pub struct BlockchainDataClient { /* private fields */ }Expand description
Client for fetching blockchain data
Implementations§
Source§impl BlockchainDataClient
impl BlockchainDataClient
Sourcepub fn new(sources: DataSources) -> Self
👎Deprecated since 0.8.0: pass the transport: use BlockchainDataClient::new_with_http
pub fn new(sources: DataSources) -> Self
pass the transport: use BlockchainDataClient::new_with_http
Create new client with data sources and a transport built from the environment.
Sourcepub fn new_with_http(sources: DataSources, http: Arc<dyn HttpClient>) -> Self
pub fn new_with_http(sources: DataSources, http: Arc<dyn HttpClient>) -> Self
Create new client with data sources, sending requests through http.
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>
👎Deprecated since 0.8.0: pass the transport: use BlockchainDataClient::from_env_opt_with_http
pub fn from_env_opt() -> Option<Self>
pass the transport: use BlockchainDataClient::from_env_opt_with_http
A client for super::etherscan::etherscan_key, or
None when there is no key (then use RiskEngine::new()).
Sourcepub fn from_env_opt_with_http(http: Arc<dyn HttpClient>) -> Option<Self>
pub fn from_env_opt_with_http(http: Arc<dyn HttpClient>) -> Option<Self>
BlockchainDataClient::from_env_opt, sending requests through http.
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 Forget 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