@dynamic-labs-wallet/node 0.0.81 → 0.0.83
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 +57 -32
- package/index.esm.js +57 -32
- package/package.json +2 -2
- package/src/client.d.ts +24 -12
- package/src/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -435,16 +435,18 @@ class DynamicWalletClient {
|
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
//todo: need to modify with imported flag
|
|
438
|
-
async sign({ accountAddress, message, chainName, password = undefined }) {
|
|
438
|
+
async sign({ accountAddress, message, chainName, password = undefined, signedSessionId }) {
|
|
439
439
|
await this.verifyPassword({
|
|
440
440
|
accountAddress,
|
|
441
441
|
password,
|
|
442
|
-
walletOperation: core.WalletOperation.SIGN_MESSAGE
|
|
442
|
+
walletOperation: core.WalletOperation.SIGN_MESSAGE,
|
|
443
|
+
signedSessionId
|
|
443
444
|
});
|
|
444
445
|
const wallet = await this.getWallet({
|
|
445
446
|
accountAddress,
|
|
446
447
|
walletOperation: core.WalletOperation.SIGN_MESSAGE,
|
|
447
|
-
password
|
|
448
|
+
password,
|
|
449
|
+
signedSessionId
|
|
448
450
|
});
|
|
449
451
|
// Perform the dynamic server sign
|
|
450
452
|
const data = await this.dynamicServerSign({
|
|
@@ -462,17 +464,19 @@ class DynamicWalletClient {
|
|
|
462
464
|
});
|
|
463
465
|
return signature;
|
|
464
466
|
}
|
|
465
|
-
async refreshWalletAccountShares({ accountAddress, chainName, password = undefined }) {
|
|
467
|
+
async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, signedSessionId }) {
|
|
466
468
|
this.ensureApiClientAuthenticated();
|
|
467
469
|
await this.verifyPassword({
|
|
468
470
|
accountAddress,
|
|
469
471
|
password,
|
|
470
|
-
walletOperation: core.WalletOperation.REFRESH
|
|
472
|
+
walletOperation: core.WalletOperation.REFRESH,
|
|
473
|
+
signedSessionId
|
|
471
474
|
});
|
|
472
475
|
const wallet = await this.getWallet({
|
|
473
476
|
accountAddress,
|
|
474
477
|
walletOperation: core.WalletOperation.REFRESH,
|
|
475
|
-
password
|
|
478
|
+
password,
|
|
479
|
+
signedSessionId
|
|
476
480
|
});
|
|
477
481
|
const mpcSigner = getMPCSigner({
|
|
478
482
|
chainName,
|
|
@@ -490,7 +494,8 @@ class DynamicWalletClient {
|
|
|
490
494
|
});
|
|
491
495
|
await this.storeEncryptedBackupByWallet({
|
|
492
496
|
accountAddress,
|
|
493
|
-
password: password != null ? password : this.environmentId
|
|
497
|
+
password: password != null ? password : this.environmentId,
|
|
498
|
+
signedSessionId
|
|
494
499
|
});
|
|
495
500
|
return refreshResults;
|
|
496
501
|
}
|
|
@@ -543,12 +548,13 @@ class DynamicWalletClient {
|
|
|
543
548
|
existingExternalServerKeyShares
|
|
544
549
|
};
|
|
545
550
|
}
|
|
546
|
-
async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined }) {
|
|
551
|
+
async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined, signedSessionId }) {
|
|
547
552
|
this.ensureApiClientAuthenticated();
|
|
548
553
|
await this.verifyPassword({
|
|
549
554
|
accountAddress,
|
|
550
555
|
password,
|
|
551
|
-
walletOperation: core.WalletOperation.RESHARE
|
|
556
|
+
walletOperation: core.WalletOperation.RESHARE,
|
|
557
|
+
signedSessionId
|
|
552
558
|
});
|
|
553
559
|
const { existingExternalServerShareCount } = core.getServerWalletReshareConfig({
|
|
554
560
|
oldThresholdSignatureScheme,
|
|
@@ -558,7 +564,8 @@ class DynamicWalletClient {
|
|
|
558
564
|
accountAddress,
|
|
559
565
|
walletOperation: core.WalletOperation.RESHARE,
|
|
560
566
|
shareCount: existingExternalServerShareCount,
|
|
561
|
-
password
|
|
567
|
+
password,
|
|
568
|
+
signedSessionId
|
|
562
569
|
});
|
|
563
570
|
const { newExternalServerInitKeygenResults, newExternalServerKeygenIds, existingExternalServerKeygenIds, existingExternalServerKeyShares } = await this.reshareStrategy({
|
|
564
571
|
chainName,
|
|
@@ -600,21 +607,24 @@ class DynamicWalletClient {
|
|
|
600
607
|
});
|
|
601
608
|
await this.storeEncryptedBackupByWallet({
|
|
602
609
|
accountAddress,
|
|
603
|
-
password
|
|
610
|
+
password,
|
|
611
|
+
signedSessionId
|
|
604
612
|
});
|
|
605
613
|
return reshareResults;
|
|
606
614
|
}
|
|
607
|
-
async exportKey({ accountAddress, chainName, password = undefined }) {
|
|
615
|
+
async exportKey({ accountAddress, chainName, password = undefined, signedSessionId }) {
|
|
608
616
|
this.ensureApiClientAuthenticated();
|
|
609
617
|
await this.verifyPassword({
|
|
610
618
|
accountAddress,
|
|
611
619
|
password,
|
|
612
|
-
walletOperation: core.WalletOperation.EXPORT_PRIVATE_KEY
|
|
620
|
+
walletOperation: core.WalletOperation.EXPORT_PRIVATE_KEY,
|
|
621
|
+
signedSessionId
|
|
613
622
|
});
|
|
614
623
|
const wallet = await this.getWallet({
|
|
615
624
|
accountAddress,
|
|
616
625
|
password,
|
|
617
|
-
walletOperation: core.WalletOperation.EXPORT_PRIVATE_KEY
|
|
626
|
+
walletOperation: core.WalletOperation.EXPORT_PRIVATE_KEY,
|
|
627
|
+
signedSessionId
|
|
618
628
|
});
|
|
619
629
|
const mpcSigner = getMPCSigner({
|
|
620
630
|
chainName,
|
|
@@ -700,7 +710,7 @@ class DynamicWalletClient {
|
|
|
700
710
|
throw new Error('Ceremony completion timeout');
|
|
701
711
|
}
|
|
702
712
|
}
|
|
703
|
-
async storeEncryptedBackupByWallet({ accountAddress, externalServerKeyShares = undefined, password = undefined }) {
|
|
713
|
+
async storeEncryptedBackupByWallet({ accountAddress, externalServerKeyShares = undefined, password = undefined, signedSessionId }) {
|
|
704
714
|
this.ensureApiClientAuthenticated();
|
|
705
715
|
//add retry logic for ceremony completion to prevent race condition
|
|
706
716
|
await this.ensureCeremonyCompletionBeforeBackup({
|
|
@@ -708,7 +718,8 @@ class DynamicWalletClient {
|
|
|
708
718
|
});
|
|
709
719
|
try {
|
|
710
720
|
const keySharesToBackup = externalServerKeyShares != null ? externalServerKeyShares : await this.getExternalServerKeyShares({
|
|
711
|
-
accountAddress
|
|
721
|
+
accountAddress,
|
|
722
|
+
signedSessionId
|
|
712
723
|
});
|
|
713
724
|
if (!keySharesToBackup || keySharesToBackup.length === 0) {
|
|
714
725
|
throw new Error(`Key shares not found for accountAddress: ${accountAddress}`);
|
|
@@ -720,10 +731,12 @@ class DynamicWalletClient {
|
|
|
720
731
|
if (!this.walletMap[accountAddress] || !this.walletMap[accountAddress].walletId) {
|
|
721
732
|
throw new Error(`WalletId not found for accountAddress: ${accountAddress}`);
|
|
722
733
|
}
|
|
734
|
+
// TODO(zfaizal2): throw error if signedSessionId is not provided after service deploy
|
|
723
735
|
const data = await this.apiClient.storeEncryptedBackupByWallet({
|
|
724
736
|
walletId: this.walletMap[accountAddress].walletId,
|
|
725
737
|
encryptedKeyShares,
|
|
726
|
-
passwordEncrypted: Boolean(password) && password !== this.environmentId
|
|
738
|
+
passwordEncrypted: Boolean(password) && password !== this.environmentId,
|
|
739
|
+
signedSessionId
|
|
727
740
|
});
|
|
728
741
|
this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress], {
|
|
729
742
|
externalServerKeySharesBackupInfo: getExternalServerKeyShareBackupInfo({
|
|
@@ -740,11 +753,12 @@ class DynamicWalletClient {
|
|
|
740
753
|
throw error;
|
|
741
754
|
}
|
|
742
755
|
}
|
|
743
|
-
async storeEncryptedBackupByWalletWithRetry({ accountAddress, externalServerKeyShares, password }) {
|
|
756
|
+
async storeEncryptedBackupByWalletWithRetry({ accountAddress, externalServerKeyShares, password, signedSessionId }) {
|
|
744
757
|
await retryPromise(()=>this.storeEncryptedBackupByWallet({
|
|
745
758
|
accountAddress,
|
|
746
759
|
externalServerKeyShares,
|
|
747
|
-
password
|
|
760
|
+
password,
|
|
761
|
+
signedSessionId
|
|
748
762
|
}), {
|
|
749
763
|
operationName: 'store encrypted backup',
|
|
750
764
|
logContext: {
|
|
@@ -756,23 +770,26 @@ class DynamicWalletClient {
|
|
|
756
770
|
}
|
|
757
771
|
});
|
|
758
772
|
}
|
|
759
|
-
async getExternalServerKeyShares({ accountAddress, password }) {
|
|
773
|
+
async getExternalServerKeyShares({ accountAddress, password, signedSessionId }) {
|
|
760
774
|
const wallet = await this.getWallet({
|
|
761
775
|
accountAddress,
|
|
762
776
|
password,
|
|
763
|
-
walletOperation: core.WalletOperation.REACH_THRESHOLD
|
|
777
|
+
walletOperation: core.WalletOperation.REACH_THRESHOLD,
|
|
778
|
+
signedSessionId
|
|
764
779
|
});
|
|
765
780
|
return wallet.externalServerKeyShares;
|
|
766
781
|
}
|
|
767
|
-
async updatePassword({ accountAddress, existingPassword, newPassword }) {
|
|
782
|
+
async updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId }) {
|
|
768
783
|
await this.getWallet({
|
|
769
784
|
accountAddress,
|
|
770
785
|
password: existingPassword,
|
|
771
|
-
walletOperation: core.WalletOperation.REACH_ALL_PARTIES
|
|
786
|
+
walletOperation: core.WalletOperation.REACH_ALL_PARTIES,
|
|
787
|
+
signedSessionId
|
|
772
788
|
});
|
|
773
789
|
await this.storeEncryptedBackupByWallet({
|
|
774
790
|
accountAddress,
|
|
775
|
-
password: newPassword
|
|
791
|
+
password: newPassword,
|
|
792
|
+
signedSessionId
|
|
776
793
|
});
|
|
777
794
|
}
|
|
778
795
|
async decryptKeyShare({ keyShare, password }) {
|
|
@@ -811,7 +828,7 @@ class DynamicWalletClient {
|
|
|
811
828
|
requiredShareCount
|
|
812
829
|
};
|
|
813
830
|
}
|
|
814
|
-
async recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, shareCount = undefined, storeRecoveredShares = true }) {
|
|
831
|
+
async recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, signedSessionId, shareCount = undefined, storeRecoveredShares = true }) {
|
|
815
832
|
this.ensureApiClientAuthenticated();
|
|
816
833
|
const wallet = this.walletMap[accountAddress];
|
|
817
834
|
this.logger.debug(`recoverEncryptedBackupByWallet wallet: ${walletOperation}`, wallet);
|
|
@@ -824,7 +841,8 @@ class DynamicWalletClient {
|
|
|
824
841
|
const { dynamic: dynamicKeyShareIds } = shares;
|
|
825
842
|
const data = await this.apiClient.recoverEncryptedBackupByWallet({
|
|
826
843
|
walletId: wallet.walletId,
|
|
827
|
-
keyShareIds: dynamicKeyShareIds
|
|
844
|
+
keyShareIds: dynamicKeyShareIds,
|
|
845
|
+
signedSessionId
|
|
828
846
|
});
|
|
829
847
|
const dynamicKeyShares = data.keyShares.filter((keyShare)=>keyShare.encryptedAccountCredential !== null && keyShare.backupLocation === core.BackupLocation.DYNAMIC);
|
|
830
848
|
const decryptedKeyShares = await Promise.all(dynamicKeyShares.map((keyShare)=>this.decryptKeyShare({
|
|
@@ -838,15 +856,17 @@ class DynamicWalletClient {
|
|
|
838
856
|
}
|
|
839
857
|
return decryptedKeyShares;
|
|
840
858
|
}
|
|
841
|
-
async exportExternalServerKeyShares({ accountAddress, password }) {
|
|
859
|
+
async exportExternalServerKeyShares({ accountAddress, password, signedSessionId }) {
|
|
842
860
|
await this.verifyPassword({
|
|
843
861
|
accountAddress,
|
|
844
862
|
password,
|
|
845
|
-
walletOperation: core.WalletOperation.REACH_ALL_PARTIES
|
|
863
|
+
walletOperation: core.WalletOperation.REACH_ALL_PARTIES,
|
|
864
|
+
signedSessionId
|
|
846
865
|
});
|
|
847
866
|
const externalServerKeyShares = await this.getExternalServerKeyShares({
|
|
848
867
|
accountAddress,
|
|
849
|
-
password
|
|
868
|
+
password,
|
|
869
|
+
signedSessionId
|
|
850
870
|
});
|
|
851
871
|
return externalServerKeyShares;
|
|
852
872
|
}
|
|
@@ -895,11 +915,12 @@ class DynamicWalletClient {
|
|
|
895
915
|
* verifyPassword attempts to recover and decrypt a single client key share using the provided password.
|
|
896
916
|
* If successful, the key share is encrypted with the new password. This method solely performs the recovery
|
|
897
917
|
* and decryption without storing the restored key shares. If unsuccessful, it throws an error.
|
|
898
|
-
*/ async verifyPassword({ accountAddress, password = undefined, walletOperation = core.WalletOperation.NO_OPERATION }) {
|
|
918
|
+
*/ async verifyPassword({ accountAddress, password = undefined, walletOperation = core.WalletOperation.NO_OPERATION, signedSessionId }) {
|
|
899
919
|
await this.getWallet({
|
|
900
920
|
accountAddress,
|
|
901
921
|
password,
|
|
902
|
-
walletOperation
|
|
922
|
+
walletOperation,
|
|
923
|
+
signedSessionId
|
|
903
924
|
});
|
|
904
925
|
if (await this.requiresPasswordForOperation({
|
|
905
926
|
accountAddress,
|
|
@@ -919,10 +940,12 @@ class DynamicWalletClient {
|
|
|
919
940
|
throw new Error('No dynamic key shares found');
|
|
920
941
|
}
|
|
921
942
|
try {
|
|
943
|
+
// TODO(zfaizal2): throw error if signedSessionId is not provided after service deploy
|
|
922
944
|
await this.recoverEncryptedBackupByWallet({
|
|
923
945
|
accountAddress,
|
|
924
946
|
password,
|
|
925
947
|
walletOperation,
|
|
948
|
+
signedSessionId,
|
|
926
949
|
shareCount: 1,
|
|
927
950
|
storeRecoveredShares: false
|
|
928
951
|
});
|
|
@@ -985,7 +1008,7 @@ class DynamicWalletClient {
|
|
|
985
1008
|
walletProperties: wallet == null ? void 0 : wallet.walletProperties
|
|
986
1009
|
});
|
|
987
1010
|
}
|
|
988
|
-
async getWallet({ accountAddress, walletOperation = core.WalletOperation.NO_OPERATION, shareCount = undefined, password = undefined }) {
|
|
1011
|
+
async getWallet({ accountAddress, walletOperation = core.WalletOperation.NO_OPERATION, signedSessionId, shareCount = undefined, password = undefined }) {
|
|
989
1012
|
var _user_verifiedCredentials;
|
|
990
1013
|
this.ensureApiClientAuthenticated();
|
|
991
1014
|
const existingWalletCheck = await this.checkWalletFields({
|
|
@@ -1017,10 +1040,12 @@ class DynamicWalletClient {
|
|
|
1017
1040
|
accountAddress,
|
|
1018
1041
|
walletOperation
|
|
1019
1042
|
})) {
|
|
1043
|
+
// TODO(zfaizal2): throw error if signedSessionId is not provided after service deploy
|
|
1020
1044
|
const decryptedKeyShares = await this.recoverEncryptedBackupByWallet({
|
|
1021
1045
|
accountAddress,
|
|
1022
1046
|
password: password != null ? password : this.environmentId,
|
|
1023
1047
|
walletOperation: walletOperation,
|
|
1048
|
+
signedSessionId,
|
|
1024
1049
|
shareCount
|
|
1025
1050
|
});
|
|
1026
1051
|
this.logger.debug('Recovered backup', decryptedKeyShares);
|
package/index.esm.js
CHANGED
|
@@ -435,16 +435,18 @@ class DynamicWalletClient {
|
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
//todo: need to modify with imported flag
|
|
438
|
-
async sign({ accountAddress, message, chainName, password = undefined }) {
|
|
438
|
+
async sign({ accountAddress, message, chainName, password = undefined, signedSessionId }) {
|
|
439
439
|
await this.verifyPassword({
|
|
440
440
|
accountAddress,
|
|
441
441
|
password,
|
|
442
|
-
walletOperation: WalletOperation.SIGN_MESSAGE
|
|
442
|
+
walletOperation: WalletOperation.SIGN_MESSAGE,
|
|
443
|
+
signedSessionId
|
|
443
444
|
});
|
|
444
445
|
const wallet = await this.getWallet({
|
|
445
446
|
accountAddress,
|
|
446
447
|
walletOperation: WalletOperation.SIGN_MESSAGE,
|
|
447
|
-
password
|
|
448
|
+
password,
|
|
449
|
+
signedSessionId
|
|
448
450
|
});
|
|
449
451
|
// Perform the dynamic server sign
|
|
450
452
|
const data = await this.dynamicServerSign({
|
|
@@ -462,17 +464,19 @@ class DynamicWalletClient {
|
|
|
462
464
|
});
|
|
463
465
|
return signature;
|
|
464
466
|
}
|
|
465
|
-
async refreshWalletAccountShares({ accountAddress, chainName, password = undefined }) {
|
|
467
|
+
async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, signedSessionId }) {
|
|
466
468
|
this.ensureApiClientAuthenticated();
|
|
467
469
|
await this.verifyPassword({
|
|
468
470
|
accountAddress,
|
|
469
471
|
password,
|
|
470
|
-
walletOperation: WalletOperation.REFRESH
|
|
472
|
+
walletOperation: WalletOperation.REFRESH,
|
|
473
|
+
signedSessionId
|
|
471
474
|
});
|
|
472
475
|
const wallet = await this.getWallet({
|
|
473
476
|
accountAddress,
|
|
474
477
|
walletOperation: WalletOperation.REFRESH,
|
|
475
|
-
password
|
|
478
|
+
password,
|
|
479
|
+
signedSessionId
|
|
476
480
|
});
|
|
477
481
|
const mpcSigner = getMPCSigner({
|
|
478
482
|
chainName,
|
|
@@ -490,7 +494,8 @@ class DynamicWalletClient {
|
|
|
490
494
|
});
|
|
491
495
|
await this.storeEncryptedBackupByWallet({
|
|
492
496
|
accountAddress,
|
|
493
|
-
password: password != null ? password : this.environmentId
|
|
497
|
+
password: password != null ? password : this.environmentId,
|
|
498
|
+
signedSessionId
|
|
494
499
|
});
|
|
495
500
|
return refreshResults;
|
|
496
501
|
}
|
|
@@ -543,12 +548,13 @@ class DynamicWalletClient {
|
|
|
543
548
|
existingExternalServerKeyShares
|
|
544
549
|
};
|
|
545
550
|
}
|
|
546
|
-
async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined }) {
|
|
551
|
+
async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined, signedSessionId }) {
|
|
547
552
|
this.ensureApiClientAuthenticated();
|
|
548
553
|
await this.verifyPassword({
|
|
549
554
|
accountAddress,
|
|
550
555
|
password,
|
|
551
|
-
walletOperation: WalletOperation.RESHARE
|
|
556
|
+
walletOperation: WalletOperation.RESHARE,
|
|
557
|
+
signedSessionId
|
|
552
558
|
});
|
|
553
559
|
const { existingExternalServerShareCount } = getServerWalletReshareConfig({
|
|
554
560
|
oldThresholdSignatureScheme,
|
|
@@ -558,7 +564,8 @@ class DynamicWalletClient {
|
|
|
558
564
|
accountAddress,
|
|
559
565
|
walletOperation: WalletOperation.RESHARE,
|
|
560
566
|
shareCount: existingExternalServerShareCount,
|
|
561
|
-
password
|
|
567
|
+
password,
|
|
568
|
+
signedSessionId
|
|
562
569
|
});
|
|
563
570
|
const { newExternalServerInitKeygenResults, newExternalServerKeygenIds, existingExternalServerKeygenIds, existingExternalServerKeyShares } = await this.reshareStrategy({
|
|
564
571
|
chainName,
|
|
@@ -600,21 +607,24 @@ class DynamicWalletClient {
|
|
|
600
607
|
});
|
|
601
608
|
await this.storeEncryptedBackupByWallet({
|
|
602
609
|
accountAddress,
|
|
603
|
-
password
|
|
610
|
+
password,
|
|
611
|
+
signedSessionId
|
|
604
612
|
});
|
|
605
613
|
return reshareResults;
|
|
606
614
|
}
|
|
607
|
-
async exportKey({ accountAddress, chainName, password = undefined }) {
|
|
615
|
+
async exportKey({ accountAddress, chainName, password = undefined, signedSessionId }) {
|
|
608
616
|
this.ensureApiClientAuthenticated();
|
|
609
617
|
await this.verifyPassword({
|
|
610
618
|
accountAddress,
|
|
611
619
|
password,
|
|
612
|
-
walletOperation: WalletOperation.EXPORT_PRIVATE_KEY
|
|
620
|
+
walletOperation: WalletOperation.EXPORT_PRIVATE_KEY,
|
|
621
|
+
signedSessionId
|
|
613
622
|
});
|
|
614
623
|
const wallet = await this.getWallet({
|
|
615
624
|
accountAddress,
|
|
616
625
|
password,
|
|
617
|
-
walletOperation: WalletOperation.EXPORT_PRIVATE_KEY
|
|
626
|
+
walletOperation: WalletOperation.EXPORT_PRIVATE_KEY,
|
|
627
|
+
signedSessionId
|
|
618
628
|
});
|
|
619
629
|
const mpcSigner = getMPCSigner({
|
|
620
630
|
chainName,
|
|
@@ -700,7 +710,7 @@ class DynamicWalletClient {
|
|
|
700
710
|
throw new Error('Ceremony completion timeout');
|
|
701
711
|
}
|
|
702
712
|
}
|
|
703
|
-
async storeEncryptedBackupByWallet({ accountAddress, externalServerKeyShares = undefined, password = undefined }) {
|
|
713
|
+
async storeEncryptedBackupByWallet({ accountAddress, externalServerKeyShares = undefined, password = undefined, signedSessionId }) {
|
|
704
714
|
this.ensureApiClientAuthenticated();
|
|
705
715
|
//add retry logic for ceremony completion to prevent race condition
|
|
706
716
|
await this.ensureCeremonyCompletionBeforeBackup({
|
|
@@ -708,7 +718,8 @@ class DynamicWalletClient {
|
|
|
708
718
|
});
|
|
709
719
|
try {
|
|
710
720
|
const keySharesToBackup = externalServerKeyShares != null ? externalServerKeyShares : await this.getExternalServerKeyShares({
|
|
711
|
-
accountAddress
|
|
721
|
+
accountAddress,
|
|
722
|
+
signedSessionId
|
|
712
723
|
});
|
|
713
724
|
if (!keySharesToBackup || keySharesToBackup.length === 0) {
|
|
714
725
|
throw new Error(`Key shares not found for accountAddress: ${accountAddress}`);
|
|
@@ -720,10 +731,12 @@ class DynamicWalletClient {
|
|
|
720
731
|
if (!this.walletMap[accountAddress] || !this.walletMap[accountAddress].walletId) {
|
|
721
732
|
throw new Error(`WalletId not found for accountAddress: ${accountAddress}`);
|
|
722
733
|
}
|
|
734
|
+
// TODO(zfaizal2): throw error if signedSessionId is not provided after service deploy
|
|
723
735
|
const data = await this.apiClient.storeEncryptedBackupByWallet({
|
|
724
736
|
walletId: this.walletMap[accountAddress].walletId,
|
|
725
737
|
encryptedKeyShares,
|
|
726
|
-
passwordEncrypted: Boolean(password) && password !== this.environmentId
|
|
738
|
+
passwordEncrypted: Boolean(password) && password !== this.environmentId,
|
|
739
|
+
signedSessionId
|
|
727
740
|
});
|
|
728
741
|
this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress], {
|
|
729
742
|
externalServerKeySharesBackupInfo: getExternalServerKeyShareBackupInfo({
|
|
@@ -740,11 +753,12 @@ class DynamicWalletClient {
|
|
|
740
753
|
throw error;
|
|
741
754
|
}
|
|
742
755
|
}
|
|
743
|
-
async storeEncryptedBackupByWalletWithRetry({ accountAddress, externalServerKeyShares, password }) {
|
|
756
|
+
async storeEncryptedBackupByWalletWithRetry({ accountAddress, externalServerKeyShares, password, signedSessionId }) {
|
|
744
757
|
await retryPromise(()=>this.storeEncryptedBackupByWallet({
|
|
745
758
|
accountAddress,
|
|
746
759
|
externalServerKeyShares,
|
|
747
|
-
password
|
|
760
|
+
password,
|
|
761
|
+
signedSessionId
|
|
748
762
|
}), {
|
|
749
763
|
operationName: 'store encrypted backup',
|
|
750
764
|
logContext: {
|
|
@@ -756,23 +770,26 @@ class DynamicWalletClient {
|
|
|
756
770
|
}
|
|
757
771
|
});
|
|
758
772
|
}
|
|
759
|
-
async getExternalServerKeyShares({ accountAddress, password }) {
|
|
773
|
+
async getExternalServerKeyShares({ accountAddress, password, signedSessionId }) {
|
|
760
774
|
const wallet = await this.getWallet({
|
|
761
775
|
accountAddress,
|
|
762
776
|
password,
|
|
763
|
-
walletOperation: WalletOperation.REACH_THRESHOLD
|
|
777
|
+
walletOperation: WalletOperation.REACH_THRESHOLD,
|
|
778
|
+
signedSessionId
|
|
764
779
|
});
|
|
765
780
|
return wallet.externalServerKeyShares;
|
|
766
781
|
}
|
|
767
|
-
async updatePassword({ accountAddress, existingPassword, newPassword }) {
|
|
782
|
+
async updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId }) {
|
|
768
783
|
await this.getWallet({
|
|
769
784
|
accountAddress,
|
|
770
785
|
password: existingPassword,
|
|
771
|
-
walletOperation: WalletOperation.REACH_ALL_PARTIES
|
|
786
|
+
walletOperation: WalletOperation.REACH_ALL_PARTIES,
|
|
787
|
+
signedSessionId
|
|
772
788
|
});
|
|
773
789
|
await this.storeEncryptedBackupByWallet({
|
|
774
790
|
accountAddress,
|
|
775
|
-
password: newPassword
|
|
791
|
+
password: newPassword,
|
|
792
|
+
signedSessionId
|
|
776
793
|
});
|
|
777
794
|
}
|
|
778
795
|
async decryptKeyShare({ keyShare, password }) {
|
|
@@ -811,7 +828,7 @@ class DynamicWalletClient {
|
|
|
811
828
|
requiredShareCount
|
|
812
829
|
};
|
|
813
830
|
}
|
|
814
|
-
async recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, shareCount = undefined, storeRecoveredShares = true }) {
|
|
831
|
+
async recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, signedSessionId, shareCount = undefined, storeRecoveredShares = true }) {
|
|
815
832
|
this.ensureApiClientAuthenticated();
|
|
816
833
|
const wallet = this.walletMap[accountAddress];
|
|
817
834
|
this.logger.debug(`recoverEncryptedBackupByWallet wallet: ${walletOperation}`, wallet);
|
|
@@ -824,7 +841,8 @@ class DynamicWalletClient {
|
|
|
824
841
|
const { dynamic: dynamicKeyShareIds } = shares;
|
|
825
842
|
const data = await this.apiClient.recoverEncryptedBackupByWallet({
|
|
826
843
|
walletId: wallet.walletId,
|
|
827
|
-
keyShareIds: dynamicKeyShareIds
|
|
844
|
+
keyShareIds: dynamicKeyShareIds,
|
|
845
|
+
signedSessionId
|
|
828
846
|
});
|
|
829
847
|
const dynamicKeyShares = data.keyShares.filter((keyShare)=>keyShare.encryptedAccountCredential !== null && keyShare.backupLocation === BackupLocation.DYNAMIC);
|
|
830
848
|
const decryptedKeyShares = await Promise.all(dynamicKeyShares.map((keyShare)=>this.decryptKeyShare({
|
|
@@ -838,15 +856,17 @@ class DynamicWalletClient {
|
|
|
838
856
|
}
|
|
839
857
|
return decryptedKeyShares;
|
|
840
858
|
}
|
|
841
|
-
async exportExternalServerKeyShares({ accountAddress, password }) {
|
|
859
|
+
async exportExternalServerKeyShares({ accountAddress, password, signedSessionId }) {
|
|
842
860
|
await this.verifyPassword({
|
|
843
861
|
accountAddress,
|
|
844
862
|
password,
|
|
845
|
-
walletOperation: WalletOperation.REACH_ALL_PARTIES
|
|
863
|
+
walletOperation: WalletOperation.REACH_ALL_PARTIES,
|
|
864
|
+
signedSessionId
|
|
846
865
|
});
|
|
847
866
|
const externalServerKeyShares = await this.getExternalServerKeyShares({
|
|
848
867
|
accountAddress,
|
|
849
|
-
password
|
|
868
|
+
password,
|
|
869
|
+
signedSessionId
|
|
850
870
|
});
|
|
851
871
|
return externalServerKeyShares;
|
|
852
872
|
}
|
|
@@ -895,11 +915,12 @@ class DynamicWalletClient {
|
|
|
895
915
|
* verifyPassword attempts to recover and decrypt a single client key share using the provided password.
|
|
896
916
|
* If successful, the key share is encrypted with the new password. This method solely performs the recovery
|
|
897
917
|
* and decryption without storing the restored key shares. If unsuccessful, it throws an error.
|
|
898
|
-
*/ async verifyPassword({ accountAddress, password = undefined, walletOperation = WalletOperation.NO_OPERATION }) {
|
|
918
|
+
*/ async verifyPassword({ accountAddress, password = undefined, walletOperation = WalletOperation.NO_OPERATION, signedSessionId }) {
|
|
899
919
|
await this.getWallet({
|
|
900
920
|
accountAddress,
|
|
901
921
|
password,
|
|
902
|
-
walletOperation
|
|
922
|
+
walletOperation,
|
|
923
|
+
signedSessionId
|
|
903
924
|
});
|
|
904
925
|
if (await this.requiresPasswordForOperation({
|
|
905
926
|
accountAddress,
|
|
@@ -919,10 +940,12 @@ class DynamicWalletClient {
|
|
|
919
940
|
throw new Error('No dynamic key shares found');
|
|
920
941
|
}
|
|
921
942
|
try {
|
|
943
|
+
// TODO(zfaizal2): throw error if signedSessionId is not provided after service deploy
|
|
922
944
|
await this.recoverEncryptedBackupByWallet({
|
|
923
945
|
accountAddress,
|
|
924
946
|
password,
|
|
925
947
|
walletOperation,
|
|
948
|
+
signedSessionId,
|
|
926
949
|
shareCount: 1,
|
|
927
950
|
storeRecoveredShares: false
|
|
928
951
|
});
|
|
@@ -985,7 +1008,7 @@ class DynamicWalletClient {
|
|
|
985
1008
|
walletProperties: wallet == null ? void 0 : wallet.walletProperties
|
|
986
1009
|
});
|
|
987
1010
|
}
|
|
988
|
-
async getWallet({ accountAddress, walletOperation = WalletOperation.NO_OPERATION, shareCount = undefined, password = undefined }) {
|
|
1011
|
+
async getWallet({ accountAddress, walletOperation = WalletOperation.NO_OPERATION, signedSessionId, shareCount = undefined, password = undefined }) {
|
|
989
1012
|
var _user_verifiedCredentials;
|
|
990
1013
|
this.ensureApiClientAuthenticated();
|
|
991
1014
|
const existingWalletCheck = await this.checkWalletFields({
|
|
@@ -1017,10 +1040,12 @@ class DynamicWalletClient {
|
|
|
1017
1040
|
accountAddress,
|
|
1018
1041
|
walletOperation
|
|
1019
1042
|
})) {
|
|
1043
|
+
// TODO(zfaizal2): throw error if signedSessionId is not provided after service deploy
|
|
1020
1044
|
const decryptedKeyShares = await this.recoverEncryptedBackupByWallet({
|
|
1021
1045
|
accountAddress,
|
|
1022
1046
|
password: password != null ? password : this.environmentId,
|
|
1023
1047
|
walletOperation: walletOperation,
|
|
1048
|
+
signedSessionId,
|
|
1024
1049
|
shareCount
|
|
1025
1050
|
});
|
|
1026
1051
|
this.logger.debug('Recovered backup', decryptedKeyShares);
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/node",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.83",
|
|
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.83",
|
|
7
7
|
"@dynamic-labs/logger": "^4.5.1",
|
|
8
8
|
"@noble/hashes": "1.7.1"
|
|
9
9
|
},
|
package/src/client.d.ts
CHANGED
|
@@ -77,16 +77,18 @@ export declare class DynamicWalletClient {
|
|
|
77
77
|
keyShare: ServerKeyShare;
|
|
78
78
|
derivationPath: Uint32Array | undefined;
|
|
79
79
|
}): Promise<Uint8Array | EcdsaSignature>;
|
|
80
|
-
sign({ accountAddress, message, chainName, password, }: {
|
|
80
|
+
sign({ accountAddress, message, chainName, password, signedSessionId, }: {
|
|
81
81
|
accountAddress: string;
|
|
82
82
|
message: string | Uint8Array;
|
|
83
83
|
chainName: string;
|
|
84
84
|
password?: string;
|
|
85
|
+
signedSessionId?: string;
|
|
85
86
|
}): Promise<Uint8Array | EcdsaSignature>;
|
|
86
|
-
refreshWalletAccountShares({ accountAddress, chainName, password, }: {
|
|
87
|
+
refreshWalletAccountShares({ accountAddress, chainName, password, signedSessionId, }: {
|
|
87
88
|
accountAddress: string;
|
|
88
89
|
chainName: string;
|
|
89
90
|
password?: string;
|
|
91
|
+
signedSessionId?: string;
|
|
90
92
|
}): Promise<(EcdsaKeygenResult | BIP340KeygenResult)[]>;
|
|
91
93
|
getExportId({ chainName, serverKeyShare, }: {
|
|
92
94
|
chainName: string;
|
|
@@ -117,17 +119,19 @@ export declare class DynamicWalletClient {
|
|
|
117
119
|
existingExternalServerKeygenIds: string[];
|
|
118
120
|
existingExternalServerKeyShares: ServerKeyShare[];
|
|
119
121
|
}>;
|
|
120
|
-
reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, }: {
|
|
122
|
+
reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId, }: {
|
|
121
123
|
chainName: string;
|
|
122
124
|
accountAddress: string;
|
|
123
125
|
oldThresholdSignatureScheme: ThresholdSignatureScheme;
|
|
124
126
|
newThresholdSignatureScheme: ThresholdSignatureScheme;
|
|
125
127
|
password?: string;
|
|
128
|
+
signedSessionId?: string;
|
|
126
129
|
}): Promise<(EcdsaKeygenResult | BIP340KeygenResult)[]>;
|
|
127
|
-
exportKey({ accountAddress, chainName, password, }: {
|
|
130
|
+
exportKey({ accountAddress, chainName, password, signedSessionId, }: {
|
|
128
131
|
accountAddress: string;
|
|
129
132
|
chainName: string;
|
|
130
133
|
password?: string;
|
|
134
|
+
signedSessionId?: string;
|
|
131
135
|
}): Promise<{
|
|
132
136
|
derivedPrivateKey: string | undefined;
|
|
133
137
|
}>;
|
|
@@ -145,24 +149,28 @@ export declare class DynamicWalletClient {
|
|
|
145
149
|
ensureCeremonyCompletionBeforeBackup({ accountAddress, }: {
|
|
146
150
|
accountAddress: string;
|
|
147
151
|
}): Promise<void>;
|
|
148
|
-
storeEncryptedBackupByWallet({ accountAddress, externalServerKeyShares, password, }: {
|
|
152
|
+
storeEncryptedBackupByWallet({ accountAddress, externalServerKeyShares, password, signedSessionId, }: {
|
|
149
153
|
accountAddress: string;
|
|
150
154
|
externalServerKeyShares?: ServerKeyShare[];
|
|
151
155
|
password?: string;
|
|
156
|
+
signedSessionId?: string;
|
|
152
157
|
}): Promise<any>;
|
|
153
|
-
storeEncryptedBackupByWalletWithRetry({ accountAddress, externalServerKeyShares, password, }: {
|
|
158
|
+
storeEncryptedBackupByWalletWithRetry({ accountAddress, externalServerKeyShares, password, signedSessionId, }: {
|
|
154
159
|
accountAddress: string;
|
|
155
160
|
externalServerKeyShares?: ServerKeyShare[];
|
|
156
161
|
password?: string;
|
|
162
|
+
signedSessionId?: string;
|
|
157
163
|
}): Promise<void>;
|
|
158
|
-
getExternalServerKeyShares({ accountAddress, password, }: {
|
|
164
|
+
getExternalServerKeyShares({ accountAddress, password, signedSessionId, }: {
|
|
159
165
|
accountAddress: string;
|
|
160
166
|
password?: string;
|
|
167
|
+
signedSessionId?: string;
|
|
161
168
|
}): Promise<import("./mpc").ServerKeyShare[]>;
|
|
162
|
-
updatePassword({ accountAddress, existingPassword, newPassword, }: {
|
|
169
|
+
updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId, }: {
|
|
163
170
|
accountAddress: string;
|
|
164
171
|
existingPassword?: string;
|
|
165
172
|
newPassword?: string;
|
|
173
|
+
signedSessionId?: string;
|
|
166
174
|
}): Promise<void>;
|
|
167
175
|
decryptKeyShare({ keyShare, password, }: {
|
|
168
176
|
keyShare: string;
|
|
@@ -189,16 +197,18 @@ export declare class DynamicWalletClient {
|
|
|
189
197
|
shares: Partial<Record<BackupLocation, string[]>>;
|
|
190
198
|
requiredShareCount: number;
|
|
191
199
|
};
|
|
192
|
-
recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, shareCount, storeRecoveredShares, }: {
|
|
200
|
+
recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, signedSessionId, shareCount, storeRecoveredShares, }: {
|
|
193
201
|
accountAddress: string;
|
|
194
202
|
password?: string;
|
|
195
203
|
walletOperation: WalletOperation;
|
|
204
|
+
signedSessionId?: string;
|
|
196
205
|
shareCount?: number;
|
|
197
206
|
storeRecoveredShares?: boolean;
|
|
198
207
|
}): Promise<any[]>;
|
|
199
|
-
exportExternalServerKeyShares({ accountAddress, password, }: {
|
|
208
|
+
exportExternalServerKeyShares({ accountAddress, password, signedSessionId, }: {
|
|
200
209
|
accountAddress: string;
|
|
201
210
|
password?: string;
|
|
211
|
+
signedSessionId?: string;
|
|
202
212
|
}): Promise<import("./mpc").ServerKeyShare[]>;
|
|
203
213
|
/**
|
|
204
214
|
* Helper function to check if the required wallet fields are present and valid
|
|
@@ -212,10 +222,11 @@ export declare class DynamicWalletClient {
|
|
|
212
222
|
* If successful, the key share is encrypted with the new password. This method solely performs the recovery
|
|
213
223
|
* and decryption without storing the restored key shares. If unsuccessful, it throws an error.
|
|
214
224
|
*/
|
|
215
|
-
verifyPassword({ accountAddress, password, walletOperation, }: {
|
|
225
|
+
verifyPassword({ accountAddress, password, walletOperation, signedSessionId, }: {
|
|
216
226
|
accountAddress: string;
|
|
217
227
|
password?: string;
|
|
218
228
|
walletOperation?: WalletOperation;
|
|
229
|
+
signedSessionId?: string;
|
|
219
230
|
}): Promise<void>;
|
|
220
231
|
isPasswordEncrypted({ accountAddress, }: {
|
|
221
232
|
accountAddress: string;
|
|
@@ -237,9 +248,10 @@ export declare class DynamicWalletClient {
|
|
|
237
248
|
getWalletExternalServerKeyShareBackupInfo({ accountAddress, }: {
|
|
238
249
|
accountAddress: string;
|
|
239
250
|
}): Promise<KeyShareBackupInfo>;
|
|
240
|
-
getWallet({ accountAddress, walletOperation, shareCount, password, }: {
|
|
251
|
+
getWallet({ accountAddress, walletOperation, signedSessionId, shareCount, password, }: {
|
|
241
252
|
accountAddress: string;
|
|
242
253
|
walletOperation?: WalletOperation;
|
|
254
|
+
signedSessionId?: string;
|
|
243
255
|
shareCount?: number;
|
|
244
256
|
password?: string;
|
|
245
257
|
}): Promise<WalletProperties>;
|
package/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.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