Skip to main content
BETA
HomeIntegration BuilderAPI ReferenceGuides
View Mirror World on Github
Join the Discord server

Language:

solana_mint_nft

Mints a new NFT to a verified NFT collection.


_51
use mirrorworld_sdk_rust::{ marketplace::Marketplace, NetEnv };
_51
use mirrorworld_sdk_rust::marketplace::GeneralPayload;
_51
_51
// Payload types
_51
pub struct GeneralPayload {
_51
pub name: String,
_51
pub symbol: String,
_51
pub url: String,
_51
pub collection_mint: String,
_51
}
_51
_51
fn 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)]
_51
pub 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)]
_51
pub struct Err {
_51
#[serde(rename = "InstructionError")]
_51
pub instruction_error: Option<String>,
_51
}

Edit this page on GitHub

Copyright © Mirror World, Inc. 2023
On this page

    Home

    Tutorials

    Guides

    API Reference