Skip to main content
Home

latest

Framework for Nostr on Deno and web. 🛸

This package works with Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
94%
Published
2 months ago (0.46.5)
class LNURL

Represents an LNURL, with methods to fetch details and generate invoices.

Constructors

new
LNURL(
url: URL,
opts?: { fetch: globalThis.fetch; },
)

Properties

private
fetch: globalThis.fetch

Fetch function to use for HTTP requests.

readonly
url: URL

Underlying HTTP(s) URL of the user.

Methods

Resolve an LNURL to its details.

getInvoice(opts: { amount: number; nostr?: NostrEvent; signal?: AbortSignal; }): Promise<LNURLCallback>

Generate an LNURL invoice from the params.

toString(): `lnurl1${string}`

Returns the LNURL object as a bech32-encoded lnurl1... string.

Static Methods

fromLightningAddress(
ln: string,
opts?: { fetch: globalThis.fetch; },
): LNURL

Create an LNURL object from a lightning address (email-like format). Throws if the value is not a valid lightning address.

fromString(
value: string,
opts?: { fetch: globalThis.fetch; },
): LNURL

Create an LNURL object from a bech32 lnurl1... string. Throws if the value is not a valid lnurl.

LNURL callback schema.

LNURL response schema.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@nostrify/nostrify

Import symbol

import { LNURL } from "@nostrify/nostrify/ln";
or

Import directly with a jsr specifier

import { LNURL } from "jsr:@nostrify/nostrify/ln";

Add Package

pnpm i jsr:@nostrify/nostrify
or (using pnpm 10.8 or older)
pnpm dlx jsr add @nostrify/nostrify

Import symbol

import { LNURL } from "@nostrify/nostrify/ln";

Add Package

yarn add jsr:@nostrify/nostrify
or (using Yarn 4.8 or older)
yarn dlx jsr add @nostrify/nostrify

Import symbol

import { LNURL } from "@nostrify/nostrify/ln";

Add Package

vlt install jsr:@nostrify/nostrify

Import symbol

import { LNURL } from "@nostrify/nostrify/ln";

Add Package

npx jsr add @nostrify/nostrify

Import symbol

import { LNURL } from "@nostrify/nostrify/ln";

Add Package

bunx jsr add @nostrify/nostrify

Import symbol

import { LNURL } from "@nostrify/nostrify/ln";