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

Language:

update_nft_listing

Update the listing price of an NFT on a given marketplace.


_43
use mirrorworld_sdk_rust::{ marketplace::Marketplace, NetEnv };
_43
_43
fn main() {
_43
// First create the SDK instance
_43
let api_key: &str = "SUPER_SECRET_API_KEY"; // Can be gotten from the developer dashboard
_43
let access_token: &str = "USER_AUTH_ACCESS_TOKEN"; // Current user's auth token
_43
let marketplace = Marketplace::new(api_key.to_string(), NetEnv::DEVNET, access_token.to_string());
_43
_43
// Update listing for NFT params
_43
let mint_address: &str = "5eGe5EaC5w5L9nCdmqM4eCe8ZLkBanBVMYBB4gj71qg";
_43
let new_price: f64 = 1.5; // amount in marketplace settlement currency
_43
_43
let update_listing_result: NftListing = marketplace.update_nft_listing(mint_address, new_price).await.unwrap();
_43
}
_43
_43
// Return Types
_43
// ============
_43
_43
#[derive(Debug, Serialize, Deserialize)]
_43
pub struct NftListing {
_43
pub id: usize,
_43
#[serde(rename = "type")]
_43
pub type_name: String,
_43
pub wallet_address: String,
_43
pub mint_address: String,
_43
pub price: String,
_43
pub seller_address: String,
_43
pub to_wallet_address: Option<String>,
_43
pub signature: String,
_43
pub status: String,
_43
#[serde(rename = "updatedAt")]
_43
pub updated_at: String,
_43
#[serde(rename = "createdAt")]
_43
pub created_at: String,
_43
}
_43
_43
// Error response if any
_43
// =====================
_43
#[derive(Debug, Serialize, Deserialize)]
_43
pub struct Err {
_43
#[serde(rename = "InstructionError")]
_43
pub instruction_error: Option<String>,
_43
}

Edit this page on GitHub

Copyright © Mirror World, Inc. 2023
On this page

    Home

    Tutorials

    Guides

    API Reference