Skip to main content

Crate datamaxi

Crate datamaxi 

Source
Expand description

§DataMaxi+ Rust SDK

This is the official implementation of Rust SDK for DataMaxi+. The package can be used to fetch both historical and latest data using DataMaxi+ API.

§Installation

[dependencies]
datamaxi = { git = "https://github.com/bisonai/datamaxi-rust.git" }

§Configuration

Private API endpoints are protected by an API key. You can get the API key upon registering at https://datamaxiplus.com/auth.

OptionExplanation
api_keyYour API key
base_urlIf base_url is not provided, it defaults to https://api.datamaxiplus.com.

§Examples

§CEX Candle

let api_key = "my_api_key".to_string();
let candle: datamaxi::cex::Candle = datamaxi::api::Datamaxi::new(api_key);

// Fetch supported exchanges for CEX candle data
candle.exchanges("spot");

// Fetch supported symbols for CEX candle data
let symbols_options = datamaxi::cex::SymbolsOptions::new();
candle.symbols("binance", symbols_options);

// Fetch supported intervals for CEX candle data
candle.intervals();

// Fetch CEX candle data
let candle_options = datamaxi::cex::CandleOptions::new();
candle.get("binance", "ETH-USDT", candle_options);

§DEX

let api_key = "my_api_key".to_string();
let dex: datamaxi::dex::Dex = datamaxi::api::Datamaxi::new(api_key);

// Fetch supported intervals for DEX candle data
dex.intervals();

// Fetch supported exchange for DEX data
dex.exchanges();

// Fetch supported chains for DEX data
dex.chains();

// Fetch supported pools for DEX data
let pools_options = datamaxi::dex::PoolsOptions::new();
dex.pools(pools_options);

// Fetch DEX candle data
let params = datamaxi::dex::CandleOptions::new();
dex.candle(
  "bsc_mainnet",
  "pancakeswap",
  "0xb24cd29e32FaCDDf9e73831d5cD1FFcd1e535423",
  params,
);

// Fetch DEX trade data
let trade_options = datamaxi::dex::TradeOptions::new().limit(5);
dex.trade(
  "bsc_mainnet",
  "pancakeswap",
  "0xb24cd29e32FaCDDf9e73831d5cD1FFcd1e535423",
  trade_options
);

§Contributing

We welcome contributions! If you discover a bug in this project, please feel free to open an issue to discuss the changes you would like to propose.

§License

MIT License

Modules§

api
API definitions and related utilities.
cex
CEX-related data fetcher and data structures.
dex
DEX-related data fetcher and data structures.
generated
Auto-generated typed wrappers for every public REST endpoint on the data API. This module is the canonical surface for the OI / Liquidation / cex-symbol surfaces; the older hand-written modules (cex, dex) cover only a subset of endpoints and are kept for backward compatibility.
models
Data models representing API responses and optional parameters.