mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-20 15:10:10 +00:00
* currency: Add pair matching update (cherry-pick) * exchange/currency: Add tests and update func * linter fix, also if using json unmarshal functionality stop usage of string conversion without delimiter * gemini: fix test * currency/manager: potential optimisation * exchanges: purge derive from wrapper cases and add warning comment * glorious: nits * glorious: nits * linter: fix * glorious: nits * whoops * whoops * glorious: nits continued * glorious: diff THANKS! * hitbtc: fix update tradable pairs strings splitting. continue if not enabled tickers update pair. * glorious: nits * linter: fix * Update exchanges/exmo/exmo_wrapper.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * bitstamp: fix test when 32 biterinos architecturinos * capture more strings for speed * swapsies because whos running 32bit \0/? --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
84 lines
2.6 KiB
Go
84 lines
2.6 KiB
Go
package currency
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/thrasher-corp/gocryptotrader/currency/coinmarketcap"
|
|
)
|
|
|
|
// Config holds all the information needed for currency related manipulation
|
|
type Config struct {
|
|
ForexProviders AllFXSettings `json:"forexProviders"`
|
|
CryptocurrencyProvider Provider `json:"cryptocurrencyProvider"`
|
|
CurrencyPairFormat *PairFormat `json:"currencyPairFormat"`
|
|
FiatDisplayCurrency Code `json:"fiatDisplayCurrency"`
|
|
CurrencyFileUpdateDuration time.Duration `json:"currencyFileUpdateDuration"`
|
|
ForeignExchangeUpdateDuration time.Duration `json:"foreignExchangeUpdateDuration"`
|
|
}
|
|
|
|
// Provider defines coinmarketcap tools
|
|
type Provider struct {
|
|
Name string `json:"name"`
|
|
Enabled bool `json:"enabled"`
|
|
Verbose bool `json:"verbose"`
|
|
APIKey string `json:"apiKey"`
|
|
AccountPlan string `json:"accountPlan"`
|
|
}
|
|
|
|
// BotOverrides defines a bot overriding factor for quick running currency
|
|
// subsystems
|
|
type BotOverrides struct {
|
|
Coinmarketcap bool
|
|
CurrencyConverter bool
|
|
CurrencyLayer bool
|
|
ExchangeRates bool
|
|
Fixer bool
|
|
OpenExchangeRates bool
|
|
ExchangeRateHost 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
|
|
}
|
|
|
|
// AllFXSettings defines all the foreign exchange settings
|
|
type AllFXSettings []FXSettings
|
|
|
|
// FXSettings defines foreign exchange requester settings
|
|
type FXSettings struct {
|
|
Name string `json:"name"`
|
|
Enabled bool `json:"enabled"`
|
|
Verbose bool `json:"verbose"`
|
|
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"`
|
|
Stable []*Item `json:"stableCurrencies"`
|
|
}
|
|
|
|
// Const here are packaged defined delimiters
|
|
const (
|
|
UnderscoreDelimiter = "_"
|
|
DashDelimiter = "-"
|
|
ForwardSlashDelimiter = "/"
|
|
ColonDelimiter = ":"
|
|
)
|