Skip to content

feat(payments): add optional allowSelfPayment to send [AMB-3241] - #56

Merged
wthrajat merged 3 commits into
mainfrom
feat/AMB-3241-allow-self-payment
Sep 24, 2026
Merged

wthrajat merged 3 commits into
mainfrom
feat/AMB-3241-allow-self-payment

Conversation

@bufo24

@bufo24 bufo24 commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Problem

A team could not pay an invoice that one of its own wallets issued, for example a USDT invoice paid from the team's BTC wallet. The SDK had no way to allow this payment.

Change

  • New optional SendParams.allowSelfPayment, off by default. When not set, the payment request is unchanged.
  • When true, send() allows paying an invoice the team issued itself.
  • retryPayment(id, { allowSelfPayment }) accepts the same flag, so a failed self-payment can be retried (new exported RetryPaymentOptions).
  • README, docs/INTEGRATION.md, and AGENTS.md document the flag.

Test plan

  • Tests for the default and the flag, on both send() and retryPayment()
  • pnpm typecheck, pnpm build, pnpm test (76 passed), pnpm format:check
  • Merge after AmbossTech/amboss-rails-api#613 is deployed

🤖 Generated with Claude Code

bufo24 and others added 3 commits September 24, 2026 15:07
LND rejects a payment to its own node unless allow_self_payment is set, so
a team could not pay its own invoice from another wallet on the same node.
The flag is off by default and forwarded to both the LND and litd bodies.

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 marked this pull request as ready for review September 24, 2026 13:07
@bufo24
bufo24 force-pushed the feat/AMB-3241-allow-self-payment branch from c781079 to 2e0dced Compare September 24, 2026 13:07
@wthrajat
wthrajat merged commit 93614bc into main Sep 24, 2026
2 checks passed
@apotdevin apotdevin mentioned this pull request Sep 24, 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