aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-09-25 03:18:29 +0000
committerAdam Soltys <[email protected]>2024-09-25 03:18:31 +0000
commitaf43511ca3f8654dd578fd3c55240725b0b9fc96 (patch)
treee403100bcd0f5c635773d50adb68286651007f2a /lib
parent3ac47dfbda99f192201af63357e51efc01dde612 (diff)
downloadcoinos-server-af43511ca3f8654dd578fd3c55240725b0b9fc96.tar.gz
coinos-server-af43511ca3f8654dd578fd3c55240725b0b9fc96.zip
nwc methods
Diffstat (limited to 'lib')
-rw-r--r--lib/nwc.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/nwc.ts b/lib/nwc.ts
index ad74c680..5cb5dcf2 100644
--- a/lib/nwc.ts
+++ b/lib/nwc.ts
@@ -13,6 +13,8 @@ import ln from "$lib/ln";
let result = (result) => ({ result });
let error = (error) => ({ error });
+let methods= ["pay_invoice", "get_balance", "get_info", "make_invoice"];
+
export default () => {
let r = new Relay("ws://strfry:7777");
@@ -29,6 +31,8 @@ export default () => {
await nip04.decrypt(sk, pubkey, content),
);
+ if (!methods.includes(method)) return;
+
let uid = await g(pubkey);
let user = await g(`user:${uid}`);
@@ -105,7 +109,7 @@ let handle = (method, params, user) =>
pubkey: serverPubkey,
network: "mainnet",
block_height: blockheight,
- methods: ["pay_invoice", "get_balance", "get_info"],
+ methods
});
},