Skip to content

feat(payments): send amountSats to create_send for zero-amount BOLT11 invoices [AMB-3258] - #54

Merged
wthrajat merged 8 commits into
mainfrom
feat/AMB-3258-amountless-bolt11
Sep 25, 2026
Merged

wthrajat merged 8 commits into
mainfrom
feat/AMB-3258-amountless-bolt11

Conversation

@bufo24

@bufo24 bufo24 commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Problem

transactions.send accepts amountSats on a bolt11 destination but never sends it to create_send, so the API rejects zero-amount invoices. Taproot Asset wallets never receive the amount, and retryPayment sends the amount even for invoices that already encode one, which the wallet rejects.

Change

  • buildCreateSendInput sends destination.amountSats as request.amount for BOLT11 destinations.
  • New isAmountlessBolt11 decodes the invoice with light-bolt11-decoder (new dependency, MIT, the same decoder the dashboard uses). The amount goes to the wallet only for a zero-amount invoice, for BTC and Taproot Asset wallets, in send() and retryPayment().
  • Fixes the retry of a fixed-amount invoice from a BTC wallet (separate commit).
  • SendByRequest.amount is hand-added to packages/core/schema/rails.graphql; refresh the schema after AmbossTech/amboss-rails-api#612 deploys.
  • README, INTEGRATION guide and SendDestination doc: amountSats is in sats for every wallet; a Taproot Asset wallet pays it in the asset at the current exchange rate.

Depends on AmbossTech/amboss-rails-api#612. Docs: AmbossTech/amboss-documentation#88. Dashboard: AmbossTech/amboss-rails#461.

Test plan

  • Unit tests: create_send carries request.amount; the amount reaches the wallet only for a zero-amount invoice (send and retry, BTC and Taproot Asset); isAmountlessBolt11 cases
  • pnpm build, pnpm typecheck, pnpm format:check, pnpm test (68 + 11 pass)
  • Test environment: a Taproot Asset wallet paid a zero-amount invoice with the SDK request shape; it was rejected without the amount, and rejected with an amount on a fixed-amount invoice
  • After #612 deploys: pnpm --filter @ambosstech/core run refresh-schema shows no diff for SendByRequest

🤖 Generated with Claude Code

@bufo24
bufo24 marked this pull request as ready for review September 24, 2026 14:23
@bufo24
bufo24 force-pushed the feat/AMB-3258-amountless-bolt11 branch from 6687571 to 2d097c6 Compare September 24, 2026 14:27
bufo24 and others added 8 commits September 24, 2026 16:38
… invoices

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
tapd forwards payment_request.amt to LND, which accepts it only for an
invoice without an amount, so the invoice decides whether to send it.
This covers send() and retryPayment().

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
retryPayment passed the persisted amount_sats as amt for every BTC
retry, and LND rejects amt for an invoice that encodes an amount.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@bufo24
bufo24 force-pushed the feat/AMB-3258-amountless-bolt11 branch from 2d097c6 to c15d929 Compare September 24, 2026 14:38
@wthrajat
wthrajat merged commit 0e51c39 into main Sep 25, 2026
2 checks passed
@apotdevin apotdevin mentioned this pull request Sep 25, 2026
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.

2 participants