@dynamic-labs-wallet/core 1.0.9 → 1.0.11
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
CHANGED
|
@@ -901,7 +901,7 @@ const getRequiredExternalKeyShareId = (ks)=>{
|
|
|
901
901
|
* before it is posted and surfaces in Datadog exactly as the recovery path does.
|
|
902
902
|
*/ const assertDynamicLocationsHaveExternalKeyShareId = (locations)=>locations.filter((location)=>location.location === BackupLocation.DYNAMIC).forEach((location)=>getRequiredExternalKeyShareId(location));
|
|
903
903
|
|
|
904
|
-
var version = "1.0.
|
|
904
|
+
var version = "1.0.11";
|
|
905
905
|
|
|
906
906
|
class BaseClient {
|
|
907
907
|
get forwardMPCClient() {
|
|
@@ -1795,13 +1795,8 @@ const STATUS_MESSAGES = {
|
|
|
1795
1795
|
429: 'Rate limited',
|
|
1796
1796
|
500: 'Internal server error'
|
|
1797
1797
|
};
|
|
1798
|
-
const isCloudflareRateLimitError = (error)=>{
|
|
1799
|
-
var _error_response, _error_response1;
|
|
1800
|
-
const data = (_error_response = error.response) == null ? void 0 : _error_response.data;
|
|
1801
|
-
return ((_error_response1 = error.response) == null ? void 0 : _error_response1.status) === 429 && (data == null ? void 0 : data['cloudflare_error']) === true;
|
|
1802
|
-
};
|
|
1803
1798
|
const handleAxiosError = (error, message, context, _logger)=>{
|
|
1804
|
-
var _error_config, _error_config1, _error_response, _error_response1, _error_response2;
|
|
1799
|
+
var _error_config, _error_config1, _error_response, _error_response1, _error_response2, _error_response3;
|
|
1805
1800
|
const requestUrl = (_error_config = error.config) == null ? void 0 : _error_config.url;
|
|
1806
1801
|
const requestBaseUrl = (_error_config1 = error.config) == null ? void 0 : _error_config1.baseURL;
|
|
1807
1802
|
const logPayload = _extends({
|
|
@@ -1815,9 +1810,13 @@ const handleAxiosError = (error, message, context, _logger)=>{
|
|
|
1815
1810
|
}, {
|
|
1816
1811
|
context
|
|
1817
1812
|
});
|
|
1818
|
-
|
|
1813
|
+
// A 429 (Too Many Requests) is a transient rate-limit signal, not a code or
|
|
1814
|
+
// logic failure. Log it as a warning so it doesn't pollute error dashboards
|
|
1815
|
+
// or trigger PagerDuty alerts. This covers both Cloudflare WAF 429s and
|
|
1816
|
+
// application-level rate limiting.
|
|
1817
|
+
const logLevel = ((_error_response2 = error.response) == null ? void 0 : _error_response2.status) === 429 ? 'warn' : 'error';
|
|
1819
1818
|
Logger[logLevel]('[DynamicWaasWalletClient] Axios error: ', logPayload);
|
|
1820
|
-
const status = (
|
|
1819
|
+
const status = (_error_response3 = error.response) == null ? void 0 : _error_response3.status;
|
|
1821
1820
|
const resolvedStatus = status && STATUS_MESSAGES[status] ? status : 500;
|
|
1822
1821
|
throw new WalletApiError(resolvedStatus, STATUS_MESSAGES[resolvedStatus]);
|
|
1823
1822
|
};
|
|
@@ -1918,7 +1917,6 @@ exports.getTSSConfig = getTSSConfig;
|
|
|
1918
1917
|
exports.getVersionNamespace = getVersionNamespace;
|
|
1919
1918
|
exports.getVersionWithoutNamespace = getVersionWithoutNamespace;
|
|
1920
1919
|
exports.handleAxiosError = handleAxiosError;
|
|
1921
|
-
exports.isCloudflareRateLimitError = isCloudflareRateLimitError;
|
|
1922
1920
|
exports.isEvmCompatibleChain = isEvmCompatibleChain;
|
|
1923
1921
|
exports.parseNamespacedVersion = parseNamespacedVersion;
|
|
1924
1922
|
exports.serializeMessageForForwardMPC = serializeMessageForForwardMPC;
|
package/index.esm.js
CHANGED
|
@@ -901,7 +901,7 @@ const getRequiredExternalKeyShareId = (ks)=>{
|
|
|
901
901
|
* before it is posted and surfaces in Datadog exactly as the recovery path does.
|
|
902
902
|
*/ const assertDynamicLocationsHaveExternalKeyShareId = (locations)=>locations.filter((location)=>location.location === BackupLocation.DYNAMIC).forEach((location)=>getRequiredExternalKeyShareId(location));
|
|
903
903
|
|
|
904
|
-
var version = "1.0.
|
|
904
|
+
var version = "1.0.11";
|
|
905
905
|
|
|
906
906
|
class BaseClient {
|
|
907
907
|
get forwardMPCClient() {
|
|
@@ -1795,13 +1795,8 @@ const STATUS_MESSAGES = {
|
|
|
1795
1795
|
429: 'Rate limited',
|
|
1796
1796
|
500: 'Internal server error'
|
|
1797
1797
|
};
|
|
1798
|
-
const isCloudflareRateLimitError = (error)=>{
|
|
1799
|
-
var _error_response, _error_response1;
|
|
1800
|
-
const data = (_error_response = error.response) == null ? void 0 : _error_response.data;
|
|
1801
|
-
return ((_error_response1 = error.response) == null ? void 0 : _error_response1.status) === 429 && (data == null ? void 0 : data['cloudflare_error']) === true;
|
|
1802
|
-
};
|
|
1803
1798
|
const handleAxiosError = (error, message, context, _logger)=>{
|
|
1804
|
-
var _error_config, _error_config1, _error_response, _error_response1, _error_response2;
|
|
1799
|
+
var _error_config, _error_config1, _error_response, _error_response1, _error_response2, _error_response3;
|
|
1805
1800
|
const requestUrl = (_error_config = error.config) == null ? void 0 : _error_config.url;
|
|
1806
1801
|
const requestBaseUrl = (_error_config1 = error.config) == null ? void 0 : _error_config1.baseURL;
|
|
1807
1802
|
const logPayload = _extends({
|
|
@@ -1815,11 +1810,15 @@ const handleAxiosError = (error, message, context, _logger)=>{
|
|
|
1815
1810
|
}, {
|
|
1816
1811
|
context
|
|
1817
1812
|
});
|
|
1818
|
-
|
|
1813
|
+
// A 429 (Too Many Requests) is a transient rate-limit signal, not a code or
|
|
1814
|
+
// logic failure. Log it as a warning so it doesn't pollute error dashboards
|
|
1815
|
+
// or trigger PagerDuty alerts. This covers both Cloudflare WAF 429s and
|
|
1816
|
+
// application-level rate limiting.
|
|
1817
|
+
const logLevel = ((_error_response2 = error.response) == null ? void 0 : _error_response2.status) === 429 ? 'warn' : 'error';
|
|
1819
1818
|
Logger[logLevel]('[DynamicWaasWalletClient] Axios error: ', logPayload);
|
|
1820
|
-
const status = (
|
|
1819
|
+
const status = (_error_response3 = error.response) == null ? void 0 : _error_response3.status;
|
|
1821
1820
|
const resolvedStatus = status && STATUS_MESSAGES[status] ? status : 500;
|
|
1822
1821
|
throw new WalletApiError(resolvedStatus, STATUS_MESSAGES[resolvedStatus]);
|
|
1823
1822
|
};
|
|
1824
1823
|
|
|
1825
|
-
export { AuthMode, BITCOIN_ADDRESS_TYPE_CONFIG, BITCOIN_DERIVATION_PATHS, BROWSER_SDK_ROUTE_PREFIX, BackupLocation, BitcoinAddressType, BitcoinNetwork, CreateRoomPartiesOptions, DELEGATED_SHARE_COUNT, 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_REDCOAST_API_KEY_MAP, DYNAMIC_CLIENT_RELAY_REDCOAST_APP_ID_MAP, DYNAMIC_FORWARD_MPC_DEV_ENCLAVE_URL, DYNAMIC_FORWARD_MPC_ENCLAVE_ATTESTATION_CONFIG_MAP, DYNAMIC_FORWARD_MPC_ENCLAVE_URL_MAP, DYNAMIC_FORWARD_MPC_PREPROD_ENCLAVE_URL, DYNAMIC_FORWARD_MPC_PROD_ENCLAVE_URL, DYNAMIC_KEYSHARES_RELAY_MAP, DYNAMIC_KEYSHARES_RELAY_PREPROD_BASE_API_URL, DYNAMIC_KEYSHARES_RELAY_PROD_BASE_API_URL, DynamicApiClient, DynamicClientSessionSignature, DynamicElevatedAccessTokenHeader, DynamicForwardMPCHeader, DynamicMfaTokenHeader, DynamicRequestIdHeader, DynamicTraceElapsedTimeHeader, DynamicTraceIdHeader, ENCRYPTED_SHARES_STORAGE_SUFFIX, ENVIRONMENT_ENUM, EVM_COMPATIBLE_CHAINS, FEATURE_FLAGS, IFRAME_DOMAIN_MAP, Logger, MIDNIGHT_DERIVATION_PATHS, MPC_CHAIN_CONFIG, MPC_CONFIG, MPC_RELAY_DEV_API_URL, MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, MPC_RELAY_URL_MAP, NoopLogger, PREPROD_RELAY_API_KEY, PREPROD_RELAY_APP_ID, PROD_RELAY_API_KEY, PROD_RELAY_APP_ID, RELAY_API_KEY_HEADER, RELAY_APP_ID_HEADER, SDK_NAMESPACE, SERVER_SDK_ROUTE_PREFIX, SOLANA_RPC_URL, SuccessEventType, ThresholdSignatureScheme, URL_PATTERNS, WalletApiError, WalletOperation, WalletReadyState, assertDynamicLocationsHaveExternalKeyShareId, chain, chainEnumToVerifiedCredentialName, formatNamespacedVersion, getBitcoinChainConfig, getClientThreshold, getDynamicServerThreshold, getEnvironmentFromUrl, getMPCChainConfig, getRequiredExternalKeyShareId, getReshareConfig, getServerWalletReshareConfig, getTSSConfig, getVersionNamespace, getVersionWithoutNamespace, handleAxiosError,
|
|
1824
|
+
export { AuthMode, BITCOIN_ADDRESS_TYPE_CONFIG, BITCOIN_DERIVATION_PATHS, BROWSER_SDK_ROUTE_PREFIX, BackupLocation, BitcoinAddressType, BitcoinNetwork, CreateRoomPartiesOptions, DELEGATED_SHARE_COUNT, 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_REDCOAST_API_KEY_MAP, DYNAMIC_CLIENT_RELAY_REDCOAST_APP_ID_MAP, DYNAMIC_FORWARD_MPC_DEV_ENCLAVE_URL, DYNAMIC_FORWARD_MPC_ENCLAVE_ATTESTATION_CONFIG_MAP, DYNAMIC_FORWARD_MPC_ENCLAVE_URL_MAP, DYNAMIC_FORWARD_MPC_PREPROD_ENCLAVE_URL, DYNAMIC_FORWARD_MPC_PROD_ENCLAVE_URL, DYNAMIC_KEYSHARES_RELAY_MAP, DYNAMIC_KEYSHARES_RELAY_PREPROD_BASE_API_URL, DYNAMIC_KEYSHARES_RELAY_PROD_BASE_API_URL, DynamicApiClient, DynamicClientSessionSignature, DynamicElevatedAccessTokenHeader, DynamicForwardMPCHeader, DynamicMfaTokenHeader, DynamicRequestIdHeader, DynamicTraceElapsedTimeHeader, DynamicTraceIdHeader, ENCRYPTED_SHARES_STORAGE_SUFFIX, ENVIRONMENT_ENUM, EVM_COMPATIBLE_CHAINS, FEATURE_FLAGS, IFRAME_DOMAIN_MAP, Logger, MIDNIGHT_DERIVATION_PATHS, MPC_CHAIN_CONFIG, MPC_CONFIG, MPC_RELAY_DEV_API_URL, MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, MPC_RELAY_URL_MAP, NoopLogger, PREPROD_RELAY_API_KEY, PREPROD_RELAY_APP_ID, PROD_RELAY_API_KEY, PROD_RELAY_APP_ID, RELAY_API_KEY_HEADER, RELAY_APP_ID_HEADER, SDK_NAMESPACE, SERVER_SDK_ROUTE_PREFIX, SOLANA_RPC_URL, SuccessEventType, ThresholdSignatureScheme, URL_PATTERNS, WalletApiError, WalletOperation, WalletReadyState, assertDynamicLocationsHaveExternalKeyShareId, chain, chainEnumToVerifiedCredentialName, formatNamespacedVersion, getBitcoinChainConfig, getClientThreshold, getDynamicServerThreshold, getEnvironmentFromUrl, getMPCChainConfig, getRequiredExternalKeyShareId, getReshareConfig, getServerWalletReshareConfig, getTSSConfig, getVersionNamespace, getVersionWithoutNamespace, handleAxiosError, isEvmCompatibleChain, parseNamespacedVersion, serializeMessageForForwardMPC, verifiedCredentialNameToChainEnum };
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@dynamic-labs/sdk-api-core": "^0.0.984",
|
|
8
|
-
"@dynamic-labs-wallet/primitives": "1.0.
|
|
8
|
+
"@dynamic-labs-wallet/primitives": "1.0.11",
|
|
9
9
|
"axios": "1.16.0",
|
|
10
10
|
"uuid": "11.1.0"
|
|
11
11
|
},
|
|
@@ -3,7 +3,6 @@ export declare class WalletApiError extends Error {
|
|
|
3
3
|
status: number;
|
|
4
4
|
constructor(status: number, message: string);
|
|
5
5
|
}
|
|
6
|
-
export declare const isCloudflareRateLimitError: (error: AxiosError) => boolean;
|
|
7
6
|
export declare const handleAxiosError: (error: AxiosError, message: string, context: Record<string, unknown>, _logger?: unknown) => never;
|
|
8
7
|
export type { AxiosError } from 'axios';
|
|
9
8
|
export { isAxiosError } from 'axios';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axiosErrorResponse.d.ts","sourceRoot":"","sources":["../../src/services/axiosErrorResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC,qBAAa,cAAe,SAAQ,KAAK;IACvC,MAAM,EAAE,MAAM,CAAC;gBAEH,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAK5C;AAWD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"axiosErrorResponse.d.ts","sourceRoot":"","sources":["../../src/services/axiosErrorResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC,qBAAa,cAAe,SAAQ,KAAK;IACvC,MAAM,EAAE,MAAM,CAAC;gBAEH,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAK5C;AAWD,eAAO,MAAM,gBAAgB,UACpB,UAAU,WACR,MAAM,WACN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YACtB,OAAO,UAsBlB,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC"}
|