mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 07:26:53 +00:00
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@@ -401,7 +402,7 @@ func (a *ANX) GetDepositAddressByCurrency(currency, name string, new bool) (stri
|
||||
|
||||
// SendHTTPRequest sends an unauthenticated HTTP request
|
||||
func (a *ANX) SendHTTPRequest(path string, result interface{}) error {
|
||||
return a.SendPayload("GET", path, nil, nil, result, false, a.Verbose)
|
||||
return a.SendPayload(http.MethodGet, path, nil, nil, result, false, a.Verbose)
|
||||
}
|
||||
|
||||
// SendAuthenticatedHTTPRequest sends a authenticated HTTP request
|
||||
@@ -439,7 +440,7 @@ func (a *ANX) SendAuthenticatedHTTPRequest(path string, params map[string]interf
|
||||
headers["Rest-Sign"] = common.Base64Encode(hmac)
|
||||
headers["Content-Type"] = "application/json"
|
||||
|
||||
return a.SendPayload("POST", a.APIUrl+path, headers, bytes.NewBuffer(PayloadJSON), result, true, a.Verbose)
|
||||
return a.SendPayload(http.MethodPost, a.APIUrl+path, headers, bytes.NewBuffer(PayloadJSON), result, true, a.Verbose)
|
||||
}
|
||||
|
||||
// GetFee returns an estimate of fee based on type of transaction
|
||||
|
||||
@@ -25,7 +25,7 @@ func TestSetDefaults(t *testing.T) {
|
||||
if a.Name != "ANX" {
|
||||
t.Error("Test Failed - ANX SetDefaults() incorrect values set")
|
||||
}
|
||||
if a.Enabled != false {
|
||||
if a.Enabled {
|
||||
t.Error("Test Failed - ANX SetDefaults() incorrect values set")
|
||||
}
|
||||
if a.TakerFee != 0.02 {
|
||||
@@ -34,10 +34,10 @@ func TestSetDefaults(t *testing.T) {
|
||||
if a.MakerFee != 0.01 {
|
||||
t.Error("Test Failed - ANX SetDefaults() incorrect values set")
|
||||
}
|
||||
if a.Verbose != false {
|
||||
if a.Verbose {
|
||||
t.Error("Test Failed - ANX SetDefaults() incorrect values set")
|
||||
}
|
||||
if a.Websocket.IsEnabled() != false {
|
||||
if a.Websocket.IsEnabled() {
|
||||
t.Error("Test Failed - ANX SetDefaults() incorrect values set")
|
||||
}
|
||||
if a.RESTPollingDelay != 10 {
|
||||
@@ -59,16 +59,16 @@ func TestSetup(t *testing.T) {
|
||||
a.APISecret = testAPISecret
|
||||
a.AuthenticatedAPISupport = true
|
||||
|
||||
if a.Enabled != true {
|
||||
if !a.Enabled {
|
||||
t.Error("Test Failed - ANX Setup() incorrect values set")
|
||||
}
|
||||
if a.RESTPollingDelay != 10 {
|
||||
t.Error("Test Failed - ANX Setup() incorrect values set")
|
||||
}
|
||||
if a.Verbose != false {
|
||||
if a.Verbose {
|
||||
t.Error("Test Failed - ANX Setup() incorrect values set")
|
||||
}
|
||||
if a.Websocket.IsEnabled() != false {
|
||||
if a.Websocket.IsEnabled() {
|
||||
t.Error("Test Failed - ANX Setup() incorrect values set")
|
||||
}
|
||||
if len(a.BaseCurrencies) <= 0 {
|
||||
|
||||
@@ -224,7 +224,7 @@ func (a *ANX) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]excha
|
||||
}
|
||||
|
||||
// SubmitOrder submits a new order
|
||||
func (a *ANX) SubmitOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (exchange.SubmitOrderResponse, error) {
|
||||
func (a *ANX) SubmitOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, _ string) (exchange.SubmitOrderResponse, error) {
|
||||
var submitOrderResponse exchange.SubmitOrderResponse
|
||||
|
||||
var isBuying bool
|
||||
@@ -274,7 +274,7 @@ func (a *ANX) CancelOrder(order exchange.OrderCancellation) error {
|
||||
}
|
||||
|
||||
// CancelAllOrders cancels all orders associated with a currency pair
|
||||
func (a *ANX) CancelAllOrders(orderCancellation exchange.OrderCancellation) (exchange.CancelAllOrdersResponse, error) {
|
||||
func (a *ANX) CancelAllOrders(_ exchange.OrderCancellation) (exchange.CancelAllOrdersResponse, error) {
|
||||
cancelAllOrdersResponse := exchange.CancelAllOrdersResponse{
|
||||
OrderStatus: make(map[string]string),
|
||||
}
|
||||
@@ -309,7 +309,7 @@ func (a *ANX) GetOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
}
|
||||
|
||||
// GetDepositAddress returns a deposit address for a specified currency
|
||||
func (a *ANX) GetDepositAddress(cryptocurrency pair.CurrencyItem, accountID string) (string, error) {
|
||||
func (a *ANX) GetDepositAddress(cryptocurrency pair.CurrencyItem, _ string) (string, error) {
|
||||
return a.GetDepositAddressByCurrency(cryptocurrency.String(), "", false)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user