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§
- layers
- Module for housing transport layers.
- mock
- Mock transport and utility types.
- utils
- Misc. utilities for building transports.
Macros§
- impl_
future - Macro that return an
impl Future
type, with aSend
bound on non-wasm targets.
Structs§
- BoxTransport
- A boxed, Clone-able
Transport
trait object. - Dual
Transport - A transport that dispatches requests to one of two inner transports based on a handler.
- Http
Error - Type for holding HTTP errors such as 429 rate limit error.
Enums§
- Authorization
- Basic, bearer or raw authentication in http or websocket transport.
- RpcError
- An RPC error.
Traits§
- Dual
Transport Handler - Trait that determines how to dispatch a request given two transports.
- Into
BoxTransport - Trait for converting a transport into a boxed transport.
- Transport
- A
Transport
manages the JSON-RPC request/response lifecycle. - Transport
Connect - Connection details for a transport.
Type Aliases§
- BoxFuture
- Type alias for a pin-boxed future, with a
Send
bound on non-wasm targets. - Pbf
- Pin-boxed future.
- RpcFut
- Future for RPC-level requests.
- RpcResult
- The result of a JSON-RPC request.
- Transport
Error - A transport error is an
RpcError
containing a [TransportErrorKind
]. - Transport
Fut - Future for transport-level requests.
- Transport
Result - A transport result is a
Result
containing aTransportError
.