# Struct ethcore_rpc::v1::EthClient [−] [src]

    pub struct EthClient<C, SN: ?Sized, S: ?Sized, M, EM> where C: MiningBlockChainClient, SN: SnapshotService, S: SyncProvider, M: MinerService, EM: ExternalMinerService { /* fields omitted */ }

Eth rpc implementation.

## Methods

### `impl<C, SN: ?Sized, S: ?Sized, M, EM> EthClient<C, SN, S, M, EM> where C: MiningBlockChainClient, SN: SnapshotService, S: SyncProvider, M: MinerService, EM: ExternalMinerService`
[src]

#### `fn new(client: &Arc<C>,
snapshot: &Arc<SN>,
sync: &Arc<S>,
accounts: &Arc<AccountProvider>,
miner: &Arc<M>,
em: &Arc<EM>,
options: EthClientOptions)
-> Self`

Creates new EthClient.

## Trait Implementations

### `impl<C, SN: ?Sized, S: ?Sized, M, EM> Eth for EthClient<C, SN, S, M, EM> where C: MiningBlockChainClient + 'static, SN: SnapshotService + 'static, S: SyncProvider + 'static, M: MinerService + 'static, EM: ExternalMinerService + 'static`
[src]

#### `type Metadata = Metadata`

Requests metadata

#### `fn protocol_version(&self) -> Result<String, Error>`

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

#### `fn syncing(&self) -> Result<SyncStatus, Error>`

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

#### `fn author(&self, meta: Metadata) -> BoxFuture<RpcH160, Error>`

Returns block author.

#### `fn is_mining(&self) -> Result<bool, Error>`

Returns true if client is actively mining new blocks.

#### `fn hashrate(&self) -> Result<RpcU256, Error>`

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

#### `fn gas_price(&self) -> Result<RpcU256, Error>`

Returns current gas_price.

#### `fn accounts(&self, meta: Metadata) -> BoxFuture<Vec<RpcH160>, Error>`

Returns accounts list.

#### `fn block_number(&self) -> Result<RpcU256, Error>`

Returns highest block number.

#### `fn balance(&self,
address: RpcH160,
num: Trailing<BlockNumber>)
-> Result<RpcU256, Error>`

Returns balance of the given account.

#### `fn storage_at(&self,
address: RpcH160,
pos: RpcU256,
num: Trailing<BlockNumber>)
-> Result<RpcH256, Error>`

Returns content of the storage at given address.

#### `fn transaction_count(&self,
address: RpcH160,
num: Trailing<BlockNumber>)
-> Result<RpcU256, Error>`

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

#### `fn block_transaction_count_by_hash(&self,
hash: RpcH256)
-> Result<Option<RpcU256>, Error>`

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

#### `fn block_transaction_count_by_number(&self,
num: BlockNumber)
-> Result<Option<RpcU256>, Error>`

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

#### `fn block_uncles_count_by_hash(&self,
hash: RpcH256)
-> Result<Option<RpcU256>, Error>`

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

#### `fn block_uncles_count_by_number(&self,
num: BlockNumber)
-> Result<Option<RpcU256>, Error>`

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

#### `fn code_at(&self,
address: RpcH160,
num: Trailing<BlockNumber>)
-> Result<Bytes, Error>`

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

#### `fn block_by_hash(&self,
hash: RpcH256,
include_txs: bool)
-> Result<Option<RichBlock>, Error>`

Returns block with given hash.

#### `fn block_by_number(&self,
num: BlockNumber,
include_txs: bool)
-> Result<Option<RichBlock>, Error>`

Returns block with given number.

#### `fn transaction_by_hash(&self,
hash: RpcH256)
-> Result<Option<Transaction>, Error>`

Get transaction by its hash.

#### `fn transaction_by_block_hash_and_index(&self,
hash: RpcH256,
index: Index)
-> Result<Option<Transaction>, Error>`

Returns transaction at given block hash and index.

#### `fn transaction_by_block_number_and_index(&self,
num: BlockNumber,
index: Index)
-> Result<Option<Transaction>, Error>`

Returns transaction by given block number and index.

#### `fn transaction_receipt(&self, hash: RpcH256) -> Result<Option<Receipt>, Error>`

Returns transaction receipt.

#### `fn uncle_by_block_hash_and_index(&self,
hash: RpcH256,
index: Index)
-> Result<Option<RichBlock>, Error>`

Returns an uncles at given block and index.

#### `fn uncle_by_block_number_and_index(&self,
num: BlockNumber,
index: Index)
-> Result<Option<RichBlock>, Error>`

Returns an uncles at given block and index.

#### `fn compilers(&self) -> Result<Vec<String>, Error>`

Returns available compilers.

#### `fn logs(&self, filter: Filter) -> Result<Vec<Log>, Error>`

Returns logs matching given filter object.

#### `fn work(&self, no_new_work_timeout: Trailing<u64>) -> Result<Work, Error>`

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

#### `fn submit_work(&self,
nonce: RpcH64,
pow_hash: RpcH256,
mix_hash: RpcH256)
-> Result<bool, Error>`

Used for submitting a proof-of-work solution.

#### `fn submit_hashrate(&self, rate: RpcU256, id: RpcH256) -> Result<bool, Error>`

Used for submitting mining hashrate.

#### `fn send_raw_transaction(&self, raw: Bytes) -> Result<RpcH256, Error>`

Sends signed transaction, returning its hash.

#### `fn submit_transaction(&self, raw: Bytes) -> Result<RpcH256, Error>`

Alias of `eth_sendRawTransaction`.

#### `fn call(&self,
request: CallRequest,
num: Trailing<BlockNumber>)
-> Result<Bytes, Error>`

Call contract, returning the output data.

#### `fn estimate_gas(&self,
request: CallRequest,
num: Trailing<BlockNumber>)
-> Result<RpcU256, Error>`

Estimate gas needed for execution of given contract.

#### `fn compile_lll(&self, _: String) -> Result<Bytes, Error>`

Compiles lll code.

#### `fn compile_serpent(&self, _: String) -> Result<Bytes, Error>`

Compiles serpent.

#### `fn compile_solidity(&self, code: String) -> Result<Bytes, Error>`

Compiles solidity.

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

Transform this into an `IoDelegate`, automatically wrapping the parameters. Read more

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)