Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@synonymdev/blocktank-client
Advanced tools
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
yarn add @synonymdev/blocktank-client
#or
npm i -S @synonymdev/blocktank-client
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);
}
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.
FAQs
LSP client library
We found that @synonymdev/blocktank-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.