/
types.go
46 lines (40 loc) · 1.28 KB
/
types.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
package pricefeed
// Asset struct
type Asset struct {
Symbol string
Price float64
TargetMarketCode string
}
// CoinGeckoTickers struct
type CoinGeckoTickers struct {
Name string `json:"name"`
Tickers []CoinGeckoTicker `json:"tickers"`
}
// CoinGeckoTicker struct
type CoinGeckoTicker struct {
Base string `json:"base"`
Target string `json:"target"`
Market CoinGeckoMarket `json:"market"`
Last float64 `json:"last"`
CoinID string `json:"coin_id"`
}
// CoinGeckoMarket struct
type CoinGeckoMarket struct {
Name string `json:"name"`
Identifier string `json:"identifier"`
HasTradingIncentive bool `json:"has_trading_incentive"`
CoinID string `json:"coin_id"`
}
// MarketsRes struct
type MarketsRes struct {
Height string `json:"height"`
Result []string `json:"result"`
}
// TODO: Replace MarketRes once cli query result has been fixed to no longer be a string
// type MarketRes struct {
// MarketID string `json:"market_id" yaml:"market_id"`
// BaseAsset string `json:"base_asset" yaml:"base_asset"`
// QuoteAsset string `json:"quote_asset" yaml:"quote_asset"`
// Oracles string `json:"oracles" yaml:"oracles"`
// Active bool `json:"active" yaml:"active"`
// }