简体   繁体   中英

How to get the tokenids of certain ERC721 tokens for a adress? using Web3py

A known way:

  1. call balanceOf to get the number of tokens owned by the address call
  2. Call tokenOfOwnerByIndex in a loop to get each owned token ID.

But what I'm very confused about is what to do when the ERC721 contract has not included tokenOfOwnerByIndex function

tokenOfOwnerByIndex is what most token will provide for you to enumerate in, but you could use Transfer event on that contract to do that also

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM