Skip to main content

DocumentsBatchTransitionMethodsV1

Trait DocumentsBatchTransitionMethodsV1 

Source
pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 {
Show 18 methods // Required methods async fn new_token_mint_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, issued_to_identity_id: Option<Identifier>, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_burn_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_transfer_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, recipient_id: Identifier, public_note: Option<String>, shared_encrypted_note: Option<SharedEncryptedNote>, private_encrypted_note: Option<PrivateEncryptedNote>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_shield_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, bundle: OrchardBundleParams, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_mint_to_pool_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, bundle: OrchardBundleParams, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_burn_from_pool_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, bundle: OrchardBundleParams, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_claim_to_pool_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, distribution_type: TokenDistributionType, claim_up_to: Option<u64>, bundle: OrchardBundleParams, public_note: Option<String>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_direct_purchase_to_pool_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, token_count: TokenAmount, total_agreed_price: Credits, bundle: OrchardBundleParams, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_unshield_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, recipient_id: Identifier, bundle: OrchardBundleParams, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_shielded_transfer_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, bundle: OrchardBundleParams, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_freeze_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, frozen_identity_id: Identifier, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_unfreeze_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, frozen_identity_id: Identifier, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_destroy_frozen_funds_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, frozen_identity_id: Identifier, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_emergency_action_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, emergency_action: TokenEmergencyAction, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_config_update_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, update_token_configuration_item: TokenConfigurationChangeItem, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_claim_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, distribution_type: TokenDistributionType, public_note: Option<String>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_change_direct_purchase_price_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, token_pricing_schedule: Option<TokenPricingSchedule>, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>; async fn new_token_direct_purchase_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, total_agreed_price: Credits, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>;
}
Expand description

A trait defining methods to create various token-related state transitions as part of a document batch.

This trait builds on DocumentsBatchTransitionAccessorsV0 and provides a unified interface for constructing signed StateTransitions for token operations such as minting, burning, transferring, freezing, claiming, and direct purchases.

These methods are primarily used by clients or services that need to programmatically generate transitions while applying protocol-specific rules like nonce tracking, version selection, group action metadata, and fee calculations.

All methods in this trait require the state-transition-signing feature to be enabled.

Required Methods§

Source

async fn new_token_mint_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, issued_to_identity_id: Option<Identifier>, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition to mint new tokens.

§Parameters
  • token_id: ID of the token being minted.
  • owner_id: ID of the token’s owner.
  • issued_to_identity_id: Optionally specifies the identity receiving the minted tokens. If this is not set the tokens will go to the identity set in the data contract. If neither is set we will get an error.
  • data_contract_id: The contract ID associated with the token.
  • token_contract_position: The token’s index within the contract.
  • amount: Number of tokens to mint.
  • public_note: Optional plaintext note.
  • using_group_info: Optional group/multisig info if performing this task within a group.
  • identity_public_key: Public key used for signing.
  • identity_contract_nonce: Nonce to prevent replay.
  • user_fee_increase: Fee adjustment parameter.
  • signer: Object implementing the signer trait that much contain the private key for the identity public key.
Source

async fn new_token_burn_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition to burn tokens, permanently removing them from circulation.

§Parameters
  • token_id: ID of the token being burned.
  • owner_id: ID of the token’s owner.
  • data_contract_id: The contract ID associated with the token.
  • token_contract_position: The token’s index within the contract.
  • amount: Number of tokens to burn.
  • public_note: Optional plaintext note.
  • using_group_info: Optional group/multisig info if performing this task within a group.
  • identity_public_key: Public key used for signing.
  • identity_contract_nonce: Nonce to prevent replay.
  • user_fee_increase: Fee adjustment parameter.
  • signer: Object implementing the signer trait that must contain the private key for the identity public key.
Source

async fn new_token_transfer_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, recipient_id: Identifier, public_note: Option<String>, shared_encrypted_note: Option<SharedEncryptedNote>, private_encrypted_note: Option<PrivateEncryptedNote>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition to transfer tokens from one identity to another.

§Parameters
  • token_id: ID of the token being transferred.
  • owner_id: ID of the token’s current owner.
  • data_contract_id: The contract ID associated with the token.
  • token_contract_position: The token’s index within the contract.
  • amount: Number of tokens to transfer.
  • recipient_id: Identity ID of the recipient.
  • public_note: Optional plaintext note.
  • shared_encrypted_note: Optional encrypted note viewable by multiple parties.
  • private_encrypted_note: Optional encrypted note viewable only by the recipient.
  • identity_public_key: Public key used for signing.
  • identity_contract_nonce: Nonce to prevent replay.
  • user_fee_increase: Fee adjustment parameter.
  • signer: Object implementing the signer trait that must contain the private key for the identity public key.
Source

async fn new_token_shield_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, bundle: OrchardBundleParams, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition moving amount of a token from owner_id’s identity token balance into the token’s shielded pool.

