@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,52 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import { ConfidentialVestingFactoryClient, type ConfidentialVestingFactoryClientConfig, type PredictManagerArgs } from "../factory.js";
|
|
3
|
+
/**
|
|
4
|
+
* Advanced extension of {@link ConfidentialVestingFactoryClient} that re-exposes
|
|
5
|
+
* the CREATE2 address prediction read.
|
|
6
|
+
*
|
|
7
|
+
* **Why this is "advanced" surface.** R02 ADR P-1 + P-2 (alignment-auditor R04
|
|
8
|
+
* top-1): `predictManagerAddress` is block-dependent on a live chain — the
|
|
9
|
+
* factory packs the deployment block number into the clone's immutable args,
|
|
10
|
+
* which feed into the CREATE2 init-code hash. Predict at block N, mine at
|
|
11
|
+
* N+1, and the addresses differ. The vast majority of consumers want
|
|
12
|
+
* `createManager` (rich-return, `{ hash, manager }`) — the address is parsed
|
|
13
|
+
* from the `ManagerCreated` event in the tx receipt with no block guessing.
|
|
14
|
+
*
|
|
15
|
+
* Genuine use cases for the predict read:
|
|
16
|
+
* - Historical lookups (verifying a clone deployed at a known past block).
|
|
17
|
+
* - Tightly-coupled same-tx flash flows (rare).
|
|
18
|
+
*
|
|
19
|
+
* For everything else, the headline factory's `createManager` is the right
|
|
20
|
+
* entry point.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* import { createConfidentialVestingFactoryAdvancedClient } from "@tokenops/sdk/fhe-vesting/advanced";
|
|
24
|
+
*
|
|
25
|
+
* const factory = createConfidentialVestingFactoryAdvancedClient({ publicClient });
|
|
26
|
+
* const predicted = await factory.predictManagerAddress({
|
|
27
|
+
* token, userSalt, deployer, blockNumber: 10_852_182n,
|
|
28
|
+
* });
|
|
29
|
+
*/
|
|
30
|
+
export declare class ConfidentialVestingFactoryAdvancedClient extends ConfidentialVestingFactoryClient {
|
|
31
|
+
/**
|
|
32
|
+
* Compute the deterministic CREATE2 clone address as the factory would have
|
|
33
|
+
* computed it at `args.blockNumber`.
|
|
34
|
+
*
|
|
35
|
+
* **Block-dependent.** See class TSDoc — predict at block N, mine at N+1,
|
|
36
|
+
* the addresses differ.
|
|
37
|
+
*
|
|
38
|
+
* For the common "deploy a clone and learn its address" flow, prefer the
|
|
39
|
+
* headline `factory.createManager`, which parses the address from the tx
|
|
40
|
+
* receipt's `ManagerCreated` event.
|
|
41
|
+
*/
|
|
42
|
+
predictManagerAddress(args: PredictManagerArgs): Promise<Address>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Create a {@link ConfidentialVestingFactoryAdvancedClient}. Mirrors viem's
|
|
46
|
+
* `create*` convention.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* const factory = createConfidentialVestingFactoryAdvancedClient({ publicClient, walletClient });
|
|
50
|
+
* const predicted = await factory.predictManagerAddress({ token, userSalt, deployer, blockNumber });
|
|
51
|
+
*/
|
|
52
|
+
export declare function createConfidentialVestingFactoryAdvancedClient(config: ConfidentialVestingFactoryClientConfig): ConfidentialVestingFactoryAdvancedClient;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkQCA7O2Q5_cjs = require('../../chunk-QCA7O2Q5.cjs');
|
|
4
|
+
require('../../chunk-62DF53UQ.cjs');
|
|
5
|
+
require('../../chunk-VDXVNZCO.cjs');
|
|
6
|
+
require('../../chunk-OLDGMKW2.cjs');
|
|
7
|
+
require('../../chunk-CQIPRNS7.cjs');
|
|
8
|
+
require('../../chunk-VJKZWYYJ.cjs');
|
|
9
|
+
require('../../chunk-66IHPTOK.cjs');
|
|
10
|
+
require('../../chunk-56UI7LUR.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
Object.defineProperty(exports, "ConfidentialVestingFactoryAdvancedClient", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return chunkQCA7O2Q5_cjs.ConfidentialVestingFactoryAdvancedClient; }
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "createConfidentialVestingFactoryAdvancedClient", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return chunkQCA7O2Q5_cjs.createConfidentialVestingFactoryAdvancedClient; }
|
|
21
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advanced FHE-vesting primitives — power-user surface kept off the headline
|
|
3
|
+
* client to keep the 90 % path lean (R02 ADR P-2; alignment-auditor R04 top-1).
|
|
4
|
+
*
|
|
5
|
+
* Re-exports the {@link ConfidentialVestingFactoryAdvancedClient} subclass,
|
|
6
|
+
* which extends the headline factory client with `predictManagerAddress`. The
|
|
7
|
+
* predict read is block-dependent — see the subclass TSDoc. For the common
|
|
8
|
+
* "deploy and learn the address" case, the headline factory's
|
|
9
|
+
* `createManager` returns `{ hash, manager }` directly (R02 ADR P-1).
|
|
10
|
+
*/
|
|
11
|
+
export { ConfidentialVestingFactoryAdvancedClient, createConfidentialVestingFactoryAdvancedClient, } from "./factory-advanced.js";
|
|
12
|
+
export type { PredictManagerArgs } from "../factory.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advanced FHE-vesting primitives — power-user surface kept off the headline
|
|
3
|
+
* client to keep the 90 % path lean (R02 ADR P-2; alignment-auditor R04 top-1).
|
|
4
|
+
*
|
|
5
|
+
* Re-exports the {@link ConfidentialVestingFactoryAdvancedClient} subclass,
|
|
6
|
+
* which extends the headline factory client with `predictManagerAddress`. The
|
|
7
|
+
* predict read is block-dependent — see the subclass TSDoc. For the common
|
|
8
|
+
* "deploy and learn the address" case, the headline factory's
|
|
9
|
+
* `createManager` returns `{ hash, manager }` directly (R02 ADR P-1).
|
|
10
|
+
*/
|
|
11
|
+
export { ConfidentialVestingFactoryAdvancedClient, createConfidentialVestingFactoryAdvancedClient, } from "./factory-advanced.js";
|
|
12
|
+
export type { PredictManagerArgs } from "../factory.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ConfidentialVestingFactoryAdvancedClient, createConfidentialVestingFactoryAdvancedClient } from '../../chunk-CMRETRZO.js';
|
|
2
|
+
import '../../chunk-72YGZEQE.js';
|
|
3
|
+
import '../../chunk-JFLEEXKP.js';
|
|
4
|
+
import '../../chunk-COPFW5Z4.js';
|
|
5
|
+
import '../../chunk-BE2AIZ3K.js';
|
|
6
|
+
import '../../chunk-Q2GP5UDC.js';
|
|
7
|
+
import '../../chunk-KWFFIJYX.js';
|
|
8
|
+
import '../../chunk-IVE3QEGD.js';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkJFR5J4FL_cjs = require('../../../chunk-JFR5J4FL.cjs');
|
|
4
|
+
require('../../../chunk-SUOG3BQS.cjs');
|
|
5
|
+
require('../../../chunk-NS44KBV5.cjs');
|
|
6
|
+
require('../../../chunk-5SGMJADP.cjs');
|
|
7
|
+
require('../../../chunk-Q7ARQSUH.cjs');
|
|
8
|
+
var chunkQCA7O2Q5_cjs = require('../../../chunk-QCA7O2Q5.cjs');
|
|
9
|
+
require('../../../chunk-62DF53UQ.cjs');
|
|
10
|
+
require('../../../chunk-VDXVNZCO.cjs');
|
|
11
|
+
var chunkOLDGMKW2_cjs = require('../../../chunk-OLDGMKW2.cjs');
|
|
12
|
+
require('../../../chunk-CQIPRNS7.cjs');
|
|
13
|
+
require('../../../chunk-VJKZWYYJ.cjs');
|
|
14
|
+
require('../../../chunk-66IHPTOK.cjs');
|
|
15
|
+
require('../../../chunk-56UI7LUR.cjs');
|
|
16
|
+
var react = require('react');
|
|
17
|
+
var reactQuery = require('@tanstack/react-query');
|
|
18
|
+
var wagmi = require('wagmi');
|
|
19
|
+
|
|
20
|
+
function usePredictManagerAddress(args = {}) {
|
|
21
|
+
const {
|
|
22
|
+
token,
|
|
23
|
+
userSalt,
|
|
24
|
+
deployer,
|
|
25
|
+
blockNumber,
|
|
26
|
+
splitEnabled,
|
|
27
|
+
pausableEnabled,
|
|
28
|
+
address,
|
|
29
|
+
chainId,
|
|
30
|
+
publicClient
|
|
31
|
+
} = args;
|
|
32
|
+
const wagmiPublicClient = wagmi.usePublicClient({ ...chainId !== void 0 ? { chainId } : {} });
|
|
33
|
+
const resolvedPublicClient = publicClient ?? wagmiPublicClient;
|
|
34
|
+
const { data: walletClient } = wagmi.useWalletClient({
|
|
35
|
+
...chainId !== void 0 ? { chainId } : {}
|
|
36
|
+
});
|
|
37
|
+
const resolvedChainId = chainId ?? resolvedPublicClient?.chain?.id;
|
|
38
|
+
const resolvedAddress = address ?? (resolvedChainId === void 0 ? void 0 : chunkOLDGMKW2_cjs.DEPLOYED_ADDRESSES.fheVesting?.confidentialVestingFactory?.[resolvedChainId] ?? void 0);
|
|
39
|
+
react.useRef(void 0);
|
|
40
|
+
const client = react.useMemo(() => {
|
|
41
|
+
if (!resolvedPublicClient) return void 0;
|
|
42
|
+
if (!resolvedAddress) return void 0;
|
|
43
|
+
return chunkQCA7O2Q5_cjs.createConfidentialVestingFactoryAdvancedClient({
|
|
44
|
+
publicClient: resolvedPublicClient,
|
|
45
|
+
...walletClient ? { walletClient } : {},
|
|
46
|
+
address: resolvedAddress,
|
|
47
|
+
...resolvedChainId !== void 0 ? { chainId: resolvedChainId } : {}
|
|
48
|
+
});
|
|
49
|
+
}, [resolvedPublicClient, walletClient, resolvedAddress, resolvedChainId]);
|
|
50
|
+
return reactQuery.useQuery({
|
|
51
|
+
queryKey: chunkJFR5J4FL_cjs.buildQueryKey(
|
|
52
|
+
"factory:predictManagerAddress",
|
|
53
|
+
resolvedChainId,
|
|
54
|
+
resolvedAddress,
|
|
55
|
+
token,
|
|
56
|
+
userSalt,
|
|
57
|
+
deployer,
|
|
58
|
+
blockNumber,
|
|
59
|
+
splitEnabled ?? null,
|
|
60
|
+
pausableEnabled ?? null
|
|
61
|
+
),
|
|
62
|
+
queryFn: () => client.predictManagerAddress({
|
|
63
|
+
token,
|
|
64
|
+
userSalt,
|
|
65
|
+
deployer,
|
|
66
|
+
blockNumber,
|
|
67
|
+
...splitEnabled !== void 0 && { splitEnabled },
|
|
68
|
+
...pausableEnabled !== void 0 && { pausableEnabled }
|
|
69
|
+
}),
|
|
70
|
+
enabled: !!client && !!token && !!userSalt && !!deployer && blockNumber !== void 0,
|
|
71
|
+
staleTime: 0
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
exports.usePredictManagerAddress = usePredictManagerAddress;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React hooks for `@tokenops/sdk/fhe-vesting/advanced`. The headline React
|
|
3
|
+
* subpath stays lean; pre-mine address prediction lives here per R02 ADR P-2.
|
|
4
|
+
*/
|
|
5
|
+
export { usePredictManagerAddress, type UsePredictManagerAddressArgs, } from "./usePredictManagerAddress.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React hooks for `@tokenops/sdk/fhe-vesting/advanced`. The headline React
|
|
3
|
+
* subpath stays lean; pre-mine address prediction lives here per R02 ADR P-2.
|
|
4
|
+
*/
|
|
5
|
+
export { usePredictManagerAddress, type UsePredictManagerAddressArgs, } from "./usePredictManagerAddress.js";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { buildQueryKey } from '../../../chunk-ECT3NL2L.js';
|
|
2
|
+
import '../../../chunk-52TC6BF7.js';
|
|
3
|
+
import '../../../chunk-ZXCOJY2Z.js';
|
|
4
|
+
import '../../../chunk-XSNLAS5M.js';
|
|
5
|
+
import '../../../chunk-FYQ2UW4T.js';
|
|
6
|
+
import { createConfidentialVestingFactoryAdvancedClient } from '../../../chunk-CMRETRZO.js';
|
|
7
|
+
import '../../../chunk-72YGZEQE.js';
|
|
8
|
+
import '../../../chunk-JFLEEXKP.js';
|
|
9
|
+
import { DEPLOYED_ADDRESSES } from '../../../chunk-COPFW5Z4.js';
|
|
10
|
+
import '../../../chunk-BE2AIZ3K.js';
|
|
11
|
+
import '../../../chunk-Q2GP5UDC.js';
|
|
12
|
+
import '../../../chunk-KWFFIJYX.js';
|
|
13
|
+
import '../../../chunk-IVE3QEGD.js';
|
|
14
|
+
import { useRef, useMemo } from 'react';
|
|
15
|
+
import { useQuery } from '@tanstack/react-query';
|
|
16
|
+
import { usePublicClient, useWalletClient } from 'wagmi';
|
|
17
|
+
|
|
18
|
+
function usePredictManagerAddress(args = {}) {
|
|
19
|
+
const {
|
|
20
|
+
token,
|
|
21
|
+
userSalt,
|
|
22
|
+
deployer,
|
|
23
|
+
blockNumber,
|
|
24
|
+
splitEnabled,
|
|
25
|
+
pausableEnabled,
|
|
26
|
+
address,
|
|
27
|
+
chainId,
|
|
28
|
+
publicClient
|
|
29
|
+
} = args;
|
|
30
|
+
const wagmiPublicClient = usePublicClient({ ...chainId !== void 0 ? { chainId } : {} });
|
|
31
|
+
const resolvedPublicClient = publicClient ?? wagmiPublicClient;
|
|
32
|
+
const { data: walletClient } = useWalletClient({
|
|
33
|
+
...chainId !== void 0 ? { chainId } : {}
|
|
34
|
+
});
|
|
35
|
+
const resolvedChainId = chainId ?? resolvedPublicClient?.chain?.id;
|
|
36
|
+
const resolvedAddress = address ?? (resolvedChainId === void 0 ? void 0 : DEPLOYED_ADDRESSES.fheVesting?.confidentialVestingFactory?.[resolvedChainId] ?? void 0);
|
|
37
|
+
useRef(void 0);
|
|
38
|
+
const client = useMemo(() => {
|
|
39
|
+
if (!resolvedPublicClient) return void 0;
|
|
40
|
+
if (!resolvedAddress) return void 0;
|
|
41
|
+
return createConfidentialVestingFactoryAdvancedClient({
|
|
42
|
+
publicClient: resolvedPublicClient,
|
|
43
|
+
...walletClient ? { walletClient } : {},
|
|
44
|
+
address: resolvedAddress,
|
|
45
|
+
...resolvedChainId !== void 0 ? { chainId: resolvedChainId } : {}
|
|
46
|
+
});
|
|
47
|
+
}, [resolvedPublicClient, walletClient, resolvedAddress, resolvedChainId]);
|
|
48
|
+
return useQuery({
|
|
49
|
+
queryKey: buildQueryKey(
|
|
50
|
+
"factory:predictManagerAddress",
|
|
51
|
+
resolvedChainId,
|
|
52
|
+
resolvedAddress,
|
|
53
|
+
token,
|
|
54
|
+
userSalt,
|
|
55
|
+
deployer,
|
|
56
|
+
blockNumber,
|
|
57
|
+
splitEnabled ?? null,
|
|
58
|
+
pausableEnabled ?? null
|
|
59
|
+
),
|
|
60
|
+
queryFn: () => client.predictManagerAddress({
|
|
61
|
+
token,
|
|
62
|
+
userSalt,
|
|
63
|
+
deployer,
|
|
64
|
+
blockNumber,
|
|
65
|
+
...splitEnabled !== void 0 && { splitEnabled },
|
|
66
|
+
...pausableEnabled !== void 0 && { pausableEnabled }
|
|
67
|
+
}),
|
|
68
|
+
enabled: !!client && !!token && !!userSalt && !!deployer && blockNumber !== void 0,
|
|
69
|
+
staleTime: 0
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { usePredictManagerAddress };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address, Hex, PublicClient } from "viem";
|
|
3
|
+
export interface UsePredictManagerAddressArgs {
|
|
4
|
+
token?: Address;
|
|
5
|
+
userSalt?: Hex;
|
|
6
|
+
deployer?: Address;
|
|
7
|
+
blockNumber?: bigint;
|
|
8
|
+
splitEnabled?: boolean;
|
|
9
|
+
pausableEnabled?: boolean;
|
|
10
|
+
/** Override the on-chain factory address. Defaults to {@link DEPLOYED_ADDRESSES}. */
|
|
11
|
+
address?: Address | undefined;
|
|
12
|
+
/** Override the chain id used for default address resolution. Defaults to `usePublicClient().chain?.id`. */
|
|
13
|
+
chainId?: number | undefined;
|
|
14
|
+
/** Override the viem `PublicClient` — bypasses the wagmi context. */
|
|
15
|
+
publicClient?: PublicClient | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Compute the deterministic CREATE2 clone address as the factory would have
|
|
19
|
+
* computed it at `blockNumber`.
|
|
20
|
+
*
|
|
21
|
+
* **Advanced surface — block-dependent.** The factory packs the deployment
|
|
22
|
+
* block number into the clone's immutable args, which feed into
|
|
23
|
+
* `keccak256(initCode)`. Predict at block N and mine at N+1 and you get
|
|
24
|
+
* different addresses. This hook is only useful for:
|
|
25
|
+
* - Historical lookups (verifying a clone deployed at a known past block).
|
|
26
|
+
* - Tightly-coupled same-tx flows (rare).
|
|
27
|
+
*
|
|
28
|
+
* **For the common "deploy a clone and learn its address" flow, prefer
|
|
29
|
+
* `useCreateManagerAndGetAddress`** on the headline React subpath — it parses
|
|
30
|
+
* the address out of the `ManagerCreated` event in the tx receipt without any
|
|
31
|
+
* block-number guessing.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* import { usePredictManagerAddress } from "@tokenops/sdk/fhe-vesting/advanced/react";
|
|
35
|
+
*
|
|
36
|
+
* // Historical lookup
|
|
37
|
+
* const { data: predictedAddress } = usePredictManagerAddress({
|
|
38
|
+
* token, userSalt, deployer, blockNumber: 10_852_182n,
|
|
39
|
+
* });
|
|
40
|
+
*/
|
|
41
|
+
export declare function usePredictManagerAddress(args?: UsePredictManagerAddressArgs): UseQueryResult<Address, Error>;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { EncryptedInput, EncryptedInputs } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* FHE input values, discriminated by ciphertext type. Mirrors the shape of
|
|
5
|
+
* `EncryptInput` from `@zama-fhe/sdk` so that a `RelayerWeb` / `RelayerNode`
|
|
6
|
+
* / `MockFhevmInstance` instance is structurally assignable to {@link Encryptor}
|
|
7
|
+
* without casting. We restate it here instead of importing from the optional
|
|
8
|
+
* `@zama-fhe/sdk` peer dep.
|
|
9
|
+
*/
|
|
10
|
+
export type FheValueInput = {
|
|
11
|
+
value: boolean | bigint;
|
|
12
|
+
type: "ebool";
|
|
13
|
+
} | {
|
|
14
|
+
value: Address;
|
|
15
|
+
type: "eaddress";
|
|
16
|
+
} | {
|
|
17
|
+
value: bigint;
|
|
18
|
+
type: "euint8" | "euint16" | "euint32" | "euint64" | "euint128" | "euint160" | "euint256" | "ebytes64" | "ebytes128" | "ebytes256";
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Subset of `@zama-fhe/sdk` `RelayerSDK` we depend on. Declared structurally so
|
|
22
|
+
* consumers can pass any v3 RelayerSDK (`RelayerWeb`, `RelayerNode`, or a mock
|
|
23
|
+
* like `MockFhevmInstance`) without us importing the optional peer dep.
|
|
24
|
+
*
|
|
25
|
+
* The `values` shape matches Zama's `EncryptInput` discriminated union, so
|
|
26
|
+
* `relayer` instances satisfy this interface directly — no cast needed.
|
|
27
|
+
*/
|
|
28
|
+
export interface Encryptor {
|
|
29
|
+
encrypt(params: {
|
|
30
|
+
values: FheValueInput[];
|
|
31
|
+
contractAddress: Address;
|
|
32
|
+
userAddress: Address;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
handles: Uint8Array[];
|
|
35
|
+
inputProof: Uint8Array;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Eager or lazy {@link Encryptor} reference. The lazy form (`() => Encryptor | undefined`)
|
|
40
|
+
* is for hosts where the encryptor instance lives in a context whose lifetime
|
|
41
|
+
* doesn't match the SDK client's — React contexts, Vue refs, signals, etc. The
|
|
42
|
+
* factory is invoked per-encryption, so the client always picks up the live
|
|
43
|
+
* instance without needing to be reconstructed when the host swaps it.
|
|
44
|
+
*
|
|
45
|
+
* Server-side and test code where the encryptor is built once at startup can
|
|
46
|
+
* keep passing an {@link Encryptor} directly; the union accepts both shapes.
|
|
47
|
+
*/
|
|
48
|
+
export type EncryptorSource = Encryptor | (() => Encryptor | undefined);
|
|
49
|
+
/**
|
|
50
|
+
* Normalize an {@link EncryptorSource} to the underlying {@link Encryptor}, invoking the factory if lazy.
|
|
51
|
+
*
|
|
52
|
+
* @param source Eager encryptor instance or a lazy factory that returns one.
|
|
53
|
+
* @returns The resolved {@link Encryptor}, or `undefined` if `source` is `undefined` or the factory returned `undefined`.
|
|
54
|
+
* @example
|
|
55
|
+
* // Server / test — eager instance
|
|
56
|
+
* const encryptor = new RelayerNode({ transports: { ... }, getChainId: async () => sepolia.id });
|
|
57
|
+
* const resolved = resolveEncryptor(encryptor); // returns encryptor directly
|
|
58
|
+
*
|
|
59
|
+
* // React — lazy factory picks up the live ZamaSDK context
|
|
60
|
+
* const zamaSDK = useZamaSDK();
|
|
61
|
+
* const resolved = resolveEncryptor(() => zamaSDK.relayer);
|
|
62
|
+
*/
|
|
63
|
+
export declare function resolveEncryptor(source: EncryptorSource | undefined): Encryptor | undefined;
|
|
64
|
+
export interface EncryptUint64Args {
|
|
65
|
+
encryptor: Encryptor;
|
|
66
|
+
contractAddress: Address;
|
|
67
|
+
userAddress: Address;
|
|
68
|
+
value: bigint;
|
|
69
|
+
}
|
|
70
|
+
export interface EncryptUint64BatchArgs {
|
|
71
|
+
encryptor: Encryptor;
|
|
72
|
+
contractAddress: Address;
|
|
73
|
+
userAddress: Address;
|
|
74
|
+
values: bigint[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Encrypt a single `uint64` value into an `externalEuint64` handle + KMS input proof.
|
|
78
|
+
*
|
|
79
|
+
* The handle and proof are bound to `contractAddress` and `userAddress` — they
|
|
80
|
+
* cannot be replayed against a different contract or sender.
|
|
81
|
+
*
|
|
82
|
+
* @param args Encryption request; `value` must fit in `uint64` (0 to 2^64-1).
|
|
83
|
+
* @returns `{ handle: Hex, inputProof: Hex }` — pass both to the contract.
|
|
84
|
+
* @example
|
|
85
|
+
* const encrypted = await encryptUint64({
|
|
86
|
+
* encryptor, contractAddress: managerAddress,
|
|
87
|
+
* userAddress: account.address, value: 1_000_000n,
|
|
88
|
+
* });
|
|
89
|
+
*/
|
|
90
|
+
export declare function encryptUint64({ encryptor, contractAddress, userAddress, value, }: EncryptUint64Args): Promise<EncryptedInput>;
|
|
91
|
+
/**
|
|
92
|
+
* Encrypt N `uint64` values into N handles bound by a single input proof.
|
|
93
|
+
*
|
|
94
|
+
* Using a batch is more gas-efficient than N separate `encryptUint64` calls because
|
|
95
|
+
* the prover generates one proof for the entire set.
|
|
96
|
+
*
|
|
97
|
+
* @returns `{ handles: Hex[], inputProof: Hex }` — `handles[i]` corresponds to `values[i]`.
|
|
98
|
+
* @example
|
|
99
|
+
* const { handles, inputProof } = await encryptUint64Batch({
|
|
100
|
+
* encryptor, contractAddress, userAddress,
|
|
101
|
+
* values: [100_000n, 200_000n],
|
|
102
|
+
* });
|
|
103
|
+
*/
|
|
104
|
+
export declare function encryptUint64Batch({ encryptor, contractAddress, userAddress, values, }: EncryptUint64BatchArgs): Promise<EncryptedInputs>;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { Address, Hex } from "viem";
|
|
2
|
+
import { TokenOpsSdkError } from "../core/errors.js";
|
|
3
|
+
import type { RevertNameMapper } from "../core/revert-mapper.js";
|
|
4
|
+
/** Vesting schedule with this ID does not exist. */
|
|
5
|
+
export declare class VestingNotFoundError extends TokenOpsSdkError {
|
|
6
|
+
readonly name = "VestingNotFoundError";
|
|
7
|
+
readonly context: {
|
|
8
|
+
method: string;
|
|
9
|
+
contractAddress: Address;
|
|
10
|
+
vestingId: Hex;
|
|
11
|
+
};
|
|
12
|
+
constructor(args: {
|
|
13
|
+
method: string;
|
|
14
|
+
contractAddress: Address;
|
|
15
|
+
vestingId: Hex;
|
|
16
|
+
cause?: unknown;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/** Caller is not the recipient of this vesting schedule. */
|
|
20
|
+
export declare class NotVestingRecipientError extends TokenOpsSdkError {
|
|
21
|
+
readonly name = "NotVestingRecipientError";
|
|
22
|
+
readonly context: {
|
|
23
|
+
method: string;
|
|
24
|
+
contractAddress: Address;
|
|
25
|
+
vestingId: Hex;
|
|
26
|
+
caller?: Address;
|
|
27
|
+
expectedRecipient?: Address;
|
|
28
|
+
};
|
|
29
|
+
constructor(args: {
|
|
30
|
+
method: string;
|
|
31
|
+
contractAddress: Address;
|
|
32
|
+
vestingId: Hex;
|
|
33
|
+
caller?: Address;
|
|
34
|
+
expectedRecipient?: Address;
|
|
35
|
+
cause?: unknown;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Vesting has a timelock and the current block timestamp has not yet reached
|
|
40
|
+
* it. `unlocksAt` is populated when the SDK has read the vesting info; UIs can
|
|
41
|
+
* render a countdown.
|
|
42
|
+
*/
|
|
43
|
+
export declare class ClaimLockedError extends TokenOpsSdkError {
|
|
44
|
+
readonly name = "ClaimLockedError";
|
|
45
|
+
readonly context: {
|
|
46
|
+
method: string;
|
|
47
|
+
contractAddress: Address;
|
|
48
|
+
vestingId: Hex;
|
|
49
|
+
/** Unix seconds. Multiply by 1000 for `new Date(...)`. */
|
|
50
|
+
unlocksAt?: number;
|
|
51
|
+
};
|
|
52
|
+
constructor(args: {
|
|
53
|
+
method: string;
|
|
54
|
+
contractAddress: Address;
|
|
55
|
+
vestingId: Hex;
|
|
56
|
+
unlocksAt?: number;
|
|
57
|
+
cause?: unknown;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** Vesting has already been revoked. `revokedAt` is in unix seconds. */
|
|
61
|
+
export declare class VestingRevokedError extends TokenOpsSdkError {
|
|
62
|
+
readonly name = "VestingRevokedError";
|
|
63
|
+
readonly context: {
|
|
64
|
+
method: string;
|
|
65
|
+
contractAddress: Address;
|
|
66
|
+
vestingId: Hex;
|
|
67
|
+
/** Unix seconds. Multiply by 1000 for `new Date(...)`. */
|
|
68
|
+
revokedAt?: number;
|
|
69
|
+
};
|
|
70
|
+
constructor(args: {
|
|
71
|
+
method: string;
|
|
72
|
+
contractAddress: Address;
|
|
73
|
+
vestingId: Hex;
|
|
74
|
+
revokedAt?: number;
|
|
75
|
+
cause?: unknown;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/** Vesting was created with `isRevocable: false` and cannot be revoked. */
|
|
79
|
+
export declare class VestingNotRevocableError extends TokenOpsSdkError {
|
|
80
|
+
readonly name = "VestingNotRevocableError";
|
|
81
|
+
readonly context: {
|
|
82
|
+
method: string;
|
|
83
|
+
contractAddress: Address;
|
|
84
|
+
vestingId: Hex;
|
|
85
|
+
};
|
|
86
|
+
constructor(args: {
|
|
87
|
+
method: string;
|
|
88
|
+
contractAddress: Address;
|
|
89
|
+
vestingId: Hex;
|
|
90
|
+
cause?: unknown;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/** Vesting has ended (`block.timestamp > endTimestamp`); admin actions like revoke are no longer valid. */
|
|
94
|
+
export declare class VestingExpiredError extends TokenOpsSdkError {
|
|
95
|
+
readonly name = "VestingExpiredError";
|
|
96
|
+
readonly context: {
|
|
97
|
+
method: string;
|
|
98
|
+
contractAddress: Address;
|
|
99
|
+
vestingId: Hex;
|
|
100
|
+
/** Unix seconds. Multiply by 1000 for `new Date(...)`. */
|
|
101
|
+
endedAt?: number;
|
|
102
|
+
};
|
|
103
|
+
constructor(args: {
|
|
104
|
+
method: string;
|
|
105
|
+
contractAddress: Address;
|
|
106
|
+
vestingId: Hex;
|
|
107
|
+
endedAt?: number;
|
|
108
|
+
cause?: unknown;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/** A vesting transfer is already pending — initiate fails until accepted/cancelled/expired. */
|
|
112
|
+
export declare class TransferAlreadyPendingError extends TokenOpsSdkError {
|
|
113
|
+
readonly name = "TransferAlreadyPendingError";
|
|
114
|
+
readonly context: {
|
|
115
|
+
method: string;
|
|
116
|
+
contractAddress: Address;
|
|
117
|
+
vestingId: Hex;
|
|
118
|
+
pendingRecipient?: Address;
|
|
119
|
+
/** Unix seconds. Multiply by 1000 for `new Date(...)`. */
|
|
120
|
+
expiresAt?: number;
|
|
121
|
+
};
|
|
122
|
+
constructor(args: {
|
|
123
|
+
method: string;
|
|
124
|
+
contractAddress: Address;
|
|
125
|
+
vestingId: Hex;
|
|
126
|
+
pendingRecipient?: Address;
|
|
127
|
+
expiresAt?: number;
|
|
128
|
+
cause?: unknown;
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/** No pending transfer exists — cancel/accept fails until one is initiated. */
|
|
132
|
+
export declare class NoPendingTransferError extends TokenOpsSdkError {
|
|
133
|
+
readonly name = "NoPendingTransferError";
|
|
134
|
+
readonly context: {
|
|
135
|
+
method: string;
|
|
136
|
+
contractAddress: Address;
|
|
137
|
+
vestingId: Hex;
|
|
138
|
+
};
|
|
139
|
+
constructor(args: {
|
|
140
|
+
method: string;
|
|
141
|
+
contractAddress: Address;
|
|
142
|
+
vestingId: Hex;
|
|
143
|
+
cause?: unknown;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/** Caller is not the pending recipient of this transfer. */
|
|
147
|
+
export declare class NotPendingRecipientError extends TokenOpsSdkError {
|
|
148
|
+
readonly name = "NotPendingRecipientError";
|
|
149
|
+
readonly context: {
|
|
150
|
+
method: string;
|
|
151
|
+
contractAddress: Address;
|
|
152
|
+
vestingId: Hex;
|
|
153
|
+
caller?: Address;
|
|
154
|
+
expectedRecipient?: Address;
|
|
155
|
+
};
|
|
156
|
+
constructor(args: {
|
|
157
|
+
method: string;
|
|
158
|
+
contractAddress: Address;
|
|
159
|
+
vestingId: Hex;
|
|
160
|
+
caller?: Address;
|
|
161
|
+
expectedRecipient?: Address;
|
|
162
|
+
cause?: unknown;
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/** Pending transfer has expired and can no longer be accepted. */
|
|
166
|
+
export declare class TransferExpiredError extends TokenOpsSdkError {
|
|
167
|
+
readonly name = "TransferExpiredError";
|
|
168
|
+
readonly context: {
|
|
169
|
+
method: string;
|
|
170
|
+
contractAddress: Address;
|
|
171
|
+
vestingId: Hex;
|
|
172
|
+
/** Unix seconds. Multiply by 1000 for `new Date(...)`. */
|
|
173
|
+
expiredAt?: number;
|
|
174
|
+
};
|
|
175
|
+
constructor(args: {
|
|
176
|
+
method: string;
|
|
177
|
+
contractAddress: Address;
|
|
178
|
+
vestingId: Hex;
|
|
179
|
+
expiredAt?: number;
|
|
180
|
+
cause?: unknown;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
export declare const vestingProductMapper: RevertNameMapper;
|