mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-06 15:10:59 +00:00
exchanges/qa: Add exchange wrapper testing suite (#1159)
* initial concept of a nice validation tester for exchanges * adds some datahandler design * expand testing * more tests and fixes * minor end of day fix for bithumb * fixes implementation issues * more test coverage and improvements, but not sure if i should continue * fix more wrapper implementations * adds error type, more fixes * changes signature, fixes implementations * fixes more wrapper implementations * one more bit * more cleanup * WOW things work? * lintle 1/1337 * mini bump * fixes all linting * neaten * GetOrderInfo+ asset pair fixes+improvements * adds new websocket test * expand ws testing * fix bug, expand tests, improve implementation * code coverage of a lot of new codes * fixes everything * reverts accidental changes * minor fixes from reviewing code * removes Bitfinex cancelBatchOrder implementation * fixes dumb baby typo for babies * mini nit fixes * so many nits to address * addresses all the nits * Titlecase * switcheroo * removes websocket testing for now * fix appveyor, minor test fix * fixes typo, re-kindles killed kode * skip binance wrapper tests when running CI * expired context, huobi okx fixes * kodespull * fix ordering * time fix because why not * fix exmo, others * hopefully this fixes all of my life's problems * last thing today * huobi, more like hypotrophy * golangci-lint, more like mypooroldknee-splint * fix huobi times by removing them * should fix okx currency issues * blocks the application * adds last little contingency for pairs * addresses most nits and new problems * lovely fixed before seeing why okx sucks * fixes issues with okx websocket * the classic receieieivaier * lintle * adds test and fixes existing tests * expands error handling messages during setup * fixes dumb okx bugs introduced * quick fix for lint and exmo * fixes nixes * fix exmo deposit issue * lint * fixes issue with extra asset runs missing * fix surprise race * all the lint and merge fixes * fixes surprise bugs in OKx * fixes issues with times and chains * fixing all the merge stuff * merge fix * rm logs and a panic potential * lovely lint lament * an easy demonstration of scenario, but not of initial purpose * put it in the bin * Revert "put it in the bin" This reverts commit 15c6490f713233d43f10957367fcbf18e3818bdd. * re-add after immediate error popup * fix mini poor test design * okx okay * merge fixes * fixes issues discovered in lovely test * I FORGOT TO COMMIT THIS * nit fixaroonaboo * forgoetten test fix * revert old okx asset intrument work * fixes * revert problems I didnt understand. update bybit * fix merge bugs * test cleanup * further improvements * reshuffle and lint * rm redundant CI_TEST by rm the CI_TEST field that is redundant * path fix * move to its own section, dont run on 32 bit + appveyor * lint * fix lbank * address nits * let it rip * fix failing test time range * niteroo boogaloo * mod tidy, use common.SimpleTimeFormat
This commit is contained in:
@@ -20,7 +20,6 @@ import (
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/kline"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/request"
|
||||
"github.com/thrasher-corp/gocryptotrader/log"
|
||||
"github.com/thrasher-corp/gocryptotrader/portfolio/withdraw"
|
||||
)
|
||||
|
||||
@@ -129,10 +128,7 @@ var (
|
||||
errIncompleteArguments = errors.New("missing required argument")
|
||||
errStartTimeOrFromIDNotSet = errors.New("please set StartTime or FromId, but not both")
|
||||
errIncorrectLimitValues = errors.New("incorrect limit values - valid values are 5, 10, 20, 50, 100, 500, 1000")
|
||||
errUnableToTypeAssertResponseData = errors.New("unable to type assert responseData")
|
||||
errUnableToTypeAssertInvalidData = errors.New("unable to type assert individualData")
|
||||
errUnexpectedKlineDataLength = errors.New("unexpected kline data length")
|
||||
errUnableToTypeAssertTradeCount = errors.New("unable to type assert trade count")
|
||||
errMissingRequiredArgumentCoin = errors.New("missing required argument,coin")
|
||||
errMissingRequiredArgumentNetwork = errors.New("missing required argument,network")
|
||||
errAmountValueMustBeGreaterThan0 = errors.New("amount must be greater than 0")
|
||||
@@ -298,7 +294,6 @@ func (bi *Binanceus) batchAggregateTrades(ctx context.Context, arg *AggregatedTr
|
||||
err := bi.SendHTTPRequest(ctx,
|
||||
exchange.RestSpotSupplementary, path, spotDefaultRate, &resp)
|
||||
if err != nil {
|
||||
log.Warnln(log.ExchangeSys, err.Error())
|
||||
return resp, err
|
||||
}
|
||||
}
|
||||
@@ -476,14 +471,14 @@ func (bi *Binanceus) GetSpotKline(ctx context.Context, arg *KlinesRequestParams)
|
||||
}
|
||||
responseData, ok := resp.([]interface{})
|
||||
if !ok {
|
||||
return nil, errUnableToTypeAssertResponseData
|
||||
return nil, common.GetTypeAssertError("[]interface{}", resp, "responseData")
|
||||
}
|
||||
|
||||
klineData := make([]CandleStick, len(responseData))
|
||||
for x := range responseData {
|
||||
individualData, ok := responseData[x].([]interface{})
|
||||
if !ok {
|
||||
return nil, errUnableToTypeAssertInvalidData
|
||||
return nil, common.GetTypeAssertError("[]interface{}", responseData[x], "individualData")
|
||||
}
|
||||
if len(individualData) != 12 {
|
||||
return nil, errUnexpectedKlineDataLength
|
||||
@@ -518,7 +513,7 @@ func (bi *Binanceus) GetSpotKline(ctx context.Context, arg *KlinesRequestParams)
|
||||
return nil, err
|
||||
}
|
||||
if candle.TradeCount, ok = individualData[8].(float64); !ok {
|
||||
return nil, errUnableToTypeAssertTradeCount
|
||||
return nil, common.GetTypeAssertError("float64", individualData[8], "trade count")
|
||||
}
|
||||
if candle.TakerBuyAssetVolume, err = convert.FloatFromString(individualData[9]); err != nil {
|
||||
return nil, err
|
||||
@@ -1792,7 +1787,7 @@ func (bi *Binanceus) SendHTTPRequest(ctx context.Context, ePath exchange.URL, pa
|
||||
}
|
||||
return bi.SendPayload(ctx, f, func() (*request.Item, error) {
|
||||
return item, nil
|
||||
})
|
||||
}, request.UnauthenticatedRequest)
|
||||
}
|
||||
|
||||
// SendAPIKeyHTTPRequest is a special API request where the api key is
|
||||
@@ -1820,7 +1815,7 @@ func (bi *Binanceus) SendAPIKeyHTTPRequest(ctx context.Context, ePath exchange.U
|
||||
|
||||
return bi.SendPayload(ctx, f, func() (*request.Item, error) {
|
||||
return item, nil
|
||||
})
|
||||
}, request.AuthenticatedRequest)
|
||||
}
|
||||
|
||||
// SendAuthHTTPRequest sends an authenticated HTTP request
|
||||
@@ -1861,11 +1856,10 @@ func (bi *Binanceus) SendAuthHTTPRequest(ctx context.Context, ePath exchange.URL
|
||||
Path: fullPath,
|
||||
Headers: headers,
|
||||
Result: &interim,
|
||||
AuthRequest: true,
|
||||
Verbose: bi.Verbose,
|
||||
HTTPDebugging: bi.HTTPDebugging,
|
||||
HTTPRecording: bi.HTTPRecording}, nil
|
||||
})
|
||||
}, request.AuthenticatedRequest)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1908,7 +1902,6 @@ func (bi *Binanceus) GetWsAuthStreamKey(ctx context.Context) (string, error) {
|
||||
Path: endpointPath + userAccountStream,
|
||||
Headers: headers,
|
||||
Result: &resp,
|
||||
AuthRequest: true,
|
||||
Verbose: bi.Verbose,
|
||||
HTTPDebugging: bi.HTTPDebugging,
|
||||
HTTPRecording: bi.HTTPRecording,
|
||||
@@ -1916,7 +1909,7 @@ func (bi *Binanceus) GetWsAuthStreamKey(ctx context.Context) (string, error) {
|
||||
|
||||
err = bi.SendPayload(ctx, spotDefaultRate, func() (*request.Item, error) {
|
||||
return item, nil
|
||||
})
|
||||
}, request.AuthenticatedRequest)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -1953,7 +1946,6 @@ func (bi *Binanceus) MaintainWsAuthStreamKey(ctx context.Context) error {
|
||||
Method: http.MethodPut,
|
||||
Path: path,
|
||||
Headers: headers,
|
||||
AuthRequest: true,
|
||||
Verbose: bi.Verbose,
|
||||
HTTPDebugging: bi.HTTPDebugging,
|
||||
HTTPRecording: bi.HTTPRecording,
|
||||
@@ -1961,7 +1953,7 @@ func (bi *Binanceus) MaintainWsAuthStreamKey(ctx context.Context) error {
|
||||
|
||||
return bi.SendPayload(ctx, spotDefaultRate, func() (*request.Item, error) {
|
||||
return item, nil
|
||||
})
|
||||
}, request.AuthenticatedRequest)
|
||||
}
|
||||
|
||||
// CloseUserDataStream Close out a user data stream.
|
||||
@@ -1990,7 +1982,6 @@ func (bi *Binanceus) CloseUserDataStream(ctx context.Context) error {
|
||||
Method: http.MethodDelete,
|
||||
Path: path,
|
||||
Headers: headers,
|
||||
AuthRequest: true,
|
||||
Verbose: bi.Verbose,
|
||||
HTTPDebugging: bi.HTTPDebugging,
|
||||
HTTPRecording: bi.HTTPRecording,
|
||||
@@ -1998,5 +1989,5 @@ func (bi *Binanceus) CloseUserDataStream(ctx context.Context) error {
|
||||
|
||||
return bi.SendPayload(ctx, spotDefaultRate, func() (*request.Item, error) {
|
||||
return item, nil
|
||||
})
|
||||
}, request.AuthenticatedRequest)
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ func TestWithdrawFiat(t *testing.T) {
|
||||
func TestGetActiveOrders(t *testing.T) {
|
||||
t.Parallel()
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, bi)
|
||||
var getOrdersRequest = order.GetOrdersRequest{
|
||||
var getOrdersRequest = order.MultiOrderRequest{
|
||||
Type: order.AnyType,
|
||||
AssetType: asset.Spot,
|
||||
Side: order.AnySide,
|
||||
|
||||
@@ -2,7 +2,6 @@ package binanceus
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strconv"
|
||||
@@ -254,7 +253,7 @@ func (bi *Binanceus) Run(ctx context.Context) {
|
||||
// FetchTradablePairs returns a list of the exchanges tradable pairs
|
||||
func (bi *Binanceus) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) {
|
||||
if !bi.SupportsAsset(a) {
|
||||
return nil, fmt.Errorf("asset type of %s is not supported by %s", a, bi.Name)
|
||||
return nil, fmt.Errorf("%w %v", asset.ErrNotSupported, a)
|
||||
}
|
||||
info, err := bi.GetExchangeInfo(ctx)
|
||||
if err != nil {
|
||||
@@ -284,11 +283,18 @@ func (bi *Binanceus) UpdateTradablePairs(ctx context.Context, forceUpdate bool)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return bi.UpdatePairs(pairs, asset.Spot, false, forceUpdate)
|
||||
err = bi.UpdatePairs(pairs, asset.Spot, false, forceUpdate)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return bi.EnsureOnePairEnabled()
|
||||
}
|
||||
|
||||
// UpdateTicker updates and returns the ticker for a currency pair
|
||||
func (bi *Binanceus) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error) {
|
||||
if p.IsEmpty() {
|
||||
return nil, currency.ErrCurrencyPairEmpty
|
||||
}
|
||||
if a != asset.Spot {
|
||||
return nil, fmt.Errorf("%w '%v'", asset.ErrNotSupported, a)
|
||||
}
|
||||
@@ -319,7 +325,7 @@ func (bi *Binanceus) UpdateTicker(ctx context.Context, p currency.Pair, a asset.
|
||||
// UpdateTickers updates all currency pairs of a given asset type
|
||||
func (bi *Binanceus) UpdateTickers(ctx context.Context, a asset.Item) error {
|
||||
if a != asset.Spot {
|
||||
return fmt.Errorf("assetType not supported: %v", a)
|
||||
return fmt.Errorf("%w %v", asset.ErrNotSupported, a)
|
||||
}
|
||||
tick, err := bi.GetTickers(ctx)
|
||||
if err != nil {
|
||||
@@ -390,6 +396,12 @@ func (bi *Binanceus) FetchOrderbook(ctx context.Context, pair currency.Pair, ass
|
||||
|
||||
// UpdateOrderbook updates and returns the orderbook for a currency pair
|
||||
func (bi *Binanceus) UpdateOrderbook(ctx context.Context, pair currency.Pair, assetType asset.Item) (*orderbook.Base, error) {
|
||||
if pair.IsEmpty() {
|
||||
return nil, currency.ErrCurrencyPairEmpty
|
||||
}
|
||||
if err := bi.CurrencyPairs.IsAssetEnabled(assetType); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
book := &orderbook.Base{
|
||||
Exchange: bi.Name,
|
||||
Pair: pair,
|
||||
@@ -430,7 +442,7 @@ func (bi *Binanceus) UpdateAccountInfo(ctx context.Context, assetType asset.Item
|
||||
var acc account.SubAccount
|
||||
info.Exchange = bi.Name
|
||||
if assetType != asset.Spot {
|
||||
return info, fmt.Errorf("%v assetType is not supported", assetType)
|
||||
return info, fmt.Errorf("%w %v", asset.ErrNotSupported, assetType)
|
||||
}
|
||||
theAccount, err := bi.GetAccount(ctx)
|
||||
if err != nil {
|
||||
@@ -474,39 +486,49 @@ func (bi *Binanceus) FetchAccountInfo(ctx context.Context, assetType asset.Item)
|
||||
return acc, nil
|
||||
}
|
||||
|
||||
// GetFundingHistory returns funding history, deposits and withdrawals
|
||||
func (bi *Binanceus) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
|
||||
// GetAccountFundingHistory returns funding history, deposits and withdrawals
|
||||
func (bi *Binanceus) GetAccountFundingHistory(_ context.Context) ([]exchange.FundingHistory, error) {
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
// GetWithdrawalsHistory returns previous withdrawals data
|
||||
func (bi *Binanceus) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
|
||||
w, err := bi.WithdrawalHistory(ctx, c, "", time.Time{}, time.Time{}, 0, 10000)
|
||||
func (bi *Binanceus) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) ([]exchange.WithdrawalHistory, error) {
|
||||
if a != asset.Spot {
|
||||
return nil, fmt.Errorf("%w %v", asset.ErrNotSupported, a)
|
||||
}
|
||||
withdrawals, err := bi.WithdrawalHistory(ctx, c, "", time.Time{}, time.Time{}, 0, 10000)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for i := range w {
|
||||
tm, err := time.Parse(binanceUSAPITimeLayout, w[i].ApplyTime)
|
||||
resp := make([]exchange.WithdrawalHistory, len(withdrawals))
|
||||
for i := range withdrawals {
|
||||
tm, err := time.Parse(binanceUSAPITimeLayout, withdrawals[i].ApplyTime)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp = append(resp, exchange.WithdrawalHistory{
|
||||
Status: fmt.Sprint(w[i].Status),
|
||||
TransferID: w[i].ID,
|
||||
Currency: w[i].Coin,
|
||||
Amount: w[i].Amount,
|
||||
Fee: w[i].TransactionFee,
|
||||
CryptoToAddress: w[i].Address,
|
||||
CryptoTxID: w[i].ID,
|
||||
CryptoChain: w[i].Network,
|
||||
resp[i] = exchange.WithdrawalHistory{
|
||||
Status: fmt.Sprint(withdrawals[i].Status),
|
||||
TransferID: withdrawals[i].ID,
|
||||
Currency: withdrawals[i].Coin,
|
||||
Amount: withdrawals[i].Amount,
|
||||
Fee: withdrawals[i].TransactionFee,
|
||||
CryptoToAddress: withdrawals[i].Address,
|
||||
CryptoTxID: withdrawals[i].ID,
|
||||
CryptoChain: withdrawals[i].Network,
|
||||
Timestamp: tm,
|
||||
})
|
||||
}
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// GetRecentTrades returns the most recent trades for a currency and asset
|
||||
func (bi *Binanceus) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error) {
|
||||
if p.IsEmpty() {
|
||||
return nil, currency.ErrCurrencyPairEmpty
|
||||
}
|
||||
if err := bi.CurrencyPairs.IsAssetEnabled(assetType); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
const limit = 1000
|
||||
tradeData, err := bi.GetMostRecentTrades(ctx, RecentTradeRequestParams{p, limit})
|
||||
if err != nil {
|
||||
@@ -536,8 +558,13 @@ func (bi *Binanceus) GetRecentTrades(ctx context.Context, p currency.Pair, asset
|
||||
}
|
||||
|
||||
// GetHistoricTrades returns historic trade data within the timeframe provided
|
||||
func (bi *Binanceus) GetHistoricTrades(ctx context.Context, p currency.Pair,
|
||||
assetType asset.Item, timestampStart, timestampEnd time.Time) ([]trade.Data, error) {
|
||||
func (bi *Binanceus) GetHistoricTrades(ctx context.Context, p currency.Pair, assetType asset.Item, timestampStart, timestampEnd time.Time) ([]trade.Data, error) {
|
||||
if p.IsEmpty() {
|
||||
return nil, currency.ErrCurrencyPairEmpty
|
||||
}
|
||||
if err := bi.CurrencyPairs.IsAssetEnabled(assetType); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req := AggregatedTradeRequestParams{
|
||||
Symbol: p,
|
||||
StartTime: timestampStart.UnixMilli(),
|
||||
@@ -581,7 +608,7 @@ func (bi *Binanceus) SubmitOrder(ctx context.Context, s *order.Submit) (*order.S
|
||||
timeInForce = BinanceRequestParamsTimeGTC
|
||||
requestParamOrderType = BinanceRequestParamsOrderLimit
|
||||
default:
|
||||
return nil, errors.New(bi.Name + " unsupported order type")
|
||||
return nil, fmt.Errorf("%w %v", order.ErrUnsupportedOrderType, s.Type)
|
||||
}
|
||||
var response NewOrderResponse
|
||||
response, err = bi.NewOrder(ctx, &NewOrderRequest{
|
||||
@@ -639,8 +666,8 @@ func (bi *Binanceus) CancelOrder(ctx context.Context, o *order.Cancel) error {
|
||||
}
|
||||
|
||||
// CancelBatchOrders cancels orders by their corresponding ID numbers
|
||||
func (bi *Binanceus) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
|
||||
return order.CancelBatchResponse{}, common.ErrFunctionNotSupported
|
||||
func (bi *Binanceus) CancelBatchOrders(_ context.Context, _ []order.Cancel) (*order.CancelBatchResponse, error) {
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
// CancelAllOrders cancels all orders associated with a currency pair
|
||||
@@ -680,18 +707,24 @@ func (bi *Binanceus) CancelAllOrders(ctx context.Context, orderCancellation *ord
|
||||
}
|
||||
|
||||
// GetOrderInfo returns order information based on order ID
|
||||
func (bi *Binanceus) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
|
||||
var respData order.Detail
|
||||
func (bi *Binanceus) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (*order.Detail, error) {
|
||||
if pair.IsEmpty() {
|
||||
return nil, currency.ErrCurrencyPairEmpty
|
||||
}
|
||||
if err := bi.CurrencyPairs.IsAssetEnabled(assetType); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
orderIDInt, err := strconv.ParseInt(orderID, 10, 64)
|
||||
if err != nil {
|
||||
return respData, fmt.Errorf("invalid orderID %w", err)
|
||||
return nil, fmt.Errorf("invalid orderID %w", err)
|
||||
}
|
||||
symbolValue, err := bi.FormatSymbol(pair, asset.Spot)
|
||||
if err != nil {
|
||||
return respData, err
|
||||
return nil, err
|
||||
}
|
||||
if assetType != asset.Spot {
|
||||
return respData, fmt.Errorf("%s %w", assetType, asset.ErrNotSupported)
|
||||
return nil, fmt.Errorf("%s %w", assetType, asset.ErrNotSupported)
|
||||
}
|
||||
var orderType order.Type
|
||||
resp, err := bi.GetOrder(ctx, &OrderRequestParams{
|
||||
@@ -699,7 +732,7 @@ func (bi *Binanceus) GetOrderInfo(ctx context.Context, orderID string, pair curr
|
||||
OrderID: uint64(orderIDInt),
|
||||
})
|
||||
if err != nil {
|
||||
return respData, err
|
||||
return nil, err
|
||||
}
|
||||
orderSide, err := order.StringToOrderSide(resp.Side)
|
||||
if err != nil {
|
||||
@@ -714,7 +747,7 @@ func (bi *Binanceus) GetOrderInfo(ctx context.Context, orderID string, pair curr
|
||||
log.Errorf(log.ExchangeSys, "%s %v", bi.Name, err)
|
||||
}
|
||||
|
||||
return order.Detail{
|
||||
return &order.Detail{
|
||||
Amount: resp.OrigQty,
|
||||
Exchange: bi.Name,
|
||||
OrderID: strconv.FormatInt(int64(resp.OrderID), 10),
|
||||
@@ -762,17 +795,17 @@ func (bi *Binanceus) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRe
|
||||
// the fiat withdrawal end point of Binance.US is built to submit a USD withdraw request via Silvergate Exchange Network (SEN).
|
||||
// So, this method is not implemented.
|
||||
func (bi *Binanceus) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
// WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
|
||||
// But, GCT has no concept of withdrawal via SEN the fiat withdrawal end point of Binance.US is built to submit a USD withdraw request via Silvergate Exchange Network (SEN).
|
||||
func (bi *Binanceus) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
// GetActiveOrders retrieves any orders that are active/open
|
||||
func (bi *Binanceus) GetActiveOrders(ctx context.Context, getOrdersRequest *order.GetOrdersRequest) (order.FilteredOrders, error) {
|
||||
func (bi *Binanceus) GetActiveOrders(ctx context.Context, getOrdersRequest *order.MultiOrderRequest) (order.FilteredOrders, error) {
|
||||
err := getOrdersRequest.Validate()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -843,7 +876,7 @@ func (bi *Binanceus) GetActiveOrders(ctx context.Context, getOrdersRequest *orde
|
||||
}
|
||||
|
||||
// GetOrderHistory retrieves account order information Can Limit response to specific order status
|
||||
func (bi *Binanceus) GetOrderHistory(_ context.Context, _ *order.GetOrdersRequest) (order.FilteredOrders, error) {
|
||||
func (bi *Binanceus) GetOrderHistory(_ context.Context, _ *order.MultiOrderRequest) (order.FilteredOrders, error) {
|
||||
// An endpoint like /api/v3/allOrders does not exist in the binance us
|
||||
// so This end point is left unimplemented
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
|
||||
Reference in New Issue
Block a user