@tokenops/sdk 2.0.0-alpha.3 → 2.0.0-alpha.4

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 (151) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +71 -35
  3. package/SUPPORT.md +1 -1
  4. package/dist/{chunk-NGU4JYIR.js → chunk-2ND7US2I.js} +1 -1
  5. package/dist/{chunk-U3TBQRT7.js → chunk-3ZSPRHR3.js} +55 -12
  6. package/dist/{chunk-BXX5TETM.js → chunk-67Q6KSVV.js} +4114 -3267
  7. package/dist/{chunk-JVNJSDQ4.cjs → chunk-6AYJRUGP.cjs} +7 -50
  8. package/dist/{chunk-AHU2HMNE.cjs → chunk-6FUHF73F.cjs} +5 -5
  9. package/dist/{chunk-NWFMBLSQ.js → chunk-7KY4K4PH.js} +1 -1
  10. package/dist/{chunk-YABHXJNH.cjs → chunk-ARZ5C3FS.cjs} +7 -7
  11. package/dist/{chunk-4IB4IY5Y.js → chunk-AX6MQAWU.js} +2 -2
  12. package/dist/{chunk-BPIVVCSQ.js → chunk-BSXEX2SH.js} +3 -3
  13. package/dist/{chunk-PK6Q6J5F.js → chunk-CHGY6B7L.js} +34 -81
  14. package/dist/{chunk-GKYZQJGP.cjs → chunk-DFK5GCJP.cjs} +55 -72
  15. package/dist/{chunk-4AWQJQXY.cjs → chunk-E4IV4M4E.cjs} +4126 -3279
  16. package/dist/{chunk-6HCT4QIX.js → chunk-GHGF65LN.js} +16 -13
  17. package/dist/{chunk-TWT3STIX.js → chunk-K3R27WX4.js} +8 -46
  18. package/dist/{chunk-GCJFAY4X.js → chunk-KJUNBOJQ.js} +52 -71
  19. package/dist/{chunk-6XOAYDC6.cjs → chunk-PO3A2AQX.cjs} +4 -4
  20. package/dist/{chunk-TND5NDV7.cjs → chunk-QHDMPT7I.cjs} +64 -19
  21. package/dist/{chunk-IEKTGJ4J.cjs → chunk-S47IBDTA.cjs} +36 -83
  22. package/dist/{chunk-UG5RKLU2.cjs → chunk-SUYBAF27.cjs} +1 -1
  23. package/dist/{chunk-WRWRA4TN.js → chunk-TWU7L5H7.js} +5 -48
  24. package/dist/{chunk-WJLECC22.cjs → chunk-UUSSWOPR.cjs} +9 -47
  25. package/dist/{chunk-YTIYTV4K.cjs → chunk-VHKMWWBA.cjs} +319 -40
  26. package/dist/{chunk-PG3WXT3K.cjs → chunk-YAL6JSAZ.cjs} +16 -13
  27. package/dist/{chunk-LEYYG4RF.js → chunk-YMWMIWBP.js} +315 -42
  28. package/dist/core/addresses.d.ts +4 -4
  29. package/dist/core/errors.d.ts +1 -1
  30. package/dist/core/index.d.ts +1 -0
  31. package/dist/core/pending.d.ts +57 -0
  32. package/dist/core/version.d.ts +1 -1
  33. package/dist/fhe/operators.d.ts +6 -5
  34. package/dist/fhe/types.d.ts +1 -1
  35. package/dist/fhe-airdrop/abis/airdrop-base.d.ts +81 -4
  36. package/dist/fhe-airdrop/abis/ecdsa.d.ts +101 -4
  37. package/dist/fhe-airdrop/abis/factory.d.ts +222 -4
  38. package/dist/fhe-airdrop/abis/merkle.d.ts +100 -4
  39. package/dist/fhe-airdrop/advanced/index.cjs +8 -4
  40. package/dist/fhe-airdrop/advanced/index.d.cts +1 -0
  41. package/dist/fhe-airdrop/advanced/index.d.ts +1 -0
  42. package/dist/fhe-airdrop/advanced/index.js +1 -1
  43. package/dist/fhe-airdrop/advanced/react/index.cjs +121 -143
  44. package/dist/fhe-airdrop/advanced/react/index.js +55 -77
  45. package/dist/fhe-airdrop/advanced/react/useClearCompliancePolicy.d.ts +3 -1
  46. package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +3 -1
  47. package/dist/fhe-airdrop/advanced/react/useFactoryComplianceDelegate.d.ts +2 -4
  48. package/dist/fhe-airdrop/advanced/react/useSetComplianceDelegate.d.ts +7 -7
  49. package/dist/fhe-airdrop/advanced/react/useSetComplianceManagerImpl.d.ts +3 -1
  50. package/dist/fhe-airdrop/advanced/react/useSetCompliancePolicy.d.ts +2 -1
  51. package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +3 -1
  52. package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +5 -4
  53. package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +3 -1
  54. package/dist/fhe-airdrop/advanced/react/useSetMaxGasFee.d.ts +7 -3
  55. package/dist/fhe-airdrop/airdrop-base.d.ts +95 -10
  56. package/dist/fhe-airdrop/campaign.d.ts +37 -73
  57. package/dist/fhe-airdrop/compliance-clone.d.ts +21 -0
  58. package/dist/fhe-airdrop/constants.d.ts +3 -1
  59. package/dist/fhe-airdrop/ecdsa.d.ts +67 -27
  60. package/dist/fhe-airdrop/encryption.d.ts +19 -6
  61. package/dist/fhe-airdrop/errors.d.ts +77 -2
  62. package/dist/fhe-airdrop/factory-params.d.ts +2361 -0
  63. package/dist/fhe-airdrop/factory.d.ts +142 -68
  64. package/dist/fhe-airdrop/guards.d.ts +110 -31
  65. package/dist/fhe-airdrop/index.cjs +79 -59
  66. package/dist/fhe-airdrop/index.d.cts +11 -9
  67. package/dist/fhe-airdrop/index.d.ts +11 -9
  68. package/dist/fhe-airdrop/index.js +5 -5
  69. package/dist/fhe-airdrop/merkle-tree.d.ts +9 -9
  70. package/dist/fhe-airdrop/merkle.d.ts +32 -11
  71. package/dist/fhe-airdrop/react/_shared.d.ts +12 -6
  72. package/dist/fhe-airdrop/react/index.cjs +294 -258
  73. package/dist/fhe-airdrop/react/index.d.cts +16 -9
  74. package/dist/fhe-airdrop/react/index.d.ts +16 -9
  75. package/dist/fhe-airdrop/react/index.js +114 -110
  76. package/dist/fhe-airdrop/react/keys.d.ts +46 -7
  77. package/dist/fhe-airdrop/react/useAccessEcdsaClaimAmount.d.ts +6 -3
  78. package/dist/fhe-airdrop/react/useAccessMerkleClaimAmount.d.ts +2 -2
  79. package/dist/fhe-airdrop/react/useAirdropConfig.d.ts +8 -3
  80. package/dist/fhe-airdrop/react/useAirdropPause.d.ts +5 -0
  81. package/dist/fhe-airdrop/react/useBuildMerkleCampaign.d.ts +4 -6
  82. package/dist/fhe-airdrop/react/useComplianceManager.d.ts +2 -2
  83. package/dist/fhe-airdrop/react/useComplianceManagerOf.d.ts +1 -2
  84. package/dist/fhe-airdrop/react/useCreateAndFundEcdsaAirdrop.d.ts +16 -11
  85. package/dist/fhe-airdrop/react/useCreateAndFundMerkleAirdrop.d.ts +23 -7
  86. package/dist/fhe-airdrop/react/useCreateEcdsaAirdrop.d.ts +13 -8
  87. package/dist/fhe-airdrop/react/useCreateMerkleAirdrop.d.ts +27 -7
  88. package/dist/fhe-airdrop/react/useDedupMode.d.ts +16 -0
  89. package/dist/fhe-airdrop/react/useDiscloseHandleToParty.d.ts +4 -3
  90. package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +6 -4
  91. package/dist/fhe-airdrop/react/useEcdsaClaimAndUnwrap.d.ts +15 -8
  92. package/dist/fhe-airdrop/react/useEcdsaDomain.d.ts +1 -1
  93. package/dist/fhe-airdrop/react/useEncryptCampaignAmounts.d.ts +5 -7
  94. package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +4 -1
  95. package/dist/fhe-airdrop/react/useFundAirdrop.d.ts +3 -4
  96. package/dist/fhe-airdrop/react/useGrantInstanceRoles.d.ts +2 -1
  97. package/dist/fhe-airdrop/react/useIsSignatureValid.d.ts +5 -4
  98. package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +4 -1
  99. package/dist/fhe-airdrop/react/useMerkleClaimAndUnwrap.d.ts +14 -3
  100. package/dist/fhe-airdrop/react/usePlanMerkleCampaign.d.ts +18 -3
  101. package/dist/fhe-airdrop/react/usePreflightClaim.d.ts +1 -1
  102. package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +34 -13
  103. package/dist/fhe-airdrop/react/useRescueERC20.d.ts +3 -3
  104. package/dist/fhe-airdrop/react/useRescueNativeToken.d.ts +23 -0
  105. package/dist/fhe-airdrop/react/useRotateMerkleRoot.d.ts +5 -2
  106. package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +4 -0
  107. package/dist/fhe-airdrop/react/useTokenOf.d.ts +29 -0
  108. package/dist/fhe-airdrop/react/useUnwrapRequest.d.ts +25 -0
  109. package/dist/fhe-airdrop/react/useWithdrawConfidential.d.ts +4 -0
  110. package/dist/fhe-airdrop/roles.d.ts +82 -7
  111. package/dist/fhe-airdrop/types.d.ts +109 -14
  112. package/dist/fhe-disperse/errors.d.ts +3 -3
  113. package/dist/fhe-disperse/index.cjs +22 -22
  114. package/dist/fhe-disperse/index.d.cts +2 -1
  115. package/dist/fhe-disperse/index.d.ts +2 -1
  116. package/dist/fhe-disperse/index.js +3 -3
  117. package/dist/fhe-disperse/react/index.cjs +27 -25
  118. package/dist/fhe-disperse/react/index.d.cts +2 -1
  119. package/dist/fhe-disperse/react/index.d.ts +2 -1
  120. package/dist/fhe-disperse/react/index.js +8 -6
  121. package/dist/fhe-disperse/react/useDisperse.d.ts +6 -2
  122. package/dist/fhe-disperse/react/useRegister.d.ts +9 -3
  123. package/dist/fhe-disperse/react/useSingletonWithdrawTokenFee.d.ts +7 -2
  124. package/dist/fhe-disperse/react/useWithdrawTokenFee.d.ts +7 -2
  125. package/dist/fhe-disperse/singleton.d.ts +33 -19
  126. package/dist/fhe-disperse/types.d.ts +48 -8
  127. package/dist/fhe-vesting/advanced/index.cjs +6 -6
  128. package/dist/fhe-vesting/advanced/index.js +4 -4
  129. package/dist/fhe-vesting/advanced/react/index.cjs +9 -9
  130. package/dist/fhe-vesting/advanced/react/index.js +6 -6
  131. package/dist/fhe-vesting/factory.d.ts +31 -8
  132. package/dist/fhe-vesting/index.cjs +23 -23
  133. package/dist/fhe-vesting/index.d.cts +3 -2
  134. package/dist/fhe-vesting/index.d.ts +3 -2
  135. package/dist/fhe-vesting/index.js +4 -4
  136. package/dist/fhe-vesting/manager.d.ts +27 -2
  137. package/dist/fhe-vesting/react/index.cjs +126 -126
  138. package/dist/fhe-vesting/react/index.d.cts +3 -2
  139. package/dist/fhe-vesting/react/index.d.ts +3 -2
  140. package/dist/fhe-vesting/react/index.js +5 -5
  141. package/dist/fhe-vesting/react/useCreateManager.d.ts +16 -9
  142. package/dist/fhe-vesting/react/useCreateManagerAndGetAddress.d.ts +9 -5
  143. package/dist/fhe-vesting/react/useSplitVesting.d.ts +9 -3
  144. package/dist/index.cjs +18 -18
  145. package/dist/index.js +1 -1
  146. package/dist/testnet-faucet/faucet.d.ts +3 -0
  147. package/dist/testnet-faucet/index.cjs +15 -15
  148. package/dist/testnet-faucet/index.js +3 -3
  149. package/dist/testnet-faucet/react/index.cjs +9 -9
  150. package/dist/testnet-faucet/react/index.js +4 -4
  151. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import { useMemoAirdropFactoryClient, airdropQueryKey, airdropKeys, airdropQueryKeyPrefix } from '../../../chunk-U3TBQRT7.js';
