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

Language:

fetch_nfts_by_owner_addresses

Fetch NFTs by owner addresses. Returns a detailed payload of all NFTs whose owner 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_update_authorities params
// You may add as many owner 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 owner_address: &str = "2BrLoxPTkPLyLuD3sPitNKXQRA9y8zzZ9P6vYwMTtgBL";
owner_address.push(update_authority);
let result: SolanaNFTs = marketplace.fetch_nfts_by_owner_addresses(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