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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
use serde::{Serialize, Deserialize};

#[derive(Deserialize, Debug)]
pub struct ValidateAddress {
    #[serde(rename(deserialize = "isvalid"))]
    pub is_valid: bool,
}

#[derive(Deserialize, Debug)]
pub struct MarketInfo {
    pub rate: f64,
    #[serde(rename(deserialize = "minerFee"))]
    pub miner_fee: f64,
    pub limit: f64,
    pub minimum: f64,
    #[serde(rename(deserialize = "maxLimit"))]
    pub max_limit: f64
}

#[derive(Deserialize, Debug)]
pub struct ExchangeLimit {
    pub limit: f64,
    pub minimum: f64,
}

#[derive(Debug, Deserialize)]
pub struct Etherscan<T> {
    pub status: String,
    pub message: String,
    pub result: T,
}

#[derive(Debug, Deserialize)]
pub struct EthBalance {
    pub account: String,
    pub balance: String,
}

#[derive(Debug, Deserialize)]
pub struct  EthPrice {
    pub ethbtc: String,
    pub ethbtc_timestamp: String,
    pub ethusd: String,
    pub ethusd_timestamp: String
}

#[derive(Debug, Deserialize)]
pub struct EthTransaction {
    #[serde(rename = "blockNumber")]
    pub block_number: String,
    #[serde(rename = "timeStamp")]
    pub time_stamp: String,
    pub hash: String,
    pub nonce: String,
    #[serde(rename = "blockHash")]
    pub block_hash: String,
    #[serde(rename = "transactionIndex")]
    pub transaction_index: String,
    pub from: String,
    pub to: String,
    pub value: String,
    pub gas: String,
    #[serde(rename = "gasPrice")]
    pub gas_price: String,
    #[serde(rename = "isError")]
    pub is_error: String,
    pub txreceipt_status: String,
    pub input: String,
    #[serde(rename = "contractAddress")]
    pub contract_address: String,
    #[serde(rename = "cumulativeGasUsed")]
    pub cumulative_gas_used: String,
    #[serde(rename = "gasUsed")]
    pub gas_used: String,
    pub confirmations: String,
}
#[derive(Debug, Deserialize)]
pub struct EthTransactionHash {
    #[serde(rename = "blockHash")]
    pub block_hash: String,
    #[serde(rename = "blockNumber")]
    pub block_number: String,
    pub from: String,
    pub gas: String,
    #[serde(rename = "gasPrice")]
    pub gas_price: String,
    pub hash: String,
    pub input: String,
    pub nonce: String,
    pub to: String,
    #[serde(rename = "transactionIndex")]
    pub transaction_index: String,
    pub value: String,
    pub v: String,
    pub r: String,
    pub s: String,
}

#[derive(Debug, Deserialize)]
pub struct EthTransactionnReceipt {
    #[serde(rename = "blockHash")]
    pub block_hash: String,
    #[serde(rename = "blockNumber")]
    pub block_number: String,
    #[serde(rename = "contractAddress")]
    pub contract_address: Option<serde_json::Value>,
    #[serde(rename = "cumulativeGasUsed")]
    pub cumulative_gas_used: String,
    pub from: String,
    #[serde(rename = "gasUsed")]
    pub gas_used: String,
    #[serde(rename = "Ethlogs")]
    pub ethlogs: Vec<Ethlog>,
    #[serde(rename = "logsBloom")]
    pub logs_bloom: String,
    pub root: String,
    pub to: String,
    #[serde(rename = "transactionHash")]
    pub transaction_hash: String,
    #[serde(rename = "transactionIndex")]
    pub transaction_index: String,
}

#[derive(Debug, Deserialize)]
pub struct Ethlog {
    pub address: String,
    pub topics: Vec<String>,
    pub data: String,
    #[serde(rename = "blockNumber")]
    pub block_number: String,
    #[serde(rename = "transactionHash")]
    pub transaction_hash: String,
    #[serde(rename = "transactionIndex")]
    pub transaction_index: String,
    #[serde(rename = "blockHash")]
    pub block_hash: String,
    #[serde(rename = "logIndex")]
    pub log_index: String,
    pub removed: bool,
}

#[derive(Debug, Deserialize)]
pub struct EthBlockByNumber {
    pub difficulty: String,
    #[serde(rename = "extraData")]
    pub extra_data: String,
    #[serde(rename = "gasLimit")]
    pub gas_limit: String,
    #[serde(rename = "gasUsed")]
    pub gas_used: String,
    pub hash: String,
    #[serde(rename = "logsBloom")]
    pub logs_bloom: String,
    pub miner: String,
    #[serde(rename = "mixHash")]
    pub mix_hash: String,
    pub nonce: String,
    pub number: String,
    #[serde(rename = "parentHash")]
    pub parent_hash: String,
    #[serde(rename = "receiptsRoot")]
    pub receipts_root: String,
    #[serde(rename = "sha3Uncles")]
    pub sha3_uncles: String,
    pub size: String,
    #[serde(rename = "stateRoot")]
    pub state_root: String,
    pub timestamp: String,
    #[serde(rename = "totalDifficulty")]
    pub total_difficulty: Option<serde_json::Value>,
    #[serde(rename = "transactionsRoot")]
    pub transactions_root: String,
    pub uncles: Vec<Option<serde_json::Value>>,
}