@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.
- package/CHANGELOG.md +207 -0
- package/CONTRIBUTING.md +113 -0
- package/LICENSE +32 -0
- package/README.md +677 -0
- package/SECURITY.md +59 -0
- package/dist/chunk-52TC6BF7.js +2755 -0
- package/dist/chunk-56UI7LUR.cjs +516 -0
- package/dist/chunk-5SA2HF2W.cjs +1635 -0
- package/dist/chunk-5SGMJADP.cjs +139 -0
- package/dist/chunk-62DF53UQ.cjs +749 -0
- package/dist/chunk-66IHPTOK.cjs +20 -0
- package/dist/chunk-6ECAHP5O.cjs +1496 -0
- package/dist/chunk-72YGZEQE.js +742 -0
- package/dist/chunk-7VELUOMI.js +35 -0
- package/dist/chunk-BE2AIZ3K.js +23 -0
- package/dist/chunk-CMRETRZO.js +46 -0
- package/dist/chunk-COPFW5Z4.js +82 -0
- package/dist/chunk-CQIPRNS7.cjs +25 -0
- package/dist/chunk-ECT3NL2L.js +124 -0
- package/dist/chunk-FWHYQZ5E.cjs +37 -0
- package/dist/chunk-FYQ2UW4T.js +37 -0
- package/dist/chunk-HGXNRR25.js +105 -0
- package/dist/chunk-HTOMTEA3.cjs +3406 -0
- package/dist/chunk-ITQ7WKVC.cjs +101 -0
- package/dist/chunk-IVE3QEGD.js +478 -0
- package/dist/chunk-JFLEEXKP.js +325 -0
- package/dist/chunk-JFR5J4FL.cjs +128 -0
- package/dist/chunk-K6MFFDBJ.cjs +109 -0
- package/dist/chunk-KWFFIJYX.js +11 -0
- package/dist/chunk-NS44KBV5.cjs +89 -0
- package/dist/chunk-OLDGMKW2.cjs +93 -0
- package/dist/chunk-Q2GP5UDC.js +29 -0
- package/dist/chunk-Q7ARQSUH.cjs +42 -0
- package/dist/chunk-QCA7O2Q5.cjs +49 -0
- package/dist/chunk-QIHZVLIK.js +3388 -0
- package/dist/chunk-SUOG3BQS.cjs +2772 -0
- package/dist/chunk-T5LVV3KY.cjs +44 -0
- package/dist/chunk-UOG4PJL5.js +1488 -0
- package/dist/chunk-VDXVNZCO.cjs +329 -0
- package/dist/chunk-VJKZWYYJ.cjs +32 -0
- package/dist/chunk-WRCUDSUJ.js +96 -0
- package/dist/chunk-XSNLAS5M.js +135 -0
- package/dist/chunk-XXXDQSHE.js +1628 -0
- package/dist/chunk-ZHFLRKFY.js +41 -0
- package/dist/chunk-ZXCOJY2Z.js +87 -0
- package/dist/core/addresses.d.ts +59 -0
- package/dist/core/brands.d.ts +87 -0
- package/dist/core/chains.d.ts +102 -0
- package/dist/core/errors.d.ts +687 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/normalise.d.ts +27 -0
- package/dist/core/preflight.d.ts +25 -0
- package/dist/core/revert-mapper.d.ts +74 -0
- package/dist/core/telemetry.d.ts +50 -0
- package/dist/core/types.d.ts +10 -0
- package/dist/core/version.d.ts +15 -0
- package/dist/core/zama-error-mapper.d.ts +27 -0
- package/dist/fhe/acl.d.ts +73 -0
- package/dist/fhe/erc7984-abi.d.ts +53 -0
- package/dist/fhe/index.cjs +599 -0
- package/dist/fhe/index.d.cts +11 -0
- package/dist/fhe/index.d.ts +11 -0
- package/dist/fhe/index.js +394 -0
- package/dist/fhe/mock-encryptor.d.ts +90 -0
- package/dist/fhe/mock-erc7984.d.ts +134 -0
- package/dist/fhe/operators.d.ts +190 -0
- package/dist/fhe/react/index.cjs +102 -0
- package/dist/fhe/react/index.d.cts +10 -0
- package/dist/fhe/react/index.d.ts +10 -0
- package/dist/fhe/react/index.js +85 -0
- package/dist/fhe/react/use-decrypted-handle.d.ts +102 -0
- package/dist/fhe/scale-ratio.d.ts +168 -0
- package/dist/fhe/sepolia-encryptor-web.d.ts +101 -0
- package/dist/fhe/sepolia-encryptor.d.ts +132 -0
- package/dist/fhe/types.d.ts +62 -0
- package/dist/fhe-airdrop/abis/cloneable.d.ts +781 -0
- package/dist/fhe-airdrop/abis/factory.d.ts +714 -0
- package/dist/fhe-airdrop/abis/index.d.ts +2 -0
- package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +53 -0
- package/dist/fhe-airdrop/advanced/index.cjs +21 -0
- package/dist/fhe-airdrop/advanced/index.d.cts +13 -0
- package/dist/fhe-airdrop/advanced/index.d.ts +13 -0
- package/dist/fhe-airdrop/advanced/index.js +8 -0
- package/dist/fhe-airdrop/advanced/react/index.cjs +61 -0
- package/dist/fhe-airdrop/advanced/react/index.d.cts +5 -0
- package/dist/fhe-airdrop/advanced/react/index.d.ts +5 -0
- package/dist/fhe-airdrop/advanced/react/index.js +59 -0
- package/dist/fhe-airdrop/advanced/react/usePredictAirdropAddress.d.ts +49 -0
- package/dist/fhe-airdrop/airdrop.d.ts +308 -0
- package/dist/fhe-airdrop/encryption.d.ts +109 -0
- package/dist/fhe-airdrop/errors.d.ts +60 -0
- package/dist/fhe-airdrop/factory.d.ts +281 -0
- package/dist/fhe-airdrop/index.cjs +227 -0
- package/dist/fhe-airdrop/index.d.cts +10 -0
- package/dist/fhe-airdrop/index.d.ts +10 -0
- package/dist/fhe-airdrop/index.js +10 -0
- package/dist/fhe-airdrop/react/_shared.d.ts +107 -0
- package/dist/fhe-airdrop/react/index.cjs +638 -0
- package/dist/fhe-airdrop/react/index.d.cts +90 -0
- package/dist/fhe-airdrop/react/index.d.ts +90 -0
- package/dist/fhe-airdrop/react/index.js +430 -0
- package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +31 -0
- package/dist/fhe-airdrop/react/useAirdropCanExtendClaimWindow.d.ts +7 -0
- package/dist/fhe-airdrop/react/useAirdropClaim.d.ts +25 -0
- package/dist/fhe-airdrop/react/useAirdropClaimTypehash.d.ts +10 -0
- package/dist/fhe-airdrop/react/useAirdropClaimedSignatures.d.ts +16 -0
- package/dist/fhe-airdrop/react/useAirdropDeploymentBlockNumber.d.ts +6 -0
- package/dist/fhe-airdrop/react/useAirdropDomainSeparator.d.ts +8 -0
- package/dist/fhe-airdrop/react/useAirdropEndTime.d.ts +10 -0
- package/dist/fhe-airdrop/react/useAirdropFactoryCustomFee.d.ts +17 -0
- package/dist/fhe-airdrop/react/useAirdropFactoryDefaultGasFee.d.ts +10 -0
- package/dist/fhe-airdrop/react/useAirdropFactoryDisableCustomFee.d.ts +15 -0
- package/dist/fhe-airdrop/react/useAirdropFactoryFeeCollector.d.ts +11 -0
- package/dist/fhe-airdrop/react/useAirdropFactoryInitCodeHash.d.ts +17 -0
- package/dist/fhe-airdrop/react/useAirdropFactorySetCustomFee.d.ts +17 -0
- package/dist/fhe-airdrop/react/useAirdropFactorySetDefaultGasFee.d.ts +16 -0
- package/dist/fhe-airdrop/react/useAirdropFactorySetFeeCollector.d.ts +15 -0
- package/dist/fhe-airdrop/react/useAirdropGasFee.d.ts +11 -0
- package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +16 -0
- package/dist/fhe-airdrop/react/useAirdropHasClaimEnded.d.ts +7 -0
- package/dist/fhe-airdrop/react/useAirdropHasClaimStarted.d.ts +7 -0
- package/dist/fhe-airdrop/react/useAirdropHasRole.d.ts +14 -0
- package/dist/fhe-airdrop/react/useAirdropIsClaimWindowActive.d.ts +9 -0
- package/dist/fhe-airdrop/react/useAirdropIsPaused.d.ts +8 -0
- package/dist/fhe-airdrop/react/useAirdropIsSignatureClaimed.d.ts +22 -0
- package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +50 -0
- package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +15 -0
- package/dist/fhe-airdrop/react/useAirdropStartTime.d.ts +10 -0
- package/dist/fhe-airdrop/react/useAirdropToken.d.ts +11 -0
- package/dist/fhe-airdrop/react/useAirdropWithdrawGasFee.d.ts +15 -0
- package/dist/fhe-airdrop/react/useAirdropWithdrawOtherConfidentialToken.d.ts +14 -0
- package/dist/fhe-airdrop/react/useAirdropWithdrawOtherToken.d.ts +14 -0
- package/dist/fhe-airdrop/react/useClaim.d.ts +29 -0
- package/dist/fhe-airdrop/react/useConfidentialAirdropFactoryImplementation.d.ts +11 -0
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +33 -0
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +40 -0
- package/dist/fhe-airdrop/react/useCreateConfidentialAirdrop.d.ts +29 -0
- package/dist/fhe-airdrop/react/useCreateConfidentialAirdropAndGetAddress.d.ts +31 -0
- package/dist/fhe-airdrop/react/useDisableCustomFee.d.ts +14 -0
- package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +16 -0
- package/dist/fhe-airdrop/react/useFactoryCustomFee.d.ts +17 -0
- package/dist/fhe-airdrop/react/useFactoryDefaultGasFee.d.ts +10 -0
- package/dist/fhe-airdrop/react/useFactoryFeeCollector.d.ts +11 -0
- package/dist/fhe-airdrop/react/useFactoryInitCodeHash.d.ts +17 -0
- package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +25 -0
- package/dist/fhe-airdrop/react/useGetClaimAmount.d.ts +30 -0
- package/dist/fhe-airdrop/react/useSetCustomFee.d.ts +16 -0
- package/dist/fhe-airdrop/react/useSetDefaultGasFee.d.ts +15 -0
- package/dist/fhe-airdrop/react/useSetFeeCollector.d.ts +14 -0
- package/dist/fhe-airdrop/react/useSetPaused.d.ts +14 -0
- package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +31 -0
- package/dist/fhe-airdrop/react/useWithdraw.d.ts +12 -0
- package/dist/fhe-airdrop/react/useWithdrawOtherConfidentialToken.d.ts +13 -0
- package/dist/fhe-airdrop/react/useWithdrawOtherToken.d.ts +13 -0
- package/dist/fhe-airdrop/types.d.ts +21 -0
- package/dist/fhe-disperse/abis/index.d.ts +2 -0
- package/dist/fhe-disperse/abis/singleton.d.ts +1297 -0
- package/dist/fhe-disperse/abis/wallet.d.ts +111 -0
- package/dist/fhe-disperse/encryption.d.ts +77 -0
- package/dist/fhe-disperse/errors.d.ts +39 -0
- package/dist/fhe-disperse/index.cjs +248 -0
- package/dist/fhe-disperse/index.d.cts +14 -0
- package/dist/fhe-disperse/index.d.ts +14 -0
- package/dist/fhe-disperse/index.js +11 -0
- package/dist/fhe-disperse/react/_shared.d.ts +104 -0
- package/dist/fhe-disperse/react/index.cjs +752 -0
- package/dist/fhe-disperse/react/index.d.cts +82 -0
- package/dist/fhe-disperse/react/index.d.ts +82 -0
- package/dist/fhe-disperse/react/index.js +522 -0
- package/dist/fhe-disperse/react/useAccessEncryptedFeeReserve.d.ts +35 -0
- package/dist/fhe-disperse/react/useApproveTokenOnWallets.d.ts +25 -0
- package/dist/fhe-disperse/react/useBatchDiscloseHandlesToParty.d.ts +16 -0
- package/dist/fhe-disperse/react/useCalculateFee.d.ts +26 -0
- package/dist/fhe-disperse/react/useDeploymentBlockNumber.d.ts +11 -0
- package/dist/fhe-disperse/react/useDisableCustomFee.d.ts +20 -0
- package/dist/fhe-disperse/react/useDiscloseHandleToParty.d.ts +20 -0
- package/dist/fhe-disperse/react/useDisperse.d.ts +28 -0
- package/dist/fhe-disperse/react/useGetBatchLimits.d.ts +12 -0
- package/dist/fhe-disperse/react/useGetFeeConfig.d.ts +15 -0
- package/dist/fhe-disperse/react/useGetFees.d.ts +19 -0
- package/dist/fhe-disperse/react/useGetWallets.d.ts +19 -0
- package/dist/fhe-disperse/react/useGrantRole.d.ts +24 -0
- package/dist/fhe-disperse/react/useHasApprovedSubwallets.d.ts +25 -0
- package/dist/fhe-disperse/react/useHasRole.d.ts +22 -0
- package/dist/fhe-disperse/react/useIsPaused.d.ts +11 -0
- package/dist/fhe-disperse/react/useIsRegistered.d.ts +15 -0
- package/dist/fhe-disperse/react/usePause.d.ts +18 -0
- package/dist/fhe-disperse/react/usePredictWallets.d.ts +19 -0
- package/dist/fhe-disperse/react/usePreflightDisperse.d.ts +37 -0
- package/dist/fhe-disperse/react/useRecoverERC20FromWallets.d.ts +21 -0
- package/dist/fhe-disperse/react/useRecoverFromWallets.d.ts +21 -0
- package/dist/fhe-disperse/react/useRegister.d.ts +40 -0
- package/dist/fhe-disperse/react/useRescueConfidentialTokens.d.ts +21 -0
- package/dist/fhe-disperse/react/useRescueERC20.d.ts +21 -0
- package/dist/fhe-disperse/react/useRevokeRole.d.ts +24 -0
- package/dist/fhe-disperse/react/useRevokeTokenOnWallets.d.ts +24 -0
- package/dist/fhe-disperse/react/useSetCustomFee.d.ts +24 -0
- package/dist/fhe-disperse/react/useSetFeeConfig.d.ts +23 -0
- package/dist/fhe-disperse/react/useSetMaxBatchSizeDirect.d.ts +20 -0
- package/dist/fhe-disperse/react/useSetMaxBatchSizeHolding.d.ts +20 -0
- package/dist/fhe-disperse/react/useSetMaxBatchSizeTokenFee.d.ts +20 -0
- package/dist/fhe-disperse/react/useSingletonBatchDiscloseHandlesToParty.d.ts +13 -0
- package/dist/fhe-disperse/react/useSingletonBatchLimits.d.ts +12 -0
- package/dist/fhe-disperse/react/useSingletonCalculateFee.d.ts +26 -0
- package/dist/fhe-disperse/react/useSingletonDeploymentBlockNumber.d.ts +11 -0
- package/dist/fhe-disperse/react/useSingletonDisableCustomFee.d.ts +21 -0
- package/dist/fhe-disperse/react/useSingletonDiscloseHandleToParty.d.ts +17 -0
- package/dist/fhe-disperse/react/useSingletonFees.d.ts +19 -0
- package/dist/fhe-disperse/react/useSingletonGrantRole.d.ts +26 -0
- package/dist/fhe-disperse/react/useSingletonHasApprovedSubwallets.d.ts +25 -0
- package/dist/fhe-disperse/react/useSingletonHasRole.d.ts +23 -0
- package/dist/fhe-disperse/react/useSingletonIsPaused.d.ts +11 -0
- package/dist/fhe-disperse/react/useSingletonIsRegistered.d.ts +15 -0
- package/dist/fhe-disperse/react/useSingletonPause.d.ts +19 -0
- package/dist/fhe-disperse/react/useSingletonPredictWallets.d.ts +19 -0
- package/dist/fhe-disperse/react/useSingletonRevokeRole.d.ts +26 -0
- package/dist/fhe-disperse/react/useSingletonSetCustomFee.d.ts +25 -0
- package/dist/fhe-disperse/react/useSingletonUnpause.d.ts +18 -0
- package/dist/fhe-disperse/react/useSingletonWalletImplementation.d.ts +12 -0
- package/dist/fhe-disperse/react/useSingletonWallets.d.ts +19 -0
- package/dist/fhe-disperse/react/useSingletonWithdrawGasFee.d.ts +21 -0
- package/dist/fhe-disperse/react/useSingletonWithdrawTokenFee.d.ts +50 -0
- package/dist/fhe-disperse/react/useUnpause.d.ts +17 -0
- package/dist/fhe-disperse/react/useWalletImplementation.d.ts +12 -0
- package/dist/fhe-disperse/react/useWithdrawGasFee.d.ts +26 -0
- package/dist/fhe-disperse/react/useWithdrawTokenFee.d.ts +70 -0
- package/dist/fhe-disperse/singleton.d.ts +442 -0
- package/dist/fhe-disperse/subtotals.d.ts +14 -0
- package/dist/fhe-disperse/types.d.ts +332 -0
- package/dist/fhe-disperse/validate.d.ts +78 -0
- package/dist/fhe-vesting/abis/factory.d.ts +676 -0
- package/dist/fhe-vesting/abis/index.d.ts +3 -0
- package/dist/fhe-vesting/abis/manager.d.ts +1797 -0
- package/dist/fhe-vesting/advanced/factory-advanced.d.ts +52 -0
- package/dist/fhe-vesting/advanced/index.cjs +21 -0
- package/dist/fhe-vesting/advanced/index.d.cts +12 -0
- package/dist/fhe-vesting/advanced/index.d.ts +12 -0
- package/dist/fhe-vesting/advanced/index.js +8 -0
- package/dist/fhe-vesting/advanced/react/index.cjs +75 -0
- package/dist/fhe-vesting/advanced/react/index.d.cts +5 -0
- package/dist/fhe-vesting/advanced/react/index.d.ts +5 -0
- package/dist/fhe-vesting/advanced/react/index.js +73 -0
- package/dist/fhe-vesting/advanced/react/usePredictManagerAddress.d.ts +41 -0
- package/dist/fhe-vesting/encryption.d.ts +104 -0
- package/dist/fhe-vesting/errors.d.ts +183 -0
- package/dist/fhe-vesting/factory.d.ts +207 -0
- package/dist/fhe-vesting/index.cjs +269 -0
- package/dist/fhe-vesting/index.d.cts +9 -0
- package/dist/fhe-vesting/index.d.ts +9 -0
- package/dist/fhe-vesting/index.js +12 -0
- package/dist/fhe-vesting/manager.d.ts +808 -0
- package/dist/fhe-vesting/react/_shared.d.ts +122 -0
- package/dist/fhe-vesting/react/index.cjs +1054 -0
- package/dist/fhe-vesting/react/index.d.cts +123 -0
- package/dist/fhe-vesting/react/index.d.ts +123 -0
- package/dist/fhe-vesting/react/index.js +771 -0
- package/dist/fhe-vesting/react/useAcceptVestingTransfer.d.ts +12 -0
- package/dist/fhe-vesting/react/useAccessClaimableAmount.d.ts +14 -0
- package/dist/fhe-vesting/react/useAccessSettledAmount.d.ts +15 -0
- package/dist/fhe-vesting/react/useAccessTotalAllocation.d.ts +14 -0
- package/dist/fhe-vesting/react/useAccessVestedAmount.d.ts +26 -0
- package/dist/fhe-vesting/react/useAdminBatchDiscloseToParty.d.ts +16 -0
- package/dist/fhe-vesting/react/useAdminClaim.d.ts +9 -0
- package/dist/fhe-vesting/react/useAdminDiscloseToParty.d.ts +8 -0
- package/dist/fhe-vesting/react/useAdminGetClaimableAmount.d.ts +13 -0
- package/dist/fhe-vesting/react/useAdminGetSettledAmount.d.ts +13 -0
- package/dist/fhe-vesting/react/useAdminGetTokenBalance.d.ts +13 -0
- package/dist/fhe-vesting/react/useAdminGetTotalAllocation.d.ts +13 -0
- package/dist/fhe-vesting/react/useAdminGetVestedAmount.d.ts +15 -0
- package/dist/fhe-vesting/react/useAdminPartialClaim.d.ts +8 -0
- package/dist/fhe-vesting/react/useAllRecipients.d.ts +8 -0
- package/dist/fhe-vesting/react/useAllRecipientsLength.d.ts +6 -0
- package/dist/fhe-vesting/react/useAllRecipientsSliced.d.ts +13 -0
- package/dist/fhe-vesting/react/useBatchCreateVesting.d.ts +24 -0
- package/dist/fhe-vesting/react/useBatchDiscloseHandlesToParty.d.ts +13 -0
- package/dist/fhe-vesting/react/useBatchDiscloseToParty.d.ts +18 -0
- package/dist/fhe-vesting/react/useBatchRevokeVesting.d.ts +12 -0
- package/dist/fhe-vesting/react/useCancelVestingTransfer.d.ts +12 -0
- package/dist/fhe-vesting/react/useClaim.d.ts +19 -0
- package/dist/fhe-vesting/react/useConfidentialVestingFactoryImplementation.d.ts +11 -0
- package/dist/fhe-vesting/react/useCreateManager.d.ts +32 -0
- package/dist/fhe-vesting/react/useCreateManagerAndGetAddress.d.ts +31 -0
- package/dist/fhe-vesting/react/useCreateVesting.d.ts +38 -0
- package/dist/fhe-vesting/react/useDirectVestingTransfer.d.ts +13 -0
- package/dist/fhe-vesting/react/useDisableCustomFee.d.ts +14 -0
- package/dist/fhe-vesting/react/useDiscloseHandleToParty.d.ts +14 -0
- package/dist/fhe-vesting/react/useDiscloseToParty.d.ts +14 -0
- package/dist/fhe-vesting/react/useFactoryCustomFee.d.ts +17 -0
- package/dist/fhe-vesting/react/useFactoryDefaultFeeType.d.ts +11 -0
- package/dist/fhe-vesting/react/useFactoryDefaultGasFee.d.ts +10 -0
- package/dist/fhe-vesting/react/useFactoryDefaultTokenFee.d.ts +10 -0
- package/dist/fhe-vesting/react/useFactoryFeeCollector.d.ts +10 -0
- package/dist/fhe-vesting/react/useFactoryInitCodeHash.d.ts +18 -0
- package/dist/fhe-vesting/react/useGetClaimableAmount.d.ts +13 -0
- package/dist/fhe-vesting/react/useGetSettledAmount.d.ts +14 -0
- package/dist/fhe-vesting/react/useGetTotalAllocation.d.ts +13 -0
- package/dist/fhe-vesting/react/useGetVestedAmount.d.ts +25 -0
- package/dist/fhe-vesting/react/useGrantRole.d.ts +15 -0
- package/dist/fhe-vesting/react/useHasRole.d.ts +14 -0
- package/dist/fhe-vesting/react/useInitiateVestingTransfer.d.ts +12 -0
- package/dist/fhe-vesting/react/useIsRecipient.d.ts +10 -0
- package/dist/fhe-vesting/react/useManagerBatchDiscloseHandlesToParty.d.ts +15 -0
- package/dist/fhe-vesting/react/useManagerDeploymentBlockNumber.d.ts +7 -0
- package/dist/fhe-vesting/react/useManagerDiscloseHandleToParty.d.ts +16 -0
- package/dist/fhe-vesting/react/useManagerFactoryCustomFee.d.ts +17 -0
- package/dist/fhe-vesting/react/useManagerFactoryDefaultGasFee.d.ts +10 -0
- package/dist/fhe-vesting/react/useManagerFactoryDisableCustomFee.d.ts +15 -0
- package/dist/fhe-vesting/react/useManagerFactoryFeeCollector.d.ts +10 -0
- package/dist/fhe-vesting/react/useManagerFactoryInitCodeHash.d.ts +18 -0
- package/dist/fhe-vesting/react/useManagerFactorySetCustomFee.d.ts +19 -0
- package/dist/fhe-vesting/react/useManagerFactorySetDefaultGasFee.d.ts +13 -0
- package/dist/fhe-vesting/react/useManagerFactorySetFeeCollector.d.ts +14 -0
- package/dist/fhe-vesting/react/useManagerFee.d.ts +7 -0
- package/dist/fhe-vesting/react/useManagerFeeInfo.d.ts +18 -0
- package/dist/fhe-vesting/react/useManagerFeeType.d.ts +7 -0
- package/dist/fhe-vesting/react/useManagerGrantRole.d.ts +17 -0
- package/dist/fhe-vesting/react/useManagerHasRole.d.ts +15 -0
- package/dist/fhe-vesting/react/useManagerIsPausable.d.ts +6 -0
- package/dist/fhe-vesting/react/useManagerIsSplitEnabled.d.ts +6 -0
- package/dist/fhe-vesting/react/useManagerMaxBatchSize.d.ts +6 -0
- package/dist/fhe-vesting/react/useManagerMaxRevokeBatchSize.d.ts +6 -0
- package/dist/fhe-vesting/react/useManagerPause.d.ts +13 -0
- package/dist/fhe-vesting/react/useManagerPaused.d.ts +6 -0
- package/dist/fhe-vesting/react/useManagerRevokeRole.d.ts +17 -0
- package/dist/fhe-vesting/react/useManagerToken.d.ts +11 -0
- package/dist/fhe-vesting/react/useManagerUnpause.d.ts +12 -0
- package/dist/fhe-vesting/react/useManagerWithdrawGasFee.d.ts +14 -0
- package/dist/fhe-vesting/react/useManagerWithdrawOtherConfidentialToken.d.ts +14 -0
- package/dist/fhe-vesting/react/useManagerWithdrawOtherToken.d.ts +14 -0
- package/dist/fhe-vesting/react/useManagerWithdrawTokenFee.d.ts +11 -0
- package/dist/fhe-vesting/react/usePartialClaim.d.ts +15 -0
- package/dist/fhe-vesting/react/usePause.d.ts +12 -0
- package/dist/fhe-vesting/react/usePendingVestingTransfer.d.ts +20 -0
- package/dist/fhe-vesting/react/useRecipientVestings.d.ts +11 -0
- package/dist/fhe-vesting/react/useRecipientVestingsLength.d.ts +10 -0
- package/dist/fhe-vesting/react/useRecipientVestingsSliced.d.ts +12 -0
- package/dist/fhe-vesting/react/useRenounceRole.d.ts +16 -0
- package/dist/fhe-vesting/react/useResetGasFee.d.ts +10 -0
- package/dist/fhe-vesting/react/useResetTokenFee.d.ts +10 -0
- package/dist/fhe-vesting/react/useRevokeRole.d.ts +15 -0
- package/dist/fhe-vesting/react/useRevokeVesting.d.ts +15 -0
- package/dist/fhe-vesting/react/useRoleConstants.d.ts +19 -0
- package/dist/fhe-vesting/react/useSetCustomFee.d.ts +18 -0
- package/dist/fhe-vesting/react/useSetDefaultFeeType.d.ts +14 -0
- package/dist/fhe-vesting/react/useSetDefaultGasFee.d.ts +12 -0
- package/dist/fhe-vesting/react/useSetDefaultTokenFee.d.ts +13 -0
- package/dist/fhe-vesting/react/useSetFeeCollector.d.ts +13 -0
- package/dist/fhe-vesting/react/useSetMaxBatchSize.d.ts +12 -0
- package/dist/fhe-vesting/react/useSetMaxRevokeBatchSize.d.ts +12 -0
- package/dist/fhe-vesting/react/useSplitVesting.d.ts +28 -0
- package/dist/fhe-vesting/react/useTransferFeeCollectorRole.d.ts +12 -0
- package/dist/fhe-vesting/react/useUnpause.d.ts +11 -0
- package/dist/fhe-vesting/react/useVestingClaim.d.ts +19 -0
- package/dist/fhe-vesting/react/useVestingInfo.d.ts +25 -0
- package/dist/fhe-vesting/react/useWithdrawAdmin.d.ts +17 -0
- package/dist/fhe-vesting/react/useWithdrawGasFee.d.ts +13 -0
- package/dist/fhe-vesting/react/useWithdrawOtherConfidentialToken.d.ts +13 -0
- package/dist/fhe-vesting/react/useWithdrawOtherToken.d.ts +13 -0
- package/dist/fhe-vesting/react/useWithdrawTokenFee.d.ts +18 -0
- package/dist/fhe-vesting/types.d.ts +72 -0
- package/dist/index.cjs +237 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +14 -0
- package/dist/telemetry/console.d.ts +29 -0
- package/dist/telemetry/index.cjs +113 -0
- package/dist/telemetry/index.d.cts +3 -0
- package/dist/telemetry/index.d.ts +3 -0
- package/dist/telemetry/index.js +102 -0
- package/dist/telemetry/tokenops.d.ts +15 -0
- package/package.json +316 -0
|
@@ -0,0 +1,808 @@
|
|
|
1
|
+
import type { Account, Address, Hex, PublicClient, WalletClient } from "viem";
|
|
2
|
+
import { type PreflightResult } from "../core/preflight.js";
|
|
3
|
+
import { type EncryptedHandle, type Role, type TxHash, type VestingId } from "../core/brands.js";
|
|
4
|
+
import { type SdkTelemetry } from "../core/telemetry.js";
|
|
5
|
+
import { type Encryptor, type EncryptorSource } from "./encryption.js";
|
|
6
|
+
import { FeeType, type DisclosureType, type EncryptedInput, type EncryptedViewResult, type PendingTransfer, type VestingInfo, type VestingParams } from "./types.js";
|
|
7
|
+
export type { EncryptedViewResult } from "./types.js";
|
|
8
|
+
export interface ConfidentialVestingManagerClientConfig {
|
|
9
|
+
publicClient: PublicClient;
|
|
10
|
+
walletClient?: WalletClient | undefined;
|
|
11
|
+
/** Manager clone address (per-user; use the factory's `predictManagerAddress` or `ManagerCreated` event). */
|
|
12
|
+
address: Address;
|
|
13
|
+
/**
|
|
14
|
+
* Default encryptor used by methods that take plaintext inputs. Optional at
|
|
15
|
+
* construction time, but **REQUIRED at call time** for any method that submits
|
|
16
|
+
* encrypted inputs: `createVesting`, `batchCreateVesting`, `partialClaim`,
|
|
17
|
+
* `splitVesting`, `withdrawAdmin`, `withdrawTokenFee`. These methods throw if
|
|
18
|
+
* no encryptor is resolvable when they run — TypeScript cannot catch this at
|
|
19
|
+
* construction time.
|
|
20
|
+
*
|
|
21
|
+
* Pass an eager {@link Encryptor} instance (server, vitest) or a
|
|
22
|
+
* `() => Encryptor | undefined` factory (React contexts, Vue refs, signals)
|
|
23
|
+
* whose result is resolved per-encryption so the live instance is always picked up.
|
|
24
|
+
*/
|
|
25
|
+
encryptor?: EncryptorSource;
|
|
26
|
+
/**
|
|
27
|
+
* FHEVM ACL contract address override. When omitted, resolved from
|
|
28
|
+
* `publicClient.chain?.id` via the SDK's chain registry; the constructor
|
|
29
|
+
* throws `DeploymentAddressUnavailableError` if neither is available.
|
|
30
|
+
* Required because `#encryptedView` filters the receipt for ACL grants
|
|
31
|
+
* to extract the returned handle.
|
|
32
|
+
*/
|
|
33
|
+
aclAddress?: Address;
|
|
34
|
+
/**
|
|
35
|
+
* Optional telemetry sink. When provided, the SDK brackets public write
|
|
36
|
+
* methods with named spans (`fhe-vesting.manager.pause`, etc.). Defaults to
|
|
37
|
+
* a no-op — zero overhead, zero leakage of consumer-side identifiers.
|
|
38
|
+
*
|
|
39
|
+
* Structurally compatible with `NoopTelemetry` / `ConsoleTelemetry` /
|
|
40
|
+
* `TokenOpsTelemetry` exported from `@tokenops/sdk/telemetry`.
|
|
41
|
+
*/
|
|
42
|
+
telemetry?: SdkTelemetry | undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Common fields for {@link CreateVestingArgs}. The encryption path is
|
|
46
|
+
* discriminated below — pass `encryptor` (SDK encrypts `amount`) XOR
|
|
47
|
+
* `encryptedInput` (caller pre-encrypted). Passing both is a compile error.
|
|
48
|
+
*/
|
|
49
|
+
interface CreateVestingArgsCommon {
|
|
50
|
+
params: VestingParams;
|
|
51
|
+
/**
|
|
52
|
+
* Plaintext token amount. The SDK encrypts it via `encryptor`.
|
|
53
|
+
*
|
|
54
|
+
* Supply **exactly one** of `amount` or `encryptedInput`. Passing both throws
|
|
55
|
+
* `InvalidArgumentError` — the SDK refuses to silently pick a side, which
|
|
56
|
+
* would let the plaintext metadata diverge from the on-chain ciphertext.
|
|
57
|
+
*/
|
|
58
|
+
amount?: bigint;
|
|
59
|
+
/** Override the per-client `encryptor`. */
|
|
60
|
+
encryptor?: Encryptor;
|
|
61
|
+
/**
|
|
62
|
+
* Pre-encrypted input — bypasses `encryptor`. Use when callers manage their
|
|
63
|
+
* own encryption (e.g. server-side issuance). Mutually exclusive with `amount`.
|
|
64
|
+
*/
|
|
65
|
+
encryptedInput?: EncryptedInput;
|
|
66
|
+
account?: Account | Address;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Discriminated union: provide EITHER an encryptor (the SDK encrypts the
|
|
70
|
+
* plaintext `amount`) OR a pre-built `encryptedInput`. Passing both is a TS
|
|
71
|
+
* error — the JSDoc previously documented this as a runtime contract; now
|
|
72
|
+
* it's enforced by the compiler.
|
|
73
|
+
*/
|
|
74
|
+
export type CreateVestingArgs = (CreateVestingArgsCommon & {
|
|
75
|
+
/** Plaintext token amount. The SDK encrypts it via `encryptor`. */
|
|
76
|
+
amount: bigint;
|
|
77
|
+
/** Override the per-client `encryptor`. */
|
|
78
|
+
encryptor?: Encryptor | undefined;
|
|
79
|
+
encryptedInput?: never;
|
|
80
|
+
}) | (CreateVestingArgsCommon & {
|
|
81
|
+
/** Pre-encrypted input — bypasses `encryptor`. Use when callers manage their own encryption. */
|
|
82
|
+
encryptedInput: EncryptedInput;
|
|
83
|
+
amount?: never;
|
|
84
|
+
encryptor?: never;
|
|
85
|
+
});
|
|
86
|
+
export interface BatchCreateVestingArgs {
|
|
87
|
+
items: Array<{
|
|
88
|
+
params: VestingParams;
|
|
89
|
+
amount: bigint;
|
|
90
|
+
}>;
|
|
91
|
+
encryptor?: Encryptor | undefined;
|
|
92
|
+
account?: Account | Address | undefined;
|
|
93
|
+
}
|
|
94
|
+
/** Common fields for {@link ClaimArgs}. */
|
|
95
|
+
interface ClaimArgsCommon {
|
|
96
|
+
/** bytes32 vesting schedule ID emitted in the `VestingCreated` event. */
|
|
97
|
+
vestingId: VestingId;
|
|
98
|
+
account?: Account | Address | undefined;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Arguments for {@link ConfidentialVestingManagerClient.claim} and
|
|
102
|
+
* {@link ConfidentialVestingManagerClient.adminClaim}, discriminated by
|
|
103
|
+
* `feeType` (read via `getFeeInfo()`).
|
|
104
|
+
*
|
|
105
|
+
* For `FeeType.Gas`, pass `value` (gas fee in wei).
|
|
106
|
+
* For `FeeType.DistributionToken`, omit `value` (token fee deducted on-chain).
|
|
107
|
+
*/
|
|
108
|
+
export type ClaimArgs = (ClaimArgsCommon & {
|
|
109
|
+
feeType: FeeType.Gas;
|
|
110
|
+
value: bigint;
|
|
111
|
+
}) | (ClaimArgsCommon & {
|
|
112
|
+
feeType: FeeType.DistributionToken;
|
|
113
|
+
value?: never;
|
|
114
|
+
});
|
|
115
|
+
interface PartialClaimArgsCommon {
|
|
116
|
+
vestingId: Hex;
|
|
117
|
+
value?: bigint;
|
|
118
|
+
account?: Account | Address;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Discriminated union: provide EITHER an encryptor (the SDK encrypts `amount`)
|
|
122
|
+
* OR a pre-built `encryptedInput`. Passing both is a compile error.
|
|
123
|
+
*/
|
|
124
|
+
export type PartialClaimArgs = (PartialClaimArgsCommon & {
|
|
125
|
+
amount: bigint;
|
|
126
|
+
encryptor?: Encryptor | undefined;
|
|
127
|
+
encryptedInput?: never;
|
|
128
|
+
}) | (PartialClaimArgsCommon & {
|
|
129
|
+
encryptedInput: EncryptedInput;
|
|
130
|
+
amount?: never;
|
|
131
|
+
encryptor?: never;
|
|
132
|
+
});
|
|
133
|
+
/** Common fields for {@link WithdrawAdminArgs} — discriminated below. */
|
|
134
|
+
interface WithdrawAdminArgsCommon {
|
|
135
|
+
account?: Account | Address | undefined;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Discriminated union: provide EITHER an encryptor (the SDK encrypts `amount`)
|
|
139
|
+
* OR a pre-built `encryptedInput`. Passing both is a compile error.
|
|
140
|
+
*/
|
|
141
|
+
export type WithdrawAdminArgs = (WithdrawAdminArgsCommon & {
|
|
142
|
+
amount: bigint;
|
|
143
|
+
encryptor?: Encryptor | undefined;
|
|
144
|
+
encryptedInput?: never;
|
|
145
|
+
}) | (WithdrawAdminArgsCommon & {
|
|
146
|
+
encryptedInput: EncryptedInput;
|
|
147
|
+
amount?: never;
|
|
148
|
+
encryptor?: never;
|
|
149
|
+
});
|
|
150
|
+
/** Common fields for {@link WithdrawTokenFeeArgs} — discriminated below. */
|
|
151
|
+
interface WithdrawTokenFeeArgsCommon {
|
|
152
|
+
to: Address;
|
|
153
|
+
account?: Account | Address | undefined;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Discriminated union: provide EITHER an encryptor (the SDK encrypts `amount`)
|
|
157
|
+
* OR a pre-built `encryptedInput`. Passing both is a compile error.
|
|
158
|
+
*/
|
|
159
|
+
export type WithdrawTokenFeeArgs = (WithdrawTokenFeeArgsCommon & {
|
|
160
|
+
amount: bigint;
|
|
161
|
+
encryptor?: Encryptor | undefined;
|
|
162
|
+
encryptedInput?: never;
|
|
163
|
+
}) | (WithdrawTokenFeeArgsCommon & {
|
|
164
|
+
encryptedInput: EncryptedInput;
|
|
165
|
+
amount?: never;
|
|
166
|
+
encryptor?: never;
|
|
167
|
+
});
|
|
168
|
+
export interface SplitVestingArgs {
|
|
169
|
+
/** bytes32 vesting schedule ID emitted in the `VestingCreated` event. */
|
|
170
|
+
vestingId: VestingId;
|
|
171
|
+
/**
|
|
172
|
+
* Plaintext share numerator (kept confidential on-chain — SDK encrypts it).
|
|
173
|
+
*
|
|
174
|
+
* Note: after auto-scaling, large numerators (close to `uint64` max after
|
|
175
|
+
* multiplication by the scale factor) will cause `assertUint64` to throw.
|
|
176
|
+
* Call `scaleRatio({ numerator, denominator })` manually first to preview
|
|
177
|
+
* the scaled values, then pass `preScaled: true` to skip double-scaling.
|
|
178
|
+
*/
|
|
179
|
+
numerator: bigint;
|
|
180
|
+
/**
|
|
181
|
+
* Plaintext denominator. Auto-scaled to the universal privacy-preserving
|
|
182
|
+
* constant `FHE_SPLIT_DENOMINATOR` (`90_090_000` = LCM(1..16, 10_000)),
|
|
183
|
+
* which is well above the contract's `MIN_SPLIT_DENOMINATOR` (10_000) floor.
|
|
184
|
+
* Use the {@link share} builder (`share.fraction` / `share.basisPoints`)
|
|
185
|
+
* for exact-integer ratios without manual scaling.
|
|
186
|
+
*/
|
|
187
|
+
denominator: bigint;
|
|
188
|
+
newRecipient: Address;
|
|
189
|
+
encryptor?: Encryptor | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* Set to `true` if you have already called `scaleRatio` on the
|
|
192
|
+
* `numerator`/`denominator` pair. By default the SDK calls `scaleRatio`
|
|
193
|
+
* automatically; pass `preScaled: true` to skip it and use your values as-is.
|
|
194
|
+
*/
|
|
195
|
+
preScaled?: boolean | undefined;
|
|
196
|
+
account?: Account | Address | undefined;
|
|
197
|
+
}
|
|
198
|
+
export interface InitiateTransferArgs {
|
|
199
|
+
vestingId: VestingId;
|
|
200
|
+
newRecipient: Address;
|
|
201
|
+
transferDurationSeconds: number;
|
|
202
|
+
account?: Account | Address | undefined;
|
|
203
|
+
}
|
|
204
|
+
export interface DiscloseArgs {
|
|
205
|
+
vestingId: VestingId;
|
|
206
|
+
party: Address;
|
|
207
|
+
disclosureType: DisclosureType;
|
|
208
|
+
account?: Account | Address | undefined;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Result of {@link ConfidentialVestingManagerClient.splitVesting}.
|
|
212
|
+
*
|
|
213
|
+
* The `newVestingId` is parsed from the `VestingSplit` event filtered by the
|
|
214
|
+
* `(originalVestingId, newRecipient)` indexed args — both supplied at call
|
|
215
|
+
* time, so the filter is exact.
|
|
216
|
+
*/
|
|
217
|
+
export interface SplitVestingResult {
|
|
218
|
+
hash: Hex;
|
|
219
|
+
newVestingId: Hex;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Result of {@link ConfidentialVestingManagerClient.discloseToParty} /
|
|
223
|
+
* {@link ConfidentialVestingManagerClient.adminDiscloseToParty}.
|
|
224
|
+
*
|
|
225
|
+
* The `handle` is the `euint128` ciphertext parsed from the `AmountDisclosed`
|
|
226
|
+
* event — `(vestingId, discloser=msg.sender, party)` are indexed and the
|
|
227
|
+
* filter pins all three.
|
|
228
|
+
*/
|
|
229
|
+
export interface DiscloseToPartyResult {
|
|
230
|
+
hash: Hex;
|
|
231
|
+
handle: Hex;
|
|
232
|
+
}
|
|
233
|
+
/** Result of {@link ConfidentialVestingManagerClient.batchDiscloseToParty} /
|
|
234
|
+
* {@link ConfidentialVestingManagerClient.adminBatchDiscloseToParty}.
|
|
235
|
+
*
|
|
236
|
+
* `handles[i]` corresponds to `vestingIds[i]` from the input. Each handle
|
|
237
|
+
* comes from the `AmountDisclosed` event keyed on that vestingId.
|
|
238
|
+
*/
|
|
239
|
+
export interface BatchDiscloseToPartyResult {
|
|
240
|
+
hash: Hex;
|
|
241
|
+
handles: readonly Hex[];
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Typed wrapper around a deployed `ConfidentialVestingManager` clone. The
|
|
245
|
+
* underlying contract delegates calls to its extension via `fallback()`; we
|
|
246
|
+
* merge both ABIs so the consumer sees one logical surface.
|
|
247
|
+
*
|
|
248
|
+
* Pass `encryptor` to enable methods that take plaintext `amount` inputs. The SDK
|
|
249
|
+
* encrypts them internally — callers never handle raw ciphertext.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* const manager = createConfidentialVestingManagerClient({
|
|
253
|
+
* publicClient, walletClient,
|
|
254
|
+
* address: managerAddress,
|
|
255
|
+
* encryptor, // RelayerNode / RelayerWeb / MockFhevmInstance
|
|
256
|
+
* });
|
|
257
|
+
*/
|
|
258
|
+
export declare class ConfidentialVestingManagerClient {
|
|
259
|
+
#private;
|
|
260
|
+
readonly publicClient: PublicClient;
|
|
261
|
+
readonly walletClient?: WalletClient;
|
|
262
|
+
readonly address: Address;
|
|
263
|
+
readonly encryptor?: EncryptorSource;
|
|
264
|
+
constructor(config: ConfidentialVestingManagerClientConfig);
|
|
265
|
+
/**
|
|
266
|
+
* The FHEVM ACL contract address used by encrypted-view methods to parse
|
|
267
|
+
* `ACL.Allowed` events. Resolved lazily on first access; throws
|
|
268
|
+
* `DeploymentAddressUnavailableError` if no override was passed and the
|
|
269
|
+
* SDK does not have an ACL deployed for the connected chain.
|
|
270
|
+
*/
|
|
271
|
+
get aclAddress(): Address;
|
|
272
|
+
/**
|
|
273
|
+
* Return the ERC-7984 token address this manager clone is bound to.
|
|
274
|
+
* @returns Checksummed token address.
|
|
275
|
+
*/
|
|
276
|
+
token(): Promise<Address>;
|
|
277
|
+
/**
|
|
278
|
+
* Return the fee model baked into this clone's immutable args.
|
|
279
|
+
* @returns `FeeType.Gas` (0) or `FeeType.DistributionToken` (1).
|
|
280
|
+
*/
|
|
281
|
+
feeType(): Promise<FeeType>;
|
|
282
|
+
/**
|
|
283
|
+
* Return the raw fee value baked into this clone's immutable args.
|
|
284
|
+
* Interpretation depends on `feeType`: wei for `Gas`, basis points for `DistributionToken`.
|
|
285
|
+
* @returns Fee amount in the unit appropriate for `feeType`.
|
|
286
|
+
*/
|
|
287
|
+
fee(): Promise<bigint>;
|
|
288
|
+
/**
|
|
289
|
+
* Read the manager's fee configuration in one call.
|
|
290
|
+
*
|
|
291
|
+
* Both fields are immutable (baked into the clone's bytecode at deploy time), so
|
|
292
|
+
* consumers should memoize the result for the manager's lifetime.
|
|
293
|
+
*
|
|
294
|
+
* @returns `{ feeType, fee }` — feed both into the discriminated
|
|
295
|
+
* {@link ClaimArgs} union to construct the correct claim shape.
|
|
296
|
+
* @example
|
|
297
|
+
* const { feeType, fee } = await manager.getFeeInfo();
|
|
298
|
+
* await manager.claim(
|
|
299
|
+
* feeType === FeeType.Gas
|
|
300
|
+
* ? { feeType, vestingId, value: fee }
|
|
301
|
+
* : { feeType, vestingId },
|
|
302
|
+
* );
|
|
303
|
+
*/
|
|
304
|
+
getFeeInfo(): Promise<{
|
|
305
|
+
feeType: FeeType;
|
|
306
|
+
fee: bigint;
|
|
307
|
+
}>;
|
|
308
|
+
/**
|
|
309
|
+
* Return the block number at which this clone was deployed.
|
|
310
|
+
* Used for event log scanning — start from this block to avoid scanning from genesis.
|
|
311
|
+
* @returns Block number as `bigint`.
|
|
312
|
+
*/
|
|
313
|
+
deploymentBlockNumber(): Promise<bigint>;
|
|
314
|
+
/**
|
|
315
|
+
* Return whether `splitVesting` is enabled on this clone.
|
|
316
|
+
* @returns `true` if the split feature is enabled.
|
|
317
|
+
*/
|
|
318
|
+
isSplitEnabled(): Promise<boolean>;
|
|
319
|
+
/**
|
|
320
|
+
* Return whether this clone supports pause/unpause.
|
|
321
|
+
* @returns `true` if the clone is pausable.
|
|
322
|
+
*/
|
|
323
|
+
isPausable(): Promise<boolean>;
|
|
324
|
+
/**
|
|
325
|
+
* Return the current pause state. Always `false` for non-pausable clones.
|
|
326
|
+
* @returns `true` if the manager is paused and claims are blocked.
|
|
327
|
+
*/
|
|
328
|
+
paused(): Promise<boolean>;
|
|
329
|
+
/**
|
|
330
|
+
* Return the maximum number of vesting schedules allowed in a single `batchCreateVesting` call.
|
|
331
|
+
* @returns Batch size limit as `bigint`.
|
|
332
|
+
*/
|
|
333
|
+
maxBatchSize(): Promise<bigint>;
|
|
334
|
+
/**
|
|
335
|
+
* Return the maximum number of vesting ids allowed in a single `batchRevokeVesting` call.
|
|
336
|
+
* @returns Revoke batch size limit as `bigint`.
|
|
337
|
+
*/
|
|
338
|
+
maxRevokeBatchSize(): Promise<bigint>;
|
|
339
|
+
/**
|
|
340
|
+
* Return metadata for a vesting schedule. Returns a zero-struct when `vestingId` does not exist.
|
|
341
|
+
* @param vestingId The `bytes32` vesting schedule ID from the `VestingCreated` event.
|
|
342
|
+
* @returns `VestingInfo` struct; `startTimestamp === 0` means the schedule does not exist.
|
|
343
|
+
* @example
|
|
344
|
+
* const info = await manager.getVestingInfo(vestingId);
|
|
345
|
+
* if (info.startTimestamp === 0) throw new Error("vesting not found");
|
|
346
|
+
*/
|
|
347
|
+
getVestingInfo(vestingId: VestingId): Promise<VestingInfo>;
|
|
348
|
+
/**
|
|
349
|
+
* Return all recipient addresses that have at least one vesting schedule on this manager.
|
|
350
|
+
* @returns Array of checksummed addresses; may be large — use `getAllRecipientsSliced` for pagination.
|
|
351
|
+
*/
|
|
352
|
+
getAllRecipients(): Promise<readonly Address[]>;
|
|
353
|
+
/**
|
|
354
|
+
* Return the total number of unique recipients on this manager.
|
|
355
|
+
* @returns Count as `bigint`.
|
|
356
|
+
*/
|
|
357
|
+
getAllRecipientsLength(): Promise<bigint>;
|
|
358
|
+
/**
|
|
359
|
+
* Slice of `getAllRecipients`, half-open `[start, end)`.
|
|
360
|
+
*
|
|
361
|
+
* Accepts `bigint | number` for `start` / `end` for ergonomics on read paths
|
|
362
|
+
* — CI scripts typically derive these from `Number(process.env.X)` and
|
|
363
|
+
* forcing bigint coercion at the call site is a pure paper cut. The
|
|
364
|
+
* underlying contract reads through unchanged (viem coerces). R22
|
|
365
|
+
* devops-integrator MINOR-4; R25 close.
|
|
366
|
+
*/
|
|
367
|
+
getAllRecipientsSliced(start: bigint | number, end: bigint | number): Promise<readonly Address[]>;
|
|
368
|
+
/**
|
|
369
|
+
* Return whether `account` has at least one vesting schedule on this manager.
|
|
370
|
+
* @param account Address to check.
|
|
371
|
+
* @returns `true` if the account is a known recipient.
|
|
372
|
+
*/
|
|
373
|
+
isRecipient(account: Address): Promise<boolean>;
|
|
374
|
+
/**
|
|
375
|
+
* Return all vesting schedule IDs for `recipient`.
|
|
376
|
+
* @param recipient Address of the vesting recipient.
|
|
377
|
+
* @returns Array of `bytes32` vesting IDs; may be large — use `getAllRecipientVestingsSliced` for pagination.
|
|
378
|
+
*/
|
|
379
|
+
getAllRecipientVestings(recipient: Address): Promise<readonly VestingId[]>;
|
|
380
|
+
/**
|
|
381
|
+
* Return the number of vesting schedules for `recipient`.
|
|
382
|
+
* @param recipient Address of the vesting recipient.
|
|
383
|
+
* @returns Count as `bigint`.
|
|
384
|
+
*/
|
|
385
|
+
getAllRecipientVestingsLength(recipient: Address): Promise<bigint>;
|
|
386
|
+
/**
|
|
387
|
+
* Slice of `getAllRecipientVestings(recipient)`, half-open `[start, end)`.
|
|
388
|
+
* See {@link getAllRecipientsSliced} for the bigint-permissiveness rationale.
|
|
389
|
+
*/
|
|
390
|
+
getAllRecipientVestingsSliced(recipient: Address, start: bigint | number, end: bigint | number): Promise<readonly VestingId[]>;
|
|
391
|
+
/**
|
|
392
|
+
* Return the pending transfer details for a vesting schedule.
|
|
393
|
+
* @param vestingId The `bytes32` vesting schedule ID.
|
|
394
|
+
* @returns `{ newRecipient, initiatedAt, expiresAt }` — all zero if no transfer is pending.
|
|
395
|
+
*/
|
|
396
|
+
getPendingVestingTransfer(vestingId: VestingId): Promise<PendingTransfer>;
|
|
397
|
+
/**
|
|
398
|
+
* Read-only preflight for {@link claim}. Runs the deterministic-from-off-chain
|
|
399
|
+
* checks in parallel and reports any blockers as typed {@link TokenOpsSdkError}s.
|
|
400
|
+
* Returns `{ ready: true, blockers: [] }` when the claim is safe to submit.
|
|
401
|
+
*
|
|
402
|
+
* Preflight is **opt-in**. Consumers who have already validated state can
|
|
403
|
+
* skip this call and invoke `claim` directly — they'll receive the same
|
|
404
|
+
* typed errors at write time via the revert mapper.
|
|
405
|
+
*
|
|
406
|
+
* Checks performed (all read-only, no gas):
|
|
407
|
+
* - Recipient match: `vestingInfo.recipient === caller`.
|
|
408
|
+
* - Schedule exists: `getVestingInfo` returns a non-zero startTimestamp.
|
|
409
|
+
* - Timelock elapsed: `block.timestamp ≥ startTimestamp + timelock`.
|
|
410
|
+
* - Manager is not paused (only when the clone has pause enabled).
|
|
411
|
+
* - ETH balance covers the gas fee (only when `feeType === FeeType.Gas`).
|
|
412
|
+
*
|
|
413
|
+
* Stochastic failures (FHE handle invalidation between read and write, ACL
|
|
414
|
+
* race conditions) cannot be detected off-chain and still surface as
|
|
415
|
+
* typed errors via the revert mapper.
|
|
416
|
+
*
|
|
417
|
+
* @returns `{ ready, blockers }` — same `code` shape as the write would throw.
|
|
418
|
+
*/
|
|
419
|
+
preflightClaim(args: {
|
|
420
|
+
vestingId: Hex;
|
|
421
|
+
caller: Address;
|
|
422
|
+
}): Promise<PreflightResult>;
|
|
423
|
+
/**
|
|
424
|
+
* Get the vested amount at a given timestamp as an encrypted handle.
|
|
425
|
+
*
|
|
426
|
+
* Submits a transaction that calls `FHE.allow(handle, msg.sender)` — the handle
|
|
427
|
+
* is extracted from the receipt's ACL `Allowed` event, not from simulation. Pass
|
|
428
|
+
* `handle` to the Zama relayer's `userDecrypt` to obtain the plaintext.
|
|
429
|
+
*
|
|
430
|
+
* @param args.timestamp Unix timestamp to evaluate vesting at (use `Date.now() / 1000` for current).
|
|
431
|
+
* @returns `{ handle, hash }` — `handle` is a `euint128` granted to the caller.
|
|
432
|
+
*/
|
|
433
|
+
getVestedAmount(args: {
|
|
434
|
+
vestingId: VestingId;
|
|
435
|
+
timestamp: number;
|
|
436
|
+
account?: Account | Address | undefined;
|
|
437
|
+
}): Promise<EncryptedViewResult>;
|
|
438
|
+
/**
|
|
439
|
+
* Get the currently claimable token amount as an encrypted handle.
|
|
440
|
+
*
|
|
441
|
+
* Like all encrypted view methods, this submits a transaction. Pass `handle`
|
|
442
|
+
* to the Zama relayer's `userDecrypt` to obtain the plaintext.
|
|
443
|
+
*
|
|
444
|
+
* @returns `{ handle, hash }` — `handle` is a `euint128` granted to the caller.
|
|
445
|
+
*/
|
|
446
|
+
getClaimableAmount(args: {
|
|
447
|
+
vestingId: VestingId;
|
|
448
|
+
account?: Account | Address | undefined;
|
|
449
|
+
}): Promise<EncryptedViewResult>;
|
|
450
|
+
getTotalAllocation(args: {
|
|
451
|
+
vestingId: VestingId;
|
|
452
|
+
account?: Account | Address | undefined;
|
|
453
|
+
}): Promise<EncryptedViewResult>;
|
|
454
|
+
getSettledAmount(args: {
|
|
455
|
+
vestingId: VestingId;
|
|
456
|
+
account?: Account | Address | undefined;
|
|
457
|
+
}): Promise<EncryptedViewResult>;
|
|
458
|
+
adminGetVestedAmount(args: {
|
|
459
|
+
vestingId: VestingId;
|
|
460
|
+
timestamp: number;
|
|
461
|
+
account?: Account | Address | undefined;
|
|
462
|
+
}): Promise<EncryptedViewResult>;
|
|
463
|
+
adminGetClaimableAmount(args: {
|
|
464
|
+
vestingId: VestingId;
|
|
465
|
+
account?: Account | Address | undefined;
|
|
466
|
+
}): Promise<EncryptedViewResult>;
|
|
467
|
+
adminGetTotalAllocation(args: {
|
|
468
|
+
vestingId: VestingId;
|
|
469
|
+
account?: Account | Address | undefined;
|
|
470
|
+
}): Promise<EncryptedViewResult>;
|
|
471
|
+
adminGetSettledAmount(args: {
|
|
472
|
+
vestingId: VestingId;
|
|
473
|
+
account?: Account | Address | undefined;
|
|
474
|
+
}): Promise<EncryptedViewResult>;
|
|
475
|
+
adminGetTokenBalance(args?: {
|
|
476
|
+
account?: Account | Address;
|
|
477
|
+
}): Promise<EncryptedViewResult>;
|
|
478
|
+
/**
|
|
479
|
+
* Create a single vesting schedule. The SDK encrypts `amount` into an
|
|
480
|
+
* `externalEuint64` and submits it as the input proof — callers pass plaintext.
|
|
481
|
+
*
|
|
482
|
+
* Pass `encryptedInput` to bypass the encryptor when you manage encryption yourself.
|
|
483
|
+
*
|
|
484
|
+
* @returns Transaction hash. Parse the `VestingCreated` event to extract the `vestingId`.
|
|
485
|
+
* @example
|
|
486
|
+
* const hash = await manager.createVesting({
|
|
487
|
+
* params: { recipient, startTimestamp, endTimestamp, cliffSeconds: 0,
|
|
488
|
+
* releaseIntervalSecs: 86400, timelockSeconds: 0,
|
|
489
|
+
* initialUnlockBps: 0, cliffAmountBps: 0, isRevocable: false },
|
|
490
|
+
* amount: 1_000_000n,
|
|
491
|
+
* });
|
|
492
|
+
*/
|
|
493
|
+
createVesting(args: CreateVestingArgs): Promise<Hex>;
|
|
494
|
+
/**
|
|
495
|
+
* Batch-create vesting schedules. All amounts are encrypted together under a
|
|
496
|
+
* single input proof, saving gas vs. multiple `createVesting` calls.
|
|
497
|
+
*
|
|
498
|
+
* Respects `maxBatchSize` — check before calling on large lists.
|
|
499
|
+
*
|
|
500
|
+
* @returns Transaction hash.
|
|
501
|
+
*/
|
|
502
|
+
batchCreateVesting(args: BatchCreateVestingArgs): Promise<Hex>;
|
|
503
|
+
/**
|
|
504
|
+
* Claim all currently vested tokens for `vestingId`.
|
|
505
|
+
* For `FeeType.Gas` managers, pass `value` (gas fee in wei from `getFeeInfo()`).
|
|
506
|
+
* @param args Discriminated by `feeType`: pass `{ feeType, vestingId, value }` for Gas, `{ feeType, vestingId }` for DistributionToken.
|
|
507
|
+
* @returns Transaction hash.
|
|
508
|
+
* @example
|
|
509
|
+
* const { feeType, fee } = await manager.getFeeInfo();
|
|
510
|
+
* const hash = await manager.claim(
|
|
511
|
+
* feeType === FeeType.Gas ? { feeType, vestingId, value: fee } : { feeType, vestingId },
|
|
512
|
+
* );
|
|
513
|
+
*/
|
|
514
|
+
claim(args: ClaimArgs): Promise<Hex>;
|
|
515
|
+
/**
|
|
516
|
+
* Admin variant of `claim` — callable by the manager admin on behalf of any recipient.
|
|
517
|
+
* Useful for gas-sponsored claim flows. Same fee rules as `claim`.
|
|
518
|
+
* @param args Same discriminated union as `claim`.
|
|
519
|
+
* @returns Transaction hash.
|
|
520
|
+
*/
|
|
521
|
+
adminClaim(args: ClaimArgs): Promise<Hex>;
|
|
522
|
+
/**
|
|
523
|
+
* Claim a specific encrypted amount from a vesting schedule rather than the full claimable balance.
|
|
524
|
+
* The SDK encrypts `amount` — pass plaintext. Alternatively pass `encryptedInput` to bypass encryption.
|
|
525
|
+
* @param args Includes `vestingId`, `amount` or `encryptedInput`, and optional `value` for Gas-fee managers.
|
|
526
|
+
* @returns Transaction hash.
|
|
527
|
+
*/
|
|
528
|
+
partialClaim(args: PartialClaimArgs): Promise<Hex>;
|
|
529
|
+
/**
|
|
530
|
+
* Admin variant of `partialClaim` — callable by the manager admin on behalf of any recipient.
|
|
531
|
+
* @param args Same as `partialClaim`.
|
|
532
|
+
* @returns Transaction hash.
|
|
533
|
+
*/
|
|
534
|
+
adminPartialClaim(args: PartialClaimArgs): Promise<Hex>;
|
|
535
|
+
/**
|
|
536
|
+
* Revoke a vesting schedule. Callable only when the schedule was created with `isRevocable: true`.
|
|
537
|
+
* The unvested remainder is returned to the manager admin.
|
|
538
|
+
* @param vestingId The `bytes32` vesting schedule ID to revoke.
|
|
539
|
+
* @returns Transaction hash.
|
|
540
|
+
*/
|
|
541
|
+
revokeVesting(vestingId: Hex, account?: Account | Address): Promise<Hex>;
|
|
542
|
+
/**
|
|
543
|
+
* Revoke multiple vesting schedules in one transaction. Respects `maxRevokeBatchSize`.
|
|
544
|
+
* @param vestingIds Array of `bytes32` vesting schedule IDs to revoke.
|
|
545
|
+
* @returns Transaction hash.
|
|
546
|
+
*/
|
|
547
|
+
batchRevokeVesting(vestingIds: readonly Hex[], account?: Account | Address): Promise<Hex>;
|
|
548
|
+
/**
|
|
549
|
+
* Split a vesting into two positions.
|
|
550
|
+
*
|
|
551
|
+
* The `numerator/denominator` ratio is auto-scaled via `scaleRatio` to the
|
|
552
|
+
* universal split constant `FHE_SPLIT_DENOMINATOR` (`90_090_000` =
|
|
553
|
+
* LCM(1..16, 10_000)) unless `args.preScaled` is set. Every confidential
|
|
554
|
+
* split lands on the same plaintext denominator so the constant itself
|
|
555
|
+
* leaks no information about the split's shape; only the encrypted
|
|
556
|
+
* numerator carries the share. `90_090_000` is well above the contract's
|
|
557
|
+
* `MIN_SPLIT_DENOMINATOR` (10_000) floor. The SDK encrypts `numerator` —
|
|
558
|
+
* pass plaintext.
|
|
559
|
+
*
|
|
560
|
+
* Two natural input shapes both produce exact integer numerators against
|
|
561
|
+
* the universal denominator:
|
|
562
|
+
* - `n/m` with `m ∈ 1..16` (halves, thirds, …, sixteenths)
|
|
563
|
+
* - `bps/10_000` (basis points)
|
|
564
|
+
*
|
|
565
|
+
* Use the {@link share} builder to construct them without manual math:
|
|
566
|
+
* `share.fraction(1, 7)` or `share.basisPoints(250)` → pass the returned
|
|
567
|
+
* `{ numerator, denominator }` with `preScaled: true`.
|
|
568
|
+
*
|
|
569
|
+
* @param args.numerator Plaintext share numerator (kept confidential on-chain).
|
|
570
|
+
* @param args.denominator Plaintext denominator — auto-scaled to 90_090_000.
|
|
571
|
+
* @param args.newRecipient Recipient address for the split-off position.
|
|
572
|
+
* @returns `{ hash, newVestingId }` — the receipt-derived id of the
|
|
573
|
+
* newly-created vesting position, required for any follow-up call
|
|
574
|
+
* (claim, transfer, disclose) on the split-off position.
|
|
575
|
+
* @example
|
|
576
|
+
* const { newVestingId } = await manager.splitVesting({
|
|
577
|
+
* vestingId,
|
|
578
|
+
* numerator: 1n, denominator: 2n, // 50% split; SDK scales to 45_045_000 / 90_090_000
|
|
579
|
+
* newRecipient: "0xNewRecipient",
|
|
580
|
+
* });
|
|
581
|
+
*
|
|
582
|
+
* @example
|
|
583
|
+
* // Basis-point style via the guided builder:
|
|
584
|
+
* const ratio = share.basisPoints(250); // 2.5%
|
|
585
|
+
* const { newVestingId } = await manager.splitVesting({
|
|
586
|
+
* vestingId,
|
|
587
|
+
* numerator: ratio.numerator,
|
|
588
|
+
* denominator: ratio.denominator,
|
|
589
|
+
* preScaled: true,
|
|
590
|
+
* newRecipient: "0xNewRecipient",
|
|
591
|
+
* });
|
|
592
|
+
*/
|
|
593
|
+
splitVesting(args: SplitVestingArgs): Promise<SplitVestingResult>;
|
|
594
|
+
/**
|
|
595
|
+
* Initiate a vesting schedule transfer to a new recipient.
|
|
596
|
+
* The new recipient has `transferDurationSeconds` to accept before the offer expires.
|
|
597
|
+
* @param args `{ vestingId, newRecipient, transferDurationSeconds }`.
|
|
598
|
+
* @returns Transaction hash.
|
|
599
|
+
*/
|
|
600
|
+
initiateVestingTransfer(args: InitiateTransferArgs): Promise<Hex>;
|
|
601
|
+
/**
|
|
602
|
+
* Accept a pending vesting transfer. Called by the `newRecipient` named in `initiateVestingTransfer`.
|
|
603
|
+
* @param vestingId The `bytes32` vesting schedule ID being transferred.
|
|
604
|
+
* @returns Transaction hash.
|
|
605
|
+
*/
|
|
606
|
+
acceptVestingTransfer(vestingId: Hex, account?: Account | Address): Promise<Hex>;
|
|
607
|
+
/**
|
|
608
|
+
* Cancel a pending vesting transfer. Callable by either the original or new recipient.
|
|
609
|
+
* @param vestingId The `bytes32` vesting schedule ID with a pending transfer.
|
|
610
|
+
* @returns Transaction hash.
|
|
611
|
+
*/
|
|
612
|
+
cancelVestingTransfer(vestingId: Hex, account?: Account | Address): Promise<Hex>;
|
|
613
|
+
/**
|
|
614
|
+
* Transfer ownership of a vesting schedule directly to `newOwner` without a time-locked acceptance window.
|
|
615
|
+
* Callable only by the manager admin.
|
|
616
|
+
* @param vestingId The `bytes32` vesting schedule ID to transfer.
|
|
617
|
+
* @param newOwner Address that will become the new recipient.
|
|
618
|
+
* @returns Transaction hash.
|
|
619
|
+
*/
|
|
620
|
+
directVestingTransfer(vestingId: VestingId, newOwner: Address, account?: Account | Address): Promise<Hex>;
|
|
621
|
+
/**
|
|
622
|
+
* Disclose a single vesting amount to `party`, granting them persistent FHE
|
|
623
|
+
* ACL on the corresponding `euint128` handle. The handle is parsed from the
|
|
624
|
+
* `AmountDisclosed` event filtered by the indexed
|
|
625
|
+
* `(vestingId, discloser=caller, party)` tuple — exactly one match expected.
|
|
626
|
+
*
|
|
627
|
+
* @returns `{ hash, handle }` — pass `handle` to the Zama relayer's
|
|
628
|
+
* `userDecrypt` (from the `party` side) to obtain the plaintext.
|
|
629
|
+
*/
|
|
630
|
+
discloseToParty(args: DiscloseArgs): Promise<DiscloseToPartyResult>;
|
|
631
|
+
/**
|
|
632
|
+
* Disclose multiple vesting amounts to one `party` in a single tx. Handles
|
|
633
|
+
* are parsed from the matching `AmountDisclosed` events and returned in the
|
|
634
|
+
* same order as `args.vestingIds` (one handle per input id).
|
|
635
|
+
*
|
|
636
|
+
* @returns `{ hash, handles }` — `handles[i]` corresponds to `vestingIds[i]`.
|
|
637
|
+
*/
|
|
638
|
+
batchDiscloseToParty(args: {
|
|
639
|
+
vestingIds: readonly VestingId[];
|
|
640
|
+
disclosureTypes: readonly DisclosureType[];
|
|
641
|
+
party: Address;
|
|
642
|
+
account?: Account | Address;
|
|
643
|
+
}): Promise<BatchDiscloseToPartyResult>;
|
|
644
|
+
/**
|
|
645
|
+
* Admin-only counterpart to {@link discloseToParty}. Same receipt-parsing
|
|
646
|
+
* semantics — returns the granted `euint128` handle from the
|
|
647
|
+
* `AmountDisclosed` event.
|
|
648
|
+
*/
|
|
649
|
+
adminDiscloseToParty(args: DiscloseArgs): Promise<DiscloseToPartyResult>;
|
|
650
|
+
/**
|
|
651
|
+
* Admin-only counterpart to {@link batchDiscloseToParty}. Same return shape.
|
|
652
|
+
*/
|
|
653
|
+
adminBatchDiscloseToParty(args: {
|
|
654
|
+
vestingIds: readonly VestingId[];
|
|
655
|
+
disclosureTypes: readonly DisclosureType[];
|
|
656
|
+
party: Address;
|
|
657
|
+
account?: Account | Address;
|
|
658
|
+
}): Promise<BatchDiscloseToPartyResult>;
|
|
659
|
+
/**
|
|
660
|
+
* Grant `party` persistent FHE ACL on an already-obtained encrypted handle.
|
|
661
|
+
* Use this when you hold a handle from a previous call and want to share it with another address.
|
|
662
|
+
* @param handle The `euint128` encrypted handle to disclose.
|
|
663
|
+
* @param party Address to grant ACL on the handle.
|
|
664
|
+
* @returns Transaction hash.
|
|
665
|
+
*/
|
|
666
|
+
discloseHandleToParty(handle: EncryptedHandle, party: Address, account?: Account | Address): Promise<TxHash>;
|
|
667
|
+
/**
|
|
668
|
+
* Grant `party` persistent FHE ACL on multiple encrypted handles in one transaction.
|
|
669
|
+
* @param handles Array of `euint128` handles to disclose.
|
|
670
|
+
* @param party Address to grant ACL on all handles.
|
|
671
|
+
* @returns Transaction hash.
|
|
672
|
+
*/
|
|
673
|
+
batchDiscloseHandlesToParty(handles: readonly EncryptedHandle[], party: Address, account?: Account | Address): Promise<TxHash>;
|
|
674
|
+
/**
|
|
675
|
+
* Withdraw a confidential token amount from the manager's balance back to the admin.
|
|
676
|
+
* The SDK encrypts `amount` — pass plaintext. Alternatively pass `encryptedInput`.
|
|
677
|
+
* @param args `{ amount }` (plaintext, SDK encrypts) or `{ encryptedInput }` (pre-encrypted).
|
|
678
|
+
* @returns Transaction hash.
|
|
679
|
+
*/
|
|
680
|
+
withdrawAdmin(args: {
|
|
681
|
+
/** Plaintext amount. Mutually exclusive with `encryptedInput`. */
|
|
682
|
+
amount?: bigint;
|
|
683
|
+
encryptor?: Encryptor;
|
|
684
|
+
/** Pre-encrypted input. Mutually exclusive with `amount`. */
|
|
685
|
+
encryptedInput?: EncryptedInput;
|
|
686
|
+
account?: Account | Address;
|
|
687
|
+
}): Promise<Hex>;
|
|
688
|
+
/**
|
|
689
|
+
* Recover a plain ERC-20 token accidentally sent to this manager. Admin only.
|
|
690
|
+
* @param token ERC-20 token address to recover.
|
|
691
|
+
* @param to Recipient address for the recovered tokens.
|
|
692
|
+
* @returns Transaction hash.
|
|
693
|
+
*/
|
|
694
|
+
withdrawOtherToken(token: Address, to: Address, account?: Account | Address): Promise<TxHash>;
|
|
695
|
+
/**
|
|
696
|
+
* Recover a confidential ERC-7984 token accidentally sent to this manager. Admin only.
|
|
697
|
+
* @param token ERC-7984 token address to recover.
|
|
698
|
+
* @param to Recipient address for the recovered tokens.
|
|
699
|
+
* @returns Transaction hash.
|
|
700
|
+
*/
|
|
701
|
+
withdrawOtherConfidentialToken(token: Address, to: Address, account?: Account | Address): Promise<TxHash>;
|
|
702
|
+
/**
|
|
703
|
+
* Withdraw accumulated ETH gas fees from the manager to `to`. Admin only.
|
|
704
|
+
* @param to Recipient address.
|
|
705
|
+
* @param amount Amount in wei.
|
|
706
|
+
* @returns Transaction hash.
|
|
707
|
+
*/
|
|
708
|
+
withdrawGasFee(to: Address, amount: bigint, account?: Account | Address): Promise<TxHash>;
|
|
709
|
+
/**
|
|
710
|
+
* Withdraw accumulated token fees from a `FeeType.DistributionToken` manager. Admin only.
|
|
711
|
+
* The SDK encrypts `amount` — pass plaintext. Alternatively pass `encryptedInput`.
|
|
712
|
+
* @param args `{ to, amount }` (plaintext, SDK encrypts) or `{ to, encryptedInput }` (pre-encrypted).
|
|
713
|
+
* @returns Transaction hash.
|
|
714
|
+
*/
|
|
715
|
+
withdrawTokenFee(args: {
|
|
716
|
+
to: Address;
|
|
717
|
+
/** Plaintext amount. Mutually exclusive with `encryptedInput`. */
|
|
718
|
+
amount?: bigint;
|
|
719
|
+
encryptor?: Encryptor;
|
|
720
|
+
/** Pre-encrypted input. Mutually exclusive with `amount`. */
|
|
721
|
+
encryptedInput?: EncryptedInput;
|
|
722
|
+
account?: Account | Address;
|
|
723
|
+
}): Promise<Hex>;
|
|
724
|
+
/**
|
|
725
|
+
* Update the maximum number of vestings allowed in a single `batchCreateVesting` call. Admin only.
|
|
726
|
+
* @param newMax New batch size limit.
|
|
727
|
+
* @returns Transaction hash.
|
|
728
|
+
*/
|
|
729
|
+
setMaxBatchSize(newMax: bigint, account?: Account | Address): Promise<TxHash>;
|
|
730
|
+
/**
|
|
731
|
+
* Update the maximum number of vestings allowed in a single `batchRevokeVesting` call. Admin only.
|
|
732
|
+
* @param newMax New revoke batch size limit.
|
|
733
|
+
* @returns Transaction hash.
|
|
734
|
+
*/
|
|
735
|
+
setMaxRevokeBatchSize(newMax: bigint | number, account?: Account | Address): Promise<TxHash>;
|
|
736
|
+
/**
|
|
737
|
+
* Transfer the fee-collector role to a new address. Callable by the current fee collector.
|
|
738
|
+
* @param newCollector Address to assign the fee-collector role.
|
|
739
|
+
* @returns Transaction hash.
|
|
740
|
+
*/
|
|
741
|
+
transferFeeCollectorRole(newCollector: Address, account?: Account | Address): Promise<TxHash>;
|
|
742
|
+
/**
|
|
743
|
+
* Pause the manager, blocking all claim operations. Requires `isPausable() === true`. PAUSER_ROLE only.
|
|
744
|
+
* @returns Transaction hash.
|
|
745
|
+
*/
|
|
746
|
+
pause(account?: Account | Address): Promise<TxHash>;
|
|
747
|
+
/**
|
|
748
|
+
* Resume a paused manager, re-enabling claim operations. PAUSER_ROLE only.
|
|
749
|
+
* @returns Transaction hash.
|
|
750
|
+
*/
|
|
751
|
+
unpause(account?: Account | Address): Promise<TxHash>;
|
|
752
|
+
/**
|
|
753
|
+
* Check whether `account` holds `role` on this manager.
|
|
754
|
+
* @param role `bytes32` role identifier — use the `roleConstants()` helper or the SDK's exported role constants.
|
|
755
|
+
* @param account Address to check.
|
|
756
|
+
* @returns `true` if the account holds the role.
|
|
757
|
+
*/
|
|
758
|
+
hasRole(role: Role, account: Address): Promise<boolean>;
|
|
759
|
+
/**
|
|
760
|
+
* Grant `role` to `accountTarget`. Requires DEFAULT_ADMIN_ROLE.
|
|
761
|
+
* @param role `bytes32` role identifier.
|
|
762
|
+
* @param accountTarget Address to grant the role to.
|
|
763
|
+
* @returns Transaction hash.
|
|
764
|
+
*/
|
|
765
|
+
grantRole(role: Role, accountTarget: Address, account?: Account | Address): Promise<TxHash>;
|
|
766
|
+
/**
|
|
767
|
+
* Revoke `role` from `accountTarget`. Requires DEFAULT_ADMIN_ROLE.
|
|
768
|
+
* @param role `bytes32` role identifier.
|
|
769
|
+
* @param accountTarget Address to revoke the role from.
|
|
770
|
+
* @returns Transaction hash.
|
|
771
|
+
*/
|
|
772
|
+
revokeRole(role: Role, accountTarget: Address, account?: Account | Address): Promise<TxHash>;
|
|
773
|
+
/**
|
|
774
|
+
* Renounce a role held by the caller. `callerConfirm` must equal `msg.sender` (OpenZeppelin guard).
|
|
775
|
+
* @param role `bytes32` role identifier to renounce.
|
|
776
|
+
* @param callerConfirm Must equal the calling account address.
|
|
777
|
+
* @returns Transaction hash.
|
|
778
|
+
*/
|
|
779
|
+
renounceRole(role: Role, callerConfirm: Address, account?: Account | Address): Promise<TxHash>;
|
|
780
|
+
/**
|
|
781
|
+
* Read all role identifiers from the contract in one multicall.
|
|
782
|
+
* @returns Object mapping role name to its `bytes32` identifier.
|
|
783
|
+
* @example
|
|
784
|
+
* const { VESTING_CREATOR_ROLE } = await manager.roleConstants();
|
|
785
|
+
* await manager.grantRole(VESTING_CREATOR_ROLE, creatorAddress);
|
|
786
|
+
*/
|
|
787
|
+
roleConstants(): Promise<{
|
|
788
|
+
DEFAULT_ADMIN_ROLE: Role;
|
|
789
|
+
VESTING_CREATOR_ROLE: Role;
|
|
790
|
+
REVOKER_ROLE: Role;
|
|
791
|
+
WITHDRAWER_ROLE: Role;
|
|
792
|
+
CLAIMER_ROLE: Role;
|
|
793
|
+
FEE_COLLECTOR_ROLE: Role;
|
|
794
|
+
PAUSER_ROLE: Role;
|
|
795
|
+
DISCLOSURE_ADMIN_ROLE: Role;
|
|
796
|
+
}>;
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Create a {@link ConfidentialVestingManagerClient}. Mirrors viem's `create*` convention.
|
|
800
|
+
*
|
|
801
|
+
* @example
|
|
802
|
+
* const manager = createConfidentialVestingManagerClient({
|
|
803
|
+
* publicClient, walletClient,
|
|
804
|
+
* address: "0xYourManagerClone",
|
|
805
|
+
* encryptor,
|
|
806
|
+
* });
|
|
807
|
+
*/
|
|
808
|
+
export declare function createConfidentialVestingManagerClient(config: ConfidentialVestingManagerClientConfig): ConfidentialVestingManagerClient;
|