pub type AccountCreateTransaction = Transaction<AccountCreateTransactionData>;
Expand description
Create a new Hiero™ account.
Aliased Type§
pub struct AccountCreateTransaction { /* private fields */ }
Implementations§
Source§impl AccountCreateTransaction
impl AccountCreateTransaction
Sourcepub fn set_ecdsa_key_with_alias(&mut self, ecdsa_key: PrivateKey) -> &mut Self
pub fn set_ecdsa_key_with_alias(&mut self, ecdsa_key: PrivateKey) -> &mut Self
Sets the ECDSA(secp256k1) private key as the account key and derives the alias (EVM address) from it.
Sourcepub fn set_key_with_alias(
&mut self,
key: impl Into<Key>,
ecdsa_key: PrivateKey,
) -> &mut Self
pub fn set_key_with_alias( &mut self, key: impl Into<Key>, ecdsa_key: PrivateKey, ) -> &mut Self
Sets a generic key and an ECDSA(secp256k1) private key, and derives the alias from the ECDSA key.
Sourcepub fn set_key_without_alias(&mut self, key: impl Into<Key>) -> &mut Self
pub fn set_key_without_alias(&mut self, key: impl Into<Key>) -> &mut Self
Sets a generic key and unsets the alias.
Sourcepub fn get_key(&self) -> Option<&Key>
pub fn get_key(&self) -> Option<&Key>
Get the key this account will be created with.
Returns Some(key)
if previously set, None
otherwise.
Sourcepub fn key(&mut self, key: impl Into<Key>) -> &mut Self
👎Deprecated: use set_key_without_alias instead
pub fn key(&mut self, key: impl Into<Key>) -> &mut Self
Sets the key for this account.
Sourcepub fn get_initial_balance(&self) -> Hbar
pub fn get_initial_balance(&self) -> Hbar
Get the balance that will be transferred to this account on creation.
Returns initial_balance
if previously set, 0
otherwise.
Sourcepub fn initial_balance(&mut self, balance: Hbar) -> &mut Self
pub fn initial_balance(&mut self, balance: Hbar) -> &mut Self
Sets the balance that will be transferred to this account on creation.
Sourcepub fn get_receiver_signature_required(&self) -> bool
pub fn get_receiver_signature_required(&self) -> bool
Returns true
if this account must sign any transfer of hbars to itself.
Sourcepub fn receiver_signature_required(&mut self, required: bool) -> &mut Self
pub fn receiver_signature_required(&mut self, required: bool) -> &mut Self
Sets to true to require this account to sign any transfer of hbars to this account.
Sourcepub fn get_auto_renew_period(&self) -> Option<Duration>
pub fn get_auto_renew_period(&self) -> Option<Duration>
Returns the auto renew period for this account.
Sourcepub fn auto_renew_period(&mut self, period: Duration) -> &mut Self
pub fn auto_renew_period(&mut self, period: Duration) -> &mut Self
Sets the auto renew period for this account.
Sourcepub fn get_auto_renew_account_id(&self) -> Option<AccountId>
pub fn get_auto_renew_account_id(&self) -> Option<AccountId>
Gets the account to be used at this account’s expiration time to extend the
life of the account. If None
, this account pays for its own auto renewal fee.
§Network Support
Please note that this not supported on any hedera network at this time.
Sourcepub fn auto_renew_account_id(&mut self, id: AccountId) -> &mut Self
pub fn auto_renew_account_id(&mut self, id: AccountId) -> &mut Self
Sets the account to be used at this account’s expiration time to extend the
life of the account. If None
, this account pays for its own auto renewal fee.
§Network Support
Please note that this not supported on any hedera network at this time.
Sourcepub fn get_account_memo(&self) -> &str
pub fn get_account_memo(&self) -> &str
Get the memo associated with the account
Sourcepub fn account_memo(&mut self, memo: impl Into<String>) -> &mut Self
pub fn account_memo(&mut self, memo: impl Into<String>) -> &mut Self
Sets the memo associated with the account.
Sourcepub fn get_max_automatic_token_associations(&self) -> i32
pub fn get_max_automatic_token_associations(&self) -> i32
Get the maximum number of tokens that an Account can be implicitly associated with.
Defaults to 0
. Allows up to a maximum value of 1000
.
Sourcepub fn max_automatic_token_associations(&mut self, amount: i32) -> &mut Self
pub fn max_automatic_token_associations(&mut self, amount: i32) -> &mut Self
Sets the maximum number of tokens that an Account can be implicitly associated with.
Sourcepub fn get_alias(&self) -> Option<EvmAddress>
pub fn get_alias(&self) -> Option<EvmAddress>
Returns the evm address the account will be created with as an alias.
§Network Support
Please note that this not currently supported on mainnet.
Sourcepub fn alias(&mut self, alias: EvmAddress) -> &mut Self
pub fn alias(&mut self, alias: EvmAddress) -> &mut Self
Sets the evm address the account will be created with as an alias.
The last 20 bytes of the keccak-256 hash of a ECDSA_SECP256K1
primitive key.
§Network Support
Please note that this not currently supported on mainnet.
Sourcepub fn get_staked_account_id(&self) -> Option<AccountId>
pub fn get_staked_account_id(&self) -> Option<AccountId>
Returns the ID of the account to which this account is staking.
This is mutually exclusive with staked_node_id
.
Sourcepub fn staked_account_id(&mut self, id: AccountId) -> &mut Self
pub fn staked_account_id(&mut self, id: AccountId) -> &mut Self
Sets the ID of the account to which this account is staking.
This is mutually exclusive with staked_node_id
.
Sourcepub fn get_staked_node_id(&self) -> Option<u64>
pub fn get_staked_node_id(&self) -> Option<u64>
Returns the ID of the node to which this account is staking.
This is mutually exclusive with staked_account_id
.
Sourcepub fn staked_node_id(&mut self, id: u64) -> &mut Self
pub fn staked_node_id(&mut self, id: u64) -> &mut Self
Sets the ID of the node to which this account is staking.
This is mutually exclusive with staked_account_id
.
Sourcepub fn get_decline_staking_reward(&self) -> bool
pub fn get_decline_staking_reward(&self) -> bool
Returns true
if the account should decline receiving staking rewards, false
otherwise.
Sourcepub fn decline_staking_reward(&mut self, decline: bool) -> &mut Self
pub fn decline_staking_reward(&mut self, decline: bool) -> &mut Self
If true
, the account declines receiving a staking reward. The default value is false.