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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AddressCoinsTransactionUnconfirmedDataItem {
#[serde(rename = "blockchain")]
pub blockchain: String,
#[serde(rename = "network")]
pub network: String,
#[serde(rename = "address")]
pub address: String,
#[serde(rename = "transactionId")]
pub transaction_id: String,
#[serde(rename = "amount")]
pub amount: String,
#[serde(rename = "unit")]
pub unit: Unit,
#[serde(rename = "direction")]
pub direction: Direction,
#[serde(rename = "firstSeenInMempoolTimestamp")]
pub first_seen_in_mempool_timestamp: i32,
}
impl AddressCoinsTransactionUnconfirmedDataItem {
pub fn new(blockchain: String, network: String, address: String, transaction_id: String, amount: String, unit: Unit, direction: Direction, first_seen_in_mempool_timestamp: i32) -> AddressCoinsTransactionUnconfirmedDataItem {
AddressCoinsTransactionUnconfirmedDataItem {
blockchain,
network,
address,
transaction_id,
amount,
unit,
direction,
first_seen_in_mempool_timestamp,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Unit {
#[serde(rename = "btc")]
Btc,
#[serde(rename = "satoshi")]
Satoshi,
#[serde(rename = "wei")]
Wei,
#[serde(rename = "gwei")]
Gwei,
#[serde(rename = "eth")]
Eth,
#[serde(rename = "doge")]
Doge,
#[serde(rename = "dash")]
Dash,
#[serde(rename = "etc")]
Etc,
#[serde(rename = "xrp")]
Xrp,
#[serde(rename = "zil")]
Zil,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Direction {
#[serde(rename = "incoming")]
Incoming,
#[serde(rename = "outgoing")]
Outgoing,
}