Type Alias hedera::TokenUpdateTransaction

source ·
pub type TokenUpdateTransaction = Transaction<TokenUpdateTransactionData>;
Expand description

At consensus, updates an already created token to the given values.

If no value is given for a field, that field is left unchanged. For an immutable token (that is, a token without an admin key), only the expiry may be updated. Setting any other field in that case will cause the transaction status to resolve to TokenIsImmutable.

§— Signing Requirements —

  1. Whether or not a token has an admin key, its expiry can be extended with only the transaction payer’s signature.
  2. Updating any other field of a mutable token requires the admin key’s signature.
  3. If a new admin key is set, this new key must sign unless it is exactly an empty KeyList. This special sentinel key removes the existing admin key and causes the token to become immutable. (Other Key structures without a constituent Ed25519 key will be rejected with InvalidAdminKey.
  4. If a new treasury is set, the new treasury account’s key must sign the transaction.

§— Nft Requirements —

  1. If a non fungible token has a positive treasury balance, the operation will abort with CurrentTreasuryStillOwnsNfts.

Aliased Type§

struct TokenUpdateTransaction { /* private fields */ }

Implementations§

source§

impl TokenUpdateTransaction

source

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

Returns the token to be updated.

source

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

Sets the token to be updated.

source

pub fn get_token_name(&self) -> &str

Returns the new publicly visible name of the token.

source

pub fn token_name(&mut self, token_name: impl Into<String>) -> &mut Self

Sets the new publicly visible name of the token.

Maximum 100 characters.

source

pub fn get_token_symbol(&self) -> &str

Returns the new publicly visible token symbol.

source

pub fn token_symbol(&mut self, token_symbol: impl Into<String>) -> &mut Self

Sets the new publicly visible token symbol.

Maximum 100 characters.

source

pub fn get_treasury_account_id(&self) -> Option<AccountId>

Returns the new account which will act as a treasury for the token.

source

pub fn treasury_account_id( &mut self, treasury_account_id: AccountId ) -> &mut Self

Sets the new account which will act as a treasury for the token.

If the provided treasury_account_id does not exist or has been deleted, the response will be InvalidTreasuryAccountForToken.

If successful, the token balance held in the previous treasury account is transferred to the new one.

source

pub fn get_admin_key(&self) -> Option<&Key>

Returns the new key which can perform update/delete operations on the token.

source

pub fn admin_key(&mut self, admin_key: impl Into<Key>) -> &mut Self

Sets the new key which can perform update/delete operations on the token.

If the token is immutable, transaction will resolve to TokenIsImmutable.

source

pub fn get_kyc_key(&self) -> Option<&Key>

Returns the new key which can grant or revoke KYC of an account for the token’s transactions.

source

pub fn kyc_key(&mut self, kyc_key: impl Into<Key>) -> &mut Self

Sets the new key which can grant or revoke KYC of an account for the token’s transactions.

If the token does not currently have a KYC key, transaction will resolve to TokenHasNoKycKey.

source

pub fn get_freeze_key(&self) -> Option<&Key>

Returns the new key which can sign to freeze or unfreeze an account for token transactions.

source

pub fn freeze_key(&mut self, freeze_key: impl Into<Key>) -> &mut Self

Sets the new key which can sign to freeze or unfreeze an account for token transactions.

If the token does not currently have a Freeze key, transaction will resolve to TokenHasNoFreezeKey.

source

pub fn get_wipe_key(&self) -> Option<&Key>

Returns the new key which can wipe the token balance of an account.

source

pub fn wipe_key(&mut self, wipe_key: impl Into<Key>) -> &mut Self

Sets the new key which can wipe the token balance of an account.

If the token does not currently have a Wipe key, transaction will resolve to TokenHasNoWipeKey.

source

pub fn get_supply_key(&self) -> Option<&Key>

Returns the new key which can change the supply of a token.

source

pub fn supply_key(&mut self, supply_key: impl Into<Key>) -> &mut Self

Sets the new key which can change the supply of a token.

If the token does not currently have a Supply key, transaction will resolve to TokenHasNoSupplyKey.

source

pub fn get_auto_renew_account_id(&self) -> Option<AccountId>

Returns the new account which will be automatically charged to renew the token’s expiration.

source

pub fn auto_renew_account_id( &mut self, auto_renew_account_id: AccountId ) -> &mut Self

Sets the new account which will be automatically charged to renew the token’s expiration.

source

pub fn get_auto_renew_period(&self) -> Option<Duration>

Returns the new interval at which the auto renew account will be charged to extend the token’s expiry.

source

pub fn auto_renew_period(&mut self, auto_renew_period: Duration) -> &mut Self

Sets the new interval at which the auto renew account will be charged to extend the token’s expiry.

source

pub fn get_expiration_time(&self) -> Option<OffsetDateTime>

Returns the new time at which the token should expire.

source

pub fn expiration_time(&mut self, expiration_time: OffsetDateTime) -> &mut Self

Sets the new time at which the token should expire.

If the new expiration time is earlier than the current expiration time, transaction will resolve to InvalidExpirationTime.

source

pub fn get_token_memo(&self) -> Option<&str>

Returns the new memo associated with the token.

source

pub fn token_memo(&mut self, memo: Option<impl Into<String>>) -> &mut Self

Sets the new memo associated with the token.

Maximum of 100 bytes.

source

pub fn get_fee_schedule_key(&self) -> Option<&Key>

Returns the new key which can change the token’s custom fee schedule.

source

pub fn fee_schedule_key( &mut self, fee_schedule_key: impl Into<Key> ) -> &mut Self

Sets the new key which can change the token’s custom fee schedule.

If the token does not currently have a fee schedule key, transaction will resolve to TokenHasNoFeeScheduleKey.

source

pub fn get_pause_key(&self) -> Option<&Key>

Returns the new key which can pause and unpause the token.

source

pub fn pause_key(&mut self, pause_key: impl Into<Key>) -> &mut Self

Sets the new key which can pause and unpause the Token.

If the token does not currently have a pause key, transaction will resolve to TokenHasNoPauseKey.

source

pub fn get_metadata(&self) -> Vec<u8>

Returns the new metadata of the created token definition.

source

pub fn metadata(&mut self, metadata: Vec<u8>) -> &mut Self

Sets the new metadata of the token definition.

source

pub fn get_metadata_key(&self) -> Option<&Key>

Returns the new key which can change the metadata of a token.

source

pub fn metadata_key(&mut self, metadata_key: impl Into<Key>) -> &mut Self

Sets the new key which can change the metadata of a token.