lightning-client-js
JavaScript c-lightning client.
This repository is published as the lightning-client
NPM module.
Installing the client
You can easily install this client using npm
by running:
npm install lightning-client
Using the client
Once the client is installed you can use it by loading the main class and instantiating it in this way:
'use strict'; const LightningClient = ; // This should point to your lightning-dir, by default in ~/.lightning. // The debug mode is enabled (second parameter) but this decreases performances (see PR #10)const client = '/home/bitcoind/.lightning' true; // Every call returns a Promise // "Show information about this node"client ; // "Create an invoice for {msatoshi} with {label} and {description} with optional {expiry} seconds (default 1 hour)" }client ; // "Show addresses list up to derivation {index} (default is the last bip32 index)"client ;