@tokenops/sdk 1.6.0 → 2.0.0-alpha.2

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 (263) hide show
  1. package/CHANGELOG.md +77 -8
  2. package/CONTRIBUTING.md +4 -2
  3. package/README.md +146 -90
  4. package/SUPPORT.md +47 -0
  5. package/dist/{chunk-BD4LZBVF.cjs → chunk-3QHNYEQD.cjs} +18 -17
  6. package/dist/{chunk-YFIWCYHC.cjs → chunk-3YHBO2DL.cjs} +56 -54
  7. package/dist/{chunk-QET3Q4JP.js → chunk-44YJPMQC.js} +8 -6
  8. package/dist/{chunk-6WSNS3UV.js → chunk-4RAAATVY.js} +2 -4
  9. package/dist/{chunk-4KJ66YRH.js → chunk-4TSDNZQ3.js} +2 -2
  10. package/dist/chunk-66IHPTOK.cjs +20 -0
  11. package/dist/{chunk-2RNW4MIJ.cjs → chunk-67OV5CX2.cjs} +0 -18
  12. package/dist/{chunk-PD7ME2BT.js → chunk-6GNR22OV.js} +2 -1
  13. package/dist/{chunk-WOEETTH7.cjs → chunk-7AFPOE7N.cjs} +6 -6
  14. package/dist/{chunk-QKKBBH7I.js → chunk-A4DCEE33.js} +34 -7
  15. package/dist/chunk-AREQJHKA.cjs +713 -0
  16. package/dist/{chunk-U57COLUE.js → chunk-AXIPOR3C.js} +2 -2
  17. package/dist/chunk-EBLBPUPI.cjs +255 -0
  18. package/dist/chunk-EYDA6Q6C.js +245 -0
  19. package/dist/{chunk-SYHNZSZZ.cjs → chunk-FAXIIH5R.cjs} +3 -3
  20. package/dist/{chunk-AYGRYDBX.cjs → chunk-FEDX7B6T.cjs} +37 -35
  21. package/dist/{chunk-CBRL2PJA.cjs → chunk-FHWSBGWE.cjs} +12 -12
  22. package/dist/{chunk-WUXUWTFW.cjs → chunk-FT5H2Q7Y.cjs} +37 -7
  23. package/dist/chunk-GADGBQJO.js +423 -0
  24. package/dist/{chunk-VHSNYUYV.js → chunk-IGO5XSPS.js} +5 -5
  25. package/dist/chunk-IUKKNJ2R.cjs +433 -0
  26. package/dist/{chunk-VR3FREBX.cjs → chunk-JK4XMMKM.cjs} +3 -3
  27. package/dist/{chunk-4ZCXK4VI.cjs → chunk-KFRDLKMA.cjs} +14 -14
  28. package/dist/chunk-KWFFIJYX.js +11 -0
  29. package/dist/{chunk-7G7UOQV4.cjs → chunk-MM5BV5CS.cjs} +4 -4
  30. package/dist/{chunk-43RFBQ73.cjs → chunk-MVDQMV25.cjs} +29 -32
  31. package/dist/chunk-NWFMBLSQ.js +4 -0
  32. package/dist/{chunk-HETNKZEE.js → chunk-PYYSB5ZN.js} +1 -1
  33. package/dist/chunk-PZZK3O3S.cjs +9843 -0
  34. package/dist/{chunk-DRSPMIZ7.js → chunk-QBJ7O2B4.js} +1 -11
  35. package/dist/{chunk-WTK6JDSI.js → chunk-SPLNGUFF.js} +6 -4
  36. package/dist/{chunk-UJS4N2XM.cjs → chunk-TEBM66WA.cjs} +12 -12
  37. package/dist/{chunk-TN65XNTI.js → chunk-TWT3STIX.js} +8 -6
  38. package/dist/chunk-UG5RKLU2.cjs +6 -0
  39. package/dist/{chunk-EUKPOXWR.cjs → chunk-UHHMVBLU.cjs} +17 -15
  40. package/dist/chunk-VW356KR3.js +688 -0
  41. package/dist/{chunk-BK7YIVLK.cjs → chunk-WJLECC22.cjs} +75 -73
  42. package/dist/{chunk-V5D7BHW3.js → chunk-WJMEBBU7.js} +6 -4
  43. package/dist/{chunk-NFW7AUEX.js → chunk-WMACINXO.js} +1 -1
  44. package/dist/chunk-X7WBPCEU.js +9817 -0
  45. package/dist/{chunk-46T67CE2.js → chunk-ZA673I3O.js} +1 -1
  46. package/dist/{chunk-YPYCWLYP.js → chunk-ZWXJTBZO.js} +1 -1
  47. package/dist/core/addresses.d.ts +14 -2
  48. package/dist/core/brands.d.ts +8 -2
  49. package/dist/core/errors.d.ts +71 -10
  50. package/dist/core/preflight.d.ts +1 -0
  51. package/dist/fhe/erc7984-abi.d.ts +1 -0
  52. package/dist/fhe/index.cjs +64 -63
  53. package/dist/fhe/index.js +7 -6
  54. package/dist/fhe/operators.d.ts +22 -5
  55. package/dist/fhe/react/index.cjs +13 -12
  56. package/dist/fhe/react/index.js +6 -5
  57. package/dist/fhe/types.d.ts +8 -2
  58. package/dist/fhe-airdrop/abis/{cloneable.d.ts → airdrop-base.d.ts} +254 -396
  59. package/dist/fhe-airdrop/abis/compliance.d.ts +422 -0
  60. package/dist/fhe-airdrop/abis/ecdsa.d.ts +1316 -0
  61. package/dist/fhe-airdrop/abis/factory.d.ts +1319 -190
  62. package/dist/fhe-airdrop/abis/index.d.ts +5 -2
  63. package/dist/fhe-airdrop/abis/merkle.d.ts +1250 -0
  64. package/dist/fhe-airdrop/advanced/index.cjs +11 -12
  65. package/dist/fhe-airdrop/advanced/index.d.cts +34 -11
  66. package/dist/fhe-airdrop/advanced/index.d.ts +34 -11
  67. package/dist/fhe-airdrop/advanced/index.js +3 -8
  68. package/dist/fhe-airdrop/advanced/react/index.cjs +619 -51
  69. package/dist/fhe-airdrop/advanced/react/index.d.cts +43 -3
  70. package/dist/fhe-airdrop/advanced/react/index.d.ts +43 -3
  71. package/dist/fhe-airdrop/advanced/react/index.js +592 -52
  72. package/dist/fhe-airdrop/advanced/react/useClearCompliancePolicy.d.ts +28 -0
  73. package/dist/fhe-airdrop/advanced/react/useClearUpgradeabilityPolicy.d.ts +26 -0
  74. package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +25 -0
  75. package/dist/fhe-airdrop/advanced/react/useEcdsaInitCodeHash.d.ts +30 -0
  76. package/dist/fhe-airdrop/advanced/react/useFactoryComplianceDelegate.d.ts +25 -0
  77. package/dist/fhe-airdrop/advanced/react/useFactoryCompliancePolicy.d.ts +38 -0
  78. package/dist/fhe-airdrop/advanced/react/useFactoryCustomFee.d.ts +24 -0
  79. package/dist/fhe-airdrop/advanced/react/useFactoryGrantRole.d.ts +32 -0
  80. package/dist/fhe-airdrop/advanced/react/useFactoryHasRole.d.ts +27 -0
  81. package/dist/fhe-airdrop/advanced/react/useFactoryImplementations.d.ts +33 -0
  82. package/dist/fhe-airdrop/advanced/react/useFactoryRenounceRole.d.ts +36 -0
  83. package/dist/fhe-airdrop/advanced/react/useFactoryRevokeRole.d.ts +35 -0
  84. package/dist/fhe-airdrop/advanced/react/useFactoryRoleConstants.d.ts +46 -0
  85. package/dist/fhe-airdrop/advanced/react/useFactoryRoleMembers.d.ts +47 -0
  86. package/dist/fhe-airdrop/advanced/react/useFactoryUpgradeabilityPolicy.d.ts +39 -0
  87. package/dist/fhe-airdrop/advanced/react/useMerkleInitCodeHash.d.ts +24 -0
  88. package/dist/fhe-airdrop/advanced/react/usePredictEcdsaAirdropAddress.d.ts +33 -0
  89. package/dist/fhe-airdrop/advanced/react/usePredictMerkleAirdropAddress.d.ts +27 -0
  90. package/dist/fhe-airdrop/advanced/react/useSetComplianceDelegate.d.ts +33 -0
  91. package/dist/fhe-airdrop/advanced/react/useSetComplianceManagerImpl.d.ts +27 -0
  92. package/dist/fhe-airdrop/advanced/react/useSetCompliancePolicy.d.ts +28 -0
  93. package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +28 -0
  94. package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +31 -0
  95. package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +28 -0
  96. package/dist/fhe-airdrop/advanced/react/useSetDefaultUpgradeable.d.ts +27 -0
  97. package/dist/fhe-airdrop/advanced/react/useSetEcdsaImplementation.d.ts +34 -0
  98. package/dist/fhe-airdrop/advanced/react/useSetFeeCollector.d.ts +27 -0
  99. package/dist/fhe-airdrop/advanced/react/useSetMerkleImplementation.d.ts +30 -0
  100. package/dist/fhe-airdrop/advanced/react/useSetUpgradeabilityPolicy.d.ts +31 -0
  101. package/dist/fhe-airdrop/airdrop-base.d.ts +608 -0
  102. package/dist/fhe-airdrop/campaign.d.ts +338 -0
  103. package/dist/fhe-airdrop/compliance.d.ts +302 -0
  104. package/dist/fhe-airdrop/constants.d.ts +33 -0
  105. package/dist/fhe-airdrop/ecdsa.d.ts +263 -0
  106. package/dist/fhe-airdrop/encryption.d.ts +92 -14
  107. package/dist/fhe-airdrop/errors.d.ts +273 -15
  108. package/dist/fhe-airdrop/factory.d.ts +533 -274
  109. package/dist/fhe-airdrop/guards.d.ts +317 -0
  110. package/dist/fhe-airdrop/index.cjs +233 -73
  111. package/dist/fhe-airdrop/index.d.cts +46 -8
  112. package/dist/fhe-airdrop/index.d.ts +46 -8
  113. package/dist/fhe-airdrop/index.js +11 -7
  114. package/dist/fhe-airdrop/merkle-tree.d.ts +97 -0
  115. package/dist/fhe-airdrop/merkle.d.ts +201 -0
  116. package/dist/fhe-airdrop/react/_shared.d.ts +156 -70
  117. package/dist/fhe-airdrop/react/index.cjs +1174 -384
  118. package/dist/fhe-airdrop/react/index.d.cts +99 -74
  119. package/dist/fhe-airdrop/react/index.d.ts +99 -74
  120. package/dist/fhe-airdrop/react/index.js +993 -303
  121. package/dist/fhe-airdrop/react/keys.d.ts +90 -0
  122. package/dist/fhe-airdrop/react/useAccessEcdsaClaimAmount.d.ts +26 -0
  123. package/dist/fhe-airdrop/react/useAccessMerkleClaimAmount.d.ts +27 -0
  124. package/dist/fhe-airdrop/react/useAddComplianceDelegate.d.ts +37 -0
  125. package/dist/fhe-airdrop/react/useAdminBatchDiscloseBalanceToParties.d.ts +36 -0
  126. package/dist/fhe-airdrop/react/useAdminDiscloseBalanceToParty.d.ts +31 -0
  127. package/dist/fhe-airdrop/react/useAdminGetCurrentBalance.d.ts +27 -0
  128. package/dist/fhe-airdrop/react/useAirdropConfig.d.ts +49 -0
  129. package/dist/fhe-airdrop/react/useAirdropDeploymentMode.d.ts +28 -0
  130. package/dist/fhe-airdrop/react/useAirdropGasFee.d.ts +10 -5
  131. package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +29 -10
  132. package/dist/fhe-airdrop/react/useAirdropHasRole.d.ts +15 -6
  133. package/dist/fhe-airdrop/react/useAirdropPause.d.ts +30 -0
  134. package/dist/fhe-airdrop/react/useAirdropPaused.d.ts +17 -0
  135. package/dist/fhe-airdrop/react/useAirdropRenounceRole.d.ts +36 -0
  136. package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +27 -9
  137. package/dist/fhe-airdrop/react/useAirdropRoleAdmin.d.ts +28 -0
  138. package/dist/fhe-airdrop/react/useAirdropRoleConstants.d.ts +67 -0
  139. package/dist/fhe-airdrop/react/useAirdropRoleMembers.d.ts +49 -0
  140. package/dist/fhe-airdrop/react/useAirdropToken.d.ts +11 -4
  141. package/dist/fhe-airdrop/react/useAirdropUpgradeToAndCall.d.ts +45 -0
  142. package/dist/fhe-airdrop/react/useAirdropWindow.d.ts +37 -0
  143. package/dist/fhe-airdrop/react/useBatchDiscloseHandlesToParty.d.ts +32 -0
  144. package/dist/fhe-airdrop/react/useBuildMerkleCampaign.d.ts +68 -0
  145. package/dist/fhe-airdrop/react/useClaimedAmount.d.ts +29 -0
  146. package/dist/fhe-airdrop/react/useComplianceGrantRole.d.ts +32 -0
  147. package/dist/fhe-airdrop/react/useComplianceHasRole.d.ts +37 -0
  148. package/dist/fhe-airdrop/react/useComplianceInfo.d.ts +50 -0
  149. package/dist/fhe-airdrop/react/useComplianceManager.d.ts +16 -0
  150. package/dist/fhe-airdrop/react/useComplianceManagerOf.d.ts +32 -0
  151. package/dist/fhe-airdrop/react/useComplianceRenounceRole.d.ts +38 -0
  152. package/dist/fhe-airdrop/react/useComplianceRevokeRole.d.ts +36 -0
  153. package/dist/fhe-airdrop/react/useComplianceRoleConstants.d.ts +41 -0
  154. package/dist/fhe-airdrop/react/useComplianceRoleMembers.d.ts +45 -0
  155. package/dist/fhe-airdrop/react/useCreateAndFundEcdsaAirdrop.d.ts +55 -0
  156. package/dist/fhe-airdrop/react/useCreateAndFundMerkleAirdrop.d.ts +52 -0
  157. package/dist/fhe-airdrop/react/useCreateEcdsaAirdrop.d.ts +28 -0
  158. package/dist/fhe-airdrop/react/useCreateMerkleAirdrop.d.ts +25 -0
  159. package/dist/fhe-airdrop/react/useDiscloseHandleToParty.d.ts +35 -0
  160. package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +24 -0
  161. package/dist/fhe-airdrop/react/useEcdsaClaimAndUnwrap.d.ts +27 -0
  162. package/dist/fhe-airdrop/react/useEcdsaDomain.d.ts +41 -0
  163. package/dist/fhe-airdrop/react/useEffectiveDelegateToCompliance.d.ts +26 -0
  164. package/dist/fhe-airdrop/react/useEffectiveUpgradeable.d.ts +20 -0
  165. package/dist/fhe-airdrop/react/useEncryptCampaignAmounts.d.ts +59 -0
  166. package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +17 -12
  167. package/dist/fhe-airdrop/react/useFactoryFees.d.ts +28 -0
  168. package/dist/fhe-airdrop/react/useFactoryRegistry.d.ts +35 -0
  169. package/dist/fhe-airdrop/react/useFundAirdrop.d.ts +35 -0
  170. package/dist/fhe-airdrop/react/useGrantInstanceRoles.d.ts +35 -0
  171. package/dist/fhe-airdrop/react/useIsActiveDelegate.d.ts +29 -0
  172. package/dist/fhe-airdrop/react/useIsMerkleRootMutable.d.ts +21 -0
  173. package/dist/fhe-airdrop/react/useIsSignatureValid.d.ts +46 -0
  174. package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +22 -0
  175. package/dist/fhe-airdrop/react/useMerkleClaimAndUnwrap.d.ts +29 -0
  176. package/dist/fhe-airdrop/react/useMerkleRoot.d.ts +15 -0
  177. package/dist/fhe-airdrop/react/usePlanMerkleCampaign.d.ts +53 -0
  178. package/dist/fhe-airdrop/react/usePreflightClaim.d.ts +46 -0
  179. package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +51 -35
  180. package/dist/fhe-airdrop/react/useRescueERC20.d.ts +30 -0
  181. package/dist/fhe-airdrop/react/useRescueOtherConfidentialToken.d.ts +34 -0
  182. package/dist/fhe-airdrop/react/useRevokeComplianceDelegate.d.ts +37 -0
  183. package/dist/fhe-airdrop/react/useRotateMerkleRoot.d.ts +52 -0
  184. package/dist/fhe-airdrop/react/useSetMerkleRoot.d.ts +22 -0
  185. package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +32 -21
  186. package/dist/fhe-airdrop/react/useWithdrawConfidential.d.ts +23 -0
  187. package/dist/fhe-airdrop/react/useWithdrawGasFee.d.ts +37 -0
  188. package/dist/fhe-airdrop/roles.d.ts +147 -0
  189. package/dist/fhe-airdrop/types.d.ts +78 -63
  190. package/dist/fhe-disperse/index.cjs +70 -68
  191. package/dist/fhe-disperse/index.js +10 -8
  192. package/dist/fhe-disperse/react/index.cjs +94 -92
  193. package/dist/fhe-disperse/react/index.js +13 -11
  194. package/dist/fhe-vesting/advanced/index.cjs +10 -8
  195. package/dist/fhe-vesting/advanced/index.js +8 -6
  196. package/dist/fhe-vesting/advanced/react/index.cjs +16 -14
  197. package/dist/fhe-vesting/advanced/react/index.js +13 -11
  198. package/dist/fhe-vesting/index.cjs +74 -72
  199. package/dist/fhe-vesting/index.js +11 -9
  200. package/dist/fhe-vesting/react/index.cjs +228 -226
  201. package/dist/fhe-vesting/react/index.js +15 -13
  202. package/dist/index.cjs +100 -87
  203. package/dist/index.js +3 -2
  204. package/dist/testnet-faucet/index.cjs +57 -55
  205. package/dist/testnet-faucet/index.js +7 -5
  206. package/dist/testnet-faucet/react/index.cjs +55 -53
  207. package/dist/testnet-faucet/react/index.js +9 -7
  208. package/package.json +6 -2
  209. package/dist/chunk-CNP4L3GF.js +0 -105
  210. package/dist/chunk-KSDSXJ34.js +0 -41
  211. package/dist/chunk-LBWRFZR3.cjs +0 -1681
  212. package/dist/chunk-OL6SHN3D.cjs +0 -44
  213. package/dist/chunk-S2XD75JM.js +0 -1637
  214. package/dist/chunk-SPGSO5SO.cjs +0 -1644
  215. package/dist/chunk-UE5XK2SY.js +0 -1673
  216. package/dist/chunk-WO72UBQD.cjs +0 -109
  217. package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +0 -53
  218. package/dist/fhe-airdrop/advanced/react/usePredictAirdropAddress.d.ts +0 -49
  219. package/dist/fhe-airdrop/airdrop.d.ts +0 -317
  220. package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +0 -37
  221. package/dist/fhe-airdrop/react/useAirdropCanExtendClaimWindow.d.ts +0 -7
  222. package/dist/fhe-airdrop/react/useAirdropClaimTypehash.d.ts +0 -10
  223. package/dist/fhe-airdrop/react/useAirdropClaimedSignatures.d.ts +0 -16
  224. package/dist/fhe-airdrop/react/useAirdropDeploymentBlockNumber.d.ts +0 -6
  225. package/dist/fhe-airdrop/react/useAirdropDomainSeparator.d.ts +0 -8
  226. package/dist/fhe-airdrop/react/useAirdropEndTime.d.ts +0 -10
  227. package/dist/fhe-airdrop/react/useAirdropFactoryCustomFee.d.ts +0 -17
  228. package/dist/fhe-airdrop/react/useAirdropFactoryDefaultGasFee.d.ts +0 -10
  229. package/dist/fhe-airdrop/react/useAirdropFactoryDisableCustomFee.d.ts +0 -15
  230. package/dist/fhe-airdrop/react/useAirdropFactoryFeeCollector.d.ts +0 -11
  231. package/dist/fhe-airdrop/react/useAirdropFactoryInitCodeHash.d.ts +0 -17
  232. package/dist/fhe-airdrop/react/useAirdropFactorySetCustomFee.d.ts +0 -17
  233. package/dist/fhe-airdrop/react/useAirdropFactorySetDefaultGasFee.d.ts +0 -16
  234. package/dist/fhe-airdrop/react/useAirdropFactorySetFeeCollector.d.ts +0 -15
  235. package/dist/fhe-airdrop/react/useAirdropHasClaimEnded.d.ts +0 -7
  236. package/dist/fhe-airdrop/react/useAirdropHasClaimStarted.d.ts +0 -7
  237. package/dist/fhe-airdrop/react/useAirdropIsClaimWindowActive.d.ts +0 -9
  238. package/dist/fhe-airdrop/react/useAirdropIsPaused.d.ts +0 -8
  239. package/dist/fhe-airdrop/react/useAirdropIsSignatureClaimed.d.ts +0 -22
  240. package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +0 -51
  241. package/dist/fhe-airdrop/react/useAirdropStartTime.d.ts +0 -10
  242. package/dist/fhe-airdrop/react/useAirdropWithdrawGasFee.d.ts +0 -15
  243. package/dist/fhe-airdrop/react/useAirdropWithdrawOtherConfidentialToken.d.ts +0 -14
  244. package/dist/fhe-airdrop/react/useAirdropWithdrawOtherToken.d.ts +0 -14
  245. package/dist/fhe-airdrop/react/useClaim.d.ts +0 -39
  246. package/dist/fhe-airdrop/react/useConfidentialAirdropFactoryImplementation.d.ts +0 -11
  247. package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +0 -41
  248. package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +0 -48
  249. package/dist/fhe-airdrop/react/useCreateConfidentialAirdrop.d.ts +0 -29
  250. package/dist/fhe-airdrop/react/useCreateConfidentialAirdropAndGetAddress.d.ts +0 -31
  251. package/dist/fhe-airdrop/react/useDisableCustomFee.d.ts +0 -14
  252. package/dist/fhe-airdrop/react/useFactoryCustomFee.d.ts +0 -17
  253. package/dist/fhe-airdrop/react/useFactoryDefaultGasFee.d.ts +0 -10
  254. package/dist/fhe-airdrop/react/useFactoryFeeCollector.d.ts +0 -11
  255. package/dist/fhe-airdrop/react/useFactoryInitCodeHash.d.ts +0 -17
  256. package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +0 -33
  257. package/dist/fhe-airdrop/react/useSetCustomFee.d.ts +0 -16
  258. package/dist/fhe-airdrop/react/useSetDefaultGasFee.d.ts +0 -15
  259. package/dist/fhe-airdrop/react/useSetFeeCollector.d.ts +0 -14
  260. package/dist/fhe-airdrop/react/useSetPaused.d.ts +0 -14
  261. package/dist/fhe-airdrop/react/useWithdraw.d.ts +0 -12
  262. package/dist/fhe-airdrop/react/useWithdrawOtherConfidentialToken.d.ts +0 -13
  263. package/dist/fhe-airdrop/react/useWithdrawOtherToken.d.ts +0 -13
@@ -1,59 +1,599 @@
1
- import { buildQueryKey } from '../../../chunk-CNP4L3GF.js';
2
- import '../../../chunk-S2XD75JM.js';
3
- import { createConfidentialAirdropFactoryAdvancedClient } from '../../../chunk-KSDSXJ34.js';
4
- import { resolveEncryptor } from '../../../chunk-UE5XK2SY.js';
5
- import '../../../chunk-YPYCWLYP.js';
6
- import '../../../chunk-7VELUOMI.js';
7
- import '../../../chunk-6WSNS3UV.js';
8
- import { DEPLOYED_ADDRESSES } from '../../../chunk-QKKBBH7I.js';
9
- import '../../../chunk-46T67CE2.js';
10
- import '../../../chunk-DRSPMIZ7.js';
1
+ import { useMemoAirdropFactoryClient, airdropQueryKey, airdropKeys, airdropQueryKeyPrefix } from '../../../chunk-EYDA6Q6C.js';
2
+ import '../../../chunk-X7WBPCEU.js';
3
+ import '../../../chunk-VW356KR3.js';
4
+ import '../../../chunk-ZWXJTBZO.js';
5
+ import '../../../chunk-NWFMBLSQ.js';
6
+ import '../../../chunk-4RAAATVY.js';
7
+ import '../../../chunk-A4DCEE33.js';
8
+ import '../../../chunk-ZA673I3O.js';
9
+ import '../../../chunk-KWFFIJYX.js';
10
+ import { MissingClientError } from '../../../chunk-QBJ7O2B4.js';
11
11
  import '../../../chunk-Q2GP5UDC.js';
