enumeration methods need self
@@ -3,7 +3,7 @@ use near_sdk::json_types::U128;
pub trait NonFungibleTokenEnumeration {
/// 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.
- fn nft_total_supply() -> U128;
+ fn nft_total_supply(self) -> U128;
/// Get a list of all tokens
///
@@ -14,6 +14,7 @@ pub trait NonFungibleTokenEnumeration {
///
/// Returns an array of Token objects, as described in Core standard
fn nft_tokens(
+ self,
from_index: Option<String>, // default: "0"
limit: Option<u64>, // default: unlimited (could fail due to gas limit)
) -> Vec<Token>;
@@ -26,7 +27,7 @@ pub trait NonFungibleTokenEnumeration {
/// 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.
- fn nft_supply_for_owner(account_id: String) -> String;
+ fn nft_supply_for_owner(self, account_id: String) -> String;
/// Get list of all tokens owned by a given account
///
@@ -38,6 +39,7 @@ pub trait NonFungibleTokenEnumeration {
///
/// Returns a paginated list of all tokens owned by this account
fn nft_tokens_for_owner(
+ self,
account_id: String,
from_index: Option<String>, // default: 0
limit: Option<number>, // default: unlimited (could fail due to gas limit)
