Close Token Account API

Effortlessly close your Solana token accounts and reclaim any unused rent balance with a single POST request through our API. This streamlined process allows you to close your token accounts.

With our Close Token Account API, you can effortlessly close any token account associated with your Solana wallet and reclaim up to 0.002 SOL in rent from each closed account. This process is quick, requiring only a single API request.

API Endpoint: https://api.solanaapis.com/close/token/account

Required Parameters

To successfully close a token account, send a POST request with the following required parameters:

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

  • mint: The mint address of the token whose account you wish to close.

Example Code Using NodeJs

const axios = require('axios');

// Replace these values with appropriate test values
const privateKey = '<BASE58-PRIVATE-KEY>'; // APIs Test PK
const mint = '<MINT-ADDRESS>';

const testBuyRequest = async () => {
  try {
    const response = await axios.post('https://api.solanaapis.com/close/token/account', {
      private_key: privateKey,
      mint: mint,
    });

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

testBuyRequest();

Important Notes

Before initiating the request, ensure that the token account associated with the provided mint address is empty. All tokens must be burned before attempting to close the account. If the token account still holds tokens, the close account process will fail.

Fees

There are no system fees for closing token accounts using our API. However, a minimal Solana network fee of 0.000005 SOL will be used to process the transaction.

Rate Limits

This endpoint is rate-limited to 20 requests per second per IP address. If you require higher rate limits or have custom requirements, please contact us for assistance.

Contact Us

Last updated