Trait fc_rpc::EthApiServer[][src]

pub trait EthApiServer: 'static + Send + Sync {
    pub fn protocol_version(&self) -> Result<u64, Error>;
pub fn syncing(&self) -> Result<SyncStatus, Error>;
pub fn hashrate(&self) -> Result<U256, Error>;
pub fn author(&self) -> Result<H160, Error>;
pub fn is_mining(&self) -> Result<bool, Error>;
pub fn chain_id(&self) -> Result<Option<U64>, Error>;
pub fn gas_price(&self) -> Result<U256, Error>;
pub fn accounts(&self) -> Result<Vec<H160, Global>, Error>;
pub fn block_number(&self) -> Result<U256, Error>;
pub fn balance(&self, H160, Option<BlockNumber>) -> Result<U256, Error>;
pub fn storage_at(
        &self,
        H160,
        U256,
        Option<BlockNumber>
    ) -> Result<H256, Error>;
pub fn block_by_hash(
        &self,
        H256,
        bool
    ) -> Result<Option<Rich<Block>>, Error>;
pub fn block_by_number(
        &self,
        BlockNumber,
        bool
    ) -> Result<Option<Rich<Block>>, Error>;
pub fn transaction_count(
        &self,
        H160,
        Option<BlockNumber>
    ) -> Result<U256, Error>;
pub fn block_transaction_count_by_hash(
        &self,
        H256
    ) -> Result<Option<U256>, Error>;
pub fn block_transaction_count_by_number(
        &self,
        BlockNumber
    ) -> Result<Option<U256>, Error>;
pub fn block_uncles_count_by_hash(&self, H256) -> Result<U256, Error>;
pub fn block_uncles_count_by_number(
        &self,
        BlockNumber
    ) -> Result<U256, Error>;
pub fn code_at(&self, H160, Option<BlockNumber>) -> Result<Bytes, Error>;
pub fn send_transaction(
        &self,
        TransactionRequest
    ) -> Box<dyn Future<Item = H256, Error = Error> + 'static + Send, Global>;
pub fn send_raw_transaction(
        &self,
        Bytes
    ) -> Box<dyn Future<Item = H256, Error = Error> + 'static + Send, Global>;
pub fn call(&self, CallRequest, Option<BlockNumber>) -> Result<Bytes, Error>;
pub fn estimate_gas(
        &self,
        CallRequest,
        Option<BlockNumber>
    ) -> Result<U256, Error>;
pub fn transaction_by_hash(
        &self,
        H256
    ) -> Result<Option<Transaction>, Error>;
pub fn transaction_by_block_hash_and_index(
        &self,
        H256,
        Index
    ) -> Result<Option<Transaction>, Error>;
pub fn transaction_by_block_number_and_index(
        &self,
        BlockNumber,
        Index
    ) -> Result<Option<Transaction>, Error>;
pub fn transaction_receipt(&self, H256) -> Result<Option<Receipt>, Error>;
pub fn uncle_by_block_hash_and_index(
        &self,
        H256,
        Index
    ) -> Result<Option<Rich<Block>>, Error>;
pub fn uncle_by_block_number_and_index(
        &self,
        BlockNumber,
        Index
    ) -> Result<Option<Rich<Block>>, Error>;
pub fn logs(&self, Filter) -> Result<Vec<Log, Global>, Error>;
pub fn work(&self) -> Result<Work, Error>;
pub fn submit_work(&self, H64, H256, H256) -> Result<bool, Error>;
pub fn submit_hashrate(&self, U256, H256) -> Result<bool, Error>; pub fn to_delegate<M>(self) -> IoDelegate<Self, M>
    where
        M: Metadata
, { ... } }

Eth rpc interface.

Required methods

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

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

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

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

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

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

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

Returns block author.

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

Returns true if client is actively mining new blocks.

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

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

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

Returns current gas_price.

pub fn accounts(&self) -> Result<Vec<H160, Global>, Error>[src]

Returns accounts list.

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

Returns highest block number.

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

Returns balance of the given account.

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

Returns content of the storage at given address.

pub fn block_by_hash(&self, H256, bool) -> Result<Option<Rich<Block>>, Error>[src]

Returns block with given hash.

pub fn block_by_number(
    &self,
    BlockNumber,
    bool
) -> Result<Option<Rich<Block>>, Error>
[src]

Returns block with given number.

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

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

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

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

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

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

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

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

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

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

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

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

pub fn send_transaction(
    &self,
    TransactionRequest
) -> Box<dyn Future<Item = H256, Error = Error> + 'static + Send, Global>
[src]

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

pub fn send_raw_transaction(
    &self,
    Bytes
) -> Box<dyn Future<Item = H256, Error = Error> + 'static + Send, Global>
[src]

Sends signed transaction, returning its hash.

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

Call contract, returning the output data.

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

Estimate gas needed for execution of given contract.

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

Get transaction by its hash.

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

Returns transaction at given block hash and index.

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

Returns transaction by given block number and index.

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

Returns transaction receipt by transaction hash.

pub fn uncle_by_block_hash_and_index(
    &self,
    H256,
    Index
) -> Result<Option<Rich<Block>>, Error>
[src]

Returns an uncles at given block and index.

pub fn uncle_by_block_number_and_index(
    &self,
    BlockNumber,
    Index
) -> Result<Option<Rich<Block>>, Error>
[src]

Returns an uncles at given block and index.

pub fn logs(&self, Filter) -> Result<Vec<Log, Global>, Error>[src]

Returns logs matching given filter object.

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

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

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

Used for submitting a proof-of-work solution.

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

Used for submitting mining hashrate.

Loading content...

Provided methods

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

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

Loading content...

Implementors

impl<B, C, P, CT, BE, H: ExHashT> EthApi for EthApi<B, C, P, CT, BE, H> where
    C: ProvideRuntimeApi<B> + StorageProvider<B, BE> + AuxStore,
    C: HeaderBackend<B> + HeaderMetadata<B, Error = BlockChainError> + 'static,
    C::Api: EthereumRuntimeRPCApi<B>,
    BE: Backend<B> + 'static,
    BE::State: StateBackend<BlakeTwo256>,
    B: BlockT<Hash = H256> + Send + Sync + 'static,
    C: Send + Sync + 'static,
    P: TransactionPool<Block = B> + Send + Sync + 'static,
    CT: ConvertTransaction<<B as BlockT>::Extrinsic> + Send + Sync + 'static, 
[src]

Loading content...