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
//! Rust client for the [Fynd](https://fynd.exchange) DEX router.
//!
//! `fynd-client` lets you request swap quotes, build signable transaction payloads, and
//! broadcast signed orders through the Fynd RPC API — all from a single typed interface.
//!
//! # Constructing a client
//!
//! Use [`FyndClientBuilder`] to configure and build a [`FyndClient`]:
//!
//! ```rust,no_run
//! # use fynd_client::{FyndClient, FyndClientBuilder};
//! # #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = FyndClientBuilder::new(
//! "https://rpc.fynd.exchange",
//! "https://mainnet.infura.io/v3/YOUR_KEY",
//! )
//! .build()
//! .await?;
//! # Ok(()) }
//! ```
//!
//! # Minimal quote example
//!
//! ```rust,no_run
//! # use fynd_client::{FyndClientBuilder, Order, OrderSide, QuoteOptions, QuoteParams};
//! # use bytes::Bytes;
//! # use num_bigint::BigUint;
//! # #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! # let client = FyndClientBuilder::new("https://rpc.fynd.exchange", "https://example.com")
//! # .build().await?;
//! let weth: Bytes = Bytes::copy_from_slice(&[0xC0; 20]); // placeholder
//! let usdc: Bytes = Bytes::copy_from_slice(&[0xA0; 20]); // placeholder
//! let sender: Bytes = Bytes::copy_from_slice(&[0xd8; 20]); // placeholder
//!
//! let order = Order::new(
//! weth,
//! usdc,
//! BigUint::from(1_000_000_000_000_000_000u64), // 1 WETH (18 decimals)
//! OrderSide::Sell,
//! sender,
//! None,
//! );
//!
//! let quote = client
//! .quote(QuoteParams::new(order, QuoteOptions::default()))
//! .await?;
//!
//! println!("amount out: {}", quote.amount_out());
//! # Ok(()) }
//! ```
pub use ;
pub use ;
pub use ;
pub use ;