forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
currency_types.go
77 lines (67 loc) · 2.21 KB
/
currency_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
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
package currency
import (
"time"
"github.com/thrasher-corp/gocryptotrader/currency/coinmarketcap"
)
// MainConfiguration is the main configuration from the config.json file
type MainConfiguration struct {
ForexProviders []FXSettings
CryptocurrencyProvider coinmarketcap.Settings
Cryptocurrencies Currencies
CurrencyPairFormat interface{}
FiatDisplayCurrency Code
CurrencyDelay time.Duration
FxRateDelay time.Duration
}
// BotOverrides defines a bot overriding factor for quick running currency
// subsystems
type BotOverrides struct {
Coinmarketcap bool
FxCurrencyConverter bool
FxCurrencyLayer bool
FxFixer bool
FxOpenExchangeRates bool
FxExchangeRateHost bool
}
// CoinmarketcapSettings refers to settings
type CoinmarketcapSettings coinmarketcap.Settings
// SystemsSettings defines incoming system settings
type SystemsSettings struct {
Coinmarketcap coinmarketcap.Settings
Currencyconverter FXSettings
Currencylayer FXSettings
Fixer FXSettings
Openexchangerates FXSettings
}
// FXSettings defines foreign exchange requester settings
type FXSettings struct {
Name string `json:"name"`
Enabled bool `json:"enabled"`
Verbose bool `json:"verbose"`
RESTPollingDelay time.Duration `json:"restPollingDelay"`
APIKey string `json:"apiKey"`
APIKeyLvl int `json:"apiKeyLvl"`
PrimaryProvider bool `json:"primaryProvider"`
}
// File defines a full currency file generated by the currency storage
// analysis system
type File struct {
LastMainUpdate interface{} `json:"lastMainUpdate"`
Cryptocurrency []Item `json:"cryptocurrencies"`
FiatCurrency []Item `json:"fiatCurrencies"`
UnsetCurrency []Item `json:"unsetCurrencies"`
Contracts []Item `json:"contracts"`
Token []Item `json:"tokens"`
}
// Const here are packaged defined delimiters
const (
UnderscoreDelimiter = "_"
DashDelimiter = "-"
ForwardSlashDelimiter = "/"
ColonDelimiter = ":"
)
// delimiters is a delimiter list
var delimiters = []string{UnderscoreDelimiter,
DashDelimiter,
ForwardSlashDelimiter,
ColonDelimiter}