@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,742 @@
1
+ import { SDK_VERSION, mapContractRevert, isContractRevert } from './chunk-JFLEEXKP.js';
2
+ import { getFheVestingFactoryAddress } from './chunk-COPFW5Z4.js';
3
+ import { normaliseAddress } from './chunk-BE2AIZ3K.js';
4
+ import { withTelemetry } from './chunk-Q2GP5UDC.js';
5
+ import { asTxHash } from './chunk-KWFFIJYX.js';
6
+ import { DeploymentAddressUnavailableError, TokenOpsSdkError, MissingWalletClientError, MissingAccountError } from './chunk-IVE3QEGD.js';
7
+ import { parseEventLogs } from 'viem';
8
+
9
+ // src/fhe-vesting/abis/factory.ts
10
+ var confidentialVestingFactoryAbi = [
11
+ {
12
+ inputs: [
13
+ { internalType: "address", name: "_implementation", type: "address" },
14
+ { internalType: "address", name: "admin", type: "address" },
15
+ { internalType: "address", name: "initialFeeCollector", type: "address" },
16
+ { internalType: "uint256", name: "initialDefaultGasFee", type: "uint256" },
17
+ { internalType: "uint256", name: "initialDefaultTokenFee", type: "uint256" },
18
+ {
19
+ internalType: "enum IConfidentialVestingFactory.FeeType",
20
+ name: "initialDefaultFeeType",
21
+ type: "uint8"
22
+ }
23
+ ],
24
+ stateMutability: "nonpayable",
25
+ type: "constructor"
26
+ },
27
+ { inputs: [], name: "AccessControlBadConfirmation", type: "error" },
28
+ {
29
+ inputs: [
30
+ { internalType: "address", name: "account", type: "address" },
31
+ { internalType: "bytes32", name: "neededRole", type: "bytes32" }
32
+ ],
33
+ name: "AccessControlUnauthorizedAccount",
34
+ type: "error"
35
+ },
36
+ { inputs: [], name: "InvalidAdmin", type: "error" },
37
+ { inputs: [], name: "InvalidFeeBps", type: "error" },
38
+ { inputs: [], name: "InvalidFeeCollector", type: "error" },
39
+ { inputs: [], name: "InvalidFeeType", type: "error" },
40
+ { inputs: [], name: "InvalidImplementation", type: "error" },
41
+ { inputs: [], name: "InvalidToken", type: "error" },
42
+ { inputs: [], name: "ZamaProtocolUnsupported", type: "error" },
43
+ {
44
+ anonymous: false,
45
+ inputs: [{ indexed: true, internalType: "address", name: "creator", type: "address" }],
46
+ name: "CustomFeeDisabled",
47
+ type: "event"
48
+ },
49
+ {
50
+ anonymous: false,
51
+ inputs: [
52
+ { indexed: true, internalType: "address", name: "creator", type: "address" },
53
+ {
54
+ indexed: false,
55
+ internalType: "enum IConfidentialVestingFactory.FeeType",
56
+ name: "feeType",
57
+ type: "uint8"
58
+ },
59
+ { indexed: false, internalType: "uint256", name: "gasFee", type: "uint256" },
60
+ { indexed: false, internalType: "uint256", name: "tokenFee", type: "uint256" }
61
+ ],
62
+ name: "CustomFeeSet",
63
+ type: "event"
64
+ },
65
+ {
66
+ anonymous: false,
67
+ inputs: [
68
+ {
69
+ indexed: false,
70
+ internalType: "enum IConfidentialVestingFactory.FeeType",
71
+ name: "oldType",
72
+ type: "uint8"
73
+ },
74
+ {
75
+ indexed: false,
76
+ internalType: "enum IConfidentialVestingFactory.FeeType",
77
+ name: "newType",
78
+ type: "uint8"
79
+ }
80
+ ],
81
+ name: "DefaultFeeTypeChanged",
82
+ type: "event"
83
+ },
84
+ {
85
+ anonymous: false,
86
+ inputs: [
87
+ { indexed: false, internalType: "uint256", name: "oldFee", type: "uint256" },
88
+ { indexed: false, internalType: "uint256", name: "newFee", type: "uint256" }
89
+ ],
90
+ name: "DefaultGasFeeUpdated",
91
+ type: "event"
92
+ },
93
+ {
94
+ anonymous: false,
95
+ inputs: [
96
+ { indexed: false, internalType: "uint256", name: "oldFee", type: "uint256" },
97
+ { indexed: false, internalType: "uint256", name: "newFee", type: "uint256" }
98
+ ],
99
+ name: "DefaultTokenFeeUpdated",
100
+ type: "event"
101
+ },
102
+ {
103
+ anonymous: false,
104
+ inputs: [
105
+ { indexed: true, internalType: "address", name: "oldCollector", type: "address" },
106
+ { indexed: true, internalType: "address", name: "newCollector", type: "address" }
107
+ ],
108
+ name: "FeeCollectorUpdated",
109
+ type: "event"
110
+ },
111
+ {
112
+ anonymous: false,
113
+ inputs: [
114
+ { indexed: true, internalType: "address", name: "manager", type: "address" },
115
+ { indexed: true, internalType: "address", name: "creator", type: "address" },
116
+ { indexed: true, internalType: "address", name: "token", type: "address" },
117
+ {
118
+ indexed: false,
119
+ internalType: "enum IConfidentialVestingFactory.FeeType",
120
+ name: "feeType",
121
+ type: "uint8"
122
+ },
123
+ { indexed: false, internalType: "uint256", name: "fee", type: "uint256" },
124
+ { indexed: false, internalType: "bytes32", name: "salt", type: "bytes32" }
125
+ ],
126
+ name: "ManagerCreated",
127
+ type: "event"
128
+ },
129
+ {
130
+ anonymous: false,
131
+ inputs: [
132
+ { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
133
+ { indexed: true, internalType: "bytes32", name: "previousAdminRole", type: "bytes32" },
134
+ { indexed: true, internalType: "bytes32", name: "newAdminRole", type: "bytes32" }
135
+ ],
136
+ name: "RoleAdminChanged",
137
+ type: "event"
138
+ },
139
+ {
140
+ anonymous: false,
141
+ inputs: [
142
+ { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
143
+ { indexed: true, internalType: "address", name: "account", type: "address" },
144
+ { indexed: true, internalType: "address", name: "sender", type: "address" }
145
+ ],
146
+ name: "RoleGranted",
147
+ type: "event"
148
+ },
149
+ {
150
+ anonymous: false,
151
+ inputs: [
152
+ { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
153
+ { indexed: true, internalType: "address", name: "account", type: "address" },
154
+ { indexed: true, internalType: "address", name: "sender", type: "address" }
155
+ ],
156
+ name: "RoleRevoked",
157
+ type: "event"
158
+ },
159
+ {
160
+ inputs: [],
161
+ name: "DEFAULT_ADMIN_ROLE",
162
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
163
+ stateMutability: "view",
164
+ type: "function"
165
+ },
166
+ {
167
+ inputs: [],
168
+ name: "FEE_MANAGER_ROLE",
169
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
170
+ stateMutability: "view",
171
+ type: "function"
172
+ },
173
+ {
174
+ inputs: [
175
+ { internalType: "address", name: "token", type: "address" },
176
+ { internalType: "bytes32", name: "userSalt", type: "bytes32" }
177
+ ],
178
+ name: "createManager",
179
+ outputs: [{ internalType: "address", name: "manager", type: "address" }],
180
+ stateMutability: "nonpayable",
181
+ type: "function"
182
+ },
183
+ {
184
+ inputs: [
185
+ { internalType: "address", name: "token", type: "address" },
186
+ { internalType: "bytes32", name: "userSalt", type: "bytes32" },
187
+ { internalType: "bool", name: "splitEnabled", type: "bool" },
188
+ { internalType: "bool", name: "pausableEnabled", type: "bool" }
189
+ ],
190
+ name: "createManagerWithOptions",
191
+ outputs: [{ internalType: "address", name: "manager", type: "address" }],
192
+ stateMutability: "nonpayable",
193
+ type: "function"
194
+ },
195
+ {
196
+ inputs: [],
197
+ name: "defaultFeeType",
198
+ outputs: [
199
+ { internalType: "enum IConfidentialVestingFactory.FeeType", name: "", type: "uint8" }
200
+ ],
201
+ stateMutability: "view",
202
+ type: "function"
203
+ },
204
+ {
205
+ inputs: [],
206
+ name: "defaultGasFee",
207
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
208
+ stateMutability: "view",
209
+ type: "function"
210
+ },
211
+ {
212
+ inputs: [],
213
+ name: "defaultTokenFee",
214
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
215
+ stateMutability: "view",
216
+ type: "function"
217
+ },
218
+ {
219
+ inputs: [{ internalType: "address", name: "creator", type: "address" }],
220
+ name: "disableCustomFee",
221
+ outputs: [],
222
+ stateMutability: "nonpayable",
223
+ type: "function"
224
+ },
225
+ {
226
+ inputs: [],
227
+ name: "feeCollector",
228
+ outputs: [{ internalType: "address", name: "", type: "address" }],
229
+ stateMutability: "view",
230
+ type: "function"
231
+ },
232
+ {
233
+ inputs: [{ internalType: "address", name: "creator", type: "address" }],
234
+ name: "getCustomFee",
235
+ outputs: [
236
+ {
237
+ components: [
238
+ { internalType: "bool", name: "enabled", type: "bool" },
239
+ {
240
+ internalType: "enum IConfidentialVestingFactory.FeeType",
241
+ name: "preferredFeeType",
242
+ type: "uint8"
243
+ },
244
+ { internalType: "uint256", name: "gasFee", type: "uint256" },
245
+ { internalType: "uint256", name: "tokenFee", type: "uint256" }
246
+ ],
247
+ internalType: "struct IConfidentialVestingFactory.CustomFee",
248
+ name: "",
249
+ type: "tuple"
250
+ }
251
+ ],
252
+ stateMutability: "view",
253
+ type: "function"
254
+ },
255
+ {
256
+ inputs: [
257
+ { internalType: "address", name: "token", type: "address" },
258
+ { internalType: "address", name: "deployer", type: "address" }
259
+ ],
260
+ name: "getInitCodeHash",
261
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
262
+ stateMutability: "view",
263
+ type: "function"
264
+ },
265
+ {
266
+ inputs: [
267
+ { internalType: "address", name: "token", type: "address" },
268
+ { internalType: "address", name: "deployer", type: "address" },
269
+ { internalType: "bool", name: "splitEnabled", type: "bool" },
270
+ { internalType: "bool", name: "pausableEnabled", type: "bool" }
271
+ ],
272
+ name: "getInitCodeHashWithOptions",
273
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
274
+ stateMutability: "view",
275
+ type: "function"
276
+ },
277
+ {
278
+ inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
279
+ name: "getRoleAdmin",
280
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
281
+ stateMutability: "view",
282
+ type: "function"
283
+ },
284
+ {
285
+ inputs: [
286
+ { internalType: "bytes32", name: "role", type: "bytes32" },
287
+ { internalType: "address", name: "account", type: "address" }
288
+ ],
289
+ name: "grantRole",
290
+ outputs: [],
291
+ stateMutability: "nonpayable",
292
+ type: "function"
293
+ },
294
+ {
295
+ inputs: [
296
+ { internalType: "bytes32", name: "role", type: "bytes32" },
297
+ { internalType: "address", name: "account", type: "address" }
298
+ ],
299
+ name: "hasRole",
300
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
301
+ stateMutability: "view",
302
+ type: "function"
303
+ },
304
+ {
305
+ inputs: [],
306
+ name: "implementation",
307
+ outputs: [{ internalType: "address", name: "", type: "address" }],
308
+ stateMutability: "view",
309
+ type: "function"
310
+ },
311
+ {
312
+ inputs: [
313
+ { internalType: "address", name: "token", type: "address" },
314
+ { internalType: "bytes32", name: "userSalt", type: "bytes32" },
315
+ { internalType: "address", name: "deployer", type: "address" }
316
+ ],
317
+ name: "predictManagerAddress",
318
+ outputs: [{ internalType: "address", name: "", type: "address" }],
319
+ stateMutability: "view",
320
+ type: "function"
321
+ },
322
+ {
323
+ inputs: [
324
+ { internalType: "address", name: "token", type: "address" },
325
+ { internalType: "bytes32", name: "userSalt", type: "bytes32" },
326
+ { internalType: "address", name: "deployer", type: "address" },
327
+ { internalType: "bool", name: "splitEnabled", type: "bool" },
328
+ { internalType: "bool", name: "pausableEnabled", type: "bool" }
329
+ ],
330
+ name: "predictManagerAddressWithOptions",
331
+ outputs: [{ internalType: "address", name: "", type: "address" }],
332
+ stateMutability: "view",
333
+ type: "function"
334
+ },
335
+ {
336
+ inputs: [
337
+ { internalType: "bytes32", name: "role", type: "bytes32" },
338
+ { internalType: "address", name: "callerConfirmation", type: "address" }
339
+ ],
340
+ name: "renounceRole",
341
+ outputs: [],
342
+ stateMutability: "nonpayable",
343
+ type: "function"
344
+ },
345
+ { inputs: [], name: "resetGasFee", outputs: [], stateMutability: "nonpayable", type: "function" },
346
+ {
347
+ inputs: [],
348
+ name: "resetTokenFee",
349
+ outputs: [],
350
+ stateMutability: "nonpayable",
351
+ type: "function"
352
+ },
353
+ {
354
+ inputs: [
355
+ { internalType: "bytes32", name: "role", type: "bytes32" },
356
+ { internalType: "address", name: "account", type: "address" }
357
+ ],
358
+ name: "revokeRole",
359
+ outputs: [],
360
+ stateMutability: "nonpayable",
361
+ type: "function"
362
+ },
363
+ {
364
+ inputs: [
365
+ { internalType: "address", name: "creator", type: "address" },
366
+ { internalType: "enum IConfidentialVestingFactory.FeeType", name: "feeType", type: "uint8" },
367
+ { internalType: "uint256", name: "gasFee", type: "uint256" },
368
+ { internalType: "uint256", name: "tokenFee", type: "uint256" }
369
+ ],
370
+ name: "setCustomFee",
371
+ outputs: [],
372
+ stateMutability: "nonpayable",
373
+ type: "function"
374
+ },
375
+ {
376
+ inputs: [
377
+ { internalType: "enum IConfidentialVestingFactory.FeeType", name: "feeType", type: "uint8" }
378
+ ],
379
+ name: "setDefaultFeeType",
380
+ outputs: [],
381
+ stateMutability: "nonpayable",
382
+ type: "function"
383
+ },
384
+ {
385
+ inputs: [{ internalType: "uint256", name: "fee", type: "uint256" }],
386
+ name: "setDefaultGasFee",
387
+ outputs: [],
388
+ stateMutability: "nonpayable",
389
+ type: "function"
390
+ },
391
+ {
392
+ inputs: [{ internalType: "uint256", name: "fee", type: "uint256" }],
393
+ name: "setDefaultTokenFee",
394
+ outputs: [],
395
+ stateMutability: "nonpayable",
396
+ type: "function"
397
+ },
398
+ {
399
+ inputs: [{ internalType: "address", name: "newCollector", type: "address" }],
400
+ name: "setFeeCollector",
401
+ outputs: [],
402
+ stateMutability: "nonpayable",
403
+ type: "function"
404
+ },
405
+ {
406
+ inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
407
+ name: "supportsInterface",
408
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
409
+ stateMutability: "view",
410
+ type: "function"
411
+ }
412
+ ];
413
+
414
+ // src/fhe-vesting/types.ts
415
+ var FeeType = /* @__PURE__ */ ((FeeType2) => {
416
+ FeeType2[FeeType2["Gas"] = 0] = "Gas";
417
+ FeeType2[FeeType2["DistributionToken"] = 1] = "DistributionToken";
418
+ return FeeType2;
419
+ })(FeeType || {});
420
+ function feeTypeName(feeType) {
421
+ switch (feeType) {
422
+ case 0 /* Gas */:
423
+ return "Gas";
424
+ case 1 /* DistributionToken */:
425
+ return "DistributionToken";
426
+ }
427
+ }
428
+ var DisclosureType = /* @__PURE__ */ ((DisclosureType2) => {
429
+ DisclosureType2[DisclosureType2["TotalAllocation"] = 0] = "TotalAllocation";
430
+ DisclosureType2[DisclosureType2["SettledAmount"] = 1] = "SettledAmount";
431
+ DisclosureType2[DisclosureType2["VestedAmount"] = 2] = "VestedAmount";
432
+ DisclosureType2[DisclosureType2["ClaimableAmount"] = 3] = "ClaimableAmount";
433
+ return DisclosureType2;
434
+ })(DisclosureType || {});
435
+ var vestingFactoryProductMapper = () => void 0;
436
+ var ConfidentialVestingFactoryClient = class {
437
+ publicClient;
438
+ walletClient;
439
+ address;
440
+ #telemetry;
441
+ constructor(config) {
442
+ this.publicClient = config.publicClient;
443
+ this.walletClient = config.walletClient;
444
+ const chainId = config.chainId ?? config.publicClient.chain?.id;
445
+ const addressOverride = config.address ? normaliseAddress(config.address) : void 0;
446
+ const resolved = addressOverride ?? (chainId === void 0 ? void 0 : getFheVestingFactoryAddress(chainId));
447
+ if (!resolved) {
448
+ throw new DeploymentAddressUnavailableError({
449
+ reason: chainId === void 0 ? "chain-id-missing" : "registry-not-deployed",
450
+ product: "fheVesting",
451
+ contract: "confidentialVestingFactory",
452
+ chainId,
453
+ clientLabel: "ConfidentialVestingFactoryClient"
454
+ });
455
+ }
456
+ this.address = resolved;
457
+ this.#telemetry = config.telemetry;
458
+ this.#telemetry?.event("fhe-vesting.client.init", {
459
+ surface: "factory",
460
+ chainId: chainId ?? null,
461
+ hasWallet: !!this.walletClient,
462
+ aclResolved: true,
463
+ // factory has no ACL dependency; constant for funnel-shape parity with manager.
464
+ sdkVersion: SDK_VERSION
465
+ });
466
+ }
467
+ // ----------------------- writes -----------------------
468
+ /**
469
+ * Deploy a new `ConfidentialVestingManager` clone via the factory and return
470
+ * its address, parsed from the `ManagerCreated` event in the tx receipt.
471
+ *
472
+ * **This is the headline factory entry point.** R02 ADR P-1 collapses the
473
+ * old hash-only + `…AndGetAddress` pair down to one rich-return method —
474
+ * the address is only knowable after the tx mines (the factory packs
475
+ * `block.number` into the clone's immutable args), so a hash-only variant
476
+ * forced consumers to re-derive what the SDK already had to compute.
477
+ *
478
+ * Calls `createManagerWithOptions` when `splitEnabled` or `pausableEnabled`
479
+ * is provided; otherwise calls the simpler `createManager` entry point.
480
+ *
481
+ * Internally: `writeContract` → {@link PublicClient.waitForTransactionReceipt} →
482
+ * `parseEventLogs({ eventName: "ManagerCreated" })`.
483
+ *
484
+ * Pre-mine prediction is exposed only on
485
+ * `ConfidentialVestingFactoryAdvancedClient` from
486
+ * `@tokenops/sdk/fhe-vesting/advanced` — predict at block N, mine at N+1,
487
+ * the addresses differ.
488
+ *
489
+ * @example
490
+ * const { hash, manager } = await factory.createManager({
491
+ * token: "0xYourToken",
492
+ * userSalt: "0x0000000000000000000000000000000000000000000000000000000000000001",
493
+ * });
494
+ */
495
+ async createManager(args) {
496
+ return withTelemetry(this.#telemetry, "fhe-vesting.factory.createManager", async () => {
497
+ const hasOptions = args.splitEnabled !== void 0 || args.pausableEnabled !== void 0;
498
+ const hash = hasOptions ? await this.#write(
499
+ "createManagerWithOptions",
500
+ [args.token, args.userSalt, args.splitEnabled ?? true, args.pausableEnabled ?? true],
501
+ args.account
502
+ ) : await this.#write("createManager", [args.token, args.userSalt], args.account);
503
+ return this.#resolveManagerFromReceipt(hash, "createManager");
504
+ });
505
+ }
506
+ /**
507
+ * Deploy a new manager clone and return its address, parsed from the
508
+ * `ManagerCreated` event in the tx receipt.
509
+ *
510
+ * This is the recommended entry point for the common "deploy a clone and use
511
+ * its address" flow. {@link ConfidentialVestingFactoryClient.predictManagerAddress}
512
+ * is unreliable on a live chain because the factory packs the deployment
513
+ * block number into the clone's immutable args — predict at block N, mine at
514
+ * N+1, and the addresses differ.
515
+ *
516
+ * Internally: {@link ConfidentialVestingFactoryClient.createManager} →
517
+ * {@link PublicClient.waitForTransactionReceipt} →
518
+ * `parseEventLogs({ eventName: "ManagerCreated" })`.
519
+ *
520
+ * @example
521
+ * const { hash, manager } = await factory.createManagerAndGetAddress({
522
+ * token, userSalt,
523
+ * });
524
+ */
525
+ async createManagerAndGetAddress(args) {
526
+ return this.createManager(args);
527
+ }
528
+ /**
529
+ * Set the factory-wide default gas fee (in wei). Factory admin only.
530
+ *
531
+ * @param fee Fee in wei charged per `claim` on `FeeType.Gas` managers.
532
+ */
533
+ async setDefaultGasFee(fee, account) {
534
+ return withTelemetry(this.#telemetry, "fhe-vesting.factory.setDefaultGasFee", async () => {
535
+ return this.#write("setDefaultGasFee", [fee], account);
536
+ });
537
+ }
538
+ /**
539
+ * Set the factory-wide default token fee in basis points. Factory admin only.
540
+ *
541
+ * @param feeBps Basis points (1 bps = 0.01 %). Deducted from the claimed token
542
+ * amount on `FeeType.DistributionToken` managers.
543
+ */
544
+ async setDefaultTokenFee(feeBps, account) {
545
+ return withTelemetry(this.#telemetry, "fhe-vesting.factory.setDefaultTokenFee", async () => {
546
+ return this.#write("setDefaultTokenFee", [feeBps], account);
547
+ });
548
+ }
549
+ /** Set the default fee model (`FeeType.Gas` or `FeeType.DistributionToken`) for new clones. Factory admin only. */
550
+ async setDefaultFeeType(feeType, account) {
551
+ return withTelemetry(this.#telemetry, "fhe-vesting.factory.setDefaultFeeType", async () => {
552
+ return this.#write("setDefaultFeeType", [feeType], account);
553
+ });
554
+ }
555
+ async resetGasFee(account) {
556
+ return withTelemetry(this.#telemetry, "fhe-vesting.factory.resetGasFee", async () => {
557
+ return this.#write("resetGasFee", [], account);
558
+ });
559
+ }
560
+ async resetTokenFee(account) {
561
+ return withTelemetry(this.#telemetry, "fhe-vesting.factory.resetTokenFee", async () => {
562
+ return this.#write("resetTokenFee", [], account);
563
+ });
564
+ }
565
+ /**
566
+ * Set a per-creator fee override. The override takes precedence over the factory
567
+ * defaults for all managers created by `args.creator`.
568
+ */
569
+ async setCustomFee(args, account) {
570
+ return withTelemetry(this.#telemetry, "fhe-vesting.factory.setCustomFee", async () => {
571
+ return this.#write(
572
+ "setCustomFee",
573
+ [args.creator, args.feeType, args.gasFee, args.tokenFee],
574
+ account
575
+ );
576
+ });
577
+ }
578
+ async disableCustomFee(creator, account) {
579
+ return withTelemetry(this.#telemetry, "fhe-vesting.factory.disableCustomFee", async () => {
580
+ return this.#write("disableCustomFee", [creator], account);
581
+ });
582
+ }
583
+ async setFeeCollector(newCollector, account) {
584
+ return withTelemetry(this.#telemetry, "fhe-vesting.factory.setFeeCollector", async () => {
585
+ return this.#write("setFeeCollector", [newCollector], account);
586
+ });
587
+ }
588
+ // ----------------------- reads -----------------------
589
+ /** Current LibClone implementation address. */
590
+ async implementation() {
591
+ return this.#read("implementation");
592
+ }
593
+ /**
594
+ * Alias for {@link ConfidentialVestingFactoryClient.implementation} that matches
595
+ * the contract's storage field name (`_managerImplementation`).
596
+ *
597
+ * Renamed for clarity per backend-integrator-r14 friction
598
+ * (`docs/feedback/inbox/2026-05-24-backend-integrator-r14-minor-implementation-vs-manager-implementation-naming.md`):
599
+ * server devs reading the Solidity reach for `factory.managerImplementation()`
600
+ * via autocomplete (the contract storage slot name) and hit a TS2551. The
601
+ * canonical `implementation()` method is retained for backwards-compat and
602
+ * cross-factory uniformity (fhe-airdrop exposes the same shape).
603
+ */
604
+ async managerImplementation() {
605
+ return this.implementation();
606
+ }
607
+ async defaultGasFee() {
608
+ return this.#read("defaultGasFee");
609
+ }
610
+ async defaultTokenFee() {
611
+ return this.#read("defaultTokenFee");
612
+ }
613
+ async defaultFeeType() {
614
+ const raw = await this.#read("defaultFeeType");
615
+ return raw;
616
+ }
617
+ async feeCollector() {
618
+ return this.#read("feeCollector");
619
+ }
620
+ async getCustomFee(creator) {
621
+ const raw = await this.#read("getCustomFee", [creator]);
622
+ return {
623
+ enabled: raw.enabled,
624
+ preferredFeeType: raw.preferredFeeType,
625
+ gasFee: raw.gasFee,
626
+ tokenFee: raw.tokenFee
627
+ };
628
+ }
629
+ async getInitCodeHash(args) {
630
+ const hasOptions = args.splitEnabled !== void 0 || args.pausableEnabled !== void 0;
631
+ if (hasOptions) {
632
+ return this.#read("getInitCodeHashWithOptions", [
633
+ args.token,
634
+ args.deployer,
635
+ args.splitEnabled ?? true,
636
+ args.pausableEnabled ?? true
637
+ ]);
638
+ }
639
+ return this.#read("getInitCodeHash", [args.token, args.deployer]);
640
+ }
641
+ // ----------------------- internals -----------------------
642
+ /**
643
+ * Wait for the receipt of a clone-deploy tx and parse the `ManagerCreated`
644
+ * event to extract the deployed manager address. Branded result; throws
645
+ * `TokenOpsSdkError` if zero or >1 events match this factory address.
646
+ */
647
+ async #resolveManagerFromReceipt(hash, method) {
648
+ const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
649
+ const events = parseEventLogs({
650
+ abi: confidentialVestingFactoryAbi,
651
+ eventName: "ManagerCreated",
652
+ logs: receipt.logs
653
+ });
654
+ const ours = events.filter((ev) => ev.address.toLowerCase() === this.address.toLowerCase());
655
+ if (ours.length === 0) {
656
+ throw new TokenOpsSdkError(
657
+ `${method}: no ManagerCreated event from factory ${this.address} in tx ${hash}`
658
+ );
659
+ }
660
+ if (ours.length > 1) {
661
+ throw new TokenOpsSdkError(
662
+ `${method}: ${ours.length} ManagerCreated events from factory ${this.address} in tx ${hash}; ambiguous result`
663
+ );
664
+ }
665
+ return { hash: asTxHash(hash), manager: ours[0].args.manager };
666
+ }
667
+ #requireWallet(method) {
668
+ if (!this.walletClient) {
669
+ throw new MissingWalletClientError(method);
670
+ }
671
+ return this.walletClient;
672
+ }
673
+ async #write(functionName, args, account) {
674
+ const wallet = this.#requireWallet(functionName);
675
+ const acct = account ?? wallet.account;
676
+ if (!acct) {
677
+ throw new MissingAccountError(String(functionName));
678
+ }
679
+ await this.#preflightWrite(String(functionName), functionName, args, acct);
680
+ try {
681
+ return await wallet.writeContract({
682
+ address: this.address,
683
+ abi: confidentialVestingFactoryAbi,
684
+ functionName,
685
+ args,
686
+ account: acct,
687
+ chain: wallet.chain
688
+ });
689
+ } catch (err) {
690
+ throw this.#mapRevert(String(functionName), err, accountAddress(acct));
691
+ }
692
+ }
693
+ #mapRevert(method, err, account) {
694
+ return mapContractRevert(err, {
695
+ method,
696
+ contractAddress: this.address,
697
+ abi: confidentialVestingFactoryAbi,
698
+ productMapper: vestingFactoryProductMapper,
699
+ account
700
+ });
701
+ }
702
+ /**
703
+ * Pre-flight a write via `simulateContract` purely to surface typed reverts.
704
+ * The simulate's *return value* is discarded — only revert metadata matters,
705
+ * since wallet transports drop revert data during gas estimation
706
+ * (CLAUDE.md Pitfall #1).
707
+ */
708
+ async #preflightWrite(method, functionName, args, account, value) {
709
+ try {
710
+ await this.publicClient.simulateContract({
711
+ address: this.address,
712
+ abi: confidentialVestingFactoryAbi,
713
+ functionName,
714
+ args,
715
+ account,
716
+ ...value !== void 0 ? { value } : {}
717
+ });
718
+ } catch (err) {
719
+ if (isContractRevert(err)) {
720
+ throw this.#mapRevert(method, err, accountAddress(account));
721
+ }
722
+ }
723
+ }
724
+ async #read(functionName, args = [], blockNumber) {
725
+ const result = await this.publicClient.readContract({
726
+ address: this.address,
727
+ abi: confidentialVestingFactoryAbi,
728
+ functionName,
729
+ args,
730
+ ...blockNumber !== void 0 && { blockNumber }
731
+ });
732
+ return result;
733
+ }
734
+ };
735
+ function createConfidentialVestingFactoryClient(config) {
736
+ return new ConfidentialVestingFactoryClient(config);
737
+ }
738
+ function accountAddress(account) {
739
+ return typeof account === "string" ? account : account.address;
740
+ }
741
+
742
+ export { ConfidentialVestingFactoryClient, DisclosureType, FeeType, confidentialVestingFactoryAbi, createConfidentialVestingFactoryClient, feeTypeName };