Skip to main content

openlimits_binance/model/
trade_history.rs

1use serde::Deserialize;
2use serde::Serialize;
3use rust_decimal::prelude::Decimal;
4use super::shared::string_to_decimal;
5
6/// This struct represents a trade history
7#[derive(Debug, Serialize, Deserialize, Clone)]
8#[serde(rename_all = "camelCase")]
9pub struct TradeHistory {
10    pub symbol: String,
11    pub id: u64,
12    pub order_id: u64,
13    #[serde(with = "string_to_decimal")]
14    pub price: Decimal,
15    #[serde(with = "string_to_decimal")]
16    pub qty: Decimal,
17    #[serde(with = "string_to_decimal")]
18    pub commission: Decimal,
19    pub commission_asset: String,
20    pub time: u64,
21    pub is_buyer: bool,
22    pub is_maker: bool,
23    pub is_best_match: bool,
24}