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 lsp-ui
yarn add @synonymdev/lsp-client
#or
npm i -S @synonymdev/lsp-clientimportbtfrom'@synonymdev/lsp-client';// Choose networkbt.setNetwork('mainnet');// Options are 'mainnet' and 'regtest'// Get all node infoconstinfo=awaitbt.getInfo();// 1. Create channel orderconstbuyRes=awaitbt.createOrder({lspBalanceSat: 100000,channelExpiryWeeks: 6,clientBalanceSat: 0});// 2. Make payment using one of the provided methodsconst{onchain, bolt11Invoice}=buyRes.payment;// 3. Get status and details for the current channel orderconstorder=awaitbt.getOrder(buyRes.id);const{state, payment}=order;// 4. Open channel once order.payment.state === 'paid'awaitbt.openChannel({connectionStringOrPubkey: '0296b2db342fcf87ea94d981757fdf4d3e545bd5cef4919f58b5d38dfdd73bf5c9@34.79.58.84:9735',announceChannel: false// For mobile nodes that won't be routing transactions});Builds library ready for production use.
Integration tests.
Code formatting.
Code linting.
Prepares code for publishing bu building and bumping package version.