@invisi-labs/primitives 0.0.0-stage → 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.
@@ -0,0 +1,511 @@
1
+ import { ReceivingAddress } from './address.cjs';
2
+ export { DecodedAddress, ReceivingKeyLookup, decodeAddress } from './address.cjs';
3
+ import { N as NoteBytes, a as NoteDecryptionContext, C as CreditStateDecryptionContext } from './encryption-P2HJ89FQ.cjs';
4
+ export { b as CreditStateEncryptionContext, c as NoteEncryptionContext, d as decryptCreditState, e as decryptPrivateTransferNote, f as encryptCreditState, g as encryptPrivateTransferNote } from './encryption-P2HJ89FQ.cjs';
5
+ import { a as CreditState, b as CreditPolicy, c as CreditUsage, N as Note, P as ProtocolContext, C as CreditDeliveryState, d as CreditDataV1, F as FundsDataV1 } from './types-CEAuh35C.cjs';
6
+ export { e as CreditStateRecovery, M as MAX_MEMO_BYTES, f as Memo, R as ReceivingKeys, g as decodeMemoText, h as encodeMemo } from './types-CEAuh35C.cjs';
7
+ export { computeNoteCommitment, computeNoteIdentity, computeNoteNullifier } from './note.cjs';
8
+ export { CREDIT_POLICY_FIELDS, CREDIT_USAGE_FIELDS, CreditUpdateChanges, applyCreditDrawUsage, computeCreditCommitment, computeCreditNullifier, computeCreditRecoveryPad, computeCreditSharedKeyHash, creditPeriods, deriveCreditState, deriveCreditStateNonce, deriveCreditUpdate, normalizeCreditDeliveryState, normalizeCreditPolicy, normalizeCreditState, normalizeCreditUsage, recoverCreditState } from './credit.cjs';
9
+ import { TypedDataField, TypedDataDomain, BytesLike } from 'ethers';
10
+
11
+ /** Compressed secp256k1 viewing key (33 bytes), independent of spending authority. */
12
+ declare function viewingPublicKey(key: NoteBytes): Uint8Array;
13
+
14
+ /** Current protocol Poseidon2 domain tags. */
15
+ declare const D_IDENT = 2n;
16
+ declare const D_NOTE = 3n;
17
+ declare const D_NULL = 4n;
18
+ declare const D_CREDIT = 5n;
19
+ declare const D_CNULL = 6n;
20
+ declare const D_CREDIT_KEY_HASH = 7n;
21
+ declare const D_CREDIT_RECOVERY = 9n;
22
+ declare const D_CREDIT_STATE_NONCE = 10n;
23
+ declare const TREE_DEPTH = 16;
24
+
25
+ /** Barretenberg's length-separated rate-three BN254 Poseidon2 sponge. */
26
+ declare function poseidonHash(inputs: bigint[]): Promise<`0x${string}`>;
27
+
28
+ /** BN254 scalar field modulus. */
29
+ declare const FIELD_MODULUS = 21888242871839275222246405745257275088548364400416034343698204186575808495617n;
30
+ /** Uniform canonical BN254 nonce, sampled using browser/Node Web Crypto. */
31
+ declare function generateNonce(): bigint;
32
+ /** Independent shared Credit secret. Never derive it from a note/master secret. */
33
+ declare function generateCreditSharedKey(): bigint;
34
+
35
+ /** A Credit commitment opening excludes encrypted memos and the shared recovery/nullifier secret. */
36
+ interface CreditOpening extends Omit<CreditState, "creditSharedKey" | "memo" | keyof CreditPolicy | keyof CreditUsage>, CreditPolicy, CreditUsage {
37
+ creditSharedKeyHash: `0x${string}`;
38
+ }
39
+ /** Independently authenticated output data. Core verification alone does not establish inclusion. */
40
+ interface DisclosureOutput {
41
+ chainId: bigint;
42
+ protocolAddress: bigint;
43
+ tokenAddress: bigint;
44
+ outputCommitment: `0x${string}`;
45
+ role: "funds" | "owner" | "spender";
46
+ ciphertext?: NoteBytes | undefined;
47
+ }
48
+ /** Sensitive transport material: obtain it only through the explicit export() operation. */
49
+ interface DisclosureExport {
50
+ version: 1;
51
+ kind: "note" | "credit";
52
+ method: "opening" | "payload-key";
53
+ context: {
54
+ chainId: string;
55
+ protocolAddress: string;
56
+ tokenAddress: string;
57
+ outputCommitment: `0x${string}`;
58
+ };
59
+ data: Record<string, string>;
60
+ }
61
+ type DisclosureResult = {
62
+ kind: "note";
63
+ note: Readonly<Note>;
64
+ } | {
65
+ kind: "credit";
66
+ note: Readonly<CreditOpening & {
67
+ payload?: Uint8Array;
68
+ }>;
69
+ };
70
+ /** Scoped disclosure material. Default JSON/inspection is redacted; export() is deliberately sensitive. */
71
+ declare class Disclosure {
72
+ #private;
73
+ private constructor();
74
+ static fromNote(value: Note): Promise<Disclosure>;
75
+ static fromCredit(value: CreditState): Promise<Disclosure>;
76
+ /** Low-level factory; normally use wallet.getViewer().discloseNote(). */
77
+ static fromEncryptedNote(key: NoteBytes, envelope: NoteBytes, value: NoteDecryptionContext): Promise<Disclosure>;
78
+ /** Exposes the full selected Credit envelope, including its shared key and receiving snapshots. */
79
+ static fromEncryptedCredit(key: NoteBytes, envelope: NoteBytes, value: CreditStateDecryptionContext): Promise<Disclosure>;
80
+ private static fromEnvelope;
81
+ /** Parse untrusted JSON material; verification against an independent output is still required. */
82
+ static fromExport(value: unknown): Promise<Disclosure>;
83
+ getScope(): {
84
+ version: 1;
85
+ kind: "credit" | "note";
86
+ method: "opening" | "payload-key";
87
+ permitsOwnerSweep: boolean;
88
+ revealsNoteConsumption: boolean;
89
+ revealsCreditSharedKey: boolean;
90
+ revealsReceivingKeys: boolean;
91
+ revealsMemo: boolean;
92
+ revealsPayload: boolean;
93
+ };
94
+ /** Explicitly export sensitive, JSON-compatible material for a chosen recipient. */
95
+ export(): DisclosureExport;
96
+ verify(value: DisclosureOutput): Promise<DisclosureResult>;
97
+ toJSON(): {
98
+ version: 1;
99
+ kind: "credit" | "note";
100
+ method: "opening" | "payload-key";
101
+ permitsOwnerSweep: boolean;
102
+ revealsNoteConsumption: boolean;
103
+ revealsCreditSharedKey: boolean;
104
+ revealsReceivingKeys: boolean;
105
+ revealsMemo: boolean;
106
+ revealsPayload: boolean;
107
+ capability: string;
108
+ };
109
+ }
110
+
111
+ /** A requested permission was not explicitly supplied to this component. */
112
+ declare class MissingCapabilityError extends Error {
113
+ readonly capability: string;
114
+ readonly code = "MISSING_CAPABILITY";
115
+ constructor(capability: string);
116
+ }
117
+
118
+ /** Derive the canonical 32-byte Decaf377 clue key from a nonzero FMD scalar. */
119
+ declare function deriveClueKey(detectionKey: Uint8Array): Uint8Array;
120
+ /** Reject malformed, noncanonical, or identity clue keys. */
121
+ declare function validateClueKey(clueKey: Uint8Array): void;
122
+ /** Create a fixed 24-bit clue using a fresh WebCrypto random seed. */
123
+ declare function createClue(clueKey: Uint8Array): Uint8Array;
124
+ /**
125
+ * Deterministic interoperability/backend entry point. Seed must be independently
126
+ * generated with a CSPRNG for every production clue; never reuse a fixed seed.
127
+ */
128
+ declare function createClueFromSeed(clueKey: Uint8Array, seed32: Uint8Array): Uint8Array;
129
+
130
+ type WalletBytes = Uint8Array | `0x${string}`;
131
+ declare const OPERATIONS: {
132
+ readonly transact: "Transact";
133
+ readonly "create-credit": "CreateCredit";
134
+ readonly "credit-draw": "CreditDraw";
135
+ readonly "update-credit": "UpdateCredit";
136
+ };
137
+ type WalletOperation = keyof typeof OPERATIONS;
138
+ interface WalletAuthorizationRequest {
139
+ context: ProtocolContext;
140
+ operation: WalletOperation;
141
+ capacity: number;
142
+ /** Complete, canonically padded operation words before the two digest limbs. */
143
+ words: readonly bigint[];
144
+ }
145
+ declare const WALLET_AUTHORIZATION_TYPES: {
146
+ readonly WalletAuthorization: readonly [{
147
+ readonly name: "operation";
148
+ readonly type: "bytes32";
149
+ }, {
150
+ readonly name: "statementHash";
151
+ readonly type: "bytes32";
152
+ }];
153
+ };
154
+ /** Standard EVM owner address from a validated secp256k1 public key. */
155
+ declare function computeOwnerAddress(publicKey: WalletBytes): Promise<`0x${string}`>;
156
+ /** EIP712 data for private circuit authorization, independent of EVM funding signatures. */
157
+ declare function walletAuthorizationTypedData(request: WalletAuthorizationRequest): {
158
+ domain: {
159
+ name: string;
160
+ version: string;
161
+ chainId: bigint;
162
+ verifyingContract: `0x${string}`;
163
+ };
164
+ types: {
165
+ readonly WalletAuthorization: readonly [{
166
+ readonly name: "operation";
167
+ readonly type: "bytes32";
168
+ }, {
169
+ readonly name: "statementHash";
170
+ readonly type: "bytes32";
171
+ }];
172
+ };
173
+ primaryType: "WalletAuthorization";
174
+ message: {
175
+ operation: `0x${string}`;
176
+ statementHash: `0x${string}`;
177
+ };
178
+ };
179
+ declare function computeWalletAuthorizationDigest(request: WalletAuthorizationRequest): `0x${string}`;
180
+ declare function verifyWalletAuthorization(expectedIdentity: `0x${string}`, publicKey: WalletBytes, signature: WalletBytes, request: WalletAuthorizationRequest): Promise<boolean>;
181
+ interface WalletAuthorizationWitness {
182
+ public_key_x: number[];
183
+ public_key_y: number[];
184
+ signature: number[];
185
+ }
186
+
187
+ type Identity = `0x${string}`;
188
+ declare const inspect: unique symbol;
189
+ /** Local viewing permission, permitting note recovery and owner-only sweep, without arbitrary spending. */
190
+ declare class ViewingCapability {
191
+ #private;
192
+ readonly ownerAddress: Identity;
193
+ constructor(ownerAddress: Identity, privateKey: WalletBytes, expectedPublicKey?: Uint8Array);
194
+ decryptNote(envelope: NoteBytes, context: Omit<NoteDecryptionContext, "ownerAddress">): Promise<Note & {
195
+ payload: Uint8Array;
196
+ }>;
197
+ decryptCredit(envelope: NoteBytes, context: Omit<CreditStateDecryptionContext, "ownerAddress">): Promise<CreditDeliveryState & {
198
+ note: CreditState & {
199
+ payload: Uint8Array;
200
+ };
201
+ }>;
202
+ getPublicKey(): Uint8Array;
203
+ /** Disclose this authenticated output's payload key, without exporting the wallet viewing key. */
204
+ discloseNote(envelope: NoteBytes, context: Omit<NoteDecryptionContext, "ownerAddress">): Promise<Disclosure>;
205
+ /** Exposes the entire Credit envelope; prefer Disclosure.fromCredit() for hash-only opening. */
206
+ discloseCredit(envelope: NoteBytes, context: Omit<CreditStateDecryptionContext, "ownerAddress">): Promise<Disclosure>;
207
+ /** Explicit sensitive export for delegating viewing. It grants note recovery and owner-only sweep permission. */
208
+ exportKey(): Uint8Array;
209
+ toJSON(): {
210
+ capability: string;
211
+ ownerAddress: `0x${string}`;
212
+ };
213
+ [inspect](): {
214
+ capability: string;
215
+ ownerAddress: `0x${string}`;
216
+ };
217
+ }
218
+ /** Delegated candidate detection key, without viewing or spending. */
219
+ declare class Detector {
220
+ #private;
221
+ constructor(key: Uint8Array);
222
+ getClueKey(): Uint8Array;
223
+ /** Full detection delegation; the receiver chooses the checked prefix length. */
224
+ exportKey(): Uint8Array;
225
+ toJSON(): {
226
+ capability: string;
227
+ };
228
+ [inspect](): {
229
+ capability: string;
230
+ };
231
+ }
232
+ /** Note-derived spent-state calculation; the note opening supplies its nonce. */
233
+ declare class NullifierCapability {
234
+ readonly ownerAddress: Identity;
235
+ private constructor();
236
+ static fromIdentity(ownerAddress: Identity): NullifierCapability;
237
+ compute(chainId: bigint, protocolAddress: bigint, commitment: Identity, nonce: bigint): Promise<Identity>;
238
+ toJSON(): {
239
+ capability: string;
240
+ ownerAddress: `0x${string}`;
241
+ };
242
+ [inspect](): {
243
+ capability: string;
244
+ ownerAddress: `0x${string}`;
245
+ };
246
+ }
247
+ /** Frozen local authorization. Witness access is an explicit trusted proving boundary. */
248
+ declare class AuthorizedStatement {
249
+ #private;
250
+ readonly digest: Identity;
251
+ readonly ownerAddress: Identity;
252
+ constructor(ownerAddress: Identity, digest: Identity, witness: WalletAuthorizationWitness);
253
+ withWitness<T>(assemble: (witness: WalletAuthorizationWitness) => T): T;
254
+ toJSON(): {
255
+ ownerAddress: `0x${string}`;
256
+ digest: `0x${string}`;
257
+ };
258
+ [inspect](): {
259
+ ownerAddress: `0x${string}`;
260
+ digest: `0x${string}`;
261
+ };
262
+ }
263
+
264
+ /** Public identity and receiving keys. */
265
+ declare class WalletAddress {
266
+ #private;
267
+ protected constructor(address: ReceivingAddress);
268
+ get ownerAddress(): `0x${string}`;
269
+ get viewingPublicKey(): Uint8Array;
270
+ get clueKey(): Uint8Array;
271
+ /** Complete 0i receiving address. Owner-only wallets must first resolve their receiving keys. */
272
+ getAddress(): string;
273
+ getReceivingAddress(): ReceivingAddress;
274
+ /** Nullifiers derive from public identity and do not grant spending authority. */
275
+ exportNullifier(): NullifierCapability;
276
+ toJSON(): {
277
+ ownerAddress: `0x${string}`;
278
+ address: string;
279
+ };
280
+ }
281
+ /** Address-only wallet. Contains no private keys or private capability methods. */
282
+ declare class Wallet extends WalletAddress {
283
+ private constructor();
284
+ /** Parse a complete 0i address or an EVM owner address without network access. */
285
+ static fromAddress(address: ReceivingAddress | string): Wallet;
286
+ }
287
+
288
+ type Hex = `0x${string}`;
289
+ type Address = `0x${string}`;
290
+
291
+ /** JSON-safe EIP-712 data, directly consumable by an external signing tool. */
292
+ interface SigningRequest {
293
+ domain: {
294
+ name?: string;
295
+ version?: string;
296
+ chainId?: string;
297
+ verifyingContract?: string;
298
+ salt?: string;
299
+ };
300
+ primaryType: string;
301
+ types: Record<string, TypedDataField[]>;
302
+ message: Record<string, unknown>;
303
+ }
304
+ /** Normalize through ethers; do not implement a second typed-data encoder. */
305
+ declare function createSigningRequest(data: {
306
+ domain: TypedDataDomain;
307
+ primaryType: string;
308
+ types: Record<string, readonly TypedDataField[]>;
309
+ message: Record<string, unknown>;
310
+ }): SigningRequest;
311
+
312
+ /** Stable transport resource bound; applications do not select the SDK envelope version. */
313
+ declare const MAX_CIPHERTEXT_BYTES = 4096;
314
+ type DeliveryKind = "funds" | "credit";
315
+ declare function deliveryHeader(kind: DeliveryKind): number;
316
+ declare function decodeDeliveryHeader(header: number): {
317
+ kind: DeliveryKind;
318
+ version: number;
319
+ };
320
+ /** Dispatch only SDK-owned envelope implementations. Future versions are added here. */
321
+ declare function deliveryCodec(header: number): {
322
+ domain: string;
323
+ kind: "funds";
324
+ version: number;
325
+ minimum: number;
326
+ maximum: number;
327
+ encode(note: Note): Uint8Array<ArrayBufferLike>;
328
+ decode(plain: Uint8Array, context: NoteDecryptionContext): {
329
+ chainId: bigint;
330
+ protocolAddress: bigint;
331
+ tokenAddress: bigint;
332
+ ownerAddress: `0x${string}`;
333
+ amount: bigint;
334
+ nonce: bigint;
335
+ payload: Uint8Array<ArrayBufferLike>;
336
+ };
337
+ } | {
338
+ domain: string;
339
+ kind: "credit";
340
+ version: number;
341
+ minimum: number;
342
+ maximum: number;
343
+ encode(input: CreditDeliveryState): Uint8Array<ArrayBufferLike>;
344
+ decode(plain: Uint8Array, context: CreditStateDecryptionContext): CreditDeliveryState;
345
+ };
346
+ declare function validateDeliveryCiphertext(value: BytesLike, kind?: DeliveryKind): Uint8Array;
347
+
348
+ /** Pure memo codec: payload version1 followed by memo bytes; no flags or address semantics. */
349
+ declare const fundsV1: Readonly<{
350
+ encode(data?: FundsDataV1): Uint8Array;
351
+ decode(value: Uint8Array): {
352
+ memo?: Uint8Array;
353
+ };
354
+ }>;
355
+ /** Credit uses the same memo-only application layout, independently of its financial fields. */
356
+ declare const creditV1: Readonly<{
357
+ encode(data?: CreditDataV1): Uint8Array;
358
+ decode(value: Uint8Array): {
359
+ memo?: Uint8Array;
360
+ };
361
+ }>;
362
+
363
+ type WalletHex = `0x${string}`;
364
+ type WalletMethod = "wallet.public" | "wallet.detect" | "wallet.decryptNote" | "wallet.decryptCredit" | "wallet.authorize";
365
+ interface WalletWireContext {
366
+ chainId: string;
367
+ protocolAddress: string;
368
+ }
369
+ interface WalletDecryptContext extends WalletWireContext {
370
+ tokenAddress: string;
371
+ outputCommitment: WalletHex;
372
+ role?: "owner" | "spender";
373
+ }
374
+ interface WalletParams {
375
+ "wallet.public": Record<string, never>;
376
+ "wallet.detect": {
377
+ clues: WalletHex[];
378
+ };
379
+ "wallet.decryptNote": {
380
+ envelope: WalletHex;
381
+ context: WalletDecryptContext;
382
+ };
383
+ "wallet.decryptCredit": {
384
+ envelope: WalletHex;
385
+ context: WalletDecryptContext;
386
+ };
387
+ "wallet.authorize": {
388
+ operation: WalletOperation;
389
+ capacity: number;
390
+ words: string[];
391
+ context: WalletWireContext;
392
+ };
393
+ }
394
+ interface WalletResults {
395
+ "wallet.public": {
396
+ viewingPublicKey: WalletHex;
397
+ spendingPublicKey: WalletHex;
398
+ clueKey: WalletHex;
399
+ };
400
+ "wallet.detect": {
401
+ matches: boolean[];
402
+ };
403
+ "wallet.decryptNote": {
404
+ plaintext: WalletHex;
405
+ };
406
+ "wallet.decryptCredit": {
407
+ plaintext: WalletHex;
408
+ };
409
+ "wallet.authorize": {
410
+ spendingPublicKey: WalletHex;
411
+ signature: WalletHex;
412
+ digest: WalletHex;
413
+ };
414
+ }
415
+ interface WalletAcceptedResults {
416
+ "wallet.public": WalletResults["wallet.public"];
417
+ "wallet.detect": WalletResults["wallet.detect"];
418
+ "wallet.decryptNote": Note & {
419
+ payload: Uint8Array;
420
+ };
421
+ "wallet.decryptCredit": CreditDeliveryState & {
422
+ note: CreditState & {
423
+ payload: Uint8Array;
424
+ };
425
+ };
426
+ "wallet.authorize": AuthorizedStatement;
427
+ }
428
+ type WalletRequest<M extends WalletMethod = WalletMethod> = {
429
+ version: 1;
430
+ id: string;
431
+ ownerAddress: WalletHex;
432
+ method: M;
433
+ params: WalletParams[M];
434
+ };
435
+ type WalletResponse<M extends WalletMethod = WalletMethod> = {
436
+ version: 1;
437
+ id: string;
438
+ ownerAddress: WalletHex;
439
+ method: M;
440
+ } & ({
441
+ result: WalletResults[M];
442
+ error?: never;
443
+ } | {
444
+ error: {
445
+ code: string;
446
+ };
447
+ result?: never;
448
+ });
449
+ interface PreparedWalletRequest<M extends WalletMethod = WalletMethod> {
450
+ readonly request: WalletRequest<M>;
451
+ }
452
+ declare function prepareWalletRequest<M extends WalletMethod>(wallet: Wallet, id: string, method: M, params: WalletParams[M]): PreparedWalletRequest<M>;
453
+ /** Validate native output against the retained request before using it in business state. */
454
+ declare function acceptWalletResponse<M extends WalletMethod>(prepared: PreparedWalletRequest<M>, response: WalletResponse<M>): Promise<WalletAcceptedResults[M]>;
455
+ /** Native errors contain machine-readable codes only. */
456
+ declare class NativeWalletError extends Error {
457
+ readonly code: string;
458
+ constructor(code: string);
459
+ }
460
+ declare const MAX_WALLET_BATCH_BYTES: number;
461
+ declare function validateWalletBatch(requests: readonly WalletRequest[]): void;
462
+ /** Check every envelope before returning responses in request order. */
463
+ declare function validateWalletResponses(requests: readonly WalletRequest[], responses: readonly WalletResponse[]): WalletResponse[];
464
+ declare function acceptWalletResponses(prepared: readonly PreparedWalletRequest[], responses: readonly WalletResponse[]): Promise<unknown[]>;
465
+
466
+ declare function provenanceIntentHash(originalRequestHash: string): string;
467
+
468
+ type DeliveryDecryptionResult = Uint8Array | null | {
469
+ status: "authentication-failed";
470
+ };
471
+ interface DeliveryDetectionCandidate extends NoteDecryptionContext {
472
+ role: "funds" | "owner" | "spender";
473
+ clue: `0x${string}`;
474
+ ciphertext: `0x${string}`;
475
+ }
476
+ interface DeliveryDetectionBatch {
477
+ ownerAddress: `0x${string}`;
478
+ results: readonly ("candidate" | "not-recipient" | "unresolved")[];
479
+ }
480
+ /** App-owned decryption. Only null means nonrecipient; operational failures must reject. */
481
+ interface DeliveryDecryptor {
482
+ detect?(candidates: readonly DeliveryDetectionCandidate[]): Promise<DeliveryDetectionBatch>;
483
+ decryptNote(envelope: NoteBytes, context: NoteDecryptionContext): Promise<DeliveryDecryptionResult>;
484
+ decryptCredit(envelope: NoteBytes, context: CreditStateDecryptionContext): Promise<DeliveryDecryptionResult>;
485
+ }
486
+ /** Keeps App failures and invalid plaintext distinct from unrelated local scan candidates. */
487
+ declare class DeliveryDecryptionError extends Error {
488
+ constructor(cause: unknown);
489
+ }
490
+ /** Bind untrusted App plaintext to the requested wallet, deployment, token and commitment. */
491
+ declare function authenticatedDecryptor(wallet: Wallet, decryptor: DeliveryDecryptor): {
492
+ ownerAddress: `0x${string}`;
493
+ detectCandidates(candidates: readonly DeliveryDetectionCandidate[]): Promise<any[]>;
494
+ decryptNote(envelope: NoteBytes, context: Omit<NoteDecryptionContext, "ownerAddress">): Promise<{
495
+ chainId: bigint;
496
+ protocolAddress: bigint;
497
+ tokenAddress: bigint;
498
+ ownerAddress: `0x${string}`;
499
+ amount: bigint;
500
+ nonce: bigint;
501
+ payload: Uint8Array<ArrayBufferLike>;
502
+ } | null>;
503
+ decryptCredit(envelope: NoteBytes, context: Omit<CreditStateDecryptionContext, "ownerAddress">): Promise<CreditDeliveryState | null>;
504
+ };
505
+
506
+ /** AEAD failure is ambiguous: wrong recipient key, wrong context or damaged ciphertext. */
507
+ declare class DeliveryAuthenticationError extends Error {
508
+ constructor(cause?: unknown);
509
+ }
510
+
511
+ export { type Address, AuthorizedStatement, CreditDataV1, CreditDeliveryState, type CreditOpening, CreditPolicy, CreditState, CreditStateDecryptionContext, CreditUsage, D_CNULL, D_CREDIT, D_CREDIT_KEY_HASH, D_CREDIT_RECOVERY, D_CREDIT_STATE_NONCE, D_IDENT, D_NOTE, D_NULL, DeliveryAuthenticationError, DeliveryDecryptionError, type DeliveryDecryptionResult, type DeliveryDecryptor, type DeliveryDetectionBatch, type DeliveryDetectionCandidate, type DeliveryKind, Detector, Disclosure, type DisclosureExport, type DisclosureOutput, type DisclosureResult, FIELD_MODULUS, FundsDataV1, type Hex, MAX_CIPHERTEXT_BYTES, MAX_WALLET_BATCH_BYTES, MissingCapabilityError, NativeWalletError, Note, NoteBytes, NoteDecryptionContext, NullifierCapability, type PreparedWalletRequest, ProtocolContext, ReceivingAddress, type SigningRequest, TREE_DEPTH, ViewingCapability, WALLET_AUTHORIZATION_TYPES, Wallet, type WalletAcceptedResults, type WalletAuthorizationRequest, type WalletAuthorizationWitness, type WalletBytes, type WalletDecryptContext, type WalletHex, type WalletMethod, type WalletOperation, type WalletParams, type WalletRequest, type WalletResponse, type WalletResults, type WalletWireContext, acceptWalletResponse, acceptWalletResponses, authenticatedDecryptor, computeOwnerAddress, computeWalletAuthorizationDigest, createClue, createClueFromSeed, createSigningRequest, creditV1, decodeDeliveryHeader, deliveryCodec, deliveryHeader, deriveClueKey, fundsV1, generateCreditSharedKey, generateNonce, poseidonHash, prepareWalletRequest, provenanceIntentHash, validateClueKey, validateDeliveryCiphertext, validateWalletBatch, validateWalletResponses, verifyWalletAuthorization, viewingPublicKey, walletAuthorizationTypedData };