From 1d5053feb4a5f9b2ea477676f437aef5c7fb7c5d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 19 Oct 2024 08:09:59 -0700 Subject: subscriptions --- lib/utils.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/utils.ts') diff --git a/lib/utils.ts b/lib/utils.ts index b7f55ff1..fa10fb81 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -5,6 +5,8 @@ import { g, s } from "$lib/db"; import config from "$config"; import { getPublicKey } from "nostr"; + let { URL } = process.env; + export let fail = (msg) => { throw new Error(msg); }; @@ -180,3 +182,9 @@ export let time = (() => { console.timeLog("", ++count, s); }; })(); + +export let fmt = (sats) => + "⚡️" + + new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format(sats); + +export let link = (id) => `${URL}/payment/${id}`; -- cgit v1.2.3