Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add OrigQuoteOrderQuantity field for order responses #660

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions v2/order_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ type CreateOrderResponse struct {
TransactTime int64 `json:"transactTime"`
Price string `json:"price"`
OrigQuantity string `json:"origQty"`
OrigQuoteOrderQuantity string `json:"origQuoteOrderQty"`
ExecutedQuantity string `json:"executedQty"`
CummulativeQuoteQuantity string `json:"cummulativeQuoteQty"`
IsIsolated bool `json:"isIsolated"` // for isolated margin
Expand Down Expand Up @@ -807,6 +808,7 @@ type CancelOrderResponse struct {
TransactTime int64 `json:"transactTime"`
Price string `json:"price"`
OrigQuantity string `json:"origQty"`
OrigQuoteOrderQuantity string `json:"origQuoteOrderQty"`
ExecutedQuantity string `json:"executedQty"`
CummulativeQuoteQuantity string `json:"cummulativeQuoteQty"`
Status OrderStatusType `json:"status"`
Expand Down
8 changes: 8 additions & 0 deletions v2/order_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func (s *orderServiceTestSuite) TestCreateOrder() {
"transactTime": 1499827319559,
"price": "0.0001",
"origQty": "12.00",
"origQuoteOrderQty": "10.00",
"executedQty": "10.00",
"cummulativeQuoteQty": "10.00",
"status": "FILLED",
Expand Down Expand Up @@ -69,6 +70,7 @@ func (s *orderServiceTestSuite) TestCreateOrder() {
TransactTime: 1499827319559,
Price: "0.0001",
OrigQuantity: "12.00",
OrigQuoteOrderQuantity: "10.00",
ExecutedQuantity: "10.00",
CummulativeQuoteQuantity: "10.00",
Status: OrderStatusTypeFilled,
Expand All @@ -92,6 +94,7 @@ func (s *orderServiceTestSuite) TestCreateOrderFull() {
"transactTime": 1499827319559,
"price": "0.0001",
"origQty": "12.00",
"origQuoteOrderQty": "10.00",
"executedQty": "10.00",
"cummulativeQuoteQty": "10.00",
"status": "FILLED",
Expand Down Expand Up @@ -145,6 +148,7 @@ func (s *orderServiceTestSuite) TestCreateOrderFull() {
TransactTime: 1499827319559,
Price: "0.0001",
OrigQuantity: "12.00",
OrigQuoteOrderQuantity: "10.00",
ExecutedQuantity: "10.00",
CummulativeQuoteQuantity: "10.00",
Status: OrderStatusTypeFilled,
Expand Down Expand Up @@ -177,6 +181,7 @@ func (s *baseOrderTestSuite) assertCreateOrderResponseEqual(e, a *CreateOrderRes
r.Equal(e.TransactTime, a.TransactTime, "TransactTime")
r.Equal(e.Price, a.Price, "Price")
r.Equal(e.OrigQuantity, a.OrigQuantity, "OrigQuantity")
r.Equal(e.OrigQuoteOrderQuantity, a.OrigQuoteOrderQuantity, "OrigQuoteOrderQuantity")
r.Equal(e.ExecutedQuantity, a.ExecutedQuantity, "ExecutedQuantity")
r.Equal(e.CummulativeQuoteQuantity, a.CummulativeQuoteQuantity, "CummulativeQuoteQuantity")
r.Equal(e.Status, a.Status, "Status")
Expand Down Expand Up @@ -793,6 +798,7 @@ func (s *orderServiceTestSuite) TestCancelOrder() {
"transactTime": 1507725176595,
"price": "1.00000000",
"origQty": "10.00000000",
"origQuoteOrderQty": "11.00000000",
"executedQty": "8.00000000",
"cummulativeQuoteQty": "8.00000000",
"status": "CANCELED",
Expand Down Expand Up @@ -830,6 +836,7 @@ func (s *orderServiceTestSuite) TestCancelOrder() {
TransactTime: 1507725176595,
Price: "1.00000000",
OrigQuantity: "10.00000000",
OrigQuoteOrderQuantity: "11.00000000",
ExecutedQuantity: "8.00000000",
CummulativeQuoteQuantity: "8.00000000",
Status: OrderStatusTypeCanceled,
Expand Down Expand Up @@ -1015,6 +1022,7 @@ func (s *baseOrderTestSuite) assertCancelOrderResponseEqual(e, a *CancelOrderRes
r.Equal(e.TransactTime, a.TransactTime, "TransactTime")
r.Equal(e.Price, a.Price, "Price")
r.Equal(e.OrigQuantity, a.OrigQuantity, "OrigQuantity")
r.Equal(e.OrigQuoteOrderQuantity, a.OrigQuoteOrderQuantity, "OrigQuoteOrderQuantity")
r.Equal(e.ExecutedQuantity, a.ExecutedQuantity, "ExecutedQuantity")
r.Equal(e.CummulativeQuoteQuantity, a.CummulativeQuoteQuantity, "CummulativeQuoteQuantity")
r.Equal(e.Status, a.Status, "Status")
Expand Down