@ganaka/sdk 1.4.0 → 1.5.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
@@ -99,6 +99,20 @@ declare const fetchNiftyQuote: ({ developerToken, apiDomain, runId, currentTimes
99
99
 
100
100
  export declare type FetchNiftyQuoteResponse = Awaited<ReturnType<ReturnType<typeof fetchNiftyQuote>>>;
101
101
 
102
+ declare const fetchNiftyQuoteTimeline: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
103
+ developerToken: string;
104
+ apiDomain: string;
105
+ runId: string | null;
106
+ currentTimestamp: string;
107
+ currentTimezone?: string;
108
+ }) => (
109
+ /**
110
+ * End datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
111
+ */
112
+ end_datetime: string) => Promise<default_2.infer<typeof v1_developer_groww_schemas.getGrowwNiftyQuoteTimeline.response>["data"]["niftyTimeline"]>;
113
+
114
+ export declare type FetchNiftyQuoteTimelineResponse = Awaited<ReturnType<ReturnType<typeof fetchNiftyQuoteTimeline>>>;
115
+
102
116
  declare const fetchQuote: ({ developerToken, apiDomain, runId, currentTimestamp, currentTimezone, }: {
103
117
  developerToken: string;
104
118
  apiDomain: string;
@@ -117,9 +131,9 @@ declare const fetchQuoteTimeline: ({ developerToken, apiDomain, runId, currentTi
117
131
  currentTimezone?: string;
118
132
  }) => (symbol: string,
119
133
  /**
120
- * Date in IST string format (YYYY-MM-DD)
134
+ * End datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
121
135
  */
122
- date: string) => Promise<default_2.infer<typeof v1_developer_groww_schemas.getGrowwQuoteTimeline.response>["data"]["quoteTimeline"]>;
136
+ end_datetime: string) => Promise<default_2.infer<typeof v1_developer_groww_schemas.getGrowwQuoteTimeline.response>["data"]["quoteTimeline"]>;
123
137
 
124
138
  export declare type FetchQuoteTimelineResponse = Awaited<ReturnType<ReturnType<typeof fetchQuoteTimeline>>>;
125
139
 
@@ -365,6 +379,74 @@ declare const getGrowwNiftyQuote: {
365
379
  }, z.core.$strip>;
366
380
  };
367
381
 
