@tokenops/sdk 1.5.1 → 2.0.0-alpha.1

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.
Files changed (222) hide show
  1. package/CHANGELOG.md +198 -2
  2. package/CONTRIBUTING.md +4 -2
  3. package/README.md +146 -90
  4. package/SECURITY.md +7 -1
  5. package/SUPPORT.md +47 -0
  6. package/dist/{chunk-YQIBBEFJ.js → chunk-335Z2W67.js} +1 -1
  7. package/dist/{chunk-2NCLOQ56.cjs → chunk-3QHNYEQD.cjs} +77 -0
  8. package/dist/chunk-456VDDA3.js +370 -0
  9. package/dist/{chunk-SG65XWH7.js → chunk-4RAAATVY.js} +1 -3
  10. package/dist/{chunk-6BMP4ICG.js → chunk-4TSDNZQ3.js} +60 -2
  11. package/dist/{chunk-PUPKNW3R.cjs → chunk-5576FRT3.cjs} +30 -6
  12. package/dist/{chunk-AOP6HMPW.js → chunk-6GNR22OV.js} +75 -1
  13. package/dist/{chunk-NTZY6IB7.js → chunk-6NAVMWZQ.js} +4 -3
  14. package/dist/{chunk-C7BRZXJA.cjs → chunk-6PXXGACR.cjs} +8 -7
  15. package/dist/{chunk-IJFQ5L4I.js → chunk-74QFZ5MK.js} +4 -3
  16. package/dist/chunk-7AFPOE7N.cjs +59 -0
  17. package/dist/chunk-AXIPOR3C.js +56 -0
  18. package/dist/chunk-CTED3MTR.cjs +380 -0
  19. package/dist/{chunk-XGGTQQFH.js → chunk-DZHYSUGY.js} +28 -7
  20. package/dist/{chunk-OXTLPTO3.js → chunk-EAJ7SYHE.js} +4 -3
  21. package/dist/{chunk-V2PXZVBF.cjs → chunk-FGEB7RMY.cjs} +4 -4
  22. package/dist/chunk-GKKDAW44.js +8823 -0
  23. package/dist/{chunk-2PWNH3UE.js → chunk-H5POPGOZ.js} +63 -5
  24. package/dist/{chunk-W7IGCOVL.cjs → chunk-JQYC66TO.cjs} +9 -8
  25. package/dist/{chunk-PFXURMBZ.cjs → chunk-JZLGCTGK.cjs} +68 -8
  26. package/dist/{chunk-JYOTGRSO.cjs → chunk-KFRDLKMA.cjs} +61 -1
  27. package/dist/chunk-M4IT6DNJ.cjs +608 -0
  28. package/dist/{chunk-KLKI352M.cjs → chunk-MVDQMV25.cjs} +0 -3
  29. package/dist/chunk-NCVX3K2N.cjs +161 -0
  30. package/dist/chunk-NWFMBLSQ.js +4 -0
  31. package/dist/chunk-O5676ZWY.js +585 -0
  32. package/dist/chunk-PUX5VXDB.cjs +8845 -0
  33. package/dist/{chunk-IXLO7GO5.js → chunk-TWT3STIX.js} +46 -80
  34. package/dist/chunk-UG5RKLU2.cjs +6 -0
  35. package/dist/chunk-VP2B4WM2.js +154 -0
  36. package/dist/{chunk-5X5WL5CU.cjs → chunk-WJLECC22.cjs} +51 -88
  37. package/dist/{chunk-WENHUPZC.cjs → chunk-XAYGD4E4.cjs} +9 -8
  38. package/dist/core/addresses.d.ts +15 -3
  39. package/dist/core/brands.d.ts +8 -2
  40. package/dist/core/errors.d.ts +71 -10
  41. package/dist/core/preflight.d.ts +1 -0
  42. package/dist/fhe/erc7984-abi.d.ts +1 -0
  43. package/dist/fhe/index.cjs +34 -13
  44. package/dist/fhe/index.d.cts +1 -0
  45. package/dist/fhe/index.d.ts +1 -0
  46. package/dist/fhe/index.js +19 -6
  47. package/dist/fhe/mock-erc7984.d.ts +4 -4
  48. package/dist/fhe/operators.d.ts +160 -3
  49. package/dist/fhe/react/index.cjs +14 -0
  50. package/dist/fhe/react/index.d.cts +2 -0
  51. package/dist/fhe/react/index.d.ts +2 -0
  52. package/dist/fhe/react/index.js +6 -0
  53. package/dist/fhe/react/useEnsureOperator.d.ts +56 -0
  54. package/dist/fhe/react/useIsOperator.d.ts +54 -0
  55. package/dist/fhe/sepolia-encryptor-web.d.ts +18 -3
  56. package/dist/fhe/types.d.ts +6 -0
  57. package/dist/fhe-airdrop/abis/{cloneable.d.ts → airdrop-base.d.ts} +254 -396
  58. package/dist/fhe-airdrop/abis/compliance.d.ts +422 -0
  59. package/dist/fhe-airdrop/abis/ecdsa.d.ts +1316 -0
  60. package/dist/fhe-airdrop/abis/factory.d.ts +1319 -190
  61. package/dist/fhe-airdrop/abis/index.d.ts +5 -2
  62. package/dist/fhe-airdrop/abis/merkle.d.ts +1238 -0
  63. package/dist/fhe-airdrop/advanced/index.cjs +10 -12
  64. package/dist/fhe-airdrop/advanced/index.d.cts +34 -11
  65. package/dist/fhe-airdrop/advanced/index.d.ts +34 -11
  66. package/dist/fhe-airdrop/advanced/index.js +2 -8
  67. package/dist/fhe-airdrop/advanced/react/index.cjs +34 -48
  68. package/dist/fhe-airdrop/advanced/react/index.d.cts +9 -3
  69. package/dist/fhe-airdrop/advanced/react/index.d.ts +9 -3
  70. package/dist/fhe-airdrop/advanced/react/index.js +33 -48
  71. package/dist/fhe-airdrop/advanced/react/usePredictEcdsaAirdropAddress.d.ts +33 -0
  72. package/dist/fhe-airdrop/advanced/react/usePredictMerkleAirdropAddress.d.ts +27 -0
  73. package/dist/fhe-airdrop/airdrop-base.d.ts +600 -0
  74. package/dist/fhe-airdrop/campaign.d.ts +297 -0
  75. package/dist/fhe-airdrop/compliance.d.ts +302 -0
  76. package/dist/fhe-airdrop/constants.d.ts +33 -0
  77. package/dist/fhe-airdrop/ecdsa.d.ts +263 -0
  78. package/dist/fhe-airdrop/encryption.d.ts +92 -14
  79. package/dist/fhe-airdrop/errors.d.ts +245 -15
  80. package/dist/fhe-airdrop/factory.d.ts +533 -274
  81. package/dist/fhe-airdrop/guards.d.ts +273 -0
  82. package/dist/fhe-airdrop/index.cjs +1089 -33
  83. package/dist/fhe-airdrop/index.d.cts +46 -8
  84. package/dist/fhe-airdrop/index.d.ts +46 -8
  85. package/dist/fhe-airdrop/index.js +929 -7
  86. package/dist/fhe-airdrop/merkle-tree.d.ts +103 -0
  87. package/dist/fhe-airdrop/merkle.d.ts +180 -0
  88. package/dist/fhe-airdrop/react/_shared.d.ts +144 -71
  89. package/dist/fhe-airdrop/react/index.cjs +364 -413
  90. package/dist/fhe-airdrop/react/index.d.cts +53 -72
  91. package/dist/fhe-airdrop/react/index.d.ts +53 -72
  92. package/dist/fhe-airdrop/react/index.js +258 -369
  93. package/dist/fhe-airdrop/react/useAirdropGasFee.d.ts +10 -5
  94. package/dist/fhe-airdrop/react/useAirdropHasRole.d.ts +15 -6
  95. package/dist/fhe-airdrop/react/useAirdropPause.d.ts +30 -0
  96. package/dist/fhe-airdrop/react/useAirdropPaused.d.ts +17 -0
  97. package/dist/fhe-airdrop/react/useAirdropToken.d.ts +11 -4
  98. package/dist/fhe-airdrop/react/useAirdropWindow.d.ts +37 -0
  99. package/dist/fhe-airdrop/react/useClaimedAmount.d.ts +29 -0
  100. package/dist/fhe-airdrop/react/useComplianceManager.d.ts +16 -0
  101. package/dist/fhe-airdrop/react/useCreateEcdsaAirdrop.d.ts +28 -0
  102. package/dist/fhe-airdrop/react/useCreateMerkleAirdrop.d.ts +25 -0
  103. package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +23 -0
  104. package/dist/fhe-airdrop/react/useEffectiveUpgradeable.d.ts +20 -0
  105. package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +17 -12
  106. package/dist/fhe-airdrop/react/useFactoryFees.d.ts +28 -0
  107. package/dist/fhe-airdrop/react/useFactoryRegistry.d.ts +35 -0
  108. package/dist/fhe-airdrop/react/useFundAirdrop.d.ts +35 -0
  109. package/dist/fhe-airdrop/react/useGrantInstanceRoles.d.ts +35 -0
  110. package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +34 -0
  111. package/dist/fhe-airdrop/react/useMerkleRoot.d.ts +15 -0
  112. package/dist/fhe-airdrop/react/useSetMerkleRoot.d.ts +22 -0
  113. package/dist/fhe-airdrop/react/useWithdrawConfidential.d.ts +23 -0
  114. package/dist/fhe-airdrop/roles.d.ts +147 -0
  115. package/dist/fhe-airdrop/types.d.ts +68 -55
  116. package/dist/fhe-disperse/errors.d.ts +55 -0
  117. package/dist/fhe-disperse/index.cjs +34 -25
  118. package/dist/fhe-disperse/index.d.cts +1 -1
  119. package/dist/fhe-disperse/index.d.ts +1 -1
  120. package/dist/fhe-disperse/index.js +6 -5
  121. package/dist/fhe-disperse/react/index.cjs +42 -23
  122. package/dist/fhe-disperse/react/index.d.cts +3 -1
  123. package/dist/fhe-disperse/react/index.d.ts +3 -1
  124. package/dist/fhe-disperse/react/index.js +9 -6
  125. package/dist/fhe-vesting/advanced/index.cjs +8 -7
  126. package/dist/fhe-vesting/advanced/index.js +6 -5
  127. package/dist/fhe-vesting/advanced/react/index.cjs +12 -11
  128. package/dist/fhe-vesting/advanced/react/index.js +9 -8
  129. package/dist/fhe-vesting/index.cjs +35 -34
  130. package/dist/fhe-vesting/index.js +7 -6
  131. package/dist/fhe-vesting/manager.d.ts +19 -0
  132. package/dist/fhe-vesting/react/index.cjs +160 -140
  133. package/dist/fhe-vesting/react/index.d.cts +6 -4
  134. package/dist/fhe-vesting/react/index.d.ts +6 -4
  135. package/dist/fhe-vesting/react/index.js +24 -16
  136. package/dist/fhe-vesting/react/useAccessClaimableAmount.d.ts +11 -3
  137. package/dist/fhe-vesting/react/useAccessSettledAmount.d.ts +11 -3
  138. package/dist/fhe-vesting/react/useAccessTotalAllocation.d.ts +11 -3
  139. package/dist/fhe-vesting/react/useAccessVestedAmount.d.ts +11 -3
  140. package/dist/fhe-vesting/react/useAdminGetClaimableAmount.d.ts +1 -1
  141. package/dist/fhe-vesting/react/useAdminGetSettledAmount.d.ts +1 -1
  142. package/dist/fhe-vesting/react/useAdminGetTotalAllocation.d.ts +1 -1
  143. package/dist/fhe-vesting/react/useAdminGetVestedAmount.d.ts +1 -1
  144. package/dist/fhe-vesting/react/useAdminPartialClaim.d.ts +8 -0
  145. package/dist/fhe-vesting/react/useClaim.d.ts +1 -1
  146. package/dist/fhe-vesting/react/useDiscloseHandleToParty.d.ts +1 -1
  147. package/dist/fhe-vesting/react/useManagerDiscloseHandleToParty.d.ts +1 -1
  148. package/dist/fhe-vesting/react/usePartialClaim.d.ts +1 -1
  149. package/dist/fhe-vesting/react/useVestingInfo.d.ts +1 -1
  150. package/dist/fhe-vesting/types.d.ts +12 -1
  151. package/dist/index.cjs +27 -15
  152. package/dist/index.js +1 -1
  153. package/dist/testnet-faucet/index.cjs +17 -16
  154. package/dist/testnet-faucet/index.js +5 -4
  155. package/dist/testnet-faucet/react/index.cjs +11 -10
  156. package/dist/testnet-faucet/react/index.js +6 -5
  157. package/package.json +18 -9
  158. package/dist/chunk-4WPGQSNT.cjs +0 -44
  159. package/dist/chunk-6R4KNAPK.js +0 -1630
  160. package/dist/chunk-DUZIIRPF.js +0 -1655
  161. package/dist/chunk-MCRBVJGZ.cjs +0 -1637
  162. package/dist/chunk-ODLTEGHB.js +0 -41
  163. package/dist/chunk-ORFTDNFZ.js +0 -105
  164. package/dist/chunk-T46YXSBP.cjs +0 -109
  165. package/dist/chunk-TIUKIY5V.cjs +0 -1663
  166. package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +0 -53
  167. package/dist/fhe-airdrop/advanced/react/usePredictAirdropAddress.d.ts +0 -49
  168. package/dist/fhe-airdrop/airdrop.d.ts +0 -310
  169. package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +0 -31
  170. package/dist/fhe-airdrop/react/useAirdropCanExtendClaimWindow.d.ts +0 -7
  171. package/dist/fhe-airdrop/react/useAirdropClaim.d.ts +0 -27
  172. package/dist/fhe-airdrop/react/useAirdropClaimTypehash.d.ts +0 -10
  173. package/dist/fhe-airdrop/react/useAirdropClaimedSignatures.d.ts +0 -16
  174. package/dist/fhe-airdrop/react/useAirdropDeploymentBlockNumber.d.ts +0 -6
  175. package/dist/fhe-airdrop/react/useAirdropDomainSeparator.d.ts +0 -8
  176. package/dist/fhe-airdrop/react/useAirdropEndTime.d.ts +0 -10
  177. package/dist/fhe-airdrop/react/useAirdropFactoryCustomFee.d.ts +0 -17
  178. package/dist/fhe-airdrop/react/useAirdropFactoryDefaultGasFee.d.ts +0 -10
  179. package/dist/fhe-airdrop/react/useAirdropFactoryDisableCustomFee.d.ts +0 -15
  180. package/dist/fhe-airdrop/react/useAirdropFactoryFeeCollector.d.ts +0 -11
  181. package/dist/fhe-airdrop/react/useAirdropFactoryInitCodeHash.d.ts +0 -17
  182. package/dist/fhe-airdrop/react/useAirdropFactorySetCustomFee.d.ts +0 -17
  183. package/dist/fhe-airdrop/react/useAirdropFactorySetDefaultGasFee.d.ts +0 -16
  184. package/dist/fhe-airdrop/react/useAirdropFactorySetFeeCollector.d.ts +0 -15
  185. package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +0 -16
  186. package/dist/fhe-airdrop/react/useAirdropHasClaimEnded.d.ts +0 -7
  187. package/dist/fhe-airdrop/react/useAirdropHasClaimStarted.d.ts +0 -7
  188. package/dist/fhe-airdrop/react/useAirdropIsClaimWindowActive.d.ts +0 -9
  189. package/dist/fhe-airdrop/react/useAirdropIsPaused.d.ts +0 -8
  190. package/dist/fhe-airdrop/react/useAirdropIsSignatureClaimed.d.ts +0 -22
  191. package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +0 -51
  192. package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +0 -15
  193. package/dist/fhe-airdrop/react/useAirdropStartTime.d.ts +0 -10
  194. package/dist/fhe-airdrop/react/useAirdropWithdrawGasFee.d.ts +0 -15
  195. package/dist/fhe-airdrop/react/useAirdropWithdrawOtherConfidentialToken.d.ts +0 -14
  196. package/dist/fhe-airdrop/react/useAirdropWithdrawOtherToken.d.ts +0 -14
  197. package/dist/fhe-airdrop/react/useClaim.d.ts +0 -31
  198. package/dist/fhe-airdrop/react/useConfidentialAirdropFactoryImplementation.d.ts +0 -11
  199. package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +0 -41
  200. package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +0 -48
  201. package/dist/fhe-airdrop/react/useCreateConfidentialAirdrop.d.ts +0 -29
  202. package/dist/fhe-airdrop/react/useCreateConfidentialAirdropAndGetAddress.d.ts +0 -31
  203. package/dist/fhe-airdrop/react/useDisableCustomFee.d.ts +0 -14
  204. package/dist/fhe-airdrop/react/useFactoryCustomFee.d.ts +0 -17
  205. package/dist/fhe-airdrop/react/useFactoryDefaultGasFee.d.ts +0 -10
  206. package/dist/fhe-airdrop/react/useFactoryFeeCollector.d.ts +0 -11
  207. package/dist/fhe-airdrop/react/useFactoryInitCodeHash.d.ts +0 -17
  208. package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +0 -33
  209. package/dist/fhe-airdrop/react/useGetClaimAmount.d.ts +0 -30
  210. package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +0 -51
  211. package/dist/fhe-airdrop/react/useSetCustomFee.d.ts +0 -16
  212. package/dist/fhe-airdrop/react/useSetDefaultGasFee.d.ts +0 -15
  213. package/dist/fhe-airdrop/react/useSetFeeCollector.d.ts +0 -14
  214. package/dist/fhe-airdrop/react/useSetPaused.d.ts +0 -14
  215. package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +0 -31
  216. package/dist/fhe-airdrop/react/useWithdraw.d.ts +0 -12
  217. package/dist/fhe-airdrop/react/useWithdrawOtherConfidentialToken.d.ts +0 -13
  218. package/dist/fhe-airdrop/react/useWithdrawOtherToken.d.ts +0 -13
  219. package/dist/fhe-vesting/react/useGetClaimableAmount.d.ts +0 -13
  220. package/dist/fhe-vesting/react/useGetSettledAmount.d.ts +0 -14
  221. package/dist/fhe-vesting/react/useGetTotalAllocation.d.ts +0 -13
  222. package/dist/fhe-vesting/react/useGetVestedAmount.d.ts +0 -25
