npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jbaczuk/c-lightning-rpc

v1.0.1

Published

Node.js API client for C-Lightning

Downloads

3

Readme

c-lightning-rpc

NPM

Node.js c-lightning RPC client library

Installation

$ npm i --save @jbaczuk/c-lightning-rpc

Usage

const LightningRpc = require('../c-lightning-rpc')

l = new LightningRpc('/home/<username>/.lightning/lightning-rpc')

l.listpeers()
.then((response) => {
    console.debug('TEST ', response)
})

Available Commands

feerates
    Return feerate estimates, either satoshi-per-kw ({style} perkw) or satoshi-per-kb ({style} perkb).

connect
    Connect to {id} at {host} (which can end in ':port' if not default). {id} can also be of the form id@host

listnodes
    Show node {id} (or all, if no {id}), in our local network view

getroute
    Show route to {id} for {msatoshi}, using {riskfactor} and optional {cltv} (default 9). If specified search from {fromid} otherwise use this node as source. Randomize the route with up to {fuzzpercent} (0.0 -> 100.0, default 5.0) using {seed} as an arbitrary-size string seed.

listchannels
    Show channel {short_channel_id} (or all known channels, if no {short_channel_id})

invoice
    Create an invoice for {msatoshi} with {label} and {description} with optional {expiry} seconds (default 1 hour) and optional {preimage} (default autogenerated)

listinvoices
    Show invoice {label} (or all, if no {label})

delinvoice
    Delete unpaid invoice {label} with {status}

delexpiredinvoice
    Delete all expired invoices that expired as of given {maxexpirytime} (a UNIX epoch time), or all expired invoices if not specified

autocleaninvoice
    Set up autoclean of expired invoices. Perform cleanup every {cycle_seconds} (default 3600), or disable autoclean if 0. Clean up expired invoices that have expired for {expired_by} seconds (default 86400). 

waitanyinvoice
    Wait for the next invoice to be paid, after {lastpay_index} (if supplied)

waitinvoice
    Wait for an incoming payment matching the invoice with {label}, or if the invoice expires

decodepay
    Decode {bolt11}, using {description} if necessary

help
    List available commands, or give verbose help on one command.

stop
    Shut down the lightningd process

getinfo
    Show information about this node

getlog
    Show logs, with optional log {level} (info|unusual|debug|io)

fundchannel
    Fund channel with {id} using {satoshi} (or 'all') satoshis, at optional {feerate}

listconfigs
    List all configuration options, or with [config], just that one.

sendpay
    Send along {route} in return for preimage of {payment_hash}

waitsendpay
    Wait for payment attempt on {payment_hash} to succeed or fail, but only up to {timeout} seconds.

listpayments
    Show outgoing payments

pay
    Send payment specified by {bolt11} with optional {msatoshi} (if and only if {bolt11} does not have amount), {description} (required if {bolt11} uses description hash), {riskfactor} (default 1.0), {maxfeepercent} (default 0.5) the maximum acceptable fee as a percentage (e.g. 0.5 => 0.5%), {exemptfee} (default 5000 msat) disables the maxfeepercent check for fees below the threshold, {retry_for} (default 60) the integer number of seconds before we stop retrying, and {maxdelay} (default 500) the maximum number of blocks we allow the funds to possibly get locked

listpeers
    Show current peers, if {level} is set, include logs for {id}

close
    Close the channel with {id} (either peer ID, channel ID, or short channel ID). If {force} (default false) is true, force a unilateral close after {timeout} seconds (default 30), otherwise just schedule a mutual close later and fail after timing out.

disconnect
    Disconnect from {id} that has previously been connected to using connect

ping
    Send peer {id} a ping of length {len} (default 128) asking for {pongbytes} (default 128)

withdraw
    Send to {destination} address {satoshi} (or 'all') amount via Bitcoin transaction, at optional {feerate}

newaddr
    Get a new {bech32, p2sh-segwit} address to fund a channel (default is bech32)

dev-listaddrs
    Show addresses list up to derivation {index} (default is the last bip32 index)

listfunds
    Show available funds from the internal wallet

dev-rescan-outputs
    Synchronize the state of our funds with bitcoind