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>

source

pub fn approve_hbar_allowance( &mut self, owner_account_id: AccountId, spender_account_id: AccountId, amount: Hbar, ) -> &mut Self

Approves the hbar allowance.

source

pub fn hbar_approvals(&self) -> &[HbarAllowance]

Returns the hbar allowances approved by the account owner.

source

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.

source

pub fn token_approvals(&self) -> &[TokenAllowance]

Returns the fungible token allowances approved by the account owner

source

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.

source

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).

source

pub fn token_nft_approvals(&self) -> &[NftAllowance]

Returns the non-fungible token allowances approved by the account owner.

source§

impl Transaction<AccountAllowanceDeleteTransactionData>

source

pub fn get_nft_allowances(&self) -> &[NftRemoveAllowance]

Get the nft allowances that will be removed.

source

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>

source

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

Get the key this account will be created with.

Returns Some(key) if previously set, None otherwise.

source

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

Sets the key for this account.

source

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.

source

pub fn initial_balance(&mut self, balance: Hbar) -> &mut Self

Sets the balance that will be transferred to this account on creation.

source

pub fn get_receiver_signature_required(&self) -> bool

Returns true if this account must sign any transfer of hbars to itself.

source

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.

source

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

Returns the auto renew period for this account.

source

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

Sets the auto renew period for this account.

source

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.

source

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.

source

pub fn get_account_memo(&self) -> &str

Get the memo associated with the account

source

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

Sets the memo associated with the account.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn get_decline_staking_reward(&self) -> bool

Returns true if the account should decline receiving staking rewards, false otherwise.

source

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>

source

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

Get the account ID which should be deleted.

source

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

Sets the account ID which should be deleted.

source

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

Get the account ID which will receive all remaining hbars.

source

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>

source

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

Returns the ID for the account that is being updated.

source

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

Sets the ID for the account that is being updated.

source

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).

source

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).

source

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

Returns the key that the account will be updated to.

source

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

Sets the key for this account.

source

pub fn get_receiver_signature_required(&self) -> Option<bool>

If true, this account’s key must sign any transaction depositing hbar into this account.

source

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.

source

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

👎Deprecated

Gets the ID of the account to which this account will be updated to be proxy staked to.

source

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

👎Deprecated

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.

source

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

Returns the new auto renew period.

source

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

Sets the auto renew period for this account.

source

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.

source

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.

source

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

Returns the memo associated with the account.

source

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

Sets the memo associated with the account.

source

pub fn get_max_automatic_token_associations(&self) -> Option<u16>

Returns the maximum number of tokens that an Account can be implicitly associated with.

source

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.

source

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.

source

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.

source

pub fn clear_staked_account_id(&mut self) -> &mut Self

Clears the account’s staked account ID.

source

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.

source

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.

source

pub fn clear_staked_node_id(&mut self) -> &mut Self

Clears the account’s staked node ID.

source

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.

source

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>

source

pub fn get_bytecode_file_id(&self) -> Option<FileId>

Returns the FileId to be used as the bytecode for this smart contract.

source

pub fn bytecode_file_id(&mut self, file_id: FileId) -> &mut Self

Sets the file to use as the bytes for the smart contract.

source

pub fn get_bytecode(&self) -> Option<&[u8]>

Returns the bytecode for the smart contract.

source

pub fn bytecode(&mut self, bytecode: impl AsRef<[u8]>) -> &mut Self

Sets the bytes of the smart contract.

source

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

Returns the admin key.

source

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

Sets the admin key.

source

pub fn get_gas(&self) -> u64

Returns the gas limit to deploy the smart contract.

source

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

Sets the gas limit to deploy the smart contract.

source

pub fn get_initial_balance(&self) -> Hbar

Returns the initial balance to put into the cryptocurrency account associated with the new smart contract.

source

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.

source

pub fn get_auto_renew_period(&self) -> Duration

Returns the auto renew period for this smart contract.

source

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

Sets the auto renew period for this smart contract.

source

