mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 15:10:46 +00:00
General fixes for CancelAllOrders exchange wrapper function (#313)
* General fixes for CancelAllOrders * Fix error shadowing issue * Initialise order status map and rm reduntant initialisations
This commit is contained in:
committed by
Adrian Gallagher
parent
416fbbd5ae
commit
a80acb16de
@@ -240,7 +240,6 @@ func (e *EXMO) ModifyOrder(action *exchange.ModifyOrder) (string, error) {
|
||||
// CancelOrder cancels an order by its corresponding ID number
|
||||
func (e *EXMO) CancelOrder(order *exchange.OrderCancellation) error {
|
||||
orderIDInt, err := strconv.ParseInt(order.OrderID, 10, 64)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -253,6 +252,7 @@ func (e *EXMO) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.CancelAl
|
||||
cancelAllOrdersResponse := exchange.CancelAllOrdersResponse{
|
||||
OrderStatus: make(map[string]string),
|
||||
}
|
||||
|
||||
openOrders, err := e.GetOpenOrders()
|
||||
if err != nil {
|
||||
return cancelAllOrdersResponse, err
|
||||
@@ -292,7 +292,10 @@ func (e *EXMO) GetDepositAddress(cryptocurrency currency.Code, _ string) (string
|
||||
// WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (e *EXMO) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.WithdrawRequest) (string, error) {
|
||||
resp, err := e.WithdrawCryptocurrency(withdrawRequest.Currency.String(), withdrawRequest.Address, withdrawRequest.AddressTag, withdrawRequest.Amount)
|
||||
resp, err := e.WithdrawCryptocurrency(withdrawRequest.Currency.String(),
|
||||
withdrawRequest.Address,
|
||||
withdrawRequest.AddressTag,
|
||||
withdrawRequest.Amount)
|
||||
|
||||
return fmt.Sprintf("%v", resp), err
|
||||
}
|
||||
@@ -329,6 +332,7 @@ func (e *EXMO) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest) ([]e
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var orders []exchange.OrderDetail
|
||||
for _, order := range resp {
|
||||
symbol := currency.NewPairDelimiter(order.Pair, "_")
|
||||
|
||||
Reference in New Issue
Block a user