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 —
- Whether or not a token has an admin key, its expiry can be extended with only the transaction payer’s signature.
- Updating any other field of a mutable token requires the admin key’s signature.
- 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. (OtherKey
structures without a constituentEd25519
key will be rejected withInvalidAdminKey
. - If a new treasury is set, the new treasury account’s key must sign the transaction.
§— Nft Requirements —
- 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
impl TokenUpdateTransaction
sourcepub fn get_token_id(&self) -> Option<TokenId>
pub fn get_token_id(&self) -> Option<TokenId>
Returns the token to be updated.
sourcepub fn token_id(&mut self, token_id: impl Into<TokenId>) -> &mut Self
pub fn token_id(&mut self, token_id: impl Into<TokenId>) -> &mut Self
Sets the token to be updated.
sourcepub fn get_token_name(&self) -> &str
pub fn get_token_name(&self) -> &str
Returns the new publicly visible name of the token.
sourcepub fn token_name(&mut self, token_name: impl Into<String>) -> &mut Self
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.
sourcepub fn get_token_symbol(&self) -> &str
pub fn get_token_symbol(&self) -> &str
Returns the new publicly visible token symbol.
sourcepub fn token_symbol(&mut self, token_symbol: impl Into<String>) -> &mut Self
pub fn token_symbol(&mut self, token_symbol: impl Into<String>) -> &mut Self
Sets the new publicly visible token symbol.
Maximum 100 characters.
sourcepub fn get_treasury_account_id(&self) -> Option<AccountId>
pub fn get_treasury_account_id(&self) -> Option<AccountId>
Returns the new account which will act as a treasury for the token.
sourcepub fn treasury_account_id(
&mut self,
treasury_account_id: AccountId
) -> &mut Self
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.
sourcepub fn get_admin_key(&self) -> Option<&Key>
pub fn get_admin_key(&self) -> Option<&Key>
Returns the new key which can perform update/delete operations on the token.
sourcepub fn admin_key(&mut self, admin_key: impl Into<Key>) -> &mut Self
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
.
sourcepub fn get_kyc_key(&self) -> Option<&Key>
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.
sourcepub fn kyc_key(&mut self, kyc_key: impl Into<Key>) -> &mut Self
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
.
sourcepub fn get_freeze_key(&self) -> Option<&Key>
pub fn get_freeze_key(&self) -> Option<&Key>
Returns the new key which can sign to freeze or unfreeze an account for token transactions.
sourcepub fn freeze_key(&mut self, freeze_key: impl Into<Key>) -> &mut Self
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
.
sourcepub fn get_wipe_key(&self) -> Option<&Key>
pub fn get_wipe_key(&self) -> Option<&Key>
Returns the new key which can wipe the token balance of an account.
sourcepub fn wipe_key(&mut self, wipe_key: impl Into<Key>) -> &mut Self
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
.
sourcepub fn get_supply_key(&self) -> Option<&Key>
pub fn get_supply_key(&self) -> Option<&Key>
Returns the new key which can change the supply of a token.
sourcepub fn supply_key(&mut self, supply_key: impl Into<Key>) -> &mut Self
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
.
sourcepub fn get_auto_renew_account_id(&self) -> Option<AccountId>
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.
sourcepub fn auto_renew_account_id(
&mut self,
auto_renew_account_id: AccountId
) -> &mut Self
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.
sourcepub fn get_auto_renew_period(&self) -> Option<Duration>
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.
sourcepub fn auto_renew_period(&mut self, auto_renew_period: Duration) -> &mut Self
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.
sourcepub fn get_expiration_time(&self) -> Option<OffsetDateTime>
pub fn get_expiration_time(&self) -> Option<OffsetDateTime>
Returns the new time at which the token should expire.
sourcepub fn expiration_time(&mut self, expiration_time: OffsetDateTime) -> &mut Self
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
.
sourcepub fn get_token_memo(&self) -> Option<&str>
pub fn get_token_memo(&self) -> Option<&str>
Returns the new memo associated with the token.
sourcepub fn token_memo(&mut self, memo: Option<impl Into<String>>) -> &mut Self
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.
sourcepub fn get_fee_schedule_key(&self) -> Option<&Key>
pub fn get_fee_schedule_key(&self) -> Option<&Key>
Returns the new key which can change the token’s custom fee schedule.
sourcepub fn fee_schedule_key(
&mut self,
fee_schedule_key: impl Into<Key>
) -> &mut Self
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
.
sourcepub fn get_pause_key(&self) -> Option<&Key>
pub fn get_pause_key(&self) -> Option<&Key>
Returns the new key which can pause and unpause the token.
sourcepub fn pause_key(&mut self, pause_key: impl Into<Key>) -> &mut Self
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
.
sourcepub fn get_metadata(&self) -> Vec<u8> ⓘ
pub fn get_metadata(&self) -> Vec<u8> ⓘ
Returns the new metadata of the created token definition.
sourcepub fn metadata(&mut self, metadata: Vec<u8>) -> &mut Self
pub fn metadata(&mut self, metadata: Vec<u8>) -> &mut Self
Sets the new metadata of the token definition.
sourcepub fn get_metadata_key(&self) -> Option<&Key>
pub fn get_metadata_key(&self) -> Option<&Key>
Returns the new key which can change the metadata of a token.
sourcepub fn metadata_key(&mut self, metadata_key: impl Into<Key>) -> &mut Self
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.