crypto_trading

Crates.iocrypto_trading
lib.rscrypto_trading
version0.2.2
created_at2025-05-02 05:50:57.810808+00
updated_at2025-06-29 08:41:58.463173+00
descriptionEasy Binance API Wrapping Crate
homepage
repositoryhttps://github.com/wangki-kyu/crypto_trading
max_upload_size
id1657303
size98,242
wangki-kyu (wangki-kyu)

documentation

README

crypto_trading

crypto_trading is a wrapping library that allows you to easily use Binance's price information and various APIs.

Getting Started

you need to set up a .env file.

  1. Make .env file
  2. Setting BINANCE_SECRET_KEY and BINANCE_API_KEY
  3. You add the dotenv crate dependency.
  4. Set the main statement as follows.
    dotenv::dotenv().ok();
    

example

use crypto_trading::{adapter::common::BinanceCommon, port::binance_port::CommonPort};

#[tokio::main]
async fn main() {
    dotenv::dotenv().ok();

    let binance_common = BinanceCommon::new();
    let klines = binance_common.get_kline("BTCUSDT", "1m", None).await.unwrap();

    println!("{:?}", klines);
}

Can API

Refer to the Binance API site. https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info

  1. common
    • kline data
  2. trade
    • change leverage
  3. users
    • get_account_balance

In the future, i will develop a way to wrap various APIs so that they can be used easily.

Commit count: 6

cargo fmt