@invisi-labs/sdk 1.1.6 → 1.2.0
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/README.md +5 -0
- package/dist/broadcaster-3KTB4JO2.cjs +21 -0
- package/dist/broadcaster-3KTB4JO2.cjs.map +1 -0
- package/dist/broadcaster-7ZKKSTZQ.js +21 -0
- package/dist/broadcaster-preparation-PJ263WBL.cjs +15 -0
- package/dist/broadcaster-preparation-PJ263WBL.cjs.map +1 -0
- package/dist/broadcaster-preparation-ZQAPZAUG.js +15 -0
- package/dist/broadcaster-preparation-ZQAPZAUG.js.map +1 -0
- package/dist/chunk-2URICDPW.cjs +167 -0
- package/dist/chunk-2URICDPW.cjs.map +1 -0
- package/dist/chunk-3D24ABYR.js +86 -0
- package/dist/chunk-3D24ABYR.js.map +1 -0
- package/dist/chunk-3KTQQZOW.cjs +71 -0
- package/dist/chunk-3KTQQZOW.cjs.map +1 -0
- package/dist/chunk-4H4FARQK.js +1582 -0
- package/dist/chunk-4H4FARQK.js.map +1 -0
- package/dist/chunk-4SDP53YQ.cjs +765 -0
- package/dist/chunk-4SDP53YQ.cjs.map +1 -0
- package/dist/{chunk-QC6TQR3R.js → chunk-4VI6LYGH.js} +35 -12
- package/dist/chunk-4VI6LYGH.js.map +1 -0
- package/dist/chunk-BBSRP4MH.cjs +287 -0
- package/dist/chunk-BBSRP4MH.cjs.map +1 -0
- package/dist/chunk-DGMVGFKM.js +41 -0
- package/dist/chunk-DGMVGFKM.js.map +1 -0
- package/dist/chunk-GUD3LAUO.js +765 -0
- package/dist/chunk-GUD3LAUO.js.map +1 -0
- package/dist/chunk-HCB7RQ3S.cjs +79 -0
- package/dist/chunk-HCB7RQ3S.cjs.map +1 -0
- package/dist/{broadcaster-preparation-QVL62KM6.js → chunk-HKGJXQVN.js} +73 -34
- package/dist/chunk-HKGJXQVN.js.map +1 -0
- package/dist/chunk-HLH5JZD4.js +287 -0
- package/dist/chunk-HLH5JZD4.js.map +1 -0
- package/dist/chunk-J6TZZVAM.cjs +230 -0
- package/dist/chunk-J6TZZVAM.cjs.map +1 -0
- package/dist/chunk-LOR6PYH5.cjs +397 -0
- package/dist/chunk-LOR6PYH5.cjs.map +1 -0
- package/dist/chunk-MA2QZEF5.cjs +399 -0
- package/dist/chunk-MA2QZEF5.cjs.map +1 -0
- package/dist/chunk-MI4IP4ZD.cjs +86 -0
- package/dist/chunk-MI4IP4ZD.cjs.map +1 -0
- package/dist/chunk-NKYHYIRP.cjs +1582 -0
- package/dist/chunk-NKYHYIRP.cjs.map +1 -0
- package/dist/chunk-OCZLJKIA.cjs +41 -0
- package/dist/chunk-OCZLJKIA.cjs.map +1 -0
- package/dist/chunk-R5YAOJKB.js +71 -0
- package/dist/chunk-R5YAOJKB.js.map +1 -0
- package/dist/chunk-RY4M2CIQ.js +399 -0
- package/dist/chunk-RY4M2CIQ.js.map +1 -0
- package/dist/chunk-THMD5QO2.js +79 -0
- package/dist/chunk-THMD5QO2.js.map +1 -0
- package/dist/chunk-ZD2652WH.js +230 -0
- package/dist/chunk-ZD2652WH.js.map +1 -0
- package/dist/credit.cjs +1 -0
- package/dist/credit.cjs.map +1 -0
- package/dist/credit.d.cts +12 -0
- package/dist/credit.d.ts +12 -0
- package/dist/credit.js +1 -0
- package/dist/credit.js.map +1 -0
- package/dist/ethers.cjs +11 -385
- package/dist/ethers.cjs.map +1 -1
- package/dist/ethers.d.cts +16 -6
- package/dist/ethers.d.ts +16 -6
- package/dist/ethers.js +1 -1
- package/dist/index-CLhGwLxZ.d.cts +42 -0
- package/dist/index-Crp-ZFiM.d.ts +42 -0
- package/dist/index.cjs +479 -7847
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -710
- package/dist/index.d.ts +87 -710
- package/dist/index.js +407 -869
- package/dist/index.js.map +1 -1
- package/dist/note.cjs +11 -0
- package/dist/note.cjs.map +1 -0
- package/dist/note.d.cts +29 -0
- package/dist/note.d.ts +29 -0
- package/dist/note.js +11 -0
- package/dist/note.js.map +1 -0
- package/dist/operation-bridge-CoECSxfi.d.cts +472 -0
- package/dist/operation-bridge-CoECSxfi.d.ts +472 -0
- package/dist/preparation-HUBTVCZE.js +404 -0
- package/dist/preparation-HUBTVCZE.js.map +1 -0
- package/dist/preparation-QD3ZSYV5.cjs +404 -0
- package/dist/preparation-QD3ZSYV5.cjs.map +1 -0
- package/dist/provenance-preparation-43DN2WK7.cjs +16 -0
- package/dist/provenance-preparation-43DN2WK7.cjs.map +1 -0
- package/dist/provenance-preparation-HEZE4L5H.js +16 -0
- package/dist/provenance-preparation-HEZE4L5H.js.map +1 -0
- package/dist/provenance.cjs +59 -0
- package/dist/provenance.cjs.map +1 -0
- package/dist/provenance.d.cts +34 -0
- package/dist/provenance.d.ts +34 -0
- package/dist/provenance.js +59 -0
- package/dist/provenance.js.map +1 -0
- package/dist/receipt-logs-8Msm_HZS.d.ts +322 -0
- package/dist/receipt-logs-DWG4In8N.d.cts +322 -0
- package/dist/session-support.cjs +189 -0
- package/dist/session-support.cjs.map +1 -0
- package/dist/session-support.d.cts +284 -0
- package/dist/session-support.d.ts +284 -0
- package/dist/session-support.js +189 -0
- package/dist/session-support.js.map +1 -0
- package/package.json +25 -19
- package/dist/NoteOutput-DRkVnwlx.d.cts +0 -398
- package/dist/NoteOutput-DpDC6T2O.d.ts +0 -398
- package/dist/broadcaster-preparation-QVL62KM6.js.map +0 -1
- package/dist/chunk-4SD3MW6N.js +0 -4711
- package/dist/chunk-4SD3MW6N.js.map +0 -1
- package/dist/chunk-FL4TIGWW.js +0 -1781
- 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-7ZKKSTZQ.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,318 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
import * as _invisi_labs_protocol from '@invisi-labs/protocol';
|
|
9
|
-
import { TransactionCall, Protocol as Protocol$1, CanonicalBlock, ChainReader, TokenProtocol, RegistrationPreparation, RegistrationOperation, AddressRegistry as AddressRegistry$1, CanonicalReceipt } from '@invisi-labs/protocol';
|
|
10
|
-
export { AddressRegistryOptions, CanonicalBlock, CanonicalReceipt, ChainReader, FactoryReader, Membership, ProtocolDataProvider, ProtocolDataStatus, ProtocolOptions, ProtocolUpdateRange, ProtocolUpdates, RegistrationOperation, RegistryContext, RegistryReader, TokenProtocol, TokenProtocolOptions, TransactionCall, TransactionContext } from '@invisi-labs/protocol';
|
|
11
|
-
import { Prover, ProofBundle } from '@invisi-labs/prover';
|
|
1
|
+
import { DisclosureOutput, Disclosure, DisclosureResult, Wallet } from '@invisi-labs/primitives';
|
|
2
|
+
export { Address, CreditDataV1, CreditDeliveryState, CreditOpening, CreditPolicy, CreditState, DeliveryDecryptionError, DeliveryDecryptor, Detector, Disclosure, DisclosureExport, DisclosureOutput, DisclosureResult, FundsDataV1, Hex, MAX_MEMO_BYTES, Memo, MissingCapabilityError, Note, NullifierCapability, ReceivingKeys, SigningRequest, ViewingCapability, Wallet, authenticatedDecryptor, computeCreditNullifier, creditPeriods, creditV1, decodeDeliveryHeader, decodeMemoText, encodeMemo, fundsV1 } from '@invisi-labs/primitives';
|
|
3
|
+
import * as _invisi_labs_rpc from '@invisi-labs/rpc';
|
|
4
|
+
import { TokenProtocol, Protocol as Protocol$1, ProtocolRpcClient as ProtocolRpcClient$1, AddressRegistry as AddressRegistry$1, RegistrationPreparation } from '@invisi-labs/rpc';
|
|
5
|
+
export { AddressRegistryOptions, IndexedCreditState, MAX_UPDATE_BLOCKS, ProtocolCreditTransition, ProtocolDeployment, ProtocolNoteOutput, ProtocolOptions, ProtocolRpcChain, ProtocolRpcClientOptions, ProtocolRpcConnectionOptions, ProtocolRpcError, ProtocolRpcReader, ProtocolTransactionCreditUpdates, ProtocolTransactionNoteUpdates, RegisteredReceivingAddress, RegistrationOperation, RegistryReader, TokenProtocol, TokenProtocolOptions } from '@invisi-labs/rpc';
|
|
6
|
+
import { CanonicalBlock, ChainReader, TransactionCall, Membership } from '@invisi-labs/protocol';
|
|
7
|
+
export { CanonicalBlock, CanonicalReceipt, ChainReader, DocumentedGasReference, DocumentedGasShape, FactoryReader, Membership, ProtocolDataProvider, ProtocolDataStatus, ProtocolUpdateRange, RegistryContext, TransactionCall, TransactionContext, getDocumentedGasReference } from '@invisi-labs/protocol';
|
|
12
8
|
export { AggregateMember, AggregatorCapability, ProofBundle, ProofStatement, Prover, ProverOptions } from '@invisi-labs/prover';
|
|
13
|
-
|
|
14
|
-
export { b as WalletStore, w as walletBalance } from './state-C4HZFotm.cjs';
|
|
9
|
+
export { D as DeliveryEventLog, a as DiscoveredCredit, b as DiscoveredNote, I as Invisi, c as InvisiError, d as InvisiErrorCode, e as InvisiErrorDetails, f as InvisiOptions, P as PreparedTransaction, R as RegistrationPreparationOptions, g as decryptCandidates, r as readProtocolLogs } from './receipt-logs-DWG4In8N.cjs';
|
|
15
10
|
import { Hex, Address } from '@invisi-labs/protocol/contracts';
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
interface BroadcasterQuote {
|
|
27
|
-
token: string;
|
|
28
|
-
feeRecipient: string;
|
|
29
|
-
feeAmount: string;
|
|
30
|
-
deadline: string;
|
|
31
|
-
maxGas: string;
|
|
32
|
-
requestHash: string;
|
|
33
|
-
}
|
|
34
|
-
interface SignedBroadcasterQuote {
|
|
35
|
-
quote: BroadcasterQuote;
|
|
36
|
-
signature: string;
|
|
37
|
-
context?: {
|
|
38
|
-
chainId: bigint;
|
|
39
|
-
protocol: string;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
interface BroadcasterTrust {
|
|
43
|
-
chainId: bigint;
|
|
44
|
-
protocol: string;
|
|
45
|
-
signer: string;
|
|
46
|
-
}
|
|
47
|
-
declare function broadcasterQuoteDomain(trust: BroadcasterTrust): {
|
|
48
|
-
name: string;
|
|
49
|
-
version: string;
|
|
50
|
-
chainId: bigint;
|
|
51
|
-
verifyingContract: string;
|
|
52
|
-
};
|
|
53
|
-
declare const broadcasterTransactInterface: Interface;
|
|
54
|
-
/** Decode a canonical supported direct public intent. Draw, registry and aggregates are excluded. */
|
|
55
|
-
declare function decodeBroadcasterIntent(data: string): {
|
|
56
|
-
fragment: ethers.FunctionFragment;
|
|
57
|
-
method: string;
|
|
58
|
-
args: ethers.Result;
|
|
59
|
-
proof: string;
|
|
60
|
-
request: {
|
|
61
|
-
params: any;
|
|
62
|
-
funding: any;
|
|
63
|
-
deliveries: any;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
/** Domain-separated final public intent: omit only proof bytes and funding.signature. */
|
|
67
|
-
declare function broadcasterRequestHash(data: string): string;
|
|
68
|
-
declare function verifyBroadcasterQuote(signed: SignedBroadcasterQuote, trust: BroadcasterTrust, data: string, now?: bigint): BroadcasterQuote;
|
|
69
|
-
interface BroadcasterStatus {
|
|
70
|
-
id: string;
|
|
71
|
-
state: "pending" | "submitted" | "confirmed" | "reverted" | "uncertain";
|
|
72
|
-
transactionHash?: string;
|
|
73
|
-
}
|
|
74
|
-
type BroadcasterTransport = (request: {
|
|
75
|
-
jsonrpc: "2.0";
|
|
76
|
-
id: number;
|
|
77
|
-
method: string;
|
|
78
|
-
params: unknown;
|
|
79
|
-
}) => Promise<unknown>;
|
|
80
|
-
interface BroadcasterConfiguration {
|
|
81
|
-
endpoint: string;
|
|
82
|
-
quoteSigner: string;
|
|
83
|
-
feeRecipient: string;
|
|
84
|
-
}
|
|
85
|
-
declare class BroadcasterClient {
|
|
86
|
-
readonly configuration: Readonly<BroadcasterConfiguration>;
|
|
87
|
-
readonly url: string;
|
|
88
|
-
readonly transport: BroadcasterTransport;
|
|
89
|
-
private requestId;
|
|
90
|
-
constructor(configuration: BroadcasterConfiguration, transport?: BroadcasterTransport);
|
|
91
|
-
private call;
|
|
92
|
-
fee(token: string, data?: string): Promise<{
|
|
93
|
-
feeRecipient: string;
|
|
94
|
-
feeAmount: string;
|
|
95
|
-
maxGas: string;
|
|
96
|
-
}>;
|
|
97
|
-
quote(data: string, context: {
|
|
98
|
-
chainId: bigint;
|
|
99
|
-
protocol: string;
|
|
100
|
-
}): Promise<SignedBroadcasterQuote>;
|
|
101
|
-
submit(data: string, signed: SignedBroadcasterQuote, idempotencyKey: string): Promise<BroadcasterStatus>;
|
|
102
|
-
status(id: string): Promise<BroadcasterStatus>;
|
|
103
|
-
}
|
|
104
|
-
declare class BroadcasterRpcError extends Error {
|
|
105
|
-
readonly code: number;
|
|
106
|
-
constructor(code: number, message: string);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/** Stable codes returned by public SDK prepare* methods; inspect details instead of matching messages. */
|
|
110
|
-
type InvisiErrorCode =
|
|
111
|
-
/**
|
|
112
|
-
* Other preparation failure, such as invalid amounts, expired deadlines,
|
|
113
|
-
* or conflicting registration state. Inspect message and cause.
|
|
114
|
-
*/
|
|
115
|
-
"PREPARATION_FAILED"
|
|
116
|
-
/**
|
|
117
|
-
* Required infrastructure or permissions were not supplied.
|
|
118
|
-
* The capability field identifies what is missing.
|
|
119
|
-
*/
|
|
120
|
-
| "MISSING_CAPABILITY"
|
|
121
|
-
/**
|
|
122
|
-
* The recipient string is not a valid full 0i address or nonzero EVM owner address.
|
|
123
|
-
* No registration lookup is attempted for this invalid string.
|
|
124
|
-
*/
|
|
125
|
-
| "INVALID_RECIPIENT"
|
|
126
|
-
/**
|
|
127
|
-
* A successful lookup found no receiving keys for this short 0x owner
|
|
128
|
-
* at the queried state. Indexed data may lag behind the latest chain state.
|
|
129
|
-
* Full 0i addresses contain receiving keys and do not require registration.
|
|
130
|
-
*/
|
|
131
|
-
| "EVM_ADDRESS_NOT_REGISTERED"
|
|
132
|
-
/**
|
|
133
|
-
* Recipient lookup failed or returned invalid keys. Inspect cause.
|
|
134
|
-
* Registration status is unknown; this does not mean the owner is unregistered.
|
|
135
|
-
*/
|
|
136
|
-
| "RECIPIENT_LOOKUP_FAILED";
|
|
137
|
-
interface InvisiErrorDetails {
|
|
138
|
-
operation?: string;
|
|
139
|
-
address?: string;
|
|
140
|
-
/** Zero-based index into the caller's outputs array, excluding automatic change. */
|
|
141
|
-
outputIndex?: number;
|
|
142
|
-
field?: string;
|
|
143
|
-
capability?: string;
|
|
144
|
-
cause?: unknown;
|
|
145
|
-
}
|
|
146
|
-
/** Stable application-facing preparation failure with the original cause. */
|
|
147
|
-
declare class InvisiError extends Error {
|
|
148
|
-
readonly code: InvisiErrorCode;
|
|
149
|
-
readonly operation: string | undefined;
|
|
150
|
-
readonly address: string | undefined;
|
|
151
|
-
readonly outputIndex: number | undefined;
|
|
152
|
-
readonly field: string | undefined;
|
|
153
|
-
readonly capability: string | undefined;
|
|
154
|
-
constructor(code: InvisiErrorCode, message: string, details?: InvisiErrorDetails);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
type Runtime = Omit<OperationRuntime, "store" | "authorization"> & {
|
|
158
|
-
reprepare?: (intent: PreparationIntent) => Promise<OperationPlan>;
|
|
159
|
-
};
|
|
160
|
-
/** An immutable, local transaction handle. No wallet inventory, reservations or persistence. */
|
|
161
|
-
declare class PreparedTransaction {
|
|
162
|
-
#private;
|
|
163
|
-
readonly status: OperationStatus;
|
|
164
|
-
private constructor();
|
|
165
|
-
static prepare(runtime: Runtime, plan: OperationPlan): PreparedTransaction;
|
|
166
|
-
broadcasterQuote(): SignedBroadcasterQuote | undefined;
|
|
167
|
-
withBroadcaster(client: BroadcasterClient, options: WithBroadcasterOptions): Promise<PreparedTransaction>;
|
|
168
|
-
get id(): string;
|
|
169
|
-
get kind(): "shield" | "transfer" | "create-credit" | "draw-credit" | "top-up-credit" | "cancel-credit";
|
|
170
|
-
estimateGas(): GasReference;
|
|
171
|
-
preview(): {
|
|
172
|
-
id: string;
|
|
173
|
-
kind: "shield" | "transfer" | "create-credit" | "draw-credit" | "top-up-credit" | "cancel-credit";
|
|
174
|
-
status: OperationStatus;
|
|
175
|
-
context: {
|
|
176
|
-
tokenAddress: _invisi_labs_core.Address;
|
|
177
|
-
now?: bigint;
|
|
178
|
-
timestamp?: bigint;
|
|
179
|
-
chainId: bigint;
|
|
180
|
-
protocolAddress: _invisi_labs_core.Address;
|
|
181
|
-
};
|
|
182
|
-
inputs: number;
|
|
183
|
-
inputDetails: ({
|
|
184
|
-
kind: "notes";
|
|
185
|
-
commitment: `0x${string}`;
|
|
186
|
-
amount: bigint;
|
|
187
|
-
owner: `0x${string}`;
|
|
188
|
-
treeId: bigint;
|
|
189
|
-
leafIndex: number;
|
|
190
|
-
} | {
|
|
191
|
-
kind: "credits";
|
|
192
|
-
commitment: `0x${string}`;
|
|
193
|
-
amount: bigint;
|
|
194
|
-
owner: `0x${string}`;
|
|
195
|
-
spender: `0x${string}`;
|
|
196
|
-
expiry: bigint;
|
|
197
|
-
role: "owner" | "spender";
|
|
198
|
-
treeId: bigint;
|
|
199
|
-
leafIndex: number;
|
|
200
|
-
})[];
|
|
201
|
-
funding: {
|
|
202
|
-
payer: `0x${string}`;
|
|
203
|
-
amount: bigint;
|
|
204
|
-
authorization: "signature" | "none" | "caller";
|
|
205
|
-
sigNonce: bigint;
|
|
206
|
-
deadline: bigint;
|
|
207
|
-
permit: {
|
|
208
|
-
deadline: bigint;
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
creditOutputs: {
|
|
212
|
-
commitment: `0x${string}`;
|
|
213
|
-
amount: bigint;
|
|
214
|
-
expiry: bigint;
|
|
215
|
-
owner: `0x${string}`;
|
|
216
|
-
spender: `0x${string}`;
|
|
217
|
-
ownerPayout: bigint;
|
|
218
|
-
spenderPayout: bigint;
|
|
219
|
-
}[] | undefined;
|
|
220
|
-
outputs: {
|
|
221
|
-
commitment: `0x${string}`;
|
|
222
|
-
to: string;
|
|
223
|
-
amount: bigint;
|
|
224
|
-
change: boolean;
|
|
225
|
-
}[];
|
|
226
|
-
capacity: number | undefined;
|
|
227
|
-
deadline: bigint;
|
|
228
|
-
feeRecipient: `0x${string}` | undefined;
|
|
229
|
-
feeAmount: bigint;
|
|
230
|
-
fundingAmount: bigint;
|
|
231
|
-
fundingPayer: `0x${string}` | undefined;
|
|
232
|
-
withdrawalAmount: bigint;
|
|
233
|
-
withdrawalAddress: `0x${string}` | undefined;
|
|
234
|
-
permissions: {
|
|
235
|
-
walletAuthorization: boolean;
|
|
236
|
-
proof: boolean;
|
|
237
|
-
fundingAuthorization: boolean;
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
|
-
/** Obtain a firm quote before signing. This intent contains no private inputs or witness. */
|
|
241
|
-
exportBroadcasterIntent(): Promise<{
|
|
242
|
-
sendable: false;
|
|
243
|
-
data: _invisi_labs_core.Hex;
|
|
244
|
-
}>;
|
|
245
|
-
private current;
|
|
246
|
-
private stage;
|
|
247
|
-
/** Public EIP-712 request; signing transport and key custody belong to the caller. */
|
|
248
|
-
exportWalletAuthorization(options?: {
|
|
249
|
-
signal?: AbortSignal;
|
|
250
|
-
}): Promise<_invisi_labs_core.SigningRequest>;
|
|
251
|
-
/** Attach an external EOA signature, retaining its witness only at the private proving boundary. */
|
|
252
|
-
withWalletSignature(signature: string, options?: {
|
|
253
|
-
signal?: AbortSignal;
|
|
254
|
-
}): Promise<PreparedTransaction>;
|
|
255
|
-
/** Export only after proving when the funding authorization binds an actual proof hash. */
|
|
256
|
-
exportFundingAuthorization(options?: {
|
|
257
|
-
signal?: AbortSignal;
|
|
258
|
-
}): Promise<_invisi_labs_core.SigningRequest>;
|
|
259
|
-
/** Verify an external signature against this handle's own frozen operation. */
|
|
260
|
-
withFundingSignature(signature: string, options?: {
|
|
261
|
-
signal?: AbortSignal;
|
|
262
|
-
}): Promise<PreparedTransaction>;
|
|
263
|
-
prove(options?: TransactionProveOptions): Promise<PreparedTransaction>;
|
|
264
|
-
prove(backend: Prover, options?: TransactionProveOptions): Promise<PreparedTransaction>;
|
|
265
|
-
private encode;
|
|
266
|
-
/** Shield caller funding needs no wallet signing or proof; this step only encodes its frozen request. */
|
|
267
|
-
ready(): Promise<PreparedTransaction>;
|
|
268
|
-
exportTransaction(): Promise<TransactionCall>;
|
|
269
|
-
exportProof(): ProofBundle;
|
|
270
|
-
exportAggregateMember(): OperationAggregateMember;
|
|
271
|
-
toJSON(): {
|
|
272
|
-
transaction: boolean;
|
|
273
|
-
id: string;
|
|
274
|
-
kind: "shield" | "transfer" | "create-credit" | "draw-credit" | "top-up-credit" | "cancel-credit";
|
|
275
|
-
status: OperationStatus;
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
interface NoteInput {
|
|
280
|
-
note: Note;
|
|
281
|
-
commitment: Hex;
|
|
282
|
-
treeId: bigint;
|
|
283
|
-
leafIndex: number;
|
|
284
|
-
}
|
|
285
|
-
interface CreditInput {
|
|
286
|
-
state: CreditDeliveryState;
|
|
287
|
-
commitment: Hex;
|
|
288
|
-
treeId: bigint;
|
|
289
|
-
leafIndex: number;
|
|
290
|
-
role: "owner" | "spender";
|
|
291
|
-
}
|
|
292
|
-
interface TransactionIdentity {
|
|
293
|
-
wallet: PublicWallet & {
|
|
294
|
-
getViewer?: never;
|
|
295
|
-
getDetector?: never;
|
|
296
|
-
exportAuthorization?: never;
|
|
297
|
-
};
|
|
298
|
-
protocol: Protocol$1;
|
|
299
|
-
}
|
|
300
|
-
interface ExplicitFunds {
|
|
301
|
-
inputs: readonly NoteInput[];
|
|
302
|
-
changeAddress?: string;
|
|
303
|
-
}
|
|
304
|
-
type ExplicitTransferPreparation = TransactionIdentity & TransferPreparation & ExplicitFunds;
|
|
305
|
-
type ExplicitShieldPreparation = TransactionIdentity & ShieldPreparation;
|
|
306
|
-
type ExplicitCreateCreditPreparation = TransactionIdentity & CreateCreditPreparation & ExplicitFunds;
|
|
307
|
-
type ExplicitDrawCreditPreparation = TransactionIdentity & DrawCreditPreparation & {
|
|
308
|
-
creditInputs: readonly CreditInput[];
|
|
309
|
-
};
|
|
310
|
-
type ExplicitTopUpCreditPreparation = TransactionIdentity & TopUpCreditPreparation & ExplicitFunds & {
|
|
311
|
-
creditInputs: readonly CreditInput[];
|
|
312
|
-
};
|
|
313
|
-
type ExplicitCancelCreditPreparation = TransactionIdentity & CancelCreditPreparation & {
|
|
314
|
-
creditInputs: readonly CreditInput[];
|
|
315
|
-
};
|
|
11
|
+
import { Provider } from 'ethers';
|
|
12
|
+
import { i as BroadcasterClient, j as PaymentRequest } from './operation-bridge-CoECSxfi.cjs';
|
|
13
|
+
export { k as BroadcasterFeeSource, l as BroadcasterQuoteOptions, B as BroadcasterTransaction, C as CreateCreditPreparation, D as DrawCreditPreparation, c as FundingAuthorizationVerifier, F as FundingSigner, m as FundingSource, b as FundingTypedData, N as NoteOutput, n as NoteOutputContext, o as NoteOutputExecutionOptions, p as NoteOutputRecipient, g as OperationAggregateMember, a as PreparedProvenanceCapability, R as RevokeCreditPreparation, S as ShieldPreparation, q as TransactionExecution, f as TransactionProveOptions, r as TransferPreparation, U as UpdateCreditPreparation } from './operation-bridge-CoECSxfi.cjs';
|
|
14
|
+
import { N as NoteInput } from './index-CLhGwLxZ.cjs';
|
|
15
|
+
export { C as CreditInput, b as ExplicitCreateCreditPreparation, c as ExplicitDrawCreditPreparation, e as ExplicitRevokeCreditPreparation, a as ExplicitShieldPreparation, E as ExplicitTransferPreparation, d as ExplicitUpdateCreditPreparation, T as TransactionIdentity } from './index-CLhGwLxZ.cjs';
|
|
16
|
+
export { TransactionOutput } from './note.cjs';
|
|
17
|
+
export { BroadcasterConfiguration, BroadcasterEstimate, BroadcasterQuote, BroadcasterRpcError, BroadcasterStatus, BroadcasterTransport, BroadcasterTrust, SignedBroadcasterQuote, broadcasterQuoteDomain, broadcasterQuoteTypes, broadcasterRequestHash, broadcasterTransactInterface, decodeBroadcasterIntent, verifyBroadcasterQuote } from '@invisi-labs/rpc/broadcaster';
|
|
18
|
+
import '@invisi-labs/protocol/provenance';
|
|
19
|
+
import '@invisi-labs/prover/provenance-witness';
|
|
20
|
+
import '@invisi-labs/rpc/provenance';
|
|
316
21
|
|
|
317
22
|
interface DisclosureReference {
|
|
318
23
|
transactionHash: Hex;
|
|
@@ -359,396 +64,23 @@ declare class DisclosureVerifier {
|
|
|
359
64
|
};
|
|
360
65
|
}
|
|
361
66
|
|
|
362
|
-
/**
|
|
363
|
-
declare class Operation {
|
|
364
|
-
#private;
|
|
365
|
-
readonly status: OperationStatus;
|
|
366
|
-
private constructor();
|
|
367
|
-
static prepare(runtime: OperationRuntime, plan: OperationPlan): Promise<Operation>;
|
|
368
|
-
static resume(runtime: OperationRuntime, id: string): Promise<Operation>;
|
|
369
|
-
/** Public non-sendable intent for a firm quote before wallet authorization. */
|
|
370
|
-
exportBroadcasterIntent(): Promise<{
|
|
371
|
-
sendable: false;
|
|
372
|
-
data: Hex;
|
|
373
|
-
}>;
|
|
374
|
-
broadcasterQuote(): SignedBroadcasterQuote | undefined;
|
|
375
|
-
withBroadcaster(client: BroadcasterClient, options: WithBroadcasterOptions): Promise<Operation>;
|
|
376
|
-
get id(): string;
|
|
377
|
-
get kind(): OperationPlan["kind"];
|
|
378
|
-
estimateGas(): GasReference;
|
|
379
|
-
preview(): {
|
|
380
|
-
id: string;
|
|
381
|
-
kind: "shield" | "transfer" | "create-credit" | "draw-credit" | "top-up-credit" | "cancel-credit";
|
|
382
|
-
status: OperationStatus;
|
|
383
|
-
context: {
|
|
384
|
-
tokenAddress: _invisi_labs_core.Address;
|
|
385
|
-
now?: bigint;
|
|
386
|
-
timestamp?: bigint;
|
|
387
|
-
chainId: bigint;
|
|
388
|
-
protocolAddress: _invisi_labs_core.Address;
|
|
389
|
-
};
|
|
390
|
-
inputs: number;
|
|
391
|
-
inputDetails: ({
|
|
392
|
-
kind: "notes";
|
|
393
|
-
commitment: `0x${string}`;
|
|
394
|
-
amount: bigint;
|
|
395
|
-
owner: `0x${string}`;
|
|
396
|
-
treeId: bigint;
|
|
397
|
-
leafIndex: number;
|
|
398
|
-
} | {
|
|
399
|
-
kind: "credits";
|
|
400
|
-
commitment: `0x${string}`;
|
|
401
|
-
amount: bigint;
|
|
402
|
-
owner: `0x${string}`;
|
|
403
|
-
spender: `0x${string}`;
|
|
404
|
-
expiry: bigint;
|
|
405
|
-
role: "owner" | "spender";
|
|
406
|
-
treeId: bigint;
|
|
407
|
-
leafIndex: number;
|
|
408
|
-
})[];
|
|
409
|
-
funding: {
|
|
410
|
-
payer: `0x${string}`;
|
|
411
|
-
amount: bigint;
|
|
412
|
-
authorization: "signature" | "none" | "caller";
|
|
413
|
-
sigNonce: bigint;
|
|
414
|
-
deadline: bigint;
|
|
415
|
-
permit: {
|
|
416
|
-
deadline: bigint;
|
|
417
|
-
};
|
|
418
|
-
};
|
|
419
|
-
creditOutputs: {
|
|
420
|
-
commitment: `0x${string}`;
|
|
421
|
-
amount: bigint;
|
|
422
|
-
expiry: bigint;
|
|
423
|
-
owner: `0x${string}`;
|
|
424
|
-
spender: `0x${string}`;
|
|
425
|
-
ownerPayout: bigint;
|
|
426
|
-
spenderPayout: bigint;
|
|
427
|
-
}[] | undefined;
|
|
428
|
-
outputs: {
|
|
429
|
-
commitment: `0x${string}`;
|
|
430
|
-
to: string;
|
|
431
|
-
amount: bigint;
|
|
432
|
-
change: boolean;
|
|
433
|
-
}[];
|
|
434
|
-
capacity: number | undefined;
|
|
435
|
-
deadline: bigint;
|
|
436
|
-
feeRecipient: `0x${string}` | undefined;
|
|
437
|
-
feeAmount: bigint;
|
|
438
|
-
fundingAmount: bigint;
|
|
439
|
-
fundingPayer: `0x${string}` | undefined;
|
|
440
|
-
withdrawalAmount: bigint;
|
|
441
|
-
withdrawalAddress: `0x${string}` | undefined;
|
|
442
|
-
permissions: {
|
|
443
|
-
walletAuthorization: boolean;
|
|
444
|
-
proof: boolean;
|
|
445
|
-
fundingAuthorization: boolean;
|
|
446
|
-
};
|
|
447
|
-
};
|
|
448
|
-
private current;
|
|
449
|
-
private stage;
|
|
450
|
-
private signingCurrent;
|
|
451
|
-
/** Public EIP-712 request; signing transport and key custody belong to the caller. */
|
|
452
|
-
exportWalletAuthorization(options?: {
|
|
453
|
-
signal?: AbortSignal;
|
|
454
|
-
}): Promise<_invisi_labs_core.SigningRequest>;
|
|
455
|
-
/** Attach an external EOA signature, retaining its witness only at the private proving boundary. */
|
|
456
|
-
withWalletSignature(signature: string, options?: {
|
|
457
|
-
signal?: AbortSignal;
|
|
458
|
-
}): Promise<Operation>;
|
|
459
|
-
/** Export only after proving when the funding authorization binds an actual proof hash. */
|
|
460
|
-
exportFundingAuthorization(options?: {
|
|
461
|
-
signal?: AbortSignal;
|
|
462
|
-
}): Promise<_invisi_labs_core.SigningRequest>;
|
|
463
|
-
/** Verify an external signature against this handle's own frozen operation. */
|
|
464
|
-
withFundingSignature(signature: string, options?: {
|
|
465
|
-
signal?: AbortSignal;
|
|
466
|
-
}): Promise<Operation>;
|
|
467
|
-
authorize(options?: {
|
|
468
|
-
signal?: AbortSignal;
|
|
469
|
-
}): Promise<Operation>;
|
|
470
|
-
prove(suppliedOptions?: TransactionProveOptions): Promise<Operation>;
|
|
471
|
-
private encode;
|
|
472
|
-
authorizeFunding(options?: {
|
|
473
|
-
signal?: AbortSignal;
|
|
474
|
-
}): Promise<Operation>;
|
|
475
|
-
/** Shield caller funding needs no wallet signing or proof; this step only encodes its frozen request. */
|
|
476
|
-
ready(): Promise<Operation>;
|
|
477
|
-
private validateExport;
|
|
478
|
-
exportTransaction(options?: {
|
|
479
|
-
signal?: AbortSignal;
|
|
480
|
-
}): Promise<TransactionCall>;
|
|
481
|
-
exportAggregateMember(): Promise<OperationAggregateMember>;
|
|
482
|
-
abandon(): Promise<Operation>;
|
|
483
|
-
/** Record an application-owned signed/broadcast transaction. This never sends or waits. */
|
|
484
|
-
trackTransaction(transactionHash: string): Promise<Operation>;
|
|
485
|
-
reconcile(options?: {
|
|
486
|
-
transactionHash?: Hex;
|
|
487
|
-
signal?: AbortSignal;
|
|
488
|
-
}): Promise<Operation>;
|
|
489
|
-
toJSON(): {
|
|
490
|
-
id: string;
|
|
491
|
-
kind: "shield" | "transfer" | "create-credit" | "draw-credit" | "top-up-credit" | "cancel-credit";
|
|
492
|
-
status: OperationStatus;
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
interface DiscoveryContext {
|
|
497
|
-
chainId: bigint;
|
|
498
|
-
protocolAddress: Address;
|
|
499
|
-
}
|
|
500
|
-
/** Decoded logs from complete canonical transaction receipts, including insertion logs. */
|
|
501
|
-
interface DeliveryEventLog {
|
|
502
|
-
address: string;
|
|
503
|
-
eventName: string;
|
|
504
|
-
args?: Record<string, unknown>;
|
|
505
|
-
blockNumber?: bigint | null;
|
|
506
|
-
blockHash?: Hex | null;
|
|
507
|
-
transactionHash?: Hex | null;
|
|
508
|
-
logIndex?: number | null;
|
|
509
|
-
removed?: boolean;
|
|
510
|
-
}
|
|
511
|
-
interface DeliveryCandidate {
|
|
512
|
-
tokenAddress: Address;
|
|
513
|
-
treeId: bigint;
|
|
514
|
-
leafIndex: number;
|
|
515
|
-
commitment: Hex;
|
|
516
|
-
role: "funds" | "owner" | "spender";
|
|
517
|
-
delivery: {
|
|
518
|
-
ciphertext: Hex;
|
|
519
|
-
clue: Hex;
|
|
520
|
-
};
|
|
521
|
-
blockNumber: bigint;
|
|
522
|
-
blockHash: Hex;
|
|
523
|
-
transactionHash: Hex;
|
|
524
|
-
}
|
|
525
|
-
interface DiscoveredNote extends Omit<DeliveryCandidate, "delivery" | "role"> {
|
|
526
|
-
note: Note;
|
|
527
|
-
}
|
|
528
|
-
interface DiscoveredCredit extends Omit<DeliveryCandidate, "delivery"> {
|
|
529
|
-
role: "owner" | "spender";
|
|
530
|
-
state: CreditDeliveryState;
|
|
531
|
-
}
|
|
532
|
-
/** Authenticate private deliveries from a single batch of canonical receipts. */
|
|
533
|
-
declare function decryptCandidates(logs: readonly DeliveryEventLog[], options: {
|
|
534
|
-
context: DiscoveryContext;
|
|
535
|
-
viewing: Pick<ViewingCapability, "ownerAddress" | "decryptNote" | "decryptCredit">;
|
|
536
|
-
confirmedThrough: bigint;
|
|
537
|
-
}): Promise<{
|
|
538
|
-
notes: DiscoveredNote[];
|
|
539
|
-
credits: DiscoveredCredit[];
|
|
540
|
-
}>;
|
|
541
|
-
|
|
542
|
-
interface RefreshResult {
|
|
543
|
-
block: CanonicalBlock;
|
|
544
|
-
notes: number;
|
|
545
|
-
credits: number;
|
|
546
|
-
balances: BalanceSnapshot[];
|
|
547
|
-
}
|
|
548
|
-
interface RefreshOptions {
|
|
549
|
-
/** Explicit history range; retain the returned block to request the next page later. */
|
|
550
|
-
fromBlock: bigint;
|
|
551
|
-
/** Defaults to the Protocol RPC's indexed head, independently checked against Chain RPC. */
|
|
552
|
-
toBlock?: bigint;
|
|
553
|
-
/** Explicit permission to delegate detection; never provide a viewing or spending key. */
|
|
554
|
-
detectionKey?: Uint8Array;
|
|
555
|
-
/** Defaults to MAX_UPDATE_BLOCKS (10000 blocks) per service request. Reduce this on high-volume deployments. */
|
|
556
|
-
pageSize?: number;
|
|
557
|
-
signal?: AbortSignal;
|
|
558
|
-
/** Rebuild private inventory from these pages while retaining uncertain operations. */
|
|
559
|
-
reset?: boolean;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
declare function operationPreview(plan: OperationPlan, status: OperationStatus): {
|
|
563
|
-
id: string;
|
|
564
|
-
kind: "shield" | "transfer" | "create-credit" | "draw-credit" | "top-up-credit" | "cancel-credit";
|
|
565
|
-
status: OperationStatus;
|
|
566
|
-
context: {
|
|
567
|
-
tokenAddress: _invisi_labs_core.Address;
|
|
568
|
-
now?: bigint;
|
|
569
|
-
timestamp?: bigint;
|
|
570
|
-
chainId: bigint;
|
|
571
|
-
protocolAddress: _invisi_labs_core.Address;
|
|
572
|
-
};
|
|
573
|
-
inputs: number;
|
|
574
|
-
inputDetails: ({
|
|
575
|
-
kind: "notes";
|
|
576
|
-
commitment: `0x${string}`;
|
|
577
|
-
amount: bigint;
|
|
578
|
-
owner: `0x${string}`;
|
|
579
|
-
treeId: bigint;
|
|
580
|
-
leafIndex: number;
|
|
581
|
-
} | {
|
|
582
|
-
kind: "credits";
|
|
583
|
-
commitment: `0x${string}`;
|
|
584
|
-
amount: bigint;
|
|
585
|
-
owner: `0x${string}`;
|
|
586
|
-
spender: `0x${string}`;
|
|
587
|
-
expiry: bigint;
|
|
588
|
-
role: "owner" | "spender";
|
|
589
|
-
treeId: bigint;
|
|
590
|
-
leafIndex: number;
|
|
591
|
-
})[];
|
|
592
|
-
funding: {
|
|
593
|
-
payer: `0x${string}`;
|
|
594
|
-
amount: bigint;
|
|
595
|
-
authorization: "signature" | "none" | "caller";
|
|
596
|
-
sigNonce: bigint;
|
|
597
|
-
deadline: bigint;
|
|
598
|
-
permit: {
|
|
599
|
-
deadline: bigint;
|
|
600
|
-
};
|
|
601
|
-
};
|
|
602
|
-
creditOutputs: {
|
|
603
|
-
commitment: `0x${string}`;
|
|
604
|
-
amount: bigint;
|
|
605
|
-
expiry: bigint;
|
|
606
|
-
owner: `0x${string}`;
|
|
607
|
-
spender: `0x${string}`;
|
|
608
|
-
ownerPayout: bigint;
|
|
609
|
-
spenderPayout: bigint;
|
|
610
|
-
}[] | undefined;
|
|
611
|
-
outputs: {
|
|
612
|
-
commitment: `0x${string}`;
|
|
613
|
-
to: string;
|
|
614
|
-
amount: bigint;
|
|
615
|
-
change: boolean;
|
|
616
|
-
}[];
|
|
617
|
-
capacity: number | undefined;
|
|
618
|
-
deadline: bigint;
|
|
619
|
-
feeRecipient: `0x${string}` | undefined;
|
|
620
|
-
feeAmount: bigint;
|
|
621
|
-
fundingAmount: bigint;
|
|
622
|
-
fundingPayer: `0x${string}` | undefined;
|
|
623
|
-
withdrawalAmount: bigint;
|
|
624
|
-
withdrawalAddress: `0x${string}` | undefined;
|
|
625
|
-
permissions: {
|
|
626
|
-
walletAuthorization: boolean;
|
|
627
|
-
proof: boolean;
|
|
628
|
-
fundingAuthorization: boolean;
|
|
629
|
-
};
|
|
630
|
-
};
|
|
631
|
-
|
|
632
|
-
/** Private application data. Never send this view to public analytics. */
|
|
633
|
-
interface OutgoingHistoryEntry extends Omit<ReturnType<typeof operationPreview>, "outputs"> {
|
|
634
|
-
preparedAt: {
|
|
635
|
-
number: bigint;
|
|
636
|
-
hash: Hex;
|
|
637
|
-
timestamp: bigint;
|
|
638
|
-
};
|
|
639
|
-
transactionHash?: Hex;
|
|
640
|
-
outputs: {
|
|
641
|
-
to: string;
|
|
642
|
-
amount: bigint;
|
|
643
|
-
change: boolean;
|
|
644
|
-
commitment: Hex;
|
|
645
|
-
payload: Uint8Array;
|
|
646
|
-
}[];
|
|
647
|
-
}
|
|
648
|
-
interface IncomingHistoryEntry extends ReceiptPosition {
|
|
649
|
-
tokenAddress: Hex;
|
|
650
|
-
amount: bigint;
|
|
651
|
-
payload: Uint8Array;
|
|
652
|
-
spent: SpentState;
|
|
653
|
-
}
|
|
654
|
-
interface WalletHistory {
|
|
655
|
-
revision: number;
|
|
656
|
-
checkedThrough: Checkpoint | null;
|
|
657
|
-
invalidated: boolean;
|
|
658
|
-
/** Local construction records; not proof of a mined payment or funding identity. */
|
|
659
|
-
outgoing: OutgoingHistoryEntry[];
|
|
660
|
-
/** Authenticated incoming funds outputs, including already consumed ones. */
|
|
661
|
-
incoming: IncomingHistoryEntry[];
|
|
662
|
-
}
|
|
663
|
-
interface HistoryOptions {
|
|
664
|
-
tokenAddress?: Hex;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
/** Native ethers transaction options; the exported business call and session chain remain fixed. */
|
|
668
|
-
type SessionTransactionOptions = Omit<TransactionRequest, "to" | "from" | "data" | "value" | "chainId">;
|
|
669
|
-
/** Wallet state and operations, with infrastructure and permissions explicitly injected. */
|
|
670
|
-
declare class WalletSession {
|
|
671
|
-
#private;
|
|
672
|
-
readonly scope: WalletScope;
|
|
673
|
-
readonly protocol: Protocol$1;
|
|
674
|
-
constructor(options: WalletSessionOptions);
|
|
675
|
-
sendTransaction(call: TransactionCall, options?: SessionTransactionOptions): Promise<TransactionResponse>;
|
|
676
|
-
sendTransaction(operation: Operation, options?: SessionTransactionOptions): Promise<TransactionResponse>;
|
|
677
|
-
private runtime;
|
|
678
|
-
private updater;
|
|
679
|
-
/** Local session commits only. Host applications own cross-tab/store subscriptions. */
|
|
680
|
-
subscribe(listener: () => void): () => void;
|
|
681
|
-
/** Detached history for wallet UI; construction records do not imply chain success. */
|
|
682
|
-
getHistory(options?: HistoryOptions): Promise<WalletHistory>;
|
|
683
|
-
balance(tokenAddress: `0x${string}`): Promise<BalanceSnapshot>;
|
|
684
|
-
/** Pull explicitly selected indexed pages; no chain scanning or public tree reconstruction. */
|
|
685
|
-
refresh(options: RefreshOptions): Promise<RefreshResult>;
|
|
686
|
-
private preparation;
|
|
687
|
-
prepareTransfer(options: TransferPreparation): Promise<Operation>;
|
|
688
|
-
prepareShield(options: ShieldPreparation): Promise<Operation>;
|
|
689
|
-
prepareCreateCredit(options: CreateCreditPreparation): Promise<Operation>;
|
|
690
|
-
prepareDrawCredit(options: DrawCreditPreparation): Promise<Operation>;
|
|
691
|
-
prepareTopUpCredit(options: TopUpCreditPreparation): Promise<Operation>;
|
|
692
|
-
prepareCancelCredit(options: CancelCreditPreparation): Promise<Operation>;
|
|
693
|
-
resume(operationId: string): Promise<Operation>;
|
|
694
|
-
toJSON(): {
|
|
695
|
-
walletSession: boolean;
|
|
696
|
-
ownerAddress: `0x${string}`;
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
/** Compose independent Chain RPC and indexed Protocol RPC with local wallet capabilities. */
|
|
701
|
-
type InvisiInfrastructure = Omit<WalletSessionInfrastructure, "wallet" | "protocol" | "namespace" | "viewing" | "authorization" | "chainReader" | "signer" | "fundingSigner"> & {
|
|
702
|
-
provider?: Provider;
|
|
703
|
-
chainReader?: ChainReader;
|
|
704
|
-
};
|
|
705
|
-
type InvisiOptions = InvisiInfrastructure;
|
|
706
|
-
/** Public wallet and registry-specific inputs; signing remains external. */
|
|
707
|
-
type RegistrationPreparationOptions = Pick<RegistrationPreparation, "update" | "deadline"> & Pick<TransactionIdentity, "wallet">;
|
|
708
|
-
/** Owner address and session permissions; shared infrastructure belongs to InvisiOptions. */
|
|
709
|
-
type ConnectionOptions = Pick<WalletSessionOptions, "wallet" | "protocol" | "namespace" | "viewing" | "authorization" | "signer" | "fundingSigner">;
|
|
710
|
-
/** A neutral composition entry point; every resolved instance owns an independent session. */
|
|
711
|
-
declare class Invisi {
|
|
712
|
-
#private;
|
|
713
|
-
constructor(options?: InvisiOptions);
|
|
714
|
-
connect(options: ConnectionOptions): Promise<WalletSession>;
|
|
715
|
-
private resolve;
|
|
716
|
-
/** Discover the selected chain's registry and prepare an independent signing request. */
|
|
717
|
-
prepareRegistration(options: RegistrationPreparationOptions): Promise<RegistrationOperation>;
|
|
718
|
-
private assertPublicIdentity;
|
|
719
|
-
private resolveExplicit;
|
|
720
|
-
prepareTransfer(options: ExplicitTransferPreparation): Promise<PreparedTransaction>;
|
|
721
|
-
prepareShield(options: ExplicitShieldPreparation): Promise<PreparedTransaction>;
|
|
722
|
-
prepareCreateCredit(options: ExplicitCreateCreditPreparation): Promise<PreparedTransaction>;
|
|
723
|
-
prepareDrawCredit(options: ExplicitDrawCreditPreparation): Promise<PreparedTransaction>;
|
|
724
|
-
prepareTopUpCredit(options: ExplicitTopUpCreditPreparation): Promise<PreparedTransaction>;
|
|
725
|
-
prepareCancelCredit(options: ExplicitCancelCreditPreparation): Promise<PreparedTransaction>;
|
|
726
|
-
toJSON(): {
|
|
727
|
-
invisi: boolean;
|
|
728
|
-
};
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
/** Deployment operations and token-compatible broadcaster discovery. */
|
|
67
|
+
/** Deployment operations and transaction-compatible broadcaster discovery. */
|
|
732
68
|
declare class Protocol extends Protocol$1 {
|
|
733
|
-
static fromRpc(rpc: Pick<ProtocolRpcClient$1, "getDeployment"> & Partial<Pick<ProtocolRpcClient$1, "getBroadcasters">>, provider: Provider, options?: {
|
|
69
|
+
static fromRpc(rpc: Pick<ProtocolRpcClient$1, "getDeployment"> & Partial<Pick<ProtocolRpcClient$1, "getBroadcasters" | "withReader">>, provider: Provider, options?: {
|
|
734
70
|
signal?: AbortSignal;
|
|
735
71
|
}): Promise<Protocol>;
|
|
736
|
-
/**
|
|
72
|
+
/** Discover token support without disclosing a transaction or requesting a price. */
|
|
737
73
|
getBroadcasters(options: {
|
|
738
74
|
tokenAddress: string;
|
|
75
|
+
signal?: AbortSignal;
|
|
739
76
|
}): Promise<BroadcasterClient[]>;
|
|
740
77
|
}
|
|
741
78
|
|
|
742
|
-
/** Protocol RPC transport with ethers provider integration for independent chain checks. */
|
|
743
|
-
declare class ProtocolRpcClient extends ProtocolRpcClient$1 {
|
|
744
|
-
withProvider(provider: Provider): ProtocolRpcClient$1;
|
|
745
|
-
}
|
|
746
|
-
|
|
747
79
|
/** Registry operations accept the application's existing ethers provider. */
|
|
748
80
|
declare class AddressRegistry extends AddressRegistry$1 {
|
|
749
81
|
prepareRegistration(options: RegistrationPreparation | (Omit<RegistrationPreparation, "reader"> & {
|
|
750
82
|
provider: Provider;
|
|
751
|
-
})): Promise<
|
|
83
|
+
})): Promise<_invisi_labs_rpc.RegistrationOperation>;
|
|
752
84
|
}
|
|
753
85
|
|
|
754
86
|
interface BroadcasterRegistration {
|
|
@@ -788,27 +120,72 @@ declare class BroadcasterRegistry {
|
|
|
788
120
|
}): Promise<RegisteredBroadcaster[]>;
|
|
789
121
|
}
|
|
790
122
|
|
|
791
|
-
/**
|
|
792
|
-
declare class
|
|
123
|
+
/** Protocol RPC transport with ethers provider integration for independent chain checks. */
|
|
124
|
+
declare class ProtocolRpcClient extends ProtocolRpcClient$1 {
|
|
125
|
+
withProvider(provider: Provider): ProtocolRpcClient$1;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Encode only the request, never the current output nonce or local registry lookup choice. */
|
|
129
|
+
declare function encodePaymentRequest(request: PaymentRequest): string;
|
|
130
|
+
/** Decode a canonical Note request offline, with exact resource and byte-layout checks. */
|
|
131
|
+
declare function decodePaymentRequest(encoded: string): PaymentRequest;
|
|
132
|
+
|
|
133
|
+
/** Complete opening of one funds Note. Never contains wallet keys or application payload. */
|
|
134
|
+
interface PaymentNoteData {
|
|
135
|
+
chainId: bigint;
|
|
136
|
+
protocolAddress: Hex;
|
|
137
|
+
tokenAddress: Hex;
|
|
138
|
+
amount: bigint;
|
|
139
|
+
ownerAddress: Hex;
|
|
140
|
+
nonce: bigint;
|
|
141
|
+
commitment: Hex;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** Supply connections for manually constructed Protocols; fromRpc connections are reused. */
|
|
145
|
+
type PaymentNoteVerificationOptions = {
|
|
146
|
+
protocolRpc: Pick<ProtocolRpcClient$1, "withReader">;
|
|
147
|
+
confirmations?: number;
|
|
148
|
+
} & ({
|
|
149
|
+
provider: Provider;
|
|
150
|
+
chainReader?: never;
|
|
151
|
+
} | {
|
|
152
|
+
chainReader: ChainReader;
|
|
153
|
+
provider?: never;
|
|
154
|
+
});
|
|
155
|
+
type PaymentNoteVerificationSettings = {
|
|
156
|
+
confirmations?: number;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
declare class VerifiedPaymentNote {
|
|
793
160
|
#private;
|
|
161
|
+
constructor(token: symbol, membership: Membership, checkedAt: CanonicalBlock);
|
|
162
|
+
get membership(): Membership;
|
|
163
|
+
get checkedAt(): CanonicalBlock;
|
|
164
|
+
}
|
|
165
|
+
declare class SpendablePaymentNote extends VerifiedPaymentNote {
|
|
166
|
+
#private;
|
|
167
|
+
constructor(token: symbol, input: NoteInput, membership: Membership, checkedAt: CanonicalBlock, spendabilityCheckedAt: CanonicalBlock);
|
|
168
|
+
get spendabilityCheckedAt(): CanonicalBlock;
|
|
169
|
+
toInput(): NoteInput;
|
|
170
|
+
}
|
|
171
|
+
/** A validated Note opening, independent of an indexed wallet store. */
|
|
172
|
+
declare class PaymentNote implements PaymentNoteData {
|
|
173
|
+
readonly chainId: bigint;
|
|
174
|
+
readonly protocolAddress: PaymentNoteData["protocolAddress"];
|
|
175
|
+
readonly tokenAddress: PaymentNoteData["tokenAddress"];
|
|
176
|
+
readonly amount: bigint;
|
|
177
|
+
readonly ownerAddress: PaymentNoteData["ownerAddress"];
|
|
178
|
+
readonly nonce: bigint;
|
|
179
|
+
readonly commitment: PaymentNoteData["commitment"];
|
|
180
|
+
readonly ipn: string;
|
|
794
181
|
private constructor();
|
|
795
|
-
static
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
key: string;
|
|
800
|
-
revision: number;
|
|
801
|
-
}): Promise<Uint8Array>;
|
|
802
|
-
decode(data: Uint8Array, context: {
|
|
803
|
-
key: string;
|
|
804
|
-
revision: number;
|
|
805
|
-
}): Promise<WalletState>;
|
|
806
|
-
toJSON(): {
|
|
807
|
-
walletRecordCodec: string;
|
|
808
|
-
};
|
|
182
|
+
static from(ipn: string): Promise<PaymentNote>;
|
|
183
|
+
verify(protocol: Protocol$1, options?: PaymentNoteVerificationOptions | PaymentNoteVerificationSettings): Promise<VerifiedPaymentNote>;
|
|
184
|
+
verifySpendable(protocol: Protocol$1, wallet: Wallet, options?: PaymentNoteVerificationOptions | PaymentNoteVerificationSettings): Promise<SpendablePaymentNote>;
|
|
185
|
+
private data;
|
|
809
186
|
}
|
|
810
187
|
|
|
811
|
-
|
|
812
|
-
declare function
|
|
188
|
+
declare function encodePaymentNote(value: PaymentNoteData): string;
|
|
189
|
+
declare function decodePaymentNote(encoded: string): PaymentNoteData;
|
|
813
190
|
|
|
814
|
-
export { AddressRegistry,
|
|
191
|
+
export { AddressRegistry, BroadcasterClient, type BroadcasterRegistration, BroadcasterRegistry, type BroadcasterRegistryOptions, type DisclosureEvidence, type DisclosureReader, type DisclosureReference, DisclosureVerifier, type DisclosureVerifierOptions, NoteInput, PaymentNote, type PaymentNoteData, type PaymentNoteVerificationOptions, type PaymentNoteVerificationSettings, PaymentRequest, Protocol, ProtocolRpcClient, type RegisteredBroadcaster, SpendablePaymentNote, type VerifiedDisclosure, VerifiedPaymentNote, decodePaymentNote, decodePaymentRequest, encodePaymentNote, encodePaymentRequest };
|