From a79e0d2b3eeb165763a7009bcfdb15173dfc2f7d Mon Sep 17 00:00:00 2001 From: Adrian Gallagher Date: Mon, 30 Jan 2023 12:36:56 +1100 Subject: [PATCH] qa/spelling: Add Codespell support (#1121) * Add codespell support * Fix paths * Add HTML files to exclusion list --- .codespellrc | 4 ++ .github/workflows/spell-checker.yml | 13 ++++ backtester/config/README.md | 4 +- .../eventhandlers/portfolio/portfolio.go | 12 ++-- backtester/eventtypes/signal/signal_types.go | 2 +- backtester/funding/README.md | 2 +- backtester/funding/collateralpair_test.go | 62 +++++++++---------- backtester/funding/funding_test.go | 26 ++++---- backtester/funding/spotpair_test.go | 8 +-- .../trackingcurrencies_test.go | 2 +- backtester/report/report_types.go | 2 +- cmd/apichecker/README.md | 2 +- .../backtester_config_readme.tmpl | 4 +- .../backtester_funding_readme.tmpl | 2 +- .../cmd_templates/apichecker.tmpl | 2 +- .../engine_templates/datahistory_manager.tmpl | 2 +- cmd/exchange_template/wrapper_file.tmpl | 2 +- cmd/gctcli/technical_analysis.go | 2 +- common/common_test.go | 2 +- common/convert/convert.go | 2 +- common/math/math_test.go | 2 +- communications/slack/slack.go | 8 +-- communications/slack/slack_test.go | 8 +-- config/config.go | 10 +-- config/config_test.go | 12 ++-- contrib/spellcheck/exclude_lines.txt | 19 ++++++ contrib/spellcheck/ignore_words.txt | 6 ++ core/version.go | 2 +- currency/coinmarketcap/coinmarketcap_types.go | 2 +- .../exchangeratesapi_test.go | 10 +-- currency/manager_test.go | 10 +-- currency/pair.go | 4 +- .../datahistoryjob/datahistoryjob.go | 4 +- database/repository/trade/trade_test.go | 2 +- dispatch/dispatch_types.go | 6 +- docs/ADD_NEW_EXCHANGE.md | 2 +- docs/FILES.md | 2 +- engine/datahistory_manager.md | 2 +- engine/helpers_test.go | 2 +- engine/order_manager_test.go | 6 +- engine/rpcserver.go | 4 +- exchanges/alphapoint/alphapoint_wrapper.go | 8 +-- exchanges/asset/asset_test.go | 18 +++--- exchanges/binance/binance.go | 2 +- exchanges/binance/binance_test.go | 2 +- exchanges/binance/binance_types.go | 4 +- exchanges/binanceus/binanceus_test.go | 2 +- exchanges/binanceus/type_convert.go | 2 +- exchanges/bitfinex/bitfinex.go | 8 +-- exchanges/bitfinex/bitfinex_websocket.go | 2 +- exchanges/bitfinex/bitfinex_wrapper.go | 2 +- exchanges/bitfinex/ratelimit.go | 58 ++++++++--------- exchanges/bitflyer/bitflyer.go | 4 +- exchanges/bithumb/bithumb.go | 2 +- exchanges/bithumb/bithumb_websocket_types.go | 2 +- exchanges/bitmex/bitmex.go | 2 +- exchanges/bitmex/bitmex_parameters.go | 58 ++++++++--------- exchanges/bitstamp/bitstamp.go | 2 +- exchanges/bittrex/bittrex_test.go | 2 +- exchanges/bittrex/bittrex_types.go | 2 +- exchanges/btcmarkets/btcmarkets_test.go | 18 +++--- exchanges/btcmarkets/ratelimit.go | 2 +- exchanges/btse/btse.go | 2 +- exchanges/btse/btse_test.go | 2 +- exchanges/btse/btse_wrapper.go | 6 +- exchanges/bybit/bybit_types.go | 4 +- exchanges/coinbasepro/coinbasepro_test.go | 2 +- exchanges/coinut/coinut_test.go | 2 +- exchanges/coinut/coinut_types.go | 4 +- exchanges/exchange.go | 2 +- exchanges/exchange_test.go | 4 +- exchanges/exmo/exmo_wrapper.go | 8 +-- exchanges/gateio/gateio.go | 4 +- exchanges/gemini/gemini.go | 2 +- exchanges/gemini/gemini_test.go | 4 +- exchanges/gemini/gemini_types.go | 2 +- exchanges/hitbtc/hitbtc_test.go | 8 +-- exchanges/huobi/huobi_cfutures.go | 8 +-- exchanges/huobi/huobi_futures.go | 4 +- exchanges/huobi/huobi_test.go | 10 +-- exchanges/kline/kline_test.go | 2 +- exchanges/kline/technical_analysis.go | 2 +- exchanges/kraken/futures_types.go | 2 +- exchanges/kraken/kraken.go | 2 +- exchanges/lbank/lbank_test.go | 10 +-- exchanges/localbitcoins/localbitcoins.go | 2 +- .../localbitcoins/localbitcoins_types.go | 4 +- exchanges/localbitcoins/rate_limit.go | 2 +- exchanges/nonce/nonce.go | 2 +- exchanges/okcoin/okcoin_wrapper.go | 2 +- exchanges/okx/okx.go | 9 ++- exchanges/okx/okx_types.go | 18 +++--- exchanges/okx/okx_wrapper.go | 2 +- exchanges/order/futures_types.go | 2 +- exchanges/order/order_test.go | 14 ++--- exchanges/orderbook/linked_list.go | 2 +- exchanges/orderbook/orderbook.go | 2 +- exchanges/orderbook/orderbook_test.go | 2 +- exchanges/poloniex/poloniex_test.go | 12 ++-- exchanges/stream/buffer/buffer.go | 2 +- exchanges/stream/websocket_test.go | 2 +- exchanges/yobit/yobit.go | 2 +- exchanges/zb/ratelimit.go | 2 +- exchanges/zb/zb.go | 4 +- exchanges/zb/zb_wrapper.go | 6 +- gctscript/modules/gct/errors_test.go | 2 +- gctscript/modules/ta/indicators/indicators.go | 2 +- portfolio/portfolio.go | 2 +- 108 files changed, 359 insertions(+), 318 deletions(-) create mode 100644 .codespellrc create mode 100644 .github/workflows/spell-checker.yml create mode 100644 contrib/spellcheck/exclude_lines.txt create mode 100644 contrib/spellcheck/ignore_words.txt diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000000..c7118d0785b --- /dev/null +++ b/.codespellrc @@ -0,0 +1,4 @@ +[codespell] +skip = ./.git,./web,./currency/code_types.go,*.json,*.sum,*.html +exclude-file = ./contrib/spellcheck/exclude_lines.txt +ignore-words = ./contrib/spellcheck/ignore_words.txt \ No newline at end of file diff --git a/.github/workflows/spell-checker.yml b/.github/workflows/spell-checker.yml new file mode 100644 index 00000000000..78688f00311 --- /dev/null +++ b/.github/workflows/spell-checker.yml @@ -0,0 +1,13 @@ +name: codespell +on: [push, pull_request] +jobs: + codespell: + name: Spell checker + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: codespell-project/actions-codespell@master + with: + exclude_file: contrib/spellcheck/exclude_lines.txt + skip: ./.git,./web,./currency/code_types.go,*.json,*.sum,*.html + ignore_words_file: contrib/spellcheck/ignore_words.txt diff --git a/backtester/config/README.md b/backtester/config/README.md index c03e9e30f20..16b40fe0b31 100644 --- a/backtester/config/README.md +++ b/backtester/config/README.md @@ -115,7 +115,7 @@ See below for a set of tables and fields, expected values and what they can do |------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------| | name | The strategy to use | `rsi` | | use-simultaneous-signal-processing | This denotes whether multiple currencies are processed simultaneously with the strategy function `OnSimultaneousSignals`. Eg If you have multiple CurrencySettings and only wish to purchase BTC-USDT when XRP-DOGE is 1337, this setting is useful as you can analyse both signal events to output a purchase call for BTC | `true` | -| disable-usd-tracking | If `false`, will track all currencies used in your strategy against USD equivalent candles. For example, if you are running a strategy for BTC/XRP, then the GoCryptoTrader Backtester will also retreive candles data for BTC/USD and XRP/USD to then track strategy performance against a single currency. This also tracks against USDT and other USD tracked stablecoins, so one exchange supporting USDT and another BUSD will still allow unified strategy performance analysis. If disabled, will not track against USD, this can be especially helpful when running strategies under live, database and CSV based data | `false` | +| disable-usd-tracking | If `false`, will track all currencies used in your strategy against USD equivalent candles. For example, if you are running a strategy for BTC/XRP, then the GoCryptoTrader Backtester will also retrieve candles data for BTC/USD and XRP/USD to then track strategy performance against a single currency. This also tracks against USDT and other USD tracked stablecoins, so one exchange supporting USDT and another BUSD will still allow unified strategy performance analysis. If disabled, will not track against USD, this can be especially helpful when running strategies under live, database and CSV based data | `false` | | custom-settings | This is a map where you can enter custom settings for a strategy. The RSI strategy allows for customisation of the upper, lower and length variables to allow you to change them from 70, 30 and 14 respectively to 69, 36, 12 | `"custom-settings": { "rsi-high": 70, "rsi-low": 30, "rsi-period": 14 } ` | #### Funding Config Settings @@ -232,7 +232,7 @@ See below for a set of tables and fields, expected values and what they can do | data-check-timer | The interval in which to check exchange API's for new data | `1000000000` | | real-orders | Whether to place real orders with real money. Its likely you should never want to set this to true | `false` | | close-positions-on-stop | As live trading doesn't stop until you tell it to, you can trigger a close of your position(s) when you stop the strategy | `true` | -| data-request-retry-tolerance | Rather than immediately closing a strategy on failure to retreive candle data, having a retry tolerance allows multiple attempts to return data | `3` | +| data-request-retry-tolerance | Rather than immediately closing a strategy on failure to retrieve candle data, having a retry tolerance allows multiple attempts to return data | `3` | | data-request-retry-wait-time | How long to wait in between request retries | `500000000` | | exchange-credentials | A list of exchange credentials. See table named `ExchangeCredentials` | | diff --git a/backtester/eventhandlers/portfolio/portfolio.go b/backtester/eventhandlers/portfolio/portfolio.go index eba246dfb34..597583beaed 100644 --- a/backtester/eventhandlers/portfolio/portfolio.go +++ b/backtester/eventhandlers/portfolio/portfolio.go @@ -265,7 +265,7 @@ func (p *Portfolio) OnFill(ev fill.Event, funds funding.IFundReleaser) (fill.Eve return ev, nil } -// addComplianceSnapshot gets the previous snapshot of compliance events, updates with the latest fillevent +// addComplianceSnapshot gets the previous snapshot of compliance events, updates with the latest fill event // then saves the snapshot to the c func (p *Portfolio) addComplianceSnapshot(fillEvent fill.Event) error { if fillEvent == nil { @@ -276,17 +276,17 @@ func (p *Portfolio) addComplianceSnapshot(fillEvent fill.Event) error { return err } prevSnap := complianceManager.GetLatestSnapshot() - if fo := fillEvent.GetOrder(); fo != nil { - price := decimal.NewFromFloat(fo.Price) - amount := decimal.NewFromFloat(fo.Amount) - fee := decimal.NewFromFloat(fo.Fee) + if filledOrder := fillEvent.GetOrder(); filledOrder != nil { + price := decimal.NewFromFloat(filledOrder.Price) + amount := decimal.NewFromFloat(filledOrder.Amount) + fee := decimal.NewFromFloat(filledOrder.Fee) snapOrder := compliance.SnapshotOrder{ ClosePrice: fillEvent.GetClosePrice(), VolumeAdjustedPrice: fillEvent.GetVolumeAdjustedPrice(), SlippageRate: fillEvent.GetSlippageRate(), CostBasis: price.Mul(amount).Add(fee), } - snapOrder.Order = fo + snapOrder.Order = filledOrder prevSnap.Orders = append(prevSnap.Orders, snapOrder) } snap := &compliance.Snapshot{ diff --git a/backtester/eventtypes/signal/signal_types.go b/backtester/eventtypes/signal/signal_types.go index 12c57283e9b..cf53d1e976f 100644 --- a/backtester/eventtypes/signal/signal_types.go +++ b/backtester/eventtypes/signal/signal_types.go @@ -57,7 +57,7 @@ type Signal struct { // if there is corresponding collateral in the selected currency // this enabled cash and carry strategies for example FillDependentEvent Event - // CollateralCurrency is an optional paramater + // CollateralCurrency is an optional parameter // when using futures to limit the collateral available // to a singular currency // eg with $5000 usd and 1 BTC, specifying BTC ensures diff --git a/backtester/funding/README.md b/backtester/funding/README.md index 02ccb514d67..57350aaefef 100644 --- a/backtester/funding/README.md +++ b/backtester/funding/README.md @@ -69,7 +69,7 @@ No. The already existing `CurrencySettings` will populate the funding manager wi |------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------| | name | The strategy to use | `rsi` | | use-simultaneous-signal-processing | This denotes whether multiple currencies are processed simultaneously with the strategy function `OnSimultaneousSignals`. Eg If you have multiple CurrencySettings and only wish to purchase BTC-USDT when XRP-DOGE is 1337, this setting is useful as you can analyse both signal events to output a purchase call for BTC | `true` | -| disable-usd-tracking | If `false`, will track all currencies used in your strategy against USD equivalent candles. For example, if you are running a strategy for BTC/XRP, then the GoCryptoTrader Backtester will also retreive candles data for BTC/USD and XRP/USD to then track strategy performance against a single currency. This also tracks against USDT and other USD tracked stablecoins, so one exchange supporting USDT and another BUSD will still allow unified strategy performance analysis. If disabled, will not track against USD, this can be especially helpful when running strategies under live, database and CSV based data | `false` | +| disable-usd-tracking | If `false`, will track all currencies used in your strategy against USD equivalent candles. For example, if you are running a strategy for BTC/XRP, then the GoCryptoTrader Backtester will also retrieve candles data for BTC/USD and XRP/USD to then track strategy performance against a single currency. This also tracks against USDT and other USD tracked stablecoins, so one exchange supporting USDT and another BUSD will still allow unified strategy performance analysis. If disabled, will not track against USD, this can be especially helpful when running strategies under live, database and CSV based data | `false` | | custom-settings | This is a map where you can enter custom settings for a strategy. The RSI strategy allows for customisation of the upper, lower and length variables to allow you to change them from 70, 30 and 14 respectively to 69, 36, 12 | `"custom-settings": { "rsi-high": 70, "rsi-low": 30, "rsi-period": 14 } ` | #### Funding Config Settings diff --git a/backtester/funding/collateralpair_test.go b/backtester/funding/collateralpair_test.go index 6273c85a626..566132dad13 100644 --- a/backtester/funding/collateralpair_test.go +++ b/backtester/funding/collateralpair_test.go @@ -34,7 +34,7 @@ func TestCollateralTakeProfit(t *testing.T) { var expectedError error err := c.TakeProfit(decimal.NewFromInt(1), decimal.NewFromInt(1)) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } } @@ -44,7 +44,7 @@ func TestCollateralCollateralCurrency(t *testing.T) { collateral: &Item{currency: currency.DOGE}, } if !c.CollateralCurrency().Equal(currency.DOGE) { - t.Errorf("recevied '%v' expected '%v'", c.CollateralCurrency(), currency.DOGE) + t.Errorf("received '%v' expected '%v'", c.CollateralCurrency(), currency.DOGE) } } @@ -54,7 +54,7 @@ func TestCollateralContractCurrency(t *testing.T) { contract: &Item{currency: currency.DOGE}, } if !c.ContractCurrency().Equal(currency.DOGE) { - t.Errorf("recevied '%v' expected '%v'", c.ContractCurrency(), currency.DOGE) + t.Errorf("received '%v' expected '%v'", c.ContractCurrency(), currency.DOGE) } } @@ -64,7 +64,7 @@ func TestCollateralInitialFunds(t *testing.T) { collateral: &Item{initialFunds: decimal.NewFromInt(1337)}, } if !c.InitialFunds().Equal(decimal.NewFromInt(1337)) { - t.Errorf("recevied '%v' expected '%v'", c.InitialFunds(), decimal.NewFromInt(1337)) + t.Errorf("received '%v' expected '%v'", c.InitialFunds(), decimal.NewFromInt(1337)) } } @@ -74,7 +74,7 @@ func TestCollateralAvailableFunds(t *testing.T) { collateral: &Item{available: decimal.NewFromInt(1337)}, } if !c.AvailableFunds().Equal(decimal.NewFromInt(1337)) { - t.Errorf("recevied '%v' expected '%v'", c.AvailableFunds(), decimal.NewFromInt(1337)) + t.Errorf("received '%v' expected '%v'", c.AvailableFunds(), decimal.NewFromInt(1337)) } } @@ -85,7 +85,7 @@ func TestCollateralGetPairReader(t *testing.T) { collateral: &Item{}, } if _, err := c.GetPairReader(); !errors.Is(err, ErrNotPair) { - t.Errorf("recevied '%v' expected '%v'", err, ErrNotPair) + t.Errorf("received '%v' expected '%v'", err, ErrNotPair) } } @@ -97,7 +97,7 @@ func TestCollateralGetCollateralReader(t *testing.T) { var expectedError error cr, err := c.GetCollateralReader() if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } if cr != c { t.Error("expected the same thing") @@ -119,27 +119,27 @@ func TestCollateralUpdateContracts(t *testing.T) { leet := decimal.NewFromInt(1337) err := c.UpdateContracts(gctorder.Buy, leet) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } if !c.contract.available.Equal(leet) { - t.Errorf("recevied '%v' expected '%v'", c.contract.available, leet) + t.Errorf("received '%v' expected '%v'", c.contract.available, leet) } b = gctorder.Sell err = c.UpdateContracts(gctorder.Buy, leet) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } if !c.contract.available.Equal(decimal.Zero) { - t.Errorf("recevied '%v' expected '%v'", c.contract.available, decimal.Zero) + t.Errorf("received '%v' expected '%v'", c.contract.available, decimal.Zero) } c.currentDirection = nil err = c.UpdateContracts(gctorder.Buy, leet) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } if !c.contract.available.Equal(leet) { - t.Errorf("recevied '%v' expected '%v'", c.contract.available, leet) + t.Errorf("received '%v' expected '%v'", c.contract.available, leet) } } @@ -158,20 +158,20 @@ func TestCollateralReleaseContracts(t *testing.T) { expectedError := errPositiveOnly err := c.ReleaseContracts(decimal.Zero) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } expectedError = errCannotAllocate err = c.ReleaseContracts(decimal.NewFromInt(1337)) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } expectedError = nil c.contract.available = decimal.NewFromInt(1337) err = c.ReleaseContracts(decimal.NewFromInt(1337)) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } } @@ -192,7 +192,7 @@ func TestCollateralPairReleaser(t *testing.T) { contract: &Item{}, } if _, err := c.PairReleaser(); !errors.Is(err, ErrNotPair) { - t.Errorf("recevied '%v' expected '%v'", err, ErrNotPair) + t.Errorf("received '%v' expected '%v'", err, ErrNotPair) } } @@ -214,7 +214,7 @@ func TestCollateralCollateralReleaser(t *testing.T) { } var expectedError error if _, err := c.CollateralReleaser(); !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } } @@ -241,41 +241,41 @@ func TestCollateralReserve(t *testing.T) { var expectedError error err := c.Reserve(decimal.NewFromInt(1), gctorder.Long) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } if !c.collateral.reserved.Equal(decimal.NewFromInt(1)) { - t.Errorf("recevied '%v' expected '%v'", c.collateral.reserved, decimal.NewFromInt(1)) + t.Errorf("received '%v' expected '%v'", c.collateral.reserved, decimal.NewFromInt(1)) } if !c.collateral.available.Equal(decimal.NewFromInt(1336)) { - t.Errorf("recevied '%v' expected '%v'", c.collateral.available, decimal.NewFromInt(1336)) + t.Errorf("received '%v' expected '%v'", c.collateral.available, decimal.NewFromInt(1336)) } err = c.Reserve(decimal.NewFromInt(1), gctorder.Short) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } if !c.collateral.reserved.Equal(decimal.NewFromInt(2)) { - t.Errorf("recevied '%v' expected '%v'", c.collateral.reserved, decimal.NewFromInt(2)) + t.Errorf("received '%v' expected '%v'", c.collateral.reserved, decimal.NewFromInt(2)) } if !c.collateral.available.Equal(decimal.NewFromInt(1335)) { - t.Errorf("recevied '%v' expected '%v'", c.collateral.available, decimal.NewFromInt(1335)) + t.Errorf("received '%v' expected '%v'", c.collateral.available, decimal.NewFromInt(1335)) } err = c.Reserve(decimal.NewFromInt(2), gctorder.ClosePosition) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } if !c.collateral.reserved.Equal(decimal.NewFromInt(4)) { - t.Errorf("recevied '%v' expected '%v'", c.collateral.reserved, decimal.Zero) + t.Errorf("received '%v' expected '%v'", c.collateral.reserved, decimal.Zero) } if !c.collateral.available.Equal(decimal.NewFromInt(1333)) { - t.Errorf("recevied '%v' expected '%v'", c.collateral.available, decimal.NewFromInt(1333)) + t.Errorf("received '%v' expected '%v'", c.collateral.available, decimal.NewFromInt(1333)) } expectedError = errCannotAllocate err = c.Reserve(decimal.NewFromInt(2), gctorder.Buy) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } } @@ -293,10 +293,10 @@ func TestCollateralLiquidate(t *testing.T) { } c.Liquidate() if !c.collateral.available.Equal(decimal.Zero) { - t.Errorf("recevied '%v' expected '%v'", c.collateral.available, decimal.Zero) + t.Errorf("received '%v' expected '%v'", c.collateral.available, decimal.Zero) } if !c.contract.available.Equal(decimal.Zero) { - t.Errorf("recevied '%v' expected '%v'", c.contract.available, decimal.Zero) + t.Errorf("received '%v' expected '%v'", c.contract.available, decimal.Zero) } } @@ -306,6 +306,6 @@ func TestCollateralCurrentHoldings(t *testing.T) { contract: &Item{available: decimal.NewFromInt(1337)}, } if !c.CurrentHoldings().Equal(decimal.NewFromInt(1337)) { - t.Errorf("recevied '%v' expected '%v'", c.CurrentHoldings(), decimal.NewFromInt(1337)) + t.Errorf("received '%v' expected '%v'", c.CurrentHoldings(), decimal.NewFromInt(1337)) } } diff --git a/backtester/funding/funding_test.go b/backtester/funding/funding_test.go index 13dc730cf30..a4d99494ce1 100644 --- a/backtester/funding/funding_test.go +++ b/backtester/funding/funding_test.go @@ -595,7 +595,7 @@ func TestFundingLiquidate(t *testing.T) { f := FundManager{} err := f.Liquidate(nil) if !errors.Is(err, gctcommon.ErrNilPointer) { - t.Errorf("recevied '%v' expected '%v'", err, gctcommon.ErrNilPointer) + t.Errorf("received '%v' expected '%v'", err, gctcommon.ErrNilPointer) } f.items = append(f.items, &Item{ exchange: "test", @@ -612,7 +612,7 @@ func TestFundingLiquidate(t *testing.T) { }, }) if !errors.Is(err, nil) { - t.Errorf("recevied '%v' expected '%v'", err, nil) + t.Errorf("received '%v' expected '%v'", err, nil) } if !f.items[0].available.IsZero() { t.Errorf("received '%v' expected '%v'", f.items[0].available, "0") @@ -624,7 +624,7 @@ func TestHasExchangeBeenLiquidated(t *testing.T) { f := FundManager{} err := f.Liquidate(nil) if !errors.Is(err, gctcommon.ErrNilPointer) { - t.Errorf("recevied '%v' expected '%v'", err, gctcommon.ErrNilPointer) + t.Errorf("received '%v' expected '%v'", err, gctcommon.ErrNilPointer) } f.items = append(f.items, &Item{ exchange: "test", @@ -641,7 +641,7 @@ func TestHasExchangeBeenLiquidated(t *testing.T) { } err = f.Liquidate(ev) if !errors.Is(err, nil) { - t.Errorf("recevied '%v' expected '%v'", err, nil) + t.Errorf("received '%v' expected '%v'", err, nil) } if !f.items[0].available.IsZero() { t.Errorf("received '%v' expected '%v'", f.items[0].available, "0") @@ -710,16 +710,16 @@ func TestRealisePNL(t *testing.T) { var expectedError error err := f.RealisePNL("test", asset.Futures, currency.BTC, decimal.NewFromInt(1)) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } if !f.items[0].available.Equal(decimal.NewFromInt(1337)) { - t.Errorf("recevied '%v' expected '%v'", f.items[0].available, decimal.NewFromInt(1337)) + t.Errorf("received '%v' expected '%v'", f.items[0].available, decimal.NewFromInt(1337)) } expectedError = ErrFundsNotFound err = f.RealisePNL("test2", asset.Futures, currency.BTC, decimal.NewFromInt(1)) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } } @@ -742,18 +742,18 @@ func TestCreateCollateral(t *testing.T) { var expectedError error _, err := CreateCollateral(collat, contract) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } expectedError = gctcommon.ErrNilPointer _, err = CreateCollateral(nil, contract) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } _, err = CreateCollateral(collat, nil) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } } @@ -763,7 +763,7 @@ func TestUpdateCollateral(t *testing.T) { expectedError := common.ErrNilEvent err := f.UpdateCollateralForEvent(nil, false) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } ev := &signal.Signal{ @@ -791,7 +791,7 @@ func TestUpdateCollateral(t *testing.T) { expectedError = nil err = f.UpdateCollateralForEvent(ev, false) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } expectedError = gctcommon.ErrNotYetImplemented @@ -804,7 +804,7 @@ func TestUpdateCollateral(t *testing.T) { }) err = f.UpdateCollateralForEvent(ev, false) if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } } diff --git a/backtester/funding/spotpair_test.go b/backtester/funding/spotpair_test.go index f0de925c4b7..33cde86a8b3 100644 --- a/backtester/funding/spotpair_test.go +++ b/backtester/funding/spotpair_test.go @@ -263,7 +263,7 @@ func TestGetPairReader(t *testing.T) { var expectedError error ip, err := p.GetPairReader() if !errors.Is(err, expectedError) { - t.Errorf("recevied '%v' expected '%v'", err, expectedError) + t.Errorf("received '%v' expected '%v'", err, expectedError) } if ip != p { t.Error("expected the same thing") @@ -276,7 +276,7 @@ func TestGetCollateralReader(t *testing.T) { base: &Item{exchange: "hello"}, } if _, err := p.GetCollateralReader(); !errors.Is(err, ErrNotCollateral) { - t.Errorf("recevied '%v' expected '%v'", err, ErrNotCollateral) + t.Errorf("received '%v' expected '%v'", err, ErrNotCollateral) } } @@ -316,7 +316,7 @@ func TestPairReleaser(t *testing.T) { base: &Item{exchange: "hello"}, } if _, err := p.PairReleaser(); !errors.Is(err, nil) { - t.Errorf("recevied '%v' expected '%v'", err, nil) + t.Errorf("received '%v' expected '%v'", err, nil) } } @@ -326,7 +326,7 @@ func TestCollateralReleaser(t *testing.T) { base: &Item{exchange: "hello"}, } if _, err := p.CollateralReleaser(); !errors.Is(err, ErrNotCollateral) { - t.Errorf("recevied '%v' expected '%v'", err, ErrNotCollateral) + t.Errorf("received '%v' expected '%v'", err, ErrNotCollateral) } } diff --git a/backtester/funding/trackingcurrencies/trackingcurrencies_test.go b/backtester/funding/trackingcurrencies/trackingcurrencies_test.go index 045bfa2672f..4ba70df58b6 100644 --- a/backtester/funding/trackingcurrencies/trackingcurrencies_test.go +++ b/backtester/funding/trackingcurrencies/trackingcurrencies_test.go @@ -133,7 +133,7 @@ func TestFindMatchingUSDPairs(t *testing.T) { expectedErr: errNoMatchingPairUSDFound, }, { - description: "currency doesnt exist in available pairs", + description: "currency doesn't exist in available pairs", initialPair: currency.NewPair(currency.BTC, currency.LTC), availablePairs: ¤cy.PairStore{Available: currency.Pairs{currency.NewPair(currency.BTC, currency.DOGE)}}, basePair: currency.EMPTYPAIR, diff --git a/backtester/report/report_types.go b/backtester/report/report_types.go index cff3d43b7d3..bbb3bcbb399 100644 --- a/backtester/report/report_types.go +++ b/backtester/report/report_types.go @@ -13,7 +13,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" ) -// lightweight charts can ony render 1100 candles +// lightweight charts can only render 1100 candles const maxChartLimit = 1100 var ( diff --git a/cmd/apichecker/README.md b/cmd/apichecker/README.md index 620045ca81c..ad15026e226 100644 --- a/cmd/apichecker/README.md +++ b/cmd/apichecker/README.md @@ -57,7 +57,7 @@ go build && apichecker.exe + Upon addition of a new exchange, to update Trello checklist and to add the exchange to updates.json the following would need to be done: ###### HTML Scraping method: -HTMLScrapingData is a struct which contains the necessary information to scrape data from the given path website. Not all the elements of HTMLScrapingData are necessary, its all dependant on site where information is being extracted from. Regexp is used to capture necessary bits of data using r.FindString() where r is the declared regular expression. If update dates data is available, DateFormat is used to convert the dates to a more standard format which can then be used for further comparisons of which update is most recent. +HTMLScrapingData is a struct which contains the necessary information to scrape data from the given path website. Not all the elements of HTMLScrapingData are necessary, its all dependent on site where information is being extracted from. Regexp is used to capture necessary bits of data using r.FindString() where r is the declared regular expression. If update dates data is available, DateFormat is used to convert the dates to a more standard format which can then be used for further comparisons of which update is most recent. ```go func TestAdd(t *testing.T) { t.Parallel() diff --git a/cmd/documentation/backtester_templates/backtester_config_readme.tmpl b/cmd/documentation/backtester_templates/backtester_config_readme.tmpl index ea12dbbee79..2c8572a088d 100644 --- a/cmd/documentation/backtester_templates/backtester_config_readme.tmpl +++ b/cmd/documentation/backtester_templates/backtester_config_readme.tmpl @@ -97,7 +97,7 @@ See below for a set of tables and fields, expected values and what they can do |------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------| | name | The strategy to use | `rsi` | | use-simultaneous-signal-processing | This denotes whether multiple currencies are processed simultaneously with the strategy function `OnSimultaneousSignals`. Eg If you have multiple CurrencySettings and only wish to purchase BTC-USDT when XRP-DOGE is 1337, this setting is useful as you can analyse both signal events to output a purchase call for BTC | `true` | -| disable-usd-tracking | If `false`, will track all currencies used in your strategy against USD equivalent candles. For example, if you are running a strategy for BTC/XRP, then the GoCryptoTrader Backtester will also retreive candles data for BTC/USD and XRP/USD to then track strategy performance against a single currency. This also tracks against USDT and other USD tracked stablecoins, so one exchange supporting USDT and another BUSD will still allow unified strategy performance analysis. If disabled, will not track against USD, this can be especially helpful when running strategies under live, database and CSV based data | `false` | +| disable-usd-tracking | If `false`, will track all currencies used in your strategy against USD equivalent candles. For example, if you are running a strategy for BTC/XRP, then the GoCryptoTrader Backtester will also retrieve candles data for BTC/USD and XRP/USD to then track strategy performance against a single currency. This also tracks against USDT and other USD tracked stablecoins, so one exchange supporting USDT and another BUSD will still allow unified strategy performance analysis. If disabled, will not track against USD, this can be especially helpful when running strategies under live, database and CSV based data | `false` | | custom-settings | This is a map where you can enter custom settings for a strategy. The RSI strategy allows for customisation of the upper, lower and length variables to allow you to change them from 70, 30 and 14 respectively to 69, 36, 12 | `"custom-settings": { "rsi-high": 70, "rsi-low": 30, "rsi-period": 14 } ` | #### Funding Config Settings @@ -214,7 +214,7 @@ See below for a set of tables and fields, expected values and what they can do | data-check-timer | The interval in which to check exchange API's for new data | `1000000000` | | real-orders | Whether to place real orders with real money. Its likely you should never want to set this to true | `false` | | close-positions-on-stop | As live trading doesn't stop until you tell it to, you can trigger a close of your position(s) when you stop the strategy | `true` | -| data-request-retry-tolerance | Rather than immediately closing a strategy on failure to retreive candle data, having a retry tolerance allows multiple attempts to return data | `3` | +| data-request-retry-tolerance | Rather than immediately closing a strategy on failure to retrieve candle data, having a retry tolerance allows multiple attempts to return data | `3` | | data-request-retry-wait-time | How long to wait in between request retries | `500000000` | | exchange-credentials | A list of exchange credentials. See table named `ExchangeCredentials` | | diff --git a/cmd/documentation/backtester_templates/backtester_funding_readme.tmpl b/cmd/documentation/backtester_templates/backtester_funding_readme.tmpl index 8b55103b1b8..4b5c90d8057 100644 --- a/cmd/documentation/backtester_templates/backtester_funding_readme.tmpl +++ b/cmd/documentation/backtester_templates/backtester_funding_readme.tmpl @@ -51,7 +51,7 @@ No. The already existing `CurrencySettings` will populate the funding manager wi |------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------| | name | The strategy to use | `rsi` | | use-simultaneous-signal-processing | This denotes whether multiple currencies are processed simultaneously with the strategy function `OnSimultaneousSignals`. Eg If you have multiple CurrencySettings and only wish to purchase BTC-USDT when XRP-DOGE is 1337, this setting is useful as you can analyse both signal events to output a purchase call for BTC | `true` | -| disable-usd-tracking | If `false`, will track all currencies used in your strategy against USD equivalent candles. For example, if you are running a strategy for BTC/XRP, then the GoCryptoTrader Backtester will also retreive candles data for BTC/USD and XRP/USD to then track strategy performance against a single currency. This also tracks against USDT and other USD tracked stablecoins, so one exchange supporting USDT and another BUSD will still allow unified strategy performance analysis. If disabled, will not track against USD, this can be especially helpful when running strategies under live, database and CSV based data | `false` | +| disable-usd-tracking | If `false`, will track all currencies used in your strategy against USD equivalent candles. For example, if you are running a strategy for BTC/XRP, then the GoCryptoTrader Backtester will also retrieve candles data for BTC/USD and XRP/USD to then track strategy performance against a single currency. This also tracks against USDT and other USD tracked stablecoins, so one exchange supporting USDT and another BUSD will still allow unified strategy performance analysis. If disabled, will not track against USD, this can be especially helpful when running strategies under live, database and CSV based data | `false` | | custom-settings | This is a map where you can enter custom settings for a strategy. The RSI strategy allows for customisation of the upper, lower and length variables to allow you to change them from 70, 30 and 14 respectively to 69, 36, 12 | `"custom-settings": { "rsi-high": 70, "rsi-low": 30, "rsi-period": 14 } ` | #### Funding Config Settings diff --git a/cmd/documentation/cmd_templates/apichecker.tmpl b/cmd/documentation/cmd_templates/apichecker.tmpl index d670327391e..023d9099f7e 100644 --- a/cmd/documentation/cmd_templates/apichecker.tmpl +++ b/cmd/documentation/cmd_templates/apichecker.tmpl @@ -39,7 +39,7 @@ go build && apichecker.exe + Upon addition of a new exchange, to update Trello checklist and to add the exchange to updates.json the following would need to be done: ###### HTML Scraping method: -HTMLScrapingData is a struct which contains the necessary information to scrape data from the given path website. Not all the elements of HTMLScrapingData are necessary, its all dependant on site where information is being extracted from. Regexp is used to capture necessary bits of data using r.FindString() where r is the declared regular expression. If update dates data is available, DateFormat is used to convert the dates to a more standard format which can then be used for further comparisons of which update is most recent. +HTMLScrapingData is a struct which contains the necessary information to scrape data from the given path website. Not all the elements of HTMLScrapingData are necessary, its all dependent on site where information is being extracted from. Regexp is used to capture necessary bits of data using r.FindString() where r is the declared regular expression. If update dates data is available, DateFormat is used to convert the dates to a more standard format which can then be used for further comparisons of which update is most recent. ```go func TestAdd(t *testing.T) { t.Parallel() diff --git a/cmd/documentation/engine_templates/datahistory_manager.tmpl b/cmd/documentation/engine_templates/datahistory_manager.tmpl index a2182616cdc..d632d76516b 100644 --- a/cmd/documentation/engine_templates/datahistory_manager.tmpl +++ b/cmd/documentation/engine_templates/datahistory_manager.tmpl @@ -43,7 +43,7 @@ A breakdown of each type is under the Add Jobs command list below | Job Status | Description | Representative value | | ---------- | ----------- | -------------------- | | active | A job that is ready to processed | 0 | -| failed | The job has failed to retrieve/covert/validate the data you have specified. See the associated data history job results to understand why | 1 | +| failed | The job has failed to retrieve/convert/validate the data you have specified. See the associated data history job results to understand why | 1 | | complete | The job has successfully retrieved/converted/validated all data you have specified | 2 | | removed | The job has been deleted. No data is removed, but the job can no longer be processed | 3 | | missing data | The job is complete, however there is some missing data. See the associated data history job results to understand why | 4 | diff --git a/cmd/exchange_template/wrapper_file.tmpl b/cmd/exchange_template/wrapper_file.tmpl index 3c90d8980fc..689657d18fa 100644 --- a/cmd/exchange_template/wrapper_file.tmpl +++ b/cmd/exchange_template/wrapper_file.tmpl @@ -68,7 +68,7 @@ func ({{.Variable}} *{{.CapitalName}}) SetDefaults() { log.Errorln(log.ExchangeSys, err) } - // If assets require multiple differences in formating for request and + // If assets require multiple differences in formatting for request and // configuration, another exchange method can be be used e.g. futures // contracts require a dash as a delimiter rather than an underscore. You // can use this example below: diff --git a/cmd/gctcli/technical_analysis.go b/cmd/gctcli/technical_analysis.go index 1f6361c3dec..1d1b7753921 100644 --- a/cmd/gctcli/technical_analysis.go +++ b/cmd/gctcli/technical_analysis.go @@ -119,7 +119,7 @@ var ( var technicalAnalysisCommand = &cli.Command{ Name: "technicalanalysis", - Usage: "get techincal analysis command", + Usage: "get technical analysis command", Aliases: []string{"ta"}, ArgsUsage: " ", Subcommands: []*cli.Command{ diff --git a/common/common_test.go b/common/common_test.go index c64a24e881f..37cba6474d1 100644 --- a/common/common_test.go +++ b/common/common_test.go @@ -708,7 +708,7 @@ func TestMatchesEmailPattern(t *testing.T) { if success { t.Error("MatchesEmailPattern() unexpected test validation result") } - success = MatchesEmailPattern("someon esemail@gmail") + success = MatchesEmailPattern("someone esemail@gmail") if success { t.Error("MatchesEmailPattern() unexpected test validation result") } diff --git a/common/convert/convert.go b/common/convert/convert.go index 82a4a37a146..42a4910420c 100644 --- a/common/convert/convert.go +++ b/common/convert/convert.go @@ -79,7 +79,7 @@ func UnixTimestampStrToTime(timeStr string) (time.Time, error) { return time.Unix(i, 0), nil } -// BoolPtr takes in boolen condition and returns pointer version of it +// BoolPtr takes in boolean condition and returns pointer version of it func BoolPtr(condition bool) *bool { b := condition return &b diff --git a/common/math/math_test.go b/common/math/math_test.go index 140cbc3f9ad..ed21cf3e990 100644 --- a/common/math/math_test.go +++ b/common/math/math_test.go @@ -95,7 +95,7 @@ func TestRoundFloat(t *testing.T) { for testInput, expectedOutput := range values { actualOutput := RoundFloat(testInput, precision) if actualOutput != expectedOutput { - t.Errorf("RoundFloat Expected '%v'. Actual '%v' on precission %d", + t.Errorf("RoundFloat Expected '%v'. Actual '%v' on precision %d", expectedOutput, actualOutput, precision) } } diff --git a/communications/slack/slack.go b/communications/slack/slack.go index ce14fdb5001..193f4c1a4ad 100644 --- a/communications/slack/slack.go +++ b/communications/slack/slack.go @@ -263,15 +263,15 @@ func (s *Slack) WebsocketReader() { } func (s *Slack) handlePresenceChange(resp []byte) error { - var pres PresenceChange - err := json.Unmarshal(resp, &pres) + var p PresenceChange + err := json.Unmarshal(resp, &p) if err != nil { return err } if s.Verbose { log.Debugf(log.CommunicationMgr, "Slack: Presence change. User %s [%s] changed status to %s\n", - s.GetUsernameByID(pres.User), - pres.User, pres.Presence) + s.GetUsernameByID(p.User), + p.User, p.Presence) } return nil } diff --git a/communications/slack/slack_test.go b/communications/slack/slack_test.go index d3298b47efa..f7f307a5cc4 100644 --- a/communications/slack/slack_test.go +++ b/communications/slack/slack_test.go @@ -197,16 +197,16 @@ func TestWebsocketConnect(t *testing.T) { func TestHandlePresenceChange(t *testing.T) { t.Parallel() var s Slack - var pres PresenceChange - pres.User = "1337" - pres.Presence = "Present" + var presChange PresenceChange + presChange.User = "1337" + presChange.Presence = "Present" err := s.handlePresenceChange([]byte(`{"malformedjson}`)) if err == nil { t.Error("slack handlePresenceChange(), unmarshalled malformed json") } - data, err := json.Marshal(pres) + data, err := json.Marshal(presChange) if err != nil { t.Fatal(err) } diff --git a/config/config.go b/config/config.go index 3a77ff559b0..33849ca75d7 100644 --- a/config/config.go +++ b/config/config.go @@ -583,7 +583,7 @@ func (c *Config) CheckPairConsistency(exchName string) error { atLeastOneEnabled = true } - // If no pair is enabled across the entire range of assets, then atleast + // If no pair is enabled across the entire range of assets, then at least // enable one and turn on the asset type if !atLeastOneEnabled { avail, err := c.GetAvailablePairs(exchName, assetTypes[0]) @@ -661,7 +661,7 @@ func (c *Config) GetPairFormat(exchName string, assetType asset.Item) (currency. return *p.ConfigFormat, nil } -// GetAvailablePairs returns a list of currency pairs for a specifc exchange +// GetAvailablePairs returns a list of currency pairs for a specific exchange func (c *Config) GetAvailablePairs(exchName string, assetType asset.Item) (currency.Pairs, error) { exchCfg, err := c.GetExchangeConfig(exchName) if err != nil { @@ -685,7 +685,7 @@ func (c *Config) GetAvailablePairs(exchName string, assetType asset.Item) (curre return pairs.Format(pairFormat), nil } -// GetEnabledPairs returns a list of currency pairs for a specifc exchange +// GetEnabledPairs returns a list of currency pairs for a specific exchange func (c *Config) GetEnabledPairs(exchName string, assetType asset.Item) (currency.Pairs, error) { exchCfg, err := c.GetExchangeConfig(exchName) if err != nil { @@ -755,7 +755,7 @@ func (c *Config) GetAllExchangeConfigs() []Exchange { return configs } -// GetExchangeConfig returns exchange configurations by its indivdual name +// GetExchangeConfig returns exchange configurations by its individual name func (c *Config) GetExchangeConfig(name string) (*Exchange, error) { m.Lock() defer m.Unlock() @@ -780,7 +780,7 @@ func (c *Config) UpdateExchangeConfig(e *Exchange) error { return fmt.Errorf("%s %w", e.Name, ErrExchangeNotFound) } -// CheckExchangeConfigValues returns configuation values for all enabled +// CheckExchangeConfigValues returns configuration values for all enabled // exchanges func (c *Config) CheckExchangeConfigValues() error { if len(c.Exchanges) == 0 { diff --git a/config/config_test.go b/config/config_test.go index d553f8fd3d8..f703c481611 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -812,7 +812,7 @@ func TestCheckPairConsistency(t *testing.T) { } if len(c.Exchanges[0].CurrencyPairs.Pairs[asset.Spot].Enabled) != 1 { - t.Fatal("there should be atleast one pair located in this list") + t.Fatal("there should be at least one pair located in this list") } if !c.Exchanges[0].CurrencyPairs.Pairs[asset.Spot].Enabled[0].Equal(p1) { @@ -840,7 +840,7 @@ func TestCheckPairConsistency(t *testing.T) { } if len(c.Exchanges[0].CurrencyPairs.Pairs[asset.Spot].Enabled) != 1 { - t.Fatal("should be populated with atleast one currency pair") + t.Fatal("should be populated with at least one currency pair") } // Test that an invalid enabled pair is removed from the list @@ -861,7 +861,7 @@ func TestCheckPairConsistency(t *testing.T) { c.Exchanges[0].CurrencyPairs.Pairs[asset.Spot].AssetEnabled = convert.BoolPtr(true) c.Exchanges[0].CurrencyPairs.Pairs[asset.Spot].Enabled = currency.Pairs{} - // Test no conflict and atleast one on enabled asset type + // Test no conflict and at least one on enabled asset type if err := c.CheckPairConsistency(testFakeExchangeName); err != nil { t.Error("unexpected result") } @@ -869,7 +869,7 @@ func TestCheckPairConsistency(t *testing.T) { c.Exchanges[0].CurrencyPairs.Pairs[asset.Spot].AssetEnabled = convert.BoolPtr(true) c.Exchanges[0].CurrencyPairs.Pairs[asset.Spot].Enabled = currency.Pairs{currency.NewPair(currency.DASH, currency.USD)} - // Test with conflict and atleast one on enabled asset type + // Test with conflict and at least one on enabled asset type if err := c.CheckPairConsistency(testFakeExchangeName); err != nil { t.Error("unexpected result") } @@ -877,7 +877,7 @@ func TestCheckPairConsistency(t *testing.T) { c.Exchanges[0].CurrencyPairs.Pairs[asset.Spot].AssetEnabled = convert.BoolPtr(false) c.Exchanges[0].CurrencyPairs.Pairs[asset.Spot].Enabled = currency.Pairs{} - // Test no conflict and atleast one on disabled asset type + // Test no conflict and at least one on disabled asset type if err := c.CheckPairConsistency(testFakeExchangeName); err != nil { t.Error("unexpected result") } @@ -888,7 +888,7 @@ func TestCheckPairConsistency(t *testing.T) { p2, } - // Test with conflict and atleast one on disabled asset type + // Test with conflict and at least one on disabled asset type if err := c.CheckPairConsistency(testFakeExchangeName); err != nil { t.Error("unexpected result") } diff --git a/contrib/spellcheck/exclude_lines.txt b/contrib/spellcheck/exclude_lines.txt new file mode 100644 index 00000000000..4185a4bf246 --- /dev/null +++ b/contrib/spellcheck/exclude_lines.txt @@ -0,0 +1,19 @@ + os, errOs := order.StringToOrderStatus(genOrderDetail.Status) + if errOs != nil { + return order.Detail{}, fmt.Errorf("error parsing order status: %s", errOs) + tt, errOt := order.StringToOrderType(genOrderDetail.Type) + if errOt != nil { + return order.Detail{}, fmt.Errorf("error parsing order type: %s", errOt) + currency.CANN: 0.2, + InstrumentID string `json:"insId"` + currency.DOTA: 0.01, + currency.SCRPT: 0.01, + currency.NOO: 0.002, + currency.BU: 0.1, + currency.HAV: 10, + currency.GARD: 100, + currency.DASHS: 0.01, + const pressXToJSON = `[0,"bu",[4131.85,4131.85]]` + wsTradeExecuted = "te" + wsBalanceUpdate = "bu" + "59512": errors.New("unable to set up this permission for ND brokers sub accounts. by default, all ND sub accounts can transfer funds out"), diff --git a/contrib/spellcheck/ignore_words.txt b/contrib/spellcheck/ignore_words.txt new file mode 100644 index 00000000000..48d1bc44ece --- /dev/null +++ b/contrib/spellcheck/ignore_words.txt @@ -0,0 +1,6 @@ +strat +datas +prevend +flate +freez +zar \ No newline at end of file diff --git a/core/version.go b/core/version.go index d2722d7b5b1..6e86ddfea5f 100644 --- a/core/version.go +++ b/core/version.go @@ -11,7 +11,7 @@ const ( MajorVersion = "0" MinorVersion = "1" - PrereleaseBlurb = "This version is pre-release and is not inteded to be used as a production ready trading framework or bot - use at your own risk." + PrereleaseBlurb = "This version is pre-release and is not intended to be used as a production ready trading framework or bot - use at your own risk." IsRelease = false GitHub = "GitHub: https://github.com/thrasher-corp/gocryptotrader" Trello = "Trello: https://trello.com/b/ZAhMhpOy/gocryptotrader" diff --git a/currency/coinmarketcap/coinmarketcap_types.go b/currency/coinmarketcap/coinmarketcap_types.go index 333444b7263..bf010dc9333 100644 --- a/currency/coinmarketcap/coinmarketcap_types.go +++ b/currency/coinmarketcap/coinmarketcap_types.go @@ -6,7 +6,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" ) -// Coinmarketcap account plan bitmasks, url and enpoint consts +// Coinmarketcap account plan bitmasks, url and endpoint consts const ( Basic uint8 = 1 << iota Hobbyist diff --git a/currency/forexprovider/exchangeratesapi.io/exchangeratesapi_test.go b/currency/forexprovider/exchangeratesapi.io/exchangeratesapi_test.go index 81cfda2b45f..d2fa41f6060 100644 --- a/currency/forexprovider/exchangeratesapi.io/exchangeratesapi_test.go +++ b/currency/forexprovider/exchangeratesapi.io/exchangeratesapi_test.go @@ -58,15 +58,15 @@ func TestGetLatestRates(t *testing.T) { } if result.Base != "EUR" { - t.Fatalf("unexepcted result. Base currency should be EUR") + t.Fatalf("unexpected result. Base currency should be EUR") } if result.Rates["EUR"] != 1 { - t.Fatalf("unexepcted result. EUR value should be 1") + t.Fatalf("unexpected result. EUR value should be 1") } if len(result.Rates) <= 1 { - t.Fatalf("unexepcted result. Rates map should be 1") + t.Fatalf("unexpected result. Rates map should be 1") } if e.APIKeyLvl <= apiKeyFree { @@ -82,11 +82,11 @@ func TestGetLatestRates(t *testing.T) { } if result.Base != "EUR" { - t.Fatalf("unexepcted result. Base currency should be EUR") + t.Fatalf("unexpected result. Base currency should be EUR") } if len(result.Rates) != 1 { - t.Fatalf("unexepcted result. Rates len should be 1") + t.Fatalf("unexpected result. Rates len should be 1") } } diff --git a/currency/manager_test.go b/currency/manager_test.go index 514bd222cab..ea3aa0cf417 100644 --- a/currency/manager_test.go +++ b/currency/manager_test.go @@ -81,12 +81,12 @@ func TestGet(t *testing.T) { _, err = p.Get(asset.Empty) if !errors.Is(err, asset.ErrNotSupported) { - t.Fatalf("received: '%v' bu expected: '%v'", err, asset.ErrNotSupported) + t.Fatalf("received: '%v' but expected: '%v'", err, asset.ErrNotSupported) } _, err = p.Get(asset.CoinMarginedFutures) if !errors.Is(err, asset.ErrNotSupported) { - t.Fatalf("received: '%v' bu expected: '%v'", err, asset.ErrNotSupported) + t.Fatalf("received: '%v' but expected: '%v'", err, asset.ErrNotSupported) } } @@ -132,12 +132,12 @@ func TestStore(t *testing.T) { err = p.Store(asset.Empty, nil) if !errors.Is(err, asset.ErrNotSupported) { - t.Fatalf("received: '%v' bu expected: '%v'", err, asset.ErrNotSupported) + t.Fatalf("received: '%v' but expected: '%v'", err, asset.ErrNotSupported) } err = p.Store(asset.Futures, nil) if !errors.Is(err, errPairStoreIsNil) { - t.Fatalf("received: '%v' bu expected: '%v'", err, errPairStoreIsNil) + t.Fatalf("received: '%v' but expected: '%v'", err, errPairStoreIsNil) } } @@ -200,7 +200,7 @@ func TestGetPairs(t *testing.T) { pairs, err = p.GetPairs(asset.Empty, true) if !errors.Is(err, asset.ErrNotSupported) { - t.Fatalf("received: '%v' but expetced: '%v'", err, asset.ErrNotSupported) + t.Fatalf("received: '%v' but expected: '%v'", err, asset.ErrNotSupported) } if pairs != nil { diff --git a/currency/pair.go b/currency/pair.go index 64e8f2b6ec8..2a5b297858b 100644 --- a/currency/pair.go +++ b/currency/pair.go @@ -8,7 +8,7 @@ import ( var errCannotCreatePair = errors.New("cannot create currency pair") -// NewPairDelimiter splits the desired currency string at delimeter, the returns +// NewPairDelimiter splits the desired currency string at delimiter, the returns // a Pair struct func NewPairDelimiter(currencyPair, delimiter string) (Pair, error) { if !strings.Contains(currencyPair, delimiter) { @@ -82,7 +82,7 @@ func NewPairFromIndex(currencyPair, index string) (Pair, error) { } // NewPairFromString converts currency string into a new CurrencyPair -// with or without delimeter +// with or without delimiter func NewPairFromString(currencyPair string) (Pair, error) { for x := range delimiters { if strings.Contains(currencyPair, delimiters[x]) { diff --git a/database/repository/datahistoryjob/datahistoryjob.go b/database/repository/datahistoryjob/datahistoryjob.go index 5e1b511f1ed..d5ad00ee6d9 100644 --- a/database/repository/datahistoryjob/datahistoryjob.go +++ b/database/repository/datahistoryjob/datahistoryjob.go @@ -652,7 +652,7 @@ func (db *DBService) createSQLiteDataHistoryJobResponse(result *sqlite3.Datahist if err != nil { return nil, err } - te, err := time.Parse(time.RFC3339, result.EndTime) + tEnd, err := time.Parse(time.RFC3339, result.EndTime) if err != nil { return nil, err } @@ -709,7 +709,7 @@ func (db *DBService) createSQLiteDataHistoryJobResponse(result *sqlite3.Datahist Base: result.Base, Quote: result.Quote, StartDate: ts, - EndDate: te, + EndDate: tEnd, Interval: int64(result.Interval), RequestSizeLimit: int64(result.RequestSize), DataType: int64(result.DataType), diff --git a/database/repository/trade/trade_test.go b/database/repository/trade/trade_test.go index b43bb6ad0fb..97c1d5821a7 100644 --- a/database/repository/trade/trade_test.go +++ b/database/repository/trade/trade_test.go @@ -209,7 +209,7 @@ func tradeSQLTester(t *testing.T) { t.Error(err) } if len(v) != 0 { - t.Errorf("should all be ded %v", v) + t.Errorf("should all be dead %v", v) } } diff --git a/dispatch/dispatch_types.go b/dispatch/dispatch_types.go index 1c723bce674..0a4b4471f6d 100644 --- a/dispatch/dispatch_types.go +++ b/dispatch/dispatch_types.go @@ -8,7 +8,7 @@ import ( ) const ( - // DefaultJobsLimit defines a maxiumum amount of jobs allowed in channel + // DefaultJobsLimit defines a maximum amount of jobs allowed in channel DefaultJobsLimit = 100 // DefaultMaxWorkers is the package default worker ceiling amount @@ -24,7 +24,7 @@ var dispatcher *Dispatcher // Dispatcher defines an internal subsystem communication/change state publisher type Dispatcher struct { - // routes refers to a subystem uuid ticket map with associated publish + // routes refers to a subsystem uuid ticket map with associated publish // channels, a relayer will be given a unique id through its job channel, // then publish the data across the full registered channels for that uuid. // See relayer() method below. @@ -71,7 +71,7 @@ type Mux struct { // Pipe defines an outbound object to the desired routine type Pipe struct { - // Channel to get all our lovely informations + // Channel to get all our lovely information C <-chan interface{} // ID to tracked system id uuid.UUID diff --git a/docs/ADD_NEW_EXCHANGE.md b/docs/ADD_NEW_EXCHANGE.md index c153d947207..aeb53d5f003 100644 --- a/docs/ADD_NEW_EXCHANGE.md +++ b/docs/ADD_NEW_EXCHANGE.md @@ -431,7 +431,7 @@ const( ) func TestGetMarket(t *testing.T) { - t.Parallel() // adding t.Parralel() is preferred as it allows tests to run simultaneously, speeding up package test time + t.Parallel() // adding t.Parallel() is preferred as it allows tests to run simultaneously, speeding up package test time f.Verbose = true // used for more detailed output a, err := f.GetMarket(context.Background(), spotPair) // spotPair is just a const so it can be reused in other tests too t.Log(a) diff --git a/docs/FILES.md b/docs/FILES.md index 1b8a4c3b93f..f8317ec6089 100644 --- a/docs/FILES.md +++ b/docs/FILES.md @@ -18,7 +18,7 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader ## Default data directory -By default, GoCryptoTrader uses the following data directores: +By default, GoCryptoTrader uses the following data directories: Operating System | Path | Translated --- | --- | ---- diff --git a/engine/datahistory_manager.md b/engine/datahistory_manager.md index 14e1be4008d..1141c9ae952 100644 --- a/engine/datahistory_manager.md +++ b/engine/datahistory_manager.md @@ -61,7 +61,7 @@ A breakdown of each type is under the Add Jobs command list below | Job Status | Description | Representative value | | ---------- | ----------- | -------------------- | | active | A job that is ready to processed | 0 | -| failed | The job has failed to retrieve/covert/validate the data you have specified. See the associated data history job results to understand why | 1 | +| failed | The job has failed to retrieve/convert/validate the data you have specified. See the associated data history job results to understand why | 1 | | complete | The job has successfully retrieved/converted/validated all data you have specified | 2 | | removed | The job has been deleted. No data is removed, but the job can no longer be processed | 3 | | missing data | The job is complete, however there is some missing data. See the associated data history job results to understand why | 4 | diff --git a/engine/helpers_test.go b/engine/helpers_test.go index 7ee60726449..c1ee38cf50f 100644 --- a/engine/helpers_test.go +++ b/engine/helpers_test.go @@ -974,7 +974,7 @@ func TestGetExchangeLowestPriceByCurrencyPair(t *testing.T) { _, err = GetExchangeLowestPriceByCurrencyPair(btcaud, asset.Spot) if err == nil { - t.Error("Unexpected reuslt") + t.Error("Unexpected result") } } diff --git a/engine/order_manager_test.go b/engine/order_manager_test.go index d0f9ee12aee..eff1245593f 100644 --- a/engine/order_manager_test.go +++ b/engine/order_manager_test.go @@ -112,12 +112,12 @@ func (f omfExchange) GetActiveOrders(ctx context.Context, req *order.GetOrdersRe } func (f omfExchange) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error) { - ans, err := action.DeriveModifyResponse() + modResp, err := action.DeriveModifyResponse() if err != nil { return nil, err } - ans.OrderID = "modified_order_id" - return ans, nil + modResp.OrderID = "modified_order_id" + return modResp, nil } func (f omfExchange) GetFuturesPositions(ctx context.Context, req *order.PositionsRequest) ([]order.PositionDetails, error) { diff --git a/engine/rpcserver.go b/engine/rpcserver.go index 554591d628a..4e5bec0ac63 100644 --- a/engine/rpcserver.go +++ b/engine/rpcserver.go @@ -244,7 +244,7 @@ func (s *RPCServer) GetSubsystems(_ context.Context, _ *gctrpc.GetSubsystemsRequ return &gctrpc.GetSusbsytemsResponse{SubsystemsStatus: s.GetSubsystemsStatus()}, nil } -// EnableSubsystem enables a engine subsytem +// EnableSubsystem enables a engine subsystem func (s *RPCServer) EnableSubsystem(_ context.Context, r *gctrpc.GenericSubsystemRequest) (*gctrpc.GenericResponse, error) { err := s.SetSubsystem(r.Subsystem, true) if err != nil { @@ -254,7 +254,7 @@ func (s *RPCServer) EnableSubsystem(_ context.Context, r *gctrpc.GenericSubsyste Data: fmt.Sprintf("subsystem %s enabled", r.Subsystem)}, nil } -// DisableSubsystem disables a engine subsytem +// DisableSubsystem disables a engine subsystem func (s *RPCServer) DisableSubsystem(_ context.Context, r *gctrpc.GenericSubsystemRequest) (*gctrpc.GenericResponse, error) { err := s.SetSubsystem(r.Subsystem, false) if err != nil { diff --git a/exchanges/alphapoint/alphapoint_wrapper.go b/exchanges/alphapoint/alphapoint_wrapper.go index 2bcf2c3676c..81edde431f6 100644 --- a/exchanges/alphapoint/alphapoint_wrapper.go +++ b/exchanges/alphapoint/alphapoint_wrapper.go @@ -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") diff --git a/exchanges/asset/asset_test.go b/exchanges/asset/asset_test.go index 9a575fa1f21..13105dc1f99 100644 --- a/exchanges/asset/asset_test.go +++ b/exchanges/asset/asset_test.go @@ -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) } } diff --git a/exchanges/binance/binance.go b/exchanges/binance/binance.go index 25b0edfdbab..c25b45ba581 100644 --- a/exchanges/binance/binance.go +++ b/exchanges/binance/binance.go @@ -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 diff --git a/exchanges/binance/binance_test.go b/exchanges/binance/binance_test.go index db6449b7338..a0949063a12 100644 --- a/exchanges/binance/binance_test.go +++ b/exchanges/binance/binance_test.go @@ -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) } } } diff --git a/exchanges/binance/binance_types.go b/exchanges/binance/binance_types.go index 13d9e81d3ad..a686e9889fa 100644 --- a/exchanges/binance/binance_types.go +++ b/exchanges/binance/binance_types.go @@ -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 diff --git a/exchanges/binanceus/binanceus_test.go b/exchanges/binanceus/binanceus_test.go index 58e79169a9c..ccc0bd54154 100644 --- a/exchanges/binanceus/binanceus_test.go +++ b/exchanges/binanceus/binanceus_test.go @@ -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) } } } diff --git a/exchanges/binanceus/type_convert.go b/exchanges/binanceus/type_convert.go index 72d371e778c..4873f53526f 100644 --- a/exchanges/binanceus/type_convert.go +++ b/exchanges/binanceus/type_convert.go @@ -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 { diff --git a/exchanges/bitfinex/bitfinex.go b/exchanges/bitfinex/bitfinex.go index 1e7d69c8eb5..92043b65768 100644 --- a/exchanges/bitfinex/bitfinex.go +++ b/exchanges/bitfinex/bitfinex.go @@ -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) diff --git a/exchanges/bitfinex/bitfinex_websocket.go b/exchanges/bitfinex/bitfinex_websocket.go index f2e5357dace..62d022ccf6b 100644 --- a/exchanges/bitfinex/bitfinex_websocket.go +++ b/exchanges/bitfinex/bitfinex_websocket.go @@ -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 { diff --git a/exchanges/bitfinex/bitfinex_wrapper.go b/exchanges/bitfinex/bitfinex_wrapper.go index 11e342d3253..a9994916304 100644 --- a/exchanges/bitfinex/bitfinex_wrapper.go +++ b/exchanges/bitfinex/bitfinex_wrapper.go @@ -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" { diff --git a/exchanges/bitfinex/ratelimit.go b/exchanges/bitfinex/ratelimit.go index f63420432aa..ff30f9d868e 100644 --- a/exchanges/bitfinex/ratelimit.go +++ b/exchanges/bitfinex/ratelimit.go @@ -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 diff --git a/exchanges/bitflyer/bitflyer.go b/exchanges/bitflyer/bitflyer.go index 5a6aaefc08a..c5de817ce61 100644 --- a/exchanges/bitflyer/bitflyer.go +++ b/exchanges/bitflyer/bitflyer.go @@ -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{} diff --git a/exchanges/bithumb/bithumb.go b/exchanges/bithumb/bithumb.go index 7b3af521cdf..3759601be23 100644 --- a/exchanges/bithumb/bithumb.go +++ b/exchanges/bithumb/bithumb.go @@ -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, "_") diff --git a/exchanges/bithumb/bithumb_websocket_types.go b/exchanges/bithumb/bithumb_websocket_types.go index cb6dacc6a8c..bb8fb4268eb 100644 --- a/exchanges/bithumb/bithumb_websocket_types.go +++ b/exchanges/bithumb/bithumb_websocket_types.go @@ -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 diff --git a/exchanges/bitmex/bitmex.go b/exchanges/bitmex/bitmex.go index 8028d66c7ce..b167f68e2f8 100644 --- a/exchanges/bitmex/bitmex.go +++ b/exchanges/bitmex/bitmex.go @@ -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 diff --git a/exchanges/bitmex/bitmex_parameters.go b/exchanges/bitmex/bitmex_parameters.go index e158d95453a..a0afd6c9b03 100644 --- a/exchanges/bitmex/bitmex_parameters.go +++ b/exchanges/bitmex/bitmex_parameters.go @@ -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{}) } diff --git a/exchanges/bitstamp/bitstamp.go b/exchanges/bitstamp/bitstamp.go index 1093d245f45..4008863a2ea 100644 --- a/exchanges/bitstamp/bitstamp.go +++ b/exchanges/bitstamp/bitstamp.go @@ -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 diff --git a/exchanges/bittrex/bittrex_test.go b/exchanges/bittrex/bittrex_test.go index 91492801ad8..ae849113444 100644 --- a/exchanges/bittrex/bittrex_test.go +++ b/exchanges/bittrex/bittrex_test.go @@ -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) diff --git a/exchanges/bittrex/bittrex_types.go b/exchanges/bittrex/bittrex_types.go index 0756a4f9d7c..a1c18af164b 100644 --- a/exchanges/bittrex/bittrex_types.go +++ b/exchanges/bittrex/bittrex_types.go @@ -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 diff --git a/exchanges/btcmarkets/btcmarkets_test.go b/exchanges/btcmarkets/btcmarkets_test.go index a6126773cdf..d146a3edd95 100644 --- a/exchanges/btcmarkets/btcmarkets_test.go +++ b/exchanges/btcmarkets/btcmarkets_test.go @@ -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), diff --git a/exchanges/btcmarkets/ratelimit.go b/exchanges/btcmarkets/ratelimit.go index d22c88482a9..a54aa9665d8 100644 --- a/exchanges/btcmarkets/ratelimit.go +++ b/exchanges/btcmarkets/ratelimit.go @@ -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 diff --git a/exchanges/btse/btse.go b/exchanges/btse/btse.go index 8048084446e..6cdef8454b2 100644 --- a/exchanges/btse/btse.go +++ b/exchanges/btse/btse.go @@ -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 } diff --git a/exchanges/btse/btse_test.go b/exchanges/btse/btse_test.go index e2321a89bf1..ade78ad611e 100644 --- a/exchanges/btse/btse_test.go +++ b/exchanges/btse/btse_test.go @@ -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) } } } diff --git a/exchanges/btse/btse_wrapper.go b/exchanges/btse/btse_wrapper.go index f04f667416d..6d62f15dd76 100644 --- a/exchanges/btse/btse_wrapper.go +++ b/exchanges/btse/btse_wrapper.go @@ -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, diff --git a/exchanges/bybit/bybit_types.go b/exchanges/bybit/bybit_types.go index 1d0604b8cd7..35111af9496 100644 --- a/exchanges/bybit/bybit_types.go +++ b/exchanges/bybit/bybit_types.go @@ -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") diff --git a/exchanges/coinbasepro/coinbasepro_test.go b/exchanges/coinbasepro/coinbasepro_test.go index b93acfb05cd..c53ef1df0d9 100644 --- a/exchanges/coinbasepro/coinbasepro_test.go +++ b/exchanges/coinbasepro/coinbasepro_test.go @@ -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) } } } diff --git a/exchanges/coinut/coinut_test.go b/exchanges/coinut/coinut_test.go index c38409c0c44..dee64f1d5b4 100644 --- a/exchanges/coinut/coinut_test.go +++ b/exchanges/coinut/coinut_test.go @@ -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) } } } diff --git a/exchanges/coinut/coinut_types.go b/exchanges/coinut/coinut_types.go index 5ff4adb7d17..abd7400ead4 100644 --- a/exchanges/coinut/coinut_types.go +++ b/exchanges/coinut/coinut_types.go @@ -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"` diff --git a/exchanges/exchange.go b/exchanges/exchange.go index 5c626cce704..1b900e64d4d 100644 --- a/exchanges/exchange.go +++ b/exchanges/exchange.go @@ -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 } diff --git a/exchanges/exchange_test.go b/exchanges/exchange_test.go index 1111be3b2fc..3bac304f808 100644 --- a/exchanges/exchange_test.go +++ b/exchanges/exchange_test.go @@ -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 { diff --git a/exchanges/exmo/exmo_wrapper.go b/exchanges/exmo/exmo_wrapper.go index 84ef09c541f..dc6b9032947 100644 --- a/exchanges/exmo/exmo_wrapper.go +++ b/exchanges/exmo/exmo_wrapper.go @@ -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 } diff --git a/exchanges/gateio/gateio.go b/exchanges/gateio/gateio.go index 3b09761f841..e9538ff016a 100644 --- a/exchanges/gateio/gateio.go +++ b/exchanges/gateio/gateio.go @@ -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, diff --git a/exchanges/gemini/gemini.go b/exchanges/gemini/gemini.go index b7b6221e48a..cf606e0aa7a 100644 --- a/exchanges/gemini/gemini.go +++ b/exchanges/gemini/gemini.go @@ -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 { diff --git a/exchanges/gemini/gemini_test.go b/exchanges/gemini/gemini_test.go index da3d415f194..b6037dd1d20 100644 --- a/exchanges/gemini/gemini_test.go +++ b/exchanges/gemini/gemini_test.go @@ -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) } } } diff --git a/exchanges/gemini/gemini_types.go b/exchanges/gemini/gemini_types.go index db13b085067..d93880fc2a1 100644 --- a/exchanges/gemini/gemini_types.go +++ b/exchanges/gemini/gemini_types.go @@ -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"` diff --git a/exchanges/hitbtc/hitbtc_test.go b/exchanges/hitbtc/hitbtc_test.go index f03cb526f48..9929087afaf 100644 --- a/exchanges/hitbtc/hitbtc_test.go +++ b/exchanges/hitbtc/hitbtc_test.go @@ -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) } } diff --git a/exchanges/huobi/huobi_cfutures.go b/exchanges/huobi/huobi_cfutures.go index ae08a02370e..c261d87f62e 100644 --- a/exchanges/huobi/huobi_cfutures.go +++ b/exchanges/huobi/huobi_cfutures.go @@ -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 diff --git a/exchanges/huobi/huobi_futures.go b/exchanges/huobi/huobi_futures.go index 41ddb97982b..f106fd171b6 100644 --- a/exchanges/huobi/huobi_futures.go +++ b/exchanges/huobi/huobi_futures.go @@ -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 { diff --git a/exchanges/huobi/huobi_test.go b/exchanges/huobi/huobi_test.go index ca30ff97379..92a1089cf34 100644 --- a/exchanges/huobi/huobi_test.go +++ b/exchanges/huobi/huobi_test.go @@ -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) } } } diff --git a/exchanges/kline/kline_test.go b/exchanges/kline/kline_test.go index 83d15b57428..113140f74b0 100644 --- a/exchanges/kline/kline_test.go +++ b/exchanges/kline/kline_test.go @@ -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) diff --git a/exchanges/kline/technical_analysis.go b/exchanges/kline/technical_analysis.go index adb2e9f006f..91c2f374539 100644 --- a/exchanges/kline/technical_analysis.go +++ b/exchanges/kline/technical_analysis.go @@ -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", diff --git a/exchanges/kraken/futures_types.go b/exchanges/kraken/futures_types.go index 3751ea02d9e..859451b3017 100644 --- a/exchanges/kraken/futures_types.go +++ b/exchanges/kraken/futures_types.go @@ -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"` } diff --git a/exchanges/kraken/kraken.go b/exchanges/kraken/kraken.go index 08d789135f1..6999ce00a16 100644 --- a/exchanges/kraken/kraken.go +++ b/exchanges/kraken/kraken.go @@ -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"` diff --git a/exchanges/lbank/lbank_test.go b/exchanges/lbank/lbank_test.go index bd5ad8dc2a2..a91154a9c03 100644 --- a/exchanges/lbank/lbank_test.go +++ b/exchanges/lbank/lbank_test.go @@ -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 diff --git a/exchanges/localbitcoins/localbitcoins.go b/exchanges/localbitcoins/localbitcoins.go index 3f28b15d812..0744136e1f4 100644 --- a/exchanges/localbitcoins/localbitcoins.go +++ b/exchanges/localbitcoins/localbitcoins.go @@ -19,7 +19,7 @@ import ( const ( localbitcoinsAPIURL = "https://localbitcoins.com" - // Autheticated Calls + // Authenticated Calls localbitcoinsAPIAccountInfo = "api/account_info" localbitcoinsAPIMyself = "myself/" localbitcoinsAPIAds = "ads/" diff --git a/exchanges/localbitcoins/localbitcoins_types.go b/exchanges/localbitcoins/localbitcoins_types.go index 67e0d7d4f93..fd75e838ba5 100644 --- a/exchanges/localbitcoins/localbitcoins_types.go +++ b/exchanges/localbitcoins/localbitcoins_types.go @@ -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"` diff --git a/exchanges/localbitcoins/rate_limit.go b/exchanges/localbitcoins/rate_limit.go index edebb2960a4..45c36e1def4 100644 --- a/exchanges/localbitcoins/rate_limit.go +++ b/exchanges/localbitcoins/rate_limit.go @@ -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), } diff --git a/exchanges/nonce/nonce.go b/exchanges/nonce/nonce.go index 95fd1a4bdcb..5e4d62fac1c 100644 --- a/exchanges/nonce/nonce.go +++ b/exchanges/nonce/nonce.go @@ -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() diff --git a/exchanges/okcoin/okcoin_wrapper.go b/exchanges/okcoin/okcoin_wrapper.go index 34ee73f5fa2..18817d9263a 100644 --- a/exchanges/okcoin/okcoin_wrapper.go +++ b/exchanges/okcoin/okcoin_wrapper.go @@ -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 diff --git a/exchanges/okx/okx.go b/exchanges/okx/okx.go index f9362700f1a..1aa52718245 100644 --- a/exchanges/okx/okx.go +++ b/exchanges/okx/okx.go @@ -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)) diff --git a/exchanges/okx/okx_types.go b/exchanges/okx/okx_types.go index f2aed093ebd..2f14c0018ca 100644 --- a/exchanges/okx/okx_types.go +++ b/exchanges/okx/okx_types.go @@ -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"` diff --git a/exchanges/okx/okx_wrapper.go b/exchanges/okx/okx_wrapper.go index f3b0b56f5bf..8ce0881951e 100644 --- a/exchanges/okx/okx_wrapper.go +++ b/exchanges/okx/okx_wrapper.go @@ -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 diff --git a/exchanges/order/futures_types.go b/exchanges/order/futures_types.go index 6c91297c974..b6edbbf37c6 100644 --- a/exchanges/order/futures_types.go +++ b/exchanges/order/futures_types.go @@ -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 } diff --git a/exchanges/order/order_test.go b/exchanges/order/order_test.go index 6d01fcf733f..cb07e5bb0fa 100644 --- a/exchanges/order/order_test.go +++ b/exchanges/order/order_test.go @@ -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()) } } diff --git a/exchanges/orderbook/linked_list.go b/exchanges/orderbook/linked_list.go index 3d93dfe8d7b..36baf2c4409 100644 --- a/exchanges/orderbook/linked_list.go +++ b/exchanges/orderbook/linked_list.go @@ -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 diff --git a/exchanges/orderbook/orderbook.go b/exchanges/orderbook/orderbook.go index c1d1ea83267..6ca0496777c 100644 --- a/exchanges/orderbook/orderbook.go +++ b/exchanges/orderbook/orderbook.go @@ -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. diff --git a/exchanges/orderbook/orderbook_test.go b/exchanges/orderbook/orderbook_test.go index 46981280a6a..0ea9fffc790 100644 --- a/exchanges/orderbook/orderbook_test.go +++ b/exchanges/orderbook/orderbook_test.go @@ -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 { diff --git a/exchanges/poloniex/poloniex_test.go b/exchanges/poloniex/poloniex_test.go index 794fc65a12c..75b9a00697c 100644 --- a/exchanges/poloniex/poloniex_test.go +++ b/exchanges/poloniex/poloniex_test.go @@ -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) } } diff --git a/exchanges/stream/buffer/buffer.go b/exchanges/stream/buffer/buffer.go index 96a8cfe6d6f..473683a8bd2 100644 --- a/exchanges/stream/buffer/buffer.go +++ b/exchanges/stream/buffer/buffer.go @@ -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) diff --git a/exchanges/stream/websocket_test.go b/exchanges/stream/websocket_test.go index 7342d743b11..5cdab00cff0 100644 --- a/exchanges/stream/websocket_test.go +++ b/exchanges/stream/websocket_test.go @@ -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") } } diff --git a/exchanges/yobit/yobit.go b/exchanges/yobit/yobit.go index 0e891836e86..f3eca18a685 100644 --- a/exchanges/yobit/yobit.go +++ b/exchanges/yobit/yobit.go @@ -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) diff --git a/exchanges/zb/ratelimit.go b/exchanges/zb/ratelimit.go index 065e132e814..d0750ddcf41 100644 --- a/exchanges/zb/ratelimit.go +++ b/exchanges/zb/ratelimit.go @@ -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 ) diff --git a/exchanges/zb/zb.go b/exchanges/zb/zb.go index fc25d03378e..88701542094 100644 --- a/exchanges/zb/zb.go +++ b/exchanges/zb/zb.go @@ -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], diff --git a/exchanges/zb/zb_wrapper.go b/exchanges/zb/zb_wrapper.go index 012ac51444d..193ffb6458f 100644 --- a/exchanges/zb/zb_wrapper.go +++ b/exchanges/zb/zb_wrapper.go @@ -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) diff --git a/gctscript/modules/gct/errors_test.go b/gctscript/modules/gct/errors_test.go index 69d698b2d3c..8c72dcaf283 100644 --- a/gctscript/modules/gct/errors_test.go +++ b/gctscript/modules/gct/errors_test.go @@ -33,6 +33,6 @@ func TestConstructRuntimeError(t *testing.T) { t.Parallel() err := constructRuntimeError(0, "", "", nil) if !errors.Is(err, common.ErrTypeAssertFailure) { - t.Fatalf("receieved: '%v' but expected: '%v'", err, common.ErrTypeAssertFailure) + t.Fatalf("received: '%v' but expected: '%v'", err, common.ErrTypeAssertFailure) } } diff --git a/gctscript/modules/ta/indicators/indicators.go b/gctscript/modules/ta/indicators/indicators.go index 3b404c61f75..d9d95c7a76a 100644 --- a/gctscript/modules/ta/indicators/indicators.go +++ b/gctscript/modules/ta/indicators/indicators.go @@ -47,7 +47,7 @@ func ParseIndicatorSelector(in string) (int, error) { } } -// ParseMAType returns moving average from sring +// ParseMAType returns moving average from string func ParseMAType(in string) (indicators.MaType, error) { in = strings.ToLower(in) switch in { diff --git a/portfolio/portfolio.go b/portfolio/portfolio.go index f6b0c05e875..965ad33c5bf 100644 --- a/portfolio/portfolio.go +++ b/portfolio/portfolio.go @@ -107,7 +107,7 @@ func (b *Base) GetRippleBalance(address string) (float64, error) { return result.XRPBalance, nil } -// GetAddressBalance acceses the portfolio base and returns the balance by passed +// GetAddressBalance accesses the portfolio base and returns the balance by passed // in address, coin type and description func (b *Base) GetAddressBalance(address, description string, coinType currency.Code) (float64, bool) { for x := range b.Addresses {