watch_getTransfersByAddress
This method is needed to watch all transfers to certain addresses and other filters. It can be useful to receive historical wallet transfers
Parameters
Object - An object with the following fields
addresses
:DATA
, 20 Bytes - a user address (i.e.0x1a2b3x...
) or array of user addresses.fromBlock
(optional):QUANTITY
- the minimum block number from where to get the transactionstoBlock
(optional):QUANTITY
- the maximum block number from where to get the transactions.transferType
(optional):DATA
- transfer type(trx/erc20/erc721)
transferDirection
(optional):DATA
- transfer direction(from/to)
contractAddresses
(optional):DATA
, 20 Bytes - contract address (i.e.0x1a2b3x
) or list of contract addresses.offset
(optional):QUANTITY
- offset.limit
(optional):QUANTITY
- limit
"params": [
{
"addresses": "0x123f96bc8edcb73bd5b8612c1e5203f90d4628a4",
"contractAddresses": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"transferDirection": "to",
"fromBlock": 14046400,
"toBlock": 14049300,
"offset": 1,
"limit": 10
}
]
Returns
Array
- The list of all the transfersObject schema:
blockNumber: :
QUANTITY
- the block number. null when its pending block.blockTimestamp:
DATETIME
- the UTC DATETIME for when the block was collated.transactionHash:
DATA
, 32 Bytes - hash of the transaction.transactionIndex:
QUANTITY
- index of transactions in blocklogIndex:
QUANTITY
- index of transaction logscontractAddress:
DATA
, 20 Bytes - contract address (i.e.0x1a2b3x
)transferType:
DATA
, transfer type(trx/erc20/erc721)
from:
DATA
, 20 Bytes - address of the sender.to:
DATA
, 20 Bytes - address of the receiver. null when it's a contract creation transaction.value:
QUANTITY
- value transferred.fee:
QUANTITY
- fee of the transaction.asset:
DATA
-ETH
or the token's symbol.null
if not defined in the contract and not available from our sources.decimals:
QUANTITY
- contract decimal.null
if not defined in the contract and not available from other sources.error (optional):
BOOLEAN
- True, if the transaction was made with an error
Request example
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_getTransfersByAddress", "jsonrpc": "2.0", "params": [{"addresses": "0x123f96bc8edcb73bd5b8612c1e5203f90d4628a4","contractAddresses": "0xdac17f958d2ee523a2206206994597c13d831ec7","transferDirection": "to","fromBlock": 14046400,"toBlock": 14049300,"offset": 1,"limit": 10}]}'
Response
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"blockNumber": 14049260,
"blockTimestamp": "2022-01-21T13:47:35",
"transactionHash": "0x8a1258d3b31fb5ea1d51f65542f1f436e24de8eeb36726e8075e286fea6154b7",
"transactionIndex": 128,
"logIndex": 221,
"contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"transferType": "erc20transfer",
"from": "0x2819c144d5946404c0516b6f817a960db37d4929",
"to": "0x123f96bc8edcb73bd5b8612c1e5203f90d4628a4",
"value": 2165000000,
"fee": 8550565140309632,
"asset": "USDT",
"decimals": 6
}
]
}
Last updated