@ganaka/sdk 1.0.3 → 1.2.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 CHANGED
@@ -49,6 +49,8 @@ declare const createRun: {
49
49
  start_datetime: z.ZodString;
50
50
  end_datetime: z.ZodString;
51
51
  timezone: z.ZodOptional<z.ZodString>;
52
+ name: z.ZodOptional<z.ZodString>;
53
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
52
54
  }, z.core.$strip>;
53
55
  response: z.ZodObject<{
54
56
  statusCode: z.ZodNumber;
@@ -58,6 +60,8 @@ declare const createRun: {
58
60
  start_datetime: z.ZodString;
59
61
  end_datetime: z.ZodString;
60
62
  completed: z.ZodBoolean;
63
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
64
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
65
  }, z.core.$strip>;
62
66
  }, z.core.$strip>;
63
67
  };
@@ -85,6 +89,16 @@ declare const fetchCandles: ({ developerToken, apiDomain, runId, currentTimestam
85
89
 
86
90
  export declare type FetchCandlesResponse = Awaited<ReturnType<ReturnType<typeof fetchCandles>>>;
87
91
 
92
+ declare const fetchNiftyQuote: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
93
+ developerToken: string;
94
+ apiDomain: string;
95
+ runId: string | null;
96
+ currentTimestamp: string;
97
+ currentTimezone?: string;
98
+ }) => (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
+
100
+ export declare type FetchNiftyQuoteResponse = Awaited<ReturnType<ReturnType<typeof fetchNiftyQuote>>>;
101
+
88
102
  declare const fetchQuote: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
89
103
  developerToken: string;
90
104
  apiDomain: string;
@@ -119,7 +133,7 @@ declare const fetchShortlist: ({ developerToken, apiDomain, runId, currentTimest
119
133
 
120
134
  export declare type FetchShortlistResponse = Awaited<ReturnType<ReturnType<typeof fetchShortlist>>>;
121
135
 
122
- export declare function ganaka<T>({ fn, startTime, endTime, intervalMinutes, deleteRunAfterCompletion, }: {
136
+ export declare function ganaka<T>({ fn, startTime, endTime, intervalMinutes, deleteRunAfterCompletion, name, tags, }: {
123
137
  fn: (context: RunContext) => Promise<T>;
124
138
  /** Start time in IST string format (YYYY-MM-DDTHH:mm:ss) */
125
139
  startTime: string;
@@ -132,6 +146,14 @@ export declare function ganaka<T>({ fn, startTime, endTime, intervalMinutes, del
132
146
  * @default false
133
147
  */
134
148
  deleteRunAfterCompletion?: boolean;
149
+ /**
150
+ * Optional name for the run
151
+ */
152
+ name?: string;
153
+ /**
154
+ * Optional array of tags to classify and group the run
155
+ */
156
+ tags?: string[];
135
157
  }): Promise<void>;
136
158
 
137
159
  declare const getAvailableDatetimes: {
@@ -275,6 +297,66 @@ declare const getGrowwHistoricalCandles: {
275
297
  }, z.core.$strip>;
276
298
  };
277
299
 
300
+ declare const getGrowwNiftyQuote: {
301
+ query: z.ZodObject<{
302
+ datetime: z.ZodOptional<z.ZodString>;
303
+ timezone: z.ZodOptional<z.ZodString>;
304
+ }, z.core.$strip>;
305
+ response: z.ZodObject<{
306
+ statusCode: z.ZodNumber;
307
+ message: z.ZodString;
308
+ data: z.ZodNullable<z.ZodObject<{
309
+ status: z.ZodEnum<{
310
+ SUCCESS: "SUCCESS";
311
+ FAILURE: "FAILURE";
312
+ }>;
313
+ payload: z.ZodObject<{
314
+ average_price: z.ZodNullable<z.ZodNumber>;
315
+ bid_quantity: z.ZodNullable<z.ZodNumber>;
316
+ bid_price: z.ZodNullable<z.ZodNumber>;
317
+ day_change: z.ZodNullable<z.ZodNumber>;
318
+ day_change_perc: z.ZodNullable<z.ZodNumber>;
319
+ upper_circuit_limit: z.ZodNullable<z.ZodNumber>;
320
+ lower_circuit_limit: z.ZodNullable<z.ZodNumber>;
321
+ ohlc: z.ZodNullable<z.ZodObject<{
322
+ open: z.ZodNullable<z.ZodNumber>;
323
+ high: z.ZodNullable<z.ZodNumber>;
324
+ low: z.ZodNullable<z.ZodNumber>;
325
+ close: z.ZodNullable<z.ZodNumber>;
326
+ }, z.core.$strip>>;
327
+ depth: z.ZodNullable<z.ZodObject<{
328
+ buy: z.ZodArray<z.ZodObject<{
329
+ price: z.ZodNullable<z.ZodNumber>;
330
+ quantity: z.ZodNullable<z.ZodNumber>;
331
+ }, z.core.$strip>>;
332
+ sell: z.ZodArray<z.ZodObject<{
333
+ price: z.ZodNullable<z.ZodNumber>;
334
+ quantity: z.ZodNullable<z.ZodNumber>;
335
+ }, z.core.$strip>>;
336
+ }, z.core.$strip>>;
337
+ high_trade_range: z.ZodNullable<z.ZodNull>;
338
+ implied_volatility: z.ZodNullable<z.ZodNull>;
339
+ last_trade_quantity: z.ZodNullable<z.ZodNumber>;
340
+ last_trade_time: z.ZodNullable<z.ZodNumber>;
341
+ low_trade_range: z.ZodNullable<z.ZodNull>;
342
+ last_price: z.ZodNullable<z.ZodNumber>;
343
+ market_cap: z.ZodNullable<z.ZodNumber>;
344
+ offer_price: z.ZodNullable<z.ZodNumber>;
345
+ offer_quantity: z.ZodNullable<z.ZodNumber>;
346
+ oi_day_change: z.ZodNullable<z.ZodNumber>;
347
+ oi_day_change_percentage: z.ZodNullable<z.ZodNumber>;
348
+ open_interest: z.ZodNullable<z.ZodNumber>;
349
+ previous_open_interest: z.ZodNullable<z.ZodNull>;
350
+ total_buy_quantity: z.ZodNullable<z.ZodNumber>;
351
+ total_sell_quantity: z.ZodNullable<z.ZodNumber>;
352
+ volume: z.ZodNullable<z.ZodNumber>;
353
+ week_52_high: z.ZodNullable<z.ZodNumber>;
354
+ week_52_low: z.ZodNullable<z.ZodNumber>;
355
+ }, z.core.$strip>;
356
+ }, z.core.$strip>>;
357
+ }, z.core.$strip>;
358
+ };
359
+
278
360
  declare const getGrowwQuote: {
279
361
  query: z.ZodObject<{
280
362
  symbol: z.ZodString;
@@ -550,10 +632,20 @@ declare const getRuns: {
550
632
  end_datetime: z.ZodString;
551
633
  completed: z.ZodBoolean;
552
634
  orderCount: z.ZodNumber;
635
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
636
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
553
637
  }, z.core.$strip>>>;
554
638
  }, z.core.$strip>;
555
639
  };
556
640
 
641
+ declare const getRunTags: {
642
+ response: z.ZodObject<{
643
+ statusCode: z.ZodNumber;
644
+ message: z.ZodString;
645
+ data: z.ZodArray<z.ZodString>;
646
+ }, z.core.$strip>;
647
+ };
648
+
557
649
  declare const getShortlists: {
558
650
  query: z.ZodObject<{
559
651
  datetime: z.ZodString;
@@ -756,6 +848,7 @@ export declare interface RunContext {
756
848
  placeOrder: ReturnType<typeof placeOrder>;
757
849
  fetchCandles: ReturnType<typeof fetchCandles>;
758
850
  fetchQuote: ReturnType<typeof fetchQuote>;
851
+ fetchNiftyQuote: ReturnType<typeof fetchNiftyQuote>;
759
852
  fetchQuoteTimeline: ReturnType<typeof fetchQuoteTimeline>;
760
853
  fetchShortlist: ReturnType<typeof fetchShortlist>;
761
854
  /**
@@ -785,6 +878,8 @@ declare const updateRun: {
785
878
  }, z.core.$strip>;
786
879
  body: z.ZodObject<{
787
880
  completed: z.ZodOptional<z.ZodBoolean>;
881
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
882
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
788
883
  }, z.core.$strip>;
789
884
  response: z.ZodObject<{
790
885
  statusCode: z.ZodNumber;
@@ -794,6 +889,8 @@ declare const updateRun: {
794
889
  start_datetime: z.ZodString;
795
890
  end_datetime: z.ZodString;
796
891
  completed: z.ZodBoolean;
892
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
893
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
797
894
  }, z.core.$strip>;
798
895
  }, z.core.$strip>;
799
896
  };
@@ -841,7 +938,8 @@ declare namespace v1_dashboard_runs_schemas {
841
938
  createRun,
842
939
  updateRun,
843
940
  deleteRun,
844
- createOrder
941
+ createOrder,
942
+ getRunTags
845
943
  }
846
944
  }
847
945
 
@@ -870,7 +968,8 @@ declare namespace v1_developer_groww_schemas {
870
968
  getGrowwHistoricalCandles,
871
969
  getGrowwQuote,
872
970
  getGrowwToken,
873
- getGrowwQuoteTimeline
971
+ getGrowwQuoteTimeline,
972
+ getGrowwNiftyQuote
874
973
  }
875
974
  }
876
975