web3js NFT get all token ids from address
-
Example of how to get all NFT tokens IDs owned by a specific wallet address.
let toAddr = '0xAddress'; let incomingTokenTransferEvents = await MyContract.getPastEvents('Transfer', { filter: {'to': toAddr}, fromBlock: 0, toBlock: 'latest'}) incomingTokenTransferEvents.forEach( (event) => console.log(event.returnValues.tokenId));