This API method helps you to get the token balance for ERC1155/BEP1155.
Supported on BSC and ETH mainnet only.
Parameters
Token Address
- The address of the ERC1155/BEP1155 tokenAccount Address
- Account address whose balance will be checkedBlock Number
- The block number in hex format or the string 'latest' or 'earliest' on which the balance will be checkedToken Id
- The tokenId in hex format of the ERC1155/BEP1155 token
Returns
Balance
- The balance of the address
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://bsc-mainnet.nodereal.io/v1/your-api-key \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nr_getTokenBalance1155","params":["0x98387108842a7CfC7bA23E080030351f6ea68ac0", "0x38767ebadf9b4f9302c5cb88be9a3426234bc9a5", "0x1333EF1", "0x1"],"id": 1 }'
Result
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x000000000000000000000000000000000000000000000000000000000000006c"
}