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
use crate::TokenId;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct HostItem {
	pub cml_id: u64,
	pub host_height: u64,
	pub performance: u64,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct AccountBalance {
	pub tea_balance: String,
	pub token_balance: String,
	pub reserved_token_balance: String,
	pub allowance: String,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct TappItem {
	pub tapp_id: TokenId,
	pub name: String,
	pub owner: String,
	pub ticker: String,
	pub detail: String,
	pub link: String,
	pub max_allowed_hosts: u32,
	pub min_allowed_hosts: u32,
	pub tapp_type: String,
	pub created_timestamp: u64,
	pub billing_mode: String,
	pub buy_curve_k: u32,
	pub sell_curve_k: u32,
	pub hosting_amount: u32,
	pub status: String,
	pub start_height: u64,
	pub hosts: Vec<HostItem>,
	pub consume_account_balance: String,

	pub total_supply: String,
	pub buy_price: String,
	pub sell_price: String,

	pub account_balance: AccountBalance,
	pub cid: String,
}

impl TappItem {
	pub fn get_name(&self) -> &str {
		&self.name
	}
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct LeaderboardItem {
	pub address: String,
	pub init_asset_add: String,
	pub init_asset_sub: String,
	pub tea_balance: String,
	pub tea_deposit: String,
	pub seat_asset: String,
	pub token_asset: String,
	pub ref_code: Option<String>,
	pub email: Option<String>,
	pub telegram: Option<String>,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct SeedAuctionItem {
	pub cml_key: String,
	pub uri: String,
	pub status: String,
	pub create_at: String,

	pub latest_bidder: Option<String>,
	pub latest_price: Option<String>,
	pub bid_at: Option<String>,
	pub sold_at: Option<String>,

	pub base_price: String,
	pub step_price: String,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct TappMetaData {
	pub name: String,
	pub owner: String,
	pub ticker: String,
	pub detail: String,
	pub link: String,
	pub tapp_type: String,
	pub cid: String,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct TxnGasFeeItem {
	pub txn_name: String,
	pub fee: String,
}