mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-29 15:10:37 +00:00
GCTCLI: Destination var/arg check usage fixes (#421)
* GCTCLI param and linter fixes * Linter fixes * Add more basic validation and address codelingo nits * Add arg number support to cancelOrder and more validity checks
This commit is contained in:
@@ -72,7 +72,7 @@ type Binance struct {
|
||||
validIntervals []TimeInterval
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (b *Binance) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ type Bitfinex struct {
|
||||
WebsocketSubdChannels map[int]WebsocketChanInfo
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (b *Bitfinex) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ type Bitflyer struct {
|
||||
exchange.Base
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (b *Bitflyer) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ type Bithumb struct {
|
||||
exchange.Base
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (b *Bithumb) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -910,7 +910,7 @@ func calculateTradingFee(purchasePrice, amount float64, isMaker bool) float64 {
|
||||
return fee * purchasePrice * amount
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (b *Bitmex) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ type Bitstamp struct {
|
||||
WebsocketConn *wshandler.WebsocketConnection
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (b *Bitstamp) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ type Bittrex struct {
|
||||
exchange.Base
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (b *Bittrex) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ type BTCMarkets struct {
|
||||
WebsocketConn *wshandler.WebsocketConnection
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (b *BTCMarkets) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ func parseOrderTime(timeStr string) (time.Time, error) {
|
||||
return time.Parse(btseTimeLayout, timeStr)
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (b *BTSE) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -1074,7 +1074,7 @@ func (c *Coinbene) SendAuthHTTPRequest(method, path, epPath string, isSwap bool,
|
||||
return json.Unmarshal(resp, result)
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (c *Coinbene) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ type COINUT struct {
|
||||
instrumentMap instrumentMap
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (c *COINUT) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ type EXMO struct {
|
||||
exchange.Base
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (e *EXMO) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -48,8 +48,7 @@ type Gateio struct {
|
||||
exchange.Base
|
||||
}
|
||||
|
||||
// GetHistoriCandles
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (g *Gateio) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ func calculateTradingFee(notionVolume *NotionalVolume, purchasePrice, amount flo
|
||||
return volumeFee * amount * purchasePrice
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (g *Gemini) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ type HitBTC struct {
|
||||
WebsocketConn *wshandler.WebsocketConnection
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (h *HitBTC) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ type HUOBI struct {
|
||||
AuthenticatedWebsocketConn *wshandler.WebsocketConnection
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (h *HUOBI) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ type ItBit struct {
|
||||
exchange.Base
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (i *ItBit) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ type Kraken struct {
|
||||
wsRequestMtx sync.Mutex
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (k *Kraken) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ type LakeBTC struct {
|
||||
WebsocketConn
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (l *LakeBTC) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -581,7 +581,7 @@ func (l *Lbank) SendAuthHTTPRequest(method, endpoint string, vals url.Values, re
|
||||
l.HTTPRecording)
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (l *Lbank) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ type LocalBitcoins struct {
|
||||
exchange.Base
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (l *LocalBitcoins) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ type OKCoin struct {
|
||||
okgroup.OKGroup
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (o *OKCoin) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ type OKEX struct {
|
||||
okgroup.OKGroup
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (o *OKEX) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ type Poloniex struct {
|
||||
WebsocketConn *wshandler.WebsocketConnection
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (p *Poloniex) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -11,15 +11,17 @@ const (
|
||||
ErrStrAmountMustBeGreaterThanZero = "amount must be greater than 0"
|
||||
// ErrStrAddressisInvalid message to return when address is invalid for crypto request
|
||||
ErrStrAddressisInvalid = "address is not valid"
|
||||
// ErrStrAddressNotSet message to returh when address is empty
|
||||
// ErrStrAddressNotSet message to return when address is empty
|
||||
ErrStrAddressNotSet = "address cannot be empty"
|
||||
// ErrStrNoCurrencySet message to return when no currency is set
|
||||
ErrStrNoCurrencySet = "currency not set"
|
||||
)
|
||||
|
||||
var (
|
||||
// ErrRequestCannotBeNil message to return when a request is nil
|
||||
ErrRequestCannotBeNil = errors.New("request cannot be nil")
|
||||
ErrInvalidRequest = errors.New("invalid request type")
|
||||
// ErrInvalidRequest message to return when a request is invalid
|
||||
ErrInvalidRequest = errors.New("invalid request type")
|
||||
)
|
||||
|
||||
// GenericInfo stores genric withdraw request info
|
||||
|
||||
@@ -43,7 +43,7 @@ type Yobit struct {
|
||||
exchange.Base
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (y *Yobit) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ type ZB struct {
|
||||
exchange.Base
|
||||
}
|
||||
|
||||
// GetHistoriCandles returns _rangesize_ number of candles for the given _granularity_ and _pair_ starting from the latest available
|
||||
// GetHistoricCandles returns rangesize number of candles for the given granularity and pair starting from the latest available
|
||||
func (z *ZB) GetHistoricCandles(pair currency.Pair, rangesize, granularity int64) ([]exchange.Candle, error) {
|
||||
return nil, common.ErrNotYetImplemented
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user