# sendTokensDecimal

{% hint style="warning" %}

#### Important:

This method may lead to slightly inaccurate results due to decimal roundoff error. We highly recommend using the sendTokens method ([sendTokens](/reference/sdk-reference/send-tokens.md)) instead.
{% endhint %}

```javascript
(async() => {
    await SOLPay.sendTokensDecimal("WALLET_ADDRESS", 0.00001, "TOKEN_ADDRESS"); // {"from": "...", "to": "WALLET_ADDRESS", "amount_decimal": 0.00001, "token_address": "TOKEN_ADDRESS", "signature": "..."}
    await SOLPay.sendTokensDecimal("WALLET_ADDRESS", 0.00001, "TOKEN_ADDRESS", (details) => {
        // {"from": "...", "to": "WALLET_ADDRESS", "amount_decimal": 0.00001, "token_address": "TOKEN_ADDRESS", "signature": "..."}
    }); // {"from": "...", "to": "WALLET_ADDRESS", "amount_decimal": 0.00001, "token_address": "TOKEN_ADDRESS", "signature": "..."}
})();
```

### Parameters:

* address: string - the address where the tokens should be sent
* amount\_decimal: number - the decimal amount of tokens to send
* token\_address: string - the mint address of the token
* preconfirm (optional, default: `(details) => {}`): function - a function to capture the unconfirmed and unbroadcasted transaction details before the transaction has been broadcasted and confirmed on the Solana network

### Returns:

object (`{"from": "...", "to": "WALLET_ADDRESS", "amount_decimal": 0.00001, "token_address": "TOKEN_ADDRESS", "signature": "..."}`) - the transaction details

* from: string (`"..."`) - the address from which Solana is sent
* to: string (`"..."`) - the address to which Solana is sent
* amount\_decimal: number (`0.00001`) - the amount of tokens sent
* token\_address: string(`"..."`) - the address of the token sent
* signature: string (`"..."`) - the signature of the transaction

### Throws:

* `SOL Pay SDK Fatal Error: No connection found. Use SOLPay.connectNetwork() to connect to the Solana network.` - could not find a connection to the Solana network
* `SOL Pay SDK Fatal Error: No wallet connection found. Use SOLPay.connectWallet() to connect to a Solana wallet.` - no wallet was connected
* `SOL Pay SDK Fatal Error: Unable to get recent blockhash.` - was not able to get a recent blockhash
* `SOL Pay SDK Fatal Error: SOL Pay SDK Fatal Error: Unable to broadcast transaction.` - was not able to broadcast the transaction
* `SOL Pay SDK Fatal Error: The preconfirm function returned an error, halting the transaction from being sent: ${err}` - did not send transaction because the preconfirm function could not be run to completion successfully
* `SOL Pay SDK Fatal Error: Invalid transfers ${transfers}.` - invalid transfers were used
* `SOL Pay SDK Fatal Error: Invalid serialized transaction ${serialized_transaction}.` - an invalid serialized transaction was used

{% hint style="info" %}
**Note:**

Sending a transaction includes a fee of at least 0.000005 SOL.
{% endhint %}


---

# 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://solpay-docs.solblaze.org/reference/sdk-reference/send-tokens-decimal.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.
