#![allow(missing_docs)]
use super::*;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
#[rpc(server, client)]
pub trait EthRpc {
#[method(name = "eth_accounts")]
async fn accounts(&self) -> RpcResult<Vec<Address>>;
#[method(name = "eth_blockNumber")]
async fn block_number(&self) -> RpcResult<U256>;
#[method(name = "eth_call")]
async fn call(
&self,
transaction: GenericTransaction,
block: Option<BlockNumberOrTagOrHash>,
) -> RpcResult<Bytes>;
#[method(name = "eth_chainId")]
async fn chain_id(&self) -> RpcResult<U256>;
#[method(name = "eth_estimateGas")]
async fn estimate_gas(
&self,
transaction: GenericTransaction,
block: Option<BlockNumberOrTag>,
) -> RpcResult<U256>;
#[method(name = "eth_gasPrice")]
async fn gas_price(&self) -> RpcResult<U256>;
#[method(name = "eth_getBalance")]
async fn get_balance(&self, address: Address, block: BlockNumberOrTagOrHash)
-> RpcResult<U256>;
#[method(name = "eth_getBlockByHash")]
async fn get_block_by_hash(
&self,
block_hash: H256,
hydrated_transactions: bool,
) -> RpcResult<Option<Block>>;
#[method(name = "eth_getBlockByNumber")]
async fn get_block_by_number(
&self,
block: BlockNumberOrTag,
hydrated_transactions: bool,
) -> RpcResult<Option<Block>>;
#[method(name = "eth_getBlockTransactionCountByHash")]
async fn get_block_transaction_count_by_hash(
&self,
block_hash: Option<H256>,
) -> RpcResult<Option<U256>>;
#[method(name = "eth_getBlockTransactionCountByNumber")]
async fn get_block_transaction_count_by_number(
&self,
block: Option<BlockNumberOrTag>,
) -> RpcResult<Option<U256>>;
#[method(name = "eth_getCode")]
async fn get_code(&self, address: Address, block: BlockNumberOrTagOrHash) -> RpcResult<Bytes>;
#[method(name = "eth_getStorageAt")]
async fn get_storage_at(
&self,
address: Address,
storage_slot: U256,
block: BlockNumberOrTagOrHash,
) -> RpcResult<Bytes>;
#[method(name = "eth_getTransactionByBlockHashAndIndex")]
async fn get_transaction_by_block_hash_and_index(
&self,
block_hash: H256,
transaction_index: U256,
) -> RpcResult<Option<TransactionInfo>>;
#[method(name = "eth_getTransactionByBlockNumberAndIndex")]
async fn get_transaction_by_block_number_and_index(
&self,
block: BlockNumberOrTag,
transaction_index: U256,
) -> RpcResult<Option<TransactionInfo>>;
#[method(name = "eth_getTransactionByHash")]
async fn get_transaction_by_hash(
&self,
transaction_hash: H256,
) -> RpcResult<Option<TransactionInfo>>;
#[method(name = "eth_getTransactionCount")]
async fn get_transaction_count(
&self,
address: Address,
block: BlockNumberOrTagOrHash,
) -> RpcResult<U256>;
#[method(name = "eth_getTransactionReceipt")]
async fn get_transaction_receipt(
&self,
transaction_hash: H256,
) -> RpcResult<Option<ReceiptInfo>>;
#[method(name = "eth_sendRawTransaction")]
async fn send_raw_transaction(&self, transaction: Bytes) -> RpcResult<H256>;
#[method(name = "eth_sendTransaction")]
async fn send_transaction(&self, transaction: GenericTransaction) -> RpcResult<H256>;
#[method(name = "eth_syncing")]
async fn syncing(&self) -> RpcResult<SyncingStatus>;
#[method(name = "net_version")]
async fn net_version(&self) -> RpcResult<String>;
}