@dynamic-labs-wallet/core 0.0.88 → 0.0.90

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
@@ -2,7 +2,6 @@
2
2
 
3
3
  var axios = require('axios');
4
4
  var uuid = require('uuid');
5
- var createHttpError = require('http-errors');
6
5
 
7
6
  const DYNAMIC_AUTH_PROD_BASE_API_URL = 'https://app.dynamicauth.com';
8
7
  const DYNAMIC_AUTH_PREPROD_BASE_API_URL = 'https://app.dynamic-preprod.xyz';
@@ -458,24 +457,6 @@ var SuccessEventType = /*#__PURE__*/ function(SuccessEventType) {
458
457
  }({});
459
458
  // iframe communication types end
460
459
 
461
- const handleAxiosError = (error)=>{
462
- var _error_response;
463
- switch((_error_response = error.response) == null ? void 0 : _error_response.status){
464
- case 400:
465
- throw createHttpError(400, 'Invalid request');
466
- case 401:
467
- throw createHttpError(401, 'Authorization header or cookie is required');
468
- case 403:
469
- throw createHttpError(403, 'Forbidden');
470
- case 422:
471
- throw createHttpError(422, 'Unprocessable content');
472
- case 500:
473
- throw createHttpError(500, 'Internal server error');
474
- default:
475
- throw createHttpError(500, 'Internal server error');
476
- }
477
- };
478
-
479
460
  /**
480
461
  * Creates a promise that resolves when a specific event is received from an event stream.
481
462
  * Adds a timeout to prevent hanging and races the two promises.
@@ -548,9 +529,6 @@ const handleAxiosError = (error)=>{
548
529
  }
549
530
  if (event.type === 'error') {
550
531
  const error = createErrorFromEventData(event.data);
551
- if (error instanceof axios.AxiosError) {
552
- handleAxiosError(error);
553
- }
554
532
  reject(error);
555
533
  onError == null ? void 0 : onError(error);
556
534
  }
@@ -794,10 +772,6 @@ class DynamicApiClient extends BaseClient {
794
772
  }
795
773
  }
796
774
 
797
- Object.defineProperty(exports, "AxiosError", {
798
- enumerable: true,
799
- get: function () { return axios.AxiosError; }
800
- });
801
775
  exports.BITCOIN_DERIVATION_PATHS = BITCOIN_DERIVATION_PATHS;
802
776
  exports.BackupLocation = BackupLocation;
803
777
  exports.ChainEnumToVerifiedCredentialName = ChainEnumToVerifiedCredentialName;
@@ -835,4 +809,3 @@ exports.getMPCChainConfig = getMPCChainConfig;
835
809
  exports.getReshareConfig = getReshareConfig;
836
810
  exports.getServerWalletReshareConfig = getServerWalletReshareConfig;
837
811
  exports.getTSSConfig = getTSSConfig;
838
- exports.handleAxiosError = handleAxiosError;
package/index.esm.js CHANGED
@@ -1,7 +1,5 @@
1
- import axios, { AxiosError } from 'axios';
2
- export { AxiosError } from 'axios';
1
+ import axios from 'axios';
3
2
  import { v4 } from 'uuid';
4
- import createHttpError from 'http-errors';
5
3
 
6
4
  const DYNAMIC_AUTH_PROD_BASE_API_URL = 'https://app.dynamicauth.com';
7
5
  const DYNAMIC_AUTH_PREPROD_BASE_API_URL = 'https://app.dynamic-preprod.xyz';
@@ -457,24 +455,6 @@ var SuccessEventType = /*#__PURE__*/ function(SuccessEventType) {
457
455
  }({});
458
456
  // iframe communication types end
459
457
 
