@eclesia/indexer-engine 2.7.7 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.cjs +34 -0
- package/dist/_virtual/rolldown_runtime.js +13 -0
- package/dist/emitter/index.cjs +57 -0
- package/dist/emitter/index.cjs.map +1 -0
- package/dist/emitter/index.d.cts +21 -0
- package/dist/emitter/index.d.cts.map +1 -0
- package/dist/emitter/index.d.ts +19 -15
- package/dist/emitter/index.d.ts.map +1 -1
- package/dist/emitter/index.js +54 -73
- package/dist/emitter/index.js.map +1 -0
- package/dist/index.cjs +23 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +7 -44
- package/dist/indexer/index.cjs +572 -0
- package/dist/indexer/index.cjs.map +1 -0
- package/dist/indexer/index.d.cts +54 -0
- package/dist/indexer/index.d.cts.map +1 -0
- package/dist/indexer/index.d.ts +50 -46
- package/dist/indexer/index.d.ts.map +1 -1
- package/dist/indexer/index.js +553 -724
- package/dist/indexer/index.js.map +1 -0
- package/dist/promise-queue/index.cjs +140 -0
- package/dist/promise-queue/index.cjs.map +1 -0
- package/dist/promise-queue/index.d.cts +39 -0
- package/dist/promise-queue/index.d.cts.map +1 -0
- package/dist/promise-queue/index.d.ts +36 -33
- package/dist/promise-queue/index.d.ts.map +1 -1
- package/dist/promise-queue/index.js +138 -172
- package/dist/promise-queue/index.js.map +1 -0
- package/dist/types/index.cjs +12 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.cts +102 -0
- package/dist/types/index.d.cts.map +1 -0
- package/dist/types/index.d.ts +88 -83
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +6 -2
- package/dist/types/index.js.map +1 -0
- package/dist/utils/bech32.cjs +27 -0
- package/dist/utils/bech32.cjs.map +1 -0
- package/dist/utils/bech32.d.cts +7 -0
- package/dist/utils/bech32.d.cts.map +1 -0
- package/dist/utils/bech32.d.ts +3 -1
- package/dist/utils/bech32.d.ts.map +1 -1
- package/dist/utils/bech32.js +17 -21
- package/dist/utils/bech32.js.map +1 -0
- package/dist/utils/bigint.cjs +9 -0
- package/dist/utils/bigint.cjs.map +1 -0
- package/dist/utils/bigint.d.cts +5 -0
- package/dist/utils/bigint.d.cts.map +1 -0
- package/dist/utils/bigint.d.ts +3 -1
- package/dist/utils/bigint.d.ts.map +1 -1
- package/dist/utils/bigint.js +6 -5
- package/dist/utils/bigint.js.map +1 -0
- package/dist/utils/index.cjs +22 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +11 -0
- package/dist/utils/index.d.cts.map +1 -0
- package/dist/utils/index.d.ts +10 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +17 -19
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/text.cjs +11 -0
- package/dist/utils/text.cjs.map +1 -0
- package/dist/utils/text.d.cts +5 -0
- package/dist/utils/text.d.cts.map +1 -0
- package/dist/utils/text.d.ts +4 -1
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/text.js +8 -13
- package/dist/utils/text.js.map +1 -0
- package/package.json +24 -6
- package/dist/index.d.ts.map +0 -1
|
@@ -1,172 +1,138 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
this.enqueuer = resolve;
|
|
140
|
-
});
|
|
141
|
-
this.items = new Array(this.batchSize);
|
|
142
|
-
this.items[this.nextAvail] = nextVal;
|
|
143
|
-
this.synced = false;
|
|
144
|
-
this.count = 1;
|
|
145
|
-
this.nextAvail++;
|
|
146
|
-
if (this.nextAvail >= this.batchSize) {
|
|
147
|
-
this.nextAvail = 0;
|
|
148
|
-
}
|
|
149
|
-
this.continuePromise = new Promise((resolve, _reject) => {
|
|
150
|
-
this.batcher = resolve;
|
|
151
|
-
});
|
|
152
|
-
this.batcher(true);
|
|
153
|
-
}
|
|
154
|
-
continue() {
|
|
155
|
-
return this.continuePromise;
|
|
156
|
-
}
|
|
157
|
-
setSynced() {
|
|
158
|
-
this.synced = true;
|
|
159
|
-
}
|
|
160
|
-
isEmpty() {
|
|
161
|
-
if (this.count == 0) {
|
|
162
|
-
return true;
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
return false;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
size() {
|
|
169
|
-
return this.count;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
exports.CircularBuffer = CircularBuffer;
|
|
1
|
+
//#region src/promise-queue/index.ts
|
|
2
|
+
var PromiseQueue = class {
|
|
3
|
+
constructor(batchSize) {
|
|
4
|
+
this.synced = false;
|
|
5
|
+
const nextVal = new Promise((resolve, _reject) => {
|
|
6
|
+
this.enqueuer = resolve;
|
|
7
|
+
});
|
|
8
|
+
this.batchSize = batchSize;
|
|
9
|
+
this.continuePromise = new Promise((resolve, _reject) => {
|
|
10
|
+
this.batcher = resolve;
|
|
11
|
+
});
|
|
12
|
+
this.batcher(true);
|
|
13
|
+
this.items = [nextVal];
|
|
14
|
+
}
|
|
15
|
+
enqueue(item) {
|
|
16
|
+
try {
|
|
17
|
+
this.enqueuer(item);
|
|
18
|
+
const nextVal = new Promise((resolve, _reject) => {
|
|
19
|
+
this.enqueuer = resolve;
|
|
20
|
+
});
|
|
21
|
+
this.items.push(nextVal);
|
|
22
|
+
if (this.size() > this.batchSize) this.continuePromise = new Promise((resolve, _reject) => {
|
|
23
|
+
this.batcher = resolve;
|
|
24
|
+
});
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.error("Enqueing rejected data: " + e);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
clear() {
|
|
30
|
+
const nextVal = new Promise((resolve, _reject) => {
|
|
31
|
+
this.enqueuer = resolve;
|
|
32
|
+
});
|
|
33
|
+
this.continuePromise = new Promise((resolve, _reject) => {
|
|
34
|
+
this.batcher = resolve;
|
|
35
|
+
});
|
|
36
|
+
this.batcher(true);
|
|
37
|
+
this.items = [nextVal];
|
|
38
|
+
}
|
|
39
|
+
dequeue() {
|
|
40
|
+
const item = this.items.shift();
|
|
41
|
+
if (this.size() <= this.batchSize) this.batcher(true);
|
|
42
|
+
return item;
|
|
43
|
+
}
|
|
44
|
+
continue() {
|
|
45
|
+
return this.continuePromise;
|
|
46
|
+
}
|
|
47
|
+
setSynced() {
|
|
48
|
+
this.synced = true;
|
|
49
|
+
}
|
|
50
|
+
isEmpty() {
|
|
51
|
+
if (this.items.length == 0) return true;
|
|
52
|
+
else return false;
|
|
53
|
+
}
|
|
54
|
+
size() {
|
|
55
|
+
return this.items.length;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var CircularBuffer = class {
|
|
59
|
+
constructor(batchSize) {
|
|
60
|
+
this.count = 0;
|
|
61
|
+
this.next = 0;
|
|
62
|
+
this.synced = false;
|
|
63
|
+
this.nextAvail = 0;
|
|
64
|
+
if (batchSize <= 1) throw new Error("Batch size must be greater than 1");
|
|
65
|
+
const nextVal = new Promise((resolve, _reject) => {
|
|
66
|
+
this.enqueuer = resolve;
|
|
67
|
+
});
|
|
68
|
+
this.items = new Array(batchSize);
|
|
69
|
+
this.batchSize = batchSize;
|
|
70
|
+
this.items[this.nextAvail] = nextVal;
|
|
71
|
+
this.count = 1;
|
|
72
|
+
this.nextAvail++;
|
|
73
|
+
if (this.nextAvail >= this.batchSize) this.nextAvail = 0;
|
|
74
|
+
this.continuePromise = new Promise((resolve, _reject) => {
|
|
75
|
+
this.batcher = resolve;
|
|
76
|
+
});
|
|
77
|
+
this.batcher(true);
|
|
78
|
+
}
|
|
79
|
+
enqueue(item) {
|
|
80
|
+
try {
|
|
81
|
+
this.enqueuer(item);
|
|
82
|
+
const nextVal = new Promise((resolve, _reject) => {
|
|
83
|
+
this.enqueuer = resolve;
|
|
84
|
+
});
|
|
85
|
+
this.items[this.nextAvail] = nextVal;
|
|
86
|
+
this.count++;
|
|
87
|
+
this.nextAvail++;
|
|
88
|
+
if (this.nextAvail >= this.batchSize) this.nextAvail = 0;
|
|
89
|
+
if (this.nextAvail == this.next) this.continuePromise = new Promise((resolve, _reject) => {
|
|
90
|
+
this.batcher = resolve;
|
|
91
|
+
});
|
|
92
|
+
} catch (e) {
|
|
93
|
+
console.error("Enqueing rejected data: " + e);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
dequeue() {
|
|
97
|
+
const item = this.items[this.next];
|
|
98
|
+
this.next++;
|
|
99
|
+
this.count--;
|
|
100
|
+
if (this.next >= this.batchSize) this.next = 0;
|
|
101
|
+
if (this.count < this.batchSize) this.batcher(true);
|
|
102
|
+
return item;
|
|
103
|
+
}
|
|
104
|
+
clear() {
|
|
105
|
+
this.next = 0;
|
|
106
|
+
this.nextAvail = 0;
|
|
107
|
+
const nextVal = new Promise((resolve, _reject) => {
|
|
108
|
+
this.enqueuer = resolve;
|
|
109
|
+
});
|
|
110
|
+
this.items = new Array(this.batchSize);
|
|
111
|
+
this.items[this.nextAvail] = nextVal;
|
|
112
|
+
this.synced = false;
|
|
113
|
+
this.count = 1;
|
|
114
|
+
this.nextAvail++;
|
|
115
|
+
if (this.nextAvail >= this.batchSize) this.nextAvail = 0;
|
|
116
|
+
this.continuePromise = new Promise((resolve, _reject) => {
|
|
117
|
+
this.batcher = resolve;
|
|
118
|
+
});
|
|
119
|
+
this.batcher(true);
|
|
120
|
+
}
|
|
121
|
+
continue() {
|
|
122
|
+
return this.continuePromise;
|
|
123
|
+
}
|
|
124
|
+
setSynced() {
|
|
125
|
+
this.synced = true;
|
|
126
|
+
}
|
|
127
|
+
isEmpty() {
|
|
128
|
+
if (this.count == 0) return true;
|
|
129
|
+
else return false;
|
|
130
|
+
}
|
|
131
|
+
size() {
|
|
132
|
+
return this.count;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
//#endregion
|
|
137
|
+
export { CircularBuffer, PromiseQueue };
|
|
138
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/promise-queue/index.ts"],"sourcesContent":["/*\n *This implements an \"infinite\" FIFO queue of fixed size.\n *await `continue()` before enqueing items to ensure fixed size (as it only resolves when space available)\n *await `dequeue()` to pop an item as it will only resolve if the next item is available\n *size() is always at minimum 1 item which is the promise that will resolve to the next item whenever it is enqueued\n */\n\nexport class PromiseQueue<T> {\n private items: Array<Promise<T>>;\n\n private enqueuer!: (val: T | PromiseLike<T>) => void;\n\n private batcher!: (val: boolean) => void;\n\n public synced = false;\n\n private batchSize: number;\n\n private continuePromise: Promise<boolean>;\n\n constructor(batchSize: number) {\n const nextVal = new Promise<T>((resolve, _reject) => {\n this.enqueuer = resolve;\n });\n this.batchSize = batchSize;\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 console.error(\"Enqueing rejected data: \" + e);\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\nexport class CircularBuffer<T> {\n private items: Array<Promise<T>>;\n\n private enqueuer!: (val: T | PromiseLike<T>) => void;\n\n private count: number = 0;\n\n private next: number = 0;\n\n private batcher!: (val: boolean) => void;\n\n public synced = false;\n\n private batchSize: number;\n\n private continuePromise: Promise<boolean>;\n\n private nextAvail: number = 0;\n\n constructor(batchSize: number) {\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.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 console.error(\"Enqueing rejected data: \" + e);\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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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":["import {\n BlockResponse, BlockResultsResponse,\n} from \"@cosmjs/tendermint-rpc\";\nimport {\n Event,\n} from \"@cosmjs/tendermint-rpc/build/comet38/responses\";\nimport {\n Validator,\n} from \"cosmjs-types/cosmos/staking/v1beta1/staking\";\nimport {\n TxBody,\n} from \"cosmjs-types/cosmos/tx/v1beta1/tx\";\n\nimport {\n EcleciaIndexer,\n} from \"../indexer\";\nimport {\n CircularBuffer,\n} from \"../promise-queue\";\n\nexport type EcleciaIndexerConfig = {\n startHeight?: number\n endHeight?: number\n batchSize: number\n modules: string[]\n getNextHeight: () => number | PromiseLike<number>\n logLevel: \"error\" | \"warn\" | \"info\" | \"http\" | \"verbose\" | \"debug\" | \"silly\"\n rpcUrl: string\n processGenesis?: boolean\n genesisPath?: string\n usePolling?: boolean\n pollingInterval?: number\n minimal?: boolean\n init?: () => Promise<void>\n beginTransaction: () => Promise<void>\n endTransaction: (status: boolean) => Promise<void>\n};\n\nexport type FullBlockQueue = CircularBuffer<[BlockResponse, BlockResultsResponse, Uint8Array]>;\nexport type MinimalBlockQueue = CircularBuffer<[BlockResponse, BlockResultsResponse]>;\nexport type BlockQueue = FullBlockQueue | MinimalBlockQueue;\nexport type WithHeightAndUUID<T> = {\n [K in keyof T]: T[K] & {\n uuid?: string\n height?: number\n timestamp?: string\n };\n};\nexport type EmitFunc<K extends keyof WithHeightAndUUID<EventMap>> = (\n t: K,\n e: WithHeightAndUUID<EventMap>[K]\n) => Promise<void | void[]>;\n\nexport type LogEvent = {\n type: \"log\" | \"info\" | \"warning\" | \"error\" | \"verbose\" | \"transient\"\n message: string\n};\nexport type UUIDEvent = {\n uuid: string\n error?: string\n status: boolean\n};\nexport type Events = {\n log: LogEvent\n uuid: UUIDEvent\n begin_block: {\n value: {\n events: BlockResultsResponse[\"beginBlockEvents\"]\n validators: Validator[] | undefined\n }\n }\n\n block: {\n value: {\n block: BlockResponse\n block_results: BlockResultsResponse\n }\n }\n end_block: {\n value: BlockResultsResponse[\"endBlockEvents\"]\n }\n tx_events: {\n value: BlockResultsResponse[\"results\"]\n }\n tx_memo: {\n value: {\n txHash: string\n txBody: TxBody\n }\n }\n _unhandled: {\n type: string\n event: unknown\n }\n \"periodic/50\": {\n value: null\n }\n \"periodic/100\": {\n value: null\n }\n \"periodic/1000\": {\n value: null\n }\n};\nexport type TxResult<T> = {\n tx: T\n events: Event[]\n};\n\nexport interface IndexingModule {\n indexer: EcleciaIndexer\n name: string\n depends: string[]\n provides: string[]\n setup: () => Promise<void>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n init: (...args: any[]) => void\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { EcleciaIndexer } from "../indexer/index.cjs";
|
|
2
|
+
import { CircularBuffer } from "../promise-queue/index.cjs";
|
|
3
|
+
import { BlockResponse, BlockResultsResponse } from "@cosmjs/tendermint-rpc";
|
|
4
|
+
import { Event } from "@cosmjs/tendermint-rpc/build/comet38/responses";
|
|
5
|
+
import { Validator } from "cosmjs-types/cosmos/staking/v1beta1/staking";
|
|
6
|
+
import { TxBody } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
|
7
|
+
|
|
8
|
+
//#region src/types/index.d.ts
|
|
9
|
+
declare namespace index_d_exports {
|
|
10
|
+
export { BlockQueue, EcleciaIndexerConfig, EmitFunc, Events, FullBlockQueue, IndexingModule, LogEvent, MinimalBlockQueue, TxResult, UUIDEvent, WithHeightAndUUID };
|
|
11
|
+
}
|
|
12
|
+
type EcleciaIndexerConfig = {
|
|
13
|
+
startHeight?: number;
|
|
14
|
+
endHeight?: number;
|
|
15
|
+
batchSize: number;
|
|
16
|
+
modules: string[];
|
|
17
|
+
getNextHeight: () => number | PromiseLike<number>;
|
|
18
|
+
logLevel: "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
|
|
19
|
+
rpcUrl: string;
|
|
20
|
+
processGenesis?: boolean;
|
|
21
|
+
genesisPath?: string;
|
|
22
|
+
usePolling?: boolean;
|
|
23
|
+
pollingInterval?: number;
|
|
24
|
+
minimal?: boolean;
|
|
25
|
+
init?: () => Promise<void>;
|
|
26
|
+
beginTransaction: () => Promise<void>;
|
|
27
|
+
endTransaction: (status: boolean) => Promise<void>;
|
|
28
|
+
};
|
|
29
|
+
type FullBlockQueue = CircularBuffer<[BlockResponse, BlockResultsResponse, Uint8Array]>;
|
|
30
|
+
type MinimalBlockQueue = CircularBuffer<[BlockResponse, BlockResultsResponse]>;
|
|
31
|
+
type BlockQueue = FullBlockQueue | MinimalBlockQueue;
|
|
32
|
+
type WithHeightAndUUID<T> = { [K in keyof T]: T[K] & {
|
|
33
|
+
uuid?: string;
|
|
34
|
+
height?: number;
|
|
35
|
+
timestamp?: string;
|
|
36
|
+
} };
|
|
37
|
+
type EmitFunc<K extends keyof WithHeightAndUUID<EventMap>> = (t: K, e: WithHeightAndUUID<EventMap>[K]) => Promise<void | void[]>;
|
|
38
|
+
type LogEvent = {
|
|
39
|
+
type: "log" | "info" | "warning" | "error" | "verbose" | "transient";
|
|
40
|
+
message: string;
|
|
41
|
+
};
|
|
42
|
+
type UUIDEvent = {
|
|
43
|
+
uuid: string;
|
|
44
|
+
error?: string;
|
|
45
|
+
status: boolean;
|
|
46
|
+
};
|
|
47
|
+
type Events = {
|
|
48
|
+
log: LogEvent;
|
|
49
|
+
uuid: UUIDEvent;
|
|
50
|
+
begin_block: {
|
|
51
|
+
value: {
|
|
52
|
+
events: BlockResultsResponse["beginBlockEvents"];
|
|
53
|
+
validators: Validator[] | undefined;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
block: {
|
|
57
|
+
value: {
|
|
58
|
+
block: BlockResponse;
|
|
59
|
+
block_results: BlockResultsResponse;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
end_block: {
|
|
63
|
+
value: BlockResultsResponse["endBlockEvents"];
|
|
64
|
+
};
|
|
65
|
+
tx_events: {
|
|
66
|
+
value: BlockResultsResponse["results"];
|
|
67
|
+
};
|
|
68
|
+
tx_memo: {
|
|
69
|
+
value: {
|
|
70
|
+
txHash: string;
|
|
71
|
+
txBody: TxBody;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
_unhandled: {
|
|
75
|
+
type: string;
|
|
76
|
+
event: unknown;
|
|
77
|
+
};
|
|
78
|
+
"periodic/50": {
|
|
79
|
+
value: null;
|
|
80
|
+
};
|
|
81
|
+
"periodic/100": {
|
|
82
|
+
value: null;
|
|
83
|
+
};
|
|
84
|
+
"periodic/1000": {
|
|
85
|
+
value: null;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
type TxResult<T> = {
|
|
89
|
+
tx: T;
|
|
90
|
+
events: Event[];
|
|
91
|
+
};
|
|
92
|
+
interface IndexingModule {
|
|
93
|
+
indexer: EcleciaIndexer;
|
|
94
|
+
name: string;
|
|
95
|
+
depends: string[];
|
|
96
|
+
provides: string[];
|
|
97
|
+
setup: () => Promise<void>;
|
|
98
|
+
init: (...args: any[]) => void;
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
export { EcleciaIndexerConfig, EmitFunc, WithHeightAndUUID, index_d_exports };
|
|
102
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","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"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,97 +1,102 @@
|
|
|
1
|
+
import { EcleciaIndexer } from "../indexer/index.js";
|
|
2
|
+
import { CircularBuffer } from "../promise-queue/index.js";
|
|
1
3
|
import { BlockResponse, BlockResultsResponse } from "@cosmjs/tendermint-rpc";
|
|
2
4
|
import { Event } from "@cosmjs/tendermint-rpc/build/comet38/responses";
|
|
3
5
|
import { Validator } from "cosmjs-types/cosmos/staking/v1beta1/staking";
|
|
4
6
|
import { TxBody } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export type BlockQueue = FullBlockQueue | MinimalBlockQueue;
|
|
27
|
-
export type WithHeightAndUUID<T> = {
|
|
28
|
-
[K in keyof T]: T[K] & {
|
|
29
|
-
uuid?: string;
|
|
30
|
-
height?: number;
|
|
31
|
-
timestamp?: string;
|
|
32
|
-
};
|
|
7
|
+
|
|
8
|
+
//#region src/types/index.d.ts
|
|
9
|
+
declare namespace index_d_exports {
|
|
10
|
+
export { BlockQueue, EcleciaIndexerConfig, EmitFunc, Events, FullBlockQueue, IndexingModule, LogEvent, MinimalBlockQueue, TxResult, UUIDEvent, WithHeightAndUUID };
|
|
11
|
+
}
|
|
12
|
+
type EcleciaIndexerConfig = {
|
|
13
|
+
startHeight?: number;
|
|
14
|
+
endHeight?: number;
|
|
15
|
+
batchSize: number;
|
|
16
|
+
modules: string[];
|
|
17
|
+
getNextHeight: () => number | PromiseLike<number>;
|
|
18
|
+
logLevel: "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly";
|
|
19
|
+
rpcUrl: string;
|
|
20
|
+
processGenesis?: boolean;
|
|
21
|
+
genesisPath?: string;
|
|
22
|
+
usePolling?: boolean;
|
|
23
|
+
pollingInterval?: number;
|
|
24
|
+
minimal?: boolean;
|
|
25
|
+
init?: () => Promise<void>;
|
|
26
|
+
beginTransaction: () => Promise<void>;
|
|
27
|
+
endTransaction: (status: boolean) => Promise<void>;
|
|
33
28
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
type FullBlockQueue = CircularBuffer<[BlockResponse, BlockResultsResponse, Uint8Array]>;
|
|
30
|
+
type MinimalBlockQueue = CircularBuffer<[BlockResponse, BlockResultsResponse]>;
|
|
31
|
+
type BlockQueue = FullBlockQueue | MinimalBlockQueue;
|
|
32
|
+
type WithHeightAndUUID<T> = { [K in keyof T]: T[K] & {
|
|
33
|
+
uuid?: string;
|
|
34
|
+
height?: number;
|
|
35
|
+
timestamp?: string;
|
|
36
|
+
} };
|
|
37
|
+
type EmitFunc<K extends keyof WithHeightAndUUID<EventMap>> = (t: K, e: WithHeightAndUUID<EventMap>[K]) => Promise<void | void[]>;
|
|
38
|
+
type LogEvent = {
|
|
39
|
+
type: "log" | "info" | "warning" | "error" | "verbose" | "transient";
|
|
40
|
+
message: string;
|
|
38
41
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
type UUIDEvent = {
|
|
43
|
+
uuid: string;
|
|
44
|
+
error?: string;
|
|
45
|
+
status: boolean;
|
|
43
46
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
block: {
|
|
54
|
-
value: {
|
|
55
|
-
block: BlockResponse;
|
|
56
|
-
block_results: BlockResultsResponse;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
end_block: {
|
|
60
|
-
value: BlockResultsResponse["endBlockEvents"];
|
|
61
|
-
};
|
|
62
|
-
tx_events: {
|
|
63
|
-
value: BlockResultsResponse["results"];
|
|
64
|
-
};
|
|
65
|
-
tx_memo: {
|
|
66
|
-
value: {
|
|
67
|
-
txHash: string;
|
|
68
|
-
txBody: TxBody;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
_unhandled: {
|
|
72
|
-
type: string;
|
|
73
|
-
event: unknown;
|
|
74
|
-
};
|
|
75
|
-
"periodic/50": {
|
|
76
|
-
value: null;
|
|
47
|
+
type Events = {
|
|
48
|
+
log: LogEvent;
|
|
49
|
+
uuid: UUIDEvent;
|
|
50
|
+
begin_block: {
|
|
51
|
+
value: {
|
|
52
|
+
events: BlockResultsResponse["beginBlockEvents"];
|
|
53
|
+
validators: Validator[] | undefined;
|
|
77
54
|
};
|
|
78
|
-
|
|
79
|
-
|
|
55
|
+
};
|
|
56
|
+
block: {
|
|
57
|
+
value: {
|
|
58
|
+
block: BlockResponse;
|
|
59
|
+
block_results: BlockResultsResponse;
|
|
80
60
|
};
|
|
81
|
-
|
|
82
|
-
|
|
61
|
+
};
|
|
62
|
+
end_block: {
|
|
63
|
+
value: BlockResultsResponse["endBlockEvents"];
|
|
64
|
+
};
|
|
65
|
+
tx_events: {
|
|
66
|
+
value: BlockResultsResponse["results"];
|
|
67
|
+
};
|
|
68
|
+
tx_memo: {
|
|
69
|
+
value: {
|
|
70
|
+
txHash: string;
|
|
71
|
+
txBody: TxBody;
|
|
83
72
|
};
|
|
73
|
+
};
|
|
74
|
+
_unhandled: {
|
|
75
|
+
type: string;
|
|
76
|
+
event: unknown;
|
|
77
|
+
};
|
|
78
|
+
"periodic/50": {
|
|
79
|
+
value: null;
|
|
80
|
+
};
|
|
81
|
+
"periodic/100": {
|
|
82
|
+
value: null;
|
|
83
|
+
};
|
|
84
|
+
"periodic/1000": {
|
|
85
|
+
value: null;
|
|
86
|
+
};
|
|
84
87
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
type TxResult<T> = {
|
|
89
|
+
tx: T;
|
|
90
|
+
events: Event[];
|
|
88
91
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
interface IndexingModule {
|
|
93
|
+
indexer: EcleciaIndexer;
|
|
94
|
+
name: string;
|
|
95
|
+
depends: string[];
|
|
96
|
+
provides: string[];
|
|
97
|
+
setup: () => Promise<void>;
|
|
98
|
+
init: (...args: any[]) => void;
|
|
96
99
|
}
|
|
100
|
+
//#endregion
|
|
101
|
+
export { EcleciaIndexerConfig, EmitFunc, WithHeightAndUUID, index_d_exports };
|
|
97
102
|
//# sourceMappingURL=index.d.ts.map
|