getTokenTransfers

Get all token transfers for a given ERC20 token contract address in reverse chronological order (most recent first)

Efficiently access and retrieve all token transfers for a specified ERC20 token contract address, ordered in reverse chronological order (most recent transfers first), using the getTokenTransfers method. This documentation page provides valuable insights into how to utilize this method, allowing developers to seamlessly access and analyze token transfer data within their applications or projects.

How to use getTokenMetadata method ?

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

Parameters

Below, you can find the query parameters accepted by the method.

ParameterTypeDescription

contractAddress *

string

The token contract address.

fromBlock

string

Starting block for the query.

toBlock

string

Ending block for the query.

pageSize

integer

Number of records to be retrieved on one page.

pageKey

string

Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response.

Returns

Discover an insightful explanation of the returned parameters here, offering a deep understanding of their significance and implications.

ParameterTypeDescription

contractAddress

string

The token contract address.

contractDecimals

string

Token decimals specified in the contract.

contractName

string

The name of the token.

contractSymbols

string

The symbol of the token.

count

integer

The number of transfers.

nextPageKey

string

Key to get the next page of results if more are available.

tokenTransfers

array

The array of Token Transfers for the specified token contract.

fromAddress

string

The wallet address from which tokens were transferred.

toAddress

string

Destination wallet address.

value

string

The amount of tokens to be transferred.

blockHash

string

The hash of the block in which the transfer transaction was executed.

blockNumber

integer

The height of the block in which the transfer transaction was executed.

blockTimestamp

string

The timestamp of the block in which the transfer transaction was executed.

transactionHash

string

The hash of the token transfer transaction.

transactionIndex

integer

The number of the token transfer transaction.

logIndex

integer

The index of the transaction log.

Example Request and Result for getTokenTransfers

In this section, we provide an illustrative example of a request made to retrieve token transfers for a specific ERC20 token contract address using the getTokenTransfers method. The example request demonstrates how to specify the contract address, fromBlock, toBlock, pageSize, and pageKey parameters to customize your query.

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!

Returns all token transfers for a given ERC20 token contract address in reverse chronological orde

GET https://starknet-mainnet.blastapi.io/<project-id>/builder/getTokenTransfers

Query Parameters

NameTypeDescription

contractAddress*

String

0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7

fromBlock

String

515111

toBlock

String

515113

{
  "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
  "contractDecimals": "18",
  "contractName": "Ether",
  "contractSymbol": "ETH",
  "count": 100,
  "nextPageKey": "ZTYwZDg3YWJkNTIwOjE3MDU5NjI3MzY6NTE1MTEzOjIzMzpFdGhlcjpFVEg6MTg",
  "tokenTransfers": [
    {
      "fromAddress": "0x06486b80b103bb5bffb5909c2d029dfb1ed0ef320f545cca339b32d975c72452",
      "toAddress": "0x01176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8",
      "value": "54094989199810",
      "blockHash": "0x0221ea2421b883bff86b3112b70c84bdf41af9bb9f06667f675c4606d521787a",
      "blockNumber": 515113,
      "blockTimestamp": "2024-01-22T20:22:07.000Z",
      "transactionHash": "0x0589506564c8c42f89068562b07c38386b768ebf3c0504b7280e2eb38c429e65"
    },
    ... ...
    {
      "fromAddress": "0x07c80fe80a887454b96273c3d94971733adafa2a366bdeee7aa0bc83a41a3eaf",
      "toAddress": "0x01176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8",
      "value": "318206359223732",
      "blockHash": "0x038a72e058f754b4e8141b64cd03f3e6dc5196e04312e49c1457ec0c8df4bc7a",
      "blockNumber": 515111,
      "blockTimestamp": "2024-01-22T20:16:40.000Z",
      "transactionHash": "0x00aab6ba3b7358baea7f364be9f16a3bea2158917bc2b25a3149cedde7d3219f"
    }
  ]
}
curl --location 'https://starknet-mainnet.blastapi.io/<project-id>/builder/getTokenTransfers?contractAddress=0x013062189dc3dcc99e9Cee714c513033b8d99e3c&pageSize=1&fromBlock=188505&toBlock=18188504'

Last updated