aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-11-25 09:25:18 -0700
committerAdam Soltys <[email protected]>2026-11-25 09:25:18 -0700
commit6d5f69a23b8e52513825465a06911d67702edec3 (patch)
treeeab409c6d3394c37f9b8b790e7f3e7f8b9ac4301 /routes
parent00799bb5ed16d3f2514ba68938e479110a1412a9 (diff)
downloadcoinos-server-6d5f69a23b8e52513825465a06911d67702edec3.tar.gz
coinos-server-6d5f69a23b8e52513825465a06911d67702edec3.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SEnsbshZrUDtTsxAX
Diffstat (limited to 'routes')
-rw-r--r--routes/shopify.ts49
1 files changed, 0 insertions, 49 deletions
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);
- }
-};