pub trait OtterscanServer<T>:
Sized
+ Send
+ Sync
+ 'staticwhere
T: RpcObject,{
Show 14 methods
// Required methods
fn get_header_by_number<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Header>, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn has_code<'life0, 'async_trait>(
&'life0 self,
address: Address,
block_id: Option<BlockId>,
) -> Pin<Box<dyn Future<Output = Result<bool, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_api_level<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_internal_operations<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<InternalOperation>, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_transaction_error<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn trace_transaction<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TraceEntry>>, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_block_details<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockDetails, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_block_details_by_hash<'life0, 'async_trait>(
&'life0 self,
block_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<BlockDetails, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_block_transactions<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
page_number: usize,
page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<OtsBlockTransactions<T>, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn search_transactions_before<'life0, 'async_trait>(
&'life0 self,
address: Address,
block_number: u64,
page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn search_transactions_after<'life0, 'async_trait>(
&'life0 self,
address: Address,
block_number: u64,
page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_transaction_by_sender_and_nonce<'life0, 'async_trait>(
&'life0 self,
sender: Address,
nonce: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<FixedBytes<32>>, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_contract_creator<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = Result<Option<ContractCreator>, ErrorObject<'static>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided method
fn into_rpc(self) -> RpcModule<Self>
where T: Send + Sync + 'static + Clone + Serialize { ... }
}
Expand description
Server trait implementation for the Otterscan
RPC API.
Required Methods§
Sourcefn get_header_by_number<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Header>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_header_by_number<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Header>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
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<'life0, 'async_trait>(
&'life0 self,
address: Address,
block_id: Option<BlockId>,
) -> Pin<Box<dyn Future<Output = Result<bool, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn has_code<'life0, 'async_trait>(
&'life0 self,
address: Address,
block_id: Option<BlockId>,
) -> Pin<Box<dyn Future<Output = Result<bool, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Check if a certain address contains a deployed code.
Sourcefn get_api_level<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_api_level<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Very simple API versioning scheme. Every time we add a new capability, the number is incremented. This allows for Otterscan to check if the node contains all API it needs.
Sourcefn get_internal_operations<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<InternalOperation>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_internal_operations<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<InternalOperation>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Return the internal ETH transfers inside a transaction.
Sourcefn get_transaction_error<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_transaction_error<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Given a transaction hash, returns its raw revert reason.
Sourcefn trace_transaction<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TraceEntry>>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn trace_transaction<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TraceEntry>>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Extract all variations of calls, contract creation and self-destructs and returns a call tree.
Sourcefn get_block_details<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockDetails, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_block_details<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockDetails, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Tailor-made and expanded version of eth_getBlockByNumber for block details page in Otterscan.
Sourcefn get_block_details_by_hash<'life0, 'async_trait>(
&'life0 self,
block_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<BlockDetails, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_block_details_by_hash<'life0, 'async_trait>(
&'life0 self,
block_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<BlockDetails, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Tailor-made and expanded version of eth_getBlockByHash for block details page in Otterscan.
Sourcefn get_block_transactions<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
page_number: usize,
page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<OtsBlockTransactions<T>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_block_transactions<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
page_number: usize,
page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<OtsBlockTransactions<T>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get paginated transactions for a certain block. Also remove some verbose fields like logs.
Sourcefn search_transactions_before<'life0, 'async_trait>(
&'life0 self,
address: Address,
block_number: u64,
page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn search_transactions_before<'life0, 'async_trait>(
&'life0 self,
address: Address,
block_number: u64,
page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Gets paginated inbound/outbound transaction calls for a certain address.
Sourcefn search_transactions_after<'life0, 'async_trait>(
&'life0 self,
address: Address,
block_number: u64,
page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn search_transactions_after<'life0, 'async_trait>(
&'life0 self,
address: Address,
block_number: u64,
page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Gets paginated inbound/outbound transaction calls for a certain address.
Sourcefn get_transaction_by_sender_and_nonce<'life0, 'async_trait>(
&'life0 self,
sender: Address,
nonce: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<FixedBytes<32>>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_transaction_by_sender_and_nonce<'life0, 'async_trait>(
&'life0 self,
sender: Address,
nonce: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<FixedBytes<32>>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Gets the transaction hash for a certain sender address, given its nonce.
Sourcefn get_contract_creator<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = Result<Option<ContractCreator>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_contract_creator<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = Result<Option<ContractCreator>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Gets the transaction hash and the address who created a contract.
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.
Implementations on Foreign Types§
Source§impl<Eth> OtterscanServer<<<Eth as EthApiTypes>::NetworkTypes as Network>::TransactionResponse> for OtterscanApi<Eth>where
Eth: EthApiServer<<<Eth as EthApiTypes>::NetworkTypes as Network>::TransactionResponse, Block<<<Eth as EthApiTypes>::NetworkTypes as Network>::TransactionResponse, <<Eth as EthApiTypes>::NetworkTypes as Network>::HeaderResponse>, <<Eth as EthApiTypes>::NetworkTypes as Network>::ReceiptResponse> + EthTransactions + TraceExt + 'static,
impl<Eth> OtterscanServer<<<Eth as EthApiTypes>::NetworkTypes as Network>::TransactionResponse> for OtterscanApi<Eth>where
Eth: EthApiServer<<<Eth as EthApiTypes>::NetworkTypes as Network>::TransactionResponse, Block<<<Eth as EthApiTypes>::NetworkTypes as Network>::TransactionResponse, <<Eth as EthApiTypes>::NetworkTypes as Network>::HeaderResponse>, <<Eth as EthApiTypes>::NetworkTypes as Network>::ReceiptResponse> + EthTransactions + TraceExt + 'static,
Source§fn get_header_by_number<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Header>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
fn get_header_by_number<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Header>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
Handler for {ots,erigon}_getHeaderByNumber
Source§fn has_code<'life0, 'async_trait>(
&'life0 self,
address: Address,
block_id: Option<BlockId>,
) -> Pin<Box<dyn Future<Output = Result<bool, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
fn has_code<'life0, 'async_trait>(
&'life0 self,
address: Address,
block_id: Option<BlockId>,
) -> Pin<Box<dyn Future<Output = Result<bool, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
Handler for ots_hasCode
Source§fn get_api_level<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
fn get_api_level<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
Handler for ots_getApiLevel
Source§fn get_internal_operations<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<InternalOperation>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
fn get_internal_operations<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<InternalOperation>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
Handler for ots_getInternalOperations
Source§fn get_transaction_error<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
fn get_transaction_error<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
Handler for ots_getTransactionError
Source§fn trace_transaction<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TraceEntry>>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
fn trace_transaction<'life0, 'async_trait>(
&'life0 self,
tx_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<TraceEntry>>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
Handler for ots_traceTransaction
Source§fn get_block_details<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockDetails, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
fn get_block_details<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockDetails, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
Handler for ots_getBlockDetails
Source§fn get_block_details_by_hash<'life0, 'async_trait>(
&'life0 self,
block_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<BlockDetails, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
fn get_block_details_by_hash<'life0, 'async_trait>(
&'life0 self,
block_hash: FixedBytes<32>,
) -> Pin<Box<dyn Future<Output = Result<BlockDetails, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
Handler for getBlockDetailsByHash
Source§fn get_block_transactions<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
page_number: usize,
page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<OtsBlockTransactions<<<Eth as EthApiTypes>::NetworkTypes as Network>::TransactionResponse>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
fn get_block_transactions<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
page_number: usize,
page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<OtsBlockTransactions<<<Eth as EthApiTypes>::NetworkTypes as Network>::TransactionResponse>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
Handler for getBlockTransactions
Source§fn search_transactions_before<'life0, 'async_trait>(
&'life0 self,
_address: Address,
_block_number: u64,
_page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
fn search_transactions_before<'life0, 'async_trait>(
&'life0 self,
_address: Address,
_block_number: u64,
_page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
Handler for searchTransactionsBefore
Source§fn search_transactions_after<'life0, 'async_trait>(
&'life0 self,
_address: Address,
_block_number: u64,
_page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
fn search_transactions_after<'life0, 'async_trait>(
&'life0 self,
_address: Address,
_block_number: u64,
_page_size: usize,
) -> Pin<Box<dyn Future<Output = Result<TransactionsWithReceipts, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
Handler for searchTransactionsAfter
Source§fn get_transaction_by_sender_and_nonce<'life0, 'async_trait>(
&'life0 self,
sender: Address,
nonce: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<FixedBytes<32>>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
fn get_transaction_by_sender_and_nonce<'life0, 'async_trait>(
&'life0 self,
sender: Address,
nonce: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<FixedBytes<32>>, ErrorObject<'static>>> + Send + 'async_trait>>where
'life0: 'async_trait,
OtterscanApi<Eth>: 'async_trait,
Handler for getTransactionBySenderAndNonce