Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@webbtc/webln-types
Advanced tools
Type definitions for WebLN
WebLN may be implemented by a lightning browser extension (e.g. Alby) therefore WebLN can already be called directly from the browser if the user has the extension installed. This package simply adds type definitions to make it easier to integrate WebLN into web applications that are written in Typescript.
Install package
npm install @webbtc/webln-types --save-dev # or yarn add @webbtc/webln-types --dev
Create webln-types.d.ts
in your src
directory with the following contents to ensure the types are picked up by the Typescript compiler:
/// <reference types="@webbtc/webln-types" />
"@webbtc/webln-types"
import type { GetInfoResponse } from "@webbtc/webln-types";
if (window.webln) {
(async () => {
await window.webln.enable();
const info: GetInfoResponse = await window.webln.getInfo();
console.log("Your node pubkey is", info.node.pubkey);
})();
} else {
console.warn("WebLN not enabled");
}
Read the WebLN Guide
FAQs
Type definitions for WebLN
The npm package @webbtc/webln-types receives a total of 2,268 weekly downloads. As such, @webbtc/webln-types popularity was classified as popular.
We found that @webbtc/webln-types demonstrated a healthy version release cadence and project activity because the last version was released less than 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
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.