pub fn get_constructor_parameters(&self) -> &[u8]

Returns the parameters to pass to the constructor.

source

pub fn constructor_parameters( &mut self, parameters: impl AsRef<[u8]>, ) -> &mut Self

Sets the parameters to pass to the constructor.

source

pub fn get_contract_memo(&self) -> &str

Returns the memo for the new smart contract.

source

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

Sets the memo for the new smart contract.

source

pub fn get_max_automatic_token_associations(&self) -> u32

Returns the maximum number of tokens that the contract can be automatically associated with.

source

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.

source

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

source

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.

source

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

Returns the ID of the account to which this contract is staking.

source

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.

source

pub fn get_staked_node_id(&self) -> Option<u64>

Returns the ID of the node to which this contract is staking.

source

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.

source

pub fn get_decline_staking_reward(&self) -> bool

Returns true if the contract will decline receiving staking rewards, false otherwise.

source

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>

source

pub fn get_contract_id(&self) -> Option<ContractId>

Returns the ID of the contract that should be deleted.

source

pub fn contract_id(&mut self, id: ContractId) -> &mut Self

Sets ID of the contract which should be deleted.

source

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

Returns the ID of the account which will receive all remaining hbars.

source

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

Sets the ID of the account which will receive all remaining hbars.

source

pub fn get_transfer_contract_id(&self) -> Option<ContractId>

Returns ID of the contract which will receive all rmaining hbars.

source

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>

source

pub fn get_contract_id(&self) -> Option<ContractId>

Returns the contract instance to call.

source

pub fn contract_id(&mut self, contract_id: ContractId) -> &mut Self

Sets the contract instance to call.

source

pub fn get_gas(&self) -> u64

Returns the maximum amount of gas to use for the call.

source

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

Sets the maximum amount of gas to use for the call.

source

pub fn get_payable_amount(&self) -> Hbar

Returns the number of hbars to be sent with this function call.

source

pub fn payable_amount(&mut self, amount: Hbar) -> &mut Self

Sets the number of hbars to be sent with this function call.

source

pub fn get_function_parameters(&self) -> &[u8]

Returns the function parameters as their raw bytes.

source

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

Sets the function parameters as their raw bytes.

source

pub fn function(&mut self, name: &str) -> &mut Self

Sets the function with no parameters.

source

pub fn function_with_parameters( &mut self, name: &str, parameters: &ContractFunctionParameters, ) -> &mut Self

Sets the function with parameters.

source§

impl Transaction<ContractUpdateTransactionData>

source

pub fn get_contract_id(&self) -> Option<ContractId>

Returns the contract to be updated.

source

pub fn contract_id(&mut self, contract_id: ContractId) -> &mut Self

Sets the contract to be updated.

source

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

Returns the new admin key.

source

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

Sets the new admin key.

source

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).

source

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).

source

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

Returns the auto renew period for this smart contract.

source

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

Sets the auto renew period for this smart contract.

source

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

Returns the new memo for the smart contract.

source

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

Sets the new memo for the smart contract.

source

pub fn get_max_automatic_token_associations(&self) -> Option<u32>

Returns the maximum number of tokens that this contract can be automatically associated with.

source

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.

source

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.

source

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.

source

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

Returns the ID of the account to which this contract is proxy staked.

source

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

Sets the ID of the account to which this contract is proxy staked.

source

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

Returns the ID of the account to which this contract is staking.

source

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.

source

pub fn get_staked_node_id(&self) -> Option<u64>

Returns the ID of the node to which this contract is staking.

source

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.

source

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.

source

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>

source

pub fn get_ethereum_data(&self) -> &[u8]

Returns the raw Ethereum transaction (RLP encoded type 0, 1, and 2).

source

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

Sets the raw Ethereum transaction (RLP encoded type 0, 1, and 2).

source

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).

source

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.

source

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.

source

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>

source

pub fn get_file_id(&self) -> Option<FileId>

Returns the file to which the bytes will be appended.

source

