1.0.3 • Published 6 years ago
c-lightning-wrapper v1.0.3
c-lightning-wrapper
Javascript wrapper for c-lightning
Install
$ npm i c-lightning-wrapper
Usage
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'
);
API
- 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()
Test
npm test
License
MIT © Moonbois