@tokenops/sdk 2.0.0-alpha.2 → 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 (160) hide show
  1. package/CHANGELOG.md +92 -3
  2. package/README.md +76 -34
  3. package/SUPPORT.md +1 -1
  4. package/dist/{chunk-PYYSB5ZN.js → chunk-2ND7US2I.js} +1 -1
  5. package/dist/{chunk-EYDA6Q6C.js → chunk-3ZSPRHR3.js} +63 -12
  6. package/dist/{chunk-X7WBPCEU.js → chunk-67Q6KSVV.js} +4578 -3383
  7. package/dist/{chunk-UHHMVBLU.cjs → chunk-6AYJRUGP.cjs} +7 -50
  8. package/dist/{chunk-FEDX7B6T.cjs → chunk-6FUHF73F.cjs} +5 -5
  9. package/dist/{chunk-NWFMBLSQ.js → chunk-7KY4K4PH.js} +1 -1
  10. package/dist/{chunk-FHWSBGWE.cjs → chunk-ARZ5C3FS.cjs} +7 -7
  11. package/dist/{chunk-SPLNGUFF.js → chunk-AX6MQAWU.js} +2 -2
  12. package/dist/{chunk-IGO5XSPS.js → chunk-BSXEX2SH.js} +3 -3
  13. package/dist/{chunk-44YJPMQC.js → chunk-CHGY6B7L.js} +34 -81
  14. package/dist/{chunk-IUKKNJ2R.cjs → chunk-DFK5GCJP.cjs} +55 -72
  15. package/dist/{chunk-PZZK3O3S.cjs → chunk-E4IV4M4E.cjs} +4598 -3403
  16. package/dist/{chunk-A4DCEE33.js → chunk-GHGF65LN.js} +16 -12
  17. package/dist/{chunk-TWT3STIX.js → chunk-K3R27WX4.js} +8 -46
  18. package/dist/{chunk-GADGBQJO.js → chunk-KJUNBOJQ.js} +52 -71
  19. package/dist/{chunk-MM5BV5CS.cjs → chunk-PO3A2AQX.cjs} +4 -4
  20. package/dist/{chunk-EBLBPUPI.cjs → chunk-QHDMPT7I.cjs} +72 -19
  21. package/dist/{chunk-3YHBO2DL.cjs → chunk-S47IBDTA.cjs} +36 -83
  22. package/dist/{chunk-UG5RKLU2.cjs → chunk-SUYBAF27.cjs} +1 -1
  23. package/dist/{chunk-WJMEBBU7.js → chunk-TWU7L5H7.js} +5 -48
  24. package/dist/{chunk-WJLECC22.cjs → chunk-UUSSWOPR.cjs} +9 -47
  25. package/dist/{chunk-AREQJHKA.cjs → chunk-VHKMWWBA.cjs} +428 -22
  26. package/dist/{chunk-FT5H2Q7Y.cjs → chunk-YAL6JSAZ.cjs} +16 -12
  27. package/dist/{chunk-VW356KR3.js → chunk-YMWMIWBP.js} +421 -25
  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 +97 -1
  36. package/dist/fhe-airdrop/abis/ecdsa.d.ts +117 -1
  37. package/dist/fhe-airdrop/abis/factory.d.ts +332 -1
  38. package/dist/fhe-airdrop/abis/merkle.d.ts +116 -1
  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 +145 -137
  44. package/dist/fhe-airdrop/advanced/react/index.d.cts +1 -0
  45. package/dist/fhe-airdrop/advanced/react/index.d.ts +1 -0
  46. package/dist/fhe-airdrop/advanced/react/index.js +85 -78
  47. package/dist/fhe-airdrop/advanced/react/useClearCompliancePolicy.d.ts +3 -1
  48. package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +4 -1
  49. package/dist/fhe-airdrop/advanced/react/useFactoryComplianceDelegate.d.ts +2 -4
  50. package/dist/fhe-airdrop/advanced/react/useFactoryRenounceRole.d.ts +4 -3
  51. package/dist/fhe-airdrop/advanced/react/useFactoryRevokeRole.d.ts +9 -7
  52. package/dist/fhe-airdrop/advanced/react/useFactoryRoleMembers.d.ts +6 -5
  53. package/dist/fhe-airdrop/advanced/react/useSetComplianceDelegate.d.ts +7 -7
  54. package/dist/fhe-airdrop/advanced/react/useSetComplianceManagerImpl.d.ts +3 -1
  55. package/dist/fhe-airdrop/advanced/react/useSetCompliancePolicy.d.ts +2 -1
  56. package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +4 -1
  57. package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +5 -4
  58. package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +7 -3
  59. package/dist/fhe-airdrop/advanced/react/useSetMaxGasFee.d.ts +37 -0
  60. package/dist/fhe-airdrop/airdrop-base.d.ts +142 -18
  61. package/dist/fhe-airdrop/campaign.d.ts +37 -73
  62. package/dist/fhe-airdrop/compliance-clone.d.ts +21 -0
  63. package/dist/fhe-airdrop/constants.d.ts +11 -1
  64. package/dist/fhe-airdrop/ecdsa.d.ts +79 -26
  65. package/dist/fhe-airdrop/encryption.d.ts +19 -6
  66. package/dist/fhe-airdrop/errors.d.ts +136 -2
  67. package/dist/fhe-airdrop/factory-params.d.ts +2361 -0
  68. package/dist/fhe-airdrop/factory.d.ts +189 -75
  69. package/dist/fhe-airdrop/guards.d.ts +183 -19
  70. package/dist/fhe-airdrop/index.cjs +88 -56
  71. package/dist/fhe-airdrop/index.d.cts +12 -10
  72. package/dist/fhe-airdrop/index.d.ts +12 -10
  73. package/dist/fhe-airdrop/index.js +5 -5
  74. package/dist/fhe-airdrop/merkle-tree.d.ts +9 -9
  75. package/dist/fhe-airdrop/merkle.d.ts +32 -11
  76. package/dist/fhe-airdrop/react/_shared.d.ts +12 -6
  77. package/dist/fhe-airdrop/react/index.cjs +336 -240
  78. package/dist/fhe-airdrop/react/index.d.cts +19 -9
  79. package/dist/fhe-airdrop/react/index.d.ts +19 -9
  80. package/dist/fhe-airdrop/react/index.js +158 -97
  81. package/dist/fhe-airdrop/react/keys.d.ts +54 -7
  82. package/dist/fhe-airdrop/react/useAccessEcdsaClaimAmount.d.ts +6 -3
  83. package/dist/fhe-airdrop/react/useAccessMerkleClaimAmount.d.ts +2 -2
  84. package/dist/fhe-airdrop/react/useAirdropConfig.d.ts +8 -3
  85. package/dist/fhe-airdrop/react/useAirdropPause.d.ts +5 -0
  86. package/dist/fhe-airdrop/react/useBuildMerkleCampaign.d.ts +4 -6
  87. package/dist/fhe-airdrop/react/useComplianceManager.d.ts +2 -2
  88. package/dist/fhe-airdrop/react/useComplianceManagerOf.d.ts +1 -2
  89. package/dist/fhe-airdrop/react/useCreateAndFundEcdsaAirdrop.d.ts +16 -11
  90. package/dist/fhe-airdrop/react/useCreateAndFundMerkleAirdrop.d.ts +23 -7
  91. package/dist/fhe-airdrop/react/useCreateEcdsaAirdrop.d.ts +13 -8
  92. package/dist/fhe-airdrop/react/useCreateMerkleAirdrop.d.ts +27 -7
  93. package/dist/fhe-airdrop/react/useDedupMode.d.ts +16 -0
  94. package/dist/fhe-airdrop/react/useDiscloseHandleToParty.d.ts +4 -3
  95. package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +6 -4
  96. package/dist/fhe-airdrop/react/useEcdsaClaimAndUnwrap.d.ts +15 -8
  97. package/dist/fhe-airdrop/react/useEcdsaDomain.d.ts +1 -1
  98. package/dist/fhe-airdrop/react/useEncryptCampaignAmounts.d.ts +5 -7
  99. package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +4 -1
  100. package/dist/fhe-airdrop/react/useFactoryFees.d.ts +11 -4
  101. package/dist/fhe-airdrop/react/useFundAirdrop.d.ts +3 -4
  102. package/dist/fhe-airdrop/react/useGrantInstanceRoles.d.ts +2 -1
  103. package/dist/fhe-airdrop/react/useIsAirdrop.d.ts +44 -0
  104. package/dist/fhe-airdrop/react/useIsSignatureValid.d.ts +5 -4
  105. package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +4 -1
  106. package/dist/fhe-airdrop/react/useMerkleClaimAndUnwrap.d.ts +14 -3
  107. package/dist/fhe-airdrop/react/usePlanMerkleCampaign.d.ts +18 -3
  108. package/dist/fhe-airdrop/react/usePreflightClaim.d.ts +1 -1
  109. package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +34 -13
  110. package/dist/fhe-airdrop/react/useRefreshComplianceBalance.d.ts +36 -0
  111. package/dist/fhe-airdrop/react/useRescueERC20.d.ts +3 -3
  112. package/dist/fhe-airdrop/react/useRescueNativeToken.d.ts +23 -0
  113. package/dist/fhe-airdrop/react/useResolveGasFee.d.ts +30 -0
  114. package/dist/fhe-airdrop/react/useRotateMerkleRoot.d.ts +5 -2
  115. package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +4 -0
  116. package/dist/fhe-airdrop/react/useTokenOf.d.ts +29 -0
  117. package/dist/fhe-airdrop/react/useUnwrapRequest.d.ts +25 -0
  118. package/dist/fhe-airdrop/react/useWithdrawConfidential.d.ts +4 -0
  119. package/dist/fhe-airdrop/roles.d.ts +82 -7
  120. package/dist/fhe-airdrop/types.d.ts +122 -14
  121. package/dist/fhe-disperse/errors.d.ts +3 -3
  122. package/dist/fhe-disperse/index.cjs +22 -22
  123. package/dist/fhe-disperse/index.d.cts +2 -1
  124. package/dist/fhe-disperse/index.d.ts +2 -1
  125. package/dist/fhe-disperse/index.js +3 -3
  126. package/dist/fhe-disperse/react/index.cjs +27 -25
  127. package/dist/fhe-disperse/react/index.d.cts +2 -1
  128. package/dist/fhe-disperse/react/index.d.ts +2 -1
  129. package/dist/fhe-disperse/react/index.js +8 -6
  130. package/dist/fhe-disperse/react/useDisperse.d.ts +6 -2
  131. package/dist/fhe-disperse/react/useRegister.d.ts +9 -3
  132. package/dist/fhe-disperse/react/useSingletonWithdrawTokenFee.d.ts +7 -2
  133. package/dist/fhe-disperse/react/useWithdrawTokenFee.d.ts +7 -2
  134. package/dist/fhe-disperse/singleton.d.ts +33 -19
  135. package/dist/fhe-disperse/types.d.ts +48 -8
  136. package/dist/fhe-vesting/advanced/index.cjs +6 -6
  137. package/dist/fhe-vesting/advanced/index.js +4 -4
  138. package/dist/fhe-vesting/advanced/react/index.cjs +9 -9
  139. package/dist/fhe-vesting/advanced/react/index.js +6 -6
  140. package/dist/fhe-vesting/factory.d.ts +31 -8
  141. package/dist/fhe-vesting/index.cjs +23 -23
  142. package/dist/fhe-vesting/index.d.cts +3 -2
  143. package/dist/fhe-vesting/index.d.ts +3 -2
  144. package/dist/fhe-vesting/index.js +4 -4
  145. package/dist/fhe-vesting/manager.d.ts +27 -2
  146. package/dist/fhe-vesting/react/index.cjs +126 -126
  147. package/dist/fhe-vesting/react/index.d.cts +3 -2
  148. package/dist/fhe-vesting/react/index.d.ts +3 -2
  149. package/dist/fhe-vesting/react/index.js +5 -5
  150. package/dist/fhe-vesting/react/useCreateManager.d.ts +16 -9
  151. package/dist/fhe-vesting/react/useCreateManagerAndGetAddress.d.ts +9 -5
  152. package/dist/fhe-vesting/react/useSplitVesting.d.ts +9 -3
  153. package/dist/index.cjs +18 -18
  154. package/dist/index.js +1 -1
  155. package/dist/testnet-faucet/faucet.d.ts +3 -0
  156. package/dist/testnet-faucet/index.cjs +15 -15
  157. package/dist/testnet-faucet/index.js +3 -3
  158. package/dist/testnet-faucet/react/index.cjs +9 -9
  159. package/dist/testnet-faucet/react/index.js +4 -4
  160. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import type { Address, Hex } from "viem";
