tail_fin_arkham/lib.rs
1//! Arkham Intel adapter — pure-HTTP client for `api.arkm.com`.
2//!
3//! Auth contract (verified 2026-04-30 against live api.arkm.com):
4//! - `X-Timestamp: <unix epoch seconds>`
5//! - `X-Payload: sha256(KEY + ":" + sha256(path + ":" + ts + ":" + KEY))`
6//! - `Origin: https://intel.arkm.com` (CORS-pinned by server)
7//!
8//! `KEY` is the build-time `NEXT_PUBLIC_WEBAPP_CLIENT_KEY` baked into the
9//! SPA's JS bundle. Same value for every user — there is no per-user secret
10//! for the public data surface (~75 of 84 documented endpoints). The
11//! ~9 user-bound endpoints (`/user`, `/user/portfolio`, `/turnkey/wallet`,
12//! `/user/alerts*`, etc.) return `null` / `[]` without an additional auth
13//! cookie that the SPA sends via `withCredentials:true`.
14//!
15//! Server enforces a < 18-minute replay window on `X-Timestamp`.
16//!
17//! No browser, no Cloudflare bypass, no cookies needed for the data surface.
18
19pub mod http;
20pub mod parsing;
21pub mod signing;
22pub mod types;
23
24pub use http::ArkhamClient;
25pub use signing::{sign_payload, ARKM_CLIENT_KEY};
26pub use types::*;