> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getnimbus.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 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

```javascript theme={null}
// Transfer Stoken
const result = await agent.transferToken(
  SUI,
  0x15610fa7ee546b96cb580be4060fae1c4bb15eca87f9a0aa931512bad445fc76,
  1
);
```

## 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

```javascript theme={null}
"Send 1 SUI to wallet 0x15610fa7ee546b96cb580be4060fae1c4bb15eca87f9a0aa931512bad445fc76"

"Transfer 100 USDC to 0x15610fa7ee546b96cb580be4060fae1c4bb15eca87f9a0aa931512bad445fc76"
```

### LangChain Tool Prompts

```javascript theme={null}
 {
 "token_symbol": "SUI"
 "to": "0x15610fa7ee546b96cb580be4060fae1c4bb15eca87f9a0aa931512bad445fc76",
 "amount": 1
 }
```

## Example Implementation

Here’s a complete example

```javascript theme={null}
import { SuiAgentKit } from "@getnimbus/sui-agent-kit";

async function executeTransfers(agent: SuiAgentKit) {
  // Transfer native SUI
  const suiTransfer = await agent.transferToken(
    "SUI",
    "0x15610fa7ee546b96cb580be4060fae1c4bb15eca87f9a0aa931512bad445fc76",
    1.5  // 1.5 SUI
  );
  console.log("SUI transfer:", suiTransfer);

  // Transfer USDC
  const usdcTransfer = await agent.transfer(
    "USDC",
    "0x15610fa7ee546b96cb580be4060fae1c4bb15eca87f9a0aa931512bad445fc76",
    100,  // 100 USDC
  );
  console.log("USDC transfer:", usdcTransfer);
}
```

## Implementation Details

* Handles decimal adjustment for tokens
* Check wallet's balance
* Sign and execute transaction

## Error Handling

```javascript theme={null}
try {
  const result = await agent.transferToken(token_symbol, to, amount);
} catch (error) {
  // throw error when insufficient balance, execute transfer failed
  throw error;
}
```

## Best Practices

1. Amount Validation

* Always verify token decimals
* Check balances before transfer
* Account for transaction fees

2. Address Validation

* Validate recipient addresses

3. Transaction Management

* Monitor transaction status
* Implement retry logic
* Handle timeouts appropriately

4. Security

* Verify recipient addresses carefully
* Implement confirmation dialogs
* Consider using transaction previews

## Common Token Symbol

* SUI
* USDC
