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
69
//! # Monaco SDK
//!
//! Typed Rust client for the [Monaco DEX](https://github.com/Monaco-Research/monaco-core)
//! REST API — auto-generated from the OpenAPI specification via
//! [progenitor](https://docs.rs/progenitor).
//!
//! ## Quick start
//!
//! ```rust,no_run
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = monaco_sdk::Client::new("https://develop.apimonaco.xyz");
//!
//! // Public endpoints (no auth required)
//! let health = client.health_check().await?.into_inner();
//! println!("Status: {:?}", health.status);
//!
//! let pairs = client
//! .list_trading_pairs(None, Some(true), None, None, None, None)
//! .await?
//! .into_inner();
//! println!("Trading pairs: {:?}", pairs.trading_pairs);
//!
//! Ok(())
//! }
//! ```
//!
//! ## Authentication
//!
//! Authenticated endpoints require a Bearer token obtained through the
//! challenge → sign → verify flow. Pass it via a custom `reqwest::Client`:
//!
//! ```rust,no_run
//! use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION};
//!
//! let mut headers = HeaderMap::new();
//! headers.insert(
//! AUTHORIZATION,
//! HeaderValue::from_str("Bearer <your-jwt>").unwrap(),
//! );
//! let http = reqwest::ClientBuilder::new()
//! .default_headers(headers)
//! .build()
//! .unwrap();
//! let client = monaco_sdk::Client::new_with_client("https://develop.apimonaco.xyz", http);
//! ```
//!
//! ## API coverage
//!
//! The client exposes every operation from the Monaco REST API:
//!
//! | Category | Methods |
//! |----------|---------|
//! | **Market data** | `list_trading_pairs`, `get_trading_pair_by_id`, `get_market_metadata`, `get_candles` |
//! | **Orderbook** | `get_orderbook_snapshot` |
//! | **Trades** | `get_trades` |
//! | **Orders** | `create_order`, `replace_order`, `cancel_order`, `get_orders`, `get_order_by_id` |
//! | **Batch orders** | `batch_create_orders`, `batch_replace_orders`, `batch_cancel_orders`, `batch_cancel_all`, `batch_cancel_all_by_pair` |
//! | **Accounts** | `get_user_profile`, `get_user_balances`, `get_user_balance_by_asset`, `get_user_movements` |
//! | **Sub-accounts** | `list_sub_accounts_with_balances`, `create_sub_account_limit`, `get_sub_account_limits`, `update_sub_account_limit`, `delete_sub_account_limit` |
//! | **Auth** | `create_challenge`, `verify_signature`, `refresh_token`, `revoke_session`, `authenticate_backend` |
//! | **Fees** | `simulate_fees` |
//! | **Whitelist** | `submit_whitelist` |
//! | **Faucet** | `mint_tokens` |
//! | **Health** | `health_check` |
//!
//! All request/response types live in the [`types`] module.
include!;