diff options
| author | Adam Soltys <[email protected]> | 2023-09-03 20:48:31 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-09-03 20:48:35 -0700 |
| commit | 3aa200db295438827bfff48f80e3f4b25f44e8ea (patch) | |
| tree | a5520366ec430ed0b2cdf86f971bb006ffd5b0da /lib/invoices.js | |
| parent | 0d7574597d33bad78f4ebad3c38b956debb0e699 (diff) | |
| download | coinos-server-3aa200db295438827bfff48f80e3f4b25f44e8ea.tar.gz coinos-server-3aa200db295438827bfff48f80e3f4b25f44e8ea.zip | |
use bolt11 for invoice hash
Diffstat (limited to 'lib/invoices.js')
| -rw-r--r-- | lib/invoices.js | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/invoices.js b/lib/invoices.js index b4583ea1..2e5a8e64 100644 --- a/lib/invoices.js +++ b/lib/invoices.js @@ -38,19 +38,15 @@ export let generate = async ({ invoice, user, sender, memo }) => { let hash, text; if (type === types.lightning) { - let r = await ln.invoice( - amount ? `${amount + tip}sat` : "any", - new Date(), - memo || "", - expiry || 3600, - undefined, - undefined, - undefined, - undefined, - true - ); + let r = await ln.invoice({ + amount_msat: amount ? `${amount + tip}sat` : "any", + label: new Date(), + description: memo || "", + expiry: expiry || 3600, + deschashonly: true + }); - hash = r.payment_hash; + hash = r.bolt11; text = r.bolt11; } else if (type === types.bitcoin) { hash = await bc.getNewAddress(); |
