Crate alloy_transport

Source
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:

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 a Send bound on non-wasm targets.

Structs§

BoxTransport
A boxed, Clone-able Transport trait object.
DualTransport
A transport that dispatches requests to one of two inner transports based on a handler.
HttpError
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§

DualTransportHandler
Trait that determines how to dispatch a request given two transports.
IntoBoxTransport
Trait for converting a transport into a boxed transport.
Transport
A Transport manages the JSON-RPC request/response lifecycle.
TransportConnect
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.
TransportError
A transport error is an RpcError containing a [TransportErrorKind].
TransportFut
Future for transport-level requests.
TransportResult
A transport result is a Result containing a TransportError.