@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,442 @@
|
|
|
1
|
+
import type { Account, Address, Hex, PublicClient, WalletClient } from "viem";
|
|
2
|
+
import { type TxHash } from "../core/brands.js";
|
|
3
|
+
import { type SdkTelemetry } from "../core/telemetry.js";
|
|
4
|
+
import { type Encryptor, type EncryptorSource } from "./encryption.js";
|
|
5
|
+
import { type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type CustomFee, type DisperseArgs, type DisperseResult, type DisclosureResult, type BatchDiscloseHandlesArgs, type DiscloseHandleArgs, type EncryptedInput, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PreflightDisperseArgs, type PreflightReport, type RegisterResult, type SubwalletApprovalState, type UserFees, type WithdrawTokenFeeResult } from "./types.js";
|
|
6
|
+
export interface ConfidentialDisperseClientConfig {
|
|
7
|
+
/** viem public client for read calls. */
|
|
8
|
+
publicClient: PublicClient;
|
|
9
|
+
/** viem wallet client for write calls. Optional for read-only usage. */
|
|
10
|
+
walletClient?: WalletClient | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Override the singleton address. Falls back to
|
|
13
|
+
* `DEPLOYED_ADDRESSES.fheDisperse.disperseConfidentialSingleton[chainId]`.
|
|
14
|
+
* Required when that entry is `null` (i.e., singleton not yet deployed on this chain).
|
|
15
|
+
*/
|
|
16
|
+
address?: Address | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Chain id used to look up the default singleton address and the FHEVM ACL address.
|
|
19
|
+
* Defaults to `publicClient.chain?.id`.
|
|
20
|
+
*/
|
|
21
|
+
chainId?: number | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Default encryptor for `disperse` and `getEncryptedFeeReserve`.
|
|
24
|
+
* Accepts an eager instance or a lazy factory (for React / Vue hosts).
|
|
25
|
+
*
|
|
26
|
+
* **Wallet-switch hazard.** A `RelayerWeb` instance binds to the signing
|
|
27
|
+
* keypair active when it was constructed. If you cache a single SDK client
|
|
28
|
+
* across wallet switches in a React/Vue app, the lazy factory MUST return
|
|
29
|
+
* a freshly constructed `RelayerWeb` for the new active account — returning
|
|
30
|
+
* a memoised instance built for the previous user will produce
|
|
31
|
+
* input-proofs the KMSVerifier rejects on-chain.
|
|
32
|
+
*/
|
|
33
|
+
encryptor?: EncryptorSource | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* FHEVM ACL contract address override. When omitted, resolved from the
|
|
36
|
+
* effective chain id (`chainId` arg or `publicClient.chain?.id`) via the
|
|
37
|
+
* SDK's chain registry; the constructor throws
|
|
38
|
+
* `DeploymentAddressUnavailableError` if neither is available. Required
|
|
39
|
+
* because `getEncryptedFeeReserve` filters the receipt for ACL grants
|
|
40
|
+
* to extract the returned handle.
|
|
41
|
+
*/
|
|
42
|
+
aclAddress?: Address | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Optional telemetry sink. When provided, the SDK emits a `fhe-disperse.client.init`
|
|
45
|
+
* event on construction and brackets public write methods with named spans
|
|
46
|
+
* (`fhe-disperse.singleton.register`, `…disperse`, …). Defaults to a no-op —
|
|
47
|
+
* zero overhead, zero leakage of consumer-side identifiers.
|
|
48
|
+
*
|
|
49
|
+
* The shape is structurally compatible with `NoopTelemetry` / `ConsoleTelemetry` /
|
|
50
|
+
* `TokenOpsTelemetry` exported from `@tokenops/sdk/telemetry`.
|
|
51
|
+
*/
|
|
52
|
+
telemetry?: SdkTelemetry | undefined;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Typed SDK wrapper for the deployed `DisperseConfidential` singleton.
|
|
56
|
+
*
|
|
57
|
+
* One `DisperseConfidential` exists per chain (no factory). This client is
|
|
58
|
+
* wired to a specific chain's singleton address, either by explicit `address`
|
|
59
|
+
* override or via `DEPLOYED_ADDRESSES.fheDisperse.disperseConfidentialSingleton[chainId]`.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* // On Sepolia or mainnet the singleton address auto-resolves from
|
|
63
|
+
* // `DEPLOYED_ADDRESSES.fheDisperse.disperseConfidentialSingleton[chainId]`;
|
|
64
|
+
* // pass `address` explicitly only for custom networks.
|
|
65
|
+
* const client = new ConfidentialDisperseClient({
|
|
66
|
+
* publicClient,
|
|
67
|
+
* walletClient,
|
|
68
|
+
* encryptor,
|
|
69
|
+
* });
|
|
70
|
+
* await client.register({ token });
|
|
71
|
+
* await client.disperse({ token, mode: "direct", recipients, amounts });
|
|
72
|
+
*/
|
|
73
|
+
export declare class ConfidentialDisperseClient {
|
|
74
|
+
#private;
|
|
75
|
+
readonly publicClient: PublicClient;
|
|
76
|
+
readonly walletClient?: WalletClient;
|
|
77
|
+
readonly address: Address;
|
|
78
|
+
readonly encryptor?: EncryptorSource;
|
|
79
|
+
constructor(config: ConfidentialDisperseClientConfig);
|
|
80
|
+
/**
|
|
81
|
+
* The FHEVM ACL contract address used by encrypted-view methods to parse
|
|
82
|
+
* `ACL.Allowed` events. Resolved lazily on first access; throws
|
|
83
|
+
* `DeploymentAddressUnavailableError` if no override was passed and the
|
|
84
|
+
* SDK does not have an ACL deployed for the connected chain.
|
|
85
|
+
*/
|
|
86
|
+
get aclAddress(): Address;
|
|
87
|
+
/**
|
|
88
|
+
* Check whether a user has registered their wallet pair via `register(token)`.
|
|
89
|
+
*/
|
|
90
|
+
isRegistered(user: Address): Promise<boolean>;
|
|
91
|
+
/**
|
|
92
|
+
* Return the on-chain wallet pair for a registered user, or `null` if not registered.
|
|
93
|
+
*
|
|
94
|
+
* Both wallet addresses are fetched in parallel via `getUserWallet(user, 0|1)`.
|
|
95
|
+
* For unregistered users, call {@link predictWallets} to get the deterministic
|
|
96
|
+
* addresses they would get after registration.
|
|
97
|
+
*/
|
|
98
|
+
getWallets(user: Address): Promise<[Address, Address] | null>;
|
|
99
|
+
/**
|
|
100
|
+
* Deterministically predict the wallet addresses a user would get after
|
|
101
|
+
* calling `register()`, even before registration.
|
|
102
|
+
*
|
|
103
|
+
* Reads `WALLET_IMPLEMENTATION()` once from chain, then applies the same
|
|
104
|
+
* `keccak256(abi.encodePacked(user, uint256(0|1)))` salt scheme used in the
|
|
105
|
+
* contract's `_registerWallets` function.
|
|
106
|
+
*
|
|
107
|
+
* Note: `Clones.predictDeterministicAddress(impl, salt)` without an explicit
|
|
108
|
+
* deployer uses `address(this)` (the singleton) as the deployer — mirrored here.
|
|
109
|
+
*/
|
|
110
|
+
predictWallets(user: Address): Promise<[Address, Address]>;
|
|
111
|
+
/**
|
|
112
|
+
* Return consolidated fee information for a user in a single helper.
|
|
113
|
+
*
|
|
114
|
+
* Combines `getFeeAmounts(user)` (per-user resolved fees) and `feeConfig()`
|
|
115
|
+
* (global toggles) in two parallel RPC calls. UI code calls this to render
|
|
116
|
+
* the fee panel before the user submits.
|
|
117
|
+
*/
|
|
118
|
+
getFees(user: Address): Promise<UserFees>;
|
|
119
|
+
/**
|
|
120
|
+
* Read the raw per-user fee override stored on-chain, BEFORE the global
|
|
121
|
+
* toggles are applied. Returns `{ enabled: false, gasFeeWei: 0n,
|
|
122
|
+
* tokenFeeBps: 0 }` when no override exists for `user`.
|
|
123
|
+
*
|
|
124
|
+
* Use this — not {@link getFees} — when you need to distinguish "no
|
|
125
|
+
* override set" from "override set but globally disabled". The resolved
|
|
126
|
+
* shape is in {@link getFees}.
|
|
127
|
+
*/
|
|
128
|
+
getCustomFee(user: Address): Promise<CustomFee>;
|
|
129
|
+
/**
|
|
130
|
+
* Return the on-chain global fee configuration.
|
|
131
|
+
*
|
|
132
|
+
* Round-trips against {@link setFeeConfig} — pass the result back unchanged
|
|
133
|
+
* to update one toggle without re-stating the others. Note that ABI outputs
|
|
134
|
+
* are positional, not named — viem decodes the tuple as an array.
|
|
135
|
+
*/
|
|
136
|
+
getFeeConfig(): Promise<FeeConfig>;
|
|
137
|
+
/**
|
|
138
|
+
* Return batch size limits for all three disperse modes.
|
|
139
|
+
* `0n` means no limit is configured.
|
|
140
|
+
*/
|
|
141
|
+
getBatchLimits(): Promise<BatchLimits>;
|
|
142
|
+
/**
|
|
143
|
+
* Calculate the fee for a specific disperse call without writing to chain.
|
|
144
|
+
*
|
|
145
|
+
* Reads live fee data via `getFeeAmounts(user)` and computes:
|
|
146
|
+
* - `"wallet"` / `"direct"`: `ethValue = recipients * gasFeeWei`, no token fee.
|
|
147
|
+
* - `"wallet-token-fee"`: `ethValue = 0n`, `tokenFeeAmount = totalTokens * tokenFeeBps / 10000n`.
|
|
148
|
+
*
|
|
149
|
+
* **For `"wallet-token-fee"` mode**, the on-chain fee base is the
|
|
150
|
+
* post-cap subtotal sum (`subtotal0 + subtotal1`), not `sum(amounts[])`.
|
|
151
|
+
* The two differ only when the caller has independently constructed subtotals
|
|
152
|
+
* that don't match `sum(amounts)` — pass `totalTokens === subtotal0 +
|
|
153
|
+
* subtotal1` for the result to match the on-chain computation. Both this
|
|
154
|
+
* SDK and the contract round the BPS multiplication down (floor division).
|
|
155
|
+
*
|
|
156
|
+
* @throws {TokenOpsSdkError} if mode is `"wallet-token-fee"` and `totalTokens` is not provided.
|
|
157
|
+
*/
|
|
158
|
+
calculateFee(args: CalculateFeeArgs): Promise<CalculatedFee>;
|
|
159
|
+
/**
|
|
160
|
+
* Check whether a user's registered subwallets have approved the singleton
|
|
161
|
+
* as an ERC-7984 operator for the given token.
|
|
162
|
+
*
|
|
163
|
+
* Calls `isOperator(wallet, singleton)` on the token contract for each wallet.
|
|
164
|
+
* Both wallets must return `true` for wallet-mode disperses to work.
|
|
165
|
+
*
|
|
166
|
+
* Note: this requires the user to already be registered. For unregistered
|
|
167
|
+
* users, call {@link predictWallets} first and check predicted addresses.
|
|
168
|
+
*/
|
|
169
|
+
hasApprovedSubwallets(args: {
|
|
170
|
+
user: Address;
|
|
171
|
+
token: Address;
|
|
172
|
+
}): Promise<SubwalletApprovalState>;
|
|
173
|
+
/**
|
|
174
|
+
* Comprehensive pre-flight report. One call gives a UI everything it needs
|
|
175
|
+
* to render a "ready to disperse" checklist.
|
|
176
|
+
*
|
|
177
|
+
* Internally composes:
|
|
178
|
+
* - `isRegistered` + `getWallets` / `predictWallets`
|
|
179
|
+
* - `hasApprovedSubwallets` (wallet modes) or `isOperator(sender, singleton)` (direct mode)
|
|
180
|
+
* - `calculateFee` / `getBatchLimits`
|
|
181
|
+
* - Structural recipient + amount validation
|
|
182
|
+
*/
|
|
183
|
+
preflightDisperse(args: PreflightDisperseArgs): Promise<PreflightReport>;
|
|
184
|
+
/**
|
|
185
|
+
* Register the caller's dedicated wallet pair for wallet-mode disperses.
|
|
186
|
+
*
|
|
187
|
+
* Deploys two deterministic ERC-1167 wallet clones and approves them for `token`.
|
|
188
|
+
* Can only be called once per user — subsequent calls revert with `UserAlreadyRegistered`.
|
|
189
|
+
*
|
|
190
|
+
* @returns `{ hash, wallets }` — `wallets` is parsed from the `UserRegistered` event.
|
|
191
|
+
* @throws {DisperseSubwalletNotFoundError} if no `UserRegistered` event matching the singleton is found.
|
|
192
|
+
*/
|
|
193
|
+
register(args: {
|
|
194
|
+
token: Address;
|
|
195
|
+
account?: Account | Address;
|
|
196
|
+
}): Promise<RegisterResult>;
|
|
197
|
+
/**
|
|
198
|
+
* Approve the caller's existing registered wallets as ERC-7984 operators for `token`.
|
|
199
|
+
*
|
|
200
|
+
* Required for wallet-mode disperses when using a token different from the one
|
|
201
|
+
* passed at registration time.
|
|
202
|
+
*/
|
|
203
|
+
approveTokenOnWallets(args: {
|
|
204
|
+
token: Address;
|
|
205
|
+
account?: Account | Address;
|
|
206
|
+
}): Promise<Hex>;
|
|
207
|
+
/**
|
|
208
|
+
* Revoke the operator approval on `token` for the caller's wallets.
|
|
209
|
+
*
|
|
210
|
+
* The user can re-approve later via `approveTokenOnWallets`.
|
|
211
|
+
*/
|
|
212
|
+
revokeTokenOnWallets(args: {
|
|
213
|
+
token: Address;
|
|
214
|
+
account?: Account | Address;
|
|
215
|
+
}): Promise<Hex>;
|
|
216
|
+
/**
|
|
217
|
+
* Recover all residual confidential tokens from the caller's wallets to `to`.
|
|
218
|
+
*
|
|
219
|
+
* Use after a wallet-mode disperse where the subtotals were inflated and tokens
|
|
220
|
+
* remain locked in the wallets. Returns the bare tx hash (not a wrapped result
|
|
221
|
+
* object) — unlike `disperse()`, this method does not surface any additional
|
|
222
|
+
* receipt-derived data.
|
|
223
|
+
*/
|
|
224
|
+
recoverFromWallets(args: {
|
|
225
|
+
token: Address;
|
|
226
|
+
to: Address;
|
|
227
|
+
account?: Account | Address;
|
|
228
|
+
}): Promise<Hex>;
|
|
229
|
+
/**
|
|
230
|
+
* Recover ERC-20 tokens accidentally sent to the caller's wallets. Returns the
|
|
231
|
+
* bare tx hash.
|
|
232
|
+
*/
|
|
233
|
+
recoverERC20FromWallets(args: {
|
|
234
|
+
token: Address;
|
|
235
|
+
to: Address;
|
|
236
|
+
account?: Account | Address;
|
|
237
|
+
}): Promise<Hex>;
|
|
238
|
+
/**
|
|
239
|
+
* Disperse confidential tokens to multiple recipients.
|
|
240
|
+
*
|
|
241
|
+
* SDK responsibilities:
|
|
242
|
+
* 1. Validates input deterministically (lengths, zero addresses, per-amount
|
|
243
|
+
* uint64 bounds, wallet-mode subtotal overflow, batch-limit for the
|
|
244
|
+
* selected mode) — using the same {@link validateDisperseInputs} helper
|
|
245
|
+
* `preflightDisperse` uses, so an oversized or malformed batch is rejected
|
|
246
|
+
* before any FHE encryption time is spent.
|
|
247
|
+
* 2. For wallet modes: computes group subtotals using the contract's exact split rule.
|
|
248
|
+
* 3. Encrypts amounts + subtotals in a single batch call (one input proof).
|
|
249
|
+
* 4. Computes `msg.value` for gas-fee modes; `0` for token-fee mode.
|
|
250
|
+
* 5. Dispatches to the correct contract function based on `mode`.
|
|
251
|
+
*
|
|
252
|
+
* @throws {TokenOpsSdkError} on input validation failure (first deterministic error).
|
|
253
|
+
* @throws {TokenOpsSdkError} if no encryptor is available at call time.
|
|
254
|
+
*/
|
|
255
|
+
disperse(args: DisperseArgs): Promise<DisperseResult>;
|
|
256
|
+
/**
|
|
257
|
+
* **This is a write transaction, not a free view. It costs gas.**
|
|
258
|
+
*
|
|
259
|
+
* Grant the caller persistent FHE ACL on the encrypted token fee reserve and
|
|
260
|
+
* return the handle. The handle is extracted from the receipt's ACL `Allowed`
|
|
261
|
+
* event — using `simulateContract` here would return a divergent handle that
|
|
262
|
+
* breaks user-decrypt downstream (Pitfall #1).
|
|
263
|
+
*
|
|
264
|
+
* If no fees have accrued for `token`, the contract does not emit an ACL event
|
|
265
|
+
* and this method throws {@link DisperseEncryptedReserveNotGrantedError}.
|
|
266
|
+
* Check `FHE.isInitialized` off-chain: a zero-hash handle means the reserve
|
|
267
|
+
* is uninitialised.
|
|
268
|
+
*
|
|
269
|
+
* Requires FEE_COLLECTOR_ROLE or DEFAULT_ADMIN_ROLE.
|
|
270
|
+
*
|
|
271
|
+
* @throws {DisperseEncryptedReserveNotGrantedError} when no ACL event is found
|
|
272
|
+
* (i.e., reserve is uninitialised — no fees have accrued).
|
|
273
|
+
*/
|
|
274
|
+
getEncryptedFeeReserve(args: GetEncryptedFeeReserveArgs): Promise<EncryptedViewResult>;
|
|
275
|
+
/**
|
|
276
|
+
* Grant `party` persistent FHE ACL on a single `handle`.
|
|
277
|
+
*
|
|
278
|
+
* Caller must already hold ACL on `handle`. FHEVM ACL is append-only — the
|
|
279
|
+
* grant cannot be revoked.
|
|
280
|
+
*
|
|
281
|
+
* @returns `{ hash, discloser, party, disclosedHandles }`. The non-`hash`
|
|
282
|
+
* fields are parsed from the `HandlesDisclosedToParty` event when present;
|
|
283
|
+
* if the event is absent (anomalous), they fall back to the call's inputs.
|
|
284
|
+
*/
|
|
285
|
+
discloseHandleToParty(args: DiscloseHandleArgs): Promise<DisclosureResult>;
|
|
286
|
+
/**
|
|
287
|
+
* Batch variant — atomically grant `party` persistent ACL on all `handles`.
|
|
288
|
+
* Reverts on the first handle that fails caller-ACL or contract-ACL checks.
|
|
289
|
+
*/
|
|
290
|
+
batchDiscloseHandlesToParty(args: BatchDiscloseHandlesArgs): Promise<DisclosureResult>;
|
|
291
|
+
/**
|
|
292
|
+
* Pause all disperse operations. Requires PAUSER_ROLE.
|
|
293
|
+
* @returns Transaction hash.
|
|
294
|
+
*/
|
|
295
|
+
pause(account?: Account | Address): Promise<TxHash>;
|
|
296
|
+
/**
|
|
297
|
+
* Unpause the singleton. Requires PAUSER_ROLE.
|
|
298
|
+
* @returns Transaction hash.
|
|
299
|
+
*/
|
|
300
|
+
unpause(account?: Account | Address): Promise<TxHash>;
|
|
301
|
+
/**
|
|
302
|
+
* Update the global fee configuration: enable/disable gas and token fees, set defaults.
|
|
303
|
+
* Requires FEE_MANAGER_ROLE.
|
|
304
|
+
* @returns Transaction hash.
|
|
305
|
+
*/
|
|
306
|
+
setFeeConfig(config: FeeConfig, account?: Account | Address): Promise<Hex>;
|
|
307
|
+
/**
|
|
308
|
+
* Set a per-user fee override (gas fee in wei, token fee in BPS).
|
|
309
|
+
* Requires FEE_MANAGER_ROLE.
|
|
310
|
+
* @returns Transaction hash.
|
|
311
|
+
*/
|
|
312
|
+
setCustomFee(user: Address, gasFee: bigint, tokenFee: number, account?: Account | Address): Promise<Hex>;
|
|
313
|
+
/**
|
|
314
|
+
* Remove a per-user fee override, falling back to the global defaults.
|
|
315
|
+
* Requires FEE_MANAGER_ROLE. Throws `CustomFeeNotSet` if no override exists.
|
|
316
|
+
* @returns Transaction hash.
|
|
317
|
+
*/
|
|
318
|
+
disableCustomFee(user: Address, account?: Account | Address): Promise<Hex>;
|
|
319
|
+
/**
|
|
320
|
+
* Set the maximum batch size for `"wallet"` mode disperses. `0n` = no limit.
|
|
321
|
+
* Requires DEFAULT_ADMIN_ROLE.
|
|
322
|
+
* @returns Transaction hash.
|
|
323
|
+
*/
|
|
324
|
+
setMaxBatchSizeHolding(size: bigint, account?: Account | Address): Promise<TxHash>;
|
|
325
|
+
/**
|
|
326
|
+
* Set the maximum batch size for `"direct"` mode disperses. `0n` = no limit.
|
|
327
|
+
* Requires DEFAULT_ADMIN_ROLE.
|
|
328
|
+
* @returns Transaction hash.
|
|
329
|
+
*/
|
|
330
|
+
setMaxBatchSizeDirect(size: bigint, account?: Account | Address): Promise<TxHash>;
|
|
331
|
+
/**
|
|
332
|
+
* Set the maximum batch size for `"wallet-token-fee"` mode disperses. `0n` = no limit.
|
|
333
|
+
* Requires DEFAULT_ADMIN_ROLE.
|
|
334
|
+
* @returns Transaction hash.
|
|
335
|
+
*/
|
|
336
|
+
setMaxBatchSizeTokenFee(size: bigint, account?: Account | Address): Promise<TxHash>;
|
|
337
|
+
/**
|
|
338
|
+
* Withdraw `amount` wei of accumulated ETH gas fees to `to`. The amount is
|
|
339
|
+
* not capped on-chain — callers MUST pass an explicit amount. There is no
|
|
340
|
+
* "drain full balance" sentinel: passing `0n` succeeds with no ETH movement.
|
|
341
|
+
* Read the singleton's ETH balance with `publicClient.getBalance(singleton)`
|
|
342
|
+
* to drain.
|
|
343
|
+
*
|
|
344
|
+
* Requires FEE_COLLECTOR_ROLE.
|
|
345
|
+
* @returns Transaction hash.
|
|
346
|
+
*/
|
|
347
|
+
withdrawGasFee(to: Address, amount: bigint, account?: Account | Address): Promise<Hex>;
|
|
348
|
+
/**
|
|
349
|
+
* Withdraw accumulated encrypted token fees.
|
|
350
|
+
*
|
|
351
|
+
* The amount is encrypted by the caller — pass plaintext `amount` and an
|
|
352
|
+
* encryptor, or pass `encryptedInput` directly. The contract caps the
|
|
353
|
+
* withdrawal at the available reserve via `FHE.min`.
|
|
354
|
+
*
|
|
355
|
+
* Returns the tx hash plus the **transferred** handle parsed from the
|
|
356
|
+
* `TokenFeeWithdrawn` event. Decrypt the handle via Zama's `userDecrypt`
|
|
357
|
+
* to view the actual amount moved (which can be less than requested when
|
|
358
|
+
* the reserve was smaller than the request). The caller is granted
|
|
359
|
+
* persistent ACL on this handle by the contract.
|
|
360
|
+
*
|
|
361
|
+
* **`encryptedInput` is bound to (this singleton, this caller).** Zama's
|
|
362
|
+
* KMSVerifier rejects proofs whose `contractAddress` or `userAddress`
|
|
363
|
+
* don't match the executing tx. If you pre-encrypt on a different chain's
|
|
364
|
+
* singleton, or for a different caller, the on-chain submission will
|
|
365
|
+
* revert with a generic verification failure. The plaintext `amount`
|
|
366
|
+
* path is safer when the caller / chain isn't fixed yet.
|
|
367
|
+
*/
|
|
368
|
+
withdrawTokenFee(args: {
|
|
369
|
+
token: Address;
|
|
370
|
+
to: Address;
|
|
371
|
+
/** Plaintext amount. Mutually exclusive with `encryptedInput` — supply exactly one. */
|
|
372
|
+
amount?: bigint;
|
|
373
|
+
encryptor?: Encryptor;
|
|
374
|
+
/** Pre-encrypted input. Mutually exclusive with `amount`. */
|
|
375
|
+
encryptedInput?: EncryptedInput;
|
|
376
|
+
account?: Account | Address;
|
|
377
|
+
}): Promise<WithdrawTokenFeeResult>;
|
|
378
|
+
/**
|
|
379
|
+
* Rescue accidentally-sent ERC-7984 confidential tokens from the singleton.
|
|
380
|
+
* Requires WITHDRAWER_ROLE.
|
|
381
|
+
* @returns Transaction hash.
|
|
382
|
+
*/
|
|
383
|
+
rescueConfidentialTokens(token: Address, to: Address, account?: Account | Address): Promise<Hex>;
|
|
384
|
+
/**
|
|
385
|
+
* Rescue accidentally-sent ERC-20 tokens from the singleton.
|
|
386
|
+
* Requires WITHDRAWER_ROLE.
|
|
387
|
+
* @returns Transaction hash.
|
|
388
|
+
*/
|
|
389
|
+
rescueERC20(token: Address, to: Address, account?: Account | Address): Promise<Hex>;
|
|
390
|
+
/**
|
|
391
|
+
* Check whether `address` holds `role` on the singleton.
|
|
392
|
+
* @example
|
|
393
|
+
* const isAdmin = await client.hasRole("0x0000...0000", account.address);
|
|
394
|
+
*/
|
|
395
|
+
hasRole(role: Hex, address: Address): Promise<boolean>;
|
|
396
|
+
/**
|
|
397
|
+
* Grant `role` to `accountTarget`. Requires DEFAULT_ADMIN_ROLE.
|
|
398
|
+
* @returns Transaction hash.
|
|
399
|
+
*/
|
|
400
|
+
grantRole(role: Hex, accountTarget: Address, account?: Account | Address): Promise<Hex>;
|
|
401
|
+
/**
|
|
402
|
+
* Revoke `role` from `accountTarget`. Requires DEFAULT_ADMIN_ROLE.
|
|
403
|
+
* @returns Transaction hash.
|
|
404
|
+
*/
|
|
405
|
+
revokeRole(role: Hex, accountTarget: Address, account?: Account | Address): Promise<Hex>;
|
|
406
|
+
/**
|
|
407
|
+
* Voluntarily relinquish `role` from the caller. The contract enforces
|
|
408
|
+
* `callerConfirmation === msg.sender` (OZ AccessControl) as a guard against
|
|
409
|
+
* accidental renunciation via a wrapper contract — pass the connected
|
|
410
|
+
* wallet's address here.
|
|
411
|
+
*
|
|
412
|
+
* Use to permanently drop privileges from a fee-collector / withdrawer /
|
|
413
|
+
* pauser without needing an admin's `revokeRole`. Cannot be undone.
|
|
414
|
+
*
|
|
415
|
+
* @returns Transaction hash.
|
|
416
|
+
*/
|
|
417
|
+
renounceRole(role: Hex, callerConfirmation: Address, account?: Account | Address): Promise<Hex>;
|
|
418
|
+
/** Whether the singleton is currently paused. */
|
|
419
|
+
paused(): Promise<boolean>;
|
|
420
|
+
/** Block number at which the singleton was deployed. */
|
|
421
|
+
deploymentBlockNumber(): Promise<bigint>;
|
|
422
|
+
/** The ERC-1167 `WALLET_IMPLEMENTATION` address used by `Clones.cloneDeterministic`. */
|
|
423
|
+
walletImplementation(): Promise<Address>;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Re-exported from `./subtotals.js` for backwards compatibility with the
|
|
427
|
+
* public `@tokenops/sdk/fhe-disperse` surface. The canonical implementation
|
|
428
|
+
* is shared with `./validate.ts`.
|
|
429
|
+
*/
|
|
430
|
+
export { computeSubtotals } from "./subtotals.js";
|
|
431
|
+
/**
|
|
432
|
+
* Create a {@link ConfidentialDisperseClient}. Mirrors viem's `create*` convention.
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* const client = createConfidentialDisperseClient({
|
|
436
|
+
* publicClient,
|
|
437
|
+
* walletClient,
|
|
438
|
+
* address: "0x...",
|
|
439
|
+
* encryptor,
|
|
440
|
+
* });
|
|
441
|
+
*/
|
|
442
|
+
export declare function createConfidentialDisperseClient(config: ConfidentialDisperseClientConfig): ConfidentialDisperseClient;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the two FHE-encrypted subtotals the singleton expects for
|
|
3
|
+
* wallet-mode disperses.
|
|
4
|
+
*
|
|
5
|
+
* The contract distributes amounts across two subwallets using the rule:
|
|
6
|
+
* group0 = first (baseSize + remainder) recipients → wallet0
|
|
7
|
+
* group1 = remaining baseSize recipients → wallet1
|
|
8
|
+
*
|
|
9
|
+
* This matches `_distributeFromWallets` in `DisperseConfidential.sol`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function computeSubtotals(amounts: bigint[]): {
|
|
12
|
+
group0: bigint;
|
|
13
|
+
group1: bigint;
|
|
14
|
+
};
|