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

Language:

fetch_nfts_by_mint_address

Fetch NFTs By Mint Addresses. Returns a detailed payload of all NFTs whose mint addresses are provided.


use mirrorworld_sdk_rust::{ marketplace::Marketplace, NetEnv };
fn main() {
// First create the SDK instance
let api_key: &str = "SUPER_SECRET_API_KEY"; // Can be gotten from the developer dashboard
let access_token: &str = "USER_AUTH_ACCESS_TOKEN"; // Current user's auth token
let marketplace = Marketplace::new(api_key.to_string(), NetEnv::DEVNET, access_token.to_string());
// fetch_nfts_by_mint_address params
// You may add as many mint addresses as you wish to this vector
let mut addresses = Vec::new();
let limit: usize = 10; // Page size for pagination
let offset: usize = 1; // Page number for pagination
let mint_address: &str = "5eGe5EaC5w5L9nCdmqM4eCe8ZLkBanBVMYBB4gj71qg";
addresses.push(mint_address);
let result: SolanaNFTs = marketplace.fetch_nfts_by_mint_address(addresses, limit, offset).await.unwrap();
}
// Return Types
// ============
#[derive(Debug, Serialize, Deserialize)]
pub struct SolanaNFTs {
pub nfts: Vec<SolanaNFTExtended>
}
#[derive(Debug, Serialize, Deserialize)]
pub struct SolanaNFTExtended {
pub name: String,
#[serde(rename = "sellerFeeBasisPoints")]
pub seller_fee_basic_points: usize,
#[serde(rename = "updateAuthorityAddress")]
pub update_authority_address: String,
pub description: Option<String>,
pub image: Option<String>,
#[serde(rename = "externalUrl")]
pub external_url: Option<String>,
pub creators: Vec<Creator>,
pub owner: Option<Owner>,
pub attributes: Option<Vec<MetadataAttribute>>,
pub listings: Option<Vec<SolanaNFTListing>>,
}
// Error response if any
// =====================
#[derive(Debug, Serialize, Deserialize)]
pub struct Err {
#[serde(rename = "InstructionError")]
pub instruction_error: Option<String>,
}

Edit this page on GitHub

Copyright © Mirror World, Inc. 2023
On this page

    Home

    Integration

    Guides

    API Reference

    Changelog