-
Notifications
You must be signed in to change notification settings - Fork 3
feat(trezor): add hidden-wallet passphrase selection and on-chain watcher #574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
46bb276
feat(trezor): add hidden-wallet passphrase selection and on-chain wat…
coreyphillips 5953f53
fix(trezor): make event watcher usable without a connected device
coreyphillips 9283ad9
Merge branch 'master' into feat/trezor-hidden-wallet-and-watcher
ovitrif d44202a
fix(trezor): align watcher follow-up behavior
ovitrif 6772be8
chore: add trezor changelog fragment
ovitrif 00da2de
refactor(trezor): reuse shared UI components in dev screens
coreyphillips ba10de0
fix(trezor): stop watchers on dashboard dismiss and key tx rows by txid
coreyphillips 34ac7a4
Merge branch 'master' into feat/trezor-hidden-wallet-and-watcher
coreyphillips 9505677
fix(trezor): reset watcher input on dismiss and restart watcher on ac…
coreyphillips ac289c6
fix(trezor): treat watcher stop during native startup as cancellatio…
coreyphillips 04b2305
fix(trezor): keep watcher alive across connect/disconnect and quarant…
coreyphillips 9880030
Merge branch 'master' into feat/trezor-hidden-wallet-and-watcher
ovitrif 95512e3
Merge branch 'master' into feat/trezor-hidden-wallet-and-watcher
ovitrif 71d1a11
Merge branch 'master' into feat/trezor-hidden-wallet-and-watcher
ovitrif 0177a8b
fix(trezor): clear stale wallet state on disconnect failures
ovitrif b7ac927
Merge branch 'master' into feat/trezor-hidden-wallet-and-watcher
ovitrif e1a50ba
Merge branch 'master' into feat/trezor-hidden-wallet-and-watcher
ovitrif File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Bitkit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import SwiftUI | ||
|
|
||
| struct TrezorAccountTypeSelector: View { | ||
| @Binding var selection: TrezorAccountTypeSelection | ||
| var title: String = "Account Type" | ||
|
|
||
| var body: some View { | ||
|
jvsena42 marked this conversation as resolved.
|
||
| VStack(alignment: .leading, spacing: 8) { | ||
| CaptionMText(title) | ||
|
|
||
| SegmentedControl(selectedTab: $selection, tabs: TrezorAccountTypeSelection.allCases) | ||
|
|
||
| FootnoteText(selection.subtitle) | ||
| } | ||
| .frame(maxWidth: .infinity, alignment: .leading) | ||
| .accessibilityIdentifier("TrezorAccountTypeSelector") | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import BitkitCore | ||
| import Foundation | ||
|
|
||
| /// Bridges bitkit-core's `EventListener` callback (invoked on a background thread by the | ||
| /// Rust watcher loop) onto the main actor so the ViewModel can update `@Observable` state. | ||
| /// | ||
| /// Mirrors bitkit-android's `eventBridge` in `TrezorRepo`. | ||
| final class TrezorEventListener: EventListener, @unchecked Sendable { | ||
| /// Forwards `(watcherId, event)` to a consumer on the main actor. | ||
| private let onEventHandler: @MainActor (String, WatcherEvent) -> Void | ||
|
|
||
| init(onEvent: @escaping @MainActor (String, WatcherEvent) -> Void) { | ||
| onEventHandler = onEvent | ||
| } | ||
|
|
||
| func onEvent(watcherId: String, event: WatcherEvent) { | ||
| let handler = onEventHandler | ||
| Task { @MainActor in | ||
| TrezorDebugLog.shared.log("[WATCHER] [\(watcherId)] \(event.logLabel)") | ||
| handler(watcherId, event) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| extension WatcherEvent { | ||
| /// Short label for the debug log. | ||
| var logLabel: String { | ||
| switch self { | ||
| case .transactionsChanged: | ||
| return "transactionsChanged" | ||
| case let .error(message): | ||
| return "error: \(message)" | ||
| case let .disconnected(message): | ||
| return "disconnected: \(message)" | ||
| case .reconnected: | ||
| return "reconnected" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.