@hsuite/native-connect-types 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +50 -0
  2. package/dist/address-avatar.d.ts +67 -0
  3. package/dist/address-avatar.d.ts.map +1 -0
  4. package/dist/address-avatar.js +130 -0
  5. package/dist/address-avatar.js.map +1 -0
  6. package/dist/addressbook.d.ts +289 -0
  7. package/dist/addressbook.d.ts.map +1 -0
  8. package/dist/addressbook.js +82 -0
  9. package/dist/addressbook.js.map +1 -0
  10. package/dist/enrichment.d.ts +88 -0
  11. package/dist/enrichment.d.ts.map +1 -0
  12. package/dist/enrichment.js +47 -0
  13. package/dist/enrichment.js.map +1 -0
  14. package/dist/hedera-system-accounts.d.ts +49 -0
  15. package/dist/hedera-system-accounts.d.ts.map +1 -0
  16. package/dist/hedera-system-accounts.js +56 -0
  17. package/dist/hedera-system-accounts.js.map +1 -0
  18. package/dist/identity.d.ts +94 -0
  19. package/dist/identity.d.ts.map +1 -0
  20. package/dist/identity.js +190 -0
  21. package/dist/identity.js.map +1 -0
  22. package/dist/index.d.ts +43 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +52 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/ledger.d.ts +848 -0
  27. package/dist/ledger.d.ts.map +1 -0
  28. package/dist/ledger.js +152 -0
  29. package/dist/ledger.js.map +1 -0
  30. package/dist/messages.d.ts +726 -0
  31. package/dist/messages.d.ts.map +1 -0
  32. package/dist/messages.js +252 -0
  33. package/dist/messages.js.map +1 -0
  34. package/dist/multisig-account.d.ts +419 -0
  35. package/dist/multisig-account.d.ts.map +1 -0
  36. package/dist/multisig-account.js +201 -0
  37. package/dist/multisig-account.js.map +1 -0
  38. package/dist/private-key-export.d.ts +112 -0
  39. package/dist/private-key-export.d.ts.map +1 -0
  40. package/dist/private-key-export.js +11 -0
  41. package/dist/private-key-export.js.map +1 -0
  42. package/dist/rpc.d.ts +872 -0
  43. package/dist/rpc.d.ts.map +1 -0
  44. package/dist/rpc.js +143 -0
  45. package/dist/rpc.js.map +1 -0
  46. package/dist/transaction-approval.d.ts +895 -0
  47. package/dist/transaction-approval.d.ts.map +1 -0
  48. package/dist/transaction-approval.js +11 -0
  49. package/dist/transaction-approval.js.map +1 -0
  50. package/dist/transaction-parser.d.ts +93 -0
  51. package/dist/transaction-parser.d.ts.map +1 -0
  52. package/dist/transaction-parser.js +11 -0
  53. package/dist/transaction-parser.js.map +1 -0
  54. package/dist/vault.d.ts +673 -0
  55. package/dist/vault.d.ts.map +1 -0
  56. package/dist/vault.js +188 -0
  57. package/dist/vault.js.map +1 -0
  58. package/dist/widget.types.d.ts +323 -0
  59. package/dist/widget.types.d.ts.map +1 -0
  60. package/dist/widget.types.js +140 -0
  61. package/dist/widget.types.js.map +1 -0
  62. package/package.json +43 -0
  63. package/src/address-avatar.ts +181 -0
  64. package/src/addressbook.spec.ts +220 -0
  65. package/src/addressbook.ts +115 -0
  66. package/src/enrichment.ts +97 -0
  67. package/src/hedera-system-accounts.ts +60 -0
  68. package/src/identity.spec.ts +243 -0
  69. package/src/identity.ts +244 -0
  70. package/src/index.ts +197 -0
  71. package/src/ledger.spec.ts +366 -0
  72. package/src/ledger.ts +567 -0
  73. package/src/messages.ts +381 -0
  74. package/src/multisig-account.spec.ts +362 -0
  75. package/src/multisig-account.ts +310 -0
  76. package/src/private-key-export.ts +117 -0
  77. package/src/rpc.spec.ts +396 -0
  78. package/src/rpc.ts +257 -0
  79. package/src/transaction-approval.ts +1033 -0
  80. package/src/transaction-parser.ts +98 -0
  81. package/src/vault.spec.ts +268 -0
  82. package/src/vault.ts +256 -0
  83. package/src/widget.types.spec.ts +337 -0
  84. package/src/widget.types.ts +501 -0
  85. package/tsconfig.build.json +17 -0
  86. package/tsconfig.json +11 -0
  87. package/vitest.config.ts +36 -0
