@tokenops/sdk 1.0.0

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 (371) hide show
  1. package/CHANGELOG.md +207 -0
  2. package/CONTRIBUTING.md +113 -0
  3. package/LICENSE +32 -0
  4. package/README.md +677 -0
  5. package/SECURITY.md +59 -0
  6. package/dist/chunk-52TC6BF7.js +2755 -0
  7. package/dist/chunk-56UI7LUR.cjs +516 -0
  8. package/dist/chunk-5SA2HF2W.cjs +1635 -0
  9. package/dist/chunk-5SGMJADP.cjs +139 -0
  10. package/dist/chunk-62DF53UQ.cjs +749 -0
  11. package/dist/chunk-66IHPTOK.cjs +20 -0
  12. package/dist/chunk-6ECAHP5O.cjs +1496 -0
  13. package/dist/chunk-72YGZEQE.js +742 -0
  14. package/dist/chunk-7VELUOMI.js +35 -0
  15. package/dist/chunk-BE2AIZ3K.js +23 -0
  16. package/dist/chunk-CMRETRZO.js +46 -0
  17. package/dist/chunk-COPFW5Z4.js +82 -0
  18. package/dist/chunk-CQIPRNS7.cjs +25 -0
  19. package/dist/chunk-ECT3NL2L.js +124 -0
  20. package/dist/chunk-FWHYQZ5E.cjs +37 -0
  21. package/dist/chunk-FYQ2UW4T.js +37 -0
  22. package/dist/chunk-HGXNRR25.js +105 -0
  23. package/dist/chunk-HTOMTEA3.cjs +3406 -0
  24. package/dist/chunk-ITQ7WKVC.cjs +101 -0
  25. package/dist/chunk-IVE3QEGD.js +478 -0
  26. package/dist/chunk-JFLEEXKP.js +325 -0
  27. package/dist/chunk-JFR5J4FL.cjs +128 -0
  28. package/dist/chunk-K6MFFDBJ.cjs +109 -0
  29. package/dist/chunk-KWFFIJYX.js +11 -0
  30. package/dist/chunk-NS44KBV5.cjs +89 -0
  31. package/dist/chunk-OLDGMKW2.cjs +93 -0
  32. package/dist/chunk-Q2GP5UDC.js +29 -0
  33. package/dist/chunk-Q7ARQSUH.cjs +42 -0
  34. package/dist/chunk-QCA7O2Q5.cjs +49 -0
  35. package/dist/chunk-QIHZVLIK.js +3388 -0
  36. package/dist/chunk-SUOG3BQS.cjs +2772 -0
  37. package/dist/chunk-T5LVV3KY.cjs +44 -0
  38. package/dist/chunk-UOG4PJL5.js +1488 -0
  39. package/dist/chunk-VDXVNZCO.cjs +329 -0
  40. package/dist/chunk-VJKZWYYJ.cjs +32 -0
  41. package/dist/chunk-WRCUDSUJ.js +96 -0
  42. package/dist/chunk-XSNLAS5M.js +135 -0
  43. package/dist/chunk-XXXDQSHE.js +1628 -0
  44. package/dist/chunk-ZHFLRKFY.js +41 -0
  45. package/dist/chunk-ZXCOJY2Z.js +87 -0
  46. package/dist/core/addresses.d.ts +59 -0
  47. package/dist/core/brands.d.ts +87 -0
  48. package/dist/core/chains.d.ts +102 -0
  49. package/dist/core/errors.d.ts +687 -0
  50. package/dist/core/index.d.ts +7 -0
  51. package/dist/core/normalise.d.ts +27 -0
  52. package/dist/core/preflight.d.ts +25 -0
  53. package/dist/core/revert-mapper.d.ts +74 -0
  54. package/dist/core/telemetry.d.ts +50 -0
  55. package/dist/core/types.d.ts +10 -0
  56. package/dist/core/version.d.ts +15 -0
  57. package/dist/core/zama-error-mapper.d.ts +27 -0
  58. package/dist/fhe/acl.d.ts +73 -0
  59. package/dist/fhe/erc7984-abi.d.ts +53 -0
  60. package/dist/fhe/index.cjs +599 -0
  61. package/dist/fhe/index.d.cts +11 -0
  62. package/dist/fhe/index.d.ts +11 -0
  63. package/dist/fhe/index.js +394 -0
  64. package/dist/fhe/mock-encryptor.d.ts +90 -0
  65. package/dist/fhe/mock-erc7984.d.ts +134 -0
  66. package/dist/fhe/operators.d.ts +190 -0
  67. package/dist/fhe/react/index.cjs +102 -0
  68. package/dist/fhe/react/index.d.cts +10 -0
  69. package/dist/fhe/react/index.d.ts +10 -0
  70. package/dist/fhe/react/index.js +85 -0
  71. package/dist/fhe/react/use-decrypted-handle.d.ts +102 -0
  72. package/dist/fhe/scale-ratio.d.ts +168 -0
  73. package/dist/fhe/sepolia-encryptor-web.d.ts +101 -0
  74. package/dist/fhe/sepolia-encryptor.d.ts +132 -0
  75. package/dist/fhe/types.d.ts +62 -0
  76. package/dist/fhe-airdrop/abis/cloneable.d.ts +781 -0
  77. package/dist/fhe-airdrop/abis/factory.d.ts +714 -0
  78. package/dist/fhe-airdrop/abis/index.d.ts +2 -0
  79. package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +53 -0
  80. package/dist/fhe-airdrop/advanced/index.cjs +21 -0
  81. package/dist/fhe-airdrop/advanced/index.d.cts +13 -0
  82. package/dist/fhe-airdrop/advanced/index.d.ts +13 -0
  83. package/dist/fhe-airdrop/advanced/index.js +8 -0
  84. package/dist/fhe-airdrop/advanced/react/index.cjs +61 -0
  85. package/dist/fhe-airdrop/advanced/react/index.d.cts +5 -0
  86. package/dist/fhe-airdrop/advanced/react/index.d.ts +5 -0
  87. package/dist/fhe-airdrop/advanced/react/index.js +59 -0
  88. package/dist/fhe-airdrop/advanced/react/usePredictAirdropAddress.d.ts +49 -0
  89. package/dist/fhe-airdrop/airdrop.d.ts +308 -0
  90. package/dist/fhe-airdrop/encryption.d.ts +109 -0
  91. package/dist/fhe-airdrop/errors.d.ts +60 -0
  92. package/dist/fhe-airdrop/factory.d.ts +281 -0
  93. package/dist/fhe-airdrop/index.cjs +227 -0
  94. package/dist/fhe-airdrop/index.d.cts +10 -0
  95. package/dist/fhe-airdrop/index.d.ts +10 -0
  96. package/dist/fhe-airdrop/index.js +10 -0
  97. package/dist/fhe-airdrop/react/_shared.d.ts +107 -0
  98. package/dist/fhe-airdrop/react/index.cjs +638 -0
  99. package/dist/fhe-airdrop/react/index.d.cts +90 -0
  100. package/dist/fhe-airdrop/react/index.d.ts +90 -0
  101. package/dist/fhe-airdrop/react/index.js +430 -0
  102. package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +31 -0
  103. package/dist/fhe-airdrop/react/useAirdropCanExtendClaimWindow.d.ts +7 -0
  104. package/dist/fhe-airdrop/react/useAirdropClaim.d.ts +25 -0
  105. package/dist/fhe-airdrop/react/useAirdropClaimTypehash.d.ts +10 -0
  106. package/dist/fhe-airdrop/react/useAirdropClaimedSignatures.d.ts +16 -0
  107. package/dist/fhe-airdrop/react/useAirdropDeploymentBlockNumber.d.ts +6 -0
  108. package/dist/fhe-airdrop/react/useAirdropDomainSeparator.d.ts +8 -0
  109. package/dist/fhe-airdrop/react/useAirdropEndTime.d.ts +10 -0
  110. package/dist/fhe-airdrop/react/useAirdropFactoryCustomFee.d.ts +17 -0
  111. package/dist/fhe-airdrop/react/useAirdropFactoryDefaultGasFee.d.ts +10 -0
  112. package/dist/fhe-airdrop/react/useAirdropFactoryDisableCustomFee.d.ts +15 -0
  113. package/dist/fhe-airdrop/react/useAirdropFactoryFeeCollector.d.ts +11 -0
  114. package/dist/fhe-airdrop/react/useAirdropFactoryInitCodeHash.d.ts +17 -0
  115. package/dist/fhe-airdrop/react/useAirdropFactorySetCustomFee.d.ts +17 -0
  116. package/dist/fhe-airdrop/react/useAirdropFactorySetDefaultGasFee.d.ts +16 -0
  117. package/dist/fhe-airdrop/react/useAirdropFactorySetFeeCollector.d.ts +15 -0
  118. package/dist/fhe-airdrop/react/useAirdropGasFee.d.ts +11 -0
  119. package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +16 -0
  120. package/dist/fhe-airdrop/react/useAirdropHasClaimEnded.d.ts +7 -0
  121. package/dist/fhe-airdrop/react/useAirdropHasClaimStarted.d.ts +7 -0
  122. package/dist/fhe-airdrop/react/useAirdropHasRole.d.ts +14 -0
  123. package/dist/fhe-airdrop/react/useAirdropIsClaimWindowActive.d.ts +9 -0
  124. package/dist/fhe-airdrop/react/useAirdropIsPaused.d.ts +8 -0
  125. package/dist/fhe-airdrop/react/useAirdropIsSignatureClaimed.d.ts +22 -0
  126. package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +50 -0
  127. package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +15 -0
  128. package/dist/fhe-airdrop/react/useAirdropStartTime.d.ts +10 -0
  129. package/dist/fhe-airdrop/react/useAirdropToken.d.ts +11 -0
  130. package/dist/fhe-airdrop/react/useAirdropWithdrawGasFee.d.ts +15 -0
  131. package/dist/fhe-airdrop/react/useAirdropWithdrawOtherConfidentialToken.d.ts +14 -0
  132. package/dist/fhe-airdrop/react/useAirdropWithdrawOtherToken.d.ts +14 -0
  133. package/dist/fhe-airdrop/react/useClaim.d.ts +29 -0
  134. package/dist/fhe-airdrop/react/useConfidentialAirdropFactoryImplementation.d.ts +11 -0
  135. package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +33 -0
  136. package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +40 -0
  137. package/dist/fhe-airdrop/react/useCreateConfidentialAirdrop.d.ts +29 -0
  138. package/dist/fhe-airdrop/react/useCreateConfidentialAirdropAndGetAddress.d.ts +31 -0
  139. package/dist/fhe-airdrop/react/useDisableCustomFee.d.ts +14 -0
  140. package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +16 -0
  141. package/dist/fhe-airdrop/react/useFactoryCustomFee.d.ts +17 -0
  142. package/dist/fhe-airdrop/react/useFactoryDefaultGasFee.d.ts +10 -0
  143. package/dist/fhe-airdrop/react/useFactoryFeeCollector.d.ts +11 -0
  144. package/dist/fhe-airdrop/react/useFactoryInitCodeHash.d.ts +17 -0
  145. package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +25 -0
  146. package/dist/fhe-airdrop/react/useGetClaimAmount.d.ts +30 -0
  147. package/dist/fhe-airdrop/react/useSetCustomFee.d.ts +16 -0
  148. package/dist/fhe-airdrop/react/useSetDefaultGasFee.d.ts +15 -0
  149. package/dist/fhe-airdrop/react/useSetFeeCollector.d.ts +14 -0
  150. package/dist/fhe-airdrop/react/useSetPaused.d.ts +14 -0
  151. package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +31 -0
  152. package/dist/fhe-airdrop/react/useWithdraw.d.ts +12 -0
  153. package/dist/fhe-airdrop/react/useWithdrawOtherConfidentialToken.d.ts +13 -0
  154. package/dist/fhe-airdrop/react/useWithdrawOtherToken.d.ts +13 -0
  155. package/dist/fhe-airdrop/types.d.ts +21 -0
  156. package/dist/fhe-disperse/abis/index.d.ts +2 -0
  157. package/dist/fhe-disperse/abis/singleton.d.ts +1297 -0
  158. package/dist/fhe-disperse/abis/wallet.d.ts +111 -0
  159. package/dist/fhe-disperse/encryption.d.ts +77 -0
  160. package/dist/fhe-disperse/errors.d.ts +39 -0
  161. package/dist/fhe-disperse/index.cjs +248 -0
  162. package/dist/fhe-disperse/index.d.cts +14 -0
  163. package/dist/fhe-disperse/index.d.ts +14 -0
  164. package/dist/fhe-disperse/index.js +11 -0
  165. package/dist/fhe-disperse/react/_shared.d.ts +104 -0
  166. package/dist/fhe-disperse/react/index.cjs +752 -0
  167. package/dist/fhe-disperse/react/index.d.cts +82 -0
  168. package/dist/fhe-disperse/react/index.d.ts +82 -0
  169. package/dist/fhe-disperse/react/index.js +522 -0
  170. package/dist/fhe-disperse/react/useAccessEncryptedFeeReserve.d.ts +35 -0
  171. package/dist/fhe-disperse/react/useApproveTokenOnWallets.d.ts +25 -0
  172. package/dist/fhe-disperse/react/useBatchDiscloseHandlesToParty.d.ts +16 -0
  173. package/dist/fhe-disperse/react/useCalculateFee.d.ts +26 -0
  174. package/dist/fhe-disperse/react/useDeploymentBlockNumber.d.ts +11 -0
  175. package/dist/fhe-disperse/react/useDisableCustomFee.d.ts +20 -0
  176. package/dist/fhe-disperse/react/useDiscloseHandleToParty.d.ts +20 -0
  177. package/dist/fhe-disperse/react/useDisperse.d.ts +28 -0
  178. package/dist/fhe-disperse/react/useGetBatchLimits.d.ts +12 -0
  179. package/dist/fhe-disperse/react/useGetFeeConfig.d.ts +15 -0
  180. package/dist/fhe-disperse/react/useGetFees.d.ts +19 -0
  181. package/dist/fhe-disperse/react/useGetWallets.d.ts +19 -0
  182. package/dist/fhe-disperse/react/useGrantRole.d.ts +24 -0
  183. package/dist/fhe-disperse/react/useHasApprovedSubwallets.d.ts +25 -0
  184. package/dist/fhe-disperse/react/useHasRole.d.ts +22 -0
  185. package/dist/fhe-disperse/react/useIsPaused.d.ts +11 -0
  186. package/dist/fhe-disperse/react/useIsRegistered.d.ts +15 -0
  187. package/dist/fhe-disperse/react/usePause.d.ts +18 -0
  188. package/dist/fhe-disperse/react/usePredictWallets.d.ts +19 -0
  189. package/dist/fhe-disperse/react/usePreflightDisperse.d.ts +37 -0
  190. package/dist/fhe-disperse/react/useRecoverERC20FromWallets.d.ts +21 -0
  191. package/dist/fhe-disperse/react/useRecoverFromWallets.d.ts +21 -0
  192. package/dist/fhe-disperse/react/useRegister.d.ts +40 -0
  193. package/dist/fhe-disperse/react/useRescueConfidentialTokens.d.ts +21 -0
  194. package/dist/fhe-disperse/react/useRescueERC20.d.ts +21 -0
  195. package/dist/fhe-disperse/react/useRevokeRole.d.ts +24 -0
  196. package/dist/fhe-disperse/react/useRevokeTokenOnWallets.d.ts +24 -0
  197. package/dist/fhe-disperse/react/useSetCustomFee.d.ts +24 -0
  198. package/dist/fhe-disperse/react/useSetFeeConfig.d.ts +23 -0
  199. package/dist/fhe-disperse/react/useSetMaxBatchSizeDirect.d.ts +20 -0
  200. package/dist/fhe-disperse/react/useSetMaxBatchSizeHolding.d.ts +20 -0
  201. package/dist/fhe-disperse/react/useSetMaxBatchSizeTokenFee.d.ts +20 -0
  202. package/dist/fhe-disperse/react/useSingletonBatchDiscloseHandlesToParty.d.ts +13 -0
  203. package/dist/fhe-disperse/react/useSingletonBatchLimits.d.ts +12 -0
  204. package/dist/fhe-disperse/react/useSingletonCalculateFee.d.ts +26 -0
  205. package/dist/fhe-disperse/react/useSingletonDeploymentBlockNumber.d.ts +11 -0
  206. package/dist/fhe-disperse/react/useSingletonDisableCustomFee.d.ts +21 -0
  207. package/dist/fhe-disperse/react/useSingletonDiscloseHandleToParty.d.ts +17 -0
  208. package/dist/fhe-disperse/react/useSingletonFees.d.ts +19 -0
  209. package/dist/fhe-disperse/react/useSingletonGrantRole.d.ts +26 -0
  210. package/dist/fhe-disperse/react/useSingletonHasApprovedSubwallets.d.ts +25 -0
  211. package/dist/fhe-disperse/react/useSingletonHasRole.d.ts +23 -0
  212. package/dist/fhe-disperse/react/useSingletonIsPaused.d.ts +11 -0
  213. package/dist/fhe-disperse/react/useSingletonIsRegistered.d.ts +15 -0
  214. package/dist/fhe-disperse/react/useSingletonPause.d.ts +19 -0
  215. package/dist/fhe-disperse/react/useSingletonPredictWallets.d.ts +19 -0
  216. package/dist/fhe-disperse/react/useSingletonRevokeRole.d.ts +26 -0
  217. package/dist/fhe-disperse/react/useSingletonSetCustomFee.d.ts +25 -0
  218. package/dist/fhe-disperse/react/useSingletonUnpause.d.ts +18 -0
  219. package/dist/fhe-disperse/react/useSingletonWalletImplementation.d.ts +12 -0
  220. package/dist/fhe-disperse/react/useSingletonWallets.d.ts +19 -0
  221. package/dist/fhe-disperse/react/useSingletonWithdrawGasFee.d.ts +21 -0
  222. package/dist/fhe-disperse/react/useSingletonWithdrawTokenFee.d.ts +50 -0
  223. package/dist/fhe-disperse/react/useUnpause.d.ts +17 -0
  224. package/dist/fhe-disperse/react/useWalletImplementation.d.ts +12 -0
  225. package/dist/fhe-disperse/react/useWithdrawGasFee.d.ts +26 -0
  226. package/dist/fhe-disperse/react/useWithdrawTokenFee.d.ts +70 -0
  227. package/dist/fhe-disperse/singleton.d.ts +442 -0
  228. package/dist/fhe-disperse/subtotals.d.ts +14 -0
  229. package/dist/fhe-disperse/types.d.ts +332 -0
  230. package/dist/fhe-disperse/validate.d.ts +78 -0
  231. package/dist/fhe-vesting/abis/factory.d.ts +676 -0
  232. package/dist/fhe-vesting/abis/index.d.ts +3 -0
  233. package/dist/fhe-vesting/abis/manager.d.ts +1797 -0
  234. package/dist/fhe-vesting/advanced/factory-advanced.d.ts +52 -0
  235. package/dist/fhe-vesting/advanced/index.cjs +21 -0
  236. package/dist/fhe-vesting/advanced/index.d.cts +12 -0
  237. package/dist/fhe-vesting/advanced/index.d.ts +12 -0
  238. package/dist/fhe-vesting/advanced/index.js +8 -0
  239. package/dist/fhe-vesting/advanced/react/index.cjs +75 -0
  240. package/dist/fhe-vesting/advanced/react/index.d.cts +5 -0
  241. package/dist/fhe-vesting/advanced/react/index.d.ts +5 -0
  242. package/dist/fhe-vesting/advanced/react/index.js +73 -0
  243. package/dist/fhe-vesting/advanced/react/usePredictManagerAddress.d.ts +41 -0
  244. package/dist/fhe-vesting/encryption.d.ts +104 -0
  245. package/dist/fhe-vesting/errors.d.ts +183 -0
  246. package/dist/fhe-vesting/factory.d.ts +207 -0
  247. package/dist/fhe-vesting/index.cjs +269 -0
  248. package/dist/fhe-vesting/index.d.cts +9 -0
  249. package/dist/fhe-vesting/index.d.ts +9 -0
  250. package/dist/fhe-vesting/index.js +12 -0
  251. package/dist/fhe-vesting/manager.d.ts +808 -0
  252. package/dist/fhe-vesting/react/_shared.d.ts +122 -0
  253. package/dist/fhe-vesting/react/index.cjs +1054 -0
  254. package/dist/fhe-vesting/react/index.d.cts +123 -0
  255. package/dist/fhe-vesting/react/index.d.ts +123 -0
  256. package/dist/fhe-vesting/react/index.js +771 -0
  257. package/dist/fhe-vesting/react/useAcceptVestingTransfer.d.ts +12 -0
  258. package/dist/fhe-vesting/react/useAccessClaimableAmount.d.ts +14 -0
  259. package/dist/fhe-vesting/react/useAccessSettledAmount.d.ts +15 -0
  260. package/dist/fhe-vesting/react/useAccessTotalAllocation.d.ts +14 -0
  261. package/dist/fhe-vesting/react/useAccessVestedAmount.d.ts +26 -0
  262. package/dist/fhe-vesting/react/useAdminBatchDiscloseToParty.d.ts +16 -0
  263. package/dist/fhe-vesting/react/useAdminClaim.d.ts +9 -0
  264. package/dist/fhe-vesting/react/useAdminDiscloseToParty.d.ts +8 -0
  265. package/dist/fhe-vesting/react/useAdminGetClaimableAmount.d.ts +13 -0
  266. package/dist/fhe-vesting/react/useAdminGetSettledAmount.d.ts +13 -0
  267. package/dist/fhe-vesting/react/useAdminGetTokenBalance.d.ts +13 -0
  268. package/dist/fhe-vesting/react/useAdminGetTotalAllocation.d.ts +13 -0
  269. package/dist/fhe-vesting/react/useAdminGetVestedAmount.d.ts +15 -0
  270. package/dist/fhe-vesting/react/useAdminPartialClaim.d.ts +8 -0
  271. package/dist/fhe-vesting/react/useAllRecipients.d.ts +8 -0
  272. package/dist/fhe-vesting/react/useAllRecipientsLength.d.ts +6 -0
  273. package/dist/fhe-vesting/react/useAllRecipientsSliced.d.ts +13 -0
  274. package/dist/fhe-vesting/react/useBatchCreateVesting.d.ts +24 -0
  275. package/dist/fhe-vesting/react/useBatchDiscloseHandlesToParty.d.ts +13 -0
  276. package/dist/fhe-vesting/react/useBatchDiscloseToParty.d.ts +18 -0
  277. package/dist/fhe-vesting/react/useBatchRevokeVesting.d.ts +12 -0
  278. package/dist/fhe-vesting/react/useCancelVestingTransfer.d.ts +12 -0
  279. package/dist/fhe-vesting/react/useClaim.d.ts +19 -0
  280. package/dist/fhe-vesting/react/useConfidentialVestingFactoryImplementation.d.ts +11 -0
  281. package/dist/fhe-vesting/react/useCreateManager.d.ts +32 -0
  282. package/dist/fhe-vesting/react/useCreateManagerAndGetAddress.d.ts +31 -0
  283. package/dist/fhe-vesting/react/useCreateVesting.d.ts +38 -0
  284. package/dist/fhe-vesting/react/useDirectVestingTransfer.d.ts +13 -0
  285. package/dist/fhe-vesting/react/useDisableCustomFee.d.ts +14 -0
  286. package/dist/fhe-vesting/react/useDiscloseHandleToParty.d.ts +14 -0
  287. package/dist/fhe-vesting/react/useDiscloseToParty.d.ts +14 -0
  288. package/dist/fhe-vesting/react/useFactoryCustomFee.d.ts +17 -0
  289. package/dist/fhe-vesting/react/useFactoryDefaultFeeType.d.ts +11 -0
  290. package/dist/fhe-vesting/react/useFactoryDefaultGasFee.d.ts +10 -0
  291. package/dist/fhe-vesting/react/useFactoryDefaultTokenFee.d.ts +10 -0
  292. package/dist/fhe-vesting/react/useFactoryFeeCollector.d.ts +10 -0
  293. package/dist/fhe-vesting/react/useFactoryInitCodeHash.d.ts +18 -0
  294. package/dist/fhe-vesting/react/useGetClaimableAmount.d.ts +13 -0
  295. package/dist/fhe-vesting/react/useGetSettledAmount.d.ts +14 -0
  296. package/dist/fhe-vesting/react/useGetTotalAllocation.d.ts +13 -0
  297. package/dist/fhe-vesting/react/useGetVestedAmount.d.ts +25 -0
  298. package/dist/fhe-vesting/react/useGrantRole.d.ts +15 -0
  299. package/dist/fhe-vesting/react/useHasRole.d.ts +14 -0
  300. package/dist/fhe-vesting/react/useInitiateVestingTransfer.d.ts +12 -0
  301. package/dist/fhe-vesting/react/useIsRecipient.d.ts +10 -0
  302. package/dist/fhe-vesting/react/useManagerBatchDiscloseHandlesToParty.d.ts +15 -0
  303. package/dist/fhe-vesting/react/useManagerDeploymentBlockNumber.d.ts +7 -0
  304. package/dist/fhe-vesting/react/useManagerDiscloseHandleToParty.d.ts +16 -0
  305. package/dist/fhe-vesting/react/useManagerFactoryCustomFee.d.ts +17 -0
  306. package/dist/fhe-vesting/react/useManagerFactoryDefaultGasFee.d.ts +10 -0
  307. package/dist/fhe-vesting/react/useManagerFactoryDisableCustomFee.d.ts +15 -0
  308. package/dist/fhe-vesting/react/useManagerFactoryFeeCollector.d.ts +10 -0
  309. package/dist/fhe-vesting/react/useManagerFactoryInitCodeHash.d.ts +18 -0
  310. package/dist/fhe-vesting/react/useManagerFactorySetCustomFee.d.ts +19 -0
  311. package/dist/fhe-vesting/react/useManagerFactorySetDefaultGasFee.d.ts +13 -0
  312. package/dist/fhe-vesting/react/useManagerFactorySetFeeCollector.d.ts +14 -0
  313. package/dist/fhe-vesting/react/useManagerFee.d.ts +7 -0
  314. package/dist/fhe-vesting/react/useManagerFeeInfo.d.ts +18 -0
  315. package/dist/fhe-vesting/react/useManagerFeeType.d.ts +7 -0
  316. package/dist/fhe-vesting/react/useManagerGrantRole.d.ts +17 -0
  317. package/dist/fhe-vesting/react/useManagerHasRole.d.ts +15 -0
  318. package/dist/fhe-vesting/react/useManagerIsPausable.d.ts +6 -0
  319. package/dist/fhe-vesting/react/useManagerIsSplitEnabled.d.ts +6 -0
  320. package/dist/fhe-vesting/react/useManagerMaxBatchSize.d.ts +6 -0
  321. package/dist/fhe-vesting/react/useManagerMaxRevokeBatchSize.d.ts +6 -0
  322. package/dist/fhe-vesting/react/useManagerPause.d.ts +13 -0
  323. package/dist/fhe-vesting/react/useManagerPaused.d.ts +6 -0
  324. package/dist/fhe-vesting/react/useManagerRevokeRole.d.ts +17 -0
  325. package/dist/fhe-vesting/react/useManagerToken.d.ts +11 -0
  326. package/dist/fhe-vesting/react/useManagerUnpause.d.ts +12 -0
  327. package/dist/fhe-vesting/react/useManagerWithdrawGasFee.d.ts +14 -0
  328. package/dist/fhe-vesting/react/useManagerWithdrawOtherConfidentialToken.d.ts +14 -0
  329. package/dist/fhe-vesting/react/useManagerWithdrawOtherToken.d.ts +14 -0
  330. package/dist/fhe-vesting/react/useManagerWithdrawTokenFee.d.ts +11 -0
  331. package/dist/fhe-vesting/react/usePartialClaim.d.ts +15 -0
  332. package/dist/fhe-vesting/react/usePause.d.ts +12 -0
  333. package/dist/fhe-vesting/react/usePendingVestingTransfer.d.ts +20 -0
  334. package/dist/fhe-vesting/react/useRecipientVestings.d.ts +11 -0
  335. package/dist/fhe-vesting/react/useRecipientVestingsLength.d.ts +10 -0
  336. package/dist/fhe-vesting/react/useRecipientVestingsSliced.d.ts +12 -0
  337. package/dist/fhe-vesting/react/useRenounceRole.d.ts +16 -0
  338. package/dist/fhe-vesting/react/useResetGasFee.d.ts +10 -0
  339. package/dist/fhe-vesting/react/useResetTokenFee.d.ts +10 -0
  340. package/dist/fhe-vesting/react/useRevokeRole.d.ts +15 -0
  341. package/dist/fhe-vesting/react/useRevokeVesting.d.ts +15 -0
  342. package/dist/fhe-vesting/react/useRoleConstants.d.ts +19 -0
  343. package/dist/fhe-vesting/react/useSetCustomFee.d.ts +18 -0
  344. package/dist/fhe-vesting/react/useSetDefaultFeeType.d.ts +14 -0
  345. package/dist/fhe-vesting/react/useSetDefaultGasFee.d.ts +12 -0
  346. package/dist/fhe-vesting/react/useSetDefaultTokenFee.d.ts +13 -0
  347. package/dist/fhe-vesting/react/useSetFeeCollector.d.ts +13 -0
  348. package/dist/fhe-vesting/react/useSetMaxBatchSize.d.ts +12 -0
  349. package/dist/fhe-vesting/react/useSetMaxRevokeBatchSize.d.ts +12 -0
  350. package/dist/fhe-vesting/react/useSplitVesting.d.ts +28 -0
  351. package/dist/fhe-vesting/react/useTransferFeeCollectorRole.d.ts +12 -0
  352. package/dist/fhe-vesting/react/useUnpause.d.ts +11 -0
  353. package/dist/fhe-vesting/react/useVestingClaim.d.ts +19 -0
  354. package/dist/fhe-vesting/react/useVestingInfo.d.ts +25 -0
  355. package/dist/fhe-vesting/react/useWithdrawAdmin.d.ts +17 -0
  356. package/dist/fhe-vesting/react/useWithdrawGasFee.d.ts +13 -0
  357. package/dist/fhe-vesting/react/useWithdrawOtherConfidentialToken.d.ts +13 -0
  358. package/dist/fhe-vesting/react/useWithdrawOtherToken.d.ts +13 -0
  359. package/dist/fhe-vesting/react/useWithdrawTokenFee.d.ts +18 -0
  360. package/dist/fhe-vesting/types.d.ts +72 -0
  361. package/dist/index.cjs +237 -0
  362. package/dist/index.d.cts +3 -0
  363. package/dist/index.d.ts +3 -0
  364. package/dist/index.js +14 -0
  365. package/dist/telemetry/console.d.ts +29 -0
  366. package/dist/telemetry/index.cjs +113 -0
  367. package/dist/telemetry/index.d.cts +3 -0
  368. package/dist/telemetry/index.d.ts +3 -0
  369. package/dist/telemetry/index.js +102 -0
  370. package/dist/telemetry/tokenops.d.ts +15 -0
  371. package/package.json +316 -0
