ic_web3_rs::api

Struct Eth

Source
pub struct Eth<T> { /* private fields */ }
Expand description

Eth namespace

Implementations§

Source§

impl<T: Transport> Eth<T>

Source

pub fn accounts(&self, options: CallOptions) -> CallFuture<Vec<Address>, T::Out>

Get list of available accounts.

Source

pub fn block_number(&self, options: CallOptions) -> CallFuture<U64, T::Out>

Get current block number

Source

pub fn call( &self, req: CallRequest, block: Option<BlockId>, options: CallOptions, ) -> CallFuture<Bytes, T::Out>

Call a constant method of contract without changing the state of the blockchain.

Source

pub fn coinbase(&self, options: CallOptions) -> CallFuture<Address, T::Out>

Get coinbase address

Source

pub fn compile_lll( &self, code: String, options: CallOptions, ) -> CallFuture<Bytes, T::Out>

Compile LLL

Source

pub fn compile_solidity( &self, code: String, options: CallOptions, ) -> CallFuture<Bytes, T::Out>

Compile Solidity

Source

pub fn compile_serpent( &self, code: String, options: CallOptions, ) -> CallFuture<Bytes, T::Out>

Compile Serpent

Source

pub fn estimate_gas( &self, req: CallRequest, block: Option<BlockNumber>, options: CallOptions, ) -> CallFuture<U256, T::Out>

Call a contract without changing the state of the blockchain to estimate gas usage.

Source

pub fn max_priority_fee_per_gas( &self, options: CallOptions, ) -> CallFuture<U256, T::Out>

Source

pub fn gas_price(&self, options: CallOptions) -> CallFuture<U256, T::Out>

Get current recommended gas price

Source

pub fn fee_history( &self, block_count: U256, newest_block: BlockNumber, reward_percentiles: Option<Vec<f64>>, options: CallOptions, ) -> CallFuture<FeeHistory, T::Out>

Returns a collection of historical gas information. This can be used for evaluating the max_fee_per_gas and max_priority_fee_per_gas to send the future transactions.

Source

pub fn balance( &self, address: Address, block: Option<BlockNumber>, options: CallOptions, ) -> CallFuture<U256, T::Out>

Get balance of given address

Source

pub fn logs( &self, filter: Filter, options: CallOptions, ) -> CallFuture<Vec<Log>, T::Out>

Get all logs matching a given filter object

Source

pub fn block( &self, block: BlockId, options: CallOptions, ) -> CallFuture<Option<Block<H256>>, T::Out>

Get block details with transaction hashes.

Source

pub fn block_with_txs( &self, block: BlockId, options: CallOptions, ) -> CallFuture<Option<Block<Transaction>>, T::Out>

Get block details with full transaction objects.

Source

pub fn block_transaction_count( &self, block: BlockId, options: CallOptions, ) -> CallFuture<Option<U256>, T::Out>

Get number of transactions in block

Source

pub fn code( &self, address: Address, block: Option<BlockNumber>, options: CallOptions, ) -> CallFuture<Bytes, T::Out>

Get code under given address

Source

pub fn compilers(&self, options: CallOptions) -> CallFuture<Vec<String>, T::Out>

Get supported compilers

Source

pub fn chain_id(&self, options: CallOptions) -> CallFuture<U256, T::Out>

Get chain id

Source

pub fn request_accounts( &self, options: CallOptions, ) -> CallFuture<Vec<Address>, T::Out>

Get available user accounts. This method is only available in the browser. With MetaMask, this will cause the popup that prompts the user to allow or deny access to their accounts to your app.

Source

pub fn storage( &self, address: Address, idx: U256, block: Option<BlockNumber>, options: CallOptions, ) -> CallFuture<H256, T::Out>

Get storage entry

Source

pub fn transaction_count( &self, address: Address, block: Option<BlockNumber>, options: CallOptions, ) -> CallFuture<U256, T::Out>

Get nonce

Source

pub fn transaction( &self, id: TransactionId, options: CallOptions, ) -> CallFuture<Option<Transaction>, T::Out>

Get transaction

Source

pub fn transaction_receipt( &self, hash: H256, options: CallOptions, ) -> CallFuture<Option<TransactionReceipt>, T::Out>

Get transaction receipt

Source

pub fn uncle_header( &self, block: BlockId, index: Index, options: CallOptions, ) -> CallFuture<Option<BlockHeader>, T::Out>

Get uncle header by block ID and uncle index.

This method is meant for TurboGeth compatiblity, which is missing transaction hashes in the response.

Source

pub fn uncle( &self, block: BlockId, index: Index, options: CallOptions, ) -> CallFuture<Option<Block<H256>>, T::Out>

Get uncle by block ID and uncle index – transactions only has hashes.

Source

pub fn uncle_count( &self, block: BlockId, options: CallOptions, ) -> CallFuture<Option<U256>, T::Out>

Get uncle count in block

Source

pub fn work(&self, options: CallOptions) -> CallFuture<Work, T::Out>

Get work package

Source

pub fn hashrate(&self, options: CallOptions) -> CallFuture<U256, T::Out>

Get hash rate

Source

pub fn mining(&self, options: CallOptions) -> CallFuture<bool, T::Out>

Get mining status

Source

pub fn new_block_filter(&self, options: CallOptions) -> CallFuture<U256, T::Out>

Start new block filter

Source

pub fn new_pending_transaction_filter( &self, options: CallOptions, ) -> CallFuture<U256, T::Out>

Start new pending transaction filter

Source

pub fn protocol_version( &self, options: CallOptions, ) -> CallFuture<String, T::Out>

Start new pending transaction filter

Source

pub fn send_raw_transaction( &self, rlp: Bytes, options: CallOptions, ) -> CallFuture<H256, T::Out>

Sends a rlp-encoded signed transaction

Source

pub fn send_transaction( &self, tx: TransactionRequest, options: CallOptions, ) -> CallFuture<H256, T::Out>

Sends a transaction transaction

Source

pub fn sign( &self, address: Address, data: Bytes, options: CallOptions, ) -> CallFuture<H520, T::Out>

Signs a hash of given data

Source

pub fn submit_hashrate( &self, rate: U256, id: H256, options: CallOptions, ) -> CallFuture<bool, T::Out>

Submit hashrate of external miner

Source

pub fn submit_work( &self, nonce: H64, pow_hash: H256, mix_hash: H256, options: CallOptions, ) -> CallFuture<bool, T::Out>

Submit work of external miner

Source

pub fn syncing(&self, options: CallOptions) -> CallFuture<SyncState, T::Out>

Get syncing status

Source

pub fn proof( &self, address: Address, keys: Vec<U256>, block: Option<BlockNumber>, options: CallOptions, ) -> CallFuture<Option<Proof>, T::Out>

Returns the account- and storage-values of the specified account including the Merkle-proof.

Trait Implementations§

Source§

impl<T: Clone> Clone for Eth<T>

Source§

fn clone(&self) -> Eth<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Eth<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Transport> Namespace<T> for Eth<T>

Source§

fn new(transport: T) -> Self
where Self: Sized,

Creates new API namespace
Source§

fn transport(&self) -> &T

Borrows a transport.

Auto Trait Implementations§

§

impl<T> Freeze for Eth<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Eth<T>
where T: RefUnwindSafe,

§

impl<T> Send for Eth<T>
where T: Send,

§

impl<T> Sync for Eth<T>
where T: Sync,

§

impl<T> Unpin for Eth<T>
where T: Unpin,

§

impl<T> UnwindSafe for Eth<T>
where T: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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