@xyo-network/xl1-protocol-sdk 3.0.5 → 3.0.7
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/Archivists/MemoryArchivistFactory.d.ts +5 -2
- package/dist/neutral/Archivists/MemoryArchivistFactory.d.ts.map +1 -1
- package/dist/neutral/Archivists/archivistFactoryRegistry.d.ts +9 -0
- package/dist/neutral/Archivists/archivistFactoryRegistry.d.ts.map +1 -0
- package/dist/neutral/Archivists/connectArchivist.d.ts +4 -4
- package/dist/neutral/Archivists/connectArchivist.d.ts.map +1 -1
- package/dist/neutral/Archivists/index.d.ts +1 -0
- package/dist/neutral/Archivists/index.d.ts.map +1 -1
- package/dist/neutral/CreatableProvider/AbstractCreatableProvider.d.ts +5 -95
- package/dist/neutral/CreatableProvider/AbstractCreatableProvider.d.ts.map +1 -1
- package/dist/neutral/config/Actor.d.ts +30 -573
- package/dist/neutral/config/Actor.d.ts.map +1 -1
- package/dist/neutral/config/Actors.d.ts +5 -98
- package/dist/neutral/config/Actors.d.ts.map +1 -1
- package/dist/neutral/config/Base.d.ts +5 -98
- package/dist/neutral/config/Base.d.ts.map +1 -1
- package/dist/neutral/config/Config.d.ts +20 -386
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/HostActor.d.ts +30 -573
- package/dist/neutral/config/HostActor.d.ts.map +1 -1
- package/dist/neutral/config/index.d.ts +2 -4
- package/dist/neutral/config/index.d.ts.map +1 -1
- package/dist/neutral/config/normalizeConnectionsConfig.d.ts +2 -5
- package/dist/neutral/config/normalizeConnectionsConfig.d.ts.map +1 -1
- package/dist/neutral/config/synthesizeRpcConnectionBindings.d.ts +8 -0
- package/dist/neutral/config/synthesizeRpcConnectionBindings.d.ts.map +1 -0
- package/dist/neutral/config/transports/Mongo.d.ts +12 -0
- package/dist/neutral/config/transports/Mongo.d.ts.map +1 -0
- package/dist/neutral/config/{Remote.d.ts → transports/Rpc.d.ts} +1 -14
- package/dist/neutral/config/transports/Rpc.d.ts.map +1 -0
- package/dist/neutral/config/transports/S3.d.ts +19 -0
- package/dist/neutral/config/transports/S3.d.ts.map +1 -0
- package/dist/neutral/config/transports/Transport.d.ts +15 -6
- package/dist/neutral/config/transports/Transport.d.ts.map +1 -1
- package/dist/neutral/config/transports/index.d.ts +3 -0
- package/dist/neutral/config/transports/index.d.ts.map +1 -1
- package/dist/neutral/context/Actor.d.ts +30 -573
- package/dist/neutral/context/Actor.d.ts.map +1 -1
- package/dist/neutral/context/HostActor.d.ts +30 -573
- package/dist/neutral/context/HostActor.d.ts.map +1 -1
- package/dist/neutral/context/index.d.ts +0 -1
- package/dist/neutral/context/index.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.d.ts +10 -190
- package/dist/neutral/getFileConfig.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.mjs +133 -199
- package/dist/neutral/getFileConfig.mjs.map +4 -4
- package/dist/neutral/index.mjs +357 -593
- package/dist/neutral/index.mjs.map +4 -4
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts +30 -573
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts.map +1 -1
- package/dist/neutral/simple/mempool/SimpleMempoolRunner.d.ts +1 -1
- package/dist/neutral/test/index.mjs +167 -226
- package/dist/neutral/test/index.mjs.map +4 -4
- package/package.json +13 -13
- package/dist/neutral/config/Evm.d.ts +0 -24
- package/dist/neutral/config/Evm.d.ts.map +0 -1
- package/dist/neutral/config/Remote.d.ts.map +0 -1
- package/dist/neutral/config/adaptLegacyConfig.d.ts +0 -8
- package/dist/neutral/config/adaptLegacyConfig.d.ts.map +0 -1
- package/dist/neutral/config/storage/Storage.d.ts +0 -45
- package/dist/neutral/config/storage/Storage.d.ts.map +0 -1
- package/dist/neutral/config/storage/driver/Mongo.d.ts +0 -25
- package/dist/neutral/config/storage/driver/Mongo.d.ts.map +0 -1
- package/dist/neutral/config/storage/driver/S3.d.ts +0 -77
- package/dist/neutral/config/storage/driver/S3.d.ts.map +0 -1
- package/dist/neutral/config/storage/driver/index.d.ts +0 -3
- package/dist/neutral/config/storage/driver/index.d.ts.map +0 -1
- package/dist/neutral/config/storage/index.d.ts +0 -3
- package/dist/neutral/config/storage/index.d.ts.map +0 -1
- package/dist/neutral/context/getEmptyProviderContext.d.ts +0 -7
- package/dist/neutral/context/getEmptyProviderContext.d.ts.map +0 -1
package/dist/neutral/index.mjs
CHANGED
|
@@ -216,13 +216,6 @@ var ArchivistInstanceCache = class {
|
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
// src/Archivists/archivistRoles.ts
|
|
220
|
-
var CHAIN_ARCHIVIST_ROLE = "chain";
|
|
221
|
-
var PENDING_TRANSACTIONS_ARCHIVIST_ROLE = "pending-transactions";
|
|
222
|
-
var PENDING_BLOCKS_ARCHIVIST_ROLE = "pending-blocks";
|
|
223
|
-
var REJECTED_BLOCKS_ARCHIVIST_ROLE = "rejected-blocks";
|
|
224
|
-
var REJECTED_TRANSACTIONS_ARCHIVIST_ROLE = "rejected-transactions";
|
|
225
|
-
|
|
226
219
|
// src/Archivists/MemoryArchivistFactory.ts
|
|
227
220
|
import { MemoryArchivist } from "@xyo-network/sdk-js";
|
|
228
221
|
var MemoryArchivistFactory = class _MemoryArchivistFactory {
|
|
@@ -243,16 +236,34 @@ var MemoryArchivistFactory = class _MemoryArchivistFactory {
|
|
|
243
236
|
}
|
|
244
237
|
};
|
|
245
238
|
|
|
239
|
+
// src/Archivists/archivistFactoryRegistry.ts
|
|
240
|
+
var registry = /* @__PURE__ */ new Map();
|
|
241
|
+
function registerArchivistFactory(type, factory) {
|
|
242
|
+
registry.set(type, factory);
|
|
243
|
+
}
|
|
244
|
+
function getArchivistFactory(type) {
|
|
245
|
+
return registry.get(type);
|
|
246
|
+
}
|
|
247
|
+
registerArchivistFactory("memory", MemoryArchivistFactory);
|
|
248
|
+
function resetArchivistFactories() {
|
|
249
|
+
registry.clear();
|
|
250
|
+
registerArchivistFactory("memory", MemoryArchivistFactory);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// src/Archivists/archivistRoles.ts
|
|
254
|
+
var CHAIN_ARCHIVIST_ROLE = "chain";
|
|
255
|
+
var PENDING_TRANSACTIONS_ARCHIVIST_ROLE = "pending-transactions";
|
|
256
|
+
var PENDING_BLOCKS_ARCHIVIST_ROLE = "pending-blocks";
|
|
257
|
+
var REJECTED_BLOCKS_ARCHIVIST_ROLE = "rejected-blocks";
|
|
258
|
+
var REJECTED_TRANSACTIONS_ARCHIVIST_ROLE = "rejected-transactions";
|
|
259
|
+
|
|
246
260
|
// src/Archivists/connectArchivist.ts
|
|
247
261
|
async function connectArchivist(binding, options) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
default: {
|
|
253
|
-
throw new Error(`connectArchivist: connection type '${binding.config.type}' is not self-provisioned \u2014 inject the archivist instead`);
|
|
254
|
-
}
|
|
262
|
+
const factory = getArchivistFactory(binding.config.type);
|
|
263
|
+
if (factory === void 0) {
|
|
264
|
+
throw new Error(`connectArchivist: no archivist factory registered for connection type '${binding.config.type}'`);
|
|
255
265
|
}
|
|
266
|
+
return await factory.connect(binding.name, binding.config, options);
|
|
256
267
|
}
|
|
257
268
|
|
|
258
269
|
// src/block/hydrate/allHashesPresent.ts
|
|
@@ -1109,9 +1120,6 @@ function factoryBackingsCompatible(declared, available) {
|
|
|
1109
1120
|
}
|
|
1110
1121
|
|
|
1111
1122
|
// src/config/normalizeConnectionsConfig.ts
|
|
1112
|
-
function mergeConnectionMaps(transports, connections) {
|
|
1113
|
-
return { ...transports, ...connections };
|
|
1114
|
-
}
|
|
1115
1123
|
function normalizeProviderBinding(binding) {
|
|
1116
1124
|
const connectionName = binding.connection ?? binding.transport;
|
|
1117
1125
|
if (connectionName === void 0 || connectionName === "") {
|
|
@@ -1132,18 +1140,14 @@ function normalizeProviderBindings(bindings) {
|
|
|
1132
1140
|
return normalized;
|
|
1133
1141
|
}
|
|
1134
1142
|
function normalizeConnectionsConfig(config) {
|
|
1135
|
-
const transports = config.transports ?? {};
|
|
1136
|
-
const connections = config.connections ?? {};
|
|
1137
|
-
const merged = mergeConnectionMaps(transports, connections);
|
|
1138
1143
|
return {
|
|
1139
1144
|
...config,
|
|
1140
|
-
connections:
|
|
1141
|
-
providerBindings: normalizeProviderBindings(config.providerBindings ?? {})
|
|
1142
|
-
transports: merged
|
|
1145
|
+
connections: config.connections ?? {},
|
|
1146
|
+
providerBindings: normalizeProviderBindings(config.providerBindings ?? {})
|
|
1143
1147
|
};
|
|
1144
1148
|
}
|
|
1145
1149
|
function hasDeclaredConnectionProfiles(config) {
|
|
1146
|
-
return Object.keys(config.
|
|
1150
|
+
return Object.keys(config.connections ?? {}).length > 0;
|
|
1147
1151
|
}
|
|
1148
1152
|
|
|
1149
1153
|
// src/CreatableProvider/ProviderFactoryLocator.ts
|
|
@@ -1265,7 +1269,7 @@ var buildProviderFactory = (provider, defaultParams, labels) => {
|
|
|
1265
1269
|
};
|
|
1266
1270
|
return factory;
|
|
1267
1271
|
};
|
|
1268
|
-
var registerCreatableProviderFactory = (
|
|
1272
|
+
var registerCreatableProviderFactory = (registry2, factory, labels, primary = false) => {
|
|
1269
1273
|
const primaryMonikers = primary !== true && isTruthy(primary) ? Array.isArray(primary) ? primary : [primary] : [];
|
|
1270
1274
|
for (const primaryMoniker of primaryMonikers) {
|
|
1271
1275
|
if (!factory.monikers.includes(primaryMoniker)) {
|
|
@@ -1289,17 +1293,17 @@ var registerCreatableProviderFactory = (registry, factory, labels, primary = fal
|
|
|
1289
1293
|
throw new Error(`Invalid primary value: ${String(primary)}`);
|
|
1290
1294
|
};
|
|
1291
1295
|
const factoryClone = buildProviderFactory(factory, factory.defaultParams, labels);
|
|
1292
|
-
|
|
1296
|
+
registry2[factoryClone.defaultMoniker] = [factoryClone, ...registry2[factoryClone.defaultMoniker] ?? []];
|
|
1293
1297
|
for (const moniker of factoryClone.monikers) {
|
|
1294
1298
|
if (moniker === factoryClone.defaultMoniker) continue;
|
|
1295
|
-
|
|
1299
|
+
registry2[moniker] = isPrimaryForMoniker(moniker) ? [factoryClone, ...registry2[moniker] ?? []] : [...registry2[moniker] ?? [], factoryClone];
|
|
1296
1300
|
}
|
|
1297
1301
|
};
|
|
1298
|
-
var registerCreatableProviderFactories = (factories,
|
|
1302
|
+
var registerCreatableProviderFactories = (factories, registry2 = {}, primary = false) => {
|
|
1299
1303
|
for (const factory of factories) {
|
|
1300
|
-
registerCreatableProviderFactory(
|
|
1304
|
+
registerCreatableProviderFactory(registry2, factory, void 0, primary);
|
|
1301
1305
|
}
|
|
1302
|
-
return
|
|
1306
|
+
return registry2;
|
|
1303
1307
|
};
|
|
1304
1308
|
|
|
1305
1309
|
// src/CreatableProvider/LabeledCreatableProviderFactory.ts
|
|
@@ -1319,8 +1323,8 @@ var ProviderFactoryLocator = class _ProviderFactoryLocator {
|
|
|
1319
1323
|
_frozen = false;
|
|
1320
1324
|
_parent;
|
|
1321
1325
|
_validateDepsOnRegister;
|
|
1322
|
-
constructor(context,
|
|
1323
|
-
this._registry =
|
|
1326
|
+
constructor(context, registry2 = {}, validateDepsOnRegister = false) {
|
|
1327
|
+
this._registry = registry2;
|
|
1324
1328
|
this._context = { ...context, locator: this };
|
|
1325
1329
|
this._parent = context.locator;
|
|
1326
1330
|
this._validateDepsOnRegister = validateDepsOnRegister;
|
|
@@ -1365,16 +1369,16 @@ var ProviderFactoryLocator = class _ProviderFactoryLocator {
|
|
|
1365
1369
|
);
|
|
1366
1370
|
}
|
|
1367
1371
|
merge(locator) {
|
|
1368
|
-
const
|
|
1372
|
+
const registry2 = { ...this.registry };
|
|
1369
1373
|
for (const moniker in locator.registry) {
|
|
1370
|
-
const existing =
|
|
1374
|
+
const existing = registry2[moniker];
|
|
1371
1375
|
if (existing === void 0) {
|
|
1372
|
-
|
|
1376
|
+
registry2[moniker] = locator.registry[moniker];
|
|
1373
1377
|
} else {
|
|
1374
1378
|
existing.push(...locator.registry[moniker] ?? []);
|
|
1375
1379
|
}
|
|
1376
1380
|
}
|
|
1377
|
-
return new _ProviderFactoryLocator(this.context,
|
|
1381
|
+
return new _ProviderFactoryLocator(this.context, registry2);
|
|
1378
1382
|
}
|
|
1379
1383
|
/**
|
|
1380
1384
|
* Registers a single module factory (with optional tags) with the locator
|
|
@@ -1703,10 +1707,10 @@ import {
|
|
|
1703
1707
|
zodIsFactory as zodIsFactory2,
|
|
1704
1708
|
zodToFactory as zodToFactory2
|
|
1705
1709
|
} from "@xylabs/sdk-js";
|
|
1706
|
-
import { globalRegistry as
|
|
1710
|
+
import { globalRegistry as globalRegistry11, z as z17 } from "zod/mini";
|
|
1707
1711
|
|
|
1708
1712
|
// src/config/Base.ts
|
|
1709
|
-
import { z as
|
|
1713
|
+
import { z as z16 } from "zod/mini";
|
|
1710
1714
|
|
|
1711
1715
|
// src/config/Chain.ts
|
|
1712
1716
|
import { HexZod } from "@xylabs/sdk-js";
|
|
@@ -1726,172 +1730,129 @@ var ChainConfigZod = z2.object({
|
|
|
1726
1730
|
});
|
|
1727
1731
|
|
|
1728
1732
|
// src/config/transports/Transport.ts
|
|
1729
|
-
import { globalRegistry as
|
|
1733
|
+
import { globalRegistry as globalRegistry3, z as z5 } from "zod";
|
|
1730
1734
|
|
|
1731
|
-
// src/config/
|
|
1735
|
+
// src/config/transports/Mongo.ts
|
|
1732
1736
|
import { globalRegistry as globalRegistry2, z as z3 } from "zod";
|
|
1733
|
-
var
|
|
1734
|
-
protocol: z3.string("http").register(globalRegistry2, {
|
|
1735
|
-
description: "Protocol for the RPC connection",
|
|
1736
|
-
type: "string"
|
|
1737
|
-
})
|
|
1738
|
-
}).describe("Base configuration for the remote RPC");
|
|
1739
|
-
var HttpRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
1740
|
-
protocol: z3.string("http").register(globalRegistry2, {
|
|
1741
|
-
description: "Protocol for the RPC connection",
|
|
1742
|
-
type: "string"
|
|
1743
|
-
}).default("http"),
|
|
1744
|
-
url: z3.string().register(globalRegistry2, {
|
|
1745
|
-
description: "URL for the Chain RPC API",
|
|
1746
|
-
type: "string"
|
|
1747
|
-
})
|
|
1748
|
-
}).describe("Configuration for the remote RPC using Http");
|
|
1749
|
-
var PostMessageRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
1750
|
-
protocol: z3.string().register(globalRegistry2, {
|
|
1751
|
-
description: "Protocol for the RPC connection",
|
|
1752
|
-
type: "string"
|
|
1753
|
-
}).default("postMessage"),
|
|
1754
|
-
networkId: z3.string().register(globalRegistry2, {
|
|
1755
|
-
description: "Network ID to use for the postMessage RPC connection",
|
|
1756
|
-
type: "string"
|
|
1757
|
-
}),
|
|
1758
|
-
sessionId: z3.string().register(globalRegistry2, {
|
|
1759
|
-
description: "Session ID to use for the postMessage RPC connection",
|
|
1760
|
-
type: "string"
|
|
1761
|
-
})
|
|
1762
|
-
}).describe("Configuration for the remote RPC using postMessage");
|
|
1763
|
-
var RpcRemoteConfigZod = z3.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod]).describe("Configuration for a remote RPC connection, either Http or postMessage");
|
|
1764
|
-
var RemoteConfigZod = z3.object({ rpc: RpcRemoteConfigZod.optional() }).describe("Configuration for remote connections, including RPC");
|
|
1765
|
-
|
|
1766
|
-
// src/config/storage/driver/Mongo.ts
|
|
1767
|
-
import { isDefined as isDefined5, isUndefined as isUndefined5 } from "@xylabs/sdk-js";
|
|
1768
|
-
import { globalRegistry as globalRegistry3, z as z4 } from "zod";
|
|
1769
|
-
var hasMongoConfig = (config) => {
|
|
1770
|
-
if (isUndefined5(config)) return false;
|
|
1771
|
-
return isDefined5(config.connectionString) && isDefined5(config.database) && isDefined5(config.domain);
|
|
1772
|
-
};
|
|
1773
|
-
var MongoConfigZod = z4.object({
|
|
1737
|
+
var MongoConfigZod = z3.object({
|
|
1774
1738
|
// TODO: Create from other arguments
|
|
1775
|
-
connectionString:
|
|
1739
|
+
connectionString: z3.string().nonempty().optional().register(globalRegistry2, {
|
|
1776
1740
|
description: "MongoDB connection string",
|
|
1777
1741
|
title: "storage.mongo.connectionString",
|
|
1778
1742
|
type: "string"
|
|
1779
1743
|
}),
|
|
1780
|
-
database:
|
|
1744
|
+
database: z3.string().nonempty().optional().register(globalRegistry2, {
|
|
1781
1745
|
description: "MongoDB database name",
|
|
1782
1746
|
title: "storage.mongo.database",
|
|
1783
1747
|
type: "string"
|
|
1784
1748
|
}),
|
|
1785
|
-
domain:
|
|
1749
|
+
domain: z3.string().nonempty().optional().register(globalRegistry2, {
|
|
1786
1750
|
description: "MongoDB domain",
|
|
1787
1751
|
title: "storage.mongo.domain",
|
|
1788
1752
|
type: "string"
|
|
1789
1753
|
}),
|
|
1790
|
-
password:
|
|
1754
|
+
password: z3.string().nonempty().optional().register(globalRegistry2, {
|
|
1791
1755
|
description: "MongoDB password",
|
|
1792
1756
|
title: "storage.mongo.password",
|
|
1793
1757
|
type: "string"
|
|
1794
1758
|
}),
|
|
1795
|
-
username:
|
|
1759
|
+
username: z3.string().nonempty().optional().register(globalRegistry2, {
|
|
1796
1760
|
description: "MongoDB username",
|
|
1797
1761
|
title: "storage.mongo.username",
|
|
1798
1762
|
type: "string"
|
|
1799
1763
|
})
|
|
1800
1764
|
});
|
|
1801
1765
|
|
|
1802
|
-
// src/config/
|
|
1803
|
-
import {
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
secretAccessKey: z5.string().nonempty().optional().describe("S3-compatible secret access key for this bucket (overrides the shared default)")
|
|
1766
|
+
// src/config/transports/S3.ts
|
|
1767
|
+
import { z as z4 } from "zod";
|
|
1768
|
+
var S3BucketConfigZod = z4.object({
|
|
1769
|
+
accessKeyId: z4.string().nonempty().optional().describe("S3-compatible access key id for this bucket (overrides the shared default)"),
|
|
1770
|
+
accountId: z4.string().nonempty().optional().describe("Account id for this bucket; on Cloudflare R2 it forms the endpoint (overrides the shared default)"),
|
|
1771
|
+
bucket: z4.string().nonempty().optional().describe("S3-compatible bucket name"),
|
|
1772
|
+
prefix: z4.string().nonempty().optional().describe("Optional key prefix within the bucket"),
|
|
1773
|
+
readUrl: z4.string().nonempty().optional().describe("Public HTTP/CDN base URL for anonymous reads of this bucket"),
|
|
1774
|
+
secretAccessKey: z4.string().nonempty().optional().describe("S3-compatible secret access key for this bucket (overrides the shared default)")
|
|
1812
1775
|
});
|
|
1813
|
-
var S3ConfigZod = z5.object({
|
|
1814
|
-
accessKeyId: z5.string().nonempty().optional().describe("Shared S3-compatible access key id (default for all buckets)"),
|
|
1815
|
-
accountId: z5.string().nonempty().optional().describe("Shared account id (default for all buckets; on Cloudflare R2 it forms the endpoint)"),
|
|
1816
|
-
chainState: S3BucketConfigZod.optional().describe("Bucket for the mutable chain state (the head pointer)"),
|
|
1817
|
-
finalized: S3BucketConfigZod.optional().describe("Bucket for the finalized files (blocks, payloads, manifest)"),
|
|
1818
|
-
index: S3BucketConfigZod.optional().describe("Bucket for the chain index (the step-summary families)"),
|
|
1819
|
-
prefix: z5.string().nonempty().optional().describe("Shared key prefix (default for all buckets)"),
|
|
1820
|
-
secretAccessKey: z5.string().nonempty().optional().describe("Shared S3-compatible secret access key (default for all buckets)")
|
|
1821
|
-
});
|
|
1822
|
-
function resolveS3Bucket(config, which) {
|
|
1823
|
-
if (config === void 0) return void 0;
|
|
1824
|
-
const entry = config[which];
|
|
1825
|
-
const accessKeyId = entry?.accessKeyId ?? config.accessKeyId;
|
|
1826
|
-
const accountId = entry?.accountId ?? config.accountId;
|
|
1827
|
-
const secretAccessKey = entry?.secretAccessKey ?? config.secretAccessKey;
|
|
1828
|
-
const bucket = entry?.bucket ?? config.finalized?.bucket;
|
|
1829
|
-
if (!isDefined6(accessKeyId) || !isDefined6(accountId) || !isDefined6(secretAccessKey) || !isDefined6(bucket)) return void 0;
|
|
1830
|
-
return {
|
|
1831
|
-
accessKeyId,
|
|
1832
|
-
accountId,
|
|
1833
|
-
bucket,
|
|
1834
|
-
prefix: entry?.prefix ?? config.prefix,
|
|
1835
|
-
readUrl: entry?.readUrl,
|
|
1836
|
-
secretAccessKey
|
|
1837
|
-
};
|
|
1838
|
-
}
|
|
1839
|
-
function hasS3Config(config, which = "finalized") {
|
|
1840
|
-
return resolveS3Bucket(config, which) !== void 0;
|
|
1841
|
-
}
|
|
1842
1776
|
|
|
1843
1777
|
// src/config/transports/Transport.ts
|
|
1844
|
-
var LmdbTransportConfigZod =
|
|
1845
|
-
access:
|
|
1778
|
+
var LmdbTransportConfigZod = z5.object({
|
|
1779
|
+
access: z5.enum(["read", "write"]).optional().register(globalRegistry3, {
|
|
1846
1780
|
description: "Access mode for this LMDB connection (read or write)",
|
|
1847
1781
|
title: "transports.lmdb.access",
|
|
1848
1782
|
type: "string"
|
|
1849
1783
|
}),
|
|
1850
|
-
root:
|
|
1784
|
+
root: z5.string().register(globalRegistry3, {
|
|
1851
1785
|
description: "Root directory for local LMDB storage",
|
|
1852
1786
|
title: "transports.lmdb.root",
|
|
1853
1787
|
type: "string"
|
|
1854
1788
|
}),
|
|
1855
|
-
store:
|
|
1789
|
+
store: z5.string().optional().register(globalRegistry3, {
|
|
1856
1790
|
description: "Logical store name within the LMDB root (e.g. finalized-chain, mempool)",
|
|
1857
1791
|
title: "transports.lmdb.store",
|
|
1858
1792
|
type: "string"
|
|
1859
1793
|
}),
|
|
1860
|
-
type:
|
|
1794
|
+
type: z5.literal("lmdb")
|
|
1861
1795
|
}).describe("LMDB local storage transport");
|
|
1862
|
-
var MongoTransportConfigZod =
|
|
1863
|
-
type:
|
|
1796
|
+
var MongoTransportConfigZod = z5.object({
|
|
1797
|
+
type: z5.literal("mongo"),
|
|
1864
1798
|
connectionString: MongoConfigZod.shape.connectionString,
|
|
1865
1799
|
database: MongoConfigZod.shape.database,
|
|
1866
1800
|
domain: MongoConfigZod.shape.domain,
|
|
1867
1801
|
password: MongoConfigZod.shape.password,
|
|
1868
1802
|
username: MongoConfigZod.shape.username
|
|
1869
1803
|
}).describe("MongoDB storage transport");
|
|
1870
|
-
var RpcTransportConfigZod =
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1804
|
+
var RpcTransportConfigZod = z5.object({
|
|
1805
|
+
type: z5.literal("rpc"),
|
|
1806
|
+
protocol: z5.string().default("http").register(globalRegistry3, {
|
|
1807
|
+
description: "Protocol for the RPC connection (http or postMessage)",
|
|
1808
|
+
title: "transports.rpc.protocol",
|
|
1809
|
+
type: "string"
|
|
1810
|
+
}),
|
|
1811
|
+
url: z5.string().optional().register(globalRegistry3, {
|
|
1812
|
+
description: "URL for the Chain RPC API (http protocol)",
|
|
1813
|
+
title: "transports.rpc.url",
|
|
1814
|
+
type: "string"
|
|
1815
|
+
}),
|
|
1816
|
+
networkId: z5.string().optional().register(globalRegistry3, {
|
|
1817
|
+
description: "Network ID for the postMessage RPC connection",
|
|
1818
|
+
title: "transports.rpc.networkId",
|
|
1819
|
+
type: "string"
|
|
1820
|
+
}),
|
|
1821
|
+
sessionId: z5.string().optional().register(globalRegistry3, {
|
|
1822
|
+
description: "Session ID for the postMessage RPC connection",
|
|
1823
|
+
title: "transports.rpc.sessionId",
|
|
1824
|
+
type: "string"
|
|
1825
|
+
})
|
|
1826
|
+
}).describe("XL1 JSON-RPC transport");
|
|
1827
|
+
var RestTransportConfigZod = z5.object({
|
|
1828
|
+
type: z5.literal("rest"),
|
|
1829
|
+
baseUrl: z5.string().register(globalRegistry3, {
|
|
1874
1830
|
description: "HTTP base URL for REST reads",
|
|
1875
1831
|
title: "transports.rest.baseUrl",
|
|
1876
1832
|
type: "string"
|
|
1877
1833
|
})
|
|
1878
1834
|
}).describe("HTTP REST read transport");
|
|
1879
1835
|
var S3TransportConfigZod = S3BucketConfigZod.extend({
|
|
1880
|
-
type:
|
|
1881
|
-
accessKeyId:
|
|
1882
|
-
accountId:
|
|
1883
|
-
secretAccessKey:
|
|
1836
|
+
type: z5.literal("s3"),
|
|
1837
|
+
accessKeyId: z5.string().optional(),
|
|
1838
|
+
accountId: z5.string().optional(),
|
|
1839
|
+
secretAccessKey: z5.string().optional()
|
|
1884
1840
|
}).describe("S3-compatible object storage transport");
|
|
1885
|
-
var EvmRpcTransportConfigZod =
|
|
1886
|
-
type:
|
|
1887
|
-
url:
|
|
1841
|
+
var EvmRpcTransportConfigZod = z5.object({
|
|
1842
|
+
type: z5.literal("evm-rpc"),
|
|
1843
|
+
url: z5.string().register(globalRegistry3, {
|
|
1888
1844
|
description: "EVM JSON-RPC URL",
|
|
1889
1845
|
title: "transports.evm-rpc.url",
|
|
1890
1846
|
type: "string"
|
|
1847
|
+
}),
|
|
1848
|
+
chainId: z5.string().optional().register(globalRegistry3, {
|
|
1849
|
+
description: "EVM chain ID for this RPC endpoint; auto-detected from the endpoint when omitted",
|
|
1850
|
+
title: "transports.evm-rpc.chainId",
|
|
1851
|
+
type: "string"
|
|
1891
1852
|
})
|
|
1892
1853
|
}).describe("EVM JSON-RPC transport");
|
|
1893
|
-
var MemoryTransportConfigZod =
|
|
1894
|
-
var TransportConfigZod =
|
|
1854
|
+
var MemoryTransportConfigZod = z5.object({ type: z5.literal("memory") }).describe("In-process memory transport");
|
|
1855
|
+
var TransportConfigZod = z5.discriminatedUnion("type", [
|
|
1895
1856
|
LmdbTransportConfigZod,
|
|
1896
1857
|
MongoTransportConfigZod,
|
|
1897
1858
|
RpcTransportConfigZod,
|
|
@@ -1900,18 +1861,18 @@ var TransportConfigZod = z6.discriminatedUnion("type", [
|
|
|
1900
1861
|
EvmRpcTransportConfigZod,
|
|
1901
1862
|
MemoryTransportConfigZod
|
|
1902
1863
|
]);
|
|
1903
|
-
var TransportsConfigZod =
|
|
1864
|
+
var TransportsConfigZod = z5.record(z5.string(), TransportConfigZod).default({});
|
|
1904
1865
|
|
|
1905
1866
|
// src/config/DataLake/DataLake.ts
|
|
1906
|
-
import { z as
|
|
1867
|
+
import { z as z9 } from "zod";
|
|
1907
1868
|
|
|
1908
1869
|
// src/config/DataLake/RestDataLakeConfig.ts
|
|
1909
|
-
import { globalRegistry as
|
|
1870
|
+
import { globalRegistry as globalRegistry5, z as z7 } from "zod";
|
|
1910
1871
|
|
|
1911
1872
|
// src/config/DataLake/DataLakeRemoteConfig.ts
|
|
1912
|
-
import { globalRegistry as
|
|
1913
|
-
var DataLakeDriverConfigBaseZod =
|
|
1914
|
-
driver:
|
|
1873
|
+
import { globalRegistry as globalRegistry4, z as z6 } from "zod";
|
|
1874
|
+
var DataLakeDriverConfigBaseZod = z6.object({
|
|
1875
|
+
driver: z6.string().register(globalRegistry4, {
|
|
1915
1876
|
description: "Driver for the data lake",
|
|
1916
1877
|
type: "string"
|
|
1917
1878
|
})
|
|
@@ -1919,76 +1880,45 @@ var DataLakeDriverConfigBaseZod = z7.object({
|
|
|
1919
1880
|
|
|
1920
1881
|
// src/config/DataLake/RestDataLakeConfig.ts
|
|
1921
1882
|
var RestDataLakeConfigZod = DataLakeDriverConfigBaseZod.extend({
|
|
1922
|
-
driver:
|
|
1883
|
+
driver: z7.literal("rest").register(globalRegistry5, {
|
|
1923
1884
|
description: "Driver for the REST data lake",
|
|
1924
1885
|
type: "string"
|
|
1925
1886
|
}),
|
|
1926
|
-
url:
|
|
1887
|
+
url: z7.string().register(globalRegistry5, {
|
|
1927
1888
|
description: "URL for the REST data lake",
|
|
1928
1889
|
type: "string"
|
|
1929
1890
|
})
|
|
1930
1891
|
}).describe("Configuration for the REST data lake driver");
|
|
1931
1892
|
|
|
1932
1893
|
// src/config/DataLake/RouterDataLakeConfig.ts
|
|
1933
|
-
import { globalRegistry as
|
|
1934
|
-
var RouterDataLakeConfigZod =
|
|
1935
|
-
driver:
|
|
1894
|
+
import { globalRegistry as globalRegistry6, z as z8 } from "zod";
|
|
1895
|
+
var RouterDataLakeConfigZod = z8.object({
|
|
1896
|
+
driver: z8.literal("router").register(globalRegistry6, {
|
|
1936
1897
|
description: "Driver for the router data lake",
|
|
1937
1898
|
type: "string"
|
|
1938
1899
|
}),
|
|
1939
|
-
children:
|
|
1900
|
+
children: z8.array(z8.lazy(() => DataLakeConfigZod)).register(globalRegistry6, {
|
|
1940
1901
|
description: "Child data lake drivers",
|
|
1941
1902
|
type: "array"
|
|
1942
1903
|
})
|
|
1943
1904
|
}).describe("Configuration for the router data lake driver");
|
|
1944
1905
|
|
|
1945
1906
|
// src/config/DataLake/DataLake.ts
|
|
1946
|
-
var DataLakeConfigZod =
|
|
1947
|
-
|
|
1948
|
-
// src/config/Evm.ts
|
|
1949
|
-
import { globalRegistry as globalRegistry8, z as z11 } from "zod";
|
|
1950
|
-
var EvmInfuraConfigZod = z11.object({
|
|
1951
|
-
projectId: z11.string().optional().register(globalRegistry8, {
|
|
1952
|
-
description: "Infura project ID",
|
|
1953
|
-
title: "evm.infura.projectId",
|
|
1954
|
-
type: "string"
|
|
1955
|
-
}),
|
|
1956
|
-
projectSecret: z11.string().optional().register(globalRegistry8, {
|
|
1957
|
-
description: "Infura project secret",
|
|
1958
|
-
title: "evm.infura.projectSecret",
|
|
1959
|
-
type: "string"
|
|
1960
|
-
})
|
|
1961
|
-
});
|
|
1962
|
-
var EvmJsonRpcConfigZod = z11.object({
|
|
1963
|
-
url: z11.url().optional().register(globalRegistry8, {
|
|
1964
|
-
description: "JSON-RPC URL",
|
|
1965
|
-
title: "evm.jsonRpc.url",
|
|
1966
|
-
type: "string"
|
|
1967
|
-
})
|
|
1968
|
-
});
|
|
1969
|
-
var EvmConfigZod = z11.object({
|
|
1970
|
-
chainId: z11.string().optional().register(globalRegistry8, {
|
|
1971
|
-
description: "EVM chain ID",
|
|
1972
|
-
title: "evm.chainId",
|
|
1973
|
-
type: "string"
|
|
1974
|
-
}),
|
|
1975
|
-
infura: EvmInfuraConfigZod.optional().describe("Infura Provider configuration"),
|
|
1976
|
-
jsonRpc: EvmJsonRpcConfigZod.optional().describe("JSON-RPC Provider configuration")
|
|
1977
|
-
});
|
|
1907
|
+
var DataLakeConfigZod = z9.lazy(() => z9.union([RestDataLakeConfigZod, RouterDataLakeConfigZod])).describe("Configuration for a data lake");
|
|
1978
1908
|
|
|
1979
1909
|
// src/config/Log.ts
|
|
1980
1910
|
import { LogLevel } from "@xylabs/sdk-js";
|
|
1981
|
-
import { globalRegistry as
|
|
1911
|
+
import { globalRegistry as globalRegistry7, z as z10 } from "zod";
|
|
1982
1912
|
var LogLevelNames = Object.keys(LogLevel);
|
|
1983
|
-
var LogConfigZod =
|
|
1984
|
-
logLevel:
|
|
1913
|
+
var LogConfigZod = z10.object({
|
|
1914
|
+
logLevel: z10.enum(LogLevelNames).default("info").register(globalRegistry7, {
|
|
1985
1915
|
choices: LogLevelNames,
|
|
1986
1916
|
default: "info",
|
|
1987
1917
|
description: "Desired process verbosity",
|
|
1988
1918
|
title: "logLevel",
|
|
1989
1919
|
type: "string"
|
|
1990
1920
|
}),
|
|
1991
|
-
silent:
|
|
1921
|
+
silent: z10.boolean().default(false).register(globalRegistry7, {
|
|
1992
1922
|
default: false,
|
|
1993
1923
|
description: "Whether to run in silent mode",
|
|
1994
1924
|
title: "silent",
|
|
@@ -1997,23 +1927,23 @@ var LogConfigZod = z12.object({
|
|
|
1997
1927
|
});
|
|
1998
1928
|
|
|
1999
1929
|
// src/config/ProviderBinding.ts
|
|
2000
|
-
import { globalRegistry as
|
|
2001
|
-
var ProviderBindingConfigZod =
|
|
2002
|
-
connection:
|
|
1930
|
+
import { globalRegistry as globalRegistry8, z as z11 } from "zod";
|
|
1931
|
+
var ProviderBindingConfigZod = z11.object({
|
|
1932
|
+
connection: z11.string().optional().register(globalRegistry8, {
|
|
2003
1933
|
description: "Named connection from the top-level connections map",
|
|
2004
1934
|
title: "providerBindings.connection",
|
|
2005
1935
|
type: "string"
|
|
2006
1936
|
}),
|
|
2007
|
-
transport:
|
|
1937
|
+
transport: z11.string().optional().register(globalRegistry8, {
|
|
2008
1938
|
description: "Deprecated alias for connection (kept in sync during migration)",
|
|
2009
1939
|
title: "providerBindings.transport",
|
|
2010
1940
|
type: "string"
|
|
2011
1941
|
})
|
|
2012
1942
|
}).describe("Provider connection binding");
|
|
2013
|
-
var ProviderBindingsConfigZod =
|
|
1943
|
+
var ProviderBindingsConfigZod = z11.record(z11.string(), ProviderBindingConfigZod).default({});
|
|
2014
1944
|
|
|
2015
1945
|
// src/config/Providers.ts
|
|
2016
|
-
import
|
|
1946
|
+
import z13 from "zod";
|
|
2017
1947
|
|
|
2018
1948
|
// src/config/Provider.ts
|
|
2019
1949
|
import {
|
|
@@ -2021,32 +1951,20 @@ import {
|
|
|
2021
1951
|
zodIsFactory,
|
|
2022
1952
|
zodToFactory
|
|
2023
1953
|
} from "@xylabs/sdk-js";
|
|
2024
|
-
import { z as
|
|
2025
|
-
var ProviderConfigZod =
|
|
2026
|
-
moniker:
|
|
2027
|
-
labels:
|
|
1954
|
+
import { z as z12 } from "zod";
|
|
1955
|
+
var ProviderConfigZod = z12.object({
|
|
1956
|
+
moniker: z12.string(),
|
|
1957
|
+
labels: z12.array(z12.string()).optional()
|
|
2028
1958
|
}).describe("Configuration for a Provider");
|
|
2029
1959
|
var isProviderConfig = zodIsFactory(ProviderConfigZod);
|
|
2030
1960
|
var asProviderConfig = zodAsFactory2(ProviderConfigZod, "asProviderConfig");
|
|
2031
1961
|
var toProviderConfig = zodToFactory(ProviderConfigZod, "toProviderConfig");
|
|
2032
1962
|
|
|
2033
1963
|
// src/config/Providers.ts
|
|
2034
|
-
var ProvidersConfigZod =
|
|
2035
|
-
|
|
2036
|
-
// src/config/storage/Storage.ts
|
|
2037
|
-
import { globalRegistry as globalRegistry11, z as z16 } from "zod";
|
|
2038
|
-
var StorageConfigZod = z16.object({
|
|
2039
|
-
mongo: MongoConfigZod.optional().describe("Configuration for the MongoD storage driver"),
|
|
2040
|
-
root: z16.string().optional().register(globalRegistry11, {
|
|
2041
|
-
description: "Root directory for local storage",
|
|
2042
|
-
title: "storage.root",
|
|
2043
|
-
type: "string"
|
|
2044
|
-
}),
|
|
2045
|
-
s3: S3ConfigZod.optional().describe("Configuration for S3-compatible object storage (e.g. Cloudflare R2)")
|
|
2046
|
-
}).describe("Storage configuration options");
|
|
1964
|
+
var ProvidersConfigZod = z13.array(ProviderConfigZod.loose()).describe("Configuration for providers").default([]);
|
|
2047
1965
|
|
|
2048
1966
|
// src/config/Telemetry.ts
|
|
2049
|
-
import { globalRegistry as
|
|
1967
|
+
import { globalRegistry as globalRegistry9, z as z14 } from "zod";
|
|
2050
1968
|
var DefaultMetricsScrapePorts = {
|
|
2051
1969
|
api: 9465,
|
|
2052
1970
|
bridge: 9468,
|
|
@@ -2054,29 +1972,29 @@ var DefaultMetricsScrapePorts = {
|
|
|
2054
1972
|
producer: 9464,
|
|
2055
1973
|
rewardRedemptionApi: 9467
|
|
2056
1974
|
};
|
|
2057
|
-
var MetricsScrapeConfigZod =
|
|
2058
|
-
path:
|
|
1975
|
+
var MetricsScrapeConfigZod = z14.object({
|
|
1976
|
+
path: z14.string().default("/metrics").register(globalRegistry9, {
|
|
2059
1977
|
default: "/metrics",
|
|
2060
1978
|
description: "Path for the metrics scrape endpoint",
|
|
2061
1979
|
title: "telemetry.metrics.scrape.path",
|
|
2062
1980
|
type: "string"
|
|
2063
1981
|
}),
|
|
2064
|
-
port:
|
|
2065
|
-
description: "Port for the metrics scrape endpoint",
|
|
1982
|
+
port: z14.coerce.number().int().nonnegative().optional().register(globalRegistry9, {
|
|
1983
|
+
description: "Port for the metrics scrape endpoint (0 disables the scrape endpoint)",
|
|
2066
1984
|
title: "telemetry.metrics.scrape.port",
|
|
2067
1985
|
type: "number"
|
|
2068
1986
|
})
|
|
2069
1987
|
}).describe("Metrics scrape configuration");
|
|
2070
|
-
var MetricsConfigZod =
|
|
2071
|
-
var OpenTelemetryConfigZod =
|
|
1988
|
+
var MetricsConfigZod = z14.object({ scrape: MetricsScrapeConfigZod }).describe("Metrics configuration options");
|
|
1989
|
+
var OpenTelemetryConfigZod = z14.object({
|
|
2072
1990
|
// OpenTelemetry options
|
|
2073
|
-
otlpEndpoint:
|
|
1991
|
+
otlpEndpoint: z14.url().optional().register(globalRegistry9, {
|
|
2074
1992
|
description: "OTLP endpoint for exporting telemetry data",
|
|
2075
1993
|
title: "telemetry.otel.otlpEndpoint",
|
|
2076
1994
|
type: "string"
|
|
2077
1995
|
})
|
|
2078
1996
|
});
|
|
2079
|
-
var TelemetryConfigZod =
|
|
1997
|
+
var TelemetryConfigZod = z14.object({
|
|
2080
1998
|
// Metrics configuration
|
|
2081
1999
|
metrics: MetricsConfigZod.optional().describe("Metrics configuration"),
|
|
2082
2000
|
// OpenTelemetry configuration
|
|
@@ -2085,7 +2003,7 @@ var TelemetryConfigZod = z17.object({
|
|
|
2085
2003
|
|
|
2086
2004
|
// src/config/Validation.ts
|
|
2087
2005
|
import { XyoAddressZod as XyoAddressZod2 } from "@xyo-network/sdk-js";
|
|
2088
|
-
import { globalRegistry as
|
|
2006
|
+
import { globalRegistry as globalRegistry10, z as z15 } from "zod";
|
|
2089
2007
|
|
|
2090
2008
|
// src/primitives/block/range/blockRangeSteps.ts
|
|
2091
2009
|
import { asXL1BlockNumber as asXL1BlockNumber2, StepSizes as StepSizes3 } from "@xyo-network/xl1-protocol-lib";
|
|
@@ -2106,11 +2024,11 @@ function blockRangeSteps(range, steps) {
|
|
|
2106
2024
|
}
|
|
2107
2025
|
|
|
2108
2026
|
// src/primitives/block/rate/blockRate.ts
|
|
2109
|
-
import { isDefined as
|
|
2027
|
+
import { isDefined as isDefined6, isFalsy } from "@xylabs/sdk-js";
|
|
2110
2028
|
import { asXL1BlockRange } from "@xyo-network/xl1-protocol-lib";
|
|
2111
2029
|
|
|
2112
2030
|
// src/primitives/block/rate/timeHelpers.ts
|
|
2113
|
-
import { assertEx as assertEx10, isDefined as
|
|
2031
|
+
import { assertEx as assertEx10, isDefined as isDefined5 } from "@xylabs/sdk-js";
|
|
2114
2032
|
var rateMultipliers = {
|
|
2115
2033
|
millis: 1,
|
|
2116
2034
|
seconds: 1e3,
|
|
@@ -2128,7 +2046,7 @@ var timeDurations = (timeInMs) => ({
|
|
|
2128
2046
|
weeks: timeInMs / (1e3 * 60 * 60 * 24 * 7)
|
|
2129
2047
|
});
|
|
2130
2048
|
var getTimeConfigInMilliseconds = (timeConfig) => {
|
|
2131
|
-
const assertedTimeConfig = assertEx10(
|
|
2049
|
+
const assertedTimeConfig = assertEx10(isDefined5(timeConfig) ? timeConfig : void 0, () => "Time configuration must be provided");
|
|
2132
2050
|
let totalMilliseconds = 0;
|
|
2133
2051
|
if ("years" in assertedTimeConfig) {
|
|
2134
2052
|
totalMilliseconds += assertedTimeConfig.years * 31536e6;
|
|
@@ -2167,13 +2085,13 @@ var blockRate = (startBlock, endBlock, timeUnit) => {
|
|
|
2167
2085
|
throw new Error("Time difference must be greater than 0");
|
|
2168
2086
|
}
|
|
2169
2087
|
const rate = heightDifference / timeDifference;
|
|
2170
|
-
const timeUnitValue =
|
|
2171
|
-
const returnedTimeDifference =
|
|
2088
|
+
const timeUnitValue = isDefined6(timeUnit) ? timeUnit : "millis";
|
|
2089
|
+
const returnedTimeDifference = isDefined6(timeUnit) ? timeDurations(timeDifference)[timeUnit] : timeDifference;
|
|
2172
2090
|
const timePerBlock = returnedTimeDifference / heightDifference;
|
|
2173
2091
|
return {
|
|
2174
2092
|
range: asXL1BlockRange([startingBlock.block, endingBlock.block], true),
|
|
2175
2093
|
span: heightDifference,
|
|
2176
|
-
rate:
|
|
2094
|
+
rate: isDefined6(timeUnit) ? rate * rateMultipliers[timeUnit] : rate,
|
|
2177
2095
|
timeUnit: timeUnitValue,
|
|
2178
2096
|
timeDifference: returnedTimeDifference,
|
|
2179
2097
|
timePerBlock
|
|
@@ -2221,7 +2139,7 @@ var calculateStepSizeRate = async (viewer, start, stepIndex, count = 1, timeUnit
|
|
|
2221
2139
|
// src/primitives/block/rate/timeRate.ts
|
|
2222
2140
|
import {
|
|
2223
2141
|
assertEx as assertEx12,
|
|
2224
|
-
isDefined as
|
|
2142
|
+
isDefined as isDefined7,
|
|
2225
2143
|
isDefinedNotNull
|
|
2226
2144
|
} from "@xylabs/sdk-js";
|
|
2227
2145
|
import { asXL1BlockNumber as asXL1BlockNumber3, asXL1BlockRange as asXL1BlockRange3 } from "@xyo-network/xl1-protocol-lib";
|
|
@@ -2260,7 +2178,7 @@ var findEndBlockRecursive = async (viewer, startBlock, targetTimeMs, estimatedBl
|
|
|
2260
2178
|
}
|
|
2261
2179
|
const endBlock = await viewer.blockByNumber(estimatedEndBlockNumber);
|
|
2262
2180
|
const resolvedEndBlock = assertEx12(
|
|
2263
|
-
|
|
2181
|
+
isDefined7(endBlock?.[0]) ? endBlock[0] : void 0,
|
|
2264
2182
|
() => `Could not retrieve block ${estimatedEndBlockNumber} for time rate calculation`
|
|
2265
2183
|
);
|
|
2266
2184
|
const endBlockEpoch = resolvedEndBlock.$epoch;
|
|
@@ -2297,7 +2215,7 @@ var findEndBlockRecursive = async (viewer, startBlock, targetTimeMs, estimatedBl
|
|
|
2297
2215
|
// src/primitives/chain/getWindowedChain.ts
|
|
2298
2216
|
import {
|
|
2299
2217
|
assertEx as assertEx13,
|
|
2300
|
-
isDefined as
|
|
2218
|
+
isDefined as isDefined8,
|
|
2301
2219
|
isNull,
|
|
2302
2220
|
spanRootAsync
|
|
2303
2221
|
} from "@xylabs/sdk-js";
|
|
@@ -2311,7 +2229,7 @@ async function getWindowedChain(context, blockViewer, maxWindowSize, previousCha
|
|
|
2311
2229
|
while (currentBlock !== null && newChain.length < maxWindowSize) {
|
|
2312
2230
|
const currentBlockNumber = currentBlock[0].block;
|
|
2313
2231
|
const nextBlock = newChain[0];
|
|
2314
|
-
if (
|
|
2232
|
+
if (isDefined8(nextBlock)) {
|
|
2315
2233
|
const nextBlockNumber = nextBlock[0].block;
|
|
2316
2234
|
assertEx13(
|
|
2317
2235
|
currentBlockNumber === nextBlockNumber - 1,
|
|
@@ -2408,7 +2326,7 @@ async function chainStepRewardAddress(context, blockViewer, { block, step }) {
|
|
|
2408
2326
|
}
|
|
2409
2327
|
|
|
2410
2328
|
// src/primitives/chain/step/stepRewardTotal.ts
|
|
2411
|
-
import { assertEx as assertEx17, isDefined as
|
|
2329
|
+
import { assertEx as assertEx17, isDefined as isDefined9 } from "@xylabs/sdk-js";
|
|
2412
2330
|
import {
|
|
2413
2331
|
asAttoXL1,
|
|
2414
2332
|
asXL1BlockRange as asXL1BlockRange5,
|
|
@@ -2501,7 +2419,7 @@ function stepInRange(step, range) {
|
|
|
2501
2419
|
return stepRange[0] >= range[0] && stepRange[1] <= range[1];
|
|
2502
2420
|
}
|
|
2503
2421
|
async function stepRewardTotal(context, blockViewer, { block, step }, multipliers) {
|
|
2504
|
-
const cacheKey = `${block}|${step}|${
|
|
2422
|
+
const cacheKey = `${block}|${step}|${isDefined9(multipliers)}`;
|
|
2505
2423
|
return await withContextCacheResponse(context, "stepRewardTotal", cacheKey, async () => {
|
|
2506
2424
|
const [blockBw, payloads] = await stepRewardBlock(context, blockViewer, { block, step });
|
|
2507
2425
|
assertEx17(blockBw.block === block, () => `Block Mismatch: expected ${block}, got ${blockBw.block}`);
|
|
@@ -2592,7 +2510,7 @@ async function externalBlockRangeFromStep(context, blockViewer, stepIdentity) {
|
|
|
2592
2510
|
}
|
|
2593
2511
|
|
|
2594
2512
|
// src/primitives/mapToMapType.ts
|
|
2595
|
-
import { isDefined as
|
|
2513
|
+
import { isDefined as isDefined10 } from "@xylabs/sdk-js";
|
|
2596
2514
|
function mapToMapType(map) {
|
|
2597
2515
|
return {
|
|
2598
2516
|
get: (key) => map.get(key),
|
|
@@ -2611,7 +2529,7 @@ function mapToMapType(map) {
|
|
|
2611
2529
|
const result = [];
|
|
2612
2530
|
for (const key of keys) {
|
|
2613
2531
|
const value = map.get(key);
|
|
2614
|
-
if (
|
|
2532
|
+
if (isDefined10(value)) {
|
|
2615
2533
|
result.push(value);
|
|
2616
2534
|
}
|
|
2617
2535
|
}
|
|
@@ -2626,7 +2544,7 @@ function mapToMapType(map) {
|
|
|
2626
2544
|
}
|
|
2627
2545
|
|
|
2628
2546
|
// src/primitives/readPayloadMapFromStore.ts
|
|
2629
|
-
import { isDefined as
|
|
2547
|
+
import { isDefined as isDefined11 } from "@xylabs/sdk-js";
|
|
2630
2548
|
function readPayloadMapFromStore(store) {
|
|
2631
2549
|
if (isReadArchivist(store)) {
|
|
2632
2550
|
return {
|
|
@@ -2639,7 +2557,7 @@ function readPayloadMapFromStore(store) {
|
|
|
2639
2557
|
},
|
|
2640
2558
|
has: async (hash) => {
|
|
2641
2559
|
const results = await store.get([hash]);
|
|
2642
|
-
return
|
|
2560
|
+
return isDefined11(results[0]);
|
|
2643
2561
|
}
|
|
2644
2562
|
};
|
|
2645
2563
|
}
|
|
@@ -2657,7 +2575,7 @@ function payloadMapFromStore(store) {
|
|
|
2657
2575
|
},
|
|
2658
2576
|
has: async (hash) => {
|
|
2659
2577
|
const results = await store.get([hash]);
|
|
2660
|
-
return
|
|
2578
|
+
return isDefined11(results[0]);
|
|
2661
2579
|
},
|
|
2662
2580
|
clear: async () => {
|
|
2663
2581
|
return await store.clear();
|
|
@@ -2703,7 +2621,7 @@ function rewardFromBlockNumber(blockNumber) {
|
|
|
2703
2621
|
import { XYO_NETWORK_STAKING_ADDRESS } from "@xyo-network/xl1-protocol-lib";
|
|
2704
2622
|
|
|
2705
2623
|
// src/primitives/stake/activeStakeAtTimeByAddress.ts
|
|
2706
|
-
import { isDefined as
|
|
2624
|
+
import { isDefined as isDefined12 } from "@xylabs/sdk-js";
|
|
2707
2625
|
|
|
2708
2626
|
// src/primitives/stake/mergedAddRemoveStakeEventsByStaker.ts
|
|
2709
2627
|
async function mergedAddRemoveStakeEventsByStaker(chainEvents, range, staked, staker) {
|
|
@@ -2723,7 +2641,7 @@ async function activeStakeAtTimeByAddress(chain, staked, time, staker) {
|
|
|
2723
2641
|
for (const event of stakeEvents) {
|
|
2724
2642
|
if (event.time > time) break;
|
|
2725
2643
|
if (event.args.staked !== staked) continue;
|
|
2726
|
-
if (
|
|
2644
|
+
if (isDefined12(staker) && event.args.staker !== staker) continue;
|
|
2727
2645
|
if (event.name === "StakeAdded") {
|
|
2728
2646
|
result += event.args.amount;
|
|
2729
2647
|
} else if (event.name === "StakeRemoved") {
|
|
@@ -2734,7 +2652,7 @@ async function activeStakeAtTimeByAddress(chain, staked, time, staker) {
|
|
|
2734
2652
|
}
|
|
2735
2653
|
|
|
2736
2654
|
// src/primitives/stake/activeStakeAtTimeByPosition.ts
|
|
2737
|
-
import { isUndefined as
|
|
2655
|
+
import { isUndefined as isUndefined5 } from "@xylabs/sdk-js";
|
|
2738
2656
|
|
|
2739
2657
|
// src/primitives/stake/mergedAddRemoveStakeEventsByPosition.ts
|
|
2740
2658
|
async function mergedAddRemoveStakeEventsByPosition(chainEvents, range, position) {
|
|
@@ -2753,7 +2671,7 @@ async function activeStakeAtTimeByPosition(chainStakeEvents, externalTime, posit
|
|
|
2753
2671
|
let result = 0n;
|
|
2754
2672
|
for (const event of stakeEvents) {
|
|
2755
2673
|
if (event.time > externalTime) break;
|
|
2756
|
-
if (
|
|
2674
|
+
if (isUndefined5(position) || position === Number(event.args.id)) {
|
|
2757
2675
|
if (event.name === "StakeAdded") {
|
|
2758
2676
|
result += event.args.amount;
|
|
2759
2677
|
} else if (event.name === "StakeRemoved") {
|
|
@@ -2797,20 +2715,20 @@ async function allStakersForStep(context, blockViewer, stakeEventsViewer, stepCo
|
|
|
2797
2715
|
}
|
|
2798
2716
|
|
|
2799
2717
|
// src/primitives/stake/weightedStakeForRangeByPosition.ts
|
|
2800
|
-
import { isDefined as
|
|
2718
|
+
import { isDefined as isDefined13 } from "@xylabs/sdk-js";
|
|
2801
2719
|
import { asBlockNumber as asBlockNumber2 } from "@xyo-network/xl1-protocol-lib";
|
|
2802
2720
|
async function weightedStakeForRangeByPosition(context, blockViewer, stakeEventsViewer, externalRange, staked, positionId) {
|
|
2803
|
-
const cacheKey =
|
|
2721
|
+
const cacheKey = isDefined13(positionId) ? `${externalRange[0]}-${externalRange[1]}-${positionId}` : `${externalRange[0]}-${externalRange[1]}-all`;
|
|
2804
2722
|
return await withContextCacheResponse(context, "weightedStakeForRangeByPosition", cacheKey, async () => {
|
|
2805
2723
|
let weightedStakeSum = 0n;
|
|
2806
|
-
if (
|
|
2724
|
+
if (isDefined13(positionId)) {
|
|
2807
2725
|
const mergedEventsResult = await mergedAddRemoveStakeEventsByPosition(
|
|
2808
2726
|
stakeEventsViewer,
|
|
2809
2727
|
[0, externalRange[1]],
|
|
2810
2728
|
positionId
|
|
2811
2729
|
);
|
|
2812
2730
|
const mergedEvents = mergedEventsResult.toSorted((a, b) => a.time - b.time);
|
|
2813
|
-
if (
|
|
2731
|
+
if (isDefined13(staked) && mergedEvents.at(0)?.args.staked !== staked) {
|
|
2814
2732
|
return 0n;
|
|
2815
2733
|
}
|
|
2816
2734
|
let currentTime = externalRange[0];
|
|
@@ -3003,24 +2921,24 @@ function findUncles(context, finalizedWindowedChain, blocks) {
|
|
|
3003
2921
|
}
|
|
3004
2922
|
|
|
3005
2923
|
// src/config/Validation.ts
|
|
3006
|
-
var ValidationConfigZod =
|
|
3007
|
-
allowedRewardRedeemers:
|
|
2924
|
+
var ValidationConfigZod = z15.object({
|
|
2925
|
+
allowedRewardRedeemers: z15.array(XyoAddressZod2).optional().register(globalRegistry10, {
|
|
3008
2926
|
description: "List of allowed reward redeemer addresses, if undefined anyone can participate",
|
|
3009
2927
|
title: "allowedRewardRedeemers",
|
|
3010
2928
|
type: "array"
|
|
3011
2929
|
}),
|
|
3012
|
-
allowedRewardEscrowAccountSigners:
|
|
2930
|
+
allowedRewardEscrowAccountSigners: z15.array(XyoAddressZod2).optional().register(globalRegistry10, {
|
|
3013
2931
|
description: "List of allowed reward escrow account signer addresses, if undefined anyone can participate",
|
|
3014
2932
|
title: "allowedRewardEscrowAccountSigners",
|
|
3015
2933
|
type: "array"
|
|
3016
2934
|
}),
|
|
3017
|
-
minCandidates:
|
|
2935
|
+
minCandidates: z15.coerce.number().default(DEFAULT_MIN_CANDIDATES).register(globalRegistry10, {
|
|
3018
2936
|
default: DEFAULT_MIN_CANDIDATES,
|
|
3019
2937
|
description: "Minimum number of uncle candidates before selecting the best uncle",
|
|
3020
2938
|
title: "validation.minCandidates",
|
|
3021
2939
|
type: "number"
|
|
3022
2940
|
}),
|
|
3023
|
-
backoffMs:
|
|
2941
|
+
backoffMs: z15.coerce.number().default(DEFAULT_BACKOFF_MS).register(globalRegistry10, {
|
|
3024
2942
|
default: DEFAULT_BACKOFF_MS,
|
|
3025
2943
|
description: "Back-off timeout in ms. If head age exceeds this, minCandidates is ignored",
|
|
3026
2944
|
title: "validation.backoffMs",
|
|
@@ -3029,29 +2947,25 @@ var ValidationConfigZod = z18.object({
|
|
|
3029
2947
|
});
|
|
3030
2948
|
|
|
3031
2949
|
// src/config/Base.ts
|
|
3032
|
-
var BaseConfigZod =
|
|
3033
|
-
chain:
|
|
3034
|
-
dataLake:
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
transports: z19._default(TransportsConfigZod, TransportsConfigZod.parse({})).check(z19.describe("Deprecated alias for connections (kept in sync during migration)")),
|
|
3042
|
-
storage: z19._default(StorageConfigZod, StorageConfigZod.parse({})).check(z19.describe("Configuration for the storage")),
|
|
3043
|
-
telemetry: z19._default(TelemetryConfigZod, TelemetryConfigZod.parse({})).check(z19.describe("Configuration for telemetry")),
|
|
3044
|
-
validation: z19._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z19.describe("Configuration for validation"))
|
|
2950
|
+
var BaseConfigZod = z16.object({
|
|
2951
|
+
chain: z16._default(ChainConfigZod, ChainConfigZod.parse({})).check(z16.describe("Configuration for the chain")),
|
|
2952
|
+
dataLake: z16.optional(DataLakeConfigZod).check(z16.describe("Configuration for data lakes")),
|
|
2953
|
+
log: z16._default(LogConfigZod, LogConfigZod.parse({})).check(z16.describe("Configuration for logging")),
|
|
2954
|
+
connections: z16._default(TransportsConfigZod, TransportsConfigZod.parse({})).check(z16.describe("Named connection profiles (rpc, rest, s3, lmdb, mongo, evm-rpc)")),
|
|
2955
|
+
providerBindings: z16._default(ProviderBindingsConfigZod, ProviderBindingsConfigZod.parse({})).check(z16.describe("Per-moniker provider connection bindings")),
|
|
2956
|
+
providers: z16._default(ProvidersConfigZod, ProvidersConfigZod.parse([])).check(z16.describe("Configuration for providers")),
|
|
2957
|
+
telemetry: z16._default(TelemetryConfigZod, TelemetryConfigZod.parse({})).check(z16.describe("Configuration for telemetry")),
|
|
2958
|
+
validation: z16._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z16.describe("Configuration for validation"))
|
|
3045
2959
|
});
|
|
3046
2960
|
|
|
3047
2961
|
// src/config/Actor.ts
|
|
3048
|
-
var AccountPathZod =
|
|
2962
|
+
var AccountPathZod = z17.string().check(z17.regex(
|
|
3049
2963
|
/^(m(\/\d+'?)+|\d+'?(\/\d+'?)*)$/,
|
|
3050
2964
|
`Invalid BIP-32 derivation path. Use either an absolute path like "m/44'/60'/0'/0/0" or a relative path like "0", "0/1", or "44'/60'/0'/0/0".`
|
|
3051
2965
|
));
|
|
3052
|
-
var ActorConfigZod =
|
|
3053
|
-
name:
|
|
3054
|
-
accountPath:
|
|
2966
|
+
var ActorConfigZod = z17.extend(BaseConfigZod, {
|
|
2967
|
+
name: z17.string(),
|
|
2968
|
+
accountPath: z17.optional(AccountPathZod).register(globalRegistry11, {
|
|
3055
2969
|
description: 'BIP-32 derivation path for the actor wallet. Absolute when it starts with "m/"; otherwise relative to the root wallet base path. Each actor must derive to a distinct path.',
|
|
3056
2970
|
title: "accountPath",
|
|
3057
2971
|
type: "string"
|
|
@@ -3062,25 +2976,22 @@ var asActorConfig = zodAsFactory3(ActorConfigZod, "asActorConfig");
|
|
|
3062
2976
|
var toActorConfig = zodToFactory2(ActorConfigZod, "toActorConfig");
|
|
3063
2977
|
|
|
3064
2978
|
// src/config/Actors.ts
|
|
3065
|
-
import { z as
|
|
3066
|
-
var ActorsConfigZod =
|
|
3067
|
-
|
|
2979
|
+
import { z as z18 } from "zod/mini";
|
|
2980
|
+
var ActorsConfigZod = z18._default(
|
|
2981
|
+
z18.array(z18.looseObject(ActorConfigZod.shape)).check(z18.describe("Actor-specific configurations that override the base configuration when the actor is running")),
|
|
3068
2982
|
[]
|
|
3069
2983
|
);
|
|
3070
2984
|
|
|
3071
|
-
// src/config/adaptLegacyConfig.ts
|
|
3072
|
-
import { isDefined as isDefined16 } from "@xylabs/sdk-js";
|
|
3073
|
-
|
|
3074
2985
|
// src/config/Config.ts
|
|
3075
|
-
import { globalRegistry as
|
|
3076
|
-
var ConfigZod =
|
|
2986
|
+
import { globalRegistry as globalRegistry12, z as z19 } from "zod/mini";
|
|
2987
|
+
var ConfigZod = z19.extend(BaseConfigZod, {
|
|
3077
2988
|
actors: ActorsConfigZod,
|
|
3078
|
-
healthCheckPort:
|
|
2989
|
+
healthCheckPort: z19.optional(z19.coerce.number()).register(globalRegistry12, {
|
|
3079
2990
|
description: "Port for the system-wide health, readiness, and liveness endpoints (/healthz, /livez, /readyz). Set to 0 to disable.",
|
|
3080
2991
|
title: "healthCheckPort",
|
|
3081
2992
|
type: "number"
|
|
3082
2993
|
})
|
|
3083
|
-
}).check(
|
|
2994
|
+
}).check(z19.describe("The complete configuration for the protocol, including global settings and actor-specific overrides"));
|
|
3084
2995
|
function resolveConfig(config) {
|
|
3085
2996
|
const parsedConfig = ConfigZod.parse(config);
|
|
3086
2997
|
const {
|
|
@@ -3089,108 +3000,38 @@ function resolveConfig(config) {
|
|
|
3089
3000
|
...rootConfig
|
|
3090
3001
|
} = parsedConfig;
|
|
3091
3002
|
parsedConfig.actors = actors.map((actorConfig) => {
|
|
3092
|
-
return
|
|
3003
|
+
return z19.looseObject(ActorConfigZod.shape).parse({ ...rootConfig, ...actorConfig });
|
|
3093
3004
|
});
|
|
3094
3005
|
return parsedConfig;
|
|
3095
3006
|
}
|
|
3096
3007
|
|
|
3097
|
-
// src/config/
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
type: "s3",
|
|
3125
|
-
accessKeyId: entry?.accessKeyId ?? shared.accessKeyId,
|
|
3126
|
-
accountId: entry?.accountId ?? shared.accountId,
|
|
3127
|
-
bucket: entry?.bucket ?? fallbackBucket,
|
|
3128
|
-
prefix: entry?.prefix ?? shared.prefix,
|
|
3129
|
-
readUrl: entry?.readUrl,
|
|
3130
|
-
secretAccessKey: entry?.secretAccessKey ?? shared.secretAccessKey
|
|
3131
|
-
};
|
|
3132
|
-
}
|
|
3133
|
-
function synthesizeS3Transports(s3) {
|
|
3134
|
-
const shared = {
|
|
3135
|
-
accessKeyId: s3.accessKeyId,
|
|
3136
|
-
accountId: s3.accountId,
|
|
3137
|
-
prefix: s3.prefix,
|
|
3138
|
-
secretAccessKey: s3.secretAccessKey
|
|
3139
|
-
};
|
|
3140
|
-
const transports = {};
|
|
3141
|
-
const finalized = s3TransportFromBucket(shared, s3.finalized);
|
|
3142
|
-
const fallbackBucket = s3.finalized?.bucket;
|
|
3143
|
-
if (finalized) {
|
|
3144
|
-
transports[S3_FINALIZED_TRANSPORT] = finalized;
|
|
3145
|
-
}
|
|
3146
|
-
const chainState = s3TransportFromBucket(shared, s3.chainState, fallbackBucket);
|
|
3147
|
-
if (chainState) {
|
|
3148
|
-
transports[S3_CHAIN_STATE_TRANSPORT] = chainState;
|
|
3149
|
-
}
|
|
3150
|
-
const index = s3TransportFromBucket(shared, s3.index, fallbackBucket);
|
|
3151
|
-
if (index) {
|
|
3152
|
-
transports[S3_INDEX_TRANSPORT] = index;
|
|
3153
|
-
}
|
|
3154
|
-
return transports;
|
|
3155
|
-
}
|
|
3156
|
-
function hasTransport(transports, key) {
|
|
3157
|
-
return Object.hasOwn(transports, key) && transports[key] !== void 0;
|
|
3158
|
-
}
|
|
3159
|
-
function bindMoniker2(bindings, moniker, connectionName) {
|
|
3160
|
-
bindings[moniker] = { connection: connectionName, transport: connectionName };
|
|
3161
|
-
}
|
|
3162
|
-
var LMDB_MONIKERS = [
|
|
3163
|
-
"AccountBalanceViewer",
|
|
3164
|
-
"BlockRewardViewer",
|
|
3165
|
-
"BlockRunner",
|
|
3166
|
-
"BlockValidationViewer",
|
|
3167
|
-
"BlockViewer",
|
|
3168
|
-
"ChainContractViewer",
|
|
3169
|
-
"DeadLetterQueueRunner",
|
|
3170
|
-
"DeadLetterQueueViewer",
|
|
3171
|
-
"FinalizationRunner",
|
|
3172
|
-
"FinalizationViewer",
|
|
3173
|
-
"MempoolRunner",
|
|
3174
|
-
"MempoolViewer",
|
|
3175
|
-
"NetworkStakeViewer",
|
|
3176
|
-
"NetworkStakeStepRewardsByPositionViewer",
|
|
3177
|
-
"NetworkStakeStepRewardsByStakerViewer",
|
|
3178
|
-
"NetworkStakeStepRewardsByStepViewer",
|
|
3179
|
-
"NetworkStakeStepRewardsTotalViewer",
|
|
3180
|
-
"NetworkStakeStepRewardsViewer",
|
|
3181
|
-
"StakeEventsViewer",
|
|
3182
|
-
"StakeTotalsViewer",
|
|
3183
|
-
"StakeViewer",
|
|
3184
|
-
"StepViewer",
|
|
3185
|
-
"TimeSyncViewer",
|
|
3186
|
-
"TransactionValidationViewer",
|
|
3187
|
-
"TransactionViewer",
|
|
3188
|
-
"WindowedBlockViewer",
|
|
3189
|
-
"XyoConnection",
|
|
3190
|
-
"XyoGateway",
|
|
3191
|
-
"XyoRunner",
|
|
3192
|
-
"XyoViewer"
|
|
3193
|
-
];
|
|
3008
|
+
// src/config/HostActor.ts
|
|
3009
|
+
import {
|
|
3010
|
+
zodAsFactory as zodAsFactory4,
|
|
3011
|
+
zodIsFactory as zodIsFactory3,
|
|
3012
|
+
zodToFactory as zodToFactory3
|
|
3013
|
+
} from "@xylabs/sdk-js";
|
|
3014
|
+
import { globalRegistry as globalRegistry13, z as z20 } from "zod/mini";
|
|
3015
|
+
var HostActorConfigZod = z20.extend(ActorConfigZod, {
|
|
3016
|
+
host: z20._default(z20.string(), "localhost").register(globalRegistry13, {
|
|
3017
|
+
default: "localhost",
|
|
3018
|
+
description: "Host for the Actor",
|
|
3019
|
+
title: "host",
|
|
3020
|
+
type: "string"
|
|
3021
|
+
}),
|
|
3022
|
+
port: z20._default(z20.coerce.number(), 8080).register(globalRegistry13, {
|
|
3023
|
+
default: 8080,
|
|
3024
|
+
description: "Port for the Actor",
|
|
3025
|
+
title: "port",
|
|
3026
|
+
type: "number"
|
|
3027
|
+
})
|
|
3028
|
+
});
|
|
3029
|
+
var isHostActorConfig = zodIsFactory3(HostActorConfigZod);
|
|
3030
|
+
var asHostActorConfig = zodAsFactory4(HostActorConfigZod, "asHostActorConfig");
|
|
3031
|
+
var toHostActorConfig = zodToFactory3(HostActorConfigZod, "toHostActorConfig");
|
|
3032
|
+
|
|
3033
|
+
// src/config/synthesizeRpcConnectionBindings.ts
|
|
3034
|
+
var DEFAULT_RPC_CONNECTION = "default-rpc";
|
|
3194
3035
|
var RPC_MONIKERS = [
|
|
3195
3036
|
"AccountBalanceViewer",
|
|
3196
3037
|
"BlockRewardViewer",
|
|
@@ -3212,133 +3053,73 @@ var RPC_MONIKERS = [
|
|
|
3212
3053
|
"WindowedBlockViewer",
|
|
3213
3054
|
"XyoViewer"
|
|
3214
3055
|
];
|
|
3215
|
-
function
|
|
3056
|
+
function synthesizeRpcConnectionBindings() {
|
|
3216
3057
|
const bindings = {};
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
}
|
|
3220
|
-
for (const moniker of LMDB_MONIKERS) {
|
|
3221
|
-
bindMoniker2(bindings, moniker, DEFAULT_LMDB_TRANSPORT);
|
|
3058
|
+
for (const moniker of RPC_MONIKERS) {
|
|
3059
|
+
bindings[moniker] = { connection: DEFAULT_RPC_CONNECTION, transport: DEFAULT_RPC_CONNECTION };
|
|
3222
3060
|
}
|
|
3223
3061
|
return bindings;
|
|
3224
3062
|
}
|
|
3225
|
-
function synthesizeProviderBindings(transports) {
|
|
3226
|
-
const bindings = {};
|
|
3227
|
-
if (hasTransport(transports, DEFAULT_RPC_TRANSPORT)) {
|
|
3228
|
-
for (const moniker of RPC_MONIKERS) {
|
|
3229
|
-
bindMoniker2(bindings, moniker, DEFAULT_RPC_TRANSPORT);
|
|
3230
|
-
}
|
|
3231
|
-
}
|
|
3232
|
-
if (hasTransport(transports, S3_FINALIZED_TRANSPORT)) {
|
|
3233
|
-
bindMoniker2(bindings, "BlockPublishRunner", S3_FINALIZED_TRANSPORT);
|
|
3234
|
-
}
|
|
3235
|
-
if (hasTransport(transports, S3_CHAIN_STATE_TRANSPORT)) {
|
|
3236
|
-
bindMoniker2(bindings, "ChainStateViewer", S3_CHAIN_STATE_TRANSPORT);
|
|
3237
|
-
bindMoniker2(bindings, "ChainStatePublishRunner", S3_CHAIN_STATE_TRANSPORT);
|
|
3238
|
-
}
|
|
3239
|
-
if (hasTransport(transports, S3_INDEX_TRANSPORT)) {
|
|
3240
|
-
bindMoniker2(bindings, "IndexPublishRunner", S3_INDEX_TRANSPORT);
|
|
3241
|
-
}
|
|
3242
|
-
if (hasTransport(transports, DEFAULT_EVM_RPC_TRANSPORT)) {
|
|
3243
|
-
bindMoniker2(bindings, "ChainContractViewer", DEFAULT_EVM_RPC_TRANSPORT);
|
|
3244
|
-
bindMoniker2(bindings, "StakeEventsViewer", DEFAULT_EVM_RPC_TRANSPORT);
|
|
3245
|
-
bindMoniker2(bindings, "StakeTotalsViewer", DEFAULT_EVM_RPC_TRANSPORT);
|
|
3246
|
-
bindMoniker2(bindings, "StakeViewer", DEFAULT_EVM_RPC_TRANSPORT);
|
|
3247
|
-
bindMoniker2(bindings, "TimeSyncViewer", DEFAULT_EVM_RPC_TRANSPORT);
|
|
3248
|
-
}
|
|
3249
|
-
return bindings;
|
|
3250
|
-
}
|
|
3251
|
-
function adaptLegacyConfig(config) {
|
|
3252
|
-
const parsed = ConfigZod.parse(config);
|
|
3253
|
-
if (hasDeclaredConnectionProfiles(parsed)) {
|
|
3254
|
-
return ConfigZod.parse(normalizeConnectionsConfig(parsed));
|
|
3255
|
-
}
|
|
3256
|
-
const transports = { ...parsed.transports, ...parsed.connections };
|
|
3257
|
-
if (isDefined16(parsed.storage?.root) && parsed.storage.root !== "") {
|
|
3258
|
-
transports[DEFAULT_LMDB_TRANSPORT] = { type: "lmdb", root: parsed.storage.root };
|
|
3259
|
-
}
|
|
3260
|
-
if (hasMongoConfig(parsed.storage?.mongo)) {
|
|
3261
|
-
transports["chain-mongo"] = {
|
|
3262
|
-
type: "mongo",
|
|
3263
|
-
connectionString: parsed.storage.mongo.connectionString,
|
|
3264
|
-
database: parsed.storage.mongo.database,
|
|
3265
|
-
domain: parsed.storage.mongo.domain,
|
|
3266
|
-
password: parsed.storage.mongo.password,
|
|
3267
|
-
username: parsed.storage.mongo.username
|
|
3268
|
-
};
|
|
3269
|
-
}
|
|
3270
|
-
if (isDefined16(parsed.remote?.rpc)) {
|
|
3271
|
-
transports[DEFAULT_RPC_TRANSPORT] = rpcTransportFromRemote(parsed.remote.rpc);
|
|
3272
|
-
}
|
|
3273
|
-
if (isDefined16(parsed.evm?.jsonRpc?.url)) {
|
|
3274
|
-
transports[DEFAULT_EVM_RPC_TRANSPORT] = { type: "evm-rpc", url: parsed.evm.jsonRpc.url };
|
|
3275
|
-
}
|
|
3276
|
-
if (isDefined16(parsed.storage?.s3)) {
|
|
3277
|
-
Object.assign(transports, synthesizeS3Transports(parsed.storage.s3));
|
|
3278
|
-
}
|
|
3279
|
-
const providerBindings = {
|
|
3280
|
-
...synthesizeLmdbProviderBindings(transports),
|
|
3281
|
-
...synthesizeProviderBindings(transports),
|
|
3282
|
-
...parsed.providerBindings
|
|
3283
|
-
};
|
|
3284
|
-
return ConfigZod.parse(normalizeConnectionsConfig({
|
|
3285
|
-
...parsed,
|
|
3286
|
-
connections: transports,
|
|
3287
|
-
providerBindings,
|
|
3288
|
-
transports
|
|
3289
|
-
}));
|
|
3290
|
-
}
|
|
3291
3063
|
|
|
3292
|
-
// src/config/
|
|
3293
|
-
import {
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
description: "
|
|
3303
|
-
|
|
3064
|
+
// src/config/transports/Rpc.ts
|
|
3065
|
+
import { globalRegistry as globalRegistry14, z as z21 } from "zod";
|
|
3066
|
+
var RpcRemoteConfigBaseZod = z21.object({
|
|
3067
|
+
protocol: z21.string("http").register(globalRegistry14, {
|
|
3068
|
+
description: "Protocol for the RPC connection",
|
|
3069
|
+
type: "string"
|
|
3070
|
+
})
|
|
3071
|
+
}).describe("Base configuration for the remote RPC");
|
|
3072
|
+
var HttpRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
3073
|
+
protocol: z21.string("http").register(globalRegistry14, {
|
|
3074
|
+
description: "Protocol for the RPC connection",
|
|
3075
|
+
type: "string"
|
|
3076
|
+
}).default("http"),
|
|
3077
|
+
url: z21.string().register(globalRegistry14, {
|
|
3078
|
+
description: "URL for the Chain RPC API",
|
|
3079
|
+
type: "string"
|
|
3080
|
+
})
|
|
3081
|
+
}).describe("Configuration for the remote RPC using Http");
|
|
3082
|
+
var PostMessageRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
3083
|
+
protocol: z21.string().register(globalRegistry14, {
|
|
3084
|
+
description: "Protocol for the RPC connection",
|
|
3085
|
+
type: "string"
|
|
3086
|
+
}).default("postMessage"),
|
|
3087
|
+
networkId: z21.string().register(globalRegistry14, {
|
|
3088
|
+
description: "Network ID to use for the postMessage RPC connection",
|
|
3304
3089
|
type: "string"
|
|
3305
3090
|
}),
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
title: "port",
|
|
3310
|
-
type: "number"
|
|
3091
|
+
sessionId: z21.string().register(globalRegistry14, {
|
|
3092
|
+
description: "Session ID to use for the postMessage RPC connection",
|
|
3093
|
+
type: "string"
|
|
3311
3094
|
})
|
|
3312
|
-
});
|
|
3313
|
-
var
|
|
3314
|
-
var asHostActorConfig = zodAsFactory4(HostActorConfigZod, "asHostActorConfig");
|
|
3315
|
-
var toHostActorConfig = zodToFactory3(HostActorConfigZod, "toHostActorConfig");
|
|
3095
|
+
}).describe("Configuration for the remote RPC using postMessage");
|
|
3096
|
+
var RpcRemoteConfigZod = z21.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod]).describe("Configuration for a remote RPC connection, either Http or postMessage");
|
|
3316
3097
|
|
|
3317
3098
|
// src/config/UsageMeta.ts
|
|
3318
|
-
import { z as
|
|
3319
|
-
var DescriptionSchema =
|
|
3320
|
-
var TitleSchema =
|
|
3321
|
-
var JSONSchemaMetaSchema =
|
|
3322
|
-
id:
|
|
3099
|
+
import { z as z22 } from "zod";
|
|
3100
|
+
var DescriptionSchema = z22.string();
|
|
3101
|
+
var TitleSchema = z22.string();
|
|
3102
|
+
var JSONSchemaMetaSchema = z22.object({
|
|
3103
|
+
id: z22.string().optional(),
|
|
3323
3104
|
title: TitleSchema.optional(),
|
|
3324
3105
|
description: DescriptionSchema.optional(),
|
|
3325
|
-
deprecated:
|
|
3326
|
-
}).catchall(
|
|
3106
|
+
deprecated: z22.boolean().optional()
|
|
3107
|
+
}).catchall(z22.unknown());
|
|
3327
3108
|
var GlobalMetaSchema = JSONSchemaMetaSchema.extend({});
|
|
3328
|
-
var ChoicesSchema =
|
|
3109
|
+
var ChoicesSchema = z22.array(z22.union([z22.string(), z22.number(), z22.literal(true), z22.undefined()])).readonly();
|
|
3329
3110
|
var UsageMetaSchema = GlobalMetaSchema.extend({
|
|
3330
3111
|
choices: ChoicesSchema.optional(),
|
|
3331
|
-
default:
|
|
3112
|
+
default: z22.unknown().optional(),
|
|
3332
3113
|
description: DescriptionSchema,
|
|
3333
|
-
group:
|
|
3334
|
-
hidden:
|
|
3114
|
+
group: z22.string().optional(),
|
|
3115
|
+
hidden: z22.boolean().optional(),
|
|
3335
3116
|
title: TitleSchema,
|
|
3336
|
-
type:
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3117
|
+
type: z22.union([
|
|
3118
|
+
z22.literal("array"),
|
|
3119
|
+
z22.literal("count"),
|
|
3120
|
+
z22.literal("boolean"),
|
|
3121
|
+
z22.literal("number"),
|
|
3122
|
+
z22.literal("string")
|
|
3342
3123
|
])
|
|
3343
3124
|
});
|
|
3344
3125
|
function isUsageMeta(v) {
|
|
@@ -3351,7 +3132,7 @@ import {
|
|
|
3351
3132
|
zodIsFactory as zodIsFactory5,
|
|
3352
3133
|
zodToFactory as zodToFactory5
|
|
3353
3134
|
} from "@xylabs/sdk-js";
|
|
3354
|
-
import { z as
|
|
3135
|
+
import { z as z24 } from "zod/mini";
|
|
3355
3136
|
|
|
3356
3137
|
// src/model/CreatableProviderContext.zod.ts
|
|
3357
3138
|
import {
|
|
@@ -3360,17 +3141,17 @@ import {
|
|
|
3360
3141
|
zodToFactory as zodToFactory4
|
|
3361
3142
|
} from "@xylabs/sdk-js";
|
|
3362
3143
|
import { CachingContextZod } from "@xyo-network/xl1-protocol-lib";
|
|
3363
|
-
import { z as
|
|
3364
|
-
var RuntimeStatusMonitorZod =
|
|
3365
|
-
var ProviderFactoryLocatorZod =
|
|
3366
|
-
var BaseConfigContextZod =
|
|
3367
|
-
config:
|
|
3368
|
-
locator:
|
|
3144
|
+
import { z as z23 } from "zod/mini";
|
|
3145
|
+
var RuntimeStatusMonitorZod = z23.custom((val) => val !== null && val !== void 0 && typeof val === "object");
|
|
3146
|
+
var ProviderFactoryLocatorZod = z23.lazy(() => z23.custom((val) => val !== null && val !== void 0 && typeof val === "object" && "context" in val && "registry" in val));
|
|
3147
|
+
var BaseConfigContextZod = z23.extend(CachingContextZod, {
|
|
3148
|
+
config: z23.looseObject(BaseConfigZod.shape),
|
|
3149
|
+
locator: z23.optional(ProviderFactoryLocatorZod)
|
|
3369
3150
|
});
|
|
3370
|
-
var CreatableProviderContextZod =
|
|
3371
|
-
_id:
|
|
3151
|
+
var CreatableProviderContextZod = z23.lazy(() => z23.extend(BaseConfigContextZod, {
|
|
3152
|
+
_id: z23.optional(z23.string()),
|
|
3372
3153
|
locator: ProviderFactoryLocatorZod,
|
|
3373
|
-
statusReporter:
|
|
3154
|
+
statusReporter: z23.optional(RuntimeStatusMonitorZod)
|
|
3374
3155
|
}));
|
|
3375
3156
|
var isBaseConfigContext = zodIsFactory4(BaseConfigContextZod);
|
|
3376
3157
|
var asBaseConfigContext = zodAsFactory5(BaseConfigContextZod, "asBaseConfigContext");
|
|
@@ -3491,7 +3272,7 @@ async function buildUnsignedTransaction(chain, onChainPayloads, offChainPayloads
|
|
|
3491
3272
|
// src/transaction/confirmSubmittedTransaction.ts
|
|
3492
3273
|
import {
|
|
3493
3274
|
delay,
|
|
3494
|
-
isDefined as
|
|
3275
|
+
isDefined as isDefined14,
|
|
3495
3276
|
isNumber
|
|
3496
3277
|
} from "@xylabs/sdk-js";
|
|
3497
3278
|
var DEFAULT_CONFIRMATION_ATTEMPTS = 20;
|
|
@@ -3513,7 +3294,7 @@ var confirmSubmittedTransaction = async (viewer, txHash, options) => {
|
|
|
3513
3294
|
let attempts = 0;
|
|
3514
3295
|
while (true) {
|
|
3515
3296
|
const tx = await viewer.transaction.byHash(txHash) ?? void 0;
|
|
3516
|
-
if (
|
|
3297
|
+
if (isDefined14(tx)) {
|
|
3517
3298
|
options?.logger?.debug("Transaction confirmed", txHash);
|
|
3518
3299
|
return tx;
|
|
3519
3300
|
}
|
|
@@ -3824,11 +3605,23 @@ var bundle2 = (root, transaction) => {
|
|
|
3824
3605
|
};
|
|
3825
3606
|
|
|
3826
3607
|
// src/context/Actor.ts
|
|
3827
|
-
var ActorConfigContext =
|
|
3608
|
+
var ActorConfigContext = z24.extend(BaseConfigContextZod, { config: ActorConfigZod });
|
|
3828
3609
|
var isActorConfigContext = zodIsFactory5(ActorConfigContext);
|
|
3829
3610
|
var asActorConfigContext = zodAsFactory6(ActorConfigContext, "asActorConfigContext");
|
|
3830
3611
|
var toActorConfigContext = zodToFactory5(ActorConfigContext, "toActorConfigContext");
|
|
3831
3612
|
|
|
3613
|
+
// src/context/HostActor.ts
|
|
3614
|
+
import {
|
|
3615
|
+
zodAsFactory as zodAsFactory7,
|
|
3616
|
+
zodIsFactory as zodIsFactory6,
|
|
3617
|
+
zodToFactory as zodToFactory6
|
|
3618
|
+
} from "@xylabs/sdk-js";
|
|
3619
|
+
import { z as z25 } from "zod/mini";
|
|
3620
|
+
var HostActorConfigContext = z25.extend(BaseConfigContextZod, { config: HostActorConfigZod });
|
|
3621
|
+
var isHostActorConfigContext = zodIsFactory6(HostActorConfigContext);
|
|
3622
|
+
var asHostActorConfigContext = zodAsFactory7(HostActorConfigContext, "asHostActorConfigContext");
|
|
3623
|
+
var toHostActorConfigContext = zodToFactory6(HostActorConfigContext, "toHostActorConfigContext");
|
|
3624
|
+
|
|
3832
3625
|
// src/CreatableProvider/AbstractCreatableProvider.ts
|
|
3833
3626
|
import {
|
|
3834
3627
|
AbstractCreatable,
|
|
@@ -3910,42 +3703,14 @@ function labeledCreatableProvider() {
|
|
|
3910
3703
|
};
|
|
3911
3704
|
}
|
|
3912
3705
|
|
|
3913
|
-
// src/context/getEmptyProviderContext.ts
|
|
3914
|
-
function getEmptyProviderContext(config) {
|
|
3915
|
-
const singletons = {};
|
|
3916
|
-
const caches = {};
|
|
3917
|
-
const locator = new ProviderFactoryLocator({
|
|
3918
|
-
config,
|
|
3919
|
-
singletons,
|
|
3920
|
-
caches,
|
|
3921
|
-
logger: console
|
|
3922
|
-
});
|
|
3923
|
-
return locator.context;
|
|
3924
|
-
}
|
|
3925
|
-
function getEmptyContext(config) {
|
|
3926
|
-
return getEmptyProviderContext(config);
|
|
3927
|
-
}
|
|
3928
|
-
|
|
3929
|
-
// src/context/HostActor.ts
|
|
3930
|
-
import {
|
|
3931
|
-
zodAsFactory as zodAsFactory7,
|
|
3932
|
-
zodIsFactory as zodIsFactory6,
|
|
3933
|
-
zodToFactory as zodToFactory6
|
|
3934
|
-
} from "@xylabs/sdk-js";
|
|
3935
|
-
import { z as z27 } from "zod/mini";
|
|
3936
|
-
var HostActorConfigContext = z27.extend(BaseConfigContextZod, { config: HostActorConfigZod });
|
|
3937
|
-
var isHostActorConfigContext = zodIsFactory6(HostActorConfigContext);
|
|
3938
|
-
var asHostActorConfigContext = zodAsFactory7(HostActorConfigContext, "asHostActorConfigContext");
|
|
3939
|
-
var toHostActorConfigContext = zodToFactory6(HostActorConfigContext, "toHostActorConfigContext");
|
|
3940
|
-
|
|
3941
3706
|
// src/createDeclarationPayload.ts
|
|
3942
|
-
import { isDefined as
|
|
3707
|
+
import { isDefined as isDefined15 } from "@xylabs/sdk-js";
|
|
3943
3708
|
import { PayloadBuilder as PayloadBuilder13 } from "@xyo-network/sdk-js";
|
|
3944
3709
|
import {
|
|
3945
3710
|
ChainStakeIntentSchema
|
|
3946
3711
|
} from "@xyo-network/xl1-protocol-lib";
|
|
3947
3712
|
var createDeclarationIntent = (address, intent, nbf, exp) => {
|
|
3948
|
-
const expiration =
|
|
3713
|
+
const expiration = isDefined15(exp) ? exp : nbf + 1e4;
|
|
3949
3714
|
const payloadBuilder = new PayloadBuilder13({ schema: ChainStakeIntentSchema });
|
|
3950
3715
|
const builder = payloadBuilder.fields({
|
|
3951
3716
|
from: address,
|
|
@@ -3977,26 +3742,26 @@ import {
|
|
|
3977
3742
|
asSchema as asSchema2,
|
|
3978
3743
|
isPayloadOfZodType
|
|
3979
3744
|
} from "@xyo-network/sdk-js";
|
|
3980
|
-
import { z as
|
|
3745
|
+
import { z as z27 } from "zod";
|
|
3981
3746
|
|
|
3982
3747
|
// src/eip-712/Types.ts
|
|
3983
|
-
import { z as
|
|
3984
|
-
var TypedDataDomainZod =
|
|
3985
|
-
name:
|
|
3986
|
-
version:
|
|
3987
|
-
chainId:
|
|
3988
|
-
verifyingContract:
|
|
3989
|
-
salt:
|
|
3748
|
+
import { z as z26 } from "zod";
|
|
3749
|
+
var TypedDataDomainZod = z26.object({
|
|
3750
|
+
name: z26.string().nullable().optional(),
|
|
3751
|
+
version: z26.string().nullable().optional(),
|
|
3752
|
+
chainId: z26.union([z26.string(), z26.number(), z26.bigint()]).nullable().optional(),
|
|
3753
|
+
verifyingContract: z26.string().nullable().optional(),
|
|
3754
|
+
salt: z26.union([z26.string(), z26.instanceof(Uint8Array)]).nullable().optional()
|
|
3990
3755
|
});
|
|
3991
|
-
var TypedDataFieldZod =
|
|
3992
|
-
name:
|
|
3993
|
-
type:
|
|
3756
|
+
var TypedDataFieldZod = z26.object({
|
|
3757
|
+
name: z26.string(),
|
|
3758
|
+
type: z26.string()
|
|
3994
3759
|
});
|
|
3995
|
-
var TypedDataTypesZod =
|
|
3996
|
-
var TypedDataValueZod =
|
|
3760
|
+
var TypedDataTypesZod = z26.record(z26.string(), z26.array(TypedDataFieldZod));
|
|
3761
|
+
var TypedDataValueZod = z26.record(z26.string(), z26.any());
|
|
3997
3762
|
|
|
3998
3763
|
// src/eip-712/Payloads/EIP712Data.ts
|
|
3999
|
-
var EIP712DataPayloadFieldsZod =
|
|
3764
|
+
var EIP712DataPayloadFieldsZod = z27.object({
|
|
4000
3765
|
domain: TypedDataDomainZod,
|
|
4001
3766
|
types: TypedDataTypesZod,
|
|
4002
3767
|
values: TypedDataValueZod
|
|
@@ -4014,11 +3779,11 @@ import {
|
|
|
4014
3779
|
asSchema as asSchema3,
|
|
4015
3780
|
isPayloadOfZodType as isPayloadOfZodType2
|
|
4016
3781
|
} from "@xyo-network/sdk-js";
|
|
4017
|
-
import { z as
|
|
4018
|
-
var EIP712SignaturePayloadFieldsZod =
|
|
4019
|
-
address:
|
|
3782
|
+
import { z as z28 } from "zod";
|
|
3783
|
+
var EIP712SignaturePayloadFieldsZod = z28.object({
|
|
3784
|
+
address: z28.string(),
|
|
4020
3785
|
hash: HashZod,
|
|
4021
|
-
signature:
|
|
3786
|
+
signature: z28.string()
|
|
4022
3787
|
});
|
|
4023
3788
|
var EIP712SignaturePayloadSchema = asSchema3("network.xyo.chains.ethereum.eip712.signature", true);
|
|
4024
3789
|
var isEIP712SignaturePayload = isPayloadOfZodType2(
|
|
@@ -4047,7 +3812,7 @@ var signEIP712Message = async (signer, data) => {
|
|
|
4047
3812
|
};
|
|
4048
3813
|
|
|
4049
3814
|
// src/eip-712/verify.ts
|
|
4050
|
-
import { asHash as asHash3, isUndefined as
|
|
3815
|
+
import { asHash as asHash3, isUndefined as isUndefined6 } from "@xylabs/sdk-js";
|
|
4051
3816
|
import { PayloadBuilder as PayloadBuilder16 } from "@xyo-network/sdk-js";
|
|
4052
3817
|
import { verifyTypedData } from "ethers";
|
|
4053
3818
|
var verifyEIP712Message = async (data, sig) => {
|
|
@@ -4058,7 +3823,7 @@ var verifyEIP712Message = async (data, sig) => {
|
|
|
4058
3823
|
} = sig;
|
|
4059
3824
|
const { schema, ...fields } = data;
|
|
4060
3825
|
const signedHash = asHash3(hash);
|
|
4061
|
-
if (
|
|
3826
|
+
if (isUndefined6(signedHash) || signedHash !== await PayloadBuilder16.hash(data)) return false;
|
|
4062
3827
|
const recoveredAddress = verifyTypedData(fields.domain, fields.types, fields.values, signature);
|
|
4063
3828
|
return recoveredAddress.toLowerCase() === address.toLowerCase();
|
|
4064
3829
|
};
|
|
@@ -4129,7 +3894,7 @@ import {
|
|
|
4129
3894
|
asHash as asHash4,
|
|
4130
3895
|
assertEx as assertEx33,
|
|
4131
3896
|
exists as exists3,
|
|
4132
|
-
isDefined as
|
|
3897
|
+
isDefined as isDefined16,
|
|
4133
3898
|
ZERO_ADDRESS
|
|
4134
3899
|
} from "@xylabs/sdk-js";
|
|
4135
3900
|
import {
|
|
@@ -4628,7 +4393,7 @@ var SimpleAccountBalanceViewer = class extends AbstractCreatableProvider {
|
|
|
4628
4393
|
block[1].find((p) => p._hash === hash),
|
|
4629
4394
|
() => `Error: Could not find Transfer with hash ${hash} in block ${block[0]._hash}`
|
|
4630
4395
|
);
|
|
4631
|
-
}).filter(exists3).filter((t) => t.from === address ||
|
|
4396
|
+
}).filter(exists3).filter((t) => t.from === address || isDefined16(t.transfers[address]));
|
|
4632
4397
|
if (transfers.length === 0) {
|
|
4633
4398
|
continue;
|
|
4634
4399
|
}
|
|
@@ -4747,7 +4512,7 @@ var SimpleAccountBalanceViewer = class extends AbstractCreatableProvider {
|
|
|
4747
4512
|
return await this.spanAsync("qualifiedAccountBalanceHistory", async () => {
|
|
4748
4513
|
const range = asRange(headOrRange);
|
|
4749
4514
|
const headHash = asHash4(headOrRange);
|
|
4750
|
-
const [head] = assertEx33(
|
|
4515
|
+
const [head] = assertEx33(isDefined16(headHash) ? await this.blockViewer.blockByHash(headHash) : await this.blockViewer.currentBlock(), () => "Could not resolve head block");
|
|
4751
4516
|
const startingRange = asXL1BlockRange10(range ?? [0, head.block], true);
|
|
4752
4517
|
const blockNumbers = await this.distillTransferHistory(address, startingRange);
|
|
4753
4518
|
const blockResults = await Promise.all(blockNumbers.map(async (bn) => await this.blockViewer.blockByNumber(bn)));
|
|
@@ -4761,7 +4526,7 @@ var SimpleAccountBalanceViewer = class extends AbstractCreatableProvider {
|
|
|
4761
4526
|
block[1].find((p) => p._hash === hash),
|
|
4762
4527
|
() => `Error: Could not find Transfer with hash ${hash} in block ${block[0]._hash}`
|
|
4763
4528
|
);
|
|
4764
|
-
}).filter(exists3).filter((t) => t.from === address ||
|
|
4529
|
+
}).filter(exists3).filter((t) => t.from === address || isDefined16(t.transfers[address]));
|
|
4765
4530
|
if (transfers.length === 0) {
|
|
4766
4531
|
continue;
|
|
4767
4532
|
}
|
|
@@ -4791,7 +4556,7 @@ SimpleAccountBalanceViewer = __decorateClass([
|
|
|
4791
4556
|
import {
|
|
4792
4557
|
assertEx as assertEx34,
|
|
4793
4558
|
exists as exists4,
|
|
4794
|
-
isUndefined as
|
|
4559
|
+
isUndefined as isUndefined7
|
|
4795
4560
|
} from "@xylabs/sdk-js";
|
|
4796
4561
|
import { LruCacheMap as LruCacheMap2 } from "@xyo-network/xl1-driver-memory";
|
|
4797
4562
|
import {
|
|
@@ -4830,12 +4595,12 @@ var HydratedCache = class {
|
|
|
4830
4595
|
};
|
|
4831
4596
|
|
|
4832
4597
|
// src/utils/isZodError.ts
|
|
4833
|
-
import { z as
|
|
4598
|
+
import { z as z29 } from "zod";
|
|
4834
4599
|
var isZodError = (error) => {
|
|
4835
|
-
return error instanceof
|
|
4600
|
+
return error instanceof z29.ZodError;
|
|
4836
4601
|
};
|
|
4837
4602
|
var prettifyZodError = (error) => {
|
|
4838
|
-
return
|
|
4603
|
+
return z29.prettifyError(error);
|
|
4839
4604
|
};
|
|
4840
4605
|
|
|
4841
4606
|
// src/simple/block/SimpleBlockViewer.ts
|
|
@@ -4905,7 +4670,7 @@ var SimpleBlockViewer = class extends AbstractCreatableProvider {
|
|
|
4905
4670
|
async blockByNumber(blockNumber) {
|
|
4906
4671
|
return await this.spanAsync("blockByNumber", async () => {
|
|
4907
4672
|
const chainContext = await this.getChainContextRead();
|
|
4908
|
-
if (
|
|
4673
|
+
if (isUndefined7(chainContext.head)) {
|
|
4909
4674
|
return null;
|
|
4910
4675
|
}
|
|
4911
4676
|
return await this.blockByNumberWithContext(chainContext, blockNumber);
|
|
@@ -4931,7 +4696,7 @@ var SimpleBlockViewer = class extends AbstractCreatableProvider {
|
|
|
4931
4696
|
assertEx34(limit > 0, () => "limit must be greater than 0");
|
|
4932
4697
|
assertEx34(limit <= 100, () => "limit must be less than 100");
|
|
4933
4698
|
const chainContext = await this.getChainContextRead();
|
|
4934
|
-
if (
|
|
4699
|
+
if (isUndefined7(chainContext.head)) {
|
|
4935
4700
|
return [];
|
|
4936
4701
|
}
|
|
4937
4702
|
const blocks = [];
|
|
@@ -4954,7 +4719,7 @@ var SimpleBlockViewer = class extends AbstractCreatableProvider {
|
|
|
4954
4719
|
() => `blocksByStep does not support step levels above ${blocksMaxStep} (requested ${stepLevel})`
|
|
4955
4720
|
);
|
|
4956
4721
|
const chainContext = await this.getChainContextRead();
|
|
4957
|
-
if (
|
|
4722
|
+
if (isUndefined7(chainContext.head)) {
|
|
4958
4723
|
return [];
|
|
4959
4724
|
}
|
|
4960
4725
|
const start = stepIndex * size;
|
|
@@ -5330,7 +5095,7 @@ var SimpleXyoClient = class {
|
|
|
5330
5095
|
import { assertEx as assertEx37, exists as exists6 } from "@xylabs/sdk-js";
|
|
5331
5096
|
import { isAnyPayload as isAnyPayload8, PayloadZodLoose } from "@xyo-network/sdk-js";
|
|
5332
5097
|
import { DataLakeRunnerMoniker } from "@xyo-network/xl1-protocol-lib";
|
|
5333
|
-
import { z as
|
|
5098
|
+
import { z as z30 } from "zod/mini";
|
|
5334
5099
|
|
|
5335
5100
|
// src/simple/datalake/AbstractRestDataLake.ts
|
|
5336
5101
|
import { FetchClientError, FetchJsonClient } from "@xylabs/sdk-js";
|
|
@@ -5405,7 +5170,7 @@ var RestDataLakeRunner = class extends AbstractRestDataLake {
|
|
|
5405
5170
|
}).filter(exists6);
|
|
5406
5171
|
if (allowedItems.length > 0) {
|
|
5407
5172
|
const result = await this.client.post(`${this.params.endpoint}/insert`, allowedItems);
|
|
5408
|
-
return
|
|
5173
|
+
return z30.array(PayloadZodLoose).parse(result.data);
|
|
5409
5174
|
}
|
|
5410
5175
|
return [];
|
|
5411
5176
|
}
|
|
@@ -5682,7 +5447,7 @@ var SimpleXyoGateway = class _SimpleXyoGateway extends AbstractCreatableProvider
|
|
|
5682
5447
|
import {
|
|
5683
5448
|
assertEx as assertEx40,
|
|
5684
5449
|
BigIntToJsonZod,
|
|
5685
|
-
isDefined as
|
|
5450
|
+
isDefined as isDefined17
|
|
5686
5451
|
} from "@xylabs/sdk-js";
|
|
5687
5452
|
import { PayloadBuilder as PayloadBuilder20 } from "@xyo-network/sdk-js";
|
|
5688
5453
|
import {
|
|
@@ -5720,9 +5485,9 @@ var SimpleXyoGatewayRunner = class _SimpleXyoGatewayRunner extends AbstractCreat
|
|
|
5720
5485
|
chain,
|
|
5721
5486
|
fees
|
|
5722
5487
|
} = options ?? {};
|
|
5723
|
-
const resolvedChainId =
|
|
5724
|
-
const resolvedNbf = asXL1BlockNumber10(
|
|
5725
|
-
const resolvedExp = asXL1BlockNumber10(
|
|
5488
|
+
const resolvedChainId = isDefined17(chain) ? chain : await viewer.chainId();
|
|
5489
|
+
const resolvedNbf = asXL1BlockNumber10(isDefined17(nbf) ? nbf : await viewer.currentBlockNumber(), true);
|
|
5490
|
+
const resolvedExp = asXL1BlockNumber10(isDefined17(exp) ? exp : resolvedNbf + 10, true);
|
|
5726
5491
|
const tx = await buildUnsignedTransaction(resolvedChainId, onChain, offChain, resolvedNbf, resolvedExp, await this.signer.address(), fees);
|
|
5727
5492
|
return await this.addTransactionToChain(tx, await PayloadBuilder20.addHashMeta(offChain));
|
|
5728
5493
|
}
|
|
@@ -6220,7 +5985,7 @@ SimpleMempoolRunner = __decorateClass([
|
|
|
6220
5985
|
import {
|
|
6221
5986
|
assertEx as assertEx42,
|
|
6222
5987
|
exists as exists9,
|
|
6223
|
-
isDefined as
|
|
5988
|
+
isDefined as isDefined18,
|
|
6224
5989
|
isHash as isHash2
|
|
6225
5990
|
} from "@xylabs/sdk-js";
|
|
6226
5991
|
import { isHashMeta as isHashMeta2, isPayloadBundle as isPayloadBundle2 } from "@xyo-network/sdk-js";
|
|
@@ -6291,7 +6056,7 @@ var SimpleMempoolViewer = class extends AbstractCreatableProvider {
|
|
|
6291
6056
|
let cursor = void 0;
|
|
6292
6057
|
if (isHash2(providedCursor)) {
|
|
6293
6058
|
const [p] = await this.pendingBlocksArchivist.get([providedCursor]);
|
|
6294
|
-
if (
|
|
6059
|
+
if (isDefined18(p)) {
|
|
6295
6060
|
cursor = p._sequence;
|
|
6296
6061
|
}
|
|
6297
6062
|
}
|
|
@@ -6311,7 +6076,7 @@ var SimpleMempoolViewer = class extends AbstractCreatableProvider {
|
|
|
6311
6076
|
let cursor = void 0;
|
|
6312
6077
|
if (isHash2(providedCursor)) {
|
|
6313
6078
|
const [p] = await this.pendingTransactionsArchivist.get([providedCursor]);
|
|
6314
|
-
if (
|
|
6079
|
+
if (isDefined18(p)) {
|
|
6315
6080
|
cursor = p._sequence;
|
|
6316
6081
|
}
|
|
6317
6082
|
}
|
|
@@ -6384,7 +6149,7 @@ var SimpleMempoolViewer = class extends AbstractCreatableProvider {
|
|
|
6384
6149
|
const hydratedResults = await Promise.all(
|
|
6385
6150
|
filteredBundles.map(async (bundle3) => {
|
|
6386
6151
|
const tx = await bundledPayloadToHydratedTransaction(bundle3);
|
|
6387
|
-
return
|
|
6152
|
+
return isDefined18(tx) ? { bundle: bundle3, tx } : void 0;
|
|
6388
6153
|
})
|
|
6389
6154
|
);
|
|
6390
6155
|
return hydratedResults.filter(exists9);
|
|
@@ -6456,7 +6221,7 @@ function deduplicateWithBundleBySigner(items) {
|
|
|
6456
6221
|
}
|
|
6457
6222
|
|
|
6458
6223
|
// src/simple/network/SimpleXyoNetwork.ts
|
|
6459
|
-
import { fetchJsonGet, isUndefined as
|
|
6224
|
+
import { fetchJsonGet, isUndefined as isUndefined8 } from "@xylabs/sdk-js";
|
|
6460
6225
|
import { isNetworkStatus } from "@xyo-network/xl1-protocol-lib";
|
|
6461
6226
|
|
|
6462
6227
|
// src/simple/network/lib/FailedNetworkStatusPayloads.ts
|
|
@@ -6504,7 +6269,7 @@ var SimpleXyoNetwork = class {
|
|
|
6504
6269
|
}
|
|
6505
6270
|
async status() {
|
|
6506
6271
|
const statusNetwork = StatusNetworks[this._networkId];
|
|
6507
|
-
if (
|
|
6272
|
+
if (isUndefined8(statusNetwork)) {
|
|
6508
6273
|
throw new Error(`Unknown status network ID: ${this._networkId}`);
|
|
6509
6274
|
}
|
|
6510
6275
|
return await this.makeRequest(statusNetwork.statusUrl);
|
|
@@ -6690,7 +6455,7 @@ var SimpleXyoSigner = class _SimpleXyoSigner extends AbstractCreatableProvider {
|
|
|
6690
6455
|
};
|
|
6691
6456
|
|
|
6692
6457
|
// src/simple/StakeEventsViewer/SimpleStakeEventsViewer.ts
|
|
6693
|
-
import { isDefined as
|
|
6458
|
+
import { isDefined as isDefined19 } from "@xylabs/sdk-js";
|
|
6694
6459
|
import { StakeEventsViewerMoniker } from "@xyo-network/xl1-protocol-lib";
|
|
6695
6460
|
var SimpleStakeEventsViewer = class extends AbstractCreatableProvider {
|
|
6696
6461
|
moniker = SimpleStakeEventsViewer.defaultMoniker;
|
|
@@ -6703,7 +6468,7 @@ var SimpleStakeEventsViewer = class extends AbstractCreatableProvider {
|
|
|
6703
6468
|
stakeEvents(range, { name } = {}) {
|
|
6704
6469
|
const positions = this.positionsFromRange(range);
|
|
6705
6470
|
const events = this.eventsFromPositions(positions);
|
|
6706
|
-
if (
|
|
6471
|
+
if (isDefined19(name)) {
|
|
6707
6472
|
return events.filter((event) => event.name === name);
|
|
6708
6473
|
}
|
|
6709
6474
|
return events;
|
|
@@ -7057,7 +6822,7 @@ RestSyncViewer = __decorateClass([
|
|
|
7057
6822
|
import {
|
|
7058
6823
|
asHash as asHash5,
|
|
7059
6824
|
assertEx as assertEx47,
|
|
7060
|
-
isDefined as
|
|
6825
|
+
isDefined as isDefined20
|
|
7061
6826
|
} from "@xylabs/sdk-js";
|
|
7062
6827
|
import {
|
|
7063
6828
|
asTimePayload as asTimePayload2,
|
|
@@ -7081,7 +6846,7 @@ var SimpleTimeSyncViewer = class extends AbstractCreatableProvider {
|
|
|
7081
6846
|
const [block, payloads] = assertEx47(await this.blockViewer.blockByNumber(asXL1BlockNumber11(from, true)), () => "Block not found");
|
|
7082
6847
|
const timeSchemaIndex = block.payload_schemas.indexOf(TimeSchema);
|
|
7083
6848
|
const hash = timeSchemaIndex === -1 ? void 0 : block.payload_hashes[timeSchemaIndex];
|
|
7084
|
-
const timePayload = asTimePayload2(
|
|
6849
|
+
const timePayload = asTimePayload2(isDefined20(hash) ? payloads.find((p) => p._hash === hash) : void 0);
|
|
7085
6850
|
if (timePayload === void 0) return 0;
|
|
7086
6851
|
switch (toDomain) {
|
|
7087
6852
|
case "xl1": {
|
|
@@ -7155,7 +6920,7 @@ var SimpleTimeSyncViewer = class extends AbstractCreatableProvider {
|
|
|
7155
6920
|
xl1Hash: assertEx47(xl1Hash, () => "No xl1 hash available from time sync service"),
|
|
7156
6921
|
epoch: Date.now()
|
|
7157
6922
|
};
|
|
7158
|
-
if (
|
|
6923
|
+
if (isDefined20(this.ethProvider)) {
|
|
7159
6924
|
const [ethereum, ethHashOrNull] = await this.currentTimeAndHash("ethereum");
|
|
7160
6925
|
const ethereumHash = asHash5(ethHashOrNull, () => "No ethereum hash available from time sync service");
|
|
7161
6926
|
timePayload.ethereum = ethereum;
|
|
@@ -7659,7 +7424,7 @@ import {
|
|
|
7659
7424
|
} from "@xyo-network/xl1-protocol-lib";
|
|
7660
7425
|
|
|
7661
7426
|
// src/test/buildBlock.ts
|
|
7662
|
-
import { assertEx as assertEx51, isDefined as
|
|
7427
|
+
import { assertEx as assertEx51, isDefined as isDefined21 } from "@xylabs/sdk-js";
|
|
7663
7428
|
import {
|
|
7664
7429
|
asAnyPayload as asAnyPayload5,
|
|
7665
7430
|
BoundWitnessBuilder as BoundWitnessBuilder3,
|
|
@@ -7743,7 +7508,7 @@ function buildStepHashes(blockNumber, inStepHashes, previousBlockHash, chainStep
|
|
|
7743
7508
|
completedStepRewardTransfers.push(createTransferPayload(chainStepRewardAddress2, { [completedStepRewardHolderAddress]: completedStepReward }));
|
|
7744
7509
|
}
|
|
7745
7510
|
step_hashes.push(assertEx51(previousBlockHash, () => `Previous block hash is required for step ${step} at block ${blockNumber}`));
|
|
7746
|
-
} else if (
|
|
7511
|
+
} else if (isDefined21(inStepHashes.at(i))) {
|
|
7747
7512
|
step_hashes.push(inStepHashes[i]);
|
|
7748
7513
|
}
|
|
7749
7514
|
}
|
|
@@ -8045,8 +7810,8 @@ var getUrl = (host, port) => {
|
|
|
8045
7810
|
var TODO = true;
|
|
8046
7811
|
|
|
8047
7812
|
// src/validation/schema/Mnemonic.ts
|
|
8048
|
-
import { z as
|
|
8049
|
-
var MnemonicStringZod =
|
|
7813
|
+
import { z as z31 } from "zod";
|
|
7814
|
+
var MnemonicStringZod = z31.string().transform((s) => s.trim().replaceAll(/\s+/g, " ")).refine(
|
|
8050
7815
|
(s) => [12, 15, 18, 21, 24].includes(s.split(" ").length),
|
|
8051
7816
|
{ message: "Mnemonic must contain 12, 15, 18, 21, or 24 words." }
|
|
8052
7817
|
).describe("BIP-39 mnemonic string");
|
|
@@ -8123,6 +7888,7 @@ export {
|
|
|
8123
7888
|
MemoryTransportConfigZod,
|
|
8124
7889
|
MissingCapabilityError,
|
|
8125
7890
|
MnemonicStringZod,
|
|
7891
|
+
MongoConfigZod,
|
|
8126
7892
|
MongoTransportConfigZod as MongoConnectionConfigZod,
|
|
8127
7893
|
MongoTransportConfigZod,
|
|
8128
7894
|
PENDING_BLOCKS_ARCHIVIST_ROLE,
|
|
@@ -8139,7 +7905,6 @@ export {
|
|
|
8139
7905
|
ProvidersConfigZod,
|
|
8140
7906
|
REJECTED_BLOCKS_ARCHIVIST_ROLE,
|
|
8141
7907
|
REJECTED_TRANSACTIONS_ARCHIVIST_ROLE,
|
|
8142
|
-
RemoteConfigZod,
|
|
8143
7908
|
RestTransportConfigZod as RestConnectionConfigZod,
|
|
8144
7909
|
RestDataLakeConfigZod,
|
|
8145
7910
|
RestDataLakeRunner,
|
|
@@ -8154,6 +7919,7 @@ export {
|
|
|
8154
7919
|
RpcTransportConfigZod,
|
|
8155
7920
|
RuntimeStatusMonitor,
|
|
8156
7921
|
RuntimeStatusMonitorZod,
|
|
7922
|
+
S3BucketConfigZod,
|
|
8157
7923
|
S3TransportConfigZod as S3ConnectionConfigZod,
|
|
8158
7924
|
S3TransportConfigZod,
|
|
8159
7925
|
SchemasStepSummarySchema,
|
|
@@ -8206,7 +7972,6 @@ export {
|
|
|
8206
7972
|
XL1_NETWORK_STAKING_GENESIS_PERIOD_TOTAL_REWARDS,
|
|
8207
7973
|
activeStakeAtTimeByAddress,
|
|
8208
7974
|
activeStakeAtTimeByPosition,
|
|
8209
|
-
adaptLegacyConfig,
|
|
8210
7975
|
addDataLakePayloads,
|
|
8211
7976
|
addDataLakePayloadsToPayloads,
|
|
8212
7977
|
allHashesPresent,
|
|
@@ -8286,9 +8051,8 @@ export {
|
|
|
8286
8051
|
flattenHydratedTransaction,
|
|
8287
8052
|
flattenHydratedTransactions,
|
|
8288
8053
|
generateXyoBaseWalletFromPhrase,
|
|
8054
|
+
getArchivistFactory,
|
|
8289
8055
|
getBlockRateBlocks,
|
|
8290
|
-
getEmptyContext,
|
|
8291
|
-
getEmptyProviderContext,
|
|
8292
8056
|
getProducerKey,
|
|
8293
8057
|
getTestProviderContext2 as getTestProviderContext,
|
|
8294
8058
|
getTestSimpleBlockViewerLocator,
|
|
@@ -8297,8 +8061,6 @@ export {
|
|
|
8297
8061
|
getWindowedChain,
|
|
8298
8062
|
hasDeclaredConnectionProfiles,
|
|
8299
8063
|
hasLabels,
|
|
8300
|
-
hasMongoConfig,
|
|
8301
|
-
hasS3Config,
|
|
8302
8064
|
hashFromBlockNumber,
|
|
8303
8065
|
hydrateBlock,
|
|
8304
8066
|
hydrateElevatedTransaction,
|
|
@@ -8354,13 +8116,14 @@ export {
|
|
|
8354
8116
|
providerFactoryDescription,
|
|
8355
8117
|
rateMultipliers,
|
|
8356
8118
|
readPayloadMapFromStore,
|
|
8119
|
+
registerArchivistFactory,
|
|
8357
8120
|
registerCreatableProviderFactories,
|
|
8358
8121
|
registerCreatableProviderFactory,
|
|
8359
8122
|
registerFactoriesFromPlan,
|
|
8123
|
+
resetArchivistFactories,
|
|
8360
8124
|
resolveConfig,
|
|
8361
8125
|
resolveProviders,
|
|
8362
8126
|
resolveProvidersFromConfig,
|
|
8363
|
-
resolveS3Bucket,
|
|
8364
8127
|
rewardFromBlockNumber,
|
|
8365
8128
|
schemasMaxStep,
|
|
8366
8129
|
schemasStepSummaryFromRange,
|
|
@@ -8379,6 +8142,7 @@ export {
|
|
|
8379
8142
|
stepsRewardTotalGenesisPeriod,
|
|
8380
8143
|
stepsRewardTotalRange,
|
|
8381
8144
|
surfaceForBranch,
|
|
8145
|
+
synthesizeRpcConnectionBindings,
|
|
8382
8146
|
timeDurations,
|
|
8383
8147
|
toActorConfig,
|
|
8384
8148
|
toActorConfigContext,
|