v1

latestOpenAPI 3.1.0GPL 3.02026-07-131857173.1 KB
Chain State

Get token balance(s)

Retrieve token balance(s) for one or more addresses at given block(s). Corresponds to the <a href="/chifra/chainstate/#chifra-tokens">chifra tokens</a> command line.

get/tokens

Query parameters

addrsstring[] required

two or more addresses (one for --approvals), the first is an ERC20 token, balances for the rest are reported

blocksstring[]

an optional list of one or more blocks at which to report balances, defaults to 'latest'

approvalsboolean

returns all open approvals for the given address(es)

partsstring[]

which parts of the token information to retrieve

byAcctboolean

consider each address an ERC20 token except the last, whose balance is reported for each token

changesboolean

only report a balance when it changes from one block to the next

noZeroboolean

suppress the display of zero balance accounts

chainstring

the chain to use

noHeaderboolean

suppress the header in the output

cacheboolean

force the results of the query into the cache

decacheboolean

removes related items from the cache

fmtstring

export format, one of [ txt | csv | json ]

Response

returns the requested data

Example response

{
  "holder": "0x2910543af39aba0cd09dbb2d50200b3e800a63d2",
  "balance": "624980000000000000",
  "address": "0xbb9bc244d798123fde783fcc1c72d3bb8c189413",
  "name": "The DAO Original",
  "decimals": 1,
  "isContract": true,
  "isErc20": true,
  "isErc721": true
}