Socket
Socket
Sign inDemoInstall

@webbtc/webln-types

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webbtc/webln-types

Type definitions for WebLN


Version published
Weekly downloads
3.5K
increased by7.1%
Maintainers
1
Weekly downloads
 
Created
Source

webln-types

Type definitions for WebLN

Quick Start

  1. Install package
 npm install @webbtc/webln-types --save-dev # or yarn add @webbtc/webln-types --dev
  1. Type definitions are now available through window.webln and importing from "@webbtc/webln-types"
import { 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");
}

If you do not import any types from "@webbtc/webln-types" and just want to use window.webln, add the following line somewhere in your codebase (e.g. the main/index.tsx file) to ensure the types still get consumed:

/// <reference types="@webbtc/webln-types" />

Adding WebLN to your application

Read the WebLN Guide

Keywords

FAQs

Package last updated on 17 Jan 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc