Token Operations
Transfer Tokens
Learn how to transfer tokens to other wallets
Transfer tokens to another wallet address. This function automatically manages both native SUI and other token transfers, ensuring proper decimal adjustments.
Usage
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token_symbol | string | Yes | Symbol of the token to transfer |
to | string | Yes | Wallet address to transfer to |
amount | number | Yes | Amount to be transferred |
Example Prompts
Natural Language Prompts
LangChain Tool Prompts
Example Implementation
Here’s a complete example
Implementation Details
- Handles decimal adjustment for tokens
- Check wallet’s balance
- Sign and execute transaction
Error Handling
Best Practices
- Amount Validation
- Always verify token decimals
- Check balances before transfer
- Account for transaction fees
- Address Validation
- Validate recipient addresses
- Transaction Management
- Monitor transaction status
- Implement retry logic
- Handle timeouts appropriately
- Security
- Verify recipient addresses carefully
- Implement confirmation dialogs
- Consider using transaction previews
Common Token Symbol
- SUI
- USDC