@tokenops/sdk 2.0.0-alpha.1 → 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.
Files changed (145) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +5 -5
  3. package/dist/{chunk-JZLGCTGK.cjs → chunk-3YHBO2DL.cjs} +2 -2
  4. package/dist/{chunk-H5POPGOZ.js → chunk-44YJPMQC.js} +1 -1
  5. package/dist/{chunk-DZHYSUGY.js → chunk-A4DCEE33.js} +11 -5
  6. package/dist/{chunk-M4IT6DNJ.cjs → chunk-AREQJHKA.cjs} +108 -3
  7. package/dist/chunk-EBLBPUPI.cjs +255 -0
  8. package/dist/chunk-EYDA6Q6C.js +245 -0
  9. package/dist/{chunk-XAYGD4E4.cjs → chunk-FEDX7B6T.cjs} +3 -3
  10. package/dist/{chunk-JQYC66TO.cjs → chunk-FHWSBGWE.cjs} +5 -5
  11. package/dist/{chunk-5576FRT3.cjs → chunk-FT5H2Q7Y.cjs} +11 -5
  12. package/dist/{chunk-456VDDA3.js → chunk-GADGBQJO.js} +78 -25
  13. package/dist/{chunk-6NAVMWZQ.js → chunk-IGO5XSPS.js} +2 -2
  14. package/dist/{chunk-CTED3MTR.cjs → chunk-IUKKNJ2R.cjs} +82 -29
  15. package/dist/{chunk-FGEB7RMY.cjs → chunk-MM5BV5CS.cjs} +4 -4
  16. package/dist/{chunk-335Z2W67.js → chunk-PYYSB5ZN.js} +1 -1
  17. package/dist/{chunk-PUX5VXDB.cjs → chunk-PZZK3O3S.cjs} +1040 -42
  18. package/dist/{chunk-74QFZ5MK.js → chunk-SPLNGUFF.js} +1 -1
  19. package/dist/{chunk-6PXXGACR.cjs → chunk-UHHMVBLU.cjs} +2 -2
  20. package/dist/{chunk-O5676ZWY.js → chunk-VW356KR3.js} +108 -5
  21. package/dist/{chunk-EAJ7SYHE.js → chunk-WJMEBBU7.js} +1 -1
  22. package/dist/{chunk-GKKDAW44.js → chunk-X7WBPCEU.js} +1026 -32
  23. package/dist/core/addresses.d.ts +4 -4
  24. package/dist/core/errors.d.ts +1 -1
  25. package/dist/fhe/types.d.ts +2 -2
  26. package/dist/fhe-airdrop/abis/merkle.d.ts +24 -12
  27. package/dist/fhe-airdrop/advanced/index.cjs +4 -4
  28. package/dist/fhe-airdrop/advanced/index.js +1 -1
  29. package/dist/fhe-airdrop/advanced/react/index.cjs +590 -9
  30. package/dist/fhe-airdrop/advanced/react/index.d.cts +34 -0
  31. package/dist/fhe-airdrop/advanced/react/index.d.ts +34 -0
  32. package/dist/fhe-airdrop/advanced/react/index.js +561 -7
  33. package/dist/fhe-airdrop/advanced/react/useClearCompliancePolicy.d.ts +28 -0
  34. package/dist/fhe-airdrop/advanced/react/useClearUpgradeabilityPolicy.d.ts +26 -0
  35. package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +25 -0
  36. package/dist/fhe-airdrop/advanced/react/useEcdsaInitCodeHash.d.ts +30 -0
  37. package/dist/fhe-airdrop/advanced/react/useFactoryComplianceDelegate.d.ts +25 -0
  38. package/dist/fhe-airdrop/advanced/react/useFactoryCompliancePolicy.d.ts +38 -0
  39. package/dist/fhe-airdrop/advanced/react/useFactoryCustomFee.d.ts +24 -0
  40. package/dist/fhe-airdrop/advanced/react/useFactoryGrantRole.d.ts +32 -0
  41. package/dist/fhe-airdrop/advanced/react/useFactoryHasRole.d.ts +27 -0
  42. package/dist/fhe-airdrop/advanced/react/useFactoryImplementations.d.ts +33 -0
  43. package/dist/fhe-airdrop/advanced/react/useFactoryRenounceRole.d.ts +36 -0
  44. package/dist/fhe-airdrop/advanced/react/useFactoryRevokeRole.d.ts +35 -0
  45. package/dist/fhe-airdrop/advanced/react/useFactoryRoleConstants.d.ts +46 -0
  46. package/dist/fhe-airdrop/advanced/react/useFactoryRoleMembers.d.ts +47 -0
  47. package/dist/fhe-airdrop/advanced/react/useFactoryUpgradeabilityPolicy.d.ts +39 -0
  48. package/dist/fhe-airdrop/advanced/react/useMerkleInitCodeHash.d.ts +24 -0
  49. package/dist/fhe-airdrop/advanced/react/useSetComplianceDelegate.d.ts +33 -0
  50. package/dist/fhe-airdrop/advanced/react/useSetComplianceManagerImpl.d.ts +27 -0
  51. package/dist/fhe-airdrop/advanced/react/useSetCompliancePolicy.d.ts +28 -0
  52. package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +28 -0
  53. package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +31 -0
  54. package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +28 -0
  55. package/dist/fhe-airdrop/advanced/react/useSetDefaultUpgradeable.d.ts +27 -0
  56. package/dist/fhe-airdrop/advanced/react/useSetEcdsaImplementation.d.ts +34 -0
  57. package/dist/fhe-airdrop/advanced/react/useSetFeeCollector.d.ts +27 -0
  58. package/dist/fhe-airdrop/advanced/react/useSetMerkleImplementation.d.ts +30 -0
  59. package/dist/fhe-airdrop/advanced/react/useSetUpgradeabilityPolicy.d.ts +31 -0
  60. package/dist/fhe-airdrop/airdrop-base.d.ts +8 -0
  61. package/dist/fhe-airdrop/campaign.d.ts +61 -20
  62. package/dist/fhe-airdrop/constants.d.ts +1 -1
  63. package/dist/fhe-airdrop/errors.d.ts +28 -0
  64. package/dist/fhe-airdrop/guards.d.ts +46 -2
  65. package/dist/fhe-airdrop/index.cjs +74 -971
  66. package/dist/fhe-airdrop/index.d.cts +2 -2
  67. package/dist/fhe-airdrop/index.d.ts +2 -2
  68. package/dist/fhe-airdrop/index.js +8 -927
  69. package/dist/fhe-airdrop/merkle-tree.d.ts +32 -38
  70. package/dist/fhe-airdrop/merkle.d.ts +52 -31
  71. package/dist/fhe-airdrop/react/_shared.d.ts +13 -0
  72. package/dist/fhe-airdrop/react/index.cjs +934 -84
  73. package/dist/fhe-airdrop/react/index.d.cts +49 -3
  74. package/dist/fhe-airdrop/react/index.d.ts +49 -3
  75. package/dist/fhe-airdrop/react/index.js +825 -22
  76. package/dist/fhe-airdrop/react/keys.d.ts +90 -0
  77. package/dist/fhe-airdrop/react/useAccessEcdsaClaimAmount.d.ts +26 -0
  78. package/dist/fhe-airdrop/react/useAccessMerkleClaimAmount.d.ts +27 -0
  79. package/dist/fhe-airdrop/react/useAddComplianceDelegate.d.ts +37 -0
  80. package/dist/fhe-airdrop/react/useAdminBatchDiscloseBalanceToParties.d.ts +36 -0
  81. package/dist/fhe-airdrop/react/useAdminDiscloseBalanceToParty.d.ts +31 -0
  82. package/dist/fhe-airdrop/react/useAdminGetCurrentBalance.d.ts +27 -0
  83. package/dist/fhe-airdrop/react/useAirdropConfig.d.ts +49 -0
  84. package/dist/fhe-airdrop/react/useAirdropDeploymentMode.d.ts +28 -0
  85. package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +35 -0
  86. package/dist/fhe-airdrop/react/useAirdropRenounceRole.d.ts +36 -0
  87. package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +33 -0
  88. package/dist/fhe-airdrop/react/useAirdropRoleAdmin.d.ts +28 -0
  89. package/dist/fhe-airdrop/react/useAirdropRoleConstants.d.ts +67 -0
  90. package/dist/fhe-airdrop/react/useAirdropRoleMembers.d.ts +49 -0
  91. package/dist/fhe-airdrop/react/useAirdropUpgradeToAndCall.d.ts +45 -0
  92. package/dist/fhe-airdrop/react/useBatchDiscloseHandlesToParty.d.ts +32 -0
  93. package/dist/fhe-airdrop/react/useBuildMerkleCampaign.d.ts +68 -0
  94. package/dist/fhe-airdrop/react/useComplianceGrantRole.d.ts +32 -0
  95. package/dist/fhe-airdrop/react/useComplianceHasRole.d.ts +37 -0
  96. package/dist/fhe-airdrop/react/useComplianceInfo.d.ts +50 -0
  97. package/dist/fhe-airdrop/react/useComplianceManagerOf.d.ts +32 -0
  98. package/dist/fhe-airdrop/react/useComplianceRenounceRole.d.ts +38 -0
  99. package/dist/fhe-airdrop/react/useComplianceRevokeRole.d.ts +36 -0
  100. package/dist/fhe-airdrop/react/useComplianceRoleConstants.d.ts +41 -0
  101. package/dist/fhe-airdrop/react/useComplianceRoleMembers.d.ts +45 -0
  102. package/dist/fhe-airdrop/react/useCreateAndFundEcdsaAirdrop.d.ts +55 -0
  103. package/dist/fhe-airdrop/react/useCreateAndFundMerkleAirdrop.d.ts +52 -0
  104. package/dist/fhe-airdrop/react/useDiscloseHandleToParty.d.ts +35 -0
  105. package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +4 -3
  106. package/dist/fhe-airdrop/react/useEcdsaClaimAndUnwrap.d.ts +27 -0
  107. package/dist/fhe-airdrop/react/useEcdsaDomain.d.ts +41 -0
  108. package/dist/fhe-airdrop/react/useEffectiveDelegateToCompliance.d.ts +26 -0
  109. package/dist/fhe-airdrop/react/useEncryptCampaignAmounts.d.ts +59 -0
  110. package/dist/fhe-airdrop/react/useIsActiveDelegate.d.ts +29 -0
  111. package/dist/fhe-airdrop/react/useIsMerkleRootMutable.d.ts +21 -0
  112. package/dist/fhe-airdrop/react/useIsSignatureValid.d.ts +46 -0
  113. package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +7 -19
  114. package/dist/fhe-airdrop/react/useMerkleClaimAndUnwrap.d.ts +29 -0
  115. package/dist/fhe-airdrop/react/usePlanMerkleCampaign.d.ts +53 -0
  116. package/dist/fhe-airdrop/react/usePreflightClaim.d.ts +46 -0
  117. package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +67 -0
  118. package/dist/fhe-airdrop/react/useRescueERC20.d.ts +30 -0
  119. package/dist/fhe-airdrop/react/useRescueOtherConfidentialToken.d.ts +34 -0
  120. package/dist/fhe-airdrop/react/useRevokeComplianceDelegate.d.ts +37 -0
  121. package/dist/fhe-airdrop/react/useRotateMerkleRoot.d.ts +52 -0
  122. package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +42 -0
  123. package/dist/fhe-airdrop/react/useWithdrawGasFee.d.ts +37 -0
  124. package/dist/fhe-airdrop/types.d.ts +14 -1
  125. package/dist/fhe-disperse/index.cjs +21 -21
  126. package/dist/fhe-disperse/index.js +2 -2
  127. package/dist/fhe-disperse/react/index.cjs +22 -22
  128. package/dist/fhe-disperse/react/index.js +3 -3
  129. package/dist/fhe-vesting/advanced/index.cjs +5 -5
  130. package/dist/fhe-vesting/advanced/index.js +3 -3
  131. package/dist/fhe-vesting/advanced/react/index.cjs +7 -7
  132. package/dist/fhe-vesting/advanced/react/index.js +4 -4
  133. package/dist/fhe-vesting/index.cjs +8 -8
  134. package/dist/fhe-vesting/index.js +2 -2
  135. package/dist/fhe-vesting/react/index.cjs +114 -114
  136. package/dist/fhe-vesting/react/index.js +3 -3
  137. package/dist/index.cjs +18 -18
  138. package/dist/index.js +1 -1
  139. package/dist/testnet-faucet/index.cjs +14 -14
  140. package/dist/testnet-faucet/index.js +2 -2
  141. package/dist/testnet-faucet/react/index.cjs +8 -8
  142. package/dist/testnet-faucet/react/index.js +3 -3
  143. package/package.json +1 -1
  144. package/dist/chunk-NCVX3K2N.cjs +0 -161
  145. package/dist/chunk-VP2B4WM2.js +0 -154