460
- const handleAxiosError = (error)=>{
461
- var _error_response;
462
- switch((_error_response = error.response) == null ? void 0 : _error_response.status){
463
- case 400:
464
- throw createHttpError(400, 'Invalid request');
465
- case 401:
466
- throw createHttpError(401, 'Authorization header or cookie is required');
467
- case 403:
468
- throw createHttpError(403, 'Forbidden');
469
- case 422:
470
- throw createHttpError(422, 'Unprocessable content');
471
- case 500:
472
- throw createHttpError(500, 'Internal server error');
473
- default:
474
- throw createHttpError(500, 'Internal server error');
475
- }
476
- };
477
-
478
458
  /**
479
459
  * Creates a promise that resolves when a specific event is received from an event stream.
480
460
  * Adds a timeout to prevent hanging and races the two promises.
@@ -547,9 +527,6 @@ const handleAxiosError = (error)=>{
547
527
  }
548
528
  if (event.type === 'error') {
549
529
  const error = createErrorFromEventData(event.data);
550
- if (error instanceof AxiosError) {
551
- handleAxiosError(error);
552
- }
553
530
  reject(error);
554
531
  onError == null ? void 0 : onError(error);
555
532
  }
@@ -793,4 +770,4 @@ class DynamicApiClient extends BaseClient {
793
770
  }
794
771
  }
795
772
 
796
- export { BITCOIN_DERIVATION_PATHS, BackupLocation, ChainEnumToVerifiedCredentialName, CreateRoomPartiesOptions, DYNAMIC_AUTH_BASE_API_URL_MAP, DYNAMIC_AUTH_DEV_BASE_API_URL, DYNAMIC_AUTH_PREPROD_BASE_API_URL, DYNAMIC_AUTH_PROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_DEV_BASE_API_URL, DYNAMIC_CLIENT_RELAY_MAP, DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_PROD_BASE_API_URL, DynamicApiClient, DynamicClientSessionSignature, DynamicRequestIdHeader, ENVIRONMENT_ENUM, IFRAME_DOMAIN_MAP, MPC_CHAIN_CONFIG, MPC_CONFIG, MPC_RELAY_DEV_API_URL, MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, SOLANA_RPC_URL, SigningAlgorithm, SuccessEventType, ThresholdSignatureScheme, URL_PATTERNS, VerifiedCredentialNameToChainEnum, WalletOperation, chain, getClientThreshold, getDynamicServerThreshold, getEnvironmentFromUrl, getMPCChainConfig, getReshareConfig, getServerWalletReshareConfig, getTSSConfig, handleAxiosError };
773
+ export { BITCOIN_DERIVATION_PATHS, BackupLocation, ChainEnumToVerifiedCredentialName, CreateRoomPartiesOptions, DYNAMIC_AUTH_BASE_API_URL_MAP, DYNAMIC_AUTH_DEV_BASE_API_URL, DYNAMIC_AUTH_PREPROD_BASE_API_URL, DYNAMIC_AUTH_PROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_DEV_BASE_API_URL, DYNAMIC_CLIENT_RELAY_MAP, DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_PROD_BASE_API_URL, DynamicApiClient, DynamicClientSessionSignature, DynamicRequestIdHeader, ENVIRONMENT_ENUM, IFRAME_DOMAIN_MAP, MPC_CHAIN_CONFIG, MPC_CONFIG, MPC_RELAY_DEV_API_URL, MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, SOLANA_RPC_URL, SigningAlgorithm, SuccessEventType, ThresholdSignatureScheme, URL_PATTERNS, VerifiedCredentialNameToChainEnum, WalletOperation, chain, getClientThreshold, getDynamicServerThreshold, getEnvironmentFromUrl, getMPCChainConfig, getReshareConfig, getServerWalletReshareConfig, getTSSConfig };
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/core",
3
- "version": "0.0.88",
3
+ "version": "0.0.90",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "axios": "1.9.0",
7
- "http-errors": "2.0.0",
8
7
  "uuid": "11.1.0"
9
8
  },
10
9
  "files": [
@@ -30,8 +29,5 @@
30
29
  "require": "./index.cjs.js",
31
30
  "default": "./index.cjs.js"
32
31
  }
33
- },
34
- "devDependencies": {
35
- "@types/http-errors": "^2.0.0"
36
32
  }
37
33
  }
@@ -1,3 +1,2 @@
1
1
  export * from './api';
2
- export * from './axiosErrorResponse';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/eventStream/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI5C;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GAAI,CAAC,4GASvC;IACD,SAAS,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;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AS,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC1C,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,kBAAkB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzE,KAAG,OAAO,CAAC,CAAC,CAiCZ,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oCAAoC,GAAI,CAAC,uEAMnD;IACD,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC3B,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,kBAAkB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzE,gBACmB;IAChB,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM;YACf,IAAI,EAAE,MAAM,OAAO,CAAC;gBAAE,KAAK,EAAE,UAAU,CAAC;gBAAC,IAAI,EAAE,OAAO,CAAA;aAAE,CAAC,CAAC;SAC3D,CAAC;KACH,CAAC;CACH,SAyCF,CAAC"}
@@ -1,4 +0,0 @@
1
- import { AxiosError } from 'axios';
2
- export declare const handleAxiosError: (error: AxiosError) => never;
3
- export { AxiosError };
4
- //# sourceMappingURL=axiosErrorResponse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"axiosErrorResponse.d.ts","sourceRoot":"","sources":["../../src/api/axiosErrorResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,eAAO,MAAM,gBAAgB,UAAW,UAAU,UAejD,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}