var Contract = require('web3-eth-contract');
Contract.setProvider('wss://polygon-mainnet.blastapi.io/1160f5ab-4dfa-4ac1-aec4-12c7214ee252');
//jsonInterface:Contract ABI,address:Contract Address
var myContract = new Contract(jsonInterface,address);
JsonInterface can be viewed in the blockchain browser, such as the polygon example:
Query NFT Count of ERC1155
//walletAddress:Wallet Address,tokenId:TokenId of ERC1155 NFT
myContract.methods["balanceOf"](walletAddress,tokenId).call({})
.then(function(result){
///Return the number of tokenIds held
});
{
"name": "Pallet Genesis",
"description": "Pallet Genesis NFT is linked to user’s Pallet wallet address with plenty of benefits and privileges like - Free-mint NFT, airdrops, discounts in coming campaigns or activities on Pallet",
"image": "https://static.pallet.zone/genesis/pallet.webp"
}