fireblocks-sdk 2026.3.27

Rust implementation of the Fireblocks SDK
Documentation
// Fireblocks API
//
// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain.  - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
//
// The version of the OpenAPI document: 1.8.0
// Contact: developers@fireblocks.com
// Generated by: https://openapi-generator.tech

use {
    crate::models,
    serde::{Deserialize, Serialize},
};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TokenOwnershipResponse {
    /// The Fireblocks NFT asset id
    #[serde(rename = "id")]
    pub id: String,
    /// Token id within the contract/collection
    #[serde(rename = "tokenId")]
    pub token_id: String,
    /// Token's standard
    #[serde(rename = "standard")]
    pub standard: String,
    /// URL of the original token JSON metadata
    #[serde(rename = "metadataURI", skip_serializing_if = "Option::is_none")]
    pub metadata_uri: Option<String>,
    /// URL of the cached token JSON metadata
    #[serde(rename = "cachedMetadataURI", skip_serializing_if = "Option::is_none")]
    pub cached_metadata_uri: Option<String>,
    /// Media items extracted from metadata JSON
    #[serde(rename = "media", skip_serializing_if = "Option::is_none")]
    pub media: Option<Vec<models::MediaEntityResponse>>,
    /// Owned Token's Spam status
    #[serde(rename = "spam", skip_serializing_if = "Option::is_none")]
    pub spam: Option<models::SpamOwnershipResponse>,
    /// Parent collection information
    #[serde(rename = "collection", skip_serializing_if = "Option::is_none")]
    pub collection: Option<models::TokenCollectionResponse>,
    /// Token's balance
    #[serde(rename = "balance")]
    pub balance: String,
    /// Fireblocks Vault Account ID
    #[serde(rename = "vaultAccountId", skip_serializing_if = "Option::is_none")]
    pub vault_account_id: Option<String>,
    /// Ownership start timestamp (epoch)
    #[serde(rename = "ownershipStartTime")]
    pub ownership_start_time: f64,
    /// Ownership start last update time (epoch)
    #[serde(rename = "ownershipLastUpdateTime")]
    pub ownership_last_update_time: f64,
    /// Token's blockchain
    #[serde(rename = "blockchainDescriptor")]
    pub blockchain_descriptor: BlockchainDescriptor,
    /// Token's metadata description
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Token's name
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Ownership Non-Custodial Wallet ID
    #[serde(rename = "ncwId", skip_serializing_if = "Option::is_none")]
    pub ncw_id: Option<String>,
    /// Ownership Non-Custodial Wallet's account ID
    #[serde(rename = "ncwAccountId", skip_serializing_if = "Option::is_none")]
    pub ncw_account_id: Option<String>,
    /// Owned Token's status
    #[serde(rename = "status")]
    pub status: Status,
}

impl TokenOwnershipResponse {
    pub fn new(
        id: String,
        token_id: String,
        standard: String,
        balance: String,
        ownership_start_time: f64,
        ownership_last_update_time: f64,
        blockchain_descriptor: BlockchainDescriptor,
        status: Status,
    ) -> TokenOwnershipResponse {
        TokenOwnershipResponse {
            id,
            token_id,
            standard,
            metadata_uri: None,
            cached_metadata_uri: None,
            media: None,
            spam: None,
            collection: None,
            balance,
            vault_account_id: None,
            ownership_start_time,
            ownership_last_update_time,
            blockchain_descriptor,
            description: None,
            name: None,
            ncw_id: None,
            ncw_account_id: None,
            status,
        }
    }
}
/// Token's blockchain
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BlockchainDescriptor {
    #[serde(rename = "ETH")]
    Eth,
    #[serde(rename = "ETH_TEST3")]
    EthTest3,
    #[serde(rename = "ETH_TEST5")]
    EthTest5,
    #[serde(rename = "ETH_TEST6")]
    EthTest6,
    #[serde(rename = "POLYGON")]
    Polygon,
    #[serde(rename = "POLYGON_TEST_MUMBAI")]
    PolygonTestMumbai,
    #[serde(rename = "AMOY_POLYGON_TEST")]
    AmoyPolygonTest,
    #[serde(rename = "XTZ")]
    Xtz,
    #[serde(rename = "XTZ_TEST")]
    XtzTest,
    #[serde(rename = "BASECHAIN_ETH")]
    BasechainEth,
    #[serde(rename = "BASECHAIN_ETH_TEST3")]
    BasechainEthTest3,
    #[serde(rename = "BASECHAIN_ETH_TEST5")]
    BasechainEthTest5,
    #[serde(rename = "ETHERLINK")]
    Etherlink,
    #[serde(rename = "ETHERLINK_TEST")]
    EtherlinkTest,
    #[serde(rename = "MANTLE")]
    Mantle,
    #[serde(rename = "MANTLE_TEST")]
    MantleTest,
    #[serde(rename = "GUN_GUNZILLA_TEST")]
    GunGunzillaTest,
    #[serde(rename = "ETH_SONEIUM")]
    EthSoneium,
    #[serde(rename = "SONEIUM_MINATO_TEST")]
    SoneiumMinatoTest,
    #[serde(rename = "IOTX_IOTEX")]
    IotxIotex,
}

impl Default for BlockchainDescriptor {
    fn default() -> BlockchainDescriptor {
        Self::Eth
    }
}
/// Owned Token's status
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "LISTED")]
    Listed,
    #[serde(rename = "ARCHIVED")]
    Archived,
}

impl Default for Status {
    fn default() -> Status {
        Self::Listed
    }
}