This API method helps you to get transfers for any fromAddress, toAddress, contractAddress, etc.
Supported on BSC and ETH mainnet only.
Parameters
category
- example: List [ "external", "20" ]; ------ external, internal; 20, 721, 1155;fromBlock
- hexadecimal string or latest.toBlock
- hexadecimal string or latest.addresses
- address, must not be nulladdressType
- option: from, to, contract, null if all of addressTypeorder
- option: asc or descexcludeZeroValue
- boolean, true for excluding zero value data, false for all datamaxCount
- hex encoded value, define once request return data count, max value:0x3E8PageKey
- uuid for pagination. If more results are available, a uuid pageKey will be returned in the response. Pass that uuid into pageKey to fetch the next maxCount. For first page, don't need this param.
Returns
PageKey
- string, page key for next page querytransfers
- detailscategory
- external or internalblockNum
- numberfrom
- string, from addresssto
- string, to addressvalue
- hexadecimal string, raw transfer valueerc721TokenId
- 32-byte fixed-length hexadecimal stringerc1155MetaData
- string, page key for next page querytokenId
- hexadecimal stringvalue
- hexadecimal string, raw transfer value
asset
- ETH/BNB or the token's symbol. null if not defined in the contract and not available from other sources.hash
- string, transaction hashcontractAddress
- contract address (hex string). null if external transferdecimal
- contract decimal (hex string). null if not defined in the contract and not available from other sources.blockTimestamp
- timestamp of the block from which the transaction event originatedgasPrice
- gas price for external transfer, not return when category is othersgasUsed
- gas used for external transfer, not return when category is othersreceiptsStatus
- receipt status, 1 is success,0 is failed
API Endpoint
The format of a MegaNode API endpoint is https://{chain}-{network}.nodereal.io/v1/{API-key}
Here is an example:
https://bsc-mainnet.nodereal.io/v1/4c0a1c23661a4e26bcbcwed461e34ea9
For other chains or networks, you could refer to this guidance Find API key & endpoint.
Example
Request
curl https://eth-mainnet.nodereal.io/v1/your-api-key \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nr_getTransactionByAddress","params":[{"category": ["external","20"],"addressType": "from","address": "0xd7cdba6d6fa60a0aa9518dc0dacd0ad896cc02bd","order": "asc","excludeZeroValue": false,"maxCount": "0x5","fromBlock": "0x4","toBlock": "0x615856d7","pageKey": "qg000000-0075-RyKy-efk2-Fx9n32gAu432"}],"id":1}'
Result
{
"id": "1",
"jsonrpc": "2.0",
"result": {
"pageKey": "qh000000-0X5j-WSqq-mCLq-kPfWRH8B1GPS",
"transfers": [
{
"category": "external",
"blockNum": "0x6c92dd",
"from": "0x646eafba97ec6ee7631887cdee468b323dd65d4f",
"to": "0x8f07f7312f3ede8b0094f09ab1554c8d89f47ddf",
"value": "0x0",
"asset": "BNB",
"hash": "0xf7605ce61c1855348cde8512d752265a8cbbf57e0ac4c8bc259155f8c1592838",
"blockTimeStamp": 1620089457,
"gasPrice": 5000000000,
"gasUsed": 35813,
"receiptsStatus": 1
}
]
}
}