@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.cjs CHANGED
@@ -894,19 +894,27 @@ var import_query_key_factory3 = require("@lukemorales/query-key-factory");
894
894
 
895
895
  // src/v2/streams/schemas.ts
896
896
  var import_zod8 = require("zod");
897
- var customArgsRequiredFieldsSchema = import_zod8.z.object({
898
- targetTokenId: import_zod8.z.string().uuid(),
899
- targetToken: supportedTokenSchema.optional()
897
+ var customArgsBaseSchema = import_zod8.z.object({
898
+ targetTokenId: import_zod8.z.string().uuid()
900
899
  });
901
- var customArgsTokensPerUsdSchema = customArgsRequiredFieldsSchema.extend({
900
+ var snapshotCustomArgsTokensPerUsdSchema = customArgsBaseSchema.extend({
902
901
  tokensPerUSD: import_zod8.z.string()
903
902
  });
904
- var customArgsAprSchema = customArgsRequiredFieldsSchema.extend({
903
+ var snapshotCustomArgsAprSchema = customArgsBaseSchema.extend({
905
904
  apr: import_zod8.z.string()
906
905
  });
907
- var customArgsTokensPerDaySchema = customArgsRequiredFieldsSchema.extend({
906
+ var snapshotCustomArgsTokensPerDaySchema = customArgsBaseSchema.extend({
908
907
  tokensPerDay: import_zod8.z.string()
909
908
  });
909
+ var streamCustomArgsTokensPerUsdSchema = snapshotCustomArgsTokensPerUsdSchema.extend({
910
+ targetToken: supportedTokenSchema
911
+ });
912
+ var streamCustomArgsAprSchema = snapshotCustomArgsAprSchema.extend({
913
+ targetToken: supportedTokenSchema
914
+ });
915
+ var streamCustomArgsTokensPerDaySchema = snapshotCustomArgsTokensPerDaySchema.extend({
916
+ targetToken: supportedTokenSchema
917
+ });
910
918
  var snapshotSchema = import_zod8.z.object({
911
919
  amountBase: import_zod8.z.string(),
912
920
  amountDistributed: import_zod8.z.string(),
@@ -922,7 +930,11 @@ var snapshotSchema = import_zod8.z.object({
922
930
  turtleTvl: import_zod8.z.string().nullable().optional(),
923
931
  turtleNetTvl: import_zod8.z.string().nullable().optional(),
924
932
  customMetrics: import_zod8.z.record(import_zod8.z.unknown()).optional(),
925
- customArgs: import_zod8.z.union([customArgsTokensPerUsdSchema, customArgsAprSchema, customArgsTokensPerDaySchema]).optional()
933
+ customArgs: import_zod8.z.union([
934
+ snapshotCustomArgsTokensPerUsdSchema,
935
+ snapshotCustomArgsAprSchema,
936
+ snapshotCustomArgsTokensPerDaySchema
937
+ ]).optional()
926
938
  });
927
939
  var streamPointSchema = import_zod8.z.object({
928
940
  id: import_zod8.z.string(),
@@ -1006,9 +1018,9 @@ var streamSchema = import_zod8.z.object({
1006
1018
  createdAt: import_zod8.z.string().datetime(),
1007
1019
  creationConfirmedAt: import_zod8.z.string().datetime().nullable(),
1008
1020
  customArgs: import_zod8.z.union([
1009
- customArgsTokensPerUsdSchema,
1010
- customArgsAprSchema,
1011
- customArgsTokensPerDaySchema
1021
+ streamCustomArgsTokensPerUsdSchema,
1022
+ streamCustomArgsAprSchema,
1023
+ streamCustomArgsTokensPerDaySchema
1012
1024
  ]),
1013
1025
  endTimestamp: import_zod8.z.string().datetime().nullable(),
1014
1026
  fee: feeSchema.nullable(),
@@ -4457,10 +4469,12 @@ function useWidgetOpportunities(distributorId) {
4457
4469
  var import_react_query17 = require("@tanstack/react-query");
4458
4470
  function useGeocheck(options = {}) {
4459
4471
  const { enabled = true, staleTime, gcTime } = options;
4472
+ const { disableGeocheck } = apiClient.getConfig();
4460
4473
  return (0, import_react_query17.useQuery)({
4461
4474
  ...geocheckQueries.check,
4462
4475
  ...queryDefaults,
4463
- enabled,
4476
+ enabled: enabled && !disableGeocheck,
4477
+ ...disableGeocheck && { initialData: { canInteract: true } },
4464
4478
  staleTime: staleTime ?? 5 * 60 * 1e3,
4465
4479
  // 5 minutes
4466
4480
  gcTime: gcTime ?? 10 * 60 * 1e3
@@ -4879,9 +4893,10 @@ function TurtleHooksProvider({
4879
4893
  earnUrl,
4880
4894
  getToken,
4881
4895
  earnApiKey,
4882
- debug
4896
+ debug,
4897
+ disableGeocheck
4883
4898
  }) {
4884
- apiClient.configure({ apiUrl, earnUrl, getToken, earnApiKey, debug });
4899
+ apiClient.configure({ apiUrl, earnUrl, getToken, earnApiKey, debug, disableGeocheck });
4885
4900
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
4886
4901
  }
4887
4902