@@ -0,0 +1,673 @@
1
+ /**
2
+ * HSuite Native Connect
3
+ * Copyright 2024-2025 HSuite (https://hsuite.finance)
4
+ *
5
+ * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
6
+ *
7
+ * This file is part of HSuite Native Connect. For commercial licensing,
8
+ * visit https://hsuite.finance/licensing
9
+ */
10
+ /**
11
+ * @file Vault types for secure key storage and wallet configuration.
12
+ *
13
+ * This module defines the data structures for the wallet's secure vault system,
14
+ * which manages encrypted seed phrases, derived keys, and recovery mechanisms.
15
+ *
16
+ * Vault Architecture:
17
+ * - {@link VaultSeed} - Encrypted seed phrase storage with KDF parameters
18
+ * - {@link VaultKey} - Derived key with address and derivation path
19
+ * - {@link VaultProtection} - Protection mode (passphrase, biometric, hardware, KMS)
20
+ * - {@link VaultRecoveryBundle} - Encrypted backup for wallet restoration
21
+ * - {@link VaultConfig} - Global vault configuration and policies
22
+ *
23
+ * Protection Modes:
24
+ * - `none` - No additional protection (development only)
25
+ * - `passphrase` - User-provided passphrase with PBKDF2/Argon2
26
+ * - `biometric` - Device biometric authentication
27
+ * - `hardware` - Hardware security module (HSM/TPM)
28
+ * - `kms` - Cloud key management service
29
+ *
30
+ * @module types/vault
31
+ * @security SOC2-CC6.1 - Encryption at rest for seed phrases
32
+ */
33
+ import { z } from 'zod';
34
+ /**
35
+ * @description Schema for vault protection mode enum
36
+ */
37
+ export declare const VaultProtectionModeSchema: z.ZodEnum<["none", "passphrase", "hardware", "biometric", "kms"]>;
38
+ /**
39
+ * @description Type representing vault protection mode
40
+ */
41
+ export type VaultProtectionMode = z.infer<typeof VaultProtectionModeSchema>;
42
+ /**
43
+ * @description Schema for vault protection configuration
44
+ */
45
+ export declare const VaultProtectionSchema: z.ZodObject<{
46
+ mode: z.ZodEnum<["none", "passphrase", "hardware", "biometric", "kms"]>;
47
+ hint: z.ZodOptional<z.ZodString>;
48
+ hardwareId: z.ZodOptional<z.ZodString>;
49
+ biometricId: z.ZodOptional<z.ZodString>;
50
+ lastUnlockedAt: z.ZodOptional<z.ZodNumber>;
51
+ kmsKeyId: z.ZodOptional<z.ZodString>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ mode?: "passphrase" | "none" | "hardware" | "biometric" | "kms";
54
+ hint?: string;
55
+ hardwareId?: string;
56
+ biometricId?: string;
57
+ lastUnlockedAt?: number;
58
+ kmsKeyId?: string;
59
+ }, {
60
+ mode?: "passphrase" | "none" | "hardware" | "biometric" | "kms";
61
+ hint?: string;
62
+ hardwareId?: string;
63
+ biometricId?: string;
64
+ lastUnlockedAt?: number;
65
+ kmsKeyId?: string;
66
+ }>;
67
+ /**
68
+ * @description Type representing vault protection settings
69
+ */
70
+ export type VaultProtection = z.infer<typeof VaultProtectionSchema>;
71
+ /**
72
+ * @description Schema for recovery contact information
73
+ */
74
+ export declare const VaultRecoveryContactSchema: z.ZodObject<{
75
+ name: z.ZodString;
76
+ contact: z.ZodString;
77
+ }, "strip", z.ZodTypeAny, {
78
+ name?: string;
79
+ contact?: string;
80
+ }, {
81
+ name?: string;
82
+ contact?: string;
83
+ }>;
84
+ /**
85
+ * @description Type representing recovery contact
86
+ */
87
+ export type VaultRecoveryContact = z.infer<typeof VaultRecoveryContactSchema>;
88
+ /**
89
+ * @description Schema for recovery metadata and hints
90
+ */
91
+ export declare const VaultRecoverySchema: z.ZodObject<{
92
+ hint: z.ZodOptional<z.ZodString>;
93
+ contacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
94
+ name: z.ZodString;
95
+ contact: z.ZodString;
96
+ }, "strip", z.ZodTypeAny, {
97
+ name?: string;
98
+ contact?: string;
99
+ }, {
100
+ name?: string;
101
+ contact?: string;
102
+ }>, "many">>;
103
+ note: z.ZodOptional<z.ZodString>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ contacts?: {
106
+ name?: string;
107
+ contact?: string;
108
+ }[];
109
+ hint?: string;
110
+ note?: string;
111
+ }, {
112
+ contacts?: {
113
+ name?: string;
114
+ contact?: string;
115
+ }[];
116
+ hint?: string;
117
+ note?: string;
118
+ }>;
119
+ /**
120
+ * @description Type representing recovery configuration
121
+ */
122
+ export type VaultRecovery = z.infer<typeof VaultRecoverySchema>;
123
+ /**
124
+ * @description Schema for derived vault key
125
+ * Moved before VaultRecoveryBundleSchema to avoid forward reference.
126
+ */
127
+ export declare const VaultKeySchema: z.ZodObject<{
128
+ id: z.ZodString;
129
+ seedId: z.ZodString;
130
+ ledgerId: z.ZodString;
131
+ networkId: z.ZodString;
132
+ address: z.ZodString;
133
+ publicKey: z.ZodString;
134
+ derivationPath: z.ZodObject<{
135
+ purpose: z.ZodNumber;
136
+ coinType: z.ZodNumber;
137
+ account: z.ZodDefault<z.ZodNumber>;
138
+ change: z.ZodDefault<z.ZodNumber>;
139
+ addressIndex: z.ZodDefault<z.ZodNumber>;
140
+ }, "strip", z.ZodTypeAny, {
141
+ purpose?: number;
142
+ coinType?: number;
143
+ account?: number;
144
+ change?: number;
145
+ addressIndex?: number;
146
+ }, {
147
+ purpose?: number;
148
+ coinType?: number;
149
+ account?: number;
150
+ change?: number;
151
+ addressIndex?: number;
152
+ }>;
153
+ protection: z.ZodEnum<["none", "passphrase", "hardware", "biometric", "kms"]>;
154
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
155
+ }, "strip", z.ZodTypeAny, {
156
+ ledgerId?: string;
157
+ networkId?: string;
158
+ address?: string;
159
+ publicKey?: string;
160
+ metadata?: Record<string, unknown>;
161
+ id?: string;
162
+ derivationPath?: {
163
+ purpose?: number;
164
+ coinType?: number;
165
+ account?: number;
166
+ change?: number;
167
+ addressIndex?: number;
168
+ };
169
+ seedId?: string;
170
+ protection?: "passphrase" | "none" | "hardware" | "biometric" | "kms";
171
+ }, {
172
+ ledgerId?: string;
173
+ networkId?: string;
174
+ address?: string;
175
+ publicKey?: string;
176
+ metadata?: Record<string, unknown>;
177
+ id?: string;
178
+ derivationPath?: {
179
+ purpose?: number;
180
+ coinType?: number;
181
+ account?: number;
182
+ change?: number;
183
+ addressIndex?: number;
184
+ };
185
+ seedId?: string;
186
+ protection?: "passphrase" | "none" | "hardware" | "biometric" | "kms";
187
+ }>;
188
+ /**
189
+ * @description Type representing vault key
190
+ */
191
+ export type VaultKey = z.infer<typeof VaultKeySchema>;
192
+ /**
193
+ * @description Schema for user preferences stored in recovery bundle
194
+ */
195
+ export declare const BundleUserSettingsSchema: z.ZodObject<{
196
+ language: z.ZodOptional<z.ZodString>;
197
+ currency: z.ZodOptional<z.ZodString>;
198
+ autoLockSeconds: z.ZodOptional<z.ZodNumber>;
199
+ navigationMode: z.ZodOptional<z.ZodEnum<["menu", "tabs"]>>;
200
+ desktopNavMode: z.ZodOptional<z.ZodEnum<["classic", "sidebar"]>>;
201
+ telemetryDestination: z.ZodOptional<z.ZodEnum<["console", "server", "analytics"]>>;
202
+ telemetryEndpoint: z.ZodOptional<z.ZodString>;
203
+ }, "strip", z.ZodTypeAny, {
204
+ language?: string;
205
+ currency?: string;
206
+ autoLockSeconds?: number;
207
+ navigationMode?: "menu" | "tabs";
208
+ desktopNavMode?: "classic" | "sidebar";
209
+ telemetryDestination?: "console" | "server" | "analytics";
210
+ telemetryEndpoint?: string;
211
+ }, {
212
+ language?: string;
213
+ currency?: string;
214
+ autoLockSeconds?: number;
215
+ navigationMode?: "menu" | "tabs";
216
+ desktopNavMode?: "classic" | "sidebar";
217
+ telemetryDestination?: "console" | "server" | "analytics";
218
+ telemetryEndpoint?: string;
219
+ }>;
220
+ /**
221
+ * @description Type representing bundled user settings
222
+ */
223
+ export type BundleUserSettings = z.infer<typeof BundleUserSettingsSchema>;
224
+ /**
225
+ * @description Schema for encrypted recovery bundle
226
+ * Extended to include VaultKey objects for complete wallet restoration.
227
+ * The `keys` field contains all derived and imported accounts associated with the seed.
228
+ */
229
+ export declare const VaultRecoveryBundleSchema: z.ZodObject<{
230
+ id: z.ZodString;
231
+ seedId: z.ZodString;
232
+ createdAt: z.ZodNumber;
233
+ algorithm: z.ZodLiteral<"AES-GCM">;
234
+ payload: z.ZodString;
235
+ key: z.ZodString;
236
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
237
+ checksum: z.ZodOptional<z.ZodString>;
238
+ /** VaultKey objects (derived and imported accounts) to restore with the seed */
239
+ keys: z.ZodOptional<z.ZodArray<z.ZodObject<{
240
+ id: z.ZodString;
241
+ seedId: z.ZodString;
242
+ ledgerId: z.ZodString;
243
+ networkId: z.ZodString;
244
+ address: z.ZodString;
245
+ publicKey: z.ZodString;
246
+ derivationPath: z.ZodObject<{
247
+ purpose: z.ZodNumber;
248
+ coinType: z.ZodNumber;
249
+ account: z.ZodDefault<z.ZodNumber>;
250
+ change: z.ZodDefault<z.ZodNumber>;
251
+ addressIndex: z.ZodDefault<z.ZodNumber>;
252
+ }, "strip", z.ZodTypeAny, {
253
+ purpose?: number;
254
+ coinType?: number;
255
+ account?: number;
256
+ change?: number;
257
+ addressIndex?: number;
258
+ }, {
259
+ purpose?: number;
260
+ coinType?: number;
261
+ account?: number;
262
+ change?: number;
263
+ addressIndex?: number;
264
+ }>;
265
+ protection: z.ZodEnum<["none", "passphrase", "hardware", "biometric", "kms"]>;
266
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
267
+ }, "strip", z.ZodTypeAny, {
268
+ ledgerId?: string;
269
+ networkId?: string;
270
+ address?: string;
271
+ publicKey?: string;
272
+ metadata?: Record<string, unknown>;
273
+ id?: string;
274
+ derivationPath?: {
275
+ purpose?: number;
276
+ coinType?: number;
277
+ account?: number;
278
+ change?: number;
279
+ addressIndex?: number;
280
+ };
281
+ seedId?: string;
282
+ protection?: "passphrase" | "none" | "hardware" | "biometric" | "kms";
283
+ }, {
284
+ ledgerId?: string;
285
+ networkId?: string;
286
+ address?: string;
287
+ publicKey?: string;
288
+ metadata?: Record<string, unknown>;
289
+ id?: string;
290
+ derivationPath?: {
291
+ purpose?: number;
292
+ coinType?: number;
293
+ account?: number;
294
+ change?: number;
295
+ addressIndex?: number;
296
+ };
297
+ seedId?: string;
298
+ protection?: "passphrase" | "none" | "hardware" | "biometric" | "kms";
299
+ }>, "many">>;
300
+ /** Address book contacts to restore with the seed */
301
+ addressBook: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
302
+ /** User preferences (language, currency, auto-lock, etc.) */
303
+ userSettings: z.ZodOptional<z.ZodObject<{
304
+ language: z.ZodOptional<z.ZodString>;
305
+ currency: z.ZodOptional<z.ZodString>;
306
+ autoLockSeconds: z.ZodOptional<z.ZodNumber>;
307
+ navigationMode: z.ZodOptional<z.ZodEnum<["menu", "tabs"]>>;
308
+ desktopNavMode: z.ZodOptional<z.ZodEnum<["classic", "sidebar"]>>;
309
+ telemetryDestination: z.ZodOptional<z.ZodEnum<["console", "server", "analytics"]>>;
310
+ telemetryEndpoint: z.ZodOptional<z.ZodString>;
311
+ }, "strip", z.ZodTypeAny, {
312
+ language?: string;
313
+ currency?: string;
314
+ autoLockSeconds?: number;
315
+ navigationMode?: "menu" | "tabs";
316
+ desktopNavMode?: "classic" | "sidebar";
317
+ telemetryDestination?: "console" | "server" | "analytics";
318
+ telemetryEndpoint?: string;
319
+ }, {
320
+ language?: string;
321
+ currency?: string;
322
+ autoLockSeconds?: number;
323
+ navigationMode?: "menu" | "tabs";
324
+ desktopNavMode?: "classic" | "sidebar";
325
+ telemetryDestination?: "console" | "server" | "analytics";
326
+ telemetryEndpoint?: string;
327
+ }>>;
328
+ /** Current theme ID */
329
+ currentTheme: z.ZodOptional<z.ZodString>;
330
+ /** Custom imported themes (full theme objects) */
331
+ customThemes: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
332
+ /** Multisig party states for restoration */
333
+ multisigParties: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
334
+ }, "strip", z.ZodTypeAny, {
335
+ keys?: {
336
+ ledgerId?: string;
337
+ networkId?: string;
338
+ address?: string;
339
+ publicKey?: string;
340
+ metadata?: Record<string, unknown>;
341
+ id?: string;
342
+ derivationPath?: {
343
+ purpose?: number;
344
+ coinType?: number;
345
+ account?: number;
346
+ change?: number;
347
+ addressIndex?: number;
348
+ };
349
+ seedId?: string;
350
+ protection?: "passphrase" | "none" | "hardware" | "biometric" | "kms";
351
+ }[];
352
+ metadata?: Record<string, unknown>;
353
+ id?: string;
354
+ createdAt?: number;
355
+ payload?: string;
356
+ algorithm?: "AES-GCM";
357
+ seedId?: string;
358
+ key?: string;
359
+ checksum?: string;
360
+ addressBook?: unknown[];
361
+ userSettings?: {
362
+ language?: string;
363
+ currency?: string;
364
+ autoLockSeconds?: number;
365
+ navigationMode?: "menu" | "tabs";
366
+ desktopNavMode?: "classic" | "sidebar";
367
+ telemetryDestination?: "console" | "server" | "analytics";
368
+ telemetryEndpoint?: string;
369
+ };
370
+ currentTheme?: string;
371
+ customThemes?: unknown[];
372
+ multisigParties?: unknown[];
373
+ }, {
374
+ keys?: {
375
+ ledgerId?: string;
376
+ networkId?: string;
377
+ address?: string;
378
+ publicKey?: string;
379
+ metadata?: Record<string, unknown>;
380
+ id?: string;
381
+ derivationPath?: {
382
+ purpose?: number;
383
+ coinType?: number;
384
+ account?: number;
385
+ change?: number;
386
+ addressIndex?: number;
387
+ };
388
+ seedId?: string;
389
+ protection?: "passphrase" | "none" | "hardware" | "biometric" | "kms";
390
+ }[];
391
+ metadata?: Record<string, unknown>;
392
+ id?: string;
393
+ createdAt?: number;
394
+ payload?: string;
395
+ algorithm?: "AES-GCM";
396
+ seedId?: string;
397
+ key?: string;
398
+ checksum?: string;
399
+ addressBook?: unknown[];
400
+ userSettings?: {
401
+ language?: string;
402
+ currency?: string;
403
+ autoLockSeconds?: number;
404
+ navigationMode?: "menu" | "tabs";
405
+ desktopNavMode?: "classic" | "sidebar";
406
+ telemetryDestination?: "console" | "server" | "analytics";
407
+ telemetryEndpoint?: string;
408
+ };
409
+ currentTheme?: string;
410
+ customThemes?: unknown[];
411
+ multisigParties?: unknown[];
412
+ }>;
413
+ /**
414
+ * @description Type representing recovery bundle
415
+ */
416
+ export type VaultRecoveryBundle = z.infer<typeof VaultRecoveryBundleSchema>;
417
+ /**
418
+ * @description Schema for encrypted seed storage
419
+ */
420
+ export declare const VaultSeedSchema: z.ZodObject<{
421
+ id: z.ZodString;
422
+ label: z.ZodOptional<z.ZodString>;
423
+ createdAt: z.ZodNumber;
424
+ encryptedSeed: z.ZodString;
425
+ encryptedMnemonic: z.ZodOptional<z.ZodString>;
426
+ kdfSalt: z.ZodString;
427
+ derivationScheme: z.ZodString;
428
+ protection: z.ZodObject<{
429
+ mode: z.ZodEnum<["none", "passphrase", "hardware", "biometric", "kms"]>;
430
+ hint: z.ZodOptional<z.ZodString>;
431
+ hardwareId: z.ZodOptional<z.ZodString>;
432
+ biometricId: z.ZodOptional<z.ZodString>;
433
+ lastUnlockedAt: z.ZodOptional<z.ZodNumber>;
434
+ kmsKeyId: z.ZodOptional<z.ZodString>;
435
+ }, "strip", z.ZodTypeAny, {
436
+ mode?: "passphrase" | "none" | "hardware" | "biometric" | "kms";
437
+ hint?: string;
438
+ hardwareId?: string;
439
+ biometricId?: string;
440
+ lastUnlockedAt?: number;
441
+ kmsKeyId?: string;
442
+ }, {
443
+ mode?: "passphrase" | "none" | "hardware" | "biometric" | "kms";
444
+ hint?: string;
445
+ hardwareId?: string;
446
+ biometricId?: string;
447
+ lastUnlockedAt?: number;
448
+ kmsKeyId?: string;
449
+ }>;
450
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
451
+ recovery: z.ZodOptional<z.ZodObject<{
452
+ hint: z.ZodOptional<z.ZodString>;
453
+ contacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
454
+ name: z.ZodString;
455
+ contact: z.ZodString;
456
+ }, "strip", z.ZodTypeAny, {
457
+ name?: string;
458
+ contact?: string;
459
+ }, {
460
+ name?: string;
461
+ contact?: string;
462
+ }>, "many">>;
463
+ note: z.ZodOptional<z.ZodString>;
464
+ }, "strip", z.ZodTypeAny, {
465
+ contacts?: {
466
+ name?: string;
467
+ contact?: string;
468
+ }[];
469
+ hint?: string;
470
+ note?: string;
471
+ }, {
472
+ contacts?: {
473
+ name?: string;
474
+ contact?: string;
475
+ }[];
476
+ hint?: string;
477
+ note?: string;
478
+ }>>;
479
+ }, "strip", z.ZodTypeAny, {
480
+ metadata?: Record<string, unknown>;
481
+ id?: string;
482
+ label?: string;
483
+ createdAt?: number;
484
+ protection?: {
485
+ mode?: "passphrase" | "none" | "hardware" | "biometric" | "kms";
486
+ hint?: string;
487
+ hardwareId?: string;
488
+ biometricId?: string;
489
+ lastUnlockedAt?: number;
490
+ kmsKeyId?: string;
491
+ };
492
+ encryptedSeed?: string;
493
+ encryptedMnemonic?: string;
494
+ kdfSalt?: string;
495
+ derivationScheme?: string;
496
+ recovery?: {
497
+ contacts?: {
498
+ name?: string;
499
+ contact?: string;
500
+ }[];
501
+ hint?: string;
502
+ note?: string;
503
+ };
504
+ }, {
505
+ metadata?: Record<string, unknown>;
506
+ id?: string;
507
+ label?: string;
508
+ createdAt?: number;
509
+ protection?: {
510
+ mode?: "passphrase" | "none" | "hardware" | "biometric" | "kms";
511
+ hint?: string;
512
+ hardwareId?: string;
513
+ biometricId?: string;
514
+ lastUnlockedAt?: number;
515
+ kmsKeyId?: string;
516
+ };
517
+ encryptedSeed?: string;
518
+ encryptedMnemonic?: string;
519
+ kdfSalt?: string;
520
+ derivationScheme?: string;
521
+ recovery?: {
522
+ contacts?: {
523
+ name?: string;
524
+ contact?: string;
525
+ }[];
526
+ hint?: string;
527
+ note?: string;
528
+ };
529
+ }>;
530
+ /**
531
+ * @description Type representing vault seed
532
+ */
533
+ export type VaultSeed = z.infer<typeof VaultSeedSchema>;
534
+ /**
535
+ * @description Schema for credential mode — determines whether the vault
536
+ * is protected by a numeric PIN (legacy) or a full password.
537
+ */
538
+ export declare const CredentialModeSchema: z.ZodEnum<["pin", "password"]>;
539
+ /**
540
+ * @description Type representing credential mode
541
+ */
542
+ export type CredentialMode = z.infer<typeof CredentialModeSchema>;
543
+ /**
544
+ * @description Schema for KDF algorithm used to derive encryption keys
545
+ * from the user credential (PIN or password).
546
+ */
547
+ export declare const KdfAlgorithmSchema: z.ZodEnum<["argon2id", "pbkdf2"]>;
548
+ /**
549
+ * @description Type representing KDF algorithm
550
+ */
551
+ export type KdfAlgorithm = z.infer<typeof KdfAlgorithmSchema>;
552
+ /**
553
+ * @description Schema for wallet vault configuration
554
+ */
555
+ export declare const VaultConfigSchema: z.ZodObject<{
556
+ defaultLedgerId: z.ZodOptional<z.ZodString>;
557
+ defaultNetworkId: z.ZodOptional<z.ZodString>;
558
+ autoLockIntervalSeconds: z.ZodDefault<z.ZodNumber>;
559
+ allowHardware: z.ZodDefault<z.ZodBoolean>;
560
+ allowBiometric: z.ZodDefault<z.ZodBoolean>;
561
+ allowRecoveryBundles: z.ZodDefault<z.ZodBoolean>;
562
+ allowKms: z.ZodDefault<z.ZodBoolean>;
563
+ credentialMode: z.ZodDefault<z.ZodEnum<["pin", "password"]>>;
564
+ encryptionSalt: z.ZodOptional<z.ZodString>;
565
+ kdfAlgorithm: z.ZodDefault<z.ZodEnum<["argon2id", "pbkdf2"]>>;
566
+ authAttempts: z.ZodDefault<z.ZodNumber>;
567
+ authLockIntervalSeconds: z.ZodDefault<z.ZodNumber>;
568
+ /** @deprecated Legacy alias for authAttempts — kept for migration compatibility, remove in future version */
569
+ pinAttempts: z.ZodOptional<z.ZodNumber>;
570
+ /** @deprecated Legacy alias for authLockIntervalSeconds — kept for migration compatibility, remove in future version */
571
+ pinLockIntervalSeconds: z.ZodOptional<z.ZodNumber>;
572
+ recoverWithPassphrase: z.ZodDefault<z.ZodBoolean>;
573
+ recoverWithHardware: z.ZodDefault<z.ZodBoolean>;
574
+ recoverWithBiometric: z.ZodDefault<z.ZodBoolean>;
575
+ recoveryExportFormats: z.ZodDefault<z.ZodArray<z.ZodEnum<["json", "qr", "mnemonic"]>, "many">>;
576
+ pinDigest: z.ZodOptional<z.ZodString>;
577
+ pinSalt: z.ZodOptional<z.ZodString>;
578
+ pinUpdatedAt: z.ZodOptional<z.ZodNumber>;
579
+ passphraseDigest: z.ZodOptional<z.ZodString>;
580
+ passphraseSalt: z.ZodOptional<z.ZodString>;
581
+ biometricRequired: z.ZodDefault<z.ZodBoolean>;
582
+ auditLogRetentionDays: z.ZodDefault<z.ZodNumber>;
583
+ metricsEnabled: z.ZodDefault<z.ZodBoolean>;
584
+ recoveryContactRequired: z.ZodDefault<z.ZodBoolean>;
585
+ defaultRecoveryContact: z.ZodOptional<z.ZodObject<{
586
+ name: z.ZodString;
587
+ contact: z.ZodString;
588
+ }, "strip", z.ZodTypeAny, {
589
+ name?: string;
590
+ contact?: string;
591
+ }, {
592
+ name?: string;
593
+ contact?: string;
594
+ }>>;
595
+ kmsDefaultKeyId: z.ZodOptional<z.ZodString>;
596
+ kmsAllowRotation: z.ZodDefault<z.ZodBoolean>;
597
+ kmsProviderConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
598
+ }, "strip", z.ZodTypeAny, {
599
+ defaultNetworkId?: string;
600
+ defaultLedgerId?: string;
601
+ autoLockIntervalSeconds?: number;
602
+ allowHardware?: boolean;
603
+ allowBiometric?: boolean;
604
+ allowRecoveryBundles?: boolean;
605
+ allowKms?: boolean;
606
+ credentialMode?: "password" | "pin";
607
+ encryptionSalt?: string;
608
+ kdfAlgorithm?: "argon2id" | "pbkdf2";
609
+ authAttempts?: number;
610
+ authLockIntervalSeconds?: number;
611
+ pinAttempts?: number;
612
+ pinLockIntervalSeconds?: number;
613
+ recoverWithPassphrase?: boolean;
614
+ recoverWithHardware?: boolean;
615
+ recoverWithBiometric?: boolean;
616
+ recoveryExportFormats?: ("json" | "qr" | "mnemonic")[];
617
+ pinDigest?: string;
618
+ pinSalt?: string;
619
+ pinUpdatedAt?: number;
620
+ passphraseDigest?: string;
621
+ passphraseSalt?: string;
622
+ biometricRequired?: boolean;
623
+ auditLogRetentionDays?: number;
624
+ metricsEnabled?: boolean;
625
+ recoveryContactRequired?: boolean;
626
+ defaultRecoveryContact?: {
627
+ name?: string;
628
+ contact?: string;
629
+ };
630
+ kmsDefaultKeyId?: string;
631
+ kmsAllowRotation?: boolean;
632
+ kmsProviderConfig?: Record<string, unknown>;
633
+ }, {
634
+ defaultNetworkId?: string;
635
+ defaultLedgerId?: string;
636
+ autoLockIntervalSeconds?: number;
637
+ allowHardware?: boolean;
638
+ allowBiometric?: boolean;
639
+ allowRecoveryBundles?: boolean;
640
+ allowKms?: boolean;
641
+ credentialMode?: "password" | "pin";
642
+ encryptionSalt?: string;
643
+ kdfAlgorithm?: "argon2id" | "pbkdf2";
644
+ authAttempts?: number;
645
+ authLockIntervalSeconds?: number;
646
+ pinAttempts?: number;
647
+ pinLockIntervalSeconds?: number;
648
+ recoverWithPassphrase?: boolean;
649
+ recoverWithHardware?: boolean;
650
+ recoverWithBiometric?: boolean;
651
+ recoveryExportFormats?: ("json" | "qr" | "mnemonic")[];
652
+ pinDigest?: string;
653
+ pinSalt?: string;
654
+ pinUpdatedAt?: number;
655
+ passphraseDigest?: string;
656
+ passphraseSalt?: string;
657
+ biometricRequired?: boolean;
658
+ auditLogRetentionDays?: number;
659
+ metricsEnabled?: boolean;
660
+ recoveryContactRequired?: boolean;
661
+ defaultRecoveryContact?: {
662
+ name?: string;
663
+ contact?: string;
664
+ };
665
+ kmsDefaultKeyId?: string;
666
+ kmsAllowRotation?: boolean;
667
+ kmsProviderConfig?: Record<string, unknown>;
668
+ }>;
669
+ /**
670
+ * @description Type representing vault configuration
671
+ */
672
+ export type VaultConfig = z.infer<typeof VaultConfigSchema>;
673
+ //# sourceMappingURL=vault.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault.d.ts","sourceRoot":"","sources":["../src/vault.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,yBAAyB,mEAMpC,CAAC;AAEH;;GAEG;AACH,MA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