@origintrail-official/dkg-node-ui 10.0.19 → 10.0.21
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/README.md +1 -0
- package/dist/api.d.ts +7 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +22 -1
- package/dist/api.js.map +1 -1
- package/dist/chain-cursor-stores.d.ts +11 -108
- package/dist/chain-cursor-stores.d.ts.map +1 -1
- package/dist/chain-cursor-stores.js +11 -287
- package/dist/chain-cursor-stores.js.map +1 -1
- package/dist/chain-event-log-store.d.ts +10 -112
- package/dist/chain-event-log-store.d.ts.map +1 -1
- package/dist/chain-event-log-store.js +9 -360
- package/dist/chain-event-log-store.js.map +1 -1
- package/dist/chat-memory.d.ts +1 -0
- package/dist/chat-memory.d.ts.map +1 -1
- package/dist/chat-memory.js +31 -39
- package/dist/chat-memory.js.map +1 -1
- package/dist/chat-turn-subject.d.ts +18 -0
- package/dist/chat-turn-subject.d.ts.map +1 -0
- package/dist/chat-turn-subject.js +52 -0
- package/dist/chat-turn-subject.js.map +1 -0
- package/dist/db.d.ts +2 -143
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +9 -387
- package/dist/db.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/metrics-collector.d.ts +11 -1
- package/dist/metrics-collector.d.ts.map +1 -1
- package/dist/metrics-collector.js +77 -39
- package/dist/metrics-collector.js.map +1 -1
- package/dist/protocol-outbox-store.d.ts +9 -64
- package/dist/protocol-outbox-store.d.ts.map +1 -1
- package/dist/protocol-outbox-store.js +11 -198
- package/dist/protocol-outbox-store.js.map +1 -1
- package/dist-ui/assets/{3d-force-graph-CehOGxux.js → 3d-force-graph-DbVwxMKf.js} +1 -1
- package/dist-ui/assets/{ActivityFeed-BE4MTD8M.js → ActivityFeed-Bfg6fmQQ.js} +1 -1
- package/dist-ui/assets/{AgentHub-CT6UhLF2.js → AgentHub-DyF5Pa70.js} +1 -1
- package/dist-ui/assets/{AgentProfilePage-ygi-GXKM.js → AgentProfilePage-BPrSuKjV.js} +1 -1
- package/dist-ui/assets/{ApproveWalletsModal-YFfDrGth.js → ApproveWalletsModal-Dd_tHLRP.js} +1 -1
- package/dist-ui/assets/{ContextGraphPrimitives-Dh-w2D_i.js → ContextGraphPrimitives-BXormriD.js} +1 -1
- package/dist-ui/assets/{ConvictionDetailView-CfRmqqDD.js → ConvictionDetailView-BsPTd17P.js} +1 -1
- package/dist-ui/assets/{MemoryLayerView-DL0zLYAQ.js → MemoryLayerView-CloJeM33.js} +2 -2
- package/dist-ui/assets/{MemoryStackView-BsV_JnOe.js → MemoryStackView-BbUJ2uiM.js} +1 -1
- package/dist-ui/assets/{Network-BkxRENe4.js → Network-BKvJttOu.js} +1 -1
- package/dist-ui/assets/{OnChainProvenanceCard-CnnkMMNI.js → OnChainProvenanceCard-BV9-G1cT.js} +1 -1
- package/dist-ui/assets/{Operations-BaWWLSUw.js → Operations-LAhUQsnj.js} +1 -1
- package/dist-ui/assets/{ProjectView-BJmZ5f62.js → ProjectView-0zCSblAV.js} +3 -3
- package/dist-ui/assets/{PublishingConviction-CKB6JBYk.js → PublishingConviction-CF6352oT.js} +1 -1
- package/dist-ui/assets/{Settings-DXGMPiJk.js → Settings-runaZqPv.js} +1 -1
- package/dist-ui/assets/{browserWalletTransaction-BdmrJpK1.js → browserWalletTransaction-CBgx0i4w.js} +3 -3
- package/dist-ui/assets/{ccip-BNYiIkjs.js → ccip-BM07w5uU.js} +1 -1
- package/dist-ui/assets/{index-DOGXDQkQ.js → index-CfVUpsfM.js} +3 -3
- package/dist-ui/assets/{index-DK8XzE3T.js → index-MQh8C4aJ.js} +90 -90
- package/dist-ui/assets/index-xKO-U_eV.css +1 -0
- package/dist-ui/assets/{jsonld-32FQRO67-Ca-KnQfb.js → jsonld-32FQRO67-DBZOBQji.js} +2 -2
- package/dist-ui/assets/{jsonld-mRC9FbFR.js → jsonld-DOX7dKpf.js} +1 -1
- package/dist-ui/assets/{renderer-3d-2EVDZII7-AEMBPIY7.js → renderer-3d-2EVDZII7-CVCpAmwB.js} +2 -2
- package/dist-ui/assets/{shikiHighlighter-CUQ07vzt.js → shikiHighlighter-CzU2U2Tx.js} +1 -1
- package/dist-ui/assets/{useEntityOnChainReceipt-C8NHlPPN.js → useEntityOnChainReceipt-BvWQ6qdT.js} +1 -1
- package/dist-ui/assets/{useProjectActivity-CVFCfbMj.js → useProjectActivity-Cxr4QGX1.js} +1 -1
- package/dist-ui/index.html +2 -2
- package/package.json +6 -4
- package/dist-ui/assets/index-BLQUVvVz.css +0 -1
|
@@ -1,289 +1,13 @@
|
|
|
1
|
-
function parsePositiveSafeInteger(value) {
|
|
2
|
-
if (value == null)
|
|
3
|
-
return undefined;
|
|
4
|
-
const parsed = Number(value);
|
|
5
|
-
return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : undefined;
|
|
6
|
-
}
|
|
7
|
-
class SettingsPositiveIntegerCursorStore {
|
|
8
|
-
db;
|
|
9
|
-
constructor(db) {
|
|
10
|
-
this.db = db;
|
|
11
|
-
}
|
|
12
|
-
load(key) {
|
|
13
|
-
const row = this.db.prepare(`SELECT value FROM settings WHERE key = ?`).get(key);
|
|
14
|
-
return parsePositiveSafeInteger(row?.value);
|
|
15
|
-
}
|
|
16
|
-
save(key, value) {
|
|
17
|
-
if (!Number.isSafeInteger(value) || value <= 0)
|
|
18
|
-
return;
|
|
19
|
-
this.db.prepare(`INSERT OR REPLACE INTO settings (key, value) VALUES (?, ?)`).run(key, String(value));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
class RuntimePositiveIntegerCursorStore {
|
|
23
|
-
db;
|
|
24
|
-
namespace;
|
|
25
|
-
constructor(db, namespace) {
|
|
26
|
-
this.db = db;
|
|
27
|
-
this.namespace = namespace;
|
|
28
|
-
}
|
|
29
|
-
load(scope, key) {
|
|
30
|
-
const row = this.db.prepare(`SELECT value FROM runtime_cursors WHERE namespace = ? AND scope = ? AND key = ?`).get(this.namespace, scope, key);
|
|
31
|
-
return parsePositiveSafeInteger(row?.value);
|
|
32
|
-
}
|
|
33
|
-
save(scope, key, value) {
|
|
34
|
-
if (!Number.isSafeInteger(value) || value <= 0)
|
|
35
|
-
return;
|
|
36
|
-
this.db.prepare(`
|
|
37
|
-
INSERT INTO runtime_cursors (namespace, scope, key, value, updated_at)
|
|
38
|
-
VALUES (?, ?, ?, ?, ?)
|
|
39
|
-
ON CONFLICT(namespace, scope, key) DO UPDATE SET
|
|
40
|
-
value = excluded.value,
|
|
41
|
-
updated_at = excluded.updated_at
|
|
42
|
-
`).run(this.namespace, scope, key, value, Date.now());
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
1
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.legacyCursors = new SettingsPositiveIntegerCursorStore(dashboard.db);
|
|
58
|
-
this.scope = options.scope ?? 'default';
|
|
59
|
-
}
|
|
60
|
-
async loadLane(lane) {
|
|
61
|
-
return this.cursors.load(this.scope, lane) ?? this.legacyCursors.load(this.legacyKey(lane));
|
|
62
|
-
}
|
|
63
|
-
async saveLane(lane, blockNumber) {
|
|
64
|
-
this.cursors.save(this.scope, lane, blockNumber);
|
|
65
|
-
}
|
|
66
|
-
legacyKey(lane) {
|
|
67
|
-
return `chainEventPoller.cursor:${this.scope}:${lane}`;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* SQLite-backed ContextGraphNameRegistry scan cursor.
|
|
72
|
-
*
|
|
73
|
-
* The value is the next unbuffered block after a successfully scanned
|
|
74
|
-
* contiguous prefix. It is keyed by chain/deployment/registry address; corrupt
|
|
75
|
-
* values are ignored by returning `undefined`, which fails closed to the
|
|
76
|
-
* historical scan path.
|
|
77
|
-
*/
|
|
78
|
-
export class SqliteContextGraphRegistryScanCursorStore {
|
|
79
|
-
static REPAIR_KEY_PREFIX = 'contextGraphRegistryScan.repair:v1';
|
|
80
|
-
cursors;
|
|
81
|
-
legacyCursors;
|
|
82
|
-
db;
|
|
83
|
-
repairAudit = {
|
|
84
|
-
load: async (key) => {
|
|
85
|
-
const row = this.db.prepare(`SELECT value FROM settings WHERE key = ?`).get(this.repairKey(key));
|
|
86
|
-
if (!row)
|
|
87
|
-
return undefined;
|
|
88
|
-
try {
|
|
89
|
-
return JSON.parse(row.value);
|
|
90
|
-
}
|
|
91
|
-
catch {
|
|
92
|
-
return undefined;
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
save: async (key, checkpoint) => {
|
|
96
|
-
const encoded = JSON.stringify(checkpoint);
|
|
97
|
-
if (encoded === undefined)
|
|
98
|
-
throw new Error('Registry repair checkpoint is not serializable');
|
|
99
|
-
this.db.prepare(`INSERT OR REPLACE INTO settings (key, value) VALUES (?, ?)`).run(this.repairKey(key), encoded);
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
constructor(dashboard) {
|
|
103
|
-
this.db = dashboard.db;
|
|
104
|
-
this.cursors = new RuntimePositiveIntegerCursorStore(dashboard.db, 'contextGraphRegistryScan.cursor');
|
|
105
|
-
this.legacyCursors = new SettingsPositiveIntegerCursorStore(dashboard.db);
|
|
106
|
-
}
|
|
107
|
-
async load(key) {
|
|
108
|
-
return this.cursors.load(this.scope(key), this.registryKey(key))
|
|
109
|
-
?? this.legacyCursors.load(this.legacyKey(key));
|
|
110
|
-
}
|
|
111
|
-
async save(key, nextBlock) {
|
|
112
|
-
this.cursors.save(this.scope(key), this.registryKey(key), nextBlock);
|
|
113
|
-
}
|
|
114
|
-
scope(key) {
|
|
115
|
-
return `${key.chainId}:${key.deploymentId}`;
|
|
116
|
-
}
|
|
117
|
-
registryKey(key) {
|
|
118
|
-
return key.registryAddress.toLowerCase();
|
|
119
|
-
}
|
|
120
|
-
legacyKey(key) {
|
|
121
|
-
return [
|
|
122
|
-
'contextGraphRegistryScan.cursor',
|
|
123
|
-
key.chainId,
|
|
124
|
-
key.deploymentId,
|
|
125
|
-
key.registryAddress.toLowerCase(),
|
|
126
|
-
].join(':');
|
|
127
|
-
}
|
|
128
|
-
repairKey(key) {
|
|
129
|
-
return [
|
|
130
|
-
SqliteContextGraphRegistryScanCursorStore.REPAIR_KEY_PREFIX,
|
|
131
|
-
key.chainId,
|
|
132
|
-
key.deploymentId,
|
|
133
|
-
key.registryAddress.toLowerCase(),
|
|
134
|
-
].join(':');
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* SQLite-backed ContextGraphStorage discovery checkpoint: the enumeration
|
|
139
|
-
* cursor plus the chain facts of every id below it. One opaque JSON value per
|
|
140
|
-
* chain deployment `scope`; the agent owns and validates the codec, and a
|
|
141
|
-
* replace is one atomic row write.
|
|
142
|
-
*/
|
|
143
|
-
export class SqliteContextGraphStorageDiscoveryStore {
|
|
144
|
-
static KEY_PREFIX = 'contextGraphStorageDiscovery.checkpoint:v1:';
|
|
145
|
-
db;
|
|
146
|
-
scope;
|
|
147
|
-
constructor(dashboard, options = {}) {
|
|
148
|
-
this.db = dashboard.db;
|
|
149
|
-
this.scope = options.scope ?? 'default';
|
|
150
|
-
}
|
|
151
|
-
async load() {
|
|
152
|
-
const row = this.db.prepare(`SELECT value FROM settings WHERE key = ?`).get(this.key());
|
|
153
|
-
if (row === undefined)
|
|
154
|
-
return undefined;
|
|
155
|
-
try {
|
|
156
|
-
return JSON.parse(row.value);
|
|
157
|
-
}
|
|
158
|
-
catch {
|
|
159
|
-
// Hand back the raw text: the agent rejects it visibly and re-enumerates.
|
|
160
|
-
return row.value;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
async save(checkpoint) {
|
|
164
|
-
const value = JSON.stringify(checkpoint);
|
|
165
|
-
if (value === undefined) {
|
|
166
|
-
throw new Error('Context Graph storage discovery checkpoint is not serializable');
|
|
167
|
-
}
|
|
168
|
-
this.db.prepare(`INSERT OR REPLACE INTO settings (key, value) VALUES (?, ?)`).run(this.key(), value);
|
|
169
|
-
}
|
|
170
|
-
key() {
|
|
171
|
-
return `${SqliteContextGraphStorageDiscoveryStore.KEY_PREFIX}${this.scope}`;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Opaque, SQLite-backed authority-history checkpoints.
|
|
176
|
-
*
|
|
177
|
-
* SQLite makes each replacement atomic. The chain package exclusively owns
|
|
178
|
-
* the versioned codec, integrity check, and authority-state model; this adapter
|
|
179
|
-
* intentionally only persists and returns JSON values.
|
|
180
|
-
*/
|
|
181
|
-
export class SqliteContextGraphAuthorityHistoryStore {
|
|
182
|
-
static KEY_PREFIX = 'contextGraphAuthorityHistory.checkpoint:v1:';
|
|
183
|
-
db;
|
|
184
|
-
constructor(dashboard) {
|
|
185
|
-
this.db = dashboard.db;
|
|
186
|
-
}
|
|
187
|
-
async load(cacheKey) {
|
|
188
|
-
const row = this.db.prepare(`SELECT value FROM settings WHERE key = ?`).get(this.key(cacheKey));
|
|
189
|
-
if (row === undefined)
|
|
190
|
-
return undefined;
|
|
191
|
-
try {
|
|
192
|
-
return JSON.parse(row.value);
|
|
193
|
-
}
|
|
194
|
-
catch {
|
|
195
|
-
return undefined;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
async save(cacheKey, checkpoint) {
|
|
199
|
-
const value = JSON.stringify(checkpoint);
|
|
200
|
-
this.db.prepare(`INSERT OR REPLACE INTO settings (key, value) VALUES (?, ?)`).run(this.key(cacheKey), value);
|
|
201
|
-
}
|
|
202
|
-
async delete(cacheKey) {
|
|
203
|
-
this.db.prepare(`DELETE FROM settings WHERE key = ?`).run(this.key(cacheKey));
|
|
204
|
-
}
|
|
205
|
-
key(cacheKey) {
|
|
206
|
-
return `${SqliteContextGraphAuthorityHistoryStore.KEY_PREFIX}${cacheKey}`;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Opaque SQLite persistence for the chain-owned contract-wide authority index.
|
|
211
|
-
*
|
|
212
|
-
* Authority-bearing JSON is never interpreted here. The store owns the
|
|
213
|
-
* monotonic CAS token, and JSON `null` is its durable invalidation tombstone.
|
|
214
|
-
* Tokens therefore never repeat, including across corruption/reorg recovery.
|
|
215
|
-
*/
|
|
216
|
-
export class SqliteContextGraphAuthorityIndexStore {
|
|
217
|
-
db;
|
|
218
|
-
constructor(dashboard) {
|
|
219
|
-
this.db = dashboard.db;
|
|
220
|
-
}
|
|
221
|
-
async load(scope) {
|
|
222
|
-
const row = this.db.prepare(`
|
|
223
|
-
SELECT revision, checkpoint_json
|
|
224
|
-
FROM context_graph_authority_indexes
|
|
225
|
-
WHERE scope = ?
|
|
226
|
-
`).get(scope);
|
|
227
|
-
if (row === undefined)
|
|
228
|
-
return undefined;
|
|
229
|
-
try {
|
|
230
|
-
return Object.freeze({
|
|
231
|
-
token: row.revision,
|
|
232
|
-
value: JSON.parse(row.checkpoint_json),
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
catch {
|
|
236
|
-
// Preserve the durable token even when the opaque payload is corrupt, so
|
|
237
|
-
// chain can conditionally invalidate this exact row without racing a
|
|
238
|
-
// newer compare-and-swap winner.
|
|
239
|
-
return Object.freeze({
|
|
240
|
-
token: row.revision,
|
|
241
|
-
value: Object.freeze({ invalidCheckpointJson: row.checkpoint_json }),
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
async compareAndSwap(scope, expectedToken, checkpoint) {
|
|
246
|
-
if (scope.trim().length === 0)
|
|
247
|
-
throw new Error('Authority index scope is empty');
|
|
248
|
-
const value = JSON.stringify(checkpoint);
|
|
249
|
-
if (value === undefined)
|
|
250
|
-
throw new Error('Authority index checkpoint is not serializable');
|
|
251
|
-
if (expectedToken === undefined) {
|
|
252
|
-
const inserted = this.db.prepare(`
|
|
253
|
-
INSERT OR IGNORE INTO context_graph_authority_indexes (
|
|
254
|
-
scope, revision, checkpoint_json, updated_at
|
|
255
|
-
) VALUES (?, ?, ?, ?)
|
|
256
|
-
`).run(scope, 1, value, Date.now()).changes === 1;
|
|
257
|
-
return inserted ? 1 : undefined;
|
|
258
|
-
}
|
|
259
|
-
if (!Number.isSafeInteger(expectedToken) || expectedToken < 1) {
|
|
260
|
-
throw new Error('Authority index expected token is invalid');
|
|
261
|
-
}
|
|
262
|
-
const nextToken = expectedToken + 1;
|
|
263
|
-
if (!Number.isSafeInteger(nextToken)) {
|
|
264
|
-
throw new Error('Authority index token exceeds the safe integer range');
|
|
265
|
-
}
|
|
266
|
-
const updated = this.db.prepare(`
|
|
267
|
-
UPDATE context_graph_authority_indexes
|
|
268
|
-
SET revision = ?, checkpoint_json = ?, updated_at = ?
|
|
269
|
-
WHERE scope = ? AND revision = ?
|
|
270
|
-
`).run(nextToken, value, Date.now(), scope, expectedToken).changes === 1;
|
|
271
|
-
return updated ? nextToken : undefined;
|
|
272
|
-
}
|
|
273
|
-
async invalidate(scope, expectedToken) {
|
|
274
|
-
if (!Number.isSafeInteger(expectedToken) || expectedToken < 1) {
|
|
275
|
-
throw new Error('Authority index expected token is invalid');
|
|
276
|
-
}
|
|
277
|
-
const nextToken = expectedToken + 1;
|
|
278
|
-
if (!Number.isSafeInteger(nextToken)) {
|
|
279
|
-
throw new Error('Authority index token exceeds the safe integer range');
|
|
280
|
-
}
|
|
281
|
-
const invalidated = this.db.prepare(`
|
|
282
|
-
UPDATE context_graph_authority_indexes
|
|
283
|
-
SET revision = ?, checkpoint_json = 'null', updated_at = ?
|
|
284
|
-
WHERE scope = ? AND revision = ?
|
|
285
|
-
`).run(nextToken, Date.now(), scope, expectedToken).changes === 1;
|
|
286
|
-
return invalidated ? nextToken : undefined;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
2
|
+
* @deprecated Compatibility module. The chain cursor, registry-scan,
|
|
3
|
+
* storage-discovery and authority stores moved to
|
|
4
|
+
* `@origintrail-official/dkg-node-store`; this file only keeps the deep import
|
|
5
|
+
* path `@origintrail-official/dkg-node-ui/dist/chain-cursor-stores.js`
|
|
6
|
+
* resolving for downstream consumers that shipped against it (this package has
|
|
7
|
+
* no `exports` map, so `dist/*` is importable). First-party code imports
|
|
8
|
+
* `@origintrail-official/dkg-node-store` directly. Every class the former
|
|
9
|
+
* module exported is forwarded, and each is the very same class node-store
|
|
10
|
+
* exports.
|
|
11
|
+
*/
|
|
12
|
+
export { SqliteChainEventCursorStore, SqliteContextGraphAuthorityHistoryStore, SqliteContextGraphAuthorityIndexStore, SqliteContextGraphRegistryScanCursorStore, SqliteContextGraphStorageDiscoveryStore, } from '@origintrail-official/dkg-node-store';
|
|
289
13
|
//# sourceMappingURL=chain-cursor-stores.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-cursor-stores.js","sourceRoot":"","sources":["../src/chain-cursor-stores.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chain-cursor-stores.js","sourceRoot":"","sources":["../src/chain-cursor-stores.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,2BAA2B,EAC3B,uCAAuC,EACvC,qCAAqC,EACrC,yCAAyC,EACzC,uCAAuC,GACxC,MAAM,sCAAsC,CAAC"}
|
|
@@ -1,115 +1,13 @@
|
|
|
1
|
-
import type { DashboardDB } from './db.js';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* a tick's cursor advance, its tail replacement and its coverage extension are
|
|
12
|
-
* one atomic act. A half-applied tick would leave coverage claiming a range
|
|
13
|
-
* whose rows were rolled back, and a reader would then report an unindexed
|
|
14
|
-
* Context Graph as absent.
|
|
2
|
+
* @deprecated Compatibility module. The chain-event log store moved to
|
|
3
|
+
* `@origintrail-official/dkg-node-store`; this file only keeps the deep import
|
|
4
|
+
* path `@origintrail-official/dkg-node-ui/dist/chain-event-log-store.js`
|
|
5
|
+
* resolving for downstream consumers that shipped against it (this package has
|
|
6
|
+
* no `exports` map, so `dist/*` is importable). First-party code imports
|
|
7
|
+
* `@origintrail-official/dkg-node-store` directly. Every runtime value and type
|
|
8
|
+
* the former module exported is forwarded, and each is the very same
|
|
9
|
+
* declaration node-store exports.
|
|
15
10
|
*/
|
|
16
|
-
|
|
17
|
-
export
|
|
18
|
-
readonly blockNumber: number;
|
|
19
|
-
readonly blockHash: string;
|
|
20
|
-
readonly logIndex: number;
|
|
21
|
-
readonly transactionHash: string;
|
|
22
|
-
readonly address: string;
|
|
23
|
-
readonly topics: readonly string[];
|
|
24
|
-
readonly data: string;
|
|
25
|
-
readonly settled: boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface SqliteChainEventLogHead {
|
|
28
|
-
readonly number: number;
|
|
29
|
-
readonly hash: string;
|
|
30
|
-
readonly timestampSeconds: number;
|
|
31
|
-
readonly fetchedAtMs: number;
|
|
32
|
-
}
|
|
33
|
-
export interface SqliteChainEventLogCursor {
|
|
34
|
-
readonly revision: number;
|
|
35
|
-
readonly lineage: string;
|
|
36
|
-
readonly deploymentBlockNumber: number;
|
|
37
|
-
readonly settledBlockNumber: number;
|
|
38
|
-
readonly settledBlockHash: string;
|
|
39
|
-
readonly head: SqliteChainEventLogHead;
|
|
40
|
-
readonly topicSetVersion: string;
|
|
41
|
-
}
|
|
42
|
-
export interface SqliteChainEventLogCoverage {
|
|
43
|
-
readonly family: string;
|
|
44
|
-
readonly address: string;
|
|
45
|
-
readonly coveredFromBlock: number;
|
|
46
|
-
readonly coveredThroughBlock: number;
|
|
47
|
-
readonly floorBlock: number;
|
|
48
|
-
}
|
|
49
|
-
export interface SqliteChainEventLogState {
|
|
50
|
-
readonly cursor: SqliteChainEventLogCursor;
|
|
51
|
-
readonly coverage: readonly SqliteChainEventLogCoverage[];
|
|
52
|
-
readonly suspectedForkBlockNumber?: number;
|
|
53
|
-
}
|
|
54
|
-
export interface SqliteChainEventLogBlockRange {
|
|
55
|
-
readonly fromBlockNumber: number;
|
|
56
|
-
readonly throughBlockNumber: number;
|
|
57
|
-
}
|
|
58
|
-
export interface SqliteChainEventLogCommit {
|
|
59
|
-
readonly cursor: Omit<SqliteChainEventLogCursor, 'revision'>;
|
|
60
|
-
readonly rows: readonly SqliteChainEventLogRow[];
|
|
61
|
-
/** Blocks this commit re-fetched; the only tail it may replace. */
|
|
62
|
-
readonly replacedRange?: SqliteChainEventLogBlockRange;
|
|
63
|
-
readonly coverage: readonly SqliteChainEventLogCoverage[];
|
|
64
|
-
readonly suspectedForkBlockNumber?: number;
|
|
65
|
-
readonly clearsForkSuspicion?: boolean;
|
|
66
|
-
}
|
|
67
|
-
export interface SqliteChainEventLogQuery {
|
|
68
|
-
readonly fromBlockNumber: number;
|
|
69
|
-
readonly throughBlockNumber: number;
|
|
70
|
-
readonly addresses?: readonly string[];
|
|
71
|
-
readonly topic0?: readonly string[];
|
|
72
|
-
readonly topic1?: readonly string[];
|
|
73
|
-
readonly topic2?: readonly string[];
|
|
74
|
-
}
|
|
75
|
-
/** A query counted instead of read, optionally only settled or only tail rows. */
|
|
76
|
-
export interface SqliteChainEventLogCountQuery extends SqliteChainEventLogQuery {
|
|
77
|
-
readonly settled?: boolean;
|
|
78
|
-
}
|
|
79
|
-
export declare class SqliteChainEventLogStore {
|
|
80
|
-
private readonly db;
|
|
81
|
-
/**
|
|
82
|
-
* The pinnable indexes that exist. `INDEXED BY` turns a missing index into a
|
|
83
|
-
* query ERROR, not a slower plan. `DashboardDB` creates them on every open it
|
|
84
|
-
* migrates (the KA index best-effort), but a database written by a NEWER
|
|
85
|
-
* schema is opened without migrating at all, so a hint is only used once its
|
|
86
|
-
* index is known to be there.
|
|
87
|
-
*/
|
|
88
|
-
private readonly indexes;
|
|
89
|
-
constructor(dashboard: DashboardDB);
|
|
90
|
-
/**
|
|
91
|
-
* The WHERE clause, its parameters and the index to pin for one filter.
|
|
92
|
-
*
|
|
93
|
-
* Hints are chosen for the exact shapes that have a better index than the
|
|
94
|
-
* block range, and only then:
|
|
95
|
-
* - the KA point read (four equalities on the KA index);
|
|
96
|
-
* - one graph's rows (the per-graph ordinal reads and counts): address,
|
|
97
|
-
* topic0 and topic1 equalities on the topic index, index-only for a count;
|
|
98
|
-
* - a count of tail rows, walked from the unsettled index.
|
|
99
|
-
*/
|
|
100
|
-
private where;
|
|
101
|
-
load(scope: string): Promise<SqliteChainEventLogState | undefined>;
|
|
102
|
-
commit(scope: string, expectedRevision: number | undefined, commit: SqliteChainEventLogCommit): Promise<number | undefined>;
|
|
103
|
-
tombstone(scope: string, expectedRevision: number): Promise<number | undefined>;
|
|
104
|
-
readEvents(scope: string, query: SqliteChainEventLogQuery): Promise<readonly SqliteChainEventLogRow[]>;
|
|
105
|
-
/**
|
|
106
|
-
* `COUNT(*)` of exactly what {@link readEvents} returns for `query`, narrowed
|
|
107
|
-
* by `settled` when given, without building a row. For one graph's rows the
|
|
108
|
-
* count is index-only (~2 ms over 30k registrations); for tail rows it walks
|
|
109
|
-
* the unsettled index, i.e. the reorg tail.
|
|
110
|
-
*/
|
|
111
|
-
countEvents(scope: string, query: SqliteChainEventLogCountQuery): Promise<number>;
|
|
112
|
-
blockHashAt(scope: string, blockNumber: number): Promise<string | undefined>;
|
|
113
|
-
private writeCursor;
|
|
114
|
-
}
|
|
11
|
+
export { SqliteChainEventLogStore } from '@origintrail-official/dkg-node-store';
|
|
12
|
+
export type { SqliteChainEventLogBlockRange, SqliteChainEventLogCommit, SqliteChainEventLogCountQuery, SqliteChainEventLogCoverage, SqliteChainEventLogCursor, SqliteChainEventLogHead, SqliteChainEventLogQuery, SqliteChainEventLogRow, SqliteChainEventLogState, } from '@origintrail-official/dkg-node-store';
|
|
115
13
|
//# sourceMappingURL=chain-event-log-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-event-log-store.d.ts","sourceRoot":"","sources":["../src/chain-event-log-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chain-event-log-store.d.ts","sourceRoot":"","sources":["../src/chain-event-log-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,YAAY,EACV,6BAA6B,EAC7B,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,sCAAsC,CAAC"}
|