@xyo-network/xl1-protocol-sdk 3.0.15 → 3.0.16
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/index.mjs +146 -36
- package/dist/neutral/index.mjs.map +4 -4
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts +9 -10
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts.map +1 -1
- package/dist/neutral/simple/index.d.ts +1 -0
- package/dist/neutral/simple/index.d.ts.map +1 -1
- package/dist/neutral/simple/systemStatus/ConsoleSystemStatusPublisher.d.ts +21 -0
- package/dist/neutral/simple/systemStatus/ConsoleSystemStatusPublisher.d.ts.map +1 -0
- package/dist/neutral/simple/systemStatus/SimpleSystemStatusViewer.d.ts +27 -0
- package/dist/neutral/simple/systemStatus/SimpleSystemStatusViewer.d.ts.map +1 -0
- package/dist/neutral/simple/systemStatus/index.d.ts +3 -0
- package/dist/neutral/simple/systemStatus/index.d.ts.map +1 -0
- package/dist/neutral/status/SimpleSystemStatusRunner.d.ts +35 -0
- package/dist/neutral/status/SimpleSystemStatusRunner.d.ts.map +1 -0
- package/dist/neutral/status/index.d.ts +1 -1
- package/dist/neutral/status/index.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/neutral/status/RuntimeStatusMonitor.d.ts +0 -34
- package/dist/neutral/status/RuntimeStatusMonitor.d.ts.map +0 -1
package/dist/neutral/index.mjs
CHANGED
|
@@ -3101,7 +3101,7 @@ import {
|
|
|
3101
3101
|
} from "@xylabs/sdk-js";
|
|
3102
3102
|
import { CachingContextZod } from "@xyo-network/xl1-protocol-lib";
|
|
3103
3103
|
import { z as z19 } from "zod/mini";
|
|
3104
|
-
var
|
|
3104
|
+
var SystemStatusRunnerZod = z19.custom((val) => val !== null && val !== void 0 && typeof val === "object");
|
|
3105
3105
|
var ProviderFactoryLocatorZod = z19.lazy(() => z19.custom((val) => val !== null && val !== void 0 && typeof val === "object" && "context" in val && "registry" in val));
|
|
3106
3106
|
var BaseConfigContextZod = z19.extend(CachingContextZod, {
|
|
3107
3107
|
config: z19.looseObject(BaseConfigZod.shape),
|
|
@@ -3110,7 +3110,7 @@ var BaseConfigContextZod = z19.extend(CachingContextZod, {
|
|
|
3110
3110
|
var CreatableProviderContextZod = z19.lazy(() => z19.extend(BaseConfigContextZod, {
|
|
3111
3111
|
_id: z19.optional(z19.string()),
|
|
3112
3112
|
locator: ProviderFactoryLocatorZod,
|
|
3113
|
-
statusReporter: z19.optional(
|
|
3113
|
+
statusReporter: z19.optional(SystemStatusRunnerZod)
|
|
3114
3114
|
}));
|
|
3115
3115
|
var isBaseConfigContext = zodIsFactory4(BaseConfigContextZod);
|
|
3116
3116
|
var asBaseConfigContext = zodAsFactory5(BaseConfigContextZod, "asBaseConfigContext");
|
|
@@ -6781,10 +6781,71 @@ RestSyncViewer = __decorateClass([
|
|
|
6781
6781
|
creatableProvider()
|
|
6782
6782
|
], RestSyncViewer);
|
|
6783
6783
|
|
|
6784
|
+
// src/simple/systemStatus/ConsoleSystemStatusPublisher.ts
|
|
6785
|
+
import { assertEx as assertEx50 } from "@xylabs/sdk-js";
|
|
6786
|
+
import { SystemStatusPublisherMoniker } from "@xyo-network/xl1-protocol-lib";
|
|
6787
|
+
var ConsoleSystemStatusPublisher = class extends AbstractCreatableProvider {
|
|
6788
|
+
moniker = ConsoleSystemStatusPublisher.defaultMoniker;
|
|
6789
|
+
async startHandler() {
|
|
6790
|
+
await super.startHandler();
|
|
6791
|
+
const runner = assertEx50(
|
|
6792
|
+
this.context.statusReporter,
|
|
6793
|
+
() => "ConsoleSystemStatusPublisher requires a SystemStatusRunner (context.statusReporter)"
|
|
6794
|
+
);
|
|
6795
|
+
runner.onGlobalTransition({ to: "started" }, () => {
|
|
6796
|
+
this.logger?.info("All services started.");
|
|
6797
|
+
});
|
|
6798
|
+
runner.onGlobalTransition({ to: "error" }, () => {
|
|
6799
|
+
this.logger?.error("A service entered an error state.");
|
|
6800
|
+
});
|
|
6801
|
+
}
|
|
6802
|
+
};
|
|
6803
|
+
__publicField(ConsoleSystemStatusPublisher, "connectionTypes", ["memory"]);
|
|
6804
|
+
__publicField(ConsoleSystemStatusPublisher, "defaultMoniker", SystemStatusPublisherMoniker);
|
|
6805
|
+
__publicField(ConsoleSystemStatusPublisher, "dependencies", []);
|
|
6806
|
+
__publicField(ConsoleSystemStatusPublisher, "monikers", [SystemStatusPublisherMoniker]);
|
|
6807
|
+
__publicField(ConsoleSystemStatusPublisher, "surface", "node");
|
|
6808
|
+
ConsoleSystemStatusPublisher = __decorateClass([
|
|
6809
|
+
creatableProvider()
|
|
6810
|
+
], ConsoleSystemStatusPublisher);
|
|
6811
|
+
|
|
6812
|
+
// src/simple/systemStatus/SimpleSystemStatusViewer.ts
|
|
6813
|
+
import { assertEx as assertEx51 } from "@xylabs/sdk-js";
|
|
6814
|
+
import { SystemStatusViewerMoniker } from "@xyo-network/xl1-protocol-lib";
|
|
6815
|
+
var SimpleSystemStatusViewer = class extends AbstractCreatableProvider {
|
|
6816
|
+
moniker = SimpleSystemStatusViewer.defaultMoniker;
|
|
6817
|
+
get runner() {
|
|
6818
|
+
return assertEx51(this.context.statusReporter, () => "SystemStatusViewer requires a SystemStatusRunner (context.statusReporter)");
|
|
6819
|
+
}
|
|
6820
|
+
getGlobalStatus() {
|
|
6821
|
+
return this.runner.getGlobalStatus();
|
|
6822
|
+
}
|
|
6823
|
+
getStatus(name) {
|
|
6824
|
+
return this.runner.getStatus(name);
|
|
6825
|
+
}
|
|
6826
|
+
isReady() {
|
|
6827
|
+
return this.runner.isReady();
|
|
6828
|
+
}
|
|
6829
|
+
isShuttingDown() {
|
|
6830
|
+
return this.runner.isShuttingDown();
|
|
6831
|
+
}
|
|
6832
|
+
snapshot() {
|
|
6833
|
+
return this.runner.snapshot();
|
|
6834
|
+
}
|
|
6835
|
+
};
|
|
6836
|
+
__publicField(SimpleSystemStatusViewer, "connectionTypes", ["memory"]);
|
|
6837
|
+
__publicField(SimpleSystemStatusViewer, "defaultMoniker", SystemStatusViewerMoniker);
|
|
6838
|
+
__publicField(SimpleSystemStatusViewer, "dependencies", []);
|
|
6839
|
+
__publicField(SimpleSystemStatusViewer, "monikers", [SystemStatusViewerMoniker]);
|
|
6840
|
+
__publicField(SimpleSystemStatusViewer, "surface", "node");
|
|
6841
|
+
SimpleSystemStatusViewer = __decorateClass([
|
|
6842
|
+
creatableProvider()
|
|
6843
|
+
], SimpleSystemStatusViewer);
|
|
6844
|
+
|
|
6784
6845
|
// src/simple/timeSync2/SimpleTimeSyncViewer.ts
|
|
6785
6846
|
import {
|
|
6786
6847
|
asHash as asHash5,
|
|
6787
|
-
assertEx as
|
|
6848
|
+
assertEx as assertEx52,
|
|
6788
6849
|
isDefined as isDefined22
|
|
6789
6850
|
} from "@xylabs/sdk-js";
|
|
6790
6851
|
import {
|
|
@@ -6806,7 +6867,7 @@ var SimpleTimeSyncViewer = class extends AbstractCreatableProvider {
|
|
|
6806
6867
|
async convertTime(fromDomain, toDomain, from) {
|
|
6807
6868
|
switch (fromDomain) {
|
|
6808
6869
|
case "xl1": {
|
|
6809
|
-
const [block, payloads] =
|
|
6870
|
+
const [block, payloads] = assertEx52(await this.blockViewer.blockByNumber(asXL1BlockNumber11(from, true)), () => "Block not found");
|
|
6810
6871
|
const timeSchemaIndex = block.payload_schemas.indexOf(TimeSchema);
|
|
6811
6872
|
const hash = timeSchemaIndex === -1 ? void 0 : block.payload_hashes[timeSchemaIndex];
|
|
6812
6873
|
const timePayload = asTimePayload2(isDefined22(hash) ? payloads.find((p) => p._hash === hash) : void 0);
|
|
@@ -6862,10 +6923,10 @@ var SimpleTimeSyncViewer = class extends AbstractCreatableProvider {
|
|
|
6862
6923
|
return [Date.now(), null];
|
|
6863
6924
|
}
|
|
6864
6925
|
case "ethereum": {
|
|
6865
|
-
const provider =
|
|
6926
|
+
const provider = assertEx52(this.ethProvider, () => "Ethereum provider not configured");
|
|
6866
6927
|
const blockNumber = await provider.getBlockNumber() ?? 0;
|
|
6867
6928
|
const block = await provider.getBlock(blockNumber);
|
|
6868
|
-
const blockHash = asHash5(
|
|
6929
|
+
const blockHash = asHash5(assertEx52(block?.hash, () => "Block hash not found"), true);
|
|
6869
6930
|
return [blockNumber, blockHash];
|
|
6870
6931
|
}
|
|
6871
6932
|
default: {
|
|
@@ -6880,7 +6941,7 @@ var SimpleTimeSyncViewer = class extends AbstractCreatableProvider {
|
|
|
6880
6941
|
// this is for the previous block
|
|
6881
6942
|
xl1,
|
|
6882
6943
|
// this is for the previous block
|
|
6883
|
-
xl1Hash:
|
|
6944
|
+
xl1Hash: assertEx52(xl1Hash, () => "No xl1 hash available from time sync service"),
|
|
6884
6945
|
epoch: Date.now()
|
|
6885
6946
|
};
|
|
6886
6947
|
if (isDefined22(this.ethProvider)) {
|
|
@@ -6902,7 +6963,7 @@ SimpleTimeSyncViewer = __decorateClass([
|
|
|
6902
6963
|
], SimpleTimeSyncViewer);
|
|
6903
6964
|
|
|
6904
6965
|
// src/simple/transactionValidation/SimpleTransactionValidationViewer.ts
|
|
6905
|
-
import { assertEx as
|
|
6966
|
+
import { assertEx as assertEx53 } from "@xylabs/sdk-js";
|
|
6906
6967
|
import { PayloadBuilder as PayloadBuilder24 } from "@xyo-network/sdk-js";
|
|
6907
6968
|
import {
|
|
6908
6969
|
AccountBalanceViewerMoniker as AccountBalanceViewerMoniker3,
|
|
@@ -6956,7 +7017,7 @@ var SimpleTransactionValidationViewer = class extends AbstractCreatableProvider
|
|
|
6956
7017
|
let head;
|
|
6957
7018
|
if (isChainQualifiedHeadConfig6(config)) {
|
|
6958
7019
|
const headBlockResult = await this.blockViewer.blockByHash(config.head);
|
|
6959
|
-
head = headBlockResult == null ?
|
|
7020
|
+
head = headBlockResult == null ? assertEx53(
|
|
6960
7021
|
void 0,
|
|
6961
7022
|
() => `Specified a head that is not in the chain [${config.head}]`
|
|
6962
7023
|
) : headBlockResult[0];
|
|
@@ -7028,7 +7089,7 @@ SimpleTransactionValidationViewer = __decorateClass([
|
|
|
7028
7089
|
], SimpleTransactionValidationViewer);
|
|
7029
7090
|
|
|
7030
7091
|
// src/simple/TransactionViewer/SimpleTransactionViewer.ts
|
|
7031
|
-
import { assertEx as
|
|
7092
|
+
import { assertEx as assertEx54, exists as exists10 } from "@xylabs/sdk-js";
|
|
7032
7093
|
import { BoundWitnessSchema } from "@xyo-network/sdk-js";
|
|
7033
7094
|
import {
|
|
7034
7095
|
asSignedHydratedTransactionWithHashMeta as asSignedHydratedTransactionWithHashMeta2,
|
|
@@ -7045,7 +7106,7 @@ var SimpleTransactionViewer = class extends AbstractCreatableProvider {
|
|
|
7045
7106
|
}
|
|
7046
7107
|
async byBlockHashAndIndex(blockHash, transactionIndex) {
|
|
7047
7108
|
return await this.spanAsync("byBlockHashAndIndex", async () => {
|
|
7048
|
-
|
|
7109
|
+
assertEx54(transactionIndex >= 0, () => "transactionIndex must be greater than or equal to 0");
|
|
7049
7110
|
try {
|
|
7050
7111
|
const block = await this.blockViewer.blockByHash(blockHash);
|
|
7051
7112
|
if (!block) return null;
|
|
@@ -7110,7 +7171,7 @@ SimpleTransactionViewer = __decorateClass([
|
|
|
7110
7171
|
|
|
7111
7172
|
// src/simple/windowedBlock/SimpleWindowedBlockViewer.ts
|
|
7112
7173
|
import {
|
|
7113
|
-
assertEx as
|
|
7174
|
+
assertEx as assertEx55,
|
|
7114
7175
|
exists as exists11,
|
|
7115
7176
|
isNull as isNull2
|
|
7116
7177
|
} from "@xylabs/sdk-js";
|
|
@@ -7192,7 +7253,7 @@ var SimpleWindowedBlockViewer = class extends AbstractCreatableProvider {
|
|
|
7192
7253
|
}
|
|
7193
7254
|
async createHandler() {
|
|
7194
7255
|
await super.createHandler();
|
|
7195
|
-
this._blockViewer =
|
|
7256
|
+
this._blockViewer = assertEx55(
|
|
7196
7257
|
this.params.blockViewer ?? await this.locator.getInstance(BlockViewerMoniker7),
|
|
7197
7258
|
() => "BlockViewer instance is required"
|
|
7198
7259
|
);
|
|
@@ -7201,13 +7262,13 @@ var SimpleWindowedBlockViewer = class extends AbstractCreatableProvider {
|
|
|
7201
7262
|
this._transactionHashMap = new MemoryMap2();
|
|
7202
7263
|
}
|
|
7203
7264
|
currentBlock() {
|
|
7204
|
-
return
|
|
7265
|
+
return assertEx55(this._chain.at(-1));
|
|
7205
7266
|
}
|
|
7206
7267
|
currentBlockHash() {
|
|
7207
|
-
return
|
|
7268
|
+
return assertEx55(this._chain.at(-1)?.[0]._hash);
|
|
7208
7269
|
}
|
|
7209
7270
|
currentBlockNumber() {
|
|
7210
|
-
return
|
|
7271
|
+
return assertEx55(this._chain.at(-1)?.[0].block);
|
|
7211
7272
|
}
|
|
7212
7273
|
async payloadByHash(hash) {
|
|
7213
7274
|
const payloads = await this.payloadsByHash([hash]);
|
|
@@ -7301,7 +7362,8 @@ var LoggerStatusReporter = class {
|
|
|
7301
7362
|
}
|
|
7302
7363
|
};
|
|
7303
7364
|
|
|
7304
|
-
// src/status/
|
|
7365
|
+
// src/status/SimpleSystemStatusRunner.ts
|
|
7366
|
+
import { SystemStatusRunnerMoniker } from "@xyo-network/xl1-protocol-lib";
|
|
7305
7367
|
var statusPriority = {
|
|
7306
7368
|
error: 0,
|
|
7307
7369
|
stopped: 1,
|
|
@@ -7324,22 +7386,35 @@ var reduceToMinimumStatus = (statuses) => {
|
|
|
7324
7386
|
}
|
|
7325
7387
|
return minStatus;
|
|
7326
7388
|
};
|
|
7327
|
-
var
|
|
7389
|
+
var SimpleSystemStatusRunner = class extends LoggerStatusReporter {
|
|
7390
|
+
moniker = SystemStatusRunnerMoniker;
|
|
7328
7391
|
globalTransitions = [];
|
|
7392
|
+
progressMap = {};
|
|
7393
|
+
readinessMap = {};
|
|
7394
|
+
reportErrorMap = {};
|
|
7395
|
+
shuttingDown = false;
|
|
7329
7396
|
transitions = [];
|
|
7397
|
+
updatedAtMap = {};
|
|
7330
7398
|
getGlobalStatus() {
|
|
7331
|
-
|
|
7332
|
-
|
|
7399
|
+
const statuses = Object.values(this.statusMap);
|
|
7400
|
+
if (statuses.length === 0) return SENTINEL_STATUS;
|
|
7401
|
+
return reduceToMinimumStatus(statuses);
|
|
7333
7402
|
}
|
|
7334
7403
|
getStatus(name) {
|
|
7335
7404
|
return this.statusMap[name];
|
|
7336
7405
|
}
|
|
7406
|
+
isReady() {
|
|
7407
|
+
if (this.shuttingDown) return false;
|
|
7408
|
+
const entries = Object.values(this.readinessMap);
|
|
7409
|
+
if (entries.length === 0) return false;
|
|
7410
|
+
return entries.every((entry) => entry?.readiness === "ready");
|
|
7411
|
+
}
|
|
7412
|
+
isShuttingDown() {
|
|
7413
|
+
return this.shuttingDown;
|
|
7414
|
+
}
|
|
7337
7415
|
onGlobalTransition(match, handler) {
|
|
7338
7416
|
this.globalTransitions.push({ ...match, handler });
|
|
7339
7417
|
}
|
|
7340
|
-
/**
|
|
7341
|
-
* Register a callback to be called on a specific transition.
|
|
7342
|
-
*/
|
|
7343
7418
|
onTransition(match, handler) {
|
|
7344
7419
|
this.transitions.push({ ...match, handler });
|
|
7345
7420
|
}
|
|
@@ -7347,12 +7422,45 @@ var RuntimeStatusMonitor = class extends LoggerStatusReporter {
|
|
|
7347
7422
|
const previous = this.statusMap[name];
|
|
7348
7423
|
const previousGlobal = this.getGlobalStatus();
|
|
7349
7424
|
super.report(name, status, progress);
|
|
7425
|
+
this.updatedAtMap[name] = Date.now();
|
|
7426
|
+
if (progress instanceof Error) {
|
|
7427
|
+
this.reportErrorMap[name] = progress.message;
|
|
7428
|
+
} else if (typeof progress === "number") {
|
|
7429
|
+
this.progressMap[name] = progress;
|
|
7430
|
+
}
|
|
7350
7431
|
if (previous === status) return;
|
|
7351
|
-
this.runTransitions(this.transitions, previous, status, name);
|
|
7432
|
+
this.runTransitions(this.transitions, previous ?? status, status, name);
|
|
7352
7433
|
const globalStatus = this.getGlobalStatus();
|
|
7353
7434
|
if (previousGlobal === globalStatus) return;
|
|
7354
7435
|
this.runTransitions(this.globalTransitions, previousGlobal, globalStatus);
|
|
7355
7436
|
}
|
|
7437
|
+
reportReady(name, readiness, error) {
|
|
7438
|
+
const message = error instanceof Error ? error.message : error;
|
|
7439
|
+
this.readinessMap[name] = { readiness, error: message };
|
|
7440
|
+
this.updatedAtMap[name] = Date.now();
|
|
7441
|
+
}
|
|
7442
|
+
setShuttingDown(shuttingDown) {
|
|
7443
|
+
this.shuttingDown = shuttingDown;
|
|
7444
|
+
}
|
|
7445
|
+
snapshot() {
|
|
7446
|
+
const components = Object.entries(this.statusMap).map(([name, lifecycle]) => {
|
|
7447
|
+
const readinessEntry = this.readinessMap[name];
|
|
7448
|
+
return {
|
|
7449
|
+
name,
|
|
7450
|
+
lifecycle,
|
|
7451
|
+
readiness: readinessEntry?.readiness,
|
|
7452
|
+
progress: this.progressMap[name],
|
|
7453
|
+
error: readinessEntry?.error ?? this.reportErrorMap[name],
|
|
7454
|
+
updatedAt: this.updatedAtMap[name] ?? 0
|
|
7455
|
+
};
|
|
7456
|
+
});
|
|
7457
|
+
return {
|
|
7458
|
+
components,
|
|
7459
|
+
globalStatus: this.getGlobalStatus(),
|
|
7460
|
+
isReady: this.isReady(),
|
|
7461
|
+
isShuttingDown: this.shuttingDown
|
|
7462
|
+
};
|
|
7463
|
+
}
|
|
7356
7464
|
runTransitions(transitions, prev, next, name) {
|
|
7357
7465
|
for (const {
|
|
7358
7466
|
from,
|
|
@@ -7368,7 +7476,7 @@ var RuntimeStatusMonitor = class extends LoggerStatusReporter {
|
|
|
7368
7476
|
};
|
|
7369
7477
|
|
|
7370
7478
|
// src/test/buildRandomChain.ts
|
|
7371
|
-
import { asAddress as asAddress2, assertEx as
|
|
7479
|
+
import { asAddress as asAddress2, assertEx as assertEx58 } from "@xylabs/sdk-js";
|
|
7372
7480
|
import {
|
|
7373
7481
|
Account as Account4,
|
|
7374
7482
|
asSchema as asSchema9,
|
|
@@ -7387,7 +7495,7 @@ import {
|
|
|
7387
7495
|
} from "@xyo-network/xl1-protocol-lib";
|
|
7388
7496
|
|
|
7389
7497
|
// src/test/buildBlock.ts
|
|
7390
|
-
import { assertEx as
|
|
7498
|
+
import { assertEx as assertEx56, isDefined as isDefined23 } from "@xylabs/sdk-js";
|
|
7391
7499
|
import {
|
|
7392
7500
|
asAnyPayload as asAnyPayload5,
|
|
7393
7501
|
BoundWitnessBuilder as BoundWitnessBuilder4,
|
|
@@ -7470,7 +7578,7 @@ function buildStepHashes(blockNumber, inStepHashes, previousBlockHash, chainStep
|
|
|
7470
7578
|
const completedStepReward = calculateCompletedStepReward(i, stepRewardPoolBalance);
|
|
7471
7579
|
completedStepRewardTransfers.push(createTransferPayload(chainStepRewardAddress2, { [completedStepRewardHolderAddress]: completedStepReward }));
|
|
7472
7580
|
}
|
|
7473
|
-
step_hashes.push(
|
|
7581
|
+
step_hashes.push(assertEx56(previousBlockHash, () => `Previous block hash is required for step ${step} at block ${blockNumber}`));
|
|
7474
7582
|
} else if (isDefined23(inStepHashes.at(i))) {
|
|
7475
7583
|
step_hashes.push(inStepHashes[i]);
|
|
7476
7584
|
}
|
|
@@ -7524,7 +7632,7 @@ async function buildBlock(options) {
|
|
|
7524
7632
|
protocol
|
|
7525
7633
|
}).meta({ $epoch: Date.now(), $signatures: [] }).signers(signers).payloads(await PayloadBuilder25.addStorageMeta(payloads));
|
|
7526
7634
|
const [bw, txPayloads] = await builder.build();
|
|
7527
|
-
|
|
7635
|
+
assertEx56(isBlockBoundWitness(bw), () => "Build of BlockBoundWitness failed");
|
|
7528
7636
|
return [await PayloadBuilder25.addStorageMeta(bw), txPayloads.map((p) => asAnyPayload5(p, true))];
|
|
7529
7637
|
}
|
|
7530
7638
|
|
|
@@ -7545,7 +7653,7 @@ async function buildNextBlock(previousBlock, txs, blockPayloads, signers, chainS
|
|
|
7545
7653
|
}
|
|
7546
7654
|
|
|
7547
7655
|
// src/test/buildRandomGenesisBlock.ts
|
|
7548
|
-
import { asAddress, assertEx as
|
|
7656
|
+
import { asAddress, assertEx as assertEx57 } from "@xylabs/sdk-js";
|
|
7549
7657
|
import {
|
|
7550
7658
|
Account as Account3,
|
|
7551
7659
|
asAnyPayload as asAnyPayload6,
|
|
@@ -7589,7 +7697,7 @@ var buildRandomTransaction = async (chain, payloads, account, nbf = asXL1BlockNu
|
|
|
7589
7697
|
};
|
|
7590
7698
|
|
|
7591
7699
|
// src/test/buildRandomGenesisBlock.ts
|
|
7592
|
-
var TestChainId =
|
|
7700
|
+
var TestChainId = assertEx57(asAddress("c5fe2e6F6841Cbab12d8C0618Be2DF8C6156cC44"));
|
|
7593
7701
|
|
|
7594
7702
|
// src/test/createGenesisBlock.ts
|
|
7595
7703
|
import { PayloadBuilder as PayloadBuilder28 } from "@xyo-network/sdk-js";
|
|
@@ -7644,7 +7752,7 @@ var createGenesisBlock = async (initialBlockProducer, nextContractAddress, genes
|
|
|
7644
7752
|
};
|
|
7645
7753
|
|
|
7646
7754
|
// src/test/buildRandomChain.ts
|
|
7647
|
-
var TestGenesisBlockRewardAddress =
|
|
7755
|
+
var TestGenesisBlockRewardAddress = assertEx58(asAddress2("fa7f0bb865a4bfff3d5e2c726d3e063297014da9"));
|
|
7648
7756
|
var buildRandomChain = async (blockProducer, count = 10, previousBlock, chainId, transactionAccount, receiverAddresses) => {
|
|
7649
7757
|
const chainIdToUse = chainId ?? TestChainId;
|
|
7650
7758
|
const blocks = [];
|
|
@@ -7688,7 +7796,7 @@ var buildRandomChain = async (blockProducer, count = 10, previousBlock, chainId,
|
|
|
7688
7796
|
receiverAddress
|
|
7689
7797
|
));
|
|
7690
7798
|
}
|
|
7691
|
-
const previousBlock2 =
|
|
7799
|
+
const previousBlock2 = assertEx58(lastBlock?.[0], () => new Error("No last block"));
|
|
7692
7800
|
const block = await buildNextBlock(previousBlock2, txs, [], [blockProducer], transactionAccountToUse.address);
|
|
7693
7801
|
blocks.push(block);
|
|
7694
7802
|
remaining = remaining - 1;
|
|
@@ -7749,13 +7857,13 @@ function getTestProviderContext2(config) {
|
|
|
7749
7857
|
}
|
|
7750
7858
|
|
|
7751
7859
|
// src/time/primitives/xl1BlockNumberToEthBlockNumber.ts
|
|
7752
|
-
import { assertEx as
|
|
7860
|
+
import { assertEx as assertEx59 } from "@xylabs/sdk-js";
|
|
7753
7861
|
import { asTimePayload as asTimePayload3, TimeSchema as TimeSchema2 } from "@xyo-network/xl1-protocol-lib";
|
|
7754
7862
|
async function xl1BlockNumberToEthBlockNumber(context, xl1BlockNumber) {
|
|
7755
7863
|
const blockHash = await hashFromBlockNumber(context, xl1BlockNumber);
|
|
7756
7864
|
const hydratedBlock = await hydrateBlock(context, blockHash);
|
|
7757
7865
|
const timePayload = asTimePayload3(hydratedBlock[1].find((p) => p.schema === TimeSchema2), { required: true });
|
|
7758
|
-
return
|
|
7866
|
+
return assertEx59(timePayload.ethereum, () => "No ethereum timestamp found on block");
|
|
7759
7867
|
}
|
|
7760
7868
|
|
|
7761
7869
|
// src/validation/lib/isLocalhost.ts
|
|
@@ -7821,6 +7929,7 @@ export {
|
|
|
7821
7929
|
ConfigZod,
|
|
7822
7930
|
ConnectionConfigZod,
|
|
7823
7931
|
ConnectionsConfigZod,
|
|
7932
|
+
ConsoleSystemStatusPublisher,
|
|
7824
7933
|
CreatableProviderContextZod,
|
|
7825
7934
|
DEFAULT_BACKOFF_MS,
|
|
7826
7935
|
DEFAULT_MAX_ATTEMPTS,
|
|
@@ -7871,8 +7980,6 @@ export {
|
|
|
7871
7980
|
RpcConnectionConfigZod,
|
|
7872
7981
|
RpcRemoteConfigBaseZod,
|
|
7873
7982
|
RpcRemoteConfigZod,
|
|
7874
|
-
RuntimeStatusMonitor,
|
|
7875
|
-
RuntimeStatusMonitorZod,
|
|
7876
7983
|
S3BucketConfigZod,
|
|
7877
7984
|
S3ConnectionConfigZod,
|
|
7878
7985
|
SchemasStepSummarySchema,
|
|
@@ -7891,6 +7998,8 @@ export {
|
|
|
7891
7998
|
SimpleStakeEventsViewer,
|
|
7892
7999
|
SimpleStakeTotalsViewer,
|
|
7893
8000
|
SimpleStakeViewer,
|
|
8001
|
+
SimpleSystemStatusRunner,
|
|
8002
|
+
SimpleSystemStatusViewer,
|
|
7894
8003
|
SimpleTimeSyncViewer,
|
|
7895
8004
|
SimpleTransactionValidationViewer,
|
|
7896
8005
|
SimpleTransactionViewer,
|
|
@@ -7902,6 +8011,7 @@ export {
|
|
|
7902
8011
|
SimpleXyoPermissions,
|
|
7903
8012
|
SimpleXyoRunner,
|
|
7904
8013
|
SimpleXyoSigner,
|
|
8014
|
+
SystemStatusRunnerZod,
|
|
7905
8015
|
TODO,
|
|
7906
8016
|
TestGenesisBlockRewardAddress,
|
|
7907
8017
|
TransactionBuilder,
|