pub fn file_id(&mut self, id: impl Into<FileId>) -> &mut Self

Sets the file to which the bytes will be appended.

source

pub fn get_contents(&self) -> Option<&[u8]>

Retuns the bytes that will be appended to the end of the specified file.

source

pub fn contents(&mut self, contents: impl Into<Vec<u8>>) -> &mut Self

Sets the bytes that will be appended to the end of the specified file.

source§

impl Transaction<FileCreateTransactionData>

source

pub fn get_file_memo(&self) -> &str

Returns the memo to be associated with the file.

source

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

Sets the memo associated with the file.

source

pub fn get_contents(&self) -> Option<&[u8]>

Returns the bytes that are to be the contents of the file.

source

pub fn contents(&mut self, contents: impl Into<Vec<u8>>) -> &mut Self

Sets the bytes that are to be the contents of the file.

source

pub fn get_keys(&self) -> Option<&KeyList>

Returns the keys for this file.

source

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.

source

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.

source

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

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.

source

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.

source

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

Returns the time at which this file should expire.

source

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

Sets the time at which this file should expire.

source§

impl Transaction<FileDeleteTransactionData>

source

pub fn get_file_id(&self) -> Option<FileId>

Returns the ID of the file to be deleted.

source

pub fn file_id(&mut self, id: impl Into<FileId>) -> &mut Self

Sets the ID of the file to be deleted.

source§

impl Transaction<FileUpdateTransactionData>

source

pub fn get_file_id(&self) -> Option<FileId>

Returns the ID of the file which is being updated.

source

pub fn file_id(&mut self, id: impl Into<FileId>) -> &mut Self

Sets the ID of the file which is being updated.

source

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

Returns the new memo for the file.

source

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

Sets the new memo to be associated with the file.

source

pub fn get_contents(&self) -> Option<&[u8]>

Returns the bytes that are to be the contents of the file.

source

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

Sets the bytes that are to be the contents of the file.

source

pub fn get_keys(&self) -> Option<&KeyList>

Returns the keys for this file.

source

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.

source

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

Returns the time at which this file should expire.

source

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

Sets the time at which this file should expire.

source

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.

source

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.

source

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.

source

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>

source

pub fn get_range(&self) -> Option<u32>

Returns the upper-bound for the random number.

source

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

Sets the upper-bound for the random number.

If the value is zero, instead of returning a 32-bit number, a 384-bit number will be returned.

source§

impl Transaction<ScheduleCreateTransactionData>

source

pub fn scheduled_transaction<D>( &mut self, transaction: Transaction<D>, ) -> &mut Self
where 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.
source

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

Returns the timestamp for when the transaction should be evaluated for execution and then expire.

source

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.

source

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.

source

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.

source

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).

source

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).

source

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

Returns the memo for the schedule entity.

source

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

Sets the memo for the schedule entity.

source

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

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

Sets the Hedera key which can be used to sign a ScheduleDelete and remove the schedule.

source§

impl Transaction<ScheduleDeleteTransactionData>

source

pub fn get_schedule_id(&self) -> Option<ScheduleId>

Returns the schedule to delete.

source

pub fn schedule_id(&mut self, id: ScheduleId) -> &mut Self

Sets the schedule to delete.

source§

impl Transaction<ScheduleSignTransactionData>

source

pub fn get_schedule_id(&self) -> Option<ScheduleId>

Returns the schedule to add signing keys to.

source

pub fn schedule_id(&mut self, id: ScheduleId) -> &mut Self

Sets the schedule to add signing keys to.

source§

impl Transaction<FreezeTransactionData>

source

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

Returns the start time.

source

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

Sets the start time.

source

pub fn get_freeze_type(&self) -> FreezeType

Returns the freeze type.

source

pub fn freeze_type(&mut self, ty: FreezeType) -> &mut Self

Sets the freeze type.

source

pub fn get_file_id(&self) -> Option<FileId>

Returns the file ID.

source

pub fn file_id(&mut self, id: FileId) -> &mut Self

Sets the file ID.

source

