Links

getTokenSupply

Get the total supply for the given ERC20 token contract address (supports snapshotting at a specific block number)
The getTokenSupply method provides developers with the means to retrieve the total supply of a specific ERC20 token by specifying the contract address. Additionally, this method supports the functionality of snapshotting the total supply at a specific block number,

How to use getTokenSupply method ?

Below, you'll find an in-depth guide that provides a comprehensive explanation of how to utilize the getTokenSupply method effectively using Blast Builder API.

Parameters

Below, you can find the query parameters accepted by the method.
Parameter
Type
Description
contractAddress *
string
The token contract address
blockNumber
string
The block height for which the supply is requested

Returns

Discover an insightful explanation of the returned parameters here, offering a deep understanding of their significance and implications.
Parameter
Type
Description
totalSupply
string
The total token supply for the specified contract

Example Request and Result for getTokenSupply

In this section, you can find an illustrative example of a request made to retrieve the total supply of a specific ERC20 token contract using the getTokenSupply method. The example showcases how to use this method to obtain the total token supply, providing valuable insights into the supply status of the token at a given block height
The example in this section uses a non-existing project id.
Make sure you replace it with your Starknet endpoint when issuing the Builder API calls.
Don't have a project id? Here's a straightforward guide on how to obtain one!
get
https://starknet-mainnet.blastapi.io/<project_id>/builder/getTokenSupply
Returns the total supply for the given ERC20 token contract address
Parameters
Query
contractAddress*
0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7
Responses
200: OK
Request
curl -X GET https://starknet-mainnet.blastapi.io/<project_id>/builder/getTokenSupply?contractAddress=0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 -H 'Content-Type: application/json'
Result
{
"totalSupply": "100207279129169697046687842654"
}