1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! The official Rust client for the [0xinsider Developer API](https://0xinsider.com/developers):
//! Polymarket analytics for sports and esports. Every tracked wallet is graded S
//! to F from settled P&L; the API returns grades, large trades, sharp-money
//! flow, positions, market snapshots, reports and search.
//!
//! Every operation in the [OpenAPI document](https://0xinsider.com/api/v1/openapi.json)
//! is a typed async method on [`Client`], named after its operationId in
//! snake_case (`listLeaderboard` is [`Client::list_leaderboard`]). Required
//! parameters are arguments; optional ones go in a `...Params` struct.
//!
//! ```no_run
//! # async fn run() -> oxinsider::Result<()> {
//! use oxinsider::{Client, ListLeaderboardParams};
//!
//! let client = Client::from_env()?; // reads OXINSIDER_API_KEY
//! let board = client.list_leaderboard(&ListLeaderboardParams::default().limit(10)).await?;
//! for entry in &board.data {
//! println!("{} {:?}", entry.address, entry.grade);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! Build against the [sandbox](SANDBOX_BASE_URL) first: [`Client::sandbox`]
//! needs no key and answers every documented operation with example data.
//!
//! - **Absent is not zero.** A field the API did not report is `None`. Serve a
//! truthful unavailable state; never read it as `0`.
//! - **Errors.** A non-2xx answer is [`Error::Api`]. Branch on
//! [`ApiError::code`] and [`ApiError::reason`], never on the message.
//! - **Retries.** Reads, and writes that carry an `Idempotency-Key`, are retried
//! on 408, 429, 502, 503 and 504, honoring `Retry-After` up to 60 seconds.
//! - **Pagination.** Follow cursors to completion with [`pagination::Pager`].
//! - **Stream.** Read `GET /api/v1/stream` with [`Client::open_stream`].
//! - **Webhooks.** Verify deliveries with [`webhooks::verify_signature`].
//! - **Where the credential goes.** Over `https`, or `http` to a loopback host
//! only; anything else fails with [`Error::InsecureTransport`] before a request is sent.
pub use ;
pub use ;
pub use ;
pub use *;
pub use ;
pub use ;
pub use ;
pub use ;
// Compiles the README's complete programs as doctests, so its examples cannot drift from the API.
;