Links

getWalletTokenHistory

Get all ERC20 tokens (with balances, including zero-value balances) the given wallet address has ever held (supports snapshotting at a specific block number)

Parameters

  • walletAddress :(string) REQUIRED - The address of the wallet
  • blockNumber: (string) OPTIONAL - Indicate the block height
  • pageSize : (integer) OPTIONAL - Number of records to be retrieved on one page
  • pageKey : (string) OPTIONAL - Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response

Returns

  • walletAddress: <string> - The address of the wallet
  • count : <integer> - The number of allowances
  • nextPageKey: <string> - Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response
  • historicalBalances: <array> - The array of Token Balance objects
    • contractAddress: <string> - The token contract address
    • contractDecimals : <string> - Token decimals specified in the contract
    • contractName: <string> - The name of the token
    • contractSymbols: <string> - The name of the token
    • balance: <string> - Token balance on the specified wallet
    • firstTransfer: <string> - Details of the transfer which updated the wallet balance for this token for the first time
      • fromAddress : <string> - Address from which the transfer originated
      • toAddress: <array> - Destination address for the transfer
      • value: <string> - Token amount
      • blockHash : <string> - The hash of the block
      • blockNumber : <integer> - The block height
      • blockTimestamp : <string> - The timestamp of the block
      • transactionHash: <string>- The hash of the transaction
      • transactionIndex: <integer> - The index of the transaction
      • logIndex : <integer> - The index of the log
    • lastTransfer: <string> - Details of the latest transfer which updated the wallet balance for this token
      • fromAddress : <string> - Address from which the transfer originated
      • toAddress: <array> - Destination address for the transfer
      • value: <string> - Token amount
      • blockHash : <string> - The hash of the block
      • blockNumber : <integer> - The block height
      • blockTimestamp : <string> - The timestamp of the block
      • transactionHash: <string>- The hash of the transaction
      • transactionIndex: <integer> - The index of the transaction
      • logIndex : <integer> - The index of the log

Example Request and Result for getWalletTokenHistory

Request
curl --location 'https://eth-mainnet.blastapi.io/<project-id>/builder/getWalletTokenHistory?walletAddress=0x58edF78281334335EfFa23101bBe3371b6a36A51'
Result
{
"walletAddress": "0x58edf78281334335effa23101bbe3371b6a36a51",
"count": 100,
"nextPageKey": "NTI5MTQzYTZjM2U4OjE2OTg3NjE0NDU6MTg0Njk3NjQ6MzA1MDAwNDE4MDAwMDAwOjE4NDcwNDYw",
"historicalBalances": [
{
"contractAddress": "0xf433089366899d83a9f26a773d59ec7ecf30355e",
"contractDecimals": "8",
"contractName": "Metal",
"contractSymbol": "MTL",
"balance": "11071425258866",
"firstTransfer": {
"fromAddress": "0xc4c688429cbbb1c5c2d77af92f8f9add1f2145e4",
"toAddress": "0x58edf78281334335effa23101bbe3371b6a36a51",
"value": "1770700000000",
"blockHash": "0xa197eb12ebae02b865075df98f2b4e944fb800d541329d321205725976dfdb9b",
"blockNumber": 18374204,
"blockTimestamp": "2023-10-18T02:16:11.000Z",
"transactionHash": "0x826c0ff04bf7ce28d4ed429f81fa5b12a65e3881e0af927353539d220d30509e",
"transactionIndex": 47,
"logIndex": 148
},
"lastTransfer": {
"fromAddress": "0x58edf78281334335effa23101bbe3371b6a36a51",
"toAddress": "0xe73bdf9bf93cb2464bd571350bcdb630e46ef8ed",
"value": "500000000000",
"blockHash": "0x582d950dea5a96c21ade45d676726afa5f65638257dc189c38022eff97c05e62",
"blockNumber": 18470460,
"blockTimestamp": "2023-10-31T13:39:35.000Z",
"transactionHash": "0xed6bd23e093f5af51b2ce11769bba02778e245dce48603037ff060612a8975e6",
"transactionIndex": 45,
"logIndex": 78
}
},
{
"contractAddress": "0x85f6eb2bd5a062f5f8560be93fb7147e16c81472",
"contractDecimals": "4",
"contractName": "Franklin",
"contractSymbol": "FLy",
"balance": "3225580594174",
"firstTransfer": {
"fromAddress": "0x738cf6903e6c4e699d1c2dd9ab8b67fcdb3121ea",
"toAddress": "0x58edf78281334335effa23101bbe3371b6a36a51",
"value": "1038071506568",
"blockHash": "0x69b39c6a754da182f746db1e9a7cc0bee6f5dfbe8c7b102cdf5aae7f221d1c5c",
"blockNumber": 18375648,
"blockTimestamp": "2023-10-18T07:06:59.000Z",
"transactionHash": "0xdb152848c691c33d8766112b0f5db317bfae7bc3cc24f0fd9d0f23ee9423af69",
"transactionIndex": 39,
"logIndex": 1436
},
"lastTransfer": {
"fromAddress": "0x58edf78281334335effa23101bbe3371b6a36a51",
"toAddress": "0x0c3de458b51a11da7d4616f42f66c861e3859d3e",
"value": "5448172529",
"blockHash": "0x582d950dea5a96c21ade45d676726afa5f65638257dc189c38022eff97c05e62",
"blockNumber": 18470460,
"blockTimestamp": "2023-10-31T13:39:35.000Z",
"transactionHash": "0x5702a10945ecb10e3123d028afec0b43411efa2b9bb53d16630875730696212a",
"transactionIndex": 43,
"logIndex": 73
}
},
```