2
- import '../../../chunk-BXX5TETM.js';
3
- import '../../../chunk-LEYYG4RF.js';
1
+ import { useMemoAirdropFactoryClient, airdropKeys, airdropQueryKey } from '../../../chunk-3ZSPRHR3.js';
2
+ import '../../../chunk-67Q6KSVV.js';
3
+ import '../../../chunk-YMWMIWBP.js';
4
4
  import '../../../chunk-ZWXJTBZO.js';
5
- import '../../../chunk-NWFMBLSQ.js';
5
+ import '../../../chunk-7KY4K4PH.js';
6
6
  import '../../../chunk-4RAAATVY.js';
7
- import '../../../chunk-6HCT4QIX.js';
7
+ import '../../../chunk-GHGF65LN.js';
8
8
  import '../../../chunk-ZA673I3O.js';
9
9
  import '../../../chunk-KWFFIJYX.js';
10
10
  import { MissingClientError } from '../../../chunk-QBJ7O2B4.js';
@@ -16,12 +16,12 @@ function usePredictEcdsaAirdropAddress(args) {
16
16
  const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
17
17
  return useQuery({
18
18
  ...args.query,
19
- queryKey: airdropQueryKey({
20
- chainId,
21
- address: resolvedAddress,
22
- fn: "predictEcdsaAirdropAddress",
23
- args: [mode, deployer, userSalt]
24
- }),
19
+ queryKey: airdropKeys.predictEcdsaAddress(
20
+ { chainId, address: resolvedAddress },
21
+ mode,
22
+ deployer,
23
+ userSalt
24
+ ),
25
25
  queryFn: () => client.predictEcdsaAirdropAddress({ params, mode, deployer, userSalt }),
26
26
  enabled: Boolean(client && (args.query?.enabled ?? true))
27
27
  });
@@ -31,12 +31,12 @@ function usePredictMerkleAirdropAddress(args) {
31
31
  const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
32
32
  return useQuery({
33
33
  ...args.query,
34
- queryKey: airdropQueryKey({
35
- chainId,
36
- address: resolvedAddress,
37
- fn: "predictMerkleAirdropAddress",
38
- args: [mode, deployer, userSalt]
39
- }),
34
+ queryKey: airdropKeys.predictMerkleAddress(
35
+ { chainId, address: resolvedAddress },
36
+ mode,
37
+ deployer,
38
+ userSalt
39
+ ),
40
40
  queryFn: () => client.predictMerkleAirdropAddress({ params, mode, deployer, userSalt }),
41
41
  enabled: Boolean(client && (args.query?.enabled ?? true))
42
42
  });
@@ -57,12 +57,9 @@ function useClearCompliancePolicy(options = {}) {
57
57
  queryKey: airdropKeys.compliancePolicy(scope, variables.creator)
58
58
  });
59
59
  void queryClient.invalidateQueries({
60
- queryKey: airdropQueryKey({
61
- ...scope,
62
- fn: "effectiveDelegateToCompliance",
63
- args: [variables.creator]
64
- })
60
+ queryKey: airdropKeys.effectiveDelegateToCompliance(scope, variables.creator)
65
61
  });
62
+ void queryClient.invalidateQueries({ queryKey: airdropKeys.preflightCreateAll(scope) });
66
63
  }