382
+ declare const getGrowwNiftyQuoteTimeline: {
383
+ query: z.ZodObject<{
384
+ end_datetime: z.ZodString;
385
+ timezone: z.ZodOptional<z.ZodString>;
386
+ }, z.core.$strip>;
387
+ response: z.ZodObject<{
388
+ statusCode: z.ZodNumber;
389
+ message: z.ZodString;
390
+ data: z.ZodObject<{
391
+ niftyTimeline: z.ZodArray<z.ZodObject<{
392
+ id: z.ZodString;
393
+ timestamp: z.ZodString;
394
+ quoteData: z.ZodObject<{
395
+ status: z.ZodEnum<{
396
+ SUCCESS: "SUCCESS";
397
+ FAILURE: "FAILURE";
398
+ }>;
399
+ payload: z.ZodObject<{
400
+ average_price: z.ZodNullable<z.ZodNumber>;
401
+ bid_quantity: z.ZodNullable<z.ZodNumber>;
402
+ bid_price: z.ZodNullable<z.ZodNumber>;
403
+ day_change: z.ZodNullable<z.ZodNumber>;
404
+ day_change_perc: z.ZodNullable<z.ZodNumber>;
405
+ upper_circuit_limit: z.ZodNullable<z.ZodNumber>;
406
+ lower_circuit_limit: z.ZodNullable<z.ZodNumber>;
407
+ ohlc: z.ZodNullable<z.ZodObject<{
408
+ open: z.ZodNullable<z.ZodNumber>;
409
+ high: z.ZodNullable<z.ZodNumber>;
410
+ low: z.ZodNullable<z.ZodNumber>;
411
+ close: z.ZodNullable<z.ZodNumber>;
412
+ }, z.core.$strip>>;
413
+ depth: z.ZodNullable<z.ZodObject<{
414
+ buy: z.ZodArray<z.ZodObject<{
415
+ price: z.ZodNullable<z.ZodNumber>;
416
+ quantity: z.ZodNullable<z.ZodNumber>;
417
+ }, z.core.$strip>>;
418
+ sell: z.ZodArray<z.ZodObject<{
419
+ price: z.ZodNullable<z.ZodNumber>;
420
+ quantity: z.ZodNullable<z.ZodNumber>;
421
+ }, z.core.$strip>>;
422
+ }, z.core.$strip>>;
423
+ high_trade_range: z.ZodNullable<z.ZodNull>;
424
+ implied_volatility: z.ZodNullable<z.ZodNull>;
425
+ last_trade_quantity: z.ZodNullable<z.ZodNumber>;
426
+ last_trade_time: z.ZodNullable<z.ZodNumber>;
427
+ low_trade_range: z.ZodNullable<z.ZodNull>;
428
+ last_price: z.ZodNullable<z.ZodNumber>;
429
+ market_cap: z.ZodNullable<z.ZodNumber>;
430
+ offer_price: z.ZodNullable<z.ZodNumber>;
431
+ offer_quantity: z.ZodNullable<z.ZodNumber>;
432
+ oi_day_change: z.ZodNullable<z.ZodNumber>;
433
+ oi_day_change_percentage: z.ZodNullable<z.ZodNumber>;
434
+ open_interest: z.ZodNullable<z.ZodNumber>;
435
+ previous_open_interest: z.ZodNullable<z.ZodNull>;
436
+ total_buy_quantity: z.ZodNullable<z.ZodNumber>;
437
+ total_sell_quantity: z.ZodNullable<z.ZodNumber>;
438
+ volume: z.ZodNullable<z.ZodNumber>;
439
+ week_52_high: z.ZodNullable<z.ZodNumber>;
440
+ week_52_low: z.ZodNullable<z.ZodNumber>;
441
+ }, z.core.$strip>;
442
+ }, z.core.$strip>;
443
+ createdAt: z.ZodString;
444
+ updatedAt: z.ZodString;
445
+ }, z.core.$strip>>;
446
+ }, z.core.$strip>;
447
+ }, z.core.$strip>;
448
+ };
449
+
368
450
  declare const getGrowwQuote: {
369
451
  query: z.ZodObject<{
370
452
  symbol: z.ZodString;
@@ -890,6 +972,13 @@ export declare interface RunContext {
890
972
  fetchCandles: ReturnType<typeof fetchCandles>;
891
973
  fetchQuote: ReturnType<typeof fetchQuote>;
892
974
  fetchNiftyQuote: ReturnType<typeof fetchNiftyQuote>;
975
+ /**
976
+ * Given an end_datetime, returns the NIFTY quote timeline for the given date
977
+ *
978
+ * @param end_datetime - The end datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
979
+ * @returns The NIFTY quote timeline for the given date
980
+ */
981
+ fetchNiftyQuoteTimeline: ReturnType<typeof fetchNiftyQuoteTimeline>;
893
982
  /**
894
983
  * Given a symbol and a end_datetime, returns the quote timeline for the given date
895
984
  */
@@ -1022,6 +1111,7 @@ declare namespace v1_developer_groww_schemas {
1022
1111
  getGrowwQuote,
1023
1112
  getGrowwToken,
1024
1113
  getGrowwQuoteTimeline,
1114
+ getGrowwNiftyQuoteTimeline,
1025
1115
  getGrowwNiftyQuote
1026
1116
  }
1027
1117
  }
package/dist/index.js CHANGED
@@ -4346,6 +4346,27 @@ const p = object({
4346
4346
  })
4347
4347
  })