bundle is the outputs-only Orchard bundle (value balance -amount) the client proved for the token pool. Having no spends it carries no anchor, so its sighash must bind the shield tag, the token id and owner_id — see token_pool_output_only_extra_sighash_data; a bundle proved without them is rejected.

Source

async fn new_token_mint_to_pool_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, bundle: OrchardBundleParams, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition minting amount of a token straight into the token’s shielded pool as the notes in bundle. owner_id must be authorized to mint; it signs and pays the credits fee. A group action is set up exactly like a transparent mint.

The bundle’s sighash must bind the mint tag, the token id and the minter — see token_pool_output_only_extra_sighash_data. The minter is owner_id for a direct mint and the proposer for a group action, so every other signer passes the proposer’s bundle unchanged.

Source

async fn new_token_burn_from_pool_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, bundle: OrchardBundleParams, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition destroying amount of a token held in the token’s shielded pool by spending the notes in bundle. owner_id must be authorized to burn; it signs and pays the credits fee.

A group action is set up exactly like a transparent burn, with one difference: bundle is always the proposer’s. Its spend authorization is signed over token_burn_from_pool_extra_sighash_data(token_id, proposer_id, amount) and the group action pins the digest of its actions, so every other signer passes the proposer’s bundle unchanged.

Source

async fn new_token_claim_to_pool_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, distribution_type: TokenDistributionType, claim_up_to: Option<u64>, bundle: OrchardBundleParams, public_note: Option<String>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition claiming a distribution straight into the token’s shielded pool as the notes in bundle. claim_up_to names the cycle-aligned moment a perpetual claim pays out to, so the bundle’s value can be predicted; owner_id signs and pays the credits fee.

Source

async fn new_token_direct_purchase_to_pool_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, token_count: TokenAmount, total_agreed_price: Credits, bundle: OrchardBundleParams, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition buying token_count tokens for at most total_agreed_price credits and receiving them shielded as the notes in bundle. owner_id pays the price and the credits fee.

Source

async fn new_token_unshield_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, recipient_id: Identifier, bundle: OrchardBundleParams, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition moving amount of a token out of the token’s shielded pool into recipient_id’s identity token balance. owner_id signs and pays the credits fee.

bundle is the Orchard spend bundle (value balance +amount) whose spend authorization was signed over token_unshield_extra_sighash_data(token_id, owner_id, recipient_id, amount).

Source

async fn new_token_shielded_transfer_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, bundle: OrchardBundleParams, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition transferring a token inside its shielded pool. owner_id signs and pays the credits fee.

bundle is the Orchard spend bundle (value balance 0) whose spend authorization was signed over token_shielded_transfer_extra_sighash_data(token_id, owner_id).

Source

async fn new_token_freeze_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, frozen_identity_id: Identifier, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition to freeze tokens belonging to a specific identity.

Frozen tokens cannot be transferred or used until explicitly unfrozen or destroyed.

§Parameters
  • token_id: ID of the token being frozen.
  • owner_id: ID of the token’s owner.
  • data_contract_id: The contract ID associated with the token.
  • token_contract_position: The token’s index within the contract.
  • frozen_identity_id: ID of the identity whose tokens are being frozen.
  • public_note: Optional plaintext note.
  • using_group_info: Optional group/multisig info if performing this task within a group.
  • identity_public_key: Public key used for signing.
  • identity_contract_nonce: Nonce to prevent replay.
  • user_fee_increase: Fee adjustment parameter.
  • signer: Object implementing the signer trait that must contain the private key for the identity public key.
Source

async fn new_token_unfreeze_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, frozen_identity_id: Identifier, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition to unfreeze tokens previously frozen for a specific identity.

§Parameters
  • token_id: ID of the token being unfrozen.
  • owner_id: ID of the token’s owner.
  • data_contract_id: The contract ID associated with the token.
  • token_contract_position: The token’s index within the contract.
  • frozen_identity_id: ID of the identity whose tokens are being unfrozen.
  • public_note: Optional plaintext note.
  • using_group_info: Optional group/multisig info if performing this task within a group.
  • identity_public_key: Public key used for signing.
  • identity_contract_nonce: Nonce to prevent replay.
  • user_fee_increase: Fee adjustment parameter.
  • signer: Object implementing the signer trait that must contain the private key for the identity public key.
Source

async fn new_token_destroy_frozen_funds_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, frozen_identity_id: Identifier, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition to destroy previously frozen tokens, removing them permanently from supply.

§Parameters
  • token_id: ID of the token being destroyed.
  • owner_id: ID of the token’s owner.
  • data_contract_id: The contract ID associated with the token.
  • token_contract_position: The token’s index within the contract.
  • frozen_identity_id: ID of the identity whose frozen tokens are being destroyed.
  • public_note: Optional plaintext note.
  • using_group_info: Optional group/multisig info if performing this task within a group.
  • identity_public_key: Public key used for signing.
  • identity_contract_nonce: Nonce to prevent replay.
  • user_fee_increase: Fee adjustment parameter.
  • signer: Object implementing the signer trait that must contain the private key for the identity public key.
