@ganaka/sdk 1.7.0 → 1.9.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/dist/index.d.ts +127 -20
- package/dist/index.js +727 -477
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +727 -477
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -79,7 +79,21 @@ declare const deleteRun: {
|
|
|
79
79
|
}, z.core.$strip>;
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
declare
|
|
82
|
+
export declare type fetchAvailableDates = ReturnType<typeof fetchAvailableDates_2>;
|
|
83
|
+
|
|
84
|
+
declare const fetchAvailableDates_2: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
|
|
85
|
+
developerToken: string;
|
|
86
|
+
apiDomain: string;
|
|
87
|
+
runId: string | null;
|
|
88
|
+
currentTimestamp: string;
|
|
89
|
+
currentTimezone?: string;
|
|
90
|
+
}) => () => Promise<default_2.infer<typeof v1_developer_available_dates_schemas.getAvailableDates.response>["data"]>;
|
|
91
|
+
|
|
92
|
+
export declare type FetchAvailableDatesResponse = Awaited<ReturnType<ReturnType<typeof fetchAvailableDates_2>>>;
|
|
93
|
+
|
|
94
|
+
export declare type fetchCandles = ReturnType<typeof fetchCandles_2>;
|
|
95
|
+
|
|
96
|
+
declare const fetchCandles_2: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
|
|
83
97
|
developerToken: string;
|
|
84
98
|
apiDomain: string;
|
|
85
99
|
runId: string | null;
|
|
@@ -87,9 +101,23 @@ declare const fetchCandles: ({ developerToken, apiDomain, runId, currentTimestam
|
|
|
87
101
|
currentTimezone?: string;
|
|
88
102
|
}) => (params: default_2.infer<typeof v1_developer_groww_schemas.getGrowwHistoricalCandles.query>) => Promise<default_2.infer<typeof v1_developer_groww_schemas.getGrowwHistoricalCandles.response>["data"]>;
|
|
89
103
|
|
|
90
|
-
export declare type FetchCandlesResponse = Awaited<ReturnType<ReturnType<typeof
|
|
104
|
+
export declare type FetchCandlesResponse = Awaited<ReturnType<ReturnType<typeof fetchCandles_2>>>;
|
|
105
|
+
|
|
106
|
+
export declare type fetchHolidays = ReturnType<typeof fetchHolidays_2>;
|
|
107
|
+
|
|
108
|
+
declare const fetchHolidays_2: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
|
|
109
|
+
developerToken: string;
|
|
110
|
+
apiDomain: string;
|
|
111
|
+
runId: string | null;
|
|
112
|
+
currentTimestamp: string;
|
|
113
|
+
currentTimezone?: string;
|
|
114
|
+
}) => () => Promise<default_2.infer<typeof v1_developer_holidays_schemas.getHolidays.response>["data"]>;
|
|
115
|
+
|
|
116
|
+
export declare type FetchHolidaysResponse = Awaited<ReturnType<ReturnType<typeof fetchHolidays_2>>>;
|
|
91
117
|
|
|
92
|
-
declare
|
|
118
|
+
export declare type fetchNiftyQuote = ReturnType<typeof fetchNiftyQuote_2>;
|
|
119
|
+
|
|
120
|
+
declare const fetchNiftyQuote_2: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
|
|
93
121
|
developerToken: string;
|
|
94
122
|
apiDomain: string;
|
|
95
123
|
runId: string | null;
|
|
@@ -97,9 +125,11 @@ declare const fetchNiftyQuote: ({ developerToken, apiDomain, runId, currentTimes
|
|
|
97
125
|
currentTimezone?: string;
|
|
98
126
|
}) => (params: default_2.infer<typeof v1_developer_groww_schemas.getGrowwNiftyQuote.query>) => Promise<default_2.infer<typeof v1_developer_groww_schemas.getGrowwNiftyQuote.response>["data"] | null>;
|
|
99
127
|
|
|
100
|
-
export declare type FetchNiftyQuoteResponse = Awaited<ReturnType<ReturnType<typeof
|
|
128
|
+
export declare type FetchNiftyQuoteResponse = Awaited<ReturnType<ReturnType<typeof fetchNiftyQuote_2>>>;
|
|
129
|
+
|
|
130
|
+
export declare type fetchNiftyQuoteTimeline = ReturnType<typeof fetchNiftyQuoteTimeline_2>;
|
|
101
131
|
|
|
102
|
-
declare const
|
|
132
|
+
declare const fetchNiftyQuoteTimeline_2: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
|
|
103
133
|
developerToken: string;
|
|
104
134
|
apiDomain: string;
|
|
105
135
|
runId: string | null;
|
|
@@ -111,9 +141,11 @@ declare const fetchNiftyQuoteTimeline: ({ developerToken, apiDomain, runId, curr
|
|
|
111
141
|
*/
|
|
112
142
|
end_datetime: string) => Promise<default_2.infer<typeof v1_developer_groww_schemas.getGrowwNiftyQuoteTimeline.response>["data"]["niftyTimeline"]>;
|
|
113
143
|
|
|
114
|
-
export declare type FetchNiftyQuoteTimelineResponse = Awaited<ReturnType<ReturnType<typeof
|
|
144
|
+
export declare type FetchNiftyQuoteTimelineResponse = Awaited<ReturnType<ReturnType<typeof fetchNiftyQuoteTimeline_2>>>;
|
|
145
|
+
|
|
146
|
+
export declare type fetchQuote = ReturnType<typeof fetchQuote_2>;
|
|
115
147
|
|
|
116
|
-
declare const
|
|
148
|
+
declare const fetchQuote_2: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
|
|
117
149
|
developerToken: string;
|
|
118
150
|
apiDomain: string;
|
|
119
151
|
runId: string | null;
|
|
@@ -121,9 +153,11 @@ declare const fetchQuote: ({ developerToken, apiDomain, runId, currentTimestamp,
|
|
|
121
153
|
currentTimezone?: string;
|
|
122
154
|
}) => (params: default_2.infer<typeof v1_developer_groww_schemas.getGrowwQuote.query>) => Promise<default_2.infer<typeof v1_developer_groww_schemas.getGrowwQuote.response>["data"] | null>;
|
|
123
155
|
|
|
124
|
-
export declare type FetchQuoteResponse = Awaited<ReturnType<ReturnType<typeof
|
|
156
|
+
export declare type FetchQuoteResponse = Awaited<ReturnType<ReturnType<typeof fetchQuote_2>>>;
|
|
125
157
|
|
|
126
|
-
declare
|
|
158
|
+
export declare type fetchQuoteTimeline = ReturnType<typeof fetchQuoteTimeline_2>;
|
|
159
|
+
|
|
160
|
+
declare const fetchQuoteTimeline_2: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
|
|
127
161
|
developerToken: string;
|
|
128
162
|
apiDomain: string;
|
|
129
163
|
runId: string | null;
|
|
@@ -135,9 +169,11 @@ declare const fetchQuoteTimeline: ({ developerToken, apiDomain, runId, currentTi
|
|
|
135
169
|
*/
|
|
136
170
|
end_datetime: string) => Promise<default_2.infer<typeof v1_developer_groww_schemas.getGrowwQuoteTimeline.response>["data"]["quoteTimeline"]>;
|
|
137
171
|
|
|
138
|
-
export declare type FetchQuoteTimelineResponse = Awaited<ReturnType<ReturnType<typeof
|
|
172
|
+
export declare type FetchQuoteTimelineResponse = Awaited<ReturnType<ReturnType<typeof fetchQuoteTimeline_2>>>;
|
|
173
|
+
|
|
174
|
+
export declare type fetchShortlist = ReturnType<typeof fetchShortlist_2>;
|
|
139
175
|
|
|
140
|
-
declare const
|
|
176
|
+
declare const fetchShortlist_2: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
|
|
141
177
|
developerToken: string;
|
|
142
178
|
apiDomain: string;
|
|
143
179
|
runId: string | null;
|
|
@@ -145,7 +181,9 @@ declare const fetchShortlist: ({ developerToken, apiDomain, runId, currentTimest
|
|
|
145
181
|
currentTimezone?: string;
|
|
146
182
|
}) => (queryParams: default_2.infer<typeof v1_developer_lists_schemas.getLists.query>) => Promise<default_2.infer<typeof v1_developer_lists_schemas.getLists.response>["data"] | null>;
|
|
147
183
|
|
|
148
|
-
declare
|
|
184
|
+
export declare type fetchShortlistPersistence = ReturnType<typeof fetchShortlistPersistence_2>;
|
|
185
|
+
|
|
186
|
+
declare const fetchShortlistPersistence_2: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
|
|
149
187
|
developerToken: string;
|
|
150
188
|
apiDomain: string;
|
|
151
189
|
runId: string | null;
|
|
@@ -153,7 +191,7 @@ declare const fetchShortlistPersistence: ({ developerToken, apiDomain, runId, cu
|
|
|
153
191
|
currentTimezone?: string;
|
|
154
192
|
}) => (queryParams: default_2.infer<typeof v1_developer_shortlist_persistence_schemas.getShortlistPersistence.query>) => Promise<default_2.infer<typeof v1_developer_shortlist_persistence_schemas.getShortlistPersistence.response>["data"] | null>;
|
|
155
193
|
|
|
156
|
-
export declare type FetchShortlistResponse = Awaited<ReturnType<ReturnType<typeof
|
|
194
|
+
export declare type FetchShortlistResponse = Awaited<ReturnType<ReturnType<typeof fetchShortlist_2>>>;
|
|
157
195
|
|
|
158
196
|
export declare function ganaka<T>({ fn, startTime, endTime, intervalMinutes, deleteRunAfterCompletion, name, tags, }: {
|
|
159
197
|
fn: (context: RunContext) => Promise<T>;
|
|
@@ -269,6 +307,20 @@ export declare class GanakaClient {
|
|
|
269
307
|
* @returns Promise resolving to shortlist persistence data or null
|
|
270
308
|
*/
|
|
271
309
|
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>;
|
|
310
|
+
/**
|
|
311
|
+
* Fetch available dates with timestamps.
|
|
312
|
+
* Returns which dates have data available, grouped by date with all timestamps for each date.
|
|
313
|
+
*
|
|
314
|
+
* @returns Promise resolving to available dates data with dates and timestamps
|
|
315
|
+
*/
|
|
316
|
+
fetchAvailableDates(): Promise<z.infer<typeof v1_developer_available_dates_schemas.getAvailableDates.response>["data"]>;
|
|
317
|
+
/**
|
|
318
|
+
* Fetch market holidays.
|
|
319
|
+
* Returns all dates marked as market holidays.
|
|
320
|
+
*
|
|
321
|
+
* @returns Promise resolving to holidays data
|
|
322
|
+
*/
|
|
323
|
+
fetchHolidays(): Promise<z.infer<typeof v1_developer_holidays_schemas.getHolidays.response>["data"]>;
|
|
272
324
|
}
|
|
273
325
|
|
|
274
326
|
export declare interface GanakaClientConfig {
|
|
@@ -285,6 +337,20 @@ export declare interface GanakaClientConfig {
|
|
|
285
337
|
apiDomain?: string;
|
|
286
338
|
}
|
|
287
339
|
|
|
340
|
+
declare const getAvailableDates: {
|
|
341
|
+
query: z.ZodObject<{}, z.core.$strip>;
|
|
342
|
+
response: z.ZodObject<{
|
|
343
|
+
statusCode: z.ZodNumber;
|
|
344
|
+
message: z.ZodString;
|
|
345
|
+
data: z.ZodObject<{
|
|
346
|
+
dates: z.ZodArray<z.ZodObject<{
|
|
347
|
+
date: z.ZodString;
|
|
348
|
+
timestamps: z.ZodArray<z.ZodString>;
|
|
349
|
+
}, z.core.$strip>>;
|
|
350
|
+
}, z.core.$strip>;
|
|
351
|
+
}, z.core.$strip>;
|
|
352
|
+
};
|
|
353
|
+
|
|
288
354
|
declare const getAvailableDatetimes: {
|
|
289
355
|
query: z.ZodObject<{}, z.core.$strip>;
|
|
290
356
|
response: z.ZodObject<{
|
|
@@ -700,6 +766,21 @@ declare const getGrowwToken: {
|
|
|
700
766
|
}, z.core.$strip>;
|
|
701
767
|
};
|
|
702
768
|
|
|
769
|
+
declare const getHolidays: {
|
|
770
|
+
response: z.ZodObject<{
|
|
771
|
+
statusCode: z.ZodNumber;
|
|
772
|
+
message: z.ZodString;
|
|
773
|
+
data: z.ZodObject<{
|
|
774
|
+
holidays: z.ZodArray<z.ZodObject<{
|
|
775
|
+
id: z.ZodString;
|
|
776
|
+
date: z.ZodString;
|
|
777
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
778
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
779
|
+
}, z.core.$strip>>;
|
|
780
|
+
}, z.core.$strip>;
|
|
781
|
+
}, z.core.$strip>;
|
|
782
|
+
};
|
|
783
|
+
|
|
703
784
|
declare const getLists: {
|
|
704
785
|
query: z.ZodObject<{
|
|
705
786
|
type: z.ZodEnum<{
|
|
@@ -1098,21 +1179,21 @@ declare const placeOrder: ({ runId, apiClient }: {
|
|
|
1098
1179
|
|
|
1099
1180
|
export declare interface RunContext {
|
|
1100
1181
|
placeOrder: ReturnType<typeof placeOrder>;
|
|
1101
|
-
fetchCandles: ReturnType<typeof
|
|
1102
|
-
fetchQuote: ReturnType<typeof
|
|
1103
|
-
fetchNiftyQuote: ReturnType<typeof
|
|
1182
|
+
fetchCandles: ReturnType<typeof fetchCandles_2>;
|
|
1183
|
+
fetchQuote: ReturnType<typeof fetchQuote_2>;
|
|
1184
|
+
fetchNiftyQuote: ReturnType<typeof fetchNiftyQuote_2>;
|
|
1104
1185
|
/**
|
|
1105
1186
|
* Given an end_datetime, returns the NIFTY quote timeline for the given date
|
|
1106
1187
|
*
|
|
1107
1188
|
* @param end_datetime - The end datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
1108
1189
|
* @returns The NIFTY quote timeline for the given date
|
|
1109
1190
|
*/
|
|
1110
|
-
fetchNiftyQuoteTimeline: ReturnType<typeof
|
|
1191
|
+
fetchNiftyQuoteTimeline: ReturnType<typeof fetchNiftyQuoteTimeline_2>;
|
|
1111
1192
|
/**
|
|
1112
1193
|
* Given a symbol and a end_datetime, returns the quote timeline for the given date
|
|
1113
1194
|
*/
|
|
1114
|
-
fetchQuoteTimeline: ReturnType<typeof
|
|
1115
|
-
fetchShortlist: ReturnType<typeof
|
|
1195
|
+
fetchQuoteTimeline: ReturnType<typeof fetchQuoteTimeline_2>;
|
|
1196
|
+
fetchShortlist: ReturnType<typeof fetchShortlist_2>;
|
|
1116
1197
|
/**
|
|
1117
1198
|
* Given a shortlist type and a start and end datetime,
|
|
1118
1199
|
* returns the list of instruments that appeared in the shortlist during the time range
|
|
@@ -1121,7 +1202,21 @@ export declare interface RunContext {
|
|
|
1121
1202
|
* This helps identify the stocks that have been consistently appearing in the shortlist
|
|
1122
1203
|
* over a given period of time.
|
|
1123
1204
|
*/
|
|
1124
|
-
fetchShortlistPersistence: ReturnType<typeof
|
|
1205
|
+
fetchShortlistPersistence: ReturnType<typeof fetchShortlistPersistence_2>;
|
|
1206
|
+
/**
|
|
1207
|
+
* Fetch available dates with timestamps.
|
|
1208
|
+
* Returns which dates have data available, grouped by date with all timestamps for each date.
|
|
1209
|
+
*
|
|
1210
|
+
* @returns Available dates data with dates and timestamps
|
|
1211
|
+
*/
|
|
1212
|
+
fetchAvailableDates: ReturnType<typeof fetchAvailableDates_2>;
|
|
1213
|
+
/**
|
|
1214
|
+
* Fetch market holidays.
|
|
1215
|
+
* Returns all dates marked as market holidays.
|
|
1216
|
+
*
|
|
1217
|
+
* @returns Holidays data
|
|
1218
|
+
*/
|
|
1219
|
+
fetchHolidays: ReturnType<typeof fetchHolidays_2>;
|
|
1125
1220
|
/**
|
|
1126
1221
|
* Current timestamp in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
1127
1222
|
* for every loop iteration
|
|
@@ -1297,6 +1392,12 @@ declare namespace v1_dashboard_shortlists_schemas {
|
|
|
1297
1392
|
}
|
|
1298
1393
|
}
|
|
1299
1394
|
|
|
1395
|
+
declare namespace v1_developer_available_dates_schemas {
|
|
1396
|
+
export {
|
|
1397
|
+
getAvailableDates
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1300
1401
|
declare namespace v1_developer_groww_schemas {
|
|
1301
1402
|
export {
|
|
1302
1403
|
growwHistoricalCandlesSchema,
|
|
@@ -1309,6 +1410,12 @@ declare namespace v1_developer_groww_schemas {
|
|
|
1309
1410
|
}
|
|
1310
1411
|
}
|
|
1311
1412
|
|
|
1413
|
+
declare namespace v1_developer_holidays_schemas {
|
|
1414
|
+
export {
|
|
1415
|
+
getHolidays
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1312
1419
|
declare namespace v1_developer_lists_schemas {
|
|
1313
1420
|
export {
|
|
1314
1421
|
listSchema,
|