@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.
@@ -24524,11 +24524,11 @@ function decryptSimple(ciphertext, password) {
24524
24524
  }
24525
24525
 
24526
24526
  // impl/nodejs/storage/list-wallets.ts
24527
- var WALLET_FILE = /\.(json|txt)$/;
24527
+ var WALLET_FILE = /\.(json|txt)$/i;
24528
24528
  var PLAINTEXT_KEY = /^[0-9a-f]{64}$/i;
24529
24529
  var PASSPHRASE_CIPHERTEXT = /^U2FsdGVkX1[0-9A-Za-z+/=]+$/;
24530
24530
  function readStoredSecret(filePath, content) {
24531
- if (filePath.endsWith(".txt")) {
24531
+ if (/\.txt$/i.test(filePath)) {
24532
24532
  return validateMnemonic2(content) || PASSPHRASE_CIPHERTEXT.test(content) ? content : null;
24533
24533
  }
24534
24534
  let record;
@@ -24540,6 +24540,7 @@ function readStoredSecret(filePath, content) {
24540
24540
  if (typeof record !== "object" || record === null) return null;
24541
24541
  const fields = record;
24542
24542
  if (fields.type === "sphere-wallet") return null;
24543
+ if ("masterPrivateKey" in fields || "descriptorPath" in fields || "encrypted" in fields) return null;
24543
24544
  for (const key of [STORAGE_KEYS_GLOBAL.MNEMONIC, STORAGE_KEYS_GLOBAL.MASTER_KEY]) {
24544
24545
  const value = fields[key];
24545
24546
  if (typeof value === "string" && value !== "") return value;