@moneydevkit/lightning-js 0.1.66 → 0.1.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +66 -7
  2. package/package.json +14 -14
package/index.d.ts CHANGED
@@ -3,7 +3,10 @@
3
3
 
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- export declare function setLogListener(callback?: (...args: any[]) => any | undefined | null, minLevel?: string | undefined | null): void
6
+ export declare function setLogListener(
7
+ callback?: (...args: any[]) => any | undefined | null,
8
+ minLevel?: string | undefined | null,
9
+ ): void
7
10
  export declare function generateMnemonic(): string
8
11
  export interface MdkNodeOptions {
9
12
  network: string
@@ -34,7 +37,7 @@ export interface PaymentEvent {
34
37
  export const enum PaymentEventType {
35
38
  Claimable = 0,
36
39
  Received = 1,
37
- Failed = 2
40
+ Failed = 2,
38
41
  }
39
42
  export interface NodeChannel {
40
43
  channelId: string
@@ -68,6 +71,11 @@ export declare class MdkNode {
68
71
  stopReceiving(): void
69
72
  syncWallets(): void
70
73
  getBalance(): number
74
+ /**
75
+ * Get balance without starting/stopping the node.
76
+ * Use this when the node is already running via start_receiving().
77
+ */
78
+ getBalanceWhileRunning(): number
71
79
  listChannels(): Array<NodeChannel>
72
80
  /**
73
81
  * Manually sync the RGS snapshot.
@@ -78,10 +86,61 @@ export declare class MdkNode {
78
86
  syncRgs(doFullSync: boolean): number
79
87
  receivePayment(minThresholdMs: number, quietThresholdMs: number): Array<ReceivedPayment>
80
88
  getInvoice(amount: number, description: string, expirySecs: number): PaymentMetadata
81
- getInvoiceWithScid(humanReadableScid: string, amount: number, description: string, expirySecs: number): PaymentMetadata
89
+ /**
90
+ * Get invoice without starting/stopping the node.
91
+ * Use this when the node is already running via start_receiving().
92
+ */
93
+ getInvoiceWhileRunning(amount: number, description: string, expirySecs: number): PaymentMetadata
94
+ /**
95
+ * Get variable amount invoice without starting/stopping the node.
96
+ * Use this when the node is already running via start_receiving().
97
+ */
98
+ getVariableAmountJitInvoiceWhileRunning(description: string, expirySecs: number): PaymentMetadata
99
+ getInvoiceWithScid(
100
+ humanReadableScid: string,
101
+ amount: number,
102
+ description: string,
103
+ expirySecs: number,
104
+ ): PaymentMetadata
82
105
  getVariableAmountJitInvoice(description: string, expirySecs: number): PaymentMetadata
83
- getVariableAmountJitInvoiceWithScid(humanReadableScid: string, description: string, expirySecs: number): PaymentMetadata
84
- payLnurl(lnurl: string, amountMsat: number, waitForPaymentSecs?: number | undefined | null): string
85
- payBolt11(bolt11Invoice: string): string
86
- payBolt12Offer(bolt12OfferString: string, amountMsat: number, waitForPaymentSecs?: number | undefined | null): string
106
+ getVariableAmountJitInvoiceWithScid(
107
+ humanReadableScid: string,
108
+ description: string,
109
+ expirySecs: number,
110
+ ): PaymentMetadata
111
+ /**
112
+ * Unified payment method that auto-detects the destination type.
113
+ *
114
+ * Only supports variable-amount destinations where we set the amount:
115
+ * - BOLT12 offers (lno...)
116
+ * - LNURL (lnurl...)
117
+ * - Lightning addresses (user@domain)
118
+ * - Zero-amount BOLT11 invoices
119
+ *
120
+ * For fixed-amount BOLT11 invoices, amount_msat can be omitted (the invoice amount is used).
121
+ * For variable-amount destinations, amount_msat is required.
122
+ */
123
+ pay(
124
+ destination: string,
125
+ amountMsat?: number | undefined | null,
126
+ waitForPaymentSecs?: number | undefined | null,
127
+ ): string
128
+ /**
129
+ * Unified payment method that auto-detects the destination type.
130
+ * Use this when the node is already running via start_receiving().
131
+ *
132
+ * Supports all destination types:
133
+ * - BOLT11 invoices (fixed or variable amount)
134
+ * - BOLT12 offers (lno...)
135
+ * - LNURL (lnurl...)
136
+ * - Lightning addresses (user@domain)
137
+ *
138
+ * For fixed-amount BOLT11 invoices, amount_msat can be omitted (the invoice amount is used).
139
+ * For variable-amount destinations, amount_msat is required.
140
+ */
141
+ payWhileRunning(
142
+ destination: string,
143
+ amountMsat?: number | undefined | null,
144
+ waitForPaymentSecs?: number | undefined | null,
145
+ ): string
87
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneydevkit/lightning-js",
3
- "version": "0.1.66",
3
+ "version": "0.1.67",
4
4
  "main": "index.js",
5
5
  "files": [
6
6
  "index.d.ts",
@@ -80,18 +80,18 @@
80
80
  "packageManager": "yarn@4.9.1",
81
81
  "repository": "https://github.com/moneydevkit/lightning-js",
82
82
  "optionalDependencies": {
83
- "@moneydevkit/lightning-js-win32-x64-msvc": "0.1.66",
84
- "@moneydevkit/lightning-js-darwin-x64": "0.1.66",
85
- "@moneydevkit/lightning-js-linux-x64-gnu": "0.1.66",
86
- "@moneydevkit/lightning-js-linux-x64-musl": "0.1.66",
87
- "@moneydevkit/lightning-js-linux-arm64-gnu": "0.1.66",
88
- "@moneydevkit/lightning-js-win32-ia32-msvc": "0.1.66",
89
- "@moneydevkit/lightning-js-linux-arm-gnueabihf": "0.1.66",
90
- "@moneydevkit/lightning-js-darwin-arm64": "0.1.66",
91
- "@moneydevkit/lightning-js-android-arm64": "0.1.66",
92
- "@moneydevkit/lightning-js-freebsd-x64": "0.1.66",
93
- "@moneydevkit/lightning-js-linux-arm64-musl": "0.1.66",
94
- "@moneydevkit/lightning-js-win32-arm64-msvc": "0.1.66",
95
- "@moneydevkit/lightning-js-android-arm-eabi": "0.1.66"
83
+ "@moneydevkit/lightning-js-win32-x64-msvc": "0.1.67",
84
+ "@moneydevkit/lightning-js-darwin-x64": "0.1.67",
85
+ "@moneydevkit/lightning-js-linux-x64-gnu": "0.1.67",
86
+ "@moneydevkit/lightning-js-linux-x64-musl": "0.1.67",
87
+ "@moneydevkit/lightning-js-linux-arm64-gnu": "0.1.67",
88
+ "@moneydevkit/lightning-js-win32-ia32-msvc": "0.1.67",
89
+ "@moneydevkit/lightning-js-linux-arm-gnueabihf": "0.1.67",
90
+ "@moneydevkit/lightning-js-darwin-arm64": "0.1.67",
91
+ "@moneydevkit/lightning-js-android-arm64": "0.1.67",
92
+ "@moneydevkit/lightning-js-freebsd-x64": "0.1.67",
93
+ "@moneydevkit/lightning-js-linux-arm64-musl": "0.1.67",
94
+ "@moneydevkit/lightning-js-win32-arm64-msvc": "0.1.67",
95
+ "@moneydevkit/lightning-js-android-arm-eabi": "0.1.67"
96
96
  }
97
97
  }