All types described here are exported directly fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/anurag-roy/kiteconnect-ts/llms.txt
Use this file to discover all available pages before exploring further.
kiteconnect-ts and derived from the source without modification. Import them alongside the class:
Tick packet types
The WebSocket server sends binary packets in one of five formats depending on the mode and whether the instrument is an index or a tradable instrument. Each format maps to a distinct TypeScript interface. All five are united in theTick discriminated union type.
TickLtp
The smallest possible packet — 8 bytes. Produced when mode is set toltp for any instrument.
false for indices, true for all tradable instruments.Discriminant literal — always
'ltp' for this type.Numeric instrument token.
Last traded price.
TickIndexQuote
Produced for index instruments inquote mode (28 bytes). Extends TickLtp with OHLC and change data.
Discriminant literal — always
'quote' for this type.Numeric instrument token.
Last traded price.
Percentage change from previous close.
TickIndexFull
Produced for index instruments infull mode (32 bytes). Extends TickIndexQuote with an exchange timestamp.
Discriminant literal — always
'full' for this type.Exchange timestamp of the tick.
TickQuote
Produced for tradable (non-index) instruments inquote mode (44 bytes). Extends TickLtp with volume, OHLC, and depth-adjacent totals.
Discriminant literal.
Quantity in the last trade.
Volume-weighted average price.
Total volume traded today.
Total pending buy quantity in the order book.
Total pending sell quantity in the order book.
Percentage change from previous close.
TickFull
The largest packet — 184 bytes. Produced for tradable instruments infull mode. Extends TickQuote with timestamps, open interest, and 5-level market depth.
Discriminant literal.
Timestamp of the last trade.
Exchange packet timestamp.
Open interest (F&O instruments).
Day’s highest open interest.
Day’s lowest open interest.
5-level order book. Contains ten entries total — five buy (bid) levels and five sell (ask) levels.
Tick (discriminated union)
Tick is the discriminated union of all five packet types. The discriminant is mode. TypeScript narrows the type inside each branch so you only access fields that are actually present in the packet.
Type narrowing example
TickIndexQuote and TickQuote share the same mode: 'quote' discriminant but have different shapes. Distinguish them using the tradable field — indices always have tradable: false.Event types
TickerEvent
ticker.on().
TickerEvents
TickerEvent name and the value is the exact callback signature the on() method expects. TypeScript enforces the correct callback signature at the call site.
| Event | Callback | Description |
|---|---|---|
connect | () => void | Fired when WebSocket opens |
ticks | (ticks: any[]) => void | Fired when tick packets are received |
disconnect | (error: Error) => void | Fired when connection drops |
error | (error: Error) => void | Fired on socket errors |
close | () => void | Fired on clean socket close |
reconnect | (retries, interval) => void | Fired on each reconnect attempt |
noreconnect | () => void | Fired when max retries is exhausted |
order_update | (order: Order) => void | Fired when a user order postback arrives |
message | (data: ArrayBuffer) => void | Fired for every raw binary frame |
OrderUpdatePostback
order_update callbacks. It is identical to the Order interface from kiteconnect-ts — see the KiteConnect type reference for all fields.
Param types
KiteTickerParams
Constructor parameters forKiteTicker. See the KiteTickerParams reference for full details.
API key issued by Zerodha.
Access token from the login flow.
Enable auto-reconnect. Default:
true.Maximum reconnection attempts. Default:
50, maximum: 300.Maximum back-off delay in seconds. Default:
60, minimum: 5.WebSocket server URL. Default:
"wss://ws.kite.trade/".