ethers_middleware/
lib.rs

1#![doc = include_str!("../README.md")]
2#![deny(unsafe_code, rustdoc::broken_intra_doc_links)]
3#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
4
5/// The [Gas Escalator middleware](crate::gas_escalator::GasEscalatorMiddleware)
6/// is used to re-broadcast transactions with an increasing gas price to guarantee
7/// their timely inclusion.
8pub mod gas_escalator;
9pub use gas_escalator::GasEscalatorMiddleware;
10
11/// The gas oracle middleware is used to get the gas price from a list of gas oracles instead of
12/// using `eth_gasPrice`. For usage examples, refer to the [`GasOracle`] trait.
13pub mod gas_oracle;
14pub use gas_oracle::GasOracle;
15
16/// The [Nonce Manager](crate::NonceManagerMiddleware) is used to locally calculate nonces instead
17/// of using eth_getTransactionCount
18pub mod nonce_manager;
19pub use nonce_manager::NonceManagerMiddleware;
20
21/// The [TransformerMiddleware] is used to intercept transactions
22/// and transform them to be sent via various supported transformers, e.g.,
23/// [DSProxy](crate::transformer::DsProxy).
24pub mod transformer;
25pub use transformer::TransformerMiddleware;
26
27/// The [SignerMiddleware] is used to locally sign transactions and messages instead of using
28/// `eth_sendTransaction` and `eth_sign`.
29pub mod signer;
30pub use signer::SignerMiddleware;
31
32/// The [Policy] is used to ensure transactions comply with the rules configured in the
33/// [`PolicyMiddleware`] before sending them.
34pub mod policy;
35pub use policy::{
36    AllowEverything, Policy, PolicyMiddleware, PolicyMiddlewareError, RejectEverything,
37};
38
39/// The [TimeLag] middleware provides safety against reorgs by querying state N blocks before the
40/// chain tip.
41pub mod timelag;
42pub use timelag::TimeLag;
43
44/// [MiddlewareBuilder] provides a way to compose many [`Middleware`]s in a concise way.
45pub mod builder;
46pub use builder::MiddlewareBuilder;
47
48pub use ethers_providers::{Middleware, MiddlewareError};
49
50// For macro expansions only, not public API.
51// See: [#2235](https://github.com/gakonst/ethers-rs/pull/2235)
52
53#[doc(hidden)]
54#[allow(unused_extern_crates)]
55extern crate self as ethers;
56
57#[doc(hidden)]
58pub use ethers_contract as contract;
59
60#[doc(hidden)]
61pub use ethers_core as core;
62
63#[doc(hidden)]
64pub use ethers_providers as providers;