Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
{
tagName: 'expire_time',
data: 30,
},
{
tagName: 'description',
data: memo,
},
],
}
data[unit] = amount
var encoded = lightningPayReq.encode(data)
var privateKeyHex = 'e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734'
var signed = lightningPayReq.sign(encoded, privateKeyHex)
return signed.paymentRequest
}
{
tagName: 'payment_hash',
data: '0001020304050607080900010203040506070809000102030405060708090102',
},
{
tagName: 'expire_time',
data: 15,
},
{
tagName: 'description',
data: 'Some items',
},
],
})
const privateKeyHex = 'e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734'
const signed = lightningPayReq.sign(encoded, privateKeyHex)
const invoice = {
finalAmount: 15000,
settled: boolean('Settled', false),
creation_date: Math.round(new Date().getTime() / 1000),
settle_date: Math.round(new Date().getTime() / 1000),
payment_request: signed.paymentRequest,
memo: signed.tags.find(t => t.tagName === 'description').data,
tx_hash: '1ae44a23c141a2892c55eb3fe9de45195d88e89b36b5070e10df92d4130e4028',
}
return (
{
tagName: 'payment_hash',
data: '0001020304050607080900010203040506070809000102030405060708090102',
},
{
tagName: 'expire_time',
data: 30,
},
{
tagName: 'description',
data: memo,
},
],
})
const privateKeyHex = 'e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734'
const signed = lightningPayReq.sign(encoded, privateKeyHex)
return signed.paymentRequest
}