@dynamic-labs-wallet/browser 0.0.350 → 0.0.351
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 +7 -7
- package/index.esm.js +7 -7
- package/package.json +3 -3
- package/src/client.d.ts +1 -1
- package/src/errorConstants.d.ts +1 -1
- package/src/utils.d.ts +1 -1
package/index.cjs
CHANGED
|
@@ -376,7 +376,7 @@ const ERROR_VERIFY_TRANSACTION_SIGNATURE = '[DynamicWaasWalletClient]: Error ver
|
|
|
376
376
|
const ERROR_EXPORT_PRIVATE_KEY = '[DynamicWaasWalletClient]: Error exporting private key';
|
|
377
377
|
const ERROR_IMPORT_PRIVATE_KEY = '[DynamicWaasWalletClient]: Error importing private key';
|
|
378
378
|
const ERROR_PUBLIC_KEY_MISMATCH = 'Mismatch between the public keys of the server and the ones provided';
|
|
379
|
-
const
|
|
379
|
+
const ERROR_PASSWORD_REQUIRED = '[DynamicWaasWalletClient]: A password is required for this environment. Please provide a password.';
|
|
380
380
|
const ERROR_REFRESH_NOT_SUPPORTED_FOR_TWO_OF_THREE = '[DynamicWaasWalletClient]: Refresh is not supported for 2/3 wallets. Reshare to 2/2 before refreshing.';
|
|
381
381
|
// Server-side error returned by /waas/create when an env disallows more than
|
|
382
382
|
// one wallet per chain and the user already has one. Matched verbatim by
|
|
@@ -1040,7 +1040,7 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1040
1040
|
/**
|
|
1041
1041
|
* Classifies whether a wallet-creation / wallet-import ceremony error is
|
|
1042
1042
|
* worth retrying. Returns true for terminal errors that won't get better on
|
|
1043
|
-
* retry (wrong password, missing
|
|
1043
|
+
* retry (wrong password, missing password, public-key mismatch, etc.) so the
|
|
1044
1044
|
* caller can mark them with `isRetryable: false` and short-circuit
|
|
1045
1045
|
* `retryPromise`.
|
|
1046
1046
|
*/ const isNonRetryableCeremonyError = (error)=>{
|
|
@@ -1050,7 +1050,7 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1050
1050
|
if (error instanceof InvalidPasswordError) return true;
|
|
1051
1051
|
const message = error instanceof Error ? error.message : '';
|
|
1052
1052
|
if (!message) return false;
|
|
1053
|
-
if (message.includes(
|
|
1053
|
+
if (message.includes(ERROR_PASSWORD_REQUIRED)) return true;
|
|
1054
1054
|
if (message.includes(ERROR_PUBLIC_KEY_MISMATCH)) return true;
|
|
1055
1055
|
if (message.includes(ERROR_PASSWORD_MISMATCH)) return true;
|
|
1056
1056
|
if (message.includes(ERROR_MULTIPLE_WALLETS_PER_CHAIN)) return true;
|
|
@@ -4933,14 +4933,14 @@ class DynamicWalletClient {
|
|
|
4933
4933
|
throw error;
|
|
4934
4934
|
}
|
|
4935
4935
|
}
|
|
4936
|
-
|
|
4936
|
+
isPasswordRequired() {
|
|
4937
4937
|
var _readEnvironmentSettings_sdk_waas, _readEnvironmentSettings_sdk, _readEnvironmentSettings;
|
|
4938
4938
|
var _readEnvironmentSettings_sdk_waas_passcodeRequired;
|
|
4939
4939
|
return (_readEnvironmentSettings_sdk_waas_passcodeRequired = (_readEnvironmentSettings = readEnvironmentSettings()) == null ? void 0 : (_readEnvironmentSettings_sdk = _readEnvironmentSettings.sdk) == null ? void 0 : (_readEnvironmentSettings_sdk_waas = _readEnvironmentSettings_sdk.waas) == null ? void 0 : _readEnvironmentSettings_sdk_waas.passcodeRequired) != null ? _readEnvironmentSettings_sdk_waas_passcodeRequired : false;
|
|
4940
4940
|
}
|
|
4941
4941
|
assertPasswordRequired(password) {
|
|
4942
|
-
if (this.
|
|
4943
|
-
throw new Error(
|
|
4942
|
+
if (this.isPasswordRequired() && !password) {
|
|
4943
|
+
throw new Error(ERROR_PASSWORD_REQUIRED);
|
|
4944
4944
|
}
|
|
4945
4945
|
}
|
|
4946
4946
|
async validatePasswordConsistencyForNewWallet({ password, signedSessionId }) {
|
|
@@ -6501,8 +6501,8 @@ exports.ERROR_IMPORT_PRIVATE_KEY = ERROR_IMPORT_PRIVATE_KEY;
|
|
|
6501
6501
|
exports.ERROR_KEYGEN_FAILED = ERROR_KEYGEN_FAILED;
|
|
6502
6502
|
exports.ERROR_MULTIPLE_WALLETS_PER_CHAIN = ERROR_MULTIPLE_WALLETS_PER_CHAIN;
|
|
6503
6503
|
exports.ERROR_NO_KEY_SHARES_BACKED_UP = ERROR_NO_KEY_SHARES_BACKED_UP;
|
|
6504
|
-
exports.ERROR_PASSCODE_REQUIRED = ERROR_PASSCODE_REQUIRED;
|
|
6505
6504
|
exports.ERROR_PASSWORD_MISMATCH = ERROR_PASSWORD_MISMATCH;
|
|
6505
|
+
exports.ERROR_PASSWORD_REQUIRED = ERROR_PASSWORD_REQUIRED;
|
|
6506
6506
|
exports.ERROR_PASSWORD_REQUIRED_FOR_ENCRYPTED_WALLET = ERROR_PASSWORD_REQUIRED_FOR_ENCRYPTED_WALLET;
|
|
6507
6507
|
exports.ERROR_PUBLIC_KEY_MISMATCH = ERROR_PUBLIC_KEY_MISMATCH;
|
|
6508
6508
|
exports.ERROR_REFRESH_NOT_SUPPORTED_FOR_TWO_OF_THREE = ERROR_REFRESH_NOT_SUPPORTED_FOR_TWO_OF_THREE;
|
package/index.esm.js
CHANGED
|
@@ -377,7 +377,7 @@ const ERROR_VERIFY_TRANSACTION_SIGNATURE = '[DynamicWaasWalletClient]: Error ver
|
|
|
377
377
|
const ERROR_EXPORT_PRIVATE_KEY = '[DynamicWaasWalletClient]: Error exporting private key';
|
|
378
378
|
const ERROR_IMPORT_PRIVATE_KEY = '[DynamicWaasWalletClient]: Error importing private key';
|
|
379
379
|
const ERROR_PUBLIC_KEY_MISMATCH = 'Mismatch between the public keys of the server and the ones provided';
|
|
380
|
-
const
|
|
380
|
+
const ERROR_PASSWORD_REQUIRED = '[DynamicWaasWalletClient]: A password is required for this environment. Please provide a password.';
|
|
381
381
|
const ERROR_REFRESH_NOT_SUPPORTED_FOR_TWO_OF_THREE = '[DynamicWaasWalletClient]: Refresh is not supported for 2/3 wallets. Reshare to 2/2 before refreshing.';
|
|
382
382
|
// Server-side error returned by /waas/create when an env disallows more than
|
|
383
383
|
// one wallet per chain and the user already has one. Matched verbatim by
|
|
@@ -1041,7 +1041,7 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1041
1041
|
/**
|
|
1042
1042
|
* Classifies whether a wallet-creation / wallet-import ceremony error is
|
|
1043
1043
|
* worth retrying. Returns true for terminal errors that won't get better on
|
|
1044
|
-
* retry (wrong password, missing
|
|
1044
|
+
* retry (wrong password, missing password, public-key mismatch, etc.) so the
|
|
1045
1045
|
* caller can mark them with `isRetryable: false` and short-circuit
|
|
1046
1046
|
* `retryPromise`.
|
|
1047
1047
|
*/ const isNonRetryableCeremonyError = (error)=>{
|
|
@@ -1051,7 +1051,7 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1051
1051
|
if (error instanceof InvalidPasswordError) return true;
|
|
1052
1052
|
const message = error instanceof Error ? error.message : '';
|
|
1053
1053
|
if (!message) return false;
|
|
1054
|
-
if (message.includes(
|
|
1054
|
+
if (message.includes(ERROR_PASSWORD_REQUIRED)) return true;
|
|
1055
1055
|
if (message.includes(ERROR_PUBLIC_KEY_MISMATCH)) return true;
|
|
1056
1056
|
if (message.includes(ERROR_PASSWORD_MISMATCH)) return true;
|
|
1057
1057
|
if (message.includes(ERROR_MULTIPLE_WALLETS_PER_CHAIN)) return true;
|
|
@@ -4934,14 +4934,14 @@ class DynamicWalletClient {
|
|
|
4934
4934
|
throw error;
|
|
4935
4935
|
}
|
|
4936
4936
|
}
|
|
4937
|
-
|
|
4937
|
+
isPasswordRequired() {
|
|
4938
4938
|
var _readEnvironmentSettings_sdk_waas, _readEnvironmentSettings_sdk, _readEnvironmentSettings;
|
|
4939
4939
|
var _readEnvironmentSettings_sdk_waas_passcodeRequired;
|
|
4940
4940
|
return (_readEnvironmentSettings_sdk_waas_passcodeRequired = (_readEnvironmentSettings = readEnvironmentSettings()) == null ? void 0 : (_readEnvironmentSettings_sdk = _readEnvironmentSettings.sdk) == null ? void 0 : (_readEnvironmentSettings_sdk_waas = _readEnvironmentSettings_sdk.waas) == null ? void 0 : _readEnvironmentSettings_sdk_waas.passcodeRequired) != null ? _readEnvironmentSettings_sdk_waas_passcodeRequired : false;
|
|
4941
4941
|
}
|
|
4942
4942
|
assertPasswordRequired(password) {
|
|
4943
|
-
if (this.
|
|
4944
|
-
throw new Error(
|
|
4943
|
+
if (this.isPasswordRequired() && !password) {
|
|
4944
|
+
throw new Error(ERROR_PASSWORD_REQUIRED);
|
|
4945
4945
|
}
|
|
4946
4946
|
}
|
|
4947
4947
|
async validatePasswordConsistencyForNewWallet({ password, signedSessionId }) {
|
|
@@ -6431,4 +6431,4 @@ DynamicWalletClient.rooms = {};
|
|
|
6431
6431
|
DynamicWalletClient.roomsInitializing = {};
|
|
6432
6432
|
DynamicWalletClient.roomsPersistChain = Promise.resolve();
|
|
6433
6433
|
|
|
6434
|
-
export { BACKUP_FILENAME, CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX, DynamicWalletClient, ENVIRONMENT_SETTINGS_STORAGE_KEY, ERROR_ACCOUNT_ADDRESS_REQUIRED, ERROR_CREATE_WALLET_ACCOUNT, ERROR_EXPORT_PRIVATE_KEY, ERROR_IMPORT_PRIVATE_KEY, ERROR_KEYGEN_FAILED, ERROR_MULTIPLE_WALLETS_PER_CHAIN, ERROR_NO_KEY_SHARES_BACKED_UP,
|
|
6434
|
+
export { BACKUP_FILENAME, CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX, DynamicWalletClient, ENVIRONMENT_SETTINGS_STORAGE_KEY, ERROR_ACCOUNT_ADDRESS_REQUIRED, ERROR_CREATE_WALLET_ACCOUNT, ERROR_EXPORT_PRIVATE_KEY, ERROR_IMPORT_PRIVATE_KEY, ERROR_KEYGEN_FAILED, ERROR_MULTIPLE_WALLETS_PER_CHAIN, ERROR_NO_KEY_SHARES_BACKED_UP, ERROR_PASSWORD_MISMATCH, ERROR_PASSWORD_REQUIRED, ERROR_PASSWORD_REQUIRED_FOR_ENCRYPTED_WALLET, ERROR_PUBLIC_KEY_MISMATCH, ERROR_REFRESH_NOT_SUPPORTED_FOR_TWO_OF_THREE, ERROR_SIGN_MESSAGE, ERROR_SIGN_TYPED_DATA, ERROR_VERIFY_MESSAGE_SIGNATURE, ERROR_VERIFY_TRANSACTION_SIGNATURE, HEAVY_QUEUE_OPERATIONS, RECOVER_QUEUE_OPERATIONS, ROOM_CACHE_COUNT, ROOM_EXPIRATION_TIME, SIGNED_SESSION_ID_MIN_VERSION, SIGNED_SESSION_ID_MIN_VERSION_BY_NAMESPACE, SIGN_QUEUE_OPERATIONS, STORAGE_KEY, StaleLocalSharesError, WalletBusyError, WalletNotReadyError, cancelICloudAuth, createAddCloudProviderToExistingDelegationDistribution, createBackupData, createCloudProviderDistribution, createDelegationOnlyDistribution, createDelegationWithCloudProviderDistribution, createDynamicOnlyDistribution, deleteICloudBackup, downloadStringAsFile, extractPubkey, formatEvmMessage, formatMessage, getActiveCloudProviders, getBitcoinAddressTypeFromDerivationPath, getClientKeyShareBackupInfo, getClientKeyShareExportFileName, getDelegatedShareSet, getGoogleOAuthAccountId, getHttpStatus, getICloudBackup, getMPCSignatureScheme, getMPCSigner, hasCloudProviderBackup, hasDelegatedBackup, hasEncryptedSharesCached, initializeCloudKit, isBrowser, isHeavyQueueOperation, isHexString, isICloudAuthenticated, isNonRetryableCeremonyError, isPublicKeyMismatchError, isRecoverQueueOperation, isSignQueueOperation, listICloudBackups, markCeremonyErrorNonRetryable, readEnvironmentSettings, retryPromise, shouldReshareToSameBackups, timeoutPromise };
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.351",
|
|
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.351",
|
|
8
8
|
"@dynamic-labs-wallet/forward-mpc-client": "0.9.0",
|
|
9
|
-
"@dynamic-labs-wallet/primitives": "0.0.
|
|
9
|
+
"@dynamic-labs-wallet/primitives": "0.0.351",
|
|
10
10
|
"@dynamic-labs/sdk-api-core": "^0.0.964",
|
|
11
11
|
"argon2id": "1.0.1",
|
|
12
12
|
"axios": "1.15.2",
|
package/src/client.d.ts
CHANGED
|
@@ -570,7 +570,7 @@ export declare class DynamicWalletClient {
|
|
|
570
570
|
* Throws ERROR_PASSWORD_MISMATCH if the password is incorrect.
|
|
571
571
|
*/
|
|
572
572
|
private validatePasswordAgainstEncryptedShares;
|
|
573
|
-
private
|
|
573
|
+
private isPasswordRequired;
|
|
574
574
|
private assertPasswordRequired;
|
|
575
575
|
protected validatePasswordConsistencyForNewWallet({ password, signedSessionId, }: {
|
|
576
576
|
password?: string;
|
package/src/errorConstants.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const ERROR_VERIFY_TRANSACTION_SIGNATURE = "[DynamicWaasWalletCli
|
|
|
9
9
|
export declare const ERROR_EXPORT_PRIVATE_KEY = "[DynamicWaasWalletClient]: Error exporting private key";
|
|
10
10
|
export declare const ERROR_IMPORT_PRIVATE_KEY = "[DynamicWaasWalletClient]: Error importing private key";
|
|
11
11
|
export declare const ERROR_PUBLIC_KEY_MISMATCH = "Mismatch between the public keys of the server and the ones provided";
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const ERROR_PASSWORD_REQUIRED = "[DynamicWaasWalletClient]: A password is required for this environment. Please provide a password.";
|
|
13
13
|
export declare const ERROR_REFRESH_NOT_SUPPORTED_FOR_TWO_OF_THREE = "[DynamicWaasWalletClient]: Refresh is not supported for 2/3 wallets. Reshare to 2/2 before refreshing.";
|
|
14
14
|
export declare const ERROR_MULTIPLE_WALLETS_PER_CHAIN = "Multiple wallets per chain not allowed";
|
|
15
15
|
//# sourceMappingURL=errorConstants.d.ts.map
|
package/src/utils.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export declare function retryPromise<T>(operation: () => Promise<T>, { maxAttemp
|
|
|
53
53
|
/**
|
|
54
54
|
* Classifies whether a wallet-creation / wallet-import ceremony error is
|
|
55
55
|
* worth retrying. Returns true for terminal errors that won't get better on
|
|
56
|
-
* retry (wrong password, missing
|
|
56
|
+
* retry (wrong password, missing password, public-key mismatch, etc.) so the
|
|
57
57
|
* caller can mark them with `isRetryable: false` and short-circuit
|
|
58
58
|
* `retryPromise`.
|
|
59
59
|
*/
|