Skip to content

fix: bip21 lightning param parsing without address#438

Merged
im-adithya merged 1 commit into
masterfrom
fix/bip21-lightning-parsing
Jun 17, 2026
Merged

fix: bip21 lightning param parsing without address#438
im-adithya merged 1 commit into
masterfrom
fix/bip21-lightning-parsing

Conversation

@im-adithya

@im-adithya im-adithya commented Jun 17, 2026

Copy link
Copy Markdown
Member

Fixes #437

Signet invoices actually work fine, the problem was with scanning a bip21 link without an address/host

Summary by CodeRabbit

  • Bug Fixes
    • Improved parsing of Bitcoin payment links to correctly extract Lightning payment parameters.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ccec9c16-f571-4f8e-a55c-53d68d239e98

📥 Commits

Reviewing files that changed from the base of the PR and between 1ce5cd6 and 2b8258f.

📒 Files selected for processing (1)
  • lib/initiatePaymentFlow.ts

📝 Walkthrough

Walkthrough

In lib/initiatePaymentFlow.ts, the BIP21 bitcoin: URI parsing is updated to extract the query string directly from the input and read the lightning parameter using URLSearchParams, replacing the previous workaround that constructed a fake http:// URL to leverage URL.searchParams.

Changes

BIP21 Lightning Parameter Parsing

Layer / File(s) Summary
BIP21 query string parsing via URLSearchParams
lib/initiatePaymentFlow.ts
The lightning parameter is now read by slicing the query portion from the raw bitcoin: string and passing it to URLSearchParams, removing the http:// placeholder URL construction.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A bunny once hopped through a BIP21 lane,
Where http:// tricks caused signet much pain.
🐇 "Just slice off the query," the rabbit declared,
URLSearchParams leapt in, and the invoice was snared!
No more fake URLs — the lightning was there! ⚡

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: bip21 lightning param parsing without address' accurately summarizes the main change: fixing BIP21 lightning parameter parsing when no address/host is present.
Linked Issues check ✅ Passed The code change directly addresses issue #437 by fixing BIP21 lightning parameter parsing logic, which resolves the failure when scanning signet invoice QR codes.
Out of Scope Changes check ✅ Passed All changes in initiatePaymentFlow.ts are focused on fixing the BIP21 lightning parameter parsing issue without introducing unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bip21-lightning-parsing

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@im-adithya im-adithya merged commit ad980aa into master Jun 17, 2026
3 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.

Bug: fails to scan signet invoice QRs

1 participant