@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,53 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import { ConfidentialAirdropFactoryClient, type ConfidentialAirdropFactoryClientConfig, type PredictAirdropArgs } from "../factory.js";
|
|
3
|
+
/**
|
|
4
|
+
* Advanced extension of {@link ConfidentialAirdropFactoryClient} 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): 90 % of consumers want one call back — `createConfidentialAirdrop`
|
|
9
|
+
* (rich-return, `{ hash, airdrop }`). The factory still emits
|
|
10
|
+
* `ConfidentialAirdropCreated`, the SDK still parses it, so consumers never
|
|
11
|
+
* need to ask "what address will this deploy to before mining?" Hoisting
|
|
12
|
+
* `predictAirdropAddress` onto the headline client surface gave consumers a
|
|
13
|
+
* footgun: pass the wrong `gasFee` and you predict an address that won't
|
|
14
|
+
* match the deployed clone.
|
|
15
|
+
*
|
|
16
|
+
* For the genuinely-advanced cases — historical address recovery, same-tx
|
|
17
|
+
* pre-confirmation flows — import this subclass from `@tokenops/sdk/fhe-airdrop/advanced`
|
|
18
|
+
* and call it explicitly. The headline factory does not include this method.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* import { createConfidentialAirdropFactoryAdvancedClient } from "@tokenops/sdk/fhe-airdrop/advanced";
|
|
22
|
+
*
|
|
23
|
+
* const factory = createConfidentialAirdropFactoryAdvancedClient({ publicClient });
|
|
24
|
+
* const predicted = await factory.predictAirdropAddress({
|
|
25
|
+
* params, userSalt, deployer, gasFee: customGasFee,
|
|
26
|
+
* });
|
|
27
|
+
*/
|
|
28
|
+
export declare class ConfidentialAirdropFactoryAdvancedClient extends ConfidentialAirdropFactoryClient {
|
|
29
|
+
/**
|
|
30
|
+
* Compute the deterministic CREATE2 address for an airdrop clone without
|
|
31
|
+
* deploying it.
|
|
32
|
+
*
|
|
33
|
+
* Note: `gasFee` must match what the factory would charge the deployer at
|
|
34
|
+
* deploy time (custom fee if set, otherwise `defaultGasFee`). Use
|
|
35
|
+
* `getCustomFee(deployer)` and `defaultGasFee()` to resolve it correctly —
|
|
36
|
+
* a mismatch silently targets the wrong address.
|
|
37
|
+
*
|
|
38
|
+
* For the common "deploy a clone and learn its address" flow, use the
|
|
39
|
+
* headline `factory.createConfidentialAirdrop` instead — it parses the
|
|
40
|
+
* address from the tx receipt's `ConfidentialAirdropCreated` event without
|
|
41
|
+
* any `gasFee` guessing.
|
|
42
|
+
*/
|
|
43
|
+
predictAirdropAddress(args: PredictAirdropArgs): Promise<Address>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create a {@link ConfidentialAirdropFactoryAdvancedClient}. Mirrors viem's
|
|
47
|
+
* `create*` convention.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* const factory = createConfidentialAirdropFactoryAdvancedClient({ publicClient, walletClient, encryptor });
|
|
51
|
+
* const predicted = await factory.predictAirdropAddress({ params, userSalt, deployer, gasFee });
|
|
52
|
+
*/
|
|
53
|
+
export declare function createConfidentialAirdropFactoryAdvancedClient(config: ConfidentialAirdropFactoryClientConfig): ConfidentialAirdropFactoryAdvancedClient;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkT5LVV3KY_cjs = require('../../chunk-T5LVV3KY.cjs');
|
|
4
|
+
require('../../chunk-6ECAHP5O.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, "ConfidentialAirdropFactoryAdvancedClient", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return chunkT5LVV3KY_cjs.ConfidentialAirdropFactoryAdvancedClient; }
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "createConfidentialAirdropFactoryAdvancedClient", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return chunkT5LVV3KY_cjs.createConfidentialAirdropFactoryAdvancedClient; }
|
|
21
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advanced FHE-airdrop 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 ConfidentialAirdropFactoryAdvancedClient} subclass,
|
|
6
|
+
* which extends the headline factory client with `predictAirdropAddress`. Use
|
|
7
|
+
* this subpath when you genuinely need to compute a clone address before
|
|
8
|
+
* deploying — historical recovery, deterministic same-tx flows. For the
|
|
9
|
+
* common "deploy and learn the address" case, the headline factory's
|
|
10
|
+
* `createConfidentialAirdrop` returns `{ hash, airdrop }` directly (R02 ADR P-1).
|
|
11
|
+
*/
|
|
12
|
+
export { ConfidentialAirdropFactoryAdvancedClient, createConfidentialAirdropFactoryAdvancedClient, } from "./factory-advanced.js";
|
|
13
|
+
export type { PredictAirdropArgs } from "../factory.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advanced FHE-airdrop 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 ConfidentialAirdropFactoryAdvancedClient} subclass,
|
|
6
|
+
* which extends the headline factory client with `predictAirdropAddress`. Use
|
|
7
|
+
* this subpath when you genuinely need to compute a clone address before
|
|
8
|
+
* deploying — historical recovery, deterministic same-tx flows. For the
|
|
9
|
+
* common "deploy and learn the address" case, the headline factory's
|
|
10
|
+
* `createConfidentialAirdrop` returns `{ hash, airdrop }` directly (R02 ADR P-1).
|
|
11
|
+
*/
|
|
12
|
+
export { ConfidentialAirdropFactoryAdvancedClient, createConfidentialAirdropFactoryAdvancedClient, } from "./factory-advanced.js";
|
|
13
|
+
export type { PredictAirdropArgs } from "../factory.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ConfidentialAirdropFactoryAdvancedClient, createConfidentialAirdropFactoryAdvancedClient } from '../../chunk-ZHFLRKFY.js';
|
|
2
|
+
import '../../chunk-UOG4PJL5.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,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkK6MFFDBJ_cjs = require('../../../chunk-K6MFFDBJ.cjs');
|
|
4
|
+
require('../../../chunk-5SA2HF2W.cjs');
|
|
5
|
+
var chunkT5LVV3KY_cjs = require('../../../chunk-T5LVV3KY.cjs');
|
|
6
|
+
var chunk6ECAHP5O_cjs = require('../../../chunk-6ECAHP5O.cjs');
|
|
7
|
+
require('../../../chunk-Q7ARQSUH.cjs');
|
|
8
|
+
require('../../../chunk-VDXVNZCO.cjs');
|
|
9
|
+
var chunkOLDGMKW2_cjs = require('../../../chunk-OLDGMKW2.cjs');
|
|
10
|
+
require('../../../chunk-CQIPRNS7.cjs');
|
|
11
|
+
require('../../../chunk-VJKZWYYJ.cjs');
|
|
12
|
+
require('../../../chunk-66IHPTOK.cjs');
|
|
13
|
+
require('../../../chunk-56UI7LUR.cjs');
|
|
14
|
+
var react = require('react');
|
|
15
|
+
var reactQuery = require('@tanstack/react-query');
|
|
16
|
+
var wagmi = require('wagmi');
|
|
17
|
+
|
|
18
|
+
function usePredictAirdropAddress(args = {}) {
|
|
19
|
+
const { params, userSalt, deployer, gasFee, address, chainId, publicClient, encryptor } = args;
|
|
20
|
+
const wagmiPublicClient = wagmi.usePublicClient({ ...chainId !== void 0 ? { chainId } : {} });
|
|
21
|
+
const resolvedPublicClient = publicClient ?? wagmiPublicClient;
|
|
22
|
+
const { data: walletClient } = wagmi.useWalletClient({
|
|
23
|
+
...chainId !== void 0 ? { chainId } : {}
|
|
24
|
+
});
|
|
25
|
+
const resolvedChainId = chainId ?? resolvedPublicClient?.chain?.id;
|
|
26
|
+
const resolvedAddress = address ?? (resolvedChainId === void 0 ? void 0 : chunkOLDGMKW2_cjs.DEPLOYED_ADDRESSES.fheAirdrop?.confidentialAirdropFactory?.[resolvedChainId] ?? void 0);
|
|
27
|
+
const encryptorSourceRef = react.useRef(encryptor);
|
|
28
|
+
encryptorSourceRef.current = encryptor;
|
|
29
|
+
const client = react.useMemo(() => {
|
|
30
|
+
if (!resolvedPublicClient) return void 0;
|
|
31
|
+
if (!resolvedAddress) return void 0;
|
|
32
|
+
return chunkT5LVV3KY_cjs.createConfidentialAirdropFactoryAdvancedClient({
|
|
33
|
+
publicClient: resolvedPublicClient,
|
|
34
|
+
...walletClient ? { walletClient } : {},
|
|
35
|
+
address: resolvedAddress,
|
|
36
|
+
...resolvedChainId !== void 0 ? { chainId: resolvedChainId } : {},
|
|
37
|
+
encryptor: () => chunk6ECAHP5O_cjs.resolveEncryptor(encryptorSourceRef.current)
|
|
38
|
+
});
|
|
39
|
+
}, [resolvedPublicClient, walletClient, resolvedAddress, resolvedChainId]);
|
|
40
|
+
return reactQuery.useQuery({
|
|
41
|
+
queryKey: chunkK6MFFDBJ_cjs.buildQueryKey(
|
|
42
|
+
"factory:predictAirdropAddress",
|
|
43
|
+
resolvedChainId,
|
|
44
|
+
resolvedAddress,
|
|
45
|
+
params,
|
|
46
|
+
userSalt,
|
|
47
|
+
deployer,
|
|
48
|
+
gasFee
|
|
49
|
+
),
|
|
50
|
+
queryFn: () => client.predictAirdropAddress({
|
|
51
|
+
params,
|
|
52
|
+
userSalt,
|
|
53
|
+
deployer,
|
|
54
|
+
gasFee
|
|
55
|
+
}),
|
|
56
|
+
enabled: !!client && !!params && !!userSalt && !!deployer && gasFee !== void 0,
|
|
57
|
+
staleTime: 0
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
exports.usePredictAirdropAddress = usePredictAirdropAddress;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React hooks for `@tokenops/sdk/fhe-airdrop/advanced`. The headline React
|
|
3
|
+
* subpath stays lean; pre-mine address prediction lives here per R02 ADR P-2.
|
|
4
|
+
*/
|
|
5
|
+
export { usePredictAirdropAddress, type UsePredictAirdropAddressArgs, } from "./usePredictAirdropAddress.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React hooks for `@tokenops/sdk/fhe-airdrop/advanced`. The headline React
|
|
3
|
+
* subpath stays lean; pre-mine address prediction lives here per R02 ADR P-2.
|
|
4
|
+
*/
|
|
5
|
+
export { usePredictAirdropAddress, type UsePredictAirdropAddressArgs, } from "./usePredictAirdropAddress.js";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { buildQueryKey } from '../../../chunk-HGXNRR25.js';
|
|
2
|
+
import '../../../chunk-XXXDQSHE.js';
|
|
3
|
+
import { createConfidentialAirdropFactoryAdvancedClient } from '../../../chunk-ZHFLRKFY.js';
|
|
4
|
+
import { resolveEncryptor } from '../../../chunk-UOG4PJL5.js';
|
|
5
|
+
import '../../../chunk-FYQ2UW4T.js';
|
|
6
|
+
import '../../../chunk-JFLEEXKP.js';
|
|
7
|
+
import { DEPLOYED_ADDRESSES } from '../../../chunk-COPFW5Z4.js';
|
|
8
|
+
import '../../../chunk-BE2AIZ3K.js';
|
|
9
|
+
import '../../../chunk-Q2GP5UDC.js';
|
|
10
|
+
import '../../../chunk-KWFFIJYX.js';
|
|
11
|
+
import '../../../chunk-IVE3QEGD.js';
|
|
12
|
+
import { useRef, useMemo } from 'react';
|
|
13
|
+
import { useQuery } from '@tanstack/react-query';
|
|
14
|
+
import { usePublicClient, useWalletClient } from 'wagmi';
|
|
15
|
+
|
|
16
|
+
function usePredictAirdropAddress(args = {}) {
|
|
17
|
+
const { params, userSalt, deployer, gasFee, address, chainId, publicClient, encryptor } = args;
|
|
18
|
+
const wagmiPublicClient = usePublicClient({ ...chainId !== void 0 ? { chainId } : {} });
|
|
19
|
+
const resolvedPublicClient = publicClient ?? wagmiPublicClient;
|
|
20
|
+
const { data: walletClient } = useWalletClient({
|
|
21
|
+
...chainId !== void 0 ? { chainId } : {}
|
|
22
|
+
});
|
|
23
|
+
const resolvedChainId = chainId ?? resolvedPublicClient?.chain?.id;
|
|
24
|
+
const resolvedAddress = address ?? (resolvedChainId === void 0 ? void 0 : DEPLOYED_ADDRESSES.fheAirdrop?.confidentialAirdropFactory?.[resolvedChainId] ?? void 0);
|
|
25
|
+
const encryptorSourceRef = useRef(encryptor);
|
|
26
|
+
encryptorSourceRef.current = encryptor;
|
|
27
|
+
const client = useMemo(() => {
|
|
28
|
+
if (!resolvedPublicClient) return void 0;
|
|
29
|
+
if (!resolvedAddress) return void 0;
|
|
30
|
+
return createConfidentialAirdropFactoryAdvancedClient({
|
|
31
|
+
publicClient: resolvedPublicClient,
|
|
32
|
+
...walletClient ? { walletClient } : {},
|
|
33
|
+
address: resolvedAddress,
|
|
34
|
+
...resolvedChainId !== void 0 ? { chainId: resolvedChainId } : {},
|
|
35
|
+
encryptor: () => resolveEncryptor(encryptorSourceRef.current)
|
|
36
|
+
});
|
|
37
|
+
}, [resolvedPublicClient, walletClient, resolvedAddress, resolvedChainId]);
|
|
38
|
+
return useQuery({
|
|
39
|
+
queryKey: buildQueryKey(
|
|
40
|
+
"factory:predictAirdropAddress",
|
|
41
|
+
resolvedChainId,
|
|
42
|
+
resolvedAddress,
|
|
43
|
+
params,
|
|
44
|
+
userSalt,
|
|
45
|
+
deployer,
|
|
46
|
+
gasFee
|
|
47
|
+
),
|
|
48
|
+
queryFn: () => client.predictAirdropAddress({
|
|
49
|
+
params,
|
|
50
|
+
userSalt,
|
|
51
|
+
deployer,
|
|
52
|
+
gasFee
|
|
53
|
+
}),
|
|
54
|
+
enabled: !!client && !!params && !!userSalt && !!deployer && gasFee !== void 0,
|
|
55
|
+
staleTime: 0
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { usePredictAirdropAddress };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address, Hex, PublicClient } from "viem";
|
|
3
|
+
import { type EncryptorSource } from "../../encryption.js";
|
|
4
|
+
import { type AirdropParams } from "../../types.js";
|
|
5
|
+
export interface UsePredictAirdropAddressArgs {
|
|
6
|
+
params?: AirdropParams;
|
|
7
|
+
userSalt?: Hex;
|
|
8
|
+
deployer?: Address;
|
|
9
|
+
/**
|
|
10
|
+
* Gas fee in wei to embed into the CREATE2 salt computation. Must match the
|
|
11
|
+
* fee that will be (or was) active for `deployer` at deploy time:
|
|
12
|
+
* custom fee if `getCustomFee(deployer).enabled`, otherwise `defaultGasFee`.
|
|
13
|
+
*
|
|
14
|
+
* Passing the wrong value produces a different address than the deployed
|
|
15
|
+
* clone — use `useAirdropFactoryCustomFee` and `useAirdropFactoryDefaultGasFee`
|
|
16
|
+
* from the headline `@tokenops/sdk/fhe-airdrop/react` subpath to resolve it
|
|
17
|
+
* correctly.
|
|
18
|
+
*/
|
|
19
|
+
gasFee?: bigint;
|
|
20
|
+
/** Override the on-chain factory address. Defaults to {@link DEPLOYED_ADDRESSES}. */
|
|
21
|
+
address?: Address | undefined;
|
|
22
|
+
/** Override the chain id used for default address resolution. Defaults to `usePublicClient().chain?.id`. */
|
|
23
|
+
chainId?: number | undefined;
|
|
24
|
+
/** Override the viem `PublicClient` — bypasses the wagmi context. */
|
|
25
|
+
publicClient?: PublicClient | undefined;
|
|
26
|
+
/** Lazy or eager encryptor source. Not required for predict reads, accepted for client-construction symmetry. */
|
|
27
|
+
encryptor?: EncryptorSource;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Compute the deterministic CREATE2 address the factory would produce for an
|
|
31
|
+
* airdrop clone without deploying it.
|
|
32
|
+
*
|
|
33
|
+
* **Advanced surface.** This hook lives on the advanced subpath because the
|
|
34
|
+
* common "deploy and learn the address" flow is better served by
|
|
35
|
+
* `useCreateConfidentialAirdropAndGetAddress` on the headline React subpath —
|
|
36
|
+
* which parses the address from the `ConfidentialAirdropCreated` event and
|
|
37
|
+
* never has to guess the `gasFee` that was active at deploy time.
|
|
38
|
+
*
|
|
39
|
+
* The hook is disabled until all four of `params`, `userSalt`, `deployer`, and
|
|
40
|
+
* `gasFee` are set.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* import { usePredictAirdropAddress } from "@tokenops/sdk/fhe-airdrop/advanced/react";
|
|
44
|
+
*
|
|
45
|
+
* const { data: predictedAddress } = usePredictAirdropAddress({
|
|
46
|
+
* params, userSalt, deployer, gasFee: defaultGasFee,
|
|
47
|
+
* });
|
|
48
|
+
*/
|
|
49
|
+
export declare function usePredictAirdropAddress(args?: UsePredictAirdropAddressArgs): UseQueryResult<Address, Error>;
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import type { Account, Address, Hex, PublicClient, WalletClient } from "viem";
|
|
2
|
+
import type { EncryptedHandle, Role, TxHash } from "../core/brands.js";
|
|
3
|
+
import { type PreflightResult } from "../core/preflight.js";
|
|
4
|
+
import { type SdkTelemetry } from "../core/telemetry.js";
|
|
5
|
+
import type { EncryptedInput, EncryptedViewResult } from "./types.js";
|
|
6
|
+
export type { EncryptedViewResult } from "./types.js";
|
|
7
|
+
export interface ConfidentialAirdropClientConfig {
|
|
8
|
+
publicClient: PublicClient;
|
|
9
|
+
walletClient?: WalletClient | undefined;
|
|
10
|
+
/** Deployed airdrop clone address. */
|
|
11
|
+
address: Address;
|
|
12
|
+
/**
|
|
13
|
+
* FHEVM ACL contract address override. When omitted, resolved from
|
|
14
|
+
* `publicClient.chain?.id` via the SDK's chain registry; the constructor
|
|
15
|
+
* throws `DeploymentAddressUnavailableError` if neither is available.
|
|
16
|
+
* Required because `getClaimAmount` filters the receipt for ACL grants
|
|
17
|
+
* to extract the returned handle.
|
|
18
|
+
*/
|
|
19
|
+
aclAddress?: Address | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Optional telemetry sink. When provided, the SDK emits a `fhe-airdrop.client.init`
|
|
22
|
+
* event on construction and brackets public write methods with named spans
|
|
23
|
+
* (`fhe-airdrop.client.claim`, `…getClaimAmount`, …). Defaults to a no-op —
|
|
24
|
+
* zero overhead, zero leakage of consumer-side identifiers.
|
|
25
|
+
*
|
|
26
|
+
* The shape is structurally compatible with `NoopTelemetry` / `ConsoleTelemetry` /
|
|
27
|
+
* `TokenOpsTelemetry` exported from `@tokenops/sdk/telemetry`.
|
|
28
|
+
*/
|
|
29
|
+
telemetry?: SdkTelemetry | undefined;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Args for `claim()` / `getClaimAmount()`.
|
|
33
|
+
*
|
|
34
|
+
* The admin produces `{ encryptedInput, signature }` off-chain (typically
|
|
35
|
+
* server-side) by encrypting the allocation with `userAddress: recipient`
|
|
36
|
+
* (the Zama input proof MUST be bound to the recipient — the contract's
|
|
37
|
+
* `FHE.fromExternal` rejects proofs bound to any other address) and then
|
|
38
|
+
* signing the resulting handle with {@link signClaimAuthorization}. The
|
|
39
|
+
* recipient submits exactly that pair — the SDK does not re-encrypt.
|
|
40
|
+
*
|
|
41
|
+
* The signature commits to a specific `bytes32` handle via EIP-712, so
|
|
42
|
+
* re-encrypting the same plaintext locally would produce a different handle
|
|
43
|
+
* and the signature would no longer match. That is why `encryptedInput` is
|
|
44
|
+
* required and there is no plaintext `amount` field on this type.
|
|
45
|
+
*/
|
|
46
|
+
export interface ClaimArgs {
|
|
47
|
+
/** Pre-encrypted external `euint64` input — must match the handle the admin signed. */
|
|
48
|
+
encryptedInput: EncryptedInput;
|
|
49
|
+
/** EIP-712 signature from an address with DEFAULT_ADMIN_ROLE on this clone. */
|
|
50
|
+
signature: Hex;
|
|
51
|
+
/**
|
|
52
|
+
* ETH value (in wei) to attach as `msg.value`. Defaults to `gasFee()` fetched
|
|
53
|
+
* live if omitted.
|
|
54
|
+
*
|
|
55
|
+
* Pre-fetch and cache with `await airdrop.gasFee()` when displaying the fee in
|
|
56
|
+
* the UI before the user clicks submit — this avoids an extra RPC round-trip and
|
|
57
|
+
* lets you present the exact cost upfront.
|
|
58
|
+
*/
|
|
59
|
+
value?: bigint;
|
|
60
|
+
/** Override the submitting account. Defaults to `walletClient.account`. */
|
|
61
|
+
account?: Account | Address;
|
|
62
|
+
}
|
|
63
|
+
/** Args for {@link ConfidentialAirdropClient.getClaimAmount} — same shape as {@link ClaimArgs} minus `value` (the contract is not payable). */
|
|
64
|
+
export interface GetClaimAmountArgs {
|
|
65
|
+
/** Pre-encrypted external `euint64` input — must match the handle the admin signed. */
|
|
66
|
+
encryptedInput: EncryptedInput;
|
|
67
|
+
/** EIP-712 signature from an address with DEFAULT_ADMIN_ROLE on this clone. */
|
|
68
|
+
signature: Hex;
|
|
69
|
+
/** Override the submitting account. Defaults to `walletClient.account`. */
|
|
70
|
+
account?: Account | Address;
|
|
71
|
+
}
|
|
72
|
+
/** Args for {@link ConfidentialAirdropClient.isSignatureValid}. */
|
|
73
|
+
export interface IsSignatureValidArgs {
|
|
74
|
+
/** `externalEuint64` handle bytes32 — the same handle the admin signed. */
|
|
75
|
+
encryptedAmountHandle: Hex;
|
|
76
|
+
/** EIP-712 admin signature over `Claim(address recipient, bytes32 encryptedAmount)`. */
|
|
77
|
+
signature: Hex;
|
|
78
|
+
/**
|
|
79
|
+
* Address the contract will treat as `msg.sender` during the call.
|
|
80
|
+
* The on-chain check recomputes the struct hash over `(msg.sender, encryptedAmount)`,
|
|
81
|
+
* so the result varies per-caller — typically the wallet that intends to claim.
|
|
82
|
+
*/
|
|
83
|
+
caller: Address;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Typed wrapper around a deployed `ConfidentialAirdropCloneable` clone.
|
|
87
|
+
*
|
|
88
|
+
* The admin issues claims by encrypting the allocation **bound to the
|
|
89
|
+
* recipient address** (Zama input proofs are bound to `(contractAddress,
|
|
90
|
+
* userAddress)` — the contract's `FHE.fromExternal` will reject any other
|
|
91
|
+
* binding) and signing the handle. The recipient calls
|
|
92
|
+
* {@link ConfidentialAirdropClient.claim} with exactly that `{ encryptedInput,
|
|
93
|
+
* signature }` pair; the SDK never re-encrypts on the recipient side because
|
|
94
|
+
* the signature commits to a specific handle.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* const airdrop = createConfidentialAirdropClient({
|
|
98
|
+
* publicClient, walletClient,
|
|
99
|
+
* address: airdropAddress,
|
|
100
|
+
* });
|
|
101
|
+
* await airdrop.claim({ encryptedInput, signature });
|
|
102
|
+
*/
|
|
103
|
+
export declare class ConfidentialAirdropClient {
|
|
104
|
+
#private;
|
|
105
|
+
readonly publicClient: PublicClient;
|
|
106
|
+
readonly walletClient?: WalletClient;
|
|
107
|
+
readonly address: Address;
|
|
108
|
+
constructor(config: ConfidentialAirdropClientConfig);
|
|
109
|
+
/**
|
|
110
|
+
* The FHEVM ACL contract address used by encrypted-view methods to parse
|
|
111
|
+
* `ACL.Allowed` events. Resolved lazily on first access; throws
|
|
112
|
+
* `DeploymentAddressUnavailableError` if no override was passed and the
|
|
113
|
+
* SDK does not have an ACL deployed for the connected chain.
|
|
114
|
+
*/
|
|
115
|
+
get aclAddress(): Address;
|
|
116
|
+
/** ERC-7984 confidential token this airdrop was deployed for. Immutable arg. */
|
|
117
|
+
token(): Promise<Address>;
|
|
118
|
+
/** Per-claim gas fee in wei. Immutable arg. Attached as `msg.value` by `claim()` automatically. */
|
|
119
|
+
gasFee(): Promise<bigint>;
|
|
120
|
+
/** Unix timestamp when claims become available. Immutable arg. */
|
|
121
|
+
startTime(): Promise<number>;
|
|
122
|
+
/** Whether the admin can extend the claim window past `endTime`. Immutable arg. */
|
|
123
|
+
canExtendClaimWindow(): Promise<boolean>;
|
|
124
|
+
/** Unix timestamp when claims end. Mutable — can be extended by admin if `canExtendClaimWindow`. */
|
|
125
|
+
endTime(): Promise<number>;
|
|
126
|
+
/** Whether claims are currently paused by the admin. */
|
|
127
|
+
isPaused(): Promise<boolean>;
|
|
128
|
+
/** Block number at which this clone was deployed. */
|
|
129
|
+
deploymentBlockNumber(): Promise<bigint>;
|
|
130
|
+
/**
|
|
131
|
+
* Check whether a pre-computed signature hash has been consumed.
|
|
132
|
+
*
|
|
133
|
+
* The contract keys claim replay-protection on
|
|
134
|
+
* `keccak256(abi.encode(CLAIM_TYPEHASH, recipient, bytes32(encryptedAmountHandle)))`.
|
|
135
|
+
* Use this when you already hold the struct hash (e.g. you computed it server-side
|
|
136
|
+
* while building the claim payload). For the more common case where you hold the
|
|
137
|
+
* user address and the encrypted handle, use {@link isSignatureClaimed} instead —
|
|
138
|
+
* it computes the hash for you.
|
|
139
|
+
*
|
|
140
|
+
* @param signatureHash `bytes32` storage key — the EIP-712 struct hash of the Claim.
|
|
141
|
+
*/
|
|
142
|
+
claimedSignatures(signatureHash: Hex): Promise<boolean>;
|
|
143
|
+
/** `true` if within the claim time window and not paused. Free read — no gas. */
|
|
144
|
+
isClaimWindowActive(): Promise<boolean>;
|
|
145
|
+
/** `true` if the current timestamp is past `START_TIME`. */
|
|
146
|
+
hasClaimStarted(): Promise<boolean>;
|
|
147
|
+
/** `true` if the current timestamp is past `endTime`. */
|
|
148
|
+
hasClaimEnded(): Promise<boolean>;
|
|
149
|
+
/** EIP-712 domain separator for the clone. Useful for off-chain signing tools. */
|
|
150
|
+
domainSeparator(): Promise<Hex>;
|
|
151
|
+
/**
|
|
152
|
+
* EIP-712 type hash for the `Claim(address recipient, bytes32 encryptedAmount)`
|
|
153
|
+
* struct. Off-chain signers that don't use {@link signClaimAuthorization}
|
|
154
|
+
* (e.g. custom HSM-backed signers, ledger flows) need this to assemble the
|
|
155
|
+
* typed-data payload manually.
|
|
156
|
+
*/
|
|
157
|
+
claimTypehash(): Promise<Hex>;
|
|
158
|
+
/**
|
|
159
|
+
* Check whether a claim has been consumed, given the user address and encrypted amount handle.
|
|
160
|
+
*
|
|
161
|
+
* This is the method most frontend developers want. Pass the same `user` and
|
|
162
|
+
* `encryptedAmountHandle` that appear in the admin-issued claim payload; the contract
|
|
163
|
+
* recomputes the struct hash internally and looks it up in storage.
|
|
164
|
+
*
|
|
165
|
+
* Prefer this over {@link claimedSignatures} unless you already hold the pre-computed
|
|
166
|
+
* `bytes32` struct hash (e.g. from a server-side indexer).
|
|
167
|
+
*
|
|
168
|
+
* @param user Recipient address from the claim authorization.
|
|
169
|
+
* @param encryptedAmountHandle The `externalEuint64` handle (as `Hex`) from the claim payload.
|
|
170
|
+
*/
|
|
171
|
+
isSignatureClaimed(user: Address, encryptedAmountHandle: EncryptedHandle): Promise<boolean>;
|
|
172
|
+
/**
|
|
173
|
+
* Check whether an admin-issued claim authorization is valid for a specific caller,
|
|
174
|
+
* without consuming it.
|
|
175
|
+
*
|
|
176
|
+
* Returns `false` (not a revert) when the signature is **structurally valid** but
|
|
177
|
+
* fails one of the on-chain checks: already-claimed, claim window inactive, or the
|
|
178
|
+
* signer lacks `DEFAULT_ADMIN_ROLE`. The on-chain implementation recomputes the
|
|
179
|
+
* EIP-712 struct hash over `(msg.sender, encryptedAmount)`, so the result is
|
|
180
|
+
* caller-specific: a signature issued for recipient A is invalid when checked
|
|
181
|
+
* against caller B. Pass the address that will actually submit the claim.
|
|
182
|
+
*
|
|
183
|
+
* **Throws** {@link InvalidSignatureError} (code `TOKENOPS_INVALID_SIGNATURE`)
|
|
184
|
+
* when the signature bytes are **structurally malformed** — wrong length, invalid
|
|
185
|
+
* `s`-value range, or unparseable. The on-chain `ECDSA.recover` reverts before
|
|
186
|
+
* the boolean logic runs in that case, so consumer code must catch this
|
|
187
|
+
* separately from the `false` return:
|
|
188
|
+
*
|
|
189
|
+
* ```ts
|
|
190
|
+
* try {
|
|
191
|
+
* const ok = await airdrop.isSignatureValid({ encryptedAmountHandle, signature, caller });
|
|
192
|
+
* if (!ok) { /* signed by non-admin, window closed, or already claimed *\/ }
|
|
193
|
+
* } catch (err) {
|
|
194
|
+
* if (err instanceof InvalidSignatureError) { /* malformed signature bytes *\/ }
|
|
195
|
+
* }
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
198
|
+
* Use this to show a pre-claim validation state in the UI before asking the user to
|
|
199
|
+
* pay gas.
|
|
200
|
+
*/
|
|
201
|
+
isSignatureValid(args: IsSignatureValidArgs): Promise<boolean>;
|
|
202
|
+
/**
|
|
203
|
+
* Read-only preflight for {@link claim}. Runs the deterministic-from-off-chain
|
|
204
|
+
* checks in parallel and reports any blockers as typed {@link TokenOpsSdkError}s.
|
|
205
|
+
* Returns `{ ready: true, blockers: [] }` when the claim is safe to submit.
|
|
206
|
+
*
|
|
207
|
+
* Preflight is **opt-in**. Consumers who have already validated state can
|
|
208
|
+
* skip this call and invoke `claim` directly — they'll receive the same
|
|
209
|
+
* typed errors at write time via the revert mapper.
|
|
210
|
+
*
|
|
211
|
+
* Checks performed (all read-only, no gas):
|
|
212
|
+
* - Claim window started (`block.timestamp ≥ START_TIME`).
|
|
213
|
+
* - Claim window not closed (`block.timestamp ≤ endTime`).
|
|
214
|
+
* - Claims not paused.
|
|
215
|
+
* - Signature not already redeemed by this caller.
|
|
216
|
+
* - ETH balance covers `GAS_FEE()` (the `msg.value` the claim must attach).
|
|
217
|
+
*
|
|
218
|
+
* The EIP-712 admin-signature check is **not** preflight-detectable — the
|
|
219
|
+
* SDK cannot verify the signer's role without the contract round-trip — and
|
|
220
|
+
* will still surface as {@link InvalidSignatureError} at write time.
|
|
221
|
+
*
|
|
222
|
+
* Pool balance is also **not** preflight-detectable: the clone's confidential
|
|
223
|
+
* balance is an encrypted `euint64` handle that the SDK cannot read in
|
|
224
|
+
* plaintext. An unfunded clone will pass preflight and revert on-chain with
|
|
225
|
+
* {@link FheHandleNotAllowedError} (the FHEVM ACL rejects `FHE.allowTransient`
|
|
226
|
+
* on an uninitialized handle). Confirm the pool has been funded before
|
|
227
|
+
* showing `ready: true`.
|
|
228
|
+
*
|
|
229
|
+
* @returns `{ ready, blockers }` — same `code` shape the write would throw.
|
|
230
|
+
*/
|
|
231
|
+
preflightClaim(args: {
|
|
232
|
+
caller: Address;
|
|
233
|
+
encryptedAmountHandle: Hex;
|
|
234
|
+
}): Promise<PreflightResult>;
|
|
235
|
+
/**
|
|
236
|
+
* Claim tokens using an EIP-712 admin signature. Sends `GAS_FEE()` ETH with the tx.
|
|
237
|
+
*
|
|
238
|
+
* The `encryptedInput` must be the exact handle the admin signed in
|
|
239
|
+
* {@link signClaimAuthorization}. The signature commits to that handle, so the SDK
|
|
240
|
+
* does NOT re-encrypt — submit the admin-issued payload as-is.
|
|
241
|
+
*
|
|
242
|
+
* @returns Transaction hash.
|
|
243
|
+
* @example
|
|
244
|
+
* const fee = await airdrop.gasFee();
|
|
245
|
+
* const hash = await airdrop.claim({ encryptedInput, signature });
|
|
246
|
+
*/
|
|
247
|
+
claim(args: ClaimArgs): Promise<Hex>;
|
|
248
|
+
/**
|
|
249
|
+
* **This is a write transaction, not a free view. It costs gas.**
|
|
250
|
+
*
|
|
251
|
+
* Verify the admin-signed claim allocation and grant the caller decrypt access
|
|
252
|
+
* to the encrypted amount. Budget gas and `await` the receipt before calling
|
|
253
|
+
* the Zama relayer's `userDecrypt` — the handle is only valid after the tx lands.
|
|
254
|
+
*
|
|
255
|
+
* Internally the contract calls `FHE.allow(handle, msg.sender)`, which persists
|
|
256
|
+
* the ACL grant on-chain. The handle is extracted from the receipt's ACL `Allowed`
|
|
257
|
+
* event — `simulateContract` would return a divergent handle and break decryption.
|
|
258
|
+
*
|
|
259
|
+
* Does **not** consume the claim (the `claimedSignatures` bit is not set). Call
|
|
260
|
+
* {@link claim} when the user is ready to transfer tokens.
|
|
261
|
+
*
|
|
262
|
+
* @returns `{ handle, hash }` — `handle` is a `euint64` granted to the caller;
|
|
263
|
+
* pass it to the Zama relayer's `userDecrypt` to obtain the plaintext amount.
|
|
264
|
+
*/
|
|
265
|
+
getClaimAmount(args: GetClaimAmountArgs): Promise<EncryptedViewResult>;
|
|
266
|
+
/**
|
|
267
|
+
* Withdraw all confidential tokens to `recipient`. `DEFAULT_ADMIN_ROLE` only.
|
|
268
|
+
*
|
|
269
|
+
* Calling on a clone whose pool was **never funded** throws
|
|
270
|
+
* {@link FheHandleNotAllowedError} (code `TOKENOPS_FHE_HANDLE_NOT_ALLOWED`).
|
|
271
|
+
* The contract calls `FHE.allowTransient` on the confidential balance handle;
|
|
272
|
+
* when the handle is uninitialized, the FHEVM ACL contract reverts with
|
|
273
|
+
* `SenderNotAllowed(address)`. Confirm the pool has been funded (e.g. via the
|
|
274
|
+
* factory's `createAndFund...` variant or a follow-up `confidentialTransfer`)
|
|
275
|
+
* before calling.
|
|
276
|
+
*/
|
|
277
|
+
withdraw(recipient: Address, account?: Account | Address): Promise<Hex>;
|
|
278
|
+
/** Pause or unpause claims. DEFAULT_ADMIN_ROLE only. */
|
|
279
|
+
setPaused(paused: boolean, account?: Account | Address): Promise<TxHash>;
|
|
280
|
+
/**
|
|
281
|
+
* Extend the claim window end time. DEFAULT_ADMIN_ROLE only.
|
|
282
|
+
* Requires `CAN_EXTEND_CLAIM_WINDOW == true` or the contract reverts.
|
|
283
|
+
*/
|
|
284
|
+
extendClaimWindow(newEndTime: number, account?: Account | Address): Promise<TxHash>;
|
|
285
|
+
/** Rescue accidentally sent ERC20 tokens. DEFAULT_ADMIN_ROLE only. */
|
|
286
|
+
withdrawOtherToken(tokenAddress: Address, recipient: Address, account?: Account | Address): Promise<Hex>;
|
|
287
|
+
/** Rescue accidentally sent ERC7984 confidential tokens. DEFAULT_ADMIN_ROLE only. */
|
|
288
|
+
withdrawOtherConfidentialToken(tokenAddress: Address, recipient: Address, account?: Account | Address): Promise<Hex>;
|
|
289
|
+
/**
|
|
290
|
+
* Withdraw collected ETH gas fees. FEE_COLLECTOR_ROLE only.
|
|
291
|
+
* Pass `amount = 0n` to withdraw the entire balance.
|
|
292
|
+
*/
|
|
293
|
+
withdrawGasFee(recipient: Address, amount: bigint, account?: Account | Address): Promise<Hex>;
|
|
294
|
+
hasRole(role: Role, account: Address): Promise<boolean>;
|
|
295
|
+
grantRole(role: Role, accountTarget: Address, account?: Account | Address): Promise<TxHash>;
|
|
296
|
+
revokeRole(role: Role, accountTarget: Address, account?: Account | Address): Promise<TxHash>;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Create a {@link ConfidentialAirdropClient}. Mirrors viem's `create*` convention.
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* const airdrop = createConfidentialAirdropClient({
|
|
303
|
+
* publicClient, walletClient,
|
|
304
|
+
* address: "0xYourAirdropClone",
|
|
305
|
+
* encryptor,
|
|
306
|
+
* });
|
|
307
|
+
*/
|
|
308
|
+
export declare function createConfidentialAirdropClient(config: ConfidentialAirdropClientConfig): ConfidentialAirdropClient;
|