@eclesia/indexer-engine 2.7.7 → 2.8.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.
Files changed (72) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +34 -0
  2. package/dist/_virtual/rolldown_runtime.js +13 -0
  3. package/dist/emitter/index.cjs +57 -0
  4. package/dist/emitter/index.cjs.map +1 -0
  5. package/dist/emitter/index.d.cts +21 -0
  6. package/dist/emitter/index.d.cts.map +1 -0
  7. package/dist/emitter/index.d.ts +19 -15
  8. package/dist/emitter/index.d.ts.map +1 -1
  9. package/dist/emitter/index.js +54 -73
  10. package/dist/emitter/index.js.map +1 -0
  11. package/dist/index.cjs +23 -0
  12. package/dist/index.d.cts +6 -0
  13. package/dist/index.d.ts +6 -6
  14. package/dist/index.js +7 -44
  15. package/dist/indexer/index.cjs +572 -0
  16. package/dist/indexer/index.cjs.map +1 -0
  17. package/dist/indexer/index.d.cts +54 -0
  18. package/dist/indexer/index.d.cts.map +1 -0
  19. package/dist/indexer/index.d.ts +50 -46
  20. package/dist/indexer/index.d.ts.map +1 -1
  21. package/dist/indexer/index.js +553 -724
  22. package/dist/indexer/index.js.map +1 -0
  23. package/dist/promise-queue/index.cjs +140 -0
  24. package/dist/promise-queue/index.cjs.map +1 -0
  25. package/dist/promise-queue/index.d.cts +39 -0
  26. package/dist/promise-queue/index.d.cts.map +1 -0
  27. package/dist/promise-queue/index.d.ts +36 -33
  28. package/dist/promise-queue/index.d.ts.map +1 -1
  29. package/dist/promise-queue/index.js +138 -172
  30. package/dist/promise-queue/index.js.map +1 -0
  31. package/dist/types/index.cjs +12 -0
  32. package/dist/types/index.cjs.map +1 -0
  33. package/dist/types/index.d.cts +102 -0
  34. package/dist/types/index.d.cts.map +1 -0
  35. package/dist/types/index.d.ts +88 -83
  36. package/dist/types/index.d.ts.map +1 -1
  37. package/dist/types/index.js +6 -2
  38. package/dist/types/index.js.map +1 -0
  39. package/dist/utils/bech32.cjs +27 -0
  40. package/dist/utils/bech32.cjs.map +1 -0
  41. package/dist/utils/bech32.d.cts +7 -0
  42. package/dist/utils/bech32.d.cts.map +1 -0
  43. package/dist/utils/bech32.d.ts +3 -1
  44. package/dist/utils/bech32.d.ts.map +1 -1
  45. package/dist/utils/bech32.js +17 -21
  46. package/dist/utils/bech32.js.map +1 -0
  47. package/dist/utils/bigint.cjs +9 -0
  48. package/dist/utils/bigint.cjs.map +1 -0
  49. package/dist/utils/bigint.d.cts +5 -0
  50. package/dist/utils/bigint.d.cts.map +1 -0
  51. package/dist/utils/bigint.d.ts +3 -1
  52. package/dist/utils/bigint.d.ts.map +1 -1
  53. package/dist/utils/bigint.js +6 -5
  54. package/dist/utils/bigint.js.map +1 -0
  55. package/dist/utils/index.cjs +22 -0
  56. package/dist/utils/index.cjs.map +1 -0
  57. package/dist/utils/index.d.cts +11 -0
  58. package/dist/utils/index.d.cts.map +1 -0
  59. package/dist/utils/index.d.ts +10 -3
  60. package/dist/utils/index.d.ts.map +1 -1
  61. package/dist/utils/index.js +17 -19
  62. package/dist/utils/index.js.map +1 -0
  63. package/dist/utils/text.cjs +11 -0
  64. package/dist/utils/text.cjs.map +1 -0
  65. package/dist/utils/text.d.cts +5 -0
  66. package/dist/utils/text.d.cts.map +1 -0
  67. package/dist/utils/text.d.ts +4 -1
  68. package/dist/utils/text.d.ts.map +1 -1
  69. package/dist/utils/text.js +8 -13
  70. package/dist/utils/text.js.map +1 -0
  71. package/package.json +24 -6
  72. package/dist/index.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAAE,oBAAoB,EACpC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,EACN,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,SAAS,EACV,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,MAAM,EACP,MAAM,mCAA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BR,cAAQ,EAAA;IAAA,KAAA,EAAA,IAAA;;iBAEV,EAAA;IAAK,KAAA,EAAA,IAAA;EAGE,CAAA;CAAc;AACpB,KANC,QAMD,CAAA,CAAA,CAAA,GAAA;MALL,CASS;EAAO,MAAA,EARZ,KAQY,EAAA;;UALL,cAAA;WACN;;;;eAII"}
