@tokenops/sdk 1.5.1 → 2.0.0-alpha.1

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 (222) hide show
  1. package/CHANGELOG.md +198 -2
  2. package/CONTRIBUTING.md +4 -2
  3. package/README.md +146 -90
  4. package/SECURITY.md +7 -1
  5. package/SUPPORT.md +47 -0
  6. package/dist/{chunk-YQIBBEFJ.js → chunk-335Z2W67.js} +1 -1
  7. package/dist/{chunk-2NCLOQ56.cjs → chunk-3QHNYEQD.cjs} +77 -0
  8. package/dist/chunk-456VDDA3.js +370 -0
  9. package/dist/{chunk-SG65XWH7.js → chunk-4RAAATVY.js} +1 -3
  10. package/dist/{chunk-6BMP4ICG.js → chunk-4TSDNZQ3.js} +60 -2
  11. package/dist/{chunk-PUPKNW3R.cjs → chunk-5576FRT3.cjs} +30 -6
  12. package/dist/{chunk-AOP6HMPW.js → chunk-6GNR22OV.js} +75 -1
  13. package/dist/{chunk-NTZY6IB7.js → chunk-6NAVMWZQ.js} +4 -3
  14. package/dist/{chunk-C7BRZXJA.cjs → chunk-6PXXGACR.cjs} +8 -7
  15. package/dist/{chunk-IJFQ5L4I.js → chunk-74QFZ5MK.js} +4 -3
  16. package/dist/chunk-7AFPOE7N.cjs +59 -0
  17. package/dist/chunk-AXIPOR3C.js +56 -0
  18. package/dist/chunk-CTED3MTR.cjs +380 -0
  19. package/dist/{chunk-XGGTQQFH.js → chunk-DZHYSUGY.js} +28 -7
  20. package/dist/{chunk-OXTLPTO3.js → chunk-EAJ7SYHE.js} +4 -3
  21. package/dist/{chunk-V2PXZVBF.cjs → chunk-FGEB7RMY.cjs} +4 -4
  22. package/dist/chunk-GKKDAW44.js +8823 -0
  23. package/dist/{chunk-2PWNH3UE.js → chunk-H5POPGOZ.js} +63 -5
  24. package/dist/{chunk-W7IGCOVL.cjs → chunk-JQYC66TO.cjs} +9 -8
  25. package/dist/{chunk-PFXURMBZ.cjs → chunk-JZLGCTGK.cjs} +68 -8
  26. package/dist/{chunk-JYOTGRSO.cjs → chunk-KFRDLKMA.cjs} +61 -1
  27. package/dist/chunk-M4IT6DNJ.cjs +608 -0
  28. package/dist/{chunk-KLKI352M.cjs → chunk-MVDQMV25.cjs} +0 -3
  29. package/dist/chunk-NCVX3K2N.cjs +161 -0
  30. package/dist/chunk-NWFMBLSQ.js +4 -0
  31. package/dist/chunk-O5676ZWY.js +585 -0
  32. package/dist/chunk-PUX5VXDB.cjs +8845 -0
  33. package/dist/{chunk-IXLO7GO5.js → chunk-TWT3STIX.js} +46 -80
  34. package/dist/chunk-UG5RKLU2.cjs +6 -0
  35. package/dist/chunk-VP2B4WM2.js +154 -0
  36. package/dist/{chunk-5X5WL5CU.cjs → chunk-WJLECC22.cjs} +51 -88
  37. package/dist/{chunk-WENHUPZC.cjs → chunk-XAYGD4E4.cjs} +9 -8
  38. package/dist/core/addresses.d.ts +15 -3
  39. package/dist/core/brands.d.ts +8 -2
  40. package/dist/core/errors.d.ts +71 -10
  41. package/dist/core/preflight.d.ts +1 -0
  42. package/dist/fhe/erc7984-abi.d.ts +1 -0
  43. package/dist/fhe/index.cjs +34 -13
  44. package/dist/fhe/index.d.cts +1 -0
  45. package/dist/fhe/index.d.ts +1 -0
  46. package/dist/fhe/index.js +19 -6
  47. package/dist/fhe/mock-erc7984.d.ts +4 -4
  48. package/dist/fhe/operators.d.ts +160 -3
  49. package/dist/fhe/react/index.cjs +14 -0
  50. package/dist/fhe/react/index.d.cts +2 -0
  51. package/dist/fhe/react/index.d.ts +2 -0
  52. package/dist/fhe/react/index.js +6 -0
  53. package/dist/fhe/react/useEnsureOperator.d.ts +56 -0
  54. package/dist/fhe/react/useIsOperator.d.ts +54 -0
  55. package/dist/fhe/sepolia-encryptor-web.d.ts +18 -3
  56. package/dist/fhe/types.d.ts +6 -0
  57. package/dist/fhe-airdrop/abis/{cloneable.d.ts → airdrop-base.d.ts} +254 -396
  58. package/dist/fhe-airdrop/abis/compliance.d.ts +422 -0
  59. package/dist/fhe-airdrop/abis/ecdsa.d.ts +1316 -0
  60. package/dist/fhe-airdrop/abis/factory.d.ts +1319 -190
  61. package/dist/fhe-airdrop/abis/index.d.ts +5 -2
  62. package/dist/fhe-airdrop/abis/merkle.d.ts +1238 -0
  63. package/dist/fhe-airdrop/advanced/index.cjs +10 -12
  64. package/dist/fhe-airdrop/advanced/index.d.cts +34 -11
  65. package/dist/fhe-airdrop/advanced/index.d.ts +34 -11
  66. package/dist/fhe-airdrop/advanced/index.js +2 -8
  67. package/dist/fhe-airdrop/advanced/react/index.cjs +34 -48
  68. package/dist/fhe-airdrop/advanced/react/index.d.cts +9 -3
  69. package/dist/fhe-airdrop/advanced/react/index.d.ts +9 -3
  70. package/dist/fhe-airdrop/advanced/react/index.js +33 -48
  71. package/dist/fhe-airdrop/advanced/react/usePredictEcdsaAirdropAddress.d.ts +33 -0
  72. package/dist/fhe-airdrop/advanced/react/usePredictMerkleAirdropAddress.d.ts +27 -0
  73. package/dist/fhe-airdrop/airdrop-base.d.ts +600 -0
  74. package/dist/fhe-airdrop/campaign.d.ts +297 -0
  75. package/dist/fhe-airdrop/compliance.d.ts +302 -0
  76. package/dist/fhe-airdrop/constants.d.ts +33 -0
  77. package/dist/fhe-airdrop/ecdsa.d.ts +263 -0
  78. package/dist/fhe-airdrop/encryption.d.ts +92 -14
  79. package/dist/fhe-airdrop/errors.d.ts +245 -15
  80. package/dist/fhe-airdrop/factory.d.ts +533 -274
  81. package/dist/fhe-airdrop/guards.d.ts +273 -0
  82. package/dist/fhe-airdrop/index.cjs +1089 -33
  83. package/dist/fhe-airdrop/index.d.cts +46 -8
  84. package/dist/fhe-airdrop/index.d.ts +46 -8
  85. package/dist/fhe-airdrop/index.js +929 -7
  86. package/dist/fhe-airdrop/merkle-tree.d.ts +103 -0
  87. package/dist/fhe-airdrop/merkle.d.ts +180 -0
  88. package/dist/fhe-airdrop/react/_shared.d.ts +144 -71
  89. package/dist/fhe-airdrop/react/index.cjs +364 -413
  90. package/dist/fhe-airdrop/react/index.d.cts +53 -72
  91. package/dist/fhe-airdrop/react/index.d.ts +53 -72
  92. package/dist/fhe-airdrop/react/index.js +258 -369
  93. package/dist/fhe-airdrop/react/useAirdropGasFee.d.ts +10 -5
  94. package/dist/fhe-airdrop/react/useAirdropHasRole.d.ts +15 -6
  95. package/dist/fhe-airdrop/react/useAirdropPause.d.ts +30 -0
  96. package/dist/fhe-airdrop/react/useAirdropPaused.d.ts +17 -0
  97. package/dist/fhe-airdrop/react/useAirdropToken.d.ts +11 -4
  98. package/dist/fhe-airdrop/react/useAirdropWindow.d.ts +37 -0
  99. package/dist/fhe-airdrop/react/useClaimedAmount.d.ts +29 -0
  100. package/dist/fhe-airdrop/react/useComplianceManager.d.ts +16 -0
  101. package/dist/fhe-airdrop/react/useCreateEcdsaAirdrop.d.ts +28 -0
  102. package/dist/fhe-airdrop/react/useCreateMerkleAirdrop.d.ts +25 -0
  103. package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +23 -0
  104. package/dist/fhe-airdrop/react/useEffectiveUpgradeable.d.ts +20 -0
  105. package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +17 -12
  106. package/dist/fhe-airdrop/react/useFactoryFees.d.ts +28 -0
  107. package/dist/fhe-airdrop/react/useFactoryRegistry.d.ts +35 -0
  108. package/dist/fhe-airdrop/react/useFundAirdrop.d.ts +35 -0
  109. package/dist/fhe-airdrop/react/useGrantInstanceRoles.d.ts +35 -0
  110. package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +34 -0
  111. package/dist/fhe-airdrop/react/useMerkleRoot.d.ts +15 -0
  112. package/dist/fhe-airdrop/react/useSetMerkleRoot.d.ts +22 -0
  113. package/dist/fhe-airdrop/react/useWithdrawConfidential.d.ts +23 -0
  114. package/dist/fhe-airdrop/roles.d.ts +147 -0
  115. package/dist/fhe-airdrop/types.d.ts +68 -55
  116. package/dist/fhe-disperse/errors.d.ts +55 -0
  117. package/dist/fhe-disperse/index.cjs +34 -25
  118. package/dist/fhe-disperse/index.d.cts +1 -1
  119. package/dist/fhe-disperse/index.d.ts +1 -1
  120. package/dist/fhe-disperse/index.js +6 -5
  121. package/dist/fhe-disperse/react/index.cjs +42 -23
  122. package/dist/fhe-disperse/react/index.d.cts +3 -1
  123. package/dist/fhe-disperse/react/index.d.ts +3 -1
  124. package/dist/fhe-disperse/react/index.js +9 -6
  125. package/dist/fhe-vesting/advanced/index.cjs +8 -7
  126. package/dist/fhe-vesting/advanced/index.js +6 -5
  127. package/dist/fhe-vesting/advanced/react/index.cjs +12 -11
  128. package/dist/fhe-vesting/advanced/react/index.js +9 -8
  129. package/dist/fhe-vesting/index.cjs +35 -34
  130. package/dist/fhe-vesting/index.js +7 -6
  131. package/dist/fhe-vesting/manager.d.ts +19 -0
  132. package/dist/fhe-vesting/react/index.cjs +160 -140
  133. package/dist/fhe-vesting/react/index.d.cts +6 -4
  134. package/dist/fhe-vesting/react/index.d.ts +6 -4
  135. package/dist/fhe-vesting/react/index.js +24 -16
  136. package/dist/fhe-vesting/react/useAccessClaimableAmount.d.ts +11 -3
  137. package/dist/fhe-vesting/react/useAccessSettledAmount.d.ts +11 -3
  138. package/dist/fhe-vesting/react/useAccessTotalAllocation.d.ts +11 -3
  139. package/dist/fhe-vesting/react/useAccessVestedAmount.d.ts +11 -3
  140. package/dist/fhe-vesting/react/useAdminGetClaimableAmount.d.ts +1 -1
  141. package/dist/fhe-vesting/react/useAdminGetSettledAmount.d.ts +1 -1
  142. package/dist/fhe-vesting/react/useAdminGetTotalAllocation.d.ts +1 -1
  143. package/dist/fhe-vesting/react/useAdminGetVestedAmount.d.ts +1 -1
  144. package/dist/fhe-vesting/react/useAdminPartialClaim.d.ts +8 -0
  145. package/dist/fhe-vesting/react/useClaim.d.ts +1 -1
  146. package/dist/fhe-vesting/react/useDiscloseHandleToParty.d.ts +1 -1
  147. package/dist/fhe-vesting/react/useManagerDiscloseHandleToParty.d.ts +1 -1
  148. package/dist/fhe-vesting/react/usePartialClaim.d.ts +1 -1
  149. package/dist/fhe-vesting/react/useVestingInfo.d.ts +1 -1
  150. package/dist/fhe-vesting/types.d.ts +12 -1
  151. package/dist/index.cjs +27 -15
  152. package/dist/index.js +1 -1
  153. package/dist/testnet-faucet/index.cjs +17 -16
  154. package/dist/testnet-faucet/index.js +5 -4
  155. package/dist/testnet-faucet/react/index.cjs +11 -10
  156. package/dist/testnet-faucet/react/index.js +6 -5
  157. package/package.json +18 -9
  158. package/dist/chunk-4WPGQSNT.cjs +0 -44
  159. package/dist/chunk-6R4KNAPK.js +0 -1630
  160. package/dist/chunk-DUZIIRPF.js +0 -1655
  161. package/dist/chunk-MCRBVJGZ.cjs +0 -1637
  162. package/dist/chunk-ODLTEGHB.js +0 -41
  163. package/dist/chunk-ORFTDNFZ.js +0 -105
  164. package/dist/chunk-T46YXSBP.cjs +0 -109
  165. package/dist/chunk-TIUKIY5V.cjs +0 -1663
  166. package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +0 -53
  167. package/dist/fhe-airdrop/advanced/react/usePredictAirdropAddress.d.ts +0 -49
  168. package/dist/fhe-airdrop/airdrop.d.ts +0 -310
  169. package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +0 -31
  170. package/dist/fhe-airdrop/react/useAirdropCanExtendClaimWindow.d.ts +0 -7
  171. package/dist/fhe-airdrop/react/useAirdropClaim.d.ts +0 -27
  172. package/dist/fhe-airdrop/react/useAirdropClaimTypehash.d.ts +0 -10
  173. package/dist/fhe-airdrop/react/useAirdropClaimedSignatures.d.ts +0 -16
  174. package/dist/fhe-airdrop/react/useAirdropDeploymentBlockNumber.d.ts +0 -6
  175. package/dist/fhe-airdrop/react/useAirdropDomainSeparator.d.ts +0 -8
  176. package/dist/fhe-airdrop/react/useAirdropEndTime.d.ts +0 -10
  177. package/dist/fhe-airdrop/react/useAirdropFactoryCustomFee.d.ts +0 -17
  178. package/dist/fhe-airdrop/react/useAirdropFactoryDefaultGasFee.d.ts +0 -10
  179. package/dist/fhe-airdrop/react/useAirdropFactoryDisableCustomFee.d.ts +0 -15
  180. package/dist/fhe-airdrop/react/useAirdropFactoryFeeCollector.d.ts +0 -11
  181. package/dist/fhe-airdrop/react/useAirdropFactoryInitCodeHash.d.ts +0 -17
  182. package/dist/fhe-airdrop/react/useAirdropFactorySetCustomFee.d.ts +0 -17
  183. package/dist/fhe-airdrop/react/useAirdropFactorySetDefaultGasFee.d.ts +0 -16
  184. package/dist/fhe-airdrop/react/useAirdropFactorySetFeeCollector.d.ts +0 -15
  185. package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +0 -16
  186. package/dist/fhe-airdrop/react/useAirdropHasClaimEnded.d.ts +0 -7
  187. package/dist/fhe-airdrop/react/useAirdropHasClaimStarted.d.ts +0 -7
  188. package/dist/fhe-airdrop/react/useAirdropIsClaimWindowActive.d.ts +0 -9
  189. package/dist/fhe-airdrop/react/useAirdropIsPaused.d.ts +0 -8
  190. package/dist/fhe-airdrop/react/useAirdropIsSignatureClaimed.d.ts +0 -22
  191. package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +0 -51
  192. package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +0 -15
  193. package/dist/fhe-airdrop/react/useAirdropStartTime.d.ts +0 -10
  194. package/dist/fhe-airdrop/react/useAirdropWithdrawGasFee.d.ts +0 -15
  195. package/dist/fhe-airdrop/react/useAirdropWithdrawOtherConfidentialToken.d.ts +0 -14
  196. package/dist/fhe-airdrop/react/useAirdropWithdrawOtherToken.d.ts +0 -14
  197. package/dist/fhe-airdrop/react/useClaim.d.ts +0 -31
  198. package/dist/fhe-airdrop/react/useConfidentialAirdropFactoryImplementation.d.ts +0 -11
  199. package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +0 -41
  200. package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +0 -48
  201. package/dist/fhe-airdrop/react/useCreateConfidentialAirdrop.d.ts +0 -29
  202. package/dist/fhe-airdrop/react/useCreateConfidentialAirdropAndGetAddress.d.ts +0 -31
  203. package/dist/fhe-airdrop/react/useDisableCustomFee.d.ts +0 -14
  204. package/dist/fhe-airdrop/react/useFactoryCustomFee.d.ts +0 -17
  205. package/dist/fhe-airdrop/react/useFactoryDefaultGasFee.d.ts +0 -10
  206. package/dist/fhe-airdrop/react/useFactoryFeeCollector.d.ts +0 -11
  207. package/dist/fhe-airdrop/react/useFactoryInitCodeHash.d.ts +0 -17
  208. package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +0 -33
  209. package/dist/fhe-airdrop/react/useGetClaimAmount.d.ts +0 -30
  210. package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +0 -51
  211. package/dist/fhe-airdrop/react/useSetCustomFee.d.ts +0 -16
  212. package/dist/fhe-airdrop/react/useSetDefaultGasFee.d.ts +0 -15
  213. package/dist/fhe-airdrop/react/useSetFeeCollector.d.ts +0 -14
  214. package/dist/fhe-airdrop/react/useSetPaused.d.ts +0 -14
  215. package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +0 -31
  216. package/dist/fhe-airdrop/react/useWithdraw.d.ts +0 -12
  217. package/dist/fhe-airdrop/react/useWithdrawOtherConfidentialToken.d.ts +0 -13
  218. package/dist/fhe-airdrop/react/useWithdrawOtherToken.d.ts +0 -13
  219. package/dist/fhe-vesting/react/useGetClaimableAmount.d.ts +0 -13
  220. package/dist/fhe-vesting/react/useGetSettledAmount.d.ts +0 -14
  221. package/dist/fhe-vesting/react/useGetTotalAllocation.d.ts +0 -13
  222. package/dist/fhe-vesting/react/useGetVestedAmount.d.ts +0 -25
