rust_upbit_api

Crates.iorust_upbit_api
lib.rsrust_upbit_api
version1.0.5
sourcesrc
created_at2023-06-22 12:36:41.418857
updated_at2023-06-25 03:33:01.726695
descriptionrust_upbit_api
homepage
repository
max_upload_size
id897286
size65,802
loldruger (loldruger)

documentation

README

upbit-api on rust

this crate is dependant on sqlx, tokio, postgres this crate also requires openssl-sys package

Set access key and secret key

use rust_upbit_api::*;

rust_upbit_api::set_access_key("");
rust_upbit_api::set_secret_key("");

Apis

use rust_upbit_api::*;

let asdf = api::get_order_state(None, None).await.unwrap();
let asdf = api::order_by_price("KRW-ETH", OrdSide::BID, 5000.0, 1_435_085.0, OrdType::LIMIT, None).await.unwrap();

let asdf = api::OrderbookInfo::get_orderbook_info("KRW-ETH").await;
let asdf = api::TickerSnapshot::request("KRW-ETH").await;
let asdf = api::TradeRecent::request("KRW-ETH", None, 3, "0".to_string(), None).await;
let asdf = api::MarketState::request(true).await;

let asdf = api::CandleChartMinute::request_candle("KRW-ETH", None, 50, CandleMinute::Min10).await.unwrap();
let asdf = api::CandleChartDay::request_candle("KRW-ETH", 10, None, None).await;
let asdf = api::CandleChartWeek::request_candle("KRW-ETH", 10, None).await;

Problem

If you have trouble installing with this error: failed to run custom build command for openssl-sys vX.X.XX,

try

macOS
$ brew install openssl@1.1

Arch Linux
$ sudo pacman -S pkg-config openssl

Debian and Ubuntu
$ sudo apt-get install pkg-config libssl-dev

Fedora
$ sudo dnf install pkg-config openssl-devel

referenced from https://github.com/sfackler/rust-openssl/issues/855#issuecomment-450057552

Commit count: 0

cargo fmt