@@ -1,2 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ //#region src/types/index.ts
2
+ var types_exports = {};
3
+
4
+ //#endregion
5
+ export { types_exports };
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":["import {\n BlockResponse, BlockResultsResponse,\n} from \"@cosmjs/tendermint-rpc\";\nimport {\n Event,\n} from \"@cosmjs/tendermint-rpc/build/comet38/responses\";\nimport {\n Validator,\n} from \"cosmjs-types/cosmos/staking/v1beta1/staking\";\nimport {\n TxBody,\n} from \"cosmjs-types/cosmos/tx/v1beta1/tx\";\n\nimport {\n EcleciaIndexer,\n} from \"../indexer\";\nimport {\n CircularBuffer,\n} from \"../promise-queue\";\n\nexport type EcleciaIndexerConfig = {\n startHeight?: number\n endHeight?: number\n batchSize: number\n modules: string[]\n getNextHeight: () => number | PromiseLike<number>\n logLevel: \"error\" | \"warn\" | \"info\" | \"http\" | \"verbose\" | \"debug\" | \"silly\"\n rpcUrl: string\n processGenesis?: boolean\n genesisPath?: string\n usePolling?: boolean\n pollingInterval?: number\n minimal?: boolean\n init?: () => Promise<void>\n beginTransaction: () => Promise<void>\n endTransaction: (status: boolean) => Promise<void>\n};\n\nexport type FullBlockQueue = CircularBuffer<[BlockResponse, BlockResultsResponse, Uint8Array]>;\nexport type MinimalBlockQueue = CircularBuffer<[BlockResponse, BlockResultsResponse]>;\nexport type BlockQueue = FullBlockQueue | MinimalBlockQueue;\nexport type WithHeightAndUUID<T> = {\n [K in keyof T]: T[K] & {\n uuid?: string\n height?: number\n timestamp?: string\n };\n};\nexport type EmitFunc<K extends keyof WithHeightAndUUID<EventMap>> = (\n t: K,\n e: WithHeightAndUUID<EventMap>[K]\n) => Promise<void | void[]>;\n\nexport type LogEvent = {\n type: \"log\" | \"info\" | \"warning\" | \"error\" | \"verbose\" | \"transient\"\n message: string\n};\nexport type UUIDEvent = {\n uuid: string\n error?: string\n status: boolean\n};\nexport type Events = {\n log: LogEvent\n uuid: UUIDEvent\n begin_block: {\n value: {\n events: BlockResultsResponse[\"beginBlockEvents\"]\n validators: Validator[] | undefined\n }\n }\n\n block: {\n value: {\n block: BlockResponse\n block_results: BlockResultsResponse\n }\n }\n end_block: {\n value: BlockResultsResponse[\"endBlockEvents\"]\n }\n tx_events: {\n value: BlockResultsResponse[\"results\"]\n }\n tx_memo: {\n value: {\n txHash: string\n txBody: TxBody\n }\n }\n _unhandled: {\n type: string\n event: unknown\n }\n \"periodic/50\": {\n value: null\n }\n \"periodic/100\": {\n value: null\n }\n \"periodic/1000\": {\n value: null\n }\n};\nexport type TxResult<T> = {\n tx: T\n events: Event[]\n};\n\nexport interface IndexingModule {\n indexer: EcleciaIndexer\n name: string\n depends: string[]\n provides: string[]\n setup: () => Promise<void>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n init: (...args: any[]) => void\n}\n"],"mappings":""}
@@ -0,0 +1,27 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ let bech32 = require("bech32");
3
+ bech32 = require_rolldown_runtime.__toESM(bech32);
4
+
5
+ //#region src/utils/bech32.ts
6
+ function toHexString(byteArray) {
7
+ return Array.prototype.map.call(byteArray, (byte) => {
8
+ return ("0" + (byte & 255).toString(16)).slice(-2);
9
+ }).join("");
10
+ }
11
+ function keyHashfromAddress(address) {
12
+ try {
13
+ return toHexString(bech32.bech32.fromWords(bech32.bech32.decode(address).words));
14
+ } catch (_e) {
15
+ throw new Error("Could not decode address");
16
+ }
17
+ }
18
+ function chainAddressfromKeyhash(prefix, keyhash) {
19
+ const words = bech32.bech32.toWords(Buffer.from(keyhash, "hex"));
20
+ return keyhash !== "" ? bech32.bech32.encode(prefix, words) : "";
21
+ }
22
+
23
+ //#endregion
24
+ exports.chainAddressfromKeyhash = chainAddressfromKeyhash;
25
+ exports.keyHashfromAddress = keyHashfromAddress;
26
+ exports.toHexString = toHexString;
27
+ //# sourceMappingURL=bech32.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bech32.cjs","names":[],"sources":["../../src/utils/bech32.ts"],"sourcesContent":["import {\n bech32,\n} from \"bech32\";\n\nfunction toHexString(byteArray: number[]) {\n return Array.prototype.map\n .call(\n byteArray, (byte) => {\n return (\"0\" + (byte & 0xff).toString(16)).slice(-2);\n },\n )\n .join(\"\");\n}\nfunction keyHashfromAddress(address: string): string {\n try {\n return toHexString(bech32.fromWords(bech32.decode(address).words));\n }\n catch (_e) {\n throw new Error(\"Could not decode address\");\n }\n}\nfunction chainAddressfromKeyhash(prefix: string, keyhash: string) {\n const words = bech32.toWords(Buffer.from(\n keyhash, \"hex\",\n ));\n\n return keyhash !== \"\"\n ? bech32.encode(\n prefix, words,\n )\n : \"\";\n}\n\nexport {\n chainAddressfromKeyhash, keyHashfromAddress, toHexString,\n};\n"],"mappings":";;;;;AAIA,SAAS,YAAY,WAAqB;AACxC,QAAO,MAAM,UAAU,IACpB,KACC,YAAY,SAAS;AACnB,UAAQ,OAAO,OAAO,KAAM,SAAS,GAAG,EAAE,MAAM,GAAG;GAEtD,CACA,KAAK,GAAG;;AAEb,SAAS,mBAAmB,SAAyB;AACnD,KAAI;AACF,SAAO,YAAY,cAAO,UAAU,cAAO,OAAO,QAAQ,CAAC,MAAM,CAAC;UAE7D,IAAI;AACT,QAAM,IAAI,MAAM,2BAA2B;;;AAG/C,SAAS,wBAAwB,QAAgB,SAAiB;CAChE,MAAM,QAAQ,cAAO,QAAQ,OAAO,KAClC,SAAS,MACV,CAAC;AAEF,QAAO,YAAY,KACf,cAAO,OACP,QAAQ,MACT,GACC"}
@@ -0,0 +1,7 @@
1
+ //#region src/utils/bech32.d.ts
2
+ declare function toHexString(byteArray: number[]): string;
3
+ declare function keyHashfromAddress(address: string): string;
4
+ declare function chainAddressfromKeyhash(prefix: string, keyhash: string): string;
5
+ //#endregion
6
+ export { chainAddressfromKeyhash, keyHashfromAddress, toHexString };
7
+ //# sourceMappingURL=bech32.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bech32.d.cts","names":[],"sources":["../../src/utils/bech32.ts"],"sourcesContent":[],"mappings":";iBAIS,WAAA;iBASA,kBAAA,CATW,OAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAAA,iBAiBX,uBAAA,CARkB,MAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAAA,MAAA"}
@@ -1,5 +1,7 @@
1
+ //#region src/utils/bech32.d.ts
1
2
  declare function toHexString(byteArray: number[]): string;
2
3
  declare function keyHashfromAddress(address: string): string;
3
4
  declare function chainAddressfromKeyhash(prefix: string, keyhash: string): string;
4
- export { chainAddressfromKeyhash, keyHashfromAddress, toHexString, };
5
+ //#endregion
6
+ export { chainAddressfromKeyhash, keyHashfromAddress, toHexString };
5
7
  //# sourceMappingURL=bech32.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bech32.d.ts","sourceRoot":"","sources":["../../src/utils/bech32.ts"],"names":[],"mappings":"AAIA,iBAAS,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,UAQvC;AACD,iBAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOnD;AACD,iBAAS,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAU/D;AAED,OAAO,EACL,uBAAuB,EAAE,kBAAkB,EAAE,WAAW,GACzD,CAAC"}
1
+ {"version":3,"file":"bech32.d.ts","names":[],"sources":["../../src/utils/bech32.ts"],"sourcesContent":[],"mappings":";iBAIS,WAAA;iBASA,kBAAA,CATW,OAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAAA,iBAiBX,uBAAA,CARkB,MAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAAA,MAAA"}
@@ -1,27 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.chainAddressfromKeyhash = chainAddressfromKeyhash;
4
- exports.keyHashfromAddress = keyHashfromAddress;
5
- exports.toHexString = toHexString;
6
- const bech32_1 = require("bech32");
1
+ import { bech32 } from "bech32";
2
+
3
+ //#region src/utils/bech32.ts
7
4
  function toHexString(byteArray) {
8
- return Array.prototype.map
9
- .call(byteArray, (byte) => {
10
- return ("0" + (byte & 0xff).toString(16)).slice(-2);
11
- })
12
- .join("");
5
+ return Array.prototype.map.call(byteArray, (byte) => {
6
+ return ("0" + (byte & 255).toString(16)).slice(-2);
7
+ }).join("");
13
8
  }
