@invisi-labs/sdk 1.1.5 → 1.1.7

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 (68) hide show
  1. package/dist/broadcaster-preparation-DMxxZ_1Q.d.cts +587 -0
  2. package/dist/broadcaster-preparation-DMxxZ_1Q.d.ts +587 -0
  3. package/dist/broadcaster-preparation-RMWQFYNL.js +11 -0
  4. package/dist/broadcaster-preparation-UGOTO4SX.cjs +11 -0
  5. package/dist/broadcaster-preparation-UGOTO4SX.cjs.map +1 -0
  6. package/dist/chunk-7F7ZZW3L.cjs +374 -0
  7. package/dist/chunk-7F7ZZW3L.cjs.map +1 -0
  8. package/dist/chunk-EHP5TBC6.js +3565 -0
  9. package/dist/chunk-EHP5TBC6.js.map +1 -0
  10. package/dist/chunk-GTPUYPQL.js +128 -0
  11. package/dist/chunk-GTPUYPQL.js.map +1 -0
  12. package/dist/chunk-ITTGBIG2.js +1877 -0
  13. package/dist/chunk-ITTGBIG2.js.map +1 -0
  14. package/dist/chunk-J2JH6HIG.cjs +1877 -0
  15. package/dist/chunk-J2JH6HIG.cjs.map +1 -0
  16. package/dist/chunk-LOU7AP2B.cjs +128 -0
  17. package/dist/chunk-LOU7AP2B.cjs.map +1 -0
  18. package/dist/chunk-RHNIHI4P.cjs +3565 -0
  19. package/dist/chunk-RHNIHI4P.cjs.map +1 -0
  20. package/dist/{chunk-4HMM7ZKY.js → chunk-XHKQ2BO2.js} +19 -19
  21. package/dist/chunk-XHKQ2BO2.js.map +1 -0
  22. package/dist/ethers.cjs +11 -385
  23. package/dist/ethers.cjs.map +1 -1
  24. package/dist/ethers.d.cts +4 -5
  25. package/dist/ethers.d.ts +4 -5
  26. package/dist/ethers.js +1 -1
  27. package/dist/index.cjs +441 -6217
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +109 -491
  30. package/dist/index.d.ts +109 -491
  31. package/dist/index.js +518 -599
  32. package/dist/index.js.map +1 -1
  33. package/dist/receipt-logs-CvC951p7.d.cts +318 -0
  34. package/dist/receipt-logs-m0-bhaxW.d.ts +318 -0
  35. package/dist/session-support.cjs +168 -0
  36. package/dist/session-support.cjs.map +1 -0
  37. package/dist/session-support.d.cts +252 -0
  38. package/dist/session-support.d.ts +252 -0
  39. package/dist/session-support.js +168 -0
  40. package/dist/session-support.js.map +1 -0
  41. package/package.json +10 -20
  42. package/dist/chunk-4HMM7ZKY.js.map +0 -1
  43. package/dist/chunk-BE52B32Z.js +0 -5490
  44. package/dist/chunk-BE52B32Z.js.map +0 -1
  45. package/dist/indexeddb.cjs +0 -5636
  46. package/dist/indexeddb.cjs.map +0 -1
  47. package/dist/indexeddb.d.cts +0 -20
  48. package/dist/indexeddb.d.ts +0 -20
  49. package/dist/indexeddb.js +0 -70
  50. package/dist/indexeddb.js.map +0 -1
  51. package/dist/memory.cjs +0 -5644
  52. package/dist/memory.cjs.map +0 -1
  53. package/dist/memory.d.cts +0 -12
  54. package/dist/memory.d.ts +0 -12
  55. package/dist/memory.js +0 -10
  56. package/dist/operation-types-D7I405FX.d.ts +0 -275
  57. package/dist/operation-types-DIazgS2d.d.cts +0 -275
  58. package/dist/sqlite.cjs +0 -5620
  59. package/dist/sqlite.cjs.map +0 -1
  60. package/dist/sqlite.d.cts +0 -28
  61. package/dist/sqlite.d.ts +0 -28
  62. package/dist/sqlite.js +0 -54
  63. package/dist/sqlite.js.map +0 -1
  64. package/dist/state-AUnz7TG7.d.cts +0 -78
  65. package/dist/state-AUnz7TG7.d.ts +0 -78
  66. package/dist/store-BMN8kd0c.d.ts +0 -42
  67. package/dist/store-Cz75STRl.d.cts +0 -42
  68. /package/dist/{memory.js.map → broadcaster-preparation-RMWQFYNL.js.map} +0 -0
@@ -0,0 +1,587 @@
1
+ import { Note, CreditDeliveryState, ReceivingKeyLookup, Hex as Hex$2, Wallet, PublicWallet, AuthorizedStatement } from '@invisi-labs/core';
2
+ import * as _invisi_labs_prover from '@invisi-labs/prover';
3
+ import { Hex, Prover, ProverOptions, AggregateMember, ProofBundle } from '@invisi-labs/prover';
4
+ import * as _invisi_labs_protocol from '@invisi-labs/protocol';
5
+ import { FundingInput, TransactionContext, CanonicalBlock, NoteMembership, TransactRequestParams, CreditMembership, Protocol, ChainReader, ProtocolDataProvider, TokenProtocol } from '@invisi-labs/protocol';
6
+ import * as ethers from 'ethers';
7
+ import { Interface, Provider } from 'ethers';
8
+ import { Hex as Hex$1, Delivery, Address, ShieldParams, ShieldOutput, CreateCreditParams, CreditDrawParams, CancelCreditParams, TopUpCreditParams, TransactRequest } from '@invisi-labs/protocol/contracts';
9
+
10
+ declare const broadcasterQuoteTypes: {
11
+ Quote: {
12
+ name: string;
13
+ type: string;
14
+ }[];
15
+ };
16
+ interface BroadcasterQuote {
17
+ token: string;
18
+ feeRecipient: string;
19
+ feeAmount: string;
20
+ deadline: string;
21
+ maxGas: string;
22
+ requestHash: string;
23
+ }
24
+ interface SignedBroadcasterQuote {
25
+ quote: BroadcasterQuote;
26
+ signature: string;
27
+ context?: {
28
+ chainId: bigint;
29
+ protocol: string;
30
+ };
31
+ }
32
+ interface BroadcasterTrust {
33
+ chainId: bigint;
34
+ protocol: string;
35
+ signer: string;
36
+ }
37
+ declare function broadcasterQuoteDomain(trust: BroadcasterTrust): {
38
+ name: string;
39
+ version: string;
40
+ chainId: bigint;
41
+ verifyingContract: string;
42
+ };
43
+ declare const broadcasterTransactInterface: Interface;
44
+ /** Decode a canonical supported direct public intent. Draw, registry and aggregates are excluded. */
45
+ declare function decodeBroadcasterIntent(data: string): {
46
+ fragment: ethers.FunctionFragment;
47
+ method: string;
48
+ args: ethers.Result;
49
+ proof: string;
50
+ request: {
51
+ params: any;
52
+ funding: any;
53
+ deliveries: any;
54
+ };
55
+ };
56
+ /** Domain-separated final public intent: omit only proof bytes and funding.signature. */
57
+ declare function broadcasterRequestHash(data: string): string;
58
+ declare function verifyBroadcasterQuote(signed: SignedBroadcasterQuote, trust: BroadcasterTrust, data: string, now?: bigint): BroadcasterQuote;
59
+ interface BroadcasterStatus {
60
+ id: string;
61
+ state: "pending" | "submitted" | "confirmed" | "reverted" | "uncertain";
62
+ transactionHash?: string;
63
+ }
64
+ type BroadcasterTransport = (request: {
65
+ jsonrpc: "2.0";
66
+ id: number;
67
+ method: string;
68
+ params: unknown;
69
+ }) => Promise<unknown>;
70
+ interface BroadcasterConfiguration {
71
+ endpoint: string;
72
+ quoteSigner: string;
73
+ feeRecipient: string;
74
+ }
75
+ declare class BroadcasterClient {
76
+ readonly configuration: Readonly<BroadcasterConfiguration>;
77
+ readonly url: string;
78
+ readonly transport: BroadcasterTransport;
79
+ private requestId;
80
+ constructor(configuration: BroadcasterConfiguration, transport?: BroadcasterTransport);
81
+ private call;
82
+ fee(token: string, data?: string): Promise<{
83
+ feeRecipient: string;
84
+ feeAmount: string;
85
+ maxGas: string;
86
+ }>;
87
+ quote(data: string, context: {
88
+ chainId: bigint;
89
+ protocol: string;
90
+ }): Promise<SignedBroadcasterQuote>;
91
+ submit(data: string, signed: SignedBroadcasterQuote, idempotencyKey: string): Promise<BroadcasterStatus>;
92
+ status(id: string): Promise<BroadcasterStatus>;
93
+ }
94
+ declare class BroadcasterRpcError extends Error {
95
+ readonly code: number;
96
+ constructor(code: number, message: string);
97
+ }
98
+
99
+ interface WalletScope {
100
+ namespace: string;
101
+ chainId: bigint;
102
+ protocolAddress: Hex;
103
+ ownerAddress: Hex;
104
+ }
105
+ declare function creditReservationKey(commitment: string): string;
106
+ interface Checkpoint {
107
+ number: bigint;
108
+ hash: Hex;
109
+ }
110
+ type SpentState = "unknown" | "unspent" | "spent";
111
+ interface ReceiptPosition {
112
+ commitment: Hex;
113
+ treeId: bigint;
114
+ leafIndex: number;
115
+ blockNumber: bigint;
116
+ blockHash: Hex;
117
+ transactionHash?: Hex;
118
+ }
119
+ interface NoteRecord extends ReceiptPosition {
120
+ note: Note;
121
+ spent: SpentState;
122
+ checkedThrough?: Checkpoint;
123
+ }
124
+ interface CreditRecord extends ReceiptPosition {
125
+ receivingKeySource?: {
126
+ kind: "draw" | "top-up";
127
+ commitment: Hex;
128
+ };
129
+ state: CreditDeliveryState;
130
+ role: "owner" | "spender";
131
+ spent: SpentState;
132
+ checkedThrough?: Checkpoint;
133
+ }
134
+ type OperationStatus = "prepared" | "authorized" | "proved" | "ready" | "submitted" | "confirmed" | "failed" | "expired" | "uncertain" | "reorged";
135
+
136
+ /** Minimal input count by descending amount, with deterministic tree/position/commitment ties. */
137
+ type SelectableNote = Pick<NoteRecord, "note" | "commitment" | "treeId" | "leafIndex" | "spent">;
138
+
139
+ type AddressLookup = "chain" | "protocol-rpc";
140
+ /** Capture deployment pins before a Protocol is bound to an operation's token. */
141
+ declare function configureRecipientInfrastructure<T extends TransactionInfrastructure>(options: T): T;
142
+ /** Internal lookup plumbing; public APIs never accept resolver functions. */
143
+ declare function recipientLookup(options: object, source?: AddressLookup): ReceivingKeyLookup;
144
+
145
+ interface NoteOutputContext {
146
+ chainId: bigint;
147
+ protocolAddress: Hex$1;
148
+ tokenAddress: Hex$1;
149
+ }
150
+ type NoteOutputRecipient = {
151
+ type: "evm";
152
+ address: string;
153
+ envelope?: boolean;
154
+ addressLookup?: AddressLookup;
155
+ nonce?: bigint | undefined;
156
+ } | {
157
+ type: "invisi";
158
+ address: string;
159
+ nonce?: bigint | undefined;
160
+ } | {
161
+ type: "identity";
162
+ identity: Hex$1;
163
+ };
164
+ type EncryptedRecipient = {
165
+ type: "evm";
166
+ address: string;
167
+ envelope?: true;
168
+ addressLookup?: AddressLookup;
169
+ nonce?: bigint | undefined;
170
+ } | {
171
+ type: "invisi";
172
+ address: string;
173
+ nonce?: bigint | undefined;
174
+ };
175
+ type PaymentRequest = NoteOutputContext & {
176
+ amount: bigint;
177
+ } & ({
178
+ recipient: EncryptedRecipient;
179
+ payload?: Uint8Array;
180
+ } | {
181
+ recipient: {
182
+ type: "evm";
183
+ address: string;
184
+ envelope: false;
185
+ addressLookup?: AddressLookup;
186
+ nonce?: bigint | undefined;
187
+ } | {
188
+ type: "identity";
189
+ identity: Hex$1;
190
+ };
191
+ payload?: never;
192
+ });
193
+ /** Local payment choices; these never rewrite the encoded request. */
194
+ interface NoteOutputExecutionOptions {
195
+ nonce?: bigint;
196
+ addressLookup?: AddressLookup;
197
+ }
198
+
199
+ /** Immutable output statement and optional recoverable opening. */
200
+ declare class NoteOutput {
201
+ readonly to: string;
202
+ readonly ipp: string;
203
+ readonly amount: bigint;
204
+ readonly identity: Hex$1;
205
+ readonly commitment: Hex$1;
206
+ readonly deliveryFingerprint: Hex$1;
207
+ /** Encrypted EVM delivery is resolved by preparation; the original offline intent stays pending. */
208
+ readonly deliveryPending: boolean;
209
+ readonly context: NoteOutputContext;
210
+ readonly recipient: NoteOutputRecipient;
211
+ readonly nonce: bigint | undefined;
212
+ readonly payload: Uint8Array;
213
+ readonly preparedOutput: PreparedOutput;
214
+ private constructor();
215
+ /** Private offline delivery data; does not assert that the output has been mined. */
216
+ exportPaymentNote(): string;
217
+ static create(input: PaymentRequest | string, execution?: NoteOutputExecutionOptions): Promise<NoteOutput>;
218
+ assertCommitment(expectedHex: Hex$1): void;
219
+ get note(): Note | undefined;
220
+ get delivery(): Delivery;
221
+ }
222
+
223
+ interface GasBenchmarkShape {
224
+ kind: OperationPlan["kind"];
225
+ target: string;
226
+ capacity: number;
227
+ noteInputs: number;
228
+ noteOutputs: number;
229
+ sourceTrees: number;
230
+ creditInputs: number;
231
+ creditOutputs: number;
232
+ creditRemainders: number;
233
+ funding: "none" | "caller" | "signature";
234
+ permit: boolean;
235
+ deliveryBytes: number;
236
+ }
237
+ interface GasBenchmarkDeployment {
238
+ chainId: string;
239
+ protocolAddress: Hex$2;
240
+ runtimeCodeHash: Hex$2 | null;
241
+ tokenAddress: Hex$2;
242
+ }
243
+ interface GasBenchmarkCircuit {
244
+ circuitName: string;
245
+ target: string;
246
+ artifactSha256: string;
247
+ vkSha256: string;
248
+ }
249
+ interface GasBenchmarkSample {
250
+ gasUsed: string;
251
+ transactionHash: Hex$2;
252
+ blockNumber: string;
253
+ blockHash: Hex$2;
254
+ calldataBytes: number;
255
+ }
256
+ interface GasBenchmarkProfile {
257
+ formatVersion: 1;
258
+ id: string;
259
+ deployment: GasBenchmarkDeployment;
260
+ source: {
261
+ protocolCommit: string;
262
+ fingerprints?: {
263
+ protocolSourceSha256: string;
264
+ dirtyDiffSha256: string;
265
+ compiledArtifactsSha256: string;
266
+ creditManifestSha256: string;
267
+ userManifestSha256: string;
268
+ sdkSourceSha256: string;
269
+ };
270
+ toolchain?: {
271
+ solidity: string;
272
+ barretenberg: string;
273
+ noir: string;
274
+ evmVersion: string;
275
+ optimizerRuns: number;
276
+ anvil: string;
277
+ };
278
+ blockGasLimit?: string;
279
+ runtimeContracts?: Record<string, {
280
+ address: Hex$2;
281
+ runtimeCodeHash: Hex$2;
282
+ }>;
283
+ measuredAt: string;
284
+ chain: string;
285
+ hardfork: string;
286
+ token: string;
287
+ verifier: "real";
288
+ assumptions: string[];
289
+ };
290
+ measurements: Array<{
291
+ id: string;
292
+ shape: GasBenchmarkShape;
293
+ circuit: GasBenchmarkCircuit | null;
294
+ samples: GasBenchmarkSample[];
295
+ }>;
296
+ }
297
+ interface GasEstimateRequest {
298
+ deployment: GasBenchmarkDeployment;
299
+ shape: GasBenchmarkShape;
300
+ circuit: GasBenchmarkCircuit | null;
301
+ }
302
+ type BenchmarkGasEstimate = {
303
+ source: "benchmark";
304
+ request: GasEstimateRequest;
305
+ } & ({
306
+ available: false;
307
+ reason: "deployment-not-covered" | "shape-not-covered" | "recursive-member-only";
308
+ } | {
309
+ available: true;
310
+ gasUnits: bigint;
311
+ range: {
312
+ min: bigint;
313
+ max: bigint;
314
+ kind: "observed";
315
+ };
316
+ samples: number;
317
+ profileId: string;
318
+ measurementId: string;
319
+ evidence: GasBenchmarkProfile["source"];
320
+ });
321
+ /** Pre-proof reference only; ethers must estimate the final transaction independently. */
322
+ interface GasReference {
323
+ gasUnits: bigint;
324
+ }
325
+
326
+ interface CoinSelector {
327
+ select(candidates: readonly NoteRecord[], requiredAmount: bigint): readonly Hex$1[] | Promise<readonly Hex$1[]>;
328
+ }
329
+ interface FundingTypedData {
330
+ domain: Record<string, unknown>;
331
+ primaryType: string;
332
+ types: Record<string, readonly {
333
+ name: string;
334
+ type: string;
335
+ }[]>;
336
+ message: Record<string, unknown>;
337
+ }
338
+ interface FundingSigner {
339
+ readonly address: Address;
340
+ signTypedData(data: FundingTypedData): Promise<Hex$1>;
341
+ }
342
+ interface FundingAuthorizationVerifier {
343
+ verifyTypedData(data: FundingTypedData & {
344
+ address: Address;
345
+ signature: Hex$1;
346
+ }): Promise<boolean>;
347
+ }
348
+ interface FundingSource {
349
+ payer: Address;
350
+ amount: bigint;
351
+ authorization?: "signature" | "caller";
352
+ sigNonce?: bigint;
353
+ deadline?: bigint;
354
+ permit?: NonNullable<FundingInput["permit"]>;
355
+ }
356
+ /** Public submission mode; backend proof targets are selected internally. */
357
+ type TransactionExecution = "single" | "aggregate";
358
+ interface TransactionProveOptions extends ProverOptions {
359
+ /** Defaults to single. Aggregate produces a member for a separate aggregate submission. */
360
+ execution?: TransactionExecution;
361
+ }
362
+ interface TransferPreparation {
363
+ tokenAddress: Address;
364
+ /** Explicit subset for managed inventory; detached calls already supply inputs. */
365
+ commitments?: readonly Hex$1[];
366
+ /** Public ERC20 payout. Empty private outputs are allowed when a payout is present. */
367
+ withdrawal?: {
368
+ to: Address;
369
+ amount: bigint;
370
+ };
371
+ /** Immediate public fee paid from this operation's token. */
372
+ fee?: {
373
+ recipient: Address;
374
+ amount: bigint;
375
+ };
376
+ outputs: readonly NoteOutput[];
377
+ funding?: FundingSource;
378
+ deadline?: bigint;
379
+ }
380
+ interface ShieldPreparation {
381
+ fee?: {
382
+ recipient: Address;
383
+ amount: bigint;
384
+ };
385
+ tokenAddress: Address;
386
+ outputs: readonly NoteOutput[];
387
+ funding: FundingSource;
388
+ deadline?: bigint;
389
+ }
390
+ interface PreparedOutput {
391
+ context: NoteOutputContext;
392
+ recipient: NoteOutputRecipient;
393
+ amount: bigint;
394
+ note?: Note;
395
+ commitment: Hex$1;
396
+ identity: Hex$1;
397
+ delivery: Delivery;
398
+ /** Only offline encrypted EVM outputs may await registry-key resolution. */
399
+ deliveryPending?: true;
400
+ address: string;
401
+ change: boolean;
402
+ }
403
+ interface CreateCreditPreparation {
404
+ fee?: {
405
+ recipient: Address;
406
+ amount: bigint;
407
+ };
408
+ /** Version-specific application data. Omission uses built-in v1 with no data. */
409
+ payload?: Uint8Array;
410
+ singleLimit?: bigint;
411
+ dailyLimit?: bigint;
412
+ monthlyLimit?: bigint;
413
+ tokenAddress: Address;
414
+ spender: string;
415
+ amount: bigint;
416
+ expiry: bigint;
417
+ funding?: FundingSource;
418
+ deadline?: bigint;
419
+ }
420
+ interface DrawCreditPreparation {
421
+ tokenAddress: Address;
422
+ credits: readonly {
423
+ credit: Hex$1;
424
+ amount: bigint;
425
+ payload?: Uint8Array;
426
+ }[];
427
+ deadline?: bigint;
428
+ }
429
+ interface TopUpCreditPreparation {
430
+ fee?: {
431
+ recipient: Address;
432
+ amount: bigint;
433
+ };
434
+ /** Version-specific application data. Omission uses built-in v1 with no data. */
435
+ payload?: Uint8Array;
436
+ /** Omission inherits the previous limit; zero disables it without clearing usage. */
437
+ singleLimit?: bigint;
438
+ dailyLimit?: bigint;
439
+ monthlyLimit?: bigint;
440
+ tokenAddress: Address;
441
+ credit: Hex$1;
442
+ additionalAmount: bigint;
443
+ expiry?: bigint;
444
+ funding?: FundingSource;
445
+ deadline?: bigint;
446
+ }
447
+ interface CancelCreditPreparation {
448
+ fee?: {
449
+ recipient: Address;
450
+ amount: bigint;
451
+ };
452
+ tokenAddress: Address;
453
+ credit: Hex$1;
454
+ deadline?: bigint;
455
+ }
456
+ interface PreparedCreditOutput {
457
+ state: CreditDeliveryState;
458
+ commitment: Hex$1;
459
+ deliveries: [Delivery, Delivery];
460
+ }
461
+ interface PreparedCreditInput extends CreditMembership {
462
+ commitment: Hex$1;
463
+ role: "owner" | "spender";
464
+ }
465
+ interface CreditPlan {
466
+ inputs: PreparedCreditInput[];
467
+ outputs: PreparedCreditOutput[];
468
+ deliveries: Delivery[];
469
+ creation?: CreateCreditParams;
470
+ draw?: CreditDrawParams;
471
+ cancel?: CancelCreditParams;
472
+ topUp?: TopUpCreditParams;
473
+ amounts?: bigint[];
474
+ }
475
+ interface OperationPlan {
476
+ intent?: PreparationIntent;
477
+ version: 1;
478
+ id: string;
479
+ kind: "transfer" | "shield" | "create-credit" | "draw-credit" | "top-up-credit" | "cancel-credit";
480
+ context: TransactionContext;
481
+ scope: WalletScope;
482
+ preparedAt: CanonicalBlock;
483
+ deadline: bigint;
484
+ outputs: PreparedOutput[];
485
+ inputs: Array<NoteMembership & {
486
+ commitment: Hex$1;
487
+ }>;
488
+ funding: FundingInput;
489
+ fundingMode: "none" | "signature" | "caller";
490
+ params?: TransactRequestParams;
491
+ shieldParams?: ShieldParams;
492
+ shieldOutputs?: ShieldOutput[];
493
+ capacity?: number;
494
+ credit?: CreditPlan;
495
+ statement?: _invisi_labs_prover.ProofStatement;
496
+ }
497
+ interface SavedOperation {
498
+ plan: OperationPlan;
499
+ broadcasterQuote?: SignedBroadcasterQuote;
500
+ proof?: ProofBundle;
501
+ call?: _invisi_labs_protocol.TransactionCall;
502
+ externalized?: boolean;
503
+ generation: number;
504
+ claim?: {
505
+ stage: string;
506
+ token: string;
507
+ };
508
+ }
509
+ interface TransactionInfrastructure {
510
+ gasBenchmarks?: readonly GasBenchmarkProfile[];
511
+ wallet: Wallet | PublicWallet;
512
+ protocol: Protocol;
513
+ chainReader?: ChainReader;
514
+ protocolRpc?: ProtocolDataProvider;
515
+ prover?: Prover;
516
+ fundingVerifier?: FundingAuthorizationVerifier;
517
+ /** Optional ethers provider used by per-output direct-chain receiving-key lookup. */
518
+ provider?: Provider;
519
+ coinSelector?: CoinSelector;
520
+ transactionTTL?: bigint;
521
+ }
522
+ interface TransactionRuntime {
523
+ options: Omit<TransactionInfrastructure, "protocol"> & {
524
+ protocol: TokenProtocol;
525
+ };
526
+ scope: WalletScope;
527
+ reader: ChainReader;
528
+ }
529
+ interface LocalOperationSecrets {
530
+ authorization?: AuthorizedStatement;
531
+ }
532
+ interface OperationAggregateMember extends AggregateMember {
533
+ context: TransactionContext;
534
+ request: TransactRequest;
535
+ }
536
+ /** Data required while preparing an operation; it does not own persistence or reservations. */
537
+ interface PreparationRuntime<Result> extends TransactionRuntime {
538
+ readInventory(): Promise<PreparationInventory>;
539
+ complete(plan: OperationPlan): Promise<Result>;
540
+ explicitInputs?: boolean;
541
+ inputSelection?: readonly Hex$1[];
542
+ changeAddress?: string;
543
+ }
544
+ interface PreparationInventory {
545
+ reservations: Record<string, string>;
546
+ invalidated?: string;
547
+ observedThrough?: Checkpoint;
548
+ notes: Record<string, SelectableNote>;
549
+ credits: Record<string, Pick<CreditRecord, "state" | "commitment" | "treeId" | "leafIndex" | "role" | "spent">>;
550
+ }
551
+
552
+ type PreparationIntent = {
553
+ kind: "transfer";
554
+ options: TransferPreparation;
555
+ } | {
556
+ kind: "shield";
557
+ options: ShieldPreparation;
558
+ } | {
559
+ kind: "create-credit";
560
+ options: CreateCreditPreparation;
561
+ } | {
562
+ kind: "top-up-credit";
563
+ options: TopUpCreditPreparation;
564
+ } | {
565
+ kind: "cancel-credit";
566
+ options: CancelCreditPreparation;
567
+ };
568
+ type BroadcasterFeeSource = "public-funding" | "private-inputs" | "payout";
569
+ interface WithBroadcasterOptions {
570
+ maxFeeAmount: bigint;
571
+ feeSource?: BroadcasterFeeSource;
572
+ maxAttempts?: number;
573
+ /** Optional app-owned permit signing, requested once for the final gross funding amount. */
574
+ fundingPermit?: (request: {
575
+ payer: `0x${string}`;
576
+ amount: bigint;
577
+ tokenAddress: `0x${string}`;
578
+ protocolAddress: `0x${string}`;
579
+ }) => Promise<NonNullable<TransferPreparation["funding"]>["permit"]>;
580
+ }
581
+ declare function prepareIntent(runtime: PreparationRuntime<OperationPlan>, intent: PreparationIntent): Promise<OperationPlan>;
582
+ declare function prepareBroadcasterPlan(plan: OperationPlan, reprepare: (intent: PreparationIntent) => Promise<OperationPlan>, client: BroadcasterClient, options: WithBroadcasterOptions): Promise<{
583
+ plan: OperationPlan;
584
+ quote: SignedBroadcasterQuote;
585
+ }>;
586
+
587
+ export { type LocalOperationSecrets as $, broadcasterTransactInterface as A, BroadcasterClient as B, type CancelCreditPreparation as C, type DrawCreditPreparation as D, decodeBroadcasterIntent as E, type FundingAuthorizationVerifier as F, type GasBenchmarkCircuit as G, verifyBroadcasterQuote as H, type GasEstimateRequest as I, type OperationPlan as J, type BenchmarkGasEstimate as K, type SavedOperation as L, type TransactionRuntime as M, NoteOutput as N, type OperationAggregateMember as O, type PaymentRequest as P, type OperationStatus as Q, type PreparationRuntime as R, type ShieldPreparation as S, type TopUpCreditPreparation as T, type TransactionInfrastructure as U, type AddressLookup as V, type WithBroadcasterOptions as W, type Checkpoint as X, type CoinSelector as Y, type CreditPlan as Z, type CreditRecord as _, type BroadcasterConfiguration as a, type NoteRecord as a0, type PreparationIntent as a1, type PreparationInventory as a2, type PreparedCreditInput as a3, type PreparedCreditOutput as a4, type PreparedOutput as a5, type ReceiptPosition as a6, type SpentState as a7, type WalletScope as a8, configureRecipientInfrastructure as a9, creditReservationKey as aa, prepareBroadcasterPlan as ab, prepareIntent as ac, recipientLookup as ad, type BroadcasterFeeSource as b, type BroadcasterQuote as c, BroadcasterRpcError as d, type BroadcasterStatus as e, type BroadcasterTransport as f, type BroadcasterTrust as g, type CreateCreditPreparation as h, type FundingSigner as i, type FundingSource as j, type FundingTypedData as k, type GasBenchmarkDeployment as l, type GasBenchmarkProfile as m, type GasBenchmarkSample as n, type GasBenchmarkShape as o, type GasReference as p, type NoteOutputContext as q, type NoteOutputExecutionOptions as r, type NoteOutputRecipient as s, type SignedBroadcasterQuote as t, type TransactionExecution as u, type TransactionProveOptions as v, type TransferPreparation as w, broadcasterQuoteDomain as x, broadcasterQuoteTypes as y, broadcasterRequestHash as z };
@@ -0,0 +1,11 @@
1
+ import {
2
+ prepareBroadcasterPlan,
3
+ prepareIntent
4
+ } from "./chunk-GTPUYPQL.js";
5
+ import "./chunk-ITTGBIG2.js";
6
+ import "./chunk-XHKQ2BO2.js";
7
+ export {
8
+ prepareBroadcasterPlan,
9
+ prepareIntent
10
+ };
11
+ //# sourceMappingURL=broadcaster-preparation-RMWQFYNL.js.map
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkLOU7AP2Bcjs = require('./chunk-LOU7AP2B.cjs');
5
+ require('./chunk-J2JH6HIG.cjs');
6
+ require('./chunk-7F7ZZW3L.cjs');
7
+
8
+
9
+
10
+ exports.prepareBroadcasterPlan = _chunkLOU7AP2Bcjs.prepareBroadcasterPlan; exports.prepareIntent = _chunkLOU7AP2Bcjs.prepareIntent;
11
+ //# sourceMappingURL=broadcaster-preparation-UGOTO4SX.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/invisi-sdk-ts/invisi-sdk-ts/packages/sdk/dist/broadcaster-preparation-UGOTO4SX.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACF,mIAAC","file":"/home/runner/work/invisi-sdk-ts/invisi-sdk-ts/packages/sdk/dist/broadcaster-preparation-UGOTO4SX.cjs"}