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 strThe Chain of the network
gas_options: Option<&'a GasOptions>Gas Options used to help with gas/fee generation of transactions
debug: boolImplementations
pub async fn lcd_client(
url: &'a str,
chain_id: &'a str,
gas_options: &'a GasOptions,
debug: Option<bool>
) -> Result<Terra<'a>>
pub async fn lcd_client(
url: &'a str,
chain_id: &'a str,
gas_options: &'a GasOptions,
debug: Option<bool>
) -> Result<Terra<'a>>
Create a LCD client interface
Create a read-only / query client interface
Tendermint (MISC) API Functions
used to send a GET command to the LCD
pub async fn send_cmd_url<T: for<'de> Deserialize<'de>>(
&self,
url: &str,
path: &str,
args: Option<&str>
) -> Result<T>
pub async fn send_cmd_url<T: for<'de> Deserialize<'de>>(
&self,
url: &str,
path: &str,
args: Option<&str>
) -> Result<T>
used to send a GET command to any URL
pub async fn fetch_url<T: for<'de> Deserialize<'de>>(
client: &Client,
url: &str,
path: &str,
args: Option<&str>
) -> Result<T>
used to send a POST with a JSON body to the LCD
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>)>
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>)>
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
pub async fn submit_transaction_sync(
&self,
secp: &Secp256k1<All>,
from: &'a PrivateKey,
messages: &'a [Message],
memo: Option<String>
) -> Result<TXResultSync>
pub async fn submit_transaction_sync(
&self,
secp: &Secp256k1<All>,
from: &'a PrivateKey,
messages: &'a [Message],
memo: Option<String>
) -> Result<TXResultSync>
helper: sign & submit the transaction sync
pub async fn submit_transaction_async(
&self,
secp: &Secp256k1<All>,
from: &'a PrivateKey,
messages: &'a [Message],
memo: Option<String>
) -> Result<TXResultAsync>
pub async fn submit_transaction_async(
&self,
secp: &Secp256k1<All>,
from: &'a PrivateKey,
messages: &'a [Message],
memo: Option<String>
) -> Result<TXResultAsync>
helper: sign & submit the transaction async
fetch the address book for the production network
fetch the address book for the testnet network
fetch a address book json structure