pub struct EVM { /* private fields */ }Expand description
EVM API client (Ethereum JSON-RPC)
Implementations§
Source§impl EVM
impl EVM
Sourcepub fn with_debug(self, debug: bool) -> Self
pub fn with_debug(self, debug: bool) -> Self
Enable debug/trace methods (mainnet only)
Sourcepub async fn block_number(&self) -> Result<u64>
pub async fn block_number(&self) -> Result<u64>
Get the current block number
Sourcepub async fn net_version(&self) -> Result<String>
pub async fn net_version(&self) -> Result<String>
Get network version
Sourcepub async fn web3_client_version(&self) -> Result<String>
pub async fn web3_client_version(&self) -> Result<String>
Get client version
Sourcepub async fn get_balance(
&self,
address: &str,
block: Option<&str>,
) -> Result<String>
pub async fn get_balance( &self, address: &str, block: Option<&str>, ) -> Result<String>
Get balance of an address
Sourcepub async fn get_transaction_count(
&self,
address: &str,
block: Option<&str>,
) -> Result<u64>
pub async fn get_transaction_count( &self, address: &str, block: Option<&str>, ) -> Result<u64>
Get transaction count (nonce) of an address
Sourcepub async fn get_code(
&self,
address: &str,
block: Option<&str>,
) -> Result<String>
pub async fn get_code( &self, address: &str, block: Option<&str>, ) -> Result<String>
Get code at an address
Sourcepub async fn get_storage_at(
&self,
address: &str,
position: &str,
block: Option<&str>,
) -> Result<String>
pub async fn get_storage_at( &self, address: &str, position: &str, block: Option<&str>, ) -> Result<String>
Get storage at a position
Sourcepub async fn accounts(&self) -> Result<Vec<String>>
pub async fn accounts(&self) -> Result<Vec<String>>
Get list of accounts (usually empty for remote nodes)
Sourcepub async fn call(&self, tx: &Value, block: Option<&str>) -> Result<String>
pub async fn call(&self, tx: &Value, block: Option<&str>) -> Result<String>
Call a contract (read-only)
Sourcepub async fn estimate_gas(&self, tx: &Value) -> Result<u64>
pub async fn estimate_gas(&self, tx: &Value) -> Result<u64>
Estimate gas for a transaction
Sourcepub async fn send_raw_transaction(&self, signed_tx: &str) -> Result<String>
pub async fn send_raw_transaction(&self, signed_tx: &str) -> Result<String>
Send a raw (signed) transaction
Sourcepub async fn get_transaction_by_hash(&self, tx_hash: &str) -> Result<Value>
pub async fn get_transaction_by_hash(&self, tx_hash: &str) -> Result<Value>
Get transaction by hash
Sourcepub async fn get_transaction_receipt(&self, tx_hash: &str) -> Result<Value>
pub async fn get_transaction_receipt(&self, tx_hash: &str) -> Result<Value>
Get transaction receipt
Sourcepub async fn get_block_by_number(
&self,
block_number: &str,
full_transactions: bool,
) -> Result<Value>
pub async fn get_block_by_number( &self, block_number: &str, full_transactions: bool, ) -> Result<Value>
Get block by number
Sourcepub async fn get_block_by_hash(
&self,
block_hash: &str,
full_transactions: bool,
) -> Result<Value>
pub async fn get_block_by_hash( &self, block_hash: &str, full_transactions: bool, ) -> Result<Value>
Get block by hash
Sourcepub async fn fee_history(
&self,
block_count: u64,
newest_block: &str,
reward_percentiles: Option<&[f64]>,
) -> Result<Value>
pub async fn fee_history( &self, block_count: u64, newest_block: &str, reward_percentiles: Option<&[f64]>, ) -> Result<Value>
Get fee history
Sourcepub async fn max_priority_fee_per_gas(&self) -> Result<u64>
pub async fn max_priority_fee_per_gas(&self) -> Result<u64>
Get max priority fee per gas
Sourcepub async fn get_block_receipts(&self, block_number: &str) -> Result<Value>
pub async fn get_block_receipts(&self, block_number: &str) -> Result<Value>
Get block receipts
Sourcepub async fn get_block_transaction_count_by_hash(
&self,
block_hash: &str,
) -> Result<u64>
pub async fn get_block_transaction_count_by_hash( &self, block_hash: &str, ) -> Result<u64>
Get block transaction count by hash
Sourcepub async fn get_block_transaction_count_by_number(
&self,
block_number: &str,
) -> Result<u64>
pub async fn get_block_transaction_count_by_number( &self, block_number: &str, ) -> Result<u64>
Get block transaction count by number
Sourcepub async fn get_transaction_by_block_hash_and_index(
&self,
block_hash: &str,
index: u64,
) -> Result<Value>
pub async fn get_transaction_by_block_hash_and_index( &self, block_hash: &str, index: u64, ) -> Result<Value>
Get transaction by block hash and index
Sourcepub async fn get_transaction_by_block_number_and_index(
&self,
block_number: &str,
index: u64,
) -> Result<Value>
pub async fn get_transaction_by_block_number_and_index( &self, block_number: &str, index: u64, ) -> Result<Value>
Get transaction by block number and index
Sourcepub async fn debug_trace_transaction(
&self,
tx_hash: &str,
tracer_config: Option<&Value>,
) -> Result<Value>
pub async fn debug_trace_transaction( &self, tx_hash: &str, tracer_config: Option<&Value>, ) -> Result<Value>
Debug trace a transaction
Sourcepub async fn trace_transaction(&self, tx_hash: &str) -> Result<Value>
pub async fn trace_transaction(&self, tx_hash: &str) -> Result<Value>
Trace a transaction
Sourcepub async fn trace_block(&self, block_number: &str) -> Result<Value>
pub async fn trace_block(&self, block_number: &str) -> Result<Value>
Trace a block
Auto Trait Implementations§
impl Freeze for EVM
impl !RefUnwindSafe for EVM
impl Send for EVM
impl Sync for EVM
impl Unpin for EVM
impl UnsafeUnpin for EVM
impl !UnwindSafe for EVM
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request