@dynamic-labs-wallet/browser 0.0.0-beta-192.1 → 0.0.0-beta-272

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 CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var core = require('@dynamic-labs-wallet/core');
4
+ var uuid = require('uuid');
4
5
  var web = require('./internal/web');
5
6
  var logger$1 = require('@dynamic-labs/logger');
6
7
  var sdkApiCore = require('@dynamic-labs/sdk-api-core');
@@ -223,29 +224,44 @@ const createBackupData = ({ encryptedKeyShares, accountAddress, thresholdSignatu
223
224
  return {
224
225
  keyShares: encryptedKeyShares,
225
226
  metadata: {
226
- version: '1.0',
227
227
  createdAt: new Date().toISOString(),
228
228
  accountAddress,
229
229
  thresholdSignatureScheme,
230
230
  hasPassword,
231
- encryption: {
232
- algorithm: AES_GCM_ALGORITHM,
233
- keyDerivation: PBKDF2_ALGORITHM,
234
- iterations: PBKDF2_ITERATIONS,
235
- hashAlgorithm: PBKDF2_HASH_ALGORITHM,
236
- algorithmLength: AES_GCM_LENGTH
237
- },
231
+ encryption: getEncryptionMetadataForVersion(ENCRYPTION_VERSION_CURRENT),
232
+ encryptionVersion: ENCRYPTION_VERSION_CURRENT,
238
233
  shareCount: encryptedKeyShares.length
239
234
  }
240
235
  };
241
236
  };
242
237
 
238
+ const ENCRYPTION_VERSION_LEGACY = 'v1';
239
+ const ENCRYPTION_VERSION_CURRENT = 'v2';
243
240
  const PBKDF2_ALGORITHM = 'PBKDF2';
244
- const PBKDF2_ITERATIONS = 100000;
245
241
  const PBKDF2_HASH_ALGORITHM = 'SHA-256';
246
242
  const AES_GCM_ALGORITHM = 'AES-GCM';
247
243
  const AES_GCM_LENGTH = 256;
248
- const getKey = async ({ password, salt })=>{
244
+ const ENCRYPTION_VERSIONS = {
245
+ [ENCRYPTION_VERSION_LEGACY]: {
246
+ version: ENCRYPTION_VERSION_LEGACY,
247
+ algorithm: AES_GCM_ALGORITHM,
248
+ keyDerivation: PBKDF2_ALGORITHM,
249
+ iterations: 100000,
250
+ hashAlgorithm: PBKDF2_HASH_ALGORITHM,
251
+ algorithmLength: AES_GCM_LENGTH
252
+ },
253
+ [ENCRYPTION_VERSION_CURRENT]: {
254
+ version: ENCRYPTION_VERSION_CURRENT,
255
+ algorithm: AES_GCM_ALGORITHM,
256
+ keyDerivation: PBKDF2_ALGORITHM,
257
+ iterations: 1000000,
258
+ hashAlgorithm: PBKDF2_HASH_ALGORITHM,
259
+ algorithmLength: AES_GCM_LENGTH
260
+ }
261
+ };
262
+ ENCRYPTION_VERSIONS[ENCRYPTION_VERSION_CURRENT].iterations;
263
+ ENCRYPTION_VERSIONS[ENCRYPTION_VERSION_LEGACY].iterations;
264
+ const getKey = async ({ password, salt, encryptionConfig })=>{
249
265
  const passwordBytes = stringToBytes(password);
250
266
  const initialKey = await crypto.subtle.importKey('raw', passwordBytes, {
251
267
  name: 'PBKDF2'
@@ -253,26 +269,34 @@ const getKey = async ({ password, salt })=>{
253
269
  'deriveKey'
254
270
  ]);
255
271
  return crypto.subtle.deriveKey({
256
- name: PBKDF2_ALGORITHM,
257
- salt,
258
- iterations: PBKDF2_ITERATIONS,
259
- hash: PBKDF2_HASH_ALGORITHM
272
+ name: encryptionConfig.keyDerivation,
273
+ salt: salt,
274
+ iterations: encryptionConfig.iterations,
275
+ hash: encryptionConfig.hashAlgorithm
260
276
  }, initialKey, {
261
- name: AES_GCM_ALGORITHM,
262
- length: AES_GCM_LENGTH
277
+ name: encryptionConfig.algorithm,
278
+ length: encryptionConfig.algorithmLength
263
279
  }, false, [
264
280
  'encrypt',
265
281
  'decrypt'
266
282
  ]);
267
283
  };
268
- const encryptData = async ({ data, password })=>{
284
+ /**
285
+ * Encrypts data using the specified encryption version.
286
+ * Always uses the latest encryption configuration for new encryptions by default.
287
+ */ const encryptData = async ({ data, password, version = ENCRYPTION_VERSION_CURRENT })=>{
288
+ const encryptionConfig = ENCRYPTION_VERSIONS[version];
289
+ if (!encryptionConfig) {
290
+ throw new Error(`Unsupported encryption version: ${version}`);
291
+ }
269
292
  try {
270
293
  // Generate a random salt and IV
271
294
  const salt = crypto.getRandomValues(new Uint8Array(16));
272
295
  const iv = crypto.getRandomValues(new Uint8Array(12)); // AES-GCM requires 12 bytes
273
296
  const key = await getKey({
274
297
  password,
275
- salt
298
+ salt,
299
+ encryptionConfig
276
300
  });
277
301
  // Convert the input string to bytes
278
302
  const dataBytes = new TextEncoder().encode(data);
@@ -285,25 +309,39 @@ const encryptData = async ({ data, password })=>{
285
309
  return {
286
310
  salt: bytesToBase64(salt),
287
311
  iv: bytesToBase64(iv),
288
- cipher: bytesToBase64(new Uint8Array(encryptedData))
312
+ cipher: bytesToBase64(new Uint8Array(encryptedData)),
313
+ version
289
314
  };
290
315
  } catch (error) {
291
316
  throw new Error('Error encrypting data');
292
317
  }
293
318
  };
294
- const decryptData = async ({ data, password })=>{
319
+ /**
320
+ * Decrypts data with version-based configuration.
321
+ * Uses the version field from the data to determine encryption parameters.
322
+ * Falls back to legacy version for backward compatibility if no version is specified.
323
+ */ const decryptData = async ({ data, password })=>{
324
+ const { salt, iv, cipher, version } = data;
325
+ // Ensure proper base64 padding for all values
326
+ const paddedSalt = ensureBase64Padding(salt);
327
+ const paddedIv = ensureBase64Padding(iv);
328
+ const paddedCipher = ensureBase64Padding(cipher);
329
+ const saltBytes = base64ToBytes(paddedSalt);
330
+ const ivBytes = base64ToBytes(paddedIv);
331
+ const cipherBytes = base64ToBytes(paddedCipher);
332
+ let encryptionConfig;
333
+ // Use version-based configuration if available, otherwise fallback to legacy
334
+ if (version && ENCRYPTION_VERSIONS[version]) {
335
+ encryptionConfig = ENCRYPTION_VERSIONS[version];
336
+ } else {
337
+ // Fallback to legacy version for backward compatibility
338
+ encryptionConfig = ENCRYPTION_VERSIONS[ENCRYPTION_VERSION_LEGACY];
339
+ }
295
340
  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
341
  const key = await getKey({
305
342
  password,
306
- salt: saltBytes
343
+ salt: saltBytes,
344
+ encryptionConfig
307
345
  });
308
346
  const decryptedData = await crypto.subtle.decrypt({
309
347
  name: AES_GCM_ALGORITHM,
@@ -311,8 +349,24 @@ const decryptData = async ({ data, password })=>{
311
349
  }, key, cipherBytes);
312
350
  return new TextDecoder().decode(decryptedData);
313
351
  } catch (error) {
314
- throw new Error('Decryption failed');
352
+ throw new Error('Decryption failed: ' + error);
353
+ }
354
+ };
355
+ /**
356
+ * Gets encryption metadata for a specific version.
357
+ * Used when we need to include metadata in legacy systems or APIs that require it.
358
+ */ const getEncryptionMetadataForVersion = (version)=>{
359
+ const encryptionConfig = ENCRYPTION_VERSIONS[version];
360
+ if (!encryptionConfig) {
361
+ throw new Error(`Unsupported encryption version: ${version}`);
315
362
  }
363
+ return {
364
+ algorithm: encryptionConfig.algorithm,
365
+ keyDerivation: encryptionConfig.keyDerivation,
366
+ iterations: encryptionConfig.iterations,
367
+ hashAlgorithm: encryptionConfig.hashAlgorithm,
368
+ algorithmLength: encryptionConfig.algorithmLength
369
+ };
316
370
  };
317
371
 
318
372
  const GOOGLE_DRIVE_UPLOAD_API = 'https://www.googleapis.com';
@@ -600,11 +654,12 @@ class DynamicWalletClient {
600
654
  };
601
655
  }
602
656
  }
603
- async serverInitializeKeyGen({ chainName, clientKeygenIds, thresholdSignatureScheme, onError, onCeremonyComplete }) {
657
+ async serverInitializeKeyGen({ chainName, clientKeygenIds, dynamicRequestId, thresholdSignatureScheme, onError, onCeremonyComplete }) {
604
658
  // Initialize keygen, create room, and create the wallet account on the server
605
659
  const data = await this.apiClient.createWalletAccount({
606
660
  chainName,
607
661
  clientKeygenIds,
662
+ dynamicRequestId,
608
663
  thresholdSignatureScheme,
609
664
  onError,
610
665
  onCeremonyComplete
@@ -675,6 +730,7 @@ class DynamicWalletClient {
675
730
  };
676
731
  }
677
732
  async keyGen({ chainName, thresholdSignatureScheme, onError, onCeremonyComplete }) {
733
+ const dynamicRequestId = uuid.v4();
678
734
  try {
679
735
  const clientKeygenInitResults = await this.clientInitializeKeyGen({
680
736
  chainName,
@@ -689,6 +745,7 @@ class DynamicWalletClient {
689
745
  const { roomId, serverKeygenIds } = await this.serverInitializeKeyGen({
690
746
  chainName,
691
747
  clientKeygenIds,
748
+ dynamicRequestId,
692
749
  thresholdSignatureScheme,
693
750
  onCeremonyComplete
694
751
  });
@@ -724,13 +781,15 @@ class DynamicWalletClient {
724
781
  error: error,
725
782
  context: {
726
783
  chainName,
727
- thresholdSignatureScheme
784
+ thresholdSignatureScheme,
785
+ dynamicRequestId
728
786
  }
729
787
  });
730
788
  throw error;
731
789
  }
732
790
  }
733
791
  async importRawPrivateKey({ chainName, privateKey, thresholdSignatureScheme, onError, onCeremonyComplete }) {
792
+ const dynamicRequestId = uuid.v4();
734
793
  try {
735
794
  const mpcSigner = getMPCSigner({
736
795
  chainName,
@@ -749,6 +808,7 @@ class DynamicWalletClient {
749
808
  const { roomId, serverKeygenIds } = await this.apiClient.importPrivateKey({
750
809
  chainName,
751
810
  clientKeygenIds,
811
+ dynamicRequestId,
752
812
  thresholdSignatureScheme,
753
813
  onError,
754
814
  onCeremonyComplete
@@ -801,7 +861,8 @@ class DynamicWalletClient {
801
861
  error: error,
802
862
  context: {
803
863
  chainName,
804
- thresholdSignatureScheme
864
+ thresholdSignatureScheme,
865
+ dynamicRequestId
805
866
  }
806
867
  });
807
868
  throw error;
@@ -815,7 +876,8 @@ class DynamicWalletClient {
815
876
  const data = await this.apiClient.signMessage({
816
877
  walletId,
817
878
  message,
818
- isFormatted
879
+ isFormatted,
880
+ dynamicRequestId: uuid.v4()
819
881
  });
820
882
  return data;
821
883
  }
@@ -911,6 +973,7 @@ class DynamicWalletClient {
911
973
  }
912
974
  }
913
975
  async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, signedSessionId }) {
976
+ const dynamicRequestId = uuid.v4();
914
977
  try {
915
978
  await this.verifyPassword({
916
979
  accountAddress,
@@ -930,6 +993,7 @@ class DynamicWalletClient {
930
993
  });
931
994
  // Create the room and refresh the shares
932
995
  const data = await this.apiClient.refreshWalletAccountShares({
996
+ dynamicRequestId,
933
997
  walletId: wallet.walletId
934
998
  });
935
999
  const roomId = data.roomId;
@@ -953,7 +1017,8 @@ class DynamicWalletClient {
953
1017
  error: error,
954
1018
  context: {
955
1019
  accountAddress,
956
- chainName
1020
+ chainName,
1021
+ dynamicRequestId
957
1022
  }
958
1023
  });
959
1024
  throw error;
@@ -1011,6 +1076,7 @@ class DynamicWalletClient {
1011
1076
  };
1012
1077
  }
1013
1078
  async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined, signedSessionId, backupToGoogleDrive = false }) {
1079
+ const dynamicRequestId = uuid.v4();
1014
1080
  try {
1015
1081
  await this.verifyPassword({
1016
1082
  accountAddress,
@@ -1045,7 +1111,8 @@ class DynamicWalletClient {
1045
1111
  walletId: wallet.walletId,
1046
1112
  clientKeygenIds: clientKeygenIds,
1047
1113
  oldThresholdSignatureScheme,
1048
- newThresholdSignatureScheme
1114
+ newThresholdSignatureScheme,
1115
+ dynamicRequestId
1049
1116
  });
1050
1117
  const { roomId, serverKeygenIds, newServerKeygenIds = [] } = data;
1051
1118
  // Get the MPC config for the threshold signature scheme
@@ -1087,13 +1154,15 @@ class DynamicWalletClient {
1087
1154
  chainName,
1088
1155
  oldThresholdSignatureScheme,
1089
1156
  newThresholdSignatureScheme,
1090
- backupToGoogleDrive
1157
+ backupToGoogleDrive,
1158
+ dynamicRequestId
1091
1159
  }
1092
1160
  });
1093
1161
  throw error;
1094
1162
  }
1095
1163
  }
1096
1164
  async exportKey({ accountAddress, chainName, password = undefined, signedSessionId }) {
1165
+ const dynamicRequestId = uuid.v4();
1097
1166
  try {
1098
1167
  const wallet = await this.getWallet({
1099
1168
  accountAddress,
@@ -1114,7 +1183,8 @@ class DynamicWalletClient {
1114
1183
  });
1115
1184
  const data = await this.apiClient.exportKey({
1116
1185
  walletId: wallet.walletId,
1117
- exportId
1186
+ exportId,
1187
+ dynamicRequestId
1118
1188
  });
1119
1189
  this.logger.debug('[DynamicWaasWalletClient] Starting export of private key', {
1120
1190
  accountAddress,
@@ -1152,7 +1222,8 @@ class DynamicWalletClient {
1152
1222
  error: error,
1153
1223
  context: {
1154
1224
  accountAddress,
1155
- chainName
1225
+ chainName,
1226
+ dynamicRequestId
1156
1227
  }
1157
1228
  });
1158
1229
  throw error;
@@ -1322,6 +1393,7 @@ class DynamicWalletClient {
1322
1393
  walletId: this.walletMap[accountAddress].walletId,
1323
1394
  encryptedKeyShares: dynamicClientKeyShares,
1324
1395
  passwordEncrypted: Boolean(password) && password !== this.environmentId,
1396
+ encryptionVersion: ENCRYPTION_VERSION_CURRENT,
1325
1397
  signedSessionId
1326
1398
  });
1327
1399
  await this.apiClient.markKeySharesAsBackedUp({
@@ -2008,7 +2080,13 @@ class DynamicWalletClient {
2008
2080
  throw error;
2009
2081
  }
2010
2082
  }
2011
- constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug, baseClientRelayApiUrl }){
2083
+ /**
2084
+ * sync auth token with api client
2085
+ * @param authToken - auth token to sync
2086
+ */ syncAuthToken(authToken) {
2087
+ this.apiClient.syncAuthToken(authToken);
2088
+ }
2089
+ constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug }){
2012
2090
  this.initializePromise = null;
2013
2091
  this.logger = logger;
2014
2092
  this.walletMap = {} // todo: store in session storage
@@ -2021,8 +2099,7 @@ class DynamicWalletClient {
2021
2099
  this.apiClient = new core.DynamicApiClient({
2022
2100
  environmentId,
2023
2101
  authToken,
2024
- baseApiUrl,
2025
- baseClientRelayApiUrl
2102
+ baseApiUrl
2026
2103
  });
2027
2104
  this.debug = Boolean(debug);
2028
2105
  this.logger.setLogLevel(this.debug ? logger$1.LogLevel.DEBUG : DEFAULT_LOG_LEVEL);
@@ -2036,17 +2113,16 @@ class DynamicWalletClient {
2036
2113
  const environment = core.getEnvironmentFromUrl(baseApiUrl);
2037
2114
  this.iframeDomain = core.IFRAME_DOMAIN_MAP[environment];
2038
2115
  // Generate unique instanceId when client is created
2039
- this.instanceId = crypto.randomUUID();
2116
+ this.instanceId = uuid.v4();
2040
2117
  // initialize logger context
2041
2118
  this.initLoggerContext(authToken);
2042
- // initialize the client
2043
- this.initialize();
2044
2119
  }
2045
2120
  }
2046
2121
 
2047
2122
  const ERROR_KEYGEN_FAILED = '[DynamicWaasWalletClient]: Error with keygen';
2048
2123
  const ERROR_CREATE_WALLET_ACCOUNT = '[DynamicWaasWalletClient]: Error creating wallet account';
2049
2124
  const ERROR_SIGN_MESSAGE = '[DynamicWaasWalletClient]: Error signing message';
2125
+ const ERROR_SIGN_TYPED_DATA = '[DynamicWaasWalletClient]: Error signing typed data';
2050
2126
  const ERROR_ACCOUNT_ADDRESS_REQUIRED = '[DynamicWaasWalletClient]: Account address is required';
2051
2127
  const ERROR_VERIFY_MESSAGE_SIGNATURE = '[DynamicWaasWalletClient]: Error verifying message signature';
2052
2128
  const ERROR_VERIFY_TRANSACTION_SIGNATURE = '[DynamicWaasWalletClient]: Error verifying transaction signature';
@@ -2101,6 +2177,10 @@ Object.defineProperty(exports, "MessageHash", {
2101
2177
  enumerable: true,
2102
2178
  get: function () { return web.MessageHash; }
2103
2179
  });
2180
+ Object.defineProperty(exports, "Logger", {
2181
+ enumerable: true,
2182
+ get: function () { return logger$1.Logger; }
2183
+ });
2104
2184
  exports.DynamicWalletClient = DynamicWalletClient;
2105
2185
  exports.ERROR_ACCOUNT_ADDRESS_REQUIRED = ERROR_ACCOUNT_ADDRESS_REQUIRED;
2106
2186
  exports.ERROR_CREATE_WALLET_ACCOUNT = ERROR_CREATE_WALLET_ACCOUNT;
@@ -2108,6 +2188,7 @@ exports.ERROR_EXPORT_PRIVATE_KEY = ERROR_EXPORT_PRIVATE_KEY;
2108
2188
  exports.ERROR_IMPORT_PRIVATE_KEY = ERROR_IMPORT_PRIVATE_KEY;
2109
2189
  exports.ERROR_KEYGEN_FAILED = ERROR_KEYGEN_FAILED;
2110
2190
  exports.ERROR_SIGN_MESSAGE = ERROR_SIGN_MESSAGE;
2191
+ exports.ERROR_SIGN_TYPED_DATA = ERROR_SIGN_TYPED_DATA;
2111
2192
  exports.ERROR_VERIFY_MESSAGE_SIGNATURE = ERROR_VERIFY_MESSAGE_SIGNATURE;
2112
2193
  exports.ERROR_VERIFY_TRANSACTION_SIGNATURE = ERROR_VERIFY_TRANSACTION_SIGNATURE;
2113
2194
  exports.base64ToBytes = base64ToBytes;
package/index.esm.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import { SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, BackupLocation, getClientThreshold, MPC_CONFIG, getTSSConfig, WalletOperation, getReshareConfig, ThresholdSignatureScheme, verifiedCredentialNameToChainEnum, DynamicApiClient, getEnvironmentFromUrl, IFRAME_DOMAIN_MAP } from '@dynamic-labs-wallet/core';
2
2
  export * from '@dynamic-labs-wallet/core';
3
+ import { v4 } from 'uuid';
3
4
  import { BIP340, ExportableEd25519, Ecdsa, MessageHash, EcdsaKeygenResult, ExportableEd25519KeygenResult, BIP340KeygenResult } from './internal/web';
4
5
  export { BIP340, BIP340InitKeygenResult, BIP340KeygenResult, Ecdsa, EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519, Ed25519InitKeygenResult, Ed25519KeygenResult, MessageHash } from './internal/web';
5
6
  import { LogLevel, Logger } from '@dynamic-labs/logger';
7
+ export { Logger } from '@dynamic-labs/logger';
6
8
  import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
7
9
  import { AxiosError } from 'axios';
8
10
  import createHttpError from 'http-errors';
@@ -223,29 +225,44 @@ const createBackupData = ({ encryptedKeyShares, accountAddress, thresholdSignatu
223
225
  return {
224
226
  keyShares: encryptedKeyShares,
225
227
  metadata: {
226
- version: '1.0',
227
228
  createdAt: new Date().toISOString(),
228
229
  accountAddress,
229
230
  thresholdSignatureScheme,
230
231
  hasPassword,
231
- encryption: {
232
- algorithm: AES_GCM_ALGORITHM,
233
- keyDerivation: PBKDF2_ALGORITHM,
234
- iterations: PBKDF2_ITERATIONS,
235
- hashAlgorithm: PBKDF2_HASH_ALGORITHM,
236
- algorithmLength: AES_GCM_LENGTH
237
- },
232
+ encryption: getEncryptionMetadataForVersion(ENCRYPTION_VERSION_CURRENT),
233
+ encryptionVersion: ENCRYPTION_VERSION_CURRENT,
238
234
  shareCount: encryptedKeyShares.length
239
235
  }
240
236
  };
241
237
  };
242
238
 
239
+ const ENCRYPTION_VERSION_LEGACY = 'v1';
240
+ const ENCRYPTION_VERSION_CURRENT = 'v2';
243
241
  const PBKDF2_ALGORITHM = 'PBKDF2';
244
- const PBKDF2_ITERATIONS = 100000;
245
242
  const PBKDF2_HASH_ALGORITHM = 'SHA-256';
246
243
  const AES_GCM_ALGORITHM = 'AES-GCM';
247
244
  const AES_GCM_LENGTH = 256;
248
- const getKey = async ({ password, salt })=>{
245
+ const ENCRYPTION_VERSIONS = {
246
+ [ENCRYPTION_VERSION_LEGACY]: {
247
+ version: ENCRYPTION_VERSION_LEGACY,
248
+ algorithm: AES_GCM_ALGORITHM,
249
+ keyDerivation: PBKDF2_ALGORITHM,
250
+ iterations: 100000,
251
+ hashAlgorithm: PBKDF2_HASH_ALGORITHM,
252
+ algorithmLength: AES_GCM_LENGTH
253
+ },
254
+ [ENCRYPTION_VERSION_CURRENT]: {
255
+ version: ENCRYPTION_VERSION_CURRENT,
256
+ algorithm: AES_GCM_ALGORITHM,
257
+ keyDerivation: PBKDF2_ALGORITHM,
258
+ iterations: 1000000,
259
+ hashAlgorithm: PBKDF2_HASH_ALGORITHM,
260
+ algorithmLength: AES_GCM_LENGTH
261
+ }
262
+ };
263
+ ENCRYPTION_VERSIONS[ENCRYPTION_VERSION_CURRENT].iterations;
264
+ ENCRYPTION_VERSIONS[ENCRYPTION_VERSION_LEGACY].iterations;
265
+ const getKey = async ({ password, salt, encryptionConfig })=>{
249
266
  const passwordBytes = stringToBytes(password);
250
267
  const initialKey = await crypto.subtle.importKey('raw', passwordBytes, {
251
268
  name: 'PBKDF2'
@@ -253,26 +270,34 @@ const getKey = async ({ password, salt })=>{
253
270
  'deriveKey'
254
271
  ]);
255
272
  return crypto.subtle.deriveKey({
256
- name: PBKDF2_ALGORITHM,
257
- salt,
258
- iterations: PBKDF2_ITERATIONS,
259
- hash: PBKDF2_HASH_ALGORITHM
273
+ name: encryptionConfig.keyDerivation,
274
+ salt: salt,
275
+ iterations: encryptionConfig.iterations,
276
+ hash: encryptionConfig.hashAlgorithm
260
277
  }, initialKey, {
261
- name: AES_GCM_ALGORITHM,
262
- length: AES_GCM_LENGTH
278
+ name: encryptionConfig.algorithm,
279
+ length: encryptionConfig.algorithmLength
263
280
  }, false, [
264
281
  'encrypt',
265
282
  'decrypt'
266
283
  ]);
267
284
  };
268
- const encryptData = async ({ data, password })=>{
285
+ /**
286
+ * Encrypts data using the specified encryption version.
287
+ * Always uses the latest encryption configuration for new encryptions by default.
288
+ */ const encryptData = async ({ data, password, version = ENCRYPTION_VERSION_CURRENT })=>{
289
+ const encryptionConfig = ENCRYPTION_VERSIONS[version];
290
+ if (!encryptionConfig) {
291
+ throw new Error(`Unsupported encryption version: ${version}`);
292
+ }
269
293
  try {
270
294
  // Generate a random salt and IV
271
295
  const salt = crypto.getRandomValues(new Uint8Array(16));
272
296
  const iv = crypto.getRandomValues(new Uint8Array(12)); // AES-GCM requires 12 bytes
273
297
  const key = await getKey({
274
298
  password,
275
- salt
299
+ salt,
300
+ encryptionConfig
276
301
  });
277
302
  // Convert the input string to bytes
278
303
  const dataBytes = new TextEncoder().encode(data);
@@ -285,25 +310,39 @@ const encryptData = async ({ data, password })=>{
285
310
  return {
286
311
  salt: bytesToBase64(salt),
287
312
  iv: bytesToBase64(iv),
288
- cipher: bytesToBase64(new Uint8Array(encryptedData))
313
+ cipher: bytesToBase64(new Uint8Array(encryptedData)),
314
+ version
289
315
  };
290
316
  } catch (error) {
291
317
  throw new Error('Error encrypting data');
292
318
  }
293
319
  };
294
- const decryptData = async ({ data, password })=>{
320
+ /**
321
+ * Decrypts data with version-based configuration.
322
+ * Uses the version field from the data to determine encryption parameters.
323
+ * Falls back to legacy version for backward compatibility if no version is specified.
324
+ */ const decryptData = async ({ data, password })=>{
325
+ const { salt, iv, cipher, version } = data;
326
+ // Ensure proper base64 padding for all values
327
+ const paddedSalt = ensureBase64Padding(salt);
328
+ const paddedIv = ensureBase64Padding(iv);
329
+ const paddedCipher = ensureBase64Padding(cipher);
330
+ const saltBytes = base64ToBytes(paddedSalt);
331
+ const ivBytes = base64ToBytes(paddedIv);
332
+ const cipherBytes = base64ToBytes(paddedCipher);
333
+ let encryptionConfig;
334
+ // Use version-based configuration if available, otherwise fallback to legacy
335
+ if (version && ENCRYPTION_VERSIONS[version]) {
336
+ encryptionConfig = ENCRYPTION_VERSIONS[version];
337
+ } else {
338
+ // Fallback to legacy version for backward compatibility
339
+ encryptionConfig = ENCRYPTION_VERSIONS[ENCRYPTION_VERSION_LEGACY];
340
+ }
295
341
  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
342
  const key = await getKey({
305
343
  password,
306
- salt: saltBytes
344
+ salt: saltBytes,
345
+ encryptionConfig
307
346
  });
308
347
  const decryptedData = await crypto.subtle.decrypt({
309
348
  name: AES_GCM_ALGORITHM,
@@ -311,8 +350,24 @@ const decryptData = async ({ data, password })=>{
311
350
  }, key, cipherBytes);
312
351
  return new TextDecoder().decode(decryptedData);
313
352
  } catch (error) {
314
- throw new Error('Decryption failed');
353
+ throw new Error('Decryption failed: ' + error);
354
+ }
355
+ };
356
+ /**
357
+ * Gets encryption metadata for a specific version.
358
+ * Used when we need to include metadata in legacy systems or APIs that require it.
359
+ */ const getEncryptionMetadataForVersion = (version)=>{
360
+ const encryptionConfig = ENCRYPTION_VERSIONS[version];
361
+ if (!encryptionConfig) {
362
+ throw new Error(`Unsupported encryption version: ${version}`);
315
363
  }
364
+ return {
365
+ algorithm: encryptionConfig.algorithm,
366
+ keyDerivation: encryptionConfig.keyDerivation,
367
+ iterations: encryptionConfig.iterations,
368
+ hashAlgorithm: encryptionConfig.hashAlgorithm,
369
+ algorithmLength: encryptionConfig.algorithmLength
370
+ };
316
371
  };
317
372
 
318
373
  const GOOGLE_DRIVE_UPLOAD_API = 'https://www.googleapis.com';
@@ -600,11 +655,12 @@ class DynamicWalletClient {
600
655
  };
601
656
  }
602
657
  }
603
- async serverInitializeKeyGen({ chainName, clientKeygenIds, thresholdSignatureScheme, onError, onCeremonyComplete }) {
658
+ async serverInitializeKeyGen({ chainName, clientKeygenIds, dynamicRequestId, thresholdSignatureScheme, onError, onCeremonyComplete }) {
604
659
  // Initialize keygen, create room, and create the wallet account on the server
605
660
  const data = await this.apiClient.createWalletAccount({
606
661
  chainName,
607
662
  clientKeygenIds,
663
+ dynamicRequestId,
608
664
  thresholdSignatureScheme,
609
665
  onError,
610
666
  onCeremonyComplete
@@ -675,6 +731,7 @@ class DynamicWalletClient {
675
731
  };
676
732
  }
677
733
  async keyGen({ chainName, thresholdSignatureScheme, onError, onCeremonyComplete }) {
734
+ const dynamicRequestId = v4();
678
735
  try {
679
736
  const clientKeygenInitResults = await this.clientInitializeKeyGen({
680
737
  chainName,
@@ -689,6 +746,7 @@ class DynamicWalletClient {
689
746
  const { roomId, serverKeygenIds } = await this.serverInitializeKeyGen({
690
747
  chainName,
691
748
  clientKeygenIds,
749
+ dynamicRequestId,
692
750
  thresholdSignatureScheme,
693
751
  onCeremonyComplete
694
752
  });
@@ -724,13 +782,15 @@ class DynamicWalletClient {
724
782
  error: error,
725
783
  context: {
726
784
  chainName,
727
- thresholdSignatureScheme
785
+ thresholdSignatureScheme,
786
+ dynamicRequestId
728
787
  }
729
788
  });
730
789
  throw error;
731
790
  }
732
791
  }
733
792
  async importRawPrivateKey({ chainName, privateKey, thresholdSignatureScheme, onError, onCeremonyComplete }) {
793
+ const dynamicRequestId = v4();
734
794
  try {
735
795
  const mpcSigner = getMPCSigner({
736
796
  chainName,
@@ -749,6 +809,7 @@ class DynamicWalletClient {
749
809
  const { roomId, serverKeygenIds } = await this.apiClient.importPrivateKey({
750
810
  chainName,
751
811
  clientKeygenIds,
812
+ dynamicRequestId,
752
813
  thresholdSignatureScheme,
753
814
  onError,
754
815
  onCeremonyComplete
@@ -801,7 +862,8 @@ class DynamicWalletClient {
801
862
  error: error,
802
863
  context: {
803
864
  chainName,
804
- thresholdSignatureScheme
865
+ thresholdSignatureScheme,
866
+ dynamicRequestId
805
867
  }
806
868
  });
807
869
  throw error;
@@ -815,7 +877,8 @@ class DynamicWalletClient {
815
877
  const data = await this.apiClient.signMessage({
816
878
  walletId,
817
879
  message,
818
- isFormatted
880
+ isFormatted,
881
+ dynamicRequestId: v4()
819
882
  });
820
883
  return data;
821
884
  }
@@ -911,6 +974,7 @@ class DynamicWalletClient {
911
974
  }
912
975
  }
913
976
  async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, signedSessionId }) {
977
+ const dynamicRequestId = v4();
914
978
  try {
915
979
  await this.verifyPassword({
916
980
  accountAddress,
@@ -930,6 +994,7 @@ class DynamicWalletClient {
930
994
  });
931
995
  // Create the room and refresh the shares
932
996
  const data = await this.apiClient.refreshWalletAccountShares({
997
+ dynamicRequestId,
933
998
  walletId: wallet.walletId
934
999
  });
935
1000
  const roomId = data.roomId;
@@ -953,7 +1018,8 @@ class DynamicWalletClient {
953
1018
  error: error,
954
1019
  context: {
955
1020
  accountAddress,
956
- chainName
1021
+ chainName,
1022
+ dynamicRequestId
957
1023
  }
958
1024
  });
959
1025
  throw error;
@@ -1011,6 +1077,7 @@ class DynamicWalletClient {
1011
1077
  };
1012
1078
  }
1013
1079
  async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined, signedSessionId, backupToGoogleDrive = false }) {
1080
+ const dynamicRequestId = v4();
1014
1081
  try {
1015
1082
  await this.verifyPassword({
1016
1083
  accountAddress,
@@ -1045,7 +1112,8 @@ class DynamicWalletClient {
1045
1112
  walletId: wallet.walletId,
1046
1113
  clientKeygenIds: clientKeygenIds,
1047
1114
  oldThresholdSignatureScheme,
1048
- newThresholdSignatureScheme
1115
+ newThresholdSignatureScheme,
1116
+ dynamicRequestId
1049
1117
  });
1050
1118
  const { roomId, serverKeygenIds, newServerKeygenIds = [] } = data;
1051
1119
  // Get the MPC config for the threshold signature scheme
@@ -1087,13 +1155,15 @@ class DynamicWalletClient {
1087
1155
  chainName,
1088
1156
  oldThresholdSignatureScheme,
1089
1157
  newThresholdSignatureScheme,
1090
- backupToGoogleDrive
1158
+ backupToGoogleDrive,
1159
+ dynamicRequestId
1091
1160
  }
1092
1161
  });
1093
1162
  throw error;
1094
1163
  }
1095
1164
  }
1096
1165
  async exportKey({ accountAddress, chainName, password = undefined, signedSessionId }) {
1166
+ const dynamicRequestId = v4();
1097
1167
  try {
1098
1168
  const wallet = await this.getWallet({
1099
1169
  accountAddress,
@@ -1114,7 +1184,8 @@ class DynamicWalletClient {
1114
1184
  });
1115
1185
  const data = await this.apiClient.exportKey({
1116
1186
  walletId: wallet.walletId,
1117
- exportId
1187
+ exportId,
1188
+ dynamicRequestId
1118
1189
  });
1119
1190
  this.logger.debug('[DynamicWaasWalletClient] Starting export of private key', {
1120
1191
  accountAddress,
@@ -1152,7 +1223,8 @@ class DynamicWalletClient {
1152
1223
  error: error,
1153
1224
  context: {
1154
1225
  accountAddress,
1155
- chainName
1226
+ chainName,
1227
+ dynamicRequestId
1156
1228
  }
1157
1229
  });
1158
1230
  throw error;
@@ -1322,6 +1394,7 @@ class DynamicWalletClient {
1322
1394
  walletId: this.walletMap[accountAddress].walletId,
1323
1395
  encryptedKeyShares: dynamicClientKeyShares,
1324
1396
  passwordEncrypted: Boolean(password) && password !== this.environmentId,
1397
+ encryptionVersion: ENCRYPTION_VERSION_CURRENT,
1325
1398
  signedSessionId
1326
1399
  });
1327
1400
  await this.apiClient.markKeySharesAsBackedUp({
@@ -2008,7 +2081,13 @@ class DynamicWalletClient {
2008
2081
  throw error;
2009
2082
  }
2010
2083
  }
2011
- constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug, baseClientRelayApiUrl }){
2084
+ /**
2085
+ * sync auth token with api client
2086
+ * @param authToken - auth token to sync
2087
+ */ syncAuthToken(authToken) {
2088
+ this.apiClient.syncAuthToken(authToken);
2089
+ }
2090
+ constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug }){
2012
2091
  this.initializePromise = null;
2013
2092
  this.logger = logger;
2014
2093
  this.walletMap = {} // todo: store in session storage
@@ -2021,8 +2100,7 @@ class DynamicWalletClient {
2021
2100
  this.apiClient = new DynamicApiClient({
2022
2101
  environmentId,
2023
2102
  authToken,
2024
- baseApiUrl,
2025
- baseClientRelayApiUrl
2103
+ baseApiUrl
2026
2104
  });
2027
2105
  this.debug = Boolean(debug);
2028
2106
  this.logger.setLogLevel(this.debug ? LogLevel.DEBUG : DEFAULT_LOG_LEVEL);
@@ -2036,21 +2114,20 @@ class DynamicWalletClient {
2036
2114
  const environment = getEnvironmentFromUrl(baseApiUrl);
2037
2115
  this.iframeDomain = IFRAME_DOMAIN_MAP[environment];
2038
2116
  // Generate unique instanceId when client is created
2039
- this.instanceId = crypto.randomUUID();
2117
+ this.instanceId = v4();
2040
2118
  // initialize logger context
2041
2119
  this.initLoggerContext(authToken);
2042
- // initialize the client
2043
- this.initialize();
2044
2120
  }
2045
2121
  }
2046
2122
 
2047
2123
  const ERROR_KEYGEN_FAILED = '[DynamicWaasWalletClient]: Error with keygen';
2048
2124
  const ERROR_CREATE_WALLET_ACCOUNT = '[DynamicWaasWalletClient]: Error creating wallet account';
2049
2125
  const ERROR_SIGN_MESSAGE = '[DynamicWaasWalletClient]: Error signing message';
2126
+ const ERROR_SIGN_TYPED_DATA = '[DynamicWaasWalletClient]: Error signing typed data';
2050
2127
  const ERROR_ACCOUNT_ADDRESS_REQUIRED = '[DynamicWaasWalletClient]: Account address is required';
2051
2128
  const ERROR_VERIFY_MESSAGE_SIGNATURE = '[DynamicWaasWalletClient]: Error verifying message signature';
2052
2129
  const ERROR_VERIFY_TRANSACTION_SIGNATURE = '[DynamicWaasWalletClient]: Error verifying transaction signature';
2053
2130
  const ERROR_EXPORT_PRIVATE_KEY = '[DynamicWaasWalletClient]: Error exporting private key';
2054
2131
  const ERROR_IMPORT_PRIVATE_KEY = '[DynamicWaasWalletClient]: Error importing private key';
2055
2132
 
2056
- export { DynamicWalletClient, ERROR_ACCOUNT_ADDRESS_REQUIRED, ERROR_CREATE_WALLET_ACCOUNT, ERROR_EXPORT_PRIVATE_KEY, ERROR_IMPORT_PRIVATE_KEY, ERROR_KEYGEN_FAILED, ERROR_SIGN_MESSAGE, ERROR_VERIFY_MESSAGE_SIGNATURE, ERROR_VERIFY_TRANSACTION_SIGNATURE, base64ToBytes, bytesToBase64, createBackupData, ensureBase64Padding, formatEvmMessage, formatMessage, getClientKeyShareBackupInfo, getClientKeyShareExportFileName, getGoogleOAuthAccountId, getMPCSignatureScheme, getMPCSigner, isBrowser, isHexString, mergeUniqueKeyShares, retryPromise, stringToBytes, timeoutPromise };
2133
+ export { DynamicWalletClient, ERROR_ACCOUNT_ADDRESS_REQUIRED, ERROR_CREATE_WALLET_ACCOUNT, ERROR_EXPORT_PRIVATE_KEY, ERROR_IMPORT_PRIVATE_KEY, ERROR_KEYGEN_FAILED, ERROR_SIGN_MESSAGE, ERROR_SIGN_TYPED_DATA, ERROR_VERIFY_MESSAGE_SIGNATURE, ERROR_VERIFY_TRANSACTION_SIGNATURE, base64ToBytes, bytesToBase64, createBackupData, ensureBase64Padding, formatEvmMessage, formatMessage, getClientKeyShareBackupInfo, getClientKeyShareExportFileName, getGoogleOAuthAccountId, getMPCSignatureScheme, getMPCSigner, isBrowser, isHexString, mergeUniqueKeyShares, retryPromise, stringToBytes, timeoutPromise };
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/browser",
3
- "version": "0.0.0-beta-192.1",
3
+ "version": "0.0.0-beta-272",
4
4
  "license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
5
+ "type": "commonjs",
5
6
  "dependencies": {
6
- "@dynamic-labs-wallet/core": "0.0.0-beta-192.1",
7
+ "@dynamic-labs-wallet/core": "0.0.0-beta-272",
7
8
  "@dynamic-labs/logger": "^4.9.9",
8
9
  "@dynamic-labs/sdk-api-core": "^0.0.663",
9
10
  "axios": "1.9.0",
10
11
  "http-errors": "2.0.0",
12
+ "uuid": "11.1.0",
11
13
  "@noble/hashes": "1.7.1"
12
14
  },
13
15
  "files": [
@@ -31,7 +33,7 @@
31
33
  "types": "./index.esm.d.ts",
32
34
  "import": "./index.esm.js",
33
35
  "require": "./index.cjs.js",
34
- "default": "./index.cjs.js"
36
+ "default": "./index.esm.js"
35
37
  }
36
38
  },
37
39
  "devDependencies": {
@@ -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 encryptData: ({ data, password, }: {
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":"AAOA,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,iBAAiB,SAAS,CAAC;AACxC,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,cAAc,MAAM,CAAC;AAiClC,eAAO,MAAM,WAAW,wBAGrB;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;;;;EA2BA,CAAC;AAEF,eAAO,MAAM,WAAW,wBAGrB;IACD,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB,oBAyBA,CAAC"}
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,16 +19,17 @@ 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, baseClientRelayApiUrl, }: DynamicWalletClientProps);
22
+ constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug, }: DynamicWalletClientProps);
23
23
  initLoggerContext(authToken: string): Promise<void>;
24
24
  initialize(): Promise<InitializeResult>;
25
25
  /**
26
26
  * Client initialization logic
27
27
  */
28
28
  protected _initialize(): Promise<InitializeResult>;
29
- serverInitializeKeyGen({ chainName, clientKeygenIds, thresholdSignatureScheme, onError, onCeremonyComplete, }: {
29
+ serverInitializeKeyGen({ chainName, clientKeygenIds, dynamicRequestId, thresholdSignatureScheme, onError, onCeremonyComplete, }: {
30
30
  chainName: string;
31
31
  clientKeygenIds: string[];
32
+ dynamicRequestId: string;
32
33
  thresholdSignatureScheme: ThresholdSignatureScheme;
33
34
  onError?: (error: Error) => void;
34
35
  onCeremonyComplete?: (accountAddress: string, walletId: string) => void;
@@ -90,13 +91,13 @@ export declare class DynamicWalletClient {
90
91
  chainName: string;
91
92
  password?: string;
92
93
  isFormatted?: boolean;
93
- signedSessionId?: string;
94
+ signedSessionId: string;
94
95
  }): Promise<Uint8Array | EcdsaSignature>;
95
96
  refreshWalletAccountShares({ accountAddress, chainName, password, signedSessionId, }: {
96
97
  accountAddress: string;
97
98
  chainName: string;
98
99
  password?: string;
99
- signedSessionId?: string;
100
+ signedSessionId: string;
100
101
  }): Promise<void>;
101
102
  getExportId({ chainName, clientKeyShare, }: {
102
103
  chainName: string;
@@ -134,14 +135,14 @@ export declare class DynamicWalletClient {
134
135
  oldThresholdSignatureScheme: ThresholdSignatureScheme;
135
136
  newThresholdSignatureScheme: ThresholdSignatureScheme;
136
137
  password?: string;
137
- signedSessionId?: string;
138
+ signedSessionId: string;
138
139
  backupToGoogleDrive?: boolean;
139
140
  }): Promise<void>;
140
141
  exportKey({ accountAddress, chainName, password, signedSessionId, }: {
141
142
  accountAddress: string;
142
143
  chainName: string;
143
144
  password?: string;
144
- signedSessionId?: string;
145
+ signedSessionId: string;
145
146
  }): Promise<{
146
147
  derivedPrivateKey: string | undefined;
147
148
  }>;
@@ -202,20 +203,20 @@ export declare class DynamicWalletClient {
202
203
  accountAddress: string;
203
204
  clientKeyShares?: ClientKeyShare[];
204
205
  password?: string;
205
- signedSessionId?: string;
206
+ signedSessionId: string;
206
207
  backupToGoogleDrive?: boolean;
207
208
  }): Promise<any>;
208
209
  storeEncryptedBackupByWalletWithRetry({ accountAddress, clientKeyShares, password, signedSessionId, }: {
209
210
  accountAddress: string;
210
211
  clientKeyShares?: ClientKeyShare[];
211
212
  password?: string;
212
- signedSessionId?: string;
213
+ signedSessionId: string;
213
214
  }): Promise<void>;
214
215
  updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId, }: {
215
216
  accountAddress: string;
216
217
  existingPassword?: string;
217
218
  newPassword?: string;
218
- signedSessionId?: string;
219
+ signedSessionId: string;
219
220
  }): Promise<void>;
220
221
  decryptKeyShare({ keyShare, password, }: {
221
222
  keyShare: string;
@@ -253,7 +254,7 @@ export declare class DynamicWalletClient {
253
254
  accountAddress: string;
254
255
  password?: string;
255
256
  walletOperation: WalletOperation;
256
- signedSessionId?: string;
257
+ signedSessionId: string;
257
258
  shareCount?: number;
258
259
  storeRecoveredShares?: boolean;
259
260
  }): Promise<any[]>;
@@ -272,7 +273,7 @@ export declare class DynamicWalletClient {
272
273
  backupKeySharesToGoogleDrive({ accountAddress, password, signedSessionId, }: {
273
274
  accountAddress: string;
274
275
  password?: string;
275
- signedSessionId?: string;
276
+ signedSessionId: string;
276
277
  }): Promise<string[]>;
277
278
  /**
278
279
  * This method handles only the Google Drive upload mechanics without any reshare logic.
@@ -290,17 +291,17 @@ export declare class DynamicWalletClient {
290
291
  restoreBackupFromGoogleDrive({ accountAddress, password, signedSessionId, }: {
291
292
  accountAddress: string;
292
293
  password?: string;
293
- signedSessionId?: string;
294
+ signedSessionId: string;
294
295
  }): Promise<ClientKeyShare[]>;
295
296
  exportClientKeyshares({ accountAddress, password, signedSessionId, }: {
296
297
  accountAddress: string;
297
298
  password?: string;
298
- signedSessionId?: string;
299
+ signedSessionId: string;
299
300
  }): Promise<void>;
300
301
  getClientKeyShares({ accountAddress, password, signedSessionId, }: {
301
302
  accountAddress: string;
302
303
  password?: string;
303
- signedSessionId?: string;
304
+ signedSessionId: string;
304
305
  }): Promise<ClientKeyShare[]>;
305
306
  /**
306
307
  * Helper function to check if the required wallet fields are present and valid
@@ -318,7 +319,7 @@ export declare class DynamicWalletClient {
318
319
  accountAddress: string;
319
320
  password?: string;
320
321
  walletOperation?: WalletOperation;
321
- signedSessionId?: string;
322
+ signedSessionId: string;
322
323
  }): Promise<void>;
323
324
  isPasswordEncrypted({ accountAddress, }: {
324
325
  accountAddress: string;
@@ -345,8 +346,13 @@ export declare class DynamicWalletClient {
345
346
  walletOperation?: WalletOperation;
346
347
  shareCount?: number;
347
348
  password?: string;
348
- signedSessionId?: string;
349
+ signedSessionId: string;
349
350
  }): Promise<WalletProperties>;
350
351
  getWallets(): Promise<any>;
352
+ /**
353
+ * sync auth token with api client
354
+ * @param authToken - auth token to sync
355
+ */
356
+ syncAuthToken(authToken: string): void;
351
357
  }
352
358
  //# sourceMappingURL=client.d.ts.map
@@ -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,EAExB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,kBAAkB,EAElB,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,iBAAiB,EAGlB,MAAM,eAAe,CAAC;AAevB,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAGL,KAAK,gBAAgB,EAEtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAWhD,qBAAa,mBAAmB;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IAEtB,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAQ;IACrE,SAAS,CAAC,MAAM,wCAAU;IAC1B,SAAS,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACtC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAM;IAC3D,SAAS,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACpC,SAAS,CAAC,aAAa,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,CAAQ;IACjE,SAAS,CAAC,kBAAkB,CAAC,EAA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E,MAAM;CAGhC"}
@@ -1,6 +1,7 @@
1
1
  export declare const ERROR_KEYGEN_FAILED = "[DynamicWaasWalletClient]: Error with keygen";
2
2
  export declare const ERROR_CREATE_WALLET_ACCOUNT = "[DynamicWaasWalletClient]: Error creating wallet account";
3
3
  export declare const ERROR_SIGN_MESSAGE = "[DynamicWaasWalletClient]: Error signing message";
4
+ export declare const ERROR_SIGN_TYPED_DATA = "[DynamicWaasWalletClient]: Error signing typed data";
4
5
  export declare const ERROR_ACCOUNT_ADDRESS_REQUIRED = "[DynamicWaasWalletClient]: Account address is required";
5
6
  export declare const ERROR_VERIFY_MESSAGE_SIGNATURE = "[DynamicWaasWalletClient]: Error verifying message signature";
6
7
  export declare const ERROR_VERIFY_TRANSACTION_SIGNATURE = "[DynamicWaasWalletClient]: Error verifying transaction signature";
@@ -1 +1 @@
1
- {"version":3,"file":"errorConstants.d.ts","sourceRoot":"","sources":["../../packages/src/errorConstants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,iDACgB,CAAC;AAEjD,eAAO,MAAM,2BAA2B,6DACoB,CAAC;AAE7D,eAAO,MAAM,kBAAkB,qDACqB,CAAC;AAErD,eAAO,MAAM,8BAA8B,2DACe,CAAC;AAE3D,eAAO,MAAM,8BAA8B,iEACqB,CAAC;AAEjE,eAAO,MAAM,kCAAkC,qEACqB,CAAC;AAErE,eAAO,MAAM,wBAAwB,2DACqB,CAAC;AAE3D,eAAO,MAAM,wBAAwB,2DACqB,CAAC"}
1
+ {"version":3,"file":"errorConstants.d.ts","sourceRoot":"","sources":["../../packages/src/errorConstants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,iDACgB,CAAC;AAEjD,eAAO,MAAM,2BAA2B,6DACoB,CAAC;AAE7D,eAAO,MAAM,kBAAkB,qDACqB,CAAC;AAErD,eAAO,MAAM,qBAAqB,wDACqB,CAAC;AAExD,eAAO,MAAM,8BAA8B,2DACe,CAAC;AAE3D,eAAO,MAAM,8BAA8B,iEACqB,CAAC;AAEjE,eAAO,MAAM,kCAAkC,qEACqB,CAAC;AAErE,eAAO,MAAM,wBAAwB,2DACqB,CAAC;AAE3D,eAAO,MAAM,wBAAwB,2DACqB,CAAC"}
package/src/index.d.ts CHANGED
@@ -4,4 +4,6 @@ export * from './types';
4
4
  export * from './mpc/index';
5
5
  export * from './utils';
6
6
  export * from './errorConstants';
7
+ import { Logger } from './services/logger';
8
+ export { Logger };
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAE1C,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAExB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAE1C,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAExB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -10,5 +10,5 @@ declare const logError: ({ message, error, context, }: {
10
10
  error: Error;
11
11
  context: Record<string, unknown>;
12
12
  }) => void;
13
- export { setLoggerContext, logError };
13
+ export { Logger, setLoggerContext, logError };
14
14
  //# sourceMappingURL=logger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/services/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAY,MAAM,sBAAsB,CAAC;AAIxD,eAAO,MAAM,MAAM,QAAwD,CAAC;AAE5E,QAAA,MAAM,gBAAgB,0CAInB;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,SAYA,CAAC;AAEF,QAAA,MAAM,QAAQ,iCAIX;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,KAAG,IAQH,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/services/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAY,MAAM,sBAAsB,CAAC;AAIxD,eAAO,MAAM,MAAM,QAAwD,CAAC;AAE5E,QAAA,MAAM,gBAAgB,0CAInB;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,SAYA,CAAC;AAEF,QAAA,MAAM,QAAQ,iCAIX;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,KAAG,IAQH,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC"}
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
- algorithm: string;
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
  };
@@ -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;AAS5C,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,sBACZ,cAAc,EAAE,gBACrB,cAAc,EAAE,KAC7B,cAAc,EAchB,CAAC;AAEF,eAAO,MAAM,cAAc,4BAGxB;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,qBAOA,CAAC;AAEF,UAAU,WAAW;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,C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