From af43511ca3f8654dd578fd3c55240725b0b9fc96 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 25 Sep 2024 03:18:29 +0000 Subject: nwc methods --- lib/nwc.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') 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 }); }, -- cgit v1.2.3