webln.ts raw
1 /**
2 * WebLN API Types
3 * Based on the WebLN specification: https://webln.dev/
4 */
5
6 export interface WebLNNode {
7 alias?: string;
8 pubkey?: string;
9 color?: string;
10 }
11
12 export interface GetInfoResponse {
13 node: WebLNNode;
14 }
15
16 export interface SendPaymentResponse {
17 preimage: string;
18 }
19
20 export interface RequestInvoiceArgs {
21 amount?: string | number;
22 defaultAmount?: string | number;
23 minimumAmount?: string | number;
24 maximumAmount?: string | number;
25 defaultMemo?: string;
26 }
27
28 export interface RequestInvoiceResponse {
29 paymentRequest: string;
30 }
31
32 export interface KeysendArgs {
33 destination: string;
34 amount: string | number;
35 customRecords?: Record<string, string>;
36 }
37
38 export interface SignMessageResponse {
39 message: string;
40 signature: string;
41 }
42