获取给定 NFT 合约的当前代币所有者
我正在尝试交叉引用我的本地数据库并确认 NFT 代币的所有权。我有合约地址和用户钱包地址,我试图获取该用户为该给定合约拥有的所有当前代币的返回数组。如果我访问 etherscan 合约页面,我可以手动输入给定钱包的地址并获取我需要的内容:
是否有一个简单的 API 可以用来获取合约下所有代币的当前所有者?我尝试了下面 Etherscan 的 api,但它不会返回当前所有权,而是返回交易列表。
<一href="https://api-rinkeby.etherscan.io/api?module=account&action=tokennfttx&contractaddress=0x1481e948f2cc7886D454532714D011A7D8e9ec2e&ad衣服=0xe93FBC84f5743Ec68a03260f4A9A23c708593d02&page=1&offset=10000&startblock=0&endblock=27025780&sort=asc&apikey=$myapikey" rel="nofollow noreferrer">https://api-rinkeby.etherscan.io/api?module=account&action=tokennfttx&contractaddress=0x1481e948f2cc7886D454532714D011A7D8e9ec2e&a地址=0xe93FBC84f5743Ec68a03260f4A9A23c708593d02&page=1&offset=10000&startblock=0&endblock=27025780&sort=asc&apikey=$myapikey
I am attempting to cross-reference my local database and confirm ownership of an NFT token. I have the contract address and the users wallet address and Im trying to get a returned array of all current tokens owned by that user for that given contract. If I visit the etherscan contract page I can manually enter the address of the given wallet and get just what I need:
Is there a simple API I can use to get just the current owner of all tokens under a contract? I tried the api from Etherscan below however that doesn't return current ownership, but a list of the transactions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用 OpenSea 的检索资产端点。
这将返回给定用户资产的数组。
另一种选择是 使用 Etherscan API 按地址获取“ERC721 - 代币转移事件”列表
这将返回给定用户已进行的交易的数组。
希望这有帮助!
Try using to OpenSea's Retrieving assets endpoint.
This returns an array of a given user's assets.
Another option is to Get a list of 'ERC721 - Token Transfer Events' by Address using Etherscan API
This returns an array of transactions a given user has made.
Hope this helps!
您可以使用一个简单的工具 holders.at 获取并导出任何区块的所有 NFT 代币持有者。它支持以太坊和Polygon集合。
You can use a simple tool holders.at to take and export all NFT token holders at any block. It supports Ethereum and Polygon collections.