@moneydevkit/lightning-js 0.1.64 → 0.1.66
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.
- package/index.d.ts +9 -16
- package/index.js +41 -14
- package/package.json +14 -14
package/index.d.ts
CHANGED
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
|
-
export declare function setLogListener(
|
|
7
|
-
callback?: (...args: any[]) => any | undefined | null,
|
|
8
|
-
minLevel?: string | undefined | null,
|
|
9
|
-
): void
|
|
6
|
+
export declare function setLogListener(callback?: (...args: any[]) => any | undefined | null, minLevel?: string | undefined | null): void
|
|
10
7
|
export declare function generateMnemonic(): string
|
|
11
8
|
export interface MdkNodeOptions {
|
|
12
9
|
network: string
|
|
@@ -29,11 +26,16 @@ export interface ReceivedPayment {
|
|
|
29
26
|
amount: number
|
|
30
27
|
}
|
|
31
28
|
export interface PaymentEvent {
|
|
32
|
-
eventType:
|
|
29
|
+
eventType: PaymentEventType
|
|
33
30
|
paymentHash: string
|
|
34
31
|
amountMsat?: number
|
|
35
32
|
reason?: string
|
|
36
33
|
}
|
|
34
|
+
export const enum PaymentEventType {
|
|
35
|
+
Claimable = 0,
|
|
36
|
+
Received = 1,
|
|
37
|
+
Failed = 2
|
|
38
|
+
}
|
|
37
39
|
export interface NodeChannel {
|
|
38
40
|
channelId: string
|
|
39
41
|
counterpartyNodeId: string
|
|
@@ -76,18 +78,9 @@ export declare class MdkNode {
|
|
|
76
78
|
syncRgs(doFullSync: boolean): number
|
|
77
79
|
receivePayment(minThresholdMs: number, quietThresholdMs: number): Array<ReceivedPayment>
|
|
78
80
|
getInvoice(amount: number, description: string, expirySecs: number): PaymentMetadata
|
|
79
|
-
getInvoiceWithScid(
|
|
80
|
-
humanReadableScid: string,
|
|
81
|
-
amount: number,
|
|
82
|
-
description: string,
|
|
83
|
-
expirySecs: number,
|
|
84
|
-
): PaymentMetadata
|
|
81
|
+
getInvoiceWithScid(humanReadableScid: string, amount: number, description: string, expirySecs: number): PaymentMetadata
|
|
85
82
|
getVariableAmountJitInvoice(description: string, expirySecs: number): PaymentMetadata
|
|
86
|
-
getVariableAmountJitInvoiceWithScid(
|
|
87
|
-
humanReadableScid: string,
|
|
88
|
-
description: string,
|
|
89
|
-
expirySecs: number,
|
|
90
|
-
): PaymentMetadata
|
|
83
|
+
getVariableAmountJitInvoiceWithScid(humanReadableScid: string, description: string, expirySecs: number): PaymentMetadata
|
|
91
84
|
payLnurl(lnurl: string, amountMsat: number, waitForPaymentSecs?: number | undefined | null): string
|
|
92
85
|
payBolt11(bolt11Invoice: string): string
|
|
93
86
|
payBolt12Offer(bolt12OfferString: string, amountMsat: number, waitForPaymentSecs?: number | undefined | null): string
|
package/index.js
CHANGED
|
@@ -62,7 +62,9 @@ switch (platform) {
|
|
|
62
62
|
case 'win32':
|
|
63
63
|
switch (arch) {
|
|
64
64
|
case 'x64':
|
|
65
|
-
localFileExisted = existsSync(
|
|
65
|
+
localFileExisted = existsSync(
|
|
66
|
+
join(__dirname, 'lightning-js.win32-x64-msvc.node')
|
|
67
|
+
)
|
|
66
68
|
try {
|
|
67
69
|
if (localFileExisted) {
|
|
68
70
|
nativeBinding = require('./lightning-js.win32-x64-msvc.node')
|
|
@@ -74,7 +76,9 @@ switch (platform) {
|
|
|
74
76
|
}
|
|
75
77
|
break
|
|
76
78
|
case 'ia32':
|
|
77
|
-
localFileExisted = existsSync(
|
|
79
|
+
localFileExisted = existsSync(
|
|
80
|
+
join(__dirname, 'lightning-js.win32-ia32-msvc.node')
|
|
81
|
+
)
|
|
78
82
|
try {
|
|
79
83
|
if (localFileExisted) {
|
|
80
84
|
nativeBinding = require('./lightning-js.win32-ia32-msvc.node')
|
|
@@ -86,7 +90,9 @@ switch (platform) {
|
|
|
86
90
|
}
|
|
87
91
|
break
|
|
88
92
|
case 'arm64':
|
|
89
|
-
localFileExisted = existsSync(
|
|
93
|
+
localFileExisted = existsSync(
|
|
94
|
+
join(__dirname, 'lightning-js.win32-arm64-msvc.node')
|
|
95
|
+
)
|
|
90
96
|
try {
|
|
91
97
|
if (localFileExisted) {
|
|
92
98
|
nativeBinding = require('./lightning-js.win32-arm64-msvc.node')
|
|
@@ -125,7 +131,9 @@ switch (platform) {
|
|
|
125
131
|
}
|
|
126
132
|
break
|
|
127
133
|
case 'arm64':
|
|
128
|
-
localFileExisted = existsSync(
|
|
134
|
+
localFileExisted = existsSync(
|
|
135
|
+
join(__dirname, 'lightning-js.darwin-arm64.node')
|
|
136
|
+
)
|
|
129
137
|
try {
|
|
130
138
|
if (localFileExisted) {
|
|
131
139
|
nativeBinding = require('./lightning-js.darwin-arm64.node')
|
|
@@ -159,7 +167,9 @@ switch (platform) {
|
|
|
159
167
|
switch (arch) {
|
|
160
168
|
case 'x64':
|
|
161
169
|
if (isMusl()) {
|
|
162
|
-
localFileExisted = existsSync(
|
|
170
|
+
localFileExisted = existsSync(
|
|
171
|
+
join(__dirname, 'lightning-js.linux-x64-musl.node')
|
|
172
|
+
)
|
|
163
173
|
try {
|
|
164
174
|
if (localFileExisted) {
|
|
165
175
|
nativeBinding = require('./lightning-js.linux-x64-musl.node')
|
|
@@ -170,7 +180,9 @@ switch (platform) {
|
|
|
170
180
|
loadError = e
|
|
171
181
|
}
|
|
172
182
|
} else {
|
|
173
|
-
localFileExisted = existsSync(
|
|
183
|
+
localFileExisted = existsSync(
|
|
184
|
+
join(__dirname, 'lightning-js.linux-x64-gnu.node')
|
|
185
|
+
)
|
|
174
186
|
try {
|
|
175
187
|
if (localFileExisted) {
|
|
176
188
|
nativeBinding = require('./lightning-js.linux-x64-gnu.node')
|
|
@@ -184,7 +196,9 @@ switch (platform) {
|
|
|
184
196
|
break
|
|
185
197
|
case 'arm64':
|
|
186
198
|
if (isMusl()) {
|
|
187
|
-
localFileExisted = existsSync(
|
|
199
|
+
localFileExisted = existsSync(
|
|
200
|
+
join(__dirname, 'lightning-js.linux-arm64-musl.node')
|
|
201
|
+
)
|
|
188
202
|
try {
|
|
189
203
|
if (localFileExisted) {
|
|
190
204
|
nativeBinding = require('./lightning-js.linux-arm64-musl.node')
|
|
@@ -195,7 +209,9 @@ switch (platform) {
|
|
|
195
209
|
loadError = e
|
|
196
210
|
}
|
|
197
211
|
} else {
|
|
198
|
-
localFileExisted = existsSync(
|
|
212
|
+
localFileExisted = existsSync(
|
|
213
|
+
join(__dirname, 'lightning-js.linux-arm64-gnu.node')
|
|
214
|
+
)
|
|
199
215
|
try {
|
|
200
216
|
if (localFileExisted) {
|
|
201
217
|
nativeBinding = require('./lightning-js.linux-arm64-gnu.node')
|
|
@@ -209,7 +225,9 @@ switch (platform) {
|
|
|
209
225
|
break
|
|
210
226
|
case 'arm':
|
|
211
227
|
if (isMusl()) {
|
|
212
|
-
localFileExisted = existsSync(
|
|
228
|
+
localFileExisted = existsSync(
|
|
229
|
+
join(__dirname, 'lightning-js.linux-arm-musleabihf.node')
|
|
230
|
+
)
|
|
213
231
|
try {
|
|
214
232
|
if (localFileExisted) {
|
|
215
233
|
nativeBinding = require('./lightning-js.linux-arm-musleabihf.node')
|
|
@@ -220,7 +238,9 @@ switch (platform) {
|
|
|
220
238
|
loadError = e
|
|
221
239
|
}
|
|
222
240
|
} else {
|
|
223
|
-
localFileExisted = existsSync(
|
|
241
|
+
localFileExisted = existsSync(
|
|
242
|
+
join(__dirname, 'lightning-js.linux-arm-gnueabihf.node')
|
|
243
|
+
)
|
|
224
244
|
try {
|
|
225
245
|
if (localFileExisted) {
|
|
226
246
|
nativeBinding = require('./lightning-js.linux-arm-gnueabihf.node')
|
|
@@ -234,7 +254,9 @@ switch (platform) {
|
|
|
234
254
|
break
|
|
235
255
|
case 'riscv64':
|
|
236
256
|
if (isMusl()) {
|
|
237
|
-
localFileExisted = existsSync(
|
|
257
|
+
localFileExisted = existsSync(
|
|
258
|
+
join(__dirname, 'lightning-js.linux-riscv64-musl.node')
|
|
259
|
+
)
|
|
238
260
|
try {
|
|
239
261
|
if (localFileExisted) {
|
|
240
262
|
nativeBinding = require('./lightning-js.linux-riscv64-musl.node')
|
|
@@ -245,7 +267,9 @@ switch (platform) {
|
|
|
245
267
|
loadError = e
|
|
246
268
|
}
|
|
247
269
|
} else {
|
|
248
|
-
localFileExisted = existsSync(
|
|
270
|
+
localFileExisted = existsSync(
|
|
271
|
+
join(__dirname, 'lightning-js.linux-riscv64-gnu.node')
|
|
272
|
+
)
|
|
249
273
|
try {
|
|
250
274
|
if (localFileExisted) {
|
|
251
275
|
nativeBinding = require('./lightning-js.linux-riscv64-gnu.node')
|
|
@@ -258,7 +282,9 @@ switch (platform) {
|
|
|
258
282
|
}
|
|
259
283
|
break
|
|
260
284
|
case 's390x':
|
|
261
|
-
localFileExisted = existsSync(
|
|
285
|
+
localFileExisted = existsSync(
|
|
286
|
+
join(__dirname, 'lightning-js.linux-s390x-gnu.node')
|
|
287
|
+
)
|
|
262
288
|
try {
|
|
263
289
|
if (localFileExisted) {
|
|
264
290
|
nativeBinding = require('./lightning-js.linux-s390x-gnu.node')
|
|
@@ -284,8 +310,9 @@ if (!nativeBinding) {
|
|
|
284
310
|
throw new Error(`Failed to load native binding`)
|
|
285
311
|
}
|
|
286
312
|
|
|
287
|
-
const { setLogListener, generateMnemonic, MdkNode } = nativeBinding
|
|
313
|
+
const { setLogListener, generateMnemonic, PaymentEventType, MdkNode } = nativeBinding
|
|
288
314
|
|
|
289
315
|
module.exports.setLogListener = setLogListener
|
|
290
316
|
module.exports.generateMnemonic = generateMnemonic
|
|
317
|
+
module.exports.PaymentEventType = PaymentEventType
|
|
291
318
|
module.exports.MdkNode = MdkNode
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneydevkit/lightning-js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.66",
|
|
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.
|
|
84
|
-
"@moneydevkit/lightning-js-darwin-x64": "0.1.
|
|
85
|
-
"@moneydevkit/lightning-js-linux-x64-gnu": "0.1.
|
|
86
|
-
"@moneydevkit/lightning-js-linux-x64-musl": "0.1.
|
|
87
|
-
"@moneydevkit/lightning-js-linux-arm64-gnu": "0.1.
|
|
88
|
-
"@moneydevkit/lightning-js-win32-ia32-msvc": "0.1.
|
|
89
|
-
"@moneydevkit/lightning-js-linux-arm-gnueabihf": "0.1.
|
|
90
|
-
"@moneydevkit/lightning-js-darwin-arm64": "0.1.
|
|
91
|
-
"@moneydevkit/lightning-js-android-arm64": "0.1.
|
|
92
|
-
"@moneydevkit/lightning-js-freebsd-x64": "0.1.
|
|
93
|
-
"@moneydevkit/lightning-js-linux-arm64-musl": "0.1.
|
|
94
|
-
"@moneydevkit/lightning-js-win32-arm64-msvc": "0.1.
|
|
95
|
-
"@moneydevkit/lightning-js-android-arm-eabi": "0.1.
|
|
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"
|
|
96
96
|
}
|
|
97
97
|
}
|