Add wallet overwrite warning before QR code generation

Open
#9 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp, javascript
Domain
backend, frontend

Research direction

Start in Controllers/SetupController.cs at the ImportWallets GET handler and follow the existing wallet status access through ExplorerClientProvider and StoreRepository. Add the flags in Models/ImportViewModels.cs and update Views/Setup/ImportWallets.cshtml so Generate QR Code warns only for selected wallet types with active configurations. Done means the warning lists each wallet type that will be overwritten and requires confirmation before generation.

Written by the indexing model from the issue text.

Description

Problem

The ImportWallets setup form lets users select wallet types (Bitcoin, Lightning, Liquid) and click "Generate QR Code" without any warning that existing wallet configurations will be replaced. If a user has an on-chain hot wallet with a balance in BTCPay, scanning the resulting QR code from their mobile wallet will overwrite that configuration and the funds become inaccessible.

Current UI

The setup form shows toggles for Bitcoin, Lightning, and Liquid Bitcoin with a "Generate QR Code" button, but no indication that existing wallets will be replaced.

SamRock Protocol setup form

Suggested Fix

  1. Backend (Controllers/SetupController.cs): In the ImportWallets GET handler, query the store's existing wallet status for each type (BTC, BTC-LN, LBTC) via ExplorerClientProvider / StoreRepository. Pass flags like HasExistingBtcWallet, HasExistingLnWallet, HasExistingLbtcWallet to the view model.

  2. View Model (Models/ImportViewModels.cs): Add HasExisting* boolean properties to ImportWalletsViewModel.

  3. Frontend (Views/Setup/ImportWallets.cshtml): When the user clicks "Generate QR Code", intercept with a JavaScript confirmation modal if any selected wallet type already has an active configuration. Example message:

    WARNING: Your store already has a [Bitcoin/Lightning/Liquid] wallet configured. Generating this QR code and scanning it will REPLACE your current wallet. If you have funds in your existing wallet, transfer them out first. Continue?

  4. The modal should list specifically which wallet types will be overwritten based on the checkboxes selected and existing configs.

Dominant language
C#
Stars
13
Forks
6
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.