aboutsummaryrefslogtreecommitdiffstats
path: root/routes
Commit message (Collapse)AuthorAgeFilesLines
* users: add authenticated self-delete endpointAdam Soltys2026-06-171-0/+104
| | | | | | | | | | | | Port of master 2548f757, adapted from Express to this stack's Hono handlers (c.get("user"), c.req.json(), setCookie, bail) and TigerBeetle balances (getBalance/getPending instead of the Redis balance:/pending: keys). POST /delete (auth) wipes every key tied to the calling user: user records, payments/invoices, sub-accounts, NWC apps, nostr follow graph + nip5. Gated by typing the username and refuses while balance+pending > 10k sats so funds can't be destroyed by accident. Co-Authored-By: Claude Opus 4.8 <[email protected]>
* don't remove orphan payment ids from user payment listsAdam Soltys2026-05-171-6/+4
| | | | | | | | | | When the underlying payment record is missing, removing the id from the user's payments list was destructive — a transiently unavailable record (arc fallback miss, database hiccup) would cause us to permanently drop the pointer. Leave the orphan in place so a back-fill from an RDB backup can restore the record under the same id later. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
* fix lnurl description_hash mismatch when sender provides a commentAdam Soltys2026-05-171-2/+6
| | | | | | | | | | | | | | | The bolt11 description_hash is computed from the metadata JSON, which was being constructed with the sender's `comment` substituted into text/plain. Wallets verify description_hash against the metadata they received in the lnurl-pay response, so injecting the comment into the hash made the verification fail — the invoice would settle but description_hash verification would reject it as inconsistent. Keep metadata canonical ("Paying user@host") so the description_hash the wallet receives matches what they verify against. The comment is still preserved as the human-readable memo on the invoice record. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
* verifyRecaptcha: check x-forwarded-host before host headerAdam Soltys2026-05-171-1/+1
| | | | | | | | | Tor users access via .onion through a forwarding layer that puts the real hostname in x-forwarded-host while the literal host header is the internal target. Without checking the forwarded header first, captcha prompted for .onion visitors who should have been exempt. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
* mirror payment records to arc + atomic /confirm lock to prevent double-creditsAdam Soltys2026-05-171-3/+25
| | | | | | | | | | | | | | | | | | | | | Apr 29 double-credit prevention, ported from master 0e368dab and adapted to staging's hono/tigerbeetle structure. Two parallel callers of /confirm (walletnotify, catchUp, bulk sweeps) could each read p.confirmed=false and each run tbConfirm — doubling the pending→balance transfer. tbConfirm itself isn't idempotent on its own, so the race materializes as a real double-credit even with TB. - routes/payments.ts: SET NX EX 60 lock around the confirmation block keyed by `confirmlock:${txid}:${vout}`. Concurrent callers short-circuit cleanly. Released on success and on every early-return. - lib/payments.ts credit() + routes/payments.ts /confirm: mirror payment + invoice records and the `payment:<txid>:<vout>` / `payment:<hash>` pointer keys into arc as soon as they're written. gf() will then find the prior credit via arc fallback even if the main-db copy is wiped by a future data-loss event. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
* remove /gateway endpointAdam Soltys2026-05-171-8/+0
| | | | | | | | | | | Unauthenticated arbitrary db.set abuse vector. Exploited on the master deployment to inflate user balances and override safety controls in real time, leading to a hot-wallet drain. Route and handler both fully removed; if a webhook-by-short-channel-id mapping is ever needed again it must be rebuilt with auth + SCID format validation + webhook URL validation + per-user ownership check. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
* feat: blocked address protection, LNURL proxy, replay timestampsAdam Soltys2026-03-271-0/+12
| | | | | | | | | | - Add lib/changeid.ts for in-process account rekeying - Block sends to addresses in redis blocked_addresses set, auto-rekey on attempt - Add created param to credit() for accurate replay timestamps - Add paid_at to replay() for correct payment dates - Add /lnurl/proxy endpoint for server-side LNURL callback fetching Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* verify ark amountsAdam Soltys2026-03-221-18/+29
|
* stop republishing external events and add NWC rate limitingAdam Soltys2026-03-181-2/+1
| | | | Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* fix: add account ownership checks and harden PIN validationAdam Soltys2026-03-171-2/+6
| | | | | | | | - Validate account ownership (aid) before allowing ark send/sync/vault operations and in debit/sendOnchain as defense-in-depth - Harden PIN check to reject missing/empty pin when user has one set Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* tx recalcAdam Soltys2026-03-111-1/+1
|
* try to cpfp piggyback on in flight withdrawalsAdam Soltys2026-03-111-1/+0
|
* remove bumpestimateAdam Soltys2026-03-111-27/+7
|
* add LNURL-withdraw endpoints for fund-based NFC paymentsAdam Soltys2026-03-081-1/+77
| | | | Co-Authored-By: Claude Opus 4.6 <[email protected]>
* profile searchAdam Soltys2026-03-061-0/+9
|
* drop abstract pool useAdam Soltys2026-03-061-3/+1
|
* check for server generated keyAdam Soltys2026-03-051-3/+4
|
* auth fixAdam Soltys2026-03-051-8/+16
|
* fix pending payment cleanup and login password verificationAdam Soltys2026-03-051-1/+7
| | | | | | | Skip non-lightning entries in pending payments check and handle malformed password hashes gracefully during login. Co-Authored-By: Claude Opus 4.6 <[email protected]>
* fund authorizationsAdam Soltys2026-03-041-6/+53
|
* funds routeAdam Soltys2026-03-042-0/+21
|
* vault wallet fixesAdam Soltys2026-03-032-4/+17
|
* sync vaultAdam Soltys2026-03-032-1/+70
|
* bip353Adam Soltys2026-03-031-0/+7
|
* fix login/reset glitchesAdam Soltys2026-03-031-7/+18
|
* request tuningAdam Soltys2026-03-033-43/+91
|
* fee bumpingAdam Soltys2026-03-021-31/+35
|
* bump nodemonAdam Soltys2026-03-011-0/+1
|
* log ark wallet balanceAdam Soltys2026-03-011-5/+2
|
* delete endpointAdam Soltys2026-03-011-0/+37
|
* disable rate limiting in devAdam Soltys2026-02-281-4/+4
|
* fix hono route orderAdam Soltys2026-02-282-8/+32
|
* hash pinsAdam Soltys2026-02-281-1/+1
|
* fix typescript issuesAdam Soltys2026-02-289-53/+45
|
* migrate to honoAdam Soltys2026-02-2813-733/+681
|
* encrypted keys fieldAdam Soltys2026-02-271-0/+1
|
* map updatesAdam Soltys2026-02-271-1/+37
|
* client-side password authAdam Soltys2026-02-261-3/+65
|
* fix ark vault to custodial sendsAdam Soltys2026-02-261-29/+100
|
* formattingAdam Soltys2026-02-249-204/+81
|
* migrate funds to tbAdam Soltys2026-02-181-8/+8
|
* trigger importAdam Soltys2026-02-161-1/+18
|
* passkey authAdam Soltys2026-02-162-1/+88
|
* Prevent duplicate Ark vault accountsAdam Soltys2026-02-161-16/+15
| | | | Co-Authored-By: Claude Opus 4.6 <[email protected]>
* fix custodial bitcoin sendsAdam Soltys2026-02-151-7/+17
|
* ark refreshAdam Soltys2026-02-151-0/+1
|
* fix custodial sendsAdam Soltys2026-02-151-15/+12
|
* custodial ark sendsAdam Soltys2026-02-142-17/+53
|
* ark payment notificationsAdam Soltys2026-02-132-5/+37
|
* account level currency and autowithdraw settingsAdam Soltys2026-02-131-2/+8
|