SigningClient

Struct SigningClient 

Source
pub struct SigningClient {
    pub querier: QueryClient,
    pub signer: Arc<dyn TxSigner>,
    pub addr: Address,
    pub account_number: u64,
    pub middleware_map_body: Arc<Vec<SigningMiddlewareMapBody>>,
    pub middleware_map_resp: Arc<Vec<SigningMiddlewareMapResp>>,
    pub sequence_strategy: SequenceStrategy,
}

Fields§

§querier: QueryClient§signer: Arc<dyn TxSigner>§addr: Address§account_number: u64§middleware_map_body: Arc<Vec<SigningMiddlewareMapBody>>

Middleware to run before the tx is broadcast

§middleware_map_resp: Arc<Vec<SigningMiddlewareMapResp>>

Middleware to run after the tx is broadcast

§sequence_strategy: SequenceStrategy

Strategy for determining the sequence number for txs it will be applied when calling tx_builder() (i.e. it’s always possible to manually construct a TxBuilder and override it) Default is SequenceStrategyKind::Query

Implementations§

Source§

impl SigningClient

Source

pub fn authz_grant_any_msg( &self, granter: Address, grantee: Address, grant: Option<Grant>, ) -> Result<MsgGrant, Error>

Source§

impl SigningClient

Source

pub async fn authz_grant_any( &self, granter: Address, grantee: Address, grant: Option<Grant>, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn authz_grant_send( &self, granter: Address, grantee: Address, spend_limit: Vec<Coin>, allow_list: Vec<Address>, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source§

impl SigningClient

Source

pub fn contract_upload_file_msg( &self, wasm_byte_code: Vec<u8>, ) -> Result<MsgStoreCode, Error>

Source

pub fn contract_instantiate_msg( &self, admin: impl Into<Option<Address>>, code_id: u64, label: impl ToString, funds: Vec<Coin>, msg: &impl Serialize, ) -> Result<MsgInstantiateContract, Error>

Source

pub fn contract_execute_msg( &self, address: &Address, funds: Vec<Coin>, msg: &impl Serialize, ) -> Result<MsgExecuteContract, Error>

Source

pub fn contract_migrate_msg( &self, address: &Address, code_id: u64, msg: &impl Serialize, ) -> Result<MsgMigrateContract, Error>

Source§

impl SigningClient

Source

pub async fn contract_upload_file( &self, wasm_byte_code: Vec<u8>, tx_builder: Option<TxBuilder<'_>>, ) -> Result<(u64, TxResponse), Error>

Source

pub async fn contract_instantiate( &self, admin: impl Into<Option<Address>>, code_id: u64, label: impl ToString, msg: &impl Serialize, funds: Vec<Coin>, tx_builder: Option<TxBuilder<'_>>, ) -> Result<(Address, TxResponse), Error>

Source

pub async fn contract_execute( &self, address: &Address, msg: &impl Serialize, funds: Vec<Coin>, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn contract_migrate( &self, address: &Address, code_id: u64, msg: &impl Serialize, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source§

impl SigningClient

Source

pub async fn ibc_connection_handshake( &self, counterparty_client: &SigningClient, client_id: Option<IbcClientId>, counterparty_client_id: Option<IbcClientId>, simulation_gas_multipliers: Option<IbcConnectionHandshakeGasSimulationMultipliers>, logger: impl Fn(String), ) -> Result<IbcConnectionHandshake, Error>

Source

pub async fn ibc_channel_handshake( &self, counterparty_client: &SigningClient, port_id: &IbcPortId, counterparty_port_id: &IbcPortId, version: &IbcChannelVersion, ordering: IbcChannelOrdering, conn_handshake: &IbcConnectionHandshake, simulation_gas_multipliers: Option<IbcChannelHandshakeGasSimulationMultipliers>, logger: impl Fn(String), ) -> Result<IbcChannelHandshake, Error>

Source§

impl SigningClient

Source§

impl SigningClient

Source

pub async fn ibc_create_client_msg( &self, trusting_period_secs: Option<u64>, remote_querier: &QueryClient, ) -> Result<MsgCreateClient, Error>

Source

pub async fn ibc_update_client_msg( &self, client_id: &IbcClientId, remote_querier: &QueryClient, trusted_height: Option<Height>, ) -> Result<MsgUpdateClient, Error>

Source

pub async fn ibc_open_connection_init_msg( &self, client_id: &IbcClientId, counterparty_client_id: &IbcClientId, ) -> Result<MsgConnectionOpenInit, Error>

Source

pub async fn ibc_open_connection_try_msg( &self, client_id: &IbcClientId, counterparty_client_id: &IbcClientId, counterparty_connection_id: &IbcConnectionId, remote_querier: &QueryClient, ) -> Result<MsgConnectionOpenTry, Error>

Source

pub async fn ibc_open_connection_ack_msg( &self, client_id: &IbcClientId, counterparty_client_id: &IbcClientId, connection_id: &IbcConnectionId, counterparty_connection_id: &IbcConnectionId, remote_querier: &QueryClient, ) -> Result<MsgConnectionOpenAck, Error>

Source

pub async fn ibc_open_connection_confirm_msg( &self, client_id: &IbcClientId, counterparty_client_id: &IbcClientId, connection_id: &IbcConnectionId, counterparty_connection_id: &IbcConnectionId, remote_querier: &QueryClient, ) -> Result<MsgConnectionOpenConfirm, Error>

Source

pub fn ibc_open_channel_init_msg( &self, connection_id: &IbcConnectionId, port_id: &IbcPortId, version: &IbcChannelVersion, ordering: IbcChannelOrdering, counterparty_port_id: &IbcPortId, ) -> Result<MsgChannelOpenInit, Error>

Source

pub async fn ibc_open_channel_try_msg( &self, client_id: &IbcClientId, connection_id: &IbcConnectionId, port_id: &IbcPortId, version: &IbcChannelVersion, counterparty_port_id: &IbcPortId, counterparty_channel_id: &IbcChannelId, counterparty_version: &IbcChannelVersion, ordering: IbcChannelOrdering, remote_querier: &QueryClient, ) -> Result<MsgChannelOpenTry, Error>

Source

pub async fn ibc_open_channel_ack_msg( &self, client_id: &IbcClientId, channel_id: &IbcChannelId, port_id: &IbcPortId, counterparty_port_id: &IbcPortId, counterparty_channel_id: &IbcChannelId, counterparty_version: &IbcChannelVersion, remote_querier: &QueryClient, ) -> Result<MsgChannelOpenAck, Error>

Source

pub async fn ibc_open_channel_confirm_msg( &self, client_id: &IbcClientId, channel_id: &IbcChannelId, port_id: &IbcPortId, counterparty_port_id: &IbcPortId, counterparty_channel_id: &IbcChannelId, remote_querier: &QueryClient, ) -> Result<MsgChannelOpenConfirm, Error>

Source

pub async fn ibc_packet_recv_msg( &self, client_id: &IbcClientId, packet: IbcPacket, remote_querier: &QueryClient, ) -> Result<MsgRecvPacket, Error>

Source

pub async fn ibc_packet_ack_msg( &self, client_id: &IbcClientId, packet: IbcPacket, remote_querier: &QueryClient, ) -> Result<MsgAcknowledgement, Error>

Source§

impl SigningClient

Source

pub async fn ibc_create_client( &self, remote_querier: &QueryClient, trusting_period_secs: Option<u64>, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn ibc_update_client( &self, client_id: &IbcClientId, remote_querier: &QueryClient, trusted_height: Option<Height>, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn ibc_open_connection_init( &self, client_id: &IbcClientId, counterparty_client_id: &IbcClientId, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn ibc_open_connection_try( &self, client_id: &IbcClientId, counterparty_client_id: &IbcClientId, counterparty_connection_id: &IbcConnectionId, remote_querier: &QueryClient, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn ibc_open_connection_ack( &self, client_id: &IbcClientId, counterparty_client_id: &IbcClientId, connection_id: &IbcConnectionId, counterparty_connection_id: &IbcConnectionId, remote_querier: &QueryClient, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn ibc_open_connection_confirm( &self, client_id: &IbcClientId, counterparty_client_id: &IbcClientId, connection_id: &IbcConnectionId, counterparty_connection_id: &IbcConnectionId, remote_querier: &QueryClient, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn ibc_open_channel_init( &self, connection_id: &IbcConnectionId, port_id: &IbcPortId, version: &IbcChannelVersion, ordering: IbcChannelOrdering, counterparty_port_id: &IbcPortId, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn ibc_open_channel_try( &self, client_id: &IbcClientId, connection_id: &IbcConnectionId, port_id: &IbcPortId, version: &IbcChannelVersion, counterparty_port_id: &IbcPortId, counterparty_channel_id: &IbcChannelId, counterparty_version: &IbcChannelVersion, ordering: IbcChannelOrdering, remote_querier: &QueryClient, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn ibc_open_channel_ack( &self, client_id: &IbcClientId, channel_id: &IbcChannelId, port_id: &IbcPortId, counterparty_port_id: &IbcPortId, counterparty_channel_id: &IbcChannelId, counterparty_version: &IbcChannelVersion, remote_querier: &QueryClient, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn ibc_open_channel_confirm( &self, client_id: &IbcClientId, channel_id: &IbcChannelId, port_id: &IbcPortId, counterparty_port_id: &IbcPortId, counterparty_channel_id: &IbcChannelId, remote_querier: &QueryClient, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn ibc_packet_recv( &self, client_id: &IbcClientId, packet: IbcPacket, remote_querier: &QueryClient, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source

pub async fn ibc_packet_ack( &self, client_id: &IbcClientId, packet: IbcPacket, remote_querier: &QueryClient, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>

Source§

impl SigningClient

Source

pub fn transfer_msg<'a, D>( &self, amount: u128, recipient: &Address, denom: D, ) -> Result<MsgSend, Error>
where D: Into<Option<&'a str>> + Debug,

Source§

impl SigningClient

Source

pub async fn new( chain_config: ChainConfig, signer: impl TxSigner + 'static, connection: Option<Connection>, ) -> Result<SigningClient, Error>

Source

pub async fn new_with_cache( chain_config: ChainConfig, signer: impl TxSigner + 'static, cache: ClimbCache, connection: Option<Connection>, ) -> Result<SigningClient, Error>

Source

pub async fn refresh_signer(&mut self) -> Result<(), Error>

Source

pub fn chain_id(&self) -> &ChainId

Source

pub fn sequence_strategy_kind(&self) -> &SequenceStrategyKind

Source

pub fn tx_builder(&self) -> TxBuilder<'_>

Source

pub async fn transfer<'a, D>( &self, amount: u128, recipient: &Address, denom: D, tx_builder: Option<TxBuilder<'_>>, ) -> Result<TxResponse, Error>
where D: Into<Option<&'a str>> + Debug,

Trait Implementations§

Source§

impl Clone for SigningClient

Source§

fn clone(&self) -> SigningClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SigningClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<SigningClient> for AnyClient

Source§

fn from(client: SigningClient) -> AnyClient

Converts to this type from the input type.
Source§

impl TryFrom<AnyClient> for SigningClient

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: AnyClient) -> Result<SigningClient, Error>

Performs the conversion.

Auto Trait Implementations§

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<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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
Source§

impl<T> ErasedDestructor for T
where T: 'static,