-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement EstimateRouteFee #167
Comments
Yes there is probeForRoute |
If anyone wants a shim for this, something like this should work (untested): async function estimateRouteFee ({ lnd, dest, amt_sat, request, timeout }) {
return await new Promise((resolve, reject) => {
lnd.router.estimateRouteFee({ dest: Buffer.from(dest, 'hex'), amt_sat, payment_request: request, timeout }, (err, res) => {
if (err) {
reject(err)
} else {
if (res.failure_reason) {
reject(new Error(`Unable to estimate route: ${res.failure_reason}`))
}
resolve({
routingFeeMsat: res.routing_fee_msat,
timeLockDelay: res.time_lock_delay
})
}
})
})
} |
Would love to help out on this issue if it hasn't already been completed. Any guidance in addition to the above commentary is welcomed. |
Sounds good, I would avoid the destination based arguments and stick to only the payment request argument For the response i would interpret the error instead of returning the error in the success. Potentially just return the callback with an error if the PaymentFailureReason is not reason none |
Thank you 🙏🏼 will follow up with any further questions etc. as I move along |
It doesn't appear to be implemented. I'm pretty sure we can do this by probing using the library, but this would be nice to have.
The request/response are pretty simple so I imagine wrapping it is less of a lift than other things.
lightning/grpc/protos/router.proto
Lines 56 to 60 in c754858
The text was updated successfully, but these errors were encountered: