Hex encoding

This commit is contained in:
austinkelsay 2024-11-06 17:17:25 -06:00
parent 7d1ed230ac
commit 95b7b2cae2
No known key found for this signature in database
GPG Key ID: 44CB4EC6D9F2FA02

View File

@ -59,6 +59,7 @@ export default async function handler(req, res) {
const invoice = response.data.payment_request; const invoice = response.data.payment_request;
const paymentHash = response.data.r_hash; const paymentHash = response.data.r_hash;
const paymentHashHex = paymentHash.toString('hex');
// If this is a zap, publish a zap receipt // If this is a zap, publish a zap receipt
if (zap_request && foundAddress.allowsNostr) { if (zap_request && foundAddress.allowsNostr) {
@ -85,7 +86,7 @@ export default async function handler(req, res) {
console.log("ZAP RECEIPT PUBLISHED", signedZapReceipt); console.log("ZAP RECEIPT PUBLISHED", signedZapReceipt);
} }
res.status(200).json({ invoice, payment_hash: paymentHash }); res.status(200).json({ invoice, payment_hash: paymentHashHex });
} catch (error) { } catch (error) {
console.error('Error (server) fetching data from LND:', error.message); console.error('Error (server) fetching data from LND:', error.message);
res.status(500).json({ message: 'Error fetching data' }); res.status(500).json({ message: 'Error fetching data' });