14
9
  function keyHashfromAddress(address) {
15
- try {
16
- return toHexString(bech32_1.bech32.fromWords(bech32_1.bech32.decode(address).words));
17
- }
18
- catch (_e) {
19
- throw new Error("Could not decode address");
20
- }
10
+ try {
11
+ return toHexString(bech32.fromWords(bech32.decode(address).words));
12
+ } catch (_e) {
13
+ throw new Error("Could not decode address");
14
+ }
21
15
  }
22
16
  function chainAddressfromKeyhash(prefix, keyhash) {
23
- const words = bech32_1.bech32.toWords(Buffer.from(keyhash, "hex"));
24
- return keyhash !== ""
25
- ? bech32_1.bech32.encode(prefix, words)
26
- : "";
17
+ const words = bech32.toWords(Buffer.from(keyhash, "hex"));
18
+ return keyhash !== "" ? bech32.encode(prefix, words) : "";
27
19
  }
20
+
21
+ //#endregion
22
+ export { chainAddressfromKeyhash, keyHashfromAddress, toHexString };
23
+ //# sourceMappingURL=bech32.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bech32.js","names":[],"sources":["../../src/utils/bech32.ts"],"sourcesContent":["import {\n bech32,\n} from \"bech32\";\n\nfunction toHexString(byteArray: number[]) {\n return Array.prototype.map\n .call(\n byteArray, (byte) => {\n return (\"0\" + (byte & 0xff).toString(16)).slice(-2);\n },\n )\n .join(\"\");\n}\nfunction keyHashfromAddress(address: string): string {\n try {\n return toHexString(bech32.fromWords(bech32.decode(address).words));\n }\n catch (_e) {\n throw new Error(\"Could not decode address\");\n }\n}\nfunction chainAddressfromKeyhash(prefix: string, keyhash: string) {\n const words = bech32.toWords(Buffer.from(\n keyhash, \"hex\",\n ));\n\n return keyhash !== \"\"\n ? bech32.encode(\n prefix, words,\n )\n : \"\";\n}\n\nexport {\n chainAddressfromKeyhash, keyHashfromAddress, toHexString,\n};\n"],"mappings":";;;AAIA,SAAS,YAAY,WAAqB;AACxC,QAAO,MAAM,UAAU,IACpB,KACC,YAAY,SAAS;AACnB,UAAQ,OAAO,OAAO,KAAM,SAAS,GAAG,EAAE,MAAM,GAAG;GAEtD,CACA,KAAK,GAAG;;AAEb,SAAS,mBAAmB,SAAyB;AACnD,KAAI;AACF,SAAO,YAAY,OAAO,UAAU,OAAO,OAAO,QAAQ,CAAC,MAAM,CAAC;UAE7D,IAAI;AACT,QAAM,IAAI,MAAM,2BAA2B;;;AAG/C,SAAS,wBAAwB,QAAgB,SAAiB;CAChE,MAAM,QAAQ,OAAO,QAAQ,OAAO,KAClC,SAAS,MACV,CAAC;AAEF,QAAO,YAAY,KACf,OAAO,OACP,QAAQ,MACT,GACC"}
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/utils/bigint.ts
3
+ const toPlainObject = (obj) => {
4
+ return JSON.parse(JSON.stringify(obj, (key, value) => typeof value === "bigint" ? value.toString() : value));
5
+ };
6
+
7
+ //#endregion
8
+ exports.toPlainObject = toPlainObject;
9
+ //# sourceMappingURL=bigint.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigint.cjs","names":[],"sources":["../../src/utils/bigint.ts"],"sourcesContent":["const toPlainObject = (obj: unknown) => {\n return JSON.parse(JSON.stringify(obj,\n (key, value) => (typeof value === \"bigint\" ? value.toString() : value), // return everything else unchanged\n ));\n};\nexport {\n toPlainObject,\n};\n"],"mappings":";;AAAA,MAAM,iBAAiB,QAAiB;AACtC,QAAO,KAAK,MAAM,KAAK,UAAU,MAC9B,KAAK,UAAW,OAAO,UAAU,WAAW,MAAM,UAAU,GAAG,MACjE,CAAC"}
@@ -0,0 +1,5 @@
1
+ //#region src/utils/bigint.d.ts
2
+ declare const toPlainObject: (obj: unknown) => any;
3
+ //#endregion
4
+ export { toPlainObject };
5
+ //# sourceMappingURL=bigint.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigint.d.cts","names":[],"sources":["../../src/utils/bigint.ts"],"sourcesContent":[],"mappings":";cAAM"}
@@ -1,3 +1,5 @@
1
+ //#region src/utils/bigint.d.ts
1
2
  declare const toPlainObject: (obj: unknown) => any;
