Sigil documentation
ReferenceRust referencesigil-rpc

sigil-rpc · nft

Source declarations, signatures and documentation for nft.

Source: sigil/node/sigil-rpc/src/nft.rs. SHA-256: 585a677974ec6ed1554791571a2e5efef4afc8517e063b79f0fa2719c6c90f70.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

nft::RpcTokenId

A u128 token identifier serialized as a decimal string on the JSON wire.

JavaScript cannot represent u128 as a Number without precision loss, so all token IDs in RPC responses are sent as strings (e.g. "340282366920938").

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct RpcTokenId(pub u128);

Source line: 29.

nft::RpcNftCollection

Wire representation of an NFT collection for sigil_getNftCollection.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RpcNftCollection {
pub collection_id: String,
pub name: String,
pub symbol: String,
pub kind: NftKind,
pub issuer_did: String,
pub controller_did: String,
pub policy: CollectionPolicy,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metadata_uri: Option<String>,
pub created_height: u64,
/// Cumulative mint count serialized as a string (u128 safety).

pub total_minted: String,
/// Cumulative burn count serialized as a string (u128 safety).

pub total_burned: String
}

Source line: 69.

nft::RpcNftToken

Wire representation of a single NFT token for sigil_getNftToken.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RpcNftToken {
pub collection_id: String,
/// Token ID as a decimal string (u128-safe).

pub token_id: RpcTokenId,
pub owner_did: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metadata_uri: Option<String>,
/// BLAKE3 hash as hex string, if present.

#[serde(default, skip_serializing_if = "Option::is_none")]
pub metadata_hash: Option<String>,
pub locked: bool,
pub burn_auth: BurnAuth,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub identity: Option<IdentityBinding>,
pub minted_height: u64,
pub last_metadata_update_height: u64
}

Source line: 110.

nft::RpcOwnerIndexEntry

Wire representation of one (collection, token list) entry for sigil_getOwnerNfts.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RpcOwnerIndexEntry {
pub collection_id: String,
pub owner_did: String,
/// All token IDs held by this owner in this collection — decimal strings.

pub token_ids: Vec<RpcTokenId>
}

Source line: 152.

nft::RpcDidIdentityIndex

Wire representation of the DID-identity index for sigil_getDidIdentityNft.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RpcDidIdentityIndex {
pub subject_did: String,
/// All `(collection_id, token_id)` pairs bound to this DID.

pub identity_tokens: Vec<RpcIdentityTokenRef>
}

Source line: 175.

nft::RpcIdentityTokenRef

A single (collection_id, token_id) pair in a DID-identity index entry.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RpcIdentityTokenRef {
pub collection_id: String,
/// Token ID as a decimal string.

pub token_id: RpcTokenId
}

Source line: 183.

nft::RpcNftEvent

Wire representation of a single NFT lifecycle event for sigil_getNftEvents.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RpcNftEvent {
pub kind: NftEventKind,
pub collection_id: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub token_id: Option<RpcTokenId>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub from_did: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub to_did: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metadata_uri: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub metadata_hash: Option<String>,
pub block_height: u64,
/// Transaction hash as hex string.

pub tx_hash: String
}

Source line: 211.

nft::NftEventFilter

Query parameters for sigil_getNftEvents.

All fields are optional; omitting a field means "no filter on that dimension". limit defaults to 50 when absent; offset defaults to 0.

#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
pub struct NftEventFilter {
/// Filter by collection ID. Field name `collection_id` matches the Explorer

/// client and the rest of the NFT RPC surface.

#[serde(default, skip_serializing_if = "Option::is_none")]
pub collection_id: Option<String>,
/// Filter by owner / participant DID.

#[serde(default, skip_serializing_if = "Option::is_none")]
pub owner_did: Option<String>,
/// Filter by event kind.

#[serde(default, skip_serializing_if = "Option::is_none")]
pub kind: Option<NftEventKind>,
/// Maximum number of events to return (default: 50).

#[serde(default, skip_serializing_if = "Option::is_none")]
pub limit: Option<usize>,
/// Number of events to skip (default: 0).

#[serde(default, skip_serializing_if = "Option::is_none")]
pub offset: Option<usize>
}

Source line: 254.

On this page