-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: partial draft of compressed NFTs
- Loading branch information
Showing
9 changed files
with
969 additions
and
304 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,79 @@ | ||
use holaplex_hub_nfts_solana_entity::{collection_mints, collections}; | ||
|
||
use crate::proto::{ | ||
MetaplexMasterEditionTransaction, MintMetaplexEditionTransaction, | ||
TransferMetaplexAssetTransaction, | ||
}; | ||
use hub_core::prelude::*; | ||
use solana_program::pubkey::Pubkey; | ||
|
||
#[derive(Clone)] | ||
pub struct MasterEditionAddresses { | ||
pub metadata: Pubkey, | ||
pub associated_token_account: Pubkey, | ||
pub owner: Pubkey, | ||
pub master_edition: Pubkey, | ||
pub mint: Pubkey, | ||
pub update_authority: Pubkey, | ||
} | ||
|
||
#[derive(Clone)] | ||
pub struct MintEditionAddresses { | ||
pub edition: Pubkey, | ||
pub mint: Pubkey, | ||
pub metadata: Pubkey, | ||
pub owner: Pubkey, | ||
pub associated_token_account: Pubkey, | ||
} | ||
|
||
#[derive(Clone)] | ||
pub struct UpdateMasterEditionAddresses { | ||
pub metadata: Pubkey, | ||
pub update_authority: Pubkey, | ||
} | ||
|
||
#[derive(Clone)] | ||
pub struct TransferAssetAddresses { | ||
pub owner: Pubkey, | ||
pub recipient: Pubkey, | ||
pub recipient_associated_token_account: Pubkey, | ||
pub owner_associated_token_account: Pubkey, | ||
} | ||
|
||
/// Represents a response from a transaction on the blockchain. This struct | ||
/// provides the serialized message and the signatures of the signed message. | ||
pub struct TransactionResponse<A> { | ||
/// The serialized version of the message from the transaction. | ||
pub serialized_message: Vec<u8>, | ||
|
||
/// The signatures of the signed message or the public keys of wallets that should sign the transaction. Order matters. | ||
pub signatures_or_signers_public_keys: Vec<String>, | ||
|
||
/// Addresses that are related to the transaction. | ||
pub addresses: A, | ||
} | ||
|
||
pub trait Backend { | ||
fn create( | ||
&self, | ||
txn: MetaplexMasterEditionTransaction, | ||
) -> Result<TransactionResponse<MasterEditionAddresses>>; | ||
|
||
fn mint( | ||
&self, | ||
collection: collections::Model, | ||
txn: MintMetaplexEditionTransaction, | ||
) -> Result<TransactionResponse<MintEditionAddresses>>; | ||
|
||
fn update( | ||
&self, | ||
collection: collections::Model, | ||
txn: MetaplexMasterEditionTransaction, | ||
) -> Result<TransactionResponse<UpdateMasterEditionAddresses>>; | ||
|
||
fn transfer( | ||
&self, | ||
mint: collection_mints::Model, | ||
txn: TransferMetaplexAssetTransaction, | ||
) -> Result<TransactionResponse<TransferAssetAddresses>>; | ||
} |
Oops, something went wrong.