@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
|
@@ -1,457 +1,1147 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import '../../chunk-
|
|
8
|
-
|
|
9
|
-
import '../../chunk-
|
|
10
|
-
import '../../chunk-
|
|
11
|
-
import '../../chunk-
|
|
12
|
-
import '../../chunk-
|
|
13
|
-
import
|
|
14
|
-
|
|
1
|
+
import { grantInstanceRoles, buildMerkleCampaign, encryptCampaignAmounts, planMerkleCampaign, rotateMerkleRoot } from '../../chunk-GADGBQJO.js';
|
|
2
|
+
export { buildMerkleCampaign, buildMerkleTree, encryptCampaignAmounts, grantInstanceRoles, leafOf, planInstanceRoleSplit, planMerkleCampaign, rotateMerkleRoot, validateCampaignRecipients } from '../../chunk-GADGBQJO.js';
|
|
3
|
+
import { useMemoAirdropBaseClient, airdropQueryKey, useMemoMerkleAirdropClient, useMemoAirdropFactoryClient, airdropKeys, useMemoEcdsaAirdropClient, useMemoComplianceManagerClient, AIRDROP_FN, airdropQueryKeyPrefix } from '../../chunk-EYDA6Q6C.js';
|
|
4
|
+
export { airdropQueryKey, airdropQueryKeyPrefix } from '../../chunk-EYDA6Q6C.js';
|
|
5
|
+
import { resolveEncryptor, signClaimAuthorization } from '../../chunk-X7WBPCEU.js';
|
|
6
|
+
export { encryptUint64, encryptUint64Batch, resolveEncryptor, signClaimAuthorization } from '../../chunk-X7WBPCEU.js';
|
|
7
|
+
import { preflightClaim, preflightCreate } from '../../chunk-VW356KR3.js';
|
|
8
|
+
export { AlreadyClaimedError, ClaimNotStartedError, ClaimWindowClosedError, DedupIdConsumedError, FeeCollectorSelfAdministeredError, MerkleUupsUnsupportedError, NonStockWrapperError, PredictionDriftError, SaltCollisionError, SignatureExpiredError, UnauthorizedRedirectError, UpgradeabilityNotAllowedError, preflightClaim, preflightCreate } from '../../chunk-VW356KR3.js';
|
|
9
|
+
import '../../chunk-ZWXJTBZO.js';
|
|
10
|
+
import '../../chunk-NWFMBLSQ.js';
|
|
11
|
+
import '../../chunk-4RAAATVY.js';
|
|
12
|
+
import '../../chunk-A4DCEE33.js';
|
|
13
|
+
import '../../chunk-ZA673I3O.js';
|
|
14
|
+
import '../../chunk-KWFFIJYX.js';
|
|
15
|
+
import { MissingClientError, MissingWalletClientError } from '../../chunk-QBJ7O2B4.js';
|
|
16
|
+
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, TokenOpsSdkError, TransferFailedError, UnknownWriteFailureError, UnsupportedChainError, UserDecryptNotAllowedError, UserRejectedSignatureError, WalletChainMismatchError, WalletRejectedError, isTokenOpsSdkError } from '../../chunk-QBJ7O2B4.js';
|
|
15
17
|
import '../../chunk-Q2GP5UDC.js';
|
|
16
|
-
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
17
|
-
import {
|
|
18
|
+
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
19
|
+
import { useRef } from 'react';
|
|
18
20
|
|
|
19
|
-
function
|
|
20
|
-
const { client, chainId
|
|
21
|
+
function useAirdropToken(args) {
|
|
22
|
+
const { client, chainId } = useMemoAirdropBaseClient(args);
|
|
21
23
|
return useQuery({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
...args.query,
|
|
25
|
+
queryKey: airdropQueryKey({ chainId, address: args.address, fn: "token", args: [] }),
|
|
26
|
+
queryFn: () => client.token(),
|
|
27
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function useAirdropWindow(args) {
|
|
31
|
+
const { client, chainId } = useMemoAirdropBaseClient(args);
|
|
32
|
+
return useQuery({
|
|
33
|
+
...args.query,
|
|
34
|
+
queryKey: airdropQueryKey({ chainId, address: args.address, fn: "window", args: [] }),
|
|
35
|
+
queryFn: async () => {
|
|
36
|
+
const [startTime, endTime, hasStarted, hasEnded, isActive] = await Promise.all([
|
|
37
|
+
client.startTime(),
|
|
38
|
+
client.endTime(),
|
|
39
|
+
client.hasClaimStarted(),
|
|
40
|
+
client.hasClaimEnded(),
|
|
41
|
+
client.isClaimWindowActive()
|
|
42
|
+
]);
|
|
43
|
+
return { startTime, endTime, hasStarted, hasEnded, isActive };
|
|
44
|
+
},
|
|
45
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function useAirdropPaused(args) {
|
|
49
|
+
const { client, chainId } = useMemoAirdropBaseClient(args);
|
|
50
|
+
return useQuery({
|
|
51
|
+
...args.query,
|
|
52
|
+
queryKey: airdropQueryKey({ chainId, address: args.address, fn: "paused", args: [] }),
|
|
53
|
+
queryFn: () => client.paused(),
|
|
54
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function useAirdropGasFee(args) {
|
|
58
|
+
const { client, chainId } = useMemoAirdropBaseClient(args);
|
|
59
|
+
return useQuery({
|
|
60
|
+
...args.query,
|
|
61
|
+
queryKey: airdropQueryKey({ chainId, address: args.address, fn: "gasFee", args: [] }),
|
|
62
|
+
queryFn: () => client.gasFee(),
|
|
63
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function useAirdropHasRole(args) {
|
|
67
|
+
const { role, holder, ...base } = args;
|
|
68
|
+
const { client, chainId } = useMemoAirdropBaseClient(base);
|
|
69
|
+
return useQuery({
|
|
70
|
+
...args.query,
|
|
71
|
+
queryKey: airdropQueryKey({
|
|
72
|
+
chainId,
|
|
73
|
+
address: args.address,
|
|
74
|
+
fn: "hasRole",
|
|
75
|
+
args: [role, holder]
|
|
76
|
+
}),
|
|
77
|
+
queryFn: () => client.hasRole({ role, holder }),
|
|
78
|
+
enabled: Boolean(client && role && holder && (args.query?.enabled ?? true))
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function useMerkleRoot(args) {
|
|
82
|
+
const { client, chainId } = useMemoMerkleAirdropClient(args);
|
|
83
|
+
return useQuery({
|
|
84
|
+
...args.query,
|
|
85
|
+
queryKey: airdropQueryKey({ chainId, address: args.address, fn: "merkleRoot", args: [] }),
|
|
86
|
+
queryFn: () => client.merkleRoot(),
|
|
87
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function useClaimedAmount(args) {
|
|
91
|
+
const { account, ...base } = args;
|
|
92
|
+
const { client, chainId } = useMemoMerkleAirdropClient(base);
|
|
93
|
+
return useQuery({
|
|
94
|
+
...args.query,
|
|
95
|
+
queryKey: airdropQueryKey({
|
|
96
|
+
chainId,
|
|
97
|
+
address: args.address,
|
|
98
|
+
fn: "getClaimedAmount",
|
|
99
|
+
args: [account]
|
|
100
|
+
}),
|
|
101
|
+
queryFn: () => client.getClaimedAmount(account),
|
|
102
|
+
enabled: Boolean(client && account && (args.query?.enabled ?? true))
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function useComplianceManager(args) {
|
|
106
|
+
const { client, chainId } = useMemoAirdropBaseClient(args);
|
|
107
|
+
return useQuery({
|
|
108
|
+
...args.query,
|
|
109
|
+
queryKey: airdropQueryKey({
|
|
110
|
+
chainId,
|
|
111
|
+
address: args.address,
|
|
112
|
+
fn: "complianceManager",
|
|
113
|
+
args: []
|
|
114
|
+
}),
|
|
115
|
+
queryFn: () => client.complianceManager(),
|
|
116
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function useFactoryFees(args = {}) {
|
|
120
|
+
const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(args);
|
|
121
|
+
return useQuery({
|
|
122
|
+
...args.query,
|
|
123
|
+
queryKey: airdropQueryKey({ chainId, address: resolvedAddress, fn: "fees", args: [] }),
|
|
124
|
+
queryFn: async () => {
|
|
125
|
+
const [feeCollector, defaultGasFee] = await Promise.all([
|
|
126
|
+
client.feeCollector(),
|
|
127
|
+
client.defaultGasFee()
|
|
128
|
+
]);
|
|
129
|
+
return { feeCollector, defaultGasFee };
|
|
130
|
+
},
|
|
131
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function useFactoryRegistry(args = {}) {
|
|
135
|
+
const { offset = 0n, limit = 50n, ...base } = args;
|
|
136
|
+
const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
|
|
137
|
+
return useQuery({
|
|
138
|
+
...args.query,
|
|
139
|
+
queryKey: airdropQueryKey({
|
|
140
|
+
chainId,
|
|
141
|
+
address: resolvedAddress,
|
|
142
|
+
fn: "registry",
|
|
143
|
+
args: [offset, limit]
|
|
144
|
+
}),
|
|
145
|
+
queryFn: async () => {
|
|
146
|
+
const [count, items] = await Promise.all([
|
|
147
|
+
client.airdropCount(),
|
|
148
|
+
client.airdrops(offset, limit)
|
|
149
|
+
]);
|
|
150
|
+
return { count, items };
|
|
151
|
+
},
|
|
152
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function useEffectiveUpgradeable(args = {}) {
|
|
156
|
+
const { creator, ...base } = args;
|
|
157
|
+
const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
|
|
158
|
+
return useQuery({
|
|
159
|
+
...args.query,
|
|
160
|
+
queryKey: airdropQueryKey({
|
|
161
|
+
chainId,
|
|
162
|
+
address: resolvedAddress,
|
|
163
|
+
fn: "effectiveUpgradeable",
|
|
164
|
+
args: [creator]
|
|
165
|
+
}),
|
|
166
|
+
queryFn: () => client.effectiveUpgradeable(creator),
|
|
167
|
+
enabled: Boolean(client && creator && (args.query?.enabled ?? true))
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function useAirdropConfig(args) {
|
|
171
|
+
const { client, chainId } = useMemoAirdropBaseClient(args);
|
|
172
|
+
return useQuery({
|
|
173
|
+
staleTime: Infinity,
|
|
174
|
+
...args.query,
|
|
175
|
+
queryKey: airdropKeys.config({ chainId, address: args.address }),
|
|
176
|
+
queryFn: async () => {
|
|
177
|
+
const [token, airdropType, unwrappable, complianceManager, gasFee] = await Promise.all([
|
|
178
|
+
client.token(),
|
|
179
|
+
client.airdropType(),
|
|
180
|
+
client.unwrappable(),
|
|
181
|
+
client.complianceManager(),
|
|
182
|
+
client.gasFee()
|
|
183
|
+
]);
|
|
184
|
+
return {
|
|
185
|
+
token,
|
|
186
|
+
airdropType,
|
|
187
|
+
variant: airdropType === 1 ? "merkle" : "ecdsa",
|
|
188
|
+
unwrappable,
|
|
189
|
+
complianceManager,
|
|
190
|
+
gasFee
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
function useAirdropDeploymentMode(args) {
|
|
197
|
+
const { client, chainId } = useMemoAirdropBaseClient(args);
|
|
198
|
+
return useQuery({
|
|
199
|
+
staleTime: Infinity,
|
|
200
|
+
...args.query,
|
|
201
|
+
queryKey: airdropQueryKey({
|
|
202
|
+
chainId,
|
|
203
|
+
address: args.address,
|
|
204
|
+
fn: "deploymentMode",
|
|
205
|
+
args: []
|
|
206
|
+
}),
|
|
207
|
+
queryFn: () => client.deploymentMode(),
|
|
208
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function useAirdropRoleAdmin(args) {
|
|
212
|
+
const { role, ...base } = args;
|
|
213
|
+
const { client, chainId } = useMemoAirdropBaseClient(base);
|
|
214
|
+
return useQuery({
|
|
215
|
+
// A default, not a lock: `query.staleTime` still wins.
|
|
216
|
+
staleTime: Infinity,
|
|
217
|
+
...args.query,
|
|
218
|
+
queryKey: airdropQueryKey({
|
|
219
|
+
chainId,
|
|
220
|
+
address: args.address,
|
|
221
|
+
fn: "getRoleAdmin",
|
|
222
|
+
args: [role]
|
|
223
|
+
}),
|
|
224
|
+
queryFn: () => client.getRoleAdmin(role),
|
|
225
|
+
enabled: Boolean(client && role && (args.query?.enabled ?? true))
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function useAirdropRoleConstants(args) {
|
|
229
|
+
const { variant, dedupMode, ...base } = args;
|
|
230
|
+
const { client, chainId } = useMemoAirdropBaseClient(base);
|
|
231
|
+
const { client: merkleClient } = useMemoMerkleAirdropClient(base);
|
|
232
|
+
const { client: ecdsaClient } = useMemoEcdsaAirdropClient({
|
|
233
|
+
...base,
|
|
234
|
+
dedupMode: dedupMode ?? "none"
|
|
235
|
+
});
|
|
236
|
+
return useQuery({
|
|
237
|
+
// A default, not a lock: `query.staleTime` still wins if a consumer wants refetching.
|
|
238
|
+
staleTime: Infinity,
|
|
239
|
+
...args.query,
|
|
240
|
+
// `variant` is in the key because it changes the SHAPE of the result -
|
|
241
|
+
// the merkle and ecdsa responses must not share a cache slot.
|
|
242
|
+
queryKey: airdropQueryKey({
|
|
243
|
+
chainId,
|
|
244
|
+
address: args.address,
|
|
245
|
+
fn: "roleConstants",
|
|
246
|
+
args: [variant]
|
|
247
|
+
}),
|
|
248
|
+
queryFn: async () => {
|
|
249
|
+
const [
|
|
250
|
+
PAUSER_ROLE,
|
|
251
|
+
WINDOW_ADMIN_ROLE,
|
|
252
|
+
TREASURY_ROLE,
|
|
253
|
+
RESCUER_ROLE,
|
|
254
|
+
FEE_COLLECTOR_ROLE,
|
|
255
|
+
UPGRADER_ROLE,
|
|
256
|
+
DISCLOSURE_ADMIN_ROLE,
|
|
257
|
+
DEFAULT_ADMIN_ROLE,
|
|
258
|
+
variantRole
|
|
259
|
+
] = await Promise.all([
|
|
260
|
+
client.PAUSER_ROLE(),
|
|
261
|
+
client.WINDOW_ADMIN_ROLE(),
|
|
262
|
+
client.TREASURY_ROLE(),
|
|
263
|
+
client.RESCUER_ROLE(),
|
|
264
|
+
client.FEE_COLLECTOR_ROLE(),
|
|
265
|
+
client.UPGRADER_ROLE(),
|
|
266
|
+
client.DISCLOSURE_ADMIN_ROLE(),
|
|
267
|
+
client.DEFAULT_ADMIN_ROLE(),
|
|
268
|
+
variant === "merkle" ? merkleClient.MERKLE_ADMIN_ROLE() : variant === "ecdsa" ? ecdsaClient.SIGNER_ROLE() : Promise.resolve(void 0)
|
|
269
|
+
]);
|
|
270
|
+
return {
|
|
271
|
+
PAUSER_ROLE,
|
|
272
|
+
WINDOW_ADMIN_ROLE,
|
|
273
|
+
TREASURY_ROLE,
|
|
274
|
+
RESCUER_ROLE,
|
|
275
|
+
FEE_COLLECTOR_ROLE,
|
|
276
|
+
UPGRADER_ROLE,
|
|
277
|
+
DISCLOSURE_ADMIN_ROLE,
|
|
278
|
+
DEFAULT_ADMIN_ROLE,
|
|
279
|
+
...variant === "merkle" && variantRole ? { MERKLE_ADMIN_ROLE: variantRole } : {},
|
|
280
|
+
...variant === "ecdsa" && variantRole ? { SIGNER_ROLE: variantRole } : {}
|
|
281
|
+
};
|
|
282
|
+
},
|
|
283
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
function useAirdropRoleMembers(args) {
|
|
287
|
+
const { role, ...base } = args;
|
|
288
|
+
const { client, chainId } = useMemoAirdropBaseClient(base);
|
|
289
|
+
return useQuery({
|
|
290
|
+
...args.query,
|
|
291
|
+
queryKey: airdropKeys.roleMembers({ chainId, address: args.address }, role),
|
|
292
|
+
queryFn: async () => {
|
|
293
|
+
const [members, count] = await Promise.all([
|
|
294
|
+
client.getRoleMembers(role),
|
|
295
|
+
client.getRoleMemberCount(role)
|
|
296
|
+
]);
|
|
297
|
+
return { members, count };
|
|
298
|
+
},
|
|
299
|
+
enabled: Boolean(client && role && (args.query?.enabled ?? true))
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
function useComplianceHasRole(args) {
|
|
303
|
+
const { role, holder, ...base } = args;
|
|
304
|
+
const { client, chainId } = useMemoComplianceManagerClient(base);
|
|
305
|
+
return useQuery({
|
|
306
|
+
...args.query,
|
|
307
|
+
queryKey: airdropKeys.complianceHasRole({ chainId, address: args.address }, role, holder),
|
|
308
|
+
queryFn: () => client.hasRole({ role, holder }),
|
|
309
|
+
enabled: Boolean(client && role && holder && (args.query?.enabled ?? true))
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
function useComplianceInfo(args) {
|
|
313
|
+
const { client, chainId } = useMemoComplianceManagerClient(args);
|
|
314
|
+
return useQuery({
|
|
315
|
+
...args.query,
|
|
316
|
+
queryKey: airdropKeys.complianceInfo({ chainId, address: args.address }),
|
|
317
|
+
queryFn: async () => {
|
|
318
|
+
const [airdrop, platformDelegate, clientDelegates] = await Promise.all([
|
|
319
|
+
client.airdrop(),
|
|
320
|
+
client.complianceDelegate(),
|
|
321
|
+
client.clientDelegates()
|
|
322
|
+
]);
|
|
323
|
+
return { airdrop, platformDelegate, clientDelegates };
|
|
324
|
+
},
|
|
325
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function useComplianceManagerOf(args = {}) {
|
|
329
|
+
const { airdrop, ...base } = args;
|
|
330
|
+
const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
|
|
331
|
+
return useQuery({
|
|
332
|
+
staleTime: Infinity,
|
|
333
|
+
...args.query,
|
|
334
|
+
queryKey: airdropQueryKey({
|
|
335
|
+
chainId,
|
|
336
|
+
address: resolvedAddress,
|
|
337
|
+
fn: "complianceManagerOf",
|
|
338
|
+
args: [airdrop]
|
|
339
|
+
}),
|
|
340
|
+
queryFn: () => client.complianceManagerOf(airdrop),
|
|
341
|
+
enabled: Boolean(client && airdrop && (args.query?.enabled ?? true))
|
|
26
342
|
});
|
|
27
343
|
}
|
|
28
|
-
function
|
|
29
|
-
const { client, chainId
|
|
344
|
+
function useComplianceRoleConstants(args) {
|
|
345
|
+
const { client, chainId } = useMemoComplianceManagerClient(args);
|
|
30
346
|
return useQuery({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
347
|
+
// A default, not a lock: `query.staleTime` still wins.
|
|
348
|
+
staleTime: Infinity,
|
|
349
|
+
...args.query,
|
|
350
|
+
queryKey: airdropQueryKey({
|
|
351
|
+
chainId,
|
|
352
|
+
address: args.address,
|
|
353
|
+
fn: "complianceRoleConstants",
|
|
354
|
+
args: []
|
|
355
|
+
}),
|
|
356
|
+
queryFn: async () => {
|
|
357
|
+
const [DELEGATION_ADMIN_ROLE, DEFAULT_ADMIN_ROLE] = await Promise.all([
|
|
358
|
+
client.DELEGATION_ADMIN_ROLE(),
|
|
359
|
+
client.DEFAULT_ADMIN_ROLE()
|
|
360
|
+
]);
|
|
361
|
+
return { DELEGATION_ADMIN_ROLE, DEFAULT_ADMIN_ROLE };
|
|
362
|
+
},
|
|
363
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
function useComplianceRoleMembers(args) {
|
|
367
|
+
const { role, ...base } = args;
|
|
368
|
+
const { client, chainId } = useMemoComplianceManagerClient(base);
|
|
369
|
+
return useQuery({
|
|
370
|
+
...args.query,
|
|
371
|
+
queryKey: airdropKeys.complianceRoleMembers({ chainId, address: args.address }, role),
|
|
372
|
+
queryFn: async () => {
|
|
373
|
+
const [members, count] = await Promise.all([
|
|
374
|
+
client.getRoleMembers(role),
|
|
375
|
+
client.getRoleMemberCount(role)
|
|
376
|
+
]);
|
|
377
|
+
return { members, count };
|
|
378
|
+
},
|
|
379
|
+
enabled: Boolean(client && role && (args.query?.enabled ?? true))
|
|
35
380
|
});
|
|
36
381
|
}
|
|
37
|
-
function
|
|
38
|
-
const { client, chainId
|
|
382
|
+
function useEcdsaDomain(args) {
|
|
383
|
+
const { client, chainId } = useMemoEcdsaAirdropClient(args);
|
|
39
384
|
return useQuery({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
385
|
+
staleTime: Infinity,
|
|
386
|
+
...args.query,
|
|
387
|
+
// `dedupMode` is a client-construction concern only; it moves no value
|
|
388
|
+
// read here, so it stays out of the key.
|
|
389
|
+
queryKey: airdropQueryKey({ chainId, address: args.address, fn: "ecdsaDomain", args: [] }),
|
|
390
|
+
queryFn: async () => {
|
|
391
|
+
const [claimTypehash, domainSeparator, domain] = await Promise.all([
|
|
392
|
+
client.claimTypehash(),
|
|
393
|
+
client.domainSeparator(),
|
|
394
|
+
client.eip712Domain()
|
|
395
|
+
]);
|
|
396
|
+
return { claimTypehash, domainSeparator, domain };
|
|
397
|
+
},
|
|
398
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
44
399
|
});
|
|
45
400
|
}
|
|
46
|
-
function
|
|
401
|
+
function useEffectiveDelegateToCompliance(args = {}) {
|
|
47
402
|
const { creator, ...base } = args;
|
|
48
|
-
const { client, chainId, resolvedAddress } =
|
|
403
|
+
const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
|
|
404
|
+
return useQuery({
|
|
405
|
+
...args.query,
|
|
406
|
+
queryKey: airdropQueryKey({
|
|
407
|
+
chainId,
|
|
408
|
+
address: resolvedAddress,
|
|
409
|
+
fn: "effectiveDelegateToCompliance",
|
|
410
|
+
args: [creator]
|
|
411
|
+
}),
|
|
412
|
+
queryFn: () => client.effectiveDelegateToCompliance(creator),
|
|
413
|
+
enabled: Boolean(client && creator && (args.query?.enabled ?? true))
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
function useIsActiveDelegate(args) {
|
|
417
|
+
const { delegate, ...base } = args;
|
|
418
|
+
const { client, chainId } = useMemoComplianceManagerClient(base);
|
|
49
419
|
return useQuery({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
420
|
+
...args.query,
|
|
421
|
+
queryKey: airdropKeys.activeDelegate({ chainId, address: args.address }, delegate),
|
|
422
|
+
queryFn: () => client.isActiveDelegate(delegate),
|
|
423
|
+
enabled: Boolean(client && delegate && (args.query?.enabled ?? true))
|
|
54
424
|
});
|
|
55
425
|
}
|
|
56
|
-
function
|
|
57
|
-
const {
|
|
58
|
-
const { client, chainId, resolvedAddress } = useMemoFactoryClient(base);
|
|
426
|
+
function useIsMerkleRootMutable(args) {
|
|
427
|
+
const { client, chainId } = useMemoMerkleAirdropClient(args);
|
|
59
428
|
return useQuery({
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
429
|
+
// Before the spread so a consumer can still opt into refetching.
|
|
430
|
+
staleTime: Infinity,
|
|
431
|
+
...args.query,
|
|
432
|
+
queryKey: airdropKeys.merkleRootMutable({ chainId, address: args.address }),
|
|
433
|
+
queryFn: () => client.isMerkleRootMutable(),
|
|
434
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
function useIsSignatureValid(args) {
|
|
438
|
+
const { recipient, encryptedAmountHandle, dedupId, deadline, signer, signature, ...base } = args;
|
|
439
|
+
const { client, chainId } = useMemoEcdsaAirdropClient(base);
|
|
440
|
+
return useQuery({
|
|
441
|
+
...args.query,
|
|
442
|
+
queryKey: airdropQueryKey({
|
|
443
|
+
chainId,
|
|
444
|
+
address: args.address,
|
|
445
|
+
fn: AIRDROP_FN.isSignatureValid,
|
|
446
|
+
args: [recipient, encryptedAmountHandle, dedupId, deadline, signer, signature]
|
|
447
|
+
}),
|
|
448
|
+
queryFn: () => client.isSignatureValid({
|
|
449
|
+
recipient,
|
|
450
|
+
encryptedAmountHandle,
|
|
451
|
+
dedupId,
|
|
452
|
+
deadline,
|
|
453
|
+
signer,
|
|
454
|
+
signature
|
|
455
|
+
}),
|
|
456
|
+
enabled: Boolean(
|
|
457
|
+
client && recipient && encryptedAmountHandle && dedupId && deadline !== void 0 && signer && signature && (args.query?.enabled ?? true)
|
|
458
|
+
)
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
function usePreflightClaim(args) {
|
|
462
|
+
const { variant, dedupMode, claimant, account, to, entrypoint, signature, ...base } = args;
|
|
463
|
+
const { client: merkleClient, chainId } = useMemoMerkleAirdropClient(base);
|
|
464
|
+
const { client: ecdsaClient } = useMemoEcdsaAirdropClient({
|
|
465
|
+
...base,
|
|
466
|
+
dedupMode: dedupMode ?? "none"
|
|
467
|
+
});
|
|
468
|
+
const client = variant === "ecdsa" ? ecdsaClient : merkleClient;
|
|
469
|
+
return useQuery({
|
|
470
|
+
...args.query,
|
|
471
|
+
queryKey: airdropQueryKey({
|
|
472
|
+
chainId,
|
|
473
|
+
address: args.address,
|
|
474
|
+
fn: "preflightClaim",
|
|
475
|
+
args: [variant, claimant, account, to, entrypoint, signature]
|
|
476
|
+
}),
|
|
477
|
+
queryFn: () => preflightClaim({
|
|
478
|
+
airdrop: client,
|
|
479
|
+
claimant,
|
|
480
|
+
account,
|
|
481
|
+
to,
|
|
482
|
+
entrypoint,
|
|
483
|
+
signature
|
|
484
|
+
}),
|
|
485
|
+
enabled: Boolean(client && claimant && (args.query?.enabled ?? true))
|
|
64
486
|
});
|
|
65
487
|
}
|
|
66
488
|
function usePreflightCreateAirdrop(args = {}) {
|
|
67
|
-
const {
|
|
68
|
-
const { client, chainId, resolvedAddress } = useMemoFactoryClient(base);
|
|
489
|
+
const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(args);
|
|
69
490
|
return useQuery({
|
|
70
|
-
|
|
71
|
-
|
|
491
|
+
...args.query,
|
|
492
|
+
queryKey: airdropQueryKey({
|
|
72
493
|
chainId,
|
|
73
|
-
resolvedAddress,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
494
|
+
address: resolvedAddress,
|
|
495
|
+
fn: AIRDROP_FN.preflightCreate,
|
|
496
|
+
args: [
|
|
497
|
+
args.variant,
|
|
498
|
+
args.mode,
|
|
499
|
+
args.creator,
|
|
500
|
+
args.userSalt,
|
|
501
|
+
args.expectedInitCodeHash,
|
|
502
|
+
// `params` IS key-affecting here, unlike in the predict hooks: the
|
|
503
|
+
// stock-wrapper probe reads `common.token` / `common.unwrappable`.
|
|
504
|
+
args.params
|
|
505
|
+
]
|
|
84
506
|
}),
|
|
85
|
-
|
|
86
|
-
|
|
507
|
+
queryFn: () => {
|
|
508
|
+
const common = {
|
|
509
|
+
factory: client,
|
|
510
|
+
mode: args.mode,
|
|
511
|
+
creator: args.creator,
|
|
512
|
+
userSalt: args.userSalt,
|
|
513
|
+
expectedInitCodeHash: args.expectedInitCodeHash
|
|
514
|
+
};
|
|
515
|
+
return args.variant === "merkle" ? preflightCreate({ ...common, variant: "merkle", params: args.params }) : preflightCreate({ ...common, variant: "ecdsa", params: args.params });
|
|
516
|
+
},
|
|
517
|
+
enabled: Boolean(
|
|
518
|
+
client && args.variant && args.params && args.mode && args.creator && args.userSalt && (args.query?.enabled ?? true)
|
|
519
|
+
)
|
|
87
520
|
});
|
|
88
521
|
}
|
|
89
|
-
function
|
|
90
|
-
const { client, resolutionError } =
|
|
522
|
+
function useCreateEcdsaAirdrop(options = {}) {
|
|
523
|
+
const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
|
|
524
|
+
const queryClient = useQueryClient();
|
|
91
525
|
return useMutation({
|
|
92
526
|
mutationFn: async (args) => {
|
|
93
527
|
if (!client) {
|
|
94
|
-
throw resolutionError ?? new MissingClientError("
|
|
528
|
+
throw resolutionError ?? new MissingClientError("useCreateEcdsaAirdrop", "factory");
|
|
95
529
|
}
|
|
96
|
-
return client.
|
|
530
|
+
return client.createEcdsaAirdrop(args);
|
|
531
|
+
},
|
|
532
|
+
onSuccess: () => {
|
|
533
|
+
void queryClient.invalidateQueries({
|
|
534
|
+
queryKey: airdropQueryKeyPrefix({ chainId, address: resolvedAddress, fn: "registry" })
|
|
535
|
+
});
|
|
97
536
|
}
|
|
98
537
|
});
|
|
99
538
|
}
|
|
100
|
-
function
|
|
101
|
-
const { client, resolutionError } =
|
|
539
|
+
function useCreateMerkleAirdrop(options = {}) {
|
|
540
|
+
const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
|
|
541
|
+
const queryClient = useQueryClient();
|
|
102
542
|
return useMutation({
|
|
103
543
|
mutationFn: async (args) => {
|
|
104
544
|
if (!client) {
|
|
105
|
-
throw resolutionError ?? new MissingClientError("
|
|
545
|
+
throw resolutionError ?? new MissingClientError("useCreateMerkleAirdrop", "factory");
|
|
106
546
|
}
|
|
107
|
-
return client.
|
|
547
|
+
return client.createMerkleAirdrop(args);
|
|
548
|
+
},
|
|
549
|
+
onSuccess: () => {
|
|
550
|
+
void queryClient.invalidateQueries({
|
|
551
|
+
queryKey: airdropQueryKeyPrefix({ chainId, address: resolvedAddress, fn: "registry" })
|
|
552
|
+
});
|
|
108
553
|
}
|
|
109
554
|
});
|
|
110
555
|
}
|
|
111
|
-
function
|
|
112
|
-
const { client, resolutionError } =
|
|
556
|
+
function useFundAirdrop(options = {}) {
|
|
557
|
+
const { client, resolutionError } = useMemoAirdropFactoryClient(options);
|
|
113
558
|
return useMutation({
|
|
114
559
|
mutationFn: async (args) => {
|
|
115
560
|
if (!client) {
|
|
116
|
-
throw resolutionError ?? new MissingClientError("
|
|
561
|
+
throw resolutionError ?? new MissingClientError("useFundAirdrop", "factory");
|
|
117
562
|
}
|
|
118
|
-
return client.
|
|
563
|
+
return client.fundAirdrop(args);
|
|
119
564
|
}
|
|
120
565
|
});
|
|
121
566
|
}
|
|
122
|
-
function
|
|
123
|
-
const { client,
|
|
567
|
+
function useEcdsaClaim(options) {
|
|
568
|
+
const { client, chainId } = useMemoEcdsaAirdropClient(options);
|
|
569
|
+
const queryClient = useQueryClient();
|
|
124
570
|
return useMutation({
|
|
125
571
|
mutationFn: async (args) => {
|
|
126
572
|
if (!client) {
|
|
127
|
-
throw
|
|
573
|
+
throw new MissingClientError("useEcdsaClaim", "ecdsa-airdrop");
|
|
128
574
|
}
|
|
129
|
-
return client.
|
|
575
|
+
return client.claim(args);
|
|
576
|
+
},
|
|
577
|
+
onSuccess: () => {
|
|
578
|
+
void queryClient.invalidateQueries({
|
|
579
|
+
queryKey: airdropKeys.isSignatureValidAll({ chainId, address: options.address })
|
|
580
|
+
});
|
|
130
581
|
}
|
|
131
582
|
});
|
|
132
583
|
}
|
|
133
|
-
function
|
|
134
|
-
const { client,
|
|
584
|
+
function useMerkleClaim(options) {
|
|
585
|
+
const { client, chainId } = useMemoMerkleAirdropClient(options);
|
|
586
|
+
const queryClient = useQueryClient();
|
|
135
587
|
return useMutation({
|
|
136
588
|
mutationFn: async (args) => {
|
|
137
589
|
if (!client) {
|
|
138
|
-
throw
|
|
590
|
+
throw new MissingClientError("useMerkleClaim", "merkle-airdrop");
|
|
139
591
|
}
|
|
140
|
-
return client.
|
|
592
|
+
return client.claim(args);
|
|
593
|
+
},
|
|
594
|
+
onMutate: (variables) => ({ account: variables.entry.account }),
|
|
595
|
+
onSuccess: (_hash, _variables, context) => {
|
|
596
|
+
if (!context?.account) return;
|
|
597
|
+
void queryClient.invalidateQueries({
|
|
598
|
+
queryKey: airdropQueryKey({
|
|
599
|
+
chainId,
|
|
600
|
+
address: options.address,
|
|
601
|
+
fn: "getClaimedAmount",
|
|
602
|
+
args: [context.account]
|
|
603
|
+
})
|
|
604
|
+
});
|
|
141
605
|
}
|
|
142
606
|
});
|
|
143
607
|
}
|
|
144
|
-
function
|
|
145
|
-
const { client,
|
|
608
|
+
function useSetMerkleRoot(options) {
|
|
609
|
+
const { client, chainId } = useMemoMerkleAirdropClient(options);
|
|
610
|
+
const queryClient = useQueryClient();
|
|
146
611
|
return useMutation({
|
|
147
|
-
mutationFn: async (
|
|
148
|
-
if (!client)
|
|
149
|
-
|
|
612
|
+
mutationFn: async (args) => {
|
|
613
|
+
if (!client) {
|
|
614
|
+
throw new MissingClientError("useSetMerkleRoot", "merkle-airdrop");
|
|
615
|
+
}
|
|
616
|
+
return client.setMerkleRoot(args);
|
|
617
|
+
},
|
|
618
|
+
onSuccess: () => {
|
|
619
|
+
void queryClient.invalidateQueries({
|
|
620
|
+
queryKey: airdropQueryKey({
|
|
621
|
+
chainId,
|
|
622
|
+
address: options.address,
|
|
623
|
+
fn: "merkleRoot",
|
|
624
|
+
args: []
|
|
625
|
+
})
|
|
626
|
+
});
|
|
150
627
|
}
|
|
151
628
|
});
|
|
152
629
|
}
|
|
153
|
-
function
|
|
154
|
-
const { client,
|
|
630
|
+
function useGrantInstanceRoles(options) {
|
|
631
|
+
const { client, chainId } = useMemoAirdropBaseClient(options);
|
|
632
|
+
const queryClient = useQueryClient();
|
|
155
633
|
return useMutation({
|
|
156
|
-
mutationFn: async (
|
|
157
|
-
if (!client)
|
|
158
|
-
throw
|
|
159
|
-
|
|
634
|
+
mutationFn: async (args) => {
|
|
635
|
+
if (!client) {
|
|
636
|
+
throw new MissingClientError("useGrantInstanceRoles", "airdrop-base");
|
|
637
|
+
}
|
|
638
|
+
return grantInstanceRoles({
|
|
639
|
+
airdrop: client,
|
|
640
|
+
assignment: args.assignment,
|
|
641
|
+
...args.revokeFromCreator !== void 0 ? { revokeFromCreator: args.revokeFromCreator } : {}
|
|
642
|
+
});
|
|
643
|
+
},
|
|
644
|
+
onSuccess: () => {
|
|
645
|
+
const scope = { chainId, address: options.address };
|
|
646
|
+
void queryClient.invalidateQueries({ queryKey: airdropKeys.hasRoleAll(scope) });
|
|
647
|
+
void queryClient.invalidateQueries({ queryKey: airdropKeys.roleMembersAll(scope) });
|
|
160
648
|
}
|
|
161
649
|
});
|
|
162
650
|
}
|
|
163
|
-
function
|
|
164
|
-
const { client,
|
|
651
|
+
function useAirdropPause(options) {
|
|
652
|
+
const { client, chainId } = useMemoAirdropBaseClient(options);
|
|
653
|
+
const queryClient = useQueryClient();
|
|
165
654
|
return useMutation({
|
|
166
|
-
mutationFn: async ({
|
|
167
|
-
if (!client)
|
|
168
|
-
|
|
655
|
+
mutationFn: async ({ paused, ...rest }) => {
|
|
656
|
+
if (!client) {
|
|
657
|
+
throw new MissingClientError("useAirdropPause", "airdrop-base");
|
|
658
|
+
}
|
|
659
|
+
return paused ? client.pause(rest) : client.unpause(rest);
|
|
660
|
+
},
|
|
661
|
+
onSuccess: () => {
|
|
662
|
+
void queryClient.invalidateQueries({
|
|
663
|
+
queryKey: airdropQueryKey({ chainId, address: options.address, fn: "paused", args: [] })
|
|
664
|
+
});
|
|
665
|
+
void queryClient.invalidateQueries({
|
|
666
|
+
queryKey: airdropQueryKey({ chainId, address: options.address, fn: "window", args: [] })
|
|
667
|
+
});
|
|
169
668
|
}
|
|
170
669
|
});
|
|
171
670
|
}
|
|
172
|
-
function
|
|
173
|
-
const { client,
|
|
671
|
+
function useExtendClaimWindow(options) {
|
|
672
|
+
const { client, chainId } = useMemoAirdropBaseClient(options);
|
|
673
|
+
const queryClient = useQueryClient();
|
|
174
674
|
return useMutation({
|
|
175
|
-
mutationFn: async (
|
|
176
|
-
if (!client)
|
|
177
|
-
throw
|
|
178
|
-
|
|
675
|
+
mutationFn: async (args) => {
|
|
676
|
+
if (!client) {
|
|
677
|
+
throw new MissingClientError("useExtendClaimWindow", "airdrop-base");
|
|
678
|
+
}
|
|
679
|
+
return client.extendClaimWindow(args);
|
|
680
|
+
},
|
|
681
|
+
onSuccess: () => {
|
|
682
|
+
void queryClient.invalidateQueries({
|
|
683
|
+
queryKey: airdropQueryKey({ chainId, address: options.address, fn: "window", args: [] })
|
|
684
|
+
});
|
|
179
685
|
}
|
|
180
686
|
});
|
|
181
687
|
}
|
|
182
|
-
function
|
|
183
|
-
const { client
|
|
184
|
-
return
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
688
|
+
function useWithdrawConfidential(options) {
|
|
689
|
+
const { client } = useMemoAirdropBaseClient(options);
|
|
690
|
+
return useMutation({
|
|
691
|
+
mutationFn: async (args) => {
|
|
692
|
+
if (!client) {
|
|
693
|
+
throw new MissingClientError("useWithdrawConfidential", "airdrop-base");
|
|
694
|
+
}
|
|
695
|
+
return client.withdrawConfidential(args);
|
|
696
|
+
}
|
|
189
697
|
});
|
|
190
698
|
}
|
|
191
|
-
function
|
|
192
|
-
const { client, chainId } =
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
699
|
+
function useAddComplianceDelegate(options) {
|
|
700
|
+
const { client, chainId } = useMemoComplianceManagerClient(options);
|
|
701
|
+
const queryClient = useQueryClient();
|
|
702
|
+
return useMutation({
|
|
703
|
+
mutationFn: async (args) => {
|
|
704
|
+
if (!client) {
|
|
705
|
+
throw new MissingClientError("useAddComplianceDelegate", "compliance-manager");
|
|
706
|
+
}
|
|
707
|
+
return client.addDelegate(args);
|
|
708
|
+
},
|
|
709
|
+
onSuccess: (_hash, variables) => {
|
|
710
|
+
const scope = { chainId, address: options.address };
|
|
711
|
+
void queryClient.invalidateQueries({ queryKey: airdropKeys.complianceInfo(scope) });
|
|
712
|
+
void queryClient.invalidateQueries({
|
|
713
|
+
queryKey: airdropKeys.activeDelegate(scope, variables.delegate)
|
|
714
|
+
});
|
|
715
|
+
}
|
|
198
716
|
});
|
|
199
717
|
}
|
|
200
|
-
function
|
|
201
|
-
const { client, chainId } =
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
718
|
+
function useAirdropGrantRole(options) {
|
|
719
|
+
const { client, chainId } = useMemoAirdropBaseClient(options);
|
|
720
|
+
const queryClient = useQueryClient();
|
|
721
|
+
return useMutation({
|
|
722
|
+
mutationFn: async (args) => {
|
|
723
|
+
if (!client) {
|
|
724
|
+
throw new MissingClientError("useAirdropGrantRole", "airdrop-base");
|
|
725
|
+
}
|
|
726
|
+
return client.grantRole(args);
|
|
727
|
+
},
|
|
728
|
+
onSuccess: (_hash, variables) => {
|
|
729
|
+
const scope = { chainId, address: options.address };
|
|
730
|
+
void queryClient.invalidateQueries({
|
|
731
|
+
queryKey: airdropKeys.hasRole(scope, variables.role, variables.holder)
|
|
732
|
+
});
|
|
733
|
+
void queryClient.invalidateQueries({
|
|
734
|
+
queryKey: airdropKeys.roleMembers(scope, variables.role)
|
|
735
|
+
});
|
|
736
|
+
}
|
|
207
737
|
});
|
|
208
738
|
}
|
|
209
|
-
function
|
|
210
|
-
const { client, chainId } =
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
739
|
+
function useAirdropRenounceRole(options) {
|
|
740
|
+
const { client, chainId } = useMemoAirdropBaseClient(options);
|
|
741
|
+
const queryClient = useQueryClient();
|
|
742
|
+
return useMutation({
|
|
743
|
+
mutationFn: async (args) => {
|
|
744
|
+
if (!client) {
|
|
745
|
+
throw new MissingClientError("useAirdropRenounceRole", "airdrop-base");
|
|
746
|
+
}
|
|
747
|
+
return client.renounceRole(args);
|
|
748
|
+
},
|
|
749
|
+
onSuccess: (_hash, variables) => {
|
|
750
|
+
const scope = { chainId, address: options.address };
|
|
751
|
+
void queryClient.invalidateQueries({ queryKey: airdropKeys.hasRoleAll(scope) });
|
|
752
|
+
void queryClient.invalidateQueries({
|
|
753
|
+
queryKey: airdropKeys.roleMembers(scope, variables.role)
|
|
754
|
+
});
|
|
755
|
+
}
|
|
216
756
|
});
|
|
217
757
|
}
|
|
218
|
-
function
|
|
219
|
-
const { client, chainId } =
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
758
|
+
function useAirdropRevokeRole(options) {
|
|
759
|
+
const { client, chainId } = useMemoAirdropBaseClient(options);
|
|
760
|
+
const queryClient = useQueryClient();
|
|
761
|
+
return useMutation({
|
|
762
|
+
mutationFn: async (args) => {
|
|
763
|
+
if (!client) {
|
|
764
|
+
throw new MissingClientError("useAirdropRevokeRole", "airdrop-base");
|
|
765
|
+
}
|
|
766
|
+
return client.revokeRole(args);
|
|
767
|
+
},
|
|
768
|
+
onSuccess: (_hash, variables) => {
|
|
769
|
+
const scope = { chainId, address: options.address };
|
|
770
|
+
void queryClient.invalidateQueries({
|
|
771
|
+
queryKey: airdropKeys.hasRole(scope, variables.role, variables.holder)
|
|
772
|
+
});
|
|
773
|
+
void queryClient.invalidateQueries({
|
|
774
|
+
queryKey: airdropKeys.roleMembers(scope, variables.role)
|
|
775
|
+
});
|
|
776
|
+
}
|
|
225
777
|
});
|
|
226
778
|
}
|
|
227
|
-
function
|
|
228
|
-
const { client
|
|
229
|
-
return
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
779
|
+
function useAirdropUpgradeToAndCall(options) {
|
|
780
|
+
const { client } = useMemoAirdropBaseClient(options);
|
|
781
|
+
return useMutation({
|
|
782
|
+
mutationFn: async (args) => {
|
|
783
|
+
if (!client) {
|
|
784
|
+
throw new MissingClientError("useAirdropUpgradeToAndCall", "airdrop-base");
|
|
785
|
+
}
|
|
786
|
+
return client.upgradeToAndCall(args);
|
|
787
|
+
}
|
|
234
788
|
});
|
|
235
789
|
}
|
|
236
|
-
function
|
|
237
|
-
const { client
|
|
238
|
-
return
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
790
|
+
function useBatchDiscloseHandlesToParty(options) {
|
|
791
|
+
const { client } = useMemoAirdropBaseClient(options);
|
|
792
|
+
return useMutation({
|
|
793
|
+
mutationFn: async (args) => {
|
|
794
|
+
if (!client) {
|
|
795
|
+
throw new MissingClientError("useBatchDiscloseHandlesToParty", "airdrop-base");
|
|
796
|
+
}
|
|
797
|
+
return client.batchDiscloseHandlesToParty(args);
|
|
798
|
+
}
|
|
243
799
|
});
|
|
244
800
|
}
|
|
245
|
-
function
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
801
|
+
function useBuildMerkleCampaign(options = {}) {
|
|
802
|
+
const encryptorSourceRef = useRef(options.encryptor);
|
|
803
|
+
encryptorSourceRef.current = options.encryptor;
|
|
804
|
+
return useMutation({
|
|
805
|
+
mutationFn: async (args) => buildMerkleCampaign({
|
|
806
|
+
instance: args.instance,
|
|
807
|
+
recipients: args.recipients,
|
|
808
|
+
encryptor: () => resolveEncryptor(encryptorSourceRef.current),
|
|
809
|
+
...args.submitter !== void 0 ? { submitter: args.submitter } : {}
|
|
810
|
+
})
|
|
252
811
|
});
|
|
253
812
|
}
|
|
254
|
-
function
|
|
255
|
-
const { client, chainId } =
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
813
|
+
function useComplianceGrantRole(options) {
|
|
814
|
+
const { client, chainId } = useMemoComplianceManagerClient(options);
|
|
815
|
+
const queryClient = useQueryClient();
|
|
816
|
+
return useMutation({
|
|
817
|
+
mutationFn: async (args) => {
|
|
818
|
+
if (!client) {
|
|
819
|
+
throw new MissingClientError("useComplianceGrantRole", "compliance-manager");
|
|
820
|
+
}
|
|
821
|
+
return client.grantRole(args);
|
|
822
|
+
},
|
|
823
|
+
onSuccess: (_hash, variables) => {
|
|
824
|
+
const scope = { chainId, address: options.address };
|
|
825
|
+
void queryClient.invalidateQueries({
|
|
826
|
+
queryKey: airdropKeys.complianceHasRole(scope, variables.role, variables.holder)
|
|
827
|
+
});
|
|
828
|
+
void queryClient.invalidateQueries({
|
|
829
|
+
queryKey: airdropKeys.complianceRoleMembers(scope, variables.role)
|
|
830
|
+
});
|
|
831
|
+
}
|
|
261
832
|
});
|
|
262
833
|
}
|
|
263
|
-
function
|
|
264
|
-
const { client, chainId } =
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
834
|
+
function useComplianceRenounceRole(options) {
|
|
835
|
+
const { client, chainId } = useMemoComplianceManagerClient(options);
|
|
836
|
+
const queryClient = useQueryClient();
|
|
837
|
+
return useMutation({
|
|
838
|
+
mutationFn: async (args) => {
|
|
839
|
+
if (!client) {
|
|
840
|
+
throw new MissingClientError("useComplianceRenounceRole", "compliance-manager");
|
|
841
|
+
}
|
|
842
|
+
return client.renounceRole(args);
|
|
843
|
+
},
|
|
844
|
+
onSuccess: (_hash, variables) => {
|
|
845
|
+
const scope = { chainId, address: options.address };
|
|
846
|
+
void queryClient.invalidateQueries({ queryKey: airdropKeys.complianceHasRoleAll(scope) });
|
|
847
|
+
void queryClient.invalidateQueries({
|
|
848
|
+
queryKey: airdropKeys.complianceRoleMembers(scope, variables.role)
|
|
849
|
+
});
|
|
850
|
+
}
|
|
270
851
|
});
|
|
271
852
|
}
|
|
272
|
-
function
|
|
273
|
-
const { client, chainId } =
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
853
|
+
function useComplianceRevokeRole(options) {
|
|
854
|
+
const { client, chainId } = useMemoComplianceManagerClient(options);
|
|
855
|
+
const queryClient = useQueryClient();
|
|
856
|
+
return useMutation({
|
|
857
|
+
mutationFn: async (args) => {
|
|
858
|
+
if (!client) {
|
|
859
|
+
throw new MissingClientError("useComplianceRevokeRole", "compliance-manager");
|
|
860
|
+
}
|
|
861
|
+
return client.revokeRole(args);
|
|
862
|
+
},
|
|
863
|
+
onSuccess: (_hash, variables) => {
|
|
864
|
+
const scope = { chainId, address: options.address };
|
|
865
|
+
void queryClient.invalidateQueries({
|
|
866
|
+
queryKey: airdropKeys.complianceHasRole(scope, variables.role, variables.holder)
|
|
867
|
+
});
|
|
868
|
+
void queryClient.invalidateQueries({
|
|
869
|
+
queryKey: airdropKeys.complianceRoleMembers(scope, variables.role)
|
|
870
|
+
});
|
|
871
|
+
}
|
|
279
872
|
});
|
|
280
873
|
}
|
|
281
|
-
function
|
|
282
|
-
const { client, chainId } =
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
874
|
+
function useCreateAndFundEcdsaAirdrop(options = {}) {
|
|
875
|
+
const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
|
|
876
|
+
const queryClient = useQueryClient();
|
|
877
|
+
return useMutation({
|
|
878
|
+
mutationFn: async (args) => {
|
|
879
|
+
if (!client) {
|
|
880
|
+
throw resolutionError ?? new MissingClientError("useCreateAndFundEcdsaAirdrop", "factory");
|
|
881
|
+
}
|
|
882
|
+
return client.createAndFundEcdsaAirdrop(args);
|
|
883
|
+
},
|
|
884
|
+
onSuccess: () => {
|
|
885
|
+
void queryClient.invalidateQueries({
|
|
886
|
+
queryKey: airdropKeys.registryAll({ chainId, address: resolvedAddress })
|
|
887
|
+
});
|
|
888
|
+
}
|
|
288
889
|
});
|
|
289
890
|
}
|
|
290
|
-
function
|
|
291
|
-
const {
|
|
292
|
-
const
|
|
293
|
-
return
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
891
|
+
function useCreateAndFundMerkleAirdrop(options = {}) {
|
|
892
|
+
const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
|
|
893
|
+
const queryClient = useQueryClient();
|
|
894
|
+
return useMutation({
|
|
895
|
+
mutationFn: async (args) => {
|
|
896
|
+
if (!client) {
|
|
897
|
+
throw resolutionError ?? new MissingClientError("useCreateAndFundMerkleAirdrop", "factory");
|
|
898
|
+
}
|
|
899
|
+
return client.createAndFundMerkleAirdrop(args);
|
|
900
|
+
},
|
|
901
|
+
onSuccess: () => {
|
|
902
|
+
void queryClient.invalidateQueries({
|
|
903
|
+
queryKey: airdropKeys.registryAll({ chainId, address: resolvedAddress })
|
|
904
|
+
});
|
|
905
|
+
}
|
|
298
906
|
});
|
|
299
907
|
}
|
|
300
|
-
function
|
|
301
|
-
const {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
encryptedAmountHandle
|
|
310
|
-
),
|
|
311
|
-
queryFn: () => client.isSignatureClaimed(user, encryptedAmountHandle),
|
|
312
|
-
enabled: !!client && !!user && !!encryptedAmountHandle,
|
|
313
|
-
staleTime: 0
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
function useAirdropIsSignatureValid(args) {
|
|
317
|
-
const { encryptedAmountHandle, signature, caller, ...base } = args;
|
|
318
|
-
const { client, chainId } = useMemoAirdropClient(base);
|
|
319
|
-
const { address: connectedAddress } = useWagmiAccount();
|
|
320
|
-
const resolvedCaller = caller ?? connectedAddress;
|
|
321
|
-
return useQuery({
|
|
322
|
-
queryKey: buildQueryKey(
|
|
323
|
-
"airdrop:isSignatureValid",
|
|
324
|
-
chainId,
|
|
325
|
-
base.address,
|
|
326
|
-
encryptedAmountHandle,
|
|
327
|
-
signature,
|
|
328
|
-
resolvedCaller
|
|
329
|
-
),
|
|
330
|
-
queryFn: () => client.isSignatureValid({
|
|
331
|
-
encryptedAmountHandle,
|
|
332
|
-
signature,
|
|
333
|
-
caller: resolvedCaller
|
|
334
|
-
}),
|
|
335
|
-
enabled: !!client && !!encryptedAmountHandle && !!signature && !!resolvedCaller,
|
|
336
|
-
staleTime: 0
|
|
908
|
+
function useDiscloseHandleToParty(options) {
|
|
909
|
+
const { client } = useMemoAirdropBaseClient(options);
|
|
910
|
+
return useMutation({
|
|
911
|
+
mutationFn: async (args) => {
|
|
912
|
+
if (!client) {
|
|
913
|
+
throw new MissingClientError("useDiscloseHandleToParty", "airdrop-base");
|
|
914
|
+
}
|
|
915
|
+
return client.discloseHandleToParty(args);
|
|
916
|
+
}
|
|
337
917
|
});
|
|
338
918
|
}
|
|
339
|
-
function
|
|
340
|
-
const {
|
|
341
|
-
const
|
|
342
|
-
return
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
919
|
+
function useEcdsaClaimAndUnwrap(options) {
|
|
920
|
+
const { client, chainId } = useMemoEcdsaAirdropClient(options);
|
|
921
|
+
const queryClient = useQueryClient();
|
|
922
|
+
return useMutation({
|
|
923
|
+
mutationFn: async (args) => {
|
|
924
|
+
if (!client) {
|
|
925
|
+
throw new MissingClientError("useEcdsaClaimAndUnwrap", "ecdsa-airdrop");
|
|
926
|
+
}
|
|
927
|
+
return client.claimAndUnwrap(args);
|
|
928
|
+
},
|
|
929
|
+
onSuccess: () => {
|
|
930
|
+
void queryClient.invalidateQueries({
|
|
931
|
+
queryKey: airdropKeys.isSignatureValidAll({ chainId, address: options.address })
|
|
932
|
+
});
|
|
933
|
+
}
|
|
347
934
|
});
|
|
348
935
|
}
|
|
349
|
-
function
|
|
350
|
-
const
|
|
936
|
+
function useEncryptCampaignAmounts(options = {}) {
|
|
937
|
+
const encryptorSourceRef = useRef(options.encryptor);
|
|
938
|
+
encryptorSourceRef.current = options.encryptor;
|
|
939
|
+
return useMutation({
|
|
940
|
+
mutationFn: async (args) => encryptCampaignAmounts({
|
|
941
|
+
instance: args.instance,
|
|
942
|
+
recipients: args.recipients,
|
|
943
|
+
encryptor: () => resolveEncryptor(encryptorSourceRef.current),
|
|
944
|
+
...args.submitter !== void 0 ? { submitter: args.submitter } : {}
|
|
945
|
+
})
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
function useMerkleClaimAndUnwrap(options) {
|
|
949
|
+
const { client, walletClient, chainId } = useMemoMerkleAirdropClient(options);
|
|
950
|
+
const queryClient = useQueryClient();
|
|
351
951
|
return useMutation({
|
|
352
952
|
mutationFn: async (args) => {
|
|
353
|
-
if (!client)
|
|
354
|
-
|
|
953
|
+
if (!client) {
|
|
954
|
+
throw new MissingClientError("useMerkleClaimAndUnwrap", "merkle-airdrop");
|
|
955
|
+
}
|
|
956
|
+
return client.claimAndUnwrap(args);
|
|
957
|
+
},
|
|
958
|
+
// Resolved here rather than in `onSuccess`: a mutation outlives several
|
|
959
|
+
// re-renders of its own component and `useWalletClient().data` can read back
|
|
960
|
+
// transiently empty across them, which would silently skip the invalidation.
|
|
961
|
+
onMutate: (variables) => {
|
|
962
|
+
const account = variables.account ?? walletClient?.account;
|
|
963
|
+
if (!account) return {};
|
|
964
|
+
return { sender: typeof account === "string" ? account : account.address };
|
|
965
|
+
},
|
|
966
|
+
onSuccess: (_hash, _variables, context) => {
|
|
967
|
+
if (!context?.sender) return;
|
|
968
|
+
void queryClient.invalidateQueries({
|
|
969
|
+
queryKey: airdropKeys.claimedAmount({ chainId, address: options.address }, context.sender)
|
|
970
|
+
});
|
|
355
971
|
}
|
|
356
972
|
});
|
|
357
973
|
}
|
|
358
|
-
function
|
|
359
|
-
const { client } =
|
|
974
|
+
function usePlanMerkleCampaign(options = {}) {
|
|
975
|
+
const { client, resolutionError } = useMemoAirdropFactoryClient(options);
|
|
976
|
+
const encryptorSourceRef = useRef(options.encryptor);
|
|
977
|
+
encryptorSourceRef.current = options.encryptor;
|
|
360
978
|
return useMutation({
|
|
361
979
|
mutationFn: async (args) => {
|
|
362
|
-
if (!client)
|
|
363
|
-
|
|
980
|
+
if (!client) {
|
|
981
|
+
throw resolutionError ?? new MissingClientError("usePlanMerkleCampaign", "factory");
|
|
982
|
+
}
|
|
983
|
+
return planMerkleCampaign({
|
|
984
|
+
factory: client,
|
|
985
|
+
...args,
|
|
986
|
+
encryptor: () => resolveEncryptor(encryptorSourceRef.current)
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
function useRescueERC20(options) {
|
|
992
|
+
const { client } = useMemoAirdropBaseClient(options);
|
|
993
|
+
return useMutation({
|
|
994
|
+
mutationFn: async (args) => {
|
|
995
|
+
if (!client) {
|
|
996
|
+
throw new MissingClientError("useRescueERC20", "airdrop-base");
|
|
997
|
+
}
|
|
998
|
+
return client.rescueERC20(args);
|
|
364
999
|
}
|
|
365
1000
|
});
|
|
366
1001
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
const { client } = useMemoAirdropClient(options);
|
|
1002
|
+
function useRescueOtherConfidentialToken(options) {
|
|
1003
|
+
const { client } = useMemoAirdropBaseClient(options);
|
|
370
1004
|
return useMutation({
|
|
371
|
-
mutationFn: async (
|
|
372
|
-
if (!client)
|
|
373
|
-
|
|
1005
|
+
mutationFn: async (args) => {
|
|
1006
|
+
if (!client) {
|
|
1007
|
+
throw new MissingClientError("useRescueOtherConfidentialToken", "airdrop-base");
|
|
1008
|
+
}
|
|
1009
|
+
return client.rescueOtherConfidentialToken(args);
|
|
374
1010
|
}
|
|
375
1011
|
});
|
|
376
1012
|
}
|
|
377
|
-
function
|
|
378
|
-
const { client } =
|
|
1013
|
+
function useRevokeComplianceDelegate(options) {
|
|
1014
|
+
const { client, chainId } = useMemoComplianceManagerClient(options);
|
|
1015
|
+
const queryClient = useQueryClient();
|
|
379
1016
|
return useMutation({
|
|
380
|
-
mutationFn: async (
|
|
381
|
-
if (!client)
|
|
382
|
-
|
|
1017
|
+
mutationFn: async (args) => {
|
|
1018
|
+
if (!client) {
|
|
1019
|
+
throw new MissingClientError("useRevokeComplianceDelegate", "compliance-manager");
|
|
1020
|
+
}
|
|
1021
|
+
return client.revokeDelegate(args);
|
|
1022
|
+
},
|
|
1023
|
+
onSuccess: (_hash, variables) => {
|
|
1024
|
+
const scope = { chainId, address: options.address };
|
|
1025
|
+
void queryClient.invalidateQueries({ queryKey: airdropKeys.complianceInfo(scope) });
|
|
1026
|
+
void queryClient.invalidateQueries({
|
|
1027
|
+
queryKey: airdropKeys.activeDelegate(scope, variables.delegate)
|
|
1028
|
+
});
|
|
383
1029
|
}
|
|
384
1030
|
});
|
|
385
1031
|
}
|
|
386
|
-
function
|
|
387
|
-
const { client } =
|
|
1032
|
+
function useRotateMerkleRoot(options) {
|
|
1033
|
+
const { client, chainId } = useMemoMerkleAirdropClient(options);
|
|
1034
|
+
const encryptorSourceRef = useRef(options.encryptor);
|
|
1035
|
+
encryptorSourceRef.current = options.encryptor;
|
|
1036
|
+
const queryClient = useQueryClient();
|
|
1037
|
+
return useMutation({
|
|
1038
|
+
mutationFn: async (args) => {
|
|
1039
|
+
if (!client) {
|
|
1040
|
+
throw new MissingClientError("useRotateMerkleRoot", "merkle-airdrop");
|
|
1041
|
+
}
|
|
1042
|
+
return rotateMerkleRoot({
|
|
1043
|
+
airdrop: client,
|
|
1044
|
+
recipients: args.recipients,
|
|
1045
|
+
encryptor: () => resolveEncryptor(encryptorSourceRef.current),
|
|
1046
|
+
...args.submitter !== void 0 ? { submitter: args.submitter } : {},
|
|
1047
|
+
...args.account !== void 0 ? { account: args.account } : {}
|
|
1048
|
+
});
|
|
1049
|
+
},
|
|
1050
|
+
onSuccess: () => {
|
|
1051
|
+
void queryClient.invalidateQueries({
|
|
1052
|
+
queryKey: airdropKeys.merkleRoot({ chainId, address: options.address })
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
function useSignClaimAuthorization(options) {
|
|
1058
|
+
const { walletClient, chainId } = useMemoAirdropBaseClient(options);
|
|
388
1059
|
return useMutation({
|
|
389
|
-
mutationFn: async (
|
|
390
|
-
if (!
|
|
391
|
-
|
|
1060
|
+
mutationFn: async (args) => {
|
|
1061
|
+
if (!walletClient) {
|
|
1062
|
+
throw new MissingWalletClientError("useSignClaimAuthorization");
|
|
1063
|
+
}
|
|
1064
|
+
if (chainId === void 0) {
|
|
1065
|
+
throw new MissingClientError("useSignClaimAuthorization", "airdrop-base");
|
|
1066
|
+
}
|
|
1067
|
+
return signClaimAuthorization({
|
|
1068
|
+
walletClient,
|
|
1069
|
+
airdrop: options.address,
|
|
1070
|
+
chainId,
|
|
1071
|
+
recipient: args.recipient,
|
|
1072
|
+
encryptedAmountHandle: args.encryptedAmountHandle,
|
|
1073
|
+
dedupId: args.dedupId,
|
|
1074
|
+
deadline: args.deadline,
|
|
1075
|
+
account: args.account
|
|
1076
|
+
});
|
|
392
1077
|
}
|
|
393
1078
|
});
|
|
394
1079
|
}
|
|
395
|
-
function
|
|
396
|
-
const { client } =
|
|
1080
|
+
function useWithdrawGasFee(options) {
|
|
1081
|
+
const { client } = useMemoAirdropBaseClient(options);
|
|
397
1082
|
return useMutation({
|
|
398
|
-
mutationFn: async (
|
|
399
|
-
if (!client)
|
|
400
|
-
|
|
1083
|
+
mutationFn: async (args) => {
|
|
1084
|
+
if (!client) {
|
|
1085
|
+
throw new MissingClientError("useWithdrawGasFee", "airdrop-base");
|
|
1086
|
+
}
|
|
1087
|
+
return client.withdrawGasFee(args);
|
|
401
1088
|
}
|
|
402
1089
|
});
|
|
403
1090
|
}
|
|
404
|
-
function
|
|
405
|
-
const { client } =
|
|
1091
|
+
function useAdminBatchDiscloseBalanceToParties(options) {
|
|
1092
|
+
const { client } = useMemoAirdropBaseClient(options);
|
|
406
1093
|
return useMutation({
|
|
407
|
-
mutationFn: async (
|
|
408
|
-
if (!client)
|
|
409
|
-
|
|
1094
|
+
mutationFn: async (args) => {
|
|
1095
|
+
if (!client) {
|
|
1096
|
+
throw new MissingClientError("useAdminBatchDiscloseBalanceToParties", "airdrop-base");
|
|
1097
|
+
}
|
|
1098
|
+
return client.adminBatchDiscloseBalanceToParties(args);
|
|
410
1099
|
}
|
|
411
1100
|
});
|
|
412
1101
|
}
|
|
413
|
-
function
|
|
414
|
-
const { client } =
|
|
1102
|
+
function useAdminDiscloseBalanceToParty(options) {
|
|
1103
|
+
const { client } = useMemoAirdropBaseClient(options);
|
|
415
1104
|
return useMutation({
|
|
416
|
-
mutationFn: async (
|
|
417
|
-
if (!client)
|
|
418
|
-
|
|
1105
|
+
mutationFn: async (args) => {
|
|
1106
|
+
if (!client) {
|
|
1107
|
+
throw new MissingClientError("useAdminDiscloseBalanceToParty", "airdrop-base");
|
|
1108
|
+
}
|
|
1109
|
+
return client.adminDiscloseBalanceToParty(args);
|
|
419
1110
|
}
|
|
420
1111
|
});
|
|
421
1112
|
}
|
|
422
|
-
function
|
|
423
|
-
const { client } =
|
|
1113
|
+
function useAdminGetCurrentBalance(options) {
|
|
1114
|
+
const { client } = useMemoAirdropBaseClient(options);
|
|
424
1115
|
return useMutation({
|
|
425
|
-
mutationFn: async (
|
|
426
|
-
if (!client)
|
|
427
|
-
|
|
1116
|
+
mutationFn: async (args) => {
|
|
1117
|
+
if (!client) {
|
|
1118
|
+
throw new MissingClientError("useAdminGetCurrentBalance", "airdrop-base");
|
|
1119
|
+
}
|
|
1120
|
+
return client.adminGetCurrentBalance(args ?? {});
|
|
428
1121
|
}
|
|
429
1122
|
});
|
|
430
1123
|
}
|
|
431
|
-
function
|
|
432
|
-
const { client } =
|
|
1124
|
+
function useAccessEcdsaClaimAmount(options) {
|
|
1125
|
+
const { client } = useMemoEcdsaAirdropClient(options);
|
|
433
1126
|
return useMutation({
|
|
434
|
-
mutationFn: async (
|
|
435
|
-
if (!client)
|
|
436
|
-
|
|
1127
|
+
mutationFn: async (args) => {
|
|
1128
|
+
if (!client) {
|
|
1129
|
+
throw new MissingClientError("useAccessEcdsaClaimAmount", "ecdsa-airdrop");
|
|
1130
|
+
}
|
|
1131
|
+
return client.getClaimAmount(args);
|
|
437
1132
|
}
|
|
438
1133
|
});
|
|
439
1134
|
}
|
|
440
|
-
function
|
|
441
|
-
const {
|
|
1135
|
+
function useAccessMerkleClaimAmount(options) {
|
|
1136
|
+
const { client } = useMemoMerkleAirdropClient(options);
|
|
442
1137
|
return useMutation({
|
|
443
1138
|
mutationFn: async (args) => {
|
|
444
|
-
if (!
|
|
445
|
-
throw new
|
|
1139
|
+
if (!client) {
|
|
1140
|
+
throw new MissingClientError("useAccessMerkleClaimAmount", "merkle-airdrop");
|
|
446
1141
|
}
|
|
447
|
-
return
|
|
448
|
-
walletClient,
|
|
449
|
-
airdropAddress: args.airdropAddress,
|
|
450
|
-
recipient: args.recipient,
|
|
451
|
-
encryptedAmountHandle: args.encryptedAmountHandle
|
|
452
|
-
});
|
|
1142
|
+
return client.getClaimAmount(args);
|
|
453
1143
|
}
|
|
454
1144
|
});
|
|
455
1145
|
}
|
|
456
1146
|
|
|
457
|
-
export {
|
|
1147
|
+
export { useAccessEcdsaClaimAmount, useAccessMerkleClaimAmount, useAddComplianceDelegate, useAdminBatchDiscloseBalanceToParties, useAdminDiscloseBalanceToParty, useAdminGetCurrentBalance, useAirdropConfig, useAirdropDeploymentMode, useAirdropGasFee, useAirdropGrantRole, useAirdropHasRole, useAirdropPause, useAirdropPaused, useAirdropRenounceRole, useAirdropRevokeRole, useAirdropRoleAdmin, useAirdropRoleConstants, useAirdropRoleMembers, useAirdropToken, useAirdropUpgradeToAndCall, useAirdropWindow, useBatchDiscloseHandlesToParty, useBuildMerkleCampaign, useClaimedAmount, useComplianceGrantRole, useComplianceHasRole, useComplianceInfo, useComplianceManager, useComplianceManagerOf, useComplianceRenounceRole, useComplianceRevokeRole, useComplianceRoleConstants, useComplianceRoleMembers, useCreateAndFundEcdsaAirdrop, useCreateAndFundMerkleAirdrop, useCreateEcdsaAirdrop, useCreateMerkleAirdrop, useDiscloseHandleToParty, useEcdsaClaim, useEcdsaClaimAndUnwrap, useEcdsaDomain, useEffectiveDelegateToCompliance, useEffectiveUpgradeable, useEncryptCampaignAmounts, useExtendClaimWindow, useFactoryFees, useFactoryRegistry, useFundAirdrop, useGrantInstanceRoles, useIsActiveDelegate, useIsMerkleRootMutable, useIsSignatureValid, useMerkleClaim, useMerkleClaimAndUnwrap, useMerkleRoot, usePlanMerkleCampaign, usePreflightClaim, usePreflightCreateAirdrop, useRescueERC20, useRescueOtherConfidentialToken, useRevokeComplianceDelegate, useRotateMerkleRoot, useSetMerkleRoot, useSignClaimAuthorization, useWithdrawConfidential, useWithdrawGasFee };
|