linters: Bump golangci-lint version to v1.52.2 and fix issues (#1169)

* fix linter issues

* linter issue suppressing and fixing

* change linter version and linter issues fix

* Bump version
This commit is contained in:
Samuael A
2023-04-27 00:13:46 +00:00
committed by GitHub
parent 42475bf2b8
commit 969669cb0d
70 changed files with 346 additions and 329 deletions

View File

@@ -540,7 +540,7 @@ func (a *Alphapoint) GetOrderFee(ctx context.Context, symbol, side string, quant
}
// SendHTTPRequest sends an unauthenticated HTTP request
func (a *Alphapoint) SendHTTPRequest(ctx context.Context, ep exchange.URL, method, path string, data map[string]interface{}, result interface{}) error {
func (a *Alphapoint) SendHTTPRequest(_ context.Context, ep exchange.URL, method, path string, data map[string]interface{}, result interface{}) error {
endpoint, err := a.API.Endpoints.GetURL(ep)
if err != nil {
return err

View File

@@ -23,7 +23,7 @@ import (
)
// GetDefaultConfig returns a default exchange config for Alphapoint
func (a *Alphapoint) GetDefaultConfig(ctx context.Context) (*config.Exchange, error) {
func (a *Alphapoint) GetDefaultConfig(_ context.Context) (*config.Exchange, error) {
return nil, common.ErrFunctionNotSupported
}
@@ -87,7 +87,7 @@ func (a *Alphapoint) FetchTradablePairs(_ context.Context, _ asset.Item) (curren
// UpdateTradablePairs updates the exchanges available pairs and stores
// them in the exchanges config
func (a *Alphapoint) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error {
func (a *Alphapoint) UpdateTradablePairs(_ context.Context, _ bool) error {
return common.ErrFunctionNotSupported
}
@@ -145,7 +145,7 @@ func (a *Alphapoint) FetchAccountInfo(ctx context.Context, assetType asset.Item)
}
// UpdateTickers updates the ticker for all currency pairs of a given asset type
func (a *Alphapoint) UpdateTickers(assetType asset.Item) error {
func (a *Alphapoint) UpdateTickers(_ asset.Item) error {
return common.ErrFunctionNotSupported
}
@@ -230,13 +230,13 @@ func (a *Alphapoint) FetchOrderbook(ctx context.Context, p currency.Pair, assetT
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (a *Alphapoint) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (a *Alphapoint) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
// https://alphapoint.github.io/slate/#generatetreasuryactivityreport
return nil, common.ErrNotYetImplemented
}
// GetWithdrawalsHistory returns previous withdrawals data
func (a *Alphapoint) GetWithdrawalsHistory(ctx context.Context, c currency.Code, as asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (a *Alphapoint) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -294,7 +294,7 @@ func (a *Alphapoint) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (a *Alphapoint) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (a *Alphapoint) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -308,7 +308,7 @@ func (a *Alphapoint) CancelAllOrders(ctx context.Context, orderCancellation *ord
}
// GetOrderInfo returns order information based on order ID
func (a *Alphapoint) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (float64, error) {
func (a *Alphapoint) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, _ asset.Item) (float64, error) {
orders, err := a.GetOrders(ctx)
if err != nil {
return 0, err

View File

@@ -807,12 +807,12 @@ func (b *Binance) FetchAccountInfo(ctx context.Context, assetType asset.Item) (a
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (b *Binance) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (b *Binance) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (b *Binance) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (b *Binance) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
w, err := b.WithdrawHistory(ctx, c, "", time.Time{}, time.Time{}, 0, 10000)
if err != nil {
return nil, err
@@ -1114,7 +1114,7 @@ func (b *Binance) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (b *Binance) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (b *Binance) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}

View File

@@ -475,7 +475,7 @@ func (bi *Binanceus) FetchAccountInfo(ctx context.Context, assetType asset.Item)
}
// GetFundingHistory returns funding history, deposits and withdrawals
func (bi *Binanceus) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (bi *Binanceus) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
@@ -639,7 +639,7 @@ func (bi *Binanceus) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels orders by their corresponding ID numbers
func (bi *Binanceus) CancelBatchOrders(ctx context.Context, orders []order.Cancel) (order.CancelBatchResponse, error) {
func (bi *Binanceus) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrFunctionNotSupported
}
@@ -761,13 +761,13 @@ func (bi *Binanceus) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRe
// WithdrawFiatFunds 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).
// So, this method is not implemented.
func (bi *Binanceus) WithdrawFiatFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error) {
func (bi *Binanceus) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error) {
return nil, common.ErrNotYetImplemented
}
// 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(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error) {
func (bi *Binanceus) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error) {
return nil, common.ErrNotYetImplemented
}
@@ -843,7 +843,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(ctx context.Context, getOrdersRequest *order.GetOrdersRequest) (order.FilteredOrders, error) {
func (bi *Binanceus) GetOrderHistory(_ context.Context, _ *order.GetOrdersRequest) (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

View File

@@ -1085,6 +1085,7 @@ func TestWsAuth(t *testing.T) {
runAuth(t)
}
//nolint:gocritic // Only used as a testing helper function in this package
func runAuth(t *testing.T) {
t.Helper()
setupWs()

View File

@@ -553,12 +553,12 @@ func (b *Bitfinex) FetchAccountInfo(ctx context.Context, assetType asset.Item) (
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (b *Bitfinex) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (b *Bitfinex) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (b *Bitfinex) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (b *Bitfinex) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -691,7 +691,7 @@ func (b *Bitfinex) SubmitOrder(ctx context.Context, o *order.Submit) (*order.Sub
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (b *Bitfinex) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error) {
func (b *Bitfinex) ModifyOrder(_ context.Context, action *order.Modify) (*order.ModifyResponse, error) {
if !b.Websocket.CanUseAuthenticatedWebsocketForWrapper() {
return nil, common.ErrNotYetImplemented
}
@@ -739,7 +739,7 @@ func (b *Bitfinex) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (b *Bitfinex) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (b *Bitfinex) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -755,7 +755,7 @@ func (b *Bitfinex) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.
}
// GetOrderInfo returns order information based on order ID
func (b *Bitfinex) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (b *Bitfinex) GetOrderInfo(_ context.Context, _ string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
var orderDetail order.Detail
return orderDetail, common.ErrNotYetImplemented
}

View File

@@ -202,7 +202,7 @@ func (b *Bitflyer) UpdateTradablePairs(ctx context.Context, forceUpdate bool) er
}
// UpdateTickers updates the ticker for all currency pairs of a given asset type
func (b *Bitflyer) UpdateTickers(ctx context.Context, a asset.Item) error {
func (b *Bitflyer) UpdateTickers(_ context.Context, _ asset.Item) error {
return common.ErrFunctionNotSupported
}

View File

@@ -237,7 +237,7 @@ func (b *Bithumb) Run(ctx context.Context) {
}
// FetchTradablePairs returns a list of the exchanges tradable pairs
func (b *Bithumb) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) {
func (b *Bithumb) FetchTradablePairs(ctx context.Context, _ asset.Item) (currency.Pairs, error) {
currencies, err := b.GetTradablePairs(ctx)
if err != nil {
return nil, err
@@ -427,12 +427,12 @@ func (b *Bithumb) FetchAccountInfo(ctx context.Context, assetType asset.Item) (a
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (b *Bithumb) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (b *Bithumb) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (b *Bithumb) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (b *Bithumb) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -532,7 +532,7 @@ func (b *Bithumb) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (b *Bithumb) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (b *Bithumb) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -579,7 +579,7 @@ func (b *Bithumb) CancelAllOrders(ctx context.Context, orderCancellation *order.
}
// GetOrderInfo returns order information based on order ID
func (b *Bithumb) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (b *Bithumb) GetOrderInfo(_ context.Context, _ string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
var orderDetail order.Detail
return orderDetail, common.ErrNotYetImplemented
}

View File

@@ -168,7 +168,7 @@ func (p ChatSendParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p ChatSendParams) ToURLVals(path string) (string, error) {
func (p ChatSendParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -247,7 +247,7 @@ func (p LeaderboardGetParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p LeaderboardGetParams) ToURLVals(path string) (string, error) {
func (p LeaderboardGetParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -339,7 +339,7 @@ func (p *OrderNewParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p *OrderNewParams) ToURLVals(path string) (string, error) {
func (p *OrderNewParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -404,7 +404,7 @@ func (p *OrderAmendParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p *OrderAmendParams) ToURLVals(path string) (string, error) {
func (p *OrderAmendParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -432,7 +432,7 @@ func (p OrderCancelParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p OrderCancelParams) ToURLVals(path string) (string, error) {
func (p OrderCancelParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -463,7 +463,7 @@ func (p OrderCancelAllParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p OrderCancelAllParams) ToURLVals(path string) (string, error) {
func (p OrderCancelAllParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -485,7 +485,7 @@ func (p OrderAmendBulkParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p OrderAmendBulkParams) ToURLVals(path string) (string, error) {
func (p OrderAmendBulkParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -507,7 +507,7 @@ func (p OrderNewBulkParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p OrderNewBulkParams) ToURLVals(path string) (string, error) {
func (p OrderNewBulkParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -530,7 +530,7 @@ func (p OrderCancelAllAfterParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p OrderCancelAllAfterParams) ToURLVals(path string) (string, error) {
func (p OrderCancelAllAfterParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -556,7 +556,7 @@ func (p OrderClosePositionParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p OrderClosePositionParams) ToURLVals(path string) (string, error) {
func (p OrderClosePositionParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -615,7 +615,7 @@ func (p PositionGetParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p PositionGetParams) ToURLVals(path string) (string, error) {
func (p PositionGetParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -641,7 +641,7 @@ func (p PositionIsolateMarginParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p PositionIsolateMarginParams) ToURLVals(path string) (string, error) {
func (p PositionIsolateMarginParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -668,7 +668,7 @@ func (p PositionUpdateLeverageParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p PositionUpdateLeverageParams) ToURLVals(path string) (string, error) {
func (p PositionUpdateLeverageParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -694,7 +694,7 @@ func (p PositionUpdateRiskLimitParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p PositionUpdateRiskLimitParams) ToURLVals(path string) (string, error) {
func (p PositionUpdateRiskLimitParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -720,7 +720,7 @@ func (p PositionTransferIsolatedMarginParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p PositionTransferIsolatedMarginParams) ToURLVals(path string) (string, error) {
func (p PositionTransferIsolatedMarginParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -780,7 +780,7 @@ func (p *QuoteGetBucketedParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p *QuoteGetBucketedParams) ToURLVals(path string) (string, error) {
func (p *QuoteGetBucketedParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -841,7 +841,7 @@ func (p *TradeGetBucketedParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p *TradeGetBucketedParams) ToURLVals(path string) (string, error) {
func (p *TradeGetBucketedParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -878,7 +878,7 @@ func (p *UserUpdateParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p *UserUpdateParams) ToURLVals(path string) (string, error) {
func (p *UserUpdateParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -899,7 +899,7 @@ func (p UserTokenParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p UserTokenParams) ToURLVals(path string) (string, error) {
func (p UserTokenParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -921,7 +921,7 @@ func (p UserCheckReferralCodeParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p UserCheckReferralCodeParams) ToURLVals(path string) (string, error) {
func (p UserCheckReferralCodeParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -947,7 +947,7 @@ func (p UserConfirmTFAParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p UserConfirmTFAParams) ToURLVals(path string) (string, error) {
func (p UserConfirmTFAParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -968,7 +968,7 @@ func (p UserCurrencyParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p UserCurrencyParams) ToURLVals(path string) (string, error) {
func (p UserCurrencyParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -993,7 +993,7 @@ func (p UserPreferencesParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p UserPreferencesParams) ToURLVals(path string) (string, error) {
func (p UserPreferencesParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -1030,7 +1030,7 @@ func (p UserRequestWithdrawalParams) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p UserRequestWithdrawalParams) ToURLVals(path string) (string, error) {
func (p UserRequestWithdrawalParams) ToURLVals(_ string) (string, error) {
return "", nil
}
@@ -1058,7 +1058,7 @@ func (p *OrdersRequest) VerifyData() error {
// ToURLVals converts struct values to url.values and encodes it on the supplied
// path
func (p *OrdersRequest) ToURLVals(path string) (string, error) {
func (p *OrdersRequest) ToURLVals(_ string) (string, error) {
return "", nil
}

View File

@@ -335,7 +335,7 @@ func (b *Bitmex) FetchTradablePairs(ctx context.Context, a asset.Item) (currency
// UpdateTradablePairs updates the exchanges available pairs and stores
// them in the exchanges config
func (b *Bitmex) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error {
func (b *Bitmex) UpdateTradablePairs(ctx context.Context, _ bool) error {
assets := b.GetAssetTypes(false)
for x := range assets {
@@ -551,12 +551,12 @@ func (b *Bitmex) FetchAccountInfo(ctx context.Context, assetType asset.Item) (ac
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (b *Bitmex) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (b *Bitmex) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrNotYetImplemented
}
// GetWithdrawalsHistory returns previous withdrawals data
func (b *Bitmex) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (b *Bitmex) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -715,7 +715,7 @@ func (b *Bitmex) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (b *Bitmex) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (b *Bitmex) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -740,7 +740,7 @@ func (b *Bitmex) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.Ca
}
// GetOrderInfo returns order information based on order ID
func (b *Bitmex) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (b *Bitmex) GetOrderInfo(_ context.Context, _ string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
var orderDetail order.Detail
return orderDetail, common.ErrNotYetImplemented
}

View File

@@ -280,7 +280,7 @@ func (b *Bitstamp) Run(ctx context.Context) {
}
// FetchTradablePairs returns a list of the exchanges tradable pairs
func (b *Bitstamp) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) {
func (b *Bitstamp) FetchTradablePairs(ctx context.Context, _ asset.Item) (currency.Pairs, error) {
symbols, err := b.GetTradingPairs(ctx)
if err != nil {
return nil, err
@@ -312,7 +312,7 @@ func (b *Bitstamp) UpdateTradablePairs(ctx context.Context, forceUpdate bool) er
}
// UpdateTickers updates the ticker for all currency pairs of a given asset type
func (b *Bitstamp) UpdateTickers(ctx context.Context, a asset.Item) error {
func (b *Bitstamp) UpdateTickers(_ context.Context, _ asset.Item) error {
return common.ErrFunctionNotSupported
}
@@ -481,12 +481,12 @@ func (b *Bitstamp) FetchAccountInfo(ctx context.Context, assetType asset.Item) (
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (b *Bitstamp) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (b *Bitstamp) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (b *Bitstamp) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (b *Bitstamp) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -578,7 +578,7 @@ func (b *Bitstamp) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (b *Bitstamp) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (b *Bitstamp) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -596,7 +596,7 @@ func (b *Bitstamp) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.
}
// GetOrderInfo returns order information based on order ID
func (b *Bitstamp) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (b *Bitstamp) GetOrderInfo(_ context.Context, _ string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
var orderDetail order.Detail
return orderDetail, common.ErrNotYetImplemented
}

View File

@@ -604,6 +604,7 @@ func TestModifyOrder(t *testing.T) {
}
}
//nolint:gocritic // Only used as a testing helper function in this package
func WithdrawCryptocurrencyFunds(t *testing.T) {
t.Helper()
withdrawCryptoRequest := withdraw.Request{

View File

@@ -289,7 +289,7 @@ func (b *Bittrex) UpdateTradablePairs(ctx context.Context, forceUpdate bool) err
}
// UpdateTickers updates the ticker for all currency pairs of a given asset type
func (b *Bittrex) UpdateTickers(ctx context.Context, a asset.Item) error {
func (b *Bittrex) UpdateTickers(_ context.Context, _ asset.Item) error {
return common.ErrFunctionNotSupported
}
@@ -511,7 +511,7 @@ func (b *Bittrex) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory
}
// GetWithdrawalsHistory returns previous withdrawals data
func (b *Bittrex) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (b *Bittrex) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -644,7 +644,7 @@ func (b *Bittrex) CancelAllOrders(ctx context.Context, orderCancellation *order.
}
// GetOrderInfo returns information on a current open order
func (b *Bittrex) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (b *Bittrex) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
orderData, err := b.GetOrder(ctx, orderID)
if err != nil {
return order.Detail{}, err

View File

@@ -491,12 +491,12 @@ func (b *BTCMarkets) FetchAccountInfo(ctx context.Context, assetType asset.Item)
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (b *BTCMarkets) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (b *BTCMarkets) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (b *BTCMarkets) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (b *BTCMarkets) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -644,7 +644,7 @@ func (b *BTCMarkets) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (b *BTCMarkets) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (b *BTCMarkets) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -679,7 +679,7 @@ func (b *BTCMarkets) CancelAllOrders(ctx context.Context, _ *order.Cancel) (orde
}
// GetOrderInfo returns order information based on order ID
func (b *BTCMarkets) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (b *BTCMarkets) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
var resp order.Detail
o, err := b.FetchOrder(ctx, orderID)
if err != nil {
@@ -738,7 +738,7 @@ func (b *BTCMarkets) GetOrderInfo(ctx context.Context, orderID string, pair curr
}
// GetDepositAddress returns a deposit address for a specified currency
func (b *BTCMarkets) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, accountID, _ string) (*deposit.Address, error) {
func (b *BTCMarkets) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, _, _ string) (*deposit.Address, error) {
depositAddr, err := b.FetchDepositAddress(ctx, cryptocurrency, -1, -1, -1)
if err != nil {
return nil, err

View File

@@ -437,7 +437,7 @@ func (b *BTSE) FetchAccountInfo(ctx context.Context, assetType asset.Item) (acco
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (b *BTSE) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (b *BTSE) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
@@ -452,7 +452,7 @@ func (b *BTSE) withinLimits(pair currency.Pair, amount float64) bool {
}
// GetWithdrawalsHistory returns previous withdrawals data
func (b *BTSE) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (b *BTSE) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -573,7 +573,7 @@ func (b *BTSE) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (b *BTSE) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (b *BTSE) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -617,7 +617,7 @@ func orderIntToType(i int) order.Type {
}
// GetOrderInfo returns order information based on order ID
func (b *BTSE) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (b *BTSE) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
o, err := b.GetOrders(ctx, "", orderID, "")
if err != nil {
return order.Detail{}, err
@@ -701,7 +701,7 @@ func (b *BTSE) GetOrderInfo(ctx context.Context, orderID string, pair currency.P
}
// GetDepositAddress returns a deposit address for a specified currency
func (b *BTSE) GetDepositAddress(ctx context.Context, c currency.Code, accountID, _ string) (*deposit.Address, error) {
func (b *BTSE) GetDepositAddress(ctx context.Context, c currency.Code, _, _ string) (*deposit.Address, error) {
address, err := b.GetWalletAddress(ctx, c.String())
if err != nil {
return nil, err

View File

@@ -794,7 +794,7 @@ func (by *Bybit) FetchAccountInfo(ctx context.Context, assetType asset.Item) (ac
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (by *Bybit) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (by *Bybit) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrNotYetImplemented
}
@@ -920,7 +920,7 @@ func (by *Bybit) GetRecentTrades(ctx context.Context, p currency.Pair, assetType
}
// GetHistoricTrades returns historic trade data within the timeframe provided
func (by *Bybit) GetHistoricTrades(ctx context.Context, p currency.Pair, assetType asset.Item, timestampStart, timestampEnd time.Time) ([]trade.Data, error) {
func (by *Bybit) GetHistoricTrades(_ context.Context, _ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error) {
return nil, common.ErrFunctionNotSupported
}
@@ -1132,7 +1132,7 @@ func (by *Bybit) CancelOrder(ctx context.Context, ord *order.Cancel) error {
}
// CancelBatchOrders cancels orders by their corresponding ID numbers
func (by *Bybit) CancelBatchOrders(ctx context.Context, orders []order.Cancel) (order.CancelBatchResponse, error) {
func (by *Bybit) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -1415,13 +1415,13 @@ func (by *Bybit) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawReques
// WithdrawFiatFunds returns a withdrawal ID when a withdrawal is
// submitted
func (by *Bybit) WithdrawFiatFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error) {
func (by *Bybit) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error) {
return nil, common.ErrFunctionNotSupported
}
// WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is
// submitted
func (by *Bybit) WithdrawFiatFundsToInternationalBank(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error) {
func (by *Bybit) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error) {
return nil, common.ErrFunctionNotSupported
}
@@ -1754,7 +1754,7 @@ func (by *Bybit) GetOrderHistory(ctx context.Context, req *order.GetOrdersReques
}
// GetFeeByType returns an estimate of fee based on the type of transaction
func (by *Bybit) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error) {
func (by *Bybit) GetFeeByType(_ context.Context, _ *exchange.FeeBuilder) (float64, error) {
return 0, common.ErrNotYetImplemented
}
@@ -1765,7 +1765,7 @@ func (by *Bybit) ValidateCredentials(ctx context.Context, assetType asset.Item)
}
// FormatExchangeKlineInterval returns Interval to exchange formatted string
func (by *Bybit) FormatExchangeKlineInterval(ctx context.Context, interval kline.Interval) string {
func (by *Bybit) FormatExchangeKlineInterval(_ context.Context, interval kline.Interval) string {
switch interval {
case kline.OneMin:
return "1m"
@@ -1799,7 +1799,7 @@ func (by *Bybit) FormatExchangeKlineInterval(ctx context.Context, interval kline
}
// FormatExchangeKlineIntervalFutures returns Interval to exchange formatted string for future assets
func (by *Bybit) FormatExchangeKlineIntervalFutures(ctx context.Context, interval kline.Interval) string {
func (by *Bybit) FormatExchangeKlineIntervalFutures(_ context.Context, interval kline.Interval) string {
switch interval {
case kline.OneMin:
return "1"

View File

@@ -284,7 +284,7 @@ func (c *CoinbasePro) Run(ctx context.Context) {
}
// FetchTradablePairs returns a list of the exchanges tradable pairs
func (c *CoinbasePro) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) {
func (c *CoinbasePro) FetchTradablePairs(ctx context.Context, _ asset.Item) (currency.Pairs, error) {
products, err := c.GetProducts(ctx)
if err != nil {
return nil, err
@@ -369,7 +369,7 @@ func (c *CoinbasePro) FetchAccountInfo(ctx context.Context, assetType asset.Item
}
// UpdateTickers updates the ticker for all currency pairs of a given asset type
func (c *CoinbasePro) UpdateTickers(ctx context.Context, a asset.Item) error {
func (c *CoinbasePro) UpdateTickers(_ context.Context, _ asset.Item) error {
return common.ErrFunctionNotSupported
}
@@ -589,7 +589,7 @@ func (c *CoinbasePro) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (c *CoinbasePro) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (c *CoinbasePro) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}

View File

@@ -263,7 +263,7 @@ func (c *COINUT) Run(ctx context.Context) {
}
// FetchTradablePairs returns a list of the exchanges tradable pairs
func (c *COINUT) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) {
func (c *COINUT) FetchTradablePairs(ctx context.Context, _ asset.Item) (currency.Pairs, error) {
var resp Instruments
var err error
if c.Websocket.IsConnected() {
@@ -411,7 +411,7 @@ func (c *COINUT) FetchAccountInfo(ctx context.Context, assetType asset.Item) (ac
}
// UpdateTickers updates the ticker for all currency pairs of a given asset type
func (c *COINUT) UpdateTickers(ctx context.Context, a asset.Item) error {
func (c *COINUT) UpdateTickers(_ context.Context, _ asset.Item) error {
return common.ErrFunctionNotSupported
}
@@ -525,7 +525,7 @@ func (c *COINUT) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (c *COINUT) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (c *COINUT) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -301,7 +301,7 @@ func TestCurrencyGetState(t *testing.T) {
}
}
func TestAlerting(t *testing.T) {
func TestAlerting(_ *testing.T) {
c := Currency{}
var start, finish sync.WaitGroup
start.Add(3)

View File

@@ -1413,7 +1413,7 @@ func (a *AssetWebsocketSupport) IsAssetWebsocketSupported(aType asset.Item) bool
}
// UpdateCurrencyStates updates currency states
func (b *Base) UpdateCurrencyStates(ctx context.Context, a asset.Item) error {
func (b *Base) UpdateCurrencyStates(_ context.Context, _ asset.Item) error {
return common.ErrNotYetImplemented
}
@@ -1440,12 +1440,12 @@ func (b *Base) ScaleCollateral(context.Context, *order.CollateralCalculator) (*o
// CalculateTotalCollateral takes in n collateral calculators to determine an overall
// standing in a singular currency
func (b *Base) CalculateTotalCollateral(ctx context.Context, calculator *order.TotalCollateralCalculator) (*order.TotalCollateralResponse, error) {
func (b *Base) CalculateTotalCollateral(_ context.Context, _ *order.TotalCollateralCalculator) (*order.TotalCollateralResponse, error) {
return nil, common.ErrNotYetImplemented
}
// GetCollateralCurrencyForContract returns the collateral currency for an asset and contract pair
func (b *Base) GetCollateralCurrencyForContract(a asset.Item, cp currency.Pair) (currency.Code, asset.Item, error) {
func (b *Base) GetCollateralCurrencyForContract(_ asset.Item, _ currency.Pair) (currency.Code, asset.Item, error) {
return currency.Code{}, asset.Empty, common.ErrNotYetImplemented
}

View File

@@ -414,12 +414,12 @@ func (e *EXMO) FetchAccountInfo(ctx context.Context, assetType asset.Item) (acco
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (e *EXMO) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (e *EXMO) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (e *EXMO) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (e *EXMO) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -522,7 +522,7 @@ func (e *EXMO) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (e *EXMO) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (e *EXMO) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -548,7 +548,7 @@ func (e *EXMO) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.Canc
}
// GetOrderInfo returns order information based on order ID
func (e *EXMO) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (e *EXMO) GetOrderInfo(_ context.Context, _ string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
var orderDetail order.Detail
return orderDetail, common.ErrNotYetImplemented
}

View File

@@ -457,12 +457,12 @@ func (g *Gateio) FetchAccountInfo(ctx context.Context, assetType asset.Item) (ac
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (g *Gateio) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (g *Gateio) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (g *Gateio) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (g *Gateio) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -578,7 +578,7 @@ func (g *Gateio) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (g *Gateio) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (g *Gateio) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -608,7 +608,7 @@ func (g *Gateio) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.Ca
}
// GetOrderInfo returns order information based on order ID
func (g *Gateio) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (g *Gateio) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, assetType asset.Item) (order.Detail, error) {
var orderDetail order.Detail
orders, err := g.GetOpenOrders(ctx, "")
if err != nil {

View File

@@ -363,7 +363,7 @@ func (g *Gemini) FetchAccountInfo(ctx context.Context, assetType asset.Item) (ac
}
// UpdateTickers updates the ticker for all currency pairs of a given asset type
func (g *Gemini) UpdateTickers(ctx context.Context, a asset.Item) error {
func (g *Gemini) UpdateTickers(_ context.Context, _ asset.Item) error {
return common.ErrFunctionNotSupported
}
@@ -466,12 +466,12 @@ func (g *Gemini) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (g *Gemini) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (g *Gemini) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (g *Gemini) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (g *Gemini) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -597,7 +597,7 @@ func (g *Gemini) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (g *Gemini) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (g *Gemini) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -619,7 +619,7 @@ func (g *Gemini) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.Ca
}
// GetOrderInfo returns order information based on order ID
func (g *Gemini) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (g *Gemini) GetOrderInfo(_ context.Context, _ string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
var orderDetail order.Detail
return orderDetail, common.ErrNotYetImplemented
}

View File

@@ -466,6 +466,8 @@ func TestGetDepositAddress(t *testing.T) {
}
}
}
//nolint:gocritic // Only used as a testing helper function in this package
func setupWsAuth(t *testing.T) {
t.Helper()
if wsSetupRan {

View File

@@ -283,7 +283,7 @@ func (h *HitBTC) Run(ctx context.Context) {
}
// FetchTradablePairs returns a list of the exchanges tradable pairs
func (h *HitBTC) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) {
func (h *HitBTC) FetchTradablePairs(ctx context.Context, _ asset.Item) (currency.Pairs, error) {
symbols, err := h.GetSymbolsDetailed(ctx)
if err != nil {
return nil, err
@@ -479,12 +479,12 @@ func (h *HitBTC) FetchAccountInfo(ctx context.Context, assetType asset.Item) (ac
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (h *HitBTC) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (h *HitBTC) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (h *HitBTC) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (h *HitBTC) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -632,7 +632,7 @@ func (h *HitBTC) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (h *HitBTC) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (h *HitBTC) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -660,7 +660,7 @@ func (h *HitBTC) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.Ca
}
// GetOrderInfo returns order information based on order ID
func (h *HitBTC) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (h *HitBTC) GetOrderInfo(_ context.Context, _ string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
var orderDetail order.Detail
return orderDetail, common.ErrNotYetImplemented
}

View File

@@ -425,7 +425,7 @@ func (h *HUOBI) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error
}
// UpdateTickers updates the ticker for all currency pairs of a given asset type
func (h *HUOBI) UpdateTickers(ctx context.Context, a asset.Item) error {
func (h *HUOBI) UpdateTickers(_ context.Context, _ asset.Item) error {
return common.ErrFunctionNotSupported
}
@@ -820,12 +820,12 @@ func (h *HUOBI) FetchAccountInfo(ctx context.Context, assetType asset.Item) (acc
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (h *HUOBI) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (h *HUOBI) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (h *HUOBI) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (h *HUOBI) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -1034,7 +1034,7 @@ func (h *HUOBI) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (h *HUOBI) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (h *HUOBI) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}

View File

@@ -129,25 +129,25 @@ func (i *ItBit) Start(ctx context.Context, wg *sync.WaitGroup) error {
}
// Run implements the ItBit wrapper
func (i *ItBit) Run(ctx context.Context) {
func (i *ItBit) Run(_ context.Context) {
if i.Verbose {
i.PrintEnabledPairs()
}
}
// FetchTradablePairs returns a list of the exchanges tradable pairs
func (i *ItBit) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) {
func (i *ItBit) FetchTradablePairs(_ context.Context, _ asset.Item) (currency.Pairs, error) {
return nil, common.ErrFunctionNotSupported
}
// UpdateTradablePairs updates the exchanges available pairs and stores
// them in the exchanges config
func (i *ItBit) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error {
func (i *ItBit) UpdateTradablePairs(_ context.Context, _ bool) error {
return common.ErrFunctionNotSupported
}
// UpdateTickers updates the ticker for all currency pairs of a given asset type
func (i *ItBit) UpdateTickers(ctx context.Context, a asset.Item) error {
func (i *ItBit) UpdateTickers(_ context.Context, _ asset.Item) error {
return common.ErrFunctionNotSupported
}
@@ -325,12 +325,12 @@ func (i *ItBit) FetchAccountInfo(ctx context.Context, assetType asset.Item) (acc
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (i *ItBit) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (i *ItBit) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (i *ItBit) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (i *ItBit) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -445,7 +445,7 @@ func (i *ItBit) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (i *ItBit) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (i *ItBit) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -480,7 +480,7 @@ func (i *ItBit) CancelAllOrders(ctx context.Context, orderCancellation *order.Ca
}
// GetOrderInfo returns order information based on order ID
func (i *ItBit) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (i *ItBit) GetOrderInfo(_ context.Context, _ string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
var orderDetail order.Detail
return orderDetail, common.ErrNotYetImplemented
}

View File

@@ -877,9 +877,8 @@ func BenchmarkJustifyIntervalTimeStoringUnixValues1(b *testing.B) {
tt2 := time.Now().Add(-time.Hour)
tt3 := time.Now().Add(time.Hour)
for i := 0; i < b.N; i++ {
if tt1.Unix() == tt2.Unix() || //nolint:staticcheck // it is a benchmark to demonstrate inefficiency in calling
(tt1.Unix() > tt2.Unix() && tt1.Unix() < tt3.Unix()) {
if tt1.Unix() == tt2.Unix() || (tt1.Unix() > tt2.Unix() && tt1.Unix() < tt3.Unix()) {
continue
}
}
}
@@ -893,8 +892,8 @@ func BenchmarkJustifyIntervalTimeStoringUnixValues2(b *testing.B) {
tt2 := time.Now().Add(-time.Hour).Unix()
tt3 := time.Now().Add(time.Hour).Unix()
for i := 0; i < b.N; i++ {
if tt1 >= tt2 && tt1 <= tt3 { //nolint:staticcheck // it is a benchmark to demonstrate inefficiency in calling
if tt1 >= tt2 && tt1 <= tt3 {
continue
}
}
}

View File

@@ -657,12 +657,12 @@ func (k *Kraken) FetchAccountInfo(ctx context.Context, assetType asset.Item) (ac
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (k *Kraken) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (k *Kraken) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (k *Kraken) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (k *Kraken) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
withdrawals, err := k.WithdrawStatus(ctx, c, "")
for i := range withdrawals {
resp = append(resp, exchange.WithdrawalHistory{
@@ -831,7 +831,7 @@ func (k *Kraken) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (k *Kraken) CancelBatchOrders(ctx context.Context, orders []order.Cancel) (order.CancelBatchResponse, error) {
func (k *Kraken) CancelBatchOrders(_ context.Context, orders []order.Cancel) (order.CancelBatchResponse, error) {
if !k.Websocket.CanUseAuthenticatedWebsocketForWrapper() {
return order.CancelBatchResponse{}, common.ErrFunctionNotSupported
}
@@ -897,7 +897,7 @@ func (k *Kraken) CancelAllOrders(ctx context.Context, req *order.Cancel) (order.
}
// GetOrderInfo returns information on a current open order
func (k *Kraken) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (k *Kraken) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, assetType asset.Item) (order.Detail, error) {
var orderDetail order.Detail
switch assetType {
case asset.Spot:

View File

@@ -184,7 +184,7 @@ func (l *Lbank) Run(ctx context.Context) {
}
// FetchTradablePairs returns a list of the exchanges tradable pairs
func (l *Lbank) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) {
func (l *Lbank) FetchTradablePairs(ctx context.Context, _ asset.Item) (currency.Pairs, error) {
currencies, err := l.GetCurrencyPairs(ctx)
if err != nil {
return nil, err
@@ -381,12 +381,12 @@ func (l *Lbank) FetchAccountInfo(ctx context.Context, assetType asset.Item) (acc
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (l *Lbank) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (l *Lbank) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (l *Lbank) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (l *Lbank) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -507,7 +507,7 @@ func (l *Lbank) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (l *Lbank) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (l *Lbank) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -573,7 +573,7 @@ func (l *Lbank) CancelAllOrders(ctx context.Context, o *order.Cancel) (order.Can
}
// GetOrderInfo returns order information based on order ID
func (l *Lbank) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (l *Lbank) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
var resp order.Detail
orderIDs, err := l.getAllOpenOrderID(ctx)
if err != nil {

View File

@@ -768,7 +768,7 @@ func (o *OKCoin) CancelAllOrders(ctx context.Context, orderCancellation *order.C
}
// GetOrderInfo returns order information based on order ID
func (o *OKCoin) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (o *OKCoin) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, assetType asset.Item) (order.Detail, error) {
var resp order.Detail
if assetType != asset.Spot {
return resp, fmt.Errorf("%s %w", assetType, asset.ErrNotSupported)
@@ -870,7 +870,7 @@ func (o *OKCoin) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *with
}
// GetWithdrawalsHistory returns previous withdrawals data
func (o *OKCoin) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) ([]exchange.WithdrawalHistory, error) {
func (o *OKCoin) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) ([]exchange.WithdrawalHistory, error) {
return nil, common.ErrNotYetImplemented
}

View File

@@ -1445,7 +1445,7 @@ func (ok *Okx) GetFundsTransferState(ctx context.Context, transferID, clientID s
}
// GetAssetBillsDetails Query the billing record, you can get the latest 1 month historical data
func (ok *Okx) GetAssetBillsDetails(ctx context.Context, currency, clientID, clientSecret string, after, before time.Time, billType, limit int64) ([]AssetBillDetail, error) {
func (ok *Okx) GetAssetBillsDetails(ctx context.Context, currency, clientID string, after, before time.Time, billType, limit int64) ([]AssetBillDetail, error) {
params := url.Values{}
billTypeMap := map[int64]bool{1: true, 2: true, 13: true, 20: true, 21: true, 28: true, 47: true, 48: true, 49: true, 50: true, 51: true, 52: true, 53: true, 54: true, 61: true, 68: true, 69: true, 72: true, 73: true, 74: true, 75: true, 76: true, 77: true, 78: true, 79: true, 80: true, 81: true, 82: true, 83: true, 84: true, 85: true, 86: true, 87: true, 88: true, 89: true, 90: true, 91: true, 92: true, 93: true, 94: true, 95: true, 96: true, 97: true, 98: true, 99: true, 102: true, 103: true, 104: true, 105: true, 106: true, 107: true, 108: true, 109: true, 110: true, 111: true, 112: true, 113: true, 114: true, 115: true, 116: true, 117: true, 118: true, 119: true, 120: true, 121: true, 122: true, 123: true, 124: true, 125: true, 126: true, 127: true, 128: true, 129: true, 130: true, 131: true, 132: true, 133: true, 134: true, 135: true, 136: true, 137: true, 138: true, 139: true, 141: true, 142: true, 143: true, 144: true, 145: true, 146: true, 147: true, 150: true, 151: true, 152: true, 153: true, 154: true, 155: true, 156: true, 157: true, 160: true, 161: true, 162: true, 163: true, 169: true, 170: true, 171: true, 172: true, 173: true, 174: true, 175: true, 176: true, 177: true, 178: true, 179: true, 180: true, 181: true, 182: true, 183: true, 184: true, 185: true, 186: true, 187: true, 188: true, 189: true, 193: true, 194: true, 195: true, 196: true, 197: true, 198: true, 199: true, 200: true, 211: true}
if _, okay := billTypeMap[billType]; okay {
@@ -2058,6 +2058,9 @@ func (ok *Okx) GetMaximumAvailableTradableAmount(ctx context.Context, instrument
tradeMode != TradeModeCash {
return nil, errInvalidTradeModeValue
}
if reduceOnly {
params.Set("reduceOnly", "true")
}
params.Set("tdMode", tradeMode)
params.Set("px", strconv.FormatFloat(price, 'f', 0, 64))
var resp []MaximumTradableAmount

File diff suppressed because one or more lines are too long

View File

@@ -34,9 +34,11 @@ var defaultSubscribedChannels = []string{
okxChannelCandle5m,
okxChannelTickers,
}
var candlestickChannelsMap = map[string]bool{okxChannelCandle1Y: true, okxChannelCandle6M: true, okxChannelCandle3M: true, okxChannelCandle1M: true, okxChannelCandle1W: true, okxChannelCandle1D: true, okxChannelCandle2D: true, okxChannelCandle3D: true, okxChannelCandle5D: true, okxChannelCandle12H: true, okxChannelCandle6H: true, okxChannelCandle4H: true, okxChannelCandle2H: true, okxChannelCandle1H: true, okxChannelCandle30m: true, okxChannelCandle15m: true, okxChannelCandle5m: true, okxChannelCandle3m: true, okxChannelCandle1m: true, okxChannelCandle1Yutc: true, okxChannelCandle3Mutc: true, okxChannelCandle1Mutc: true, okxChannelCandle1Wutc: true, okxChannelCandle1Dutc: true, okxChannelCandle2Dutc: true, okxChannelCandle3Dutc: true, okxChannelCandle5Dutc: true, okxChannelCandle12Hutc: true, okxChannelCandle6Hutc: true}
var candlesticksMarkPriceMap = map[string]bool{okxChannelMarkPriceCandle1Y: true, okxChannelMarkPriceCandle6M: true, okxChannelMarkPriceCandle3M: true, okxChannelMarkPriceCandle1M: true, okxChannelMarkPriceCandle1W: true, okxChannelMarkPriceCandle1D: true, okxChannelMarkPriceCandle2D: true, okxChannelMarkPriceCandle3D: true, okxChannelMarkPriceCandle5D: true, okxChannelMarkPriceCandle12H: true, okxChannelMarkPriceCandle6H: true, okxChannelMarkPriceCandle4H: true, okxChannelMarkPriceCandle2H: true, okxChannelMarkPriceCandle1H: true, okxChannelMarkPriceCandle30m: true, okxChannelMarkPriceCandle15m: true, okxChannelMarkPriceCandle5m: true, okxChannelMarkPriceCandle3m: true, okxChannelMarkPriceCandle1m: true, okxChannelMarkPriceCandle1Yutc: true, okxChannelMarkPriceCandle3Mutc: true, okxChannelMarkPriceCandle1Mutc: true, okxChannelMarkPriceCandle1Wutc: true, okxChannelMarkPriceCandle1Dutc: true, okxChannelMarkPriceCandle2Dutc: true, okxChannelMarkPriceCandle3Dutc: true, okxChannelMarkPriceCandle5Dutc: true, okxChannelMarkPriceCandle12Hutc: true, okxChannelMarkPriceCandle6Hutc: true}
var candlesticksIndexPriceMap = map[string]bool{okxChannelIndexCandle1Y: true, okxChannelIndexCandle6M: true, okxChannelIndexCandle3M: true, okxChannelIndexCandle1M: true, okxChannelIndexCandle1W: true, okxChannelIndexCandle1D: true, okxChannelIndexCandle2D: true, okxChannelIndexCandle3D: true, okxChannelIndexCandle5D: true, okxChannelIndexCandle12H: true, okxChannelIndexCandle6H: true, okxChannelIndexCandle4H: true, okxChannelIndexCandle2H: true, okxChannelIndexCandle1H: true, okxChannelIndexCandle30m: true, okxChannelIndexCandle15m: true, okxChannelIndexCandle5m: true, okxChannelIndexCandle3m: true, okxChannelIndexCandle1m: true, okxChannelIndexCandle1Yutc: true, okxChannelIndexCandle3Mutc: true, okxChannelIndexCandle1Mutc: true, okxChannelIndexCandle1Wutc: true, okxChannelIndexCandle1Dutc: true, okxChannelIndexCandle2Dutc: true, okxChannelIndexCandle3Dutc: true, okxChannelIndexCandle5Dutc: true, okxChannelIndexCandle12Hutc: true, okxChannelIndexCandle6Hutc: true}
var (
candlestickChannelsMap = map[string]bool{okxChannelCandle1Y: true, okxChannelCandle6M: true, okxChannelCandle3M: true, okxChannelCandle1M: true, okxChannelCandle1W: true, okxChannelCandle1D: true, okxChannelCandle2D: true, okxChannelCandle3D: true, okxChannelCandle5D: true, okxChannelCandle12H: true, okxChannelCandle6H: true, okxChannelCandle4H: true, okxChannelCandle2H: true, okxChannelCandle1H: true, okxChannelCandle30m: true, okxChannelCandle15m: true, okxChannelCandle5m: true, okxChannelCandle3m: true, okxChannelCandle1m: true, okxChannelCandle1Yutc: true, okxChannelCandle3Mutc: true, okxChannelCandle1Mutc: true, okxChannelCandle1Wutc: true, okxChannelCandle1Dutc: true, okxChannelCandle2Dutc: true, okxChannelCandle3Dutc: true, okxChannelCandle5Dutc: true, okxChannelCandle12Hutc: true, okxChannelCandle6Hutc: true}
candlesticksMarkPriceMap = map[string]bool{okxChannelMarkPriceCandle1Y: true, okxChannelMarkPriceCandle6M: true, okxChannelMarkPriceCandle3M: true, okxChannelMarkPriceCandle1M: true, okxChannelMarkPriceCandle1W: true, okxChannelMarkPriceCandle1D: true, okxChannelMarkPriceCandle2D: true, okxChannelMarkPriceCandle3D: true, okxChannelMarkPriceCandle5D: true, okxChannelMarkPriceCandle12H: true, okxChannelMarkPriceCandle6H: true, okxChannelMarkPriceCandle4H: true, okxChannelMarkPriceCandle2H: true, okxChannelMarkPriceCandle1H: true, okxChannelMarkPriceCandle30m: true, okxChannelMarkPriceCandle15m: true, okxChannelMarkPriceCandle5m: true, okxChannelMarkPriceCandle3m: true, okxChannelMarkPriceCandle1m: true, okxChannelMarkPriceCandle1Yutc: true, okxChannelMarkPriceCandle3Mutc: true, okxChannelMarkPriceCandle1Mutc: true, okxChannelMarkPriceCandle1Wutc: true, okxChannelMarkPriceCandle1Dutc: true, okxChannelMarkPriceCandle2Dutc: true, okxChannelMarkPriceCandle3Dutc: true, okxChannelMarkPriceCandle5Dutc: true, okxChannelMarkPriceCandle12Hutc: true, okxChannelMarkPriceCandle6Hutc: true}
candlesticksIndexPriceMap = map[string]bool{okxChannelIndexCandle1Y: true, okxChannelIndexCandle6M: true, okxChannelIndexCandle3M: true, okxChannelIndexCandle1M: true, okxChannelIndexCandle1W: true, okxChannelIndexCandle1D: true, okxChannelIndexCandle2D: true, okxChannelIndexCandle3D: true, okxChannelIndexCandle5D: true, okxChannelIndexCandle12H: true, okxChannelIndexCandle6H: true, okxChannelIndexCandle4H: true, okxChannelIndexCandle2H: true, okxChannelIndexCandle1H: true, okxChannelIndexCandle30m: true, okxChannelIndexCandle15m: true, okxChannelIndexCandle5m: true, okxChannelIndexCandle3m: true, okxChannelIndexCandle1m: true, okxChannelIndexCandle1Yutc: true, okxChannelIndexCandle3Mutc: true, okxChannelIndexCandle1Mutc: true, okxChannelIndexCandle1Wutc: true, okxChannelIndexCandle1Dutc: true, okxChannelIndexCandle2Dutc: true, okxChannelIndexCandle3Dutc: true, okxChannelIndexCandle5Dutc: true, okxChannelIndexCandle12Hutc: true, okxChannelIndexCandle6Hutc: true}
)
const (
// allowableIterations use the first 25 bids and asks in the full load to form a string
@@ -1855,7 +1857,7 @@ func (ok *Okx) BalanceAndPositionSubscription(operation, uid string) error {
}
// WsOrderChannel for subscribing for orders.
func (ok *Okx) WsOrderChannel(operation string, assetType asset.Item, pair currency.Pair, instrumentID string) error {
func (ok *Okx) WsOrderChannel(operation string, assetType asset.Item, pair currency.Pair, _ string) error {
return ok.wsAuthChannelSubscription(operation, okxChannelOrders, assetType, pair, "", "", wsSubscriptionParameters{InstrumentType: true, InstrumentID: true, Underlying: true})
}

View File

@@ -268,7 +268,7 @@ func (ok *Okx) Run(ctx context.Context) {
}
// GetServerTime returns the current exchange server time.
func (ok *Okx) GetServerTime(ctx context.Context, ai asset.Item) (time.Time, error) {
func (ok *Okx) GetServerTime(ctx context.Context, _ asset.Item) (time.Time, error) {
return ok.GetSystemTime(ctx)
}
@@ -1133,12 +1133,12 @@ func (ok *Okx) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest
// WithdrawFiatFunds returns a withdrawal ID when a withdrawal is
// submitted
func (ok *Okx) WithdrawFiatFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error) {
func (ok *Okx) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error) {
return nil, common.ErrFunctionNotSupported
}
// WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
func (ok *Okx) WithdrawFiatFundsToInternationalBank(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error) {
func (ok *Okx) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -631,7 +631,7 @@ func (t Type) Lower() string {
// Title returns the type titleized, eg "Limit"
func (t Type) Title() string {
return strings.Title(strings.ToLower(t.String())) //nolint:staticcheck // Ignore Title usage warning
return strings.Title(strings.ToLower(t.String()))
}
// String implements the stringer interface
@@ -684,7 +684,7 @@ func (s Side) Lower() string {
// Title returns the side titleized, eg "Buy"
func (s Side) Title() string {
return strings.Title(strings.ToLower(s.String())) //nolint:staticcheck // Ignore Title usage warning
return strings.Title(strings.ToLower(s.String()))
}
// IsShort returns if the side is short
@@ -1002,8 +1002,10 @@ func StringToOrderType(oType string) (Type, error) {
return ImmediateOrCancel, nil
case Stop.String(), "STOP LOSS", "STOP_LOSS", "EXCHANGE STOP":
return Stop, nil
case StopLimit.String(), "EXCHANGE STOP LIMIT":
case StopLimit.String(), "EXCHANGE STOP LIMIT", "STOP_LIMIT":
return StopLimit, nil
case StopMarket.String(), "STOP_MARKET":
return StopMarket, nil
case TrailingStop.String(), "TRAILING STOP", "EXCHANGE TRAILING STOP":
return TrailingStop, nil
case FillOrKill.String(), "EXCHANGE FOK":

View File

@@ -264,7 +264,7 @@ func (p *Poloniex) Run(ctx context.Context) {
}
// FetchTradablePairs returns a list of the exchanges tradable pairs
func (p *Poloniex) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) {
func (p *Poloniex) FetchTradablePairs(ctx context.Context, _ asset.Item) (currency.Pairs, error) {
resp, err := p.GetTicker(ctx)
if err != nil {
return nil, err
@@ -466,12 +466,12 @@ func (p *Poloniex) FetchAccountInfo(ctx context.Context, assetType asset.Item) (
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (p *Poloniex) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (p *Poloniex) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (p *Poloniex) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (p *Poloniex) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -618,7 +618,7 @@ func (p *Poloniex) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (p *Poloniex) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (p *Poloniex) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -646,7 +646,7 @@ func (p *Poloniex) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.
}
// GetOrderInfo returns order information based on order ID
func (p *Poloniex) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (p *Poloniex) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, _ asset.Item) (order.Detail, error) {
orderInfo := order.Detail{
Exchange: p.Name,
Pair: pair,

View File

@@ -26,12 +26,12 @@ type CustomEx struct {
}
// Setup is a mock method for CustomEx
func (c *CustomEx) Setup(exch *config.Exchange) error {
func (c *CustomEx) Setup(_ *config.Exchange) error {
return nil
}
// Start is a mock method for CustomEx
func (c *CustomEx) Start(ctx context.Context, wg *sync.WaitGroup) error {
func (c *CustomEx) Start(_ context.Context, _ *sync.WaitGroup) error {
return nil
}
@@ -54,82 +54,82 @@ func (c *CustomEx) SetEnabled(bool) {
}
// ValidateCredentials is a mock method for CustomEx
func (c *CustomEx) ValidateCredentials(ctx context.Context, a asset.Item) error {
func (c *CustomEx) ValidateCredentials(_ context.Context, _ asset.Item) error {
return nil
}
// FetchTicker is a mock method for CustomEx
func (c *CustomEx) FetchTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error) {
func (c *CustomEx) FetchTicker(_ context.Context, _ currency.Pair, _ asset.Item) (*ticker.Price, error) {
return nil, nil
}
// UpdateTickers is a mock method for CustomEx
func (c *CustomEx) UpdateTickers(ctx context.Context, a asset.Item) error {
func (c *CustomEx) UpdateTickers(_ context.Context, _ asset.Item) error {
return nil
}
// UpdateTicker is a mock method for CustomEx
func (c *CustomEx) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error) {
func (c *CustomEx) UpdateTicker(_ context.Context, _ currency.Pair, _ asset.Item) (*ticker.Price, error) {
return nil, nil
}
// FetchOrderbook is a mock method for CustomEx
func (c *CustomEx) FetchOrderbook(ctx context.Context, p currency.Pair, a asset.Item) (*orderbook.Base, error) {
func (c *CustomEx) FetchOrderbook(_ context.Context, _ currency.Pair, _ asset.Item) (*orderbook.Base, error) {
return nil, nil
}
// UpdateOrderbook is a mock method for CustomEx
func (c *CustomEx) UpdateOrderbook(ctx context.Context, p currency.Pair, a asset.Item) (*orderbook.Base, error) {
func (c *CustomEx) UpdateOrderbook(_ context.Context, _ currency.Pair, _ asset.Item) (*orderbook.Base, error) {
return nil, nil
}
// FetchTradablePairs is a mock method for CustomEx
func (c *CustomEx) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) {
func (c *CustomEx) FetchTradablePairs(_ context.Context, _ asset.Item) (currency.Pairs, error) {
return nil, nil
}
// UpdateTradablePairs is a mock method for CustomEx
func (c *CustomEx) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error {
func (c *CustomEx) UpdateTradablePairs(_ context.Context, _ bool) error {
return nil
}
// GetEnabledPairs is a mock method for CustomEx
func (c *CustomEx) GetEnabledPairs(a asset.Item) (currency.Pairs, error) {
func (c *CustomEx) GetEnabledPairs(_ asset.Item) (currency.Pairs, error) {
return nil, nil
}
// GetAvailablePairs is a mock method for CustomEx
func (c *CustomEx) GetAvailablePairs(a asset.Item) (currency.Pairs, error) {
func (c *CustomEx) GetAvailablePairs(_ asset.Item) (currency.Pairs, error) {
return nil, nil
}
// FetchAccountInfo is a mock method for CustomEx
func (c *CustomEx) FetchAccountInfo(ctx context.Context, a asset.Item) (account.Holdings, error) {
func (c *CustomEx) FetchAccountInfo(_ context.Context, _ asset.Item) (account.Holdings, error) {
return account.Holdings{}, nil
}
// UpdateAccountInfo is a mock method for CustomEx
func (c *CustomEx) UpdateAccountInfo(ctx context.Context, a asset.Item) (account.Holdings, error) {
func (c *CustomEx) UpdateAccountInfo(_ context.Context, _ asset.Item) (account.Holdings, error) {
return account.Holdings{}, nil
}
// SetPairs is a mock method for CustomEx
func (c *CustomEx) SetPairs(pairs currency.Pairs, a asset.Item, enabled bool) error {
func (c *CustomEx) SetPairs(_ currency.Pairs, _ asset.Item, _ bool) error {
return nil
}
// GetAssetTypes is a mock method for CustomEx
func (c *CustomEx) GetAssetTypes(enabled bool) asset.Items {
func (c *CustomEx) GetAssetTypes(_ bool) asset.Items {
return nil
}
// GetRecentTrades is a mock method for CustomEx
func (c *CustomEx) GetRecentTrades(ctx context.Context, p currency.Pair, a asset.Item) ([]trade.Data, error) {
func (c *CustomEx) GetRecentTrades(_ context.Context, _ currency.Pair, _ asset.Item) ([]trade.Data, error) {
return nil, nil
}
// GetHistoricTrades is a mock method for CustomEx
func (c *CustomEx) GetHistoricTrades(ctx context.Context, p currency.Pair, a asset.Item, startTime, endTime time.Time) ([]trade.Data, error) {
func (c *CustomEx) GetHistoricTrades(_ context.Context, _ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error) {
return nil, nil
}
@@ -144,7 +144,7 @@ func (c *CustomEx) SupportsRESTTickerBatchUpdates() bool {
}
// GetFeeByType is a mock method for CustomEx
func (c *CustomEx) GetFeeByType(ctx context.Context, f *exchange.FeeBuilder) (float64, error) {
func (c *CustomEx) GetFeeByType(_ context.Context, _ *exchange.FeeBuilder) (float64, error) {
return 0.0, nil
}
@@ -164,17 +164,17 @@ func (c *CustomEx) FormatWithdrawPermissions() string {
}
// SupportsWithdrawPermissions is a mock method for CustomEx
func (c *CustomEx) SupportsWithdrawPermissions(permissions uint32) bool {
func (c *CustomEx) SupportsWithdrawPermissions(_ uint32) bool {
return false
}
// GetFundingHistory is a mock method for CustomEx
func (c *CustomEx) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (c *CustomEx) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, nil
}
// SubmitOrder is a mock method for CustomEx
func (c *CustomEx) SubmitOrder(ctx context.Context, s *order.Submit) (*order.SubmitResponse, error) {
func (c *CustomEx) SubmitOrder(_ context.Context, _ *order.Submit) (*order.SubmitResponse, error) {
return nil, nil
}
@@ -184,62 +184,62 @@ func (c *CustomEx) ModifyOrder(_ context.Context, _ *order.Modify) (*order.Modif
}
// CancelOrder is a mock method for CustomEx
func (c *CustomEx) CancelOrder(ctx context.Context, o *order.Cancel) error {
func (c *CustomEx) CancelOrder(_ context.Context, _ *order.Cancel) error {
return nil
}
// CancelBatchOrders is a mock method for CustomEx
func (c *CustomEx) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (c *CustomEx) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, nil
}
// CancelAllOrders is a mock method for CustomEx
func (c *CustomEx) CancelAllOrders(ctx context.Context, orders *order.Cancel) (order.CancelAllResponse, error) {
func (c *CustomEx) CancelAllOrders(_ context.Context, _ *order.Cancel) (order.CancelAllResponse, error) {
return order.CancelAllResponse{}, nil
}
// GetOrderInfo is a mock method for CustomEx
func (c *CustomEx) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (c *CustomEx) GetOrderInfo(_ context.Context, _ string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
return order.Detail{}, nil
}
// GetDepositAddress is a mock method for CustomEx
func (c *CustomEx) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, accountID, chain string) (*deposit.Address, error) {
func (c *CustomEx) GetDepositAddress(_ context.Context, _ currency.Code, _, _ string) (*deposit.Address, error) {
return nil, nil
}
// GetOrderHistory is a mock method for CustomEx
func (c *CustomEx) GetOrderHistory(ctx context.Context, getOrdersRequest *order.GetOrdersRequest) (order.FilteredOrders, error) {
func (c *CustomEx) GetOrderHistory(_ context.Context, _ *order.GetOrdersRequest) (order.FilteredOrders, error) {
return nil, nil
}
// GetWithdrawalsHistory is a mock method for CustomEx
func (c *CustomEx) GetWithdrawalsHistory(ctx context.Context, code currency.Code, a asset.Item) ([]exchange.WithdrawalHistory, error) {
func (c *CustomEx) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) ([]exchange.WithdrawalHistory, error) {
return []exchange.WithdrawalHistory{}, nil
}
// GetActiveOrders is a mock method for CustomEx
func (c *CustomEx) GetActiveOrders(ctx context.Context, getOrdersRequest *order.GetOrdersRequest) (order.FilteredOrders, error) {
func (c *CustomEx) GetActiveOrders(_ context.Context, _ *order.GetOrdersRequest) (order.FilteredOrders, error) {
return []order.Detail{}, nil
}
// WithdrawCryptocurrencyFunds is a mock method for CustomEx
func (c *CustomEx) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error) {
func (c *CustomEx) WithdrawCryptocurrencyFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error) {
return nil, nil
}
// WithdrawFiatFunds is a mock method for CustomEx
func (c *CustomEx) WithdrawFiatFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error) {
func (c *CustomEx) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error) {
return nil, nil
}
// WithdrawFiatFundsToInternationalBank is a mock method for CustomEx
func (c *CustomEx) WithdrawFiatFundsToInternationalBank(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error) {
func (c *CustomEx) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error) {
return nil, nil
}
// SetHTTPClientUserAgent is a mock method for CustomEx
func (c *CustomEx) SetHTTPClientUserAgent(ua string) error {
func (c *CustomEx) SetHTTPClientUserAgent(_ string) error {
return nil
}
@@ -249,7 +249,7 @@ func (c *CustomEx) GetHTTPClientUserAgent() (string, error) {
}
// SetClientProxyAddress is a mock method for CustomEx
func (c *CustomEx) SetClientProxyAddress(addr string) error {
func (c *CustomEx) SetClientProxyAddress(_ string) error {
return nil
}
@@ -264,7 +264,7 @@ func (c *CustomEx) GetSubscriptions() ([]stream.ChannelSubscription, error) {
}
// GetDefaultConfig is a mock method for CustomEx
func (c *CustomEx) GetDefaultConfig(ctx context.Context) (*config.Exchange, error) {
func (c *CustomEx) GetDefaultConfig(_ context.Context) (*config.Exchange, error) {
return nil, nil
}
@@ -274,17 +274,17 @@ func (c *CustomEx) GetBase() *exchange.Base {
}
// SupportsAsset is a mock method for CustomEx
func (c *CustomEx) SupportsAsset(assetType asset.Item) bool {
func (c *CustomEx) SupportsAsset(_ asset.Item) bool {
return false
}
// GetHistoricCandles is a mock method for CustomEx
func (c *CustomEx) GetHistoricCandles(ctx context.Context, p currency.Pair, a asset.Item, interval kline.Interval, timeStart, timeEnd time.Time) (*kline.Item, error) {
func (c *CustomEx) GetHistoricCandles(_ context.Context, _ currency.Pair, _ asset.Item, _ kline.Interval, _, _ time.Time) (*kline.Item, error) {
return &kline.Item{}, nil
}
// GetHistoricCandlesExtended is a mock method for CustomEx
func (c *CustomEx) GetHistoricCandlesExtended(ctx context.Context, p currency.Pair, a asset.Item, interval kline.Interval, timeStart, timeEnd time.Time) (*kline.Item, error) {
func (c *CustomEx) GetHistoricCandlesExtended(_ context.Context, _ currency.Pair, _ asset.Item, _ kline.Interval, _, _ time.Time) (*kline.Item, error) {
return &kline.Item{}, nil
}
@@ -314,17 +314,17 @@ func (c *CustomEx) SupportsWebsocket() bool {
}
// SubscribeToWebsocketChannels is a mock method for CustomEx
func (c *CustomEx) SubscribeToWebsocketChannels(channels []stream.ChannelSubscription) error {
func (c *CustomEx) SubscribeToWebsocketChannels(_ []stream.ChannelSubscription) error {
return nil
}
// UnsubscribeToWebsocketChannels is a mock method for CustomEx
func (c *CustomEx) UnsubscribeToWebsocketChannels(channels []stream.ChannelSubscription) error {
func (c *CustomEx) UnsubscribeToWebsocketChannels(_ []stream.ChannelSubscription) error {
return nil
}
// IsAssetWebsocketSupported is a mock method for CustomEx
func (c *CustomEx) IsAssetWebsocketSupported(aType asset.Item) bool {
func (c *CustomEx) IsAssetWebsocketSupported(_ asset.Item) bool {
return false
}
@@ -334,21 +334,21 @@ func (c *CustomEx) FlushWebsocketChannels() error {
}
// AuthenticateWebsocket is a mock method for CustomEx
func (c *CustomEx) AuthenticateWebsocket(ctx context.Context) error {
func (c *CustomEx) AuthenticateWebsocket(_ context.Context) error {
return nil
}
// GetOrderExecutionLimits is a mock method for CustomEx
func (c *CustomEx) GetOrderExecutionLimits(a asset.Item, cp currency.Pair) (order.MinMaxLevel, error) {
func (c *CustomEx) GetOrderExecutionLimits(_ asset.Item, _ currency.Pair) (order.MinMaxLevel, error) {
return order.MinMaxLevel{}, nil
}
// CheckOrderExecutionLimits is a mock method for CustomEx
func (c *CustomEx) CheckOrderExecutionLimits(a asset.Item, cp currency.Pair, price, amount float64, orderType order.Type) error {
func (c *CustomEx) CheckOrderExecutionLimits(_ asset.Item, _ currency.Pair, _, _ float64, _ order.Type) error {
return nil
}
// UpdateOrderExecutionLimits is a mock method for CustomEx
func (c *CustomEx) UpdateOrderExecutionLimits(ctx context.Context, a asset.Item) error {
func (c *CustomEx) UpdateOrderExecutionLimits(_ context.Context, _ asset.Item) error {
return nil
}

View File

@@ -48,6 +48,7 @@ func createSnapshot() (holder *Orderbook, asks, bids orderbook.Items, err error)
ch := make(chan interface{})
go func(<-chan interface{}) { // reader
for range ch {
continue
}
}(ch)
holder = &Orderbook{

View File

@@ -158,7 +158,7 @@ func (y *Yobit) Run(ctx context.Context) {
}
// FetchTradablePairs returns a list of the exchanges tradable pairs
func (y *Yobit) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) {
func (y *Yobit) FetchTradablePairs(ctx context.Context, _ asset.Item) (currency.Pairs, error) {
info, err := y.GetInfo(ctx)
if err != nil {
return nil, err
@@ -355,12 +355,12 @@ func (y *Yobit) FetchAccountInfo(ctx context.Context, assetType asset.Item) (acc
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (y *Yobit) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (y *Yobit) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (y *Yobit) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (y *Yobit) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -459,7 +459,7 @@ func (y *Yobit) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (y *Yobit) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (y *Yobit) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -507,7 +507,7 @@ func (y *Yobit) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.Can
}
// GetOrderInfo returns order information based on order ID
func (y *Yobit) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (y *Yobit) GetOrderInfo(_ context.Context, _ string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
var orderDetail order.Detail
return orderDetail, common.ErrNotYetImplemented
}
@@ -697,12 +697,12 @@ func (y *Yobit) ValidateCredentials(ctx context.Context, assetType asset.Item) e
}
// GetHistoricCandles returns candles between a time period for a set time interval
func (y *Yobit) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error) {
func (y *Yobit) GetHistoricCandles(_ context.Context, _ currency.Pair, _ asset.Item, _ kline.Interval, _, _ time.Time) (*kline.Item, error) {
return nil, common.ErrFunctionNotSupported
}
// GetHistoricCandlesExtended returns candles between a time period for a set time interval
func (y *Yobit) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error) {
func (y *Yobit) GetHistoricCandlesExtended(_ context.Context, _ currency.Pair, _ asset.Item, _ kline.Interval, _, _ time.Time) (*kline.Item, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -37,6 +37,7 @@ func areTestAPIKeysSet() bool {
return z.ValidateAPICredentials(z.GetDefaultCredentials()) == nil
}
//nolint:gocritic // Only used as a testing helper function in this package
func setupWsAuth(t *testing.T) {
t.Helper()
if wsSetupRan {

View File

@@ -227,7 +227,7 @@ func (z *ZB) Run(ctx context.Context) {
}
// FetchTradablePairs returns a list of the exchanges tradable pairs
func (z *ZB) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) {
func (z *ZB) FetchTradablePairs(ctx context.Context, _ asset.Item) (currency.Pairs, error) {
markets, err := z.GetMarkets(ctx)
if err != nil {
return nil, err
@@ -431,12 +431,12 @@ func (z *ZB) FetchAccountInfo(ctx context.Context, assetType asset.Item) (accoun
// GetFundingHistory returns funding history, deposits and
// withdrawals
func (z *ZB) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error) {
func (z *ZB) GetFundingHistory(_ context.Context) ([]exchange.FundHistory, error) {
return nil, common.ErrFunctionNotSupported
}
// GetWithdrawalsHistory returns previous withdrawals data
func (z *ZB) GetWithdrawalsHistory(ctx context.Context, c currency.Code, a asset.Item) (resp []exchange.WithdrawalHistory, err error) {
func (z *ZB) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) (resp []exchange.WithdrawalHistory, err error) {
return nil, common.ErrNotYetImplemented
}
@@ -567,7 +567,7 @@ func (z *ZB) CancelOrder(ctx context.Context, o *order.Cancel) error {
}
// CancelBatchOrders cancels an orders by their corresponding ID numbers
func (z *ZB) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error) {
func (z *ZB) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error) {
return order.CancelBatchResponse{}, common.ErrNotYetImplemented
}
@@ -630,7 +630,7 @@ func (z *ZB) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.Cancel
}
// GetOrderInfo returns order information based on order ID
func (z *ZB) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
func (z *ZB) GetOrderInfo(_ context.Context, _ string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
var orderDetail order.Detail
return orderDetail, common.ErrNotYetImplemented
}