buffer to string
This commit is contained in:
parent
25e6b14094
commit
6cae694c95
3 changed files with 7 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 {Record<string,(invoice:Invoice) =>void>}
|
||||
|
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue