Expand description
This crate provides a low level RPC interface to Substrate based nodes.
See the client module for a client::RpcClient which is driven by implementations
of client::RpcClientT (several of which are provided behind feature flags).
See the methods module for structs which implement sets of concrete RPC calls for
communicating with Substrate based nodes. These structs are all driven by a client::RpcClient.
The RPC clients/methods here are made use of in subxt. Enabling the subxt feature flag ensures
that all Subxt configurations are also valid RPC configurations.
The provided RPC client implementations can be used natively (with the default native feature
flag) or in WASM based web apps (with the web feature flag).
Re-exports§
pub use client::RpcClient;pub use client::RpcClientT;pub use methods::ChainHeadRpcMethods;pub use methods::LegacyRpcMethods;
Modules§
- client
- RPC types and client for interacting with a substrate node.
- methods
- RPC methods are defined in this module. At the moment we have:
- utils
- A couple of utility methods that we make use of.
Macros§
- rpc_
params - Create some
RpcParamsto pass to ourRpcClient.RpcParamssimply enforces that parameters handed to ourRpcClientmethods are the correct shape.
Structs§
- User
Error - This error should be returned when the user is at fault making a call,
for instance because the method name was wrong, parameters invalid or some
invariant not upheld. Implementations of
RpcClientTshould turn any such errors into this, so that they can be handled appropriately. By contrast,Error::Clientis emitted when the underlying RPC Client implementation has some problem that isn’t user specific (eg network issues or similar).
Enums§
- Error
- This encapsulates any errors that could be emitted in this crate.
Traits§
- Account
Id - A trait which is applied to any type that is a valid Account ID.
- Hash
- A trait which is applied to any type that is a valid block hash.
- Header
- A trait which is applied to any type that is a valid block header.
- RpcConfig
- Configuration used by some of the RPC methods to determine the shape of some of the inputs or responses.