@tokenops/sdk 1.6.0 → 2.0.0-alpha.2
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 +77 -8
- package/CONTRIBUTING.md +4 -2
- package/README.md +146 -90
- package/SUPPORT.md +47 -0
- package/dist/{chunk-BD4LZBVF.cjs → chunk-3QHNYEQD.cjs} +18 -17
- package/dist/{chunk-YFIWCYHC.cjs → chunk-3YHBO2DL.cjs} +56 -54
- package/dist/{chunk-QET3Q4JP.js → chunk-44YJPMQC.js} +8 -6
- package/dist/{chunk-6WSNS3UV.js → chunk-4RAAATVY.js} +2 -4
- package/dist/{chunk-4KJ66YRH.js → chunk-4TSDNZQ3.js} +2 -2
- package/dist/chunk-66IHPTOK.cjs +20 -0
- package/dist/{chunk-2RNW4MIJ.cjs → chunk-67OV5CX2.cjs} +0 -18
- package/dist/{chunk-PD7ME2BT.js → chunk-6GNR22OV.js} +2 -1
- package/dist/{chunk-WOEETTH7.cjs → chunk-7AFPOE7N.cjs} +6 -6
- package/dist/{chunk-QKKBBH7I.js → chunk-A4DCEE33.js} +34 -7
- package/dist/chunk-AREQJHKA.cjs +713 -0
- package/dist/{chunk-U57COLUE.js → chunk-AXIPOR3C.js} +2 -2
- package/dist/chunk-EBLBPUPI.cjs +255 -0
- package/dist/chunk-EYDA6Q6C.js +245 -0
- package/dist/{chunk-SYHNZSZZ.cjs → chunk-FAXIIH5R.cjs} +3 -3
- package/dist/{chunk-AYGRYDBX.cjs → chunk-FEDX7B6T.cjs} +37 -35
- package/dist/{chunk-CBRL2PJA.cjs → chunk-FHWSBGWE.cjs} +12 -12
- package/dist/{chunk-WUXUWTFW.cjs → chunk-FT5H2Q7Y.cjs} +37 -7
- package/dist/chunk-GADGBQJO.js +423 -0
- package/dist/{chunk-VHSNYUYV.js → chunk-IGO5XSPS.js} +5 -5
- package/dist/chunk-IUKKNJ2R.cjs +433 -0
- package/dist/{chunk-VR3FREBX.cjs → chunk-JK4XMMKM.cjs} +3 -3
- package/dist/{chunk-4ZCXK4VI.cjs → chunk-KFRDLKMA.cjs} +14 -14
- package/dist/chunk-KWFFIJYX.js +11 -0
- package/dist/{chunk-7G7UOQV4.cjs → chunk-MM5BV5CS.cjs} +4 -4
- package/dist/{chunk-43RFBQ73.cjs → chunk-MVDQMV25.cjs} +29 -32
- package/dist/chunk-NWFMBLSQ.js +4 -0
- package/dist/{chunk-HETNKZEE.js → chunk-PYYSB5ZN.js} +1 -1
- package/dist/chunk-PZZK3O3S.cjs +9843 -0
- package/dist/{chunk-DRSPMIZ7.js → chunk-QBJ7O2B4.js} +1 -11
- package/dist/{chunk-WTK6JDSI.js → chunk-SPLNGUFF.js} +6 -4
- package/dist/{chunk-UJS4N2XM.cjs → chunk-TEBM66WA.cjs} +12 -12
- package/dist/{chunk-TN65XNTI.js → chunk-TWT3STIX.js} +8 -6
- package/dist/chunk-UG5RKLU2.cjs +6 -0
- package/dist/{chunk-EUKPOXWR.cjs → chunk-UHHMVBLU.cjs} +17 -15
- package/dist/chunk-VW356KR3.js +688 -0
- package/dist/{chunk-BK7YIVLK.cjs → chunk-WJLECC22.cjs} +75 -73
- package/dist/{chunk-V5D7BHW3.js → chunk-WJMEBBU7.js} +6 -4
- package/dist/{chunk-NFW7AUEX.js → chunk-WMACINXO.js} +1 -1
- package/dist/chunk-X7WBPCEU.js +9817 -0
- package/dist/{chunk-46T67CE2.js → chunk-ZA673I3O.js} +1 -1
- package/dist/{chunk-YPYCWLYP.js → chunk-ZWXJTBZO.js} +1 -1
- package/dist/core/addresses.d.ts +14 -2
- package/dist/core/brands.d.ts +8 -2
- package/dist/core/errors.d.ts +71 -10
- package/dist/core/preflight.d.ts +1 -0
- package/dist/fhe/erc7984-abi.d.ts +1 -0
- package/dist/fhe/index.cjs +64 -63
- package/dist/fhe/index.js +7 -6
- package/dist/fhe/operators.d.ts +22 -5
- package/dist/fhe/react/index.cjs +13 -12
- package/dist/fhe/react/index.js +6 -5
- package/dist/fhe/types.d.ts +8 -2
- package/dist/fhe-airdrop/abis/{cloneable.d.ts → airdrop-base.d.ts} +254 -396
- package/dist/fhe-airdrop/abis/compliance.d.ts +422 -0
- package/dist/fhe-airdrop/abis/ecdsa.d.ts +1316 -0
- package/dist/fhe-airdrop/abis/factory.d.ts +1319 -190
- package/dist/fhe-airdrop/abis/index.d.ts +5 -2
- package/dist/fhe-airdrop/abis/merkle.d.ts +1250 -0
- package/dist/fhe-airdrop/advanced/index.cjs +11 -12
- package/dist/fhe-airdrop/advanced/index.d.cts +34 -11
- package/dist/fhe-airdrop/advanced/index.d.ts +34 -11
- package/dist/fhe-airdrop/advanced/index.js +3 -8
- package/dist/fhe-airdrop/advanced/react/index.cjs +619 -51
- package/dist/fhe-airdrop/advanced/react/index.d.cts +43 -3
- package/dist/fhe-airdrop/advanced/react/index.d.ts +43 -3
- package/dist/fhe-airdrop/advanced/react/index.js +592 -52
- package/dist/fhe-airdrop/advanced/react/useClearCompliancePolicy.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useClearUpgradeabilityPolicy.d.ts +26 -0
- package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +25 -0
- package/dist/fhe-airdrop/advanced/react/useEcdsaInitCodeHash.d.ts +30 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryComplianceDelegate.d.ts +25 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryCompliancePolicy.d.ts +38 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryCustomFee.d.ts +24 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryGrantRole.d.ts +32 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryHasRole.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryImplementations.d.ts +33 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRenounceRole.d.ts +36 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRevokeRole.d.ts +35 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRoleConstants.d.ts +46 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRoleMembers.d.ts +47 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryUpgradeabilityPolicy.d.ts +39 -0
- package/dist/fhe-airdrop/advanced/react/useMerkleInitCodeHash.d.ts +24 -0
- package/dist/fhe-airdrop/advanced/react/usePredictEcdsaAirdropAddress.d.ts +33 -0
- package/dist/fhe-airdrop/advanced/react/usePredictMerkleAirdropAddress.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetComplianceDelegate.d.ts +33 -0
- package/dist/fhe-airdrop/advanced/react/useSetComplianceManagerImpl.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetCompliancePolicy.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +31 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultUpgradeable.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetEcdsaImplementation.d.ts +34 -0
- package/dist/fhe-airdrop/advanced/react/useSetFeeCollector.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetMerkleImplementation.d.ts +30 -0
- package/dist/fhe-airdrop/advanced/react/useSetUpgradeabilityPolicy.d.ts +31 -0
- package/dist/fhe-airdrop/airdrop-base.d.ts +608 -0
- package/dist/fhe-airdrop/campaign.d.ts +338 -0
- package/dist/fhe-airdrop/compliance.d.ts +302 -0
- package/dist/fhe-airdrop/constants.d.ts +33 -0
- package/dist/fhe-airdrop/ecdsa.d.ts +263 -0
- package/dist/fhe-airdrop/encryption.d.ts +92 -14
- package/dist/fhe-airdrop/errors.d.ts +273 -15
- package/dist/fhe-airdrop/factory.d.ts +533 -274
- package/dist/fhe-airdrop/guards.d.ts +317 -0
- package/dist/fhe-airdrop/index.cjs +233 -73
- package/dist/fhe-airdrop/index.d.cts +46 -8
- package/dist/fhe-airdrop/index.d.ts +46 -8
- package/dist/fhe-airdrop/index.js +11 -7
- package/dist/fhe-airdrop/merkle-tree.d.ts +97 -0
- package/dist/fhe-airdrop/merkle.d.ts +201 -0
- package/dist/fhe-airdrop/react/_shared.d.ts +156 -70
- package/dist/fhe-airdrop/react/index.cjs +1174 -384
- package/dist/fhe-airdrop/react/index.d.cts +99 -74
- package/dist/fhe-airdrop/react/index.d.ts +99 -74
- package/dist/fhe-airdrop/react/index.js +993 -303
- package/dist/fhe-airdrop/react/keys.d.ts +90 -0
- package/dist/fhe-airdrop/react/useAccessEcdsaClaimAmount.d.ts +26 -0
- package/dist/fhe-airdrop/react/useAccessMerkleClaimAmount.d.ts +27 -0
- package/dist/fhe-airdrop/react/useAddComplianceDelegate.d.ts +37 -0
- package/dist/fhe-airdrop/react/useAdminBatchDiscloseBalanceToParties.d.ts +36 -0
- package/dist/fhe-airdrop/react/useAdminDiscloseBalanceToParty.d.ts +31 -0
- package/dist/fhe-airdrop/react/useAdminGetCurrentBalance.d.ts +27 -0
- package/dist/fhe-airdrop/react/useAirdropConfig.d.ts +49 -0
- package/dist/fhe-airdrop/react/useAirdropDeploymentMode.d.ts +28 -0
- package/dist/fhe-airdrop/react/useAirdropGasFee.d.ts +10 -5
- package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +29 -10
- package/dist/fhe-airdrop/react/useAirdropHasRole.d.ts +15 -6
- package/dist/fhe-airdrop/react/useAirdropPause.d.ts +30 -0
- package/dist/fhe-airdrop/react/useAirdropPaused.d.ts +17 -0
- package/dist/fhe-airdrop/react/useAirdropRenounceRole.d.ts +36 -0
- package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +27 -9
- package/dist/fhe-airdrop/react/useAirdropRoleAdmin.d.ts +28 -0
- package/dist/fhe-airdrop/react/useAirdropRoleConstants.d.ts +67 -0
- package/dist/fhe-airdrop/react/useAirdropRoleMembers.d.ts +49 -0
- package/dist/fhe-airdrop/react/useAirdropToken.d.ts +11 -4
- package/dist/fhe-airdrop/react/useAirdropUpgradeToAndCall.d.ts +45 -0
- package/dist/fhe-airdrop/react/useAirdropWindow.d.ts +37 -0
- package/dist/fhe-airdrop/react/useBatchDiscloseHandlesToParty.d.ts +32 -0
- package/dist/fhe-airdrop/react/useBuildMerkleCampaign.d.ts +68 -0
- package/dist/fhe-airdrop/react/useClaimedAmount.d.ts +29 -0
- package/dist/fhe-airdrop/react/useComplianceGrantRole.d.ts +32 -0
- package/dist/fhe-airdrop/react/useComplianceHasRole.d.ts +37 -0
- package/dist/fhe-airdrop/react/useComplianceInfo.d.ts +50 -0
- package/dist/fhe-airdrop/react/useComplianceManager.d.ts +16 -0
- package/dist/fhe-airdrop/react/useComplianceManagerOf.d.ts +32 -0
- package/dist/fhe-airdrop/react/useComplianceRenounceRole.d.ts +38 -0
- package/dist/fhe-airdrop/react/useComplianceRevokeRole.d.ts +36 -0
- package/dist/fhe-airdrop/react/useComplianceRoleConstants.d.ts +41 -0
- package/dist/fhe-airdrop/react/useComplianceRoleMembers.d.ts +45 -0
- package/dist/fhe-airdrop/react/useCreateAndFundEcdsaAirdrop.d.ts +55 -0
- package/dist/fhe-airdrop/react/useCreateAndFundMerkleAirdrop.d.ts +52 -0
- package/dist/fhe-airdrop/react/useCreateEcdsaAirdrop.d.ts +28 -0
- package/dist/fhe-airdrop/react/useCreateMerkleAirdrop.d.ts +25 -0
- package/dist/fhe-airdrop/react/useDiscloseHandleToParty.d.ts +35 -0
- package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +24 -0
- package/dist/fhe-airdrop/react/useEcdsaClaimAndUnwrap.d.ts +27 -0
- package/dist/fhe-airdrop/react/useEcdsaDomain.d.ts +41 -0
- package/dist/fhe-airdrop/react/useEffectiveDelegateToCompliance.d.ts +26 -0
- package/dist/fhe-airdrop/react/useEffectiveUpgradeable.d.ts +20 -0
- package/dist/fhe-airdrop/react/useEncryptCampaignAmounts.d.ts +59 -0
- package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +17 -12
- package/dist/fhe-airdrop/react/useFactoryFees.d.ts +28 -0
- package/dist/fhe-airdrop/react/useFactoryRegistry.d.ts +35 -0
- package/dist/fhe-airdrop/react/useFundAirdrop.d.ts +35 -0
- package/dist/fhe-airdrop/react/useGrantInstanceRoles.d.ts +35 -0
- package/dist/fhe-airdrop/react/useIsActiveDelegate.d.ts +29 -0
- package/dist/fhe-airdrop/react/useIsMerkleRootMutable.d.ts +21 -0
- package/dist/fhe-airdrop/react/useIsSignatureValid.d.ts +46 -0
- package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +22 -0
- package/dist/fhe-airdrop/react/useMerkleClaimAndUnwrap.d.ts +29 -0
- package/dist/fhe-airdrop/react/useMerkleRoot.d.ts +15 -0
- package/dist/fhe-airdrop/react/usePlanMerkleCampaign.d.ts +53 -0
- package/dist/fhe-airdrop/react/usePreflightClaim.d.ts +46 -0
- package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +51 -35
- package/dist/fhe-airdrop/react/useRescueERC20.d.ts +30 -0
- package/dist/fhe-airdrop/react/useRescueOtherConfidentialToken.d.ts +34 -0
- package/dist/fhe-airdrop/react/useRevokeComplianceDelegate.d.ts +37 -0
- package/dist/fhe-airdrop/react/useRotateMerkleRoot.d.ts +52 -0
- package/dist/fhe-airdrop/react/useSetMerkleRoot.d.ts +22 -0
- package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +32 -21
- package/dist/fhe-airdrop/react/useWithdrawConfidential.d.ts +23 -0
- package/dist/fhe-airdrop/react/useWithdrawGasFee.d.ts +37 -0
- package/dist/fhe-airdrop/roles.d.ts +147 -0
- package/dist/fhe-airdrop/types.d.ts +78 -63
- package/dist/fhe-disperse/index.cjs +70 -68
- package/dist/fhe-disperse/index.js +10 -8
- package/dist/fhe-disperse/react/index.cjs +94 -92
- package/dist/fhe-disperse/react/index.js +13 -11
- package/dist/fhe-vesting/advanced/index.cjs +10 -8
- package/dist/fhe-vesting/advanced/index.js +8 -6
- package/dist/fhe-vesting/advanced/react/index.cjs +16 -14
- package/dist/fhe-vesting/advanced/react/index.js +13 -11
- package/dist/fhe-vesting/index.cjs +74 -72
- package/dist/fhe-vesting/index.js +11 -9
- package/dist/fhe-vesting/react/index.cjs +228 -226
- package/dist/fhe-vesting/react/index.js +15 -13
- package/dist/index.cjs +100 -87
- package/dist/index.js +3 -2
- package/dist/testnet-faucet/index.cjs +57 -55
- package/dist/testnet-faucet/index.js +7 -5
- package/dist/testnet-faucet/react/index.cjs +55 -53
- package/dist/testnet-faucet/react/index.js +9 -7
- package/package.json +6 -2
- package/dist/chunk-CNP4L3GF.js +0 -105
- package/dist/chunk-KSDSXJ34.js +0 -41
- package/dist/chunk-LBWRFZR3.cjs +0 -1681
- package/dist/chunk-OL6SHN3D.cjs +0 -44
- package/dist/chunk-S2XD75JM.js +0 -1637
- package/dist/chunk-SPGSO5SO.cjs +0 -1644
- package/dist/chunk-UE5XK2SY.js +0 -1673
- package/dist/chunk-WO72UBQD.cjs +0 -109
- package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +0 -53
- package/dist/fhe-airdrop/advanced/react/usePredictAirdropAddress.d.ts +0 -49
- package/dist/fhe-airdrop/airdrop.d.ts +0 -317
- package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +0 -37
- package/dist/fhe-airdrop/react/useAirdropCanExtendClaimWindow.d.ts +0 -7
- package/dist/fhe-airdrop/react/useAirdropClaimTypehash.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropClaimedSignatures.d.ts +0 -16
- package/dist/fhe-airdrop/react/useAirdropDeploymentBlockNumber.d.ts +0 -6
- package/dist/fhe-airdrop/react/useAirdropDomainSeparator.d.ts +0 -8
- package/dist/fhe-airdrop/react/useAirdropEndTime.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropFactoryCustomFee.d.ts +0 -17
- package/dist/fhe-airdrop/react/useAirdropFactoryDefaultGasFee.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropFactoryDisableCustomFee.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropFactoryFeeCollector.d.ts +0 -11
- package/dist/fhe-airdrop/react/useAirdropFactoryInitCodeHash.d.ts +0 -17
- package/dist/fhe-airdrop/react/useAirdropFactorySetCustomFee.d.ts +0 -17
- package/dist/fhe-airdrop/react/useAirdropFactorySetDefaultGasFee.d.ts +0 -16
- package/dist/fhe-airdrop/react/useAirdropFactorySetFeeCollector.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropHasClaimEnded.d.ts +0 -7
- package/dist/fhe-airdrop/react/useAirdropHasClaimStarted.d.ts +0 -7
- package/dist/fhe-airdrop/react/useAirdropIsClaimWindowActive.d.ts +0 -9
- package/dist/fhe-airdrop/react/useAirdropIsPaused.d.ts +0 -8
- package/dist/fhe-airdrop/react/useAirdropIsSignatureClaimed.d.ts +0 -22
- package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +0 -51
- package/dist/fhe-airdrop/react/useAirdropStartTime.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropWithdrawGasFee.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropWithdrawOtherConfidentialToken.d.ts +0 -14
- package/dist/fhe-airdrop/react/useAirdropWithdrawOtherToken.d.ts +0 -14
- package/dist/fhe-airdrop/react/useClaim.d.ts +0 -39
- package/dist/fhe-airdrop/react/useConfidentialAirdropFactoryImplementation.d.ts +0 -11
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +0 -41
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +0 -48
- package/dist/fhe-airdrop/react/useCreateConfidentialAirdrop.d.ts +0 -29
- package/dist/fhe-airdrop/react/useCreateConfidentialAirdropAndGetAddress.d.ts +0 -31
- package/dist/fhe-airdrop/react/useDisableCustomFee.d.ts +0 -14
- package/dist/fhe-airdrop/react/useFactoryCustomFee.d.ts +0 -17
- package/dist/fhe-airdrop/react/useFactoryDefaultGasFee.d.ts +0 -10
- package/dist/fhe-airdrop/react/useFactoryFeeCollector.d.ts +0 -11
- package/dist/fhe-airdrop/react/useFactoryInitCodeHash.d.ts +0 -17
- package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +0 -33
- package/dist/fhe-airdrop/react/useSetCustomFee.d.ts +0 -16
- package/dist/fhe-airdrop/react/useSetDefaultGasFee.d.ts +0 -15
- package/dist/fhe-airdrop/react/useSetFeeCollector.d.ts +0 -14
- package/dist/fhe-airdrop/react/useSetPaused.d.ts +0 -14
- package/dist/fhe-airdrop/react/useWithdraw.d.ts +0 -12
- package/dist/fhe-airdrop/react/useWithdrawOtherConfidentialToken.d.ts +0 -13
- package/dist/fhe-airdrop/react/useWithdrawOtherToken.d.ts +0 -13
package/dist/fhe/index.cjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkKFRDLKMA_cjs = require('../chunk-KFRDLKMA.cjs');
|
|
4
|
+
var chunk3QHNYEQD_cjs = require('../chunk-3QHNYEQD.cjs');
|
|
5
|
+
var chunkFAXIIH5R_cjs = require('../chunk-FAXIIH5R.cjs');
|
|
6
6
|
var chunkFWHYQZ5E_cjs = require('../chunk-FWHYQZ5E.cjs');
|
|
7
|
-
var
|
|
8
|
-
|
|
7
|
+
var chunkJK4XMMKM_cjs = require('../chunk-JK4XMMKM.cjs');
|
|
8
|
+
require('../chunk-66IHPTOK.cjs');
|
|
9
|
+
var chunk67OV5CX2_cjs = require('../chunk-67OV5CX2.cjs');
|
|
9
10
|
var chunkVJKZWYYJ_cjs = require('../chunk-VJKZWYYJ.cjs');
|
|
10
11
|
var sdk = require('@zama-fhe/sdk');
|
|
11
12
|
|
|
@@ -217,18 +218,18 @@ var MOCK_ERC7984_MINT_ABI = [
|
|
|
217
218
|
var UINT64_MAX = (1n << 64n) - 1n;
|
|
218
219
|
async function mintMockERC7984(args) {
|
|
219
220
|
const { publicClient, walletClient, account, waitForReceipt = true, telemetry } = args;
|
|
220
|
-
const token =
|
|
221
|
-
const to =
|
|
221
|
+
const token = chunkJK4XMMKM_cjs.normaliseAddress(args.token);
|
|
222
|
+
const to = chunkJK4XMMKM_cjs.normaliseAddress(args.to);
|
|
222
223
|
return chunkVJKZWYYJ_cjs.withTelemetry(telemetry, "fhe.mintMockERC7984", async () => {
|
|
223
224
|
const fromAccount = account ?? walletClient.account;
|
|
224
225
|
if (!fromAccount) {
|
|
225
|
-
throw new
|
|
226
|
+
throw new chunk67OV5CX2_cjs.TokenOpsContractError(
|
|
226
227
|
"mintMockERC7984: no account available \u2014 pass `account` explicitly or attach an account to the walletClient",
|
|
227
228
|
{ contract: "ERC7984", call: "mint" }
|
|
228
229
|
);
|
|
229
230
|
}
|
|
230
231
|
if (args.amount < 0n || args.amount > UINT64_MAX) {
|
|
231
|
-
throw new
|
|
232
|
+
throw new chunk67OV5CX2_cjs.TokenOpsContractError(
|
|
232
233
|
`mintMockERC7984: amount ${args.amount} out of uint64 range [0, ${UINT64_MAX}]`,
|
|
233
234
|
{ contract: "ERC7984", call: "mint", amount: args.amount.toString() }
|
|
234
235
|
);
|
|
@@ -246,7 +247,7 @@ async function mintMockERC7984(args) {
|
|
|
246
247
|
chain: walletClient.chain
|
|
247
248
|
});
|
|
248
249
|
} catch (err) {
|
|
249
|
-
throw new
|
|
250
|
+
throw new chunk67OV5CX2_cjs.TokenOpsContractError(
|
|
250
251
|
`mintMockERC7984: writeContract failed (token=${token}, to=${to})`,
|
|
251
252
|
{
|
|
252
253
|
contract: "ERC7984",
|
|
@@ -263,7 +264,7 @@ async function mintMockERC7984(args) {
|
|
|
263
264
|
const receipt = await publicClient.waitForTransactionReceipt({ hash });
|
|
264
265
|
blockNumber = receipt.blockNumber;
|
|
265
266
|
} catch (err) {
|
|
266
|
-
throw new
|
|
267
|
+
throw new chunk67OV5CX2_cjs.TokenOpsContractError(`mintMockERC7984: receipt wait failed (tx=${hash})`, {
|
|
267
268
|
contract: "ERC7984",
|
|
268
269
|
call: "mint",
|
|
269
270
|
tx: hash,
|
|
@@ -275,7 +276,7 @@ async function mintMockERC7984(args) {
|
|
|
275
276
|
});
|
|
276
277
|
}
|
|
277
278
|
function createMockErc7984Client(args) {
|
|
278
|
-
const address =
|
|
279
|
+
const address = chunkJK4XMMKM_cjs.normaliseAddress(args.address);
|
|
279
280
|
const { publicClient, walletClient, telemetry } = args;
|
|
280
281
|
return {
|
|
281
282
|
address,
|
|
@@ -448,55 +449,55 @@ function createSepoliaEncryptorWeb(opts) {
|
|
|
448
449
|
|
|
449
450
|
Object.defineProperty(exports, "ERC7984_OPERATOR_MAX_DEADLINE", {
|
|
450
451
|
enumerable: true,
|
|
451
|
-
get: function () { return
|
|
452
|
+
get: function () { return chunkKFRDLKMA_cjs.ERC7984_OPERATOR_MAX_DEADLINE; }
|
|
452
453
|
});
|
|
453
454
|
Object.defineProperty(exports, "ERC7984_SET_OPERATOR_ABI", {
|
|
454
455
|
enumerable: true,
|
|
455
|
-
get: function () { return
|
|
456
|
+
get: function () { return chunkKFRDLKMA_cjs.ERC7984_SET_OPERATOR_ABI; }
|
|
456
457
|
});
|
|
457
458
|
Object.defineProperty(exports, "ensureOperator", {
|
|
458
459
|
enumerable: true,
|
|
459
|
-
get: function () { return
|
|
460
|
+
get: function () { return chunkKFRDLKMA_cjs.ensureOperator; }
|
|
460
461
|
});
|
|
461
462
|
Object.defineProperty(exports, "isOperator", {
|
|
462
463
|
enumerable: true,
|
|
463
|
-
get: function () { return
|
|
464
|
+
get: function () { return chunkKFRDLKMA_cjs.isOperator; }
|
|
464
465
|
});
|
|
465
466
|
Object.defineProperty(exports, "revokeOperator", {
|
|
466
467
|
enumerable: true,
|
|
467
|
-
get: function () { return
|
|
468
|
+
get: function () { return chunkKFRDLKMA_cjs.revokeOperator; }
|
|
468
469
|
});
|
|
469
470
|
Object.defineProperty(exports, "setOperator", {
|
|
470
471
|
enumerable: true,
|
|
471
|
-
get: function () { return
|
|
472
|
+
get: function () { return chunkKFRDLKMA_cjs.setOperator; }
|
|
472
473
|
});
|
|
473
474
|
Object.defineProperty(exports, "FHE_SPLIT_DENOMINATOR", {
|
|
474
475
|
enumerable: true,
|
|
475
|
-
get: function () { return
|
|
476
|
+
get: function () { return chunk3QHNYEQD_cjs.FHE_SPLIT_DENOMINATOR; }
|
|
476
477
|
});
|
|
477
478
|
Object.defineProperty(exports, "scaleRatio", {
|
|
478
479
|
enumerable: true,
|
|
479
|
-
get: function () { return
|
|
480
|
+
get: function () { return chunk3QHNYEQD_cjs.scaleRatio; }
|
|
480
481
|
});
|
|
481
482
|
Object.defineProperty(exports, "share", {
|
|
482
483
|
enumerable: true,
|
|
483
|
-
get: function () { return
|
|
484
|
+
get: function () { return chunk3QHNYEQD_cjs.share; }
|
|
484
485
|
});
|
|
485
486
|
Object.defineProperty(exports, "ACL_ALLOWED_EVENT", {
|
|
486
487
|
enumerable: true,
|
|
487
|
-
get: function () { return
|
|
488
|
+
get: function () { return chunkFAXIIH5R_cjs.ACL_ALLOWED_EVENT; }
|
|
488
489
|
});
|
|
489
490
|
Object.defineProperty(exports, "FHEVM_ACL_ADDRESS_BY_CHAIN", {
|
|
490
491
|
enumerable: true,
|
|
491
|
-
get: function () { return
|
|
492
|
+
get: function () { return chunkFAXIIH5R_cjs.FHEVM_ACL_ADDRESS_BY_CHAIN; }
|
|
492
493
|
});
|
|
493
494
|
Object.defineProperty(exports, "getFhevmAclAddress", {
|
|
494
495
|
enumerable: true,
|
|
495
|
-
get: function () { return
|
|
496
|
+
get: function () { return chunkFAXIIH5R_cjs.getFhevmAclAddress; }
|
|
496
497
|
});
|
|
497
498
|
Object.defineProperty(exports, "requireFhevmAclAddress", {
|
|
498
499
|
enumerable: true,
|
|
499
|
-
get: function () { return
|
|
500
|
+
get: function () { return chunkFAXIIH5R_cjs.requireFhevmAclAddress; }
|
|
500
501
|
});
|
|
501
502
|
Object.defineProperty(exports, "erc7984OperatorAbi", {
|
|
502
503
|
enumerable: true,
|
|
@@ -504,155 +505,155 @@ Object.defineProperty(exports, "erc7984OperatorAbi", {
|
|
|
504
505
|
});
|
|
505
506
|
Object.defineProperty(exports, "AccessDeniedError", {
|
|
506
507
|
enumerable: true,
|
|
507
|
-
get: function () { return
|
|
508
|
+
get: function () { return chunk67OV5CX2_cjs.AccessDeniedError; }
|
|
508
509
|
});
|
|
509
510
|
Object.defineProperty(exports, "AlreadyInitializedError", {
|
|
510
511
|
enumerable: true,
|
|
511
|
-
get: function () { return
|
|
512
|
+
get: function () { return chunk67OV5CX2_cjs.AlreadyInitializedError; }
|
|
512
513
|
});
|
|
513
514
|
Object.defineProperty(exports, "BatchTooLargeError", {
|
|
514
515
|
enumerable: true,
|
|
515
|
-
get: function () { return
|
|
516
|
+
get: function () { return chunk67OV5CX2_cjs.BatchTooLargeError; }
|
|
516
517
|
});
|
|
517
518
|
Object.defineProperty(exports, "ContractRevertError", {
|
|
518
519
|
enumerable: true,
|
|
519
|
-
get: function () { return
|
|
520
|
+
get: function () { return chunk67OV5CX2_cjs.ContractRevertError; }
|
|
520
521
|
});
|
|
521
522
|
Object.defineProperty(exports, "DecryptionFailedError", {
|
|
522
523
|
enumerable: true,
|
|
523
|
-
get: function () { return
|
|
524
|
+
get: function () { return chunk67OV5CX2_cjs.DecryptionFailedError; }
|
|
524
525
|
});
|
|
525
526
|
Object.defineProperty(exports, "DeploymentAddressUnavailableError", {
|
|
526
527
|
enumerable: true,
|
|
527
|
-
get: function () { return
|
|
528
|
+
get: function () { return chunk67OV5CX2_cjs.DeploymentAddressUnavailableError; }
|
|
528
529
|
});
|
|
529
530
|
Object.defineProperty(exports, "EncryptionFailedError", {
|
|
530
531
|
enumerable: true,
|
|
531
|
-
get: function () { return
|
|
532
|
+
get: function () { return chunk67OV5CX2_cjs.EncryptionFailedError; }
|
|
532
533
|
});
|
|
533
534
|
Object.defineProperty(exports, "FeatureDisabledError", {
|
|
534
535
|
enumerable: true,
|
|
535
|
-
get: function () { return
|
|
536
|
+
get: function () { return chunk67OV5CX2_cjs.FeatureDisabledError; }
|
|
536
537
|
});
|
|
537
538
|
Object.defineProperty(exports, "FheHandleNotAllowedError", {
|
|
538
539
|
enumerable: true,
|
|
539
|
-
get: function () { return
|
|
540
|
+
get: function () { return chunk67OV5CX2_cjs.FheHandleNotAllowedError; }
|
|
540
541
|
});
|
|
541
542
|
Object.defineProperty(exports, "InsufficientBalanceError", {
|
|
542
543
|
enumerable: true,
|
|
543
|
-
get: function () { return
|
|
544
|
+
get: function () { return chunk67OV5CX2_cjs.InsufficientBalanceError; }
|
|
544
545
|
});
|
|
545
546
|
Object.defineProperty(exports, "InsufficientFeeError", {
|
|
546
547
|
enumerable: true,
|
|
547
|
-
get: function () { return
|
|
548
|
+
get: function () { return chunk67OV5CX2_cjs.InsufficientFeeError; }
|
|
548
549
|
});
|
|
549
550
|
Object.defineProperty(exports, "InsufficientGasFundsError", {
|
|
550
551
|
enumerable: true,
|
|
551
|
-
get: function () { return
|
|
552
|
+
get: function () { return chunk67OV5CX2_cjs.InsufficientGasFundsError; }
|
|
552
553
|
});
|
|
553
554
|
Object.defineProperty(exports, "InvalidArgumentError", {
|
|
554
555
|
enumerable: true,
|
|
555
|
-
get: function () { return
|
|
556
|
+
get: function () { return chunk67OV5CX2_cjs.InvalidArgumentError; }
|
|
556
557
|
});
|
|
557
558
|
Object.defineProperty(exports, "InvalidSignatureError", {
|
|
558
559
|
enumerable: true,
|
|
559
|
-
get: function () { return
|
|
560
|
+
get: function () { return chunk67OV5CX2_cjs.InvalidSignatureError; }
|
|
560
561
|
});
|
|
561
562
|
Object.defineProperty(exports, "MissingAccountError", {
|
|
562
563
|
enumerable: true,
|
|
563
|
-
get: function () { return
|
|
564
|
+
get: function () { return chunk67OV5CX2_cjs.MissingAccountError; }
|
|
564
565
|
});
|
|
565
566
|
Object.defineProperty(exports, "MissingClientError", {
|
|
566
567
|
enumerable: true,
|
|
567
|
-
get: function () { return
|
|
568
|
+
get: function () { return chunk67OV5CX2_cjs.MissingClientError; }
|
|
568
569
|
});
|
|
569
570
|
Object.defineProperty(exports, "MissingEncryptorError", {
|
|
570
571
|
enumerable: true,
|
|
571
|
-
get: function () { return
|
|
572
|
+
get: function () { return chunk67OV5CX2_cjs.MissingEncryptorError; }
|
|
572
573
|
});
|
|
573
574
|
Object.defineProperty(exports, "MissingPublicClientError", {
|
|
574
575
|
enumerable: true,
|
|
575
|
-
get: function () { return
|
|
576
|
+
get: function () { return chunk67OV5CX2_cjs.MissingPublicClientError; }
|
|
576
577
|
});
|
|
577
578
|
Object.defineProperty(exports, "MissingWalletClientError", {
|
|
578
579
|
enumerable: true,
|
|
579
|
-
get: function () { return
|
|
580
|
+
get: function () { return chunk67OV5CX2_cjs.MissingWalletClientError; }
|
|
580
581
|
});
|
|
581
582
|
Object.defineProperty(exports, "NetworkError", {
|
|
582
583
|
enumerable: true,
|
|
583
|
-
get: function () { return
|
|
584
|
+
get: function () { return chunk67OV5CX2_cjs.NetworkError; }
|
|
584
585
|
});
|
|
585
586
|
Object.defineProperty(exports, "OperatorNotApprovedError", {
|
|
586
587
|
enumerable: true,
|
|
587
|
-
get: function () { return
|
|
588
|
+
get: function () { return chunk67OV5CX2_cjs.OperatorNotApprovedError; }
|
|
588
589
|
});
|
|
589
590
|
Object.defineProperty(exports, "PausedError", {
|
|
590
591
|
enumerable: true,
|
|
591
|
-
get: function () { return
|
|
592
|
+
get: function () { return chunk67OV5CX2_cjs.PausedError; }
|
|
592
593
|
});
|
|
593
594
|
Object.defineProperty(exports, "ReceiptEventAmbiguousError", {
|
|
594
595
|
enumerable: true,
|
|
595
|
-
get: function () { return
|
|
596
|
+
get: function () { return chunk67OV5CX2_cjs.ReceiptEventAmbiguousError; }
|
|
596
597
|
});
|
|
597
598
|
Object.defineProperty(exports, "ReceiptEventNotFoundError", {
|
|
598
599
|
enumerable: true,
|
|
599
|
-
get: function () { return
|
|
600
|
+
get: function () { return chunk67OV5CX2_cjs.ReceiptEventNotFoundError; }
|
|
600
601
|
});
|
|
601
602
|
Object.defineProperty(exports, "ReentrancyError", {
|
|
602
603
|
enumerable: true,
|
|
603
|
-
get: function () { return
|
|
604
|
+
get: function () { return chunk67OV5CX2_cjs.ReentrancyError; }
|
|
604
605
|
});
|
|
605
606
|
Object.defineProperty(exports, "RelayerUnreachableError", {
|
|
606
607
|
enumerable: true,
|
|
607
|
-
get: function () { return
|
|
608
|
+
get: function () { return chunk67OV5CX2_cjs.RelayerUnreachableError; }
|
|
608
609
|
});
|
|
609
610
|
Object.defineProperty(exports, "SigningFailedError", {
|
|
610
611
|
enumerable: true,
|
|
611
|
-
get: function () { return
|
|
612
|
+
get: function () { return chunk67OV5CX2_cjs.SigningFailedError; }
|
|
612
613
|
});
|
|
613
614
|
Object.defineProperty(exports, "TokenOpsContractError", {
|
|
614
615
|
enumerable: true,
|
|
615
|
-
get: function () { return
|
|
616
|
+
get: function () { return chunk67OV5CX2_cjs.TokenOpsContractError; }
|
|
616
617
|
});
|
|
617
618
|
Object.defineProperty(exports, "TokenOpsSdkError", {
|
|
618
619
|
enumerable: true,
|
|
619
|
-
get: function () { return
|
|
620
|
+
get: function () { return chunk67OV5CX2_cjs.TokenOpsSdkError; }
|
|
620
621
|
});
|
|
621
622
|
Object.defineProperty(exports, "TokenOpsValidationError", {
|
|
622
623
|
enumerable: true,
|
|
623
|
-
get: function () { return
|
|
624
|
+
get: function () { return chunk67OV5CX2_cjs.TokenOpsValidationError; }
|
|
624
625
|
});
|
|
625
626
|
Object.defineProperty(exports, "TransferFailedError", {
|
|
626
627
|
enumerable: true,
|
|
627
|
-
get: function () { return
|
|
628
|
+
get: function () { return chunk67OV5CX2_cjs.TransferFailedError; }
|
|
628
629
|
});
|
|
629
630
|
Object.defineProperty(exports, "UnknownWriteFailureError", {
|
|
630
631
|
enumerable: true,
|
|
631
|
-
get: function () { return
|
|
632
|
+
get: function () { return chunk67OV5CX2_cjs.UnknownWriteFailureError; }
|
|
632
633
|
});
|
|
633
634
|
Object.defineProperty(exports, "UnsupportedChainError", {
|
|
634
635
|
enumerable: true,
|
|
635
|
-
get: function () { return
|
|
636
|
+
get: function () { return chunk67OV5CX2_cjs.UnsupportedChainError; }
|
|
636
637
|
});
|
|
637
638
|
Object.defineProperty(exports, "UserDecryptNotAllowedError", {
|
|
638
639
|
enumerable: true,
|
|
639
|
-
get: function () { return
|
|
640
|
+
get: function () { return chunk67OV5CX2_cjs.UserDecryptNotAllowedError; }
|
|
640
641
|
});
|
|
641
642
|
Object.defineProperty(exports, "UserRejectedSignatureError", {
|
|
642
643
|
enumerable: true,
|
|
643
|
-
get: function () { return
|
|
644
|
+
get: function () { return chunk67OV5CX2_cjs.UserRejectedSignatureError; }
|
|
644
645
|
});
|
|
645
646
|
Object.defineProperty(exports, "WalletChainMismatchError", {
|
|
646
647
|
enumerable: true,
|
|
647
|
-
get: function () { return
|
|
648
|
+
get: function () { return chunk67OV5CX2_cjs.WalletChainMismatchError; }
|
|
648
649
|
});
|
|
649
650
|
Object.defineProperty(exports, "WalletRejectedError", {
|
|
650
651
|
enumerable: true,
|
|
651
|
-
get: function () { return
|
|
652
|
+
get: function () { return chunk67OV5CX2_cjs.WalletRejectedError; }
|
|
652
653
|
});
|
|
653
654
|
Object.defineProperty(exports, "isTokenOpsSdkError", {
|
|
654
655
|
enumerable: true,
|
|
655
|
-
get: function () { return
|
|
656
|
+
get: function () { return chunk67OV5CX2_cjs.isTokenOpsSdkError; }
|
|
656
657
|
});
|
|
657
658
|
exports.MAINNET_CHAIN_ID = MAINNET_CHAIN_ID;
|
|
658
659
|
exports.MOCK_ERC7984_MINT_ABI = MOCK_ERC7984_MINT_ABI;
|
package/dist/fhe/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export { ERC7984_OPERATOR_MAX_DEADLINE, ERC7984_SET_OPERATOR_ABI, ensureOperator, isOperator, revokeOperator, setOperator } from '../chunk-
|
|
2
|
-
export { FHE_SPLIT_DENOMINATOR, scaleRatio, share } from '../chunk-
|
|
3
|
-
export { ACL_ALLOWED_EVENT, FHEVM_ACL_ADDRESS_BY_CHAIN, getFhevmAclAddress, requireFhevmAclAddress } from '../chunk-
|
|
1
|
+
export { ERC7984_OPERATOR_MAX_DEADLINE, ERC7984_SET_OPERATOR_ABI, ensureOperator, isOperator, revokeOperator, setOperator } from '../chunk-4TSDNZQ3.js';
|
|
2
|
+
export { FHE_SPLIT_DENOMINATOR, scaleRatio, share } from '../chunk-6GNR22OV.js';
|
|
3
|
+
export { ACL_ALLOWED_EVENT, FHEVM_ACL_ADDRESS_BY_CHAIN, getFhevmAclAddress, requireFhevmAclAddress } from '../chunk-ZWXJTBZO.js';
|
|
4
4
|
export { erc7984OperatorAbi } from '../chunk-7VELUOMI.js';
|
|
5
|
-
import { normaliseAddress } from '../chunk-
|
|
6
|
-
import
|
|
7
|
-
|
|
5
|
+
import { normaliseAddress } from '../chunk-ZA673I3O.js';
|
|
6
|
+
import '../chunk-KWFFIJYX.js';
|
|
7
|
+
import { TokenOpsContractError } from '../chunk-QBJ7O2B4.js';
|
|
8
|
+
export { AccessDeniedError, AlreadyInitializedError, BatchTooLargeError, ContractRevertError, DecryptionFailedError, DeploymentAddressUnavailableError, EncryptionFailedError, FeatureDisabledError, FheHandleNotAllowedError, InsufficientBalanceError, InsufficientFeeError, InsufficientGasFundsError, InvalidArgumentError, InvalidSignatureError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, NetworkError, OperatorNotApprovedError, PausedError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, ReentrancyError, RelayerUnreachableError, SigningFailedError, TokenOpsContractError, TokenOpsSdkError, TokenOpsValidationError, TransferFailedError, UnknownWriteFailureError, UnsupportedChainError, UserDecryptNotAllowedError, UserRejectedSignatureError, WalletChainMismatchError, WalletRejectedError, isTokenOpsSdkError } from '../chunk-QBJ7O2B4.js';
|
|
8
9
|
import { withTelemetry } from '../chunk-Q2GP5UDC.js';
|
|
9
10
|
import { RelayerWeb, MainnetConfig, SepoliaConfig } from '@zama-fhe/sdk';
|
|
10
11
|
|
package/dist/fhe/operators.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { type SdkTelemetry } from "../core/telemetry.js";
|
|
|
14
14
|
*
|
|
15
15
|
* `uint48` upper bound (`2**48 - 1 ≈ 8.9e+14`) is comfortably past year 9999
|
|
16
16
|
* in unix seconds, so a "far-future" deadline is structurally safe.
|
|
17
|
+
* @public
|
|
17
18
|
*/
|
|
18
19
|
export declare const ERC7984_SET_OPERATOR_ABI: readonly [{
|
|
19
20
|
readonly type: "function";
|
|
@@ -35,8 +36,10 @@ export declare const ERC7984_SET_OPERATOR_ABI: readonly [{
|
|
|
35
36
|
* about expiry — typical for local-chain dev loops and end-to-end fixture
|
|
36
37
|
* setup. For production flows, scope the deadline to the expected operation
|
|
37
38
|
* window (e.g. `Date.now()/1000 + 3600`).
|
|
39
|
+
* @public
|
|
38
40
|
*/
|
|
39
41
|
export declare const ERC7984_OPERATOR_MAX_DEADLINE: bigint;
|
|
42
|
+
/** @public */
|
|
40
43
|
export interface SetOperatorArgs {
|
|
41
44
|
/** Read-only viem client for receipt waiting. */
|
|
42
45
|
publicClient: PublicClient;
|
|
@@ -113,11 +116,12 @@ export interface SetOperatorArgs {
|
|
|
113
116
|
* // deadline defaults to ERC7984_OPERATOR_MAX_DEADLINE (forever).
|
|
114
117
|
* });
|
|
115
118
|
*
|
|
116
|
-
* // Now safe to call manager.createVesting / factory.
|
|
119
|
+
* // Now safe to call manager.createVesting / factory.fundAirdrop / etc.
|
|
117
120
|
* ```
|
|
118
121
|
*
|
|
119
122
|
* @throws {@link TokenOpsContractError} if the writeContract or receipt-wait
|
|
120
123
|
* step throws. The original viem error is attached as the cause.
|
|
124
|
+
* @public
|
|
121
125
|
*/
|
|
122
126
|
export declare function setOperator(args: SetOperatorArgs): Promise<Hex>;
|
|
123
127
|
/**
|
|
@@ -125,6 +129,7 @@ export declare function setOperator(args: SetOperatorArgs): Promise<Hex>;
|
|
|
125
129
|
* minus the `deadline` field — revoke is a fixed `until=0` call that cannot
|
|
126
130
|
* accept a non-zero deadline (the ERC-7984 contract treats `0` as the revoke
|
|
127
131
|
* convention; any non-zero `until` would be a re-grant, not a revoke).
|
|
132
|
+
* @public
|
|
128
133
|
*/
|
|
129
134
|
export interface RevokeOperatorArgs {
|
|
130
135
|
/** Read-only viem client for receipt waiting. */
|
|
@@ -186,9 +191,14 @@ export interface RevokeOperatorArgs {
|
|
|
186
191
|
*
|
|
187
192
|
* @throws {@link TokenOpsContractError} if the writeContract or receipt-wait
|
|
188
193
|
* step throws. The original viem error is attached as the cause.
|
|
194
|
+
* @public
|
|
189
195
|
*/
|
|
190
196
|
export declare function revokeOperator(args: RevokeOperatorArgs): Promise<Hex>;
|
|
191
|
-
/**
|
|
197
|
+
/**
|
|
198
|
+
* Arguments for {@link isOperator}. Read-only — no wallet required.
|
|
199
|
+
*
|
|
200
|
+
* @public
|
|
201
|
+
*/
|
|
192
202
|
export interface IsOperatorArgs {
|
|
193
203
|
/** Read-only viem client the `isOperator` view call goes through. */
|
|
194
204
|
publicClient: PublicClient;
|
|
@@ -236,6 +246,7 @@ export interface IsOperatorArgs {
|
|
|
236
246
|
* @throws {@link TokenOpsContractError} if the read call itself fails (RPC
|
|
237
247
|
* error, non-ERC-7984 token). The original viem error is attached as the
|
|
238
248
|
* cause.
|
|
249
|
+
* @public
|
|
239
250
|
*/
|
|
240
251
|
export declare function isOperator(args: IsOperatorArgs): Promise<boolean>;
|
|
241
252
|
/**
|
|
@@ -245,6 +256,7 @@ export declare function isOperator(args: IsOperatorArgs): Promise<boolean>;
|
|
|
245
256
|
* grant must be an explicit caller decision — the SDK refuses to default a
|
|
246
257
|
* security-sensitive approval window (a silent
|
|
247
258
|
* {@link ERC7984_OPERATOR_MAX_DEADLINE} would grant "forever").
|
|
259
|
+
* @public
|
|
248
260
|
*/
|
|
249
261
|
export interface EnsureOperatorArgs {
|
|
250
262
|
/** Read-only viem client for the `isOperator` pre-check + receipt waiting. */
|
|
@@ -277,7 +289,11 @@ export interface EnsureOperatorArgs {
|
|
|
277
289
|
/** Optional telemetry sink — span emits as `fhe.ensureOperator`. */
|
|
278
290
|
telemetry?: SdkTelemetry;
|
|
279
291
|
}
|
|
280
|
-
/**
|
|
292
|
+
/**
|
|
293
|
+
* Result of {@link ensureOperator}.
|
|
294
|
+
*
|
|
295
|
+
* @public
|
|
296
|
+
*/
|
|
281
297
|
export interface EnsureOperatorResult {
|
|
282
298
|
/**
|
|
283
299
|
* `true` when the authorization was already in place and no transaction
|
|
@@ -297,7 +313,7 @@ export interface EnsureOperatorResult {
|
|
|
297
313
|
*
|
|
298
314
|
* This is the recommended pre-step before any flow that pulls tokens from
|
|
299
315
|
* the caller's balance (`createVesting` / `batchCreateVesting`,
|
|
300
|
-
* `
|
|
316
|
+
* `fundAirdrop` / `createAndFund{Ecdsa,Merkle}Airdrop`, disperse
|
|
301
317
|
* registration) — skipping it fails with {@link OperatorNotApprovedError},
|
|
302
318
|
* the SDK's mapping of the on-chain `ERC7984UnauthorizedSpender` revert,
|
|
303
319
|
* whose message is the canonical {@link OPERATOR_NOT_APPROVED_REMEDIATION}
|
|
@@ -320,11 +336,12 @@ export interface EnsureOperatorResult {
|
|
|
320
336
|
* spender: manager,
|
|
321
337
|
* deadline: oneHour,
|
|
322
338
|
* });
|
|
323
|
-
* // Now safe to call manager.createVesting / factory.
|
|
339
|
+
* // Now safe to call manager.createVesting / factory.fundAirdrop / etc.
|
|
324
340
|
* ```
|
|
325
341
|
*
|
|
326
342
|
* @throws {@link TokenOpsContractError} if no holder account can be
|
|
327
343
|
* resolved, if `deadline` is outside `(0, 2**48 - 1]`, or if the
|
|
328
344
|
* read/write/receipt step fails.
|
|
345
|
+
* @public
|
|
329
346
|
*/
|
|
330
347
|
export declare function ensureOperator(args: EnsureOperatorArgs): Promise<EnsureOperatorResult>;
|
package/dist/fhe/react/index.cjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk7AFPOE7N_cjs = require('../../chunk-7AFPOE7N.cjs');
|
|
4
4
|
require('../../chunk-ZQUE2B3Q.cjs');
|
|
5
|
-
require('../../chunk-
|
|
5
|
+
require('../../chunk-KFRDLKMA.cjs');
|
|
6
6
|
require('../../chunk-FWHYQZ5E.cjs');
|
|
7
|
-
require('../../chunk-
|
|
8
|
-
|
|
7
|
+
require('../../chunk-JK4XMMKM.cjs');
|
|
8
|
+
require('../../chunk-66IHPTOK.cjs');
|
|
9
|
+
var chunk67OV5CX2_cjs = require('../../chunk-67OV5CX2.cjs');
|
|
9
10
|
require('../../chunk-VJKZWYYJ.cjs');
|
|
10
11
|
var react = require('react');
|
|
11
12
|
|
|
@@ -40,7 +41,7 @@ function useDecryptedHandle(opts) {
|
|
|
40
41
|
setState({
|
|
41
42
|
status: "error",
|
|
42
43
|
value: void 0,
|
|
43
|
-
error: new
|
|
44
|
+
error: new chunk67OV5CX2_cjs.TokenOpsValidationError(
|
|
44
45
|
"useDecryptedHandle: no `userDecryptor` resolved \u2014 pass `userDecryptor: () => useZamaSDK().relayer` (or an eager RelayerSDK / MockFhevmInstance).",
|
|
45
46
|
{ method: "useDecryptedHandle" }
|
|
46
47
|
)
|
|
@@ -57,7 +58,7 @@ function useDecryptedHandle(opts) {
|
|
|
57
58
|
});
|
|
58
59
|
const plain = result[handleStr];
|
|
59
60
|
if (plain === void 0) {
|
|
60
|
-
throw new
|
|
61
|
+
throw new chunk67OV5CX2_cjs.TokenOpsValidationError(
|
|
61
62
|
`useDecryptedHandle: relayer returned no value for handle ${handleStr} on contract ${contractStr} \u2014 check ACL grant + (handle, contractAddress, userAddress) triple`,
|
|
62
63
|
{ method: "useDecryptedHandle", contractAddress: contractStr }
|
|
63
64
|
);
|
|
@@ -90,26 +91,26 @@ function serializableSlice(v) {
|
|
|
90
91
|
|
|
91
92
|
Object.defineProperty(exports, "useEnsureOperator", {
|
|
92
93
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunk7AFPOE7N_cjs.useEnsureOperator; }
|
|
94
95
|
});
|
|
95
96
|
Object.defineProperty(exports, "useIsOperator", {
|
|
96
97
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunk7AFPOE7N_cjs.useIsOperator; }
|
|
98
99
|
});
|
|
99
100
|
Object.defineProperty(exports, "TokenOpsContractError", {
|
|
100
101
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunk67OV5CX2_cjs.TokenOpsContractError; }
|
|
102
103
|
});
|
|
103
104
|
Object.defineProperty(exports, "TokenOpsSdkError", {
|
|
104
105
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunk67OV5CX2_cjs.TokenOpsSdkError; }
|
|
106
107
|
});
|
|
107
108
|
Object.defineProperty(exports, "TokenOpsValidationError", {
|
|
108
109
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunk67OV5CX2_cjs.TokenOpsValidationError; }
|
|
110
111
|
});
|
|
111
112
|
Object.defineProperty(exports, "isTokenOpsSdkError", {
|
|
112
113
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunk67OV5CX2_cjs.isTokenOpsSdkError; }
|
|
114
115
|
});
|
|
115
116
|
exports.useDecryptedHandle = useDecryptedHandle;
|
package/dist/fhe/react/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export { useEnsureOperator, useIsOperator } from '../../chunk-
|
|
1
|
+
export { useEnsureOperator, useIsOperator } from '../../chunk-AXIPOR3C.js';
|
|
2
2
|
import '../../chunk-FT4LNBOS.js';
|
|
3
|
-
import '../../chunk-
|
|
3
|
+
import '../../chunk-4TSDNZQ3.js';
|
|
4
4
|
import '../../chunk-7VELUOMI.js';
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import
|
|
7
|
-
|
|
5
|
+
import '../../chunk-ZA673I3O.js';
|
|
6
|
+
import '../../chunk-KWFFIJYX.js';
|
|
7
|
+
import { TokenOpsValidationError } from '../../chunk-QBJ7O2B4.js';
|
|
8
|
+
export { TokenOpsContractError, TokenOpsSdkError, TokenOpsValidationError, isTokenOpsSdkError } from '../../chunk-QBJ7O2B4.js';
|
|
8
9
|
import '../../chunk-Q2GP5UDC.js';
|
|
9
10
|
import { useState, useRef, useEffect } from 'react';
|
|
10
11
|
|
package/dist/fhe/types.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type { Hex } from "viem";
|
|
|
13
13
|
* The current SDK only produces uint64 ciphertexts. If a future version
|
|
14
14
|
* adds encryption helpers for other widths (e.g. `encryptUint128`), this
|
|
15
15
|
* type may be specialised; existing uint64 usage will keep type-checking.
|
|
16
|
+
* @public
|
|
16
17
|
*/
|
|
17
18
|
export interface EncryptedInput {
|
|
18
19
|
handle: Hex;
|
|
@@ -24,6 +25,7 @@ export interface EncryptedInput {
|
|
|
24
25
|
* encryptor returns from a batched `encrypt({ values: [...] })` call.
|
|
25
26
|
*
|
|
26
27
|
* `handles[i]` corresponds to the i-th plaintext value passed in.
|
|
28
|
+
* @public
|
|
27
29
|
*/
|
|
28
30
|
export interface EncryptedInputs {
|
|
29
31
|
handles: Hex[];
|
|
@@ -31,12 +33,13 @@ export interface EncryptedInputs {
|
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* Return shape for SDK methods that perform an on-chain encrypted-view tx —
|
|
34
|
-
* the contract emits `FHE.allow(handle, msg.sender)
|
|
36
|
+
* the contract emits `FHE.allow(handle, grantee)` (usually `msg.sender`) and the SDK extracts
|
|
35
37
|
* `handle` from the receipt's ACL `Allowed` event.
|
|
36
38
|
*
|
|
37
|
-
* Pass `handle` to the Zama relayer's `userDecrypt` to obtain the plaintext.
|
|
39
|
+
* Pass `handle` to the Zama relayer's `userDecrypt` to obtain the plaintext — AS THE GRANTEE. Most entrypoints grant the caller, but not all: `MerkleAirdropClient.getClaimAmount` grants the entry's `account`, so a third-party submitter receives a valid handle it is not authorised to read.
|
|
38
40
|
* `hash` is the tx that committed the persistent ACL grant — surface it if
|
|
39
41
|
* your UI needs to show the receipt.
|
|
42
|
+
* @public
|
|
40
43
|
*/
|
|
41
44
|
export interface EncryptedViewResult {
|
|
42
45
|
handle: Hex;
|
|
@@ -48,15 +51,18 @@ export interface EncryptedViewResult {
|
|
|
48
51
|
* match the rest of the SDK or the on-chain calldata layout (the contracts
|
|
49
52
|
* accept `bytes inputProof`). This alias points at the corrected shape and
|
|
50
53
|
* will be removed in the next major.
|
|
54
|
+
* @public
|
|
51
55
|
*/
|
|
52
56
|
export type EncryptedInput64 = EncryptedInput;
|
|
53
57
|
/**
|
|
54
58
|
* @deprecated Use `Hex` from `viem` directly. This alias added no narrowing
|
|
55
59
|
* beyond `Hex` and will be removed in the next major.
|
|
60
|
+
* @public
|
|
56
61
|
*/
|
|
57
62
|
export type EncryptedHandle = Hex;
|
|
58
63
|
/**
|
|
59
64
|
* @deprecated Use `Hex` from `viem` directly. This alias added no narrowing
|
|
60
65
|
* beyond `Hex` and will be removed in the next major.
|
|
66
|
+
* @public
|
|
61
67
|
*/
|
|
62
68
|
export type ExternalInputProof = Hex;
|