watch_getTransfers
This method allows you to receive transfers by certain block parameters, smart contracts or transfer types: trx, erc20, erc721. This method can be useful to watch all transfers for certain tokens or certain blocks

Parameters

Object - An object with the following fields
  1. 1.
    fromBlock (optional): QUANTITY - the minimum block number from where to get the transactions
  2. 2.
    toBlock (optional): QUANTITY - the maximum block number from where to get the transactions.
  3. 3.
    transferType (optional): DATA - transfer type (trx/erc20/erc721)
  4. 4.
    contractAddresses(optional): DATA, 20 Bytes - contract address (i.e. 0x1a2b3x) or array of contract addresses
  5. 5.
    offset(optional): QUANTITY - offset.
  6. 6.
    limit(optional): QUANTITY - limit
"params": [
{
"contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"fromBlock": 14046400,
"toBlock": 14049300,
"offset": 1,
"limit": 10
}
]

Returns

  • Array - The list of all the transfers
  • Object schema:
  1. 1.
    blockNumber: : QUANTITY - the block number. null when its pending block.
  2. 2.
    blockTimestamp: DATETIME - the UTC DATETIME for when the block was collated.
  3. 3.
    transactionHash: DATA, 32 Bytes - hash of the transaction.
  4. 4.
    transactionIndex: QUANTITY - index of transactions in block
  5. 5.
    logIndex: QUANTITY - index of transaction logs
  6. 6.
    contractAddress: DATA, 20 Bytes - contract address (i.e. 0x1a2b3x)
  7. 7.
    transferType: DATA, transfer type (trx/erc20/erc721)
  8. 8.
    from: DATA, 20 Bytes - address of the sender.
  9. 9.
    to: DATA, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
  10. 10.
    value: QUANTITY - value transferred.
  11. 11.
    fee: QUANTITY- fee of the transaction.
  12. 12.
    asset: DATA- ETH or the token's symbol. null if not defined in the contract and not available from our sources.
  13. 13.
    decimals: QUANTITY - contract decimal. null if not defined in the contract and not available from other sources.
  14. 14.
    error (optional):BOOLEAN - True, if the transaction was made with an error
Request
Curl
Postman
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"id": 1, "method": "watch_getTransfers", "jsonrpc": "2.0", "params": ["contractAddresses": "0xdac17f958d2ee523a2206206994597c13d831ec7","fromBlock": 14046400,"toBlock": 14049300,"offset": 1,"limit": 10}]}'
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body:
{
"id": 1,
"method": "watch_getTransfers",
"jsonrpc": "2.0",
"params": [
{
"contractAddresses": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"fromBlock": 14046400,
"toBlock": 14049300,
"offset": 1,
"limit": 10
}
]
}
Response
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"blockNumber": 14046400,
"blockTimestamp": "2022-01-21T03:01:52",
"transactionHash": "0x2d26ccfaa37f5100c920c2991959df0f486baf4d72a73777b99286ceca133f5f",
"transactionIndex": 11,
"logIndex": 3,
"contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"transferType": "erc20transfer",
"from": "0x56eddb7aa87536c09ccc2793473599fd21a8b17f",
"to": "0xf450719d9a03955d24b73ed0d8b28be09b5cec4d",
"value": 396400000,
"fee": 12072919000000000,
"asset": "USDT",
"decimals": 6
}
]
}
Copy link