Trait near_contract_standards_sbt::non_fungible_token::enumeration::NonFungibleTokenEnumeration
source · pub trait NonFungibleTokenEnumeration {
fn nft_total_supply(&self) -> U128;
fn nft_tokens(
&self,
from_index: Option<U128>,
limit: Option<u64>
) -> Vec<Token>;
fn nft_supply_for_owner(&self, account_id: AccountId) -> U128;
fn nft_tokens_for_owner(
&self,
account_id: AccountId,
from_index: Option<U128>,
limit: Option<u64>
) -> Vec<Token>;
}
Expand description
Offers methods helpful in determining account ownership of NFTs and provides a way to page through NFTs per owner, determine total supply, etc.
Required Methods§
sourcefn nft_total_supply(&self) -> U128
fn nft_total_supply(&self) -> U128
Returns the total supply of non-fungible tokens as a string representing an unsigned 128-bit integer to avoid JSON number limit of 2^53.
sourcefn nft_tokens(&self, from_index: Option<U128>, limit: Option<u64>) -> Vec<Token>
fn nft_tokens(&self, from_index: Option<U128>, limit: Option<u64>) -> Vec<Token>
Get a list of all tokens
Arguments:
from_index
: a string representing an unsigned 128-bit integer, representing the starting index of tokens to returnlimit
: the maximum number of tokens to return
Returns an array of Token objects, as described in Core standard
sourcefn nft_supply_for_owner(&self, account_id: AccountId) -> U128
fn nft_supply_for_owner(&self, account_id: AccountId) -> U128
Get number of tokens owned by a given account
Arguments:
account_id
: a valid NEAR account
Returns the number of non-fungible tokens owned by given account_id
as
a string representing the value as an unsigned 128-bit integer to avoid JSON
number limit of 2^53.
sourcefn nft_tokens_for_owner(
&self,
account_id: AccountId,
from_index: Option<U128>,
limit: Option<u64>
) -> Vec<Token>
fn nft_tokens_for_owner(
&self,
account_id: AccountId,
from_index: Option<U128>,
limit: Option<u64>
) -> Vec<Token>
Get list of all tokens owned by a given account
Arguments:
account_id
: a valid NEAR accountfrom_index
: a string representing an unsigned 128-bit integer, representing the starting index of tokens to returnlimit
: the maximum number of tokens to return
Returns a paginated list of all tokens owned by this account