UNPKG

@getalby/lightning-tools

Version:

Collection of helpful building blocks and tools to develop Bitcoin Lightning web apps

44 lines (43 loc) 1.77 kB
import { SendPaymentResponse, WebLNProvider } from "@webbtc/webln-types"; import { Invoice } from "../bolt11"; import { Boost } from "../podcasting2"; import { KeysendResponse, LnUrlPayResponse, NostrResponse, RequestInvoiceArgs, ZapArgs, ZapOptions } from "./types"; export declare const DEFAULT_PROXY = "https://api.getalby.com/lnurl"; type LightningAddressOptions = { proxy?: string | false; webln?: WebLNProvider; }; export declare class LightningAddress { address: string; options: LightningAddressOptions; username: string | undefined; domain: string | undefined; pubkey: string | undefined; lnurlpData: LnUrlPayResponse | undefined; keysendData: KeysendResponse | undefined; nostrData: NostrResponse | undefined; nostrPubkey: string | undefined; nostrRelays: string[] | undefined; webln: WebLNProvider | undefined; constructor(address: string, options?: LightningAddressOptions); parse(): void; getWebLN(): any; fetch(): Promise<void>; fetchWithProxy(): Promise<void>; fetchWithoutProxy(): Promise<void>; fetchLnurlData(): Promise<void>; fetchKeysendData(): Promise<void>; fetchNostrData(): Promise<void>; lnurlpUrl(): string; keysendUrl(): string; nostrUrl(): string; generateInvoice(params: Record<string, string>): Promise<Invoice>; requestInvoice(args: RequestInvoiceArgs): Promise<Invoice>; boost(boost: Boost, amount?: number): Promise<SendPaymentResponse>; zapInvoice({ satoshi, comment, relays, e }: ZapArgs, options?: ZapOptions): Promise<Invoice>; zap(args: ZapArgs, options?: ZapOptions): Promise<SendPaymentResponse>; private parseLnUrlPayResponse; private parseKeysendResponse; private parseNostrResponse; } export {};