Skip to content

Commit 3d5b0bd

Browse files
committed
Update
1 parent 813e4bc commit 3d5b0bd

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

ws/ws_response.go

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package ws
22

33
import (
4+
sjson "encoding/json"
45
"strconv"
56
"time"
67
)
@@ -60,26 +61,26 @@ type Instrument struct {
6061
}
6162

6263
type Order struct {
63-
OrderID string `json:"order_id"`
64-
OrderLinkID string `json:"order_link_id"`
65-
Symbol string `json:"symbol"`
66-
Side string `json:"side"`
67-
OrderType string `json:"order_type"`
68-
Price float64 `json:"price,string"`
69-
Qty float64 `json:"qty"`
70-
TimeInForce string `json:"time_in_force"` // GoodTillCancel/ImmediateOrCancel/FillOrKill/PostOnly
71-
CreateType string `json:"create_type"`
72-
CancelType string `json:"cancel_type"`
73-
OrderStatus string `json:"order_status"`
74-
LeavesQty float64 `json:"leaves_qty"`
75-
CumExecQty float64 `json:"cum_exec_qty"`
76-
CumExecValue float64 `json:"cum_exec_value,string"`
77-
CumExecFee float64 `json:"cum_exec_fee,string"`
78-
Timestamp time.Time `json:"timestamp"`
79-
TakeProfit float64 `json:"take_profit,string"`
80-
StopLoss float64 `json:"stop_loss,string"`
81-
TrailingStop float64 `json:"trailing_stop,string"`
82-
LastExecPrice float64 `json:"last_exec_price,string"`
64+
OrderID string `json:"order_id"`
65+
OrderLinkID string `json:"order_link_id"`
66+
Symbol string `json:"symbol"`
67+
Side string `json:"side"`
68+
OrderType string `json:"order_type"`
69+
Price sjson.Number `json:"price"`
70+
Qty float64 `json:"qty"`
71+
TimeInForce string `json:"time_in_force"` // GoodTillCancel/ImmediateOrCancel/FillOrKill/PostOnly
72+
CreateType string `json:"create_type"`
73+
CancelType string `json:"cancel_type"`
74+
OrderStatus string `json:"order_status"`
75+
LeavesQty float64 `json:"leaves_qty"`
76+
CumExecQty float64 `json:"cum_exec_qty"`
77+
CumExecValue sjson.Number `json:"cum_exec_value"`
78+
CumExecFee sjson.Number `json:"cum_exec_fee"`
79+
Timestamp time.Time `json:"timestamp"`
80+
TakeProfit sjson.Number `json:"take_profit"`
81+
StopLoss sjson.Number `json:"stop_loss"`
82+
TrailingStop sjson.Number `json:"trailing_stop"`
83+
LastExecPrice sjson.Number `json:"last_exec_price"`
8384
}
8485

8586
type Execution struct {

0 commit comments

Comments
 (0)