2
- export { toPlainObject, };
3
+ //#endregion
4
+ export { toPlainObject };
3
5
  //# sourceMappingURL=bigint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bigint.d.ts","sourceRoot":"","sources":["../../src/utils/bigint.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa,GAAI,KAAK,OAAO,QAIlC,CAAC;AACF,OAAO,EACL,aAAa,GACd,CAAC"}
1
+ {"version":3,"file":"bigint.d.ts","names":[],"sources":["../../src/utils/bigint.ts"],"sourcesContent":[],"mappings":";cAAM"}
@@ -1,7 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toPlainObject = void 0;
1
+ //#region src/utils/bigint.ts
4
2
  const toPlainObject = (obj) => {
5
- return JSON.parse(JSON.stringify(obj, (key, value) => (typeof value === "bigint" ? value.toString() : value)));
3
+ return JSON.parse(JSON.stringify(obj, (key, value) => typeof value === "bigint" ? value.toString() : value));
6
4
  };
7
- exports.toPlainObject = toPlainObject;
5
+
6
+ //#endregion
7
+ export { toPlainObject };
8
+ //# sourceMappingURL=bigint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigint.js","names":[],"sources":["../../src/utils/bigint.ts"],"sourcesContent":["const toPlainObject = (obj: unknown) => {\n return JSON.parse(JSON.stringify(obj,\n (key, value) => (typeof value === \"bigint\" ? value.toString() : value), // return everything else unchanged\n ));\n};\nexport {\n toPlainObject,\n};\n"],"mappings":";AAAA,MAAM,iBAAiB,QAAiB;AACtC,QAAO,KAAK,MAAM,KAAK,UAAU,MAC9B,KAAK,UAAW,OAAO,UAAU,WAAW,MAAM,UAAU,GAAG,MACjE,CAAC"}
@@ -0,0 +1,22 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_bech32 = require('./bech32.cjs');
3
+ const require_bigint = require('./bigint.cjs');
4
+ const require_text = require('./text.cjs');
5
+
6
+ //#region src/utils/index.ts
7
+ var utils_exports = /* @__PURE__ */ require_rolldown_runtime.__export({
8
+ chainAddressfromKeyhash: () => require_bech32.chainAddressfromKeyhash,
9
+ decodeAttr: () => require_text.decodeAttr,
10
+ keyHashfromAddress: () => require_bech32.keyHashfromAddress,
11
+ toHexString: () => require_bech32.toHexString,
12
+ toPlainObject: () => require_bigint.toPlainObject
13
+ });
14
+
15
+ //#endregion
16
+ Object.defineProperty(exports, 'utils_exports', {
17
+ enumerable: true,
18
+ get: function () {
19
+ return utils_exports;
20
+ }
21
+ });
22
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from \"./bech32\";\nexport * from \"./bigint\";\nexport * from \"./text\";\n"],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { chainAddressfromKeyhash, keyHashfromAddress, toHexString } from "./bech32.cjs";
2
+ import { toPlainObject } from "./bigint.cjs";
3
+ import { decodeAttr } from "./text.cjs";
4
+
5
+ //#region src/utils/index.d.ts
6
+ declare namespace index_d_exports {
7
+ export { chainAddressfromKeyhash, decodeAttr, keyHashfromAddress, toHexString, toPlainObject };
8
+ }
9
+ //#endregion
10
+ export { index_d_exports };
11
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":[],"mappings":""}
@@ -1,4 +1,11 @@
1
- export * from "./bech32";
2
- export * from "./bigint";
3
- export * from "./text";
1
+ import { chainAddressfromKeyhash, keyHashfromAddress, toHexString } from "./bech32.js";
2
+ import { toPlainObject } from "./bigint.js";
3
+ import { decodeAttr } from "./text.js";
4
+
5
+ //#region src/utils/index.d.ts
6
+ declare namespace index_d_exports {
7
+ export { chainAddressfromKeyhash, decodeAttr, keyHashfromAddress, toHexString, toPlainObject };
8
+ }
9
+ //#endregion
10
+ export { index_d_exports };
4
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":[],"mappings":""}
@@ -1,19 +1,17 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./bech32"), exports);
18
- __exportStar(require("./bigint"), exports);
19
- __exportStar(require("./text"), exports);
1
+ import { __export } from "../_virtual/rolldown_runtime.js";
2
+ import { chainAddressfromKeyhash, keyHashfromAddress, toHexString } from "./bech32.js";
3
+ import { toPlainObject } from "./bigint.js";
4
+ import { decodeAttr } from "./text.js";
5
+
6
+ //#region src/utils/index.ts
7
+ var utils_exports = /* @__PURE__ */ __export({
8
+ chainAddressfromKeyhash: () => chainAddressfromKeyhash,
9
+ decodeAttr: () => decodeAttr,
10
+ keyHashfromAddress: () => keyHashfromAddress,
11
+ toHexString: () => toHexString,
12
+ toPlainObject: () => toPlainObject
13
+ });
14
+
15
+ //#endregion
16
+ export { utils_exports };
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from \"./bech32\";\nexport * from \"./bigint\";\nexport * from \"./text\";\n"],"mappings":""}
@@ -0,0 +1,11 @@
1
+
2
+ //#region src/utils/text.ts
3
+ const decodeAttr = (x) => {
4
+ if (typeof x === "string") return x;
5
+ else if (x instanceof Uint8Array) return Buffer.from(x).toString();
6
+ else return "";
7
+ };
8
+
9
+ //#endregion
10
+ exports.decodeAttr = decodeAttr;
11
+ //# sourceMappingURL=text.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.cjs","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":["export const decodeAttr = (x: Uint8Array | string) => {\n if (typeof x === \"string\") {\n return x;\n }\n else if (x instanceof Uint8Array) {\n return Buffer.from(x).toString();\n }\n else {\n return \"\";\n }\n};\n"],"mappings":";;AAAA,MAAa,cAAc,MAA2B;AACpD,KAAI,OAAO,MAAM,SACf,QAAO;UAEA,aAAa,WACpB,QAAO,OAAO,KAAK,EAAE,CAAC,UAAU;KAGhC,QAAO"}
@@ -0,0 +1,5 @@
1
+ //#region src/utils/text.d.ts
2
+ declare const decodeAttr: (x: Uint8Array | string) => string;
3
+ //#endregion
4
+ export { decodeAttr };
5
+ //# sourceMappingURL=text.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.cts","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":[],"mappings":";cAAa,gBAAiB"}
@@ -1,2 +1,5 @@
1
- export declare const decodeAttr: (x: Uint8Array | string) => string;
1
+ //#region src/utils/text.d.ts
2
+ declare const decodeAttr: (x: Uint8Array | string) => string;
3
+ //#endregion
4
+ export { decodeAttr };
2
5
  //# sourceMappingURL=text.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/utils/text.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GAAI,GAAG,UAAU,GAAG,MAAM,WAUhD,CAAC"}
