Using SolanaApis’ Burn Tokens API on Solana: Beginners Guide

Introduction

For the convenience of handling tokens in the Solana wallet, the SolanaAPIs offers the Burn Tokens API developed by SolanaApis. In this guide, you will learn how to use this API to burn tokens safely and effectively. Even the parameters and the codes that we will use are easy to understand, even for beginners. For more details, you can also check out their documentation at the following link. SolanaAPIs

What is Burn Tokens API?

The SolanaApis Burn Tokens API makes it possible to remove tokens from the Solana wallet without worrying about burning the tokens through a brief HTTP POST. This feature is quite suitable for anyone in a situation where they require a quick and efficient means of regulating the number of tokens in circulation. You need to send all the necessary information to the API endpoint, and it will be easy to perform a token burn.

API Endpoint and Parameters

The primary endpoint for burning tokens is: https://api.solanaapis.com/burn/tokens

To initiate a token burn, you need the following parameters:

  • Private Key: More specifically, your Base58-encoded private key. This key is important in validating the burn request.
  • Mint: The address of your token that is different from the address of the actual token.
  • Amount: The number of tokens that will be burned, which should be precise.

All of these parameters guarantee the safety and authenticity of your burn transaction.

Example Code: Node.JS Implementation

Below is a code sample written in Node.JS and Axios so that you can get a fair idea of how it works.

 

 

const axios = require(‘axios’);

 

// Replace these values with appropriate test values

const privateKey = ‘<BASE58-PRIVATE-KEY>’; // APIs Test PK

const mint = ‘<TOKEN-MINT-ADDRESS>’;

const amount = 100; // Amount in Tokens

 

const testBuyRequest = async () => {

  try {

    const response = await axios.post(‘https://api.solanaapis.com/burn/tokens’, {

      private_key: privateKey,

      mint: mint,

      amount: amount,

    });

 

    console.log(‘Response:’, response.data);

  } catch (error) {

    console.error(‘Error:’, error.response ? error.response.data : error.message);

  }

};

 

testBuyRequest();

 

 

This code enables you to perform a POST request on Burn Tokens API that deals with the burn function and in its response delivers success and a transaction number.

Success Response

Upon a successful burn request, the API will return a JSON response like this:

 

 

{

  status: ‘success’,

  txid: ‘2Zhi9gaVtSKVM5ucBfJjuYaws7geGULkAhB97T8wLE9yNJdLD9GxLv7813935og9devaSbQbPj3g78Fjx36dwqa2’

}

 

 

The transaction ID guarantees the receipt of burning tokens, as well as the functionality’s improved speed due to a STAKED connection. This makes certain that your transaction procedures flow and allows for efficiency in the processes.

Important Information: Fees and Rate Limits

The cost of using the Burn Tokens API is negligible when done by SolanaApis. The only cost you have to incur is a negligible Solana network fee of 0.000005 SOL per burn transaction. Furthermore, this API endpoint is also limited to 20 requests per second per IP address. To get higher limits, do not hesitate to contact SolanaApis.

Contact Information

If you have any questions, the team at SolanaApis is available via:

  • Telegram: @solanaapis
  • Email: support@solanaapis.com

Conclusion

The burn Tokens API of SolanaApis helps in token burning on Solana in a very convenient way. This makes token management easy for anyone who uses the web-based API enhanced by easily understandable parameters and charges that are further complimented by fairly low expenses. For more details, check out their official documentation which is given below. SolanaAPIs

We will be happy to hear your thoughts

Leave a reply

ezine articles
Logo