@xyo-network/xl1-protocol-sdk 3.0.6 → 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/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 +317 -567
- 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 +141 -207
- 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
|
@@ -1029,10 +1029,10 @@ import {
|
|
|
1029
1029
|
zodIsFactory as zodIsFactory2,
|
|
1030
1030
|
zodToFactory as zodToFactory2
|
|
1031
1031
|
} from "@xylabs/sdk-js";
|
|
1032
|
-
import { globalRegistry as
|
|
1032
|
+
import { globalRegistry as globalRegistry11, z as z16 } from "zod/mini";
|
|
1033
1033
|
|
|
1034
1034
|
// src/config/Base.ts
|
|
1035
|
-
import { z as
|
|
1035
|
+
import { z as z15 } from "zod/mini";
|
|
1036
1036
|
|
|
1037
1037
|
// src/config/Chain.ts
|
|
1038
1038
|
import { HexZod } from "@xylabs/sdk-js";
|
|
@@ -1052,148 +1052,129 @@ var ChainConfigZod = z.object({
|
|
|
1052
1052
|
});
|
|
1053
1053
|
|
|
1054
1054
|
// src/config/transports/Transport.ts
|
|
1055
|
-
import { globalRegistry as
|
|
1055
|
+
import { globalRegistry as globalRegistry3, z as z4 } from "zod";
|
|
1056
1056
|
|
|
1057
|
-
// src/config/
|
|
1057
|
+
// src/config/transports/Mongo.ts
|
|
1058
1058
|
import { globalRegistry as globalRegistry2, z as z2 } from "zod";
|
|
1059
|
-
var
|
|
1060
|
-
protocol: z2.string("http").register(globalRegistry2, {
|
|
1061
|
-
description: "Protocol for the RPC connection",
|
|
1062
|
-
type: "string"
|
|
1063
|
-
})
|
|
1064
|
-
}).describe("Base configuration for the remote RPC");
|
|
1065
|
-
var HttpRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
1066
|
-
protocol: z2.string("http").register(globalRegistry2, {
|
|
1067
|
-
description: "Protocol for the RPC connection",
|
|
1068
|
-
type: "string"
|
|
1069
|
-
}).default("http"),
|
|
1070
|
-
url: z2.string().register(globalRegistry2, {
|
|
1071
|
-
description: "URL for the Chain RPC API",
|
|
1072
|
-
type: "string"
|
|
1073
|
-
})
|
|
1074
|
-
}).describe("Configuration for the remote RPC using Http");
|
|
1075
|
-
var PostMessageRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
1076
|
-
protocol: z2.string().register(globalRegistry2, {
|
|
1077
|
-
description: "Protocol for the RPC connection",
|
|
1078
|
-
type: "string"
|
|
1079
|
-
}).default("postMessage"),
|
|
1080
|
-
networkId: z2.string().register(globalRegistry2, {
|
|
1081
|
-
description: "Network ID to use for the postMessage RPC connection",
|
|
1082
|
-
type: "string"
|
|
1083
|
-
}),
|
|
1084
|
-
sessionId: z2.string().register(globalRegistry2, {
|
|
1085
|
-
description: "Session ID to use for the postMessage RPC connection",
|
|
1086
|
-
type: "string"
|
|
1087
|
-
})
|
|
1088
|
-
}).describe("Configuration for the remote RPC using postMessage");
|
|
1089
|
-
var RpcRemoteConfigZod = z2.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod]).describe("Configuration for a remote RPC connection, either Http or postMessage");
|
|
1090
|
-
var RemoteConfigZod = z2.object({ rpc: RpcRemoteConfigZod.optional() }).describe("Configuration for remote connections, including RPC");
|
|
1091
|
-
|
|
1092
|
-
// src/config/storage/driver/Mongo.ts
|
|
1093
|
-
import { isDefined as isDefined4, isUndefined as isUndefined2 } from "@xylabs/sdk-js";
|
|
1094
|
-
import { globalRegistry as globalRegistry3, z as z3 } from "zod";
|
|
1095
|
-
var MongoConfigZod = z3.object({
|
|
1059
|
+
var MongoConfigZod = z2.object({
|
|
1096
1060
|
// TODO: Create from other arguments
|
|
1097
|
-
connectionString:
|
|
1061
|
+
connectionString: z2.string().nonempty().optional().register(globalRegistry2, {
|
|
1098
1062
|
description: "MongoDB connection string",
|
|
1099
1063
|
title: "storage.mongo.connectionString",
|
|
1100
1064
|
type: "string"
|
|
1101
1065
|
}),
|
|
1102
|
-
database:
|
|
1066
|
+
database: z2.string().nonempty().optional().register(globalRegistry2, {
|
|
1103
1067
|
description: "MongoDB database name",
|
|
1104
1068
|
title: "storage.mongo.database",
|
|
1105
1069
|
type: "string"
|
|
1106
1070
|
}),
|
|
1107
|
-
domain:
|
|
1071
|
+
domain: z2.string().nonempty().optional().register(globalRegistry2, {
|
|
1108
1072
|
description: "MongoDB domain",
|
|
1109
1073
|
title: "storage.mongo.domain",
|
|
1110
1074
|
type: "string"
|
|
1111
1075
|
}),
|
|
1112
|
-
password:
|
|
1076
|
+
password: z2.string().nonempty().optional().register(globalRegistry2, {
|
|
1113
1077
|
description: "MongoDB password",
|
|
1114
1078
|
title: "storage.mongo.password",
|
|
1115
1079
|
type: "string"
|
|
1116
1080
|
}),
|
|
1117
|
-
username:
|
|
1081
|
+
username: z2.string().nonempty().optional().register(globalRegistry2, {
|
|
1118
1082
|
description: "MongoDB username",
|
|
1119
1083
|
title: "storage.mongo.username",
|
|
1120
1084
|
type: "string"
|
|
1121
1085
|
})
|
|
1122
1086
|
});
|
|
1123
1087
|
|
|
1124
|
-
// src/config/
|
|
1125
|
-
import {
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
secretAccessKey: z4.string().nonempty().optional().describe("S3-compatible secret access key for this bucket (overrides the shared default)")
|
|
1134
|
-
});
|
|
1135
|
-
var S3ConfigZod = z4.object({
|
|
1136
|
-
accessKeyId: z4.string().nonempty().optional().describe("Shared S3-compatible access key id (default for all buckets)"),
|
|
1137
|
-
accountId: z4.string().nonempty().optional().describe("Shared account id (default for all buckets; on Cloudflare R2 it forms the endpoint)"),
|
|
1138
|
-
chainState: S3BucketConfigZod.optional().describe("Bucket for the mutable chain state (the head pointer)"),
|
|
1139
|
-
finalized: S3BucketConfigZod.optional().describe("Bucket for the finalized files (blocks, payloads, manifest)"),
|
|
1140
|
-
index: S3BucketConfigZod.optional().describe("Bucket for the chain index (the step-summary families)"),
|
|
1141
|
-
prefix: z4.string().nonempty().optional().describe("Shared key prefix (default for all buckets)"),
|
|
1142
|
-
secretAccessKey: z4.string().nonempty().optional().describe("Shared S3-compatible secret access key (default for all buckets)")
|
|
1088
|
+
// src/config/transports/S3.ts
|
|
1089
|
+
import { z as z3 } from "zod";
|
|
1090
|
+
var S3BucketConfigZod = z3.object({
|
|
1091
|
+
accessKeyId: z3.string().nonempty().optional().describe("S3-compatible access key id for this bucket (overrides the shared default)"),
|
|
1092
|
+
accountId: z3.string().nonempty().optional().describe("Account id for this bucket; on Cloudflare R2 it forms the endpoint (overrides the shared default)"),
|
|
1093
|
+
bucket: z3.string().nonempty().optional().describe("S3-compatible bucket name"),
|
|
1094
|
+
prefix: z3.string().nonempty().optional().describe("Optional key prefix within the bucket"),
|
|
1095
|
+
readUrl: z3.string().nonempty().optional().describe("Public HTTP/CDN base URL for anonymous reads of this bucket"),
|
|
1096
|
+
secretAccessKey: z3.string().nonempty().optional().describe("S3-compatible secret access key for this bucket (overrides the shared default)")
|
|
1143
1097
|
});
|
|
1144
1098
|
|
|
1145
1099
|
// src/config/transports/Transport.ts
|
|
1146
|
-
var LmdbTransportConfigZod =
|
|
1147
|
-
access:
|
|
1100
|
+
var LmdbTransportConfigZod = z4.object({
|
|
1101
|
+
access: z4.enum(["read", "write"]).optional().register(globalRegistry3, {
|
|
1148
1102
|
description: "Access mode for this LMDB connection (read or write)",
|
|
1149
1103
|
title: "transports.lmdb.access",
|
|
1150
1104
|
type: "string"
|
|
1151
1105
|
}),
|
|
1152
|
-
root:
|
|
1106
|
+
root: z4.string().register(globalRegistry3, {
|
|
1153
1107
|
description: "Root directory for local LMDB storage",
|
|
1154
1108
|
title: "transports.lmdb.root",
|
|
1155
1109
|
type: "string"
|
|
1156
1110
|
}),
|
|
1157
|
-
store:
|
|
1111
|
+
store: z4.string().optional().register(globalRegistry3, {
|
|
1158
1112
|
description: "Logical store name within the LMDB root (e.g. finalized-chain, mempool)",
|
|
1159
1113
|
title: "transports.lmdb.store",
|
|
1160
1114
|
type: "string"
|
|
1161
1115
|
}),
|
|
1162
|
-
type:
|
|
1116
|
+
type: z4.literal("lmdb")
|
|
1163
1117
|
}).describe("LMDB local storage transport");
|
|
1164
|
-
var MongoTransportConfigZod =
|
|
1165
|
-
type:
|
|
1118
|
+
var MongoTransportConfigZod = z4.object({
|
|
1119
|
+
type: z4.literal("mongo"),
|
|
1166
1120
|
connectionString: MongoConfigZod.shape.connectionString,
|
|
1167
1121
|
database: MongoConfigZod.shape.database,
|
|
1168
1122
|
domain: MongoConfigZod.shape.domain,
|
|
1169
1123
|
password: MongoConfigZod.shape.password,
|
|
1170
1124
|
username: MongoConfigZod.shape.username
|
|
1171
1125
|
}).describe("MongoDB storage transport");
|
|
1172
|
-
var RpcTransportConfigZod =
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1126
|
+
var RpcTransportConfigZod = z4.object({
|
|
1127
|
+
type: z4.literal("rpc"),
|
|
1128
|
+
protocol: z4.string().default("http").register(globalRegistry3, {
|
|
1129
|
+
description: "Protocol for the RPC connection (http or postMessage)",
|
|
1130
|
+
title: "transports.rpc.protocol",
|
|
1131
|
+
type: "string"
|
|
1132
|
+
}),
|
|
1133
|
+
url: z4.string().optional().register(globalRegistry3, {
|
|
1134
|
+
description: "URL for the Chain RPC API (http protocol)",
|
|
1135
|
+
title: "transports.rpc.url",
|
|
1136
|
+
type: "string"
|
|
1137
|
+
}),
|
|
1138
|
+
networkId: z4.string().optional().register(globalRegistry3, {
|
|
1139
|
+
description: "Network ID for the postMessage RPC connection",
|
|
1140
|
+
title: "transports.rpc.networkId",
|
|
1141
|
+
type: "string"
|
|
1142
|
+
}),
|
|
1143
|
+
sessionId: z4.string().optional().register(globalRegistry3, {
|
|
1144
|
+
description: "Session ID for the postMessage RPC connection",
|
|
1145
|
+
title: "transports.rpc.sessionId",
|
|
1146
|
+
type: "string"
|
|
1147
|
+
})
|
|
1148
|
+
}).describe("XL1 JSON-RPC transport");
|
|
1149
|
+
var RestTransportConfigZod = z4.object({
|
|
1150
|
+
type: z4.literal("rest"),
|
|
1151
|
+
baseUrl: z4.string().register(globalRegistry3, {
|
|
1176
1152
|
description: "HTTP base URL for REST reads",
|
|
1177
1153
|
title: "transports.rest.baseUrl",
|
|
1178
1154
|
type: "string"
|
|
1179
1155
|
})
|
|
1180
1156
|
}).describe("HTTP REST read transport");
|
|
1181
1157
|
var S3TransportConfigZod = S3BucketConfigZod.extend({
|
|
1182
|
-
type:
|
|
1183
|
-
accessKeyId:
|
|
1184
|
-
accountId:
|
|
1185
|
-
secretAccessKey:
|
|
1158
|
+
type: z4.literal("s3"),
|
|
1159
|
+
accessKeyId: z4.string().optional(),
|
|
1160
|
+
accountId: z4.string().optional(),
|
|
1161
|
+
secretAccessKey: z4.string().optional()
|
|
1186
1162
|
}).describe("S3-compatible object storage transport");
|
|
1187
|
-
var EvmRpcTransportConfigZod =
|
|
1188
|
-
type:
|
|
1189
|
-
url:
|
|
1163
|
+
var EvmRpcTransportConfigZod = z4.object({
|
|
1164
|
+
type: z4.literal("evm-rpc"),
|
|
1165
|
+
url: z4.string().register(globalRegistry3, {
|
|
1190
1166
|
description: "EVM JSON-RPC URL",
|
|
1191
1167
|
title: "transports.evm-rpc.url",
|
|
1192
1168
|
type: "string"
|
|
1169
|
+
}),
|
|
1170
|
+
chainId: z4.string().optional().register(globalRegistry3, {
|
|
1171
|
+
description: "EVM chain ID for this RPC endpoint; auto-detected from the endpoint when omitted",
|
|
1172
|
+
title: "transports.evm-rpc.chainId",
|
|
1173
|
+
type: "string"
|
|
1193
1174
|
})
|
|
1194
1175
|
}).describe("EVM JSON-RPC transport");
|
|
1195
|
-
var MemoryTransportConfigZod =
|
|
1196
|
-
var TransportConfigZod =
|
|
1176
|
+
var MemoryTransportConfigZod = z4.object({ type: z4.literal("memory") }).describe("In-process memory transport");
|
|
1177
|
+
var TransportConfigZod = z4.discriminatedUnion("type", [
|
|
1197
1178
|
LmdbTransportConfigZod,
|
|
1198
1179
|
MongoTransportConfigZod,
|
|
1199
1180
|
RpcTransportConfigZod,
|
|
@@ -1202,18 +1183,18 @@ var TransportConfigZod = z5.discriminatedUnion("type", [
|
|
|
1202
1183
|
EvmRpcTransportConfigZod,
|
|
1203
1184
|
MemoryTransportConfigZod
|
|
1204
1185
|
]);
|
|
1205
|
-
var TransportsConfigZod =
|
|
1186
|
+
var TransportsConfigZod = z4.record(z4.string(), TransportConfigZod).default({});
|
|
1206
1187
|
|
|
1207
1188
|
// src/config/DataLake/DataLake.ts
|
|
1208
|
-
import { z as
|
|
1189
|
+
import { z as z8 } from "zod";
|
|
1209
1190
|
|
|
1210
1191
|
// src/config/DataLake/RestDataLakeConfig.ts
|
|
1211
|
-
import { globalRegistry as
|
|
1192
|
+
import { globalRegistry as globalRegistry5, z as z6 } from "zod";
|
|
1212
1193
|
|
|
1213
1194
|
// src/config/DataLake/DataLakeRemoteConfig.ts
|
|
1214
|
-
import { globalRegistry as
|
|
1215
|
-
var DataLakeDriverConfigBaseZod =
|
|
1216
|
-
driver:
|
|
1195
|
+
import { globalRegistry as globalRegistry4, z as z5 } from "zod";
|
|
1196
|
+
var DataLakeDriverConfigBaseZod = z5.object({
|
|
1197
|
+
driver: z5.string().register(globalRegistry4, {
|
|
1217
1198
|
description: "Driver for the data lake",
|
|
1218
1199
|
type: "string"
|
|
1219
1200
|
})
|
|
@@ -1221,76 +1202,45 @@ var DataLakeDriverConfigBaseZod = z6.object({
|
|
|
1221
1202
|
|
|
1222
1203
|
// src/config/DataLake/RestDataLakeConfig.ts
|
|
1223
1204
|
var RestDataLakeConfigZod = DataLakeDriverConfigBaseZod.extend({
|
|
1224
|
-
driver:
|
|
1205
|
+
driver: z6.literal("rest").register(globalRegistry5, {
|
|
1225
1206
|
description: "Driver for the REST data lake",
|
|
1226
1207
|
type: "string"
|
|
1227
1208
|
}),
|
|
1228
|
-
url:
|
|
1209
|
+
url: z6.string().register(globalRegistry5, {
|
|
1229
1210
|
description: "URL for the REST data lake",
|
|
1230
1211
|
type: "string"
|
|
1231
1212
|
})
|
|
1232
1213
|
}).describe("Configuration for the REST data lake driver");
|
|
1233
1214
|
|
|
1234
1215
|
// src/config/DataLake/RouterDataLakeConfig.ts
|
|
1235
|
-
import { globalRegistry as
|
|
1236
|
-
var RouterDataLakeConfigZod =
|
|
1237
|
-
driver:
|
|
1216
|
+
import { globalRegistry as globalRegistry6, z as z7 } from "zod";
|
|
1217
|
+
var RouterDataLakeConfigZod = z7.object({
|
|
1218
|
+
driver: z7.literal("router").register(globalRegistry6, {
|
|
1238
1219
|
description: "Driver for the router data lake",
|
|
1239
1220
|
type: "string"
|
|
1240
1221
|
}),
|
|
1241
|
-
children:
|
|
1222
|
+
children: z7.array(z7.lazy(() => DataLakeConfigZod)).register(globalRegistry6, {
|
|
1242
1223
|
description: "Child data lake drivers",
|
|
1243
1224
|
type: "array"
|
|
1244
1225
|
})
|
|
1245
1226
|
}).describe("Configuration for the router data lake driver");
|
|
1246
1227
|
|
|
1247
1228
|
// src/config/DataLake/DataLake.ts
|
|
1248
|
-
var DataLakeConfigZod =
|
|
1249
|
-
|
|
1250
|
-
// src/config/Evm.ts
|
|
1251
|
-
import { globalRegistry as globalRegistry8, z as z10 } from "zod";
|
|
1252
|
-
var EvmInfuraConfigZod = z10.object({
|
|
1253
|
-
projectId: z10.string().optional().register(globalRegistry8, {
|
|
1254
|
-
description: "Infura project ID",
|
|
1255
|
-
title: "evm.infura.projectId",
|
|
1256
|
-
type: "string"
|
|
1257
|
-
}),
|
|
1258
|
-
projectSecret: z10.string().optional().register(globalRegistry8, {
|
|
1259
|
-
description: "Infura project secret",
|
|
1260
|
-
title: "evm.infura.projectSecret",
|
|
1261
|
-
type: "string"
|
|
1262
|
-
})
|
|
1263
|
-
});
|
|
1264
|
-
var EvmJsonRpcConfigZod = z10.object({
|
|
1265
|
-
url: z10.url().optional().register(globalRegistry8, {
|
|
1266
|
-
description: "JSON-RPC URL",
|
|
1267
|
-
title: "evm.jsonRpc.url",
|
|
1268
|
-
type: "string"
|
|
1269
|
-
})
|
|
1270
|
-
});
|
|
1271
|
-
var EvmConfigZod = z10.object({
|
|
1272
|
-
chainId: z10.string().optional().register(globalRegistry8, {
|
|
1273
|
-
description: "EVM chain ID",
|
|
1274
|
-
title: "evm.chainId",
|
|
1275
|
-
type: "string"
|
|
1276
|
-
}),
|
|
1277
|
-
infura: EvmInfuraConfigZod.optional().describe("Infura Provider configuration"),
|
|
1278
|
-
jsonRpc: EvmJsonRpcConfigZod.optional().describe("JSON-RPC Provider configuration")
|
|
1279
|
-
});
|
|
1229
|
+
var DataLakeConfigZod = z8.lazy(() => z8.union([RestDataLakeConfigZod, RouterDataLakeConfigZod])).describe("Configuration for a data lake");
|
|
1280
1230
|
|
|
1281
1231
|
// src/config/Log.ts
|
|
1282
1232
|
import { LogLevel } from "@xylabs/sdk-js";
|
|
1283
|
-
import { globalRegistry as
|
|
1233
|
+
import { globalRegistry as globalRegistry7, z as z9 } from "zod";
|
|
1284
1234
|
var LogLevelNames = Object.keys(LogLevel);
|
|
1285
|
-
var LogConfigZod =
|
|
1286
|
-
logLevel:
|
|
1235
|
+
var LogConfigZod = z9.object({
|
|
1236
|
+
logLevel: z9.enum(LogLevelNames).default("info").register(globalRegistry7, {
|
|
1287
1237
|
choices: LogLevelNames,
|
|
1288
1238
|
default: "info",
|
|
1289
1239
|
description: "Desired process verbosity",
|
|
1290
1240
|
title: "logLevel",
|
|
1291
1241
|
type: "string"
|
|
1292
1242
|
}),
|
|
1293
|
-
silent:
|
|
1243
|
+
silent: z9.boolean().default(false).register(globalRegistry7, {
|
|
1294
1244
|
default: false,
|
|
1295
1245
|
description: "Whether to run in silent mode",
|
|
1296
1246
|
title: "silent",
|
|
@@ -1299,23 +1249,23 @@ var LogConfigZod = z11.object({
|
|
|
1299
1249
|
});
|
|
1300
1250
|
|
|
1301
1251
|
// src/config/ProviderBinding.ts
|
|
1302
|
-
import { globalRegistry as
|
|
1303
|
-
var ProviderBindingConfigZod =
|
|
1304
|
-
connection:
|
|
1252
|
+
import { globalRegistry as globalRegistry8, z as z10 } from "zod";
|
|
1253
|
+
var ProviderBindingConfigZod = z10.object({
|
|
1254
|
+
connection: z10.string().optional().register(globalRegistry8, {
|
|
1305
1255
|
description: "Named connection from the top-level connections map",
|
|
1306
1256
|
title: "providerBindings.connection",
|
|
1307
1257
|
type: "string"
|
|
1308
1258
|
}),
|
|
1309
|
-
transport:
|
|
1259
|
+
transport: z10.string().optional().register(globalRegistry8, {
|
|
1310
1260
|
description: "Deprecated alias for connection (kept in sync during migration)",
|
|
1311
1261
|
title: "providerBindings.transport",
|
|
1312
1262
|
type: "string"
|
|
1313
1263
|
})
|
|
1314
1264
|
}).describe("Provider connection binding");
|
|
1315
|
-
var ProviderBindingsConfigZod =
|
|
1265
|
+
var ProviderBindingsConfigZod = z10.record(z10.string(), ProviderBindingConfigZod).default({});
|
|
1316
1266
|
|
|
1317
1267
|
// src/config/Providers.ts
|
|
1318
|
-
import
|
|
1268
|
+
import z12 from "zod";
|
|
1319
1269
|
|
|
1320
1270
|
// src/config/Provider.ts
|
|
1321
1271
|
import {
|
|
@@ -1323,55 +1273,43 @@ import {
|
|
|
1323
1273
|
zodIsFactory,
|
|
1324
1274
|
zodToFactory
|
|
1325
1275
|
} from "@xylabs/sdk-js";
|
|
1326
|
-
import { z as
|
|
1327
|
-
var ProviderConfigZod =
|
|
1328
|
-
moniker:
|
|
1329
|
-
labels:
|
|
1276
|
+
import { z as z11 } from "zod";
|
|
1277
|
+
var ProviderConfigZod = z11.object({
|
|
1278
|
+
moniker: z11.string(),
|
|
1279
|
+
labels: z11.array(z11.string()).optional()
|
|
1330
1280
|
}).describe("Configuration for a Provider");
|
|
1331
1281
|
var isProviderConfig = zodIsFactory(ProviderConfigZod);
|
|
1332
1282
|
var asProviderConfig = zodAsFactory(ProviderConfigZod, "asProviderConfig");
|
|
1333
1283
|
var toProviderConfig = zodToFactory(ProviderConfigZod, "toProviderConfig");
|
|
1334
1284
|
|
|
1335
1285
|
// src/config/Providers.ts
|
|
1336
|
-
var ProvidersConfigZod =
|
|
1337
|
-
|
|
1338
|
-
// src/config/storage/Storage.ts
|
|
1339
|
-
import { globalRegistry as globalRegistry11, z as z15 } from "zod";
|
|
1340
|
-
var StorageConfigZod = z15.object({
|
|
1341
|
-
mongo: MongoConfigZod.optional().describe("Configuration for the MongoD storage driver"),
|
|
1342
|
-
root: z15.string().optional().register(globalRegistry11, {
|
|
1343
|
-
description: "Root directory for local storage",
|
|
1344
|
-
title: "storage.root",
|
|
1345
|
-
type: "string"
|
|
1346
|
-
}),
|
|
1347
|
-
s3: S3ConfigZod.optional().describe("Configuration for S3-compatible object storage (e.g. Cloudflare R2)")
|
|
1348
|
-
}).describe("Storage configuration options");
|
|
1286
|
+
var ProvidersConfigZod = z12.array(ProviderConfigZod.loose()).describe("Configuration for providers").default([]);
|
|
1349
1287
|
|
|
1350
1288
|
// src/config/Telemetry.ts
|
|
1351
|
-
import { globalRegistry as
|
|
1352
|
-
var MetricsScrapeConfigZod =
|
|
1353
|
-
path:
|
|
1289
|
+
import { globalRegistry as globalRegistry9, z as z13 } from "zod";
|
|
1290
|
+
var MetricsScrapeConfigZod = z13.object({
|
|
1291
|
+
path: z13.string().default("/metrics").register(globalRegistry9, {
|
|
1354
1292
|
default: "/metrics",
|
|
1355
1293
|
description: "Path for the metrics scrape endpoint",
|
|
1356
1294
|
title: "telemetry.metrics.scrape.path",
|
|
1357
1295
|
type: "string"
|
|
1358
1296
|
}),
|
|
1359
|
-
port:
|
|
1360
|
-
description: "Port for the metrics scrape endpoint",
|
|
1297
|
+
port: z13.coerce.number().int().nonnegative().optional().register(globalRegistry9, {
|
|
1298
|
+
description: "Port for the metrics scrape endpoint (0 disables the scrape endpoint)",
|
|
1361
1299
|
title: "telemetry.metrics.scrape.port",
|
|
1362
1300
|
type: "number"
|
|
1363
1301
|
})
|
|
1364
1302
|
}).describe("Metrics scrape configuration");
|
|
1365
|
-
var MetricsConfigZod =
|
|
1366
|
-
var OpenTelemetryConfigZod =
|
|
1303
|
+
var MetricsConfigZod = z13.object({ scrape: MetricsScrapeConfigZod }).describe("Metrics configuration options");
|
|
1304
|
+
var OpenTelemetryConfigZod = z13.object({
|
|
1367
1305
|
// OpenTelemetry options
|
|
1368
|
-
otlpEndpoint:
|
|
1306
|
+
otlpEndpoint: z13.url().optional().register(globalRegistry9, {
|
|
1369
1307
|
description: "OTLP endpoint for exporting telemetry data",
|
|
1370
1308
|
title: "telemetry.otel.otlpEndpoint",
|
|
1371
1309
|
type: "string"
|
|
1372
1310
|
})
|
|
1373
1311
|
});
|
|
1374
|
-
var TelemetryConfigZod =
|
|
1312
|
+
var TelemetryConfigZod = z13.object({
|
|
1375
1313
|
// Metrics configuration
|
|
1376
1314
|
metrics: MetricsConfigZod.optional().describe("Metrics configuration"),
|
|
1377
1315
|
// OpenTelemetry configuration
|
|
@@ -1380,14 +1318,14 @@ var TelemetryConfigZod = z16.object({
|
|
|
1380
1318
|
|
|
1381
1319
|
// src/config/Validation.ts
|
|
1382
1320
|
import { XyoAddressZod as XyoAddressZod2 } from "@xyo-network/sdk-js";
|
|
1383
|
-
import { globalRegistry as
|
|
1321
|
+
import { globalRegistry as globalRegistry10, z as z14 } from "zod";
|
|
1384
1322
|
|
|
1385
1323
|
// src/primitives/block/rate/blockRate.ts
|
|
1386
|
-
import { isDefined as
|
|
1324
|
+
import { isDefined as isDefined5, isFalsy } from "@xylabs/sdk-js";
|
|
1387
1325
|
import { asXL1BlockRange } from "@xyo-network/xl1-protocol-lib";
|
|
1388
1326
|
|
|
1389
1327
|
// src/primitives/block/rate/timeHelpers.ts
|
|
1390
|
-
import { assertEx as assertEx10, isDefined as
|
|
1328
|
+
import { assertEx as assertEx10, isDefined as isDefined4 } from "@xylabs/sdk-js";
|
|
1391
1329
|
var rateMultipliers = {
|
|
1392
1330
|
millis: 1,
|
|
1393
1331
|
seconds: 1e3,
|
|
@@ -1405,7 +1343,7 @@ var timeDurations = (timeInMs) => ({
|
|
|
1405
1343
|
weeks: timeInMs / (1e3 * 60 * 60 * 24 * 7)
|
|
1406
1344
|
});
|
|
1407
1345
|
var getTimeConfigInMilliseconds = (timeConfig) => {
|
|
1408
|
-
const assertedTimeConfig = assertEx10(
|
|
1346
|
+
const assertedTimeConfig = assertEx10(isDefined4(timeConfig) ? timeConfig : void 0, () => "Time configuration must be provided");
|
|
1409
1347
|
let totalMilliseconds = 0;
|
|
1410
1348
|
if ("years" in assertedTimeConfig) {
|
|
1411
1349
|
totalMilliseconds += assertedTimeConfig.years * 31536e6;
|
|
@@ -1444,13 +1382,13 @@ var blockRate = (startBlock, endBlock, timeUnit) => {
|
|
|
1444
1382
|
throw new Error("Time difference must be greater than 0");
|
|
1445
1383
|
}
|
|
1446
1384
|
const rate = heightDifference / timeDifference;
|
|
1447
|
-
const timeUnitValue =
|
|
1448
|
-
const returnedTimeDifference =
|
|
1385
|
+
const timeUnitValue = isDefined5(timeUnit) ? timeUnit : "millis";
|
|
1386
|
+
const returnedTimeDifference = isDefined5(timeUnit) ? timeDurations(timeDifference)[timeUnit] : timeDifference;
|
|
1449
1387
|
const timePerBlock = returnedTimeDifference / heightDifference;
|
|
1450
1388
|
return {
|
|
1451
1389
|
range: asXL1BlockRange([startingBlock.block, endingBlock.block], true),
|
|
1452
1390
|
span: heightDifference,
|
|
1453
|
-
rate:
|
|
1391
|
+
rate: isDefined5(timeUnit) ? rate * rateMultipliers[timeUnit] : rate,
|
|
1454
1392
|
timeUnit: timeUnitValue,
|
|
1455
1393
|
timeDifference: returnedTimeDifference,
|
|
1456
1394
|
timePerBlock
|
|
@@ -1498,7 +1436,7 @@ var calculateStepSizeRate = async (viewer, start, stepIndex, count = 1, timeUnit
|
|
|
1498
1436
|
// src/primitives/block/rate/timeRate.ts
|
|
1499
1437
|
import {
|
|
1500
1438
|
assertEx as assertEx12,
|
|
1501
|
-
isDefined as
|
|
1439
|
+
isDefined as isDefined6,
|
|
1502
1440
|
isDefinedNotNull
|
|
1503
1441
|
} from "@xylabs/sdk-js";
|
|
1504
1442
|
import { asXL1BlockNumber as asXL1BlockNumber7, asXL1BlockRange as asXL1BlockRange3 } from "@xyo-network/xl1-protocol-lib";
|
|
@@ -1537,7 +1475,7 @@ var findEndBlockRecursive = async (viewer, startBlock, targetTimeMs, estimatedBl
|
|
|
1537
1475
|
}
|
|
1538
1476
|
const endBlock = await viewer.blockByNumber(estimatedEndBlockNumber);
|
|
1539
1477
|
const resolvedEndBlock = assertEx12(
|
|
1540
|
-
|
|
1478
|
+
isDefined6(endBlock?.[0]) ? endBlock[0] : void 0,
|
|
1541
1479
|
() => `Could not retrieve block ${estimatedEndBlockNumber} for time rate calculation`
|
|
1542
1480
|
);
|
|
1543
1481
|
const endBlockEpoch = resolvedEndBlock.$epoch;
|
|
@@ -1620,24 +1558,24 @@ var DEFAULT_MIN_CANDIDATES = 1;
|
|
|
1620
1558
|
var DEFAULT_BACKOFF_MS = 12e4;
|
|
1621
1559
|
|
|
1622
1560
|
// src/config/Validation.ts
|
|
1623
|
-
var ValidationConfigZod =
|
|
1624
|
-
allowedRewardRedeemers:
|
|
1561
|
+
var ValidationConfigZod = z14.object({
|
|
1562
|
+
allowedRewardRedeemers: z14.array(XyoAddressZod2).optional().register(globalRegistry10, {
|
|
1625
1563
|
description: "List of allowed reward redeemer addresses, if undefined anyone can participate",
|
|
1626
1564
|
title: "allowedRewardRedeemers",
|
|
1627
1565
|
type: "array"
|
|
1628
1566
|
}),
|
|
1629
|
-
allowedRewardEscrowAccountSigners:
|
|
1567
|
+
allowedRewardEscrowAccountSigners: z14.array(XyoAddressZod2).optional().register(globalRegistry10, {
|
|
1630
1568
|
description: "List of allowed reward escrow account signer addresses, if undefined anyone can participate",
|
|
1631
1569
|
title: "allowedRewardEscrowAccountSigners",
|
|
1632
1570
|
type: "array"
|
|
1633
1571
|
}),
|
|
1634
|
-
minCandidates:
|
|
1572
|
+
minCandidates: z14.coerce.number().default(DEFAULT_MIN_CANDIDATES).register(globalRegistry10, {
|
|
1635
1573
|
default: DEFAULT_MIN_CANDIDATES,
|
|
1636
1574
|
description: "Minimum number of uncle candidates before selecting the best uncle",
|
|
1637
1575
|
title: "validation.minCandidates",
|
|
1638
1576
|
type: "number"
|
|
1639
1577
|
}),
|
|
1640
|
-
backoffMs:
|
|
1578
|
+
backoffMs: z14.coerce.number().default(DEFAULT_BACKOFF_MS).register(globalRegistry10, {
|
|
1641
1579
|
default: DEFAULT_BACKOFF_MS,
|
|
1642
1580
|
description: "Back-off timeout in ms. If head age exceeds this, minCandidates is ignored",
|
|
1643
1581
|
title: "validation.backoffMs",
|
|
@@ -1646,29 +1584,25 @@ var ValidationConfigZod = z17.object({
|
|
|
1646
1584
|
});
|
|
1647
1585
|
|
|
1648
1586
|
// src/config/Base.ts
|
|
1649
|
-
var BaseConfigZod =
|
|
1650
|
-
chain:
|
|
1651
|
-
dataLake:
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
transports: z18._default(TransportsConfigZod, TransportsConfigZod.parse({})).check(z18.describe("Deprecated alias for connections (kept in sync during migration)")),
|
|
1659
|
-
storage: z18._default(StorageConfigZod, StorageConfigZod.parse({})).check(z18.describe("Configuration for the storage")),
|
|
1660
|
-
telemetry: z18._default(TelemetryConfigZod, TelemetryConfigZod.parse({})).check(z18.describe("Configuration for telemetry")),
|
|
1661
|
-
validation: z18._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z18.describe("Configuration for validation"))
|
|
1587
|
+
var BaseConfigZod = z15.object({
|
|
1588
|
+
chain: z15._default(ChainConfigZod, ChainConfigZod.parse({})).check(z15.describe("Configuration for the chain")),
|
|
1589
|
+
dataLake: z15.optional(DataLakeConfigZod).check(z15.describe("Configuration for data lakes")),
|
|
1590
|
+
log: z15._default(LogConfigZod, LogConfigZod.parse({})).check(z15.describe("Configuration for logging")),
|
|
1591
|
+
connections: z15._default(TransportsConfigZod, TransportsConfigZod.parse({})).check(z15.describe("Named connection profiles (rpc, rest, s3, lmdb, mongo, evm-rpc)")),
|
|
1592
|
+
providerBindings: z15._default(ProviderBindingsConfigZod, ProviderBindingsConfigZod.parse({})).check(z15.describe("Per-moniker provider connection bindings")),
|
|
1593
|
+
providers: z15._default(ProvidersConfigZod, ProvidersConfigZod.parse([])).check(z15.describe("Configuration for providers")),
|
|
1594
|
+
telemetry: z15._default(TelemetryConfigZod, TelemetryConfigZod.parse({})).check(z15.describe("Configuration for telemetry")),
|
|
1595
|
+
validation: z15._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z15.describe("Configuration for validation"))
|
|
1662
1596
|
});
|
|
1663
1597
|
|
|
1664
1598
|
// src/config/Actor.ts
|
|
1665
|
-
var AccountPathZod =
|
|
1599
|
+
var AccountPathZod = z16.string().check(z16.regex(
|
|
1666
1600
|
/^(m(\/\d+'?)+|\d+'?(\/\d+'?)*)$/,
|
|
1667
1601
|
`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".`
|
|
1668
1602
|
));
|
|
1669
|
-
var ActorConfigZod =
|
|
1670
|
-
name:
|
|
1671
|
-
accountPath:
|
|
1603
|
+
var ActorConfigZod = z16.extend(BaseConfigZod, {
|
|
1604
|
+
name: z16.string(),
|
|
1605
|
+
accountPath: z16.optional(AccountPathZod).register(globalRegistry11, {
|
|
1672
1606
|
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.',
|
|
1673
1607
|
title: "accountPath",
|
|
1674
1608
|
type: "string"
|
|
@@ -1679,22 +1613,22 @@ var asActorConfig = zodAsFactory2(ActorConfigZod, "asActorConfig");
|
|
|
1679
1613
|
var toActorConfig = zodToFactory2(ActorConfigZod, "toActorConfig");
|
|
1680
1614
|
|
|
1681
1615
|
// src/config/Actors.ts
|
|
1682
|
-
import { z as
|
|
1683
|
-
var ActorsConfigZod =
|
|
1684
|
-
|
|
1616
|
+
import { z as z17 } from "zod/mini";
|
|
1617
|
+
var ActorsConfigZod = z17._default(
|
|
1618
|
+
z17.array(z17.looseObject(ActorConfigZod.shape)).check(z17.describe("Actor-specific configurations that override the base configuration when the actor is running")),
|
|
1685
1619
|
[]
|
|
1686
1620
|
);
|
|
1687
1621
|
|
|
1688
1622
|
// src/config/Config.ts
|
|
1689
|
-
import { globalRegistry as
|
|
1690
|
-
var ConfigZod =
|
|
1623
|
+
import { globalRegistry as globalRegistry12, z as z18 } from "zod/mini";
|
|
1624
|
+
var ConfigZod = z18.extend(BaseConfigZod, {
|
|
1691
1625
|
actors: ActorsConfigZod,
|
|
1692
|
-
healthCheckPort:
|
|
1626
|
+
healthCheckPort: z18.optional(z18.coerce.number()).register(globalRegistry12, {
|
|
1693
1627
|
description: "Port for the system-wide health, readiness, and liveness endpoints (/healthz, /livez, /readyz). Set to 0 to disable.",
|
|
1694
1628
|
title: "healthCheckPort",
|
|
1695
1629
|
type: "number"
|
|
1696
1630
|
})
|
|
1697
|
-
}).check(
|
|
1631
|
+
}).check(z18.describe("The complete configuration for the protocol, including global settings and actor-specific overrides"));
|
|
1698
1632
|
|
|
1699
1633
|
// src/summary/primitives/blocks/blocksMaxStep.ts
|
|
1700
1634
|
var blocksMaxStep = 3;
|
|
@@ -1769,7 +1703,7 @@ async function blocksStepSummaryFromRange(context, semaphores, blockViewer, summ
|
|
|
1769
1703
|
import {
|
|
1770
1704
|
assertEx as assertEx15,
|
|
1771
1705
|
exists,
|
|
1772
|
-
isUndefined as
|
|
1706
|
+
isUndefined as isUndefined2
|
|
1773
1707
|
} from "@xylabs/sdk-js";
|
|
1774
1708
|
import { LruCacheMap as LruCacheMap2 } from "@xyo-network/xl1-driver-memory";
|
|
1775
1709
|
import {
|
|
@@ -1945,7 +1879,7 @@ var SimpleBlockViewer = class extends AbstractCreatableProvider {
|
|
|
1945
1879
|
async blockByNumber(blockNumber) {
|
|
1946
1880
|
return await this.spanAsync("blockByNumber", async () => {
|
|
1947
1881
|
const chainContext = await this.getChainContextRead();
|
|
1948
|
-
if (
|
|
1882
|
+
if (isUndefined2(chainContext.head)) {
|
|
1949
1883
|
return null;
|
|
1950
1884
|
}
|
|
1951
1885
|
return await this.blockByNumberWithContext(chainContext, blockNumber);
|
|
@@ -1971,7 +1905,7 @@ var SimpleBlockViewer = class extends AbstractCreatableProvider {
|
|
|
1971
1905
|
assertEx15(limit > 0, () => "limit must be greater than 0");
|
|
1972
1906
|
assertEx15(limit <= 100, () => "limit must be less than 100");
|
|
1973
1907
|
const chainContext = await this.getChainContextRead();
|
|
1974
|
-
if (
|
|
1908
|
+
if (isUndefined2(chainContext.head)) {
|
|
1975
1909
|
return [];
|
|
1976
1910
|
}
|
|
1977
1911
|
const blocks = [];
|
|
@@ -1994,7 +1928,7 @@ var SimpleBlockViewer = class extends AbstractCreatableProvider {
|
|
|
1994
1928
|
() => `blocksByStep does not support step levels above ${blocksMaxStep} (requested ${stepLevel})`
|
|
1995
1929
|
);
|
|
1996
1930
|
const chainContext = await this.getChainContextRead();
|
|
1997
|
-
if (
|
|
1931
|
+
if (isUndefined2(chainContext.head)) {
|
|
1998
1932
|
return [];
|
|
1999
1933
|
}
|
|
2000
1934
|
const start = stepIndex * size;
|