upbit-api on rust, with upbit api v1.3.4
this crate is dependant on tokio
it also requires openssl-sys
package
```rust use upbit::*;
upbit::setaccesskey(""); upbit::setsecretkey(""); ```
```rust use upbit::*;
// apiexchange let accountinfo = apiexchange::getaccountinfo().await; let orderchance = apiexchange::getorderchance("KRW-ETH").await; let orderstatus = apiexchange::getorderstatus(None, None).await; let orderstatuslist = apiexchange::getorderstatus_list().await;
let orderinfo = apiexchange::orderbyprice("KRW-ETH", OrderSide::BID, 5000.0, 1435085.0, OrderType::LIMIT, None).await; let orderinfo = apiexchange::sellbymarketprice("KRW-ETH", 1.0, "cdd92199-2897-4e14-9448-f923320408ad").await; let orderinfo = apiexchange::cancelorder("cdd92199-2897-4e14-9448-f923320408ad").await;
// apiwithdraw let listwithdrawinfo = apiwithdraw::listwithdrawinfo().await;
// apiquotation let orderbookinfo = apiquotation::OrderbookInfo::getorderbookinfo("KRW-ETH").await; let tickersnapshot = apiquotation::TickerSnapshot::request("KRW-ETH").await; let recenttradelist = apiquotation::TradeRecent::request("KRW-ETH", None, 3, "0".tostring(), None).await; let marketstate = apiquotation::MarketState::request(true).await;
let chartofminute = apiquotation::requestcandle("KRW-ETH", None, 50, CandleMinute::Min10).await; let chartofday = apiquotation::requestcandle("KRW-ETH", 10, None, None).await; let chartofweek = apiquotation::requestcandle("KRW-ETH", 10, None).await; let chartofmonth = apiquotation::requestcandle("KRW-ETH", 10, None).await;
```
openssl-sys vX.X.XX
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