@tokenops/sdk 2.0.0-alpha.3 → 2.0.0-alpha.4

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.
Files changed (151) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +71 -35
  3. package/SUPPORT.md +1 -1
  4. package/dist/{chunk-NGU4JYIR.js → chunk-2ND7US2I.js} +1 -1
  5. package/dist/{chunk-U3TBQRT7.js → chunk-3ZSPRHR3.js} +55 -12
  6. package/dist/{chunk-BXX5TETM.js → chunk-67Q6KSVV.js} +4114 -3267
  7. package/dist/{chunk-JVNJSDQ4.cjs → chunk-6AYJRUGP.cjs} +7 -50
  8. package/dist/{chunk-AHU2HMNE.cjs → chunk-6FUHF73F.cjs} +5 -5
  9. package/dist/{chunk-NWFMBLSQ.js → chunk-7KY4K4PH.js} +1 -1
  10. package/dist/{chunk-YABHXJNH.cjs → chunk-ARZ5C3FS.cjs} +7 -7
  11. package/dist/{chunk-4IB4IY5Y.js → chunk-AX6MQAWU.js} +2 -2
  12. package/dist/{chunk-BPIVVCSQ.js → chunk-BSXEX2SH.js} +3 -3
  13. package/dist/{chunk-PK6Q6J5F.js → chunk-CHGY6B7L.js} +34 -81
  14. package/dist/{chunk-GKYZQJGP.cjs → chunk-DFK5GCJP.cjs} +55 -72
  15. package/dist/{chunk-4AWQJQXY.cjs → chunk-E4IV4M4E.cjs} +4126 -3279
  16. package/dist/{chunk-6HCT4QIX.js → chunk-GHGF65LN.js} +16 -13
  17. package/dist/{chunk-TWT3STIX.js → chunk-K3R27WX4.js} +8 -46
  18. package/dist/{chunk-GCJFAY4X.js → chunk-KJUNBOJQ.js} +52 -71
  19. package/dist/{chunk-6XOAYDC6.cjs → chunk-PO3A2AQX.cjs} +4 -4
  20. package/dist/{chunk-TND5NDV7.cjs → chunk-QHDMPT7I.cjs} +64 -19
  21. package/dist/{chunk-IEKTGJ4J.cjs → chunk-S47IBDTA.cjs} +36 -83
  22. package/dist/{chunk-UG5RKLU2.cjs → chunk-SUYBAF27.cjs} +1 -1
  23. package/dist/{chunk-WRWRA4TN.js → chunk-TWU7L5H7.js} +5 -48
  24. package/dist/{chunk-WJLECC22.cjs → chunk-UUSSWOPR.cjs} +9 -47
  25. package/dist/{chunk-YTIYTV4K.cjs → chunk-VHKMWWBA.cjs} +319 -40
  26. package/dist/{chunk-PG3WXT3K.cjs → chunk-YAL6JSAZ.cjs} +16 -13
  27. package/dist/{chunk-LEYYG4RF.js → chunk-YMWMIWBP.js} +315 -42
  28. package/dist/core/addresses.d.ts +4 -4
  29. package/dist/core/errors.d.ts +1 -1
  30. package/dist/core/index.d.ts +1 -0
  31. package/dist/core/pending.d.ts +57 -0
  32. package/dist/core/version.d.ts +1 -1
  33. package/dist/fhe/operators.d.ts +6 -5
  34. package/dist/fhe/types.d.ts +1 -1
  35. package/dist/fhe-airdrop/abis/airdrop-base.d.ts +81 -4
  36. package/dist/fhe-airdrop/abis/ecdsa.d.ts +101 -4
  37. package/dist/fhe-airdrop/abis/factory.d.ts +222 -4
  38. package/dist/fhe-airdrop/abis/merkle.d.ts +100 -4
  39. package/dist/fhe-airdrop/advanced/index.cjs +8 -4
  40. package/dist/fhe-airdrop/advanced/index.d.cts +1 -0
  41. package/dist/fhe-airdrop/advanced/index.d.ts +1 -0
  42. package/dist/fhe-airdrop/advanced/index.js +1 -1
  43. package/dist/fhe-airdrop/advanced/react/index.cjs +121 -143
  44. package/dist/fhe-airdrop/advanced/react/index.js +55 -77
  45. package/dist/fhe-airdrop/advanced/react/useClearCompliancePolicy.d.ts +3 -1
  46. package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +3 -1
  47. package/dist/fhe-airdrop/advanced/react/useFactoryComplianceDelegate.d.ts +2 -4
  48. package/dist/fhe-airdrop/advanced/react/useSetComplianceDelegate.d.ts +7 -7
  49. package/dist/fhe-airdrop/advanced/react/useSetComplianceManagerImpl.d.ts +3 -1
  50. package/dist/fhe-airdrop/advanced/react/useSetCompliancePolicy.d.ts +2 -1
  51. package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +3 -1
  52. package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +5 -4
  53. package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +3 -1
  54. package/dist/fhe-airdrop/advanced/react/useSetMaxGasFee.d.ts +7 -3
  55. package/dist/fhe-airdrop/airdrop-base.d.ts +95 -10
  56. package/dist/fhe-airdrop/campaign.d.ts +37 -73
  57. package/dist/fhe-airdrop/compliance-clone.d.ts +21 -0
  58. package/dist/fhe-airdrop/constants.d.ts +3 -1
  59. package/dist/fhe-airdrop/ecdsa.d.ts +67 -27
  60. package/dist/fhe-airdrop/encryption.d.ts +19 -6
  61. package/dist/fhe-airdrop/errors.d.ts +77 -2
  62. package/dist/fhe-airdrop/factory-params.d.ts +2361 -0
  63. package/dist/fhe-airdrop/factory.d.ts +142 -68
  64. package/dist/fhe-airdrop/guards.d.ts +110 -31
  65. package/dist/fhe-airdrop/index.cjs +79 -59
  66. package/dist/fhe-airdrop/index.d.cts +11 -9
  67. package/dist/fhe-airdrop/index.d.ts +11 -9
  68. package/dist/fhe-airdrop/index.js +5 -5
  69. package/dist/fhe-airdrop/merkle-tree.d.ts +9 -9
  70. package/dist/fhe-airdrop/merkle.d.ts +32 -11
  71. package/dist/fhe-airdrop/react/_shared.d.ts +12 -6
  72. package/dist/fhe-airdrop/react/index.cjs +294 -258
  73. package/dist/fhe-airdrop/react/index.d.cts +16 -9
  74. package/dist/fhe-airdrop/react/index.d.ts +16 -9
  75. package/dist/fhe-airdrop/react/index.js +114 -110
  76. package/dist/fhe-airdrop/react/keys.d.ts +46 -7
  77. package/dist/fhe-airdrop/react/useAccessEcdsaClaimAmount.d.ts +6 -3
  78. package/dist/fhe-airdrop/react/useAccessMerkleClaimAmount.d.ts +2 -2
  79. package/dist/fhe-airdrop/react/useAirdropConfig.d.ts +8 -3
  80. package/dist/fhe-airdrop/react/useAirdropPause.d.ts +5 -0
  81. package/dist/fhe-airdrop/react/useBuildMerkleCampaign.d.ts +4 -6
  82. package/dist/fhe-airdrop/react/useComplianceManager.d.ts +2 -2
  83. package/dist/fhe-airdrop/react/useComplianceManagerOf.d.ts +1 -2
  84. package/dist/fhe-airdrop/react/useCreateAndFundEcdsaAirdrop.d.ts +16 -11
  85. package/dist/fhe-airdrop/react/useCreateAndFundMerkleAirdrop.d.ts +23 -7
  86. package/dist/fhe-airdrop/react/useCreateEcdsaAirdrop.d.ts +13 -8
  87. package/dist/fhe-airdrop/react/useCreateMerkleAirdrop.d.ts +27 -7
  88. package/dist/fhe-airdrop/react/useDedupMode.d.ts +16 -0
  89. package/dist/fhe-airdrop/react/useDiscloseHandleToParty.d.ts +4 -3
  90. package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +6 -4
  91. package/dist/fhe-airdrop/react/useEcdsaClaimAndUnwrap.d.ts +15 -8
  92. package/dist/fhe-airdrop/react/useEcdsaDomain.d.ts +1 -1
  93. package/dist/fhe-airdrop/react/useEncryptCampaignAmounts.d.ts +5 -7
  94. package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +4 -1
  95. package/dist/fhe-airdrop/react/useFundAirdrop.d.ts +3 -4
  96. package/dist/fhe-airdrop/react/useGrantInstanceRoles.d.ts +2 -1
  97. package/dist/fhe-airdrop/react/useIsSignatureValid.d.ts +5 -4
  98. package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +4 -1
  99. package/dist/fhe-airdrop/react/useMerkleClaimAndUnwrap.d.ts +14 -3
  100. package/dist/fhe-airdrop/react/usePlanMerkleCampaign.d.ts +18 -3
  101. package/dist/fhe-airdrop/react/usePreflightClaim.d.ts +1 -1
  102. package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +34 -13
  103. package/dist/fhe-airdrop/react/useRescueERC20.d.ts +3 -3
  104. package/dist/fhe-airdrop/react/useRescueNativeToken.d.ts +23 -0
  105. package/dist/fhe-airdrop/react/useRotateMerkleRoot.d.ts +5 -2
  106. package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +4 -0
  107. package/dist/fhe-airdrop/react/useTokenOf.d.ts +29 -0
  108. package/dist/fhe-airdrop/react/useUnwrapRequest.d.ts +25 -0
  109. package/dist/fhe-airdrop/react/useWithdrawConfidential.d.ts +4 -0
  110. package/dist/fhe-airdrop/roles.d.ts +82 -7
  111. package/dist/fhe-airdrop/types.d.ts +109 -14
  112. package/dist/fhe-disperse/errors.d.ts +3 -3
  113. package/dist/fhe-disperse/index.cjs +22 -22
  114. package/dist/fhe-disperse/index.d.cts +2 -1
  115. package/dist/fhe-disperse/index.d.ts +2 -1
  116. package/dist/fhe-disperse/index.js +3 -3
  117. package/dist/fhe-disperse/react/index.cjs +27 -25
  118. package/dist/fhe-disperse/react/index.d.cts +2 -1
  119. package/dist/fhe-disperse/react/index.d.ts +2 -1
  120. package/dist/fhe-disperse/react/index.js +8 -6
  121. package/dist/fhe-disperse/react/useDisperse.d.ts +6 -2
  122. package/dist/fhe-disperse/react/useRegister.d.ts +9 -3
  123. package/dist/fhe-disperse/react/useSingletonWithdrawTokenFee.d.ts +7 -2
  124. package/dist/fhe-disperse/react/useWithdrawTokenFee.d.ts +7 -2
  125. package/dist/fhe-disperse/singleton.d.ts +33 -19
  126. package/dist/fhe-disperse/types.d.ts +48 -8
  127. package/dist/fhe-vesting/advanced/index.cjs +6 -6
  128. package/dist/fhe-vesting/advanced/index.js +4 -4
  129. package/dist/fhe-vesting/advanced/react/index.cjs +9 -9
  130. package/dist/fhe-vesting/advanced/react/index.js +6 -6
  131. package/dist/fhe-vesting/factory.d.ts +31 -8
  132. package/dist/fhe-vesting/index.cjs +23 -23
  133. package/dist/fhe-vesting/index.d.cts +3 -2
  134. package/dist/fhe-vesting/index.d.ts +3 -2
  135. package/dist/fhe-vesting/index.js +4 -4
  136. package/dist/fhe-vesting/manager.d.ts +27 -2
  137. package/dist/fhe-vesting/react/index.cjs +126 -126
  138. package/dist/fhe-vesting/react/index.d.cts +3 -2
  139. package/dist/fhe-vesting/react/index.d.ts +3 -2
  140. package/dist/fhe-vesting/react/index.js +5 -5
  141. package/dist/fhe-vesting/react/useCreateManager.d.ts +16 -9
  142. package/dist/fhe-vesting/react/useCreateManagerAndGetAddress.d.ts +9 -5
  143. package/dist/fhe-vesting/react/useSplitVesting.d.ts +9 -3
  144. package/dist/index.cjs +18 -18
  145. package/dist/index.js +1 -1
  146. package/dist/testnet-faucet/faucet.d.ts +3 -0
  147. package/dist/testnet-faucet/index.cjs +15 -15
  148. package/dist/testnet-faucet/index.js +3 -3
  149. package/dist/testnet-faucet/react/index.cjs +9 -9
  150. package/dist/testnet-faucet/react/index.js +4 -4
  151. package/package.json +1 -1