67
64
  });
68
65
  }
@@ -79,11 +76,7 @@ function useClearUpgradeabilityPolicy(options = {}) {
79
76
  onSuccess: (_hash, variables) => {
80
77
  const scope = { chainId, address: resolvedAddress };
81
78
  void queryClient.invalidateQueries({
82
- queryKey: airdropQueryKey({
83
- ...scope,
84
- fn: "effectiveUpgradeable",
85
- args: [variables.creator]
86
- })
79
+ queryKey: airdropKeys.effectiveUpgradeable(scope, variables.creator)
87
80
  });
88
81
  void queryClient.invalidateQueries({
89
82
  queryKey: airdropKeys.upgradeabilityPolicy(scope, variables.creator)
@@ -111,6 +104,9 @@ function useDisableCustomFee(options = {}) {
111
104
  void queryClient.invalidateQueries({
112
105
  queryKey: airdropKeys.customFee({ chainId, address: resolvedAddress }, variables.creator)
113
106
  });
107
+ void queryClient.invalidateQueries({
108
+ queryKey: airdropKeys.preflightCreateAll({ chainId, address: resolvedAddress })
109
+ });
114
110
  }
115
111
  });
116
112
  }
@@ -124,12 +120,7 @@ function useEcdsaInitCodeHash(args) {
124
120
  // implementation pointer, which is what this read reports) moves the
125
121
  // result. If a future factory version makes params hash-affecting, this
126
122
  // key has to grow with it.
127
- queryKey: airdropQueryKey({
128
- chainId,
129
- address: resolvedAddress,
130
- fn: "getEcdsaInitCodeHash",
131
- args: [mode]
132
- }),
123
+ queryKey: airdropKeys.ecdsaInitCodeHash({ chainId, address: resolvedAddress }, mode),
133
124
  queryFn: () => client.getEcdsaInitCodeHash({ params, mode }),
134
125
  enabled: Boolean(client && (args.query?.enabled ?? true))
135
126
  });
