Expand description
§alloy-transport
Low-level Ethereum JSON-RPC transport abstraction.
This crate handles RPC connection and request management. It builds an
RpcClient
on top of the tower Service
abstraction, and provides
futures for simple and batch RPC requests as well as a unified TransportError
type.
Typically, this crate should not be used directly. Most EVM users will want to use the alloy-provider crate, which provides a high-level API for interacting with JSON-RPC servers that provide the standard Ethereum RPC endpoints, or the [alloy-rpc-client] crate, which provides a low-level JSON-RPC API without the specific Ethereum endpoints.
§Transports
Alloy maintains the following transports:
- alloy-transport-http: JSON-RPC via HTTP.
- alloy-transport-ws: JSON-RPC via Websocket, supports pubsub via alloy-pubsub.
- alloy-transport-ipc: JSON-RPC via IPC, supports pubsub via alloy-pubsub.
Modules§
- Module for housing transport layers.
- Misc. utilities for building transports.
Macros§
- Macro that return an
impl Future
type, with aSend
bound on non-wasm targets.
Structs§
- A boxed, Clone-able
Transport
trait object. - Type for holding HTTP errors such as 429 rate limit error.
Enums§
- Basic, bearer or raw authentication in http or websocket transport.
- An RPC error.
Traits§
- Connection details for a transport that can be boxed.
- A
Transport
manages the JSON-RPC request/response lifecycle. - Connection details for a transport.
Type Aliases§
- Type alias for a pin-boxed future, with a
Send
bound on non-wasm targets. - Pin-boxed future.
- Future for RPC-level requests.
- The result of a JSON-RPC request.
- A transport error is an
RpcError
containing a [TransportErrorKind
]. - Future for transport-level requests.
- A transport result is a
Result
containing aTransportError
.