@ganaka/sdk 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +165 -132
- package/dist/index.d.ts +193 -0
- package/dist/index.js +326 -159
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +326 -159
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,172 +16,218 @@ pnpm add @ganaka/sdk
|
|
|
16
16
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
19
|
+
### Using GanakaClient for Standalone API Calls
|
|
20
|
+
|
|
21
|
+
The `GanakaClient` allows you to fetch data without setting up a full ganaka run:
|
|
22
|
+
|
|
19
23
|
```typescript
|
|
20
24
|
import { GanakaClient } from "@ganaka/sdk";
|
|
25
|
+
import dotenv from "dotenv";
|
|
26
|
+
|
|
27
|
+
dotenv.config();
|
|
21
28
|
|
|
22
|
-
// Initialize the client
|
|
29
|
+
// Initialize the client (reads DEVELOPER_KEY from environment)
|
|
30
|
+
const client = new GanakaClient();
|
|
31
|
+
|
|
32
|
+
// Or with explicit configuration
|
|
23
33
|
const client = new GanakaClient({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
developerToken: "your-developer-token",
|
|
35
|
+
apiDomain: "https://api.ganaka.live", // optional, defaults to this
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Fetch historical candles
|
|
39
|
+
const candles = await client.fetchCandles({
|
|
40
|
+
symbol: "RELIANCE",
|
|
41
|
+
interval: "1minute",
|
|
42
|
+
start_datetime: "2026-01-20T09:15:00",
|
|
43
|
+
end_datetime: "2026-01-20T15:30:00",
|
|
27
44
|
});
|
|
28
45
|
|
|
29
|
-
//
|
|
30
|
-
const
|
|
31
|
-
|
|
46
|
+
// Fetch quote for a symbol
|
|
47
|
+
const quote = await client.fetchQuote({
|
|
48
|
+
symbol: "RELIANCE",
|
|
49
|
+
datetime: "2026-01-20T10:30:00",
|
|
50
|
+
});
|
|
32
51
|
|
|
33
|
-
//
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
52
|
+
// Fetch shortlist
|
|
53
|
+
const shortlist = await client.fetchShortlist({
|
|
54
|
+
type: "top-gainers",
|
|
55
|
+
datetime: "2026-01-20T10:30:00",
|
|
56
|
+
});
|
|
38
57
|
```
|
|
39
58
|
|
|
40
|
-
|
|
59
|
+
### Using ganaka() for Iterative Strategies
|
|
60
|
+
|
|
61
|
+
The `ganaka()` function is used for running iterative strategies with time loops:
|
|
41
62
|
|
|
42
63
|
```typescript
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
64
|
+
import { ganaka } from "@ganaka/sdk";
|
|
65
|
+
import dotenv from "dotenv";
|
|
66
|
+
|
|
67
|
+
dotenv.config();
|
|
68
|
+
|
|
69
|
+
await ganaka({
|
|
70
|
+
fn: async ({ fetchCandles, fetchQuote, placeOrder, currentTimestamp }) => {
|
|
71
|
+
// Your strategy logic here
|
|
72
|
+
const candles = await fetchCandles({
|
|
73
|
+
symbol: "RELIANCE",
|
|
74
|
+
interval: "1minute",
|
|
75
|
+
start_datetime: "2026-01-20T09:15:00",
|
|
76
|
+
end_datetime: currentTimestamp,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const quote = await fetchQuote({
|
|
80
|
+
symbol: "RELIANCE",
|
|
81
|
+
datetime: currentTimestamp,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// Place order if conditions are met
|
|
85
|
+
if (quote && quote.price > 100) {
|
|
86
|
+
await placeOrder({
|
|
87
|
+
nseSymbol: "RELIANCE",
|
|
88
|
+
entryPrice: quote.price,
|
|
89
|
+
stopLossPrice: quote.price * 0.95,
|
|
90
|
+
takeProfitPrice: quote.price * 1.05,
|
|
91
|
+
datetime: currentTimestamp,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
startTime: "2026-01-20T09:15:00",
|
|
96
|
+
endTime: "2026-01-20T15:30:00",
|
|
97
|
+
intervalMinutes: 1,
|
|
98
|
+
name: "My Strategy",
|
|
99
|
+
tags: ["momentum", "scalping"],
|
|
49
100
|
});
|
|
50
101
|
```
|
|
51
102
|
|
|
52
|
-
##
|
|
103
|
+
## Configuration
|
|
53
104
|
|
|
54
|
-
###
|
|
105
|
+
### Environment Variables
|
|
55
106
|
|
|
56
|
-
|
|
57
|
-
// Get all shortlists
|
|
58
|
-
const shortlists = await client.getShortlists();
|
|
107
|
+
The SDK reads configuration from environment variables:
|
|
59
108
|
|
|
60
|
-
|
|
61
|
-
|
|
109
|
+
- `DEVELOPER_KEY` - Your developer token (required)
|
|
110
|
+
- `API_DOMAIN` - API base URL (optional, defaults to `https://api.ganaka.live`)
|
|
62
111
|
|
|
63
|
-
|
|
64
|
-
const newShortlist = await client.createShortlist({
|
|
65
|
-
name: "My Watchlist",
|
|
66
|
-
symbols: ["AAPL", "GOOGL", "MSFT"],
|
|
67
|
-
});
|
|
112
|
+
### GanakaClient Configuration
|
|
68
113
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
name: "Updated Watchlist",
|
|
72
|
-
});
|
|
114
|
+
```typescript
|
|
115
|
+
import { GanakaClient } from "@ganaka/sdk";
|
|
73
116
|
|
|
74
|
-
|
|
75
|
-
|
|
117
|
+
const client = new GanakaClient({
|
|
118
|
+
developerToken: "your-developer-token", // optional if DEVELOPER_KEY env var is set
|
|
119
|
+
apiDomain: "https://api.ganaka.live", // optional, defaults to this
|
|
120
|
+
});
|
|
76
121
|
```
|
|
77
122
|
|
|
78
|
-
|
|
123
|
+
## API Methods
|
|
79
124
|
|
|
80
|
-
|
|
81
|
-
// Search instruments
|
|
82
|
-
const results = await client.searchInstruments("apple");
|
|
125
|
+
### GanakaClient Methods
|
|
83
126
|
|
|
84
|
-
|
|
85
|
-
const instrument = await client.getInstrument("AAPL");
|
|
127
|
+
All methods return promises that resolve to the API response data.
|
|
86
128
|
|
|
87
|
-
|
|
88
|
-
const instruments = await client.getInstruments(["AAPL", "GOOGL"]);
|
|
89
|
-
```
|
|
129
|
+
#### `fetchCandles(params)`
|
|
90
130
|
|
|
91
|
-
|
|
131
|
+
Fetch historical candles for a symbol.
|
|
92
132
|
|
|
93
133
|
```typescript
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
name: "My Strategy",
|
|
100
|
-
type: "momentum",
|
|
101
|
-
parameters: {
|
|
102
|
-
period: 20,
|
|
103
|
-
threshold: 0.02,
|
|
104
|
-
},
|
|
105
|
-
status: "inactive",
|
|
134
|
+
const candles = await client.fetchCandles({
|
|
135
|
+
symbol: "RELIANCE",
|
|
136
|
+
interval: "1minute", // or "5minute", "1day", etc.
|
|
137
|
+
start_datetime: "2026-01-20T09:15:00", // IST format (YYYY-MM-DDTHH:mm:ss)
|
|
138
|
+
end_datetime: "2026-01-20T15:30:00",
|
|
106
139
|
});
|
|
107
|
-
|
|
108
|
-
// Start/stop a strategy
|
|
109
|
-
await client.startStrategy("strategy-id");
|
|
110
|
-
await client.stopStrategy("strategy-id");
|
|
111
140
|
```
|
|
112
141
|
|
|
113
|
-
|
|
142
|
+
#### `fetchQuote(params)`
|
|
143
|
+
|
|
144
|
+
Fetch quote for a symbol at a specific datetime.
|
|
114
145
|
|
|
115
146
|
```typescript
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
quantity: 100,
|
|
120
|
-
orderType: "market",
|
|
121
|
-
side: "buy",
|
|
147
|
+
const quote = await client.fetchQuote({
|
|
148
|
+
symbol: "RELIANCE",
|
|
149
|
+
datetime: "2026-01-20T10:30:00", // IST format
|
|
122
150
|
});
|
|
123
|
-
|
|
124
|
-
// Get orders
|
|
125
|
-
const orders = await client.getOrders();
|
|
126
|
-
|
|
127
|
-
// Cancel an order
|
|
128
|
-
await client.cancelOrder("order-id");
|
|
129
151
|
```
|
|
130
152
|
|
|
131
|
-
|
|
153
|
+
#### `fetchQuoteTimeline(symbol, end_datetime)`
|
|
132
154
|
|
|
133
|
-
|
|
134
|
-
// Get WebSocket client
|
|
135
|
-
const ws = client.getWebSocket();
|
|
155
|
+
Fetch quote timeline for a symbol.
|
|
136
156
|
|
|
137
|
-
|
|
138
|
-
await client.
|
|
157
|
+
```typescript
|
|
158
|
+
const timeline = await client.fetchQuoteTimeline(
|
|
159
|
+
"RELIANCE",
|
|
160
|
+
"2026-01-20T15:30:00" // IST format
|
|
161
|
+
);
|
|
162
|
+
```
|
|
139
163
|
|
|
140
|
-
|
|
141
|
-
ws.on("connected", () => {
|
|
142
|
-
console.log("Connected to real-time data");
|
|
143
|
-
});
|
|
164
|
+
#### `fetchNiftyQuote(params)`
|
|
144
165
|
|
|
145
|
-
|
|
146
|
-
console.log("Tick data:", data);
|
|
147
|
-
});
|
|
166
|
+
Fetch NIFTY quote at a specific datetime.
|
|
148
167
|
|
|
149
|
-
|
|
150
|
-
|
|
168
|
+
```typescript
|
|
169
|
+
const niftyQuote = await client.fetchNiftyQuote({
|
|
170
|
+
datetime: "2026-01-20T10:30:00", // IST format
|
|
151
171
|
});
|
|
172
|
+
```
|
|
152
173
|
|
|
153
|
-
|
|
154
|
-
ws.subscribeTicks(["AAPL", "GOOGL"]);
|
|
174
|
+
#### `fetchNiftyQuoteTimeline(end_datetime)`
|
|
155
175
|
|
|
156
|
-
|
|
157
|
-
ws.unsubscribeTicks(["AAPL"]);
|
|
176
|
+
Fetch NIFTY quote timeline.
|
|
158
177
|
|
|
159
|
-
|
|
160
|
-
client.
|
|
178
|
+
```typescript
|
|
179
|
+
const niftyTimeline = await client.fetchNiftyQuoteTimeline(
|
|
180
|
+
"2026-01-20T15:30:00" // IST format
|
|
181
|
+
);
|
|
161
182
|
```
|
|
162
183
|
|
|
163
|
-
|
|
184
|
+
#### `fetchShortlist(queryParams)`
|
|
164
185
|
|
|
165
|
-
|
|
186
|
+
Fetch shortlist for a specific type and datetime.
|
|
166
187
|
|
|
167
188
|
```typescript
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
message?: string;
|
|
173
|
-
}
|
|
189
|
+
const shortlist = await client.fetchShortlist({
|
|
190
|
+
type: "top-gainers", // or "top-losers", etc.
|
|
191
|
+
datetime: "2026-01-20T10:30:00", // IST format
|
|
192
|
+
});
|
|
174
193
|
```
|
|
175
194
|
|
|
176
|
-
|
|
195
|
+
#### `fetchShortlistPersistence(queryParams)`
|
|
196
|
+
|
|
197
|
+
Fetch shortlist persistence - stocks that consistently appeared in a shortlist over a time range.
|
|
177
198
|
|
|
178
199
|
```typescript
|
|
179
|
-
const
|
|
200
|
+
const persistence = await client.fetchShortlistPersistence({
|
|
201
|
+
type: "top-gainers",
|
|
202
|
+
start_datetime: "2026-01-20T09:15:00", // IST format
|
|
203
|
+
end_datetime: "2026-01-20T15:30:00", // IST format
|
|
204
|
+
});
|
|
205
|
+
```
|
|
180
206
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
207
|
+
### ganaka() Function
|
|
208
|
+
|
|
209
|
+
The `ganaka()` function provides a `RunContext` with all the above methods plus:
|
|
210
|
+
|
|
211
|
+
- `placeOrder(data)` - Place an order (only available within a run context)
|
|
212
|
+
- `currentTimestamp` - Current timestamp in IST format for the current loop iteration
|
|
213
|
+
|
|
214
|
+
## Error Handling
|
|
215
|
+
|
|
216
|
+
All methods throw errors if the API request fails. Handle them with try-catch:
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
try {
|
|
220
|
+
const candles = await client.fetchCandles({
|
|
221
|
+
symbol: "RELIANCE",
|
|
222
|
+
interval: "1minute",
|
|
223
|
+
start_datetime: "2026-01-20T09:15:00",
|
|
224
|
+
end_datetime: "2026-01-20T15:30:00",
|
|
225
|
+
});
|
|
226
|
+
console.log("Candles:", candles);
|
|
227
|
+
} catch (error) {
|
|
228
|
+
if (error instanceof Error) {
|
|
229
|
+
console.error("Failed to fetch candles:", error.message);
|
|
230
|
+
}
|
|
185
231
|
}
|
|
186
232
|
```
|
|
187
233
|
|
|
@@ -190,7 +236,14 @@ if (response.success) {
|
|
|
190
236
|
This SDK is written in TypeScript and provides full type definitions:
|
|
191
237
|
|
|
192
238
|
```typescript
|
|
193
|
-
import type {
|
|
239
|
+
import type {
|
|
240
|
+
GanakaClient,
|
|
241
|
+
GanakaClientConfig,
|
|
242
|
+
FetchCandlesResponse,
|
|
243
|
+
FetchQuoteResponse,
|
|
244
|
+
FetchShortlistResponse,
|
|
245
|
+
RunContext,
|
|
246
|
+
} from "@ganaka/sdk";
|
|
194
247
|
```
|
|
195
248
|
|
|
196
249
|
## Development
|
|
@@ -238,23 +291,3 @@ MIT
|
|
|
238
291
|
## Contributing
|
|
239
292
|
|
|
240
293
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
package/dist/index.d.ts
CHANGED
|
@@ -178,6 +178,113 @@ export declare function ganaka<T>({ fn, startTime, endTime, intervalMinutes, del
|
|
|
178
178
|
tags?: string[];
|
|
179
179
|
}): Promise<void>;
|
|
180
180
|
|
|
181
|
+
/**
|
|
182
|
+
* GanakaClient provides standalone access to Ganaka API methods without requiring a run context.
|
|
183
|
+
* This allows you to fetch data (candles, quotes, shortlists, etc.) without setting up a full ganaka run.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* import { GanakaClient } from "@ganaka/sdk";
|
|
188
|
+
*
|
|
189
|
+
* const client = new GanakaClient();
|
|
190
|
+
* const candles = await client.fetchCandles({
|
|
191
|
+
* symbol: "RELIANCE",
|
|
192
|
+
* interval: "1minute",
|
|
193
|
+
* start_datetime: "2026-01-20T09:15:00",
|
|
194
|
+
* end_datetime: "2026-01-20T15:30:00",
|
|
195
|
+
* });
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
export declare class GanakaClient {
|
|
199
|
+
private developerToken;
|
|
200
|
+
private apiDomain;
|
|
201
|
+
constructor(config?: GanakaClientConfig);
|
|
202
|
+
/**
|
|
203
|
+
* Fetch historical candles for a symbol.
|
|
204
|
+
*
|
|
205
|
+
* @param params - Query parameters for fetching candles
|
|
206
|
+
* @param params.symbol - The symbol to fetch candles for
|
|
207
|
+
* @param params.interval - The interval for candles (e.g., "1minute", "5minute", "1day")
|
|
208
|
+
* @param params.start_datetime - Start datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
209
|
+
* @param params.end_datetime - End datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
210
|
+
* @returns Promise resolving to candle data
|
|
211
|
+
*/
|
|
212
|
+
fetchCandles(params: z.infer<typeof v1_developer_groww_schemas.getGrowwHistoricalCandles.query>): Promise<z.infer<typeof v1_developer_groww_schemas.getGrowwHistoricalCandles.response>["data"]>;
|
|
213
|
+
/**
|
|
214
|
+
* Fetch quote for a symbol at a specific datetime.
|
|
215
|
+
*
|
|
216
|
+
* @param params - Query parameters for fetching quote
|
|
217
|
+
* @param params.symbol - The symbol to fetch quote for
|
|
218
|
+
* @param params.datetime - Datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
219
|
+
* @returns Promise resolving to quote data or null
|
|
220
|
+
*/
|
|
221
|
+
fetchQuote(params: z.infer<typeof v1_developer_groww_schemas.getGrowwQuote.query>): Promise<z.infer<typeof v1_developer_groww_schemas.getGrowwQuote.response>["data"] | null>;
|
|
222
|
+
/**
|
|
223
|
+
* Fetch quote timeline for a symbol.
|
|
224
|
+
* Given a symbol and an end_datetime, returns the quote timeline for the given date.
|
|
225
|
+
*
|
|
226
|
+
* @param symbol - The symbol to fetch quote timeline for
|
|
227
|
+
* @param end_datetime - End datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
228
|
+
* @returns Promise resolving to quote timeline data
|
|
229
|
+
*/
|
|
230
|
+
fetchQuoteTimeline(symbol: string, end_datetime: string): Promise<z.infer<typeof v1_developer_groww_schemas.getGrowwQuoteTimeline.response>["data"]["quoteTimeline"]>;
|
|
231
|
+
/**
|
|
232
|
+
* Fetch NIFTY quote at a specific datetime.
|
|
233
|
+
*
|
|
234
|
+
* @param params - Query parameters for fetching NIFTY quote
|
|
235
|
+
* @param params.datetime - Datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
236
|
+
* @returns Promise resolving to NIFTY quote data or null
|
|
237
|
+
*/
|
|
238
|
+
fetchNiftyQuote(params: z.infer<typeof v1_developer_groww_schemas.getGrowwNiftyQuote.query>): Promise<z.infer<typeof v1_developer_groww_schemas.getGrowwNiftyQuote.response>["data"] | null>;
|
|
239
|
+
/**
|
|
240
|
+
* Fetch NIFTY quote timeline.
|
|
241
|
+
* Given an end_datetime, returns the NIFTY quote timeline for the given date.
|
|
242
|
+
*
|
|
243
|
+
* @param end_datetime - End datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
244
|
+
* @returns Promise resolving to NIFTY quote timeline data
|
|
245
|
+
*/
|
|
246
|
+
fetchNiftyQuoteTimeline(end_datetime: string): Promise<z.infer<typeof v1_developer_groww_schemas.getGrowwNiftyQuoteTimeline.response>["data"]["niftyTimeline"]>;
|
|
247
|
+
/**
|
|
248
|
+
* Fetch shortlist for a specific type and datetime.
|
|
249
|
+
*
|
|
250
|
+
* @param queryParams - Query parameters for fetching shortlist
|
|
251
|
+
* @param queryParams.type - The type of shortlist (e.g., "top-gainers", "top-losers")
|
|
252
|
+
* @param queryParams.datetime - Datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
253
|
+
* @returns Promise resolving to shortlist data or null
|
|
254
|
+
*/
|
|
255
|
+
fetchShortlist(queryParams: z.infer<typeof v1_developer_lists_schemas.getLists.query>): Promise<z.infer<typeof v1_developer_lists_schemas.getLists.response>["data"] | null>;
|
|
256
|
+
/**
|
|
257
|
+
* Fetch shortlist persistence.
|
|
258
|
+
* Given a shortlist type and a start and end datetime,
|
|
259
|
+
* returns the list of instruments that appeared in the shortlist during the time range
|
|
260
|
+
* in descending order of appearance count.
|
|
261
|
+
*
|
|
262
|
+
* This helps identify the stocks that have been consistently appearing in the shortlist
|
|
263
|
+
* over a given period of time.
|
|
264
|
+
*
|
|
265
|
+
* @param queryParams - Query parameters for fetching shortlist persistence
|
|
266
|
+
* @param queryParams.type - The type of shortlist (e.g., "top-gainers", "top-losers")
|
|
267
|
+
* @param queryParams.start_datetime - Start datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
268
|
+
* @param queryParams.end_datetime - End datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
269
|
+
* @returns Promise resolving to shortlist persistence data or null
|
|
270
|
+
*/
|
|
271
|
+
fetchShortlistPersistence(queryParams: z.infer<typeof v1_developer_shortlist_persistence_schemas.getShortlistPersistence.query>): Promise<z.infer<typeof v1_developer_shortlist_persistence_schemas.getShortlistPersistence.response>["data"] | null>;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export declare interface GanakaClientConfig {
|
|
275
|
+
/**
|
|
276
|
+
* Developer token for API authentication.
|
|
277
|
+
* If not provided, will be read from DEVELOPER_KEY environment variable.
|
|
278
|
+
*/
|
|
279
|
+
developerToken?: string;
|
|
280
|
+
/**
|
|
281
|
+
* API domain base URL.
|
|
282
|
+
* If not provided, defaults to "https://api.ganaka.live".
|
|
283
|
+
* Can also be set via API_DOMAIN environment variable.
|
|
284
|
+
*/
|
|
285
|
+
apiDomain?: string;
|
|
286
|
+
}
|
|
287
|
+
|
|
181
288
|
declare const getAvailableDatetimes: {
|
|
182
289
|
query: z.ZodObject<{}, z.core.$strip>;
|
|
183
290
|
response: z.ZodObject<{
|
|
@@ -601,6 +708,10 @@ declare const getLists: {
|
|
|
601
708
|
}>;
|
|
602
709
|
datetime: z.ZodOptional<z.ZodString>;
|
|
603
710
|
timezone: z.ZodOptional<z.ZodString>;
|
|
711
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
712
|
+
FULL: "FULL";
|
|
713
|
+
TOP_5: "TOP_5";
|
|
714
|
+
}>>;
|
|
604
715
|
}, z.core.$strip>;
|
|
605
716
|
response: z.ZodObject<{
|
|
606
717
|
statusCode: z.ZodNumber;
|
|
@@ -746,6 +857,10 @@ declare const getShortlistPersistence: {
|
|
|
746
857
|
start_datetime: z.ZodString;
|
|
747
858
|
end_datetime: z.ZodString;
|
|
748
859
|
timezone: z.ZodOptional<z.ZodString>;
|
|
860
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
861
|
+
FULL: "FULL";
|
|
862
|
+
TOP_5: "TOP_5";
|
|
863
|
+
}>>;
|
|
749
864
|
}, z.core.$strip>;
|
|
750
865
|
response: z.ZodObject<{
|
|
751
866
|
statusCode: z.ZodNumber;
|
|
@@ -777,6 +892,12 @@ declare const getShortlists: {
|
|
|
777
892
|
TOP_GAINERS: "TOP_GAINERS";
|
|
778
893
|
VOLUME_SHOCKERS: "VOLUME_SHOCKERS";
|
|
779
894
|
}>;
|
|
895
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
896
|
+
FULL: "FULL";
|
|
897
|
+
TOP_5: "TOP_5";
|
|
898
|
+
}>>;
|
|
899
|
+
takeProfitPercentage: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
900
|
+
stopLossPercentage: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
780
901
|
}, z.core.$strip>;
|
|
781
902
|
response: z.ZodObject<{
|
|
782
903
|
statusCode: z.ZodNumber;
|
|
@@ -842,6 +963,14 @@ declare const getShortlists: {
|
|
|
842
963
|
week_52_low: z.ZodNullable<z.ZodNumber>;
|
|
843
964
|
}, z.core.$strip>;
|
|
844
965
|
}, z.core.$strip>>>;
|
|
966
|
+
targetPrice: z.ZodOptional<z.ZodNumber>;
|
|
967
|
+
stopLossPrice: z.ZodOptional<z.ZodNumber>;
|
|
968
|
+
targetAchieved: z.ZodOptional<z.ZodBoolean>;
|
|
969
|
+
stopLossHit: z.ZodOptional<z.ZodBoolean>;
|
|
970
|
+
timeToTargetMinutes: z.ZodOptional<z.ZodNumber>;
|
|
971
|
+
timeToStopLossMinutes: z.ZodOptional<z.ZodNumber>;
|
|
972
|
+
targetTimestamp: z.ZodOptional<z.ZodString>;
|
|
973
|
+
stopLossTimestamp: z.ZodOptional<z.ZodString>;
|
|
845
974
|
}, z.core.$strip>>;
|
|
846
975
|
}, z.core.$strip>>;
|
|
847
976
|
}, z.core.$strip>;
|
|
@@ -1000,6 +1129,69 @@ export declare interface RunContext {
|
|
|
1000
1129
|
currentTimestamp: string;
|
|
1001
1130
|
}
|
|
1002
1131
|
|
|
1132
|
+
declare const shortlistEntryWithMetricsSchema: z.ZodObject<{
|
|
1133
|
+
nseSymbol: z.ZodString;
|
|
1134
|
+
name: z.ZodString;
|
|
1135
|
+
price: z.ZodNumber;
|
|
1136
|
+
quoteData: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1137
|
+
status: z.ZodEnum<{
|
|
1138
|
+
SUCCESS: "SUCCESS";
|
|
1139
|
+
FAILURE: "FAILURE";
|
|
1140
|
+
}>;
|
|
1141
|
+
payload: z.ZodObject<{
|
|
1142
|
+
average_price: z.ZodNullable<z.ZodNumber>;
|
|
1143
|
+
bid_quantity: z.ZodNullable<z.ZodNumber>;
|
|
1144
|
+
bid_price: z.ZodNullable<z.ZodNumber>;
|
|
1145
|
+
day_change: z.ZodNullable<z.ZodNumber>;
|
|
1146
|
+
day_change_perc: z.ZodNullable<z.ZodNumber>;
|
|
1147
|
+
upper_circuit_limit: z.ZodNullable<z.ZodNumber>;
|
|
1148
|
+
lower_circuit_limit: z.ZodNullable<z.ZodNumber>;
|
|
1149
|
+
ohlc: z.ZodNullable<z.ZodObject<{
|
|
1150
|
+
open: z.ZodNullable<z.ZodNumber>;
|
|
1151
|
+
high: z.ZodNullable<z.ZodNumber>;
|
|
1152
|
+
low: z.ZodNullable<z.ZodNumber>;
|
|
1153
|
+
close: z.ZodNullable<z.ZodNumber>;
|
|
1154
|
+
}, z.core.$strip>>;
|
|
1155
|
+
depth: z.ZodNullable<z.ZodObject<{
|
|
1156
|
+
buy: z.ZodArray<z.ZodObject<{
|
|
1157
|
+
price: z.ZodNullable<z.ZodNumber>;
|
|
1158
|
+
quantity: z.ZodNullable<z.ZodNumber>;
|
|
1159
|
+
}, z.core.$strip>>;
|
|
1160
|
+
sell: z.ZodArray<z.ZodObject<{
|
|
1161
|
+
price: z.ZodNullable<z.ZodNumber>;
|
|
1162
|
+
quantity: z.ZodNullable<z.ZodNumber>;
|
|
1163
|
+
}, z.core.$strip>>;
|
|
1164
|
+
}, z.core.$strip>>;
|
|
1165
|
+
high_trade_range: z.ZodNullable<z.ZodNull>;
|
|
1166
|
+
implied_volatility: z.ZodNullable<z.ZodNull>;
|
|
1167
|
+
last_trade_quantity: z.ZodNullable<z.ZodNumber>;
|
|
1168
|
+
last_trade_time: z.ZodNullable<z.ZodNumber>;
|
|
1169
|
+
low_trade_range: z.ZodNullable<z.ZodNull>;
|
|
1170
|
+
last_price: z.ZodNullable<z.ZodNumber>;
|
|
1171
|
+
market_cap: z.ZodNullable<z.ZodNumber>;
|
|
1172
|
+
offer_price: z.ZodNullable<z.ZodNumber>;
|
|
1173
|
+
offer_quantity: z.ZodNullable<z.ZodNumber>;
|
|
1174
|
+
oi_day_change: z.ZodNullable<z.ZodNumber>;
|
|
1175
|
+
oi_day_change_percentage: z.ZodNullable<z.ZodNumber>;
|
|
1176
|
+
open_interest: z.ZodNullable<z.ZodNumber>;
|
|
1177
|
+
previous_open_interest: z.ZodNullable<z.ZodNull>;
|
|
1178
|
+
total_buy_quantity: z.ZodNullable<z.ZodNumber>;
|
|
1179
|
+
total_sell_quantity: z.ZodNullable<z.ZodNumber>;
|
|
1180
|
+
volume: z.ZodNullable<z.ZodNumber>;
|
|
1181
|
+
week_52_high: z.ZodNullable<z.ZodNumber>;
|
|
1182
|
+
week_52_low: z.ZodNullable<z.ZodNumber>;
|
|
1183
|
+
}, z.core.$strip>;
|
|
1184
|
+
}, z.core.$strip>>>;
|
|
1185
|
+
targetPrice: z.ZodOptional<z.ZodNumber>;
|
|
1186
|
+
stopLossPrice: z.ZodOptional<z.ZodNumber>;
|
|
1187
|
+
targetAchieved: z.ZodOptional<z.ZodBoolean>;
|
|
1188
|
+
stopLossHit: z.ZodOptional<z.ZodBoolean>;
|
|
1189
|
+
timeToTargetMinutes: z.ZodOptional<z.ZodNumber>;
|
|
1190
|
+
timeToStopLossMinutes: z.ZodOptional<z.ZodNumber>;
|
|
1191
|
+
targetTimestamp: z.ZodOptional<z.ZodString>;
|
|
1192
|
+
stopLossTimestamp: z.ZodOptional<z.ZodString>;
|
|
1193
|
+
}, z.core.$strip>;
|
|
1194
|
+
|
|
1003
1195
|
declare const signIn: {
|
|
1004
1196
|
body: z.ZodObject<{
|
|
1005
1197
|
developerToken: z.ZodString;
|
|
@@ -1100,6 +1292,7 @@ declare namespace v1_dashboard_schemas {
|
|
|
1100
1292
|
|
|
1101
1293
|
declare namespace v1_dashboard_shortlists_schemas {
|
|
1102
1294
|
export {
|
|
1295
|
+
shortlistEntryWithMetricsSchema,
|
|
1103
1296
|
getShortlists
|
|
1104
1297
|
}
|
|
1105
1298
|
}
|