Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(near-contract-standards): export ext_nft_* #1206

Merged
merged 4 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod approval_impl;
mod approval_receiver;

pub use approval_receiver::*;
use near_sdk::ext_contract;

use crate::non_fungible_token::token::TokenId;
use near_sdk::AccountId;
Expand Down Expand Up @@ -54,6 +55,7 @@ use near_sdk::Promise;
/// }
/// ```
///
#[ext_contract(ext_nft_approval)]
pub trait NonFungibleTokenApproval {
/// Add an approved account for a specific token.
///
Expand Down
6 changes: 4 additions & 2 deletions near-contract-standards/src/non_fungible_token/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ mod resolver;

pub use self::core_impl::*;

pub use self::receiver::NonFungibleTokenReceiver;
pub use self::resolver::NonFungibleTokenResolver;
pub use self::receiver::{ext_nft_receiver, NonFungibleTokenReceiver};
pub use self::resolver::{ext_nft_resolver, NonFungibleTokenResolver};

use crate::non_fungible_token::token::{Token, TokenId};
use near_sdk::ext_contract;
use near_sdk::AccountId;
use near_sdk::PromiseOrValue;

Expand Down Expand Up @@ -49,6 +50,7 @@ use near_sdk::PromiseOrValue;
///}
/// ```
///
#[ext_contract(ext_nft_core)]
pub trait NonFungibleTokenCore {
/// Simple transfer. Transfer a given `token_id` from current owner to
/// `receiver_id`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mod enumeration_impl;

use crate::non_fungible_token::token::Token;
use near_sdk::json_types::U128;
use near_sdk::AccountId;
use near_sdk::{ext_contract, AccountId};

/// Offers methods helpful in determining account ownership of NFTs and provides a way to page through NFTs per owner, determine total supply, etc.
///
Expand Down Expand Up @@ -40,6 +40,7 @@ use near_sdk::AccountId;
/// }
/// ```
///
#[ext_contract(ext_nft_enumeration)]
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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use near_sdk::json_types::Base64VecU8;
use near_sdk::{near, require};
use near_sdk::{ext_contract, near, require};

/// This spec can be treated like a version of the standard.
pub const NFT_METADATA_SPEC: &str = "nft-1.0.0";
Expand Down Expand Up @@ -35,6 +35,7 @@ pub struct TokenMetadata {
}

/// Offers details on the contract-level metadata.
#[ext_contract(ext_nft_metadata_provider)]
pub trait NonFungibleTokenMetadataProvider {
fn nft_metadata(&self) -> NFTContractMetadata;
}
Expand Down
Loading