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
//! Rust client for the `KyberSwap` Aggregator API
//!
//! `KyberSwap` is a multi-chain DEX aggregator that provides optimal swap routes.
//!
//! # Quick Start
//!
//! ```no_run
//! use kybr::{Client, Chain, RouteRequest};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), kybr::Error> {
//! let client = Client::new()?;
//!
//! let request = RouteRequest::new(
//! "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
//! "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
//! "1000000000000000000", // 1 WETH
//! );
//!
//! let route = client.get_routes(Chain::Ethereum, &request).await?;
//! println!("Output: {} USDC", route.amount_out);
//!
//! Ok(())
//! }
//! ```
pub use Client;
pub use ;
pub use ;
// Re-export common utilities
pub use ;
pub use ;
/// Default base URL for the `KyberSwap` API
pub const DEFAULT_BASE_URL: &str = "https://aggregator-api.kyberswap.com";
/// Configuration for the `KyberSwap` API client
pub type Config = ApiConfig;
/// Create a default Kyber config