mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
BTCMarkets: Fix order JSON unmarshal response (#314)
This commit is contained in:
@@ -78,7 +78,7 @@ type OrderToGo struct {
|
||||
|
||||
// Order holds order information
|
||||
type Order struct {
|
||||
ID string `json:"id"`
|
||||
ID int64 `json:"id"`
|
||||
Currency string `json:"currency"`
|
||||
Instrument string `json:"instrument"`
|
||||
OrderSide string `json:"orderSide"`
|
||||
|
||||
@@ -229,12 +229,7 @@ func (b *BTCMarkets) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.Ca
|
||||
|
||||
var orderList []int64
|
||||
for i := range openOrders {
|
||||
orderIDInt, err := strconv.ParseInt(openOrders[i].ID, 10, 64)
|
||||
if err != nil {
|
||||
cancelAllOrdersResponse.OrderStatus[openOrders[i].ID] = err.Error()
|
||||
continue
|
||||
}
|
||||
orderList = append(orderList, orderIDInt)
|
||||
orderList = append(orderList, openOrders[i].ID)
|
||||
}
|
||||
|
||||
if len(orderList) > 0 {
|
||||
@@ -287,7 +282,7 @@ func (b *BTCMarkets) GetOrderInfo(orderID string) (exchange.OrderDetail, error)
|
||||
OrderDetail.Amount = orders[i].Volume
|
||||
OrderDetail.OrderDate = orderDate
|
||||
OrderDetail.Exchange = b.GetName()
|
||||
OrderDetail.ID = orders[i].ID
|
||||
OrderDetail.ID = strconv.FormatInt(orders[i].ID, 10)
|
||||
OrderDetail.RemainingAmount = orders[i].OpenVolume
|
||||
OrderDetail.OrderSide = side
|
||||
OrderDetail.OrderType = orderType
|
||||
@@ -359,7 +354,7 @@ func (b *BTCMarkets) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest
|
||||
orderType := exchange.OrderType(strings.ToUpper(resp[i].OrderType))
|
||||
|
||||
openOrder := exchange.OrderDetail{
|
||||
ID: resp[i].ID,
|
||||
ID: strconv.FormatInt(resp[i].ID, 10),
|
||||
Amount: resp[i].Volume,
|
||||
Exchange: b.Name,
|
||||
RemainingAmount: resp[i].OpenVolume,
|
||||
@@ -429,7 +424,7 @@ func (b *BTCMarkets) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest
|
||||
orderType := exchange.OrderType(strings.ToUpper(respOrders[i].OrderType))
|
||||
|
||||
openOrder := exchange.OrderDetail{
|
||||
ID: respOrders[i].ID,
|
||||
ID: strconv.FormatInt(respOrders[i].ID, 10),
|
||||
Amount: respOrders[i].Volume,
|
||||
Exchange: b.Name,
|
||||
RemainingAmount: respOrders[i].OpenVolume,
|
||||
|
||||
Reference in New Issue
Block a user