@invisi-labs/sdk 1.1.7 → 1.2.1
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-LOU7AP2B.cjs → chunk-2URICDPW.cjs} +72 -33
- 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-4SDP53YQ.cjs +765 -0
- package/dist/chunk-4SDP53YQ.cjs.map +1 -0
- package/dist/{chunk-XHKQ2BO2.js → chunk-4VI6LYGH.js} +25 -2
- 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-DHQEB6JR.cjs +1616 -0
- package/dist/chunk-DHQEB6JR.cjs.map +1 -0
- package/dist/chunk-FKF67XE6.js +1616 -0
- package/dist/chunk-FKF67XE6.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/{chunk-GTPUYPQL.js → chunk-HKGJXQVN.js} +69 -30
- 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-7F7ZZW3L.cjs → chunk-LOR6PYH5.cjs} +25 -2
- 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-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 +2 -2
- package/dist/ethers.cjs.map +1 -1
- package/dist/ethers.d.cts +15 -4
- package/dist/ethers.d.ts +15 -4
- 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 +69 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -14
- package/dist/index.d.ts +21 -14
- package/dist/index.js +64 -33
- 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/{broadcaster-preparation-DMxxZ_1Q.d.cts → operation-bridge-CoECSxfi.d.cts} +130 -245
- package/dist/{broadcaster-preparation-DMxxZ_1Q.d.ts → operation-bridge-CoECSxfi.d.ts} +130 -245
- 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-m0-bhaxW.d.ts → receipt-logs-DQRJK0l8.d.cts} +84 -78
- package/dist/{receipt-logs-CvC951p7.d.cts → receipt-logs-fMR6Bwql.d.ts} +84 -78
- package/dist/session-support.cjs +28 -7
- package/dist/session-support.cjs.map +1 -1
- package/dist/session-support.d.cts +71 -39
- package/dist/session-support.d.ts +71 -39
- package/dist/session-support.js +58 -37
- package/dist/session-support.js.map +1 -1
- package/package.json +22 -6
- package/dist/broadcaster-preparation-RMWQFYNL.js +0 -11
- package/dist/broadcaster-preparation-UGOTO4SX.cjs +0 -11
- package/dist/broadcaster-preparation-UGOTO4SX.cjs.map +0 -1
- package/dist/chunk-7F7ZZW3L.cjs.map +0 -1
- package/dist/chunk-EHP5TBC6.js +0 -3565
- package/dist/chunk-EHP5TBC6.js.map +0 -1
- package/dist/chunk-GTPUYPQL.js.map +0 -1
- package/dist/chunk-ITTGBIG2.js +0 -1877
- package/dist/chunk-ITTGBIG2.js.map +0 -1
- package/dist/chunk-J2JH6HIG.cjs +0 -1877
- package/dist/chunk-J2JH6HIG.cjs.map +0 -1
- package/dist/chunk-LOU7AP2B.cjs.map +0 -1
- package/dist/chunk-RHNIHI4P.cjs +0 -3565
- package/dist/chunk-RHNIHI4P.cjs.map +0 -1
- package/dist/chunk-XHKQ2BO2.js.map +0 -1
- /package/dist/{broadcaster-preparation-RMWQFYNL.js.map → broadcaster-7ZKKSTZQ.js.map} +0 -0
package/dist/session-support.cjs
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
var _chunk2URICDPWcjs = require('./chunk-2URICDPW.cjs');
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
10
|
+
var _chunkJ6TZZVAMcjs = require('./chunk-J6TZZVAM.cjs');
|
|
11
|
+
require('./chunk-MI4IP4ZD.cjs');
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
|
@@ -33,18 +36,20 @@
|
|
|
33
36
|
|
|
34
37
|
|
|
35
38
|
|
|
39
|
+
var _chunkDHQEB6JRcjs = require('./chunk-DHQEB6JR.cjs');
|
|
36
40
|
|
|
37
41
|
|
|
38
42
|
|
|
39
|
-
var
|
|
43
|
+
var _chunkBBSRP4MHcjs = require('./chunk-BBSRP4MH.cjs');
|
|
40
44
|
|
|
41
45
|
|
|
42
46
|
|
|
43
|
-
var _chunkLOU7AP2Bcjs = require('./chunk-LOU7AP2B.cjs');
|
|
44
47
|
|
|
45
48
|
|
|
49
|
+
var _chunkHCB7RQ3Scjs = require('./chunk-HCB7RQ3S.cjs');
|
|
46
50
|
|
|
47
51
|
|
|
52
|
+
var _chunkOCZLJKIAcjs = require('./chunk-OCZLJKIA.cjs');
|
|
48
53
|
|
|
49
54
|
|
|
50
55
|
|
|
@@ -55,8 +60,20 @@ var _chunkLOU7AP2Bcjs = require('./chunk-LOU7AP2B.cjs');
|
|
|
55
60
|
|
|
56
61
|
|
|
57
62
|
|
|
58
|
-
var
|
|
59
|
-
|
|
63
|
+
var _chunk3KTQQZOWcjs = require('./chunk-3KTQQZOW.cjs');
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
var _chunkMA2QZEF5cjs = require('./chunk-MA2QZEF5.cjs');
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
var _chunk4SDP53YQcjs = require('./chunk-4SDP53YQ.cjs');
|
|
76
|
+
require('./chunk-LOR6PYH5.cjs');
|
|
60
77
|
|
|
61
78
|
// src/transactions/proving/aggregate-receipt.ts
|
|
62
79
|
var _ethers = require('ethers');
|
|
@@ -76,7 +93,7 @@ function matchesAggregateTransaction(saved, transaction) {
|
|
|
76
93
|
(source) => source.toObject(true)
|
|
77
94
|
);
|
|
78
95
|
member.params.nullifiers = request.params.nullifiers.toArray(true);
|
|
79
|
-
member.params.
|
|
96
|
+
member.params.noteCommitments = request.params.noteCommitments.toArray(true);
|
|
80
97
|
member.deliveries = request.deliveries.map(
|
|
81
98
|
(delivery) => delivery.toObject(true)
|
|
82
99
|
);
|
|
@@ -87,7 +104,7 @@ function matchesAggregateTransaction(saved, transaction) {
|
|
|
87
104
|
funding: member.funding
|
|
88
105
|
};
|
|
89
106
|
});
|
|
90
|
-
if (decoded.name !== "transact" || !Array.isArray(requests) || ![
|
|
107
|
+
if (decoded.name !== "transact" || !Array.isArray(requests) || ![1, 2, 3, 4, 5].includes(requests.length))
|
|
91
108
|
return false;
|
|
92
109
|
const canonical = (request) => _protocol.buildTransactCalldata.call(void 0, {
|
|
93
110
|
context: { ...plan.context, tokenAddress: request.params.token },
|
|
@@ -164,5 +181,9 @@ function matchesAggregateTransaction(saved, transaction) {
|
|
|
164
181
|
|
|
165
182
|
|
|
166
183
|
|
|
167
|
-
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
exports.BroadcasterClient = _chunk3KTQQZOWcjs.BroadcasterClient; exports.BroadcasterRpcError = _chunk3KTQQZOWcjs.BroadcasterRpcError; exports.Invisi = _chunkDHQEB6JRcjs.Invisi; exports.InvisiError = _chunk4SDP53YQcjs.InvisiError; exports.NoteOutput = _chunk4SDP53YQcjs.NoteOutput; exports.TransactionOutput = _chunkOCZLJKIAcjs.TransactionOutput; exports.TransactionPreparation = _chunkBBSRP4MHcjs.TransactionPreparation; exports.acceptFundingSignature = _chunkDHQEB6JRcjs.acceptFundingSignature; exports.acceptRevocationSignature = _chunkDHQEB6JRcjs.acceptRevocationSignature; exports.acceptWalletSignature = _chunkDHQEB6JRcjs.acceptWalletSignature; exports.assertCreditUpdatePlan = _chunkMA2QZEF5cjs.assertCreditUpdatePlan; exports.authorizationRequest = _chunkHCB7RQ3Scjs.authorizationRequest; exports.bindBroadcasterOperation = _chunk3KTQQZOWcjs.bindBroadcasterOperation; exports.broadcasterQuoteDomain = _chunk3KTQQZOWcjs.broadcasterQuoteDomain; exports.broadcasterQuoteTypes = _chunk3KTQQZOWcjs.broadcasterQuoteTypes; exports.broadcasterRequestHash = _chunk3KTQQZOWcjs.broadcasterRequestHash; exports.broadcasterTransactInterface = _chunk3KTQQZOWcjs.broadcasterTransactInterface; exports.configureRecipientInfrastructure = _chunkMA2QZEF5cjs.configureRecipientInfrastructure; exports.configureTransactionInfrastructure = _chunkDHQEB6JRcjs.configureTransactionInfrastructure; exports.creditLeaf = _chunkMA2QZEF5cjs.creditLeaf; exports.creditReservationKey = _chunkDHQEB6JRcjs.creditReservationKey; exports.decodeBroadcasterIntent = _chunk3KTQQZOWcjs.decodeBroadcasterIntent; exports.decodeProtocolEvent = _chunkDHQEB6JRcjs.decodeProtocolEvent; exports.decryptCandidates = _chunkDHQEB6JRcjs.decryptCandidates; exports.encodeOperation = _chunkDHQEB6JRcjs.encodeOperation; exports.exportBroadcasterIntent = _chunkBBSRP4MHcjs.exportBroadcasterIntent; exports.extractDeliveryCandidates = _chunkDHQEB6JRcjs.extractDeliveryCandidates; exports.fundingSigningRequest = _chunkDHQEB6JRcjs.fundingSigningRequest; exports.fundingTypedData = _chunkDHQEB6JRcjs.fundingTypedData; exports.getDocumentedGasReference = _chunkDHQEB6JRcjs.getDocumentedGasReference; exports.getOperationGasReference = _chunkDHQEB6JRcjs.getOperationGasReference; exports.inputFacts = _chunkDHQEB6JRcjs.inputFacts; exports.matchesAggregateTransaction = matchesAggregateTransaction; exports.operationExpired = _chunkHCB7RQ3Scjs.operationExpired; exports.operationPreview = _chunkDHQEB6JRcjs.operationPreview; exports.operationSources = _chunkDHQEB6JRcjs.operationSources; exports.prepareBroadcasterPlan = _chunk2URICDPWcjs.prepareBroadcasterPlan; exports.prepareIntent = _chunk2URICDPWcjs.prepareIntent; exports.prepareProvenance = _chunkJ6TZZVAMcjs.prepareProvenance; exports.prepareWithErrors = _chunk4SDP53YQcjs.prepareWithErrors; exports.proveOperation = _chunkDHQEB6JRcjs.proveOperation; exports.provePreparedProvenance = _chunkJ6TZZVAMcjs.provePreparedProvenance; exports.publicProof = _chunkDHQEB6JRcjs.publicProof; exports.readProtocolLogs = _chunkDHQEB6JRcjs.readProtocolLogs; exports.recipientLookup = _chunkMA2QZEF5cjs.recipientLookup; exports.requiresAuthorization = _chunkHCB7RQ3Scjs.requiresAuthorization; exports.revocationSigningRequest = _chunkDHQEB6JRcjs.revocationSigningRequest; exports.sameStatement = _chunkDHQEB6JRcjs.sameStatement; exports.signOperationFunding = _chunkDHQEB6JRcjs.signOperationFunding; exports.statement = _chunkHCB7RQ3Scjs.statement; exports.validateBroadcastEnvelope = _chunkJ6TZZVAMcjs.validateBroadcastEnvelope; exports.validatePreparedBroadcast = _chunkJ6TZZVAMcjs.validatePreparedBroadcast; exports.validateTransactionInfrastructure = _chunkDHQEB6JRcjs.validateTransactionInfrastructure; exports.verifyBroadcasterQuote = _chunk3KTQQZOWcjs.verifyBroadcasterQuote; exports.verifyMembership = _chunkMA2QZEF5cjs.verifyMembership; exports.walletSigningRequest = _chunkDHQEB6JRcjs.walletSigningRequest; exports.witnessFor = _chunkDHQEB6JRcjs.witnessFor;
|
|
168
189
|
//# sourceMappingURL=session-support.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/wx/Workspace/invisi-lab/invisi-sdk-ts/packages/sdk/dist/session-support.cjs","../src/transactions/proving/aggregate-receipt.ts"],"names":[],"mappings":"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","file":"/Users/wx/Workspace/invisi-lab/invisi-sdk-ts/packages/sdk/dist/session-support.cjs","sourcesContent":[null,"import type { Address } from \"@invisi-labs/protocol/contracts\";\nimport { Interface, type Result } from \"ethers\";\n\nimport { buildTransactCalldata, type TransactionCall } from \"@invisi-labs/protocol\";\nimport { invisiProtocolAbi, type TransactRequest } from \"@invisi-labs/protocol/contracts\";\nimport type { SavedOperation } from \"../operation-types\";\nconst aggregateAbi = invisiProtocolAbi.filter(\n (item) =>\n item.type === \"function\" &&\n item.name === \"transact\" &&\n item.inputs.length === 2 &&\n item.inputs[1]?.type === \"tuple[]\"\n);\n/** Match the whole frozen member, including funding nonce, signature and permit, in one successful aggregate. */\nexport function matchesAggregateTransaction(\n saved: SavedOperation,\n transaction: TransactionCall & { from: Address }\n): boolean {\n const plan = saved.plan;\n if (\n plan.statement?.target !== \"noir-recursive\" ||\n !plan.params ||\n !saved.externalized ||\n transaction.to.toLowerCase() !== plan.context.protocolAddress.toLowerCase() ||\n transaction.value !== 0n\n )\n return false;\n try {\n const decoded = new Interface(aggregateAbi).parseTransaction({ data: transaction.data })!,\n requests = (decoded.args[1] as Result[]).map((request) => {\n const member = request.toObject(true);\n member.params.sources = request.params.sources.map((source: Result) =>\n source.toObject(true)\n );\n member.params.nullifiers = request.params.nullifiers.toArray(true);\n member.params.noteCommitments = request.params.noteCommitments.toArray(true);\n member.deliveries = request.deliveries.map((delivery: Result) =>\n delivery.toObject(true)\n );\n member.funding.permit.v = Number(member.funding.permit.v);\n return {\n params: member.params,\n deliveries: member.deliveries,\n funding: member.funding,\n };\n }) as readonly TransactRequest[];\n if (\n decoded.name !== \"transact\" ||\n !Array.isArray(requests) ||\n ![1, 2, 3, 4, 5].includes(requests.length)\n )\n return false;\n const canonical = (request: TransactRequest) =>\n buildTransactCalldata({\n context: { ...plan.context, tokenAddress: request.params.token },\n proof: \"0x00\",\n params: request.params,\n deliveries: request.deliveries,\n funding: request.funding,\n caller: transaction.from,\n }).data.toLowerCase();\n const expected = buildTransactCalldata({\n context: plan.context,\n proof: \"0x00\",\n params: plan.params,\n deliveries: plan.outputs.map((output) => output.delivery),\n funding: plan.funding,\n caller: transaction.from,\n }).data.toLowerCase();\n return requests.filter((request) => canonical(request) === expected).length === 1;\n } catch {\n return false;\n }\n}\n"]}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { Hex as Hex$1, InputSource, Address
|
|
4
|
-
export {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
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-DQRJK0l8.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';
|
|
8
11
|
import * as _invisi_labs_prover from '@invisi-labs/prover';
|
|
9
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';
|
|
10
18
|
import 'ethers';
|
|
19
|
+
import './index-CLhGwLxZ.cjs';
|
|
11
20
|
|
|
12
|
-
/**
|
|
13
|
-
declare function estimateShapeGas(request: GasEstimateRequest, profiles?: readonly GasBenchmarkProfile[]): GasReference;
|
|
14
|
-
|
|
15
|
-
/** Pure reference lookup. No proof, RPC, current fee price, extrapolation or transaction gas limit. */
|
|
16
|
-
declare function estimateBenchmarkGas(plan: OperationPlan, protocol: TokenProtocol, profiles?: readonly GasBenchmarkProfile[]): BenchmarkGasEstimate;
|
|
17
|
-
declare function estimateGasReference(plan: OperationPlan, protocol: TokenProtocol, profiles?: readonly GasBenchmarkProfile[]): GasReference;
|
|
18
|
-
|
|
19
|
-
/** Public frozen request for quote signing. Empty proof/signature make this deliberately non-sendable. */
|
|
21
|
+
/** Quote-only export; callers still need the operation-specific proof or owner authorization. */
|
|
20
22
|
declare function exportBroadcasterIntent(plan: OperationPlan): {
|
|
21
23
|
sendable: false;
|
|
22
24
|
data: Hex$1;
|
|
@@ -34,37 +36,37 @@ declare function decodeProtocolEvent(log: {
|
|
|
34
36
|
topics: readonly string[];
|
|
35
37
|
}): {
|
|
36
38
|
eventName: string;
|
|
37
|
-
args:
|
|
39
|
+
args: {
|
|
40
|
+
[k: string]: unknown;
|
|
41
|
+
};
|
|
38
42
|
};
|
|
39
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
|
+
|
|
40
47
|
declare function encodeOperation(saved: SavedOperation): Promise<TransactionCall>;
|
|
41
48
|
|
|
42
|
-
/** Both managed and detached handles authorize the same frozen statement. */
|
|
43
|
-
declare function authorizeOperation(plan: OperationPlan, provider: WalletAuthorizationProvider): Promise<AuthorizedStatement>;
|
|
44
49
|
declare function proveOperation(protocol: TokenProtocol, plan: OperationPlan, authorization: AuthorizedStatement | undefined, prover: Prover, options: TransactionProveOptions): Promise<_invisi_labs_prover.ProofBundle>;
|
|
45
50
|
declare function signOperationFunding(saved: SavedOperation, signer: FundingSigner, verifier?: FundingAuthorizationVerifier): Promise<`0x${string}`>;
|
|
46
51
|
/** Export only typed commitments, never private note openings or authorization witnesses. */
|
|
47
|
-
declare function walletSigningRequest(plan: OperationPlan):
|
|
52
|
+
declare function walletSigningRequest(plan: OperationPlan): _invisi_labs_primitives.SigningRequest;
|
|
48
53
|
/** Recover the EOA key and build the existing private witness without receiving a private key. */
|
|
49
54
|
declare function acceptWalletSignature(plan: OperationPlan, signature: string): Promise<AuthorizedStatement>;
|
|
50
55
|
/** The remote round trip may outlive the nonce or deadline selected during preparation. */
|
|
51
|
-
declare function fundingSigningRequest(saved: SavedOperation, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<
|
|
56
|
+
declare function fundingSigningRequest(saved: SavedOperation, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<_invisi_labs_primitives.SigningRequest>;
|
|
52
57
|
/** Verify against reconstructed operation data, never caller-supplied typed data. */
|
|
53
58
|
declare function acceptFundingSignature(saved: SavedOperation, signature: string, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<`0x${string}`>;
|
|
54
59
|
|
|
55
|
-
type Hex = `0x${string}`;
|
|
56
|
-
type Address = `0x${string}`;
|
|
57
|
-
|
|
58
60
|
declare function operationPreview(plan: OperationPlan, status: OperationStatus): {
|
|
59
61
|
id: string;
|
|
60
|
-
kind: "
|
|
62
|
+
kind: "create-credit" | "update-credit" | "transfer" | "shield" | "draw-credit" | "revoke-credit";
|
|
61
63
|
status: OperationStatus;
|
|
62
64
|
context: {
|
|
63
|
-
tokenAddress: Address;
|
|
65
|
+
tokenAddress: _invisi_labs_primitives.Address;
|
|
64
66
|
now?: bigint;
|
|
65
67
|
timestamp?: bigint;
|
|
66
68
|
chainId: bigint;
|
|
67
|
-
protocolAddress: Address;
|
|
69
|
+
protocolAddress: _invisi_labs_primitives.Address;
|
|
68
70
|
};
|
|
69
71
|
inputs: number;
|
|
70
72
|
inputDetails: ({
|
|
@@ -77,10 +79,13 @@ declare function operationPreview(plan: OperationPlan, status: OperationStatus):
|
|
|
77
79
|
} | {
|
|
78
80
|
kind: "credits";
|
|
79
81
|
commitment: `0x${string}`;
|
|
80
|
-
|
|
82
|
+
revocationShard: bigint;
|
|
83
|
+
revocationSlot: bigint;
|
|
81
84
|
owner: `0x${string}`;
|
|
82
85
|
spender: `0x${string}`;
|
|
83
86
|
expiry: bigint;
|
|
87
|
+
availableCredit: bigint;
|
|
88
|
+
unlimited: boolean;
|
|
84
89
|
role: "owner" | "spender";
|
|
85
90
|
treeId: bigint;
|
|
86
91
|
leafIndex: number;
|
|
@@ -96,14 +101,34 @@ declare function operationPreview(plan: OperationPlan, status: OperationStatus):
|
|
|
96
101
|
};
|
|
97
102
|
};
|
|
98
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;
|
|
99
114
|
commitment: `0x${string}`;
|
|
100
|
-
|
|
115
|
+
revocationShard: bigint;
|
|
116
|
+
revocationSlot: bigint;
|
|
101
117
|
expiry: bigint;
|
|
102
118
|
owner: `0x${string}`;
|
|
103
119
|
spender: `0x${string}`;
|
|
104
|
-
ownerPayout: bigint;
|
|
105
|
-
spenderPayout: bigint;
|
|
106
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;
|
|
107
132
|
outputs: {
|
|
108
133
|
commitment: `0x${string}`;
|
|
109
134
|
to: string;
|
|
@@ -126,6 +151,8 @@ declare function operationPreview(plan: OperationPlan, status: OperationStatus):
|
|
|
126
151
|
};
|
|
127
152
|
|
|
128
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>;
|
|
129
156
|
|
|
130
157
|
declare function inputFacts(plan: OperationPlan): Array<{
|
|
131
158
|
key: string;
|
|
@@ -147,13 +174,13 @@ declare class TransactionPreparation<Result> {
|
|
|
147
174
|
prepareShield(options: ShieldPreparation): Promise<Result>;
|
|
148
175
|
prepareCreateCredit(options: CreateCreditPreparation): Promise<Result>;
|
|
149
176
|
prepareDrawCredit(options: DrawCreditPreparation): Promise<Result>;
|
|
150
|
-
|
|
151
|
-
|
|
177
|
+
prepareUpdateCredit(options: UpdateCreditPreparation): Promise<Result>;
|
|
178
|
+
prepareRevokeCredit(options: RevokeCreditPreparation): Promise<Result>;
|
|
152
179
|
}
|
|
153
180
|
|
|
154
181
|
/** Match the whole frozen member, including funding nonce, signature and permit, in one successful aggregate. */
|
|
155
182
|
declare function matchesAggregateTransaction(saved: SavedOperation, transaction: TransactionCall & {
|
|
156
|
-
from: Address
|
|
183
|
+
from: Address;
|
|
157
184
|
}): boolean;
|
|
158
185
|
|
|
159
186
|
/** Whitelist the public proof fields; a custom local backend cannot accidentally export its witness. */
|
|
@@ -163,6 +190,8 @@ declare function sameStatement(proof: ProofBundle, expected: ProofStatement): vo
|
|
|
163
190
|
|
|
164
191
|
declare function witnessFor(protocol: TokenProtocol, plan: OperationPlan, authorization?: AuthorizedStatement): Promise<ProvingRequest>;
|
|
165
192
|
|
|
193
|
+
type Hex = `0x${string}`;
|
|
194
|
+
|
|
166
195
|
declare function fundingTypedData(saved: SavedOperation): Promise<{
|
|
167
196
|
domain: {
|
|
168
197
|
name: string;
|
|
@@ -170,9 +199,9 @@ declare function fundingTypedData(saved: SavedOperation): Promise<{
|
|
|
170
199
|
chainId: bigint;
|
|
171
200
|
verifyingContract: Hex;
|
|
172
201
|
};
|
|
173
|
-
primaryType: "
|
|
202
|
+
primaryType: "FundShield";
|
|
174
203
|
types: {
|
|
175
|
-
|
|
204
|
+
FundShield: readonly [{
|
|
176
205
|
readonly name: "requestHash";
|
|
177
206
|
readonly type: "bytes32";
|
|
178
207
|
}, {
|
|
@@ -203,9 +232,9 @@ declare function fundingTypedData(saved: SavedOperation): Promise<{
|
|
|
203
232
|
chainId: bigint;
|
|
204
233
|
verifyingContract: Hex;
|
|
205
234
|
};
|
|
206
|
-
primaryType: "
|
|
235
|
+
primaryType: "FundTransact";
|
|
207
236
|
types: {
|
|
208
|
-
|
|
237
|
+
FundTransact: readonly [{
|
|
209
238
|
readonly name: "requestHash";
|
|
210
239
|
readonly type: "bytes32";
|
|
211
240
|
}, {
|
|
@@ -238,7 +267,7 @@ declare function authorizationRequest(plan: OperationPlan): {
|
|
|
238
267
|
chainId: bigint;
|
|
239
268
|
protocolAddress: bigint;
|
|
240
269
|
};
|
|
241
|
-
operation: "transact" | "create-credit" | "
|
|
270
|
+
operation: "transact" | "create-credit" | "update-credit" | "credit-draw";
|
|
242
271
|
capacity: number;
|
|
243
272
|
words: bigint[];
|
|
244
273
|
};
|
|
@@ -249,4 +278,7 @@ declare function configureTransactionInfrastructure<T extends TransactionInfrast
|
|
|
249
278
|
/** Validate the selected chain and pinned deployment before any managed state access. */
|
|
250
279
|
declare function validateTransactionInfrastructure(options: TransactionInfrastructure): Promise<void>;
|
|
251
280
|
|
|
252
|
-
|
|
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 };
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { Hex as Hex$1, InputSource, Address
|
|
4
|
-
export {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
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-fMR6Bwql.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';
|
|
8
11
|
import * as _invisi_labs_prover from '@invisi-labs/prover';
|
|
9
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';
|
|
10
18
|
import 'ethers';
|
|
19
|
+
import './index-Crp-ZFiM.js';
|
|
11
20
|
|
|
12
|
-
/**
|
|
13
|
-
declare function estimateShapeGas(request: GasEstimateRequest, profiles?: readonly GasBenchmarkProfile[]): GasReference;
|
|
14
|
-
|
|
15
|
-
/** Pure reference lookup. No proof, RPC, current fee price, extrapolation or transaction gas limit. */
|
|
16
|
-
declare function estimateBenchmarkGas(plan: OperationPlan, protocol: TokenProtocol, profiles?: readonly GasBenchmarkProfile[]): BenchmarkGasEstimate;
|
|
17
|
-
declare function estimateGasReference(plan: OperationPlan, protocol: TokenProtocol, profiles?: readonly GasBenchmarkProfile[]): GasReference;
|
|
18
|
-
|
|
19
|
-
/** Public frozen request for quote signing. Empty proof/signature make this deliberately non-sendable. */
|
|
21
|
+
/** Quote-only export; callers still need the operation-specific proof or owner authorization. */
|
|
20
22
|
declare function exportBroadcasterIntent(plan: OperationPlan): {
|
|
21
23
|
sendable: false;
|
|
22
24
|
data: Hex$1;
|
|
@@ -34,37 +36,37 @@ declare function decodeProtocolEvent(log: {
|
|
|
34
36
|
topics: readonly string[];
|
|
35
37
|
}): {
|
|
36
38
|
eventName: string;
|
|
37
|
-
args:
|
|
39
|
+
args: {
|
|
40
|
+
[k: string]: unknown;
|
|
41
|
+
};
|
|
38
42
|
};
|
|
39
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
|
+
|
|
40
47
|
declare function encodeOperation(saved: SavedOperation): Promise<TransactionCall>;
|
|
41
48
|
|
|
42
|
-
/** Both managed and detached handles authorize the same frozen statement. */
|
|
43
|
-
declare function authorizeOperation(plan: OperationPlan, provider: WalletAuthorizationProvider): Promise<AuthorizedStatement>;
|
|
44
49
|
declare function proveOperation(protocol: TokenProtocol, plan: OperationPlan, authorization: AuthorizedStatement | undefined, prover: Prover, options: TransactionProveOptions): Promise<_invisi_labs_prover.ProofBundle>;
|
|
45
50
|
declare function signOperationFunding(saved: SavedOperation, signer: FundingSigner, verifier?: FundingAuthorizationVerifier): Promise<`0x${string}`>;
|
|
46
51
|
/** Export only typed commitments, never private note openings or authorization witnesses. */
|
|
47
|
-
declare function walletSigningRequest(plan: OperationPlan):
|
|
52
|
+
declare function walletSigningRequest(plan: OperationPlan): _invisi_labs_primitives.SigningRequest;
|
|
48
53
|
/** Recover the EOA key and build the existing private witness without receiving a private key. */
|
|
49
54
|
declare function acceptWalletSignature(plan: OperationPlan, signature: string): Promise<AuthorizedStatement>;
|
|
50
55
|
/** The remote round trip may outlive the nonce or deadline selected during preparation. */
|
|
51
|
-
declare function fundingSigningRequest(saved: SavedOperation, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<
|
|
56
|
+
declare function fundingSigningRequest(saved: SavedOperation, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<_invisi_labs_primitives.SigningRequest>;
|
|
52
57
|
/** Verify against reconstructed operation data, never caller-supplied typed data. */
|
|
53
58
|
declare function acceptFundingSignature(saved: SavedOperation, signature: string, runtime: Pick<TransactionRuntime, "reader" | "options">): Promise<`0x${string}`>;
|
|
54
59
|
|
|
55
|
-
type Hex = `0x${string}`;
|
|
56
|
-
type Address = `0x${string}`;
|
|
57
|
-
|
|
58
60
|
declare function operationPreview(plan: OperationPlan, status: OperationStatus): {
|
|
59
61
|
id: string;
|
|
60
|
-
kind: "
|
|
62
|
+
kind: "create-credit" | "update-credit" | "transfer" | "shield" | "draw-credit" | "revoke-credit";
|
|
61
63
|
status: OperationStatus;
|
|
62
64
|
context: {
|
|
63
|
-
tokenAddress: Address;
|
|
65
|
+
tokenAddress: _invisi_labs_primitives.Address;
|
|
64
66
|
now?: bigint;
|
|
65
67
|
timestamp?: bigint;
|
|
66
68
|
chainId: bigint;
|
|
67
|
-
protocolAddress: Address;
|
|
69
|
+
protocolAddress: _invisi_labs_primitives.Address;
|
|
68
70
|
};
|
|
69
71
|
inputs: number;
|
|
70
72
|
inputDetails: ({
|
|
@@ -77,10 +79,13 @@ declare function operationPreview(plan: OperationPlan, status: OperationStatus):
|
|
|
77
79
|
} | {
|
|
78
80
|
kind: "credits";
|
|
79
81
|
commitment: `0x${string}`;
|
|
80
|
-
|
|
82
|
+
revocationShard: bigint;
|
|
83
|
+
revocationSlot: bigint;
|
|
81
84
|
owner: `0x${string}`;
|
|
82
85
|
spender: `0x${string}`;
|
|
83
86
|
expiry: bigint;
|
|
87
|
+
availableCredit: bigint;
|
|
88
|
+
unlimited: boolean;
|
|
84
89
|
role: "owner" | "spender";
|
|
85
90
|
treeId: bigint;
|
|
86
91
|
leafIndex: number;
|
|
@@ -96,14 +101,34 @@ declare function operationPreview(plan: OperationPlan, status: OperationStatus):
|
|
|
96
101
|
};
|
|
97
102
|
};
|
|
98
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;
|
|
99
114
|
commitment: `0x${string}`;
|
|
100
|
-
|
|
115
|
+
revocationShard: bigint;
|
|
116
|
+
revocationSlot: bigint;
|
|
101
117
|
expiry: bigint;
|
|
102
118
|
owner: `0x${string}`;
|
|
103
119
|
spender: `0x${string}`;
|
|
104
|
-
ownerPayout: bigint;
|
|
105
|
-
spenderPayout: bigint;
|
|
106
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;
|
|
107
132
|
outputs: {
|
|
108
133
|
commitment: `0x${string}`;
|
|
109
134
|
to: string;
|
|
@@ -126,6 +151,8 @@ declare function operationPreview(plan: OperationPlan, status: OperationStatus):
|
|
|
126
151
|
};
|
|
127
152
|
|
|
128
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>;
|
|
129
156
|
|
|
130
157
|
declare function inputFacts(plan: OperationPlan): Array<{
|
|
131
158
|
key: string;
|
|
@@ -147,13 +174,13 @@ declare class TransactionPreparation<Result> {
|
|
|
147
174
|
prepareShield(options: ShieldPreparation): Promise<Result>;
|
|
148
175
|
prepareCreateCredit(options: CreateCreditPreparation): Promise<Result>;
|
|
149
176
|
prepareDrawCredit(options: DrawCreditPreparation): Promise<Result>;
|
|
150
|
-
|
|
151
|
-
|
|
177
|
+
prepareUpdateCredit(options: UpdateCreditPreparation): Promise<Result>;
|
|
178
|
+
prepareRevokeCredit(options: RevokeCreditPreparation): Promise<Result>;
|
|
152
179
|
}
|
|
153
180
|
|
|
154
181
|
/** Match the whole frozen member, including funding nonce, signature and permit, in one successful aggregate. */
|
|
155
182
|
declare function matchesAggregateTransaction(saved: SavedOperation, transaction: TransactionCall & {
|
|
156
|
-
from: Address
|
|
183
|
+
from: Address;
|
|
157
184
|
}): boolean;
|
|
158
185
|
|
|
159
186
|
/** Whitelist the public proof fields; a custom local backend cannot accidentally export its witness. */
|
|
@@ -163,6 +190,8 @@ declare function sameStatement(proof: ProofBundle, expected: ProofStatement): vo
|
|
|
163
190
|
|
|
164
191
|
declare function witnessFor(protocol: TokenProtocol, plan: OperationPlan, authorization?: AuthorizedStatement): Promise<ProvingRequest>;
|
|
165
192
|
|
|
193
|
+
type Hex = `0x${string}`;
|
|
194
|
+
|
|
166
195
|
declare function fundingTypedData(saved: SavedOperation): Promise<{
|
|
167
196
|
domain: {
|
|
168
197
|
name: string;
|
|
@@ -170,9 +199,9 @@ declare function fundingTypedData(saved: SavedOperation): Promise<{
|
|
|
170
199
|
chainId: bigint;
|
|
171
200
|
verifyingContract: Hex;
|
|
172
201
|
};
|
|
173
|
-
primaryType: "
|
|
202
|
+
primaryType: "FundShield";
|
|
174
203
|
types: {
|
|
175
|
-
|
|
204
|
+
FundShield: readonly [{
|
|
176
205
|
readonly name: "requestHash";
|
|
177
206
|
readonly type: "bytes32";
|
|
178
207
|
}, {
|
|
@@ -203,9 +232,9 @@ declare function fundingTypedData(saved: SavedOperation): Promise<{
|
|
|
203
232
|
chainId: bigint;
|
|
204
233
|
verifyingContract: Hex;
|
|
205
234
|
};
|
|
206
|
-
primaryType: "
|
|
235
|
+
primaryType: "FundTransact";
|
|
207
236
|
types: {
|
|
208
|
-
|
|
237
|
+
FundTransact: readonly [{
|
|
209
238
|
readonly name: "requestHash";
|
|
210
239
|
readonly type: "bytes32";
|
|
211
240
|
}, {
|
|
@@ -238,7 +267,7 @@ declare function authorizationRequest(plan: OperationPlan): {
|
|
|
238
267
|
chainId: bigint;
|
|
239
268
|
protocolAddress: bigint;
|
|
240
269
|
};
|
|
241
|
-
operation: "transact" | "create-credit" | "
|
|
270
|
+
operation: "transact" | "create-credit" | "update-credit" | "credit-draw";
|
|
242
271
|
capacity: number;
|
|
243
272
|
words: bigint[];
|
|
244
273
|
};
|
|
@@ -249,4 +278,7 @@ declare function configureTransactionInfrastructure<T extends TransactionInfrast
|
|
|
249
278
|
/** Validate the selected chain and pinned deployment before any managed state access. */
|
|
250
279
|
declare function validateTransactionInfrastructure(options: TransactionInfrastructure): Promise<void>;
|
|
251
280
|
|
|
252
|
-
|
|
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 };
|