@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/index.d.cts
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import { DisclosureOutput, Disclosure, DisclosureResult, Wallet } from '@invisi-labs/
|
|
2
|
-
export { Address, CreditDataV1, CreditDeliveryState,
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
export { AddressRegistryOptions,
|
|
1
|
+
import { DisclosureOutput, Disclosure, DisclosureResult, Wallet } from '@invisi-labs/primitives';
|
|
2
|
+
export { Address, CreditDataV1, CreditDeliveryState, CreditOpening, CreditPolicy, CreditState, DeliveryAuthenticationError, DeliveryDecryptionError, DeliveryDecryptionResult, DeliveryDecryptor, DeliveryDetectionBatch, DeliveryDetectionCandidate, 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';
|
|
6
8
|
export { AggregateMember, AggregatorCapability, ProofBundle, ProofStatement, Prover, ProverOptions } from '@invisi-labs/prover';
|
|
7
|
-
|
|
8
|
-
export { C as CreditInput, D as DeliveryEventLog, a as DiscoveredCredit, b as DiscoveredNote, E as ExplicitCancelCreditPreparation, c as ExplicitCreateCreditPreparation, d as ExplicitDrawCreditPreparation, e as ExplicitShieldPreparation, f as ExplicitTopUpCreditPreparation, g as ExplicitTransferPreparation, I as Invisi, h as InvisiError, i as InvisiErrorCode, j as InvisiErrorDetails, k as InvisiOptions, P as PreparedTransaction, R as RegistrationPreparationOptions, T as TransactionIdentity, l as TransactionOutput, m as decryptCandidates, n as defineGasBenchmarks, r as readProtocolLogs } from './receipt-logs-CvC951p7.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-DQRJK0l8.cjs';
|
|
9
10
|
import { Hex, Address } from '@invisi-labs/protocol/contracts';
|
|
10
11
|
import { Provider } from 'ethers';
|
|
11
|
-
import {
|
|
12
|
-
export {
|
|
13
|
-
import {
|
|
14
|
-
export {
|
|
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';
|
|
15
21
|
|
|
16
22
|
interface DisclosureReference {
|
|
17
23
|
transactionHash: Hex;
|
|
@@ -58,14 +64,15 @@ declare class DisclosureVerifier {
|
|
|
58
64
|
};
|
|
59
65
|
}
|
|
60
66
|
|
|
61
|
-
/** Deployment operations and
|
|
67
|
+
/** Deployment operations and transaction-compatible broadcaster discovery. */
|
|
62
68
|
declare class Protocol extends Protocol$1 {
|
|
63
69
|
static fromRpc(rpc: Pick<ProtocolRpcClient$1, "getDeployment"> & Partial<Pick<ProtocolRpcClient$1, "getBroadcasters" | "withReader">>, provider: Provider, options?: {
|
|
64
70
|
signal?: AbortSignal;
|
|
65
71
|
}): Promise<Protocol>;
|
|
66
|
-
/**
|
|
72
|
+
/** Discover token support without disclosing a transaction or requesting a price. */
|
|
67
73
|
getBroadcasters(options: {
|
|
68
74
|
tokenAddress: string;
|
|
75
|
+
signal?: AbortSignal;
|
|
69
76
|
}): Promise<BroadcasterClient[]>;
|
|
70
77
|
}
|
|
71
78
|
|
|
@@ -73,7 +80,7 @@ declare class Protocol extends Protocol$1 {
|
|
|
73
80
|
declare class AddressRegistry extends AddressRegistry$1 {
|
|
74
81
|
prepareRegistration(options: RegistrationPreparation | (Omit<RegistrationPreparation, "reader"> & {
|
|
75
82
|
provider: Provider;
|
|
76
|
-
})): Promise<
|
|
83
|
+
})): Promise<_invisi_labs_rpc.RegistrationOperation>;
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
interface BroadcasterRegistration {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import { DisclosureOutput, Disclosure, DisclosureResult, Wallet } from '@invisi-labs/
|
|
2
|
-
export { Address, CreditDataV1, CreditDeliveryState,
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
export { AddressRegistryOptions,
|
|
1
|
+
import { DisclosureOutput, Disclosure, DisclosureResult, Wallet } from '@invisi-labs/primitives';
|
|
2
|
+
export { Address, CreditDataV1, CreditDeliveryState, CreditOpening, CreditPolicy, CreditState, DeliveryAuthenticationError, DeliveryDecryptionError, DeliveryDecryptionResult, DeliveryDecryptor, DeliveryDetectionBatch, DeliveryDetectionCandidate, 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';
|
|
6
8
|
export { AggregateMember, AggregatorCapability, ProofBundle, ProofStatement, Prover, ProverOptions } from '@invisi-labs/prover';
|
|
7
|
-
|
|
8
|
-
export { C as CreditInput, D as DeliveryEventLog, a as DiscoveredCredit, b as DiscoveredNote, E as ExplicitCancelCreditPreparation, c as ExplicitCreateCreditPreparation, d as ExplicitDrawCreditPreparation, e as ExplicitShieldPreparation, f as ExplicitTopUpCreditPreparation, g as ExplicitTransferPreparation, I as Invisi, h as InvisiError, i as InvisiErrorCode, j as InvisiErrorDetails, k as InvisiOptions, P as PreparedTransaction, R as RegistrationPreparationOptions, T as TransactionIdentity, l as TransactionOutput, m as decryptCandidates, n as defineGasBenchmarks, r as readProtocolLogs } from './receipt-logs-m0-bhaxW.js';
|
|
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-fMR6Bwql.js';
|
|
9
10
|
import { Hex, Address } from '@invisi-labs/protocol/contracts';
|
|
10
11
|
import { Provider } from 'ethers';
|
|
11
|
-
import {
|
|
12
|
-
export {
|
|
13
|
-
import {
|
|
14
|
-
export {
|
|
12
|
+
import { i as BroadcasterClient, j as PaymentRequest } from './operation-bridge-CoECSxfi.js';
|
|
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.js';
|
|
14
|
+
import { N as NoteInput } from './index-Crp-ZFiM.js';
|
|
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-Crp-ZFiM.js';
|
|
16
|
+
export { TransactionOutput } from './note.js';
|
|
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';
|
|
15
21
|
|
|
16
22
|
interface DisclosureReference {
|
|
17
23
|
transactionHash: Hex;
|
|
@@ -58,14 +64,15 @@ declare class DisclosureVerifier {
|
|
|
58
64
|
};
|
|
59
65
|
}
|
|
60
66
|
|
|
61
|
-
/** Deployment operations and
|
|
67
|
+
/** Deployment operations and transaction-compatible broadcaster discovery. */
|
|
62
68
|
declare class Protocol extends Protocol$1 {
|
|
63
69
|
static fromRpc(rpc: Pick<ProtocolRpcClient$1, "getDeployment"> & Partial<Pick<ProtocolRpcClient$1, "getBroadcasters" | "withReader">>, provider: Provider, options?: {
|
|
64
70
|
signal?: AbortSignal;
|
|
65
71
|
}): Promise<Protocol>;
|
|
66
|
-
/**
|
|
72
|
+
/** Discover token support without disclosing a transaction or requesting a price. */
|
|
67
73
|
getBroadcasters(options: {
|
|
68
74
|
tokenAddress: string;
|
|
75
|
+
signal?: AbortSignal;
|
|
69
76
|
}): Promise<BroadcasterClient[]>;
|
|
70
77
|
}
|
|
71
78
|
|
|
@@ -73,7 +80,7 @@ declare class Protocol extends Protocol$1 {
|
|
|
73
80
|
declare class AddressRegistry extends AddressRegistry$1 {
|
|
74
81
|
prepareRegistration(options: RegistrationPreparation | (Omit<RegistrationPreparation, "reader"> & {
|
|
75
82
|
provider: Provider;
|
|
76
|
-
})): Promise<
|
|
83
|
+
})): Promise<_invisi_labs_rpc.RegistrationOperation>;
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
interface BroadcasterRegistration {
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AddressRegistry,
|
|
3
|
-
BroadcasterClient,
|
|
4
|
-
BroadcasterRpcError,
|
|
5
3
|
Invisi,
|
|
6
4
|
PreparedTransaction,
|
|
7
|
-
|
|
5
|
+
decryptCandidates,
|
|
6
|
+
extractDeliveryCandidates,
|
|
7
|
+
readProtocolLogs
|
|
8
|
+
} from "./chunk-FKF67XE6.js";
|
|
9
|
+
import "./chunk-HLH5JZD4.js";
|
|
10
|
+
import "./chunk-THMD5QO2.js";
|
|
11
|
+
import {
|
|
12
|
+
TransactionOutput
|
|
13
|
+
} from "./chunk-DGMVGFKM.js";
|
|
14
|
+
import {
|
|
15
|
+
BroadcasterClient,
|
|
16
|
+
BroadcasterRpcError,
|
|
8
17
|
broadcasterQuoteDomain,
|
|
9
18
|
broadcasterQuoteTypes,
|
|
10
19
|
broadcasterRequestHash,
|
|
11
20
|
broadcasterTransactInterface,
|
|
12
21
|
decodeBroadcasterIntent,
|
|
13
|
-
decryptCandidates,
|
|
14
|
-
defineGasBenchmarks,
|
|
15
|
-
extractDeliveryCandidates,
|
|
16
|
-
readProtocolLogs,
|
|
17
22
|
verifyBroadcasterQuote
|
|
18
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-R5YAOJKB.js";
|
|
24
|
+
import "./chunk-RY4M2CIQ.js";
|
|
19
25
|
import {
|
|
20
26
|
InvisiError,
|
|
21
27
|
NoteOutput,
|
|
@@ -23,10 +29,10 @@ import {
|
|
|
23
29
|
decodePaymentRequest,
|
|
24
30
|
encodePaymentNote,
|
|
25
31
|
encodePaymentRequest
|
|
26
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-GUD3LAUO.js";
|
|
27
33
|
import {
|
|
28
34
|
EthersChainReader
|
|
29
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-4VI6LYGH.js";
|
|
30
36
|
|
|
31
37
|
// src/index.ts
|
|
32
38
|
import {
|
|
@@ -35,10 +41,8 @@ import {
|
|
|
35
41
|
MAX_MEMO_BYTES,
|
|
36
42
|
MissingCapabilityError,
|
|
37
43
|
NullifierCapability,
|
|
38
|
-
PublicWallet,
|
|
39
44
|
ViewingCapability,
|
|
40
45
|
Wallet as Wallet2,
|
|
41
|
-
WalletAuthorization,
|
|
42
46
|
computeCreditNullifier,
|
|
43
47
|
creditPeriods,
|
|
44
48
|
creditV1,
|
|
@@ -46,8 +50,8 @@ import {
|
|
|
46
50
|
decodeMemoText,
|
|
47
51
|
encodeMemo,
|
|
48
52
|
fundsV1
|
|
49
|
-
} from "@invisi-labs/
|
|
50
|
-
import { RegistrationOperation } from "@invisi-labs/
|
|
53
|
+
} from "@invisi-labs/primitives";
|
|
54
|
+
import { RegistrationOperation } from "@invisi-labs/rpc";
|
|
51
55
|
|
|
52
56
|
// src/disclosure/DisclosureVerifier.ts
|
|
53
57
|
function check(value, message) {
|
|
@@ -177,7 +181,7 @@ function protocolConnection(protocol) {
|
|
|
177
181
|
}
|
|
178
182
|
|
|
179
183
|
// src/protocol/Protocol.ts
|
|
180
|
-
import { Protocol as BaseProtocol } from "@invisi-labs/
|
|
184
|
+
import { Protocol as BaseProtocol } from "@invisi-labs/rpc";
|
|
181
185
|
import { getAddress } from "ethers";
|
|
182
186
|
var sources = /* @__PURE__ */ new WeakMap();
|
|
183
187
|
var Protocol = class _Protocol extends BaseProtocol {
|
|
@@ -194,9 +198,11 @@ var Protocol = class _Protocol extends BaseProtocol {
|
|
|
194
198
|
);
|
|
195
199
|
return protocol;
|
|
196
200
|
}
|
|
197
|
-
/**
|
|
201
|
+
/** Discover token support without disclosing a transaction or requesting a price. */
|
|
198
202
|
async getBroadcasters(options) {
|
|
203
|
+
options.signal?.throwIfAborted();
|
|
199
204
|
const token = getAddress(options.tokenAddress);
|
|
205
|
+
if (BigInt(token) === 0n) throw Error("Invalid Broadcaster token address");
|
|
200
206
|
if (!this.deployment.broadcasterRegistry)
|
|
201
207
|
throw new Error("broadcaster registry is not configured");
|
|
202
208
|
const rpc = sources.get(this);
|
|
@@ -206,9 +212,11 @@ var Protocol = class _Protocol extends BaseProtocol {
|
|
|
206
212
|
let block;
|
|
207
213
|
const seen = /* @__PURE__ */ new Set();
|
|
208
214
|
do {
|
|
215
|
+
options.signal?.throwIfAborted();
|
|
209
216
|
const page = await rpc.getBroadcasters({
|
|
210
217
|
enabled: true,
|
|
211
218
|
limit: 100,
|
|
219
|
+
...options.signal ? { signal: options.signal } : {},
|
|
212
220
|
...after ? { after } : {},
|
|
213
221
|
...block ? { block } : {}
|
|
214
222
|
});
|
|
@@ -217,14 +225,28 @@ var Protocol = class _Protocol extends BaseProtocol {
|
|
|
217
225
|
page.broadcasters.map(async (entry) => {
|
|
218
226
|
if (!entry.enabled) return void 0;
|
|
219
227
|
try {
|
|
220
|
-
const client = new BroadcasterClient(
|
|
221
|
-
|
|
228
|
+
const client = new BroadcasterClient({
|
|
229
|
+
endpoint: entry.endpoint,
|
|
230
|
+
quoteSigner: entry.quoteSigner,
|
|
231
|
+
feeRecipient: entry.feeRecipient
|
|
232
|
+
});
|
|
233
|
+
if (!await client.supportsToken(
|
|
234
|
+
token,
|
|
235
|
+
{
|
|
236
|
+
chainId: this.context.chainId,
|
|
237
|
+
protocol: this.context.protocolAddress
|
|
238
|
+
},
|
|
239
|
+
options
|
|
240
|
+
))
|
|
241
|
+
return void 0;
|
|
222
242
|
return client;
|
|
223
243
|
} catch {
|
|
244
|
+
options.signal?.throwIfAborted();
|
|
224
245
|
return void 0;
|
|
225
246
|
}
|
|
226
247
|
})
|
|
227
248
|
);
|
|
249
|
+
options.signal?.throwIfAborted();
|
|
228
250
|
clients.push(
|
|
229
251
|
...compatible.filter((client) => client !== void 0)
|
|
230
252
|
);
|
|
@@ -353,15 +375,18 @@ var ProtocolRpcClient = class extends RpcClient {
|
|
|
353
375
|
}
|
|
354
376
|
};
|
|
355
377
|
|
|
378
|
+
// src/index.ts
|
|
379
|
+
import { getDocumentedGasReference } from "@invisi-labs/protocol";
|
|
380
|
+
|
|
356
381
|
// src/payment-note/PaymentNote.ts
|
|
357
|
-
import { computeNoteIdentity, computeNoteCommitment, Wallet } from "@invisi-labs/
|
|
382
|
+
import { computeNoteIdentity, computeNoteCommitment, Wallet } from "@invisi-labs/primitives";
|
|
358
383
|
|
|
359
384
|
// src/payment-note/verification.ts
|
|
360
385
|
import {
|
|
361
386
|
poseidonHash,
|
|
362
387
|
TREE_DEPTH,
|
|
363
388
|
computeNoteNullifier
|
|
364
|
-
} from "@invisi-labs/
|
|
389
|
+
} from "@invisi-labs/primitives";
|
|
365
390
|
import { getAddress as getAddress3 } from "ethers";
|
|
366
391
|
function verificationOptions(protocol, options = {}) {
|
|
367
392
|
const connected = protocolConnection(protocol);
|
|
@@ -395,13 +420,6 @@ async function verifyPaymentNote(data, protocol, options, wallet) {
|
|
|
395
420
|
await protocol.validateDeployment(reader);
|
|
396
421
|
if (wallet && getAddress3(wallet.ownerAddress) !== getAddress3(data.ownerAddress))
|
|
397
422
|
throw new Error("Payment note owner mismatch");
|
|
398
|
-
if (wallet) {
|
|
399
|
-
if (typeof wallet.exportAuthorization !== "function")
|
|
400
|
-
throw new Error("Wallet spending authorization capability required");
|
|
401
|
-
const authorization = wallet.exportAuthorization();
|
|
402
|
-
if (getAddress3(authorization.ownerAddress) !== getAddress3(data.ownerAddress))
|
|
403
|
-
throw new Error("Wallet authorization owner mismatch");
|
|
404
|
-
}
|
|
405
423
|
const latest = await reader.getLatestBlockNumber();
|
|
406
424
|
const number = latest - BigInt(confirmations - 1);
|
|
407
425
|
if (number < protocol.deployment.protocol.fromBlock)
|
|
@@ -434,7 +452,12 @@ async function verifyPaymentNote(data, protocol, options, wallet) {
|
|
|
434
452
|
let spendabilityCheckedAt;
|
|
435
453
|
if (wallet) {
|
|
436
454
|
const current = await reader.getBlock(await reader.getLatestBlockNumber());
|
|
437
|
-
const nullifier = await computeNoteNullifier(
|
|
455
|
+
const nullifier = await computeNoteNullifier(
|
|
456
|
+
data.chainId,
|
|
457
|
+
BigInt(data.protocolAddress),
|
|
458
|
+
data.nonce,
|
|
459
|
+
data.commitment
|
|
460
|
+
);
|
|
438
461
|
const spent = await reader.isSpent(protocol.context, [nullifier], current);
|
|
439
462
|
if (spent.length !== 1 || spent[0] !== false)
|
|
440
463
|
throw new Error("Payment note is already spent");
|
|
@@ -522,6 +545,7 @@ var PaymentNote = class _PaymentNote {
|
|
|
522
545
|
const identity = await computeNoteIdentity(BigInt(data.ownerAddress), data.nonce);
|
|
523
546
|
const commitment = await computeNoteCommitment(
|
|
524
547
|
data.chainId,
|
|
548
|
+
BigInt(data.protocolAddress),
|
|
525
549
|
identity,
|
|
526
550
|
BigInt(data.tokenAddress),
|
|
527
551
|
data.amount
|
|
@@ -540,8 +564,7 @@ var PaymentNote = class _PaymentNote {
|
|
|
540
564
|
return verified;
|
|
541
565
|
}
|
|
542
566
|
async verifySpendable(protocol, wallet, options = {}) {
|
|
543
|
-
if (!(wallet instanceof Wallet))
|
|
544
|
-
throw new Error("Wallet spending authorization capability required");
|
|
567
|
+
if (!(wallet instanceof Wallet)) throw new Error("A public Wallet is required");
|
|
545
568
|
const result = await verifyPaymentNote(
|
|
546
569
|
this.data(),
|
|
547
570
|
protocol,
|
|
@@ -561,11 +584,20 @@ var PaymentNote = class _PaymentNote {
|
|
|
561
584
|
return { chainId, protocolAddress, tokenAddress, amount, ownerAddress, nonce, commitment };
|
|
562
585
|
}
|
|
563
586
|
};
|
|
587
|
+
|
|
588
|
+
// src/index.ts
|
|
589
|
+
import {
|
|
590
|
+
authenticatedDecryptor,
|
|
591
|
+
DeliveryDecryptionError,
|
|
592
|
+
DeliveryAuthenticationError
|
|
593
|
+
} from "@invisi-labs/primitives";
|
|
564
594
|
export {
|
|
565
595
|
AddressRegistry,
|
|
566
596
|
BroadcasterClient,
|
|
567
597
|
BroadcasterRegistry,
|
|
568
598
|
BroadcasterRpcError,
|
|
599
|
+
DeliveryAuthenticationError,
|
|
600
|
+
DeliveryDecryptionError,
|
|
569
601
|
Detector,
|
|
570
602
|
Disclosure,
|
|
571
603
|
DisclosureVerifier,
|
|
@@ -581,14 +613,13 @@ export {
|
|
|
581
613
|
Protocol,
|
|
582
614
|
ProtocolRpcClient,
|
|
583
615
|
ProtocolRpcError,
|
|
584
|
-
PublicWallet,
|
|
585
616
|
RegistrationOperation,
|
|
586
617
|
SpendablePaymentNote,
|
|
587
618
|
TransactionOutput,
|
|
588
619
|
VerifiedPaymentNote,
|
|
589
620
|
ViewingCapability,
|
|
590
621
|
Wallet2 as Wallet,
|
|
591
|
-
|
|
622
|
+
authenticatedDecryptor,
|
|
592
623
|
broadcasterQuoteDomain,
|
|
593
624
|
broadcasterQuoteTypes,
|
|
594
625
|
broadcasterRequestHash,
|
|
@@ -602,11 +633,11 @@ export {
|
|
|
602
633
|
decodePaymentNote,
|
|
603
634
|
decodePaymentRequest,
|
|
604
635
|
decryptCandidates,
|
|
605
|
-
defineGasBenchmarks,
|
|
606
636
|
encodeMemo,
|
|
607
637
|
encodePaymentNote,
|
|
608
638
|
encodePaymentRequest,
|
|
609
639
|
fundsV1,
|
|
640
|
+
getDocumentedGasReference,
|
|
610
641
|
readProtocolLogs,
|
|
611
642
|
verifyBroadcasterQuote
|
|
612
643
|
};
|