@@ -1,15 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { Account, Address } from "viem";
3
- import type { TxHash } from "../../core/brands.js";
4
- import { type BaseHookOptions } from "./_shared.js";
5
- export interface UseAirdropFactorySetFeeCollectorArgs {
6
- newFeeCollector: Address;
7
- account?: Account | Address;
8
- }
9
- /**
10
- * Admin: change the factory's fee collector address. Requires
11
- * `FEE_MANAGER_ROLE`.
12
- *
13
- * After success, invalidate `useFactoryFeeCollector()`.
14
- */
15
- export declare function useAirdropFactorySetFeeCollector(options?: BaseHookOptions): UseMutationResult<TxHash, Error, UseAirdropFactorySetFeeCollectorArgs>;
@@ -1,16 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { Account, Address, Hex } from "viem";
3
- import { type AirdropHookOptions } from "./_shared.js";
4
- export interface UseAirdropGrantRoleArgs {
5
- role: Hex;
6
- accountTarget: Address;
7
- account?: Account | Address;
8
- }
9
- /**
10
- * AccessControl: grant `role` to `accountTarget` on this airdrop clone.
11
- * Caller must be a member of the role's admin role (typically
12
- * `DEFAULT_ADMIN_ROLE`).
13
- *
14
- * After success, invalidate `useAirdropHasRole({ role, account: accountTarget })`.
15
- */
16
- export declare function useAirdropGrantRole(options: AirdropHookOptions): UseMutationResult<Hex, Error, UseAirdropGrantRoleArgs>;
@@ -1,7 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import { type AirdropHookOptions } from "./_shared.js";
3
- /**
4
- * Read whether the current chain timestamp is past `endTime` on this airdrop
5
- * clone. Free chain read — no gas, no tx.
6
- */
7
- export declare function useAirdropHasClaimEnded(options: AirdropHookOptions): UseQueryResult<boolean, Error>;
@@ -1,7 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import { type AirdropHookOptions } from "./_shared.js";
3
- /**
4
- * Read whether the current chain timestamp is past `START_TIME` on this
5
- * airdrop clone. Free chain read — no gas, no tx.
6
- */
7
- export declare function useAirdropHasClaimStarted(options: AirdropHookOptions): UseQueryResult<boolean, Error>;
@@ -1,9 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import { type AirdropHookOptions } from "./_shared.js";
3
- /**
4
- * Read whether the airdrop is currently within its claim window AND not paused.
5
- * Free chain read — no gas, no tx.
6
- *
7
- * Use this as a pre-claim UI gate.
8
- */
9
- export declare function useAirdropIsClaimWindowActive(options: AirdropHookOptions): UseQueryResult<boolean, Error>;
@@ -1,8 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import { type AirdropHookOptions } from "./_shared.js";
3
- /**
4
- * Read whether claims are currently paused by the admin on this airdrop clone.
5
- *
6
- * After a successful `useSetPaused`, invalidate this query.
7
- */
8
- export declare function useAirdropIsPaused(options: AirdropHookOptions): UseQueryResult<boolean, Error>;
@@ -1,22 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import type { Address, Hex } from "viem";
3
- import { type AirdropHookOptions } from "./_shared.js";
4
- export interface UseAirdropIsSignatureClaimedArgs extends AirdropHookOptions {
5
- /** Recipient address from the claim authorization. */
6
- user?: Address;
7
- /** `externalEuint64` handle (as `Hex`) from the claim payload. */
8
- encryptedAmountHandle?: Hex;
9
- }
10
- /**
11
- * Check whether a claim has been consumed for a `(user, encryptedAmountHandle)`
12
- * pair on this airdrop clone. The contract recomputes the struct hash
13
- * internally and looks it up in storage.
14
- *
15
- * Most frontends want this hook over {@link useAirdropClaimedSignatures} —
16
- * pass the same `user` + `encryptedAmountHandle` that appear in the
17
- * admin-issued claim payload.
18
- *
19
- * After a successful {@link useClaim}, invalidate this query for the claimed
20
- * `(user, encryptedAmountHandle)` pair.
21
- */
22
- export declare function useAirdropIsSignatureClaimed(args: UseAirdropIsSignatureClaimedArgs): UseQueryResult<boolean, Error>;
@@ -1,51 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import type { Address, Hex } from "viem";
3
- import { type AirdropHookOptions } from "./_shared.js";
4
- export interface UseAirdropIsSignatureValidArgs extends AirdropHookOptions {
5
- /** `externalEuint64` handle (as `Hex`) from the claim payload. */
6
- encryptedAmountHandle?: Hex;
7
- /** EIP-712 admin signature over `Claim(address recipient, bytes32 encryptedAmount)`. */
8
- signature?: Hex;
9
- /**
10
- * Caller address — the contract recomputes the struct hash over
11
- * `(msg.sender, encryptedAmount)`, so validity is caller-specific.
12
- * Defaults to the connected wallet via wagmi's account hook (v2
13
- * `useAccount()` / v3 `useConnection()`); pass explicitly to check on
14
- * behalf of another address.
15
- */
16
- caller?: Address;
17
- }
18
- /**
19
- * Check whether an admin-issued claim authorization is valid for a specific
20
- * caller, without consuming it.
21
- *
22
- * The query has **two distinct failure shapes** that must be handled separately:
23
- *
24
- * - `data === false`: the signature is structurally valid but fails the on-chain
25
- * check — already claimed, claim window inactive, or signer lacks
26
- * `DEFAULT_ADMIN_ROLE`.
27
- * - `error?.code === "TOKENOPS_INVALID_SIGNATURE"`: the signature bytes are
28
- * structurally malformed (wrong length, invalid `s`-value range, unparseable).
29
- * The on-chain `ECDSA.recover` reverts before the boolean logic runs, so this
30
- * shows up on `error`, not on `data`.
31
- *
32
- * ```ts
33
- * const sig = useAirdropIsSignatureValid({ address, encryptedAmountHandle, signature, caller });
34
- * if (sig.error?.code === "TOKENOPS_INVALID_SIGNATURE") {
35
- * // malformed signature bytes
36
- * } else if (sig.data === false) {
37
- * // wrong signer, already claimed, or window closed
38
- * } else if (sig.data === true) {
39
- * // ready to claim
40
- * }
41
- * ```
42
- *
43
- * The result is caller-specific (the on-chain check binds to `msg.sender`).
44
- * `caller` defaults to the connected wallet; the query stays disabled until
45
- * a caller is available, and the caller is part of the query key so cached
46
- * results don't bleed across account switches.
47
- *
48
- * Use this to show a pre-claim validation state in the UI before asking the
49
- * user to pay gas.
50
- */
51
- export declare function useAirdropIsSignatureValid(args: UseAirdropIsSignatureValidArgs): UseQueryResult<boolean, Error>;
@@ -1,15 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { Account, Address, Hex } from "viem";
3
- import { type AirdropHookOptions } from "./_shared.js";
4
- export interface UseAirdropRevokeRoleArgs {
5
- role: Hex;
6
- accountTarget: Address;
7
- account?: Account | Address;
8
- }
9
- /**
10
- * AccessControl: revoke `role` from `accountTarget` on this airdrop clone.
11
- * Caller must be a member of the role's admin role.
12
- *
13
- * After success, invalidate `useAirdropHasRole({ role, account: accountTarget })`.
14
- */
15
- export declare function useAirdropRevokeRole(options: AirdropHookOptions): UseMutationResult<Hex, Error, UseAirdropRevokeRoleArgs>;
@@ -1,10 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import { type AirdropHookOptions } from "./_shared.js";
3
- /**
4
- * Read the airdrop clone's immutable `START_TIME` — the unix timestamp when
5
- * claims become available.
6
- *
7
- * @example
8
- * const { data: startTime } = useAirdropStartTime({ address: airdropAddress });
9
- */
10
- export declare function useAirdropStartTime(options: AirdropHookOptions): UseQueryResult<number, Error>;
@@ -1,15 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { Account, Address, Hex } from "viem";
3
- import { type AirdropHookOptions } from "./_shared.js";
4
- export interface UseAirdropWithdrawGasFeeArgs {
5
- recipient: Address;
6
- /** Amount of ETH to withdraw (in wei). Pass `0n` to withdraw the entire balance. */
7
- amount: bigint;
8
- account?: Account | Address;
9
- }
10
- /**
11
- * Fee collector: withdraw collected ETH gas fees from the airdrop clone.
12
- * Requires `FEE_COLLECTOR_ROLE`. Pass `amount = 0n` to withdraw the entire
13
- * balance.
14
- */
15
- export declare function useAirdropWithdrawGasFee(options: AirdropHookOptions): UseMutationResult<Hex, Error, UseAirdropWithdrawGasFeeArgs>;
@@ -1,14 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { Account, Address } from "viem";
3
- import type { TxHash } from "../../core/brands.js";
4
- import { type AirdropHookOptions } from "./_shared.js";
5
- export interface UseAirdropWithdrawOtherConfidentialTokenArgs {
6
- tokenAddress: Address;
7
- recipient: Address;
8
- account?: Account | Address;
9
- }
10
- /**
11
- * Admin: rescue accidentally sent ERC-7984 confidential tokens (other than
12
- * this airdrop's configured `TOKEN`). Requires `DEFAULT_ADMIN_ROLE`.
13
- */
14
- export declare function useAirdropWithdrawOtherConfidentialToken(options: AirdropHookOptions): UseMutationResult<TxHash, Error, UseAirdropWithdrawOtherConfidentialTokenArgs>;
@@ -1,14 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { Account, Address } from "viem";
3
- import type { TxHash } from "../../core/brands.js";
4
- import { type AirdropHookOptions } from "./_shared.js";
5
- export interface UseAirdropWithdrawOtherTokenArgs {
6
- tokenAddress: Address;
7
- recipient: Address;
8
- account?: Account | Address;
9
- }
10
- /**
11
- * Admin: rescue accidentally sent ERC-20 (non-confidential) tokens. Requires
12
- * `DEFAULT_ADMIN_ROLE`.
13
- */
14
- export declare function useAirdropWithdrawOtherToken(options: AirdropHookOptions): UseMutationResult<TxHash, Error, UseAirdropWithdrawOtherTokenArgs>;
@@ -1,31 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { Hex } from "viem";
3
- import type { ClaimArgs } from "../airdrop.js";
4
- import { type AirdropHookOptions } from "./_shared.js";
5
- /**
6
- * Claim tokens from an airdrop using an EIP-712 admin signature. Submits the
7
- * admin-issued `{ encryptedInput, signature }` pair verbatim — the SDK does
8
- * NOT re-encrypt on the recipient side, because the signature commits to the
9
- * exact `bytes32` handle and any re-encryption would invalidate it.
10
- *
11
- * Attaches `GAS_FEE()` ETH as `msg.value` automatically unless `args.value` is
12
- * set.
13
- *
14
- * The admin builds `encryptedInput` server-side via
15
- * {@link encryptUint64} with `userAddress: recipient` (Zama input proofs are
16
- * bound to the recipient), then signs the resulting handle with
17
- * {@link signClaimAuthorization}. Deliver `(encryptedInput, signature)` to
18
- * the recipient via your channel of choice; the recipient passes the pair to
19
- * this hook unchanged.
20
- *
21
- * After a successful claim, invalidate
22
- * `useAirdropIsSignatureClaimed({ user, encryptedAmountHandle })` and any
23
- * UI counts you computed off it.
24
- *
25
- * **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
26
- *
27
- * @example
28
- * const claim = useClaim({ address: airdropAddress });
29
- * claim.mutate({ encryptedInput, signature });
30
- */
31
- export declare function useClaim(options: AirdropHookOptions): UseMutationResult<Hex, Error, ClaimArgs>;
@@ -1,11 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import type { Address } from "viem";
3
- import { type BaseHookOptions } from "./_shared.js";
4
- /**
5
- * Read the FHE-airdrop factory's current `implementation()` address — the
6
- * LibClone target every new airdrop clone delegates to.
7
- *
8
- * @example
9
- * const { data: implementation } = useConfidentialAirdropFactoryImplementation();
10
- */
11
- export declare function useConfidentialAirdropFactoryImplementation(options?: BaseHookOptions): UseQueryResult<Address, Error>;
@@ -1,41 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { CreateAirdropResult, CreateAndFundAirdropArgs } from "../factory.js";
3
- import { type FactoryHookOptions } from "./_shared.js";
4
- /**
5
- * Deploy AND fund a new airdrop clone in a single transaction. The SDK
6
- * encrypts the plaintext `amount` into an `externalEuint64` and submits it
7
- * with an input proof — callers never handle ciphertext.
8
- *
9
- * **Encryptor resolution.** The hook-level `encryptor` (from
10
- * {@link FactoryHookOptions}) is forwarded lazily to the SDK client. You can
11
- * also pass `encryptor` per-mutation via `args.encryptor` to override it. If
12
- * neither is present, the SDK throws `Missing encryptor — pass encryptor…`
13
- * verbatim.
14
- *
15
- * **Prerequisites:** caller must have set the factory as an operator on the
16
- * token: `token.setOperator(factoryAddress, deadline)`.
17
- *
18
- * **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
19
- *
20
- * **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
21
- * convention (1 token = 1_000_000 base units), not the 18 decimals typical of
22
- * ERC-20. Amount parameters are base units of the token's actual decimals:
23
- * for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
24
- * transparent TTT test token uses 18 decimals.
25
- *
26
- * After success, invalidate factory queries that depend on per-creator state:
27
- *
28
- * ```ts
29
- * function Component() {
30
- * const queryClient = useQueryClient();
31
- * const zamaSDK = useZamaSDK();
32
- * const create = useCreateAndFundConfidentialAirdrop({ encryptor: () => zamaSDK.relayer });
33
- * create.mutate(args, {
34
- * onSuccess: () => {
35
- * queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
36
- * },
37
- * });
38
- * }
39
- * ```
40
- */
41
- export declare function useCreateAndFundConfidentialAirdrop(options?: FactoryHookOptions): UseMutationResult<CreateAirdropResult, Error, CreateAndFundAirdropArgs>;
@@ -1,48 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { CreateAirdropResult, CreateAndFundAirdropArgs } from "../factory.js";
3
- import { type FactoryHookOptions } from "./_shared.js";
4
- /**
5
- * **Recommended fund-on-create entry point.** Deploy AND fund a new airdrop
6
- * clone in one tx, then resolve its address from the
7
- * `ConfidentialAirdropCreated` event in the receipt.
8
- *
9
- * Use this in place of {@link useCreateAndFundConfidentialAirdrop} when you
10
- * need the deployed clone address — for example to navigate to a detail page
11
- * immediately after the deploy.
12
- *
13
- * Internally: `createAndFundConfidentialAirdrop` → `waitForTransactionReceipt`
14
- * → `parseEventLogs({ eventName: "ConfidentialAirdropCreated" })`.
15
- *
16
- * **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
17
- *
18
- * **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
19
- * convention (1 token = 1_000_000 base units), not the 18 decimals typical of
20
- * ERC-20. Amount parameters are base units of the token's actual decimals:
21
- * for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
22
- * transparent TTT test token uses 18 decimals.
23
- *
24
- * After a successful create, invalidate factory queries that depend on
25
- * per-creator state:
26
- *
27
- * ```ts
28
- * function Component() {
29
- * const queryClient = useQueryClient();
30
- * const zamaSDK = useZamaSDK();
31
- * const create = useCreateAndFundConfidentialAirdropAndGetAddress({
32
- * encryptor: () => zamaSDK.relayer,
33
- * });
34
- * create.mutate(args, {
35
- * onSuccess: ({ airdrop }) => {
36
- * queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
37
- * navigate(`/airdrop/${airdrop}`);
38
- * },
39
- * });
40
- * }
41
- * ```
42
- *
43
- * @example
44
- * const create = useCreateAndFundConfidentialAirdropAndGetAddress();
45
- * create.mutate({ params, userSalt, amount });
46
- * // create.data → { hash, airdrop }
47
- */
48
- export declare function useCreateAndFundConfidentialAirdropAndGetAddress(options?: FactoryHookOptions): UseMutationResult<CreateAirdropResult, Error, CreateAndFundAirdropArgs>;
@@ -1,29 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { CreateAirdropArgs, CreateAirdropResult } from "../factory.js";
3
- import { type FactoryHookOptions } from "./_shared.js";
4
- /**
5
- * Deploy a new airdrop clone via the factory. Raw-hash-only variant — parse
6
- * the `ConfidentialAirdropCreated` event yourself if you need the address.
7
- *
8
- * **For the common "deploy and learn the address" flow, prefer
9
- * {@link useCreateConfidentialAirdropAndGetAddress}** — it's a one-call wrapper
10
- * that returns `{ hash, airdrop }`.
11
- *
12
- * After a successful create, invalidate factory queries that depend on
13
- * per-creator state:
14
- *
15
- * ```ts
16
- * const queryClient = useQueryClient();
17
- * const create = useCreateConfidentialAirdrop();
18
- * create.mutate(args, {
19
- * onSuccess: () => {
20
- * queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
21
- * },
22
- * });
23
- * ```
24
- *
25
- * @example
26
- * const create = useCreateConfidentialAirdrop();
27
- * create.mutate({ params, userSalt });
28
- */
29
- export declare function useCreateConfidentialAirdrop(options?: FactoryHookOptions): UseMutationResult<CreateAirdropResult, Error, CreateAirdropArgs>;
@@ -1,31 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { CreateAirdropResult, CreateAirdropArgs } from "../factory.js";
3
- import { type FactoryHookOptions } from "./_shared.js";
4
- /**
5
- * **Recommended factory entry point.** Deploy a new
6
- * `ConfidentialAirdropCloneable` clone and resolve its address from the
7
- * `ConfidentialAirdropCreated` event in the tx receipt — in one call.
8
- *
9
- * Internally: `createConfidentialAirdrop` → `waitForTransactionReceipt` →
10
- * `parseEventLogs({ eventName: "ConfidentialAirdropCreated" })`.
11
- *
12
- * After a successful create, invalidate factory queries that depend on
13
- * per-creator state:
14
- *
15
- * ```ts
16
- * const queryClient = useQueryClient();
17
- * const create = useCreateConfidentialAirdropAndGetAddress();
18
- * create.mutate(args, {
19
- * onSuccess: ({ airdrop }) => {
20
- * queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
21
- * navigate(`/airdrop/${airdrop}`);
22
- * },
23
- * });
24
- * ```
25
- *
26
- * @example
27
- * const create = useCreateConfidentialAirdropAndGetAddress();
28
- * create.mutate({ params, userSalt });
29
- * // create.data → { hash, airdrop }
30
- */
31
- export declare function useCreateConfidentialAirdropAndGetAddress(options?: FactoryHookOptions): UseMutationResult<CreateAirdropResult, Error, CreateAirdropArgs>;
@@ -1,14 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { Account, Address, Hex } from "viem";
3
- import { type BaseHookOptions } from "./_shared.js";
4
- export interface UseDisableCustomFeeArgs {
5
- campaignCreator: Address;
6
- account?: Account | Address;
7
- }
8
- /**
9
- * Admin: remove a per-creator fee override, reverting to `defaultGasFee`.
10
- * Requires `FEE_MANAGER_ROLE`.
11
- *
12
- * After success, invalidate `useFactoryCustomFee({ creator: campaignCreator })`.
13
- */
14
- export declare function useDisableCustomFee(options?: BaseHookOptions): UseMutationResult<Hex, Error, UseDisableCustomFeeArgs>;
@@ -1,17 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import type { Address } from "viem";
3
- import { type CustomFee } from "../types.js";
4
- import { type BaseHookOptions } from "./_shared.js";
5
- export interface UseFactoryCustomFeeArgs extends BaseHookOptions {
6
- /** Address whose per-creator fee override to read. Hook is disabled until set. */
7
- creator?: Address;
8
- }
9
- /**
10
- * Read the per-creator fee override set on the factory for `creator`. Returns
11
- * `{ enabled: false, gasFee: 0n }` when no override exists.
12
- *
13
- * @example
14
- * const { data: customFee } = useFactoryCustomFee({ creator });
15
- * if (customFee?.enabled) { ... use customFee.gasFee ... }
16
- */
17
- export declare function useFactoryCustomFee(args?: UseFactoryCustomFeeArgs): UseQueryResult<CustomFee, Error>;
@@ -1,10 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import { type BaseHookOptions } from "./_shared.js";
3
- /**
4
- * Read the factory-wide default per-claim gas fee (in wei) — applied to new
5
- * airdrop clones at deployment when the creator has no custom override.
6
- *
7
- * @example
8
- * const { data: defaultGasFee } = useFactoryDefaultGasFee();
9
- */
10
- export declare function useFactoryDefaultGasFee(options?: BaseHookOptions): UseQueryResult<bigint, Error>;
@@ -1,11 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import type { Address } from "viem";
3
- import { type BaseHookOptions } from "./_shared.js";
4
- /**
5
- * Read the factory's current fee collector address — the account authorized to
6
- * call `withdrawGasFee` on each deployed airdrop clone.
7
- *
8
- * @example
9
- * const { data: feeCollector } = useFactoryFeeCollector();
10
- */
11
- export declare function useFactoryFeeCollector(options?: BaseHookOptions): UseQueryResult<Address, Error>;
@@ -1,17 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import type { Hex } from "viem";
3
- import { type AirdropParams } from "../types.js";
4
- import { type BaseHookOptions } from "./_shared.js";
5
- export interface UseFactoryInitCodeHashArgs extends BaseHookOptions {
6
- params?: AirdropParams;
7
- gasFee?: bigint;
8
- }
9
- /**
10
- * Read the init-code hash the factory would use to CREATE2 an airdrop clone
11
- * with the given `params` + `gasFee`. Mirrors Solidity's `getInitCodeHash`
12
- * selector.
13
- *
14
- * @example
15
- * const { data: initCodeHash } = useFactoryInitCodeHash({ params, gasFee });
16
- */
17
- export declare function useFactoryInitCodeHash(args?: UseFactoryInitCodeHashArgs): UseQueryResult<Hex, Error>;
@@ -1,33 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { Hex } from "viem";
3
- import type { FundAirdropArgs } from "../factory.js";
4
- import { type FactoryHookOptions } from "./_shared.js";
5
- /**
6
- * Fund an existing (or not-yet-deployed) airdrop clone with encrypted tokens
7
- * via the factory. The SDK encrypts the plaintext `amount` into an
8
- * `externalEuint64` and submits it with an input proof — callers never handle
9
- * ciphertext.
10
- *
11
- * **Encryptor resolution.** The hook-level `encryptor` (from
12
- * {@link FactoryHookOptions}) is forwarded lazily to the SDK client. You can
13
- * also pass `encryptor` per-mutation via `args.encryptor` to override it. If
14
- * neither is present, the SDK throws `Missing encryptor — pass encryptor…`
15
- * verbatim.
16
- *
17
- * **Prerequisites:** caller must have set the factory as an operator on the
18
- * token: `token.setOperator(factoryAddress, deadline)`.
19
- *
20
- * **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
21
- *
22
- * **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
23
- * convention (1 token = 1_000_000 base units), not the 18 decimals typical of
24
- * ERC-20. Amount parameters are base units of the token's actual decimals:
25
- * for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
26
- * transparent TTT test token uses 18 decimals.
27
- *
28
- * **`args.gasFee` MUST match the fee active for `deployer` at airdrop creation
29
- * time** — custom fee if `getCustomFee(deployer).enabled`, otherwise
30
- * `defaultGasFee`. The factory derives the target clone address from this
31
- * value via CREATE2; a mismatch funds the wrong (predicted) address.
32
- */
33
- export declare function useFundConfidentialAirdrop(options?: FactoryHookOptions): UseMutationResult<Hex, Error, FundAirdropArgs>;
@@ -1,30 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { EncryptedViewResult, GetClaimAmountArgs } from "../airdrop.js";
3
- import { type AirdropHookOptions } from "./_shared.js";
4
- /**
5
- * **Submits a transaction (costs gas) to grant the caller decrypt access to
6
- * the claim amount as an `euint64` handle.** The handle is granted persistent
7
- * ACL on-chain via `FHE.allow(handle, msg.sender)`; the SDK extracts it from
8
- * the receipt's `ACL.Allowed` event (NOT from simulation — that returns a
9
- * divergent, ACL-less handle; see CLAUDE.md Pitfall #1).
10
- *
11
- * Pass `data.handle` to the Zama relayer's `userDecrypt` to obtain the
12
- * plaintext amount. The handle is only valid after the tx lands.
13
- *
14
- * Does **not** consume the claim (the `claimedSignatures` bit is not set).
15
- * Call {@link useClaim} when the user is ready to transfer tokens.
16
- *
17
- * Submits the admin-issued `{ encryptedInput, signature }` pair verbatim. The
18
- * SDK does NOT re-encrypt — the signature commits to the exact handle.
19
- *
20
- * @example
21
- * // `encryptedInput` + `signature` are the admin-issued payload delivered to
22
- * // the recipient (same pair the recipient passes to `useClaim`). Sourced
23
- * // from your server API or, for admin-dashboard flows, by combining
24
- * // `encryptUint64({ userAddress: recipient, ... })` with
25
- * // `useSignClaimAuthorization`.
26
- * const view = useGetClaimAmount({ address: airdropAddress });
27
- * view.mutate({ encryptedInput, signature });
28
- * // view.data → { handle: "0x...", hash: "0x..." }
29
- */
30
- export declare function useGetClaimAmount(options: AirdropHookOptions): UseMutationResult<EncryptedViewResult, Error, GetClaimAmountArgs>;
@@ -1,51 +0,0 @@
1
- import { type UseQueryResult } from "@tanstack/react-query";
2
- import type { Address, Hex } from "viem";
3
- import type { AirdropParams, CreateAirdropPreflightReport } from "../types.js";
4
- import { type BaseHookOptions } from "./_shared.js";
5
- export interface UsePreflightCreateAirdropArgs extends BaseHookOptions {
6
- /** The airdrop parameters that will be passed to the create call. */
7
- params?: AirdropParams;
8
- /** The address that will send the create transaction (`msg.sender`). */
9
- creator?: Address;
10
- /**
11
- * The `userSalt` planned for the create call. Optional — when supplied, the
12
- * report also carries `predictedAirdrop` and `alreadyDeployed`.
13
- */
14
- userSalt?: Hex;
15
- /**
16
- * Set `true` when the plan is `useCreateAndFundConfidentialAirdrop` — a
17
- * missing factory-operator approval then becomes a blocker instead of
18
- * informational `isFactoryOperator` state.
19
- */
20
- funding?: boolean;
21
- }
22
- /**
23
- * Read-only preflight for `useCreateConfidentialAirdrop` /
24
- * `useCreateAndFundConfidentialAirdrop` — wraps
25
- * {@link ConfidentialAirdropFactoryClient.preflightCreateAirdrop} as a
26
- * TanStack query.
27
- *
28
- * The report carries `isFactoryOperator`, `gasFee`, `predictedAirdrop`,
29
- * `alreadyDeployed`, `ready`, `blockers` (human-readable strings) and
30
- * `blockerErrors` (typed `TokenOpsSdkError`s, index-aligned with `blockers` —
31
- * branch on `error.code`).
32
- *
33
- * Checks: structural `params` validation (non-zero token/admin, timestamp
34
- * ordering, end time in the future), ERC-7984 operator approval of the
35
- * factory on `params.token` (blocker only with `funding: true`), and — when
36
- * `userSalt` is set — whether a clone already exists at the predicted CREATE2
37
- * address. The creator's confidential token balance is NOT checked
38
- * (encrypted; an underfunded create-and-fund silently moves an encrypted
39
- * zero) — see the headless method's TSDoc.
40
- *
41
- * Hook is disabled until `params` and `creator` are both set. Refetch after
42
- * the user calls `setOperator` (e.g. via `queryClient.invalidateQueries` or a
43
- * `refetchInterval`).
44
- *
45
- * @example
46
- * const { data: report } = usePreflightCreateAirdrop({
47
- * params, creator, userSalt, funding: true,
48
- * });
49
- * if (report?.ready) { /* enable submit *\/ }
50
- */
51
- export declare function usePreflightCreateAirdrop(args?: UsePreflightCreateAirdropArgs): UseQueryResult<CreateAirdropPreflightReport, Error>;
@@ -1,16 +0,0 @@
1
- import { type UseMutationResult } from "@tanstack/react-query";
2
- import type { Account, Address, Hex } from "viem";
3
- import { type BaseHookOptions } from "./_shared.js";
4
- export interface UseSetCustomFeeArgs {
5
- campaignCreator: Address;
6
- gasFee: bigint;
7
- account?: Account | Address;
8
- }
9
- /**
10
- * Admin: install a per-creator gas-fee override on the factory. Takes
11
- * precedence over `defaultGasFee` for all airdrops `campaignCreator` deploys
12
- * after the override. Requires `FEE_MANAGER_ROLE`.
13
- *
14
- * After success, invalidate `useFactoryCustomFee({ creator: campaignCreator })`.
15
- */
16
- export declare function useSetCustomFee(options?: BaseHookOptions): UseMutationResult<Hex, Error, UseSetCustomFeeArgs>;