[][src]Struct substrate_subxt::Client

pub struct Client<T: System, S = MultiSignature> { /* fields omitted */ }

Client to interface with a substrate node.

Methods

impl<T: System + Balances + Sync + Send + 'static, S: 'static> Client<T, S>[src]

pub fn metadata(&self) -> &Metadata[src]

Returns the chain metadata.

pub async fn fetch<'_, V: Decode>(
    &'_ self,
    key: StorageKey,
    hash: Option<T::Hash>
) -> Result<Option<V>, Error>
[src]

Fetch a StorageKey.

pub async fn fetch_or<'_, V: Decode>(
    &'_ self,
    key: StorageKey,
    hash: Option<T::Hash>,
    default: V
) -> Result<V, Error>
[src]

Fetch a StorageKey or return the default.

pub async fn fetch_or_default<'_, V: Decode + Default>(
    &'_ self,
    key: StorageKey,
    hash: Option<T::Hash>
) -> Result<V, Error>
[src]

Fetch a StorageKey or return the default.

pub async fn query_storage<'_>(
    &'_ self,
    keys: Vec<StorageKey>,
    from: T::Hash,
    to: Option<T::Hash>
) -> Result<Vec<StorageChangeSet<<T as System>::Hash>>, Error>
[src]

Query historical storage entries

pub async fn header<'_, H>(
    &'_ self,
    hash: Option<H>
) -> Result<Option<T::Header>, Error> where
    H: Into<T::Hash> + 'static, 
[src]

Get a header

pub async fn block_hash<'_>(
    &'_ self,
    block_number: Option<NumberOrHex<<T as System>::BlockNumber>>
) -> Result<Option<T::Hash>, Error>
[src]

Get a block hash. By default returns the latest block hash

pub async fn finalized_head<'_>(&'_ self) -> Result<T::Hash, Error>[src]

Get a block hash of the latest finalized block

pub async fn block<'_, H>(
    &'_ self,
    hash: Option<H>
) -> Result<Option<SignedBlock<Block<<T as System>::Header, <T as System>::Extrinsic>>>, Error> where
    H: Into<T::Hash> + 'static, 
[src]

Get a block

pub async fn submit_extrinsic<'_, E: Encode>(
    &'_ self,
    extrinsic: E
) -> Result<T::Hash, Error>
[src]

Create and submit an extrinsic and return corresponding Hash if successful

pub async fn submit_and_watch_extrinsic<E: Encode + 'static>(
    self,
    extrinsic: E,
    decoder: EventsDecoder<T>
) -> Result<ExtrinsicSuccess<T>, Error>
[src]

Create and submit an extrinsic and return corresponding Event if successful

pub async fn subscribe_events<'_>(
    &'_ self
) -> Result<Subscription<StorageChangeSet<T::Hash>>, Error>
[src]

Subscribe to events.

pub async fn subscribe_blocks<'_>(
    &'_ self
) -> Result<Subscription<T::Header>, Error>
[src]

Subscribe to new blocks.

pub async fn subscribe_finalized_blocks<'_>(
    &'_ self
) -> Result<Subscription<T::Header>, Error>
[src]

Subscribe to finalized blocks.

pub async fn xt<'_, P>(
    &'_ self,
    signer: P,
    nonce: Option<T::Index>
) -> Result<XtBuilder<T, P, S>, Error> where
    P: Pair,
    P::Signature: Codec,
    S: Verify,
    S::Signer: From<P::Public> + IdentifyAccount<AccountId = T::AccountId>, 
[src]

Create a transaction builder for a private key.

Trait Implementations

impl<T: System, S> Clone for Client<T, S>[src]

impl<T: System + Balances + Sync + Send + 'static, S: 'static> SystemStore for Client<T, S>[src]

type System = T

System type.

Auto Trait Implementations

impl<T, S = MultiSignature> !RefUnwindSafe for Client<T, S>

impl<T, S> Send for Client<T, S> where
    T: Send,
    <T as System>::Hash: Send

impl<T, S> Sync for Client<T, S> where
    T: Sync,
    <T as System>::Hash: Sync

impl<T, S> Unpin for Client<T, S> where
    T: Unpin,
    <T as System>::Hash: Unpin

impl<T, S = MultiSignature> !UnwindSafe for Client<T, S>

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> CheckedConversion for T[src]

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

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

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

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<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    S: TryInto<T>,
    T: Bounded

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