pub trait OtterscanClient<T, H>: ClientTwhere
T: RpcObject + Send + Sync + 'static + DeserializeOwned,
H: RpcObject + Send + Sync + 'static + DeserializeOwned,{
Show 13 methods
// Provided methods
fn get_header_by_number(
&self,
block_number: u64,
) -> impl Future<Output = Result<Option<H>, Error>> + Send { ... }
fn has_code(
&self,
address: Address,
block_id: Option<BlockId>,
) -> impl Future<Output = Result<bool, Error>> + Send { ... }
fn get_api_level(&self) -> impl Future<Output = Result<u64, Error>> + Send { ... }
fn get_internal_operations(
&self,
tx_hash: FixedBytes<32>,
) -> impl Future<Output = Result<Vec<InternalOperation>, Error>> + Send { ... }
fn get_transaction_error(
&self,
tx_hash: FixedBytes<32>,
) -> impl Future<Output = Result<Option<Bytes>, Error>> + Send { ... }
fn trace_transaction(
&self,
tx_hash: FixedBytes<32>,
) -> impl Future<Output = Result<Option<Vec<TraceEntry>>, Error>> + Send { ... }
fn get_block_details(
&self,
block_number: u64,
) -> impl Future<Output = Result<BlockDetails<H>, Error>> + Send { ... }
fn get_block_details_by_hash(
&self,
block_hash: FixedBytes<32>,
) -> impl Future<Output = Result<BlockDetails<H>, Error>> + Send { ... }
fn get_block_transactions(
&self,
block_number: u64,
page_number: usize,
page_size: usize,
) -> impl Future<Output = Result<OtsBlockTransactions<T, H>, Error>> + Send { ... }
fn search_transactions_before(
&self,
address: Address,
block_number: u64,
page_size: usize,
) -> impl Future<Output = Result<TransactionsWithReceipts, Error>> + Send { ... }
fn search_transactions_after(
&self,
address: Address,
block_number: u64,
page_size: usize,
) -> impl Future<Output = Result<TransactionsWithReceipts, Error>> + Send { ... }
fn get_transaction_by_sender_and_nonce(
&self,
sender: Address,
nonce: u64,
) -> impl Future<Output = Result<Option<FixedBytes<32>>, Error>> + Send { ... }
fn get_contract_creator(
&self,
address: Address,
) -> impl Future<Output = Result<Option<ContractCreator>, Error>> + Send { ... }
}
Expand description
Client implementation for the Otterscan
RPC API.
Provided Methods§
Sourcefn get_header_by_number(
&self,
block_number: u64,
) -> impl Future<Output = Result<Option<H>, Error>> + Send
fn get_header_by_number( &self, block_number: u64, ) -> impl Future<Output = Result<Option<H>, Error>> + 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, Error>> + Send
fn has_code( &self, address: Address, block_id: Option<BlockId>, ) -> impl Future<Output = Result<bool, Error>> + Send
Check if a certain address contains a deployed code.
Sourcefn get_api_level(&self) -> impl Future<Output = Result<u64, Error>> + Send
fn get_api_level(&self) -> impl Future<Output = Result<u64, Error>> + Send
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(
&self,
tx_hash: FixedBytes<32>,
) -> impl Future<Output = Result<Vec<InternalOperation>, Error>> + Send
fn get_internal_operations( &self, tx_hash: FixedBytes<32>, ) -> impl Future<Output = Result<Vec<InternalOperation>, Error>> + Send
Return the internal ETH transfers inside a transaction.
Sourcefn get_transaction_error(
&self,
tx_hash: FixedBytes<32>,
) -> impl Future<Output = Result<Option<Bytes>, Error>> + Send
fn get_transaction_error( &self, tx_hash: FixedBytes<32>, ) -> impl Future<Output = Result<Option<Bytes>, Error>> + Send
Given a transaction hash, returns its raw revert reason.
Sourcefn trace_transaction(
&self,
tx_hash: FixedBytes<32>,
) -> impl Future<Output = Result<Option<Vec<TraceEntry>>, Error>> + Send
fn trace_transaction( &self, tx_hash: FixedBytes<32>, ) -> impl Future<Output = Result<Option<Vec<TraceEntry>>, Error>> + Send
Extract all variations of calls, contract creation and self-destructs and returns a call tree.
Sourcefn get_block_details(
&self,
block_number: u64,
) -> impl Future<Output = Result<BlockDetails<H>, Error>> + Send
fn get_block_details( &self, block_number: u64, ) -> impl Future<Output = Result<BlockDetails<H>, Error>> + 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>, Error>> + Send
fn get_block_details_by_hash( &self, block_hash: FixedBytes<32>, ) -> impl Future<Output = Result<BlockDetails<H>, Error>> + Send
Tailor-made and expanded version of eth_getBlockByHash for block details page in Otterscan.
Sourcefn get_block_transactions(
&self,
block_number: u64,
page_number: usize,
page_size: usize,
) -> impl Future<Output = Result<OtsBlockTransactions<T, H>, Error>> + Send
fn get_block_transactions( &self, block_number: u64, page_number: usize, page_size: usize, ) -> impl Future<Output = Result<OtsBlockTransactions<T, H>, Error>> + Send
Get paginated transactions for a certain block. Also remove some verbose fields like logs.
Sourcefn search_transactions_before(
&self,
address: Address,
block_number: u64,
page_size: usize,
) -> impl Future<Output = Result<TransactionsWithReceipts, Error>> + Send
fn search_transactions_before( &self, address: Address, block_number: u64, page_size: usize, ) -> impl Future<Output = Result<TransactionsWithReceipts, Error>> + Send
Gets paginated inbound/outbound transaction calls for a certain address.
Sourcefn search_transactions_after(
&self,
address: Address,
block_number: u64,
page_size: usize,
) -> impl Future<Output = Result<TransactionsWithReceipts, Error>> + Send
fn search_transactions_after( &self, address: Address, block_number: u64, page_size: usize, ) -> impl Future<Output = Result<TransactionsWithReceipts, Error>> + Send
Gets paginated inbound/outbound transaction calls for a certain address.
Sourcefn get_transaction_by_sender_and_nonce(
&self,
sender: Address,
nonce: u64,
) -> impl Future<Output = Result<Option<FixedBytes<32>>, Error>> + Send
fn get_transaction_by_sender_and_nonce( &self, sender: Address, nonce: u64, ) -> impl Future<Output = Result<Option<FixedBytes<32>>, Error>> + Send
Gets the transaction hash for a certain sender address, given its nonce.
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.