4348
4348
  }, P = {
4349
+ query: object({
4350
+ end_datetime: n,
4351
+ timezone: o.optional()
4352
+ }),
4353
+ response: t.extend({
4354
+ data: object({
4355
+ niftyTimeline: array(
4356
+ object({
4357
+ id: string(),
4358
+ timestamp: string(),
4359
+ // Format: YYYY-MM-DDTHH:mm:ss (UTC)
4360
+ quoteData: a,
4361
+ createdAt: string(),
4362
+ // Format: YYYY-MM-DDTHH:mm:ss (UTC)
4363
+ updatedAt: string()
4364
+ // Format: YYYY-MM-DDTHH:mm:ss (UTC)
4365
+ })
4366
+ )
4367
+ })
4368
+ })
4369
+ }, q = {
4349
4370
  query: object({
4350
4371
  datetime: n.optional(),
4351
4372
  timezone: o.optional()
@@ -4353,10 +4374,11 @@ const p = object({
4353
4374
  response: t.extend({
4354
4375
  data: a.nullable()
4355
4376
  })
4356
- }, je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4377
+ }, he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4357
4378
  __proto__: null,
4358
4379
  getGrowwHistoricalCandles: v,
4359
- getGrowwNiftyQuote: P,
4380
+ getGrowwNiftyQuote: q,
4381
+ getGrowwNiftyQuoteTimeline: P,
4360
4382
  getGrowwQuote: f,
4361
4383
  getGrowwQuoteTimeline: x,
4362
4384
  getGrowwToken: T,
@@ -4374,11 +4396,11 @@ const p = object({
4374
4396
  response: t.extend({
4375
4397
  data: array(g).nullable()
4376
4398
  })
4377
- }, he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4399
+ }, Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4378
4400
  __proto__: null,
4379
4401
  getLists: O,
4380
4402
  listSchema: g
4381
- }, Symbol.toStringTag, { value: "Module" })), q = {
4403
+ }, Symbol.toStringTag, { value: "Module" })), w = {
4382
4404
  query: object({
4383
4405
  type: _enum(["top-gainers", "volume-shockers"]),
4384
4406
  start_datetime: n,
@@ -4402,9 +4424,9 @@ const p = object({
4402
4424
  )
4403
4425
  })
4404
4426
  })
4405
- }, Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4427
+ }, ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4406
4428
  __proto__: null,
4407
- getShortlistPersistence: q
4429
+ getShortlistPersistence: w
4408
4430
  }, Symbol.toStringTag, { value: "Module" })), z = {
4409
4431
  query: object({}),
4410
4432
  response: t.extend({
@@ -4419,10 +4441,10 @@ const p = object({
4419
4441
  )
4420
4442
  })
4421
4443
  })
4422
- }, w = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4444
+ }, D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4423
4445
  __proto__: null,
4424
4446
  getAvailableDatetimes: z
4425
- }, Symbol.toStringTag, { value: "Module" })), D = {
4447
+ }, Symbol.toStringTag, { value: "Module" })), C = {
4426
4448
  query: object({
4427
4449
  symbol: string(),
4428
4450
  date: i,
@@ -4444,10 +4466,10 @@ const p = object({
4444
4466
  interval_in_minutes: number$1()
4445
4467
  })
4446
4468
  })
4447
- }, C = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4469
+ }, M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4448
4470
  __proto__: null,
4449
- getCandles: D
4450
- }, Symbol.toStringTag, { value: "Module" })), M = {
4471
+ getCandles: C
4472
+ }, Symbol.toStringTag, { value: "Module" })), A = {
4451
4473
  query: object({
4452
4474
  date: i,
4453
4475
  type: _enum(t$1)
@@ -4469,8 +4491,8 @@ const p = object({
4469
4491
  })
4470
4492
  }, R = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4471
4493
  __proto__: null,
4472
- getDailyPersistentCompanies: M
4473
- }, Symbol.toStringTag, { value: "Module" })), A = {
4494
+ getDailyPersistentCompanies: A
4495
+ }, Symbol.toStringTag, { value: "Module" })), k = {
4474
4496
  query: object({
4475
4497
  date: i,
4476
4498
  type: _enum(t$1)
@@ -4482,23 +4504,23 @@ const p = object({
4482
4504
  uniqueCount: number$1()
4483
4505
  })
4484
4506
  })
4485
- }, k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4507
+ }, E = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4486
4508
  __proto__: null,
