@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,25 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { TxHash } from "../../core/brands.js";
|
|
3
|
+
import type { ClaimArgs } from "../airdrop.js";
|
|
4
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
5
|
+
/**
|
|
6
|
+
* Claim tokens from an airdrop using an EIP-712 admin signature. The SDK
|
|
7
|
+
* encrypts the plaintext `amount` into an `externalEuint64` and submits it
|
|
8
|
+
* with an input proof — callers never handle ciphertext. Attaches `GAS_FEE()`
|
|
9
|
+
* ETH automatically unless `args.value` is set.
|
|
10
|
+
*
|
|
11
|
+
* **Encryptor resolution.** The hook-level `encryptor` (from
|
|
12
|
+
* {@link AirdropHookOptions}) is forwarded lazily to the SDK client. You can
|
|
13
|
+
* also pass `encryptor` per-mutation via `args.encryptor` to override it. If
|
|
14
|
+
* neither is present, the SDK throws `Missing encryptor — pass encryptor…`
|
|
15
|
+
* verbatim.
|
|
16
|
+
*
|
|
17
|
+
* After a successful claim, invalidate
|
|
18
|
+
* `useAirdropIsSignatureClaimed({ user, encryptedAmountHandle })` and any
|
|
19
|
+
* UI counts you computed off it.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const claim = useAirdropClaim({ address: airdropAddress, encryptor: () => useZamaSDK().relayer });
|
|
23
|
+
* claim.mutate({ amount: 1_000_000n, signature });
|
|
24
|
+
*/
|
|
25
|
+
export declare function useAirdropClaim(options: AirdropHookOptions): UseMutationResult<TxHash, Error, ClaimArgs>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Hex } from "viem";
|
|
3
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Read the EIP-712 type hash for `Claim(address recipient, bytes32 encryptedAmount)`.
|
|
6
|
+
* Useful for off-chain signers that assemble the typed-data payload manually
|
|
7
|
+
* (custom HSM-backed signers, ledger flows) instead of calling
|
|
8
|
+
* {@link signClaimAuthorization}.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useAirdropClaimTypehash(options: AirdropHookOptions): UseQueryResult<Hex, Error>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Hex } from "viem";
|
|
3
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseAirdropClaimedSignaturesArgs extends AirdropHookOptions {
|
|
5
|
+
/** EIP-712 struct hash of a `Claim`. Hook is disabled until set. */
|
|
6
|
+
signatureHash?: Hex;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Check whether a pre-computed claim struct hash has been consumed on this
|
|
10
|
+
* airdrop clone.
|
|
11
|
+
*
|
|
12
|
+
* Prefer {@link useAirdropIsSignatureClaimed} unless you already hold the
|
|
13
|
+
* pre-computed `bytes32` struct hash — that hook takes the more common
|
|
14
|
+
* `(user, encryptedAmountHandle)` shape and computes the hash for you.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useAirdropClaimedSignatures(args: UseAirdropClaimedSignaturesArgs): UseQueryResult<boolean, Error>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read the block number at which this airdrop clone was deployed.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useAirdropDeploymentBlockNumber(options: AirdropHookOptions): UseQueryResult<bigint, Error>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Hex } from "viem";
|
|
3
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Read the EIP-712 domain separator for this airdrop clone. Useful for
|
|
6
|
+
* off-chain signing tools that build claim authorizations server-side.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useAirdropDomainSeparator(options: AirdropHookOptions): UseQueryResult<Hex, Error>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read the airdrop clone's `endTime` — the unix timestamp when claims close.
|
|
5
|
+
* Mutable: the admin can extend it via `useExtendClaimWindow` when
|
|
6
|
+
* `canExtendClaimWindow()` is `true`.
|
|
7
|
+
*
|
|
8
|
+
* After a successful `useExtendClaimWindow`, invalidate this query.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useAirdropEndTime(options: AirdropHookOptions): UseQueryResult<number, Error>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { type CustomFee } from "../types.js";
|
|
4
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UseAirdropFactoryCustomFeeArgs extends BaseHookOptions {
|
|
6
|
+
/** Address whose per-creator fee override to read. Hook is disabled until set. */
|
|
7
|
+
creator?: Address;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Read the per-creator fee override set on the factory for `creator`. Returns
|
|
11
|
+
* `{ enabled: false, gasFee: 0n }` when no override exists.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const { data: customFee } = useAirdropFactoryCustomFee({ creator });
|
|
15
|
+
* if (customFee?.enabled) { ... use customFee.gasFee ... }
|
|
16
|
+
*/
|
|
17
|
+
export declare function useAirdropFactoryCustomFee(args?: UseAirdropFactoryCustomFeeArgs): UseQueryResult<CustomFee, Error>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read the factory-wide default per-claim gas fee (in wei) — applied to new
|
|
5
|
+
* airdrop clones at deployment when the creator has no custom override.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const { data: defaultGasFee } = useAirdropFactoryDefaultGasFee();
|
|
9
|
+
*/
|
|
10
|
+
export declare function useAirdropFactoryDefaultGasFee(options?: BaseHookOptions): UseQueryResult<bigint, Error>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address } from "viem";
|
|
3
|
+
import type { TxHash } from "../../core/brands.js";
|
|
4
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UseAirdropFactoryDisableCustomFeeArgs {
|
|
6
|
+
campaignCreator: Address;
|
|
7
|
+
account?: Account | Address;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Admin: remove a per-creator fee override, reverting to `defaultGasFee`.
|
|
11
|
+
* Requires `FEE_MANAGER_ROLE`.
|
|
12
|
+
*
|
|
13
|
+
* After success, invalidate `useFactoryCustomFee({ creator: campaignCreator })`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useAirdropFactoryDisableCustomFee(options?: BaseHookOptions): UseMutationResult<TxHash, Error, UseAirdropFactoryDisableCustomFeeArgs>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Read the factory's current fee collector address — the account authorized to
|
|
6
|
+
* call `withdrawGasFee` on each deployed airdrop clone.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const { data: feeCollector } = useAirdropFactoryFeeCollector();
|
|
10
|
+
*/
|
|
11
|
+
export declare function useAirdropFactoryFeeCollector(options?: BaseHookOptions): UseQueryResult<Address, Error>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Hex } from "viem";
|
|
3
|
+
import { type AirdropParams } from "../types.js";
|
|
4
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UseAirdropFactoryInitCodeHashArgs extends BaseHookOptions {
|
|
6
|
+
params?: AirdropParams;
|
|
7
|
+
gasFee?: bigint;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Read the init-code hash the factory would use to CREATE2 an airdrop clone
|
|
11
|
+
* with the given `params` + `gasFee`. Mirrors Solidity's `getInitCodeHash`
|
|
12
|
+
* selector.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const { data: initCodeHash } = useAirdropFactoryInitCodeHash({ params, gasFee });
|
|
16
|
+
*/
|
|
17
|
+
export declare function useAirdropFactoryInitCodeHash(args?: UseAirdropFactoryInitCodeHashArgs): UseQueryResult<Hex, Error>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address } from "viem";
|
|
3
|
+
import type { TxHash } from "../../core/brands.js";
|
|
4
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UseAirdropFactorySetCustomFeeArgs {
|
|
6
|
+
campaignCreator: Address;
|
|
7
|
+
gasFee: bigint;
|
|
8
|
+
account?: Account | Address;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Admin: install a per-creator gas-fee override on the factory. Takes
|
|
12
|
+
* precedence over `defaultGasFee` for all airdrops `campaignCreator` deploys
|
|
13
|
+
* after the override. Requires `FEE_MANAGER_ROLE`.
|
|
14
|
+
*
|
|
15
|
+
* After success, invalidate `useFactoryCustomFee({ creator: campaignCreator })`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useAirdropFactorySetCustomFee(options?: BaseHookOptions): UseMutationResult<TxHash, Error, UseAirdropFactorySetCustomFeeArgs>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address } from "viem";
|
|
3
|
+
import type { TxHash } from "../../core/brands.js";
|
|
4
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UseAirdropFactorySetDefaultGasFeeArgs {
|
|
6
|
+
newGasFee: bigint;
|
|
7
|
+
account?: Account | Address;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Admin: change the factory-wide default per-claim gas fee. Requires
|
|
11
|
+
* `FEE_MANAGER_ROLE`. Only affects airdrops deployed AFTER this call — already
|
|
12
|
+
* deployed clones carry the gas fee as an immutable arg.
|
|
13
|
+
*
|
|
14
|
+
* After success, invalidate `useFactoryDefaultGasFee()`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useAirdropFactorySetDefaultGasFee(options?: BaseHookOptions): UseMutationResult<TxHash, Error, UseAirdropFactorySetDefaultGasFeeArgs>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address } from "viem";
|
|
3
|
+
import type { TxHash } from "../../core/brands.js";
|
|
4
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UseAirdropFactorySetFeeCollectorArgs {
|
|
6
|
+
newFeeCollector: Address;
|
|
7
|
+
account?: Account | Address;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Admin: change the factory's fee collector address. Requires
|
|
11
|
+
* `FEE_MANAGER_ROLE`.
|
|
12
|
+
*
|
|
13
|
+
* After success, invalidate `useFactoryFeeCollector()`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useAirdropFactorySetFeeCollector(options?: BaseHookOptions): UseMutationResult<TxHash, Error, UseAirdropFactorySetFeeCollectorArgs>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read the airdrop clone's immutable per-claim gas fee (in wei). Attached as
|
|
5
|
+
* `msg.value` by `claim()` automatically when the consumer doesn't pass
|
|
6
|
+
* `value` explicitly.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const { data: gasFee } = useAirdropGasFee({ address: airdropAddress });
|
|
10
|
+
*/
|
|
11
|
+
export declare function useAirdropGasFee(options: AirdropHookOptions): UseQueryResult<bigint, Error>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseAirdropGrantRoleArgs {
|
|
5
|
+
role: Hex;
|
|
6
|
+
accountTarget: Address;
|
|
7
|
+
account?: Account | Address;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* AccessControl: grant `role` to `accountTarget` on this airdrop clone.
|
|
11
|
+
* Caller must be a member of the role's admin role (typically
|
|
12
|
+
* `DEFAULT_ADMIN_ROLE`).
|
|
13
|
+
*
|
|
14
|
+
* After success, invalidate `useAirdropHasRole({ role, account: accountTarget })`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useAirdropGrantRole(options: AirdropHookOptions): UseMutationResult<Hex, Error, UseAirdropGrantRoleArgs>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read whether the current chain timestamp is past `endTime` on this airdrop
|
|
5
|
+
* clone. Free chain read — no gas, no tx.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useAirdropHasClaimEnded(options: AirdropHookOptions): UseQueryResult<boolean, Error>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read whether the current chain timestamp is past `START_TIME` on this
|
|
5
|
+
* airdrop clone. Free chain read — no gas, no tx.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useAirdropHasClaimStarted(options: AirdropHookOptions): UseQueryResult<boolean, Error>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address, Hex } from "viem";
|
|
3
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseAirdropHasRoleArgs extends AirdropHookOptions {
|
|
5
|
+
role?: Hex;
|
|
6
|
+
account?: Address;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Read AccessControl: is `account` a member of `role` on this airdrop clone?
|
|
10
|
+
*
|
|
11
|
+
* The role hashes are stable across deployments (DEFAULT_ADMIN_ROLE,
|
|
12
|
+
* FEE_COLLECTOR_ROLE, etc.).
|
|
13
|
+
*/
|
|
14
|
+
export declare function useAirdropHasRole(args: UseAirdropHasRoleArgs): UseQueryResult<boolean, Error>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read whether the airdrop is currently within its claim window AND not paused.
|
|
5
|
+
* Free chain read — no gas, no tx.
|
|
6
|
+
*
|
|
7
|
+
* Use this as a pre-claim UI gate.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useAirdropIsClaimWindowActive(options: AirdropHookOptions): UseQueryResult<boolean, Error>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read whether claims are currently paused by the admin on this airdrop clone.
|
|
5
|
+
*
|
|
6
|
+
* After a successful `useSetPaused`, invalidate this query.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useAirdropIsPaused(options: AirdropHookOptions): UseQueryResult<boolean, Error>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address, Hex } from "viem";
|
|
3
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseAirdropIsSignatureClaimedArgs extends AirdropHookOptions {
|
|
5
|
+
/** Recipient address from the claim authorization. */
|
|
6
|
+
user?: Address;
|
|
7
|
+
/** `externalEuint64` handle (as `Hex`) from the claim payload. */
|
|
8
|
+
encryptedAmountHandle?: Hex;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Check whether a claim has been consumed for a `(user, encryptedAmountHandle)`
|
|
12
|
+
* pair on this airdrop clone. The contract recomputes the struct hash
|
|
13
|
+
* internally and looks it up in storage.
|
|
14
|
+
*
|
|
15
|
+
* Most frontends want this hook over {@link useAirdropClaimedSignatures} —
|
|
16
|
+
* pass the same `user` + `encryptedAmountHandle` that appear in the
|
|
17
|
+
* admin-issued claim payload.
|
|
18
|
+
*
|
|
19
|
+
* After a successful {@link useClaim}, invalidate this query for the claimed
|
|
20
|
+
* `(user, encryptedAmountHandle)` pair.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useAirdropIsSignatureClaimed(args: UseAirdropIsSignatureClaimedArgs): UseQueryResult<boolean, Error>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address, Hex } from "viem";
|
|
3
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseAirdropIsSignatureValidArgs extends AirdropHookOptions {
|
|
5
|
+
/** `externalEuint64` handle (as `Hex`) from the claim payload. */
|
|
6
|
+
encryptedAmountHandle?: Hex;
|
|
7
|
+
/** EIP-712 admin signature over `Claim(address recipient, bytes32 encryptedAmount)`. */
|
|
8
|
+
signature?: Hex;
|
|
9
|
+
/**
|
|
10
|
+
* Caller address — the contract recomputes the struct hash over
|
|
11
|
+
* `(msg.sender, encryptedAmount)`, so validity is caller-specific.
|
|
12
|
+
* Defaults to the connected wallet via `wagmi`'s `useAccount()`; pass
|
|
13
|
+
* explicitly to check on behalf of another address.
|
|
14
|
+
*/
|
|
15
|
+
caller?: Address;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Check whether an admin-issued claim authorization is valid for a specific
|
|
19
|
+
* caller, without consuming it.
|
|
20
|
+
*
|
|
21
|
+
* The query has **two distinct failure shapes** that must be handled separately:
|
|
22
|
+
*
|
|
23
|
+
* - `data === false`: the signature is structurally valid but fails the on-chain
|
|
24
|
+
* check — already claimed, claim window inactive, or signer lacks
|
|
25
|
+
* `DEFAULT_ADMIN_ROLE`.
|
|
26
|
+
* - `error?.code === "TOKENOPS_INVALID_SIGNATURE"`: the signature bytes are
|
|
27
|
+
* structurally malformed (wrong length, invalid `s`-value range, unparseable).
|
|
28
|
+
* The on-chain `ECDSA.recover` reverts before the boolean logic runs, so this
|
|
29
|
+
* shows up on `error`, not on `data`.
|
|
30
|
+
*
|
|
31
|
+
* ```ts
|
|
32
|
+
* const sig = useAirdropIsSignatureValid({ address, encryptedAmountHandle, signature, caller });
|
|
33
|
+
* if (sig.error?.code === "TOKENOPS_INVALID_SIGNATURE") {
|
|
34
|
+
* // malformed signature bytes
|
|
35
|
+
* } else if (sig.data === false) {
|
|
36
|
+
* // wrong signer, already claimed, or window closed
|
|
37
|
+
* } else if (sig.data === true) {
|
|
38
|
+
* // ready to claim
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* The result is caller-specific (the on-chain check binds to `msg.sender`).
|
|
43
|
+
* `caller` defaults to the connected wallet; the query stays disabled until
|
|
44
|
+
* a caller is available, and the caller is part of the query key so cached
|
|
45
|
+
* results don't bleed across account switches.
|
|
46
|
+
*
|
|
47
|
+
* Use this to show a pre-claim validation state in the UI before asking the
|
|
48
|
+
* user to pay gas.
|
|
49
|
+
*/
|
|
50
|
+
export declare function useAirdropIsSignatureValid(args: UseAirdropIsSignatureValidArgs): UseQueryResult<boolean, Error>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseAirdropRevokeRoleArgs {
|
|
5
|
+
role: Hex;
|
|
6
|
+
accountTarget: Address;
|
|
7
|
+
account?: Account | Address;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* AccessControl: revoke `role` from `accountTarget` on this airdrop clone.
|
|
11
|
+
* Caller must be a member of the role's admin role.
|
|
12
|
+
*
|
|
13
|
+
* After success, invalidate `useAirdropHasRole({ role, account: accountTarget })`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useAirdropRevokeRole(options: AirdropHookOptions): UseMutationResult<Hex, Error, UseAirdropRevokeRoleArgs>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read the airdrop clone's immutable `START_TIME` — the unix timestamp when
|
|
5
|
+
* claims become available.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const { data: startTime } = useAirdropStartTime({ address: airdropAddress });
|
|
9
|
+
*/
|
|
10
|
+
export declare function useAirdropStartTime(options: AirdropHookOptions): UseQueryResult<number, Error>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Read the airdrop clone's immutable `TOKEN`. Result is cacheable for the
|
|
6
|
+
* clone's lifetime — the field is baked into the clone's bytecode.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const { data: token } = useAirdropToken({ address: airdropAddress });
|
|
10
|
+
*/
|
|
11
|
+
export declare function useAirdropToken(options: AirdropHookOptions): UseQueryResult<Address, Error>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseAirdropWithdrawGasFeeArgs {
|
|
5
|
+
recipient: Address;
|
|
6
|
+
/** Amount of ETH to withdraw (in wei). Pass `0n` to withdraw the entire balance. */
|
|
7
|
+
amount: bigint;
|
|
8
|
+
account?: Account | Address;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Fee collector: withdraw collected ETH gas fees from the airdrop clone.
|
|
12
|
+
* Requires `FEE_COLLECTOR_ROLE`. Pass `amount = 0n` to withdraw the entire
|
|
13
|
+
* balance.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useAirdropWithdrawGasFee(options: AirdropHookOptions): UseMutationResult<Hex, Error, UseAirdropWithdrawGasFeeArgs>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address } from "viem";
|
|
3
|
+
import type { TxHash } from "../../core/brands.js";
|
|
4
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UseAirdropWithdrawOtherConfidentialTokenArgs {
|
|
6
|
+
tokenAddress: Address;
|
|
7
|
+
recipient: Address;
|
|
8
|
+
account?: Account | Address;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Admin: rescue accidentally sent ERC-7984 confidential tokens (other than
|
|
12
|
+
* this airdrop's configured `TOKEN`). Requires `DEFAULT_ADMIN_ROLE`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useAirdropWithdrawOtherConfidentialToken(options: AirdropHookOptions): UseMutationResult<TxHash, Error, UseAirdropWithdrawOtherConfidentialTokenArgs>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address } from "viem";
|
|
3
|
+
import type { TxHash } from "../../core/brands.js";
|
|
4
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UseAirdropWithdrawOtherTokenArgs {
|
|
6
|
+
tokenAddress: Address;
|
|
7
|
+
recipient: Address;
|
|
8
|
+
account?: Account | Address;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Admin: rescue accidentally sent ERC-20 (non-confidential) tokens. Requires
|
|
12
|
+
* `DEFAULT_ADMIN_ROLE`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useAirdropWithdrawOtherToken(options: AirdropHookOptions): UseMutationResult<TxHash, Error, UseAirdropWithdrawOtherTokenArgs>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Hex } from "viem";
|
|
3
|
+
import type { ClaimArgs } from "../airdrop.js";
|
|
4
|
+
import { type AirdropHookOptions } from "./_shared.js";
|
|
5
|
+
/**
|
|
6
|
+
* Claim tokens from an airdrop using an EIP-712 admin signature. Submits the
|
|
7
|
+
* admin-issued `{ encryptedInput, signature }` pair verbatim — the SDK does
|
|
8
|
+
* NOT re-encrypt on the recipient side, because the signature commits to the
|
|
9
|
+
* exact `bytes32` handle and any re-encryption would invalidate it.
|
|
10
|
+
*
|
|
11
|
+
* Attaches `GAS_FEE()` ETH as `msg.value` automatically unless `args.value` is
|
|
12
|
+
* set.
|
|
13
|
+
*
|
|
14
|
+
* The admin builds `encryptedInput` server-side via
|
|
15
|
+
* {@link encryptUint64} with `userAddress: recipient` (Zama input proofs are
|
|
16
|
+
* bound to the recipient), then signs the resulting handle with
|
|
17
|
+
* {@link signClaimAuthorization}. Deliver `(encryptedInput, signature)` to
|
|
18
|
+
* the recipient via your channel of choice; the recipient passes the pair to
|
|
19
|
+
* this hook unchanged.
|
|
20
|
+
*
|
|
21
|
+
* After a successful claim, invalidate
|
|
22
|
+
* `useAirdropIsSignatureClaimed({ user, encryptedAmountHandle })` and any
|
|
23
|
+
* UI counts you computed off it.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const claim = useClaim({ address: airdropAddress });
|
|
27
|
+
* claim.mutate({ encryptedInput, signature });
|
|
28
|
+
*/
|
|
29
|
+
export declare function useClaim(options: AirdropHookOptions): UseMutationResult<Hex, Error, ClaimArgs>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Read the FHE-airdrop factory's current `implementation()` address — the
|
|
6
|
+
* LibClone target every new airdrop clone delegates to.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const { data: implementation } = useConfidentialAirdropFactoryImplementation();
|
|
10
|
+
*/
|
|
11
|
+
export declare function useConfidentialAirdropFactoryImplementation(options?: BaseHookOptions): UseQueryResult<Address, Error>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { CreateAirdropResult, CreateAndFundAirdropArgs } from "../factory.js";
|
|
3
|
+
import { type FactoryHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Deploy AND fund a new airdrop clone in a single transaction. The SDK
|
|
6
|
+
* encrypts the plaintext `amount` into an `externalEuint64` and submits it
|
|
7
|
+
* with an input proof — callers never handle ciphertext.
|
|
8
|
+
*
|
|
9
|
+
* **Encryptor resolution.** The hook-level `encryptor` (from
|
|
10
|
+
* {@link FactoryHookOptions}) is forwarded lazily to the SDK client. You can
|
|
11
|
+
* also pass `encryptor` per-mutation via `args.encryptor` to override it. If
|
|
12
|
+
* neither is present, the SDK throws `Missing encryptor — pass encryptor…`
|
|
13
|
+
* verbatim.
|
|
14
|
+
*
|
|
15
|
+
* **Prerequisites:** caller must have set the factory as an operator on the
|
|
16
|
+
* token: `token.setOperator(factoryAddress, deadline)`.
|
|
17
|
+
*
|
|
18
|
+
* After success, invalidate factory queries that depend on per-creator state:
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* function Component() {
|
|
22
|
+
* const queryClient = useQueryClient();
|
|
23
|
+
* const zamaSDK = useZamaSDK();
|
|
24
|
+
* const create = useCreateAndFundConfidentialAirdrop({ encryptor: () => zamaSDK.relayer });
|
|
25
|
+
* create.mutate(args, {
|
|
26
|
+
* onSuccess: () => {
|
|
27
|
+
* queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
|
|
28
|
+
* },
|
|
29
|
+
* });
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function useCreateAndFundConfidentialAirdrop(options?: FactoryHookOptions): UseMutationResult<CreateAirdropResult, Error, CreateAndFundAirdropArgs>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { CreateAirdropResult, CreateAndFundAirdropArgs } from "../factory.js";
|
|
3
|
+
import { type FactoryHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* **Recommended fund-on-create entry point.** Deploy AND fund a new airdrop
|
|
6
|
+
* clone in one tx, then resolve its address from the
|
|
7
|
+
* `ConfidentialAirdropCreated` event in the receipt.
|
|
8
|
+
*
|
|
9
|
+
* Use this in place of {@link useCreateAndFundConfidentialAirdrop} when you
|
|
10
|
+
* need the deployed clone address — for example to navigate to a detail page
|
|
11
|
+
* immediately after the deploy.
|
|
12
|
+
*
|
|
13
|
+
* Internally: `createAndFundConfidentialAirdrop` → `waitForTransactionReceipt`
|
|
14
|
+
* → `parseEventLogs({ eventName: "ConfidentialAirdropCreated" })`.
|
|
15
|
+
*
|
|
16
|
+
* After a successful create, invalidate factory queries that depend on
|
|
17
|
+
* per-creator state:
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* function Component() {
|
|
21
|
+
* const queryClient = useQueryClient();
|
|
22
|
+
* const zamaSDK = useZamaSDK();
|
|
23
|
+
* const create = useCreateAndFundConfidentialAirdropAndGetAddress({
|
|
24
|
+
* encryptor: () => zamaSDK.relayer,
|
|
25
|
+
* });
|
|
26
|
+
* create.mutate(args, {
|
|
27
|
+
* onSuccess: ({ airdrop }) => {
|
|
28
|
+
* queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
|
|
29
|
+
* navigate(`/airdrop/${airdrop}`);
|
|
30
|
+
* },
|
|
31
|
+
* });
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const create = useCreateAndFundConfidentialAirdropAndGetAddress();
|
|
37
|
+
* create.mutate({ params, userSalt, amount });
|
|
38
|
+
* // create.data → { hash, airdrop }
|
|
39
|
+
*/
|
|
40
|
+
export declare function useCreateAndFundConfidentialAirdropAndGetAddress(options?: FactoryHookOptions): UseMutationResult<CreateAirdropResult, Error, CreateAndFundAirdropArgs>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { CreateAirdropArgs, CreateAirdropResult } from "../factory.js";
|
|
3
|
+
import { type FactoryHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Deploy a new airdrop clone via the factory. Raw-hash-only variant — parse
|
|
6
|
+
* the `ConfidentialAirdropCreated` event yourself if you need the address.
|
|
7
|
+
*
|
|
8
|
+
* **For the common "deploy and learn the address" flow, prefer
|
|
9
|
+
* {@link useCreateConfidentialAirdropAndGetAddress}** — it's a one-call wrapper
|
|
10
|
+
* that returns `{ hash, airdrop }`.
|
|
11
|
+
*
|
|
12
|
+
* After a successful create, invalidate factory queries that depend on
|
|
13
|
+
* per-creator state:
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const queryClient = useQueryClient();
|
|
17
|
+
* const create = useCreateConfidentialAirdrop();
|
|
18
|
+
* create.mutate(args, {
|
|
19
|
+
* onSuccess: () => {
|
|
20
|
+
* queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
|
|
21
|
+
* },
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const create = useCreateConfidentialAirdrop();
|
|
27
|
+
* create.mutate({ params, userSalt });
|
|
28
|
+
*/
|
|
29
|
+
export declare function useCreateConfidentialAirdrop(options?: FactoryHookOptions): UseMutationResult<CreateAirdropResult, Error, CreateAirdropArgs>;
|