sui-client
Original:🇺🇸 English
Translated
8 scripts
Comprehensive SuiClient skill for interacting with the Sui blockchain using @mysten/sui SDK. Use this skill when you need to connect to Sui blockchain, read data, execute transactions, manage staking positions, or query network information.
10installs
Sourcerandypen/sui-eco-skills
Added on
NPX Install
npx skill4agent add randypen/sui-eco-skills sui-clientTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →SuiClient Skill
A comprehensive Claude Code skill for interacting with the Sui blockchain using the official SDK.
@mysten/suiInstructions
Use this skill when you need to interact with the Sui blockchain. Includes:
- Network Connection: Connect to mainnet, testnet, devnet, or localnet
- Data Reading: Get tokens, objects, transactions, and balances
- Transaction Execution: Build, sign, and execute transactions
- Network Information: Get system state, gas prices, and protocol configuration
- Move Package Interactions: Query normalized Move data
- Event Handling: Query and subscribe to blockchain events
- Staking Operations: Manage staking positions
- Error Handling: Implement comprehensive error handling patterns
Quick Start
typescript
import { SuiClient } from '@mysten/sui/client';
// Connect to mainnet
const client = new SuiClient({
url: 'https://sui-mainnet.nodeinfra.com'
});
// Get account balance
const balance = await client.getBalance({
owner: '0x123...',
coinType: '0x2::sui::SUI'
});Installation
bash
# Install the skill
claude skills install sui-client
# Install dependencies
bun add @mysten/suiFeatures
- Client Management: Connect to mainnet, testnet, devnet, and localnet
- Data Reading: Get tokens, objects, transactions, and balances
- Transaction Execution: Build, sign, and execute transactions
- Network Information: Get system state, gas prices, and protocol configuration
- Move Package Interactions: Query normalized Move data
- Event Handling: Query and subscribe to blockchain events
- Staking Operations: Manage staking positions
- Error Handling: Comprehensive error handling patterns
Examples
Check the directory for complete usage examples:
examples/- - Basic client setup and data reading
basic-usage.ts - - Transaction building and execution
transactions.ts - - Advanced patterns and error handling
advanced.ts
API Reference
This skill provides comprehensive coverage of the SuiClient API including:
- Reading Data: ,
getObject(),getCoins()getTransactionBlock() - Writing Data: ,
signAndExecuteTransaction()executeTransactionBlock() - Network Information: ,
getLatestSuiSystemState()getReferenceGasPrice() - Events: ,
queryEvents()subscribeEvent() - Staking: ,
getStakes()getStakesByIds()
Detailed Documentation
- Source Code - Complete SuiClient API implementation
- Type Definitions - TypeScript type definitions
- Code Templates - Common code templates
- Example Code - Complete usage examples
Dependencies
- : ^1.45.0 (managed via package.json)
@mysten/sui
Contributing
Contributions are welcome! Please see the CONTRIBUTING.md file for details.
License
MIT