@@ -1,455 +1,344 @@
1
- import { useMemoFactoryClient, buildQueryKey, useMemoAirdropClient } from '../../chunk-ORFTDNFZ.js';
2
- export { AlreadyClaimedError, ClaimNotStartedError, ClaimWindowClosedError } from '../../chunk-6R4KNAPK.js';
3
- import { signClaimAuthorization } from '../../chunk-DUZIIRPF.js';
4
- export { encryptUint64, encryptUint64Batch, resolveEncryptor, signClaimAuthorization } from '../../chunk-DUZIIRPF.js';
5
- import { useWagmiAccount } from '../../chunk-FT4LNBOS.js';
1
+ import { grantInstanceRoles } from '../../chunk-456VDDA3.js';
2
+ export { buildMerkleCampaign, buildMerkleTree, encryptCampaignAmounts, grantInstanceRoles, leafOf, planInstanceRoleSplit, planMerkleCampaign, rotateMerkleRoot, validateCampaignRecipients } from '../../chunk-456VDDA3.js';
3
+ import { useMemoAirdropBaseClient, airdropQueryKey, useMemoMerkleAirdropClient, useMemoAirdropFactoryClient, airdropQueryKeyPrefix, useMemoEcdsaAirdropClient } from '../../chunk-VP2B4WM2.js';
4
+ export { airdropQueryKey, airdropQueryKeyPrefix } from '../../chunk-VP2B4WM2.js';
5
+ export { encryptUint64, encryptUint64Batch, resolveEncryptor, signClaimAuthorization } from '../../chunk-GKKDAW44.js';
6
+ export { AlreadyClaimedError, ClaimNotStartedError, ClaimWindowClosedError, DedupIdConsumedError, FeeCollectorSelfAdministeredError, MerkleUupsUnsupportedError, NonStockWrapperError, PredictionDriftError, SaltCollisionError, SignatureExpiredError, UpgradeabilityNotAllowedError, preflightClaim, preflightCreate } from '../../chunk-O5676ZWY.js';
6
7
  import '../../chunk-ZWXJTBZO.js';
