diff --git a/cmd/exchange_wrapper_issues/main.go b/cmd/exchange_wrapper_issues/main.go index 13692c6b..2ab22a29 100644 --- a/cmd/exchange_wrapper_issues/main.go +++ b/cmd/exchange_wrapper_issues/main.go @@ -1139,10 +1139,7 @@ func disruptFormatting(p currency.Pair) (currency.Pair, error) { if p.Base.IsEmpty() { return currency.EMPTYPAIR, errors.New("cannot disrupt formatting as base is not populated") } - if p.Quote.IsEmpty() { - return currency.EMPTYPAIR, errors.New("cannot disrupt formatting as quote is not populated") - } - + // NOTE: Quote can be empty for margin funding return currency.Pair{ Base: p.Base.Upper(), Quote: p.Quote.Lower(), diff --git a/cmd/exchange_wrapper_issues/wrapperconfig.json b/cmd/exchange_wrapper_issues/wrapperconfig.json index c66b32f2..c8f0d8d6 100644 --- a/cmd/exchange_wrapper_issues/wrapperconfig.json +++ b/cmd/exchange_wrapper_issues/wrapperconfig.json @@ -39,6 +39,11 @@ "secret": "Secret", "otpSecret": "-" }, + "binanceus": { + "key": "Key", + "secret": "Secret", + "otpSecret": "-" + }, "bitfinex": { "key": "Key", "secret": "Secret", @@ -80,6 +85,11 @@ "secret": "Secret", "otpSecret": "-" }, + "bybit": { + "key": "Key", + "secret": "Secret", + "otpSecret": "-" + }, "coinbasepro": { "key": "Key", "secret": "Secret", @@ -148,10 +158,10 @@ "otpSecret": "-" }, "okx": { - "key": "Key", - "secret": "Secret", - "clientID": "ClientID", - "otpSecret": "-" + "key": "Key", + "secret": "Secret", + "clientID": "ClientID", + "otpSecret": "-" }, "poloniex": { "key": "Key", diff --git a/exchanges/bitfinex/bitfinex_test.go b/exchanges/bitfinex/bitfinex_test.go index 68f01d3c..1aee6305 100644 --- a/exchanges/bitfinex/bitfinex_test.go +++ b/exchanges/bitfinex/bitfinex_test.go @@ -1567,6 +1567,21 @@ func TestFixCasing(t *testing.T) { if ret != "fUSD" { t.Errorf("unexpected result: %v", ret) } + + _, err = b.fixCasing(currency.NewPair(currency.EMPTYCODE, currency.BTC), asset.MarginFunding) + if !errors.Is(err, currency.ErrCurrencyPairEmpty) { + t.Fatalf("received: '%v' but expected: '%v'", err, currency.ErrCurrencyPairEmpty) + } + + _, err = b.fixCasing(currency.NewPair(currency.BTC, currency.EMPTYCODE), asset.MarginFunding) + if !errors.Is(err, nil) { + t.Fatalf("received: '%v' but expected: '%v'", err, nil) + } + + _, err = b.fixCasing(currency.EMPTYPAIR, asset.MarginFunding) + if !errors.Is(err, currency.ErrCurrencyPairEmpty) { + t.Fatalf("received: '%v' but expected: '%v'", err, currency.ErrCurrencyPairEmpty) + } } func Test_FormatExchangeKlineInterval(t *testing.T) { diff --git a/exchanges/bitfinex/bitfinex_wrapper.go b/exchanges/bitfinex/bitfinex_wrapper.go index 2cc10d32..11e342d3 100644 --- a/exchanges/bitfinex/bitfinex_wrapper.go +++ b/exchanges/bitfinex/bitfinex_wrapper.go @@ -1158,6 +1158,9 @@ func (b *Bitfinex) GetHistoricCandlesExtended(ctx context.Context, pair currency } func (b *Bitfinex) fixCasing(in currency.Pair, a asset.Item) (string, error) { + if in.IsEmpty() || in.Base.IsEmpty() { + return "", currency.ErrCurrencyPairEmpty + } var checkString [2]byte if a == asset.Spot || a == asset.Margin { checkString[0] = 't'