Skip to content

feat: add transaction preview before signing - #32

Merged
Drincann merged 1 commit into
mainfrom
feat/tx-sign-preview
Jun 10, 2026
Merged

feat: add transaction preview before signing#32
Drincann merged 1 commit into
mainfrom
feat/tx-sign-preview

Conversation

@Drincann

@Drincann Drincann commented Jun 10, 2026

Copy link
Copy Markdown
Owner

PR Type

Enhancement, Tests


Description

  • Add transaction preview before signing

  • Require confirmation unless --yes provided

  • Show network, change, and UTXOs

  • Update E2E signing expectations


Diagram Walkthrough

flowchart LR
  A["tx sign command"] 
  B["Resolve sender and receiver"]
  C["Display transaction preview"]
  D["Prompt for confirmation"]
  E["Create and sign transaction"]
  F["Print signed transaction"]

  A -- "inputs" --> B
  B -- "details" --> C
  C -- "unless --yes" --> D
  D -- "confirmed" --> E
  C -- "--yes" --> E
  E -- "hex output" --> F
Loading

File Walkthrough

Relevant files
Enhancement
sign.mts
Preview and confirm transactions before signing                   

src/cli/commands/tx/sign.mts

  • Adds --yes to skip preview confirmation.
  • Displays a transaction preview with network, sender path, recipient,
    amounts, change, and UTXOs.
  • Prompts users to confirm signing via prompts.
  • Tracks resolved sender metadata separately from BtcAddress.
+68/-7   
Tests
wallet-lifecycle.test.ts
Cover transaction preview in signing tests                             

tests/e2e/wallet-lifecycle.test.ts

  • Passes --yes in signing E2E flows.
  • Verifies transaction preview output appears.
  • Checks expected change output for regtest signing.
+7/-2     

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@Drincann
Drincann merged commit 9f45771 into main Jun 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant