EthApiServer

Trait EthApiServer 

Source
pub trait EthApiServer:
    Sized
    + Send
    + Sync
    + 'static {
Show 34 methods // Required methods fn protocol_version(&self) -> Result<u64>; fn syncing(&self) -> Result<SyncStatus>; fn hashrate(&self) -> Result<U256>; fn author(&self) -> Result<H160>; fn is_mining(&self) -> Result<bool>; fn chain_id(&self) -> Result<Option<U64>>; fn gas_price(&self) -> Result<U256>; fn accounts(&self) -> Result<Vec<H160>>; fn block_number(&self) -> Result<U256>; fn balance(&self, _: H160, _: Option<BlockNumber>) -> Result<U256>; fn storage_at( &self, _: H160, _: U256, _: Option<BlockNumber>, ) -> Result<H256>; fn block_by_hash(&self, _: H256, _: bool) -> Result<Option<RichBlock>>; fn block_by_number( &self, _: BlockNumber, _: bool, ) -> Result<Option<RichBlock>>; fn transaction_count(&self, _: H160, _: Option<BlockNumber>) -> Result<U256>; fn block_transaction_count_by_hash(&self, _: H256) -> Result<Option<U256>>; fn block_transaction_count_by_number( &self, _: BlockNumber, ) -> Result<Option<U256>>; fn block_uncles_count_by_hash(&self, _: H256) -> Result<U256>; fn block_uncles_count_by_number(&self, _: BlockNumber) -> Result<U256>; fn code_at(&self, _: H160, _: Option<BlockNumber>) -> Result<Bytes>; fn send_transaction(&self, _: TransactionRequest) -> BoxFuture<H256>; fn send_raw_transaction(&self, _: Bytes) -> BoxFuture<H256>; fn call(&self, _: CallRequest, _: Option<BlockNumber>) -> Result<Bytes>; fn estimate_gas( &self, _: CallRequest, _: Option<BlockNumber>, ) -> Result<U256>; fn transaction_by_hash(&self, _: H256) -> Result<Option<Transaction>>; fn transaction_by_block_hash_and_index( &self, _: H256, _: Index, ) -> Result<Option<Transaction>>; fn transaction_by_block_number_and_index( &self, _: BlockNumber, _: Index, ) -> Result<Option<Transaction>>; fn transaction_receipt(&self, _: H256) -> Result<Option<Receipt>>; fn uncle_by_block_hash_and_index( &self, _: H256, _: Index, ) -> Result<Option<RichBlock>>; fn uncle_by_block_number_and_index( &self, _: BlockNumber, _: Index, ) -> Result<Option<RichBlock>>; fn logs(&self, _: Filter) -> Result<Vec<Log>>; fn work(&self) -> Result<Work>; fn submit_work(&self, _: H64, _: H256, _: H256) -> Result<bool>; fn submit_hashrate(&self, _: U256, _: H256) -> Result<bool>; // Provided method fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M> { ... }
}
Expand description

Eth rpc interface.

Required Methods§

Source

fn protocol_version(&self) -> Result<u64>

Returns protocol version encoded as a string (quotes are necessary).

Source

fn syncing(&self) -> Result<SyncStatus>

Returns an object with data about the sync status or false. (wtf?)

Source

fn hashrate(&self) -> Result<U256>

Returns the number of hashes per second that the node is mining with.

Source

fn author(&self) -> Result<H160>

Returns block author.

Source

fn is_mining(&self) -> Result<bool>

Returns true if client is actively mining new blocks.

Source

fn chain_id(&self) -> Result<Option<U64>>

Returns the chain ID used for transaction signing at the current best block. None is returned if not available.

Source

fn gas_price(&self) -> Result<U256>

Returns current gas_price.

Source

fn accounts(&self) -> Result<Vec<H160>>

Returns accounts list.

Source

fn block_number(&self) -> Result<U256>

Returns highest block number.

Source

fn balance(&self, _: H160, _: Option<BlockNumber>) -> Result<U256>

Returns balance of the given account.

Source

fn storage_at(&self, _: H160, _: U256, _: Option<BlockNumber>) -> Result<H256>

Returns content of the storage at given address.

Source

fn block_by_hash(&self, _: H256, _: bool) -> Result<Option<RichBlock>>

Returns block with given hash.

Source

fn block_by_number(&self, _: BlockNumber, _: bool) -> Result<Option<RichBlock>>

Returns block with given number.

Source

fn transaction_count(&self, _: H160, _: Option<BlockNumber>) -> Result<U256>

Returns the number of transactions sent from given address at given time (block number).

Source

fn block_transaction_count_by_hash(&self, _: H256) -> Result<Option<U256>>

Returns the number of transactions in a block with given hash.

Source

fn block_transaction_count_by_number( &self, _: BlockNumber, ) -> Result<Option<U256>>

Returns the number of transactions in a block with given block number.

Source

fn block_uncles_count_by_hash(&self, _: H256) -> Result<U256>

Returns the number of uncles in a block with given hash.

Source

fn block_uncles_count_by_number(&self, _: BlockNumber) -> Result<U256>

Returns the number of uncles in a block with given block number.

Source

fn code_at(&self, _: H160, _: Option<BlockNumber>) -> Result<Bytes>

Returns the code at given address at given time (block number).

Source

fn send_transaction(&self, _: TransactionRequest) -> BoxFuture<H256>

Sends transaction; will block waiting for signer to return the transaction hash.

Source

fn send_raw_transaction(&self, _: Bytes) -> BoxFuture<H256>

Sends signed transaction, returning its hash.

Source

fn call(&self, _: CallRequest, _: Option<BlockNumber>) -> Result<Bytes>

Call contract, returning the output data.

Source

fn estimate_gas(&self, _: CallRequest, _: Option<BlockNumber>) -> Result<U256>

Estimate gas needed for execution of given contract.

Source

fn transaction_by_hash(&self, _: H256) -> Result<Option<Transaction>>

Get transaction by its hash.

Source

fn transaction_by_block_hash_and_index( &self, _: H256, _: Index, ) -> Result<Option<Transaction>>

Returns transaction at given block hash and index.

Source

fn transaction_by_block_number_and_index( &self, _: BlockNumber, _: Index, ) -> Result<Option<Transaction>>

Returns transaction by given block number and index.

Source

fn transaction_receipt(&self, _: H256) -> Result<Option<Receipt>>

Returns transaction receipt by transaction hash.

Source

fn uncle_by_block_hash_and_index( &self, _: H256, _: Index, ) -> Result<Option<RichBlock>>

Returns an uncles at given block and index.

Source

fn uncle_by_block_number_and_index( &self, _: BlockNumber, _: Index, ) -> Result<Option<RichBlock>>

Returns an uncles at given block and index.

Source

fn logs(&self, _: Filter) -> Result<Vec<Log>>

Returns logs matching given filter object.

Source

fn work(&self) -> Result<Work>

Returns the hash of the current block, the seedHash, and the boundary condition to be met.

Source

fn submit_work(&self, _: H64, _: H256, _: H256) -> Result<bool>

Used for submitting a proof-of-work solution.

Source

fn submit_hashrate(&self, _: U256, _: H256) -> Result<bool>

Used for submitting mining hashrate.

Provided Methods§

Source

fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M>

Create an IoDelegate, wiring rpc calls to the trait methods.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§