@@ -7,32 +7,32 @@ import type { Address, Hex } from "viem";
7
7
  export interface LeafOfArgs {
8
8
  /** The `MerkleConfidentialAirdrop` instance the leaf is scoped to — `address(this)` on-chain. */
9
9
  instance: Address;
10
- /** The claiming account — always `msg.sender` on-chain, never the claim's payout destination. */
11
- recipient: Address;
12
- /** The encrypted handle committing the recipient's cumulative total allocation. */
10
+ /** The claim identity, independent of both the transaction submitter and the payout destination. */
11
+ account: Address;
12
+ /** The encrypted handle committing the account's cumulative total allocation. */
13
13
  handle: Hex;
14
14
  }
15
15
  /**
16
- * Compute a Merkle leaf byte-for-byte identical to the contract's
17
- * `_leafOf(recipient, inputAmount)` — see the module comment above for the
18
- * verified derivation. Mirrors what the campaign builder (`buildMerkleCampaign`,
19
- * `campaign.ts`) needs to construct the same tree `StandardMerkleTree` would,
20
- * and is useful to any caller who wants to recompute a leaf independently of
21
- * the campaign orchestrator.
16
+ * Compute a Merkle leaf byte-for-byte identical to the contract's `_leafOf` — see the
17
+ * module comment for the verified derivation.
22
18
  *
23
19
  * @alpha
24
20
  */
