[][src]Struct contact::client::Contact

pub struct Contact { /* fields omitted */ }

An instance of Contact Cosmos RPC Client.

Implementations

impl Contact[src]

pub async fn get_latest_block<'_>(
    &'_ self
) -> Result<LatestBlockEndpointResponse, JsonRpcError>
[src]

pub async fn get_account_info<'_>(
    &'_ self,
    address: Address
) -> Result<ResponseWrapper<TypeWrapper<CosmosAccountInfo>>, JsonRpcError>
[src]

Gets account info for the provided Cosmos account using the accounts endpoint

pub async fn get_peggy_valset<'_>(
    &'_ self
) -> Result<ResponseWrapper<Valset>, JsonRpcError>
[src]

Get the latest valset recorded by the peggy module. If no valset has ever been created you will instead get a blank valset at height 0. Any value above this may or may not be a complete valset and it's up to the caller to interpret the response.

pub async fn get_peggy_valset_request<'_>(
    &'_ self,
    nonce: u128
) -> Result<ResponseWrapper<Valset>, JsonRpcError>
[src]

get the valset for a given nonce (block) height

pub async fn get_oldest_unsigned_valset<'_>(
    &'_ self,
    address: Address
) -> Result<ResponseWrapper<Valset>, JsonRpcError>
[src]

This hits the /pending_valset_requests endpoint and will provide the oldest validator set we have not yet signed.

pub async fn get_last_valset_requests<'_>(
    &'_ self
) -> Result<ResponseWrapper<Vec<Valset>>, JsonRpcError>
[src]

this input views the last five valest requests that have been made, useful if you're a relayer looking to ferry confirmations

pub async fn get_all_valset_confirms<'_>(
    &'_ self,
    nonce: u64
) -> Result<ResponseWrapper<Vec<ValsetConfirmResponse>>, JsonRpcError>
[src]

get all valset confirmations for a given nonce

impl Contact[src]

pub async fn send_transaction<'_>(
    &'_ self,
    msg: Transaction
) -> Result<TXSendResponse, JsonRpcError>
[src]

The advanced version of create_and_send transaction that expects you to perform your own signing and prep first.

pub async fn create_and_send_transaction<'_>(
    &'_ self,
    coin: Coin,
    fee: Coin,
    destination: Address,
    private_key: PrivateKey,
    chain_id: Option<String>,
    account_number: Option<u128>,
    sequence: Option<u128>
) -> Result<TXSendResponse, JsonRpcError>
[src]

The hand holding version of send transaction that does it all for you

pub async fn update_peggy_eth_address<'_>(
    &'_ self,
    eth_private_key: EthPrivateKey,
    private_key: PrivateKey,
    fee: Coin,
    chain_id: Option<String>,
    account_number: Option<u128>,
    sequence: Option<u128>
) -> Result<TXSendResponse, JsonRpcError>
[src]

Send a transaction updating the eth address for the sending Cosmos address. The sending Cosmos address should be a validator

pub async fn send_valset_request<'_>(
    &'_ self,
    private_key: PrivateKey,
    fee: Coin,
    chain_id: Option<String>,
    account_number: Option<u128>,
    sequence: Option<u128>
) -> Result<TXSendResponse, JsonRpcError>
[src]

Send a transaction requesting that a valset be formed for a given block height

pub async fn send_valset_confirm<'_>(
    &'_ self,
    eth_private_key: EthPrivateKey,
    fee: Coin,
    valset: Valset,
    private_key: PrivateKey,
    peggy_id: String,
    chain_id: Option<String>,
    account_number: Option<u128>,
    sequence: Option<u128>
) -> Result<TXSendResponse, JsonRpcError>
[src]

Send in a confirmation for a specific validator set for a specific block height

impl Contact[src]

pub fn new(url: &str, timeout: Duration) -> Self[src]

Trait Implementations

impl Clone for Contact[src]

Auto Trait Implementations

impl !RefUnwindSafe for Contact

impl !Send for Contact

impl !Sync for Contact

impl Unpin for Contact

impl !UnwindSafe for Contact

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.

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