pub struct ArkhamClient { /* private fields */ }Expand description
HTTP client for Arkham Intel’s public data API.
Implementations§
Source§impl ArkhamClient
impl ArkhamClient
Sourcepub fn new() -> Result<Self, TailFinError>
pub fn new() -> Result<Self, TailFinError>
Build a Chrome-145-emulated client. The TLS fingerprint is overkill
for api.arkm.com (vanilla curl works), but keeps us aligned with the
SPA and inoculates against future Cloudflare tightening.
Sourcepub async fn signed_get(
&self,
path: &str,
query_pairs: &[(&str, &str)],
) -> Result<Value, TailFinError>
pub async fn signed_get( &self, path: &str, query_pairs: &[(&str, &str)], ) -> Result<Value, TailFinError>
Call any signed GET endpoint and return the response body as Value.
Public so library users can hit endpoints we haven’t typed yet.
Sourcepub async fn search(&self, query: &str) -> Result<SearchResults, TailFinError>
pub async fn search(&self, query: &str) -> Result<SearchResults, TailFinError>
Search across entities, tokens, and pools.
Sourcepub async fn address_enriched(
&self,
address: &str,
) -> Result<AddressEnriched, TailFinError>
pub async fn address_enriched( &self, address: &str, ) -> Result<AddressEnriched, TailFinError>
Cross-chain enriched profile for an EVM-style address.
Sourcepub async fn transfers(
&self,
q: &TransfersQuery<'_>,
) -> Result<TransfersPage, TailFinError>
pub async fn transfers( &self, q: &TransfersQuery<'_>, ) -> Result<TransfersPage, TailFinError>
Page of transfers matching the filter. Pass TransfersQuery::default
for a default scan, or populate fields like base, flow, usd_gte,
sort_key/sort_dir, limit, offset to filter and paginate.
pub async fn balances_address( &self, address: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
pub async fn counterparties_address( &self, address: &str, chains: Option<&str>, flow: Option<&str>, time_last: Option<&str>, usd_gte: Option<&str>, limit: Option<u32>, ) -> Result<Value, TailFinError>
pub async fn flow_address( &self, address: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
pub async fn history_address( &self, address: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
Sourcepub async fn intelligence_address(
&self,
address: &str,
chain: &str,
) -> Result<Value, TailFinError>
pub async fn intelligence_address( &self, address: &str, chain: &str, ) -> Result<Value, TailFinError>
Single-chain /intelligence/address/{address} (NOT the /all variant).
Sourcepub async fn intelligence_address_all(
&self,
address: &str,
) -> Result<Value, TailFinError>
pub async fn intelligence_address_all( &self, address: &str, ) -> Result<Value, TailFinError>
All-chain /intelligence/address/{address}/all.
Sourcepub async fn intelligence_address_enriched_chain(
&self,
address: &str,
chain: &str,
) -> Result<Value, TailFinError>
pub async fn intelligence_address_enriched_chain( &self, address: &str, chain: &str, ) -> Result<Value, TailFinError>
Single-chain enriched profile (vs address_enriched() which is /all).
pub async fn intelligence_contract( &self, chain: &str, address: &str, ) -> Result<Value, TailFinError>
pub async fn loans_address( &self, address: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
Sourcepub async fn portfolio_address(
&self,
address: &str,
time: &str,
chains: Option<&str>,
) -> Result<Value, TailFinError>
pub async fn portfolio_address( &self, address: &str, time: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
Server REQUIRES time (unix milliseconds string). Returns 400
“invalid unix millisecond time” without it.
Sourcepub async fn portfolio_timeseries_address(
&self,
address: &str,
pricing_id: &str,
chains: Option<&str>,
) -> Result<Value, TailFinError>
pub async fn portfolio_timeseries_address( &self, address: &str, pricing_id: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
Server REQUIRES pricing_id. Returns 400 “missing pricingId” without it.
pub async fn volume_address( &self, address: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
pub async fn balances_entity( &self, entity: &str, chains: Option<&str>, cheap: Option<bool>, ) -> Result<Value, TailFinError>
pub async fn counterparties_entity( &self, entity: &str, chains: Option<&str>, flow: Option<&str>, time_last: Option<&str>, usd_gte: Option<&str>, limit: Option<u32>, ) -> Result<Value, TailFinError>
pub async fn flow_entity( &self, entity: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
pub async fn history_entity( &self, entity: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
pub async fn loans_entity( &self, entity: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
Sourcepub async fn portfolio_entity(
&self,
entity: &str,
time: &str,
chains: Option<&str>,
) -> Result<Value, TailFinError>
pub async fn portfolio_entity( &self, entity: &str, time: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
Server REQUIRES time (unix milliseconds string). Returns 400
“invalid unix millisecond time” without it.
Sourcepub async fn portfolio_timeseries_entity(
&self,
entity: &str,
pricing_id: &str,
chains: Option<&str>,
) -> Result<Value, TailFinError>
pub async fn portfolio_timeseries_entity( &self, entity: &str, pricing_id: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
Server REQUIRES pricing_id. Returns 400 “missing pricingId” without it.
pub async fn volume_entity( &self, entity: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
pub async fn intelligence_entity( &self, entity: &str, ) -> Result<Value, TailFinError>
pub async fn intelligence_entity_summary( &self, entity: &str, ) -> Result<Value, TailFinError>
pub async fn intelligence_entity_predictions( &self, entity: &str, ) -> Result<Value, TailFinError>
Sourcepub async fn intelligence_entity_balance_changes(
&self,
order_by: &str,
order_dir: &str,
interval: &str,
limit: u32,
chains: Option<&str>,
entity_types: Option<&str>,
entity_ids: Option<&str>,
offset: Option<u32>,
) -> Result<Value, TailFinError>
pub async fn intelligence_entity_balance_changes( &self, order_by: &str, order_dir: &str, interval: &str, limit: u32, chains: Option<&str>, entity_types: Option<&str>, entity_ids: Option<&str>, offset: Option<u32>, ) -> Result<Value, TailFinError>
Recent balance changes across entities. Server REQUIRES four params
— order_by, order_dir, interval, and limit. Without interval
the server returns 400; without limit it returns 500. Valid
order_by: balanceUsd | balanceUsdChange | balanceUsdPctChange | balanceUnit | balanceUnitChange | balanceUnitPctChange. Valid
interval: 7d | 14d | 30d.
pub async fn intelligence_entity_types(&self) -> Result<Value, TailFinError>
pub async fn token_addresses(&self, id: &str) -> Result<Value, TailFinError>
pub async fn token_balance_by_addr( &self, chain: &str, token_address: &str, entity_id: Option<&str>, holder_address: Option<&str>, ) -> Result<Value, TailFinError>
pub async fn token_balance_by_id( &self, id: &str, entity_id: Option<&str>, holder_address: Option<&str>, ) -> Result<Value, TailFinError>
pub async fn token_holders_by_addr( &self, chain: &str, token_address: &str, group_by_entity: Option<bool>, limit: Option<u32>, offset: Option<u32>, ) -> Result<Value, TailFinError>
pub async fn token_holders_by_id( &self, id: &str, group_by_entity: Option<bool>, limit: Option<u32>, offset: Option<u32>, ) -> Result<Value, TailFinError>
pub async fn token_market(&self, id: &str) -> Result<Value, TailFinError>
pub async fn token_price_history_by_addr( &self, chain: &str, token_address: &str, daily: Option<bool>, ) -> Result<Value, TailFinError>
pub async fn token_price_history_by_id( &self, id: &str, daily: Option<bool>, ) -> Result<Value, TailFinError>
Sourcepub async fn token_price_change(
&self,
id: &str,
past_time: &str,
) -> Result<Value, TailFinError>
pub async fn token_price_change( &self, id: &str, past_time: &str, ) -> Result<Value, TailFinError>
Server REQUIRES past_time as an RFC 3339 timestamp (e.g.
2025-12-01T00:00:00Z) — NOT a Go duration. Server returns 400
“missing pastTime query param” without it, “invalid pastTime format”
with anything that doesn’t parse as RFC 3339.
Sourcepub async fn token_top(
&self,
timeframe: &str,
order_by_agg: &str,
order_by_percent: bool,
order_by_desc: bool,
from: u32,
size: u32,
chains: Option<&str>,
) -> Result<Value, TailFinError>
pub async fn token_top( &self, timeframe: &str, order_by_agg: &str, order_by_percent: bool, order_by_desc: bool, from: u32, size: u32, chains: Option<&str>, ) -> Result<Value, TailFinError>
Top tokens. Server REQUIRES four params — timeframe,
order_by_agg, order_by_percent, from, order_by_desc, AND
size — six required params total. Server returns 400 naming
whichever is missing. from is the pagination start (0 for the
first page). Note order_by_agg here is distinct from the
order_by param on /intelligence/entity_balance_changes.
Sourcepub async fn token_top_flow_by_addr(
&self,
chain: &str,
token_address: &str,
time_last: &str,
chains: Option<&str>,
) -> Result<Value, TailFinError>
pub async fn token_top_flow_by_addr( &self, chain: &str, token_address: &str, time_last: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
Server REQUIRES time_last (Go duration: 1h, 24h, 7d, 30d).
Returns 400 “invalid timeLast” without it.
Sourcepub async fn token_top_flow_by_id(
&self,
id: &str,
time_last: &str,
chains: Option<&str>,
) -> Result<Value, TailFinError>
pub async fn token_top_flow_by_id( &self, id: &str, time_last: &str, chains: Option<&str>, ) -> Result<Value, TailFinError>
Server REQUIRES time_last. See [token_top_flow_by_addr].
pub async fn token_trending(&self) -> Result<Value, TailFinError>
pub async fn token_trending_by_id( &self, id: &str, ) -> Result<Value, TailFinError>
Sourcepub async fn token_volume_by_addr(
&self,
chain: &str,
token_address: &str,
time_last: &str,
granularity: &str,
) -> Result<Value, TailFinError>
pub async fn token_volume_by_addr( &self, chain: &str, token_address: &str, time_last: &str, granularity: &str, ) -> Result<Value, TailFinError>
Server REQUIRES granularity as a Go duration string (1h, 1d,
30m, etc. — NOT keywords like hourly/daily). Returns 400
“missing granularity” or “invalid duration” otherwise. time_last
is also de-facto required by the server.
Sourcepub async fn token_volume_by_id(
&self,
id: &str,
time_last: &str,
granularity: &str,
) -> Result<Value, TailFinError>
pub async fn token_volume_by_id( &self, id: &str, time_last: &str, granularity: &str, ) -> Result<Value, TailFinError>
Server REQUIRES granularity and time_last. See [token_volume_by_addr].
pub async fn token_arkham_exchange_tokens(&self) -> Result<Value, TailFinError>
pub async fn intelligence_token_by_addr( &self, chain: &str, address: &str, ) -> Result<Value, TailFinError>
pub async fn intelligence_token_by_id( &self, id: &str, ) -> Result<Value, TailFinError>
pub async fn intelligence_addresses_updates( &self, since: Option<&str>, limit: Option<u32>, page_token: Option<&str>, ) -> Result<Value, TailFinError>
pub async fn intelligence_entities_updates( &self, since: Option<&str>, limit: Option<u32>, page_token: Option<&str>, ) -> Result<Value, TailFinError>
pub async fn transfers_histogram( &self, q: &TransfersQuery<'_>, granularity: Option<&str>, ) -> Result<Value, TailFinError>
pub async fn transfers_histogram_simple( &self, q: &TransfersQuery<'_>, ) -> Result<Value, TailFinError>
Sourcepub async fn transfers_tx(
&self,
hash: &str,
transfer_type: &str,
chain: &str,
) -> Result<Value, TailFinError>
pub async fn transfers_tx( &self, hash: &str, transfer_type: &str, chain: &str, ) -> Result<Value, TailFinError>
Server REQUIRES chain. Returns 400 “could not parse chain” without it.
pub async fn tx(&self, hash: &str) -> Result<Value, TailFinError>
Sourcepub async fn swaps(
&self,
base: Option<&[&str]>,
chains: Option<&str>,
flow: Option<&str>,
time_last: Option<&str>,
usd_gte: Option<&str>,
sort_key: Option<&str>,
sort_dir: Option<&str>,
limit: Option<u32>,
offset: Option<u32>,
) -> Result<Value, TailFinError>
pub async fn swaps( &self, base: Option<&[&str]>, chains: Option<&str>, flow: Option<&str>, time_last: Option<&str>, usd_gte: Option<&str>, sort_key: Option<&str>, sort_dir: Option<&str>, limit: Option<u32>, offset: Option<u32>, ) -> Result<Value, TailFinError>
base mirrors /transfers (repeated ?base=A&base=B for multi).