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
49
50
51
52
53
54
55
56
/*
* 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 SubaccountDto {
/// Id representing the registered subaccount
#[serde(rename = "id")]
pub id: uuid::Uuid,
/// Bytes32 encoded subaccount name (0x prefix, zero padded)
#[serde(rename = "name")]
pub name: String,
/// Address of the account which registered the subaccount (non-checksummed)
#[serde(rename = "account")]
pub account: String,
/// Block number this subaccount was created on
#[serde(rename = "createdBlockNumber")]
pub created_block_number: String,
/// Block number this subaccount was registered on
#[serde(
rename = "registeredBlockNumber",
skip_serializing_if = "Option::is_none"
)]
pub registered_block_number: Option<String>,
/// Subaccount creation timestamp (ms since Unix Epoch)
#[serde(rename = "createdAt")]
pub created_at: f64,
}
impl SubaccountDto {
pub fn new(
id: uuid::Uuid,
name: String,
account: String,
created_block_number: String,
created_at: f64,
) -> SubaccountDto {
SubaccountDto {
id,
name,
account,
created_block_number,
registered_block_number: None,
created_at,
}
}
}