Commit edcc1a6
committed
Unify payment methods into single pay() function
Replace payLnurl(), payBolt11(), and payBolt12Offer() with a single pay()
method that auto-detects the destination type using bitcoin_payment_instructions.
Supported destinations:
- BOLT12 offers (lno...)
- LNURL (lnurl...)
- Lightning addresses (user@domain)
- Zero-amount BOLT11 invoices
This is a breaking change: BOLT11 invoices with pre-set amounts are no longer
supported through this API. The design enforces that the caller always
specifies the amount, which:
- Simplifies the API surface (one method instead of three)
- Ensures consistent amount handling across all payment types
- Protects against malicious LNURL services returning wrong amounts
The amount_msat parameter is now always required.1 parent 7811573 commit edcc1a6
2 files changed
Lines changed: 190 additions & 459 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
73 | 83 | | |
0 commit comments