pub struct ExecuteSignedTransaction {
pub tr: TransactionableOrSigned<SignedTransaction>,
pub signer: Arc<Signer>,
pub wait_until: TxExecutionStatus,
}Expand description
The handler for signing and sending transaction to the network.
This is the main entry point for the transaction sending functionality.
Fields§
§tr: TransactionableOrSigned<SignedTransaction>The transaction that is either not signed yet or already signed.
signer: Arc<Signer>The signer that will be used to sign the transaction.
wait_until: TxExecutionStatusImplementations§
Source§impl ExecuteSignedTransaction
impl ExecuteSignedTransaction
pub fn new<T: Transactionable + 'static>(tr: T, signer: Arc<Signer>) -> Self
Sourcepub fn meta(self) -> ExecuteMetaTransaction
pub fn meta(self) -> ExecuteMetaTransaction
Changes the transaction to a meta transaction, allowing some 3rd party entity to execute it and pay for the gas.
Please note, that if you already presigned the transaction, it would require you to sign it again as a meta transaction is a different type of transaction.
pub const fn wait_until(self, wait_until: TxExecutionStatus) -> Self
Sourcepub async fn presign_offline(
self,
public_key: PublicKey,
block_hash: CryptoHash,
nonce: Nonce,
) -> Result<Self, SignerError>
pub async fn presign_offline( self, public_key: PublicKey, block_hash: CryptoHash, nonce: Nonce, ) -> Result<Self, SignerError>
Signs the transaction offline without fetching the nonce or block hash from the network.
The transaction won’t be broadcasted to the network and just stored signed in the Self::tr struct variable.
This is useful if you already have the nonce and block hash, or if you want to sign the transaction offline. Please note that incorrect nonce will lead to transaction failure.
Sourcepub async fn presign_with(
self,
network: &NetworkConfig,
) -> Result<Self, ExecuteTransactionError>
pub async fn presign_with( self, network: &NetworkConfig, ) -> Result<Self, ExecuteTransactionError>
Signs the transaction with the custom network configuration but doesn’t broadcast it.
Signed transaction is stored in the Self::tr struct variable.
This is useful if you want to sign with non-default network configuration (e.g, custom RPC URL, sandbox). The provided call will fetch the nonce and block hash from the given network.
Sourcepub async fn presign_with_mainnet(self) -> Result<Self, ExecuteTransactionError>
pub async fn presign_with_mainnet(self) -> Result<Self, ExecuteTransactionError>
Signs the transaction with the default mainnet configuration. Does not broadcast it.
Signed transaction is stored in the Self::tr struct variable.
The provided call will fetch the nonce and block hash from the network.
Sourcepub async fn presign_with_testnet(self) -> Result<Self, ExecuteTransactionError>
pub async fn presign_with_testnet(self) -> Result<Self, ExecuteTransactionError>
Signs the transaction with the default testnet configuration. Does not broadcast it.
Signed transaction is stored in the Self::tr struct variable.
The provided call will fetch the nonce and block hash from the network.
Sourcepub async fn send_to(
self,
network: &NetworkConfig,
) -> Result<ExecutionFinalResult, ExecuteTransactionError>
pub async fn send_to( self, network: &NetworkConfig, ) -> Result<ExecutionFinalResult, ExecuteTransactionError>
Sends the transaction to the custom provided network.
This is useful if you want to send the transaction to a non-default network configuration (e.g, custom RPC URL, sandbox). Please note that if the transaction is not presigned, it will be signed with the network’s nonce and block hash.
Sourcepub async fn send_to_mainnet(
self,
) -> Result<ExecutionFinalResult, ExecuteTransactionError>
pub async fn send_to_mainnet( self, ) -> Result<ExecutionFinalResult, ExecuteTransactionError>
Sends the transaction to the default mainnet configuration.
Please note that this will sign the transaction with the mainnet’s nonce and block hash if it’s not presigned yet.
Sourcepub async fn send_to_testnet(
self,
) -> Result<ExecutionFinalResult, ExecuteTransactionError>
pub async fn send_to_testnet( self, ) -> Result<ExecutionFinalResult, ExecuteTransactionError>
Sends the transaction to the default testnet configuration.
Please note that this will sign the transaction with the testnet’s nonce and block hash if it’s not presigned yet.