@@ -1,15 +1,17 @@
1
1
  /**
2
2
  * React/wagmi hooks for `@tokenops/sdk/fhe-airdrop`.
3
3
  *
4
- * v1 shipped 30 hooks, many one-line reads nobody called (Task 4 deleted all
5
- * of them). This subpath ships exactly the v2 hook list — a consumer who
4
+ * v1 shipped 30 hooks, many one-line reads nobody called, and v2 dropped all of
5
+ * them. This subpath ships exactly the v2 hook list — a consumer who
6
6
  * needs a headless method not wrapped here calls it directly from
7
7
  * `@tokenops/sdk/fhe-airdrop`; every hook below composes with wagmi
8
8
  * (`usePublicClient`, `useWalletClient`) and TanStack Query (`useQuery`,
9
9
  * `useMutation`) — no extra provider needed beyond the standard wagmi
10
10
  * `<WagmiProvider>` + `<QueryClientProvider>`.
11
11
  *
12
- * **Encryptor.** Only `useFundAirdrop` submits an encrypted input. Pass an
12
+ * **Encryptor.** The fund hooks (`useFundAirdrop`, `useCreateAndFund*`) and the
13
+ * campaign builders (`useBuildMerkleCampaign`, `usePlanMerkleCampaign`,
14
+ * `useRotateMerkleRoot`, `useEncryptCampaignAmounts`) encrypt. Pass an
13
15
  * explicit `encryptor` source (eager `Encryptor` or `() => Encryptor |
14
16
  * undefined`) — wire it as a lazy factory so the SDK picks up the live React
15
17
  * context at submit time (CLAUDE.md Pitfall #3):
@@ -56,6 +58,7 @@ export { useComplianceInfo, type ComplianceInfo, type UseComplianceInfoArgs, } f
56
58
  export { useComplianceManagerOf, type UseComplianceManagerOfArgs, } from "./useComplianceManagerOf.js";
57
59
  export { useComplianceRoleConstants, type ComplianceRoleConstants, type UseComplianceRoleConstantsArgs, } from "./useComplianceRoleConstants.js";
58
60
  export { useComplianceRoleMembers, type ComplianceRoleMembership, type UseComplianceRoleMembersArgs, } from "./useComplianceRoleMembers.js";
61
+ export { useDedupMode, type UseDedupModeArgs } from "./useDedupMode.js";
59
62
  export { useEcdsaDomain, type EcdsaDomain, type UseEcdsaDomainArgs } from "./useEcdsaDomain.js";
60
63
  export { useEffectiveDelegateToCompliance, type UseEffectiveDelegateToComplianceArgs, } from "./useEffectiveDelegateToCompliance.js";
61
64
  export { useIsActiveDelegate, type UseIsActiveDelegateArgs } from "./useIsActiveDelegate.js";
@@ -63,6 +66,7 @@ export { useIsMerkleRootMutable, type UseIsMerkleRootMutableArgs, } from "./useI
63
66
  export { useIsSignatureValid, type UseIsSignatureValidArgs } from "./useIsSignatureValid.js";
64
67
  export { usePreflightClaim, type UsePreflightClaimArgs } from "./usePreflightClaim.js";
65
68
  export { usePreflightCreateAirdrop, type PreflightCreateAirdropCommon, type UsePreflightCreateAirdropArgs, } from "./usePreflightCreateAirdrop.js";
69
+ export { useTokenOf, type UseTokenOfArgs } from "./useTokenOf.js";
66
70
  export { useCreateEcdsaAirdrop } from "./useCreateEcdsaAirdrop.js";
67
71
  export { useCreateMerkleAirdrop } from "./useCreateMerkleAirdrop.js";
68
72
  export { useFundAirdrop } from "./useFundAirdrop.js";
@@ -73,6 +77,7 @@ export { useGrantInstanceRoles, type GrantInstanceRolesArgs } from "./useGrantIn
73
77
  export { useAirdropPause, type AirdropPauseArgs } from "./useAirdropPause.js";
74
78
  export { useExtendClaimWindow } from "./useExtendClaimWindow.js";
75
79
  export { useWithdrawConfidential } from "./useWithdrawConfidential.js";
80
+ export { useRescueNativeToken } from "./useRescueNativeToken.js";
76
81
  export { useAddComplianceDelegate, type AddComplianceDelegateArgs, } from "./useAddComplianceDelegate.js";
77
82
  export { useAirdropGrantRole, type AirdropGrantRoleArgs } from "./useAirdropGrantRole.js";
78
83
  export { useAirdropRenounceRole, type AirdropRenounceRoleArgs } from "./useAirdropRenounceRole.js";
@@ -89,6 +94,7 @@ export { useDiscloseHandleToParty, type UseDiscloseHandleToPartyArgs, } from "./
89
94
  export { useEcdsaClaimAndUnwrap } from "./useEcdsaClaimAndUnwrap.js";
90
95
  export { useEncryptCampaignAmounts, type UseEncryptCampaignAmountsOptions, type UseEncryptCampaignAmountsArgs, } from "./useEncryptCampaignAmounts.js";
91
96
  export { useMerkleClaimAndUnwrap } from "./useMerkleClaimAndUnwrap.js";
97
+ export { useUnwrapRequest, type UseUnwrapRequestArgs } from "./useUnwrapRequest.js";
92
98
  export { usePlanMerkleCampaign, type UsePlanMerkleCampaignArgs } from "./usePlanMerkleCampaign.js";
93
99
  export { useRescueERC20, type RescueERC20Args } from "./useRescueERC20.js";
94
100
  export { useRescueOtherConfidentialToken, type RescueOtherConfidentialTokenArgs, } from "./useRescueOtherConfidentialToken.js";
@@ -105,17 +111,18 @@ export { useAccessMerkleClaimAmount } from "./useAccessMerkleClaimAmount.js";
105
111
  export { airdropQueryKey, airdropQueryKeyPrefix, type AirdropClientOptions, type AirdropHookOptions, type AirdropInstanceClientOptions, type AirdropInstanceHookOptions, type EcdsaAirdropInstanceClientOptions, type EcdsaAirdropInstanceHookOptions, } from "./_shared.js";
106
112
  export { encryptUint64, encryptUint64Batch, resolveEncryptor, signClaimAuthorization, type Encryptor, type EncryptorSource, type EncryptUint64Args, type EncryptUint64BatchArgs, type FheValueInput, } from "../encryption.js";
107
113
  export type { EncryptedInput, EncryptedInputs, EncryptedViewResult } from "../../fhe/types.js";
108
- export type { CreateAirdropArgs, CreateAirdropResult, EcdsaAirdropParams, MerkleAirdropParams, CommonAirdropParams, BuiltCampaign, CampaignEntry, CampaignRecipient, } from "../types.js";
114
+ export type { CreateAirdropArgs, AirdropVariantParams, CreateAirdropResult, CreateCommitments, CreateMerkleAirdropArgs, EcdsaAirdropParams, MerkleAirdropParams, CommonAirdropParams, BuiltCampaign, CampaignEntry, CampaignRecipient, PendingCreateAirdropResult, } from "../types.js";
115
+ export type { MinedWrite, PendingWrite, ReceiptMode } from "../../core/pending.js";
109
116
  export type { EcdsaClaimArgs, Eip712Domain, GetClaimAmountArgs as EcdsaGetClaimAmountArgs, } from "../ecdsa.js";
110
117
  export type { GetClaimAmountArgs as MerkleGetClaimAmountArgs } from "../merkle.js";
111
118
  export type { MerkleClaimArgs } from "../merkle.js";
112
119
  export { buildMerkleTree, leafOf, type BuildMerkleTreeArgs, type BuiltMerkleTree, type LeafOfArgs, type MerkleLeafInput, } from "../merkle-tree.js";
113
120
  export type { FundInput } from "../factory.js";
114
- export type { WriteAccountOverride } from "../airdrop-base.js";
115
- export { buildMerkleCampaign, encryptCampaignAmounts, planMerkleCampaign, rotateMerkleRoot, validateCampaignRecipients, type BuildMerkleCampaignArgs, type CampaignSubmitterOption, type EncryptCampaignAmountsArgs, type EncryptedCampaignLeaf, type PlanMerkleCampaignArgs, type PlannedCampaign, type RotatedCampaign, type RotateMerkleRootArgs, } from "../campaign.js";
116
- export { preflightClaim, preflightCreate, type AirdropRegistry, type ClaimPreflightTarget, type EcdsaClaimPreflightSignature, type PreflightClaimArgs, type PreflightCreateArgs, } from "../guards.js";
121
+ export type { UnwrapRequest, WriteAccountOverride } from "../airdrop-base.js";
122
+ export { buildMerkleCampaign, encryptCampaignAmounts, MERKLE_BATCH_LIMIT, planMerkleCampaign, rotateMerkleRoot, validateCampaignRecipients, type BuildMerkleCampaignArgs, type EncryptCampaignAmountsArgs, type EncryptedCampaignLeaf, type PlanMerkleCampaignArgs, type PlannedCampaign, type RotatedCampaign, type RotateMerkleRootArgs, } from "../campaign.js";
123
+ export { preflightClaim, preflightCreate, type AirdropRegistry, type ClaimPreflightTarget, type EcdsaClaimPreflightSignature, type PreflightClaimArgs, type PreflightCreateArgs, type PreflightCreateResult, } from "../guards.js";
117
124
  export type { PreflightResult } from "../../core/preflight.js";
118
125
  export { grantInstanceRoles, planInstanceRoleSplit, type InstanceRoleAssignment, type RoleGrantOutcome, type RoleGrantStep, type RoleName, } from "../roles.js";
119
- export { type DedupMode, type DeploymentMode } from "../constants.js";
126
+ export { UINT96_MAX, type DedupMode, type DeploymentMode } from "../constants.js";
120
127
  export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, ContractRevertError, PausedError, AccessDeniedError, OperatorNotApprovedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../../core/errors.js";
121
- export { AlreadyClaimedError, ClaimNotStartedError, ClaimWindowClosedError, DedupIdConsumedError, FeeCollectorSelfAdministeredError, MerkleUupsUnsupportedError, NonStockWrapperError, PredictionDriftError, SaltCollisionError, SignatureExpiredError, UnauthorizedRedirectError, UpgradeabilityNotAllowedError, type AirdropVariant, } from "../errors.js";
128
+ export { AlreadyClaimedError, ClaimNotStartedError, ClaimWindowClosedError, ClawbackRequiresPauseError, CreateCommitmentMismatchError, DedupIdConsumedError, FeeCollectorSelfAdministeredError, GasFeeNotAcceptedError, MerkleUupsUnsupportedError, NativeRescueRequiresZeroFeeError, NonStockWrapperError, PredictionDriftError, SaltCollisionError, SignatureExpiredError, UnauthorizedRedirectError, UnrecognisedAirdropError, UpgradeabilityNotAllowedError, type AirdropVariant, } from "../errors.js";
@@ -1,15 +1,17 @@
1
1
  /**
2
2
  * React/wagmi hooks for `@tokenops/sdk/fhe-airdrop`.
3
3
  *
4
- * v1 shipped 30 hooks, many one-line reads nobody called (Task 4 deleted all
5
- * of them). This subpath ships exactly the v2 hook list — a consumer who
4
+ * v1 shipped 30 hooks, many one-line reads nobody called, and v2 dropped all of
5
+ * them. This subpath ships exactly the v2 hook list — a consumer who
6
6
  * needs a headless method not wrapped here calls it directly from
7
7
  * `@tokenops/sdk/fhe-airdrop`; every hook below composes with wagmi
8
8
  * (`usePublicClient`, `useWalletClient`) and TanStack Query (`useQuery`,
9
9
  * `useMutation`) — no extra provider needed beyond the standard wagmi
10
10
  * `<WagmiProvider>` + `<QueryClientProvider>`.
11
11
  *
12
- * **Encryptor.** Only `useFundAirdrop` submits an encrypted input. Pass an
12
+ * **Encryptor.** The fund hooks (`useFundAirdrop`, `useCreateAndFund*`) and the
13
+ * campaign builders (`useBuildMerkleCampaign`, `usePlanMerkleCampaign`,
14
+ * `useRotateMerkleRoot`, `useEncryptCampaignAmounts`) encrypt. Pass an
13
15
  * explicit `encryptor` source (eager `Encryptor` or `() => Encryptor |
14
16
  * undefined`) — wire it as a lazy factory so the SDK picks up the live React
15
17
  * context at submit time (CLAUDE.md Pitfall #3):
@@ -56,6 +58,7 @@ export { useComplianceInfo, type ComplianceInfo, type UseComplianceInfoArgs, } f
56
58
  export { useComplianceManagerOf, type UseComplianceManagerOfArgs, } from "./useComplianceManagerOf.js";
57
59
  export { useComplianceRoleConstants, type ComplianceRoleConstants, type UseComplianceRoleConstantsArgs, } from "./useComplianceRoleConstants.js";
58
60
  export { useComplianceRoleMembers, type ComplianceRoleMembership, type UseComplianceRoleMembersArgs, } from "./useComplianceRoleMembers.js";
61
+ export { useDedupMode, type UseDedupModeArgs } from "./useDedupMode.js";
59
62
  export { useEcdsaDomain, type EcdsaDomain, type UseEcdsaDomainArgs } from "./useEcdsaDomain.js";
60
63
  export { useEffectiveDelegateToCompliance, type UseEffectiveDelegateToComplianceArgs, } from "./useEffectiveDelegateToCompliance.js";
61
64
  export { useIsActiveDelegate, type UseIsActiveDelegateArgs } from "./useIsActiveDelegate.js";
@@ -63,6 +66,7 @@ export { useIsMerkleRootMutable, type UseIsMerkleRootMutableArgs, } from "./useI
63
66
  export { useIsSignatureValid, type UseIsSignatureValidArgs } from "./useIsSignatureValid.js";
64
67
  export { usePreflightClaim, type UsePreflightClaimArgs } from "./usePreflightClaim.js";
65
68
  export { usePreflightCreateAirdrop, type PreflightCreateAirdropCommon, type UsePreflightCreateAirdropArgs, } from "./usePreflightCreateAirdrop.js";
69
+ export { useTokenOf, type UseTokenOfArgs } from "./useTokenOf.js";
66
70
  export { useCreateEcdsaAirdrop } from "./useCreateEcdsaAirdrop.js";
67
71
  export { useCreateMerkleAirdrop } from "./useCreateMerkleAirdrop.js";
68
72
  export { useFundAirdrop } from "./useFundAirdrop.js";
@@ -73,6 +77,7 @@ export { useGrantInstanceRoles, type GrantInstanceRolesArgs } from "./useGrantIn
73
77
  export { useAirdropPause, type AirdropPauseArgs } from "./useAirdropPause.js";
74
78
  export { useExtendClaimWindow } from "./useExtendClaimWindow.js";
75
79
  export { useWithdrawConfidential } from "./useWithdrawConfidential.js";
80
+ export { useRescueNativeToken } from "./useRescueNativeToken.js";
76
81
  export { useAddComplianceDelegate, type AddComplianceDelegateArgs, } from "./useAddComplianceDelegate.js";
77
82
  export { useAirdropGrantRole, type AirdropGrantRoleArgs } from "./useAirdropGrantRole.js";
78
83
  export { useAirdropRenounceRole, type AirdropRenounceRoleArgs } from "./useAirdropRenounceRole.js";
@@ -89,6 +94,7 @@ export { useDiscloseHandleToParty, type UseDiscloseHandleToPartyArgs, } from "./
89
94
  export { useEcdsaClaimAndUnwrap } from "./useEcdsaClaimAndUnwrap.js";
90
95
  export { useEncryptCampaignAmounts, type UseEncryptCampaignAmountsOptions, type UseEncryptCampaignAmountsArgs, } from "./useEncryptCampaignAmounts.js";
91
96
  export { useMerkleClaimAndUnwrap } from "./useMerkleClaimAndUnwrap.js";
97
+ export { useUnwrapRequest, type UseUnwrapRequestArgs } from "./useUnwrapRequest.js";
92
98
  export { usePlanMerkleCampaign, type UsePlanMerkleCampaignArgs } from "./usePlanMerkleCampaign.js";
93
99
  export { useRescueERC20, type RescueERC20Args } from "./useRescueERC20.js";
94
100
  export { useRescueOtherConfidentialToken, type RescueOtherConfidentialTokenArgs, } from "./useRescueOtherConfidentialToken.js";
@@ -105,17 +111,18 @@ export { useAccessMerkleClaimAmount } from "./useAccessMerkleClaimAmount.js";
105
111
  export { airdropQueryKey, airdropQueryKeyPrefix, type AirdropClientOptions, type AirdropHookOptions, type AirdropInstanceClientOptions, type AirdropInstanceHookOptions, type EcdsaAirdropInstanceClientOptions, type EcdsaAirdropInstanceHookOptions, } from "./_shared.js";
106
112
  export { encryptUint64, encryptUint64Batch, resolveEncryptor, signClaimAuthorization, type Encryptor, type EncryptorSource, type EncryptUint64Args, type EncryptUint64BatchArgs, type FheValueInput, } from "../encryption.js";
107
113
  export type { EncryptedInput, EncryptedInputs, EncryptedViewResult } from "../../fhe/types.js";
108
- export type { CreateAirdropArgs, CreateAirdropResult, EcdsaAirdropParams, MerkleAirdropParams, CommonAirdropParams, BuiltCampaign, CampaignEntry, CampaignRecipient, } from "../types.js";
114
+ export type { CreateAirdropArgs, AirdropVariantParams, CreateAirdropResult, CreateCommitments, CreateMerkleAirdropArgs, EcdsaAirdropParams, MerkleAirdropParams, CommonAirdropParams, BuiltCampaign, CampaignEntry, CampaignRecipient, PendingCreateAirdropResult, } from "../types.js";
115
+ export type { MinedWrite, PendingWrite, ReceiptMode } from "../../core/pending.js";
109
116
  export type { EcdsaClaimArgs, Eip712Domain, GetClaimAmountArgs as EcdsaGetClaimAmountArgs, } from "../ecdsa.js";
110
117
  export type { GetClaimAmountArgs as MerkleGetClaimAmountArgs } from "../merkle.js";
111
118
  export type { MerkleClaimArgs } from "../merkle.js";
112
119
  export { buildMerkleTree, leafOf, type BuildMerkleTreeArgs, type BuiltMerkleTree, type LeafOfArgs, type MerkleLeafInput, } from "../merkle-tree.js";
113
120
  export type { FundInput } from "../factory.js";
114
- export type { WriteAccountOverride } from "../airdrop-base.js";
115
- export { buildMerkleCampaign, encryptCampaignAmounts, planMerkleCampaign, rotateMerkleRoot, validateCampaignRecipients, type BuildMerkleCampaignArgs, type CampaignSubmitterOption, type EncryptCampaignAmountsArgs, type EncryptedCampaignLeaf, type PlanMerkleCampaignArgs, type PlannedCampaign, type RotatedCampaign, type RotateMerkleRootArgs, } from "../campaign.js";
116
- export { preflightClaim, preflightCreate, type AirdropRegistry, type ClaimPreflightTarget, type EcdsaClaimPreflightSignature, type PreflightClaimArgs, type PreflightCreateArgs, } from "../guards.js";
121
+ export type { UnwrapRequest, WriteAccountOverride } from "../airdrop-base.js";
122
+ export { buildMerkleCampaign, encryptCampaignAmounts, MERKLE_BATCH_LIMIT, planMerkleCampaign, rotateMerkleRoot, validateCampaignRecipients, type BuildMerkleCampaignArgs, type EncryptCampaignAmountsArgs, type EncryptedCampaignLeaf, type PlanMerkleCampaignArgs, type PlannedCampaign, type RotatedCampaign, type RotateMerkleRootArgs, } from "../campaign.js";
123
+ export { preflightClaim, preflightCreate, type AirdropRegistry, type ClaimPreflightTarget, type EcdsaClaimPreflightSignature, type PreflightClaimArgs, type PreflightCreateArgs, type PreflightCreateResult, } from "../guards.js";
117
124
  export type { PreflightResult } from "../../core/preflight.js";
118
125
  export { grantInstanceRoles, planInstanceRoleSplit, type InstanceRoleAssignment, type RoleGrantOutcome, type RoleGrantStep, type RoleName, } from "../roles.js";
119
- export { type DedupMode, type DeploymentMode } from "../constants.js";
126
+ export { UINT96_MAX, type DedupMode, type DeploymentMode } from "../constants.js";
120
127
  export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, ContractRevertError, PausedError, AccessDeniedError, OperatorNotApprovedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../../core/errors.js";
121
- export { AlreadyClaimedError, ClaimNotStartedError, ClaimWindowClosedError, DedupIdConsumedError, FeeCollectorSelfAdministeredError, MerkleUupsUnsupportedError, NonStockWrapperError, PredictionDriftError, SaltCollisionError, SignatureExpiredError, UnauthorizedRedirectError, UpgradeabilityNotAllowedError, type AirdropVariant, } from "../errors.js";
128
+ export { AlreadyClaimedError, ClaimNotStartedError, ClaimWindowClosedError, ClawbackRequiresPauseError, CreateCommitmentMismatchError, DedupIdConsumedError, FeeCollectorSelfAdministeredError, GasFeeNotAcceptedError, MerkleUupsUnsupportedError, NativeRescueRequiresZeroFeeError, NonStockWrapperError, PredictionDriftError, SaltCollisionError, SignatureExpiredError, UnauthorizedRedirectError, UnrecognisedAirdropError, UpgradeabilityNotAllowedError, type AirdropVariant, } from "../errors.js";
@@ -1,15 +1,15 @@
1
- import { grantInstanceRoles, buildMerkleCampaign, encryptCampaignAmounts, planMerkleCampaign, rotateMerkleRoot } from '../../chunk-GCJFAY4X.js';
2
- export { buildMerkleCampaign, buildMerkleTree, encryptCampaignAmounts, grantInstanceRoles, leafOf, planInstanceRoleSplit, planMerkleCampaign, rotateMerkleRoot, validateCampaignRecipients } from '../../chunk-GCJFAY4X.js';
3
- import { useMemoAirdropBaseClient, airdropQueryKey, useMemoMerkleAirdropClient, useMemoAirdropFactoryClient, AIRDROP_FN, airdropKeys, useMemoEcdsaAirdropClient, useMemoComplianceManagerClient } from '../../chunk-U3TBQRT7.js';
4
- export { airdropQueryKey, airdropQueryKeyPrefix } from '../../chunk-U3TBQRT7.js';
5
- import { resolveEncryptor, signClaimAuthorization } from '../../chunk-BXX5TETM.js';
6
- export { encryptUint64, encryptUint64Batch, resolveEncryptor, signClaimAuthorization } from '../../chunk-BXX5TETM.js';
7
- import { preflightClaim, preflightCreate } from '../../chunk-LEYYG4RF.js';
8
- export { AlreadyClaimedError, ClaimNotStartedError, ClaimWindowClosedError, DedupIdConsumedError, FeeCollectorSelfAdministeredError, MerkleUupsUnsupportedError, NonStockWrapperError, PredictionDriftError, SaltCollisionError, SignatureExpiredError, UnauthorizedRedirectError, UpgradeabilityNotAllowedError, preflightClaim, preflightCreate } from '../../chunk-LEYYG4RF.js';
1
+ import { grantInstanceRoles, buildMerkleCampaign, encryptCampaignAmounts, planMerkleCampaign, rotateMerkleRoot } from '../../chunk-KJUNBOJQ.js';
2
+ export { MERKLE_BATCH_LIMIT, buildMerkleCampaign, buildMerkleTree, encryptCampaignAmounts, grantInstanceRoles, leafOf, planInstanceRoleSplit, planMerkleCampaign, rotateMerkleRoot, validateCampaignRecipients } from '../../chunk-KJUNBOJQ.js';
3
+ import { useMemoAirdropBaseClient, airdropQueryKey, airdropKeys, useMemoMerkleAirdropClient, useMemoAirdropFactoryClient, AIRDROP_FN, useMemoEcdsaAirdropClient, useMemoComplianceManagerClient, staleUntilNonZeroAddress, invalidateAfterCreate } from '../../chunk-3ZSPRHR3.js';
4
+ export { airdropQueryKey, airdropQueryKeyPrefix } from '../../chunk-3ZSPRHR3.js';
5
+ import { resolveEncryptor, signClaimAuthorization } from '../../chunk-67Q6KSVV.js';
6
+ export { encryptUint64, encryptUint64Batch, resolveEncryptor, signClaimAuthorization } from '../../chunk-67Q6KSVV.js';
7
+ import { preflightClaim, preflightCreate } from '../../chunk-YMWMIWBP.js';
8
+ export { AlreadyClaimedError, ClaimNotStartedError, ClaimWindowClosedError, ClawbackRequiresPauseError, CreateCommitmentMismatchError, DedupIdConsumedError, FeeCollectorSelfAdministeredError, GasFeeNotAcceptedError, MerkleUupsUnsupportedError, NativeRescueRequiresZeroFeeError, NonStockWrapperError, PredictionDriftError, SaltCollisionError, SignatureExpiredError, UINT96_MAX, UnauthorizedRedirectError, UnrecognisedAirdropError, UpgradeabilityNotAllowedError, preflightClaim, preflightCreate } from '../../chunk-YMWMIWBP.js';
9
9
  import '../../chunk-ZWXJTBZO.js';
10
- import '../../chunk-NWFMBLSQ.js';
10
+ import '../../chunk-7KY4K4PH.js';
11
11
  import '../../chunk-4RAAATVY.js';
12
- import '../../chunk-6HCT4QIX.js';
12
+ import '../../chunk-GHGF65LN.js';
13
13
  import '../../chunk-ZA673I3O.js';
14
14
  import '../../chunk-KWFFIJYX.js';
15
15
  import { MissingClientError, MissingWalletClientError } from '../../chunk-QBJ7O2B4.js';
@@ -31,7 +31,7 @@ function useAirdropWindow(args) {
31
31
  const { client, chainId } = useMemoAirdropBaseClient(args);
32
32
  return useQuery({
33
33
  ...args.query,
34
- queryKey: airdropQueryKey({ chainId, address: args.address, fn: "window", args: [] }),
34
+ queryKey: airdropKeys.window({ chainId, address: args.address }),
35
35
  queryFn: async () => {
36
36
  const [startTime, endTime, hasStarted, hasEnded, isActive] = await Promise.all([
37
37
  client.startTime(),
@@ -49,7 +49,7 @@ function useAirdropPaused(args) {
49
49
  const { client, chainId } = useMemoAirdropBaseClient(args);
50
50
  return useQuery({
51
51
  ...args.query,
52
- queryKey: airdropQueryKey({ chainId, address: args.address, fn: "paused", args: [] }),
52
+ queryKey: airdropKeys.paused({ chainId, address: args.address }),
53
53
  queryFn: () => client.paused(),
54
54
  enabled: Boolean(client && (args.query?.enabled ?? true))
55
55
  });
@@ -58,7 +58,7 @@ function useAirdropGasFee(args) {
58
58
  const { client, chainId } = useMemoAirdropBaseClient(args);
59
59
  return useQuery({
60
60
  ...args.query,
61
- queryKey: airdropQueryKey({ chainId, address: args.address, fn: "gasFee", args: [] }),
61
+ queryKey: airdropKeys.gasFee({ chainId, address: args.address }),
62
62
  queryFn: () => client.gasFee(),
63
63
  enabled: Boolean(client && (args.query?.enabled ?? true))
64
64
  });
@@ -68,12 +68,7 @@ function useAirdropHasRole(args) {
68
68
  const { client, chainId } = useMemoAirdropBaseClient(base);
69
69
  return useQuery({
70
70
  ...args.query,
71
- queryKey: airdropQueryKey({
72
- chainId,
73
- address: args.address,
74
- fn: "hasRole",
75
- args: [role, holder]
76
- }),
71
+ queryKey: airdropKeys.hasRole({ chainId, address: args.address }, role, holder),
77
72
  queryFn: () => client.hasRole({ role, holder }),
78
73
  enabled: Boolean(client && role && holder && (args.query?.enabled ?? true))
79
74
  });
@@ -82,7 +77,7 @@ function useMerkleRoot(args) {
82
77
  const { client, chainId } = useMemoMerkleAirdropClient(args);
83
78
  return useQuery({
84
79
  ...args.query,
85
- queryKey: airdropQueryKey({ chainId, address: args.address, fn: "merkleRoot", args: [] }),
80
+ queryKey: airdropKeys.merkleRoot({ chainId, address: args.address }),
86
81
  queryFn: () => client.merkleRoot(),
87
82
  enabled: Boolean(client && (args.query?.enabled ?? true))
88
83
  });
@@ -92,12 +87,7 @@ function useClaimedAmount(args) {
92
87
  const { client, chainId } = useMemoMerkleAirdropClient(base);
93
88
  return useQuery({
94
89
  ...args.query,
95
- queryKey: airdropQueryKey({
96
- chainId,
97
- address: args.address,
98
- fn: "getClaimedAmount",
99
- args: [account]
100
- }),
90
+ queryKey: airdropKeys.claimedAmount({ chainId, address: args.address }, account),
101
91
  queryFn: () => client.getClaimedAmount(account),
102
92
  enabled: Boolean(client && account && (args.query?.enabled ?? true))
103
93
  });
@@ -120,7 +110,7 @@ function useFactoryFees(args = {}) {
120
110
  const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(args);
121
111
  return useQuery({
122
112
  ...args.query,
123
- queryKey: airdropQueryKey({ chainId, address: resolvedAddress, fn: "fees", args: [] }),
113
+ queryKey: airdropKeys.fees({ chainId, address: resolvedAddress }),
124
114
  queryFn: async () => {
125
115
  const [feeCollector, defaultGasFee, maxGasFee] = await Promise.all([
126
116
  client.feeCollector(),
@@ -152,12 +142,7 @@ function useFactoryRegistry(args = {}) {
152
142
  const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
153
143
  return useQuery({
154
144
  ...args.query,
155
- queryKey: airdropQueryKey({
156
- chainId,
157
- address: resolvedAddress,
158
- fn: "registry",
159
- args: [offset, limit]
160
- }),
145
+ queryKey: airdropKeys.registry({ chainId, address: resolvedAddress }, offset, limit),
161
146
  queryFn: async () => {
162
147
  const [count, items] = await Promise.all([
163
148
  client.airdropCount(),
@@ -191,12 +176,7 @@ function useEffectiveUpgradeable(args = {}) {
191
176
  const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
192
177
  return useQuery({
193
178
  ...args.query,
194
- queryKey: airdropQueryKey({
195
- chainId,
196
- address: resolvedAddress,
197
- fn: "effectiveUpgradeable",
198
- args: [creator]
199
- }),
179
+ queryKey: airdropKeys.effectiveUpgradeable({ chainId, address: resolvedAddress }, creator),
200
180
  queryFn: () => client.effectiveUpgradeable(creator),
201
181
  enabled: Boolean(client && creator && (args.query?.enabled ?? true))
202
182
  });
@@ -208,12 +188,22 @@ function useAirdropConfig(args) {
208
188
  ...args.query,
209
189
  queryKey: airdropKeys.config({ chainId, address: args.address }),
210
190
  queryFn: async () => {
211
- const [token, airdropType, unwrappable, complianceManager, gasFee] = await Promise.all([
191
+ const [
192
+ token,
193
+ airdropType,
194
+ unwrappable,
195
+ complianceManager,
196
+ gasFee,
197
+ canExtendClaimWindow,
198
+ deploymentBlockNumber
199
+ ] = await Promise.all([
212
200
  client.token(),
213
201
  client.airdropType(),
214
202
  client.unwrappable(),
215
203
  client.complianceManager(),
216
- client.gasFee()
204
+ client.gasFee(),
205
+ client.canExtendClaimWindow(),
206
+ client.deploymentBlockNumber()
217
207
  ]);
218
208
  return {
219
209
  token,
@@ -221,7 +211,9 @@ function useAirdropConfig(args) {
221
211
  variant: airdropType === 1 ? "merkle" : "ecdsa",
222
212
  unwrappable,
223
213
  complianceManager,
224
- gasFee
214
+ gasFee,
215
+ canExtendClaimWindow,
216
+ deploymentBlockNumber
225
217
  };
226
218
  },
227
219
  enabled: Boolean(client && (args.query?.enabled ?? true))
@@ -363,14 +355,9 @@ function useComplianceManagerOf(args = {}) {
363
355
  const { airdrop, ...base } = args;
364
356
  const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
365
357
  return useQuery({
366
- staleTime: Infinity,
358
+ staleTime: staleUntilNonZeroAddress,
367
359
  ...args.query,
368
- queryKey: airdropQueryKey({
369
- chainId,
370
- address: resolvedAddress,
371
- fn: "complianceManagerOf",
372
- args: [airdrop]
373
- }),
360
+ queryKey: airdropKeys.complianceManagerOf({ chainId, address: resolvedAddress }, airdrop),
374
361
  queryFn: () => client.complianceManagerOf(airdrop),
375
362
  enabled: Boolean(client && airdrop && (args.query?.enabled ?? true))
376
363
  });
@@ -413,6 +400,16 @@ function useComplianceRoleMembers(args) {
413
400
  enabled: Boolean(client && role && (args.query?.enabled ?? true))
414
401
  });
415
402
  }
403
+ function useDedupMode(args) {
404
+ const { client, chainId } = useMemoEcdsaAirdropClient(args);
405
+ return useQuery({
406
+ staleTime: Infinity,
407
+ ...args.query,
408
+ queryKey: airdropKeys.dedupMode({ chainId, address: args.address }),
409
+ queryFn: () => client.readDedupMode(),
410
+ enabled: Boolean(client && (args.query?.enabled ?? true))
411
+ });
412
+ }
416
413
  function useEcdsaDomain(args) {
417
414
  const { client, chainId } = useMemoEcdsaAirdropClient(args);
418
415
  return useQuery({
@@ -437,12 +434,10 @@ function useEffectiveDelegateToCompliance(args = {}) {
437
434
  const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
438
435
  return useQuery({
439
436
  ...args.query,
440
- queryKey: airdropQueryKey({
441
- chainId,
442
- address: resolvedAddress,
443
- fn: "effectiveDelegateToCompliance",
444
- args: [creator]
445
- }),
437
+ queryKey: airdropKeys.effectiveDelegateToCompliance(
438
+ { chainId, address: resolvedAddress },
439
+ creator
440
+ ),
446
441
  queryFn: () => client.effectiveDelegateToCompliance(creator),
447
442
  enabled: Boolean(client && creator && (args.query?.enabled ?? true))
448
443
  });
@@ -533,6 +528,13 @@ function usePreflightCreateAirdrop(args = {}) {
533
528
  args.creator,
534
529
  args.userSalt,
535
530
  args.expectedInitCodeHash,
531
+ // Pinned commitments change the reported quote.
532
+ args.expected,
533
+ // A plan pins three scalars; `entries` never changes the verdict, and
534
+ // keying on it would hash every ciphertext on each render.
535
+ args.variant === "merkle" ? args.plan?.predictedAddress : void 0,
536
+ args.variant === "merkle" ? args.plan?.root : void 0,
537
+ args.variant === "merkle" ? args.plan?.initCodeHashAfter : void 0,
536
538
  // `params` IS key-affecting here, unlike in the predict hooks: the
537
539
  // stock-wrapper probe reads `common.token` / `common.unwrappable`.
538
540
  args.params
@@ -544,15 +546,27 @@ function usePreflightCreateAirdrop(args = {}) {
544
546
  mode: args.mode,
545
547
  creator: args.creator,
546
548
  userSalt: args.userSalt,
547
- expectedInitCodeHash: args.expectedInitCodeHash
549
+ expectedInitCodeHash: args.expectedInitCodeHash,
550
+ expected: args.expected
548
551
  };
549
- return args.variant === "merkle" ? preflightCreate({ ...common, variant: "merkle", params: args.params }) : preflightCreate({ ...common, variant: "ecdsa", params: args.params });
552
+ return args.variant === "merkle" ? preflightCreate({ ...common, variant: "merkle", params: args.params, plan: args.plan }) : preflightCreate({ ...common, variant: "ecdsa", params: args.params });
550
553
  },
551
554
  enabled: Boolean(
552
555
  client && args.variant && args.params && args.mode && args.creator && args.userSalt && (args.query?.enabled ?? true)
553
556
  )
554
557
  });
555
558
  }
559
+ function useTokenOf(args = {}) {
560
+ const { airdrop, ...base } = args;
561
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
562
+ return useQuery({
563
+ staleTime: staleUntilNonZeroAddress,
564
+ ...args.query,
565
+ queryKey: airdropKeys.tokenOf({ chainId, address: resolvedAddress }, airdrop),
566
+ queryFn: () => client.tokenOf(airdrop),
567
+ enabled: Boolean(client && airdrop && (args.query?.enabled ?? true))
568
+ });
569
+ }
556
570
  function useCreateEcdsaAirdrop(options = {}) {
557
571
  const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
558
572
  const queryClient = useQueryClient();
@@ -563,13 +577,8 @@ function useCreateEcdsaAirdrop(options = {}) {
563
577
  }
564
578
  return client.createEcdsaAirdrop(args);
565
579
  },
566
- onSuccess: () => {
567
- void queryClient.invalidateQueries({
568
- queryKey: airdropKeys.registryAll({ chainId, address: resolvedAddress })
569
- });
570
- void queryClient.invalidateQueries({
571
- queryKey: airdropKeys.isAirdropAll({ chainId, address: resolvedAddress })
572
- });
580
+ onSuccess: (result) => {
581
+ invalidateAfterCreate(queryClient, { chainId, address: resolvedAddress }, result.airdrop);
573
582
  }
574
583
  });
575
584
  }
@@ -583,13 +592,8 @@ function useCreateMerkleAirdrop(options = {}) {
583
592
  }
584
593
  return client.createMerkleAirdrop(args);
585
594
  },
586
- onSuccess: () => {
587
- void queryClient.invalidateQueries({
588
- queryKey: airdropKeys.registryAll({ chainId, address: resolvedAddress })
589
- });
590
- void queryClient.invalidateQueries({
591
- queryKey: airdropKeys.isAirdropAll({ chainId, address: resolvedAddress })
592
- });
595
+ onSuccess: (result) => {
596
+ invalidateAfterCreate(queryClient, { chainId, address: resolvedAddress }, result.airdrop);
593
597
  }
594
598
  });
595
599
  }
@@ -635,12 +639,7 @@ function useMerkleClaim(options) {
635
639
  onSuccess: (_hash, _variables, context) => {
636
640
  if (!context?.account) return;
637
641
  void queryClient.invalidateQueries({
638
- queryKey: airdropQueryKey({
639
- chainId,
640
- address: options.address,
641
- fn: "getClaimedAmount",
642
- args: [context.account]
643
- })
642
+ queryKey: airdropKeys.claimedAmount({ chainId, address: options.address }, context.account)
644
643
  });
645
644
  }
646
645
  });
@@ -657,12 +656,7 @@ function useSetMerkleRoot(options) {
657
656
  },
658
657
  onSuccess: () => {
659
658
  void queryClient.invalidateQueries({
660
- queryKey: airdropQueryKey({
661
- chainId,
662
- address: options.address,
663
- fn: "merkleRoot",
664
- args: []
665
- })
659
+ queryKey: airdropKeys.merkleRoot({ chainId, address: options.address })
666
660
  });
667
661
  }
668
662
  });
@@ -699,12 +693,9 @@ function useAirdropPause(options) {
699
693
  return paused ? client.pause(rest) : client.unpause(rest);
700
694
  },
701
695
  onSuccess: () => {
702
- void queryClient.invalidateQueries({
703
- queryKey: airdropQueryKey({ chainId, address: options.address, fn: "paused", args: [] })
704
- });
705
- void queryClient.invalidateQueries({
706
- queryKey: airdropQueryKey({ chainId, address: options.address, fn: "window", args: [] })
707
- });
696
+ const scope = { chainId, address: options.address };
697
+ void queryClient.invalidateQueries({ queryKey: airdropKeys.paused(scope) });
698
+ void queryClient.invalidateQueries({ queryKey: airdropKeys.window(scope) });
708
699
  }
709
700
  });
710
701
  }
@@ -720,7 +711,7 @@ function useExtendClaimWindow(options) {
720
711
  },
721
712
  onSuccess: () => {
722
713
  void queryClient.invalidateQueries({
723
- queryKey: airdropQueryKey({ chainId, address: options.address, fn: "window", args: [] })
714
+ queryKey: airdropKeys.window({ chainId, address: options.address })
724
715
  });
725
716
  }
726
717
  });
@@ -736,6 +727,17 @@ function useWithdrawConfidential(options) {
736
727
  }
737
728
  });
738
729
  }
730
+ function useRescueNativeToken(options) {
731
+ const { client } = useMemoAirdropBaseClient(options);
732
+ return useMutation({
733
+ mutationFn: async (args) => {
734
+ if (!client) {
735
+ throw new MissingClientError("useRescueNativeToken", "airdrop-base");
736
+ }
737
+ return client.rescueNativeToken(args);
738
+ }
739
+ });
740
+ }
739
741
  function useAddComplianceDelegate(options) {
740
742
  const { client, chainId } = useMemoComplianceManagerClient(options);
741
743
  const queryClient = useQueryClient();
@@ -845,8 +847,7 @@ function useBuildMerkleCampaign(options = {}) {
845
847
  mutationFn: async (args) => buildMerkleCampaign({
846
848
  instance: args.instance,
847
849
  recipients: args.recipients,
848
- encryptor: () => resolveEncryptor(encryptorSourceRef.current),
849
- ...args.submitter !== void 0 ? { submitter: args.submitter } : {}
850
+ encryptor: () => resolveEncryptor(encryptorSourceRef.current)
850
851
  })
851
852
  });
852
853
  }
@@ -921,13 +922,8 @@ function useCreateAndFundEcdsaAirdrop(options = {}) {
921
922
  }
922
923
  return client.createAndFundEcdsaAirdrop(args);
923
924
  },
924
- onSuccess: () => {
925
- void queryClient.invalidateQueries({
926
- queryKey: airdropKeys.registryAll({ chainId, address: resolvedAddress })
927
- });
928
- void queryClient.invalidateQueries({
929
- queryKey: airdropKeys.isAirdropAll({ chainId, address: resolvedAddress })
930
- });
925
+ onSuccess: (result) => {
926
+ invalidateAfterCreate(queryClient, { chainId, address: resolvedAddress }, result.airdrop);
931
927
  }
932
928
  });
933
929
  }
@@ -941,13 +937,8 @@ function useCreateAndFundMerkleAirdrop(options = {}) {
941
937
  }
942
938
  return client.createAndFundMerkleAirdrop(args);
943
939
  },
944
- onSuccess: () => {
945
- void queryClient.invalidateQueries({
946
- queryKey: airdropKeys.registryAll({ chainId, address: resolvedAddress })
947
- });
948
- void queryClient.invalidateQueries({
949
- queryKey: airdropKeys.isAirdropAll({ chainId, address: resolvedAddress })
950
- });
940
+ onSuccess: (result) => {
941
+ invalidateAfterCreate(queryClient, { chainId, address: resolvedAddress }, result.airdrop);
951
942
  }
952
943
  });
953
944
  }
@@ -986,8 +977,7 @@ function useEncryptCampaignAmounts(options = {}) {
986
977
  mutationFn: async (args) => encryptCampaignAmounts({
987
978
  instance: args.instance,
988
979
  recipients: args.recipients,
989
- encryptor: () => resolveEncryptor(encryptorSourceRef.current),
990
- ...args.submitter !== void 0 ? { submitter: args.submitter } : {}
980
+ encryptor: () => resolveEncryptor(encryptorSourceRef.current)
991
981
  })
992
982
  });
993
983
  }
@@ -1017,6 +1007,21 @@ function useMerkleClaimAndUnwrap(options) {
1017
1007
  }
1018
1008
  });
1019
1009
  }
1010
+ function useUnwrapRequest(args) {
1011
+ const { client, chainId } = useMemoAirdropBaseClient(args);
1012
+ return useQuery({
1013
+ staleTime: Infinity,
1014
+ ...args.query,
1015
+ queryKey: airdropQueryKey({
1016
+ chainId,
1017
+ address: args.address,
1018
+ fn: "unwrapRequest",
1019
+ args: [args.hash]
1020
+ }),
1021
+ queryFn: () => client.readUnwrapRequest(args.hash),
1022
+ enabled: Boolean(client && args.hash && (args.query?.enabled ?? true))
1023
+ });
1024
+ }
1020
1025
  function usePlanMerkleCampaign(options = {}) {
1021
1026
  const { client, resolutionError } = useMemoAirdropFactoryClient(options);
1022
1027
  const encryptorSourceRef = useRef(options.encryptor);
@@ -1089,7 +1094,6 @@ function useRotateMerkleRoot(options) {
1089
1094
  airdrop: client,
1090
1095
  recipients: args.recipients,
1091
1096
  encryptor: () => resolveEncryptor(encryptorSourceRef.current),
1092
- ...args.submitter !== void 0 ? { submitter: args.submitter } : {},
1093
1097
  ...args.account !== void 0 ? { account: args.account } : {}
1094
1098
  });
1095
1099
  },
@@ -1201,4 +1205,4 @@ function useAccessMerkleClaimAmount(options) {
1201
1205
  });
1202
1206
  }
1203
1207
 
1204
- export { useAccessEcdsaClaimAmount, useAccessMerkleClaimAmount, useAddComplianceDelegate, useAdminBatchDiscloseBalanceToParties, useAdminDiscloseBalanceToParty, useAdminGetCurrentBalance, useAirdropConfig, useAirdropDeploymentMode, useAirdropGasFee, useAirdropGrantRole, useAirdropHasRole, useAirdropPause, useAirdropPaused, useAirdropRenounceRole, useAirdropRevokeRole, useAirdropRoleAdmin, useAirdropRoleConstants, useAirdropRoleMembers, useAirdropToken, useAirdropUpgradeToAndCall, useAirdropWindow, useBatchDiscloseHandlesToParty, useBuildMerkleCampaign, useClaimedAmount, useComplianceGrantRole, useComplianceHasRole, useComplianceInfo, useComplianceManager, useComplianceManagerOf, useComplianceRenounceRole, useComplianceRevokeRole, useComplianceRoleConstants, useComplianceRoleMembers, useCreateAndFundEcdsaAirdrop, useCreateAndFundMerkleAirdrop, useCreateEcdsaAirdrop, useCreateMerkleAirdrop, useDiscloseHandleToParty, useEcdsaClaim, useEcdsaClaimAndUnwrap, useEcdsaDomain, useEffectiveDelegateToCompliance, useEffectiveUpgradeable, useEncryptCampaignAmounts, useExtendClaimWindow, useFactoryFees, useFactoryRegistry, useFundAirdrop, useGrantInstanceRoles, useIsActiveDelegate, useIsAirdrop, useIsMerkleRootMutable, useIsSignatureValid, useMerkleClaim, useMerkleClaimAndUnwrap, useMerkleRoot, usePlanMerkleCampaign, usePreflightClaim, usePreflightCreateAirdrop, useRefreshComplianceBalance, useRescueERC20, useRescueOtherConfidentialToken, useResolveGasFee, useRevokeComplianceDelegate, useRotateMerkleRoot, useSetMerkleRoot, useSignClaimAuthorization, useWithdrawConfidential, useWithdrawGasFee };
1208
+ export { useAccessEcdsaClaimAmount, useAccessMerkleClaimAmount, useAddComplianceDelegate, useAdminBatchDiscloseBalanceToParties, useAdminDiscloseBalanceToParty, useAdminGetCurrentBalance, useAirdropConfig, useAirdropDeploymentMode, useAirdropGasFee, useAirdropGrantRole, useAirdropHasRole, useAirdropPause, useAirdropPaused, useAirdropRenounceRole, useAirdropRevokeRole, useAirdropRoleAdmin, useAirdropRoleConstants, useAirdropRoleMembers, useAirdropToken, useAirdropUpgradeToAndCall, useAirdropWindow, useBatchDiscloseHandlesToParty, useBuildMerkleCampaign, useClaimedAmount, useComplianceGrantRole, useComplianceHasRole, useComplianceInfo, useComplianceManager, useComplianceManagerOf, useComplianceRenounceRole, useComplianceRevokeRole, useComplianceRoleConstants, useComplianceRoleMembers, useCreateAndFundEcdsaAirdrop, useCreateAndFundMerkleAirdrop, useCreateEcdsaAirdrop, useCreateMerkleAirdrop, useDedupMode, useDiscloseHandleToParty, useEcdsaClaim, useEcdsaClaimAndUnwrap, useEcdsaDomain, useEffectiveDelegateToCompliance, useEffectiveUpgradeable, useEncryptCampaignAmounts, useExtendClaimWindow, useFactoryFees, useFactoryRegistry, useFundAirdrop, useGrantInstanceRoles, useIsActiveDelegate, useIsAirdrop, useIsMerkleRootMutable, useIsSignatureValid, useMerkleClaim, useMerkleClaimAndUnwrap, useMerkleRoot, usePlanMerkleCampaign, usePreflightClaim, usePreflightCreateAirdrop, useRefreshComplianceBalance, useRescueERC20, useRescueNativeToken, useRescueOtherConfidentialToken, useResolveGasFee, useRevokeComplianceDelegate, useRotateMerkleRoot, useSetMerkleRoot, useSignClaimAuthorization, useTokenOf, useUnwrapRequest, useWithdrawConfidential, useWithdrawGasFee };