diff options
| author | Adam Soltys <[email protected]> | 2024-09-25 03:18:29 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-09-25 03:18:31 +0000 |
| commit | af43511ca3f8654dd578fd3c55240725b0b9fc96 (patch) | |
| tree | e403100bcd0f5c635773d50adb68286651007f2a /lib | |
| parent | 3ac47dfbda99f192201af63357e51efc01dde612 (diff) | |
| download | coinos-server-af43511ca3f8654dd578fd3c55240725b0b9fc96.tar.gz coinos-server-af43511ca3f8654dd578fd3c55240725b0b9fc96.zip | |
nwc methods
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/nwc.ts | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 }); }, |
