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.
The goal of the LNPay API is to create a toolkit interface for interaction between nodes and external services.
Help me to stack sats! :blush:
Using npm:
$ npm install lnpay
Using yarn:
$ yarn add lnpay
Initial LNPay configuration.
import LNPay from 'lnpay';
const lnpay = LNPay({
secretKey: 'pak_O0iUMxk8kK_qUzkT4YKFvp1ZsUtp',
walletAccessKey: 'waka_kqvaiFFl4Tjq4rgAXlwsu6',
});
Create a new wallet and corresponding access keys.
Official Documentation / Code Example
Parameters:
const wallet = await lnpay.createWallet({
user_label: 'My Wallet',
});
console.log(wallet);
Returns info about the wallet, including balance.
Official Documentation / Code Example
const balance = await lnpay.getBalance();
console.log(balance);
Get a list of wallet transactions that have been SETTLED. This includes only transactions that have an impact on wallet balance. These DO NOT include unsettled/unpaid invoices.
Official Documentation / Code Example
Parameters:
const transactions = await lnpay.getTransactions({
page: 1,
});
console.log(transactions);
Generate a new Invoice payment.
Official Documentation / Code Example
Parameters:
const invoice = await lnpay.generateInvoice({
num_satoshis: 100,
passThru: {
order_id: '100',
},
description_hash: 'MTIzNDY1Nzg5N...',
memo: 'Invoice memo.',
expiry: 86400, // 1 day
});
console.log(invoice);
Generate an LN payment invoice from the specified wallet.
Official Documentation / Code Example
Parameters:
const payInvoice = await lnpay.payInvoice({
payment_request: 'lnbc50n1p0qjf84p...',
passThru: {
order_id: '100',
},
});
console.log(payInvoice);
Initiate a keysend payment from your wallet to a destination pubkey.
Official Documentation / Code Example
Parameters:
const keysend = await lnpay.keysend({
passThru: {
order_id: '100',
},
dest_pubkey: '033868c219bdb51a3...',
num_satoshis: 1,
});
console.log(keysend);
This section describes how to transfer sats between wallets within LNPay.
Official Documentation / Code Example
Parameters:
const transfer = await lnpay.transfer({
dest_wallet_id: 'w_n743yizWqe43Oz',
num_satoshis: 1,
memo: 'Transfer Memo',
lnPayParams: {
order_id: '100',
},
});
console.log(transfer);
Generate an LNURL-withdraw link.
Official Documentation / Code Example
Parameters:
const lnUrlWithdraw = await lnpay.lnUrlWithdraw({
public: false,
memo: 'LNURL Withdraw memo',
num_satoshis: 3,
});
console.log(lnUrlWithdraw);
Retrieve a LN transaction (invoice). This is usually used to see if a transaction has been settled or not, and for how much.
Official Documentation / Code Example
Parameters:
const getInvoice = await lnpay.getInvoice({
id: 'lntx_82yveCX2Wn0EkkdyzvyBv',
});
console.log(getInvoice);
Retrieve a LN transaction (invoice). This is usually used to see if a transaction has been settled or not, and for how much.
Official Documentation / Code Example
Parameters:
const paywall = await lnpay.createPaywall({
destination_url: 'https://bigsun.xyz',
memo: 'This is my memo',
short_url: 'bigsun',
num_satoshis: 100,
});
console.log(paywall);
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
FAQs
NPM Package for LNPay.co API.
We found that lnpay demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.