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§
Sourcefn protocol_version(&self) -> Result<u64>
fn protocol_version(&self) -> Result<u64>
Returns protocol version encoded as a string (quotes are necessary).
Sourcefn syncing(&self) -> Result<SyncStatus>
fn syncing(&self) -> Result<SyncStatus>
Returns an object with data about the sync status or false. (wtf?)
Sourcefn hashrate(&self) -> Result<U256>
fn hashrate(&self) -> Result<U256>
Returns the number of hashes per second that the node is mining with.
Returns block author.
Sourcefn chain_id(&self) -> Result<Option<U64>>
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.
Sourcefn block_number(&self) -> Result<U256>
fn block_number(&self) -> Result<U256>
Returns highest block number.
Sourcefn balance(&self, _: H160, _: Option<BlockNumber>) -> Result<U256>
fn balance(&self, _: H160, _: Option<BlockNumber>) -> Result<U256>
Returns balance of the given account.
Sourcefn storage_at(&self, _: H160, _: U256, _: Option<BlockNumber>) -> Result<H256>
fn storage_at(&self, _: H160, _: U256, _: Option<BlockNumber>) -> Result<H256>
Returns content of the storage at given address.
Sourcefn block_by_hash(&self, _: H256, _: bool) -> Result<Option<RichBlock>>
fn block_by_hash(&self, _: H256, _: bool) -> Result<Option<RichBlock>>
Returns block with given hash.
Sourcefn block_by_number(&self, _: BlockNumber, _: bool) -> Result<Option<RichBlock>>
fn block_by_number(&self, _: BlockNumber, _: bool) -> Result<Option<RichBlock>>
Returns block with given number.
Sourcefn transaction_count(&self, _: H160, _: Option<BlockNumber>) -> Result<U256>
fn transaction_count(&self, _: H160, _: Option<BlockNumber>) -> Result<U256>
Returns the number of transactions sent from given address at given time (block number).
Sourcefn block_transaction_count_by_hash(&self, _: H256) -> Result<Option<U256>>
fn block_transaction_count_by_hash(&self, _: H256) -> Result<Option<U256>>
Returns the number of transactions in a block with given hash.
Sourcefn block_transaction_count_by_number(
&self,
_: BlockNumber,
) -> Result<Option<U256>>
fn block_transaction_count_by_number( &self, _: BlockNumber, ) -> Result<Option<U256>>
Returns the number of transactions in a block with given block number.
Sourcefn block_uncles_count_by_hash(&self, _: H256) -> Result<U256>
fn block_uncles_count_by_hash(&self, _: H256) -> Result<U256>
Returns the number of uncles in a block with given hash.
Sourcefn block_uncles_count_by_number(&self, _: BlockNumber) -> Result<U256>
fn block_uncles_count_by_number(&self, _: BlockNumber) -> Result<U256>
Returns the number of uncles in a block with given block number.
Sourcefn code_at(&self, _: H160, _: Option<BlockNumber>) -> Result<Bytes>
fn code_at(&self, _: H160, _: Option<BlockNumber>) -> Result<Bytes>
Returns the code at given address at given time (block number).
Sourcefn send_transaction(&self, _: TransactionRequest) -> BoxFuture<H256>
fn send_transaction(&self, _: TransactionRequest) -> BoxFuture<H256>
Sends transaction; will block waiting for signer to return the transaction hash.
Sourcefn send_raw_transaction(&self, _: Bytes) -> BoxFuture<H256>
fn send_raw_transaction(&self, _: Bytes) -> BoxFuture<H256>
Sends signed transaction, returning its hash.
Sourcefn call(&self, _: CallRequest, _: Option<BlockNumber>) -> Result<Bytes>
fn call(&self, _: CallRequest, _: Option<BlockNumber>) -> Result<Bytes>
Call contract, returning the output data.
Sourcefn estimate_gas(&self, _: CallRequest, _: Option<BlockNumber>) -> Result<U256>
fn estimate_gas(&self, _: CallRequest, _: Option<BlockNumber>) -> Result<U256>
Estimate gas needed for execution of given contract.
Sourcefn transaction_by_hash(&self, _: H256) -> Result<Option<Transaction>>
fn transaction_by_hash(&self, _: H256) -> Result<Option<Transaction>>
Get transaction by its hash.
Sourcefn transaction_by_block_hash_and_index(
&self,
_: H256,
_: Index,
) -> Result<Option<Transaction>>
fn transaction_by_block_hash_and_index( &self, _: H256, _: Index, ) -> Result<Option<Transaction>>
Returns transaction at given block hash and index.
Sourcefn transaction_by_block_number_and_index(
&self,
_: BlockNumber,
_: Index,
) -> Result<Option<Transaction>>
fn transaction_by_block_number_and_index( &self, _: BlockNumber, _: Index, ) -> Result<Option<Transaction>>
Returns transaction by given block number and index.
Sourcefn transaction_receipt(&self, _: H256) -> Result<Option<Receipt>>
fn transaction_receipt(&self, _: H256) -> Result<Option<Receipt>>
Returns transaction receipt by transaction hash.
Sourcefn uncle_by_block_hash_and_index(
&self,
_: H256,
_: Index,
) -> Result<Option<RichBlock>>
fn uncle_by_block_hash_and_index( &self, _: H256, _: Index, ) -> Result<Option<RichBlock>>
Returns an uncles at given block and index.
Sourcefn uncle_by_block_number_and_index(
&self,
_: BlockNumber,
_: Index,
) -> Result<Option<RichBlock>>
fn uncle_by_block_number_and_index( &self, _: BlockNumber, _: Index, ) -> Result<Option<RichBlock>>
Returns an uncles at given block and index.
Sourcefn work(&self) -> Result<Work>
fn work(&self) -> Result<Work>
Returns the hash of the current block, the seedHash, and the boundary condition to be met.
Provided Methods§
Sourcefn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M>
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.