@dynamic-labs-wallet/browser 1.0.104 → 1.0.106
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
|
@@ -723,7 +723,9 @@ const ERROR_PASSWORD_REQUIRED = '[DynamicWaasWalletClient]: A password is requir
|
|
|
723
723
|
const ERROR_REFRESH_NOT_SUPPORTED_FOR_TWO_OF_THREE = '[DynamicWaasWalletClient]: Refresh is not supported for 2/3 wallets. Reshare to 2/2 before refreshing.';
|
|
724
724
|
// Server-side error returned by /waas/create when an env disallows more than
|
|
725
725
|
// one wallet per chain and the user already has one. Matched verbatim by
|
|
726
|
-
// isNonRetryableCeremonyError — keep in sync with the backend wording.
|
|
726
|
+
// isNonRetryableCeremonyError — keep in sync with the backend wording. Also
|
|
727
|
+
// thrown client-side by createWalletAccountGuard.ts (see logger.ts's
|
|
728
|
+
// classifyOne for why that throw site needs its own classifier entry).
|
|
727
729
|
const ERROR_MULTIPLE_WALLETS_PER_CHAIN = 'Multiple wallets per chain not allowed';
|
|
728
730
|
|
|
729
731
|
const ERROR_PASSWORD_MISMATCH = '[DynamicWaasWalletClient]: Password does not match the password used for existing wallets. All wallets must use the same password for encrypted backups.';
|
|
@@ -2330,9 +2332,14 @@ const CLIENT_NETWORK_ERROR_MESSAGES = new Set([
|
|
|
2330
2332
|
const msg = error.message.toLowerCase();
|
|
2331
2333
|
return CLIENT_NETWORK_ERROR_MESSAGES.has(msg) || msg.startsWith('webassembly compilation aborted: network error');
|
|
2332
2334
|
};
|
|
2335
|
+
// Every expected/business-rule rejection needs a predicate here, not just a
|
|
2336
|
+
// check in its own catch block — browser-iframe's reportOperationError sees
|
|
2337
|
+
// every operation failure and classifies solely via resolveLogLevel here.
|
|
2333
2338
|
const classifyOne = (error)=>{
|
|
2334
2339
|
if (isExpectedUserError(error)) return 'info';
|
|
2335
|
-
if (isDowngradableApiError(error) || isQueueTimeoutError(error) || isClientNetworkError(error))
|
|
2340
|
+
if (isDowngradableApiError(error) || isQueueTimeoutError(error) || isClientNetworkError(error) || isMultipleWalletsPerChainRejection(error)) {
|
|
2341
|
+
return 'warn';
|
|
2342
|
+
}
|
|
2336
2343
|
return undefined;
|
|
2337
2344
|
};
|
|
2338
2345
|
/** Bounded so a self-referencing or cyclic `cause` chain cannot spin. */ const MAX_CAUSE_DEPTH = 5;
|
|
@@ -3121,6 +3128,8 @@ const assertCanCreateWalletAccount = ({ chainName, businessAccountId, environmen
|
|
|
3121
3128
|
chainName,
|
|
3122
3129
|
existingWalletId: existingWallet.walletId
|
|
3123
3130
|
});
|
|
3131
|
+
// Thrown before keyGen()'s own catch runs, so severity here depends
|
|
3132
|
+
// solely on logger.ts's classifyOne, not that catch's local check.
|
|
3124
3133
|
throw new Error(ERROR_MULTIPLE_WALLETS_PER_CHAIN);
|
|
3125
3134
|
}
|
|
3126
3135
|
}
|
package/index.esm.js
CHANGED
|
@@ -724,7 +724,9 @@ const ERROR_PASSWORD_REQUIRED = '[DynamicWaasWalletClient]: A password is requir
|
|
|
724
724
|
const ERROR_REFRESH_NOT_SUPPORTED_FOR_TWO_OF_THREE = '[DynamicWaasWalletClient]: Refresh is not supported for 2/3 wallets. Reshare to 2/2 before refreshing.';
|
|
725
725
|
// Server-side error returned by /waas/create when an env disallows more than
|
|
726
726
|
// one wallet per chain and the user already has one. Matched verbatim by
|
|
727
|
-
// isNonRetryableCeremonyError — keep in sync with the backend wording.
|
|
727
|
+
// isNonRetryableCeremonyError — keep in sync with the backend wording. Also
|
|
728
|
+
// thrown client-side by createWalletAccountGuard.ts (see logger.ts's
|
|
729
|
+
// classifyOne for why that throw site needs its own classifier entry).
|
|
728
730
|
const ERROR_MULTIPLE_WALLETS_PER_CHAIN = 'Multiple wallets per chain not allowed';
|
|
729
731
|
|
|
730
732
|
const ERROR_PASSWORD_MISMATCH = '[DynamicWaasWalletClient]: Password does not match the password used for existing wallets. All wallets must use the same password for encrypted backups.';
|
|
@@ -2331,9 +2333,14 @@ const CLIENT_NETWORK_ERROR_MESSAGES = new Set([
|
|
|
2331
2333
|
const msg = error.message.toLowerCase();
|
|
2332
2334
|
return CLIENT_NETWORK_ERROR_MESSAGES.has(msg) || msg.startsWith('webassembly compilation aborted: network error');
|
|
2333
2335
|
};
|
|
2336
|
+
// Every expected/business-rule rejection needs a predicate here, not just a
|
|
2337
|
+
// check in its own catch block — browser-iframe's reportOperationError sees
|
|
2338
|
+
// every operation failure and classifies solely via resolveLogLevel here.
|
|
2334
2339
|
const classifyOne = (error)=>{
|
|
2335
2340
|
if (isExpectedUserError(error)) return 'info';
|
|
2336
|
-
if (isDowngradableApiError(error) || isQueueTimeoutError(error) || isClientNetworkError(error))
|
|
2341
|
+
if (isDowngradableApiError(error) || isQueueTimeoutError(error) || isClientNetworkError(error) || isMultipleWalletsPerChainRejection(error)) {
|
|
2342
|
+
return 'warn';
|
|
2343
|
+
}
|
|
2337
2344
|
return undefined;
|
|
2338
2345
|
};
|
|
2339
2346
|
/** Bounded so a self-referencing or cyclic `cause` chain cannot spin. */ const MAX_CAUSE_DEPTH = 5;
|
|
@@ -3122,6 +3129,8 @@ const assertCanCreateWalletAccount = ({ chainName, businessAccountId, environmen
|
|
|
3122
3129
|
chainName,
|
|
3123
3130
|
existingWalletId: existingWallet.walletId
|
|
3124
3131
|
});
|
|
3132
|
+
// Thrown before keyGen()'s own catch runs, so severity here depends
|
|
3133
|
+
// solely on logger.ts's classifyOne, not that catch's local check.
|
|
3125
3134
|
throw new Error(ERROR_MULTIPLE_WALLETS_PER_CHAIN);
|
|
3126
3135
|
}
|
|
3127
3136
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.106",
|
|
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": "1.0.
|
|
7
|
+
"@dynamic-labs-wallet/core": "1.0.106",
|
|
8
8
|
"@dynamic-labs-wallet/forward-mpc-client": "1.0.1",
|
|
9
|
-
"@dynamic-labs-wallet/primitives": "1.0.
|
|
9
|
+
"@dynamic-labs-wallet/primitives": "1.0.106",
|
|
10
10
|
"@dynamic-labs/sdk-api-core": "^0.0.1093",
|
|
11
11
|
"@noble/curves": "1.8.0",
|
|
12
12
|
"argon2id": "1.0.1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorConstants.d.ts","sourceRoot":"","sources":["../../packages/src/errorConstants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,oDAAoD,CAAC;AAE/F,eAAO,MAAM,mBAAmB,iDAAiD,CAAC;AAElF,eAAO,MAAM,2BAA2B,6DAA6D,CAAC;AAEtG,eAAO,MAAM,kBAAkB,qDAAqD,CAAC;AAErF,eAAO,MAAM,qBAAqB,wDAAwD,CAAC;AAE3F,eAAO,MAAM,8BAA8B,2DAA2D,CAAC;AAEvG,eAAO,MAAM,8BAA8B,iEAAiE,CAAC;AAE7G,eAAO,MAAM,kCAAkC,qEAAqE,CAAC;AAErH,eAAO,MAAM,wBAAwB,2DAA2D,CAAC;AAEjG,eAAO,MAAM,wBAAwB,2DAA2D,CAAC;AAEjG,eAAO,MAAM,yBAAyB,yEAAyE,CAAC;AAEhH,eAAO,MAAM,uBAAuB,uGACkE,CAAC;AAEvG,eAAO,MAAM,4CAA4C,2GACiD,CAAC;
|
|
1
|
+
{"version":3,"file":"errorConstants.d.ts","sourceRoot":"","sources":["../../packages/src/errorConstants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,oDAAoD,CAAC;AAE/F,eAAO,MAAM,mBAAmB,iDAAiD,CAAC;AAElF,eAAO,MAAM,2BAA2B,6DAA6D,CAAC;AAEtG,eAAO,MAAM,kBAAkB,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A4B,KAAG,
|
|
1
|
+
{"version":3,"file":"createWalletAccountGuard.d.ts","sourceRoot":"","sources":["../../src/services/createWalletAccountGuard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAQ5E,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,4BAA4B,aAAc,eAAe,GAAG,IAAI,KAAG,MAAM,GAAG,SAC1B,CAAC;AAEhE,eAAO,MAAM,0BAA0B,oDAIpC;IACD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;CAClC,KAAG,OAYH,CAAC;AAEF,eAAO,MAAM,4BAA4B,gFAOtC,4BAA4B,KAAG,IAsBjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/services/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/services/logger.ts"],"names":[],"mappings":"AAwDA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,UAAW,OAAO,KAAG,OAIrD,CAAC;AAqBF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,UAAW,OAAO,YAAY,OAAO,GAAG,MAAM,KAAG,MAAM,GAAG,MAAM,GAAG,OAW9F,CAAC;AAeF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,UAAW,OAAO,KAAG,MAmBjD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,wBAAwB,UAC5B,OAAO,KACb;IAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAShG,CAAC;AAEF,eAAO,MAAM,QAAQ,wCAKlB;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC1B,KAAG,IAoBH,CAAC"}
|