# Solana Send SPL Tokens Tool

#### Solana Send SPL Tokens Tool (`solana_send_spl_tokens_tool`)

Performs an **on-chain transaction** to send a specified amount of a specific SPL token (like USDC, Bonk, etc.) from the agent's (user's) wallet to a recipient's Solana address. Exercise extreme caution as this involves real fund transfers.

{% hint style="info" %}
**Inputs:** Requires sender's wallet, recipient, token details, and amount.
{% endhint %}

```python
class SolanaSendSplTokensInput(BaseModel):
    agent_public: str      # Sender's public key
    agent_private: str     # Sender's ENCRYPTED private key
    recipient_address: str # Recipient's Solana address
    token_address: str     # SPL token mint address (e.g., for USDC)
    amount: float          # Amount of the token to send
```

***

**Key Functionality:**

* Securely decrypts the sender's private key.
* Validates the amount and checks the sender's balance for the specified SPL token.
* Handles Associated Token Account (ATA) creation for the recipient if one doesn't exist.
* Constructs and sends a versioned transaction to the Solana network for the SPL token transfer.
* Returns a confirmation with the transaction signature and an explorer link on success.

***

**Sample Usage Queries (How an AI might use it):** *(These imply the agent has access to or will securely prompt for necessary wallet details, and can use a token identification tool to get `token_address` if a name like "USDC" or "LUMO" is given.)*

* "Send 100 USDC to `RecipientPublicKeyHere` from my wallet."
* "Transfer 500 Bonk from my account to `FriendAddress`."
* "I need to send 25.5 of token `TokenMintAddressHere` to `DestinationAddress`."
* "Initiate a payment of 1000 LUMO to address `Z`."
* "Execute a transaction: send `75` FARTCOIN to `AnotherWalletAddress`."
* "Help me send some GOAT tokens from my wallet." (Agent would then gather all parameters)
* "Send `AmountX` of `$TOKEN_SYMBOL` to `wallet_address`."

***

**Quick Code Glance:**

```python
class SolanaSendSplTokensTool(BaseTool):
    name: ClassVar[str] = "solana_send_spl_tokens_tool"
    description: ClassVar[str] = "Send SPL tokens from agent wallet to a specified Solana address."
    args_schema: ClassVar[Type[BaseModel]] = SolanaSendSplTokensInput
```

***

**⚠️ CRITICAL INFORMATION & SECURITY:**

* **Real Transactions:** This tool executes actual SPL token transfers on the Solana blockchain. **Transactions are irreversible.**
* **Encrypted Private Key:** Requires the agent's **encrypted** private key. The security of the encryption/decryption mechanism is vital.
* **Token & Wallet Addresses:** Ensure correct SPL token mint address and recipient wallet address are used.
* **Network Dependent:** Relies on a connection to a Solana RPC node (`CONFIG.SOLANA_RPC_URL`).
* **Asynchronous:** Primarily designed for asynchronous execution (`_arun`).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.lumolabs.ai/tools/solana-send-spl-tokens-tool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
