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

lnrpc

v0.6.2

Published

User-centric Node.js gRPC client for lightningnetwork/lnd

Downloads

21

Readme

LNRPC Build Status

Synced to LND master branch

Features

  • 🛠Auto-generates lnd/lnrpc client
  • ✨Wraps requests in promises
  • 🤝Easily setup SSL and Macaroons
  • 📚Instantiates all gRPC services
  • 🔢Configurable LND version

Installation

yarn add lnrpc

# Or
npm i lnrpc -S

For best results, be sure to install lnd before using this project and ensure you have an lnd instance running with --no-macaroons, unless you provide macaroon authentication to your lnrpc instance.

Usage

Connecting to an lnd instance at localhost:10001.

const createLnrpc = require('lnrpc');

(async function() {
  const lnrpc = await createLnrpc();

  // All requests are promisified
  const balance = await lnrpc.walletBalance({});

  // ...and you're off!
  console.log(balance);
})();

Options

const createLnrpc = require('lnrpc');

(async function() {
  const lnrcpCustom = await createLnrpc({
    /*
     By default lnrpc connects to `localhost:10001`,
     however we can point to any host.
     */
    server: '173.239.209.2:3001',

    /*
     By default  lnrpc looks for your tls certificate at:
     `~/.lnd/tls.cert`, unless it detects you're using macOS and
     defaults to `~/Library/Application\ Support/Lnd/tls.cert`
     however you can configure your own SSL certificate path like:
     */
    tls: './path/to/tls.cert',

    /*
     You can also provide a TLS certificate directly as a string
     (Just make sure you don't commit this to git).
     Overwrites: `tls`
     */
    cert: process.env.MY_SSL_CERT,

    /*
     Optional path to configure macaroon authentication
     from LND generated macaroon file.
     */
    macaroonPath: './path/to/data/admin.macaroon',

    /*
     Optional way to configure macaroon authentication by
     passing a hex encoded string of your macaroon file
     */
    macaroon: process.env.MY_MACAROON_HEX,
  });
})();

Configuring LND Version

By default the LND master branch is installed, however you can easily install specific releases and branches by updating your project's package.json file.

Install at Release

{
  "lnrpc": {
    "version": "v0.5.2-beta"
  }
}

Install at Branch

{
  "lnrpc": {
    "version": "temp-testnet-fee-estimation"
  }
}

⚠️ Setting an undiscoverable version will fail without error, so be sure you've selected a valid release or git branch.

API Reference

All lnrpc methods documentation can be found here.

Usage With BTCPayServer

By default lnrpc assumes SSl certificate pinning. In order to use lnrpc with a service (like BTCPayServer) which manages your certification, you'll have to opt to disable certificate pinning by passing { tls: false } within your lnrpc configuration.

Contributors

To develop on the project please run:

git clone [email protected]:Matt-Jensen/lnrpc.git && cd $_
yarn
npm run start

License

This project is licensed under the MIT License.