25
21
  export declare function leafOf(args: LeafOfArgs): Hex;
26
22
  /**
27
- * The minimum a leaf must carry. `buildMerkleTree` is generic over anything
28
- * wider, so a caller's own fields ride along onto the entry.
23
+ * The minimum a leaf must carry. `buildMerkleTree` is generic over anything wider, so a
24
+ * caller's own fields ride along onto the entry.
25
+ *
26
+ * Deliberately does NOT include `boundTo`: the tree does not commit the submitter, so it
27
+ * is not needed to build one. Pass it anyway (alongside `inputProof`) and it rides through
28
+ * to the entry, which is what makes the result assignable to {@link CampaignEntry}.
29
29
  *
30
30
  * @alpha
31
31
  */
32
32
  export interface MerkleLeafInput {
33
- /** The account that will SEND the claim. The contract recomputes the leaf as `_leafOf(msg.sender, inputAmount)`. */
34
- recipient: Address;
35
- /** The encrypted handle committing this recipient's cumulative total. */
33
+ /** The claim identity this leaf commits — whose payout and cumulative accounting it keys. */
34
+ account: Address;
35
+ /** The encrypted handle committing this account's cumulative total. */
36
36
  handle: Hex;
37
37
  }
38
38
  /**
@@ -57,34 +57,30 @@ export interface BuiltMerkleTree<L extends MerkleLeafInput> {
57
57
  })[];
58
58
  }
59
59
  /**
60
- * Build the Merkle tree a `MerkleConfidentialAirdrop` verifies against, from
61
- * handles produced anywhere.
60
+ * Build the Merkle tree a `MerkleConfidentialAirdrop` verifies against, from handles
61
+ * produced anywhere.
62
62
  *
63
- * **Pure.** No relayer, no chain access, no encryptor. Given the same leaves
64
- * it returns the same root, so it can run offline, in a test, or on a machine
65
- * that has never seen a private key.
63
+ * **Pure.** No relayer, no chain access, no encryptor — same leaves in, same root out.
66
64
  *
67
- * **The tree commits to the handle, not the amount.** `_leafOf` hashes
68
- * `(address(this), recipient, encHandle)`, so whoever encrypted must have bound
69
- * each input to `(instance, that recipient)` — `FHE.fromExternal` reverts on any
70
- * mismatch. This function cannot check that; it will happily build a tree over
71
- * wrongly-bound handles, and the failure surfaces at claim time.
65
+ * **The tree commits to the handle, not the amount, and not the submitter.** `_leafOf`
66
+ * hashes `(instance, account, handle)`, so whoever encrypted must have bound each input
67
+ * to `(instance, the intended submitter)`. This function cannot check that: it will
68
+ * happily build a tree over wrongly-bound handles, and the failure surfaces at claim time
69
+ * inside the coprocessor.
72
70
  *
73
- * **Extra fields ride along.** Whatever the leaf carries beyond
74
- * `recipient` and `handle` — an `inputProof`, your own row id — comes back on
75
- * the entry, still aligned with its proof. Passing
76
- * `{ recipient, handle, inputProof }` therefore yields a value structurally
77
- * assignable to `CampaignEntry`, which is what `MerkleAirdropClient.claim`
78
- * consumes.
71
+ * **Extra fields ride along.** Whatever a leaf carries beyond `account` and `handle` —
72
+ * `boundTo`, an `inputProof`, your own row id — comes back on the entry, still aligned
73
+ * with its proof. Passing `{ account, boundTo, handle, inputProof }` therefore yields a
74
+ * value structurally assignable to {@link CampaignEntry}.
79
75
  *
80
76
  * @param args The instance the leaves are scoped to, and the leaves.
81
77
  * @returns The root to publish, and one proof-bearing entry per input leaf, in input order.
82
- * @throws {@link InvalidArgumentError} on a zero or malformed instance, an empty leaf set, a malformed or zero recipient, a duplicate recipient, or a handle that is not 32 bytes.
78
+ * @throws {@link InvalidArgumentError} on a zero or malformed instance, an empty leaf set, a malformed or zero account, a duplicate account, or a handle that is not 32 bytes.
83
79
  *
84
80
  * @example
85
81
  * const { root, entries } = buildMerkleTree({
86
82
  * instance: airdrop,
87
- * leaves: [{ recipient: alice, handle, inputProof }],
83
+ * leaves: [{ account: alice, boundTo: alice, handle, inputProof }],
88
84
  * });
89
85
  * await merkle.setMerkleRoot({ newRoot: root });
90
86
  *
@@ -92,12 +88,10 @@ export interface BuiltMerkleTree<L extends MerkleLeafInput> {
92
88
  */
