erc20_totalSupply
Returns erc20 total supply info of contract.
You can specify the contract address and block number, then you can obtain the total supply of the token at the block number you enter. If you don't specify the block number, the API can return all the total supply in that erc20 contract.
Supported on Ethereum, Optimism, and Arbitrum.

Parameters

Object - An object with the following fields (required):
  • contractAddress(hex string, required) - the contract address for ERC20 token.
  • blockNumber(integer number, optional) - the blockNumber for snapshot query (default latest). BlockVision can not only support users to query the current information, but also support users to query the historical information at any time.

Returns

Object - An object with the following fields:
  • id(integer number) - json-rpc id.
  • jsonrpc(string) - json-rpc version.
  • result(object) - an object with the following fields:
  • Object schema:
    • totalSupply(string) - total Supply information of the erc20 contract. The data returned by BlockVision is the original data of the contract. Divide it by the decimal of the contract to get the "real" data.

Example

Request

curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"id": 1,
"jsonrpc": "2.0",
"method": "erc20_totalSupply",
"params": {
"contractAddress": "0x8C6bf16C273636523C29Db7DB04396143770F6A0",
"blockNumber": 0
}
}'

Result

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"totalSupply": "10795329961214869504"
}
}
Copy link
Outline
Parameters
Returns
Example
Request
Result