mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-30 15:10:40 +00:00
Migrate from gometalinter.v2 to golangci-lint (#249)
* Migrate from gometalinter.v2 to golangci-lint
This commit is contained in:
@@ -119,9 +119,9 @@ func (e *EXMO) GetTrades(symbol string) (map[string][]Trades, error) {
|
||||
v := url.Values{}
|
||||
v.Set("pair", symbol)
|
||||
result := make(map[string][]Trades)
|
||||
url := fmt.Sprintf("%s/v%s/%s", e.APIUrl, exmoAPIVersion, exmoTrades)
|
||||
urlPath := fmt.Sprintf("%s/v%s/%s", e.APIUrl, exmoAPIVersion, exmoTrades)
|
||||
|
||||
return result, e.SendHTTPRequest(common.EncodeURLValues(url, v), &result)
|
||||
return result, e.SendHTTPRequest(common.EncodeURLValues(urlPath, v), &result)
|
||||
}
|
||||
|
||||
// GetOrderbook returns the orderbook for a symbol or symbols
|
||||
@@ -129,9 +129,9 @@ func (e *EXMO) GetOrderbook(symbol string) (map[string]Orderbook, error) {
|
||||
v := url.Values{}
|
||||
v.Set("pair", symbol)
|
||||
result := make(map[string]Orderbook)
|
||||
url := fmt.Sprintf("%s/v%s/%s", e.APIUrl, exmoAPIVersion, exmoOrderbook)
|
||||
urlPath := fmt.Sprintf("%s/v%s/%s", e.APIUrl, exmoAPIVersion, exmoOrderbook)
|
||||
|
||||
return result, e.SendHTTPRequest(common.EncodeURLValues(url, v), &result)
|
||||
return result, e.SendHTTPRequest(common.EncodeURLValues(urlPath, v), &result)
|
||||
}
|
||||
|
||||
// GetTicker returns the ticker for a symbol or symbols
|
||||
@@ -139,25 +139,24 @@ func (e *EXMO) GetTicker(symbol string) (map[string]Ticker, error) {
|
||||
v := url.Values{}
|
||||
v.Set("pair", symbol)
|
||||
result := make(map[string]Ticker)
|
||||
url := fmt.Sprintf("%s/v%s/%s", e.APIUrl, exmoAPIVersion, exmoTicker)
|
||||
urlPath := fmt.Sprintf("%s/v%s/%s", e.APIUrl, exmoAPIVersion, exmoTicker)
|
||||
|
||||
return result, e.SendHTTPRequest(common.EncodeURLValues(url, v), &result)
|
||||
return result, e.SendHTTPRequest(common.EncodeURLValues(urlPath, v), &result)
|
||||
}
|
||||
|
||||
// GetPairSettings returns the pair settings for a symbol or symbols
|
||||
func (e *EXMO) GetPairSettings() (map[string]PairSettings, error) {
|
||||
result := make(map[string]PairSettings)
|
||||
url := fmt.Sprintf("%s/v%s/%s", e.APIUrl, exmoAPIVersion, exmoPairSettings)
|
||||
urlPath := fmt.Sprintf("%s/v%s/%s", e.APIUrl, exmoAPIVersion, exmoPairSettings)
|
||||
|
||||
return result, e.SendHTTPRequest(url, &result)
|
||||
return result, e.SendHTTPRequest(urlPath, &result)
|
||||
}
|
||||
|
||||
// GetCurrency returns a list of currencies
|
||||
func (e *EXMO) GetCurrency() ([]string, error) {
|
||||
result := []string{}
|
||||
url := fmt.Sprintf("%s/v%s/%s", e.APIUrl, exmoAPIVersion, exmoCurrency)
|
||||
|
||||
return result, e.SendHTTPRequest(url, &result)
|
||||
urlPath := fmt.Sprintf("%s/v%s/%s", e.APIUrl, exmoAPIVersion, exmoCurrency)
|
||||
return result, e.SendHTTPRequest(urlPath, &result)
|
||||
}
|
||||
|
||||
// GetUserInfo returns the user info
|
||||
@@ -445,11 +444,12 @@ func getInternationalBankWithdrawalFee(currency string, amount float64, bankTran
|
||||
|
||||
switch bankTransactionType {
|
||||
case exchange.WireTransfer:
|
||||
if currency == symbol.RUB {
|
||||
switch currency {
|
||||
case symbol.RUB:
|
||||
fee = 3200
|
||||
} else if currency == symbol.PLN {
|
||||
case symbol.PLN:
|
||||
fee = 125
|
||||
} else if currency == symbol.TRY {
|
||||
case symbol.TRY:
|
||||
fee = 0
|
||||
}
|
||||
case exchange.PerfectMoney:
|
||||
@@ -513,11 +513,12 @@ func getInternationalBankDepositFee(currency string, amount float64, bankTransac
|
||||
var fee float64
|
||||
switch bankTransactionType {
|
||||
case exchange.WireTransfer:
|
||||
if currency == symbol.RUB {
|
||||
switch currency {
|
||||
case symbol.RUB:
|
||||
fee = 1600
|
||||
} else if currency == symbol.PLN {
|
||||
case symbol.PLN:
|
||||
fee = 30
|
||||
} else if currency == symbol.TRY {
|
||||
case symbol.TRY:
|
||||
fee = 0
|
||||
}
|
||||
case exchange.Neteller:
|
||||
|
||||
@@ -188,16 +188,17 @@ func (e *EXMO) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exch
|
||||
func (e *EXMO) SubmitOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, _ string) (exchange.SubmitOrderResponse, error) {
|
||||
var submitOrderResponse exchange.SubmitOrderResponse
|
||||
var oT string
|
||||
if orderType == exchange.LimitOrderType {
|
||||
return submitOrderResponse, errors.New("Unsupported order type")
|
||||
} else if orderType == exchange.MarketOrderType {
|
||||
if side == exchange.BuyOrderSide {
|
||||
oT = "market_buy"
|
||||
} else {
|
||||
|
||||
switch orderType {
|
||||
case exchange.LimitOrderType:
|
||||
return submitOrderResponse, errors.New("unsupported order type")
|
||||
case exchange.MarketOrderType:
|
||||
oT = "market_buy"
|
||||
if side == exchange.SellOrderSide {
|
||||
oT = "market_sell"
|
||||
}
|
||||
} else {
|
||||
return submitOrderResponse, errors.New("Unsupported order type")
|
||||
default:
|
||||
return submitOrderResponse, errors.New("unsupported order type")
|
||||
}
|
||||
|
||||
response, err := e.CreateOrder(p.Pair().String(), oT, price, amount)
|
||||
@@ -332,8 +333,8 @@ func (e *EXMO) GetActiveOrders(getOrdersRequest exchange.GetOrdersRequest) ([]ex
|
||||
// GetOrderHistory retrieves account order information
|
||||
// Can Limit response to specific order status
|
||||
func (e *EXMO) GetOrderHistory(getOrdersRequest exchange.GetOrdersRequest) ([]exchange.OrderDetail, error) {
|
||||
if len(getOrdersRequest.Currencies) <= 0 {
|
||||
return nil, errors.New("Currency must be supplied")
|
||||
if len(getOrdersRequest.Currencies) == 0 {
|
||||
return nil, errors.New("currency must be supplied")
|
||||
}
|
||||
|
||||
var allTrades []UserTrades
|
||||
|
||||
Reference in New Issue
Block a user