pub fn get_file_hash(&self) -> Option<&[u8]>

Returns the file hash.

source

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

Sets the file hash.

source§

impl Transaction<SystemDeleteTransactionData>

source

pub fn get_contract_id(&self) -> Option<ContractId>

Returns the contract ID which should be deleted.

source

pub fn contract_id(&mut self, id: impl Into<ContractId>) -> &mut Self

Sets the contract ID which should be deleted.

source

pub fn get_file_id(&self) -> Option<FileId>

Returns the file ID which should be deleted.

source

pub fn file_id(&mut self, id: impl Into<FileId>) -> &mut Self

Sets the file ID which should be deleted.

source

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

Returns the timestamp at which the “deleted” entity should truly be permanently deleted.

source

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>

source

pub fn get_contract_id(&self) -> Option<ContractId>

Returns the contract ID to undelete.

source

pub fn contract_id(&mut self, id: impl Into<ContractId>) -> &mut Self

Sets the contract ID to undelete.

source

pub fn get_file_id(&self) -> Option<FileId>

Returns the file ID to undelete.

source

pub fn file_id(&mut self, id: impl Into<FileId>) -> &mut Self

Sets the file ID to undelete.

source§

impl Transaction<TokenAssociateTransactionData>

source

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

Returns the account to be associated with the provided tokens.

source

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

Sets the account to be associated with the provided tokens.

source

pub fn get_token_ids(&self) -> &[TokenId]

Returns the tokens to be associated with the provided account.

source

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>

source

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

Returns the token for which to burn tokens.

source

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

Sets the token for which to burn tokens.

source

pub fn get_amount(&self) -> u64

Returns the amount of a fungible token to burn from the treasury account.

source

pub fn amount(&mut self, amount: impl Into<u64>) -> &mut Self

Sets the amount of a fungible token to burn from the treasury account.

source

pub fn get_serials(&self) -> &[i64]

Returns the serial numbers of a non-fungible token to burn from the treasury account.

source

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>

source

pub fn get_name(&self) -> &str

Returns the publicly visible name of the token.

source

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

Sets the publicly visible name of the token.

Maximum 100 characters.

source

pub fn get_symbol(&self) -> &str

Returns the publicly visible token symbol.

source

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

Sets the publicly visible token symbol.

Maximum 100 characters.

source

pub fn get_decimals(&self) -> u32

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

source

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

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

source

pub fn get_initial_supply(&self) -> u64

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

pub fn get_freeze_default(&self) -> bool

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

source

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

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

source

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

Returns the time at which the token should expire.

source

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

Sets the time at which the token should expire.

source

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

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

source

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

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

source

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

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

source

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

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

source

pub fn get_token_memo(&self) -> &str

Returns the memo associated with the token.

source

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

Sets the memo associated with the token.

Maximum 100 bytes.

source

pub fn get_token_type(&self) -> TokenType

Returns the token type.

source

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

Sets the token type. Defaults to FungibleCommon.

source

pub fn get_token_supply_type(&self) -> TokenSupplyType

Returns the token supply type.

source

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

Sets the token supply type. Defaults to Infinite.

source

pub fn get_max_supply(&self) -> u64

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

source

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

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

source

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

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

source

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

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

source

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

Returns the custom fees to be assessed during a transfer.

source

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

Sets the custom fees to be assessed during a transfer.

source

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

Returns the key which can pause and unpause the token.

source

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

Sets the key which can pause and unpause the token.

source

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

Returns the metadata of the created token definition.

source

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

Sets metadata of the created token definition.

source

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

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

source

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

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

source§

impl Transaction<TokenDeleteTransactionData>

source

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

Returns the token to be deleted.

source

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

Sets the token to be deleted.

source§

impl Transaction<TokenDissociateTransactionData>

source

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

Returns the account to be dissociated with the provided tokens.

source

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

Sets the account to be dissociated with the provided tokens.

source

pub fn get_token_ids(&self) -> &[TokenId]

Returns the tokens to be dissociated with the provided account.