1
+ {"version":3,"file":"text.d.ts","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":[],"mappings":";cAAa,gBAAiB"}
@@ -1,15 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decodeAttr = void 0;
1
+ //#region src/utils/text.ts
4
2
  const decodeAttr = (x) => {
5
- if (typeof x === "string") {
6
- return x;
7
- }
8
- else if (x instanceof Uint8Array) {
9
- return Buffer.from(x).toString();
10
- }
11
- else {
12
- return "";
13
- }
3
+ if (typeof x === "string") return x;
4
+ else if (x instanceof Uint8Array) return Buffer.from(x).toString();
5
+ else return "";
14
6
  };
15
- exports.decodeAttr = decodeAttr;
7
+
8
+ //#endregion
9
+ export { decodeAttr };
10
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.js","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":["export const decodeAttr = (x: Uint8Array | string) => {\n if (typeof x === \"string\") {\n return x;\n }\n else if (x instanceof Uint8Array) {\n return Buffer.from(x).toString();\n }\n else {\n return \"\";\n }\n};\n"],"mappings":";AAAA,MAAa,cAAc,MAA2B;AACpD,KAAI,OAAO,MAAM,SACf,QAAO;UAEA,aAAa,WACpB,QAAO,OAAO,KAAK,EAAE,CAAC,UAAU;KAGhC,QAAO"}
package/package.json CHANGED
@@ -1,27 +1,30 @@
1
1
  {
2
2
  "name": "@eclesia/indexer-engine",
3
- "version": "2.7.7",
3
+ "version": "2.8.1",
4
4
  "description": "Core eclesia indexer engine",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
5
  "scripts": {
8
- "build": "tsc",
6
+ "build": "tsc --noEmit && tsdown",
9
7
  "lint": "eslint",
10
8
  "lint:fix": "eslint --fix",
11
9
  "test": "vitest",
12
- "start": "node --experimental-require-module dist/index.js"
10
+ "start": "node dist/index.mjs"
13
11
  },
14
12
  "files": [
15
13
  "dist/",
16
14
  "scripts/",
17
15
  "templates"
18
16
  ],
17
+ "engines": {
18
+ "node": ">=20"
19
+ },
20
+ "type": "module",
19
21
  "keywords": [],
20
22
  "contributors": [
21
23
  "Alex M.<alex.megalokonomos@tendermint.com>"
22
24
  ],
23
25
  "license": "Apache-2.0",
24
26
  "devDependencies": {
27
+ "@arethetypeswrong/core": "^0.18.2",
25
28
  "@eslint/js": "^9.35.0",
26
29
  "@stylistic/eslint-plugin": "^5.3.1",
27
30
  "@types/node": "^22.14.0",
@@ -30,6 +33,7 @@
30
33
  "@types/uuid": "^11.0.0",
31
34
  "eslint": "^9.35.0",
32
35
  "eslint-plugin-simple-import-sort": "^12.1.1",
36
+ "tsdown": "^0.15.2",
33
37
  "typescript": "^5.9.2",
34
38
  "typescript-eslint": "^8.44.0",
35
39
  "vitest": "^3.2.4"
@@ -48,5 +52,19 @@
48
52
  "uuid": "^13.0.0",
49
53
  "winston": "^3.17.0"
50
54
  },
51
- "type": "commonjs"
55
+ "main": "dist/index.cjs",
56
+ "module": "dist/index.js",
57
+ "types": "dist/index.d.cts",
58
+ "exports": {
59
+ ".": {
60
+ "import": {
61
+ "types": "./dist/index.d.ts",
62
+ "default": "./dist/index.js"
63
+ },
64
+ "require": "./dist/index.cjs",
65
+ "types": "./dist/index.d.ts",
66
+ "default": "./dist/index.js"
67
+ },
68
+ "./package.json": "./package.json"
69
+ }
52
70
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}