@dynamic-labs-wallet/browser 0.0.81 → 0.0.82
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 +49 -28
- package/index.esm.js +49 -28
- package/package.json +2 -2
- package/src/client.d.ts +22 -11
- package/src/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -686,16 +686,18 @@ class DynamicWalletClient {
|
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
//todo: need to modify with imported flag
|
|
689
|
-
async sign({ accountAddress, message, chainName, password = undefined, isFormatted = false }) {
|
|
689
|
+
async sign({ accountAddress, message, chainName, password = undefined, isFormatted = false, signedSessionId }) {
|
|
690
690
|
await this.verifyPassword({
|
|
691
691
|
accountAddress,
|
|
692
692
|
password,
|
|
693
|
-
walletOperation: core.WalletOperation.SIGN_MESSAGE
|
|
693
|
+
walletOperation: core.WalletOperation.SIGN_MESSAGE,
|
|
694
|
+
signedSessionId
|
|
694
695
|
});
|
|
695
696
|
const wallet = await this.getWallet({
|
|
696
697
|
accountAddress,
|
|
697
698
|
password,
|
|
698
|
-
walletOperation: core.WalletOperation.SIGN_MESSAGE
|
|
699
|
+
walletOperation: core.WalletOperation.SIGN_MESSAGE,
|
|
700
|
+
signedSessionId
|
|
699
701
|
});
|
|
700
702
|
// Perform the server sign
|
|
701
703
|
const data = await this.serverSign({
|
|
@@ -718,16 +720,18 @@ class DynamicWalletClient {
|
|
|
718
720
|
});
|
|
719
721
|
return signature;
|
|
720
722
|
}
|
|
721
|
-
async refreshWalletAccountShares({ accountAddress, chainName, password = undefined }) {
|
|
723
|
+
async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, signedSessionId }) {
|
|
722
724
|
await this.verifyPassword({
|
|
723
725
|
accountAddress,
|
|
724
726
|
password,
|
|
725
|
-
walletOperation: core.WalletOperation.REFRESH
|
|
727
|
+
walletOperation: core.WalletOperation.REFRESH,
|
|
728
|
+
signedSessionId
|
|
726
729
|
});
|
|
727
730
|
const wallet = await this.getWallet({
|
|
728
731
|
accountAddress,
|
|
729
732
|
walletOperation: core.WalletOperation.NO_OPERATION,
|
|
730
|
-
password
|
|
733
|
+
password,
|
|
734
|
+
signedSessionId
|
|
731
735
|
});
|
|
732
736
|
const mpcSigner = getMPCSigner({
|
|
733
737
|
chainName,
|
|
@@ -752,7 +756,8 @@ class DynamicWalletClient {
|
|
|
752
756
|
});
|
|
753
757
|
await this.storeEncryptedBackupByWallet({
|
|
754
758
|
accountAddress,
|
|
755
|
-
password: password != null ? password : this.environmentId
|
|
759
|
+
password: password != null ? password : this.environmentId,
|
|
760
|
+
signedSessionId
|
|
756
761
|
});
|
|
757
762
|
}
|
|
758
763
|
async getExportId({ chainName, clientKeyShare }) {
|
|
@@ -806,11 +811,12 @@ class DynamicWalletClient {
|
|
|
806
811
|
existingClientKeyShares
|
|
807
812
|
};
|
|
808
813
|
}
|
|
809
|
-
async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined }) {
|
|
814
|
+
async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined, signedSessionId }) {
|
|
810
815
|
await this.verifyPassword({
|
|
811
816
|
accountAddress,
|
|
812
817
|
password,
|
|
813
|
-
walletOperation: core.WalletOperation.RESHARE
|
|
818
|
+
walletOperation: core.WalletOperation.RESHARE,
|
|
819
|
+
signedSessionId
|
|
814
820
|
});
|
|
815
821
|
const { existingClientShareCount } = core.getReshareConfig({
|
|
816
822
|
oldThresholdSignatureScheme,
|
|
@@ -820,7 +826,8 @@ class DynamicWalletClient {
|
|
|
820
826
|
accountAddress,
|
|
821
827
|
walletOperation: core.WalletOperation.NO_OPERATION,
|
|
822
828
|
shareCount: existingClientShareCount,
|
|
823
|
-
password
|
|
829
|
+
password,
|
|
830
|
+
signedSessionId
|
|
824
831
|
});
|
|
825
832
|
const { newClientInitKeygenResults, newClientKeygenIds, existingClientKeygenIds, existingClientKeyShares } = await this.reshareStrategy({
|
|
826
833
|
chainName,
|
|
@@ -864,14 +871,16 @@ class DynamicWalletClient {
|
|
|
864
871
|
});
|
|
865
872
|
await this.storeEncryptedBackupByWallet({
|
|
866
873
|
accountAddress,
|
|
867
|
-
password
|
|
874
|
+
password,
|
|
875
|
+
signedSessionId
|
|
868
876
|
});
|
|
869
877
|
}
|
|
870
|
-
async exportKey({ accountAddress, chainName, password = undefined }) {
|
|
878
|
+
async exportKey({ accountAddress, chainName, password = undefined, signedSessionId }) {
|
|
871
879
|
const wallet = await this.getWallet({
|
|
872
880
|
accountAddress,
|
|
873
881
|
password,
|
|
874
|
-
walletOperation: core.WalletOperation.EXPORT_PRIVATE_KEY
|
|
882
|
+
walletOperation: core.WalletOperation.EXPORT_PRIVATE_KEY,
|
|
883
|
+
signedSessionId
|
|
875
884
|
});
|
|
876
885
|
const mpcSigner = getMPCSigner({
|
|
877
886
|
chainName,
|
|
@@ -1005,7 +1014,7 @@ class DynamicWalletClient {
|
|
|
1005
1014
|
* @param {Object} params - The parameters for the backup operation
|
|
1006
1015
|
* @param {string} params.accountAddress - The account address of the wallet to backup
|
|
1007
1016
|
* @param {string} [params.password] - Optional password for encrypting the key shares
|
|
1008
|
-
*/ async storeEncryptedBackupByWallet({ accountAddress, clientKeyShares = undefined, password = undefined }) {
|
|
1017
|
+
*/ async storeEncryptedBackupByWallet({ accountAddress, clientKeyShares = undefined, password = undefined, signedSessionId }) {
|
|
1009
1018
|
const keySharesToBackup = clientKeyShares != null ? clientKeyShares : await this.getClientKeySharesFromLocalStorage({
|
|
1010
1019
|
accountAddress
|
|
1011
1020
|
});
|
|
@@ -1016,10 +1025,12 @@ class DynamicWalletClient {
|
|
|
1016
1025
|
if (!this.walletMap[accountAddress].walletId) {
|
|
1017
1026
|
throw new Error(`WalletId not found for accountAddress: ${accountAddress}`);
|
|
1018
1027
|
}
|
|
1028
|
+
// TODO(zfaizal2): throw error if signedSessionId is not provided after service deploy
|
|
1019
1029
|
const data = await this.apiClient.storeEncryptedBackupByWallet({
|
|
1020
1030
|
walletId: this.walletMap[accountAddress].walletId,
|
|
1021
1031
|
encryptedKeyShares,
|
|
1022
|
-
passwordEncrypted: Boolean(password) && password !== this.environmentId
|
|
1032
|
+
passwordEncrypted: Boolean(password) && password !== this.environmentId,
|
|
1033
|
+
signedSessionId
|
|
1023
1034
|
});
|
|
1024
1035
|
const hasGoogleDriveBackup = this.walletMap[accountAddress].clientKeySharesBackupInfo.backups[core.BackupLocation.GOOGLE_DRIVE].length > 0;
|
|
1025
1036
|
if (hasGoogleDriveBackup) {
|
|
@@ -1045,11 +1056,12 @@ class DynamicWalletClient {
|
|
|
1045
1056
|
await this.storage.setItem(this.storageKey, JSON.stringify(this.walletMap));
|
|
1046
1057
|
return data;
|
|
1047
1058
|
}
|
|
1048
|
-
async storeEncryptedBackupByWalletWithRetry({ accountAddress, clientKeyShares, password }) {
|
|
1059
|
+
async storeEncryptedBackupByWalletWithRetry({ accountAddress, clientKeyShares, password, signedSessionId }) {
|
|
1049
1060
|
await retryPromise(()=>this.storeEncryptedBackupByWallet({
|
|
1050
1061
|
accountAddress,
|
|
1051
1062
|
clientKeyShares,
|
|
1052
|
-
password
|
|
1063
|
+
password,
|
|
1064
|
+
signedSessionId
|
|
1053
1065
|
}), {
|
|
1054
1066
|
operationName: 'store encrypted backup',
|
|
1055
1067
|
logContext: {
|
|
@@ -1061,15 +1073,17 @@ class DynamicWalletClient {
|
|
|
1061
1073
|
}
|
|
1062
1074
|
});
|
|
1063
1075
|
}
|
|
1064
|
-
async updatePassword({ accountAddress, existingPassword, newPassword }) {
|
|
1076
|
+
async updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId }) {
|
|
1065
1077
|
await this.getWallet({
|
|
1066
1078
|
accountAddress,
|
|
1067
1079
|
password: existingPassword,
|
|
1068
|
-
walletOperation: core.WalletOperation.REACH_ALL_PARTIES
|
|
1080
|
+
walletOperation: core.WalletOperation.REACH_ALL_PARTIES,
|
|
1081
|
+
signedSessionId
|
|
1069
1082
|
});
|
|
1070
1083
|
await this.storeEncryptedBackupByWallet({
|
|
1071
1084
|
accountAddress,
|
|
1072
|
-
password: newPassword
|
|
1085
|
+
password: newPassword,
|
|
1086
|
+
signedSessionId
|
|
1073
1087
|
});
|
|
1074
1088
|
}
|
|
1075
1089
|
async decryptKeyShare({ keyShare, password }) {
|
|
@@ -1125,7 +1139,7 @@ class DynamicWalletClient {
|
|
|
1125
1139
|
requiredShareCount
|
|
1126
1140
|
};
|
|
1127
1141
|
}
|
|
1128
|
-
async recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, shareCount = undefined, storeRecoveredShares = true }) {
|
|
1142
|
+
async recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, signedSessionId, shareCount = undefined, storeRecoveredShares = true }) {
|
|
1129
1143
|
const wallet = this.walletMap[accountAddress];
|
|
1130
1144
|
this.logger.debug(`recoverEncryptedBackupByWallet wallet: ${walletOperation}`, wallet);
|
|
1131
1145
|
const { shares } = this.recoverStrategy({
|
|
@@ -1137,7 +1151,8 @@ class DynamicWalletClient {
|
|
|
1137
1151
|
const { dynamic: dynamicKeyShareIds } = shares;
|
|
1138
1152
|
const data = await this.apiClient.recoverEncryptedBackupByWallet({
|
|
1139
1153
|
walletId: wallet.walletId,
|
|
1140
|
-
keyShareIds: dynamicKeyShareIds
|
|
1154
|
+
keyShareIds: dynamicKeyShareIds,
|
|
1155
|
+
signedSessionId
|
|
1141
1156
|
});
|
|
1142
1157
|
const dynamicKeyShares = data.keyShares.filter((keyShare)=>keyShare.encryptedAccountCredential !== null && keyShare.backupLocation === core.BackupLocation.DYNAMIC);
|
|
1143
1158
|
const decryptedKeyShares = await Promise.all(dynamicKeyShares.map((keyShare)=>this.decryptKeyShare({
|
|
@@ -1262,11 +1277,12 @@ class DynamicWalletClient {
|
|
|
1262
1277
|
});
|
|
1263
1278
|
return decryptedKeyShares;
|
|
1264
1279
|
}
|
|
1265
|
-
async exportClientKeyshares({ accountAddress, password }) {
|
|
1280
|
+
async exportClientKeyshares({ accountAddress, password, signedSessionId }) {
|
|
1266
1281
|
await this.verifyPassword({
|
|
1267
1282
|
accountAddress,
|
|
1268
1283
|
password,
|
|
1269
|
-
walletOperation: core.WalletOperation.REACH_ALL_PARTIES
|
|
1284
|
+
walletOperation: core.WalletOperation.REACH_ALL_PARTIES,
|
|
1285
|
+
signedSessionId
|
|
1270
1286
|
});
|
|
1271
1287
|
const clientKeyShares = await this.getClientKeySharesFromLocalStorage({
|
|
1272
1288
|
accountAddress
|
|
@@ -1347,11 +1363,12 @@ class DynamicWalletClient {
|
|
|
1347
1363
|
* verifyPassword attempts to recover and decrypt a single client key share using the provided password.
|
|
1348
1364
|
* If successful, the key share is encrypted with the new password. This method solely performs the recovery
|
|
1349
1365
|
* and decryption without storing the restored key shares. If unsuccessful, it throws an error.
|
|
1350
|
-
*/ async verifyPassword({ accountAddress, password = undefined, walletOperation = core.WalletOperation.NO_OPERATION }) {
|
|
1366
|
+
*/ async verifyPassword({ accountAddress, password = undefined, walletOperation = core.WalletOperation.NO_OPERATION, signedSessionId }) {
|
|
1351
1367
|
await this.getWallet({
|
|
1352
1368
|
accountAddress,
|
|
1353
1369
|
password,
|
|
1354
|
-
walletOperation
|
|
1370
|
+
walletOperation,
|
|
1371
|
+
signedSessionId
|
|
1355
1372
|
});
|
|
1356
1373
|
if (await this.requiresPasswordForOperation({
|
|
1357
1374
|
accountAddress,
|
|
@@ -1371,12 +1388,14 @@ class DynamicWalletClient {
|
|
|
1371
1388
|
throw new Error('No dynamic key shares found');
|
|
1372
1389
|
}
|
|
1373
1390
|
try {
|
|
1391
|
+
// TODO(zfaizal2): throw error if signedSessionId is not provided after service deploy
|
|
1374
1392
|
await this.recoverEncryptedBackupByWallet({
|
|
1375
1393
|
accountAddress,
|
|
1376
1394
|
password,
|
|
1377
1395
|
walletOperation,
|
|
1378
1396
|
shareCount: 1,
|
|
1379
|
-
storeRecoveredShares: false
|
|
1397
|
+
storeRecoveredShares: false,
|
|
1398
|
+
signedSessionId
|
|
1380
1399
|
});
|
|
1381
1400
|
} catch (error) {
|
|
1382
1401
|
this.logger.error('Error in verifying password', error);
|
|
@@ -1438,7 +1457,7 @@ class DynamicWalletClient {
|
|
|
1438
1457
|
walletProperties: wallet == null ? void 0 : wallet.walletProperties
|
|
1439
1458
|
});
|
|
1440
1459
|
}
|
|
1441
|
-
async getWallet({ accountAddress, walletOperation = core.WalletOperation.NO_OPERATION, shareCount = undefined, password = undefined }) {
|
|
1460
|
+
async getWallet({ accountAddress, walletOperation = core.WalletOperation.NO_OPERATION, shareCount = undefined, password = undefined, signedSessionId = undefined }) {
|
|
1442
1461
|
var _user_verifiedCredentials;
|
|
1443
1462
|
const existingWalletCheck = await this.checkWalletFields({
|
|
1444
1463
|
accountAddress,
|
|
@@ -1468,10 +1487,12 @@ class DynamicWalletClient {
|
|
|
1468
1487
|
accountAddress,
|
|
1469
1488
|
walletOperation
|
|
1470
1489
|
})) {
|
|
1490
|
+
// TODO(zfaizal2): throw error if signedSessionId is not provided after service deploy
|
|
1471
1491
|
const decryptedKeyShares = await this.recoverEncryptedBackupByWallet({
|
|
1472
1492
|
accountAddress,
|
|
1473
1493
|
password: password != null ? password : this.environmentId,
|
|
1474
1494
|
walletOperation: walletOperation,
|
|
1495
|
+
signedSessionId,
|
|
1475
1496
|
shareCount
|
|
1476
1497
|
});
|
|
1477
1498
|
const existingKeyShares = await this.getClientKeySharesFromLocalStorage({
|
package/index.esm.js
CHANGED
|
@@ -686,16 +686,18 @@ class DynamicWalletClient {
|
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
//todo: need to modify with imported flag
|
|
689
|
-
async sign({ accountAddress, message, chainName, password = undefined, isFormatted = false }) {
|
|
689
|
+
async sign({ accountAddress, message, chainName, password = undefined, isFormatted = false, signedSessionId }) {
|
|
690
690
|
await this.verifyPassword({
|
|
691
691
|
accountAddress,
|
|
692
692
|
password,
|
|
693
|
-
walletOperation: WalletOperation.SIGN_MESSAGE
|
|
693
|
+
walletOperation: WalletOperation.SIGN_MESSAGE,
|
|
694
|
+
signedSessionId
|
|
694
695
|
});
|
|
695
696
|
const wallet = await this.getWallet({
|
|
696
697
|
accountAddress,
|
|
697
698
|
password,
|
|
698
|
-
walletOperation: WalletOperation.SIGN_MESSAGE
|
|
699
|
+
walletOperation: WalletOperation.SIGN_MESSAGE,
|
|
700
|
+
signedSessionId
|
|
699
701
|
});
|
|
700
702
|
// Perform the server sign
|
|
701
703
|
const data = await this.serverSign({
|
|
@@ -718,16 +720,18 @@ class DynamicWalletClient {
|
|
|
718
720
|
});
|
|
719
721
|
return signature;
|
|
720
722
|
}
|
|
721
|
-
async refreshWalletAccountShares({ accountAddress, chainName, password = undefined }) {
|
|
723
|
+
async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, signedSessionId }) {
|
|
722
724
|
await this.verifyPassword({
|
|
723
725
|
accountAddress,
|
|
724
726
|
password,
|
|
725
|
-
walletOperation: WalletOperation.REFRESH
|
|
727
|
+
walletOperation: WalletOperation.REFRESH,
|
|
728
|
+
signedSessionId
|
|
726
729
|
});
|
|
727
730
|
const wallet = await this.getWallet({
|
|
728
731
|
accountAddress,
|
|
729
732
|
walletOperation: WalletOperation.NO_OPERATION,
|
|
730
|
-
password
|
|
733
|
+
password,
|
|
734
|
+
signedSessionId
|
|
731
735
|
});
|
|
732
736
|
const mpcSigner = getMPCSigner({
|
|
733
737
|
chainName,
|
|
@@ -752,7 +756,8 @@ class DynamicWalletClient {
|
|
|
752
756
|
});
|
|
753
757
|
await this.storeEncryptedBackupByWallet({
|
|
754
758
|
accountAddress,
|
|
755
|
-
password: password != null ? password : this.environmentId
|
|
759
|
+
password: password != null ? password : this.environmentId,
|
|
760
|
+
signedSessionId
|
|
756
761
|
});
|
|
757
762
|
}
|
|
758
763
|
async getExportId({ chainName, clientKeyShare }) {
|
|
@@ -806,11 +811,12 @@ class DynamicWalletClient {
|
|
|
806
811
|
existingClientKeyShares
|
|
807
812
|
};
|
|
808
813
|
}
|
|
809
|
-
async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined }) {
|
|
814
|
+
async reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password = undefined, signedSessionId }) {
|
|
810
815
|
await this.verifyPassword({
|
|
811
816
|
accountAddress,
|
|
812
817
|
password,
|
|
813
|
-
walletOperation: WalletOperation.RESHARE
|
|
818
|
+
walletOperation: WalletOperation.RESHARE,
|
|
819
|
+
signedSessionId
|
|
814
820
|
});
|
|
815
821
|
const { existingClientShareCount } = getReshareConfig({
|
|
816
822
|
oldThresholdSignatureScheme,
|
|
@@ -820,7 +826,8 @@ class DynamicWalletClient {
|
|
|
820
826
|
accountAddress,
|
|
821
827
|
walletOperation: WalletOperation.NO_OPERATION,
|
|
822
828
|
shareCount: existingClientShareCount,
|
|
823
|
-
password
|
|
829
|
+
password,
|
|
830
|
+
signedSessionId
|
|
824
831
|
});
|
|
825
832
|
const { newClientInitKeygenResults, newClientKeygenIds, existingClientKeygenIds, existingClientKeyShares } = await this.reshareStrategy({
|
|
826
833
|
chainName,
|
|
@@ -864,14 +871,16 @@ class DynamicWalletClient {
|
|
|
864
871
|
});
|
|
865
872
|
await this.storeEncryptedBackupByWallet({
|
|
866
873
|
accountAddress,
|
|
867
|
-
password
|
|
874
|
+
password,
|
|
875
|
+
signedSessionId
|
|
868
876
|
});
|
|
869
877
|
}
|
|
870
|
-
async exportKey({ accountAddress, chainName, password = undefined }) {
|
|
878
|
+
async exportKey({ accountAddress, chainName, password = undefined, signedSessionId }) {
|
|
871
879
|
const wallet = await this.getWallet({
|
|
872
880
|
accountAddress,
|
|
873
881
|
password,
|
|
874
|
-
walletOperation: WalletOperation.EXPORT_PRIVATE_KEY
|
|
882
|
+
walletOperation: WalletOperation.EXPORT_PRIVATE_KEY,
|
|
883
|
+
signedSessionId
|
|
875
884
|
});
|
|
876
885
|
const mpcSigner = getMPCSigner({
|
|
877
886
|
chainName,
|
|
@@ -1005,7 +1014,7 @@ class DynamicWalletClient {
|
|
|
1005
1014
|
* @param {Object} params - The parameters for the backup operation
|
|
1006
1015
|
* @param {string} params.accountAddress - The account address of the wallet to backup
|
|
1007
1016
|
* @param {string} [params.password] - Optional password for encrypting the key shares
|
|
1008
|
-
*/ async storeEncryptedBackupByWallet({ accountAddress, clientKeyShares = undefined, password = undefined }) {
|
|
1017
|
+
*/ async storeEncryptedBackupByWallet({ accountAddress, clientKeyShares = undefined, password = undefined, signedSessionId }) {
|
|
1009
1018
|
const keySharesToBackup = clientKeyShares != null ? clientKeyShares : await this.getClientKeySharesFromLocalStorage({
|
|
1010
1019
|
accountAddress
|
|
1011
1020
|
});
|
|
@@ -1016,10 +1025,12 @@ class DynamicWalletClient {
|
|
|
1016
1025
|
if (!this.walletMap[accountAddress].walletId) {
|
|
1017
1026
|
throw new Error(`WalletId not found for accountAddress: ${accountAddress}`);
|
|
1018
1027
|
}
|
|
1028
|
+
// TODO(zfaizal2): throw error if signedSessionId is not provided after service deploy
|
|
1019
1029
|
const data = await this.apiClient.storeEncryptedBackupByWallet({
|
|
1020
1030
|
walletId: this.walletMap[accountAddress].walletId,
|
|
1021
1031
|
encryptedKeyShares,
|
|
1022
|
-
passwordEncrypted: Boolean(password) && password !== this.environmentId
|
|
1032
|
+
passwordEncrypted: Boolean(password) && password !== this.environmentId,
|
|
1033
|
+
signedSessionId
|
|
1023
1034
|
});
|
|
1024
1035
|
const hasGoogleDriveBackup = this.walletMap[accountAddress].clientKeySharesBackupInfo.backups[BackupLocation.GOOGLE_DRIVE].length > 0;
|
|
1025
1036
|
if (hasGoogleDriveBackup) {
|
|
@@ -1045,11 +1056,12 @@ class DynamicWalletClient {
|
|
|
1045
1056
|
await this.storage.setItem(this.storageKey, JSON.stringify(this.walletMap));
|
|
1046
1057
|
return data;
|
|
1047
1058
|
}
|
|
1048
|
-
async storeEncryptedBackupByWalletWithRetry({ accountAddress, clientKeyShares, password }) {
|
|
1059
|
+
async storeEncryptedBackupByWalletWithRetry({ accountAddress, clientKeyShares, password, signedSessionId }) {
|
|
1049
1060
|
await retryPromise(()=>this.storeEncryptedBackupByWallet({
|
|
1050
1061
|
accountAddress,
|
|
1051
1062
|
clientKeyShares,
|
|
1052
|
-
password
|
|
1063
|
+
password,
|
|
1064
|
+
signedSessionId
|
|
1053
1065
|
}), {
|
|
1054
1066
|
operationName: 'store encrypted backup',
|
|
1055
1067
|
logContext: {
|
|
@@ -1061,15 +1073,17 @@ class DynamicWalletClient {
|
|
|
1061
1073
|
}
|
|
1062
1074
|
});
|
|
1063
1075
|
}
|
|
1064
|
-
async updatePassword({ accountAddress, existingPassword, newPassword }) {
|
|
1076
|
+
async updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId }) {
|
|
1065
1077
|
await this.getWallet({
|
|
1066
1078
|
accountAddress,
|
|
1067
1079
|
password: existingPassword,
|
|
1068
|
-
walletOperation: WalletOperation.REACH_ALL_PARTIES
|
|
1080
|
+
walletOperation: WalletOperation.REACH_ALL_PARTIES,
|
|
1081
|
+
signedSessionId
|
|
1069
1082
|
});
|
|
1070
1083
|
await this.storeEncryptedBackupByWallet({
|
|
1071
1084
|
accountAddress,
|
|
1072
|
-
password: newPassword
|
|
1085
|
+
password: newPassword,
|
|
1086
|
+
signedSessionId
|
|
1073
1087
|
});
|
|
1074
1088
|
}
|
|
1075
1089
|
async decryptKeyShare({ keyShare, password }) {
|
|
@@ -1125,7 +1139,7 @@ class DynamicWalletClient {
|
|
|
1125
1139
|
requiredShareCount
|
|
1126
1140
|
};
|
|
1127
1141
|
}
|
|
1128
|
-
async recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, shareCount = undefined, storeRecoveredShares = true }) {
|
|
1142
|
+
async recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, signedSessionId, shareCount = undefined, storeRecoveredShares = true }) {
|
|
1129
1143
|
const wallet = this.walletMap[accountAddress];
|
|
1130
1144
|
this.logger.debug(`recoverEncryptedBackupByWallet wallet: ${walletOperation}`, wallet);
|
|
1131
1145
|
const { shares } = this.recoverStrategy({
|
|
@@ -1137,7 +1151,8 @@ class DynamicWalletClient {
|
|
|
1137
1151
|
const { dynamic: dynamicKeyShareIds } = shares;
|
|
1138
1152
|
const data = await this.apiClient.recoverEncryptedBackupByWallet({
|
|
1139
1153
|
walletId: wallet.walletId,
|
|
1140
|
-
keyShareIds: dynamicKeyShareIds
|
|
1154
|
+
keyShareIds: dynamicKeyShareIds,
|
|
1155
|
+
signedSessionId
|
|
1141
1156
|
});
|
|
1142
1157
|
const dynamicKeyShares = data.keyShares.filter((keyShare)=>keyShare.encryptedAccountCredential !== null && keyShare.backupLocation === BackupLocation.DYNAMIC);
|
|
1143
1158
|
const decryptedKeyShares = await Promise.all(dynamicKeyShares.map((keyShare)=>this.decryptKeyShare({
|
|
@@ -1262,11 +1277,12 @@ class DynamicWalletClient {
|
|
|
1262
1277
|
});
|
|
1263
1278
|
return decryptedKeyShares;
|
|
1264
1279
|
}
|
|
1265
|
-
async exportClientKeyshares({ accountAddress, password }) {
|
|
1280
|
+
async exportClientKeyshares({ accountAddress, password, signedSessionId }) {
|
|
1266
1281
|
await this.verifyPassword({
|
|
1267
1282
|
accountAddress,
|
|
1268
1283
|
password,
|
|
1269
|
-
walletOperation: WalletOperation.REACH_ALL_PARTIES
|
|
1284
|
+
walletOperation: WalletOperation.REACH_ALL_PARTIES,
|
|
1285
|
+
signedSessionId
|
|
1270
1286
|
});
|
|
1271
1287
|
const clientKeyShares = await this.getClientKeySharesFromLocalStorage({
|
|
1272
1288
|
accountAddress
|
|
@@ -1347,11 +1363,12 @@ class DynamicWalletClient {
|
|
|
1347
1363
|
* verifyPassword attempts to recover and decrypt a single client key share using the provided password.
|
|
1348
1364
|
* If successful, the key share is encrypted with the new password. This method solely performs the recovery
|
|
1349
1365
|
* and decryption without storing the restored key shares. If unsuccessful, it throws an error.
|
|
1350
|
-
*/ async verifyPassword({ accountAddress, password = undefined, walletOperation = WalletOperation.NO_OPERATION }) {
|
|
1366
|
+
*/ async verifyPassword({ accountAddress, password = undefined, walletOperation = WalletOperation.NO_OPERATION, signedSessionId }) {
|
|
1351
1367
|
await this.getWallet({
|
|
1352
1368
|
accountAddress,
|
|
1353
1369
|
password,
|
|
1354
|
-
walletOperation
|
|
1370
|
+
walletOperation,
|
|
1371
|
+
signedSessionId
|
|
1355
1372
|
});
|
|
1356
1373
|
if (await this.requiresPasswordForOperation({
|
|
1357
1374
|
accountAddress,
|
|
@@ -1371,12 +1388,14 @@ class DynamicWalletClient {
|
|
|
1371
1388
|
throw new Error('No dynamic key shares found');
|
|
1372
1389
|
}
|
|
1373
1390
|
try {
|
|
1391
|
+
// TODO(zfaizal2): throw error if signedSessionId is not provided after service deploy
|
|
1374
1392
|
await this.recoverEncryptedBackupByWallet({
|
|
1375
1393
|
accountAddress,
|
|
1376
1394
|
password,
|
|
1377
1395
|
walletOperation,
|
|
1378
1396
|
shareCount: 1,
|
|
1379
|
-
storeRecoveredShares: false
|
|
1397
|
+
storeRecoveredShares: false,
|
|
1398
|
+
signedSessionId
|
|
1380
1399
|
});
|
|
1381
1400
|
} catch (error) {
|
|
1382
1401
|
this.logger.error('Error in verifying password', error);
|
|
@@ -1438,7 +1457,7 @@ class DynamicWalletClient {
|
|
|
1438
1457
|
walletProperties: wallet == null ? void 0 : wallet.walletProperties
|
|
1439
1458
|
});
|
|
1440
1459
|
}
|
|
1441
|
-
async getWallet({ accountAddress, walletOperation = WalletOperation.NO_OPERATION, shareCount = undefined, password = undefined }) {
|
|
1460
|
+
async getWallet({ accountAddress, walletOperation = WalletOperation.NO_OPERATION, shareCount = undefined, password = undefined, signedSessionId = undefined }) {
|
|
1442
1461
|
var _user_verifiedCredentials;
|
|
1443
1462
|
const existingWalletCheck = await this.checkWalletFields({
|
|
1444
1463
|
accountAddress,
|
|
@@ -1468,10 +1487,12 @@ class DynamicWalletClient {
|
|
|
1468
1487
|
accountAddress,
|
|
1469
1488
|
walletOperation
|
|
1470
1489
|
})) {
|
|
1490
|
+
// TODO(zfaizal2): throw error if signedSessionId is not provided after service deploy
|
|
1471
1491
|
const decryptedKeyShares = await this.recoverEncryptedBackupByWallet({
|
|
1472
1492
|
accountAddress,
|
|
1473
1493
|
password: password != null ? password : this.environmentId,
|
|
1474
1494
|
walletOperation: walletOperation,
|
|
1495
|
+
signedSessionId,
|
|
1475
1496
|
shareCount
|
|
1476
1497
|
});
|
|
1477
1498
|
const existingKeyShares = await this.getClientKeySharesFromLocalStorage({
|
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.82",
|
|
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.82",
|
|
7
7
|
"@dynamic-labs/logger": "^4.9.9",
|
|
8
8
|
"@dynamic-labs/sdk-api-core": "^0.0.663",
|
|
9
9
|
"@noble/hashes": "1.7.1"
|
package/src/client.d.ts
CHANGED
|
@@ -83,17 +83,19 @@ export declare class DynamicWalletClient {
|
|
|
83
83
|
derivationPath: Uint32Array | undefined;
|
|
84
84
|
isFormatted?: boolean;
|
|
85
85
|
}): Promise<Uint8Array | EcdsaSignature>;
|
|
86
|
-
sign({ accountAddress, message, chainName, password, isFormatted, }: {
|
|
86
|
+
sign({ accountAddress, message, chainName, password, isFormatted, signedSessionId, }: {
|
|
87
87
|
accountAddress: string;
|
|
88
88
|
message: string | Uint8Array;
|
|
89
89
|
chainName: string;
|
|
90
90
|
password?: string;
|
|
91
91
|
isFormatted?: boolean;
|
|
92
|
+
signedSessionId?: string;
|
|
92
93
|
}): Promise<Uint8Array | EcdsaSignature>;
|
|
93
|
-
refreshWalletAccountShares({ accountAddress, chainName, password, }: {
|
|
94
|
+
refreshWalletAccountShares({ accountAddress, chainName, password, signedSessionId, }: {
|
|
94
95
|
accountAddress: string;
|
|
95
96
|
chainName: string;
|
|
96
97
|
password?: string;
|
|
98
|
+
signedSessionId?: string;
|
|
97
99
|
}): Promise<void>;
|
|
98
100
|
getExportId({ chainName, clientKeyShare, }: {
|
|
99
101
|
chainName: string;
|
|
@@ -125,17 +127,19 @@ export declare class DynamicWalletClient {
|
|
|
125
127
|
existingClientKeygenIds: string[];
|
|
126
128
|
existingClientKeyShares: ClientKeyShare[];
|
|
127
129
|
}>;
|
|
128
|
-
reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, }: {
|
|
130
|
+
reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId, }: {
|
|
129
131
|
chainName: string;
|
|
130
132
|
accountAddress: string;
|
|
131
133
|
oldThresholdSignatureScheme: ThresholdSignatureScheme;
|
|
132
134
|
newThresholdSignatureScheme: ThresholdSignatureScheme;
|
|
133
135
|
password?: string;
|
|
136
|
+
signedSessionId?: string;
|
|
134
137
|
}): Promise<void>;
|
|
135
|
-
exportKey({ accountAddress, chainName, password, }: {
|
|
138
|
+
exportKey({ accountAddress, chainName, password, signedSessionId, }: {
|
|
136
139
|
accountAddress: string;
|
|
137
140
|
chainName: string;
|
|
138
141
|
password?: string;
|
|
142
|
+
signedSessionId?: string;
|
|
139
143
|
}): Promise<{
|
|
140
144
|
derivedPrivateKey: string | undefined;
|
|
141
145
|
}>;
|
|
@@ -183,20 +187,23 @@ export declare class DynamicWalletClient {
|
|
|
183
187
|
* @param {string} params.accountAddress - The account address of the wallet to backup
|
|
184
188
|
* @param {string} [params.password] - Optional password for encrypting the key shares
|
|
185
189
|
*/
|
|
186
|
-
storeEncryptedBackupByWallet({ accountAddress, clientKeyShares, password, }: {
|
|
190
|
+
storeEncryptedBackupByWallet({ accountAddress, clientKeyShares, password, signedSessionId, }: {
|
|
187
191
|
accountAddress: string;
|
|
188
192
|
clientKeyShares?: ClientKeyShare[];
|
|
189
193
|
password?: string;
|
|
194
|
+
signedSessionId?: string;
|
|
190
195
|
}): Promise<any>;
|
|
191
|
-
storeEncryptedBackupByWalletWithRetry({ accountAddress, clientKeyShares, password, }: {
|
|
196
|
+
storeEncryptedBackupByWalletWithRetry({ accountAddress, clientKeyShares, password, signedSessionId, }: {
|
|
192
197
|
accountAddress: string;
|
|
193
198
|
clientKeyShares?: ClientKeyShare[];
|
|
194
199
|
password?: string;
|
|
200
|
+
signedSessionId?: string;
|
|
195
201
|
}): Promise<void>;
|
|
196
|
-
updatePassword({ accountAddress, existingPassword, newPassword, }: {
|
|
202
|
+
updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId, }: {
|
|
197
203
|
accountAddress: string;
|
|
198
204
|
existingPassword?: string;
|
|
199
205
|
newPassword?: string;
|
|
206
|
+
signedSessionId?: string;
|
|
200
207
|
}): Promise<void>;
|
|
201
208
|
decryptKeyShare({ keyShare, password, }: {
|
|
202
209
|
keyShare: string;
|
|
@@ -230,10 +237,11 @@ export declare class DynamicWalletClient {
|
|
|
230
237
|
shares: Partial<Record<BackupLocation, string[]>>;
|
|
231
238
|
requiredShareCount: number;
|
|
232
239
|
};
|
|
233
|
-
recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, shareCount, storeRecoveredShares, }: {
|
|
240
|
+
recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, signedSessionId, shareCount, storeRecoveredShares, }: {
|
|
234
241
|
accountAddress: string;
|
|
235
242
|
password?: string;
|
|
236
243
|
walletOperation: WalletOperation;
|
|
244
|
+
signedSessionId?: string;
|
|
237
245
|
shareCount?: number;
|
|
238
246
|
storeRecoveredShares?: boolean;
|
|
239
247
|
}): Promise<any[]>;
|
|
@@ -246,9 +254,10 @@ export declare class DynamicWalletClient {
|
|
|
246
254
|
accountAddress: string;
|
|
247
255
|
password?: string;
|
|
248
256
|
}): Promise<ClientKeyShare[]>;
|
|
249
|
-
exportClientKeyshares({ accountAddress, password, }: {
|
|
257
|
+
exportClientKeyshares({ accountAddress, password, signedSessionId, }: {
|
|
250
258
|
accountAddress: string;
|
|
251
259
|
password?: string;
|
|
260
|
+
signedSessionId?: string;
|
|
252
261
|
}): Promise<void>;
|
|
253
262
|
getClientKeyShares({ accountAddress, password, }: {
|
|
254
263
|
accountAddress: string;
|
|
@@ -266,10 +275,11 @@ export declare class DynamicWalletClient {
|
|
|
266
275
|
* If successful, the key share is encrypted with the new password. This method solely performs the recovery
|
|
267
276
|
* and decryption without storing the restored key shares. If unsuccessful, it throws an error.
|
|
268
277
|
*/
|
|
269
|
-
verifyPassword({ accountAddress, password, walletOperation, }: {
|
|
278
|
+
verifyPassword({ accountAddress, password, walletOperation, signedSessionId, }: {
|
|
270
279
|
accountAddress: string;
|
|
271
280
|
password?: string;
|
|
272
281
|
walletOperation?: WalletOperation;
|
|
282
|
+
signedSessionId?: string;
|
|
273
283
|
}): Promise<void>;
|
|
274
284
|
isPasswordEncrypted({ accountAddress, }: {
|
|
275
285
|
accountAddress: string;
|
|
@@ -291,11 +301,12 @@ export declare class DynamicWalletClient {
|
|
|
291
301
|
getWalletClientKeyShareBackupInfo({ accountAddress, }: {
|
|
292
302
|
accountAddress: string;
|
|
293
303
|
}): Promise<KeyShareBackupInfo>;
|
|
294
|
-
getWallet({ accountAddress, walletOperation, shareCount, password, }: {
|
|
304
|
+
getWallet({ accountAddress, walletOperation, shareCount, password, signedSessionId, }: {
|
|
295
305
|
accountAddress: string;
|
|
296
306
|
walletOperation?: WalletOperation;
|
|
297
307
|
shareCount?: number;
|
|
298
308
|
password?: string;
|
|
309
|
+
signedSessionId?: string;
|
|
299
310
|
}): Promise<WalletProperties>;
|
|
300
311
|
getWallets(): Promise<any>;
|
|
301
312
|
}
|
package/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts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