@dynamic-labs-wallet/browser 0.0.1 → 0.0.3
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 +118 -34
- package/package.json +4 -4
- package/src/backup/encryption.d.ts.map +1 -1
- package/src/backup/providers/googleDrive.d.ts.map +1 -1
- package/src/client.d.ts +34 -18
- package/src/client.d.ts.map +1 -1
- package/src/constants.d.ts.map +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.d.ts.map +1 -1
- package/src/mpc/index.d.ts.map +1 -1
- package/src/mpc/mpc.d.ts.map +1 -1
- package/src/mpc/types.d.ts.map +1 -1
- package/src/utils.d.ts.map +1 -1
package/index.esm.js
CHANGED
|
@@ -186,8 +186,10 @@ class DynamicWalletClient {
|
|
|
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
|
-
|
|
190
|
-
|
|
189
|
+
clientKeygenIds: [
|
|
190
|
+
clientPrimaryKeygenId,
|
|
191
|
+
clientSecondaryKeygenId
|
|
192
|
+
]
|
|
191
193
|
});
|
|
192
194
|
return data;
|
|
193
195
|
}
|
|
@@ -222,7 +224,7 @@ class DynamicWalletClient {
|
|
|
222
224
|
}
|
|
223
225
|
return publicKey;
|
|
224
226
|
}
|
|
225
|
-
async clientKeyGen({ chainName, roomId,
|
|
227
|
+
async clientKeyGen({ chainName, roomId, serverKeygenIds, clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult }) {
|
|
226
228
|
// Get the chain config and the mpc signer
|
|
227
229
|
const chainConfig = getMPCChainConfig(chainName);
|
|
228
230
|
const mpcSigner = getMPCSigner({
|
|
@@ -233,11 +235,11 @@ class DynamicWalletClient {
|
|
|
233
235
|
const clientPrimaryKeygenId = clientPrimaryKeygenInitResult.keygenId;
|
|
234
236
|
const clientSecondaryKeygenId = clientSecondaryKeygenInitResult.keygenId;
|
|
235
237
|
const clientPrimaryKeygenIds = [
|
|
236
|
-
|
|
238
|
+
...serverKeygenIds,
|
|
237
239
|
clientSecondaryKeygenId
|
|
238
240
|
];
|
|
239
241
|
const clientSecondaryKeygenIds = [
|
|
240
|
-
|
|
242
|
+
...serverKeygenIds,
|
|
241
243
|
clientPrimaryKeygenId
|
|
242
244
|
];
|
|
243
245
|
// Get the MPC config for the threshold signature scheme
|
|
@@ -279,7 +281,7 @@ class DynamicWalletClient {
|
|
|
279
281
|
const { rawPublicKey, primaryKeygenResult, secondaryKeygenResult } = await this.clientKeyGen({
|
|
280
282
|
chainName,
|
|
281
283
|
roomId: data.roomId,
|
|
282
|
-
|
|
284
|
+
serverKeygenIds: data.serverKeygenIds,
|
|
283
285
|
clientPrimaryKeygenInitResult,
|
|
284
286
|
clientSecondaryKeygenInitResult
|
|
285
287
|
});
|
|
@@ -293,45 +295,65 @@ class DynamicWalletClient {
|
|
|
293
295
|
throw new Error('Error creating wallet account');
|
|
294
296
|
}
|
|
295
297
|
}
|
|
296
|
-
async serverSign({
|
|
298
|
+
async serverSign({ walletId, message }) {
|
|
297
299
|
// Create the room and sign the message
|
|
298
300
|
const data = await this.apiClient.signMessage({
|
|
299
|
-
|
|
301
|
+
walletId,
|
|
302
|
+
message
|
|
300
303
|
});
|
|
301
304
|
return data;
|
|
302
305
|
}
|
|
303
|
-
async clientSign({ chainName,
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
306
|
+
async clientSign({ chainName, message, roomId }) {
|
|
307
|
+
try {
|
|
308
|
+
const chainConfig = getMPCChainConfig(chainName);
|
|
309
|
+
const mpcSigner = getMPCSigner({
|
|
310
|
+
chainName,
|
|
311
|
+
baseRelayUrl: RELAY_API_URL
|
|
312
|
+
});
|
|
313
|
+
const derivationPath = new Uint32Array(chainConfig.derivationPath);
|
|
314
|
+
let formattedMessage;
|
|
315
|
+
if (mpcSigner instanceof Ecdsa) {
|
|
316
|
+
formattedMessage = MessageHash.sha256(message);
|
|
317
|
+
} else if (mpcSigner instanceof Ed25519) {
|
|
318
|
+
formattedMessage = new TextEncoder().encode(message);
|
|
319
|
+
} else if (mpcSigner instanceof BIP340) {
|
|
320
|
+
formattedMessage = new TextEncoder().encode(message);
|
|
321
|
+
} else {
|
|
322
|
+
throw new Error('Unsupported signer type');
|
|
323
|
+
}
|
|
324
|
+
const signature = await mpcSigner.sign(roomId, this.clientKeyshare, formattedMessage, derivationPath);
|
|
325
|
+
return signature;
|
|
326
|
+
} catch (error) {
|
|
327
|
+
console.error('Error in clientSign:', error);
|
|
328
|
+
throw error;
|
|
329
|
+
}
|
|
314
330
|
}
|
|
315
|
-
async sign({ chainName,
|
|
331
|
+
async sign({ chainName, message }) {
|
|
332
|
+
if (!this.walletId) {
|
|
333
|
+
throw new Error('Wallet ID is not set');
|
|
334
|
+
}
|
|
316
335
|
// Perform the server sign
|
|
317
336
|
const data = await this.serverSign({
|
|
318
|
-
|
|
337
|
+
walletId: this.walletId,
|
|
338
|
+
message
|
|
319
339
|
});
|
|
320
340
|
// Perform the client sign and return the signature
|
|
321
341
|
const signature = await this.clientSign({
|
|
322
342
|
chainName,
|
|
323
|
-
|
|
343
|
+
message,
|
|
324
344
|
roomId: data.roomId
|
|
325
345
|
});
|
|
326
346
|
return signature;
|
|
327
347
|
}
|
|
328
|
-
async refreshWalletAccountShares({ chainName, clientPrimaryKeyshare, clientSecondaryKeyshare }) {
|
|
348
|
+
async refreshWalletAccountShares({ chainName, walletId, clientPrimaryKeyshare, clientSecondaryKeyshare }) {
|
|
329
349
|
const mpcSigner = getMPCSigner({
|
|
330
350
|
chainName,
|
|
331
351
|
baseRelayUrl: RELAY_API_URL
|
|
332
352
|
});
|
|
333
353
|
// Create the room and refresh the shares
|
|
334
|
-
const data = await this.apiClient.refreshWalletAccountShares(
|
|
354
|
+
const data = await this.apiClient.refreshWalletAccountShares({
|
|
355
|
+
walletId
|
|
356
|
+
});
|
|
335
357
|
const roomId = data.roomId;
|
|
336
358
|
const keygenResults = await Promise.all([
|
|
337
359
|
mpcSigner.refresh(roomId, clientPrimaryKeyshare),
|
|
@@ -340,10 +362,10 @@ class DynamicWalletClient {
|
|
|
340
362
|
this.clientKeyshare = keygenResults[0];
|
|
341
363
|
return keygenResults;
|
|
342
364
|
}
|
|
343
|
-
async serverReshareRemainingParty({
|
|
365
|
+
async serverReshareRemainingParty({ walletId, clientKeygenIds }) {
|
|
344
366
|
const data = await this.apiClient.reshareRemainingParty({
|
|
345
|
-
|
|
346
|
-
|
|
367
|
+
walletId,
|
|
368
|
+
clientKeygenIds
|
|
347
369
|
});
|
|
348
370
|
return data;
|
|
349
371
|
}
|
|
@@ -355,7 +377,7 @@ class DynamicWalletClient {
|
|
|
355
377
|
const exportId = await mpcSigner.exportID(clientKeyshare);
|
|
356
378
|
return exportId;
|
|
357
379
|
}
|
|
358
|
-
async reshareRemainingParty({ chainName, clientKeyshare }) {
|
|
380
|
+
async reshareRemainingParty({ chainName, walletId, clientKeyshare }) {
|
|
359
381
|
const mpcSigner = getMPCSigner({
|
|
360
382
|
chainName,
|
|
361
383
|
baseRelayUrl: RELAY_API_URL
|
|
@@ -369,8 +391,11 @@ class DynamicWalletClient {
|
|
|
369
391
|
});
|
|
370
392
|
// Create the room and reshare the server share
|
|
371
393
|
const data = await this.serverReshareRemainingParty({
|
|
372
|
-
|
|
373
|
-
|
|
394
|
+
walletId,
|
|
395
|
+
clientKeygenIds: [
|
|
396
|
+
newPartyInitKeygenId,
|
|
397
|
+
clientKeygenId
|
|
398
|
+
]
|
|
374
399
|
});
|
|
375
400
|
const roomId = data.roomId;
|
|
376
401
|
// Get the MPC config for the threshold signature scheme
|
|
@@ -392,7 +417,7 @@ class DynamicWalletClient {
|
|
|
392
417
|
this.clientKeyshare = keygenResults[0];
|
|
393
418
|
return keygenResults;
|
|
394
419
|
}
|
|
395
|
-
async exportPrivateKey({ chainName, clientKeyshare }) {
|
|
420
|
+
async exportPrivateKey({ chainName, clientKeyshare, walletId }) {
|
|
396
421
|
const chainConfig = getMPCChainConfig(chainName);
|
|
397
422
|
const mpcSigner = getMPCSigner({
|
|
398
423
|
chainName,
|
|
@@ -403,6 +428,7 @@ class DynamicWalletClient {
|
|
|
403
428
|
clientKeyshare
|
|
404
429
|
});
|
|
405
430
|
const data = await this.apiClient.exportKey({
|
|
431
|
+
walletId,
|
|
406
432
|
exportId
|
|
407
433
|
});
|
|
408
434
|
const keyExportRaw = await mpcSigner.exportFullPrivateKey(data.roomId, clientKeyshare, exportId);
|
|
@@ -455,12 +481,13 @@ class DynamicWalletClient {
|
|
|
455
481
|
const serializedEncryptedKeyShare = Buffer.from(JSON.stringify(encryptedKeyShare)).toString('base64');
|
|
456
482
|
return serializedEncryptedKeyShare;
|
|
457
483
|
}
|
|
458
|
-
async storeEncryptedBackup({ keyShare, password }) {
|
|
484
|
+
async storeEncryptedBackup({ walletId, keyShare, password }) {
|
|
459
485
|
const encryptedKeyShare = await this.encryptKeyShare({
|
|
460
486
|
keyShare,
|
|
461
487
|
password
|
|
462
488
|
});
|
|
463
489
|
const data = await this.apiClient.storeEncryptedBackup({
|
|
490
|
+
walletId,
|
|
464
491
|
keyShare: encryptedKeyShare
|
|
465
492
|
});
|
|
466
493
|
return data;
|
|
@@ -474,8 +501,11 @@ class DynamicWalletClient {
|
|
|
474
501
|
const deserializedKeyShare = JSON.parse(decryptedKeyShare);
|
|
475
502
|
return deserializedKeyShare;
|
|
476
503
|
}
|
|
477
|
-
async recoverEncryptedBackup({
|
|
478
|
-
const data = await this.apiClient.recoverEncryptedBackup(
|
|
504
|
+
async recoverEncryptedBackup({ walletId, keyShareId, password }) {
|
|
505
|
+
const data = await this.apiClient.recoverEncryptedBackup({
|
|
506
|
+
walletId,
|
|
507
|
+
keyShareId
|
|
508
|
+
});
|
|
479
509
|
const decryptedKeyShare = await this.decryptKeyShare({
|
|
480
510
|
keyShare: data.keyShare,
|
|
481
511
|
password: password != null ? password : this.environmentId
|
|
@@ -491,6 +521,9 @@ class DynamicWalletClient {
|
|
|
491
521
|
async getClientShare() {
|
|
492
522
|
return this.clientKeyshare;
|
|
493
523
|
}
|
|
524
|
+
async setClientShare(clientKeyshare) {
|
|
525
|
+
this.clientKeyshare = clientKeyshare;
|
|
526
|
+
}
|
|
494
527
|
async backupFileToGoogleDrive({ oauthAccountId, fileName = BACKUP_FILENAME, jsonData, password }) {
|
|
495
528
|
const encryptedKeyShare = await this.encryptKeyShare({
|
|
496
529
|
keyShare: jsonData,
|
|
@@ -523,6 +556,57 @@ class DynamicWalletClient {
|
|
|
523
556
|
});
|
|
524
557
|
return decryptedKeyShare;
|
|
525
558
|
}
|
|
559
|
+
async importRawPrivateKey({ chainName, walletId, privateKey }) {
|
|
560
|
+
const mpcSigner = getMPCSigner({
|
|
561
|
+
chainName,
|
|
562
|
+
baseRelayUrl: RELAY_API_URL
|
|
563
|
+
});
|
|
564
|
+
// 1. 2 parties on the client side create keygenInit
|
|
565
|
+
const { clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult } = await this.clientInitializeKeyGen({
|
|
566
|
+
chainName
|
|
567
|
+
});
|
|
568
|
+
const clientSecondaryKeygenId = clientSecondaryKeygenInitResult.keygenId;
|
|
569
|
+
const clientPrimaryKeygenId = clientPrimaryKeygenInitResult.keygenId;
|
|
570
|
+
// 2. server to create a room for importing the private key
|
|
571
|
+
// server will do 3 things:
|
|
572
|
+
// --- 1. init keygen for the server as a party
|
|
573
|
+
// --- 2. open a room and return the roomId for the ceremony
|
|
574
|
+
// --- 3. join the room as a party for the 2/3 ceremony
|
|
575
|
+
const { roomId, serverKeygenId } = await this.apiClient.importPrivateKey({
|
|
576
|
+
chainName,
|
|
577
|
+
walletId,
|
|
578
|
+
clientKeygenIds: [
|
|
579
|
+
clientPrimaryKeygenId,
|
|
580
|
+
clientSecondaryKeygenId
|
|
581
|
+
]
|
|
582
|
+
});
|
|
583
|
+
const threshold = MPC_CONFIG[ThresholdSignatureScheme.TWO_OF_THREE].threshold;
|
|
584
|
+
// prep
|
|
585
|
+
const importerKeygenIds = [
|
|
586
|
+
serverKeygenId,
|
|
587
|
+
clientSecondaryKeygenId
|
|
588
|
+
];
|
|
589
|
+
const recipientKeygenIds = [
|
|
590
|
+
serverKeygenId,
|
|
591
|
+
clientPrimaryKeygenId
|
|
592
|
+
];
|
|
593
|
+
// 3. Join the keygen room for the ceremony
|
|
594
|
+
const [clientPrimaryKeygenResult, clientSecondaryKeygenResult] = await Promise.all([
|
|
595
|
+
mpcSigner.importPrivateKeyImporter(roomId, threshold, privateKey, clientPrimaryKeygenInitResult, importerKeygenIds),
|
|
596
|
+
mpcSigner.importPrivateKeyRecipient(roomId, threshold, clientSecondaryKeygenInitResult, recipientKeygenIds)
|
|
597
|
+
]);
|
|
598
|
+
this.clientKeyshare = clientPrimaryKeygenResult;
|
|
599
|
+
return [
|
|
600
|
+
clientPrimaryKeygenResult,
|
|
601
|
+
clientSecondaryKeygenResult
|
|
602
|
+
];
|
|
603
|
+
}
|
|
604
|
+
async getWalletId() {
|
|
605
|
+
return this.walletId;
|
|
606
|
+
}
|
|
607
|
+
async setWalletId(walletId) {
|
|
608
|
+
this.walletId = walletId;
|
|
609
|
+
}
|
|
526
610
|
constructor({ environmentId, authToken, baseApiUrl, clientKeyshare }){
|
|
527
611
|
this.environmentId = environmentId;
|
|
528
612
|
this.clientKeyshare = clientKeyshare;
|
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.3",
|
|
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.3",
|
|
6
|
+
"@dynamic-labs-wallet/lib-mpc-web": "0.0.3"
|
|
7
7
|
},
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "restricted"
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"type": "module"
|
|
28
|
-
}
|
|
28
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../src/backup/encryption.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,WAAW,wBAGrB;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;;;;EA4BA,CAAC;AAEF,eAAO,MAAM,WAAW,wBAGrB;IACD,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB,oBA0BA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"googleDrive.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"googleDrive.d.ts","sourceRoot":"","sources":["../../../src/backup/providers/googleDrive.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,yCAIjC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAkCA,CAAC;AAEF,eAAO,MAAM,wBAAwB,2BAGlC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,iBAsBA,CAAC;AAEF,eAAO,MAAM,2BAA2B,2BAGrC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAsBxB,CAAC"}
|
package/src/client.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare class DynamicWalletClient {
|
|
|
4
4
|
environmentId: string;
|
|
5
5
|
private apiClient;
|
|
6
6
|
private clientKeyshare?;
|
|
7
|
+
private walletId?;
|
|
7
8
|
constructor({ environmentId, authToken, baseApiUrl, clientKeyshare, }: {
|
|
8
9
|
environmentId: string;
|
|
9
10
|
authToken: string;
|
|
@@ -18,17 +19,17 @@ export declare class DynamicWalletClient {
|
|
|
18
19
|
clientInitializeKeyGen({ chainName }: {
|
|
19
20
|
chainName: string;
|
|
20
21
|
}): Promise<{
|
|
21
|
-
clientPrimaryKeygenInitResult: import("@dynamic-labs-wallet/lib-mpc-
|
|
22
|
-
clientSecondaryKeygenInitResult: import("@dynamic-labs-wallet/lib-mpc-
|
|
22
|
+
clientPrimaryKeygenInitResult: import("@dynamic-labs-wallet/lib-mpc-internal").BIP340InitKeygenResult;
|
|
23
|
+
clientSecondaryKeygenInitResult: import("@dynamic-labs-wallet/lib-mpc-internal").BIP340InitKeygenResult;
|
|
23
24
|
}>;
|
|
24
25
|
derivePublicKey({ chainName, keyShare, }: {
|
|
25
26
|
chainName: string;
|
|
26
27
|
keyShare?: ClientKeyshare;
|
|
27
28
|
}): Promise<Uint8Array | EcdsaPublicKey | undefined>;
|
|
28
|
-
clientKeyGen({ chainName, roomId,
|
|
29
|
+
clientKeyGen({ chainName, roomId, serverKeygenIds, clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult, }: {
|
|
29
30
|
chainName: string;
|
|
30
31
|
roomId: string;
|
|
31
|
-
|
|
32
|
+
serverKeygenIds: string[];
|
|
32
33
|
clientPrimaryKeygenInitResult: ClientInitKeygenResult;
|
|
33
34
|
clientSecondaryKeygenInitResult: ClientInitKeygenResult;
|
|
34
35
|
}): Promise<{
|
|
@@ -43,38 +44,42 @@ export declare class DynamicWalletClient {
|
|
|
43
44
|
primaryKeygenResult: EcdsaKeygenResult | BIP340KeygenResult;
|
|
44
45
|
secondaryKeygenResult: EcdsaKeygenResult | BIP340KeygenResult;
|
|
45
46
|
}>;
|
|
46
|
-
serverSign({
|
|
47
|
-
|
|
47
|
+
serverSign({ walletId, message, }: {
|
|
48
|
+
walletId: string;
|
|
49
|
+
message: string;
|
|
48
50
|
}): Promise<any>;
|
|
49
|
-
clientSign({ chainName,
|
|
51
|
+
clientSign({ chainName, message, roomId, }: {
|
|
50
52
|
chainName: string;
|
|
51
|
-
|
|
53
|
+
message: string;
|
|
52
54
|
roomId: string;
|
|
53
55
|
}): Promise<Uint8Array | EcdsaSignature>;
|
|
54
|
-
sign({ chainName,
|
|
56
|
+
sign({ chainName, message, }: {
|
|
55
57
|
chainName: string;
|
|
56
|
-
|
|
58
|
+
message: string;
|
|
57
59
|
}): Promise<Uint8Array | EcdsaSignature>;
|
|
58
|
-
refreshWalletAccountShares({ chainName, clientPrimaryKeyshare, clientSecondaryKeyshare, }: {
|
|
60
|
+
refreshWalletAccountShares({ chainName, walletId, clientPrimaryKeyshare, clientSecondaryKeyshare, }: {
|
|
59
61
|
chainName: string;
|
|
62
|
+
walletId: string;
|
|
60
63
|
clientPrimaryKeyshare: EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
|
|
61
64
|
clientSecondaryKeyshare: EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
|
|
62
65
|
}): Promise<[EcdsaKeygenResult | BIP340KeygenResult, EcdsaKeygenResult | BIP340KeygenResult]>;
|
|
63
|
-
serverReshareRemainingParty({
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
serverReshareRemainingParty({ walletId, clientKeygenIds, }: {
|
|
67
|
+
walletId: string;
|
|
68
|
+
clientKeygenIds: string[];
|
|
66
69
|
}): Promise<any>;
|
|
67
70
|
getKeygenId({ chainName, clientKeyshare, }: {
|
|
68
71
|
chainName: string;
|
|
69
72
|
clientKeyshare: EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
|
|
70
73
|
}): Promise<string>;
|
|
71
|
-
reshareRemainingParty({ chainName, clientKeyshare, }: {
|
|
74
|
+
reshareRemainingParty({ chainName, walletId, clientKeyshare, }: {
|
|
72
75
|
chainName: string;
|
|
76
|
+
walletId: string;
|
|
73
77
|
clientKeyshare: EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
|
|
74
78
|
}): Promise<[EcdsaKeygenResult | BIP340KeygenResult, EcdsaKeygenResult | BIP340KeygenResult]>;
|
|
75
|
-
exportPrivateKey({ chainName, clientKeyshare, }: {
|
|
79
|
+
exportPrivateKey({ chainName, clientKeyshare, walletId, }: {
|
|
76
80
|
chainName: string;
|
|
77
81
|
clientKeyshare: EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
|
|
82
|
+
walletId: string;
|
|
78
83
|
}): Promise<{
|
|
79
84
|
derivedPrivateKey: string | undefined;
|
|
80
85
|
}>;
|
|
@@ -88,7 +93,8 @@ export declare class DynamicWalletClient {
|
|
|
88
93
|
keyShare: ClientKeyshare;
|
|
89
94
|
password?: string;
|
|
90
95
|
}): Promise<string>;
|
|
91
|
-
storeEncryptedBackup({ keyShare, password, }: {
|
|
96
|
+
storeEncryptedBackup({ walletId, keyShare, password, }: {
|
|
97
|
+
walletId: string;
|
|
92
98
|
keyShare: ClientKeyshare;
|
|
93
99
|
password?: string;
|
|
94
100
|
}): Promise<any>;
|
|
@@ -96,13 +102,16 @@ export declare class DynamicWalletClient {
|
|
|
96
102
|
keyShare: string;
|
|
97
103
|
password?: string;
|
|
98
104
|
}): Promise<any>;
|
|
99
|
-
recoverEncryptedBackup({ password }
|
|
105
|
+
recoverEncryptedBackup({ walletId, keyShareId, password, }: {
|
|
106
|
+
walletId: string;
|
|
107
|
+
keyShareId: string;
|
|
100
108
|
password?: string;
|
|
101
109
|
}): Promise<any>;
|
|
102
110
|
restoreBackupShare({ keyShare }: {
|
|
103
111
|
keyShare: ClientKeyshare;
|
|
104
112
|
}): void;
|
|
105
113
|
getClientShare(): Promise<ClientKeyshare | undefined>;
|
|
114
|
+
setClientShare(clientKeyshare: ClientKeyshare): Promise<void>;
|
|
106
115
|
backupFileToGoogleDrive({ oauthAccountId, fileName, jsonData, password, }: {
|
|
107
116
|
oauthAccountId: string;
|
|
108
117
|
fileName?: string;
|
|
@@ -114,5 +123,12 @@ export declare class DynamicWalletClient {
|
|
|
114
123
|
name?: string;
|
|
115
124
|
password?: string;
|
|
116
125
|
}): Promise<ClientKeyshare | null>;
|
|
126
|
+
importRawPrivateKey({ chainName, walletId, privateKey, }: {
|
|
127
|
+
chainName: string;
|
|
128
|
+
walletId: string;
|
|
129
|
+
privateKey: string;
|
|
130
|
+
}): Promise<ClientKeyshare[]>;
|
|
131
|
+
getWalletId(): Promise<string | undefined>;
|
|
132
|
+
setWalletId(walletId: string): Promise<void>;
|
|
117
133
|
}
|
|
118
134
|
//# sourceMappingURL=client.d.ts.map
|
package/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAQA,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,qBAAa,mBAAmB;IACvB,aAAa,EAAE,MAAM,CAAC;IAE7B,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,CAAS;gBAEd,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,cAAc,GACf,EAAE;QACD,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,cAAc,CAAC,EAA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AAC;IAmDvB,WAAW;IAIX,WAAW,CAAC,QAAQ,EAAE,MAAM;CAGnC"}
|
package/src/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,mCAAmC,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../packages/src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,mCAAmC,CAAC"}
|
package/src/index.d.ts
CHANGED
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAE1C,cAAc,aAAa,CAAC;AAE5B,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAE1C,cAAc,aAAa,CAAC;AAE5B,cAAc,UAAU,CAAC;AAEzB,cAAc,aAAa,CAAC"}
|
package/src/mpc/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,OAAO,EACP,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,cAAc,EACf,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,KAAK,EACL,OAAO,EACP,MAAM,EACN,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,cAAc,GACf,CAAC;AAEF,cAAc,OAAO,CAAC"}
|
package/src/mpc/mpc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mpc.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"mpc.d.ts","sourceRoot":"","sources":["../../src/mpc/mpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1E,eAAO,MAAM,qBAAqB,wCAG/B;IACD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,6BAWA,CAAC;AAEF,eAAO,MAAM,YAAY,iCAGtB;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,6BAOA,CAAC"}
|
package/src/mpc/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/mpc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,kCAAkC,CAAC;AAE1C,MAAM,MAAM,sBAAsB,GAC9B,qBAAqB,GACrB,uBAAuB,GACvB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,mBAAmB,GACnB,kBAAkB,CAAC;AAGrB,YAAY,EACV,KAAK,EACL,OAAO,EACP,MAAM,EACN,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,cAAc,GACf,MAAM,kCAAkC,CAAC"}
|
package/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,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"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,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"}
|