Conversation
✅ Deploy Preview for cheery-moxie-4f1121 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
JSKitty
left a comment
There was a problem hiding this comment.
JSKitty
Tested the full export/import flow on the deploy preview. Imported a mnemonic, skipped encryption, exported — got a base64 seed. Deleted the wallet, re-imported the base64 seed, and the wallet recreated with the same address. The core functionality works, but there's a couple code issues I'll let Claude expand on below.
Claude Audit
Bug 1: Double call to getSecretToExport()
In scripts/composables/use_wallet.js — getSecretToBackup():
const secret = v.getSecretToExport();
if (typeof v.getSecretToExport() === 'string') {v.getSecretToExport() is called twice — once stored in secret, then again in the typeof check. This is unnecessary computation; should be typeof secret.
Bug 2: Stale isJSON prop — users can download a .json file that isn't JSON
In Dashboard.vue, the export modal still has:
<ExportPrivKey :isJSON="hasShield && !activeVault?.isEncrypted" ... />For unencrypted seeded vaults, getSecretToBackup() now returns a base64 seed string, not JSON. But isJSON still evaluates to true, so the "Download Wallet File" button appears and offers a .json download containing raw base64 — not valid JSON.
✅ Deploy Preview for cheery-moxie-4f1121 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
I removed the slightly awkward isJSON and now:
|
| 'wallet.json', | ||
| 'application/json;charset=utf-8;' | ||
| isJSON ? 'wallet.json' : 'wallet.txt', | ||
| `${isJSON ? application / json : 'text/plain'};charset=utf-8;` |
There was a problem hiding this comment.
Typo that would lead to a MIME type of NaN;charset=utf-8;
| `${isJSON ? application / json : 'text/plain'};charset=utf-8;` | |
| `${isJSON ? 'application/json' : 'text/plain'};charset=utf-8;` |
Abstract
Add the ability for MPW to accept and import base64 encoded seeds,
Export (optionally encrypted) seed when clicking on the "Export" instead of exporting the singular wallet
Testing
Test exporting on a different types of vaults (Legacy, seeded, unseeded)