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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//! # metaflux-client — Rust SDK for the MetaFlux L1
//!
//! A typed client for the MetaFlux (MTF) derivatives L1. Every type, request
//! shape, and channel discriminator follows the wire convention: snake_case
//! JSON, plain-integer numerics (sizes / prices on fixed-point planes), and
//! `market_id` rather than `coin`.
//!
//! The SDK signs and submits the node's full signed-action surface — perp and
//! spot orders, TWAP, modify / batch, leverage and margin, vaults, staking,
//! agent / account settings, and spot-margin / Earn — and reads market and
//! account state over REST and WebSocket.
//!
//! ## Modules
//!
//! - [`wallet`] — secp256k1 keypair + EIP-712 signer (deterministic nonces).
//! - [`rest`] — `/info`, `/exchange`, `/explorer` HTTP endpoints.
//! - [`ws`] — WebSocket subscriptions, reconnect + heartbeat.
//! - [`types`] — domain types shared by all transports.
//! - [`faucet`] — devnet / testnet test-USDC faucet helper.
//! - [`error`] — single [`ClientError`] thiserror enum.
//!
//! ## Quick start
//!
//! ```no_run
//! use metaflux_client::{Client, wallet::Wallet};
//!
//! # async fn run() -> Result<(), Box<dyn std::error::Error>> {
//! let wallet = Wallet::from_hex(&std::env::var("MTF_PRIVATE_KEY")?)?;
//! let client = Client::new("https://devnet-gateway.mtf.exchange")?;
//! let markets = client.rest().info().markets().await?;
//! println!("{} markets available", markets.len());
//! # let _ = wallet; Ok(())
//! # }
//! ```
pub use ClientError;
pub use ;
pub use RestClient;
pub use ;
pub use Wallet;
/// Top-level convenience bundle.
///
/// Holds a single [`RestClient`] and a base URL re-used to construct WS
/// clients on demand. The fields are owned and `Clone`able cheaply so a
/// long-lived `Client` instance is the recommended pattern.