@bsv/wallet-toolbox-client 1.1.62 → 1.2.2

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 (71) hide show
  1. package/out/src/CWIStyleWalletManager.d.ts +417 -0
  2. package/out/src/CWIStyleWalletManager.d.ts.map +1 -0
  3. package/out/src/CWIStyleWalletManager.js +1140 -0
  4. package/out/src/CWIStyleWalletManager.js.map +1 -0
  5. package/out/src/SimpleWalletManager.d.ts +169 -0
  6. package/out/src/SimpleWalletManager.d.ts.map +1 -0
  7. package/out/src/SimpleWalletManager.js +315 -0
  8. package/out/src/SimpleWalletManager.js.map +1 -0
  9. package/out/src/Wallet.d.ts +6 -1
  10. package/out/src/Wallet.d.ts.map +1 -1
  11. package/out/src/Wallet.js +39 -7
  12. package/out/src/Wallet.js.map +1 -1
  13. package/out/src/WalletAuthenticationManager.d.ts +33 -0
  14. package/out/src/WalletAuthenticationManager.d.ts.map +1 -0
  15. package/out/src/WalletAuthenticationManager.js +110 -0
  16. package/out/src/WalletAuthenticationManager.js.map +1 -0
  17. package/out/src/WalletPermissionsManager.d.ts +575 -0
  18. package/out/src/WalletPermissionsManager.d.ts.map +1 -0
  19. package/out/src/WalletPermissionsManager.js +1789 -0
  20. package/out/src/WalletPermissionsManager.js.map +1 -0
  21. package/out/src/WalletSettingsManager.d.ts +59 -0
  22. package/out/src/WalletSettingsManager.d.ts.map +1 -0
  23. package/out/src/WalletSettingsManager.js +189 -0
  24. package/out/src/WalletSettingsManager.js.map +1 -0
  25. package/out/src/index.client.d.ts +9 -0
  26. package/out/src/index.client.d.ts.map +1 -1
  27. package/out/src/index.client.js +9 -0
  28. package/out/src/index.client.js.map +1 -1
  29. package/out/src/sdk/CertOpsWallet.d.ts +7 -0
  30. package/out/src/sdk/CertOpsWallet.d.ts.map +1 -0
  31. package/out/src/sdk/CertOpsWallet.js +3 -0
  32. package/out/src/sdk/CertOpsWallet.js.map +1 -0
  33. package/out/src/sdk/index.d.ts +1 -1
  34. package/out/src/sdk/index.d.ts.map +1 -1
  35. package/out/src/sdk/index.js +1 -1
  36. package/out/src/sdk/index.js.map +1 -1
  37. package/out/src/sdk/validationHelpers.d.ts.map +1 -1
  38. package/out/src/sdk/validationHelpers.js +13 -12
  39. package/out/src/sdk/validationHelpers.js.map +1 -1
  40. package/out/src/signer/methods/proveCertificate.d.ts.map +1 -1
  41. package/out/src/signer/methods/proveCertificate.js +3 -19
  42. package/out/src/signer/methods/proveCertificate.js.map +1 -1
  43. package/out/src/storage/remoting/StorageClient.d.ts +2 -2
  44. package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
  45. package/out/src/storage/remoting/StorageClient.js +1 -1
  46. package/out/src/storage/remoting/StorageClient.js.map +1 -1
  47. package/out/src/utility/identityUtils.d.ts +31 -0
  48. package/out/src/utility/identityUtils.d.ts.map +1 -0
  49. package/out/src/utility/identityUtils.js +116 -0
  50. package/out/src/utility/identityUtils.js.map +1 -0
  51. package/out/src/wab-client/WABClient.d.ts +49 -0
  52. package/out/src/wab-client/WABClient.d.ts.map +1 -0
  53. package/out/src/wab-client/WABClient.js +83 -0
  54. package/out/src/wab-client/WABClient.js.map +1 -0
  55. package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts +34 -0
  56. package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts.map +1 -0
  57. package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js +16 -0
  58. package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js.map +1 -0
  59. package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts +7 -0
  60. package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts.map +1 -0
  61. package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js +36 -0
  62. package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js.map +1 -0
  63. package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts +28 -0
  64. package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts.map +1 -0
  65. package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js +69 -0
  66. package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js.map +1 -0
  67. package/package.json +2 -2
  68. package/out/src/sdk/CertOps.d.ts +0 -66
  69. package/out/src/sdk/CertOps.d.ts.map +0 -1
  70. package/out/src/sdk/CertOps.js +0 -190
  71. package/out/src/sdk/CertOps.js.map +0 -1
