|
1 |
| -# Kite v4 |
| 1 | +# Kite v5 - TypeScript |
2 | 2 |
|
3 |
| -### Breaking changes |
4 |
| -- Upgrade deps and set minimum nodejs version to 8.0.0+ |
5 |
| -- Return promise instead of throwing error on generateSession and renewAccessToken |
6 |
| -- Handle gtt payload validation and throw proper error |
7 |
| -- Change ticker response attributes naming as per [kite connect doc](https://kite.trade/docs/connect/v3/websocket/#quote-packet-structure) |
| 3 | +## [5.0.0] - 2024-06-13 |
8 | 4 |
|
9 |
| -### New features |
10 |
| -- Order margin call : [orderMargins](https://github.com/zerodha/kiteconnectjs/blob/master/lib/connect.js#L704) |
11 |
| -- Basket order margin call : [orderBasketMargins](https://github.com/zerodha/kiteconnectjs/blob/master/lib/connect.js#L727) |
12 |
| -- Add OI param to `getHistoricalData` |
13 |
| -- Add global constant for postion types `POSITION_TYPE_DAY`, `POSITION_TYPE_OVERNIGHT` and `EXCHANGE_BCD` |
| 5 | +### Breaking Changes |
14 | 6 |
|
15 |
| -### Fixes |
16 |
| -- Remove `order_id` param from complete tradebook fetch `getTrades` |
17 |
| -- Fix `cancelMF` order_id param struct |
18 |
| -- Handle price conversion for BCD segment in ticker |
19 |
| -- Remove un-used `headers` param for `parseHistorical` |
20 |
| -- Update comment block for `getQuote, getOHLC, getLTP, placeOrder and placeMFOrder` |
| 7 | +- **TypeScript Conversion**: The entire codebase has been converted to TypeScript. This means type definitions are now included, and any custom integrations may need to be updated to match the new type definitions. |
| 8 | +- **Node.js Version Requirement**: The minimum required Node.js version is now 18.0.0. Please upgrade your Node.js installation if you are using an older version. |
| 9 | +- **API Changes**: Updated various function signatures and added explicit types for better TypeScript support. |
21 | 10 |
|
| 11 | +### New Features |
22 | 12 |
|
23 |
| -# Kite v3 |
| 13 | +- **TypeScript Support**: The library is now fully written in TypeScript, providing better type safety. |
| 14 | +- **Documentation**: Added and updated documentation to reflect the new TypeScript codebase as per the [TSDOC standard](https://tsdoc.org/). |
| 15 | +- **Examples**: Added new examples for both REST API and WebSocket client in TypeScript. |
24 | 16 |
|
25 |
| -### New features |
26 |
| -- method: `getProfile` |
27 |
| -- method: `getOHLC` |
28 |
| -- method: `getLTP` |
29 |
| -- method: `getInstrumentsMargins` |
30 |
| -- Added MF API calls |
31 |
| -- method: `getMFOrders` |
32 |
| -- method: `getMFHoldings` |
33 |
| -- method: `placeMFOrder` |
34 |
| -- method: `cancelMFOrder` |
35 |
| -- method: `getMFSIPS` |
36 |
| -- method: `placeMFSIP` |
37 |
| -- method: `modifyMFSIP` |
38 |
| -- method: `cancelMFSIP` |
39 |
| -- method: `getMFInstruments` |
40 |
| -- method: `exitOrder` |
41 |
| -- method: `renewAccessToken` |
42 |
| -- method: `invalidateRefreshToken` |
43 |
| -- constants for products, order type, transaction type, variety, validity, exchanges and margin segments |
| 17 | +### Improvements |
44 | 18 |
|
45 |
| -### API method name changes |
| 19 | +- **Code Quality**: Refactored codebase to improve readability, maintainability, and performance. |
| 20 | +- **Error Handling**: Improved error handling and added more descriptive error messages. |
46 | 21 |
|
47 |
| -| v2 | v3 | |
48 |
| -| ------------------------- | ------------------------- | |
49 |
| -| requestAccessToken | generateSession | |
50 |
| -| invalidateToken | invalidateAccessToken | |
51 |
| -| setSessionHook | setSessionExpiryHook | |
52 |
| -| loginUrl | getLoginURL | |
53 |
| -| margins | getMargins | |
54 |
| -| orderPlace | placeOrder | |
55 |
| -| orderModify | modifyOrder | |
56 |
| -| orderCancel | cancelOrder | |
57 |
| -| orders | getOrders | |
58 |
| -| orders(order_id) | getOrderHistory | |
59 |
| -| trades | getTrades | |
60 |
| -| trades(order_id) | getOrderTrades | |
61 |
| -| holdings | getHoldings | |
62 |
| -| positions | getPositions | |
63 |
| -| productModify | convertPosition | |
64 |
| -| instruments | getInstruments | |
65 |
| -| historical | getHistoricalData | |
66 |
| -| triggerRange | getTriggerRange | |
| 22 | +### Migration Guide |
67 | 23 |
|
68 |
| -### Params and other changes |
69 |
| -- `KiteConnect` takes all the params as object including `api_key` |
70 |
| -- `convertPosition` method takes all the params as object |
71 |
| -- All success response returns only `data` field in response instead with envelope |
72 |
| -- All error thrown are in the format of `{"message": "Unknown error", "error_type": "GeneralException", "data": null}` |
73 |
| -- [Changes in `generateSession` response structure](https://kite.trade/docs/connect/v3/user/#response-attributes) |
74 |
| -- [Changes in `getPositions` response structure](https://kite.trade/docs/connect/v3/portfolio/#response-attributes_1) |
75 |
| -- [Changes in `getQuote` response structure](https://kite.trade/docs/connect/v3/market-quotes/#retrieving-full-market-quotes) |
76 |
| -- [Changes in `placeOrder` params](https://kite.trade/docs/connect/v3/orders/#bracket-order-bo-parameters) |
77 |
| -- Changes in `getHistoricalData` params |
78 |
| -- All datetime string fields has been converted to `Date` object. |
79 |
| - - `getOrders`, `getOrderHistory`, `getTrades`, `getOrderTrades`, `getMFOrders` responses fields `order_timestamp`, `exchange_timestamp`, `fill_timestamp` |
80 |
| - - `getMFSIPS` fields `created`, `last_instalment` |
81 |
| - - `generateSession` field `login_time` |
82 |
| - - `getQuote` fields `timestamp`, `last_trade_time` |
83 |
| - - `getInstruments` field `expiry` |
84 |
| - - `getMFInstruments` field `last_price_date` |
| 24 | +If you are upgrading from a previous version, please review the following changes and adjust your code accordingly: |
85 | 25 |
|
86 |
| -### KiteTicker changes |
87 |
| -- `KiteTicker` receives param `access_token` instead of `public_token` |
88 |
| -- New params addedd to `KiteTicker` initializer |
89 |
| - - `reconnect` - Toggle auto reconnect on/off |
90 |
| - - `max_retry` - Max retry count for auto reconnect |
91 |
| - - `max_delay` - Max delay between subsequent retries |
92 |
| - - Auto reconnect is enabled by default |
93 |
| -- Renamed callback `reconnecting` to `reconnect` |
94 |
| -- Added new callbacks |
95 |
| - - `error` - when socket connection is closed with error. Error is received as a first param |
96 |
| - - `close` - when socket connection is closed cleanly |
97 |
| - - `order_update` - When order update (postback) is received for the connected user (Data object is received as first argument) |
| 26 | +- **Node.js Version**: Ensure your Node.js version is 18.0.0 or higher. |
| 27 | +- **TypeScript Integration**: Update your project to handle the new TypeScript types. This may involve adding or adjusting type definitions in your project. |
| 28 | +- **Function Signatures**: Review the updated function signatures in the documentation and adjust your usage of the library accordingly. |
98 | 29 |
|
| 30 | +### Bug Fixes |
99 | 31 |
|
| 32 | +- Fixed various minor bugs and performance issues reported in the previous version. |
| 33 | + |
| 34 | +### Notes |
| 35 | + |
| 36 | +- This release marks a significant update with the transition to TypeScript. Please report any issues or bugs to the repository's issue tracker. |
| 37 | + |
| 38 | +[5.0.0]: https://github.com/your-repo/kiteconnect-ts/releases/tag/v5.0.0 |
0 commit comments