Struct terra_rust_api::client::Terra [−][src]
pub struct Terra {
pub chain_id: String,
pub gas_options: Option<GasOptions>,
pub debug: bool,
// some fields omitted
}
Expand description
The main structure that all API calls are generated from
Fields
chain_id: String
The Chain of the network
gas_options: Option<GasOptions>
Gas Options used to help with gas/fee generation of transactions
debug: bool
Implementations
pub fn lcd_client<S: Into<String>>(
url: S,
chain_id: S,
gas_options: &GasOptions,
debug: Option<bool>
) -> Terra
pub fn lcd_client<S: Into<String>>(
url: S,
chain_id: S,
gas_options: &GasOptions,
debug: Option<bool>
) -> Terra
Create a LCD client interface
Create a read-only / query client interface
Tendermint (MISC) API Functions
pub async fn send_cmd<T: for<'de> Deserialize<'de>>(
&self,
path: &str,
args: Option<&str>
) -> Result<T, TerraRustAPIError>
pub async fn send_cmd<T: for<'de> Deserialize<'de>>(
&self,
path: &str,
args: Option<&str>
) -> Result<T, TerraRustAPIError>
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, TerraRustAPIError>
pub async fn send_cmd_url<T: for<'de> Deserialize<'de>>(
&self,
url: &str,
path: &str,
args: Option<&str>
) -> Result<T, TerraRustAPIError>
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, TerraRustAPIError>
pub async fn post_cmd<R: for<'de> Serialize, T: for<'de> Deserialize<'de>>(
&self,
path: &str,
args: &R
) -> Result<T, TerraRustAPIError>
pub async fn post_cmd<R: for<'de> Serialize, T: for<'de> Deserialize<'de>>(
&self,
path: &str,
args: &R
) -> Result<T, TerraRustAPIError>
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: &PrivateKey,
messages: Vec<Message>,
memo: Option<String>
) -> Result<(StdSignMsg, Vec<StdSignature>)>
pub async fn generate_transaction_to_broadcast(
&self,
secp: &Secp256k1<All>,
from: &PrivateKey,
messages: Vec<Message>,
memo: Option<String>
) -> Result<(StdSignMsg, 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: &PrivateKey,
messages: Vec<Message>,
memo: Option<String>
) -> Result<TXResultSync>
pub async fn submit_transaction_sync(
&self,
secp: &Secp256k1<All>,
from: &PrivateKey,
messages: Vec<Message>,
memo: Option<String>
) -> Result<TXResultSync>
helper: sign & submit the transaction sync
pub async fn submit_transaction_async(
&self,
secp: &Secp256k1<All>,
from: &PrivateKey,
messages: Vec<Message>,
memo: Option<String>
) -> Result<TXResultAsync>
pub async fn submit_transaction_async(
&self,
secp: &Secp256k1<All>,
from: &PrivateKey,
messages: Vec<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
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Terra
impl !UnwindSafe for Terra
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more