@invisi-labs/sdk 1.1.4 → 1.1.6
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/dist/{operation-types-DIazgS2d.d.cts → NoteOutput-DRkVnwlx.d.cts} +140 -17
- package/dist/{operation-types-D7I405FX.d.ts → NoteOutput-DpDC6T2O.d.ts} +140 -17
- package/dist/broadcaster-preparation-QVL62KM6.js +128 -0
- package/dist/broadcaster-preparation-QVL62KM6.js.map +1 -0
- package/dist/{chunk-BE52B32Z.js → chunk-4SD3MW6N.js} +846 -1625
- package/dist/chunk-4SD3MW6N.js.map +1 -0
- package/dist/chunk-FL4TIGWW.js +1781 -0
- package/dist/chunk-FL4TIGWW.js.map +1 -0
- package/dist/{chunk-4HMM7ZKY.js → chunk-QC6TQR3R.js} +8 -8
- package/dist/chunk-QC6TQR3R.js.map +1 -0
- package/dist/ethers.cjs +7 -7
- package/dist/ethers.cjs.map +1 -1
- package/dist/ethers.d.cts +3 -3
- package/dist/ethers.d.ts +3 -3
- package/dist/ethers.js +1 -1
- package/dist/index.cjs +4520 -2902
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +273 -25
- package/dist/index.d.ts +273 -25
- package/dist/index.js +459 -52
- package/dist/index.js.map +1 -1
- package/dist/indexeddb.cjs +5812 -4570
- package/dist/indexeddb.cjs.map +1 -1
- package/dist/indexeddb.d.cts +2 -2
- package/dist/indexeddb.d.ts +2 -2
- package/dist/indexeddb.js +3 -2
- package/dist/indexeddb.js.map +1 -1
- package/dist/memory.cjs +5868 -4626
- package/dist/memory.cjs.map +1 -1
- package/dist/memory.d.cts +3 -3
- package/dist/memory.d.ts +3 -3
- package/dist/memory.js +3 -2
- package/dist/sqlite.cjs +5812 -4570
- package/dist/sqlite.cjs.map +1 -1
- package/dist/sqlite.d.cts +2 -2
- package/dist/sqlite.d.ts +2 -2
- package/dist/sqlite.js +3 -2
- package/dist/sqlite.js.map +1 -1
- package/dist/{state-AUnz7TG7.d.cts → state-C4HZFotm.d.cts} +1 -1
- package/dist/{state-AUnz7TG7.d.ts → state-C4HZFotm.d.ts} +1 -1
- package/dist/{store-BMN8kd0c.d.ts → store-8aBhnbGr.d.ts} +1 -1
- package/dist/{store-Cz75STRl.d.cts → store-YrbXb6CY.d.cts} +1 -1
- package/package.json +5 -5
- package/dist/chunk-4HMM7ZKY.js.map +0 -1
- package/dist/chunk-BE52B32Z.js.map +0 -1
|
@@ -1,10 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Hex, Note, CreditDeliveryState, ViewingCapability, Wallet, PublicWallet, WalletAuthorizationProvider } from '@invisi-labs/core';
|
|
2
|
+
import { Address, Hex as Hex$1, Delivery, ShieldParams, ShieldOutput, CreateCreditParams, CreditDrawParams, CancelCreditParams, TopUpCreditParams, TransactRequest } from '@invisi-labs/protocol/contracts';
|
|
3
|
+
import { c as StoredNote, W as WalletScope, b as WalletStore } from './state-C4HZFotm.cjs';
|
|
4
|
+
import { FundingInput, TransactionContext, CanonicalBlock, NoteMembership, TransactRequestParams, CreditMembership, Protocol, ChainReader, ProtocolDataProvider, TokenProtocol } from '@invisi-labs/protocol';
|
|
5
|
+
import { Signer, Provider } from 'ethers';
|
|
3
6
|
import * as _invisi_labs_prover from '@invisi-labs/prover';
|
|
4
7
|
import { Prover, ProverOptions, AggregateMember } from '@invisi-labs/prover';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
type PreparationIntent = {
|
|
10
|
+
kind: "transfer";
|
|
11
|
+
options: TransferPreparation;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "shield";
|
|
14
|
+
options: ShieldPreparation;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "create-credit";
|
|
17
|
+
options: CreateCreditPreparation;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "top-up-credit";
|
|
20
|
+
options: TopUpCreditPreparation;
|
|
21
|
+
} | {
|
|
22
|
+
kind: "cancel-credit";
|
|
23
|
+
options: CancelCreditPreparation;
|
|
24
|
+
};
|
|
25
|
+
type BroadcasterFeeSource = "public-funding" | "private-inputs" | "payout";
|
|
26
|
+
interface WithBroadcasterOptions {
|
|
27
|
+
maxFeeAmount: bigint;
|
|
28
|
+
feeSource?: BroadcasterFeeSource;
|
|
29
|
+
maxAttempts?: number;
|
|
30
|
+
/** Optional app-owned permit signing, requested once for the final gross funding amount. */
|
|
31
|
+
fundingPermit?: (request: {
|
|
32
|
+
payer: `0x${string}`;
|
|
33
|
+
amount: bigint;
|
|
34
|
+
tokenAddress: `0x${string}`;
|
|
35
|
+
protocolAddress: `0x${string}`;
|
|
36
|
+
}) => Promise<NonNullable<TransferPreparation["funding"]>["permit"]>;
|
|
37
|
+
}
|
|
8
38
|
|
|
9
39
|
interface GasBenchmarkShape {
|
|
10
40
|
kind: OperationPlan["kind"];
|
|
@@ -117,12 +147,6 @@ interface FundingSource {
|
|
|
117
147
|
deadline?: bigint;
|
|
118
148
|
permit?: NonNullable<FundingInput["permit"]>;
|
|
119
149
|
}
|
|
120
|
-
interface PaymentOutput {
|
|
121
|
-
/** Version-specific application data. Omission uses built-in v1 with no data. */
|
|
122
|
-
payload?: Uint8Array;
|
|
123
|
-
to: string;
|
|
124
|
-
amount: bigint;
|
|
125
|
-
}
|
|
126
150
|
/** Public submission mode; backend proof targets are selected internally. */
|
|
127
151
|
type TransactionExecution = "single" | "aggregate";
|
|
128
152
|
interface TransactionProveOptions extends ProverOptions {
|
|
@@ -138,25 +162,43 @@ interface TransferPreparation {
|
|
|
138
162
|
to: Address;
|
|
139
163
|
amount: bigint;
|
|
140
164
|
};
|
|
141
|
-
|
|
165
|
+
/** Immediate public fee paid from this operation's token. */
|
|
166
|
+
fee?: {
|
|
167
|
+
recipient: Address;
|
|
168
|
+
amount: bigint;
|
|
169
|
+
};
|
|
170
|
+
outputs: readonly NoteOutput[];
|
|
142
171
|
funding?: FundingSource;
|
|
143
172
|
deadline?: bigint;
|
|
144
173
|
}
|
|
145
174
|
interface ShieldPreparation {
|
|
175
|
+
fee?: {
|
|
176
|
+
recipient: Address;
|
|
177
|
+
amount: bigint;
|
|
178
|
+
};
|
|
146
179
|
tokenAddress: Address;
|
|
147
|
-
outputs: readonly
|
|
180
|
+
outputs: readonly NoteOutput[];
|
|
148
181
|
funding: FundingSource;
|
|
149
182
|
deadline?: bigint;
|
|
150
183
|
}
|
|
151
184
|
interface PreparedOutput {
|
|
152
|
-
|
|
185
|
+
context: NoteOutputContext;
|
|
186
|
+
recipient: NoteOutputRecipient;
|
|
187
|
+
amount: bigint;
|
|
188
|
+
note?: Note;
|
|
153
189
|
commitment: Hex$1;
|
|
154
190
|
identity: Hex$1;
|
|
155
191
|
delivery: Delivery;
|
|
192
|
+
/** Only offline encrypted EVM outputs may await registry-key resolution. */
|
|
193
|
+
deliveryPending?: true;
|
|
156
194
|
address: string;
|
|
157
195
|
change: boolean;
|
|
158
196
|
}
|
|
159
197
|
interface CreateCreditPreparation {
|
|
198
|
+
fee?: {
|
|
199
|
+
recipient: Address;
|
|
200
|
+
amount: bigint;
|
|
201
|
+
};
|
|
160
202
|
/** Version-specific application data. Omission uses built-in v1 with no data. */
|
|
161
203
|
payload?: Uint8Array;
|
|
162
204
|
singleLimit?: bigint;
|
|
@@ -179,6 +221,10 @@ interface DrawCreditPreparation {
|
|
|
179
221
|
deadline?: bigint;
|
|
180
222
|
}
|
|
181
223
|
interface TopUpCreditPreparation {
|
|
224
|
+
fee?: {
|
|
225
|
+
recipient: Address;
|
|
226
|
+
amount: bigint;
|
|
227
|
+
};
|
|
182
228
|
/** Version-specific application data. Omission uses built-in v1 with no data. */
|
|
183
229
|
payload?: Uint8Array;
|
|
184
230
|
/** Omission inherits the previous limit; zero disables it without clearing usage. */
|
|
@@ -193,6 +239,10 @@ interface TopUpCreditPreparation {
|
|
|
193
239
|
deadline?: bigint;
|
|
194
240
|
}
|
|
195
241
|
interface CancelCreditPreparation {
|
|
242
|
+
fee?: {
|
|
243
|
+
recipient: Address;
|
|
244
|
+
amount: bigint;
|
|
245
|
+
};
|
|
196
246
|
tokenAddress: Address;
|
|
197
247
|
credit: Hex$1;
|
|
198
248
|
deadline?: bigint;
|
|
@@ -217,6 +267,7 @@ interface CreditPlan {
|
|
|
217
267
|
amounts?: bigint[];
|
|
218
268
|
}
|
|
219
269
|
interface OperationPlan {
|
|
270
|
+
intent?: PreparationIntent;
|
|
220
271
|
version: 1;
|
|
221
272
|
id: string;
|
|
222
273
|
kind: "transfer" | "shield" | "create-credit" | "draw-credit" | "top-up-credit" | "cancel-credit";
|
|
@@ -243,7 +294,7 @@ interface WalletSessionInfrastructure {
|
|
|
243
294
|
gasBenchmarks?: readonly GasBenchmarkProfile[];
|
|
244
295
|
/** Optional ethers gas/funding signer; distinct from the Invisi wallet authority. */
|
|
245
296
|
signer?: Signer;
|
|
246
|
-
viewing?: Pick<ViewingCapability, "
|
|
297
|
+
viewing?: Pick<ViewingCapability, "ownerAddress" | "decryptNote" | "decryptCredit">;
|
|
247
298
|
wallet: Wallet | PublicWallet;
|
|
248
299
|
protocol: Protocol;
|
|
249
300
|
namespace?: string;
|
|
@@ -254,7 +305,8 @@ interface WalletSessionInfrastructure {
|
|
|
254
305
|
prover?: Prover;
|
|
255
306
|
fundingSigner?: FundingSigner;
|
|
256
307
|
fundingVerifier?: FundingAuthorizationVerifier;
|
|
257
|
-
|
|
308
|
+
/** Optional ethers provider used by per-output direct-chain receiving-key lookup. */
|
|
309
|
+
provider?: Provider;
|
|
258
310
|
coinSelector?: CoinSelector;
|
|
259
311
|
transactionTTL?: bigint;
|
|
260
312
|
}
|
|
@@ -272,4 +324,75 @@ interface OperationAggregateMember extends AggregateMember {
|
|
|
272
324
|
request: TransactRequest;
|
|
273
325
|
}
|
|
274
326
|
|
|
275
|
-
|
|
327
|
+
type AddressLookup = "chain" | "protocol-rpc";
|
|
328
|
+
|
|
329
|
+
interface NoteOutputContext {
|
|
330
|
+
chainId: bigint;
|
|
331
|
+
protocolAddress: Hex$1;
|
|
332
|
+
tokenAddress: Hex$1;
|
|
333
|
+
}
|
|
334
|
+
type NoteOutputRecipient = {
|
|
335
|
+
type: "evm";
|
|
336
|
+
address: string;
|
|
337
|
+
envelope?: boolean;
|
|
338
|
+
addressLookup?: AddressLookup;
|
|
339
|
+
nonce?: bigint | undefined;
|
|
340
|
+
} | {
|
|
341
|
+
type: "invisi";
|
|
342
|
+
address: string;
|
|
343
|
+
nonce?: bigint | undefined;
|
|
344
|
+
} | {
|
|
345
|
+
type: "identity";
|
|
346
|
+
identity: Hex$1;
|
|
347
|
+
};
|
|
348
|
+
type EncryptedRecipient = {
|
|
349
|
+
type: "evm";
|
|
350
|
+
address: string;
|
|
351
|
+
envelope?: true;
|
|
352
|
+
addressLookup?: AddressLookup;
|
|
353
|
+
nonce?: bigint | undefined;
|
|
354
|
+
} | {
|
|
355
|
+
type: "invisi";
|
|
356
|
+
address: string;
|
|
357
|
+
nonce?: bigint | undefined;
|
|
358
|
+
};
|
|
359
|
+
type NoteOutputOptions = NoteOutputContext & {
|
|
360
|
+
amount: bigint;
|
|
361
|
+
} & ({
|
|
362
|
+
recipient: EncryptedRecipient;
|
|
363
|
+
payload?: Uint8Array;
|
|
364
|
+
} | {
|
|
365
|
+
recipient: {
|
|
366
|
+
type: "evm";
|
|
367
|
+
address: string;
|
|
368
|
+
envelope: false;
|
|
369
|
+
addressLookup?: AddressLookup;
|
|
370
|
+
nonce?: bigint | undefined;
|
|
371
|
+
} | {
|
|
372
|
+
type: "identity";
|
|
373
|
+
identity: Hex$1;
|
|
374
|
+
};
|
|
375
|
+
payload?: never;
|
|
376
|
+
});
|
|
377
|
+
/** Immutable output statement and optional recoverable opening. */
|
|
378
|
+
declare class NoteOutput {
|
|
379
|
+
readonly to: string;
|
|
380
|
+
readonly amount: bigint;
|
|
381
|
+
readonly identity: Hex$1;
|
|
382
|
+
readonly commitment: Hex$1;
|
|
383
|
+
readonly deliveryFingerprint: Hex$1;
|
|
384
|
+
/** Encrypted EVM delivery is resolved by preparation; the original offline intent stays pending. */
|
|
385
|
+
readonly deliveryPending: boolean;
|
|
386
|
+
readonly context: NoteOutputContext;
|
|
387
|
+
readonly recipient: NoteOutputRecipient;
|
|
388
|
+
readonly nonce: bigint | undefined;
|
|
389
|
+
readonly payload: Uint8Array;
|
|
390
|
+
readonly preparedOutput: PreparedOutput;
|
|
391
|
+
private constructor();
|
|
392
|
+
static create(options: NoteOutputOptions): Promise<NoteOutput>;
|
|
393
|
+
assertCommitment(expectedHex: Hex$1): void;
|
|
394
|
+
get note(): Note | undefined;
|
|
395
|
+
get delivery(): Delivery;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export { type BroadcasterFeeSource as B, type CancelCreditPreparation as C, type DrawCreditPreparation as D, type FundingAuthorizationVerifier as F, type GasReference as G, NoteOutput as N, type OperationRuntime as O, type PreparationIntent as P, type ShieldPreparation as S, type TransactionProveOptions as T, type WithBroadcasterOptions as W, type OperationPlan as a, type OperationAggregateMember as b, type CreateCreditPreparation as c, type TopUpCreditPreparation as d, type TransferPreparation as e, type WalletSessionOptions as f, type WalletSessionInfrastructure as g, type CoinSelector as h, type FundingSigner as i, type FundingSource as j, type FundingTypedData as k, type GasBenchmarkCircuit as l, type GasBenchmarkDeployment as m, type GasBenchmarkProfile as n, type GasBenchmarkSample as o, type GasBenchmarkShape as p, type NoteOutputContext as q, type NoteOutputOptions as r, type NoteOutputRecipient as s, type TransactionExecution as t, defineGasBenchmarks as u };
|
|
@@ -1,10 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Hex, Note, CreditDeliveryState, ViewingCapability, Wallet, PublicWallet, WalletAuthorizationProvider } from '@invisi-labs/core';
|
|
2
|
+
import { Address, Hex as Hex$1, Delivery, ShieldParams, ShieldOutput, CreateCreditParams, CreditDrawParams, CancelCreditParams, TopUpCreditParams, TransactRequest } from '@invisi-labs/protocol/contracts';
|
|
3
|
+
import { c as StoredNote, W as WalletScope, b as WalletStore } from './state-C4HZFotm.js';
|
|
4
|
+
import { FundingInput, TransactionContext, CanonicalBlock, NoteMembership, TransactRequestParams, CreditMembership, Protocol, ChainReader, ProtocolDataProvider, TokenProtocol } from '@invisi-labs/protocol';
|
|
5
|
+
import { Signer, Provider } from 'ethers';
|
|
3
6
|
import * as _invisi_labs_prover from '@invisi-labs/prover';
|
|
4
7
|
import { Prover, ProverOptions, AggregateMember } from '@invisi-labs/prover';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
type PreparationIntent = {
|
|
10
|
+
kind: "transfer";
|
|
11
|
+
options: TransferPreparation;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "shield";
|
|
14
|
+
options: ShieldPreparation;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "create-credit";
|
|
17
|
+
options: CreateCreditPreparation;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "top-up-credit";
|
|
20
|
+
options: TopUpCreditPreparation;
|
|
21
|
+
} | {
|
|
22
|
+
kind: "cancel-credit";
|
|
23
|
+
options: CancelCreditPreparation;
|
|
24
|
+
};
|
|
25
|
+
type BroadcasterFeeSource = "public-funding" | "private-inputs" | "payout";
|
|
26
|
+
interface WithBroadcasterOptions {
|
|
27
|
+
maxFeeAmount: bigint;
|
|
28
|
+
feeSource?: BroadcasterFeeSource;
|
|
29
|
+
maxAttempts?: number;
|
|
30
|
+
/** Optional app-owned permit signing, requested once for the final gross funding amount. */
|
|
31
|
+
fundingPermit?: (request: {
|
|
32
|
+
payer: `0x${string}`;
|
|
33
|
+
amount: bigint;
|
|
34
|
+
tokenAddress: `0x${string}`;
|
|
35
|
+
protocolAddress: `0x${string}`;
|
|
36
|
+
}) => Promise<NonNullable<TransferPreparation["funding"]>["permit"]>;
|
|
37
|
+
}
|
|
8
38
|
|
|
9
39
|
interface GasBenchmarkShape {
|
|
10
40
|
kind: OperationPlan["kind"];
|
|
@@ -117,12 +147,6 @@ interface FundingSource {
|
|
|
117
147
|
deadline?: bigint;
|
|
118
148
|
permit?: NonNullable<FundingInput["permit"]>;
|
|
119
149
|
}
|
|
120
|
-
interface PaymentOutput {
|
|
121
|
-
/** Version-specific application data. Omission uses built-in v1 with no data. */
|
|
122
|
-
payload?: Uint8Array;
|
|
123
|
-
to: string;
|
|
124
|
-
amount: bigint;
|
|
125
|
-
}
|
|
126
150
|
/** Public submission mode; backend proof targets are selected internally. */
|
|
127
151
|
type TransactionExecution = "single" | "aggregate";
|
|
128
152
|
interface TransactionProveOptions extends ProverOptions {
|
|
@@ -138,25 +162,43 @@ interface TransferPreparation {
|
|
|
138
162
|
to: Address;
|
|
139
163
|
amount: bigint;
|
|
140
164
|
};
|
|
141
|
-
|
|
165
|
+
/** Immediate public fee paid from this operation's token. */
|
|
166
|
+
fee?: {
|
|
167
|
+
recipient: Address;
|
|
168
|
+
amount: bigint;
|
|
169
|
+
};
|
|
170
|
+
outputs: readonly NoteOutput[];
|
|
142
171
|
funding?: FundingSource;
|
|
143
172
|
deadline?: bigint;
|
|
144
173
|
}
|
|
145
174
|
interface ShieldPreparation {
|
|
175
|
+
fee?: {
|
|
176
|
+
recipient: Address;
|
|
177
|
+
amount: bigint;
|
|
178
|
+
};
|
|
146
179
|
tokenAddress: Address;
|
|
147
|
-
outputs: readonly
|
|
180
|
+
outputs: readonly NoteOutput[];
|
|
148
181
|
funding: FundingSource;
|
|
149
182
|
deadline?: bigint;
|
|
150
183
|
}
|
|
151
184
|
interface PreparedOutput {
|
|
152
|
-
|
|
185
|
+
context: NoteOutputContext;
|
|
186
|
+
recipient: NoteOutputRecipient;
|
|
187
|
+
amount: bigint;
|
|
188
|
+
note?: Note;
|
|
153
189
|
commitment: Hex$1;
|
|
154
190
|
identity: Hex$1;
|
|
155
191
|
delivery: Delivery;
|
|
192
|
+
/** Only offline encrypted EVM outputs may await registry-key resolution. */
|
|
193
|
+
deliveryPending?: true;
|
|
156
194
|
address: string;
|
|
157
195
|
change: boolean;
|
|
158
196
|
}
|
|
159
197
|
interface CreateCreditPreparation {
|
|
198
|
+
fee?: {
|
|
199
|
+
recipient: Address;
|
|
200
|
+
amount: bigint;
|
|
201
|
+
};
|
|
160
202
|
/** Version-specific application data. Omission uses built-in v1 with no data. */
|
|
161
203
|
payload?: Uint8Array;
|
|
162
204
|
singleLimit?: bigint;
|
|
@@ -179,6 +221,10 @@ interface DrawCreditPreparation {
|
|
|
179
221
|
deadline?: bigint;
|
|
180
222
|
}
|
|
181
223
|
interface TopUpCreditPreparation {
|
|
224
|
+
fee?: {
|
|
225
|
+
recipient: Address;
|
|
226
|
+
amount: bigint;
|
|
227
|
+
};
|
|
182
228
|
/** Version-specific application data. Omission uses built-in v1 with no data. */
|
|
183
229
|
payload?: Uint8Array;
|
|
184
230
|
/** Omission inherits the previous limit; zero disables it without clearing usage. */
|
|
@@ -193,6 +239,10 @@ interface TopUpCreditPreparation {
|
|
|
193
239
|
deadline?: bigint;
|
|
194
240
|
}
|
|
195
241
|
interface CancelCreditPreparation {
|
|
242
|
+
fee?: {
|
|
243
|
+
recipient: Address;
|
|
244
|
+
amount: bigint;
|
|
245
|
+
};
|
|
196
246
|
tokenAddress: Address;
|
|
197
247
|
credit: Hex$1;
|
|
198
248
|
deadline?: bigint;
|
|
@@ -217,6 +267,7 @@ interface CreditPlan {
|
|
|
217
267
|
amounts?: bigint[];
|
|
218
268
|
}
|
|
219
269
|
interface OperationPlan {
|
|
270
|
+
intent?: PreparationIntent;
|
|
220
271
|
version: 1;
|
|
221
272
|
id: string;
|
|
222
273
|
kind: "transfer" | "shield" | "create-credit" | "draw-credit" | "top-up-credit" | "cancel-credit";
|
|
@@ -243,7 +294,7 @@ interface WalletSessionInfrastructure {
|
|
|
243
294
|
gasBenchmarks?: readonly GasBenchmarkProfile[];
|
|
244
295
|
/** Optional ethers gas/funding signer; distinct from the Invisi wallet authority. */
|
|
245
296
|
signer?: Signer;
|
|
246
|
-
viewing?: Pick<ViewingCapability, "
|
|
297
|
+
viewing?: Pick<ViewingCapability, "ownerAddress" | "decryptNote" | "decryptCredit">;
|
|
247
298
|
wallet: Wallet | PublicWallet;
|
|
248
299
|
protocol: Protocol;
|
|
249
300
|
namespace?: string;
|
|
@@ -254,7 +305,8 @@ interface WalletSessionInfrastructure {
|
|
|
254
305
|
prover?: Prover;
|
|
255
306
|
fundingSigner?: FundingSigner;
|
|
256
307
|
fundingVerifier?: FundingAuthorizationVerifier;
|
|
257
|
-
|
|
308
|
+
/** Optional ethers provider used by per-output direct-chain receiving-key lookup. */
|
|
309
|
+
provider?: Provider;
|
|
258
310
|
coinSelector?: CoinSelector;
|
|
259
311
|
transactionTTL?: bigint;
|
|
260
312
|
}
|
|
@@ -272,4 +324,75 @@ interface OperationAggregateMember extends AggregateMember {
|
|
|
272
324
|
request: TransactRequest;
|
|
273
325
|
}
|
|
274
326
|
|
|
275
|
-
|
|
327
|
+
type AddressLookup = "chain" | "protocol-rpc";
|
|
328
|
+
|
|
329
|
+
interface NoteOutputContext {
|
|
330
|
+
chainId: bigint;
|
|
331
|
+
protocolAddress: Hex$1;
|
|
332
|
+
tokenAddress: Hex$1;
|
|
333
|
+
}
|
|
334
|
+
type NoteOutputRecipient = {
|
|
335
|
+
type: "evm";
|
|
336
|
+
address: string;
|
|
337
|
+
envelope?: boolean;
|
|
338
|
+
addressLookup?: AddressLookup;
|
|
339
|
+
nonce?: bigint | undefined;
|
|
340
|
+
} | {
|
|
341
|
+
type: "invisi";
|
|
342
|
+
address: string;
|
|
343
|
+
nonce?: bigint | undefined;
|
|
344
|
+
} | {
|
|
345
|
+
type: "identity";
|
|
346
|
+
identity: Hex$1;
|
|
347
|
+
};
|
|
348
|
+
type EncryptedRecipient = {
|
|
349
|
+
type: "evm";
|
|
350
|
+
address: string;
|
|
351
|
+
envelope?: true;
|
|
352
|
+
addressLookup?: AddressLookup;
|
|
353
|
+
nonce?: bigint | undefined;
|
|
354
|
+
} | {
|
|
355
|
+
type: "invisi";
|
|
356
|
+
address: string;
|
|
357
|
+
nonce?: bigint | undefined;
|
|
358
|
+
};
|
|
359
|
+
type NoteOutputOptions = NoteOutputContext & {
|
|
360
|
+
amount: bigint;
|
|
361
|
+
} & ({
|
|
362
|
+
recipient: EncryptedRecipient;
|
|
363
|
+
payload?: Uint8Array;
|
|
364
|
+
} | {
|
|
365
|
+
recipient: {
|
|
366
|
+
type: "evm";
|
|
367
|
+
address: string;
|
|
368
|
+
envelope: false;
|
|
369
|
+
addressLookup?: AddressLookup;
|
|
370
|
+
nonce?: bigint | undefined;
|
|
371
|
+
} | {
|
|
372
|
+
type: "identity";
|
|
373
|
+
identity: Hex$1;
|
|
374
|
+
};
|
|
375
|
+
payload?: never;
|
|
376
|
+
});
|
|
377
|
+
/** Immutable output statement and optional recoverable opening. */
|
|
378
|
+
declare class NoteOutput {
|
|
379
|
+
readonly to: string;
|
|
380
|
+
readonly amount: bigint;
|
|
381
|
+
readonly identity: Hex$1;
|
|
382
|
+
readonly commitment: Hex$1;
|
|
383
|
+
readonly deliveryFingerprint: Hex$1;
|
|
384
|
+
/** Encrypted EVM delivery is resolved by preparation; the original offline intent stays pending. */
|
|
385
|
+
readonly deliveryPending: boolean;
|
|
386
|
+
readonly context: NoteOutputContext;
|
|
387
|
+
readonly recipient: NoteOutputRecipient;
|
|
388
|
+
readonly nonce: bigint | undefined;
|
|
389
|
+
readonly payload: Uint8Array;
|
|
390
|
+
readonly preparedOutput: PreparedOutput;
|
|
391
|
+
private constructor();
|
|
392
|
+
static create(options: NoteOutputOptions): Promise<NoteOutput>;
|
|
393
|
+
assertCommitment(expectedHex: Hex$1): void;
|
|
394
|
+
get note(): Note | undefined;
|
|
395
|
+
get delivery(): Delivery;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export { type BroadcasterFeeSource as B, type CancelCreditPreparation as C, type DrawCreditPreparation as D, type FundingAuthorizationVerifier as F, type GasReference as G, NoteOutput as N, type OperationRuntime as O, type PreparationIntent as P, type ShieldPreparation as S, type TransactionProveOptions as T, type WithBroadcasterOptions as W, type OperationPlan as a, type OperationAggregateMember as b, type CreateCreditPreparation as c, type TopUpCreditPreparation as d, type TransferPreparation as e, type WalletSessionOptions as f, type WalletSessionInfrastructure as g, type CoinSelector as h, type FundingSigner as i, type FundingSource as j, type FundingTypedData as k, type GasBenchmarkCircuit as l, type GasBenchmarkDeployment as m, type GasBenchmarkProfile as n, type GasBenchmarkSample as o, type GasBenchmarkShape as p, type NoteOutputContext as q, type NoteOutputOptions as r, type NoteOutputRecipient as s, type TransactionExecution as t, defineGasBenchmarks as u };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TransactionPreparation,
|
|
3
|
+
exportBroadcasterIntent
|
|
4
|
+
} from "./chunk-FL4TIGWW.js";
|
|
5
|
+
import "./chunk-QC6TQR3R.js";
|
|
6
|
+
|
|
7
|
+
// src/broadcaster-preparation.ts
|
|
8
|
+
import { getAddress } from "ethers";
|
|
9
|
+
async function prepareIntent(runtime, intent) {
|
|
10
|
+
const preparation = new TransactionPreparation(runtime);
|
|
11
|
+
switch (intent.kind) {
|
|
12
|
+
case "transfer":
|
|
13
|
+
return preparation.prepareTransfer(intent.options);
|
|
14
|
+
case "shield":
|
|
15
|
+
return preparation.prepareShield(intent.options);
|
|
16
|
+
case "create-credit":
|
|
17
|
+
return preparation.prepareCreateCredit(intent.options);
|
|
18
|
+
case "top-up-credit":
|
|
19
|
+
return preparation.prepareTopUpCredit(intent.options);
|
|
20
|
+
case "cancel-credit":
|
|
21
|
+
return preparation.prepareCancelCredit(intent.options);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function prepareBroadcasterPlan(plan, reprepare, client, options) {
|
|
25
|
+
if (!plan.intent) throw new Error("operation has no supported preparation intent");
|
|
26
|
+
const intent = structuredClone(plan.intent);
|
|
27
|
+
intent.options.deadline = plan.deadline;
|
|
28
|
+
const maxFee = options.maxFeeAmount;
|
|
29
|
+
const attempts = options.maxAttempts ?? 4;
|
|
30
|
+
if (typeof maxFee !== "bigint" || maxFee <= 0n || maxFee >= 1n << 128n)
|
|
31
|
+
throw new Error("maxFeeAmount must be a positive uint128");
|
|
32
|
+
if (!Number.isInteger(attempts) || attempts < 1 || attempts > 16)
|
|
33
|
+
throw new Error("maxAttempts must be 1..16");
|
|
34
|
+
const funding = "funding" in intent.options ? intent.options.funding : void 0;
|
|
35
|
+
let source = options.feeSource ?? (intent.kind === "cancel-credit" ? "payout" : funding ? "public-funding" : "private-inputs");
|
|
36
|
+
if (!["public-funding", "private-inputs", "payout"].includes(source))
|
|
37
|
+
throw new Error("unsupported fee source");
|
|
38
|
+
if (intent.kind === "cancel-credit" ? source !== "payout" : source === "payout" || intent.kind === "shield" && source !== "public-funding")
|
|
39
|
+
throw new Error("fee source is unavailable for this operation");
|
|
40
|
+
if (source === "public-funding" && !funding)
|
|
41
|
+
throw new Error("public funding fee requires an explicit payer");
|
|
42
|
+
const permitCallback = options.fundingPermit;
|
|
43
|
+
let schedule = await client.fee(plan.context.tokenAddress, exportBroadcasterIntent(plan).data);
|
|
44
|
+
let previousAmount = 0n;
|
|
45
|
+
for (let i = 0; i < attempts; i++) {
|
|
46
|
+
const minimum = BigInt(schedule.feeAmount);
|
|
47
|
+
const amount = minimum > previousAmount ? minimum : previousAmount;
|
|
48
|
+
const recipient = getAddress(schedule.feeRecipient);
|
|
49
|
+
if (amount <= 0n || amount > maxFee || amount >= 1n << 128n || BigInt(recipient) === 0n)
|
|
50
|
+
throw new Error("broadcaster fee exceeds user limit or is invalid");
|
|
51
|
+
if (options.feeSource === void 0 && funding && plan.inputs.length > 0 && (intent.kind === "transfer" || intent.kind === "create-credit" || intent.kind === "top-up-credit")) {
|
|
52
|
+
const business = intent.kind === "transfer" ? intent.options.outputs.reduce(
|
|
53
|
+
(sum, output) => sum + output.amount,
|
|
54
|
+
intent.options.withdrawal?.amount ?? 0n
|
|
55
|
+
) : intent.kind === "create-credit" ? intent.options.amount : intent.options.additionalAmount;
|
|
56
|
+
const change = plan.inputs.reduce((sum, input) => sum + input.note.amount, funding.amount) - business;
|
|
57
|
+
source = change >= amount ? "private-inputs" : "public-funding";
|
|
58
|
+
}
|
|
59
|
+
if (source === "public-funding" && funding?.permit && funding.permit.deadline !== 0n && !permitCallback)
|
|
60
|
+
throw new Error(
|
|
61
|
+
"existing permit cannot fund an increased amount; provide fundingPermit for final gross funding or approve separately"
|
|
62
|
+
);
|
|
63
|
+
if (source === "payout" && amount >= plan.credit.cancel.amount)
|
|
64
|
+
throw new Error("fee must be less than the cancellation refund");
|
|
65
|
+
const request = structuredClone(intent);
|
|
66
|
+
request.options.fee = { recipient, amount };
|
|
67
|
+
if (funding && "funding" in request.options) {
|
|
68
|
+
const signedFunding = { ...funding };
|
|
69
|
+
if (funding.authorization === "caller") {
|
|
70
|
+
delete signedFunding.sigNonce;
|
|
71
|
+
delete signedFunding.deadline;
|
|
72
|
+
}
|
|
73
|
+
request.options.funding = {
|
|
74
|
+
...signedFunding,
|
|
75
|
+
amount: funding.amount + (source === "public-funding" ? amount : 0n),
|
|
76
|
+
authorization: "signature"
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const next = await reprepare(request);
|
|
80
|
+
if (source === "private-inputs" && next.inputs.length === 0)
|
|
81
|
+
throw new Error("private-inputs fee requires private funds");
|
|
82
|
+
const recalculated = await client.fee(
|
|
83
|
+
plan.context.tokenAddress,
|
|
84
|
+
exportBroadcasterIntent(next).data
|
|
85
|
+
);
|
|
86
|
+
const required = BigInt(recalculated.feeAmount);
|
|
87
|
+
if (getAddress(recalculated.feeRecipient) !== recipient || required <= 0n || required > maxFee)
|
|
88
|
+
throw new Error("broadcaster fee exceeds user limit or recipient changed");
|
|
89
|
+
if (amount >= required) {
|
|
90
|
+
let final = next;
|
|
91
|
+
if (permitCallback) {
|
|
92
|
+
if (!funding || !("funding" in request.options))
|
|
93
|
+
throw new Error("fundingPermit requires public funding");
|
|
94
|
+
const permit = await permitCallback({
|
|
95
|
+
payer: funding.payer,
|
|
96
|
+
amount: request.options.funding.amount,
|
|
97
|
+
tokenAddress: plan.context.tokenAddress,
|
|
98
|
+
protocolAddress: plan.context.protocolAddress
|
|
99
|
+
});
|
|
100
|
+
if (!permit) throw new Error("fundingPermit did not return a permit");
|
|
101
|
+
request.options.funding = { ...request.options.funding, permit };
|
|
102
|
+
final = await reprepare(request);
|
|
103
|
+
const permitted = await client.fee(
|
|
104
|
+
plan.context.tokenAddress,
|
|
105
|
+
exportBroadcasterIntent(final).data
|
|
106
|
+
);
|
|
107
|
+
if (getAddress(permitted.feeRecipient) !== recipient || BigInt(permitted.feeAmount) > amount)
|
|
108
|
+
throw new Error("permit changed the required fee; prepare again");
|
|
109
|
+
}
|
|
110
|
+
final.intent = structuredClone(intent);
|
|
111
|
+
return {
|
|
112
|
+
plan: final,
|
|
113
|
+
quote: await client.quote(exportBroadcasterIntent(final).data, {
|
|
114
|
+
chainId: final.context.chainId,
|
|
115
|
+
protocol: final.context.protocolAddress
|
|
116
|
+
})
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
previousAmount = amount;
|
|
120
|
+
schedule = recalculated;
|
|
121
|
+
}
|
|
122
|
+
throw new Error("broadcaster fee did not stabilize within the preparation limit");
|
|
123
|
+
}
|
|
124
|
+
export {
|
|
125
|
+
prepareBroadcasterPlan,
|
|
126
|
+
prepareIntent
|
|
127
|
+
};
|
|
128
|
+
//# sourceMappingURL=broadcaster-preparation-QVL62KM6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/broadcaster-preparation.ts"],"sourcesContent":["import { getAddress } from \"ethers\";\nimport type { BroadcasterClient, SignedBroadcasterQuote } from \"./broadcaster\";\nimport type {\n OperationPlan,\n PreparationRuntime,\n TransferPreparation,\n ShieldPreparation,\n CreateCreditPreparation,\n TopUpCreditPreparation,\n CancelCreditPreparation,\n} from \"./session/operation-types\";\nimport { TransactionPreparation } from \"./session/transaction-preparation\";\nimport { exportBroadcasterIntent } from \"./session/operation-protocol\";\nexport type PreparationIntent =\n | { kind: \"transfer\"; options: TransferPreparation }\n | { kind: \"shield\"; options: ShieldPreparation }\n | { kind: \"create-credit\"; options: CreateCreditPreparation }\n | { kind: \"top-up-credit\"; options: TopUpCreditPreparation }\n | { kind: \"cancel-credit\"; options: CancelCreditPreparation };\nexport type BroadcasterFeeSource = \"public-funding\" | \"private-inputs\" | \"payout\";\nexport interface WithBroadcasterOptions {\n maxFeeAmount: bigint;\n feeSource?: BroadcasterFeeSource;\n maxAttempts?: number;\n /** Optional app-owned permit signing, requested once for the final gross funding amount. */\n fundingPermit?: (request: {\n payer: `0x${string}`;\n amount: bigint;\n tokenAddress: `0x${string}`;\n protocolAddress: `0x${string}`;\n }) => Promise<NonNullable<TransferPreparation[\"funding\"]>[\"permit\"]>;\n}\nexport async function prepareIntent(\n runtime: PreparationRuntime<OperationPlan>,\n intent: PreparationIntent\n): Promise<OperationPlan> {\n const preparation = new TransactionPreparation(runtime);\n switch (intent.kind) {\n case \"transfer\":\n return preparation.prepareTransfer(intent.options);\n case \"shield\":\n return preparation.prepareShield(intent.options);\n case \"create-credit\":\n return preparation.prepareCreateCredit(intent.options);\n case \"top-up-credit\":\n return preparation.prepareTopUpCredit(intent.options);\n case \"cancel-credit\":\n return preparation.prepareCancelCredit(intent.options);\n }\n}\nexport async function prepareBroadcasterPlan(\n plan: OperationPlan,\n reprepare: (intent: PreparationIntent) => Promise<OperationPlan>,\n client: BroadcasterClient,\n options: WithBroadcasterOptions\n): Promise<{ plan: OperationPlan; quote: SignedBroadcasterQuote }> {\n if (!plan.intent) throw new Error(\"operation has no supported preparation intent\");\n const intent = structuredClone(plan.intent);\n intent.options.deadline = plan.deadline;\n const maxFee = options.maxFeeAmount;\n const attempts = options.maxAttempts ?? 4;\n if (typeof maxFee !== \"bigint\" || maxFee <= 0n || maxFee >= 1n << 128n)\n throw new Error(\"maxFeeAmount must be a positive uint128\");\n if (!Number.isInteger(attempts) || attempts < 1 || attempts > 16)\n throw new Error(\"maxAttempts must be 1..16\");\n const funding = \"funding\" in intent.options ? intent.options.funding : undefined;\n let source =\n options.feeSource ??\n (intent.kind === \"cancel-credit\"\n ? \"payout\"\n : funding\n ? \"public-funding\"\n : \"private-inputs\");\n if (![\"public-funding\", \"private-inputs\", \"payout\"].includes(source))\n throw new Error(\"unsupported fee source\");\n if (\n intent.kind === \"cancel-credit\"\n ? source !== \"payout\"\n : source === \"payout\" || (intent.kind === \"shield\" && source !== \"public-funding\")\n )\n throw new Error(\"fee source is unavailable for this operation\");\n if (source === \"public-funding\" && !funding)\n throw new Error(\"public funding fee requires an explicit payer\");\n const permitCallback = options.fundingPermit;\n let schedule = await client.fee(plan.context.tokenAddress, exportBroadcasterIntent(plan).data);\n let previousAmount = 0n;\n for (let i = 0; i < attempts; i++) {\n const minimum = BigInt(schedule.feeAmount);\n const amount = minimum > previousAmount ? minimum : previousAmount;\n const recipient = getAddress(schedule.feeRecipient) as `0x${string}`;\n if (amount <= 0n || amount > maxFee || amount >= 1n << 128n || BigInt(recipient) === 0n)\n throw new Error(\"broadcaster fee exceeds user limit or is invalid\");\n // Prefer already available private change; never add a payer implicitly.\n if (\n options.feeSource === undefined &&\n funding &&\n plan.inputs.length > 0 &&\n (intent.kind === \"transfer\" ||\n intent.kind === \"create-credit\" ||\n intent.kind === \"top-up-credit\")\n ) {\n const business =\n intent.kind === \"transfer\"\n ? intent.options.outputs.reduce(\n (sum, output) => sum + output.amount,\n intent.options.withdrawal?.amount ?? 0n\n )\n : intent.kind === \"create-credit\"\n ? intent.options.amount\n : intent.options.additionalAmount;\n const change =\n plan.inputs.reduce((sum, input) => sum + input.note.amount, funding.amount) -\n business;\n source = change >= amount ? \"private-inputs\" : \"public-funding\";\n }\n if (\n source === \"public-funding\" &&\n funding?.permit &&\n funding.permit.deadline !== 0n &&\n !permitCallback\n )\n throw new Error(\n \"existing permit cannot fund an increased amount; provide fundingPermit for final gross funding or approve separately\"\n );\n if (source === \"payout\" && amount >= plan.credit!.cancel!.amount)\n throw new Error(\"fee must be less than the cancellation refund\");\n const request = structuredClone(intent);\n request.options.fee = { recipient, amount };\n if (funding && \"funding\" in request.options) {\n const signedFunding = { ...funding };\n if (funding.authorization === \"caller\") {\n delete signedFunding.sigNonce;\n delete signedFunding.deadline;\n }\n request.options.funding = {\n ...signedFunding,\n amount: funding.amount + (source === \"public-funding\" ? amount : 0n),\n authorization: \"signature\",\n };\n }\n const next = await reprepare(request);\n if (source === \"private-inputs\" && next.inputs.length === 0)\n throw new Error(\"private-inputs fee requires private funds\");\n const recalculated = await client.fee(\n plan.context.tokenAddress,\n exportBroadcasterIntent(next).data\n );\n const required = BigInt(recalculated.feeAmount);\n if (\n getAddress(recalculated.feeRecipient) !== recipient ||\n required <= 0n ||\n required > maxFee\n )\n throw new Error(\"broadcaster fee exceeds user limit or recipient changed\");\n if (amount >= required) {\n let final = next;\n if (permitCallback) {\n if (!funding || !(\"funding\" in request.options))\n throw new Error(\"fundingPermit requires public funding\");\n const permit = await permitCallback({\n payer: funding.payer,\n amount: request.options.funding!.amount,\n tokenAddress: plan.context.tokenAddress,\n protocolAddress: plan.context.protocolAddress,\n });\n if (!permit) throw new Error(\"fundingPermit did not return a permit\");\n request.options.funding = { ...request.options.funding!, permit };\n final = await reprepare(request);\n const permitted = await client.fee(\n plan.context.tokenAddress,\n exportBroadcasterIntent(final).data\n );\n if (\n getAddress(permitted.feeRecipient) !== recipient ||\n BigInt(permitted.feeAmount) > amount\n )\n throw new Error(\"permit changed the required fee; prepare again\");\n }\n final.intent = structuredClone(intent);\n return {\n plan: final,\n quote: await client.quote(exportBroadcasterIntent(final).data, {\n chainId: final.context.chainId,\n protocol: final.context.protocolAddress,\n }),\n };\n }\n previousAmount = amount;\n schedule = recalculated;\n }\n throw new Error(\"broadcaster fee did not stabilize within the preparation limit\");\n}\n"],"mappings":";;;;;;;AAAA,SAAS,kBAAkB;AAgC3B,eAAsB,cAClB,SACA,QACsB;AACtB,QAAM,cAAc,IAAI,uBAAuB,OAAO;A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