@moneydevkit/lightning-js 0.1.1 → 0.1.3
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/README.md +4 -0
- package/index.d.ts +6 -0
- package/index.js +13 -39
- package/package.json +14 -14
package/README.md
CHANGED
package/index.d.ts
CHANGED
|
@@ -18,8 +18,14 @@ export interface PaymentMetadata {
|
|
|
18
18
|
paymentHash: string
|
|
19
19
|
expiresAt: number
|
|
20
20
|
}
|
|
21
|
+
export interface ReceivedPayment {
|
|
22
|
+
paymentHash: string
|
|
23
|
+
amount: number
|
|
24
|
+
}
|
|
21
25
|
export declare class MdkNode {
|
|
22
26
|
constructor(options: MdkNodeOptions)
|
|
27
|
+
getNodeId(): string
|
|
28
|
+
receivePayment(minThresholdMs: number, quietThresholdMs: number): Array<ReceivedPayment>
|
|
23
29
|
getInvoice(amount: number, description: string, expirySecs: number): PaymentMetadata
|
|
24
30
|
getVariableAmountInvoice(description: string, expirySecs: number): PaymentMetadata
|
|
25
31
|
}
|
package/index.js
CHANGED
|
@@ -62,9 +62,7 @@ switch (platform) {
|
|
|
62
62
|
case 'win32':
|
|
63
63
|
switch (arch) {
|
|
64
64
|
case 'x64':
|
|
65
|
-
localFileExisted = existsSync(
|
|
66
|
-
join(__dirname, 'lightning-js.win32-x64-msvc.node')
|
|
67
|
-
)
|
|
65
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.win32-x64-msvc.node'))
|
|
68
66
|
try {
|
|
69
67
|
if (localFileExisted) {
|
|
70
68
|
nativeBinding = require('./lightning-js.win32-x64-msvc.node')
|
|
@@ -76,9 +74,7 @@ switch (platform) {
|
|
|
76
74
|
}
|
|
77
75
|
break
|
|
78
76
|
case 'ia32':
|
|
79
|
-
localFileExisted = existsSync(
|
|
80
|
-
join(__dirname, 'lightning-js.win32-ia32-msvc.node')
|
|
81
|
-
)
|
|
77
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.win32-ia32-msvc.node'))
|
|
82
78
|
try {
|
|
83
79
|
if (localFileExisted) {
|
|
84
80
|
nativeBinding = require('./lightning-js.win32-ia32-msvc.node')
|
|
@@ -90,9 +86,7 @@ switch (platform) {
|
|
|
90
86
|
}
|
|
91
87
|
break
|
|
92
88
|
case 'arm64':
|
|
93
|
-
localFileExisted = existsSync(
|
|
94
|
-
join(__dirname, 'lightning-js.win32-arm64-msvc.node')
|
|
95
|
-
)
|
|
89
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.win32-arm64-msvc.node'))
|
|
96
90
|
try {
|
|
97
91
|
if (localFileExisted) {
|
|
98
92
|
nativeBinding = require('./lightning-js.win32-arm64-msvc.node')
|
|
@@ -131,9 +125,7 @@ switch (platform) {
|
|
|
131
125
|
}
|
|
132
126
|
break
|
|
133
127
|
case 'arm64':
|
|
134
|
-
localFileExisted = existsSync(
|
|
135
|
-
join(__dirname, 'lightning-js.darwin-arm64.node')
|
|
136
|
-
)
|
|
128
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.darwin-arm64.node'))
|
|
137
129
|
try {
|
|
138
130
|
if (localFileExisted) {
|
|
139
131
|
nativeBinding = require('./lightning-js.darwin-arm64.node')
|
|
@@ -167,9 +159,7 @@ switch (platform) {
|
|
|
167
159
|
switch (arch) {
|
|
168
160
|
case 'x64':
|
|
169
161
|
if (isMusl()) {
|
|
170
|
-
localFileExisted = existsSync(
|
|
171
|
-
join(__dirname, 'lightning-js.linux-x64-musl.node')
|
|
172
|
-
)
|
|
162
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.linux-x64-musl.node'))
|
|
173
163
|
try {
|
|
174
164
|
if (localFileExisted) {
|
|
175
165
|
nativeBinding = require('./lightning-js.linux-x64-musl.node')
|
|
@@ -180,9 +170,7 @@ switch (platform) {
|
|
|
180
170
|
loadError = e
|
|
181
171
|
}
|
|
182
172
|
} else {
|
|
183
|
-
localFileExisted = existsSync(
|
|
184
|
-
join(__dirname, 'lightning-js.linux-x64-gnu.node')
|
|
185
|
-
)
|
|
173
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.linux-x64-gnu.node'))
|
|
186
174
|
try {
|
|
187
175
|
if (localFileExisted) {
|
|
188
176
|
nativeBinding = require('./lightning-js.linux-x64-gnu.node')
|
|
@@ -196,9 +184,7 @@ switch (platform) {
|
|
|
196
184
|
break
|
|
197
185
|
case 'arm64':
|
|
198
186
|
if (isMusl()) {
|
|
199
|
-
localFileExisted = existsSync(
|
|
200
|
-
join(__dirname, 'lightning-js.linux-arm64-musl.node')
|
|
201
|
-
)
|
|
187
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.linux-arm64-musl.node'))
|
|
202
188
|
try {
|
|
203
189
|
if (localFileExisted) {
|
|
204
190
|
nativeBinding = require('./lightning-js.linux-arm64-musl.node')
|
|
@@ -209,9 +195,7 @@ switch (platform) {
|
|
|
209
195
|
loadError = e
|
|
210
196
|
}
|
|
211
197
|
} else {
|
|
212
|
-
localFileExisted = existsSync(
|
|
213
|
-
join(__dirname, 'lightning-js.linux-arm64-gnu.node')
|
|
214
|
-
)
|
|
198
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.linux-arm64-gnu.node'))
|
|
215
199
|
try {
|
|
216
200
|
if (localFileExisted) {
|
|
217
201
|
nativeBinding = require('./lightning-js.linux-arm64-gnu.node')
|
|
@@ -225,9 +209,7 @@ switch (platform) {
|
|
|
225
209
|
break
|
|
226
210
|
case 'arm':
|
|
227
211
|
if (isMusl()) {
|
|
228
|
-
localFileExisted = existsSync(
|
|
229
|
-
join(__dirname, 'lightning-js.linux-arm-musleabihf.node')
|
|
230
|
-
)
|
|
212
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.linux-arm-musleabihf.node'))
|
|
231
213
|
try {
|
|
232
214
|
if (localFileExisted) {
|
|
233
215
|
nativeBinding = require('./lightning-js.linux-arm-musleabihf.node')
|
|
@@ -238,9 +220,7 @@ switch (platform) {
|
|
|
238
220
|
loadError = e
|
|
239
221
|
}
|
|
240
222
|
} else {
|
|
241
|
-
localFileExisted = existsSync(
|
|
242
|
-
join(__dirname, 'lightning-js.linux-arm-gnueabihf.node')
|
|
243
|
-
)
|
|
223
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.linux-arm-gnueabihf.node'))
|
|
244
224
|
try {
|
|
245
225
|
if (localFileExisted) {
|
|
246
226
|
nativeBinding = require('./lightning-js.linux-arm-gnueabihf.node')
|
|
@@ -254,9 +234,7 @@ switch (platform) {
|
|
|
254
234
|
break
|
|
255
235
|
case 'riscv64':
|
|
256
236
|
if (isMusl()) {
|
|
257
|
-
localFileExisted = existsSync(
|
|
258
|
-
join(__dirname, 'lightning-js.linux-riscv64-musl.node')
|
|
259
|
-
)
|
|
237
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.linux-riscv64-musl.node'))
|
|
260
238
|
try {
|
|
261
239
|
if (localFileExisted) {
|
|
262
240
|
nativeBinding = require('./lightning-js.linux-riscv64-musl.node')
|
|
@@ -267,9 +245,7 @@ switch (platform) {
|
|
|
267
245
|
loadError = e
|
|
268
246
|
}
|
|
269
247
|
} else {
|
|
270
|
-
localFileExisted = existsSync(
|
|
271
|
-
join(__dirname, 'lightning-js.linux-riscv64-gnu.node')
|
|
272
|
-
)
|
|
248
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.linux-riscv64-gnu.node'))
|
|
273
249
|
try {
|
|
274
250
|
if (localFileExisted) {
|
|
275
251
|
nativeBinding = require('./lightning-js.linux-riscv64-gnu.node')
|
|
@@ -282,9 +258,7 @@ switch (platform) {
|
|
|
282
258
|
}
|
|
283
259
|
break
|
|
284
260
|
case 's390x':
|
|
285
|
-
localFileExisted = existsSync(
|
|
286
|
-
join(__dirname, 'lightning-js.linux-s390x-gnu.node')
|
|
287
|
-
)
|
|
261
|
+
localFileExisted = existsSync(join(__dirname, 'lightning-js.linux-s390x-gnu.node'))
|
|
288
262
|
try {
|
|
289
263
|
if (localFileExisted) {
|
|
290
264
|
nativeBinding = require('./lightning-js.linux-s390x-gnu.node')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneydevkit/lightning-js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"index.d.ts",
|
|
@@ -96,18 +96,18 @@
|
|
|
96
96
|
"packageManager": "yarn@4.9.1",
|
|
97
97
|
"repository": "https://github.com/moneydevkit/lightning-js",
|
|
98
98
|
"optionalDependencies": {
|
|
99
|
-
"@moneydevkit/lightning-js-win32-x64-msvc": "0.1.
|
|
100
|
-
"@moneydevkit/lightning-js-darwin-x64": "0.1.
|
|
101
|
-
"@moneydevkit/lightning-js-linux-x64-gnu": "0.1.
|
|
102
|
-
"@moneydevkit/lightning-js-linux-x64-musl": "0.1.
|
|
103
|
-
"@moneydevkit/lightning-js-linux-arm64-gnu": "0.1.
|
|
104
|
-
"@moneydevkit/lightning-js-win32-ia32-msvc": "0.1.
|
|
105
|
-
"@moneydevkit/lightning-js-linux-arm-gnueabihf": "0.1.
|
|
106
|
-
"@moneydevkit/lightning-js-darwin-arm64": "0.1.
|
|
107
|
-
"@moneydevkit/lightning-js-android-arm64": "0.1.
|
|
108
|
-
"@moneydevkit/lightning-js-freebsd-x64": "0.1.
|
|
109
|
-
"@moneydevkit/lightning-js-linux-arm64-musl": "0.1.
|
|
110
|
-
"@moneydevkit/lightning-js-win32-arm64-msvc": "0.1.
|
|
111
|
-
"@moneydevkit/lightning-js-android-arm-eabi": "0.1.
|
|
99
|
+
"@moneydevkit/lightning-js-win32-x64-msvc": "0.1.3",
|
|
100
|
+
"@moneydevkit/lightning-js-darwin-x64": "0.1.3",
|
|
101
|
+
"@moneydevkit/lightning-js-linux-x64-gnu": "0.1.3",
|
|
102
|
+
"@moneydevkit/lightning-js-linux-x64-musl": "0.1.3",
|
|
103
|
+
"@moneydevkit/lightning-js-linux-arm64-gnu": "0.1.3",
|
|
104
|
+
"@moneydevkit/lightning-js-win32-ia32-msvc": "0.1.3",
|
|
105
|
+
"@moneydevkit/lightning-js-linux-arm-gnueabihf": "0.1.3",
|
|
106
|
+
"@moneydevkit/lightning-js-darwin-arm64": "0.1.3",
|
|
107
|
+
"@moneydevkit/lightning-js-android-arm64": "0.1.3",
|
|
108
|
+
"@moneydevkit/lightning-js-freebsd-x64": "0.1.3",
|
|
109
|
+
"@moneydevkit/lightning-js-linux-arm64-musl": "0.1.3",
|
|
110
|
+
"@moneydevkit/lightning-js-win32-arm64-msvc": "0.1.3",
|
|
111
|
+
"@moneydevkit/lightning-js-android-arm-eabi": "0.1.3"
|
|
112
112
|
}
|
|
113
113
|
}
|