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
// use serde::{Deserialize, Serialize};
//
// #[derive(Serialize, Deserialize, Debug)]
// pub struct ApiResponse {
// jsonrpc: String,
// result: BlockResult,
// id: i32,
// }
//
// #[derive(Serialize, Deserialize, Debug)]
// struct BlockResult {
// block_hash: String,
// confirmed_transaction_list: Vec<Transaction>,
// height: i64,
// merkle_tree_root_hash: String,
// peer_id: String,
// prev_block_hash: String,
// signature: String,
// time_stamp: i64,
// version: String,
// }
//
// // Assuming transactions can be of different types, you might define an enum for them
// // For simplicity, I'll treat them as a single type here
// #[derive(Serialize, Deserialize, Debug)]
// #[serde(tag = "dataType", rename_all = "camelCase")]
// enum Transaction {
// Base {
// data: TransactionData,
// timestamp: String,
// txHash: String,
// version: String,
// },
// // Other types of transactions can be added here
// }
//
// #[derive(Serialize, Deserialize, Debug)]
// struct TransactionData {
// result: TransactionResult,
// }
//
// #[derive(Serialize, Deserialize, Debug)]
// #[serde(tag = "dataType", rename_all = "camelCase")]
// struct TransactionResult {
// covered_by_fee: String,
// covered_by_over_issued_ICX: String,
// issue: String,
// }