@tokenops/sdk 1.6.0 → 2.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/CHANGELOG.md +77 -8
  2. package/CONTRIBUTING.md +4 -2
  3. package/README.md +146 -90
  4. package/SUPPORT.md +47 -0
  5. package/dist/{chunk-BD4LZBVF.cjs → chunk-3QHNYEQD.cjs} +18 -17
  6. package/dist/{chunk-YFIWCYHC.cjs → chunk-3YHBO2DL.cjs} +56 -54
  7. package/dist/{chunk-QET3Q4JP.js → chunk-44YJPMQC.js} +8 -6
  8. package/dist/{chunk-6WSNS3UV.js → chunk-4RAAATVY.js} +2 -4
  9. package/dist/{chunk-4KJ66YRH.js → chunk-4TSDNZQ3.js} +2 -2
  10. package/dist/chunk-66IHPTOK.cjs +20 -0
  11. package/dist/{chunk-2RNW4MIJ.cjs → chunk-67OV5CX2.cjs} +0 -18
  12. package/dist/{chunk-PD7ME2BT.js → chunk-6GNR22OV.js} +2 -1
  13. package/dist/{chunk-WOEETTH7.cjs → chunk-7AFPOE7N.cjs} +6 -6
  14. package/dist/{chunk-QKKBBH7I.js → chunk-A4DCEE33.js} +34 -7
  15. package/dist/chunk-AREQJHKA.cjs +713 -0
  16. package/dist/{chunk-U57COLUE.js → chunk-AXIPOR3C.js} +2 -2
  17. package/dist/chunk-EBLBPUPI.cjs +255 -0
  18. package/dist/chunk-EYDA6Q6C.js +245 -0
  19. package/dist/{chunk-SYHNZSZZ.cjs → chunk-FAXIIH5R.cjs} +3 -3
  20. package/dist/{chunk-AYGRYDBX.cjs → chunk-FEDX7B6T.cjs} +37 -35
  21. package/dist/{chunk-CBRL2PJA.cjs → chunk-FHWSBGWE.cjs} +12 -12
  22. package/dist/{chunk-WUXUWTFW.cjs → chunk-FT5H2Q7Y.cjs} +37 -7
  23. package/dist/chunk-GADGBQJO.js +423 -0
  24. package/dist/{chunk-VHSNYUYV.js → chunk-IGO5XSPS.js} +5 -5
  25. package/dist/chunk-IUKKNJ2R.cjs +433 -0
  26. package/dist/{chunk-VR3FREBX.cjs → chunk-JK4XMMKM.cjs} +3 -3
  27. package/dist/{chunk-4ZCXK4VI.cjs → chunk-KFRDLKMA.cjs} +14 -14
  28. package/dist/chunk-KWFFIJYX.js +11 -0
  29. package/dist/{chunk-7G7UOQV4.cjs → chunk-MM5BV5CS.cjs} +4 -4
  30. package/dist/{chunk-43RFBQ73.cjs → chunk-MVDQMV25.cjs} +29 -32
  31. package/dist/chunk-NWFMBLSQ.js +4 -0
  32. package/dist/{chunk-HETNKZEE.js → chunk-PYYSB5ZN.js} +1 -1
  33. package/dist/chunk-PZZK3O3S.cjs +9843 -0
  34. package/dist/{chunk-DRSPMIZ7.js → chunk-QBJ7O2B4.js} +1 -11
  35. package/dist/{chunk-WTK6JDSI.js → chunk-SPLNGUFF.js} +6 -4
  36. package/dist/{chunk-UJS4N2XM.cjs → chunk-TEBM66WA.cjs} +12 -12
  37. package/dist/{chunk-TN65XNTI.js → chunk-TWT3STIX.js} +8 -6
  38. package/dist/chunk-UG5RKLU2.cjs +6 -0
  39. package/dist/{chunk-EUKPOXWR.cjs → chunk-UHHMVBLU.cjs} +17 -15
  40. package/dist/chunk-VW356KR3.js +688 -0
  41. package/dist/{chunk-BK7YIVLK.cjs → chunk-WJLECC22.cjs} +75 -73
  42. package/dist/{chunk-V5D7BHW3.js → chunk-WJMEBBU7.js} +6 -4
  43. package/dist/{chunk-NFW7AUEX.js → chunk-WMACINXO.js} +1 -1
  44. package/dist/chunk-X7WBPCEU.js +9817 -0
  45. package/dist/{chunk-46T67CE2.js → chunk-ZA673I3O.js} +1 -1
  46. package/dist/{chunk-YPYCWLYP.js → chunk-ZWXJTBZO.js} +1 -1
  47. package/dist/core/addresses.d.ts +14 -2
  48. package/dist/core/brands.d.ts +8 -2
  49. package/dist/core/errors.d.ts +71 -10
  50. package/dist/core/preflight.d.ts +1 -0
  51. package/dist/fhe/erc7984-abi.d.ts +1 -0
  52. package/dist/fhe/index.cjs +64 -63
  53. package/dist/fhe/index.js +7 -6
  54. package/dist/fhe/operators.d.ts +22 -5
  55. package/dist/fhe/react/index.cjs +13 -12
  56. package/dist/fhe/react/index.js +6 -5
  57. package/dist/fhe/types.d.ts +8 -2
  58. package/dist/fhe-airdrop/abis/{cloneable.d.ts → airdrop-base.d.ts} +254 -396
  59. package/dist/fhe-airdrop/abis/compliance.d.ts +422 -0
  60. package/dist/fhe-airdrop/abis/ecdsa.d.ts +1316 -0
  61. package/dist/fhe-airdrop/abis/factory.d.ts +1319 -190
  62. package/dist/fhe-airdrop/abis/index.d.ts +5 -2
  63. package/dist/fhe-airdrop/abis/merkle.d.ts +1250 -0
  64. package/dist/fhe-airdrop/advanced/index.cjs +11 -12
  65. package/dist/fhe-airdrop/advanced/index.d.cts +34 -11
  66. package/dist/fhe-airdrop/advanced/index.d.ts +34 -11
  67. package/dist/fhe-airdrop/advanced/index.js +3 -8
  68. package/dist/fhe-airdrop/advanced/react/index.cjs +619 -51
  69. package/dist/fhe-airdrop/advanced/react/index.d.cts +43 -3
  70. package/dist/fhe-airdrop/advanced/react/index.d.ts +43 -3
  71. package/dist/fhe-airdrop/advanced/react/index.js +592 -52
  72. package/dist/fhe-airdrop/advanced/react/useClearCompliancePolicy.d.ts +28 -0
  73. package/dist/fhe-airdrop/advanced/react/useClearUpgradeabilityPolicy.d.ts +26 -0
  74. package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +25 -0
  75. package/dist/fhe-airdrop/advanced/react/useEcdsaInitCodeHash.d.ts +30 -0
  76. package/dist/fhe-airdrop/advanced/react/useFactoryComplianceDelegate.d.ts +25 -0
  77. package/dist/fhe-airdrop/advanced/react/useFactoryCompliancePolicy.d.ts +38 -0
  78. package/dist/fhe-airdrop/advanced/react/useFactoryCustomFee.d.ts +24 -0
  79. package/dist/fhe-airdrop/advanced/react/useFactoryGrantRole.d.ts +32 -0
  80. package/dist/fhe-airdrop/advanced/react/useFactoryHasRole.d.ts +27 -0
  81. package/dist/fhe-airdrop/advanced/react/useFactoryImplementations.d.ts +33 -0
  82. package/dist/fhe-airdrop/advanced/react/useFactoryRenounceRole.d.ts +36 -0
  83. package/dist/fhe-airdrop/advanced/react/useFactoryRevokeRole.d.ts +35 -0
  84. package/dist/fhe-airdrop/advanced/react/useFactoryRoleConstants.d.ts +46 -0
  85. package/dist/fhe-airdrop/advanced/react/useFactoryRoleMembers.d.ts +47 -0
  86. package/dist/fhe-airdrop/advanced/react/useFactoryUpgradeabilityPolicy.d.ts +39 -0
  87. package/dist/fhe-airdrop/advanced/react/useMerkleInitCodeHash.d.ts +24 -0
  88. package/dist/fhe-airdrop/advanced/react/usePredictEcdsaAirdropAddress.d.ts +33 -0
  89. package/dist/fhe-airdrop/advanced/react/usePredictMerkleAirdropAddress.d.ts +27 -0
  90. package/dist/fhe-airdrop/advanced/react/useSetComplianceDelegate.d.ts +33 -0
  91. package/dist/fhe-airdrop/advanced/react/useSetComplianceManagerImpl.d.ts +27 -0
  92. package/dist/fhe-airdrop/advanced/react/useSetCompliancePolicy.d.ts +28 -0
  93. package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +28 -0
  94. package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +31 -0
  95. package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +28 -0
  96. package/dist/fhe-airdrop/advanced/react/useSetDefaultUpgradeable.d.ts +27 -0
  97. package/dist/fhe-airdrop/advanced/react/useSetEcdsaImplementation.d.ts +34 -0
  98. package/dist/fhe-airdrop/advanced/react/useSetFeeCollector.d.ts +27 -0
  99. package/dist/fhe-airdrop/advanced/react/useSetMerkleImplementation.d.ts +30 -0
  100. package/dist/fhe-airdrop/advanced/react/useSetUpgradeabilityPolicy.d.ts +31 -0
  101. package/dist/fhe-airdrop/airdrop-base.d.ts +608 -0
  102. package/dist/fhe-airdrop/campaign.d.ts +338 -0
  103. package/dist/fhe-airdrop/compliance.d.ts +302 -0
  104. package/dist/fhe-airdrop/constants.d.ts +33 -0
  105. package/dist/fhe-airdrop/ecdsa.d.ts +263 -0
  106. package/dist/fhe-airdrop/encryption.d.ts +92 -14
  107. package/dist/fhe-airdrop/errors.d.ts +273 -15
  108. package/dist/fhe-airdrop/factory.d.ts +533 -274
  109. package/dist/fhe-airdrop/guards.d.ts +317 -0
  110. package/dist/fhe-airdrop/index.cjs +233 -73
  111. package/dist/fhe-airdrop/index.d.cts +46 -8
  112. package/dist/fhe-airdrop/index.d.ts +46 -8
  113. package/dist/fhe-airdrop/index.js +11 -7
  114. package/dist/fhe-airdrop/merkle-tree.d.ts +97 -0
  115. package/dist/fhe-airdrop/merkle.d.ts +201 -0
  116. package/dist/fhe-airdrop/react/_shared.d.ts +156 -70
  117. package/dist/fhe-airdrop/react/index.cjs +1174 -384
  118. package/dist/fhe-airdrop/react/index.d.cts +99 -74
  119. package/dist/fhe-airdrop/react/index.d.ts +99 -74
  120. package/dist/fhe-airdrop/react/index.js +993 -303
  121. package/dist/fhe-airdrop/react/keys.d.ts +90 -0
  122. package/dist/fhe-airdrop/react/useAccessEcdsaClaimAmount.d.ts +26 -0
  123. package/dist/fhe-airdrop/react/useAccessMerkleClaimAmount.d.ts +27 -0
  124. package/dist/fhe-airdrop/react/useAddComplianceDelegate.d.ts +37 -0
  125. package/dist/fhe-airdrop/react/useAdminBatchDiscloseBalanceToParties.d.ts +36 -0
  126. package/dist/fhe-airdrop/react/useAdminDiscloseBalanceToParty.d.ts +31 -0
  127. package/dist/fhe-airdrop/react/useAdminGetCurrentBalance.d.ts +27 -0
  128. package/dist/fhe-airdrop/react/useAirdropConfig.d.ts +49 -0
  129. package/dist/fhe-airdrop/react/useAirdropDeploymentMode.d.ts +28 -0
  130. package/dist/fhe-airdrop/react/useAirdropGasFee.d.ts +10 -5
  131. package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +29 -10
  132. package/dist/fhe-airdrop/react/useAirdropHasRole.d.ts +15 -6
  133. package/dist/fhe-airdrop/react/useAirdropPause.d.ts +30 -0
  134. package/dist/fhe-airdrop/react/useAirdropPaused.d.ts +17 -0
  135. package/dist/fhe-airdrop/react/useAirdropRenounceRole.d.ts +36 -0
  136. package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +27 -9
  137. package/dist/fhe-airdrop/react/useAirdropRoleAdmin.d.ts +28 -0
  138. package/dist/fhe-airdrop/react/useAirdropRoleConstants.d.ts +67 -0
  139. package/dist/fhe-airdrop/react/useAirdropRoleMembers.d.ts +49 -0
  140. package/dist/fhe-airdrop/react/useAirdropToken.d.ts +11 -4
  141. package/dist/fhe-airdrop/react/useAirdropUpgradeToAndCall.d.ts +45 -0
  142. package/dist/fhe-airdrop/react/useAirdropWindow.d.ts +37 -0
  143. package/dist/fhe-airdrop/react/useBatchDiscloseHandlesToParty.d.ts +32 -0
  144. package/dist/fhe-airdrop/react/useBuildMerkleCampaign.d.ts +68 -0
  145. package/dist/fhe-airdrop/react/useClaimedAmount.d.ts +29 -0
  146. package/dist/fhe-airdrop/react/useComplianceGrantRole.d.ts +32 -0
  147. package/dist/fhe-airdrop/react/useComplianceHasRole.d.ts +37 -0
  148. package/dist/fhe-airdrop/react/useComplianceInfo.d.ts +50 -0
  149. package/dist/fhe-airdrop/react/useComplianceManager.d.ts +16 -0
  150. package/dist/fhe-airdrop/react/useComplianceManagerOf.d.ts +32 -0
  151. package/dist/fhe-airdrop/react/useComplianceRenounceRole.d.ts +38 -0
  152. package/dist/fhe-airdrop/react/useComplianceRevokeRole.d.ts +36 -0
  153. package/dist/fhe-airdrop/react/useComplianceRoleConstants.d.ts +41 -0
  154. package/dist/fhe-airdrop/react/useComplianceRoleMembers.d.ts +45 -0
  155. package/dist/fhe-airdrop/react/useCreateAndFundEcdsaAirdrop.d.ts +55 -0
  156. package/dist/fhe-airdrop/react/useCreateAndFundMerkleAirdrop.d.ts +52 -0
  157. package/dist/fhe-airdrop/react/useCreateEcdsaAirdrop.d.ts +28 -0
  158. package/dist/fhe-airdrop/react/useCreateMerkleAirdrop.d.ts +25 -0
  159. package/dist/fhe-airdrop/react/useDiscloseHandleToParty.d.ts +35 -0
  160. package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +24 -0
  161. package/dist/fhe-airdrop/react/useEcdsaClaimAndUnwrap.d.ts +27 -0
  162. package/dist/fhe-airdrop/react/useEcdsaDomain.d.ts +41 -0
  163. package/dist/fhe-airdrop/react/useEffectiveDelegateToCompliance.d.ts +26 -0
  164. package/dist/fhe-airdrop/react/useEffectiveUpgradeable.d.ts +20 -0
  165. package/dist/fhe-airdrop/react/useEncryptCampaignAmounts.d.ts +59 -0
  166. package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +17 -12
  167. package/dist/fhe-airdrop/react/useFactoryFees.d.ts +28 -0
  168. package/dist/fhe-airdrop/react/useFactoryRegistry.d.ts +35 -0
  169. package/dist/fhe-airdrop/react/useFundAirdrop.d.ts +35 -0
  170. package/dist/fhe-airdrop/react/useGrantInstanceRoles.d.ts +35 -0
  171. package/dist/fhe-airdrop/react/useIsActiveDelegate.d.ts +29 -0
  172. package/dist/fhe-airdrop/react/useIsMerkleRootMutable.d.ts +21 -0
  173. package/dist/fhe-airdrop/react/useIsSignatureValid.d.ts +46 -0
  174. package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +22 -0
  175. package/dist/fhe-airdrop/react/useMerkleClaimAndUnwrap.d.ts +29 -0
  176. package/dist/fhe-airdrop/react/useMerkleRoot.d.ts +15 -0
  177. package/dist/fhe-airdrop/react/usePlanMerkleCampaign.d.ts +53 -0
  178. package/dist/fhe-airdrop/react/usePreflightClaim.d.ts +46 -0
  179. package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +51 -35
  180. package/dist/fhe-airdrop/react/useRescueERC20.d.ts +30 -0
  181. package/dist/fhe-airdrop/react/useRescueOtherConfidentialToken.d.ts +34 -0
  182. package/dist/fhe-airdrop/react/useRevokeComplianceDelegate.d.ts +37 -0
  183. package/dist/fhe-airdrop/react/useRotateMerkleRoot.d.ts +52 -0
  184. package/dist/fhe-airdrop/react/useSetMerkleRoot.d.ts +22 -0
  185. package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +32 -21
  186. package/dist/fhe-airdrop/react/useWithdrawConfidential.d.ts +23 -0
  187. package/dist/fhe-airdrop/react/useWithdrawGasFee.d.ts +37 -0
  188. package/dist/fhe-airdrop/roles.d.ts +147 -0
  189. package/dist/fhe-airdrop/types.d.ts +78 -63
  190. package/dist/fhe-disperse/index.cjs +70 -68
  191. package/dist/fhe-disperse/index.js +10 -8
  192. package/dist/fhe-disperse/react/index.cjs +94 -92
  193. package/dist/fhe-disperse/react/index.js +13 -11
  194. package/dist/fhe-vesting/advanced/index.cjs +10 -8
  195. package/dist/fhe-vesting/advanced/index.js +8 -6
  196. package/dist/fhe-vesting/advanced/react/index.cjs +16 -14
  197. package/dist/fhe-vesting/advanced/react/index.js +13 -11
  198. package/dist/fhe-vesting/index.cjs +74 -72
  199. package/dist/fhe-vesting/index.js +11 -9
  200. package/dist/fhe-vesting/react/index.cjs +228 -226
  201. package/dist/fhe-vesting/react/index.js +15 -13
  202. package/dist/index.cjs +100 -87
  203. package/dist/index.js +3 -2
  204. package/dist/testnet-faucet/index.cjs +57 -55
  205. package/dist/testnet-faucet/index.js +7 -5
  206. package/dist/testnet-faucet/react/index.cjs +55 -53
  207. package/dist/testnet-faucet/react/index.js +9 -7
  208. package/package.json +6 -2
  209. package/dist/chunk-CNP4L3GF.js +0 -105
  210. package/dist/chunk-KSDSXJ34.js +0 -41
  211. package/dist/chunk-LBWRFZR3.cjs +0 -1681
  212. package/dist/chunk-OL6SHN3D.cjs +0 -44
  213. package/dist/chunk-S2XD75JM.js +0 -1637
  214. package/dist/chunk-SPGSO5SO.cjs +0 -1644
  215. package/dist/chunk-UE5XK2SY.js +0 -1673
  216. package/dist/chunk-WO72UBQD.cjs +0 -109
  217. package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +0 -53
  218. package/dist/fhe-airdrop/advanced/react/usePredictAirdropAddress.d.ts +0 -49
  219. package/dist/fhe-airdrop/airdrop.d.ts +0 -317
  220. package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +0 -37
  221. package/dist/fhe-airdrop/react/useAirdropCanExtendClaimWindow.d.ts +0 -7
  222. package/dist/fhe-airdrop/react/useAirdropClaimTypehash.d.ts +0 -10
  223. package/dist/fhe-airdrop/react/useAirdropClaimedSignatures.d.ts +0 -16
  224. package/dist/fhe-airdrop/react/useAirdropDeploymentBlockNumber.d.ts +0 -6
  225. package/dist/fhe-airdrop/react/useAirdropDomainSeparator.d.ts +0 -8
  226. package/dist/fhe-airdrop/react/useAirdropEndTime.d.ts +0 -10
  227. package/dist/fhe-airdrop/react/useAirdropFactoryCustomFee.d.ts +0 -17
  228. package/dist/fhe-airdrop/react/useAirdropFactoryDefaultGasFee.d.ts +0 -10
  229. package/dist/fhe-airdrop/react/useAirdropFactoryDisableCustomFee.d.ts +0 -15
  230. package/dist/fhe-airdrop/react/useAirdropFactoryFeeCollector.d.ts +0 -11
  231. package/dist/fhe-airdrop/react/useAirdropFactoryInitCodeHash.d.ts +0 -17
  232. package/dist/fhe-airdrop/react/useAirdropFactorySetCustomFee.d.ts +0 -17
  233. package/dist/fhe-airdrop/react/useAirdropFactorySetDefaultGasFee.d.ts +0 -16
  234. package/dist/fhe-airdrop/react/useAirdropFactorySetFeeCollector.d.ts +0 -15
  235. package/dist/fhe-airdrop/react/useAirdropHasClaimEnded.d.ts +0 -7
  236. package/dist/fhe-airdrop/react/useAirdropHasClaimStarted.d.ts +0 -7
  237. package/dist/fhe-airdrop/react/useAirdropIsClaimWindowActive.d.ts +0 -9
  238. package/dist/fhe-airdrop/react/useAirdropIsPaused.d.ts +0 -8
  239. package/dist/fhe-airdrop/react/useAirdropIsSignatureClaimed.d.ts +0 -22
  240. package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +0 -51
  241. package/dist/fhe-airdrop/react/useAirdropStartTime.d.ts +0 -10
  242. package/dist/fhe-airdrop/react/useAirdropWithdrawGasFee.d.ts +0 -15
  243. package/dist/fhe-airdrop/react/useAirdropWithdrawOtherConfidentialToken.d.ts +0 -14
  244. package/dist/fhe-airdrop/react/useAirdropWithdrawOtherToken.d.ts +0 -14
  245. package/dist/fhe-airdrop/react/useClaim.d.ts +0 -39
  246. package/dist/fhe-airdrop/react/useConfidentialAirdropFactoryImplementation.d.ts +0 -11
  247. package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +0 -41
  248. package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +0 -48
  249. package/dist/fhe-airdrop/react/useCreateConfidentialAirdrop.d.ts +0 -29
  250. package/dist/fhe-airdrop/react/useCreateConfidentialAirdropAndGetAddress.d.ts +0 -31
  251. package/dist/fhe-airdrop/react/useDisableCustomFee.d.ts +0 -14
  252. package/dist/fhe-airdrop/react/useFactoryCustomFee.d.ts +0 -17
  253. package/dist/fhe-airdrop/react/useFactoryDefaultGasFee.d.ts +0 -10
  254. package/dist/fhe-airdrop/react/useFactoryFeeCollector.d.ts +0 -11
  255. package/dist/fhe-airdrop/react/useFactoryInitCodeHash.d.ts +0 -17
  256. package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +0 -33
  257. package/dist/fhe-airdrop/react/useSetCustomFee.d.ts +0 -16
  258. package/dist/fhe-airdrop/react/useSetDefaultGasFee.d.ts +0 -15
  259. package/dist/fhe-airdrop/react/useSetFeeCollector.d.ts +0 -14
  260. package/dist/fhe-airdrop/react/useSetPaused.d.ts +0 -14
  261. package/dist/fhe-airdrop/react/useWithdraw.d.ts +0 -12
  262. package/dist/fhe-airdrop/react/useWithdrawOtherConfidentialToken.d.ts +0 -13
  263. package/dist/fhe-airdrop/react/useWithdrawOtherToken.d.ts +0 -13