source

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>

source

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

Returns the ID of the token that’s being updated.

source

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

Sets the ID of the token that’s being updated.

source

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

Returns the new custom fees to be assessed during a transfer.

source

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

Sets the new custom fees to be assessed during a transfer.

source§

impl Transaction<TokenFreezeTransactionData>

source

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

Returns the account to be frozen.

source

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

Sets the account to be frozen.

source

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

Returns the toke nfor which the account will be frozen.

source

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

Sets the token for which the account will be frozen.

source§

impl Transaction<TokenGrantKycTransactionData>

source

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

Returns the account to be granted KYC.

source

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

Sets the account to be granted KYC.

source

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

Returns the token for which the account will be granted KYC.

source

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

Sets the token for which the account will be granted KYC.

source§

impl Transaction<TokenMintTransactionData>

source

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

Returns the token for which to mint tokens.

source

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

Sets the token for which to mint tokens.

source

pub fn get_amount(&self) -> u64

Returns the amount of a fungible token to mint to the treasury account.

source

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

Sets the amount of a fungible token to mint to the treasury account.

source

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

Returns the list of metadata for a non-fungible token to mint to the treasury account.

source

pub fn metadata<Bytes>( &mut self, metadata: impl IntoIterator<Item = Bytes>, ) -> &mut Self
where Bytes: AsRef<[u8]>,

Sets the list of metadata for a non-fungible token to mint to the treasury account.

source§

impl Transaction<TokenPauseTransactionData>

source

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

Returns the token to be paused.

source

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

Sets the token to be paused.

source§

impl Transaction<TokenRevokeKycTransactionData>

source

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

Returns the account to have their KYC revoked.

source

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

Sets the account to have their KYC revoked.

source

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

Returns the token for which the account will have their KYC revoked.

source

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

Sets the token for which this account will have their KYC revoked.

source§

impl Transaction<TokenUnfreezeTransactionData>

source

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

Returns the account to be unfrozen.

source

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

Sets the account to be unfrozen.

source

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

Returns the token for which the account will be unfrozen.

source

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

Sets the token for which this account will be unfrozen.

source§

impl Transaction<TokenUnpauseTransactionData>

source

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

Returns the token to be unpaused.

source

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

Sets the token to be unpaused.

source§

impl Transaction<TokenUpdateNftsTransactionData>

source

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

Returns the token for which to update NFTs.

source

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

Sets the token for which to update NFTs.

source

pub fn get_serials(&self) -> Vec<i64>

Returns the list of serial numbers to be updated.

source

pub fn serials(&mut self, serials: Vec<i64>) -> &mut Self

Sets the list of serial numbers to be updated.

source

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

Returns the new metadata of the NFT(s).

source

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

Sets the new metadata of the NFT(s).

source§

impl Transaction<TokenUpdateTransactionData>

source

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

Returns the token to be updated.

source

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

Sets the token to be updated.

source

pub fn get_token_name(&self) -> &str

Returns the new publicly visible name of the token.

source

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

Sets the new publicly visible name of the token.

Maximum 100 characters.

source

pub fn get_token_symbol(&self) -> &str

Returns the new publicly visible token symbol.

source

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

Sets the new publicly visible token symbol.

Maximum 100 characters.

source

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

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

source

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

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

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

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

source

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

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

source

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

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

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

source

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

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

source

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

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

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

source

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

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

source

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

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

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

source

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

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

source

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

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

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

source

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

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

source

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

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

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

Returns the new time at which the token should expire.

source

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

Sets the new time at which the token should expire.

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

source

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

Returns the new memo associated with the token.

source

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

Sets the new memo associated with the token.

Maximum of 100 bytes.

source

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

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

source

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

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

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

source

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

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

source

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

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

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

source

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

Returns the new metadata of the created token definition.

source

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

Sets the new metadata of the token definition.

source

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

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

source

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

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

source

pub fn get_key_verification_mode(&self) -> TokenKeyValidation

Returns key verification mode.

source

