1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Ethereal Exchange API
*
* Ethereal HTTP API for real-time trading, order management, and market data access.
*
* The version of the OpenAPI document: 0.1.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MarketLiquidityDto {
/// Most recent book update, created timestamp if never updated (ms since Unix Epoch)
#[serde(rename = "timestamp")]
pub timestamp: f64,
/// Previous book update, undefined if never updated (ms since Unix Epoch)
#[serde(rename = "previousTimestamp", skip_serializing_if = "Option::is_none")]
pub previous_timestamp: Option<f64>,
/// Id representing the product
#[serde(rename = "productId")]
pub product_id: uuid::Uuid,
/// An array of ask tuple pairs (price, quantity) ordered in asc
#[serde(rename = "asks")]
pub asks: Vec<Vec<serde_json::Value>>,
/// An array of bid tuple pairs (price, quantity) ordered in desc
#[serde(rename = "bids")]
pub bids: Vec<Vec<serde_json::Value>>,
}
impl MarketLiquidityDto {
pub fn new(
timestamp: f64,
product_id: uuid::Uuid,
asks: Vec<Vec<serde_json::Value>>,
bids: Vec<Vec<serde_json::Value>>,
) -> MarketLiquidityDto {
MarketLiquidityDto {
timestamp,
previous_timestamp: None,
product_id,
asks,
bids,
}
}
}