aboutsummaryrefslogtreecommitdiffstats
path: root/lib/lightning.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-02-26 11:59:58 -0800
committerAdam Soltys <[email protected]>2025-02-26 11:59:58 -0800
commit1d541fd97210389f006e65d46ab783afbe82cea8 (patch)
tree66781ea2992fa99198ed1e450cdb9b68acfbc4d9 /lib/lightning.ts
parenta14b987a392bc700975b048f37838da08e4ed255 (diff)
downloadcoinos-server-1d541fd97210389f006e65d46ab783afbe82cea8.tar.gz
coinos-server-1d541fd97210389f006e65d46ab783afbe82cea8.zip
payment types
Diffstat (limited to 'lib/lightning.ts')
-rw-r--r--lib/lightning.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/lightning.ts b/lib/lightning.ts
index f63b57be..4d41d9eb 100644
--- a/lib/lightning.ts
+++ b/lib/lightning.ts
@@ -2,8 +2,9 @@ import { db, g, s } from "$lib/db";
import ln from "$lib/ln";
import { err, warn } from "$lib/logging";
import { handleZap } from "$lib/nostr";
-import { credit, types } from "$lib/payments";
+import { credit } from "$lib/payments";
import { getPayment, getUser } from "$lib/utils";
+import { PaymentType } from "$lib/types";
export async function listenForLightning() {
const inv = await ln.waitanyinvoice((await g("pay_index")) || 0);
@@ -49,7 +50,7 @@ export async function listenForLightning() {
amount: received,
memo: invoice.memo,
ref: preimage,
- type: bolt12 ? types.bolt12 : types.lightning,
+ type: bolt12 ? PaymentType.bolt12 : PaymentType.lightning,
});
} catch (e) {
console.log(e);
@@ -97,7 +98,7 @@ export async function replay(index) {
amount: received,
memo: invoice.memo,
ref: preimage,
- type: bolt12 ? types.bolt12 : types.lightning,
+ type: bolt12 ? PaymentType.bolt12 : PaymentType.lightning,
});
} catch (e) {
console.log(e);