2
+ import type { MinedWrite, PendingWrite } from "../core/pending.js";
2
3
  import type { DedupMode, DeploymentMode } from "./constants.js";
3
4
  /**
4
5
  * Create-time fields shared by both variants. There is deliberately no `admin`
@@ -20,6 +21,40 @@ export interface CommonAirdropParams {
20
21
  unwrappable: boolean;
21
22
  /** Client admin AND client delegate of the compliance clone. Zero means msg.sender. */
22
23
  complianceAdmin: Address;
24
+ /**
25
+ * The highest per-claim gas fee this creator accepts being frozen into the new
26
+ * instance, in wei. The factory resolves the creator's fee at execution time
27
+ * (their custom override, else the factory default) and reverts
28
+ * `GasFeeNotAccepted` if it lands above this bound.
29
+ *
30
+ * Required, and deliberately so: the fee is immutable once frozen, and the
31
+ * value that resolves is chosen by the factory admin, not the creator. A
32
+ * default here would hand that decision back to whoever is not making it.
33
+ * Pass `0n` to accept only a zero-fee campaign, or {@link UINT96_MAX} to
34
+ * accept whatever resolves.
35
+ */
36
+ maxAcceptedGasFee: bigint;
37
+ }
38
+ /**
39
+ * The three values a create commits to. The factory reverts before consuming the salt
40
+ * when any of them differs from what it would actually deploy (`PredictionMismatch`,
41
+ * `ManagerImplementationMismatch`, `ComplianceDelegateMismatch`), so a rotation between
42
+ * quote and send can never produce an instance the creator did not plan for.
43
+ *
44
+ * Every field is literal: the zero address never means "skip". A zero
45
+ * `complianceDelegate` means "I expect the manager clone to carry no platform
46
+ * delegation", which is what the factory resolves when the creator's effective
47
+ * compliance policy is OFF.
48
+ *
49
+ * @alpha
50
+ */
51
+ export interface CreateCommitments {
52
+ /** Where the instance must land - what `predict*AirdropAddress` returned. */
53
+ airdrop: Address;
54
+ /** The manager implementation the compliance clone must be made from - `factory.complianceManagerImpl()`. */
55
+ complianceManagerImpl: Address;
56
+ /** The platform delegate the clone must be wired with, or zero under an OFF policy - `factory.resolveComplianceDelegate(creator)`. */
57
+ complianceDelegate: Address;
23
58
  }
