aboutsummaryrefslogtreecommitdiffstats
path: root/lib/invoices.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-09-04 20:40:35 -0700
committerAdam Soltys <[email protected]>2024-09-04 20:51:14 -0700
commit33d67e431416ea8b69b424e7d043ef63953c355a (patch)
tree58d8fed75e94d6d6fcb21d83b8b860670659fe5d /lib/invoices.ts
parentdfde1c88ebb52e50f983f5a36e8868dd0938c3fc (diff)
downloadcoinos-server-33d67e431416ea8b69b424e7d043ef63953c355a.tar.gz
coinos-server-33d67e431416ea8b69b424e7d043ef63953c355a.zip
fx endpoint
Diffstat (limited to 'lib/invoices.ts')
-rw-r--r--lib/invoices.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/invoices.ts b/lib/invoices.ts
index 04e1200b..ee0eb73d 100644
--- a/lib/invoices.ts
+++ b/lib/invoices.ts
@@ -1,16 +1,16 @@
-import crypto from "crypto";
-import store from "$lib/store";
-import { l } from "$lib/logging";
import { emit } from "$lib/sockets";
import { db, g, s } from "$lib/db";
import { getUser, bip21, fail, SATS } from "$lib/utils";
import { types } from "$lib/payments";
import { v4 } from "uuid";
-import lq from "$lib/liquid";
-import bc from "$lib/bitcoin";
+import bc_ from "$lib/bitcoin";
+import lq_ from "$lib/liquid";
import ln from "$lib/ln";
+let bc = bc_ as any;
+let lq = lq_ as any;
+
export let generate = async ({ invoice, user, sender = undefined }) => {
let {
bolt11,
@@ -37,7 +37,7 @@ export let generate = async ({ invoice, user, sender = undefined }) => {
else if (sender) user = await getUser(sender.username);
if (!user) fail("user not provided");
- let rates = await g('rates');
+ let rates = await g("rates");
if (!currency) currency = user.currency;
if (!rate) rate = rates[currency];
if (fiat) amount = Math.round((SATS * fiat) / rate);