@eclesia/indexer-engine 2.10.0 → 2.11.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 (153) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +4 -0
  2. package/dist/_virtual/rolldown_runtime.mjs +38 -0
  3. package/dist/constants.cjs +6 -2
  4. package/dist/constants.cjs.map +1 -1
  5. package/dist/constants.d.cts +6 -3
  6. package/dist/constants.d.cts.map +1 -1
  7. package/dist/{constants.d.ts → constants.d.mts} +7 -4
  8. package/dist/constants.d.mts.map +1 -0
  9. package/dist/{constants.js → constants.mjs} +7 -4
  10. package/dist/constants.mjs.map +1 -0
  11. package/dist/emitter/index.cjs +6 -3
  12. package/dist/emitter/index.cjs.map +1 -1
  13. package/dist/emitter/index.d.cts.map +1 -1
  14. package/dist/emitter/{index.d.ts → index.d.mts} +2 -2
  15. package/dist/emitter/index.d.mts.map +1 -0
  16. package/dist/emitter/{index.js → index.mjs} +7 -4
  17. package/dist/emitter/index.mjs.map +1 -0
  18. package/dist/errors/index.cjs +18 -0
  19. package/dist/errors/index.cjs.map +1 -1
  20. package/dist/errors/index.d.cts.map +1 -1
  21. package/dist/errors/{index.d.ts → index.d.mts} +1 -1
  22. package/dist/errors/index.d.mts.map +1 -0
  23. package/dist/errors/{index.js → index.mjs} +19 -1
  24. package/dist/errors/index.mjs.map +1 -0
  25. package/dist/index.cjs +10 -2
  26. package/dist/index.d.cts +6 -5
  27. package/dist/index.d.mts +11 -0
  28. package/dist/index.mjs +12 -0
  29. package/dist/indexer/index.cjs +113 -67
  30. package/dist/indexer/index.cjs.map +1 -1
  31. package/dist/indexer/index.d.cts +7 -1
  32. package/dist/indexer/index.d.cts.map +1 -1
  33. package/dist/indexer/{index.d.ts → index.d.mts} +11 -5
  34. package/dist/indexer/index.d.mts.map +1 -0
  35. package/dist/indexer/{index.js → index.mjs} +121 -75
  36. package/dist/indexer/index.mjs.map +1 -0
  37. package/dist/metrics/index.cjs +28 -0
  38. package/dist/metrics/index.cjs.map +1 -1
  39. package/dist/metrics/index.d.cts.map +1 -1
  40. package/dist/metrics/{index.d.ts → index.d.mts} +1 -1
  41. package/dist/metrics/index.d.mts.map +1 -0
  42. package/dist/metrics/{index.js → index.mjs} +29 -1
  43. package/dist/metrics/index.mjs.map +1 -0
  44. package/dist/mocks/index.cjs +18 -0
  45. package/dist/mocks/index.cjs.map +1 -0
  46. package/dist/mocks/index.d.cts +9 -0
  47. package/dist/mocks/index.d.cts.map +1 -0
  48. package/dist/mocks/index.d.mts +9 -0
  49. package/dist/mocks/index.d.mts.map +1 -0
  50. package/dist/mocks/index.mjs +13 -0
  51. package/dist/mocks/index.mjs.map +1 -0
  52. package/dist/mocks/rpc-client.cjs +209 -0
  53. package/dist/mocks/rpc-client.cjs.map +1 -0
  54. package/dist/mocks/rpc-client.d.cts +44 -0
  55. package/dist/mocks/rpc-client.d.cts.map +1 -0
  56. package/dist/mocks/rpc-client.d.mts +44 -0
  57. package/dist/mocks/rpc-client.d.mts.map +1 -0
  58. package/dist/mocks/rpc-client.mjs +208 -0
  59. package/dist/mocks/rpc-client.mjs.map +1 -0
  60. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/ascii.cjs +32 -0
  61. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/ascii.cjs.map +1 -0
  62. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/ascii.mjs +29 -0
  63. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/ascii.mjs.map +1 -0
  64. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/base64.cjs +67 -0
  65. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/base64.cjs.map +1 -0
  66. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/base64.mjs +64 -0
  67. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/base64.mjs.map +1 -0
  68. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/bech32.cjs +80 -0
  69. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/bech32.cjs.map +1 -0
  70. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/bech32.mjs +77 -0
  71. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/bech32.mjs.map +1 -0
  72. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/hex.cjs +33 -0
  73. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/hex.cjs.map +1 -0
  74. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/hex.mjs +30 -0
  75. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/hex.mjs.map +1 -0
  76. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/index.cjs +106 -0
  77. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/index.cjs.map +1 -0
  78. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/index.mjs +103 -0
  79. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/index.mjs.map +1 -0
  80. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.cjs +52 -0
  81. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.cjs.map +1 -0
  82. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.mjs +49 -0
  83. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/rfc3339.mjs.map +1 -0
  84. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.cjs +31 -0
  85. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.cjs.map +1 -0
  86. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.mjs +28 -0
  87. package/dist/node_modules/.pnpm/@cosmjs_encoding@0.36.0/node_modules/@cosmjs/encoding/build/utf8.mjs.map +1 -0
  88. package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.cjs +98 -0
  89. package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.cjs.map +1 -0
  90. package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.mjs +95 -0
  91. package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.mjs.map +1 -0
  92. package/dist/promise-queue/index.cjs +34 -5
  93. package/dist/promise-queue/index.cjs.map +1 -1
  94. package/dist/promise-queue/index.d.cts.map +1 -1
  95. package/dist/promise-queue/{index.d.ts → index.d.mts} +1 -1
  96. package/dist/promise-queue/index.d.mts.map +1 -0
  97. package/dist/promise-queue/{index.js → index.mjs} +35 -6
  98. package/dist/promise-queue/index.mjs.map +1 -0
  99. package/dist/types/index.cjs.map +1 -1
  100. package/dist/types/index.d.cts +2 -1
  101. package/dist/types/index.d.cts.map +1 -1
  102. package/dist/types/{index.d.ts → index.d.mts} +5 -4
  103. package/dist/types/index.d.mts.map +1 -0
  104. package/dist/types/{index.js → index.mjs} +1 -1
  105. package/dist/types/index.mjs.map +1 -0
  106. package/dist/utils/{bech32.d.ts → bech32.d.mts} +1 -1
  107. package/dist/utils/bech32.d.mts.map +1 -0
  108. package/dist/utils/{bech32.js → bech32.mjs} +1 -1
  109. package/dist/utils/bech32.mjs.map +1 -0
  110. package/dist/utils/{bigint.d.ts → bigint.d.mts} +1 -1
  111. package/dist/utils/bigint.d.mts.map +1 -0
  112. package/dist/utils/{bigint.js → bigint.mjs} +1 -1
  113. package/dist/utils/bigint.mjs.map +1 -0
  114. package/dist/utils/{index.d.ts → index.d.mts} +4 -4
  115. package/dist/utils/index.d.mts.map +1 -0
  116. package/dist/utils/{index.js → index.mjs} +5 -5
  117. package/dist/utils/index.mjs.map +1 -0
  118. package/dist/utils/{text.d.ts → text.d.mts} +1 -1
  119. package/dist/utils/text.d.mts.map +1 -0
  120. package/dist/utils/{text.js → text.mjs} +1 -1
  121. package/dist/utils/text.mjs.map +1 -0
  122. package/dist/validation/{index.d.ts → index.d.mts} +1 -1
  123. package/dist/validation/index.d.mts.map +1 -0
  124. package/dist/validation/{index.js → index.mjs} +3 -3
  125. package/dist/validation/index.mjs.map +1 -0
  126. package/package.json +23 -20
  127. package/dist/_virtual/rolldown_runtime.js +0 -13
  128. package/dist/constants.d.ts.map +0 -1
  129. package/dist/constants.js.map +0 -1
  130. package/dist/emitter/index.d.ts.map +0 -1
  131. package/dist/emitter/index.js.map +0 -1
  132. package/dist/errors/index.d.ts.map +0 -1
  133. package/dist/errors/index.js.map +0 -1
  134. package/dist/index.d.ts +0 -10
  135. package/dist/index.js +0 -11
  136. package/dist/indexer/index.d.ts.map +0 -1
  137. package/dist/indexer/index.js.map +0 -1
  138. package/dist/metrics/index.d.ts.map +0 -1
  139. package/dist/metrics/index.js.map +0 -1
  140. package/dist/promise-queue/index.d.ts.map +0 -1
  141. package/dist/promise-queue/index.js.map +0 -1
  142. package/dist/types/index.d.ts.map +0 -1
  143. package/dist/types/index.js.map +0 -1
  144. package/dist/utils/bech32.d.ts.map +0 -1
  145. package/dist/utils/bech32.js.map +0 -1
  146. package/dist/utils/bigint.d.ts.map +0 -1
  147. package/dist/utils/bigint.js.map +0 -1
  148. package/dist/utils/index.d.ts.map +0 -1
  149. package/dist/utils/index.js.map +0 -1
  150. package/dist/utils/text.d.ts.map +0 -1
  151. package/dist/utils/text.js.map +0 -1
  152. package/dist/validation/index.d.ts.map +0 -1
  153. package/dist/validation/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/promise-queue/index.ts"],"sourcesContent":[],"mappings":";;AAMA;;;;;AAwE2B,cAxEd,YAwEc,CAAA,CAAA,CAAA,CAAA;;UAGjB,YAAA;EAAA;EA2BG,QAAA,KAAA;EAAc;UAsDX,QAAA;;UAAI,OAAA;;QA2BX,EAAA,OAAA;;EAkCC,QAAA,SAAA;;;;gBAvLM,IAAI,YAAY;;aAsCb,QAAQ;cAGjB;;;;;;;;;;cA2BG;;;;;;;;;;;;;;;;;;;;;;gBAsDG,IAAI,YAAY;aA2BvB,QAAA;;cAkCC"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/promise-queue/index.ts"],"sourcesContent":[],"mappings":";;AAMA;;;;;AAwEmB,cAxEN,YAwEM,CAAA,CAAA,CAAA,CAAA;EAGT;EAAA,QAAA,YAAA;EA2BG;EAsDG,QAAA,KAAA;EAAgB;EAAZ,QAAA,QAAA;EA2BX;EAAA,QAAA,OAAA;EAkCC;EAAA,MAAA,EAAA,OAAA;;;;;;gBAvLM,IAAI,YAAY;;aAsCb,QAAQ;cAGjB;;;;;;;;;;cA2BG;;;;;;;;;;;;;;;;;;;;;;gBAsDG,IAAI,YAAY;aA2BvB,QAAA;;cAkCC"}
