univo 0.1.16 → 0.1.17
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.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { config } from 'dotenv';
|
|
|
5
5
|
import { WebSocket } from 'partysocket';
|
|
6
6
|
import { defineCommand, runMain } from 'citty';
|
|
7
7
|
import { http } from './client.mjs';
|
|
8
|
-
import { c as createLogger, e as version, l as name } from './shared/univo.
|
|
8
|
+
import { c as createLogger, e as version, l as name } from './shared/univo.2F7MFHxq.mjs';
|
|
9
9
|
|
|
10
10
|
const log = createLogger({ quiet: false });
|
|
11
11
|
const dev = defineCommand({
|
package/dist/client.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createException, o as compress, f as getSignature, g as getException } from './shared/univo.
|
|
1
|
+
import { a as createException, o as compress, f as getSignature, g as getException } from './shared/univo.2F7MFHxq.mjs';
|
|
2
2
|
|
|
3
3
|
const MIN_GZIP_SIZE = 1024;
|
|
4
4
|
function http(url, opts = {}) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createLogger, v as verifySignature, d as decompress, a as createException, g as getException, h as hexToNumber, i as isAddressEqual, b as catchException, r as retry, e as version, n as nonNullable, f as getSignature } from './shared/univo.
|
|
1
|
+
import { c as createLogger, v as verifySignature, d as decompress, a as createException, g as getException, h as hexToNumber, i as isAddressEqual, b as catchException, r as retry, e as version, n as nonNullable, f as getSignature } from './shared/univo.2F7MFHxq.mjs';
|
|
2
2
|
|
|
3
3
|
function matchFilter(block, filter) {
|
|
4
4
|
if (!chainValid(block, filter)) return false;
|
|
@@ -440,7 +440,7 @@ function indexer(opts) {
|
|
|
440
440
|
const handler = async (req) => {
|
|
441
441
|
let body_buffer;
|
|
442
442
|
try {
|
|
443
|
-
body_buffer =
|
|
443
|
+
body_buffer = await req.arrayBuffer();
|
|
444
444
|
} catch {
|
|
445
445
|
return Response.json(
|
|
446
446
|
{ jsonrpc: "2.0", id: null, error: { code: 0, message: "Invalid request body" } },
|
package/dist/realtime.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import WS from 'ws';
|
|
2
2
|
import { WebSocket } from 'partysocket';
|
|
3
3
|
import { http } from './client.mjs';
|
|
4
|
-
import { c as createLogger, r as retry, h as hexToNumber, j as raise, m as mutex, k as assert } from './shared/univo.
|
|
4
|
+
import { c as createLogger, r as retry, h as hexToNumber, j as raise, m as mutex, k as assert } from './shared/univo.2F7MFHxq.mjs';
|
|
5
5
|
|
|
6
6
|
function createSocket(url, opts) {
|
|
7
7
|
const ws = new WebSocket(url, [], { WebSocket: WS });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const name = "univo";
|
|
2
|
-
const version = "0.1.
|
|
2
|
+
const version = "0.1.17";
|
|
3
3
|
|
|
4
4
|
function createException(message) {
|
|
5
5
|
return `univo:${message}`;
|
|
@@ -108,47 +108,12 @@ function nonNullable(value) {
|
|
|
108
108
|
return value !== null && value !== void 0;
|
|
109
109
|
}
|
|
110
110
|
async function compress(input) {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
const writer = stream.writable.getWriter();
|
|
114
|
-
writer.write(encoded);
|
|
115
|
-
writer.close();
|
|
116
|
-
const chunks = [];
|
|
117
|
-
const reader = stream.readable.getReader();
|
|
118
|
-
while (true) {
|
|
119
|
-
const { done, value } = await reader.read();
|
|
120
|
-
if (done) break;
|
|
121
|
-
chunks.push(value);
|
|
122
|
-
}
|
|
123
|
-
const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
|
|
124
|
-
const result = new Uint8Array(totalLength);
|
|
125
|
-
let offset = 0;
|
|
126
|
-
for (const chunk of chunks) {
|
|
127
|
-
result.set(chunk, offset);
|
|
128
|
-
offset += chunk.length;
|
|
129
|
-
}
|
|
130
|
-
return result;
|
|
111
|
+
const compressed = new Blob([input]).stream().pipeThrough(new CompressionStream("gzip"));
|
|
112
|
+
return new Response(compressed).arrayBuffer();
|
|
131
113
|
}
|
|
132
114
|
async function decompress(input) {
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
writer.write(input);
|
|
136
|
-
writer.close();
|
|
137
|
-
const chunks = [];
|
|
138
|
-
const reader = stream.readable.getReader();
|
|
139
|
-
while (true) {
|
|
140
|
-
const { done, value } = await reader.read();
|
|
141
|
-
if (done) break;
|
|
142
|
-
chunks.push(value);
|
|
143
|
-
}
|
|
144
|
-
const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
|
|
145
|
-
const result = new Uint8Array(totalLength);
|
|
146
|
-
let offset = 0;
|
|
147
|
-
for (const chunk of chunks) {
|
|
148
|
-
result.set(chunk, offset);
|
|
149
|
-
offset += chunk.length;
|
|
150
|
-
}
|
|
151
|
-
return new TextDecoder().decode(result);
|
|
115
|
+
const decompressed = new Blob([input]).stream().pipeThrough(new DecompressionStream("gzip"));
|
|
116
|
+
return new Response(decompressed).text();
|
|
152
117
|
}
|
|
153
118
|
|
|
154
119
|
export { createException as a, catchException as b, createLogger as c, decompress as d, version as e, getSignature as f, getException as g, hexToNumber as h, isAddressEqual as i, raise as j, assert as k, name as l, mutex as m, nonNullable as n, compress as o, retry as r, verifySignature as v };
|