Type Alias hedera::TokenBurnTransaction

source ·
pub type TokenBurnTransaction = Transaction<TokenBurnTransactionData>;
Expand description

Burns tokens from the Token’s treasury Account.

The operation decreases the Total Supply of the Token. Total supply cannot go below zero.

The amount provided must be in the lowest denomination possible. Example: Token A has 2 decimals. In order to burn 100 tokens, one must provide amount of 10000. In order to burn 100.55 tokens, one must provide amount of 10055.

For non-fungible tokens the transaction body accepts a serials list of integers as a parameter.

  • If no Supply Key is defined, the transaction will resolve to TOKEN_HAS_NO_SUPPLY_KEY.

  • If neither the amount nor the serials get filled, a INVALID_TOKEN_BURN_AMOUNT response code will be returned.

  • If both amount and serials get filled, a INVALID_TRANSACTION_BODY response code will be returned.

  • If the serials list count is greater than the batch size limit global dynamic property, a BATCH_SIZE_LIMIT_EXCEEDED response code will be returned.

  • If the serials list contains a non-positive integer as a serial number, a INVALID_NFT_ID response code will be returned.

Aliased Type§

struct TokenBurnTransaction { /* private fields */ }

Implementations§

source§

impl TokenBurnTransaction

source

pub fn get_token_id(&self) -> Option<TokenId>

Returns the token for which to burn tokens.

source

pub fn token_id(&mut self, token_id: impl Into<TokenId>) -> &mut Self

Sets the token for which to burn tokens.

source

pub fn get_amount(&self) -> u64

Returns the amount of a fungible token to burn from the treasury account.

source

pub fn amount(&mut self, amount: impl Into<u64>) -> &mut Self

Sets the amount of a fungible token to burn from the treasury account.

source

pub fn get_serials(&self) -> &[i64]

Returns the serial numbers of a non-fungible token to burn from the treasury account.

source

pub fn serials(&mut self, serials: impl IntoIterator<Item = i64>) -> &mut Self

Sets the serial numbers of a non-fungible token to burn from the treasury account.