Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 66 additions & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

/* auto-generated by NAPI-RS */

export declare function setLogListener(callback?: (...args: any[]) => any | undefined | null, minLevel?: string | undefined | null): void
export declare function setLogListener(
callback?: (...args: any[]) => any | undefined | null,
minLevel?: string | undefined | null,
): void
export declare function generateMnemonic(): string
export interface MdkNodeOptions {
network: string
Expand Down Expand Up @@ -34,7 +37,7 @@ export interface PaymentEvent {
export const enum PaymentEventType {
Claimable = 0,
Received = 1,
Failed = 2
Failed = 2,
}
export interface NodeChannel {
channelId: string
Expand Down Expand Up @@ -68,6 +71,11 @@ export declare class MdkNode {
stopReceiving(): void
syncWallets(): void
getBalance(): number
/**
* Get balance without starting/stopping the node.
* Use this when the node is already running via start_receiving().
*/
getBalanceWhileRunning(): number
listChannels(): Array<NodeChannel>
/**
* Manually sync the RGS snapshot.
Expand All @@ -78,10 +86,61 @@ export declare class MdkNode {
syncRgs(doFullSync: boolean): number
receivePayment(minThresholdMs: number, quietThresholdMs: number): Array<ReceivedPayment>
getInvoice(amount: number, description: string, expirySecs: number): PaymentMetadata
getInvoiceWithScid(humanReadableScid: string, amount: number, description: string, expirySecs: number): PaymentMetadata
/**
* Get invoice without starting/stopping the node.
* Use this when the node is already running via start_receiving().
*/
getInvoiceWhileRunning(amount: number, description: string, expirySecs: number): PaymentMetadata
/**
* Get variable amount invoice without starting/stopping the node.
* Use this when the node is already running via start_receiving().
*/
getVariableAmountJitInvoiceWhileRunning(description: string, expirySecs: number): PaymentMetadata
getInvoiceWithScid(
humanReadableScid: string,
amount: number,
description: string,
expirySecs: number,
): PaymentMetadata
getVariableAmountJitInvoice(description: string, expirySecs: number): PaymentMetadata
getVariableAmountJitInvoiceWithScid(humanReadableScid: string, description: string, expirySecs: number): PaymentMetadata
payLnurl(lnurl: string, amountMsat: number, waitForPaymentSecs?: number | undefined | null): string
payBolt11(bolt11Invoice: string): string
payBolt12Offer(bolt12OfferString: string, amountMsat: number, waitForPaymentSecs?: number | undefined | null): string
getVariableAmountJitInvoiceWithScid(
humanReadableScid: string,
description: string,
expirySecs: number,
): PaymentMetadata
/**
* Unified payment method that auto-detects the destination type.
*
* Only supports variable-amount destinations where we set the amount:
* - BOLT12 offers (lno...)
* - LNURL (lnurl...)
* - Lightning addresses (user@domain)
* - Zero-amount BOLT11 invoices
*
* For fixed-amount BOLT11 invoices, amount_msat can be omitted (the invoice amount is used).
* For variable-amount destinations, amount_msat is required.
*/
pay(
destination: string,
amountMsat?: number | undefined | null,
waitForPaymentSecs?: number | undefined | null,
): string
/**
* Unified payment method that auto-detects the destination type.
* Use this when the node is already running via start_receiving().
*
* Supports all destination types:
* - BOLT11 invoices (fixed or variable amount)
* - BOLT12 offers (lno...)
* - LNURL (lnurl...)
* - Lightning addresses (user@domain)
*
* For fixed-amount BOLT11 invoices, amount_msat can be omitted (the invoice amount is used).
* For variable-amount destinations, amount_msat is required.
*/
payWhileRunning(
destination: string,
amountMsat?: number | undefined | null,
waitForPaymentSecs?: number | undefined | null,
): string
}
Loading