@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,15 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Account, Address } from "viem";
|
|
3
|
-
import type { TxHash } from "../../core/brands.js";
|
|
4
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
-
export interface UseAirdropFactoryDisableCustomFeeArgs {
|
|
6
|
-
campaignCreator: Address;
|
|
7
|
-
account?: Account | Address;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Admin: remove a per-creator fee override, reverting to `defaultGasFee`.
|
|
11
|
-
* Requires `FEE_MANAGER_ROLE`.
|
|
12
|
-
*
|
|
13
|
-
* After success, invalidate `useFactoryCustomFee({ creator: campaignCreator })`.
|
|
14
|
-
*/
|
|
15
|
-
export declare function useAirdropFactoryDisableCustomFee(options?: BaseHookOptions): UseMutationResult<TxHash, Error, UseAirdropFactoryDisableCustomFeeArgs>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Address } from "viem";
|
|
3
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
-
/**
|
|
5
|
-
* Read the factory's current fee collector address — the account authorized to
|
|
6
|
-
* call `withdrawGasFee` on each deployed airdrop clone.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* const { data: feeCollector } = useAirdropFactoryFeeCollector();
|
|
10
|
-
*/
|
|
11
|
-
export declare function useAirdropFactoryFeeCollector(options?: BaseHookOptions): UseQueryResult<Address, Error>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Hex } from "viem";
|
|
3
|
-
import { type AirdropParams } from "../types.js";
|
|
4
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
-
export interface UseAirdropFactoryInitCodeHashArgs extends BaseHookOptions {
|
|
6
|
-
params?: AirdropParams;
|
|
7
|
-
gasFee?: bigint;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Read the init-code hash the factory would use to CREATE2 an airdrop clone
|
|
11
|
-
* with the given `params` + `gasFee`. Mirrors Solidity's `getInitCodeHash`
|
|
12
|
-
* selector.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* const { data: initCodeHash } = useAirdropFactoryInitCodeHash({ params, gasFee });
|
|
16
|
-
*/
|
|
17
|
-
export declare function useAirdropFactoryInitCodeHash(args?: UseAirdropFactoryInitCodeHashArgs): UseQueryResult<Hex, Error>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Account, Address } from "viem";
|
|
3
|
-
import type { TxHash } from "../../core/brands.js";
|
|
4
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
-
export interface UseAirdropFactorySetCustomFeeArgs {
|
|
6
|
-
campaignCreator: Address;
|
|
7
|
-
gasFee: bigint;
|
|
8
|
-
account?: Account | Address;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Admin: install a per-creator gas-fee override on the factory. Takes
|
|
12
|
-
* precedence over `defaultGasFee` for all airdrops `campaignCreator` deploys
|
|
13
|
-
* after the override. Requires `FEE_MANAGER_ROLE`.
|
|
14
|
-
*
|
|
15
|
-
* After success, invalidate `useFactoryCustomFee({ creator: campaignCreator })`.
|
|
16
|
-
*/
|
|
17
|
-
export declare function useAirdropFactorySetCustomFee(options?: BaseHookOptions): UseMutationResult<TxHash, Error, UseAirdropFactorySetCustomFeeArgs>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Account, Address } from "viem";
|
|
3
|
-
import type { TxHash } from "../../core/brands.js";
|
|
4
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
-
export interface UseAirdropFactorySetDefaultGasFeeArgs {
|
|
6
|
-
newGasFee: bigint;
|
|
7
|
-
account?: Account | Address;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Admin: change the factory-wide default per-claim gas fee. Requires
|
|
11
|
-
* `FEE_MANAGER_ROLE`. Only affects airdrops deployed AFTER this call — already
|
|
12
|
-
* deployed clones carry the gas fee as an immutable arg.
|
|
13
|
-
*
|
|
14
|
-
* After success, invalidate `useFactoryDefaultGasFee()`.
|
|
15
|
-
*/
|
|
16
|
-
export declare function useAirdropFactorySetDefaultGasFee(options?: BaseHookOptions): UseMutationResult<TxHash, Error, UseAirdropFactorySetDefaultGasFeeArgs>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Account, Address } from "viem";
|
|
3
|
-
import type { TxHash } from "../../core/brands.js";
|
|
4
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
-
export interface UseAirdropFactorySetFeeCollectorArgs {
|
|
6
|
-
newFeeCollector: Address;
|
|
7
|
-
account?: Account | Address;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Admin: change the factory's fee collector address. Requires
|
|
11
|
-
* `FEE_MANAGER_ROLE`.
|
|
12
|
-
*
|
|
13
|
-
* After success, invalidate `useFactoryFeeCollector()`.
|
|
14
|
-
*/
|
|
15
|
-
export declare function useAirdropFactorySetFeeCollector(options?: BaseHookOptions): UseMutationResult<TxHash, Error, UseAirdropFactorySetFeeCollectorArgs>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
-
/**
|
|
4
|
-
* Read whether the current chain timestamp is past `endTime` on this airdrop
|
|
5
|
-
* clone. Free chain read — no gas, no tx.
|
|
6
|
-
*/
|
|
7
|
-
export declare function useAirdropHasClaimEnded(options: AirdropHookOptions): UseQueryResult<boolean, Error>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
-
/**
|
|
4
|
-
* Read whether the current chain timestamp is past `START_TIME` on this
|
|
5
|
-
* airdrop clone. Free chain read — no gas, no tx.
|
|
6
|
-
*/
|
|
7
|
-
export declare function useAirdropHasClaimStarted(options: AirdropHookOptions): UseQueryResult<boolean, Error>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
-
/**
|
|
4
|
-
* Read whether the airdrop is currently within its claim window AND not paused.
|
|
5
|
-
* Free chain read — no gas, no tx.
|
|
6
|
-
*
|
|
7
|
-
* Use this as a pre-claim UI gate.
|
|
8
|
-
*/
|
|
9
|
-
export declare function useAirdropIsClaimWindowActive(options: AirdropHookOptions): UseQueryResult<boolean, Error>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
-
/**
|
|
4
|
-
* Read whether claims are currently paused by the admin on this airdrop clone.
|
|
5
|
-
*
|
|
6
|
-
* After a successful `useSetPaused`, invalidate this query.
|
|
7
|
-
*/
|
|
8
|
-
export declare function useAirdropIsPaused(options: AirdropHookOptions): UseQueryResult<boolean, Error>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Address, Hex } from "viem";
|
|
3
|
-
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
-
export interface UseAirdropIsSignatureClaimedArgs extends AirdropHookOptions {
|
|
5
|
-
/** Recipient address from the claim authorization. */
|
|
6
|
-
user?: Address;
|
|
7
|
-
/** `externalEuint64` handle (as `Hex`) from the claim payload. */
|
|
8
|
-
encryptedAmountHandle?: Hex;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Check whether a claim has been consumed for a `(user, encryptedAmountHandle)`
|
|
12
|
-
* pair on this airdrop clone. The contract recomputes the struct hash
|
|
13
|
-
* internally and looks it up in storage.
|
|
14
|
-
*
|
|
15
|
-
* Most frontends want this hook over {@link useAirdropClaimedSignatures} —
|
|
16
|
-
* pass the same `user` + `encryptedAmountHandle` that appear in the
|
|
17
|
-
* admin-issued claim payload.
|
|
18
|
-
*
|
|
19
|
-
* After a successful {@link useClaim}, invalidate this query for the claimed
|
|
20
|
-
* `(user, encryptedAmountHandle)` pair.
|
|
21
|
-
*/
|
|
22
|
-
export declare function useAirdropIsSignatureClaimed(args: UseAirdropIsSignatureClaimedArgs): UseQueryResult<boolean, Error>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Address, Hex } from "viem";
|
|
3
|
-
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
-
export interface UseAirdropIsSignatureValidArgs extends AirdropHookOptions {
|
|
5
|
-
/** `externalEuint64` handle (as `Hex`) from the claim payload. */
|
|
6
|
-
encryptedAmountHandle?: Hex;
|
|
7
|
-
/** EIP-712 admin signature over `Claim(address recipient, bytes32 encryptedAmount)`. */
|
|
8
|
-
signature?: Hex;
|
|
9
|
-
/**
|
|
10
|
-
* Caller address — the contract recomputes the struct hash over
|
|
11
|
-
* `(msg.sender, encryptedAmount)`, so validity is caller-specific.
|
|
12
|
-
* Defaults to the connected wallet via wagmi's account hook (v2
|
|
13
|
-
* `useAccount()` / v3 `useConnection()`); pass explicitly to check on
|
|
14
|
-
* behalf of another address.
|
|
15
|
-
*/
|
|
16
|
-
caller?: Address;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Check whether an admin-issued claim authorization is valid for a specific
|
|
20
|
-
* caller, without consuming it.
|
|
21
|
-
*
|
|
22
|
-
* The query has **two distinct failure shapes** that must be handled separately:
|
|
23
|
-
*
|
|
24
|
-
* - `data === false`: the signature is structurally valid but fails the on-chain
|
|
25
|
-
* check — already claimed, claim window inactive, or signer lacks
|
|
26
|
-
* `DEFAULT_ADMIN_ROLE`.
|
|
27
|
-
* - `error?.code === "TOKENOPS_INVALID_SIGNATURE"`: the signature bytes are
|
|
28
|
-
* structurally malformed (wrong length, invalid `s`-value range, unparseable).
|
|
29
|
-
* The on-chain `ECDSA.recover` reverts before the boolean logic runs, so this
|
|
30
|
-
* shows up on `error`, not on `data`.
|
|
31
|
-
*
|
|
32
|
-
* ```ts
|
|
33
|
-
* const sig = useAirdropIsSignatureValid({ address, encryptedAmountHandle, signature, caller });
|
|
34
|
-
* if (sig.error?.code === "TOKENOPS_INVALID_SIGNATURE") {
|
|
35
|
-
* // malformed signature bytes
|
|
36
|
-
* } else if (sig.data === false) {
|
|
37
|
-
* // wrong signer, already claimed, or window closed
|
|
38
|
-
* } else if (sig.data === true) {
|
|
39
|
-
* // ready to claim
|
|
40
|
-
* }
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* The result is caller-specific (the on-chain check binds to `msg.sender`).
|
|
44
|
-
* `caller` defaults to the connected wallet; the query stays disabled until
|
|
45
|
-
* a caller is available, and the caller is part of the query key so cached
|
|
46
|
-
* results don't bleed across account switches.
|
|
47
|
-
*
|
|
48
|
-
* Use this to show a pre-claim validation state in the UI before asking the
|
|
49
|
-
* user to pay gas.
|
|
50
|
-
*/
|
|
51
|
-
export declare function useAirdropIsSignatureValid(args: UseAirdropIsSignatureValidArgs): UseQueryResult<boolean, Error>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { type AirdropHookOptions } from "./_shared.js";
|
|
3
|
-
/**
|
|
4
|
-
* Read the airdrop clone's immutable `START_TIME` — the unix timestamp when
|
|
5
|
-
* claims become available.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* const { data: startTime } = useAirdropStartTime({ address: airdropAddress });
|
|
9
|
-
*/
|
|
10
|
-
export declare function useAirdropStartTime(options: AirdropHookOptions): UseQueryResult<number, Error>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Account, Address, Hex } from "viem";
|
|
3
|
-
import { type AirdropHookOptions } from "./_shared.js";
|
|
4
|
-
export interface UseAirdropWithdrawGasFeeArgs {
|
|
5
|
-
recipient: Address;
|
|
6
|
-
/** Amount of ETH to withdraw (in wei). Pass `0n` to withdraw the entire balance. */
|
|
7
|
-
amount: bigint;
|
|
8
|
-
account?: Account | Address;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Fee collector: withdraw collected ETH gas fees from the airdrop clone.
|
|
12
|
-
* Requires `FEE_COLLECTOR_ROLE`. Pass `amount = 0n` to withdraw the entire
|
|
13
|
-
* balance.
|
|
14
|
-
*/
|
|
15
|
-
export declare function useAirdropWithdrawGasFee(options: AirdropHookOptions): UseMutationResult<Hex, Error, UseAirdropWithdrawGasFeeArgs>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Account, Address } from "viem";
|
|
3
|
-
import type { TxHash } from "../../core/brands.js";
|
|
4
|
-
import { type AirdropHookOptions } from "./_shared.js";
|
|
5
|
-
export interface UseAirdropWithdrawOtherConfidentialTokenArgs {
|
|
6
|
-
tokenAddress: Address;
|
|
7
|
-
recipient: Address;
|
|
8
|
-
account?: Account | Address;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Admin: rescue accidentally sent ERC-7984 confidential tokens (other than
|
|
12
|
-
* this airdrop's configured `TOKEN`). Requires `DEFAULT_ADMIN_ROLE`.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useAirdropWithdrawOtherConfidentialToken(options: AirdropHookOptions): UseMutationResult<TxHash, Error, UseAirdropWithdrawOtherConfidentialTokenArgs>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Account, Address } from "viem";
|
|
3
|
-
import type { TxHash } from "../../core/brands.js";
|
|
4
|
-
import { type AirdropHookOptions } from "./_shared.js";
|
|
5
|
-
export interface UseAirdropWithdrawOtherTokenArgs {
|
|
6
|
-
tokenAddress: Address;
|
|
7
|
-
recipient: Address;
|
|
8
|
-
account?: Account | Address;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Admin: rescue accidentally sent ERC-20 (non-confidential) tokens. Requires
|
|
12
|
-
* `DEFAULT_ADMIN_ROLE`.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useAirdropWithdrawOtherToken(options: AirdropHookOptions): UseMutationResult<TxHash, Error, UseAirdropWithdrawOtherTokenArgs>;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Hex } from "viem";
|
|
3
|
-
import type { ClaimArgs } from "../airdrop.js";
|
|
4
|
-
import { type AirdropHookOptions } from "./_shared.js";
|
|
5
|
-
/**
|
|
6
|
-
* Claim tokens from an airdrop using an EIP-712 admin signature. Submits the
|
|
7
|
-
* admin-issued `{ encryptedInput, signature }` pair verbatim — the SDK does
|
|
8
|
-
* NOT re-encrypt on the recipient side, because the signature commits to the
|
|
9
|
-
* exact `bytes32` handle and any re-encryption would invalidate it.
|
|
10
|
-
*
|
|
11
|
-
* Attaches `GAS_FEE()` ETH as `msg.value` automatically unless `args.value` is
|
|
12
|
-
* set.
|
|
13
|
-
*
|
|
14
|
-
* The admin builds `encryptedInput` server-side via
|
|
15
|
-
* {@link encryptUint64} with `userAddress: recipient` (Zama input proofs are
|
|
16
|
-
* bound to the recipient), then signs the resulting handle with
|
|
17
|
-
* {@link signClaimAuthorization}. Deliver `(encryptedInput, signature)` to
|
|
18
|
-
* the recipient via your channel of choice; the recipient passes the pair to
|
|
19
|
-
* this hook unchanged.
|
|
20
|
-
*
|
|
21
|
-
* After a successful claim, invalidate
|
|
22
|
-
* `useAirdropIsSignatureClaimed({ user, encryptedAmountHandle })` and any
|
|
23
|
-
* UI counts you computed off it.
|
|
24
|
-
*
|
|
25
|
-
* **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
|
|
26
|
-
*
|
|
27
|
-
* **An unfunded pool is the opposite case — it reverts loudly.** Do not
|
|
28
|
-
* generalize the silent-zero rule above to a clone whose pool was never
|
|
29
|
-
* funded: that claim throws {@link FheHandleNotAllowedError} (the FHEVM ACL
|
|
30
|
-
* rejects `FHE.allowTransient` on an uninitialized handle). It is not
|
|
31
|
-
* preflight-detectable either — the pool balance is an encrypted `euint64` the
|
|
32
|
-
* SDK cannot read in plaintext — so surface the error rather than reporting a
|
|
33
|
-
* silent no-op success. See `preflightClaim` for the same caveat.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* const claim = useClaim({ address: airdropAddress });
|
|
37
|
-
* claim.mutate({ encryptedInput, signature });
|
|
38
|
-
*/
|
|
39
|
-
export declare function useClaim(options: AirdropHookOptions): UseMutationResult<Hex, Error, ClaimArgs>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Address } from "viem";
|
|
3
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
-
/**
|
|
5
|
-
* Read the FHE-airdrop factory's current `implementation()` address — the
|
|
6
|
-
* LibClone target every new airdrop clone delegates to.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* const { data: implementation } = useConfidentialAirdropFactoryImplementation();
|
|
10
|
-
*/
|
|
11
|
-
export declare function useConfidentialAirdropFactoryImplementation(options?: BaseHookOptions): UseQueryResult<Address, Error>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { CreateAirdropResult, CreateAndFundAirdropArgs } from "../factory.js";
|
|
3
|
-
import { type FactoryHookOptions } from "./_shared.js";
|
|
4
|
-
/**
|
|
5
|
-
* Deploy AND fund a new airdrop clone in a single transaction. The SDK
|
|
6
|
-
* encrypts the plaintext `amount` into an `externalEuint64` and submits it
|
|
7
|
-
* with an input proof — callers never handle ciphertext.
|
|
8
|
-
*
|
|
9
|
-
* **Encryptor resolution.** The hook-level `encryptor` (from
|
|
10
|
-
* {@link FactoryHookOptions}) is forwarded lazily to the SDK client. You can
|
|
11
|
-
* also pass `encryptor` per-mutation via `args.encryptor` to override it. If
|
|
12
|
-
* neither is present, the SDK throws `Missing encryptor — pass encryptor…`
|
|
13
|
-
* verbatim.
|
|
14
|
-
*
|
|
15
|
-
* **Prerequisites:** caller must have set the factory as an operator on the
|
|
16
|
-
* token: `token.setOperator(factoryAddress, deadline)`.
|
|
17
|
-
*
|
|
18
|
-
* **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
|
|
19
|
-
*
|
|
20
|
-
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
21
|
-
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
22
|
-
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
23
|
-
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
24
|
-
* transparent TTT test token uses 18 decimals.
|
|
25
|
-
*
|
|
26
|
-
* After success, invalidate factory queries that depend on per-creator state:
|
|
27
|
-
*
|
|
28
|
-
* ```ts
|
|
29
|
-
* function Component() {
|
|
30
|
-
* const queryClient = useQueryClient();
|
|
31
|
-
* const zamaSDK = useZamaSDK();
|
|
32
|
-
* const create = useCreateAndFundConfidentialAirdrop({ encryptor: () => zamaSDK.relayer });
|
|
33
|
-
* create.mutate(args, {
|
|
34
|
-
* onSuccess: () => {
|
|
35
|
-
* queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
|
|
36
|
-
* },
|
|
37
|
-
* });
|
|
38
|
-
* }
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export declare function useCreateAndFundConfidentialAirdrop(options?: FactoryHookOptions): UseMutationResult<CreateAirdropResult, Error, CreateAndFundAirdropArgs>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { CreateAirdropResult, CreateAndFundAirdropArgs } from "../factory.js";
|
|
3
|
-
import { type FactoryHookOptions } from "./_shared.js";
|
|
4
|
-
/**
|
|
5
|
-
* **Recommended fund-on-create entry point.** Deploy AND fund a new airdrop
|
|
6
|
-
* clone in one tx, then resolve its address from the
|
|
7
|
-
* `ConfidentialAirdropCreated` event in the receipt.
|
|
8
|
-
*
|
|
9
|
-
* Use this in place of {@link useCreateAndFundConfidentialAirdrop} when you
|
|
10
|
-
* need the deployed clone address — for example to navigate to a detail page
|
|
11
|
-
* immediately after the deploy.
|
|
12
|
-
*
|
|
13
|
-
* Internally: `createAndFundConfidentialAirdrop` → `waitForTransactionReceipt`
|
|
14
|
-
* → `parseEventLogs({ eventName: "ConfidentialAirdropCreated" })`.
|
|
15
|
-
*
|
|
16
|
-
* **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
|
|
17
|
-
*
|
|
18
|
-
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
19
|
-
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
20
|
-
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
21
|
-
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
22
|
-
* transparent TTT test token uses 18 decimals.
|
|
23
|
-
*
|
|
24
|
-
* After a successful create, invalidate factory queries that depend on
|
|
25
|
-
* per-creator state:
|
|
26
|
-
*
|
|
27
|
-
* ```ts
|
|
28
|
-
* function Component() {
|
|
29
|
-
* const queryClient = useQueryClient();
|
|
30
|
-
* const zamaSDK = useZamaSDK();
|
|
31
|
-
* const create = useCreateAndFundConfidentialAirdropAndGetAddress({
|
|
32
|
-
* encryptor: () => zamaSDK.relayer,
|
|
33
|
-
* });
|
|
34
|
-
* create.mutate(args, {
|
|
35
|
-
* onSuccess: ({ airdrop }) => {
|
|
36
|
-
* queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
|
|
37
|
-
* navigate(`/airdrop/${airdrop}`);
|
|
38
|
-
* },
|
|
39
|
-
* });
|
|
40
|
-
* }
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* const create = useCreateAndFundConfidentialAirdropAndGetAddress();
|
|
45
|
-
* create.mutate({ params, userSalt, amount });
|
|
46
|
-
* // create.data → { hash, airdrop }
|
|
47
|
-
*/
|
|
48
|
-
export declare function useCreateAndFundConfidentialAirdropAndGetAddress(options?: FactoryHookOptions): UseMutationResult<CreateAirdropResult, Error, CreateAndFundAirdropArgs>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { CreateAirdropArgs, CreateAirdropResult } from "../factory.js";
|
|
3
|
-
import { type FactoryHookOptions } from "./_shared.js";
|
|
4
|
-
/**
|
|
5
|
-
* Deploy a new airdrop clone via the factory. Raw-hash-only variant — parse
|
|
6
|
-
* the `ConfidentialAirdropCreated` event yourself if you need the address.
|
|
7
|
-
*
|
|
8
|
-
* **For the common "deploy and learn the address" flow, prefer
|
|
9
|
-
* {@link useCreateConfidentialAirdropAndGetAddress}** — it's a one-call wrapper
|
|
10
|
-
* that returns `{ hash, airdrop }`.
|
|
11
|
-
*
|
|
12
|
-
* After a successful create, invalidate factory queries that depend on
|
|
13
|
-
* per-creator state:
|
|
14
|
-
*
|
|
15
|
-
* ```ts
|
|
16
|
-
* const queryClient = useQueryClient();
|
|
17
|
-
* const create = useCreateConfidentialAirdrop();
|
|
18
|
-
* create.mutate(args, {
|
|
19
|
-
* onSuccess: () => {
|
|
20
|
-
* queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
|
|
21
|
-
* },
|
|
22
|
-
* });
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* const create = useCreateConfidentialAirdrop();
|
|
27
|
-
* create.mutate({ params, userSalt });
|
|
28
|
-
*/
|
|
29
|
-
export declare function useCreateConfidentialAirdrop(options?: FactoryHookOptions): UseMutationResult<CreateAirdropResult, Error, CreateAirdropArgs>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { CreateAirdropResult, CreateAirdropArgs } from "../factory.js";
|
|
3
|
-
import { type FactoryHookOptions } from "./_shared.js";
|
|
4
|
-
/**
|
|
5
|
-
* **Recommended factory entry point.** Deploy a new
|
|
6
|
-
* `ConfidentialAirdropCloneable` clone and resolve its address from the
|
|
7
|
-
* `ConfidentialAirdropCreated` event in the tx receipt — in one call.
|
|
8
|
-
*
|
|
9
|
-
* Internally: `createConfidentialAirdrop` → `waitForTransactionReceipt` →
|
|
10
|
-
* `parseEventLogs({ eventName: "ConfidentialAirdropCreated" })`.
|
|
11
|
-
*
|
|
12
|
-
* After a successful create, invalidate factory queries that depend on
|
|
13
|
-
* per-creator state:
|
|
14
|
-
*
|
|
15
|
-
* ```ts
|
|
16
|
-
* const queryClient = useQueryClient();
|
|
17
|
-
* const create = useCreateConfidentialAirdropAndGetAddress();
|
|
18
|
-
* create.mutate(args, {
|
|
19
|
-
* onSuccess: ({ airdrop }) => {
|
|
20
|
-
* queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
|
|
21
|
-
* navigate(`/airdrop/${airdrop}`);
|
|
22
|
-
* },
|
|
23
|
-
* });
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* const create = useCreateConfidentialAirdropAndGetAddress();
|
|
28
|
-
* create.mutate({ params, userSalt });
|
|
29
|
-
* // create.data → { hash, airdrop }
|
|
30
|
-
*/
|
|
31
|
-
export declare function useCreateConfidentialAirdropAndGetAddress(options?: FactoryHookOptions): UseMutationResult<CreateAirdropResult, Error, CreateAirdropArgs>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Account, Address, Hex } from "viem";
|
|
3
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
-
export interface UseDisableCustomFeeArgs {
|
|
5
|
-
campaignCreator: Address;
|
|
6
|
-
account?: Account | Address;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Admin: remove a per-creator fee override, reverting to `defaultGasFee`.
|
|
10
|
-
* Requires `FEE_MANAGER_ROLE`.
|
|
11
|
-
*
|
|
12
|
-
* After success, invalidate `useFactoryCustomFee({ creator: campaignCreator })`.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useDisableCustomFee(options?: BaseHookOptions): UseMutationResult<Hex, Error, UseDisableCustomFeeArgs>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Address } from "viem";
|
|
3
|
-
import { type CustomFee } from "../types.js";
|
|
4
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
-
export interface UseFactoryCustomFeeArgs extends BaseHookOptions {
|
|
6
|
-
/** Address whose per-creator fee override to read. Hook is disabled until set. */
|
|
7
|
-
creator?: Address;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Read the per-creator fee override set on the factory for `creator`. Returns
|
|
11
|
-
* `{ enabled: false, gasFee: 0n }` when no override exists.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* const { data: customFee } = useFactoryCustomFee({ creator });
|
|
15
|
-
* if (customFee?.enabled) { ... use customFee.gasFee ... }
|
|
16
|
-
*/
|
|
17
|
-
export declare function useFactoryCustomFee(args?: UseFactoryCustomFeeArgs): UseQueryResult<CustomFee, Error>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
3
|
-
/**
|
|
4
|
-
* Read the factory-wide default per-claim gas fee (in wei) — applied to new
|
|
5
|
-
* airdrop clones at deployment when the creator has no custom override.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* const { data: defaultGasFee } = useFactoryDefaultGasFee();
|
|
9
|
-
*/
|
|
10
|
-
export declare function useFactoryDefaultGasFee(options?: BaseHookOptions): UseQueryResult<bigint, Error>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Address } from "viem";
|
|
3
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
-
/**
|
|
5
|
-
* Read the factory's current fee collector address — the account authorized to
|
|
6
|
-
* call `withdrawGasFee` on each deployed airdrop clone.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* const { data: feeCollector } = useFactoryFeeCollector();
|
|
10
|
-
*/
|
|
11
|
-
export declare function useFactoryFeeCollector(options?: BaseHookOptions): UseQueryResult<Address, Error>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Hex } from "viem";
|
|
3
|
-
import { type AirdropParams } from "../types.js";
|
|
4
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
5
|
-
export interface UseFactoryInitCodeHashArgs extends BaseHookOptions {
|
|
6
|
-
params?: AirdropParams;
|
|
7
|
-
gasFee?: bigint;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Read the init-code hash the factory would use to CREATE2 an airdrop clone
|
|
11
|
-
* with the given `params` + `gasFee`. Mirrors Solidity's `getInitCodeHash`
|
|
12
|
-
* selector.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* const { data: initCodeHash } = useFactoryInitCodeHash({ params, gasFee });
|
|
16
|
-
*/
|
|
17
|
-
export declare function useFactoryInitCodeHash(args?: UseFactoryInitCodeHashArgs): UseQueryResult<Hex, Error>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Hex } from "viem";
|
|
3
|
-
import type { FundAirdropArgs } from "../factory.js";
|
|
4
|
-
import { type FactoryHookOptions } from "./_shared.js";
|
|
5
|
-
/**
|
|
6
|
-
* Fund an existing (or not-yet-deployed) airdrop clone with encrypted tokens
|
|
7
|
-
* via the factory. The SDK encrypts the plaintext `amount` into an
|
|
8
|
-
* `externalEuint64` and submits it with an input proof — callers never handle
|
|
9
|
-
* ciphertext.
|
|
10
|
-
*
|
|
11
|
-
* **Encryptor resolution.** The hook-level `encryptor` (from
|
|
12
|
-
* {@link FactoryHookOptions}) is forwarded lazily to the SDK client. You can
|
|
13
|
-
* also pass `encryptor` per-mutation via `args.encryptor` to override it. If
|
|
14
|
-
* neither is present, the SDK throws `Missing encryptor — pass encryptor…`
|
|
15
|
-
* verbatim.
|
|
16
|
-
*
|
|
17
|
-
* **Prerequisites:** caller must have set the factory as an operator on the
|
|
18
|
-
* token: `token.setOperator(factoryAddress, deadline)`.
|
|
19
|
-
*
|
|
20
|
-
* **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
|
|
21
|
-
*
|
|
22
|
-
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
23
|
-
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
24
|
-
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
25
|
-
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
26
|
-
* transparent TTT test token uses 18 decimals.
|
|
27
|
-
*
|
|
28
|
-
* **`args.gasFee` MUST match the fee active for `deployer` at airdrop creation
|
|
29
|
-
* time** — custom fee if `getCustomFee(deployer).enabled`, otherwise
|
|
30
|
-
* `defaultGasFee`. The factory derives the target clone address from this
|
|
31
|
-
* value via CREATE2; a mismatch funds the wrong (predicted) address.
|
|
32
|
-
*/
|
|
33
|
-
export declare function useFundConfidentialAirdrop(options?: FactoryHookOptions): UseMutationResult<Hex, Error, FundAirdropArgs>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Account, Address, Hex } from "viem";
|
|
3
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
-
export interface UseSetCustomFeeArgs {
|
|
5
|
-
campaignCreator: Address;
|
|
6
|
-
gasFee: bigint;
|
|
7
|
-
account?: Account | Address;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Admin: install a per-creator gas-fee override on the factory. Takes
|
|
11
|
-
* precedence over `defaultGasFee` for all airdrops `campaignCreator` deploys
|
|
12
|
-
* after the override. Requires `FEE_MANAGER_ROLE`.
|
|
13
|
-
*
|
|
14
|
-
* After success, invalidate `useFactoryCustomFee({ creator: campaignCreator })`.
|
|
15
|
-
*/
|
|
16
|
-
export declare function useSetCustomFee(options?: BaseHookOptions): UseMutationResult<Hex, Error, UseSetCustomFeeArgs>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Account, Address, Hex } from "viem";
|
|
3
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
-
export interface UseSetDefaultGasFeeArgs {
|
|
5
|
-
newGasFee: bigint;
|
|
6
|
-
account?: Account | Address;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Admin: change the factory-wide default per-claim gas fee. Requires
|
|
10
|
-
* `FEE_MANAGER_ROLE`. Only affects airdrops deployed AFTER this call — already
|
|
11
|
-
* deployed clones carry the gas fee as an immutable arg.
|
|
12
|
-
*
|
|
13
|
-
* After success, invalidate `useFactoryDefaultGasFee()`.
|
|
14
|
-
*/
|
|
15
|
-
export declare function useSetDefaultGasFee(options?: BaseHookOptions): UseMutationResult<Hex, Error, UseSetDefaultGasFeeArgs>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import type { Account, Address, Hex } from "viem";
|
|
3
|
-
import { type BaseHookOptions } from "./_shared.js";
|
|
4
|
-
export interface UseSetFeeCollectorArgs {
|
|
5
|
-
newFeeCollector: Address;
|
|
6
|
-
account?: Account | Address;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Admin: change the factory's fee collector address. Requires
|
|
10
|
-
* `FEE_MANAGER_ROLE`.
|
|
11
|
-
*
|
|
12
|
-
* After success, invalidate `useFactoryFeeCollector()`.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useSetFeeCollector(options?: BaseHookOptions): UseMutationResult<Hex, Error, UseSetFeeCollectorArgs>;
|