@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,28 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import { type DisperseArgs, type DisperseResult } from "../types.js";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Disperse confidential tokens to multiple recipients. The SDK validates
|
|
6
|
+
* inputs, computes the wallet-mode subtotal split, encrypts all amounts +
|
|
7
|
+
* subtotals in a single proof batch, computes `msg.value` for gas-fee modes,
|
|
8
|
+
* and dispatches to the correct contract entry point based on `mode`.
|
|
9
|
+
*
|
|
10
|
+
* **Encryptor resolution.** The hook-level `encryptor` (from
|
|
11
|
+
* {@link DisperseHookOptions}) is forwarded lazily to the SDK client. If
|
|
12
|
+
* missing when the mutation runs, the SDK throws
|
|
13
|
+
* `Missing encryptor — pass encryptor…` verbatim. Capture `useZamaSDK()` once
|
|
14
|
+
* at the top of your component and forward `() => zamaSDK.relayer` — never
|
|
15
|
+
* `() => useZamaSDK().relayer` inline (calls a React hook inside a mutation
|
|
16
|
+
* body, violating the rules of hooks; see CLAUDE.md Pitfall #3).
|
|
17
|
+
*
|
|
18
|
+
* After success, invalidate `useGetFees`, `useHasApprovedSubwallets`, and any
|
|
19
|
+
* downstream token-balance queries owned by the consumer.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* function Component() {
|
|
23
|
+
* const zamaSDK = useZamaSDK();
|
|
24
|
+
* const disperse = useDisperse({ encryptor: () => zamaSDK.relayer });
|
|
25
|
+
* disperse.mutate({ token, mode: "direct", recipients, amounts });
|
|
26
|
+
* }
|
|
27
|
+
*/
|
|
28
|
+
export declare function useDisperse(options?: DisperseHookOptions): UseMutationResult<DisperseResult, Error, DisperseArgs>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type BatchLimits } from "../types.js";
|
|
3
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Read the maximum batch size for each of the three disperse modes
|
|
6
|
+
* (`"wallet"`, `"direct"`, `"wallet-token-fee"`). `0n` means no limit.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const { data: limits } = useGetBatchLimits();
|
|
10
|
+
* // limits → { holding, direct, tokenFee }
|
|
11
|
+
*/
|
|
12
|
+
export declare function useGetBatchLimits(options?: BaseHookOptions): UseQueryResult<BatchLimits, Error>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type FeeConfig } from "../types.js";
|
|
3
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Read the on-chain global fee configuration (`feeConfig` getter).
|
|
6
|
+
*
|
|
7
|
+
* Returns the {@link FeeConfig} struct the contract stores — pass the result
|
|
8
|
+
* straight back to {@link useSetFeeConfig} to flip one toggle without
|
|
9
|
+
* re-stating the others.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { data: cfg } = useGetFeeConfig();
|
|
13
|
+
* // cfg → { gasFeeEnabled, tokenFeeEnabled, defaultGasFee, defaultTokenFee }
|
|
14
|
+
*/
|
|
15
|
+
export declare function useGetFeeConfig(options?: BaseHookOptions): UseQueryResult<FeeConfig, Error>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { type UserFees } from "../types.js";
|
|
4
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UseGetFeesArgs extends BaseHookOptions {
|
|
6
|
+
/** The user whose resolved fees to read. Hook is disabled until set. */
|
|
7
|
+
user?: Address;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Read consolidated fee information for `user` — combines per-user resolved
|
|
11
|
+
* fees (`getFeeAmounts`) with the global `feeConfig` toggles in one read.
|
|
12
|
+
*
|
|
13
|
+
* UI code calls this to render the fee panel before the user submits.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const { data: fees } = useGetFees({ user });
|
|
17
|
+
* // fees → { isCustom, gasFeeWei, tokenFeeBps, gasFeeEnabled, tokenFeeEnabled }
|
|
18
|
+
*/
|
|
19
|
+
export declare function useGetFees(args?: UseGetFeesArgs): UseQueryResult<UserFees, Error>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseGetWalletsArgs extends BaseHookOptions {
|
|
5
|
+
/** The user whose wallet pair to read. Hook is disabled until set. */
|
|
6
|
+
user?: Address;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Read the on-chain wallet pair for a registered user.
|
|
10
|
+
*
|
|
11
|
+
* Returns `null` if the user is not registered. For unregistered users, call
|
|
12
|
+
* {@link usePredictWallets} to get the deterministic addresses they would
|
|
13
|
+
* receive after `register()`.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const { data: wallets } = useGetWallets({ user });
|
|
17
|
+
* if (wallets) { ... wallets[0], wallets[1] ... }
|
|
18
|
+
*/
|
|
19
|
+
export declare function useGetWallets(args?: UseGetWalletsArgs): UseQueryResult<[Address, Address] | null, Error>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseGrantRoleArgs {
|
|
5
|
+
role: Hex;
|
|
6
|
+
accountTarget: Address;
|
|
7
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
8
|
+
account?: Account | Address;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* AccessControl: grant `role` to `accountTarget` on the singleton. Caller
|
|
12
|
+
* must hold the role's admin role (typically `DEFAULT_ADMIN_ROLE`, i.e. the
|
|
13
|
+
* all-zero hash). Non-zero role hashes are `keccak256(toBytes("<NAME>"))`.
|
|
14
|
+
*
|
|
15
|
+
* After success, invalidate
|
|
16
|
+
* {@link useHasRole}`({ role, account: accountTarget })`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* import { keccak256, toBytes } from "viem";
|
|
20
|
+
* const FEE_MANAGER_ROLE = keccak256(toBytes("FEE_MANAGER_ROLE"));
|
|
21
|
+
* const grant = useGrantRole();
|
|
22
|
+
* grant.mutate({ role: FEE_MANAGER_ROLE, accountTarget: opsAddress });
|
|
23
|
+
*/
|
|
24
|
+
export declare function useGrantRole(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UseGrantRoleArgs>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { type SubwalletApprovalState } from "../types.js";
|
|
4
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UseHasApprovedSubwalletsArgs extends BaseHookOptions {
|
|
6
|
+
/** Address whose registered subwallets to check. Hook disabled until set. */
|
|
7
|
+
user?: Address;
|
|
8
|
+
/** ERC-7984 token address to check the operator approval against. Hook disabled until set. */
|
|
9
|
+
token?: Address;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Check whether a user's registered subwallets have approved the singleton
|
|
13
|
+
* as an ERC-7984 operator for `token`. Both must return `true` before a
|
|
14
|
+
* wallet-mode disperse will succeed.
|
|
15
|
+
*
|
|
16
|
+
* Returns `{ wallet0: false, wallet1: false, both: false }` if the user is
|
|
17
|
+
* not yet registered — for pre-registration approvals, use
|
|
18
|
+
* {@link usePredictWallets} and call `isOperator(predicted, singleton)` on
|
|
19
|
+
* the token directly.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const { data: approvals } = useHasApprovedSubwallets({ user, token });
|
|
23
|
+
* if (!approvals?.both) { /* prompt user to approve *\/ }
|
|
24
|
+
*/
|
|
25
|
+
export declare function useHasApprovedSubwallets(args?: UseHasApprovedSubwalletsArgs): UseQueryResult<SubwalletApprovalState, Error>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address, Hex } from "viem";
|
|
3
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseHasRoleArgs extends BaseHookOptions {
|
|
5
|
+
role?: Hex;
|
|
6
|
+
/** The address to check role membership for. Hook disabled until set. */
|
|
7
|
+
account?: Address;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Read AccessControl: is `account` a member of `role` on the singleton?
|
|
11
|
+
*
|
|
12
|
+
* `DisperseConfidential` defines `DEFAULT_ADMIN_ROLE` (the all-zero hash),
|
|
13
|
+
* `FEE_MANAGER_ROLE`, `FEE_COLLECTOR_ROLE`, and `PAUSER_ROLE`. The non-zero
|
|
14
|
+
* role hashes are `keccak256(toBytes("<ROLE_NAME>"))` — compute them at the
|
|
15
|
+
* call site (the SDK does not export them as named constants).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* import { keccak256, toBytes } from "viem";
|
|
19
|
+
* const FEE_MANAGER_ROLE = keccak256(toBytes("FEE_MANAGER_ROLE"));
|
|
20
|
+
* const { data: isManager } = useHasRole({ role: FEE_MANAGER_ROLE, account: user });
|
|
21
|
+
*/
|
|
22
|
+
export declare function useHasRole(args?: UseHasRoleArgs): UseQueryResult<boolean, Error>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read the singleton's `paused` flag. When `true`, all disperse operations
|
|
5
|
+
* revert until a `PAUSER_ROLE` member calls `unpause()`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const { data: paused } = useIsPaused();
|
|
9
|
+
* if (paused) { /* disable submit button *\/ }
|
|
10
|
+
*/
|
|
11
|
+
export declare function useIsPaused(options?: BaseHookOptions): UseQueryResult<boolean, Error>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseIsRegisteredArgs extends BaseHookOptions {
|
|
5
|
+
/** The user to check registration for. Hook is disabled until set. */
|
|
6
|
+
user?: Address;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Check whether a user has already called `register(token)` and has a
|
|
10
|
+
* deployed wallet pair on the singleton.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const { data: isRegistered } = useIsRegistered({ user });
|
|
14
|
+
*/
|
|
15
|
+
export declare function useIsRegistered(args?: UseIsRegisteredArgs): UseQueryResult<boolean, Error>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UsePauseArgs {
|
|
5
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
6
|
+
account?: Account | Address;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Admin: pause all disperse operations on the singleton. Requires
|
|
10
|
+
* `PAUSER_ROLE`.
|
|
11
|
+
*
|
|
12
|
+
* After success, invalidate {@link useIsPaused}.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const pause = usePause();
|
|
16
|
+
* pause.mutate({});
|
|
17
|
+
*/
|
|
18
|
+
export declare function usePause(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UsePauseArgs>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UsePredictWalletsArgs extends BaseHookOptions {
|
|
5
|
+
/** The user whose wallet pair to predict. Hook is disabled until set. */
|
|
6
|
+
user?: Address;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Deterministically predict the wallet addresses a user would get after
|
|
10
|
+
* calling `register()`, **without requiring the user to be registered**.
|
|
11
|
+
*
|
|
12
|
+
* Use this to compute the addresses that need ERC-7984 operator approval
|
|
13
|
+
* before the user calls `register()` — set approvals on the predicted
|
|
14
|
+
* addresses first so the first disperse works without a follow-up tx.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const { data: predicted } = usePredictWallets({ user });
|
|
18
|
+
*/
|
|
19
|
+
export declare function usePredictWallets(args?: UsePredictWalletsArgs): UseQueryResult<[Address, Address], Error>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { type DisperseMode, type PreflightReport } from "../types.js";
|
|
4
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UsePreflightDisperseArgs extends BaseHookOptions {
|
|
6
|
+
user?: Address;
|
|
7
|
+
token?: Address;
|
|
8
|
+
recipients?: Address[];
|
|
9
|
+
amounts?: bigint[];
|
|
10
|
+
mode?: DisperseMode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Comprehensive pre-flight report — one call gives a UI everything it needs
|
|
14
|
+
* to render a "ready to disperse" checklist: registration state, wallet
|
|
15
|
+
* approvals, fee preview, batch-limit check, per-recipient validation,
|
|
16
|
+
* pre-computed wallet-mode subtotals, and a `ready` flag plus structured
|
|
17
|
+
* `blockers` list.
|
|
18
|
+
*
|
|
19
|
+
* Hook is disabled until `user`, `token`, `recipients`, `amounts`, and `mode`
|
|
20
|
+
* are all set.
|
|
21
|
+
*
|
|
22
|
+
* For live dashboards, set `refetchInterval` so the report stays current as
|
|
23
|
+
* the user toggles approvals in a wallet UI:
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* const preflight = usePreflightDisperse({ user, token, recipients, amounts, mode });
|
|
27
|
+
* // pass through TanStack Query options via queryClient.setQueryDefaults or a
|
|
28
|
+
* // wrapping useQuery, e.g. refetchInterval: 5_000.
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* const { data: report } = usePreflightDisperse({
|
|
33
|
+
* user, token, recipients, amounts, mode: "direct",
|
|
34
|
+
* });
|
|
35
|
+
* if (report?.ready) { /* enable submit *\/ }
|
|
36
|
+
*/
|
|
37
|
+
export declare function usePreflightDisperse(args?: UsePreflightDisperseArgs): UseQueryResult<PreflightReport, Error>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseRecoverERC20FromWalletsArgs {
|
|
5
|
+
/** ERC-20 token to recover from the caller's wallets. */
|
|
6
|
+
token: Address;
|
|
7
|
+
/** Address to receive the recovered tokens. */
|
|
8
|
+
to: Address;
|
|
9
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
10
|
+
account?: Account | Address;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Recover ERC-20 tokens accidentally sent to the caller's registered wallets.
|
|
14
|
+
* Mirrors {@link useRecoverFromWallets} but for plain (non-confidential)
|
|
15
|
+
* ERC-20 balances stranded in the subwallets.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const recover = useRecoverERC20FromWallets();
|
|
19
|
+
* recover.mutate({ token, to: address });
|
|
20
|
+
*/
|
|
21
|
+
export declare function useRecoverERC20FromWallets(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UseRecoverERC20FromWalletsArgs>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseRecoverFromWalletsArgs {
|
|
5
|
+
/** ERC-7984 token to recover from the caller's wallets. */
|
|
6
|
+
token: Address;
|
|
7
|
+
/** Address to receive the recovered tokens. */
|
|
8
|
+
to: Address;
|
|
9
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
10
|
+
account?: Account | Address;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Recover residual confidential ERC-7984 tokens from the caller's registered
|
|
14
|
+
* wallets to `to`. Useful after a wallet-mode disperse where subtotals were
|
|
15
|
+
* inflated and tokens remain locked in the subwallets.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const recover = useRecoverFromWallets();
|
|
19
|
+
* recover.mutate({ token, to: address });
|
|
20
|
+
*/
|
|
21
|
+
export declare function useRecoverFromWallets(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UseRecoverFromWalletsArgs>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address } from "viem";
|
|
3
|
+
import { type RegisterResult } from "../types.js";
|
|
4
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UseRegisterArgs {
|
|
6
|
+
/** ERC-7984 token to approve the new subwallets for. */
|
|
7
|
+
token: Address;
|
|
8
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
9
|
+
account?: Account | Address;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Deploy the caller's dedicated wallet pair via `register(token)` and parse
|
|
13
|
+
* the resulting `UserRegistered` event to return both subwallet addresses.
|
|
14
|
+
*
|
|
15
|
+
* Can only be called once per user — subsequent calls revert with
|
|
16
|
+
* `UserAlreadyRegistered`. Use {@link useIsRegistered} to gate this in your
|
|
17
|
+
* UI.
|
|
18
|
+
*
|
|
19
|
+
* **Throws {@link DisperseSubwalletNotFoundError}** if the receipt has no
|
|
20
|
+
* `UserRegistered` event from the singleton — typically means the tx reverted
|
|
21
|
+
* silently or you're reading the wrong singleton address.
|
|
22
|
+
*
|
|
23
|
+
* After success, invalidate every disperse query for this user:
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* const queryClient = useQueryClient();
|
|
27
|
+
* const register = useRegister();
|
|
28
|
+
* register.mutate({ token }, {
|
|
29
|
+
* onSuccess: () => {
|
|
30
|
+
* queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-disperse"] });
|
|
31
|
+
* },
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const register = useRegister();
|
|
37
|
+
* register.mutate({ token });
|
|
38
|
+
* // register.data → { hash, wallets: [wallet0, wallet1] }
|
|
39
|
+
*/
|
|
40
|
+
export declare function useRegister(options?: DisperseHookOptions): UseMutationResult<RegisterResult, Error, UseRegisterArgs>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseRescueConfidentialTokensArgs {
|
|
5
|
+
/** ERC-7984 token to rescue. */
|
|
6
|
+
token: Address;
|
|
7
|
+
/** Recipient of the rescued tokens. */
|
|
8
|
+
to: Address;
|
|
9
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
10
|
+
account?: Account | Address;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Admin: rescue accidentally-sent ERC-7984 confidential tokens from the
|
|
14
|
+
* singleton contract itself (NOT the per-user subwallets — for those, use
|
|
15
|
+
* {@link useRecoverFromWallets}). Requires `WITHDRAWER_ROLE`.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const rescue = useRescueConfidentialTokens();
|
|
19
|
+
* rescue.mutate({ token, to: treasury });
|
|
20
|
+
*/
|
|
21
|
+
export declare function useRescueConfidentialTokens(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UseRescueConfidentialTokensArgs>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseRescueERC20Args {
|
|
5
|
+
/** ERC-20 token to rescue. */
|
|
6
|
+
token: Address;
|
|
7
|
+
/** Recipient of the rescued tokens. */
|
|
8
|
+
to: Address;
|
|
9
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
10
|
+
account?: Account | Address;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Admin: rescue accidentally-sent ERC-20 tokens from the singleton contract
|
|
14
|
+
* itself (NOT the per-user subwallets — for those, use
|
|
15
|
+
* {@link useRecoverERC20FromWallets}). Requires `WITHDRAWER_ROLE`.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const rescue = useRescueERC20();
|
|
19
|
+
* rescue.mutate({ token, to: treasury });
|
|
20
|
+
*/
|
|
21
|
+
export declare function useRescueERC20(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UseRescueERC20Args>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseRevokeRoleArgs {
|
|
5
|
+
role: Hex;
|
|
6
|
+
accountTarget: Address;
|
|
7
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
8
|
+
account?: Account | Address;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* AccessControl: revoke `role` from `accountTarget` on the singleton. Caller
|
|
12
|
+
* must hold the role's admin role (typically `DEFAULT_ADMIN_ROLE`, i.e. the
|
|
13
|
+
* all-zero hash). Non-zero role hashes are `keccak256(toBytes("<NAME>"))`.
|
|
14
|
+
*
|
|
15
|
+
* After success, invalidate
|
|
16
|
+
* {@link useHasRole}`({ role, account: accountTarget })`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* import { keccak256, toBytes } from "viem";
|
|
20
|
+
* const FEE_MANAGER_ROLE = keccak256(toBytes("FEE_MANAGER_ROLE"));
|
|
21
|
+
* const revoke = useRevokeRole();
|
|
22
|
+
* revoke.mutate({ role: FEE_MANAGER_ROLE, accountTarget: opsAddress });
|
|
23
|
+
*/
|
|
24
|
+
export declare function useRevokeRole(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UseRevokeRoleArgs>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseRevokeTokenOnWalletsArgs {
|
|
5
|
+
/** ERC-7984 token to revoke operator approval on. */
|
|
6
|
+
token: Address;
|
|
7
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
8
|
+
account?: Account | Address;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Revoke the operator approval on `token` for the caller's registered
|
|
12
|
+
* wallets. Re-approve later with {@link useApproveTokenOnWallets}.
|
|
13
|
+
*
|
|
14
|
+
* **Prerequisite:** the caller must already be registered via
|
|
15
|
+
* {@link useRegister}.
|
|
16
|
+
*
|
|
17
|
+
* After success, invalidate
|
|
18
|
+
* {@link useHasApprovedSubwallets}`({ user, token })`.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const revoke = useRevokeTokenOnWallets();
|
|
22
|
+
* revoke.mutate({ token });
|
|
23
|
+
*/
|
|
24
|
+
export declare function useRevokeTokenOnWallets(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UseRevokeTokenOnWalletsArgs>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseSetCustomFeeArgs {
|
|
5
|
+
user: Address;
|
|
6
|
+
/** Per-user gas fee override in wei. */
|
|
7
|
+
gasFee: bigint;
|
|
8
|
+
/** Per-user token fee override in BPS. */
|
|
9
|
+
tokenFee: number;
|
|
10
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
11
|
+
account?: Account | Address;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Admin: install a per-user fee override (gas fee in wei, token fee in BPS).
|
|
15
|
+
* Takes precedence over the global `defaultGasFee` / `defaultTokenFee` for
|
|
16
|
+
* the targeted user. Requires `FEE_MANAGER_ROLE`.
|
|
17
|
+
*
|
|
18
|
+
* After success, invalidate {@link useGetFees}`({ user })`.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const setCustomFee = useSetCustomFee();
|
|
22
|
+
* setCustomFee.mutate({ user, gasFee: 5_000_000_000_000_000n, tokenFee: 25 });
|
|
23
|
+
*/
|
|
24
|
+
export declare function useSetCustomFee(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UseSetCustomFeeArgs>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
import type { FeeConfig } from "../types.js";
|
|
5
|
+
export interface UseSetFeeConfigArgs {
|
|
6
|
+
config: FeeConfig;
|
|
7
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
8
|
+
account?: Account | Address;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Admin: update the global fee configuration — enable/disable gas and token
|
|
12
|
+
* fees, set the defaults. Requires `FEE_MANAGER_ROLE`.
|
|
13
|
+
*
|
|
14
|
+
* After success, invalidate {@link useGetFees} for every user and any UI
|
|
15
|
+
* panels showing the global config.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const setFeeConfig = useSetFeeConfig();
|
|
19
|
+
* setFeeConfig.mutate({
|
|
20
|
+
* config: { gasFeeEnabled: true, tokenFeeEnabled: false, defaultGasFee: 10_000_000_000_000_000n, defaultTokenFee: 0 },
|
|
21
|
+
* });
|
|
22
|
+
*/
|
|
23
|
+
export declare function useSetFeeConfig(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UseSetFeeConfigArgs>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseSetMaxBatchSizeDirectArgs {
|
|
5
|
+
/** Max recipients in a single `"direct"` mode call. `0n` = no limit. */
|
|
6
|
+
size: bigint;
|
|
7
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
8
|
+
account?: Account | Address;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Admin: set the maximum batch size for `"direct"` mode disperses. `0n` = no
|
|
12
|
+
* limit. Requires `DEFAULT_ADMIN_ROLE`.
|
|
13
|
+
*
|
|
14
|
+
* After success, invalidate {@link useGetBatchLimits}.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const setLimit = useSetMaxBatchSizeDirect();
|
|
18
|
+
* setLimit.mutate({ size: 128n });
|
|
19
|
+
*/
|
|
20
|
+
export declare function useSetMaxBatchSizeDirect(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UseSetMaxBatchSizeDirectArgs>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseSetMaxBatchSizeHoldingArgs {
|
|
5
|
+
/** Max recipients in a single `"wallet"` mode call. `0n` = no limit. */
|
|
6
|
+
size: bigint;
|
|
7
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
8
|
+
account?: Account | Address;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Admin: set the maximum batch size for `"wallet"` mode disperses. `0n` = no
|
|
12
|
+
* limit. Requires `DEFAULT_ADMIN_ROLE`.
|
|
13
|
+
*
|
|
14
|
+
* After success, invalidate {@link useGetBatchLimits}.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const setLimit = useSetMaxBatchSizeHolding();
|
|
18
|
+
* setLimit.mutate({ size: 256n });
|
|
19
|
+
*/
|
|
20
|
+
export declare function useSetMaxBatchSizeHolding(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UseSetMaxBatchSizeHoldingArgs>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Account, Address, Hex } from "viem";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
export interface UseSetMaxBatchSizeTokenFeeArgs {
|
|
5
|
+
/** Max recipients in a single `"wallet-token-fee"` mode call. `0n` = no limit. */
|
|
6
|
+
size: bigint;
|
|
7
|
+
/** Override signer account. Falls back to `walletClient.account`. */
|
|
8
|
+
account?: Account | Address;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Admin: set the maximum batch size for `"wallet-token-fee"` mode
|
|
12
|
+
* disperses. `0n` = no limit. Requires `DEFAULT_ADMIN_ROLE`.
|
|
13
|
+
*
|
|
14
|
+
* After success, invalidate {@link useGetBatchLimits}.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const setLimit = useSetMaxBatchSizeTokenFee();
|
|
18
|
+
* setLimit.mutate({ size: 64n });
|
|
19
|
+
*/
|
|
20
|
+
export declare function useSetMaxBatchSizeTokenFee(options?: DisperseHookOptions): UseMutationResult<Hex, Error, UseSetMaxBatchSizeTokenFeeArgs>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import { type BatchDiscloseHandlesArgs, type DisclosureResult } from "../types.js";
|
|
3
|
+
import { type DisperseHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Batch variant of {@link useDiscloseHandleToParty} — atomically grant
|
|
6
|
+
* `party` persistent ACL on all `handles`. Reverts on the first handle that
|
|
7
|
+
* fails caller-ACL or contract-ACL checks.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const batchDisclose = useSingletonBatchDiscloseHandlesToParty();
|
|
11
|
+
* batchDisclose.mutate({ handles, party: accountingAddress });
|
|
12
|
+
*/
|
|
13
|
+
export declare function useSingletonBatchDiscloseHandlesToParty(options?: DisperseHookOptions): UseMutationResult<DisclosureResult, Error, BatchDiscloseHandlesArgs>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type BatchLimits } from "../types.js";
|
|
3
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Read the maximum batch size for each of the three disperse modes
|
|
6
|
+
* (`"wallet"`, `"direct"`, `"wallet-token-fee"`). `0n` means no limit.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const { data: limits } = useSingletonBatchLimits();
|
|
10
|
+
* // limits → { holding, direct, tokenFee }
|
|
11
|
+
*/
|
|
12
|
+
export declare function useSingletonBatchLimits(options?: BaseHookOptions): UseQueryResult<BatchLimits, Error>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { type CalculatedFee, type DisperseMode } from "../types.js";
|
|
4
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
+
export interface UseSingletonCalculateFeeArgs extends BaseHookOptions {
|
|
6
|
+
user?: Address;
|
|
7
|
+
mode?: DisperseMode;
|
|
8
|
+
recipients?: number;
|
|
9
|
+
/** Required for `"wallet-token-fee"` mode. */
|
|
10
|
+
totalTokens?: bigint;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Compute the exact fee for a disperse call before submitting — reads live
|
|
14
|
+
* fee data via `getFees(user)` and applies the mode-specific formula.
|
|
15
|
+
*
|
|
16
|
+
* - `"wallet"` / `"direct"`: `ethValue = recipients * gasFeeWei`, no token fee.
|
|
17
|
+
* - `"wallet-token-fee"`: `ethValue = 0n`, `tokenFeeAmount = totalTokens * tokenFeeBps / 10_000n`.
|
|
18
|
+
*
|
|
19
|
+
* Hook is disabled until `user`, `mode`, and `recipients` are set.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const { data: fee } = useSingletonCalculateFee({
|
|
23
|
+
* user, mode: "direct", recipients: 100,
|
|
24
|
+
* });
|
|
25
|
+
*/
|
|
26
|
+
export declare function useSingletonCalculateFee(args?: UseSingletonCalculateFeeArgs): UseQueryResult<CalculatedFee, Error>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { type BaseHookOptions } from "./_shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read the block number at which the singleton was deployed — useful as the
|
|
5
|
+
* `fromBlock` argument to `getLogs` when subscribing to events.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const { data: deployBlock } = useSingletonDeploymentBlockNumber();
|
|
9
|
+
* publicClient.getLogs({ fromBlock: deployBlock, ... });
|
|
10
|
+
*/
|
|
11
|
+
export declare function useSingletonDeploymentBlockNumber(options?: BaseHookOptions): UseQueryResult<bigint, Error>;
|