Skip to main content

How to get erc20 token burns

Prerequisites

Before getting started, make sure you have the following ready:

  • Node v.14+
  • NPM

Step 1: Setup Blocklens

First register your Blocklens account and get your Blocklens API Key.

Once you have your Blocklens API Key, install the Blocklens SDK in your project.

npm i blocklens-sdk

Step 2: Get ERC20 token burns

In order to get erc20 token burns, Blocklens provides you a getErc20Burns endpoint to do so.

import Blocklens from "blocklens-sdk";

const blocklens = new Blocklens();
blocklens.init({ apiKey: "YOUR_API_KEY" });

const runApis = async () => {
const response = await blocklens.ETH_MAINNET.getErc20Burns();
console.log(response);
};

runApis();

Step 3: Run the script

ts-node index.ts

In your terminal, you should see the following JSON response with the data: In your terminal, you should see the following JSON response with the data blocks:

{
"cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTgyODMyNTkwMDc5MDAwOTMwLCJwYWdlIjoxLCJpYXQiOjE2OTcwNjM0NDR9.d4yCGHxI9O1sjnY8U2u-1zFErv50XP0xQvrZwhNrwzg",
"page": 1,
"limit": 20,
"total_items": 1,
"data": [
{
"token_name": "Uniswap V2",
"token_symbol": "UNI-V2",
"token_decimals": 18,
"contract_address": "0x9ff3889bC152cC7952c4fD08c44C6C8aFAF47304",
"transaction_hash": "0x54eb4b8788cdd52de266a8843254b98e39f649dac6ff9826a4c7efdb49477c33",
"transaction_index": 81,
"log_index": 235,
"block_hash": "0x9dce9c505115b31b6afcae07d5b3ddc2bdf4ca89469682cc79cbc64fe12bce7b",
"block_number": 18283286,
"from_wallet": "0x9ff3889bC152cC7952c4fD08c44C6C8aFAF47304",
"value": "271122665965056236",
"value_decimal": "0.271122665965056236",
"timestamp": 1696496531
}
]
}

Congratulations 🥳 you just found the get erc20 token burns on multiple chains with only a few lines of code using the Blocklens Wallet API!

API Reference

If you want to know more details on the endpoint and optional parameters, check out:

Support

If you face any trouble following the tutorial, feel free to reach out to our community engineers in our Discord or Forum to get 24/7 developer support.