Ethereum icon

Ethereum

Interact with Ethereum blockchain

ERC1155 → Balance Of

AI-generated

Summary

Reads the ERC1155 token balance for a specific account and token ID

Inputs

  • contractAddress (required) — The deployed ERC1155 contract address
  • account (required) — The address whose token balance is queried
  • id (required) — The token ID (numeric) whose balance to retrieve

Output shape

a single numeric balance (as string)

If the token ID does not exist or the operation fails, the balance is omitted or null; otherwise a string representation of the uint256 balance is returned.

Examples

Example 1: Check balance of token ID 42 for an address

contractAddress: 0xABC..., account: 0x123..., id: 42

Example 2: Batch query for multiple token IDs (requires Balance Of Batch)

contractAddress: 0xABC..., account: 0x123..., id: [10, 20]

Example 3: Error case – contract address invalid

contractAddress: "", account: 0x123..., id: 1

Links

Discussion