@lightsparkdev/lightspark-sdk 1.5.6 → 1.5.7
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/CHANGELOG.md +9 -0
- package/dist/index.cjs +7 -7
- package/dist/index.js +7 -7
- package/package.json +7 -7
- package/src/tests/integration/general-regtest.test.ts +19 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @lightsparkdev/lightspark-sdk
|
|
2
2
|
|
|
3
|
+
## 1.5.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 062bf8a: [js] Add engines field to all packages to indicate supported NodeJS versions
|
|
8
|
+
- Updated dependencies [062bf8a]
|
|
9
|
+
- @lightsparkdev/crypto-wasm@0.1.3
|
|
10
|
+
- @lightsparkdev/core@1.0.18
|
|
11
|
+
|
|
3
12
|
## 1.5.6
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1949,7 +1949,7 @@ var import_core9 = require("@lightsparkdev/core");
|
|
|
1949
1949
|
// package.json
|
|
1950
1950
|
var package_default = {
|
|
1951
1951
|
name: "@lightsparkdev/lightspark-sdk",
|
|
1952
|
-
version: "1.5.
|
|
1952
|
+
version: "1.5.7",
|
|
1953
1953
|
description: "Lightspark JS SDK",
|
|
1954
1954
|
author: "Lightspark Inc.",
|
|
1955
1955
|
keywords: [
|
|
@@ -1967,9 +1967,6 @@ var package_default = {
|
|
|
1967
1967
|
bugs: {
|
|
1968
1968
|
url: "https://github.com/lightsparkdev/js-sdk/issues"
|
|
1969
1969
|
},
|
|
1970
|
-
engines: {
|
|
1971
|
-
node: ">=18.17.0"
|
|
1972
|
-
},
|
|
1973
1970
|
exports: {
|
|
1974
1971
|
".": {
|
|
1975
1972
|
types: "./dist/index.d.ts",
|
|
@@ -2037,8 +2034,8 @@ var package_default = {
|
|
|
2037
2034
|
},
|
|
2038
2035
|
license: "Apache-2.0",
|
|
2039
2036
|
dependencies: {
|
|
2040
|
-
"@lightsparkdev/core": "1.0.
|
|
2041
|
-
"@lightsparkdev/crypto-wasm": "0.1.
|
|
2037
|
+
"@lightsparkdev/core": "1.0.18",
|
|
2038
|
+
"@lightsparkdev/crypto-wasm": "0.1.3",
|
|
2042
2039
|
"auto-bind": "^5.0.1",
|
|
2043
2040
|
"crypto-browserify": "^3.12.0",
|
|
2044
2041
|
dayjs: "^1.11.7",
|
|
@@ -2050,7 +2047,7 @@ var package_default = {
|
|
|
2050
2047
|
},
|
|
2051
2048
|
devDependencies: {
|
|
2052
2049
|
"@lightsparkdev/eslint-config": "*",
|
|
2053
|
-
"@lightsparkdev/tsconfig": "0.0.
|
|
2050
|
+
"@lightsparkdev/tsconfig": "0.0.1",
|
|
2054
2051
|
"@types/crypto-js": "^4.1.1",
|
|
2055
2052
|
"@types/jest": "^29.5.3",
|
|
2056
2053
|
"@types/node": "^20.2.5",
|
|
@@ -2065,6 +2062,9 @@ var package_default = {
|
|
|
2065
2062
|
tsup: "^7.2.0",
|
|
2066
2063
|
typedoc: "^0.24.7",
|
|
2067
2064
|
typescript: "^5.0.0"
|
|
2065
|
+
},
|
|
2066
|
+
engines: {
|
|
2067
|
+
node: ">=18"
|
|
2068
2068
|
}
|
|
2069
2069
|
};
|
|
2070
2070
|
|
package/dist/index.js
CHANGED
|
@@ -146,7 +146,7 @@ import {
|
|
|
146
146
|
// package.json
|
|
147
147
|
var package_default = {
|
|
148
148
|
name: "@lightsparkdev/lightspark-sdk",
|
|
149
|
-
version: "1.5.
|
|
149
|
+
version: "1.5.7",
|
|
150
150
|
description: "Lightspark JS SDK",
|
|
151
151
|
author: "Lightspark Inc.",
|
|
152
152
|
keywords: [
|
|
@@ -164,9 +164,6 @@ var package_default = {
|
|
|
164
164
|
bugs: {
|
|
165
165
|
url: "https://github.com/lightsparkdev/js-sdk/issues"
|
|
166
166
|
},
|
|
167
|
-
engines: {
|
|
168
|
-
node: ">=18.17.0"
|
|
169
|
-
},
|
|
170
167
|
exports: {
|
|
171
168
|
".": {
|
|
172
169
|
types: "./dist/index.d.ts",
|
|
@@ -234,8 +231,8 @@ var package_default = {
|
|
|
234
231
|
},
|
|
235
232
|
license: "Apache-2.0",
|
|
236
233
|
dependencies: {
|
|
237
|
-
"@lightsparkdev/core": "1.0.
|
|
238
|
-
"@lightsparkdev/crypto-wasm": "0.1.
|
|
234
|
+
"@lightsparkdev/core": "1.0.18",
|
|
235
|
+
"@lightsparkdev/crypto-wasm": "0.1.3",
|
|
239
236
|
"auto-bind": "^5.0.1",
|
|
240
237
|
"crypto-browserify": "^3.12.0",
|
|
241
238
|
dayjs: "^1.11.7",
|
|
@@ -247,7 +244,7 @@ var package_default = {
|
|
|
247
244
|
},
|
|
248
245
|
devDependencies: {
|
|
249
246
|
"@lightsparkdev/eslint-config": "*",
|
|
250
|
-
"@lightsparkdev/tsconfig": "0.0.
|
|
247
|
+
"@lightsparkdev/tsconfig": "0.0.1",
|
|
251
248
|
"@types/crypto-js": "^4.1.1",
|
|
252
249
|
"@types/jest": "^29.5.3",
|
|
253
250
|
"@types/node": "^20.2.5",
|
|
@@ -262,6 +259,9 @@ var package_default = {
|
|
|
262
259
|
tsup: "^7.2.0",
|
|
263
260
|
typedoc: "^0.24.7",
|
|
264
261
|
typescript: "^5.0.0"
|
|
262
|
+
},
|
|
263
|
+
engines: {
|
|
264
|
+
node: ">=18"
|
|
265
265
|
}
|
|
266
266
|
};
|
|
267
267
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightsparkdev/lightspark-sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.7",
|
|
4
4
|
"description": "Lightspark JS SDK",
|
|
5
5
|
"author": "Lightspark Inc.",
|
|
6
6
|
"keywords": [
|
|
@@ -18,9 +18,6 @@
|
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/lightsparkdev/js-sdk/issues"
|
|
20
20
|
},
|
|
21
|
-
"engines": {
|
|
22
|
-
"node": ">=18.17.0"
|
|
23
|
-
},
|
|
24
21
|
"exports": {
|
|
25
22
|
".": {
|
|
26
23
|
"types": "./dist/index.d.ts",
|
|
@@ -88,8 +85,8 @@
|
|
|
88
85
|
},
|
|
89
86
|
"license": "Apache-2.0",
|
|
90
87
|
"dependencies": {
|
|
91
|
-
"@lightsparkdev/core": "1.0.
|
|
92
|
-
"@lightsparkdev/crypto-wasm": "0.1.
|
|
88
|
+
"@lightsparkdev/core": "1.0.18",
|
|
89
|
+
"@lightsparkdev/crypto-wasm": "0.1.3",
|
|
93
90
|
"auto-bind": "^5.0.1",
|
|
94
91
|
"crypto-browserify": "^3.12.0",
|
|
95
92
|
"dayjs": "^1.11.7",
|
|
@@ -101,7 +98,7 @@
|
|
|
101
98
|
},
|
|
102
99
|
"devDependencies": {
|
|
103
100
|
"@lightsparkdev/eslint-config": "*",
|
|
104
|
-
"@lightsparkdev/tsconfig": "0.0.
|
|
101
|
+
"@lightsparkdev/tsconfig": "0.0.1",
|
|
105
102
|
"@types/crypto-js": "^4.1.1",
|
|
106
103
|
"@types/jest": "^29.5.3",
|
|
107
104
|
"@types/node": "^20.2.5",
|
|
@@ -116,5 +113,8 @@
|
|
|
116
113
|
"tsup": "^7.2.0",
|
|
117
114
|
"typedoc": "^0.24.7",
|
|
118
115
|
"typescript": "^5.0.0"
|
|
116
|
+
},
|
|
117
|
+
"engines": {
|
|
118
|
+
"node": ">=18"
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -111,12 +111,12 @@ async function getRegtestNode() {
|
|
|
111
111
|
return regtestNode;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
const createTestModePayment = async () => {
|
|
114
|
+
const createTestModePayment = async (invoiceMemo = "hi there!") => {
|
|
115
115
|
const regtestNodeId = getRegtestNodeId();
|
|
116
116
|
const testInvoice = await lightsparkClient.createInvoice(
|
|
117
117
|
regtestNodeId,
|
|
118
118
|
10_000,
|
|
119
|
-
|
|
119
|
+
invoiceMemo,
|
|
120
120
|
);
|
|
121
121
|
|
|
122
122
|
if (!testInvoice) {
|
|
@@ -228,20 +228,20 @@ describe(initSuiteName, () => {
|
|
|
228
228
|
});
|
|
229
229
|
|
|
230
230
|
describe(p0SuiteName, () => {
|
|
231
|
-
test("Should create a
|
|
231
|
+
test("Should create a standard payment invoice", async () => {
|
|
232
232
|
paymentInvoice = await lightsparkClient.createInvoice(
|
|
233
233
|
getRegtestNodeId(),
|
|
234
234
|
10_000,
|
|
235
|
-
"
|
|
235
|
+
"Standard payment invoice memo",
|
|
236
236
|
);
|
|
237
237
|
expect(paymentInvoice).toBeDefined();
|
|
238
|
-
});
|
|
238
|
+
}, 10_000);
|
|
239
239
|
|
|
240
240
|
test("Should create a AMP type invoice", async () => {
|
|
241
241
|
const AmpPaymentInvoice = await lightsparkClient.createInvoice(
|
|
242
242
|
getRegtestNodeId(),
|
|
243
243
|
10_000,
|
|
244
|
-
"
|
|
244
|
+
"AMP payment invoice memo",
|
|
245
245
|
InvoiceType.AMP,
|
|
246
246
|
);
|
|
247
247
|
expect(AmpPaymentInvoice).toBeDefined();
|
|
@@ -252,7 +252,7 @@ describe(p0SuiteName, () => {
|
|
|
252
252
|
await lightsparkClient.createInvoice(
|
|
253
253
|
getRegtestNodeId(),
|
|
254
254
|
10_000,
|
|
255
|
-
"
|
|
255
|
+
"Invoice with custom expiration memo",
|
|
256
256
|
InvoiceType.STANDARD,
|
|
257
257
|
INVOICE_EXPIRY,
|
|
258
258
|
);
|
|
@@ -263,7 +263,7 @@ describe(p0SuiteName, () => {
|
|
|
263
263
|
const AnyPaymentAmountInvoice = await lightsparkClient.createInvoice(
|
|
264
264
|
getRegtestNodeId(),
|
|
265
265
|
0,
|
|
266
|
-
"
|
|
266
|
+
"Any amount invoice memo",
|
|
267
267
|
InvoiceType.STANDARD,
|
|
268
268
|
INVOICE_EXPIRY,
|
|
269
269
|
);
|
|
@@ -275,7 +275,7 @@ describe(p0SuiteName, () => {
|
|
|
275
275
|
unauthorizedLightsparkClient.createInvoice(
|
|
276
276
|
getRegtestNodeId(),
|
|
277
277
|
0,
|
|
278
|
-
"
|
|
278
|
+
"Unauthorized invoice memo",
|
|
279
279
|
),
|
|
280
280
|
).rejects.toThrowError();
|
|
281
281
|
});
|
|
@@ -353,7 +353,7 @@ describe(p0SuiteName, () => {
|
|
|
353
353
|
const testInvoice = await lightsparkClient.createTestModeInvoice(
|
|
354
354
|
getRegtestNodeId(),
|
|
355
355
|
round(satsToFund / 4), // should be some small fraction of the sats we know we have from earlier funding test
|
|
356
|
-
"
|
|
356
|
+
"Attempt to pay test invoice memo",
|
|
357
357
|
);
|
|
358
358
|
|
|
359
359
|
if (!testInvoice) {
|
|
@@ -372,7 +372,9 @@ describe(p0SuiteName, () => {
|
|
|
372
372
|
test(
|
|
373
373
|
"Should open just-in-time channel from inbound payment",
|
|
374
374
|
async () => {
|
|
375
|
-
const payment = await createTestModePayment(
|
|
375
|
+
const payment = await createTestModePayment(
|
|
376
|
+
"Just-in-time channel payment memo",
|
|
377
|
+
);
|
|
376
378
|
const { status } = await lightsparkClient.waitForTransactionComplete(
|
|
377
379
|
payment.id,
|
|
378
380
|
TRANSACTION_WAIT_TIME,
|
|
@@ -404,10 +406,10 @@ describe(p1SuiteName, () => {
|
|
|
404
406
|
);
|
|
405
407
|
|
|
406
408
|
test(
|
|
407
|
-
"Should
|
|
409
|
+
"Should list current payment requests",
|
|
408
410
|
async () => {
|
|
409
411
|
for (let i = 0; i < PAGINATION_STEP; i++) {
|
|
410
|
-
await createTestModePayment();
|
|
412
|
+
await createTestModePayment(`Recent payment request ${i} memo`);
|
|
411
413
|
}
|
|
412
414
|
const requests = await lightsparkClient.getRecentPaymentRequests(
|
|
413
415
|
getRegtestNodeId(),
|
|
@@ -489,7 +491,7 @@ describe(p1SuiteName, () => {
|
|
|
489
491
|
const umaInvoice = await lightsparkClient.createUmaInvoice(
|
|
490
492
|
getRegtestNodeId(),
|
|
491
493
|
10_000,
|
|
492
|
-
"
|
|
494
|
+
"UMA invoice memo",
|
|
493
495
|
);
|
|
494
496
|
expect(umaInvoice).toBeDefined();
|
|
495
497
|
const cancelledInvoice = await lightsparkClient.cancelInvoice(
|
|
@@ -500,12 +502,12 @@ describe(p1SuiteName, () => {
|
|
|
500
502
|
});
|
|
501
503
|
|
|
502
504
|
test(
|
|
503
|
-
"Should create
|
|
505
|
+
"Should create standard a test mode invoice",
|
|
504
506
|
async () => {
|
|
505
507
|
testModeInvoices.withMemo = await lightsparkClient.createTestModeInvoice(
|
|
506
508
|
getRegtestNodeId(),
|
|
507
509
|
10_000,
|
|
508
|
-
"
|
|
510
|
+
"Standard test mode invoice memo",
|
|
509
511
|
);
|
|
510
512
|
expect(testModeInvoices.withMemo).not.toBeNull();
|
|
511
513
|
},
|
|
@@ -544,7 +546,7 @@ describe(p1SuiteName, () => {
|
|
|
544
546
|
const invoiceForTestPayment = await lightsparkClient.createInvoice(
|
|
545
547
|
regtestNodeId,
|
|
546
548
|
10_000,
|
|
547
|
-
"
|
|
549
|
+
"Create test mode payment invoice memo",
|
|
548
550
|
);
|
|
549
551
|
|
|
550
552
|
if (!invoiceForTestPayment) {
|