24
59
  /** @alpha */
25
60
  export interface EcdsaAirdropParams {
@@ -34,6 +69,18 @@ export interface MerkleAirdropParams {
34
69
  merkleRoot: Hex;
35
70
  isMerkleRootMutable: boolean;
36
71
  }
72
+ /**
73
+ * A variant tag paired with that variant's params, so the two cannot be mismatched.
74
+ *
75
+ * @alpha
76
+ */
77
+ export type AirdropVariantParams = {
78
+ variant: "ecdsa";
79
+ params: EcdsaAirdropParams;
80
+ } | {
81
+ variant: "merkle";
82
+ params: MerkleAirdropParams;
83
+ };
37
84
  /**
38
85
  * Arguments shared by both `factory.createEcdsaAirdrop` / `createMerkleAirdrop` entrypoints.
39
86
  *
@@ -43,12 +90,62 @@ export interface CreateAirdropArgs<P> {
43
90
  params: P;
44
91
  mode: DeploymentMode;
45
92
  userSalt: Hex;
93
+ /**
94
+ * Commitments to pin instead of quoting fresh at send time. Anything omitted is read
95
+ * from the factory just before the transaction.
96
+ *
97
+ * Creating from a {@link PlannedCampaign}? Pass it as `plan` on the Merkle creates
98
+ * ({@link CreateMerkleAirdropArgs.plan}), which pins `airdrop` for you. Pinning
99
+ * `{ airdrop: plan.predictedAddress }` here by hand is the lower-level equivalent: the
100
+ * plan's leaves are bound to that address, and a fresh prediction after an
101
+ * implementation rotation would commit to a different one.
102
+ */
103
+ expected?: Partial<CreateCommitments> | undefined;
104
+ }
105
+ /**
106
+ * Create arguments for the Merkle variant: the shared shape plus the plan a create may realise.
107
+ *
108
+ * @alpha
109
+ */
110
+ export interface CreateMerkleAirdropArgs extends CreateAirdropArgs<MerkleAirdropParams> {
111
+ /**
112
+ * The {@link PlannedCampaign} this create realises. Supplying it pins
113
+ * `expected.airdrop` to `plan.predictedAddress`, requires `params.merkleRoot`
114
+ * to equal `plan.root`, and refuses the send when the factory's live Merkle
115
+ * init-code hash no longer equals `plan.initCodeHashAfter`
116
+ * ({@link PredictionDriftError}). An `expected.airdrop` given alongside must
117
+ * equal `plan.predictedAddress`; the other two `expected` fields are passed
118
+ * through unchanged.
119
+ */
120
+ plan?: PlannedCampaign | undefined;
46
121
  }
47
122
  /** @alpha */
48
- export interface CreateAirdropResult {
123
+ export interface CreateAirdropResult extends MinedWrite {
124
+ /** The create's transaction hash; on a pending result, what the wallet returned (from a Safe, the `safeTxHash`). */
49
125
  hash: Hex;
50
126
  airdrop: Address;
51
127
  complianceManager: Address;
128
+ /** The implementation the compliance clone was made from, as logged by `ComplianceManagerCloned`. */
129
+ managerImplementation: Address;
130
+ /** The platform delegate the clone was wired with; zero when the creator's policy was OFF. */
131
+ complianceDelegate: Address;
132
+ }
133
+ /**
134
+ * What a create returns with `waitForReceipt: false` (`ReceiptMode`): the same fields as
135
+ * {@link CreateAirdropResult}, taken from the {@link CreateCommitments} the create was sent
136
+ * with rather than from a receipt. `hash` is what the wallet returned; from a Safe, the
137
+ * `safeTxHash`, not the hash of the transaction that eventually executes.
138
+ *
139
+ * The factory reverts unless the instance lands at `commitments.airdrop` and the clone is made
140
+ * from `commitments.complianceManagerImpl` and wired with `commitments.complianceDelegate`, so
141
+ * once owners co-sign and the transaction executes, those are the addresses its logs report.
142
+ * Confirm by reading `ConfidentialAirdropCreated` and `ComplianceManagerCloned` from the
143
+ * executed transaction, or `isAirdrop(airdrop)` on the factory. If that transaction never
144
+ * executes, no instance exists at `airdrop`.
145
+ *
146
+ * @alpha
147
+ */
148
+ export interface PendingCreateAirdropResult extends Omit<CreateAirdropResult, "pending">, PendingWrite {
52
149
  }
53
150
  /**
54
151
  * One recipient's committed allocation, keyed for `CampaignEntry.merkleProof` construction.
@@ -62,25 +159,17 @@ export interface CampaignRecipient {
62
159
  cumulativeTotal: bigint;
63
160
  }
64
161
  /**
65
- * One recipient's encrypted, proof-bearing claim input — everything `merkle.claim` needs.
162
+ * One recipient's encrypted, proof-bearing claim input - everything `merkle.claim` needs.
66
163
  *
67
- * Carries TWO addresses because the contract keys two different things on them:
68
- * `account` selects the leaf and the cumulative accounting, `boundTo` is who the
69
- * coprocessor will accept as the sender. They are equal on a self-claim campaign
70
- * and differ on a relayed one.
164
+ * `account` is the claim identity: whose leaf this is, whose delivered total advances, and
165
+ * where payout defaults. The handle and proof are bound to `(instance, instance)`, so ANY
166
+ * address may submit the entry: the recipient, a relayer, or a stranger. Payout always goes
167
+ * to `account` unless `account` itself passes `to`.
71
168
  *
72
169
  * @alpha
73
170
  */
74
171
  export interface CampaignEntry {
75
- /** The claim identity: whose leaf this is, whose delivered total advances, and where payout defaults. */
76
172
  account: Address;
77
- /**
78
- * The only address that can submit this entry. The FHE input proof is bound to
79
- * `(instance, boundTo)`, so any other sender is rejected by the coprocessor —
80
- * a leaf cannot be re-pointed at a different submitter without re-encrypting,
81
- * which changes the handle and therefore the root.
82
- */
83
- boundTo: Address;
84
173
  handle: Hex;
85
174
  inputProof: Hex;
86
175
  merkleProof: readonly Hex[];
@@ -90,3 +179,22 @@ export interface BuiltCampaign {
90
179
  root: Hex;
91
180
  entries: readonly CampaignEntry[];
92
181
  }
182
+ /**
183
+ * A campaign built against a not-yet-deployed instance, plus the evidence needed to trust the prediction.
184
+ *
185
+ * Create it by passing the plan itself as `plan` to `createMerkleAirdrop` /
186
+ * `createAndFundMerkleAirdrop`, with `merkleRoot: plan.root` in `params`. Every
187
+ * entry is bound to `predictedAddress`, so the create pins it, refuses a root
188
+ * that differs from `root`, and refuses to send once the factory's Merkle
189
+ * implementation has moved since the plan was taken.
190
+ *
191
+ * @alpha
192
+ */
193
+ export interface PlannedCampaign extends BuiltCampaign {
194
+ /** Where `createMerkleAirdrop({ mode, userSalt })` from `creator` will land. Every entry is bound to this address. */
195
+ predictedAddress: Address;
196
+ /** The factory's Merkle init-code hash read BEFORE the address was predicted. */
197
+ initCodeHashBefore: Hex;
198
+ /** The same hash read AFTER. Always equal to `initCodeHashBefore` on a returned plan - a difference throws instead. */
199
+ initCodeHashAfter: Hex;
200
+ }
@@ -49,10 +49,10 @@ export declare class SubwalletsNotApprovedError extends TokenOpsSdkError {
49
49
  });
50
50
  }
