Struct substrate_api_client::Api [−][src]
pub struct Api<P> where
P: Pair,
MultiSignature: From<P::Signature>, { pub url: String, pub signer: Option<P>, pub genesis_hash: Hash, pub metadata: Metadata, pub runtime_version: RuntimeVersion, }
Fields
url: Stringsigner: Option<P>genesis_hash: Hashmetadata: Metadataruntime_version: RuntimeVersionImplementations
pub fn get_account_info(
&self,
address: &AccountId
) -> Result<Option<AccountInfo>, ApiClientError>pub fn get_account_data(
&self,
address: &AccountId
) -> Result<Option<AccountData>, ApiClientError>pub fn get_header<H>(
&self,
hash: Option<Hash>
) -> Result<Option<H>, ApiClientError> where
H: Header + DeserializeOwned, pub fn get_block<B>(
&self,
hash: Option<Hash>
) -> Result<Option<B>, ApiClientError> where
B: Block + DeserializeOwned, pub fn get_signed_block<B>(
&self,
hash: Option<Hash>
) -> Result<Option<SignedBlock<B>>, ApiClientError> where
B: Block + DeserializeOwned,
pub fn get_signed_block<B>(
&self,
hash: Option<Hash>
) -> Result<Option<SignedBlock<B>>, ApiClientError> where
B: Block + DeserializeOwned, A signed block is a block with Justification ,i.e., a Grandpa finality proof.
The interval at which finality proofs are provided is set via the
the GrandpaConfig.justification_period in a node’s service.rs.
The Justification may be none.
pub fn get_storage_value(
&self,
storage_prefix: &str,
storage_key_name: &str,
at_block: Option<Hash>
) -> Result<Option<StorageValue>, ApiClientError>pub fn get_storage_map(
&self,
storage_prefix: &str,
storage_key_name: &str,
map_key: Vec<u8>,
at_block: Option<Hash>
) -> Result<Option<StorageValue>, ApiClientError>pub fn get_storage_map_key_prefix(
&self,
storage_prefix: &str,
storage_key_name: &str
) -> Result<StorageKey, ApiClientError>pub fn get_storage_double_map(
&self,
storage_prefix: &str,
storage_key_name: &str,
first: Vec<u8>,
second: Vec<u8>,
at_block: Option<Hash>
) -> Result<Option<StorageValue>, ApiClientError>pub fn get_storage_by_key_hash(
&self,
key: StorageKey,
at_block: Option<Hash>
) -> Result<Option<StorageValue>, ApiClientError>pub fn get_opaque_storage_by_key_hash(
&self,
key: StorageKey,
at_block: Option<Hash>
) -> Result<Option<Vec<u8>>, ApiClientError>pub fn get_storage_value_proof(
&self,
storage_prefix: &str,
storage_key_name: &str,
at_block: Option<Hash>
) -> Result<Option<ReadProof<Hash>>, ApiClientError>pub fn get_storage_map_proof(
&self,
storage_prefix: &str,
storage_key_name: &str,
map_key: Vec<u8>,
at_block: Option<Hash>
) -> Result<Option<ReadProof<Hash>>, ApiClientError>pub fn get_storage_double_map_proof(
&self,
storage_prefix: &str,
storage_key_name: &str,
first: Vec<u8>,
second: Vec<u8>,
at_block: Option<Hash>
) -> Result<Option<ReadProof<Hash>>, ApiClientError>pub fn get_storage_proof_by_keys(
&self,
keys: Vec<StorageKey>,
at_block: Option<Hash>
) -> Result<Option<ReadProof<Hash>>, ApiClientError>pub fn get_keys(
&self,
key: StorageKey,
at_block: Option<Hash>
) -> Result<Option<Vec<String>>, ApiClientError>pub fn send_extrinsic(
&self,
xthex_prefixed: String,
exit_on: XtStatus
) -> Result<Option<Hash>, ApiClientError>pub fn subscribe_finalized_heads(
&self,
sender: ThreadOut<String>
) -> Result<(), ApiClientError>pub fn wait_for_event<E: Decode>(
&self,
module: &str,
variant: &str,
decoder: Option<EventsDecoder>,
receiver: &Receiver<String>
) -> Result<E, ApiClientError>pub fn wait_for_raw_event(
&self,
module: &str,
variant: &str,
decoder: Option<EventsDecoder>,
receiver: &Receiver<String>
) -> Result<RawEvent, ApiClientError>Trait Implementations
Auto Trait Implementations
impl<P> RefUnwindSafe for Api<P> where
P: RefUnwindSafe, impl<P> UnwindSafe for Api<P> where
P: UnwindSafe, Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = TShould always be Self
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>, Convert from a value of T into an equivalent instance of Self. Read more
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>, Consume self to return an equivalent value of T. Read more
The counterpart to unchecked_from.
pub fn unique_saturated_into(self) -> T
pub fn unique_saturated_into(self) -> TConsume self to return an equivalent value of T.
pub fn vzip(self) -> Vimpl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe,