Skip to main content
BETA
HomeIntegration BuilderAPI ReferenceGuides
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.


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

Edit this page on GitHub

Copyright © Mirror World, Inc. 2023
On this page

    Home

    Tutorials

    Guides

    API Reference