From 2614b25de33f2f4f6349078ada8f5f91a527cd55 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 10 Jun 2021 18:51:13 +0800 Subject: [PATCH] types: move fiat currency list to types --- pkg/bbgo/session.go | 4 +--- pkg/types/currencies.go | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/bbgo/session.go b/pkg/bbgo/session.go index faf0aec23..19a855eec 100644 --- a/pkg/bbgo/session.go +++ b/pkg/bbgo/session.go @@ -16,8 +16,6 @@ import ( "github.com/c9s/bbgo/pkg/util" ) -var fiatCurrencies = []string{"USDC", "USDT", "USD", "TWD", "EUR", "GBP", "BUSD"} - type StandardIndicatorSet struct { Symbol string // Standard indicators @@ -589,7 +587,7 @@ func (session *ExchangeSession) FindPossibleSymbols() (symbols []string, err err var balances = session.Account.Balances() var fiatAssets []string - for _, currency := range fiatCurrencies { + for _, currency := range types.FiatCurrencies { if balance, ok := balances[currency]; ok && balance.Total() > 0 { fiatAssets = append(fiatAssets, currency) } diff --git a/pkg/types/currencies.go b/pkg/types/currencies.go index 6c6bfa305..ba8c65926 100644 --- a/pkg/types/currencies.go +++ b/pkg/types/currencies.go @@ -5,3 +5,6 @@ import "github.com/leekchan/accounting" var USD = accounting.Accounting{Symbol: "$ ", Precision: 2} var BTC = accounting.Accounting{Symbol: "BTC ", Precision: 2} var BNB = accounting.Accounting{Symbol: "BNB ", Precision: 4} + +var FiatCurrencies = []string{"USDC", "USDT", "USD", "TWD", "EUR", "GBP", "BUSD"} +