From 3d5b0bd838a52d10a33ecae44616de432dacb193 Mon Sep 17 00:00:00 2001 From: ku <2201441955@qq.com> Date: Sun, 6 Feb 2022 10:47:19 +0800 Subject: [PATCH] Update --- ws/ws_response.go | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/ws/ws_response.go b/ws/ws_response.go index 0627dc4..663b8f4 100644 --- a/ws/ws_response.go +++ b/ws/ws_response.go @@ -1,6 +1,7 @@ package ws import ( + sjson "encoding/json" "strconv" "time" ) @@ -60,26 +61,26 @@ type Instrument struct { } type Order struct { - OrderID string `json:"order_id"` - OrderLinkID string `json:"order_link_id"` - Symbol string `json:"symbol"` - Side string `json:"side"` - OrderType string `json:"order_type"` - Price float64 `json:"price,string"` - Qty float64 `json:"qty"` - TimeInForce string `json:"time_in_force"` // GoodTillCancel/ImmediateOrCancel/FillOrKill/PostOnly - CreateType string `json:"create_type"` - CancelType string `json:"cancel_type"` - OrderStatus string `json:"order_status"` - LeavesQty float64 `json:"leaves_qty"` - CumExecQty float64 `json:"cum_exec_qty"` - CumExecValue float64 `json:"cum_exec_value,string"` - CumExecFee float64 `json:"cum_exec_fee,string"` - Timestamp time.Time `json:"timestamp"` - TakeProfit float64 `json:"take_profit,string"` - StopLoss float64 `json:"stop_loss,string"` - TrailingStop float64 `json:"trailing_stop,string"` - LastExecPrice float64 `json:"last_exec_price,string"` + OrderID string `json:"order_id"` + OrderLinkID string `json:"order_link_id"` + Symbol string `json:"symbol"` + Side string `json:"side"` + OrderType string `json:"order_type"` + Price sjson.Number `json:"price"` + Qty float64 `json:"qty"` + TimeInForce string `json:"time_in_force"` // GoodTillCancel/ImmediateOrCancel/FillOrKill/PostOnly + CreateType string `json:"create_type"` + CancelType string `json:"cancel_type"` + OrderStatus string `json:"order_status"` + LeavesQty float64 `json:"leaves_qty"` + CumExecQty float64 `json:"cum_exec_qty"` + CumExecValue sjson.Number `json:"cum_exec_value"` + CumExecFee sjson.Number `json:"cum_exec_fee"` + Timestamp time.Time `json:"timestamp"` + TakeProfit sjson.Number `json:"take_profit"` + StopLoss sjson.Number `json:"stop_loss"` + TrailingStop sjson.Number `json:"trailing_stop"` + LastExecPrice sjson.Number `json:"last_exec_price"` } type Execution struct {