Skip to content

feat: add get another address button while waiting for an on-chain payment - #2764

Merged
rolznz merged 1 commit into
getAlby:masterfrom
rolandgx:feat/receive-onchain-get-another-address
Dec 2, 2026
Merged

rolznz merged 1 commit into
getAlby:masterfrom
rolandgx:feat/receive-onchain-get-another-address

Conversation

@rolandgx

@rolandgx rolandgx commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2763

Problem

On /wallet/receive?type=onchain, once a payment to the current address is seen in the mempool, the page shows "Waiting for On-chain Confirmation..." with no way to get a new address. Reopening the page does not help: until the wallet syncs (about once a minute), the hub still returns the same paid address, so the waiting screen shows again.

Change

Only frontend/src/components/ReceiveToOnchain.tsx:

  • The waiting screen has a "Get Another Address" button.
  • Payment tracking moved into an inner component keyed by the address, so a new address always starts on the QR screen. The manual state reset in "Receive Another Payment" is removed; it now just requests a new address.

Testing

Reproduced and checked on local regtest (bitcoind + Esplora + hub) with a headless browser script, sending an unconfirmed 100,000 sat payment:

Step Before After
Payment sent Waiting screen, only "View on Mempool" Waiting screen with "Get Another Address"
Page reopened Same, stuck Same, button still there
Button clicked not possible QR screen with a different address

Type check, ESLint and Prettier pass. The "Receive Another Payment" path after a confirmed payment was not tested.

Not included

  • Until the wallet syncs, the hub still hands back the old paid address when the page is opened. Getting another address, leaving, and coming back before the sync shows the waiting screen for the old address again (the button then gives a third address). That needs a backend change.
  • frontend/src/screens/onchain/DepositBitcoin.tsx has the same tracking code and the same stuck state; left out on purpose.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Address-specific deposit details now update when a different receiving address is selected.
    • The “Get Another Address” button reflects when an address is still loading.
    • Deposit screens wait for a receiving address to be available before displaying its details.

…yment

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The on-chain receive view waits for an address before rendering address-specific deposit state. Success and pending actions request another address directly. The pending view shows a loading-aware “Get Another Address” button.

Changes: On-chain receive address flow

Layer / File(s) Summary
Address-specific state and UTXO lookup
frontend/src/components/ReceiveToOnchain.tsx
The parent waits for an address, then renders a child keyed by that address. The child uses the address directly for its UTXO request.
Request another address
frontend/src/components/ReceiveToOnchain.tsx
Success and pending actions call address generation directly. The pending view receives address-loading state and shows a loading-aware button. The previous handler that cleared transaction and amount state and reset the start time is removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature · Severity of issue fixed: Medium

Possibly related PRs

  • getAlby/hub#2712: Changes backend on-chain address selection, which affects the address returned when this view requests another address.

Suggested reviewers: im-adithya

Merge Risk: Minimal · up to 0723c

This adds a "Get Another Address" button to the on-chain waiting screen, so users are no longer blocked while a payment is pending. No concrete defect remains in the change. The one untested path is "Receive Another Payment" after a confirmed payment; a quick manual check of it would be worthwhile.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat: add get another address button while waiting for an on-chain payment" matches the main change. The PR adds a "Get Another Address" button on the on-chain payment waiting screen, which…
Linked Issues check Passed [#2763] Requirement: let the user get a new Bitcoin address immediately while a payment to the current on-chain address is pending at /wallet/receive?type=onchain. The change adds a "Get Another Addre…
Out of Scope Changes check Passed The PR changes only frontend/src/components/ReceiveToOnchain.tsx (+53/-16, per the summary). Every change supports #2763: the new button, the keyed address child that resets payment tracking on addres…
Full details: Title check

Explanation

The title "feat: add get another address button while waiting for an on-chain payment" matches the main change. The PR adds a "Get Another Address" button on the on-chain payment waiting screen, which is the primary change in the changeset and the objective stated in the PR description. The title is specific and concise, and it does not use vague terms.

Full details: Linked Issues check

Explanation

[#2763] Requirement: let the user get a new Bitcoin address immediately while a payment to the current on-chain address is pending at /wallet/receive?type=onchain. The change adds a "Get Another Address" button to the waiting screen (DepositPending in frontend/src/components/ReceiveToOnchain.tsx). The button calls getNewAddress. Payment tracking now sits in a ReceiveToOnchainAddress child keyed by address, so a new address starts on the QR screen. The PR author reports a headless-browser check on regtest: the button stays available after reopening the page, and clicking it shows a QR code for a different address. The PR does not fix the backend returning the old paid address before wallet sync. The PR description lists that as a known limitation, and the issue does not require it. The core requirement is met. No automated test was added. The issue is a UI feature, so the manual check is the available evidence.

Full details: Out of Scope Changes check

Explanation

The PR changes only frontend/src/components/ReceiveToOnchain.tsx (+53/-16, per the summary). Every change supports #2763: the new button, the keyed address child that resets payment tracking on address change, and the removal of the manual reset in "Receive Another Payment", which now only requests a new address. The PR explicitly leaves frontend/src/screens/onchain/DepositBitcoin.tsx unchanged, so no unrelated edits appear in the reviewed scope.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 556b53c3-5d8b-40a0-8df6-59dfd9592756
Commits

Reviewing files that changed from the base of the PR and between 8e3454c and 0723c7c.

Files selected for processing: 1

  • frontend/src/components/ReceiveToOnchain.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@rolznz
rolznz merged commit bf21e7b into getAlby:master Dec 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Get another address" to /wallet/receive?type=onchain

2 participants