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

@synonymdev/blocktank-client

v0.0.51

Published

LSP client library

Downloads

83

Readme

Description

Client side wrapper library for interacting with the Blocktank LSP server. For REST API docs see synonym.readme.io

Blocktank is an LSP that allows businesses, apps, or online platforms to integrate, automate, and monetize services from your Lightning node. This includes channel configuration, channel purchases, channel info and more.

For widget and complete code samples see blocktank-ui

Rest API docs

https://synonym.readme.io/

Getting started

yarn add @synonymdev/blocktank-client
#or
npm i -S @synonymdev/blocktank-client

Usage

import bt from '@synonymdev/blocktank-client';
// Choose network
bt.setNetwork('mainnet'); // Options are 'mainnet' and 'regtest'

// Get all node info and available services
const info = await bt.getInfo();

const service = info.services[0];

// 1. Place order
const buyRes = await bt.buyChannel({
    product_id: service.product_id,
    channel_expiry: 4,
    remote_balance: 0,
    local_balance: 20000,
});

// 2. Make payment using one of below methods
const {btc_address, ln_invoice} = buyRes;

// 3. Get order details for current state
const order = await bt.getOrder(buy.order_id);

// 4. Make an onchain transaction using the below min fee with RBF disabled to instantly be able to claim your channel
const {zero_conf_satvbyte, zero_conf_satvbyte_expiry} = order;

// Once order state === 100 a channel can be claimed
const {state, stateMessage} = order;

// For all order states see: https://github.com/synonymdev/blocktank-client/blob/f8a20c35a4953435cecf8f718ee555e311e1db9b/src/services/client.ts#L15

// 5. Claim lnurl-channel
const {lnurl_string} = order;

// Or claim manually with an additional method
try {
  await bt.finalizeChannel({
    order_id: order._id,
    node_uri: '0296b2db342fcf87ea94d981757fdf4d3e545bd5cef4919f58b5d38dfdd73bf5c9@34.79.58.84:9735',
    private: true // For mobile nodes that won't be routing transactions
  });
} catch (e) {
  console.error(e);
}

Development

yarn build

Builds library ready for production use.

yarn test

Integration tests.

yarn format

Code formatting.

yarn lint

Code linting.

yarn prepublish

Prepares code for publishing bu building and bumping package version.