1 unstable release
0.1.0 | Oct 26, 2022 |
---|
#3 in #luno
19KB
460 lines
Luno-rs (async)
The Luno API wrapper written in rust of rust in rust prorgram https://www.luno.com/en/developers/api.
Dependencies
- reqwest
- serde
- serde_json
- tokio
Configuration
- Add to Cargo.toml
luno_rs = "0.1.1"
orluno_rs = { git="https://github.com/borngraced/luno-rs"}
- Get your api key and secret from luno.com
- Create .env file in your project route and configure with:
API_KEY=myapikey
API_SECRET=myapisecret
- import Luno client to your project and initialize
use luno_rs::Luno;
#[tokio::test] // any other async runtime can be used, not limited to tokio
async fn test_luno_async() {
dotenv::dotenv().ok();
let key = env::var("API_KEY").expect("Api Key doesn't exist yet, please add");
let secret = env::var("API_SECRET").expect("Api Key Secret doesn't exist yet, please add");
let luno = luno_rs::Luno::init(key, secret).await;
let balance = luno.get_all_balance().await;
assert!(tickers.is_ok());
let all_balance: Vec<Balance> = balance.unwrap();
print!("{balance:#?}")
}
Available METHODS regularly (more will be added until completion)
available endpoints
- create_account()
- get_all_balance()
- get_ticker(pair: "XBTNGN")
- get_all_tickers()
- get_full_order_book(pair: "XBTNGN")
- get_top_order_book(pair: "XBTNGN")
Todos
- update_account_name
- list_pending_transactions
- list_transactions
- list_account_balances
- list_recent_trades
- get_candles
- get_markets_info
- list_orders
- list_trades
- post_market_order
- get_order
- post_limit_order
- cancel_order
- get_receiver_address
- create_receiver_address
- send
- estimate_send_fee
- list_withdrawal_request
- request_a_withdrawal
- get_withdrawal_request
- cancel_withdrawal_request
- list_transfers
- list_eneficiaries
CONTRIBUTING
feel free to work on any of the todos:)
Dependencies
~6–21MB
~281K SLoC