@coopenomics/parser 2025.12.2-alpha-3 → 2026.2.21-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/dist/index.cjs CHANGED
@@ -500,14 +500,18 @@ async function loadReader(db) {
500
500
  await db.purgeAfterBlock(currentBlock);
501
501
  const unique_contract_names = [.../* @__PURE__ */ new Set([...subscribedContracts, ...actions_whitelist().map((row) => row.code)])];
502
502
  const abisArr = await Promise.all(unique_contract_names.map((account_name) => fetchAbi(account_name)));
503
- const contract_abis = () => {
504
- const numap = /* @__PURE__ */ new Map();
505
- abisArr.forEach(({ account_name, abi }) => numap.set(account_name, abi));
506
- return numap;
507
- };
503
+ const abiMap = /* @__PURE__ */ new Map();
504
+ abisArr.forEach(({ account_name, abi }) => {
505
+ if (abi) {
506
+ abiMap.set(account_name, abi);
507
+ } else {
508
+ console.warn(`ABI not found for ${account_name}, skipped`);
509
+ }
510
+ });
511
+ const contract_abis = () => abiMap;
508
512
  const table_rows_whitelist = () => {
509
513
  const tables = [];
510
- abisArr.forEach(({ account_name, abi }) => {
514
+ abiMap.forEach((abi, account_name) => {
511
515
  if (subscribedContracts.includes(account_name)) {
512
516
  const tableNames = extractTablesFromAbi(abi);
513
517
  tableNames.forEach((tableName) => {
@@ -549,7 +553,15 @@ async function loadReader(db) {
549
553
  },
550
554
  auto_start: true
551
555
  };
552
- return await eosioShipReader.createEosioShipReader(eosioReaderConfig);
556
+ const reader = await eosioShipReader.createEosioShipReader(eosioReaderConfig);
557
+ reader.abis$?.subscribe((payload) => {
558
+ const { account_name, abi } = payload;
559
+ if (abi) {
560
+ abiMap.set(account_name, abi);
561
+ console.log("ABI updated for", account_name);
562
+ }
563
+ });
564
+ return reader;
553
565
  }
554
566
 
555
567
  class Parser {
package/dist/index.mjs CHANGED
@@ -491,14 +491,18 @@ async function loadReader(db) {
491
491
  await db.purgeAfterBlock(currentBlock);
492
492
  const unique_contract_names = [.../* @__PURE__ */ new Set([...subscribedContracts, ...actions_whitelist().map((row) => row.code)])];
493
493
  const abisArr = await Promise.all(unique_contract_names.map((account_name) => fetchAbi(account_name)));
494
- const contract_abis = () => {
495
- const numap = /* @__PURE__ */ new Map();
496
- abisArr.forEach(({ account_name, abi }) => numap.set(account_name, abi));
497
- return numap;
498
- };
494
+ const abiMap = /* @__PURE__ */ new Map();
495
+ abisArr.forEach(({ account_name, abi }) => {
496
+ if (abi) {
497
+ abiMap.set(account_name, abi);
498
+ } else {
499
+ console.warn(`ABI not found for ${account_name}, skipped`);
500
+ }
501
+ });
502
+ const contract_abis = () => abiMap;
499
503
  const table_rows_whitelist = () => {
500
504
  const tables = [];
501
- abisArr.forEach(({ account_name, abi }) => {
505
+ abiMap.forEach((abi, account_name) => {
502
506
  if (subscribedContracts.includes(account_name)) {
503
507
  const tableNames = extractTablesFromAbi(abi);
504
508
  tableNames.forEach((tableName) => {
@@ -540,7 +544,15 @@ async function loadReader(db) {
540
544
  },
541
545
  auto_start: true
542
546
  };
543
- return await createEosioShipReader(eosioReaderConfig);
547
+ const reader = await createEosioShipReader(eosioReaderConfig);
548
+ reader.abis$?.subscribe((payload) => {
549
+ const { account_name, abi } = payload;
550
+ if (abi) {
551
+ abiMap.set(account_name, abi);
552
+ console.log("ABI updated for", account_name);
553
+ }
554
+ });
555
+ return reader;
544
556
  }
545
557
 
546
558
  class Parser {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coopenomics/parser",
3
3
  "type": "module",
4
- "version": "2025.12.2-alpha-3",
4
+ "version": "2026.2.21-1",
5
5
  "private": false,
6
6
  "packageManager": "pnpm@9.0.6",
7
7
  "description": "",
@@ -54,7 +54,7 @@
54
54
  "@blockmatic/eosio-ship-reader": "^1.2.0",
55
55
  "@types/express": "^4.17.21",
56
56
  "@types/ws": "^8.5.13",
57
- "cooptypes": "2025.12.2-alpha-3",
57
+ "cooptypes": "2026.2.21-1",
58
58
  "dotenv": "^16.4.5",
59
59
  "dotenv-expand": "^11.0.6",
60
60
  "eosjs": "^22.1.0",
@@ -87,5 +87,5 @@
87
87
  "vite": "^5.2.10",
88
88
  "vitest": "^1.5.2"
89
89
  },
90
- "gitHead": "e27228e735ebec2df66bd808eae15089373f34b5"
90
+ "gitHead": "a549f4cae07739be1ac9ca9e19b527430ac9a10e"
91
91
  }