mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
types: add IsUSDFiatCurrency helper
This commit is contained in:
parent
99121d19c0
commit
dce64871e8
|
@ -1,10 +1,12 @@
|
|||
package types
|
||||
|
||||
import "math/big"
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
import "github.com/leekchan/accounting"
|
||||
"github.com/leekchan/accounting"
|
||||
|
||||
import "github.com/c9s/bbgo/pkg/fixedpoint"
|
||||
"github.com/c9s/bbgo/pkg/fixedpoint"
|
||||
)
|
||||
|
||||
type Acc = accounting.Accounting
|
||||
|
||||
|
@ -24,6 +26,17 @@ var BNB = wrapper{accounting.Accounting{Symbol: "BNB ", Precision: 4}}
|
|||
|
||||
var FiatCurrencies = []string{"USDC", "USDT", "USD", "TWD", "EUR", "GBP", "BUSD"}
|
||||
|
||||
var USDFiatCurrencies = []string{"USDT", "USDC", "USD", "BUSD"}
|
||||
|
||||
func IsUSDFiatCurrency(currency string) bool {
|
||||
for _, c := range USDFiatCurrencies {
|
||||
if c == currency {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func IsFiatCurrency(currency string) bool {
|
||||
for _, c := range FiatCurrencies {
|
||||
if c == currency {
|
||||
|
|
Loading…
Reference in New Issue
Block a user