@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
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { e as OperationPlan, s as SavedOperation, T as TransactionRuntime, f as TransactionProveOptions, F as FundingSigner, c as FundingAuthorizationVerifier, O as OperationStatus, t as PreparationRuntime, r as TransferPreparation, S as ShieldPreparation, C as CreateCreditPreparation, D as DrawCreditPreparation, U as UpdateCreditPreparation, R as RevokeCreditPreparation, h as TransactionInfrastructure } from './operation-bridge-CoECSxfi.cjs';
|
|
2
|
+
export { A as AddressLookup, i as BroadcasterClient, k as BroadcasterFeeSource, l as BroadcasterQuoteOptions, B as BroadcasterTransaction, u as Checkpoint, v as CoinSelector, w as CreditPlan, x as CreditRecord, m as FundingSource, b as FundingTypedData, L as LocalOperationSecrets, N as NoteOutput, y as NoteRecord, g as OperationAggregateMember, d as PreparationIntent, z as PreparationInventory, E as PreparedCreditInput, G as PreparedCreditOutput, H as PreparedOutput, a as PreparedProvenanceCapability, I as ReceiptPosition, J as SpentState, q as TransactionExecution, W as WalletScope, K as bindBroadcasterOperation, M as configureRecipientInfrastructure, Q as creditReservationKey, V as prepareBroadcasterPlan, X as prepareIntent, Y as prepareProvenance, Z as provePreparedProvenance, _ as recipientLookup, $ as validateBroadcastEnvelope, a0 as validatePreparedBroadcast } from './operation-bridge-CoECSxfi.cjs';
|
|
3
|
+
import { Hex as Hex$1, InputSource, Address } from '@invisi-labs/protocol/contracts';
|
|
4
|
+
export { h as DeliveryCandidate, D as DeliveryEventLog, a as DiscoveredCredit, b as DiscoveredNote, i as DiscoveryContext, I as Invisi, c as InvisiError, d as InvisiErrorCode, e as InvisiErrorDetails, g as decryptCandidates, j as extractDeliveryCandidates, p as prepareWithErrors, r as readProtocolLogs } from './receipt-logs-DWG4In8N.cjs';
|
|
5
|
+
import * as _invisi_labs_protocol from '@invisi-labs/protocol';
|
|
6
|
+
import { ChainReader, TransactionContext, CanonicalBlock, Membership, TransactionCall } from '@invisi-labs/protocol';
|
|
7
|
+
export { DocumentedGasReference, DocumentedGasShape, getDocumentedGasReference } from '@invisi-labs/protocol';
|
|
8
|
+
import { TokenProtocol } from '@invisi-labs/rpc';
|
|
9
|
+
import * as _invisi_labs_primitives from '@invisi-labs/primitives';
|
|
10
|
+
import { AuthorizedStatement, CreditDeliveryState } from '@invisi-labs/primitives';
|
|
11
|
+
import * as _invisi_labs_prover from '@invisi-labs/prover';
|
|
12
|
+
import { Prover, ProofBundle, ProofStatement, ProvingRequest } from '@invisi-labs/prover';
|
|
13
|
+
export { TransactionOutput } from './note.cjs';
|
|
14
|
+
export { BroadcasterConfiguration, BroadcasterEstimate, BroadcasterQuote, BroadcasterRpcError, BroadcasterStatus, BroadcasterTransport, BroadcasterTrust, SignedBroadcasterQuote, broadcasterQuoteDomain, broadcasterQuoteTypes, broadcasterRequestHash, broadcasterTransactInterface, decodeBroadcasterIntent, verifyBroadcasterQuote } from '@invisi-labs/rpc/broadcaster';
|
|
15
|
+
import '@invisi-labs/protocol/provenance';
|
|
16
|
+
import '@invisi-labs/prover/provenance-witness';
|
|
17
|
+
import '@invisi-labs/rpc/provenance';
|
|
18
|
+
import 'ethers';
|
|
19
|
+
import './index-CLhGwLxZ.cjs';
|
|
20
|
+
|
|
21
|
+
/** Quote-only export; callers still need the operation-specific proof or owner authorization. */
|
|
22
|
+
declare function exportBroadcasterIntent(plan: OperationPlan): {
|
|
23
|
+
sendable: false;
|
|
24
|
+
data: Hex$1;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
declare function verifyMembership(reader: ChainReader, context: TransactionContext, block: CanonicalBlock, input: {
|
|
28
|
+
treeId: bigint;
|
|
29
|
+
leafIndex: number;
|
|
30
|
+
commitment: Hex$1;
|
|
31
|
+
}, proof: Membership): Promise<void>;
|
|
32
|
+
|
|
33
|
+
/** Decode only canonical protocol receipt bytes before routing events to token wallets. */
|
|
34
|
+
declare function decodeProtocolEvent(log: {
|
|
35
|
+
data: string;
|
|
36
|
+
topics: readonly string[];
|
|
37
|
+
}): {
|
|
38
|
+
eventName: string;
|
|
39
|
+
args: {
|
|
40
|
+
[k: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** A pre-proof documented scenario reference; conditions remain visible in the result. */
|
|
45
|
+
declare function getOperationGasReference(plan: OperationPlan, _protocol?: TokenProtocol): _invisi_labs_protocol.DocumentedGasReference;
|
|
46
|
+
|
|
47
|
+
declare function encodeOperation(saved: SavedOperation): Promise<TransactionCall>;
|
|
48
|
+
|
|
49
|
+
declare function proveOperation(protocol: TokenProtocol, plan: OperationPlan, authorization: AuthorizedStatement | undefined, prover: Prover, options: TransactionProveOptions): Promise<_invisi_labs_prover.ProofBundle>;
|
|
50
|
+
declare function signOperationFunding(saved: SavedOperation, signer: FundingSigner, verifier?: FundingAuthorizationVerifier): Promise<`0x${string}`>;
|
|
51
|
+
/** Export only typed commitments, never private note openings or authorization witnesses. */
|
|
52
|
+
declare function walletSigningRequest(plan: OperationPlan): _invisi_labs_primitives.SigningRequest;
|
|
53
|
+
/** Recover the EOA key and build the existing private witness without receiving a private key. */
|
|
54
|
+
declare function acceptWalletSignature(plan: OperationPlan, signature: string): Promise<AuthorizedStatement>;
|
|
55
|
+
/** The remote round trip may outlive the nonce or deadline selected during preparation. */
|
|
56
|
+
declare function fundingSigningRequest(saved: SavedOperation, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<_invisi_labs_primitives.SigningRequest>;
|
|
57
|
+
/** Verify against reconstructed operation data, never caller-supplied typed data. */
|
|
58
|
+
declare function acceptFundingSignature(saved: SavedOperation, signature: string, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<`0x${string}`>;
|
|
59
|
+
|
|
60
|
+
declare function operationPreview(plan: OperationPlan, status: OperationStatus): {
|
|
61
|
+
id: string;
|
|
62
|
+
kind: "create-credit" | "update-credit" | "transfer" | "shield" | "draw-credit" | "revoke-credit";
|
|
63
|
+
status: OperationStatus;
|
|
64
|
+
context: {
|
|
65
|
+
tokenAddress: _invisi_labs_primitives.Address;
|
|
66
|
+
now?: bigint;
|
|
67
|
+
timestamp?: bigint;
|
|
68
|
+
chainId: bigint;
|
|
69
|
+
protocolAddress: _invisi_labs_primitives.Address;
|
|
70
|
+
};
|
|
71
|
+
inputs: number;
|
|
72
|
+
inputDetails: ({
|
|
73
|
+
kind: "notes";
|
|
74
|
+
commitment: `0x${string}`;
|
|
75
|
+
amount: bigint;
|
|
76
|
+
owner: `0x${string}`;
|
|
77
|
+
treeId: bigint;
|
|
78
|
+
leafIndex: number;
|
|
79
|
+
} | {
|
|
80
|
+
kind: "credits";
|
|
81
|
+
commitment: `0x${string}`;
|
|
82
|
+
revocationShard: bigint;
|
|
83
|
+
revocationSlot: bigint;
|
|
84
|
+
owner: `0x${string}`;
|
|
85
|
+
spender: `0x${string}`;
|
|
86
|
+
expiry: bigint;
|
|
87
|
+
availableCredit: bigint;
|
|
88
|
+
unlimited: boolean;
|
|
89
|
+
role: "owner" | "spender";
|
|
90
|
+
treeId: bigint;
|
|
91
|
+
leafIndex: number;
|
|
92
|
+
})[];
|
|
93
|
+
funding: {
|
|
94
|
+
payer: `0x${string}`;
|
|
95
|
+
amount: bigint;
|
|
96
|
+
authorization: "signature" | "none" | "caller";
|
|
97
|
+
sigNonce: bigint;
|
|
98
|
+
deadline: bigint;
|
|
99
|
+
permit: {
|
|
100
|
+
deadline: bigint;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
creditOutputs: {
|
|
104
|
+
lastDay: bigint;
|
|
105
|
+
dailySpent: bigint;
|
|
106
|
+
lastMonth: bigint;
|
|
107
|
+
monthlySpent: bigint;
|
|
108
|
+
totalSpent: bigint;
|
|
109
|
+
availableCredit: bigint;
|
|
110
|
+
unlimited: boolean;
|
|
111
|
+
singleLimit: bigint;
|
|
112
|
+
dailyLimit: bigint;
|
|
113
|
+
monthlyLimit: bigint;
|
|
114
|
+
commitment: `0x${string}`;
|
|
115
|
+
revocationShard: bigint;
|
|
116
|
+
revocationSlot: bigint;
|
|
117
|
+
expiry: bigint;
|
|
118
|
+
owner: `0x${string}`;
|
|
119
|
+
spender: `0x${string}`;
|
|
120
|
+
}[] | undefined;
|
|
121
|
+
creditUpdate: _invisi_labs_primitives.CreditUpdateChanges | undefined;
|
|
122
|
+
creditDraw: {
|
|
123
|
+
grossAmount: bigint;
|
|
124
|
+
feeAmount: bigint;
|
|
125
|
+
netAmount: bigint;
|
|
126
|
+
payers: {
|
|
127
|
+
payer: _invisi_labs_primitives.Address;
|
|
128
|
+
amount: bigint;
|
|
129
|
+
}[];
|
|
130
|
+
} | undefined;
|
|
131
|
+
creditFeePayer: `0x${string}` | undefined;
|
|
132
|
+
outputs: {
|
|
133
|
+
commitment: `0x${string}`;
|
|
134
|
+
to: string;
|
|
135
|
+
amount: bigint;
|
|
136
|
+
change: boolean;
|
|
137
|
+
}[];
|
|
138
|
+
capacity: number | undefined;
|
|
139
|
+
deadline: bigint;
|
|
140
|
+
feeRecipient: `0x${string}` | undefined;
|
|
141
|
+
feeAmount: bigint;
|
|
142
|
+
fundingAmount: bigint;
|
|
143
|
+
fundingPayer: `0x${string}` | undefined;
|
|
144
|
+
withdrawalAmount: bigint;
|
|
145
|
+
withdrawalAddress: `0x${string}` | undefined;
|
|
146
|
+
permissions: {
|
|
147
|
+
walletAuthorization: boolean;
|
|
148
|
+
proof: boolean;
|
|
149
|
+
fundingAuthorization: boolean;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
declare function creditLeaf(state: CreditDeliveryState): Promise<Hex$1>;
|
|
154
|
+
/** Rebuild from the original input and delta; cached output balances are never update intent. */
|
|
155
|
+
declare function assertCreditUpdatePlan(plan: OperationPlan): Promise<void>;
|
|
156
|
+
|
|
157
|
+
declare function inputFacts(plan: OperationPlan): Array<{
|
|
158
|
+
key: string;
|
|
159
|
+
reservationKey: string;
|
|
160
|
+
nullifier: Hex$1;
|
|
161
|
+
kind: "notes" | "credits";
|
|
162
|
+
}>;
|
|
163
|
+
declare function operationSources(plan: OperationPlan): readonly InputSource[];
|
|
164
|
+
|
|
165
|
+
/** Shared preparation engine for managed sessions and explicitly supplied inputs. */
|
|
166
|
+
declare class TransactionPreparation<Result> {
|
|
167
|
+
#private;
|
|
168
|
+
readonly context: PreparationRuntime<Result>;
|
|
169
|
+
constructor(context: PreparationRuntime<Result>);
|
|
170
|
+
private runtime;
|
|
171
|
+
private get scope();
|
|
172
|
+
prepareTransfer(options: TransferPreparation): Promise<Result>;
|
|
173
|
+
private funds;
|
|
174
|
+
prepareShield(options: ShieldPreparation): Promise<Result>;
|
|
175
|
+
prepareCreateCredit(options: CreateCreditPreparation): Promise<Result>;
|
|
176
|
+
prepareDrawCredit(options: DrawCreditPreparation): Promise<Result>;
|
|
177
|
+
prepareUpdateCredit(options: UpdateCreditPreparation): Promise<Result>;
|
|
178
|
+
prepareRevokeCredit(options: RevokeCreditPreparation): Promise<Result>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** Match the whole frozen member, including funding nonce, signature and permit, in one successful aggregate. */
|
|
182
|
+
declare function matchesAggregateTransaction(saved: SavedOperation, transaction: TransactionCall & {
|
|
183
|
+
from: Address;
|
|
184
|
+
}): boolean;
|
|
185
|
+
|
|
186
|
+
/** Whitelist the public proof fields; a custom local backend cannot accidentally export its witness. */
|
|
187
|
+
declare function publicProof(bundle: ProofBundle): ProofBundle;
|
|
188
|
+
|
|
189
|
+
declare function sameStatement(proof: ProofBundle, expected: ProofStatement): void;
|
|
190
|
+
|
|
191
|
+
declare function witnessFor(protocol: TokenProtocol, plan: OperationPlan, authorization?: AuthorizedStatement): Promise<ProvingRequest>;
|
|
192
|
+
|
|
193
|
+
type Hex = `0x${string}`;
|
|
194
|
+
|
|
195
|
+
declare function fundingTypedData(saved: SavedOperation): Promise<{
|
|
196
|
+
domain: {
|
|
197
|
+
name: string;
|
|
198
|
+
version: string;
|
|
199
|
+
chainId: bigint;
|
|
200
|
+
verifyingContract: Hex;
|
|
201
|
+
};
|
|
202
|
+
primaryType: "FundShield";
|
|
203
|
+
types: {
|
|
204
|
+
FundShield: readonly [{
|
|
205
|
+
readonly name: "requestHash";
|
|
206
|
+
readonly type: "bytes32";
|
|
207
|
+
}, {
|
|
208
|
+
readonly name: "payer";
|
|
209
|
+
readonly type: "address";
|
|
210
|
+
}, {
|
|
211
|
+
readonly name: "amount";
|
|
212
|
+
readonly type: "uint256";
|
|
213
|
+
}, {
|
|
214
|
+
readonly name: "sigNonce";
|
|
215
|
+
readonly type: "uint256";
|
|
216
|
+
}, {
|
|
217
|
+
readonly name: "deadline";
|
|
218
|
+
readonly type: "uint256";
|
|
219
|
+
}];
|
|
220
|
+
};
|
|
221
|
+
message: {
|
|
222
|
+
requestHash: `0x${string}`;
|
|
223
|
+
payer: `0x${string}`;
|
|
224
|
+
amount: bigint;
|
|
225
|
+
sigNonce: bigint;
|
|
226
|
+
deadline: bigint;
|
|
227
|
+
};
|
|
228
|
+
} | {
|
|
229
|
+
domain: {
|
|
230
|
+
name: string;
|
|
231
|
+
version: string;
|
|
232
|
+
chainId: bigint;
|
|
233
|
+
verifyingContract: Hex;
|
|
234
|
+
};
|
|
235
|
+
primaryType: "FundTransact";
|
|
236
|
+
types: {
|
|
237
|
+
FundTransact: readonly [{
|
|
238
|
+
readonly name: "requestHash";
|
|
239
|
+
readonly type: "bytes32";
|
|
240
|
+
}, {
|
|
241
|
+
readonly name: "payer";
|
|
242
|
+
readonly type: "address";
|
|
243
|
+
}, {
|
|
244
|
+
readonly name: "amount";
|
|
245
|
+
readonly type: "uint256";
|
|
246
|
+
}, {
|
|
247
|
+
readonly name: "sigNonce";
|
|
248
|
+
readonly type: "uint256";
|
|
249
|
+
}, {
|
|
250
|
+
readonly name: "deadline";
|
|
251
|
+
readonly type: "uint256";
|
|
252
|
+
}];
|
|
253
|
+
};
|
|
254
|
+
message: {
|
|
255
|
+
requestHash: `0x${string}`;
|
|
256
|
+
payer: `0x${string}`;
|
|
257
|
+
amount: bigint;
|
|
258
|
+
sigNonce: bigint;
|
|
259
|
+
deadline: bigint;
|
|
260
|
+
};
|
|
261
|
+
}>;
|
|
262
|
+
|
|
263
|
+
declare function requiresAuthorization(plan: OperationPlan): boolean;
|
|
264
|
+
declare function statement(plan: OperationPlan): ProofStatement;
|
|
265
|
+
declare function authorizationRequest(plan: OperationPlan): {
|
|
266
|
+
context: {
|
|
267
|
+
chainId: bigint;
|
|
268
|
+
protocolAddress: bigint;
|
|
269
|
+
};
|
|
270
|
+
operation: "transact" | "create-credit" | "update-credit" | "credit-draw";
|
|
271
|
+
capacity: number;
|
|
272
|
+
words: bigint[];
|
|
273
|
+
};
|
|
274
|
+
declare function operationExpired(plan: OperationPlan, now: bigint): boolean;
|
|
275
|
+
|
|
276
|
+
/** Resolve adapters without starting synchronization or accessing wallet state. */
|
|
277
|
+
declare function configureTransactionInfrastructure<T extends TransactionInfrastructure>(options: T): T;
|
|
278
|
+
/** Validate the selected chain and pinned deployment before any managed state access. */
|
|
279
|
+
declare function validateTransactionInfrastructure(options: TransactionInfrastructure): Promise<void>;
|
|
280
|
+
|
|
281
|
+
declare function revocationSigningRequest(plan: OperationPlan, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<_invisi_labs_primitives.SigningRequest>;
|
|
282
|
+
declare function acceptRevocationSignature(plan: OperationPlan, signature: Hex$1, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<`0x${string}`>;
|
|
283
|
+
|
|
284
|
+
export { CreateCreditPreparation, DrawCreditPreparation, FundingAuthorizationVerifier, FundingSigner, OperationPlan, OperationStatus, PreparationRuntime, RevokeCreditPreparation, SavedOperation, ShieldPreparation, TransactionInfrastructure, TransactionPreparation, TransactionProveOptions, TransactionRuntime, TransferPreparation, UpdateCreditPreparation, acceptFundingSignature, acceptRevocationSignature, acceptWalletSignature, assertCreditUpdatePlan, authorizationRequest, configureTransactionInfrastructure, creditLeaf, decodeProtocolEvent, encodeOperation, exportBroadcasterIntent, fundingSigningRequest, fundingTypedData, getOperationGasReference, inputFacts, matchesAggregateTransaction, operationExpired, operationPreview, operationSources, proveOperation, publicProof, requiresAuthorization, revocationSigningRequest, sameStatement, signOperationFunding, statement, validateTransactionInfrastructure, verifyMembership, walletSigningRequest, witnessFor };
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { e as OperationPlan, s as SavedOperation, T as TransactionRuntime, f as TransactionProveOptions, F as FundingSigner, c as FundingAuthorizationVerifier, O as OperationStatus, t as PreparationRuntime, r as TransferPreparation, S as ShieldPreparation, C as CreateCreditPreparation, D as DrawCreditPreparation, U as UpdateCreditPreparation, R as RevokeCreditPreparation, h as TransactionInfrastructure } from './operation-bridge-CoECSxfi.js';
|
|
2
|
+
export { A as AddressLookup, i as BroadcasterClient, k as BroadcasterFeeSource, l as BroadcasterQuoteOptions, B as BroadcasterTransaction, u as Checkpoint, v as CoinSelector, w as CreditPlan, x as CreditRecord, m as FundingSource, b as FundingTypedData, L as LocalOperationSecrets, N as NoteOutput, y as NoteRecord, g as OperationAggregateMember, d as PreparationIntent, z as PreparationInventory, E as PreparedCreditInput, G as PreparedCreditOutput, H as PreparedOutput, a as PreparedProvenanceCapability, I as ReceiptPosition, J as SpentState, q as TransactionExecution, W as WalletScope, K as bindBroadcasterOperation, M as configureRecipientInfrastructure, Q as creditReservationKey, V as prepareBroadcasterPlan, X as prepareIntent, Y as prepareProvenance, Z as provePreparedProvenance, _ as recipientLookup, $ as validateBroadcastEnvelope, a0 as validatePreparedBroadcast } from './operation-bridge-CoECSxfi.js';
|
|
3
|
+
import { Hex as Hex$1, InputSource, Address } from '@invisi-labs/protocol/contracts';
|
|
4
|
+
export { h as DeliveryCandidate, D as DeliveryEventLog, a as DiscoveredCredit, b as DiscoveredNote, i as DiscoveryContext, I as Invisi, c as InvisiError, d as InvisiErrorCode, e as InvisiErrorDetails, g as decryptCandidates, j as extractDeliveryCandidates, p as prepareWithErrors, r as readProtocolLogs } from './receipt-logs-8Msm_HZS.js';
|
|
5
|
+
import * as _invisi_labs_protocol from '@invisi-labs/protocol';
|
|
6
|
+
import { ChainReader, TransactionContext, CanonicalBlock, Membership, TransactionCall } from '@invisi-labs/protocol';
|
|
7
|
+
export { DocumentedGasReference, DocumentedGasShape, getDocumentedGasReference } from '@invisi-labs/protocol';
|
|
8
|
+
import { TokenProtocol } from '@invisi-labs/rpc';
|
|
9
|
+
import * as _invisi_labs_primitives from '@invisi-labs/primitives';
|
|
10
|
+
import { AuthorizedStatement, CreditDeliveryState } from '@invisi-labs/primitives';
|
|
11
|
+
import * as _invisi_labs_prover from '@invisi-labs/prover';
|
|
12
|
+
import { Prover, ProofBundle, ProofStatement, ProvingRequest } from '@invisi-labs/prover';
|
|
13
|
+
export { TransactionOutput } from './note.js';
|
|
14
|
+
export { BroadcasterConfiguration, BroadcasterEstimate, BroadcasterQuote, BroadcasterRpcError, BroadcasterStatus, BroadcasterTransport, BroadcasterTrust, SignedBroadcasterQuote, broadcasterQuoteDomain, broadcasterQuoteTypes, broadcasterRequestHash, broadcasterTransactInterface, decodeBroadcasterIntent, verifyBroadcasterQuote } from '@invisi-labs/rpc/broadcaster';
|
|
15
|
+
import '@invisi-labs/protocol/provenance';
|
|
16
|
+
import '@invisi-labs/prover/provenance-witness';
|
|
17
|
+
import '@invisi-labs/rpc/provenance';
|
|
18
|
+
import 'ethers';
|
|
19
|
+
import './index-Crp-ZFiM.js';
|
|
20
|
+
|
|
21
|
+
/** Quote-only export; callers still need the operation-specific proof or owner authorization. */
|
|
22
|
+
declare function exportBroadcasterIntent(plan: OperationPlan): {
|
|
23
|
+
sendable: false;
|
|
24
|
+
data: Hex$1;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
declare function verifyMembership(reader: ChainReader, context: TransactionContext, block: CanonicalBlock, input: {
|
|
28
|
+
treeId: bigint;
|
|
29
|
+
leafIndex: number;
|
|
30
|
+
commitment: Hex$1;
|
|
31
|
+
}, proof: Membership): Promise<void>;
|
|
32
|
+
|
|
33
|
+
/** Decode only canonical protocol receipt bytes before routing events to token wallets. */
|
|
34
|
+
declare function decodeProtocolEvent(log: {
|
|
35
|
+
data: string;
|
|
36
|
+
topics: readonly string[];
|
|
37
|
+
}): {
|
|
38
|
+
eventName: string;
|
|
39
|
+
args: {
|
|
40
|
+
[k: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** A pre-proof documented scenario reference; conditions remain visible in the result. */
|
|
45
|
+
declare function getOperationGasReference(plan: OperationPlan, _protocol?: TokenProtocol): _invisi_labs_protocol.DocumentedGasReference;
|
|
46
|
+
|
|
47
|
+
declare function encodeOperation(saved: SavedOperation): Promise<TransactionCall>;
|
|
48
|
+
|
|
49
|
+
declare function proveOperation(protocol: TokenProtocol, plan: OperationPlan, authorization: AuthorizedStatement | undefined, prover: Prover, options: TransactionProveOptions): Promise<_invisi_labs_prover.ProofBundle>;
|
|
50
|
+
declare function signOperationFunding(saved: SavedOperation, signer: FundingSigner, verifier?: FundingAuthorizationVerifier): Promise<`0x${string}`>;
|
|
51
|
+
/** Export only typed commitments, never private note openings or authorization witnesses. */
|
|
52
|
+
declare function walletSigningRequest(plan: OperationPlan): _invisi_labs_primitives.SigningRequest;
|
|
53
|
+
/** Recover the EOA key and build the existing private witness without receiving a private key. */
|
|
54
|
+
declare function acceptWalletSignature(plan: OperationPlan, signature: string): Promise<AuthorizedStatement>;
|
|
55
|
+
/** The remote round trip may outlive the nonce or deadline selected during preparation. */
|
|
56
|
+
declare function fundingSigningRequest(saved: SavedOperation, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<_invisi_labs_primitives.SigningRequest>;
|
|
57
|
+
/** Verify against reconstructed operation data, never caller-supplied typed data. */
|
|
58
|
+
declare function acceptFundingSignature(saved: SavedOperation, signature: string, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<`0x${string}`>;
|
|
59
|
+
|
|
60
|
+
declare function operationPreview(plan: OperationPlan, status: OperationStatus): {
|
|
61
|
+
id: string;
|
|
62
|
+
kind: "create-credit" | "update-credit" | "transfer" | "shield" | "draw-credit" | "revoke-credit";
|
|
63
|
+
status: OperationStatus;
|
|
64
|
+
context: {
|
|
65
|
+
tokenAddress: _invisi_labs_primitives.Address;
|
|
66
|
+
now?: bigint;
|
|
67
|
+
timestamp?: bigint;
|
|
68
|
+
chainId: bigint;
|
|
69
|
+
protocolAddress: _invisi_labs_primitives.Address;
|
|
70
|
+
};
|
|
71
|
+
inputs: number;
|
|
72
|
+
inputDetails: ({
|
|
73
|
+
kind: "notes";
|
|
74
|
+
commitment: `0x${string}`;
|
|
75
|
+
amount: bigint;
|
|
76
|
+
owner: `0x${string}`;
|
|
77
|
+
treeId: bigint;
|
|
78
|
+
leafIndex: number;
|
|
79
|
+
} | {
|
|
80
|
+
kind: "credits";
|
|
81
|
+
commitment: `0x${string}`;
|
|
82
|
+
revocationShard: bigint;
|
|
83
|
+
revocationSlot: bigint;
|
|
84
|
+
owner: `0x${string}`;
|
|
85
|
+
spender: `0x${string}`;
|
|
86
|
+
expiry: bigint;
|
|
87
|
+
availableCredit: bigint;
|
|
88
|
+
unlimited: boolean;
|
|
89
|
+
role: "owner" | "spender";
|
|
90
|
+
treeId: bigint;
|
|
91
|
+
leafIndex: number;
|
|
92
|
+
})[];
|
|
93
|
+
funding: {
|
|
94
|
+
payer: `0x${string}`;
|
|
95
|
+
amount: bigint;
|
|
96
|
+
authorization: "signature" | "none" | "caller";
|
|
97
|
+
sigNonce: bigint;
|
|
98
|
+
deadline: bigint;
|
|
99
|
+
permit: {
|
|
100
|
+
deadline: bigint;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
creditOutputs: {
|
|
104
|
+
lastDay: bigint;
|
|
105
|
+
dailySpent: bigint;
|
|
106
|
+
lastMonth: bigint;
|
|
107
|
+
monthlySpent: bigint;
|
|
108
|
+
totalSpent: bigint;
|
|
109
|
+
availableCredit: bigint;
|
|
110
|
+
unlimited: boolean;
|
|
111
|
+
singleLimit: bigint;
|
|
112
|
+
dailyLimit: bigint;
|
|
113
|
+
monthlyLimit: bigint;
|
|
114
|
+
commitment: `0x${string}`;
|
|
115
|
+
revocationShard: bigint;
|
|
116
|
+
revocationSlot: bigint;
|
|
117
|
+
expiry: bigint;
|
|
118
|
+
owner: `0x${string}`;
|
|
119
|
+
spender: `0x${string}`;
|
|
120
|
+
}[] | undefined;
|
|
121
|
+
creditUpdate: _invisi_labs_primitives.CreditUpdateChanges | undefined;
|
|
122
|
+
creditDraw: {
|
|
123
|
+
grossAmount: bigint;
|
|
124
|
+
feeAmount: bigint;
|
|
125
|
+
netAmount: bigint;
|
|
126
|
+
payers: {
|
|
127
|
+
payer: _invisi_labs_primitives.Address;
|
|
128
|
+
amount: bigint;
|
|
129
|
+
}[];
|
|
130
|
+
} | undefined;
|
|
131
|
+
creditFeePayer: `0x${string}` | undefined;
|
|
132
|
+
outputs: {
|
|
133
|
+
commitment: `0x${string}`;
|
|
134
|
+
to: string;
|
|
135
|
+
amount: bigint;
|
|
136
|
+
change: boolean;
|
|
137
|
+
}[];
|
|
138
|
+
capacity: number | undefined;
|
|
139
|
+
deadline: bigint;
|
|
140
|
+
feeRecipient: `0x${string}` | undefined;
|
|
141
|
+
feeAmount: bigint;
|
|
142
|
+
fundingAmount: bigint;
|
|
143
|
+
fundingPayer: `0x${string}` | undefined;
|
|
144
|
+
withdrawalAmount: bigint;
|
|
145
|
+
withdrawalAddress: `0x${string}` | undefined;
|
|
146
|
+
permissions: {
|
|
147
|
+
walletAuthorization: boolean;
|
|
148
|
+
proof: boolean;
|
|
149
|
+
fundingAuthorization: boolean;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
declare function creditLeaf(state: CreditDeliveryState): Promise<Hex$1>;
|
|
154
|
+
/** Rebuild from the original input and delta; cached output balances are never update intent. */
|
|
155
|
+
declare function assertCreditUpdatePlan(plan: OperationPlan): Promise<void>;
|
|
156
|
+
|
|
157
|
+
declare function inputFacts(plan: OperationPlan): Array<{
|
|
158
|
+
key: string;
|
|
159
|
+
reservationKey: string;
|
|
160
|
+
nullifier: Hex$1;
|
|
161
|
+
kind: "notes" | "credits";
|
|
162
|
+
}>;
|
|
163
|
+
declare function operationSources(plan: OperationPlan): readonly InputSource[];
|
|
164
|
+
|
|
165
|
+
/** Shared preparation engine for managed sessions and explicitly supplied inputs. */
|
|
166
|
+
declare class TransactionPreparation<Result> {
|
|
167
|
+
#private;
|
|
168
|
+
readonly context: PreparationRuntime<Result>;
|
|
169
|
+
constructor(context: PreparationRuntime<Result>);
|
|
170
|
+
private runtime;
|
|
171
|
+
private get scope();
|
|
172
|
+
prepareTransfer(options: TransferPreparation): Promise<Result>;
|
|
173
|
+
private funds;
|
|
174
|
+
prepareShield(options: ShieldPreparation): Promise<Result>;
|
|
175
|
+
prepareCreateCredit(options: CreateCreditPreparation): Promise<Result>;
|
|
176
|
+
prepareDrawCredit(options: DrawCreditPreparation): Promise<Result>;
|
|
177
|
+
prepareUpdateCredit(options: UpdateCreditPreparation): Promise<Result>;
|
|
178
|
+
prepareRevokeCredit(options: RevokeCreditPreparation): Promise<Result>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** Match the whole frozen member, including funding nonce, signature and permit, in one successful aggregate. */
|
|
182
|
+
declare function matchesAggregateTransaction(saved: SavedOperation, transaction: TransactionCall & {
|
|
183
|
+
from: Address;
|
|
184
|
+
}): boolean;
|
|
185
|
+
|
|
186
|
+
/** Whitelist the public proof fields; a custom local backend cannot accidentally export its witness. */
|
|
187
|
+
declare function publicProof(bundle: ProofBundle): ProofBundle;
|
|
188
|
+
|
|
189
|
+
declare function sameStatement(proof: ProofBundle, expected: ProofStatement): void;
|
|
190
|
+
|
|
191
|
+
declare function witnessFor(protocol: TokenProtocol, plan: OperationPlan, authorization?: AuthorizedStatement): Promise<ProvingRequest>;
|
|
192
|
+
|
|
193
|
+
type Hex = `0x${string}`;
|
|
194
|
+
|
|
195
|
+
declare function fundingTypedData(saved: SavedOperation): Promise<{
|
|
196
|
+
domain: {
|
|
197
|
+
name: string;
|
|
198
|
+
version: string;
|
|
199
|
+
chainId: bigint;
|
|
200
|
+
verifyingContract: Hex;
|
|
201
|
+
};
|
|
202
|
+
primaryType: "FundShield";
|
|
203
|
+
types: {
|
|
204
|
+
FundShield: readonly [{
|
|
205
|
+
readonly name: "requestHash";
|
|
206
|
+
readonly type: "bytes32";
|
|
207
|
+
}, {
|
|
208
|
+
readonly name: "payer";
|
|
209
|
+
readonly type: "address";
|
|
210
|
+
}, {
|
|
211
|
+
readonly name: "amount";
|
|
212
|
+
readonly type: "uint256";
|
|
213
|
+
}, {
|
|
214
|
+
readonly name: "sigNonce";
|
|
215
|
+
readonly type: "uint256";
|
|
216
|
+
}, {
|
|
217
|
+
readonly name: "deadline";
|
|
218
|
+
readonly type: "uint256";
|
|
219
|
+
}];
|
|
220
|
+
};
|
|
221
|
+
message: {
|
|
222
|
+
requestHash: `0x${string}`;
|
|
223
|
+
payer: `0x${string}`;
|
|
224
|
+
amount: bigint;
|
|
225
|
+
sigNonce: bigint;
|
|
226
|
+
deadline: bigint;
|
|
227
|
+
};
|
|
228
|
+
} | {
|
|
229
|
+
domain: {
|
|
230
|
+
name: string;
|
|
231
|
+
version: string;
|
|
232
|
+
chainId: bigint;
|
|
233
|
+
verifyingContract: Hex;
|
|
234
|
+
};
|
|
235
|
+
primaryType: "FundTransact";
|
|
236
|
+
types: {
|
|
237
|
+
FundTransact: readonly [{
|
|
238
|
+
readonly name: "requestHash";
|
|
239
|
+
readonly type: "bytes32";
|
|
240
|
+
}, {
|
|
241
|
+
readonly name: "payer";
|
|
242
|
+
readonly type: "address";
|
|
243
|
+
}, {
|
|
244
|
+
readonly name: "amount";
|
|
245
|
+
readonly type: "uint256";
|
|
246
|
+
}, {
|
|
247
|
+
readonly name: "sigNonce";
|
|
248
|
+
readonly type: "uint256";
|
|
249
|
+
}, {
|
|
250
|
+
readonly name: "deadline";
|
|
251
|
+
readonly type: "uint256";
|
|
252
|
+
}];
|
|
253
|
+
};
|
|
254
|
+
message: {
|
|
255
|
+
requestHash: `0x${string}`;
|
|
256
|
+
payer: `0x${string}`;
|
|
257
|
+
amount: bigint;
|
|
258
|
+
sigNonce: bigint;
|
|
259
|
+
deadline: bigint;
|
|
260
|
+
};
|
|
261
|
+
}>;
|
|
262
|
+
|
|
263
|
+
declare function requiresAuthorization(plan: OperationPlan): boolean;
|
|
264
|
+
declare function statement(plan: OperationPlan): ProofStatement;
|
|
265
|
+
declare function authorizationRequest(plan: OperationPlan): {
|
|
266
|
+
context: {
|
|
267
|
+
chainId: bigint;
|
|
268
|
+
protocolAddress: bigint;
|
|
269
|
+
};
|
|
270
|
+
operation: "transact" | "create-credit" | "update-credit" | "credit-draw";
|
|
271
|
+
capacity: number;
|
|
272
|
+
words: bigint[];
|
|
273
|
+
};
|
|
274
|
+
declare function operationExpired(plan: OperationPlan, now: bigint): boolean;
|
|
275
|
+
|
|
276
|
+
/** Resolve adapters without starting synchronization or accessing wallet state. */
|
|
277
|
+
declare function configureTransactionInfrastructure<T extends TransactionInfrastructure>(options: T): T;
|
|
278
|
+
/** Validate the selected chain and pinned deployment before any managed state access. */
|
|
279
|
+
declare function validateTransactionInfrastructure(options: TransactionInfrastructure): Promise<void>;
|
|
280
|
+
|
|
281
|
+
declare function revocationSigningRequest(plan: OperationPlan, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<_invisi_labs_primitives.SigningRequest>;
|
|
282
|
+
declare function acceptRevocationSignature(plan: OperationPlan, signature: Hex$1, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<`0x${string}`>;
|
|
283
|
+
|
|
284
|
+
export { CreateCreditPreparation, DrawCreditPreparation, FundingAuthorizationVerifier, FundingSigner, OperationPlan, OperationStatus, PreparationRuntime, RevokeCreditPreparation, SavedOperation, ShieldPreparation, TransactionInfrastructure, TransactionPreparation, TransactionProveOptions, TransactionRuntime, TransferPreparation, UpdateCreditPreparation, acceptFundingSignature, acceptRevocationSignature, acceptWalletSignature, assertCreditUpdatePlan, authorizationRequest, configureTransactionInfrastructure, creditLeaf, decodeProtocolEvent, encodeOperation, exportBroadcasterIntent, fundingSigningRequest, fundingTypedData, getOperationGasReference, inputFacts, matchesAggregateTransaction, operationExpired, operationPreview, operationSources, proveOperation, publicProof, requiresAuthorization, revocationSigningRequest, sameStatement, signOperationFunding, statement, validateTransactionInfrastructure, verifyMembership, walletSigningRequest, witnessFor };
|