@ganaka/sdk 1.2.0 → 1.4.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
@@ -131,6 +131,14 @@ declare const fetchShortlist: ({ developerToken, apiDomain, runId, currentTimest
131
131
  currentTimezone?: string;
132
132
  }) => (queryParams: default_2.infer<typeof v1_developer_lists_schemas.getLists.query>) => Promise<default_2.infer<typeof v1_developer_lists_schemas.getLists.response>["data"] | null>;
133
133
 
134
+ declare const fetchShortlistPersistence: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
135
+ developerToken: string;
136
+ apiDomain: string;
137
+ runId: string | null;
138
+ currentTimestamp: string;
139
+ currentTimezone?: string;
140
+ }) => (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>;
141
+
134
142
  export declare type FetchShortlistResponse = Awaited<ReturnType<ReturnType<typeof fetchShortlist>>>;
135
143
 
136
144
  export declare function ganaka<T>({ fn, startTime, endTime, intervalMinutes, deleteRunAfterCompletion, name, tags, }: {
@@ -428,7 +436,8 @@ declare const getGrowwQuote: {
428
436
  declare const getGrowwQuoteTimeline: {
429
437
  query: z.ZodObject<{
430
438
  symbol: z.ZodString;
431
- date: z.ZodString;
439
+ end_datetime: z.ZodString;
440
+ timezone: z.ZodOptional<z.ZodString>;
432
441
  }, z.core.$strip>;
433
442
  response: z.ZodObject<{
434
443
  statusCode: z.ZodNumber;
@@ -646,6 +655,38 @@ declare const getRunTags: {
646
655
  }, z.core.$strip>;
647
656
  };
648
657
 
658
+ declare const getShortlistPersistence: {
659
+ query: z.ZodObject<{
660
+ type: z.ZodEnum<{
661
+ "top-gainers": "top-gainers";
662
+ "volume-shockers": "volume-shockers";
663
+ }>;
664
+ start_datetime: z.ZodString;
665
+ end_datetime: z.ZodString;
666
+ timezone: z.ZodOptional<z.ZodString>;
667
+ }, z.core.$strip>;
668
+ response: z.ZodObject<{
669
+ statusCode: z.ZodNumber;
670
+ message: z.ZodString;
671
+ data: z.ZodObject<{
672
+ start_datetime: z.ZodString;
673
+ end_datetime: z.ZodString;
674
+ type: z.ZodEnum<{
675
+ "top-gainers": "top-gainers";
676
+ "volume-shockers": "volume-shockers";
677
+ }>;
678
+ totalSnapshots: z.ZodNumber;
679
+ instruments: z.ZodArray<z.ZodObject<{
680
+ nseSymbol: z.ZodString;
681
+ name: z.ZodString;
682
+ appearanceCount: z.ZodNumber;
683
+ totalSnapshots: z.ZodNumber;
684
+ percentage: z.ZodNumber;
685
+ }, z.core.$strip>>;
686
+ }, z.core.$strip>;
687
+ }, z.core.$strip>;
688
+ };
689
+
649
690
  declare const getShortlists: {
650
691
  query: z.ZodObject<{
651
692
  datetime: z.ZodString;
@@ -849,8 +890,20 @@ export declare interface RunContext {
849
890
  fetchCandles: ReturnType<typeof fetchCandles>;
850
891
  fetchQuote: ReturnType<typeof fetchQuote>;
851
892
  fetchNiftyQuote: ReturnType<typeof fetchNiftyQuote>;
893
+ /**
894
+ * Given a symbol and a end_datetime, returns the quote timeline for the given date
895
+ */
852
896
  fetchQuoteTimeline: ReturnType<typeof fetchQuoteTimeline>;
853
897
  fetchShortlist: ReturnType<typeof fetchShortlist>;
898
+ /**
899
+ * Given a shortlist type and a start and end datetime,
900
+ * returns the list of instruments that appeared in the shortlist during the time range
901
+ * in descending order of appearance count
902
+ *
903
+ * This helps identify the stocks that have been consistently appearing in the shortlist
904
+ * over a given period of time.
905
+ */
906
+ fetchShortlistPersistence: ReturnType<typeof fetchShortlistPersistence>;
854
907
  /**
855
908
  * Current timestamp in IST string format (YYYY-MM-DDTHH:mm:ss)
856
909
  * for every loop iteration
@@ -980,4 +1033,10 @@ declare namespace v1_developer_lists_schemas {
980
1033
  }
981
1034
  }
982
1035
 
1036
+ declare namespace v1_developer_shortlist_persistence_schemas {
1037
+ export {
1038
+ getShortlistPersistence
1039
+ }
1040
+ }
1041
+
983
1042
  export { }
package/dist/index.js CHANGED
@@ -4174,7 +4174,7 @@ object({
4174
4174
  statusCode: number$1(),
4175
4175
  message: string()
4176
4176
  });
4177
- const m = [
4177
+ const c = [
4178
4178
  "1minute",
4179
4179
  "2minute",
4180
4180
  "3minute",
@@ -4227,7 +4227,7 @@ const m = [
4227
4227
  name: string(),
4228
4228
  price: number$1(),
4229
4229
  quoteData: a.nullable().optional()
4230
- }), c = _enum(["TOP_GAINERS", "VOLUME_SHOCKERS"]), b = object({
4230
+ }), m = _enum(["TOP_GAINERS", "VOLUME_SHOCKERS"]), b = object({
4231
4231
  nseSymbol: string(),
4232
4232
  quoteData: a
4233
4233
  });
@@ -4236,7 +4236,7 @@ const m = [
4236
4236
  data: object({
4237
4237
  timestamp: n,
4238
4238
  timezone: o.optional(),
4239
- shortlistType: c,
4239
+ shortlistType: m,
4240
4240
  entries: array(d)
4241
4241
  })
4242
4242
  }),
@@ -4245,7 +4245,7 @@ const m = [
4245
4245
  id: string(),
4246
4246
  timestamp: string(),
4247
4247
  // Format: YYYY-MM-DDTHH:mm:ss (UTC)
4248
- shortlistType: c,
4248
+ shortlistType: m,
4249
4249
  entriesCount: number$1()
4250
4250
  })
4251
4251
  })
@@ -4296,10 +4296,10 @@ const p = object({
4296
4296
  end_time: string(),
4297
4297
  interval_in_minutes: number$1()
4298
4298
  })
4299
- }), f = {
4299
+ }), v = {
4300
4300
  query: object({
4301
4301
  symbol: string(),
4302
- interval: _enum(m),
4302
+ interval: _enum(c),
4303
4303
  start_datetime: n,
4304
4304
  end_datetime: n,
4305
4305
  timezone: o.optional()
@@ -4307,7 +4307,7 @@ const p = object({
4307
4307
  response: t.extend({
4308
4308
  data: p
4309
4309
  })
4310
- }, v = {
4310
+ }, f = {
4311
4311
  query: object({
4312
4312
  symbol: string(),
4313
4313
  exchange: _enum(["NSE", "BSE"]).optional(),
@@ -4325,7 +4325,8 @@ const p = object({
4325
4325
  }, x = {
4326
4326
  query: object({
4327
4327
  symbol: string(),
4328
- date: i
4328
+ end_datetime: n,
4329
+ timezone: o.optional()
4329
4330
  }),
4330
4331
  response: t.extend({
4331
4332
  data: object({
@@ -4352,11 +4353,11 @@ const p = object({
4352
4353
  response: t.extend({
4353
4354
  data: a.nullable()
4354
4355
  })
4355
- }, ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4356
+ }, je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4356
4357
  __proto__: null,
4357
- getGrowwHistoricalCandles: f,
4358
+ getGrowwHistoricalCandles: v,
4358
4359
  getGrowwNiftyQuote: P,
4359
- getGrowwQuote: v,
4360
+ getGrowwQuote: f,
4360
4361
  getGrowwQuoteTimeline: x,
4361
4362
  getGrowwToken: T,
4362
4363
  growwHistoricalCandlesSchema: p
@@ -4364,7 +4365,7 @@ const p = object({
4364
4365
  name: string(),
4365
4366
  price: number$1(),
4366
4367
  nseSymbol: string()
4367
- }), q = {
4368
+ }), O = {
4368
4369
  query: object({
4369
4370
  type: _enum(["top-gainers", "volume-shockers"]),
4370
4371
  datetime: n.optional(),
@@ -4373,11 +4374,38 @@ const p = object({
4373
4374
  response: t.extend({
4374
4375
  data: array(g).nullable()
4375
4376
  })
4376
- }, je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4377
+ }, he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4377
4378
  __proto__: null,
4378
- getLists: q,
4379
+ getLists: O,
4379
4380
  listSchema: g
4380
- }, Symbol.toStringTag, { value: "Module" })), O = {
4381
+ }, Symbol.toStringTag, { value: "Module" })), q = {
4382
+ query: object({
4383
+ type: _enum(["top-gainers", "volume-shockers"]),
4384
+ start_datetime: n,
4385
+ end_datetime: n,
4386
+ timezone: o.optional()
4387
+ }),
4388
+ response: t.extend({
4389
+ data: object({
4390
+ start_datetime: string(),
4391
+ end_datetime: string(),
4392
+ type: _enum(["top-gainers", "volume-shockers"]),
4393
+ totalSnapshots: number$1(),
4394
+ instruments: array(
4395
+ object({
4396
+ nseSymbol: string(),
4397
+ name: string(),
4398
+ appearanceCount: number$1(),
4399
+ totalSnapshots: number$1(),
4400
+ percentage: number$1()
4401
+ })
4402
+ )
4403
+ })
4404
+ })
4405
+ }, Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4406
+ __proto__: null,
4407
+ getShortlistPersistence: q
4408
+ }, Symbol.toStringTag, { value: "Module" })), z = {
4381
4409
  query: object({}),
4382
4410
  response: t.extend({
4383
4411
  data: object({
@@ -4393,12 +4421,12 @@ const p = object({
4393
4421
  })
4394
4422
  }, w = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4395
4423
  __proto__: null,
4396
- getAvailableDatetimes: O
4397
- }, Symbol.toStringTag, { value: "Module" })), z = {
4424
+ getAvailableDatetimes: z
4425
+ }, Symbol.toStringTag, { value: "Module" })), D = {
4398
4426
  query: object({
4399
4427
  symbol: string(),
4400
4428
  date: i,
4401
- interval: _enum(m).optional()
4429
+ interval: _enum(c).optional()
4402
4430
  }),
4403
4431
  response: t.extend({
4404
4432
  data: object({
@@ -4416,10 +4444,10 @@ const p = object({
4416
4444
  interval_in_minutes: number$1()
4417
4445
  })
4418
4446
  })
4419
- }, D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4447
+ }, C = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4420
4448
  __proto__: null,
4421
- getCandles: z
4422
- }, Symbol.toStringTag, { value: "Module" })), C = {
4449
+ getCandles: D
4450
+ }, Symbol.toStringTag, { value: "Module" })), M = {
4423
4451
  query: object({
4424
4452
  date: i,
4425
4453
  type: _enum(t$1)
@@ -4439,10 +4467,10 @@ const p = object({
4439
4467
  )
4440
4468
  })
4441
4469
  })
4442
- }, M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4470
+ }, R = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4443
4471
  __proto__: null,
4444
- getDailyPersistentCompanies: C
4445
- }, Symbol.toStringTag, { value: "Module" })), R = {
4472
+ getDailyPersistentCompanies: M
4473
+ }, Symbol.toStringTag, { value: "Module" })), A = {
4446
4474
  query: object({
4447
4475
  date: i,
4448
4476
  type: _enum(t$1)
@@ -4454,23 +4482,23 @@ const p = object({
4454
4482
  uniqueCount: number$1()
4455
4483
  })
4456
4484
  })
4457
- }, A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4485
+ }, k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4458
4486
  __proto__: null,
4459
- getDailyUniqueCompanies: R
4460
- }, Symbol.toStringTag, { value: "Module" })), k = object({
4487
+ getDailyUniqueCompanies: A
4488
+ }, Symbol.toStringTag, { value: "Module" })), E = object({
4461
4489
  id: uuid(),
4462
4490
  username: string()
4463
- }), E = {
4491
+ }), I = {
4464
4492
  body: object({
4465
4493
  developerToken: string().nonempty("Developer token is required")
4466
4494
  }),
4467
4495
  response: t.extend({
4468
- data: k
4496
+ data: E
4469
4497
  })
4470
- }, I = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4498
+ }, L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4471
4499
  __proto__: null,
4472
- signIn: E
4473
- }, Symbol.toStringTag, { value: "Module" })), L = {
4500
+ signIn: I
4501
+ }, Symbol.toStringTag, { value: "Module" })), N = {
4474
4502
  query: object({
4475
4503
  symbol: string(),
4476
4504
  date: i
@@ -4492,10 +4520,10 @@ const p = object({
4492
4520
  )
4493
4521
  })
4494
4522
  })
4495
- }, N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4523
+ }, G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4496
4524
  __proto__: null,
4497
- getQuoteTimeline: L
4498
- }, Symbol.toStringTag, { value: "Module" })), G = object({
4525
+ getQuoteTimeline: N
4526
+ }, Symbol.toStringTag, { value: "Module" })), U = object({
4499
4527
  id: uuid(),
4500
4528
  start_datetime: string(),
4501
4529
  end_datetime: string(),
@@ -4503,15 +4531,15 @@ const p = object({
4503
4531
  orderCount: number$1(),
4504
4532
  name: string().nullable().optional(),
4505
4533
  tags: array(string()).optional()
4506
- }), U = record(
4534
+ }), Q = record(
4507
4535
  string(),
4508
4536
  // date string (YYYY-MM-DD)
4509
- array(G)
4510
- ), Q = {
4537
+ array(U)
4538
+ ), Y = {
4511
4539
  response: t.extend({
4512
- data: U
4540
+ data: Q
4513
4541
  })
4514
- }, Y = object({
4542
+ }, H = object({
4515
4543
  id: uuid(),
4516
4544
  nseSymbol: string(),
4517
4545
  entryPrice: number(),
@@ -4530,7 +4558,7 @@ const p = object({
4530
4558
  stopLossHit: boolean().optional(),
4531
4559
  stopLossTimestamp: string().optional(),
4532
4560
  timeToStopLossMinutes: number$1().optional()
4533
- }), H = {
4561
+ }), $ = {
4534
4562
  params: object({
4535
4563
  runId: uuid()
4536
4564
  }),
@@ -4538,46 +4566,46 @@ const p = object({
4538
4566
  targetGainPercentage: number().optional()
4539
4567
  }),
4540
4568
  response: t.extend({
4541
- data: array(Y)
4569
+ data: array(H)
4542
4570
  })
4543
- }, $ = object({
4571
+ }, F = object({
4544
4572
  start_datetime: n,
4545
4573
  end_datetime: n,
4546
4574
  timezone: o.optional(),
4547
4575
  name: string().optional(),
4548
4576
  tags: array(string().min(1).max(50)).optional()
4549
- }), F = object({
4577
+ }), B = object({
4550
4578
  id: uuid(),
4551
4579
  start_datetime: n,
4552
4580
  end_datetime: n,
4553
4581
  completed: boolean(),
4554
4582
  name: string().nullable().optional(),
4555
4583
  tags: array(string()).optional()
4556
- }), B = {
4557
- body: $,
4584
+ }), K = {
4585
+ body: F,
4558
4586
  response: t.extend({
4559
- data: F
4587
+ data: B
4560
4588
  })
4561
- }, K = object({
4589
+ }, Z = object({
4562
4590
  completed: boolean().optional(),
4563
4591
  name: string().nullable().optional(),
4564
4592
  tags: array(string().min(1).max(50)).optional()
4565
- }), Z = object({
4593
+ }), V = object({
4566
4594
  id: uuid(),
4567
4595
  start_datetime: string(),
4568
4596
  end_datetime: string(),
4569
4597
  completed: boolean(),
4570
4598
  name: string().nullable().optional(),
4571
4599
  tags: array(string()).optional()
4572
- }), V = {
4600
+ }), J = {
4573
4601
  params: object({
4574
4602
  runId: uuid()
4575
4603
  }),
4576
- body: K,
4604
+ body: Z,
4577
4605
  response: t.extend({
4578
- data: Z
4606
+ data: V
4579
4607
  })
4580
- }, J = {
4608
+ }, W = {
4581
4609
  params: object({
4582
4610
  runId: uuid()
4583
4611
  }),
@@ -4586,14 +4614,14 @@ const p = object({
4586
4614
  id: uuid()
4587
4615
  })
4588
4616
  })
4589
- }, W = object({
4617
+ }, X = object({
4590
4618
  nseSymbol: string(),
4591
4619
  entryPrice: number(),
4592
4620
  stopLossPrice: number(),
4593
4621
  takeProfitPrice: number(),
4594
4622
  datetime: n,
4595
4623
  timezone: o.optional()
4596
- }), X = object({
4624
+ }), ee = object({
4597
4625
  id: uuid(),
4598
4626
  nseSymbol: string(),
4599
4627
  entryPrice: number(),
@@ -4601,28 +4629,28 @@ const p = object({
4601
4629
  takeProfitPrice: number(),
4602
4630
  datetime: string(),
4603
4631
  runId: uuid()
4604
- }), ee = {
4632
+ }), te = {
4605
4633
  params: object({
4606
4634
  runId: uuid()
4607
4635
  }),
4608
- body: W,
4636
+ body: X,
4609
4637
  response: t.extend({
4610
- data: X
4638
+ data: ee
4611
4639
  })
4612
- }, te = {
4640
+ }, ne = {
4613
4641
  response: t.extend({
4614
4642
  data: array(string())
4615
4643
  })
4616
- }, ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4644
+ }, oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4617
4645
  __proto__: null,
4618
- createOrder: ee,
4619
- createRun: B,
4620
- deleteRun: J,
4621
- getRunOrders: H,
4622
- getRunTags: te,
4623
- getRuns: Q,
4624
- updateRun: V
4625
- }, Symbol.toStringTag, { value: "Module" })), oe = {
4646
+ createOrder: te,
4647
+ createRun: K,
4648
+ deleteRun: W,
4649
+ getRunOrders: $,
4650
+ getRunTags: ne,
4651
+ getRuns: Y,
4652
+ updateRun: J
4653
+ }, Symbol.toStringTag, { value: "Module" })), ae = {
4626
4654
  query: object({
4627
4655
  datetime: n,
4628
4656
  timezone: o.optional(),
@@ -4639,19 +4667,19 @@ const p = object({
4639
4667
  }).nullable()
4640
4668
  })
4641
4669
  })
4642
- }, ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4670
+ }, re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4643
4671
  __proto__: null,
4644
- getShortlists: oe
4645
- }, Symbol.toStringTag, { value: "Module" })), he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4672
+ getShortlists: ae
4673
+ }, Symbol.toStringTag, { value: "Module" })), ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4646
4674
  __proto__: null,
4647
- v1_dashboard_auth_schemas: I,
4675
+ v1_dashboard_auth_schemas: L,
4648
4676
  v1_dashboard_available_datetimes_schemas: w,
4649
- v1_dashboard_candles_schemas: D,
4650
- v1_dashboard_daily_persistent_companies_schemas: M,
4651
- v1_dashboard_daily_unique_companies_schemas: A,
4652
- v1_dashboard_quote_timeline_schemas: N,
4653
- v1_dashboard_runs_schemas: ne,
4654
- v1_dashboard_shortlists_schemas: ae
4677
+ v1_dashboard_candles_schemas: C,
4678
+ v1_dashboard_daily_persistent_companies_schemas: R,
4679
+ v1_dashboard_daily_unique_companies_schemas: k,
4680
+ v1_dashboard_quote_timeline_schemas: G,
4681
+ v1_dashboard_runs_schemas: oe,
4682
+ v1_dashboard_shortlists_schemas: re
4655
4683
  }, Symbol.toStringTag, { value: "Module" }));
4656
4684
  ({
4657
4685
  response: t.extend({
@@ -7940,7 +7968,7 @@ const fetchCandles = ({
7940
7968
  );
7941
7969
  }
7942
7970
  try {
7943
- const validatedParams = ye.getGrowwHistoricalCandles.query.parse(params);
7971
+ const validatedParams = je.getGrowwHistoricalCandles.query.parse(params);
7944
7972
  const headers = {
7945
7973
  Authorization: `Bearer ${developerToken}`
7946
7974
  };
@@ -7984,7 +8012,7 @@ const fetchQuote = ({
7984
8012
  );
7985
8013
  }
7986
8014
  try {
7987
- const validatedParams = ye.getGrowwQuote.query.parse(params);
8015
+ const validatedParams = je.getGrowwQuote.query.parse(params);
7988
8016
  const headers = {
7989
8017
  Authorization: `Bearer ${developerToken}`
7990
8018
  };
@@ -8024,7 +8052,7 @@ const fetchQuoteTimeline = ({
8024
8052
  throw new Error("Developer token not found. Please set DEVELOPER_KEY environment variable.");
8025
8053
  }
8026
8054
  try {
8027
- const validatedParams = ye.getGrowwQuoteTimeline.query.parse({
8055
+ const validatedParams = je.getGrowwQuoteTimeline.query.parse({
8028
8056
  symbol,
8029
8057
  date: date2
8030
8058
  });
@@ -8071,7 +8099,7 @@ const fetchShortlist = ({
8071
8099
  );
8072
8100
  }
8073
8101
  try {
8074
- const validatedParams = je.getLists.query.parse(queryParams);
8102
+ const validatedParams = he.getLists.query.parse(queryParams);
8075
8103
  const headers = {
8076
8104
  Authorization: `Bearer ${developerToken}`
8077
8105
  };
@@ -8102,6 +8130,52 @@ const fetchShortlist = ({
8102
8130
  };
8103
8131
  dayjs.extend(utc);
8104
8132
  dayjs.extend(timezone);
8133
+ const fetchShortlistPersistence = ({
8134
+ developerToken,
8135
+ apiDomain,
8136
+ runId,
8137
+ currentTimestamp,
8138
+ currentTimezone = "Asia/Kolkata"
8139
+ }) => async (queryParams) => {
8140
+ if (!developerToken) {
8141
+ throw new Error(
8142
+ "Developer token not found. Please set DEVELOPER_TOKEN environment variable."
8143
+ );
8144
+ }
8145
+ try {
8146
+ const validatedParams = Se.getShortlistPersistence.query.parse(queryParams);
8147
+ const headers = {
8148
+ Authorization: `Bearer ${developerToken}`
8149
+ };
8150
+ if (runId) {
8151
+ headers["X-Run-Id"] = runId;
8152
+ }
8153
+ if (currentTimestamp) {
8154
+ headers["X-Current-Timestamp"] = currentTimestamp;
8155
+ }
8156
+ if (currentTimezone) {
8157
+ headers["X-Current-Timezone"] = currentTimezone;
8158
+ }
8159
+ const response = await axios.get(`${apiDomain}/v1/developer/shortlists/persistence`, {
8160
+ params: validatedParams,
8161
+ headers
8162
+ });
8163
+ return response.data.data;
8164
+ } catch (error) {
8165
+ if (axios.isAxiosError(error)) {
8166
+ logger.error(
8167
+ `Error fetching shortlist persistence for ${queryParams.type}: ${error.message}`
8168
+ );
8169
+ throw new Error(
8170
+ `Failed to fetch shortlist persistence: ${error.response?.data?.message || error.message}`
8171
+ );
8172
+ }
8173
+ logger.error(`Unexpected error fetching shortlist persistence: ${error}`);
8174
+ throw error;
8175
+ }
8176
+ };
8177
+ dayjs.extend(utc);
8178
+ dayjs.extend(timezone);
8105
8179
  const fetchNiftyQuote = ({
8106
8180
  developerToken,
8107
8181
  apiDomain,
@@ -8113,7 +8187,7 @@ const fetchNiftyQuote = ({
8113
8187
  throw new Error("Developer token not found. Please set DEVELOPER_KEY environment variable.");
8114
8188
  }
8115
8189
  try {
8116
- const validatedParams = ye.getGrowwNiftyQuote.query.parse(params);
8190
+ const validatedParams = je.getGrowwNiftyQuote.query.parse(params);
8117
8191
  const headers = {
8118
8192
  Authorization: `Bearer ${developerToken}`
8119
8193
  };
@@ -8220,7 +8294,7 @@ const placeOrder = ({ runId, apiClient }) => async (data) => {
8220
8294
  try {
8221
8295
  await retryWithBackoff(
8222
8296
  async () => {
8223
- const validatedData = he.v1_dashboard_runs_schemas.createOrder.body.parse(data);
8297
+ const validatedData = ve.v1_dashboard_runs_schemas.createOrder.body.parse(data);
8224
8298
  await apiClient.post(`/v1/dashboard/runs/${runId}/orders`, validatedData);
8225
8299
  logger.debug(`Order persisted for ${data.nseSymbol} in runId: ${runId}`);
8226
8300
  },
@@ -8566,6 +8640,13 @@ async function ganaka({
8566
8640
  currentTimestamp,
8567
8641
  currentTimezone: "Asia/Kolkata"
8568
8642
  }),
8643
+ fetchShortlistPersistence: fetchShortlistPersistence({
8644
+ developerToken,
8645
+ apiDomain,
8646
+ runId,
8647
+ currentTimestamp,
8648
+ currentTimezone: "Asia/Kolkata"
8649
+ }),
8569
8650
  currentTimestamp
8570
8651
  });
8571
8652
  }