@dynamic-labs-wallet/node 0.0.0-beta.310 → 0.0.0-beta.312
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 +96 -72
- package/index.esm.js +87 -32
- package/internal/core/package.json +17 -0
- package/internal/node/package.json +17 -0
- package/package.json +9 -4
- package/src/backup/encryption.d.ts +1 -1
- package/src/backup/encryption.d.ts.map +1 -1
- package/src/backup/utils.d.ts +2 -2
- package/src/backup/utils.d.ts.map +1 -1
- package/src/client.d.ts +6 -6
- package/src/client.d.ts.map +1 -1
- package/src/index.d.ts +8 -5
- package/src/index.d.ts.map +1 -1
- package/src/mpc/index.d.ts +2 -2
- package/src/mpc/index.d.ts.map +1 -1
- package/src/mpc/mpc.d.ts +1 -2
- package/src/mpc/mpc.d.ts.map +1 -1
- package/src/mpc/types.d.ts +1 -2
- package/src/mpc/types.d.ts.map +1 -1
- package/src/types.d.ts +8 -2
- package/src/types.d.ts.map +1 -1
- package/src/utils.d.ts +3 -3
- package/src/utils.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var core$1 = require('#internal/core');
|
|
3
4
|
var core = require('@dynamic-labs-wallet/core');
|
|
4
|
-
var node = require('
|
|
5
|
+
var node = require('#internal/node');
|
|
5
6
|
var uuid = require('uuid');
|
|
6
7
|
var logger$1 = require('@dynamic-labs/logger');
|
|
7
8
|
var crypto = require('crypto');
|
|
8
9
|
|
|
10
|
+
// Removed duplicate exports - these are already exported from #internal/core
|
|
9
11
|
const getMPCSignatureScheme = ({ signingAlgorithm, baseRelayUrl = core.MPC_RELAY_PROD_API_URL })=>{
|
|
10
12
|
switch(signingAlgorithm){
|
|
11
13
|
case core.SigningAlgorithm.ECDSA:
|
|
@@ -66,7 +68,8 @@ const getExternalServerKeyShareBackupInfo = (params)=>{
|
|
|
66
68
|
[core.BackupLocation.GOOGLE_DRIVE]: [],
|
|
67
69
|
[core.BackupLocation.ICLOUD]: [],
|
|
68
70
|
[core.BackupLocation.USER]: [],
|
|
69
|
-
[core.BackupLocation.EXTERNAL]: []
|
|
71
|
+
[core.BackupLocation.EXTERNAL]: [],
|
|
72
|
+
[core.BackupLocation.DELEGATED]: []
|
|
70
73
|
};
|
|
71
74
|
if (!(params == null ? void 0 : (_params_walletProperties = params.walletProperties) == null ? void 0 : _params_walletProperties.keyShares)) {
|
|
72
75
|
return {
|
|
@@ -800,6 +803,7 @@ class DynamicWalletClient {
|
|
|
800
803
|
await this.ensureCeremonyCompletionBeforeBackup({
|
|
801
804
|
accountAddress
|
|
802
805
|
});
|
|
806
|
+
const dynamicRequestId = uuid.v4();
|
|
803
807
|
try {
|
|
804
808
|
const keySharesToBackup = externalServerKeyShares != null ? externalServerKeyShares : await this.getExternalServerKeyShares({
|
|
805
809
|
accountAddress,
|
|
@@ -822,7 +826,8 @@ class DynamicWalletClient {
|
|
|
822
826
|
encryptedKeyShares: encryptedKeyShares,
|
|
823
827
|
passwordEncrypted: Boolean(password) && password !== this.environmentId,
|
|
824
828
|
encryptionVersion: ENCRYPTION_VERSION_CURRENT,
|
|
825
|
-
requiresSignedSessionId: false
|
|
829
|
+
requiresSignedSessionId: false,
|
|
830
|
+
dynamicRequestId
|
|
826
831
|
});
|
|
827
832
|
locations.push({
|
|
828
833
|
location: core.BackupLocation.DYNAMIC,
|
|
@@ -835,7 +840,8 @@ class DynamicWalletClient {
|
|
|
835
840
|
}
|
|
836
841
|
const backupData = await this.apiClient.markKeySharesAsBackedUp({
|
|
837
842
|
walletId: this.walletMap[accountAddress].walletId,
|
|
838
|
-
locations
|
|
843
|
+
locations,
|
|
844
|
+
dynamicRequestId
|
|
839
845
|
});
|
|
840
846
|
const updatedBackupInfo = getExternalServerKeyShareBackupInfo({
|
|
841
847
|
walletProperties: {
|
|
@@ -854,7 +860,11 @@ class DynamicWalletClient {
|
|
|
854
860
|
});
|
|
855
861
|
return encryptedKeyShares;
|
|
856
862
|
} catch (error) {
|
|
857
|
-
this.logger.error('Error in storeEncryptedBackupByWallet:',
|
|
863
|
+
this.logger.error('Error in storeEncryptedBackupByWallet:', {
|
|
864
|
+
accountAddress,
|
|
865
|
+
error,
|
|
866
|
+
dynamicRequestId
|
|
867
|
+
});
|
|
858
868
|
throw error;
|
|
859
869
|
}
|
|
860
870
|
}
|
|
@@ -919,10 +929,14 @@ class DynamicWalletClient {
|
|
|
919
929
|
if (shareCount !== undefined) {
|
|
920
930
|
requiredShareCount = shareCount;
|
|
921
931
|
}
|
|
922
|
-
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;
|
|
923
937
|
return {
|
|
924
938
|
shares: {
|
|
925
|
-
[
|
|
939
|
+
[backupLocation]: sharesToUse.map((ks)=>{
|
|
926
940
|
var _ks_externalKeyShareId, _ref;
|
|
927
941
|
return (_ref = (_ks_externalKeyShareId = ks.externalKeyShareId) != null ? _ks_externalKeyShareId : ks.keyShareId) != null ? _ref : '';
|
|
928
942
|
})
|
|
@@ -940,12 +954,24 @@ class DynamicWalletClient {
|
|
|
940
954
|
walletOperation,
|
|
941
955
|
shareCount
|
|
942
956
|
});
|
|
943
|
-
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
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
|
+
}
|
|
949
975
|
const dynamicKeyShares = data.keyShares.filter((keyShare)=>keyShare.encryptedAccountCredential !== null && keyShare.backupLocation === core.BackupLocation.DYNAMIC);
|
|
950
976
|
const decryptedKeyShares = await Promise.all(dynamicKeyShares.map((keyShare)=>this.decryptKeyShare({
|
|
951
977
|
keyShare: keyShare.encryptedAccountCredential,
|
|
@@ -976,6 +1002,7 @@ class DynamicWalletClient {
|
|
|
976
1002
|
* @param walletOperation - The wallet operation that determines required fields
|
|
977
1003
|
* @returns boolean indicating if wallet needs to be re-fetched and restored from server
|
|
978
1004
|
*/ async checkWalletFields({ accountAddress, walletOperation = core.WalletOperation.REACH_THRESHOLD, shareCount }) {
|
|
1005
|
+
var _existingWallet_externalServerKeyShares;
|
|
979
1006
|
let keyshareCheck = false;
|
|
980
1007
|
let walletCheck = false;
|
|
981
1008
|
let thresholdSignatureSchemeCheck = false;
|
|
@@ -995,7 +1022,7 @@ class DynamicWalletClient {
|
|
|
995
1022
|
}
|
|
996
1023
|
// check if wallet already exists with sufficient keyshares
|
|
997
1024
|
if (existingWallet) {
|
|
998
|
-
var
|
|
1025
|
+
var _existingWallet_externalServerKeyShares1;
|
|
999
1026
|
const { shares } = this.recoverStrategy({
|
|
1000
1027
|
externalServerKeySharesBackupInfo: existingWallet.externalServerKeySharesBackupInfo || {
|
|
1001
1028
|
backups: getExternalServerKeyShareBackupInfo()
|
|
@@ -1005,11 +1032,35 @@ class DynamicWalletClient {
|
|
|
1005
1032
|
shareCount
|
|
1006
1033
|
});
|
|
1007
1034
|
const { dynamic: requiredDynamicKeyShareIds = [] } = shares;
|
|
1008
|
-
|
|
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) {
|
|
1009
1050
|
keyshareCheck = true;
|
|
1010
1051
|
}
|
|
1011
1052
|
}
|
|
1012
|
-
|
|
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;
|
|
1013
1064
|
}
|
|
1014
1065
|
/**
|
|
1015
1066
|
* verifyPassword attempts to recover and decrypt a single client key share using the provided password.
|
|
@@ -1035,8 +1086,10 @@ class DynamicWalletClient {
|
|
|
1035
1086
|
accountAddress
|
|
1036
1087
|
});
|
|
1037
1088
|
const { dynamic: dynamicKeyShareIds = [] } = backups;
|
|
1038
|
-
|
|
1039
|
-
|
|
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');
|
|
1040
1093
|
}
|
|
1041
1094
|
try {
|
|
1042
1095
|
await this.recoverEncryptedBackupByWallet({
|
|
@@ -1081,12 +1134,16 @@ class DynamicWalletClient {
|
|
|
1081
1134
|
if (walletOperation === core.WalletOperation.REACH_ALL_PARTIES || walletOperation === core.WalletOperation.REFRESH || walletOperation === core.WalletOperation.RESHARE) {
|
|
1082
1135
|
return true;
|
|
1083
1136
|
}
|
|
1084
|
-
const { requiredShareCount } = this.recoverStrategy({
|
|
1137
|
+
const { shares, requiredShareCount } = this.recoverStrategy({
|
|
1085
1138
|
externalServerKeySharesBackupInfo,
|
|
1086
1139
|
thresholdSignatureScheme: this.walletMap[accountAddress].thresholdSignatureScheme,
|
|
1087
1140
|
walletOperation
|
|
1088
1141
|
});
|
|
1089
|
-
|
|
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) {
|
|
1090
1147
|
return false;
|
|
1091
1148
|
}
|
|
1092
1149
|
return true;
|
|
@@ -1099,13 +1156,14 @@ class DynamicWalletClient {
|
|
|
1099
1156
|
return this.walletMap[accountAddress].externalServerKeySharesBackupInfo;
|
|
1100
1157
|
}
|
|
1101
1158
|
// Get backup info from server
|
|
1102
|
-
const user = await this.apiClient.getUser();
|
|
1159
|
+
const user = await this.apiClient.getUser(uuid.v4());
|
|
1103
1160
|
const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>vc.address.toLowerCase() === accountAddress.toLowerCase());
|
|
1104
1161
|
return getExternalServerKeyShareBackupInfo({
|
|
1105
1162
|
walletProperties: wallet == null ? void 0 : wallet.walletProperties
|
|
1106
1163
|
});
|
|
1107
1164
|
}
|
|
1108
1165
|
async getWallet({ accountAddress, walletOperation = core.WalletOperation.NO_OPERATION, shareCount = undefined, password = undefined }) {
|
|
1166
|
+
const dynamicRequestId = uuid.v4();
|
|
1109
1167
|
try {
|
|
1110
1168
|
var _user_verifiedCredentials;
|
|
1111
1169
|
this.ensureApiClientAuthenticated();
|
|
@@ -1120,7 +1178,7 @@ class DynamicWalletClient {
|
|
|
1120
1178
|
}
|
|
1121
1179
|
//todo: Question - why don't we just call getWallets here? so then all are preloaded
|
|
1122
1180
|
// Fetch and restore wallet from server
|
|
1123
|
-
const user = await this.apiClient.getUser();
|
|
1181
|
+
const user = await this.apiClient.getUser(dynamicRequestId);
|
|
1124
1182
|
const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>vc.address.toLowerCase() === accountAddress.toLowerCase());
|
|
1125
1183
|
this.logger.debug('Restoring wallet', wallet);
|
|
1126
1184
|
const walletProperties = wallet.walletProperties;
|
|
@@ -1164,11 +1222,11 @@ class DynamicWalletClient {
|
|
|
1164
1222
|
async getWallets() {
|
|
1165
1223
|
var _user_verifiedCredentials;
|
|
1166
1224
|
this.ensureApiClientAuthenticated();
|
|
1167
|
-
const user = await this.apiClient.getUser();
|
|
1225
|
+
const user = await this.apiClient.getUser(uuid.v4());
|
|
1168
1226
|
const waasWallets = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.filter((vc)=>vc.walletName === 'dynamicwaas');
|
|
1169
1227
|
const wallets = waasWallets.map((vc)=>{
|
|
1170
|
-
var _this_walletMap_vc_address,
|
|
1171
|
-
var
|
|
1228
|
+
var _this_walletMap_vc_address, _vc_walletProperties, _vc_walletProperties1;
|
|
1229
|
+
var _vc_walletProperties_derivationPath;
|
|
1172
1230
|
return {
|
|
1173
1231
|
walletId: vc.id,
|
|
1174
1232
|
chainName: vc.chain,
|
|
@@ -1177,20 +1235,18 @@ class DynamicWalletClient {
|
|
|
1177
1235
|
walletProperties: vc.walletProperties || {}
|
|
1178
1236
|
}),
|
|
1179
1237
|
externalServerKeyShares: ((_this_walletMap_vc_address = this.walletMap[vc.address]) == null ? void 0 : _this_walletMap_vc_address.externalServerKeyShares) || [],
|
|
1180
|
-
derivationPath: (
|
|
1181
|
-
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
|
|
1182
1240
|
};
|
|
1183
1241
|
});
|
|
1184
1242
|
this.walletMap = wallets.reduce((acc, wallet)=>{
|
|
1185
|
-
var _acc_accountAddress;
|
|
1186
|
-
const accountAddress = wallet.accountAddress;
|
|
1187
1243
|
acc[wallet.accountAddress] = {
|
|
1188
1244
|
walletId: wallet.walletId,
|
|
1189
1245
|
chainName: wallet.chainName,
|
|
1190
1246
|
accountAddress: wallet.accountAddress,
|
|
1191
1247
|
externalServerKeyShares: wallet.externalServerKeyShares || [],
|
|
1192
1248
|
externalServerKeySharesBackupInfo: wallet.externalServerKeySharesBackupInfo,
|
|
1193
|
-
derivationPath:
|
|
1249
|
+
derivationPath: wallet.derivationPath,
|
|
1194
1250
|
thresholdSignatureScheme: wallet.thresholdSignatureScheme
|
|
1195
1251
|
};
|
|
1196
1252
|
return acc;
|
|
@@ -1210,53 +1266,21 @@ class DynamicWalletClient {
|
|
|
1210
1266
|
}
|
|
1211
1267
|
}
|
|
1212
1268
|
|
|
1213
|
-
Object.defineProperty(exports, "
|
|
1214
|
-
enumerable: true,
|
|
1215
|
-
get: function () { return node.BIP340; }
|
|
1216
|
-
});
|
|
1217
|
-
Object.defineProperty(exports, "BIP340InitKeygenResult", {
|
|
1218
|
-
enumerable: true,
|
|
1219
|
-
get: function () { return node.BIP340InitKeygenResult; }
|
|
1220
|
-
});
|
|
1221
|
-
Object.defineProperty(exports, "BIP340KeygenResult", {
|
|
1222
|
-
enumerable: true,
|
|
1223
|
-
get: function () { return node.BIP340KeygenResult; }
|
|
1224
|
-
});
|
|
1225
|
-
Object.defineProperty(exports, "Ecdsa", {
|
|
1226
|
-
enumerable: true,
|
|
1227
|
-
get: function () { return node.Ecdsa; }
|
|
1228
|
-
});
|
|
1229
|
-
Object.defineProperty(exports, "EcdsaInitKeygenResult", {
|
|
1230
|
-
enumerable: true,
|
|
1231
|
-
get: function () { return node.EcdsaInitKeygenResult; }
|
|
1232
|
-
});
|
|
1233
|
-
Object.defineProperty(exports, "EcdsaKeygenResult", {
|
|
1234
|
-
enumerable: true,
|
|
1235
|
-
get: function () { return node.EcdsaKeygenResult; }
|
|
1236
|
-
});
|
|
1237
|
-
Object.defineProperty(exports, "EcdsaPublicKey", {
|
|
1238
|
-
enumerable: true,
|
|
1239
|
-
get: function () { return node.EcdsaPublicKey; }
|
|
1240
|
-
});
|
|
1241
|
-
Object.defineProperty(exports, "EcdsaSignature", {
|
|
1242
|
-
enumerable: true,
|
|
1243
|
-
get: function () { return node.EcdsaSignature; }
|
|
1244
|
-
});
|
|
1245
|
-
Object.defineProperty(exports, "ExportableEd25519", {
|
|
1269
|
+
Object.defineProperty(exports, "SOLANA_RPC_URL", {
|
|
1246
1270
|
enumerable: true,
|
|
1247
|
-
get: function () { return
|
|
1271
|
+
get: function () { return core.SOLANA_RPC_URL; }
|
|
1248
1272
|
});
|
|
1249
|
-
Object.defineProperty(exports, "
|
|
1273
|
+
Object.defineProperty(exports, "ThresholdSignatureScheme", {
|
|
1250
1274
|
enumerable: true,
|
|
1251
|
-
get: function () { return
|
|
1275
|
+
get: function () { return core.ThresholdSignatureScheme; }
|
|
1252
1276
|
});
|
|
1253
|
-
Object.defineProperty(exports, "
|
|
1277
|
+
Object.defineProperty(exports, "WalletOperation", {
|
|
1254
1278
|
enumerable: true,
|
|
1255
|
-
get: function () { return
|
|
1279
|
+
get: function () { return core.WalletOperation; }
|
|
1256
1280
|
});
|
|
1257
|
-
Object.defineProperty(exports, "
|
|
1281
|
+
Object.defineProperty(exports, "getMPCChainConfig", {
|
|
1258
1282
|
enumerable: true,
|
|
1259
|
-
get: function () { return
|
|
1283
|
+
get: function () { return core.getMPCChainConfig; }
|
|
1260
1284
|
});
|
|
1261
1285
|
exports.DynamicWalletClient = DynamicWalletClient;
|
|
1262
1286
|
exports.base64ToBytes = base64ToBytes;
|
|
@@ -1271,9 +1295,9 @@ exports.isHexString = isHexString;
|
|
|
1271
1295
|
exports.mergeUniqueKeyShares = mergeUniqueKeyShares;
|
|
1272
1296
|
exports.retryPromise = retryPromise;
|
|
1273
1297
|
exports.stringToBytes = stringToBytes;
|
|
1274
|
-
Object.keys(core).forEach(function (k) {
|
|
1298
|
+
Object.keys(core$1).forEach(function (k) {
|
|
1275
1299
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
1276
1300
|
enumerable: true,
|
|
1277
|
-
get: function () { return core[k]; }
|
|
1301
|
+
get: function () { return core$1[k]; }
|
|
1278
1302
|
});
|
|
1279
1303
|
});
|
package/index.esm.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
export * from '#internal/core';
|
|
1
2
|
import { SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, BackupLocation, DynamicApiClient, getClientThreshold, MPC_CONFIG, getTSSConfig, WalletOperation, getServerWalletReshareConfig } from '@dynamic-labs-wallet/core';
|
|
2
|
-
export
|
|
3
|
-
import { BIP340, ExportableEd25519, Ecdsa, MessageHash, EcdsaKeygenResult, ExportableEd25519KeygenResult, BIP340KeygenResult } from '
|
|
4
|
-
export { BIP340, BIP340InitKeygenResult, BIP340KeygenResult, Ecdsa, EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, ExportableEd25519, ExportableEd25519InitKeygenResult, ExportableEd25519KeygenResult, MessageHash } from './internal/node';
|
|
3
|
+
export { SOLANA_RPC_URL, ThresholdSignatureScheme, WalletOperation, getMPCChainConfig } from '@dynamic-labs-wallet/core';
|
|
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';
|
|
7
7
|
import crypto from 'crypto';
|
|
8
8
|
|
|
9
|
+
// Removed duplicate exports - these are already exported from #internal/core
|
|
9
10
|
const getMPCSignatureScheme = ({ signingAlgorithm, baseRelayUrl = MPC_RELAY_PROD_API_URL })=>{
|
|
10
11
|
switch(signingAlgorithm){
|
|
11
12
|
case SigningAlgorithm.ECDSA:
|
|
@@ -66,7 +67,8 @@ const getExternalServerKeyShareBackupInfo = (params)=>{
|
|
|
66
67
|
[BackupLocation.GOOGLE_DRIVE]: [],
|
|
67
68
|
[BackupLocation.ICLOUD]: [],
|
|
68
69
|
[BackupLocation.USER]: [],
|
|
69
|
-
[BackupLocation.EXTERNAL]: []
|
|
70
|
+
[BackupLocation.EXTERNAL]: [],
|
|
71
|
+
[BackupLocation.DELEGATED]: []
|
|
70
72
|
};
|
|
71
73
|
if (!(params == null ? void 0 : (_params_walletProperties = params.walletProperties) == null ? void 0 : _params_walletProperties.keyShares)) {
|
|
72
74
|
return {
|
|
@@ -800,6 +802,7 @@ class DynamicWalletClient {
|
|
|
800
802
|
await this.ensureCeremonyCompletionBeforeBackup({
|
|
801
803
|
accountAddress
|
|
802
804
|
});
|
|
805
|
+
const dynamicRequestId = v4();
|
|
803
806
|
try {
|
|
804
807
|
const keySharesToBackup = externalServerKeyShares != null ? externalServerKeyShares : await this.getExternalServerKeyShares({
|
|
805
808
|
accountAddress,
|
|
@@ -822,7 +825,8 @@ class DynamicWalletClient {
|
|
|
822
825
|
encryptedKeyShares: encryptedKeyShares,
|
|
823
826
|
passwordEncrypted: Boolean(password) && password !== this.environmentId,
|
|
824
827
|
encryptionVersion: ENCRYPTION_VERSION_CURRENT,
|
|
825
|
-
requiresSignedSessionId: false
|
|
828
|
+
requiresSignedSessionId: false,
|
|
829
|
+
dynamicRequestId
|
|
826
830
|
});
|
|
827
831
|
locations.push({
|
|
828
832
|
location: BackupLocation.DYNAMIC,
|
|
@@ -835,7 +839,8 @@ class DynamicWalletClient {
|
|
|
835
839
|
}
|
|
836
840
|
const backupData = await this.apiClient.markKeySharesAsBackedUp({
|
|
837
841
|
walletId: this.walletMap[accountAddress].walletId,
|
|
838
|
-
locations
|
|
842
|
+
locations,
|
|
843
|
+
dynamicRequestId
|
|
839
844
|
});
|
|
840
845
|
const updatedBackupInfo = getExternalServerKeyShareBackupInfo({
|
|
841
846
|
walletProperties: {
|
|
@@ -854,7 +859,11 @@ class DynamicWalletClient {
|
|
|
854
859
|
});
|
|
855
860
|
return encryptedKeyShares;
|
|
856
861
|
} catch (error) {
|
|
857
|
-
this.logger.error('Error in storeEncryptedBackupByWallet:',
|
|
862
|
+
this.logger.error('Error in storeEncryptedBackupByWallet:', {
|
|
863
|
+
accountAddress,
|
|
864
|
+
error,
|
|
865
|
+
dynamicRequestId
|
|
866
|
+
});
|
|
858
867
|
throw error;
|
|
859
868
|
}
|
|
860
869
|
}
|
|
@@ -919,10 +928,14 @@ class DynamicWalletClient {
|
|
|
919
928
|
if (shareCount !== undefined) {
|
|
920
929
|
requiredShareCount = shareCount;
|
|
921
930
|
}
|
|
922
|
-
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;
|
|
923
936
|
return {
|
|
924
937
|
shares: {
|
|
925
|
-
[
|
|
938
|
+
[backupLocation]: sharesToUse.map((ks)=>{
|
|
926
939
|
var _ks_externalKeyShareId, _ref;
|
|
927
940
|
return (_ref = (_ks_externalKeyShareId = ks.externalKeyShareId) != null ? _ks_externalKeyShareId : ks.keyShareId) != null ? _ref : '';
|
|
928
941
|
})
|
|
@@ -940,12 +953,24 @@ class DynamicWalletClient {
|
|
|
940
953
|
walletOperation,
|
|
941
954
|
shareCount
|
|
942
955
|
});
|
|
943
|
-
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
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
|
+
}
|
|
949
974
|
const dynamicKeyShares = data.keyShares.filter((keyShare)=>keyShare.encryptedAccountCredential !== null && keyShare.backupLocation === BackupLocation.DYNAMIC);
|
|
950
975
|
const decryptedKeyShares = await Promise.all(dynamicKeyShares.map((keyShare)=>this.decryptKeyShare({
|
|
951
976
|
keyShare: keyShare.encryptedAccountCredential,
|
|
@@ -976,6 +1001,7 @@ class DynamicWalletClient {
|
|
|
976
1001
|
* @param walletOperation - The wallet operation that determines required fields
|
|
977
1002
|
* @returns boolean indicating if wallet needs to be re-fetched and restored from server
|
|
978
1003
|
*/ async checkWalletFields({ accountAddress, walletOperation = WalletOperation.REACH_THRESHOLD, shareCount }) {
|
|
1004
|
+
var _existingWallet_externalServerKeyShares;
|
|
979
1005
|
let keyshareCheck = false;
|
|
980
1006
|
let walletCheck = false;
|
|
981
1007
|
let thresholdSignatureSchemeCheck = false;
|
|
@@ -995,7 +1021,7 @@ class DynamicWalletClient {
|
|
|
995
1021
|
}
|
|
996
1022
|
// check if wallet already exists with sufficient keyshares
|
|
997
1023
|
if (existingWallet) {
|
|
998
|
-
var
|
|
1024
|
+
var _existingWallet_externalServerKeyShares1;
|
|
999
1025
|
const { shares } = this.recoverStrategy({
|
|
1000
1026
|
externalServerKeySharesBackupInfo: existingWallet.externalServerKeySharesBackupInfo || {
|
|
1001
1027
|
backups: getExternalServerKeyShareBackupInfo()
|
|
@@ -1005,11 +1031,35 @@ class DynamicWalletClient {
|
|
|
1005
1031
|
shareCount
|
|
1006
1032
|
});
|
|
1007
1033
|
const { dynamic: requiredDynamicKeyShareIds = [] } = shares;
|
|
1008
|
-
|
|
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) {
|
|
1009
1049
|
keyshareCheck = true;
|
|
1010
1050
|
}
|
|
1011
1051
|
}
|
|
1012
|
-
|
|
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;
|
|
1013
1063
|
}
|
|
1014
1064
|
/**
|
|
1015
1065
|
* verifyPassword attempts to recover and decrypt a single client key share using the provided password.
|
|
@@ -1035,8 +1085,10 @@ class DynamicWalletClient {
|
|
|
1035
1085
|
accountAddress
|
|
1036
1086
|
});
|
|
1037
1087
|
const { dynamic: dynamicKeyShareIds = [] } = backups;
|
|
1038
|
-
|
|
1039
|
-
|
|
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');
|
|
1040
1092
|
}
|
|
1041
1093
|
try {
|
|
1042
1094
|
await this.recoverEncryptedBackupByWallet({
|
|
@@ -1081,12 +1133,16 @@ class DynamicWalletClient {
|
|
|
1081
1133
|
if (walletOperation === WalletOperation.REACH_ALL_PARTIES || walletOperation === WalletOperation.REFRESH || walletOperation === WalletOperation.RESHARE) {
|
|
1082
1134
|
return true;
|
|
1083
1135
|
}
|
|
1084
|
-
const { requiredShareCount } = this.recoverStrategy({
|
|
1136
|
+
const { shares, requiredShareCount } = this.recoverStrategy({
|
|
1085
1137
|
externalServerKeySharesBackupInfo,
|
|
1086
1138
|
thresholdSignatureScheme: this.walletMap[accountAddress].thresholdSignatureScheme,
|
|
1087
1139
|
walletOperation
|
|
1088
1140
|
});
|
|
1089
|
-
|
|
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) {
|
|
1090
1146
|
return false;
|
|
1091
1147
|
}
|
|
1092
1148
|
return true;
|
|
@@ -1099,13 +1155,14 @@ class DynamicWalletClient {
|
|
|
1099
1155
|
return this.walletMap[accountAddress].externalServerKeySharesBackupInfo;
|
|
1100
1156
|
}
|
|
1101
1157
|
// Get backup info from server
|
|
1102
|
-
const user = await this.apiClient.getUser();
|
|
1158
|
+
const user = await this.apiClient.getUser(v4());
|
|
1103
1159
|
const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>vc.address.toLowerCase() === accountAddress.toLowerCase());
|
|
1104
1160
|
return getExternalServerKeyShareBackupInfo({
|
|
1105
1161
|
walletProperties: wallet == null ? void 0 : wallet.walletProperties
|
|
1106
1162
|
});
|
|
1107
1163
|
}
|
|
1108
1164
|
async getWallet({ accountAddress, walletOperation = WalletOperation.NO_OPERATION, shareCount = undefined, password = undefined }) {
|
|
1165
|
+
const dynamicRequestId = v4();
|
|
1109
1166
|
try {
|
|
1110
1167
|
var _user_verifiedCredentials;
|
|
1111
1168
|
this.ensureApiClientAuthenticated();
|
|
@@ -1120,7 +1177,7 @@ class DynamicWalletClient {
|
|
|
1120
1177
|
}
|
|
1121
1178
|
//todo: Question - why don't we just call getWallets here? so then all are preloaded
|
|
1122
1179
|
// Fetch and restore wallet from server
|
|
1123
|
-
const user = await this.apiClient.getUser();
|
|
1180
|
+
const user = await this.apiClient.getUser(dynamicRequestId);
|
|
1124
1181
|
const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>vc.address.toLowerCase() === accountAddress.toLowerCase());
|
|
1125
1182
|
this.logger.debug('Restoring wallet', wallet);
|
|
1126
1183
|
const walletProperties = wallet.walletProperties;
|
|
@@ -1164,11 +1221,11 @@ class DynamicWalletClient {
|
|
|
1164
1221
|
async getWallets() {
|
|
1165
1222
|
var _user_verifiedCredentials;
|
|
1166
1223
|
this.ensureApiClientAuthenticated();
|
|
1167
|
-
const user = await this.apiClient.getUser();
|
|
1224
|
+
const user = await this.apiClient.getUser(v4());
|
|
1168
1225
|
const waasWallets = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.filter((vc)=>vc.walletName === 'dynamicwaas');
|
|
1169
1226
|
const wallets = waasWallets.map((vc)=>{
|
|
1170
|
-
var _this_walletMap_vc_address,
|
|
1171
|
-
var
|
|
1227
|
+
var _this_walletMap_vc_address, _vc_walletProperties, _vc_walletProperties1;
|
|
1228
|
+
var _vc_walletProperties_derivationPath;
|
|
1172
1229
|
return {
|
|
1173
1230
|
walletId: vc.id,
|
|
1174
1231
|
chainName: vc.chain,
|
|
@@ -1177,20 +1234,18 @@ class DynamicWalletClient {
|
|
|
1177
1234
|
walletProperties: vc.walletProperties || {}
|
|
1178
1235
|
}),
|
|
1179
1236
|
externalServerKeyShares: ((_this_walletMap_vc_address = this.walletMap[vc.address]) == null ? void 0 : _this_walletMap_vc_address.externalServerKeyShares) || [],
|
|
1180
|
-
derivationPath: (
|
|
1181
|
-
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
|
|
1182
1239
|
};
|
|
1183
1240
|
});
|
|
1184
1241
|
this.walletMap = wallets.reduce((acc, wallet)=>{
|
|
1185
|
-
var _acc_accountAddress;
|
|
1186
|
-
const accountAddress = wallet.accountAddress;
|
|
1187
1242
|
acc[wallet.accountAddress] = {
|
|
1188
1243
|
walletId: wallet.walletId,
|
|
1189
1244
|
chainName: wallet.chainName,
|
|
1190
1245
|
accountAddress: wallet.accountAddress,
|
|
1191
1246
|
externalServerKeyShares: wallet.externalServerKeyShares || [],
|
|
1192
1247
|
externalServerKeySharesBackupInfo: wallet.externalServerKeySharesBackupInfo,
|
|
1193
|
-
derivationPath:
|
|
1248
|
+
derivationPath: wallet.derivationPath,
|
|
1194
1249
|
thresholdSignatureScheme: wallet.thresholdSignatureScheme
|
|
1195
1250
|
};
|
|
1196
1251
|
return acc;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "#internal/core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"require": "./index.js",
|
|
11
|
+
"import": "./index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@noble/hashes": "1.7.1"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "#internal/node",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"require": "./index.js",
|
|
11
|
+
"import": "./index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@noble/hashes": "1.7.1"
|
|
16
|
+
}
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/node",
|
|
3
|
-
"version": "0.0.0-beta.
|
|
3
|
+
"version": "0.0.0-beta.312",
|
|
4
4
|
"license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/core": "0.0.0-beta.
|
|
7
|
+
"@dynamic-labs-wallet/core": "0.0.0-beta.312",
|
|
7
8
|
"@dynamic-labs/logger": "^4.25.3",
|
|
8
9
|
"uuid": "11.1.0",
|
|
9
10
|
"@noble/hashes": "1.7.1"
|
|
@@ -23,13 +24,17 @@
|
|
|
23
24
|
"main": "./index.cjs.js",
|
|
24
25
|
"module": "./index.esm.js",
|
|
25
26
|
"types": "./index.esm.d.ts",
|
|
26
|
-
"type": "module",
|
|
27
27
|
"exports": {
|
|
28
28
|
"./package.json": "./package.json",
|
|
29
29
|
".": {
|
|
30
30
|
"types": "./index.esm.d.ts",
|
|
31
31
|
"import": "./index.esm.js",
|
|
32
|
-
"require": "./index.cjs.js"
|
|
32
|
+
"require": "./index.cjs.js",
|
|
33
|
+
"default": "./index.esm.js"
|
|
33
34
|
}
|
|
35
|
+
},
|
|
36
|
+
"imports": {
|
|
37
|
+
"#internal/node": "./internal/node/index.js",
|
|
38
|
+
"#internal/core": "./internal/core/index.js"
|
|
34
39
|
}
|
|
35
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EncryptionMetadata } from '@dynamic-labs-wallet/core';
|
|
1
|
+
import type { EncryptionMetadata } from '@dynamic-labs-wallet/core';
|
|
2
2
|
export declare const ENCRYPTION_VERSION_LEGACY = "v1";
|
|
3
3
|
export declare const ENCRYPTION_VERSION_CURRENT = "v2";
|
|
4
4
|
export declare const PBKDF2_ALGORITHM = "PBKDF2";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../src/backup/encryption.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../src/backup/encryption.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAQpE,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAC/C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;CAiBtB,CAAC;AAEX,eAAO,MAAM,iBAAiB,SAC8B,CAAC;AAC7D,eAAO,MAAM,wBAAwB,QACsB,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAsCjE;;;GAGG;AACH,eAAO,MAAM,WAAW,iCAIrB;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;;;;;EAkCA,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,wBAGrB;IACD,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,QAAQ,EAAE,MAAM,CAAC;CAClB,oBA2CA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,YACjC,MAAM,KACd,kBAcF,CAAC"}
|
package/src/backup/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ServerKeyShare } from '../mpc/types';
|
|
2
|
-
import { WalletProperties } from '../types';
|
|
1
|
+
import type { ServerKeyShare } from '../mpc/types.js';
|
|
2
|
+
import type { WalletProperties } from '../types.js';
|
|
3
3
|
export declare const checkIfExternalServerKeySharesAreRequired: (wallet: WalletProperties, externalServerKeyShares?: ServerKeyShare[]) => void;
|
|
4
4
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/backup/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/backup/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,yCAAyC,WAC5C,gBAAgB,4BACE,cAAc,EAAE,SAkB3C,CAAC"}
|
package/src/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EcdsaKeygenResult, BIP340KeygenResult, EcdsaPublicKey, EcdsaSignature, ExportableEd25519KeygenResult } from '
|
|
2
|
-
import { ThresholdSignatureScheme, DynamicApiClient, WalletOperation, KeyShareBackupInfo, BackupLocation } from '@dynamic-labs-wallet/core';
|
|
3
|
-
import { ServerInitKeygenResult } from './mpc/types';
|
|
4
|
-
import { WalletProperties } from './types';
|
|
1
|
+
import { EcdsaKeygenResult, BIP340KeygenResult, type EcdsaPublicKey, type EcdsaSignature, ExportableEd25519KeygenResult } from '#internal/node';
|
|
2
|
+
import { type ThresholdSignatureScheme, DynamicApiClient, WalletOperation, type KeyShareBackupInfo, BackupLocation } from '@dynamic-labs-wallet/core';
|
|
3
|
+
import type { ServerInitKeygenResult } from './mpc/types.js';
|
|
4
|
+
import type { WalletProperties } from './types.js';
|
|
5
5
|
type ServerKeyShare = EcdsaKeygenResult | BIP340KeygenResult | ExportableEd25519KeygenResult;
|
|
6
6
|
export declare class DynamicWalletClient {
|
|
7
7
|
environmentId: string;
|
|
@@ -170,7 +170,7 @@ export declare class DynamicWalletClient {
|
|
|
170
170
|
getExternalServerKeyShares({ accountAddress, password, }: {
|
|
171
171
|
accountAddress: string;
|
|
172
172
|
password?: string;
|
|
173
|
-
}): Promise<import("./
|
|
173
|
+
}): Promise<import("./index.js").ServerKeyShare[]>;
|
|
174
174
|
updatePassword({ accountAddress, existingPassword, newPassword, backUpToClientShareService, }: {
|
|
175
175
|
accountAddress: string;
|
|
176
176
|
existingPassword?: string;
|
|
@@ -212,7 +212,7 @@ export declare class DynamicWalletClient {
|
|
|
212
212
|
exportExternalServerKeyShares({ accountAddress, password, }: {
|
|
213
213
|
accountAddress: string;
|
|
214
214
|
password?: string;
|
|
215
|
-
}): Promise<import("./
|
|
215
|
+
}): Promise<import("./index.js").ServerKeyShare[]>;
|
|
216
216
|
/**
|
|
217
217
|
* Helper function to check if the required wallet fields are present and valid
|
|
218
218
|
* @param accountAddress - The account address of the wallet to check
|
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,cAAc,
|
|
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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
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export * from '#internal/core';
|
|
2
|
+
export { ThresholdSignatureScheme } from '@dynamic-labs-wallet/core';
|
|
3
|
+
export { WalletOperation, SOLANA_RPC_URL, getMPCChainConfig, } from '@dynamic-labs-wallet/core';
|
|
4
|
+
export { getMPCSignatureScheme, getMPCSigner } from './mpc/index.js';
|
|
5
|
+
export type { ServerInitKeygenResult, ServerKeyShare, SignMessage, } from './mpc/index.js';
|
|
6
|
+
export * from './client.js';
|
|
7
|
+
export * from './types.js';
|
|
8
|
+
export * from './utils.js';
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"
|
|
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/mpc/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { getMPCSignatureScheme, getMPCSigner } from './mpc.js';
|
|
2
|
+
export type { ServerInitKeygenResult, ServerKeyShare, SignMessage, } from './types.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/src/mpc/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mpc/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mpc/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC/D,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,WAAW,GACZ,MAAM,YAAY,CAAC"}
|
package/src/mpc/mpc.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SigningAlgorithm } from '@dynamic-labs-wallet/core';
|
|
2
|
-
import { Ecdsa, ExportableEd25519, BIP340
|
|
3
|
-
export { Ecdsa, ExportableEd25519, BIP340, EcdsaPublicKey, EcdsaKeygenResult, ExportableEd25519KeygenResult, BIP340KeygenResult, MessageHash, EcdsaInitKeygenResult, ExportableEd25519InitKeygenResult, BIP340InitKeygenResult, EcdsaSignature, };
|
|
2
|
+
import { Ecdsa, ExportableEd25519, BIP340 } from '#internal/node';
|
|
4
3
|
export declare const getMPCSignatureScheme: ({ signingAlgorithm, baseRelayUrl, }: {
|
|
5
4
|
signingAlgorithm: SigningAlgorithm;
|
|
6
5
|
baseRelayUrl?: string;
|
package/src/mpc/mpc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mpc.d.ts","sourceRoot":"","sources":["../../src/mpc/mpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,
|
|
1
|
+
{"version":3,"file":"mpc.d.ts","sourceRoot":"","sources":["../../src/mpc/mpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAIlE,eAAO,MAAM,qBAAqB,wCAG/B;IACD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,uCAWA,CAAC;AAEF,eAAO,MAAM,YAAY,iCAGtB;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,uCAOA,CAAC"}
|
package/src/mpc/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { BIP340InitKeygenResult, BIP340KeygenResult,
|
|
1
|
+
import type { BIP340InitKeygenResult, BIP340KeygenResult, EcdsaInitKeygenResult, EcdsaKeygenResult, Ed25519InitKeygenResult, Ed25519KeygenResult, MessageHash } from '#internal/node';
|
|
2
2
|
export type ServerInitKeygenResult = EcdsaInitKeygenResult | Ed25519InitKeygenResult | BIP340InitKeygenResult;
|
|
3
3
|
export type ServerKeyShare = EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
|
|
4
4
|
export type SignMessage = MessageHash | Uint8Array;
|
|
5
|
-
export type { Ecdsa, Ed25519, BIP340, EcdsaPublicKey, EcdsaKeygenResult, Ed25519KeygenResult, BIP340KeygenResult, MessageHash, EcdsaSignature, } from '../../../internal/node';
|
|
6
5
|
//# sourceMappingURL=types.d.ts.map
|
package/src/mpc/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/mpc/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/mpc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,sBAAsB,GAC9B,qBAAqB,GACrB,uBAAuB,GACvB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,mBAAmB,GACnB,kBAAkB,CAAC;AAEvB,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,UAAU,CAAC"}
|
package/src/types.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { ThresholdSignatureScheme, KeyShareBackupInfo } from '@dynamic-labs-wallet/core';
|
|
2
|
-
import { ServerKeyShare } from './mpc/types';
|
|
1
|
+
import type { ThresholdSignatureScheme, KeyShareBackupInfo } from '@dynamic-labs-wallet/core';
|
|
2
|
+
import type { ServerKeyShare } from './mpc/types.js';
|
|
3
|
+
export interface DynamicWalletClientProps {
|
|
4
|
+
environmentId: string;
|
|
5
|
+
baseApiUrl?: string;
|
|
6
|
+
baseMPCRelayApiUrl?: string;
|
|
7
|
+
debug?: boolean;
|
|
8
|
+
}
|
|
3
9
|
export interface WalletProperties {
|
|
4
10
|
chainName: string;
|
|
5
11
|
walletId: string;
|
package/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../packages/src/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../packages/src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,WAAW,wBAAwB;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,EAAE,cAAc,EAAE,CAAC;IAC1C,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iCAAiC,EAAE,kBAAkB,CAAC;CACvD"}
|
package/src/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WaasWalletProperties, KeyShareBackupInfo } from '@dynamic-labs-wallet/core';
|
|
2
|
-
import { ServerKeyShare } from './mpc/types';
|
|
3
|
-
import { MessageHash } from '
|
|
1
|
+
import { type WaasWalletProperties, type KeyShareBackupInfo } from '@dynamic-labs-wallet/core';
|
|
2
|
+
import type { ServerKeyShare } from './mpc/types.js';
|
|
3
|
+
import { MessageHash } from '#internal/node';
|
|
4
4
|
export declare const bytesToBase64: (arr: Uint8Array) => string;
|
|
5
5
|
export declare const stringToBytes: (str: string) => Uint8Array;
|
|
6
6
|
export declare const base64ToBytes: (base64: string) => Uint8Array;
|
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,oBAAoB,
|
|
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,eAA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