Skip to main content

TX

Struct TX 

Source
pub struct TX<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> TX<'a>

Source

pub fn create(terra: &'a Terra) -> TX<'a>

Source

pub async fn broadcast_async( &self, std_sign_msg: &StdSignMsg, sigs: &[StdSignature], ) -> Result<TXResultAsync, TerraRustAPIError>

perform an Async submission to the blockchain. This returns the TXHash This is not guaranteed to successfully create a transaction record, due to numerous factors

Source

pub async fn broadcast_sync( &self, std_sign_msg: &StdSignMsg, sigs: &[StdSignature], ) -> Result<TXResultSync, TerraRustAPIError>

perform a sync submission to the blockchain. This will return more validation logic than async but you wait. It is still not guaranteed to create a blockchain transaction

Source

pub async fn broadcast_block( &self, std_sign_msg: &StdSignMsg, sigs: &[StdSignature], ) -> Result<TXResultBlock, TerraRustAPIError>

perform a ‘blocking’ submission to the blockchain. This will only return once the transaction is executed on the blockchain. This is great for debugging, but not recommended to be used otherwise

Source

pub async fn get(&self, hash: &str) -> Result<TXResultBlock, TerraRustAPIError>

👎Deprecated since 1.2.12:

terra has deprecated this API endpoint. use get_v1

get TX result

Source

pub async fn get_v1(&self, hash: &str) -> Result<V1TXResult, TerraRustAPIError>

use v1 API

Source

pub async fn get_and_wait( &self, hash: &str, max_times: usize, sleep_amount: Duration, ) -> Result<TXResultBlock, TerraRustAPIError>

👎Deprecated since 1.2.12:

terra has deprecated this API endpoint. Use get_and_wait_v1

get TX result, retrying a few times.

Source

pub async fn get_and_wait_v1( &self, hash: &str, max_times: usize, sleep_amount: Duration, ) -> Result<V1TXResult, TerraRustAPIError>

get TX result, retrying a few times.

Source

pub async fn estimate_fee( &self, sender: &str, msgs: &[Message], gas_adjustment: f64, gas_prices: &[&Coin], ) -> Result<LCDResult<TxFeeResult>, TerraRustAPIError>

Estimate the StdFee structure based on the gas used

Source

pub async fn simulate_v1( &self, sender: &str, msgs: &[Message], gas_adjustment: f64, gas_prices: &[&Coin], ) -> Result<LCDResult<TxFeeResult>, TerraRustAPIError>

simulate transaction for estimating gas usage

Source

pub async fn get_txs_in_block( &self, height: u64, offset: Option<u64>, limit: Option<u64>, ) -> Result<V1TXSResult, TerraRustAPIError>

Get a list of transactions in a given block

Auto Trait Implementations§

§

impl<'a> Freeze for TX<'a>

§

impl<'a> !RefUnwindSafe for TX<'a>

§

impl<'a> Send for TX<'a>

§

impl<'a> Sync for TX<'a>

§

impl<'a> Unpin for TX<'a>

§

impl<'a> UnsafeUnpin for TX<'a>

§

impl<'a> !UnwindSafe for TX<'a>

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