Type Alias hedera::TokenCreateTransaction

source ·
pub type TokenCreateTransaction = Transaction<TokenCreateTransactionData>;
Expand description

Create a new token.

After the token is created, the TokenId for it is in the receipt.

The specified treasury account receives the initial supply of tokens, as well as the tokens from a TokenMintTransaction once executed. The balance of the treasury account is decreased when a TokenBurnTransaction is executed.

The initial_supply is in the lowest denomination of the token (like a tinybar, not an hbar).

Note that a created token is immutable if the admin_key is omitted. No property of an immutable token can ever change, with the sole exception of its expiry. Anyone can pay to extend the expiry time of an immutable token.

  • If NonFungibleUnique is used, the initial_supply should explicitly be set to 0 (which is the default). If not, the transaction will resolve to InvalidTokenInitialSupply.

  • If Infinite is used, the max_supply should explicitly be set to 0 (which is the default). If it is not 0, the transaction will resolve to InvalidTokenMaxSupply.

Aliased Type§

struct TokenCreateTransaction { /* private fields */ }

Implementations§

source§

impl TokenCreateTransaction

source

pub fn get_name(&self) -> &str

Returns the publicly visible name of the token.

source

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

Sets the publicly visible name of the token.

Maximum 100 characters.

source

pub fn get_symbol(&self) -> &str

Returns the publicly visible token symbol.

source

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

Sets the publicly visible token symbol.

Maximum 100 characters.

source

pub fn get_decimals(&self) -> u32

Returns the number of decimal places the token is divisble by.

source

pub fn decimals(&mut self, decimals: u32) -> &mut Self

Sets the number of decimal places a token is divisible by.

source

pub fn get_initial_supply(&self) -> u64

Returns the initial supply of tokens to be put into circulation.

source

pub fn initial_supply(&mut self, initial_supply: u64) -> &mut Self

Sets the initial supply of tokens to be put in circulation.

source

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

Returns the 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 account which will act as a treasury for the token.

source

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

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

source

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

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

source

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

Returns the 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 key which can grant or revoke KYC of an account for the token’s transactions.

source

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

Returns the 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 key which can sign to freeze or unfreeze an account for token transactions.

source

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

Returns the 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 key which can wipe the token balance of an account.

source

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

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

source

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

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

source

pub fn get_freeze_default(&self) -> bool

Returnsthe default freeze status (frozen or unfrozen) of hedera accounts relative to this token. If true, an account must be unfrozen before it can receive the token.

source

pub fn freeze_default(&mut self, freeze_default: bool) -> &mut Self

Sets the default freeze status (frozen or unfrozen) of hedera accounts relative to this token. If true, an account must be unfrozen before it can receive the token.

source

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

Returns the time at which the token should expire.

source

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

Sets the time at which the token should expire.

source

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

Returns the 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 account which will be automatically charged to renew the token’s expiration.

source

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

Returns the 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 interval at which the auto renew account will be charged to extend the token’s expiry.

source

pub fn get_token_memo(&self) -> &str

Returns the memo associated with the token.

source

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

Sets the memo associated with the token.

Maximum 100 bytes.

source

pub fn get_token_type(&self) -> TokenType

Returns the token type.

source

pub fn token_type(&mut self, token_type: TokenType) -> &mut Self

Sets the token type. Defaults to FungibleCommon.

source

pub fn get_token_supply_type(&self) -> TokenSupplyType

Returns the token supply type.

source

pub fn token_supply_type( &mut self, token_supply_type: TokenSupplyType ) -> &mut Self

Sets the token supply type. Defaults to Infinite.

source

pub fn get_max_supply(&self) -> u64

Returns the maximum number of tokens that can be in circulation.

source

pub fn max_supply(&mut self, max_supply: u64) -> &mut Self

Sets the maximum number of tokens that can be in circulation.

source

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

Returns the 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 key which can change the token’s custom fee schedule.

source

pub fn get_custom_fees(&self) -> &[AnyCustomFee]

Returns the custom fees to be assessed during a transfer.

source

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

Sets the custom fees to be assessed during a transfer.

source

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

Returns the key which can pause and unpause the token.

source

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

Sets the key which can pause and unpause the token.

source

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

Returns the metadata of the created token definition.

source

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

Sets metadata of the created token definition.

source

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

Returns the 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 key which can change the metadata of a token.