From 6d5f69a23b8e52513825465a06911d67702edec3 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 25 Nov 2026 09:25:18 -0700 Subject: payments: hold Lightning deposits back from on-chain withdrawal While hold:enabled is set, Lightning deposits above a daily free allowance are held: they can still be spent over Lightning or sent internally, but not withdrawn on-chain or over Lightning into our own on-chain liquidity. The check and release run inside the atomic debit script, internal transfers carry the hold to the receiver, and old holds expire via scripts/holds.ts. The listener notes which peer each deposit arrived from for review. sendOnchain now refuses frozen accounts before building the transaction or locking its inputs, so a frozen account retrying withdrawals cannot hold hot-wallet UTXOs and make other sends fail with locked outputs. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VMan6SEnsbshZrUDtTsxAX --- routes/shopify.ts | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 routes/shopify.ts (limited to 'routes') diff --git a/routes/shopify.ts b/routes/shopify.ts deleted file mode 100644 index ff601963..00000000 --- a/routes/shopify.ts +++ /dev/null @@ -1,49 +0,0 @@ -import got from "got"; -import { g } from "$lib/db"; -import { l, err } from "$lib/logging"; -import { getPayment } from "$lib/utils"; - -const query = `mutation orderMarkAsPaid($input: OrderMarkAsPaidInput!) { - orderMarkAsPaid(input: $input) { - order { id } - userErrors { - field - message - } - } -}`; - -export default async (req, res) => { - const { - body: { hash }, - params: { id }, - } = req; - const p = await getPayment(hash); - const user = await g(`user:${p.uid}`); - - l("marking shopify order paid", id, user.username, p.id, user.shopifyStore); - - try { - const r = await got - .post( - `https://${user.shopifyStore}.myshopify.com/admin/api/2023-07/graphql.json`, - { - headers: { - "Content-Type": "application/json", - "X-Shopify-Access-Token": user.shopifyToken, - }, - json: { - query, - variables: { input: { id: `gid://shopify/Order/${id}` } }, - }, - }, - ) - .json(); - - l("shopify success", r); - - res.send(r); - } catch (e) { - err("problem marking shopify order as paid", e.message); - } -}; -- cgit v1.2.3