binance-standard-sdk 0.1.1

Binance SDK, A wrapper for the Binance API.
Documentation
use serde::{Deserialize, Serialize};

use crate::types::{time::TimeInForce, trade::TradeSide, work::WorkingType};

/// order type
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum OrderType {
    LIMIT,
    MARKET,
    STOP,
    STOP_MARKET,
    TAKE_PROFIT,
    TAKE_PROFIT_MARKET,
    TRAILING_STOP_MARKET,
}

/// position direction
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum PositionSide {
    BOTH,
    LONG,
    SHORT,
}

/// order response
#[derive(Debug, Clone, Deserialize)]
pub struct OrderResponse {
    pub client_order_id: String,
    pub cum_qty: String,
    pub cum_quote: String,
    pub executed_qty: String,
    pub order_id: u64,
    pub avg_price: String,
    pub orig_qty: String,
    pub price: String,
    pub reduce_only: bool,
    pub side: TradeSide,
    pub position_side: PositionSide,
    pub status: OrderStatus,
    pub stop_price: String,
    pub close_position: bool,
    pub symbol: String,
    pub time_in_force: TimeInForce,
    #[serde(rename = "type")]
    pub order_type: OrderType,
    pub orig_type: OrderType,
    pub activate_price: String,
    pub price_rate: String,
    pub update_time: u64,
    pub working_type: WorkingType,
    pub price_protect: bool,
}

/// order status
#[derive(Debug, Clone, Deserialize)]
pub enum OrderStatus {
    NEW,
    PARTIALLY_FILLED,
    FILLED,
    CANCELED,
    REJECTED,
    EXPIRED,
}

/// order book
#[derive(Debug, Clone, Deserialize)]
pub struct OrderBook {
    pub last_update_id: u64,
    pub bids: Vec<(String, String)>,
    pub asks: Vec<(String, String)>,
}