pub struct Provider { /* private fields */ }
Expand description
Ether network api provider
Implementations§
source§impl Provider
impl Provider
sourcepub async fn eth_block_number(
&mut self
) -> impl Future<Output = Result<U256, Error<String, Value>>>
pub async fn eth_block_number(
&mut self
) -> impl Future<Output = Result<U256, Error<String, Value>>>
Returns the number of most recent block.
sourcepub async fn eth_chain_id(
&mut self
) -> impl Future<Output = Result<U64, Error<String, Value>>>
pub async fn eth_chain_id(
&mut self
) -> impl Future<Output = Result<U64, 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
) -> impl Future<Output = Result<Option<Block>, Error<String, Value>>>where
B: TryInto<H256>,
<B as TryInto<H256>>::Error: Debug + Display,
pub async fn eth_get_block_by_hash<B>(
&mut self,
block_hash: B,
hydrated: bool
) -> impl Future<Output = Result<Option<Block>, Error<String, Value>>>where
B: TryInto<H256>,
<B as TryInto<H256>>::Error: Debug + Display,
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
) -> impl Future<Output = Result<Option<Block>, Error<String, Value>>>where
BT: TryInto<BlockNumberOrTag>,
<BT as TryInto<BlockNumberOrTag>>::Error: Debug + Display,
pub async fn eth_get_block_by_number<BT>(
&mut self,
block_number_or_tag: BT,
hydrated: bool
) -> impl Future<Output = Result<Option<Block>, Error<String, Value>>>where
BT: TryInto<BlockNumberOrTag>,
<BT as TryInto<BlockNumberOrTag>>::Error: Debug + Display,
Returns information about a block by number
sourcepub async fn eth_get_block_transaction_count_by_hash<H>(
&mut self,
hash: H
) -> impl Future<Output = Result<U64, Error<String, Value>>>where
H: TryInto<H256>,
<H as TryInto<H256>>::Error: Debug + Display,
pub async fn eth_get_block_transaction_count_by_hash<H>(
&mut self,
hash: H
) -> impl Future<Output = Result<U64, Error<String, Value>>>where
H: TryInto<H256>,
<H as TryInto<H256>>::Error: Debug + Display,
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
) -> impl Future<Output = Result<U64, Error<String, Value>>>where
H: TryInto<H256>,
<H as TryInto<H256>>::Error: Debug + Display,
pub async fn eth_get_uncle_count_by_block_hash<H>(
&mut self,
hash: H
) -> impl Future<Output = Result<U64, Error<String, Value>>>where
H: TryInto<H256>,
<H as TryInto<H256>>::Error: Debug + Display,
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
) -> impl Future<Output = Result<U64, Error<String, Value>>>where
BT: TryInto<BlockNumberOrTag>,
<BT as TryInto<BlockNumberOrTag>>::Error: Debug + Display,
pub async fn eth_get_uncle_count_by_block_number<BT>(
&mut self,
block_number_or_tag: BT
) -> impl Future<Output = Result<U64, Error<String, Value>>>where
BT: TryInto<BlockNumberOrTag>,
<BT as TryInto<BlockNumberOrTag>>::Error: Debug + Display,
Returns the number of uncles in a block from a block matching the given block hash
sourcepub async fn eth_syncing(
&mut self
) -> impl Future<Output = Result<SyncingStatus, Error<String, Value>>>
pub async fn eth_syncing(
&mut self
) -> impl Future<Output = Result<SyncingStatus, Error<String, Value>>>
Returns an object with data about the sync status or false
sourcepub async fn eth_coinbase(
&mut self
) -> impl Future<Output = Result<H160, Error<String, Value>>>
pub async fn eth_coinbase(
&mut self
) -> impl Future<Output = Result<H160, Error<String, Value>>>
Returns the client coinbase address.
sourcepub async fn eth_accounts(
&mut self
) -> impl Future<Output = Result<Vec<H160, Global>, Error<String, Value>>>
pub async fn eth_accounts(
&mut self
) -> impl Future<Output = Result<Vec<H160, Global>, 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>
) -> impl Future<Output = Result<Bytecode, 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>
) -> impl Future<Output = Result<Bytecode, 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>
) -> impl Future<Output = Result<U256, 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>
) -> impl Future<Output = Result<U256, 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>
) -> impl Future<Output = Result<U256, 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>
) -> impl Future<Output = Result<U256, 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
) -> impl Future<Output = Result<U256, Error<String, Value>>>
pub async fn eth_gas_price(
&mut self
) -> impl Future<Output = Result<U256, Error<String, Value>>>
Returns the current price gas in wei.
sourcepub async fn eth_max_priority_fee_per_gas(
&mut self
) -> impl Future<Output = Result<U256, Error<String, Value>>>
pub async fn eth_max_priority_fee_per_gas(
&mut self
) -> impl Future<Output = Result<U256, 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
) -> impl Future<Output = Result<FeeHistory, Error<String, Value>>>where
N: TryInto<U256>,
<N as TryInto<U256>>::Error: Debug + Display,
BT: TryInto<BlockNumberOrTag>,
<BT as TryInto<BlockNumberOrTag>>::Error: Debug + Display,
RP: AsRef<[f64]>,
pub async fn eth_fee_history<N, BT, RP>(
&mut self,
block_count: N,
newest_block: BT,
reward_percentiles: RP
) -> impl Future<Output = Result<FeeHistory, Error<String, Value>>>where
N: TryInto<U256>,
<N as TryInto<U256>>::Error: Debug + Display,
BT: TryInto<BlockNumberOrTag>,
<BT as TryInto<BlockNumberOrTag>>::Error: Debug + Display,
RP: AsRef<[f64]>,
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
) -> impl Future<Output = Result<U256, Error<String, Value>>>where
F: TryInto<Filter>,
<F as TryInto<Filter>>::Error: Debug + Display,
pub async fn eth_new_filter<F>(
&mut self,
filter: F
) -> impl Future<Output = Result<U256, Error<String, Value>>>where
F: TryInto<Filter>,
<F as TryInto<Filter>>::Error: Debug + Display,
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
) -> impl Future<Output = Result<U256, Error<String, Value>>>
pub async fn eth_new_block_filter(
&mut self
) -> impl Future<Output = Result<U256, 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
) -> impl Future<Output = Result<U256, Error<String, Value>>>
pub async fn eth_new_pending_transaction_filter(
&mut self
) -> impl Future<Output = Result<U256, 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
) -> impl Future<Output = Result<bool, Error<String, Value>>>where
N: TryInto<U256>,
<N as TryInto<U256>>::Error: Debug + Display,
pub async fn eth_uninstall_filter<N>(
&mut self,
id: N
) -> impl Future<Output = Result<bool, Error<String, Value>>>where
N: TryInto<U256>,
<N as TryInto<U256>>::Error: Debug + Display,
Uninstalls a filter with given id
sourcepub async fn eth_get_filter_changes<N>(
&mut self,
id: N
) -> impl Future<Output = Result<FilterEvents, Error<String, Value>>>where
N: TryInto<U256>,
<N as TryInto<U256>>::Error: Debug + Display,
pub async fn eth_get_filter_changes<N>(
&mut self,
id: N
) -> impl Future<Output = Result<FilterEvents, Error<String, Value>>>where
N: TryInto<U256>,
<N as TryInto<U256>>::Error: Debug + Display,
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
) -> impl Future<Output = Result<FilterEvents, Error<String, Value>>>where
N: TryInto<U256>,
<N as TryInto<U256>>::Error: Debug + Display,
pub async fn eth_get_filter_logs<N>(
&mut self,
id: N
) -> impl Future<Output = Result<FilterEvents, Error<String, Value>>>where
N: TryInto<U256>,
<N as TryInto<U256>>::Error: Debug + Display,
Returns any arrays of all logs matching filter with given id
sourcepub async fn eth_get_logs<F>(
&mut self,
filter: F
) -> impl Future<Output = Result<FilterEvents, Error<String, Value>>>where
F: TryInto<Filter>,
<F as TryInto<Filter>>::Error: Debug + Display,
pub async fn eth_get_logs<F>(
&mut self,
filter: F
) -> impl Future<Output = Result<FilterEvents, Error<String, Value>>>where
F: TryInto<Filter>,
<F as TryInto<Filter>>::Error: Debug + Display,
Returns an array of all logs matching filter with filter description
sourcepub async fn eth_sign<A, M>(
&mut self,
address: A,
message: M
) -> impl Future<Output = Result<H520, Error<String, Value>>>where
A: TryInto<H160>,
<A as TryInto<H160>>::Error: Debug + Display,
M: TryInto<Bytecode>,
<M as TryInto<Bytecode>>::Error: Debug + Display,
pub async fn eth_sign<A, M>(
&mut self,
address: A,
message: M
) -> impl Future<Output = Result<H520, Error<String, Value>>>where
A: TryInto<H160>,
<A as TryInto<H160>>::Error: Debug + Display,
M: TryInto<Bytecode>,
<M as TryInto<Bytecode>>::Error: Debug + Display,
Returns an EIP-191 signature over the provided data
sourcepub async fn eth_sign_transaction<T>(
&mut self,
transaction: T
) -> impl Future<Output = Result<Bytecode, Error<String, Value>>>where
T: TryInto<Transaction>,
<T as TryInto<Transaction>>::Error: Debug + Display,
pub async fn eth_sign_transaction<T>(
&mut self,
transaction: T
) -> impl Future<Output = Result<Bytecode, Error<String, Value>>>where
T: TryInto<Transaction>,
<T as TryInto<Transaction>>::Error: Debug + Display,
Returns an RLP encoded transaction signed by the specified account.
sourcepub async fn eth_get_balance<A>(
&mut self,
address: A
) -> impl Future<Output = Result<U256, Error<String, Value>>>where
A: TryInto<H160>,
<A as TryInto<H160>>::Error: Debug + Display,
pub async fn eth_get_balance<A>(
&mut self,
address: A
) -> impl Future<Output = Result<U256, Error<String, Value>>>where
A: TryInto<H160>,
<A as TryInto<H160>>::Error: Debug + Display,
Returns the balance of the account given address.
sourcepub async fn eth_get_transaction_count<A>(
&mut self,
address: A
) -> impl Future<Output = Result<U256, Error<String, Value>>>where
A: TryInto<H160>,
<A as TryInto<H160>>::Error: Debug + Display,
pub async fn eth_get_transaction_count<A>(
&mut self,
address: A
) -> impl Future<Output = Result<U256, Error<String, Value>>>where
A: TryInto<H160>,
<A as TryInto<H160>>::Error: Debug + Display,
Returns the number of transactions sent from an address
sourcepub async fn eth_send_raw_transaction<B>(
&mut self,
raw: B
) -> impl Future<Output = Result<H256, Error<String, Value>>>where
B: TryInto<Bytecode>,
<B as TryInto<Bytecode>>::Error: Debug + Display,
pub async fn eth_send_raw_transaction<B>(
&mut self,
raw: B
) -> impl Future<Output = Result<H256, Error<String, Value>>>where
B: TryInto<Bytecode>,
<B as TryInto<Bytecode>>::Error: Debug + Display,
Submit a raw transaction.