Source

async fn new_token_emergency_action_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, emergency_action: TokenEmergencyAction, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition to execute an emergency action for a token.

Emergency actions may include critical interventions such as pausing operations, revoking permissions, or executing recovery operations.

§Parameters
  • token_id: ID of the token involved.
  • owner_id: ID of the token’s owner.
  • data_contract_id: The contract ID associated with the token.
  • token_contract_position: The token’s index within the contract.
  • emergency_action: The action to be executed.
  • public_note: Optional plaintext note.
  • using_group_info: Optional group/multisig info if performing this task within a group.
  • identity_public_key: Public key used for signing.
  • identity_contract_nonce: Nonce to prevent replay.
  • user_fee_increase: Fee adjustment parameter.
  • signer: Object implementing the signer trait that must contain the private key for the identity public key.
Source

async fn new_token_config_update_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, update_token_configuration_item: TokenConfigurationChangeItem, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition to update the configuration of a token.

This includes changing properties such as max supply, permissions, or other configurable behavior defined in the token contract.

§Parameters
  • token_id: ID of the token being updated.
  • owner_id: ID of the token’s owner.
  • data_contract_id: The contract ID associated with the token.
  • token_contract_position: The token’s index within the contract.
  • update_token_configuration_item: The configuration change to be applied.
  • public_note: Optional plaintext note.
  • using_group_info: Optional group/multisig info if performing this task within a group.
  • identity_public_key: Public key used for signing.
  • identity_contract_nonce: Nonce to prevent replay.
  • user_fee_increase: Fee adjustment parameter.
  • signer: Object implementing the signer trait that must contain the private key for the identity public key.
Source

async fn new_token_claim_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, distribution_type: TokenDistributionType, public_note: Option<String>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition to claim tokens from a distribution source.

Used when tokens are distributed through rewards, airdrops, or other allocation mechanisms that require explicit claiming by the identity.

§Parameters
  • token_id: ID of the token being claimed.
  • owner_id: ID of the token’s owner.
  • data_contract_id: The contract ID associated with the token.
  • token_contract_position: The token’s index within the contract.
  • distribution_type: Type of token distribution (e.g., reward pool, airdrop).
  • public_note: Optional plaintext note.
  • identity_public_key: Public key used for signing.
  • identity_contract_nonce: Nonce to prevent replay.
  • user_fee_increase: Fee adjustment parameter.
  • signer: Object implementing the signer trait that must contain the private key for the identity public key.
Source

async fn new_token_change_direct_purchase_price_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, token_pricing_schedule: Option<TokenPricingSchedule>, public_note: Option<String>, using_group_info: Option<GroupStateTransitionInfoStatus>, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition to set or update the price of a token for direct purchase.

This defines a TokenPricingSchedule that determines how credits are exchanged for tokens. Setting the price to None disables the ability to purchase the token.

§Parameters
  • token_id: ID of the token whose price is being updated.
  • owner_id: ID of the token’s owner.
  • data_contract_id: The contract ID associated with the token.
  • token_contract_position: The token’s index within the contract.
  • token_pricing_schedule: The new pricing schedule. None disables purchases.
  • public_note: Optional plaintext note.
  • using_group_info: Optional group/multisig info if performing this task within a group.
  • identity_public_key: Public key used for signing.
  • identity_contract_nonce: Nonce to prevent replay.
  • user_fee_increase: Fee adjustment parameter.
  • signer: Object implementing the signer trait that must contain the private key for the identity public key.
Source

async fn new_token_direct_purchase_transition<S: Signer<IdentityPublicKey>>( token_id: Identifier, owner_id: Identifier, data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, total_agreed_price: Credits, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, signer: &S, platform_version: &PlatformVersion, options: Option<StateTransitionCreationOptions>, ) -> Result<StateTransition, ProtocolError>

Creates a StateTransition to perform a direct purchase of tokens by a user.

The user agrees to purchase a given amount of tokens and provides a maximum total credit value they’re willing to pay. If the configured price is lower than this amount, the user will be charged less.

§Parameters
  • token_id: ID of the token being purchased.
  • owner_id: ID of the token’s owner.
  • data_contract_id: The contract ID associated with the token.
  • token_contract_position: The token’s index within the contract.
  • amount: Number of tokens to purchase.
  • agreed_total_cost: Maximum credits the user agrees to pay.
  • identity_public_key: Public key used for signing.
  • identity_contract_nonce: Nonce to prevent replay.
  • user_fee_increase: Fee adjustment parameter.
  • signer: Object implementing the signer trait that must contain the private key for the identity public key.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§