diff options
| author | Adam Soltys <[email protected]> | 2024-11-01 20:29:59 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-01 20:29:59 -0700 |
| commit | e3ec831eb9cbedd8e5d08cee4c1d6abc15b8a4d4 (patch) | |
| tree | 60450fde56ea6d9180450eeecf340178a6ac5d61 /lib/nwc.ts | |
| parent | 88b32c9cd70916a742263c36703d8c2b073236c6 (diff) | |
| download | coinos-server-e3ec831eb9cbedd8e5d08cee4c1d6abc15b8a4d4.tar.gz coinos-server-e3ec831eb9cbedd8e5d08cee4c1d6abc15b8a4d4.zip | |
cleanup
Diffstat (limited to 'lib/nwc.ts')
| -rw-r--r-- | lib/nwc.ts | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -22,6 +22,8 @@ const methods = [ "list_transactions", ]; +const week = 7 * 24 * 60 * 60; + export default () => { const r = new Relay("ws://strfry:7777"); @@ -172,6 +174,7 @@ const handle = (method, params, user) => if (invoices.length) { const { amount_received_msat: amount, + description, expires_at, preimage, paid_at: settled_at, @@ -185,7 +188,7 @@ const handle = (method, params, user) => payment_hash, amount, fees_paid: 0, - created_at: expires_at - 7 * 24 * 60 * 60, + created_at: expires_at - week, expires_at, settled_at, }); @@ -217,14 +220,7 @@ const handle = (method, params, user) => }, async list_transactions() { - const { - from, - until, - limit = 10, - offset = 0, - unpaid = false, - type, - } = params; + const { from, until, limit = 10, offset = 0, type } = params; const payments = await db.lRange(`${user.id}:payments`, 0, -1); @@ -253,7 +249,7 @@ const handle = (method, params, user) => amount: Math.abs(p.amount * 1000), fees_paid: p.fee * 1000, created_at, - expires_at: created_at + 7 * 24 * 60 * 60, + expires_at: created_at + week, settled_at: p.amount > 0 ? created_at : undefined, metadata: {}, }); |
