@dynamic-labs-wallet/browser 0.0.158 → 0.0.160

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
@@ -65,7 +65,7 @@ const AES_GCM_LENGTH = 256;
65
65
  * taking into account that this runs in the client, possibly in smartphones with limited resources
66
66
  */ const ARGON2_MEMORY_SIZE = 65536; // 64 MB in KiB
67
67
  const ARGON2_ITERATIONS = 3;
68
- const ARGON2_PARALLELISM = 2;
68
+ const ARGON2_PARALLELISM = 1;
69
69
  const ARGON2_HASH_LENGTH = 32;
70
70
  /**
71
71
  * PBKDF2 configuration constants
@@ -231,7 +231,8 @@ const ensureBase64Padding = (str)=>{
231
231
  version
232
232
  };
233
233
  } catch (error) {
234
- throw new Error('Error encrypting data');
234
+ const errorMessage = error instanceof Error ? error.message : String(error);
235
+ throw new Error(`Error encrypting data: ${errorMessage} (version: ${version})`);
235
236
  }
236
237
  };
237
238
  /**
@@ -381,13 +382,14 @@ const downloadFileFromGoogleDrive = async ({ accessToken, fileName })=>{
381
382
  };
382
383
 
383
384
  const handleAxiosError = (error, message, context)=>{
384
- var _error_response, _error_response1;
385
- logger.debug("[DynamicWaasWalletClient] Axios error: " + message, {
386
- error: (_error_response = error.response) == null ? void 0 : _error_response.status,
387
- message: error.message,
385
+ var _error_response, _error_response1, _error_response2;
386
+ logger.warn('[DynamicWaasWalletClient] Axios error: ', {
387
+ message,
388
+ error: (_error_response = error.response) == null ? void 0 : _error_response.data,
389
+ status: (_error_response1 = error.response) == null ? void 0 : _error_response1.status,
388
390
  context
389
391
  });
390
- switch((_error_response1 = error.response) == null ? void 0 : _error_response1.status){
392
+ switch((_error_response2 = error.response) == null ? void 0 : _error_response2.status){
391
393
  case 400:
392
394
  throw createHttpError(400, 'Invalid request');
393
395
  case 401:
@@ -503,10 +505,17 @@ const timeoutPromise = ({ timeInMs, activity = 'Ceremony' })=>{
503
505
  try {
504
506
  return await operation();
505
507
  } catch (error) {
508
+ var _error_response;
506
509
  attempts++;
510
+ logger.warn(`Failed to execute ${operationName} on attempt ${attempts}`, _extends({}, logContext, {
511
+ error: error instanceof Error ? error.message : 'Unknown error',
512
+ axiosError: error instanceof axios.AxiosError ? (_error_response = error.response) == null ? void 0 : _error_response.data : undefined
513
+ }));
507
514
  if (attempts === maxAttempts) {
515
+ var _error_response1;
508
516
  logger.error(`Failed to execute ${operationName} after ${maxAttempts} attempts`, _extends({}, logContext, {
509
- error: error instanceof Error ? error.message : 'Unknown error'
517
+ error: error instanceof Error ? error.message : 'Unknown error',
518
+ axiosError: error instanceof axios.AxiosError ? (_error_response1 = error.response) == null ? void 0 : _error_response1.data : undefined
510
519
  }));
511
520
  throw error;
512
521
  }
package/index.esm.js CHANGED
@@ -66,7 +66,7 @@ const AES_GCM_LENGTH = 256;
66
66
  * taking into account that this runs in the client, possibly in smartphones with limited resources
67
67
  */ const ARGON2_MEMORY_SIZE = 65536; // 64 MB in KiB
68
68
  const ARGON2_ITERATIONS = 3;
69
- const ARGON2_PARALLELISM = 2;
69
+ const ARGON2_PARALLELISM = 1;
70
70
  const ARGON2_HASH_LENGTH = 32;