@@ -0,0 +1,608 @@
1
+ import type { Abi, Account, Address, Hex, PublicClient, WalletClient } from "viem";
2
+ import { type TokenOpsSdkError } from "../core/errors.js";
3
+ import { type SdkTelemetry } from "../core/telemetry.js";
4
+ import type { EncryptedViewResult } from "../fhe/types.js";
5
+ import type { DeploymentMode } from "./constants.js";
6
+ /**
7
+ * The minimum of a receipt log this module reads.
8
+ *
9
+ * Deliberately narrower than viem's `Log`: `receipt.logs` satisfies it, and so
10
+ * does a hand-built fixture, which keeps the ACL-extraction contract testable
11
+ * without inventing block numbers and log indices that play no part in it.
12
+ */
13
+ export interface AclCandidateLog {
14
+ address: Address;
15
+ topics: readonly Hex[];
16
+ data: Hex;
17
+ }
18
+ /** Inputs for {@link extractGrantedHandle}. */
19
+ export interface ExtractGrantedHandleArgs {
20
+ /** Receipt logs, unfiltered. */
21
+ logs: readonly AclCandidateLog[];
22
+ /** FHEVM ACL contract for the chain — the only address whose `Allowed` events count. */
23
+ aclAddress: Address;
24
+ /** The address the grant must name, i.e. the `FHE.allow(handle, <account>)` target. */
25
+ account: Address;
26
+ /** Optional: the contract that issued the grant, to exclude allows made by other contracts in the same tx. */
27
+ caller?: Address | undefined;
28
+ /** Method label for the thrown error. */
29
+ method?: string | undefined;
30
+ /** Transaction hash for the thrown error. */
31
+ txHash?: Hex | undefined;
32
+ }
33
+ /**
34
+ * Pull the encrypted handle a transaction granted to `account` out of its
35
+ * receipt logs.
36
+ *
37
+ * This is the module's implementation of CLAUDE.md pitfall 1, and the reason
38
+ * every encrypted view here is a transaction rather than a `readContract`.
39
+ * The tempting alternative — `simulateContract(...).result` — returns a
40
+ * handle that is **wrong but plausible**: an FHE op's output handle is derived
41
+ * from counters that advance inside the executed transaction, so the simulated
42
+ * value diverges from the one the executed transaction actually granted ACL
43
+ * on. Nothing fails at that point. The damage surfaces much later, as a
44
+ * `userDecrypt` rejected with "User X is not authorized to decrypt handle Y".
45
+ * The receipt's ACL `Allowed` event is the only source that cannot drift.
46
+ *
47
+ * **Last match wins — a defensive default, not a live requirement.** Across
48
+ * every entrypoint currently routed through `encryptedView`, exactly one
49
+ * `Allowed` event survives the `account` filter, so the choice between first
50
+ * and last is moot today:
51
+ *
52
+ * - `adminGetCurrentBalance` — a single `FHE.allow(balance, msg.sender)`
53
+ * (`ConfidentialAirdropBase.sol:358`).
54
+ * - `adminDiscloseBalanceToParty` — a single `FHE.allow(balance, party)` (`:367`).
55
+ * - `adminBatchDiscloseBalanceToParties` — N grants, but the balance is read
56
+ * once (`:377`) and the *same* handle is fanned out (`:379`), so every
57
+ * candidate carries an identical value and ordering cannot matter.
58
+ * - `getClaimAmount` on both variants — the sibling grants target other
59
+ * addresses: `FHE.allowThis` grants `address(this)` and `_grantCompliance`
60
+ * grants the manager clone (`ConfidentialAirdropBase.sol:431`), leaving one
61
+ * grant to the caller (`ECDSAConfidentialAirdrop.sol:166-167`,
62
+ * `MerkleConfidentialAirdrop.sol:264-266`).
63
+ *
64
+ * Last-wins is therefore chosen for entrypoints that do not exist yet, over
65
+ * `fhe-vesting`'s throw-on-ambiguous: a future compound view that grants twice
66
+ * should return its final handle rather than fail, and the batch-disclosure
67
+ * path already shows the shape where N events legitimately carry one answer.
68
+ *
69
+ * Note what is NOT a motivating case: the Merkle `claim` path does grant an
70
+ * intermediate handle before the outstanding one, but `claim` /
71
+ * `claimAndUnwrap` return void (`IMerkleConfidentialAirdrop.sol:51-70`), so
72
+ * they run as plain writes and their receipts never reach this function.
73
+ *
74
+ * @throws {@link ReceiptEventNotFoundError} when no `Allowed` event names `account`.
75
+ */
76
+ export declare function extractGrantedHandle(args: ExtractGrantedHandleArgs): Hex;
77
+ /** @alpha */
78
+ export interface AirdropBaseClientConfig {
79
+ publicClient: PublicClient;
80
+ walletClient?: WalletClient | undefined;
81
+ /** The airdrop instance — a factory-deployed clone or UUPS proxy, never the implementation. */
82
+ address: Address;
83
+ /**
84
+ * Chain id used for the support check and the ACL lookup. Defaults to
85
+ * `publicClient.chain?.id`; one of the two must resolve, because the client
86
+ * refuses to talk to a chain it cannot name.
87
+ */
88
+ chainId?: number | undefined;
89
+ /**
90
+ * FHEVM ACL contract address override. Resolved from the chain id via the
91
+ * SDK's registry when omitted. Required because every encrypted view reads
92
+ * the granted handle out of this contract's `Allowed` events — pointing it
93
+ * at the wrong address does not fail loudly, it returns nothing to parse.
94
+ */
95
+ aclAddress?: Address | undefined;
96
+ /**
97
+ * Optional telemetry sink. When provided, the SDK emits a
98
+ * `fhe-airdrop.client.init` event on construction and brackets public write
99
+ * methods with named spans (`fhe-airdrop.airdrop.pause`, …). Defaults to a
100
+ * no-op — zero overhead, zero leakage of consumer-side identifiers.
101
+ *
102
+ * Spans carry the method name and the instance address only. Encrypted
103
+ * handles may appear; decrypted amounts never do.
104
+ */
105
+ telemetry?: SdkTelemetry | undefined;
106
+ }
107
+ /**
108
+ * Wiring a subclass supplies to the base constructor. Not part of the
109
+ * consumer-facing config: an application never chooses these, a variant client
110
+ * always does.
111
+ */
112
+ export interface AirdropClientInternals {
113
+ /**
114
+ * The variant's full ABI — a superset of `confidentialAirdropBaseAbi`. Used for every
115
+ * read, write, preflight and revert decode, so passing the variant ABI is
116
+ * what lets an inherited helper carry a variant-only revert (e.g.
117
+ * `InvalidMerkleProof`) through to its typed error.
118
+ */
119
+ abi?: Abi | undefined;
120
+ /** Telemetry span namespace segment, e.g. `"ecdsa"` for `fhe-airdrop.ecdsa.pause`. */
121
+ surface?: string | undefined;
122
+ }
123
+ /**
124
+ * Who sends the transaction, when it should not be the wallet client's own account.
125
+ *
126
+ * @alpha
127
+ */
128
+ export interface WriteAccountOverride {
129
+ account?: Account | Address | undefined;
130
+ }
131
+ /**
132
+ * The surface every airdrop v2 instance shares, regardless of how it
133
+ * authorises a claim.
134
+ *
135
+ * `ConfidentialAirdropBase` is the abstract half of both deployed variants, so
136
+ * this class is usable directly against any instance address whose variant you
137
+ * do not care about (an admin panel listing campaigns, say). The ECDSA and
138
+ * Merkle clients extend it and add their own claim path.
139
+ *
140
+ * What it encapsulates beyond the raw ABI is the encrypted-view protocol: five
141
+ * of the contract's disclosure entrypoints look like getters and are not —
142
+ * they mutate ACL state, so they are transactions, and their result must be
143
+ * recovered from the receipt. See {@link extractGrantedHandle}.
144
+ *
145
+ * @example
146
+ * const airdrop = new AirdropBaseClient({ publicClient, walletClient, address });
147
+ * const { handle } = await airdrop.adminGetCurrentBalance();
148
+ * // `handle` is now decryptable by the caller via the Zama relayer.
149
+ *
150
+ * @alpha
151
+ */
152
+ export declare class AirdropBaseClient {
153
+ readonly publicClient: PublicClient;
154
+ readonly walletClient?: WalletClient | undefined;
155
+ readonly address: Address;
156
+ readonly chainId: number;
157
+ readonly aclAddress: Address;
158
+ /** The ABI every inherited helper uses. Subclasses pass their variant's. */
159
+ protected readonly abi: Abi;
160
+ /** Telemetry span namespace, e.g. `fhe-airdrop.airdrop`. */
161
+ protected readonly spanPrefix: string;
162
+ protected readonly telemetry?: SdkTelemetry | undefined;
163
+ constructor(config: AirdropBaseClientConfig, internals?: AirdropClientInternals);
164
+ /**
165
+ * Halt claiming. Requires `PAUSER_ROLE`.
166
+ *
167
+ * Pausing does not stop the clock: `endTime` still passes while paused, so a
168
+ * long pause can consume the window outright. Pair it with
169
+ * {@link extendClaimWindow} when the campaign is meant to survive.
170
+ *
171
+ * @returns The transaction hash.
172
+ */
173
+ pause(args?: WriteAccountOverride): Promise<Hex>;
174
+ /**
175
+ * Resume claiming. Requires `PAUSER_ROLE`.
176
+ *
177
+ * @returns The transaction hash.
178
+ */
179
+ unpause(args?: WriteAccountOverride): Promise<Hex>;
180
+ /**
181
+ * Move the campaign's end time forward. Requires `WINDOW_ADMIN_ROLE`.
182
+ *
183
+ * Forward-only, and only on an instance created with
184
+ * `canExtendClaimWindow: true` — otherwise the contract reverts
185
+ * `ExtensionNotAllowed`, which the SDK surfaces as `FeatureDisabledError`.
186
+ *
187
+ * @param args.newEndTime Unix seconds, `uint32` on-chain; must exceed the current `endTime`.
188
+ * @returns The transaction hash.
189
+ */
190
+ extendClaimWindow(args: {
191
+ newEndTime: number;
192
+ } & WriteAccountOverride): Promise<Hex>;
193
+ /**
194
+ * Sweep the instance's entire remaining confidential balance to `recipient`.
195
+ * Requires `TREASURY_ROLE`.
196
+ *
197
+ * The amount is not a parameter and never appears in plaintext anywhere:
198
+ * the contract reads its own encrypted balance and moves all of it.
199
+ *
200
+ * @returns The transaction hash.
201
+ */
202
+ withdrawConfidential(args: {
203
+ recipient: Address;
204
+ } & WriteAccountOverride): Promise<Hex>;
205
+ /**
206
+ * Withdraw accrued claim-fee ETH. Requires `FEE_COLLECTOR_ROLE`.
207
+ *
208
+ * @param args.amount Wei. Exceeding the accrued balance reverts `InsufficientFeeBalance`
209
+ * (surfaced as `InsufficientBalanceError`) — this is public ETH, not a confidential quantity.
210
+ * @returns The transaction hash.
211
+ */
212
+ withdrawGasFee(args: {
213
+ recipient: Address;
214
+ amount: bigint;
215
+ } & WriteAccountOverride): Promise<Hex>;
216
+ /**
217
+ * Sweep a plain ERC-20 that was sent to the instance by mistake. Requires
218
+ * `RESCUER_ROLE`.
219
+ *
220
+ * The campaign's own token is ERC-7984, not ERC-20, so it cannot be reached
221
+ * through this path — use {@link withdrawConfidential} for the pool.
222
+ *
223
+ * @returns The transaction hash.
224
+ */
225
+ rescueERC20(args: {
226
+ token: Address;
227
+ recipient: Address;
228
+ } & WriteAccountOverride): Promise<Hex>;
229
+ /**
230
+ * Sweep a *different* ERC-7984 token that was sent to the instance by
231
+ * mistake. Requires `RESCUER_ROLE`.
232
+ *
233
+ * Passing the campaign's own token reverts `CannotRescueAirdropToken` — the
234
+ * guard that stops a rescuer draining the pool without `TREASURY_ROLE`.
235
+ *
236
+ * @returns The transaction hash.
237
+ */
238
+ rescueOtherConfidentialToken(args: {
239
+ token: Address;
240
+ recipient: Address;
241
+ } & WriteAccountOverride): Promise<Hex>;
242
+ /** The ERC-7984 token this campaign distributes. */
243
+ token(): Promise<Address>;
244
+ /**
245
+ * The variant ordinal: `0` = ECDSA, `1` = Merkle (contract enum
246
+ * `AirdropType`). Read it to pick which variant client to construct against
247
+ * an address you were handed rather than created.
248
+ */
249
+ airdropType(): Promise<number>;
250
+ /** Claim-window open, Unix seconds. */
251
+ startTime(): Promise<number>;
252
+ /** Claim-window close, Unix seconds. Movable forward via {@link extendClaimWindow}. */
253
+ endTime(): Promise<number>;
254
+ /** Whether claimants may unwrap to the underlying ERC-20 as part of a claim. */
255
+ unwrappable(): Promise<boolean>;
256
+ /** The instance's own compliance-manager clone — the only contract granted ACL on campaign handles. */
257
+ complianceManager(): Promise<Address>;
258
+ /** Per-claim ETH fee in wei; `0` on a fee-free campaign. */
259
+ gasFee(): Promise<bigint>;
260
+ /**
261
+ * Whether a claim would be accepted right now — in window **and** not
262
+ * paused. Distinct from `hasClaimStarted() && !hasClaimEnded()`, which
263
+ * ignores the pause flag.
264
+ */
265
+ isClaimWindowActive(): Promise<boolean>;
266
+ /** Whether `startTime` has passed. Says nothing about the pause flag. */
267
+ hasClaimStarted(): Promise<boolean>;
268
+ /** Whether `endTime` has passed. Says nothing about the pause flag. */
269
+ hasClaimEnded(): Promise<boolean>;
270
+ /**
271
+ * Whether claiming is currently halted (`PausableUpgradeable.paused()`).
272
+ * Independent of the claim window — see {@link isClaimWindowActive}, which
273
+ * ANDs this together with the window check.
274
+ */
275
+ paused(): Promise<boolean>;
276
+ /** Gates {@link pause} / {@link unpause}. */
277
+ PAUSER_ROLE(): Promise<Hex>;
278
+ /** Gates {@link extendClaimWindow}. */
279
+ WINDOW_ADMIN_ROLE(): Promise<Hex>;
280
+ /** Gates {@link withdrawConfidential}. */
281
+ TREASURY_ROLE(): Promise<Hex>;
282
+ /** Gates {@link rescueERC20} / {@link rescueOtherConfidentialToken}. */
283
+ RESCUER_ROLE(): Promise<Hex>;
284
+ /** Gates {@link withdrawGasFee}. The contract refuses to leave it empty on a fee-charging campaign. */
285
+ FEE_COLLECTOR_ROLE(): Promise<Hex>;
286
+ /** Gates `upgradeToAndCall` on UUPS instances; inert on clones. */
287
+ UPGRADER_ROLE(): Promise<Hex>;
288
+ /** Gates the admin disclosure surface, and bypasses gate #1 of the raw-handle disclosure path. */
289
+ DISCLOSURE_ADMIN_ROLE(): Promise<Hex>;
290
+ /**
291
+ * OpenZeppelin's root role (`bytes32(0)`), read from the instance rather
292
+ * than hard-coded so a re-parented hierarchy shows up here instead of
293
+ * silently diverging.
294
+ *
295
+ * It administers every role on this instance except `FEE_COLLECTOR_ROLE`,
296
+ * which administers itself - see {@link getRoleAdmin}.
297
+ */
298
+ DEFAULT_ADMIN_ROLE(): Promise<Hex>;
299
+ /**
300
+ * The role whose holders may {@link grantRole} and {@link revokeRole} `role`.
301
+ *
302
+ * `DEFAULT_ADMIN_ROLE` for everything the instance sets up at `initialize`,
303
+ * except `FEE_COLLECTOR_ROLE`, which the contract re-parents to itself: only
304
+ * a current fee collector can add or remove another. That is why
305
+ * `planInstanceRoleSplit` (`./roles.js`) refuses to plan a fee-collector
306
+ * grant from an admin key - this read is how a caller confirms it.
307
+ */
308
+ getRoleAdmin(role: Hex): Promise<Hex>;
309
+ /**
310
+ * Whether `holder` holds `role`.
311
+ *
312
+ * The role subject is called `holder`, not `account`, across all three role
313
+ * methods: on the two writes `account` already means "who sends this
314
+ * transaction" ({@link WriteAccountOverride}), and one key cannot be both —
315
+ * a grant made by an admin to somebody else is the normal case, not the
316
+ * exception.
317
+ *
318
+ * @param args.role A `bytes32` from one of the role getters above — not a hand-hashed string.
319
+ */
320
+ hasRole(args: {
321
+ role: Hex;
322
+ holder: Address;
323
+ }): Promise<boolean>;
324
+ /**
325
+ * Grant `role` to `holder`. Requires the role's admin role
326
+ * (`DEFAULT_ADMIN_ROLE` unless the instance re-parented it).
327
+ *
328
+ * @returns The transaction hash.
329
+ */
330
+ grantRole(args: {
331
+ role: Hex;
332
+ holder: Address;
333
+ } & WriteAccountOverride): Promise<Hex>;
334
+ /**
335
+ * Revoke `role` from `holder`. Requires the role's admin role.
336
+ *
337
+ * Two revocations are blocked on-chain rather than silently allowed:
338
+ * removing the last `DEFAULT_ADMIN_ROLE` member (`LastAdmin`) or the last
339
+ * `FEE_COLLECTOR_ROLE` member of a fee-charging campaign
340
+ * (`LastFeeCollector`). Both would strand the instance.
341
+ *
342
+ * @returns The transaction hash.
343
+ */
344
+ revokeRole(args: {
345
+ role: Hex;
346
+ holder: Address;
347
+ } & WriteAccountOverride): Promise<Hex>;
348
+ /**
349
+ * Give up `role` yourself.
350
+ *
351
+ * The contract's signature is `renounceRole(role, callerConfirmation)` and
352
+ * it reverts `AccessControlBadConfirmation` unless `callerConfirmation` is
353
+ * the sender. This method therefore takes no holder at all and fills the
354
+ * confirmation from the resolved sending account: renouncing on somebody
355
+ * else's behalf is not a call that can succeed, so the SDK does not offer a
356
+ * shape that lets a caller try. To remove a role from another account, use
357
+ * {@link revokeRole}.
358
+ *
359
+ * Renouncing runs through the same `_revokeRole` floors as
360
+ * {@link revokeRole}, so it is **not** an escape hatch from them. In
361
+ * particular `DEFAULT_ADMIN_ROLE`'s floor is unconditional: the sole
362
+ * remaining admin cannot renounce (`LastAdmin`), because an instance with no
363
+ * admin has no role administrator left to re-grant one. The
364
+ * renounce-admin-to-freeze-the-instance pattern is deliberately unavailable
365
+ * here - grant a successor first, then have the predecessor renounce or be
366
+ * revoked.
367
+ *
368
+ * @param args.role A `bytes32` from one of the role getters above.
369
+ * @returns The transaction hash.
370
+ */
371
+ renounceRole(args: {
372
+ role: Hex;
373
+ } & WriteAccountOverride): Promise<Hex>;
374
+ /**
375
+ * How many accounts hold `role`.
376
+ *
377
+ * Cheap enough to poll, and the value the contract's own floors are written
378
+ * against: a revoke of `DEFAULT_ADMIN_ROLE` at count 1 reverts `LastAdmin`,
379
+ * and of `FEE_COLLECTOR_ROLE` at count 1 on a fee-charging campaign reverts
380
+ * `LastFeeCollector`.
381
+ */
382
+ getRoleMemberCount(role: Hex): Promise<bigint>;
383
+ /**
384
+ * The `index`-th holder of `role`, in the contract's own enumeration order.
385
+ *
386
+ * Ordering is `EnumerableSet`'s and is not stable across grants and
387
+ * revokes - index into it only alongside a
388
+ * {@link getRoleMemberCount} read taken at the same block, or prefer
389
+ * {@link getRoleMembers}, which returns the whole set in one call.
390
+ */
391
+ getRoleMember(args: {
392
+ role: Hex;
393
+ index: bigint;
394
+ }): Promise<Address>;
395
+ /**
396
+ * Every account currently holding `role`.
397
+ *
398
+ * This is how the campaign's fee collectors are meant to be discovered: the
399
+ * contract deliberately ships no `feeCollectors()` view and points callers
400
+ * at `getRoleMembers(FEE_COLLECTOR_ROLE)` instead, so this read is the
401
+ * supported answer to "who can withdraw this campaign's accrued claim ETH?"
402
+ * - the membership the `LastFeeCollector` floor exists to keep non-empty.
403
+ *
404
+ * One `eth_call` and unpaginated: role sets on an airdrop instance are
405
+ * operator-sized, not user-sized.
406
+ */
407
+ getRoleMembers(role: Hex): Promise<readonly Address[]>;
408
+ /**
409
+ * Point this instance's proxy at `newImplementation`, optionally calling
410
+ * into it in the same transaction. Requires `UPGRADER_ROLE`
411
+ * (`_authorizeUpgrade` is `onlyRole(UPGRADER_ROLE)`).
412
+ *
413
+ * **Inert on clone-mode instances.** A clone has no ERC-1967 implementation
414
+ * slot to rewrite; the call reverts at the proxy layer rather than doing
415
+ * anything partial. Call {@link deploymentMode}, or remember the create-time
416
+ * `mode`, before offering this in a UI. Do NOT reach for
417
+ * {@link proxiableUUID} - it reverts on clone and UUPS instances alike and
418
+ * cannot tell them apart.
419
+ *
420
+ * **Merkle campaigns cannot reach this at all through the SDK**, because the
421
+ * SDK refuses to create one in `uups` mode in the first place - see
422
+ * {@link MerkleUupsUnsupportedError} for the storage-retype reason.
423
+ *
424
+ * @param args.data Initializer calldata to run against the new
425
+ * implementation, or `"0x"` (the default) for a plain implementation
426
+ * swap. A non-empty payload runs with `delegatecall` semantics - it is the
427
+ * new implementation's code executing against this instance's storage.
428
+ * @param args.value Wei to attach. The function is `payable`, but the
429
+ * ERC-1967 upgrade path reverts `ERC1967NonPayable` when value is sent
430
+ * with empty `data`, so leave it unset for a plain swap.
431
+ * @returns The transaction hash.
432
+ */
433
+ upgradeToAndCall(args: {
434
+ newImplementation: Address;
435
+ data?: Hex;
436
+ value?: bigint;
437
+ } & WriteAccountOverride): Promise<Hex>;
438
+ /**
439
+ * The ERC-1822 storage slot this implementation expects a proxy to keep its
440
+ * implementation address in.
441
+ *
442
+ * Succeeds **only when called on the implementation contract directly**,
443
+ * answering `0x360894...bbc`, and **reverts** `UUPSUnauthorizedCallContext`
444
+ * through any proxy: OpenZeppelin guards it with `notDelegated`, which
445
+ * rejects every delegatecall context. That is what makes it a target
446
+ * implementation's proof of UUPS compliance, not a probe of a live instance.
447
+ *
448
+ * **Not a mode discriminator.** This client is always pointed at an
449
+ * instance, so this call reverts here for `clone` and `uups` alike. Use
450
+ * {@link deploymentMode} to tell them apart.
451
+ */
452
+ proxiableUUID(): Promise<Hex>;
453
+ /** OpenZeppelin's upgrade-interface version string, e.g. `"5.0.0"`. */
454
+ upgradeInterfaceVersion(): Promise<string>;
455
+ /**
456
+ * Which deployment shell this instance is: a minimal-proxy `clone`, or a
457
+ * `uups` ERC-1967 proxy that {@link upgradeToAndCall} can actually move.
458
+ *
459
+ * Read from the ERC-1967 implementation slot, which a UUPS proxy populates
460
+ * and a clone never has - a clone's implementation is baked into its runtime
461
+ * code. One `eth_getStorageAt`, no ABI involved.
462
+ *
463
+ * Neither obvious probe works in its place, which is why this exists:
464
+ * {@link proxiableUUID} carries OpenZeppelin's `notDelegated` guard and so
465
+ * reverts on both shells when called at an instance address, and
466
+ * {@link upgradeInterfaceVersion} reads `UPGRADE_INTERFACE_VERSION`, an
467
+ * implementation constant that answers `"5.0.0"` for both.
468
+ *
469
+ * @alpha
470
+ */
471
+ deploymentMode(): Promise<DeploymentMode>;
472
+ /**
473
+ * Read the instance's own remaining pool balance as a handle the **caller**
474
+ * can decrypt. Requires `DISCLOSURE_ADMIN_ROLE`.
475
+ *
476
+ * @returns `{ handle, hash }` — pass `handle` to the Zama relayer's `userDecrypt`.
477
+ * @throws {@link ReceiptEventNotFoundError} when the transaction granted no ACL to the caller.
478
+ */
479
+ adminGetCurrentBalance(args?: WriteAccountOverride): Promise<EncryptedViewResult>;
480
+ /**
481
+ * Disclose the instance's pool balance to `party`. Requires
482
+ * `DISCLOSURE_ADMIN_ROLE`.
483
+ *
484
+ * The ACL grant goes to `party`, **not** to the caller, so the returned
485
+ * handle is extracted from the grant naming `party` — and unless the caller
486
+ * is also `party`, the caller cannot decrypt what it just disclosed.
487
+ *
488
+ * @returns `{ handle, hash }` — the handle `party` may now decrypt.
489
+ */
490
+ adminDiscloseBalanceToParty(args: {
491
+ party: Address;
492
+ } & WriteAccountOverride): Promise<EncryptedViewResult>;
493
+ /**
494
+ * Disclose the instance's pool balance to several parties in one
495
+ * transaction. Requires `DISCLOSURE_ADMIN_ROLE`.
496
+ *
497
+ * The contract reads the balance once and fans the *same* handle out to
498
+ * every party, which is why one handle is returned for the whole batch. It
499
+ * is recovered from the grant naming the first party.
500
+ *
501
+ * The contract's own two argument checks, `EmptyBatch` and `InvalidParty`
502
+ * (a zero address anywhere in the list), are mirrored client-side and
503
+ * thrown before the transaction is sent. Both are decidable off-chain from
504
+ * the argument alone, and both are easy to hit from a UI that maps a form
505
+ * over rows; paying gas to be told so adds nothing. Nothing beyond those two
506
+ * is checked here: duplicates, for instance, are wasteful but legal
507
+ * on-chain, and the SDK does not invent rules the contract does not have.
508
+ *
509
+ * @returns `{ handle, hash }` — the single handle every party may now decrypt.
510
+ * @throws {@link InvalidArgumentError} on an empty list or a zero-address party.
511
+ */
512
+ adminBatchDiscloseBalanceToParties(args: {
513
+ parties: readonly Address[];
514
+ } & WriteAccountOverride): Promise<EncryptedViewResult>;
515
+ /**
516
+ * Grant `party` decrypt access to a handle you already hold.
517
+ *
518
+ * Two gates apply on-chain: the caller must itself be allowed on the handle
519
+ * (bypassed by `DISCLOSURE_ADMIN_ROLE`), and the *instance* must be allowed
520
+ * on it — so an arbitrary handle from another contract cannot be laundered
521
+ * through this campaign. A failure of the first surfaces as
522
+ * `FheHandleNotAllowedError`.
523
+ *
524
+ * @param args.handle An existing `euint64` handle — a public pointer, not a value.
525
+ * @returns The transaction hash. No new handle is produced.
526
+ */
527
+ discloseHandleToParty(args: {
528
+ handle: Hex;
529
+ party: Address;
530
+ } & WriteAccountOverride): Promise<Hex>;
531
+ /**
532
+ * Grant `party` decrypt access to several handles at once. Same two gates as
533
+ * {@link discloseHandleToParty}, applied per handle; the first failure
534
+ * reverts the batch and names the offending handle.
535
+ *
536
+ * @returns The transaction hash. No new handles are produced.
537
+ */
538
+ batchDiscloseHandlesToParty(args: {
539
+ handles: readonly Hex[];
540
+ party: Address;
541
+ } & WriteAccountOverride): Promise<Hex>;
542
+ /**
543
+ * Submit a transaction for a function that returns an encrypted handle via
544
+ * `FHE.allow`, and recover that handle from the receipt.
545
+ *
546
+ * Subclasses call this for their claim-preview entrypoints (`getClaimAmount`
547
+ * on both variants). Simulating instead would return a handle with no ACL
548
+ * behind it — see {@link extractGrantedHandle} for why.
549
+ *
550
+ * @param input.grantee The address the contract grants ACL to. Defaults to
551
+ * the sender, which is right for every `msg.sender` grant; disclosure
552
+ * entrypoints that grant a third party must pass it explicitly.
553
+ * @param input.method Label for telemetry and errors. Defaults to `functionName`.
554
+ * @returns `{ handle, hash }`.
555
+ */
556
+ protected encryptedView(input: {
557
+ functionName: string;
558
+ args?: readonly unknown[] | undefined;
559
+ grantee?: Address | undefined;
560
+ account?: Account | Address | undefined;
561
+ method?: string | undefined;
562
+ /** Wei to attach — for fee-charging entrypoints that also return a handle. */
563
+ value?: bigint | undefined;
564
+ }): Promise<EncryptedViewResult>;
565
+ /**
566
+ * Send a transaction against the instance, mapping any revert to a typed
567
+ * error. Preflighted first so the revert is decoded before the user pays.
568
+ */
569
+ protected write(functionName: string, args?: readonly unknown[], account?: Account | Address, method?: string, value?: bigint): Promise<Hex>;
570
+ protected read<T = unknown>(functionName: string, args?: readonly unknown[]): Promise<T>;
571
+ /**
572
+ * Simulate a write purely to surface typed reverts.
573
+ *
574
+ * The simulate's return value is discarded on principle: FHE handles
575
+ * produced during simulation diverge from the executed transaction's, so the
576
+ * only trustworthy source for a result is the receipt. What simulation is
577
+ * good for is letting viem decode a revert against the ABI first.
578
+ */
579
+ protected preflightWrite(method: string, functionName: string, args: readonly unknown[], account: Account | Address, value?: bigint): Promise<void>;
580
+ /**
581
+ * Map a viem error to the SDK's typed palette.
582
+ *
583
+ * `productContext` deliberately carries only public identifiers — the
584
+ * caller, the chain. Never an amount: the whole point of this module is that
585
+ * amounts are ciphertext, and an error object is one of the easiest places
586
+ * for a plaintext to escape into a log.
587
+ */
588
+ protected mapRevert(method: string, err: unknown, account: Account | Address): TokenOpsSdkError;
589
+ protected requireWallet(method: string): WalletClient;
590
+ protected resolveAccount(wallet: WalletClient, override: Account | Address | undefined, method: string): Account | Address;
591
+ /**
592
+ * The address that will actually send the transaction, as a plain `Address`.
593
+ *
594
+ * Needed by any method whose arguments must be validated against the sender before
595
+ * the write — on the Merkle variant the claim identity, the payout destination and
596
+ * the submitter are three separate addresses with rules between them.
597
+ */
598
+ protected resolveSender(override: Account | Address | undefined, method: string): Address;
599
+ }
600
+ /**
601
+ * Create an {@link AirdropBaseClient}. Mirrors viem's `create*` convention.
602
+ *
603
+ * @example
604
+ * const airdrop = createAirdropBaseClient({ publicClient, walletClient, address });
605
+ *
606
+ * @alpha
607
+ */
608
+ export declare function createAirdropBaseClient(config: AirdropBaseClientConfig): AirdropBaseClient;