@dynamic-labs-wallet/browser 0.0.321 → 0.0.322

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
@@ -4659,7 +4659,10 @@ class DynamicWalletClient {
4659
4659
  }
4660
4660
  // Get backup info from server
4661
4661
  const user = await this.apiClient.getUser(dynamicRequestId);
4662
- const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>vc.address.toLowerCase() === accountAddress.toLowerCase());
4662
+ const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>{
4663
+ var _vc_address;
4664
+ return ((_vc_address = vc.address) == null ? void 0 : _vc_address.toLowerCase()) === accountAddress.toLowerCase();
4665
+ });
4663
4666
  return getClientKeyShareBackupInfo({
4664
4667
  walletProperties: wallet == null ? void 0 : wallet.walletProperties
4665
4668
  });
@@ -5187,6 +5190,7 @@ class DynamicWalletClient {
5187
5190
  return roomType === sdkApiCore.RoomTypeEnum.Threshold ? MPC_SCHEME_CONFIG.threshold : MPC_SCHEME_CONFIG.numberOfParties;
5188
5191
  }
5189
5192
  async getRoom(roomType, thresholdSignatureScheme) {
5193
+ var _DynamicWalletClient_rooms_numberOfParties;
5190
5194
  const numberOfParties = this.getNumberOfParties(roomType, thresholdSignatureScheme);
5191
5195
  const consume = async ()=>{
5192
5196
  // Re-read from localStorage rather than the in-memory static so we see rooms
@@ -5211,7 +5215,17 @@ class DynamicWalletClient {
5211
5215
  // Use the Web Locks API for cross-tab mutual exclusion so that two tabs
5212
5216
  // cannot both consume the same cached room. Falls back to a direct call in
5213
5217
  // environments where navigator.locks is unavailable (e.g. Node.js tests).
5214
- const room = typeof navigator !== 'undefined' && navigator.locks ? await navigator.locks.request(`${this.storageKey}-room-cache`, consume) : await consume();
5218
+ const webLocksAvailable = typeof navigator !== 'undefined' && !!navigator.locks;
5219
+ const room = webLocksAvailable ? await navigator.locks.request(`${this.storageKey}-room-cache`, consume) : await consume();
5220
+ var _DynamicWalletClient_rooms_numberOfParties_length;
5221
+ this.logger.info('[DynamicWaasWalletClient] getRoom result', {
5222
+ key: 'roomCache',
5223
+ operation: 'getRoom',
5224
+ numberOfParties,
5225
+ roomId: room == null ? void 0 : room.roomId,
5226
+ remainingInMemory: (_DynamicWalletClient_rooms_numberOfParties_length = (_DynamicWalletClient_rooms_numberOfParties = DynamicWalletClient.rooms[numberOfParties]) == null ? void 0 : _DynamicWalletClient_rooms_numberOfParties.length) != null ? _DynamicWalletClient_rooms_numberOfParties_length : 0,
5227
+ webLocksAvailable
5228
+ });
5215
5229
  // If less than or only 1 room left after removing one, trigger async creation for more rooms.
5216
5230
  const remainingRooms = DynamicWalletClient.rooms[numberOfParties] || [];
5217
5231
  if (remainingRooms.length <= 1) {
package/index.esm.js CHANGED
@@ -4660,7 +4660,10 @@ class DynamicWalletClient {
4660
4660
  }
4661
4661
  // Get backup info from server
4662
4662
  const user = await this.apiClient.getUser(dynamicRequestId);
4663
- const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>vc.address.toLowerCase() === accountAddress.toLowerCase());
4663
+ const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>{
4664
+ var _vc_address;
4665
+ return ((_vc_address = vc.address) == null ? void 0 : _vc_address.toLowerCase()) === accountAddress.toLowerCase();
4666
+ });
4664
4667
  return getClientKeyShareBackupInfo({
4665
4668
  walletProperties: wallet == null ? void 0 : wallet.walletProperties
4666
4669
  });
@@ -5188,6 +5191,7 @@ class DynamicWalletClient {
5188
5191
  return roomType === RoomTypeEnum.Threshold ? MPC_SCHEME_CONFIG.threshold : MPC_SCHEME_CONFIG.numberOfParties;
5189
5192
  }
5190
5193
  async getRoom(roomType, thresholdSignatureScheme) {
5194
+ var _DynamicWalletClient_rooms_numberOfParties;
5191
5195
  const numberOfParties = this.getNumberOfParties(roomType, thresholdSignatureScheme);
5192
5196
  const consume = async ()=>{
5193
5197
  // Re-read from localStorage rather than the in-memory static so we see rooms
@@ -5212,7 +5216,17 @@ class DynamicWalletClient {
5212
5216
  // Use the Web Locks API for cross-tab mutual exclusion so that two tabs
5213
5217
  // cannot both consume the same cached room. Falls back to a direct call in
5214
5218
  // environments where navigator.locks is unavailable (e.g. Node.js tests).
5215
- const room = typeof navigator !== 'undefined' && navigator.locks ? await navigator.locks.request(`${this.storageKey}-room-cache`, consume) : await consume();
5219
+ const webLocksAvailable = typeof navigator !== 'undefined' && !!navigator.locks;
5220
+ const room = webLocksAvailable ? await navigator.locks.request(`${this.storageKey}-room-cache`, consume) : await consume();
5221
+ var _DynamicWalletClient_rooms_numberOfParties_length;
5222
+ this.logger.info('[DynamicWaasWalletClient] getRoom result', {
5223
+ key: 'roomCache',
5224
+ operation: 'getRoom',
5225
+ numberOfParties,
5226
+ roomId: room == null ? void 0 : room.roomId,
5227
+ remainingInMemory: (_DynamicWalletClient_rooms_numberOfParties_length = (_DynamicWalletClient_rooms_numberOfParties = DynamicWalletClient.rooms[numberOfParties]) == null ? void 0 : _DynamicWalletClient_rooms_numberOfParties.length) != null ? _DynamicWalletClient_rooms_numberOfParties_length : 0,
5228
+ webLocksAvailable
5229
+ });
5216
5230
  // If less than or only 1 room left after removing one, trigger async creation for more rooms.
5217
5231
  const remainingRooms = DynamicWalletClient.rooms[numberOfParties] || [];
5218
5232
  if (remainingRooms.length <= 1) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/browser",
3
- "version": "0.0.321",
3
+ "version": "0.0.322",
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.321",
7
+ "@dynamic-labs-wallet/core": "0.0.322",
8
8
  "@dynamic-labs/sdk-api-core": "^0.0.900",
9
9
  "argon2id": "1.0.1",
10
10
  "axios": "1.13.5",