-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e4ed70
commit 96d2886
Showing
17 changed files
with
974 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
src/main.rs | ||
|
||
Cargo.lock | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use datamaxi::cex; | ||
use datamaxi::api::Datamaxi; | ||
use std::env; | ||
|
||
fn main() { | ||
dotenv::dotenv().ok(); | ||
let api_key = env::var("API_KEY").expect("API_KEY not found"); | ||
let candle: cex::Candle = Datamaxi::new(api_key); | ||
|
||
// CEX Candle Exchanges | ||
match candle.exchanges("futures") { | ||
Ok(answer) => println!("{:?}", answer), | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
|
||
// CEX Candle Symbols | ||
let symbols_options = cex::SymbolsOptionalParams::new(); | ||
let symbols_response = candle.symbols("binance", symbols_options); | ||
match symbols_response { | ||
Ok(answer) => match serde_json::to_string(&answer) { | ||
Ok(json) => println!("{}", json), | ||
Err(e) => println!("Error: {}", e), | ||
}, | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
|
||
// CEX Candle Intervals | ||
match candle.intervals("binance", "futures") { | ||
Ok(answer) => println!("{:?}", answer), | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
|
||
// CEX Candle Data | ||
let candle_options = cex::CandleOptionalParams::new(); | ||
let candle_response = candle.get("binance", "ETH-USDT", candle_options); | ||
match candle_response { | ||
Ok(answer) => match serde_json::to_string(&answer) { | ||
Ok(json) => println!("{}", json), | ||
Err(e) => println!("Error: {}", e), | ||
}, | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
use datamaxi::dex; | ||
use datamaxi::api::Datamaxi; | ||
use std::env; | ||
|
||
fn main() { | ||
dotenv::dotenv().ok(); | ||
let api_key = env::var("API_KEY").expect("API_KEY not found"); | ||
let candle: dex::Candle = Datamaxi::new(api_key); | ||
|
||
// DEX Candle Intervals | ||
match candle.intervals() { | ||
Ok(answer) => println!("{:?}", answer), | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
|
||
// DEX Candle Exchanges | ||
match candle.exchanges() { | ||
Ok(answer) => println!("{:?}", answer), | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
|
||
// DEX Candle Chains | ||
match candle.chains() { | ||
Ok(answer) => println!("{:?}", answer), | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
|
||
// DEX Candle Pools | ||
let pools_options = dex::PoolsOptionalParams::new(); | ||
let pools_response = candle.pools(pools_options); | ||
match pools_response { | ||
Ok(answer) => match serde_json::to_string(&answer) { | ||
Ok(json) => println!("{}", json), | ||
Err(e) => println!("Error: {}", e), | ||
}, | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
|
||
// DEX Candle Data | ||
let params = dex::CandleOptionalParams::new(); | ||
let candle_response = candle.get( | ||
"bsc_mainnet", | ||
"pancakeswap", | ||
"0xb24cd29e32FaCDDf9e73831d5cD1FFcd1e535423", | ||
params, | ||
); | ||
match candle_response { | ||
Ok(answer) => match serde_json::to_string(&answer) { | ||
Ok(json) => println!("{}", json), | ||
Err(e) => println!("Error: {}", e), | ||
}, | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
use datamaxi::dex; | ||
use datamaxi::api::Datamaxi; | ||
use std::env; | ||
|
||
fn main() { | ||
dotenv::dotenv().ok(); | ||
let api_key = env::var("API_KEY").expect("API_KEY not found"); | ||
let trade: dex::Trade = Datamaxi::new(api_key); | ||
|
||
// DEX Trade Exchanges | ||
match trade.exchanges() { | ||
Ok(answer) => println!("{:?}", answer), | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
|
||
// DEX Trade Chains | ||
match trade.chains() { | ||
Ok(answer) => println!("{:?}", answer), | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
|
||
// DEX Trade Pools | ||
let pools_options = dex::PoolsOptionalParams::new(); | ||
let pools_response = trade.pools(pools_options); | ||
match pools_response { | ||
Ok(answer) => match serde_json::to_string(&answer) { | ||
Ok(json) => println!("{}", json), | ||
Err(e) => println!("Error: {}", e), | ||
}, | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
|
||
// DEX Trade Data | ||
let trade_options = dex::TradeOptionalParams::new(); | ||
let trade_response = trade.get( | ||
"bsc_mainnet", | ||
"pancakeswap", | ||
"0xb24cd29e32FaCDDf9e73831d5cD1FFcd1e535423", | ||
trade_options | ||
); | ||
match trade_response { | ||
Ok(answer) => match serde_json::to_string(&answer) { | ||
Ok(json) => println!("{}", json), | ||
Err(e) => println!("Error: {}", e), | ||
}, | ||
Err(e) => println!("Error: {}", e), | ||
} | ||
} |
Oops, something went wrong.