pub trait OtterscanServer<T, H>:
Sized
+ Send
+ Sync
+ 'staticwhere
T: RpcObject,
H: RpcObject,{
Show 14 methods
// Required methods
fn get_header_by_number(
&self,
block_number: LenientBlockNumberOrTag,
) -> impl Future<Output = Result<Option<H>, ErrorObject<'static>>> + Send;
fn has_code(
&self,
address: Address,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<bool, ErrorObject<'static>>> + Send;
fn get_api_level(
&self,
) -> impl Future<Output = Result<u64, ErrorObject<'static>>> + Send;
fn get_internal_operations(
&self,
tx_hash: FixedBytes<32>,
) -> impl Future<Output = Result<Vec<InternalOperation>, ErrorObject<'static>>> + Send;
fn get_transaction_error(
&self,
tx_hash: FixedBytes<32>,
) -> impl Future<Output = Result<Option<Bytes>, ErrorObject<'static>>> + Send;
fn trace_transaction(
&self,
tx_hash: FixedBytes<32>,
) -> impl Future<Output = Result<Option<Vec<TraceEntry>>, ErrorObject<'static>>> + Send;
fn get_block_details(
&self,
block_number: LenientBlockNumberOrTag,
) -> impl Future<Output = Result<BlockDetails<H>, ErrorObject<'static>>> + Send;
fn get_block_details_by_hash(
&self,
block_hash: FixedBytes<32>,
) -> impl Future<Output = Result<BlockDetails<H>, ErrorObject<'static>>> + Send;
fn get_block_transactions(
&self,
block_number: LenientBlockNumberOrTag,
page_number: usize,
page_size: usize,
) -> impl Future<Output = Result<OtsBlockTransactions<T, H>, ErrorObject<'static>>> + Send;
fn search_transactions_before(
&self,
address: Address,
block_number: LenientBlockNumberOrTag,
page_size: usize,
) -> impl Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send;
fn search_transactions_after(
&self,
address: Address,
block_number: LenientBlockNumberOrTag,
page_size: usize,
) -> impl Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send;
fn get_transaction_by_sender_and_nonce(
&self,
sender: Address,
nonce: u64,
) -> impl Future<Output = Result<Option<FixedBytes<32>>, ErrorObject<'static>>> + Send;
fn get_contract_creator(
&self,
address: Address,
) -> impl Future<Output = Result<Option<ContractCreator>, ErrorObject<'static>>> + Send;
// Provided method
fn into_rpc(self) -> RpcModule<Self>
where T: Send + Sync + 'static + Clone + Serialize,
H: Send + Sync + 'static + Clone + Serialize { ... }
}Expand description
Server trait implementation for the Otterscan RPC API.
Required Methods§
Sourcefn get_header_by_number(
&self,
block_number: LenientBlockNumberOrTag,
) -> impl Future<Output = Result<Option<H>, ErrorObject<'static>>> + Send
fn get_header_by_number( &self, block_number: LenientBlockNumberOrTag, ) -> impl Future<Output = Result<Option<H>, ErrorObject<'static>>> + Send
Get the block header by block number, required by otterscan. Otterscan currently requires this endpoint, used as:
- check if the node is Erigon or not
- get block header instead of the full block
Sourcefn has_code(
&self,
address: Address,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<bool, ErrorObject<'static>>> + Send
fn has_code( &self, address: Address, block_id: Option<BlockId>, ) -> impl Future<Output = Result<bool, ErrorObject<'static>>> + Send
Check if a certain address contains a deployed code.
Sourcefn get_api_level(
&self,
) -> impl Future<Output = Result<u64, ErrorObject<'static>>> + Send
fn get_api_level( &self, ) -> impl Future<Output = Result<u64, ErrorObject<'static>>> + Send
Returns API level 8 for frontend compatibility, not a guarantee of complete support. In particular, both address history search methods remain unimplemented.
Sourcefn get_internal_operations(
&self,
tx_hash: FixedBytes<32>,
) -> impl Future<Output = Result<Vec<InternalOperation>, ErrorObject<'static>>> + Send
fn get_internal_operations( &self, tx_hash: FixedBytes<32>, ) -> impl Future<Output = Result<Vec<InternalOperation>, ErrorObject<'static>>> + Send
Return the internal ETH transfers inside a transaction.
Sourcefn get_transaction_error(
&self,
tx_hash: FixedBytes<32>,
) -> impl Future<Output = Result<Option<Bytes>, ErrorObject<'static>>> + Send
fn get_transaction_error( &self, tx_hash: FixedBytes<32>, ) -> impl Future<Output = Result<Option<Bytes>, ErrorObject<'static>>> + Send
Given a transaction hash, returns its raw revert reason.
Known transactions without revert data return empty bytes; unknown transactions return
None.
Sourcefn trace_transaction(
&self,
tx_hash: FixedBytes<32>,
) -> impl Future<Output = Result<Option<Vec<TraceEntry>>, ErrorObject<'static>>> + Send
fn trace_transaction( &self, tx_hash: FixedBytes<32>, ) -> impl Future<Output = Result<Option<Vec<TraceEntry>>, ErrorObject<'static>>> + Send
Extract all variations of calls, contract creation and self-destructs and returns a call tree.
Sourcefn get_block_details(
&self,
block_number: LenientBlockNumberOrTag,
) -> impl Future<Output = Result<BlockDetails<H>, ErrorObject<'static>>> + Send
fn get_block_details( &self, block_number: LenientBlockNumberOrTag, ) -> impl Future<Output = Result<BlockDetails<H>, ErrorObject<'static>>> + Send
Tailor-made and expanded version of eth_getBlockByNumber for block details page in
Otterscan.
Sourcefn get_block_details_by_hash(
&self,
block_hash: FixedBytes<32>,
) -> impl Future<Output = Result<BlockDetails<H>, ErrorObject<'static>>> + Send
fn get_block_details_by_hash( &self, block_hash: FixedBytes<32>, ) -> impl Future<Output = Result<BlockDetails<H>, ErrorObject<'static>>> + Send
Tailor-made and expanded version of eth_getBlockByHash for block details page in
Otterscan.
Sourcefn get_block_transactions(
&self,
block_number: LenientBlockNumberOrTag,
page_number: usize,
page_size: usize,
) -> impl Future<Output = Result<OtsBlockTransactions<T, H>, ErrorObject<'static>>> + Send
fn get_block_transactions( &self, block_number: LenientBlockNumberOrTag, page_number: usize, page_size: usize, ) -> impl Future<Output = Result<OtsBlockTransactions<T, H>, ErrorObject<'static>>> + Send
Get paginated transactions for a certain block. Also remove some verbose fields like logs. Page zero selects the block’s last transactions; each page retains ascending block order.
Sourcefn search_transactions_before(
&self,
address: Address,
block_number: LenientBlockNumberOrTag,
page_size: usize,
) -> impl Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send
fn search_transactions_before( &self, address: Address, block_number: LenientBlockNumberOrTag, page_size: usize, ) -> impl Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send
Gets paginated inbound/outbound transaction calls for a certain address.
Unimplemented: returns JSON-RPC error -32603 with message “unimplemented”. See https://github.com/paradigmxyz/reth/issues/13499.
Sourcefn search_transactions_after(
&self,
address: Address,
block_number: LenientBlockNumberOrTag,
page_size: usize,
) -> impl Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send
fn search_transactions_after( &self, address: Address, block_number: LenientBlockNumberOrTag, page_size: usize, ) -> impl Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send
Gets paginated inbound/outbound transaction calls for a certain address.
Unimplemented: returns JSON-RPC error -32603 with message “unimplemented”. See https://github.com/paradigmxyz/reth/issues/13499.
Sourcefn get_transaction_by_sender_and_nonce(
&self,
sender: Address,
nonce: u64,
) -> impl Future<Output = Result<Option<FixedBytes<32>>, ErrorObject<'static>>> + Send
fn get_transaction_by_sender_and_nonce( &self, sender: Address, nonce: u64, ) -> impl Future<Output = Result<Option<FixedBytes<32>>, ErrorObject<'static>>> + Send
Gets the transaction hash for a certain sender address, given its nonce.
Sourcefn get_contract_creator(
&self,
address: Address,
) -> impl Future<Output = Result<Option<ContractCreator>, ErrorObject<'static>>> + Send
fn get_contract_creator( &self, address: Address, ) -> impl Future<Output = Result<Option<ContractCreator>, ErrorObject<'static>>> + Send
Gets the transaction hash and the address who created a contract. Requires historical state. Code-presence binary search is unreliable for destroyed and redeployed contracts, and cannot identify genesis allocations or EIP-7702 delegations.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<Eth> OtterscanServer<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::TransactionResponse, <<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header> for OtterscanApi<Eth>where
Eth: EthApiServer<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::TransactionRequest, <<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::TransactionResponse, Block<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::TransactionResponse, <<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header>, <<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Receipt, <<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header, <<Eth as RpcNodeCore>::Primitives as NodePrimitives>::SignedTx> + EthTransactions + TraceExt,
impl<Eth> OtterscanServer<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::TransactionResponse, <<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header> for OtterscanApi<Eth>where
Eth: EthApiServer<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::TransactionRequest, <<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::TransactionResponse, Block<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::TransactionResponse, <<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header>, <<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Receipt, <<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header, <<Eth as RpcNodeCore>::Primitives as NodePrimitives>::SignedTx> + EthTransactions + TraceExt,
Source§async fn get_header_by_number(
&self,
block_number: LenientBlockNumberOrTag,
) -> Result<Option<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header>, ErrorObject<'static>>
async fn get_header_by_number( &self, block_number: LenientBlockNumberOrTag, ) -> Result<Option<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header>, ErrorObject<'static>>
Handler for ots_getHeaderByNumber and erigon_getHeaderByNumber
Source§async fn has_code(
&self,
address: Address,
block_id: Option<BlockId>,
) -> Result<bool, ErrorObject<'static>>
async fn has_code( &self, address: Address, block_id: Option<BlockId>, ) -> Result<bool, ErrorObject<'static>>
Handler for ots_hasCode
Source§async fn get_api_level(&self) -> Result<u64, ErrorObject<'static>>
async fn get_api_level(&self) -> Result<u64, ErrorObject<'static>>
Handler for ots_getApiLevel
Source§async fn get_internal_operations(
&self,
tx_hash: FixedBytes<32>,
) -> Result<Vec<InternalOperation>, ErrorObject<'static>>
async fn get_internal_operations( &self, tx_hash: FixedBytes<32>, ) -> Result<Vec<InternalOperation>, ErrorObject<'static>>
Handler for ots_getInternalOperations
Source§async fn get_transaction_error(
&self,
tx_hash: FixedBytes<32>,
) -> Result<Option<Bytes>, ErrorObject<'static>>
async fn get_transaction_error( &self, tx_hash: FixedBytes<32>, ) -> Result<Option<Bytes>, ErrorObject<'static>>
Handler for ots_getTransactionError
Source§async fn trace_transaction(
&self,
tx_hash: FixedBytes<32>,
) -> Result<Option<Vec<TraceEntry>>, ErrorObject<'static>>
async fn trace_transaction( &self, tx_hash: FixedBytes<32>, ) -> Result<Option<Vec<TraceEntry>>, ErrorObject<'static>>
Handler for ots_traceTransaction
Source§async fn get_block_details(
&self,
block_number: LenientBlockNumberOrTag,
) -> Result<BlockDetails<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header>, ErrorObject<'static>>
async fn get_block_details( &self, block_number: LenientBlockNumberOrTag, ) -> Result<BlockDetails<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header>, ErrorObject<'static>>
Handler for ots_getBlockDetails
Source§async fn get_block_details_by_hash(
&self,
block_hash: FixedBytes<32>,
) -> Result<BlockDetails<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header>, ErrorObject<'static>>
async fn get_block_details_by_hash( &self, block_hash: FixedBytes<32>, ) -> Result<BlockDetails<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header>, ErrorObject<'static>>
Handler for ots_getBlockDetailsByHash
Source§async fn get_block_transactions(
&self,
block_number: LenientBlockNumberOrTag,
page_number: usize,
page_size: usize,
) -> Result<OtsBlockTransactions<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::TransactionResponse, <<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header>, ErrorObject<'static>>
async fn get_block_transactions( &self, block_number: LenientBlockNumberOrTag, page_number: usize, page_size: usize, ) -> Result<OtsBlockTransactions<<<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::TransactionResponse, <<Eth as EthApiTypes>::NetworkTypes as RpcTypes>::Header>, ErrorObject<'static>>
Handler for ots_getBlockTransactions
Source§async fn search_transactions_before(
&self,
_address: Address,
_block_number: LenientBlockNumberOrTag,
_page_size: usize,
) -> Result<TransactionsWithReceipts, ErrorObject<'static>>
async fn search_transactions_before( &self, _address: Address, _block_number: LenientBlockNumberOrTag, _page_size: usize, ) -> Result<TransactionsWithReceipts, ErrorObject<'static>>
Handler for ots_searchTransactionsBefore
Source§async fn search_transactions_after(
&self,
_address: Address,
_block_number: LenientBlockNumberOrTag,
_page_size: usize,
) -> Result<TransactionsWithReceipts, ErrorObject<'static>>
async fn search_transactions_after( &self, _address: Address, _block_number: LenientBlockNumberOrTag, _page_size: usize, ) -> Result<TransactionsWithReceipts, ErrorObject<'static>>
Handler for ots_searchTransactionsAfter
Source§async fn get_transaction_by_sender_and_nonce(
&self,
sender: Address,
nonce: u64,
) -> Result<Option<FixedBytes<32>>, ErrorObject<'static>>
async fn get_transaction_by_sender_and_nonce( &self, sender: Address, nonce: u64, ) -> Result<Option<FixedBytes<32>>, ErrorObject<'static>>
Handler for ots_getTransactionBySenderAndNonce
Source§async fn get_contract_creator(
&self,
address: Address,
) -> Result<Option<ContractCreator>, ErrorObject<'static>>
async fn get_contract_creator( &self, address: Address, ) -> Result<Option<ContractCreator>, ErrorObject<'static>>
Handler for ots_getContractCreator