93
89
  export declare function buildMerkleTree<L extends MerkleLeafInput>(args: BuildMerkleTreeArgs<L>): BuiltMerkleTree<L>;
94
90
  /**
95
- * Real implementation behind {@link buildMerkleTree}, parameterised on the
96
- * function name a thrown {@link InvalidArgumentError} blames.
91
+ * Real implementation behind {@link buildMerkleTree}, parameterised on the function name
92
+ * a thrown {@link InvalidArgumentError} blames.
97
93
  *
98
- * Not part of the public surface — exported from this module only so
99
- * `buildMerkleCampaign` (`campaign.ts`) can call it directly with its own
100
- * name, attributing a malformed-handle failure to itself rather than to
101
- * `buildMerkleTree`. Neither barrel (`index.ts`) re-exports it.
94
+ * Not part of the public surface — exported only so `buildMerkleCampaign` can call it
95
+ * with its own name. Neither barrel re-exports it.
102
96
  */
103
97
  export declare function buildMerkleTreeInternal<L extends MerkleLeafInput>({ instance, leaves }: BuildMerkleTreeArgs<L>, method: string): BuiltMerkleTree<L>;
@@ -10,23 +10,22 @@ import type { CampaignEntry } from "./types.js";
10
10
  */
11
11
  export interface MerkleClaimArgs extends WriteAccountOverride {
12
12
  /**
13
- * Payout destination. Omit (or pass the zero address) to default to the
14
- * sending account — mirrors the contract's own `to == address(0)` redirect
15
- * rule. The leaf's recipient field, the outstanding-amount accounting and
16
- * the FHE input proof all stay bound to the sending account regardless of
17
- * `to`; this field only redirects where the tokens (and the recipient ACL)
18
- * land.
13
+ * Payout destination. Omit (or pass the zero address) to default to
14
+ * `entry.account` — note that is the CLAIM IDENTITY, not the sender, so on a
15
+ * relayed claim omitting `to` still pays the recipient.
16
+ *
17
+ * Only the account itself may redirect elsewhere; a third-party submitter passing
18
+ * a different `to` is refused before the write with
19
+ * {@link UnauthorizedRedirectError}.
19
20
  */
20
21
  to?: Address;
21
22
  /**
22
- * The recipient's proof-bearing claim entry, built by the campaign
23
- * orchestrator (`campaign.ts`, Task 11). `entry.recipient` must equal the
24
- * account this call sends from (`args.account`, or the wallet client's
25
- * default account): the contract recomputes the leaf as
26
- * `_leafOf(msg.sender, inputAmount)`, so submitting `entry.merkleProof`
27
- * from any account other than `entry.recipient` recomputes a different
28
- * leaf and reverts `InvalidMerkleProof` even though the proof bytes
29
- * themselves are untouched.
23
+ * The proof-bearing claim entry, built by a campaign builder (`campaign.ts`).
24
+ *
25
+ * `entry.account` is submitted as the claim identity and selects the leaf.
26
+ * `entry.boundTo` must be the sending account, because the coprocessor verifies
27
+ * the input proof against the literal caller — the SDK checks this before the
28
+ * write rather than letting the transaction revert.
30
29
  */
31
30
  entry: CampaignEntry;
32
31
  }