4487
- getDailyUniqueCompanies: A
4488
- }, Symbol.toStringTag, { value: "Module" })), E = object({
4509
+ getDailyUniqueCompanies: k
4510
+ }, Symbol.toStringTag, { value: "Module" })), I = object({
4489
4511
  id: uuid(),
4490
4512
  username: string()
4491
- }), I = {
4513
+ }), N = {
4492
4514
  body: object({
4493
4515
  developerToken: string().nonempty("Developer token is required")
4494
4516
  }),
4495
4517
  response: t.extend({
4496
- data: E
4518
+ data: I
4497
4519
  })
4498
- }, L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4520
+ }, G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4499
4521
  __proto__: null,
4500
- signIn: I
4501
- }, Symbol.toStringTag, { value: "Module" })), N = {
4522
+ signIn: N
4523
+ }, Symbol.toStringTag, { value: "Module" })), L = {
4502
4524
  query: object({
4503
4525
  symbol: string(),
4504
4526
  date: i
@@ -4520,9 +4542,9 @@ const p = object({
4520
4542
  )
4521
4543
  })
4522
4544
  })
4523
- }, G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4545
+ }, Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4524
4546
  __proto__: null,
4525
- getQuoteTimeline: N
4547
+ getQuoteTimeline: L
4526
4548
  }, Symbol.toStringTag, { value: "Module" })), U = object({
4527
4549
  id: uuid(),
4528
4550
  start_datetime: string(),
@@ -4531,15 +4553,15 @@ const p = object({
4531
4553
  orderCount: number$1(),
4532
4554
  name: string().nullable().optional(),
4533
4555
  tags: array(string()).optional()
4534
- }), Q = record(
4556
+ }), Y = record(
4535
4557
  string(),
4536
4558
  // date string (YYYY-MM-DD)
4537
4559
  array(U)
4538
- ), Y = {
4560
+ ), H = {
4539
4561
  response: t.extend({
4540
- data: Q
4562
+ data: Y
4541
4563
  })
4542
- }, H = object({
4564
+ }, $ = object({
4543
4565
  id: uuid(),
4544
4566
  nseSymbol: string(),
4545
4567
  entryPrice: number(),
@@ -4558,7 +4580,7 @@ const p = object({
4558
4580
  stopLossHit: boolean().optional(),
4559
4581
  stopLossTimestamp: string().optional(),
4560
4582
  timeToStopLossMinutes: number$1().optional()
4561
- }), $ = {
4583
+ }), F = {
4562
4584
  params: object({
4563
4585
  runId: uuid()
4564
4586
  }),
@@ -4566,46 +4588,46 @@ const p = object({
4566
4588
  targetGainPercentage: number().optional()
4567
4589
  }),
4568
4590
  response: t.extend({
4569
- data: array(H)
4591
+ data: array($)
4570
4592
  })
4571
- }, F = object({
4593
+ }, B = object({
4572
4594
  start_datetime: n,
4573
4595
  end_datetime: n,
4574
4596
  timezone: o.optional(),
4575
4597
  name: string().optional(),
4576
4598
  tags: array(string().min(1).max(50)).optional()
4577
- }), B = object({
4599
+ }), K = object({
4578
4600
  id: uuid(),
4579
4601
  start_datetime: n,
4580
4602
  end_datetime: n,
4581
4603
  completed: boolean(),
4582
4604
  name: string().nullable().optional(),
4583
4605
  tags: array(string()).optional()
4584
- }), K = {
4585
- body: F,
4606
+ }), Z = {
4607
+ body: B,
4586
4608
  response: t.extend({
4587
- data: B
4609
+ data: K
4588
4610
  })
4589
- }, Z = object({
4611
+ }, V = object({
4590
4612
  completed: boolean().optional(),
4591
4613
  name: string().nullable().optional(),
4592
4614
  tags: array(string().min(1).max(50)).optional()
4593
- }), V = object({
4615
+ }), J = object({
4594
4616
  id: uuid(),
4595
4617
  start_datetime: string(),
4596
4618
  end_datetime: string(),
4597
4619
  completed: boolean(),
4598
4620
  name: string().nullable().optional(),
4599
4621
  tags: array(string()).optional()
4600
- }), J = {
4622
+ }), W = {
4601
4623
  params: object({
4602
4624
  runId: uuid()
4603
4625
  }),
4604
- body: Z,
4626
+ body: V,
4605
4627
  response: t.extend({
4606
- data: V
4628
+ data: J
4607
4629
  })
4608
- }, W = {
4630
+ }, X = {
4609
4631
  params: object({
4610
4632
  runId: uuid()
4611
4633
  }),
@@ -4614,14 +4636,14 @@ const p = object({
4614
4636
  id: uuid()
4615
4637
  })
4616
4638
  })
4617
- }, X = object({
4639
+ }, ee = object({
4618
4640
  nseSymbol: string(),
4619
4641
  entryPrice: number(),
4620
4642
  stopLossPrice: number(),
4621
4643
  takeProfitPrice: number(),
4622
4644
  datetime: n,
4623
4645
  timezone: o.optional()
4624
- }), ee = object({
4646
+ }), te = object({
4625
4647
  id: uuid(),
4626
4648
  nseSymbol: string(),
4627
4649
  entryPrice: number(),
@@ -4629,28 +4651,28 @@ const p = object({
4629
4651
  takeProfitPrice: number(),
4630
4652
  datetime: string(),
4631
4653
  runId: uuid()
4632
- }), te = {
4654
+ }), ne = {
4633
4655
  params: object({
4634
4656
  runId: uuid()
4635
4657
  }),
4636
- body: X,
4658
+ body: ee,
4637
4659
  response: t.extend({
4638
- data: ee
4660
+ data: te
4639
4661
  })
4640
- }, ne = {
4662
+ }, oe = {
4641
4663
  response: t.extend({
4642
4664
  data: array(string())
4643
4665
  })
4644
- }, oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4666
+ }, ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4645
4667
  __proto__: null,
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 = {
4668
+ createOrder: ne,
4669
+ createRun: Z,
4670
+ deleteRun: X,
4671
+ getRunOrders: F,
4672
+ getRunTags: oe,
4673
+ getRuns: H,
4674
+ updateRun: W
4675
+ }, Symbol.toStringTag, { value: "Module" })), re = {
4654
4676
  query: object({
4655
4677
  datetime: n,
4656
4678
  timezone: o.optional(),
@@ -4667,19 +4689,19 @@ const p = object({
4667
4689
  }).nullable()
4668
4690
  })
4669
4691
  })
