@dynamic-labs-wallet/browser 0.0.276 → 0.0.277
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 +10 -15
- package/index.esm.js +11 -16
- package/package.json +2 -4
- package/src/services/axiosErrorResponse.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -8,7 +8,6 @@ var logger$1 = require('@dynamic-labs/logger');
|
|
|
8
8
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
9
9
|
var loadArgon2idWasm = require('argon2id');
|
|
10
10
|
var axios = require('axios');
|
|
11
|
-
var createHttpError = require('http-errors');
|
|
12
11
|
var PQueue = require('p-queue');
|
|
13
12
|
|
|
14
13
|
function _extends() {
|
|
@@ -443,6 +442,13 @@ const downloadFileFromGoogleDrive = async ({ accessToken, fileName })=>{
|
|
|
443
442
|
}
|
|
444
443
|
};
|
|
445
444
|
|
|
445
|
+
const STATUS_MESSAGES = {
|
|
446
|
+
400: 'Invalid request',
|
|
447
|
+
401: 'Authorization header or cookie is required',
|
|
448
|
+
403: 'Forbidden',
|
|
449
|
+
422: 'Unprocessable content',
|
|
450
|
+
500: 'Internal server error'
|
|
451
|
+
};
|
|
446
452
|
const handleAxiosError = (error, message, context)=>{
|
|
447
453
|
var _error_response, _error_response1, _error_response2;
|
|
448
454
|
logger.error('[DynamicWaasWalletClient] Axios error: ', {
|
|
@@ -451,20 +457,9 @@ const handleAxiosError = (error, message, context)=>{
|
|
|
451
457
|
status: (_error_response1 = error.response) == null ? void 0 : _error_response1.status,
|
|
452
458
|
context
|
|
453
459
|
});
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
case 401:
|
|
458
|
-
throw createHttpError(401, 'Authorization header or cookie is required');
|
|
459
|
-
case 403:
|
|
460
|
-
throw createHttpError(403, 'Forbidden');
|
|
461
|
-
case 422:
|
|
462
|
-
throw createHttpError(422, 'Unprocessable content');
|
|
463
|
-
case 500:
|
|
464
|
-
throw createHttpError(500, 'Internal server error');
|
|
465
|
-
default:
|
|
466
|
-
throw createHttpError(500, 'Internal server error');
|
|
467
|
-
}
|
|
460
|
+
const status = (_error_response2 = error.response) == null ? void 0 : _error_response2.status;
|
|
461
|
+
const resolvedStatus = status && STATUS_MESSAGES[status] ? status : 500;
|
|
462
|
+
throw new core.WalletApiError(resolvedStatus, STATUS_MESSAGES[resolvedStatus]);
|
|
468
463
|
};
|
|
469
464
|
|
|
470
465
|
const logger = new logger$1.Logger('DynamicWaasWalletClient', logger$1.LogLevel.DEBUG);
|
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BitcoinAddressType, SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, AuthMode, BackupLocation, ENCRYPTED_SHARES_STORAGE_SUFFIX, WalletOperation, WalletReadyState, parseNamespacedVersion, FEATURE_FLAGS, ThresholdSignatureScheme, getClientThreshold, MPC_CONFIG, getTSSConfig, serializeMessageForForwardMPC, getReshareConfig, verifiedCredentialNameToChainEnum, DynamicApiClient, getEnvironmentFromUrl, IFRAME_DOMAIN_MAP } from '@dynamic-labs-wallet/core';
|
|
1
|
+
import { BitcoinAddressType, SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, WalletApiError, AuthMode, BackupLocation, ENCRYPTED_SHARES_STORAGE_SUFFIX, WalletOperation, WalletReadyState, parseNamespacedVersion, FEATURE_FLAGS, ThresholdSignatureScheme, getClientThreshold, MPC_CONFIG, getTSSConfig, serializeMessageForForwardMPC, getReshareConfig, verifiedCredentialNameToChainEnum, DynamicApiClient, getEnvironmentFromUrl, IFRAME_DOMAIN_MAP } from '@dynamic-labs-wallet/core';
|
|
2
2
|
export * from '@dynamic-labs-wallet/core';
|
|
3
3
|
import { BIP340, ExportableEd25519, Ecdsa, MessageHash, EcdsaSignature, EcdsaKeygenResult, ExportableEd25519KeygenResult, BIP340KeygenResult } from '#internal/web';
|
|
4
4
|
export { BIP340, BIP340InitKeygenResult, BIP340KeygenResult, Ecdsa, EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519, Ed25519InitKeygenResult, Ed25519KeygenResult, MessageHash } from '#internal/web';
|
|
@@ -9,7 +9,6 @@ export { Logger } from '@dynamic-labs/logger';
|
|
|
9
9
|
import { ProviderEnum, RoomTypeEnum } from '@dynamic-labs/sdk-api-core';
|
|
10
10
|
import loadArgon2idWasm from 'argon2id';
|
|
11
11
|
import { AxiosError } from 'axios';
|
|
12
|
-
import createHttpError from 'http-errors';
|
|
13
12
|
import PQueue from 'p-queue';
|
|
14
13
|
|
|
15
14
|
function _extends() {
|
|
@@ -444,6 +443,13 @@ const downloadFileFromGoogleDrive = async ({ accessToken, fileName })=>{
|
|
|
444
443
|
}
|
|
445
444
|
};
|
|
446
445
|
|
|
446
|
+
const STATUS_MESSAGES = {
|
|
447
|
+
400: 'Invalid request',
|
|
448
|
+
401: 'Authorization header or cookie is required',
|
|
449
|
+
403: 'Forbidden',
|
|
450
|
+
422: 'Unprocessable content',
|
|
451
|
+
500: 'Internal server error'
|
|
452
|
+
};
|
|
447
453
|
const handleAxiosError = (error, message, context)=>{
|
|
448
454
|
var _error_response, _error_response1, _error_response2;
|
|
449
455
|
logger.error('[DynamicWaasWalletClient] Axios error: ', {
|
|
@@ -452,20 +458,9 @@ const handleAxiosError = (error, message, context)=>{
|
|
|
452
458
|
status: (_error_response1 = error.response) == null ? void 0 : _error_response1.status,
|
|
453
459
|
context
|
|
454
460
|
});
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
case 401:
|
|
459
|
-
throw createHttpError(401, 'Authorization header or cookie is required');
|
|
460
|
-
case 403:
|
|
461
|
-
throw createHttpError(403, 'Forbidden');
|
|
462
|
-
case 422:
|
|
463
|
-
throw createHttpError(422, 'Unprocessable content');
|
|
464
|
-
case 500:
|
|
465
|
-
throw createHttpError(500, 'Internal server error');
|
|
466
|
-
default:
|
|
467
|
-
throw createHttpError(500, 'Internal server error');
|
|
468
|
-
}
|
|
461
|
+
const status = (_error_response2 = error.response) == null ? void 0 : _error_response2.status;
|
|
462
|
+
const resolvedStatus = status && STATUS_MESSAGES[status] ? status : 500;
|
|
463
|
+
throw new WalletApiError(resolvedStatus, STATUS_MESSAGES[resolvedStatus]);
|
|
469
464
|
};
|
|
470
465
|
|
|
471
466
|
const logger = new Logger('DynamicWaasWalletClient', LogLevel.DEBUG);
|
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.277",
|
|
4
4
|
"license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/core": "0.0.
|
|
7
|
+
"@dynamic-labs-wallet/core": "0.0.277",
|
|
8
8
|
"@dynamic-labs/logger": "^4.25.3",
|
|
9
9
|
"@dynamic-labs/sdk-api-core": "^0.0.875",
|
|
10
10
|
"argon2id": "1.0.1",
|
|
11
11
|
"axios": "1.13.5",
|
|
12
|
-
"http-errors": "2.0.0",
|
|
13
12
|
"p-queue": "9.1.0",
|
|
14
13
|
"semver": "^7.6.3",
|
|
15
14
|
"tsl-apple-cloudkit": "0.2.34",
|
|
@@ -50,7 +49,6 @@
|
|
|
50
49
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
51
50
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
52
51
|
"@rollup/plugin-wasm": "^6.2.2",
|
|
53
|
-
"@types/http-errors": "^2.0.0",
|
|
54
52
|
"@types/semver": "^7.5.8",
|
|
55
53
|
"tsl-apple-cloudkit": "^0.2.11"
|
|
56
54
|
}
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"axiosErrorResponse.d.ts","sourceRoot":"","sources":["../../src/services/axiosErrorResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAYnC,eAAO,MAAM,gBAAgB,UACpB,UAAU,WACR,MAAM,WACN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAYjC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|