@@ -138,12 +129,7 @@ function useFactoryComplianceDelegate(args = {}) {
138
129
  const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(args);
139
130
  return useQuery({
140
131
  ...args.query,
141
- queryKey: airdropQueryKey({
142
- chainId,
143
- address: resolvedAddress,
144
- fn: "complianceDelegate",
145
- args: []
146
- }),
132
+ queryKey: airdropKeys.complianceDelegate({ chainId, address: resolvedAddress }),
147
133
  queryFn: () => client.complianceDelegate(),
148
134
  enabled: Boolean(client && (args.query?.enabled ?? true))
149
135
  });
@@ -347,12 +333,7 @@ function useMerkleInitCodeHash(args) {
347
333
  return useQuery({
348
334
  ...args.query,
349
335
  // `params` omitted deliberately — see useEcdsaInitCodeHash for why.
350
- queryKey: airdropQueryKey({
351
- chainId,
352
- address: resolvedAddress,
353
- fn: "getMerkleInitCodeHash",
354
- args: [mode]
355
- }),
336
+ queryKey: airdropKeys.merkleInitCodeHash({ chainId, address: resolvedAddress }, mode),
356
337
  queryFn: () => client.getMerkleInitCodeHash({ params, mode }),
357
338
  enabled: Boolean(client && (args.query?.enabled ?? true))
358
339
  });
@@ -369,12 +350,10 @@ function useSetComplianceDelegate(options = {}) {
369
350
  },
370
351
  onSuccess: () => {
371
352
  void queryClient.invalidateQueries({
372
- queryKey: airdropQueryKey({
373
- chainId,
374
- address: resolvedAddress,
375
- fn: "complianceDelegate",
376
- args: []
377
- })
353
+ queryKey: airdropKeys.complianceDelegate({ chainId, address: resolvedAddress })
354
+ });
355
+ void queryClient.invalidateQueries({
356
+ queryKey: airdropKeys.preflightCreateAll({ chainId, address: resolvedAddress })
378
357
  });
379
358
  }
380
359
  });
@@ -393,6 +372,9 @@ function useSetComplianceManagerImpl(options = {}) {
393
372
  void queryClient.invalidateQueries({
394
373
  queryKey: airdropKeys.implementations({ chainId, address: resolvedAddress })
395
374
  });
375
+ void queryClient.invalidateQueries({
376
+ queryKey: airdropKeys.preflightCreateAll({ chainId, address: resolvedAddress })
377
+ });
396
378
  }
397
379
  });
398
380
  }
@@ -412,12 +394,9 @@ function useSetCompliancePolicy(options = {}) {
412
394
  queryKey: airdropKeys.compliancePolicy(scope, variables.creator)
413
395
  });
414
396
  void queryClient.invalidateQueries({
415
- queryKey: airdropQueryKey({
416
- ...scope,
417
- fn: "effectiveDelegateToCompliance",
418
- args: [variables.creator]
419
- })
397
+ queryKey: airdropKeys.effectiveDelegateToCompliance(scope, variables.creator)
420
398
  });
399
+ void queryClient.invalidateQueries({ queryKey: airdropKeys.preflightCreateAll(scope) });
421
400
  }
422
401
  });
423
402
  }
@@ -438,6 +417,9 @@ function useSetCustomFee(options = {}) {
438
417
  void queryClient.invalidateQueries({
439
418
  queryKey: airdropKeys.customFee({ chainId, address: resolvedAddress }, variables.creator)
440
419
  });
420
+ void queryClient.invalidateQueries({
421
+ queryKey: airdropKeys.preflightCreateAll({ chainId, address: resolvedAddress })
422
+ });
441
423
  }
442
424
  });
443
425
  }
@@ -453,15 +435,17 @@ function useSetDefaultDelegateToCompliance(options = {}) {
453
435
  },
454
436
  onSuccess: () => {
455
437
  void queryClient.invalidateQueries({
456
- queryKey: airdropQueryKeyPrefix({
438
+ queryKey: airdropKeys.effectiveDelegateToComplianceAll({
457
439
  chainId,
458
- address: resolvedAddress,
459
- fn: "effectiveDelegateToCompliance"
440
+ address: resolvedAddress
460
441
  })
461
442
  });
462
443
  void queryClient.invalidateQueries({
463
444
  queryKey: airdropKeys.compliancePolicyAll({ chainId, address: resolvedAddress })
464
445
  });
446
+ void queryClient.invalidateQueries({
447
+ queryKey: airdropKeys.preflightCreateAll({ chainId, address: resolvedAddress })
448
+ });
465
449
  }
466
450
  });
467
451
  }
@@ -482,6 +466,9 @@ function useSetDefaultGasFee(options = {}) {
482
466
  void queryClient.invalidateQueries({
483
467
  queryKey: airdropKeys.fees({ chainId, address: resolvedAddress })
484
468
  });
469
+ void queryClient.invalidateQueries({
470
+ queryKey: airdropKeys.preflightCreateAll({ chainId, address: resolvedAddress })
471
+ });
485
472
  }
486
473
  });
487
474
  }
@@ -502,6 +489,9 @@ function useSetMaxGasFee(options = {}) {
502
489
  void queryClient.invalidateQueries({
503
490
  queryKey: airdropKeys.resolvedGasFeeAll({ chainId, address: resolvedAddress })
504
491
  });
492
+ void queryClient.invalidateQueries({
493
+ queryKey: airdropKeys.preflightCreateAll({ chainId, address: resolvedAddress })
494
+ });
505
495
  }
