rango_sdk/lib.rs
1//! Unofficial Rango SDK for Rust
2//!
3//! Rango Exchange is providing two types of API for interacting with its services:
4//! 1. Single step (a.k.a Basic API)
5//! 2. Multistep (a.k.a Main API)
6//!
7//! The Basic API is designed to provide a straightforward integration experience, unless you have specific and unique requirements that necessitate the use of the Main API.
8//! You can find more details on [Rango's docs](https://docs.rango.exchange/integration-quick-start/overview).
9//!
10//! NOTE: this crate only supports for single step api.
11//!
12//! # Prerequisite
13//!
14//! Before doing anything, you need to get your API key first.
15//! Here you can find out how you can [get a key](https://docs.rango.exchange/integration-quick-start/overview#get-your-api-key).
16//!
17//! # Usage
18//!
19//! Create a clinet:
20//! ```rust
21//! let rango = Client::new(
22//! "put-a-device-id-for-your-client",
23//! "YOUR_API_KEY",
24//! None,
25//! );
26//! ```
27//!
28//! Use available methods to get what you need (e.g. Getting chains):
29//! ```rust
30//! let result = rango.meta.chains().await;
31//! ```
32//!
33
34mod check;
35/// Initialize a client to send request to server
36pub mod client;
37mod error;
38mod meta;
39mod quote;
40mod swap;
41
42/// Create request to be passed to different methods.
43pub mod request {
44 pub use crate::check::{
45 balance::BalanceRequest, is_approved::IsApprovedRequest, status::StatusRequest,
46 };
47 pub use crate::quote::{Asset, QuoteRequest};
48 pub use crate::swap::SwapRequest;
49}