Skip to content

Commit

Permalink
Added total supply as part of the enumeration standard
Browse files Browse the repository at this point in the history
  • Loading branch information
BenKurrek committed Jan 13, 2022
1 parent 95f7cba commit 783c064
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nft-contract/src/enumeration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ use crate::*;

#[near_bindgen]
impl Contract {
//Query for the total supply of NFTs on the contract
pub fn nft_total_supply(&self) -> U128 {
//return the length of the token metadata by ID
U128(self.token_metadata_by_id.len() as u128)
}

//Query for nft tokens on the contract regardless of the owner using pagination
pub fn nft_tokens(&self, from_index: Option<U128>, limit: Option<u64>) -> Vec<JsonToken> {
Expand Down
Binary file modified out/main.wasm
Binary file not shown.
Binary file modified out/market.wasm
Binary file not shown.

0 comments on commit 783c064

Please sign in to comment.