@lightsparkdev/lightspark-sdk 0.2.0 → 0.2.1
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 +8 -0
- package/dist/chunk-5Z7FB6OT.js +5530 -0
- package/dist/index.cjs +108 -3
- package/dist/index.js +107 -4
- package/dist/objects/index.js +1 -1
- package/package.json +2 -2
- package/src/client.ts +7 -3
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
8
11
|
var __export = (target, all) => {
|
|
9
12
|
for (var name in all)
|
|
10
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -27,6 +30,104 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
30
|
));
|
|
28
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
32
|
|
|
33
|
+
// package.json
|
|
34
|
+
var require_package = __commonJS({
|
|
35
|
+
"package.json"(exports, module2) {
|
|
36
|
+
module2.exports = {
|
|
37
|
+
name: "@lightsparkdev/lightspark-sdk",
|
|
38
|
+
version: "0.2.1",
|
|
39
|
+
description: "Lightspark JS SDK",
|
|
40
|
+
author: "Lightspark Inc.",
|
|
41
|
+
keywords: [
|
|
42
|
+
"lightspark",
|
|
43
|
+
"bitcoin",
|
|
44
|
+
"lightning",
|
|
45
|
+
"payments",
|
|
46
|
+
"typescript"
|
|
47
|
+
],
|
|
48
|
+
homepage: "https://github.com/lightsparkdev/js-sdk",
|
|
49
|
+
repository: {
|
|
50
|
+
type: "git",
|
|
51
|
+
url: "https://github.com/lightsparkdev/js-sdk.git"
|
|
52
|
+
},
|
|
53
|
+
bugs: {
|
|
54
|
+
url: "https://github.com/lightsparkdev/js-sdk/issues"
|
|
55
|
+
},
|
|
56
|
+
engines: {
|
|
57
|
+
node: ">=14.16"
|
|
58
|
+
},
|
|
59
|
+
exports: {
|
|
60
|
+
".": {
|
|
61
|
+
types: "./dist/index.d.ts",
|
|
62
|
+
import: {
|
|
63
|
+
types: "./dist/index.d.ts",
|
|
64
|
+
default: "./dist/index.js"
|
|
65
|
+
},
|
|
66
|
+
module: "./dist/index.js",
|
|
67
|
+
require: "./dist/index.cjs",
|
|
68
|
+
default: "./dist/index.cjs"
|
|
69
|
+
},
|
|
70
|
+
"./objects": {
|
|
71
|
+
types: "./dist/objects/index.d.ts",
|
|
72
|
+
import: {
|
|
73
|
+
types: "./dist/objects/index.d.ts",
|
|
74
|
+
default: "./dist/objects/index.js"
|
|
75
|
+
},
|
|
76
|
+
module: "./dist/objects/index.js",
|
|
77
|
+
require: "./dist/objects/index.cjs",
|
|
78
|
+
default: "./dist/objects/index.cjs"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
type: "module",
|
|
82
|
+
types: "./dist/index.d.ts",
|
|
83
|
+
main: "./dist/index.js",
|
|
84
|
+
module: "./dist/index.js",
|
|
85
|
+
browser: {
|
|
86
|
+
crypto: false
|
|
87
|
+
},
|
|
88
|
+
files: [
|
|
89
|
+
"src/*",
|
|
90
|
+
"dist/*",
|
|
91
|
+
"CHANGELOG.md"
|
|
92
|
+
],
|
|
93
|
+
scripts: {
|
|
94
|
+
build: "tsup --entry src/index.ts --entry src/objects/index.ts --format cjs,esm --dts",
|
|
95
|
+
"copy-static": "cp ./package.json ./README.md ./LICENSE ./dist/",
|
|
96
|
+
dev: "yarn build -- --watch",
|
|
97
|
+
clean: "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
98
|
+
lint: "npx prettier --check ./src",
|
|
99
|
+
format: "npx prettier --write ./src",
|
|
100
|
+
test: "tsc --noEmit --project tsconfig-test.json && jest --no-cache --runInBand --bail",
|
|
101
|
+
"type-check": "tsc --noEmit",
|
|
102
|
+
postversion: "yarn build"
|
|
103
|
+
},
|
|
104
|
+
license: "Apache-2.0",
|
|
105
|
+
dependencies: {
|
|
106
|
+
"@lightsparkdev/core": "^0.2.1",
|
|
107
|
+
"auto-bind": "^5.0.1",
|
|
108
|
+
crypto: "^1.0.1",
|
|
109
|
+
"crypto-browserify": "^3.12.0",
|
|
110
|
+
dayjs: "^1.11.7",
|
|
111
|
+
graphql: "^16.6.0",
|
|
112
|
+
"graphql-ws": "^5.11.3",
|
|
113
|
+
ws: "^8.12.1",
|
|
114
|
+
"zen-observable-ts": "^1.1.0"
|
|
115
|
+
},
|
|
116
|
+
devDependencies: {
|
|
117
|
+
"@types/crypto-js": "^4.1.1",
|
|
118
|
+
"@types/ws": "^8.5.4",
|
|
119
|
+
jest: "^29.4.1",
|
|
120
|
+
prettier: "^2.8.4",
|
|
121
|
+
"prettier-plugin-organize-imports": "^3.2.2",
|
|
122
|
+
"ts-jest": "^29.0.5",
|
|
123
|
+
"ts-node": "^10.9.1",
|
|
124
|
+
typescript: "^4.9.5",
|
|
125
|
+
tsconfig: "*"
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
30
131
|
// src/index.ts
|
|
31
132
|
var src_exports = {};
|
|
32
133
|
__export(src_exports, {
|
|
@@ -5080,9 +5181,11 @@ var LightsparkClient = class {
|
|
|
5080
5181
|
this.authProvider = authProvider;
|
|
5081
5182
|
this.serverUrl = serverUrl;
|
|
5082
5183
|
this.nodeKeyCache = nodeKeyCache;
|
|
5184
|
+
const sdkVersion = require_package().version;
|
|
5083
5185
|
this.requester = new import_core6.Requester(
|
|
5084
5186
|
this.nodeKeyCache,
|
|
5085
|
-
|
|
5187
|
+
LIGHTSPARK_SDK_ENDPOINT,
|
|
5188
|
+
`js-lightspark-sdk/${sdkVersion}`,
|
|
5086
5189
|
authProvider,
|
|
5087
5190
|
serverUrl
|
|
5088
5191
|
);
|
|
@@ -5096,9 +5199,11 @@ var LightsparkClient = class {
|
|
|
5096
5199
|
* @param authProvider
|
|
5097
5200
|
*/
|
|
5098
5201
|
async setAuthProvider(authProvider) {
|
|
5202
|
+
const sdkVersion = require_package().version;
|
|
5099
5203
|
this.requester = new import_core6.Requester(
|
|
5100
5204
|
this.nodeKeyCache,
|
|
5101
|
-
|
|
5205
|
+
LIGHTSPARK_SDK_ENDPOINT,
|
|
5206
|
+
`js-lightspark-sdk/${sdkVersion}`,
|
|
5102
5207
|
authProvider,
|
|
5103
5208
|
this.serverUrl
|
|
5104
5209
|
);
|
|
@@ -5612,7 +5717,7 @@ var LightsparkClient = class {
|
|
|
5612
5717
|
return this.requester.executeQuery(query);
|
|
5613
5718
|
}
|
|
5614
5719
|
};
|
|
5615
|
-
var
|
|
5720
|
+
var LIGHTSPARK_SDK_ENDPOINT = "graphql/server/2023-04-04";
|
|
5616
5721
|
var client_default = LightsparkClient;
|
|
5617
5722
|
|
|
5618
5723
|
// src/objects/InvoiceType.ts
|
package/dist/index.js
CHANGED
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
WithdrawalRequestFromJson,
|
|
46
46
|
WithdrawalRequestStatus_default,
|
|
47
47
|
WithdrawalRequest_default,
|
|
48
|
+
__commonJS,
|
|
48
49
|
getApiTokenQuery,
|
|
49
50
|
getChannelClosingTransactionQuery,
|
|
50
51
|
getChannelOpeningTransactionQuery,
|
|
@@ -58,7 +59,105 @@ import {
|
|
|
58
59
|
getRoutingTransactionQuery,
|
|
59
60
|
getTransactionQuery,
|
|
60
61
|
getWithdrawalQuery
|
|
61
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-5Z7FB6OT.js";
|
|
63
|
+
|
|
64
|
+
// package.json
|
|
65
|
+
var require_package = __commonJS({
|
|
66
|
+
"package.json"(exports, module) {
|
|
67
|
+
module.exports = {
|
|
68
|
+
name: "@lightsparkdev/lightspark-sdk",
|
|
69
|
+
version: "0.2.1",
|
|
70
|
+
description: "Lightspark JS SDK",
|
|
71
|
+
author: "Lightspark Inc.",
|
|
72
|
+
keywords: [
|
|
73
|
+
"lightspark",
|
|
74
|
+
"bitcoin",
|
|
75
|
+
"lightning",
|
|
76
|
+
"payments",
|
|
77
|
+
"typescript"
|
|
78
|
+
],
|
|
79
|
+
homepage: "https://github.com/lightsparkdev/js-sdk",
|
|
80
|
+
repository: {
|
|
81
|
+
type: "git",
|
|
82
|
+
url: "https://github.com/lightsparkdev/js-sdk.git"
|
|
83
|
+
},
|
|
84
|
+
bugs: {
|
|
85
|
+
url: "https://github.com/lightsparkdev/js-sdk/issues"
|
|
86
|
+
},
|
|
87
|
+
engines: {
|
|
88
|
+
node: ">=14.16"
|
|
89
|
+
},
|
|
90
|
+
exports: {
|
|
91
|
+
".": {
|
|
92
|
+
types: "./dist/index.d.ts",
|
|
93
|
+
import: {
|
|
94
|
+
types: "./dist/index.d.ts",
|
|
95
|
+
default: "./dist/index.js"
|
|
96
|
+
},
|
|
97
|
+
module: "./dist/index.js",
|
|
98
|
+
require: "./dist/index.cjs",
|
|
99
|
+
default: "./dist/index.cjs"
|
|
100
|
+
},
|
|
101
|
+
"./objects": {
|
|
102
|
+
types: "./dist/objects/index.d.ts",
|
|
103
|
+
import: {
|
|
104
|
+
types: "./dist/objects/index.d.ts",
|
|
105
|
+
default: "./dist/objects/index.js"
|
|
106
|
+
},
|
|
107
|
+
module: "./dist/objects/index.js",
|
|
108
|
+
require: "./dist/objects/index.cjs",
|
|
109
|
+
default: "./dist/objects/index.cjs"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
type: "module",
|
|
113
|
+
types: "./dist/index.d.ts",
|
|
114
|
+
main: "./dist/index.js",
|
|
115
|
+
module: "./dist/index.js",
|
|
116
|
+
browser: {
|
|
117
|
+
crypto: false
|
|
118
|
+
},
|
|
119
|
+
files: [
|
|
120
|
+
"src/*",
|
|
121
|
+
"dist/*",
|
|
122
|
+
"CHANGELOG.md"
|
|
123
|
+
],
|
|
124
|
+
scripts: {
|
|
125
|
+
build: "tsup --entry src/index.ts --entry src/objects/index.ts --format cjs,esm --dts",
|
|
126
|
+
"copy-static": "cp ./package.json ./README.md ./LICENSE ./dist/",
|
|
127
|
+
dev: "yarn build -- --watch",
|
|
128
|
+
clean: "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
129
|
+
lint: "npx prettier --check ./src",
|
|
130
|
+
format: "npx prettier --write ./src",
|
|
131
|
+
test: "tsc --noEmit --project tsconfig-test.json && jest --no-cache --runInBand --bail",
|
|
132
|
+
"type-check": "tsc --noEmit",
|
|
133
|
+
postversion: "yarn build"
|
|
134
|
+
},
|
|
135
|
+
license: "Apache-2.0",
|
|
136
|
+
dependencies: {
|
|
137
|
+
"@lightsparkdev/core": "^0.2.1",
|
|
138
|
+
"auto-bind": "^5.0.1",
|
|
139
|
+
crypto: "^1.0.1",
|
|
140
|
+
"crypto-browserify": "^3.12.0",
|
|
141
|
+
dayjs: "^1.11.7",
|
|
142
|
+
graphql: "^16.6.0",
|
|
143
|
+
"graphql-ws": "^5.11.3",
|
|
144
|
+
ws: "^8.12.1",
|
|
145
|
+
"zen-observable-ts": "^1.1.0"
|
|
146
|
+
},
|
|
147
|
+
devDependencies: {
|
|
148
|
+
"@types/crypto-js": "^4.1.1",
|
|
149
|
+
"@types/ws": "^8.5.4",
|
|
150
|
+
jest: "^29.4.1",
|
|
151
|
+
prettier: "^2.8.4",
|
|
152
|
+
"prettier-plugin-organize-imports": "^3.2.2",
|
|
153
|
+
"ts-jest": "^29.0.5",
|
|
154
|
+
"ts-node": "^10.9.1",
|
|
155
|
+
typescript: "^4.9.5",
|
|
156
|
+
tsconfig: "*"
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
});
|
|
62
161
|
|
|
63
162
|
// src/auth/AccountTokenAuthProvider.ts
|
|
64
163
|
import { b64encode } from "@lightsparkdev/core";
|
|
@@ -595,9 +694,11 @@ var LightsparkClient = class {
|
|
|
595
694
|
this.authProvider = authProvider;
|
|
596
695
|
this.serverUrl = serverUrl;
|
|
597
696
|
this.nodeKeyCache = nodeKeyCache;
|
|
697
|
+
const sdkVersion = require_package().version;
|
|
598
698
|
this.requester = new Requester(
|
|
599
699
|
this.nodeKeyCache,
|
|
600
|
-
|
|
700
|
+
LIGHTSPARK_SDK_ENDPOINT,
|
|
701
|
+
`js-lightspark-sdk/${sdkVersion}`,
|
|
601
702
|
authProvider,
|
|
602
703
|
serverUrl
|
|
603
704
|
);
|
|
@@ -611,9 +712,11 @@ var LightsparkClient = class {
|
|
|
611
712
|
* @param authProvider
|
|
612
713
|
*/
|
|
613
714
|
async setAuthProvider(authProvider) {
|
|
715
|
+
const sdkVersion = require_package().version;
|
|
614
716
|
this.requester = new Requester(
|
|
615
717
|
this.nodeKeyCache,
|
|
616
|
-
|
|
718
|
+
LIGHTSPARK_SDK_ENDPOINT,
|
|
719
|
+
`js-lightspark-sdk/${sdkVersion}`,
|
|
617
720
|
authProvider,
|
|
618
721
|
this.serverUrl
|
|
619
722
|
);
|
|
@@ -1127,7 +1230,7 @@ var LightsparkClient = class {
|
|
|
1127
1230
|
return this.requester.executeQuery(query);
|
|
1128
1231
|
}
|
|
1129
1232
|
};
|
|
1130
|
-
var
|
|
1233
|
+
var LIGHTSPARK_SDK_ENDPOINT = "graphql/server/2023-04-04";
|
|
1131
1234
|
var client_default = LightsparkClient;
|
|
1132
1235
|
export {
|
|
1133
1236
|
Account_default as Account,
|
package/dist/objects/index.js
CHANGED
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
getRoutingTransactionQuery,
|
|
42
42
|
getTransactionQuery,
|
|
43
43
|
getWithdrawalQuery
|
|
44
|
-
} from "../chunk-
|
|
44
|
+
} from "../chunk-5Z7FB6OT.js";
|
|
45
45
|
export {
|
|
46
46
|
Account_default as Account,
|
|
47
47
|
AccountToChannelsConnection_default as AccountToChannelsConnection,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightsparkdev/lightspark-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Lightspark JS SDK",
|
|
5
5
|
"author": "Lightspark Inc.",
|
|
6
6
|
"keywords": [
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"license": "Apache-2.0",
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@lightsparkdev/core": "^0.2.
|
|
71
|
+
"@lightsparkdev/core": "^0.2.1",
|
|
72
72
|
"auto-bind": "^5.0.1",
|
|
73
73
|
"crypto": "^1.0.1",
|
|
74
74
|
"crypto-browserify": "^3.12.0",
|
package/src/client.ts
CHANGED
|
@@ -100,9 +100,11 @@ class LightsparkClient {
|
|
|
100
100
|
private readonly serverUrl: string = "api.lightspark.com",
|
|
101
101
|
private readonly nodeKeyCache: NodeKeyCache = new NodeKeyCache()
|
|
102
102
|
) {
|
|
103
|
+
const sdkVersion = require("../package.json").version;
|
|
103
104
|
this.requester = new Requester(
|
|
104
105
|
this.nodeKeyCache,
|
|
105
|
-
|
|
106
|
+
LIGHTSPARK_SDK_ENDPOINT,
|
|
107
|
+
`js-lightspark-sdk/${sdkVersion}`,
|
|
106
108
|
authProvider,
|
|
107
109
|
serverUrl
|
|
108
110
|
);
|
|
@@ -117,9 +119,11 @@ class LightsparkClient {
|
|
|
117
119
|
* @param authProvider
|
|
118
120
|
*/
|
|
119
121
|
public async setAuthProvider(authProvider: AuthProvider) {
|
|
122
|
+
const sdkVersion = require("../package.json").version;
|
|
120
123
|
this.requester = new Requester(
|
|
121
124
|
this.nodeKeyCache,
|
|
122
|
-
|
|
125
|
+
LIGHTSPARK_SDK_ENDPOINT,
|
|
126
|
+
`js-lightspark-sdk/${sdkVersion}`,
|
|
123
127
|
authProvider,
|
|
124
128
|
this.serverUrl
|
|
125
129
|
);
|
|
@@ -753,6 +757,6 @@ class LightsparkClient {
|
|
|
753
757
|
}
|
|
754
758
|
}
|
|
755
759
|
|
|
756
|
-
const
|
|
760
|
+
const LIGHTSPARK_SDK_ENDPOINT = "graphql/server/2023-04-04";
|
|
757
761
|
|
|
758
762
|
export default LightsparkClient;
|