-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
structs.go
79 lines (71 loc) · 2.12 KB
/
structs.go
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
package main
import "time"
type Server struct {
Online bool `json:"online"`
HourHits int64 `json:"hour_requests"`
}
type Badge struct {
Coin string
Token string
Address string
FullAddress string
Balance string
Label string
Type string
Width int
Height int
LeftColor string
LeftSize int
LeftTextSize int
LeftTextX int
RightColor string
RightSize int
RightTextSize int
RightTextX int
error error
start time.Time
toCurrency bool
cache string
}
type TokenBalanceResponse struct {
Name string `json:"name"`
Wallet string `json:"wallet"`
Symbol string `json:"symbol"`
Balance string `json:"balance"`
EthBalance string `json:"eth_balance"`
Decimals int `json:"decimals"`
Block int `json:"block"`
}
type MarketRate struct {
Coin string
Symbol string
Price float64
}
type CoinMarketCapResponse struct {
Data map[string]*Ticker `json:"data,omitempty"`
Metadata struct {
Timestamp int64
NumCryptoCurrencies int `json:"num_cryptocurrencies,omitempty"`
Error string `json:",omitempty"`
}
}
type Ticker struct {
ID int `json:"id"`
Name string `json:"name"`
Symbol string `json:"symbol"`
Slug string `json:"website_slug"`
Rank int `json:"rank"`
CirculatingSupply float64 `json:"circulating_supply"`
TotalSupply float64 `json:"total_supply"`
MaxSupply float64 `json:"max_supply"`
Quotes map[string]*TickerQuote `json:"quotes"`
LastUpdated int `json:"last_updated"`
}
type TickerQuote struct {
Price float64 `json:"price"`
Volume24H float64 `json:"volume_24h"`
MarketCap float64 `json:"market_cap"`
PercentChange1H float64 `json:"percent_change_1h"`
PercentChange24H float64 `json:"percent_change_24h"`
PercentChange7D float64 `json:"percent_change_7d"`
}