Trait MultiTokenEnumeration

Source
pub trait MultiTokenEnumeration {
    // Required methods
    fn mt_tokens(
        &self,
        from_index: Option<U128>,
        limit: Option<u32>,
    ) -> Vec<Token>;
    fn mt_tokens_for_owner(
        &self,
        account_id: AccountId,
        from_index: Option<U128>,
        limit: Option<u32>,
    ) -> Vec<Token>;
}
Expand description

A trait representing the multi-token enumeration standard.

Required Methods§

Source

fn mt_tokens(&self, from_index: Option<U128>, limit: Option<u32>) -> 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 return
  • limit: the maximum number of tokens to return

Returns an array of Token objects, as described in the Core standard, and an empty array if there are no tokens

Source

fn mt_tokens_for_owner( &self, account_id: AccountId, from_index: Option<U128>, limit: Option<u32>, ) -> Vec<Token>

Get list of all tokens owned by a given account

Arguments:

  • account_id: a valid NEAR account
  • from_index: a string representing an unsigned 128-bit integer, representing the starting index of tokens to return
  • limit: the maximum number of tokens to return

Returns a paginated list of all tokens owned by this account, and an empty array if there are no tokens

Implementors§