@@ -0,0 +1,417 @@
1
+ import { AbortActionArgs, AbortActionResult, AcquireCertificateArgs, AcquireCertificateResult, AuthenticatedResult, CreateActionArgs, CreateActionResult, CreateHmacArgs, CreateHmacResult, CreateSignatureArgs, CreateSignatureResult, DiscoverByAttributesArgs, DiscoverByIdentityKeyArgs, DiscoverCertificatesResult, GetHeaderArgs, GetHeaderResult, GetHeightResult, GetNetworkResult, GetPublicKeyArgs, GetPublicKeyResult, GetVersionResult, InternalizeActionArgs, InternalizeActionResult, ListActionsArgs, ListActionsResult, ListCertificatesArgs, ListCertificatesResult, ListOutputsArgs, ListOutputsResult, OriginatorDomainNameStringUnder250Bytes, ProveCertificateArgs, ProveCertificateResult, RelinquishCertificateArgs, RelinquishCertificateResult, RelinquishOutputArgs, RelinquishOutputResult, RevealCounterpartyKeyLinkageArgs, RevealCounterpartyKeyLinkageResult, RevealSpecificKeyLinkageArgs, RevealSpecificKeyLinkageResult, SignActionArgs, SignActionResult, VerifyHmacArgs, VerifyHmacResult, VerifySignatureArgs, VerifySignatureResult, WalletDecryptArgs, WalletDecryptResult, WalletEncryptArgs, WalletEncryptResult, WalletInterface, OutpointString, LookupResolver, SHIPBroadcaster } from '@bsv/sdk';
2
+ import { PrivilegedKeyManager } from './sdk/PrivilegedKeyManager';
3
+ /**
4
+ * Number of rounds used in PBKDF2 for deriving password keys.
5
+ */
6
+ export declare const PBKDF2_NUM_ROUNDS = 7777;
7
+ /**
8
+ * Describes the structure of a User Management Protocol (UMP) token.
9
+ */
10
+ export interface UMPToken {
11
+ /**
12
+ * Primary key encrypted by the XOR of the password and presentation keys.
13
+ */
14
+ passwordPresentationPrimary: number[];
15
+ /**
16
+ * Primary key encrypted by the XOR of the password and recovery keys.
17
+ */
18
+ passwordRecoveryPrimary: number[];
19
+ /**
20
+ * Primary key encrypted by the XOR of the presentation and recovery keys.
21
+ */
22
+ presentationRecoveryPrimary: number[];
23
+ /**
24
+ * Privileged key encrypted by the XOR of the password and primary keys.
25
+ */
26
+ passwordPrimaryPrivileged: number[];
27
+ /**
28
+ * Privileged key encrypted by the XOR of the presentation and recovery keys.
29
+ */
30
+ presentationRecoveryPrivileged: number[];
31
+ /**
32
+ * Hash of the presentation key.
33
+ */
34
+ presentationHash: number[];
35
+ /**
36
+ * PBKDF2 salt used in conjunction with the password to derive the password key.
37
+ */
38
+ passwordSalt: number[];
39
+ /**
40
+ * Hash of the recovery key.
41
+ */
42
+ recoveryHash: number[];
43
+ /**
44
+ * A copy of the presentation key encrypted with the privileged key.
45
+ */
46
+ presentationKeyEncrypted: number[];
47
+ /**
48
+ * A copy of the recovery key encrypted with the privileged key.
49
+ */
50
+ recoveryKeyEncrypted: number[];
51
+ /**
52
+ * A copy of the password key encrypted with the privileged key.
53
+ */
54
+ passwordKeyEncrypted: number[];
55
+ /**
56
+ * Describes the token's location on-chain, if it's already been published.
57
+ */
58
+ currentOutpoint?: OutpointString;
59
+ }
60
+ /**
61
+ * Describes a system capable of finding and updating UMP tokens on the blockchain.
62
+ */
63
+ export interface UMPTokenInteractor {
64
+ /**
65
+ * Locates the latest valid copy of a UMP token (including its outpoint)
66
+ * based on the presentation key hash.
67
+ *
68
+ * @param hash The hash of the presentation key.
69
+ * @returns The UMP token if found; otherwise, undefined.
70
+ */
71
+ findByPresentationKeyHash: (hash: number[]) => Promise<UMPToken | undefined>;
72
+ /**
73
+ * Locates the latest valid copy of a UMP token (including its outpoint)
74
+ * based on the recovery key hash.
75
+ *
76
+ * @param hash The hash of the recovery key.
77
+ * @returns The UMP token if found; otherwise, undefined.
78
+ */
79
+ findByRecoveryKeyHash: (hash: number[]) => Promise<UMPToken | undefined>;
80
+ /**
81
+ * Creates (and optionally consumes the previous version of) a UMP token on-chain.
82
+ *
83
+ * @param wallet The wallet that might be used to create a new token.
84
+ * @param adminOriginator The domain name of the administrative originator.
85
+ * @param token The new UMP token to create.
86
+ * @param oldTokenToConsume If provided, the old token that must be consumed in the same transaction.
87
+ * @returns The newly created outpoint.
88
+ */
89
+ buildAndSend: (wallet: WalletInterface, adminOriginator: OriginatorDomainNameStringUnder250Bytes, token: UMPToken, oldTokenToConsume?: UMPToken) => Promise<OutpointString>;
90
+ }
91
+ /**
92
+ * @class OverlayUMPTokenInteractor
93
+ *
94
+ * A concrete implementation of the UMPTokenInteractor interface that interacts
95
+ * with Overlay Services and the UMP (User Management Protocol) topic. This class
96
+ * is responsible for:
97
+ *
98
+ * 1) Locating UMP tokens via overlay lookups (ls_users).
99
+ * 2) Creating and publishing new or updated UMP token outputs on-chain under
100
+ * the "tm_users" topic.
101
+ * 3) Consuming (spending) an old token if provided.
102
+ */
103
+ export declare class OverlayUMPTokenInteractor implements UMPTokenInteractor {
104
+ /**
105
+ * A `LookupResolver` instance used to query overlay networks.
106
+ */
107
+ private readonly resolver;
108
+ /**
109
+ * A SHIP broadcaster that can be used to publish updated UMP tokens
110
+ * under the `tm_users` topic to overlay service peers.
111
+ */
112
+ private readonly broadcaster;
113
+ /**
114
+ * Construct a new OverlayUMPTokenInteractor.
115
+ *
116
+ * @param resolver A LookupResolver instance for performing overlay queries (ls_users).
117
+ * @param broadcaster A SHIPBroadcaster instance for sharing new or updated tokens across the `tm_users` overlay.
118
+ */
119
+ constructor(resolver?: LookupResolver, broadcaster?: SHIPBroadcaster);
120
+ /**
121
+ * Finds a UMP token on-chain by the given presentation key hash, if it exists.
122
+ * Uses the ls_users overlay service to perform the lookup.
123
+ *
124
+ * @param hash The 32-byte SHA-256 hash of the presentation key.
125
+ * @returns A UMPToken object (including currentOutpoint) if found, otherwise undefined.
126
+ */
127
+ findByPresentationKeyHash(hash: number[]): Promise<UMPToken | undefined>;
128
+ /**
129
+ * Finds a UMP token on-chain by the given recovery key hash, if it exists.
130
+ * Uses the ls_users overlay service to perform the lookup.
131
+ *
132
+ * @param hash The 32-byte SHA-256 hash of the recovery key.
133
+ * @returns A UMPToken object (including currentOutpoint) if found, otherwise undefined.
134
+ */
135
+ findByRecoveryKeyHash(hash: number[]): Promise<UMPToken | undefined>;
136
+ /**
137
+ * Creates or updates (replaces) a UMP token on-chain. If `oldTokenToConsume` is provided,
138
+ * it is spent in the same transaction that creates the new token output. The new token is
139
+ * then broadcast and published under the `tm_users` topic using a SHIP broadcast, ensuring
140
+ * overlay participants see the updated token.
141
+ *
142
+ * @param wallet The wallet used to build and sign the transaction.
143
+ * @param adminOriginator The domain/FQDN of the administrative originator (wallet operator).
144
+ * @param token The new UMPToken to create on-chain.
145
+ * @param oldTokenToConsume Optionally, an existing token to consume/spend in the same transaction.
146
+ * @returns The outpoint of the newly created UMP token (e.g. "abcd1234...ef.0").
147
+ */
148
+ buildAndSend(wallet: WalletInterface, adminOriginator: OriginatorDomainNameStringUnder250Bytes, token: UMPToken, oldTokenToConsume?: UMPToken): Promise<OutpointString>;
149
+ /**
150
+ * Attempts to parse a LookupAnswer from the UMP lookup service. If successful,
151
+ * extracts the token fields from the resulting transaction and constructs
152
+ * a UMPToken object.
153
+ *
154
+ * @param answer The LookupAnswer returned by a query to ls_users.
155
+ * @returns The parsed UMPToken or `undefined` if none found/decodable.
156
+ */
157
+ private parseLookupAnswer;
158
+ /**
159
+ * Finds by outpoint for unlocking / spending previous tokens.
160
+ * @param outpoint The outpoint we are searching by
161
+ * @returns The result so that we can use it to unlock the transaction
162
+ */
163
+ private findByOutpoint;
164
+ }
165
+ /**
166
+ * Manages a "CWI-style" wallet that uses a UMP token and a
167
+ * multi-key authentication scheme (password, presentation key, and recovery key).
168
+ */
169
+ export declare class CWIStyleWalletManager implements WalletInterface {
170
+ /**
171
+ * Whether the user is currently authenticated.
172
+ */
173
+ authenticated: boolean;
174
+ /**
175
+ * The domain name of the administrative originator (wallet operator / vendor, or your own).
176
+ */
177
+ private adminOriginator;
178
+ /**
179
+ * The system that locates and publishes UMP tokens on-chain.
180
+ */
181
+ private UMPTokenInteractor;
182
+ /**
183
+ * A function called to persist the newly generated recovery key.
184
+ * It should generally trigger a UI prompt where the user is asked to write it down.
185
+ */
186
+ private recoveryKeySaver;
187
+ /**
188
+ * Asks the user to enter their password, for a given reason.
189
+ * The test function can be used to see if the password is correct before resolving.
190
+ * Only resolve with the correct password or reject with an error.
191
+ * Resolving with an incorrect password will throw an error.
192
+ */
193
+ private passwordRetriever;
194
+ /**
195
+ * An optional function that funds a new Wallet after the new-user flow, before the system proceeds.
196
+ * Allows integration with faucets, and provides the presentation key for use in claiming faucet funds
197
+ * that may be bound to it.
198
+ */
199
+ private newWalletFunder?;
200
+ /**
201
+ * Builds the underlying wallet once the user has been authenticated.
202
+ */
203
+ private walletBuilder;
204
+ /**
205
+ * The current mode of authentication:
206
+ * - 'presentation-key-and-password'
207
+ * - 'presentation-key-and-recovery-key'
208
+ * - 'recovery-key-and-password'
209
+ */
210
+ authenticationMode: 'presentation-key-and-password' | 'presentation-key-and-recovery-key' | 'recovery-key-and-password';
211
+ /**
212
+ * Indicates whether this is a new user or an existing user flow:
213
+ * - 'new-user'
214
+ * - 'existing-user'
215
+ */
216
+ authenticationFlow: 'new-user' | 'existing-user';
217
+ /**
218
+ * The current UMP token in use (representing the user's keys on-chain).
219
+ */
220
+ private currentUMPToken?;
221
+ /**
222
+ * The presentation key, temporarily retained after being provided until authenticated.
223
+ */
224
+ private presentationKey?;
225
+ /**
226
+ * The recovery key, temporarily retained after being provided until authenticated.
227
+ */
228
+ private recoveryKey?;
229
+ /**
230
+ * The user's primary key, which is used to operate the underlying wallet.
231
+ * It is also stored within state snapshots.
232
+ */
233
+ private primaryKey?;
234
+ /**
235
+ * The underlying wallet that handles the
236
+ * actual signing, encryption, and other wallet operations.
237
+ */
238
+ private underlying?;
239
+ /**
240
+ * Privileged key manager associated with the underlying wallet, used for
241
+ * short-term administrative tasks (e.g. re-wrapping or rotating keys).
242
+ */
243
+ private underlyingPrivilegedKeyManager?;
244
+ /**
245
+ * Constructs a new CWIStyleWalletManager.
246
+ *
247
+ * @param adminOriginator The domain name of the administrative originator.
248
+ * @param walletBuilder A function that can build an underlying wallet instance
249
+ * from a primary key and a privileged key manager
250
+ * @param interactor An instance of UMPTokenInteractor capable of managing UMP tokens.
251
+ * @param recoveryKeySaver A function that can persist or display a newly generated recovery key.
252
+ * @param passwordRetriever A function to request the user's password, given a reason and a test function.
253
+ * @param newWalletFunder An optional function called with the presentation key and a new Wallet post-construction to fund it before use.
254
+ * @param stateSnapshot If provided, a previously saved snapshot of the wallet's state.
255
+ */
256
+ constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => Promise<WalletInterface>, interactor: UMPTokenInteractor | undefined, recoveryKeySaver: (key: number[]) => Promise<true>, passwordRetriever: (reason: string, test: (passwordCandidate: string) => boolean) => Promise<string>, newWalletFunder?: (presentationKey: number[], wallet: WalletInterface, adminOriginator: OriginatorDomainNameStringUnder250Bytes) => Promise<void>, stateSnapshot?: number[]);
257
+ /**
258
+ * Provides the presentation key in an authentication mode that requires it.
259
+ * If a UMP token is found based on the key's hash, this is an existing-user flow.
260
+ * Otherwise, it is treated as a new-user flow.
261
+ *
262
+ * @param key The user's presentation key (32 bytes).
263
+ * @throws {Error} if user is already authenticated, or if the current mode does not require a presentation key.
264
+ */
265
+ providePresentationKey(key: number[]): Promise<void>;
266
+ /**
267
+ * Provides the password in an authentication mode that requires it.
268
+ *
269
+ * - **Existing user**:
270
+ * Decrypts the primary key using the provided password (and either the presentation key or recovery key, depending on the mode).
271
+ * Then builds the underlying wallet, marking the user as authenticated.
272
+ *
273
+ * - **New user**:
274
+ * Generates a new UMP token with fresh keys (primary, privileged, recovery). Publishes it on-chain and builds the wallet.
275
+ *
276
+ * @param password The user's password as a string.
277
+ * @throws {Error} If the user is already authenticated, if the mode does not use a password, or if required keys are missing.
278
+ */
279
+ providePassword(password: string): Promise<void>;
280
+ /**
281
+ * Provides the recovery key in an authentication flow that requires it.
282
+ *
283
+ * @param recoveryKey The user's recovery key (32 bytes).
284
+ * @throws {Error} if user is already authenticated, if the mode does not use a recovery key,
285
+ * or if a required presentation key is missing in "presentation-key-and-recovery-key" mode.
286
+ */
287
+ provideRecoveryKey(recoveryKey: number[]): Promise<void>;
288
+ /**
289
+ * Saves the current wallet state (including the current UMP token and primary key)
290
+ * into an encrypted snapshot. This snapshot can be stored locally and later passed
291
+ * to `loadSnapshot` to restore the wallet state without re-authenticating manually.
292
+ *
293
+ * @remarks
294
+ * Storing the snapshot provides a fully authenticated state.
295
+ * This **must** be securely stored (e.g. system keychain or encrypted file).
296
+ * If attackers gain access to this snapshot, they can fully control the wallet.
297
+ *
298
+ * @returns An array of bytes representing the encrypted snapshot.
299
+ * @throws {Error} if no primary key or token is currently set.
300
+ */
301
+ saveSnapshot(): number[];
302
+ /**
303
+ * Loads a previously saved state snapshot (e.g. from `saveSnapshot`).
304
+ * Upon success, the wallet becomes authenticated without needing to re-enter keys.
305
+ *
306
+ * @param snapshot An array of bytes that was previously produced by `saveSnapshot`.
307
+ * @throws {Error} If the snapshot format is invalid or decryption fails.
308
+ */
309
+ loadSnapshot(snapshot: number[]): Promise<void>;
310
+ /**
311
+ * Destroys the underlying wallet, returning to a default state
312
+ */
313
+ destroy(): void;
314
+ /**
315
+ * Changes the user's password, re-wrapping the primary and privileged keys with the new password factor.
316
+ *
317
+ * @param newPassword The user's new password as a string.
318
+ * @throws {Error} If the user is not authenticated, or if underlying token references are missing.
319
+ */
320
+ changePassword(newPassword: string): Promise<void>;
321
+ /**
322
+ * Retrieves the current recovery key.
323
+ *
324
+ * @throws {Error} If the user is not authenticated, or if underlying token references are missing.
325
+ */
326
+ getRecoveryKey(): Promise<number[]>;
327
+ /**
328
+ * Changes the user's recovery key, prompting the user to save the new key.
329
+ *
330
+ * @throws {Error} If the user is not authenticated, or if underlying token references are missing.
331
+ */
332
+ changeRecoveryKey(): Promise<void>;
333
+ /**
334
+ * Changes the user's presentation key.
335
+ *
336
+ * @param presentationKey The new presentation key (32 bytes).
337
+ * @throws {Error} If the user is not authenticated, or if underlying token references are missing.
338
+ */
339
+ changePresentationKey(presentationKey: number[]): Promise<void>;
340
+ /**
341
+ * Internal helper to recompute a UMP token with updated authentication factors and consume the old token on-chain.
342
+ *
343
+ * @param passwordSalt The PBKDF2 salt for the new password factor.
344
+ * @param passwordKey The PBKDF2-derived password key (32 bytes).
345
+ * @param presentationKey The new or existing presentation key (32 bytes).
346
+ * @param recoveryKey The new or existing recovery key (32 bytes).
347
+ * @param primaryKey The user's primary key for re-wrapping.
348
+ * @param privilegedKey The user's privileged key for re-wrapping.
349
+ * @throws {Error} If the user is not authenticated or if keys are unavailable.
350
+ */
351
+ private updateAuthFactors;
352
+ /**
353
+ * A helper function to XOR two equal-length byte arrays.
354
+ *
355
+ * @param n1 The first byte array.
356
+ * @param n2 The second byte array.
357
+ * @returns A new byte array which is the element-wise XOR of the two inputs.
358
+ * @throws {Error} if the two arrays are not the same length.
359
+ */
360
+ private XOR;
361
+ /**
362
+ * A helper function to serialize a UMP token to a binary format (version=1).
363
+ * The serialization layout is:
364
+ * - [1 byte version (value=1)]
365
+ * - For each array field in the UMP token, [varint length + bytes]
366
+ * - Then [varint length + outpoint string in UTF-8]
367
+ *
368
+ * @param token The UMP token to serialize.
369
+ * @returns A byte array representing the serialized token.
370
+ * @throws {Error} if the token has no currentOutpoint (required for serialization).
371
+ */
372
+ private serializeUMPToken;
373
+ /**
374
+ * A helper function to deserialize a UMP token from the format described in `serializeUMPToken`.
375
+ *
376
+ * @param bin The serialized byte array.
377
+ * @returns The reconstructed UMP token.
378
+ * @throws {Error} if the version byte is unexpected or if parsing fails.
379
+ */
380
+ private deserializeUMPToken;
381
+ /**
382
+ * Builds the underlying wallet once the user is authenticated.
383
+ *
384
+ * @param primaryKey The user's primary key (32 bytes).
385
+ * @param privilegedKey Optionally, a privileged key (for short-term usage in account recovery).
386
+ */
387
+ private buildUnderlying;
388
+ getPublicKey(args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetPublicKeyResult>;
389
+ revealCounterpartyKeyLinkage(args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealCounterpartyKeyLinkageResult>;
390
+ revealSpecificKeyLinkage(args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealSpecificKeyLinkageResult>;
391
+ encrypt(args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletEncryptResult>;
392
+ decrypt(args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletDecryptResult>;
393
+ createHmac(args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateHmacResult>;
394
+ verifyHmac(args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifyHmacResult>;
395
+ createSignature(args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateSignatureResult>;
396
+ verifySignature(args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifySignatureResult>;
397
+ createAction(args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateActionResult>;
398
+ signAction(args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<SignActionResult>;
399
+ abortAction(args: AbortActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AbortActionResult>;
400
+ listActions(args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListActionsResult>;
401
+ internalizeAction(args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<InternalizeActionResult>;
402
+ listOutputs(args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>;
403
+ relinquishOutput(args: RelinquishOutputArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishOutputResult>;
404
+ acquireCertificate(args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AcquireCertificateResult>;
405
+ listCertificates(args: ListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult>;
406
+ proveCertificate(args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ProveCertificateResult>;
407
+ relinquishCertificate(args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishCertificateResult>;
408
+ discoverByIdentityKey(args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>;
409
+ discoverByAttributes(args: DiscoverByAttributesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>;
410
+ isAuthenticated(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>;
411
+ waitForAuthentication(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>;
412
+ getHeight(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeightResult>;
413
+ getHeaderForHeight(args: GetHeaderArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeaderResult>;
414
+ getNetwork(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetNetworkResult>;
415
+ getVersion(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetVersionResult>;
416
+ }
417
+ //# sourceMappingURL=CWIStyleWalletManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CWIStyleWalletManager.d.ts","sourceRoot":"","sources":["../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