71
71
  /**
72
72
  * PBKDF2 configuration constants
@@ -232,7 +232,8 @@ const ensureBase64Padding = (str)=>{
232
232
  version
233
233
  };
234
234
  } catch (error) {
235
- throw new Error('Error encrypting data');
235
+ const errorMessage = error instanceof Error ? error.message : String(error);
236
+ throw new Error(`Error encrypting data: ${errorMessage} (version: ${version})`);
236
237
  }
237
238
  };
238
239
  /**
@@ -382,13 +383,14 @@ const downloadFileFromGoogleDrive = async ({ accessToken, fileName })=>{
382
383
  };
383
384
 
384
385
  const handleAxiosError = (error, message, context)=>{
385
- var _error_response, _error_response1;
386
- logger.debug("[DynamicWaasWalletClient] Axios error: " + message, {
387
- error: (_error_response = error.response) == null ? void 0 : _error_response.status,
388
- message: error.message,
386
+ var _error_response, _error_response1, _error_response2;
387
+ logger.warn('[DynamicWaasWalletClient] Axios error: ', {
388
+ message,
389
+ error: (_error_response = error.response) == null ? void 0 : _error_response.data,
390
+ status: (_error_response1 = error.response) == null ? void 0 : _error_response1.status,
389
391
  context
390
392
  });
391
- switch((_error_response1 = error.response) == null ? void 0 : _error_response1.status){
393
+ switch((_error_response2 = error.response) == null ? void 0 : _error_response2.status){
392
394
  case 400:
393
395
  throw createHttpError(400, 'Invalid request');
394
396
  case 401:
@@ -504,10 +506,17 @@ const timeoutPromise = ({ timeInMs, activity = 'Ceremony' })=>{
504
506
  try {
505
507
  return await operation();
506
508
  } catch (error) {
509
+ var _error_response;
507
510
  attempts++;
511
+ logger.warn(`Failed to execute ${operationName} on attempt ${attempts}`, _extends({}, logContext, {
512
+ error: error instanceof Error ? error.message : 'Unknown error',
513
+ axiosError: error instanceof AxiosError ? (_error_response = error.response) == null ? void 0 : _error_response.data : undefined
514
+ }));
508
515
  if (attempts === maxAttempts) {
516
+ var _error_response1;
509
517
  logger.error(`Failed to execute ${operationName} after ${maxAttempts} attempts`, _extends({}, logContext, {
510
- error: error instanceof Error ? error.message : 'Unknown error'
518
+ error: error instanceof Error ? error.message : 'Unknown error',
519
+ axiosError: error instanceof AxiosError ? (_error_response1 = error.response) == null ? void 0 : _error_response1.data : undefined
511
520
  }));
512
521
  throw error;
513
522
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/browser",
3
- "version": "0.0.158",
3
+ "version": "0.0.160",
4
4
  "license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
5
5
  "type": "commonjs",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/core": "0.0.158",
7
+ "@dynamic-labs-wallet/core": "0.0.160",
8
8
  "@dynamic-labs/logger": "^4.25.3",
9
9
  "@dynamic-labs/sdk-api-core": "^0.0.764",
10
10
  "argon2id": "1.0.1",
@@ -25,7 +25,7 @@ export declare const AES_GCM_LENGTH = 256;
25
25
  */
26
26
  export declare const ARGON2_MEMORY_SIZE = 65536;
27
27
  export declare const ARGON2_ITERATIONS = 3;
28
- export declare const ARGON2_PARALLELISM = 2;
28
+ export declare const ARGON2_PARALLELISM = 1;
29
29
  export declare const ARGON2_HASH_LENGTH = 32;
30
30
  /**
31
31
  * PBKDF2 configuration constants
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/backup/encryption/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAU/D,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EAEd,MAAM,SAAS,CAAC;AAkBjB;;;GAGG;AACH,eAAO,MAAM,WAAW,iCAIrB;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,OAAO,CAAC,aAAa,CA8BxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,wBAGrB;IACD,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,KAAG,OAAO,CAAC,MAAM,CA4BjB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,YACjC,MAAM,KACd,kBAmBF,CAAC"}
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/backup/encryption/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAU/D,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EAEd,MAAM,SAAS,CAAC;AAkBjB;;;GAGG;AACH,eAAO,MAAM,WAAW,iCAIrB;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,OAAO,CAAC,aAAa,CAiCxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,wBAGrB;IACD,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,KAAG,OAAO,CAAC,MAAM,CA4BjB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,YACjC,MAAM,KACd,kBAmBF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"axiosErrorResponse.d.ts","sourceRoot":"","sources":["../../src/services/axiosErrorResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,eAAO,MAAM,gBAAgB,UAAW,UAAU,WAAW,MAAM,WAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAoBpG,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"axiosErrorResponse.d.ts","sourceRoot":"","sources":["../../src/services/axiosErrorResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,eAAO,MAAM,gBAAgB,UACpB,UAAU,WACR,MAAM,WACN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAsBjC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,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;AAI5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,eAAO,MAAM,SAAS,eAAsC,CAAC;AAE7D,eAAO,MAAM,+BAA+B,kDAGzC;IACD,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,cAAc,EAAE,M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