solana_mint_nft
Mints a new NFT to a verified NFT collection.
_51use mirrorworld_sdk_rust::{ marketplace::Marketplace, NetEnv };_51use mirrorworld_sdk_rust::marketplace::GeneralPayload;_51_51// Payload types_51pub struct GeneralPayload {_51 pub name: String,_51 pub symbol: String,_51 pub url: String,_51 pub collection_mint: String,_51}_51_51fn main() {_51 // First create the SDK instance_51 let api_key: &str = "SUPER_SECRET_API_KEY"; // Can be gotten from the developer dashboard_51 let access_token: &str = "USER_AUTH_ACCESS_TOKEN"; // Current user's auth token_51 let marketplace = Marketplace::new(api_key.to_string(), NetEnv::DEVNET, access_token.to_string());_51_51 // Create collection process_51 let payload: GeneralPayload = GeneralPayload {_51 name: "YOUR_NFT_NAME",_51 symbol: "YOUR_NFT_SYMBOL",_51 url: "YOUR_NFT_METADATA_URI",_51 collection_mint: "YOUR_COLLECTION_MINT_ADDRESS"_51 };_51_51 let nft_result: SolanaMintNftResult = marketplace.solana_mint_nft(payload).await.unwrap();_51}_51_51// Return Types_51// ============_51_51 #[derive(Debug, Serialize, Deserialize)]_51pub struct SolanaMintNftResult {_51 pub mint_address: String,_51 pub url: String,_51 pub update_authority: String,_51 pub creator_address: String,_51 pub name: String,_51 pub symbol: String,_51 pub collection: String,_51 pub signature: String,_51 pub status: String,_51}_51_51// Error response if any_51// =====================_51#[derive(Debug, Serialize, Deserialize)]_51pub struct Err {_51 #[serde(rename = "InstructionError")]_51 pub instruction_error: Option<String>,_51}
Edit this page on GitHub