506
496
  });
507
497
  }
@@ -518,7 +508,7 @@ function useSetDefaultUpgradeable(options = {}) {
518
508
  onSuccess: () => {
519
509
  const scope = { chainId, address: resolvedAddress };
520
510
  void queryClient.invalidateQueries({
521
- queryKey: airdropQueryKeyPrefix({ ...scope, fn: "effectiveUpgradeable" })
511
+ queryKey: airdropKeys.effectiveUpgradeableAll(scope)
522
512
  });
523
513
  void queryClient.invalidateQueries({
524
514
  queryKey: airdropKeys.upgradeabilityPolicyAll(scope)
@@ -542,12 +532,8 @@ function useSetEcdsaImplementation(options = {}) {
542
532
  onSuccess: () => {
543
533
  const scope = { chainId, address: resolvedAddress };
544
534
  void queryClient.invalidateQueries({ queryKey: airdropKeys.implementations(scope) });
545
- void queryClient.invalidateQueries({
546
- queryKey: airdropQueryKeyPrefix({ ...scope, fn: "getEcdsaInitCodeHash" })
547
- });
548
- void queryClient.invalidateQueries({
549
- queryKey: airdropQueryKeyPrefix({ ...scope, fn: "predictEcdsaAirdropAddress" })
550
- });
535
+ void queryClient.invalidateQueries({ queryKey: airdropKeys.ecdsaInitCodeHashAll(scope) });
536
+ void queryClient.invalidateQueries({ queryKey: airdropKeys.predictEcdsaAddressAll(scope) });
551
537
  void queryClient.invalidateQueries({
552
538
  queryKey: airdropKeys.preflightCreateAll(scope)
553
539
  });
@@ -584,12 +570,8 @@ function useSetMerkleImplementation(options = {}) {
584
570
  onSuccess: () => {
585
571
  const scope = { chainId, address: resolvedAddress };
586
572
  void queryClient.invalidateQueries({ queryKey: airdropKeys.implementations(scope) });
587
- void queryClient.invalidateQueries({
588
- queryKey: airdropQueryKeyPrefix({ ...scope, fn: "getMerkleInitCodeHash" })
589
- });
590
- void queryClient.invalidateQueries({
591
- queryKey: airdropQueryKeyPrefix({ ...scope, fn: "predictMerkleAirdropAddress" })
592
- });
573
+ void queryClient.invalidateQueries({ queryKey: airdropKeys.merkleInitCodeHashAll(scope) });
574
+ void queryClient.invalidateQueries({ queryKey: airdropKeys.predictMerkleAddressAll(scope) });
593
575
  void queryClient.invalidateQueries({
594
576
  queryKey: airdropKeys.preflightCreateAll(scope)
595
577
  });
@@ -609,11 +591,7 @@ function useSetUpgradeabilityPolicy(options = {}) {
609
591
  onSuccess: (_hash, variables) => {
610
592
  const scope = { chainId, address: resolvedAddress };
611
593
  void queryClient.invalidateQueries({
612
- queryKey: airdropQueryKey({
613
- ...scope,
614
- fn: "effectiveUpgradeable",
615
- args: [variables.creator]
616
- })
594
+ queryKey: airdropKeys.effectiveUpgradeable(scope, variables.creator)
617
595
  });
618
596
  void queryClient.invalidateQueries({
619
597
  queryKey: airdropKeys.upgradeabilityPolicy(scope, variables.creator)
@@ -17,7 +17,9 @@ export interface ClearCompliancePolicyArgs extends WriteAccountOverride {
17
17
  * the override had been.
18
18
  *
19
19
  * **Invalidates:** `fn "compliancePolicy"` and
20
- * `fn "effectiveDelegateToCompliance"`, both keyed on `args.creator`.
20
+ * `fn "effectiveDelegateToCompliance"`, both keyed on `args.creator`, and every
21
+ * cached {@link usePreflightCreateAirdrop} report on this factory, whose
22
+ * `commitments.complianceDelegate` this write moves.
21
23
  *
22
24
  * @example
23
25
  * const clearPolicy = useClearCompliancePolicy();
@@ -15,7 +15,9 @@ export interface DisableCustomFeeArgs extends WriteAccountOverride {
15
15
  *
16
16
  * **Invalidates:** `useFactoryCustomFee({ creator })` for the TARGET creator -
17
17
  * `variables.creator`, never the sending admin. Also every `useResolveGasFee`
18
- * entry: dropping the override sends this creator back to the default.
18
+ * entry: dropping the override sends this creator back to the default. Also every
19
+ * cached {@link usePreflightCreateAirdrop} report on this factory, whose
20
+ * fee blockers (the `maxGasFee` ceiling and `GasFeeNotAcceptedError`) this write moves.
19
21
  *
20
22
  * @example
21
23
  * const disableCustomFee = useDisableCustomFee();
@@ -7,10 +7,8 @@ export type UseFactoryComplianceDelegateArgs = AirdropHookOptions<Address>;
7
7
  * The platform-designated compliance delegate the FACTORY wires into every
8
8
  * new compliance-manager clone.
9
9
  *
10
- * Deliberately unbundled: its being set is what gates
11
- * {@link useSetDefaultDelegateToCompliance} with `on: true` (that write
12
- * reverts `ZeroComplianceDelegate` against the zero address), so an admin
13
- * panel reads it alone to decide whether to enable the toggle at all.
10
+ * Never zero: the constructor seeds it and `setComplianceDelegate` rejects zero. Read it
11
+ * to show which platform delegate policy-ON creates will wire.
14
12
  *
15
13
  * **Not** `ComplianceManagerClient.complianceDelegate()`. That method has the
16
14
  * same name on a different contract and returns the delegate one already-
@@ -11,18 +11,18 @@ export interface SetComplianceDelegateArgs extends WriteAccountOverride {
11
11
  * Set the platform-designated compliance delegate that every new
12
12
  * compliance-manager clone wires in. Requires `COMPLIANCE_WIRING_ROLE`.
13
13
  *
14
- * **Ordering is load-bearing.** Call this before
15
- * {@link useSetDefaultDelegateToCompliance} with `on: true` - turning
16
- * delegation on while no delegate is set reverts `ZeroComplianceDelegate`. An
17
- * admin panel must sequence the two writes, and read
18
- * {@link useFactoryComplianceDelegate} to decide whether the toggle is even
19
- * offerable.
14
+ * The factory's constructor seeded a non-zero delegate with delegation ON, so this only
15
+ * rotates it: it can never be cleared, and the zero address always reverts
16
+ * `ZeroComplianceDelegate`. There is no ordering against
17
+ * {@link useSetDefaultDelegateToCompliance}.
20
18
  *
21
19
  * Applies to FUTURE clones only; it cannot retro-wire managers that already
22
20
  * exist.
23
21
  *
24
22
  * **Invalidates:** the factory's `fn "complianceDelegate"` entry
25
- * ({@link useFactoryComplianceDelegate}).
23
+ * ({@link useFactoryComplianceDelegate}), and every cached
24
+ * {@link usePreflightCreateAirdrop} report on this factory, whose
25
+ * `commitments.complianceDelegate` this write moves.
26
26
  *
27
27
  * @example
28
28
  * const setDelegate = useSetComplianceDelegate();
@@ -16,7 +16,9 @@ export interface SetComplianceManagerImplArgs extends WriteAccountOverride {
16
16
  * fleet-wide upgrade.
17
17
  *
18
18
  * **Invalidates:** the factory's `fn "implementations"` entry, which carries
19
- * `complianceManagerImpl` alongside the ECDSA/Merkle pointers.
19
+ * `complianceManagerImpl` alongside the ECDSA/Merkle pointers, and every cached
20
+ * {@link usePreflightCreateAirdrop} report on this factory, whose
21
+ * `commitments.complianceManagerImpl` this write moves.
20
22
  *
21
23
  * @example
22
24
  * const setImpl = useSetComplianceManagerImpl();
@@ -17,7 +17,8 @@ export interface SetCompliancePolicyArgs extends WriteAccountOverride {
17
17
  * `fn "effectiveDelegateToCompliance"`, both keyed on `args.creator` - the
18
18
  * TARGET creator, never the sending admin. Keying on the sender would leave
19
19
  * the panel's view of the creator it just edited stale while invalidating an
20
- * entry nobody rendered.
20
+ * entry nobody rendered. Also every cached {@link usePreflightCreateAirdrop}
21
+ * report on this factory, whose `commitments.complianceDelegate` this write moves.
21
22
  *
22
23
  * @example
23
24
  * const setPolicy = useSetCompliancePolicy();
@@ -18,7 +18,9 @@ export interface SetCustomFeeArgs extends WriteAccountOverride {
18
18
  * `variables.creator`, never the sending admin. `account` is the submitter and
19
19
  * has no cache entry of its own here, so keying the invalidation off it would
20
20
  * refresh the wrong row and leave the edited one stale. Also every
21
- * `useResolveGasFee` entry, since an override is what that hook resolves.
21
+ * `useResolveGasFee` entry, since an override is what that hook resolves, and every
22
+ * cached {@link usePreflightCreateAirdrop} report on this factory, whose
23
+ * fee blockers (the `maxGasFee` ceiling and `GasFeeNotAcceptedError`) this write moves.
22
24
  *
23
25
  * @example
24
26
  * const setCustomFee = useSetCustomFee();
@@ -11,16 +11,17 @@ export interface SetDefaultDelegateToComplianceArgs extends WriteAccountOverride
11
11
  * Set the factory-wide default for whether new instances delegate compliance
12
12
  * disclosure to the platform delegate. Requires `COMPLIANCE_WIRING_ROLE`.
13
13
  *
14
- * **Ordering is load-bearing.** `on: true` reverts `ZeroComplianceDelegate`
15
- * unless {@link useSetComplianceDelegate} has already set a delegate - read
16
- * {@link useFactoryComplianceDelegate} first and sequence the two writes.
14
+ * The default starts ON at factory construction; `on: false` is the deliberate
15
+ * global opt-out. A per-creator {@link useSetCompliancePolicy} override still wins.
17
16
  *
18
17
  * **Invalidates:** the `fn "effectiveDelegateToCompliance"` PREFIX and the
19
18
  * `fn "compliancePolicy"` PREFIX - every cached creator at once, because this
20
19
  * write is chain-wide: any creator without an override moves with the
21
20
  * default, and {@link useFactoryCompliancePolicy}'s bundle carries the
22
21
  * resolved `effective` field. Contrast {@link useSetCompliancePolicy}, which
23
- * stays keyed on the one creator it targets.
22
+ * stays keyed on the one creator it targets. Also every cached
23
+ * {@link usePreflightCreateAirdrop} report on this factory, whose
24
+ * `commitments.complianceDelegate` this write moves.
24
25
  *
25
26
  * @example
26
27
  * const setDefault = useSetDefaultDelegateToCompliance();
@@ -19,7 +19,9 @@ export interface SetDefaultGasFeeArgs extends WriteAccountOverride {
19
19
  * `useResolveGasFee` entry - the default is what resolves for every creator
20
20
  * without an override, so all of them move at once. Deliberately NOT any
21
21
  * instance's fn `"gasFee"` key: those are frozen at create and invalidating
22
- * them would refetch unchanged values.
22
+ * them would refetch unchanged values. Also every cached
23
+ * {@link usePreflightCreateAirdrop} report on this factory, whose
24
+ * fee blockers (the `maxGasFee` ceiling and `GasFeeNotAcceptedError`) this write moves.
23
25
  *
24
26
  * @example
25
27
  * const setDefaultFee = useSetDefaultGasFee();
@@ -20,9 +20,13 @@ export interface SetMaxGasFeeArgs extends WriteAccountOverride {
20
20
  * it is lowered too, so a reduction is two steps, not one.
21
21
  *
22
22
  * **Invalidates:** this factory's `useFactoryFees` entry (fn `"fees"`, which
23
- * carries `maxGasFee`) and every `useResolveGasFee` entry, since the ceiling
24
- * bounds what any creator's fee can resolve to. Deliberately NOT any instance's
25
- * fn `"gasFee"` key - an instance's fee is frozen at create and cannot move.
23
+ * carries `maxGasFee`) and every `useResolveGasFee` entry. The ceiling is checked
24
+ * at create time, and lowering it below existing fees is allowed: a create whose
25
+ * resolved fee is above it then reverts `GasFeeExceedsMaximum`. Deliberately NOT
26
+ * any instance's fn `"gasFee"` key - an instance's fee is frozen at create and
27
+ * cannot move. Also every cached {@link usePreflightCreateAirdrop} report on this
28
+ * factory: the preflight reports a resolved fee above the ceiling as a blocker,
29
+ * so the new ceiling must reach it.
26
30
  *
27
31
  * @example
28
32
  * const setCeiling = useSetMaxGasFee();
@@ -49,17 +49,15 @@ export interface ExtractGrantedHandleArgs {
49
49
  * `Allowed` event survives the `account` filter, so the choice between first
50
50
  * and last is moot today:
51
51
  *
52
- * - `adminGetCurrentBalance` — a single `FHE.allow(balance, msg.sender)`
53
- * (`ConfidentialAirdropBase.sol:358`).
54
- * - `adminDiscloseBalanceToParty` — a single `FHE.allow(balance, party)` (`:367`).
52
+ * - `adminGetCurrentBalance` - a single `FHE.allow(balance, msg.sender)`.
53
+ * - `adminDiscloseBalanceToParty` - a single `FHE.allow(balance, party)`.
55
54
  * - `adminBatchDiscloseBalanceToParties` — N grants, but the balance is read
56
- * once (`:377`) and the *same* handle is fanned out (`:379`), so every
57
- * candidate carries an identical value and ordering cannot matter.
55
+ * once and the *same* handle is fanned out, so every candidate carries an
56
+ * identical value and ordering cannot matter.
58
57
  * - `getClaimAmount` on both variants — the sibling grants target other
59
58
  * addresses: `FHE.allowThis` grants `address(this)` and `_grantCompliance`
60
- * grants the manager clone (`ConfidentialAirdropBase.sol:431`), leaving one
61
- * grant to the caller (`ECDSAConfidentialAirdrop.sol:166-167`,
62
- * `MerkleConfidentialAirdrop.sol:264-266`).
59
+ * grants the manager clone, leaving one grant to the preview's grantee: the
60
+ * caller on ECDSA (`getClaimAmount`), `account` on Merkle (`_outstandingOf`).
63
61
  *
64
62
  * Last-wins is therefore chosen for entrypoints that do not exist yet, over
65
63
  * `fhe-vesting`'s throw-on-ambiguous: a future compound view that grants twice
@@ -68,12 +66,50 @@ export interface ExtractGrantedHandleArgs {
68
66
  *
69
67
  * Note what is NOT a motivating case: the Merkle `claim` path does grant an
70
68
  * intermediate handle before the outstanding one, but `claim` /
71
- * `claimAndUnwrap` return void (`IMerkleConfidentialAirdrop.sol:51-70`), so
69
+ * `claimAndUnwrap` return void (`IMerkleConfidentialAirdrop`), so
72
70
  * they run as plain writes and their receipts never reach this function.
73
71
  *
74
72
  * @throws {@link ReceiptEventNotFoundError} when no `Allowed` event names `account`.
75
73
  */
76
74
  export declare function extractGrantedHandle(args: ExtractGrantedHandleArgs): Hex;
75
+ /**
76
+ * The unwrap a `claimAndUnwrap` started, decoded from the instance's
77
+ * `ClaimedAndUnwrapInitiated` event.
78
+ *
79
+ * @alpha
80
+ */
81
+ export interface UnwrapRequest {
82
+ /** The claim identity, which is always the claim transaction's sender. */
83
+ claimant: Address;
84
+ /** The underlying ERC-20 recipient that `finalizeUnwrap` pays. */
85
+ beneficiary: Address;
86
+ /** The ECDSA dedup key (claimant address or `dedupId`) or the Merkle leaf. */
87
+ claimKey: Hex;
88
+ /**
89
+ * The wrapper's unwrap request id, the input to its `finalizeUnwrap`. With the stock
90
+ * `ERC7984ERC20Wrapper` it is also the burned amount's handle, which the wrapper makes
91
+ * publicly decryptable in the claim transaction.
92
+ */
93
+ unwrapRequestId: Hex;
94
+ }
95
+ /**
96
+ * What {@link AirdropBaseClient.parseUnwrapRequest} reads: a viem receipt, or its logs.
97
+ *
98
+ * @alpha
99
+ */
100
+ export type UnwrapRequestSource = readonly {
101
+ address: Address;
102
+ topics: readonly Hex[];
103
+ data: Hex;
104
+ }[] | {
105
+ logs: readonly {
106
+ address: Address;
107
+ topics: readonly Hex[];
108
+ data: Hex;
109
+ }[];
110
+ transactionHash?: Hex | undefined;
111
+ status?: "success" | "reverted" | undefined;
112
+ };
77
113
  /** @alpha */
78
114
  export interface AirdropBaseClientConfig {
79
115
  publicClient: PublicClient;
@@ -142,6 +178,11 @@ export interface WriteAccountOverride {
142
178
  * they mutate ACL state, so they are transactions, and their result must be
143
179
  * recovered from the receipt. See {@link extractGrantedHandle}.
144
180
  *
181
+ * Those encrypted views and disclosures have no `waitForReceipt: false` option
182
+ * for Safe / multisig signers: the handle is only useful to an account that
183
+ * can user-decrypt in-session, so run them from an EOA or a delegate. The other
184
+ * writes here return a bare hash and never wait on a receipt.
185
+ *
145
186
  * @example
146
187
  * const airdrop = new AirdropBaseClient({ publicClient, walletClient, address });
147
188
  * const { handle } = await airdrop.adminGetCurrentBalance();
@@ -197,6 +238,10 @@ export declare class AirdropBaseClient {
197
238
  * The amount is not a parameter and never appears in plaintext anywhere:
198
239
  * the contract reads its own encrypted balance and moves all of it.
199
240
  *
241
+ * Refused while the campaign is unpaused inside its claim window (`ClawbackRequiresPause`,
242
+ * surfaced as {@link ClawbackRequiresPauseError}): pause first, or run it outside the window
243
+ * (before `startTime` or after `endTime`).
244
+ *
200
245
  * @returns The transaction hash.
201
246
  */
202
247
  withdrawConfidential(args: {
@@ -213,6 +258,19 @@ export declare class AirdropBaseClient {
213
258
  recipient: Address;
214
259
  amount: bigint;
215
260
  } & WriteAccountOverride): Promise<Hex>;
261
+ /**
262
+ * Sweep ETH that landed on a ZERO-FEE instance without running its code (a forced send,
263
+ * a transfer to the predicted address before deploy). Requires `RESCUER_ROLE`.
264
+ *
265
+ * Refused while `gasFee() > 0` (`NativeRescueRequiresZeroFee`, surfaced as
266
+ * {@link NativeRescueRequiresZeroFeeError}): on a fee-charging campaign the ETH is fee
267
+ * revenue and belongs to `withdrawGasFee`. Reverts `ZeroBalance` with nothing to sweep.
268
+ *
269
+ * @returns The transaction hash.
270
+ */
271
+ rescueNativeToken(args: {
272
+ recipient: Address;
273
+ } & WriteAccountOverride): Promise<Hex>;
216
274
  /**
217
275
  * Sweep a plain ERC-20 that was sent to the instance by mistake. Requires
218
276
  * `RESCUER_ROLE`.
@@ -257,6 +315,10 @@ export declare class AirdropBaseClient {
257
315
  endTime(): Promise<number>;
258
316
  /** Whether claimants may unwrap to the underlying ERC-20 as part of a claim. */
259
317
  unwrappable(): Promise<boolean>;
318
+ /** Whether `extendClaimWindow` is permitted on this instance; frozen at create. */
319
+ canExtendClaimWindow(): Promise<boolean>;
320
+ /** The block this instance was initialized in (L2 block on Arbitrum). */
321
+ deploymentBlockNumber(): Promise<bigint>;
260
322
  /** The instance's own compliance-manager clone — the only contract granted ACL on campaign handles. */
261
323
  complianceManager(): Promise<Address>;
262
324
  /** Per-claim ETH fee in wei; `0` on a fee-free campaign. */
@@ -283,7 +345,7 @@ export declare class AirdropBaseClient {
283
345
  WINDOW_ADMIN_ROLE(): Promise<Hex>;
284
346
  /** Gates {@link withdrawConfidential}. */
285
347
  TREASURY_ROLE(): Promise<Hex>;
286
- /** Gates {@link rescueERC20} / {@link rescueOtherConfidentialToken}. */
348
+ /** Gates {@link rescueERC20} / {@link rescueOtherConfidentialToken} / {@link rescueNativeToken}. */
287
349
  RESCUER_ROLE(): Promise<Hex>;
288
350
  /** Gates {@link withdrawGasFee}. The contract refuses to leave it empty on a fee-charging campaign. */
289
351
  FEE_COLLECTOR_ROLE(): Promise<Hex>;
@@ -578,6 +640,29 @@ export declare class AirdropBaseClient {
578
640
  handles: readonly Hex[];
579
641
  party: Address;
580
642
  } & WriteAccountOverride): Promise<Hex>;
643
+ /**
644
+ * Decode the unwrap request a `claimAndUnwrap` started, from its receipt or logs.
645
+ *
646
+ * Pure: no RPC. Only this instance's `ClaimedAndUnwrapInitiated` counts, so a
647
+ * receipt that also carries another instance's event (a batched transaction) still
648
+ * resolves to this one. Pass the result's `unwrapRequestId` to the wrapper's
649
+ * `finalizeUnwrap`; with Zama's SDK that is
650
+ * `sdk.createToken(wrapper).finalizeUnwrap(unwrapRequestId)`, which fetches the
651
+ * public-decryption proof itself.
652
+ *
653
+ * @throws {@link ReceiptEventNotFoundError} when no such event from this instance is present.
654
+ * @throws {@link ReceiptEventAmbiguousError} when the transaction started more than one.
655
+ */
656
+ parseUnwrapRequest(source: UnwrapRequestSource): UnwrapRequest;
657
+ /**
658
+ * Wait for the `claimAndUnwrap` transaction `hash` to be mined and decode the unwrap
659
+ * request it started; see {@link parseUnwrapRequest}.
660
+ *
661
+ * `hash` must be the on-chain transaction hash. A Safe returns a `safeTxHash`, which
662
+ * no node can wait on: resolve the executed transaction first, or pass its receipt to
663
+ * {@link parseUnwrapRequest}.
664
+ */
665
+ readUnwrapRequest(hash: Hex): Promise<UnwrapRequest>;
581
666
  /**
582
667
  * Submit a transaction for a function that returns an encrypted handle via
583
668
  * `FHE.allow`, and recover that handle from the receipt.