-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add collection metadata verification
- Loading branch information
1 parent
6e06918
commit c58fdc8
Showing
4 changed files
with
84 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
use anchor_lang::{prelude::*, AnchorDeserialize, AnchorSerialize}; | ||
|
||
// Define the TokenStandard enum | ||
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] | ||
pub enum TokenStandard { | ||
NonFungible, | ||
FungibleAsset, | ||
Fungible, | ||
NonFungibleEdition, | ||
} | ||
|
||
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, Eq, PartialEq)] | ||
pub struct Collection { | ||
pub verified: bool, | ||
pub key: Pubkey, | ||
} | ||
|
||
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] | ||
pub enum UseMethod { | ||
Burn, | ||
Multiple, | ||
Single, | ||
} | ||
|
||
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, Eq, PartialEq)] | ||
pub struct Uses { | ||
pub use_method: UseMethod, | ||
pub remaining: u64, | ||
pub total: u64, | ||
} | ||
|
||
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash)] | ||
pub enum TokenProgramVersion { | ||
Original, | ||
Token2022, | ||
} | ||
|
||
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug, Eq, PartialEq)] | ||
pub struct Creator { | ||
pub address: Pubkey, | ||
pub verified: bool, | ||
/// The percentage share. | ||
/// | ||
/// The value is a percentage, not basis points. | ||
pub share: u8, | ||
} | ||
|
||
// Define the MetadataArgs struct | ||
#[derive(AnchorSerialize, AnchorDeserialize, Clone)] | ||
pub struct MetadataArgs { | ||
pub name: String, | ||
pub symbol: String, // Changed from Option<String> to String | ||
pub uri: String, | ||
pub seller_fee_basis_points: u16, | ||
pub primary_sale_happened: bool, // Changed from Option<bool> to bool | ||
pub is_mutable: bool, // Changed from Option<bool> to bool | ||
pub edition_nonce: Option<u8>, | ||
pub token_standard: Option<TokenStandard>, // Changed from Option<u8> to Option<TokenStandard> | ||
pub collection: Option<Collection>, | ||
pub uses: Option<Uses>, | ||
pub token_program_version: TokenProgramVersion, // Assuming TokenProgramVersion is a simple u8 | ||
pub creators: Vec<Creator>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub mod sol_cnft_fulfill_buy; | ||
pub mod metadata_args; | ||
|
||
pub use sol_cnft_fulfill_buy::*; | ||
pub use sol_cnft_fulfill_buy::*; | ||
pub use metadata_args::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters