@invisi-labs/sdk 1.1.6 → 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.
- package/dist/{NoteOutput-DRkVnwlx.d.cts → broadcaster-preparation-DMxxZ_1Q.d.cts} +309 -120
- package/dist/{NoteOutput-DpDC6T2O.d.ts → broadcaster-preparation-DMxxZ_1Q.d.ts} +309 -120
- package/dist/broadcaster-preparation-RMWQFYNL.js +11 -0
- package/dist/broadcaster-preparation-UGOTO4SX.cjs +11 -0
- package/dist/broadcaster-preparation-UGOTO4SX.cjs.map +1 -0
- package/dist/chunk-7F7ZZW3L.cjs +374 -0
- package/dist/chunk-7F7ZZW3L.cjs.map +1 -0
- package/dist/{chunk-4SD3MW6N.js → chunk-EHP5TBC6.js} +1347 -2493
- package/dist/chunk-EHP5TBC6.js.map +1 -0
- package/dist/{broadcaster-preparation-QVL62KM6.js → chunk-GTPUYPQL.js} +6 -6
- package/dist/chunk-GTPUYPQL.js.map +1 -0
- package/dist/{chunk-FL4TIGWW.js → chunk-ITTGBIG2.js} +617 -521
- package/dist/chunk-ITTGBIG2.js.map +1 -0
- package/dist/chunk-J2JH6HIG.cjs +1877 -0
- package/dist/chunk-J2JH6HIG.cjs.map +1 -0
- package/dist/chunk-LOU7AP2B.cjs +128 -0
- package/dist/chunk-LOU7AP2B.cjs.map +1 -0
- package/dist/chunk-RHNIHI4P.cjs +3565 -0
- package/dist/chunk-RHNIHI4P.cjs.map +1 -0
- package/dist/{chunk-QC6TQR3R.js → chunk-XHKQ2BO2.js} +12 -12
- package/dist/chunk-XHKQ2BO2.js.map +1 -0
- package/dist/ethers.cjs +11 -385
- package/dist/ethers.cjs.map +1 -1
- package/dist/ethers.d.cts +3 -4
- package/dist/ethers.d.ts +3 -4
- package/dist/ethers.js +1 -1
- package/dist/index.cjs +451 -7845
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -702
- package/dist/index.d.ts +72 -702
- package/dist/index.js +374 -862
- package/dist/index.js.map +1 -1
- package/dist/receipt-logs-CvC951p7.d.cts +318 -0
- package/dist/receipt-logs-m0-bhaxW.d.ts +318 -0
- package/dist/session-support.cjs +168 -0
- package/dist/session-support.cjs.map +1 -0
- package/dist/session-support.d.cts +252 -0
- package/dist/session-support.d.ts +252 -0
- package/dist/session-support.js +168 -0
- package/dist/session-support.js.map +1 -0
- package/package.json +10 -20
- package/dist/broadcaster-preparation-QVL62KM6.js.map +0 -1
- package/dist/chunk-4SD3MW6N.js.map +0 -1
- package/dist/chunk-FL4TIGWW.js.map +0 -1
- package/dist/chunk-QC6TQR3R.js.map +0 -1
- package/dist/indexeddb.cjs +0 -6878
- package/dist/indexeddb.cjs.map +0 -1
- package/dist/indexeddb.d.cts +0 -20
- package/dist/indexeddb.d.ts +0 -20
- package/dist/indexeddb.js +0 -71
- package/dist/indexeddb.js.map +0 -1
- package/dist/memory.cjs +0 -6886
- package/dist/memory.cjs.map +0 -1
- package/dist/memory.d.cts +0 -12
- package/dist/memory.d.ts +0 -12
- package/dist/memory.js +0 -11
- package/dist/sqlite.cjs +0 -6862
- package/dist/sqlite.cjs.map +0 -1
- package/dist/sqlite.d.cts +0 -28
- package/dist/sqlite.d.ts +0 -28
- package/dist/sqlite.js +0 -55
- package/dist/sqlite.js.map +0 -1
- package/dist/state-C4HZFotm.d.cts +0 -78
- package/dist/state-C4HZFotm.d.ts +0 -78
- package/dist/store-8aBhnbGr.d.ts +0 -42
- package/dist/store-YrbXb6CY.d.cts +0 -42
- /package/dist/{memory.js.map → broadcaster-preparation-RMWQFYNL.js.map} +0 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { I as GasEstimateRequest, m as GasBenchmarkProfile, p as GasReference, J as OperationPlan, K as BenchmarkGasEstimate, L as SavedOperation, M as TransactionRuntime, v as TransactionProveOptions, i as FundingSigner, F as FundingAuthorizationVerifier, Q as OperationStatus, R as PreparationRuntime, w as TransferPreparation, S as ShieldPreparation, h as CreateCreditPreparation, D as DrawCreditPreparation, T as TopUpCreditPreparation, C as CancelCreditPreparation, U as TransactionInfrastructure } from './broadcaster-preparation-DMxxZ_1Q.js';
|
|
2
|
+
export { V as AddressLookup, B as BroadcasterClient, a as BroadcasterConfiguration, b as BroadcasterFeeSource, c as BroadcasterQuote, d as BroadcasterRpcError, e as BroadcasterStatus, f as BroadcasterTransport, g as BroadcasterTrust, X as Checkpoint, Y as CoinSelector, Z as CreditPlan, _ as CreditRecord, j as FundingSource, k as FundingTypedData, G as GasBenchmarkCircuit, l as GasBenchmarkDeployment, n as GasBenchmarkSample, o as GasBenchmarkShape, $ as LocalOperationSecrets, N as NoteOutput, a0 as NoteRecord, O as OperationAggregateMember, a1 as PreparationIntent, a2 as PreparationInventory, a3 as PreparedCreditInput, a4 as PreparedCreditOutput, a5 as PreparedOutput, a6 as ReceiptPosition, t as SignedBroadcasterQuote, a7 as SpentState, u as TransactionExecution, a8 as WalletScope, W as WithBroadcasterOptions, x as broadcasterQuoteDomain, y as broadcasterQuoteTypes, z as broadcasterRequestHash, A as broadcasterTransactInterface, a9 as configureRecipientInfrastructure, aa as creditReservationKey, E as decodeBroadcasterIntent, ab as prepareBroadcasterPlan, ac as prepareIntent, ad as recipientLookup, H as verifyBroadcasterQuote } from './broadcaster-preparation-DMxxZ_1Q.js';
|
|
3
|
+
import { Hex as Hex$1, InputSource, Address as Address$1 } from '@invisi-labs/protocol/contracts';
|
|
4
|
+
export { o as DeliveryCandidate, D as DeliveryEventLog, a as DiscoveredCredit, b as DiscoveredNote, p as DiscoveryContext, I as Invisi, h as InvisiError, i as InvisiErrorCode, j as InvisiErrorDetails, l as TransactionOutput, q as copyGasBenchmarks, m as decryptCandidates, n as defineGasBenchmarks, s as extractDeliveryCandidates, t as prepareWithErrors, r as readProtocolLogs } from './receipt-logs-m0-bhaxW.js';
|
|
5
|
+
import { TokenProtocol, ChainReader, TransactionContext, CanonicalBlock, Membership, TransactionCall } from '@invisi-labs/protocol';
|
|
6
|
+
import * as _invisi_labs_core from '@invisi-labs/core';
|
|
7
|
+
import { AuthorizedStatement, WalletAuthorizationProvider, CreditDeliveryState } from '@invisi-labs/core';
|
|
8
|
+
import * as _invisi_labs_prover from '@invisi-labs/prover';
|
|
9
|
+
import { Prover, ProofBundle, ProofStatement, ProvingRequest } from '@invisi-labs/prover';
|
|
10
|
+
import 'ethers';
|
|
11
|
+
|
|
12
|
+
/** Internal workload envelope for combinations without an exact receipt measurement. */
|
|
13
|
+
declare function estimateShapeGas(request: GasEstimateRequest, profiles?: readonly GasBenchmarkProfile[]): GasReference;
|
|
14
|
+
|
|
15
|
+
/** Pure reference lookup. No proof, RPC, current fee price, extrapolation or transaction gas limit. */
|
|
16
|
+
declare function estimateBenchmarkGas(plan: OperationPlan, protocol: TokenProtocol, profiles?: readonly GasBenchmarkProfile[]): BenchmarkGasEstimate;
|
|
17
|
+
declare function estimateGasReference(plan: OperationPlan, protocol: TokenProtocol, profiles?: readonly GasBenchmarkProfile[]): GasReference;
|
|
18
|
+
|
|
19
|
+
/** Public frozen request for quote signing. Empty proof/signature make this deliberately non-sendable. */
|
|
20
|
+
declare function exportBroadcasterIntent(plan: OperationPlan): {
|
|
21
|
+
sendable: false;
|
|
22
|
+
data: Hex$1;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
declare function verifyMembership(reader: ChainReader, context: TransactionContext, block: CanonicalBlock, input: {
|
|
26
|
+
treeId: bigint;
|
|
27
|
+
leafIndex: number;
|
|
28
|
+
commitment: Hex$1;
|
|
29
|
+
}, proof: Membership): Promise<void>;
|
|
30
|
+
|
|
31
|
+
/** Decode only canonical protocol receipt bytes before routing events to token wallets. */
|
|
32
|
+
declare function decodeProtocolEvent(log: {
|
|
33
|
+
data: string;
|
|
34
|
+
topics: readonly string[];
|
|
35
|
+
}): {
|
|
36
|
+
eventName: string;
|
|
37
|
+
args: Record<string, any>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
declare function encodeOperation(saved: SavedOperation): Promise<TransactionCall>;
|
|
41
|
+
|
|
42
|
+
/** Both managed and detached handles authorize the same frozen statement. */
|
|
43
|
+
declare function authorizeOperation(plan: OperationPlan, provider: WalletAuthorizationProvider): Promise<AuthorizedStatement>;
|
|
44
|
+
declare function proveOperation(protocol: TokenProtocol, plan: OperationPlan, authorization: AuthorizedStatement | undefined, prover: Prover, options: TransactionProveOptions): Promise<_invisi_labs_prover.ProofBundle>;
|
|
45
|
+
declare function signOperationFunding(saved: SavedOperation, signer: FundingSigner, verifier?: FundingAuthorizationVerifier): Promise<`0x${string}`>;
|
|
46
|
+
/** Export only typed commitments, never private note openings or authorization witnesses. */
|
|
47
|
+
declare function walletSigningRequest(plan: OperationPlan): _invisi_labs_core.SigningRequest;
|
|
48
|
+
/** Recover the EOA key and build the existing private witness without receiving a private key. */
|
|
49
|
+
declare function acceptWalletSignature(plan: OperationPlan, signature: string): Promise<AuthorizedStatement>;
|
|
50
|
+
/** The remote round trip may outlive the nonce or deadline selected during preparation. */
|
|
51
|
+
declare function fundingSigningRequest(saved: SavedOperation, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<_invisi_labs_core.SigningRequest>;
|
|
52
|
+
/** Verify against reconstructed operation data, never caller-supplied typed data. */
|
|
53
|
+
declare function acceptFundingSignature(saved: SavedOperation, signature: string, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<`0x${string}`>;
|
|
54
|
+
|
|
55
|
+
type Hex = `0x${string}`;
|
|
56
|
+
type Address = `0x${string}`;
|
|
57
|
+
|
|
58
|
+
declare function operationPreview(plan: OperationPlan, status: OperationStatus): {
|
|
59
|
+
id: string;
|
|
60
|
+
kind: "shield" | "transfer" | "create-credit" | "draw-credit" | "top-up-credit" | "cancel-credit";
|
|
61
|
+
status: OperationStatus;
|
|
62
|
+
context: {
|
|
63
|
+
tokenAddress: Address;
|
|
64
|
+
now?: bigint;
|
|
65
|
+
timestamp?: bigint;
|
|
66
|
+
chainId: bigint;
|
|
67
|
+
protocolAddress: Address;
|
|
68
|
+
};
|
|
69
|
+
inputs: number;
|
|
70
|
+
inputDetails: ({
|
|
71
|
+
kind: "notes";
|
|
72
|
+
commitment: `0x${string}`;
|
|
73
|
+
amount: bigint;
|
|
74
|
+
owner: `0x${string}`;
|
|
75
|
+
treeId: bigint;
|
|
76
|
+
leafIndex: number;
|
|
77
|
+
} | {
|
|
78
|
+
kind: "credits";
|
|
79
|
+
commitment: `0x${string}`;
|
|
80
|
+
amount: bigint;
|
|
81
|
+
owner: `0x${string}`;
|
|
82
|
+
spender: `0x${string}`;
|
|
83
|
+
expiry: bigint;
|
|
84
|
+
role: "owner" | "spender";
|
|
85
|
+
treeId: bigint;
|
|
86
|
+
leafIndex: number;
|
|
87
|
+
})[];
|
|
88
|
+
funding: {
|
|
89
|
+
payer: `0x${string}`;
|
|
90
|
+
amount: bigint;
|
|
91
|
+
authorization: "signature" | "none" | "caller";
|
|
92
|
+
sigNonce: bigint;
|
|
93
|
+
deadline: bigint;
|
|
94
|
+
permit: {
|
|
95
|
+
deadline: bigint;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
creditOutputs: {
|
|
99
|
+
commitment: `0x${string}`;
|
|
100
|
+
amount: bigint;
|
|
101
|
+
expiry: bigint;
|
|
102
|
+
owner: `0x${string}`;
|
|
103
|
+
spender: `0x${string}`;
|
|
104
|
+
ownerPayout: bigint;
|
|
105
|
+
spenderPayout: bigint;
|
|
106
|
+
}[] | undefined;
|
|
107
|
+
outputs: {
|
|
108
|
+
commitment: `0x${string}`;
|
|
109
|
+
to: string;
|
|
110
|
+
amount: bigint;
|
|
111
|
+
change: boolean;
|
|
112
|
+
}[];
|
|
113
|
+
capacity: number | undefined;
|
|
114
|
+
deadline: bigint;
|
|
115
|
+
feeRecipient: `0x${string}` | undefined;
|
|
116
|
+
feeAmount: bigint;
|
|
117
|
+
fundingAmount: bigint;
|
|
118
|
+
fundingPayer: `0x${string}` | undefined;
|
|
119
|
+
withdrawalAmount: bigint;
|
|
120
|
+
withdrawalAddress: `0x${string}` | undefined;
|
|
121
|
+
permissions: {
|
|
122
|
+
walletAuthorization: boolean;
|
|
123
|
+
proof: boolean;
|
|
124
|
+
fundingAuthorization: boolean;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
declare function creditLeaf(state: CreditDeliveryState): Promise<Hex$1>;
|
|
129
|
+
|
|
130
|
+
declare function inputFacts(plan: OperationPlan): Array<{
|
|
131
|
+
key: string;
|
|
132
|
+
reservationKey: string;
|
|
133
|
+
nullifier: Hex$1;
|
|
134
|
+
kind: "notes" | "credits";
|
|
135
|
+
}>;
|
|
136
|
+
declare function operationSources(plan: OperationPlan): readonly InputSource[];
|
|
137
|
+
|
|
138
|
+
/** Shared preparation engine for managed sessions and explicitly supplied inputs. */
|
|
139
|
+
declare class TransactionPreparation<Result> {
|
|
140
|
+
#private;
|
|
141
|
+
readonly context: PreparationRuntime<Result>;
|
|
142
|
+
constructor(context: PreparationRuntime<Result>);
|
|
143
|
+
private runtime;
|
|
144
|
+
private get scope();
|
|
145
|
+
prepareTransfer(options: TransferPreparation): Promise<Result>;
|
|
146
|
+
private funds;
|
|
147
|
+
prepareShield(options: ShieldPreparation): Promise<Result>;
|
|
148
|
+
prepareCreateCredit(options: CreateCreditPreparation): Promise<Result>;
|
|
149
|
+
prepareDrawCredit(options: DrawCreditPreparation): Promise<Result>;
|
|
150
|
+
prepareTopUpCredit(options: TopUpCreditPreparation): Promise<Result>;
|
|
151
|
+
prepareCancelCredit(options: CancelCreditPreparation): Promise<Result>;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Match the whole frozen member, including funding nonce, signature and permit, in one successful aggregate. */
|
|
155
|
+
declare function matchesAggregateTransaction(saved: SavedOperation, transaction: TransactionCall & {
|
|
156
|
+
from: Address$1;
|
|
157
|
+
}): boolean;
|
|
158
|
+
|
|
159
|
+
/** Whitelist the public proof fields; a custom local backend cannot accidentally export its witness. */
|
|
160
|
+
declare function publicProof(bundle: ProofBundle): ProofBundle;
|
|
161
|
+
|
|
162
|
+
declare function sameStatement(proof: ProofBundle, expected: ProofStatement): void;
|
|
163
|
+
|
|
164
|
+
declare function witnessFor(protocol: TokenProtocol, plan: OperationPlan, authorization?: AuthorizedStatement): Promise<ProvingRequest>;
|
|
165
|
+
|
|
166
|
+
declare function fundingTypedData(saved: SavedOperation): Promise<{
|
|
167
|
+
domain: {
|
|
168
|
+
name: string;
|
|
169
|
+
version: string;
|
|
170
|
+
chainId: bigint;
|
|
171
|
+
verifyingContract: Hex;
|
|
172
|
+
};
|
|
173
|
+
primaryType: "FundTransact";
|
|
174
|
+
types: {
|
|
175
|
+
FundTransact: readonly [{
|
|
176
|
+
readonly name: "requestHash";
|
|
177
|
+
readonly type: "bytes32";
|
|
178
|
+
}, {
|
|
179
|
+
readonly name: "payer";
|
|
180
|
+
readonly type: "address";
|
|
181
|
+
}, {
|
|
182
|
+
readonly name: "amount";
|
|
183
|
+
readonly type: "uint256";
|
|
184
|
+
}, {
|
|
185
|
+
readonly name: "sigNonce";
|
|
186
|
+
readonly type: "uint256";
|
|
187
|
+
}, {
|
|
188
|
+
readonly name: "deadline";
|
|
189
|
+
readonly type: "uint256";
|
|
190
|
+
}];
|
|
191
|
+
};
|
|
192
|
+
message: {
|
|
193
|
+
requestHash: `0x${string}`;
|
|
194
|
+
payer: `0x${string}`;
|
|
195
|
+
amount: bigint;
|
|
196
|
+
sigNonce: bigint;
|
|
197
|
+
deadline: bigint;
|
|
198
|
+
};
|
|
199
|
+
} | {
|
|
200
|
+
domain: {
|
|
201
|
+
name: string;
|
|
202
|
+
version: string;
|
|
203
|
+
chainId: bigint;
|
|
204
|
+
verifyingContract: Hex;
|
|
205
|
+
};
|
|
206
|
+
primaryType: "FundShield";
|
|
207
|
+
types: {
|
|
208
|
+
FundShield: readonly [{
|
|
209
|
+
readonly name: "requestHash";
|
|
210
|
+
readonly type: "bytes32";
|
|
211
|
+
}, {
|
|
212
|
+
readonly name: "payer";
|
|
213
|
+
readonly type: "address";
|
|
214
|
+
}, {
|
|
215
|
+
readonly name: "amount";
|
|
216
|
+
readonly type: "uint256";
|
|
217
|
+
}, {
|
|
218
|
+
readonly name: "sigNonce";
|
|
219
|
+
readonly type: "uint256";
|
|
220
|
+
}, {
|
|
221
|
+
readonly name: "deadline";
|
|
222
|
+
readonly type: "uint256";
|
|
223
|
+
}];
|
|
224
|
+
};
|
|
225
|
+
message: {
|
|
226
|
+
requestHash: `0x${string}`;
|
|
227
|
+
payer: `0x${string}`;
|
|
228
|
+
amount: bigint;
|
|
229
|
+
sigNonce: bigint;
|
|
230
|
+
deadline: bigint;
|
|
231
|
+
};
|
|
232
|
+
}>;
|
|
233
|
+
|
|
234
|
+
declare function requiresAuthorization(plan: OperationPlan): boolean;
|
|
235
|
+
declare function statement(plan: OperationPlan): ProofStatement;
|
|
236
|
+
declare function authorizationRequest(plan: OperationPlan): {
|
|
237
|
+
context: {
|
|
238
|
+
chainId: bigint;
|
|
239
|
+
protocolAddress: bigint;
|
|
240
|
+
};
|
|
241
|
+
operation: "transact" | "create-credit" | "top-up-credit" | "cancel-credit" | "credit-draw";
|
|
242
|
+
capacity: number;
|
|
243
|
+
words: bigint[];
|
|
244
|
+
};
|
|
245
|
+
declare function operationExpired(plan: OperationPlan, now: bigint): boolean;
|
|
246
|
+
|
|
247
|
+
/** Resolve adapters without starting synchronization or accessing wallet state. */
|
|
248
|
+
declare function configureTransactionInfrastructure<T extends TransactionInfrastructure>(options: T): T;
|
|
249
|
+
/** Validate the selected chain and pinned deployment before any managed state access. */
|
|
250
|
+
declare function validateTransactionInfrastructure(options: TransactionInfrastructure): Promise<void>;
|
|
251
|
+
|
|
252
|
+
export { BenchmarkGasEstimate, CancelCreditPreparation, CreateCreditPreparation, DrawCreditPreparation, FundingAuthorizationVerifier, FundingSigner, GasBenchmarkProfile, GasEstimateRequest, GasReference, OperationPlan, OperationStatus, PreparationRuntime, SavedOperation, ShieldPreparation, TopUpCreditPreparation, TransactionInfrastructure, TransactionPreparation, TransactionProveOptions, TransactionRuntime, TransferPreparation, acceptFundingSignature, acceptWalletSignature, authorizationRequest, authorizeOperation, configureTransactionInfrastructure, creditLeaf, decodeProtocolEvent, encodeOperation, estimateBenchmarkGas, estimateGasReference, estimateShapeGas, exportBroadcasterIntent, fundingSigningRequest, fundingTypedData, inputFacts, matchesAggregateTransaction, operationExpired, operationPreview, operationSources, proveOperation, publicProof, requiresAuthorization, sameStatement, signOperationFunding, statement, validateTransactionInfrastructure, verifyMembership, walletSigningRequest, witnessFor };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BroadcasterClient,
|
|
3
|
+
BroadcasterRpcError,
|
|
4
|
+
Invisi,
|
|
5
|
+
TransactionOutput,
|
|
6
|
+
acceptFundingSignature,
|
|
7
|
+
acceptWalletSignature,
|
|
8
|
+
authorizeOperation,
|
|
9
|
+
broadcasterQuoteDomain,
|
|
10
|
+
broadcasterQuoteTypes,
|
|
11
|
+
broadcasterRequestHash,
|
|
12
|
+
broadcasterTransactInterface,
|
|
13
|
+
configureTransactionInfrastructure,
|
|
14
|
+
copyGasBenchmarks,
|
|
15
|
+
creditReservationKey,
|
|
16
|
+
decodeBroadcasterIntent,
|
|
17
|
+
decodeProtocolEvent,
|
|
18
|
+
decryptCandidates,
|
|
19
|
+
defineGasBenchmarks,
|
|
20
|
+
encodeOperation,
|
|
21
|
+
estimateBenchmarkGas,
|
|
22
|
+
estimateGasReference,
|
|
23
|
+
estimateShapeGas,
|
|
24
|
+
extractDeliveryCandidates,
|
|
25
|
+
fundingSigningRequest,
|
|
26
|
+
fundingTypedData,
|
|
27
|
+
inputFacts,
|
|
28
|
+
operationPreview,
|
|
29
|
+
operationSources,
|
|
30
|
+
proveOperation,
|
|
31
|
+
publicProof,
|
|
32
|
+
readProtocolLogs,
|
|
33
|
+
sameStatement,
|
|
34
|
+
signOperationFunding,
|
|
35
|
+
validateTransactionInfrastructure,
|
|
36
|
+
verifyBroadcasterQuote,
|
|
37
|
+
walletSigningRequest,
|
|
38
|
+
witnessFor
|
|
39
|
+
} from "./chunk-EHP5TBC6.js";
|
|
40
|
+
import {
|
|
41
|
+
prepareBroadcasterPlan,
|
|
42
|
+
prepareIntent
|
|
43
|
+
} from "./chunk-GTPUYPQL.js";
|
|
44
|
+
import {
|
|
45
|
+
InvisiError,
|
|
46
|
+
NoteOutput,
|
|
47
|
+
TransactionPreparation,
|
|
48
|
+
authorizationRequest,
|
|
49
|
+
configureRecipientInfrastructure,
|
|
50
|
+
creditLeaf,
|
|
51
|
+
exportBroadcasterIntent,
|
|
52
|
+
operationExpired,
|
|
53
|
+
prepareWithErrors,
|
|
54
|
+
recipientLookup,
|
|
55
|
+
requiresAuthorization,
|
|
56
|
+
statement,
|
|
57
|
+
verifyMembership
|
|
58
|
+
} from "./chunk-ITTGBIG2.js";
|
|
59
|
+
import "./chunk-XHKQ2BO2.js";
|
|
60
|
+
|
|
61
|
+
// src/transactions/proving/aggregate-receipt.ts
|
|
62
|
+
import { Interface } from "ethers";
|
|
63
|
+
import { buildTransactCalldata } from "@invisi-labs/protocol";
|
|
64
|
+
import { invisiProtocolAbi } from "@invisi-labs/protocol/contracts";
|
|
65
|
+
var aggregateAbi = invisiProtocolAbi.filter(
|
|
66
|
+
(item) => item.type === "function" && item.name === "transact" && item.inputs.length === 2 && item.inputs[1]?.type === "tuple[]"
|
|
67
|
+
);
|
|
68
|
+
function matchesAggregateTransaction(saved, transaction) {
|
|
69
|
+
const plan = saved.plan;
|
|
70
|
+
if (plan.statement?.target !== "noir-recursive" || !plan.params || !saved.externalized || transaction.to.toLowerCase() !== plan.context.protocolAddress.toLowerCase() || transaction.value !== 0n)
|
|
71
|
+
return false;
|
|
72
|
+
try {
|
|
73
|
+
const decoded = new Interface(aggregateAbi).parseTransaction({ data: transaction.data }), requests = decoded.args[1].map((request) => {
|
|
74
|
+
const member = request.toObject(true);
|
|
75
|
+
member.params.sources = request.params.sources.map(
|
|
76
|
+
(source) => source.toObject(true)
|
|
77
|
+
);
|
|
78
|
+
member.params.nullifiers = request.params.nullifiers.toArray(true);
|
|
79
|
+
member.params.outputCommitments = request.params.outputCommitments.toArray(true);
|
|
80
|
+
member.deliveries = request.deliveries.map(
|
|
81
|
+
(delivery) => delivery.toObject(true)
|
|
82
|
+
);
|
|
83
|
+
member.funding.permit.v = Number(member.funding.permit.v);
|
|
84
|
+
return {
|
|
85
|
+
params: member.params,
|
|
86
|
+
deliveries: member.deliveries,
|
|
87
|
+
funding: member.funding
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
if (decoded.name !== "transact" || !Array.isArray(requests) || ![4, 8, 12].includes(requests.length))
|
|
91
|
+
return false;
|
|
92
|
+
const canonical = (request) => buildTransactCalldata({
|
|
93
|
+
context: { ...plan.context, tokenAddress: request.params.token },
|
|
94
|
+
proof: "0x00",
|
|
95
|
+
params: request.params,
|
|
96
|
+
deliveries: request.deliveries,
|
|
97
|
+
funding: request.funding,
|
|
98
|
+
caller: transaction.from
|
|
99
|
+
}).data.toLowerCase();
|
|
100
|
+
const expected = buildTransactCalldata({
|
|
101
|
+
context: plan.context,
|
|
102
|
+
proof: "0x00",
|
|
103
|
+
params: plan.params,
|
|
104
|
+
deliveries: plan.outputs.map((output) => output.delivery),
|
|
105
|
+
funding: plan.funding,
|
|
106
|
+
caller: transaction.from
|
|
107
|
+
}).data.toLowerCase();
|
|
108
|
+
return requests.filter((request) => canonical(request) === expected).length === 1;
|
|
109
|
+
} catch {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
BroadcasterClient,
|
|
115
|
+
BroadcasterRpcError,
|
|
116
|
+
Invisi,
|
|
117
|
+
InvisiError,
|
|
118
|
+
NoteOutput,
|
|
119
|
+
TransactionOutput,
|
|
120
|
+
TransactionPreparation,
|
|
121
|
+
acceptFundingSignature,
|
|
122
|
+
acceptWalletSignature,
|
|
123
|
+
authorizationRequest,
|
|
124
|
+
authorizeOperation,
|
|
125
|
+
broadcasterQuoteDomain,
|
|
126
|
+
broadcasterQuoteTypes,
|
|
127
|
+
broadcasterRequestHash,
|
|
128
|
+
broadcasterTransactInterface,
|
|
129
|
+
configureRecipientInfrastructure,
|
|
130
|
+
configureTransactionInfrastructure,
|
|
131
|
+
copyGasBenchmarks,
|
|
132
|
+
creditLeaf,
|
|
133
|
+
creditReservationKey,
|
|
134
|
+
decodeBroadcasterIntent,
|
|
135
|
+
decodeProtocolEvent,
|
|
136
|
+
decryptCandidates,
|
|
137
|
+
defineGasBenchmarks,
|
|
138
|
+
encodeOperation,
|
|
139
|
+
estimateBenchmarkGas,
|
|
140
|
+
estimateGasReference,
|
|
141
|
+
estimateShapeGas,
|
|
142
|
+
exportBroadcasterIntent,
|
|
143
|
+
extractDeliveryCandidates,
|
|
144
|
+
fundingSigningRequest,
|
|
145
|
+
fundingTypedData,
|
|
146
|
+
inputFacts,
|
|
147
|
+
matchesAggregateTransaction,
|
|
148
|
+
operationExpired,
|
|
149
|
+
operationPreview,
|
|
150
|
+
operationSources,
|
|
151
|
+
prepareBroadcasterPlan,
|
|
152
|
+
prepareIntent,
|
|
153
|
+
prepareWithErrors,
|
|
154
|
+
proveOperation,
|
|
155
|
+
publicProof,
|
|
156
|
+
readProtocolLogs,
|
|
157
|
+
recipientLookup,
|
|
158
|
+
requiresAuthorization,
|
|
159
|
+
sameStatement,
|
|
160
|
+
signOperationFunding,
|
|
161
|
+
statement,
|
|
162
|
+
validateTransactionInfrastructure,
|
|
163
|
+
verifyBroadcasterQuote,
|
|
164
|
+
verifyMembership,
|
|
165
|
+
walletSigningRequest,
|
|
166
|
+
witnessFor
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=session-support.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/transactions/proving/aggregate-receipt.ts"],"sourcesContent":["import type { Address } from \"@invisi-labs/protocol/contracts\";\nimport { Interface, type Result } from \"ethers\";\n\nimport { buildTransactCalldata, type TransactionCall } from \"@invisi-labs/protocol\";\nimport { invisiProtocolAbi, type TransactRequest } from \"@invisi-labs/protocol/contracts\";\nimport type { SavedOperation } from \"../operation-types\";\nconst aggregateAbi = invisiProtocolAbi.filter(\n (item) =>\n item.type === \"function\" &&\n item.name === \"transact\" &&\n item.inputs.length === 2 &&\n item.inputs[1]?.type === \"tuple[]\"\n);\n/** Match the whole frozen member, including funding nonce, signature and permit, in one successful aggregate. */\nexport function matchesAggregateTransaction(\n saved: SavedOperation,\n transaction: TransactionCall & { from: Address }\n): boolean {\n const plan = saved.plan;\n if (\n plan.statement?.target !== \"noir-recursive\" ||\n !plan.params ||\n !saved.externalized ||\n transaction.to.toLowerCase() !== plan.context.protocolAddress.toLowerCase() ||\n transaction.value !== 0n\n )\n return false;\n try {\n const decoded = new Interface(aggregateAbi).parseTransaction({ data: transaction.data })!,\n requests = (decoded.args[1] as Result[]).map((request) => {\n const member = request.toObject(true);\n member.params.sources = request.params.sources.map((source: Result) =>\n source.toObject(true)\n );\n member.params.nullifiers = request.params.nullifiers.toArray(true);\n member.params.outputCommitments = request.params.outputCommitments.toArray(true);\n member.deliveries = request.deliveries.map((delivery: Result) =>\n delivery.toObject(true)\n );\n member.funding.permit.v = Number(member.funding.permit.v);\n return {\n params: member.params,\n deliveries: member.deliveries,\n funding: member.funding,\n };\n }) as readonly TransactRequest[];\n if (\n decoded.name !== \"transact\" ||\n !Array.isArray(requests) ||\n ![4, 8, 12].includes(requests.length)\n )\n return false;\n const canonical = (request: TransactRequest) =>\n buildTransactCalldata({\n context: { ...plan.context, tokenAddress: request.params.token },\n proof: \"0x00\",\n params: request.params,\n deliveries: request.deliveries,\n funding: request.funding,\n caller: transaction.from,\n }).data.toLowerCase();\n const expected = buildTransactCalldata({\n context: plan.context,\n proof: \"0x00\",\n params: plan.params,\n deliveries: plan.outputs.map((output) => output.delivery),\n funding: plan.funding,\n caller: transaction.from,\n }).data.toLowerCase();\n return requests.filter((request) => canonical(request) === expected).length === 1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Q,KACvB,CAAC,CAAC,GAAG,GAAG,EAAE,EAAE,SAAS,SAAS,MAAM;AAEpC,aAAO;AACX,UAAM,YAAY,CAAC,YACf,sBAAsB;AAAA,MAClB,SAAS,EAAE,GAAG,KAAK,SAAS,cAAc,QAAQ,OAAO,MAAM;AAAA,MAC/D,OAAO;AAAA,MACP,QAAQ,QAAQ;AAAA,MAChB,YAAY,QAAQ;AAAA,MACpB,SAAS,QAAQ;AAAA,MACjB,QAAQ,YAAY;AAAA,IACxB,CAAC,EAAE,KAAK,YAAY;AACxB,UAAM,WAAW,sBAAsB;AAAA,MACnC,SAAS,KAAK;AAAA,MACd,OAAO;AAAA,MACP,QAAQ,KAAK;AAAA,MACb,YAAY,KAAK,QAAQ,IAAI,CAAC,WAAW,OAAO,QAAQ;AAAA,MACxD,SAAS,KAAK;AAAA,MACd,QAAQ,YAAY;AAAA,IACxB,CAAC,EAAE,KAAK,YAAY;AACpB,WAAO,SAAS,OAAO,CAAC,YAAY,UAAU,OAAO,MAAM,QAAQ,EAAE,WAAW;AAAA,EACpF,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@invisi-labs/sdk",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Invisi
|
|
3
|
+
"version": "1.1.7",
|
|
4
|
+
"description": "Stateless Invisi transaction preparation, signing requests and protocol integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -17,29 +17,19 @@
|
|
|
17
17
|
"import": "./dist/ethers.js",
|
|
18
18
|
"require": "./dist/ethers.cjs"
|
|
19
19
|
},
|
|
20
|
-
"./
|
|
21
|
-
"types": "./dist/
|
|
22
|
-
"import": "./dist/
|
|
23
|
-
"require": "./dist/
|
|
24
|
-
},
|
|
25
|
-
"./indexeddb": {
|
|
26
|
-
"types": "./dist/indexeddb.d.ts",
|
|
27
|
-
"import": "./dist/indexeddb.js",
|
|
28
|
-
"require": "./dist/indexeddb.cjs"
|
|
29
|
-
},
|
|
30
|
-
"./memory": {
|
|
31
|
-
"types": "./dist/memory.d.ts",
|
|
32
|
-
"import": "./dist/memory.js",
|
|
33
|
-
"require": "./dist/memory.cjs"
|
|
20
|
+
"./session-support": {
|
|
21
|
+
"types": "./dist/session-support.d.ts",
|
|
22
|
+
"import": "./dist/session-support.js",
|
|
23
|
+
"require": "./dist/session-support.cjs"
|
|
34
24
|
}
|
|
35
25
|
},
|
|
36
26
|
"dependencies": {
|
|
37
27
|
"ethers": "^6.17.0",
|
|
38
28
|
"@noble/hashes": "1.8.0",
|
|
39
|
-
"@invisi-labs/core": "1.1.
|
|
40
|
-
"@invisi-labs/
|
|
41
|
-
"@invisi-labs/
|
|
42
|
-
"@invisi-labs/rpc": "1.1.
|
|
29
|
+
"@invisi-labs/core": "1.1.7",
|
|
30
|
+
"@invisi-labs/prover": "1.1.7",
|
|
31
|
+
"@invisi-labs/protocol": "1.1.7",
|
|
32
|
+
"@invisi-labs/rpc": "1.1.7"
|
|
43
33
|
},
|
|
44
34
|
"devDependencies": {
|
|
45
35
|
"tsup": "^8.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
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;AACtD,UAAQ,OAAO,MAAM;AAAA,IACjB,KAAK;AACD,aAAO,YAAY,gBAAgB,OAAO,OAAO;AAAA,IACrD,KAAK;AACD,aAAO,YAAY,cAAc,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