@@ -66,4 +66,4 @@ declare class CircularBuffer<T> {
66
66
  }
67
67
  //#endregion
68
68
  export { CircularBuffer, PromiseQueue };
69
- //# sourceMappingURL=index.d.ts.map
69
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/promise-queue/index.ts"],"sourcesContent":[],"mappings":";;AAMA;;;;;AAwEmB,cAxEN,YAwEM,CAAA,CAAA,CAAA,CAAA;EAGT;EAAA,QAAA,YAAA;EA2BG;EAsDG,QAAA,KAAA;EAAgB;EAAZ,QAAA,QAAA;EA2BX;EAAA,QAAA,OAAA;EAkCC;EAAA,MAAA,EAAA,OAAA;;;;;;gBAvLM,IAAI,YAAY;;aAsCb,QAAQ;cAGjB;;;;;;;;;;cA2BG;;;;;;;;;;;;;;;;;;;;;;gBAsDG,IAAI,YAAY;aA2BvB,QAAA;;cAkCC"}
@@ -6,8 +6,21 @@
6
6
  * - size() is always at minimum 1 item which is the promise for the next enqueued item
7
7
  */
8
8
  var PromiseQueue = class {
9
+ /** Optional error handler for enqueue failures */
10
+ errorHandler;
11
+ /** Array of promises representing queued items */
12
+ items;
13
+ /** Function to resolve the next enqueued promise */
14
+ enqueuer;
15
+ /** Function to resolve the continue promise when space is available */
16
+ batcher;
17
+ /** Flag indicating if the queue is synced with the data source */
18
+ synced = false;
19
+ /** Maximum number of items to keep in the queue */
20
+ batchSize;
21
+ /** Promise that resolves when it's safe to enqueue more items */
22
+ continuePromise;
9
23
  constructor(batchSize, errorHandler) {
10
- this.synced = false;
11
24
  const nextVal = new Promise((resolve, _reject) => {
12
25
  this.enqueuer = resolve;
13
26
  });
@@ -68,11 +81,27 @@ var PromiseQueue = class {
68
81
  * Used by the indexer for managing block processing queues
69
82
  */
70
83
  var CircularBuffer = class {
84
+ /** Optional error handler for enqueue failures */
85
+ errorHandler;
86
+ /** Fixed-size array of promises representing buffered items */
87
+ items;
88
+ /** Function to resolve the next enqueued promise */
89
+ enqueuer;
90
+ /** Current number of items in the buffer */
91
+ count = 0;
92
+ /** Index of the next item to dequeue */
93
+ next = 0;
94
+ /** Function to resolve the continue promise when space is available */
95
+ batcher;
96
+ /** Flag indicating if the buffer is synced with the data source */
97
+ synced = false;
98
+ /** Maximum number of items the buffer can hold */
99
+ batchSize;
100
+ /** Promise that resolves when it's safe to enqueue more items */
101
+ continuePromise;
102
+ /** Index of the next available slot for enqueueing */
103
+ nextAvail = 0;
71
104
  constructor(batchSize, errorHandler) {
72
- this.count = 0;
73
- this.next = 0;
74
- this.synced = false;
75
- this.nextAvail = 0;
76
105
  if (batchSize <= 1) throw new Error("Batch size must be greater than 1");
77
106
  const nextVal = new Promise((resolve, _reject) => {
78
107
  this.enqueuer = resolve;
@@ -148,4 +177,4 @@ var CircularBuffer = class {
148
177
 
149
178
  //#endregion
150
179
  export { CircularBuffer, PromiseQueue };
151
- //# sourceMappingURL=index.js.map
180
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/promise-queue/index.ts"],"sourcesContent":["/**\n * Implements an \"infinite\" FIFO queue of fixed size using promises\n * - await `continue()` before enqueing items to ensure fixed size (resolves when space available)\n * - await `dequeue()` to pop an item (resolves when next item is available)\n * - size() is always at minimum 1 item which is the promise for the next enqueued item\n */\nexport class PromiseQueue<T> {\n /** Optional error handler for enqueue failures */\n private errorHandler?: (error: unknown) => void;\n /** Array of promises representing queued items */\n private items: Array<Promise<T>>;\n\n /** Function to resolve the next enqueued promise */\n private enqueuer!: (val: T | PromiseLike<T>) => void;\n\n /** Function to resolve the continue promise when space is available */\n private batcher!: (val: boolean) => void;\n\n /** Flag indicating if the queue is synced with the data source */\n public synced = false;\n\n /** Maximum number of items to keep in the queue */\n private batchSize: number;\n\n /** Promise that resolves when it's safe to enqueue more items */\n private continuePromise: Promise<boolean>;\n\n constructor(batchSize: number, errorHandler?: (error: unknown) => void) {\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.batchSize = batchSize;\n this.errorHandler = errorHandler;\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n this.batcher(true);\n this.items = [nextVal];\n }\n\n enqueue(item: T | PromiseLike<T>) {\n try {\n this.enqueuer(item);\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.items.push(nextVal);\n if (this.size() > this.batchSize) {\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n }\n }\n catch (e) {\n if (this.errorHandler) {\n this.errorHandler(e);\n }\n // If no error handler provided, silently ignore (existing behavior for backward compatibility)\n }\n }\n\n clear() {\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n this.batcher(true);\n this.items = [nextVal];\n }\n\n dequeue() {\n const item = this.items.shift();\n if (this.size() <= this.batchSize) {\n this.batcher(true);\n }\n\n return item as Promise<T>;\n }\n\n continue() {\n return this.continuePromise;\n }\n\n setSynced() {\n this.synced = true;\n }\n\n isEmpty() {\n if (this.items.length == 0) {\n return true;\n }\n else {\n return false;\n }\n }\n\n size() {\n return this.items.length;\n }\n}\n\n/**\n * Circular buffer implementation using promises for efficient memory usage\n * Reuses array slots in a circular fashion to maintain constant memory footprint\n * Used by the indexer for managing block processing queues\n */\nexport class CircularBuffer<T> {\n /** Optional error handler for enqueue failures */\n private errorHandler?: (error: unknown) => void;\n\n /** Fixed-size array of promises representing buffered items */\n private items: Array<Promise<T>>;\n\n /** Function to resolve the next enqueued promise */\n private enqueuer!: (val: T | PromiseLike<T>) => void;\n\n /** Current number of items in the buffer */\n private count: number = 0;\n\n /** Index of the next item to dequeue */\n private next: number = 0;\n\n /** Function to resolve the continue promise when space is available */\n private batcher!: (val: boolean) => void;\n\n /** Flag indicating if the buffer is synced with the data source */\n public synced = false;\n\n /** Maximum number of items the buffer can hold */\n private batchSize: number;\n\n /** Promise that resolves when it's safe to enqueue more items */\n private continuePromise: Promise<boolean>;\n\n /** Index of the next available slot for enqueueing */\n private nextAvail: number = 0;\n\n constructor(batchSize: number, errorHandler?: (error: unknown) => void) {\n if (batchSize <= 1) {\n throw new Error(\"Batch size must be greater than 1\");\n }\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.items = new Array<Promise<T>>(batchSize);\n this.batchSize = batchSize;\n this.errorHandler = errorHandler;\n this.items[this.nextAvail] = nextVal;\n this.count = 1;\n this.nextAvail++;\n if (this.nextAvail >= this.batchSize) {\n this.nextAvail = 0;\n }\n\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n this.batcher(true);\n }\n\n enqueue(item: T | PromiseLike<T>) {\n try {\n this.enqueuer(item);\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.items[this.nextAvail] = nextVal;\n this.count++;\n this.nextAvail++;\n if (this.nextAvail >= this.batchSize) {\n this.nextAvail = 0;\n }\n\n if (this.nextAvail == this.next) {\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n }\n }\n catch (e) {\n if (this.errorHandler) {\n this.errorHandler(e);\n }\n // If no error handler provided, silently ignore (existing behavior for backward compatibility)\n }\n }\n\n dequeue() {\n const item = this.items[this.next];\n this.next++;\n this.count--;\n if (this.next >= this.batchSize) {\n this.next = 0;\n }\n if (this.count <= this.batchSize) {\n this.batcher(true);\n }\n return item;\n }\n\n clear() {\n this.next = 0;\n this.nextAvail = 0;\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.items = new Array<Promise<T>>(this.batchSize);\n this.items[this.nextAvail] = nextVal;\n this.synced = false;\n this.count = 1;\n this.nextAvail++;\n if (this.nextAvail >= this.batchSize) {\n this.nextAvail = 0;\n }\n\n this.continuePromise = new Promise<boolean>((resolve, _reject) => {\n this.batcher = resolve;\n });\n this.batcher(true);\n }\n\n continue() {\n return this.continuePromise;\n }\n\n setSynced() {\n this.synced = true;\n }\n\n isEmpty() {\n if (this.count == 0) {\n return true;\n }\n else {\n return false;\n }\n }\n\n size() {\n return this.count;\n }\n}\n"],"mappings":";;;;;;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Y,SAAS,YAAY;AACnD,QAAK,WAAW;IAChB;AACF,OAAK,QAAQ,IAAI,MAAkB,KAAK,UAAU;AAClD,OAAK,MAAM,KAAK,aAAa;AAC7B,OAAK,SAAS;AACd,OAAK,QAAQ;AACb,OAAK;AACL,MAAI,KAAK,aAAa,KAAK,UACzB,MAAK,YAAY;AAGnB,OAAK,kBAAkB,IAAI,SAAkB,SAAS,YAAY;AAChE,QAAK,UAAU;IACf;AACF,OAAK,QAAQ,KAAK;;CAGpB,WAAW;AACT,SAAO,KAAK;;CAGd,YAAY;AACV,OAAK,SAAS;;CAGhB,UAAU;AACR,MAAI,KAAK,SAAS,EAChB,QAAO;MAGP,QAAO;;CAIX,OAAO;AACL,SAAO,KAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":["/* eslint-disable @stylistic/no-multi-spaces */\nimport {\n BlockResponse, BlockResultsResponse,\n} from \"@cosmjs/tendermint-rpc\";\nimport {\n BlockResultsResponse as BlockResultsResponse38, 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 healthCheckPort?: number // Port for health check HTTP server (default: 8080)\n enablePrometheus?: boolean // Enable Prometheus metrics server\n prometheusPort?: number // Port for Prometheus metrics server (default: 9090)\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 \"fatal-error\": {\n error: Error\n message: string\n retryCount?: number\n }\n begin_block: {\n value: {\n events: BlockResultsResponse[\"beginBlockEvents\"] | BlockResultsResponse38[\"finalizeBlockEvents\"]\n validators: Validator[] | undefined\n }\n }\n\n block: {\n value: {\n block: BlockResponse\n block_results: BlockResultsResponse | BlockResultsResponse38\n }\n }\n end_block: {\n value: BlockResultsResponse[\"endBlockEvents\"] | BlockResultsResponse38[\"finalizeBlockEvents\"]\n }\n tx_events: {\n value: BlockResultsResponse[\"results\"] | BlockResultsResponse38[\"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":""}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":["/* eslint-disable @stylistic/no-multi-spaces */\nimport {\n BlockResponse, BlockResultsResponse,\n} from \"@cosmjs/tendermint-rpc\";\nimport {\n BlockResultsResponse as BlockResultsResponse38, 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 enableHealthcheck?: boolean // Enable health check HTTP server\n healthCheckPort?: number // Port for health check HTTP server (default: 8888)\n enablePrometheus?: boolean // Enable Prometheus metrics server\n prometheusPort?: number // Port for Prometheus metrics server (default: 9090)\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 \"fatal-error\": {\n error: Error\n message: string\n retryCount?: number\n }\n begin_block: {\n value: {\n events: BlockResultsResponse[\"beginBlockEvents\"] | BlockResultsResponse38[\"finalizeBlockEvents\"]\n validators: Validator[] | undefined\n }\n }\n\n block: {\n value: {\n block: BlockResponse\n block_results: BlockResultsResponse | BlockResultsResponse38\n }\n }\n end_block: {\n value: BlockResultsResponse[\"endBlockEvents\"] | BlockResultsResponse38[\"finalizeBlockEvents\"]\n }\n tx_events: {\n value: BlockResultsResponse[\"results\"] | BlockResultsResponse38[\"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":""}
@@ -23,6 +23,7 @@ type EcleciaIndexerConfig = {
23
23
  usePolling?: boolean;
24
24
  pollingInterval?: number;
25
25
  minimal?: boolean;
26
+ enableHealthcheck?: boolean;
26
27
  healthCheckPort?: number;
27
28
  enablePrometheus?: boolean;
28
29
  prometheusPort?: number;
@@ -43,7 +44,7 @@ type WithHeightAndUUID<T> = { [K in keyof T]: T[K] & {
43
44
  timestamp?: string;
44
45
  } };
45
46
  /** Function signature for emitting events asynchronously */
46
- type EmitFunc<K extends keyof WithHeightAndUUID<EventMap>> = (t: K, e: WithHeightAndUUID<EventMap>[K]) => Promise<void | void[]>;
47
+ type EmitFunc<K$1 extends keyof WithHeightAndUUID<EventMap>> = (t: K$1, e: WithHeightAndUUID<EventMap>[K$1]) => Promise<void | void[]>;
47
48
  type LogEvent = {
48
49
  type: "log" | "info" | "warning" | "error" | "verbose" | "transient";
49
50
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;KAsBY,oBAAA;;;;;gCAKoB;;;8BAGF;;;;;;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,SAML,EAAA,GAAA,SAAA;IACQ,CAAA;EAAuB,CAAA;EAIjC,KAAA,EAAA;IAAyC,KAAA,EAAA;MAGzC,KAAA,EARE,aAQF;MAAkC,aAAA,EAPxB,oBAOwB,GAPD,sBAOC;IAK/B,CAAA;EAAM,CAAA;EAiBR,SAAA,EAAQ;IAMH,KAAA,EA/BN,oBAgCA,CAAA,gBAII,CAAA,GApCqC,sBAoC9B,CAAA,qBAAA,CAAA;;;WAjCX,kCAAkC;;;;;cAK/B;;;;;;;;;;;;;;;;;KAiBF;MACN;UACI;;;UAIO,cAAA;WACN;;;;eAII"}
@@ -1,5 +1,5 @@
1
- import { EcleciaIndexer } from "../indexer/index.js";
2
- import { CircularBuffer } from "../promise-queue/index.js";
1
+ import { EcleciaIndexer } from "../indexer/index.mjs";
2
+ import { CircularBuffer } from "../promise-queue/index.mjs";
3
3
  import { BlockResponse, BlockResultsResponse } from "@cosmjs/tendermint-rpc";
4
4
  import { BlockResultsResponse as BlockResultsResponse$1, Event } from "@cosmjs/tendermint-rpc/build/comet38/responses";
5
5
  import { Validator } from "cosmjs-types/cosmos/staking/v1beta1/staking";
@@ -23,6 +23,7 @@ type EcleciaIndexerConfig = {
23
23
  usePolling?: boolean;
24
24
  pollingInterval?: number;
25
25
  minimal?: boolean;
26
+ enableHealthcheck?: boolean;
26
27
  healthCheckPort?: number;
27
28
  enablePrometheus?: boolean;
28
29
  prometheusPort?: number;
@@ -43,7 +44,7 @@ type WithHeightAndUUID<T> = { [K in keyof T]: T[K] & {
43
44
  timestamp?: string;
44
45
  } };
45
46
  /** Function signature for emitting events asynchronously */
46
- type EmitFunc<K extends keyof WithHeightAndUUID<EventMap>> = (t: K, e: WithHeightAndUUID<EventMap>[K]) => Promise<void | void[]>;
47
+ type EmitFunc<K$1 extends keyof WithHeightAndUUID<EventMap>> = (t: K$1, e: WithHeightAndUUID<EventMap>[K$1]) => Promise<void | void[]>;
47
48
  type LogEvent = {
48
49
  type: "log" | "info" | "warning" | "error" | "verbose" | "transient";
49
50
  message: string;
@@ -114,4 +115,4 @@ interface IndexingModule {
114
115
  }
115
116
  //#endregion
116
117
  export { EcleciaIndexerConfig, EmitFunc, WithHeightAndUUID, index_d_exports };
117
- //# sourceMappingURL=index.d.ts.map
118
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;KAsBY,oBAAA;;;;;gCAKoB;;;8BAGF;;;;;;;EARlB,gBAAA,CAAA,EAAA,OAAoB;EAKA,cAAA,CAAA,EAAA,MAAA;EAGF,IAAA,CAAA,EAAA,GAAA,GASf,OATe,CAAA,IAAA,CAAA;EASf,gBAAA,EAAA,GAAA,GACW,OADX,CAAA,IAAA,CAAA;EACW,cAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,GACa,OADb,CAAA,IAAA,CAAA;CACa;;AAI3B,KAAA,cAAA,GAAiB,cAAH,CAAA,CAAmB,aAAnB,EAAkC,oBAAlC,EAAwD,UAAxD,CAAA,CAAA;;AAAkC,KAGhD,iBAAA,GAAoB,cAH4B,CAAA,CAGZ,aAHY,EAGG,oBAHH,CAAA,CAAA;;AAA/B,KAMjB,UAAA,GAAa,cANI,GAMa,iBANb;;AAGjB,KAMA,iBANiB,CAAA,CAAA,CAAA,GAAA,QAAmB,MAOlC,CAPkC,GAO9B,CAP8B,CAO5B,CAP4B,CAAA,GAAA;EAAe,IAAA,CAAA,EAAA,MAAA;EAA/B,MAAA,CAAA,EAAA,MAAA;EAAc,SAAA,CAAA,EAAA,MAAA;AAGlC,CAAA,EAGZ;;AACkB,KAQN,QARM,CAAA,YAAA,MAQmB,iBARnB,CAQqC,QARrC,CAAA,CAAA,GAAA,CAAA,CAAA,EASb,GATa,EAAA,CAAA,EAUb,iBAVa,CAUK,QAVL,CAAA,CAUe,GAVf,CAAA,EAAA,GAWb,OAXa,CAAA,IAAA,GAAA,IAAA,EAAA,CAAA;AAAE,KAaR,QAAA,GAbQ;EAAC,IAAA,EAAA,KAAA,GAAA,MAAA,GAAA,SAAA,GAAA,OAAA,GAAA,SAAA,GAAA,WAAA;EAQT,OAAA,EAAA,MAAQ;CAAmC;AAAlB,KASzB,SAAA,GATyB;EAChC,IAAA,EAAA,MAAA;EACkB,KAAA,CAAA,EAAA,MAAA;EAAlB,MAAA,EAAA,OAAA;CAA4B;AAC5B,KAWO,MAAA,GAXP;EAAO,GAAA,EAYL,QAZK;EAEA,IAAA,EAWJ,SAXY;EAIR,aAAS,EAAA;IAKT,KAAM,EAIP,KAJO;IACX,OAAA,EAAA,MAAA;IACC,UAAA,CAAA,EAAA,MAAA;EAEG,CAAA;EAMG,WAAA,EAAA;IAA2C,KAAA,EAAA;MACvC,MAAA,EADJ,oBACI,CAAA,kBAAA,CAAA,GADuC,sBACvC,CAAA,qBAAA,CAAA;MAML,UAAA,EANK,SAML,EAAA,GAAA,SAAA;IACQ,CAAA;EAAuB,CAAA;EAIjC,KAAA,EAAA;IAAyC,KAAA,EAAA;MAGzC,KAAA,EARE,aAQF;MAAkC,aAAA,EAPxB,oBAOwB,GAPD,sBAOC;IAK/B,CAAA;EAAM,CAAA;EAiBR,SAAA,EAAQ;IAMH,KAAA,EA/BN,oBAgCA,CAAA,gBAII,CAAA,GApCqC,sBAoC9B,CAAA,qBAAA,CAAA;;;WAjCX,kCAAkC;;;;;cAK/B;;;;;;;;;;;;;;;;;KAiBF;MACN;UACI;;;UAIO,cAAA;WACN;;;;eAII"}
@@ -3,4 +3,4 @@ var types_exports = {};
3
3
 
4
4
  //#endregion
5
5
  export { types_exports };
6
- //# sourceMappingURL=index.js.map
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":["/* eslint-disable @stylistic/no-multi-spaces */\nimport {\n BlockResponse, BlockResultsResponse,\n} from \"@cosmjs/tendermint-rpc\";\nimport {\n BlockResultsResponse as BlockResultsResponse38, 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 enableHealthcheck?: boolean // Enable health check HTTP server\n healthCheckPort?: number // Port for health check HTTP server (default: 8888)\n enablePrometheus?: boolean // Enable Prometheus metrics server\n prometheusPort?: number // Port for Prometheus metrics server (default: 9090)\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 \"fatal-error\": {\n error: Error\n message: string\n retryCount?: number\n }\n begin_block: {\n value: {\n events: BlockResultsResponse[\"beginBlockEvents\"] | BlockResultsResponse38[\"finalizeBlockEvents\"]\n validators: Validator[] | undefined\n }\n }\n\n block: {\n value: {\n block: BlockResponse\n block_results: BlockResultsResponse | BlockResultsResponse38\n }\n }\n end_block: {\n value: BlockResultsResponse[\"endBlockEvents\"] | BlockResultsResponse38[\"finalizeBlockEvents\"]\n }\n tx_events: {\n value: BlockResultsResponse[\"results\"] | BlockResultsResponse38[\"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":""}
@@ -21,4 +21,4 @@ declare function keyHashfromAddress(address: string): string;
21
21
  declare function chainAddressfromKeyhash(prefix: string, keyhash: string): string;
22
22
  //#endregion
23
23
  export { chainAddressfromKeyhash, keyHashfromAddress, toHexString };
24
- //# sourceMappingURL=bech32.d.ts.map
24
+ //# sourceMappingURL=bech32.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bech32.d.mts","names":[],"sources":["../../src/utils/bech32.ts"],"sourcesContent":[],"mappings":";;;AASoB;AAgBO;;iBAhBlB,WAAA;;;;;;;iBAgBA,kBAAA;;;;;;;iBAeA,uBAAA"}
@@ -37,4 +37,4 @@ function chainAddressfromKeyhash(prefix, keyhash) {
37
37
 
38
38
  //#endregion
39
39
  export { chainAddressfromKeyhash, keyHashfromAddress, toHexString };
40
- //# sourceMappingURL=bech32.js.map
40
+ //# sourceMappingURL=bech32.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bech32.mjs","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"}
@@ -8,4 +8,4 @@
8
8
  declare const toPlainObject: (obj: unknown) => any;
9
9
  //#endregion
10
10
  export { toPlainObject };
11
- //# sourceMappingURL=bigint.d.ts.map
11
+ //# sourceMappingURL=bigint.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigint.d.mts","names":[],"sources":["../../src/utils/bigint.ts"],"sourcesContent":[],"mappings":";;;;;;;cAMM"}
@@ -11,4 +11,4 @@ const toPlainObject = (obj) => {
11
11
 
12
12
  //#endregion
13
13
  export { toPlainObject };
14
- //# sourceMappingURL=bigint.js.map
14
+ //# sourceMappingURL=bigint.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigint.mjs","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,6 +1,6 @@
1
- import { chainAddressfromKeyhash, keyHashfromAddress, toHexString } from "./bech32.js";
2
- import { toPlainObject } from "./bigint.js";
3
- import { decodeAttr } from "./text.js";
1
+ import { chainAddressfromKeyhash, keyHashfromAddress, toHexString } from "./bech32.mjs";
2
+ import { toPlainObject } from "./bigint.mjs";
3
+ import { decodeAttr } from "./text.mjs";
4
4
 
5
5
  //#region src/utils/index.d.ts
6
6
  declare namespace index_d_exports {
@@ -8,4 +8,4 @@ declare namespace index_d_exports {
8
8
  }
9
9
  //#endregion
10
10
  export { index_d_exports };
11
- //# sourceMappingURL=index.d.ts.map
11
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":[],"mappings":""}
@@ -1,7 +1,7 @@
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";
1
+ import { __export } from "../_virtual/rolldown_runtime.mjs";
2
+ import { chainAddressfromKeyhash, keyHashfromAddress, toHexString } from "./bech32.mjs";
3
+ import { toPlainObject } from "./bigint.mjs";
4
+ import { decodeAttr } from "./text.mjs";
5
5
 
6
6
  //#region src/utils/index.ts
7
7
  var utils_exports = /* @__PURE__ */ __export({
@@ -14,4 +14,4 @@ var utils_exports = /* @__PURE__ */ __export({
14
14
 
15
15
  //#endregion
16
16
  export { utils_exports };
17
- //# sourceMappingURL=index.js.map
17
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":["/* eslint-disable @stylistic/no-multi-spaces */\n// 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":""}
@@ -8,4 +8,4 @@
8
8
  declare const decodeAttr: (x: Uint8Array | string) => string;
9
9
  //#endregion
10
10
  export { decodeAttr };
11
- //# sourceMappingURL=text.d.ts.map
11
+ //# sourceMappingURL=text.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.mts","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":[],"mappings":";;AAMA;;;;;cAAa,gBAAiB"}
@@ -13,4 +13,4 @@ const decodeAttr = (x) => {
13
13
 
14
14
  //#endregion
15
15
  export { decodeAttr };
16
- //# sourceMappingURL=text.js.map
16
+ //# sourceMappingURL=text.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.mjs","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"}
@@ -49,4 +49,4 @@ declare function validatePositiveInteger(value: number, fieldName?: string): voi
49
49
  declare function getChainPrefix(defaultPrefix?: string): string;
50
50
  //#endregion
51
51
  export { index_d_exports };
52
- //# sourceMappingURL=index.d.ts.map
52
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/validation/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;iBAiBgB,WAAA;AAAhB;AA6CA;AAiCA;AAgCA;AAwBA;AAeA;iBAxGgB,gBAAA;;;;;;;iBAiCA,gCAAA;;;;;;;iBAgCA,YAAA;;;;;;;iBAwBA,uBAAA;;;;;;;iBAeA,cAAA"}
@@ -1,5 +1,5 @@
1
- import { __export } from "../_virtual/rolldown_runtime.js";
2
- import { ConfigurationError } from "../errors/index.js";
1
+ import { __export } from "../_virtual/rolldown_runtime.mjs";
2
+ import { ConfigurationError } from "../errors/index.mjs";
3
3
  import * as fs from "node:fs";
4
4
 
5
5
  //#region src/validation/index.ts
@@ -137,4 +137,4 @@ function getChainPrefix(defaultPrefix = "cosmos") {
137
137
 
138
138
  //#endregion
139
139
  export { validateFilePath, validatePort, validatePositiveInteger, validateUrl, validation_exports };
140
- //# sourceMappingURL=index.js.map
140
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/validation/index.ts"],"sourcesContent":["/**\n * Configuration validation utilities for the Eclesia indexer\n * Validates configuration parameters before initialization\n */\n\nimport * as fs from \"node:fs\";\n\nimport {\n ConfigurationError,\n} from \"../errors/index.js\";\n\n/**\n * Validates a URL string\n * @param url - The URL to validate\n * @param fieldName - Name of the field for error messages\n * @throws {ConfigurationError} If URL is invalid\n */\nexport function validateUrl(url: string, fieldName: string = \"URL\"): void {\n if (!url || typeof url !== \"string\") {\n throw new ConfigurationError(`${fieldName} is required and must be a string`, {\n fieldName,\n value: url,\n });\n }\n\n try {\n const parsed = new URL(url);\n\n // Ensure protocol is http or https\n if (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\" && parsed.protocol !== \"ws:\" && parsed.protocol !== \"wss:\") {\n throw new ConfigurationError(`${fieldName} must use http, https, ws, or wss protocol`, {\n fieldName,\n url,\n protocol: parsed.protocol,\n });\n }\n\n // Ensure hostname is present\n if (!parsed.hostname) {\n throw new ConfigurationError(`${fieldName} must include a hostname`, {\n fieldName,\n url,\n });\n }\n }\n catch (error) {\n if (error instanceof ConfigurationError) {\n throw error;\n }\n throw new ConfigurationError(`${fieldName} is not a valid URL: ${error}`, {\n fieldName,\n url,\n });\n }\n}\n\n/**\n * Validates a file path exists and is readable\n * @param filePath - The file path to validate\n * @param fieldName - Name of the field for error messages\n * @throws {ConfigurationError} If file doesn't exist or isn't readable\n */\nexport function validateFilePath(filePath: string, fieldName: string = \"File path\"): void {\n if (!filePath || typeof filePath !== \"string\") {\n throw new ConfigurationError(`${fieldName} is required and must be a string`, {\n fieldName,\n value: filePath,\n });\n }\n\n if (!fs.existsSync(filePath)) {\n throw new ConfigurationError(`${fieldName} does not exist: ${filePath}`, {\n fieldName,\n filePath,\n });\n }\n\n try {\n fs.accessSync(filePath, fs.constants.R_OK);\n }\n catch (error) {\n throw new ConfigurationError(`${fieldName} is not readable: ${filePath}`, {\n fieldName,\n filePath,\n error: String(error),\n });\n }\n}\n\n/**\n * Validates a PostgreSQL connection string\n * @param connectionString - The connection string to validate\n * @param fieldName - Name of the field for error messages\n * @throws {ConfigurationError} If connection string is invalid\n */\nexport function validatePostgresConnectionString(\n connectionString: string,\n fieldName: string = \"Database connection string\",\n): void {\n if (!connectionString || typeof connectionString !== \"string\") {\n throw new ConfigurationError(`${fieldName} is required and must be a string`, {\n fieldName,\n value: connectionString,\n });\n }\n\n // Basic PostgreSQL connection string format validation\n // Format: postgres://user:password@host:port/database\n const pgRegex = /^postgres(?:ql)?:\\/\\/(?:([^:]+)(?::([^@]+))?@)?([^:/]+)(?::(\\d+))?\\/(.+)$/;\n\n if (!pgRegex.test(connectionString)) {\n throw new ConfigurationError(\n `${fieldName} must be in format: postgres://user:password@host:port/database`,\n {\n fieldName,\n format: \"postgres://user:password@host:port/database\",\n },\n );\n }\n}\n\n/**\n * Validates a port number\n * @param port - The port number to validate\n * @param fieldName - Name of the field for error messages\n * @throws {ConfigurationError} If port is invalid\n */\nexport function validatePort(port: number, fieldName: string = \"Port\"): void {\n if (typeof port !== \"number\" || !Number.isInteger(port)) {\n throw new ConfigurationError(`${fieldName} must be an integer`, {\n fieldName,\n value: port,\n });\n }\n\n if (port < 1 || port > 65535) {\n throw new ConfigurationError(`${fieldName} must be between 1 and 65535`, {\n fieldName,\n value: port,\n min: 1,\n max: 65535,\n });\n }\n}\n\n/**\n * Validates a positive integer\n * @param value - The value to validate\n * @param fieldName - Name of the field for error messages\n * @throws {ConfigurationError} If value is not a positive integer\n */\nexport function validatePositiveInteger(value: number, fieldName: string = \"Value\"): void {\n if (typeof value !== \"number\" || !Number.isInteger(value) || value <= 0) {\n throw new ConfigurationError(`${fieldName} must be a positive integer`, {\n fieldName,\n value,\n });\n }\n}\n\n/**\n * Gets and validates the chain prefix from environment variables\n * @param defaultPrefix - Default prefix to use if environment variable is not set\n * @returns The validated chain prefix\n * @throws {ConfigurationError} If chain prefix is invalid\n */\nexport function getChainPrefix(defaultPrefix: string = \"cosmos\"): string {\n const prefix = process.env.CHAIN_PREFIX ?? defaultPrefix;\n\n if (!prefix || typeof prefix !== \"string\") {\n throw new ConfigurationError(\"CHAIN_PREFIX must be a non-empty string\", {\n value: prefix,\n defaultPrefix,\n });\n }\n\n // Validate prefix format (lowercase alphanumeric)\n if (!/^[a-z][a-z0-9]*$/.test(prefix)) {\n throw new ConfigurationError(\n \"CHAIN_PREFIX must start with lowercase letter and contain only lowercase letters and numbers\",\n {\n value: prefix,\n pattern: \"^[a-z][a-z0-9]*$\",\n },\n );\n }\n\n return prefix;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiBA,SAAgB,YAAY,KAAa,YAAoB,OAAa;AACxE,KAAI,CAAC,OAAO,OAAO,QAAQ,SACzB,OAAM,IAAI,mBAAmB,GAAG,UAAU,oCAAoC;EAC5E;EACA,OAAO;EACR,CAAC;AAGJ,KAAI;EACF,MAAM,SAAS,IAAI,IAAI,IAAI;A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,sBAAsB;EAC9D;EACA,OAAO;EACR,CAAC;AAGJ,KAAI,OAAO,KAAK,OAAO,MACrB,OAAM,IAAI,mBAAmB,GAAG,UAAU,+BAA+B;EACvE;EACA,OAAO;EACP,KAAK;EACL,KAAK;EACN,CAAC;;;;;;;;AAUN,SAAgB,wBAAwB,OAAe,YAAoB,SAAe;AACxF,KAAI,OAAO,UAAU,YAAY,CAAC,OAAO,UAAU,MAAM,IAAI,SAAS,EACpE,OAAM,IAAI,mBAAmB,GAAG,UAAU,8BAA8B;EACtE;EACA;EACD,CAAC;;;;;;;;AAUN,SAAgB,eAAe,gBAAwB,UAAkB;CACvE,MAAM,SAAS,QAAQ,IAAI,gBAAgB;AAE3C,KAAI,CAAC,UAAU,OAAO,WAAW,SAC/B,OAAM,IAAI,mBAAmB,2CAA2C;EACtE,OAAO;EACP;EACD,CAAC;AAIJ,KAAI,CAAC,mBAAmB,KAAK,OAAO,CAClC,OAAM,IAAI,mBACR,gGACA;EACE,OAAO;EACP,SAAS;EACV,CACF;AAGH,QAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclesia/indexer-engine",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "Core eclesia indexer engine",
5
5
  "files": [
6
6
  "dist/",
@@ -18,18 +18,19 @@
18
18
  "license": "Apache-2.0",
19
19
  "devDependencies": {
20
20
  "@arethetypeswrong/core": "^0.18.2",
21
- "@eslint/js": "^9.35.0",
22
- "@stylistic/eslint-plugin": "^5.3.1",
23
- "@types/node": "^22.14.0",
21
+ "@cosmjs/encoding": "^0.36.0",
22
+ "@eslint/js": "^9.39.1",
23
+ "@stylistic/eslint-plugin": "^5.5.0",
24
+ "@types/node": "^24.10.0",
24
25
  "@types/stream-chain": "^2.1.0",
25
26
  "@types/stream-json": "^1.7.8",
26
27
  "@types/uuid": "^11.0.0",
27
- "eslint": "^9.35.0",
28
+ "eslint": "^9.39.1",
28
29
  "eslint-plugin-simple-import-sort": "^12.1.1",
29
- "tsdown": "^0.15.2",
30
- "typescript": "^5.9.2",
31
- "typescript-eslint": "^8.44.0",
32
- "vitest": "^3.2.4"
30
+ "tsdown": "^0.16.0",
31
+ "typescript": "^5.9.3",
32
+ "typescript-eslint": "^8.46.3",
33
+ "vitest": "^4.0.7"
33
34
  },
34
35
  "publishConfig": {
35
36
  "access": "public"
@@ -38,31 +39,33 @@
38
39
  "@cosmjs/tendermint-rpc": "^0.36.0",
39
40
  "bech32": "^2.0.0",
40
41
  "cosmjs-types": "^0.10.1",
41
- "dayjs": "^1.11.18",
42
- "fastify": "^5.6.0",
42
+ "dayjs": "^1.11.19",
43
+ "fastify": "^5.6.1",
43
44
  "prom-client": "^15.1.3",
44
45
  "stream-chain": "^3.4.0",
45
46
  "stream-json": "^1.9.1",
46
47
  "uuid": "^13.0.0",
47
- "winston": "^3.17.0"
48
+ "winston": "^3.18.3"
48
49
  },
49
- "main": "dist/index.cjs",
50
- "module": "dist/index.js",
51
- "types": "dist/index.d.cts",
52
50
  "exports": {
53
51
  ".": {
54
52
  "import": {
55
- "types": "./dist/index.d.ts",
56
- "default": "./dist/index.js"
53
+ "types": "./dist/index.d.mts",
54
+ "default": "./dist/index.mjs"
57
55
  },
58
- "require": "./dist/index.cjs",
59
- "types": "./dist/index.d.ts",
60
- "default": "./dist/index.js"
56
+ "require": {
57
+ "types": "./dist/index.d.cts",
58
+ "default": "./dist/index.cjs"
59
+ }
61
60
  },
62
61
  "./package.json": "./package.json"
63
62
  },
63
+ "main": "dist/index.cjs",
64
+ "module": "dist/index.mjs",
65
+ "types": "dist/index.d.mts",
64
66
  "scripts": {
65
67
  "build": "tsc --noEmit && tsdown",
68
+ "bench": "vitest bench --config benchmarks/vitest.config.ts",
66
69
  "lint": "eslint",
67
70
  "lint:fix": "eslint --fix",
68
71
  "test": "vitest",
@@ -1,13 +0,0 @@
1
- //#region rolldown:runtime
2
- var __defProp = Object.defineProperty;
3
- var __export = (all) => {
4
- let target = {};
5
- for (var name in all) __defProp(target, name, {
6
- get: all[name],
7
- enumerable: true
8
- });
9
- return target;
10
- };
11
-
12
- //#endregion
13
- export { __export };
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","names":[],"sources":["../src/constants.ts"],"sourcesContent":[],"mappings":";;AAUA;AAKA;AAMA;AAKA;AAMA;AAMA;AAMA;AAMA;AAYa,cApDA,kBAAA,GAyDH,GAAA;AAMV;;;cA1Da,oBAAA;;;;;cAMA,yBAAA;;;;cAKA,2BAAA;;;;;cAMA,cAAA;;;;;cAMA,wBAAA;;;;;cAMA,uBAAA;;;;;cAMA;;;;;;;;;;;cAYA;;;;;;;;;;cAWA,kBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["/**\n * Configuration constants for the Eclesia indexer\n * These values control performance, timeouts, and connection management\n */\n\n/**\n * Number of blocks to prefetch and keep in the processing queue\n * Higher values increase memory usage but improve throughput\n * Recommended range: 300-1000 depending on block size and available memory\n */\nexport const DEFAULT_BATCH_SIZE = 500;\n\n/**\n * Default start height for indexing when no previous height is found\n */\nexport const DEFAULT_START_HEIGHT = 1;\n\n/**\n * Default port for health check HTTP server\n * Changed from 80 to 8080 to avoid requiring root privileges\n */\nexport const DEFAULT_HEALTH_CHECK_PORT = 8080;\n\n/**\n * Default polling interval in milliseconds when using polling mode instead of WebSocket\n */\nexport const DEFAULT_POLLING_INTERVAL_MS = 5000;\n\n/**\n * Timeout for RPC calls in milliseconds\n * If a call takes longer than this, it will be rejected\n */\nexport const RPC_TIMEOUT_MS = 20000;\n\n/**\n * Timeout for block queue dequeue operations in milliseconds\n * If no block is available within this time, an error will be thrown\n */\nexport const QUEUE_DEQUEUE_TIMEOUT_MS = 30000;\n\n/**\n * Number of successful transactions before recycling the database client\n * Prevents long-running connection issues and stale connections\n */\nexport const DB_CLIENT_RECYCLE_COUNT = 1500;\n\n/**\n * Block intervals for periodic event emission\n * Used for operations that should run at regular block intervals\n */\nexport const PERIODIC_INTERVALS = {\n /** Emit periodic event every 50 blocks */\n SMALL: 50,\n /** Emit periodic event every 100 blocks */\n MEDIUM: 100,\n /** Emit periodic event every 1000 blocks - used for performance logging */\n LARGE: 1000,\n} as const;\n\n/**\n * Pagination limits for blockchain queries\n */\nexport const PAGINATION_LIMITS = {\n /** Default limit for validator queries */\n VALIDATORS: 1000n,\n /** Default limit for delegation queries */\n DELEGATIONS: 250n,\n} as const;\n\n/**\n * Batch size for streaming genesis file processing\n * Number of entries to process at once from genesis JSON\n */\nexport const GENESIS_BATCH_SIZE = 1000;\n"],"mappings":";;;;;;;;;;AAUA,MAAa,qBAAqB;;;;AAKlC,MAAa,uBAAuB;;;;;AAMpC,MAAa,4BAA4B;;;;AAKzC,MAAa,8BAA8B;;;;;AAM3C,MAAa,iBAAiB;;;;;AAM9B,MAAa,2BAA2B;;;;;AAMxC,MAAa,0BAA0B;;;;;AAMvC,MAAa,qBAAqB;CAEhC,OAAO;CAEP,QAAQ;CAER,OAAO;CACR;;;;AAKD,MAAa,oBAAoB;CAE/B,YAAY;CAEZ,aAAa;CACd;;;;;AAMD,MAAa,qBAAqB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/emitter/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAYA;;AAKgB,cALH,cAAA,CAKG;;UAaY,OAAA;;SAEI,EAfhB,GAegB,CAAA,MAAA,EAAA,MAAA,CAAA;;UAAU,UAAA;;;;;aA4BvB,CAAA;MAA2C,CAAA,cAAA,MAAA,CA9BlC,iBA8BkC,CA9BhB,QA8BgB,CAAA,CAAA,GAAA,MAAA,CAAA,CAAA,SAAA,EA7B/C,KA6B+C,EAAA,QAAA,EA5BhD,iBA4BgD,CA5B9B,QA4B8B,CAAA,CA5BpB,KA4BoB,CAAA,GAAA;IAAlB,IAAA,CAAA,EAAA,MAAA;MAAgD,IAAA;KAAlB,mBAAA,MAR5C,iBAQ4C,CAR1B,QAQ0B,CAAA,GAAA,MAAA,GAAA,YAAA,CAAA,CAAA,SAAA,EAP3D,UAO2D,EAAA,OAAA,EAN7D,UAM6D,SAAA,YAAA,GAAA,CAAA,QAAA,EAAA;IAA4B,IAAA,EAAA,MAAA;IA8CrD,KAAA,EAAA,OAAA;IAAlB,IAAA,EAAA,MAAA;KAChB,GAAA,IAAA,GAAA,CAAA,QAAA,EA/CI,UA+CJ,SAAA,MA/C6B,iBA+C7B,CA/C+C,QA+C/C,CAAA,GA/C2D,iBA+C3D,CA/C6E,QA+C7E,CAAA,CA/CuF,UA+CvF,CAAA,GAAA,KAAA,EAAA,GAAA,IAAA,CAAA,EAAA,IAAA;KAC2B,CAAA,mBAAA,MAFX,iBAEW,CAFO,QAEP,CAAA,GAAA,MAAA,CAAA,CAAA,SAAA,EAD3B,UAC2B,EAAA,OAAA,EAAA,CAAA,QAAA,EAAlB,iBAAkB,CAAA,QAAA,CAAA,CAAU,UAAV,CAAA,EAAA,GAAA,IAAA,CAAA,EAAA,IAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/emitter/index.ts"],"sourcesContent":["import {\n EventEmitter,\n} from \"node:events\";\n\nimport {\n WithHeightAndUUID,\n} from \"../types/index.js\";\n\n/**\n * Custom event emitter that provides type-safe event handling for blockchain indexing\n * Extends Node.js EventEmitter with UUID tracking and error handling capabilities\n */\nexport class EclesiaEmitter {\n /** Internal Node.js EventEmitter instance */\n private emitter = new EventEmitter();\n\n /** Map tracking the number of handlers registered for each event type */\n public handled = new Map<string, number>();\n\n /** WeakMap storing wrapper functions for proper cleanup */\n private handlerMap = new WeakMap();\n\n /**\n * Creates a new EclesiaEmitter instance\n * Sets max listeners to 0 (unlimited) to handle many modules\n */\n constructor() {\n this.emitter.setMaxListeners(0);\n }\n\n emit<EType extends keyof (WithHeightAndUUID<EventMap>) & string>(\n eventName: EType,\n eventArg: WithHeightAndUUID<EventMap>[EType] & {\n uuid?: string\n },\n ) {\n if (this.handled.has(eventName)) {\n this.emitter.emit(\n eventName, eventArg,\n );\n }\n else {\n this.emitter.emit(\n \"_unhandled\", {\n type: eventName as string,\n event: eventArg,\n uuid: eventArg.uuid,\n },\n );\n }\n }\n\n on<TEventName extends keyof WithHeightAndUUID<EventMap> & string | \"_unhandled\">(\n eventName: TEventName,\n handler: TEventName extends \"_unhandled\"\n ? (eventArg: {\n type: string\n event: unknown\n uuid: string\n }) => void\n : (eventArg: TEventName extends keyof WithHeightAndUUID<EventMap> ? WithHeightAndUUID<EventMap>[TEventName] : never) => void,\n ) {\n const count = this.handled.get(eventName);\n if (count) {\n this.handled.set(\n eventName, count + 1,\n );\n }\n else {\n this.handled.set(\n eventName, 1,\n );\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const wrapper = async (eventData: any) => {\n try {\n await handler(eventData);\n if (eventName !== \"uuid\" && eventName !== \"_unhandled\" && eventData.uuid) {\n this.emit(\n \"uuid\", {\n status: true,\n uuid: eventData.uuid,\n },\n );\n }\n }\n catch (error) {\n if (eventName !== \"uuid\" && eventName !== \"_unhandled\" && eventData.uuid) {\n this.emit(\n \"uuid\", {\n status: false,\n error: error as string,\n uuid: eventData.uuid,\n },\n );\n }\n }\n };\n this.handlerMap.set(\n handler, wrapper,\n );\n this.emitter.on(\n eventName, wrapper,\n );\n }\n\n off<TEventName extends keyof WithHeightAndUUID<EventMap> & string>(\n eventName: TEventName,\n handler: (eventArg: WithHeightAndUUID<EventMap>[TEventName]) => void,\n ) {\n const count = this.handled.get(eventName);\n if (count && count > 1) {\n this.handled.set(\n eventName, count - 1,\n );\n }\n else {\n this.handled.delete(eventName);\n }\n const wrapper = this.handlerMap.get(handler);\n if (wrapper) {\n this.emitter.off(\n eventName, wrapper,\n );\n this.handlerMap.delete(handler);\n }\n }\n}\n"],"mappings":";;;;;;;AAYA,IAAa,iBAAb,MAA4B;;;;;CAc1B,cAAc;OAZN,UAAU,IAAI,cAAc;OAG7B,0BAAU,IAAI,KAAqB;OAG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A;EAAY;EAUvC,SAAA,OAAS,CAAA,EA7BM,MA6BN,CAAA,MAAA,EAAA,OAAA,CAAA;EAAA,WAAA,CAAA,OAAA,EAAA,MAAA,EAAA,IAAA,CAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EA3BmD,MA2BnD,CAAA,MAAA,EAAA,OAAA,CAAA;;;;AA2BtB;;AAO6E,cA5ChE,kBAAA,SAA2B,YAAA,CA4CqC;aAP1C,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EApCM,MAoCN,CAAA,MAAA,EAAA,OAAA,CAAA;;AAsBnC;;;;AAAsD,cAjDzC,QAAA,SAAiB,YAAA,CAiDwB;EAiBzC;EAAY,SAAA,QAAA,CAAA,EAAA,MAAA;;WAAQ,MAAA,CAAA,EAAA,MAAA;EAAY,WAAA,CAAA,OAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAAA,MAAA,EAAA,MAAA,CAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAvD/B,MAuD+B,CAAA,MAAA,EAAA,OAAA,CAAA;AAiB7C;;;;;cAxDa,aAAA,SAAsB,YAAA;;;;;6EAO0C;;;;;;cAehE,oBAAA,SAA6B,YAAA;;;yDAIe;;;;;;cAa5C,WAAA,SAAoB,YAAA;;;6DAI4B;;;;;;cAahD,YAAA,SAAqB,YAAA;;;+DAI6B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/errors/index.ts"],"sourcesContent":["/**\n * Custom error classes for the Eclesia indexer\n * These provide better context and error tracking throughout the application\n */\n\n/**\n * Base error class for all indexer errors\n * Extends Error with additional context fields\n */\nexport class IndexerError extends Error {\n /** Error code for programmatic error handling */\n public readonly code: string;\n\n /** Additional context data for debugging */\n public readonly context?: Record<string, unknown>;\n\n constructor(message: string, code: string = \"INDEXER_ERROR\", context?: Record<string, unknown>) {\n super(message);\n this.name = this.constructor.name;\n this.code = code;\n this.context = context;\n\n // Maintains proper stack trace for where error was thrown\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n\n/**\n * Configuration-related errors\n * Thrown when indexer configuration is invalid or missing\n */\nexport class ConfigurationError extends IndexerError {\n constructor(message: string, context?: Record<string, unknown>) {\n super(message, \"CONFIGURATION_ERROR\", context);\n }\n}\n\n/**\n * RPC connection and communication errors\n * Thrown when RPC calls fail or connections are lost\n */\nexport class RPCError extends IndexerError {\n /** The RPC endpoint that failed */\n public readonly endpoint?: string;\n\n /** The height being queried when error occurred */\n public readonly height?: number;\n\n constructor(\n message: string,\n endpoint?: string,\n height?: number,\n context?: Record<string, unknown>,\n ) {\n super(message, \"RPC_ERROR\", {\n ...context,\n endpoint,\n height,\n });\n this.endpoint = endpoint;\n this.height = height;\n }\n}\n\n/**\n * Database operation errors\n * Thrown when database queries or transactions fail\n */\nexport class DatabaseError extends IndexerError {\n /** The SQL query that failed */\n public readonly query?: string;\n\n /** The operation that failed (e.g., \"BEGIN\", \"COMMIT\", \"ROLLBACK\") */\n public readonly operation?: string;\n\n constructor(message: string, operation?: string, query?: string, context?: Record<string, unknown>) {\n super(message, \"DATABASE_ERROR\", {\n ...context,\n operation,\n query,\n });\n this.operation = operation;\n this.query = query;\n }\n}\n\n/**\n * Block processing errors\n * Thrown when block data is invalid or processing fails\n */\nexport class BlockProcessingError extends IndexerError {\n /** The height of the block that failed to process */\n public readonly height: number;\n\n constructor(message: string, height: number, context?: Record<string, unknown>) {\n super(message, \"BLOCK_PROCESSING_ERROR\", {\n ...context,\n height,\n });\n this.height = height;\n }\n}\n\n/**\n * Module initialization errors\n * Thrown when indexing modules fail to initialize\n */\nexport class ModuleError extends IndexerError {\n /** The name of the module that failed */\n public readonly moduleName: string;\n\n constructor(message: string, moduleName: string, context?: Record<string, unknown>) {\n super(message, \"MODULE_ERROR\", {\n ...context,\n moduleName,\n });\n this.moduleName = moduleName;\n }\n}\n\n/**\n * Genesis processing errors\n * Thrown when genesis file parsing or processing fails\n */\nexport class GenesisError extends IndexerError {\n /** Path to the genesis file */\n public readonly genesisPath?: string;\n\n constructor(message: string, genesisPath?: string, context?: Record<string, unknown>) {\n super(message, \"GENESIS_ERROR\", {\n ...context,\n genesisPath,\n });\n this.genesisPath = genesisPath;\n }\n}\n"],"mappings":";;;;;;;;;AASA,IAAa,eAAb,cAAkC,MAAM;CAOtC,YAAY,SAAiB,OAAe,iBAAiB,SAAmC;AAC9F,QAAM,QAAQ;AACd,OAAK,OAAO,KAAK,YAAY;AAC7B,OAAK,OAAO;AACZ,OAAK,UAAU;AAGf,MAAI,MAAM,kBACR,OAAM,kBAAkB,MAAM,KAAK,YAAY;;;;;;;AASrD,IAAa,qBAAb,cAAwC,aAAa;CACnD,YAAY,SAAiB,SAAmC;AAC9D,QAAM,SAAS,uBAAuB,QAAQ;;;;;;;AAQlD,IAAa,WAAb,cAA8B,aAAa;CAOzC,YACE,SACA,UACA,QACA,SACA;AACA,QAAM,SAAS,aAAa;GAC1B,GAAG;GACH;GACA;GACD,CAAC;AACF,OAAK,WAAW;AAChB,OAAK,SAAS;;;;;;;AAQlB,IAAa,gBAAb,cAAmC,aAAa;CAO9C,YAAY,SAAiB,WAAoB,OAAgB,SAAmC;AAClG,QAAM,SAAS,kBAAkB;GAC/B,GAAG;GACH;GACA;GACD,CAAC;AACF,OAAK,YAAY;AACjB,OAAK,QAAQ;;;;;;;AAQjB,IAAa,uBAAb,cAA0C,aAAa;CAIrD,YAAY,SAAiB,QAAgB,SAAmC;AAC9E,QAAM,SAAS,0BAA0B;GACvC,GAAG;GACH;GACD,CAAC;AACF,OAAK,SAAS;;;;;;;AAQlB,IAAa,cAAb,cAAiC,aAAa;CAI5C,YAAY,SAAiB,YAAoB,SAAmC;AAClF,QAAM,SAAS,gBAAgB;GAC7B,GAAG;GACH;GACD,CAAC;AACF,OAAK,aAAa;;;;;;;AAQtB,IAAa,eAAb,cAAkC,aAAa;CAI7C,YAAY,SAAiB,aAAsB,SAAmC;AACpF,QAAM,SAAS,iBAAiB;GAC9B,GAAG;GACH;GACD,CAAC;AACF,OAAK,cAAc"}
package/dist/index.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import { DB_CLIENT_RECYCLE_COUNT, DEFAULT_BATCH_SIZE, DEFAULT_HEALTH_CHECK_PORT, DEFAULT_POLLING_INTERVAL_MS, DEFAULT_START_HEIGHT, GENESIS_BATCH_SIZE, PAGINATION_LIMITS, PERIODIC_INTERVALS, QUEUE_DEQUEUE_TIMEOUT_MS, RPC_TIMEOUT_MS } from "./constants.js";
2
- import { IndexerMetrics } from "./metrics/index.js";
3
- import { EcleciaIndexer, defaultIndexerConfig } from "./indexer/index.js";
4
- import { CircularBuffer, PromiseQueue } from "./promise-queue/index.js";
5
- import { index_d_exports } from "./types/index.js";
6
- import { EclesiaEmitter } from "./emitter/index.js";
7
- import { BlockProcessingError, ConfigurationError, DatabaseError, GenesisError, IndexerError, ModuleError, RPCError } from "./errors/index.js";
8
- import { index_d_exports as index_d_exports$1 } from "./utils/index.js";
9
- import { index_d_exports as index_d_exports$2 } from "./validation/index.js";
10
- export { BlockProcessingError, CircularBuffer, ConfigurationError, DB_CLIENT_RECYCLE_COUNT, DEFAULT_BATCH_SIZE, DEFAULT_HEALTH_CHECK_PORT, DEFAULT_POLLING_INTERVAL_MS, DEFAULT_START_HEIGHT, DatabaseError, EcleciaIndexer, EclesiaEmitter, GENESIS_BATCH_SIZE, GenesisError, IndexerError, IndexerMetrics, ModuleError, PAGINATION_LIMITS, PERIODIC_INTERVALS, PromiseQueue, QUEUE_DEQUEUE_TIMEOUT_MS, RPCError, RPC_TIMEOUT_MS, index_d_exports as Types, index_d_exports$1 as Utils, index_d_exports$2 as Validation, defaultIndexerConfig };
package/dist/index.js DELETED
@@ -1,11 +0,0 @@
1
- import { DB_CLIENT_RECYCLE_COUNT, DEFAULT_BATCH_SIZE, DEFAULT_HEALTH_CHECK_PORT, DEFAULT_POLLING_INTERVAL_MS, DEFAULT_START_HEIGHT, GENESIS_BATCH_SIZE, PAGINATION_LIMITS, PERIODIC_INTERVALS, QUEUE_DEQUEUE_TIMEOUT_MS, RPC_TIMEOUT_MS } from "./constants.js";
2
- import { EclesiaEmitter } from "./emitter/index.js";
3
- import { BlockProcessingError, ConfigurationError, DatabaseError, GenesisError, IndexerError, ModuleError, RPCError } from "./errors/index.js";
4
- import { IndexerMetrics } from "./metrics/index.js";
5
- import { CircularBuffer, PromiseQueue } from "./promise-queue/index.js";
6
- import { utils_exports } from "./utils/index.js";
7
- import { validation_exports } from "./validation/index.js";
8
- import { EcleciaIndexer, defaultIndexerConfig } from "./indexer/index.js";
9
- import { types_exports } from "./types/index.js";
10
-
11
- export { BlockProcessingError, CircularBuffer, ConfigurationError, DB_CLIENT_RECYCLE_COUNT, DEFAULT_BATCH_SIZE, DEFAULT_HEALTH_CHECK_PORT, DEFAULT_POLLING_INTERVAL_MS, DEFAULT_START_HEIGHT, DatabaseError, EcleciaIndexer, EclesiaEmitter, GENESIS_BATCH_SIZE, GenesisError, IndexerError, IndexerMetrics, ModuleError, PAGINATION_LIMITS, PERIODIC_INTERVALS, PromiseQueue, QUEUE_DEQUEUE_TIMEOUT_MS, RPCError, RPC_TIMEOUT_MS, types_exports as Types, utils_exports as Utils, validation_exports as Validation, defaultIndexerConfig };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/indexer/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAmEa;EAAA,WAAA,EAAA,MAAA;EAgBZ,SAAA,EAAA,MAAA;SAXqB,EAAA,KAAA,EAAA;;YAAA;YAUa,EAAA,OAAA;EAAA,eAAA,EAAA,MAAA;EAOtB,oBAAe,EAAA,GAAA,GAAA,OAAA;EAAA,OAAA,EAAA,OAAA;iBAEX,EAAA,MAAA;kBAqBI,EAAA,OAAA;gBAMH,EAAA,MAAA;MAGK,EAAA,GAAA,UAAA,CAAA,IAAA,CAAA;kBAGD,EAAA,GAAA,UAAA,CAAA,IAAA,CAAA;gBAiBA,EAAA,CAAA,OAAA,EAAA,OAAA,EAAA,GA3Da,OA2Db,CAAA,IAAA,CAAA;;;;;;AAwrBsB,cA5uB/B,cAAA,SAAuB,cAAA,CA4uBQ;;QAAqD,EA1uBhF,oBA0uBgF;;EA5uB/C,QAAA,OAAA;;;;;;;;;;;;cAuB7B;;;;UAMH;;eAGK;;OAGT,OAAA,CAAQ;;;;;;;;;;;sBAiBA;;;;aAyKA;WAwBF;aAsMA,eAAe,kBAAkB;;;+BAiTT,+CAAqD,QAAQ"}