@eclesia/indexer-engine 2.8.2 → 2.9.0

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 (57) hide show
  1. package/dist/emitter/index.cjs +8 -0
  2. package/dist/emitter/index.cjs.map +1 -1
  3. package/dist/emitter/index.d.cts +12 -0
  4. package/dist/emitter/index.d.cts.map +1 -1
  5. package/dist/emitter/index.d.ts +12 -0
  6. package/dist/emitter/index.d.ts.map +1 -1
  7. package/dist/emitter/index.js +8 -0
  8. package/dist/emitter/index.js.map +1 -1
  9. package/dist/indexer/index.cjs +11 -2
  10. package/dist/indexer/index.cjs.map +1 -1
  11. package/dist/indexer/index.d.cts +23 -1
  12. package/dist/indexer/index.d.cts.map +1 -1
  13. package/dist/indexer/index.d.ts +23 -1
  14. package/dist/indexer/index.d.ts.map +1 -1
  15. package/dist/indexer/index.js +11 -2
  16. package/dist/indexer/index.js.map +1 -1
  17. package/dist/promise-queue/index.cjs +12 -1
  18. package/dist/promise-queue/index.cjs.map +1 -1
  19. package/dist/promise-queue/index.d.cts +26 -0
  20. package/dist/promise-queue/index.d.cts.map +1 -1
  21. package/dist/promise-queue/index.d.ts +26 -0
  22. package/dist/promise-queue/index.d.ts.map +1 -1
  23. package/dist/promise-queue/index.js +12 -1
  24. package/dist/promise-queue/index.js.map +1 -1
  25. package/dist/types/index.cjs.map +1 -1
  26. package/dist/types/index.d.cts +8 -1
  27. package/dist/types/index.d.cts.map +1 -1
  28. package/dist/types/index.d.ts +8 -1
  29. package/dist/types/index.d.ts.map +1 -1
  30. package/dist/types/index.js.map +1 -1
  31. package/dist/utils/bech32.cjs +17 -0
  32. package/dist/utils/bech32.cjs.map +1 -1
  33. package/dist/utils/bech32.d.cts +17 -0
  34. package/dist/utils/bech32.d.cts.map +1 -1
  35. package/dist/utils/bech32.d.ts +17 -0
  36. package/dist/utils/bech32.d.ts.map +1 -1
  37. package/dist/utils/bech32.js +17 -0
  38. package/dist/utils/bech32.js.map +1 -1
  39. package/dist/utils/bigint.cjs +6 -0
  40. package/dist/utils/bigint.cjs.map +1 -1
  41. package/dist/utils/bigint.d.cts +6 -0
  42. package/dist/utils/bigint.d.cts.map +1 -1
  43. package/dist/utils/bigint.d.ts +6 -0
  44. package/dist/utils/bigint.d.ts.map +1 -1
  45. package/dist/utils/bigint.js +6 -0
  46. package/dist/utils/bigint.js.map +1 -1
  47. package/dist/utils/index.cjs.map +1 -1
  48. package/dist/utils/index.js.map +1 -1
  49. package/dist/utils/text.cjs +6 -0
  50. package/dist/utils/text.cjs.map +1 -1
  51. package/dist/utils/text.d.cts +6 -0
  52. package/dist/utils/text.d.cts.map +1 -1
  53. package/dist/utils/text.d.ts +6 -0
  54. package/dist/utils/text.d.ts.map +1 -1
  55. package/dist/utils/text.js +6 -0
  56. package/dist/utils/text.js.map +1 -1
  57. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;KAoBY,oBAAA;;;;;gCAKoB;;;;;;;;eAQjB;0BACW;uCACa;AAfvC,CAAA;AAAgC,KAkBpB,cAAA,GAAiB,cAlBG,CAAA,CAkBa,aAlBb,EAkB4B,oBAlB5B,EAkBkD,UAlBlD,CAAA,CAAA;AAKA,KAcpB,iBAAA,GAAoB,cAdA,CAAA,CAcgB,aAdhB,EAc+B,oBAd/B,CAAA,CAAA;AAQjB,KAOH,UAAA,GAAa,cAPV,GAO2B,iBAP3B;AACW,KAOd,iBAPc,CAAA,CAAA,CAAA,GAAA,QACa,MAOzB,CAPyB,GAOrB,CAPqB,CAOnB,CAPmB,CAAA,GAAA;EAAO,IAAA,CAAA,EAAA,MAAA;EAGlC,MAAA,CAAA,EAAA,MAAc;EAAA,SAAA,CAAA,EAAA,MAAA;;AAAwD,KAUtE,QAVsE,CAAA,UAAA,MAU7C,iBAV6C,CAU3B,QAV2B,CAAA,CAAA,GAAA,CAAA,CAAA,EAW7E,CAX6E,EAAA,CAAA,EAY7E,iBAZ6E,CAY3D,QAZ2D,CAAA,CAYjD,CAZiD,CAAA,EAAA,GAa7E,OAb6E,CAAA,IAAA,GAAA,IAAA,EAAA,CAAA;AAArD,KAejB,QAAA,GAfiB;EAAc,IAAA,EAAA,KAAA,GAAA,MAAA,GAAA,SAAA,GAAA,OAAA,GAAA,SAAA,GAAA,WAAA;EAC/B,OAAA,EAAA,MAAA;CAAiB;AAAmB,KAkBpC,SAAA,GAlBoC;MAAe,EAAA,MAAA;OAA/B,CAAA,EAAA,MAAA;EAAc,MAAA,EAAA,OAAA;AAC9C,CAAA;AAAsB,KAsBV,MAAA,GAtBU;KAAG,EAuBlB,QAvBkB;MAAiB,EAwBlC,SAxBkC;EAAiB,WAAA,EAAA;IAC/C,KAAA,EAAA;MAAiB,MAAA,EA0Bf,oBA1Be,CAAA,kBAAA,CAAA;MACf,UAAA,EA0BI,SA1BJ,EAAA,GAAA,SAAA;IAAI,CAAA;;EAAG,KAAA,EAAA;IAMT,KAAA,EAAQ;MAAA,KAAA,EA0BP,aA1BO;MAAmC,aAAA,EA2BlC,oBA3BkC;IAAlB,CAAA;;WAEd,EAAA;IAAlB,KAAA,EA6BM,oBA7BN,CAAA,gBAAA,CAAA;;WACA,EAAA;IAAO,KAAA,EA+BD,oBA/BC,CAAA,SAAA,CAAA;EAEA,CAAA;EAIA,OAAA,EAAA;IAKA,KAAM,EAAA;MAAA,MAAA,EAAA,MAAA;MACX,MAAA,EAwBO,MAxBP;IACC,CAAA;;YAIU,EAAA;IAML,IAAA,EAAA,MAAA;IACQ,KAAA,EAAA,OAAA;;eAOV,EAAA;IAKG,KAAA,EAAA,IAAA;EAAM,CAAA;EAiBR,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
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;KAsBY,oBAAA;;;;;gCAKoB;;;8BAGF;;;;;eAKf;0BACW;EAdd,cAAA,EAAA,CAAA,MAAoB,EAAA,OAAA,EAAA,GAeO,OAfP,CAAA,IAAA,CAAA;CAAA;;AAQF,KAWlB,cAAA,GAAiB,cAXC,CAAA,CAWe,aAXf,EAW8B,oBAX9B,EAWoD,UAXpD,CAAA,CAAA;;AAMJ,KAQd,iBAAA,GAAoB,cARN,CAAA,CAQsB,aARtB,EAQqC,oBARrC,CAAA,CAAA;;AACoB,KAUlC,UAAA,GAAa,cAVqB,GAUJ,iBAVI;AAI9C;AAA0B,KASd,iBATc,CAAA,CAAA,CAAA,GAAA,QAAmB,MAU/B,CAV+B,GAU3B,CAV2B,CAUzB,CAVyB,CAAA,GAAA;EAAe,IAAA,CAAA,EAAA,MAAA;EAAsB,MAAA,CAAA,EAAA,MAAA;EAArD,SAAA,CAAA,EAAA,MAAA;AAAc,CAAA,EAG3C;;AAAgD,KAepC,QAfoC,CAAA,UAAA,MAeX,iBAfW,CAeO,QAfP,CAAA,CAAA,GAAA,CAAA,CAAA,EAgB3C,CAhB2C,EAAA,CAAA,EAiB3C,iBAjB2C,CAiBzB,QAjByB,CAAA,CAiBf,CAjBe,CAAA,EAAA,GAkB3C,OAlB2C,CAAA,IAAA,GAAA,IAAA,EAAA,CAAA;AAAe,KAoBnD,QAAA,GApBmD;MAA/B,EAAA,KAAA,GAAA,MAAA,GAAA,SAAA,GAAA,OAAA,GAAA,SAAA,GAAA,WAAA;EAAc,OAAA,EAAA,MAAA;AAG9C,CAAA;AAAsB,KAqBV,SAAA,GArBU;MAAG,EAAA,MAAA;OAAiB,CAAA,EAAA,MAAA;EAAiB,MAAA,EAAA,OAAA;AAG3D,CAAA;AAA6B,KAuBjB,MAAA,GAvBiB;KACf,EAuBP,QAvBO;MAAI,EAwBV,SAxBU;aAAE,EAAA;IAAC,KAAA,EAAA;MAQT,MAAQ,EAmBN,oBAnBM,CAAA,kBAAA,CAAA;MAAA,UAAA,EAoBF,SApBE,EAAA,GAAA,SAAA;IAAmC,CAAA;;OAClD,EAAA;IACkB,KAAA,EAAA;MAAlB,KAAA,EAwBQ,aAxBR;MAA4B,aAAA,EAyBZ,oBAzBY;IAC5B,CAAA;EAAO,CAAA;EAEA,SAAA,EAAQ;IAIR,KAAA,EAsBD,oBAtBU,CAAA,gBAAA,CAAA;EAKT,CAAA;EAAM,SAAA,EAAA;IACX,KAAA,EAmBI,oBAnBJ,CAAA,SAAA,CAAA;;SAIO,EAAA;IACI,KAAA,EAAA;MAML,MAAA,EAAA,MAAA;MACQ,MAAA,EAYP,MAZO;IAIV,CAAA;;YAQG,EAAA;IAAM,IAAA,EAAA,MAAA;IAiBR,KAAA,EAAQ,OAAA;EAAA,CAAA;eACd,EAAA;IACI,KAAA,EAAA,IAAA;EAAK,CAAA;EAIE,cAAA,EAAA;IAAc,KAAA,EAAA,IAAA;;iBAKhB,EAAA;IAAO,KAAA,EAAA,IAAA;;;KAXV;MACN;UACI;;;UAIO,cAAA;WACN;;;;eAII"}
@@ -1 +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":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":["/* eslint-disable @stylistic/no-multi-spaces */\nimport {\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\n/** Configuration interface for the Eclesia indexer */\nexport type EcleciaIndexerConfig = {\n startHeight?: number // Block height to start indexing from\n endHeight?: number // Block height to stop indexing at (optional)\n batchSize: number // Number of blocks to process in parallel\n modules: string[] // List of module names to enable\n getNextHeight: () => number | PromiseLike<number> // Function to determine next block to process\n logLevel: \"error\" | \"warn\" | \"info\" | \"http\" | \"verbose\" | \"debug\" | \"silly\" // Logging verbosity level\n rpcUrl: string // Tendermint RPC endpoint URL\n shouldProcessGenesis: () => Promise<boolean> // Whether to process genesis state\n genesisPath?: string // Path to genesis file\n usePolling?: boolean // Use polling instead of WebSocket subscription\n pollingInterval?: number // Interval between polls in milliseconds\n minimal?: boolean // Use minimal indexing mode (blocks only)\n init?: () => Promise<void> // Custom initialization function\n beginTransaction: () => Promise<void> // Function to begin database transaction\n endTransaction: (status: boolean) => Promise<void> // Function to end database transaction\n};\n\n/** Queue for full indexing mode with validator data */\nexport type FullBlockQueue = CircularBuffer<[BlockResponse, BlockResultsResponse, Uint8Array]>;\n\n/** Queue for minimal indexing mode without validator data */\nexport type MinimalBlockQueue = CircularBuffer<[BlockResponse, BlockResultsResponse]>;\n\n/** Union type for block queues */\nexport type BlockQueue = FullBlockQueue | MinimalBlockQueue;\n\n/** Utility type to add height, timestamp, and UUID to event types */\nexport type WithHeightAndUUID<T> = {\n [K in keyof T]: T[K] & {\n uuid?: string // Unique identifier for event tracking\n height?: number // Block height when event occurred\n timestamp?: string // Block timestamp when event occurred\n };\n};\n\n/** Function signature for emitting events asynchronously */\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\n/** Interface that all indexing modules must implement */\nexport interface IndexingModule {\n indexer: EcleciaIndexer // Reference to the main indexer instance\n name: string // Unique module name\n depends: string[] // Array of module names this module depends on\n provides: string[] // Array of capabilities this module provides\n setup: () => Promise<void> // Async setup function for database schema initialization\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n init: (...args: any[]) => void // Initialization function called by the indexer\n}\n"],"mappings":""}
@@ -3,11 +3,22 @@ let bech32 = require("bech32");
3
3
  bech32 = require_rolldown_runtime.__toESM(bech32);
