feat: add trezor receive - #693
Conversation
60e7c71 to
651c9ec
Compare
Greptile SummaryAdds Trezor receiving to the existing receive sheet, using watcher-provided addresses with an account-scan fallback and optional on-device verification.
Confidence Score: 5/5The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking defects identified. The receive flow preserves explicit hardware-wallet identity from its primary entry point, obtains a next-unused address through watcher or account-scan state, and rejects device verification unless the returned address exactly matches the displayed destination.
|
| Filename | Overview |
|---|---|
| Bitkit/Managers/HwWalletManager.swift | Stores watcher-provided next-unused addresses, adds account-scan fallback, and verifies the displayed derivation directly on the Trezor. |
| Bitkit/Views/Wallets/Receive/ReceiveQr.swift | Adds the Trezor receive tab, hardware BIP21 rendering, address loading, and reconnect/passphrase-aware verification. |
| Bitkit/Views/Wallets/Receive/ReceiveEdit.swift | Adds an on-chain-only editing mode that preserves amount and message state without invoking Lightning or Paykit flows. |
| Bitkit/Views/Wallets/Receive/ReceiveSheet.swift | Carries hardware-wallet identity through receive navigation and presents pairing requests during reconnect. |
| Bitkit/Components/TabBar/TabBar.swift | Opens the receive sheet on the Trezor tab when invoked from a hardware-wallet route. |
| Bitkit.xcodeproj/project.xcodeproj | Updates Bitkit Core to the version providing the watcher receive-address payload. |
Sequence Diagram
sequenceDiagram
participant User
participant Receive as Receive Sheet
participant Manager as Hardware Wallet Manager
participant Watcher as Watch-only Watcher
participant Electrum
participant Trezor
User->>Receive: Open Trezor receive tab
Receive->>Manager: Request receive address
Manager->>Watcher: Read cached next-unused address
alt Watcher address available
Watcher-->>Manager: Address and derivation path
else Watcher address unavailable
Manager->>Electrum: Scan account addresses
Electrum-->>Manager: First unused external address
end
Manager-->>Receive: Address and derivation path
Receive-->>User: Display QR and details
opt Verify on device
User->>Receive: Verify address
Receive->>Manager: Verify displayed address
Manager->>Trezor: Derive and display exact path
Trezor-->>Manager: Device-derived address
Manager-->>Receive: Accept only exact match
end
Reviews (1): Last reviewed commit: "feat: add trezor receive" | Re-trigger Greptile
2c2869a to
28be38a
Compare
960c297 to
3231855
Compare
ovitrif
left a comment
There was a problem hiding this comment.
Receive still uses getReceiveAddress when the watcher has not reported an address, but no test calls that method. testWatcherEventProvidesReceiveAddress only asserts cached watcher state, so a broken unused.first selection or a dropped empty-unused error would stay green.
Summary
Stack
Validation