diff options
| author | Eric P <[email protected]> | 2025-11-09 16:23:42 -0600 |
|---|---|---|
| committer | Eric P <[email protected]> | 2025-11-09 16:28:55 -0600 |
| commit | 078e26b451aad1f27aee04fce4054eb0d51a20e2 (patch) | |
| tree | a9cc3852759dde095239bb20b741d5e8d5cd5248 | |
| parent | 16e031fcf1bc91c8692a6689c8e281efb2d3b381 (diff) | |
| download | coinos-server-078e26b451aad1f27aee04fce4054eb0d51a20e2.tar.gz coinos-server-078e26b451aad1f27aee04fce4054eb0d51a20e2.zip | |
Fix incorrect extratlvs format in pay_keysend
| -rw-r--r-- | lib/nwc.ts | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -249,8 +249,18 @@ const handle = (method, params, ev, app, user) => }, async pay_keysend() { - const { amount: amount_msat, pubkey, tlv_records: extratlvs } = params; + const { amount: amount_msat, pubkey, tlv_records } = params; const amount = Math.round(amount_msat / 1000); + const extratlvs = {}; + + // convert tlv_records to the extratlvs format + // tlv_records: [{ type: 1, value: "asdf" }] + // extratlvs: { "1": "asdf" } + if (tlv_records && tlv_records.length) { + for (const record of tlv_records) { + extratlvs[record.type.toString()] = record.value; + } + } try { const { payment_hash } = await sendKeysend({ |
