univo 0.3.2 → 0.3.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/dist/cli.mjs CHANGED
@@ -4,8 +4,8 @@ import open from 'open';
4
4
  import { config } from 'dotenv';
5
5
  import { WebSocket } from 'partysocket';
6
6
  import { defineCommand, runMain } from 'citty';
7
- import { h as http } from './shared/univo.j1HWrILH.mjs';
8
- import { c as createLogger, v as version, n as name } from './shared/univo.vwk4Xrn3.mjs';
7
+ import { h as http } from './shared/univo.DObJAnN6.mjs';
8
+ import { c as createLogger, v as version, n as name } from './shared/univo.BCKcG-WP.mjs';
9
9
 
10
10
  const log = createLogger({ quiet: false });
11
11
  const dev = defineCommand({
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as viem from 'viem';
2
- import { g as getException, c as createException, a as catchException, l as local } from './shared/univo.j1HWrILH.mjs';
3
- import { c as createLogger, d as decompress, b as decoder, r as retry, v as version, e as normalizeHex, a as isHexEqual, f as compress } from './shared/univo.vwk4Xrn3.mjs';
2
+ import { g as getException, c as createException, a as catchException, l as local } from './shared/univo.DObJAnN6.mjs';
3
+ import { c as createLogger, d as decompress, b as decoder, r as retry, v as version, e as normalizeHex, a as isHexEqual, f as compress } from './shared/univo.BCKcG-WP.mjs';
4
4
  import { AdapterError } from './metadata/adapters.mjs';
5
5
  import 'ws';
6
6
  import 'partysocket';
@@ -94,6 +94,7 @@ function createServer(opts) {
94
94
  };
95
95
  }
96
96
 
97
+ const SUPPORTED_TRANSACTION_TYPES = /* @__PURE__ */ new Set([0n, 1n, 2n, 3n, 4n]);
97
98
  function matchFilter(block, filter) {
98
99
  if (!chainValid(block, filter)) return false;
99
100
  if (!toBlockValid(block, filter)) return false;
@@ -280,8 +281,17 @@ function defineIndexer(opts) {
280
281
  return type === 0n ? encoded : viem.concatBytes([Uint8Array.of(Number(type)), encoded]);
281
282
  }
282
283
  function verifyTransactionsRoot(block) {
283
- const transactions = block.eth_getBlockByNumber.transactions.map((transaction) => {
284
- const { input, ...formatted } = viem.formatTransaction(transaction);
284
+ const unsupportedTxs = block.eth_getBlockByNumber.transactions.filter((tx) => {
285
+ return !SUPPORTED_TRANSACTION_TYPES.has(viem.hexToBigInt(tx.type));
286
+ });
287
+ for (const tx of unsupportedTxs) {
288
+ log.warn(`Encountered unsupported tx type for ${tx.hash} on ${block.eth_chainId}`);
289
+ }
290
+ if (unsupportedTxs.length > 0) {
291
+ return log.warn("Unable to verify block `transactionsRoot` because of unsupported tx type");
292
+ }
293
+ const transactions = block.eth_getBlockByNumber.transactions.map((tx) => {
294
+ const { input, ...formatted } = viem.formatTransaction(tx);
285
295
  if (formatted.type === "legacy" && (formatted.v === 27n || formatted.v === 28n)) {
286
296
  formatted.chainId = void 0;
287
297
  }
@@ -291,8 +301,8 @@ function defineIndexer(opts) {
291
301
  //
292
302
  signature
293
303
  );
294
- if (!isHexEqual(transaction.hash, viem.keccak256(serialized))) {
295
- throw new Error(`Transaction ${transaction.hash} failed serialization check`);
304
+ if (!isHexEqual(tx.hash, viem.keccak256(serialized))) {
305
+ throw new Error(`Transaction ${tx.hash} failed serialization check`);
296
306
  }
297
307
  return viem.hexToBytes(serialized);
298
308
  });
package/dist/realtime.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { hexToNumber } from 'viem';
2
- import { c as createLogger, i as iife, m as mutex, r as retry, a as isHexEqual } from './shared/univo.vwk4Xrn3.mjs';
2
+ import { c as createLogger, i as iife, m as mutex, r as retry, a as isHexEqual } from './shared/univo.BCKcG-WP.mjs';
3
3
 
4
4
  function defineBlockchain(opts) {
5
5
  const log = createLogger({ quiet: opts.quiet });
@@ -1,5 +1,5 @@
1
1
  const name = "univo";
2
- const version = "0.3.2";
2
+ const version = "0.3.3";
3
3
 
4
4
  function createLogger(opts) {
5
5
  let prefix = `[${name}@${version}]`;
@@ -1,6 +1,6 @@
1
1
  import ws from 'ws';
2
2
  import { WebSocket } from 'partysocket';
3
- import { f as compress, g as raise, c as createLogger, m as mutex } from './univo.vwk4Xrn3.mjs';
3
+ import { f as compress, g as raise, c as createLogger, m as mutex } from './univo.BCKcG-WP.mjs';
4
4
 
5
5
  function createException(message) {
6
6
  return `univo:${message}`;
@@ -1,4 +1,4 @@
1
1
  import 'ws';
2
2
  import 'partysocket';
3
- export { h as http, l as local, w as wss } from './shared/univo.j1HWrILH.mjs';
4
- import './shared/univo.vwk4Xrn3.mjs';
3
+ export { h as http, l as local, w as wss } from './shared/univo.DObJAnN6.mjs';
4
+ import './shared/univo.BCKcG-WP.mjs';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "univo",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "0.3.2",
5
+ "version": "0.3.3",
6
6
  "sideEffects": false,
7
7
  "module": "./dist/index.mjs",
8
8
  "types": "./dist/index.d.ts",