Follow-up to the v0.1.5 account client that makes ClinkWallet pay and track
reliably in both directions:
- Paying out fixed.
PayInvoicenow sends the node-requiredamountfield:
0for a fixed-amount invoice (the invoice amount is used) or the sats to pay
for an amountless invoice. Previously sending the raw amount was rejected with
"invoice has value, do not provide amount the the request" and omitting it
failed with "invalid request body" — both surfaced as an HTTP 520. - Incoming status fixed. Invoice status now polls the node's
GetUserOperationsAPI (latestIncomingInvoiceOperations, matched by BOLT11
and apaidAtUnixtimestamp) instead ofGetPaymentState, which only tracks
outgoing payments. Paid invoices now report success instead of hanging
pending. - Stale-response guard. Responses are matched by decrypting the event and
checking itsrequestId(plus the node pubkey), so a busy node can't satisfy
a request with a reply meant for another in-flight call. - Account-first invoice creation.
create_invoiceprefers the account path
(mint viaNewInvoice) over the noffer offer path when an account is
configured, so new invoices credit the node balance and are trackable. - Empty preimages accepted. The node returns an empty
preimagefor
internal (same-node) payments; a settled response is now treated as a success
regardless. config.jsonrenamed to CLINK — Recurring Payments (matches the live
deployment);tests/test_config.pyupdated to match.
Verified end-to-end on the live instance: paid incoming checkout invoices
report success, and outgoing payments to external wallets settle (service fee
10 sats floor, network fee 0). Full suite: 112 passed.
Full Changelog: v0.1.5...v0.1.6