import { getAuthToken } from "bitcoin-auth"; const wif = process.env.SIGMA_MEMBER_WIF; if (!wif) { console.error("SIGMA_MEMBER_WIF not set"); process.exit(1); } const text = process.argv[2]; if (!text) { console.error("Usage: bun run scripts/wake.ts "); process.exit(1); } const url = "https://clark.clawbook.network/api/hooks/wake"; const body = JSON.stringify({ text }); const token = getAuthToken({ privateKeyWif: wif, requestPath: "/api/hooks/wake", body, }); console.log("Sending wake to", url); console.log("Message:", text.slice(0, 120)); const res = await fetch(url, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}`, }, body, }); const result = await res.json(); console.log("Status:", res.status); console.log("Response:", JSON.stringify(result, null, 2));