Struct ethers_middleware::gas_oracle::EthGasStation
source · pub struct EthGasStation { /* private fields */ }Expand description
A client over HTTP for the EthGasStation gas tracker API
that implements the GasOracle trait
Implementations
sourceimpl EthGasStation
impl EthGasStation
sourcepub fn new(api_key: Option<&str>) -> Self
pub fn new(api_key: Option<&str>) -> Self
Creates a new EthGasStation gas oracle
sourcepub fn with_client(client: Client, api_key: Option<&str>) -> Self
pub fn with_client(client: Client, api_key: Option<&str>) -> Self
sourcepub fn category(self, gas_category: GasCategory) -> Self
pub fn category(self, gas_category: GasCategory) -> Self
Sets the gas price category to be used when fetching the gas price.
pub async fn query(&self) -> Result<EthGasStationResponse, GasOracleError>
Trait Implementations
sourceimpl Clone for EthGasStation
impl Clone for EthGasStation
sourcefn clone(&self) -> EthGasStation
fn clone(&self) -> EthGasStation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for EthGasStation
impl Debug for EthGasStation
sourceimpl Default for EthGasStation
impl Default for EthGasStation
sourceimpl GasOracle for EthGasStation
impl GasOracle for EthGasStation
sourcefn fetch<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<U256, GasOracleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn fetch<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<U256, GasOracleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Makes an asynchronous HTTP query to the underlying
GasOracle Read morefn estimate_eip1559_fees<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(U256, U256), GasOracleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations
impl !RefUnwindSafe for EthGasStation
impl Send for EthGasStation
impl Sync for EthGasStation
impl Unpin for EthGasStation
impl !UnwindSafe for EthGasStation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more