@moneydevkit/lightning-js 0.1.66 → 0.1.68

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 +82 -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
@@ -30,11 +33,12 @@ export interface PaymentEvent {
30
33
  paymentHash: string
31
34
  amountMsat?: number
32
35
  reason?: string
36
+ payerNote?: string
33
37
  }
34
38
  export const enum PaymentEventType {
35
39
  Claimable = 0,
36
40
  Received = 1,
37
- Failed = 2
41
+ Failed = 2,
38
42
  }
39
43
  export interface NodeChannel {
40
44
  channelId: string
@@ -68,6 +72,11 @@ export declare class MdkNode {
68
72
  stopReceiving(): void
69
73
  syncWallets(): void
70
74
  getBalance(): number
75
+ /**
76
+ * Get balance without starting/stopping the node.
77
+ * Use this when the node is already running via start_receiving().
78
+ */
79
+ getBalanceWhileRunning(): number
71
80
  listChannels(): Array<NodeChannel>
72
81
  /**
73
82
  * Manually sync the RGS snapshot.
@@ -78,10 +87,76 @@ export declare class MdkNode {
78
87
  syncRgs(doFullSync: boolean): number
79
88
  receivePayment(minThresholdMs: number, quietThresholdMs: number): Array<ReceivedPayment>
80
89
  getInvoice(amount: number, description: string, expirySecs: number): PaymentMetadata
81
- getInvoiceWithScid(humanReadableScid: string, amount: number, description: string, expirySecs: number): PaymentMetadata
90
+ /**
91
+ * Get invoice without starting/stopping the node.
92
+ * Use this when the node is already running via start_receiving().
93
+ */
94
+ getInvoiceWhileRunning(amount: number, description: string, expirySecs: number): PaymentMetadata
95
+ /**
96
+ * Get variable amount invoice without starting/stopping the node.
97
+ * Use this when the node is already running via start_receiving().
98
+ */
99
+ getVariableAmountJitInvoiceWhileRunning(description: string, expirySecs: number): PaymentMetadata
100
+ getInvoiceWithScid(
101
+ humanReadableScid: string,
102
+ amount: number,
103
+ description: string,
104
+ expirySecs: number,
105
+ ): PaymentMetadata
82
106
  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
107
+ getVariableAmountJitInvoiceWithScid(
108
+ humanReadableScid: string,
109
+ description: string,
110
+ expirySecs: number,
111
+ ): PaymentMetadata
112
+ /**
113
+ * Get a BOLT12 offer for receiving via LSPS4 JIT channel.
114
+ * Use this when the node is already running via start_receiving().
115
+ */
116
+ getBolt12OfferWhileRunning(amount: number, description: string, expirySecs?: number | undefined | null): string
117
+ /**
118
+ * Get a variable amount BOLT12 offer for receiving via LSPS4 JIT channel.
119
+ * Use this when the node is already running via start_receiving().
120
+ */
121
+ getVariableAmountBolt12OfferWhileRunning(description: string, expirySecs?: number | undefined | null): string
122
+ /**
123
+ * Register LSPS4 and sync gossip for BOLT12 receive.
124
+ * Call this on startup if you want to accept payments for existing offers.
125
+ */
126
+ setupBolt12Receive(): void
127
+ /**
128
+ * Unified payment method that auto-detects the destination type.
129
+ *
130
+ * Only supports variable-amount destinations where we set the amount:
131
+ * - BOLT12 offers (lno...)
132
+ * - LNURL (lnurl...)
133
+ * - Lightning addresses (user@domain)
134
+ * - Zero-amount BOLT11 invoices
135
+ *
136
+ * For fixed-amount BOLT11 invoices, amount_msat can be omitted (the invoice amount is used).
137
+ * For variable-amount destinations, amount_msat is required.
138
+ */
139
+ pay(
140
+ destination: string,
141
+ amountMsat?: number | undefined | null,
142
+ waitForPaymentSecs?: number | undefined | null,
143
+ ): string
144
+ /**
145
+ * Unified payment method that auto-detects the destination type.
146
+ * Use this when the node is already running via start_receiving().
147
+ *
148
+ * Supports all destination types:
149
+ * - BOLT11 invoices (fixed or variable amount)
150
+ * - BOLT12 offers (lno...)
151
+ * - LNURL (lnurl...)
152
+ * - Lightning addresses (user@domain)
153
+ *
154
+ * For fixed-amount BOLT11 invoices, amount_msat can be omitted (the invoice amount is used).
155
+ * For variable-amount destinations, amount_msat is required.
156
+ */
157
+ payWhileRunning(
158
+ destination: string,
159
+ amountMsat?: number | undefined | null,
160
+ waitForPaymentSecs?: number | undefined | null,
161
+ ): string
87
162
  }
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.68",
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.68",
84
+ "@moneydevkit/lightning-js-darwin-x64": "0.1.68",
85
+ "@moneydevkit/lightning-js-linux-x64-gnu": "0.1.68",
86
+ "@moneydevkit/lightning-js-linux-x64-musl": "0.1.68",
87
+ "@moneydevkit/lightning-js-linux-arm64-gnu": "0.1.68",
88
+ "@moneydevkit/lightning-js-win32-ia32-msvc": "0.1.68",
89
+ "@moneydevkit/lightning-js-linux-arm-gnueabihf": "0.1.68",
90
+ "@moneydevkit/lightning-js-darwin-arm64": "0.1.68",
91
+ "@moneydevkit/lightning-js-android-arm64": "0.1.68",
92
+ "@moneydevkit/lightning-js-freebsd-x64": "0.1.68",
93
+ "@moneydevkit/lightning-js-linux-arm64-musl": "0.1.68",
94
+ "@moneydevkit/lightning-js-win32-arm64-msvc": "0.1.68",
95
+ "@moneydevkit/lightning-js-android-arm-eabi": "0.1.68"
96
96
  }
97
97
  }