@turtleclub/hooks 0.5.0-beta.83 → 0.5.0-beta.85

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
@@ -859,6 +859,21 @@ var import_query_key_factory3 = require("@lukemorales/query-key-factory");
859
859
 
860
860
  // src/v2/streams/schemas.ts
861
861
  var import_zod7 = require("zod");
862
+ var customArgsTokensPerUsdSchema = import_zod7.z.object({
863
+ tokensPerUSD: import_zod7.z.string(),
864
+ targetChainId: import_zod7.z.number(),
865
+ targetTokenAddress: import_zod7.z.string()
866
+ });
867
+ var customArgsAprSchema = import_zod7.z.object({
868
+ apr: import_zod7.z.string(),
869
+ targetChainId: import_zod7.z.number(),
870
+ targetTokenAddress: import_zod7.z.string()
871
+ });
872
+ var customArgsTokensPerDaySchema = import_zod7.z.object({
873
+ tokensPerDay: import_zod7.z.string(),
874
+ targetChainId: import_zod7.z.number(),
875
+ targetTokenAddress: import_zod7.z.string()
876
+ });
862
877
  var snapshotSchema = import_zod7.z.object({
863
878
  amountBase: import_zod7.z.string(),
864
879
  amountDistributed: import_zod7.z.string(),
@@ -869,7 +884,12 @@ var snapshotSchema = import_zod7.z.object({
869
884
  userCount: import_zod7.z.number().nullable().optional(),
870
885
  activeUserCount: import_zod7.z.number().optional(),
871
886
  tvl: import_zod7.z.string().nullable().optional(),
872
- baseTvl: import_zod7.z.string().nullable().optional()
887
+ baseTvl: import_zod7.z.string().nullable().optional(),
888
+ netTvl: import_zod7.z.string().nullable().optional(),
889
+ turtleTvl: import_zod7.z.string().nullable().optional(),
890
+ turtleNetTvl: import_zod7.z.string().nullable().optional(),
891
+ customMetrics: import_zod7.z.record(import_zod7.z.unknown()).optional(),
892
+ customArgs: import_zod7.z.union([customArgsTokensPerUsdSchema, customArgsAprSchema, customArgsTokensPerDaySchema]).optional()
873
893
  });
874
894
  var streamPointSchema = import_zod7.z.object({
875
895
  id: import_zod7.z.string(),
@@ -883,21 +903,6 @@ var streamPointSchema = import_zod7.z.object({
883
903
  deletedAt: import_zod7.z.string().nullable().optional(),
884
904
  organization: organizationSchema.nullable().optional()
885
905
  });
886
- var customArgsTokensPerUsdSchema = import_zod7.z.object({
887
- tokensPerUSD: import_zod7.z.string(),
888
- targetChainId: import_zod7.z.number(),
889
- targetTokenAddress: import_zod7.z.string()
890
- });
891
- var customArgsAprSchema = import_zod7.z.object({
892
- apr: import_zod7.z.string(),
893
- targetChainId: import_zod7.z.number(),
894
- targetTokenAddress: import_zod7.z.string()
895
- });
896
- var customArgsTokensPerDaySchema = import_zod7.z.object({
897
- tokensPerDay: import_zod7.z.string(),
898
- targetChainId: import_zod7.z.number(),
899
- targetTokenAddress: import_zod7.z.string()
900
- });
901
906
  var chainSchema2 = import_zod7.z.object({
902
907
  chainId: import_zod7.z.coerce.number(),
903
908
  ecosystem: import_zod7.z.string(),
@@ -4075,9 +4080,9 @@ function useWithdrawFlow({
4075
4080
  if (!selection.amountBigInt || !opportunity || !selection.selectedWithdrawTokenAddress) {
4076
4081
  return void 0;
4077
4082
  }
4078
- const tokenOut = opportunity.withdrawTokens?.length ? selection.selectedWithdrawTokenAddress : void 0;
4083
+ const tokenOut = withdrawTokens.length > 1 ? selection.selectedWithdrawTokenAddress : void 0;
4079
4084
  return earnWithdraw.withdraw(selection.amountBigInt, tokenOut);
4080
- }, [selection.amountBigInt, earnWithdraw, opportunity]);
4085
+ }, [selection.amountBigInt, selection.selectedWithdrawTokenAddress, earnWithdraw, opportunity, withdrawTokens]);
4081
4086
  return {
4082
4087
  selection,
4083
4088
  validation,