@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,687 @@
|
|
|
1
|
+
import type { Address, Hex } from "viem";
|
|
2
|
+
/**
|
|
3
|
+
* Cross-realm / cross-bundle safe brand. Consumers should narrow on this via
|
|
4
|
+
* {@link isTokenOpsSdkError} rather than `instanceof` when the SDK might be
|
|
5
|
+
* duplicated in their bundle graph (monorepos with hoisting issues, ESM/CJS
|
|
6
|
+
* dual loads, Next.js route-handler vs client-bundle splits, etc.). `instanceof`
|
|
7
|
+
* still works for the common case.
|
|
8
|
+
*/
|
|
9
|
+
declare const TOKENOPS_SDK_ERROR_BRAND: unique symbol;
|
|
10
|
+
/**
|
|
11
|
+
* Stable, string-literal error codes. Codes are the machine contract — match
|
|
12
|
+
* on `error.code` in `onError` handlers and UI surfaces. Messages stay
|
|
13
|
+
* human-readable and may evolve between versions.
|
|
14
|
+
*/
|
|
15
|
+
export type TokenOpsSdkErrorCode = "TOKENOPS_UNSUPPORTED_CHAIN" | "TOKENOPS_DEPLOYMENT_ADDRESS_UNAVAILABLE" | "TOKENOPS_MISSING_PUBLIC_CLIENT" | "TOKENOPS_MISSING_WALLET_CLIENT" | "TOKENOPS_MISSING_ACCOUNT" | "TOKENOPS_MISSING_ENCRYPTOR" | "TOKENOPS_MISSING_CLIENT" | "TOKENOPS_INVALID_ARGUMENT" | "TOKENOPS_RECEIPT_EVENT_NOT_FOUND" | "TOKENOPS_RECEIPT_EVENT_AMBIGUOUS" | "TOKENOPS_CONTRACT_REVERT" | "TOKENOPS_PAUSED" | "TOKENOPS_ACCESS_DENIED" | "TOKENOPS_INSUFFICIENT_FEE" | "TOKENOPS_INSUFFICIENT_BALANCE" | "TOKENOPS_BATCH_TOO_LARGE" | "TOKENOPS_FEATURE_DISABLED" | "TOKENOPS_TRANSFER_FAILED" | "TOKENOPS_FHE_HANDLE_NOT_ALLOWED" | "TOKENOPS_ALREADY_INITIALIZED" | "TOKENOPS_REENTRANCY" | "TOKENOPS_INVALID_SIGNATURE" | "TOKENOPS_WALLET_REJECTED" | "TOKENOPS_WALLET_CHAIN_MISMATCH" | "TOKENOPS_NETWORK_ERROR" | "TOKENOPS_INSUFFICIENT_GAS_FUNDS" | "TOKENOPS_UNKNOWN_WRITE_FAILURE" | "TOKENOPS_USER_REJECTED" | "TOKENOPS_SIGNING_FAILED" | "TOKENOPS_RELAYER_UNREACHABLE" | "TOKENOPS_ENCRYPTION_FAILED" | "TOKENOPS_DECRYPTION_FAILED" | "TOKENOPS_USER_DECRYPT_NOT_ALLOWED" | "TOKENOPS_VESTING_NOT_FOUND" | "TOKENOPS_NOT_RECIPIENT" | "TOKENOPS_CLAIM_LOCKED" | "TOKENOPS_VESTING_REVOKED" | "TOKENOPS_NOT_REVOCABLE" | "TOKENOPS_VESTING_EXPIRED" | "TOKENOPS_TRANSFER_ALREADY_PENDING" | "TOKENOPS_NO_PENDING_TRANSFER" | "TOKENOPS_NOT_PENDING_RECIPIENT" | "TOKENOPS_TRANSFER_EXPIRED" | "TOKENOPS_ALREADY_CLAIMED" | "TOKENOPS_CLAIM_NOT_STARTED" | "TOKENOPS_CLAIM_WINDOW_CLOSED" | "TOKENOPS_NOT_REGISTERED" | "TOKENOPS_ALREADY_REGISTERED";
|
|
16
|
+
export interface TokenOpsSdkErrorInit {
|
|
17
|
+
code: TokenOpsSdkErrorCode;
|
|
18
|
+
cause?: unknown;
|
|
19
|
+
context?: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Base class for every error the SDK throws. Carries a stable `code`
|
|
23
|
+
* discriminator (machine contract), a typed `context` payload (structured
|
|
24
|
+
* data for logs / UI), and the standard `cause` chain (set via
|
|
25
|
+
* `ErrorOptions`, so loggers and devtools follow it natively).
|
|
26
|
+
*
|
|
27
|
+
* Subclasses narrow `context` to a concrete shape and pin `code` to a single
|
|
28
|
+
* literal — `if (error.code === "TOKENOPS_MISSING_ENCRYPTOR") error.context.method` typechecks.
|
|
29
|
+
*/
|
|
30
|
+
export declare class TokenOpsSdkError extends Error {
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly code: TokenOpsSdkErrorCode;
|
|
33
|
+
readonly context: Record<string, unknown>;
|
|
34
|
+
readonly [TOKENOPS_SDK_ERROR_BRAND] = true;
|
|
35
|
+
constructor(message: string, init?: TokenOpsSdkErrorInit);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Brand-based predicate. Prefer over `instanceof` when bundling boundaries
|
|
39
|
+
* may have caused duplicate SDK copies — `Symbol.for` is realm-global, so the
|
|
40
|
+
* brand survives.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isTokenOpsSdkError(error: unknown): error is TokenOpsSdkError;
|
|
43
|
+
export declare class UnsupportedChainError extends TokenOpsSdkError {
|
|
44
|
+
readonly name = "UnsupportedChainError";
|
|
45
|
+
readonly context: {
|
|
46
|
+
chainId: number;
|
|
47
|
+
};
|
|
48
|
+
constructor(chainId: number, options?: {
|
|
49
|
+
cause?: unknown;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export type DeploymentAddressUnavailableReason = "chain-id-missing" | "registry-not-deployed" | "registry-unknown-chain";
|
|
53
|
+
/**
|
|
54
|
+
* Thrown when the SDK cannot resolve a deployed contract address for the
|
|
55
|
+
* caller's chain. `context.reason` tells you why — branch UI on it:
|
|
56
|
+
* - `chain-id-missing` — caller didn't pass `chainId` and `publicClient.chain` was undefined.
|
|
57
|
+
* - `registry-not-deployed` — chain is known to the SDK but the product isn't deployed there yet (`null` in registry).
|
|
58
|
+
* - `registry-unknown-chain` — chain id absent from the registry entirely.
|
|
59
|
+
*
|
|
60
|
+
* `context.overrideName` names the client-config knob the caller should set
|
|
61
|
+
* to bypass the registry (defaults to `"address"`). Infra contracts whose
|
|
62
|
+
* override lives under a different key — e.g. `aclAddress` on the FHE
|
|
63
|
+
* clients — set this so the error message points users at the right field.
|
|
64
|
+
*/
|
|
65
|
+
export declare class DeploymentAddressUnavailableError extends TokenOpsSdkError {
|
|
66
|
+
readonly name = "DeploymentAddressUnavailableError";
|
|
67
|
+
readonly context: {
|
|
68
|
+
reason: DeploymentAddressUnavailableReason;
|
|
69
|
+
product?: string;
|
|
70
|
+
contract?: string;
|
|
71
|
+
chainId?: number;
|
|
72
|
+
clientLabel?: string;
|
|
73
|
+
overrideName?: string;
|
|
74
|
+
};
|
|
75
|
+
constructor(args: {
|
|
76
|
+
reason: DeploymentAddressUnavailableReason;
|
|
77
|
+
product?: string;
|
|
78
|
+
contract?: string;
|
|
79
|
+
chainId?: number;
|
|
80
|
+
clientLabel?: string;
|
|
81
|
+
overrideName?: string;
|
|
82
|
+
cause?: unknown;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
export declare class MissingPublicClientError extends TokenOpsSdkError {
|
|
86
|
+
readonly name = "MissingPublicClientError";
|
|
87
|
+
readonly context: {
|
|
88
|
+
method: string;
|
|
89
|
+
};
|
|
90
|
+
constructor(method: string, options?: {
|
|
91
|
+
cause?: unknown;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
export declare class MissingWalletClientError extends TokenOpsSdkError {
|
|
95
|
+
readonly name = "MissingWalletClientError";
|
|
96
|
+
readonly context: {
|
|
97
|
+
method: string;
|
|
98
|
+
};
|
|
99
|
+
constructor(method: string, options?: {
|
|
100
|
+
cause?: unknown;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
export declare class MissingAccountError extends TokenOpsSdkError {
|
|
104
|
+
readonly name = "MissingAccountError";
|
|
105
|
+
readonly context: {
|
|
106
|
+
method: string;
|
|
107
|
+
};
|
|
108
|
+
constructor(method: string, options?: {
|
|
109
|
+
cause?: unknown;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
export declare class MissingEncryptorError extends TokenOpsSdkError {
|
|
113
|
+
readonly name = "MissingEncryptorError";
|
|
114
|
+
readonly context: {
|
|
115
|
+
method: string;
|
|
116
|
+
hint?: string;
|
|
117
|
+
};
|
|
118
|
+
constructor(method: string, options?: {
|
|
119
|
+
hint?: string;
|
|
120
|
+
cause?: unknown;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Thrown by React hooks when their headless client (factory / manager /
|
|
125
|
+
* airdrop / disperse) could not be constructed — usually because the wagmi
|
|
126
|
+
* `publicClient` isn't ready yet or the chain id has no resolvable address.
|
|
127
|
+
* Tests gate on `enabled: !!client`, so this fires only on the mutation path.
|
|
128
|
+
*/
|
|
129
|
+
export declare class MissingClientError extends TokenOpsSdkError {
|
|
130
|
+
readonly name = "MissingClientError";
|
|
131
|
+
readonly context: {
|
|
132
|
+
hook: string;
|
|
133
|
+
clientKind: string;
|
|
134
|
+
};
|
|
135
|
+
constructor(hook: string, clientKind: string, options?: {
|
|
136
|
+
cause?: unknown;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Thrown when an argument fails an SDK-side precondition (non-empty array,
|
|
141
|
+
* uint range, matching lengths, valid address, etc.). `context.argument`
|
|
142
|
+
* names the offending parameter; `context.reason` is the short explanation
|
|
143
|
+
* that's also embedded in the message.
|
|
144
|
+
*/
|
|
145
|
+
export declare class InvalidArgumentError extends TokenOpsSdkError {
|
|
146
|
+
readonly name = "InvalidArgumentError";
|
|
147
|
+
readonly context: {
|
|
148
|
+
method: string;
|
|
149
|
+
argument: string;
|
|
150
|
+
reason: string;
|
|
151
|
+
value?: unknown;
|
|
152
|
+
};
|
|
153
|
+
constructor(args: {
|
|
154
|
+
method: string;
|
|
155
|
+
argument: string;
|
|
156
|
+
reason: string;
|
|
157
|
+
value?: unknown;
|
|
158
|
+
cause?: unknown;
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Thrown when extracting an event from a transaction receipt finds zero
|
|
163
|
+
* matching entries — typically a silent revert, a misrouted log, or
|
|
164
|
+
* (most commonly for FHE flows) an ACL `Allowed` grant that didn't fire
|
|
165
|
+
* because the contract entrypoint took an early return path.
|
|
166
|
+
*
|
|
167
|
+
* Wraps the receipt-based handle extraction pattern described in
|
|
168
|
+
* CLAUDE.md Pitfall #1: SDK methods that return an encrypted handle MUST
|
|
169
|
+
* parse the receipt's ACL `Allowed` event, never `simulateContract().result`.
|
|
170
|
+
*/
|
|
171
|
+
export declare class ReceiptEventNotFoundError extends TokenOpsSdkError {
|
|
172
|
+
readonly name = "ReceiptEventNotFoundError";
|
|
173
|
+
readonly context: {
|
|
174
|
+
method: string;
|
|
175
|
+
eventName: string;
|
|
176
|
+
contractAddress: Address;
|
|
177
|
+
txHash: Hex;
|
|
178
|
+
hint?: string;
|
|
179
|
+
};
|
|
180
|
+
constructor(args: {
|
|
181
|
+
method: string;
|
|
182
|
+
eventName: string;
|
|
183
|
+
contractAddress: Address;
|
|
184
|
+
txHash: Hex;
|
|
185
|
+
hint?: string;
|
|
186
|
+
cause?: unknown;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Thrown when receipt-event extraction finds more than one matching event
|
|
191
|
+
* from the target contract. Indicates either a re-entrancy surprise or an
|
|
192
|
+
* SDK bug in the filter shape — the SDK errs on the side of refusing to
|
|
193
|
+
* guess which entry is authoritative.
|
|
194
|
+
*
|
|
195
|
+
* **What to do.** This is not a retry candidate. Inspect the failing tx
|
|
196
|
+
* (`context.txHash`) on a block explorer: if multiple `Allowed` events
|
|
197
|
+
* appear, either a compound view emitted several or two encrypted views
|
|
198
|
+
* landed in the same tx. File a bug with the tx hash so the SDK can add a
|
|
199
|
+
* caller-specific helper rather than picking heuristically.
|
|
200
|
+
*/
|
|
201
|
+
export declare class ReceiptEventAmbiguousError extends TokenOpsSdkError {
|
|
202
|
+
readonly name = "ReceiptEventAmbiguousError";
|
|
203
|
+
readonly context: {
|
|
204
|
+
method: string;
|
|
205
|
+
eventName: string;
|
|
206
|
+
contractAddress: Address;
|
|
207
|
+
txHash: Hex;
|
|
208
|
+
count: number;
|
|
209
|
+
};
|
|
210
|
+
constructor(args: {
|
|
211
|
+
method: string;
|
|
212
|
+
eventName: string;
|
|
213
|
+
contractAddress: Address;
|
|
214
|
+
txHash: Hex;
|
|
215
|
+
count: number;
|
|
216
|
+
cause?: unknown;
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Generic wrapper for any on-chain revert the SDK decodes but does not have a
|
|
221
|
+
* more specific typed subclass for. Always preferred over bubbling raw viem
|
|
222
|
+
* errors. `context.revertName` and `context.revertSelector` let consumers
|
|
223
|
+
* branch on specific contract errors without needing to import the contract's
|
|
224
|
+
* ABI; `context.revertArgs` carries the decoded arg tuple as-is.
|
|
225
|
+
*
|
|
226
|
+
* If the revert could not be decoded against the SDK's ABIs (custom error not
|
|
227
|
+
* in the ABI, raw `revert()` with no data, etc.), all three fields stay
|
|
228
|
+
* `undefined` and `context.rawRevertData` holds the original calldata. Always
|
|
229
|
+
* prefer this over letting viem's `ContractFunctionExecutionError` escape.
|
|
230
|
+
*/
|
|
231
|
+
export declare class ContractRevertError extends TokenOpsSdkError {
|
|
232
|
+
readonly name = "ContractRevertError";
|
|
233
|
+
readonly context: {
|
|
234
|
+
method: string;
|
|
235
|
+
contractAddress: Address;
|
|
236
|
+
revertName?: string;
|
|
237
|
+
revertSelector?: Hex;
|
|
238
|
+
revertArgs?: readonly unknown[];
|
|
239
|
+
revertReason?: string;
|
|
240
|
+
rawRevertData?: Hex;
|
|
241
|
+
};
|
|
242
|
+
constructor(args: {
|
|
243
|
+
method: string;
|
|
244
|
+
contractAddress: Address;
|
|
245
|
+
revertName?: string;
|
|
246
|
+
revertSelector?: Hex;
|
|
247
|
+
revertArgs?: readonly unknown[];
|
|
248
|
+
revertReason?: string;
|
|
249
|
+
rawRevertData?: Hex;
|
|
250
|
+
message?: string;
|
|
251
|
+
cause?: unknown;
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
/** Contract is paused. Read `paused()` before retrying. */
|
|
255
|
+
export declare class PausedError extends TokenOpsSdkError {
|
|
256
|
+
readonly name = "PausedError";
|
|
257
|
+
readonly context: {
|
|
258
|
+
method: string;
|
|
259
|
+
contractAddress: Address;
|
|
260
|
+
};
|
|
261
|
+
constructor(args: {
|
|
262
|
+
method: string;
|
|
263
|
+
contractAddress: Address;
|
|
264
|
+
cause?: unknown;
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* OpenZeppelin AccessControl rejected the caller. `context.role` is the bytes32
|
|
269
|
+
* role selector when the SDK can decode it (`AccessControlUnauthorizedAccount`
|
|
270
|
+
* carries `(account, role)`); otherwise `undefined`. Callers can map the role
|
|
271
|
+
* selector back to a human name via the client's `roleConstants()` helper.
|
|
272
|
+
*/
|
|
273
|
+
export declare class AccessDeniedError extends TokenOpsSdkError {
|
|
274
|
+
readonly name = "AccessDeniedError";
|
|
275
|
+
readonly context: {
|
|
276
|
+
method: string;
|
|
277
|
+
contractAddress: Address;
|
|
278
|
+
account?: Address;
|
|
279
|
+
role?: Hex;
|
|
280
|
+
};
|
|
281
|
+
constructor(args: {
|
|
282
|
+
method: string;
|
|
283
|
+
contractAddress: Address;
|
|
284
|
+
account?: Address;
|
|
285
|
+
role?: Hex;
|
|
286
|
+
cause?: unknown;
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Native ETH (gas) fee or token fee did not match what the contract requires.
|
|
291
|
+
* `feeKind === "gas"` means the `msg.value` was wrong; `"token"` means the
|
|
292
|
+
* encrypted token-fee BPS did not produce a matching encrypted total.
|
|
293
|
+
*
|
|
294
|
+
* The SDK does not echo plaintext FHE values — `provided` and `required` are
|
|
295
|
+
* populated only for the `gas` case where both sides are public.
|
|
296
|
+
*/
|
|
297
|
+
export declare class InsufficientFeeError extends TokenOpsSdkError {
|
|
298
|
+
readonly name = "InsufficientFeeError";
|
|
299
|
+
readonly context: {
|
|
300
|
+
method: string;
|
|
301
|
+
contractAddress: Address;
|
|
302
|
+
feeKind: "gas" | "token";
|
|
303
|
+
required?: bigint;
|
|
304
|
+
provided?: bigint;
|
|
305
|
+
};
|
|
306
|
+
constructor(args: {
|
|
307
|
+
method: string;
|
|
308
|
+
contractAddress: Address;
|
|
309
|
+
feeKind: "gas" | "token";
|
|
310
|
+
required?: bigint;
|
|
311
|
+
provided?: bigint;
|
|
312
|
+
cause?: unknown;
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Balance is too low to cover the requested operation. `balanceKind` picks the
|
|
317
|
+
* asset class. For confidential balances the underlying value is encrypted, so
|
|
318
|
+
* `requested` / `available` stay `undefined` — the SDK never echoes plaintext
|
|
319
|
+
* FHE values into `context`.
|
|
320
|
+
*/
|
|
321
|
+
export declare class InsufficientBalanceError extends TokenOpsSdkError {
|
|
322
|
+
readonly name = "InsufficientBalanceError";
|
|
323
|
+
readonly context: {
|
|
324
|
+
method: string;
|
|
325
|
+
contractAddress: Address;
|
|
326
|
+
balanceKind: "eth" | "erc20" | "confidential";
|
|
327
|
+
requested?: bigint;
|
|
328
|
+
available?: bigint;
|
|
329
|
+
};
|
|
330
|
+
constructor(args: {
|
|
331
|
+
method: string;
|
|
332
|
+
contractAddress: Address;
|
|
333
|
+
balanceKind: "eth" | "erc20" | "confidential";
|
|
334
|
+
requested?: bigint;
|
|
335
|
+
available?: bigint;
|
|
336
|
+
cause?: unknown;
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Batch size exceeds the contract's configured maximum.
|
|
341
|
+
*
|
|
342
|
+
* Note: `context.max` is `bigint` (the contract returns `uint256` for batch
|
|
343
|
+
* limits, even though realistic values fit comfortably in `Number`). Call
|
|
344
|
+
* `Number(error.context.max)` or `.toString()` before string-interpolating.
|
|
345
|
+
*/
|
|
346
|
+
export declare class BatchTooLargeError extends TokenOpsSdkError {
|
|
347
|
+
readonly name = "BatchTooLargeError";
|
|
348
|
+
readonly context: {
|
|
349
|
+
method: string;
|
|
350
|
+
contractAddress: Address;
|
|
351
|
+
requested: number;
|
|
352
|
+
/** `bigint` — call `Number(max)` or `max.toString()` before string interpolation. */
|
|
353
|
+
max: bigint;
|
|
354
|
+
};
|
|
355
|
+
constructor(args: {
|
|
356
|
+
method: string;
|
|
357
|
+
contractAddress: Address;
|
|
358
|
+
requested: number;
|
|
359
|
+
max: bigint;
|
|
360
|
+
cause?: unknown;
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* A feature toggle baked into the contract clone is off. For LibClone
|
|
365
|
+
* deployments these toggles are immutable (set at clone time) — the user
|
|
366
|
+
* cannot enable them after the fact and must deploy a new clone.
|
|
367
|
+
*/
|
|
368
|
+
export declare class FeatureDisabledError extends TokenOpsSdkError {
|
|
369
|
+
readonly name = "FeatureDisabledError";
|
|
370
|
+
readonly context: {
|
|
371
|
+
method: string;
|
|
372
|
+
contractAddress: Address;
|
|
373
|
+
feature: string;
|
|
374
|
+
};
|
|
375
|
+
constructor(args: {
|
|
376
|
+
method: string;
|
|
377
|
+
contractAddress: Address;
|
|
378
|
+
feature: string;
|
|
379
|
+
cause?: unknown;
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Native ETH or ERC-20 transfer failed at the contract layer (e.g. recipient
|
|
384
|
+
* is a contract that rejects `receive()`, or the underlying ERC-20 returned
|
|
385
|
+
* false from `transfer`).
|
|
386
|
+
*/
|
|
387
|
+
export declare class TransferFailedError extends TokenOpsSdkError {
|
|
388
|
+
readonly name = "TransferFailedError";
|
|
389
|
+
readonly context: {
|
|
390
|
+
method: string;
|
|
391
|
+
contractAddress: Address;
|
|
392
|
+
asset: "eth" | Address;
|
|
393
|
+
};
|
|
394
|
+
constructor(args: {
|
|
395
|
+
method: string;
|
|
396
|
+
contractAddress: Address;
|
|
397
|
+
asset: "eth" | Address;
|
|
398
|
+
cause?: unknown;
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Caller does not hold an FHEVM ACL grant on the encrypted handle they're
|
|
403
|
+
* trying to use (e.g. disclosure, re-share).
|
|
404
|
+
*
|
|
405
|
+
* **This is the on-chain side of the same logical problem as
|
|
406
|
+
* {@link UserDecryptNotAllowedError}.** Both mean "you don't have permission
|
|
407
|
+
* on this encrypted value"; they differ in *when* the SDK detects it:
|
|
408
|
+
*
|
|
409
|
+
* - `FheHandleNotAllowedError` (this class) fires when a contract entrypoint
|
|
410
|
+
* calls `FHE.isSenderAllowed(handle)` on-chain and reverts. The tx made it
|
|
411
|
+
* to the EVM but the contract refused.
|
|
412
|
+
* - `UserDecryptNotAllowedError` fires when the Zama relayer's user-decrypt
|
|
413
|
+
* flow refuses to issue a decryption response. No on-chain tx was sent.
|
|
414
|
+
*
|
|
415
|
+
* `context.handle` is the offending handle (the public 32-byte ciphertext
|
|
416
|
+
* identifier), when extractable from the revert args. The SDK never decodes
|
|
417
|
+
* the underlying plaintext.
|
|
418
|
+
*/
|
|
419
|
+
export declare class FheHandleNotAllowedError extends TokenOpsSdkError {
|
|
420
|
+
readonly name = "FheHandleNotAllowedError";
|
|
421
|
+
readonly context: {
|
|
422
|
+
method: string;
|
|
423
|
+
contractAddress: Address;
|
|
424
|
+
handle?: Hex;
|
|
425
|
+
account?: Address;
|
|
426
|
+
};
|
|
427
|
+
constructor(args: {
|
|
428
|
+
method: string;
|
|
429
|
+
contractAddress: Address;
|
|
430
|
+
handle?: Hex;
|
|
431
|
+
account?: Address;
|
|
432
|
+
cause?: unknown;
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
/** Contract has already been initialized — `initialize()` may only run once. */
|
|
436
|
+
export declare class AlreadyInitializedError extends TokenOpsSdkError {
|
|
437
|
+
readonly name = "AlreadyInitializedError";
|
|
438
|
+
readonly context: {
|
|
439
|
+
method: string;
|
|
440
|
+
contractAddress: Address;
|
|
441
|
+
};
|
|
442
|
+
constructor(args: {
|
|
443
|
+
method: string;
|
|
444
|
+
contractAddress: Address;
|
|
445
|
+
cause?: unknown;
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
/** OpenZeppelin ReentrancyGuardTransient blocked a nested call. */
|
|
449
|
+
export declare class ReentrancyError extends TokenOpsSdkError {
|
|
450
|
+
readonly name = "ReentrancyError";
|
|
451
|
+
readonly context: {
|
|
452
|
+
method: string;
|
|
453
|
+
contractAddress: Address;
|
|
454
|
+
};
|
|
455
|
+
constructor(args: {
|
|
456
|
+
method: string;
|
|
457
|
+
contractAddress: Address;
|
|
458
|
+
cause?: unknown;
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* EIP-712 signature was malformed or did not recover to an authorized signer.
|
|
463
|
+
* Used by airdrop claims where the admin signs a `Claim(recipient, encryptedAmount)`
|
|
464
|
+
* struct off-chain.
|
|
465
|
+
*/
|
|
466
|
+
export declare class InvalidSignatureError extends TokenOpsSdkError {
|
|
467
|
+
readonly name = "InvalidSignatureError";
|
|
468
|
+
readonly context: {
|
|
469
|
+
method: string;
|
|
470
|
+
contractAddress: Address;
|
|
471
|
+
};
|
|
472
|
+
constructor(args: {
|
|
473
|
+
method: string;
|
|
474
|
+
contractAddress: Address;
|
|
475
|
+
cause?: unknown;
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Wallet UI cancelled the request — e.g. the user clicked "Reject" on the
|
|
480
|
+
* transaction prompt, or the wallet bridge returned EIP-1193 code 4001.
|
|
481
|
+
* Retrying is safe; the underlying tx never reached the network.
|
|
482
|
+
*/
|
|
483
|
+
export declare class WalletRejectedError extends TokenOpsSdkError {
|
|
484
|
+
readonly name = "WalletRejectedError";
|
|
485
|
+
readonly context: {
|
|
486
|
+
method: string;
|
|
487
|
+
contractAddress?: Address;
|
|
488
|
+
};
|
|
489
|
+
constructor(args: {
|
|
490
|
+
method: string;
|
|
491
|
+
contractAddress?: Address;
|
|
492
|
+
cause?: unknown;
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* The connected wallet is on a different chain than the contract we tried to
|
|
497
|
+
* call. The user must switch networks before retrying.
|
|
498
|
+
*/
|
|
499
|
+
export declare class WalletChainMismatchError extends TokenOpsSdkError {
|
|
500
|
+
readonly name = "WalletChainMismatchError";
|
|
501
|
+
readonly context: {
|
|
502
|
+
method: string;
|
|
503
|
+
contractAddress?: Address;
|
|
504
|
+
};
|
|
505
|
+
constructor(args: {
|
|
506
|
+
method: string;
|
|
507
|
+
contractAddress?: Address;
|
|
508
|
+
cause?: unknown;
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Network-level failure reaching the RPC endpoint (HTTP non-2xx, timeout,
|
|
513
|
+
* DNS, socket close). `statusCode` is set when the underlying viem
|
|
514
|
+
* `HttpRequestError` exposed an HTTP status. No on-chain state changed.
|
|
515
|
+
*/
|
|
516
|
+
export declare class NetworkError extends TokenOpsSdkError {
|
|
517
|
+
readonly name = "NetworkError";
|
|
518
|
+
readonly context: {
|
|
519
|
+
method: string;
|
|
520
|
+
contractAddress?: Address;
|
|
521
|
+
statusCode?: number;
|
|
522
|
+
};
|
|
523
|
+
constructor(args: {
|
|
524
|
+
method: string;
|
|
525
|
+
contractAddress?: Address;
|
|
526
|
+
statusCode?: number;
|
|
527
|
+
cause?: unknown;
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Wallet account does not hold enough native balance to cover the
|
|
532
|
+
* transaction's gas estimate. Distinct from {@link InsufficientFeeError},
|
|
533
|
+
* which fires when the contract itself enforces a fee.
|
|
534
|
+
*/
|
|
535
|
+
export declare class InsufficientGasFundsError extends TokenOpsSdkError {
|
|
536
|
+
readonly name = "InsufficientGasFundsError";
|
|
537
|
+
readonly context: {
|
|
538
|
+
method: string;
|
|
539
|
+
contractAddress?: Address;
|
|
540
|
+
};
|
|
541
|
+
constructor(args: {
|
|
542
|
+
method: string;
|
|
543
|
+
contractAddress?: Address;
|
|
544
|
+
cause?: unknown;
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Fallback for write failures the SDK could not classify against either an
|
|
549
|
+
* on-chain revert frame or a known viem non-revert error class. Inspect
|
|
550
|
+
* `error.cause` for diagnostics; this is the case to file a bug for.
|
|
551
|
+
*/
|
|
552
|
+
export declare class UnknownWriteFailureError extends TokenOpsSdkError {
|
|
553
|
+
readonly name = "UnknownWriteFailureError";
|
|
554
|
+
readonly context: {
|
|
555
|
+
method: string;
|
|
556
|
+
contractAddress?: Address;
|
|
557
|
+
};
|
|
558
|
+
constructor(args: {
|
|
559
|
+
method: string;
|
|
560
|
+
contractAddress?: Address;
|
|
561
|
+
cause?: unknown;
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
/** User cancelled the wallet signature prompt. */
|
|
565
|
+
export declare class UserRejectedSignatureError extends TokenOpsSdkError {
|
|
566
|
+
readonly name = "UserRejectedSignatureError";
|
|
567
|
+
readonly context: {
|
|
568
|
+
method: string;
|
|
569
|
+
operation: string;
|
|
570
|
+
};
|
|
571
|
+
constructor(args: {
|
|
572
|
+
method: string;
|
|
573
|
+
operation: string;
|
|
574
|
+
cause?: unknown;
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Wallet signature failed for a reason other than the user explicitly
|
|
579
|
+
* rejecting it (timeout, wallet crash, malformed request, etc.).
|
|
580
|
+
*/
|
|
581
|
+
export declare class SigningFailedError extends TokenOpsSdkError {
|
|
582
|
+
readonly name = "SigningFailedError";
|
|
583
|
+
readonly context: {
|
|
584
|
+
method: string;
|
|
585
|
+
operation: string;
|
|
586
|
+
};
|
|
587
|
+
constructor(args: {
|
|
588
|
+
method: string;
|
|
589
|
+
operation: string;
|
|
590
|
+
cause?: unknown;
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Network call to the Zama relayer failed (HTTP non-2xx, timeout, DNS, etc.).
|
|
595
|
+
* `statusCode` is set when the underlying error exposed it.
|
|
596
|
+
*/
|
|
597
|
+
export declare class RelayerUnreachableError extends TokenOpsSdkError {
|
|
598
|
+
readonly name = "RelayerUnreachableError";
|
|
599
|
+
readonly context: {
|
|
600
|
+
method: string;
|
|
601
|
+
operation: string;
|
|
602
|
+
statusCode?: number;
|
|
603
|
+
};
|
|
604
|
+
constructor(args: {
|
|
605
|
+
method: string;
|
|
606
|
+
operation: string;
|
|
607
|
+
statusCode?: number;
|
|
608
|
+
cause?: unknown;
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
/** Encryption flow (input proof generation) failed. */
|
|
612
|
+
export declare class EncryptionFailedError extends TokenOpsSdkError {
|
|
613
|
+
readonly name = "EncryptionFailedError";
|
|
614
|
+
readonly context: {
|
|
615
|
+
method: string;
|
|
616
|
+
operation: string;
|
|
617
|
+
};
|
|
618
|
+
constructor(args: {
|
|
619
|
+
method: string;
|
|
620
|
+
operation: string;
|
|
621
|
+
cause?: unknown;
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
/** Decryption flow (user-decrypt, public-decrypt) failed. */
|
|
625
|
+
export declare class DecryptionFailedError extends TokenOpsSdkError {
|
|
626
|
+
readonly name = "DecryptionFailedError";
|
|
627
|
+
readonly context: {
|
|
628
|
+
method: string;
|
|
629
|
+
operation: string;
|
|
630
|
+
};
|
|
631
|
+
constructor(args: {
|
|
632
|
+
method: string;
|
|
633
|
+
operation: string;
|
|
634
|
+
cause?: unknown;
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Zama ACL refused to grant decryption for the caller on the requested handle.
|
|
639
|
+
*
|
|
640
|
+
* **This is the off-chain side of the same logical problem as
|
|
641
|
+
* {@link FheHandleNotAllowedError}.** Both mean "you don't have permission
|
|
642
|
+
* on this encrypted value"; they differ in *when* the SDK detects it:
|
|
643
|
+
*
|
|
644
|
+
* - `UserDecryptNotAllowedError` (this class) fires before any chain
|
|
645
|
+
* interaction — the Zama relayer / ACL precompile refused to issue a
|
|
646
|
+
* decryption response, typically because no `FHE.allow(handle, sender)`
|
|
647
|
+
* ever fired for this caller.
|
|
648
|
+
* - `FheHandleNotAllowedError` fires when a contract entrypoint calls
|
|
649
|
+
* `FHE.isSenderAllowed(handle)` on-chain and reverts. The tx made it to
|
|
650
|
+
* the EVM but the contract refused.
|
|
651
|
+
*/
|
|
652
|
+
export declare class UserDecryptNotAllowedError extends TokenOpsSdkError {
|
|
653
|
+
readonly name = "UserDecryptNotAllowedError";
|
|
654
|
+
readonly context: {
|
|
655
|
+
method: string;
|
|
656
|
+
handle?: Hex;
|
|
657
|
+
userAddress?: Address;
|
|
658
|
+
};
|
|
659
|
+
constructor(args: {
|
|
660
|
+
method: string;
|
|
661
|
+
handle?: Hex;
|
|
662
|
+
userAddress?: Address;
|
|
663
|
+
cause?: unknown;
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Free-form validation error thrown by SDK helpers that don't have a more
|
|
668
|
+
* specific typed subclass yet (e.g. `normaliseAddress`). Accepts a free-form
|
|
669
|
+
* `context` object so call sites can attach whatever per-throw metadata they
|
|
670
|
+
* need; consumers branch on `error.code === "TOKENOPS_INVALID_ARGUMENT"` (the
|
|
671
|
+
* same code `InvalidArgumentError` uses).
|
|
672
|
+
*/
|
|
673
|
+
export declare class TokenOpsValidationError extends TokenOpsSdkError {
|
|
674
|
+
readonly name = "TokenOpsValidationError";
|
|
675
|
+
constructor(message: string, context?: Record<string, unknown>);
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Generic contract-interaction error thrown by SDK helpers that wrap
|
|
679
|
+
* `writeContract` + receipt-wait (e.g. `setOperator`, `mintMockERC7984`)
|
|
680
|
+
* outside the typed revert-mapper path. Accepts a free-form `context` object;
|
|
681
|
+
* consumers branch on `error.code === "TOKENOPS_CONTRACT_REVERT"`.
|
|
682
|
+
*/
|
|
683
|
+
export declare class TokenOpsContractError extends TokenOpsSdkError {
|
|
684
|
+
readonly name = "TokenOpsContractError";
|
|
685
|
+
constructor(message: string, context?: Record<string, unknown>);
|
|
686
|
+
}
|
|
687
|
+
export {};
|