Javascript wrapper for c-lightning
$ npm i c-lightning-wrapper
It requires c-lightning to be installed on your system. The constructor takes path to lightning-cli program.
const LightningCmd = require('c-lightning-wrapper');
const lightingCmd = new LightningCmd('~/path/to/lightning/cli');
const dataAsObject = await lightingCmd.connect(
'lightning-node-id',
'lightning-node-host-ip'
);
- connect(id, host, port = '9735')
- listnodes()
- getroute(id, msatoshi, riskfactor)
- listchannels(short_channel_id)
- stop()
- getinfo()
- getlog()
- fundchannel(id, satoshi = 'all')
- listconfigs()
- listpayments()
- pay(payreq)
- listpeers()
- close(id)
- disconnect(id)
- withdraw(destination, satoshi = 'all')
- newaddr()
- listfunds()
npm test
MIT © Moonbois