cancel_nft_listing
Cancels a listing of an NFT on a given marketplace.
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()); // Cancel listing params let mint_address: &str = "5eGe5EaC5w5L9nCdmqM4eCe8ZLkBanBVMYBB4gj71qg"; let listing_price: f64 = 1.5; // amount in marketplace settlement currency let cancel_listing_result: NftListing = marketplace.cancel_nft_listing(mint_address, listing_price).await.unwrap();}// Return Types// ============#[derive(Debug, Serialize, Deserialize)]pub struct NftListing { pub id: usize, #[serde(rename = "type")] pub type_name: String, pub wallet_address: String, pub mint_address: String, pub price: String, pub seller_address: String, pub to_wallet_address: Option<String>, pub signature: String, pub status: String, #[serde(rename = "updatedAt")] pub updated_at: String, #[serde(rename = "createdAt")] pub created_at: String,}// Error response if any// =====================#[derive(Debug, Serialize, Deserialize)]pub struct Err { #[serde(rename = "InstructionError")] pub instruction_error: Option<String>,}
Edit this page on GitHub