qa/spelling: Add Codespell support (#1121)

* Add codespell support

* Fix paths

* Add HTML files to exclusion list
This commit is contained in:
Adrian Gallagher
2023-01-30 12:36:56 +11:00
committed by GitHub
parent c785ae73a7
commit a79e0d2b3e
108 changed files with 359 additions and 318 deletions

View File

@@ -326,14 +326,14 @@ func (a *Alphapoint) GetOrderInfo(ctx context.Context, orderID string, pair curr
// GetDepositAddress returns a deposit address for a specified currency
func (a *Alphapoint) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, _, _ string) (string, error) {
addreses, err := a.GetDepositAddresses(ctx)
addresses, err := a.GetDepositAddresses(ctx)
if err != nil {
return "", err
}
for x := range addreses {
if addreses[x].Name == cryptocurrency.String() {
return addreses[x].DepositAddress, nil
for x := range addresses {
if addresses[x].Name == cryptocurrency.String() {
return addresses[x].DepositAddress, nil
}
}
return "", errors.New("associated currency address not found")

View File

@@ -101,10 +101,10 @@ func TestNew(t *testing.T) {
t.Parallel()
returned, err := New(tt.Input)
if !errors.Is(err, tt.Error) {
t.Fatalf("receieved: '%v' but expected: '%v'", err, tt.Error)
t.Fatalf("received: '%v' but expected: '%v'", err, tt.Error)
}
if returned != tt.Expected {
t.Fatalf("receieved: '%v' but expected: '%v'", returned, tt.Expected)
t.Fatalf("received: '%v' but expected: '%v'", returned, tt.Expected)
}
})
}
@@ -198,7 +198,7 @@ func TestUnmarshalMarshal(t *testing.T) {
t.Parallel()
data, err := json.Marshal(Item(0))
if !errors.Is(err, nil) {
t.Fatalf("receieved: '%v' but expected: '%v'", err, nil)
t.Fatalf("received: '%v' but expected: '%v'", err, nil)
}
if string(data) != `""` {
@@ -207,7 +207,7 @@ func TestUnmarshalMarshal(t *testing.T) {
data, err = json.Marshal(Spot)
if !errors.Is(err, nil) {
t.Fatalf("receieved: '%v' but expected: '%v'", err, nil)
t.Fatalf("received: '%v' but expected: '%v'", err, nil)
}
if string(data) != `"spot"` {
@@ -218,7 +218,7 @@ func TestUnmarshalMarshal(t *testing.T) {
err = json.Unmarshal(data, &spot)
if !errors.Is(err, nil) {
t.Fatalf("receieved: '%v' but expected: '%v'", err, nil)
t.Fatalf("received: '%v' but expected: '%v'", err, nil)
}
if spot != Spot {
@@ -227,23 +227,23 @@ func TestUnmarshalMarshal(t *testing.T) {
err = json.Unmarshal([]byte(`"confused"`), &spot)
if !errors.Is(err, ErrNotSupported) {
t.Fatalf("receieved: '%v' but expected: '%v'", err, ErrNotSupported)
t.Fatalf("received: '%v' but expected: '%v'", err, ErrNotSupported)
}
err = json.Unmarshal([]byte(`""`), &spot)
if !errors.Is(err, nil) {
t.Fatalf("receieved: '%v' but expected: '%v'", err, nil)
t.Fatalf("received: '%v' but expected: '%v'", err, nil)
}
err = json.Unmarshal([]byte(`123`), &spot)
if errors.Is(err, nil) {
t.Fatalf("receieved: '%v' but expected: '%v'", nil, "an error")
t.Fatalf("received: '%v' but expected: '%v'", nil, "an error")
}
}
func TestUseDefault(t *testing.T) {
t.Parallel()
if UseDefault() != Spot {
t.Fatalf("receieved: '%v' but expected: '%v'", UseDefault(), Spot)
t.Fatalf("received: '%v' but expected: '%v'", UseDefault(), Spot)
}
}

View File

@@ -346,7 +346,7 @@ func (b *Binance) batchAggregateTrades(ctx context.Context, arg *AggregatedTrade
//
// KlinesRequestParams supports 5 parameters
// symbol: the symbol to get the kline data for
// limit: optinal
// limit: optional
// interval: the interval time for the data
// startTime: startTime filter for kline data
// endTime: endTime filter for the kline data

View File

@@ -2410,7 +2410,7 @@ func TestExecutionTypeToOrderStatus(t *testing.T) {
for i := range testCases {
result, _ := stringToOrderStatus(testCases[i].Case)
if result != testCases[i].Result {
t.Errorf("Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Expected: %v, received: %v", testCases[i].Result, result)
}
}
}

View File

@@ -140,7 +140,7 @@ type OrderBook struct {
type DepthUpdateParams []struct {
PriceLevel float64
Quantity float64
ingnore []interface{}
ignore []interface{}
}
// WebsocketDepthStream is the difference for the update depth stream
@@ -894,7 +894,7 @@ type update struct {
lastUpdateID int64
}
// job defines a synchonisation job that tells a go routine to fetch an
// job defines a synchronisation job that tells a go routine to fetch an
// orderbook via the REST protocol
type job struct {
Pair currency.Pair

View File

@@ -1808,7 +1808,7 @@ func TestExecutionTypeToOrderStatus(t *testing.T) {
for i := range testCases {
result, _ := stringToOrderStatus(testCases[i].Case)
if result != testCases[i].Result {
t.Errorf("Binanceus Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Binanceus expected: %v, received: %v", testCases[i].Result, result)
}
}
}

View File

@@ -367,7 +367,7 @@ func (a *KlineStream) UnmarshalJSON(data []byte) error {
return nil
}
// UnmarshalJSON deserialises the JSON info, including the (Timesamp and EventTime) timestamp
// UnmarshalJSON deserialises the JSON info, including the (Timestamp and EventTime) timestamp
func (a *TradeStream) UnmarshalJSON(data []byte) error {
type Alias TradeStream
aux := &struct {

View File

@@ -813,7 +813,7 @@ func (b *Bitfinex) GetTrades(ctx context.Context, currencyPair string, limit, ti
return history, nil
}
// GetOrderbook retieves the orderbook bid and ask price points for a currency
// GetOrderbook retrieves the orderbook bid and ask price points for a currency
// pair - By default the response will return 25 bid and 25 ask price points.
// symbol - Example "tBTCUSD"
// precision - P0,P1,P2,P3,R0
@@ -1078,7 +1078,7 @@ func (b *Bitfinex) GetCandles(ctx context.Context, symbol, timeFrame string, sta
return []Candle{c}, nil
}
// GetConfigurations fetchs currency and symbol site configuration data.
// GetConfigurations fetches currency and symbol site configuration data.
func (b *Bitfinex) GetConfigurations() error {
return common.ErrNotYetImplemented
}
@@ -1808,7 +1808,7 @@ func (b *Bitfinex) SendHTTPRequest(ctx context.Context, ep exchange.URL, path st
})
}
// SendAuthenticatedHTTPRequest sends an autheticated http request and json
// SendAuthenticatedHTTPRequest sends an authenticated http request and json
// unmarshals result to a supplied variable
func (b *Bitfinex) SendAuthenticatedHTTPRequest(ctx context.Context, ep exchange.URL, method, path string, params map[string]interface{}, result interface{}, endpoint request.EndpointLimit) error {
creds, err := b.GetCredentials(ctx)
@@ -1862,7 +1862,7 @@ func (b *Bitfinex) SendAuthenticatedHTTPRequest(ctx context.Context, ep exchange
})
}
// SendAuthenticatedHTTPRequestV2 sends an autheticated http request and json
// SendAuthenticatedHTTPRequestV2 sends an authenticated http request and json
// unmarshals result to a supplied variable
func (b *Bitfinex) SendAuthenticatedHTTPRequestV2(ctx context.Context, ep exchange.URL, method, path string, params map[string]interface{}, result interface{}, endpoint request.EndpointLimit) error {
creds, err := b.GetCredentials(ctx)

View File

@@ -1600,7 +1600,7 @@ func (b *Bitfinex) Unsubscribe(channelsToUnsubscribe []stream.ChannelSubscriptio
return nil
}
// WsSendAuth sends a autheticated event payload
// WsSendAuth sends a authenticated event payload
func (b *Bitfinex) WsSendAuth(ctx context.Context) error {
creds, err := b.GetCredentials(ctx)
if err != nil {

View File

@@ -1026,7 +1026,7 @@ func (b *Bitfinex) GetOrderHistory(ctx context.Context, req *order.GetOrdersRequ
orderDetail.Status = order.UnknownStatus
}
// API docs discrepency. Example contains prefixed "exchange "
// API docs discrepancy. Example contains prefixed "exchange "
// Return type suggests “market” / “limit” / “stop” / “trailing-stop”
orderType := strings.Replace(resp[i].Type, "exchange ", "", 1)
if orderType == "trailing-stop" {

View File

@@ -20,8 +20,8 @@ const (
statsReqRate = 90
candleReqRate = 60
configsReqRate = 15
statusReqRate = 15 // This is not specified just inputed WCS
liquidReqRate = 15 // This is not specified just inputed WCS
statusReqRate = 15 // This is not specified just inputted WCS
liquidReqRate = 15 // This is not specified just inputted WCS
leaderBoardReqRate = 90
marketAveragePriceReqRate = 20
fxReqRate = 20
@@ -32,11 +32,11 @@ const (
accountWalletHistoryReqRate = 45
// Orders -
retrieveOrderReqRate = 45
submitOrderReqRate = 45 // This is not specified just inputed above
updateOrderReqRate = 45 // This is not specified just inputed above
cancelOrderReqRate = 45 // This is not specified just inputed above
orderBatchReqRate = 45 // This is not specified just inputed above
cancelBatchReqRate = 45 // This is not specified just inputed above
submitOrderReqRate = 45 // This is not specified just inputted above
updateOrderReqRate = 45 // This is not specified just inputted above
cancelOrderReqRate = 45 // This is not specified just inputted above
orderBatchReqRate = 45 // This is not specified just inputted above
cancelBatchReqRate = 45 // This is not specified just inputted above
orderHistoryReqRate = 45
getOrderTradesReqRate = 45
getTradesReqRate = 45
@@ -44,19 +44,19 @@ const (
// Positions -
getAccountMarginInfoReqRate = 45
getActivePositionsReqRate = 45
claimPositionReqRate = 45 // This is not specified just inputed above
claimPositionReqRate = 45 // This is not specified just inputted above
getPositionHistoryReqRate = 45
getPositionAuditReqRate = 45
updateCollateralOnPositionReqRate = 45 // This is not specified just inputed above
updateCollateralOnPositionReqRate = 45 // This is not specified just inputted above
// Margin funding -
getMarginInfoRate = 90
getActiveFundingOffersReqRate = 45
submitFundingOfferReqRate = 45 // This is not specified just inputed above
submitFundingOfferReqRate = 45 // This is not specified just inputted above
cancelFundingOfferReqRate = 45
cancelAllFundingOfferReqRate = 45 // This is not specified just inputed above
closeFundingReqRate = 45 // This is not specified just inputed above
fundingAutoRenewReqRate = 45 // This is not specified just inputed above
keepFundingReqRate = 45 // This is not specified just inputed above
cancelAllFundingOfferReqRate = 45 // This is not specified just inputted above
closeFundingReqRate = 45 // This is not specified just inputted above
fundingAutoRenewReqRate = 45 // This is not specified just inputted above
keepFundingReqRate = 45 // This is not specified just inputted above
getOffersHistoryReqRate = 45
getFundingLoansReqRate = 45
getFundingLoanHistoryReqRate = 45
@@ -66,29 +66,29 @@ const (
getFundingInfoReqRate = 45
// Account actions
getUserInfoReqRate = 45
transferBetweenWalletsReqRate = 45 // This is not specified just inputed above
getDepositAddressReqRate = 45 // This is not specified just inputed above
withdrawalReqRate = 45 // This is not specified just inputed above
transferBetweenWalletsReqRate = 45 // This is not specified just inputted above
getDepositAddressReqRate = 45 // This is not specified just inputted above
withdrawalReqRate = 45 // This is not specified just inputted above
getMovementsReqRate = 45
getAlertListReqRate = 45
setPriceAlertReqRate = 45 // This is not specified just inputed above
deletePriceAlertReqRate = 45 // This is not specified just inputed above
setPriceAlertReqRate = 45 // This is not specified just inputted above
deletePriceAlertReqRate = 45 // This is not specified just inputted above
getBalanceForOrdersOffersReqRate = 30
userSettingsWriteReqRate = 45 // This is not specified just inputed general count
userSettingsWriteReqRate = 45 // This is not specified just inputted general count
userSettingsReadReqRate = 45
userSettingsDeleteReqRate = 45 // This is not specified just inputed above
userSettingsDeleteReqRate = 45 // This is not specified just inputted above
// Account V1 endpoints
getAccountFeesReqRate = 5
getWithdrawalFeesReqRate = 5
getAccountSummaryReqRate = 5 // This is not specified just inputed above
newDepositAddressReqRate = 5 // This is not specified just inputed above
getKeyPermissionsReqRate = 5 // This is not specified just inputed above
getMarginInfoReqRate = 5 // This is not specified just inputed above
getAccountSummaryReqRate = 5 // This is not specified just inputted above
newDepositAddressReqRate = 5 // This is not specified just inputted above
getKeyPermissionsReqRate = 5 // This is not specified just inputted above
getMarginInfoReqRate = 5 // This is not specified just inputted above
getAccountBalanceReqRate = 10
walletTransferReqRate = 10 // This is not specified just inputed above
withdrawV1ReqRate = 10 // This is not specified just inputed above
orderV1ReqRate = 10 // This is not specified just inputed above
orderMultiReqRate = 10 // This is not specified just inputed above
walletTransferReqRate = 10 // This is not specified just inputted above
withdrawV1ReqRate = 10 // This is not specified just inputted above
orderV1ReqRate = 10 // This is not specified just inputted above
orderMultiReqRate = 10 // This is not specified just inputted above
statsV1ReqRate = 10
fundingbookReqRate = 15
lendsReqRate = 30

View File

@@ -37,7 +37,7 @@ const (
pubGetHealth = "/gethealth"
pubGetChats = "/getchats"
// Autheticated Endpoints
// Authenticated Endpoints
privGetPermissions = "/me/getpermissions"
privGetBalance = "/me/getbalance"
privMarginStatus = "/me/getcollateral"
@@ -161,7 +161,7 @@ func (b *Bitflyer) GetExchangeStatus(ctx context.Context) (string, error) {
}
// GetChats returns trollbox chat log
// Note: returns vary from instant to infinty
// Note: returns vary from instant to infinity
func (b *Bitflyer) GetChats(ctx context.Context, fromDate string) ([]ChatLog, error) {
var resp []ChatLog
v := url.Values{}

View File

@@ -224,7 +224,7 @@ func (b *Bithumb) GetAccountBalance(ctx context.Context, c string) (FullBalance,
return fullBalance, err
}
// Added due to increasing of the usuable currencies on exchange, usually
// Added due to increasing of the usable currencies on exchange, usually
// without notificatation, so we dont need to update structs later on
for tag, datum := range response.Data {
splitTag := strings.Split(tag, "_")

View File

@@ -93,7 +93,7 @@ type update struct {
lastUpdated time.Time
}
// job defines a synchonisation job that tells a go routine to fetch an
// job defines a synchronisation job that tells a go routine to fetch an
// orderbook via the REST protocol
type job struct {
Pair currency.Pair

View File

@@ -206,7 +206,7 @@ func (b *Bitmex) GetTrollboxConnectedUsers(ctx context.Context) (ConnectedUsers,
}
// GetAccountExecutions returns all raw transactions, which includes order
// opening and cancelation, and order status changes. It can be quite noisy.
// opening and cancellation, and order status changes. It can be quite noisy.
// More focused information is available at /execution/tradeHistory.
func (b *Bitmex) GetAccountExecutions(ctx context.Context, params *GenericRequestParams) ([]Execution, error) {
var executionList []Execution

View File

@@ -109,7 +109,7 @@ func (p *APIKeyParams) ToURLVals(path string) (string, error) {
return common.EncodeURLValues(path, values), nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p *APIKeyParams) IsNil() bool {
return (APIKeyParams{}) == *p
}
@@ -144,7 +144,7 @@ func (p *ChatGetParams) ToURLVals(path string) (string, error) {
return common.EncodeURLValues(path, values), nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p *ChatGetParams) IsNil() bool {
return *p == (ChatGetParams{})
}
@@ -172,7 +172,7 @@ func (p ChatSendParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p *ChatSendParams) IsNil() bool {
return *p == (ChatSendParams{})
}
@@ -229,7 +229,7 @@ func (p *GenericRequestParams) ToURLVals(path string) (string, error) {
return common.EncodeURLValues(path, values), nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p *GenericRequestParams) IsNil() bool {
return *p == (GenericRequestParams{})
}
@@ -251,7 +251,7 @@ func (p LeaderboardGetParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p LeaderboardGetParams) IsNil() bool {
return p == (LeaderboardGetParams{})
}
@@ -343,7 +343,7 @@ func (p *OrderNewParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p *OrderNewParams) IsNil() bool {
return *p == (OrderNewParams{})
}
@@ -408,7 +408,7 @@ func (p *OrderAmendParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p *OrderAmendParams) IsNil() bool {
return *p == (OrderAmendParams{})
}
@@ -436,7 +436,7 @@ func (p OrderCancelParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p OrderCancelParams) IsNil() bool {
return p == (OrderCancelParams{})
}
@@ -467,7 +467,7 @@ func (p OrderCancelAllParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p OrderCancelAllParams) IsNil() bool {
return p == (OrderCancelAllParams{})
}
@@ -489,7 +489,7 @@ func (p OrderAmendBulkParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p OrderAmendBulkParams) IsNil() bool {
return len(p.Orders) == 0
}
@@ -511,7 +511,7 @@ func (p OrderNewBulkParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p OrderNewBulkParams) IsNil() bool {
return len(p.Orders) == 0
}
@@ -534,7 +534,7 @@ func (p OrderCancelAllAfterParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p OrderCancelAllAfterParams) IsNil() bool {
return p == (OrderCancelAllAfterParams{})
}
@@ -560,7 +560,7 @@ func (p OrderClosePositionParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p OrderClosePositionParams) IsNil() bool {
return p == (OrderClosePositionParams{})
}
@@ -590,7 +590,7 @@ func (p OrderBookGetL2Params) ToURLVals(path string) (string, error) {
return common.EncodeURLValues(path, values), nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p OrderBookGetL2Params) IsNil() bool {
return p == (OrderBookGetL2Params{})
}
@@ -619,7 +619,7 @@ func (p PositionGetParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p PositionGetParams) IsNil() bool {
return p == (PositionGetParams{})
}
@@ -645,7 +645,7 @@ func (p PositionIsolateMarginParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p PositionIsolateMarginParams) IsNil() bool {
return p == (PositionIsolateMarginParams{})
}
@@ -672,7 +672,7 @@ func (p PositionUpdateLeverageParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p PositionUpdateLeverageParams) IsNil() bool {
return p == (PositionUpdateLeverageParams{})
}
@@ -698,7 +698,7 @@ func (p PositionUpdateRiskLimitParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p PositionUpdateRiskLimitParams) IsNil() bool {
return p == (PositionUpdateRiskLimitParams{})
}
@@ -724,7 +724,7 @@ func (p PositionTransferIsolatedMarginParams) ToURLVals(path string) (string, er
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p PositionTransferIsolatedMarginParams) IsNil() bool {
return p == (PositionTransferIsolatedMarginParams{})
}
@@ -784,7 +784,7 @@ func (p *QuoteGetBucketedParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p *QuoteGetBucketedParams) IsNil() bool {
return *p == (QuoteGetBucketedParams{})
}
@@ -845,7 +845,7 @@ func (p *TradeGetBucketedParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p *TradeGetBucketedParams) IsNil() bool {
return *p == (TradeGetBucketedParams{})
}
@@ -882,7 +882,7 @@ func (p *UserUpdateParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p *UserUpdateParams) IsNil() bool {
return *p == (UserUpdateParams{})
}
@@ -903,7 +903,7 @@ func (p UserTokenParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p UserTokenParams) IsNil() bool {
return p == (UserTokenParams{})
}
@@ -925,7 +925,7 @@ func (p UserCheckReferralCodeParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p UserCheckReferralCodeParams) IsNil() bool {
return p == (UserCheckReferralCodeParams{})
}
@@ -951,7 +951,7 @@ func (p UserConfirmTFAParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p UserConfirmTFAParams) IsNil() bool {
return p == (UserConfirmTFAParams{})
}
@@ -972,7 +972,7 @@ func (p UserCurrencyParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p UserCurrencyParams) IsNil() bool {
return p == (UserCurrencyParams{})
}
@@ -997,7 +997,7 @@ func (p UserPreferencesParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p UserPreferencesParams) IsNil() bool {
return p == (UserPreferencesParams{})
}
@@ -1034,7 +1034,7 @@ func (p UserRequestWithdrawalParams) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p UserRequestWithdrawalParams) IsNil() bool {
return p == (UserRequestWithdrawalParams{})
}
@@ -1062,7 +1062,7 @@ func (p *OrdersRequest) ToURLVals(path string) (string, error) {
return "", nil
}
// IsNil checks to see if any values has been set for the paramater
// IsNil checks to see if any values has been set for the parameter
func (p *OrdersRequest) IsNil() bool {
return *p == (OrdersRequest{})
}

View File

@@ -201,7 +201,7 @@ func (b *Bitstamp) GetTradingPairs(ctx context.Context) ([]TradingPair, error) {
}
// GetTransactions returns transaction information
// value paramater ["time"] = "minute", "hour", "day" will collate your
// value parameter ["time"] = "minute", "hour", "day" will collate your
// response into time intervals.
func (b *Bitstamp) GetTransactions(ctx context.Context, currencyPair, timePeriod string) ([]Transactions, error) {
var transactions []Transactions

View File

@@ -358,7 +358,7 @@ func TestGetOpenDepositsForCurrency(t *testing.T) {
func TestWithdraw(t *testing.T) {
t.Parallel()
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or canManipulateRealOrders isnt set correctly")
t.Skip("skipping test, either api keys or canManipulateRealOrders isn't set correctly")
}
_, err := b.Withdraw(context.Background(),
curr, "", core.BitcoinDonationAddress, 0.0009)

View File

@@ -297,7 +297,7 @@ type update struct {
needsFetchingBook bool
}
// job defines a synchonisation job that tells a go routine to fetch an
// job defines a synchronisation job that tells a go routine to fetch an
// orderbook via the REST protocol
type job struct {
Pair currency.Pair

View File

@@ -244,7 +244,7 @@ func TestSubmitOrder(t *testing.T) {
}
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
_, err = b.SubmitOrder(context.Background(), &order.Submit{
Exchange: b.Name,
@@ -263,7 +263,7 @@ func TestSubmitOrder(t *testing.T) {
func TestNewOrder(t *testing.T) {
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
_, err := b.NewOrder(context.Background(), 100, 1, 0, 0, BTCAUD, limit, bidSide, "", "", "", true)
if err != nil {
@@ -289,7 +289,7 @@ func TestGetOrders(t *testing.T) {
func TestCancelOpenOrders(t *testing.T) {
t.Parallel()
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
temp := []string{BTCAUD, LTCAUD}
_, err := b.CancelAllOpenOrdersByPairs(context.Background(), temp)
@@ -321,7 +321,7 @@ func TestFetchOrder(t *testing.T) {
func TestRemoveOrder(t *testing.T) {
t.Parallel()
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
_, err := b.RemoveOrder(context.Background(), "")
if err != nil {
@@ -469,7 +469,7 @@ func TestGetReport(t *testing.T) {
func TestRequestWithdaw(t *testing.T) {
t.Parallel()
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
_, err := b.RequestWithdraw(context.Background(), "BTC", 1, "sdjflajdslfjld", "", "", "", "")
if err == nil {
@@ -480,7 +480,7 @@ func TestRequestWithdaw(t *testing.T) {
func TestBatchPlaceCancelOrders(t *testing.T) {
t.Parallel()
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
var temp []PlaceBatch
o := PlaceBatch{
@@ -511,7 +511,7 @@ func TestGetBatchTrades(t *testing.T) {
func TestCancelBatch(t *testing.T) {
t.Parallel()
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
temp := []string{"4477045999", "4477381751", "4477381751"}
_, err := b.CancelBatch(context.Background(), temp)
@@ -1055,7 +1055,7 @@ func TestReplaceOrder(t *testing.T) {
}
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
_, err = b.ReplaceOrder(context.Background(), "8207096301", "bruh", 100000, 0.001)
@@ -1072,7 +1072,7 @@ func TestWrapperModifyOrder(t *testing.T) {
}
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
mo, err := b.ModifyOrder(context.Background(), &order.Modify{
Pair: currency.NewPair(currency.BTC, currency.AUD),

View File

@@ -18,7 +18,7 @@ const (
btcmarketsWithdrawLimit = 10
btcmarketsCreateNewReportLimit = 1
// Used to match endpints to rate limits
// Used to match endpoints to rate limits
orderFunc request.EndpointLimit = iota
batchFunc
withdrawFunc

View File

@@ -600,7 +600,7 @@ func (b *BTSE) calculateTradingFee(ctx context.Context, feeBuilder *exchange.Fee
}
feeTiers, err := b.GetFeeInformation(ctx, formattedPair.String())
if err != nil {
// TODO: Return actual error, we should't pivot around errors.
// TODO: Return actual error, we shouldn't pivot around errors.
if feeBuilder.IsMaker {
return 0.001
}

View File

@@ -711,7 +711,7 @@ func TestStatusToStandardStatus(t *testing.T) {
for i := range testCases {
result, _ := stringToOrderStatus(testCases[i].Case)
if result != testCases[i].Result {
t.Errorf("Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Expected: %v, received: %v", testCases[i].Result, result)
}
}
}

View File

@@ -706,7 +706,7 @@ func (b *BTSE) GetDepositAddress(ctx context.Context, c currency.Code, accountID
return nil, err
}
exctractor := func(addr string) (string, string) {
extractor := func(addr string) (string, string) {
if strings.Contains(addr, ":") {
split := strings.Split(addr, ":")
return split[0], split[1]
@@ -720,7 +720,7 @@ func (b *BTSE) GetDepositAddress(ctx context.Context, c currency.Code, accountID
return nil, err
}
if len(addressCreate) != 0 {
addr, tag := exctractor(addressCreate[0].Address)
addr, tag := extractor(addressCreate[0].Address)
return &deposit.Address{
Address: addr,
Tag: tag,
@@ -728,7 +728,7 @@ func (b *BTSE) GetDepositAddress(ctx context.Context, c currency.Code, accountID
}
return nil, errors.New("address not found")
}
addr, tag := exctractor(address[0].Address)
addr, tag := extractor(address[0].Address)
return &deposit.Address{
Address: addr,
Tag: tag,

View File

@@ -34,8 +34,8 @@ var (
errInvalidCategory = errors.New("invalid category")
errInvalidCoin = errors.New("coin can't be empty")
errStopOrderOrOrderLinkIDMissing = errors.New("atleast one should be present among stopOrderID and orderLinkID")
errOrderOrOrderLinkIDMissing = errors.New("atleast one should be present among orderID and orderLinkID")
errStopOrderOrOrderLinkIDMissing = errors.New("at least one should be present among stopOrderID and orderLinkID")
errOrderOrOrderLinkIDMissing = errors.New("at least one should be present among orderID and orderLinkID")
errSymbolMissing = errors.New("symbol missing")
errUnsupportedOrderType = errors.New("unsupported order type")

View File

@@ -1034,7 +1034,7 @@ func TestStatusToStandardStatus(t *testing.T) {
for i := range testCases {
result, _ := statusToStandardStatus(testCases[i].Case)
if result != testCases[i].Result {
t.Errorf("Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Expected: %v, received: %v", testCases[i].Result, result)
}
}
}

View File

@@ -1137,7 +1137,7 @@ func TestStringToStatus(t *testing.T) {
for i := range testCases {
result, _ := stringToOrderStatus(testCases[i].Case, testCases[i].Quantity)
if result != testCases[i].Result {
t.Errorf("Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Expected: %v, received: %v", testCases[i].Result, result)
}
}
}

View File

@@ -186,7 +186,7 @@ type TradeHistory struct {
Trades []OrderFilledResponse `json:"trades"`
}
// IndexTicker holds indexed ticker inforamtion
// IndexTicker holds indexed ticker information
type IndexTicker struct {
Asset string `json:"asset"`
Price float64 `json:"price,string"`
@@ -633,7 +633,7 @@ type WsLoginResponse struct {
WithdrawEnabled bool `json:"withdraw_enabled"`
}
// WsNewOrderResponse returns if new_order response failes
// WsNewOrderResponse returns if new_order response fails
type WsNewOrderResponse struct {
Message string `json:"msg"`
Nonce int64 `json:"nonce"`

View File

@@ -151,7 +151,7 @@ func (b *Base) SetFeatureDefaults() {
}
// SupportsRESTTickerBatchUpdates returns whether or not the
// exhange supports REST batch ticker fetching
// exchange supports REST batch ticker fetching
func (b *Base) SupportsRESTTickerBatchUpdates() bool {
return b.Features.Supports.RESTCapabilities.TickerBatching
}

View File

@@ -85,7 +85,7 @@ func TestSet(t *testing.T) {
t.Error("set method or createmap failed")
}
if val != "http://google.com/" {
t.Errorf("vals didnt match. expecting: %s, got: %s\n", "http://google.com/", val)
t.Errorf("vals didn't match. expecting: %s, got: %s\n", "http://google.com/", val)
}
err = b.API.Endpoints.SetRunning(EdgeCase3.String(), "Added Edgecase3")
if err != nil {
@@ -122,7 +122,7 @@ func TestGetURL(t *testing.T) {
t.Error(err)
}
if getChangedVal != "http://OVERWRITTENBRO.com.au/" {
t.Error("couldnt get changed val")
t.Error("couldn't get changed val")
}
_, err = b.API.Endpoints.GetURL(URL(100))
if err == nil {

View File

@@ -476,15 +476,15 @@ func (e *EXMO) SubmitOrder(ctx context.Context, s *order.Submit) (*order.SubmitR
return nil, err
}
var oT string
var orderType string
switch s.Type {
case order.Limit:
return nil, errors.New("unsupported order type")
case order.Market:
if s.Side == order.Sell {
oT = "market_sell"
orderType = "market_sell"
} else {
oT = "market_buy"
orderType = "market_buy"
}
}
@@ -493,7 +493,7 @@ func (e *EXMO) SubmitOrder(ctx context.Context, s *order.Submit) (*order.SubmitR
return nil, err
}
response, err := e.CreateOrder(ctx, fPair.String(), oT, s.Price, s.Amount)
response, err := e.CreateOrder(ctx, fPair.String(), orderType, s.Price, s.Amount)
if err != nil {
return nil, err
}

View File

@@ -235,7 +235,7 @@ func (g *Gateio) GetSpotKline(ctx context.Context, arg KlinesRequestParams) ([]k
if err != nil {
return nil, err
}
ot, err := convert.TimeFromUnixTimestampFloat(otString)
orderType, err := convert.TimeFromUnixTimestampFloat(otString)
if err != nil {
return nil, fmt.Errorf("cannot parse Kline.OpenTime. Err: %s", err)
}
@@ -260,7 +260,7 @@ func (g *Gateio) GetSpotKline(ctx context.Context, arg KlinesRequestParams) ([]k
return nil, fmt.Errorf("cannot parse Kline.Open. Err: %s", err)
}
timeSeries[x] = kline.Candle{
Time: ot,
Time: orderType,
Volume: _vol,
Close: _close,
High: _high,

View File

@@ -190,7 +190,7 @@ func (g *Gemini) CancelExistingOrder(ctx context.Context, orderID int64) (Order,
// CancelExistingOrders will cancel all outstanding orders created by all
// sessions owned by this account, including interactive orders placed through
// the UI. If sessions = true will only cancel the order that is called on this
// session asssociated with the APIKEY
// session associated with the APIKEY
func (g *Gemini) CancelExistingOrders(ctx context.Context, cancelBySession bool) (OrderResult, error) {
path := geminiOrderCancelAll
if cancelBySession {

View File

@@ -1166,7 +1166,7 @@ func TestResponseToStatus(t *testing.T) {
for i := range testCases {
result, _ := stringToOrderStatus(testCases[i].Case)
if result != testCases[i].Result {
t.Errorf("Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Expected: %v, received: %v", testCases[i].Result, result)
}
}
}
@@ -1188,7 +1188,7 @@ func TestResponseToOrderType(t *testing.T) {
for i := range testCases {
result, _ := stringToOrderType(testCases[i].Case)
if result != testCases[i].Result {
t.Errorf("Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Expected: %v, received: %v", testCases[i].Result, result)
}
}
}

View File

@@ -228,7 +228,7 @@ type ErrorCapture struct {
Message string `json:"message"`
}
// WsRequestPayload Request info to subscribe to a WS enpoint
// WsRequestPayload Request info to subscribe to a WS endpoint
type WsRequestPayload struct {
Request string `json:"request"`
Nonce int64 `json:"nonce"`

View File

@@ -74,14 +74,14 @@ func TestStart(t *testing.T) {
func TestGetOrderbook(t *testing.T) {
_, err := h.GetOrderbook(context.Background(), "BTCUSD", 50)
if err != nil {
t.Error("Test faild - HitBTC GetOrderbook() error", err)
t.Error("Test failed - HitBTC GetOrderbook() error", err)
}
}
func TestGetTrades(t *testing.T) {
_, err := h.GetTrades(context.Background(), "BTCUSD", "", "", 0, 0, 0, 0)
if err != nil {
t.Error("Test faild - HitBTC GetTradeHistory() error", err)
t.Error("Test failed - HitBTC GetTradeHistory() error", err)
}
}
@@ -89,7 +89,7 @@ func TestGetChartCandles(t *testing.T) {
_, err := h.GetCandles(context.Background(),
"BTCUSD", "", "D1", time.Now().Add(-24*time.Hour), time.Now())
if err != nil {
t.Error("Test faild - HitBTC GetChartData() error", err)
t.Error("Test failed - HitBTC GetChartData() error", err)
}
}
@@ -126,7 +126,7 @@ func TestGetHistoricCandlesExtended(t *testing.T) {
func TestGetCurrencies(t *testing.T) {
_, err := h.GetCurrencies(context.Background())
if err != nil {
t.Error("Test faild - HitBTC GetCurrencies() error", err)
t.Error("Test failed - HitBTC GetCurrencies() error", err)
}
}

View File

@@ -584,7 +584,7 @@ func (h *HUOBI) GetSwapOrderLimitInfo(ctx context.Context, code currency.Pair, o
}
req["contract_code"] = codeValue
if !common.StringDataCompareInsensitive(validOrderTypes, orderType) {
return resp, fmt.Errorf("inavlid ordertype provided")
return resp, fmt.Errorf("invalid ordertype provided")
}
req["order_price_type"] = orderType
return resp, h.FuturesAuthenticatedHTTPRequest(ctx, exchange.RestFutures, http.MethodPost, huobiSwapOrderLimitInfo, nil, req, &resp)
@@ -638,7 +638,7 @@ func (h *HUOBI) AccountTransferData(ctx context.Context, code currency.Pair, sub
req["subUid"] = subUID
req["amount"] = amount
if !common.StringDataCompareInsensitive(validTransferType, transferType) {
return resp, fmt.Errorf("inavlid transferType received")
return resp, fmt.Errorf("invalid transferType received")
}
req["type"] = transferType
return resp, h.FuturesAuthenticatedHTTPRequest(ctx, exchange.RestFutures, http.MethodPost, huobiSwapInternalTransferData, nil, req, &resp)
@@ -654,7 +654,7 @@ func (h *HUOBI) AccountTransferRecords(ctx context.Context, code currency.Pair,
}
req["contract_code"] = codeValue
if !common.StringDataCompareInsensitive(validTransferType, transferType) {
return resp, fmt.Errorf("inavlid transferType received")
return resp, fmt.Errorf("invalid transferType received")
}
req["type"] = transferType
if createDate > 90 {
@@ -685,7 +685,7 @@ func (h *HUOBI) PlaceSwapOrders(ctx context.Context, code currency.Pair, clientO
req["direction"] = direction
req["offset"] = offset
if !common.StringDataCompareInsensitive(validOrderTypes, orderPriceType) {
return resp, fmt.Errorf("inavlid ordertype provided")
return resp, fmt.Errorf("invalid ordertype provided")
}
req["order_price_type"] = orderPriceType
req["price"] = price

View File

@@ -660,7 +660,7 @@ func (h *HUOBI) FTransfer(ctx context.Context, subUID, symbol, transferType stri
req["subUid"] = subUID
req["amount"] = amount
if !common.StringDataCompareInsensitive(validTransferType, transferType) {
return resp, fmt.Errorf("inavlid transferType received")
return resp, fmt.Errorf("invalid transferType received")
}
req["type"] = transferType
return resp, h.FuturesAuthenticatedHTTPRequest(ctx, exchange.RestFutures, http.MethodPost, fTransfer, nil, req, &resp)
@@ -674,7 +674,7 @@ func (h *HUOBI) FGetTransferRecords(ctx context.Context, symbol, transferType st
req["symbol"] = symbol
}
if !common.StringDataCompareInsensitive(validTransferType, transferType) {
return resp, fmt.Errorf("inavlid transferType received")
return resp, fmt.Errorf("invalid transferType received")
}
req["type"] = transferType
if createDate < 0 || createDate > 90 {

View File

@@ -683,7 +683,7 @@ func TestUpdateTickerSpot(t *testing.T) {
t.Parallel()
_, err := h.UpdateTicker(context.Background(), currency.NewPairWithDelimiter("INV", "ALID", "-"), asset.Spot)
if err == nil {
t.Error("exepcted invalid pair")
t.Error("expected invalid pair")
}
_, err = h.UpdateTicker(context.Background(), currency.NewPairWithDelimiter("BTC", "USDT", "_"), asset.Spot)
if err != nil {
@@ -695,7 +695,7 @@ func TestUpdateTickerCMF(t *testing.T) {
t.Parallel()
_, err := h.UpdateTicker(context.Background(), currency.NewPairWithDelimiter("INV", "ALID", "_"), asset.CoinMarginedFutures)
if err == nil {
t.Error("exepcted invalid contract code")
t.Error("expected invalid contract code")
}
_, err = h.UpdateTicker(context.Background(), currency.NewPairWithDelimiter("BTC", "USD", "_"), asset.CoinMarginedFutures)
if err != nil {
@@ -2553,7 +2553,7 @@ func TestStringToOrderStatus(t *testing.T) {
for i := range testCases {
result, _ := stringToOrderStatus(testCases[i].Case)
if result != testCases[i].Result {
t.Errorf("Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Expected: %v, received: %v", testCases[i].Result, result)
}
}
}
@@ -2571,7 +2571,7 @@ func TestStringToOrderSide(t *testing.T) {
for i := range testCases {
result, _ := stringToOrderSide(testCases[i].Case)
if result != testCases[i].Result {
t.Errorf("Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Expected: %v, received: %v", testCases[i].Result, result)
}
}
}
@@ -2589,7 +2589,7 @@ func TestStringToOrderType(t *testing.T) {
for i := range testCases {
result, _ := stringToOrderType(testCases[i].Case)
if result != testCases[i].Result {
t.Errorf("Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Expected: %v, received: %v", testCases[i].Result, result)
}
}
}

View File

@@ -638,7 +638,7 @@ func TestLoadFromDatabase(t *testing.T) {
t.Fatal(err)
}
if ret.Exchange != testExchanges[0].Name {
t.Fatalf("uncorrect data returned: %v", ret.Exchange)
t.Fatalf("incorrect data returned: %v", ret.Exchange)
}
err = testhelpers.CloseDatabase(dbConn)

View File

@@ -344,7 +344,7 @@ func (o *OHLC) GetRelativeStrengthIndex(option []float64, period int64) ([]float
}
if len(option) <= 2 {
// TODO: Check why 2 data points causes panic.
return nil, fmt.Errorf("get relative strength index %w, requires atleast 3 data points", errNotEnoughData)
return nil, fmt.Errorf("get relative strength index %w, requires at least 3 data points", errNotEnoughData)
}
if int(period) > len(option) {
return nil, fmt.Errorf("get exponential moving average %w exceeds data length, please reduce",

View File

@@ -401,7 +401,7 @@ type FuturesNotificationData struct {
Priority string `json:"priority"`
Note string `json:"note"`
EffectiveTime string `json:"effectiveTime"`
} `json:"notifcations"`
} `json:"notifications"`
ServerTime string `json:"serverTime"`
}

View File

@@ -1178,7 +1178,7 @@ func (k *Kraken) WithdrawStatus(ctx context.Context, c currency.Code, method str
return response.Result, GetError(response.Error)
}
// WithdrawCancel sends a withdrawal cancelation request
// WithdrawCancel sends a withdrawal cancellation request
func (k *Kraken) WithdrawCancel(ctx context.Context, c currency.Code, refID string) (bool, error) {
var response struct {
Error []string `json:"error"`

View File

@@ -104,7 +104,7 @@ func TestGetMarketDepths(t *testing.T) {
}
a, _ := l.GetMarketDepths(context.Background(), testCurrencyPair, "4", "0")
if len(a.Data.Asks) != 4 {
t.Errorf("asks length requested doesnt match the output")
t.Errorf("asks length requested doesn't match the output")
}
}
@@ -157,7 +157,7 @@ func TestGetUserInfo(t *testing.T) {
func TestCreateOrder(t *testing.T) {
t.Parallel()
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
cp := currency.NewPairWithDelimiter(currency.BTC.String(), currency.USDT.String(), "_")
_, err := l.CreateOrder(context.Background(), cp.Lower().String(), "what", 1231, 12314)
@@ -181,7 +181,7 @@ func TestCreateOrder(t *testing.T) {
func TestRemoveOrder(t *testing.T) {
t.Parallel()
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
cp := currency.NewPairWithDelimiter(currency.ETH.String(), currency.BTC.String(), "_")
_, err := l.RemoveOrder(context.Background(),
@@ -280,7 +280,7 @@ func TestGetWithdrawConfig(t *testing.T) {
func TestWithdraw(t *testing.T) {
t.Parallel()
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
_, err := l.Withdraw(context.Background(), "", "", "", "", "", "")
if err != nil {
@@ -365,7 +365,7 @@ func TestSubmitOrder(t *testing.T) {
func TestCancelOrder(t *testing.T) {
t.Parallel()
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test, either api keys or manipulaterealorders isnt set correctly")
t.Skip("skipping test, either api keys or manipulaterealorders isn't set correctly")
}
cp := currency.NewPairWithDelimiter(currency.ETH.String(), currency.BTC.String(), "_")
var a order.Cancel

View File

@@ -19,7 +19,7 @@ import (
const (
localbitcoinsAPIURL = "https://localbitcoins.com"
// Autheticated Calls
// Authenticated Calls
localbitcoinsAPIAccountInfo = "api/account_info"
localbitcoinsAPIMyself = "myself/"
localbitcoinsAPIAds = "ads/"

View File

@@ -83,7 +83,7 @@ type AdData struct {
AdCount int `json:"ad_count"`
}
// AdEdit references an outgoing paramater type for EditAd() method
// AdEdit references an outgoing parameter type for EditAd() method
type AdEdit struct {
// Required Arguments
PriceEquation string `json:"price_equation"`
@@ -123,7 +123,7 @@ type AdEdit struct {
Floating bool `json:"floating"`
}
// AdCreate references an outgoing paramater type for CreateAd() method
// AdCreate references an outgoing parameter type for CreateAd() method
type AdCreate struct {
// Required Arguments
PriceEquation string `json:"price_equation"`

View File

@@ -30,7 +30,7 @@ func (r *RateLimit) Limit(f request.EndpointLimit) error {
func SetRateLimit() *RateLimit {
return &RateLimit{
// 4 seconds per book fetching is the best time frame to actually
// receive without retying. There is undocumentated rate limit.
// receive without retrying. There is undocumentated rate limit.
Orderbook: request.NewRateLimit(4*time.Second, 1),
Ticker: request.NewRateLimit(time.Second, 1),
}

View File

@@ -11,7 +11,7 @@ type Nonce struct {
m sync.Mutex
}
// Get retrives the nonce value
// Get retrieves the nonce value
func (n *Nonce) Get() Value {
n.m.Lock()
defer n.m.Unlock()

View File

@@ -51,7 +51,7 @@ func (o *OKCoin) GetDefaultConfig() (*config.Exchange, error) {
return exchCfg, nil
}
// SetDefaults method assignes the default values for OKCoin
// SetDefaults method assigns the default values for OKCoin
func (o *OKCoin) SetDefaults() {
o.SetErrorDefaults()
o.Name = okCoinExchangeName

View File

@@ -32,7 +32,7 @@ type Okx struct {
WsResponseMultiplexer wsRequestDataChannelsMultiplexer
// WsRequestSemaphore channel is used to block write operation on the websocket connection to reduce contention; a kind of bounded parallelism.
// it is made to hold upto 20 integers so that up to 20 write operations can be called over the websocket connection at a time.
// it is made to hold up to 20 integers so that up to 20 write operations can be called over the websocket connection at a time.
// and when the operation is completed the thread releases (consumes) one value from the channel so that the other waiting operation can enter.
// ok.WsRequestSemaphore <- 1
// defer func() { <-ok.WsRequestSemaphore }()
@@ -2648,7 +2648,7 @@ func (ok *Okx) GetGridAlgoOrdersList(ctx context.Context, algoOrderType, algoID,
after, before, gridAlgoOrders, limit)
}
// GetGridAlgoOrderHistory retrieves list of grid algo orders with the complete data including the stoped orders.
// GetGridAlgoOrderHistory retrieves list of grid algo orders with the complete data including the stopped orders.
func (ok *Okx) GetGridAlgoOrderHistory(ctx context.Context, algoOrderType, algoID,
instrumentID, instrumentType,
after, before string, limit int64) ([]GridAlgoOrderResponse, error) {
@@ -2984,7 +2984,7 @@ func (ok *Okx) GetTickers(ctx context.Context, instType, uly, instID string) ([]
case instID != "":
params.Set("instId", instID)
default:
return nil, errors.New("missing required variable instType (instrument type) or insId( Instrument ID )")
return nil, errors.New("missing required variable instType (instrument type) or instId( Instrument ID )")
}
var response []TickerResponse
return response, ok.SendHTTPRequest(ctx, exchange.RestSpot, getTickersEPL, http.MethodGet, common.EncodeURLValues(marketTickers, params), nil, &response, false)
@@ -2996,7 +2996,7 @@ func (ok *Okx) GetTicker(ctx context.Context, instrumentID string) (*TickerRespo
if instrumentID != "" {
params.Set("instId", instrumentID)
} else {
return nil, errors.New("missing required variable instType(instruction type) or insId( Instrument ID )")
return nil, errors.New("missing required variable instType(instruction type) or instId( Instrument ID )")
}
var response []TickerResponse
err := ok.SendHTTPRequest(ctx, exchange.RestSpot, getTickersEPL, http.MethodGet, common.EncodeURLValues(marketTicker, params), nil, &response, false)
@@ -3374,7 +3374,6 @@ func (ok *Okx) GetDeliveryHistory(ctx context.Context, instrumentType, underlyin
if underlying == "" {
return nil, errMissingRequiredUnderlying
}
params.Set("Underlying", underlying)
params.Set("uly", underlying)
if !after.IsZero() {
params.Set("after", strconv.FormatInt(after.UnixMilli(), 10))

View File

@@ -1097,7 +1097,7 @@ type LendingRate struct {
Rate float64 `json:"rate,string"`
}
// LendingHistory holds lending hostory responses
// LendingHistory holds lending history responses
type LendingHistory struct {
Currency string `json:"ccy"`
Amount float64 `json:"amt,string"`
@@ -1490,7 +1490,7 @@ type InterestAccruedData struct {
Currency string `json:"ccy"`
InstrumentID string `json:"instId"`
Interest string `json:"interest"`
InterestRate string `json:"interestRate"` // intereset rate in an hour.
InterestRate string `json:"interestRate"` // Interest rate in an hour.
Liability string `json:"liab"`
MarginMode string `json:"mgnMode"` // Margin mode "cross" "isolated"
Timestamp okxUnixMilliTime `json:"ts"`
@@ -1860,7 +1860,7 @@ type SubaccountInfo struct {
SubaccountLabel string `json:"label"`
MobileNumber string `json:"mobile"` // Mobile number that linked with the sub-account.
GoogleAuth bool `json:"gAuth"` // If the sub-account switches on the Google Authenticator for login authentication.
CanTransferOut bool `json:"canTransOut"` // If can tranfer out, false: can not tranfer out, true: can transfer.
CanTransferOut bool `json:"canTransOut"` // If can transfer out, false: can not transfer out, true: can transfer.
Timestamp okxUnixMilliTime `json:"ts"`
}
@@ -2414,7 +2414,7 @@ func (a *WsOrderActionResponse) populateFromIncomingData(incoming *wsIncomingDat
return nil
}
// SubscriptionOperationInput represents the account channel input datas
// SubscriptionOperationInput represents the account channel input data
type SubscriptionOperationInput struct {
Operation string `json:"op"`
Arguments []SubscriptionInfo `json:"args"`
@@ -2642,12 +2642,12 @@ type WsQuoteData struct {
// WsStructureBlocTrade represents websocket push data for "struc-block-trades" subscription
type WsStructureBlocTrade struct {
Argument SubscriptionInfo `json:"arg"`
Data []WsBlocTradeResponse `json:"data"`
Argument SubscriptionInfo `json:"arg"`
Data []WsBlockTradeResponse `json:"data"`
}
// WsBlocTradeResponse represents a structure bloc order information
type WsBlocTradeResponse struct {
// WsBlockTradeResponse represents a structure block order information
type WsBlockTradeResponse struct {
CreationTime okxUnixMilliTime `json:"cTime"`
RfqID string `json:"rfqId"`
ClientSuppliedRfqID string `json:"clRfqId"`
@@ -2892,7 +2892,7 @@ type WsSystemStatusResponse struct {
Data []SystemStatusResponse `json:"data"`
}
// WsPublicTradesResponse represents websocket push data of structured bloc trades as a result of subscription to "public-struc-block-trades"
// WsPublicTradesResponse represents websocket push data of structured block trades as a result of subscription to "public-struc-block-trades"
type WsPublicTradesResponse struct {
Argument SubscriptionInfo `json:"arg"`
Data []PublicTradesResponse `json:"data"`

View File

@@ -669,7 +669,7 @@ func (ok *Okx) GetRecentTrades(ctx context.Context, p currency.Pair, assetType a
return resp, nil
}
// GetHistoricTrades retrives historic trade data within the timeframe provided
// GetHistoricTrades retrieves historic trade data within the timeframe provided
func (ok *Okx) GetHistoricTrades(ctx context.Context, p currency.Pair, assetType asset.Item, timestampStart, timestampEnd time.Time) ([]trade.Data, error) {
if timestampStart.Before(time.Now().Add(-kline.ThreeMonth.Duration())) {
return nil, errOnlyThreeMonthsSupported

View File

@@ -277,7 +277,7 @@ type PNLResult struct {
Direction Side
Fee decimal.Decimal
IsLiquidated bool
// Is event is supposed to show that something has happened and it isnt just tracking in time
// Is event is supposed to show that something has happened and it isn't just tracking in time
IsOrder bool
}

View File

@@ -266,17 +266,17 @@ func TestOrderSides(t *testing.T) {
func TestOrderTypes(t *testing.T) {
t.Parallel()
var ot Type
if ot.String() != "UNKNOWN" {
t.Errorf("unexpected string %s", ot.String())
var orderType Type
if orderType.String() != "UNKNOWN" {
t.Errorf("unexpected string %s", orderType.String())
}
if ot.Lower() != "unknown" {
t.Errorf("unexpected string %s", ot.Lower())
if orderType.Lower() != "unknown" {
t.Errorf("unexpected string %s", orderType.Lower())
}
if ot.Title() != "Unknown" {
t.Errorf("unexpected string %s", ot.Title())
if orderType.Title() != "Unknown" {
t.Errorf("unexpected string %s", orderType.Title())
}
}

View File

@@ -132,7 +132,7 @@ updates:
// cleanup reduces the max size of the depth length if exceeded. Is used after
// updates have been applied instead of adhoc, reason being its easier to prune
// at the end. (cant inline)
// at the end. (can't inline)
func (ll *linkedList) cleanup(maxChainLength int, stack *stack) {
// Reduces the max length of total linked list chain, occurs after updates
// have been implemented as updates can push length out of bounds, if

View File

@@ -328,7 +328,7 @@ func (b *Base) Process() error {
// Reverse reverses the order of orderbook items; some bid/asks are
// returned in either ascending or descending order. One bid or ask slice
// depending on whats received can be reversed. This is usually faster than
// depending on what's received can be reversed. This is usually faster than
// using a sort algorithm as the algorithm could be impeded by a worst case time
// complexity when elements are shifted as opposed to just swapping element
// values.

View File

@@ -387,7 +387,7 @@ func TestProcessOrderbook(t *testing.T) {
base.Asset = asset.Spot
err = base.Process()
if err != nil {
t.Error("unexpcted result: ", err)
t.Error("unexpected result: ", err)
}
result, err := Get("ProcessOrderbook", c, asset.Spot)
if err != nil {

View File

@@ -61,7 +61,7 @@ func TestGetVolume(t *testing.T) {
t.Parallel()
_, err := p.GetVolume(context.Background())
if err != nil {
t.Error("Test faild - Poloniex GetVolume() error")
t.Error("Test failed - Poloniex GetVolume() error")
}
}
@@ -69,7 +69,7 @@ func TestGetOrderbook(t *testing.T) {
t.Parallel()
_, err := p.GetOrderbook(context.Background(), "BTC_XMR", 50)
if err != nil {
t.Error("Test faild - Poloniex GetOrderbook() error", err)
t.Error("Test failed - Poloniex GetOrderbook() error", err)
}
}
@@ -77,7 +77,7 @@ func TestGetTradeHistory(t *testing.T) {
t.Parallel()
_, err := p.GetTradeHistory(context.Background(), "BTC_XMR", 0, 0)
if err != nil {
t.Error("Test faild - Poloniex GetTradeHistory() error", err)
t.Error("Test failed - Poloniex GetTradeHistory() error", err)
}
}
@@ -87,7 +87,7 @@ func TestGetChartData(t *testing.T) {
"BTC_XMR",
time.Unix(1405699200, 0), time.Unix(1405699400, 0), "300")
if err != nil {
t.Error("Test faild - Poloniex GetChartData() error", err)
t.Error("Test failed - Poloniex GetChartData() error", err)
}
}
@@ -95,7 +95,7 @@ func TestGetCurrencies(t *testing.T) {
t.Parallel()
_, err := p.GetCurrencies(context.Background())
if err != nil {
t.Error("Test faild - Poloniex GetCurrencies() error", err)
t.Error("Test failed - Poloniex GetCurrencies() error", err)
}
}
@@ -103,7 +103,7 @@ func TestGetLoanOrders(t *testing.T) {
t.Parallel()
_, err := p.GetLoanOrders(context.Background(), "BTC")
if err != nil {
t.Error("Test faild - Poloniex GetLoanOrders() error", err)
t.Error("Test failed - Poloniex GetLoanOrders() error", err)
}
}

View File

@@ -260,7 +260,7 @@ func (w *Orderbook) processObUpdate(o *orderbookHolder, u *orderbook.Update) err
return nil
}
// updateByPrice ammends amount if match occurs by price, deletes if amount is
// updateByPrice amends amount if match occurs by price, deletes if amount is
// zero or less and inserts if not found.
func (o *orderbookHolder) updateByPrice(updts *orderbook.Update) {
o.ob.UpdateBidAskByPrice(updts)

View File

@@ -224,7 +224,7 @@ func TestTrafficMonitorTimeout(t *testing.T) {
// await timeout closure
ws.Wg.Wait()
if ws.IsTrafficMonitorRunning() {
t.Error("should be ded")
t.Error("should be dead")
}
}

View File

@@ -231,7 +231,7 @@ func (y *Yobit) WithdrawCoinsToAddress(ctx context.Context, coin string, amount
return result, nil
}
// CreateCoupon creates an exchange coupon for a sepcific currency
// CreateCoupon creates an exchange coupon for a specific currency
func (y *Yobit) CreateCoupon(ctx context.Context, currency string, amount float64) (CreateCoupon, error) {
req := url.Values{}
req.Add("currency", currency)

View File

@@ -16,7 +16,7 @@ const (
zbKlineDataInterval = time.Second * 2
zbKlineDataLimit = 1
// Used to match endpints to rate limits
// Used to match endpoints to rate limits
klineFunc request.EndpointLimit = iota
)

View File

@@ -271,12 +271,12 @@ func (z *ZB) GetSpotKline(ctx context.Context, arg KlinesRequestParams) (KLineRe
return res, errors.New("unexpected kline data length")
}
ot, err := convert.TimeFromUnixTimestampFloat(resp.Data[x][0])
timestamp, err := convert.TimeFromUnixTimestampFloat(resp.Data[x][0])
if err != nil {
return res, err
}
res.Data = append(res.Data, &KLineResponseData{
KlineTime: ot,
KlineTime: timestamp,
Open: resp.Data[x][1],
High: resp.Data[x][2],
Low: resp.Data[x][3],

View File

@@ -501,9 +501,9 @@ func (z *ZB) SubmitOrder(ctx context.Context, o *order.Submit) (*order.SubmitRes
}
return o.DeriveSubmitResponse(strconv.FormatInt(response.Data.EntrustID, 10))
}
var oT = SpotNewOrderRequestParamsTypeSell
var orderType = SpotNewOrderRequestParamsTypeSell
if o.Side == order.Buy {
oT = SpotNewOrderRequestParamsTypeBuy
orderType = SpotNewOrderRequestParamsTypeBuy
}
fPair, err := z.FormatExchangeCurrency(o.Pair, o.AssetType)
@@ -515,7 +515,7 @@ func (z *ZB) SubmitOrder(ctx context.Context, o *order.Submit) (*order.SubmitRes
Amount: o.Amount,
Price: o.Price,
Symbol: fPair.Lower().String(),
Type: oT,
Type: orderType,
}
var response int64
response, err = z.SpotNewOrder(ctx, params)