7
- import '../../chunk-7VELUOMI.js';
8
- import '../../chunk-SG65XWH7.js';
9
- import '../../chunk-XGGTQQFH.js';
8
+ import '../../chunk-NWFMBLSQ.js';
9
+ import '../../chunk-4RAAATVY.js';
10
+ import '../../chunk-DZHYSUGY.js';
10
11
  import '../../chunk-ZA673I3O.js';
11
- import '../../chunk-Q2GP5UDC.js';
12
12
  import '../../chunk-KWFFIJYX.js';
13
- import { MissingClientError, MissingWalletClientError } from '../../chunk-QBJ7O2B4.js';
13
+ import { MissingClientError } from '../../chunk-QBJ7O2B4.js';
14
14
  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
- import { useQuery, useMutation } from '@tanstack/react-query';
16
- import { useWalletClient } from 'wagmi';
15
+ import '../../chunk-Q2GP5UDC.js';
16
+ import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
17
17
 
18
- function useConfidentialAirdropFactoryImplementation(options = {}) {
19
- const { client, chainId, resolvedAddress } = useMemoFactoryClient(options);
18
+ function useAirdropToken(args) {
19
+ const { client, chainId } = useMemoAirdropBaseClient(args);
20
20
  return useQuery({
21
- queryKey: buildQueryKey("factory:implementation", chainId, resolvedAddress),
22
- queryFn: () => client.implementation(),
23
- enabled: !!client,
24
- staleTime: 0
21
+ ...args.query,
22
+ queryKey: airdropQueryKey({ chainId, address: args.address, fn: "token", args: [] }),
23
+ queryFn: () => client.token(),
24
+ enabled: Boolean(client && (args.query?.enabled ?? true))
25
25
  });
26
26
  }
27
- function useFactoryDefaultGasFee(options = {}) {
28
- const { client, chainId, resolvedAddress } = useMemoFactoryClient(options);
27
+ function useAirdropWindow(args) {
28
+ const { client, chainId } = useMemoAirdropBaseClient(args);
29
29
  return useQuery({
30
- queryKey: buildQueryKey("factory:defaultGasFee", chainId, resolvedAddress),
31
- queryFn: () => client.defaultGasFee(),
32
- enabled: !!client,
33
- staleTime: 0
30
+ ...args.query,
31
+ queryKey: airdropQueryKey({ chainId, address: args.address, fn: "window", args: [] }),
32
+ queryFn: async () => {
33
+ const [startTime, endTime, hasStarted, hasEnded, isActive] = await Promise.all([
34
+ client.startTime(),
35
+ client.endTime(),
36
+ client.hasClaimStarted(),
37
+ client.hasClaimEnded(),
38
+ client.isClaimWindowActive()
39
+ ]);
40
+ return { startTime, endTime, hasStarted, hasEnded, isActive };
41
+ },
42
+ enabled: Boolean(client && (args.query?.enabled ?? true))
43
+ });
44
+ }
45
+ function useAirdropPaused(args) {
46
+ const { client, chainId } = useMemoAirdropBaseClient(args);
47
+ return useQuery({
48
+ ...args.query,
49
+ queryKey: airdropQueryKey({ chainId, address: args.address, fn: "paused", args: [] }),
50
+ queryFn: () => client.paused(),
51
+ enabled: Boolean(client && (args.query?.enabled ?? true))
34
52
  });
35
53
  }
36
- function useFactoryFeeCollector(options = {}) {
37
- const { client, chainId, resolvedAddress } = useMemoFactoryClient(options);
54
+ function useAirdropGasFee(args) {
55
+ const { client, chainId } = useMemoAirdropBaseClient(args);
38
56
  return useQuery({
39
- queryKey: buildQueryKey("factory:feeCollector", chainId, resolvedAddress),
40
- queryFn: () => client.feeCollector(),
41
- enabled: !!client,
42
- staleTime: 0
57
+ ...args.query,
58
+ queryKey: airdropQueryKey({ chainId, address: args.address, fn: "gasFee", args: [] }),
59
+ queryFn: () => client.gasFee(),
60
+ enabled: Boolean(client && (args.query?.enabled ?? true))
43
61
  });
44
62
  }
45
- function useFactoryCustomFee(args = {}) {
46
- const { creator, ...base } = args;
47
- const { client, chainId, resolvedAddress } = useMemoFactoryClient(base);
63
+ function useAirdropHasRole(args) {
64
+ const { role, holder, ...base } = args;
65
+ const { client, chainId } = useMemoAirdropBaseClient(base);
48
66
  return useQuery({
49
- queryKey: buildQueryKey("factory:getCustomFee", chainId, resolvedAddress, creator),
50
- queryFn: () => client.getCustomFee(creator),
51
- enabled: !!client && !!creator,
52
- staleTime: 0
67
+ ...args.query,
68
+ queryKey: airdropQueryKey({
69
+ chainId,
70
+ address: args.address,
71
+ fn: "hasRole",
72
+ args: [role, holder]
73
+ }),
74
+ queryFn: () => client.hasRole({ role, holder }),
75
+ enabled: Boolean(client && role && holder && (args.query?.enabled ?? true))
53
76
  });
54
77
  }
55
- function useFactoryInitCodeHash(args = {}) {
56
- const { params, gasFee, ...base } = args;
57
- const { client, chainId, resolvedAddress } = useMemoFactoryClient(base);
78
+ function useMerkleRoot(args) {
79
+ const { client, chainId } = useMemoMerkleAirdropClient(args);
58
80
  return useQuery({
59
- queryKey: buildQueryKey("factory:getInitCodeHash", chainId, resolvedAddress, params, gasFee),
60
- queryFn: () => client.getInitCodeHash({ params, gasFee }),
61
- enabled: !!client && !!params && gasFee !== void 0,
62
- staleTime: 0
81
+ ...args.query,
82
+ queryKey: airdropQueryKey({ chainId, address: args.address, fn: "merkleRoot", args: [] }),
83
+ queryFn: () => client.merkleRoot(),
84
+ enabled: Boolean(client && (args.query?.enabled ?? true))
63
85
  });
64
86
  }
65
- function usePreflightCreateAirdrop(args = {}) {
66
- const { params, creator, userSalt, funding, ...base } = args;
67
- const { client, chainId, resolvedAddress } = useMemoFactoryClient(base);
87
+ function useClaimedAmount(args) {
88
+ const { account, ...base } = args;
89
+ const { client, chainId } = useMemoMerkleAirdropClient(base);
68
90
  return useQuery({
69
- queryKey: buildQueryKey(
70
- "factory:preflightCreateAirdrop",
91
+ ...args.query,
92
+ queryKey: airdropQueryKey({
71
93
  chainId,
72
- resolvedAddress,
73
- creator,
74
- params,
75
- userSalt,
76
- funding
77
- ),
78
- queryFn: () => client.preflightCreateAirdrop({
79
- params,
80
- creator,
81
- ...userSalt !== void 0 ? { userSalt } : {},
82
- ...funding !== void 0 ? { funding } : {}
94
+ address: args.address,
95
+ fn: "getClaimedAmount",
96
+ args: [account]
83
97
  }),
84
- enabled: !!client && !!params && !!creator,
85
- staleTime: 0
98
+ queryFn: () => client.getClaimedAmount(account),
99
+ enabled: Boolean(client && account && (args.query?.enabled ?? true))
86
100
  });
87
101
  }
88
- function useCreateConfidentialAirdropAndGetAddress(options = {}) {
89
- const { client, resolutionError } = useMemoFactoryClient(options);
90
- return useMutation({
91
- mutationFn: async (args) => {
92
- if (!client) {
93
- throw resolutionError ?? new MissingClientError("useCreateConfidentialAirdropAndGetAddress", "factory");
94
- }
95
- return client.createConfidentialAirdropAndGetAddress(args);
96
- }
102
+ function useComplianceManager(args) {
103
+ const { client, chainId } = useMemoAirdropBaseClient(args);
104
+ return useQuery({
105
+ ...args.query,
106
+ queryKey: airdropQueryKey({
107
+ chainId,
108
+ address: args.address,
109
+ fn: "complianceManager",
110
+ args: []
111
+ }),
112
+ queryFn: () => client.complianceManager(),
113
+ enabled: Boolean(client && (args.query?.enabled ?? true))
114
+ });
115
+ }
116
+ function useFactoryFees(args = {}) {
117
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(args);
118
+ return useQuery({
119
+ ...args.query,
120
+ queryKey: airdropQueryKey({ chainId, address: resolvedAddress, fn: "fees", args: [] }),
121
+ queryFn: async () => {
122
+ const [feeCollector, defaultGasFee] = await Promise.all([
123
+ client.feeCollector(),
124
+ client.defaultGasFee()
125
+ ]);
126
+ return { feeCollector, defaultGasFee };
127
+ },
128
+ enabled: Boolean(client && (args.query?.enabled ?? true))
129
+ });
130
+ }
131
+ function useFactoryRegistry(args = {}) {
132
+ const { offset = 0n, limit = 50n, ...base } = args;
133
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
134
+ return useQuery({
135
+ ...args.query,
136
+ queryKey: airdropQueryKey({
137
+ chainId,
138
+ address: resolvedAddress,
139
+ fn: "registry",
140
+ args: [offset, limit]
141
+ }),
142
+ queryFn: async () => {
143
+ const [count, items] = await Promise.all([
144
+ client.airdropCount(),
145
+ client.airdrops(offset, limit)
146
+ ]);
147
+ return { count, items };
148
+ },
149
+ enabled: Boolean(client && (args.query?.enabled ?? true))
150
+ });
151
+ }
152
+ function useEffectiveUpgradeable(args = {}) {
153
+ const { creator, ...base } = args;
154
+ const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
155
+ return useQuery({
156
+ ...args.query,
157
+ queryKey: airdropQueryKey({
158
+ chainId,
159
+ address: resolvedAddress,
160
+ fn: "effectiveUpgradeable",
161
+ args: [creator]
162
+ }),
163
+ queryFn: () => client.effectiveUpgradeable(creator),
164
+ enabled: Boolean(client && creator && (args.query?.enabled ?? true))
97
165
  });
98
166
  }
99
- function useCreateConfidentialAirdrop(options = {}) {
100
- const { client, resolutionError } = useMemoFactoryClient(options);
167
+ function useCreateEcdsaAirdrop(options = {}) {
168
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
169
+ const queryClient = useQueryClient();
101
170
  return useMutation({
102
171
  mutationFn: async (args) => {
103
172
  if (!client) {
104
- throw resolutionError ?? new MissingClientError("useCreateConfidentialAirdrop", "factory");
173
+ throw resolutionError ?? new MissingClientError("useCreateEcdsaAirdrop", "factory");
105
174
  }
106
- return client.createConfidentialAirdrop(args);
175
+ return client.createEcdsaAirdrop(args);
176
+ },
177
+ onSuccess: () => {
178
+ void queryClient.invalidateQueries({
179
+ queryKey: airdropQueryKeyPrefix({ chainId, address: resolvedAddress, fn: "registry" })
180
+ });
107
181
  }
108
182
  });
109
183
  }
110
- function useCreateAndFundConfidentialAirdrop(options = {}) {
111
- const { client, resolutionError } = useMemoFactoryClient(options);
184
+ function useCreateMerkleAirdrop(options = {}) {
185
+ const { client, resolutionError, chainId, resolvedAddress } = useMemoAirdropFactoryClient(options);
186
+ const queryClient = useQueryClient();
112
187
  return useMutation({
113
188
  mutationFn: async (args) => {
114
189
  if (!client) {
115
- throw resolutionError ?? new MissingClientError("useCreateAndFundConfidentialAirdrop", "factory");
190
+ throw resolutionError ?? new MissingClientError("useCreateMerkleAirdrop", "factory");
116
191
  }
117
- return client.createAndFundConfidentialAirdrop(args);
192
+ return client.createMerkleAirdrop(args);
193
+ },
194
+ onSuccess: () => {
195
+ void queryClient.invalidateQueries({
196
+ queryKey: airdropQueryKeyPrefix({ chainId, address: resolvedAddress, fn: "registry" })
197
+ });
118
198
  }
119
199
  });
120
200
  }
121
- function useCreateAndFundConfidentialAirdropAndGetAddress(options = {}) {
122
- const { client, resolutionError } = useMemoFactoryClient(options);
201
+ function useFundAirdrop(options = {}) {
202
+ const { client, resolutionError } = useMemoAirdropFactoryClient(options);
123
203
  return useMutation({
124
204
  mutationFn: async (args) => {
125
205
  if (!client) {
126
- throw resolutionError ?? new MissingClientError("useCreateAndFundConfidentialAirdropAndGetAddress", "factory");
206
+ throw resolutionError ?? new MissingClientError("useFundAirdrop", "factory");
127
207
  }
128
- return client.createAndFundConfidentialAirdropAndGetAddress(args);
208
+ return client.fundAirdrop(args);
129
209
  }
130
210
  });
131
211
  }
132
- function useFundConfidentialAirdrop(options = {}) {
133
- const { client, resolutionError } = useMemoFactoryClient(options);
212
+ function useEcdsaClaim(options) {
213
+ const { client } = useMemoEcdsaAirdropClient(options);
134
214
  return useMutation({
135
215
  mutationFn: async (args) => {
136
216
  if (!client) {
137
- throw resolutionError ?? new MissingClientError("useFundConfidentialAirdrop", "factory");
217
+ throw new MissingClientError("useEcdsaClaim", "ecdsa-airdrop");
138
218
  }
139
- return client.fundConfidentialAirdrop(args);
140
- }
141
- });
142
- }
143
- function useSetFeeCollector(options = {}) {
144
- const { client, resolutionError } = useMemoFactoryClient(options);
145
- return useMutation({
146
- mutationFn: async ({ newFeeCollector, account }) => {
147
- if (!client) throw resolutionError ?? new MissingClientError("useSetFeeCollector", "factory");
148
- return client.setFeeCollector(newFeeCollector, account);
149
- }
150
- });
151
- }
152
- function useSetDefaultGasFee(options = {}) {
153
- const { client, resolutionError } = useMemoFactoryClient(options);
154
- return useMutation({
155
- mutationFn: async ({ newGasFee, account }) => {
156
- if (!client)
157
- throw resolutionError ?? new MissingClientError("useSetDefaultGasFee", "factory");
158
- return client.setDefaultGasFee(newGasFee, account);
159
- }
160
- });
161
- }
162
- function useSetCustomFee(options = {}) {
163
- const { client, resolutionError } = useMemoFactoryClient(options);
164
- return useMutation({
165
- mutationFn: async ({ campaignCreator, gasFee, account }) => {
166
- if (!client) throw resolutionError ?? new MissingClientError("useSetCustomFee", "factory");
167
- return client.setCustomFee(campaignCreator, gasFee, account);
219
+ return client.claim(args);
168
220
  }
169
221
  });
170
222
  }
171
- function useDisableCustomFee(options = {}) {
172
- const { client, resolutionError } = useMemoFactoryClient(options);
173
- return useMutation({
174
- mutationFn: async ({ campaignCreator, account }) => {
175
- if (!client)
176
- throw resolutionError ?? new MissingClientError("useDisableCustomFee", "factory");
177
- return client.disableCustomFee(campaignCreator, account);
178
- }
179
- });
180
- }
181
- function useAirdropToken(options) {
182
- const { client, chainId } = useMemoAirdropClient(options);
183
- return useQuery({
184
- queryKey: buildQueryKey("airdrop:TOKEN", chainId, options.address),
185
- queryFn: () => client.token(),
186
- enabled: !!client,
187
- staleTime: 0
188
- });
189
- }
190
- function useAirdropGasFee(options) {
191
- const { client, chainId } = useMemoAirdropClient(options);
192
- return useQuery({
193
- queryKey: buildQueryKey("airdrop:GAS_FEE", chainId, options.address),
194
- queryFn: () => client.gasFee(),
195
- enabled: !!client,
196
- staleTime: 0
197
- });
198
- }
199
- function useAirdropStartTime(options) {
200
- const { client, chainId } = useMemoAirdropClient(options);
201
- return useQuery({
202
- queryKey: buildQueryKey("airdrop:START_TIME", chainId, options.address),
203
- queryFn: () => client.startTime(),
204
- enabled: !!client,
205
- staleTime: 0
206
- });
207
- }
208
- function useAirdropCanExtendClaimWindow(options) {
209
- const { client, chainId } = useMemoAirdropClient(options);
210
- return useQuery({
211
- queryKey: buildQueryKey("airdrop:CAN_EXTEND_CLAIM_WINDOW", chainId, options.address),
212
- queryFn: () => client.canExtendClaimWindow(),
213
- enabled: !!client,
214
- staleTime: 0
215
- });
216
- }
217
- function useAirdropEndTime(options) {
218
- const { client, chainId } = useMemoAirdropClient(options);
219
- return useQuery({
220
- queryKey: buildQueryKey("airdrop:endTime", chainId, options.address),
221
- queryFn: () => client.endTime(),
222
- enabled: !!client,
223
- staleTime: 0
224
- });
225
- }
226
- function useAirdropIsPaused(options) {
227
- const { client, chainId } = useMemoAirdropClient(options);
228
- return useQuery({
229
- queryKey: buildQueryKey("airdrop:isPaused", chainId, options.address),
230
- queryFn: () => client.isPaused(),
231
- enabled: !!client,
232
- staleTime: 0
233
- });
234
- }
235
- function useAirdropDeploymentBlockNumber(options) {
236
- const { client, chainId } = useMemoAirdropClient(options);
237
- return useQuery({
238
- queryKey: buildQueryKey("airdrop:deploymentBlockNumber", chainId, options.address),
239
- queryFn: () => client.deploymentBlockNumber(),
240
- enabled: !!client,
241
- staleTime: 0
242
- });
243
- }
244
- function useAirdropDomainSeparator(options) {
245
- const { client, chainId } = useMemoAirdropClient(options);
246
- return useQuery({
247
- queryKey: buildQueryKey("airdrop:DOMAIN_SEPARATOR", chainId, options.address),
248
- queryFn: () => client.domainSeparator(),
249
- enabled: !!client,
250
- staleTime: 0
251
- });
252
- }
253
- function useAirdropClaimTypehash(options) {
254
- const { client, chainId } = useMemoAirdropClient(options);
255
- return useQuery({
256
- queryKey: buildQueryKey("airdrop:CLAIM_TYPEHASH", chainId, options.address),
257
- queryFn: () => client.claimTypehash(),
258
- enabled: !!client,
259
- staleTime: 0
260
- });
261
- }
262
- function useAirdropIsClaimWindowActive(options) {
263
- const { client, chainId } = useMemoAirdropClient(options);
264
- return useQuery({
265
- queryKey: buildQueryKey("airdrop:isClaimWindowActive", chainId, options.address),
266
- queryFn: () => client.isClaimWindowActive(),
267
- enabled: !!client,
268
- staleTime: 0
269
- });
270
- }
271
- function useAirdropHasClaimStarted(options) {
272
- const { client, chainId } = useMemoAirdropClient(options);
273
- return useQuery({
274
- queryKey: buildQueryKey("airdrop:hasClaimStarted", chainId, options.address),
275
- queryFn: () => client.hasClaimStarted(),
276
- enabled: !!client,
277
- staleTime: 0
278
- });
279
- }
280
- function useAirdropHasClaimEnded(options) {
281
- const { client, chainId } = useMemoAirdropClient(options);
282
- return useQuery({
283
- queryKey: buildQueryKey("airdrop:hasClaimEnded", chainId, options.address),
284
- queryFn: () => client.hasClaimEnded(),
285
- enabled: !!client,
286
- staleTime: 0
287
- });
288
- }
289
- function useAirdropClaimedSignatures(args) {
290
- const { signatureHash, ...base } = args;
291
- const { client, chainId } = useMemoAirdropClient(base);
292
- return useQuery({
293
- queryKey: buildQueryKey("airdrop:claimedSignatures", chainId, base.address, signatureHash),
294
- queryFn: () => client.claimedSignatures(signatureHash),
295
- enabled: !!client && !!signatureHash,
296
- staleTime: 0
297
- });
298
- }
299
- function useAirdropIsSignatureClaimed(args) {
300
- const { user, encryptedAmountHandle, ...base } = args;
301
- const { client, chainId } = useMemoAirdropClient(base);
302
- return useQuery({
303
- queryKey: buildQueryKey(
304
- "airdrop:isSignatureClaimed",
305
- chainId,
306
- base.address,
307
- user,
308
- encryptedAmountHandle
309
- ),
310
- queryFn: () => client.isSignatureClaimed(user, encryptedAmountHandle),
311
- enabled: !!client && !!user && !!encryptedAmountHandle,
312
- staleTime: 0
313
- });
314
- }
315
- function useAirdropIsSignatureValid(args) {
316
- const { encryptedAmountHandle, signature, caller, ...base } = args;
317
- const { client, chainId } = useMemoAirdropClient(base);
318
- const { address: connectedAddress } = useWagmiAccount();
319
- const resolvedCaller = caller ?? connectedAddress;
320
- return useQuery({
321
- queryKey: buildQueryKey(
322
- "airdrop:isSignatureValid",
323
- chainId,
324
- base.address,
325
- encryptedAmountHandle,
326
- signature,
327
- resolvedCaller
328
- ),
329
- queryFn: () => client.isSignatureValid({
330
- encryptedAmountHandle,
331
- signature,
332
- caller: resolvedCaller
333
- }),
334
- enabled: !!client && !!encryptedAmountHandle && !!signature && !!resolvedCaller,
335
- staleTime: 0
336
- });
337
- }
338
- function useAirdropHasRole(args) {
339
- const { role, account, ...base } = args;
340
- const { client, chainId } = useMemoAirdropClient(base);
341
- return useQuery({
342
- queryKey: buildQueryKey("airdrop:hasRole", chainId, base.address, role, account),
343
- queryFn: () => client.hasRole(role, account),
344
- enabled: !!client && !!role && !!account,
345
- staleTime: 0
346
- });
347
- }
348
- function useClaim(options) {
349
- const { client } = useMemoAirdropClient(options);
223
+ function useMerkleClaim(options) {
224
+ const { client, chainId, walletClient } = useMemoMerkleAirdropClient(options);
225
+ const queryClient = useQueryClient();
350
226
  return useMutation({
351
227
  mutationFn: async (args) => {
352
- if (!client) throw new MissingClientError("useClaim", "airdrop");
228
+ if (!client) {
229
+ throw new MissingClientError("useMerkleClaim", "merkle-airdrop");
230
+ }
353
231
  return client.claim(args);
232
+ },
233
+ onMutate: (variables) => {
234
+ const account = variables.account ?? walletClient?.account;
235
+ return {
236
+ claimant: account ? typeof account === "string" ? account : account.address : void 0
237
+ };
238
+ },
239
+ onSuccess: (_hash, _variables, context) => {
240
+ if (!context?.claimant) return;
241
+ void queryClient.invalidateQueries({
242
+ queryKey: airdropQueryKey({
243
+ chainId,
244
+ address: options.address,
245
+ fn: "getClaimedAmount",
246
+ args: [context.claimant]
247
+ })
248
+ });
354
249
  }
355
250
  });
356
251
  }
357
- function useGetClaimAmount(options) {
358
- const { client } = useMemoAirdropClient(options);
252
+ function useSetMerkleRoot(options) {
253
+ const { client, chainId } = useMemoMerkleAirdropClient(options);
254
+ const queryClient = useQueryClient();
359
255
  return useMutation({
360
256
  mutationFn: async (args) => {
361
- if (!client) throw new MissingClientError("useGetClaimAmount", "airdrop");
362
- return client.getClaimAmount(args);
257
+ if (!client) {
258
+ throw new MissingClientError("useSetMerkleRoot", "merkle-airdrop");
259
+ }
260
+ return client.setMerkleRoot(args);
261
+ },
262
+ onSuccess: () => {
263
+ void queryClient.invalidateQueries({
264
+ queryKey: airdropQueryKey({
265
+ chainId,
266
+ address: options.address,
267
+ fn: "merkleRoot",
268
+ args: []
269
+ })
270
+ });
363
271
  }
364
272
  });
365
273
  }
366
- function useWithdraw(options) {
367
- const { client } = useMemoAirdropClient(options);
274
+ function useGrantInstanceRoles(options) {
275
+ const { client, chainId } = useMemoAirdropBaseClient(options);
276
+ const queryClient = useQueryClient();
368
277
  return useMutation({
369
- mutationFn: async ({ recipient, account }) => {
370
- if (!client) throw new MissingClientError("useWithdraw", "airdrop");
371
- return client.withdraw(recipient, account);
278
+ mutationFn: async (args) => {
279
+ if (!client) {
280
+ throw new MissingClientError("useGrantInstanceRoles", "airdrop-base");
281
+ }
282
+ return grantInstanceRoles({
283
+ airdrop: client,
284
+ assignment: args.assignment,
285
+ ...args.revokeFromCreator !== void 0 ? { revokeFromCreator: args.revokeFromCreator } : {}
286
+ });
287
+ },
288
+ onSuccess: () => {
289
+ void queryClient.invalidateQueries({
290
+ queryKey: airdropQueryKeyPrefix({ chainId, address: options.address, fn: "hasRole" })
291
+ });
372
292
  }
373
293
  });
374
294
  }
375
- function useSetPaused(options) {
376
- const { client } = useMemoAirdropClient(options);
295
+ function useAirdropPause(options) {
296
+ const { client, chainId } = useMemoAirdropBaseClient(options);
297
+ const queryClient = useQueryClient();
377
298
  return useMutation({
378
- mutationFn: async ({ paused, account }) => {
379
- if (!client) throw new MissingClientError("useSetPaused", "airdrop");
380
- return client.setPaused(paused, account);
299
+ mutationFn: async ({ paused, ...rest }) => {
300
+ if (!client) {
301
+ throw new MissingClientError("useAirdropPause", "airdrop-base");
302
+ }
303
+ return paused ? client.pause(rest) : client.unpause(rest);
304
+ },
305
+ onSuccess: () => {
306
+ void queryClient.invalidateQueries({
307
+ queryKey: airdropQueryKey({ chainId, address: options.address, fn: "paused", args: [] })
308
+ });
309
+ void queryClient.invalidateQueries({
310
+ queryKey: airdropQueryKey({ chainId, address: options.address, fn: "window", args: [] })
311
+ });
381
312
  }
382
313
  });
383
314
  }
384
315
  function useExtendClaimWindow(options) {
385
- const { client } = useMemoAirdropClient(options);
316
+ const { client, chainId } = useMemoAirdropBaseClient(options);
317
+ const queryClient = useQueryClient();
386
318
  return useMutation({
387
- mutationFn: async ({ newEndTime, account }) => {
388
- if (!client) throw new MissingClientError("useExtendClaimWindow", "airdrop");
389
- return client.extendClaimWindow(newEndTime, account);
390
- }
391
- });
392
- }
393
- function useWithdrawOtherToken(options) {
394
- const { client } = useMemoAirdropClient(options);
395
- return useMutation({
396
- mutationFn: async ({ tokenAddress, recipient, account }) => {
397
- if (!client) throw new MissingClientError("useWithdrawOtherToken", "airdrop");
398
- return client.withdrawOtherToken(tokenAddress, recipient, account);
399
- }
400
- });
401
- }
402
- function useWithdrawOtherConfidentialToken(options) {
403
- const { client } = useMemoAirdropClient(options);
404
- return useMutation({
405
- mutationFn: async ({ tokenAddress, recipient, account }) => {
406
- if (!client) throw new MissingClientError("useWithdrawOtherConfidentialToken", "airdrop");
407
- return client.withdrawOtherConfidentialToken(tokenAddress, recipient, account);
408
- }
409
- });
410
- }
411
- function useAirdropWithdrawGasFee(options) {
412
- const { client } = useMemoAirdropClient(options);
413
- return useMutation({
414
- mutationFn: async ({ recipient, amount, account }) => {
415
- if (!client) throw new MissingClientError("useAirdropWithdrawGasFee", "airdrop");
416
- return client.withdrawGasFee(recipient, amount, account);
417
- }
418
- });
419
- }
420
- function useAirdropGrantRole(options) {
421
- const { client } = useMemoAirdropClient(options);
422
- return useMutation({
423
- mutationFn: async ({ role, accountTarget, account }) => {
424
- if (!client) throw new MissingClientError("useAirdropGrantRole", "airdrop");
425
- return client.grantRole(role, accountTarget, account);
426
- }
427
- });
428
- }
429
- function useAirdropRevokeRole(options) {
430
- const { client } = useMemoAirdropClient(options);
431
- return useMutation({
432
- mutationFn: async ({ role, accountTarget, account }) => {
433
- if (!client) throw new MissingClientError("useAirdropRevokeRole", "airdrop");
434
- return client.revokeRole(role, accountTarget, account);
319
+ mutationFn: async (args) => {
320
+ if (!client) {
321
+ throw new MissingClientError("useExtendClaimWindow", "airdrop-base");
322
+ }
323
+ return client.extendClaimWindow(args);
324
+ },
325
+ onSuccess: () => {
326
+ void queryClient.invalidateQueries({
327
+ queryKey: airdropQueryKey({ chainId, address: options.address, fn: "window", args: [] })
328
+ });
435
329
  }
436
330
  });
437
331
  }
438
- function useSignClaimAuthorization(options = {}) {
439
- const { data: walletClient } = useWalletClient({ chainId: options.chainId });
332
+ function useWithdrawConfidential(options) {
333
+ const { client } = useMemoAirdropBaseClient(options);
440
334
  return useMutation({
441
335
  mutationFn: async (args) => {
442
- if (!walletClient) {
443
- throw new MissingWalletClientError("useSignClaimAuthorization");
336
+ if (!client) {
337
+ throw new MissingClientError("useWithdrawConfidential", "airdrop-base");
444
338
  }
445
- return signClaimAuthorization({
446
- walletClient,
447
- airdropAddress: args.airdropAddress,
448
- recipient: args.recipient,
449
- encryptedAmountHandle: args.encryptedAmountHandle
450
- });
339
+ return client.withdrawConfidential(args);
451
340
  }
452
341
  });
453
342
  }
454
343
 
455
- export { useAirdropCanExtendClaimWindow, useAirdropClaimTypehash, useAirdropClaimedSignatures, useAirdropDeploymentBlockNumber, useAirdropDomainSeparator, useAirdropEndTime, useAirdropGasFee, useAirdropGrantRole, useAirdropHasClaimEnded, useAirdropHasClaimStarted, useAirdropHasRole, useAirdropIsClaimWindowActive, useAirdropIsPaused, useAirdropIsSignatureClaimed, useAirdropIsSignatureValid, useAirdropRevokeRole, useAirdropStartTime, useAirdropToken, useAirdropWithdrawGasFee, useClaim, useConfidentialAirdropFactoryImplementation, useCreateAndFundConfidentialAirdrop, useCreateAndFundConfidentialAirdropAndGetAddress, useCreateConfidentialAirdrop, useCreateConfidentialAirdropAndGetAddress, useDisableCustomFee, useExtendClaimWindow, useFactoryCustomFee, useFactoryDefaultGasFee, useFactoryFeeCollector, useFactoryInitCodeHash, useFundConfidentialAirdrop, useGetClaimAmount, usePreflightCreateAirdrop, useSetCustomFee, useSetDefaultGasFee, useSetFeeCollector, useSetPaused, useSignClaimAuthorization, useWithdraw, useWithdrawOtherConfidentialToken, useWithdrawOtherToken };
344
+ export { useAirdropGasFee, useAirdropHasRole, useAirdropPause, useAirdropPaused, useAirdropToken, useAirdropWindow, useClaimedAmount, useComplianceManager, useCreateEcdsaAirdrop, useCreateMerkleAirdrop, useEcdsaClaim, useEffectiveUpgradeable, useExtendClaimWindow, useFactoryFees, useFactoryRegistry, useFundAirdrop, useGrantInstanceRoles, useMerkleClaim, useMerkleRoot, useSetMerkleRoot, useWithdrawConfidential };