Struct subxt::rpc::Rpc

source ·
pub struct Rpc<T: Config> { /* private fields */ }
Expand description

Client for substrate rpc interfaces

Implementations§

Create a new Rpc

Fetch the raw bytes for a given storage key

Returns the keys with prefix with pagination support. Up to count keys will be returned. If start_key is passed, return next keys in storage in lexicographic order.

Query historical storage entries

Query historical storage entries

Fetch the genesis hash

Fetch the metadata

Execute a runtime API call.

Fetch system properties

Fetch system health

Fetch system chain

Fetch system name

Fetch system version

Fetch the current nonce for the given account ID.

Get a header

Get a block hash, returns hash of latest block by default

Get a block hash of the latest finalized block

Get a Block

Reexecute the specified block_hash and gather statistics while doing so.

This function requires the specified block and its parent to be available at the queried node. If either the specified block or the parent is pruned, this function will return None.

Get proof of storage entries at a specific block’s state.

Fetch the runtime version

Subscribe to all new best block headers.

Subscribe to all new block headers.

Subscribe to finalized block headers.

Note: this may not produce every block in the finalized chain; sometimes multiple blocks are finalized at once, and in this case only the latest one is returned. the higher level APIs that use this “fill in” the gaps for us.

Subscribe to runtime version updates that produce changes in the metadata.

Create and submit an extrinsic and return corresponding Hash if successful

Execute a runtime API call.

Create and submit an extrinsic and return a subscription to the events triggered.

Insert a key into the keystore.

Generate new session keys and returns the corresponding public keys.

Checks if the keystore has private keys for the given session public keys.

session_keys is the SCALE encoded session keys object from the runtime.

Returns true iff all private keys could be found.

Checks if the keystore has private keys for the given public key and key type.

Returns true if a private key could be found.

Submits the extrinsic to the dry_run RPC, to test if it would succeed.

Returns a types::DryRunResult, which is the result of performing the dry run.

Subscribe to chainHead_unstable_follow to obtain all reported blocks by the chain.

The subscription ID can be used to make queries for the block’s body (chainhead_unstable_body), block’s header (chainhead_unstable_header), block’s storage (chainhead_unstable_storage) and submitting runtime API calls at this block (chainhead_unstable_call).

Note

When the user is no longer interested in a block, the user is responsible for calling the chainhead_unstable_unpin method. Failure to do so will result in the subscription being stopped by generating the Stop event.

Subscribe to chainHead_unstable_body to obtain events regarding the block’s body.

Note

The subscription ID is obtained from an open subscription created by chainhead_unstable_follow.

Get the block’s body using the chainHead_unstable_header method.

Note

The subscription ID is obtained from an open subscription created by chainhead_unstable_follow.

Subscribe to chainHead_storage to obtain events regarding the block’s storage.

Note

The subscription ID is obtained from an open subscription created by chainhead_unstable_follow.

Subscribe to chainHead_call to obtain events regarding the runtime API call.

Note

The subscription ID is obtained from an open subscription created by chainhead_unstable_follow.

Unpin a block reported by the chainHead_follow subscription.

Note

The subscription ID is obtained from an open subscription created by chainhead_unstable_follow.

Get genesis hash obtained from the chainHead_genesisHash method.

Methods from Deref<Target = RpcClient>§

Make an RPC request, given a method name and some parameters.

See RpcParams and the rpc_params! macro for an example of how to construct the parameters.

Subscribe to an RPC endpoint, providing the parameters and the method to call to unsubscribe from it again.

See RpcParams and the rpc_params! macro for an example of how to construct the parameters.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
The resulting type after dereferencing.
Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert from a value of T into an equivalent instance of Option<Self>. Read more
Consume self to return Some equivalent value of Option<T>. Read more
Converts self into T using Into<T>. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when Debug-formatted. Read more
Causes self to use its LowerExp implementation when Debug-formatted. Read more
Causes self to use its LowerHex implementation when Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when Debug-formatted. Read more
Causes self to use its UpperExp implementation when Debug-formatted. Read more
Causes self to use its UpperHex implementation when Debug-formatted. Read more
Formats each item in a sequence. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
Should always be Self
Convert from a value of T into an equivalent instance of Self. Read more
Consume self to return an equivalent value of T. Read more
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The counterpart to unchecked_from.
Consume self to return an equivalent value of T.
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