pub fn key_verification_mode( &mut self, key_verification_mode: TokenKeyValidation, ) -> &mut Self

Assignss key verification mode.

source§

impl Transaction<TokenWipeTransactionData>

source

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

Returns the account to be wiped.

source

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

Sets the account to be wiped.

source

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

Returns the token for which the account will be wiped.

source

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

Sets the token for which the account will be wiped.

source

pub fn get_amount(&self) -> Option<u64>

Returns the amount of a fungible token to wipe from the specified account.

source

pub fn amount(&mut self, amount: impl Into<u64>) -> &mut Self

Sets the amount of a fungible token to wipe from the specified account.

source

pub fn get_serials(&self) -> &[u64]

Returns the serial numbers of a non-fungible token to wipe from the specified account.

source

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>

source

pub fn get_topic_memo(&self) -> &str

Returns the short, publicly visible, memo about the topic.

source

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.

source

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

Returns the access control for TopicUpdateTransaction and TopicDeleteTransaction.

source

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

Sets the access control for TopicUpdateTransaction and TopicDeleteTransaction.

source

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

Returns the access control for TopicMessageSubmitTransaction

source

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

Sets the access control for TopicMessageSubmitTransaction.

source

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.

source

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.

source

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.

source

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>

source

pub fn get_topic_id(&self) -> Option<TopicId>

Returns the ID of the topic which is being deleted in this transaction.

source

pub fn topic_id(&mut self, id: impl Into<TopicId>) -> &mut Self

Sets the topic ID which is being deleted in this transaction.

source§

impl Transaction<TopicMessageSubmitTransactionData>

source

pub fn get_topic_id(&self) -> Option<TopicId>

Returns the ID of the topic this message will be submitted to.

source

pub fn topic_id(&mut self, id: impl Into<TopicId>) -> &mut Self

Sets the topic ID to submit this message to.

source

pub fn get_message(&self) -> Option<&[u8]>

Returns the message to be submitted.

source

pub fn message(&mut self, bytes: impl Into<Vec<u8>>) -> &mut Self

Sets the message to be submitted.

source§

impl Transaction<TopicUpdateTransactionData>

source

pub fn get_topic_id(&self) -> Option<TopicId>

Returns the topic ID which is being updated.

source

pub fn topic_id(&mut self, id: impl Into<TopicId>) -> &mut Self

Sets the topic ID which is being updated.

source

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).

source

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).

source

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

Returns the new topic memo for the topic.

source

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.

source

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

Returns the access control for TopicUpdateTransaction and TopicDeleteTransaction.

source

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

Sets the access control for TopicUpdateTransaction and TopicDeleteTransaction.

source

pub fn clear_admin_key(&mut self) -> &mut Self

Clears the access control for TopicUpdateTransaction and TopicDeleteTransaction.

source

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

Returns the access control for TopicMessageSubmitTransaction.

source

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

Sets the access control for TopicMessageSubmitTransaction.

source

pub fn clear_submit_key(&mut self) -> &mut Self

Clears the access control for TopicUpdateTransaction and TopicDeleteTransaction.

source

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.

source

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.

source

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.

source

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

pub fn clear_auto_renew_account_id(&mut self) -> &mut Self

Clear the auto renew account ID for this topic.

source§

impl Transaction<AnyTransactionData>

source

pub fn downcast<D>(self) -> Result<D, Self>
where Self: DowncastOwned<D>,

Attempt to downcast from any transaction to the given transaction kind.

§Errors
  • If self doesn’t match the given transaction type, the transaction is returned as-is.
source§

impl<D> Transaction<D>
where D: Default,

source

pub fn new() -> Self

Create a new default transaction.

Does the same thing as default

source§

impl<D> Transaction<D>

source

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.

source

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.

source

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

Returns the duration that this transaction is valid for, once finalized and signed.

source

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).

source

pub fn get_max_transaction_fee(&self) -> Option<Hbar>

Returns the maximum transaction fee the paying account is willing to pay.

source

pub fn max_transaction_fee(&mut self, fee: Hbar) -> &mut Self

Sets the maximum transaction fee the paying account is willing to pay.

source

pub fn get_transaction_memo(&self) -> &str

Sets a note / description that should be recorded in the transaction record.

Maximum length of 100 characters.

source

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.

source

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.

source

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.

source

pub fn sign(&mut self, private_key: PrivateKey) -> &mut Self

Sign the transaction.

source

pub fn sign_with<F: Fn(&[u8]) -> Vec<u8> + Send + Sync + 'static>( &mut self, public_key: PublicKey, signer: F, ) -> &mut Self

Sign the transaction.

source§

impl<D: ChunkedTransactionData> Transaction<D>

source

pub fn get_max_chunks(&self) -> usize

Returns the maximum number of chunks this transaction will be split into.

source

pub fn max_chunks(&mut self, max_chunks: usize) -> &mut Self

Sets the maximum number of chunks this transaction will be split into.

source

pub fn get_chunk_size(&self) -> usize

Returns the maximum size of any chunk.

source

pub fn chunk_size(&mut self, size: usize) -> &mut Self

Sets the maximum size of any chunk.

§Panics

If size == 0

source

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.

source

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>

source

pub fn freeze(&mut self) -> Result<&mut Self>

Freeze the transaction so that no further modifications can be made.

§Errors
§Panics
  • If node_account_ids is explicitly set to empty (IE: tx.node_account_ids([]).freeze_with(None)).
source

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
§Panics
  • If node_account_ids is explicitly set to empty (IE: tx.node_account_ids([]).freeze_with(None)).
source

pub fn sign_with_operator(&mut self, client: &Client) -> Result<&mut Self>

Sign the transaction with the client’s operator.

§Errors
§Panics

If client has no operator.

source§

impl<D: TransactionExecute> Transaction<D>

source

pub fn to_bytes(&self) -> Result<Vec<u8>>

Convert self to protobuf encoded bytes.

§Errors
  • If freeze_with wasn’t called with an operator.
§Panics
  • If !self.is_frozen().
source

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.

source

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.
source

pub fn get_transaction_hash(&mut self) -> Result<TransactionHash>

Get the hash for this transaction.

Note: Calling this function disables transaction ID regeneration.

§Errors
§Panics
  • If !self.is_frozen().
source

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
§Panics
  • If !self.is_frozen().
source§

impl<D> Transaction<D>
where D: TransactionData,

source

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 no max_transaction_fee specified.

Currently this is (but not guaranteed to be) 2 ℏ for most transaction types.

source§

impl<D> Transaction<D>
where D: TransactionExecute,

source

pub async fn get_cost(&self, client: &Client) -> Result<Hbar>

Get the estimated transaction cost for this transaction.

source

pub async fn execute(&mut self, client: &Client) -> Result<TransactionResponse>

Execute this transaction against the provided client of the Hedera network.

source

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,

source

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>

source

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
source§

impl Transaction<TransferTransactionData>

source

pub fn hbar_transfer( &mut self, account_id: AccountId, amount: Hbar, ) -> &mut Self

Add a non-approved hbar transfer to the transaction.

source

pub fn approved_hbar_transfer( &mut self, account_id: AccountId, amount: Hbar, ) -> &mut Self

Add an approved hbar transfer to the transaction.

source

pub fn get_hbar_transfers(&self) -> HashMap<AccountId, Hbar>

Returns all transfers associated with this transaction.

source

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).

source

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).

source

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.

source

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.

source

pub fn get_token_transfers(&self) -> HashMap<TokenId, HashMap<AccountId, i64>>

Returns all the token transfers associated associated with this transaction.

source

pub fn get_token_decimals(&self) -> HashMap<TokenId, u32>

Returns the decimals associated with each token.

source

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.

source

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.

source

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>

source§

fn clone(&self) -> Transaction<D>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<D> Debug for Transaction<D>
where D: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<D> Default for Transaction<D>
where D: Default,

source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more