51
51
  /**
52
- * Direct-mode disperse: the sender has not approved the singleton as an
53
- * ERC-7984 operator on the token, so `disperseConfidentialTokenDirect` would
52
+ * The sender has not approved the singleton as an ERC-7984 operator on the
53
+ * token. Every disperse mode pulls from the sender, so any of them would
54
54
  * revert with the raw `ERC7984UnauthorizedSpender` selector (`0x79f2cb38`).
55
- * Surfaced by `preflightDisperse` in `direct` mode.
55
+ * Surfaced by `preflightDisperse` in every mode.
56
56
  *
57
57
  * Remediation: call `setOperator()` / `ensureOperator()` (exported from
58
58
  * `@tokenops/sdk/fhe`) with the singleton address before dispersing.
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunk3YHBO2DL_cjs = require('../chunk-3YHBO2DL.cjs');
3
+ var chunkS47IBDTA_cjs = require('../chunk-S47IBDTA.cjs');
4
4
  var chunkKFRDLKMA_cjs = require('../chunk-KFRDLKMA.cjs');
5
5
  require('../chunk-TEBM66WA.cjs');
6
6
  require('../chunk-FAXIIH5R.cjs');
7
7
  var chunkFWHYQZ5E_cjs = require('../chunk-FWHYQZ5E.cjs');
8
- require('../chunk-UG5RKLU2.cjs');
8
+ require('../chunk-SUYBAF27.cjs');
9
9
  require('../chunk-MVDQMV25.cjs');
10
- require('../chunk-FT5H2Q7Y.cjs');
10
+ require('../chunk-YAL6JSAZ.cjs');
11
11
  require('../chunk-JK4XMMKM.cjs');
12
12
  require('../chunk-66IHPTOK.cjs');
13
13
  var chunk67OV5CX2_cjs = require('../chunk-67OV5CX2.cjs');
@@ -17,79 +17,79 @@ require('../chunk-VJKZWYYJ.cjs');
17
17
 
18
18
  Object.defineProperty(exports, "AlreadyRegisteredError", {
19
19
  enumerable: true,
20
- get: function () { return chunk3YHBO2DL_cjs.AlreadyRegisteredError; }
20
+ get: function () { return chunkS47IBDTA_cjs.AlreadyRegisteredError; }
21
21
  });
22
22
  Object.defineProperty(exports, "ConfidentialDisperseClient", {
23
23
  enumerable: true,
24
- get: function () { return chunk3YHBO2DL_cjs.ConfidentialDisperseClient; }
24
+ get: function () { return chunkS47IBDTA_cjs.ConfidentialDisperseClient; }
25
25
  });
26
26
  Object.defineProperty(exports, "DEFAULT_ADMIN_ROLE", {
27
27
  enumerable: true,
28
- get: function () { return chunk3YHBO2DL_cjs.DEFAULT_ADMIN_ROLE; }
28
+ get: function () { return chunkS47IBDTA_cjs.DEFAULT_ADMIN_ROLE; }
29
29
  });
30
30
  Object.defineProperty(exports, "DisperseEncryptedReserveNotGrantedError", {
31
31
  enumerable: true,
32
- get: function () { return chunk3YHBO2DL_cjs.DisperseEncryptedReserveNotGrantedError; }
32
+ get: function () { return chunkS47IBDTA_cjs.DisperseEncryptedReserveNotGrantedError; }
33
33
  });
34
34
  Object.defineProperty(exports, "DisperseSubwalletNotFoundError", {
35
35
  enumerable: true,
36
- get: function () { return chunk3YHBO2DL_cjs.DisperseSubwalletNotFoundError; }
36
+ get: function () { return chunkS47IBDTA_cjs.DisperseSubwalletNotFoundError; }
37
37
  });
38
38
  Object.defineProperty(exports, "FEE_COLLECTOR_ROLE", {
39
39
  enumerable: true,
40
- get: function () { return chunk3YHBO2DL_cjs.FEE_COLLECTOR_ROLE; }
40
+ get: function () { return chunkS47IBDTA_cjs.FEE_COLLECTOR_ROLE; }
41
41
  });
42
42
  Object.defineProperty(exports, "FEE_MANAGER_ROLE", {
43
43
  enumerable: true,
44
- get: function () { return chunk3YHBO2DL_cjs.FEE_MANAGER_ROLE; }
44
+ get: function () { return chunkS47IBDTA_cjs.FEE_MANAGER_ROLE; }
45
45
  });
46
46
  Object.defineProperty(exports, "NotRegisteredError", {
47
47
  enumerable: true,
48
- get: function () { return chunk3YHBO2DL_cjs.NotRegisteredError; }
48
+ get: function () { return chunkS47IBDTA_cjs.NotRegisteredError; }
49
49
  });
50
50
  Object.defineProperty(exports, "PAUSER_ROLE", {
51
51
  enumerable: true,
52
- get: function () { return chunk3YHBO2DL_cjs.PAUSER_ROLE; }
52
+ get: function () { return chunkS47IBDTA_cjs.PAUSER_ROLE; }
53
53
  });
54
54
  Object.defineProperty(exports, "SingletonNotApprovedError", {
55
55
  enumerable: true,
56
- get: function () { return chunk3YHBO2DL_cjs.SingletonNotApprovedError; }
56
+ get: function () { return chunkS47IBDTA_cjs.SingletonNotApprovedError; }
57
57
  });
58
58
  Object.defineProperty(exports, "SubwalletsNotApprovedError", {
59
59
  enumerable: true,
60
- get: function () { return chunk3YHBO2DL_cjs.SubwalletsNotApprovedError; }
60
+ get: function () { return chunkS47IBDTA_cjs.SubwalletsNotApprovedError; }
61
61
  });
62
62
  Object.defineProperty(exports, "WITHDRAWER_ROLE", {
63
63
  enumerable: true,
64
- get: function () { return chunk3YHBO2DL_cjs.WITHDRAWER_ROLE; }
64
+ get: function () { return chunkS47IBDTA_cjs.WITHDRAWER_ROLE; }
65
65
  });
66
66
  Object.defineProperty(exports, "computeSubtotals", {
67
67
  enumerable: true,
68
- get: function () { return chunk3YHBO2DL_cjs.computeSubtotals; }
68
+ get: function () { return chunkS47IBDTA_cjs.computeSubtotals; }
69
69
  });
70
70
  Object.defineProperty(exports, "createConfidentialDisperseClient", {
71
71
  enumerable: true,
72
- get: function () { return chunk3YHBO2DL_cjs.createConfidentialDisperseClient; }
72
+ get: function () { return chunkS47IBDTA_cjs.createConfidentialDisperseClient; }
73
73
  });
74
74
  Object.defineProperty(exports, "disperseConfidentialAbi", {
75
75
  enumerable: true,
76
- get: function () { return chunk3YHBO2DL_cjs.disperseConfidentialAbi; }
76
+ get: function () { return chunkS47IBDTA_cjs.disperseConfidentialAbi; }
77
77
  });
78
78
  Object.defineProperty(exports, "disperseWalletAbi", {
79
79
  enumerable: true,
80
- get: function () { return chunk3YHBO2DL_cjs.disperseWalletAbi; }
80
+ get: function () { return chunkS47IBDTA_cjs.disperseWalletAbi; }
81
81
  });
82
82
  Object.defineProperty(exports, "encryptUint64", {
83
83
  enumerable: true,
84
- get: function () { return chunk3YHBO2DL_cjs.encryptUint64; }
84
+ get: function () { return chunkS47IBDTA_cjs.encryptUint64; }
85
85
  });
86
86
  Object.defineProperty(exports, "encryptUint64Batch", {
87
87
  enumerable: true,
88
- get: function () { return chunk3YHBO2DL_cjs.encryptUint64Batch; }
88
+ get: function () { return chunkS47IBDTA_cjs.encryptUint64Batch; }
89
89
  });
90
90
  Object.defineProperty(exports, "resolveEncryptor", {
91
91
  enumerable: true,
92
- get: function () { return chunk3YHBO2DL_cjs.resolveEncryptor; }
92
+ get: function () { return chunkS47IBDTA_cjs.resolveEncryptor; }
93
93
  });
94
94
  Object.defineProperty(exports, "ERC7984_OPERATOR_MAX_DEADLINE", {
95
95
  enumerable: true,
@@ -1,7 +1,7 @@
1
1
  export { ConfidentialDisperseClient, createConfidentialDisperseClient, computeSubtotals, type ConfidentialDisperseClientConfig, } from "./singleton.js";
2
2
  export { encryptUint64, encryptUint64Batch, resolveEncryptor, type Encryptor, type EncryptorSource, type EncryptUint64Args, type EncryptUint64BatchArgs, type FheValueInput, } from "./encryption.js";
3
3
  export { setOperator, revokeOperator, ERC7984_OPERATOR_MAX_DEADLINE, type SetOperatorArgs, type RevokeOperatorArgs, } from "../fhe/operators.js";
4
- export { DisperseSubwalletNotFoundError, DisperseEncryptedReserveNotGrantedError, type BatchDiscloseHandlesArgs, type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type CustomFee, type DiscloseHandleArgs, type DisclosureResult, type DisperseArgs, type DisperseDistribution, type DisperseMode, type DisperseResult, type EncryptedInput, type EncryptedInputs, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PreflightDisperseArgs, type PreflightReport, type RecipientCheck, type RegisterResult, type SubwalletApprovalState, type UserFees, type WithdrawTokenFeeResult, } from "./types.js";
4
+ export { DisperseSubwalletNotFoundError, DisperseEncryptedReserveNotGrantedError, type BatchDiscloseHandlesArgs, type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type CustomFee, type DiscloseHandleArgs, type DisclosureResult, type DisperseArgs, type DisperseDistribution, type DisperseMode, type DisperseResult, type EncryptedInput, type EncryptedInputs, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PendingDisperseResult, type PendingRegisterResult, type PendingWithdrawTokenFeeResult, type PreflightDisperseArgs, type PreflightReport, type RecipientCheck, type RegisterArgs, type RegisterResult, type SubwalletApprovalState, type UserFees, type WithdrawTokenFeeArgs, type WithdrawTokenFeeResult, } from "./types.js";
5
5
  export { disperseConfidentialAbi, disperseWalletAbi } from "./abis/index.js";
6
6
  export { erc7984OperatorAbi } from "../fhe/erc7984-abi.js";
7
7
  export declare const FEE_COLLECTOR_ROLE: "0x2dca0f5ce7e75a4b43fe2b0d6f5d0b7a2bf92ecf89f8f0aa17b8308b67038821";
@@ -11,4 +11,5 @@ export declare const WITHDRAWER_ROLE: "0x10dac8c06a04bec0b551627dad28bc00d6516b0
11
11
  export declare const DEFAULT_ADMIN_ROLE: "0x0000000000000000000000000000000000000000000000000000000000000000";
12
12
  export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, TokenOpsValidationError, ContractRevertError, TokenOpsContractError, PausedError, AccessDeniedError, OperatorNotApprovedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../core/errors.js";
13
13
  export { type PreflightResult } from "../core/preflight.js";
14
+ export type { MinedWrite, PendingWrite, ReceiptMode } from "../core/pending.js";
14
15
  export { NotRegisteredError, AlreadyRegisteredError, SubwalletsNotApprovedError, SingletonNotApprovedError, } from "./errors.js";
@@ -1,7 +1,7 @@
1
1
  export { ConfidentialDisperseClient, createConfidentialDisperseClient, computeSubtotals, type ConfidentialDisperseClientConfig, } from "./singleton.js";
2
2
  export { encryptUint64, encryptUint64Batch, resolveEncryptor, type Encryptor, type EncryptorSource, type EncryptUint64Args, type EncryptUint64BatchArgs, type FheValueInput, } from "./encryption.js";
3
3
  export { setOperator, revokeOperator, ERC7984_OPERATOR_MAX_DEADLINE, type SetOperatorArgs, type RevokeOperatorArgs, } from "../fhe/operators.js";
4
- export { DisperseSubwalletNotFoundError, DisperseEncryptedReserveNotGrantedError, type BatchDiscloseHandlesArgs, type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type CustomFee, type DiscloseHandleArgs, type DisclosureResult, type DisperseArgs, type DisperseDistribution, type DisperseMode, type DisperseResult, type EncryptedInput, type EncryptedInputs, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PreflightDisperseArgs, type PreflightReport, type RecipientCheck, type RegisterResult, type SubwalletApprovalState, type UserFees, type WithdrawTokenFeeResult, } from "./types.js";
4
+ export { DisperseSubwalletNotFoundError, DisperseEncryptedReserveNotGrantedError, type BatchDiscloseHandlesArgs, type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type CustomFee, type DiscloseHandleArgs, type DisclosureResult, type DisperseArgs, type DisperseDistribution, type DisperseMode, type DisperseResult, type EncryptedInput, type EncryptedInputs, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PendingDisperseResult, type PendingRegisterResult, type PendingWithdrawTokenFeeResult, type PreflightDisperseArgs, type PreflightReport, type RecipientCheck, type RegisterArgs, type RegisterResult, type SubwalletApprovalState, type UserFees, type WithdrawTokenFeeArgs, type WithdrawTokenFeeResult, } from "./types.js";
5
5
  export { disperseConfidentialAbi, disperseWalletAbi } from "./abis/index.js";
6
6
  export { erc7984OperatorAbi } from "../fhe/erc7984-abi.js";
7
7
  export declare const FEE_COLLECTOR_ROLE: "0x2dca0f5ce7e75a4b43fe2b0d6f5d0b7a2bf92ecf89f8f0aa17b8308b67038821";
@@ -11,4 +11,5 @@ export declare const WITHDRAWER_ROLE: "0x10dac8c06a04bec0b551627dad28bc00d6516b0
11
11
  export declare const DEFAULT_ADMIN_ROLE: "0x0000000000000000000000000000000000000000000000000000000000000000";
12
12
  export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, TokenOpsValidationError, ContractRevertError, TokenOpsContractError, PausedError, AccessDeniedError, OperatorNotApprovedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../core/errors.js";
13
13
  export { type PreflightResult } from "../core/preflight.js";
14
+ export type { MinedWrite, PendingWrite, ReceiptMode } from "../core/pending.js";
14
15
  export { NotRegisteredError, AlreadyRegisteredError, SubwalletsNotApprovedError, SingletonNotApprovedError, } from "./errors.js";
@@ -1,11 +1,11 @@
1
- export { AlreadyRegisteredError, ConfidentialDisperseClient, DEFAULT_ADMIN_ROLE, DisperseEncryptedReserveNotGrantedError, DisperseSubwalletNotFoundError, FEE_COLLECTOR_ROLE, FEE_MANAGER_ROLE, NotRegisteredError, PAUSER_ROLE, SingletonNotApprovedError, SubwalletsNotApprovedError, WITHDRAWER_ROLE, computeSubtotals, createConfidentialDisperseClient, disperseConfidentialAbi, disperseWalletAbi, encryptUint64, encryptUint64Batch, resolveEncryptor } from '../chunk-44YJPMQC.js';
1
+ export { AlreadyRegisteredError, ConfidentialDisperseClient, DEFAULT_ADMIN_ROLE, DisperseEncryptedReserveNotGrantedError, DisperseSubwalletNotFoundError, FEE_COLLECTOR_ROLE, FEE_MANAGER_ROLE, NotRegisteredError, PAUSER_ROLE, SingletonNotApprovedError, SubwalletsNotApprovedError, WITHDRAWER_ROLE, computeSubtotals, createConfidentialDisperseClient, disperseConfidentialAbi, disperseWalletAbi, encryptUint64, encryptUint64Batch, resolveEncryptor } from '../chunk-CHGY6B7L.js';
2
2
  export { ERC7984_OPERATOR_MAX_DEADLINE, revokeOperator, setOperator } from '../chunk-4TSDNZQ3.js';
3
3
  import '../chunk-WMACINXO.js';
4
4
  import '../chunk-ZWXJTBZO.js';
5
5
  export { erc7984OperatorAbi } from '../chunk-7VELUOMI.js';
6
- import '../chunk-NWFMBLSQ.js';
6
+ import '../chunk-7KY4K4PH.js';
7
7
  import '../chunk-4RAAATVY.js';
8
- import '../chunk-A4DCEE33.js';
8
+ import '../chunk-GHGF65LN.js';
9
9
  import '../chunk-ZA673I3O.js';
10
10
  import '../chunk-KWFFIJYX.js';
11
11
  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, TokenOpsContractError, TokenOpsSdkError, TokenOpsValidationError, TransferFailedError, UnknownWriteFailureError, UnsupportedChainError, UserDecryptNotAllowedError, UserRejectedSignatureError, WalletChainMismatchError, WalletRejectedError, isTokenOpsSdkError } from '../chunk-QBJ7O2B4.js';
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunk3YHBO2DL_cjs = require('../../chunk-3YHBO2DL.cjs');
3
+ var chunkS47IBDTA_cjs = require('../../chunk-S47IBDTA.cjs');
4
4
  var chunk7AFPOE7N_cjs = require('../../chunk-7AFPOE7N.cjs');
5
5
  require('../../chunk-ZQUE2B3Q.cjs');
6
6
  require('../../chunk-KFRDLKMA.cjs');
7
7
  require('../../chunk-TEBM66WA.cjs');
8
8
  require('../../chunk-FAXIIH5R.cjs');
9
9
  require('../../chunk-FWHYQZ5E.cjs');
10
- require('../../chunk-UG5RKLU2.cjs');
10
+ require('../../chunk-SUYBAF27.cjs');
11
11
  require('../../chunk-MVDQMV25.cjs');
12
- var chunkFT5H2Q7Y_cjs = require('../../chunk-FT5H2Q7Y.cjs');
12
+ var chunkYAL6JSAZ_cjs = require('../../chunk-YAL6JSAZ.cjs');
13
13
  require('../../chunk-JK4XMMKM.cjs');
14
14
  require('../../chunk-66IHPTOK.cjs');
15
15
  var chunk67OV5CX2_cjs = require('../../chunk-67OV5CX2.cjs');
@@ -23,7 +23,7 @@ var FHE_DISPERSE_NAMESPACE = "fhe-disperse";
23
23
  function tryResolveSingletonAddress(override, chainId) {
24
24
  if (override) return override;
25
25
  if (chainId === void 0) return void 0;
26
- return chunkFT5H2Q7Y_cjs.getFheDisperseSingletonAddress(chainId);
26
+ return chunkYAL6JSAZ_cjs.getFheDisperseSingletonAddress(chainId);
27
27
  }
28
28
  function useMemoDisperseClient(opts = {}) {
29
29
  const publicClient = wagmi.usePublicClient({ chainId: opts.chainId });
@@ -36,14 +36,14 @@ function useMemoDisperseClient(opts = {}) {
36
36
  const client = react.useMemo(() => {
37
37
  if (!publicClient) return void 0;
38
38
  if (!resolvedAddress) return void 0;
39
- return chunk3YHBO2DL_cjs.createConfidentialDisperseClient({
39
+ return chunkS47IBDTA_cjs.createConfidentialDisperseClient({
40
40
  publicClient,
41
41
  ...walletClient ? { walletClient } : {},
42
42
  address: resolvedAddress,
43
43
  ...chainId !== void 0 ? { chainId } : {},
44
44
  // Lazy — invoked per-encryption inside the headless client. Picks up
45
45
  // whichever EncryptorSource the consumer last passed in.
46
- encryptor: () => chunk3YHBO2DL_cjs.resolveEncryptor(encryptorSourceRef.current),
46
+ encryptor: () => chunkS47IBDTA_cjs.resolveEncryptor(encryptorSourceRef.current),
47
47
  ...opts.aclAddress ? { aclAddress: opts.aclAddress } : {}
48
48
  });
49
49
  }, [publicClient, walletClient, resolvedAddress, chainId, opts.aclAddress]);
@@ -66,7 +66,7 @@ function computeSingletonResolutionError(override, chainId) {
66
66
  clientLabel: "ConfidentialDisperseClient"
67
67
  });
68
68
  }
69
- const resolved = chunkFT5H2Q7Y_cjs.getFheDisperseSingletonAddress(chainId);
69
+ const resolved = chunkYAL6JSAZ_cjs.getFheDisperseSingletonAddress(chainId);
70
70
  if (!resolved) {
71
71
  return new chunk67OV5CX2_cjs.DeploymentAddressUnavailableError({
72
72
  reason: "registry-not-deployed",
@@ -468,17 +468,19 @@ function useWithdrawTokenFee(options = {}) {
468
468
  token: token2,
469
469
  to: to2,
470
470
  encryptedInput,
471
- ...account2 !== void 0 ? { account: account2 } : {}
471
+ ...account2 !== void 0 ? { account: account2 } : {},
472
+ waitForReceipt: args.waitForReceipt
472
473
  });
473
474
  }
474
475
  const { token, to, amount, encryptor: encryptorSource, account } = args;
475
- const eager = encryptorSource ? chunk3YHBO2DL_cjs.resolveEncryptor(encryptorSource) : void 0;
476
+ const eager = encryptorSource ? chunkS47IBDTA_cjs.resolveEncryptor(encryptorSource) : void 0;
476
477
  return client.withdrawTokenFee({
477
478
  token,
478
479
  to,
479
480
  amount,
480
481
  ...eager ? { encryptor: eager } : {},
481
- ...account !== void 0 ? { account } : {}
482
+ ...account !== void 0 ? { account } : {},
483
+ waitForReceipt: args.waitForReceipt
482
484
  });
483
485
  }
484
486
  });
@@ -524,63 +526,63 @@ function useRevokeRole(options = {}) {
524
526
 
525
527
  Object.defineProperty(exports, "AlreadyRegisteredError", {
526
528
  enumerable: true,
527
- get: function () { return chunk3YHBO2DL_cjs.AlreadyRegisteredError; }
529
+ get: function () { return chunkS47IBDTA_cjs.AlreadyRegisteredError; }
528
530
  });
529
531
  Object.defineProperty(exports, "DEFAULT_ADMIN_ROLE", {
530
532
  enumerable: true,
531
- get: function () { return chunk3YHBO2DL_cjs.DEFAULT_ADMIN_ROLE; }
533
+ get: function () { return chunkS47IBDTA_cjs.DEFAULT_ADMIN_ROLE; }
532
534
  });
533
535
  Object.defineProperty(exports, "DisperseEncryptedReserveNotGrantedError", {
534
536
  enumerable: true,
535
- get: function () { return chunk3YHBO2DL_cjs.DisperseEncryptedReserveNotGrantedError; }
537
+ get: function () { return chunkS47IBDTA_cjs.DisperseEncryptedReserveNotGrantedError; }
536
538
  });
537
539
  Object.defineProperty(exports, "DisperseSubwalletNotFoundError", {
538
540
  enumerable: true,
539
- get: function () { return chunk3YHBO2DL_cjs.DisperseSubwalletNotFoundError; }
541
+ get: function () { return chunkS47IBDTA_cjs.DisperseSubwalletNotFoundError; }
540
542
  });
541
543
  Object.defineProperty(exports, "FEE_COLLECTOR_ROLE", {
542
544
  enumerable: true,
543
- get: function () { return chunk3YHBO2DL_cjs.FEE_COLLECTOR_ROLE; }
545
+ get: function () { return chunkS47IBDTA_cjs.FEE_COLLECTOR_ROLE; }
544
546
  });
545
547
  Object.defineProperty(exports, "FEE_MANAGER_ROLE", {
546
548
  enumerable: true,
547
- get: function () { return chunk3YHBO2DL_cjs.FEE_MANAGER_ROLE; }
549
+ get: function () { return chunkS47IBDTA_cjs.FEE_MANAGER_ROLE; }
548
550
  });
549
551
  Object.defineProperty(exports, "NotRegisteredError", {
550
552
  enumerable: true,
551
- get: function () { return chunk3YHBO2DL_cjs.NotRegisteredError; }
553
+ get: function () { return chunkS47IBDTA_cjs.NotRegisteredError; }
552
554
  });
553
555
  Object.defineProperty(exports, "PAUSER_ROLE", {
554
556
  enumerable: true,
555
- get: function () { return chunk3YHBO2DL_cjs.PAUSER_ROLE; }
557
+ get: function () { return chunkS47IBDTA_cjs.PAUSER_ROLE; }
556
558
  });
557
559
  Object.defineProperty(exports, "SingletonNotApprovedError", {
558
560
  enumerable: true,
559
- get: function () { return chunk3YHBO2DL_cjs.SingletonNotApprovedError; }
561
+ get: function () { return chunkS47IBDTA_cjs.SingletonNotApprovedError; }
560
562
  });
561
563
  Object.defineProperty(exports, "SubwalletsNotApprovedError", {
562
564
  enumerable: true,
563
- get: function () { return chunk3YHBO2DL_cjs.SubwalletsNotApprovedError; }
565
+ get: function () { return chunkS47IBDTA_cjs.SubwalletsNotApprovedError; }
564
566
  });
565
567
  Object.defineProperty(exports, "WITHDRAWER_ROLE", {
566
568
  enumerable: true,
567
- get: function () { return chunk3YHBO2DL_cjs.WITHDRAWER_ROLE; }
569
+ get: function () { return chunkS47IBDTA_cjs.WITHDRAWER_ROLE; }
568
570
  });
569
571
  Object.defineProperty(exports, "computeSubtotals", {
570
572
  enumerable: true,
571
- get: function () { return chunk3YHBO2DL_cjs.computeSubtotals; }
573
+ get: function () { return chunkS47IBDTA_cjs.computeSubtotals; }
572
574
  });
573
575
  Object.defineProperty(exports, "encryptUint64", {
574
576
  enumerable: true,
575
- get: function () { return chunk3YHBO2DL_cjs.encryptUint64; }
577
+ get: function () { return chunkS47IBDTA_cjs.encryptUint64; }
576
578
  });
577
579
  Object.defineProperty(exports, "encryptUint64Batch", {
578
580
  enumerable: true,
579
- get: function () { return chunk3YHBO2DL_cjs.encryptUint64Batch; }
581
+ get: function () { return chunkS47IBDTA_cjs.encryptUint64Batch; }
580
582
  });
581
583
  Object.defineProperty(exports, "resolveEncryptor", {
582
584
  enumerable: true,
583
- get: function () { return chunk3YHBO2DL_cjs.resolveEncryptor; }
585
+ get: function () { return chunkS47IBDTA_cjs.resolveEncryptor; }
584
586
  });
585
587
  Object.defineProperty(exports, "useEnsureOperator", {
586
588
  enumerable: true,
@@ -76,9 +76,10 @@ export { FHE_DISPERSE_KEY, FHE_DISPERSE_NAMESPACE } from "./_shared.js";
76
76
  export { FEE_COLLECTOR_ROLE, FEE_MANAGER_ROLE, PAUSER_ROLE, WITHDRAWER_ROLE, DEFAULT_ADMIN_ROLE, } from "../index.js";
77
77
  export { computeSubtotals, } from "../singleton.js";
78
78
  export { encryptUint64, encryptUint64Batch, resolveEncryptor, type Encryptor, type EncryptorSource, type EncryptUint64Args, type EncryptUint64BatchArgs, type FheValueInput, } from "../encryption.js";
79
- export { DisperseSubwalletNotFoundError, DisperseEncryptedReserveNotGrantedError, type BatchDiscloseHandlesArgs, type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type DiscloseHandleArgs, type DisperseArgs, type DisperseMode, type DisperseResult, type EncryptedInput, type EncryptedInputs, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PreflightDisperseArgs, type PreflightReport, type RecipientCheck, type RegisterResult, type SubwalletApprovalState, type UserFees, } from "../types.js";
79
+ export { DisperseSubwalletNotFoundError, DisperseEncryptedReserveNotGrantedError, type BatchDiscloseHandlesArgs, type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type DiscloseHandleArgs, type DisperseArgs, type DisperseMode, type DisperseResult, type EncryptedInput, type EncryptedInputs, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PendingDisperseResult, type PendingRegisterResult, type PendingWithdrawTokenFeeResult, type PreflightDisperseArgs, type PreflightReport, type RecipientCheck, type RegisterResult, type SubwalletApprovalState, type UserFees, type WithdrawTokenFeeResult, } from "../types.js";
80
80
  export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, ContractRevertError, PausedError, AccessDeniedError, OperatorNotApprovedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../../core/errors.js";
81
81
  export { type PreflightResult } from "../../core/preflight.js";
82
+ export type { MinedWrite, PendingWrite, ReceiptMode } from "../../core/pending.js";
82
83
  export { NotRegisteredError, AlreadyRegisteredError, SubwalletsNotApprovedError, SingletonNotApprovedError, } from "../errors.js";
83
84
  export { useIsOperator, type UseIsOperatorOptions } from "../../fhe/react/useIsOperator.js";
84
85
  export { useEnsureOperator, type UseEnsureOperatorOptions, type EnsureOperatorVariables, } from "../../fhe/react/useEnsureOperator.js";
@@ -76,9 +76,10 @@ export { FHE_DISPERSE_KEY, FHE_DISPERSE_NAMESPACE } from "./_shared.js";
76
76
  export { FEE_COLLECTOR_ROLE, FEE_MANAGER_ROLE, PAUSER_ROLE, WITHDRAWER_ROLE, DEFAULT_ADMIN_ROLE, } from "../index.js";
77
77
  export { computeSubtotals, } from "../singleton.js";
78
78
  export { encryptUint64, encryptUint64Batch, resolveEncryptor, type Encryptor, type EncryptorSource, type EncryptUint64Args, type EncryptUint64BatchArgs, type FheValueInput, } from "../encryption.js";
79
- export { DisperseSubwalletNotFoundError, DisperseEncryptedReserveNotGrantedError, type BatchDiscloseHandlesArgs, type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type DiscloseHandleArgs, type DisperseArgs, type DisperseMode, type DisperseResult, type EncryptedInput, type EncryptedInputs, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PreflightDisperseArgs, type PreflightReport, type RecipientCheck, type RegisterResult, type SubwalletApprovalState, type UserFees, } from "../types.js";
79
+ export { DisperseSubwalletNotFoundError, DisperseEncryptedReserveNotGrantedError, type BatchDiscloseHandlesArgs, type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type DiscloseHandleArgs, type DisperseArgs, type DisperseMode, type DisperseResult, type EncryptedInput, type EncryptedInputs, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PendingDisperseResult, type PendingRegisterResult, type PendingWithdrawTokenFeeResult, type PreflightDisperseArgs, type PreflightReport, type RecipientCheck, type RegisterResult, type SubwalletApprovalState, type UserFees, type WithdrawTokenFeeResult, } from "../types.js";
80
80
  export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, ContractRevertError, PausedError, AccessDeniedError, OperatorNotApprovedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../../core/errors.js";
81
81
  export { type PreflightResult } from "../../core/preflight.js";
82
+ export type { MinedWrite, PendingWrite, ReceiptMode } from "../../core/pending.js";
82
83
  export { NotRegisteredError, AlreadyRegisteredError, SubwalletsNotApprovedError, SingletonNotApprovedError, } from "../errors.js";
83
84
  export { useIsOperator, type UseIsOperatorOptions } from "../../fhe/react/useIsOperator.js";
84
85
  export { useEnsureOperator, type UseEnsureOperatorOptions, type EnsureOperatorVariables, } from "../../fhe/react/useEnsureOperator.js";
@@ -1,14 +1,14 @@
1
- import { resolveEncryptor, createConfidentialDisperseClient } from '../../chunk-44YJPMQC.js';
2
- export { AlreadyRegisteredError, DEFAULT_ADMIN_ROLE, DisperseEncryptedReserveNotGrantedError, DisperseSubwalletNotFoundError, FEE_COLLECTOR_ROLE, FEE_MANAGER_ROLE, NotRegisteredError, PAUSER_ROLE, SingletonNotApprovedError, SubwalletsNotApprovedError, WITHDRAWER_ROLE, computeSubtotals, encryptUint64, encryptUint64Batch, resolveEncryptor } from '../../chunk-44YJPMQC.js';
1
+ import { resolveEncryptor, createConfidentialDisperseClient } from '../../chunk-CHGY6B7L.js';
2
+ export { AlreadyRegisteredError, DEFAULT_ADMIN_ROLE, DisperseEncryptedReserveNotGrantedError, DisperseSubwalletNotFoundError, FEE_COLLECTOR_ROLE, FEE_MANAGER_ROLE, NotRegisteredError, PAUSER_ROLE, SingletonNotApprovedError, SubwalletsNotApprovedError, WITHDRAWER_ROLE, computeSubtotals, encryptUint64, encryptUint64Batch, resolveEncryptor } from '../../chunk-CHGY6B7L.js';
3
3
  export { useEnsureOperator, useIsOperator } from '../../chunk-AXIPOR3C.js';
4
4
  import '../../chunk-FT4LNBOS.js';
5
5
  import '../../chunk-4TSDNZQ3.js';
6
6
  import '../../chunk-WMACINXO.js';
7
7
  import '../../chunk-ZWXJTBZO.js';
8
8
  import '../../chunk-7VELUOMI.js';
9
- import '../../chunk-NWFMBLSQ.js';
9
+ import '../../chunk-7KY4K4PH.js';
10
10
  import '../../chunk-4RAAATVY.js';
11
- import { getFheDisperseSingletonAddress } from '../../chunk-A4DCEE33.js';
11
+ import { getFheDisperseSingletonAddress } from '../../chunk-GHGF65LN.js';
12
12
  import '../../chunk-ZA673I3O.js';
13
13
  import '../../chunk-KWFFIJYX.js';
14
14
  import { MissingClientError, DeploymentAddressUnavailableError } from '../../chunk-QBJ7O2B4.js';
@@ -468,7 +468,8 @@ function useWithdrawTokenFee(options = {}) {
468
468
  token: token2,
469
469
  to: to2,
470
470
  encryptedInput,
471
- ...account2 !== void 0 ? { account: account2 } : {}
471
+ ...account2 !== void 0 ? { account: account2 } : {},
472
+ waitForReceipt: args.waitForReceipt
472
473
  });
473
474
  }
474
475
  const { token, to, amount, encryptor: encryptorSource, account } = args;
@@ -478,7 +479,8 @@ function useWithdrawTokenFee(options = {}) {
478
479
  to,
479
480
  amount,
480
481
  ...eager ? { encryptor: eager } : {},
481
- ...account !== void 0 ? { account } : {}
482
+ ...account !== void 0 ? { account } : {},
483
+ waitForReceipt: args.waitForReceipt
482
484
  });
483
485
  }
484
486
  });
@@ -1,5 +1,6 @@
1
1
  import { type UseMutationResult } from "@tanstack/react-query";
2
- import { type DisperseArgs, type DisperseResult } from "../types.js";
2
+ import type { ReceiptMode } from "../../core/pending.js";
3
+ import { type DisperseArgs, type DisperseResult, type PendingDisperseResult } from "../types.js";
3
4
  import { type DisperseHookOptions } from "./_shared.js";
4
5
  /**
5
6
  * Disperse confidential tokens to multiple recipients. The SDK validates
@@ -22,6 +23,9 @@ import { type DisperseHookOptions } from "./_shared.js";
22
23
  * `() => useZamaSDK().relayer` inline (calls a React hook inside a mutation
23
24
  * body, violating the rules of hooks; see CLAUDE.md Pitfall #3).
24
25
  *
26
+ * With `waitForReceipt: false` (Safe / multisig) the mutation resolves to a
27
+ * {@link PendingDisperseResult}; narrow with `if (data.pending)` before reading `distributions`.
28
+ *
25
29
  * After success, invalidate `useGetFees`, `useHasApprovedSubwallets`, and any
26
30
  * downstream token-balance queries owned by the consumer.
27
31
  *
@@ -34,4 +38,4 @@ import { type DisperseHookOptions } from "./_shared.js";
34
38
  * disperse.mutate({ token, mode: "direct", recipients, amounts });
35
39
  * }
36
40
  */
37
- export declare function useDisperse(options?: DisperseHookOptions): UseMutationResult<DisperseResult, Error, DisperseArgs>;
41
+ export declare function useDisperse(options?: DisperseHookOptions): UseMutationResult<DisperseResult | PendingDisperseResult, Error, DisperseArgs & ReceiptMode>;