@@ -37,18 +36,22 @@ export interface MerkleClaimArgs extends WriteAccountOverride {
37
36
  */
38
37
  export interface GetClaimAmountArgs extends WriteAccountOverride {
39
38
  /**
40
- * Same binding rule as {@link MerkleClaimArgs.entry}: `entry.recipient`
41
- * must equal the calling account, since the contract's preview also
42
- * recomputes the leaf against `msg.sender`.
39
+ * Same binding rule as {@link MerkleClaimArgs.entry}: `entry.boundTo` must be the
40
+ * calling account. The preview's result is ACL'd to `entry.account`, so a relayer
41
+ * can confirm a leaf verifies without being able to read the amount.
43
42
  */
44
43
  entry: CampaignEntry;
45
44
  }
46
45
  /**
47
46
  * Client for one `MerkleConfidentialAirdrop` instance — the variant whose
48
47
  * claims are authorised by inclusion in a published Merkle tree rather than
49
- * an off-chain signature. Each leaf commits `(instance, recipient, handle)`,
50
- * where `handle` is the recipient's CUMULATIVE total allocation, not a
51
- * per-drop tranche — see the `@remarks` on {@link getClaimedAmount}.
48
+ * an off-chain signature. Each leaf commits `(instance, account, handle)`, where
49
+ * `handle` is that account's CUMULATIVE total allocation, not a per-drop tranche —
50
+ * see the `@remarks` on {@link getClaimedAmount}.
51
+ *
52
+ * `claim` names its claim identity explicitly, so a relayer can settle a leaf on a
53
+ * recipient's behalf. `claimAndUnwrap` deliberately cannot: it is always submitted
54
+ * for the caller.
52
55
  *
53
56
  * Adds the claim surface on top of {@link AirdropBaseClient}'s shared
54
57
  * lifecycle/treasury/rescue/role/disclosure methods: `claim` /
@@ -71,8 +74,8 @@ export interface GetClaimAmountArgs extends WriteAccountOverride {
71
74
  export declare class MerkleAirdropClient extends AirdropBaseClient {
72
75
  constructor(config: AirdropBaseClientConfig);
73
76
  /**
74
- * Claim the outstanding amount for a proof-bearing entry, delivering the
75
- * tokens to `to` (defaults to the sending account).
77
+ * Claim the outstanding amount for a proof-bearing entry, delivering the tokens to
78
+ * `to` — which defaults to `entry.account`, the CLAIM IDENTITY, not the sender.
76
79
  *
77
80
  * Requires `msg.value == gasFee()` exactly — handled for you; see the
78
81
  * class TSDoc.
@@ -89,8 +92,9 @@ export declare class MerkleAirdropClient extends AirdropBaseClient {
89
92
  *
90
93
  * @throws {@link ClaimNotStartedError} before `startTime`.
91
94
  * @throws {@link ClaimWindowClosedError} after `endTime`.
92
- * @throws {@link InvalidArgumentError} (`argument: "merkleProof"`) when the proof does not verify against
93
- * the current root — including when `entry.recipient` does not match the sending account.
95
+ * @throws {@link InvalidArgumentError} (`argument: "entry.boundTo"`) when the entry's proof is bound to
96
+ * another address, or (`argument: "merkleProof"`) when the proof does not verify against the current root.
97
+ * @throws {@link UnauthorizedRedirectError} when a third-party submitter passes a `to` other than `entry.account`.
94
98
  * @returns The transaction hash.
95
99
  */
96
100
  claim(args: MerkleClaimArgs): Promise<Hex>;
@@ -103,6 +107,14 @@ export declare class MerkleAirdropClient extends AirdropBaseClient {
103
107
  * Same replay/accounting semantics and `msg.value == gasFee()` requirement
104
108
  * as {@link claim} — see its `@remarks`.
105
109
  *
110
+ * @remarks
111
+ * **Self-only by design.** This entrypoint takes no claim identity: releasing an
112
+ * allocation as a public ERC-20 transfer publishes the amount irreversibly, which is
113
+ * the recipient's own choice to make. A relayed unwrap is therefore unrepresentable
114
+ * rather than merely rejected, and an entry whose `account` is not the sender is
115
+ * refused before the write. A third party can still submit a confidential
116
+ * {@link claim}.
117
+ *
106
118
  * @returns The transaction hash. The underlying ERC-20 is released later by
107
119
  * a separate, permissionless `finalizeUnwrap` — this hash is only the
108
120
  * unwrap request.
@@ -113,11 +125,15 @@ export declare class MerkleAirdropClient extends AirdropBaseClient {
113
125
  * caller can decrypt. Consumes no accounting and no per-leaf state — the
114
126
  * same entry still pays the same amount after a preview. No fee.
115
127
  *
116
- * An encrypted view: the contract calls `FHE.allow(outstanding, msg.sender)`,
117
- * so the result is recovered from the receipt's ACL `Allowed` event, never
118
- * from a simulation. See {@link AirdropBaseClient}'s class TSDoc.
128
+ * **Submits a transaction.** The contract calls `FHE.allow(outstanding, account)`, so
129
+ * the result is recovered from the receipt's ACL `Allowed` event, never from a
130
+ * simulation. See {@link AirdropBaseClient}'s class TSDoc.
131
+ *
132
+ * **`entry.account` is the decryptable party, not the caller.** A relayer previewing on
133
+ * someone's behalf gets a valid handle it cannot read — that is the contract's intent,
134
+ * and it is what makes a blind relayed submission possible.
119
135
  *
120
- * @returns `{ handle, hash }` — pass `handle` to the Zama relayer's `userDecrypt`.
136
+ * @returns `{ handle, hash }` — pass `handle` to the Zama relayer's `userDecrypt`, as `entry.account`.
121
137
  */
122
138
  getClaimAmount(args: GetClaimAmountArgs): Promise<EncryptedViewResult>;
123
139
  /**
@@ -139,10 +155,15 @@ export declare class MerkleAirdropClient extends AirdropBaseClient {
139
155
  * leaves for the same recipient, claiming both pays the higher of the
140
156
  * two totals net of this running value — `max`, not `sum`.
141
157
  *
142
- * The zero handle (uninitialized ciphertext) before an account's first
143
- * settled claim decrypts as zero.
158
+ * **An account that has never claimed returns the ZERO handle, which cannot be
159
+ * decrypted.** It is an uninitialized ciphertext, so nobody holds an ACL on it and
160
+ * the relayer rejects it with "not authorized to user decrypt handle 0x0…0" rather
161
+ * than answering zero. Treat `handle === zeroHash` as "nothing delivered yet" and
162
+ * skip the decrypt; only call `userDecrypt` on a non-zero handle. (A mock FHEVM
163
+ * instance does answer zero here, so this only bites against a live relayer.)
144
164
  *
145
- * @returns The account's cumulative delivered total, as an encrypted handle.
165
+ * @returns The account's cumulative delivered total as an encrypted handle, or the
166
+ * zero handle if it has never claimed.
146
167
  */
147
168
  getClaimedAmount(account: Address): Promise<EncryptedHandle>;
148
169
  /** The currently published root. Proofs must verify against this exact value. */
@@ -8,6 +8,7 @@ import { type EcdsaAirdropClient } from "../ecdsa.js";
8
8
  import { type EncryptorSource } from "../encryption.js";
9
9
  import { type ConfidentialAirdropFactoryClient } from "../factory.js";
10
10
  import { type MerkleAirdropClient } from "../merkle.js";
11
+ import { type ComplianceManagerClient } from "../compliance.js";
11
12
  /**
12
13
  * Stable query-key prefix for every hook in this subpath — matches the
13
14
  * sibling subpaths' convention (`FHE_VESTING_KEY`/`FHE_DISPERSE_KEY`/
@@ -154,6 +155,18 @@ export declare function useMemoMerkleAirdropClient(opts: AirdropInstanceClientOp
154
155
  walletClient: WalletClient | undefined;
155
156
  chainId: number | undefined;
156
157
  };
158
+ /**
159
+ * Memoize a {@link ComplianceManagerClient} for `opts.address`.
160
+ *
161
+ * `address` is the manager CLONE, not the airdrop instance and not the factory — read it
162
+ * from `factory.complianceManagerOf(airdrop)` or off `CreateAirdropResult.complianceManager`.
163
+ */
164
+ export declare function useMemoComplianceManagerClient(opts: AirdropInstanceClientOptions): {
165
+ client: ComplianceManagerClient | undefined;
166
+ publicClient: PublicClient | undefined;
167
+ walletClient: WalletClient | undefined;
168
+ chainId: number | undefined;
169
+ };
157
170
  /**
158
171
  * Per-hook overrides for {@link useMemoEcdsaAirdropClient} — `dedupMode` has no on-chain getter, so it must be supplied.
159
172
  *