Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertCurrency(amount float64, from, to string) (float64, error)
- func GetExchangeRates() map[string]float64
- func IsCryptoFiatPair(p pair.CurrencyPair) bool
- func IsCryptoPair(p pair.CurrencyPair) bool
- func IsCryptocurrency(currency string) bool
- func IsDefaultCryptocurrency(currency string) bool
- func IsDefaultCurrency(currency string) bool
- func IsFiatCurrency(currency string) bool
- func IsFiatPair(p pair.CurrencyPair) bool
- func SeedCurrencyData(currencies string) error
- func SetDefaults()
- func Update(input []string, cryptos bool)
Constants ¶
const ( // DefaultBaseCurrency is the base currency used for conversion DefaultBaseCurrency = "USD" // DefaultCurrencies has the default minimum of FIAT values DefaultCurrencies = "USD,AUD,EUR,CNY" // DefaultCryptoCurrencies has the default minimum of crytpocurrency values DefaultCryptoCurrencies = "BTC,LTC,ETH,DOGE,DASH,XRP,XMR" )
Variables ¶
var ( FXRates map[string]float64 FiatCurrencies []string CryptoCurrencies []string BaseCurrency string FXProviders *forexprovider.ForexProviders )
Manager is the overarching type across this package
Functions ¶
func ConvertCurrency ¶
ConvertCurrency for example converts $1 USD to the equivalent Japanese Yen or vice versa.
func GetExchangeRates ¶
GetExchangeRates returns the currency exchange rates
func IsCryptoFiatPair ¶
func IsCryptoFiatPair(p pair.CurrencyPair) bool
IsCryptoFiatPair checks to see if the pair is a crypto fiat pair e.g. BTCUSD
func IsCryptoPair ¶
func IsCryptoPair(p pair.CurrencyPair) bool
IsCryptoPair checks to see if the pair is a crypto pair e.g. BTCLTC
func IsCryptocurrency ¶
IsCryptocurrency checks if the currency passed is an enabled CRYPTO currency.
func IsDefaultCryptocurrency ¶
IsDefaultCryptocurrency checks if the currency passed in matches the default cryptocurrency
func IsDefaultCurrency ¶
IsDefaultCurrency checks if the currency passed in matches the default fiat currency
func IsFiatCurrency ¶
IsFiatCurrency checks if the currency passed is an enabled fiat currency
func IsFiatPair ¶
func IsFiatPair(p pair.CurrencyPair) bool
IsFiatPair checks to see if the pair is a fiat pair e.g. EURUSD
func SeedCurrencyData ¶
SeedCurrencyData returns rates correlated with suported currencies
func SetDefaults ¶
func SetDefaults()
SetDefaults sets the default currency provider and settings for currency conversion used outside of the bot setting
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package forexprovider utilises foreign exchange API services to manage relational FIAT currencies
|
Package forexprovider utilises foreign exchange API services to manage relational FIAT currencies |
Package pair is a generated protocol buffer package.
|
Package pair is a generated protocol buffer package. |