erc20_balanceChangedList
The erc20_balanceChangedList API allows you to easily fetch historical balance for any address without having to scan the entire chain.
You can specify the contract address and account address, then you can obtain all the changed balance of the account address. If you don't specify the block number, the API can return all the the changed balance for the account address order by block number desc.
Supported on Ethereum.

Parameters

Object - An object with the following fields (required):
  • contractAddress(hex string, required) - the contract address for ERC20 token.
  • accountAddress(hex string, required) - the account address you want to query.
  • fromBlockNumber(integer number, optional) - the starting time range you want to fetch events over.
  • toBlockNumber(integer number, optional) - the ending time range you want to fetch events over.
  • pageSize(integer number, optional, default 100) - max number of results to return per call.
  • pageIndex(integer number, optional, default 1) - page index.

Returns

Object - An object with the following fields:
  • Response Payload:
    • id(integer number) - json-rpc id.
    • jsonrpc(string) - json-rpc version.
    • result(object) - an object with the following fields:
      • nextPageIndex(integer number) - next page (if exists, else blank).
      • data(array of objects, defined below) - response datas, sorted in ascending order by block number.
    • Object schema:
      • blockNumber(integer number) - the block that the transaction was included in.
      • value(string) - balance value (the unit is wei).

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_balanceChangedList",
"params": {
"contractAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"accountAddress":"0x02D436DC483f445f63Aac45b37db0eE661949842",
"pageSize": 3,
"pageIndex": 1
}
}'

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"accountAddress": "0x02D436DC483f445f63Aac45b37db0eE661949842",
"blockNumber": 15530802,
"value": "6489858594957524535"
},
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"accountAddress": "0x02D436DC483f445f63Aac45b37db0eE661949842",
"blockNumber": 15527693,
"value": "6419858594957524535"
},
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"accountAddress": "0x02D436DC483f445f63Aac45b37db0eE661949842",
"blockNumber": 15515260,
"value": "6270108594957524535"
}
],
"nextPageIndex": 2
}
}
Copy link
Outline
Parameters
Returns
Example
Request
Result