@dynamic-labs-wallet/browser 0.0.66 → 0.0.67
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 +148 -53
- package/index.esm.js +147 -54
- package/package.json +5 -2
- package/src/backup/providers/googleDrive.d.ts +4 -4
- package/src/backup/providers/googleDrive.d.ts.map +1 -1
- package/src/backup/utils.d.ts +37 -0
- package/src/backup/utils.d.ts.map +1 -0
- package/src/client.d.ts +10 -7
- package/src/client.d.ts.map +1 -1
- package/src/utils.d.ts +27 -2
- package/src/utils.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@dynamic-labs-wallet/core');
|
|
4
4
|
var web = require('./internal/web');
|
|
5
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
5
6
|
var logger$1 = require('@dynamic-labs/logger');
|
|
6
7
|
var messageTransport = require('@dynamic-labs/message-transport');
|
|
7
8
|
|
|
@@ -130,7 +131,9 @@ const timeoutPromise = ({ timeInMs, activity = 'Ceremony' })=>{
|
|
|
130
131
|
}));
|
|
131
132
|
throw error;
|
|
132
133
|
}
|
|
133
|
-
|
|
134
|
+
// Calculate exponential backoff delay
|
|
135
|
+
const exponentialDelay = retryInterval * 2 ** (attempts - 1);
|
|
136
|
+
await new Promise((resolve)=>setTimeout(resolve, exponentialDelay));
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
139
|
// TypeScript needs this even though it's unreachable
|
|
@@ -166,6 +169,30 @@ const formatMessage = (chainName, message)=>{
|
|
|
166
169
|
throw new Error('Unsupported chain name');
|
|
167
170
|
}
|
|
168
171
|
};
|
|
172
|
+
const getGoogleOAuthAccountId = (verifiedCredentials)=>{
|
|
173
|
+
const googleVerifiedCredential = verifiedCredentials == null ? void 0 : verifiedCredentials.find((credential)=>credential.oauthProvider === sdkApiCore.ProviderEnum.Google);
|
|
174
|
+
return googleVerifiedCredential == null ? void 0 : googleVerifiedCredential.id;
|
|
175
|
+
};
|
|
176
|
+
const createBackupData = ({ encryptedKeyShares, accountAddress, thresholdSignatureScheme, hasPassword = true })=>{
|
|
177
|
+
return {
|
|
178
|
+
keyShares: encryptedKeyShares,
|
|
179
|
+
metadata: {
|
|
180
|
+
version: '1.0',
|
|
181
|
+
createdAt: new Date().toISOString(),
|
|
182
|
+
accountAddress,
|
|
183
|
+
thresholdSignatureScheme,
|
|
184
|
+
hasPassword,
|
|
185
|
+
encryption: {
|
|
186
|
+
algorithm: AES_GCM_ALGORITHM,
|
|
187
|
+
keyDerivation: PBKDF2_ALGORITHM,
|
|
188
|
+
iterations: PBKDF2_ITERATIONS,
|
|
189
|
+
hashAlgorithm: PBKDF2_HASH_ALGORITHM,
|
|
190
|
+
algorithmLength: AES_GCM_LENGTH
|
|
191
|
+
},
|
|
192
|
+
shareCount: encryptedKeyShares.length
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
};
|
|
169
196
|
|
|
170
197
|
const PBKDF2_ALGORITHM = 'PBKDF2';
|
|
171
198
|
const PBKDF2_ITERATIONS = 100000;
|
|
@@ -293,9 +320,9 @@ const uploadFileToGoogleDrive = async ({ accessToken, fileName, jsonData, parent
|
|
|
293
320
|
const result = await response.json();
|
|
294
321
|
return result; // Return file metadata, including file ID
|
|
295
322
|
};
|
|
296
|
-
const listFilesFromGoogleDrive = async ({ accessToken,
|
|
323
|
+
const listFilesFromGoogleDrive = async ({ accessToken, fileName })=>{
|
|
297
324
|
// Step 1: List all files inside `appDataFolder` with the specified backup filename
|
|
298
|
-
const resp = await fetch(`${GOOGLE_DRIVE_UPLOAD_API}/drive/v3/files?q=${encodeURIComponent(`name='${
|
|
325
|
+
const resp = await fetch(`${GOOGLE_DRIVE_UPLOAD_API}/drive/v3/files?q=${encodeURIComponent(`name='${fileName}'`)}&spaces=appDataFolder&orderBy=createdTime desc`, {
|
|
299
326
|
headers: {
|
|
300
327
|
Authorization: `Bearer ${accessToken}`
|
|
301
328
|
}
|
|
@@ -308,10 +335,10 @@ const listFilesFromGoogleDrive = async ({ accessToken, name })=>{
|
|
|
308
335
|
const files = data.files;
|
|
309
336
|
return files;
|
|
310
337
|
};
|
|
311
|
-
const downloadFileFromGoogleDrive = async ({ accessToken,
|
|
338
|
+
const downloadFileFromGoogleDrive = async ({ accessToken, fileName })=>{
|
|
312
339
|
const files = await listFilesFromGoogleDrive({
|
|
313
340
|
accessToken,
|
|
314
|
-
|
|
341
|
+
fileName
|
|
315
342
|
});
|
|
316
343
|
if (!files || files.length === 0) {
|
|
317
344
|
return null;
|
|
@@ -489,6 +516,56 @@ class IframeDisplayChannelAdapter {
|
|
|
489
516
|
}
|
|
490
517
|
}
|
|
491
518
|
|
|
519
|
+
/**
|
|
520
|
+
* Updates the wallet map with backup information after successful backup to Google Drive
|
|
521
|
+
* @param data - Response data containing key shares information
|
|
522
|
+
* @param walletMap - The wallet map to update
|
|
523
|
+
* @param accountAddress - The account address associated with the wallet
|
|
524
|
+
* @param backupLocation - The location where the backup is stored
|
|
525
|
+
* @param storage - Storage interface for persisting the updated wallet map
|
|
526
|
+
* @param storageKey - Key used to store the wallet map
|
|
527
|
+
* @returns The array of key share IDs that were backed up
|
|
528
|
+
*/ const updateWalletMapWithBackupInfo = async ({ data, walletMap, accountAddress, storage, storageKey })=>{
|
|
529
|
+
const ids = data.keyShares.map((keyShare)=>keyShare.id);
|
|
530
|
+
walletMap[accountAddress].clientKeySharesBackupInfo.backups[core.BackupLocation.GOOGLE_DRIVE] = ids;
|
|
531
|
+
await storage.setItem(storageKey, JSON.stringify(walletMap));
|
|
532
|
+
return ids;
|
|
533
|
+
};
|
|
534
|
+
/**
|
|
535
|
+
* Uploads a backup to Google Drive App
|
|
536
|
+
* @param accessToken - The access token for the Google Drive API
|
|
537
|
+
* @param fileName - The name of the file to upload
|
|
538
|
+
* @param backupData - The data to upload
|
|
539
|
+
* @param accountAddress - The account address associated with the backup
|
|
540
|
+
*/ const uploadBackupToGoogleDrive = async ({ accessToken, fileName, backupData, accountAddress })=>{
|
|
541
|
+
try {
|
|
542
|
+
await retryPromise(()=>uploadFileToGoogleDriveAppStorage({
|
|
543
|
+
accessToken,
|
|
544
|
+
fileName,
|
|
545
|
+
jsonData: backupData
|
|
546
|
+
}));
|
|
547
|
+
} catch (error) {
|
|
548
|
+
logger.error('Failed to upload keyshares to Google Drive App Storage', {
|
|
549
|
+
accountAddress,
|
|
550
|
+
error
|
|
551
|
+
});
|
|
552
|
+
throw new Error(`Failed to backup keyshares to Google Drive App Storage: ${error instanceof Error ? error.message : String(error)}`);
|
|
553
|
+
}
|
|
554
|
+
try {
|
|
555
|
+
await retryPromise(()=>uploadFileToGoogleDrivePersonal({
|
|
556
|
+
accessToken,
|
|
557
|
+
fileName,
|
|
558
|
+
jsonData: backupData
|
|
559
|
+
}));
|
|
560
|
+
} catch (error) {
|
|
561
|
+
logger.error('Failed to upload keyshares to Google Drive Personal', {
|
|
562
|
+
accountAddress,
|
|
563
|
+
error
|
|
564
|
+
});
|
|
565
|
+
throw new Error(`Failed to backup keyshares to Google Drive Personal: ${error instanceof Error ? error.message : String(error)}`);
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
|
|
492
569
|
class DynamicWalletClient {
|
|
493
570
|
async initialize() {
|
|
494
571
|
if (this.initializePromise) {
|
|
@@ -1206,13 +1283,9 @@ class DynamicWalletClient {
|
|
|
1206
1283
|
});
|
|
1207
1284
|
const hasGoogleDriveBackup = this.walletMap[accountAddress].clientKeySharesBackupInfo.backups[core.BackupLocation.GOOGLE_DRIVE].length > 0;
|
|
1208
1285
|
if (hasGoogleDriveBackup) {
|
|
1209
|
-
var _user_verifiedCredentials_find;
|
|
1210
|
-
const user = await this.apiClient.getUser();
|
|
1211
|
-
const oauthAccountId = user == null ? void 0 : (_user_verifiedCredentials_find = user.verifiedCredentials.find((credential)=>credential.oauthProvider === 'google')) == null ? void 0 : _user_verifiedCredentials_find.id;
|
|
1212
1286
|
const googleDriveKeyShareIds = await this.backupKeySharesToGoogleDrive({
|
|
1213
1287
|
accountAddress,
|
|
1214
|
-
password
|
|
1215
|
-
oauthAccountId
|
|
1288
|
+
password
|
|
1216
1289
|
});
|
|
1217
1290
|
data.keyShares.push({
|
|
1218
1291
|
backupLocation: core.BackupLocation.GOOGLE_DRIVE,
|
|
@@ -1269,6 +1342,23 @@ class DynamicWalletClient {
|
|
|
1269
1342
|
return deserializedKeyShare;
|
|
1270
1343
|
}
|
|
1271
1344
|
/**
|
|
1345
|
+
* Helper function to get Google OAuth Account ID or throw an error if not found.
|
|
1346
|
+
* @param accountAddress - The account address for logging purposes
|
|
1347
|
+
* @returns The Google OAuth Account ID
|
|
1348
|
+
* @throws Error if no Google OAuth account ID is found
|
|
1349
|
+
*/ async getGoogleOauthAccountIdOrThrow(accountAddress) {
|
|
1350
|
+
const user = await this.apiClient.getUser();
|
|
1351
|
+
const oauthAccountId = getGoogleOAuthAccountId(user == null ? void 0 : user.verifiedCredentials);
|
|
1352
|
+
if (!oauthAccountId) {
|
|
1353
|
+
this.logger.error('No Google OAuth account ID found', {
|
|
1354
|
+
user,
|
|
1355
|
+
accountAddress
|
|
1356
|
+
});
|
|
1357
|
+
throw new Error('No Google OAuth account ID found');
|
|
1358
|
+
}
|
|
1359
|
+
return oauthAccountId;
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1272
1362
|
* Helper function to determine keyshare recovery strategy for dynamic shares.
|
|
1273
1363
|
* For REFRESH operations, retrieves enough shares to meet the client threshold.
|
|
1274
1364
|
* For all other operations, retrieves just 1 share.
|
|
@@ -1331,7 +1421,7 @@ class DynamicWalletClient {
|
|
|
1331
1421
|
}
|
|
1332
1422
|
this.walletMap = JSON.parse(wallets);
|
|
1333
1423
|
}
|
|
1334
|
-
async backupKeySharesToGoogleDrive({ accountAddress,
|
|
1424
|
+
async backupKeySharesToGoogleDrive({ accountAddress, password }) {
|
|
1335
1425
|
await this.getWallet({
|
|
1336
1426
|
accountAddress,
|
|
1337
1427
|
walletOperation: core.WalletOperation.REACH_ALL_PARTIES,
|
|
@@ -1347,74 +1437,77 @@ class DynamicWalletClient {
|
|
|
1347
1437
|
keyShare,
|
|
1348
1438
|
password
|
|
1349
1439
|
})));
|
|
1440
|
+
const oauthAccountId = await this.getGoogleOauthAccountIdOrThrow(accountAddress);
|
|
1350
1441
|
const accessToken = await this.apiClient.getAccessToken({
|
|
1351
1442
|
oauthAccountId
|
|
1352
1443
|
});
|
|
1353
1444
|
const thresholdSignatureScheme = this.walletMap[accountAddress].thresholdSignatureScheme;
|
|
1354
|
-
const
|
|
1445
|
+
const fileName = getClientKeyShareExportFileName({
|
|
1355
1446
|
thresholdSignatureScheme,
|
|
1356
1447
|
accountAddress
|
|
1357
1448
|
});
|
|
1358
|
-
const backupData = {
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
iterations: PBKDF2_ITERATIONS,
|
|
1370
|
-
hashAlgorithm: PBKDF2_HASH_ALGORITHM,
|
|
1371
|
-
algorithmLength: AES_GCM_LENGTH
|
|
1372
|
-
},
|
|
1373
|
-
shareCount: encryptedKeyShares.length
|
|
1374
|
-
}
|
|
1375
|
-
};
|
|
1376
|
-
// TODO: handle errors
|
|
1377
|
-
await Promise.all([
|
|
1378
|
-
uploadFileToGoogleDriveAppStorage({
|
|
1379
|
-
accessToken,
|
|
1380
|
-
fileName: fileName != null ? fileName : suggestedFileName,
|
|
1381
|
-
jsonData: backupData
|
|
1382
|
-
}),
|
|
1383
|
-
uploadFileToGoogleDrivePersonal({
|
|
1384
|
-
accessToken,
|
|
1385
|
-
fileName: fileName != null ? fileName : suggestedFileName,
|
|
1386
|
-
jsonData: backupData
|
|
1387
|
-
})
|
|
1388
|
-
]);
|
|
1449
|
+
const backupData = createBackupData({
|
|
1450
|
+
encryptedKeyShares,
|
|
1451
|
+
accountAddress,
|
|
1452
|
+
thresholdSignatureScheme
|
|
1453
|
+
});
|
|
1454
|
+
await uploadBackupToGoogleDrive({
|
|
1455
|
+
accessToken,
|
|
1456
|
+
fileName,
|
|
1457
|
+
backupData,
|
|
1458
|
+
accountAddress
|
|
1459
|
+
});
|
|
1389
1460
|
const data = await this.apiClient.markKeySharesAsBackedUpGoogleDrive({
|
|
1390
1461
|
walletId: this.walletMap[accountAddress].walletId
|
|
1391
1462
|
});
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1463
|
+
await updateWalletMapWithBackupInfo({
|
|
1464
|
+
data,
|
|
1465
|
+
walletMap: this.walletMap,
|
|
1466
|
+
accountAddress,
|
|
1467
|
+
storage: this.storage,
|
|
1468
|
+
storageKey: this.storageKey
|
|
1469
|
+
});
|
|
1396
1470
|
}
|
|
1397
|
-
async restoreBackupFromGoogleDrive({ accountAddress,
|
|
1471
|
+
async restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password }) {
|
|
1398
1472
|
await this.getWallet({
|
|
1399
1473
|
accountAddress
|
|
1400
1474
|
});
|
|
1475
|
+
const oauthAccountId = await this.getGoogleOauthAccountIdOrThrow(accountAddress);
|
|
1401
1476
|
const accessToken = await this.apiClient.getAccessToken({
|
|
1402
1477
|
oauthAccountId
|
|
1403
1478
|
});
|
|
1404
1479
|
const thresholdSignatureScheme = this.walletMap[accountAddress].thresholdSignatureScheme;
|
|
1405
|
-
const
|
|
1480
|
+
const fileName = getClientKeyShareExportFileName({
|
|
1406
1481
|
thresholdSignatureScheme,
|
|
1407
1482
|
accountAddress
|
|
1408
1483
|
});
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1484
|
+
let backupData = null;
|
|
1485
|
+
try {
|
|
1486
|
+
backupData = await retryPromise(()=>downloadFileFromGoogleDrive({
|
|
1487
|
+
accessToken,
|
|
1488
|
+
fileName
|
|
1489
|
+
}));
|
|
1490
|
+
} catch (error) {
|
|
1491
|
+
this.logger.error('Failed to download backup from Google Drive', {
|
|
1492
|
+
accountAddress,
|
|
1493
|
+
fileName,
|
|
1494
|
+
error
|
|
1495
|
+
});
|
|
1496
|
+
throw new Error('Failed to restore backup from Google Drive');
|
|
1497
|
+
}
|
|
1413
1498
|
if (!backupData) {
|
|
1499
|
+
this.logger.error('No backup file found', {
|
|
1500
|
+
accountAddress,
|
|
1501
|
+
fileName
|
|
1502
|
+
});
|
|
1414
1503
|
throw new Error('No backup file found');
|
|
1415
1504
|
}
|
|
1416
1505
|
// Validate the backup data structure
|
|
1417
1506
|
if (!backupData.keyShares || !backupData.metadata) {
|
|
1507
|
+
this.logger.error('Invalid backup format: missing keyShares or metadata', {
|
|
1508
|
+
accountAddress,
|
|
1509
|
+
fileName
|
|
1510
|
+
});
|
|
1418
1511
|
throw new Error('Invalid backup format: missing keyShares or metadata');
|
|
1419
1512
|
}
|
|
1420
1513
|
const { keyShares } = backupData;
|
|
@@ -1786,11 +1879,13 @@ Object.defineProperty(exports, "MessageHash", {
|
|
|
1786
1879
|
exports.DynamicWalletClient = DynamicWalletClient;
|
|
1787
1880
|
exports.base64ToBytes = base64ToBytes;
|
|
1788
1881
|
exports.bytesToBase64 = bytesToBase64;
|
|
1882
|
+
exports.createBackupData = createBackupData;
|
|
1789
1883
|
exports.ensureBase64Padding = ensureBase64Padding;
|
|
1790
1884
|
exports.formatEvmMessage = formatEvmMessage;
|
|
1791
1885
|
exports.formatMessage = formatMessage;
|
|
1792
1886
|
exports.getClientKeyShareBackupInfo = getClientKeyShareBackupInfo;
|
|
1793
1887
|
exports.getClientKeyShareExportFileName = getClientKeyShareExportFileName;
|
|
1888
|
+
exports.getGoogleOAuthAccountId = getGoogleOAuthAccountId;
|
|
1794
1889
|
exports.getMPCSignatureScheme = getMPCSignatureScheme;
|
|
1795
1890
|
exports.getMPCSigner = getMPCSigner;
|
|
1796
1891
|
exports.isBrowser = isBrowser;
|
package/index.esm.js
CHANGED
|
@@ -2,6 +2,7 @@ import { SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, BackupLoca
|
|
|
2
2
|
export * from '@dynamic-labs-wallet/core';
|
|
3
3
|
import { BIP340, Ed25519, Ecdsa, MessageHash, EcdsaKeygenResult, Ed25519KeygenResult, BIP340KeygenResult } from './internal/web';
|
|
4
4
|
export { BIP340, BIP340InitKeygenResult, BIP340KeygenResult, Ecdsa, EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519, Ed25519InitKeygenResult, Ed25519KeygenResult, MessageHash } from './internal/web';
|
|
5
|
+
import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
|
|
5
6
|
import { Logger } from '@dynamic-labs/logger';
|
|
6
7
|
import { createRequestChannel, parseMessageTransportData, applyDefaultMessageOrigin, createMessageTransport } from '@dynamic-labs/message-transport';
|
|
7
8
|
|
|
@@ -130,7 +131,9 @@ const timeoutPromise = ({ timeInMs, activity = 'Ceremony' })=>{
|
|
|
130
131
|
}));
|
|
131
132
|
throw error;
|
|
132
133
|
}
|
|
133
|
-
|
|
134
|
+
// Calculate exponential backoff delay
|
|
135
|
+
const exponentialDelay = retryInterval * 2 ** (attempts - 1);
|
|
136
|
+
await new Promise((resolve)=>setTimeout(resolve, exponentialDelay));
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
139
|
// TypeScript needs this even though it's unreachable
|
|
@@ -166,6 +169,30 @@ const formatMessage = (chainName, message)=>{
|
|
|
166
169
|
throw new Error('Unsupported chain name');
|
|
167
170
|
}
|
|
168
171
|
};
|
|
172
|
+
const getGoogleOAuthAccountId = (verifiedCredentials)=>{
|
|
173
|
+
const googleVerifiedCredential = verifiedCredentials == null ? void 0 : verifiedCredentials.find((credential)=>credential.oauthProvider === ProviderEnum.Google);
|
|
174
|
+
return googleVerifiedCredential == null ? void 0 : googleVerifiedCredential.id;
|
|
175
|
+
};
|
|
176
|
+
const createBackupData = ({ encryptedKeyShares, accountAddress, thresholdSignatureScheme, hasPassword = true })=>{
|
|
177
|
+
return {
|
|
178
|
+
keyShares: encryptedKeyShares,
|
|
179
|
+
metadata: {
|
|
180
|
+
version: '1.0',
|
|
181
|
+
createdAt: new Date().toISOString(),
|
|
182
|
+
accountAddress,
|
|
183
|
+
thresholdSignatureScheme,
|
|
184
|
+
hasPassword,
|
|
185
|
+
encryption: {
|
|
186
|
+
algorithm: AES_GCM_ALGORITHM,
|
|
187
|
+
keyDerivation: PBKDF2_ALGORITHM,
|
|
188
|
+
iterations: PBKDF2_ITERATIONS,
|
|
189
|
+
hashAlgorithm: PBKDF2_HASH_ALGORITHM,
|
|
190
|
+
algorithmLength: AES_GCM_LENGTH
|
|
191
|
+
},
|
|
192
|
+
shareCount: encryptedKeyShares.length
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
};
|
|
169
196
|
|
|
170
197
|
const PBKDF2_ALGORITHM = 'PBKDF2';
|
|
171
198
|
const PBKDF2_ITERATIONS = 100000;
|
|
@@ -293,9 +320,9 @@ const uploadFileToGoogleDrive = async ({ accessToken, fileName, jsonData, parent
|
|
|
293
320
|
const result = await response.json();
|
|
294
321
|
return result; // Return file metadata, including file ID
|
|
295
322
|
};
|
|
296
|
-
const listFilesFromGoogleDrive = async ({ accessToken,
|
|
323
|
+
const listFilesFromGoogleDrive = async ({ accessToken, fileName })=>{
|
|
297
324
|
// Step 1: List all files inside `appDataFolder` with the specified backup filename
|
|
298
|
-
const resp = await fetch(`${GOOGLE_DRIVE_UPLOAD_API}/drive/v3/files?q=${encodeURIComponent(`name='${
|
|
325
|
+
const resp = await fetch(`${GOOGLE_DRIVE_UPLOAD_API}/drive/v3/files?q=${encodeURIComponent(`name='${fileName}'`)}&spaces=appDataFolder&orderBy=createdTime desc`, {
|
|
299
326
|
headers: {
|
|
300
327
|
Authorization: `Bearer ${accessToken}`
|
|
301
328
|
}
|
|
@@ -308,10 +335,10 @@ const listFilesFromGoogleDrive = async ({ accessToken, name })=>{
|
|
|
308
335
|
const files = data.files;
|
|
309
336
|
return files;
|
|
310
337
|
};
|
|
311
|
-
const downloadFileFromGoogleDrive = async ({ accessToken,
|
|
338
|
+
const downloadFileFromGoogleDrive = async ({ accessToken, fileName })=>{
|
|
312
339
|
const files = await listFilesFromGoogleDrive({
|
|
313
340
|
accessToken,
|
|
314
|
-
|
|
341
|
+
fileName
|
|
315
342
|
});
|
|
316
343
|
if (!files || files.length === 0) {
|
|
317
344
|
return null;
|
|
@@ -489,6 +516,56 @@ class IframeDisplayChannelAdapter {
|
|
|
489
516
|
}
|
|
490
517
|
}
|
|
491
518
|
|
|
519
|
+
/**
|
|
520
|
+
* Updates the wallet map with backup information after successful backup to Google Drive
|
|
521
|
+
* @param data - Response data containing key shares information
|
|
522
|
+
* @param walletMap - The wallet map to update
|
|
523
|
+
* @param accountAddress - The account address associated with the wallet
|
|
524
|
+
* @param backupLocation - The location where the backup is stored
|
|
525
|
+
* @param storage - Storage interface for persisting the updated wallet map
|
|
526
|
+
* @param storageKey - Key used to store the wallet map
|
|
527
|
+
* @returns The array of key share IDs that were backed up
|
|
528
|
+
*/ const updateWalletMapWithBackupInfo = async ({ data, walletMap, accountAddress, storage, storageKey })=>{
|
|
529
|
+
const ids = data.keyShares.map((keyShare)=>keyShare.id);
|
|
530
|
+
walletMap[accountAddress].clientKeySharesBackupInfo.backups[BackupLocation.GOOGLE_DRIVE] = ids;
|
|
531
|
+
await storage.setItem(storageKey, JSON.stringify(walletMap));
|
|
532
|
+
return ids;
|
|
533
|
+
};
|
|
534
|
+
/**
|
|
535
|
+
* Uploads a backup to Google Drive App
|
|
536
|
+
* @param accessToken - The access token for the Google Drive API
|
|
537
|
+
* @param fileName - The name of the file to upload
|
|
538
|
+
* @param backupData - The data to upload
|
|
539
|
+
* @param accountAddress - The account address associated with the backup
|
|
540
|
+
*/ const uploadBackupToGoogleDrive = async ({ accessToken, fileName, backupData, accountAddress })=>{
|
|
541
|
+
try {
|
|
542
|
+
await retryPromise(()=>uploadFileToGoogleDriveAppStorage({
|
|
543
|
+
accessToken,
|
|
544
|
+
fileName,
|
|
545
|
+
jsonData: backupData
|
|
546
|
+
}));
|
|
547
|
+
} catch (error) {
|
|
548
|
+
logger.error('Failed to upload keyshares to Google Drive App Storage', {
|
|
549
|
+
accountAddress,
|
|
550
|
+
error
|
|
551
|
+
});
|
|
552
|
+
throw new Error(`Failed to backup keyshares to Google Drive App Storage: ${error instanceof Error ? error.message : String(error)}`);
|
|
553
|
+
}
|
|
554
|
+
try {
|
|
555
|
+
await retryPromise(()=>uploadFileToGoogleDrivePersonal({
|
|
556
|
+
accessToken,
|
|
557
|
+
fileName,
|
|
558
|
+
jsonData: backupData
|
|
559
|
+
}));
|
|
560
|
+
} catch (error) {
|
|
561
|
+
logger.error('Failed to upload keyshares to Google Drive Personal', {
|
|
562
|
+
accountAddress,
|
|
563
|
+
error
|
|
564
|
+
});
|
|
565
|
+
throw new Error(`Failed to backup keyshares to Google Drive Personal: ${error instanceof Error ? error.message : String(error)}`);
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
|
|
492
569
|
class DynamicWalletClient {
|
|
493
570
|
async initialize() {
|
|
494
571
|
if (this.initializePromise) {
|
|
@@ -1206,13 +1283,9 @@ class DynamicWalletClient {
|
|
|
1206
1283
|
});
|
|
1207
1284
|
const hasGoogleDriveBackup = this.walletMap[accountAddress].clientKeySharesBackupInfo.backups[BackupLocation.GOOGLE_DRIVE].length > 0;
|
|
1208
1285
|
if (hasGoogleDriveBackup) {
|
|
1209
|
-
var _user_verifiedCredentials_find;
|
|
1210
|
-
const user = await this.apiClient.getUser();
|
|
1211
|
-
const oauthAccountId = user == null ? void 0 : (_user_verifiedCredentials_find = user.verifiedCredentials.find((credential)=>credential.oauthProvider === 'google')) == null ? void 0 : _user_verifiedCredentials_find.id;
|
|
1212
1286
|
const googleDriveKeyShareIds = await this.backupKeySharesToGoogleDrive({
|
|
1213
1287
|
accountAddress,
|
|
1214
|
-
password
|
|
1215
|
-
oauthAccountId
|
|
1288
|
+
password
|
|
1216
1289
|
});
|
|
1217
1290
|
data.keyShares.push({
|
|
1218
1291
|
backupLocation: BackupLocation.GOOGLE_DRIVE,
|
|
@@ -1269,6 +1342,23 @@ class DynamicWalletClient {
|
|
|
1269
1342
|
return deserializedKeyShare;
|
|
1270
1343
|
}
|
|
1271
1344
|
/**
|
|
1345
|
+
* Helper function to get Google OAuth Account ID or throw an error if not found.
|
|
1346
|
+
* @param accountAddress - The account address for logging purposes
|
|
1347
|
+
* @returns The Google OAuth Account ID
|
|
1348
|
+
* @throws Error if no Google OAuth account ID is found
|
|
1349
|
+
*/ async getGoogleOauthAccountIdOrThrow(accountAddress) {
|
|
1350
|
+
const user = await this.apiClient.getUser();
|
|
1351
|
+
const oauthAccountId = getGoogleOAuthAccountId(user == null ? void 0 : user.verifiedCredentials);
|
|
1352
|
+
if (!oauthAccountId) {
|
|
1353
|
+
this.logger.error('No Google OAuth account ID found', {
|
|
1354
|
+
user,
|
|
1355
|
+
accountAddress
|
|
1356
|
+
});
|
|
1357
|
+
throw new Error('No Google OAuth account ID found');
|
|
1358
|
+
}
|
|
1359
|
+
return oauthAccountId;
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1272
1362
|
* Helper function to determine keyshare recovery strategy for dynamic shares.
|
|
1273
1363
|
* For REFRESH operations, retrieves enough shares to meet the client threshold.
|
|
1274
1364
|
* For all other operations, retrieves just 1 share.
|
|
@@ -1331,7 +1421,7 @@ class DynamicWalletClient {
|
|
|
1331
1421
|
}
|
|
1332
1422
|
this.walletMap = JSON.parse(wallets);
|
|
1333
1423
|
}
|
|
1334
|
-
async backupKeySharesToGoogleDrive({ accountAddress,
|
|
1424
|
+
async backupKeySharesToGoogleDrive({ accountAddress, password }) {
|
|
1335
1425
|
await this.getWallet({
|
|
1336
1426
|
accountAddress,
|
|
1337
1427
|
walletOperation: WalletOperation.REACH_ALL_PARTIES,
|
|
@@ -1347,74 +1437,77 @@ class DynamicWalletClient {
|
|
|
1347
1437
|
keyShare,
|
|
1348
1438
|
password
|
|
1349
1439
|
})));
|
|
1440
|
+
const oauthAccountId = await this.getGoogleOauthAccountIdOrThrow(accountAddress);
|
|
1350
1441
|
const accessToken = await this.apiClient.getAccessToken({
|
|
1351
1442
|
oauthAccountId
|
|
1352
1443
|
});
|
|
1353
1444
|
const thresholdSignatureScheme = this.walletMap[accountAddress].thresholdSignatureScheme;
|
|
1354
|
-
const
|
|
1445
|
+
const fileName = getClientKeyShareExportFileName({
|
|
1355
1446
|
thresholdSignatureScheme,
|
|
1356
1447
|
accountAddress
|
|
1357
1448
|
});
|
|
1358
|
-
const backupData = {
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
iterations: PBKDF2_ITERATIONS,
|
|
1370
|
-
hashAlgorithm: PBKDF2_HASH_ALGORITHM,
|
|
1371
|
-
algorithmLength: AES_GCM_LENGTH
|
|
1372
|
-
},
|
|
1373
|
-
shareCount: encryptedKeyShares.length
|
|
1374
|
-
}
|
|
1375
|
-
};
|
|
1376
|
-
// TODO: handle errors
|
|
1377
|
-
await Promise.all([
|
|
1378
|
-
uploadFileToGoogleDriveAppStorage({
|
|
1379
|
-
accessToken,
|
|
1380
|
-
fileName: fileName != null ? fileName : suggestedFileName,
|
|
1381
|
-
jsonData: backupData
|
|
1382
|
-
}),
|
|
1383
|
-
uploadFileToGoogleDrivePersonal({
|
|
1384
|
-
accessToken,
|
|
1385
|
-
fileName: fileName != null ? fileName : suggestedFileName,
|
|
1386
|
-
jsonData: backupData
|
|
1387
|
-
})
|
|
1388
|
-
]);
|
|
1449
|
+
const backupData = createBackupData({
|
|
1450
|
+
encryptedKeyShares,
|
|
1451
|
+
accountAddress,
|
|
1452
|
+
thresholdSignatureScheme
|
|
1453
|
+
});
|
|
1454
|
+
await uploadBackupToGoogleDrive({
|
|
1455
|
+
accessToken,
|
|
1456
|
+
fileName,
|
|
1457
|
+
backupData,
|
|
1458
|
+
accountAddress
|
|
1459
|
+
});
|
|
1389
1460
|
const data = await this.apiClient.markKeySharesAsBackedUpGoogleDrive({
|
|
1390
1461
|
walletId: this.walletMap[accountAddress].walletId
|
|
1391
1462
|
});
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1463
|
+
await updateWalletMapWithBackupInfo({
|
|
1464
|
+
data,
|
|
1465
|
+
walletMap: this.walletMap,
|
|
1466
|
+
accountAddress,
|
|
1467
|
+
storage: this.storage,
|
|
1468
|
+
storageKey: this.storageKey
|
|
1469
|
+
});
|
|
1396
1470
|
}
|
|
1397
|
-
async restoreBackupFromGoogleDrive({ accountAddress,
|
|
1471
|
+
async restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password }) {
|
|
1398
1472
|
await this.getWallet({
|
|
1399
1473
|
accountAddress
|
|
1400
1474
|
});
|
|
1475
|
+
const oauthAccountId = await this.getGoogleOauthAccountIdOrThrow(accountAddress);
|
|
1401
1476
|
const accessToken = await this.apiClient.getAccessToken({
|
|
1402
1477
|
oauthAccountId
|
|
1403
1478
|
});
|
|
1404
1479
|
const thresholdSignatureScheme = this.walletMap[accountAddress].thresholdSignatureScheme;
|
|
1405
|
-
const
|
|
1480
|
+
const fileName = getClientKeyShareExportFileName({
|
|
1406
1481
|
thresholdSignatureScheme,
|
|
1407
1482
|
accountAddress
|
|
1408
1483
|
});
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1484
|
+
let backupData = null;
|
|
1485
|
+
try {
|
|
1486
|
+
backupData = await retryPromise(()=>downloadFileFromGoogleDrive({
|
|
1487
|
+
accessToken,
|
|
1488
|
+
fileName
|
|
1489
|
+
}));
|
|
1490
|
+
} catch (error) {
|
|
1491
|
+
this.logger.error('Failed to download backup from Google Drive', {
|
|
1492
|
+
accountAddress,
|
|
1493
|
+
fileName,
|
|
1494
|
+
error
|
|
1495
|
+
});
|
|
1496
|
+
throw new Error('Failed to restore backup from Google Drive');
|
|
1497
|
+
}
|
|
1413
1498
|
if (!backupData) {
|
|
1499
|
+
this.logger.error('No backup file found', {
|
|
1500
|
+
accountAddress,
|
|
1501
|
+
fileName
|
|
1502
|
+
});
|
|
1414
1503
|
throw new Error('No backup file found');
|
|
1415
1504
|
}
|
|
1416
1505
|
// Validate the backup data structure
|
|
1417
1506
|
if (!backupData.keyShares || !backupData.metadata) {
|
|
1507
|
+
this.logger.error('Invalid backup format: missing keyShares or metadata', {
|
|
1508
|
+
accountAddress,
|
|
1509
|
+
fileName
|
|
1510
|
+
});
|
|
1418
1511
|
throw new Error('Invalid backup format: missing keyShares or metadata');
|
|
1419
1512
|
}
|
|
1420
1513
|
const { keyShares } = backupData;
|
|
@@ -1735,4 +1828,4 @@ class DynamicWalletClient {
|
|
|
1735
1828
|
}
|
|
1736
1829
|
}
|
|
1737
1830
|
|
|
1738
|
-
export { DynamicWalletClient, base64ToBytes, bytesToBase64, ensureBase64Padding, formatEvmMessage, formatMessage, getClientKeyShareBackupInfo, getClientKeyShareExportFileName, getMPCSignatureScheme, getMPCSigner, isBrowser, isHexString, mergeUniqueKeyShares, retryPromise, stringToBytes, timeoutPromise };
|
|
1831
|
+
export { DynamicWalletClient, base64ToBytes, bytesToBase64, createBackupData, ensureBase64Padding, formatEvmMessage, formatMessage, getClientKeyShareBackupInfo, getClientKeyShareExportFileName, getGoogleOAuthAccountId, getMPCSignatureScheme, getMPCSigner, isBrowser, isHexString, mergeUniqueKeyShares, retryPromise, stringToBytes, timeoutPromise };
|
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.67",
|
|
4
4
|
"license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/core": "0.0.
|
|
6
|
+
"@dynamic-labs-wallet/core": "0.0.67",
|
|
7
7
|
"@dynamic-labs/logger": "^4.9.9",
|
|
8
8
|
"@dynamic-labs/message-transport": "^4.9.9",
|
|
9
9
|
"@noble/hashes": "1.7.1"
|
|
10
10
|
},
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"@dynamic-labs/sdk-api-core": "^0.0.663"
|
|
13
|
+
},
|
|
11
14
|
"files": [
|
|
12
15
|
"*",
|
|
13
16
|
"node_modules/**/*"
|
|
@@ -8,12 +8,12 @@ export declare const uploadFileToGoogleDrivePersonal: ({ accessToken, fileName,
|
|
|
8
8
|
fileName: string;
|
|
9
9
|
jsonData: unknown;
|
|
10
10
|
}) => Promise<any>;
|
|
11
|
-
export declare const listFilesFromGoogleDrive: ({ accessToken,
|
|
11
|
+
export declare const listFilesFromGoogleDrive: ({ accessToken, fileName, }: {
|
|
12
12
|
accessToken: string;
|
|
13
|
-
|
|
13
|
+
fileName: string;
|
|
14
14
|
}) => Promise<any>;
|
|
15
|
-
export declare const downloadFileFromGoogleDrive: ({ accessToken,
|
|
15
|
+
export declare const downloadFileFromGoogleDrive: ({ accessToken, fileName, }: {
|
|
16
16
|
accessToken: string;
|
|
17
|
-
|
|
17
|
+
fileName: string;
|
|
18
18
|
}) => Promise<unknown | null>;
|
|
19
19
|
//# sourceMappingURL=googleDrive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"googleDrive.d.ts","sourceRoot":"","sources":["../../../src/backup/providers/googleDrive.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iCAAiC,yCAI3C;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB,iBAOA,CAAC;AAEF,eAAO,MAAM,+BAA+B,yCAIzC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB,iBAOA,CAAC;AAgDF,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"googleDrive.d.ts","sourceRoot":"","sources":["../../../src/backup/providers/googleDrive.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iCAAiC,yCAI3C;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB,iBAOA,CAAC;AAEF,eAAO,MAAM,+BAA+B,yCAIzC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB,iBAOA,CAAC;AAgDF,eAAO,MAAM,wBAAwB,+BAGlC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAsBA,CAAC;AAEF,eAAO,MAAM,2BAA2B,+BAGrC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,KAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAgCzB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { SupportedStorage } from '../services/localStorage';
|
|
2
|
+
import type { WalletProperties } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Updates the wallet map with backup information after successful backup to Google Drive
|
|
5
|
+
* @param data - Response data containing key shares information
|
|
6
|
+
* @param walletMap - The wallet map to update
|
|
7
|
+
* @param accountAddress - The account address associated with the wallet
|
|
8
|
+
* @param backupLocation - The location where the backup is stored
|
|
9
|
+
* @param storage - Storage interface for persisting the updated wallet map
|
|
10
|
+
* @param storageKey - Key used to store the wallet map
|
|
11
|
+
* @returns The array of key share IDs that were backed up
|
|
12
|
+
*/
|
|
13
|
+
export declare const updateWalletMapWithBackupInfo: ({ data, walletMap, accountAddress, storage, storageKey, }: {
|
|
14
|
+
data: {
|
|
15
|
+
keyShares: Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
walletMap: Record<string, WalletProperties>;
|
|
20
|
+
accountAddress: string;
|
|
21
|
+
storage: SupportedStorage;
|
|
22
|
+
storageKey: string;
|
|
23
|
+
}) => Promise<string[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Uploads a backup to Google Drive App
|
|
26
|
+
* @param accessToken - The access token for the Google Drive API
|
|
27
|
+
* @param fileName - The name of the file to upload
|
|
28
|
+
* @param backupData - The data to upload
|
|
29
|
+
* @param accountAddress - The account address associated with the backup
|
|
30
|
+
*/
|
|
31
|
+
export declare const uploadBackupToGoogleDrive: ({ accessToken, fileName, backupData, accountAddress, }: {
|
|
32
|
+
accessToken: string;
|
|
33
|
+
fileName: string;
|
|
34
|
+
backupData: any;
|
|
35
|
+
accountAddress: string;
|
|
36
|
+
}) => Promise<void>;
|
|
37
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/backup/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAIjD;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,8DAMvC;IACD,IAAI,EAAE;QAAE,SAAS,EAAE,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB,KAAG,OAAO,CAAC,MAAM,EAAE,CAQnB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,2DAKnC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,GAAG,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;CACxB,kBAwCA,CAAC"}
|
package/src/client.d.ts
CHANGED
|
@@ -275,6 +275,13 @@ export declare class DynamicWalletClient {
|
|
|
275
275
|
keyShare: string;
|
|
276
276
|
password?: string;
|
|
277
277
|
}): Promise<ClientKeyShare>;
|
|
278
|
+
/**
|
|
279
|
+
* Helper function to get Google OAuth Account ID or throw an error if not found.
|
|
280
|
+
* @param accountAddress - The account address for logging purposes
|
|
281
|
+
* @returns The Google OAuth Account ID
|
|
282
|
+
* @throws Error if no Google OAuth account ID is found
|
|
283
|
+
*/
|
|
284
|
+
private getGoogleOauthAccountIdOrThrow;
|
|
278
285
|
/**
|
|
279
286
|
* Helper function to determine keyshare recovery strategy for dynamic shares.
|
|
280
287
|
* For REFRESH operations, retrieves enough shares to meet the client threshold.
|
|
@@ -304,16 +311,12 @@ export declare class DynamicWalletClient {
|
|
|
304
311
|
storeRecoveredShares?: boolean;
|
|
305
312
|
}): Promise<any[]>;
|
|
306
313
|
restoreWallets(): Promise<void>;
|
|
307
|
-
backupKeySharesToGoogleDrive({ accountAddress,
|
|
314
|
+
backupKeySharesToGoogleDrive({ accountAddress, password, }: {
|
|
308
315
|
accountAddress: string;
|
|
309
|
-
fileName?: string;
|
|
310
|
-
oauthAccountId: string;
|
|
311
316
|
password?: string;
|
|
312
|
-
}): Promise<
|
|
313
|
-
restoreBackupFromGoogleDrive({ accountAddress,
|
|
317
|
+
}): Promise<void>;
|
|
318
|
+
restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, }: {
|
|
314
319
|
accountAddress: string;
|
|
315
|
-
oauthAccountId: string;
|
|
316
|
-
name?: string;
|
|
317
320
|
password?: string;
|
|
318
321
|
displayContainer: HTMLElement;
|
|
319
322
|
}): Promise<ClientKeyShare[] | null>;
|
package/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC7B,gBAAgB,EAIhB,cAAc,EAEd,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,eAAe,EAGhB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAIL,KAAK,cAAc,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,cAAc,EAEpB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC7B,gBAAgB,EAIhB,cAAc,EAEd,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,eAAe,EAGhB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAIL,KAAK,cAAc,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,cAAc,EAEpB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQ1E,OAAO,EAGL,KAAK,gBAAgB,EAEtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAWhD,OAAO,EAGL,KAAK,iCAAiC,EACvC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAMvE,qBAAa,mB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;;;;OAKG;YACW,iBAAiB;IA8D/B;;;;OAIG;IACG,cAAc,CAAC,EACnB,cAAc,EACd,QAAoB,EACpB,eAA8C,GAC/C,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,eAAe,CAAC;KACnC;IA6CK,mBAAmB,CAAC,EACxB,cAAc,GACf,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC,OAAO,CAAC;IAMpB;;OAEG;IACG,4BAA4B,CAAC,EACjC,cAAc,EACd,eAAiD,GAClD,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;KACnC,GAAG,OAAO,CAAC,OAAO,CAAC;IAYpB;;OAEG;IACG,uCAAuC,CAAC,EAC5C,cAAc,EACd,eAAiD,GAClD,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;KACnC,GAAG,OAAO,CAAC,OAAO,CAAC;IAgCd,iCAAiC,CAAC,EACtC,cAAc,GACf,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAoBzB,SAAS,CAAC,EACd,cAAc,EACd,eAA8C,EAC9C,UAAsB,EACtB,QAAoB,GACrB,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;QAClC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IA2EK,UAAU;CAkCjB"}
|
package/src/utils.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type {
|
|
1
|
+
import { type KeyShareBackupInfo, type ThresholdSignatureScheme, type WaasWalletProperties } from '@dynamic-labs-wallet/core';
|
|
2
|
+
import type { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';
|
|
3
3
|
import { MessageHash } from '../../internal/web';
|
|
4
|
+
import type { ClientKeyShare } from './mpc/types';
|
|
4
5
|
export declare const bytesToBase64: (arr: Uint8Array) => string;
|
|
5
6
|
export declare const stringToBytes: (str: string) => Uint8Array;
|
|
6
7
|
export declare const base64ToBytes: (base64: string) => Uint8Array;
|
|
@@ -42,5 +43,29 @@ interface RetryConfig {
|
|
|
42
43
|
export declare function retryPromise<T>(operation: () => Promise<T>, { maxAttempts, retryInterval, operationName, logContext, }?: RetryConfig): Promise<T>;
|
|
43
44
|
export declare const formatEvmMessage: (message: string | Uint8Array) => MessageHash;
|
|
44
45
|
export declare const formatMessage: (chainName: string, message: string | Uint8Array) => string | Uint8Array | MessageHash;
|
|
46
|
+
export declare const getGoogleOAuthAccountId: (verifiedCredentials: JwtVerifiedCredential[]) => string | undefined;
|
|
47
|
+
export declare const createBackupData: ({ encryptedKeyShares, accountAddress, thresholdSignatureScheme, hasPassword, }: {
|
|
48
|
+
encryptedKeyShares: string[];
|
|
49
|
+
accountAddress: string;
|
|
50
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
51
|
+
hasPassword?: boolean;
|
|
52
|
+
}) => {
|
|
53
|
+
keyShares: string[];
|
|
54
|
+
metadata: {
|
|
55
|
+
version: string;
|
|
56
|
+
createdAt: string;
|
|
57
|
+
accountAddress: string;
|
|
58
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
59
|
+
hasPassword: boolean;
|
|
60
|
+
encryption: {
|
|
61
|
+
algorithm: string;
|
|
62
|
+
keyDerivation: string;
|
|
63
|
+
iterations: number;
|
|
64
|
+
hashAlgorithm: string;
|
|
65
|
+
algorithmLength: number;
|
|
66
|
+
};
|
|
67
|
+
shareCount: number;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
45
70
|
export {};
|
|
46
71
|
//# sourceMappingURL=utils.d.ts.map
|
package/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAS5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,eAAO,MAAM,aAAa,QAAS,UAAU,WAE5C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,MAAM,eAExC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,eAE3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MAEjD,CAAC;AAEF,eAAO,MAAM,SAAS,eAAsC,CAAC;AAE7D,eAAO,MAAM,WAAW,QAAS,MAAM,YAKtC,CAAC;AAEF,eAAO,MAAM,+BAA+B,kDAGzC;IACD,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,cAAc,EAAE,MAAM,CAAC;CACxB,WAEA,CAAC;AAEF,eAAO,MAAM,2BAA2B,YAAa;IACnD,gBAAgB,EAAE,oBAAoB,CAAC;CACxC,KAAG,kBAgCH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,sBACZ,cAAc,EAAE,gBACrB,cAAc,EAAE,KAC7B,cAAc,EAchB,CAAC;AAEF,eAAO,MAAM,cAAc,4BAGxB;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,qBAOA,CAAC;AAEF,UAAU,WAAW;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB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