Struct hedera::Transaction
source · pub struct Transaction<D> { /* private fields */ }
Expand description
A transaction that can be executed on the Hedera network.
Implementations§
source§impl Transaction<AccountAllowanceApproveTransactionData>
impl Transaction<AccountAllowanceApproveTransactionData>
sourcepub fn approve_hbar_allowance(
&mut self,
owner_account_id: AccountId,
spender_account_id: AccountId,
amount: Hbar,
) -> &mut Self
pub fn approve_hbar_allowance( &mut self, owner_account_id: AccountId, spender_account_id: AccountId, amount: Hbar, ) -> &mut Self
Approves the hbar allowance.
sourcepub fn hbar_approvals(&self) -> &[HbarAllowance]
pub fn hbar_approvals(&self) -> &[HbarAllowance]
Returns the hbar allowances approved by the account owner.
sourcepub fn approve_token_allowance(
&mut self,
token_id: TokenId,
owner_account_id: AccountId,
spender_account_id: AccountId,
amount: u64,
) -> &mut Self
pub fn approve_token_allowance( &mut self, token_id: TokenId, owner_account_id: AccountId, spender_account_id: AccountId, amount: u64, ) -> &mut Self
Approves the token allowance.
sourcepub fn token_approvals(&self) -> &[TokenAllowance]
pub fn token_approvals(&self) -> &[TokenAllowance]
Returns the fungible token allowances approved by the account owner
sourcepub fn approve_token_nft_allowance(
&mut self,
nft_id: impl Into<NftId>,
owner_account_id: AccountId,
spender_account_id: AccountId,
) -> &mut Self
pub fn approve_token_nft_allowance( &mut self, nft_id: impl Into<NftId>, owner_account_id: AccountId, spender_account_id: AccountId, ) -> &mut Self
Approve the NFT allowance.
sourcepub fn approve_token_nft_allowance_all_serials(
&mut self,
token_id: TokenId,
owner_account_id: AccountId,
spender_account_id: AccountId,
) -> &mut Self
pub fn approve_token_nft_allowance_all_serials( &mut self, token_id: TokenId, owner_account_id: AccountId, spender_account_id: AccountId, ) -> &mut Self
Approve the NFT allowance on all serial numbers (present and future).
sourcepub fn token_nft_approvals(&self) -> &[NftAllowance]
pub fn token_nft_approvals(&self) -> &[NftAllowance]
Returns the non-fungible token allowances approved by the account owner.
source§impl Transaction<AccountAllowanceDeleteTransactionData>
impl Transaction<AccountAllowanceDeleteTransactionData>
sourcepub fn get_nft_allowances(&self) -> &[NftRemoveAllowance]
pub fn get_nft_allowances(&self) -> &[NftRemoveAllowance]
Get the nft allowances that will be removed.
sourcepub fn delete_all_token_nft_allowances(
&mut self,
nft_id: NftId,
owner_account_id: AccountId,
) -> &mut Self
pub fn delete_all_token_nft_allowances( &mut self, nft_id: NftId, owner_account_id: AccountId, ) -> &mut Self
Remove all nft token allowances.
source§impl Transaction<AccountCreateTransactionData>
impl Transaction<AccountCreateTransactionData>
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 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) -> u16
pub fn get_max_automatic_token_associations(&self) -> u16
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: u16) -> &mut Self
pub fn max_automatic_token_associations(&mut self, amount: u16) -> &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.
source§impl Transaction<AccountDeleteTransactionData>
impl Transaction<AccountDeleteTransactionData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Get the account ID which should be deleted.
sourcepub fn account_id(&mut self, id: AccountId) -> &mut Self
pub fn account_id(&mut self, id: AccountId) -> &mut Self
Sets the account ID which should be deleted.
sourcepub fn get_transfer_account_id(&self) -> Option<AccountId>
pub fn get_transfer_account_id(&self) -> Option<AccountId>
Get the account ID which will receive all remaining hbars.
sourcepub fn transfer_account_id(&mut self, id: AccountId) -> &mut Self
pub fn transfer_account_id(&mut self, id: AccountId) -> &mut Self
Sets the account ID which will receive all remaining hbars.
source§impl Transaction<AccountUpdateTransactionData>
impl Transaction<AccountUpdateTransactionData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Returns the ID for the account that is being updated.
sourcepub fn account_id(&mut self, id: AccountId) -> &mut Self
pub fn account_id(&mut self, id: AccountId) -> &mut Self
Sets the ID for the account that is being updated.
sourcepub fn get_expiration_time(&self) -> Option<OffsetDateTime>
pub fn get_expiration_time(&self) -> Option<OffsetDateTime>
Gets the new expiration time to extend to (ignored if equal to or before the current one).
sourcepub fn expiration_time(&mut self, at: OffsetDateTime) -> &mut Self
pub fn expiration_time(&mut self, at: OffsetDateTime) -> &mut Self
Sets the new expiration time to extend to (ignored if equal to or before the current one).
sourcepub fn get_receiver_signature_required(&self) -> Option<bool>
pub fn get_receiver_signature_required(&self) -> Option<bool>
If true, this account’s key must sign any transaction depositing hbar into this account.
sourcepub fn receiver_signature_required(&mut self, required: bool) -> &mut Self
pub fn receiver_signature_required(&mut self, required: bool) -> &mut Self
Set to true to require this account to sign any transfer of hbars to this account.
sourcepub fn get_proxy_account_id(&self) -> Option<AccountId>
👎Deprecated
pub fn get_proxy_account_id(&self) -> Option<AccountId>
Gets the ID of the account to which this account will be updated to be proxy staked to.
sourcepub fn proxy_account_id(&mut self, proxy_account_id: AccountId) -> &mut Self
👎Deprecated
pub fn proxy_account_id(&mut self, proxy_account_id: AccountId) -> &mut Self
Sets the proxy account ID for this account.
If proxy_account_id
is None
, or is an invalid account, or is an account
that isn’t a node, then this account is automatically proxy staked to
a node chosen by the network, but without earning payments.
If the proxy_account_id
account refuses to accept proxy staking, or
if it is not currently running a node, then it
will behave as if proxy_account_id
was None
.
sourcepub fn get_auto_renew_period(&self) -> Option<Duration>
pub fn get_auto_renew_period(&self) -> Option<Duration>
Returns the new auto renew period.
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>
Returns the new auto renew account id.
§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) -> Option<&str>
pub fn get_account_memo(&self) -> Option<&str>
Returns 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) -> Option<u16>
pub fn get_max_automatic_token_associations(&self) -> Option<u16>
Returns the maximum number of tokens that an Account can be implicitly associated with.
sourcepub fn max_automatic_token_associations(&mut self, amount: u16) -> &mut Self
pub fn max_automatic_token_associations(&mut self, amount: u16) -> &mut Self
Sets the maximum number of tokens that an Account can be implicitly associated with.
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 clear_staked_account_id(&mut self) -> &mut Self
pub fn clear_staked_account_id(&mut self) -> &mut Self
Clears the account’s staked account 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 clear_staked_node_id(&mut self) -> &mut Self
pub fn clear_staked_node_id(&mut self) -> &mut Self
Clears the account’s staked node ID.
sourcepub fn get_decline_staking_reward(&self) -> Option<bool>
pub fn get_decline_staking_reward(&self) -> Option<bool>
Returns true
if this account should decline receiving a staking reward,
false
if it should not,
and None
if the value should remain unchanged.
sourcepub fn decline_staking_reward(&mut self, decline: bool) -> &mut Self
pub fn decline_staking_reward(&mut self, decline: bool) -> &mut Self
If set to true, the account declines receiving a staking reward. The default value is false.
source§impl Transaction<ContractCreateTransactionData>
impl Transaction<ContractCreateTransactionData>
sourcepub fn get_bytecode_file_id(&self) -> Option<FileId>
pub fn get_bytecode_file_id(&self) -> Option<FileId>
Returns the FileId
to be used as the bytecode for this smart contract.
sourcepub fn bytecode_file_id(&mut self, file_id: FileId) -> &mut Self
pub fn bytecode_file_id(&mut self, file_id: FileId) -> &mut Self
Sets the file to use as the bytes for the smart contract.
sourcepub fn get_bytecode(&self) -> Option<&[u8]>
pub fn get_bytecode(&self) -> Option<&[u8]>
Returns the bytecode for the smart contract.
sourcepub fn bytecode(&mut self, bytecode: impl AsRef<[u8]>) -> &mut Self
pub fn bytecode(&mut self, bytecode: impl AsRef<[u8]>) -> &mut Self
Sets the bytes of the smart contract.
sourcepub fn get_admin_key(&self) -> Option<&Key>
pub fn get_admin_key(&self) -> Option<&Key>
Returns the admin key.
sourcepub fn get_initial_balance(&self) -> Hbar
pub fn get_initial_balance(&self) -> Hbar
Returns the initial balance to put into the cryptocurrency account associated with the new smart contract.
sourcepub fn initial_balance(&mut self, balance: Hbar) -> &mut Self
pub fn initial_balance(&mut self, balance: Hbar) -> &mut Self
Sets the initial balance to put into the cryptocurrency account associated with the new smart contract.
sourcepub fn get_auto_renew_period(&self) -> Duration
pub fn get_auto_renew_period(&self) -> Duration
Returns the auto renew period for this smart contract.
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 smart contract.
sourcepub fn get_constructor_parameters(&self) -> &[u8] ⓘ
pub fn get_constructor_parameters(&self) -> &[u8] ⓘ
Returns the parameters to pass to the constructor.
sourcepub fn constructor_parameters(
&mut self,
parameters: impl AsRef<[u8]>,
) -> &mut Self
pub fn constructor_parameters( &mut self, parameters: impl AsRef<[u8]>, ) -> &mut Self
Sets the parameters to pass to the constructor.
sourcepub fn get_contract_memo(&self) -> &str
pub fn get_contract_memo(&self) -> &str
Returns the memo for the new smart contract.
sourcepub fn contract_memo(&mut self, memo: impl Into<String>) -> &mut Self
pub fn contract_memo(&mut self, memo: impl Into<String>) -> &mut Self
Sets the memo for the new smart contract.
sourcepub fn get_max_automatic_token_associations(&self) -> u32
pub fn get_max_automatic_token_associations(&self) -> u32
Returns the maximum number of tokens that the contract can be automatically associated with.
sourcepub fn max_automatic_token_associations(&mut self, max: u32) -> &mut Self
pub fn max_automatic_token_associations(&mut self, max: u32) -> &mut Self
Sets the maximum number of tokens that this contract can be automatically associated with.
sourcepub fn get_auto_renew_account_id(&self) -> Option<AccountId>
pub fn get_auto_renew_account_id(&self) -> Option<AccountId>
Returns the account ot be used at the contract’s expiration time to extend the life of the contract
sourcepub fn auto_renew_account_id(&mut self, account_id: AccountId) -> &mut Self
pub fn auto_renew_account_id(&mut self, account_id: AccountId) -> &mut Self
Sets the account to be used at the contract’s expiration time to extend the life of the contract.
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 contract is staking.
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 contract 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 contract is staking.
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 contract 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 contract will 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 contract should declie receiving staking rewards. The default value is false
.
source§impl Transaction<ContractDeleteTransactionData>
impl Transaction<ContractDeleteTransactionData>
sourcepub fn get_contract_id(&self) -> Option<ContractId>
pub fn get_contract_id(&self) -> Option<ContractId>
Returns the ID of the contract that should be deleted.
sourcepub fn contract_id(&mut self, id: ContractId) -> &mut Self
pub fn contract_id(&mut self, id: ContractId) -> &mut Self
Sets ID of the contract which should be deleted.
sourcepub fn get_transfer_account_id(&self) -> Option<AccountId>
pub fn get_transfer_account_id(&self) -> Option<AccountId>
Returns the ID of the account which will receive all remaining hbars.
sourcepub fn transfer_account_id(&mut self, id: AccountId) -> &mut Self
pub fn transfer_account_id(&mut self, id: AccountId) -> &mut Self
Sets the ID of the account which will receive all remaining hbars.
sourcepub fn get_transfer_contract_id(&self) -> Option<ContractId>
pub fn get_transfer_contract_id(&self) -> Option<ContractId>
Returns ID of the contract which will receive all rmaining hbars.
sourcepub fn transfer_contract_id(&mut self, id: ContractId) -> &mut Self
pub fn transfer_contract_id(&mut self, id: ContractId) -> &mut Self
Sets the the ID of the contract which will receive all remaining hbars.
source§impl Transaction<ContractExecuteTransactionData>
impl Transaction<ContractExecuteTransactionData>
sourcepub fn get_contract_id(&self) -> Option<ContractId>
pub fn get_contract_id(&self) -> Option<ContractId>
Returns the contract instance to call.
sourcepub fn contract_id(&mut self, contract_id: ContractId) -> &mut Self
pub fn contract_id(&mut self, contract_id: ContractId) -> &mut Self
Sets the contract instance to call.
sourcepub fn gas(&mut self, gas: u64) -> &mut Self
pub fn gas(&mut self, gas: u64) -> &mut Self
Sets the maximum amount of gas to use for the call.
sourcepub fn get_payable_amount(&self) -> Hbar
pub fn get_payable_amount(&self) -> Hbar
Returns the number of hbars to be sent with this function call.
sourcepub fn payable_amount(&mut self, amount: Hbar) -> &mut Self
pub fn payable_amount(&mut self, amount: Hbar) -> &mut Self
Sets the number of hbars to be sent with this function call.
sourcepub fn get_function_parameters(&self) -> &[u8] ⓘ
pub fn get_function_parameters(&self) -> &[u8] ⓘ
Returns the function parameters as their raw bytes.
sourcepub fn function_parameters(&mut self, data: Vec<u8>) -> &mut Self
pub fn function_parameters(&mut self, data: Vec<u8>) -> &mut Self
Sets the function parameters as their raw bytes.
sourcepub fn function_with_parameters(
&mut self,
name: &str,
parameters: &ContractFunctionParameters,
) -> &mut Self
pub fn function_with_parameters( &mut self, name: &str, parameters: &ContractFunctionParameters, ) -> &mut Self
Sets the function with parameters.
source§impl Transaction<ContractUpdateTransactionData>
impl Transaction<ContractUpdateTransactionData>
sourcepub fn get_contract_id(&self) -> Option<ContractId>
pub fn get_contract_id(&self) -> Option<ContractId>
Returns the contract to be updated.
sourcepub fn contract_id(&mut self, contract_id: ContractId) -> &mut Self
pub fn contract_id(&mut self, contract_id: ContractId) -> &mut Self
Sets the contract to be updated.
sourcepub fn get_admin_key(&self) -> Option<&Key>
pub fn get_admin_key(&self) -> Option<&Key>
Returns the new admin key.
sourcepub fn get_expiration_time(&self) -> Option<OffsetDateTime>
pub fn get_expiration_time(&self) -> Option<OffsetDateTime>
Returns the new expiration time to extend to (ignored if equal to or before the current one).
sourcepub fn expiration_time(&mut self, at: OffsetDateTime) -> &mut Self
pub fn expiration_time(&mut self, at: OffsetDateTime) -> &mut Self
Sets the new expiration time to extend to (ignored if equal to or before the current one).
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 smart contract.
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 smart contract.
sourcepub fn get_contract_memo(&self) -> Option<&str>
pub fn get_contract_memo(&self) -> Option<&str>
Returns the new memo for the smart contract.
sourcepub fn contract_memo(&mut self, memo: impl Into<String>) -> &mut Self
pub fn contract_memo(&mut self, memo: impl Into<String>) -> &mut Self
Sets the new memo for the smart contract.
sourcepub fn get_max_automatic_token_associations(&self) -> Option<u32>
pub fn get_max_automatic_token_associations(&self) -> Option<u32>
Returns the maximum number of tokens that this contract can be automatically associated with.
sourcepub fn max_automatic_token_associations(&mut self, max: u32) -> &mut Self
pub fn max_automatic_token_associations(&mut self, max: u32) -> &mut Self
Sets the maximum number of tokens that this contract can be automatically associated with.
sourcepub fn get_auto_renew_account_id(&self) -> Option<AccountId>
pub fn get_auto_renew_account_id(&self) -> Option<AccountId>
Returns the account to be used at the contract’s expiration time to extend the life of the contract.
sourcepub fn auto_renew_account_id(&mut self, account_id: AccountId) -> &mut Self
pub fn auto_renew_account_id(&mut self, account_id: AccountId) -> &mut Self
Sets the account to be used at the contract’s expiration time to extend the life of the contract.
sourcepub fn get_proxy_account_id(&self) -> Option<AccountId>
pub fn get_proxy_account_id(&self) -> Option<AccountId>
Returns the ID of the account to which this contract is proxy staked.
sourcepub fn proxy_account_id(&mut self, id: AccountId) -> &mut Self
pub fn proxy_account_id(&mut self, id: AccountId) -> &mut Self
Sets the ID of the account to which this contract is proxy staked.
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 contract is staking.
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 contract 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 contract is staking.
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 contract is staking.
This is mutually exclusive with staked_account_id
.
sourcepub fn get_decline_staking_reward(&self) -> Option<bool>
pub fn get_decline_staking_reward(&self) -> Option<bool>
Returns true
if the contract will be updated decline staking rewards,
false
if it will be updated to not,
and None
if it will not be updated.
sourcepub fn decline_staking_reward(&mut self, decline: bool) -> &mut Self
pub fn decline_staking_reward(&mut self, decline: bool) -> &mut Self
Sets to true, the contract declines receiving a staking reward. The default value is false.
source§impl Transaction<EthereumTransactionData>
impl Transaction<EthereumTransactionData>
sourcepub fn get_ethereum_data(&self) -> &[u8] ⓘ
pub fn get_ethereum_data(&self) -> &[u8] ⓘ
Returns the raw Ethereum transaction (RLP encoded type 0, 1, and 2).
sourcepub fn ethereum_data(&mut self, data: Vec<u8>) -> &mut Self
pub fn ethereum_data(&mut self, data: Vec<u8>) -> &mut Self
Sets the raw Ethereum transaction (RLP encoded type 0, 1, and 2).
sourcepub fn get_call_data_file_id(&self) -> Option<FileId>
pub fn get_call_data_file_id(&self) -> Option<FileId>
Returns the file ID to find the raw Ethereum transaction (RLP encoded type 0, 1, and 2).
sourcepub fn call_data_file_id(&mut self, id: FileId) -> &mut Self
pub fn call_data_file_id(&mut self, id: FileId) -> &mut Self
Sets a file ID to find the raw Ethereum transaction (RLP encoded type 0, 1, and 2).
For large transactions (for example contract create) this should be used to
set the FileId
of an HFS file containing the call_data
of the ethereum_data
. The data in the ethereum_data
will be re-written with
the call_data
element as a zero length string with the original contents in
the referenced file at time of execution. The ethereum_data
will need to be
“rehydrated” with the call_data
for signature validation to pass.
sourcepub fn get_max_gas_allowance_hbar(&self) -> Hbar
pub fn get_max_gas_allowance_hbar(&self) -> Hbar
Returns the maximum amount that the payer of the hedera transaction is willing to pay to complete the transaction.
sourcepub fn max_gas_allowance_hbar(&mut self, allowance: Hbar) -> &mut Self
pub fn max_gas_allowance_hbar(&mut self, allowance: Hbar) -> &mut Self
Sets the maximum amount that the payer of the hedera transaction is willing to pay to complete the transaction.
source§impl Transaction<FileAppendTransactionData>
impl Transaction<FileAppendTransactionData>
sourcepub fn get_file_id(&self) -> Option<FileId>
pub fn get_file_id(&self) -> Option<FileId>
Returns the file to which the bytes will be appended.
sourcepub fn file_id(&mut self, id: impl Into<FileId>) -> &mut Self
pub fn file_id(&mut self, id: impl Into<FileId>) -> &mut Self
Sets the file to which the bytes will be appended.
sourcepub fn get_contents(&self) -> Option<&[u8]>
pub fn get_contents(&self) -> Option<&[u8]>
Retuns the bytes that will be appended to the end of the specified file.
source§impl Transaction<FileCreateTransactionData>
impl Transaction<FileCreateTransactionData>
sourcepub fn get_file_memo(&self) -> &str
pub fn get_file_memo(&self) -> &str
Returns the memo to be associated with the file.
sourcepub fn file_memo(&mut self, memo: impl Into<String>) -> &mut Self
pub fn file_memo(&mut self, memo: impl Into<String>) -> &mut Self
Sets the memo associated with the file.
sourcepub fn get_contents(&self) -> Option<&[u8]>
pub fn get_contents(&self) -> Option<&[u8]>
Returns the bytes that are to be the contents of the file.
sourcepub fn contents(&mut self, contents: impl Into<Vec<u8>>) -> &mut Self
pub fn contents(&mut self, contents: impl Into<Vec<u8>>) -> &mut Self
Sets the bytes that are to be the contents of the file.
sourcepub fn keys<K: Into<Key>>(
&mut self,
keys: impl IntoIterator<Item = K>,
) -> &mut Self
pub fn keys<K: Into<Key>>( &mut self, keys: impl IntoIterator<Item = K>, ) -> &mut Self
Sets the keys for this file.
All keys at the top level of a key list must sign to create or modify the file. Any one of the keys at the top level key list can sign to delete the file.
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 file.
§Network Support
Please note that this not supported on any hedera network at this time.
sourcepub fn auto_renew_period(&mut self, duration: Duration) -> &mut Self
pub fn auto_renew_period(&mut self, duration: Duration) -> &mut Self
Sets the auto renew period for this file.
§Network Support
Please note that this not supported on any hedera network at this time.
sourcepub fn get_auto_renew_account_id(&self) -> Option<AccountId>
pub fn get_auto_renew_account_id(&self) -> Option<AccountId>
Returns the account to be used at the file’s expiration time to extend the life of the file.
§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 the files’s expiration time to extend the life of the file.
§Network Support
Please note that this not supported on any hedera network at this time.
sourcepub fn get_expiration_time(&self) -> Option<OffsetDateTime>
pub fn get_expiration_time(&self) -> Option<OffsetDateTime>
Returns the time at which this file should expire.
sourcepub fn expiration_time(&mut self, at: OffsetDateTime) -> &mut Self
pub fn expiration_time(&mut self, at: OffsetDateTime) -> &mut Self
Sets the time at which this file should expire.
source§impl Transaction<FileDeleteTransactionData>
impl Transaction<FileDeleteTransactionData>
source§impl Transaction<FileUpdateTransactionData>
impl Transaction<FileUpdateTransactionData>
sourcepub fn get_file_id(&self) -> Option<FileId>
pub fn get_file_id(&self) -> Option<FileId>
Returns the ID of the file which is being updated.
sourcepub fn file_id(&mut self, id: impl Into<FileId>) -> &mut Self
pub fn file_id(&mut self, id: impl Into<FileId>) -> &mut Self
Sets the ID of the file which is being updated.
sourcepub fn get_file_memo(&self) -> Option<&str>
pub fn get_file_memo(&self) -> Option<&str>
Returns the new memo for the file.
sourcepub fn file_memo(&mut self, memo: impl Into<String>) -> &mut Self
pub fn file_memo(&mut self, memo: impl Into<String>) -> &mut Self
Sets the new memo to be associated with the file.
sourcepub fn get_contents(&self) -> Option<&[u8]>
pub fn get_contents(&self) -> Option<&[u8]>
Returns the bytes that are to be the contents of the file.
sourcepub fn contents(&mut self, contents: Vec<u8>) -> &mut Self
pub fn contents(&mut self, contents: Vec<u8>) -> &mut Self
Sets the bytes that are to be the contents of the file.
sourcepub fn keys<K: Into<Key>>(
&mut self,
keys: impl IntoIterator<Item = K>,
) -> &mut Self
pub fn keys<K: Into<Key>>( &mut self, keys: impl IntoIterator<Item = K>, ) -> &mut Self
Sets the keys for this file.
All keys at the top level of a key list must sign to create or modify the file. Any one of the keys at the top level key list can sign to delete the file.
sourcepub fn get_expiration_time(&self) -> Option<OffsetDateTime>
pub fn get_expiration_time(&self) -> Option<OffsetDateTime>
Returns the time at which this file should expire.
sourcepub fn expiration_time(&mut self, at: OffsetDateTime) -> &mut Self
pub fn expiration_time(&mut self, at: OffsetDateTime) -> &mut Self
Sets the time at which this file should expire.
sourcepub fn get_auto_renew_account_id(&self) -> Option<AccountId>
pub fn get_auto_renew_account_id(&self) -> Option<AccountId>
Returns the account to be used at the file’s expiration time to extend the life of the file.
§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 the files’s expiration time to extend the life of the file.
§Network Support
Please note that this not supported on any hedera network at this time.
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 file.
§Network Support
Please note that this not supported on any hedera network at this time.
sourcepub fn auto_renew_period(&mut self, duration: Duration) -> &mut Self
pub fn auto_renew_period(&mut self, duration: Duration) -> &mut Self
Sets the auto renew period for this file.
§Network Support
Please note that this not supported on any hedera network at this time.
source§impl Transaction<PrngTransactionData>
impl Transaction<PrngTransactionData>
source§impl Transaction<ScheduleCreateTransactionData>
impl Transaction<ScheduleCreateTransactionData>
sourcepub fn scheduled_transaction<D>(
&mut self,
transaction: Transaction<D>,
) -> &mut Selfwhere
D: TransactionExecute,
pub fn scheduled_transaction<D>(
&mut self,
transaction: Transaction<D>,
) -> &mut Selfwhere
D: TransactionExecute,
Sets the scheduled transaction.
§Panics
panics if the transaction is not schedulable, a transaction can be non-schedulable due to:
- being a transaction kind that’s non-schedulable, IE,
EthereumTransaction
, or - being a chunked transaction with multiple chunks.
sourcepub fn get_expiration_time(&self) -> Option<OffsetDateTime>
pub fn get_expiration_time(&self) -> Option<OffsetDateTime>
Returns the timestamp for when the transaction should be evaluated for execution and then expire.
sourcepub fn expiration_time(&mut self, time: OffsetDateTime) -> &mut Self
pub fn expiration_time(&mut self, time: OffsetDateTime) -> &mut Self
Sets the timestamp for when the transaction should be evaluated for execution and then expire.
sourcepub fn get_wait_for_expiry(&self) -> bool
pub fn get_wait_for_expiry(&self) -> bool
Returns true
if the transaction will be evaluated at expiration_time
instead
of when all the required signatures are received, false
otherwise.
sourcepub fn wait_for_expiry(&mut self, wait: bool) -> &mut Self
pub fn wait_for_expiry(&mut self, wait: bool) -> &mut Self
Sets if the transaction will be evaluated for execution at expiration_time
instead
of when all required signatures are received.
sourcepub fn get_payer_account_id(&self) -> Option<AccountId>
pub fn get_payer_account_id(&self) -> Option<AccountId>
Returns the id of the account to be charged the service fee for the scheduled transaction at the consensus time it executes (if ever).
sourcepub fn payer_account_id(&mut self, id: AccountId) -> &mut Self
pub fn payer_account_id(&mut self, id: AccountId) -> &mut Self
Sets the id of the account to be charged the service fee for the scheduled transaction at the consensus time that it executes (if ever).
sourcepub fn get_schedule_memo(&self) -> Option<&str>
pub fn get_schedule_memo(&self) -> Option<&str>
Returns the memo for the schedule entity.
sourcepub fn schedule_memo(&mut self, memo: impl Into<String>) -> &mut Self
pub fn schedule_memo(&mut self, memo: impl Into<String>) -> &mut Self
Sets the memo for the schedule entity.
sourcepub fn get_admin_key(&self) -> Option<&Key>
pub fn get_admin_key(&self) -> Option<&Key>
Returns the Hedera key which can be used to sign a ScheduleDelete
and remove the schedule.
source§impl Transaction<ScheduleDeleteTransactionData>
impl Transaction<ScheduleDeleteTransactionData>
sourcepub fn get_schedule_id(&self) -> Option<ScheduleId>
pub fn get_schedule_id(&self) -> Option<ScheduleId>
Returns the schedule to delete.
sourcepub fn schedule_id(&mut self, id: ScheduleId) -> &mut Self
pub fn schedule_id(&mut self, id: ScheduleId) -> &mut Self
Sets the schedule to delete.
source§impl Transaction<ScheduleSignTransactionData>
impl Transaction<ScheduleSignTransactionData>
sourcepub fn get_schedule_id(&self) -> Option<ScheduleId>
pub fn get_schedule_id(&self) -> Option<ScheduleId>
Returns the schedule to add signing keys to.
sourcepub fn schedule_id(&mut self, id: ScheduleId) -> &mut Self
pub fn schedule_id(&mut self, id: ScheduleId) -> &mut Self
Sets the schedule to add signing keys to.
source§impl Transaction<FreezeTransactionData>
impl Transaction<FreezeTransactionData>
sourcepub fn get_start_time(&self) -> Option<OffsetDateTime>
pub fn get_start_time(&self) -> Option<OffsetDateTime>
Returns the start time.
sourcepub fn start_time(&mut self, time: OffsetDateTime) -> &mut Self
pub fn start_time(&mut self, time: OffsetDateTime) -> &mut Self
Sets the start time.
sourcepub fn get_freeze_type(&self) -> FreezeType
pub fn get_freeze_type(&self) -> FreezeType
Returns the freeze type.
sourcepub fn freeze_type(&mut self, ty: FreezeType) -> &mut Self
pub fn freeze_type(&mut self, ty: FreezeType) -> &mut Self
Sets the freeze type.
sourcepub fn get_file_id(&self) -> Option<FileId>
pub fn get_file_id(&self) -> Option<FileId>
Returns the file ID.
sourcepub fn get_file_hash(&self) -> Option<&[u8]>
pub fn get_file_hash(&self) -> Option<&[u8]>
Returns the file hash.
source§impl Transaction<SystemDeleteTransactionData>
impl Transaction<SystemDeleteTransactionData>
sourcepub fn get_contract_id(&self) -> Option<ContractId>
pub fn get_contract_id(&self) -> Option<ContractId>
Returns the contract ID which should be deleted.
sourcepub fn contract_id(&mut self, id: impl Into<ContractId>) -> &mut Self
pub fn contract_id(&mut self, id: impl Into<ContractId>) -> &mut Self
Sets the contract ID which should be deleted.
sourcepub fn get_file_id(&self) -> Option<FileId>
pub fn get_file_id(&self) -> Option<FileId>
Returns the file ID which should be deleted.
sourcepub fn file_id(&mut self, id: impl Into<FileId>) -> &mut Self
pub fn file_id(&mut self, id: impl Into<FileId>) -> &mut Self
Sets the file ID which should be deleted.
sourcepub fn get_expiration_time(&self) -> Option<OffsetDateTime>
pub fn get_expiration_time(&self) -> Option<OffsetDateTime>
Returns the timestamp at which the “deleted” entity should truly be permanently deleted.
sourcepub fn expiration_time(&mut self, expiration_time: OffsetDateTime) -> &mut Self
pub fn expiration_time(&mut self, expiration_time: OffsetDateTime) -> &mut Self
Sets the timestamp at which the “deleted” file should truly be permanently deleted.
source§impl Transaction<SystemUndeleteTransactionData>
impl Transaction<SystemUndeleteTransactionData>
sourcepub fn get_contract_id(&self) -> Option<ContractId>
pub fn get_contract_id(&self) -> Option<ContractId>
Returns the contract ID to undelete.
sourcepub fn contract_id(&mut self, id: impl Into<ContractId>) -> &mut Self
pub fn contract_id(&mut self, id: impl Into<ContractId>) -> &mut Self
Sets the contract ID to undelete.
sourcepub fn get_file_id(&self) -> Option<FileId>
pub fn get_file_id(&self) -> Option<FileId>
Returns the file ID to undelete.
source§impl Transaction<TokenAssociateTransactionData>
impl Transaction<TokenAssociateTransactionData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Returns the account to be associated with the provided tokens.
sourcepub fn account_id(&mut self, account_id: AccountId) -> &mut Self
pub fn account_id(&mut self, account_id: AccountId) -> &mut Self
Sets the account to be associated with the provided tokens.
sourcepub fn get_token_ids(&self) -> &[TokenId]
pub fn get_token_ids(&self) -> &[TokenId]
Returns the tokens to be associated with the provided account.
sourcepub fn token_ids(
&mut self,
token_ids: impl IntoIterator<Item = TokenId>,
) -> &mut Self
pub fn token_ids( &mut self, token_ids: impl IntoIterator<Item = TokenId>, ) -> &mut Self
Sets the tokens to be associated with the provided account.
source§impl Transaction<TokenBurnTransactionData>
impl Transaction<TokenBurnTransactionData>
sourcepub fn get_token_id(&self) -> Option<TokenId>
pub fn get_token_id(&self) -> Option<TokenId>
Returns the token for which to burn tokens.
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 for which to burn tokens.
sourcepub fn get_amount(&self) -> u64
pub fn get_amount(&self) -> u64
Returns the amount of a fungible token to burn from the treasury account.
sourcepub fn amount(&mut self, amount: impl Into<u64>) -> &mut Self
pub fn amount(&mut self, amount: impl Into<u64>) -> &mut Self
Sets the amount of a fungible token to burn from the treasury account.
sourcepub fn get_serials(&self) -> &[i64]
pub fn get_serials(&self) -> &[i64]
Returns the serial numbers of a non-fungible token to burn from the treasury account.
sourcepub fn serials(&mut self, serials: impl IntoIterator<Item = i64>) -> &mut Self
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.
source§impl Transaction<TokenCreateTransactionData>
impl Transaction<TokenCreateTransactionData>
sourcepub fn name(&mut self, name: impl Into<String>) -> &mut Self
pub fn name(&mut self, name: impl Into<String>) -> &mut Self
Sets the publicly visible name of the token.
Maximum 100 characters.
sourcepub fn get_symbol(&self) -> &str
pub fn get_symbol(&self) -> &str
Returns the publicly visible token symbol.
sourcepub fn symbol(&mut self, symbol: impl Into<String>) -> &mut Self
pub fn symbol(&mut self, symbol: impl Into<String>) -> &mut Self
Sets the publicly visible token symbol.
Maximum 100 characters.
sourcepub fn get_decimals(&self) -> u32
pub fn get_decimals(&self) -> u32
Returns the number of decimal places the token is divisble by.
sourcepub fn decimals(&mut self, decimals: u32) -> &mut Self
pub fn decimals(&mut self, decimals: u32) -> &mut Self
Sets the number of decimal places a token is divisible by.
sourcepub fn get_initial_supply(&self) -> u64
pub fn get_initial_supply(&self) -> u64
Returns the initial supply of tokens to be put into circulation.
sourcepub fn initial_supply(&mut self, initial_supply: u64) -> &mut Self
pub fn initial_supply(&mut self, initial_supply: u64) -> &mut Self
Sets the initial supply of tokens to be put in circulation.
sourcepub fn get_treasury_account_id(&self) -> Option<AccountId>
pub fn get_treasury_account_id(&self) -> Option<AccountId>
Returns the 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 account which will act as a treasury for the token.
sourcepub fn get_admin_key(&self) -> Option<&Key>
pub fn get_admin_key(&self) -> Option<&Key>
Returns the key whcih 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 key which can perform update/delete operations on the token.
sourcepub fn get_kyc_key(&self) -> Option<&Key>
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.
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 key which can grant or revoke KYC of an account for the token’s transactions.
sourcepub fn get_freeze_key(&self) -> Option<&Key>
pub fn get_freeze_key(&self) -> Option<&Key>
Returns the 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 key which can sign to freeze or unfreeze an account for token transactions.
sourcepub fn get_wipe_key(&self) -> Option<&Key>
pub fn get_wipe_key(&self) -> Option<&Key>
Returns the 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 key which can wipe the token balance of an account.
sourcepub fn get_supply_key(&self) -> Option<&Key>
pub fn get_supply_key(&self) -> Option<&Key>
Returns the key which can change the supply of the 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 key which can change the supply of the token.
sourcepub fn get_freeze_default(&self) -> bool
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.
sourcepub fn freeze_default(&mut self, freeze_default: bool) -> &mut Self
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.
sourcepub fn get_expiration_time(&self) -> Option<OffsetDateTime>
pub fn get_expiration_time(&self) -> Option<OffsetDateTime>
Returns the 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 time at which the token should expire.
sourcepub fn get_auto_renew_account_id(&self) -> Option<AccountId>
pub fn get_auto_renew_account_id(&self) -> Option<AccountId>
Returns the 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 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 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 interval at which the auto renew account will be charged to extend the token’s expiry.
sourcepub fn get_token_memo(&self) -> &str
pub fn get_token_memo(&self) -> &str
Returns the memo associated with the token.
sourcepub fn token_memo(&mut self, memo: impl Into<String>) -> &mut Self
pub fn token_memo(&mut self, memo: impl Into<String>) -> &mut Self
Sets the memo associated with the token.
Maximum 100 bytes.
sourcepub fn get_token_type(&self) -> TokenType
pub fn get_token_type(&self) -> TokenType
Returns the token type.
sourcepub fn token_type(&mut self, token_type: TokenType) -> &mut Self
pub fn token_type(&mut self, token_type: TokenType) -> &mut Self
Sets the token type. Defaults to FungibleCommon
.
sourcepub fn get_token_supply_type(&self) -> TokenSupplyType
pub fn get_token_supply_type(&self) -> TokenSupplyType
Returns the token supply type.
sourcepub fn token_supply_type(
&mut self,
token_supply_type: TokenSupplyType,
) -> &mut Self
pub fn token_supply_type( &mut self, token_supply_type: TokenSupplyType, ) -> &mut Self
Sets the token supply type. Defaults to Infinite
.
sourcepub fn get_max_supply(&self) -> u64
pub fn get_max_supply(&self) -> u64
Returns the maximum number of tokens that can be in circulation.
sourcepub fn max_supply(&mut self, max_supply: u64) -> &mut Self
pub fn max_supply(&mut self, max_supply: u64) -> &mut Self
Sets the maximum number of tokens that can be in circulation.
sourcepub fn get_fee_schedule_key(&self) -> Option<&Key>
pub fn get_fee_schedule_key(&self) -> Option<&Key>
Returns the 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 key which can change the token’s custom fee schedule.
sourcepub fn get_custom_fees(&self) -> &[AnyCustomFee]
pub fn get_custom_fees(&self) -> &[AnyCustomFee]
Returns the custom fees to be assessed during a transfer.
sourcepub fn custom_fees(
&mut self,
custom_fees: impl IntoIterator<Item = AnyCustomFee>,
) -> &mut Self
pub fn custom_fees( &mut self, custom_fees: impl IntoIterator<Item = AnyCustomFee>, ) -> &mut Self
Sets the custom fees to be assessed during a transfer.
sourcepub fn get_pause_key(&self) -> Option<&Key>
pub fn get_pause_key(&self) -> Option<&Key>
Returns the 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 key which can pause and unpause the token.
sourcepub fn get_metadata(&self) -> Vec<u8> ⓘ
pub fn get_metadata(&self) -> Vec<u8> ⓘ
Returns the 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 metadata of the created token definition.
sourcepub fn get_metadata_key(&self) -> Option<&Key>
pub fn get_metadata_key(&self) -> Option<&Key>
Returns the 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 key which can change the metadata of a token.
source§impl Transaction<TokenDeleteTransactionData>
impl Transaction<TokenDeleteTransactionData>
source§impl Transaction<TokenDissociateTransactionData>
impl Transaction<TokenDissociateTransactionData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Returns the account to be dissociated with the provided tokens.
sourcepub fn account_id(&mut self, account_id: AccountId) -> &mut Self
pub fn account_id(&mut self, account_id: AccountId) -> &mut Self
Sets the account to be dissociated with the provided tokens.
sourcepub fn get_token_ids(&self) -> &[TokenId]
pub fn get_token_ids(&self) -> &[TokenId]
Returns the tokens to be dissociated with the provided account.
sourcepub fn token_ids(
&mut self,
token_ids: impl IntoIterator<Item = TokenId>,
) -> &mut Self
pub fn token_ids( &mut self, token_ids: impl IntoIterator<Item = TokenId>, ) -> &mut Self
Sets the tokens to be dissociated with the provided account.
source§impl Transaction<TokenFeeScheduleUpdateTransactionData>
impl Transaction<TokenFeeScheduleUpdateTransactionData>
sourcepub fn get_token_id(&self) -> Option<TokenId>
pub fn get_token_id(&self) -> Option<TokenId>
Returns the ID of the token that’s being 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 ID of the token that’s being updated.
sourcepub fn get_custom_fees(&self) -> &[AnyCustomFee]
pub fn get_custom_fees(&self) -> &[AnyCustomFee]
Returns the new custom fees to be assessed during a transfer.
sourcepub fn custom_fees(
&mut self,
custom_fees: impl IntoIterator<Item = AnyCustomFee>,
) -> &mut Self
pub fn custom_fees( &mut self, custom_fees: impl IntoIterator<Item = AnyCustomFee>, ) -> &mut Self
Sets the new custom fees to be assessed during a transfer.
source§impl Transaction<TokenFreezeTransactionData>
impl Transaction<TokenFreezeTransactionData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Returns the account to be frozen.
sourcepub fn account_id(&mut self, account_id: AccountId) -> &mut Self
pub fn account_id(&mut self, account_id: AccountId) -> &mut Self
Sets the account to be frozen.
sourcepub fn get_token_id(&self) -> Option<TokenId>
pub fn get_token_id(&self) -> Option<TokenId>
Returns the toke nfor which the account will be frozen.
source§impl Transaction<TokenGrantKycTransactionData>
impl Transaction<TokenGrantKycTransactionData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Returns the account to be granted KYC.
sourcepub fn account_id(&mut self, account_id: AccountId) -> &mut Self
pub fn account_id(&mut self, account_id: AccountId) -> &mut Self
Sets the account to be granted KYC.
sourcepub fn get_token_id(&self) -> Option<TokenId>
pub fn get_token_id(&self) -> Option<TokenId>
Returns the token for which the account will be granted KYC.
source§impl Transaction<TokenMintTransactionData>
impl Transaction<TokenMintTransactionData>
sourcepub fn get_token_id(&self) -> Option<TokenId>
pub fn get_token_id(&self) -> Option<TokenId>
Returns the token for which to mint tokens.
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 for which to mint tokens.
sourcepub fn get_amount(&self) -> u64
pub fn get_amount(&self) -> u64
Returns the amount of a fungible token to mint to the treasury account.
sourcepub fn amount(&mut self, amount: u64) -> &mut Self
pub fn amount(&mut self, amount: u64) -> &mut Self
Sets the amount of a fungible token to mint to the treasury account.
sourcepub fn get_metadata(&self) -> &[Vec<u8>]
pub fn get_metadata(&self) -> &[Vec<u8>]
Returns the list of metadata for a non-fungible token to mint to the treasury account.
source§impl Transaction<TokenPauseTransactionData>
impl Transaction<TokenPauseTransactionData>
source§impl Transaction<TokenRevokeKycTransactionData>
impl Transaction<TokenRevokeKycTransactionData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Returns the account to have their KYC revoked.
sourcepub fn account_id(&mut self, account_id: AccountId) -> &mut Self
pub fn account_id(&mut self, account_id: AccountId) -> &mut Self
Sets the account to have their KYC revoked.
sourcepub fn get_token_id(&self) -> Option<TokenId>
pub fn get_token_id(&self) -> Option<TokenId>
Returns the token for which the account will have their KYC revoked.
source§impl Transaction<TokenUnfreezeTransactionData>
impl Transaction<TokenUnfreezeTransactionData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Returns the account to be unfrozen.
sourcepub fn account_id(&mut self, account_id: AccountId) -> &mut Self
pub fn account_id(&mut self, account_id: AccountId) -> &mut Self
Sets the account to be unfrozen.
sourcepub fn get_token_id(&self) -> Option<TokenId>
pub fn get_token_id(&self) -> Option<TokenId>
Returns the token for which the account will be unfrozen.
source§impl Transaction<TokenUnpauseTransactionData>
impl Transaction<TokenUnpauseTransactionData>
source§impl Transaction<TokenUpdateNftsTransactionData>
impl Transaction<TokenUpdateNftsTransactionData>
sourcepub fn get_token_id(&self) -> Option<TokenId>
pub fn get_token_id(&self) -> Option<TokenId>
Returns the token for which to update NFTs.
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 for which to update NFTs.
sourcepub fn get_serials(&self) -> Vec<i64>
pub fn get_serials(&self) -> Vec<i64>
Returns the list of serial numbers to be updated.
sourcepub fn serials(&mut self, serials: Vec<i64>) -> &mut Self
pub fn serials(&mut self, serials: Vec<i64>) -> &mut Self
Sets the list of serial numbers to be updated.
sourcepub fn get_metadata(&self) -> Vec<u8> ⓘ
pub fn get_metadata(&self) -> Vec<u8> ⓘ
Returns the new metadata of the NFT(s).
source§impl Transaction<TokenUpdateTransactionData>
impl Transaction<TokenUpdateTransactionData>
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) -> Option<Vec<u8>>
pub fn get_metadata(&self) -> Option<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.
sourcepub fn get_key_verification_mode(&self) -> TokenKeyValidation
pub fn get_key_verification_mode(&self) -> TokenKeyValidation
Returns key verification mode.
sourcepub fn key_verification_mode(
&mut self,
key_verification_mode: TokenKeyValidation,
) -> &mut Self
pub fn key_verification_mode( &mut self, key_verification_mode: TokenKeyValidation, ) -> &mut Self
Assignss key verification mode.
source§impl Transaction<TokenWipeTransactionData>
impl Transaction<TokenWipeTransactionData>
sourcepub fn get_account_id(&self) -> Option<AccountId>
pub fn get_account_id(&self) -> Option<AccountId>
Returns the account to be wiped.
sourcepub fn account_id(&mut self, account_id: AccountId) -> &mut Self
pub fn account_id(&mut self, account_id: AccountId) -> &mut Self
Sets the account to be wiped.
sourcepub fn get_token_id(&self) -> Option<TokenId>
pub fn get_token_id(&self) -> Option<TokenId>
Returns the token for which the account will be wiped.
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 for which the account will be wiped.
sourcepub fn get_amount(&self) -> Option<u64>
pub fn get_amount(&self) -> Option<u64>
Returns the amount of a fungible token to wipe from the specified account.
sourcepub fn amount(&mut self, amount: impl Into<u64>) -> &mut Self
pub fn amount(&mut self, amount: impl Into<u64>) -> &mut Self
Sets the amount of a fungible token to wipe from the specified account.
sourcepub fn get_serials(&self) -> &[u64]
pub fn get_serials(&self) -> &[u64]
Returns the serial numbers of a non-fungible token to wipe from the specified account.
sourcepub fn serials(&mut self, serials: impl IntoIterator<Item = u64>) -> &mut Self
pub fn serials(&mut self, serials: impl IntoIterator<Item = u64>) -> &mut Self
Sets the serial numbers of a non-fungible token to wipe from the specified account.
source§impl Transaction<TopicCreateTransactionData>
impl Transaction<TopicCreateTransactionData>
sourcepub fn get_topic_memo(&self) -> &str
pub fn get_topic_memo(&self) -> &str
Returns the short, publicly visible, memo about the topic.
sourcepub fn topic_memo(&mut self, memo: impl Into<String>) -> &mut Self
pub fn topic_memo(&mut self, memo: impl Into<String>) -> &mut Self
Sets the short publicly visible memo about the topic.
No guarantee of uniqueness.
sourcepub fn get_admin_key(&self) -> Option<&Key>
pub fn get_admin_key(&self) -> Option<&Key>
Returns the access control for TopicUpdateTransaction
and TopicDeleteTransaction
.
sourcepub fn admin_key(&mut self, key: impl Into<Key>) -> &mut Self
pub fn admin_key(&mut self, key: impl Into<Key>) -> &mut Self
Sets the access control for TopicUpdateTransaction
and TopicDeleteTransaction
.
sourcepub fn get_submit_key(&self) -> Option<&Key>
pub fn get_submit_key(&self) -> Option<&Key>
Returns the access control for TopicMessageSubmitTransaction
sourcepub fn submit_key(&mut self, key: impl Into<Key>) -> &mut Self
pub fn submit_key(&mut self, key: impl Into<Key>) -> &mut Self
Sets the access control for TopicMessageSubmitTransaction
.
sourcepub fn get_auto_renew_period(&self) -> Option<Duration>
pub fn get_auto_renew_period(&self) -> Option<Duration>
Returns the initial lifetime of the topic and the amount of time to attempt to extend the topic’s lifetime by automatically at the topic’s expiration time.
sourcepub fn auto_renew_period(&mut self, period: Duration) -> &mut Self
pub fn auto_renew_period(&mut self, period: Duration) -> &mut Self
Sets the initial lifetime of the topic and the amount of time to attempt to extend the topic’s lifetime by automatically at the topic’s expiration time.
sourcepub fn get_auto_renew_account_id(&self) -> Option<AccountId>
pub fn get_auto_renew_account_id(&self) -> Option<AccountId>
Returns the account to be used at the topic’s expiration time to extend the life of the topic.
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 the topic’s expiration time to extend the life of the topic.
source§impl Transaction<TopicDeleteTransactionData>
impl Transaction<TopicDeleteTransactionData>
source§impl Transaction<TopicMessageSubmitTransactionData>
impl Transaction<TopicMessageSubmitTransactionData>
sourcepub fn get_topic_id(&self) -> Option<TopicId>
pub fn get_topic_id(&self) -> Option<TopicId>
Returns the ID of the topic this message will be submitted to.
sourcepub fn topic_id(&mut self, id: impl Into<TopicId>) -> &mut Self
pub fn topic_id(&mut self, id: impl Into<TopicId>) -> &mut Self
Sets the topic ID to submit this message to.
sourcepub fn get_message(&self) -> Option<&[u8]>
pub fn get_message(&self) -> Option<&[u8]>
Returns the message to be submitted.
source§impl Transaction<TopicUpdateTransactionData>
impl Transaction<TopicUpdateTransactionData>
sourcepub fn get_topic_id(&self) -> Option<TopicId>
pub fn get_topic_id(&self) -> Option<TopicId>
Returns the topic ID which is being updated.
sourcepub fn topic_id(&mut self, id: impl Into<TopicId>) -> &mut Self
pub fn topic_id(&mut self, id: impl Into<TopicId>) -> &mut Self
Sets the topic ID which is being updated.
sourcepub fn get_expiration_time(&self) -> Option<OffsetDateTime>
pub fn get_expiration_time(&self) -> Option<OffsetDateTime>
Returns the new expiration time to extend to (ignored if equal to or before the current one).
sourcepub fn expiration_time(&mut self, at: OffsetDateTime) -> &mut Self
pub fn expiration_time(&mut self, at: OffsetDateTime) -> &mut Self
Sets the new expiration time to extend to (ignored if equal to or before the current one).
sourcepub fn get_topic_memo(&self) -> Option<&str>
pub fn get_topic_memo(&self) -> Option<&str>
Returns the new topic memo for the topic.
sourcepub fn topic_memo(&mut self, memo: impl Into<String>) -> &mut Self
pub fn topic_memo(&mut self, memo: impl Into<String>) -> &mut Self
Sets the short publicly visible memo about the topic.
No guarantee of uniqueness.
sourcepub fn get_admin_key(&self) -> Option<&Key>
pub fn get_admin_key(&self) -> Option<&Key>
Returns the access control for TopicUpdateTransaction
and TopicDeleteTransaction
.
sourcepub fn admin_key(&mut self, key: impl Into<Key>) -> &mut Self
pub fn admin_key(&mut self, key: impl Into<Key>) -> &mut Self
Sets the access control for TopicUpdateTransaction
and TopicDeleteTransaction
.
sourcepub fn clear_admin_key(&mut self) -> &mut Self
pub fn clear_admin_key(&mut self) -> &mut Self
Clears the access control for TopicUpdateTransaction
and TopicDeleteTransaction
.
sourcepub fn get_submit_key(&self) -> Option<&Key>
pub fn get_submit_key(&self) -> Option<&Key>
Returns the access control for TopicMessageSubmitTransaction
.
sourcepub fn submit_key(&mut self, key: impl Into<Key>) -> &mut Self
pub fn submit_key(&mut self, key: impl Into<Key>) -> &mut Self
Sets the access control for TopicMessageSubmitTransaction
.
sourcepub fn clear_submit_key(&mut self) -> &mut Self
pub fn clear_submit_key(&mut self) -> &mut Self
Clears the access control for TopicUpdateTransaction
and TopicDeleteTransaction
.
sourcepub fn get_auto_renew_period(&self) -> Option<Duration>
pub fn get_auto_renew_period(&self) -> Option<Duration>
Returns the initial lifetime of the topic and the amount of time to attempt to extend the topic’s lifetime by automatically at the topic’s expiration time.
sourcepub fn auto_renew_period(&mut self, period: Duration) -> &mut Self
pub fn auto_renew_period(&mut self, period: Duration) -> &mut Self
Sets the initial lifetime of the topic and the amount of time to attempt to extend the topic’s lifetime by automatically at the topic’s expiration time.
sourcepub fn get_auto_renew_account_id(&self) -> Option<AccountId>
pub fn get_auto_renew_account_id(&self) -> Option<AccountId>
Returns the account to be used at the topic’s expiration time to extend the life of the topic.
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 the topic’s expiration time to extend the life of the topic.
sourcepub fn clear_auto_renew_account_id(&mut self) -> &mut Self
pub fn clear_auto_renew_account_id(&mut self) -> &mut Self
Clear the auto renew account ID for this topic.
source§impl Transaction<AnyTransactionData>
impl Transaction<AnyTransactionData>
source§impl<D> Transaction<D>where
D: Default,
impl<D> Transaction<D>where
D: Default,
source§impl<D> Transaction<D>
impl<D> Transaction<D>
sourcepub fn get_node_account_ids(&self) -> Option<&[AccountId]>
pub fn get_node_account_ids(&self) -> Option<&[AccountId]>
Returns the account IDs of the nodes that this transaction may be submitted to.
None
means any node configured on the client.
sourcepub fn node_account_ids(
&mut self,
ids: impl IntoIterator<Item = AccountId>,
) -> &mut Self
pub fn node_account_ids( &mut self, ids: impl IntoIterator<Item = AccountId>, ) -> &mut Self
Sets the account IDs of the nodes that this transaction may be submitted to.
Defaults to the full list of nodes configured on the client.
sourcepub fn get_transaction_valid_duration(&self) -> Option<Duration>
pub fn get_transaction_valid_duration(&self) -> Option<Duration>
Returns the duration that this transaction is valid for, once finalized and signed.
sourcepub fn transaction_valid_duration(&mut self, duration: Duration) -> &mut Self
pub fn transaction_valid_duration(&mut self, duration: Duration) -> &mut Self
Sets the duration that this transaction is valid for, once finalized and signed.
Defaults to 120 seconds (or two minutes).
sourcepub fn get_max_transaction_fee(&self) -> Option<Hbar>
pub fn get_max_transaction_fee(&self) -> Option<Hbar>
Returns the maximum transaction fee the paying account is willing to pay.
sourcepub fn max_transaction_fee(&mut self, fee: Hbar) -> &mut Self
pub fn max_transaction_fee(&mut self, fee: Hbar) -> &mut Self
Sets the maximum transaction fee the paying account is willing to pay.
sourcepub fn get_transaction_memo(&self) -> &str
pub fn get_transaction_memo(&self) -> &str
Sets a note / description that should be recorded in the transaction record.
Maximum length of 100 characters.
sourcepub fn transaction_memo(&mut self, memo: impl AsRef<str>) -> &mut Self
pub fn transaction_memo(&mut self, memo: impl AsRef<str>) -> &mut Self
Sets a note or description that should be recorded in the transaction record.
Maximum length of 100 characters.
sourcepub fn get_transaction_id(&self) -> Option<TransactionId>
pub fn get_transaction_id(&self) -> Option<TransactionId>
Returns the explicit transaction ID to use to identify this transaction.
Overrides the payer account defined on this transaction or on the client.
sourcepub fn transaction_id(&mut self, id: TransactionId) -> &mut Self
pub fn transaction_id(&mut self, id: TransactionId) -> &mut Self
Sets an explicit transaction ID to use to identify this transaction.
Overrides the payer account defined on this transaction or on the client.
sourcepub fn sign(&mut self, private_key: PrivateKey) -> &mut Self
pub fn sign(&mut self, private_key: PrivateKey) -> &mut Self
Sign the transaction.
source§impl<D: ChunkedTransactionData> Transaction<D>
impl<D: ChunkedTransactionData> Transaction<D>
sourcepub fn get_max_chunks(&self) -> usize
pub fn get_max_chunks(&self) -> usize
Returns the maximum number of chunks this transaction will be split into.
sourcepub fn max_chunks(&mut self, max_chunks: usize) -> &mut Self
pub fn max_chunks(&mut self, max_chunks: usize) -> &mut Self
Sets the maximum number of chunks this transaction will be split into.
sourcepub fn get_chunk_size(&self) -> usize
pub fn get_chunk_size(&self) -> usize
Returns the maximum size of any chunk.
sourcepub fn chunk_size(&mut self, size: usize) -> &mut Self
pub fn chunk_size(&mut self, size: usize) -> &mut Self
sourcepub fn get_regenerate_transaction_id(&self) -> Option<bool>
pub fn get_regenerate_transaction_id(&self) -> Option<bool>
Returns whether or not the transaction ID should be refreshed if a Status::TransactionExpired
occurs.
By default, the value on Client will be used.
Note: Some operations forcibly disable transaction ID regeneration, such as setting the transaction ID explicitly.
sourcepub fn regenerate_transaction_id(
&mut self,
regenerate_transaction_id: bool,
) -> &mut Self
pub fn regenerate_transaction_id( &mut self, regenerate_transaction_id: bool, ) -> &mut Self
Sets whether or not the transaction ID should be refreshed if a Status::TransactionExpired
occurs.
Various operations such as add_signature
can forcibly disable transaction ID regeneration.
source§impl<D: ValidateChecksums> Transaction<D>
impl<D: ValidateChecksums> Transaction<D>
sourcepub fn freeze(&mut self) -> Result<&mut Self>
pub fn freeze(&mut self) -> Result<&mut Self>
Freeze the transaction so that no further modifications can be made.
§Errors
Error::FreezeUnsetNodeAccountIds
if nonode_account_ids
were set.
§Panics
- If
node_account_ids
is explicitly set to empty (IE:tx.node_account_ids([]).freeze_with(None)
).
sourcepub fn freeze_with<'a>(
&mut self,
client: impl Into<Option<&'a Client>>,
) -> Result<&mut Self>
pub fn freeze_with<'a>( &mut self, client: impl Into<Option<&'a Client>>, ) -> Result<&mut Self>
Freeze the transaction so that no further modifications can be made.
§Errors
Error::FreezeUnsetNodeAccountIds
if nonode_account_ids
were set andclient.is_none()
.
§Panics
- If
node_account_ids
is explicitly set to empty (IE:tx.node_account_ids([]).freeze_with(None)
).
sourcepub fn sign_with_operator(&mut self, client: &Client) -> Result<&mut Self>
pub fn sign_with_operator(&mut self, client: &Client) -> Result<&mut Self>
Sign the transaction with the client
’s operator.
§Errors
- If
freeze_with
would error for this transaction.
§Panics
If client
has no operator.
source§impl<D: TransactionExecute> Transaction<D>
impl<D: TransactionExecute> Transaction<D>
sourcepub fn add_signature(&mut self, pk: PublicKey, signature: Vec<u8>) -> &mut Self
pub fn add_signature(&mut self, pk: PublicKey, signature: Vec<u8>) -> &mut Self
Adds a signature directly to self
.
Only use this as a last resort.
This forcibly disables transaction ID regeneration.
sourcepub fn schedule(self) -> ScheduleCreateTransaction
pub fn schedule(self) -> ScheduleCreateTransaction
§Panics
panics if the transaction is not schedulable, a transaction can be non-schedulable due to:
- if
self.is_frozen
- being a transaction kind that’s non-schedulable, IE,
EthereumTransaction
, or - being a chunked transaction with multiple chunks.
sourcepub fn get_transaction_hash(&mut self) -> Result<TransactionHash>
pub fn get_transaction_hash(&mut self) -> Result<TransactionHash>
Get the hash for this transaction.
Note: Calling this function disables transaction ID regeneration.
§Errors
Error::NoPayerAccountOrTransactionId
iffreeze_with
wasn’t called with an operator and no transaction ID was set.
§Panics
- If
!self.is_frozen()
.
sourcepub fn get_transaction_hash_per_node(
&mut self,
) -> Result<HashMap<AccountId, TransactionHash>>
pub fn get_transaction_hash_per_node( &mut self, ) -> Result<HashMap<AccountId, TransactionHash>>
Get the hashes for this transaction.
Note: Calling this function disables transaction ID regeneration.
§Errors
Error::NoPayerAccountOrTransactionId
iffreeze_with
wasn’t called with an operator and no transaction ID was set.
§Panics
- If
!self.is_frozen()
.
source§impl<D> Transaction<D>where
D: TransactionData,
impl<D> Transaction<D>where
D: TransactionData,
sourcepub fn default_max_transaction_fee(&self) -> Hbar
pub fn default_max_transaction_fee(&self) -> Hbar
Returns the maximum allowed transaction fee if none is specified.
Specifically, this default will be used in the following case:
- The transaction itself (direct user input) has no
max_transaction_fee
specified, AND - The
Client
has nomax_transaction_fee
specified.
Currently this is (but not guaranteed to be) 2 ℏ
for most transaction types.
source§impl<D> Transaction<D>where
D: TransactionExecute,
impl<D> Transaction<D>where
D: TransactionExecute,
sourcepub async fn get_cost(&self, client: &Client) -> Result<Hbar>
pub async fn get_cost(&self, client: &Client) -> Result<Hbar>
Get the estimated transaction cost for this transaction.
sourcepub async fn execute(&mut self, client: &Client) -> Result<TransactionResponse>
pub async fn execute(&mut self, client: &Client) -> Result<TransactionResponse>
Execute this transaction against the provided client of the Hedera network.
sourcepub async fn execute_with_timeout(
&mut self,
client: &Client,
timeout: Duration,
) -> Result<TransactionResponse>
pub async fn execute_with_timeout( &mut self, client: &Client, timeout: Duration, ) -> Result<TransactionResponse>
Execute this transaction against the provided client of the Hedera network.
source§impl<D> Transaction<D>where
D: TransactionExecuteChunked,
impl<D> Transaction<D>where
D: TransactionExecuteChunked,
sourcepub async fn execute_all(
&mut self,
client: &Client,
) -> Result<Vec<TransactionResponse>>
pub async fn execute_all( &mut self, client: &Client, ) -> Result<Vec<TransactionResponse>>
Execute all transactions against the provided client of the Hedera network.
source§impl Transaction<AnyTransactionData>
impl Transaction<AnyTransactionData>
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
§Examples
use hedera::AnyTransaction;
let bytes = hex::decode(concat!(
"0a522a500a4c0a120a0c0885c8879e0610a8bdd9840312021865120218061880",
"94ebdc0322020877320c686920686173686772617068721a0a180a0a0a021802",
"108088debe010a0a0a02186510ff87debe0112000a522a500a4c0a120a0c0885",
"c8879e0610a8bdd984031202186512021807188094ebdc0322020877320c6869",
"20686173686772617068721a0a180a0a0a021802108088debe010a0a0a021865",
"10ff87debe011200"
)).unwrap();
let tx = AnyTransaction::from_bytes(&bytes)?;
§Errors
Error::FromProtobuf
if a valid transaction cannot be parsed from the bytes.
source§impl Transaction<TransferTransactionData>
impl Transaction<TransferTransactionData>
sourcepub fn hbar_transfer(
&mut self,
account_id: AccountId,
amount: Hbar,
) -> &mut Self
pub fn hbar_transfer( &mut self, account_id: AccountId, amount: Hbar, ) -> &mut Self
Add a non-approved hbar transfer to the transaction.
sourcepub fn approved_hbar_transfer(
&mut self,
account_id: AccountId,
amount: Hbar,
) -> &mut Self
pub fn approved_hbar_transfer( &mut self, account_id: AccountId, amount: Hbar, ) -> &mut Self
Add an approved hbar transfer to the transaction.
sourcepub fn get_hbar_transfers(&self) -> HashMap<AccountId, Hbar>
pub fn get_hbar_transfers(&self) -> HashMap<AccountId, Hbar>
Returns all transfers associated with this transaction.
sourcepub fn token_transfer(
&mut self,
token_id: TokenId,
account_id: AccountId,
amount: i64,
) -> &mut Self
pub fn token_transfer( &mut self, token_id: TokenId, account_id: AccountId, amount: i64, ) -> &mut Self
Add a non-approved token transfer to the transaction.
amount
is in the lowest denomination for the token (if the token has 2
decimals this would be 0.01
tokens).
sourcepub fn approved_token_transfer(
&mut self,
token_id: TokenId,
account_id: AccountId,
amount: i64,
) -> &mut Self
pub fn approved_token_transfer( &mut self, token_id: TokenId, account_id: AccountId, amount: i64, ) -> &mut Self
Add an approved token transfer to the transaction.
amount
is in the lowest denomination for the token (if the token has 2
decimals this would be 0.01
tokens).
sourcepub fn token_transfer_with_decimals(
&mut self,
token_id: TokenId,
account_id: AccountId,
amount: i64,
expected_decimals: u32,
) -> &mut Self
pub fn token_transfer_with_decimals( &mut self, token_id: TokenId, account_id: AccountId, amount: i64, expected_decimals: u32, ) -> &mut Self
Add a non-approved token transfer to the transaction, ensuring that the token has expected_decimals
decimals.
amount
is still in the lowest denomination, however,
you will get an error if the token has a different amount of decimals than expected_decimals
.
sourcepub fn approved_token_transfer_with_decimals(
&mut self,
token_id: TokenId,
account_id: AccountId,
amount: i64,
expected_decimals: u32,
) -> &mut Self
pub fn approved_token_transfer_with_decimals( &mut self, token_id: TokenId, account_id: AccountId, amount: i64, expected_decimals: u32, ) -> &mut Self
Add an approved token transfer, ensuring that the token has expected_decimals
decimals.
amount
is still in the lowest denomination, however,
you will get an error if the token has a different amount of decimals than expected_decimals
.
sourcepub fn get_token_transfers(&self) -> HashMap<TokenId, HashMap<AccountId, i64>>
pub fn get_token_transfers(&self) -> HashMap<TokenId, HashMap<AccountId, i64>>
Returns all the token transfers associated associated with this transaction.
sourcepub fn get_token_decimals(&self) -> HashMap<TokenId, u32>
pub fn get_token_decimals(&self) -> HashMap<TokenId, u32>
Returns the decimals associated with each token.
sourcepub fn approved_nft_transfer(
&mut self,
nft_id: impl Into<NftId>,
sender_account_id: AccountId,
receiver_account_id: AccountId,
) -> &mut Self
pub fn approved_nft_transfer( &mut self, nft_id: impl Into<NftId>, sender_account_id: AccountId, receiver_account_id: AccountId, ) -> &mut Self
Add an approved nft transfer to the transaction.
sourcepub fn nft_transfer(
&mut self,
nft_id: impl Into<NftId>,
sender_account_id: AccountId,
receiver_account_id: AccountId,
) -> &mut Self
pub fn nft_transfer( &mut self, nft_id: impl Into<NftId>, sender_account_id: AccountId, receiver_account_id: AccountId, ) -> &mut Self
Add a non-approved nft transfer to the transaction.
sourcepub fn get_nft_transfers(&self) -> HashMap<TokenId, Vec<TokenNftTransfer>>
pub fn get_nft_transfers(&self) -> HashMap<TokenId, Vec<TokenNftTransfer>>
Returns all the NFT transfers associated with this transaction.
Trait Implementations§
source§impl<D: Clone> Clone for Transaction<D>
impl<D: Clone> Clone for Transaction<D>
source§fn clone(&self) -> Transaction<D>
fn clone(&self) -> Transaction<D>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<D> Debug for Transaction<D>where
D: Debug,
impl<D> Debug for Transaction<D>where
D: Debug,
Auto Trait Implementations§
impl<D> !Freeze for Transaction<D>
impl<D> !RefUnwindSafe for Transaction<D>
impl<D> Send for Transaction<D>where
D: Send,
impl<D> Sync for Transaction<D>where
D: Sync,
impl<D> !Unpin for Transaction<D>
impl<D> !UnwindSafe for Transaction<D>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request