Skip to main content

EVM

Struct EVM 

Source
pub struct EVM { /* private fields */ }
Expand description

EVM API client (Ethereum JSON-RPC)

Implementations§

Source§

impl EVM

Source

pub fn with_debug(self, debug: bool) -> Self

Enable debug/trace methods (mainnet only)

Source

pub async fn block_number(&self) -> Result<u64>

Get the current block number

Source

pub async fn chain_id(&self) -> Result<u64>

Get the chain ID

Source

pub async fn syncing(&self) -> Result<Value>

Check if the node is syncing

Source

pub async fn gas_price(&self) -> Result<u64>

Get current gas price

Source

pub async fn net_version(&self) -> Result<String>

Get network version

Source

pub async fn web3_client_version(&self) -> Result<String>

Get client version

Source

pub async fn get_balance( &self, address: &str, block: Option<&str>, ) -> Result<String>

Get balance of an address

Source

pub async fn get_transaction_count( &self, address: &str, block: Option<&str>, ) -> Result<u64>

Get transaction count (nonce) of an address

Source

pub async fn get_code( &self, address: &str, block: Option<&str>, ) -> Result<String>

Get code at an address

Source

pub async fn get_storage_at( &self, address: &str, position: &str, block: Option<&str>, ) -> Result<String>

Get storage at a position

Source

pub async fn accounts(&self) -> Result<Vec<String>>

Get list of accounts (usually empty for remote nodes)

Source

pub async fn call(&self, tx: &Value, block: Option<&str>) -> Result<String>

Call a contract (read-only)

Source

pub async fn estimate_gas(&self, tx: &Value) -> Result<u64>

Estimate gas for a transaction

Source

pub async fn send_raw_transaction(&self, signed_tx: &str) -> Result<String>

Send a raw (signed) transaction

Source

pub async fn get_transaction_by_hash(&self, tx_hash: &str) -> Result<Value>

Get transaction by hash

Source

pub async fn get_transaction_receipt(&self, tx_hash: &str) -> Result<Value>

Get transaction receipt

Source

pub async fn get_block_by_number( &self, block_number: &str, full_transactions: bool, ) -> Result<Value>

Get block by number

Source

pub async fn get_block_by_hash( &self, block_hash: &str, full_transactions: bool, ) -> Result<Value>

Get block by hash

Source

pub async fn get_logs(&self, filter: &Value) -> Result<Value>

Get logs matching a filter

Source

pub async fn fee_history( &self, block_count: u64, newest_block: &str, reward_percentiles: Option<&[f64]>, ) -> Result<Value>

Get fee history

Source

pub async fn max_priority_fee_per_gas(&self) -> Result<u64>

Get max priority fee per gas

Source

pub async fn get_block_receipts(&self, block_number: &str) -> Result<Value>

Get block receipts

Source

pub async fn get_block_transaction_count_by_hash( &self, block_hash: &str, ) -> Result<u64>

Get block transaction count by hash

Source

pub async fn get_block_transaction_count_by_number( &self, block_number: &str, ) -> Result<u64>

Get block transaction count by number

Source

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

Source

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

Source

pub async fn debug_trace_transaction( &self, tx_hash: &str, tracer_config: Option<&Value>, ) -> Result<Value>

Debug trace a transaction

Source

pub async fn trace_transaction(&self, tx_hash: &str) -> Result<Value>

Trace a transaction

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more