pub struct BlockchainDataClient { /* private fields */ }Expand description
Client for fetching blockchain data
Implementations§
Source§impl BlockchainDataClient
impl BlockchainDataClient
Sourcepub fn new(sources: DataSources) -> Self
pub fn new(sources: DataSources) -> Self
Create new client with data sources
Sourcepub fn with_base_url(sources: DataSources, base_url: &str) -> Self
pub fn with_base_url(sources: DataSources, base_url: &str) -> Self
Create new client with a custom base URL (for testing)
Sourcepub fn from_env_opt() -> Option<Self>
pub fn from_env_opt() -> Option<Self>
A client for super::etherscan::etherscan_key, or
None when there is no key (then use RiskEngine::new()).
Sourcepub async fn get_transactions(
&self,
address: &str,
chain: &str,
) -> Result<Vec<EtherscanTransaction>>
pub async fn get_transactions( &self, address: &str, chain: &str, ) -> Result<Vec<EtherscanTransaction>>
Fetch transaction history for an address
Sourcepub async fn get_internal_transactions(
&self,
address: &str,
) -> Result<Vec<EtherscanTransaction>>
pub async fn get_internal_transactions( &self, address: &str, ) -> Result<Vec<EtherscanTransaction>>
Get internal transactions (contract calls)
Sourcepub async fn get_token_transfers(
&self,
address: &str,
) -> Result<Vec<EtherscanTransaction>>
pub async fn get_token_transfers( &self, address: &str, ) -> Result<Vec<EtherscanTransaction>>
Get ERC-20 token transfers
Sourcepub async fn trace_transaction(
&self,
tx_hash: &str,
_depth: u32,
) -> Result<TransactionTrace>
pub async fn trace_transaction( &self, tx_hash: &str, _depth: u32, ) -> Result<TransactionTrace>
Trace transaction by following outputs
Trait Implementations§
Source§impl Clone for BlockchainDataClient
impl Clone for BlockchainDataClient
Auto Trait Implementations§
impl !RefUnwindSafe for BlockchainDataClient
impl !UnwindSafe for BlockchainDataClient
impl Freeze for BlockchainDataClient
impl Send for BlockchainDataClient
impl Sync for BlockchainDataClient
impl Unpin for BlockchainDataClient
impl UnsafeUnpin for BlockchainDataClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more