@unicitylabs/sphere-sdk 0.17.4 → 0.17.5

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.
@@ -24566,11 +24566,11 @@ function decryptSimple(ciphertext, password) {
24566
24566
  }
24567
24567
 
24568
24568
  // impl/nodejs/storage/list-wallets.ts
24569
- var WALLET_FILE = /\.(json|txt)$/;
24569
+ var WALLET_FILE = /\.(json|txt)$/i;
24570
24570
  var PLAINTEXT_KEY = /^[0-9a-f]{64}$/i;
24571
24571
  var PASSPHRASE_CIPHERTEXT = /^U2FsdGVkX1[0-9A-Za-z+/=]+$/;
24572
24572
  function readStoredSecret(filePath, content) {
24573
- if (filePath.endsWith(".txt")) {
24573
+ if (/\.txt$/i.test(filePath)) {
24574
24574
  return validateMnemonic2(content) || PASSPHRASE_CIPHERTEXT.test(content) ? content : null;
24575
24575
  }
24576
24576
  let record;
@@ -24582,6 +24582,7 @@ function readStoredSecret(filePath, content) {
24582
24582
  if (typeof record !== "object" || record === null) return null;
24583
24583
  const fields = record;
24584
24584
  if (fields.type === "sphere-wallet") return null;
24585
+ if ("masterPrivateKey" in fields || "descriptorPath" in fields || "encrypted" in fields) return null;
24585
24586
  for (const key of [STORAGE_KEYS_GLOBAL.MNEMONIC, STORAGE_KEYS_GLOBAL.MASTER_KEY]) {
24586
24587
  const value = fields[key];
24587
24588
  if (typeof value === "string" && value !== "") return value;