diff options
| author | Adam Soltys <[email protected]> | 2026-09-21 19:21:29 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-21 19:21:43 -0700 |
| commit | 671cdb3af944b5e6d39361f4a208547d0e9f7291 (patch) | |
| tree | f79311f96084d6a28708efd1223e85f18ff56926 /src/lib | |
| parent | dcca73434f93e8cf8a912e55a6e098791277a976 (diff) | |
| download | coinos-ui-671cdb3af944b5e6d39361f4a208547d0e9f7291.tar.gz coinos-ui-671cdb3af944b5e6d39361f4a208547d0e9f7291.zip | |
send: quote the lightning routing fee up front and add Max to lightning sends
The lightning send page now asks the server what the payment will cost
before showing the Send button: the exact routing fee from the route
query, the platform fee, and the total. The quoted fee is submitted as
the maxfee, so what the user sees is what gets debited; advanced
settings still let them override it, and if the quote fails the page
falls back to the old 2% reserve.
Max on the amount step asks the server for the largest amount whose
amount + routing fee + platform fee lands exactly on the balance, and
for an offer picks up the invoice fetched for that exact amount.
LNURL-pay gets a Max button too. The invoice only exists once we name an
amount, so the action fetches a probe invoice at the ceiling, lets the
server solve for the amount, then fetches the real invoice for it.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/samples.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/samples.ts b/src/lib/samples.ts index ae7ef6d5..cc6b4039 100644 --- a/src/lib/samples.ts +++ b/src/lib/samples.ts @@ -29,6 +29,20 @@ export default { -d '{ "payreq": "lnbc1pj94d8fsp5n77k340ps4m9jn7kp8he8yynpddvurv6mcsrrqpnq5l2jxdxzlwqpp5m96pqhc5nrlk8cqsu9ufdxxa43sarp8vwf9egvm2pg9nl0zu9r8qdq2vdhkjmn0wvxqztgcqpjrzjqwhmav82kntsppmkp8jp4vg4h9nns78tsy8mg7ve4lq5txrkp0h56zlarvqqdtcqqsqqqqqqqqqqp6cq9q9qyysgqzxlypywzphyujm3ga5j5csfcmqvlnae0fgnvymkaaw94eeg7py5rqzysyjkr3ev2snq63qpsc69vf54adkd0szvmvwt5cuadjnuy95sq4xfa40" }'`, + quote: `curl "${api}/lightning/quote" + -H "content-type: application/json" + -H "Authorization: Bearer $token" + -d '{ + "payreq": "lnbc1pj94d8fsp5n77k340ps4m9jn7kp8he8yynpddvurv6mcsrrqpnq5l2jxdxzlwqpp5m96pqhc5nrlk8cqsu9ufdxxa43sarp8vwf9egvm2pg9nl0zu9r8qdq2vdhkjmn0wvxqztgcqpjrzjqwhmav82kntsppmkp8jp4vg4h9nns78tsy8mg7ve4lq5txrkp0h56zlarvqqdtcqqsqqqqqqqqqqp6cq9q9qyysgqzxlypywzphyujm3ga5j5csfcmqvlnae0fgnvymkaaw94eeg7py5rqzysyjkr3ev2snq63qpsc69vf54adkd0szvmvwt5cuadjnuy95sq4xfa40", + "max": true +}'`, + quoteResponse: `{ + "amount": 99899, + "fee": 1, + "ourfee": 100, + "total": 100000, + "balance": 100000 +}`, bitcoin: `curl "${api}/bitcoin/send" -H "content-type: application/json" -H "Authorization: Bearer $token" |