12
- import { useRef, useMemo } from 'react';
13
- import { useQuery } from '@tanstack/react-query';
14
- import { usePublicClient, useWalletClient } from 'wagmi';
12
+ import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
15
13
 
16
- function usePredictAirdropAddress(args = {}) {
17
- const { params, userSalt, deployer, gasFee, address, chainId, publicClient, encryptor } = args;
18
- const wagmiPublicClient = usePublicClient({ ...chainId !== void 0 ? { chainId } : {} });
19
- const resolvedPublicClient = publicClient ?? wagmiPublicClient;
20
- const { data: walletClient } = useWalletClient({
21
- ...chainId !== void 0 ? { chainId } : {}
22
- });
23
- const resolvedChainId = chainId ?? resolvedPublicClient?.chain?.id;
24
- const resolvedAddress = address ?? (resolvedChainId === void 0 ? void 0 : DEPLOYED_ADDRESSES.fheAirdrop?.confidentialAirdropFactory?.[resolvedChainId] ?? void 0);
25
- const encryptorSourceRef = useRef(encryptor);
26
- encryptorSourceRef.current = encryptor;
27
- const client = useMemo(() => {
28
- if (!resolvedPublicClient) return void 0;
29
- if (!resolvedAddress) return void 0;
30
- return createConfidentialAirdropFactoryAdvancedClient({
31
- publicClient: resolvedPublicClient,
32
- ...walletClient ? { walletClient } : {},
14
+ function usePredictEcdsaAirdropAddress(args) {
15
+ const { params, mode, deployer, userSalt, ...base } = args;
16
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
17
+ return useQuery({
18
+ ...args.query,
19
+ queryKey: airdropQueryKey({
20
+ chainId,
21
+ address: resolvedAddress,
22
+ fn: "predictEcdsaAirdropAddress",
23
+ args: [mode, deployer, userSalt]
24
+ }),
25
+ queryFn: () => client.predictEcdsaAirdropAddress({ params, mode, deployer, userSalt }),
26
+ enabled: Boolean(client && (args.query?.enabled ?? true))
27
+ });
28
+ }
29
+ function usePredictMerkleAirdropAddress(args) {
30
+ const { params, mode, deployer, userSalt, ...base } = args;
31
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
32
+ return useQuery({
33
+ ...args.query,
34
+ queryKey: airdropQueryKey({
35
+ chainId,
36
+ address: resolvedAddress,
37
+ fn: "predictMerkleAirdropAddress",
38
+ args: [mode, deployer, userSalt]
39
+ }),
40
+ queryFn: () => client.predictMerkleAirdropAddress({ params, mode, deployer, userSalt }),
41
+ enabled: Boolean(client && (args.query?.enabled ?? true))
42
+ });
43
+ }
44
+ function useClearCompliancePolicy(options = {}) {
45
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
46
+ const queryClient = useQueryClient();
47
+ return useMutation({
48
+ mutationFn: async (args) => {
49
+ if (!client) {
50
+ throw resolutionError ?? new MissingClientError("useClearCompliancePolicy", "factory");
51
+ }
52
+ return client.clearCompliancePolicy(args.creator, args.account);
53
+ },
54
+ onSuccess: (_hash, variables) => {
55
+ const scope = { chainId, address: resolvedAddress };
56
+ void queryClient.invalidateQueries({
57
+ queryKey: airdropKeys.compliancePolicy(scope, variables.creator)
58
+ });
59
+ void queryClient.invalidateQueries({
60
+ queryKey: airdropQueryKey({
61
+ ...scope,
62
+ fn: "effectiveDelegateToCompliance",
63
+ args: [variables.creator]
64
+ })
65
+ });
66
+ }
67
+ });
68
+ }
69
+ function useClearUpgradeabilityPolicy(options = {}) {
70
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
71
+ const queryClient = useQueryClient();
72
+ return useMutation({
73
+ mutationFn: async (args) => {
74
+ if (!client) {
75
+ throw resolutionError ?? new MissingClientError("useClearUpgradeabilityPolicy", "factory");
76
+ }
77
+ return client.clearUpgradeabilityPolicy(args.creator, args.account);
78
+ },
79
+ onSuccess: (_hash, variables) => {
80
+ const scope = { chainId, address: resolvedAddress };
81
+ void queryClient.invalidateQueries({
82
+ queryKey: airdropQueryKey({
83
+ ...scope,
84
+ fn: "effectiveUpgradeable",
85
+ args: [variables.creator]
86
+ })
87
+ });
88
+ void queryClient.invalidateQueries({
89
+ queryKey: airdropKeys.upgradeabilityPolicy(scope, variables.creator)
90
+ });
91
+ void queryClient.invalidateQueries({
92
+ queryKey: airdropKeys.preflightCreateAll(scope)
93
+ });
94
+ }
95
+ });
96
+ }
97
+ function useDisableCustomFee(options = {}) {
98
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
99
+ const queryClient = useQueryClient();
100
+ return useMutation({
101
+ mutationFn: async ({ creator, account }) => {
102
+ if (!client) {
103
+ throw resolutionError ?? new MissingClientError("useDisableCustomFee", "factory");
104
+ }
105
+ return client.disableCustomFee(creator, account);
106
+ },
107
+ onSuccess: (_hash, variables) => {
108
+ void queryClient.invalidateQueries({
109
+ queryKey: airdropKeys.customFee({ chainId, address: resolvedAddress }, variables.creator)
110
+ });
111
+ }
112
+ });
113
+ }
114
+ function useEcdsaInitCodeHash(args) {
115
+ const { params, mode, ...base } = args;
116
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
117
+ return useQuery({
118
+ ...args.query,
119
+ // `params` is omitted for the same reason the predict hooks omit it: the
120
+ // ABI demands it but the factory ignores it, so only `mode` (plus the
121
+ // implementation pointer, which is what this read reports) moves the
122
+ // result. If a future factory version makes params hash-affecting, this
123
+ // key has to grow with it.
124
+ queryKey: airdropQueryKey({
125
+ chainId,
126
+ address: resolvedAddress,
127
+ fn: "getEcdsaInitCodeHash",
128
+ args: [mode]
129
+ }),
130
+ queryFn: () => client.getEcdsaInitCodeHash({ params, mode }),
131
+ enabled: Boolean(client && (args.query?.enabled ?? true))
132
+ });
133
+ }
134
+ function useFactoryComplianceDelegate(args = {}) {
135
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(args);
136
+ return useQuery({
137
+ ...args.query,
138
+ queryKey: airdropQueryKey({
139
+ chainId,
140
+ address: resolvedAddress,
141
+ fn: "complianceDelegate",
142
+ args: []
143
+ }),
144
+ queryFn: () => client.complianceDelegate(),
145
+ enabled: Boolean(client && (args.query?.enabled ?? true))
146
+ });
147
+ }
148
+ function useFactoryCompliancePolicy(args = {}) {
149
+ const { creator, ...base } = args;
150
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
151
+ return useQuery({
152
+ ...args.query,
153
+ queryKey: airdropKeys.compliancePolicy({ chainId, address: resolvedAddress }, creator),
154
+ queryFn: async () => {
155
+ const [policy, effective] = await Promise.all([
156
+ client.getCompliancePolicy(creator),
157
+ client.effectiveDelegateToCompliance(creator)
158
+ ]);
159
+ return {
160
+ overridden: policy.overridden,
161
+ delegateToCompliance: policy.delegateToCompliance,
162
+ effective
163
+ };
164
+ },
165
+ enabled: Boolean(client && creator && (args.query?.enabled ?? true))
166
+ });
167
+ }
168
+ function useFactoryCustomFee(args = {}) {
169
+ const { creator, ...base } = args;
170
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
171
+ return useQuery({
172
+ ...args.query,
173
+ queryKey: airdropKeys.customFee({ chainId, address: resolvedAddress }, creator),
174
+ queryFn: () => client.getCustomFee(creator),
175
+ enabled: Boolean(client && creator && (args.query?.enabled ?? true))
176
+ });
177
+ }
178
+ function useFactoryGrantRole(options = {}) {
179
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
180
+ const queryClient = useQueryClient();
181
+ return useMutation({
182
+ mutationFn: async (args) => {
183
+ if (!client) {
184
+ throw resolutionError ?? new MissingClientError("useFactoryGrantRole", "factory");
185
+ }
186
+ return client.grantRole(args);
187
+ },
188
+ onSuccess: (_hash, variables) => {
189
+ const scope = { chainId, address: resolvedAddress };
190
+ void queryClient.invalidateQueries({
191
+ queryKey: airdropKeys.factoryHasRole(scope, variables.role, variables.holder)
192
+ });
193
+ void queryClient.invalidateQueries({
194
+ queryKey: airdropKeys.factoryRoleMembers(scope, variables.role)
195
+ });
196
+ }
197
+ });
198
+ }
199
+ function useFactoryHasRole(args = {}) {
200
+ const { role, holder, ...base } = args;
201
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
202
+ return useQuery({
203
+ ...args.query,
204
+ queryKey: airdropKeys.factoryHasRole({ chainId, address: resolvedAddress }, role, holder),
205
+ queryFn: () => client.hasRole({ role, holder }),
206
+ enabled: Boolean(client && role && holder && (args.query?.enabled ?? true))
207
+ });
208
+ }
209
+ function useFactoryImplementations(args = {}) {
210
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(args);
211
+ return useQuery({
212
+ ...args.query,
213
+ queryKey: airdropKeys.implementations({ chainId, address: resolvedAddress }),
214
+ queryFn: async () => {
215
+ const [ecdsa, merkle, complianceManager] = await Promise.all([
216
+ client.ecdsaImplementation(),
217
+ client.merkleImplementation(),
218
+ client.complianceManagerImpl()
219
+ ]);
220
+ return { ecdsa, merkle, complianceManager };
221
+ },
222
+ enabled: Boolean(client && (args.query?.enabled ?? true))
223
+ });
224
+ }
225
+ function useFactoryRenounceRole(options = {}) {
226
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
227
+ const queryClient = useQueryClient();
228
+ return useMutation({
229
+ mutationFn: async (args) => {
230
+ if (!client) {
231
+ throw resolutionError ?? new MissingClientError("useFactoryRenounceRole", "factory");
232
+ }
233
+ return client.renounceRole(args);
234
+ },
235
+ onSuccess: (_hash, variables) => {
236
+ const scope = { chainId, address: resolvedAddress };
237
+ void queryClient.invalidateQueries({ queryKey: airdropKeys.factoryHasRoleAll(scope) });
238
+ void queryClient.invalidateQueries({
239
+ queryKey: airdropKeys.factoryRoleMembers(scope, variables.role)
240
+ });
241
+ }
242
+ });
243
+ }
244
+ function useFactoryRevokeRole(options = {}) {
245
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
246
+ const queryClient = useQueryClient();
247
+ return useMutation({
248
+ mutationFn: async (args) => {
249
+ if (!client) {
250
+ throw resolutionError ?? new MissingClientError("useFactoryRevokeRole", "factory");
251
+ }
252
+ return client.revokeRole(args);
253
+ },
254
+ onSuccess: (_hash, variables) => {
255
+ const scope = { chainId, address: resolvedAddress };
256
+ void queryClient.invalidateQueries({
257
+ queryKey: airdropKeys.factoryHasRole(scope, variables.role, variables.holder)
258
+ });
259
+ void queryClient.invalidateQueries({
260
+ queryKey: airdropKeys.factoryRoleMembers(scope, variables.role)
261
+ });
262
+ }
263
+ });
264
+ }
265
+ function useFactoryRoleConstants(args = {}) {
266
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(args);
267
+ return useQuery({
268
+ // A default, not a lock: `query.staleTime` still wins if a consumer wants refetching.
269
+ staleTime: Infinity,
270
+ ...args.query,
271
+ // `fn` label is unique to this hook, so it stays inline rather than in keys.ts.
272
+ queryKey: airdropQueryKey({
273
+ chainId,
274
+ address: resolvedAddress,
275
+ fn: "factoryRoleConstants",
276
+ args: []
277
+ }),
278
+ queryFn: async () => {
279
+ const [
280
+ FEE_MANAGER_ROLE,
281
+ IMPL_MANAGER_ROLE,
282
+ COMPLIANCE_WIRING_ROLE,
283
+ UPGRADE_MANAGER_ROLE,
284
+ DEFAULT_ADMIN_ROLE
285
+ ] = await Promise.all([
286
+ client.FEE_MANAGER_ROLE(),
287
+ client.IMPL_MANAGER_ROLE(),
288
+ client.COMPLIANCE_WIRING_ROLE(),
289
+ client.UPGRADE_MANAGER_ROLE(),
290
+ client.DEFAULT_ADMIN_ROLE()
291
+ ]);
292
+ return {
293
+ FEE_MANAGER_ROLE,
294
+ IMPL_MANAGER_ROLE,
295
+ COMPLIANCE_WIRING_ROLE,
296
+ UPGRADE_MANAGER_ROLE,
297
+ DEFAULT_ADMIN_ROLE
298
+ };
299
+ },
300
+ enabled: Boolean(client && (args.query?.enabled ?? true))
301
+ });
302
+ }
303
+ function useFactoryRoleMembers(args = {}) {
304
+ const { role, ...base } = args;
305
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
306
+ return useQuery({
307
+ ...args.query,
308
+ queryKey: airdropKeys.factoryRoleMembers({ chainId, address: resolvedAddress }, role),
309
+ queryFn: async () => {
310
+ const [members, count] = await Promise.all([
311
+ client.getRoleMembers(role),
312
+ client.getRoleMemberCount(role)
313
+ ]);
314
+ return { members, count };
315
+ },
316
+ enabled: Boolean(client && role && (args.query?.enabled ?? true))
317
+ });
318
+ }
319
+ function useFactoryUpgradeabilityPolicy(args = {}) {
320
+ const { creator, ...base } = args;
321
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
322
+ return useQuery({
323
+ ...args.query,
324
+ queryKey: airdropKeys.upgradeabilityPolicy({ chainId, address: resolvedAddress }, creator),
325
+ queryFn: async () => {
326
+ const [defaultUpgradeable, policy, effective] = await Promise.all([
327
+ client.defaultUpgradeable(),
328
+ client.getUpgradeabilityPolicy(creator),
329
+ client.effectiveUpgradeable(creator)
330
+ ]);
331
+ return {
332
+ defaultUpgradeable,
333
+ overridden: policy.overridden,
334
+ allowed: policy.allowed,
335
+ effective
336
+ };
337
+ },
338
+ enabled: Boolean(client && creator && (args.query?.enabled ?? true))
339
+ });
340
+ }
341
+ function useMerkleInitCodeHash(args) {
342
+ const { params, mode, ...base } = args;
343
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
344
+ return useQuery({
345
+ ...args.query,
346
+ // `params` omitted deliberately — see useEcdsaInitCodeHash for why.
347
+ queryKey: airdropQueryKey({
348
+ chainId,
33
349
  address: resolvedAddress,
34
- ...resolvedChainId !== void 0 ? { chainId: resolvedChainId } : {},
35
- encryptor: () => resolveEncryptor(encryptorSourceRef.current)
36
- });
37
- }, [resolvedPublicClient, walletClient, resolvedAddress, resolvedChainId]);
38
- return useQuery({
39
- queryKey: buildQueryKey(
40
- "factory:predictAirdropAddress",
41
- resolvedChainId,
42
- resolvedAddress,
43
- params,
44
- userSalt,
45
- deployer,
46
- gasFee
47
- ),
48
- queryFn: () => client.predictAirdropAddress({
49
- params,
50
- userSalt,
51
- deployer,
52
- gasFee
350
+ fn: "getMerkleInitCodeHash",
351
+ args: [mode]
53
352
  }),
54
- enabled: !!client && !!params && !!userSalt && !!deployer && gasFee !== void 0,
55
- staleTime: 0
353
+ queryFn: () => client.getMerkleInitCodeHash({ params, mode }),
354
+ enabled: Boolean(client && (args.query?.enabled ?? true))
355
+ });
356
+ }
357
+ function useSetComplianceDelegate(options = {}) {
358
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
359
+ const queryClient = useQueryClient();
360
+ return useMutation({
361
+ mutationFn: async (args) => {
362
+ if (!client) {
363
+ throw resolutionError ?? new MissingClientError("useSetComplianceDelegate", "factory");
364
+ }
365
+ return client.setComplianceDelegate(args.delegate, args.account);
366
+ },
367
+ onSuccess: () => {
368
+ void queryClient.invalidateQueries({
369
+ queryKey: airdropQueryKey({
370
+ chainId,
371
+ address: resolvedAddress,
372
+ fn: "complianceDelegate",
373
+ args: []
374
+ })
375
+ });
376
+ }
377
+ });
378
+ }
379
+ function useSetComplianceManagerImpl(options = {}) {
380
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
381
+ const queryClient = useQueryClient();
382
+ return useMutation({
383
+ mutationFn: async (args) => {
384
+ if (!client) {
385
+ throw resolutionError ?? new MissingClientError("useSetComplianceManagerImpl", "factory");
386
+ }
387
+ return client.setComplianceManagerImpl(args.implementation, args.account);
388
+ },
389
+ onSuccess: () => {
390
+ void queryClient.invalidateQueries({
391
+ queryKey: airdropKeys.implementations({ chainId, address: resolvedAddress })
392
+ });
393
+ }
394
+ });
395
+ }
396
+ function useSetCompliancePolicy(options = {}) {
397
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
398
+ const queryClient = useQueryClient();
399
+ return useMutation({
400
+ mutationFn: async (args) => {
401
+ if (!client) {
402
+ throw resolutionError ?? new MissingClientError("useSetCompliancePolicy", "factory");
403
+ }
404
+ return client.setCompliancePolicy(args.creator, args.delegateToCompliance, args.account);
405
+ },
406
+ onSuccess: (_hash, variables) => {
407
+ const scope = { chainId, address: resolvedAddress };
408
+ void queryClient.invalidateQueries({
409
+ queryKey: airdropKeys.compliancePolicy(scope, variables.creator)
410
+ });
411
+ void queryClient.invalidateQueries({
412
+ queryKey: airdropQueryKey({
413
+ ...scope,
414
+ fn: "effectiveDelegateToCompliance",
415
+ args: [variables.creator]
416
+ })
417
+ });
418
+ }
419
+ });
420
+ }
421
+ function useSetCustomFee(options = {}) {
422
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
423
+ const queryClient = useQueryClient();
424
+ return useMutation({
425
+ mutationFn: async ({ creator, gasFee, account }) => {
426
+ if (!client) {
427
+ throw resolutionError ?? new MissingClientError("useSetCustomFee", "factory");
428
+ }
429
+ return client.setCustomFee(creator, gasFee, account);
430
+ },
431
+ onSuccess: (_hash, variables) => {
432
+ void queryClient.invalidateQueries({
433
+ queryKey: airdropKeys.customFee({ chainId, address: resolvedAddress }, variables.creator)
434
+ });
435
+ }
436
+ });
437
+ }
438
+ function useSetDefaultDelegateToCompliance(options = {}) {
439
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
440
+ const queryClient = useQueryClient();
441
+ return useMutation({
442
+ mutationFn: async (args) => {
443
+ if (!client) {
444
+ throw resolutionError ?? new MissingClientError("useSetDefaultDelegateToCompliance", "factory");
445
+ }
446
+ return client.setDefaultDelegateToCompliance(args.on, args.account);
447
+ },
448
+ onSuccess: () => {
449
+ void queryClient.invalidateQueries({
450
+ queryKey: airdropQueryKeyPrefix({
451
+ chainId,
452
+ address: resolvedAddress,
453
+ fn: "effectiveDelegateToCompliance"
454
+ })
455
+ });
456
+ void queryClient.invalidateQueries({
457
+ queryKey: airdropKeys.compliancePolicyAll({ chainId, address: resolvedAddress })
458
+ });
459
+ }
460
+ });
461
+ }
462
+ function useSetDefaultGasFee(options = {}) {
463
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
464
+ const queryClient = useQueryClient();
465
+ return useMutation({
466
+ mutationFn: async ({ gasFee, account }) => {
467
+ if (!client) {
468
+ throw resolutionError ?? new MissingClientError("useSetDefaultGasFee", "factory");
469
+ }
470
+ return client.setDefaultGasFee(gasFee, account);
471
+ },
472
+ onSuccess: () => {
473
+ void queryClient.invalidateQueries({
474
+ queryKey: airdropKeys.fees({ chainId, address: resolvedAddress })
475
+ });
476
+ }
477
+ });
478
+ }
479
+ function useSetDefaultUpgradeable(options = {}) {
480
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
481
+ const queryClient = useQueryClient();
482
+ return useMutation({
483
+ mutationFn: async (args) => {
484
+ if (!client) {
485
+ throw resolutionError ?? new MissingClientError("useSetDefaultUpgradeable", "factory");
486
+ }
487
+ return client.setDefaultUpgradeable(args.allowed, args.account);
488
+ },
489
+ onSuccess: () => {
490
+ const scope = { chainId, address: resolvedAddress };
491
+ void queryClient.invalidateQueries({
492
+ queryKey: airdropQueryKeyPrefix({ ...scope, fn: "effectiveUpgradeable" })
493
+ });
494
+ void queryClient.invalidateQueries({
495
+ queryKey: airdropKeys.upgradeabilityPolicyAll(scope)
496
+ });
497
+ void queryClient.invalidateQueries({
498
+ queryKey: airdropKeys.preflightCreateAll(scope)
499
+ });
500
+ }
501
+ });
502
+ }
503
+ function useSetEcdsaImplementation(options = {}) {
504
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
505
+ const queryClient = useQueryClient();
506
+ return useMutation({
507
+ mutationFn: async ({ implementation, account }) => {
508
+ if (!client) {
509
+ throw resolutionError ?? new MissingClientError("useSetEcdsaImplementation", "factory");
510
+ }
511
+ return client.setEcdsaImplementation(implementation, account);
512
+ },
513
+ onSuccess: () => {
514
+ const scope = { chainId, address: resolvedAddress };
515
+ void queryClient.invalidateQueries({ queryKey: airdropKeys.implementations(scope) });
516
+ void queryClient.invalidateQueries({
517
+ queryKey: airdropQueryKeyPrefix({ ...scope, fn: "getEcdsaInitCodeHash" })
518
+ });
519
+ void queryClient.invalidateQueries({
520
+ queryKey: airdropQueryKeyPrefix({ ...scope, fn: "predictEcdsaAirdropAddress" })
521
+ });
522
+ void queryClient.invalidateQueries({
523
+ queryKey: airdropKeys.preflightCreateAll(scope)
524
+ });
525
+ }
526
+ });
527
+ }
528
+ function useSetFeeCollector(options = {}) {
529
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
530
+ const queryClient = useQueryClient();
531
+ return useMutation({
532
+ mutationFn: async ({ feeCollector, account }) => {
533
+ if (!client) {
534
+ throw resolutionError ?? new MissingClientError("useSetFeeCollector", "factory");
535
+ }
536
+ return client.setFeeCollector(feeCollector, account);
537
+ },
538
+ onSuccess: () => {
539
+ void queryClient.invalidateQueries({
540
+ queryKey: airdropKeys.fees({ chainId, address: resolvedAddress })
541
+ });
542
+ }
543
+ });
544
+ }
545
+ function useSetMerkleImplementation(options = {}) {
546
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
547
+ const queryClient = useQueryClient();
548
+ return useMutation({
549
+ mutationFn: async ({ implementation, account }) => {
550
+ if (!client) {
551
+ throw resolutionError ?? new MissingClientError("useSetMerkleImplementation", "factory");
552
+ }
553
+ return client.setMerkleImplementation(implementation, account);
554
+ },
555
+ onSuccess: () => {
556
+ const scope = { chainId, address: resolvedAddress };
557
+ void queryClient.invalidateQueries({ queryKey: airdropKeys.implementations(scope) });
558
+ void queryClient.invalidateQueries({
559
+ queryKey: airdropQueryKeyPrefix({ ...scope, fn: "getMerkleInitCodeHash" })
560
+ });
561
+ void queryClient.invalidateQueries({
562
+ queryKey: airdropQueryKeyPrefix({ ...scope, fn: "predictMerkleAirdropAddress" })
563
+ });
564
+ void queryClient.invalidateQueries({
565
+ queryKey: airdropKeys.preflightCreateAll(scope)
566
+ });
567
+ }
568
+ });
569
+ }
570
+ function useSetUpgradeabilityPolicy(options = {}) {
571
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
572
+ const queryClient = useQueryClient();
573
+ return useMutation({
574
+ mutationFn: async (args) => {
575
+ if (!client) {
576
+ throw resolutionError ?? new MissingClientError("useSetUpgradeabilityPolicy", "factory");
577
+ }
578
+ return client.setUpgradeabilityPolicy(args.creator, args.allowed, args.account);
579
+ },
580
+ onSuccess: (_hash, variables) => {
581
+ const scope = { chainId, address: resolvedAddress };
582
+ void queryClient.invalidateQueries({
583
+ queryKey: airdropQueryKey({
584
+ ...scope,
585
+ fn: "effectiveUpgradeable",
586
+ args: [variables.creator]
587
+ })
588
+ });
589
+ void queryClient.invalidateQueries({
590
+ queryKey: airdropKeys.upgradeabilityPolicy(scope, variables.creator)
591
+ });
592
+ void queryClient.invalidateQueries({
593
+ queryKey: airdropKeys.preflightCreateAll(scope)
594
+ });
595
+ }
56
596
  });
57
597
  }
58
598
 
59
- export { usePredictAirdropAddress };
599
+ export { useClearCompliancePolicy, useClearUpgradeabilityPolicy, useDisableCustomFee, useEcdsaInitCodeHash, useFactoryComplianceDelegate, useFactoryCompliancePolicy, useFactoryCustomFee, useFactoryGrantRole, useFactoryHasRole, useFactoryImplementations, useFactoryRenounceRole, useFactoryRevokeRole, useFactoryRoleConstants, useFactoryRoleMembers, useFactoryUpgradeabilityPolicy, useMerkleInitCodeHash, usePredictEcdsaAirdropAddress, usePredictMerkleAirdropAddress, useSetComplianceDelegate, useSetComplianceManagerImpl, useSetCompliancePolicy, useSetCustomFee, useSetDefaultDelegateToCompliance, useSetDefaultGasFee, useSetDefaultUpgradeable, useSetEcdsaImplementation, useSetFeeCollector, useSetMerkleImplementation, useSetUpgradeabilityPolicy };
@@ -0,0 +1,28 @@
1
+ import { type UseMutationResult } from "@tanstack/react-query";
2
+ import type { Address, Hex } from "viem";
3
+ import type { WriteAccountOverride } from "../../airdrop-base.js";
4
+ import { type AirdropClientOptions } from "../../react/_shared.js";
5
+ /** @alpha */
6
+ export interface ClearCompliancePolicyArgs extends WriteAccountOverride {
7
+ /** The creator whose override is dropped - not the admin sending the transaction. */
8
+ creator: Address;
9
+ }
10
+ /**
11
+ * Drop a creator's {@link useSetCompliancePolicy} override, reverting them to
12
+ * the factory default. Requires `COMPLIANCE_WIRING_ROLE`.
13
+ *
14
+ * The cleared state is `overridden: false, delegateToCompliance: false`, so
15
+ * `effectiveDelegateToCompliance` then follows the factory default set by
16
+ * {@link useSetDefaultDelegateToCompliance} rather than staying at whatever
17
+ * the override had been.
18
+ *
19
+ * **Invalidates:** `fn "compliancePolicy"` and
20
+ * `fn "effectiveDelegateToCompliance"`, both keyed on `args.creator`.
21
+ *
22
+ * @example
23
+ * const clearPolicy = useClearCompliancePolicy();
24
+ * await clearPolicy.mutateAsync({ creator });
25
+ *
26
+ * @alpha
27
+ */
28
+ export declare function useClearCompliancePolicy(options?: AirdropClientOptions): UseMutationResult<Hex, Error, ClearCompliancePolicyArgs>;