types: move fiat currency list to types

This commit is contained in:
c9s 2021-06-10 18:51:13 +08:00
parent fd2928fc82
commit 2614b25de3
2 changed files with 4 additions and 3 deletions

View File

@ -16,8 +16,6 @@ import (
"github.com/c9s/bbgo/pkg/util" "github.com/c9s/bbgo/pkg/util"
) )
var fiatCurrencies = []string{"USDC", "USDT", "USD", "TWD", "EUR", "GBP", "BUSD"}
type StandardIndicatorSet struct { type StandardIndicatorSet struct {
Symbol string Symbol string
// Standard indicators // Standard indicators
@ -589,7 +587,7 @@ func (session *ExchangeSession) FindPossibleSymbols() (symbols []string, err err
var balances = session.Account.Balances() var balances = session.Account.Balances()
var fiatAssets []string var fiatAssets []string
for _, currency := range fiatCurrencies { for _, currency := range types.FiatCurrencies {
if balance, ok := balances[currency]; ok && balance.Total() > 0 { if balance, ok := balances[currency]; ok && balance.Total() > 0 {
fiatAssets = append(fiatAssets, currency) fiatAssets = append(fiatAssets, currency)
} }

View File

@ -5,3 +5,6 @@ import "github.com/leekchan/accounting"
var USD = accounting.Accounting{Symbol: "$ ", Precision: 2} var USD = accounting.Accounting{Symbol: "$ ", Precision: 2}
var BTC = accounting.Accounting{Symbol: "BTC ", Precision: 2} var BTC = accounting.Accounting{Symbol: "BTC ", Precision: 2}
var BNB = accounting.Accounting{Symbol: "BNB ", Precision: 4} var BNB = accounting.Accounting{Symbol: "BNB ", Precision: 4}
var FiatCurrencies = []string{"USDC", "USDT", "USD", "TWD", "EUR", "GBP", "BUSD"}