@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,599 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkITQ7WKVC_cjs = require('../chunk-ITQ7WKVC.cjs');
|
|
4
|
+
var chunkFWHYQZ5E_cjs = require('../chunk-FWHYQZ5E.cjs');
|
|
5
|
+
var chunk5SGMJADP_cjs = require('../chunk-5SGMJADP.cjs');
|
|
6
|
+
var chunkQ7ARQSUH_cjs = require('../chunk-Q7ARQSUH.cjs');
|
|
7
|
+
var chunkCQIPRNS7_cjs = require('../chunk-CQIPRNS7.cjs');
|
|
8
|
+
var chunkVJKZWYYJ_cjs = require('../chunk-VJKZWYYJ.cjs');
|
|
9
|
+
var chunk56UI7LUR_cjs = require('../chunk-56UI7LUR.cjs');
|
|
10
|
+
var sdk = require('@zama-fhe/sdk');
|
|
11
|
+
|
|
12
|
+
// src/fhe/mock-encryptor.ts
|
|
13
|
+
var FHEVM_HANDLE_VERSION = 0;
|
|
14
|
+
var FHEVM_EXECUTOR_ADDRESS_LOCAL = "0xe3a9105a3a932253A70F126eb1E3b589C643dD24";
|
|
15
|
+
var COPROCESSOR_SIGNER_PRIVATE_KEY_LOCAL = "0x7ec8ada6642fc4ccfb7729bc29c17cf8d21b61abd5642d1db992c0b8672ab901";
|
|
16
|
+
async function requirePeerDep(spec, hint) {
|
|
17
|
+
try {
|
|
18
|
+
return await import(
|
|
19
|
+
/* webpackIgnore: true */
|
|
20
|
+
spec
|
|
21
|
+
);
|
|
22
|
+
} catch (err) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`@tokenops/sdk: peer dependency "${spec}" is required for createMockEncryptor.
|
|
25
|
+
install it with: ${hint}
|
|
26
|
+
underlying error: ${String(err)}`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async function createMockRelayerProvider(mockUtils, ethers, opts) {
|
|
31
|
+
const provider = new ethers.JsonRpcProvider(opts.rpcUrl);
|
|
32
|
+
const signer = new ethers.Wallet(opts.coprocessorSignerPrivateKey, provider);
|
|
33
|
+
const db = new mockUtils.FhevmDBMap();
|
|
34
|
+
const head = await provider.getBlockNumber();
|
|
35
|
+
await db.init(head);
|
|
36
|
+
const coprocessor = await mockUtils.MockCoprocessor.create(provider, {
|
|
37
|
+
coprocessorContractAddress: opts.fhevmExecutorContractAddress,
|
|
38
|
+
coprocessorSigners: [signer],
|
|
39
|
+
inputVerifierContractAddress: opts.inputVerifierContractAddress,
|
|
40
|
+
db
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
provider,
|
|
44
|
+
async send(method, params) {
|
|
45
|
+
switch (method) {
|
|
46
|
+
case mockUtils.relayer.RELAYER_V1_INPUT_PROOF: {
|
|
47
|
+
const payload = params[0];
|
|
48
|
+
mockUtils.relayer.assertIsMockRelayerV1InputProofPayload(payload);
|
|
49
|
+
const contractChainId = Number(payload.contractChainId);
|
|
50
|
+
if (opts.aclContractAddress.toLowerCase() !== payload.mockData.aclContractAddress.toLowerCase()) {
|
|
51
|
+
throw new Error(
|
|
52
|
+
`createMockEncryptor: ACL mismatch: expected ${opts.aclContractAddress}, got ${payload.mockData.aclContractAddress}`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
const handlesBytes32List = mockUtils.FhevmHandle.computeHandles(
|
|
56
|
+
ethers.getBytes(payload.ciphertextWithInputVerification),
|
|
57
|
+
payload.mockData.fhevmTypes,
|
|
58
|
+
payload.mockData.aclContractAddress,
|
|
59
|
+
contractChainId,
|
|
60
|
+
FHEVM_HANDLE_VERSION
|
|
61
|
+
);
|
|
62
|
+
const response = await coprocessor.computeCoprocessorSignatures(
|
|
63
|
+
handlesBytes32List,
|
|
64
|
+
contractChainId,
|
|
65
|
+
payload.contractAddress,
|
|
66
|
+
payload.userAddress,
|
|
67
|
+
payload.extraData
|
|
68
|
+
);
|
|
69
|
+
for (let i = 0; i < response.handles.length; i++) {
|
|
70
|
+
const raw = response.handles[i] ?? "";
|
|
71
|
+
const handleHex = raw.startsWith("0x") ? raw : `0x${raw}`;
|
|
72
|
+
const cleartext = payload.mockData.clearTextValuesBigIntHex[i] ?? "0x0";
|
|
73
|
+
const meta = payload.mockData.metadatas[i];
|
|
74
|
+
await coprocessor.insertHandleBytes32(handleHex, cleartext, meta);
|
|
75
|
+
}
|
|
76
|
+
return response;
|
|
77
|
+
}
|
|
78
|
+
case mockUtils.relayer.RELAYER_V1_USER_DECRYPT: {
|
|
79
|
+
const payload = params[0];
|
|
80
|
+
mockUtils.relayer.assertIsRelayerV1UserDecryptPayload(payload);
|
|
81
|
+
await coprocessor.awaitCoprocessor();
|
|
82
|
+
await mockUtils.MockFhevmInstance.verifyUserACLPermissions(
|
|
83
|
+
provider,
|
|
84
|
+
opts.aclContractAddress,
|
|
85
|
+
payload.handleContractPairs,
|
|
86
|
+
payload.userAddress
|
|
87
|
+
);
|
|
88
|
+
await mockUtils.MockFhevmInstance.verifyUserDecryptSignature(
|
|
89
|
+
payload.publicKey,
|
|
90
|
+
payload.signature,
|
|
91
|
+
payload.contractAddresses,
|
|
92
|
+
payload.userAddress,
|
|
93
|
+
Number(payload.requestValidity.startTimestamp),
|
|
94
|
+
Number(payload.requestValidity.durationDays),
|
|
95
|
+
opts.verifyingContractAddressDecryption,
|
|
96
|
+
Number(payload.contractsChainId)
|
|
97
|
+
);
|
|
98
|
+
const handleBytes32HexList = payload.handleContractPairs.map(
|
|
99
|
+
(h) => ethers.toBeHex(ethers.toBigInt(h.handle), 32)
|
|
100
|
+
);
|
|
101
|
+
const clearTextHexList = await coprocessor.queryHandlesBytes32AsHex(handleBytes32HexList);
|
|
102
|
+
return {
|
|
103
|
+
payload: { decrypted_values: clearTextHexList },
|
|
104
|
+
signature: ethers.ZeroHash
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
default:
|
|
108
|
+
return provider.send(method, params);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
async function createMockEncryptor(options = {}) {
|
|
114
|
+
const rpcUrl = options.rpcUrl ?? "http://127.0.0.1:8545";
|
|
115
|
+
const chainId = options.chainId ?? 31337;
|
|
116
|
+
const mockUtils = await requirePeerDep(
|
|
117
|
+
"@fhevm/mock-utils",
|
|
118
|
+
"pnpm add -D @fhevm/mock-utils"
|
|
119
|
+
);
|
|
120
|
+
const zamaSdk = await requirePeerDep(
|
|
121
|
+
"@zama-fhe/sdk",
|
|
122
|
+
"pnpm add @zama-fhe/sdk@^3"
|
|
123
|
+
);
|
|
124
|
+
const ethers = await requirePeerDep(
|
|
125
|
+
"ethers",
|
|
126
|
+
"pnpm add ethers@^6 (peer dep of @fhevm/mock-utils)"
|
|
127
|
+
);
|
|
128
|
+
const HardhatConfig = zamaSdk.HardhatConfig;
|
|
129
|
+
const hostAddresses = {
|
|
130
|
+
aclContractAddress: options.hostAddresses?.aclContractAddress ?? HardhatConfig.aclContractAddress,
|
|
131
|
+
inputVerifierContractAddress: options.hostAddresses?.inputVerifierContractAddress ?? HardhatConfig.inputVerifierContractAddress,
|
|
132
|
+
kmsContractAddress: options.hostAddresses?.kmsContractAddress ?? HardhatConfig.kmsContractAddress,
|
|
133
|
+
verifyingContractAddressDecryption: options.hostAddresses?.verifyingContractAddressDecryption ?? HardhatConfig.verifyingContractAddressDecryption,
|
|
134
|
+
verifyingContractAddressInputVerification: options.hostAddresses?.verifyingContractAddressInputVerification ?? HardhatConfig.verifyingContractAddressInputVerification,
|
|
135
|
+
fhevmExecutorContractAddress: options.hostAddresses?.fhevmExecutorContractAddress ?? FHEVM_EXECUTOR_ADDRESS_LOCAL,
|
|
136
|
+
gatewayChainId: options.hostAddresses?.gatewayChainId ?? HardhatConfig.gatewayChainId
|
|
137
|
+
};
|
|
138
|
+
const relayer = await createMockRelayerProvider(mockUtils, ethers, {
|
|
139
|
+
rpcUrl,
|
|
140
|
+
aclContractAddress: hostAddresses.aclContractAddress,
|
|
141
|
+
inputVerifierContractAddress: hostAddresses.inputVerifierContractAddress,
|
|
142
|
+
verifyingContractAddressDecryption: hostAddresses.verifyingContractAddressDecryption,
|
|
143
|
+
fhevmExecutorContractAddress: hostAddresses.fhevmExecutorContractAddress,
|
|
144
|
+
coprocessorSignerPrivateKey: options.coprocessorSignerPrivateKey ?? COPROCESSOR_SIGNER_PRIVATE_KEY_LOCAL
|
|
145
|
+
});
|
|
146
|
+
const instance = await mockUtils.MockFhevmInstance.create(
|
|
147
|
+
relayer,
|
|
148
|
+
relayer.provider,
|
|
149
|
+
{
|
|
150
|
+
aclContractAddress: hostAddresses.aclContractAddress,
|
|
151
|
+
inputVerifierContractAddress: hostAddresses.inputVerifierContractAddress,
|
|
152
|
+
kmsContractAddress: hostAddresses.kmsContractAddress,
|
|
153
|
+
verifyingContractAddressDecryption: hostAddresses.verifyingContractAddressDecryption,
|
|
154
|
+
verifyingContractAddressInputVerification: hostAddresses.verifyingContractAddressInputVerification,
|
|
155
|
+
chainId,
|
|
156
|
+
gatewayChainId: hostAddresses.gatewayChainId
|
|
157
|
+
},
|
|
158
|
+
{ inputVerifierProperties: {}, kmsVerifierProperties: {} }
|
|
159
|
+
);
|
|
160
|
+
return {
|
|
161
|
+
instance,
|
|
162
|
+
chainId,
|
|
163
|
+
async encrypt({ values, contractAddress, userAddress }) {
|
|
164
|
+
const input = instance.createEncryptedInput(contractAddress, userAddress);
|
|
165
|
+
for (const v of values) {
|
|
166
|
+
addValue(input, v);
|
|
167
|
+
}
|
|
168
|
+
return input.encrypt();
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function addValue(input, v) {
|
|
173
|
+
switch (v.type) {
|
|
174
|
+
case "euint8":
|
|
175
|
+
input.add8(v.value);
|
|
176
|
+
return;
|
|
177
|
+
case "euint16":
|
|
178
|
+
input.add16(v.value);
|
|
179
|
+
return;
|
|
180
|
+
case "euint32":
|
|
181
|
+
input.add32(v.value);
|
|
182
|
+
return;
|
|
183
|
+
case "euint64":
|
|
184
|
+
input.add64(v.value);
|
|
185
|
+
return;
|
|
186
|
+
case "euint128":
|
|
187
|
+
input.add128(v.value);
|
|
188
|
+
return;
|
|
189
|
+
case "ebool":
|
|
190
|
+
input.addBool(v.value);
|
|
191
|
+
return;
|
|
192
|
+
case "eaddress":
|
|
193
|
+
input.addAddress(v.value);
|
|
194
|
+
return;
|
|
195
|
+
default:
|
|
196
|
+
throw new Error(
|
|
197
|
+
`createMockEncryptor: unsupported FHE type "${v.type}"`
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
var createLocalFhevmEncryptor = createMockEncryptor;
|
|
202
|
+
|
|
203
|
+
// src/fhe/mock-erc7984.ts
|
|
204
|
+
var MOCK_ERC7984_MINT_ABI = [
|
|
205
|
+
{
|
|
206
|
+
type: "function",
|
|
207
|
+
name: "mint",
|
|
208
|
+
stateMutability: "nonpayable",
|
|
209
|
+
inputs: [
|
|
210
|
+
{ name: "to", type: "address" },
|
|
211
|
+
{ name: "amount", type: "uint64" }
|
|
212
|
+
],
|
|
213
|
+
outputs: []
|
|
214
|
+
}
|
|
215
|
+
];
|
|
216
|
+
var UINT64_MAX = (1n << 64n) - 1n;
|
|
217
|
+
async function mintMockERC7984(args) {
|
|
218
|
+
const { publicClient, walletClient, account, waitForReceipt = true, telemetry } = args;
|
|
219
|
+
const token = chunkCQIPRNS7_cjs.normaliseAddress(args.token);
|
|
220
|
+
const to = chunkCQIPRNS7_cjs.normaliseAddress(args.to);
|
|
221
|
+
return chunkVJKZWYYJ_cjs.withTelemetry(telemetry, "fhe.mintMockERC7984", async () => {
|
|
222
|
+
const fromAccount = account ?? walletClient.account;
|
|
223
|
+
if (!fromAccount) {
|
|
224
|
+
throw new chunk56UI7LUR_cjs.TokenOpsContractError(
|
|
225
|
+
"mintMockERC7984: no account available \u2014 pass `account` explicitly or attach an account to the walletClient",
|
|
226
|
+
{ contract: "ERC7984", call: "mint" }
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
if (args.amount < 0n || args.amount > UINT64_MAX) {
|
|
230
|
+
throw new chunk56UI7LUR_cjs.TokenOpsContractError(
|
|
231
|
+
`mintMockERC7984: amount ${args.amount} out of uint64 range [0, ${UINT64_MAX}]`,
|
|
232
|
+
{ contract: "ERC7984", call: "mint", amount: args.amount.toString() }
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
let hash;
|
|
236
|
+
try {
|
|
237
|
+
hash = await walletClient.writeContract({
|
|
238
|
+
address: token,
|
|
239
|
+
abi: MOCK_ERC7984_MINT_ABI,
|
|
240
|
+
functionName: "mint",
|
|
241
|
+
args: [to, args.amount],
|
|
242
|
+
account: fromAccount,
|
|
243
|
+
// viem requires `chain` to be passed explicitly when the wallet has
|
|
244
|
+
// no default chain. Forward whatever the wallet is bound to.
|
|
245
|
+
chain: walletClient.chain
|
|
246
|
+
});
|
|
247
|
+
} catch (err) {
|
|
248
|
+
throw new chunk56UI7LUR_cjs.TokenOpsContractError(
|
|
249
|
+
`mintMockERC7984: writeContract failed (token=${token}, to=${to})`,
|
|
250
|
+
{
|
|
251
|
+
contract: "ERC7984",
|
|
252
|
+
call: "mint",
|
|
253
|
+
token,
|
|
254
|
+
to,
|
|
255
|
+
cause: err
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
let blockNumber = 0n;
|
|
260
|
+
if (waitForReceipt) {
|
|
261
|
+
try {
|
|
262
|
+
const receipt = await publicClient.waitForTransactionReceipt({ hash });
|
|
263
|
+
blockNumber = receipt.blockNumber;
|
|
264
|
+
} catch (err) {
|
|
265
|
+
throw new chunk56UI7LUR_cjs.TokenOpsContractError(`mintMockERC7984: receipt wait failed (tx=${hash})`, {
|
|
266
|
+
contract: "ERC7984",
|
|
267
|
+
call: "mint",
|
|
268
|
+
tx: hash,
|
|
269
|
+
cause: err
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return { hash, blockNumber };
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
function createMockErc7984Client(args) {
|
|
277
|
+
const address = chunkCQIPRNS7_cjs.normaliseAddress(args.address);
|
|
278
|
+
const { publicClient, walletClient, telemetry } = args;
|
|
279
|
+
return {
|
|
280
|
+
address,
|
|
281
|
+
mint(callArgs) {
|
|
282
|
+
return mintMockERC7984({
|
|
283
|
+
publicClient,
|
|
284
|
+
walletClient,
|
|
285
|
+
token: address,
|
|
286
|
+
...telemetry !== void 0 ? { telemetry } : {},
|
|
287
|
+
...callArgs
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// src/fhe/sepolia-encryptor.ts
|
|
294
|
+
var SEPOLIA_CHAIN_ID = 11155111;
|
|
295
|
+
var MAINNET_CHAIN_ID = 1;
|
|
296
|
+
async function requirePeerDep2(spec, hint) {
|
|
297
|
+
try {
|
|
298
|
+
return await import(
|
|
299
|
+
/* webpackIgnore: true */
|
|
300
|
+
spec
|
|
301
|
+
);
|
|
302
|
+
} catch (err) {
|
|
303
|
+
throw new Error(
|
|
304
|
+
`@tokenops/sdk: peer dependency "${spec}" is required for createSepoliaEncryptor.
|
|
305
|
+
install it with: ${hint}
|
|
306
|
+
underlying error: ${String(err)}`
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
async function createSepoliaEncryptor(options = {}) {
|
|
311
|
+
const chainId = options.chainId ?? SEPOLIA_CHAIN_ID;
|
|
312
|
+
const zamaSdkNode = await requirePeerDep2(
|
|
313
|
+
"@zama-fhe/sdk/node",
|
|
314
|
+
"pnpm add @zama-fhe/sdk@^3"
|
|
315
|
+
);
|
|
316
|
+
const baseConfig = chainId === MAINNET_CHAIN_ID ? zamaSdkNode.MainnetConfig : zamaSdkNode.SepoliaConfig;
|
|
317
|
+
const transportConfig = { ...baseConfig };
|
|
318
|
+
if (options.relayerUrl !== void 0) {
|
|
319
|
+
transportConfig.relayerUrl = options.relayerUrl;
|
|
320
|
+
}
|
|
321
|
+
const safeLogger = options.logger ? {
|
|
322
|
+
debug: () => {
|
|
323
|
+
},
|
|
324
|
+
info: () => {
|
|
325
|
+
},
|
|
326
|
+
warn: () => {
|
|
327
|
+
},
|
|
328
|
+
error: () => {
|
|
329
|
+
},
|
|
330
|
+
...options.logger
|
|
331
|
+
} : void 0;
|
|
332
|
+
const instance = new zamaSdkNode.RelayerNode({
|
|
333
|
+
transports: { [chainId]: transportConfig },
|
|
334
|
+
getChainId: () => Promise.resolve(chainId),
|
|
335
|
+
poolSize: options.poolSize,
|
|
336
|
+
logger: safeLogger,
|
|
337
|
+
fheArtifactStorage: options.fheArtifactStorage,
|
|
338
|
+
fheArtifactCacheTTL: options.fheArtifactCacheTTL
|
|
339
|
+
});
|
|
340
|
+
return {
|
|
341
|
+
instance,
|
|
342
|
+
chainId,
|
|
343
|
+
async encrypt({ values, contractAddress, userAddress }) {
|
|
344
|
+
return instance.encrypt({ values, contractAddress, userAddress });
|
|
345
|
+
},
|
|
346
|
+
terminate() {
|
|
347
|
+
instance.terminate();
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
function createSepoliaEncryptorWeb(opts) {
|
|
352
|
+
const chainId = opts.chainId ?? SEPOLIA_CHAIN_ID;
|
|
353
|
+
if (typeof sdk.RelayerWeb !== "function") {
|
|
354
|
+
throw new Error(
|
|
355
|
+
`@tokenops/sdk: @zama-fhe/sdk is required for createSepoliaEncryptorWeb.
|
|
356
|
+
install it with: pnpm add @zama-fhe/sdk@^3
|
|
357
|
+
(RelayerWeb was not a constructor \u2014 the module resolved to ${typeof sdk.RelayerWeb})`
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
const baseConfig = chainId === MAINNET_CHAIN_ID ? sdk.MainnetConfig : sdk.SepoliaConfig;
|
|
361
|
+
const transportConfig = { ...baseConfig };
|
|
362
|
+
if (opts.relayerUrl !== void 0) {
|
|
363
|
+
transportConfig.relayerUrl = opts.relayerUrl;
|
|
364
|
+
}
|
|
365
|
+
void opts.publicClient;
|
|
366
|
+
void opts.walletClient;
|
|
367
|
+
const safeLogger = opts.logger ? {
|
|
368
|
+
debug: () => {
|
|
369
|
+
},
|
|
370
|
+
info: () => {
|
|
371
|
+
},
|
|
372
|
+
warn: () => {
|
|
373
|
+
},
|
|
374
|
+
error: () => {
|
|
375
|
+
},
|
|
376
|
+
...opts.logger
|
|
377
|
+
} : void 0;
|
|
378
|
+
const instance = new sdk.RelayerWeb({
|
|
379
|
+
transports: { [chainId]: transportConfig },
|
|
380
|
+
getChainId: () => Promise.resolve(chainId),
|
|
381
|
+
logger: safeLogger
|
|
382
|
+
});
|
|
383
|
+
return Promise.resolve({
|
|
384
|
+
instance,
|
|
385
|
+
chainId,
|
|
386
|
+
encrypt({ values, contractAddress, userAddress }) {
|
|
387
|
+
return instance.encrypt({ values, contractAddress, userAddress });
|
|
388
|
+
},
|
|
389
|
+
terminate() {
|
|
390
|
+
instance.terminate();
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
Object.defineProperty(exports, "ERC7984_OPERATOR_MAX_DEADLINE", {
|
|
396
|
+
enumerable: true,
|
|
397
|
+
get: function () { return chunkITQ7WKVC_cjs.ERC7984_OPERATOR_MAX_DEADLINE; }
|
|
398
|
+
});
|
|
399
|
+
Object.defineProperty(exports, "ERC7984_SET_OPERATOR_ABI", {
|
|
400
|
+
enumerable: true,
|
|
401
|
+
get: function () { return chunkITQ7WKVC_cjs.ERC7984_SET_OPERATOR_ABI; }
|
|
402
|
+
});
|
|
403
|
+
Object.defineProperty(exports, "revokeOperator", {
|
|
404
|
+
enumerable: true,
|
|
405
|
+
get: function () { return chunkITQ7WKVC_cjs.revokeOperator; }
|
|
406
|
+
});
|
|
407
|
+
Object.defineProperty(exports, "setOperator", {
|
|
408
|
+
enumerable: true,
|
|
409
|
+
get: function () { return chunkITQ7WKVC_cjs.setOperator; }
|
|
410
|
+
});
|
|
411
|
+
Object.defineProperty(exports, "erc7984OperatorAbi", {
|
|
412
|
+
enumerable: true,
|
|
413
|
+
get: function () { return chunkFWHYQZ5E_cjs.erc7984OperatorAbi; }
|
|
414
|
+
});
|
|
415
|
+
Object.defineProperty(exports, "FHE_SPLIT_DENOMINATOR", {
|
|
416
|
+
enumerable: true,
|
|
417
|
+
get: function () { return chunk5SGMJADP_cjs.FHE_SPLIT_DENOMINATOR; }
|
|
418
|
+
});
|
|
419
|
+
Object.defineProperty(exports, "scaleRatio", {
|
|
420
|
+
enumerable: true,
|
|
421
|
+
get: function () { return chunk5SGMJADP_cjs.scaleRatio; }
|
|
422
|
+
});
|
|
423
|
+
Object.defineProperty(exports, "share", {
|
|
424
|
+
enumerable: true,
|
|
425
|
+
get: function () { return chunk5SGMJADP_cjs.share; }
|
|
426
|
+
});
|
|
427
|
+
Object.defineProperty(exports, "ACL_ALLOWED_EVENT", {
|
|
428
|
+
enumerable: true,
|
|
429
|
+
get: function () { return chunkQ7ARQSUH_cjs.ACL_ALLOWED_EVENT; }
|
|
430
|
+
});
|
|
431
|
+
Object.defineProperty(exports, "FHEVM_ACL_ADDRESS_BY_CHAIN", {
|
|
432
|
+
enumerable: true,
|
|
433
|
+
get: function () { return chunkQ7ARQSUH_cjs.FHEVM_ACL_ADDRESS_BY_CHAIN; }
|
|
434
|
+
});
|
|
435
|
+
Object.defineProperty(exports, "getFhevmAclAddress", {
|
|
436
|
+
enumerable: true,
|
|
437
|
+
get: function () { return chunkQ7ARQSUH_cjs.getFhevmAclAddress; }
|
|
438
|
+
});
|
|
439
|
+
Object.defineProperty(exports, "requireFhevmAclAddress", {
|
|
440
|
+
enumerable: true,
|
|
441
|
+
get: function () { return chunkQ7ARQSUH_cjs.requireFhevmAclAddress; }
|
|
442
|
+
});
|
|
443
|
+
Object.defineProperty(exports, "AccessDeniedError", {
|
|
444
|
+
enumerable: true,
|
|
445
|
+
get: function () { return chunk56UI7LUR_cjs.AccessDeniedError; }
|
|
446
|
+
});
|
|
447
|
+
Object.defineProperty(exports, "AlreadyInitializedError", {
|
|
448
|
+
enumerable: true,
|
|
449
|
+
get: function () { return chunk56UI7LUR_cjs.AlreadyInitializedError; }
|
|
450
|
+
});
|
|
451
|
+
Object.defineProperty(exports, "BatchTooLargeError", {
|
|
452
|
+
enumerable: true,
|
|
453
|
+
get: function () { return chunk56UI7LUR_cjs.BatchTooLargeError; }
|
|
454
|
+
});
|
|
455
|
+
Object.defineProperty(exports, "ContractRevertError", {
|
|
456
|
+
enumerable: true,
|
|
457
|
+
get: function () { return chunk56UI7LUR_cjs.ContractRevertError; }
|
|
458
|
+
});
|
|
459
|
+
Object.defineProperty(exports, "DecryptionFailedError", {
|
|
460
|
+
enumerable: true,
|
|
461
|
+
get: function () { return chunk56UI7LUR_cjs.DecryptionFailedError; }
|
|
462
|
+
});
|
|
463
|
+
Object.defineProperty(exports, "DeploymentAddressUnavailableError", {
|
|
464
|
+
enumerable: true,
|
|
465
|
+
get: function () { return chunk56UI7LUR_cjs.DeploymentAddressUnavailableError; }
|
|
466
|
+
});
|
|
467
|
+
Object.defineProperty(exports, "EncryptionFailedError", {
|
|
468
|
+
enumerable: true,
|
|
469
|
+
get: function () { return chunk56UI7LUR_cjs.EncryptionFailedError; }
|
|
470
|
+
});
|
|
471
|
+
Object.defineProperty(exports, "FeatureDisabledError", {
|
|
472
|
+
enumerable: true,
|
|
473
|
+
get: function () { return chunk56UI7LUR_cjs.FeatureDisabledError; }
|
|
474
|
+
});
|
|
475
|
+
Object.defineProperty(exports, "FheHandleNotAllowedError", {
|
|
476
|
+
enumerable: true,
|
|
477
|
+
get: function () { return chunk56UI7LUR_cjs.FheHandleNotAllowedError; }
|
|
478
|
+
});
|
|
479
|
+
Object.defineProperty(exports, "InsufficientBalanceError", {
|
|
480
|
+
enumerable: true,
|
|
481
|
+
get: function () { return chunk56UI7LUR_cjs.InsufficientBalanceError; }
|
|
482
|
+
});
|
|
483
|
+
Object.defineProperty(exports, "InsufficientFeeError", {
|
|
484
|
+
enumerable: true,
|
|
485
|
+
get: function () { return chunk56UI7LUR_cjs.InsufficientFeeError; }
|
|
486
|
+
});
|
|
487
|
+
Object.defineProperty(exports, "InsufficientGasFundsError", {
|
|
488
|
+
enumerable: true,
|
|
489
|
+
get: function () { return chunk56UI7LUR_cjs.InsufficientGasFundsError; }
|
|
490
|
+
});
|
|
491
|
+
Object.defineProperty(exports, "InvalidArgumentError", {
|
|
492
|
+
enumerable: true,
|
|
493
|
+
get: function () { return chunk56UI7LUR_cjs.InvalidArgumentError; }
|
|
494
|
+
});
|
|
495
|
+
Object.defineProperty(exports, "InvalidSignatureError", {
|
|
496
|
+
enumerable: true,
|
|
497
|
+
get: function () { return chunk56UI7LUR_cjs.InvalidSignatureError; }
|
|
498
|
+
});
|
|
499
|
+
Object.defineProperty(exports, "MissingAccountError", {
|
|
500
|
+
enumerable: true,
|
|
501
|
+
get: function () { return chunk56UI7LUR_cjs.MissingAccountError; }
|
|
502
|
+
});
|
|
503
|
+
Object.defineProperty(exports, "MissingClientError", {
|
|
504
|
+
enumerable: true,
|
|
505
|
+
get: function () { return chunk56UI7LUR_cjs.MissingClientError; }
|
|
506
|
+
});
|
|
507
|
+
Object.defineProperty(exports, "MissingEncryptorError", {
|
|
508
|
+
enumerable: true,
|
|
509
|
+
get: function () { return chunk56UI7LUR_cjs.MissingEncryptorError; }
|
|
510
|
+
});
|
|
511
|
+
Object.defineProperty(exports, "MissingPublicClientError", {
|
|
512
|
+
enumerable: true,
|
|
513
|
+
get: function () { return chunk56UI7LUR_cjs.MissingPublicClientError; }
|
|
514
|
+
});
|
|
515
|
+
Object.defineProperty(exports, "MissingWalletClientError", {
|
|
516
|
+
enumerable: true,
|
|
517
|
+
get: function () { return chunk56UI7LUR_cjs.MissingWalletClientError; }
|
|
518
|
+
});
|
|
519
|
+
Object.defineProperty(exports, "NetworkError", {
|
|
520
|
+
enumerable: true,
|
|
521
|
+
get: function () { return chunk56UI7LUR_cjs.NetworkError; }
|
|
522
|
+
});
|
|
523
|
+
Object.defineProperty(exports, "PausedError", {
|
|
524
|
+
enumerable: true,
|
|
525
|
+
get: function () { return chunk56UI7LUR_cjs.PausedError; }
|
|
526
|
+
});
|
|
527
|
+
Object.defineProperty(exports, "ReceiptEventAmbiguousError", {
|
|
528
|
+
enumerable: true,
|
|
529
|
+
get: function () { return chunk56UI7LUR_cjs.ReceiptEventAmbiguousError; }
|
|
530
|
+
});
|
|
531
|
+
Object.defineProperty(exports, "ReceiptEventNotFoundError", {
|
|
532
|
+
enumerable: true,
|
|
533
|
+
get: function () { return chunk56UI7LUR_cjs.ReceiptEventNotFoundError; }
|
|
534
|
+
});
|
|
535
|
+
Object.defineProperty(exports, "ReentrancyError", {
|
|
536
|
+
enumerable: true,
|
|
537
|
+
get: function () { return chunk56UI7LUR_cjs.ReentrancyError; }
|
|
538
|
+
});
|
|
539
|
+
Object.defineProperty(exports, "RelayerUnreachableError", {
|
|
540
|
+
enumerable: true,
|
|
541
|
+
get: function () { return chunk56UI7LUR_cjs.RelayerUnreachableError; }
|
|
542
|
+
});
|
|
543
|
+
Object.defineProperty(exports, "SigningFailedError", {
|
|
544
|
+
enumerable: true,
|
|
545
|
+
get: function () { return chunk56UI7LUR_cjs.SigningFailedError; }
|
|
546
|
+
});
|
|
547
|
+
Object.defineProperty(exports, "TokenOpsContractError", {
|
|
548
|
+
enumerable: true,
|
|
549
|
+
get: function () { return chunk56UI7LUR_cjs.TokenOpsContractError; }
|
|
550
|
+
});
|
|
551
|
+
Object.defineProperty(exports, "TokenOpsSdkError", {
|
|
552
|
+
enumerable: true,
|
|
553
|
+
get: function () { return chunk56UI7LUR_cjs.TokenOpsSdkError; }
|
|
554
|
+
});
|
|
555
|
+
Object.defineProperty(exports, "TokenOpsValidationError", {
|
|
556
|
+
enumerable: true,
|
|
557
|
+
get: function () { return chunk56UI7LUR_cjs.TokenOpsValidationError; }
|
|
558
|
+
});
|
|
559
|
+
Object.defineProperty(exports, "TransferFailedError", {
|
|
560
|
+
enumerable: true,
|
|
561
|
+
get: function () { return chunk56UI7LUR_cjs.TransferFailedError; }
|
|
562
|
+
});
|
|
563
|
+
Object.defineProperty(exports, "UnknownWriteFailureError", {
|
|
564
|
+
enumerable: true,
|
|
565
|
+
get: function () { return chunk56UI7LUR_cjs.UnknownWriteFailureError; }
|
|
566
|
+
});
|
|
567
|
+
Object.defineProperty(exports, "UnsupportedChainError", {
|
|
568
|
+
enumerable: true,
|
|
569
|
+
get: function () { return chunk56UI7LUR_cjs.UnsupportedChainError; }
|
|
570
|
+
});
|
|
571
|
+
Object.defineProperty(exports, "UserDecryptNotAllowedError", {
|
|
572
|
+
enumerable: true,
|
|
573
|
+
get: function () { return chunk56UI7LUR_cjs.UserDecryptNotAllowedError; }
|
|
574
|
+
});
|
|
575
|
+
Object.defineProperty(exports, "UserRejectedSignatureError", {
|
|
576
|
+
enumerable: true,
|
|
577
|
+
get: function () { return chunk56UI7LUR_cjs.UserRejectedSignatureError; }
|
|
578
|
+
});
|
|
579
|
+
Object.defineProperty(exports, "WalletChainMismatchError", {
|
|
580
|
+
enumerable: true,
|
|
581
|
+
get: function () { return chunk56UI7LUR_cjs.WalletChainMismatchError; }
|
|
582
|
+
});
|
|
583
|
+
Object.defineProperty(exports, "WalletRejectedError", {
|
|
584
|
+
enumerable: true,
|
|
585
|
+
get: function () { return chunk56UI7LUR_cjs.WalletRejectedError; }
|
|
586
|
+
});
|
|
587
|
+
Object.defineProperty(exports, "isTokenOpsSdkError", {
|
|
588
|
+
enumerable: true,
|
|
589
|
+
get: function () { return chunk56UI7LUR_cjs.isTokenOpsSdkError; }
|
|
590
|
+
});
|
|
591
|
+
exports.MAINNET_CHAIN_ID = MAINNET_CHAIN_ID;
|
|
592
|
+
exports.MOCK_ERC7984_MINT_ABI = MOCK_ERC7984_MINT_ABI;
|
|
593
|
+
exports.SEPOLIA_CHAIN_ID = SEPOLIA_CHAIN_ID;
|
|
594
|
+
exports.createLocalFhevmEncryptor = createLocalFhevmEncryptor;
|
|
595
|
+
exports.createMockEncryptor = createMockEncryptor;
|
|
596
|
+
exports.createMockErc7984Client = createMockErc7984Client;
|
|
597
|
+
exports.createSepoliaEncryptor = createSepoliaEncryptor;
|
|
598
|
+
exports.createSepoliaEncryptorWeb = createSepoliaEncryptorWeb;
|
|
599
|
+
exports.mintMockERC7984 = mintMockERC7984;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./acl.js";
|
|
2
|
+
export * from "./mock-encryptor.js";
|
|
3
|
+
export * from "./mock-erc7984.js";
|
|
4
|
+
export * from "./operators.js";
|
|
5
|
+
export * from "./scale-ratio.js";
|
|
6
|
+
export * from "./sepolia-encryptor.js";
|
|
7
|
+
export * from "./sepolia-encryptor-web.js";
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
export { erc7984OperatorAbi } from "./erc7984-abi.js";
|
|
10
|
+
export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, TokenOpsValidationError, ContractRevertError, TokenOpsContractError, PausedError, AccessDeniedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../core/errors.js";
|
|
11
|
+
export { type PreflightResult } from "../core/preflight.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./acl.js";
|
|
2
|
+
export * from "./mock-encryptor.js";
|
|
3
|
+
export * from "./mock-erc7984.js";
|
|
4
|
+
export * from "./operators.js";
|
|
5
|
+
export * from "./scale-ratio.js";
|
|
6
|
+
export * from "./sepolia-encryptor.js";
|
|
7
|
+
export * from "./sepolia-encryptor-web.js";
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
export { erc7984OperatorAbi } from "./erc7984-abi.js";
|
|
10
|
+
export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, TokenOpsValidationError, ContractRevertError, TokenOpsContractError, PausedError, AccessDeniedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../core/errors.js";
|
|
11
|
+
export { type PreflightResult } from "../core/preflight.js";
|