pub struct ExecuteMetaTransaction {
pub tr: TransactionableOrSigned<SignedDelegateAction>,
pub signer: Arc<Signer>,
pub tx_live_for: Option<BlockHeight>,
}Fields§
§tr: TransactionableOrSigned<SignedDelegateAction>§signer: Arc<Signer>§tx_live_for: Option<BlockHeight>Implementations§
Source§impl ExecuteMetaTransaction
impl ExecuteMetaTransaction
pub fn new<T: Transactionable + 'static>(tr: T, signer: Arc<Signer>) -> Self
pub fn from_box( tr: Box<dyn Transactionable + 'static>, signer: Arc<Signer>, ) -> Self
Sourcepub const fn tx_live_for(self, tx_live_for: BlockHeight) -> Self
pub const fn tx_live_for(self, tx_live_for: BlockHeight) -> Self
Sets the transaction live for the given block amount.
This is useful if you want to set the transaction to be valid for a specific amount of blocks.
The default amount is 1000 blocks.
Sourcepub async fn presign_offline(
self,
signer_key: PublicKey,
block_hash: CryptoHash,
nonce: Nonce,
block_height: BlockHeight,
) -> Result<Self, ExecuteMetaTransactionsError>
pub async fn presign_offline( self, signer_key: PublicKey, block_hash: CryptoHash, nonce: Nonce, block_height: BlockHeight, ) -> Result<Self, ExecuteMetaTransactionsError>
Signs the transaction offline without fetching the nonce or block hash from the network. Does not broadcast it.
Signed transaction is stored 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 and incorrect block height will lead to incorrectly populated transaction live value.
Sourcepub async fn presign_with(
self,
network: &NetworkConfig,
) -> Result<Self, ExecuteMetaTransactionsError>
pub async fn presign_with( self, network: &NetworkConfig, ) -> Result<Self, ExecuteMetaTransactionsError>
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).
Sourcepub async fn presign_with_mainnet(
self,
) -> Result<Self, ExecuteMetaTransactionsError>
pub async fn presign_with_mainnet( self, ) -> Result<Self, ExecuteMetaTransactionsError>
Signs the transaction with the default mainnet configuration but doesn’t broadcast it.
Signed transaction is stored in the Self::tr struct variable.
The provided call will fetch the nonce and block hash, block height from the network.
Sourcepub async fn presign_with_testnet(
self,
) -> Result<Self, ExecuteMetaTransactionsError>
pub async fn presign_with_testnet( self, ) -> Result<Self, ExecuteMetaTransactionsError>
Signs the transaction with the default testnet configuration but doesn’t broadcast it.
Signed transaction is stored in the Self::tr struct variable.
The provided call will fetch the nonce and block hash, block height from the network.
Sourcepub async fn send_to(
self,
network: &NetworkConfig,
) -> Result<Response, ExecuteMetaTransactionsError>
pub async fn send_to( self, network: &NetworkConfig, ) -> Result<Response, ExecuteMetaTransactionsError>
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 sign with the network’s nonce and block hash.
Sourcepub async fn send_to_mainnet(
self,
) -> Result<Response, ExecuteMetaTransactionsError>
pub async fn send_to_mainnet( self, ) -> Result<Response, ExecuteMetaTransactionsError>
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<Response, ExecuteMetaTransactionsError>
pub async fn send_to_testnet( self, ) -> Result<Response, ExecuteMetaTransactionsError>
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.