@xyo-network/xl1-protocol-sdk 1.26.43 → 1.26.46
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/neutral/CreatableProvider/AbstractCreatableProvider.d.ts +1 -1
- package/dist/neutral/block/hydrate/BoundWitnessHydrator.d.ts +57 -0
- package/dist/neutral/block/hydrate/BoundWitnessHydrator.d.ts.map +1 -0
- package/dist/neutral/block/hydrate/createBlockHydrator.d.ts +6 -0
- package/dist/neutral/block/hydrate/createBlockHydrator.d.ts.map +1 -0
- package/dist/neutral/block/hydrate/createBoundWitnessHydrator.d.ts +169 -0
- package/dist/neutral/block/hydrate/createBoundWitnessHydrator.d.ts.map +1 -0
- package/dist/neutral/block/hydrate/createTransactionHydrator.d.ts +6 -0
- package/dist/neutral/block/hydrate/createTransactionHydrator.d.ts.map +1 -0
- package/dist/neutral/block/hydrate/index.d.ts +4 -0
- package/dist/neutral/block/hydrate/index.d.ts.map +1 -1
- package/dist/neutral/config/Actor.d.ts +6 -6
- package/dist/neutral/config/Actor.d.ts.map +1 -1
- package/dist/neutral/config/Actors.d.ts +1 -1
- package/dist/neutral/config/Base.d.ts +1 -1
- package/dist/neutral/config/Config.d.ts +50 -48
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/HostActor.d.ts +6 -6
- package/dist/neutral/config/Log.d.ts +1 -1
- package/dist/neutral/context/Actor.d.ts +6 -6
- package/dist/neutral/context/HostActor.d.ts +6 -6
- package/dist/neutral/getFileConfig.d.ts +3 -2
- package/dist/neutral/getFileConfig.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.mjs +16 -3
- package/dist/neutral/getFileConfig.mjs.map +1 -1
- package/dist/neutral/index.d.ts +0 -1
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +456 -321
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts +6 -6
- package/dist/neutral/simple/mempool/SimpleMempoolRunner.d.ts +3 -1
- package/dist/neutral/simple/mempool/SimpleMempoolRunner.d.ts.map +1 -1
- package/dist/neutral/test/index.mjs +20 -7
- package/dist/neutral/test/index.mjs.map +1 -1
- package/package.json +7 -7
- package/dist/neutral/actor/ActorV3.d.ts +0 -55
- package/dist/neutral/actor/ActorV3.d.ts.map +0 -1
- package/dist/neutral/actor/index.d.ts +0 -2
- package/dist/neutral/actor/index.d.ts.map +0 -1
package/dist/neutral/index.mjs
CHANGED
|
@@ -11,137 +11,6 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
11
11
|
};
|
|
12
12
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
13
13
|
|
|
14
|
-
// src/actor/ActorV3.ts
|
|
15
|
-
import {
|
|
16
|
-
AbstractCreatable,
|
|
17
|
-
assertEx,
|
|
18
|
-
delay,
|
|
19
|
-
IdLogger
|
|
20
|
-
} from "@xylabs/sdk-js";
|
|
21
|
-
import { Semaphore } from "async-mutex";
|
|
22
|
-
import z from "zod";
|
|
23
|
-
var CreatableNameZod = z.custom((val) => typeof val === "string" && val.length > 0);
|
|
24
|
-
var StatusReporterInstanceZod = z.custom((val) => val && typeof val === "object" && "report" in val);
|
|
25
|
-
var AccountInstanceZod = z.custom((val) => val && typeof val === "object" && "address" in val);
|
|
26
|
-
var ActorParamsV3Zod = z.object({
|
|
27
|
-
account: AccountInstanceZod,
|
|
28
|
-
locator: z.unknown(),
|
|
29
|
-
name: CreatableNameZod,
|
|
30
|
-
statusReporter: StatusReporterInstanceZod.optional()
|
|
31
|
-
});
|
|
32
|
-
var ActorV3 = class extends AbstractCreatable {
|
|
33
|
-
_intervals = /* @__PURE__ */ new Map();
|
|
34
|
-
_semaphores = /* @__PURE__ */ new Map();
|
|
35
|
-
_timeouts = /* @__PURE__ */ new Map();
|
|
36
|
-
_logger;
|
|
37
|
-
get logger() {
|
|
38
|
-
this._logger = new IdLogger(assertEx(this.context.logger, () => `Logger is required in context for actor ${this.name}.`), () => this.name);
|
|
39
|
-
return this._logger;
|
|
40
|
-
}
|
|
41
|
-
get account() {
|
|
42
|
-
return this.params.account;
|
|
43
|
-
}
|
|
44
|
-
get context() {
|
|
45
|
-
return this.locator.context;
|
|
46
|
-
}
|
|
47
|
-
get locator() {
|
|
48
|
-
return this.params.locator;
|
|
49
|
-
}
|
|
50
|
-
static async paramsHandler(params) {
|
|
51
|
-
const baseParams = await super.paramsHandler({ ...params, name: params.name ?? "UnknownActor" });
|
|
52
|
-
const account = assertEx(params.account, () => `params.account is required for actor ${baseParams.name}.`);
|
|
53
|
-
const locator = assertEx(params.locator, () => `params.locator is required for actor ${baseParams.name}.`);
|
|
54
|
-
return {
|
|
55
|
-
...baseParams,
|
|
56
|
-
account,
|
|
57
|
-
locator
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* The timer runs until the actor is deactivated (or you manually stop it).
|
|
62
|
-
*/
|
|
63
|
-
registerTimer(timerName, callback, dueTimeMs, periodMs) {
|
|
64
|
-
if (this.status !== "starting") {
|
|
65
|
-
this.logger?.warn(
|
|
66
|
-
`Cannot register timer '${timerName}' because actor is not starting.`
|
|
67
|
-
);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
let running = false;
|
|
71
|
-
this._semaphores.set(timerName, new Semaphore(1));
|
|
72
|
-
const timeoutId = setTimeout(() => {
|
|
73
|
-
const intervalId = setInterval(() => {
|
|
74
|
-
const semaphore = this._semaphores.get(timerName);
|
|
75
|
-
if (this.status !== "started" || !this._intervals.has(timerName) || !semaphore || running) return;
|
|
76
|
-
if (semaphore.isLocked()) {
|
|
77
|
-
this.logger?.warn(
|
|
78
|
-
`Skipping timer '${this.name}:${timerName}' execution because previous execution is still running.`
|
|
79
|
-
);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
semaphore.acquire().then(([, release]) => {
|
|
83
|
-
const startTime = Date.now();
|
|
84
|
-
running = true;
|
|
85
|
-
callback().then(() => {
|
|
86
|
-
const duration = Date.now() - startTime;
|
|
87
|
-
if (duration > periodMs) {
|
|
88
|
-
this.logger?.warn(
|
|
89
|
-
`Timer '${this.name}:${timerName}' execution took longer (${duration}ms) than the period (${periodMs}ms).`
|
|
90
|
-
);
|
|
91
|
-
} else if (duration > 5e3) {
|
|
92
|
-
this.logger?.warn(
|
|
93
|
-
`Timer '${this.name}:${timerName}' execution took longer (${duration}ms) than 5000ms.`
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
}).catch((error) => {
|
|
97
|
-
this.logger?.error(`Error in timer '${this.name}:${timerName}': ${error}`);
|
|
98
|
-
this.logger?.error(error.stack);
|
|
99
|
-
}).finally(() => {
|
|
100
|
-
release();
|
|
101
|
-
running = false;
|
|
102
|
-
});
|
|
103
|
-
}).catch((error) => {
|
|
104
|
-
this.logger?.error(`Error acquiring semaphore for timer '${this.name}:${timerName}': ${error}`);
|
|
105
|
-
});
|
|
106
|
-
}, periodMs);
|
|
107
|
-
this._intervals.set(timerName, intervalId);
|
|
108
|
-
}, dueTimeMs);
|
|
109
|
-
this._timeouts.set(timerName, timeoutId);
|
|
110
|
-
this.logger?.debug(
|
|
111
|
-
`Timer '${this.name}:${timerName}' registered: first call after ${dueTimeMs}ms, recurring every ${periodMs}ms.`
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Called by the Orchestrator when the actor is deactivated.
|
|
116
|
-
* Stop all running timers.
|
|
117
|
-
*/
|
|
118
|
-
async stopHandler() {
|
|
119
|
-
await super.stopHandler();
|
|
120
|
-
this.logger?.debug("Stopping all timers...");
|
|
121
|
-
await Promise.all(
|
|
122
|
-
[...this._semaphores.values()].map(async (semaphore) => {
|
|
123
|
-
while (semaphore.isLocked()) {
|
|
124
|
-
this.logger?.debug("Waiting for running timer task to complete...");
|
|
125
|
-
await delay(500);
|
|
126
|
-
}
|
|
127
|
-
await semaphore.acquire();
|
|
128
|
-
})
|
|
129
|
-
);
|
|
130
|
-
this._semaphores.clear();
|
|
131
|
-
for (const [, timeoutRef] of this._timeouts.entries()) {
|
|
132
|
-
clearTimeout(timeoutRef);
|
|
133
|
-
}
|
|
134
|
-
this._timeouts.clear();
|
|
135
|
-
for (const [, intervalRef] of this._intervals.entries()) {
|
|
136
|
-
clearInterval(intervalRef);
|
|
137
|
-
}
|
|
138
|
-
this._intervals.clear();
|
|
139
|
-
this.logger?.debug("Stopped.");
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
var Actor = class extends ActorV3 {
|
|
143
|
-
};
|
|
144
|
-
|
|
145
14
|
// src/amount/splitOnDecimal.ts
|
|
146
15
|
var splitOnDecimal = (value, places = 18) => {
|
|
147
16
|
const whole = value / BigInt(10 ** places);
|
|
@@ -230,7 +99,7 @@ var ShiftedBigInt = class _ShiftedBigInt {
|
|
|
230
99
|
};
|
|
231
100
|
|
|
232
101
|
// src/amount/XL1Amount.ts
|
|
233
|
-
import { assertEx
|
|
102
|
+
import { assertEx } from "@xylabs/sdk-js";
|
|
234
103
|
import {
|
|
235
104
|
AttoXL1,
|
|
236
105
|
FemtoXL1,
|
|
@@ -251,7 +120,7 @@ var XL1Amount = class _XL1Amount {
|
|
|
251
120
|
this.value = AttoXL1(value > MAX_XL1_AMOUNT ? MAX_XL1_AMOUNT : value < 0n ? 0n : value);
|
|
252
121
|
}
|
|
253
122
|
static from(value, places = XL1Places.atto) {
|
|
254
|
-
|
|
123
|
+
assertEx(allowedPlaces.includes(places), () => `Invalid conversion places (${places} not in ${allowedPlaces.join(", ")})`);
|
|
255
124
|
return new _XL1Amount(value * 10n ** BigInt(places));
|
|
256
125
|
}
|
|
257
126
|
static fromMilli(value) {
|
|
@@ -300,7 +169,7 @@ var XL1Amount = class _XL1Amount {
|
|
|
300
169
|
return XL1(this.to(XL1Places.xl1));
|
|
301
170
|
}
|
|
302
171
|
toString(places = Number(XL1Places.atto), config = {}) {
|
|
303
|
-
|
|
172
|
+
assertEx(allowedPlaces.includes(BigInt(places)), () => `Invalid conversion places (${places} not in ${allowedPlaces.join(", ")})`);
|
|
304
173
|
return new ShiftedBigInt(
|
|
305
174
|
this.value,
|
|
306
175
|
{
|
|
@@ -322,15 +191,243 @@ function allHashesPresent(hashes, payloads) {
|
|
|
322
191
|
}
|
|
323
192
|
|
|
324
193
|
// src/block/hydrate/blockPayloadsFromHydratedBlock.ts
|
|
325
|
-
import { assertEx as
|
|
194
|
+
import { assertEx as assertEx2 } from "@xylabs/sdk-js";
|
|
326
195
|
import { isTransactionBoundWitness } from "@xyo-network/xl1-protocol-lib";
|
|
327
196
|
var blockPayloadsFromHydratedBlock = (block) => {
|
|
328
|
-
return block[0].payload_hashes.map((hash) =>
|
|
197
|
+
return block[0].payload_hashes.map((hash) => assertEx2(
|
|
329
198
|
block[1].find((p) => p._hash === hash),
|
|
330
199
|
() => `missing payload ${hash}`
|
|
331
200
|
)).filter((x) => !isTransactionBoundWitness(x));
|
|
332
201
|
};
|
|
333
202
|
|
|
203
|
+
// src/block/hydrate/BoundWitnessHydrator.ts
|
|
204
|
+
import { assertEx as assertEx3 } from "@xylabs/sdk-js";
|
|
205
|
+
import {
|
|
206
|
+
isAnyPayload,
|
|
207
|
+
isBoundWitness,
|
|
208
|
+
PayloadBuilder
|
|
209
|
+
} from "@xyo-network/sdk-js";
|
|
210
|
+
import { LRUCache } from "lru-cache";
|
|
211
|
+
var DEFAULT_CACHE_MAX = 5e3;
|
|
212
|
+
var DEFAULT_CACHE_TTL = Number.MAX_SAFE_INTEGER;
|
|
213
|
+
var BoundWitnessHydrator = class {
|
|
214
|
+
asBoundWitness;
|
|
215
|
+
asHydrated;
|
|
216
|
+
datalakes;
|
|
217
|
+
isNestedBoundWitness;
|
|
218
|
+
payloadCache;
|
|
219
|
+
sourceCache;
|
|
220
|
+
/**
|
|
221
|
+
* @throws if `params.datalakes` is empty. Required at construction to fail fast on misconfig.
|
|
222
|
+
* The only zero-datalake hydrate calls that would succeed anyway are degenerate (maxDepth=0
|
|
223
|
+
* or a BW with empty payload_hashes) — not load-bearing enough to justify loosening the guard.
|
|
224
|
+
* If lifecycle ordering ever requires construction before sources are wired, prefer adding
|
|
225
|
+
* an `addDatalake()` mutator over removing this assertion.
|
|
226
|
+
*/
|
|
227
|
+
constructor(params) {
|
|
228
|
+
assertEx3(params.datalakes.length > 0, () => "BoundWitnessHydrator requires at least one datalake");
|
|
229
|
+
const seen = /* @__PURE__ */ new Set();
|
|
230
|
+
for (const dl of params.datalakes) {
|
|
231
|
+
assertEx3(!seen.has(dl.name), () => `Duplicate datalake name: ${dl.name}`);
|
|
232
|
+
seen.add(dl.name);
|
|
233
|
+
}
|
|
234
|
+
this.datalakes = params.datalakes;
|
|
235
|
+
this.asBoundWitness = params.asBoundWitness;
|
|
236
|
+
this.asHydrated = params.asHydrated;
|
|
237
|
+
this.isNestedBoundWitness = params.isNestedBoundWitness ?? isBoundWitness;
|
|
238
|
+
const max = params.cacheMax ?? DEFAULT_CACHE_MAX;
|
|
239
|
+
const ttl = params.cacheTtl ?? DEFAULT_CACHE_TTL;
|
|
240
|
+
this.payloadCache = new LRUCache({ max, ttl });
|
|
241
|
+
this.sourceCache = new LRUCache({ max, ttl });
|
|
242
|
+
}
|
|
243
|
+
async hydrate(input, maxDepth = 1, minDepth = maxDepth) {
|
|
244
|
+
const [hydrated] = await this.hydrateInternal(input, maxDepth, minDepth);
|
|
245
|
+
return hydrated;
|
|
246
|
+
}
|
|
247
|
+
async hydrateWithProvenance(input, maxDepth = 1, minDepth = maxDepth) {
|
|
248
|
+
return await this.hydrateInternal(input, maxDepth, minDepth);
|
|
249
|
+
}
|
|
250
|
+
/** Returns an adapter compatible with HydratedCache. The context arg is ignored. */
|
|
251
|
+
toHydrateFunction() {
|
|
252
|
+
return async (_context, hash) => await this.tryHydrate(hash);
|
|
253
|
+
}
|
|
254
|
+
async tryHydrate(input, maxDepth = 1) {
|
|
255
|
+
try {
|
|
256
|
+
return await this.hydrate(input, maxDepth);
|
|
257
|
+
} catch {
|
|
258
|
+
return void 0;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
async tryHydrateWithProvenance(input, maxDepth = 1) {
|
|
262
|
+
try {
|
|
263
|
+
return await this.hydrateWithProvenance(input, maxDepth);
|
|
264
|
+
} catch {
|
|
265
|
+
return void 0;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
async appendDirectPayloads(bw, sources, minDepth, orderedHashes, orderedPayloads) {
|
|
269
|
+
const fetched = await this.fetchByHashes(bw.payload_hashes, sources);
|
|
270
|
+
if (minDepth >= 1) {
|
|
271
|
+
const missing = bw.payload_hashes.filter((h) => !fetched.has(h));
|
|
272
|
+
assertEx3(missing.length === 0, () => `Unable to find all payloads for BoundWitness: missing ${missing.join(", ")}`);
|
|
273
|
+
}
|
|
274
|
+
for (const h of bw.payload_hashes) {
|
|
275
|
+
const p = fetched.get(h);
|
|
276
|
+
if (p === void 0 || orderedHashes.has(h)) continue;
|
|
277
|
+
orderedHashes.add(h);
|
|
278
|
+
orderedPayloads.push(p);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
async appendNestedPayloads(sources, minDepth, orderedHashes, orderedPayloads) {
|
|
282
|
+
const nestedHashes = [];
|
|
283
|
+
for (const p of orderedPayloads) {
|
|
284
|
+
if (!this.isNestedBoundWitness(p)) continue;
|
|
285
|
+
for (const h of p.payload_hashes) {
|
|
286
|
+
if (!orderedHashes.has(h)) nestedHashes.push(h);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
const fetched = await this.fetchByHashes(nestedHashes, sources);
|
|
290
|
+
if (minDepth >= 2) {
|
|
291
|
+
const missing = nestedHashes.filter((h) => !fetched.has(h));
|
|
292
|
+
assertEx3(missing.length === 0, () => `Unable to find all nested payloads for BoundWitness: missing ${missing.join(", ")}`);
|
|
293
|
+
}
|
|
294
|
+
for (const h of nestedHashes) {
|
|
295
|
+
const p = fetched.get(h);
|
|
296
|
+
if (p === void 0 || orderedHashes.has(h)) continue;
|
|
297
|
+
orderedHashes.add(h);
|
|
298
|
+
orderedPayloads.push(p);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
async fetchByHash(hash, sources) {
|
|
302
|
+
const cached = this.payloadCache.get(hash);
|
|
303
|
+
if (cached !== void 0) {
|
|
304
|
+
const cachedSource = this.sourceCache.get(hash);
|
|
305
|
+
if (cachedSource !== void 0) sources.set(hash, cachedSource);
|
|
306
|
+
return cached;
|
|
307
|
+
}
|
|
308
|
+
for (const dl of this.datalakes) {
|
|
309
|
+
const results = await dl.viewer.get([hash]);
|
|
310
|
+
for (const data of results) {
|
|
311
|
+
if (!isAnyPayload(data)) continue;
|
|
312
|
+
this.payloadCache.set(hash, data);
|
|
313
|
+
this.sourceCache.set(hash, dl.name);
|
|
314
|
+
sources.set(hash, dl.name);
|
|
315
|
+
return data;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return void 0;
|
|
319
|
+
}
|
|
320
|
+
async fetchByHashes(hashes, sources) {
|
|
321
|
+
const result = /* @__PURE__ */ new Map();
|
|
322
|
+
const remaining = /* @__PURE__ */ new Set();
|
|
323
|
+
for (const h of hashes) {
|
|
324
|
+
const cached = this.payloadCache.get(h);
|
|
325
|
+
if (cached === void 0) {
|
|
326
|
+
remaining.add(h);
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
result.set(h, cached);
|
|
330
|
+
const cachedSource = this.sourceCache.get(h);
|
|
331
|
+
if (cachedSource !== void 0) sources.set(h, cachedSource);
|
|
332
|
+
}
|
|
333
|
+
for (const dl of this.datalakes) {
|
|
334
|
+
if (remaining.size === 0) break;
|
|
335
|
+
const needHashes = [...remaining];
|
|
336
|
+
const fetched = await Promise.all(needHashes.map(async (h) => {
|
|
337
|
+
const arr = await dl.viewer.get([h]);
|
|
338
|
+
for (const item of arr) {
|
|
339
|
+
if (isAnyPayload(item)) return item;
|
|
340
|
+
}
|
|
341
|
+
return void 0;
|
|
342
|
+
}));
|
|
343
|
+
for (const [i, h] of needHashes.entries()) {
|
|
344
|
+
const p = fetched[i];
|
|
345
|
+
if (p === void 0) continue;
|
|
346
|
+
result.set(h, p);
|
|
347
|
+
this.payloadCache.set(h, p);
|
|
348
|
+
this.sourceCache.set(h, dl.name);
|
|
349
|
+
sources.set(h, dl.name);
|
|
350
|
+
remaining.delete(h);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return result;
|
|
354
|
+
}
|
|
355
|
+
async hydrateInternal(input, maxDepth, minDepth) {
|
|
356
|
+
assertEx3(maxDepth >= 0 && maxDepth <= 2, () => `maxDepth must be 0, 1, or 2 (got ${maxDepth})`);
|
|
357
|
+
assertEx3(minDepth >= 0 && minDepth <= 2, () => `minDepth must be 0, 1, or 2 (got ${minDepth})`);
|
|
358
|
+
assertEx3(maxDepth >= minDepth, () => `maxDepth (${maxDepth}) must be >= minDepth (${minDepth})`);
|
|
359
|
+
const sources = /* @__PURE__ */ new Map();
|
|
360
|
+
const bw = await this.resolveBoundWitness(input, sources);
|
|
361
|
+
if (maxDepth === 0) {
|
|
362
|
+
return [this.asHydrated([bw, []], true), sources];
|
|
363
|
+
}
|
|
364
|
+
const orderedHashes = /* @__PURE__ */ new Set();
|
|
365
|
+
const orderedPayloads = [];
|
|
366
|
+
await this.appendDirectPayloads(bw, sources, minDepth, orderedHashes, orderedPayloads);
|
|
367
|
+
if (maxDepth === 2) {
|
|
368
|
+
await this.appendNestedPayloads(sources, minDepth, orderedHashes, orderedPayloads);
|
|
369
|
+
}
|
|
370
|
+
return [this.asHydrated([bw, orderedPayloads], true), sources];
|
|
371
|
+
}
|
|
372
|
+
async resolveBoundWitness(input, sources) {
|
|
373
|
+
if (typeof input === "string") {
|
|
374
|
+
const fetched = assertEx3(
|
|
375
|
+
await this.fetchByHash(input, sources),
|
|
376
|
+
() => `BoundWitness ${input} not found in any datalake`
|
|
377
|
+
);
|
|
378
|
+
return this.asBoundWitness(fetched, true);
|
|
379
|
+
}
|
|
380
|
+
const withMeta = "_hash" in input ? input : await PayloadBuilder.addStorageMeta(input);
|
|
381
|
+
return this.asBoundWitness(withMeta, true);
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
// src/block/hydrate/createBlockHydrator.ts
|
|
386
|
+
import { asBlockBoundWitnessWithStorageMeta, asHydratedBlockWithStorageMeta } from "@xyo-network/xl1-protocol-lib";
|
|
387
|
+
function createBlockHydrator(params) {
|
|
388
|
+
return new BoundWitnessHydrator({
|
|
389
|
+
...params,
|
|
390
|
+
asBoundWitness: asBlockBoundWitnessWithStorageMeta,
|
|
391
|
+
asHydrated: asHydratedBlockWithStorageMeta
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// src/block/hydrate/createBoundWitnessHydrator.ts
|
|
396
|
+
import { zodAsFactory } from "@xylabs/sdk-js";
|
|
397
|
+
import {
|
|
398
|
+
BoundWitnessZod,
|
|
399
|
+
PayloadZod,
|
|
400
|
+
WithStorageMetaZod
|
|
401
|
+
} from "@xyo-network/sdk-js";
|
|
402
|
+
import { z } from "zod";
|
|
403
|
+
var BoundWitnessWithStorageMetaZod = WithStorageMetaZod(BoundWitnessZod);
|
|
404
|
+
var asBoundWitnessWithStorageMeta = zodAsFactory(BoundWitnessWithStorageMetaZod, "asBoundWitnessWithStorageMeta");
|
|
405
|
+
var HydratedBoundWitnessWithStorageMetaZod = z.tuple([
|
|
406
|
+
BoundWitnessWithStorageMetaZod,
|
|
407
|
+
z.array(WithStorageMetaZod(PayloadZod).loose())
|
|
408
|
+
]);
|
|
409
|
+
var asHydratedBoundWitnessWithStorageMeta = zodAsFactory(
|
|
410
|
+
HydratedBoundWitnessWithStorageMetaZod,
|
|
411
|
+
"asHydratedBoundWitnessWithStorageMeta"
|
|
412
|
+
);
|
|
413
|
+
function createBoundWitnessHydrator(params) {
|
|
414
|
+
return new BoundWitnessHydrator({
|
|
415
|
+
...params,
|
|
416
|
+
asBoundWitness: asBoundWitnessWithStorageMeta,
|
|
417
|
+
asHydrated: asHydratedBoundWitnessWithStorageMeta
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// src/block/hydrate/createTransactionHydrator.ts
|
|
422
|
+
import { asHydratedTransactionWithStorageMeta, asTransactionBoundWitnessWithStorageMeta } from "@xyo-network/xl1-protocol-lib";
|
|
423
|
+
function createTransactionHydrator(params) {
|
|
424
|
+
return new BoundWitnessHydrator({
|
|
425
|
+
...params,
|
|
426
|
+
asBoundWitness: asTransactionBoundWitnessWithStorageMeta,
|
|
427
|
+
asHydrated: asHydratedTransactionWithStorageMeta
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
|
|
334
431
|
// src/block/hydrate/flattenHydratedBlock.ts
|
|
335
432
|
import { toHydratedBlock } from "@xyo-network/xl1-protocol-lib";
|
|
336
433
|
var flattenHydratedBlock = (hydratedBlock) => {
|
|
@@ -350,14 +447,14 @@ var flattenHydratedBlocks = (hydratedBlocks) => hydratedBlocks.flatMap((blk) =>
|
|
|
350
447
|
// src/block/hydrate/hydrateBlock.ts
|
|
351
448
|
import { assertEx as assertEx4 } from "@xylabs/sdk-js";
|
|
352
449
|
import { asAnyPayload } from "@xyo-network/sdk-js";
|
|
353
|
-
import { asBlockBoundWitnessWithStorageMeta, isTransactionBoundWitnessWithStorageMeta } from "@xyo-network/xl1-protocol-lib";
|
|
450
|
+
import { asBlockBoundWitnessWithStorageMeta as asBlockBoundWitnessWithStorageMeta2, isTransactionBoundWitnessWithStorageMeta } from "@xyo-network/xl1-protocol-lib";
|
|
354
451
|
var hydrateBlock = async (context, hash, maxDepth = 1, minDepth = maxDepth) => {
|
|
355
452
|
assertEx4(maxDepth >= 0, () => "maxDepth must be greater than or equal to 0");
|
|
356
453
|
assertEx4(minDepth >= 0, () => "minDepth must be greater than or equal to 0");
|
|
357
454
|
assertEx4(maxDepth >= minDepth, () => "maxDepth must be greater than or equal to minDepth");
|
|
358
455
|
const { chainMap } = context;
|
|
359
456
|
const [block] = await chainMap.get([hash]);
|
|
360
|
-
const bw = assertEx4(
|
|
457
|
+
const bw = assertEx4(asBlockBoundWitnessWithStorageMeta2(
|
|
361
458
|
assertEx4(block, () => `block ${hash} not found`)
|
|
362
459
|
), () => `hash ${hash} is not a BlockBoundWitness`);
|
|
363
460
|
if (maxDepth === 0) return [bw, []];
|
|
@@ -425,11 +522,11 @@ import {
|
|
|
425
522
|
} from "@xylabs/sdk-js";
|
|
426
523
|
|
|
427
524
|
// src/driver/cache/LruCacheMap.ts
|
|
428
|
-
import { LRUCache } from "lru-cache";
|
|
525
|
+
import { LRUCache as LRUCache2 } from "lru-cache";
|
|
429
526
|
var LruCacheMap = class {
|
|
430
527
|
lruCache;
|
|
431
528
|
constructor(options) {
|
|
432
|
-
this.lruCache = new
|
|
529
|
+
this.lruCache = new LRUCache2(options ?? { max: 5e3 });
|
|
433
530
|
}
|
|
434
531
|
clear() {
|
|
435
532
|
this.lruCache.clear();
|
|
@@ -654,7 +751,7 @@ import {
|
|
|
654
751
|
toSafeJsonString as toSafeJsonString2
|
|
655
752
|
} from "@xylabs/sdk-js";
|
|
656
753
|
import {
|
|
657
|
-
PayloadBuilder
|
|
754
|
+
PayloadBuilder as PayloadBuilder2
|
|
658
755
|
} from "@xyo-network/sdk-js";
|
|
659
756
|
import { isExecutable } from "@xyo-network/xl1-protocol-lib";
|
|
660
757
|
async function validateTransactionsOpcodes(txs) {
|
|
@@ -666,7 +763,7 @@ async function validateTransactionsOpcodes(txs) {
|
|
|
666
763
|
switch (opCode) {
|
|
667
764
|
case "elevate": {
|
|
668
765
|
const [hash, ...rest] = args;
|
|
669
|
-
const txPayloadsWithStorageMeta = await
|
|
766
|
+
const txPayloadsWithStorageMeta = await PayloadBuilder2.addStorageMeta(txPayloads);
|
|
670
767
|
assertEx6(rest.length === 0, () => `Invalid elevate operation ${opCode} ${args.join(", ")} - Too many Arguments`);
|
|
671
768
|
if (isHash(hash)) {
|
|
672
769
|
assertEx6(
|
|
@@ -695,7 +792,7 @@ async function validateTransactionsOpcodes(txs) {
|
|
|
695
792
|
|
|
696
793
|
// src/config/Actor.ts
|
|
697
794
|
import {
|
|
698
|
-
zodAsFactory as
|
|
795
|
+
zodAsFactory as zodAsFactory3,
|
|
699
796
|
zodIsFactory as zodIsFactory2,
|
|
700
797
|
zodToFactory as zodToFactory2
|
|
701
798
|
} from "@xylabs/sdk-js";
|
|
@@ -819,7 +916,7 @@ import z10 from "zod";
|
|
|
819
916
|
|
|
820
917
|
// src/config/Provider.ts
|
|
821
918
|
import {
|
|
822
|
-
zodAsFactory,
|
|
919
|
+
zodAsFactory as zodAsFactory2,
|
|
823
920
|
zodIsFactory,
|
|
824
921
|
zodToFactory
|
|
825
922
|
} from "@xylabs/sdk-js";
|
|
@@ -829,7 +926,7 @@ var ProviderConfigZod = z9.object({
|
|
|
829
926
|
labels: z9.array(z9.string()).optional()
|
|
830
927
|
}).describe("Configuration for a Provider");
|
|
831
928
|
var isProviderConfig = zodIsFactory(ProviderConfigZod);
|
|
832
|
-
var asProviderConfig =
|
|
929
|
+
var asProviderConfig = zodAsFactory2(ProviderConfigZod, "asProviderConfig");
|
|
833
930
|
var toProviderConfig = zodToFactory(ProviderConfigZod, "toProviderConfig");
|
|
834
931
|
|
|
835
932
|
// src/config/Providers.ts
|
|
@@ -1463,12 +1560,12 @@ async function externalBlockRangeFromStep(context, blockViewer, stepIdentity) {
|
|
|
1463
1560
|
|
|
1464
1561
|
// src/primitives/datalake/addDataLakePayloadsToPayloads.ts
|
|
1465
1562
|
import { isUndefined as isUndefined3 } from "@xylabs/sdk-js";
|
|
1466
|
-
import { isAnyPayload, PayloadBuilder as
|
|
1563
|
+
import { isAnyPayload as isAnyPayload2, PayloadBuilder as PayloadBuilder3 } from "@xyo-network/sdk-js";
|
|
1467
1564
|
async function addDataLakePayloadsToPayloads(hashes, payloads, dataLakeViewer) {
|
|
1468
1565
|
if (isUndefined3(dataLakeViewer)) return [payloads, []];
|
|
1469
1566
|
const missingPayloadHashes = hashes.filter((hash) => !payloads.some((p) => p._hash === hash));
|
|
1470
|
-
const payloadsFromDataLake = await
|
|
1471
|
-
await
|
|
1567
|
+
const payloadsFromDataLake = await PayloadBuilder3.addHashMeta(
|
|
1568
|
+
await PayloadBuilder3.addHashMeta((await dataLakeViewer.get(missingPayloadHashes)).filter(isAnyPayload2))
|
|
1472
1569
|
);
|
|
1473
1570
|
return [[...payloads, ...payloadsFromDataLake], payloadsFromDataLake.map((p) => p._hash)];
|
|
1474
1571
|
}
|
|
@@ -1940,14 +2037,19 @@ var ActorConfigZod = BaseConfigZod.extend({
|
|
|
1940
2037
|
title: "accountPath",
|
|
1941
2038
|
type: "string"
|
|
1942
2039
|
}),
|
|
2040
|
+
/**
|
|
2041
|
+
* @deprecated Use the top-level `healthCheckPort` on `ConfigZod` instead.
|
|
2042
|
+
* The system-wide health server covers all actors in a single process; per-actor
|
|
2043
|
+
* health ports will be removed in a future major release.
|
|
2044
|
+
*/
|
|
1943
2045
|
healthCheckPort: z17.coerce.number().optional().register(globalRegistry12, {
|
|
1944
|
-
description: "
|
|
1945
|
-
title: "
|
|
2046
|
+
description: "[DEPRECATED \u2014 use top-level healthCheckPort] Per-actor health server port.",
|
|
2047
|
+
title: "actor.healthCheckPort",
|
|
1946
2048
|
type: "number"
|
|
1947
2049
|
})
|
|
1948
2050
|
});
|
|
1949
2051
|
var isActorConfig = zodIsFactory2(ActorConfigZod);
|
|
1950
|
-
var asActorConfig =
|
|
2052
|
+
var asActorConfig = zodAsFactory3(ActorConfigZod, "asActorConfig");
|
|
1951
2053
|
var toActorConfig = zodToFactory2(ActorConfigZod, "toActorConfig");
|
|
1952
2054
|
|
|
1953
2055
|
// src/config/Actors.ts
|
|
@@ -1955,7 +2057,15 @@ import z18 from "zod";
|
|
|
1955
2057
|
var ActorsConfigZod = z18.array(ActorConfigZod.loose()).describe("Actor-specific configurations that override the base configuration when the actor is running").default([]);
|
|
1956
2058
|
|
|
1957
2059
|
// src/config/Config.ts
|
|
1958
|
-
|
|
2060
|
+
import { globalRegistry as globalRegistry13, z as z19 } from "zod";
|
|
2061
|
+
var ConfigZod = BaseConfigZod.extend({
|
|
2062
|
+
actors: ActorsConfigZod,
|
|
2063
|
+
healthCheckPort: z19.coerce.number().optional().register(globalRegistry13, {
|
|
2064
|
+
description: "Port for the system-wide health, readiness, and liveness endpoints (/healthz, /livez, /readyz). Set to 0 to disable.",
|
|
2065
|
+
title: "healthCheckPort",
|
|
2066
|
+
type: "number"
|
|
2067
|
+
})
|
|
2068
|
+
}).describe("The complete configuration for the protocol, including global settings and actor-specific overrides");
|
|
1959
2069
|
function resolveConfig(config) {
|
|
1960
2070
|
const parsedConfig = ConfigZod.parse(config);
|
|
1961
2071
|
const { actors, ...rootConfig } = parsedConfig;
|
|
@@ -1967,19 +2077,19 @@ function resolveConfig(config) {
|
|
|
1967
2077
|
|
|
1968
2078
|
// src/config/HostActor.ts
|
|
1969
2079
|
import {
|
|
1970
|
-
zodAsFactory as
|
|
2080
|
+
zodAsFactory as zodAsFactory4,
|
|
1971
2081
|
zodIsFactory as zodIsFactory3,
|
|
1972
2082
|
zodToFactory as zodToFactory3
|
|
1973
2083
|
} from "@xylabs/sdk-js";
|
|
1974
|
-
import { globalRegistry as
|
|
2084
|
+
import { globalRegistry as globalRegistry14, z as z20 } from "zod";
|
|
1975
2085
|
var HostActorConfigZod = ActorConfigZod.extend({
|
|
1976
|
-
host:
|
|
2086
|
+
host: z20.string().default("localhost").register(globalRegistry14, {
|
|
1977
2087
|
default: "localhost",
|
|
1978
2088
|
description: "Host for the Actor",
|
|
1979
2089
|
title: "host",
|
|
1980
2090
|
type: "string"
|
|
1981
2091
|
}),
|
|
1982
|
-
port:
|
|
2092
|
+
port: z20.coerce.number().default(8080).register(globalRegistry14, {
|
|
1983
2093
|
default: 8080,
|
|
1984
2094
|
description: "Port for the Actor",
|
|
1985
2095
|
title: "port",
|
|
@@ -1987,34 +2097,34 @@ var HostActorConfigZod = ActorConfigZod.extend({
|
|
|
1987
2097
|
})
|
|
1988
2098
|
});
|
|
1989
2099
|
var isHostActorConfig = zodIsFactory3(HostActorConfigZod);
|
|
1990
|
-
var asHostActorConfig =
|
|
2100
|
+
var asHostActorConfig = zodAsFactory4(HostActorConfigZod, "asHostActorConfig");
|
|
1991
2101
|
var toHostActorConfig = zodToFactory3(HostActorConfigZod, "toHostActorConfig");
|
|
1992
2102
|
|
|
1993
2103
|
// src/config/UsageMeta.ts
|
|
1994
|
-
import { z as
|
|
1995
|
-
var DescriptionSchema =
|
|
1996
|
-
var TitleSchema =
|
|
1997
|
-
var JSONSchemaMetaSchema =
|
|
1998
|
-
id:
|
|
2104
|
+
import { z as z21 } from "zod";
|
|
2105
|
+
var DescriptionSchema = z21.string();
|
|
2106
|
+
var TitleSchema = z21.string();
|
|
2107
|
+
var JSONSchemaMetaSchema = z21.object({
|
|
2108
|
+
id: z21.string().optional(),
|
|
1999
2109
|
title: TitleSchema.optional(),
|
|
2000
2110
|
description: DescriptionSchema.optional(),
|
|
2001
|
-
deprecated:
|
|
2002
|
-
}).catchall(
|
|
2111
|
+
deprecated: z21.boolean().optional()
|
|
2112
|
+
}).catchall(z21.unknown());
|
|
2003
2113
|
var GlobalMetaSchema = JSONSchemaMetaSchema.extend({});
|
|
2004
|
-
var ChoicesSchema =
|
|
2114
|
+
var ChoicesSchema = z21.array(z21.union([z21.string(), z21.number(), z21.literal(true), z21.undefined()])).readonly();
|
|
2005
2115
|
var UsageMetaSchema = GlobalMetaSchema.extend({
|
|
2006
2116
|
choices: ChoicesSchema.optional(),
|
|
2007
|
-
default:
|
|
2117
|
+
default: z21.unknown().optional(),
|
|
2008
2118
|
description: DescriptionSchema,
|
|
2009
|
-
group:
|
|
2010
|
-
hidden:
|
|
2119
|
+
group: z21.string().optional(),
|
|
2120
|
+
hidden: z21.boolean().optional(),
|
|
2011
2121
|
title: TitleSchema,
|
|
2012
|
-
type:
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2122
|
+
type: z21.union([
|
|
2123
|
+
z21.literal("array"),
|
|
2124
|
+
z21.literal("count"),
|
|
2125
|
+
z21.literal("boolean"),
|
|
2126
|
+
z21.literal("number"),
|
|
2127
|
+
z21.literal("string")
|
|
2018
2128
|
])
|
|
2019
2129
|
});
|
|
2020
2130
|
function isUsageMeta(v) {
|
|
@@ -2023,42 +2133,42 @@ function isUsageMeta(v) {
|
|
|
2023
2133
|
|
|
2024
2134
|
// src/context/Actor.ts
|
|
2025
2135
|
import {
|
|
2026
|
-
zodAsFactory as
|
|
2136
|
+
zodAsFactory as zodAsFactory6,
|
|
2027
2137
|
zodIsFactory as zodIsFactory5,
|
|
2028
2138
|
zodToFactory as zodToFactory5
|
|
2029
2139
|
} from "@xylabs/sdk-js";
|
|
2030
2140
|
|
|
2031
2141
|
// src/model/CreatableProviderContext.zod.ts
|
|
2032
2142
|
import {
|
|
2033
|
-
zodAsFactory as
|
|
2143
|
+
zodAsFactory as zodAsFactory5,
|
|
2034
2144
|
zodIsFactory as zodIsFactory4,
|
|
2035
2145
|
zodToFactory as zodToFactory4
|
|
2036
2146
|
} from "@xylabs/sdk-js";
|
|
2037
2147
|
import { CachingContextZod } from "@xyo-network/xl1-protocol-lib";
|
|
2038
|
-
import { z as
|
|
2039
|
-
var RuntimeStatusMonitorZod =
|
|
2040
|
-
var ProviderFactoryLocatorZod =
|
|
2148
|
+
import { z as z22 } from "zod";
|
|
2149
|
+
var RuntimeStatusMonitorZod = z22.custom((val) => val && typeof val === "object");
|
|
2150
|
+
var ProviderFactoryLocatorZod = z22.lazy(() => z22.custom((val) => val && typeof val === "object" && "context" in val && "registry" in val));
|
|
2041
2151
|
var BaseConfigContextZod = CachingContextZod.extend({
|
|
2042
2152
|
config: BaseConfigZod.loose(),
|
|
2043
2153
|
locator: ProviderFactoryLocatorZod.optional()
|
|
2044
2154
|
});
|
|
2045
|
-
var CreatableProviderContextZod =
|
|
2046
|
-
_id:
|
|
2155
|
+
var CreatableProviderContextZod = z22.lazy(() => BaseConfigContextZod.extend({
|
|
2156
|
+
_id: z22.string().optional(),
|
|
2047
2157
|
locator: ProviderFactoryLocatorZod,
|
|
2048
2158
|
statusReporter: RuntimeStatusMonitorZod.optional()
|
|
2049
2159
|
}));
|
|
2050
2160
|
var isBaseConfigContext = zodIsFactory4(BaseConfigContextZod);
|
|
2051
|
-
var asBaseConfigContext =
|
|
2161
|
+
var asBaseConfigContext = zodAsFactory5(BaseConfigContextZod, "asBaseConfigContext");
|
|
2052
2162
|
var toBaseConfigContext = zodToFactory4(BaseConfigContextZod, "toBaseConfigContext");
|
|
2053
2163
|
var isCreatableProviderContext = zodIsFactory4(CreatableProviderContextZod);
|
|
2054
|
-
var asCreatableProviderContext =
|
|
2164
|
+
var asCreatableProviderContext = zodAsFactory5(CreatableProviderContextZod, "asCreatableProviderContext");
|
|
2055
2165
|
var toCreatableProviderContext = zodToFactory4(CreatableProviderContextZod, "toCreatableProviderContext");
|
|
2056
2166
|
|
|
2057
2167
|
// src/model/PayloadBundle/bundledPayloadToHydratedBlock.ts
|
|
2058
|
-
import { PayloadBuilder as
|
|
2168
|
+
import { PayloadBuilder as PayloadBuilder4 } from "@xyo-network/sdk-js";
|
|
2059
2169
|
import { asSignedBlockBoundWitnessWithHashMeta } from "@xyo-network/xl1-protocol-lib";
|
|
2060
2170
|
var bundledPayloadToHydratedBlock = async (payload) => {
|
|
2061
|
-
const withHashMeta = await
|
|
2171
|
+
const withHashMeta = await PayloadBuilder4.addHashMeta(payload.payloads);
|
|
2062
2172
|
const tx = asSignedBlockBoundWitnessWithHashMeta(withHashMeta.find((p) => p._hash === payload.root));
|
|
2063
2173
|
if (tx) {
|
|
2064
2174
|
return [tx, withHashMeta.filter((p) => p._hash !== payload.root)];
|
|
@@ -2066,10 +2176,10 @@ var bundledPayloadToHydratedBlock = async (payload) => {
|
|
|
2066
2176
|
};
|
|
2067
2177
|
|
|
2068
2178
|
// src/model/PayloadBundle/bundledPayloadToHydratedTransaction.ts
|
|
2069
|
-
import { PayloadBuilder as
|
|
2179
|
+
import { PayloadBuilder as PayloadBuilder5 } from "@xyo-network/sdk-js";
|
|
2070
2180
|
import { asSignedTransactionBoundWitnessWithHashMeta } from "@xyo-network/xl1-protocol-lib";
|
|
2071
2181
|
var bundledPayloadToHydratedTransaction = async (payload) => {
|
|
2072
|
-
const withHashMeta = await
|
|
2182
|
+
const withHashMeta = await PayloadBuilder5.addHashMeta(payload.payloads);
|
|
2073
2183
|
const tx = asSignedTransactionBoundWitnessWithHashMeta(withHashMeta.find((p) => p._hash === payload.root));
|
|
2074
2184
|
if (tx) {
|
|
2075
2185
|
return [tx, withHashMeta.filter((p) => p._hash !== payload.root)];
|
|
@@ -2078,26 +2188,26 @@ var bundledPayloadToHydratedTransaction = async (payload) => {
|
|
|
2078
2188
|
|
|
2079
2189
|
// src/model/PayloadBundle/hydratedBlockToPayloadBundle.ts
|
|
2080
2190
|
import { PayloadBundleSchema } from "@xyo-network/sdk-js";
|
|
2081
|
-
import { PayloadBuilder as
|
|
2191
|
+
import { PayloadBuilder as PayloadBuilder6 } from "@xyo-network/sdk-js";
|
|
2082
2192
|
var hydratedBlockToPayloadBundle = (transaction) => {
|
|
2083
2193
|
const root = transaction[0]._hash;
|
|
2084
2194
|
return bundle(root, transaction);
|
|
2085
2195
|
};
|
|
2086
2196
|
var bundle = (root, transaction) => {
|
|
2087
|
-
const payloads = flattenHydratedBlock(transaction).flatMap((p) =>
|
|
2088
|
-
return new
|
|
2197
|
+
const payloads = flattenHydratedBlock(transaction).flatMap((p) => PayloadBuilder6.omitStorageMeta(p));
|
|
2198
|
+
return new PayloadBuilder6({ schema: PayloadBundleSchema }).fields({ payloads, root }).build();
|
|
2089
2199
|
};
|
|
2090
2200
|
|
|
2091
2201
|
// src/model/PayloadBundle/hydratedTransactionToPayloadBundle.ts
|
|
2092
2202
|
import { PayloadBundleSchema as PayloadBundleSchema2 } from "@xyo-network/sdk-js";
|
|
2093
|
-
import { PayloadBuilder as
|
|
2203
|
+
import { PayloadBuilder as PayloadBuilder12 } from "@xyo-network/sdk-js";
|
|
2094
2204
|
|
|
2095
2205
|
// src/transaction/buildTransaction.ts
|
|
2096
2206
|
import { assertEx as assertEx18, toHex } from "@xylabs/sdk-js";
|
|
2097
2207
|
import {
|
|
2098
2208
|
asAnyPayload as asAnyPayload2,
|
|
2099
2209
|
BoundWitnessBuilder,
|
|
2100
|
-
PayloadBuilder as
|
|
2210
|
+
PayloadBuilder as PayloadBuilder7
|
|
2101
2211
|
} from "@xyo-network/sdk-js";
|
|
2102
2212
|
import { defaultTransactionFees } from "@xyo-network/xl1-protocol-lib";
|
|
2103
2213
|
async function buildTransaction(chain, onChainPayloads, offChainPayloads, signer, nbf, exp, from, fees = defaultTransactionFees) {
|
|
@@ -2115,7 +2225,7 @@ async function buildTransaction(chain, onChainPayloads, offChainPayloads, signer
|
|
|
2115
2225
|
nbf,
|
|
2116
2226
|
exp
|
|
2117
2227
|
};
|
|
2118
|
-
const elevatedHashes = await
|
|
2228
|
+
const elevatedHashes = await PayloadBuilder7.hashes(onChainPayloads);
|
|
2119
2229
|
const script = [];
|
|
2120
2230
|
for (const elevatedHash of elevatedHashes) {
|
|
2121
2231
|
script.push(`elevate|${elevatedHash}`);
|
|
@@ -2128,12 +2238,12 @@ async function buildTransaction(chain, onChainPayloads, offChainPayloads, signer
|
|
|
2128
2238
|
fields.script = script;
|
|
2129
2239
|
}
|
|
2130
2240
|
const [tx, txPayloads] = await new BoundWitnessBuilder().fields(fields).meta({ $signatures: [] }).payloads([...onChainPayloads, ...offChainPayloads]).signers(Array.isArray(signer) ? signer : [signer]).build();
|
|
2131
|
-
return [await
|
|
2241
|
+
return [await PayloadBuilder7.addHashMeta(tx), await PayloadBuilder7.addHashMeta(txPayloads.map((p) => asAnyPayload2(p, true)))];
|
|
2132
2242
|
}
|
|
2133
2243
|
|
|
2134
2244
|
// src/transaction/buildUnsignedTransaction.ts
|
|
2135
2245
|
import { toHex as toHex2 } from "@xylabs/sdk-js";
|
|
2136
|
-
import { BoundWitnessBuilder as BoundWitnessBuilder2, PayloadBuilder as
|
|
2246
|
+
import { BoundWitnessBuilder as BoundWitnessBuilder2, PayloadBuilder as PayloadBuilder8 } from "@xyo-network/sdk-js";
|
|
2137
2247
|
import { defaultTransactionFees as defaultTransactionFees2 } from "@xyo-network/xl1-protocol-lib";
|
|
2138
2248
|
async function buildUnsignedTransaction(chain, onChainPayloads, offChainPayloads, nbf, exp, from, fees = defaultTransactionFees2) {
|
|
2139
2249
|
const txBoundWitnessFields = {
|
|
@@ -2147,7 +2257,7 @@ async function buildUnsignedTransaction(chain, onChainPayloads, offChainPayloads
|
|
|
2147
2257
|
nbf,
|
|
2148
2258
|
exp
|
|
2149
2259
|
};
|
|
2150
|
-
const elevatedHashes = await
|
|
2260
|
+
const elevatedHashes = await PayloadBuilder8.hashes(onChainPayloads);
|
|
2151
2261
|
const script = [];
|
|
2152
2262
|
for (const elevatedHash of elevatedHashes) {
|
|
2153
2263
|
script.push(`elevate|${elevatedHash}`);
|
|
@@ -2164,7 +2274,7 @@ async function buildUnsignedTransaction(chain, onChainPayloads, offChainPayloads
|
|
|
2164
2274
|
}
|
|
2165
2275
|
|
|
2166
2276
|
// src/transaction/confirmSubmittedTransaction.ts
|
|
2167
|
-
import { delay
|
|
2277
|
+
import { delay, isDefined as isDefined14 } from "@xylabs/sdk-js";
|
|
2168
2278
|
var DEFAULT_CONFIRMATION_ATTEMPTS = 20;
|
|
2169
2279
|
var DEFAULT_DELAY_BETWEEN_ATTEMPTS = 1e3;
|
|
2170
2280
|
var confirmSubmittedTransaction = async (viewer, txHash, options) => {
|
|
@@ -2183,7 +2293,7 @@ var confirmSubmittedTransaction = async (viewer, txHash, options) => {
|
|
|
2183
2293
|
throw new Error(`Transaction ${txHash} not confirmed after ${maxAttempts} attempts`);
|
|
2184
2294
|
} else {
|
|
2185
2295
|
options?.logger?.debug(`Transaction not confirmed yet, attempt ${attempts}. Retrying...`, txHash);
|
|
2186
|
-
await
|
|
2296
|
+
await delay(attemptDelay);
|
|
2187
2297
|
}
|
|
2188
2298
|
}
|
|
2189
2299
|
}
|
|
@@ -2269,11 +2379,11 @@ var hydrateElevatedTransaction = async (context, hash) => {
|
|
|
2269
2379
|
};
|
|
2270
2380
|
|
|
2271
2381
|
// src/transaction/primitives/transactionBlockByteCount.ts
|
|
2272
|
-
import { PayloadBuilder as
|
|
2382
|
+
import { PayloadBuilder as PayloadBuilder9 } from "@xyo-network/sdk-js";
|
|
2273
2383
|
function transactionBlockByteCount([transaction, payloads]) {
|
|
2274
|
-
const cleanTransaction =
|
|
2384
|
+
const cleanTransaction = PayloadBuilder9.omitStorageMeta(transaction);
|
|
2275
2385
|
const transactionBytes = JSON.stringify(cleanTransaction).length;
|
|
2276
|
-
const cleanPayloads =
|
|
2386
|
+
const cleanPayloads = PayloadBuilder9.omitStorageMeta(payloads);
|
|
2277
2387
|
return cleanPayloads.reduce((acc, payload) => acc + JSON.stringify(payload).length, 0) + transactionBytes;
|
|
2278
2388
|
}
|
|
2279
2389
|
|
|
@@ -2322,13 +2432,13 @@ import {
|
|
|
2322
2432
|
hexFromArrayBuffer,
|
|
2323
2433
|
toArrayBuffer
|
|
2324
2434
|
} from "@xylabs/sdk-js";
|
|
2325
|
-
import { PayloadBuilder as
|
|
2435
|
+
import { PayloadBuilder as PayloadBuilder10 } from "@xyo-network/sdk-js";
|
|
2326
2436
|
async function signTransaction(tx, account) {
|
|
2327
2437
|
assertEx20(tx.from === account.address, () => "Signer address does not match transaction from address");
|
|
2328
2438
|
const unsignedTx = structuredClone(tx);
|
|
2329
2439
|
unsignedTx.addresses = [account.address];
|
|
2330
2440
|
unsignedTx.previous_hashes = [account.previousHash ?? null];
|
|
2331
|
-
const hash = await
|
|
2441
|
+
const hash = await PayloadBuilder10.dataHash(unsignedTx);
|
|
2332
2442
|
const hashBytes = toArrayBuffer(hash);
|
|
2333
2443
|
const [signature] = await account.sign(hashBytes);
|
|
2334
2444
|
const result = {
|
|
@@ -2340,7 +2450,7 @@ async function signTransaction(tx, account) {
|
|
|
2340
2450
|
|
|
2341
2451
|
// src/transaction/TransactionBuilder.ts
|
|
2342
2452
|
import { assertEx as assertEx21, Base } from "@xylabs/sdk-js";
|
|
2343
|
-
import { PayloadBuilder as
|
|
2453
|
+
import { PayloadBuilder as PayloadBuilder11 } from "@xyo-network/sdk-js";
|
|
2344
2454
|
import {
|
|
2345
2455
|
asXL1BlockNumber as asXL1BlockNumber4,
|
|
2346
2456
|
defaultTransactionFees as defaultTransactionFees3,
|
|
@@ -2438,8 +2548,8 @@ var TransactionBuilder = class extends Base {
|
|
|
2438
2548
|
return this;
|
|
2439
2549
|
}
|
|
2440
2550
|
async removeElevatedPayload(payload) {
|
|
2441
|
-
const hash = await
|
|
2442
|
-
const existingHashes = await
|
|
2551
|
+
const hash = await PayloadBuilder11.hash(payload);
|
|
2552
|
+
const existingHashes = await PayloadBuilder11.hashes(this._elevatedPayloads);
|
|
2443
2553
|
const existingPayloadIndex = existingHashes.indexOf(hash);
|
|
2444
2554
|
if (existingPayloadIndex === -1) {
|
|
2445
2555
|
throw new Error("Payload not found in the transaction");
|
|
@@ -2448,8 +2558,8 @@ var TransactionBuilder = class extends Base {
|
|
|
2448
2558
|
return this;
|
|
2449
2559
|
}
|
|
2450
2560
|
async removePayload(payload) {
|
|
2451
|
-
const hash = await
|
|
2452
|
-
const existingHashes = await
|
|
2561
|
+
const hash = await PayloadBuilder11.hash(payload);
|
|
2562
|
+
const existingHashes = await PayloadBuilder11.hashes(this._payloads);
|
|
2453
2563
|
const existingPayloadIndex = existingHashes.indexOf(hash);
|
|
2454
2564
|
if (existingPayloadIndex === -1) {
|
|
2455
2565
|
throw new Error("Payload not found in the transaction");
|
|
@@ -2481,20 +2591,20 @@ var hydratedTransactionToPayloadBundle = (transaction) => {
|
|
|
2481
2591
|
};
|
|
2482
2592
|
var bundle2 = (root, transaction) => {
|
|
2483
2593
|
const payloads = flattenHydratedTransaction(transaction);
|
|
2484
|
-
return new
|
|
2594
|
+
return new PayloadBuilder12({ schema: PayloadBundleSchema2 }).fields({ payloads, root }).build();
|
|
2485
2595
|
};
|
|
2486
2596
|
|
|
2487
2597
|
// src/context/Actor.ts
|
|
2488
2598
|
var ActorConfigContext = BaseConfigContextZod.extend({ config: ActorConfigZod });
|
|
2489
2599
|
var isActorConfigContext = zodIsFactory5(ActorConfigContext);
|
|
2490
|
-
var asActorConfigContext =
|
|
2600
|
+
var asActorConfigContext = zodAsFactory6(ActorConfigContext, "asActorConfigContext");
|
|
2491
2601
|
var toActorConfigContext = zodToFactory5(ActorConfigContext, "toActorConfigContext");
|
|
2492
2602
|
|
|
2493
2603
|
// src/CreatableProvider/AbstractCreatableProvider.ts
|
|
2494
2604
|
import {
|
|
2495
|
-
AbstractCreatable
|
|
2605
|
+
AbstractCreatable,
|
|
2496
2606
|
assertEx as assertEx23,
|
|
2497
|
-
IdLogger
|
|
2607
|
+
IdLogger
|
|
2498
2608
|
} from "@xylabs/sdk-js";
|
|
2499
2609
|
|
|
2500
2610
|
// src/CreatableProvider/ProviderFactory.ts
|
|
@@ -2582,14 +2692,14 @@ var ProviderFactory = class _ProviderFactory {
|
|
|
2582
2692
|
};
|
|
2583
2693
|
|
|
2584
2694
|
// src/CreatableProvider/AbstractCreatableProvider.ts
|
|
2585
|
-
var AbstractCreatableProvider = class extends
|
|
2695
|
+
var AbstractCreatableProvider = class extends AbstractCreatable {
|
|
2586
2696
|
dependencies = {};
|
|
2587
2697
|
_contextCache;
|
|
2588
2698
|
_logger;
|
|
2589
2699
|
get logger() {
|
|
2590
2700
|
if (this._logger === void 0) {
|
|
2591
2701
|
const providedLogger = this.params.logger ?? this.context.logger;
|
|
2592
|
-
this._logger = providedLogger ? new
|
|
2702
|
+
this._logger = providedLogger ? new IdLogger(providedLogger, () => `${this.moniker} [${this.constructor.name}]`) : null;
|
|
2593
2703
|
}
|
|
2594
2704
|
return this._logger ?? void 0;
|
|
2595
2705
|
}
|
|
@@ -2870,24 +2980,24 @@ function getEmptyContext(config) {
|
|
|
2870
2980
|
|
|
2871
2981
|
// src/context/HostActor.ts
|
|
2872
2982
|
import {
|
|
2873
|
-
zodAsFactory as
|
|
2983
|
+
zodAsFactory as zodAsFactory7,
|
|
2874
2984
|
zodIsFactory as zodIsFactory6,
|
|
2875
2985
|
zodToFactory as zodToFactory6
|
|
2876
2986
|
} from "@xylabs/sdk-js";
|
|
2877
2987
|
var HostActorConfigContext = BaseConfigContextZod.extend({ config: HostActorConfigZod });
|
|
2878
2988
|
var isHostActorConfigContext = zodIsFactory6(HostActorConfigContext);
|
|
2879
|
-
var asHostActorConfigContext =
|
|
2989
|
+
var asHostActorConfigContext = zodAsFactory7(HostActorConfigContext, "asHostActorConfigContext");
|
|
2880
2990
|
var toHostActorConfigContext = zodToFactory6(HostActorConfigContext, "toHostActorConfigContext");
|
|
2881
2991
|
|
|
2882
2992
|
// src/createDeclarationPayload.ts
|
|
2883
2993
|
import { isDefined as isDefined15 } from "@xylabs/sdk-js";
|
|
2884
|
-
import { PayloadBuilder as
|
|
2994
|
+
import { PayloadBuilder as PayloadBuilder13 } from "@xyo-network/sdk-js";
|
|
2885
2995
|
import {
|
|
2886
2996
|
ChainStakeIntentSchema
|
|
2887
2997
|
} from "@xyo-network/xl1-protocol-lib";
|
|
2888
2998
|
var createDeclarationIntent = (address, intent, nbf, exp) => {
|
|
2889
2999
|
const expiration = isDefined15(exp) ? exp : nbf + 1e4;
|
|
2890
|
-
const redeclarationIntent = new
|
|
3000
|
+
const redeclarationIntent = new PayloadBuilder13({ schema: ChainStakeIntentSchema }).fields({
|
|
2891
3001
|
from: address,
|
|
2892
3002
|
intent,
|
|
2893
3003
|
nbf,
|
|
@@ -2898,10 +3008,10 @@ var createDeclarationIntent = (address, intent, nbf, exp) => {
|
|
|
2898
3008
|
|
|
2899
3009
|
// src/createTransferPayload.ts
|
|
2900
3010
|
import { toHex as toHex3 } from "@xylabs/sdk-js";
|
|
2901
|
-
import { PayloadBuilder as
|
|
3011
|
+
import { PayloadBuilder as PayloadBuilder14 } from "@xyo-network/sdk-js";
|
|
2902
3012
|
import { TransferSchema } from "@xyo-network/xl1-protocol-lib";
|
|
2903
3013
|
function createTransferPayload(from, transfers, context) {
|
|
2904
|
-
return new
|
|
3014
|
+
return new PayloadBuilder14({ schema: TransferSchema }).fields({
|
|
2905
3015
|
epoch: Date.now(),
|
|
2906
3016
|
from,
|
|
2907
3017
|
transfers: Object.fromEntries(Object.entries(transfers).map(([k, v]) => [k, toHex3(v)])),
|
|
@@ -2915,26 +3025,26 @@ import {
|
|
|
2915
3025
|
asSchema as asSchema2,
|
|
2916
3026
|
isPayloadOfZodType
|
|
2917
3027
|
} from "@xyo-network/sdk-js";
|
|
2918
|
-
import { z as
|
|
3028
|
+
import { z as z24 } from "zod";
|
|
2919
3029
|
|
|
2920
3030
|
// src/eip-712/Types.ts
|
|
2921
|
-
import { z as
|
|
2922
|
-
var TypedDataDomainZod =
|
|
2923
|
-
name:
|
|
2924
|
-
version:
|
|
2925
|
-
chainId:
|
|
2926
|
-
verifyingContract:
|
|
2927
|
-
salt:
|
|
3031
|
+
import { z as z23 } from "zod";
|
|
3032
|
+
var TypedDataDomainZod = z23.object({
|
|
3033
|
+
name: z23.string().nullable().optional(),
|
|
3034
|
+
version: z23.string().nullable().optional(),
|
|
3035
|
+
chainId: z23.union([z23.string(), z23.number(), z23.bigint()]).nullable().optional(),
|
|
3036
|
+
verifyingContract: z23.string().nullable().optional(),
|
|
3037
|
+
salt: z23.union([z23.string(), z23.instanceof(Uint8Array)]).nullable().optional()
|
|
2928
3038
|
});
|
|
2929
|
-
var TypedDataFieldZod =
|
|
2930
|
-
name:
|
|
2931
|
-
type:
|
|
3039
|
+
var TypedDataFieldZod = z23.object({
|
|
3040
|
+
name: z23.string(),
|
|
3041
|
+
type: z23.string()
|
|
2932
3042
|
});
|
|
2933
|
-
var TypedDataTypesZod =
|
|
2934
|
-
var TypedDataValueZod =
|
|
3043
|
+
var TypedDataTypesZod = z23.record(z23.string(), z23.array(TypedDataFieldZod));
|
|
3044
|
+
var TypedDataValueZod = z23.record(z23.string(), z23.any());
|
|
2935
3045
|
|
|
2936
3046
|
// src/eip-712/Payloads/EIP712Data.ts
|
|
2937
|
-
var EIP712DataPayloadFieldsZod =
|
|
3047
|
+
var EIP712DataPayloadFieldsZod = z24.object({
|
|
2938
3048
|
domain: TypedDataDomainZod,
|
|
2939
3049
|
types: TypedDataTypesZod,
|
|
2940
3050
|
values: TypedDataValueZod
|
|
@@ -2952,11 +3062,11 @@ import {
|
|
|
2952
3062
|
asSchema as asSchema3,
|
|
2953
3063
|
isPayloadOfZodType as isPayloadOfZodType2
|
|
2954
3064
|
} from "@xyo-network/sdk-js";
|
|
2955
|
-
import { z as
|
|
2956
|
-
var EIP712SignaturePayloadFieldsZod =
|
|
2957
|
-
address:
|
|
3065
|
+
import { z as z25 } from "zod";
|
|
3066
|
+
var EIP712SignaturePayloadFieldsZod = z25.object({
|
|
3067
|
+
address: z25.string(),
|
|
2958
3068
|
hash: HashZod,
|
|
2959
|
-
signature:
|
|
3069
|
+
signature: z25.string()
|
|
2960
3070
|
});
|
|
2961
3071
|
var EIP712SignaturePayloadSchema = asSchema3("network.xyo.chains.ethereum.eip712.signature", true);
|
|
2962
3072
|
var isEIP712SignaturePayload = isPayloadOfZodType2(
|
|
@@ -2966,7 +3076,7 @@ var isEIP712SignaturePayload = isPayloadOfZodType2(
|
|
|
2966
3076
|
var asEIP712SignaturePayload = AsObjectFactory3.create(isEIP712SignaturePayload);
|
|
2967
3077
|
|
|
2968
3078
|
// src/eip-712/sign.ts
|
|
2969
|
-
import { PayloadBuilder as
|
|
3079
|
+
import { PayloadBuilder as PayloadBuilder15 } from "@xyo-network/sdk-js";
|
|
2970
3080
|
var signEIP712Message = async (signer, data) => {
|
|
2971
3081
|
const {
|
|
2972
3082
|
domain,
|
|
@@ -2974,7 +3084,7 @@ var signEIP712Message = async (signer, data) => {
|
|
|
2974
3084
|
values
|
|
2975
3085
|
} = data;
|
|
2976
3086
|
const signature = await signer.signTypedData(domain, types, values);
|
|
2977
|
-
const hash = await
|
|
3087
|
+
const hash = await PayloadBuilder15.hash(data);
|
|
2978
3088
|
const address = await signer.getAddress();
|
|
2979
3089
|
return {
|
|
2980
3090
|
address,
|
|
@@ -2986,7 +3096,7 @@ var signEIP712Message = async (signer, data) => {
|
|
|
2986
3096
|
|
|
2987
3097
|
// src/eip-712/verify.ts
|
|
2988
3098
|
import { asHash as asHash3, isUndefined as isUndefined5 } from "@xylabs/sdk-js";
|
|
2989
|
-
import { PayloadBuilder as
|
|
3099
|
+
import { PayloadBuilder as PayloadBuilder16 } from "@xyo-network/sdk-js";
|
|
2990
3100
|
import { verifyTypedData } from "ethers";
|
|
2991
3101
|
var verifyEIP712Message = async (data, sig) => {
|
|
2992
3102
|
const {
|
|
@@ -2996,7 +3106,7 @@ var verifyEIP712Message = async (data, sig) => {
|
|
|
2996
3106
|
} = sig;
|
|
2997
3107
|
const { schema, ...fields } = data;
|
|
2998
3108
|
const signedHash = asHash3(hash);
|
|
2999
|
-
if (isUndefined5(signedHash) || signedHash !== await
|
|
3109
|
+
if (isUndefined5(signedHash) || signedHash !== await PayloadBuilder16.hash(data)) return false;
|
|
3000
3110
|
const recoveredAddress = verifyTypedData(fields.domain, fields.types, fields.values, signature);
|
|
3001
3111
|
return recoveredAddress.toLowerCase() === address.toLowerCase();
|
|
3002
3112
|
};
|
|
@@ -3082,7 +3192,7 @@ import {
|
|
|
3082
3192
|
StepSizes as StepSizes11,
|
|
3083
3193
|
TransferSchema as TransferSchema2
|
|
3084
3194
|
} from "@xyo-network/xl1-protocol-lib";
|
|
3085
|
-
import { Semaphore
|
|
3195
|
+
import { Semaphore } from "async-mutex";
|
|
3086
3196
|
|
|
3087
3197
|
// src/summary/model/BalancesStepSummary.ts
|
|
3088
3198
|
import { AsObjectFactory as AsObjectFactory5 } from "@xylabs/sdk-js";
|
|
@@ -3138,7 +3248,7 @@ var asTransfersStepSummaryWithStorageMeta = AsObjectFactory7.create(isTransfersS
|
|
|
3138
3248
|
// src/summary/primitives/balances/balancesStepSummaryFromRange.ts
|
|
3139
3249
|
import { spanRootAsync as spanRootAsync2 } from "@xylabs/sdk-js";
|
|
3140
3250
|
import { assertEx as assertEx25 } from "@xylabs/sdk-js";
|
|
3141
|
-
import { isAnyPayload as
|
|
3251
|
+
import { isAnyPayload as isAnyPayload3 } from "@xyo-network/sdk-js";
|
|
3142
3252
|
import { asXL1BlockNumber as asXL1BlockNumber5, StepSizes as StepSizes8 } from "@xyo-network/xl1-protocol-lib";
|
|
3143
3253
|
async function balancesStepSummaryFromRange(context, semaphores, blockViewer, summaryMap, range) {
|
|
3144
3254
|
const cacheKey = `${range[0]}|${range[1]}`;
|
|
@@ -3163,7 +3273,7 @@ async function balancesStepSummaryFromRange(context, semaphores, blockViewer, su
|
|
|
3163
3273
|
const step = StepSizes8.indexOf(asXL1BlockNumber5(frameSize, true));
|
|
3164
3274
|
assertEx25(step !== -1, () => `Invalid step size: ${frameSize}. Must be one of ${StepSizes8.join(", ")}`);
|
|
3165
3275
|
const summaryResult = await summaryMap.get(`${frameHead._hash}|${frameSize}`);
|
|
3166
|
-
if (
|
|
3276
|
+
if (isAnyPayload3(summaryResult)) {
|
|
3167
3277
|
return summaryResult;
|
|
3168
3278
|
} else {
|
|
3169
3279
|
await semaphores[step].acquire();
|
|
@@ -3206,12 +3316,12 @@ async function balancesStepSummaryFromRange(context, semaphores, blockViewer, su
|
|
|
3206
3316
|
|
|
3207
3317
|
// src/summary/primitives/balances/balancesSummary.ts
|
|
3208
3318
|
import {
|
|
3209
|
-
asAddress
|
|
3319
|
+
asAddress,
|
|
3210
3320
|
assertEx as assertEx26,
|
|
3211
3321
|
spanRootAsync as spanRootAsync3
|
|
3212
3322
|
} from "@xylabs/sdk-js";
|
|
3213
3323
|
import {
|
|
3214
|
-
asBlockBoundWitnessWithStorageMeta as
|
|
3324
|
+
asBlockBoundWitnessWithStorageMeta as asBlockBoundWitnessWithStorageMeta3,
|
|
3215
3325
|
asXL1BlockRange as asXL1BlockRange7,
|
|
3216
3326
|
isChainQualifiedHeadConfig,
|
|
3217
3327
|
isChainQualifiedRangeConfig
|
|
@@ -3220,7 +3330,7 @@ async function balancesSummary(context, semaphores, blockViewer, summaryMap, con
|
|
|
3220
3330
|
return await spanRootAsync3("balancesSummary", async () => {
|
|
3221
3331
|
const headHash = isChainQualifiedHeadConfig(config) ? config.head : await blockViewer.currentBlockHash();
|
|
3222
3332
|
const [head] = assertEx26(await blockViewer.blockByHash(headHash), () => `Block not found for hash: ${headHash}`);
|
|
3223
|
-
const headBoundWitness =
|
|
3333
|
+
const headBoundWitness = asBlockBoundWitnessWithStorageMeta3(head, () => `Found Block not a BlockWithHashMeta: ${headHash}`);
|
|
3224
3334
|
const range = isChainQualifiedRangeConfig(config) ? config.range : asXL1BlockRange7([0, headBoundWitness.block], true);
|
|
3225
3335
|
const ranges = deepCalculateFramesFromRange(asXL1BlockRange7(
|
|
3226
3336
|
range,
|
|
@@ -3230,7 +3340,7 @@ async function balancesSummary(context, semaphores, blockViewer, summaryMap, con
|
|
|
3230
3340
|
const balances = {};
|
|
3231
3341
|
for (const summary of summaries) {
|
|
3232
3342
|
for (const [address, balance] of Object.entries(summary.balances)) {
|
|
3233
|
-
const validAddress =
|
|
3343
|
+
const validAddress = asAddress(address, () => `Invalid address: ${address}`);
|
|
3234
3344
|
balances[validAddress] = (balances[validAddress] ?? 0n) + parseSignedBigInt(balance);
|
|
3235
3345
|
}
|
|
3236
3346
|
}
|
|
@@ -3241,10 +3351,10 @@ async function balancesSummary(context, semaphores, blockViewer, summaryMap, con
|
|
|
3241
3351
|
// src/summary/primitives/schemas/schemasStepSummaryFromRange.ts
|
|
3242
3352
|
import { assertEx as assertEx27 } from "@xylabs/sdk-js";
|
|
3243
3353
|
import {
|
|
3244
|
-
isAnyPayload as
|
|
3245
|
-
isBoundWitness,
|
|
3354
|
+
isAnyPayload as isAnyPayload4,
|
|
3355
|
+
isBoundWitness as isBoundWitness2,
|
|
3246
3356
|
isHashMeta,
|
|
3247
|
-
PayloadBuilder as
|
|
3357
|
+
PayloadBuilder as PayloadBuilder17
|
|
3248
3358
|
} from "@xyo-network/sdk-js";
|
|
3249
3359
|
import { StepSizes as StepSizes9 } from "@xyo-network/xl1-protocol-lib";
|
|
3250
3360
|
async function schemasStepSummaryFromRange(context, semaphores, blockViewer, summaryMap, range) {
|
|
@@ -3253,7 +3363,7 @@ async function schemasStepSummaryFromRange(context, semaphores, blockViewer, sum
|
|
|
3253
3363
|
let result;
|
|
3254
3364
|
if (frameSize === 1) {
|
|
3255
3365
|
const [block, payloads] = assertEx27(await blockViewer.blockByNumber(range[0]), () => `Block not found for number: ${range[0]}`);
|
|
3256
|
-
const boundWitnesses = [block, ...payloads.filter((x) =>
|
|
3366
|
+
const boundWitnesses = [block, ...payloads.filter((x) => isBoundWitness2(x) && isHashMeta(x))];
|
|
3257
3367
|
const schemas = {};
|
|
3258
3368
|
for (const bw of boundWitnesses) {
|
|
3259
3369
|
schemas[bw.schema] = (schemas[bw.schema] ?? 0) + 1;
|
|
@@ -3261,7 +3371,7 @@ async function schemasStepSummaryFromRange(context, semaphores, blockViewer, sum
|
|
|
3261
3371
|
schemas[schema] = (schemas[schema] ?? 0) + 1;
|
|
3262
3372
|
}
|
|
3263
3373
|
}
|
|
3264
|
-
result = await
|
|
3374
|
+
result = await PayloadBuilder17.addHashMeta({
|
|
3265
3375
|
schema: SchemasStepSummarySchema,
|
|
3266
3376
|
hash: frameHead._hash,
|
|
3267
3377
|
stepSize: -1,
|
|
@@ -3271,7 +3381,7 @@ async function schemasStepSummaryFromRange(context, semaphores, blockViewer, sum
|
|
|
3271
3381
|
const step = StepSizes9.indexOf(frameSize);
|
|
3272
3382
|
assertEx27(step !== -1, () => `Invalid step size: ${frameSize}. Must be one of ${StepSizes9.join(", ")}`);
|
|
3273
3383
|
const summaryResult = await summaryMap.get(`${frameHead._hash}|${frameSize}`);
|
|
3274
|
-
if (
|
|
3384
|
+
if (isAnyPayload4(summaryResult)) {
|
|
3275
3385
|
result = summaryResult;
|
|
3276
3386
|
} else {
|
|
3277
3387
|
await semaphores[step].acquire();
|
|
@@ -3292,7 +3402,7 @@ async function schemasStepSummaryFromRange(context, semaphores, blockViewer, sum
|
|
|
3292
3402
|
schemas[typedSchema] = (schemas[typedSchema] ?? 0) + count;
|
|
3293
3403
|
}
|
|
3294
3404
|
}
|
|
3295
|
-
result = await
|
|
3405
|
+
result = await PayloadBuilder17.addHashMeta({
|
|
3296
3406
|
schema: SchemasStepSummarySchema,
|
|
3297
3407
|
hash: frameHead._hash,
|
|
3298
3408
|
stepSize: frameSize,
|
|
@@ -3304,13 +3414,13 @@ async function schemasStepSummaryFromRange(context, semaphores, blockViewer, sum
|
|
|
3304
3414
|
}
|
|
3305
3415
|
}
|
|
3306
3416
|
}
|
|
3307
|
-
return await
|
|
3417
|
+
return await PayloadBuilder17.addHashMeta(result);
|
|
3308
3418
|
}
|
|
3309
3419
|
|
|
3310
3420
|
// src/summary/primitives/schemas/schemasSummary.ts
|
|
3311
3421
|
import { assertEx as assertEx28, spanRootAsync as spanRootAsync4 } from "@xylabs/sdk-js";
|
|
3312
3422
|
import {
|
|
3313
|
-
asBlockBoundWitnessWithStorageMeta as
|
|
3423
|
+
asBlockBoundWitnessWithStorageMeta as asBlockBoundWitnessWithStorageMeta4,
|
|
3314
3424
|
asXL1BlockRange as asXL1BlockRange8,
|
|
3315
3425
|
isChainQualifiedHeadConfig as isChainQualifiedHeadConfig2,
|
|
3316
3426
|
isChainQualifiedRangeConfig as isChainQualifiedRangeConfig2
|
|
@@ -3319,7 +3429,7 @@ async function schemasSummary(context, semaphores, blockViewer, summaryMap, conf
|
|
|
3319
3429
|
return await spanRootAsync4("schemasSummary", async () => {
|
|
3320
3430
|
const headHash = isChainQualifiedHeadConfig2(config) ? config.head : await blockViewer.currentBlockHash();
|
|
3321
3431
|
const [head] = assertEx28(await blockViewer.blockByHash(headHash), () => `Block not found for hash: ${headHash}`);
|
|
3322
|
-
const headBoundWitness =
|
|
3432
|
+
const headBoundWitness = asBlockBoundWitnessWithStorageMeta4(head, () => `Found Block not a BlockWithHashMeta: ${headHash}`);
|
|
3323
3433
|
const range = isChainQualifiedRangeConfig2(config) ? config.range : asXL1BlockRange8([0, headBoundWitness.block], true);
|
|
3324
3434
|
const ranges = deepCalculateFramesFromRange(asXL1BlockRange8(
|
|
3325
3435
|
range,
|
|
@@ -3339,7 +3449,7 @@ async function schemasSummary(context, semaphores, blockViewer, summaryMap, conf
|
|
|
3339
3449
|
|
|
3340
3450
|
// src/summary/primitives/transfers/transfersStepSummaryFromRange.ts
|
|
3341
3451
|
import { assertEx as assertEx29, spanRootAsync as spanRootAsync5 } from "@xylabs/sdk-js";
|
|
3342
|
-
import { isAnyPayload as
|
|
3452
|
+
import { isAnyPayload as isAnyPayload5 } from "@xyo-network/sdk-js";
|
|
3343
3453
|
import { asXL1BlockNumber as asXL1BlockNumber6, StepSizes as StepSizes10 } from "@xyo-network/xl1-protocol-lib";
|
|
3344
3454
|
function transfersSummaryKey(frameHeadHash, frameSize) {
|
|
3345
3455
|
return `${frameHeadHash}|${frameSize}`;
|
|
@@ -3371,7 +3481,7 @@ async function transfersStepSummaryFromRange(context, semaphores, blockViewer, s
|
|
|
3371
3481
|
assertEx29(step !== -1, () => `Invalid step size: ${frameSize}. Must be one of ${StepSizes10.join(", ")}`);
|
|
3372
3482
|
const key = transfersSummaryKey(frameHead._hash, frameSize);
|
|
3373
3483
|
const summaryResult = await summaryMap.get(key);
|
|
3374
|
-
if (
|
|
3484
|
+
if (isAnyPayload5(summaryResult)) {
|
|
3375
3485
|
result = asTransfersStepSummary(summaryResult, { required: true });
|
|
3376
3486
|
} else {
|
|
3377
3487
|
await semaphores[step].acquire();
|
|
@@ -3420,12 +3530,12 @@ async function transfersStepSummaryFromRange(context, semaphores, blockViewer, s
|
|
|
3420
3530
|
|
|
3421
3531
|
// src/summary/primitives/transfers/transfersSummary.ts
|
|
3422
3532
|
import {
|
|
3423
|
-
asAddress as
|
|
3533
|
+
asAddress as asAddress2,
|
|
3424
3534
|
assertEx as assertEx30,
|
|
3425
3535
|
spanRootAsync as spanRootAsync6
|
|
3426
3536
|
} from "@xylabs/sdk-js";
|
|
3427
3537
|
import {
|
|
3428
|
-
asBlockBoundWitnessWithStorageMeta as
|
|
3538
|
+
asBlockBoundWitnessWithStorageMeta as asBlockBoundWitnessWithStorageMeta5,
|
|
3429
3539
|
asXL1BlockRange as asXL1BlockRange9,
|
|
3430
3540
|
isChainQualifiedHeadConfig as isChainQualifiedHeadConfig3,
|
|
3431
3541
|
isChainQualifiedRangeConfig as isChainQualifiedRangeConfig3
|
|
@@ -3434,7 +3544,7 @@ async function transfersSummary(context, semaphores, blockViewer, summaryMap, co
|
|
|
3434
3544
|
return await spanRootAsync6("transferSummary", async () => {
|
|
3435
3545
|
const headHash = isChainQualifiedHeadConfig3(config) ? config.head : await blockViewer.currentBlockHash();
|
|
3436
3546
|
const [head] = assertEx30(await blockViewer.blockByHash(headHash), () => `Block not found for hash: ${headHash}`);
|
|
3437
|
-
const headBoundWitness =
|
|
3547
|
+
const headBoundWitness = asBlockBoundWitnessWithStorageMeta5(head, () => `Found Block not a BlockWithHashMeta: ${headHash}`);
|
|
3438
3548
|
const range = isChainQualifiedRangeConfig3(config) ? config.range : asXL1BlockRange9([0, headBoundWitness.block], true);
|
|
3439
3549
|
const ranges = deepCalculateFramesFromRange(asXL1BlockRange9(
|
|
3440
3550
|
range,
|
|
@@ -3444,10 +3554,10 @@ async function transfersSummary(context, semaphores, blockViewer, summaryMap, co
|
|
|
3444
3554
|
const transfers = {};
|
|
3445
3555
|
for (const summary of summaries) {
|
|
3446
3556
|
for (const [from, toMap] of Object.entries(summary.transfers)) {
|
|
3447
|
-
const validFrom =
|
|
3557
|
+
const validFrom = asAddress2(from, () => `Invalid address: ${from}`);
|
|
3448
3558
|
transfers[validFrom] = transfers[validFrom] ?? {};
|
|
3449
3559
|
for (const [to, transfer] of Object.entries(toMap)) {
|
|
3450
|
-
const validTo =
|
|
3560
|
+
const validTo = asAddress2(to, () => `Invalid address: ${to}`);
|
|
3451
3561
|
transfers[validFrom][validTo] = (transfers[validFrom][validTo] ?? 0n) + parseSignedBigInt(transfer);
|
|
3452
3562
|
}
|
|
3453
3563
|
}
|
|
@@ -3459,9 +3569,9 @@ async function transfersSummary(context, semaphores, blockViewer, summaryMap, co
|
|
|
3459
3569
|
// src/simple/accountBalance/SimpleAccountBalanceViewer.ts
|
|
3460
3570
|
var SimpleAccountBalanceViewer = class extends AbstractCreatableProvider {
|
|
3461
3571
|
moniker = SimpleAccountBalanceViewer.defaultMoniker;
|
|
3462
|
-
_balanceStepSemaphores = StepSizes11.map(() => new
|
|
3572
|
+
_balanceStepSemaphores = StepSizes11.map(() => new Semaphore(20));
|
|
3463
3573
|
_blockViewer;
|
|
3464
|
-
_transferStepSemaphores = StepSizes11.map(() => new
|
|
3574
|
+
_transferStepSemaphores = StepSizes11.map(() => new Semaphore(20));
|
|
3465
3575
|
get balancesSummaryMap() {
|
|
3466
3576
|
return this.params.balancesSummaryMap;
|
|
3467
3577
|
}
|
|
@@ -3672,7 +3782,7 @@ import {
|
|
|
3672
3782
|
} from "@xyo-network/xl1-protocol-lib";
|
|
3673
3783
|
|
|
3674
3784
|
// src/utils/HydratedCache.ts
|
|
3675
|
-
import { LRUCache as
|
|
3785
|
+
import { LRUCache as LRUCache3 } from "lru-cache";
|
|
3676
3786
|
var HydratedCache = class {
|
|
3677
3787
|
cache;
|
|
3678
3788
|
context;
|
|
@@ -3680,7 +3790,7 @@ var HydratedCache = class {
|
|
|
3680
3790
|
constructor(context, hydrateFunction, maxCount = 2e3, ttl = Number.MAX_SAFE_INTEGER) {
|
|
3681
3791
|
this.context = context;
|
|
3682
3792
|
this.hydrateFunction = hydrateFunction;
|
|
3683
|
-
this.cache = new
|
|
3793
|
+
this.cache = new LRUCache3({ max: maxCount, ttl });
|
|
3684
3794
|
}
|
|
3685
3795
|
async get(hash) {
|
|
3686
3796
|
const existing = this.cache.get(hash);
|
|
@@ -3695,12 +3805,12 @@ var HydratedCache = class {
|
|
|
3695
3805
|
};
|
|
3696
3806
|
|
|
3697
3807
|
// src/utils/isZodError.ts
|
|
3698
|
-
import { z as
|
|
3808
|
+
import { z as z26 } from "zod";
|
|
3699
3809
|
var isZodError = (error) => {
|
|
3700
|
-
return error instanceof
|
|
3810
|
+
return error instanceof z26.ZodError;
|
|
3701
3811
|
};
|
|
3702
3812
|
var prettifyZodError = (error) => {
|
|
3703
|
-
return
|
|
3813
|
+
return z26.prettifyError(error);
|
|
3704
3814
|
};
|
|
3705
3815
|
|
|
3706
3816
|
// src/simple/block/SimpleBlockViewer.ts
|
|
@@ -3941,13 +4051,14 @@ SimpleBlockRewardViewer = __decorateClass([
|
|
|
3941
4051
|
|
|
3942
4052
|
// src/simple/blockValidation/SimpleBlockValidationViewer.ts
|
|
3943
4053
|
import { assertEx as assertEx33 } from "@xylabs/sdk-js";
|
|
3944
|
-
import { PayloadBuilder as
|
|
4054
|
+
import { PayloadBuilder as PayloadBuilder18 } from "@xyo-network/sdk-js";
|
|
3945
4055
|
import {
|
|
3946
4056
|
AccountBalanceViewerMoniker as AccountBalanceViewerMoniker2,
|
|
3947
4057
|
asXL1BlockRange as asXL1BlockRange11,
|
|
3948
4058
|
BlockValidationViewerMoniker,
|
|
3949
4059
|
BlockViewerMoniker as BlockViewerMoniker3,
|
|
3950
4060
|
ChainContractViewerMoniker,
|
|
4061
|
+
HydratedBlockValidationError,
|
|
3951
4062
|
isChainQualifiedHeadConfig as isChainQualifiedHeadConfig5,
|
|
3952
4063
|
isHydratedBlock
|
|
3953
4064
|
} from "@xyo-network/xl1-protocol-lib";
|
|
@@ -3991,7 +4102,7 @@ var SimpleBlockValidationViewer = class extends AbstractCreatableProvider {
|
|
|
3991
4102
|
state: true,
|
|
3992
4103
|
head: void 0
|
|
3993
4104
|
};
|
|
3994
|
-
const blocksWithMeta = await Promise.all(blocks.map((b) => Promise.all([
|
|
4105
|
+
const blocksWithMeta = await Promise.all(blocks.map((b) => Promise.all([PayloadBuilder18.addHashMeta(b[0]), PayloadBuilder18.addHashMeta(b[1])])));
|
|
3995
4106
|
const head = isChainQualifiedHeadConfig5(config) ? assertEx33(
|
|
3996
4107
|
(await this.blockViewer.blockByHash(config.head))?.[0],
|
|
3997
4108
|
() => `Specified a head that is not in the chain [${config.head}]`
|
|
@@ -4046,7 +4157,7 @@ var SimpleBlockValidationViewer = class extends AbstractCreatableProvider {
|
|
|
4046
4157
|
this.logger?.warn(`Unexpected uncle count during block validation [uncles=${uncles.length}, blocks=${blocks.length}]`);
|
|
4047
4158
|
this.logger?.debug(JSON.stringify({ uncles, blocks: blocks.length }, null, 2));
|
|
4048
4159
|
this.logger?.debug(JSON.stringify(windowedUncleChain, null, 2));
|
|
4049
|
-
|
|
4160
|
+
return blocks.map((block) => [new HydratedBlockValidationError(block[0]._hash, block, "Unexpected uncle count during state validation", { uncles: uncles.length, blocks: blocks.length })]);
|
|
4050
4161
|
}
|
|
4051
4162
|
return await Promise.all(uncles[0].map(async (block) => {
|
|
4052
4163
|
const errors = await this.params.state(
|
|
@@ -4150,18 +4261,18 @@ import {
|
|
|
4150
4261
|
assertEx as assertEx35,
|
|
4151
4262
|
exists as exists6
|
|
4152
4263
|
} from "@xylabs/sdk-js";
|
|
4153
|
-
import { isAnyPayload as
|
|
4264
|
+
import { isAnyPayload as isAnyPayload7, PayloadZodLoose } from "@xyo-network/sdk-js";
|
|
4154
4265
|
import {
|
|
4155
4266
|
DataLakeRunnerMoniker
|
|
4156
4267
|
} from "@xyo-network/xl1-protocol-lib";
|
|
4157
|
-
import
|
|
4268
|
+
import z27 from "zod";
|
|
4158
4269
|
|
|
4159
4270
|
// src/simple/datalake/AbstractRestDataLake.ts
|
|
4160
4271
|
import { axiosJsonConfig } from "@xylabs/sdk-js";
|
|
4161
4272
|
import {
|
|
4162
4273
|
exists as exists5
|
|
4163
4274
|
} from "@xylabs/sdk-js";
|
|
4164
|
-
import { asAnyPayload as asAnyPayload4, isAnyPayload as
|
|
4275
|
+
import { asAnyPayload as asAnyPayload4, isAnyPayload as isAnyPayload6 } from "@xyo-network/sdk-js";
|
|
4165
4276
|
import { Axios } from "axios";
|
|
4166
4277
|
var AbstractRestDataLake = class extends AbstractCreatableProvider {
|
|
4167
4278
|
get allowedSchemas() {
|
|
@@ -4186,7 +4297,7 @@ var AbstractRestDataLake = class extends AbstractCreatableProvider {
|
|
|
4186
4297
|
return asAnyPayload4((await this.axios.get(`${this.params.endpoint}/get/${hash}`)).data);
|
|
4187
4298
|
}
|
|
4188
4299
|
isAllowed(value) {
|
|
4189
|
-
if (
|
|
4300
|
+
if (isAnyPayload6(value)) {
|
|
4190
4301
|
return this.isAllowedSchema(value.schema);
|
|
4191
4302
|
}
|
|
4192
4303
|
return false;
|
|
@@ -4213,7 +4324,7 @@ var RestDataLakeRunner = class extends AbstractRestDataLake {
|
|
|
4213
4324
|
}
|
|
4214
4325
|
async insert(items) {
|
|
4215
4326
|
const allowedItems = items.map((item) => {
|
|
4216
|
-
if (
|
|
4327
|
+
if (isAnyPayload7(item) && this.isAllowed(item)) {
|
|
4217
4328
|
assertEx35(typeof item === "object" && item !== null, () => "Data must be an object");
|
|
4218
4329
|
return item;
|
|
4219
4330
|
}
|
|
@@ -4221,7 +4332,7 @@ var RestDataLakeRunner = class extends AbstractRestDataLake {
|
|
|
4221
4332
|
}).filter(exists6);
|
|
4222
4333
|
if (allowedItems.length > 0) {
|
|
4223
4334
|
const result = await this.axios.post(`${this.params.endpoint}/insert`, allowedItems);
|
|
4224
|
-
return
|
|
4335
|
+
return z27.array(PayloadZodLoose).parse(result.data);
|
|
4225
4336
|
} else {
|
|
4226
4337
|
return [];
|
|
4227
4338
|
}
|
|
@@ -4250,13 +4361,13 @@ RestDataLakeViewer = __decorateClass([
|
|
|
4250
4361
|
|
|
4251
4362
|
// src/simple/datalake/SimpleDataLakeRunner.ts
|
|
4252
4363
|
import { exists as exists7 } from "@xylabs/sdk-js";
|
|
4253
|
-
import { isAnyPayload as
|
|
4364
|
+
import { isAnyPayload as isAnyPayload9, PayloadBuilder as PayloadBuilder19 } from "@xyo-network/sdk-js";
|
|
4254
4365
|
import {
|
|
4255
4366
|
DataLakeRunnerMoniker as DataLakeRunnerMoniker2
|
|
4256
4367
|
} from "@xyo-network/xl1-protocol-lib";
|
|
4257
4368
|
|
|
4258
4369
|
// src/simple/datalake/AbstractSimpleDataLake.ts
|
|
4259
|
-
import { isAnyPayload as
|
|
4370
|
+
import { isAnyPayload as isAnyPayload8 } from "@xyo-network/sdk-js";
|
|
4260
4371
|
var AbstractSimpleDataLake = class extends AbstractCreatableProvider {
|
|
4261
4372
|
get allowedSchemas() {
|
|
4262
4373
|
return this.params.allowedSchemas;
|
|
@@ -4275,7 +4386,7 @@ var AbstractSimpleDataLake = class extends AbstractCreatableProvider {
|
|
|
4275
4386
|
throw new Error("Method not implemented.");
|
|
4276
4387
|
}
|
|
4277
4388
|
isAllowed(value) {
|
|
4278
|
-
if (
|
|
4389
|
+
if (isAnyPayload8(value)) {
|
|
4279
4390
|
return this.isAllowedSchema(value.schema);
|
|
4280
4391
|
}
|
|
4281
4392
|
return true;
|
|
@@ -4304,8 +4415,8 @@ var SimpleDataLakeRunner = class extends AbstractSimpleDataLake {
|
|
|
4304
4415
|
}))).filter(exists7);
|
|
4305
4416
|
}
|
|
4306
4417
|
async insert(items) {
|
|
4307
|
-
const payloads = items.filter(
|
|
4308
|
-
const hashPairs = await
|
|
4418
|
+
const payloads = items.filter(isAnyPayload9).filter((i) => this.isAllowed(i));
|
|
4419
|
+
const hashPairs = await PayloadBuilder19.hashPairs(payloads);
|
|
4309
4420
|
for (const [payload, hash] of hashPairs) {
|
|
4310
4421
|
await this.map.set(hash, payload);
|
|
4311
4422
|
}
|
|
@@ -4474,7 +4585,7 @@ import {
|
|
|
4474
4585
|
BigIntToJsonZod,
|
|
4475
4586
|
isDefined as isDefined17
|
|
4476
4587
|
} from "@xylabs/sdk-js";
|
|
4477
|
-
import { PayloadBuilder as
|
|
4588
|
+
import { PayloadBuilder as PayloadBuilder20 } from "@xyo-network/sdk-js";
|
|
4478
4589
|
import {
|
|
4479
4590
|
asXL1BlockNumber as asXL1BlockNumber9,
|
|
4480
4591
|
DataLakeRunnerMoniker as DataLakeRunnerMoniker3,
|
|
@@ -4514,7 +4625,7 @@ var SimpleXyoGatewayRunner = class _SimpleXyoGatewayRunner extends AbstractCreat
|
|
|
4514
4625
|
const resolvedNbf = asXL1BlockNumber9(isDefined17(nbf) ? nbf : await viewer.currentBlockNumber(), true);
|
|
4515
4626
|
const resolvedExp = asXL1BlockNumber9(isDefined17(exp) ? exp : resolvedNbf + 10, true);
|
|
4516
4627
|
const tx = await buildUnsignedTransaction(resolvedChainId, onChain, offChain, resolvedNbf, resolvedExp, await this.signer.address(), fees);
|
|
4517
|
-
return await this.addTransactionToChain(tx, await
|
|
4628
|
+
return await this.addTransactionToChain(tx, await PayloadBuilder20.addHashMeta(offChain));
|
|
4518
4629
|
}
|
|
4519
4630
|
async addTransactionToChain(tx, offChain = []) {
|
|
4520
4631
|
const connection = this.connection;
|
|
@@ -4523,8 +4634,8 @@ var SimpleXyoGatewayRunner = class _SimpleXyoGatewayRunner extends AbstractCreat
|
|
|
4523
4634
|
let signedTx;
|
|
4524
4635
|
if (isSignedHydratedTransaction(tx)) {
|
|
4525
4636
|
const [bw, payloads] = tx;
|
|
4526
|
-
const hashedBw = await
|
|
4527
|
-
const hashedPayloads = await
|
|
4637
|
+
const hashedBw = await PayloadBuilder20.addHashMeta(bw);
|
|
4638
|
+
const hashedPayloads = await PayloadBuilder20.addHashMeta(payloads);
|
|
4528
4639
|
signedTx = [hashedBw, hashedPayloads];
|
|
4529
4640
|
} else {
|
|
4530
4641
|
signedTx = await signer.signTransaction(tx);
|
|
@@ -4556,7 +4667,7 @@ var SimpleXyoGatewayRunner = class _SimpleXyoGatewayRunner extends AbstractCreat
|
|
|
4556
4667
|
BigIntToJsonZod.parse(amount)
|
|
4557
4668
|
])
|
|
4558
4669
|
);
|
|
4559
|
-
const transfer = new
|
|
4670
|
+
const transfer = new PayloadBuilder20({ schema: TransferSchema3 }).fields({
|
|
4560
4671
|
from,
|
|
4561
4672
|
transfers: hexTransfers,
|
|
4562
4673
|
epoch: Date.now()
|
|
@@ -4573,16 +4684,18 @@ import {
|
|
|
4573
4684
|
} from "@xylabs/sdk-js";
|
|
4574
4685
|
import {
|
|
4575
4686
|
isPayloadBundle,
|
|
4576
|
-
PayloadBuilder as
|
|
4687
|
+
PayloadBuilder as PayloadBuilder21
|
|
4577
4688
|
} from "@xyo-network/sdk-js";
|
|
4578
4689
|
import {
|
|
4579
4690
|
BlockValidationViewerMoniker as BlockValidationViewerMoniker2,
|
|
4580
4691
|
ChainContractViewerMoniker as ChainContractViewerMoniker4,
|
|
4692
|
+
DeadLetterQueueRunnerMoniker,
|
|
4581
4693
|
DEFAULT_MAX_EXP_AHEAD,
|
|
4582
4694
|
FinalizationViewerMoniker as FinalizationViewerMoniker4,
|
|
4583
4695
|
isSignedHydratedBlockWithHashMeta,
|
|
4584
4696
|
isSignedHydratedTransactionWithHashMeta,
|
|
4585
4697
|
MempoolRunnerMoniker,
|
|
4698
|
+
TransactionRejectionSchema,
|
|
4586
4699
|
TransactionValidationViewerMoniker
|
|
4587
4700
|
} from "@xyo-network/xl1-protocol-lib";
|
|
4588
4701
|
import { Mutex } from "async-mutex";
|
|
@@ -4592,6 +4705,7 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
|
|
|
4592
4705
|
moniker = SimpleMempoolRunner.defaultMoniker;
|
|
4593
4706
|
_blockValidationViewer;
|
|
4594
4707
|
_chainContractViewer;
|
|
4708
|
+
_deadLetterQueueRunner;
|
|
4595
4709
|
_finalizationViewer;
|
|
4596
4710
|
_transactionValidationViewer;
|
|
4597
4711
|
_syncMutex = new Mutex();
|
|
@@ -4639,6 +4753,7 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
|
|
|
4639
4753
|
this._chainContractViewer = await this.locator.getInstance(ChainContractViewerMoniker4);
|
|
4640
4754
|
this._finalizationViewer = await this.locator.getInstance(FinalizationViewerMoniker4);
|
|
4641
4755
|
this._transactionValidationViewer = await this.locator.getInstance(TransactionValidationViewerMoniker);
|
|
4756
|
+
this._deadLetterQueueRunner = await this.locator.tryGetInstance(DeadLetterQueueRunnerMoniker);
|
|
4642
4757
|
}
|
|
4643
4758
|
async prunePendingBlocks({
|
|
4644
4759
|
batchSize = 10,
|
|
@@ -4741,6 +4856,7 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
|
|
|
4741
4856
|
if (!validated) {
|
|
4742
4857
|
this.logger?.debug(`Pruning transaction ${bundles[remainingTransactionMap[i]]._hash} during transaction validation`);
|
|
4743
4858
|
this.logger?.debug(` - validation result: ${r.at(0)?.message}`);
|
|
4859
|
+
await this.routeRejectedTransaction(remainingTransactions[i], r);
|
|
4744
4860
|
}
|
|
4745
4861
|
valid[remainingTransactionMap[i]] = validated;
|
|
4746
4862
|
}
|
|
@@ -4767,8 +4883,8 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
|
|
|
4767
4883
|
async submitBlocks(blocks) {
|
|
4768
4884
|
const bundles = await Promise.all(blocks.map(async ([bw, payloads]) => {
|
|
4769
4885
|
return hydratedBlockToPayloadBundle([
|
|
4770
|
-
await
|
|
4771
|
-
await
|
|
4886
|
+
await PayloadBuilder21.addHashMeta(bw),
|
|
4887
|
+
await PayloadBuilder21.addHashMeta(payloads)
|
|
4772
4888
|
]);
|
|
4773
4889
|
}));
|
|
4774
4890
|
const inserted = await this.pendingBlocksArchivist.insert(bundles);
|
|
@@ -4786,8 +4902,8 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
|
|
|
4786
4902
|
});
|
|
4787
4903
|
const bundles = await Promise.all(validTransactions.map(async ([tx, payloads]) => {
|
|
4788
4904
|
return hydratedTransactionToPayloadBundle([
|
|
4789
|
-
await
|
|
4790
|
-
await
|
|
4905
|
+
await PayloadBuilder21.addHashMeta(tx),
|
|
4906
|
+
await PayloadBuilder21.addHashMeta(payloads)
|
|
4791
4907
|
]);
|
|
4792
4908
|
}));
|
|
4793
4909
|
const inserted = await this.pendingTransactionsArchivist.insert(bundles);
|
|
@@ -4809,6 +4925,20 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
|
|
|
4809
4925
|
this._syncTimerId = null;
|
|
4810
4926
|
}
|
|
4811
4927
|
}
|
|
4928
|
+
async routeRejectedTransaction(transaction, errors) {
|
|
4929
|
+
if (!this._deadLetterQueueRunner) return;
|
|
4930
|
+
const rejectionErrors = errors.map((e) => ({
|
|
4931
|
+
hash: transaction[0]._hash,
|
|
4932
|
+
name: e.name ?? "TransactionStateValidationError",
|
|
4933
|
+
message: String(e.message ?? e)
|
|
4934
|
+
}));
|
|
4935
|
+
await this._deadLetterQueueRunner.rejectTransaction({
|
|
4936
|
+
schema: TransactionRejectionSchema,
|
|
4937
|
+
transaction,
|
|
4938
|
+
errors: rejectionErrors,
|
|
4939
|
+
rejector: "mempool"
|
|
4940
|
+
});
|
|
4941
|
+
}
|
|
4812
4942
|
async simpleBlockValidationCheck(payloads) {
|
|
4813
4943
|
const headNumber = await this.finalizationViewer.headNumber();
|
|
4814
4944
|
const chainId = await this.chainContractViewer.chainId();
|
|
@@ -5208,7 +5338,7 @@ var MemoryPermissionsStore = class {
|
|
|
5208
5338
|
};
|
|
5209
5339
|
|
|
5210
5340
|
// src/simple/runner/SimpleXyoRunner.ts
|
|
5211
|
-
import { PayloadBuilder as
|
|
5341
|
+
import { PayloadBuilder as PayloadBuilder22 } from "@xyo-network/sdk-js";
|
|
5212
5342
|
import {
|
|
5213
5343
|
MempoolRunnerMoniker as MempoolRunnerMoniker2,
|
|
5214
5344
|
XyoRunnerMoniker
|
|
@@ -5221,7 +5351,7 @@ var SimpleXyoRunner = class extends AbstractCreatableProvider {
|
|
|
5221
5351
|
}
|
|
5222
5352
|
async broadcastTransaction(transaction) {
|
|
5223
5353
|
await this.mempool.submitTransactions([transaction]);
|
|
5224
|
-
const hash = await
|
|
5354
|
+
const hash = await PayloadBuilder22.hash(transaction[0]);
|
|
5225
5355
|
this.logger?.info(`Broadcasted transaction with hash ${hash}`);
|
|
5226
5356
|
return hash;
|
|
5227
5357
|
}
|
|
@@ -5238,7 +5368,7 @@ SimpleXyoRunner = __decorateClass([
|
|
|
5238
5368
|
], SimpleXyoRunner);
|
|
5239
5369
|
|
|
5240
5370
|
// src/simple/signer/SimpleXyoSigner.ts
|
|
5241
|
-
import { Account, PayloadBuilder as
|
|
5371
|
+
import { Account, PayloadBuilder as PayloadBuilder23 } from "@xyo-network/sdk-js";
|
|
5242
5372
|
import {
|
|
5243
5373
|
SignedHydratedTransactionWithHashMetaZod,
|
|
5244
5374
|
XyoSignerMoniker as XyoSignerMoniker2
|
|
@@ -5281,7 +5411,7 @@ var SimpleXyoSigner = class _SimpleXyoSigner extends AbstractCreatableProvider {
|
|
|
5281
5411
|
}
|
|
5282
5412
|
async signTransaction(tx) {
|
|
5283
5413
|
const txBW = await signTransaction(tx[0], this.params.account);
|
|
5284
|
-
return SignedHydratedTransactionWithHashMetaZod.parse([await
|
|
5414
|
+
return SignedHydratedTransactionWithHashMetaZod.parse([await PayloadBuilder23.addStorageMeta(txBW), await PayloadBuilder23.addStorageMeta(tx[1])]);
|
|
5285
5415
|
}
|
|
5286
5416
|
};
|
|
5287
5417
|
|
|
@@ -5366,7 +5496,7 @@ SimpleStakeEventsViewer = __decorateClass([
|
|
|
5366
5496
|
], SimpleStakeEventsViewer);
|
|
5367
5497
|
|
|
5368
5498
|
// src/simple/StakeTotalsViewer/SimpleStakeTotalsViewer.ts
|
|
5369
|
-
import { asAddress as
|
|
5499
|
+
import { asAddress as asAddress3 } from "@xylabs/sdk-js";
|
|
5370
5500
|
import { assertEx as assertEx41 } from "@xylabs/sdk-js";
|
|
5371
5501
|
import {
|
|
5372
5502
|
StakeTotalsViewerMoniker,
|
|
@@ -5392,7 +5522,7 @@ var SimpleStakeTotalsViewer = class extends AbstractCreatableProvider {
|
|
|
5392
5522
|
let active = 0n;
|
|
5393
5523
|
const positions = await this.stakeViewer.activeStakes();
|
|
5394
5524
|
for (const position of positions) {
|
|
5395
|
-
if ((position.removeBlock === 0 || position.removeBlock > time) &&
|
|
5525
|
+
if ((position.removeBlock === 0 || position.removeBlock > time) && asAddress3(position.staked) === asAddress3(staked)) {
|
|
5396
5526
|
active += position.amount;
|
|
5397
5527
|
}
|
|
5398
5528
|
}
|
|
@@ -5402,7 +5532,7 @@ var SimpleStakeTotalsViewer = class extends AbstractCreatableProvider {
|
|
|
5402
5532
|
let active = 0n;
|
|
5403
5533
|
const positions = await this.stakeViewer.activeStakes();
|
|
5404
5534
|
for (const position of positions) {
|
|
5405
|
-
if ((position.removeBlock === 0 || position.removeBlock > time) &&
|
|
5535
|
+
if ((position.removeBlock === 0 || position.removeBlock > time) && asAddress3(position.staker) === asAddress3(staker)) {
|
|
5406
5536
|
active += position.amount;
|
|
5407
5537
|
}
|
|
5408
5538
|
}
|
|
@@ -5429,7 +5559,7 @@ var SimpleStakeTotalsViewer = class extends AbstractCreatableProvider {
|
|
|
5429
5559
|
let pending = 0n;
|
|
5430
5560
|
const positions = await this.stakeViewer.removedStakes();
|
|
5431
5561
|
for (const position of positions) {
|
|
5432
|
-
if (position.removeBlock !== 0 && position.removeBlock <= time && (position.withdrawBlock === 0 || position.withdrawBlock > time) &&
|
|
5562
|
+
if (position.removeBlock !== 0 && position.removeBlock <= time && (position.withdrawBlock === 0 || position.withdrawBlock > time) && asAddress3(position.staker) === asAddress3(staker)) {
|
|
5433
5563
|
pending += position.amount;
|
|
5434
5564
|
}
|
|
5435
5565
|
}
|
|
@@ -5449,7 +5579,7 @@ var SimpleStakeTotalsViewer = class extends AbstractCreatableProvider {
|
|
|
5449
5579
|
let withdrawn = 0n;
|
|
5450
5580
|
const positions = await this.stakeViewer.withdrawnStakes();
|
|
5451
5581
|
for (const position of positions) {
|
|
5452
|
-
if (position.withdrawBlock !== 0 && position.withdrawBlock <= time &&
|
|
5582
|
+
if (position.withdrawBlock !== 0 && position.withdrawBlock <= time && asAddress3(position.staker) === asAddress3(staker)) {
|
|
5453
5583
|
withdrawn += position.amount;
|
|
5454
5584
|
}
|
|
5455
5585
|
}
|
|
@@ -5465,7 +5595,7 @@ SimpleStakeTotalsViewer = __decorateClass([
|
|
|
5465
5595
|
|
|
5466
5596
|
// src/simple/StakeViewer/SimpleStakeViewer.ts
|
|
5467
5597
|
import {
|
|
5468
|
-
asAddress as
|
|
5598
|
+
asAddress as asAddress4,
|
|
5469
5599
|
toAddress as toAddress6
|
|
5470
5600
|
} from "@xylabs/sdk-js";
|
|
5471
5601
|
import { assertEx as assertEx42 } from "@xylabs/sdk-js";
|
|
@@ -5496,7 +5626,7 @@ var SimpleStakeViewer = class extends AbstractCreatableProvider {
|
|
|
5496
5626
|
let active = 0n;
|
|
5497
5627
|
const positions = await this.activeStakes();
|
|
5498
5628
|
for (const position of positions) {
|
|
5499
|
-
if (position.removeBlock === 0 &&
|
|
5629
|
+
if (position.removeBlock === 0 && asAddress4(position.staked) === asAddress4(staked)) {
|
|
5500
5630
|
active += position.amount;
|
|
5501
5631
|
}
|
|
5502
5632
|
}
|
|
@@ -5506,7 +5636,7 @@ var SimpleStakeViewer = class extends AbstractCreatableProvider {
|
|
|
5506
5636
|
let active = 0n;
|
|
5507
5637
|
const positions = await this.activeStakes();
|
|
5508
5638
|
for (const position of positions) {
|
|
5509
|
-
if (position.removeBlock === 0 &&
|
|
5639
|
+
if (position.removeBlock === 0 && asAddress4(position.staker) === asAddress4(staker)) {
|
|
5510
5640
|
active += position.amount;
|
|
5511
5641
|
}
|
|
5512
5642
|
}
|
|
@@ -5539,7 +5669,7 @@ var SimpleStakeViewer = class extends AbstractCreatableProvider {
|
|
|
5539
5669
|
let pending = 0n;
|
|
5540
5670
|
const positions = await this.removedStakes();
|
|
5541
5671
|
for (const position of positions) {
|
|
5542
|
-
if (position.removeBlock !== 0 && position.withdrawBlock === 0 &&
|
|
5672
|
+
if (position.removeBlock !== 0 && position.withdrawBlock === 0 && asAddress4(position.staker) === asAddress4(staker)) {
|
|
5543
5673
|
pending += position.amount;
|
|
5544
5674
|
}
|
|
5545
5675
|
}
|
|
@@ -5555,15 +5685,15 @@ var SimpleStakeViewer = class extends AbstractCreatableProvider {
|
|
|
5555
5685
|
return assertEx42(this.positions[id], () => new Error(`Stake with id ${id} not found`));
|
|
5556
5686
|
}
|
|
5557
5687
|
stakeByStaker(staker, slot) {
|
|
5558
|
-
return this.positions.filter((s) =>
|
|
5688
|
+
return this.positions.filter((s) => asAddress4(s.staker) === asAddress4(staker))[slot];
|
|
5559
5689
|
}
|
|
5560
5690
|
stakesByStaked(staked, range = [0, void 0]) {
|
|
5561
5691
|
const endBlock = range[1] ?? Number.MAX_SAFE_INTEGER;
|
|
5562
|
-
return this.positions.filter((s) =>
|
|
5692
|
+
return this.positions.filter((s) => asAddress4(s.staked) === asAddress4(staked) && s.addBlock <= endBlock && s.removeBlock <= endBlock);
|
|
5563
5693
|
}
|
|
5564
5694
|
stakesByStaker(staker, range = [0, void 0]) {
|
|
5565
5695
|
const endBlock = range[1] ?? Number.MAX_SAFE_INTEGER;
|
|
5566
|
-
return this.positions.filter((s) =>
|
|
5696
|
+
return this.positions.filter((s) => asAddress4(s.staker) === asAddress4(staker) && s.addBlock <= endBlock && s.removeBlock <= endBlock);
|
|
5567
5697
|
}
|
|
5568
5698
|
stakingTokenAddress() {
|
|
5569
5699
|
return toAddress6("0x000000000000000000000000000011");
|
|
@@ -5582,7 +5712,7 @@ var SimpleStakeViewer = class extends AbstractCreatableProvider {
|
|
|
5582
5712
|
let withdrawn = 0n;
|
|
5583
5713
|
const positions = await this.withdrawnStakes();
|
|
5584
5714
|
for (const position of positions) {
|
|
5585
|
-
if (position.withdrawBlock !== 0 &&
|
|
5715
|
+
if (position.withdrawBlock !== 0 && asAddress4(position.staker) === asAddress4(staker)) {
|
|
5586
5716
|
withdrawn += position.amount;
|
|
5587
5717
|
}
|
|
5588
5718
|
}
|
|
@@ -5718,7 +5848,7 @@ SimpleTimeSyncViewer = __decorateClass([
|
|
|
5718
5848
|
|
|
5719
5849
|
// src/simple/transactionValidation/SimpleTransactionValidationViewer.ts
|
|
5720
5850
|
import { assertEx as assertEx44 } from "@xylabs/sdk-js";
|
|
5721
|
-
import { PayloadBuilder as
|
|
5851
|
+
import { PayloadBuilder as PayloadBuilder24 } from "@xyo-network/sdk-js";
|
|
5722
5852
|
import {
|
|
5723
5853
|
AccountBalanceViewerMoniker as AccountBalanceViewerMoniker3,
|
|
5724
5854
|
asXL1BlockRange as asXL1BlockRange12,
|
|
@@ -5767,7 +5897,7 @@ var SimpleTransactionValidationViewer = class extends AbstractCreatableProvider
|
|
|
5767
5897
|
state: true,
|
|
5768
5898
|
head: void 0
|
|
5769
5899
|
};
|
|
5770
|
-
const transactionsWithMeta = await Promise.all(transactions.map((b) => Promise.all([
|
|
5900
|
+
const transactionsWithMeta = await Promise.all(transactions.map((b) => Promise.all([PayloadBuilder24.addHashMeta(b[0]), PayloadBuilder24.addHashMeta(b[1])])));
|
|
5771
5901
|
const head = isChainQualifiedHeadConfig6(config) ? assertEx44(
|
|
5772
5902
|
(await this.blockViewer.blockByHash(config.head))?.[0],
|
|
5773
5903
|
() => `Specified a head that is not in the chain [${config.head}]`
|
|
@@ -6187,8 +6317,8 @@ var getUrl = (host, port) => {
|
|
|
6187
6317
|
var TODO = true;
|
|
6188
6318
|
|
|
6189
6319
|
// src/validation/schema/Mnemonic.ts
|
|
6190
|
-
import { z as
|
|
6191
|
-
var MnemonicStringZod =
|
|
6320
|
+
import { z as z28 } from "zod";
|
|
6321
|
+
var MnemonicStringZod = z28.string().transform((s) => s.trim().replaceAll(/\s+/g, " ")).refine(
|
|
6192
6322
|
(s) => [12, 15, 18, 21, 24].includes(s.split(" ").length),
|
|
6193
6323
|
{ message: "Mnemonic must contain 12, 15, 18, 21, or 24 words." }
|
|
6194
6324
|
).describe("BIP-39 mnemonic string");
|
|
@@ -6214,16 +6344,15 @@ export {
|
|
|
6214
6344
|
ADDRESS_INDEX,
|
|
6215
6345
|
AbstractCreatableProvider,
|
|
6216
6346
|
AccountPathZod,
|
|
6217
|
-
Actor,
|
|
6218
6347
|
ActorConfigContext,
|
|
6219
6348
|
ActorConfigZod,
|
|
6220
|
-
ActorParamsV3Zod,
|
|
6221
|
-
ActorV3,
|
|
6222
6349
|
ActorsConfigZod,
|
|
6223
6350
|
AddressPairSchema,
|
|
6224
6351
|
BalancesStepSummarySchema,
|
|
6225
6352
|
BaseConfigContextZod,
|
|
6226
6353
|
BaseConfigZod,
|
|
6354
|
+
BoundWitnessHydrator,
|
|
6355
|
+
BoundWitnessWithStorageMetaZod,
|
|
6227
6356
|
CHANGE_ADDRESS,
|
|
6228
6357
|
COIN_TYPES,
|
|
6229
6358
|
ChainIndexingServiceStateSchema,
|
|
@@ -6245,6 +6374,7 @@ export {
|
|
|
6245
6374
|
HostActorConfigContext,
|
|
6246
6375
|
HostActorConfigZod,
|
|
6247
6376
|
HttpRpcRemoteConfigZod,
|
|
6377
|
+
HydratedBoundWitnessWithStorageMetaZod,
|
|
6248
6378
|
HydratedCache,
|
|
6249
6379
|
JSONSchemaMetaSchema,
|
|
6250
6380
|
LoggerStatusReporter,
|
|
@@ -6325,6 +6455,7 @@ export {
|
|
|
6325
6455
|
asBalancesStepSummary,
|
|
6326
6456
|
asBalancesStepSummaryWithStorageMeta,
|
|
6327
6457
|
asBaseConfigContext,
|
|
6458
|
+
asBoundWitnessWithStorageMeta,
|
|
6328
6459
|
asChainIndexingServiceState,
|
|
6329
6460
|
asChainIndexingServiceStateWithStorageMeta,
|
|
6330
6461
|
asCreatableProviderContext,
|
|
@@ -6332,6 +6463,7 @@ export {
|
|
|
6332
6463
|
asEIP712SignaturePayload,
|
|
6333
6464
|
asHostActorConfig,
|
|
6334
6465
|
asHostActorConfigContext,
|
|
6466
|
+
asHydratedBoundWitnessWithStorageMeta,
|
|
6335
6467
|
asOptionalAddressPairPayload,
|
|
6336
6468
|
asProviderConfig,
|
|
6337
6469
|
asSchemasStepSummary,
|
|
@@ -6358,7 +6490,10 @@ export {
|
|
|
6358
6490
|
crackOperation,
|
|
6359
6491
|
crackOperations,
|
|
6360
6492
|
creatableProvider,
|
|
6493
|
+
createBlockHydrator,
|
|
6494
|
+
createBoundWitnessHydrator,
|
|
6361
6495
|
createDeclarationIntent,
|
|
6496
|
+
createTransactionHydrator,
|
|
6362
6497
|
createTransferPayload,
|
|
6363
6498
|
deepCalculateFramesFromRange,
|
|
6364
6499
|
externalBlockNumberFromXL1BlockNumber,
|