aboutsummaryrefslogtreecommitdiffstats
path: root/routes/invoices.ts
Commit message (Collapse)AuthorAgeFilesLines
* invoices: don't let a supplied id overwrite another user's invoiceAdam Soltys2026-09-291-0/+10
| | | | | | | | | | | | generate() writes invoice:<id> wholesale with the caller's uid, and the old bolt11 pointer keeps resolving to that id, so passing someone else's invoice id re-pointed their invoice at the caller's account. Invoice ids aren't secret (LUD-21 verify URLs, invoice pages, receipts), so refuse an existing id that belongs to a different user, both in generate() and in POST /invoice for anonymous pay-page callers. Both fail with "invoice not found" so ids can't be probed for existence. Co-Authored-By: Claude Fable 5.1 <[email protected]>
* security: drop the admin endpoint surface and land pending hardeningAdam Soltys2026-09-131-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the admin-gated endpoints and the account flags they set, plus a batch of hardening that had accumulated uncommitted in the tree. These were deployed and verified together, so they land as one change. admin surface: - drop POST /hidepay, POST /unlimit and GET /users, their handlers, and the now-unused admin preValidation export - `unlimited` was only ever written, never read; `hidepay` only appeared in output projections. Both flags go, along with their whitelist, public-fields and type entries. request log: - redactBody now recurses. It only masked top-level keys, so a body that nests credentials one level down wrote them to the log in plaintext, and pin fields were not on the list at all. payments: - sendOnchain/build gate `aid` through requireAccount, so a caller can only spend from an account it owns - sendOnchain signs only a tx we composed, matched against a short-lived per-account build receipt - raise xpay retry_for to 60s; route-finding preferred a drained zero-fee hop and burned the whole budget on it. check()'s reversal window keeps its 2x margin. ecash / invoices / webhooks: - resolve a token's mint through the IP-pinning fetcher instead of plain fetch, closing an unauthenticated SSRF path into the internal network - reject non-positive amounts before the balance write - /sign requires the caller to own the address, rather than signing under any address the hot wallet controls - webhook delivery no longer disables TLS verification; the body carries the merchant's shared secret registration: - refuse a username the v3 registrar holds unless the caller's own nostr key is the holder (lib/names.ts) liquid: - honour the deposit kill switch at invoice generation and at credit elements image: - pin 23.3.4 and verify the release tarball checksum Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0112TGi9GGNWqji1XQ5jZRzc
* payments: use the debited tip when crediting internal transfersAdam Soltys2026-07-101-3/+14
| | | | | | | | | | | | | | | | credit() now credits the tip the sender was actually debited (passed in by the internal-transfer callers) instead of independently re-reading the invoice. This closes a time-of-check/time-of-use gap where an invoice's tip could be changed between the sender debit and the receiver credit, letting a payer be credited a tip they were never charged. External receipts (lightning/ecash) keep reading the invoice tip, since there is no paired coinos debit to diverge from. Also harden POST /invoice/:id: validate the tip is a sane non-negative integer and reject tip changes on an already-settled invoice. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
* adjust ln minfeeregtest-dataAdam Soltys2026-03-151-6/+0
|
* consult archive for older paymentsAdam Soltys2026-01-301-2/+2
|
* don't return empty invoicesAdam Soltys2025-11-061-1/+3
|
* fix invoice userAdam Soltys2025-09-201-2/+2
|
* fail if unauthorizedAdam Soltys2025-09-181-5/+8
|
* allow invoice owners to modify the webhookAdam Soltys2025-09-181-5/+10
|
* Add support for updating the webhook of an existing invoiceStas2025-09-181-0/+2
| | | This feature allows updating the webhook for an already created invoice. It will be especially useful for our ongoing integration of your wallet into our system.
* handle 0 tipAdam Soltys2025-08-261-1/+1
|
* fix invoice updateAdam Soltys2025-08-211-2/+3
|
* add tip to amountAdam Soltys2025-08-211-0/+1
|
* invoice updateAdam Soltys2025-08-201-1/+17
|
* fail on undefined invoiceAdam Soltys2025-08-061-11/+16
|
* square endpointsAdam Soltys2025-07-171-0/+1
|
* mark self-generated invoicesAdam Soltys2025-06-231-2/+5
|
* use getInvoice helperAdam Soltys2025-03-051-4/+8
|
* nwc refactorAdam Soltys2025-02-121-1/+1
|
* allow mint self-paymentsAdam Soltys2025-01-171-1/+0
|
* default to blech32 for liquidAdam Soltys2025-01-151-9/+2
|
* sign endpointAdam Soltys2025-01-151-5/+12
|
* sign endpointAdam Soltys2025-01-151-0/+10
|
* change profile to pictureAdam Soltys2025-01-021-1/+1
|
* invoices listAdam Soltys2024-12-261-2/+9
|
* biome lintAdam Soltys2024-10-311-1/+1
|
* save ecash idAdam Soltys2024-10-241-3/+3
|
* push to account invoicesAdam Soltys2024-09-251-1/+1
|
* rename account idAdam Soltys2024-09-201-0/+1
|
* nwc make_invoiceAdam Soltys2024-09-191-5/+4
|
* default accountAdam Soltys2024-09-121-2/+1
|
* refactor rpc helper, accounts endpointsAdam Soltys2024-09-081-2/+5
|
* update sample configAdam Soltys2024-09-051-1/+1
|
* fix some ts issuesAdam Soltys2024-08-261-8/+12
|
* typescriptAdam Soltys2024-08-261-0/+38