@dynamic-labs-wallet/browser 0.0.100 → 0.0.102
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/index.cjs.js +86 -33
- package/index.esm.js +86 -33
- package/package.json +2 -2
- package/src/backup/encryption.d.ts +42 -2
- package/src/backup/encryption.d.ts.map +1 -1
- package/src/client.d.ts +1 -1
- package/src/client.d.ts.map +1 -1
- package/src/utils.d.ts +2 -8
- package/src/utils.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -223,29 +223,44 @@ const createBackupData = ({ encryptedKeyShares, accountAddress, thresholdSignatu
|
|
|
223
223
|
return {
|
|
224
224
|
keyShares: encryptedKeyShares,
|
|
225
225
|
metadata: {
|
|
226
|
-
version: '1.0',
|
|
227
226
|
createdAt: new Date().toISOString(),
|
|
228
227
|
accountAddress,
|
|
229
228
|
thresholdSignatureScheme,
|
|
230
229
|
hasPassword,
|
|
231
|
-
encryption:
|
|
232
|
-
|
|
233
|
-
keyDerivation: PBKDF2_ALGORITHM,
|
|
234
|
-
iterations: PBKDF2_ITERATIONS,
|
|
235
|
-
hashAlgorithm: PBKDF2_HASH_ALGORITHM,
|
|
236
|
-
algorithmLength: AES_GCM_LENGTH
|
|
237
|
-
},
|
|
230
|
+
encryption: getEncryptionMetadataForVersion(ENCRYPTION_VERSION_CURRENT),
|
|
231
|
+
encryptionVersion: ENCRYPTION_VERSION_CURRENT,
|
|
238
232
|
shareCount: encryptedKeyShares.length
|
|
239
233
|
}
|
|
240
234
|
};
|
|
241
235
|
};
|
|
242
236
|
|
|
237
|
+
const ENCRYPTION_VERSION_LEGACY = 'v1';
|
|
238
|
+
const ENCRYPTION_VERSION_CURRENT = 'v2';
|
|
243
239
|
const PBKDF2_ALGORITHM = 'PBKDF2';
|
|
244
|
-
const PBKDF2_ITERATIONS = 100000;
|
|
245
240
|
const PBKDF2_HASH_ALGORITHM = 'SHA-256';
|
|
246
241
|
const AES_GCM_ALGORITHM = 'AES-GCM';
|
|
247
242
|
const AES_GCM_LENGTH = 256;
|
|
248
|
-
const
|
|
243
|
+
const ENCRYPTION_VERSIONS = {
|
|
244
|
+
[ENCRYPTION_VERSION_LEGACY]: {
|
|
245
|
+
version: ENCRYPTION_VERSION_LEGACY,
|
|
246
|
+
algorithm: AES_GCM_ALGORITHM,
|
|
247
|
+
keyDerivation: PBKDF2_ALGORITHM,
|
|
248
|
+
iterations: 100000,
|
|
249
|
+
hashAlgorithm: PBKDF2_HASH_ALGORITHM,
|
|
250
|
+
algorithmLength: AES_GCM_LENGTH
|
|
251
|
+
},
|
|
252
|
+
[ENCRYPTION_VERSION_CURRENT]: {
|
|
253
|
+
version: ENCRYPTION_VERSION_CURRENT,
|
|
254
|
+
algorithm: AES_GCM_ALGORITHM,
|
|
255
|
+
keyDerivation: PBKDF2_ALGORITHM,
|
|
256
|
+
iterations: 1000000,
|
|
257
|
+
hashAlgorithm: PBKDF2_HASH_ALGORITHM,
|
|
258
|
+
algorithmLength: AES_GCM_LENGTH
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
ENCRYPTION_VERSIONS[ENCRYPTION_VERSION_CURRENT].iterations;
|
|
262
|
+
ENCRYPTION_VERSIONS[ENCRYPTION_VERSION_LEGACY].iterations;
|
|
263
|
+
const getKey = async ({ password, salt, encryptionConfig })=>{
|
|
249
264
|
const passwordBytes = stringToBytes(password);
|
|
250
265
|
const initialKey = await crypto.subtle.importKey('raw', passwordBytes, {
|
|
251
266
|
name: 'PBKDF2'
|
|
@@ -253,26 +268,34 @@ const getKey = async ({ password, salt })=>{
|
|
|
253
268
|
'deriveKey'
|
|
254
269
|
]);
|
|
255
270
|
return crypto.subtle.deriveKey({
|
|
256
|
-
name:
|
|
257
|
-
salt,
|
|
258
|
-
iterations:
|
|
259
|
-
hash:
|
|
271
|
+
name: encryptionConfig.keyDerivation,
|
|
272
|
+
salt: salt,
|
|
273
|
+
iterations: encryptionConfig.iterations,
|
|
274
|
+
hash: encryptionConfig.hashAlgorithm
|
|
260
275
|
}, initialKey, {
|
|
261
|
-
name:
|
|
262
|
-
length:
|
|
276
|
+
name: encryptionConfig.algorithm,
|
|
277
|
+
length: encryptionConfig.algorithmLength
|
|
263
278
|
}, false, [
|
|
264
279
|
'encrypt',
|
|
265
280
|
'decrypt'
|
|
266
281
|
]);
|
|
267
282
|
};
|
|
268
|
-
|
|
283
|
+
/**
|
|
284
|
+
* Encrypts data using the specified encryption version.
|
|
285
|
+
* Always uses the latest encryption configuration for new encryptions by default.
|
|
286
|
+
*/ const encryptData = async ({ data, password, version = ENCRYPTION_VERSION_CURRENT })=>{
|
|
287
|
+
const encryptionConfig = ENCRYPTION_VERSIONS[version];
|
|
288
|
+
if (!encryptionConfig) {
|
|
289
|
+
throw new Error(`Unsupported encryption version: ${version}`);
|
|
290
|
+
}
|
|
269
291
|
try {
|
|
270
292
|
// Generate a random salt and IV
|
|
271
293
|
const salt = crypto.getRandomValues(new Uint8Array(16));
|
|
272
294
|
const iv = crypto.getRandomValues(new Uint8Array(12)); // AES-GCM requires 12 bytes
|
|
273
295
|
const key = await getKey({
|
|
274
296
|
password,
|
|
275
|
-
salt
|
|
297
|
+
salt,
|
|
298
|
+
encryptionConfig
|
|
276
299
|
});
|
|
277
300
|
// Convert the input string to bytes
|
|
278
301
|
const dataBytes = new TextEncoder().encode(data);
|
|
@@ -285,25 +308,39 @@ const encryptData = async ({ data, password })=>{
|
|
|
285
308
|
return {
|
|
286
309
|
salt: bytesToBase64(salt),
|
|
287
310
|
iv: bytesToBase64(iv),
|
|
288
|
-
cipher: bytesToBase64(new Uint8Array(encryptedData))
|
|
311
|
+
cipher: bytesToBase64(new Uint8Array(encryptedData)),
|
|
312
|
+
version
|
|
289
313
|
};
|
|
290
314
|
} catch (error) {
|
|
291
315
|
throw new Error('Error encrypting data');
|
|
292
316
|
}
|
|
293
317
|
};
|
|
294
|
-
|
|
318
|
+
/**
|
|
319
|
+
* Decrypts data with version-based configuration.
|
|
320
|
+
* Uses the version field from the data to determine encryption parameters.
|
|
321
|
+
* Falls back to legacy version for backward compatibility if no version is specified.
|
|
322
|
+
*/ const decryptData = async ({ data, password })=>{
|
|
323
|
+
const { salt, iv, cipher, version } = data;
|
|
324
|
+
// Ensure proper base64 padding for all values
|
|
325
|
+
const paddedSalt = ensureBase64Padding(salt);
|
|
326
|
+
const paddedIv = ensureBase64Padding(iv);
|
|
327
|
+
const paddedCipher = ensureBase64Padding(cipher);
|
|
328
|
+
const saltBytes = base64ToBytes(paddedSalt);
|
|
329
|
+
const ivBytes = base64ToBytes(paddedIv);
|
|
330
|
+
const cipherBytes = base64ToBytes(paddedCipher);
|
|
331
|
+
let encryptionConfig;
|
|
332
|
+
// Use version-based configuration if available, otherwise fallback to legacy
|
|
333
|
+
if (version && ENCRYPTION_VERSIONS[version]) {
|
|
334
|
+
encryptionConfig = ENCRYPTION_VERSIONS[version];
|
|
335
|
+
} else {
|
|
336
|
+
// Fallback to legacy version for backward compatibility
|
|
337
|
+
encryptionConfig = ENCRYPTION_VERSIONS[ENCRYPTION_VERSION_LEGACY];
|
|
338
|
+
}
|
|
295
339
|
try {
|
|
296
|
-
const { salt, iv, cipher } = data;
|
|
297
|
-
// Ensure proper base64 padding for all values
|
|
298
|
-
const paddedSalt = ensureBase64Padding(salt);
|
|
299
|
-
const paddedIv = ensureBase64Padding(iv);
|
|
300
|
-
const paddedCipher = ensureBase64Padding(cipher);
|
|
301
|
-
const saltBytes = base64ToBytes(paddedSalt);
|
|
302
|
-
const ivBytes = base64ToBytes(paddedIv);
|
|
303
|
-
const cipherBytes = base64ToBytes(paddedCipher);
|
|
304
340
|
const key = await getKey({
|
|
305
341
|
password,
|
|
306
|
-
salt: saltBytes
|
|
342
|
+
salt: saltBytes,
|
|
343
|
+
encryptionConfig
|
|
307
344
|
});
|
|
308
345
|
const decryptedData = await crypto.subtle.decrypt({
|
|
309
346
|
name: AES_GCM_ALGORITHM,
|
|
@@ -311,9 +348,25 @@ const decryptData = async ({ data, password })=>{
|
|
|
311
348
|
}, key, cipherBytes);
|
|
312
349
|
return new TextDecoder().decode(decryptedData);
|
|
313
350
|
} catch (error) {
|
|
314
|
-
throw new Error('Decryption failed');
|
|
351
|
+
throw new Error('Decryption failed: ' + error);
|
|
315
352
|
}
|
|
316
353
|
};
|
|
354
|
+
/**
|
|
355
|
+
* Gets encryption metadata for a specific version.
|
|
356
|
+
* Used when we need to include metadata in legacy systems or APIs that require it.
|
|
357
|
+
*/ const getEncryptionMetadataForVersion = (version)=>{
|
|
358
|
+
const encryptionConfig = ENCRYPTION_VERSIONS[version];
|
|
359
|
+
if (!encryptionConfig) {
|
|
360
|
+
throw new Error(`Unsupported encryption version: ${version}`);
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
algorithm: encryptionConfig.algorithm,
|
|
364
|
+
keyDerivation: encryptionConfig.keyDerivation,
|
|
365
|
+
iterations: encryptionConfig.iterations,
|
|
366
|
+
hashAlgorithm: encryptionConfig.hashAlgorithm,
|
|
367
|
+
algorithmLength: encryptionConfig.algorithmLength
|
|
368
|
+
};
|
|
369
|
+
};
|
|
317
370
|
|
|
318
371
|
const GOOGLE_DRIVE_UPLOAD_API = 'https://www.googleapis.com';
|
|
319
372
|
const uploadFileToGoogleDriveAppStorage = async ({ accessToken, fileName, jsonData })=>{
|
|
@@ -1322,6 +1375,7 @@ class DynamicWalletClient {
|
|
|
1322
1375
|
walletId: this.walletMap[accountAddress].walletId,
|
|
1323
1376
|
encryptedKeyShares: dynamicClientKeyShares,
|
|
1324
1377
|
passwordEncrypted: Boolean(password) && password !== this.environmentId,
|
|
1378
|
+
encryptionVersion: ENCRYPTION_VERSION_CURRENT,
|
|
1325
1379
|
signedSessionId
|
|
1326
1380
|
});
|
|
1327
1381
|
await this.apiClient.markKeySharesAsBackedUp({
|
|
@@ -2008,7 +2062,7 @@ class DynamicWalletClient {
|
|
|
2008
2062
|
throw error;
|
|
2009
2063
|
}
|
|
2010
2064
|
}
|
|
2011
|
-
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug
|
|
2065
|
+
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug }){
|
|
2012
2066
|
this.initializePromise = null;
|
|
2013
2067
|
this.logger = logger;
|
|
2014
2068
|
this.walletMap = {} // todo: store in session storage
|
|
@@ -2021,8 +2075,7 @@ class DynamicWalletClient {
|
|
|
2021
2075
|
this.apiClient = new core.DynamicApiClient({
|
|
2022
2076
|
environmentId,
|
|
2023
2077
|
authToken,
|
|
2024
|
-
baseApiUrl
|
|
2025
|
-
baseClientRelayApiUrl
|
|
2078
|
+
baseApiUrl
|
|
2026
2079
|
});
|
|
2027
2080
|
this.debug = Boolean(debug);
|
|
2028
2081
|
this.logger.setLogLevel(this.debug ? logger$1.LogLevel.DEBUG : DEFAULT_LOG_LEVEL);
|
package/index.esm.js
CHANGED
|
@@ -223,29 +223,44 @@ const createBackupData = ({ encryptedKeyShares, accountAddress, thresholdSignatu
|
|
|
223
223
|
return {
|
|
224
224
|
keyShares: encryptedKeyShares,
|
|
225
225
|
metadata: {
|
|
226
|
-
version: '1.0',
|
|
227
226
|
createdAt: new Date().toISOString(),
|
|
228
227
|
accountAddress,
|
|
229
228
|
thresholdSignatureScheme,
|
|
230
229
|
hasPassword,
|
|
231
|
-
encryption:
|
|
232
|
-
|
|
233
|
-
keyDerivation: PBKDF2_ALGORITHM,
|
|
234
|
-
iterations: PBKDF2_ITERATIONS,
|
|
235
|
-
hashAlgorithm: PBKDF2_HASH_ALGORITHM,
|
|
236
|
-
algorithmLength: AES_GCM_LENGTH
|
|
237
|
-
},
|
|
230
|
+
encryption: getEncryptionMetadataForVersion(ENCRYPTION_VERSION_CURRENT),
|
|
231
|
+
encryptionVersion: ENCRYPTION_VERSION_CURRENT,
|
|
238
232
|
shareCount: encryptedKeyShares.length
|
|
239
233
|
}
|
|
240
234
|
};
|
|
241
235
|
};
|
|
242
236
|
|
|
237
|
+
const ENCRYPTION_VERSION_LEGACY = 'v1';
|
|
238
|
+
const ENCRYPTION_VERSION_CURRENT = 'v2';
|
|
243
239
|
const PBKDF2_ALGORITHM = 'PBKDF2';
|
|
244
|
-
const PBKDF2_ITERATIONS = 100000;
|
|
245
240
|
const PBKDF2_HASH_ALGORITHM = 'SHA-256';
|
|
246
241
|
const AES_GCM_ALGORITHM = 'AES-GCM';
|
|
247
242
|
const AES_GCM_LENGTH = 256;
|
|
248
|
-
const
|
|
243
|
+
const ENCRYPTION_VERSIONS = {
|
|
244
|
+
[ENCRYPTION_VERSION_LEGACY]: {
|
|
245
|
+
version: ENCRYPTION_VERSION_LEGACY,
|
|
246
|
+
algorithm: AES_GCM_ALGORITHM,
|
|
247
|
+
keyDerivation: PBKDF2_ALGORITHM,
|
|
248
|
+
iterations: 100000,
|
|
249
|
+
hashAlgorithm: PBKDF2_HASH_ALGORITHM,
|
|
250
|
+
algorithmLength: AES_GCM_LENGTH
|
|
251
|
+
},
|
|
252
|
+
[ENCRYPTION_VERSION_CURRENT]: {
|
|
253
|
+
version: ENCRYPTION_VERSION_CURRENT,
|
|
254
|
+
algorithm: AES_GCM_ALGORITHM,
|
|
255
|
+
keyDerivation: PBKDF2_ALGORITHM,
|
|
256
|
+
iterations: 1000000,
|
|
257
|
+
hashAlgorithm: PBKDF2_HASH_ALGORITHM,
|
|
258
|
+
algorithmLength: AES_GCM_LENGTH
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
ENCRYPTION_VERSIONS[ENCRYPTION_VERSION_CURRENT].iterations;
|
|
262
|
+
ENCRYPTION_VERSIONS[ENCRYPTION_VERSION_LEGACY].iterations;
|
|
263
|
+
const getKey = async ({ password, salt, encryptionConfig })=>{
|
|
249
264
|
const passwordBytes = stringToBytes(password);
|
|
250
265
|
const initialKey = await crypto.subtle.importKey('raw', passwordBytes, {
|
|
251
266
|
name: 'PBKDF2'
|
|
@@ -253,26 +268,34 @@ const getKey = async ({ password, salt })=>{
|
|
|
253
268
|
'deriveKey'
|
|
254
269
|
]);
|
|
255
270
|
return crypto.subtle.deriveKey({
|
|
256
|
-
name:
|
|
257
|
-
salt,
|
|
258
|
-
iterations:
|
|
259
|
-
hash:
|
|
271
|
+
name: encryptionConfig.keyDerivation,
|
|
272
|
+
salt: salt,
|
|
273
|
+
iterations: encryptionConfig.iterations,
|
|
274
|
+
hash: encryptionConfig.hashAlgorithm
|
|
260
275
|
}, initialKey, {
|
|
261
|
-
name:
|
|
262
|
-
length:
|
|
276
|
+
name: encryptionConfig.algorithm,
|
|
277
|
+
length: encryptionConfig.algorithmLength
|
|
263
278
|
}, false, [
|
|
264
279
|
'encrypt',
|
|
265
280
|
'decrypt'
|
|
266
281
|
]);
|
|
267
282
|
};
|
|
268
|
-
|
|
283
|
+
/**
|
|
284
|
+
* Encrypts data using the specified encryption version.
|
|
285
|
+
* Always uses the latest encryption configuration for new encryptions by default.
|
|
286
|
+
*/ const encryptData = async ({ data, password, version = ENCRYPTION_VERSION_CURRENT })=>{
|
|
287
|
+
const encryptionConfig = ENCRYPTION_VERSIONS[version];
|
|
288
|
+
if (!encryptionConfig) {
|
|
289
|
+
throw new Error(`Unsupported encryption version: ${version}`);
|
|
290
|
+
}
|
|
269
291
|
try {
|
|
270
292
|
// Generate a random salt and IV
|
|
271
293
|
const salt = crypto.getRandomValues(new Uint8Array(16));
|
|
272
294
|
const iv = crypto.getRandomValues(new Uint8Array(12)); // AES-GCM requires 12 bytes
|
|
273
295
|
const key = await getKey({
|
|
274
296
|
password,
|
|
275
|
-
salt
|
|
297
|
+
salt,
|
|
298
|
+
encryptionConfig
|
|
276
299
|
});
|
|
277
300
|
// Convert the input string to bytes
|
|
278
301
|
const dataBytes = new TextEncoder().encode(data);
|
|
@@ -285,25 +308,39 @@ const encryptData = async ({ data, password })=>{
|
|
|
285
308
|
return {
|
|
286
309
|
salt: bytesToBase64(salt),
|
|
287
310
|
iv: bytesToBase64(iv),
|
|
288
|
-
cipher: bytesToBase64(new Uint8Array(encryptedData))
|
|
311
|
+
cipher: bytesToBase64(new Uint8Array(encryptedData)),
|
|
312
|
+
version
|
|
289
313
|
};
|
|
290
314
|
} catch (error) {
|
|
291
315
|
throw new Error('Error encrypting data');
|
|
292
316
|
}
|
|
293
317
|
};
|
|
294
|
-
|
|
318
|
+
/**
|
|
319
|
+
* Decrypts data with version-based configuration.
|
|
320
|
+
* Uses the version field from the data to determine encryption parameters.
|
|
321
|
+
* Falls back to legacy version for backward compatibility if no version is specified.
|
|
322
|
+
*/ const decryptData = async ({ data, password })=>{
|
|
323
|
+
const { salt, iv, cipher, version } = data;
|
|
324
|
+
// Ensure proper base64 padding for all values
|
|
325
|
+
const paddedSalt = ensureBase64Padding(salt);
|
|
326
|
+
const paddedIv = ensureBase64Padding(iv);
|
|
327
|
+
const paddedCipher = ensureBase64Padding(cipher);
|
|
328
|
+
const saltBytes = base64ToBytes(paddedSalt);
|
|
329
|
+
const ivBytes = base64ToBytes(paddedIv);
|
|
330
|
+
const cipherBytes = base64ToBytes(paddedCipher);
|
|
331
|
+
let encryptionConfig;
|
|
332
|
+
// Use version-based configuration if available, otherwise fallback to legacy
|
|
333
|
+
if (version && ENCRYPTION_VERSIONS[version]) {
|
|
334
|
+
encryptionConfig = ENCRYPTION_VERSIONS[version];
|
|
335
|
+
} else {
|
|
336
|
+
// Fallback to legacy version for backward compatibility
|
|
337
|
+
encryptionConfig = ENCRYPTION_VERSIONS[ENCRYPTION_VERSION_LEGACY];
|
|
338
|
+
}
|
|
295
339
|
try {
|
|
296
|
-
const { salt, iv, cipher } = data;
|
|
297
|
-
// Ensure proper base64 padding for all values
|
|
298
|
-
const paddedSalt = ensureBase64Padding(salt);
|
|
299
|
-
const paddedIv = ensureBase64Padding(iv);
|
|
300
|
-
const paddedCipher = ensureBase64Padding(cipher);
|
|
301
|
-
const saltBytes = base64ToBytes(paddedSalt);
|
|
302
|
-
const ivBytes = base64ToBytes(paddedIv);
|
|
303
|
-
const cipherBytes = base64ToBytes(paddedCipher);
|
|
304
340
|
const key = await getKey({
|
|
305
341
|
password,
|
|
306
|
-
salt: saltBytes
|
|
342
|
+
salt: saltBytes,
|
|
343
|
+
encryptionConfig
|
|
307
344
|
});
|
|
308
345
|
const decryptedData = await crypto.subtle.decrypt({
|
|
309
346
|
name: AES_GCM_ALGORITHM,
|
|
@@ -311,9 +348,25 @@ const decryptData = async ({ data, password })=>{
|
|
|
311
348
|
}, key, cipherBytes);
|
|
312
349
|
return new TextDecoder().decode(decryptedData);
|
|
313
350
|
} catch (error) {
|
|
314
|
-
throw new Error('Decryption failed');
|
|
351
|
+
throw new Error('Decryption failed: ' + error);
|
|
315
352
|
}
|
|
316
353
|
};
|
|
354
|
+
/**
|
|
355
|
+
* Gets encryption metadata for a specific version.
|
|
356
|
+
* Used when we need to include metadata in legacy systems or APIs that require it.
|
|
357
|
+
*/ const getEncryptionMetadataForVersion = (version)=>{
|
|
358
|
+
const encryptionConfig = ENCRYPTION_VERSIONS[version];
|
|
359
|
+
if (!encryptionConfig) {
|
|
360
|
+
throw new Error(`Unsupported encryption version: ${version}`);
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
algorithm: encryptionConfig.algorithm,
|
|
364
|
+
keyDerivation: encryptionConfig.keyDerivation,
|
|
365
|
+
iterations: encryptionConfig.iterations,
|
|
366
|
+
hashAlgorithm: encryptionConfig.hashAlgorithm,
|
|
367
|
+
algorithmLength: encryptionConfig.algorithmLength
|
|
368
|
+
};
|
|
369
|
+
};
|
|
317
370
|
|
|
318
371
|
const GOOGLE_DRIVE_UPLOAD_API = 'https://www.googleapis.com';
|
|
319
372
|
const uploadFileToGoogleDriveAppStorage = async ({ accessToken, fileName, jsonData })=>{
|
|
@@ -1322,6 +1375,7 @@ class DynamicWalletClient {
|
|
|
1322
1375
|
walletId: this.walletMap[accountAddress].walletId,
|
|
1323
1376
|
encryptedKeyShares: dynamicClientKeyShares,
|
|
1324
1377
|
passwordEncrypted: Boolean(password) && password !== this.environmentId,
|
|
1378
|
+
encryptionVersion: ENCRYPTION_VERSION_CURRENT,
|
|
1325
1379
|
signedSessionId
|
|
1326
1380
|
});
|
|
1327
1381
|
await this.apiClient.markKeySharesAsBackedUp({
|
|
@@ -2008,7 +2062,7 @@ class DynamicWalletClient {
|
|
|
2008
2062
|
throw error;
|
|
2009
2063
|
}
|
|
2010
2064
|
}
|
|
2011
|
-
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug
|
|
2065
|
+
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug }){
|
|
2012
2066
|
this.initializePromise = null;
|
|
2013
2067
|
this.logger = logger;
|
|
2014
2068
|
this.walletMap = {} // todo: store in session storage
|
|
@@ -2021,8 +2075,7 @@ class DynamicWalletClient {
|
|
|
2021
2075
|
this.apiClient = new DynamicApiClient({
|
|
2022
2076
|
environmentId,
|
|
2023
2077
|
authToken,
|
|
2024
|
-
baseApiUrl
|
|
2025
|
-
baseClientRelayApiUrl
|
|
2078
|
+
baseApiUrl
|
|
2026
2079
|
});
|
|
2027
2080
|
this.debug = Boolean(debug);
|
|
2028
2081
|
this.logger.setLogLevel(this.debug ? LogLevel.DEBUG : DEFAULT_LOG_LEVEL);
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.102",
|
|
4
4
|
"license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/core": "0.0.
|
|
6
|
+
"@dynamic-labs-wallet/core": "0.0.102",
|
|
7
7
|
"@dynamic-labs/logger": "^4.9.9",
|
|
8
8
|
"@dynamic-labs/sdk-api-core": "^0.0.663",
|
|
9
9
|
"axios": "1.9.0",
|
|
@@ -1,22 +1,62 @@
|
|
|
1
|
+
import { EncryptionMetadata } from '@dynamic-labs-wallet/core';
|
|
2
|
+
export declare const ENCRYPTION_VERSION_LEGACY = "v1";
|
|
3
|
+
export declare const ENCRYPTION_VERSION_CURRENT = "v2";
|
|
1
4
|
export declare const PBKDF2_ALGORITHM = "PBKDF2";
|
|
2
|
-
export declare const PBKDF2_ITERATIONS = 100000;
|
|
3
5
|
export declare const PBKDF2_HASH_ALGORITHM = "SHA-256";
|
|
4
6
|
export declare const AES_GCM_ALGORITHM = "AES-GCM";
|
|
5
7
|
export declare const AES_GCM_LENGTH = 256;
|
|
6
|
-
export declare const
|
|
8
|
+
export declare const ENCRYPTION_VERSIONS: {
|
|
9
|
+
readonly v1: {
|
|
10
|
+
readonly version: "v1";
|
|
11
|
+
readonly algorithm: "AES-GCM";
|
|
12
|
+
readonly keyDerivation: "PBKDF2";
|
|
13
|
+
readonly iterations: 100000;
|
|
14
|
+
readonly hashAlgorithm: "SHA-256";
|
|
15
|
+
readonly algorithmLength: 256;
|
|
16
|
+
};
|
|
17
|
+
readonly v2: {
|
|
18
|
+
readonly version: "v2";
|
|
19
|
+
readonly algorithm: "AES-GCM";
|
|
20
|
+
readonly keyDerivation: "PBKDF2";
|
|
21
|
+
readonly iterations: 1000000;
|
|
22
|
+
readonly hashAlgorithm: "SHA-256";
|
|
23
|
+
readonly algorithmLength: 256;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const PBKDF2_ITERATIONS: 1000000;
|
|
27
|
+
export declare const PBKDF2_ITERATIONS_LEGACY: 100000;
|
|
28
|
+
export type EncryptionVersion = (typeof ENCRYPTION_VERSIONS)[keyof typeof ENCRYPTION_VERSIONS];
|
|
29
|
+
/**
|
|
30
|
+
* Encrypts data using the specified encryption version.
|
|
31
|
+
* Always uses the latest encryption configuration for new encryptions by default.
|
|
32
|
+
*/
|
|
33
|
+
export declare const encryptData: ({ data, password, version, }: {
|
|
7
34
|
data: string;
|
|
8
35
|
password: string;
|
|
36
|
+
version?: string;
|
|
9
37
|
}) => Promise<{
|
|
10
38
|
salt: string;
|
|
11
39
|
iv: string;
|
|
12
40
|
cipher: string;
|
|
41
|
+
version: string;
|
|
13
42
|
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Decrypts data with version-based configuration.
|
|
45
|
+
* Uses the version field from the data to determine encryption parameters.
|
|
46
|
+
* Falls back to legacy version for backward compatibility if no version is specified.
|
|
47
|
+
*/
|
|
14
48
|
export declare const decryptData: ({ data, password, }: {
|
|
15
49
|
data: {
|
|
16
50
|
salt: string;
|
|
17
51
|
iv: string;
|
|
18
52
|
cipher: string;
|
|
53
|
+
version?: string;
|
|
19
54
|
};
|
|
20
55
|
password: string;
|
|
21
56
|
}) => Promise<string>;
|
|
57
|
+
/**
|
|
58
|
+
* Gets encryption metadata for a specific version.
|
|
59
|
+
* Used when we need to include metadata in legacy systems or APIs that require it.
|
|
60
|
+
*/
|
|
61
|
+
export declare const getEncryptionMetadataForVersion: (version: string) => EncryptionMetadata;
|
|
22
62
|
//# sourceMappingURL=encryption.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../src/backup/encryption.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../src/backup/encryption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAQ/D,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAC/C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;CAiBtB,CAAC;AAEX,eAAO,MAAM,iBAAiB,SAC8B,CAAC;AAC7D,eAAO,MAAM,wBAAwB,QACsB,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAsCjE;;;GAGG;AACH,eAAO,MAAM,WAAW,iCAIrB;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;;;;;EAkCA,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,wBAGrB;IACD,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,QAAQ,EAAE,MAAM,CAAC;CAClB,oBA2CA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,YACjC,MAAM,KACd,kBAcF,CAAC"}
|
package/src/client.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare class DynamicWalletClient {
|
|
|
19
19
|
protected iframe: HTMLIFrameElement | null;
|
|
20
20
|
readonly instanceId: string;
|
|
21
21
|
readonly iframeDomain: string;
|
|
22
|
-
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug,
|
|
22
|
+
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug, }: DynamicWalletClientProps);
|
|
23
23
|
initLoggerContext(authToken: string): Promise<void>;
|
|
24
24
|
initialize(): Promise<InitializeResult>;
|
|
25
25
|
/**
|
package/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,gBAAgB,EAChB,KAAK,wBAAwB,EAO7B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAEvB,wBAAwB,E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D,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;KACnC,GAAG,OAAO,CAAC,OAAO,CAAC;IAYpB;;OAEG;IACG,uCAAuC,CAAC,EAC5C,cAAc,EACd,eAAiD,GAClD,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;KACnC,GAAG,OAAO,CAAC,OAAO,CAAC;IAgCd,iCAAiC,CAAC,EACtC,cAAc,GACf,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgCzB,SAAS,CAAC,EACd,cAAc,EACd,eAA8C,EAC9C,UAAsB,EACtB,QAAoB,EACpB,eAAe,GAChB,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;QAClC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B;IAiGK,UAAU;CA2CjB"}
|
package/src/utils.d.ts
CHANGED
|
@@ -52,18 +52,12 @@ export declare const createBackupData: ({ encryptedKeyShares, accountAddress, th
|
|
|
52
52
|
}) => {
|
|
53
53
|
keyShares: string[];
|
|
54
54
|
metadata: {
|
|
55
|
-
version: string;
|
|
56
55
|
createdAt: string;
|
|
57
56
|
accountAddress: string;
|
|
58
57
|
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
59
58
|
hasPassword: boolean;
|
|
60
|
-
encryption:
|
|
61
|
-
|
|
62
|
-
keyDerivation: string;
|
|
63
|
-
iterations: number;
|
|
64
|
-
hashAlgorithm: string;
|
|
65
|
-
algorithmLength: number;
|
|
66
|
-
};
|
|
59
|
+
encryption: import("@dynamic-labs-wallet/core").EncryptionMetadata;
|
|
60
|
+
encryptionVersion: string;
|
|
67
61
|
shareCount: number;
|
|
68
62
|
};
|
|
69
63
|
};
|
package/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,eAAO,MAAM,aAAa,QAAS,UAAU,WAE5C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,MAAM,eAExC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,eAE3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MAEjD,CAAC;AAEF,eAAO,MAAM,SAAS,eAAsC,CAAC;AAE7D,eAAO,MAAM,WAAW,QAAS,MAAM,YAKtC,CAAC;AAEF,eAAO,MAAM,+BAA+B,kDAGzC;IACD,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,cAAc,EAAE,MAAM,CAAC;CACxB,WAEA,CAAC;AAEF,eAAO,MAAM,2BAA2B,YAAa;IACnD,gBAAgB,EAAE,oBAAoB,CAAC;CACxC,KAAG,kBAgCH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,s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