26 releases (stable)

1.3.3 Jan 19, 2024
1.3.2 May 15, 2023
1.3.1 Jan 25, 2023
1.2.1 Dec 19, 2022
1.0.0-beta.3 Jul 30, 2021

#1136 in Magic Beans

Download history 39/week @ 2023-12-04 22/week @ 2023-12-11 57/week @ 2023-12-18 8/week @ 2023-12-25 38/week @ 2024-01-01 14/week @ 2024-01-08 90/week @ 2024-01-15 32/week @ 2024-01-22 20/week @ 2024-01-29 22/week @ 2024-02-05 129/week @ 2024-02-12 148/week @ 2024-02-19 83/week @ 2024-02-26 130/week @ 2024-03-04 99/week @ 2024-03-11 151/week @ 2024-03-18

494 downloads per month
Used in 2 crates

MIT/Apache

270KB
5.5K SLoC

binance-rs-async

Unofficial Rust Library for the Binance API

This is a fully async api using tokio.

Current state

The current beta aims at implementing every single endpoint on the binance docs. Currently, futures and savings have been implemented but not thoroughly tested.

Usage

Add this to your Cargo.toml

[dependencies]
binance-rs-async = "1.3.2"

Roadmap

  • 1.0.0 Completely tested margin sapi endpoints
  • 1.0.* Changelog check to detect binance API changes
  • 1.1.* Wallet API
  • 1.2.* to 1.3.* Continuous updates for wallet and margin APIs
  • 1.4.* Complete tested futures (m-coin and usd-m futures)

Breaking changes

  • 1.3.0 introduces optional fields for MarginOrderCancellationResult instead of definitely set fields

Risk Warning

It is a personal project, use at your own risk. I will not be responsible for your investment losses. Cryptocurrency investment is subject to high market risk. Nonetheless, this crate is aimed at high performance and production use, I have been using this to target Binance successfully for several years now.

Using TLS

By default, the crate uses native-tls for tungstenite and reqwest because I believe it's simpler and faster to let the user switch LibreSSL or OpenSSL versions rather than rebuild the program.

You can however disable default-features and use rust-tls, which might be helpful in certain situations such as CI or dev box.

Rust >= 1.37

rustup install stable

Cargo dependencies

cargo install cargo-semver-checks

Checking documentation and release

cargo semver-checks check-release --package binance-rs-async --verbose

Contribution

Simply create a pull request. Properly documented code and tests (using binance testnet) are a must.

Running github actions locally :

# Example that runs the make-release-pr workflow 
act -P ubuntu-latest=cimg/rust:1.66.1-node workflow_dispatch -j make-release-pr --eventpath release.json --secret-file=secrets

Dependencies

~13–29MB
~553K SLoC