Struct terra_rust_api::client::Terra[][src]

pub struct Terra<'a> {
    pub chain_id: &'a str,
    pub gas_options: Option<&'a GasOptions>,
    pub debug: bool,
    // some fields omitted
}
Expand description

The main structure that all API calls are generated from

Fields

chain_id: &'a str

The Chain of the network

gas_options: Option<&'a GasOptions>

Gas Options used to help with gas/fee generation of transactions

debug: bool

Implementations

impl<'a> Terra<'a>[src]

pub async fn lcd_client(
    url: &'a str,
    chain_id: &'a str,
    gas_options: &'a GasOptions,
    debug: Option<bool>
) -> Result<Terra<'a>>
[src]

Create a FULL client interface

pub async fn lcd_client_no_tx(
    url: &'a str,
    chain_id: &'a str
) -> Result<Terra<'a>>
[src]

Create a read-only / query client interface

pub fn auth(&self) -> Auth<'_>[src]

Auth API functions

pub fn staking(&self) -> Staking<'_>[src]

Staking API functions

pub fn market(&self) -> Market<'_>[src]

Market API functions

pub fn oracle(&self) -> Oracle<'_>[src]

Oracle API functions

pub fn tendermint(&self) -> Tendermint<'_>[src]

Tendermint (MISC) API Functions

pub fn tx(&self) -> TX<'_>[src]

TXS API Functions

pub fn wasm(&self) -> Wasm<'_>[src]

WASM module / smart contract API Functions

pub async fn send_cmd<T: for<'de> Deserialize<'de>>(
    &self,
    path: &str,
    args: Option<&str>
) -> Result<T>
[src]

used to send a GET command to the LCD

pub async fn post_cmd<R: for<'de> Serialize, T: for<'de> Deserialize<'de>>(
    &self,
    path: &str,
    args: &R
) -> Result<T>
[src]

used to send a POST with a JSON body to the LCD

pub async fn calc_fees(&self, messages: &[Message]) -> Result<StdFee>[src]

Generate Fee structure, either by estimation method or hardcoded

pub async fn generate_transaction_to_broadcast(
    &self,
    secp: &Secp256k1<All>,
    from: &'a PrivateKey,
    messages: &'a [Message],
    memo: Option<String>
) -> Result<(StdSignMsg<'a>, Vec<StdSignature>)>
[src]

helper function to generate a ‘StdSignMsg’ & ‘Signature’ blocks to be used to broadcast a transaction This version calculates fees, and obtains account# and sequence# as well

Auto Trait Implementations

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

impl<'a> Send for Terra<'a>

impl<'a> Sync for Terra<'a>

impl<'a> Unpin for Terra<'a>

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

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

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

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

pub fn vzip(self) -> V