@dynamic-labs-wallet/browser 0.0.157 → 0.0.159

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
@@ -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
@@ -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
  }
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.BIP340=exports.Sr25519=exports.ExportableEd25519=exports.Ed25519=exports.Ecdsa=exports.MessageHash=exports.BIP340KeygenResult=exports.BIP340InitKeygenResult=exports.Sr25519KeygenResult=exports.Sr25519InitKeygenResult=exports.ExportableEd25519KeygenResult=exports.ExportableEd25519InitKeygenResult=exports.Ed25519KeygenResult=exports.Ed25519InitKeygenResult=exports.EcdsaSignature=exports.EcdsaPublicKey=exports.EcdsaKeygenResult=exports.EcdsaInitKeygenResult=void 0;let types_1=require("./types"),ecdsa_1=(Object.defineProperty(exports,"EcdsaInitKeygenResult",{enumerable:!0,get:function(){return types_1.EcdsaInitKeygenResult}}),Object.defineProperty(exports,"EcdsaKeygenResult",{enumerable:!0,get:function(){return types_1.EcdsaKeygenResult}}),Object.defineProperty(exports,"EcdsaPublicKey",{enumerable:!0,get:function(){return types_1.EcdsaPublicKey}}),Object.defineProperty(exports,"EcdsaSignature",{enumerable:!0,get:function(){return types_1.EcdsaSignature}}),Object.defineProperty(exports,"Ed25519InitKeygenResult",{enumerable:!0,get:function(){return types_1.Ed25519InitKeygenResult}}),Object.defineProperty(exports,"Ed25519KeygenResult",{enumerable:!0,get:function(){return types_1.Ed25519KeygenResult}}),Object.defineProperty(exports,"ExportableEd25519InitKeygenResult",{enumerable:!0,get:function(){return types_1.ExportableEd25519InitKeygenResult}}),Object.defineProperty(exports,"ExportableEd25519KeygenResult",{enumerable:!0,get:function(){return types_1.ExportableEd25519KeygenResult}}),Object.defineProperty(exports,"Sr25519InitKeygenResult",{enumerable:!0,get:function(){return types_1.Sr25519InitKeygenResult}}),Object.defineProperty(exports,"Sr25519KeygenResult",{enumerable:!0,get:function(){return types_1.Sr25519KeygenResult}}),Object.defineProperty(exports,"BIP340InitKeygenResult",{enumerable:!0,get:function(){return types_1.BIP340InitKeygenResult}}),Object.defineProperty(exports,"BIP340KeygenResult",{enumerable:!0,get:function(){return types_1.BIP340KeygenResult}}),Object.defineProperty(exports,"MessageHash",{enumerable:!0,get:function(){return types_1.MessageHash}}),require("./ecdsa")),ed25519_1=(Object.defineProperty(exports,"Ecdsa",{enumerable:!0,get:function(){return ecdsa_1.Ecdsa}}),require("./ed25519")),ed25519_exportable_1=(Object.defineProperty(exports,"Ed25519",{enumerable:!0,get:function(){return ed25519_1.Ed25519}}),require("./ed25519_exportable")),sr25519_1=(Object.defineProperty(exports,"ExportableEd25519",{enumerable:!0,get:function(){return ed25519_exportable_1.ExportableEd25519}}),require("./sr25519")),bip340_1=(Object.defineProperty(exports,"Sr25519",{enumerable:!0,get:function(){return sr25519_1.Sr25519}}),require("./bip340"));Object.defineProperty(exports,"BIP340",{enumerable:!0,get:function(){return bip340_1.BIP340}});
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.BIP340=exports.Sr25519=exports.ExportableEd25519=exports.Ed25519=exports.Ecdsa=exports.MessageHash=exports.BIP340KeygenResult=exports.BIP340InitKeygenResult=exports.Sr25519KeygenResult=exports.Sr25519InitKeygenResult=exports.ExportableEd25519KeygenResult=exports.ExportableEd25519InitKeygenResult=exports.Ed25519KeygenResult=exports.Ed25519InitKeygenResult=exports.EcdsaSignature=exports.EcdsaPublicKey=exports.EcdsaKeygenResult=exports.EcdsaInitKeygenResult=void 0;let types_1=require("./types"),ecdsa_1=(Object.defineProperty(exports,"EcdsaInitKeygenResult",{value:types_1.EcdsaInitKeygenResult}),Object.defineProperty(exports,"EcdsaKeygenResult",{value:types_1.EcdsaKeygenResult}),Object.defineProperty(exports,"EcdsaPublicKey",{value:types_1.EcdsaPublicKey}),Object.defineProperty(exports,"EcdsaSignature",{value:types_1.EcdsaSignature}),Object.defineProperty(exports,"Ed25519InitKeygenResult",{value:types_1.Ed25519InitKeygenResult}),Object.defineProperty(exports,"Ed25519KeygenResult",{value:types_1.Ed25519KeygenResult}),Object.defineProperty(exports,"ExportableEd25519InitKeygenResult",{value:types_1.ExportableEd25519InitKeygenResult}),Object.defineProperty(exports,"ExportableEd25519KeygenResult",{value:types_1.ExportableEd25519KeygenResult}),Object.defineProperty(exports,"Sr25519InitKeygenResult",{value:types_1.Sr25519InitKeygenResult}),Object.defineProperty(exports,"Sr25519KeygenResult",{value:types_1.Sr25519KeygenResult}),Object.defineProperty(exports,"BIP340InitKeygenResult",{value:types_1.BIP340InitKeygenResult}),Object.defineProperty(exports,"BIP340KeygenResult",{value:types_1.BIP340KeygenResult}),Object.defineProperty(exports,"MessageHash",{value:types_1.MessageHash}),require("./ecdsa")),ed25519_1=(Object.defineProperty(exports,"Ecdsa",{value:ecdsa_1.Ecdsa}),require("./ed25519")),ed25519_exportable_1=(Object.defineProperty(exports,"Ed25519",{value:ed25519_1.Ed25519}),require("./ed25519_exportable")),sr25519_1=(Object.defineProperty(exports,"ExportableEd25519",{value:ed25519_exportable_1.ExportableEd25519}),require("./sr25519")),bip340_1=(Object.defineProperty(exports,"Sr25519",{value:sr25519_1.Sr25519}),require("./bip340"));Object.defineProperty(exports,"BIP340",{value:bip340_1.BIP340});
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/browser",
3
- "version": "0.0.157",
3
+ "version": "0.0.159",
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.157",
7
+ "@dynamic-labs-wallet/core": "0.0.159",
8
8
  "@dynamic-labs/logger": "^4.25.3",
9
9
  "@dynamic-labs/sdk-api-core": "^0.0.764",
10
10
  "argon2id": "1.0.1",
@@ -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,MAAM,CAAC;CACxB,WAEA,CAAC;AAEF,eAAO,MAAM,2BAA2B,YAAa;IACnD,gBAAgB,EAAE,oBAAoB,CAAC;CACxC,KAAG,kBA2CH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAA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