ExecuteMetaTransaction

Struct ExecuteMetaTransaction 

Source
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

Source

pub fn new<T: Transactionable + 'static>(tr: T, signer: Arc<Signer>) -> Self

Source

pub fn from_box( tr: Box<dyn Transactionable + 'static>, signer: Arc<Signer>, ) -> Self

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

async fn send_impl( network: &NetworkConfig, tr: SignedDelegateAction, ) -> Result<Response, ExecuteMetaTransactionsError>

Auto Trait Implementations§

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> 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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