@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,111 @@
|
|
|
1
|
+
export declare const disperseWalletAbi: readonly [{
|
|
2
|
+
readonly inputs: readonly [];
|
|
3
|
+
readonly stateMutability: "nonpayable";
|
|
4
|
+
readonly type: "constructor";
|
|
5
|
+
}, {
|
|
6
|
+
readonly inputs: readonly [];
|
|
7
|
+
readonly name: "InvalidAddress";
|
|
8
|
+
readonly type: "error";
|
|
9
|
+
}, {
|
|
10
|
+
readonly inputs: readonly [];
|
|
11
|
+
readonly name: "InvalidInitialization";
|
|
12
|
+
readonly type: "error";
|
|
13
|
+
}, {
|
|
14
|
+
readonly inputs: readonly [];
|
|
15
|
+
readonly name: "NotController";
|
|
16
|
+
readonly type: "error";
|
|
17
|
+
}, {
|
|
18
|
+
readonly inputs: readonly [];
|
|
19
|
+
readonly name: "NotInitializing";
|
|
20
|
+
readonly type: "error";
|
|
21
|
+
}, {
|
|
22
|
+
readonly inputs: readonly [{
|
|
23
|
+
readonly internalType: "address";
|
|
24
|
+
readonly name: "token";
|
|
25
|
+
readonly type: "address";
|
|
26
|
+
}];
|
|
27
|
+
readonly name: "SafeERC20FailedOperation";
|
|
28
|
+
readonly type: "error";
|
|
29
|
+
}, {
|
|
30
|
+
readonly inputs: readonly [];
|
|
31
|
+
readonly name: "ZamaProtocolUnsupported";
|
|
32
|
+
readonly type: "error";
|
|
33
|
+
}, {
|
|
34
|
+
readonly anonymous: false;
|
|
35
|
+
readonly inputs: readonly [{
|
|
36
|
+
readonly indexed: false;
|
|
37
|
+
readonly internalType: "uint64";
|
|
38
|
+
readonly name: "version";
|
|
39
|
+
readonly type: "uint64";
|
|
40
|
+
}];
|
|
41
|
+
readonly name: "Initialized";
|
|
42
|
+
readonly type: "event";
|
|
43
|
+
}, {
|
|
44
|
+
readonly inputs: readonly [{
|
|
45
|
+
readonly internalType: "address";
|
|
46
|
+
readonly name: "token";
|
|
47
|
+
readonly type: "address";
|
|
48
|
+
}];
|
|
49
|
+
readonly name: "approveToken";
|
|
50
|
+
readonly outputs: readonly [];
|
|
51
|
+
readonly stateMutability: "nonpayable";
|
|
52
|
+
readonly type: "function";
|
|
53
|
+
}, {
|
|
54
|
+
readonly inputs: readonly [];
|
|
55
|
+
readonly name: "controller";
|
|
56
|
+
readonly outputs: readonly [{
|
|
57
|
+
readonly internalType: "address";
|
|
58
|
+
readonly name: "";
|
|
59
|
+
readonly type: "address";
|
|
60
|
+
}];
|
|
61
|
+
readonly stateMutability: "view";
|
|
62
|
+
readonly type: "function";
|
|
63
|
+
}, {
|
|
64
|
+
readonly inputs: readonly [{
|
|
65
|
+
readonly internalType: "address";
|
|
66
|
+
readonly name: "controller_";
|
|
67
|
+
readonly type: "address";
|
|
68
|
+
}];
|
|
69
|
+
readonly name: "initialize";
|
|
70
|
+
readonly outputs: readonly [];
|
|
71
|
+
readonly stateMutability: "nonpayable";
|
|
72
|
+
readonly type: "function";
|
|
73
|
+
}, {
|
|
74
|
+
readonly inputs: readonly [{
|
|
75
|
+
readonly internalType: "address";
|
|
76
|
+
readonly name: "token";
|
|
77
|
+
readonly type: "address";
|
|
78
|
+
}, {
|
|
79
|
+
readonly internalType: "address";
|
|
80
|
+
readonly name: "to";
|
|
81
|
+
readonly type: "address";
|
|
82
|
+
}];
|
|
83
|
+
readonly name: "recoverConfidentialToken";
|
|
84
|
+
readonly outputs: readonly [];
|
|
85
|
+
readonly stateMutability: "nonpayable";
|
|
86
|
+
readonly type: "function";
|
|
87
|
+
}, {
|
|
88
|
+
readonly inputs: readonly [{
|
|
89
|
+
readonly internalType: "address";
|
|
90
|
+
readonly name: "token";
|
|
91
|
+
readonly type: "address";
|
|
92
|
+
}, {
|
|
93
|
+
readonly internalType: "address";
|
|
94
|
+
readonly name: "to";
|
|
95
|
+
readonly type: "address";
|
|
96
|
+
}];
|
|
97
|
+
readonly name: "recoverERC20";
|
|
98
|
+
readonly outputs: readonly [];
|
|
99
|
+
readonly stateMutability: "nonpayable";
|
|
100
|
+
readonly type: "function";
|
|
101
|
+
}, {
|
|
102
|
+
readonly inputs: readonly [{
|
|
103
|
+
readonly internalType: "address";
|
|
104
|
+
readonly name: "token";
|
|
105
|
+
readonly type: "address";
|
|
106
|
+
}];
|
|
107
|
+
readonly name: "revokeToken";
|
|
108
|
+
readonly outputs: readonly [];
|
|
109
|
+
readonly stateMutability: "nonpayable";
|
|
110
|
+
readonly type: "function";
|
|
111
|
+
}];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { EncryptedInput, EncryptedInputs } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* FHE input values, discriminated by ciphertext type. Mirrors the shape of
|
|
5
|
+
* `EncryptInput` from `@zama-fhe/sdk` so that a `RelayerWeb` / `RelayerNode`
|
|
6
|
+
* / `MockFhevmInstance` instance is structurally assignable to {@link Encryptor}
|
|
7
|
+
* without casting.
|
|
8
|
+
*/
|
|
9
|
+
export type FheValueInput = {
|
|
10
|
+
value: boolean | bigint;
|
|
11
|
+
type: "ebool";
|
|
12
|
+
} | {
|
|
13
|
+
value: Address;
|
|
14
|
+
type: "eaddress";
|
|
15
|
+
} | {
|
|
16
|
+
value: bigint;
|
|
17
|
+
type: "euint8" | "euint16" | "euint32" | "euint64" | "euint128" | "euint160" | "euint256" | "ebytes64" | "ebytes128" | "ebytes256";
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Subset of `@zama-fhe/sdk` `RelayerSDK` we depend on. Declared structurally so
|
|
21
|
+
* consumers can pass any v3 RelayerSDK without us importing the optional peer dep.
|
|
22
|
+
*/
|
|
23
|
+
export interface Encryptor {
|
|
24
|
+
encrypt(params: {
|
|
25
|
+
values: FheValueInput[];
|
|
26
|
+
contractAddress: Address;
|
|
27
|
+
userAddress: Address;
|
|
28
|
+
}): Promise<{
|
|
29
|
+
handles: Uint8Array[];
|
|
30
|
+
inputProof: Uint8Array;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Eager or lazy {@link Encryptor} reference. Lazy form for React/Vue/signals
|
|
35
|
+
* hosts where the encryptor lifetime doesn't match the client's.
|
|
36
|
+
*
|
|
37
|
+
* **Wallet-switch contract.** A `RelayerWeb` instance binds to the keypair
|
|
38
|
+
* derived from the active signing account at construction time. The input
|
|
39
|
+
* proofs it produces are committed to `(contractAddress, userAddress)`
|
|
40
|
+
* pairs — the KMSVerifier rejects on-chain submission when those don't
|
|
41
|
+
* match the executing tx.
|
|
42
|
+
*
|
|
43
|
+
* For multi-wallet React hosts the lazy form MUST return a freshly
|
|
44
|
+
* constructed `RelayerWeb` for the current `walletClient.account` —
|
|
45
|
+
* returning a memoised instance built for a previous account is a silent
|
|
46
|
+
* proof-invalidation bug that surfaces only at submit time.
|
|
47
|
+
*/
|
|
48
|
+
export type EncryptorSource = Encryptor | (() => Encryptor | undefined);
|
|
49
|
+
/** Normalize an {@link EncryptorSource} to the underlying {@link Encryptor}. */
|
|
50
|
+
export declare function resolveEncryptor(source: EncryptorSource | undefined): Encryptor | undefined;
|
|
51
|
+
export interface EncryptUint64Args {
|
|
52
|
+
encryptor: Encryptor;
|
|
53
|
+
contractAddress: Address;
|
|
54
|
+
userAddress: Address;
|
|
55
|
+
value: bigint;
|
|
56
|
+
}
|
|
57
|
+
export interface EncryptUint64BatchArgs {
|
|
58
|
+
encryptor: Encryptor;
|
|
59
|
+
contractAddress: Address;
|
|
60
|
+
userAddress: Address;
|
|
61
|
+
values: bigint[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Encrypt a single `uint64` value into an `externalEuint64` handle + KMS input proof.
|
|
65
|
+
*/
|
|
66
|
+
export declare function encryptUint64({ encryptor, contractAddress, userAddress, value, }: EncryptUint64Args): Promise<EncryptedInput>;
|
|
67
|
+
/**
|
|
68
|
+
* Encrypt N `uint64` values into N handles bound by a single input proof.
|
|
69
|
+
*
|
|
70
|
+
* Used by {@link disperse} to encrypt `amounts[]` and the two subtotals in a
|
|
71
|
+
* single round-trip. Handles are returned in the same order as `values`.
|
|
72
|
+
*
|
|
73
|
+
* For `disperseConfidentialTokens` / `disperseConfidentialTokensWithTokenFee`:
|
|
74
|
+
* the last two entries in `values` should be `[subtotal0, subtotal1]` and the
|
|
75
|
+
* corresponding `handles[n-2]` / `handles[n-1]` are the subtotal handles.
|
|
76
|
+
*/
|
|
77
|
+
export declare function encryptUint64Batch({ encryptor, contractAddress, userAddress, values, }: EncryptUint64BatchArgs): Promise<EncryptedInputs>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import { TokenOpsSdkError } from "../core/errors.js";
|
|
3
|
+
/**
|
|
4
|
+
* The user has not yet called `register(token)`. Wallet-mode disperse paths
|
|
5
|
+
* require the per-user OZ-clone wallet pair to exist before they can transfer.
|
|
6
|
+
*/
|
|
7
|
+
export declare class NotRegisteredError extends TokenOpsSdkError {
|
|
8
|
+
readonly name = "NotRegisteredError";
|
|
9
|
+
readonly context: {
|
|
10
|
+
method: string;
|
|
11
|
+
contractAddress: Address;
|
|
12
|
+
user: Address;
|
|
13
|
+
};
|
|
14
|
+
constructor(args: {
|
|
15
|
+
method: string;
|
|
16
|
+
contractAddress: Address;
|
|
17
|
+
user: Address;
|
|
18
|
+
cause?: unknown;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The user has already registered — `register(token)` is single-use per user.
|
|
23
|
+
* Use `approveUserWalletsForToken(token)` to grant the existing wallet pair
|
|
24
|
+
* approval over a new token.
|
|
25
|
+
*/
|
|
26
|
+
export declare class AlreadyRegisteredError extends TokenOpsSdkError {
|
|
27
|
+
readonly name = "AlreadyRegisteredError";
|
|
28
|
+
readonly context: {
|
|
29
|
+
method: string;
|
|
30
|
+
contractAddress: Address;
|
|
31
|
+
user: Address;
|
|
32
|
+
};
|
|
33
|
+
constructor(args: {
|
|
34
|
+
method: string;
|
|
35
|
+
contractAddress: Address;
|
|
36
|
+
user: Address;
|
|
37
|
+
cause?: unknown;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkHTOMTEA3_cjs = require('../chunk-HTOMTEA3.cjs');
|
|
4
|
+
var chunkITQ7WKVC_cjs = require('../chunk-ITQ7WKVC.cjs');
|
|
5
|
+
var chunkFWHYQZ5E_cjs = require('../chunk-FWHYQZ5E.cjs');
|
|
6
|
+
require('../chunk-NS44KBV5.cjs');
|
|
7
|
+
require('../chunk-Q7ARQSUH.cjs');
|
|
8
|
+
require('../chunk-VDXVNZCO.cjs');
|
|
9
|
+
require('../chunk-OLDGMKW2.cjs');
|
|
10
|
+
require('../chunk-CQIPRNS7.cjs');
|
|
11
|
+
require('../chunk-VJKZWYYJ.cjs');
|
|
12
|
+
require('../chunk-66IHPTOK.cjs');
|
|
13
|
+
var chunk56UI7LUR_cjs = require('../chunk-56UI7LUR.cjs');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
Object.defineProperty(exports, "AlreadyRegisteredError", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunkHTOMTEA3_cjs.AlreadyRegisteredError; }
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "ConfidentialDisperseClient", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return chunkHTOMTEA3_cjs.ConfidentialDisperseClient; }
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "DEFAULT_ADMIN_ROLE", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return chunkHTOMTEA3_cjs.DEFAULT_ADMIN_ROLE; }
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(exports, "DisperseEncryptedReserveNotGrantedError", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return chunkHTOMTEA3_cjs.DisperseEncryptedReserveNotGrantedError; }
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "DisperseSubwalletNotFoundError", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () { return chunkHTOMTEA3_cjs.DisperseSubwalletNotFoundError; }
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "FEE_COLLECTOR_ROLE", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () { return chunkHTOMTEA3_cjs.FEE_COLLECTOR_ROLE; }
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, "FEE_MANAGER_ROLE", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () { return chunkHTOMTEA3_cjs.FEE_MANAGER_ROLE; }
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "NotRegisteredError", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () { return chunkHTOMTEA3_cjs.NotRegisteredError; }
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "PAUSER_ROLE", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () { return chunkHTOMTEA3_cjs.PAUSER_ROLE; }
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(exports, "WITHDRAWER_ROLE", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: function () { return chunkHTOMTEA3_cjs.WITHDRAWER_ROLE; }
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "computeSubtotals", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () { return chunkHTOMTEA3_cjs.computeSubtotals; }
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "createConfidentialDisperseClient", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () { return chunkHTOMTEA3_cjs.createConfidentialDisperseClient; }
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "disperseConfidentialAbi", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () { return chunkHTOMTEA3_cjs.disperseConfidentialAbi; }
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "disperseWalletAbi", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () { return chunkHTOMTEA3_cjs.disperseWalletAbi; }
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "encryptUint64", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () { return chunkHTOMTEA3_cjs.encryptUint64; }
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports, "encryptUint64Batch", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () { return chunkHTOMTEA3_cjs.encryptUint64Batch; }
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, "resolveEncryptor", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () { return chunkHTOMTEA3_cjs.resolveEncryptor; }
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(exports, "ERC7984_OPERATOR_MAX_DEADLINE", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function () { return chunkITQ7WKVC_cjs.ERC7984_OPERATOR_MAX_DEADLINE; }
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(exports, "revokeOperator", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: function () { return chunkITQ7WKVC_cjs.revokeOperator; }
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(exports, "setOperator", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: function () { return chunkITQ7WKVC_cjs.setOperator; }
|
|
96
|
+
});
|
|
97
|
+
Object.defineProperty(exports, "erc7984OperatorAbi", {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function () { return chunkFWHYQZ5E_cjs.erc7984OperatorAbi; }
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(exports, "AccessDeniedError", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function () { return chunk56UI7LUR_cjs.AccessDeniedError; }
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(exports, "AlreadyInitializedError", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function () { return chunk56UI7LUR_cjs.AlreadyInitializedError; }
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(exports, "BatchTooLargeError", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function () { return chunk56UI7LUR_cjs.BatchTooLargeError; }
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(exports, "ContractRevertError", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
get: function () { return chunk56UI7LUR_cjs.ContractRevertError; }
|
|
116
|
+
});
|
|
117
|
+
Object.defineProperty(exports, "DecryptionFailedError", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: function () { return chunk56UI7LUR_cjs.DecryptionFailedError; }
|
|
120
|
+
});
|
|
121
|
+
Object.defineProperty(exports, "DeploymentAddressUnavailableError", {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: function () { return chunk56UI7LUR_cjs.DeploymentAddressUnavailableError; }
|
|
124
|
+
});
|
|
125
|
+
Object.defineProperty(exports, "EncryptionFailedError", {
|
|
126
|
+
enumerable: true,
|
|
127
|
+
get: function () { return chunk56UI7LUR_cjs.EncryptionFailedError; }
|
|
128
|
+
});
|
|
129
|
+
Object.defineProperty(exports, "FeatureDisabledError", {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
get: function () { return chunk56UI7LUR_cjs.FeatureDisabledError; }
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(exports, "FheHandleNotAllowedError", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: function () { return chunk56UI7LUR_cjs.FheHandleNotAllowedError; }
|
|
136
|
+
});
|
|
137
|
+
Object.defineProperty(exports, "InsufficientBalanceError", {
|
|
138
|
+
enumerable: true,
|
|
139
|
+
get: function () { return chunk56UI7LUR_cjs.InsufficientBalanceError; }
|
|
140
|
+
});
|
|
141
|
+
Object.defineProperty(exports, "InsufficientFeeError", {
|
|
142
|
+
enumerable: true,
|
|
143
|
+
get: function () { return chunk56UI7LUR_cjs.InsufficientFeeError; }
|
|
144
|
+
});
|
|
145
|
+
Object.defineProperty(exports, "InsufficientGasFundsError", {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function () { return chunk56UI7LUR_cjs.InsufficientGasFundsError; }
|
|
148
|
+
});
|
|
149
|
+
Object.defineProperty(exports, "InvalidArgumentError", {
|
|
150
|
+
enumerable: true,
|
|
151
|
+
get: function () { return chunk56UI7LUR_cjs.InvalidArgumentError; }
|
|
152
|
+
});
|
|
153
|
+
Object.defineProperty(exports, "InvalidSignatureError", {
|
|
154
|
+
enumerable: true,
|
|
155
|
+
get: function () { return chunk56UI7LUR_cjs.InvalidSignatureError; }
|
|
156
|
+
});
|
|
157
|
+
Object.defineProperty(exports, "MissingAccountError", {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: function () { return chunk56UI7LUR_cjs.MissingAccountError; }
|
|
160
|
+
});
|
|
161
|
+
Object.defineProperty(exports, "MissingClientError", {
|
|
162
|
+
enumerable: true,
|
|
163
|
+
get: function () { return chunk56UI7LUR_cjs.MissingClientError; }
|
|
164
|
+
});
|
|
165
|
+
Object.defineProperty(exports, "MissingEncryptorError", {
|
|
166
|
+
enumerable: true,
|
|
167
|
+
get: function () { return chunk56UI7LUR_cjs.MissingEncryptorError; }
|
|
168
|
+
});
|
|
169
|
+
Object.defineProperty(exports, "MissingPublicClientError", {
|
|
170
|
+
enumerable: true,
|
|
171
|
+
get: function () { return chunk56UI7LUR_cjs.MissingPublicClientError; }
|
|
172
|
+
});
|
|
173
|
+
Object.defineProperty(exports, "MissingWalletClientError", {
|
|
174
|
+
enumerable: true,
|
|
175
|
+
get: function () { return chunk56UI7LUR_cjs.MissingWalletClientError; }
|
|
176
|
+
});
|
|
177
|
+
Object.defineProperty(exports, "NetworkError", {
|
|
178
|
+
enumerable: true,
|
|
179
|
+
get: function () { return chunk56UI7LUR_cjs.NetworkError; }
|
|
180
|
+
});
|
|
181
|
+
Object.defineProperty(exports, "PausedError", {
|
|
182
|
+
enumerable: true,
|
|
183
|
+
get: function () { return chunk56UI7LUR_cjs.PausedError; }
|
|
184
|
+
});
|
|
185
|
+
Object.defineProperty(exports, "ReceiptEventAmbiguousError", {
|
|
186
|
+
enumerable: true,
|
|
187
|
+
get: function () { return chunk56UI7LUR_cjs.ReceiptEventAmbiguousError; }
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(exports, "ReceiptEventNotFoundError", {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
get: function () { return chunk56UI7LUR_cjs.ReceiptEventNotFoundError; }
|
|
192
|
+
});
|
|
193
|
+
Object.defineProperty(exports, "ReentrancyError", {
|
|
194
|
+
enumerable: true,
|
|
195
|
+
get: function () { return chunk56UI7LUR_cjs.ReentrancyError; }
|
|
196
|
+
});
|
|
197
|
+
Object.defineProperty(exports, "RelayerUnreachableError", {
|
|
198
|
+
enumerable: true,
|
|
199
|
+
get: function () { return chunk56UI7LUR_cjs.RelayerUnreachableError; }
|
|
200
|
+
});
|
|
201
|
+
Object.defineProperty(exports, "SigningFailedError", {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function () { return chunk56UI7LUR_cjs.SigningFailedError; }
|
|
204
|
+
});
|
|
205
|
+
Object.defineProperty(exports, "TokenOpsContractError", {
|
|
206
|
+
enumerable: true,
|
|
207
|
+
get: function () { return chunk56UI7LUR_cjs.TokenOpsContractError; }
|
|
208
|
+
});
|
|
209
|
+
Object.defineProperty(exports, "TokenOpsSdkError", {
|
|
210
|
+
enumerable: true,
|
|
211
|
+
get: function () { return chunk56UI7LUR_cjs.TokenOpsSdkError; }
|
|
212
|
+
});
|
|
213
|
+
Object.defineProperty(exports, "TokenOpsValidationError", {
|
|
214
|
+
enumerable: true,
|
|
215
|
+
get: function () { return chunk56UI7LUR_cjs.TokenOpsValidationError; }
|
|
216
|
+
});
|
|
217
|
+
Object.defineProperty(exports, "TransferFailedError", {
|
|
218
|
+
enumerable: true,
|
|
219
|
+
get: function () { return chunk56UI7LUR_cjs.TransferFailedError; }
|
|
220
|
+
});
|
|
221
|
+
Object.defineProperty(exports, "UnknownWriteFailureError", {
|
|
222
|
+
enumerable: true,
|
|
223
|
+
get: function () { return chunk56UI7LUR_cjs.UnknownWriteFailureError; }
|
|
224
|
+
});
|
|
225
|
+
Object.defineProperty(exports, "UnsupportedChainError", {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: function () { return chunk56UI7LUR_cjs.UnsupportedChainError; }
|
|
228
|
+
});
|
|
229
|
+
Object.defineProperty(exports, "UserDecryptNotAllowedError", {
|
|
230
|
+
enumerable: true,
|
|
231
|
+
get: function () { return chunk56UI7LUR_cjs.UserDecryptNotAllowedError; }
|
|
232
|
+
});
|
|
233
|
+
Object.defineProperty(exports, "UserRejectedSignatureError", {
|
|
234
|
+
enumerable: true,
|
|
235
|
+
get: function () { return chunk56UI7LUR_cjs.UserRejectedSignatureError; }
|
|
236
|
+
});
|
|
237
|
+
Object.defineProperty(exports, "WalletChainMismatchError", {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
get: function () { return chunk56UI7LUR_cjs.WalletChainMismatchError; }
|
|
240
|
+
});
|
|
241
|
+
Object.defineProperty(exports, "WalletRejectedError", {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function () { return chunk56UI7LUR_cjs.WalletRejectedError; }
|
|
244
|
+
});
|
|
245
|
+
Object.defineProperty(exports, "isTokenOpsSdkError", {
|
|
246
|
+
enumerable: true,
|
|
247
|
+
get: function () { return chunk56UI7LUR_cjs.isTokenOpsSdkError; }
|
|
248
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { ConfidentialDisperseClient, createConfidentialDisperseClient, computeSubtotals, type ConfidentialDisperseClientConfig, } from "./singleton.js";
|
|
2
|
+
export { encryptUint64, encryptUint64Batch, resolveEncryptor, type Encryptor, type EncryptorSource, type EncryptUint64Args, type EncryptUint64BatchArgs, type FheValueInput, } from "./encryption.js";
|
|
3
|
+
export { setOperator, revokeOperator, ERC7984_OPERATOR_MAX_DEADLINE, type SetOperatorArgs, type RevokeOperatorArgs, } from "../fhe/operators.js";
|
|
4
|
+
export { DisperseSubwalletNotFoundError, DisperseEncryptedReserveNotGrantedError, type BatchDiscloseHandlesArgs, type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type CustomFee, type DiscloseHandleArgs, type DisclosureResult, type DisperseArgs, type DisperseDistribution, type DisperseMode, type DisperseResult, type EncryptedInput, type EncryptedInputs, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PreflightDisperseArgs, type PreflightReport, type RecipientCheck, type RegisterResult, type SubwalletApprovalState, type UserFees, type WithdrawTokenFeeResult, } from "./types.js";
|
|
5
|
+
export { disperseConfidentialAbi, disperseWalletAbi } from "./abis/index.js";
|
|
6
|
+
export { erc7984OperatorAbi } from "../fhe/erc7984-abi.js";
|
|
7
|
+
export declare const FEE_COLLECTOR_ROLE: "0x2dca0f5ce7e75a4b43fe2b0d6f5d0b7a2bf92ecf89f8f0aa17b8308b67038821";
|
|
8
|
+
export declare const FEE_MANAGER_ROLE: "0x6c0757dc3e6b28b2580c03fd9e96c274acf4f99d91fbec9b418fa1d70604ff1c";
|
|
9
|
+
export declare const PAUSER_ROLE: "0x65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a";
|
|
10
|
+
export declare const WITHDRAWER_ROLE: "0x10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e4";
|
|
11
|
+
export declare const DEFAULT_ADMIN_ROLE: "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
12
|
+
export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, TokenOpsValidationError, ContractRevertError, TokenOpsContractError, PausedError, AccessDeniedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../core/errors.js";
|
|
13
|
+
export { type PreflightResult } from "../core/preflight.js";
|
|
14
|
+
export { NotRegisteredError, AlreadyRegisteredError } from "./errors.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { ConfidentialDisperseClient, createConfidentialDisperseClient, computeSubtotals, type ConfidentialDisperseClientConfig, } from "./singleton.js";
|
|
2
|
+
export { encryptUint64, encryptUint64Batch, resolveEncryptor, type Encryptor, type EncryptorSource, type EncryptUint64Args, type EncryptUint64BatchArgs, type FheValueInput, } from "./encryption.js";
|
|
3
|
+
export { setOperator, revokeOperator, ERC7984_OPERATOR_MAX_DEADLINE, type SetOperatorArgs, type RevokeOperatorArgs, } from "../fhe/operators.js";
|
|
4
|
+
export { DisperseSubwalletNotFoundError, DisperseEncryptedReserveNotGrantedError, type BatchDiscloseHandlesArgs, type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type CustomFee, type DiscloseHandleArgs, type DisclosureResult, type DisperseArgs, type DisperseDistribution, type DisperseMode, type DisperseResult, type EncryptedInput, type EncryptedInputs, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PreflightDisperseArgs, type PreflightReport, type RecipientCheck, type RegisterResult, type SubwalletApprovalState, type UserFees, type WithdrawTokenFeeResult, } from "./types.js";
|
|
5
|
+
export { disperseConfidentialAbi, disperseWalletAbi } from "./abis/index.js";
|
|
6
|
+
export { erc7984OperatorAbi } from "../fhe/erc7984-abi.js";
|
|
7
|
+
export declare const FEE_COLLECTOR_ROLE: "0x2dca0f5ce7e75a4b43fe2b0d6f5d0b7a2bf92ecf89f8f0aa17b8308b67038821";
|
|
8
|
+
export declare const FEE_MANAGER_ROLE: "0x6c0757dc3e6b28b2580c03fd9e96c274acf4f99d91fbec9b418fa1d70604ff1c";
|
|
9
|
+
export declare const PAUSER_ROLE: "0x65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a";
|
|
10
|
+
export declare const WITHDRAWER_ROLE: "0x10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e4";
|
|
11
|
+
export declare const DEFAULT_ADMIN_ROLE: "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
12
|
+
export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, TokenOpsValidationError, ContractRevertError, TokenOpsContractError, PausedError, AccessDeniedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../core/errors.js";
|
|
13
|
+
export { type PreflightResult } from "../core/preflight.js";
|
|
14
|
+
export { NotRegisteredError, AlreadyRegisteredError } from "./errors.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { AlreadyRegisteredError, ConfidentialDisperseClient, DEFAULT_ADMIN_ROLE, DisperseEncryptedReserveNotGrantedError, DisperseSubwalletNotFoundError, FEE_COLLECTOR_ROLE, FEE_MANAGER_ROLE, NotRegisteredError, PAUSER_ROLE, WITHDRAWER_ROLE, computeSubtotals, createConfidentialDisperseClient, disperseConfidentialAbi, disperseWalletAbi, encryptUint64, encryptUint64Batch, resolveEncryptor } from '../chunk-QIHZVLIK.js';
|
|
2
|
+
export { ERC7984_OPERATOR_MAX_DEADLINE, revokeOperator, setOperator } from '../chunk-WRCUDSUJ.js';
|
|
3
|
+
export { erc7984OperatorAbi } from '../chunk-7VELUOMI.js';
|
|
4
|
+
import '../chunk-ZXCOJY2Z.js';
|
|
5
|
+
import '../chunk-FYQ2UW4T.js';
|
|
6
|
+
import '../chunk-JFLEEXKP.js';
|
|
7
|
+
import '../chunk-COPFW5Z4.js';
|
|
8
|
+
import '../chunk-BE2AIZ3K.js';
|
|
9
|
+
import '../chunk-Q2GP5UDC.js';
|
|
10
|
+
import '../chunk-KWFFIJYX.js';
|
|
11
|
+
export { AccessDeniedError, AlreadyInitializedError, BatchTooLargeError, ContractRevertError, DecryptionFailedError, DeploymentAddressUnavailableError, EncryptionFailedError, FeatureDisabledError, FheHandleNotAllowedError, InsufficientBalanceError, InsufficientFeeError, InsufficientGasFundsError, InvalidArgumentError, InvalidSignatureError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, NetworkError, PausedError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, ReentrancyError, RelayerUnreachableError, SigningFailedError, TokenOpsContractError, TokenOpsSdkError, TokenOpsValidationError, TransferFailedError, UnknownWriteFailureError, UnsupportedChainError, UserDecryptNotAllowedError, UserRejectedSignatureError, WalletChainMismatchError, WalletRejectedError, isTokenOpsSdkError } from '../chunk-IVE3QEGD.js';
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { Address, PublicClient, WalletClient } from "viem";
|
|
2
|
+
import { DeploymentAddressUnavailableError } from "../../core/errors.js";
|
|
3
|
+
import { type Encryptor, type EncryptorSource } from "../encryption.js";
|
|
4
|
+
import { type ConfidentialDisperseClient } from "../singleton.js";
|
|
5
|
+
/** Common per-hook overrides — every public hook accepts these alongside its own args. */
|
|
6
|
+
export interface BaseHookOptions {
|
|
7
|
+
/** Override the on-chain singleton address. Defaults to {@link getFheDisperseSingletonAddress} keyed by chain id. */
|
|
8
|
+
address?: Address;
|
|
9
|
+
/** Override the chain id used for default address resolution. Defaults to `usePublicClient().chain?.id`. */
|
|
10
|
+
chainId?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Per-hook overrides for FHE-disperse hooks. The singleton has one deployed
|
|
14
|
+
* address per chain — `address` is optional and resolved by chain id via
|
|
15
|
+
* {@link getFheDisperseSingletonAddress}. Pass `encryptor` here so methods that submit
|
|
16
|
+
* encrypted inputs (`useDisperse`, `useWithdrawTokenFee`) can pick it up.
|
|
17
|
+
*/
|
|
18
|
+
export interface DisperseHookOptions extends BaseHookOptions {
|
|
19
|
+
/**
|
|
20
|
+
* Lazy or eager encryptor source. Optional at hook level; **required at call
|
|
21
|
+
* time** for methods that submit encrypted inputs (`useDisperse`,
|
|
22
|
+
* `useWithdrawTokenFee`).
|
|
23
|
+
*
|
|
24
|
+
* Recommended in React: capture `useZamaSDK()` once at the top of your
|
|
25
|
+
* component and wire `encryptor: () => sdk.relayer` — the SDK
|
|
26
|
+
* calls this per-encryption so it picks up the live `ZamaSDK` instance
|
|
27
|
+
* rather than a stale capture (CLAUDE.md Pitfall #3). An eager `Encryptor`
|
|
28
|
+
* instance also type-checks and is appropriate for server-side or test code.
|
|
29
|
+
*
|
|
30
|
+
* The SDK does NOT call `useZamaSDK()` automatically — calling a React hook
|
|
31
|
+
* from inside a mutation body would violate the rules of hooks. If
|
|
32
|
+
* `encryptor` is omitted and a method that needs one runs, the SDK throws
|
|
33
|
+
* `TokenOpsSdkError("Missing encryptor — pass ...")`.
|
|
34
|
+
*/
|
|
35
|
+
encryptor?: EncryptorSource;
|
|
36
|
+
/** Override the FHEVM ACL address (defaults to chain-id lookup). */
|
|
37
|
+
aclAddress?: Address;
|
|
38
|
+
}
|
|
39
|
+
/** Stable query-key prefix for every hook in this subpath. */
|
|
40
|
+
export declare const FHE_DISPERSE_KEY: "tokenops-sdk";
|
|
41
|
+
export declare const FHE_DISPERSE_NAMESPACE: "fhe-disperse";
|
|
42
|
+
/**
|
|
43
|
+
* Resolve the FHE-disperse singleton address for `chainId`, mirroring the
|
|
44
|
+
* headless client's resolution. Throws the same {@link TokenOpsSdkError} the
|
|
45
|
+
* headless client would throw at construction time.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveSingletonAddress(override: Address | undefined, chainId: number | undefined): Address;
|
|
48
|
+
/**
|
|
49
|
+
* Same as {@link resolveSingletonAddress} but returns `undefined` instead of
|
|
50
|
+
* throwing. Used by query-key builders and `enabled` gates.
|
|
51
|
+
*/
|
|
52
|
+
export declare function tryResolveSingletonAddress(override: Address | undefined, chainId: number | undefined): Address | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Memoize a {@link ConfidentialDisperseClient} keyed on
|
|
55
|
+
* `(publicClient, walletClient, address, aclAddress)`. The encryptor source is
|
|
56
|
+
* passed through as a **lazy** function (mirroring Pitfall #3 from CLAUDE.md):
|
|
57
|
+
* the SDK calls it per-encryption, picking up the live React context at submit
|
|
58
|
+
* time rather than baking in a stale capture.
|
|
59
|
+
*
|
|
60
|
+
* @returns `{ client, resolutionError, publicClient, walletClient, chainId, resolvedAddress }`.
|
|
61
|
+
* `client` is `undefined` when no `publicClient` is available (wagmi may
|
|
62
|
+
* briefly return `undefined` during reconnects) or when the singleton
|
|
63
|
+
* address could not be resolved — gate queries with `enabled: !!client`.
|
|
64
|
+
* `resolutionError` carries the typed deployment-address error that
|
|
65
|
+
* {@link resolveSingletonAddress} would have thrown (e.g.
|
|
66
|
+
* `DeploymentAddressUnavailableError`); mutation hooks throw it before
|
|
67
|
+
* falling back to a generic `MissingClientError` so consumers see the real
|
|
68
|
+
* "unsupported chain" / "not deployed on this chain" reason.
|
|
69
|
+
*/
|
|
70
|
+
export declare function useMemoDisperseClient(opts?: DisperseHookOptions): {
|
|
71
|
+
client: ConfidentialDisperseClient | undefined;
|
|
72
|
+
resolutionError: DeploymentAddressUnavailableError | undefined;
|
|
73
|
+
publicClient: PublicClient | undefined;
|
|
74
|
+
walletClient: WalletClient | undefined;
|
|
75
|
+
chainId: number | undefined;
|
|
76
|
+
resolvedAddress: Address | undefined;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Resolve the encryptor for a mutation call. Order:
|
|
80
|
+
* 1. Explicit `override` (eager `Encryptor` or lazy `() => Encryptor | undefined`).
|
|
81
|
+
* 2. The hook-level `encryptor` source from the hook options.
|
|
82
|
+
*
|
|
83
|
+
* Both are resolved per-call (not cached), mirroring the lazy `EncryptorSource`
|
|
84
|
+
* pattern from CLAUDE.md Pitfall #3 — the consumer's React context is the
|
|
85
|
+
* source of truth.
|
|
86
|
+
*
|
|
87
|
+
* If both are missing, throws an actionable error. The hook layer does NOT
|
|
88
|
+
* dynamically import `@zama-fhe/react-sdk` — calling `useZamaSDK()` from
|
|
89
|
+
* inside `mutationFn` would violate the rules of hooks. Consumers wire the
|
|
90
|
+
* encryptor at hook construction. The safe pattern is two lines:
|
|
91
|
+
* `const sdk = useZamaSDK();` then `encryptor: () => sdk.relayer` — never
|
|
92
|
+
* `() => useZamaSDK().relayer` inline (that calls a React hook inside a
|
|
93
|
+
* mutation body, violating the rules of hooks).
|
|
94
|
+
*/
|
|
95
|
+
export declare function resolveCallTimeEncryptor(override: Encryptor | EncryptorSource | undefined, hookLevelSource: EncryptorSource | undefined): Encryptor;
|
|
96
|
+
/**
|
|
97
|
+
* Build a stable TanStack Query key for an FHE-disperse hook.
|
|
98
|
+
*
|
|
99
|
+
* Conventions:
|
|
100
|
+
* - Lowercase the contract address (TanStack uses structural equality; viem
|
|
101
|
+
* sometimes returns checksummed addresses).
|
|
102
|
+
* - Convert bigints to base-10 strings (TanStack's serializer doesn't handle bigints).
|
|
103
|
+
*/
|
|
104
|
+
export declare function buildQueryKey(method: string, chainId: number | undefined, address: Address | undefined, ...args: ReadonlyArray<unknown>): ReadonlyArray<unknown>;
|