Skip to content

Commit

Permalink
Add keysend method definition (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiidb authored Mar 24, 2022
1 parent 1ee2e4d commit d68f8f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ export interface WebLNProvider {
/* Prompts the user with a BOLT-11 payment request */
sendPayment(paymentRequest: string): Promise<SendPaymentResponse>;

/* Sends a keysend payment to a node without needing an invoice */
keysend(args: KeysendArgs): Promise<SendPaymentResponse>;

/* Prompts the user to provide the page with an invoice */
makeInvoice(amount: string | number | RequestInvoiceArgs): Promise<RequestInvoiceResponse>;

Expand Down
7 changes: 7 additions & 0 deletions src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ export interface RequestInvoiceArgs {
defaultMemo?: string;
}

export interface KeysendArgs {
destination: string;
customRecords?: Record<string, string>;
amount: string | number;
}

export interface RequestInvoiceResponse {
paymentRequest: string;
}
Expand All @@ -37,6 +43,7 @@ export interface WebLNProvider {
enable(): Promise<void>;
getInfo(): Promise<GetInfoResponse>;
sendPayment(paymentRequest: string): Promise<SendPaymentResponse>;
keysend(args: KeysendArgs): Promise<SendPaymentResponse>;
makeInvoice(args: string | number | RequestInvoiceArgs): Promise<RequestInvoiceResponse>;
signMessage(message: string): Promise<SignMessageResponse>;
verifyMessage(signature: string, message: string): Promise<void>;
Expand Down

0 comments on commit d68f8f3

Please sign in to comment.