From ecf0a5bcb3bedda39f26f04feb1dc0936da42c36 Mon Sep 17 00:00:00 2001 From: Ryan O'Hara-Reid Date: Tue, 3 Oct 2023 16:07:03 +1100 Subject: [PATCH] spellcheck: fix and update (#1359) * spellcheck: fix and update * spellcheck: add exclude line for gateio_types --- .../fx_currencyconverterapi.tmpl | 2 +- .../currency_templates/fx_currencylayer.tmpl | 2 +- .../currency_templates/fx_exchangeratehost.tmpl | 2 +- .../currency_templates/fx_exchangeratesapi.tmpl | 2 +- .../currency_templates/fx_fixer.tmpl | 2 +- .../currency_templates/fx_openexchangerates.tmpl | 2 +- config/config.go | 2 +- contrib/spellcheck/exclude_lines.txt | 2 ++ .../forexprovider/currencyconverterapi/README.md | 2 +- currency/forexprovider/currencylayer/README.md | 2 +- .../forexprovider/exchangerate.host/README.md | 2 +- .../forexprovider/exchangeratesapi.io/README.md | 2 +- currency/forexprovider/fixer.io/README.md | 2 +- .../forexprovider/openexchangerates/README.md | 2 +- currency/storage_types.go | 2 +- exchanges/binance/binance_websocket.go | 2 +- exchanges/binanceus/binanceus_websocket.go | 2 +- exchanges/bithumb/bithumb_ws_orderbook.go | 2 +- exchanges/bitmex/bitmex.go | 2 +- exchanges/bitstamp/bitstamp_wrapper.go | 6 +++--- exchanges/coinut/coinut_websocket.go | 2 +- exchanges/gateio/gateio_types.go | 2 +- exchanges/gateio/gateio_websocket.go | 2 +- exchanges/gemini/gemini_types.go | 2 +- exchanges/huobi/huobi_types.go | 4 ++-- exchanges/kucoin/kucoin_types.go | 2 +- exchanges/kucoin/kucoin_websocket.go | 2 +- exchanges/okcoin/okcoin_errors_map.go | 16 ++++++++-------- exchanges/orderbook/linked_list.go | 2 +- exchanges/stream/websocket_connection.go | 2 +- exchanges/yobit/yobit_types.go | 2 +- 31 files changed, 42 insertions(+), 40 deletions(-) diff --git a/cmd/documentation/currency_templates/fx_currencyconverterapi.tmpl b/cmd/documentation/currency_templates/fx_currencyconverterapi.tmpl index 3bbf4c24..c9de6b61 100644 --- a/cmd/documentation/currency_templates/fx_currencyconverterapi.tmpl +++ b/cmd/documentation/currency_templates/fx_currencyconverterapi.tmpl @@ -2,7 +2,7 @@ {{template "header" .}} ## Current Features for {{.Name}} -+ Fetches up to date curency data from [Currency Converter API](https://free.currencyconverterapi.com/) ++ Fetches up to date currency data from [Currency Converter API](https://free.currencyconverterapi.com/) ### How to enable diff --git a/cmd/documentation/currency_templates/fx_currencylayer.tmpl b/cmd/documentation/currency_templates/fx_currencylayer.tmpl index e2797e84..0a26b4ad 100644 --- a/cmd/documentation/currency_templates/fx_currencylayer.tmpl +++ b/cmd/documentation/currency_templates/fx_currencylayer.tmpl @@ -2,7 +2,7 @@ {{template "header" .}} ## Current Features for {{.Name}} -+ Fetches up to date curency data from [Currency Layer](https://currencylayer.com/) ++ Fetches up to date currency data from [Currency Layer](https://currencylayer.com/) ### How to enable diff --git a/cmd/documentation/currency_templates/fx_exchangeratehost.tmpl b/cmd/documentation/currency_templates/fx_exchangeratehost.tmpl index 02beb65c..24a9c900 100644 --- a/cmd/documentation/currency_templates/fx_exchangeratehost.tmpl +++ b/cmd/documentation/currency_templates/fx_exchangeratehost.tmpl @@ -2,7 +2,7 @@ {{template "header" .}} ## Current Features for {{.Name}} -+ Fetches up to date curency data from [ExchangeRate.host API]("https://exchangerate.host") ++ Fetches up to date currency data from [ExchangeRate.host API]("https://exchangerate.host") ### How to enable diff --git a/cmd/documentation/currency_templates/fx_exchangeratesapi.tmpl b/cmd/documentation/currency_templates/fx_exchangeratesapi.tmpl index edf9b6df..13e2c865 100644 --- a/cmd/documentation/currency_templates/fx_exchangeratesapi.tmpl +++ b/cmd/documentation/currency_templates/fx_exchangeratesapi.tmpl @@ -2,7 +2,7 @@ {{template "header" .}} ## Current Features for {{.Name}} -+ Fetches up to date curency data from [Exchange rates API]("http://exchangeratesapi.io") ++ Fetches up to date currency data from [Exchange rates API]("http://exchangeratesapi.io") ### How to enable diff --git a/cmd/documentation/currency_templates/fx_fixer.tmpl b/cmd/documentation/currency_templates/fx_fixer.tmpl index db687992..ebcf53d1 100644 --- a/cmd/documentation/currency_templates/fx_fixer.tmpl +++ b/cmd/documentation/currency_templates/fx_fixer.tmpl @@ -2,7 +2,7 @@ {{template "header" .}} ## Current Features for {{.Name}} -+ Fetches up to date curency data from [Fixer.io](https://fixer.io/) ++ Fetches up to date currency data from [Fixer.io](https://fixer.io/) ### How to enable diff --git a/cmd/documentation/currency_templates/fx_openexchangerates.tmpl b/cmd/documentation/currency_templates/fx_openexchangerates.tmpl index 34d4f995..172a3aec 100644 --- a/cmd/documentation/currency_templates/fx_openexchangerates.tmpl +++ b/cmd/documentation/currency_templates/fx_openexchangerates.tmpl @@ -2,7 +2,7 @@ {{template "header" .}} ## Current Features for {{.Name}} -+ Fetches up to date curency data from [Open Exchange Rates](https://openexchangerates.org/) ++ Fetches up to date currency data from [Open Exchange Rates](https://openexchangerates.org/) ### How to enable diff --git a/config/config.go b/config/config.go index 28144bcd..4b7b5827 100644 --- a/config/config.go +++ b/config/config.go @@ -1551,7 +1551,7 @@ func migrateConfig(configFile, targetDir string) (string, error) { // ReadConfigFromFile reads the configuration from the given file // if target file is encrypted, prompts for encryption key // Also - if not in dryrun mode - it checks if the configuration needs to be encrypted -// and stores the file as encrypted, if necessary (prompting for enryption key) +// and stores the file as encrypted, if necessary (prompting for encryption key) func (c *Config) ReadConfigFromFile(configPath string, dryrun bool) error { defaultPath, _, err := GetFilePath(configPath) if err != nil { diff --git a/contrib/spellcheck/exclude_lines.txt b/contrib/spellcheck/exclude_lines.txt index a45e6de1..0903eeb2 100644 --- a/contrib/spellcheck/exclude_lines.txt +++ b/contrib/spellcheck/exclude_lines.txt @@ -20,3 +20,5 @@ 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"), currency.MIS: 0.002, + SHFT = NewCode("SHFT") + currency.SHFT: 84, diff --git a/currency/forexprovider/currencyconverterapi/README.md b/currency/forexprovider/currencyconverterapi/README.md index 7f2d4d82..b6b4a166 100644 --- a/currency/forexprovider/currencyconverterapi/README.md +++ b/currency/forexprovider/currencyconverterapi/README.md @@ -20,7 +20,7 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader ## Current Features for currencyconverterapi -+ Fetches up to date curency data from [Currency Converter API](https://free.currencyconverterapi.com/) ++ Fetches up to date currency data from [Currency Converter API](https://free.currencyconverterapi.com/) ### How to enable diff --git a/currency/forexprovider/currencylayer/README.md b/currency/forexprovider/currencylayer/README.md index dac480eb..7aa1b243 100644 --- a/currency/forexprovider/currencylayer/README.md +++ b/currency/forexprovider/currencylayer/README.md @@ -20,7 +20,7 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader ## Current Features for currencylayer -+ Fetches up to date curency data from [Currency Layer](https://currencylayer.com/) ++ Fetches up to date currency data from [Currency Layer](https://currencylayer.com/) ### How to enable diff --git a/currency/forexprovider/exchangerate.host/README.md b/currency/forexprovider/exchangerate.host/README.md index a19597d4..114f5909 100644 --- a/currency/forexprovider/exchangerate.host/README.md +++ b/currency/forexprovider/exchangerate.host/README.md @@ -20,7 +20,7 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader ## Current Features for exchangerate.host -+ Fetches up to date curency data from [ExchangeRate.host API]("https://exchangerate.host") ++ Fetches up to date currency data from [ExchangeRate.host API]("https://exchangerate.host") ### How to enable diff --git a/currency/forexprovider/exchangeratesapi.io/README.md b/currency/forexprovider/exchangeratesapi.io/README.md index 4c37dcea..653238b4 100644 --- a/currency/forexprovider/exchangeratesapi.io/README.md +++ b/currency/forexprovider/exchangeratesapi.io/README.md @@ -20,7 +20,7 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader ## Current Features for exchangeratesapi.io -+ Fetches up to date curency data from [Exchange rates API]("http://exchangeratesapi.io") ++ Fetches up to date currency data from [Exchange rates API]("http://exchangeratesapi.io") ### How to enable diff --git a/currency/forexprovider/fixer.io/README.md b/currency/forexprovider/fixer.io/README.md index 87651998..a9b451ff 100644 --- a/currency/forexprovider/fixer.io/README.md +++ b/currency/forexprovider/fixer.io/README.md @@ -20,7 +20,7 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader ## Current Features for fixer.io -+ Fetches up to date curency data from [Fixer.io](https://fixer.io/) ++ Fetches up to date currency data from [Fixer.io](https://fixer.io/) ### How to enable diff --git a/currency/forexprovider/openexchangerates/README.md b/currency/forexprovider/openexchangerates/README.md index 4417b2a4..1c91d1c8 100644 --- a/currency/forexprovider/openexchangerates/README.md +++ b/currency/forexprovider/openexchangerates/README.md @@ -20,7 +20,7 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader ## Current Features for openexchangerates -+ Fetches up to date curency data from [Open Exchange Rates](https://openexchangerates.org/) ++ Fetches up to date currency data from [Open Exchange Rates](https://openexchangerates.org/) ### How to enable diff --git a/currency/storage_types.go b/currency/storage_types.go index 3891031d..0dad6baf 100644 --- a/currency/storage_types.go +++ b/currency/storage_types.go @@ -31,7 +31,7 @@ type Storage struct { defaultBaseCurrency Code // DefaultFiatCurrencies has the default minimum of FIAT values defaultFiatCurrencies Currencies - // DefaultCryptoCurrencies has the default minimum of crytpocurrency values + // DefaultCryptoCurrencies has the default minimum of cryptocurrency values defaultCryptoCurrencies Currencies // FiatExchangeMarkets defines an interface to access FX data for fiat // currency rates diff --git a/exchanges/binance/binance_websocket.go b/exchanges/binance/binance_websocket.go index 85efe593..c544341f 100644 --- a/exchanges/binance/binance_websocket.go +++ b/exchanges/binance/binance_websocket.go @@ -910,7 +910,7 @@ func (o *orderbookManager) completeInitialSync(pair currency.Pair) error { asset.Spot) } if !state.initialSync { - return fmt.Errorf("initital sync already set to false for %s %s", + return fmt.Errorf("initial sync already set to false for %s %s", pair, asset.Spot) } diff --git a/exchanges/binanceus/binanceus_websocket.go b/exchanges/binanceus/binanceus_websocket.go index ae627c19..b7c95571 100644 --- a/exchanges/binanceus/binanceus_websocket.go +++ b/exchanges/binanceus/binanceus_websocket.go @@ -963,7 +963,7 @@ func (o *orderbookManager) completeInitialSync(pair currency.Pair) error { asset.Spot) } if !state.initialSync { - return fmt.Errorf("initital sync already set to false for %s %s", + return fmt.Errorf("initial sync already set to false for %s %s", pair, asset.Spot) } diff --git a/exchanges/bithumb/bithumb_ws_orderbook.go b/exchanges/bithumb/bithumb_ws_orderbook.go index d1d3fc98..a5ea0b75 100644 --- a/exchanges/bithumb/bithumb_ws_orderbook.go +++ b/exchanges/bithumb/bithumb_ws_orderbook.go @@ -302,7 +302,7 @@ func (o *orderbookManager) completeInitialSync(pair currency.Pair) error { asset.Spot) } if !state.initialSync { - return fmt.Errorf("initital sync already set to false for %s %s", + return fmt.Errorf("initial sync already set to false for %s %s", pair, asset.Spot) } diff --git a/exchanges/bitmex/bitmex.go b/exchanges/bitmex/bitmex.go index d60a1c12..8ebe9f5a 100644 --- a/exchanges/bitmex/bitmex.go +++ b/exchanges/bitmex/bitmex.go @@ -672,7 +672,7 @@ func (b *Bitmex) ConfirmWithdrawal(ctx context.Context, token string) (Transacti &info) } -// GetCryptoDepositAddress returns a deposit address for a cryptocurency +// GetCryptoDepositAddress returns a deposit address for a cryptocurrency func (b *Bitmex) GetCryptoDepositAddress(ctx context.Context, cryptoCurrency string) (string, error) { var address string if !strings.EqualFold(cryptoCurrency, currency.XBT.String()) { diff --git a/exchanges/bitstamp/bitstamp_wrapper.go b/exchanges/bitstamp/bitstamp_wrapper.go index 8b91369d..13863077 100644 --- a/exchanges/bitstamp/bitstamp_wrapper.go +++ b/exchanges/bitstamp/bitstamp_wrapper.go @@ -1002,9 +1002,9 @@ func (b *Bitstamp) GetHistoricCandlesExtended(ctx context.Context, pair currency } for i := range candles.Data.OHLCV { - timstamp := time.Unix(candles.Data.OHLCV[i].Timestamp, 0) - if timstamp.Before(req.RangeHolder.Ranges[x].Start.Time) || - timstamp.After(req.RangeHolder.Ranges[x].End.Time) { + timestamp := time.Unix(candles.Data.OHLCV[i].Timestamp, 0) + if timestamp.Before(req.RangeHolder.Ranges[x].Start.Time) || + timestamp.After(req.RangeHolder.Ranges[x].End.Time) { continue } timeSeries = append(timeSeries, kline.Candle{ diff --git a/exchanges/coinut/coinut_websocket.go b/exchanges/coinut/coinut_websocket.go index 2a373c9e..5704f065 100644 --- a/exchanges/coinut/coinut_websocket.go +++ b/exchanges/coinut/coinut_websocket.go @@ -37,7 +37,7 @@ var ( // wss://wsapi-na.coinut.com // wss://wsapi-eu.coinut.com -// WsConnect intiates a websocket connection +// WsConnect initiates a websocket connection func (c *COINUT) WsConnect() error { if !c.Websocket.IsEnabled() || !c.IsEnabled() { return errors.New(stream.WebsocketNotEnabled) diff --git a/exchanges/gateio/gateio_types.go b/exchanges/gateio/gateio_types.go index 76d7833d..bd7a6dfb 100644 --- a/exchanges/gateio/gateio_types.go +++ b/exchanges/gateio/gateio_types.go @@ -1215,7 +1215,7 @@ type MarginAccountItem struct { Quote AccountBalanceInformation `json:"quote"` } -// AccountBalanceInformation represents currency account balace information. +// AccountBalanceInformation represents currency account balance information. type AccountBalanceInformation struct { Available convert.StringToFloat64 `json:"available"` Borrowed convert.StringToFloat64 `json:"borrowed"` diff --git a/exchanges/gateio/gateio_websocket.go b/exchanges/gateio/gateio_websocket.go index bed341a6..282d2dcf 100644 --- a/exchanges/gateio/gateio_websocket.go +++ b/exchanges/gateio/gateio_websocket.go @@ -820,7 +820,7 @@ func (g *Gateio) generatePayload(event string, channelsToSubscribe []stream.Chan if channelsToSubscribe[i].Channel == "spot.book_ticker" { // To get all orderbook assets subscribed it needs to be batched and // only spot.book_ticker can be batched, if not it will take about - // half an hour for initital sync. + // half an hour for initial sync. if batch != nil { *batch = append(*batch, params...) } else { diff --git a/exchanges/gemini/gemini_types.go b/exchanges/gemini/gemini_types.go index 7cd397ca..7736e5dc 100644 --- a/exchanges/gemini/gemini_types.go +++ b/exchanges/gemini/gemini_types.go @@ -242,7 +242,7 @@ type WithdrawalAddress struct { Reason string `json:"reason"` } -// ErrorCapture is a generlized error response from the server +// ErrorCapture is a generalized error response from the server type ErrorCapture struct { Result string `json:"result"` Reason string `json:"reason"` diff --git a/exchanges/huobi/huobi_types.go b/exchanges/huobi/huobi_types.go index dd5b399e..aa3259c1 100644 --- a/exchanges/huobi/huobi_types.go +++ b/exchanges/huobi/huobi_types.go @@ -721,7 +721,7 @@ type MarginAccountBalance struct { // SpotNewOrderRequestParams holds the params required to place // an order type SpotNewOrderRequestParams struct { - AccountID int `json:"account-id,string"` // Account ID, obtained using the accounts method. Curency trades use the accountid of the ‘spot’ account; for loan asset transactions, please use the accountid of the ‘margin’ account. + AccountID int `json:"account-id,string"` // Account ID, obtained using the accounts method. Currency trades use the accountid of the ‘spot’ account; for loan asset transactions, please use the accountid of the ‘margin’ account. Amount float64 `json:"amount"` // The limit price indicates the quantity of the order, the market price indicates how much to buy when the order is paid, and the market price indicates how much the coin is sold when the order is sold. Price float64 `json:"price"` // Order price, market price does not use this parameter Source string `json:"source"` // Order source, api: API call, margin-api: loan asset transaction @@ -769,7 +769,7 @@ var ( // SpotNewOrderRequestTypeBuyLimit buy limit order SpotNewOrderRequestTypeBuyLimit = SpotNewOrderRequestParamsType("buy-limit") - // SpotNewOrderRequestTypeSellLimit sell lmit order + // SpotNewOrderRequestTypeSellLimit sell limit order SpotNewOrderRequestTypeSellLimit = SpotNewOrderRequestParamsType("sell-limit") ) diff --git a/exchanges/kucoin/kucoin_types.go b/exchanges/kucoin/kucoin_types.go index 11082992..130e3aa3 100644 --- a/exchanges/kucoin/kucoin_types.go +++ b/exchanges/kucoin/kucoin_types.go @@ -815,7 +815,7 @@ type WsSpotTicker struct { } // WsSpotTickerDetail represents the detail of a spot ticker data. -// This represents all websocket ticker information pushed as a result of susbcription to /market/snapshot:{symbol}, and /market/snapshot:{currency,market} +// This represents all websocket ticker information pushed as a result of subscription to /market/snapshot:{symbol}, and /market/snapshot:{currency,market} type WsSpotTickerDetail struct { AveragePrice float64 `json:"averagePrice"` BaseCurrency string `json:"baseCurrency"` diff --git a/exchanges/kucoin/kucoin_websocket.go b/exchanges/kucoin/kucoin_websocket.go index 67461522..a9a1b480 100644 --- a/exchanges/kucoin/kucoin_websocket.go +++ b/exchanges/kucoin/kucoin_websocket.go @@ -1747,7 +1747,7 @@ func (o *orderbookManager) completeInitialSync(pair currency.Pair, assetType ass assetType) } if !state.initialSync { - return fmt.Errorf("initital sync already set to false for %s %s", + return fmt.Errorf("initial sync already set to false for %s %s", pair, assetType) } diff --git a/exchanges/okcoin/okcoin_errors_map.go b/exchanges/okcoin/okcoin_errors_map.go index 378a5464..1808bd10 100644 --- a/exchanges/okcoin/okcoin_errors_map.go +++ b/exchanges/okcoin/okcoin_errors_map.go @@ -162,19 +162,19 @@ func (o *Okcoin) SetErrorDefaults() { "51349": errors.New(`stop profit price should be greater than the highest price in the range`), "51350": errors.New(`no recommended parameters`), "51351": errors.New(`single income must be greater than 0`), - "51400": errors.New(`cancelation failed as the order does not exist`), - "51401": errors.New(`cancelation failed as the order is already canceled`), - "51402": errors.New(`cancelation failed as the order is already completed`), - "51403": errors.New(`cancelation failed as the order type does not support cancelation`), + "51400": errors.New(`cancellation failed as the order does not exist`), + "51401": errors.New(`cancellation failed as the order is already canceled`), + "51402": errors.New(`cancellation failed as the order is already completed`), + "51403": errors.New(`cancellation failed as the order type does not support cancellation`), "51404": errors.New(`order cancellation unavailable during the second phase of call auction`), - "51405": errors.New(`cancelation failed as you do not have any pending orders`), + "51405": errors.New(`cancellation failed as you do not have any pending orders`), "51407": errors.New(`either order ID or client order ID is required`), "51408": errors.New(`pair id or name does not match the order info`), "51409": errors.New(`either pair id or pair name id is required`), - "51410": errors.New(`cancelation pending. duplicate order rejected`), - "51411": errors.New(`account does not have permission for mass cancelation`), + "51410": errors.New(`cancellation pending. duplicate order rejected`), + "51411": errors.New(`account does not have permission for mass cancellation`), "51412": errors.New(`the order has been triggered and cannot be canceled`), - "51413": errors.New(`cancelation failed as the order type is not supported by endpoint`), + "51413": errors.New(`cancellation failed as the order type is not supported by endpoint`), "51415": errors.New(`unable to place order. spot trading only supports using the last price as trigger price. please select "Last" and try again`), "51500": errors.New(`either order price or amount is required`), "51503": errors.New(`order modification failed as the order does not exist`), diff --git a/exchanges/orderbook/linked_list.go b/exchanges/orderbook/linked_list.go index e08c3608..d5e7a0ea 100644 --- a/exchanges/orderbook/linked_list.go +++ b/exchanges/orderbook/linked_list.go @@ -67,7 +67,7 @@ func (ll *linkedList) load(items Items, stack *stack, tn time.Time) { } // Push has references to dangling nodes that need to be removed and pushed - // back onto stack for re-use + // back onto stack for reuse var push *Node // Cleave unused reference chain from main chain if prev == nil { diff --git a/exchanges/stream/websocket_connection.go b/exchanges/stream/websocket_connection.go index 1a983654..b5b98ced 100644 --- a/exchanges/stream/websocket_connection.go +++ b/exchanges/stream/websocket_connection.go @@ -293,7 +293,7 @@ func (w *WebsocketConnection) GenerateMessageID(highPrec bool) int64 { max = 2e12 min = 1e12 } - // utlization of hard coded positive numbers and default crypto/rand + // utilization of hard coded positive numbers and default crypto/rand // io.reader will panic on error instead of returning randomNumber, err := rand.Int(rand.Reader, big.NewInt(max-min+1)) if err != nil { diff --git a/exchanges/yobit/yobit_types.go b/exchanges/yobit/yobit_types.go index a14367ff..8f5fc2da 100644 --- a/exchanges/yobit/yobit_types.go +++ b/exchanges/yobit/yobit_types.go @@ -123,7 +123,7 @@ type TradeHistory struct { Timestamp float64 `json:"timestamp"` } -// DepositAddress stores a curency deposit address +// DepositAddress stores a currency deposit address type DepositAddress struct { Success int `json:"success"` Return struct {