@tuwaio/quasar-sdk 0.1.9 → 0.1.11
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/dist/cli.cjs +139 -11
- package/package.json +2 -1
package/dist/cli.cjs
CHANGED
|
@@ -43,9 +43,137 @@ __export(cli_exports, {
|
|
|
43
43
|
module.exports = __toCommonJS(cli_exports);
|
|
44
44
|
var fs = __toESM(require("fs"), 1);
|
|
45
45
|
var path = __toESM(require("path"), 1);
|
|
46
|
+
|
|
47
|
+
// package.json
|
|
48
|
+
var package_default = {
|
|
49
|
+
name: "@tuwaio/quasar-sdk",
|
|
50
|
+
version: "0.1.11",
|
|
51
|
+
private: false,
|
|
52
|
+
author: "Oleksandr Tkach",
|
|
53
|
+
license: "Apache-2.0",
|
|
54
|
+
description: "Layer 5 (L5) of the TUWA Ecosystem. The Quasar Cloud SDK providing server-side Node.js & Edge utilities for transaction indexing, billing, and backend API integration.",
|
|
55
|
+
type: "module",
|
|
56
|
+
main: "./dist/index.cjs",
|
|
57
|
+
module: "./dist/index.js",
|
|
58
|
+
types: "./dist/index.d.ts",
|
|
59
|
+
exports: {
|
|
60
|
+
".": {
|
|
61
|
+
types: "./dist/index.d.ts",
|
|
62
|
+
import: "./dist/index.js",
|
|
63
|
+
require: "./dist/index.cjs"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
publishConfig: {
|
|
67
|
+
access: "public"
|
|
68
|
+
},
|
|
69
|
+
files: [
|
|
70
|
+
"dist",
|
|
71
|
+
"socket.json"
|
|
72
|
+
],
|
|
73
|
+
bin: {
|
|
74
|
+
"@tuwaio/quasar-sdk": "./dist/cli.cjs",
|
|
75
|
+
"quasar-sdk": "./dist/cli.cjs"
|
|
76
|
+
},
|
|
77
|
+
scripts: {
|
|
78
|
+
start: "tsup src/index.ts --watch",
|
|
79
|
+
build: "tsup",
|
|
80
|
+
test: "vitest run"
|
|
81
|
+
},
|
|
82
|
+
keywords: [
|
|
83
|
+
"tuwa",
|
|
84
|
+
"web3",
|
|
85
|
+
"evm",
|
|
86
|
+
"ethereum",
|
|
87
|
+
"solana",
|
|
88
|
+
"wagmi",
|
|
89
|
+
"viem",
|
|
90
|
+
"@solana/kit",
|
|
91
|
+
"wallet-standard",
|
|
92
|
+
"wallet",
|
|
93
|
+
"wallet-connect",
|
|
94
|
+
"wallets",
|
|
95
|
+
"transaction",
|
|
96
|
+
"tracking",
|
|
97
|
+
"transaction-tracking",
|
|
98
|
+
"react",
|
|
99
|
+
"ui",
|
|
100
|
+
"ui-kit",
|
|
101
|
+
"design-system",
|
|
102
|
+
"hooks",
|
|
103
|
+
"utils",
|
|
104
|
+
"components",
|
|
105
|
+
"tailwind",
|
|
106
|
+
"tailwindcss",
|
|
107
|
+
"typescript",
|
|
108
|
+
"core",
|
|
109
|
+
"headless",
|
|
110
|
+
"zustand",
|
|
111
|
+
"immer",
|
|
112
|
+
"i18n",
|
|
113
|
+
"modal",
|
|
114
|
+
"toast",
|
|
115
|
+
"quasar",
|
|
116
|
+
"cloud",
|
|
117
|
+
"sdk",
|
|
118
|
+
"next-auth",
|
|
119
|
+
"cosmos",
|
|
120
|
+
"playground",
|
|
121
|
+
"cli"
|
|
122
|
+
],
|
|
123
|
+
repository: {
|
|
124
|
+
type: "git",
|
|
125
|
+
url: "git+https://github.com/TuwaIO/sdk.git",
|
|
126
|
+
directory: "packages/quasar-sdk"
|
|
127
|
+
},
|
|
128
|
+
homepage: "https://github.com/TuwaIO/sdk",
|
|
129
|
+
bugs: {
|
|
130
|
+
url: "https://github.com/TuwaIO/sdk/issues"
|
|
131
|
+
},
|
|
132
|
+
contributors: [
|
|
133
|
+
{
|
|
134
|
+
name: "Oleksandr Tkach",
|
|
135
|
+
url: "https://github.com/Argeare5"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
peerDependencies: {
|
|
139
|
+
"@tuwaio/pulsar-core": ">=0.7",
|
|
140
|
+
ofetch: "^1.5.1",
|
|
141
|
+
"@tuwaio/siwx-react": ">=0.3",
|
|
142
|
+
"@tuwaio/siwx-core": ">=0.3",
|
|
143
|
+
"@tuwaio/siwx-server": ">=0.3"
|
|
144
|
+
},
|
|
145
|
+
peerDependenciesMeta: {
|
|
146
|
+
"@tuwaio/pulsar-core": {
|
|
147
|
+
optional: false
|
|
148
|
+
},
|
|
149
|
+
ofetch: {
|
|
150
|
+
optional: false
|
|
151
|
+
},
|
|
152
|
+
"@tuwaio/siwx-core": {
|
|
153
|
+
optional: true
|
|
154
|
+
},
|
|
155
|
+
"@tuwaio/siwx-server": {
|
|
156
|
+
optional: true
|
|
157
|
+
},
|
|
158
|
+
"@tuwaio/siwx-react": {
|
|
159
|
+
optional: true
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
devDependencies: {
|
|
163
|
+
"@tuwaio/pulsar-core": "^0.7.0",
|
|
164
|
+
ofetch: "^1.5.1",
|
|
165
|
+
tsup: "^8.5.1",
|
|
166
|
+
typescript: "6.0.3",
|
|
167
|
+
"@tuwaio/siwx-react": "^0.3.0",
|
|
168
|
+
"@tuwaio/siwx-core": "^0.3.0",
|
|
169
|
+
"@tuwaio/siwx-server": "^0.3.0"
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// src/cli.ts
|
|
46
174
|
var DEFAULT_FORWARD_URL = "http://localhost:3000/api/webhooks/quasar";
|
|
47
175
|
var DEFAULT_API_URL = "https://api.tuwa.io";
|
|
48
|
-
var CLI_VERSION = "0.
|
|
176
|
+
var CLI_VERSION = package_default.version || "0.0.0";
|
|
49
177
|
function parseEnvFile(content) {
|
|
50
178
|
const env = {};
|
|
51
179
|
const lines = content.split("\n");
|
|
@@ -195,14 +323,14 @@ async function runListen(options) {
|
|
|
195
323
|
const reader = response.body.getReader();
|
|
196
324
|
const decoder = new TextDecoder("utf-8");
|
|
197
325
|
let buffer = "";
|
|
326
|
+
let currentEvent = "message";
|
|
327
|
+
let currentData = "";
|
|
198
328
|
while (!isShuttingDown) {
|
|
199
329
|
const { done, value } = await reader.read();
|
|
200
330
|
if (done) break;
|
|
201
331
|
buffer += decoder.decode(value, { stream: true });
|
|
202
332
|
const lines = buffer.split("\n");
|
|
203
333
|
buffer = lines.pop() || "";
|
|
204
|
-
let currentEvent = "message";
|
|
205
|
-
let currentData = "";
|
|
206
334
|
for (const line of lines) {
|
|
207
335
|
const trimmed = line.trim();
|
|
208
336
|
if (!trimmed) {
|
|
@@ -213,6 +341,9 @@ async function runListen(options) {
|
|
|
213
341
|
}
|
|
214
342
|
continue;
|
|
215
343
|
}
|
|
344
|
+
if (trimmed.startsWith(":")) {
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
216
347
|
if (trimmed.startsWith("event:")) {
|
|
217
348
|
currentEvent = trimmed.slice(6).trim();
|
|
218
349
|
} else if (trimmed.startsWith("data:")) {
|
|
@@ -320,14 +451,11 @@ async function main() {
|
|
|
320
451
|
apiUrl
|
|
321
452
|
});
|
|
322
453
|
}
|
|
323
|
-
if (
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
process.exit(1);
|
|
329
|
-
});
|
|
330
|
-
}
|
|
454
|
+
if (!process.env.VITEST) {
|
|
455
|
+
void main().catch((err) => {
|
|
456
|
+
console.error("\x1B[31mFatal error:\x1B[0m", err);
|
|
457
|
+
process.exit(1);
|
|
458
|
+
});
|
|
331
459
|
}
|
|
332
460
|
// Annotate the CommonJS export names for ESM import in node:
|
|
333
461
|
0 && (module.exports = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuwaio/quasar-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Oleksandr Tkach",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"socket.json"
|
|
25
25
|
],
|
|
26
26
|
"bin": {
|
|
27
|
+
"@tuwaio/quasar-sdk": "./dist/cli.cjs",
|
|
27
28
|
"quasar-sdk": "./dist/cli.cjs"
|
|
28
29
|
},
|
|
29
30
|
"keywords": [
|