@dynamic-labs-wallet/browser 0.0.2 → 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 +79 -38
- package/package.json +3 -3
- package/src/backup/encryption.d.ts.map +1 -1
- package/src/backup/providers/googleDrive.d.ts.map +1 -1
- package/src/client.d.ts +31 -19
- package/src/client.d.ts.map +1 -1
- package/src/constants.d.ts.map +1 -1
- 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,46 +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
|
-
|
|
314
|
-
|
|
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
|
+
}
|
|
315
330
|
}
|
|
316
|
-
async sign({ chainName,
|
|
331
|
+
async sign({ chainName, message }) {
|
|
332
|
+
if (!this.walletId) {
|
|
333
|
+
throw new Error('Wallet ID is not set');
|
|
334
|
+
}
|
|
317
335
|
// Perform the server sign
|
|
318
336
|
const data = await this.serverSign({
|
|
319
|
-
|
|
337
|
+
walletId: this.walletId,
|
|
338
|
+
message
|
|
320
339
|
});
|
|
321
340
|
// Perform the client sign and return the signature
|
|
322
341
|
const signature = await this.clientSign({
|
|
323
342
|
chainName,
|
|
324
|
-
|
|
343
|
+
message,
|
|
325
344
|
roomId: data.roomId
|
|
326
345
|
});
|
|
327
346
|
return signature;
|
|
328
347
|
}
|
|
329
|
-
async refreshWalletAccountShares({ chainName, clientPrimaryKeyshare, clientSecondaryKeyshare }) {
|
|
348
|
+
async refreshWalletAccountShares({ chainName, walletId, clientPrimaryKeyshare, clientSecondaryKeyshare }) {
|
|
330
349
|
const mpcSigner = getMPCSigner({
|
|
331
350
|
chainName,
|
|
332
351
|
baseRelayUrl: RELAY_API_URL
|
|
333
352
|
});
|
|
334
353
|
// Create the room and refresh the shares
|
|
335
|
-
const data = await this.apiClient.refreshWalletAccountShares(
|
|
354
|
+
const data = await this.apiClient.refreshWalletAccountShares({
|
|
355
|
+
walletId
|
|
356
|
+
});
|
|
336
357
|
const roomId = data.roomId;
|
|
337
358
|
const keygenResults = await Promise.all([
|
|
338
359
|
mpcSigner.refresh(roomId, clientPrimaryKeyshare),
|
|
@@ -341,10 +362,10 @@ class DynamicWalletClient {
|
|
|
341
362
|
this.clientKeyshare = keygenResults[0];
|
|
342
363
|
return keygenResults;
|
|
343
364
|
}
|
|
344
|
-
async serverReshareRemainingParty({
|
|
365
|
+
async serverReshareRemainingParty({ walletId, clientKeygenIds }) {
|
|
345
366
|
const data = await this.apiClient.reshareRemainingParty({
|
|
346
|
-
|
|
347
|
-
|
|
367
|
+
walletId,
|
|
368
|
+
clientKeygenIds
|
|
348
369
|
});
|
|
349
370
|
return data;
|
|
350
371
|
}
|
|
@@ -356,7 +377,7 @@ class DynamicWalletClient {
|
|
|
356
377
|
const exportId = await mpcSigner.exportID(clientKeyshare);
|
|
357
378
|
return exportId;
|
|
358
379
|
}
|
|
359
|
-
async reshareRemainingParty({ chainName, clientKeyshare }) {
|
|
380
|
+
async reshareRemainingParty({ chainName, walletId, clientKeyshare }) {
|
|
360
381
|
const mpcSigner = getMPCSigner({
|
|
361
382
|
chainName,
|
|
362
383
|
baseRelayUrl: RELAY_API_URL
|
|
@@ -370,8 +391,11 @@ class DynamicWalletClient {
|
|
|
370
391
|
});
|
|
371
392
|
// Create the room and reshare the server share
|
|
372
393
|
const data = await this.serverReshareRemainingParty({
|
|
373
|
-
|
|
374
|
-
|
|
394
|
+
walletId,
|
|
395
|
+
clientKeygenIds: [
|
|
396
|
+
newPartyInitKeygenId,
|
|
397
|
+
clientKeygenId
|
|
398
|
+
]
|
|
375
399
|
});
|
|
376
400
|
const roomId = data.roomId;
|
|
377
401
|
// Get the MPC config for the threshold signature scheme
|
|
@@ -393,7 +417,7 @@ class DynamicWalletClient {
|
|
|
393
417
|
this.clientKeyshare = keygenResults[0];
|
|
394
418
|
return keygenResults;
|
|
395
419
|
}
|
|
396
|
-
async exportPrivateKey({ chainName, clientKeyshare }) {
|
|
420
|
+
async exportPrivateKey({ chainName, clientKeyshare, walletId }) {
|
|
397
421
|
const chainConfig = getMPCChainConfig(chainName);
|
|
398
422
|
const mpcSigner = getMPCSigner({
|
|
399
423
|
chainName,
|
|
@@ -404,6 +428,7 @@ class DynamicWalletClient {
|
|
|
404
428
|
clientKeyshare
|
|
405
429
|
});
|
|
406
430
|
const data = await this.apiClient.exportKey({
|
|
431
|
+
walletId,
|
|
407
432
|
exportId
|
|
408
433
|
});
|
|
409
434
|
const keyExportRaw = await mpcSigner.exportFullPrivateKey(data.roomId, clientKeyshare, exportId);
|
|
@@ -456,12 +481,13 @@ class DynamicWalletClient {
|
|
|
456
481
|
const serializedEncryptedKeyShare = Buffer.from(JSON.stringify(encryptedKeyShare)).toString('base64');
|
|
457
482
|
return serializedEncryptedKeyShare;
|
|
458
483
|
}
|
|
459
|
-
async storeEncryptedBackup({ keyShare, password }) {
|
|
484
|
+
async storeEncryptedBackup({ walletId, keyShare, password }) {
|
|
460
485
|
const encryptedKeyShare = await this.encryptKeyShare({
|
|
461
486
|
keyShare,
|
|
462
487
|
password
|
|
463
488
|
});
|
|
464
489
|
const data = await this.apiClient.storeEncryptedBackup({
|
|
490
|
+
walletId,
|
|
465
491
|
keyShare: encryptedKeyShare
|
|
466
492
|
});
|
|
467
493
|
return data;
|
|
@@ -475,8 +501,11 @@ class DynamicWalletClient {
|
|
|
475
501
|
const deserializedKeyShare = JSON.parse(decryptedKeyShare);
|
|
476
502
|
return deserializedKeyShare;
|
|
477
503
|
}
|
|
478
|
-
async recoverEncryptedBackup({
|
|
479
|
-
const data = await this.apiClient.recoverEncryptedBackup(
|
|
504
|
+
async recoverEncryptedBackup({ walletId, keyShareId, password }) {
|
|
505
|
+
const data = await this.apiClient.recoverEncryptedBackup({
|
|
506
|
+
walletId,
|
|
507
|
+
keyShareId
|
|
508
|
+
});
|
|
480
509
|
const decryptedKeyShare = await this.decryptKeyShare({
|
|
481
510
|
keyShare: data.keyShare,
|
|
482
511
|
password: password != null ? password : this.environmentId
|
|
@@ -492,6 +521,9 @@ class DynamicWalletClient {
|
|
|
492
521
|
async getClientShare() {
|
|
493
522
|
return this.clientKeyshare;
|
|
494
523
|
}
|
|
524
|
+
async setClientShare(clientKeyshare) {
|
|
525
|
+
this.clientKeyshare = clientKeyshare;
|
|
526
|
+
}
|
|
495
527
|
async backupFileToGoogleDrive({ oauthAccountId, fileName = BACKUP_FILENAME, jsonData, password }) {
|
|
496
528
|
const encryptedKeyShare = await this.encryptKeyShare({
|
|
497
529
|
keyShare: jsonData,
|
|
@@ -524,7 +556,7 @@ class DynamicWalletClient {
|
|
|
524
556
|
});
|
|
525
557
|
return decryptedKeyShare;
|
|
526
558
|
}
|
|
527
|
-
async importRawPrivateKey({ chainName, privateKey }) {
|
|
559
|
+
async importRawPrivateKey({ chainName, walletId, privateKey }) {
|
|
528
560
|
const mpcSigner = getMPCSigner({
|
|
529
561
|
chainName,
|
|
530
562
|
baseRelayUrl: RELAY_API_URL
|
|
@@ -542,8 +574,11 @@ class DynamicWalletClient {
|
|
|
542
574
|
// --- 3. join the room as a party for the 2/3 ceremony
|
|
543
575
|
const { roomId, serverKeygenId } = await this.apiClient.importPrivateKey({
|
|
544
576
|
chainName,
|
|
545
|
-
|
|
546
|
-
|
|
577
|
+
walletId,
|
|
578
|
+
clientKeygenIds: [
|
|
579
|
+
clientPrimaryKeygenId,
|
|
580
|
+
clientSecondaryKeygenId
|
|
581
|
+
]
|
|
547
582
|
});
|
|
548
583
|
const threshold = MPC_CONFIG[ThresholdSignatureScheme.TWO_OF_THREE].threshold;
|
|
549
584
|
// prep
|
|
@@ -566,6 +601,12 @@ class DynamicWalletClient {
|
|
|
566
601
|
clientSecondaryKeygenResult
|
|
567
602
|
];
|
|
568
603
|
}
|
|
604
|
+
async getWalletId() {
|
|
605
|
+
return this.walletId;
|
|
606
|
+
}
|
|
607
|
+
async setWalletId(walletId) {
|
|
608
|
+
this.walletId = walletId;
|
|
609
|
+
}
|
|
569
610
|
constructor({ environmentId, authToken, baseApiUrl, clientKeyshare }){
|
|
570
611
|
this.environmentId = environmentId;
|
|
571
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"
|
|
@@ -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,9 +123,12 @@ export declare class DynamicWalletClient {
|
|
|
114
123
|
name?: string;
|
|
115
124
|
password?: string;
|
|
116
125
|
}): Promise<ClientKeyshare | null>;
|
|
117
|
-
importRawPrivateKey({ chainName, privateKey }: {
|
|
126
|
+
importRawPrivateKey({ chainName, walletId, privateKey, }: {
|
|
118
127
|
chainName: string;
|
|
128
|
+
walletId: string;
|
|
119
129
|
privateKey: string;
|
|
120
130
|
}): Promise<ClientKeyshare[]>;
|
|
131
|
+
getWalletId(): Promise<string | undefined>;
|
|
132
|
+
setWalletId(walletId: string): Promise<void>;
|
|
121
133
|
}
|
|
122
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,E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sB,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,QAAQ,EACR,UAAU,GACX,EAAE;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;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.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;AAEzB,cAAc,aAAa,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"}
|