cielo_rs_sdk/lib.rs
1/*!
2# Cielo Rust SDK
3
4Cielo Rust SDK is a Rust library for interacting with the [Cielo API](https://developer.cielo.finance/reference/getfeed). It provides a convenient way to fetch and filter feed data from the Cielo platform.
5
6<div class="warning">
7This is not an official SDK. It is a personal project for learning Rust and API development. The included endpoints are primarily for personal use in my own projects and may not cover all features of the Cielo API.
8</div>
9
10## Features
11
12- Configurable retry strategy for API requests.
13- Fetch feed data with various filters.
14
15## Configuration
16
17You can configure the retry strategy by providing optional parameters when creating the [`CieloApi`] instance:
18
19- `min_retry_interval`: Minimum retry interval in milliseconds.
20- `max_retry_interval`: Maximum retry interval in milliseconds.
21- `max_retries`: Maximum number of retries.
22
23## Usage
24
25<div class="warning">
26The feed data is linked to your account, so the filters you set will be applied to your existing feed data. This means that if you filter by a wallet address, the wallet address should already be in your watchlist for this to work.
27</div>
28
29### Creating a CieloApi Instance
30
31```
32use cielo_rs_sdk::CieloApi;
33
34let api_key = "your_api_key";
35let client = CieloApi::new(api_key, None, None, None)
36 .expect("Failed to create CieloApi");
37```
38
39### Fetching Feed Data
40
41```no_run
42# use cielo_rs_sdk::{CieloApi, api};
43# #[tokio::main]
44# async fn main() {
45# let api_key = "your_api_key";
46# let cielo_api = CieloApi::new(api_key, None, None, None).unwrap();
47let filters = api::feed::Filters {
48 wallet: Some("your_wallet_address".to_string()),
49 limit: Some(10),
50 list_id: None,
51 chains: Some(vec!["solana".to_string()]),
52 tx_types: Some(vec![api::feed::TxType::Swap]),
53 tokens: None,
54 min_usd: Some(100),
55 new_trades: Some(true),
56 start_from: None,
57 from_timestamp: None,
58 to_timestamp: None,
59 include_market_cap: Some(true),
60};
61let feed = cielo_api.get_feed(filters).await.unwrap();
62# }
63*/
64
65#![warn(
66 missing_docs,
67 rustdoc::unescaped_backticks,
68 clippy::missing_errors_doc,
69 clippy::missing_docs_in_private_items
70)]
71
72mod constants;
73mod error;
74mod reqwest_ext;
75
76pub mod api;
77pub mod models;
78
79// Re-export the CieloApi struct
80pub use api::CieloApi;
81pub use error::Error;