Trait fc_rpc_core::EthApi[][src]

pub trait EthApi: Sized + Send + Sync + 'static {
    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>; fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M> { ... } }

Eth rpc interface.

Required methods

fn protocol_version(&self) -> Result<u64>[src]

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

fn syncing(&self) -> Result<SyncStatus>[src]

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

fn hashrate(&self) -> Result<U256>[src]

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

fn author(&self) -> Result<H160>[src]

Returns block author.

fn is_mining(&self) -> Result<bool>[src]

Returns true if client is actively mining new blocks.

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

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

fn gas_price(&self) -> Result<U256>[src]

Returns current gas_price.

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

Returns accounts list.

fn block_number(&self) -> Result<U256>[src]

Returns highest block number.

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

Returns balance of the given account.

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

Returns content of the storage at given address.

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

Returns block with given hash.

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

Returns block with given number.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sends signed transaction, returning its hash.

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

Call contract, returning the output data.

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

Estimate gas needed for execution of given contract.

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

Get transaction by its hash.

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

Returns transaction at given block hash and index.

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

Returns transaction by given block number and index.

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

Returns transaction receipt by transaction hash.

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

Returns an uncles at given block and index.

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

Returns an uncles at given block and index.

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

Returns logs matching given filter object.

fn work(&self) -> Result<Work>[src]

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

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

Used for submitting a proof-of-work solution.

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

Used for submitting mining hashrate.

Loading content...

Provided methods

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

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

Loading content...

Implementors

Loading content...