如何获取NEAR帐户中的所有NFT



假设所有NFT都遵守NEP-171规范,我如何在example.near等帐户中列出所有NFT?

我在https://docs.rs/near-contract-standards/latest/near_contract_standards/macro.impl_non_fungible_token_enumeration.html这应该是可能的。

使用NEAR CLI运行类似NEAR_ENV=testnet near view <the contract ID> nft_tokens_for_owner '{"account_id": "<the account ID>"}'的程序。

请参阅https://nomicon.io/Standards/NonFungibleToken/Enumeration.html#interface.

from_index默认为0,limit默认为无限制。

示例:

NEAR_ENV=testnet near view dev-1643292007908-55838431863482 nft_tokens_for_owner '{"account_id": "example.testnet"}'

最新更新