4
4
 
5
5
  //#region src/utils/bech32.ts
6
+ /**
7
+ * Converts a byte array to a hexadecimal string representation
8
+ * @param byteArray - Array of bytes to convert
9
+ * @returns Hexadecimal string
10
+ */
6
11
  function toHexString(byteArray) {
7
12
  return Array.prototype.map.call(byteArray, (byte) => {
8
13
  return ("0" + (byte & 255).toString(16)).slice(-2);
9
14
  }).join("");
10
15
  }
16
+ /**
17
+ * Extracts the key hash from a bech32-encoded address
18
+ * @param address - Bech32-encoded address string
19
+ * @returns Hexadecimal key hash
20
+ * @throws Error if address cannot be decoded
21
+ */
11
22
  function keyHashfromAddress(address) {
12
23
  try {
13
24
  return toHexString(bech32.bech32.fromWords(bech32.bech32.decode(address).words));
@@ -15,6 +26,12 @@ function keyHashfromAddress(address) {
15
26
  throw new Error("Could not decode address");
16
27
  }
17
28
  }
29
+ /**
30
+ * Creates a bech32-encoded address from a key hash and prefix
31
+ * @param prefix - Address prefix (e.g., "cosmos", "cosmosvalcons")
32
+ * @param keyhash - Hexadecimal key hash
33
+ * @returns Bech32-encoded address or empty string if keyhash is empty
34
+ */
18
35
  function chainAddressfromKeyhash(prefix, keyhash) {
19
36
  const words = bech32.bech32.toWords(Buffer.from(keyhash, "hex"));
20
37
  return keyhash !== "" ? bech32.bech32.encode(prefix, words) : "";
@@ -1 +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"}
1
+ {"version":3,"file":"bech32.cjs","names":[],"sources":["../../src/utils/bech32.ts"],"sourcesContent":["import {\n bech32,\n} from \"bech32\";\n\n/**\n * Converts a byte array to a hexadecimal string representation\n * @param byteArray - Array of bytes to convert\n * @returns Hexadecimal string\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}\n\n/**\n * Extracts the key hash from a bech32-encoded address\n * @param address - Bech32-encoded address string\n * @returns Hexadecimal key hash\n * @throws Error if address cannot be decoded\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}\n\n/**\n * Creates a bech32-encoded address from a key hash and prefix\n * @param prefix - Address prefix (e.g., \"cosmos\", \"cosmosvalcons\")\n * @param keyhash - Hexadecimal key hash\n * @returns Bech32-encoded address or empty string if keyhash is empty\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":";;;;;;;;;;AASA,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;;;;;;;;AASb,SAAS,mBAAmB,SAAyB;AACnD,KAAI;AACF,SAAO,YAAY,cAAO,UAAU,cAAO,OAAO,QAAQ,CAAC,MAAM,CAAC;UAE7D,IAAI;AACT,QAAM,IAAI,MAAM,2BAA2B;;;;;;;;;AAU/C,SAAS,wBAAwB,QAAgB,SAAiB;CAChE,MAAM,QAAQ,cAAO,QAAQ,OAAO,KAClC,SAAS,MACV,CAAC;AAEF,QAAO,YAAY,KACf,cAAO,OACP,QAAQ,MACT,GACC"}
@@ -1,6 +1,23 @@
1
1
  //#region src/utils/bech32.d.ts
2
+ /**
3
+ * Converts a byte array to a hexadecimal string representation
4
+ * @param byteArray - Array of bytes to convert
5
+ * @returns Hexadecimal string
6
+ */
2
7
  declare function toHexString(byteArray: number[]): string;
8
+ /**
9
+ * Extracts the key hash from a bech32-encoded address
10
+ * @param address - Bech32-encoded address string
11
+ * @returns Hexadecimal key hash
12
+ * @throws Error if address cannot be decoded
13
+ */
3
14
  declare function keyHashfromAddress(address: string): string;
15
+ /**
16
+ * Creates a bech32-encoded address from a key hash and prefix
17
+ * @param prefix - Address prefix (e.g., "cosmos", "cosmosvalcons")
18
+ * @param keyhash - Hexadecimal key hash
19
+ * @returns Bech32-encoded address or empty string if keyhash is empty
20
+ */
4
21
  declare function chainAddressfromKeyhash(prefix: string, keyhash: string): string;
5
22
  //#endregion
6
23
  export { chainAddressfromKeyhash, keyHashfromAddress, toHexString };
@@ -1 +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
+ {"version":3,"file":"bech32.d.cts","names":[],"sources":["../../src/utils/bech32.ts"],"sourcesContent":[],"mappings":";;;AASoB;AAgBO;;iBAhBlB,WAAA;;;;;;;iBAgBA,kBAAA;;;;;;;iBAeA,uBAAA"}
@@ -1,6 +1,23 @@
1
1
  //#region src/utils/bech32.d.ts
2
+ /**
3
+ * Converts a byte array to a hexadecimal string representation
4
+ * @param byteArray - Array of bytes to convert
5
+ * @returns Hexadecimal string
6
+ */
2
7
  declare function toHexString(byteArray: number[]): string;
8
+ /**
9
+ * Extracts the key hash from a bech32-encoded address
10
+ * @param address - Bech32-encoded address string
11
+ * @returns Hexadecimal key hash
12
+ * @throws Error if address cannot be decoded
13
+ */
3
14
  declare function keyHashfromAddress(address: string): string;
15
+ /**
16
+ * Creates a bech32-encoded address from a key hash and prefix
17
+ * @param prefix - Address prefix (e.g., "cosmos", "cosmosvalcons")
18
+ * @param keyhash - Hexadecimal key hash
19
+ * @returns Bech32-encoded address or empty string if keyhash is empty
20
+ */
4
21
  declare function chainAddressfromKeyhash(prefix: string, keyhash: string): string;
5
22
  //#endregion
6
23
  export { chainAddressfromKeyhash, keyHashfromAddress, toHexString };
@@ -1 +1 @@
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
+ {"version":3,"file":"bech32.d.ts","names":[],"sources":["../../src/utils/bech32.ts"],"sourcesContent":[],"mappings":";;;AASoB;AAgBO;;iBAhBlB,WAAA;;;;;;;iBAgBA,kBAAA;;;;;;;iBAeA,uBAAA"}
@@ -1,11 +1,22 @@
1
1
  import { bech32 } from "bech32";
2
2
 
3
3
  //#region src/utils/bech32.ts
4
+ /**
5
+ * Converts a byte array to a hexadecimal string representation
6
+ * @param byteArray - Array of bytes to convert
7
+ * @returns Hexadecimal string
8
+ */
4
9
  function toHexString(byteArray) {
5
10
  return Array.prototype.map.call(byteArray, (byte) => {
6
11
  return ("0" + (byte & 255).toString(16)).slice(-2);
7
12
  }).join("");
8
13
  }
14
+ /**
15
+ * Extracts the key hash from a bech32-encoded address
16
+ * @param address - Bech32-encoded address string
17
+ * @returns Hexadecimal key hash
18
+ * @throws Error if address cannot be decoded
19
+ */
9
20
  function keyHashfromAddress(address) {
10
21
  try {
11
22
  return toHexString(bech32.fromWords(bech32.decode(address).words));
@@ -13,6 +24,12 @@ function keyHashfromAddress(address) {
13
24
  throw new Error("Could not decode address");
14
25
  }
15
26
  }
27
+ /**
28
+ * Creates a bech32-encoded address from a key hash and prefix
29
+ * @param prefix - Address prefix (e.g., "cosmos", "cosmosvalcons")
30
+ * @param keyhash - Hexadecimal key hash
31
+ * @returns Bech32-encoded address or empty string if keyhash is empty
32
+ */
16
33
  function chainAddressfromKeyhash(prefix, keyhash) {
17
34
  const words = bech32.toWords(Buffer.from(keyhash, "hex"));
18
35
  return keyhash !== "" ? bech32.encode(prefix, words) : "";
@@ -1 +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"}
1
+ {"version":3,"file":"bech32.js","names":[],"sources":["../../src/utils/bech32.ts"],"sourcesContent":["import {\n bech32,\n} from \"bech32\";\n\n/**\n * Converts a byte array to a hexadecimal string representation\n * @param byteArray - Array of bytes to convert\n * @returns Hexadecimal string\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}\n\n/**\n * Extracts the key hash from a bech32-encoded address\n * @param address - Bech32-encoded address string\n * @returns Hexadecimal key hash\n * @throws Error if address cannot be decoded\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}\n\n/**\n * Creates a bech32-encoded address from a key hash and prefix\n * @param prefix - Address prefix (e.g., \"cosmos\", \"cosmosvalcons\")\n * @param keyhash - Hexadecimal key hash\n * @returns Bech32-encoded address or empty string if keyhash is empty\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":";;;;;;;;AASA,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;;;;;;;;AASb,SAAS,mBAAmB,SAAyB;AACnD,KAAI;AACF,SAAO,YAAY,OAAO,UAAU,OAAO,OAAO,QAAQ,CAAC,MAAM,CAAC;UAE7D,IAAI;AACT,QAAM,IAAI,MAAM,2BAA2B;;;;;;;;;AAU/C,SAAS,wBAAwB,QAAgB,SAAiB;CAChE,MAAM,QAAQ,OAAO,QAAQ,OAAO,KAClC,SAAS,MACV,CAAC;AAEF,QAAO,YAAY,KACf,OAAO,OACP,QAAQ,MACT,GACC"}
@@ -1,5 +1,11 @@
1
1
 
2
2
  //#region src/utils/bigint.ts
3
+ /**
4
+ * Converts an object containing BigInt values to a plain JavaScript object
5
+ * BigInt values are converted to strings to maintain precision in JSON serialization
6
+ * @param obj - Object that may contain BigInt values
7
+ * @returns Plain object with BigInt values converted to strings
8
+ */
3
9
  const toPlainObject = (obj) => {
4
10
  return JSON.parse(JSON.stringify(obj, (key, value) => typeof value === "bigint" ? value.toString() : value));
5
11
  };
@@ -1 +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"}
1
+ {"version":3,"file":"bigint.cjs","names":[],"sources":["../../src/utils/bigint.ts"],"sourcesContent":["/**\n * Converts an object containing BigInt values to a plain JavaScript object\n * BigInt values are converted to strings to maintain precision in JSON serialization\n * @param obj - Object that may contain BigInt values\n * @returns Plain object with BigInt values converted to strings\n */\nconst 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":";;;;;;;;AAMA,MAAM,iBAAiB,QAAiB;AACtC,QAAO,KAAK,MAAM,KAAK,UAAU,MAC9B,KAAK,UAAW,OAAO,UAAU,WAAW,MAAM,UAAU,GAAG,MACjE,CAAC"}
@@ -1,4 +1,10 @@
1
1
  //#region src/utils/bigint.d.ts
2
+ /**
3
+ * Converts an object containing BigInt values to a plain JavaScript object
4
+ * BigInt values are converted to strings to maintain precision in JSON serialization
5
+ * @param obj - Object that may contain BigInt values
6
+ * @returns Plain object with BigInt values converted to strings
7
+ */
2
8
  declare const toPlainObject: (obj: unknown) => any;
3
9
  //#endregion
4
10
  export { toPlainObject };
@@ -1 +1 @@
1
- {"version":3,"file":"bigint.d.cts","names":[],"sources":["../../src/utils/bigint.ts"],"sourcesContent":[],"mappings":";cAAM"}
1
+ {"version":3,"file":"bigint.d.cts","names":[],"sources":["../../src/utils/bigint.ts"],"sourcesContent":[],"mappings":";;;;;;;cAMM"}
@@ -1,4 +1,10 @@
1
1
  //#region src/utils/bigint.d.ts
2
+ /**
3
+ * Converts an object containing BigInt values to a plain JavaScript object
4
+ * BigInt values are converted to strings to maintain precision in JSON serialization
5
+ * @param obj - Object that may contain BigInt values
6
+ * @returns Plain object with BigInt values converted to strings
7
+ */
2
8
  declare const toPlainObject: (obj: unknown) => any;
3
9
  //#endregion
4
10
  export { toPlainObject };
@@ -1 +1 @@
1
- {"version":3,"file":"bigint.d.ts","names":[],"sources":["../../src/utils/bigint.ts"],"sourcesContent":[],"mappings":";cAAM"}
1
+ {"version":3,"file":"bigint.d.ts","names":[],"sources":["../../src/utils/bigint.ts"],"sourcesContent":[],"mappings":";;;;;;;cAMM"}
@@ -1,4 +1,10 @@
1
1
  //#region src/utils/bigint.ts
2
+ /**
3
+ * Converts an object containing BigInt values to a plain JavaScript object
4
+ * BigInt values are converted to strings to maintain precision in JSON serialization
5
+ * @param obj - Object that may contain BigInt values
6
+ * @returns Plain object with BigInt values converted to strings
7
+ */
2
8
  const toPlainObject = (obj) => {
3
9
  return JSON.parse(JSON.stringify(obj, (key, value) => typeof value === "bigint" ? value.toString() : value));
4
10
  };
@@ -1 +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"}
1
+ {"version":3,"file":"bigint.js","names":[],"sources":["../../src/utils/bigint.ts"],"sourcesContent":["/**\n * Converts an object containing BigInt values to a plain JavaScript object\n * BigInt values are converted to strings to maintain precision in JSON serialization\n * @param obj - Object that may contain BigInt values\n * @returns Plain object with BigInt values converted to strings\n */\nconst 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":";;;;;;;AAMA,MAAM,iBAAiB,QAAiB;AACtC,QAAO,KAAK,MAAM,KAAK,UAAU,MAC9B,KAAK,UAAW,OAAO,UAAU,WAAW,MAAM,UAAU,GAAG,MACjE,CAAC"}
@@ -1 +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":""}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":["// Utility function exports\nexport * from \"./bech32\"; // Bech32 address encoding/decoding utilities\nexport * from \"./bigint\"; // BigInt handling utilities\nexport * from \"./text\"; // Text processing and encoding utilities\n"],"mappings":""}
@@ -1 +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":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":["// Utility function exports\nexport * from \"./bech32\"; // Bech32 address encoding/decoding utilities\nexport * from \"./bigint\"; // BigInt handling utilities\nexport * from \"./text\"; // Text processing and encoding utilities\n"],"mappings":""}
@@ -1,5 +1,11 @@
1
1
 
2
2
  //#region src/utils/text.ts
3
+ /**
4
+ * Decodes blockchain event attributes from various formats to strings
5
+ * Handles both string and Uint8Array inputs from Tendermint events
6
+ * @param x - The attribute value to decode (string or Uint8Array)
7
+ * @returns Decoded string value
8
+ */
3
9
  const decodeAttr = (x) => {
4
10
  if (typeof x === "string") return x;
5
11
  else if (x instanceof Uint8Array) return Buffer.from(x).toString();
@@ -1 +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"}
1
+ {"version":3,"file":"text.cjs","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":["/**\n * Decodes blockchain event attributes from various formats to strings\n * Handles both string and Uint8Array inputs from Tendermint events\n * @param x - The attribute value to decode (string or Uint8Array)\n * @returns Decoded string value\n */\nexport 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":";;;;;;;;AAMA,MAAa,cAAc,MAA2B;AACpD,KAAI,OAAO,MAAM,SACf,QAAO;UAEA,aAAa,WACpB,QAAO,OAAO,KAAK,EAAE,CAAC,UAAU;KAGhC,QAAO"}
@@ -1,4 +1,10 @@
1
1
  //#region src/utils/text.d.ts
2
+ /**
3
+ * Decodes blockchain event attributes from various formats to strings
4
+ * Handles both string and Uint8Array inputs from Tendermint events
5
+ * @param x - The attribute value to decode (string or Uint8Array)
6
+ * @returns Decoded string value
7
+ */
2
8
  declare const decodeAttr: (x: Uint8Array | string) => string;
3
9
  //#endregion
4
10
  export { decodeAttr };
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.cts","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":[],"mappings":";cAAa,gBAAiB"}
1
+ {"version":3,"file":"text.d.cts","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":[],"mappings":";;AAMA;;;;;cAAa,gBAAiB"}
@@ -1,4 +1,10 @@
1
1
  //#region src/utils/text.d.ts
2
+ /**
3
+ * Decodes blockchain event attributes from various formats to strings
4
+ * Handles both string and Uint8Array inputs from Tendermint events
5
+ * @param x - The attribute value to decode (string or Uint8Array)
6
+ * @returns Decoded string value
7
+ */
2
8
  declare const decodeAttr: (x: Uint8Array | string) => string;
3
9
  //#endregion
4
10
  export { decodeAttr };
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":[],"mappings":";cAAa,gBAAiB"}
1
+ {"version":3,"file":"text.d.ts","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":[],"mappings":";;AAMA;;;;;cAAa,gBAAiB"}
@@ -1,4 +1,10 @@
1
1
  //#region src/utils/text.ts
2
+ /**
3
+ * Decodes blockchain event attributes from various formats to strings
4
+ * Handles both string and Uint8Array inputs from Tendermint events
5
+ * @param x - The attribute value to decode (string or Uint8Array)
6
+ * @returns Decoded string value
7
+ */
2
8
  const decodeAttr = (x) => {
3
9
  if (typeof x === "string") return x;
4
10
  else if (x instanceof Uint8Array) return Buffer.from(x).toString();
@@ -1 +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"}
1
+ {"version":3,"file":"text.js","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":["/**\n * Decodes blockchain event attributes from various formats to strings\n * Handles both string and Uint8Array inputs from Tendermint events\n * @param x - The attribute value to decode (string or Uint8Array)\n * @returns Decoded string value\n */\nexport 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":";;;;;;;AAMA,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclesia/indexer-engine",
3
- "version": "2.8.2",
3
+ "version": "2.9.0",
4
4
  "description": "Core eclesia indexer engine",
5
5
  "scripts": {
6
6
  "build": "tsc --noEmit && tsdown",