4670
- }, re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4692
+ }, se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4671
4693
  __proto__: null,
4672
- getShortlists: ae
4673
- }, Symbol.toStringTag, { value: "Module" })), ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4694
+ getShortlists: re
4695
+ }, Symbol.toStringTag, { value: "Module" })), fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4674
4696
  __proto__: null,
4675
- v1_dashboard_auth_schemas: L,
4676
- v1_dashboard_available_datetimes_schemas: w,
4677
- v1_dashboard_candles_schemas: C,
4697
+ v1_dashboard_auth_schemas: G,
4698
+ v1_dashboard_available_datetimes_schemas: D,
4699
+ v1_dashboard_candles_schemas: M,
4678
4700
  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
4701
+ v1_dashboard_daily_unique_companies_schemas: E,
4702
+ v1_dashboard_quote_timeline_schemas: Q,
4703
+ v1_dashboard_runs_schemas: ae,
4704
+ v1_dashboard_shortlists_schemas: se
4683
4705
  }, Symbol.toStringTag, { value: "Module" }));
4684
4706
  ({
4685
4707
  response: t.extend({
@@ -7968,7 +7990,7 @@ const fetchCandles = ({
7968
7990
  );
7969
7991
  }
7970
7992
  try {
7971
- const validatedParams = je.getGrowwHistoricalCandles.query.parse(params);
7993
+ const validatedParams = he.getGrowwHistoricalCandles.query.parse(params);
7972
7994
  const headers = {
7973
7995
  Authorization: `Bearer ${developerToken}`
7974
7996
  };
@@ -7981,7 +8003,7 @@ const fetchCandles = ({
7981
8003
  if (currentTimezone) {
7982
8004
  headers["X-Current-Timezone"] = currentTimezone;
7983
8005
  }
7984
- const response = await axios.get(`${apiDomain}/v1/developer/groww/historical-candles`, {
8006
+ const response = await axios.get(`${apiDomain}/v1/developer/historical-candles`, {
7985
8007
  params: validatedParams,
7986
8008
  headers
7987
8009
  });
@@ -8012,7 +8034,7 @@ const fetchQuote = ({
8012
8034
  );
8013
8035
  }
8014
8036
  try {
8015
- const validatedParams = je.getGrowwQuote.query.parse(params);
8037
+ const validatedParams = he.getGrowwQuote.query.parse(params);
8016
8038
  const headers = {
8017
8039
  Authorization: `Bearer ${developerToken}`
8018
8040
  };
@@ -8025,7 +8047,7 @@ const fetchQuote = ({
8025
8047
  if (currentTimezone) {
8026
8048
  headers["X-Current-Timezone"] = currentTimezone;
8027
8049
  }
8028
- const response = await axios.get(`${apiDomain}/v1/developer/groww/quote`, {
8050
+ const response = await axios.get(`${apiDomain}/v1/developer/quote`, {
8029
8051
  params: validatedParams,
8030
8052
  headers
8031
8053
  });
@@ -8047,14 +8069,14 @@ const fetchQuoteTimeline = ({
8047
8069
  runId,
8048
8070
  currentTimestamp,
8049
8071
  currentTimezone = "Asia/Kolkata"
8050
- }) => async (symbol, date2) => {
8072
+ }) => async (symbol, end_datetime) => {
8051
8073
  if (!developerToken) {
8052
8074
  throw new Error("Developer token not found. Please set DEVELOPER_KEY environment variable.");
8053
8075
  }
8054
8076
  try {
8055
- const validatedParams = je.getGrowwQuoteTimeline.query.parse({
8077
+ const validatedParams = he.getGrowwQuoteTimeline.query.parse({
8056
8078
  symbol,
8057
- date: date2
8079
+ end_datetime
8058
8080
  });
8059
8081
  const headers = {
8060
8082
  Authorization: `Bearer ${developerToken}`
@@ -8068,7 +8090,7 @@ const fetchQuoteTimeline = ({
8068
8090
  if (currentTimezone) {
8069
8091
  headers["X-Current-Timezone"] = currentTimezone;
8070
8092
  }
8071
- const response = await axios.get(`${apiDomain}/v1/developer/groww/quote-timeline`, {
8093
+ const response = await axios.get(`${apiDomain}/v1/developer/quote-timeline`, {
8072
8094
  params: validatedParams,
8073
8095
  headers
8074
8096
  });
@@ -8099,7 +8121,7 @@ const fetchShortlist = ({
8099
8121
  );
8100
8122
  }
8101
8123
  try {
8102
- const validatedParams = he.getLists.query.parse(queryParams);
8124
+ const validatedParams = Se.getLists.query.parse(queryParams);
8103
8125
  const headers = {
8104
8126
  Authorization: `Bearer ${developerToken}`
8105
8127
  };
@@ -8143,7 +8165,7 @@ const fetchShortlistPersistence = ({
8143
8165
  );
8144
8166
  }
8145
8167
  try {
8146
- const validatedParams = Se.getShortlistPersistence.query.parse(queryParams);
8168
+ const validatedParams = ve.getShortlistPersistence.query.parse(queryParams);
8147
8169
  const headers = {
8148
8170
  Authorization: `Bearer ${developerToken}`
8149
8171
  };
@@ -8187,7 +8209,7 @@ const fetchNiftyQuote = ({
8187
8209
  throw new Error("Developer token not found. Please set DEVELOPER_KEY environment variable.");
8188
8210
  }
8189
8211
  try {
8190
- const validatedParams = je.getGrowwNiftyQuote.query.parse(params);
8212
+ const validatedParams = he.getGrowwNiftyQuote.query.parse(params);
8191
8213
  const headers = {
8192
8214
  Authorization: `Bearer ${developerToken}`
8193
8215
  };
@@ -8200,7 +8222,7 @@ const fetchNiftyQuote = ({
8200
8222
  if (currentTimezone) {
8201
8223
  headers["X-Current-Timezone"] = currentTimezone;
8202
8224
  }
8203
- const response = await axios.get(`${apiDomain}/v1/developer/groww/nifty`, {
8225
+ const response = await axios.get(`${apiDomain}/v1/developer/nifty`, {
8204
8226
  params: validatedParams,
8205
8227
  headers
8206
8228
  });
@@ -8216,6 +8238,50 @@ const fetchNiftyQuote = ({
8216
8238
  throw error;
8217
8239
  }
8218
8240
  };
8241
+ dayjs.extend(utc);
8242
+ dayjs.extend(timezone);
8243
+ const fetchNiftyQuoteTimeline = ({
8244
+ developerToken,
8245
+ apiDomain,
8246
+ runId,
8247
+ currentTimestamp,
8248
+ currentTimezone = "Asia/Kolkata"
8249
+ }) => async (end_datetime) => {
8250
+ if (!developerToken) {
8251
+ throw new Error("Developer token not found. Please set DEVELOPER_KEY environment variable.");
8252
+ }
8253
+ try {
8254
+ const validatedParams = he.getGrowwNiftyQuoteTimeline.query.parse({
8255
+ end_datetime
8256
+ });
8257
+ const headers = {
8258
+ Authorization: `Bearer ${developerToken}`
8259
+ };
8260
+ if (runId) {
8261
+ headers["X-Run-Id"] = runId;
8262
+ }
8263
+ if (currentTimestamp) {
8264
+ headers["X-Current-Timestamp"] = currentTimestamp;
8265
+ }
8266
+ if (currentTimezone) {
8267
+ headers["X-Current-Timezone"] = currentTimezone;
8268
+ }
8269
+ const response = await axios.get(`${apiDomain}/v1/developer/nifty-timeline`, {
8270
+ params: validatedParams,
8271
+ headers
8272
+ });
8273
+ return response.data.data.niftyTimeline;
8274
+ } catch (error) {
8275
+ if (axios.isAxiosError(error)) {
8276
+ logger.error(`Error fetching NIFTY timeline: ${error.message}`);
8277
+ throw new Error(
8278
+ `Failed to fetch NIFTY timeline: ${error.response?.data?.message || error.message}`
8279
+ );
8280
+ }
8281
+ logger.error(`Unexpected error fetching NIFTY timeline: ${error}`);
8282
+ throw error;
8283
+ }
8284
+ };
8219
8285
  function isRetryableError(error) {
8220
8286
  if (axios.isAxiosError(error)) {
8221
8287
  const axiosError = error;
@@ -8294,7 +8360,7 @@ const placeOrder = ({ runId, apiClient }) => async (data) => {
8294
8360
  try {
8295
8361
  await retryWithBackoff(
8296
8362
  async () => {
8297
- const validatedData = ve.v1_dashboard_runs_schemas.createOrder.body.parse(data);
8363
+ const validatedData = fe.v1_dashboard_runs_schemas.createOrder.body.parse(data);
8298
8364
  await apiClient.post(`/v1/dashboard/runs/${runId}/orders`, validatedData);
8299
8365
  logger.debug(`Order persisted for ${data.nseSymbol} in runId: ${runId}`);
8300
8366
  },
@@ -8626,6 +8692,13 @@ async function ganaka({
8626
8692
  currentTimestamp,
8627
8693
  currentTimezone: "Asia/Kolkata"
8628
8694
  }),
8695
+ fetchNiftyQuoteTimeline: fetchNiftyQuoteTimeline({
8696
+ developerToken,
8697
+ apiDomain,
8698
+ runId,
8699
+ currentTimestamp,
8700
+ currentTimezone: "Asia/Kolkata"
8701
+ }),
8629
8702
  fetchQuoteTimeline: fetchQuoteTimeline({
8630
8703
  developerToken,
8631
8704
  apiDomain,