Skip to content

Commit

Permalink
fix: derive NearSchema for NEP-171 Token struct
Browse files Browse the repository at this point in the history
  • Loading branch information
encody committed May 8, 2024
1 parent 6206116 commit be4587a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ version = "3.0.0"
# normal dependencies
near-sdk = { version = "5.1.0", default-features = false }
near-sdk-contract-tools-macros = { version = "=3.0.0", path = "./macros" }
schemars = "0.8.19"
thiserror = "1"

# macro dependencies
Expand Down Expand Up @@ -53,6 +54,7 @@ missing-docs = "warn"
[dependencies]
near-sdk = { workspace = true, default-features = false, features = ["legacy"] }
near-sdk-contract-tools-macros.workspace = true
schemars.workspace = true
thiserror.workspace = true

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/standard/nep171/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use near_sdk::{
borsh::BorshSerialize,
near,
serde::{Deserialize, Serialize},
AccountId, AccountIdRef, BorshStorageKey, Gas,
AccountId, AccountIdRef, BorshStorageKey, Gas, NearSchema,
};

use crate::{hook::Hook, slot::Slot, standard::nep297::Event, DefaultStorageKey};
Expand Down Expand Up @@ -415,7 +415,7 @@ impl<T: Nep171ControllerInternal> Nep171Controller for T {
}

/// Token information structure.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, NearSchema)]
#[serde(crate = "near_sdk::serde")]
pub struct Token {
/// Token ID.
Expand Down

0 comments on commit be4587a

Please sign in to comment.