rpc-style lnd endpoint
This commit is contained in:
parent
8edbe85e53
commit
fc49249984
1 changed files with 20 additions and 0 deletions
|
|
@ -2986,4 +2986,24 @@ module.exports = async (
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ap.get('/api/lnd/cb/:methodName', (req, res) => {
|
||||||
|
const { lightning } = LightningServices.services
|
||||||
|
const { methodName } = req.params
|
||||||
|
const args = req.body
|
||||||
|
|
||||||
|
lightning[methodName](args, (err, lres) => {
|
||||||
|
if (err) {
|
||||||
|
res.status(500).json({
|
||||||
|
errorMessage: err.details
|
||||||
|
})
|
||||||
|
} else if (lres) {
|
||||||
|
res.status(200).json(lres)
|
||||||
|
} else {
|
||||||
|
res.status(500).json({
|
||||||
|
errorMessage: 'Unknown error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue