update breaking change in estimateRouteFee
This commit is contained in:
parent
1d3ab23ec4
commit
6aac9eeed4
@ -21,19 +21,24 @@ getWalletInfo({ lnd }, (err, result) => {
|
|||||||
|
|
||||||
export async function estimateRouteFee ({ lnd, destination, tokens, mtokens, request, timeout }) {
|
export async function estimateRouteFee ({ lnd, destination, tokens, mtokens, request, timeout }) {
|
||||||
return await new Promise((resolve, reject) => {
|
return await new Promise((resolve, reject) => {
|
||||||
|
const params = {}
|
||||||
|
if (request) {
|
||||||
|
params.payment_request = request
|
||||||
|
} else {
|
||||||
|
params.dest = Buffer.from(destination, 'hex')
|
||||||
|
params.amt_sat = tokens ? toPositiveNumber(tokens) : toPositiveNumber(BigInt(mtokens) / BigInt(1e3))
|
||||||
|
}
|
||||||
|
|
||||||
lnd.router.estimateRouteFee({
|
lnd.router.estimateRouteFee({
|
||||||
dest: Buffer.from(destination, 'hex'),
|
...params,
|
||||||
amt_sat: tokens ? toPositiveNumber(tokens) : toPositiveNumber(BigInt(mtokens) / BigInt(1e3)),
|
|
||||||
payment_request: request,
|
|
||||||
timeout
|
timeout
|
||||||
}, (err, res) => {
|
}, (err, res) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res?.failure_reason) {
|
if (res?.failure_reason) {
|
||||||
reject(new Error(`Unable to estimate route: ${res.failure_reason}`))
|
reject(new Error(`Unable to estimate route: ${res.failure_reason}`))
|
||||||
|
} else {
|
||||||
|
reject(err)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM polarlightning/lnd:0.17.5-beta
|
FROM polarlightning/lnd:0.18.0-beta
|
||||||
|
|
||||||
ARG LN_NODE_FOR
|
ARG LN_NODE_FOR
|
||||||
ENV LN_NODE_FOR=$LN_NODE_FOR
|
ENV LN_NODE_FOR=$LN_NODE_FOR
|
||||||
|
@ -36,7 +36,7 @@ export default async function wrapInvoice (bolt11, { msats, description, descrip
|
|||||||
throw new Error('Unable to decode invoice')
|
throw new Error('Unable to decode invoice')
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('invoice', inv.mtokens, inv.expires_at, inv.cltv_delta)
|
console.log('invoice', inv.id, inv.mtokens, inv.expires_at, inv.cltv_delta, inv.destination)
|
||||||
|
|
||||||
// validate outgoing amount
|
// validate outgoing amount
|
||||||
if (inv.mtokens) {
|
if (inv.mtokens) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user