@@ -0,0 +1,1496 @@
1
+ 'use strict';
2
+
3
+ var chunkVDXVNZCO_cjs = require('./chunk-VDXVNZCO.cjs');
4
+ var chunkOLDGMKW2_cjs = require('./chunk-OLDGMKW2.cjs');
5
+ var chunkCQIPRNS7_cjs = require('./chunk-CQIPRNS7.cjs');
6
+ var chunkVJKZWYYJ_cjs = require('./chunk-VJKZWYYJ.cjs');
7
+ var chunk66IHPTOK_cjs = require('./chunk-66IHPTOK.cjs');
8
+ var chunk56UI7LUR_cjs = require('./chunk-56UI7LUR.cjs');
9
+ var viem = require('viem');
10
+
11
+ // src/fhe-airdrop/abis/factory.ts
12
+ var confidentialAirdropFactoryAbi = [
13
+ {
14
+ inputs: [
15
+ {
16
+ internalType: "address",
17
+ name: "implementation_",
18
+ type: "address"
19
+ },
20
+ {
21
+ internalType: "address",
22
+ name: "feeCollector_",
23
+ type: "address"
24
+ },
25
+ {
26
+ internalType: "uint256",
27
+ name: "defaultGasFee_",
28
+ type: "uint256"
29
+ },
30
+ {
31
+ internalType: "address",
32
+ name: "admin",
33
+ type: "address"
34
+ }
35
+ ],
36
+ stateMutability: "nonpayable",
37
+ type: "constructor"
38
+ },
39
+ {
40
+ inputs: [],
41
+ name: "AccessControlBadConfirmation",
42
+ type: "error"
43
+ },
44
+ {
45
+ inputs: [
46
+ {
47
+ internalType: "address",
48
+ name: "account",
49
+ type: "address"
50
+ },
51
+ {
52
+ internalType: "bytes32",
53
+ name: "neededRole",
54
+ type: "bytes32"
55
+ }
56
+ ],
57
+ name: "AccessControlUnauthorizedAccount",
58
+ type: "error"
59
+ },
60
+ {
61
+ inputs: [],
62
+ name: "EndTimeInPast",
63
+ type: "error"
64
+ },
65
+ {
66
+ inputs: [],
67
+ name: "InvalidAddress",
68
+ type: "error"
69
+ },
70
+ {
71
+ inputs: [],
72
+ name: "InvalidDuration",
73
+ type: "error"
74
+ },
75
+ {
76
+ inputs: [],
77
+ name: "InvalidStartTime",
78
+ type: "error"
79
+ },
80
+ {
81
+ inputs: [
82
+ {
83
+ internalType: "bytes32",
84
+ name: "handle",
85
+ type: "bytes32"
86
+ },
87
+ {
88
+ internalType: "address",
89
+ name: "sender",
90
+ type: "address"
91
+ }
92
+ ],
93
+ name: "SenderNotAllowedToUseHandle",
94
+ type: "error"
95
+ },
96
+ {
97
+ inputs: [
98
+ {
99
+ internalType: "address",
100
+ name: "sender",
101
+ type: "address"
102
+ }
103
+ ],
104
+ name: "SenderNotAllowed",
105
+ type: "error"
106
+ },
107
+ {
108
+ inputs: [],
109
+ name: "ZamaProtocolUnsupported",
110
+ type: "error"
111
+ },
112
+ {
113
+ anonymous: false,
114
+ inputs: [
115
+ {
116
+ indexed: true,
117
+ internalType: "address",
118
+ name: "airdrop",
119
+ type: "address"
120
+ },
121
+ {
122
+ indexed: true,
123
+ internalType: "address",
124
+ name: "token",
125
+ type: "address"
126
+ },
127
+ {
128
+ indexed: true,
129
+ internalType: "address",
130
+ name: "admin",
131
+ type: "address"
132
+ },
133
+ {
134
+ indexed: false,
135
+ internalType: "address",
136
+ name: "feeCollector",
137
+ type: "address"
138
+ },
139
+ {
140
+ indexed: false,
141
+ internalType: "uint256",
142
+ name: "gasFee",
143
+ type: "uint256"
144
+ },
145
+ {
146
+ indexed: false,
147
+ internalType: "uint32",
148
+ name: "startTime",
149
+ type: "uint32"
150
+ },
151
+ {
152
+ indexed: false,
153
+ internalType: "uint32",
154
+ name: "endTime",
155
+ type: "uint32"
156
+ },
157
+ {
158
+ indexed: false,
159
+ internalType: "bool",
160
+ name: "canExtendClaimWindow",
161
+ type: "bool"
162
+ },
163
+ {
164
+ indexed: false,
165
+ internalType: "address",
166
+ name: "creator",
167
+ type: "address"
168
+ },
169
+ {
170
+ indexed: false,
171
+ internalType: "bytes32",
172
+ name: "userSalt",
173
+ type: "bytes32"
174
+ }
175
+ ],
176
+ name: "ConfidentialAirdropCreated",
177
+ type: "event"
178
+ },
179
+ {
180
+ anonymous: false,
181
+ inputs: [
182
+ {
183
+ indexed: true,
184
+ internalType: "address",
185
+ name: "airdrop",
186
+ type: "address"
187
+ },
188
+ {
189
+ indexed: true,
190
+ internalType: "address",
191
+ name: "token",
192
+ type: "address"
193
+ },
194
+ {
195
+ indexed: false,
196
+ internalType: "euint64",
197
+ name: "transferredAmount",
198
+ type: "bytes32"
199
+ }
200
+ ],
201
+ name: "ConfidentialAirdropFunded",
202
+ type: "event"
203
+ },
204
+ {
205
+ anonymous: false,
206
+ inputs: [
207
+ {
208
+ indexed: true,
209
+ internalType: "address",
210
+ name: "admin",
211
+ type: "address"
212
+ },
213
+ {
214
+ indexed: true,
215
+ internalType: "address",
216
+ name: "newFeeCollector",
217
+ type: "address"
218
+ }
219
+ ],
220
+ name: "FeeCollectorSet",
221
+ type: "event"
222
+ },
223
+ {
224
+ anonymous: false,
225
+ inputs: [
226
+ {
227
+ indexed: true,
228
+ internalType: "bytes32",
229
+ name: "role",
230
+ type: "bytes32"
231
+ },
232
+ {
233
+ indexed: true,
234
+ internalType: "bytes32",
235
+ name: "previousAdminRole",
236
+ type: "bytes32"
237
+ },
238
+ {
239
+ indexed: true,
240
+ internalType: "bytes32",
241
+ name: "newAdminRole",
242
+ type: "bytes32"
243
+ }
244
+ ],
245
+ name: "RoleAdminChanged",
246
+ type: "event"
247
+ },
248
+ {
249
+ anonymous: false,
250
+ inputs: [
251
+ {
252
+ indexed: true,
253
+ internalType: "bytes32",
254
+ name: "role",
255
+ type: "bytes32"
256
+ },
257
+ {
258
+ indexed: true,
259
+ internalType: "address",
260
+ name: "account",
261
+ type: "address"
262
+ },
263
+ {
264
+ indexed: true,
265
+ internalType: "address",
266
+ name: "sender",
267
+ type: "address"
268
+ }
269
+ ],
270
+ name: "RoleGranted",
271
+ type: "event"
272
+ },
273
+ {
274
+ anonymous: false,
275
+ inputs: [
276
+ {
277
+ indexed: true,
278
+ internalType: "bytes32",
279
+ name: "role",
280
+ type: "bytes32"
281
+ },
282
+ {
283
+ indexed: true,
284
+ internalType: "address",
285
+ name: "account",
286
+ type: "address"
287
+ },
288
+ {
289
+ indexed: true,
290
+ internalType: "address",
291
+ name: "sender",
292
+ type: "address"
293
+ }
294
+ ],
295
+ name: "RoleRevoked",
296
+ type: "event"
297
+ },
298
+ {
299
+ anonymous: false,
300
+ inputs: [
301
+ {
302
+ indexed: true,
303
+ internalType: "address",
304
+ name: "admin",
305
+ type: "address"
306
+ },
307
+ {
308
+ indexed: false,
309
+ internalType: "bool",
310
+ name: "enabled",
311
+ type: "bool"
312
+ },
313
+ {
314
+ indexed: true,
315
+ internalType: "address",
316
+ name: "campaignCreator",
317
+ type: "address"
318
+ },
319
+ {
320
+ indexed: false,
321
+ internalType: "uint256",
322
+ name: "gasFee",
323
+ type: "uint256"
324
+ }
325
+ ],
326
+ name: "SetCustomFee",
327
+ type: "event"
328
+ },
329
+ {
330
+ anonymous: false,
331
+ inputs: [
332
+ {
333
+ indexed: true,
334
+ internalType: "address",
335
+ name: "admin",
336
+ type: "address"
337
+ },
338
+ {
339
+ indexed: false,
340
+ internalType: "uint256",
341
+ name: "oldGasFee",
342
+ type: "uint256"
343
+ },
344
+ {
345
+ indexed: false,
346
+ internalType: "uint256",
347
+ name: "newGasFee",
348
+ type: "uint256"
349
+ }
350
+ ],
351
+ name: "SetDefaultGasFee",
352
+ type: "event"
353
+ },
354
+ {
355
+ inputs: [],
356
+ name: "DEFAULT_ADMIN_ROLE",
357
+ outputs: [
358
+ {
359
+ internalType: "bytes32",
360
+ name: "",
361
+ type: "bytes32"
362
+ }
363
+ ],
364
+ stateMutability: "view",
365
+ type: "function"
366
+ },
367
+ {
368
+ inputs: [],
369
+ name: "FEE_MANAGER_ROLE",
370
+ outputs: [
371
+ {
372
+ internalType: "bytes32",
373
+ name: "",
374
+ type: "bytes32"
375
+ }
376
+ ],
377
+ stateMutability: "view",
378
+ type: "function"
379
+ },
380
+ {
381
+ inputs: [],
382
+ name: "confidentialProtocolId",
383
+ outputs: [
384
+ {
385
+ internalType: "uint256",
386
+ name: "",
387
+ type: "uint256"
388
+ }
389
+ ],
390
+ stateMutability: "view",
391
+ type: "function"
392
+ },
393
+ {
394
+ inputs: [
395
+ {
396
+ components: [
397
+ {
398
+ internalType: "address",
399
+ name: "token",
400
+ type: "address"
401
+ },
402
+ {
403
+ internalType: "uint32",
404
+ name: "startTime",
405
+ type: "uint32"
406
+ },
407
+ {
408
+ internalType: "uint32",
409
+ name: "endTime",
410
+ type: "uint32"
411
+ },
412
+ {
413
+ internalType: "bool",
414
+ name: "canExtendClaimWindow",
415
+ type: "bool"
416
+ },
417
+ {
418
+ internalType: "address",
419
+ name: "admin",
420
+ type: "address"
421
+ }
422
+ ],
423
+ internalType: "struct IConfidentialAirdropFactory.AirdropParams",
424
+ name: "params",
425
+ type: "tuple"
426
+ },
427
+ {
428
+ internalType: "bytes32",
429
+ name: "userSalt",
430
+ type: "bytes32"
431
+ },
432
+ {
433
+ internalType: "externalEuint64",
434
+ name: "encryptedAmount",
435
+ type: "bytes32"
436
+ },
437
+ {
438
+ internalType: "bytes",
439
+ name: "inputProof",
440
+ type: "bytes"
441
+ }
442
+ ],
443
+ name: "createAndFundConfidentialAirdrop",
444
+ outputs: [
445
+ {
446
+ internalType: "address",
447
+ name: "airdrop",
448
+ type: "address"
449
+ }
450
+ ],
451
+ stateMutability: "nonpayable",
452
+ type: "function"
453
+ },
454
+ {
455
+ inputs: [
456
+ {
457
+ components: [
458
+ {
459
+ internalType: "address",
460
+ name: "token",
461
+ type: "address"
462
+ },
463
+ {
464
+ internalType: "uint32",
465
+ name: "startTime",
466
+ type: "uint32"
467
+ },
468
+ {
469
+ internalType: "uint32",
470
+ name: "endTime",
471
+ type: "uint32"
472
+ },
473
+ {
474
+ internalType: "bool",
475
+ name: "canExtendClaimWindow",
476
+ type: "bool"
477
+ },
478
+ {
479
+ internalType: "address",
480
+ name: "admin",
481
+ type: "address"
482
+ }
483
+ ],
484
+ internalType: "struct IConfidentialAirdropFactory.AirdropParams",
485
+ name: "params",
486
+ type: "tuple"
487
+ },
488
+ {
489
+ internalType: "bytes32",
490
+ name: "userSalt",
491
+ type: "bytes32"
492
+ }
493
+ ],
494
+ name: "createConfidentialAirdrop",
495
+ outputs: [
496
+ {
497
+ internalType: "address",
498
+ name: "airdrop",
499
+ type: "address"
500
+ }
501
+ ],
502
+ stateMutability: "nonpayable",
503
+ type: "function"
504
+ },
505
+ {
506
+ inputs: [],
507
+ name: "defaultGasFee",
508
+ outputs: [
509
+ {
510
+ internalType: "uint256",
511
+ name: "",
512
+ type: "uint256"
513
+ }
514
+ ],
515
+ stateMutability: "view",
516
+ type: "function"
517
+ },
518
+ {
519
+ inputs: [
520
+ {
521
+ internalType: "address",
522
+ name: "campaignCreator",
523
+ type: "address"
524
+ }
525
+ ],
526
+ name: "disableCustomFee",
527
+ outputs: [],
528
+ stateMutability: "nonpayable",
529
+ type: "function"
530
+ },
531
+ {
532
+ inputs: [],
533
+ name: "feeCollector",
534
+ outputs: [
535
+ {
536
+ internalType: "address",
537
+ name: "",
538
+ type: "address"
539
+ }
540
+ ],
541
+ stateMutability: "view",
542
+ type: "function"
543
+ },
544
+ {
545
+ inputs: [
546
+ {
547
+ internalType: "address",
548
+ name: "token",
549
+ type: "address"
550
+ },
551
+ {
552
+ components: [
553
+ {
554
+ internalType: "address",
555
+ name: "token",
556
+ type: "address"
557
+ },
558
+ {
559
+ internalType: "uint32",
560
+ name: "startTime",
561
+ type: "uint32"
562
+ },
563
+ {
564
+ internalType: "uint32",
565
+ name: "endTime",
566
+ type: "uint32"
567
+ },
568
+ {
569
+ internalType: "bool",
570
+ name: "canExtendClaimWindow",
571
+ type: "bool"
572
+ },
573
+ {
574
+ internalType: "address",
575
+ name: "admin",
576
+ type: "address"
577
+ }
578
+ ],
579
+ internalType: "struct IConfidentialAirdropFactory.AirdropParams",
580
+ name: "params",
581
+ type: "tuple"
582
+ },
583
+ {
584
+ internalType: "bytes32",
585
+ name: "userSalt",
586
+ type: "bytes32"
587
+ },
588
+ {
589
+ internalType: "address",
590
+ name: "deployer",
591
+ type: "address"
592
+ },
593
+ {
594
+ internalType: "uint256",
595
+ name: "gasFee",
596
+ type: "uint256"
597
+ },
598
+ {
599
+ internalType: "externalEuint64",
600
+ name: "encryptedAmount",
601
+ type: "bytes32"
602
+ },
603
+ {
604
+ internalType: "bytes",
605
+ name: "inputProof",
606
+ type: "bytes"
607
+ }
608
+ ],
609
+ name: "fundConfidentialAirdrop",
610
+ outputs: [],
611
+ stateMutability: "nonpayable",
612
+ type: "function"
613
+ },
614
+ {
615
+ inputs: [
616
+ {
617
+ internalType: "address",
618
+ name: "campaignCreator",
619
+ type: "address"
620
+ }
621
+ ],
622
+ name: "getCustomFee",
623
+ outputs: [
624
+ {
625
+ components: [
626
+ {
627
+ internalType: "bool",
628
+ name: "enabled",
629
+ type: "bool"
630
+ },
631
+ {
632
+ internalType: "uint256",
633
+ name: "gasFee",
634
+ type: "uint256"
635
+ }
636
+ ],
637
+ internalType: "struct IConfidentialAirdropFactory.CustomFee",
638
+ name: "",
639
+ type: "tuple"
640
+ }
641
+ ],
642
+ stateMutability: "view",
643
+ type: "function"
644
+ },
645
+ {
646
+ inputs: [
647
+ {
648
+ components: [
649
+ {
650
+ internalType: "address",
651
+ name: "token",
652
+ type: "address"
653
+ },
654
+ {
655
+ internalType: "uint32",
656
+ name: "startTime",
657
+ type: "uint32"
658
+ },
659
+ {
660
+ internalType: "uint32",
661
+ name: "endTime",
662
+ type: "uint32"
663
+ },
664
+ {
665
+ internalType: "bool",
666
+ name: "canExtendClaimWindow",
667
+ type: "bool"
668
+ },
669
+ {
670
+ internalType: "address",
671
+ name: "admin",
672
+ type: "address"
673
+ }
674
+ ],
675
+ internalType: "struct IConfidentialAirdropFactory.AirdropParams",
676
+ name: "params",
677
+ type: "tuple"
678
+ },
679
+ {
680
+ internalType: "uint256",
681
+ name: "gasFee",
682
+ type: "uint256"
683
+ }
684
+ ],
685
+ name: "getInitCodeHash",
686
+ outputs: [
687
+ {
688
+ internalType: "bytes32",
689
+ name: "hash",
690
+ type: "bytes32"
691
+ }
692
+ ],
693
+ stateMutability: "view",
694
+ type: "function"
695
+ },
696
+ {
697
+ inputs: [
698
+ {
699
+ internalType: "bytes32",
700
+ name: "role",
701
+ type: "bytes32"
702
+ }
703
+ ],
704
+ name: "getRoleAdmin",
705
+ outputs: [
706
+ {
707
+ internalType: "bytes32",
708
+ name: "",
709
+ type: "bytes32"
710
+ }
711
+ ],
712
+ stateMutability: "view",
713
+ type: "function"
714
+ },
715
+ {
716
+ inputs: [
717
+ {
718
+ internalType: "bytes32",
719
+ name: "role",
720
+ type: "bytes32"
721
+ },
722
+ {
723
+ internalType: "address",
724
+ name: "account",
725
+ type: "address"
726
+ }
727
+ ],
728
+ name: "grantRole",
729
+ outputs: [],
730
+ stateMutability: "nonpayable",
731
+ type: "function"
732
+ },
733
+ {
734
+ inputs: [
735
+ {
736
+ internalType: "bytes32",
737
+ name: "role",
738
+ type: "bytes32"
739
+ },
740
+ {
741
+ internalType: "address",
742
+ name: "account",
743
+ type: "address"
744
+ }
745
+ ],
746
+ name: "hasRole",
747
+ outputs: [
748
+ {
749
+ internalType: "bool",
750
+ name: "",
751
+ type: "bool"
752
+ }
753
+ ],
754
+ stateMutability: "view",
755
+ type: "function"
756
+ },
757
+ {
758
+ inputs: [],
759
+ name: "implementation",
760
+ outputs: [
761
+ {
762
+ internalType: "address",
763
+ name: "",
764
+ type: "address"
765
+ }
766
+ ],
767
+ stateMutability: "view",
768
+ type: "function"
769
+ },
770
+ {
771
+ inputs: [
772
+ {
773
+ components: [
774
+ {
775
+ internalType: "address",
776
+ name: "token",
777
+ type: "address"
778
+ },
779
+ {
780
+ internalType: "uint32",
781
+ name: "startTime",
782
+ type: "uint32"
783
+ },
784
+ {
785
+ internalType: "uint32",
786
+ name: "endTime",
787
+ type: "uint32"
788
+ },
789
+ {
790
+ internalType: "bool",
791
+ name: "canExtendClaimWindow",
792
+ type: "bool"
793
+ },
794
+ {
795
+ internalType: "address",
796
+ name: "admin",
797
+ type: "address"
798
+ }
799
+ ],
800
+ internalType: "struct IConfidentialAirdropFactory.AirdropParams",
801
+ name: "params",
802
+ type: "tuple"
803
+ },
804
+ {
805
+ internalType: "bytes32",
806
+ name: "userSalt",
807
+ type: "bytes32"
808
+ },
809
+ {
810
+ internalType: "address",
811
+ name: "deployer",
812
+ type: "address"
813
+ },
814
+ {
815
+ internalType: "uint256",
816
+ name: "gasFee",
817
+ type: "uint256"
818
+ }
819
+ ],
820
+ name: "predictAirdropAddress",
821
+ outputs: [
822
+ {
823
+ internalType: "address",
824
+ name: "predicted",
825
+ type: "address"
826
+ }
827
+ ],
828
+ stateMutability: "view",
829
+ type: "function"
830
+ },
831
+ {
832
+ inputs: [
833
+ {
834
+ internalType: "bytes32",
835
+ name: "role",
836
+ type: "bytes32"
837
+ },
838
+ {
839
+ internalType: "address",
840
+ name: "callerConfirmation",
841
+ type: "address"
842
+ }
843
+ ],
844
+ name: "renounceRole",
845
+ outputs: [],
846
+ stateMutability: "nonpayable",
847
+ type: "function"
848
+ },
849
+ {
850
+ inputs: [
851
+ {
852
+ internalType: "bytes32",
853
+ name: "role",
854
+ type: "bytes32"
855
+ },
856
+ {
857
+ internalType: "address",
858
+ name: "account",
859
+ type: "address"
860
+ }
861
+ ],
862
+ name: "revokeRole",
863
+ outputs: [],
864
+ stateMutability: "nonpayable",
865
+ type: "function"
866
+ },
867
+ {
868
+ inputs: [
869
+ {
870
+ internalType: "address",
871
+ name: "campaignCreator",
872
+ type: "address"
873
+ },
874
+ {
875
+ internalType: "uint256",
876
+ name: "gasFee",
877
+ type: "uint256"
878
+ }
879
+ ],
880
+ name: "setCustomFee",
881
+ outputs: [],
882
+ stateMutability: "nonpayable",
883
+ type: "function"
884
+ },
885
+ {
886
+ inputs: [
887
+ {
888
+ internalType: "uint256",
889
+ name: "newGasFee",
890
+ type: "uint256"
891
+ }
892
+ ],
893
+ name: "setDefaultGasFee",
894
+ outputs: [],
895
+ stateMutability: "nonpayable",
896
+ type: "function"
897
+ },
898
+ {
899
+ inputs: [
900
+ {
901
+ internalType: "address",
902
+ name: "newFeeCollector",
903
+ type: "address"
904
+ }
905
+ ],
906
+ name: "setFeeCollector",
907
+ outputs: [],
908
+ stateMutability: "nonpayable",
909
+ type: "function"
910
+ },
911
+ {
912
+ inputs: [
913
+ {
914
+ internalType: "bytes4",
915
+ name: "interfaceId",
916
+ type: "bytes4"
917
+ }
918
+ ],
919
+ name: "supportsInterface",
920
+ outputs: [
921
+ {
922
+ internalType: "bool",
923
+ name: "",
924
+ type: "bool"
925
+ }
926
+ ],
927
+ stateMutability: "view",
928
+ type: "function"
929
+ }
930
+ ];
931
+ function resolveEncryptor(source) {
932
+ if (source === void 0) return void 0;
933
+ return typeof source === "function" ? source() : source;
934
+ }
935
+ var MAX_UINT64 = (1n << 64n) - 1n;
936
+ function assertUint64(value, label) {
937
+ if (value < 0n || value > MAX_UINT64) {
938
+ throw new chunk56UI7LUR_cjs.InvalidArgumentError({
939
+ method: "encryptUint64",
940
+ argument: label,
941
+ reason: "exceeds uint64 range (0..2^64-1)",
942
+ value
943
+ });
944
+ }
945
+ }
946
+ async function encryptUint64({
947
+ encryptor,
948
+ contractAddress,
949
+ userAddress,
950
+ value
951
+ }) {
952
+ assertUint64(value, "value");
953
+ const { handles, inputProof } = await encryptor.encrypt({
954
+ values: [{ value, type: "euint64" }],
955
+ contractAddress,
956
+ userAddress
957
+ });
958
+ if (handles.length !== 1) {
959
+ throw new chunk56UI7LUR_cjs.InvalidArgumentError({
960
+ method: "encryptUint64",
961
+ argument: "handles",
962
+ reason: `expected 1 handle, got ${handles.length}`,
963
+ value: handles.length
964
+ });
965
+ }
966
+ return {
967
+ handle: chunk66IHPTOK_cjs.asEncryptedHandle(viem.bytesToHex(handles[0])),
968
+ inputProof: chunk66IHPTOK_cjs.asExternalInputProof(viem.bytesToHex(inputProof))
969
+ };
970
+ }
971
+ async function encryptUint64Batch({
972
+ encryptor,
973
+ contractAddress,
974
+ userAddress,
975
+ values
976
+ }) {
977
+ if (values.length === 0) {
978
+ throw new chunk56UI7LUR_cjs.InvalidArgumentError({
979
+ method: "encryptUint64Batch",
980
+ argument: "values",
981
+ reason: "must be non-empty"
982
+ });
983
+ }
984
+ values.forEach((v, i) => assertUint64(v, `values[${i}]`));
985
+ const { handles, inputProof } = await encryptor.encrypt({
986
+ values: values.map((value) => ({ value, type: "euint64" })),
987
+ contractAddress,
988
+ userAddress
989
+ });
990
+ if (handles.length !== values.length) {
991
+ throw new chunk56UI7LUR_cjs.InvalidArgumentError({
992
+ method: "encryptUint64Batch",
993
+ argument: "handles",
994
+ reason: `expected ${values.length} handles, got ${handles.length}`,
995
+ value: handles.length
996
+ });
997
+ }
998
+ return {
999
+ handles: handles.map((h) => chunk66IHPTOK_cjs.asEncryptedHandle(viem.bytesToHex(h))),
1000
+ inputProof: chunk66IHPTOK_cjs.asExternalInputProof(viem.bytesToHex(inputProof))
1001
+ };
1002
+ }
1003
+ async function signClaimAuthorization(args) {
1004
+ if (args.encryptedAmountHandle.length !== 66) {
1005
+ throw new chunk56UI7LUR_cjs.TokenOpsSdkError(
1006
+ `signClaimAuthorization: encryptedAmountHandle must be a 32-byte hex string (0x + 64 chars), got length ${args.encryptedAmountHandle.length}`
1007
+ );
1008
+ }
1009
+ const account = args.walletClient.account;
1010
+ if (!account) {
1011
+ throw new chunk56UI7LUR_cjs.MissingAccountError("signClaimAuthorization");
1012
+ }
1013
+ const chainId = args.walletClient.chain?.id;
1014
+ if (!chainId) {
1015
+ throw new chunk56UI7LUR_cjs.InvalidArgumentError({
1016
+ method: "signClaimAuthorization",
1017
+ argument: "walletClient.chain.id",
1018
+ reason: "required for EIP712 chainId binding; pass a walletClient constructed with a known chain (e.g. `createWalletClient({ chain: sepolia, ... })`)."
1019
+ });
1020
+ }
1021
+ const sig = await args.walletClient.signTypedData({
1022
+ account,
1023
+ domain: {
1024
+ name: "ConfidentialAirdrop",
1025
+ version: "1",
1026
+ chainId,
1027
+ verifyingContract: args.airdropAddress
1028
+ },
1029
+ types: {
1030
+ Claim: [
1031
+ { name: "recipient", type: "address" },
1032
+ { name: "encryptedAmount", type: "bytes32" }
1033
+ ]
1034
+ },
1035
+ primaryType: "Claim",
1036
+ message: {
1037
+ recipient: args.recipient,
1038
+ encryptedAmount: args.encryptedAmountHandle
1039
+ }
1040
+ });
1041
+ return chunk66IHPTOK_cjs.asSignature(sig);
1042
+ }
1043
+ var airdropFactoryProductMapper = () => void 0;
1044
+ var ConfidentialAirdropFactoryClient = class {
1045
+ publicClient;
1046
+ walletClient;
1047
+ address;
1048
+ encryptor;
1049
+ #telemetry;
1050
+ constructor(config) {
1051
+ this.publicClient = config.publicClient;
1052
+ this.walletClient = config.walletClient;
1053
+ this.encryptor = config.encryptor;
1054
+ const chainId = config.chainId ?? config.publicClient.chain?.id;
1055
+ const addressOverride = config.address ? chunkCQIPRNS7_cjs.normaliseAddress(config.address) : void 0;
1056
+ const resolved = addressOverride ?? (chainId === void 0 ? void 0 : chunkOLDGMKW2_cjs.getFheAirdropFactoryAddress(chainId));
1057
+ if (!resolved) {
1058
+ throw new chunk56UI7LUR_cjs.DeploymentAddressUnavailableError({
1059
+ reason: chainId === void 0 ? "chain-id-missing" : "registry-not-deployed",
1060
+ product: "fheAirdrop",
1061
+ contract: "confidentialAirdropFactory",
1062
+ chainId,
1063
+ clientLabel: "ConfidentialAirdropFactoryClient"
1064
+ });
1065
+ }
1066
+ this.address = resolved;
1067
+ this.#telemetry = config.telemetry;
1068
+ this.#telemetry?.event("fhe-airdrop.client.init", {
1069
+ surface: "factory",
1070
+ chainId: chainId ?? null,
1071
+ hasWallet: !!this.walletClient,
1072
+ aclResolved: true,
1073
+ // factory has no ACL dependency; constant for funnel-shape parity with client.
1074
+ sdkVersion: chunkVDXVNZCO_cjs.SDK_VERSION
1075
+ });
1076
+ }
1077
+ // ----------------------- writes -----------------------
1078
+ /**
1079
+ * Deploy a new airdrop clone via the factory and return its address, parsed
1080
+ * from the `ConfidentialAirdropCreated` event in the tx receipt.
1081
+ *
1082
+ * **This is the headline factory entry point.** R02 ADR P-1 collapses the
1083
+ * old hash-only + `…AndGetAddress` pair down to one rich-return method —
1084
+ * 90 %+ of consumers want the deployed address back, and the SDK already
1085
+ * waits + parses the event, so there's no reason to make consumers do it
1086
+ * themselves.
1087
+ *
1088
+ * Internally: `writeContract` → {@link PublicClient.waitForTransactionReceipt} →
1089
+ * `parseEventLogs({ eventName: "ConfidentialAirdropCreated" })`.
1090
+ *
1091
+ * For genuine pre-mine prediction (rare), import
1092
+ * `ConfidentialAirdropFactoryAdvancedClient` from
1093
+ * `@tokenops/sdk/fhe-airdrop/advanced` and call `predictAirdropAddress`.
1094
+ *
1095
+ * @example
1096
+ * const { hash, airdrop } = await factory.createConfidentialAirdrop({
1097
+ * params, userSalt,
1098
+ * });
1099
+ */
1100
+ async createConfidentialAirdrop(args) {
1101
+ return chunkVJKZWYYJ_cjs.withTelemetry(
1102
+ this.#telemetry,
1103
+ "fhe-airdrop.factory.createConfidentialAirdrop",
1104
+ async () => {
1105
+ const hash = await this.#write(
1106
+ "createConfidentialAirdrop",
1107
+ [toAbiParams(args.params), args.userSalt],
1108
+ args.account
1109
+ );
1110
+ return this.#resolveAirdropFromReceipt(hash, "createConfidentialAirdrop");
1111
+ }
1112
+ );
1113
+ }
1114
+ /**
1115
+ * Deploy and fund a new airdrop in a single transaction, and return its
1116
+ * address. The SDK encrypts `amount` into an `externalEuint64` before
1117
+ * passing to the contract.
1118
+ *
1119
+ * Prerequisites: caller must have set this factory as an operator on the
1120
+ * token: `token.setOperator(factoryAddress, deadline)`.
1121
+ *
1122
+ * Symmetric with {@link ConfidentialAirdropFactoryClient.createConfidentialAirdrop}
1123
+ * — both return `{ hash, airdrop }` parsed from the
1124
+ * `ConfidentialAirdropCreated` event (R02 ADR P-1).
1125
+ *
1126
+ * @example
1127
+ * const { hash, airdrop } = await factory.createAndFundConfidentialAirdrop({
1128
+ * params, userSalt, amount: 1_000_000n,
1129
+ * });
1130
+ */
1131
+ async createAndFundConfidentialAirdrop(args) {
1132
+ return chunkVJKZWYYJ_cjs.withTelemetry(
1133
+ this.#telemetry,
1134
+ "fhe-airdrop.factory.createAndFundConfidentialAirdrop",
1135
+ async () => {
1136
+ const wallet = this.#requireWallet("createAndFundConfidentialAirdrop");
1137
+ const account = this.#resolveAccount(
1138
+ wallet,
1139
+ args.account,
1140
+ "createAndFundConfidentialAirdrop"
1141
+ );
1142
+ const encrypted = await this.#encryptAmount(
1143
+ args.amount,
1144
+ args.encryptor,
1145
+ args.encryptedInput,
1146
+ account,
1147
+ "createAndFundConfidentialAirdrop"
1148
+ );
1149
+ const writeArgs = [
1150
+ toAbiParams(args.params),
1151
+ args.userSalt,
1152
+ encrypted.handle,
1153
+ encrypted.inputProof
1154
+ ];
1155
+ await this.#preflightWrite(
1156
+ "createAndFundConfidentialAirdrop",
1157
+ "createAndFundConfidentialAirdrop",
1158
+ writeArgs,
1159
+ account
1160
+ );
1161
+ let hash;
1162
+ try {
1163
+ hash = await wallet.writeContract({
1164
+ address: this.address,
1165
+ abi: confidentialAirdropFactoryAbi,
1166
+ functionName: "createAndFundConfidentialAirdrop",
1167
+ args: writeArgs,
1168
+ account,
1169
+ chain: wallet.chain
1170
+ });
1171
+ } catch (err) {
1172
+ throw this.#mapRevert("createAndFundConfidentialAirdrop", err, accountAddress(account));
1173
+ }
1174
+ return this.#resolveAirdropFromReceipt(hash, "createAndFundConfidentialAirdrop");
1175
+ }
1176
+ );
1177
+ }
1178
+ /**
1179
+ * Fund an existing (or not-yet-deployed) airdrop with encrypted tokens.
1180
+ *
1181
+ * Prerequisites: caller must have set this factory as an operator on the token:
1182
+ * `token.setOperator(factoryAddress, deadline)`
1183
+ *
1184
+ * @returns Transaction hash.
1185
+ */
1186
+ async fundConfidentialAirdrop(args) {
1187
+ const wallet = this.#requireWallet("fundConfidentialAirdrop");
1188
+ const account = this.#resolveAccount(wallet, args.account, "fundConfidentialAirdrop");
1189
+ const encrypted = await this.#encryptAmount(
1190
+ args.amount,
1191
+ args.encryptor,
1192
+ args.encryptedInput,
1193
+ account,
1194
+ "fundConfidentialAirdrop"
1195
+ );
1196
+ const writeArgs = [
1197
+ args.token,
1198
+ toAbiParams(args.params),
1199
+ args.userSalt,
1200
+ args.deployer,
1201
+ args.gasFee,
1202
+ encrypted.handle,
1203
+ encrypted.inputProof
1204
+ ];
1205
+ await this.#preflightWrite(
1206
+ "fundConfidentialAirdrop",
1207
+ "fundConfidentialAirdrop",
1208
+ writeArgs,
1209
+ account
1210
+ );
1211
+ try {
1212
+ return await wallet.writeContract({
1213
+ address: this.address,
1214
+ abi: confidentialAirdropFactoryAbi,
1215
+ functionName: "fundConfidentialAirdrop",
1216
+ args: writeArgs,
1217
+ account,
1218
+ chain: wallet.chain
1219
+ });
1220
+ } catch (err) {
1221
+ throw this.#mapRevert("fundConfidentialAirdrop", err, accountAddress(account));
1222
+ }
1223
+ }
1224
+ /**
1225
+ * Deploy a new airdrop clone and return its address, parsed from the
1226
+ * `ConfidentialAirdropCreated` event in the tx receipt.
1227
+ *
1228
+ * Symmetry helper with the fhe-vesting client. Use this when you want a
1229
+ * one-call "deploy and use" shape; otherwise call
1230
+ * {@link ConfidentialAirdropFactoryClient.createConfidentialAirdrop} and parse
1231
+ * the receipt yourself, or call
1232
+ * {@link ConfidentialAirdropFactoryClient.predictAirdropAddress} before mining.
1233
+ *
1234
+ * Internally: {@link ConfidentialAirdropFactoryClient.createConfidentialAirdrop} →
1235
+ * {@link PublicClient.waitForTransactionReceipt} →
1236
+ * `parseEventLogs({ eventName: "ConfidentialAirdropCreated" })`.
1237
+ *
1238
+ * @example
1239
+ * const { hash, airdrop } = await factory.createConfidentialAirdropAndGetAddress({
1240
+ * params, userSalt,
1241
+ * });
1242
+ */
1243
+ async createConfidentialAirdropAndGetAddress(args) {
1244
+ return this.createConfidentialAirdrop(args);
1245
+ }
1246
+ /**
1247
+ * Deploy AND fund a new airdrop clone in one tx, returning its address parsed
1248
+ * from the `ConfidentialAirdropCreated` event in the receipt.
1249
+ *
1250
+ * Symmetry with {@link ConfidentialAirdropFactoryClient.createConfidentialAirdropAndGetAddress}
1251
+ * — use this when you also need to seed the pool in the same transaction.
1252
+ *
1253
+ * Internally: {@link ConfidentialAirdropFactoryClient.createAndFundConfidentialAirdrop} →
1254
+ * {@link PublicClient.waitForTransactionReceipt} →
1255
+ * `parseEventLogs({ eventName: "ConfidentialAirdropCreated" })`.
1256
+ *
1257
+ * @example
1258
+ * const { hash, airdrop } = await factory.createAndFundConfidentialAirdropAndGetAddress({
1259
+ * params, userSalt, amount, encryptor,
1260
+ * });
1261
+ */
1262
+ async createAndFundConfidentialAirdropAndGetAddress(args) {
1263
+ return this.createAndFundConfidentialAirdrop(args);
1264
+ }
1265
+ // ----------------------- fee management (FEE_MANAGER_ROLE) -----------------------
1266
+ /** Change the fee collector address. FEE_MANAGER_ROLE only. */
1267
+ async setFeeCollector(newFeeCollector, account) {
1268
+ return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-airdrop.factory.setFeeCollector", async () => {
1269
+ return this.#write("setFeeCollector", [newFeeCollector], account);
1270
+ });
1271
+ }
1272
+ /** Change the default per-claim gas fee in wei. FEE_MANAGER_ROLE only. */
1273
+ async setDefaultGasFee(newGasFee, account) {
1274
+ return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-airdrop.factory.setDefaultGasFee", async () => {
1275
+ return this.#write("setDefaultGasFee", [newGasFee], account);
1276
+ });
1277
+ }
1278
+ /** Set a per-creator gas fee override. FEE_MANAGER_ROLE only. */
1279
+ async setCustomFee(campaignCreator, gasFee, account) {
1280
+ return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-airdrop.factory.setCustomFee", async () => {
1281
+ return this.#write("setCustomFee", [campaignCreator, gasFee], account);
1282
+ });
1283
+ }
1284
+ /** Remove a per-creator fee override, reverting to `defaultGasFee`. FEE_MANAGER_ROLE only. */
1285
+ async disableCustomFee(campaignCreator, account) {
1286
+ return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-airdrop.factory.disableCustomFee", async () => {
1287
+ return this.#write("disableCustomFee", [campaignCreator], account);
1288
+ });
1289
+ }
1290
+ // ----------------------- reads -----------------------
1291
+ /** Current LibClone implementation address. */
1292
+ async implementation() {
1293
+ return this.#read("implementation");
1294
+ }
1295
+ /**
1296
+ * Alias for {@link ConfidentialAirdropFactoryClient.implementation} that matches
1297
+ * the contract's storage field name (`_airdropImplementation`).
1298
+ *
1299
+ * Shipped proactively in R17 for parity with `fhe-vesting`'s
1300
+ * `managerImplementation()` alias (commit 6f6d7bc, closing
1301
+ * backend-integrator-r14 minor). The airdrop factory has the same
1302
+ * LibClone shape mirroring `_airdropImplementation` storage, so server
1303
+ * devs reading the Solidity first reach for `factory.airdropImplementation()`
1304
+ * via autocomplete and would otherwise hit a TS2551 on the SDK's
1305
+ * `implementation()` shape. The canonical `implementation()` method is
1306
+ * retained for backwards-compat and cross-factory uniformity.
1307
+ */
1308
+ async airdropImplementation() {
1309
+ return this.implementation();
1310
+ }
1311
+ /** Default per-claim gas fee in wei. Used when no custom fee is set for the campaign creator. */
1312
+ async defaultGasFee() {
1313
+ return this.#read("defaultGasFee");
1314
+ }
1315
+ /** Address authorized to collect gas fees from airdrop clones. */
1316
+ async feeCollector() {
1317
+ return this.#read("feeCollector");
1318
+ }
1319
+ /** Per-creator custom fee override. `enabled` is `false` when no override is set. */
1320
+ async getCustomFee(campaignCreator) {
1321
+ const raw = await this.#read("getCustomFee", [
1322
+ campaignCreator
1323
+ ]);
1324
+ return { enabled: raw.enabled, gasFee: raw.gasFee };
1325
+ }
1326
+ /**
1327
+ * Compute the CREATE2 init-code hash for a given set of params and gas fee.
1328
+ * Useful for deriving the clone address off-chain. Use `predictAirdropAddress` from
1329
+ * `@tokenops/sdk/fhe-airdrop/advanced` for the full address derivation.
1330
+ * @param args `{ params, gasFee }` — must match the values used at deploy time.
1331
+ * @returns `bytes32` init-code hash.
1332
+ */
1333
+ async getInitCodeHash(args) {
1334
+ return this.#read("getInitCodeHash", [toAbiParams(args.params), args.gasFee]);
1335
+ }
1336
+ // ----------------------- internals -----------------------
1337
+ /**
1338
+ * Wait for the receipt of a clone-deploy tx and parse the
1339
+ * `ConfidentialAirdropCreated` event to extract the deployed airdrop
1340
+ * address. Branded result; throws `TokenOpsSdkError` if zero or >1 events
1341
+ * match this factory address.
1342
+ */
1343
+ async #resolveAirdropFromReceipt(hash, method) {
1344
+ const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
1345
+ const events = viem.parseEventLogs({
1346
+ abi: confidentialAirdropFactoryAbi,
1347
+ eventName: "ConfidentialAirdropCreated",
1348
+ logs: receipt.logs
1349
+ });
1350
+ const ours = events.filter((ev) => ev.address.toLowerCase() === this.address.toLowerCase());
1351
+ if (ours.length === 0) {
1352
+ throw new chunk56UI7LUR_cjs.TokenOpsSdkError(
1353
+ `${method}: no ConfidentialAirdropCreated event from factory ${this.address} in tx ${hash}`
1354
+ );
1355
+ }
1356
+ if (ours.length > 1) {
1357
+ throw new chunk56UI7LUR_cjs.TokenOpsSdkError(
1358
+ `${method}: ${ours.length} ConfidentialAirdropCreated events from factory ${this.address} in tx ${hash}; ambiguous result`
1359
+ );
1360
+ }
1361
+ return { hash: chunk66IHPTOK_cjs.asTxHash(hash), airdrop: ours[0].args.airdrop };
1362
+ }
1363
+ #requireWallet(method) {
1364
+ if (!this.walletClient) {
1365
+ throw new chunk56UI7LUR_cjs.MissingWalletClientError(method);
1366
+ }
1367
+ return this.walletClient;
1368
+ }
1369
+ #resolveAccount(wallet, override, method) {
1370
+ const acct = override ?? wallet.account;
1371
+ if (!acct) {
1372
+ throw new chunk56UI7LUR_cjs.MissingAccountError(method);
1373
+ }
1374
+ return acct;
1375
+ }
1376
+ /**
1377
+ * Resolve the encrypted-amount payload for a fund-style write. Enforces
1378
+ * **exactly one** of `amount` / `encryptedInput` so a caller who hands the
1379
+ * SDK a pre-encrypted handle cannot also pass a stale plaintext that drifts
1380
+ * from the on-chain ciphertext.
1381
+ */
1382
+ async #encryptAmount(amount, encryptor, preEncrypted, account, method) {
1383
+ const hasAmount = amount !== void 0;
1384
+ const hasInput = preEncrypted !== void 0;
1385
+ if (hasAmount && hasInput) {
1386
+ throw new chunk56UI7LUR_cjs.InvalidArgumentError({
1387
+ method,
1388
+ argument: "amount/encryptedInput",
1389
+ reason: "exactly one of `amount` (plaintext, SDK encrypts) or `encryptedInput` (pre-encrypted) must be supplied \u2014 got both"
1390
+ });
1391
+ }
1392
+ if (!hasAmount && !hasInput) {
1393
+ throw new chunk56UI7LUR_cjs.InvalidArgumentError({
1394
+ method,
1395
+ argument: "amount/encryptedInput",
1396
+ reason: "exactly one of `amount` (plaintext, SDK encrypts) or `encryptedInput` (pre-encrypted) must be supplied \u2014 got neither"
1397
+ });
1398
+ }
1399
+ if (hasInput) return preEncrypted;
1400
+ const enc = encryptor ?? resolveEncryptor(this.encryptor);
1401
+ if (!enc) {
1402
+ throw new chunk56UI7LUR_cjs.MissingEncryptorError("encryptAmount", {
1403
+ hint: "Pass `encryptor` to the call or the client config (eager or lazy factory)."
1404
+ });
1405
+ }
1406
+ return encryptUint64({
1407
+ encryptor: enc,
1408
+ contractAddress: this.address,
1409
+ userAddress: accountAddress(account),
1410
+ value: amount
1411
+ });
1412
+ }
1413
+ async #write(functionName, args, account) {
1414
+ const wallet = this.#requireWallet(functionName);
1415
+ const acct = this.#resolveAccount(wallet, account, functionName);
1416
+ await this.#preflightWrite(functionName, functionName, args, acct);
1417
+ try {
1418
+ return await wallet.writeContract({
1419
+ address: this.address,
1420
+ abi: confidentialAirdropFactoryAbi,
1421
+ functionName,
1422
+ args,
1423
+ account: acct,
1424
+ chain: wallet.chain
1425
+ });
1426
+ } catch (err) {
1427
+ throw this.#mapRevert(functionName, err, accountAddress(acct));
1428
+ }
1429
+ }
1430
+ #mapRevert(method, err, account) {
1431
+ return chunkVDXVNZCO_cjs.mapContractRevert(err, {
1432
+ method,
1433
+ contractAddress: this.address,
1434
+ abi: confidentialAirdropFactoryAbi,
1435
+ productMapper: airdropFactoryProductMapper,
1436
+ account
1437
+ });
1438
+ }
1439
+ /**
1440
+ * Pre-flight a write via `simulateContract` purely to surface typed reverts.
1441
+ *
1442
+ * The simulate's *return value* is discarded — FHE writes still need
1443
+ * `writeContract` + receipt parsing because simulated FHE op handles diverge
1444
+ * from the executed-tx handles (CLAUDE.md Pitfall #1). The only purpose of
1445
+ * this call is to let viem decode any revert against the ABI and produce a
1446
+ * `ContractFunctionRevertedError` frame the revert-mapper can classify.
1447
+ */
1448
+ async #preflightWrite(method, functionName, args, account, value) {
1449
+ try {
1450
+ await this.publicClient.simulateContract({
1451
+ address: this.address,
1452
+ abi: confidentialAirdropFactoryAbi,
1453
+ functionName,
1454
+ args,
1455
+ account,
1456
+ ...value !== void 0 ? { value } : {}
1457
+ });
1458
+ } catch (err) {
1459
+ if (chunkVDXVNZCO_cjs.isContractRevert(err)) {
1460
+ throw this.#mapRevert(method, err, accountAddress(account));
1461
+ }
1462
+ }
1463
+ }
1464
+ async #read(functionName, args = []) {
1465
+ const result = await this.publicClient.readContract({
1466
+ address: this.address,
1467
+ abi: confidentialAirdropFactoryAbi,
1468
+ functionName,
1469
+ args
1470
+ });
1471
+ return result;
1472
+ }
1473
+ };
1474
+ function createConfidentialAirdropFactoryClient(config) {
1475
+ return new ConfidentialAirdropFactoryClient(config);
1476
+ }
1477
+ function accountAddress(account) {
1478
+ return typeof account === "string" ? account : account.address;
1479
+ }
1480
+ function toAbiParams(params) {
1481
+ return {
1482
+ token: params.token,
1483
+ startTime: params.startTimestamp,
1484
+ endTime: params.endTimestamp,
1485
+ canExtendClaimWindow: params.canExtendClaimWindow,
1486
+ admin: params.admin
1487
+ };
1488
+ }
1489
+
1490
+ exports.ConfidentialAirdropFactoryClient = ConfidentialAirdropFactoryClient;
1491
+ exports.confidentialAirdropFactoryAbi = confidentialAirdropFactoryAbi;
1492
+ exports.createConfidentialAirdropFactoryClient = createConfidentialAirdropFactoryClient;
1493
+ exports.encryptUint64 = encryptUint64;
1494
+ exports.encryptUint64Batch = encryptUint64Batch;
1495
+ exports.resolveEncryptor = resolveEncryptor;
1496
+ exports.signClaimAuthorization = signClaimAuthorization;