@dynamic-labs-wallet/node 0.0.0-pr354.0 → 0.0.0-pr361.1
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 +77 -23
- package/index.esm.js +70 -24
- package/package.json +2 -2
- package/src/client.d.ts.map +1 -1
- package/src/index.d.ts +2 -2
- package/src/index.d.ts.map +1 -1
- package/src/utils.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -68,7 +68,8 @@ const getExternalServerKeyShareBackupInfo = (params)=>{
|
|
|
68
68
|
[core.BackupLocation.GOOGLE_DRIVE]: [],
|
|
69
69
|
[core.BackupLocation.ICLOUD]: [],
|
|
70
70
|
[core.BackupLocation.USER]: [],
|
|
71
|
-
[core.BackupLocation.EXTERNAL]: []
|
|
71
|
+
[core.BackupLocation.EXTERNAL]: [],
|
|
72
|
+
[core.BackupLocation.DELEGATED]: []
|
|
72
73
|
};
|
|
73
74
|
if (!(params == null ? void 0 : (_params_walletProperties = params.walletProperties) == null ? void 0 : _params_walletProperties.keyShares)) {
|
|
74
75
|
return {
|
|
@@ -928,10 +929,14 @@ class DynamicWalletClient {
|
|
|
928
929
|
if (shareCount !== undefined) {
|
|
929
930
|
requiredShareCount = shareCount;
|
|
930
931
|
}
|
|
931
|
-
const dynamicShares = backups[core.BackupLocation.DYNAMIC].slice(0, requiredShareCount);
|
|
932
|
+
const dynamicShares = (backups[core.BackupLocation.DYNAMIC] || []).slice(0, requiredShareCount);
|
|
933
|
+
const externalShares = (backups[core.BackupLocation.EXTERNAL] || []).slice(0, requiredShareCount);
|
|
934
|
+
// If we have DYNAMIC shares, use those; otherwise use EXTERNAL shares
|
|
935
|
+
const sharesToUse = dynamicShares.length > 0 ? dynamicShares : externalShares;
|
|
936
|
+
const backupLocation = dynamicShares.length > 0 ? core.BackupLocation.DYNAMIC : core.BackupLocation.EXTERNAL;
|
|
932
937
|
return {
|
|
933
938
|
shares: {
|
|
934
|
-
[
|
|
939
|
+
[backupLocation]: sharesToUse.map((ks)=>{
|
|
935
940
|
var _ks_externalKeyShareId, _ref;
|
|
936
941
|
return (_ref = (_ks_externalKeyShareId = ks.externalKeyShareId) != null ? _ks_externalKeyShareId : ks.keyShareId) != null ? _ref : '';
|
|
937
942
|
})
|
|
@@ -949,12 +954,24 @@ class DynamicWalletClient {
|
|
|
949
954
|
walletOperation,
|
|
950
955
|
shareCount
|
|
951
956
|
});
|
|
952
|
-
|
|
953
|
-
const
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
957
|
+
// Get the key share IDs from whichever backup location has shares
|
|
958
|
+
const dynamicKeyShareIds = shares[core.BackupLocation.DYNAMIC] || [];
|
|
959
|
+
const externalKeyShareIds = shares[core.BackupLocation.EXTERNAL] || [];
|
|
960
|
+
// Only attempt recovery if we have DYNAMIC shares (the API doesn't support EXTERNAL shares)
|
|
961
|
+
let data;
|
|
962
|
+
if (dynamicKeyShareIds.length > 0) {
|
|
963
|
+
data = await this.apiClient.recoverEncryptedBackupByWallet({
|
|
964
|
+
walletId: wallet.walletId,
|
|
965
|
+
keyShareIds: dynamicKeyShareIds,
|
|
966
|
+
requiresSignedSessionId: false
|
|
967
|
+
});
|
|
968
|
+
} else if (externalKeyShareIds.length > 0) {
|
|
969
|
+
this.logger.debug('Skipping recovery - only EXTERNAL shares available (backUpToClientShareService: false)');
|
|
970
|
+
return []; // Return empty array since we can't recover EXTERNAL shares via API
|
|
971
|
+
} else {
|
|
972
|
+
this.logger.debug('No shares available for recovery');
|
|
973
|
+
return []; // Return empty array if no shares are available
|
|
974
|
+
}
|
|
958
975
|
const dynamicKeyShares = data.keyShares.filter((keyShare)=>keyShare.encryptedAccountCredential !== null && keyShare.backupLocation === core.BackupLocation.DYNAMIC);
|
|
959
976
|
const decryptedKeyShares = await Promise.all(dynamicKeyShares.map((keyShare)=>this.decryptKeyShare({
|
|
960
977
|
keyShare: keyShare.encryptedAccountCredential,
|
|
@@ -985,6 +1002,7 @@ class DynamicWalletClient {
|
|
|
985
1002
|
* @param walletOperation - The wallet operation that determines required fields
|
|
986
1003
|
* @returns boolean indicating if wallet needs to be re-fetched and restored from server
|
|
987
1004
|
*/ async checkWalletFields({ accountAddress, walletOperation = core.WalletOperation.REACH_THRESHOLD, shareCount }) {
|
|
1005
|
+
var _existingWallet_externalServerKeyShares;
|
|
988
1006
|
let keyshareCheck = false;
|
|
989
1007
|
let walletCheck = false;
|
|
990
1008
|
let thresholdSignatureSchemeCheck = false;
|
|
@@ -1004,7 +1022,7 @@ class DynamicWalletClient {
|
|
|
1004
1022
|
}
|
|
1005
1023
|
// check if wallet already exists with sufficient keyshares
|
|
1006
1024
|
if (existingWallet) {
|
|
1007
|
-
var
|
|
1025
|
+
var _existingWallet_externalServerKeyShares1;
|
|
1008
1026
|
const { shares } = this.recoverStrategy({
|
|
1009
1027
|
externalServerKeySharesBackupInfo: existingWallet.externalServerKeySharesBackupInfo || {
|
|
1010
1028
|
backups: getExternalServerKeyShareBackupInfo()
|
|
@@ -1014,11 +1032,35 @@ class DynamicWalletClient {
|
|
|
1014
1032
|
shareCount
|
|
1015
1033
|
});
|
|
1016
1034
|
const { dynamic: requiredDynamicKeyShareIds = [] } = shares;
|
|
1017
|
-
|
|
1035
|
+
const { external: requiredExternalKeyShareIds = [] } = shares;
|
|
1036
|
+
// Check if we have enough shares from any backup location
|
|
1037
|
+
const totalRequiredShares = requiredDynamicKeyShareIds.length + requiredExternalKeyShareIds.length;
|
|
1038
|
+
// Check if we have the required shares either loaded OR available in backup
|
|
1039
|
+
const hasLoadedShares = totalRequiredShares <= (((_existingWallet_externalServerKeyShares1 = existingWallet.externalServerKeyShares) == null ? void 0 : _existingWallet_externalServerKeyShares1.length) || 0);
|
|
1040
|
+
// Check if backup contains the specific required share IDs
|
|
1041
|
+
const hasBackupShares = existingWallet.externalServerKeySharesBackupInfo && (()=>{
|
|
1042
|
+
const backupShares = existingWallet.externalServerKeySharesBackupInfo.backups.dynamic;
|
|
1043
|
+
const allRequiredIds = [
|
|
1044
|
+
...requiredDynamicKeyShareIds,
|
|
1045
|
+
...requiredExternalKeyShareIds
|
|
1046
|
+
];
|
|
1047
|
+
return allRequiredIds.every((requiredId)=>backupShares.some((backupShare)=>backupShare.externalKeyShareId === requiredId || backupShare.keyShareId === requiredId));
|
|
1048
|
+
})();
|
|
1049
|
+
if (hasLoadedShares || hasBackupShares) {
|
|
1018
1050
|
keyshareCheck = true;
|
|
1019
1051
|
}
|
|
1020
1052
|
}
|
|
1021
|
-
|
|
1053
|
+
const result = walletCheck && thresholdSignatureSchemeCheck && keyshareCheck && derivationPathCheck;
|
|
1054
|
+
this.logger.debug('Wallet checks:', {
|
|
1055
|
+
walletCheck,
|
|
1056
|
+
thresholdSignatureSchemeCheck,
|
|
1057
|
+
keyshareCheck,
|
|
1058
|
+
derivationPathCheck,
|
|
1059
|
+
existingWallet: !!existingWallet,
|
|
1060
|
+
keySharesLength: existingWallet == null ? void 0 : (_existingWallet_externalServerKeyShares = existingWallet.externalServerKeyShares) == null ? void 0 : _existingWallet_externalServerKeyShares.length,
|
|
1061
|
+
result
|
|
1062
|
+
});
|
|
1063
|
+
return result;
|
|
1022
1064
|
}
|
|
1023
1065
|
/**
|
|
1024
1066
|
* verifyPassword attempts to recover and decrypt a single client key share using the provided password.
|
|
@@ -1044,8 +1086,10 @@ class DynamicWalletClient {
|
|
|
1044
1086
|
accountAddress
|
|
1045
1087
|
});
|
|
1046
1088
|
const { dynamic: dynamicKeyShareIds = [] } = backups;
|
|
1047
|
-
|
|
1048
|
-
|
|
1089
|
+
const { external: externalKeyShareIds = [] } = backups;
|
|
1090
|
+
// Check if we have any shares available (DYNAMIC or EXTERNAL)
|
|
1091
|
+
if (dynamicKeyShareIds.length === 0 && externalKeyShareIds.length === 0) {
|
|
1092
|
+
throw new Error('No key shares found');
|
|
1049
1093
|
}
|
|
1050
1094
|
try {
|
|
1051
1095
|
await this.recoverEncryptedBackupByWallet({
|
|
@@ -1090,12 +1134,16 @@ class DynamicWalletClient {
|
|
|
1090
1134
|
if (walletOperation === core.WalletOperation.REACH_ALL_PARTIES || walletOperation === core.WalletOperation.REFRESH || walletOperation === core.WalletOperation.RESHARE) {
|
|
1091
1135
|
return true;
|
|
1092
1136
|
}
|
|
1093
|
-
const { requiredShareCount } = this.recoverStrategy({
|
|
1137
|
+
const { shares, requiredShareCount } = this.recoverStrategy({
|
|
1094
1138
|
externalServerKeySharesBackupInfo,
|
|
1095
1139
|
thresholdSignatureScheme: this.walletMap[accountAddress].thresholdSignatureScheme,
|
|
1096
1140
|
walletOperation
|
|
1097
1141
|
});
|
|
1098
|
-
|
|
1142
|
+
const dynamicKeyShareIds = shares[core.BackupLocation.DYNAMIC] || [];
|
|
1143
|
+
const externalKeyShareIds = shares[core.BackupLocation.EXTERNAL] || [];
|
|
1144
|
+
// Check if we have enough shares from either location
|
|
1145
|
+
const totalAvailableShares = externalServerKeyShares.length + dynamicKeyShareIds.length + externalKeyShareIds.length;
|
|
1146
|
+
if (totalAvailableShares >= requiredShareCount) {
|
|
1099
1147
|
return false;
|
|
1100
1148
|
}
|
|
1101
1149
|
return true;
|
|
@@ -1177,8 +1225,8 @@ class DynamicWalletClient {
|
|
|
1177
1225
|
const user = await this.apiClient.getUser(uuid.v4());
|
|
1178
1226
|
const waasWallets = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.filter((vc)=>vc.walletName === 'dynamicwaas');
|
|
1179
1227
|
const wallets = waasWallets.map((vc)=>{
|
|
1180
|
-
var _this_walletMap_vc_address,
|
|
1181
|
-
var
|
|
1228
|
+
var _this_walletMap_vc_address, _vc_walletProperties, _vc_walletProperties1;
|
|
1229
|
+
var _vc_walletProperties_derivationPath;
|
|
1182
1230
|
return {
|
|
1183
1231
|
walletId: vc.id,
|
|
1184
1232
|
chainName: vc.chain,
|
|
@@ -1187,20 +1235,18 @@ class DynamicWalletClient {
|
|
|
1187
1235
|
walletProperties: vc.walletProperties || {}
|
|
1188
1236
|
}),
|
|
1189
1237
|
externalServerKeyShares: ((_this_walletMap_vc_address = this.walletMap[vc.address]) == null ? void 0 : _this_walletMap_vc_address.externalServerKeyShares) || [],
|
|
1190
|
-
derivationPath: (
|
|
1191
|
-
thresholdSignatureScheme: (
|
|
1238
|
+
derivationPath: (_vc_walletProperties_derivationPath = (_vc_walletProperties = vc.walletProperties) == null ? void 0 : _vc_walletProperties.derivationPath) != null ? _vc_walletProperties_derivationPath : undefined,
|
|
1239
|
+
thresholdSignatureScheme: (_vc_walletProperties1 = vc.walletProperties) == null ? void 0 : _vc_walletProperties1.thresholdSignatureScheme
|
|
1192
1240
|
};
|
|
1193
1241
|
});
|
|
1194
1242
|
this.walletMap = wallets.reduce((acc, wallet)=>{
|
|
1195
|
-
var _acc_accountAddress;
|
|
1196
|
-
const accountAddress = wallet.accountAddress;
|
|
1197
1243
|
acc[wallet.accountAddress] = {
|
|
1198
1244
|
walletId: wallet.walletId,
|
|
1199
1245
|
chainName: wallet.chainName,
|
|
1200
1246
|
accountAddress: wallet.accountAddress,
|
|
1201
1247
|
externalServerKeyShares: wallet.externalServerKeyShares || [],
|
|
1202
1248
|
externalServerKeySharesBackupInfo: wallet.externalServerKeySharesBackupInfo,
|
|
1203
|
-
derivationPath:
|
|
1249
|
+
derivationPath: wallet.derivationPath,
|
|
1204
1250
|
thresholdSignatureScheme: wallet.thresholdSignatureScheme
|
|
1205
1251
|
};
|
|
1206
1252
|
return acc;
|
|
@@ -1224,10 +1270,18 @@ Object.defineProperty(exports, "SOLANA_RPC_URL", {
|
|
|
1224
1270
|
enumerable: true,
|
|
1225
1271
|
get: function () { return core.SOLANA_RPC_URL; }
|
|
1226
1272
|
});
|
|
1273
|
+
Object.defineProperty(exports, "ThresholdSignatureScheme", {
|
|
1274
|
+
enumerable: true,
|
|
1275
|
+
get: function () { return core.ThresholdSignatureScheme; }
|
|
1276
|
+
});
|
|
1227
1277
|
Object.defineProperty(exports, "WalletOperation", {
|
|
1228
1278
|
enumerable: true,
|
|
1229
1279
|
get: function () { return core.WalletOperation; }
|
|
1230
1280
|
});
|
|
1281
|
+
Object.defineProperty(exports, "getMPCChainConfig", {
|
|
1282
|
+
enumerable: true,
|
|
1283
|
+
get: function () { return core.getMPCChainConfig; }
|
|
1284
|
+
});
|
|
1231
1285
|
exports.DynamicWalletClient = DynamicWalletClient;
|
|
1232
1286
|
exports.base64ToBytes = base64ToBytes;
|
|
1233
1287
|
exports.bytesToBase64 = bytesToBase64;
|
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '#internal/core';
|
|
2
2
|
import { SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, BackupLocation, DynamicApiClient, getClientThreshold, MPC_CONFIG, getTSSConfig, WalletOperation, getServerWalletReshareConfig } from '@dynamic-labs-wallet/core';
|
|
3
|
-
export { SOLANA_RPC_URL, WalletOperation } from '@dynamic-labs-wallet/core';
|
|
3
|
+
export { SOLANA_RPC_URL, ThresholdSignatureScheme, WalletOperation, getMPCChainConfig } from '@dynamic-labs-wallet/core';
|
|
4
4
|
import { BIP340, ExportableEd25519, Ecdsa, MessageHash, EcdsaKeygenResult, ExportableEd25519KeygenResult, BIP340KeygenResult } from '#internal/node';
|
|
5
5
|
import { v4 } from 'uuid';
|
|
6
6
|
import { Logger } from '@dynamic-labs/logger';
|
|
@@ -67,7 +67,8 @@ const getExternalServerKeyShareBackupInfo = (params)=>{
|
|
|
67
67
|
[BackupLocation.GOOGLE_DRIVE]: [],
|
|
68
68
|
[BackupLocation.ICLOUD]: [],
|
|
69
69
|
[BackupLocation.USER]: [],
|
|
70
|
-
[BackupLocation.EXTERNAL]: []
|
|
70
|
+
[BackupLocation.EXTERNAL]: [],
|
|
71
|
+
[BackupLocation.DELEGATED]: []
|
|
71
72
|
};
|
|
72
73
|
if (!(params == null ? void 0 : (_params_walletProperties = params.walletProperties) == null ? void 0 : _params_walletProperties.keyShares)) {
|
|
73
74
|
return {
|
|
@@ -927,10 +928,14 @@ class DynamicWalletClient {
|
|
|
927
928
|
if (shareCount !== undefined) {
|
|
928
929
|
requiredShareCount = shareCount;
|
|
929
930
|
}
|
|
930
|
-
const dynamicShares = backups[BackupLocation.DYNAMIC].slice(0, requiredShareCount);
|
|
931
|
+
const dynamicShares = (backups[BackupLocation.DYNAMIC] || []).slice(0, requiredShareCount);
|
|
932
|
+
const externalShares = (backups[BackupLocation.EXTERNAL] || []).slice(0, requiredShareCount);
|
|
933
|
+
// If we have DYNAMIC shares, use those; otherwise use EXTERNAL shares
|
|
934
|
+
const sharesToUse = dynamicShares.length > 0 ? dynamicShares : externalShares;
|
|
935
|
+
const backupLocation = dynamicShares.length > 0 ? BackupLocation.DYNAMIC : BackupLocation.EXTERNAL;
|
|
931
936
|
return {
|
|
932
937
|
shares: {
|
|
933
|
-
[
|
|
938
|
+
[backupLocation]: sharesToUse.map((ks)=>{
|
|
934
939
|
var _ks_externalKeyShareId, _ref;
|
|
935
940
|
return (_ref = (_ks_externalKeyShareId = ks.externalKeyShareId) != null ? _ks_externalKeyShareId : ks.keyShareId) != null ? _ref : '';
|
|
936
941
|
})
|
|
@@ -948,12 +953,24 @@ class DynamicWalletClient {
|
|
|
948
953
|
walletOperation,
|
|
949
954
|
shareCount
|
|
950
955
|
});
|
|
951
|
-
|
|
952
|
-
const
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
956
|
+
// Get the key share IDs from whichever backup location has shares
|
|
957
|
+
const dynamicKeyShareIds = shares[BackupLocation.DYNAMIC] || [];
|
|
958
|
+
const externalKeyShareIds = shares[BackupLocation.EXTERNAL] || [];
|
|
959
|
+
// Only attempt recovery if we have DYNAMIC shares (the API doesn't support EXTERNAL shares)
|
|
960
|
+
let data;
|
|
961
|
+
if (dynamicKeyShareIds.length > 0) {
|
|
962
|
+
data = await this.apiClient.recoverEncryptedBackupByWallet({
|
|
963
|
+
walletId: wallet.walletId,
|
|
964
|
+
keyShareIds: dynamicKeyShareIds,
|
|
965
|
+
requiresSignedSessionId: false
|
|
966
|
+
});
|
|
967
|
+
} else if (externalKeyShareIds.length > 0) {
|
|
968
|
+
this.logger.debug('Skipping recovery - only EXTERNAL shares available (backUpToClientShareService: false)');
|
|
969
|
+
return []; // Return empty array since we can't recover EXTERNAL shares via API
|
|
970
|
+
} else {
|
|
971
|
+
this.logger.debug('No shares available for recovery');
|
|
972
|
+
return []; // Return empty array if no shares are available
|
|
973
|
+
}
|
|
957
974
|
const dynamicKeyShares = data.keyShares.filter((keyShare)=>keyShare.encryptedAccountCredential !== null && keyShare.backupLocation === BackupLocation.DYNAMIC);
|
|
958
975
|
const decryptedKeyShares = await Promise.all(dynamicKeyShares.map((keyShare)=>this.decryptKeyShare({
|
|
959
976
|
keyShare: keyShare.encryptedAccountCredential,
|
|
@@ -984,6 +1001,7 @@ class DynamicWalletClient {
|
|
|
984
1001
|
* @param walletOperation - The wallet operation that determines required fields
|
|
985
1002
|
* @returns boolean indicating if wallet needs to be re-fetched and restored from server
|
|
986
1003
|
*/ async checkWalletFields({ accountAddress, walletOperation = WalletOperation.REACH_THRESHOLD, shareCount }) {
|
|
1004
|
+
var _existingWallet_externalServerKeyShares;
|
|
987
1005
|
let keyshareCheck = false;
|
|
988
1006
|
let walletCheck = false;
|
|
989
1007
|
let thresholdSignatureSchemeCheck = false;
|
|
@@ -1003,7 +1021,7 @@ class DynamicWalletClient {
|
|
|
1003
1021
|
}
|
|
1004
1022
|
// check if wallet already exists with sufficient keyshares
|
|
1005
1023
|
if (existingWallet) {
|
|
1006
|
-
var
|
|
1024
|
+
var _existingWallet_externalServerKeyShares1;
|
|
1007
1025
|
const { shares } = this.recoverStrategy({
|
|
1008
1026
|
externalServerKeySharesBackupInfo: existingWallet.externalServerKeySharesBackupInfo || {
|
|
1009
1027
|
backups: getExternalServerKeyShareBackupInfo()
|
|
@@ -1013,11 +1031,35 @@ class DynamicWalletClient {
|
|
|
1013
1031
|
shareCount
|
|
1014
1032
|
});
|
|
1015
1033
|
const { dynamic: requiredDynamicKeyShareIds = [] } = shares;
|
|
1016
|
-
|
|
1034
|
+
const { external: requiredExternalKeyShareIds = [] } = shares;
|
|
1035
|
+
// Check if we have enough shares from any backup location
|
|
1036
|
+
const totalRequiredShares = requiredDynamicKeyShareIds.length + requiredExternalKeyShareIds.length;
|
|
1037
|
+
// Check if we have the required shares either loaded OR available in backup
|
|
1038
|
+
const hasLoadedShares = totalRequiredShares <= (((_existingWallet_externalServerKeyShares1 = existingWallet.externalServerKeyShares) == null ? void 0 : _existingWallet_externalServerKeyShares1.length) || 0);
|
|
1039
|
+
// Check if backup contains the specific required share IDs
|
|
1040
|
+
const hasBackupShares = existingWallet.externalServerKeySharesBackupInfo && (()=>{
|
|
1041
|
+
const backupShares = existingWallet.externalServerKeySharesBackupInfo.backups.dynamic;
|
|
1042
|
+
const allRequiredIds = [
|
|
1043
|
+
...requiredDynamicKeyShareIds,
|
|
1044
|
+
...requiredExternalKeyShareIds
|
|
1045
|
+
];
|
|
1046
|
+
return allRequiredIds.every((requiredId)=>backupShares.some((backupShare)=>backupShare.externalKeyShareId === requiredId || backupShare.keyShareId === requiredId));
|
|
1047
|
+
})();
|
|
1048
|
+
if (hasLoadedShares || hasBackupShares) {
|
|
1017
1049
|
keyshareCheck = true;
|
|
1018
1050
|
}
|
|
1019
1051
|
}
|
|
1020
|
-
|
|
1052
|
+
const result = walletCheck && thresholdSignatureSchemeCheck && keyshareCheck && derivationPathCheck;
|
|
1053
|
+
this.logger.debug('Wallet checks:', {
|
|
1054
|
+
walletCheck,
|
|
1055
|
+
thresholdSignatureSchemeCheck,
|
|
1056
|
+
keyshareCheck,
|
|
1057
|
+
derivationPathCheck,
|
|
1058
|
+
existingWallet: !!existingWallet,
|
|
1059
|
+
keySharesLength: existingWallet == null ? void 0 : (_existingWallet_externalServerKeyShares = existingWallet.externalServerKeyShares) == null ? void 0 : _existingWallet_externalServerKeyShares.length,
|
|
1060
|
+
result
|
|
1061
|
+
});
|
|
1062
|
+
return result;
|
|
1021
1063
|
}
|
|
1022
1064
|
/**
|
|
1023
1065
|
* verifyPassword attempts to recover and decrypt a single client key share using the provided password.
|
|
@@ -1043,8 +1085,10 @@ class DynamicWalletClient {
|
|
|
1043
1085
|
accountAddress
|
|
1044
1086
|
});
|
|
1045
1087
|
const { dynamic: dynamicKeyShareIds = [] } = backups;
|
|
1046
|
-
|
|
1047
|
-
|
|
1088
|
+
const { external: externalKeyShareIds = [] } = backups;
|
|
1089
|
+
// Check if we have any shares available (DYNAMIC or EXTERNAL)
|
|
1090
|
+
if (dynamicKeyShareIds.length === 0 && externalKeyShareIds.length === 0) {
|
|
1091
|
+
throw new Error('No key shares found');
|
|
1048
1092
|
}
|
|
1049
1093
|
try {
|
|
1050
1094
|
await this.recoverEncryptedBackupByWallet({
|
|
@@ -1089,12 +1133,16 @@ class DynamicWalletClient {
|
|
|
1089
1133
|
if (walletOperation === WalletOperation.REACH_ALL_PARTIES || walletOperation === WalletOperation.REFRESH || walletOperation === WalletOperation.RESHARE) {
|
|
1090
1134
|
return true;
|
|
1091
1135
|
}
|
|
1092
|
-
const { requiredShareCount } = this.recoverStrategy({
|
|
1136
|
+
const { shares, requiredShareCount } = this.recoverStrategy({
|
|
1093
1137
|
externalServerKeySharesBackupInfo,
|
|
1094
1138
|
thresholdSignatureScheme: this.walletMap[accountAddress].thresholdSignatureScheme,
|
|
1095
1139
|
walletOperation
|
|
1096
1140
|
});
|
|
1097
|
-
|
|
1141
|
+
const dynamicKeyShareIds = shares[BackupLocation.DYNAMIC] || [];
|
|
1142
|
+
const externalKeyShareIds = shares[BackupLocation.EXTERNAL] || [];
|
|
1143
|
+
// Check if we have enough shares from either location
|
|
1144
|
+
const totalAvailableShares = externalServerKeyShares.length + dynamicKeyShareIds.length + externalKeyShareIds.length;
|
|
1145
|
+
if (totalAvailableShares >= requiredShareCount) {
|
|
1098
1146
|
return false;
|
|
1099
1147
|
}
|
|
1100
1148
|
return true;
|
|
@@ -1176,8 +1224,8 @@ class DynamicWalletClient {
|
|
|
1176
1224
|
const user = await this.apiClient.getUser(v4());
|
|
1177
1225
|
const waasWallets = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.filter((vc)=>vc.walletName === 'dynamicwaas');
|
|
1178
1226
|
const wallets = waasWallets.map((vc)=>{
|
|
1179
|
-
var _this_walletMap_vc_address,
|
|
1180
|
-
var
|
|
1227
|
+
var _this_walletMap_vc_address, _vc_walletProperties, _vc_walletProperties1;
|
|
1228
|
+
var _vc_walletProperties_derivationPath;
|
|
1181
1229
|
return {
|
|
1182
1230
|
walletId: vc.id,
|
|
1183
1231
|
chainName: vc.chain,
|
|
@@ -1186,20 +1234,18 @@ class DynamicWalletClient {
|
|
|
1186
1234
|
walletProperties: vc.walletProperties || {}
|
|
1187
1235
|
}),
|
|
1188
1236
|
externalServerKeyShares: ((_this_walletMap_vc_address = this.walletMap[vc.address]) == null ? void 0 : _this_walletMap_vc_address.externalServerKeyShares) || [],
|
|
1189
|
-
derivationPath: (
|
|
1190
|
-
thresholdSignatureScheme: (
|
|
1237
|
+
derivationPath: (_vc_walletProperties_derivationPath = (_vc_walletProperties = vc.walletProperties) == null ? void 0 : _vc_walletProperties.derivationPath) != null ? _vc_walletProperties_derivationPath : undefined,
|
|
1238
|
+
thresholdSignatureScheme: (_vc_walletProperties1 = vc.walletProperties) == null ? void 0 : _vc_walletProperties1.thresholdSignatureScheme
|
|
1191
1239
|
};
|
|
1192
1240
|
});
|
|
1193
1241
|
this.walletMap = wallets.reduce((acc, wallet)=>{
|
|
1194
|
-
var _acc_accountAddress;
|
|
1195
|
-
const accountAddress = wallet.accountAddress;
|
|
1196
1242
|
acc[wallet.accountAddress] = {
|
|
1197
1243
|
walletId: wallet.walletId,
|
|
1198
1244
|
chainName: wallet.chainName,
|
|
1199
1245
|
accountAddress: wallet.accountAddress,
|
|
1200
1246
|
externalServerKeyShares: wallet.externalServerKeyShares || [],
|
|
1201
1247
|
externalServerKeySharesBackupInfo: wallet.externalServerKeySharesBackupInfo,
|
|
1202
|
-
derivationPath:
|
|
1248
|
+
derivationPath: wallet.derivationPath,
|
|
1203
1249
|
thresholdSignatureScheme: wallet.thresholdSignatureScheme
|
|
1204
1250
|
};
|
|
1205
1251
|
return acc;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/node",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-pr361.1",
|
|
4
4
|
"license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/core": "0.0.0-
|
|
7
|
+
"@dynamic-labs-wallet/core": "0.0.0-pr361.1",
|
|
8
8
|
"@dynamic-labs/logger": "^4.25.3",
|
|
9
9
|
"uuid": "11.1.0",
|
|
10
10
|
"@noble/hashes": "1.7.1"
|
package/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,cAAc,EAEnB,KAAK,cAAc,EAInB,6BAA6B,EAC9B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,wBAAwB,EAC7B,gBAAgB,EAIhB,eAAe,EACf,KAAK,kBAAkB,EACvB,cAAc,EAIf,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAcnD,KAAK,cAAc,GACf,iBAAiB,GACjB,kBAAkB,GAClB,6BAA6B,CAAC;AAElC,qBAAa,mBAAmB;IACvB,aAAa,EAAE,MAAM,CAAC;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,eAA8C,EAC9C,UAAsB,EACtB,QAAoB,GACrB,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;QAClC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IA2EK,UAAU;CAqCjB"}
|
package/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '#internal/core';
|
|
2
|
-
export
|
|
3
|
-
export { WalletOperation, SOLANA_RPC_URL } from '@dynamic-labs-wallet/core';
|
|
2
|
+
export { ThresholdSignatureScheme } from '@dynamic-labs-wallet/core';
|
|
3
|
+
export { WalletOperation, SOLANA_RPC_URL, getMPCChainConfig, } from '@dynamic-labs-wallet/core';
|
|
4
4
|
export { getMPCSignatureScheme, getMPCSigner } from './mpc/index.js';
|
|
5
5
|
export type { ServerInitKeygenResult, ServerKeyShare, SignMessage, } from './mpc/index.js';
|
|
6
6
|
export * from './client.js';
|
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAG/B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACrE,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAGxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
package/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAExB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,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;AAEF,eAAO,MAAM,WAAW,QAAS,MAAM,YAKtC,CAAC;AAEF,eAAO,MAAM,mCAAmC,YAAa;IAC3D,gBAAgB,EAAE,oBAAoB,CAAC;CACxC,KAAG,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAExB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,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;AAEF,eAAO,MAAM,WAAW,QAAS,MAAM,YAKtC,CAAC;AAEF,eAAO,MAAM,mCAAmC,YAAa;IAC3D,gBAAgB,EAAE,oBAAoB,CA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