diff options
| author | Adam Soltys <[email protected]> | 2024-09-04 20:40:35 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-09-04 20:51:14 -0700 |
| commit | 33d67e431416ea8b69b424e7d043ef63953c355a (patch) | |
| tree | 58d8fed75e94d6d6fcb21d83b8b860670659fe5d /lib/invoices.ts | |
| parent | dfde1c88ebb52e50f983f5a36e8868dd0938c3fc (diff) | |
| download | coinos-server-33d67e431416ea8b69b424e7d043ef63953c355a.tar.gz coinos-server-33d67e431416ea8b69b424e7d043ef63953c355a.zip | |
fx endpoint
Diffstat (limited to 'lib/invoices.ts')
| -rw-r--r-- | lib/invoices.ts | 12 |
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); |
