pub trait EthApiServer:
Sized
+ Send
+ Sync
+ 'static {
Show 37 methods
// Required methods
fn protocol_version(&self) -> RpcResult<u64>;
fn syncing<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<SyncStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn author(&self) -> RpcResult<H160>;
fn accounts(&self) -> RpcResult<Vec<H160>>;
fn block_number(&self) -> RpcResult<U256>;
fn chain_id(&self) -> RpcResult<Option<U64>>;
fn block_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
full: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<RichBlock>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn block_by_number<'life0, 'async_trait>(
&'life0 self,
number_or_hash: BlockNumberOrHash,
full: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<RichBlock>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn block_transaction_count_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<U256>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn block_transaction_count_by_number<'life0, 'async_trait>(
&'life0 self,
number_or_hash: BlockNumberOrHash,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<U256>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn block_transaction_receipts<'life0, 'async_trait>(
&'life0 self,
number_or_hash: BlockNumberOrHash,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Vec<Receipt>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn block_uncles_count_by_hash(&self, hash: H256) -> RpcResult<U256>;
fn block_uncles_count_by_number(
&self,
number_or_hash: BlockNumberOrHash,
) -> RpcResult<U256>;
fn uncle_by_block_hash_and_index(
&self,
hash: H256,
index: Index,
) -> RpcResult<Option<RichBlock>>;
fn uncle_by_block_number_and_index(
&self,
number_or_hash: BlockNumberOrHash,
index: Index,
) -> RpcResult<Option<RichBlock>>;
fn transaction_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Transaction>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn transaction_by_block_hash_and_index<'life0, 'async_trait>(
&'life0 self,
hash: H256,
index: Index,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Transaction>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn transaction_by_block_number_and_index<'life0, 'async_trait>(
&'life0 self,
number_or_hash: BlockNumberOrHash,
index: Index,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Transaction>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn transaction_receipt<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Receipt>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn balance<'life0, 'async_trait>(
&'life0 self,
address: H160,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn storage_at<'life0, 'async_trait>(
&'life0 self,
address: H160,
index: U256,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<H256>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn transaction_count<'life0, 'async_trait>(
&'life0 self,
address: H160,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn code_at<'life0, 'async_trait>(
&'life0 self,
address: H160,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn call<'life0, 'async_trait>(
&'life0 self,
request: TransactionRequest,
number_or_hash: Option<BlockNumberOrHash>,
state_overrides: Option<BTreeMap<H160, CallStateOverride>>,
) -> Pin<Box<dyn Future<Output = RpcResult<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn estimate_gas<'life0, 'async_trait>(
&'life0 self,
request: TransactionRequest,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn pending_transactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Transaction>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn gas_price(&self) -> RpcResult<U256>;
fn fee_history<'life0, 'async_trait>(
&'life0 self,
block_count: BlockCount,
newest_block: BlockNumberOrHash,
reward_percentiles: Option<Vec<f64>>,
) -> Pin<Box<dyn Future<Output = RpcResult<FeeHistory>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn max_priority_fee_per_gas(&self) -> RpcResult<U256>;
fn is_mining(&self) -> RpcResult<bool>;
fn hashrate(&self) -> RpcResult<U256>;
fn work(&self) -> RpcResult<Work>;
fn submit_hashrate(&self, hashrate: U256, id: H256) -> RpcResult<bool>;
fn submit_work(
&self,
nonce: H64,
pow_hash: H256,
mix_digest: H256,
) -> RpcResult<bool>;
fn send_transaction<'life0, 'async_trait>(
&'life0 self,
request: TransactionRequest,
) -> Pin<Box<dyn Future<Output = RpcResult<H256>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_raw_transaction<'life0, 'async_trait>(
&'life0 self,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = RpcResult<H256>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description
Server trait implementation for the EthApi
RPC API.
Required Methods§
Sourcefn protocol_version(&self) -> RpcResult<u64>
fn protocol_version(&self) -> RpcResult<u64>
Returns protocol version encoded as a string (quotes are necessary).
Sourcefn syncing<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<SyncStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn syncing<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<SyncStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns an object with data about the sync status or false. (wtf?)
Returns block author.
Sourcefn block_number(&self) -> RpcResult<U256>
fn block_number(&self) -> RpcResult<U256>
Returns highest block number.
Sourcefn chain_id(&self) -> RpcResult<Option<U64>>
fn chain_id(&self) -> RpcResult<Option<U64>>
Returns the chain ID used for transaction signing at the current best block. None is returned if not available.
Sourcefn block_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
full: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<RichBlock>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
full: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<RichBlock>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns block with given hash.
Sourcefn block_by_number<'life0, 'async_trait>(
&'life0 self,
number_or_hash: BlockNumberOrHash,
full: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<RichBlock>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block_by_number<'life0, 'async_trait>(
&'life0 self,
number_or_hash: BlockNumberOrHash,
full: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<RichBlock>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns block with given number.
Sourcefn block_transaction_count_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<U256>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block_transaction_count_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<U256>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the number of transactions in a block with given hash.
Sourcefn block_transaction_count_by_number<'life0, 'async_trait>(
&'life0 self,
number_or_hash: BlockNumberOrHash,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<U256>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block_transaction_count_by_number<'life0, 'async_trait>(
&'life0 self,
number_or_hash: BlockNumberOrHash,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<U256>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the number of transactions in a block with given block number.
Sourcefn block_transaction_receipts<'life0, 'async_trait>(
&'life0 self,
number_or_hash: BlockNumberOrHash,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Vec<Receipt>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block_transaction_receipts<'life0, 'async_trait>(
&'life0 self,
number_or_hash: BlockNumberOrHash,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Vec<Receipt>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the receipts of a block by number or hash.
Sourcefn block_uncles_count_by_hash(&self, hash: H256) -> RpcResult<U256>
fn block_uncles_count_by_hash(&self, hash: H256) -> RpcResult<U256>
Returns the number of uncles in a block with given hash.
Sourcefn block_uncles_count_by_number(
&self,
number_or_hash: BlockNumberOrHash,
) -> RpcResult<U256>
fn block_uncles_count_by_number( &self, number_or_hash: BlockNumberOrHash, ) -> RpcResult<U256>
Returns the number of uncles in a block with given block number.
Sourcefn uncle_by_block_hash_and_index(
&self,
hash: H256,
index: Index,
) -> RpcResult<Option<RichBlock>>
fn uncle_by_block_hash_and_index( &self, hash: H256, index: Index, ) -> RpcResult<Option<RichBlock>>
Returns an uncles at given block and index.
Sourcefn uncle_by_block_number_and_index(
&self,
number_or_hash: BlockNumberOrHash,
index: Index,
) -> RpcResult<Option<RichBlock>>
fn uncle_by_block_number_and_index( &self, number_or_hash: BlockNumberOrHash, index: Index, ) -> RpcResult<Option<RichBlock>>
Returns an uncles at given block and index.
Sourcefn transaction_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transaction_by_hash<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get transaction by its hash.
Sourcefn transaction_by_block_hash_and_index<'life0, 'async_trait>(
&'life0 self,
hash: H256,
index: Index,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transaction_by_block_hash_and_index<'life0, 'async_trait>(
&'life0 self,
hash: H256,
index: Index,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns transaction at given block hash and index.
Sourcefn transaction_by_block_number_and_index<'life0, 'async_trait>(
&'life0 self,
number_or_hash: BlockNumberOrHash,
index: Index,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transaction_by_block_number_and_index<'life0, 'async_trait>(
&'life0 self,
number_or_hash: BlockNumberOrHash,
index: Index,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns transaction by given block number and index.
Sourcefn transaction_receipt<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Receipt>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transaction_receipt<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<Receipt>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns transaction receipt by transaction hash.
Sourcefn balance<'life0, 'async_trait>(
&'life0 self,
address: H160,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn balance<'life0, 'async_trait>(
&'life0 self,
address: H160,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns balance of the given account.
Sourcefn storage_at<'life0, 'async_trait>(
&'life0 self,
address: H160,
index: U256,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<H256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn storage_at<'life0, 'async_trait>(
&'life0 self,
address: H160,
index: U256,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<H256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns content of the storage at given address.
Sourcefn transaction_count<'life0, 'async_trait>(
&'life0 self,
address: H160,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transaction_count<'life0, 'async_trait>(
&'life0 self,
address: H160,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the number of transactions sent from given address at given time (block number).
Sourcefn code_at<'life0, 'async_trait>(
&'life0 self,
address: H160,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn code_at<'life0, 'async_trait>(
&'life0 self,
address: H160,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the code at given address at given time (block number).
Sourcefn call<'life0, 'async_trait>(
&'life0 self,
request: TransactionRequest,
number_or_hash: Option<BlockNumberOrHash>,
state_overrides: Option<BTreeMap<H160, CallStateOverride>>,
) -> Pin<Box<dyn Future<Output = RpcResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn call<'life0, 'async_trait>(
&'life0 self,
request: TransactionRequest,
number_or_hash: Option<BlockNumberOrHash>,
state_overrides: Option<BTreeMap<H160, CallStateOverride>>,
) -> Pin<Box<dyn Future<Output = RpcResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Call contract, returning the output data.
Sourcefn estimate_gas<'life0, 'async_trait>(
&'life0 self,
request: TransactionRequest,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn estimate_gas<'life0, 'async_trait>(
&'life0 self,
request: TransactionRequest,
number_or_hash: Option<BlockNumberOrHash>,
) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Estimate gas needed for execution of given contract.
Sourcefn pending_transactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pending_transactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Transaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns all pending transactions.
Sourcefn fee_history<'life0, 'async_trait>(
&'life0 self,
block_count: BlockCount,
newest_block: BlockNumberOrHash,
reward_percentiles: Option<Vec<f64>>,
) -> Pin<Box<dyn Future<Output = RpcResult<FeeHistory>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fee_history<'life0, 'async_trait>(
&'life0 self,
block_count: BlockCount,
newest_block: BlockNumberOrHash,
reward_percentiles: Option<Vec<f64>>,
) -> Pin<Box<dyn Future<Output = RpcResult<FeeHistory>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Introduced in EIP-1159 for getting information on the appropriate priority fee to use.
Sourcefn max_priority_fee_per_gas(&self) -> RpcResult<U256>
fn max_priority_fee_per_gas(&self) -> RpcResult<U256>
Introduced in EIP-1159, a Geth-specific and simplified priority fee oracle. Leverages the already existing fee history cache.
Sourcefn hashrate(&self) -> RpcResult<U256>
fn hashrate(&self) -> RpcResult<U256>
Returns the number of hashes per second that the node is mining with.
Sourcefn work(&self) -> RpcResult<Work>
fn work(&self) -> RpcResult<Work>
Returns the hash of the current block, the seedHash, and the boundary condition to be met.
Sourcefn submit_hashrate(&self, hashrate: U256, id: H256) -> RpcResult<bool>
fn submit_hashrate(&self, hashrate: U256, id: H256) -> RpcResult<bool>
Used for submitting mining hashrate.
Sourcefn submit_work(
&self,
nonce: H64,
pow_hash: H256,
mix_digest: H256,
) -> RpcResult<bool>
fn submit_work( &self, nonce: H64, pow_hash: H256, mix_digest: H256, ) -> RpcResult<bool>
Used for submitting a proof-of-work solution.
Sourcefn send_transaction<'life0, 'async_trait>(
&'life0 self,
request: TransactionRequest,
) -> Pin<Box<dyn Future<Output = RpcResult<H256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_transaction<'life0, 'async_trait>(
&'life0 self,
request: TransactionRequest,
) -> Pin<Box<dyn Future<Output = RpcResult<H256>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends transaction; will block waiting for signer to return the transaction hash.
Provided 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.