@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.
- package/CHANGELOG.md +53 -0
- package/README.md +71 -35
- package/SUPPORT.md +1 -1
- package/dist/{chunk-NGU4JYIR.js → chunk-2ND7US2I.js} +1 -1
- package/dist/{chunk-U3TBQRT7.js → chunk-3ZSPRHR3.js} +55 -12
- package/dist/{chunk-BXX5TETM.js → chunk-67Q6KSVV.js} +4114 -3267
- package/dist/{chunk-JVNJSDQ4.cjs → chunk-6AYJRUGP.cjs} +7 -50
- package/dist/{chunk-AHU2HMNE.cjs → chunk-6FUHF73F.cjs} +5 -5
- package/dist/{chunk-NWFMBLSQ.js → chunk-7KY4K4PH.js} +1 -1
- package/dist/{chunk-YABHXJNH.cjs → chunk-ARZ5C3FS.cjs} +7 -7
- package/dist/{chunk-4IB4IY5Y.js → chunk-AX6MQAWU.js} +2 -2
- package/dist/{chunk-BPIVVCSQ.js → chunk-BSXEX2SH.js} +3 -3
- package/dist/{chunk-PK6Q6J5F.js → chunk-CHGY6B7L.js} +34 -81
- package/dist/{chunk-GKYZQJGP.cjs → chunk-DFK5GCJP.cjs} +55 -72
- package/dist/{chunk-4AWQJQXY.cjs → chunk-E4IV4M4E.cjs} +4126 -3279
- package/dist/{chunk-6HCT4QIX.js → chunk-GHGF65LN.js} +16 -13
- package/dist/{chunk-TWT3STIX.js → chunk-K3R27WX4.js} +8 -46
- package/dist/{chunk-GCJFAY4X.js → chunk-KJUNBOJQ.js} +52 -71
- package/dist/{chunk-6XOAYDC6.cjs → chunk-PO3A2AQX.cjs} +4 -4
- package/dist/{chunk-TND5NDV7.cjs → chunk-QHDMPT7I.cjs} +64 -19
- package/dist/{chunk-IEKTGJ4J.cjs → chunk-S47IBDTA.cjs} +36 -83
- package/dist/{chunk-UG5RKLU2.cjs → chunk-SUYBAF27.cjs} +1 -1
- package/dist/{chunk-WRWRA4TN.js → chunk-TWU7L5H7.js} +5 -48
- package/dist/{chunk-WJLECC22.cjs → chunk-UUSSWOPR.cjs} +9 -47
- package/dist/{chunk-YTIYTV4K.cjs → chunk-VHKMWWBA.cjs} +319 -40
- package/dist/{chunk-PG3WXT3K.cjs → chunk-YAL6JSAZ.cjs} +16 -13
- package/dist/{chunk-LEYYG4RF.js → chunk-YMWMIWBP.js} +315 -42
- package/dist/core/addresses.d.ts +4 -4
- package/dist/core/errors.d.ts +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/pending.d.ts +57 -0
- package/dist/core/version.d.ts +1 -1
- package/dist/fhe/operators.d.ts +6 -5
- package/dist/fhe/types.d.ts +1 -1
- package/dist/fhe-airdrop/abis/airdrop-base.d.ts +81 -4
- package/dist/fhe-airdrop/abis/ecdsa.d.ts +101 -4
- package/dist/fhe-airdrop/abis/factory.d.ts +222 -4
- package/dist/fhe-airdrop/abis/merkle.d.ts +100 -4
- package/dist/fhe-airdrop/advanced/index.cjs +8 -4
- package/dist/fhe-airdrop/advanced/index.d.cts +1 -0
- package/dist/fhe-airdrop/advanced/index.d.ts +1 -0
- package/dist/fhe-airdrop/advanced/index.js +1 -1
- package/dist/fhe-airdrop/advanced/react/index.cjs +121 -143
- package/dist/fhe-airdrop/advanced/react/index.js +55 -77
- package/dist/fhe-airdrop/advanced/react/useClearCompliancePolicy.d.ts +3 -1
- package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +3 -1
- package/dist/fhe-airdrop/advanced/react/useFactoryComplianceDelegate.d.ts +2 -4
- package/dist/fhe-airdrop/advanced/react/useSetComplianceDelegate.d.ts +7 -7
- package/dist/fhe-airdrop/advanced/react/useSetComplianceManagerImpl.d.ts +3 -1
- package/dist/fhe-airdrop/advanced/react/useSetCompliancePolicy.d.ts +2 -1
- package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +3 -1
- package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +5 -4
- package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +3 -1
- package/dist/fhe-airdrop/advanced/react/useSetMaxGasFee.d.ts +7 -3
- package/dist/fhe-airdrop/airdrop-base.d.ts +95 -10
- package/dist/fhe-airdrop/campaign.d.ts +37 -73
- package/dist/fhe-airdrop/compliance-clone.d.ts +21 -0
- package/dist/fhe-airdrop/constants.d.ts +3 -1
- package/dist/fhe-airdrop/ecdsa.d.ts +67 -27
- package/dist/fhe-airdrop/encryption.d.ts +19 -6
- package/dist/fhe-airdrop/errors.d.ts +77 -2
- package/dist/fhe-airdrop/factory-params.d.ts +2361 -0
- package/dist/fhe-airdrop/factory.d.ts +142 -68
- package/dist/fhe-airdrop/guards.d.ts +110 -31
- package/dist/fhe-airdrop/index.cjs +79 -59
- package/dist/fhe-airdrop/index.d.cts +11 -9
- package/dist/fhe-airdrop/index.d.ts +11 -9
- package/dist/fhe-airdrop/index.js +5 -5
- package/dist/fhe-airdrop/merkle-tree.d.ts +9 -9
- package/dist/fhe-airdrop/merkle.d.ts +32 -11
- package/dist/fhe-airdrop/react/_shared.d.ts +12 -6
- package/dist/fhe-airdrop/react/index.cjs +294 -258
- package/dist/fhe-airdrop/react/index.d.cts +16 -9
- package/dist/fhe-airdrop/react/index.d.ts +16 -9
- package/dist/fhe-airdrop/react/index.js +114 -110
- package/dist/fhe-airdrop/react/keys.d.ts +46 -7
- package/dist/fhe-airdrop/react/useAccessEcdsaClaimAmount.d.ts +6 -3
- package/dist/fhe-airdrop/react/useAccessMerkleClaimAmount.d.ts +2 -2
- package/dist/fhe-airdrop/react/useAirdropConfig.d.ts +8 -3
- package/dist/fhe-airdrop/react/useAirdropPause.d.ts +5 -0
- package/dist/fhe-airdrop/react/useBuildMerkleCampaign.d.ts +4 -6
- package/dist/fhe-airdrop/react/useComplianceManager.d.ts +2 -2
- package/dist/fhe-airdrop/react/useComplianceManagerOf.d.ts +1 -2
- package/dist/fhe-airdrop/react/useCreateAndFundEcdsaAirdrop.d.ts +16 -11
- package/dist/fhe-airdrop/react/useCreateAndFundMerkleAirdrop.d.ts +23 -7
- package/dist/fhe-airdrop/react/useCreateEcdsaAirdrop.d.ts +13 -8
- package/dist/fhe-airdrop/react/useCreateMerkleAirdrop.d.ts +27 -7
- package/dist/fhe-airdrop/react/useDedupMode.d.ts +16 -0
- package/dist/fhe-airdrop/react/useDiscloseHandleToParty.d.ts +4 -3
- package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +6 -4
- package/dist/fhe-airdrop/react/useEcdsaClaimAndUnwrap.d.ts +15 -8
- package/dist/fhe-airdrop/react/useEcdsaDomain.d.ts +1 -1
- package/dist/fhe-airdrop/react/useEncryptCampaignAmounts.d.ts +5 -7
- package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +4 -1
- package/dist/fhe-airdrop/react/useFundAirdrop.d.ts +3 -4
- package/dist/fhe-airdrop/react/useGrantInstanceRoles.d.ts +2 -1
- package/dist/fhe-airdrop/react/useIsSignatureValid.d.ts +5 -4
- package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +4 -1
- package/dist/fhe-airdrop/react/useMerkleClaimAndUnwrap.d.ts +14 -3
- package/dist/fhe-airdrop/react/usePlanMerkleCampaign.d.ts +18 -3
- package/dist/fhe-airdrop/react/usePreflightClaim.d.ts +1 -1
- package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +34 -13
- package/dist/fhe-airdrop/react/useRescueERC20.d.ts +3 -3
- package/dist/fhe-airdrop/react/useRescueNativeToken.d.ts +23 -0
- package/dist/fhe-airdrop/react/useRotateMerkleRoot.d.ts +5 -2
- package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +4 -0
- package/dist/fhe-airdrop/react/useTokenOf.d.ts +29 -0
- package/dist/fhe-airdrop/react/useUnwrapRequest.d.ts +25 -0
- package/dist/fhe-airdrop/react/useWithdrawConfidential.d.ts +4 -0
- package/dist/fhe-airdrop/roles.d.ts +82 -7
- package/dist/fhe-airdrop/types.d.ts +109 -14
- package/dist/fhe-disperse/errors.d.ts +3 -3
- package/dist/fhe-disperse/index.cjs +22 -22
- package/dist/fhe-disperse/index.d.cts +2 -1
- package/dist/fhe-disperse/index.d.ts +2 -1
- package/dist/fhe-disperse/index.js +3 -3
- package/dist/fhe-disperse/react/index.cjs +27 -25
- package/dist/fhe-disperse/react/index.d.cts +2 -1
- package/dist/fhe-disperse/react/index.d.ts +2 -1
- package/dist/fhe-disperse/react/index.js +8 -6
- package/dist/fhe-disperse/react/useDisperse.d.ts +6 -2
- package/dist/fhe-disperse/react/useRegister.d.ts +9 -3
- package/dist/fhe-disperse/react/useSingletonWithdrawTokenFee.d.ts +7 -2
- package/dist/fhe-disperse/react/useWithdrawTokenFee.d.ts +7 -2
- package/dist/fhe-disperse/singleton.d.ts +33 -19
- package/dist/fhe-disperse/types.d.ts +48 -8
- package/dist/fhe-vesting/advanced/index.cjs +6 -6
- package/dist/fhe-vesting/advanced/index.js +4 -4
- package/dist/fhe-vesting/advanced/react/index.cjs +9 -9
- package/dist/fhe-vesting/advanced/react/index.js +6 -6
- package/dist/fhe-vesting/factory.d.ts +31 -8
- package/dist/fhe-vesting/index.cjs +23 -23
- package/dist/fhe-vesting/index.d.cts +3 -2
- package/dist/fhe-vesting/index.d.ts +3 -2
- package/dist/fhe-vesting/index.js +4 -4
- package/dist/fhe-vesting/manager.d.ts +27 -2
- package/dist/fhe-vesting/react/index.cjs +126 -126
- package/dist/fhe-vesting/react/index.d.cts +3 -2
- package/dist/fhe-vesting/react/index.d.ts +3 -2
- package/dist/fhe-vesting/react/index.js +5 -5
- package/dist/fhe-vesting/react/useCreateManager.d.ts +16 -9
- package/dist/fhe-vesting/react/useCreateManagerAndGetAddress.d.ts +9 -5
- package/dist/fhe-vesting/react/useSplitVesting.d.ts +9 -3
- package/dist/index.cjs +18 -18
- package/dist/index.js +1 -1
- package/dist/testnet-faucet/faucet.d.ts +3 -0
- package/dist/testnet-faucet/index.cjs +15 -15
- package/dist/testnet-faucet/index.js +3 -3
- package/dist/testnet-faucet/react/index.cjs +9 -9
- package/dist/testnet-faucet/react/index.js +4 -4
- 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`
|
|
@@ -34,6 +35,27 @@ export interface CommonAirdropParams {
|
|
|
34
35
|
*/
|
|
35
36
|
maxAcceptedGasFee: bigint;
|
|
36
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;
|
|
58
|
+
}
|
|
37
59
|
/** @alpha */
|
|
38
60
|
export interface EcdsaAirdropParams {
|
|
39
61
|
common: CommonAirdropParams;
|
|
@@ -47,6 +69,18 @@ export interface MerkleAirdropParams {
|
|
|
47
69
|
merkleRoot: Hex;
|
|
48
70
|
isMerkleRootMutable: boolean;
|
|
49
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
|
+
};
|
|
50
84
|
/**
|
|
51
85
|
* Arguments shared by both `factory.createEcdsaAirdrop` / `createMerkleAirdrop` entrypoints.
|
|
52
86
|
*
|
|
@@ -56,12 +90,62 @@ export interface CreateAirdropArgs<P> {
|
|
|
56
90
|
params: P;
|
|
57
91
|
mode: DeploymentMode;
|
|
58
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;
|
|
59
121
|
}
|
|
60
122
|
/** @alpha */
|
|
61
|
-
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`). */
|
|
62
125
|
hash: Hex;
|
|
63
126
|
airdrop: Address;
|
|
64
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 {
|
|
65
149
|
}
|
|
66
150
|
/**
|
|
67
151
|
* One recipient's committed allocation, keyed for `CampaignEntry.merkleProof` construction.
|
|
@@ -75,25 +159,17 @@ export interface CampaignRecipient {
|
|
|
75
159
|
cumulativeTotal: bigint;
|
|
76
160
|
}
|
|
77
161
|
/**
|
|
78
|
-
* One recipient's encrypted, proof-bearing claim input
|
|
162
|
+
* One recipient's encrypted, proof-bearing claim input - everything `merkle.claim` needs.
|
|
79
163
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
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`.
|
|
84
168
|
*
|
|
85
169
|
* @alpha
|
|
86
170
|
*/
|
|
87
171
|
export interface CampaignEntry {
|
|
88
|
-
/** The claim identity: whose leaf this is, whose delivered total advances, and where payout defaults. */
|
|
89
172
|
account: Address;
|
|
90
|
-
/**
|
|
91
|
-
* The only address that can submit this entry. The FHE input proof is bound to
|
|
92
|
-
* `(instance, boundTo)`, so any other sender is rejected by the coprocessor —
|
|
93
|
-
* a leaf cannot be re-pointed at a different submitter without re-encrypting,
|
|
94
|
-
* which changes the handle and therefore the root.
|
|
95
|
-
*/
|
|
96
|
-
boundTo: Address;
|
|
97
173
|
handle: Hex;
|
|
98
174
|
inputProof: Hex;
|
|
99
175
|
merkleProof: readonly Hex[];
|
|
@@ -103,3 +179,22 @@ export interface BuiltCampaign {
|
|
|
103
179
|
root: Hex;
|
|
104
180
|
entries: readonly CampaignEntry[];
|
|
105
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
|
-
*
|
|
53
|
-
*
|
|
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
|
|
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
|
|
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-
|
|
8
|
+
require('../chunk-SUYBAF27.cjs');
|
|
9
9
|
require('../chunk-MVDQMV25.cjs');
|
|
10
|
-
require('../chunk-
|
|
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
|
|
20
|
+
get: function () { return chunkS47IBDTA_cjs.AlreadyRegisteredError; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "ConfidentialDisperseClient", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
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
|
|
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
|
|
32
|
+
get: function () { return chunkS47IBDTA_cjs.DisperseEncryptedReserveNotGrantedError; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "DisperseSubwalletNotFoundError", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
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
|
|
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
|
|
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
|
|
48
|
+
get: function () { return chunkS47IBDTA_cjs.NotRegisteredError; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "PAUSER_ROLE", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunkS47IBDTA_cjs.PAUSER_ROLE; }
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "SingletonNotApprovedError", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkS47IBDTA_cjs.SingletonNotApprovedError; }
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "SubwalletsNotApprovedError", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkS47IBDTA_cjs.SubwalletsNotApprovedError; }
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "WITHDRAWER_ROLE", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunkS47IBDTA_cjs.WITHDRAWER_ROLE; }
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "computeSubtotals", {
|
|
67
67
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunkS47IBDTA_cjs.computeSubtotals; }
|
|
69
69
|
});
|
|
70
70
|
Object.defineProperty(exports, "createConfidentialDisperseClient", {
|
|
71
71
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkS47IBDTA_cjs.createConfidentialDisperseClient; }
|
|
73
73
|
});
|
|
74
74
|
Object.defineProperty(exports, "disperseConfidentialAbi", {
|
|
75
75
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
76
|
+
get: function () { return chunkS47IBDTA_cjs.disperseConfidentialAbi; }
|
|
77
77
|
});
|
|
78
78
|
Object.defineProperty(exports, "disperseWalletAbi", {
|
|
79
79
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunkS47IBDTA_cjs.disperseWalletAbi; }
|
|
81
81
|
});
|
|
82
82
|
Object.defineProperty(exports, "encryptUint64", {
|
|
83
83
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
84
|
+
get: function () { return chunkS47IBDTA_cjs.encryptUint64; }
|
|
85
85
|
});
|
|
86
86
|
Object.defineProperty(exports, "encryptUint64Batch", {
|
|
87
87
|
enumerable: true,
|
|
88
|
-
get: function () { return
|
|
88
|
+
get: function () { return chunkS47IBDTA_cjs.encryptUint64Batch; }
|
|
89
89
|
});
|
|
90
90
|
Object.defineProperty(exports, "resolveEncryptor", {
|
|
91
91
|
enumerable: true,
|
|
92
|
-
get: function () { return
|
|
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-
|
|
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-
|
|
6
|
+
import '../chunk-7KY4K4PH.js';
|
|
7
7
|
import '../chunk-4RAAATVY.js';
|
|
8
|
-
import '../chunk-
|
|
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
|
|
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-
|
|
10
|
+
require('../../chunk-SUYBAF27.cjs');
|
|
11
11
|
require('../../chunk-MVDQMV25.cjs');
|
|
12
|
-
var
|
|
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
|
|
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
|
|
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: () =>
|
|
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 =
|
|
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 ?
|
|
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
|
|
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
|
|
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
|
|
537
|
+
get: function () { return chunkS47IBDTA_cjs.DisperseEncryptedReserveNotGrantedError; }
|
|
536
538
|
});
|
|
537
539
|
Object.defineProperty(exports, "DisperseSubwalletNotFoundError", {
|
|
538
540
|
enumerable: true,
|
|
539
|
-
get: function () { return
|
|
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
|
|
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
|
|
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
|
|
553
|
+
get: function () { return chunkS47IBDTA_cjs.NotRegisteredError; }
|
|
552
554
|
});
|
|
553
555
|
Object.defineProperty(exports, "PAUSER_ROLE", {
|
|
554
556
|
enumerable: true,
|
|
555
|
-
get: function () { return
|
|
557
|
+
get: function () { return chunkS47IBDTA_cjs.PAUSER_ROLE; }
|
|
556
558
|
});
|
|
557
559
|
Object.defineProperty(exports, "SingletonNotApprovedError", {
|
|
558
560
|
enumerable: true,
|
|
559
|
-
get: function () { return
|
|
561
|
+
get: function () { return chunkS47IBDTA_cjs.SingletonNotApprovedError; }
|
|
560
562
|
});
|
|
561
563
|
Object.defineProperty(exports, "SubwalletsNotApprovedError", {
|
|
562
564
|
enumerable: true,
|
|
563
|
-
get: function () { return
|
|
565
|
+
get: function () { return chunkS47IBDTA_cjs.SubwalletsNotApprovedError; }
|
|
564
566
|
});
|
|
565
567
|
Object.defineProperty(exports, "WITHDRAWER_ROLE", {
|
|
566
568
|
enumerable: true,
|
|
567
|
-
get: function () { return
|
|
569
|
+
get: function () { return chunkS47IBDTA_cjs.WITHDRAWER_ROLE; }
|
|
568
570
|
});
|
|
569
571
|
Object.defineProperty(exports, "computeSubtotals", {
|
|
570
572
|
enumerable: true,
|
|
571
|
-
get: function () { return
|
|
573
|
+
get: function () { return chunkS47IBDTA_cjs.computeSubtotals; }
|
|
572
574
|
});
|
|
573
575
|
Object.defineProperty(exports, "encryptUint64", {
|
|
574
576
|
enumerable: true,
|
|
575
|
-
get: function () { return
|
|
577
|
+
get: function () { return chunkS47IBDTA_cjs.encryptUint64; }
|
|
576
578
|
});
|
|
577
579
|
Object.defineProperty(exports, "encryptUint64Batch", {
|
|
578
580
|
enumerable: true,
|
|
579
|
-
get: function () { return
|
|
581
|
+
get: function () { return chunkS47IBDTA_cjs.encryptUint64Batch; }
|
|
580
582
|
});
|
|
581
583
|
Object.defineProperty(exports, "resolveEncryptor", {
|
|
582
584
|
enumerable: true,
|
|
583
|
-
get: function () { return
|
|
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-
|
|
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-
|
|
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-
|
|
9
|
+
import '../../chunk-7KY4K4PH.js';
|
|
10
10
|
import '../../chunk-4RAAATVY.js';
|
|
11
|
-
import { getFheDisperseSingletonAddress } from '../../chunk-
|
|
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
|
|
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>;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { type UseMutationResult } from "@tanstack/react-query";
|
|
2
2
|
import type { Account, Address } from "viem";
|
|
3
|
-
import { type RegisterResult } from "../types.js";
|
|
3
|
+
import { type PendingRegisterResult, type RegisterResult } from "../types.js";
|
|
4
4
|
import { type DisperseHookOptions } from "./_shared.js";
|
|
5
5
|
export interface UseRegisterArgs {
|
|
6
6
|
/** ERC-7984 token to approve the new subwallets for. */
|
|
7
7
|
token: Address;
|
|
8
8
|
/** Override signer account. Falls back to `walletClient.account`. */
|
|
9
9
|
account?: Account | Address;
|
|
10
|
+
/**
|
|
11
|
+
* See `ReceiptMode`. With `false` the mutation resolves to a
|
|
12
|
+
* {@link PendingRegisterResult}; narrow with `if (data.pending)` before reading `wallets`.
|
|
13
|
+
*/
|
|
14
|
+
waitForReceipt?: boolean | undefined;
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
17
|
* Deploy the caller's dedicated wallet pair via `register(token)` and parse
|
|
@@ -35,6 +40,7 @@ export interface UseRegisterArgs {
|
|
|
35
40
|
* @example
|
|
36
41
|
* const register = useRegister();
|
|
37
42
|
* register.mutate({ token });
|
|
38
|
-
* // register.data → { hash, wallets: [wallet0, wallet1] }
|
|
43
|
+
* // register.data → { hash, wallets: [wallet0, wallet1] }; with waitForReceipt: false,
|
|
44
|
+
* // { hash, wallets: undefined, pending: true }
|
|
39
45
|
*/
|
|
40
|
-
export declare function useRegister(options?: DisperseHookOptions): UseMutationResult<RegisterResult, Error, UseRegisterArgs>;
|
|
46
|
+
export declare function useRegister(options?: DisperseHookOptions): UseMutationResult<RegisterResult | PendingRegisterResult, Error, UseRegisterArgs>;
|