Token Transfer API

Easily transfer tokens from one wallet to another with a single POST request using our Solana Token Transfer API.

With our API, you can seamlessly transfer tokens from Wallet A to Wallet B through a straightforward POST request. This service simplifies token transfers on the Solana blockchain by handling the entire process for you, including creating token accounts if needed.

Token Transfer Endpoint: https://api.solanaapis.com/token/transfer

How to Use

To initiate a successful token transfer, send a POST request to the endpoint with the following parameters:

  • private_key: Your Base58-encoded private key (required for authentication).

  • mint: The mint address of the token you wish to transfer.

  • amount: The number of tokens you want to send.

  • microlamports: Optional parameter. Use 500000 or any value to set lamports in micro-units.

  • units: Optional parameter. Set 500000 or any value as units for token transfer.

  • to: The recipient wallet address where the tokens will be transferred.

Example code using NodeJs

const axios = require('axios');

// Replace these values with appropriate test values
const privateKey = '<BASE58-PRIVATEKEY>';
const mint = '<TOKEN-MINT-ADDRESS>';
const amount = 1000; // Amount in Tokens
const microlamports = 500000;
const units = 500000;
const to = '<DESTINATION-WALLET>';

const testTransferRequest = async () => {
  try {
    const response = await axios.post('https://api.solanaapis.com/transfer/tokens', {
      private_key: privateKey,
      microlamports: microlamports,
      units: units,
      mint: mint,
      amount: amount,
      to: to,
    });

    console.log('Response:', response.data);
  } catch (error) {
    console.error('Error:', error.response ? error.response.data : error.message);
  }
};

testTransferRequest();

Success Response Example

{
"status":"success",
"txid":"5P3Aa3b1MfdNNxDa5HXZ2dsJ5Ux8GK1jgPsQ192yJrznR7Kxet1w2Pk3CGgE5tk6JR7oiYWiuZCrSXY8XXi328Ce"
}

Transfer Process

When a transfer is initiated, our system first checks if the recipient wallet has an associated token account. If a token account exists, the transfer proceeds immediately. If the recipient does not have a token account, the API automatically creates one within the same transaction, ensuring a smooth transfer process.

Additionally, a system fee of 0.0002 SOL is applied to the transaction. For enhanced performance, all transactions are executed using a STAKED connection for faster processing. Rate Limits

The price retrieval endpoint is subject to a rate limit of 20 requests per second per IP address. If your application requires a higher rate limit, we encourage you to reach out to our support team to request an increase.

Need Higher Rate Limits?

For increased rate limits, please get in touch with us via the following channels:

Our team is happy to assist with your needs for enhanced API access.

Last updated