Skip to content

Add Trusted Node feature - #195

Merged
kcw-grunt merged 5 commits into
mainfrom
feat/add-trusted-node-feat
Sep 28, 2026
Merged

kcw-grunt merged 5 commits into
mainfrom
feat/add-trusted-node-feat

Conversation

@grunt-claude-bot

Copy link
Copy Markdown
Collaborator

Summary

  • Adds the Trusted Node feature: Settings toggle/IP modal to sync against a user-specified Litecoin node instead of the mainnet peer pool, gated behind an in-app purchase
  • Wires the saved preference into BRPeerManager.connect() so it pins/clears the fixed peer accordingly, and reconnects immediately when the toggle changes
  • Shows a peer sync mode icon (mainnet vs. trusted) in the sync status bento
  • Restores the blockchain sync confirmation alert and fixes the wipe-wallet flow to clear Trusted Node/environment Keychains

Test plan

  • xcodebuild build for brainwallet scheme succeeds
  • Manually verify toggling Trusted Node on/off in Settings reconnects to the expected peer
  • Manually verify wipe wallet clears the Trusted Node Keychain entries

🤖 Generated with Claude Code

kcw-grunt and others added 5 commits September 13, 2026 18:42
Layout:
- Refactor SettingsView's expanding rows (Blockchain, Currency, Security,
  Theme/Lock actions) to a consistent structure and normalize row heights
  via shared closedRowHeight/expandArrowSize/leadRowPad/trailRowPad
  constants in SettingsHelpers.
- Rebuild SettingsLitecoinDetailView's peer-sync, blockchain-sync, and
  network-fee sections with clearer grouping, spacing, and typography
  (BWIPSSemiBold/BWIPSRegular, BrainwalletColor.content), and scaffold the
  trusted-node toggle and "Set IP Address" action.
- Size the network-fee wheel picker to 40% of the row width via
  GeometryReader, top-align it with its "Choose preferred fee" label, and
  always show the blockchain detail ScrollView's scroll indicators.

Network fees:
- Add NewMainViewModel.currentFees, fetched via
  BWAPIClient.feePerKb(_:) (GET v1/fee-per-kb), and thread it through
  SettingsExpandingBlockchainView into SettingsLitecoinDetailView so the
  fee picker shows real economy/regular/luxury tiers instead of
  placeholder values.
- Compute the fiat cost of the selected fee tier by converting litoshis to
  LTC and multiplying by the current exchange rate, and persist the
  user's choice via UserDefaults.userSetPreferredNetworkFee.
- Extract the tier math (litoshis-per-tier, nearest-tier lookup for a
  restored preference, litoshi-to-fiat formatting) into a standalone
  NetworkFeeTier enum in FeeManager.swift so it's unit-testable without
  instantiating SwiftUI view state, and add NetworkFeeTierTests covering
  it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FUKEfvG7cDWbPc1nBhwNgU
Co-Authored-By: kcw-grunt <mrkerrywashington@icloud.com>
Co-Authored-By: kcw-grunt <mrkerrywashington@icloud.com>
Co-Authored-By: kcw-grunt <mrkerrywashington@icloud.com>
Co-Authored-By: kcw-grunt <mrkerrywashington@icloud.com>
@kcw-grunt kcw-grunt added the enhancement New feature or request label Sep 28, 2026
@kcw-grunt
kcw-grunt merged commit 2435ff5 into main Sep 28, 2026
1 of 3 checks passed
@grunt-claude-bot grunt-claude-bot mentioned this pull request Sep 28, 2026
1 of 3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants