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 🙏

© 2026 – Pkg Stats / Ryan Hefner

lnpay-js

v0.1.2

Published

LNPay JavaScript SDK

Readme

lnpay-js

LNPay JavaScript SDK - at the moment a basic wrapper for the LNPay API

Install

You can get it on npm.

npm install lnpay-js --save

Or if you're not into package management, just download a ZIP file.

Setup

First, include the script located on the dist folder or load it from unpkg.

<script src="https://unpkg.com/lnpay-js@^0.1/dist/lnpay.min.js"></script>

Now, you need to instantiate it with a Public API Key from LNPay.co

let publicApiKey = '';
LNPay.Initialize(publicApiKey);

Usage - Documentation

The first alpha version of this SDK is mainly a wrapper for the LNPay API

Everyhing revolves around the wallet and Wallet Access Keys (WAK) which grant various levels of permission.

Instantiate a Wallet / Check Balance

let myWallet = new LNPayWallet(walletAccessKey);
myWallet.getInfo(function(result) {
      console.log('Balance:' + result.balance);
    }
);

Create a wallet

You can create a wallet from the UI or via the API. When you create a wallet via the API, Wallet Access Keys (WAK) are returned. You need to save these.

let walletParams = {"user_label":"My wallet"};
LNPay.createWallet(walletParams,
    function(result) {
      console.log(result);
    }
);

Generate Invoice

let myWallet = new LNPayWallet(walletAccessKey);
let invoiceParams = {"num_satoshis":2,"memo":"Tester"};
myWallet.createInvoice(invoiceParams,
    function(result) {
      console.log(result);
    }
);

Pay Invoice

let myWallet = new LNPayWallet(walletAccessKey);
let invoiceParams = {"payment_request":"lnbc1111..."};
myWallet.payInvoice(invoiceParams,
    function(result) {
      console.log(result);
    }
);

Transfers between wallets

let myWallet = new LNPayWallet(walletAccessKey);
let transferParams = {"dest_wallet_id":"wa_xxxxx","num_satoshis":22,"memo":"Transfer Memo"};
myWallet.internalTransfer(transferParams,
    function(result) {
      console.log(result);
    }
);

Get Wallet Transactions

let myWallet = new LNPayWallet(walletAccessKey);
let queryParams = {};
myWallet.getTransactions(queryParams,
    function(result) {
      console.log(result);
    }
);

Get LNURL

let lnurlParams = {"num_satoshis":12,"memo":"SatsBack!"};
let myWallet = new LNPayWallet(walletAccessKey);
myWallet.getLnurl(lnurlParams,
    function(result) {
      console.log(result);
    }
);

Get Invoice / Check if Settled

let lntx_id = "lntx_Mxxxxx";
let lntx = new LNPayLnTx(lntx_id);
lntx.getInfo(function(result) {
  console.log("Is Settled" + result.settled);
}
);

See this example file

Development

1. Installation

You will need to have nodejs installed.

Clone the repository

2. Getting started

  • open the command line and switch into the project folder
  • npm install
  • npm install -g gulp
  • gulp to see the list of available tasks

3. Essential Gulp Tasks

  • gulp build dumps a plain and a minified file from all files in the folder src into the folder dist.
  • gulp clean removes all files in the folder dist.
  • gulp test runs the tests and linting for all files in the folder src.

Credits and License

The structure for this SDK cloned from here.

This software is published under the MIT-License. See 'license' for more information.