Repository navigation
Get NFTs by account #2017
Replies: 1 comment 2 replies
|
To obtain the ERC-1155 balance for a particular token, query its owners and read the matching owner's quantity: const { owners } = await sdk.api.nfts.getNFTOwners(
contractAddress,
tokenId,
Chain.Mainnet,
)
const holding = owners.find(
owner => owner.address.toLowerCase() === account.toLowerCase(),
)
console.log(holding?.quantityString ?? holding?.quantity ?? 0)For a trust-minimized/current value, you can also call the ERC-1155 contract's If you already mean the returned owner's |
Uh oh!
There was an error while loading. Please reload this page.
When you use the "Get NFTs by account" api call it perfectly gives output of how many nfts are owned by the owner for ERC721 contracts! but for Erc1155 contracts it only gives output of 1 no matter how many the owner is holding. Please solve this
All reactions