diff options
| author | Adam Soltys <[email protected]> | 2025-12-04 08:45:52 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-04 08:45:52 -0800 |
| commit | 70e727eca29a7b99d48ea9a2acd3bf39a5352cb7 (patch) | |
| tree | fa926fa6507511f156683f15ddd01d3b2be9eecc | |
| parent | 2dd4f2aa61b0c8ad0bedb43a58d2da3118b0a6fd (diff) | |
| parent | 078e26b451aad1f27aee04fce4054eb0d51a20e2 (diff) | |
| download | coinos-server-70e727eca29a7b99d48ea9a2acd3bf39a5352cb7.tar.gz coinos-server-70e727eca29a7b99d48ea9a2acd3bf39a5352cb7.zip | |
Merge pull request #81 from ericpp/fix-keysend-extratlvs
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({ |
