Skip to content

feat(wallets): add Import Wallet wizard#259

Merged
QSchlegel merged 2 commits into
preprodfrom
claude/feat-import-wallet-preprod
May 25, 2026
Merged

feat(wallets): add Import Wallet wizard#259
QSchlegel merged 2 commits into
preprodfrom
claude/feat-import-wallet-preprod

Conversation

@QSchlegel
Copy link
Copy Markdown
Collaborator

Summary

  • Adds an Import Wallet entry point next to New Wallet with a single-page wizard covering four sources: another multisig instance (deep link or root URL + signer picker), Summon (forwards into the existing /wallets/invite flow), manual native-script CBOR paste, and JSON backup upload.
  • Backend: new wallet.importWallet / wallet.exportWallet tRPC procedures sharing the existing wallet.createWallet write path, plus /api/v1/exportWallet/{getNonce,redeem,listMine} cross-instance endpoints that reuse the CIP-8 checkSignature verification.
  • Pairs the wizard with a Download JSON backup action on the wallet info page for round-tripping. Provenance lives in the existing rawImportBodies JSON (no schema migration); a lockedSigners flag gates the wallet info Edit-Signers UI so imported wallets can't silently diverge from their origin.

Test plan

  • /wallets shows the new Import Wallet button next to New Wallet
  • /wallets/import-wallet renders the 3-step wizard (Source → Review → Ready) before a wallet is connected (added to publicRoutes)
  • Mobile: source picker is a Select dropdown; desktop: 4-column tab bar
  • Instance tab: paste a deep link to a wallet on another instance, CIP-30 nonce-sign with the connected wallet, confirm review step shows the origin panel + signers + script CBOR, submit → wallet appears in sidebar at the same on-chain address
  • Instance tab (root URL mode): paste only the origin, picker lists wallets the signer is on, pick one → same flow
  • Summon tab: paste a Summon-generated invite URL → redirects to /wallets/invite/<id> (uses the existing /api/v1/import/summon backend)
  • CBOR tab: paste known script CBOR + signers, verify rejection when (a) script hash doesn't match reconstructed signers or (b) connected stake address isn't in the list
  • JSON tab: click Download JSON backup on a wallet, log in as another signer, upload the file → import succeeds; confirm hand-edited JSON is rejected with "Payload hash mismatch"
  • Negative: POST /api/v1/exportWallet/redeem with wrong wallet id returns 401; GET /api/v1/exportWallet/getNonce with non-signer address returns 403
  • Imported wallet's info page hides the Edit Signers affordance (lockedSigners gate)
  • npm run typecheck clean (pre-existing errors in audit.ts / users.ts are unrelated)
  • npx prisma migrate status reports no pending migrations

🤖 Generated with Claude Code

Adds an Import Wallet entry point alongside New Wallet with a single-page
wizard covering four sources: another multisig instance (deep link or
root URL + signer picker, with CIP-30 nonce-sign against the origin),
Summon (forwards into the existing /wallets/invite flow), manual
native-script CBOR paste, and JSON backup upload. Wires up a paired
Download JSON backup action on the wallet info page so users can
round-trip exports between instances.

Backend: new wallet.importWallet/exportWallet tRPC procedures sharing
the wallet.createWallet write path, plus /api/v1/exportWallet/{getNonce,
redeem,listMine} cross-instance endpoints that reuse the existing CIP-8
checkSignature verification. No Prisma schema change — provenance lives
in the existing rawImportBodies JSON, with a lockedSigners flag the
wallet info Edit Signers gate respects so imported wallets can't
silently diverge from their origin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
multisig Ready Ready Preview, Comment May 25, 2026 8:18am

Request Review

The audit observability module hasn't landed on preprod yet, so the
audit() call I copied from other procedures in main's version of this
file was unresolved at build time. Drop it for now; can be re-added
once main's observability work merges into preprod.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@QSchlegel QSchlegel merged commit 6fca533 into preprod May 25, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant