diff --git a/mock_responses b/mock_responses index 02d0831..4a069d1 160000 --- a/mock_responses +++ b/mock_responses @@ -1 +1 @@ -Subproject commit 02d0831c44d30a9f4ac647a3a2c89b3c0279f317 +Subproject commit 4a069d12778c226a6afaca205928dd391bde6ff5 diff --git a/orders.go b/orders.go index 4e6149a..508b7bf 100644 --- a/orders.go +++ b/orders.go @@ -24,6 +24,7 @@ type Order struct { ExchangeUpdateTimestamp models.Time `json:"exchange_update_timestamp"` ExchangeTimestamp models.Time `json:"exchange_timestamp"` Variety string `json:"variety"` + Modified bool `json:"modified"` Meta map[string]interface{} `json:"meta"` Exchange string `json:"exchange"` @@ -45,6 +46,8 @@ type Order struct { PendingQuantity float64 `json:"pending_quantity"` CancelledQuantity float64 `json:"cancelled_quantity"` + AuctionNumber string `json:"auction_number"` + Tag string `json:"tag"` Tags []string `json:"tags"` } @@ -74,7 +77,7 @@ type OrderParams struct { IcebergLegs int `url:"iceberg_legs,omitempty"` IcebergQty int `url:"iceberg_quantity,omitempty"` - AuctionNumber int `url:"auction_number,omitempty"` + AuctionNumber string `url:"auction_number,omitempty"` Tag string `json:"tag" url:"tag,omitempty"` } diff --git a/orders_test.go b/orders_test.go index 676f3e1..cd340b6 100644 --- a/orders_test.go +++ b/orders_test.go @@ -20,15 +20,21 @@ func (ts *TestSuite) TestGetOrders(t *testing.T) { }) t.Run("test tag parsing", func(t *testing.T) { require.Equal(t, "", orders[0].Tag) - require.Equal(t, "connect test order1", orders[1].Tag) - require.Equal(t, []string{"connect test order2", "XXXXX"}, orders[2].Tags) + require.Equal(t, "connect test order1", orders[4].Tag) + require.Equal(t, []string{"connect test order2", "XXXXX"}, orders[5].Tags) }) t.Run("test ice-berg and TTL orders", func(t *testing.T) { require.Equal(t, "iceberg", orders[3].Variety) + require.Equal(t, false, orders[3].Modified) require.Equal(t, "TTL", orders[3].Validity) require.Equal(t, 200.0, orders[3].Meta["iceberg"].(map[string]interface{})["leg_quantity"]) require.Equal(t, 1000.0, orders[3].Meta["iceberg"].(map[string]interface{})["total_quantity"]) }) + t.Run("test auction order", func(t *testing.T) { + require.Equal(t, "auction", orders[6].Variety) + require.Equal(t, "22", orders[6].AuctionNumber) + require.Equal(t, false, orders[6].Modified) + }) } func (ts *TestSuite) TestGetTrades(t *testing.T) { @@ -54,6 +60,9 @@ func (ts *TestSuite) TestGetOrderHistory(t *testing.T) { if order.OrderID == "" { t.Errorf("Error while fetching order id in order history. %v", err) } + if order.Modified { + t.Errorf("Error for not modified order. %v", err) + } } } @@ -155,7 +164,7 @@ func (ts *TestSuite) TestPlaceAuctionOrder(t *testing.T) { TransactionType: "test_auction", Quantity: 100, Price: 100, - AuctionNumber: 7359, + AuctionNumber: "7359", Tag: "test_auction", } orderResponse, err := ts.KiteConnect.PlaceOrder("auction", params)