pub struct Provider { /* private fields */ }
Expand description
Ether network api provider
Implementations§
Source§impl Provider
impl Provider
pub fn register_filter_listener<A, T>(
&self,
address: Option<A>,
topic_filter: Option<T>,
) -> Result<FilterReceiver<Timeout>, Error>where
A: TryInto<AddressFilter>,
<A as TryInto<AddressFilter>>::Error: Error + Sync + Send + 'static,
T: TryInto<TopicFilter>,
<T as TryInto<TopicFilter>>::Error: Error + Sync + Send + 'static,
pub fn register_transaction_listener<H>( &self, tx_hash: H, ) -> Result<TransactionReceipter<Timeout>, Error>
Source§impl Provider
impl Provider
Sourcepub async fn eth_block_number(
&mut self,
) -> Result<Uint<256>, Error<String, Value>>
pub async fn eth_block_number( &mut self, ) -> Result<Uint<256>, Error<String, Value>>
Returns the number of most recent block.
Sourcepub async fn eth_chain_id(&mut self) -> Result<Uint<64>, Error<String, Value>>
pub async fn eth_chain_id(&mut self) -> Result<Uint<64>, Error<String, Value>>
Returns the chain ID of the current network
Sourcepub async fn eth_get_block_by_hash<B>(
&mut self,
block_hash: B,
hydrated: bool,
) -> Result<Option<Block>, Error<String, Value>>
pub async fn eth_get_block_by_hash<B>( &mut self, block_hash: B, hydrated: bool, ) -> Result<Option<Block>, Error<String, Value>>
Returns information about a block by hash.
Sourcepub async fn eth_get_block_by_number<BT>(
&mut self,
block_number_or_tag: BT,
hydrated: bool,
) -> Result<Option<Block>, Error<String, Value>>
pub async fn eth_get_block_by_number<BT>( &mut self, block_number_or_tag: BT, hydrated: bool, ) -> Result<Option<Block>, Error<String, Value>>
Returns information about a block by number
Sourcepub async fn eth_get_block_transaction_count_by_hash<H>(
&mut self,
hash: H,
) -> Result<Uint<64>, Error<String, Value>>
pub async fn eth_get_block_transaction_count_by_hash<H>( &mut self, hash: H, ) -> Result<Uint<64>, Error<String, Value>>
Returns the number of transactions in a block from a block matching the given block hash
Sourcepub async fn eth_get_uncle_count_by_block_hash<H>(
&mut self,
hash: H,
) -> Result<Uint<64>, Error<String, Value>>
pub async fn eth_get_uncle_count_by_block_hash<H>( &mut self, hash: H, ) -> Result<Uint<64>, Error<String, Value>>
Returns the number of uncles in a block from a block matching the given block hash
Sourcepub async fn eth_get_uncle_count_by_block_number<BT>(
&mut self,
block_number_or_tag: BT,
) -> Result<Uint<64>, Error<String, Value>>
pub async fn eth_get_uncle_count_by_block_number<BT>( &mut self, block_number_or_tag: BT, ) -> Result<Uint<64>, Error<String, Value>>
Returns the number of uncles in a block from a block matching the given block hash
Sourcepub async fn eth_syncing(
&mut self,
) -> Result<SyncingStatus, Error<String, Value>>
pub async fn eth_syncing( &mut self, ) -> Result<SyncingStatus, Error<String, Value>>
Returns an object with data about the sync status or false
Sourcepub async fn eth_coinbase(&mut self) -> Result<Address, Error<String, Value>>
pub async fn eth_coinbase(&mut self) -> Result<Address, Error<String, Value>>
Returns the client coinbase address.
Sourcepub async fn eth_accounts(
&mut self,
) -> Result<Vec<Address>, Error<String, Value>>
pub async fn eth_accounts( &mut self, ) -> Result<Vec<Address>, Error<String, Value>>
Returns a list of addresses owned by client.
Sourcepub async fn eth_call<TX, BT>(
&mut self,
transaction: TX,
block_number_or_tag: Option<BT>,
) -> Result<Bytes, Error<String, Value>>where
TX: TryInto<TypedTransactionRequest>,
<TX as TryInto<TypedTransactionRequest>>::Error: Debug + Display,
BT: TryInto<BlockNumberOrTag>,
<BT as TryInto<BlockNumberOrTag>>::Error: Debug + Display,
pub async fn eth_call<TX, BT>(
&mut self,
transaction: TX,
block_number_or_tag: Option<BT>,
) -> Result<Bytes, Error<String, Value>>where
TX: TryInto<TypedTransactionRequest>,
<TX as TryInto<TypedTransactionRequest>>::Error: Debug + Display,
BT: TryInto<BlockNumberOrTag>,
<BT as TryInto<BlockNumberOrTag>>::Error: Debug + Display,
Executes a new message call immediately without creating a transaction on the block chain.
Sourcepub async fn eth_estimate_gas<TX, BT>(
&mut self,
transaction: TX,
block_number_or_tag: Option<BT>,
) -> Result<Uint<256>, Error<String, Value>>where
TX: TryInto<TypedTransactionRequest>,
<TX as TryInto<TypedTransactionRequest>>::Error: Debug + Display,
BT: TryInto<BlockNumberOrTag>,
<BT as TryInto<BlockNumberOrTag>>::Error: Debug + Display,
pub async fn eth_estimate_gas<TX, BT>(
&mut self,
transaction: TX,
block_number_or_tag: Option<BT>,
) -> Result<Uint<256>, Error<String, Value>>where
TX: TryInto<TypedTransactionRequest>,
<TX as TryInto<TypedTransactionRequest>>::Error: Debug + Display,
BT: TryInto<BlockNumberOrTag>,
<BT as TryInto<BlockNumberOrTag>>::Error: Debug + Display,
Generates and returns an estimate of how much gas is necessary to allow the transaction to complete.
Sourcepub async fn eth_create_accesslist<TX, BT>(
&mut self,
transaction: TX,
block_number_or_tag: Option<BT>,
) -> Result<Uint<256>, Error<String, Value>>where
TX: TryInto<Transaction>,
<TX as TryInto<Transaction>>::Error: Debug + Display,
BT: TryInto<BlockNumberOrTag>,
<BT as TryInto<BlockNumberOrTag>>::Error: Debug + Display,
pub async fn eth_create_accesslist<TX, BT>(
&mut self,
transaction: TX,
block_number_or_tag: Option<BT>,
) -> Result<Uint<256>, Error<String, Value>>where
TX: TryInto<Transaction>,
<TX as TryInto<Transaction>>::Error: Debug + Display,
BT: TryInto<BlockNumberOrTag>,
<BT as TryInto<BlockNumberOrTag>>::Error: Debug + Display,
Generates an access list for a transaction
Sourcepub async fn eth_gas_price(&mut self) -> Result<Uint<256>, Error<String, Value>>
pub async fn eth_gas_price(&mut self) -> Result<Uint<256>, Error<String, Value>>
Returns the current price gas in wei.
Sourcepub async fn eth_max_priority_fee_per_gas(
&mut self,
) -> Result<Uint<256>, Error<String, Value>>
pub async fn eth_max_priority_fee_per_gas( &mut self, ) -> Result<Uint<256>, Error<String, Value>>
Returns the current maxPriorityFeePerGas per gas in wei.
Sourcepub async fn eth_fee_history<N, BT, RP>(
&mut self,
block_count: N,
newest_block: BT,
reward_percentiles: RP,
) -> Result<FeeHistory, Error<String, Value>>
pub async fn eth_fee_history<N, BT, RP>( &mut self, block_count: N, newest_block: BT, reward_percentiles: RP, ) -> Result<FeeHistory, Error<String, Value>>
Returns transaction base fee per gas and effective priority fee per gas for the requested/supported block range.
Sourcepub async fn eth_new_filter<F>(
&mut self,
filter: F,
) -> Result<Uint<256>, Error<String, Value>>
pub async fn eth_new_filter<F>( &mut self, filter: F, ) -> Result<Uint<256>, Error<String, Value>>
Returns transaction base fee per gas and effective priority fee per gas for the requested/supported block range.
Sourcepub async fn eth_new_block_filter(
&mut self,
) -> Result<Uint<256>, Error<String, Value>>
pub async fn eth_new_block_filter( &mut self, ) -> Result<Uint<256>, Error<String, Value>>
Creates new filter in the node,to notify when a new block arrives.
Sourcepub async fn eth_new_pending_transaction_filter(
&mut self,
) -> Result<Uint<256>, Error<String, Value>>
pub async fn eth_new_pending_transaction_filter( &mut self, ) -> Result<Uint<256>, Error<String, Value>>
Creates new filter in the node,to notify when new pending transactions arrive.
Sourcepub async fn eth_uninstall_filter<N>(
&mut self,
id: N,
) -> Result<bool, Error<String, Value>>
pub async fn eth_uninstall_filter<N>( &mut self, id: N, ) -> Result<bool, Error<String, Value>>
Uninstalls a filter with given id
Sourcepub async fn eth_get_filter_changes<N>(
&mut self,
id: N,
) -> Result<Option<FilterEvents>, Error<String, Value>>
pub async fn eth_get_filter_changes<N>( &mut self, id: N, ) -> Result<Option<FilterEvents>, Error<String, Value>>
Polling method for a filter, which returns an arrya of logs which occurred since last poll
Sourcepub async fn eth_get_filter_logs<N>(
&mut self,
id: N,
) -> Result<FilterEvents, Error<String, Value>>
pub async fn eth_get_filter_logs<N>( &mut self, id: N, ) -> Result<FilterEvents, Error<String, Value>>
Returns any arrays of all logs matching filter with given id
Sourcepub async fn eth_get_logs<F>(
&mut self,
filter: F,
) -> Result<FilterEvents, Error<String, Value>>
pub async fn eth_get_logs<F>( &mut self, filter: F, ) -> Result<FilterEvents, Error<String, Value>>
Returns an array of all logs matching filter with filter description
Sourcepub async fn eth_sign<A, M>(
&mut self,
address: A,
message: M,
) -> Result<Eip1559Signature, Error<String, Value>>
pub async fn eth_sign<A, M>( &mut self, address: A, message: M, ) -> Result<Eip1559Signature, Error<String, Value>>
Returns an EIP-191 signature over the provided data
Sourcepub async fn eth_sign_transaction<T>(
&mut self,
transaction: T,
) -> Result<Bytes, Error<String, Value>>
pub async fn eth_sign_transaction<T>( &mut self, transaction: T, ) -> Result<Bytes, Error<String, Value>>
Returns an RLP encoded transaction signed by the specified account.
Sourcepub async fn eth_get_balance<A>(
&mut self,
address: A,
) -> Result<Uint<256>, Error<String, Value>>
pub async fn eth_get_balance<A>( &mut self, address: A, ) -> Result<Uint<256>, Error<String, Value>>
Returns the balance of the account given address.
Sourcepub async fn eth_get_transaction_count<A>(
&mut self,
address: A,
) -> Result<Uint<256>, Error<String, Value>>
pub async fn eth_get_transaction_count<A>( &mut self, address: A, ) -> Result<Uint<256>, Error<String, Value>>
Returns the number of transactions sent from an address
Sourcepub async fn eth_send_raw_transaction<B>(
&mut self,
raw: B,
) -> Result<BytesM<32>, Error<String, Value>>
pub async fn eth_send_raw_transaction<B>( &mut self, raw: B, ) -> Result<BytesM<32>, Error<String, Value>>
Submit a raw transaction.
pub async fn eth_get_transaction_by_hash<H>( &mut self, tx_hash: H, ) -> Result<Option<Transaction>, Error<String, Value>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Provider
impl !RefUnwindSafe for Provider
impl Send for Provider
impl Sync for Provider
impl Unpin for Provider
impl !UnwindSafe for Provider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more