@dynamic-labs-wallet/browser 0.0.121 → 0.0.123

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
@@ -105,12 +105,6 @@ const ensureBase64Padding = (str)=>{
105
105
  return str.padEnd(Math.ceil(str.length / 4) * 4, '=');
106
106
  };
107
107
  const isBrowser = ()=>typeof window !== 'undefined';
108
- const isHexString = (str)=>{
109
- // Remove 0x prefix if present
110
- const hex = str.startsWith('0x') ? str.slice(2) : str;
111
- // Check if string contains only hex characters
112
- return /^[0-9A-Fa-f]+$/.test(hex);
113
- };
114
108
  const getClientKeyShareExportFileName = ({ thresholdSignatureScheme, accountAddress })=>{
115
109
  return `${CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX}-${thresholdSignatureScheme}-${accountAddress}.json`;
116
110
  };
@@ -193,6 +187,12 @@ const formatEvmMessage = (message)=>{
193
187
  }
194
188
  return web.MessageHash.keccak256(message);
195
189
  };
190
+ const isHexString = (str)=>{
191
+ // Remove 0x prefix if present
192
+ const hex = str.startsWith('0x') ? str.slice(2) : str;
193
+ // Check if string contains only hex characters
194
+ return /^[0-9A-Fa-f]+$/.test(hex);
195
+ };
196
196
  const formatSolanaMessage = (message)=>{
197
197
  if (typeof message === 'string') {
198
198
  if (!isHexString(message)) {
@@ -618,6 +618,7 @@ class DynamicWalletClient {
618
618
  sessionId,
619
619
  userId
620
620
  });
621
+ this.sessionId = sessionId;
621
622
  } catch (error) {
622
623
  logError({
623
624
  message: '[DynamicWaasWalletClient] Error initializing logger context',
@@ -868,7 +869,7 @@ class DynamicWalletClient {
868
869
  throw error;
869
870
  }
870
871
  }
871
- async serverSign({ walletId, message, isFormatted }) {
872
+ async serverSign({ walletId, message, isFormatted, mfaToken }) {
872
873
  // Create the room and sign the message
873
874
  if (typeof message !== 'string') {
874
875
  message = `0x${Buffer.from(message).toString('hex')}`;
@@ -877,7 +878,8 @@ class DynamicWalletClient {
877
878
  walletId,
878
879
  message,
879
880
  isFormatted,
880
- dynamicRequestId: uuid.v4()
881
+ dynamicRequestId: uuid.v4(),
882
+ mfaToken
881
883
  });
882
884
  return data;
883
885
  }
@@ -912,7 +914,7 @@ class DynamicWalletClient {
912
914
  }
913
915
  }
914
916
  //todo: need to modify with imported flag
915
- async sign({ accountAddress, message, chainName, password = undefined, isFormatted = false, signedSessionId }) {
917
+ async sign({ accountAddress, message, chainName, password = undefined, isFormatted = false, signedSessionId, mfaToken }) {
916
918
  try {
917
919
  await this.verifyPassword({
918
920
  accountAddress,
@@ -930,7 +932,8 @@ class DynamicWalletClient {
930
932
  const data = await this.serverSign({
931
933
  walletId: wallet.walletId,
932
934
  message,
933
- isFormatted
935
+ isFormatted,
936
+ mfaToken
934
937
  });
935
938
  this.logger.debug('[DynamicWaasWalletClient] Server sign completed', {
936
939
  message,
@@ -972,7 +975,7 @@ class DynamicWalletClient {
972
975
  throw error;
973
976
  }
974
977
  }
975
- async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, signedSessionId }) {
978
+ async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, signedSessionId, mfaToken }) {
976
979
  const dynamicRequestId = uuid.v4();
977
980
  try {
978
981
  await this.verifyPassword({
@@ -994,7 +997,8 @@ class DynamicWalletClient {
994
997
  // Create the room and refresh the shares
995
998
  const data = await this.apiClient.refreshWalletAccountShares({
996
999
  dynamicRequestId,
997
- walletId: wallet.walletId
1000
+ walletId: wallet.walletId,
1001
+ mfaToken
998
1002
  });
999
1003
  const roomId = data.roomId;
1000
1004
  const clientKeyShares = await this.getClientKeySharesFromLocalStorage({
@@ -1075,7 +1079,7 @@ class DynamicWalletClient {
1075
1079
  existingClientKeyShares
1076
1080
  };
1077
1081
  }
1078
- async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined, signedSessionId, backupToGoogleDrive = false }) {
1082
+ async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined, signedSessionId, backupToGoogleDrive = false, delegateToProjectEnvironment = false, mfaToken }) {
1079
1083
  const dynamicRequestId = uuid.v4();
1080
1084
  try {
1081
1085
  await this.verifyPassword({
@@ -1112,7 +1116,9 @@ class DynamicWalletClient {
1112
1116
  clientKeygenIds: clientKeygenIds,
1113
1117
  oldThresholdSignatureScheme,
1114
1118
  newThresholdSignatureScheme,
1115
- dynamicRequestId
1119
+ dynamicRequestId,
1120
+ delegateToProjectEnvironment,
1121
+ mfaToken
1116
1122
  });
1117
1123
  const { roomId, serverKeygenIds, newServerKeygenIds = [] } = data;
1118
1124
  // Get the MPC config for the threshold signature scheme
@@ -1139,12 +1145,20 @@ class DynamicWalletClient {
1139
1145
  clientKeyShares: reshareResults,
1140
1146
  overwriteOrMerge: 'overwrite'
1141
1147
  });
1142
- await this.storeEncryptedBackupByWallet({
1143
- accountAddress,
1144
- password,
1145
- signedSessionId,
1146
- backupToGoogleDrive
1147
- });
1148
+ if (delegateToProjectEnvironment) {
1149
+ await this.storeEncryptedBackupByDelegatedWallet({
1150
+ accountAddress,
1151
+ password,
1152
+ signedSessionId
1153
+ });
1154
+ } else {
1155
+ await this.storeEncryptedBackupByWallet({
1156
+ accountAddress,
1157
+ password,
1158
+ signedSessionId,
1159
+ backupToGoogleDrive
1160
+ });
1161
+ }
1148
1162
  } catch (error) {
1149
1163
  logError({
1150
1164
  message: '[DynamicWaasWalletClient] Error in reshare',
@@ -1161,7 +1175,90 @@ class DynamicWalletClient {
1161
1175
  throw error;
1162
1176
  }
1163
1177
  }
1164
- async exportKey({ accountAddress, chainName, password = undefined, signedSessionId }) {
1178
+ async sendKeySharesToDelegatedAccess({ accountAddress, chainName, delegatedKeyShares, environmentId, userId, walletId }) {
1179
+ try {
1180
+ if (!this.delegatedAccessEndpoint) {
1181
+ throw new Error('Cannot send key shares to delegated access because delegated access endpoint is not set');
1182
+ }
1183
+ const delegatedAccessEndpoint = this.delegatedAccessEndpoint;
1184
+ const response = await fetch(delegatedAccessEndpoint, {
1185
+ method: 'POST',
1186
+ body: JSON.stringify({
1187
+ chainName,
1188
+ accountAddress,
1189
+ delegatedKeyShares,
1190
+ environmentId,
1191
+ userId,
1192
+ walletId
1193
+ })
1194
+ });
1195
+ const data = await response.json();
1196
+ return data;
1197
+ } catch (error) {
1198
+ logError({
1199
+ message: '[DynamicWaasWalletClient] Error in sendKeySharesToDelegatedAccess',
1200
+ error: error,
1201
+ context: {
1202
+ accountAddress,
1203
+ chainName
1204
+ }
1205
+ });
1206
+ throw error;
1207
+ }
1208
+ }
1209
+ async delegateKeyShares({ accountAddress, password = undefined, signedSessionId, mfaToken }) {
1210
+ try {
1211
+ const delegateToProjectEnvironment = this.featureFlags && this.featureFlags[core.FEATURE_FLAGS.ENABLE_DELEGATED_KEY_SHARES_FLAG] === true;
1212
+ if (!delegateToProjectEnvironment) {
1213
+ throw new Error('Delegation is not allowed for this project environment');
1214
+ }
1215
+ const environmentSettings = await this.apiClient.getEnvironmentSettings();
1216
+ const delegatedAccessEndpoint = environmentSettings.sdk.waas.delegatedAccessEndpoint;
1217
+ if (!delegatedAccessEndpoint) {
1218
+ throw new Error('Cannot delegate key shares because verified access endpoint is not set in the environment settings');
1219
+ }
1220
+ this.delegatedAccessEndpoint = delegatedAccessEndpoint;
1221
+ const wallet = await this.getWallet({
1222
+ accountAddress,
1223
+ walletOperation: core.WalletOperation.REACH_ALL_PARTIES,
1224
+ password,
1225
+ signedSessionId
1226
+ });
1227
+ if (wallet.chainName === 'SUI') {
1228
+ throw new Error('Delegation is not allowed for SUI');
1229
+ }
1230
+ const currentThresholdSignatureScheme = this.walletMap[accountAddress].thresholdSignatureScheme;
1231
+ if (currentThresholdSignatureScheme === core.ThresholdSignatureScheme.TWO_OF_TWO) {
1232
+ // Reshare to 2-of-3, which will automatically handle the backup distribution
1233
+ await this.reshare({
1234
+ chainName: this.walletMap[accountAddress].chainName,
1235
+ accountAddress,
1236
+ oldThresholdSignatureScheme: currentThresholdSignatureScheme,
1237
+ newThresholdSignatureScheme: core.ThresholdSignatureScheme.TWO_OF_THREE,
1238
+ password,
1239
+ signedSessionId,
1240
+ backupToGoogleDrive: false,
1241
+ delegateToProjectEnvironment: true,
1242
+ mfaToken
1243
+ });
1244
+ const backupInfo = this.walletMap[accountAddress].clientKeySharesBackupInfo;
1245
+ const delegatedKeyShares = backupInfo.backups[core.BackupLocation.EXTERNAL] || [];
1246
+ return delegatedKeyShares;
1247
+ } else {
1248
+ throw new Error('Delegation is not allowed for this threshold signature scheme');
1249
+ }
1250
+ } catch (error) {
1251
+ logError({
1252
+ message: '[DynamicWaasWalletClient] Error in delegateKeyShares',
1253
+ error: error,
1254
+ context: {
1255
+ accountAddress
1256
+ }
1257
+ });
1258
+ throw error;
1259
+ }
1260
+ }
1261
+ async exportKey({ accountAddress, chainName, password = undefined, signedSessionId, mfaToken }) {
1165
1262
  const dynamicRequestId = uuid.v4();
1166
1263
  try {
1167
1264
  const wallet = await this.getWallet({
@@ -1184,7 +1281,8 @@ class DynamicWalletClient {
1184
1281
  const data = await this.apiClient.exportKey({
1185
1282
  walletId: wallet.walletId,
1186
1283
  exportId,
1187
- dynamicRequestId
1284
+ dynamicRequestId,
1285
+ mfaToken
1188
1286
  });
1189
1287
  this.logger.debug('[DynamicWaasWalletClient] Starting export of private key', {
1190
1288
  accountAddress,
@@ -1352,7 +1450,7 @@ class DynamicWalletClient {
1352
1450
  * @returns Promise with backup metadata including share locations and IDs
1353
1451
  */ async storeEncryptedBackupByWallet({ accountAddress, clientKeyShares = undefined, password = undefined, signedSessionId, backupToGoogleDrive = false }) {
1354
1452
  try {
1355
- var _this_walletMap_accountAddress;
1453
+ var _this_walletMap_accountAddress, _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups_BackupLocation_GOOGLE_DRIVE, _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups, _this_walletMap_accountAddress_clientKeySharesBackupInfo, _this_walletMap_accountAddress1;
1356
1454
  const keySharesToBackup = clientKeyShares != null ? clientKeyShares : await this.getClientKeySharesFromLocalStorage({
1357
1455
  accountAddress
1358
1456
  });
@@ -1375,7 +1473,7 @@ class DynamicWalletClient {
1375
1473
  keyShare,
1376
1474
  password
1377
1475
  })));
1378
- const hasExistingGoogleDriveBackup = this.walletMap[accountAddress].clientKeySharesBackupInfo.backups[core.BackupLocation.GOOGLE_DRIVE].length > 0;
1476
+ const hasExistingGoogleDriveBackup = ((_this_walletMap_accountAddress1 = this.walletMap[accountAddress]) == null ? void 0 : (_this_walletMap_accountAddress_clientKeySharesBackupInfo = _this_walletMap_accountAddress1.clientKeySharesBackupInfo) == null ? void 0 : (_this_walletMap_accountAddress_clientKeySharesBackupInfo_backups = _this_walletMap_accountAddress_clientKeySharesBackupInfo.backups) == null ? void 0 : (_this_walletMap_accountAddress_clientKeySharesBackupInfo_backups_BackupLocation_GOOGLE_DRIVE = _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups[core.BackupLocation.GOOGLE_DRIVE]) == null ? void 0 : _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups_BackupLocation_GOOGLE_DRIVE.length) > 0;
1379
1477
  // Backup to Google Drive if:
1380
1478
  // 1. Explicitly requested via flag, OR
1381
1479
  // 2. User already has Google Drive backups
@@ -1433,6 +1531,95 @@ class DynamicWalletClient {
1433
1531
  throw error;
1434
1532
  }
1435
1533
  }
1534
+ async storeEncryptedBackupByDelegatedWallet({ accountAddress, clientKeyShares = undefined, password = undefined, signedSessionId }) {
1535
+ try {
1536
+ var _this_walletMap_accountAddress, _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups_BackupLocation_EXTERNAL, _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups, _this_walletMap_accountAddress_clientKeySharesBackupInfo, _this_walletMap_accountAddress1;
1537
+ const keySharesToBackup = clientKeyShares != null ? clientKeyShares : await this.getClientKeySharesFromLocalStorage({
1538
+ accountAddress
1539
+ });
1540
+ if (!((_this_walletMap_accountAddress = this.walletMap[accountAddress]) == null ? void 0 : _this_walletMap_accountAddress.walletId)) {
1541
+ const error = new Error(`WalletId not found for accountAddress ${accountAddress}`);
1542
+ logError({
1543
+ message: '[DynamicWaasWalletClient] Error in storeEncryptedBackupByWallet, wallet or walletId not found from the wallet map',
1544
+ error,
1545
+ context: {
1546
+ accountAddress,
1547
+ walletMap: this.walletMap
1548
+ }
1549
+ });
1550
+ throw error;
1551
+ }
1552
+ let dynamicClientKeyShares = [];
1553
+ let delegatedKeyShares = [];
1554
+ const encryptedKeyShares = await Promise.all(keySharesToBackup.map((keyShare)=>this.encryptKeyShare({
1555
+ keyShare,
1556
+ password
1557
+ })));
1558
+ const hasExistingDelegatedBackup = ((_this_walletMap_accountAddress1 = this.walletMap[accountAddress]) == null ? void 0 : (_this_walletMap_accountAddress_clientKeySharesBackupInfo = _this_walletMap_accountAddress1.clientKeySharesBackupInfo) == null ? void 0 : (_this_walletMap_accountAddress_clientKeySharesBackupInfo_backups = _this_walletMap_accountAddress_clientKeySharesBackupInfo.backups) == null ? void 0 : (_this_walletMap_accountAddress_clientKeySharesBackupInfo_backups_BackupLocation_EXTERNAL = _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups[core.BackupLocation.EXTERNAL]) == null ? void 0 : _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups_BackupLocation_EXTERNAL.length) > 0;
1559
+ const shouldBackupToDelegated = hasExistingDelegatedBackup || keySharesToBackup.length >= 2;
1560
+ if (shouldBackupToDelegated) {
1561
+ // For 2 shares: 1 to backend, 1 to delegated
1562
+ // For 3+ shares: N-1 to backend, 1 to delegated
1563
+ dynamicClientKeyShares = encryptedKeyShares.slice(0, -core.DELEGATED_SHARE_COUNT);
1564
+ delegatedKeyShares = encryptedKeyShares.slice(-core.DELEGATED_SHARE_COUNT);
1565
+ } else {
1566
+ dynamicClientKeyShares = encryptedKeyShares;
1567
+ }
1568
+ const data = await this.apiClient.storeEncryptedBackupByWallet({
1569
+ walletId: this.walletMap[accountAddress].walletId,
1570
+ encryptedKeyShares: dynamicClientKeyShares,
1571
+ passwordEncrypted: Boolean(password) && password !== this.environmentId,
1572
+ encryptionVersion: ENCRYPTION_VERSION_CURRENT,
1573
+ signedSessionId
1574
+ });
1575
+ await this.apiClient.markKeySharesAsBackedUp({
1576
+ walletId: this.walletMap[accountAddress].walletId,
1577
+ location: core.BackupLocation.DYNAMIC
1578
+ });
1579
+ if (delegatedKeyShares.length > 0) {
1580
+ const wallet = this.walletMap[accountAddress];
1581
+ var _this_userId;
1582
+ const delegatedKeyShareIds = await this.sendKeySharesToDelegatedAccess({
1583
+ accountAddress,
1584
+ chainName: wallet.chainName,
1585
+ environmentId: this.environmentId,
1586
+ walletId: wallet.walletId,
1587
+ userId: (_this_userId = this.userId) != null ? _this_userId : '',
1588
+ delegatedKeyShares: delegatedKeyShares
1589
+ });
1590
+ data.keyShares.push({
1591
+ backupLocation: core.BackupLocation.EXTERNAL,
1592
+ id: delegatedKeyShareIds
1593
+ });
1594
+ //todo: combine with user share service backup once other branch is merged
1595
+ await this.apiClient.markKeySharesAsBackedUp({
1596
+ walletId: this.walletMap[accountAddress].walletId,
1597
+ location: core.BackupLocation.EXTERNAL
1598
+ });
1599
+ }
1600
+ const updatedBackupInfo = getClientKeyShareBackupInfo({
1601
+ walletProperties: {
1602
+ derivationPath: this.walletMap[accountAddress].derivationPath,
1603
+ keyShares: data.keyShares,
1604
+ thresholdSignatureScheme: this.walletMap[accountAddress].thresholdSignatureScheme
1605
+ }
1606
+ });
1607
+ this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress], {
1608
+ clientKeySharesBackupInfo: updatedBackupInfo
1609
+ });
1610
+ await this.storage.setItem(this.storageKey, JSON.stringify(this.walletMap));
1611
+ return data;
1612
+ } catch (error) {
1613
+ logError({
1614
+ message: '[DynamicWaasWalletClient] Error in storeEncryptedBackupByDelegatedWallet',
1615
+ error: error,
1616
+ context: {
1617
+ accountAddress
1618
+ }
1619
+ });
1620
+ throw error;
1621
+ }
1622
+ }
1436
1623
  async storeEncryptedBackupByWalletWithRetry({ accountAddress, clientKeyShares, password, signedSessionId }) {
1437
1624
  await retryPromise(()=>this.storeEncryptedBackupByWallet({
1438
1625
  accountAddress,
@@ -1528,7 +1715,7 @@ class DynamicWalletClient {
1528
1715
  requiredShareCount
1529
1716
  };
1530
1717
  }
1531
- async recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, signedSessionId, shareCount = undefined, storeRecoveredShares = true }) {
1718
+ async recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, signedSessionId, shareCount = undefined, storeRecoveredShares = true, mfaToken }) {
1532
1719
  try {
1533
1720
  const wallet = this.walletMap[accountAddress];
1534
1721
  this.logger.debug(`recoverEncryptedBackupByWallet wallet: ${walletOperation}`, wallet);
@@ -1542,7 +1729,8 @@ class DynamicWalletClient {
1542
1729
  const data = await this.apiClient.recoverEncryptedBackupByWallet({
1543
1730
  walletId: wallet.walletId,
1544
1731
  keyShareIds: dynamicKeyShareIds,
1545
- signedSessionId
1732
+ signedSessionId,
1733
+ mfaToken
1546
1734
  });
1547
1735
  const dynamicKeyShares = data.keyShares.filter((keyShare)=>keyShare.encryptedAccountCredential !== null && keyShare.backupLocation === core.BackupLocation.DYNAMIC);
1548
1736
  const decryptedKeyShares = await Promise.all(dynamicKeyShares.map((keyShare)=>this.decryptKeyShare({
@@ -2042,6 +2230,7 @@ class DynamicWalletClient {
2042
2230
  try {
2043
2231
  var _user_verifiedCredentials;
2044
2232
  const user = await this.apiClient.getUser();
2233
+ this.userId = user.id;
2045
2234
  const waasWallets = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.filter((vc)=>vc.walletName === 'dynamicwaas');
2046
2235
  const wallets = waasWallets.map((vc)=>{
2047
2236
  var _this_walletMap_vc_address, _vc_walletProperties;
@@ -2086,13 +2275,17 @@ class DynamicWalletClient {
2086
2275
  */ syncAuthToken(authToken) {
2087
2276
  this.apiClient.syncAuthToken(authToken);
2088
2277
  }
2089
- constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug }){
2278
+ constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug, featureFlags }){
2279
+ this.userId = undefined;
2280
+ this.sessionId = undefined;
2281
+ this.delegatedAccessEndpoint = undefined;
2090
2282
  this.initializePromise = null;
2091
2283
  this.logger = logger;
2092
2284
  this.walletMap = {} // todo: store in session storage
2093
2285
  ;
2094
2286
  this.memoryStorage = null;
2095
2287
  this.iframe = null;
2288
+ this.featureFlags = {};
2096
2289
  this.environmentId = environmentId;
2097
2290
  this.storageKey = `${STORAGE_KEY}-${storageKey != null ? storageKey : environmentId}`;
2098
2291
  this.baseMPCRelayApiUrl = baseMPCRelayApiUrl;
@@ -2103,6 +2296,7 @@ class DynamicWalletClient {
2103
2296
  });
2104
2297
  this.debug = Boolean(debug);
2105
2298
  this.logger.setLogLevel(this.debug ? logger$1.LogLevel.DEBUG : DEFAULT_LOG_LEVEL);
2299
+ this.featureFlags = featureFlags || {};
2106
2300
  // setup storage
2107
2301
  if (supportsLocalStorage()) {
2108
2302
  this.storage = localStorageAdapter;
package/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, BackupLocation, getClientThreshold, MPC_CONFIG, getTSSConfig, WalletOperation, getReshareConfig, ThresholdSignatureScheme, verifiedCredentialNameToChainEnum, DynamicApiClient, getEnvironmentFromUrl, IFRAME_DOMAIN_MAP } from '@dynamic-labs-wallet/core';
1
+ import { SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, BackupLocation, getClientThreshold, MPC_CONFIG, getTSSConfig, WalletOperation, getReshareConfig, FEATURE_FLAGS, ThresholdSignatureScheme, DELEGATED_SHARE_COUNT, verifiedCredentialNameToChainEnum, DynamicApiClient, getEnvironmentFromUrl, IFRAME_DOMAIN_MAP } from '@dynamic-labs-wallet/core';
2
2
  export * from '@dynamic-labs-wallet/core';
3
3
  import { v4 } from 'uuid';
4
4
  import { BIP340, ExportableEd25519, Ecdsa, MessageHash, EcdsaKeygenResult, ExportableEd25519KeygenResult, BIP340KeygenResult } from './internal/web';
@@ -106,12 +106,6 @@ const ensureBase64Padding = (str)=>{
106
106
  return str.padEnd(Math.ceil(str.length / 4) * 4, '=');
107
107
  };
108
108
  const isBrowser = ()=>typeof window !== 'undefined';
109
- const isHexString = (str)=>{
110
- // Remove 0x prefix if present
111
- const hex = str.startsWith('0x') ? str.slice(2) : str;
112
- // Check if string contains only hex characters
113
- return /^[0-9A-Fa-f]+$/.test(hex);
114
- };
115
109
  const getClientKeyShareExportFileName = ({ thresholdSignatureScheme, accountAddress })=>{
116
110
  return `${CLIENT_KEYSHARE_EXPORT_FILENAME_PREFIX}-${thresholdSignatureScheme}-${accountAddress}.json`;
117
111
  };
@@ -194,6 +188,12 @@ const formatEvmMessage = (message)=>{
194
188
  }
195
189
  return MessageHash.keccak256(message);
196
190
  };
191
+ const isHexString = (str)=>{
192
+ // Remove 0x prefix if present
193
+ const hex = str.startsWith('0x') ? str.slice(2) : str;
194
+ // Check if string contains only hex characters
195
+ return /^[0-9A-Fa-f]+$/.test(hex);
196
+ };
197
197
  const formatSolanaMessage = (message)=>{
198
198
  if (typeof message === 'string') {
199
199
  if (!isHexString(message)) {
@@ -619,6 +619,7 @@ class DynamicWalletClient {
619
619
  sessionId,
620
620
  userId
621
621
  });
622
+ this.sessionId = sessionId;
622
623
  } catch (error) {
623
624
  logError({
624
625
  message: '[DynamicWaasWalletClient] Error initializing logger context',
@@ -869,7 +870,7 @@ class DynamicWalletClient {
869
870
  throw error;
870
871
  }
871
872
  }
872
- async serverSign({ walletId, message, isFormatted }) {
873
+ async serverSign({ walletId, message, isFormatted, mfaToken }) {
873
874
  // Create the room and sign the message
874
875
  if (typeof message !== 'string') {
875
876
  message = `0x${Buffer.from(message).toString('hex')}`;
@@ -878,7 +879,8 @@ class DynamicWalletClient {
878
879
  walletId,
879
880
  message,
880
881
  isFormatted,
881
- dynamicRequestId: v4()
882
+ dynamicRequestId: v4(),
883
+ mfaToken
882
884
  });
883
885
  return data;
884
886
  }
@@ -913,7 +915,7 @@ class DynamicWalletClient {
913
915
  }
914
916
  }
915
917
  //todo: need to modify with imported flag
916
- async sign({ accountAddress, message, chainName, password = undefined, isFormatted = false, signedSessionId }) {
918
+ async sign({ accountAddress, message, chainName, password = undefined, isFormatted = false, signedSessionId, mfaToken }) {
917
919
  try {
918
920
  await this.verifyPassword({
919
921
  accountAddress,
@@ -931,7 +933,8 @@ class DynamicWalletClient {
931
933
  const data = await this.serverSign({
932
934
  walletId: wallet.walletId,
933
935
  message,
934
- isFormatted
936
+ isFormatted,
937
+ mfaToken
935
938
  });
936
939
  this.logger.debug('[DynamicWaasWalletClient] Server sign completed', {
937
940
  message,
@@ -973,7 +976,7 @@ class DynamicWalletClient {
973
976
  throw error;
974
977
  }
975
978
  }
976
- async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, signedSessionId }) {
979
+ async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, signedSessionId, mfaToken }) {
977
980
  const dynamicRequestId = v4();
978
981
  try {
979
982
  await this.verifyPassword({
@@ -995,7 +998,8 @@ class DynamicWalletClient {
995
998
  // Create the room and refresh the shares
996
999
  const data = await this.apiClient.refreshWalletAccountShares({
997
1000
  dynamicRequestId,
998
- walletId: wallet.walletId
1001
+ walletId: wallet.walletId,
1002
+ mfaToken
999
1003
  });
1000
1004
  const roomId = data.roomId;
1001
1005
  const clientKeyShares = await this.getClientKeySharesFromLocalStorage({
@@ -1076,7 +1080,7 @@ class DynamicWalletClient {
1076
1080
  existingClientKeyShares
1077
1081
  };
1078
1082
  }
1079
- async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined, signedSessionId, backupToGoogleDrive = false }) {
1083
+ async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined, signedSessionId, backupToGoogleDrive = false, delegateToProjectEnvironment = false, mfaToken }) {
1080
1084
  const dynamicRequestId = v4();
1081
1085
  try {
1082
1086
  await this.verifyPassword({
@@ -1113,7 +1117,9 @@ class DynamicWalletClient {
1113
1117
  clientKeygenIds: clientKeygenIds,
1114
1118
  oldThresholdSignatureScheme,
1115
1119
  newThresholdSignatureScheme,
1116
- dynamicRequestId
1120
+ dynamicRequestId,
1121
+ delegateToProjectEnvironment,
1122
+ mfaToken
1117
1123
  });
1118
1124
  const { roomId, serverKeygenIds, newServerKeygenIds = [] } = data;
1119
1125
  // Get the MPC config for the threshold signature scheme
@@ -1140,12 +1146,20 @@ class DynamicWalletClient {
1140
1146
  clientKeyShares: reshareResults,
1141
1147
  overwriteOrMerge: 'overwrite'
1142
1148
  });
1143
- await this.storeEncryptedBackupByWallet({
1144
- accountAddress,
1145
- password,
1146
- signedSessionId,
1147
- backupToGoogleDrive
1148
- });
1149
+ if (delegateToProjectEnvironment) {
1150
+ await this.storeEncryptedBackupByDelegatedWallet({
1151
+ accountAddress,
1152
+ password,
1153
+ signedSessionId
1154
+ });
1155
+ } else {
1156
+ await this.storeEncryptedBackupByWallet({
1157
+ accountAddress,
1158
+ password,
1159
+ signedSessionId,
1160
+ backupToGoogleDrive
1161
+ });
1162
+ }
1149
1163
  } catch (error) {
1150
1164
  logError({
1151
1165
  message: '[DynamicWaasWalletClient] Error in reshare',
@@ -1162,7 +1176,90 @@ class DynamicWalletClient {
1162
1176
  throw error;
1163
1177
  }
1164
1178
  }
1165
- async exportKey({ accountAddress, chainName, password = undefined, signedSessionId }) {
1179
+ async sendKeySharesToDelegatedAccess({ accountAddress, chainName, delegatedKeyShares, environmentId, userId, walletId }) {
1180
+ try {
1181
+ if (!this.delegatedAccessEndpoint) {
1182
+ throw new Error('Cannot send key shares to delegated access because delegated access endpoint is not set');
1183
+ }
1184
+ const delegatedAccessEndpoint = this.delegatedAccessEndpoint;
1185
+ const response = await fetch(delegatedAccessEndpoint, {
1186
+ method: 'POST',
1187
+ body: JSON.stringify({
1188
+ chainName,
1189
+ accountAddress,
1190
+ delegatedKeyShares,
1191
+ environmentId,
1192
+ userId,
1193
+ walletId
1194
+ })
1195
+ });
1196
+ const data = await response.json();
1197
+ return data;
1198
+ } catch (error) {
1199
+ logError({
1200
+ message: '[DynamicWaasWalletClient] Error in sendKeySharesToDelegatedAccess',
1201
+ error: error,
1202
+ context: {
1203
+ accountAddress,
1204
+ chainName
1205
+ }
1206
+ });
1207
+ throw error;
1208
+ }
1209
+ }
1210
+ async delegateKeyShares({ accountAddress, password = undefined, signedSessionId, mfaToken }) {
1211
+ try {
1212
+ const delegateToProjectEnvironment = this.featureFlags && this.featureFlags[FEATURE_FLAGS.ENABLE_DELEGATED_KEY_SHARES_FLAG] === true;
1213
+ if (!delegateToProjectEnvironment) {
1214
+ throw new Error('Delegation is not allowed for this project environment');
1215
+ }
1216
+ const environmentSettings = await this.apiClient.getEnvironmentSettings();
1217
+ const delegatedAccessEndpoint = environmentSettings.sdk.waas.delegatedAccessEndpoint;
1218
+ if (!delegatedAccessEndpoint) {
1219
+ throw new Error('Cannot delegate key shares because verified access endpoint is not set in the environment settings');
1220
+ }
1221
+ this.delegatedAccessEndpoint = delegatedAccessEndpoint;
1222
+ const wallet = await this.getWallet({
1223
+ accountAddress,
1224
+ walletOperation: WalletOperation.REACH_ALL_PARTIES,
1225
+ password,
1226
+ signedSessionId
1227
+ });
1228
+ if (wallet.chainName === 'SUI') {
1229
+ throw new Error('Delegation is not allowed for SUI');
1230
+ }
1231
+ const currentThresholdSignatureScheme = this.walletMap[accountAddress].thresholdSignatureScheme;
1232
+ if (currentThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO) {
1233
+ // Reshare to 2-of-3, which will automatically handle the backup distribution
1234
+ await this.reshare({
1235
+ chainName: this.walletMap[accountAddress].chainName,
1236
+ accountAddress,
1237
+ oldThresholdSignatureScheme: currentThresholdSignatureScheme,
1238
+ newThresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_THREE,
1239
+ password,
1240
+ signedSessionId,
1241
+ backupToGoogleDrive: false,
1242
+ delegateToProjectEnvironment: true,
1243
+ mfaToken
1244
+ });
1245
+ const backupInfo = this.walletMap[accountAddress].clientKeySharesBackupInfo;
1246
+ const delegatedKeyShares = backupInfo.backups[BackupLocation.EXTERNAL] || [];
1247
+ return delegatedKeyShares;
1248
+ } else {
1249
+ throw new Error('Delegation is not allowed for this threshold signature scheme');
1250
+ }
1251
+ } catch (error) {
1252
+ logError({
1253
+ message: '[DynamicWaasWalletClient] Error in delegateKeyShares',
1254
+ error: error,
1255
+ context: {
1256
+ accountAddress
1257
+ }
1258
+ });
1259
+ throw error;
1260
+ }
1261
+ }
1262
+ async exportKey({ accountAddress, chainName, password = undefined, signedSessionId, mfaToken }) {
1166
1263
  const dynamicRequestId = v4();
1167
1264
  try {
1168
1265
  const wallet = await this.getWallet({
@@ -1185,7 +1282,8 @@ class DynamicWalletClient {
1185
1282
  const data = await this.apiClient.exportKey({
1186
1283
  walletId: wallet.walletId,
1187
1284
  exportId,
1188
- dynamicRequestId
1285
+ dynamicRequestId,
1286
+ mfaToken
1189
1287
  });
1190
1288
  this.logger.debug('[DynamicWaasWalletClient] Starting export of private key', {
1191
1289
  accountAddress,
@@ -1353,7 +1451,7 @@ class DynamicWalletClient {
1353
1451
  * @returns Promise with backup metadata including share locations and IDs
1354
1452
  */ async storeEncryptedBackupByWallet({ accountAddress, clientKeyShares = undefined, password = undefined, signedSessionId, backupToGoogleDrive = false }) {
1355
1453
  try {
1356
- var _this_walletMap_accountAddress;
1454
+ var _this_walletMap_accountAddress, _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups_BackupLocation_GOOGLE_DRIVE, _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups, _this_walletMap_accountAddress_clientKeySharesBackupInfo, _this_walletMap_accountAddress1;
1357
1455
  const keySharesToBackup = clientKeyShares != null ? clientKeyShares : await this.getClientKeySharesFromLocalStorage({
1358
1456
  accountAddress
1359
1457
  });
@@ -1376,7 +1474,7 @@ class DynamicWalletClient {
1376
1474
  keyShare,
1377
1475
  password
1378
1476
  })));
1379
- const hasExistingGoogleDriveBackup = this.walletMap[accountAddress].clientKeySharesBackupInfo.backups[BackupLocation.GOOGLE_DRIVE].length > 0;
1477
+ const hasExistingGoogleDriveBackup = ((_this_walletMap_accountAddress1 = this.walletMap[accountAddress]) == null ? void 0 : (_this_walletMap_accountAddress_clientKeySharesBackupInfo = _this_walletMap_accountAddress1.clientKeySharesBackupInfo) == null ? void 0 : (_this_walletMap_accountAddress_clientKeySharesBackupInfo_backups = _this_walletMap_accountAddress_clientKeySharesBackupInfo.backups) == null ? void 0 : (_this_walletMap_accountAddress_clientKeySharesBackupInfo_backups_BackupLocation_GOOGLE_DRIVE = _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups[BackupLocation.GOOGLE_DRIVE]) == null ? void 0 : _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups_BackupLocation_GOOGLE_DRIVE.length) > 0;
1380
1478
  // Backup to Google Drive if:
1381
1479
  // 1. Explicitly requested via flag, OR
1382
1480
  // 2. User already has Google Drive backups
@@ -1434,6 +1532,95 @@ class DynamicWalletClient {
1434
1532
  throw error;
1435
1533
  }
1436
1534
  }
1535
+ async storeEncryptedBackupByDelegatedWallet({ accountAddress, clientKeyShares = undefined, password = undefined, signedSessionId }) {
1536
+ try {
1537
+ var _this_walletMap_accountAddress, _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups_BackupLocation_EXTERNAL, _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups, _this_walletMap_accountAddress_clientKeySharesBackupInfo, _this_walletMap_accountAddress1;
1538
+ const keySharesToBackup = clientKeyShares != null ? clientKeyShares : await this.getClientKeySharesFromLocalStorage({
1539
+ accountAddress
1540
+ });
1541
+ if (!((_this_walletMap_accountAddress = this.walletMap[accountAddress]) == null ? void 0 : _this_walletMap_accountAddress.walletId)) {
1542
+ const error = new Error(`WalletId not found for accountAddress ${accountAddress}`);
1543
+ logError({
1544
+ message: '[DynamicWaasWalletClient] Error in storeEncryptedBackupByWallet, wallet or walletId not found from the wallet map',
1545
+ error,
1546
+ context: {
1547
+ accountAddress,
1548
+ walletMap: this.walletMap
1549
+ }
1550
+ });
1551
+ throw error;
1552
+ }
1553
+ let dynamicClientKeyShares = [];
1554
+ let delegatedKeyShares = [];
1555
+ const encryptedKeyShares = await Promise.all(keySharesToBackup.map((keyShare)=>this.encryptKeyShare({
1556
+ keyShare,
1557
+ password
1558
+ })));
1559
+ const hasExistingDelegatedBackup = ((_this_walletMap_accountAddress1 = this.walletMap[accountAddress]) == null ? void 0 : (_this_walletMap_accountAddress_clientKeySharesBackupInfo = _this_walletMap_accountAddress1.clientKeySharesBackupInfo) == null ? void 0 : (_this_walletMap_accountAddress_clientKeySharesBackupInfo_backups = _this_walletMap_accountAddress_clientKeySharesBackupInfo.backups) == null ? void 0 : (_this_walletMap_accountAddress_clientKeySharesBackupInfo_backups_BackupLocation_EXTERNAL = _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups[BackupLocation.EXTERNAL]) == null ? void 0 : _this_walletMap_accountAddress_clientKeySharesBackupInfo_backups_BackupLocation_EXTERNAL.length) > 0;
1560
+ const shouldBackupToDelegated = hasExistingDelegatedBackup || keySharesToBackup.length >= 2;
1561
+ if (shouldBackupToDelegated) {
1562
+ // For 2 shares: 1 to backend, 1 to delegated
1563
+ // For 3+ shares: N-1 to backend, 1 to delegated
1564
+ dynamicClientKeyShares = encryptedKeyShares.slice(0, -DELEGATED_SHARE_COUNT);
1565
+ delegatedKeyShares = encryptedKeyShares.slice(-DELEGATED_SHARE_COUNT);
1566
+ } else {
1567
+ dynamicClientKeyShares = encryptedKeyShares;
1568
+ }
1569
+ const data = await this.apiClient.storeEncryptedBackupByWallet({
1570
+ walletId: this.walletMap[accountAddress].walletId,
1571
+ encryptedKeyShares: dynamicClientKeyShares,
1572
+ passwordEncrypted: Boolean(password) && password !== this.environmentId,
1573
+ encryptionVersion: ENCRYPTION_VERSION_CURRENT,
1574
+ signedSessionId
1575
+ });
1576
+ await this.apiClient.markKeySharesAsBackedUp({
1577
+ walletId: this.walletMap[accountAddress].walletId,
1578
+ location: BackupLocation.DYNAMIC
1579
+ });
1580
+ if (delegatedKeyShares.length > 0) {
1581
+ const wallet = this.walletMap[accountAddress];
1582
+ var _this_userId;
1583
+ const delegatedKeyShareIds = await this.sendKeySharesToDelegatedAccess({
1584
+ accountAddress,
1585
+ chainName: wallet.chainName,
1586
+ environmentId: this.environmentId,
1587
+ walletId: wallet.walletId,
1588
+ userId: (_this_userId = this.userId) != null ? _this_userId : '',
1589
+ delegatedKeyShares: delegatedKeyShares
1590
+ });
1591
+ data.keyShares.push({
1592
+ backupLocation: BackupLocation.EXTERNAL,
1593
+ id: delegatedKeyShareIds
1594
+ });
1595
+ //todo: combine with user share service backup once other branch is merged
1596
+ await this.apiClient.markKeySharesAsBackedUp({
1597
+ walletId: this.walletMap[accountAddress].walletId,
1598
+ location: BackupLocation.EXTERNAL
1599
+ });
1600
+ }
1601
+ const updatedBackupInfo = getClientKeyShareBackupInfo({
1602
+ walletProperties: {
1603
+ derivationPath: this.walletMap[accountAddress].derivationPath,
1604
+ keyShares: data.keyShares,
1605
+ thresholdSignatureScheme: this.walletMap[accountAddress].thresholdSignatureScheme
1606
+ }
1607
+ });
1608
+ this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress], {
1609
+ clientKeySharesBackupInfo: updatedBackupInfo
1610
+ });
1611
+ await this.storage.setItem(this.storageKey, JSON.stringify(this.walletMap));
1612
+ return data;
1613
+ } catch (error) {
1614
+ logError({
1615
+ message: '[DynamicWaasWalletClient] Error in storeEncryptedBackupByDelegatedWallet',
1616
+ error: error,
1617
+ context: {
1618
+ accountAddress
1619
+ }
1620
+ });
1621
+ throw error;
1622
+ }
1623
+ }
1437
1624
  async storeEncryptedBackupByWalletWithRetry({ accountAddress, clientKeyShares, password, signedSessionId }) {
1438
1625
  await retryPromise(()=>this.storeEncryptedBackupByWallet({
1439
1626
  accountAddress,
@@ -1529,7 +1716,7 @@ class DynamicWalletClient {
1529
1716
  requiredShareCount
1530
1717
  };
1531
1718
  }
1532
- async recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, signedSessionId, shareCount = undefined, storeRecoveredShares = true }) {
1719
+ async recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, signedSessionId, shareCount = undefined, storeRecoveredShares = true, mfaToken }) {
1533
1720
  try {
1534
1721
  const wallet = this.walletMap[accountAddress];
1535
1722
  this.logger.debug(`recoverEncryptedBackupByWallet wallet: ${walletOperation}`, wallet);
@@ -1543,7 +1730,8 @@ class DynamicWalletClient {
1543
1730
  const data = await this.apiClient.recoverEncryptedBackupByWallet({
1544
1731
  walletId: wallet.walletId,
1545
1732
  keyShareIds: dynamicKeyShareIds,
1546
- signedSessionId
1733
+ signedSessionId,
1734
+ mfaToken
1547
1735
  });
1548
1736
  const dynamicKeyShares = data.keyShares.filter((keyShare)=>keyShare.encryptedAccountCredential !== null && keyShare.backupLocation === BackupLocation.DYNAMIC);
1549
1737
  const decryptedKeyShares = await Promise.all(dynamicKeyShares.map((keyShare)=>this.decryptKeyShare({
@@ -2043,6 +2231,7 @@ class DynamicWalletClient {
2043
2231
  try {
2044
2232
  var _user_verifiedCredentials;
2045
2233
  const user = await this.apiClient.getUser();
2234
+ this.userId = user.id;
2046
2235
  const waasWallets = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.filter((vc)=>vc.walletName === 'dynamicwaas');
2047
2236
  const wallets = waasWallets.map((vc)=>{
2048
2237
  var _this_walletMap_vc_address, _vc_walletProperties;
@@ -2087,13 +2276,17 @@ class DynamicWalletClient {
2087
2276
  */ syncAuthToken(authToken) {
2088
2277
  this.apiClient.syncAuthToken(authToken);
2089
2278
  }
2090
- constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug }){
2279
+ constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug, featureFlags }){
2280
+ this.userId = undefined;
2281
+ this.sessionId = undefined;
2282
+ this.delegatedAccessEndpoint = undefined;
2091
2283
  this.initializePromise = null;
2092
2284
  this.logger = logger;
2093
2285
  this.walletMap = {} // todo: store in session storage
2094
2286
  ;
2095
2287
  this.memoryStorage = null;
2096
2288
  this.iframe = null;
2289
+ this.featureFlags = {};
2097
2290
  this.environmentId = environmentId;
2098
2291
  this.storageKey = `${STORAGE_KEY}-${storageKey != null ? storageKey : environmentId}`;
2099
2292
  this.baseMPCRelayApiUrl = baseMPCRelayApiUrl;
@@ -2104,6 +2297,7 @@ class DynamicWalletClient {
2104
2297
  });
2105
2298
  this.debug = Boolean(debug);
2106
2299
  this.logger.setLogLevel(this.debug ? LogLevel.DEBUG : DEFAULT_LOG_LEVEL);
2300
+ this.featureFlags = featureFlags || {};
2107
2301
  // setup storage
2108
2302
  if (supportsLocalStorage()) {
2109
2303
  this.storage = localStorageAdapter;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/browser",
3
- "version": "0.0.121",
3
+ "version": "0.0.123",
4
4
  "license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
5
5
  "type": "commonjs",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/core": "0.0.121",
7
+ "@dynamic-labs-wallet/core": "0.0.123",
8
8
  "@dynamic-labs/logger": "^4.9.9",
9
9
  "@dynamic-labs/sdk-api-core": "^0.0.663",
10
10
  "axios": "1.9.0",
package/src/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { BackupLocation, DynamicApiClient, type DynamicWalletClientProps, type InitializeResult, type KeyShareBackupInfo, ThresholdSignatureScheme, WalletOperation } from '@dynamic-labs-wallet/core';
2
- import { BIP340KeygenResult, EcdsaKeygenResult, type EcdsaPublicKey, type EcdsaSignature, ExportableEd25519 } from '../../internal/web';
1
+ import { BackupLocation, DynamicApiClient, type DynamicWalletClientProps, FeatureFlags, type InitializeResult, type KeyShareBackupInfo, ThresholdSignatureScheme, WalletOperation } from '@dynamic-labs-wallet/core';
2
+ import { BIP340KeygenResult, EcdsaKeygenResult, type EcdsaPublicKey, type EcdsaSignature, ExportableEd25519KeygenResult } from '../../internal/web';
3
3
  import type { ClientInitKeygenResult, ClientKeyShare } from './mpc/types';
4
4
  import { type SupportedStorage } from './services/localStorage';
5
5
  import type { WalletProperties } from './types';
@@ -7,6 +7,9 @@ export declare class DynamicWalletClient {
7
7
  environmentId: string;
8
8
  storageKey: string;
9
9
  debug: boolean;
10
+ protected userId: string | undefined;
11
+ protected sessionId: string | undefined;
12
+ protected delegatedAccessEndpoint: string | undefined;
10
13
  protected initializePromise: Promise<InitializeResult> | null;
11
14
  protected logger: import("@dynamic-labs/logger").Logger;
12
15
  protected apiClient: DynamicApiClient;
@@ -19,7 +22,8 @@ export declare class DynamicWalletClient {
19
22
  protected iframe: HTMLIFrameElement | null;
20
23
  readonly instanceId: string;
21
24
  readonly iframeDomain: string;
22
- constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug, }: DynamicWalletClientProps);
25
+ readonly featureFlags: FeatureFlags;
26
+ constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug, featureFlags, }: DynamicWalletClientProps);
23
27
  initLoggerContext(authToken: string): Promise<void>;
24
28
  initialize(): Promise<InitializeResult>;
25
29
  /**
@@ -72,10 +76,11 @@ export declare class DynamicWalletClient {
72
76
  rawPublicKey: EcdsaPublicKey | Uint8Array | string | undefined;
73
77
  clientKeyShares: ClientKeyShare[];
74
78
  }>;
75
- serverSign({ walletId, message, isFormatted, }: {
79
+ serverSign({ walletId, message, isFormatted, mfaToken, }: {
76
80
  walletId: string;
77
81
  message: string | Uint8Array;
78
82
  isFormatted?: boolean;
83
+ mfaToken?: string;
79
84
  }): Promise<import("@dynamic-labs-wallet/core").OpenRoomResponse>;
80
85
  clientSign({ chainName, message, roomId, keyShare, derivationPath, isFormatted, }: {
81
86
  chainName: string;
@@ -85,23 +90,25 @@ export declare class DynamicWalletClient {
85
90
  derivationPath: Uint32Array | undefined;
86
91
  isFormatted?: boolean;
87
92
  }): Promise<Uint8Array | EcdsaSignature>;
88
- sign({ accountAddress, message, chainName, password, isFormatted, signedSessionId, }: {
93
+ sign({ accountAddress, message, chainName, password, isFormatted, signedSessionId, mfaToken, }: {
89
94
  accountAddress: string;
90
95
  message: string | Uint8Array;
91
96
  chainName: string;
92
97
  password?: string;
93
98
  isFormatted?: boolean;
94
99
  signedSessionId: string;
100
+ mfaToken?: string;
95
101
  }): Promise<Uint8Array | EcdsaSignature>;
96
- refreshWalletAccountShares({ accountAddress, chainName, password, signedSessionId, }: {
102
+ refreshWalletAccountShares({ accountAddress, chainName, password, signedSessionId, mfaToken, }: {
97
103
  accountAddress: string;
98
104
  chainName: string;
99
105
  password?: string;
100
106
  signedSessionId: string;
107
+ mfaToken?: string;
101
108
  }): Promise<void>;
102
109
  getExportId({ chainName, clientKeyShare, }: {
103
110
  chainName: string;
104
- clientKeyShare: EcdsaKeygenResult | ExportableEd25519 | BIP340KeygenResult;
111
+ clientKeyShare: EcdsaKeygenResult | ExportableEd25519KeygenResult | BIP340KeygenResult;
105
112
  }): Promise<string>;
106
113
  /**
107
114
  * Helper function to create client shares required to complete a reshare ceremony.
@@ -129,7 +136,7 @@ export declare class DynamicWalletClient {
129
136
  existingClientKeygenIds: string[];
130
137
  existingClientKeyShares: ClientKeyShare[];
131
138
  }>;
132
- reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId, backupToGoogleDrive, }: {
139
+ reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId, backupToGoogleDrive, delegateToProjectEnvironment, mfaToken, }: {
133
140
  chainName: string;
134
141
  accountAddress: string;
135
142
  oldThresholdSignatureScheme: ThresholdSignatureScheme;
@@ -137,12 +144,29 @@ export declare class DynamicWalletClient {
137
144
  password?: string;
138
145
  signedSessionId: string;
139
146
  backupToGoogleDrive?: boolean;
147
+ delegateToProjectEnvironment?: boolean;
148
+ mfaToken?: string;
140
149
  }): Promise<void>;
141
- exportKey({ accountAddress, chainName, password, signedSessionId, }: {
150
+ sendKeySharesToDelegatedAccess({ accountAddress, chainName, delegatedKeyShares, environmentId, userId, walletId, }: {
142
151
  accountAddress: string;
143
152
  chainName: string;
153
+ delegatedKeyShares: string[];
154
+ environmentId: string;
155
+ userId: string;
156
+ walletId: string;
157
+ }): Promise<any>;
158
+ delegateKeyShares({ accountAddress, password, signedSessionId, mfaToken, }: {
159
+ accountAddress: string;
144
160
  password?: string;
145
161
  signedSessionId: string;
162
+ mfaToken?: string;
163
+ }): Promise<string[]>;
164
+ exportKey({ accountAddress, chainName, password, signedSessionId, mfaToken, }: {
165
+ accountAddress: string;
166
+ chainName: string;
167
+ password?: string;
168
+ signedSessionId: string;
169
+ mfaToken?: string;
146
170
  }): Promise<{
147
171
  derivedPrivateKey: string | undefined;
148
172
  }>;
@@ -206,6 +230,12 @@ export declare class DynamicWalletClient {
206
230
  signedSessionId: string;
207
231
  backupToGoogleDrive?: boolean;
208
232
  }): Promise<any>;
233
+ storeEncryptedBackupByDelegatedWallet({ accountAddress, clientKeyShares, password, signedSessionId, }: {
234
+ accountAddress: string;
235
+ clientKeyShares?: ClientKeyShare[];
236
+ password?: string;
237
+ signedSessionId: string;
238
+ }): Promise<any>;
209
239
  storeEncryptedBackupByWalletWithRetry({ accountAddress, clientKeyShares, password, signedSessionId, }: {
210
240
  accountAddress: string;
211
241
  clientKeyShares?: ClientKeyShare[];
@@ -250,13 +280,14 @@ export declare class DynamicWalletClient {
250
280
  shares: Partial<Record<BackupLocation, string[]>>;
251
281
  requiredShareCount: number;
252
282
  };
253
- recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, signedSessionId, shareCount, storeRecoveredShares, }: {
283
+ recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, signedSessionId, shareCount, storeRecoveredShares, mfaToken, }: {
254
284
  accountAddress: string;
255
285
  password?: string;
256
286
  walletOperation: WalletOperation;
257
287
  signedSessionId: string;
258
288
  shareCount?: number;
259
289
  storeRecoveredShares?: boolean;
290
+ mfaToken?: string;
260
291
  }): Promise<any[]>;
261
292
  restoreWallets(): Promise<void>;
262
293
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,cAAc,EACd,gBAAgB,EAChB,KAAK,wBAAwB,EAO7B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAEvB,wBAAwB,EAExB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,kBAAkB,EAElB,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,iBAAiB,EAGlB,MAAM,eAAe,CAAC;AAmBvB,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAGL,KAAK,gBAAgB,EAEtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAWhD,qBAAa,mBAAmB;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IAEtB,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAQ;IACrE,SAAS,CAAC,MAAM,wCAAU;IAC1B,SAAS,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACtC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAM;IAC3D,SAAS,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACpC,SAAS,CAAC,aAAa,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;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AE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;KACzB;IAiGK,UAAU;IA6ChB;;;OAGG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM;CAGhC"}
package/src/utils.d.ts CHANGED
@@ -1,13 +1,12 @@
1
1
  import { type KeyShareBackupInfo, type ThresholdSignatureScheme, type WaasWalletProperties } from '@dynamic-labs-wallet/core';
2
2
  import type { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';
3
- import { MessageHash } from '../../internal/web';
4
3
  import type { ClientKeyShare } from './mpc/types';
4
+ import { MessageHash } from '../../internal/web';
5
5
  export declare const bytesToBase64: (arr: Uint8Array) => string;
6
6
  export declare const stringToBytes: (str: string) => Uint8Array;
7
7
  export declare const base64ToBytes: (base64: string) => Uint8Array;
8
8
  export declare const ensureBase64Padding: (str: string) => string;
9
9
  export declare const isBrowser: () => boolean;
10
- export declare const isHexString: (str: string) => boolean;
11
10
  export declare const getClientKeyShareExportFileName: ({ thresholdSignatureScheme, accountAddress, }: {
12
11
  thresholdSignatureScheme: ThresholdSignatureScheme;
13
12
  accountAddress: string;
@@ -42,6 +41,7 @@ interface RetryConfig {
42
41
  */
43
42
  export declare function retryPromise<T>(operation: () => Promise<T>, { maxAttempts, retryInterval, operationName, logContext, }?: RetryConfig): Promise<T>;
44
43
  export declare const formatEvmMessage: (message: string | Uint8Array) => MessageHash;
44
+ export declare const isHexString: (str: string) => boolean;
45
45
  export declare const formatMessage: (chainName: string, message: string | Uint8Array) => string | Uint8Array | MessageHash;
46
46
  export declare const getGoogleOAuthAccountId: (verifiedCredentials: JwtVerifiedCredential[]) => string | undefined;
47
47
  export declare const createBackupData: ({ encryptedKeyShares, accountAddress, thresholdSignatureScheme, hasPassword, }: {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB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