@dynamic-labs-wallet/browser 0.0.3 → 0.0.4
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.esm.js +160 -84
- package/package.json +3 -3
- package/src/client.d.ts +63 -49
- package/src/client.d.ts.map +1 -1
- package/src/mpc/types.d.ts +1 -1
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SigningAlgorithm, RELAY_API_URL, getMPCChainConfig, MPC_CONFIG,
|
|
1
|
+
import { SigningAlgorithm, RELAY_API_URL, getMPCChainConfig, MPC_CONFIG, getClientThreshold, getTSSConfig, DynamicApiClient } from '@dynamic-labs-wallet/core';
|
|
2
2
|
export * from '@dynamic-labs-wallet/core';
|
|
3
3
|
import { BIP340, Ed25519, Ecdsa, MessageHash } from '@dynamic-labs-wallet/lib-mpc-web';
|
|
4
4
|
export { BIP340, BIP340InitKeygenResult, BIP340KeygenResult, Ecdsa, EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519, Ed25519InitKeygenResult, Ed25519KeygenResult, MessageHash } from '@dynamic-labs-wallet/lib-mpc-web';
|
|
@@ -182,14 +182,15 @@ const downloadFileFromGoogleDrive = async ({ accessToken, name })=>{
|
|
|
182
182
|
const BACKUP_FILENAME = 'dynamicWalletSecretBackup.json';
|
|
183
183
|
|
|
184
184
|
class DynamicWalletClient {
|
|
185
|
-
async serverInitializeKeyGen({ chainName, clientPrimaryKeygenId, clientSecondaryKeygenId }) {
|
|
185
|
+
async serverInitializeKeyGen({ chainName, clientPrimaryKeygenId, clientSecondaryKeygenId, thresholdSignatureScheme }) {
|
|
186
186
|
// Initilize keygen, create room, and create the wallet account on the server
|
|
187
187
|
const data = await this.apiClient.createWalletAccount({
|
|
188
188
|
chainName,
|
|
189
189
|
clientKeygenIds: [
|
|
190
190
|
clientPrimaryKeygenId,
|
|
191
191
|
clientSecondaryKeygenId
|
|
192
|
-
]
|
|
192
|
+
],
|
|
193
|
+
thresholdSignatureScheme
|
|
193
194
|
});
|
|
194
195
|
return data;
|
|
195
196
|
}
|
|
@@ -218,13 +219,13 @@ class DynamicWalletClient {
|
|
|
218
219
|
const chainConfig = getMPCChainConfig(chainName);
|
|
219
220
|
let publicKey;
|
|
220
221
|
if (mpcSigner instanceof Ecdsa) {
|
|
221
|
-
publicKey = await mpcSigner.derivePubkey(keyShare
|
|
222
|
+
publicKey = await mpcSigner.derivePubkey(keyShare, new Uint32Array(chainConfig.derivationPath));
|
|
222
223
|
} else if (mpcSigner instanceof Ed25519) {
|
|
223
|
-
publicKey = await mpcSigner.derivePubkey(keyShare
|
|
224
|
+
publicKey = await mpcSigner.derivePubkey(keyShare, new Uint32Array(chainConfig.derivationPath));
|
|
224
225
|
}
|
|
225
226
|
return publicKey;
|
|
226
227
|
}
|
|
227
|
-
async clientKeyGen({ chainName, roomId, serverKeygenIds, clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult }) {
|
|
228
|
+
async clientKeyGen({ chainName, roomId, serverKeygenIds, clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult, thresholdSignatureScheme }) {
|
|
228
229
|
// Get the chain config and the mpc signer
|
|
229
230
|
const chainConfig = getMPCChainConfig(chainName);
|
|
230
231
|
const mpcSigner = getMPCSigner({
|
|
@@ -243,14 +244,13 @@ class DynamicWalletClient {
|
|
|
243
244
|
clientPrimaryKeygenId
|
|
244
245
|
];
|
|
245
246
|
// Get the MPC config for the threshold signature scheme
|
|
246
|
-
const mpcConfig = MPC_CONFIG[
|
|
247
|
+
const mpcConfig = MPC_CONFIG[thresholdSignatureScheme];
|
|
247
248
|
// All parties join the keygen room
|
|
248
249
|
const keygenResults = await Promise.all([
|
|
249
250
|
mpcSigner.keygen(roomId, mpcConfig.numberOfParties, mpcConfig.threshold, clientPrimaryKeygenInitResult, clientPrimaryKeygenIds),
|
|
250
251
|
mpcSigner.keygen(roomId, mpcConfig.numberOfParties, mpcConfig.threshold, clientSecondaryKeygenInitResult, clientSecondaryKeygenIds)
|
|
251
252
|
]);
|
|
252
253
|
const [clientPrimaryKeygenResult, clientSecondaryKeygenResult] = keygenResults;
|
|
253
|
-
this.clientKeyshare = clientPrimaryKeygenResult;
|
|
254
254
|
// Pick the derivation path of the public key you want to sign for
|
|
255
255
|
const derivationPath = new Uint32Array(chainConfig.derivationPath);
|
|
256
256
|
// Get the public key for the derivation path
|
|
@@ -268,7 +268,7 @@ class DynamicWalletClient {
|
|
|
268
268
|
secondaryKeygenResult: clientSecondaryKeygenResult
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
|
-
async keyGen({ chainName }) {
|
|
271
|
+
async keyGen({ chainName, thresholdSignatureScheme }) {
|
|
272
272
|
try {
|
|
273
273
|
const { clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult } = await this.clientInitializeKeyGen({
|
|
274
274
|
chainName
|
|
@@ -276,14 +276,16 @@ class DynamicWalletClient {
|
|
|
276
276
|
const data = await this.serverInitializeKeyGen({
|
|
277
277
|
chainName,
|
|
278
278
|
clientPrimaryKeygenId: clientPrimaryKeygenInitResult.keygenId,
|
|
279
|
-
clientSecondaryKeygenId: clientSecondaryKeygenInitResult.keygenId
|
|
279
|
+
clientSecondaryKeygenId: clientSecondaryKeygenInitResult.keygenId,
|
|
280
|
+
thresholdSignatureScheme
|
|
280
281
|
});
|
|
281
282
|
const { rawPublicKey, primaryKeygenResult, secondaryKeygenResult } = await this.clientKeyGen({
|
|
282
283
|
chainName,
|
|
283
284
|
roomId: data.roomId,
|
|
284
285
|
serverKeygenIds: data.serverKeygenIds,
|
|
285
286
|
clientPrimaryKeygenInitResult,
|
|
286
|
-
clientSecondaryKeygenInitResult
|
|
287
|
+
clientSecondaryKeygenInitResult,
|
|
288
|
+
thresholdSignatureScheme
|
|
287
289
|
});
|
|
288
290
|
return {
|
|
289
291
|
rawPublicKey,
|
|
@@ -303,7 +305,7 @@ class DynamicWalletClient {
|
|
|
303
305
|
});
|
|
304
306
|
return data;
|
|
305
307
|
}
|
|
306
|
-
async clientSign({ chainName, message, roomId }) {
|
|
308
|
+
async clientSign({ chainName, message, roomId, keyShare }) {
|
|
307
309
|
try {
|
|
308
310
|
const chainConfig = getMPCChainConfig(chainName);
|
|
309
311
|
const mpcSigner = getMPCSigner({
|
|
@@ -321,45 +323,50 @@ class DynamicWalletClient {
|
|
|
321
323
|
} else {
|
|
322
324
|
throw new Error('Unsupported signer type');
|
|
323
325
|
}
|
|
324
|
-
const signature = await mpcSigner.sign(roomId,
|
|
326
|
+
const signature = await mpcSigner.sign(roomId, keyShare, formattedMessage, derivationPath);
|
|
325
327
|
return signature;
|
|
326
328
|
} catch (error) {
|
|
327
329
|
console.error('Error in clientSign:', error);
|
|
328
330
|
throw error;
|
|
329
331
|
}
|
|
330
332
|
}
|
|
331
|
-
async sign({
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
333
|
+
async sign({ accountAddress, message }) {
|
|
334
|
+
const wallet = await this.getWallet({
|
|
335
|
+
accountAddress
|
|
336
|
+
});
|
|
337
|
+
const chainName = wallet.chainName;
|
|
335
338
|
// Perform the server sign
|
|
336
339
|
const data = await this.serverSign({
|
|
337
|
-
walletId:
|
|
340
|
+
walletId: wallet.walletId,
|
|
338
341
|
message
|
|
339
342
|
});
|
|
340
343
|
// Perform the client sign and return the signature
|
|
341
344
|
const signature = await this.clientSign({
|
|
342
345
|
chainName,
|
|
343
346
|
message,
|
|
344
|
-
roomId: data.roomId
|
|
347
|
+
roomId: data.roomId,
|
|
348
|
+
keyShare: wallet.clientKeyShares[0]
|
|
345
349
|
});
|
|
346
350
|
return signature;
|
|
347
351
|
}
|
|
348
|
-
async refreshWalletAccountShares({
|
|
352
|
+
async refreshWalletAccountShares({ accountAddress }) {
|
|
353
|
+
const wallet = await this.getWallet({
|
|
354
|
+
accountAddress
|
|
355
|
+
});
|
|
356
|
+
const chainName = wallet.chainName;
|
|
349
357
|
const mpcSigner = getMPCSigner({
|
|
350
358
|
chainName,
|
|
351
359
|
baseRelayUrl: RELAY_API_URL
|
|
352
360
|
});
|
|
353
361
|
// Create the room and refresh the shares
|
|
354
362
|
const data = await this.apiClient.refreshWalletAccountShares({
|
|
355
|
-
walletId
|
|
363
|
+
walletId: wallet.walletId
|
|
356
364
|
});
|
|
357
365
|
const roomId = data.roomId;
|
|
358
366
|
const keygenResults = await Promise.all([
|
|
359
|
-
mpcSigner.refresh(roomId,
|
|
360
|
-
mpcSigner.refresh(roomId,
|
|
367
|
+
mpcSigner.refresh(roomId, wallet.clientKeyShares[0]),
|
|
368
|
+
mpcSigner.refresh(roomId, wallet.clientKeyShares[1])
|
|
361
369
|
]);
|
|
362
|
-
this.clientKeyshare = keygenResults[0];
|
|
363
370
|
return keygenResults;
|
|
364
371
|
}
|
|
365
372
|
async serverReshareRemainingParty({ walletId, clientKeygenIds }) {
|
|
@@ -369,15 +376,19 @@ class DynamicWalletClient {
|
|
|
369
376
|
});
|
|
370
377
|
return data;
|
|
371
378
|
}
|
|
372
|
-
async
|
|
379
|
+
async getExportId({ chainName, clientKeyShare }) {
|
|
373
380
|
const mpcSigner = getMPCSigner({
|
|
374
381
|
chainName,
|
|
375
382
|
baseRelayUrl: RELAY_API_URL
|
|
376
383
|
});
|
|
377
|
-
const exportId = await mpcSigner.exportID(
|
|
384
|
+
const exportId = await mpcSigner.exportID(clientKeyShare);
|
|
378
385
|
return exportId;
|
|
379
386
|
}
|
|
380
|
-
async reshareRemainingParty({
|
|
387
|
+
async reshareRemainingParty({ accountAddress, thresholdSignatureScheme }) {
|
|
388
|
+
const wallet = await this.getWallet({
|
|
389
|
+
accountAddress
|
|
390
|
+
});
|
|
391
|
+
const chainName = wallet.chainName;
|
|
381
392
|
const mpcSigner = getMPCSigner({
|
|
382
393
|
chainName,
|
|
383
394
|
baseRelayUrl: RELAY_API_URL
|
|
@@ -385,13 +396,13 @@ class DynamicWalletClient {
|
|
|
385
396
|
// Initialize the new party
|
|
386
397
|
const newPartyInitKeygen = await mpcSigner.initKeygen();
|
|
387
398
|
const newPartyInitKeygenId = newPartyInitKeygen.keygenId;
|
|
388
|
-
const clientKeygenId = await this.
|
|
399
|
+
const clientKeygenId = await this.getExportId({
|
|
389
400
|
chainName,
|
|
390
|
-
|
|
401
|
+
clientKeyShare: wallet.clientKeyShares[0]
|
|
391
402
|
});
|
|
392
403
|
// Create the room and reshare the server share
|
|
393
404
|
const data = await this.serverReshareRemainingParty({
|
|
394
|
-
walletId,
|
|
405
|
+
walletId: wallet.walletId,
|
|
395
406
|
clientKeygenIds: [
|
|
396
407
|
newPartyInitKeygenId,
|
|
397
408
|
clientKeygenId
|
|
@@ -399,7 +410,7 @@ class DynamicWalletClient {
|
|
|
399
410
|
});
|
|
400
411
|
const roomId = data.roomId;
|
|
401
412
|
// Get the MPC config for the threshold signature scheme
|
|
402
|
-
const mpcConfig = MPC_CONFIG[
|
|
413
|
+
const mpcConfig = MPC_CONFIG[thresholdSignatureScheme];
|
|
403
414
|
const newClientPrimaryKeygenIds = [
|
|
404
415
|
data.serverKeygenId,
|
|
405
416
|
clientKeygenId
|
|
@@ -412,26 +423,29 @@ class DynamicWalletClient {
|
|
|
412
423
|
console.log('clientSecondaryKeygenIds', clientSecondaryKeygenIds);
|
|
413
424
|
const keygenResults = await Promise.all([
|
|
414
425
|
mpcSigner.reshareNewParty(roomId, mpcConfig.threshold, mpcConfig.threshold, newPartyInitKeygen, newClientPrimaryKeygenIds),
|
|
415
|
-
mpcSigner.reshareRemainingParty(roomId, mpcConfig.threshold,
|
|
426
|
+
mpcSigner.reshareRemainingParty(roomId, mpcConfig.threshold, wallet.clientKeyShares[1], clientSecondaryKeygenIds)
|
|
416
427
|
]);
|
|
417
|
-
this.clientKeyshare = keygenResults[0];
|
|
418
428
|
return keygenResults;
|
|
419
429
|
}
|
|
420
|
-
async exportPrivateKey({
|
|
430
|
+
async exportPrivateKey({ accountAddress }) {
|
|
431
|
+
const wallet = await this.getWallet({
|
|
432
|
+
accountAddress
|
|
433
|
+
});
|
|
434
|
+
const chainName = wallet.chainName;
|
|
421
435
|
const chainConfig = getMPCChainConfig(chainName);
|
|
422
436
|
const mpcSigner = getMPCSigner({
|
|
423
437
|
chainName,
|
|
424
438
|
baseRelayUrl: RELAY_API_URL
|
|
425
439
|
});
|
|
426
|
-
const exportId = await this.
|
|
440
|
+
const exportId = await this.getExportId({
|
|
427
441
|
chainName,
|
|
428
|
-
|
|
442
|
+
clientKeyShare: wallet.clientKeyShares[0]
|
|
429
443
|
});
|
|
430
444
|
const data = await this.apiClient.exportKey({
|
|
431
|
-
walletId,
|
|
445
|
+
walletId: wallet.walletId,
|
|
432
446
|
exportId
|
|
433
447
|
});
|
|
434
|
-
const keyExportRaw = await mpcSigner.exportFullPrivateKey(data.roomId,
|
|
448
|
+
const keyExportRaw = await mpcSigner.exportFullPrivateKey(data.roomId, wallet.clientKeyShares[0], exportId);
|
|
435
449
|
if (!keyExportRaw) {
|
|
436
450
|
throw new Error('Error exporting private key');
|
|
437
451
|
}
|
|
@@ -448,7 +462,17 @@ class DynamicWalletClient {
|
|
|
448
462
|
derivedPrivateKey
|
|
449
463
|
};
|
|
450
464
|
}
|
|
451
|
-
|
|
465
|
+
//todo: if we already have the client threshold inside the walletMap then we do not need to remove the keyShares
|
|
466
|
+
async offlineExportPrivateKey({ chainName, keyShares, accountAddress }) {
|
|
467
|
+
const wallet = await this.getWallet({
|
|
468
|
+
accountAddress
|
|
469
|
+
});
|
|
470
|
+
const clientKeyShares = wallet.clientKeyShares;
|
|
471
|
+
const walletKeyShares = keyShares != null ? keyShares : clientKeyShares;
|
|
472
|
+
const clientThreshold = getClientThreshold(wallet.thresholdSignatureScheme);
|
|
473
|
+
if (!walletKeyShares || walletKeyShares.length !== clientThreshold) {
|
|
474
|
+
throw new Error('Must provide 2 key shares');
|
|
475
|
+
}
|
|
452
476
|
const chainConfig = getMPCChainConfig(chainName);
|
|
453
477
|
const mpcSigner = getMPCSigner({
|
|
454
478
|
chainName,
|
|
@@ -481,14 +505,15 @@ class DynamicWalletClient {
|
|
|
481
505
|
const serializedEncryptedKeyShare = Buffer.from(JSON.stringify(encryptedKeyShare)).toString('base64');
|
|
482
506
|
return serializedEncryptedKeyShare;
|
|
483
507
|
}
|
|
484
|
-
async
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
const data = await this.apiClient.
|
|
508
|
+
async storeEncryptedBackupByWallet({ walletId, keyShares, password }) {
|
|
509
|
+
const encryptedKeyShares = await Promise.all(keyShares.map((keyShare)=>this.encryptKeyShare({
|
|
510
|
+
keyShare,
|
|
511
|
+
password
|
|
512
|
+
})));
|
|
513
|
+
const data = await this.apiClient.storeEncryptedBackupByWallet({
|
|
490
514
|
walletId,
|
|
491
|
-
|
|
515
|
+
encryptedKeyShares,
|
|
516
|
+
passwordEncrypted: password ? true : false
|
|
492
517
|
});
|
|
493
518
|
return data;
|
|
494
519
|
}
|
|
@@ -501,28 +526,38 @@ class DynamicWalletClient {
|
|
|
501
526
|
const deserializedKeyShare = JSON.parse(decryptedKeyShare);
|
|
502
527
|
return deserializedKeyShare;
|
|
503
528
|
}
|
|
504
|
-
async
|
|
505
|
-
const data = await this.apiClient.
|
|
529
|
+
async recoverEncryptedBackupByWallet({ accountAddress, walletId, password, keyShareIds }) {
|
|
530
|
+
const data = await this.apiClient.recoverEncryptedBackupByWallet({
|
|
506
531
|
walletId,
|
|
507
|
-
|
|
508
|
-
});
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
532
|
+
keyShareIds
|
|
533
|
+
});
|
|
534
|
+
const decryptedKeyShares = await Promise.all(data.keyShares.map((keyShare)=>this.decryptKeyShare({
|
|
535
|
+
keyShare: keyShare.encryptedAccountCredential,
|
|
536
|
+
password: password != null ? password : this.environmentId
|
|
537
|
+
})));
|
|
538
|
+
decryptedKeyShares.forEach((keyShare)=>{
|
|
539
|
+
this.restoreBackupShare({
|
|
540
|
+
accountAddress,
|
|
541
|
+
walletId,
|
|
542
|
+
chainName: data.chainName,
|
|
543
|
+
keyShare,
|
|
544
|
+
thresholdSignatureScheme: data.thresholdSignatureScheme
|
|
545
|
+
});
|
|
515
546
|
});
|
|
516
|
-
return
|
|
517
|
-
}
|
|
518
|
-
restoreBackupShare({ keyShare }) {
|
|
519
|
-
this.clientKeyshare = keyShare;
|
|
547
|
+
return decryptedKeyShares;
|
|
520
548
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
549
|
+
restoreBackupShare({ walletId, accountAddress, chainName, keyShare, thresholdSignatureScheme }) {
|
|
550
|
+
var _this_walletMap_accountAddress;
|
|
551
|
+
this.walletMap[accountAddress] = {
|
|
552
|
+
walletId,
|
|
553
|
+
chainName,
|
|
554
|
+
accountAddress,
|
|
555
|
+
clientKeyShares: [
|
|
556
|
+
...((_this_walletMap_accountAddress = this.walletMap[accountAddress]) == null ? undefined : _this_walletMap_accountAddress.clientKeyShares) || [],
|
|
557
|
+
keyShare
|
|
558
|
+
],
|
|
559
|
+
thresholdSignatureScheme
|
|
560
|
+
};
|
|
526
561
|
}
|
|
527
562
|
async backupFileToGoogleDrive({ oauthAccountId, fileName = BACKUP_FILENAME, jsonData, password }) {
|
|
528
563
|
const encryptedKeyShare = await this.encryptKeyShare({
|
|
@@ -556,7 +591,8 @@ class DynamicWalletClient {
|
|
|
556
591
|
});
|
|
557
592
|
return decryptedKeyShare;
|
|
558
593
|
}
|
|
559
|
-
async importRawPrivateKey({ chainName,
|
|
594
|
+
async importRawPrivateKey({ chainName, privateKey, thresholdSignatureScheme }) {
|
|
595
|
+
const chainConfig = getMPCChainConfig(chainName);
|
|
560
596
|
const mpcSigner = getMPCSigner({
|
|
561
597
|
chainName,
|
|
562
598
|
baseRelayUrl: RELAY_API_URL
|
|
@@ -572,22 +608,22 @@ class DynamicWalletClient {
|
|
|
572
608
|
// --- 1. init keygen for the server as a party
|
|
573
609
|
// --- 2. open a room and return the roomId for the ceremony
|
|
574
610
|
// --- 3. join the room as a party for the 2/3 ceremony
|
|
575
|
-
const { roomId,
|
|
611
|
+
const { roomId, serverKeygenIds } = await this.apiClient.importPrivateKey({
|
|
576
612
|
chainName,
|
|
577
|
-
walletId,
|
|
578
613
|
clientKeygenIds: [
|
|
579
614
|
clientPrimaryKeygenId,
|
|
580
615
|
clientSecondaryKeygenId
|
|
581
|
-
]
|
|
616
|
+
],
|
|
617
|
+
thresholdSignatureScheme
|
|
582
618
|
});
|
|
583
|
-
const threshold =
|
|
619
|
+
const { threshold } = getTSSConfig(thresholdSignatureScheme);
|
|
584
620
|
// prep
|
|
585
621
|
const importerKeygenIds = [
|
|
586
|
-
|
|
622
|
+
...serverKeygenIds,
|
|
587
623
|
clientSecondaryKeygenId
|
|
588
624
|
];
|
|
589
625
|
const recipientKeygenIds = [
|
|
590
|
-
|
|
626
|
+
...serverKeygenIds,
|
|
591
627
|
clientPrimaryKeygenId
|
|
592
628
|
];
|
|
593
629
|
// 3. Join the keygen room for the ceremony
|
|
@@ -595,21 +631,61 @@ class DynamicWalletClient {
|
|
|
595
631
|
mpcSigner.importPrivateKeyImporter(roomId, threshold, privateKey, clientPrimaryKeygenInitResult, importerKeygenIds),
|
|
596
632
|
mpcSigner.importPrivateKeyRecipient(roomId, threshold, clientSecondaryKeygenInitResult, recipientKeygenIds)
|
|
597
633
|
]);
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
634
|
+
const derivationPath = new Uint32Array(chainConfig.derivationPath);
|
|
635
|
+
// Get the public key for the derivation path
|
|
636
|
+
let rawPublicKey;
|
|
637
|
+
if (mpcSigner instanceof Ecdsa) {
|
|
638
|
+
rawPublicKey = await mpcSigner.derivePubkey(clientPrimaryKeygenResult, derivationPath);
|
|
639
|
+
} else if (mpcSigner instanceof Ed25519) {
|
|
640
|
+
rawPublicKey = await mpcSigner.derivePubkey(clientPrimaryKeygenResult, derivationPath);
|
|
641
|
+
} else if (mpcSigner instanceof BIP340) {
|
|
642
|
+
rawPublicKey = await mpcSigner.deriveTweakPubkey(clientPrimaryKeygenResult, derivationPath);
|
|
643
|
+
}
|
|
644
|
+
return {
|
|
645
|
+
rawPublicKey,
|
|
646
|
+
primaryKeygenResult: clientPrimaryKeygenResult,
|
|
647
|
+
secondaryKeygenResult: clientSecondaryKeygenResult
|
|
648
|
+
};
|
|
606
649
|
}
|
|
607
|
-
async
|
|
608
|
-
|
|
650
|
+
async getWallet({ accountAddress }) {
|
|
651
|
+
if (accountAddress) {
|
|
652
|
+
if (this.walletMap[accountAddress]) {
|
|
653
|
+
return this.walletMap[accountAddress];
|
|
654
|
+
} else {
|
|
655
|
+
var _user_verifiedCredentials;
|
|
656
|
+
const user = await this.apiClient.getUser();
|
|
657
|
+
const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? undefined : _user_verifiedCredentials.find((vc)=>vc.address === accountAddress);
|
|
658
|
+
console.log('need to restore wallet', wallet);
|
|
659
|
+
const walletId = wallet.id;
|
|
660
|
+
const clientShares = wallet.walletProperties.keyShares.filter((ks)=>ks.backupLocation === 'dynamic');
|
|
661
|
+
console.log('clientShares', clientShares);
|
|
662
|
+
// restore backup
|
|
663
|
+
const decryptedKeyShares = await this.recoverEncryptedBackupByWallet({
|
|
664
|
+
walletId,
|
|
665
|
+
accountAddress,
|
|
666
|
+
password: this.environmentId
|
|
667
|
+
});
|
|
668
|
+
console.log('recovery decryptedKeyShares', decryptedKeyShares);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
const walletCount = Object.keys(this.walletMap).length;
|
|
672
|
+
// if there are no wallets, throw an error
|
|
673
|
+
if (walletCount === 0) {
|
|
674
|
+
throw new Error('No wallets found');
|
|
675
|
+
}
|
|
676
|
+
// if there is only one wallet, return it by default
|
|
677
|
+
if (walletCount === 1) {
|
|
678
|
+
return Object.values(this.walletMap)[0];
|
|
679
|
+
}
|
|
680
|
+
if (!accountAddress) {
|
|
681
|
+
throw new Error('Must provide an account address');
|
|
682
|
+
}
|
|
683
|
+
return this.walletMap[accountAddress];
|
|
609
684
|
}
|
|
610
|
-
constructor({ environmentId, authToken, baseApiUrl
|
|
685
|
+
constructor({ environmentId, authToken, baseApiUrl }){
|
|
686
|
+
this.walletMap = {} // todo: store in session storage
|
|
687
|
+
;
|
|
611
688
|
this.environmentId = environmentId;
|
|
612
|
-
this.clientKeyshare = clientKeyshare;
|
|
613
689
|
this.apiClient = new DynamicApiClient({
|
|
614
690
|
environmentId,
|
|
615
691
|
authToken,
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@dynamic-labs-wallet/core": "0.0.
|
|
6
|
-
"@dynamic-labs-wallet/lib-mpc-web": "0.0.
|
|
5
|
+
"@dynamic-labs-wallet/core": "0.0.4",
|
|
6
|
+
"@dynamic-labs-wallet/lib-mpc-web": "0.0.4"
|
|
7
7
|
},
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "restricted"
|
package/src/client.d.ts
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
|
+
import { ThresholdSignatureScheme, DynamicApiClient } from '@dynamic-labs-wallet/core';
|
|
1
2
|
import { EcdsaPublicKey, EcdsaKeygenResult, Ed25519KeygenResult, BIP340KeygenResult, EcdsaSignature } from '@dynamic-labs-wallet/lib-mpc-web';
|
|
2
|
-
import { ClientInitKeygenResult,
|
|
3
|
+
import { ClientInitKeygenResult, ClientKeyShare } from './mpc/types';
|
|
4
|
+
interface WalletProperties {
|
|
5
|
+
chainName: string;
|
|
6
|
+
walletId: string;
|
|
7
|
+
accountAddress: string;
|
|
8
|
+
clientKeyShares: ClientKeyShare[];
|
|
9
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
10
|
+
}
|
|
3
11
|
export declare class DynamicWalletClient {
|
|
4
12
|
environmentId: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
constructor({ environmentId, authToken, baseApiUrl, clientKeyshare, }: {
|
|
13
|
+
protected apiClient: DynamicApiClient;
|
|
14
|
+
protected walletMap: Record<string, WalletProperties>;
|
|
15
|
+
constructor({ environmentId, authToken, baseApiUrl, }: {
|
|
9
16
|
environmentId: string;
|
|
10
17
|
authToken: string;
|
|
11
18
|
baseApiUrl?: string;
|
|
12
|
-
clientKeyshare?: ClientKeyshare;
|
|
13
19
|
});
|
|
14
|
-
serverInitializeKeyGen({ chainName, clientPrimaryKeygenId, clientSecondaryKeygenId, }: {
|
|
20
|
+
serverInitializeKeyGen({ chainName, clientPrimaryKeygenId, clientSecondaryKeygenId, thresholdSignatureScheme, }: {
|
|
15
21
|
chainName: string;
|
|
16
22
|
clientPrimaryKeygenId: string;
|
|
17
23
|
clientSecondaryKeygenId: string;
|
|
24
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
18
25
|
}): Promise<any>;
|
|
19
26
|
clientInitializeKeyGen({ chainName }: {
|
|
20
27
|
chainName: string;
|
|
@@ -24,23 +31,25 @@ export declare class DynamicWalletClient {
|
|
|
24
31
|
}>;
|
|
25
32
|
derivePublicKey({ chainName, keyShare, }: {
|
|
26
33
|
chainName: string;
|
|
27
|
-
keyShare
|
|
28
|
-
}): Promise<
|
|
29
|
-
clientKeyGen({ chainName, roomId, serverKeygenIds, clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult, }: {
|
|
34
|
+
keyShare: ClientKeyShare;
|
|
35
|
+
}): Promise<EcdsaPublicKey | Uint8Array | undefined>;
|
|
36
|
+
clientKeyGen({ chainName, roomId, serverKeygenIds, clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult, thresholdSignatureScheme, }: {
|
|
30
37
|
chainName: string;
|
|
31
38
|
roomId: string;
|
|
32
39
|
serverKeygenIds: string[];
|
|
33
40
|
clientPrimaryKeygenInitResult: ClientInitKeygenResult;
|
|
34
41
|
clientSecondaryKeygenInitResult: ClientInitKeygenResult;
|
|
42
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
35
43
|
}): Promise<{
|
|
36
|
-
rawPublicKey:
|
|
44
|
+
rawPublicKey: EcdsaPublicKey | Uint8Array | undefined;
|
|
37
45
|
primaryKeygenResult: EcdsaKeygenResult | BIP340KeygenResult;
|
|
38
46
|
secondaryKeygenResult: EcdsaKeygenResult | BIP340KeygenResult;
|
|
39
47
|
}>;
|
|
40
|
-
keyGen({ chainName }: {
|
|
48
|
+
keyGen({ chainName, thresholdSignatureScheme, }: {
|
|
41
49
|
chainName: string;
|
|
50
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
42
51
|
}): Promise<{
|
|
43
|
-
rawPublicKey:
|
|
52
|
+
rawPublicKey: EcdsaPublicKey | Uint8Array | undefined;
|
|
44
53
|
primaryKeygenResult: EcdsaKeygenResult | BIP340KeygenResult;
|
|
45
54
|
secondaryKeygenResult: EcdsaKeygenResult | BIP340KeygenResult;
|
|
46
55
|
}>;
|
|
@@ -48,70 +57,69 @@ export declare class DynamicWalletClient {
|
|
|
48
57
|
walletId: string;
|
|
49
58
|
message: string;
|
|
50
59
|
}): Promise<any>;
|
|
51
|
-
clientSign({ chainName, message, roomId, }: {
|
|
60
|
+
clientSign({ chainName, message, roomId, keyShare, }: {
|
|
52
61
|
chainName: string;
|
|
53
62
|
message: string;
|
|
54
63
|
roomId: string;
|
|
64
|
+
keyShare: ClientKeyShare;
|
|
55
65
|
}): Promise<Uint8Array | EcdsaSignature>;
|
|
56
|
-
sign({
|
|
57
|
-
|
|
66
|
+
sign({ accountAddress, message, }: {
|
|
67
|
+
accountAddress?: string;
|
|
58
68
|
message: string;
|
|
59
69
|
}): Promise<Uint8Array | EcdsaSignature>;
|
|
60
|
-
refreshWalletAccountShares({
|
|
61
|
-
|
|
62
|
-
walletId: string;
|
|
63
|
-
clientPrimaryKeyshare: EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
|
|
64
|
-
clientSecondaryKeyshare: EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
|
|
70
|
+
refreshWalletAccountShares({ accountAddress, }: {
|
|
71
|
+
accountAddress: string;
|
|
65
72
|
}): Promise<[EcdsaKeygenResult | BIP340KeygenResult, EcdsaKeygenResult | BIP340KeygenResult]>;
|
|
66
73
|
serverReshareRemainingParty({ walletId, clientKeygenIds, }: {
|
|
67
74
|
walletId: string;
|
|
68
75
|
clientKeygenIds: string[];
|
|
69
76
|
}): Promise<any>;
|
|
70
|
-
|
|
77
|
+
getExportId({ chainName, clientKeyShare, }: {
|
|
71
78
|
chainName: string;
|
|
72
|
-
|
|
79
|
+
clientKeyShare: EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
|
|
73
80
|
}): Promise<string>;
|
|
74
|
-
reshareRemainingParty({
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
clientKeyshare: EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
|
|
81
|
+
reshareRemainingParty({ accountAddress, thresholdSignatureScheme, }: {
|
|
82
|
+
accountAddress: string;
|
|
83
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
78
84
|
}): Promise<[EcdsaKeygenResult | BIP340KeygenResult, EcdsaKeygenResult | BIP340KeygenResult]>;
|
|
79
|
-
exportPrivateKey({
|
|
80
|
-
|
|
81
|
-
clientKeyshare: EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
|
|
82
|
-
walletId: string;
|
|
85
|
+
exportPrivateKey({ accountAddress }: {
|
|
86
|
+
accountAddress: string;
|
|
83
87
|
}): Promise<{
|
|
84
88
|
derivedPrivateKey: string | undefined;
|
|
85
89
|
}>;
|
|
86
|
-
offlineExportPrivateKey({ chainName, keyShares, }: {
|
|
90
|
+
offlineExportPrivateKey({ chainName, keyShares, accountAddress, }: {
|
|
87
91
|
chainName: string;
|
|
88
|
-
keyShares
|
|
92
|
+
keyShares?: ClientKeyShare[];
|
|
93
|
+
accountAddress?: string;
|
|
89
94
|
}): Promise<{
|
|
90
95
|
derivedPrivateKey: string | undefined;
|
|
91
96
|
}>;
|
|
92
97
|
encryptKeyShare({ keyShare, password, }: {
|
|
93
|
-
keyShare:
|
|
98
|
+
keyShare: ClientKeyShare;
|
|
94
99
|
password?: string;
|
|
95
100
|
}): Promise<string>;
|
|
96
|
-
|
|
101
|
+
storeEncryptedBackupByWallet({ walletId, keyShares, password, }: {
|
|
97
102
|
walletId: string;
|
|
98
|
-
|
|
103
|
+
keyShares: ClientKeyShare[];
|
|
99
104
|
password?: string;
|
|
100
105
|
}): Promise<any>;
|
|
101
106
|
decryptKeyShare({ keyShare, password, }: {
|
|
102
107
|
keyShare: string;
|
|
103
108
|
password?: string;
|
|
104
109
|
}): Promise<any>;
|
|
105
|
-
|
|
110
|
+
recoverEncryptedBackupByWallet({ accountAddress, walletId, password, keyShareIds, }: {
|
|
111
|
+
accountAddress: string;
|
|
106
112
|
walletId: string;
|
|
107
|
-
keyShareId: string;
|
|
108
113
|
password?: string;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
keyShareIds?: string[];
|
|
115
|
+
}): Promise<any[]>;
|
|
116
|
+
restoreBackupShare({ walletId, accountAddress, chainName, keyShare, thresholdSignatureScheme, }: {
|
|
117
|
+
walletId: string;
|
|
118
|
+
accountAddress: string;
|
|
119
|
+
chainName: string;
|
|
120
|
+
keyShare: ClientKeyShare;
|
|
121
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
112
122
|
}): void;
|
|
113
|
-
getClientShare(): Promise<ClientKeyshare | undefined>;
|
|
114
|
-
setClientShare(clientKeyshare: ClientKeyshare): Promise<void>;
|
|
115
123
|
backupFileToGoogleDrive({ oauthAccountId, fileName, jsonData, password, }: {
|
|
116
124
|
oauthAccountId: string;
|
|
117
125
|
fileName?: string;
|
|
@@ -122,13 +130,19 @@ export declare class DynamicWalletClient {
|
|
|
122
130
|
oauthAccountId: string;
|
|
123
131
|
name?: string;
|
|
124
132
|
password?: string;
|
|
125
|
-
}): Promise<
|
|
126
|
-
importRawPrivateKey({ chainName,
|
|
133
|
+
}): Promise<ClientKeyShare | null>;
|
|
134
|
+
importRawPrivateKey({ chainName, privateKey, thresholdSignatureScheme, }: {
|
|
127
135
|
chainName: string;
|
|
128
|
-
walletId: string;
|
|
129
136
|
privateKey: string;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
137
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
138
|
+
}): Promise<{
|
|
139
|
+
rawPublicKey: EcdsaPublicKey | Uint8Array | undefined;
|
|
140
|
+
primaryKeygenResult: ClientKeyShare;
|
|
141
|
+
secondaryKeygenResult: ClientKeyShare;
|
|
142
|
+
}>;
|
|
143
|
+
getWallet({ accountAddress }: {
|
|
144
|
+
accountAddress?: string;
|
|
145
|
+
}): Promise<WalletProperties>;
|
|
133
146
|
}
|
|
147
|
+
export {};
|
|
134
148
|
//# sourceMappingURL=client.d.ts.map
|
package/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,wBAAwB,EACxB,gBAAgB,EAGjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAIL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAElB,cAAc,EACf,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAOrE,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,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AM,CAAC;KACnB;IAgBK,4BAA4B,CAAC,EACjC,cAAc,EACd,IAAsB,EACtB,QAAQ,GACT,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAmB5B,mBAAmB,CAAC,EACxB,SAAS,EACT,UAAU,EACV,wBAAwB,GACzB,EAAE;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,wBAAwB,EAAE,wBAAwB,CAAC;KACpD,GAAG,OAAO,CAAC;QACV,YAAY,EAAE,cAAc,GAAG,UAAU,GAAG,SAAS,CAAC;QACtD,mBAAmB,EAAE,cAAc,CAAC;QACpC,qBAAqB,EAAE,cAAc,CAAC;KACvC,CAAC;IA4EI,SAAS,CAAC,EAAE,cAAc,EAAE,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE;CAyChE"}
|
package/src/mpc/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BIP340InitKeygenResult, BIP340KeygenResult, Ed25519InitKeygenResult, EcdsaInitKeygenResult, EcdsaKeygenResult, Ed25519KeygenResult } from '@dynamic-labs-wallet/lib-mpc-web';
|
|
2
2
|
export type ClientInitKeygenResult = EcdsaInitKeygenResult | Ed25519InitKeygenResult | BIP340InitKeygenResult;
|
|
3
|
-
export type
|
|
3
|
+
export type ClientKeyShare = EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
|
|
4
4
|
export type { Ecdsa, Ed25519, BIP340, EcdsaPublicKey, EcdsaKeygenResult, Ed25519KeygenResult, BIP340KeygenResult, MessageHash, EcdsaSignature, } from '@dynamic-labs-wallet/lib-mpc-web';
|
|
5
5
|
//# sourceMappingURL=types.d.ts.map
|