@invisi-labs/sdk 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-Z6NDXVBL.js → chunk-BE52B32Z.js} +1658 -525
- package/dist/chunk-BE52B32Z.js.map +1 -0
- package/dist/ethers.d.cts +2 -2
- package/dist/ethers.d.ts +2 -2
- package/dist/index.cjs +1948 -740
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +242 -39
- package/dist/index.d.ts +242 -39
- package/dist/index.js +247 -131
- package/dist/index.js.map +1 -1
- package/dist/indexeddb.cjs +1687 -565
- 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 +1 -1
- package/dist/memory.cjs +1687 -565
- 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 +1 -1
- package/dist/{gas-estimation-BV8WdwNF.d.cts → operation-types-D7I405FX.d.ts} +129 -97
- package/dist/{gas-estimation-v9OjKMsL.d.ts → operation-types-DIazgS2d.d.cts} +129 -97
- package/dist/sqlite.cjs +1687 -565
- 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 +1 -1
- package/dist/{state-DHl6j33x.d.cts → state-AUnz7TG7.d.cts} +3 -1
- package/dist/{state-DHl6j33x.d.ts → state-AUnz7TG7.d.ts} +3 -1
- package/dist/{store-Dlol1q1s.d.ts → store-BMN8kd0c.d.ts} +1 -1
- package/dist/{store-1zgwa--h.d.cts → store-Cz75STRl.d.cts} +1 -1
- package/package.json +5 -5
- package/dist/chunk-Z6NDXVBL.js.map +0 -1
package/dist/memory.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as TransactionalWalletStore } from './store-
|
|
2
|
-
export { M as MemoryAtomicRecords } from './store-
|
|
3
|
-
import './state-
|
|
1
|
+
import { T as TransactionalWalletStore } from './store-Cz75STRl.cjs';
|
|
2
|
+
export { M as MemoryAtomicRecords } from './store-Cz75STRl.cjs';
|
|
3
|
+
import './state-AUnz7TG7.cjs';
|
|
4
4
|
import '@invisi-labs/core';
|
|
5
5
|
import '@invisi-labs/prover';
|
|
6
6
|
|
package/dist/memory.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as TransactionalWalletStore } from './store-
|
|
2
|
-
export { M as MemoryAtomicRecords } from './store-
|
|
3
|
-
import './state-
|
|
1
|
+
import { T as TransactionalWalletStore } from './store-BMN8kd0c.js';
|
|
2
|
+
export { M as MemoryAtomicRecords } from './store-BMN8kd0c.js';
|
|
3
|
+
import './state-AUnz7TG7.js';
|
|
4
4
|
import '@invisi-labs/core';
|
|
5
5
|
import '@invisi-labs/prover';
|
|
6
6
|
|
package/dist/memory.js
CHANGED
|
@@ -1,13 +1,94 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as StoredNote, W as WalletScope, b as WalletStore } from './state-DHl6j33x.cjs';
|
|
1
|
+
import { c as StoredNote, W as WalletScope, b as WalletStore } from './state-AUnz7TG7.js';
|
|
3
2
|
import { TransactionContext, CanonicalBlock, NoteMembership, FundingInput, TransactRequestParams, CreditMembership, Protocol, ChainReader, ProtocolDataProvider, TokenProtocol } from '@invisi-labs/protocol';
|
|
4
3
|
import * as _invisi_labs_prover from '@invisi-labs/prover';
|
|
5
|
-
import { Prover,
|
|
4
|
+
import { Prover, ProverOptions, AggregateMember } from '@invisi-labs/prover';
|
|
5
|
+
import { Hex, Note, CreditDeliveryState, ViewingCapability, Wallet, PublicWallet, WalletAuthorizationProvider, ReceivingKeyLookup } from '@invisi-labs/core';
|
|
6
6
|
import { Signer } from 'ethers';
|
|
7
|
-
import { Address, Hex, Delivery, ShieldParams, ShieldOutput, CreateCreditParams, CreditDrawParams, CancelCreditParams, TopUpCreditParams, TransactRequest } from '@invisi-labs/protocol/contracts';
|
|
7
|
+
import { Address, Hex as Hex$1, Delivery, ShieldParams, ShieldOutput, CreateCreditParams, CreditDrawParams, CancelCreditParams, TopUpCreditParams, TransactRequest } from '@invisi-labs/protocol/contracts';
|
|
8
|
+
|
|
9
|
+
interface GasBenchmarkShape {
|
|
10
|
+
kind: OperationPlan["kind"];
|
|
11
|
+
target: string;
|
|
12
|
+
capacity: number;
|
|
13
|
+
noteInputs: number;
|
|
14
|
+
noteOutputs: number;
|
|
15
|
+
sourceTrees: number;
|
|
16
|
+
creditInputs: number;
|
|
17
|
+
creditOutputs: number;
|
|
18
|
+
creditRemainders: number;
|
|
19
|
+
funding: "none" | "caller" | "signature";
|
|
20
|
+
permit: boolean;
|
|
21
|
+
deliveryBytes: number;
|
|
22
|
+
}
|
|
23
|
+
interface GasBenchmarkDeployment {
|
|
24
|
+
chainId: string;
|
|
25
|
+
protocolAddress: Hex;
|
|
26
|
+
runtimeCodeHash: Hex | null;
|
|
27
|
+
tokenAddress: Hex;
|
|
28
|
+
}
|
|
29
|
+
interface GasBenchmarkCircuit {
|
|
30
|
+
circuitName: string;
|
|
31
|
+
target: string;
|
|
32
|
+
artifactSha256: string;
|
|
33
|
+
vkSha256: string;
|
|
34
|
+
}
|
|
35
|
+
interface GasBenchmarkSample {
|
|
36
|
+
gasUsed: string;
|
|
37
|
+
transactionHash: Hex;
|
|
38
|
+
blockNumber: string;
|
|
39
|
+
blockHash: Hex;
|
|
40
|
+
calldataBytes: number;
|
|
41
|
+
}
|
|
42
|
+
interface GasBenchmarkProfile {
|
|
43
|
+
formatVersion: 1;
|
|
44
|
+
id: string;
|
|
45
|
+
deployment: GasBenchmarkDeployment;
|
|
46
|
+
source: {
|
|
47
|
+
protocolCommit: string;
|
|
48
|
+
fingerprints?: {
|
|
49
|
+
protocolSourceSha256: string;
|
|
50
|
+
dirtyDiffSha256: string;
|
|
51
|
+
compiledArtifactsSha256: string;
|
|
52
|
+
creditManifestSha256: string;
|
|
53
|
+
userManifestSha256: string;
|
|
54
|
+
sdkSourceSha256: string;
|
|
55
|
+
};
|
|
56
|
+
toolchain?: {
|
|
57
|
+
solidity: string;
|
|
58
|
+
barretenberg: string;
|
|
59
|
+
noir: string;
|
|
60
|
+
evmVersion: string;
|
|
61
|
+
optimizerRuns: number;
|
|
62
|
+
anvil: string;
|
|
63
|
+
};
|
|
64
|
+
blockGasLimit?: string;
|
|
65
|
+
runtimeContracts?: Record<string, {
|
|
66
|
+
address: Hex;
|
|
67
|
+
runtimeCodeHash: Hex;
|
|
68
|
+
}>;
|
|
69
|
+
measuredAt: string;
|
|
70
|
+
chain: string;
|
|
71
|
+
hardfork: string;
|
|
72
|
+
token: string;
|
|
73
|
+
verifier: "real";
|
|
74
|
+
assumptions: string[];
|
|
75
|
+
};
|
|
76
|
+
measurements: Array<{
|
|
77
|
+
id: string;
|
|
78
|
+
shape: GasBenchmarkShape;
|
|
79
|
+
circuit: GasBenchmarkCircuit | null;
|
|
80
|
+
samples: GasBenchmarkSample[];
|
|
81
|
+
}>;
|
|
82
|
+
}
|
|
83
|
+
/** Parse a trusted, JSON-compatible benchmark catalog. No network access or publisher authentication. */
|
|
84
|
+
declare function defineGasBenchmarks(input: unknown): GasBenchmarkProfile[];
|
|
85
|
+
/** Pre-proof reference only; ethers must estimate the final transaction independently. */
|
|
86
|
+
interface GasReference {
|
|
87
|
+
gasUnits: bigint;
|
|
88
|
+
}
|
|
8
89
|
|
|
9
90
|
interface CoinSelector {
|
|
10
|
-
select(candidates: readonly StoredNote[], requiredAmount: bigint): readonly Hex[] | Promise<readonly Hex[]>;
|
|
91
|
+
select(candidates: readonly StoredNote[], requiredAmount: bigint): readonly Hex$1[] | Promise<readonly Hex$1[]>;
|
|
11
92
|
}
|
|
12
93
|
interface FundingTypedData {
|
|
13
94
|
domain: Record<string, unknown>;
|
|
@@ -20,12 +101,12 @@ interface FundingTypedData {
|
|
|
20
101
|
}
|
|
21
102
|
interface FundingSigner {
|
|
22
103
|
readonly address: Address;
|
|
23
|
-
signTypedData(data: FundingTypedData): Promise<Hex>;
|
|
104
|
+
signTypedData(data: FundingTypedData): Promise<Hex$1>;
|
|
24
105
|
}
|
|
25
106
|
interface FundingAuthorizationVerifier {
|
|
26
107
|
verifyTypedData(data: FundingTypedData & {
|
|
27
108
|
address: Address;
|
|
28
|
-
signature: Hex;
|
|
109
|
+
signature: Hex$1;
|
|
29
110
|
}): Promise<boolean>;
|
|
30
111
|
}
|
|
31
112
|
interface FundingSource {
|
|
@@ -37,29 +118,29 @@ interface FundingSource {
|
|
|
37
118
|
permit?: NonNullable<FundingInput["permit"]>;
|
|
38
119
|
}
|
|
39
120
|
interface PaymentOutput {
|
|
40
|
-
|
|
121
|
+
/** Version-specific application data. Omission uses built-in v1 with no data. */
|
|
122
|
+
payload?: Uint8Array;
|
|
41
123
|
to: string;
|
|
42
124
|
amount: bigint;
|
|
43
125
|
}
|
|
126
|
+
/** Public submission mode; backend proof targets are selected internally. */
|
|
127
|
+
type TransactionExecution = "single" | "aggregate";
|
|
128
|
+
interface TransactionProveOptions extends ProverOptions {
|
|
129
|
+
/** Defaults to single. Aggregate produces a member for a separate aggregate submission. */
|
|
130
|
+
execution?: TransactionExecution;
|
|
131
|
+
}
|
|
44
132
|
interface TransferPreparation {
|
|
45
133
|
tokenAddress: Address;
|
|
134
|
+
/** Explicit subset for managed inventory; detached calls already supply inputs. */
|
|
135
|
+
commitments?: readonly Hex$1[];
|
|
136
|
+
/** Public ERC20 payout. Empty private outputs are allowed when a payout is present. */
|
|
137
|
+
withdrawal?: {
|
|
138
|
+
to: Address;
|
|
139
|
+
amount: bigint;
|
|
140
|
+
};
|
|
46
141
|
outputs: readonly PaymentOutput[];
|
|
47
142
|
funding?: FundingSource;
|
|
48
143
|
deadline?: bigint;
|
|
49
|
-
target?: ProofTarget;
|
|
50
|
-
}
|
|
51
|
-
interface WithdrawalPreparation {
|
|
52
|
-
tokenAddress: Address;
|
|
53
|
-
to: Address;
|
|
54
|
-
amount: bigint;
|
|
55
|
-
deadline?: bigint;
|
|
56
|
-
target?: ProofTarget;
|
|
57
|
-
}
|
|
58
|
-
interface SweepPreparation {
|
|
59
|
-
tokenAddress: Address;
|
|
60
|
-
commitments?: readonly Hex[];
|
|
61
|
-
deadline?: bigint;
|
|
62
|
-
target?: ProofTarget;
|
|
63
144
|
}
|
|
64
145
|
interface ShieldPreparation {
|
|
65
146
|
tokenAddress: Address;
|
|
@@ -69,14 +150,18 @@ interface ShieldPreparation {
|
|
|
69
150
|
}
|
|
70
151
|
interface PreparedOutput {
|
|
71
152
|
note: Note;
|
|
72
|
-
commitment: Hex;
|
|
73
|
-
identity: Hex;
|
|
153
|
+
commitment: Hex$1;
|
|
154
|
+
identity: Hex$1;
|
|
74
155
|
delivery: Delivery;
|
|
75
156
|
address: string;
|
|
76
157
|
change: boolean;
|
|
77
158
|
}
|
|
78
159
|
interface CreateCreditPreparation {
|
|
79
|
-
|
|
160
|
+
/** Version-specific application data. Omission uses built-in v1 with no data. */
|
|
161
|
+
payload?: Uint8Array;
|
|
162
|
+
singleLimit?: bigint;
|
|
163
|
+
dailyLimit?: bigint;
|
|
164
|
+
monthlyLimit?: bigint;
|
|
80
165
|
tokenAddress: Address;
|
|
81
166
|
spender: string;
|
|
82
167
|
amount: bigint;
|
|
@@ -87,16 +172,21 @@ interface CreateCreditPreparation {
|
|
|
87
172
|
interface DrawCreditPreparation {
|
|
88
173
|
tokenAddress: Address;
|
|
89
174
|
credits: readonly {
|
|
90
|
-
credit: Hex;
|
|
175
|
+
credit: Hex$1;
|
|
91
176
|
amount: bigint;
|
|
92
|
-
|
|
177
|
+
payload?: Uint8Array;
|
|
93
178
|
}[];
|
|
94
179
|
deadline?: bigint;
|
|
95
180
|
}
|
|
96
181
|
interface TopUpCreditPreparation {
|
|
97
|
-
|
|
182
|
+
/** Version-specific application data. Omission uses built-in v1 with no data. */
|
|
183
|
+
payload?: Uint8Array;
|
|
184
|
+
/** Omission inherits the previous limit; zero disables it without clearing usage. */
|
|
185
|
+
singleLimit?: bigint;
|
|
186
|
+
dailyLimit?: bigint;
|
|
187
|
+
monthlyLimit?: bigint;
|
|
98
188
|
tokenAddress: Address;
|
|
99
|
-
credit: Hex;
|
|
189
|
+
credit: Hex$1;
|
|
100
190
|
additionalAmount: bigint;
|
|
101
191
|
expiry?: bigint;
|
|
102
192
|
funding?: FundingSource;
|
|
@@ -104,16 +194,16 @@ interface TopUpCreditPreparation {
|
|
|
104
194
|
}
|
|
105
195
|
interface CancelCreditPreparation {
|
|
106
196
|
tokenAddress: Address;
|
|
107
|
-
credit: Hex;
|
|
197
|
+
credit: Hex$1;
|
|
108
198
|
deadline?: bigint;
|
|
109
199
|
}
|
|
110
200
|
interface PreparedCreditOutput {
|
|
111
201
|
state: CreditDeliveryState;
|
|
112
|
-
commitment: Hex;
|
|
202
|
+
commitment: Hex$1;
|
|
113
203
|
deliveries: [Delivery, Delivery];
|
|
114
204
|
}
|
|
115
205
|
interface PreparedCreditInput extends CreditMembership {
|
|
116
|
-
commitment: Hex;
|
|
206
|
+
commitment: Hex$1;
|
|
117
207
|
role: "owner" | "spender";
|
|
118
208
|
}
|
|
119
209
|
interface CreditPlan {
|
|
@@ -129,14 +219,14 @@ interface CreditPlan {
|
|
|
129
219
|
interface OperationPlan {
|
|
130
220
|
version: 1;
|
|
131
221
|
id: string;
|
|
132
|
-
kind: "transfer" | "
|
|
222
|
+
kind: "transfer" | "shield" | "create-credit" | "draw-credit" | "top-up-credit" | "cancel-credit";
|
|
133
223
|
context: TransactionContext;
|
|
134
224
|
scope: WalletScope;
|
|
135
225
|
preparedAt: CanonicalBlock;
|
|
136
226
|
deadline: bigint;
|
|
137
227
|
outputs: PreparedOutput[];
|
|
138
228
|
inputs: Array<NoteMembership & {
|
|
139
|
-
commitment: Hex;
|
|
229
|
+
commitment: Hex$1;
|
|
140
230
|
}>;
|
|
141
231
|
funding: FundingInput;
|
|
142
232
|
fundingMode: "none" | "signature" | "caller";
|
|
@@ -147,12 +237,14 @@ interface OperationPlan {
|
|
|
147
237
|
credit?: CreditPlan;
|
|
148
238
|
statement?: _invisi_labs_prover.ProofStatement;
|
|
149
239
|
}
|
|
150
|
-
|
|
240
|
+
type WalletSessionOptions = WalletSessionInfrastructure;
|
|
241
|
+
/** Shared runtime fields; public options separately enforce the custom registry requirement. */
|
|
242
|
+
interface WalletSessionInfrastructure {
|
|
151
243
|
gasBenchmarks?: readonly GasBenchmarkProfile[];
|
|
152
244
|
/** Optional ethers gas/funding signer; distinct from the Invisi wallet authority. */
|
|
153
245
|
signer?: Signer;
|
|
154
246
|
viewing?: Pick<ViewingCapability, "walletIdentity" | "decryptNote" | "decryptCredit">;
|
|
155
|
-
wallet: Wallet;
|
|
247
|
+
wallet: Wallet | PublicWallet;
|
|
156
248
|
protocol: Protocol;
|
|
157
249
|
namespace?: string;
|
|
158
250
|
store?: WalletStore;
|
|
@@ -180,64 +272,4 @@ interface OperationAggregateMember extends AggregateMember {
|
|
|
180
272
|
request: TransactRequest;
|
|
181
273
|
}
|
|
182
274
|
|
|
183
|
-
|
|
184
|
-
kind: OperationPlan["kind"];
|
|
185
|
-
target: string;
|
|
186
|
-
capacity: number;
|
|
187
|
-
noteInputs: number;
|
|
188
|
-
noteOutputs: number;
|
|
189
|
-
sourceTrees: number;
|
|
190
|
-
creditInputs: number;
|
|
191
|
-
creditOutputs: number;
|
|
192
|
-
creditRemainders: number;
|
|
193
|
-
funding: "none" | "caller" | "signature";
|
|
194
|
-
permit: boolean;
|
|
195
|
-
deliveryBytes: number;
|
|
196
|
-
}
|
|
197
|
-
interface GasBenchmarkDeployment {
|
|
198
|
-
chainId: string;
|
|
199
|
-
protocolAddress: Hex$1;
|
|
200
|
-
runtimeCodeHash: Hex$1 | null;
|
|
201
|
-
tokenAddress: Hex$1;
|
|
202
|
-
}
|
|
203
|
-
interface GasBenchmarkCircuit {
|
|
204
|
-
circuitName: string;
|
|
205
|
-
target: string;
|
|
206
|
-
artifactSha256: string;
|
|
207
|
-
vkSha256: string;
|
|
208
|
-
}
|
|
209
|
-
interface GasBenchmarkSample {
|
|
210
|
-
gasUsed: string;
|
|
211
|
-
transactionHash: Hex$1;
|
|
212
|
-
blockNumber: string;
|
|
213
|
-
blockHash: Hex$1;
|
|
214
|
-
calldataBytes: number;
|
|
215
|
-
}
|
|
216
|
-
interface GasBenchmarkProfile {
|
|
217
|
-
formatVersion: 1;
|
|
218
|
-
id: string;
|
|
219
|
-
deployment: GasBenchmarkDeployment;
|
|
220
|
-
source: {
|
|
221
|
-
protocolCommit: string;
|
|
222
|
-
measuredAt: string;
|
|
223
|
-
chain: string;
|
|
224
|
-
hardfork: string;
|
|
225
|
-
token: string;
|
|
226
|
-
verifier: "real";
|
|
227
|
-
assumptions: string[];
|
|
228
|
-
};
|
|
229
|
-
measurements: Array<{
|
|
230
|
-
id: string;
|
|
231
|
-
shape: GasBenchmarkShape;
|
|
232
|
-
circuit: GasBenchmarkCircuit | null;
|
|
233
|
-
samples: GasBenchmarkSample[];
|
|
234
|
-
}>;
|
|
235
|
-
}
|
|
236
|
-
/** Parse a trusted, JSON-compatible benchmark catalog. No network access or publisher authentication. */
|
|
237
|
-
declare function defineGasBenchmarks(input: unknown): GasBenchmarkProfile[];
|
|
238
|
-
/** Pre-proof reference only; ethers must estimate the final transaction independently. */
|
|
239
|
-
interface GasReference {
|
|
240
|
-
gasUnits: bigint;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export { type CancelCreditPreparation as C, type DrawCreditPreparation as D, type FundingSigner as F, type GasReference as G, type OperationRuntime as O, type ShieldPreparation as S, type TopUpCreditPreparation as T, type WithdrawalPreparation as W, type OperationPlan as a, type OperationAggregateMember as b, type CreateCreditPreparation as c, type SweepPreparation as d, type TransferPreparation as e, type WalletSessionOptions as f, type CoinSelector as g, type FundingAuthorizationVerifier as h, type FundingSource as i, type FundingTypedData as j, type GasBenchmarkCircuit as k, type GasBenchmarkDeployment as l, type GasBenchmarkProfile as m, type GasBenchmarkSample as n, type GasBenchmarkShape as o, defineGasBenchmarks as p };
|
|
275
|
+
export { type CancelCreditPreparation as C, type DrawCreditPreparation as D, type FundingAuthorizationVerifier as F, type GasReference as G, type OperationRuntime as O, type PaymentOutput as P, type ShieldPreparation as S, type TransactionProveOptions as T, type WalletSessionOptions as W, type OperationPlan as a, type OperationAggregateMember as b, type CreateCreditPreparation as c, type TopUpCreditPreparation as d, type TransferPreparation as e, type WalletSessionInfrastructure as f, type CoinSelector as g, type FundingSigner as h, type FundingSource as i, type FundingTypedData as j, type GasBenchmarkCircuit as k, type GasBenchmarkDeployment as l, type GasBenchmarkProfile as m, type GasBenchmarkSample as n, type GasBenchmarkShape as o, type TransactionExecution as p, defineGasBenchmarks as q };
|
|
@@ -1,13 +1,94 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as StoredNote, W as WalletScope, b as WalletStore } from './state-DHl6j33x.js';
|
|
1
|
+
import { c as StoredNote, W as WalletScope, b as WalletStore } from './state-AUnz7TG7.cjs';
|
|
3
2
|
import { TransactionContext, CanonicalBlock, NoteMembership, FundingInput, TransactRequestParams, CreditMembership, Protocol, ChainReader, ProtocolDataProvider, TokenProtocol } from '@invisi-labs/protocol';
|
|
4
3
|
import * as _invisi_labs_prover from '@invisi-labs/prover';
|
|
5
|
-
import { Prover,
|
|
4
|
+
import { Prover, ProverOptions, AggregateMember } from '@invisi-labs/prover';
|
|
5
|
+
import { Hex, Note, CreditDeliveryState, ViewingCapability, Wallet, PublicWallet, WalletAuthorizationProvider, ReceivingKeyLookup } from '@invisi-labs/core';
|
|
6
6
|
import { Signer } from 'ethers';
|
|
7
|
-
import { Address, Hex, Delivery, ShieldParams, ShieldOutput, CreateCreditParams, CreditDrawParams, CancelCreditParams, TopUpCreditParams, TransactRequest } from '@invisi-labs/protocol/contracts';
|
|
7
|
+
import { Address, Hex as Hex$1, Delivery, ShieldParams, ShieldOutput, CreateCreditParams, CreditDrawParams, CancelCreditParams, TopUpCreditParams, TransactRequest } from '@invisi-labs/protocol/contracts';
|
|
8
|
+
|
|
9
|
+
interface GasBenchmarkShape {
|
|
10
|
+
kind: OperationPlan["kind"];
|
|
11
|
+
target: string;
|
|
12
|
+
capacity: number;
|
|
13
|
+
noteInputs: number;
|
|
14
|
+
noteOutputs: number;
|
|
15
|
+
sourceTrees: number;
|
|
16
|
+
creditInputs: number;
|
|
17
|
+
creditOutputs: number;
|
|
18
|
+
creditRemainders: number;
|
|
19
|
+
funding: "none" | "caller" | "signature";
|
|
20
|
+
permit: boolean;
|
|
21
|
+
deliveryBytes: number;
|
|
22
|
+
}
|
|
23
|
+
interface GasBenchmarkDeployment {
|
|
24
|
+
chainId: string;
|
|
25
|
+
protocolAddress: Hex;
|
|
26
|
+
runtimeCodeHash: Hex | null;
|
|
27
|
+
tokenAddress: Hex;
|
|
28
|
+
}
|
|
29
|
+
interface GasBenchmarkCircuit {
|
|
30
|
+
circuitName: string;
|
|
31
|
+
target: string;
|
|
32
|
+
artifactSha256: string;
|
|
33
|
+
vkSha256: string;
|
|
34
|
+
}
|
|
35
|
+
interface GasBenchmarkSample {
|
|
36
|
+
gasUsed: string;
|
|
37
|
+
transactionHash: Hex;
|
|
38
|
+
blockNumber: string;
|
|
39
|
+
blockHash: Hex;
|
|
40
|
+
calldataBytes: number;
|
|
41
|
+
}
|
|
42
|
+
interface GasBenchmarkProfile {
|
|
43
|
+
formatVersion: 1;
|
|
44
|
+
id: string;
|
|
45
|
+
deployment: GasBenchmarkDeployment;
|
|
46
|
+
source: {
|
|
47
|
+
protocolCommit: string;
|
|
48
|
+
fingerprints?: {
|
|
49
|
+
protocolSourceSha256: string;
|
|
50
|
+
dirtyDiffSha256: string;
|
|
51
|
+
compiledArtifactsSha256: string;
|
|
52
|
+
creditManifestSha256: string;
|
|
53
|
+
userManifestSha256: string;
|
|
54
|
+
sdkSourceSha256: string;
|
|
55
|
+
};
|
|
56
|
+
toolchain?: {
|
|
57
|
+
solidity: string;
|
|
58
|
+
barretenberg: string;
|
|
59
|
+
noir: string;
|
|
60
|
+
evmVersion: string;
|
|
61
|
+
optimizerRuns: number;
|
|
62
|
+
anvil: string;
|
|
63
|
+
};
|
|
64
|
+
blockGasLimit?: string;
|
|
65
|
+
runtimeContracts?: Record<string, {
|
|
66
|
+
address: Hex;
|
|
67
|
+
runtimeCodeHash: Hex;
|
|
68
|
+
}>;
|
|
69
|
+
measuredAt: string;
|
|
70
|
+
chain: string;
|
|
71
|
+
hardfork: string;
|
|
72
|
+
token: string;
|
|
73
|
+
verifier: "real";
|
|
74
|
+
assumptions: string[];
|
|
75
|
+
};
|
|
76
|
+
measurements: Array<{
|
|
77
|
+
id: string;
|
|
78
|
+
shape: GasBenchmarkShape;
|
|
79
|
+
circuit: GasBenchmarkCircuit | null;
|
|
80
|
+
samples: GasBenchmarkSample[];
|
|
81
|
+
}>;
|
|
82
|
+
}
|
|
83
|
+
/** Parse a trusted, JSON-compatible benchmark catalog. No network access or publisher authentication. */
|
|
84
|
+
declare function defineGasBenchmarks(input: unknown): GasBenchmarkProfile[];
|
|
85
|
+
/** Pre-proof reference only; ethers must estimate the final transaction independently. */
|
|
86
|
+
interface GasReference {
|
|
87
|
+
gasUnits: bigint;
|
|
88
|
+
}
|
|
8
89
|
|
|
9
90
|
interface CoinSelector {
|
|
10
|
-
select(candidates: readonly StoredNote[], requiredAmount: bigint): readonly Hex[] | Promise<readonly Hex[]>;
|
|
91
|
+
select(candidates: readonly StoredNote[], requiredAmount: bigint): readonly Hex$1[] | Promise<readonly Hex$1[]>;
|
|
11
92
|
}
|
|
12
93
|
interface FundingTypedData {
|
|
13
94
|
domain: Record<string, unknown>;
|
|
@@ -20,12 +101,12 @@ interface FundingTypedData {
|
|
|
20
101
|
}
|
|
21
102
|
interface FundingSigner {
|
|
22
103
|
readonly address: Address;
|
|
23
|
-
signTypedData(data: FundingTypedData): Promise<Hex>;
|
|
104
|
+
signTypedData(data: FundingTypedData): Promise<Hex$1>;
|
|
24
105
|
}
|
|
25
106
|
interface FundingAuthorizationVerifier {
|
|
26
107
|
verifyTypedData(data: FundingTypedData & {
|
|
27
108
|
address: Address;
|
|
28
|
-
signature: Hex;
|
|
109
|
+
signature: Hex$1;
|
|
29
110
|
}): Promise<boolean>;
|
|
30
111
|
}
|
|
31
112
|
interface FundingSource {
|
|
@@ -37,29 +118,29 @@ interface FundingSource {
|
|
|
37
118
|
permit?: NonNullable<FundingInput["permit"]>;
|
|
38
119
|
}
|
|
39
120
|
interface PaymentOutput {
|
|
40
|
-
|
|
121
|
+
/** Version-specific application data. Omission uses built-in v1 with no data. */
|
|
122
|
+
payload?: Uint8Array;
|
|
41
123
|
to: string;
|
|
42
124
|
amount: bigint;
|
|
43
125
|
}
|
|
126
|
+
/** Public submission mode; backend proof targets are selected internally. */
|
|
127
|
+
type TransactionExecution = "single" | "aggregate";
|
|
128
|
+
interface TransactionProveOptions extends ProverOptions {
|
|
129
|
+
/** Defaults to single. Aggregate produces a member for a separate aggregate submission. */
|
|
130
|
+
execution?: TransactionExecution;
|
|
131
|
+
}
|
|
44
132
|
interface TransferPreparation {
|
|
45
133
|
tokenAddress: Address;
|
|
134
|
+
/** Explicit subset for managed inventory; detached calls already supply inputs. */
|
|
135
|
+
commitments?: readonly Hex$1[];
|
|
136
|
+
/** Public ERC20 payout. Empty private outputs are allowed when a payout is present. */
|
|
137
|
+
withdrawal?: {
|
|
138
|
+
to: Address;
|
|
139
|
+
amount: bigint;
|
|
140
|
+
};
|
|
46
141
|
outputs: readonly PaymentOutput[];
|
|
47
142
|
funding?: FundingSource;
|
|
48
143
|
deadline?: bigint;
|
|
49
|
-
target?: ProofTarget;
|
|
50
|
-
}
|
|
51
|
-
interface WithdrawalPreparation {
|
|
52
|
-
tokenAddress: Address;
|
|
53
|
-
to: Address;
|
|
54
|
-
amount: bigint;
|
|
55
|
-
deadline?: bigint;
|
|
56
|
-
target?: ProofTarget;
|
|
57
|
-
}
|
|
58
|
-
interface SweepPreparation {
|
|
59
|
-
tokenAddress: Address;
|
|
60
|
-
commitments?: readonly Hex[];
|
|
61
|
-
deadline?: bigint;
|
|
62
|
-
target?: ProofTarget;
|
|
63
144
|
}
|
|
64
145
|
interface ShieldPreparation {
|
|
65
146
|
tokenAddress: Address;
|
|
@@ -69,14 +150,18 @@ interface ShieldPreparation {
|
|
|
69
150
|
}
|
|
70
151
|
interface PreparedOutput {
|
|
71
152
|
note: Note;
|
|
72
|
-
commitment: Hex;
|
|
73
|
-
identity: Hex;
|
|
153
|
+
commitment: Hex$1;
|
|
154
|
+
identity: Hex$1;
|
|
74
155
|
delivery: Delivery;
|
|
75
156
|
address: string;
|
|
76
157
|
change: boolean;
|
|
77
158
|
}
|
|
78
159
|
interface CreateCreditPreparation {
|
|
79
|
-
|
|
160
|
+
/** Version-specific application data. Omission uses built-in v1 with no data. */
|
|
161
|
+
payload?: Uint8Array;
|
|
162
|
+
singleLimit?: bigint;
|
|
163
|
+
dailyLimit?: bigint;
|
|
164
|
+
monthlyLimit?: bigint;
|
|
80
165
|
tokenAddress: Address;
|
|
81
166
|
spender: string;
|
|
82
167
|
amount: bigint;
|
|
@@ -87,16 +172,21 @@ interface CreateCreditPreparation {
|
|
|
87
172
|
interface DrawCreditPreparation {
|
|
88
173
|
tokenAddress: Address;
|
|
89
174
|
credits: readonly {
|
|
90
|
-
credit: Hex;
|
|
175
|
+
credit: Hex$1;
|
|
91
176
|
amount: bigint;
|
|
92
|
-
|
|
177
|
+
payload?: Uint8Array;
|
|
93
178
|
}[];
|
|
94
179
|
deadline?: bigint;
|
|
95
180
|
}
|
|
96
181
|
interface TopUpCreditPreparation {
|
|
97
|
-
|
|
182
|
+
/** Version-specific application data. Omission uses built-in v1 with no data. */
|
|
183
|
+
payload?: Uint8Array;
|
|
184
|
+
/** Omission inherits the previous limit; zero disables it without clearing usage. */
|
|
185
|
+
singleLimit?: bigint;
|
|
186
|
+
dailyLimit?: bigint;
|
|
187
|
+
monthlyLimit?: bigint;
|
|
98
188
|
tokenAddress: Address;
|
|
99
|
-
credit: Hex;
|
|
189
|
+
credit: Hex$1;
|
|
100
190
|
additionalAmount: bigint;
|
|
101
191
|
expiry?: bigint;
|
|
102
192
|
funding?: FundingSource;
|
|
@@ -104,16 +194,16 @@ interface TopUpCreditPreparation {
|
|
|
104
194
|
}
|
|
105
195
|
interface CancelCreditPreparation {
|
|
106
196
|
tokenAddress: Address;
|
|
107
|
-
credit: Hex;
|
|
197
|
+
credit: Hex$1;
|
|
108
198
|
deadline?: bigint;
|
|
109
199
|
}
|
|
110
200
|
interface PreparedCreditOutput {
|
|
111
201
|
state: CreditDeliveryState;
|
|
112
|
-
commitment: Hex;
|
|
202
|
+
commitment: Hex$1;
|
|
113
203
|
deliveries: [Delivery, Delivery];
|
|
114
204
|
}
|
|
115
205
|
interface PreparedCreditInput extends CreditMembership {
|
|
116
|
-
commitment: Hex;
|
|
206
|
+
commitment: Hex$1;
|
|
117
207
|
role: "owner" | "spender";
|
|
118
208
|
}
|
|
119
209
|
interface CreditPlan {
|
|
@@ -129,14 +219,14 @@ interface CreditPlan {
|
|
|
129
219
|
interface OperationPlan {
|
|
130
220
|
version: 1;
|
|
131
221
|
id: string;
|
|
132
|
-
kind: "transfer" | "
|
|
222
|
+
kind: "transfer" | "shield" | "create-credit" | "draw-credit" | "top-up-credit" | "cancel-credit";
|
|
133
223
|
context: TransactionContext;
|
|
134
224
|
scope: WalletScope;
|
|
135
225
|
preparedAt: CanonicalBlock;
|
|
136
226
|
deadline: bigint;
|
|
137
227
|
outputs: PreparedOutput[];
|
|
138
228
|
inputs: Array<NoteMembership & {
|
|
139
|
-
commitment: Hex;
|
|
229
|
+
commitment: Hex$1;
|
|
140
230
|
}>;
|
|
141
231
|
funding: FundingInput;
|
|
142
232
|
fundingMode: "none" | "signature" | "caller";
|
|
@@ -147,12 +237,14 @@ interface OperationPlan {
|
|
|
147
237
|
credit?: CreditPlan;
|
|
148
238
|
statement?: _invisi_labs_prover.ProofStatement;
|
|
149
239
|
}
|
|
150
|
-
|
|
240
|
+
type WalletSessionOptions = WalletSessionInfrastructure;
|
|
241
|
+
/** Shared runtime fields; public options separately enforce the custom registry requirement. */
|
|
242
|
+
interface WalletSessionInfrastructure {
|
|
151
243
|
gasBenchmarks?: readonly GasBenchmarkProfile[];
|
|
152
244
|
/** Optional ethers gas/funding signer; distinct from the Invisi wallet authority. */
|
|
153
245
|
signer?: Signer;
|
|
154
246
|
viewing?: Pick<ViewingCapability, "walletIdentity" | "decryptNote" | "decryptCredit">;
|
|
155
|
-
wallet: Wallet;
|
|
247
|
+
wallet: Wallet | PublicWallet;
|
|
156
248
|
protocol: Protocol;
|
|
157
249
|
namespace?: string;
|
|
158
250
|
store?: WalletStore;
|
|
@@ -180,64 +272,4 @@ interface OperationAggregateMember extends AggregateMember {
|
|
|
180
272
|
request: TransactRequest;
|
|
181
273
|
}
|
|
182
274
|
|
|
183
|
-
|
|
184
|
-
kind: OperationPlan["kind"];
|
|
185
|
-
target: string;
|
|
186
|
-
capacity: number;
|
|
187
|
-
noteInputs: number;
|
|
188
|
-
noteOutputs: number;
|
|
189
|
-
sourceTrees: number;
|
|
190
|
-
creditInputs: number;
|
|
191
|
-
creditOutputs: number;
|
|
192
|
-
creditRemainders: number;
|
|
193
|
-
funding: "none" | "caller" | "signature";
|
|
194
|
-
permit: boolean;
|
|
195
|
-
deliveryBytes: number;
|
|
196
|
-
}
|
|
197
|
-
interface GasBenchmarkDeployment {
|
|
198
|
-
chainId: string;
|
|
199
|
-
protocolAddress: Hex$1;
|
|
200
|
-
runtimeCodeHash: Hex$1 | null;
|
|
201
|
-
tokenAddress: Hex$1;
|
|
202
|
-
}
|
|
203
|
-
interface GasBenchmarkCircuit {
|
|
204
|
-
circuitName: string;
|
|
205
|
-
target: string;
|
|
206
|
-
artifactSha256: string;
|
|
207
|
-
vkSha256: string;
|
|
208
|
-
}
|
|
209
|
-
interface GasBenchmarkSample {
|
|
210
|
-
gasUsed: string;
|
|
211
|
-
transactionHash: Hex$1;
|
|
212
|
-
blockNumber: string;
|
|
213
|
-
blockHash: Hex$1;
|
|
214
|
-
calldataBytes: number;
|
|
215
|
-
}
|
|
216
|
-
interface GasBenchmarkProfile {
|
|
217
|
-
formatVersion: 1;
|
|
218
|
-
id: string;
|
|
219
|
-
deployment: GasBenchmarkDeployment;
|
|
220
|
-
source: {
|
|
221
|
-
protocolCommit: string;
|
|
222
|
-
measuredAt: string;
|
|
223
|
-
chain: string;
|
|
224
|
-
hardfork: string;
|
|
225
|
-
token: string;
|
|
226
|
-
verifier: "real";
|
|
227
|
-
assumptions: string[];
|
|
228
|
-
};
|
|
229
|
-
measurements: Array<{
|
|
230
|
-
id: string;
|
|
231
|
-
shape: GasBenchmarkShape;
|
|
232
|
-
circuit: GasBenchmarkCircuit | null;
|
|
233
|
-
samples: GasBenchmarkSample[];
|
|
234
|
-
}>;
|
|
235
|
-
}
|
|
236
|
-
/** Parse a trusted, JSON-compatible benchmark catalog. No network access or publisher authentication. */
|
|
237
|
-
declare function defineGasBenchmarks(input: unknown): GasBenchmarkProfile[];
|
|
238
|
-
/** Pre-proof reference only; ethers must estimate the final transaction independently. */
|
|
239
|
-
interface GasReference {
|
|
240
|
-
gasUnits: bigint;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export { type CancelCreditPreparation as C, type DrawCreditPreparation as D, type FundingSigner as F, type GasReference as G, type OperationRuntime as O, type ShieldPreparation as S, type TopUpCreditPreparation as T, type WithdrawalPreparation as W, type OperationPlan as a, type OperationAggregateMember as b, type CreateCreditPreparation as c, type SweepPreparation as d, type TransferPreparation as e, type WalletSessionOptions as f, type CoinSelector as g, type FundingAuthorizationVerifier as h, type FundingSource as i, type FundingTypedData as j, type GasBenchmarkCircuit as k, type GasBenchmarkDeployment as l, type GasBenchmarkProfile as m, type GasBenchmarkSample as n, type GasBenchmarkShape as o, defineGasBenchmarks as p };
|
|
275
|
+
export { type CancelCreditPreparation as C, type DrawCreditPreparation as D, type FundingAuthorizationVerifier as F, type GasReference as G, type OperationRuntime as O, type PaymentOutput as P, type ShieldPreparation as S, type TransactionProveOptions as T, type WalletSessionOptions as W, type OperationPlan as a, type OperationAggregateMember as b, type CreateCreditPreparation as c, type TopUpCreditPreparation as d, type TransferPreparation as e, type WalletSessionInfrastructure as f, type CoinSelector as g, type FundingSigner as h, type FundingSource as i, type FundingTypedData as j, type GasBenchmarkCircuit as k, type GasBenchmarkDeployment as l, type GasBenchmarkProfile as m, type GasBenchmarkSample as n, type GasBenchmarkShape as o, type TransactionExecution as p, defineGasBenchmarks as q };
|