diff --git a/services/gunDB/contact-api/jobs/onOrders.js b/services/gunDB/contact-api/jobs/onOrders.js index f9a0dfb8..c7d90c24 100644 --- a/services/gunDB/contact-api/jobs/onOrders.js +++ b/services/gunDB/contact-api/jobs/onOrders.js @@ -255,7 +255,7 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { //logger.info(`[PERF] Added invoice to GunDB in ${invoicePutEndTime}ms`) /** * - * @param {Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:string}} paidInvoice + * @param {Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:Buffer}} paidInvoice */ const invoicePaidCb = async paidInvoice => { console.log('INVOICE PAID') @@ -265,8 +265,9 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { const { amt_paid_sat: amt, add_index: addIndex, - payment_addr: paymentAddr + payment_addr } = paidInvoice + const paymentAddr = payment_addr.toString('hex') const orderType = serviceOrderType || order.targetType const { ackInfo } = order //a string representing what has been requested switch (orderType) { diff --git a/services/schema/index.js b/services/schema/index.js index 9bf34fd8..145bf326 100644 --- a/services/schema/index.js +++ b/services/schema/index.js @@ -429,7 +429,7 @@ return orderedOrders }*/ /** - * @typedef {Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:string}} Invoice + * @typedef {Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:Buffer}} Invoice */ /** * @type {Recordvoid>} @@ -448,7 +448,7 @@ return orderedOrders /** * - * @param {Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:string}} data + * @param {Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:Buffer}} data */ invoiceStreamDataCb(data) { if (!data.settled) { @@ -468,7 +468,7 @@ return orderedOrders coordinateIndex: parseInt(data.add_index, 10), inbound: true, amount: amt, - toLndPub: data.payment_addr, + toLndPub: data.payment_addr.toString('hex'), invoiceMemo: data.memo }) } diff --git a/utils/lightningServices/v2.js b/utils/lightningServices/v2.js index bd2b3eb3..5efede9c 100644 --- a/utils/lightningServices/v2.js +++ b/utils/lightningServices/v2.js @@ -578,7 +578,7 @@ const addInvoice = (value, memo = '', confidential = true, expiry = 180) => * */ /** - * @param {(invoice:Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:string}) => (boolean | undefined)} dataCb + * @param {(invoice:Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:Buffer}) => (boolean | undefined)} dataCb * @param {(error:lndErr) => void} errorCb */ const subscribeInvoices = (dataCb, errorCb) => {