@turtleclub/hooks 0.5.0-beta.92 → 0.5.0-beta.94

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.js CHANGED
@@ -577,19 +577,27 @@ import { createQueryKeys as createQueryKeys3 } from "@lukemorales/query-key-fact
577
577
 
578
578
  // src/v2/streams/schemas.ts
579
579
  import { z as z8 } from "zod";
580
- var customArgsRequiredFieldsSchema = z8.object({
581
- targetTokenId: z8.string().uuid(),
582
- targetToken: supportedTokenSchema.optional()
580
+ var customArgsBaseSchema = z8.object({
581
+ targetTokenId: z8.string().uuid()
583
582
  });
584
- var customArgsTokensPerUsdSchema = customArgsRequiredFieldsSchema.extend({
583
+ var snapshotCustomArgsTokensPerUsdSchema = customArgsBaseSchema.extend({
585
584
  tokensPerUSD: z8.string()
586
585
  });
587
- var customArgsAprSchema = customArgsRequiredFieldsSchema.extend({
586
+ var snapshotCustomArgsAprSchema = customArgsBaseSchema.extend({
588
587
  apr: z8.string()
589
588
  });
590
- var customArgsTokensPerDaySchema = customArgsRequiredFieldsSchema.extend({
589
+ var snapshotCustomArgsTokensPerDaySchema = customArgsBaseSchema.extend({
591
590
  tokensPerDay: z8.string()
592
591
  });
592
+ var streamCustomArgsTokensPerUsdSchema = snapshotCustomArgsTokensPerUsdSchema.extend({
593
+ targetToken: supportedTokenSchema
594
+ });
595
+ var streamCustomArgsAprSchema = snapshotCustomArgsAprSchema.extend({
596
+ targetToken: supportedTokenSchema
597
+ });
598
+ var streamCustomArgsTokensPerDaySchema = snapshotCustomArgsTokensPerDaySchema.extend({
599
+ targetToken: supportedTokenSchema
600
+ });
593
601
  var snapshotSchema = z8.object({
594
602
  amountBase: z8.string(),
595
603
  amountDistributed: z8.string(),
@@ -605,7 +613,11 @@ var snapshotSchema = z8.object({
605
613
  turtleTvl: z8.string().nullable().optional(),
606
614
  turtleNetTvl: z8.string().nullable().optional(),
607
615
  customMetrics: z8.record(z8.unknown()).optional(),
608
- customArgs: z8.union([customArgsTokensPerUsdSchema, customArgsAprSchema, customArgsTokensPerDaySchema]).optional()
616
+ customArgs: z8.union([
617
+ snapshotCustomArgsTokensPerUsdSchema,
618
+ snapshotCustomArgsAprSchema,
619
+ snapshotCustomArgsTokensPerDaySchema
620
+ ]).optional()
609
621
  });
610
622
  var streamPointSchema = z8.object({
611
623
  id: z8.string(),
@@ -689,9 +701,9 @@ var streamSchema = z8.object({
689
701
  createdAt: z8.string().datetime(),
690
702
  creationConfirmedAt: z8.string().datetime().nullable(),
691
703
  customArgs: z8.union([
692
- customArgsTokensPerUsdSchema,
693
- customArgsAprSchema,
694
- customArgsTokensPerDaySchema
704
+ streamCustomArgsTokensPerUsdSchema,
705
+ streamCustomArgsAprSchema,
706
+ streamCustomArgsTokensPerDaySchema
695
707
  ]),
696
708
  endTimestamp: z8.string().datetime().nullable(),
697
709
  fee: feeSchema.nullable(),
@@ -4140,10 +4152,12 @@ function useWidgetOpportunities(distributorId) {
4140
4152
  import { useQuery as useQuery12 } from "@tanstack/react-query";
4141
4153
  function useGeocheck(options = {}) {
4142
4154
  const { enabled = true, staleTime, gcTime } = options;
4155
+ const { disableGeocheck } = apiClient.getConfig();
4143
4156
  return useQuery12({
4144
4157
  ...geocheckQueries.check,
4145
4158
  ...queryDefaults,
4146
- enabled,
4159
+ enabled: enabled && !disableGeocheck,
4160
+ ...disableGeocheck && { initialData: { canInteract: true } },
4147
4161
  staleTime: staleTime ?? 5 * 60 * 1e3,
4148
4162
  // 5 minutes
4149
4163
  gcTime: gcTime ?? 10 * 60 * 1e3
@@ -4565,9 +4579,10 @@ function TurtleHooksProvider({
4565
4579
  earnUrl,
4566
4580
  getToken,
4567
4581
  earnApiKey,
4568
- debug
4582
+ debug,
4583
+ disableGeocheck
4569
4584
  }) {
4570
- apiClient.configure({ apiUrl, earnUrl, getToken, earnApiKey, debug });
4585
+ apiClient.configure({ apiUrl, earnUrl, getToken, earnApiKey, debug, disableGeocheck });
4571
4586
  return /* @__PURE__ */ jsx(Fragment, { children });
4572
4587
  }
4573
4588