@xyo-network/xl1-protocol-sdk 2.2.1 → 3.0.0
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 +35 -2
- package/dist/neutral/CreatableProvider/AbstractCreatableProvider.d.ts.map +1 -1
- package/dist/neutral/capabilities/Capability.d.ts +1 -8
- package/dist/neutral/capabilities/Capability.d.ts.map +1 -1
- package/dist/neutral/capabilities/Provider.d.ts +14 -23
- package/dist/neutral/capabilities/Provider.d.ts.map +1 -1
- package/dist/neutral/capabilities/connectionTypes.d.ts +9 -0
- package/dist/neutral/capabilities/connectionTypes.d.ts.map +1 -0
- package/dist/neutral/capabilities/index.d.ts +1 -0
- package/dist/neutral/capabilities/index.d.ts.map +1 -1
- package/dist/neutral/capabilities/resolveProviders.d.ts +27 -20
- package/dist/neutral/capabilities/resolveProviders.d.ts.map +1 -1
- package/dist/neutral/config/Actor.d.ts +216 -12
- package/dist/neutral/config/Actor.d.ts.map +1 -1
- package/dist/neutral/config/Actors.d.ts +41 -2
- package/dist/neutral/config/Actors.d.ts.map +1 -1
- package/dist/neutral/config/Base.d.ts +41 -2
- package/dist/neutral/config/Base.d.ts.map +1 -1
- package/dist/neutral/config/Config.d.ts +152 -8
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/HostActor.d.ts +216 -12
- package/dist/neutral/config/HostActor.d.ts.map +1 -1
- package/dist/neutral/config/ProviderBinding.d.ts +4 -5
- package/dist/neutral/config/ProviderBinding.d.ts.map +1 -1
- package/dist/neutral/config/adaptLegacyConfig.d.ts +2 -3
- package/dist/neutral/config/adaptLegacyConfig.d.ts.map +1 -1
- package/dist/neutral/config/connections/index.d.ts +6 -0
- package/dist/neutral/config/connections/index.d.ts.map +1 -0
- package/dist/neutral/config/index.d.ts +2 -0
- package/dist/neutral/config/index.d.ts.map +1 -1
- package/dist/neutral/config/normalizeConnectionsConfig.d.ts +20 -0
- package/dist/neutral/config/normalizeConnectionsConfig.d.ts.map +1 -0
- package/dist/neutral/config/transports/Transport.d.ts +18 -3
- package/dist/neutral/config/transports/Transport.d.ts.map +1 -1
- package/dist/neutral/context/Actor.d.ts +216 -12
- package/dist/neutral/context/Actor.d.ts.map +1 -1
- package/dist/neutral/context/HostActor.d.ts +216 -12
- package/dist/neutral/context/HostActor.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.d.ts +70 -4
- package/dist/neutral/getFileConfig.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.mjs +204 -191
- package/dist/neutral/getFileConfig.mjs.map +4 -4
- package/dist/neutral/index.mjs +570 -393
- package/dist/neutral/index.mjs.map +4 -4
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts +216 -12
- 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 +204 -191
- package/dist/neutral/test/index.mjs.map +4 -4
- package/package.json +6 -6
|
@@ -1051,16 +1051,167 @@ var ChainConfigZod = z.object({
|
|
|
1051
1051
|
})
|
|
1052
1052
|
});
|
|
1053
1053
|
|
|
1054
|
+
// src/config/transports/Transport.ts
|
|
1055
|
+
import { globalRegistry as globalRegistry4, z as z5 } from "zod";
|
|
1056
|
+
|
|
1057
|
+
// src/config/Remote.ts
|
|
1058
|
+
import { globalRegistry as globalRegistry2, z as z2 } from "zod";
|
|
1059
|
+
var RpcRemoteConfigBaseZod = z2.object({
|
|
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({
|
|
1096
|
+
// TODO: Create from other arguments
|
|
1097
|
+
connectionString: z3.string().nonempty().optional().register(globalRegistry3, {
|
|
1098
|
+
description: "MongoDB connection string",
|
|
1099
|
+
title: "storage.mongo.connectionString",
|
|
1100
|
+
type: "string"
|
|
1101
|
+
}),
|
|
1102
|
+
database: z3.string().nonempty().optional().register(globalRegistry3, {
|
|
1103
|
+
description: "MongoDB database name",
|
|
1104
|
+
title: "storage.mongo.database",
|
|
1105
|
+
type: "string"
|
|
1106
|
+
}),
|
|
1107
|
+
domain: z3.string().nonempty().optional().register(globalRegistry3, {
|
|
1108
|
+
description: "MongoDB domain",
|
|
1109
|
+
title: "storage.mongo.domain",
|
|
1110
|
+
type: "string"
|
|
1111
|
+
}),
|
|
1112
|
+
password: z3.string().nonempty().optional().register(globalRegistry3, {
|
|
1113
|
+
description: "MongoDB password",
|
|
1114
|
+
title: "storage.mongo.password",
|
|
1115
|
+
type: "string"
|
|
1116
|
+
}),
|
|
1117
|
+
username: z3.string().nonempty().optional().register(globalRegistry3, {
|
|
1118
|
+
description: "MongoDB username",
|
|
1119
|
+
title: "storage.mongo.username",
|
|
1120
|
+
type: "string"
|
|
1121
|
+
})
|
|
1122
|
+
});
|
|
1123
|
+
|
|
1124
|
+
// src/config/storage/driver/S3.ts
|
|
1125
|
+
import { isDefined as isDefined5 } from "@xylabs/sdk-js";
|
|
1126
|
+
import { z as z4 } from "zod";
|
|
1127
|
+
var S3BucketConfigZod = z4.object({
|
|
1128
|
+
accessKeyId: z4.string().nonempty().optional().describe("S3-compatible access key id for this bucket (overrides the shared default)"),
|
|
1129
|
+
accountId: z4.string().nonempty().optional().describe("Account id for this bucket; on Cloudflare R2 it forms the endpoint (overrides the shared default)"),
|
|
1130
|
+
bucket: z4.string().nonempty().optional().describe("S3-compatible bucket name"),
|
|
1131
|
+
prefix: z4.string().nonempty().optional().describe("Optional key prefix within the bucket"),
|
|
1132
|
+
readUrl: z4.string().nonempty().optional().describe("Public HTTP/CDN base URL for anonymous reads of this bucket"),
|
|
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)")
|
|
1143
|
+
});
|
|
1144
|
+
|
|
1145
|
+
// src/config/transports/Transport.ts
|
|
1146
|
+
var LmdbTransportConfigZod = z5.object({
|
|
1147
|
+
access: z5.enum(["read", "write"]).optional().register(globalRegistry4, {
|
|
1148
|
+
description: "Access mode for this LMDB connection (read or write)",
|
|
1149
|
+
title: "transports.lmdb.access",
|
|
1150
|
+
type: "string"
|
|
1151
|
+
}),
|
|
1152
|
+
root: z5.string().register(globalRegistry4, {
|
|
1153
|
+
description: "Root directory for local LMDB storage",
|
|
1154
|
+
title: "transports.lmdb.root",
|
|
1155
|
+
type: "string"
|
|
1156
|
+
}),
|
|
1157
|
+
store: z5.string().optional().register(globalRegistry4, {
|
|
1158
|
+
description: "Logical store name within the LMDB root (e.g. finalized-chain, mempool)",
|
|
1159
|
+
title: "transports.lmdb.store",
|
|
1160
|
+
type: "string"
|
|
1161
|
+
}),
|
|
1162
|
+
type: z5.literal("lmdb")
|
|
1163
|
+
}).describe("LMDB local storage transport");
|
|
1164
|
+
var MongoTransportConfigZod = z5.object({
|
|
1165
|
+
type: z5.literal("mongo"),
|
|
1166
|
+
connectionString: MongoConfigZod.shape.connectionString,
|
|
1167
|
+
database: MongoConfigZod.shape.database,
|
|
1168
|
+
domain: MongoConfigZod.shape.domain,
|
|
1169
|
+
password: MongoConfigZod.shape.password,
|
|
1170
|
+
username: MongoConfigZod.shape.username
|
|
1171
|
+
}).describe("MongoDB storage transport");
|
|
1172
|
+
var RpcTransportConfigZod = HttpRpcRemoteConfigZod.extend({ type: z5.literal("rpc") }).describe("XL1 JSON-RPC transport");
|
|
1173
|
+
var RestTransportConfigZod = z5.object({
|
|
1174
|
+
type: z5.literal("rest"),
|
|
1175
|
+
baseUrl: z5.string().register(globalRegistry4, {
|
|
1176
|
+
description: "HTTP base URL for REST reads",
|
|
1177
|
+
title: "transports.rest.baseUrl",
|
|
1178
|
+
type: "string"
|
|
1179
|
+
})
|
|
1180
|
+
}).describe("HTTP REST read transport");
|
|
1181
|
+
var S3TransportConfigZod = S3BucketConfigZod.extend({
|
|
1182
|
+
type: z5.literal("s3"),
|
|
1183
|
+
accessKeyId: z5.string().optional(),
|
|
1184
|
+
accountId: z5.string().optional(),
|
|
1185
|
+
secretAccessKey: z5.string().optional()
|
|
1186
|
+
}).describe("S3-compatible object storage transport");
|
|
1187
|
+
var EvmRpcTransportConfigZod = z5.object({
|
|
1188
|
+
type: z5.literal("evm-rpc"),
|
|
1189
|
+
url: z5.string().register(globalRegistry4, {
|
|
1190
|
+
description: "EVM JSON-RPC URL",
|
|
1191
|
+
title: "transports.evm-rpc.url",
|
|
1192
|
+
type: "string"
|
|
1193
|
+
})
|
|
1194
|
+
}).describe("EVM JSON-RPC transport");
|
|
1195
|
+
var TransportConfigZod = z5.discriminatedUnion("type", [
|
|
1196
|
+
LmdbTransportConfigZod,
|
|
1197
|
+
MongoTransportConfigZod,
|
|
1198
|
+
RpcTransportConfigZod,
|
|
1199
|
+
RestTransportConfigZod,
|
|
1200
|
+
S3TransportConfigZod,
|
|
1201
|
+
EvmRpcTransportConfigZod
|
|
1202
|
+
]);
|
|
1203
|
+
var TransportsConfigZod = z5.record(z5.string(), TransportConfigZod).default({});
|
|
1204
|
+
|
|
1054
1205
|
// src/config/DataLake/DataLake.ts
|
|
1055
|
-
import { z as
|
|
1206
|
+
import { z as z9 } from "zod";
|
|
1056
1207
|
|
|
1057
1208
|
// src/config/DataLake/RestDataLakeConfig.ts
|
|
1058
|
-
import { globalRegistry as
|
|
1209
|
+
import { globalRegistry as globalRegistry6, z as z7 } from "zod";
|
|
1059
1210
|
|
|
1060
1211
|
// src/config/DataLake/DataLakeRemoteConfig.ts
|
|
1061
|
-
import { globalRegistry as
|
|
1062
|
-
var DataLakeDriverConfigBaseZod =
|
|
1063
|
-
driver:
|
|
1212
|
+
import { globalRegistry as globalRegistry5, z as z6 } from "zod";
|
|
1213
|
+
var DataLakeDriverConfigBaseZod = z6.object({
|
|
1214
|
+
driver: z6.string().register(globalRegistry5, {
|
|
1064
1215
|
description: "Driver for the data lake",
|
|
1065
1216
|
type: "string"
|
|
1066
1217
|
})
|
|
@@ -1068,55 +1219,55 @@ var DataLakeDriverConfigBaseZod = z2.object({
|
|
|
1068
1219
|
|
|
1069
1220
|
// src/config/DataLake/RestDataLakeConfig.ts
|
|
1070
1221
|
var RestDataLakeConfigZod = DataLakeDriverConfigBaseZod.extend({
|
|
1071
|
-
driver:
|
|
1222
|
+
driver: z7.literal("rest").register(globalRegistry6, {
|
|
1072
1223
|
description: "Driver for the REST data lake",
|
|
1073
1224
|
type: "string"
|
|
1074
1225
|
}),
|
|
1075
|
-
url:
|
|
1226
|
+
url: z7.string().register(globalRegistry6, {
|
|
1076
1227
|
description: "URL for the REST data lake",
|
|
1077
1228
|
type: "string"
|
|
1078
1229
|
})
|
|
1079
1230
|
}).describe("Configuration for the REST data lake driver");
|
|
1080
1231
|
|
|
1081
1232
|
// src/config/DataLake/RouterDataLakeConfig.ts
|
|
1082
|
-
import { globalRegistry as
|
|
1083
|
-
var RouterDataLakeConfigZod =
|
|
1084
|
-
driver:
|
|
1233
|
+
import { globalRegistry as globalRegistry7, z as z8 } from "zod";
|
|
1234
|
+
var RouterDataLakeConfigZod = z8.object({
|
|
1235
|
+
driver: z8.literal("router").register(globalRegistry7, {
|
|
1085
1236
|
description: "Driver for the router data lake",
|
|
1086
1237
|
type: "string"
|
|
1087
1238
|
}),
|
|
1088
|
-
children:
|
|
1239
|
+
children: z8.array(z8.lazy(() => DataLakeConfigZod)).register(globalRegistry7, {
|
|
1089
1240
|
description: "Child data lake drivers",
|
|
1090
1241
|
type: "array"
|
|
1091
1242
|
})
|
|
1092
1243
|
}).describe("Configuration for the router data lake driver");
|
|
1093
1244
|
|
|
1094
1245
|
// src/config/DataLake/DataLake.ts
|
|
1095
|
-
var DataLakeConfigZod =
|
|
1246
|
+
var DataLakeConfigZod = z9.lazy(() => z9.union([RestDataLakeConfigZod, RouterDataLakeConfigZod])).describe("Configuration for a data lake");
|
|
1096
1247
|
|
|
1097
1248
|
// src/config/Evm.ts
|
|
1098
|
-
import { globalRegistry as
|
|
1099
|
-
var EvmInfuraConfigZod =
|
|
1100
|
-
projectId:
|
|
1249
|
+
import { globalRegistry as globalRegistry8, z as z10 } from "zod";
|
|
1250
|
+
var EvmInfuraConfigZod = z10.object({
|
|
1251
|
+
projectId: z10.string().optional().register(globalRegistry8, {
|
|
1101
1252
|
description: "Infura project ID",
|
|
1102
1253
|
title: "evm.infura.projectId",
|
|
1103
1254
|
type: "string"
|
|
1104
1255
|
}),
|
|
1105
|
-
projectSecret:
|
|
1256
|
+
projectSecret: z10.string().optional().register(globalRegistry8, {
|
|
1106
1257
|
description: "Infura project secret",
|
|
1107
1258
|
title: "evm.infura.projectSecret",
|
|
1108
1259
|
type: "string"
|
|
1109
1260
|
})
|
|
1110
1261
|
});
|
|
1111
|
-
var EvmJsonRpcConfigZod =
|
|
1112
|
-
url:
|
|
1262
|
+
var EvmJsonRpcConfigZod = z10.object({
|
|
1263
|
+
url: z10.url().optional().register(globalRegistry8, {
|
|
1113
1264
|
description: "JSON-RPC URL",
|
|
1114
1265
|
title: "evm.jsonRpc.url",
|
|
1115
1266
|
type: "string"
|
|
1116
1267
|
})
|
|
1117
1268
|
});
|
|
1118
|
-
var EvmConfigZod =
|
|
1119
|
-
chainId:
|
|
1269
|
+
var EvmConfigZod = z10.object({
|
|
1270
|
+
chainId: z10.string().optional().register(globalRegistry8, {
|
|
1120
1271
|
description: "EVM chain ID",
|
|
1121
1272
|
title: "evm.chainId",
|
|
1122
1273
|
type: "string"
|
|
@@ -1127,17 +1278,17 @@ var EvmConfigZod = z6.object({
|
|
|
1127
1278
|
|
|
1128
1279
|
// src/config/Log.ts
|
|
1129
1280
|
import { LogLevel } from "@xylabs/sdk-js";
|
|
1130
|
-
import { globalRegistry as
|
|
1281
|
+
import { globalRegistry as globalRegistry9, z as z11 } from "zod";
|
|
1131
1282
|
var LogLevelNames = Object.keys(LogLevel);
|
|
1132
|
-
var LogConfigZod =
|
|
1133
|
-
logLevel:
|
|
1283
|
+
var LogConfigZod = z11.object({
|
|
1284
|
+
logLevel: z11.enum(LogLevelNames).default("info").register(globalRegistry9, {
|
|
1134
1285
|
choices: LogLevelNames,
|
|
1135
1286
|
default: "info",
|
|
1136
1287
|
description: "Desired process verbosity",
|
|
1137
1288
|
title: "logLevel",
|
|
1138
1289
|
type: "string"
|
|
1139
1290
|
}),
|
|
1140
|
-
silent:
|
|
1291
|
+
silent: z11.boolean().default(false).register(globalRegistry9, {
|
|
1141
1292
|
default: false,
|
|
1142
1293
|
description: "Whether to run in silent mode",
|
|
1143
1294
|
title: "silent",
|
|
@@ -1146,23 +1297,23 @@ var LogConfigZod = z7.object({
|
|
|
1146
1297
|
});
|
|
1147
1298
|
|
|
1148
1299
|
// src/config/ProviderBinding.ts
|
|
1149
|
-
import { globalRegistry as
|
|
1150
|
-
var ProviderBindingConfigZod =
|
|
1151
|
-
|
|
1152
|
-
description: "
|
|
1153
|
-
title: "providerBindings.
|
|
1300
|
+
import { globalRegistry as globalRegistry10, z as z12 } from "zod";
|
|
1301
|
+
var ProviderBindingConfigZod = z12.object({
|
|
1302
|
+
connection: z12.string().optional().register(globalRegistry10, {
|
|
1303
|
+
description: "Named connection from the top-level connections map",
|
|
1304
|
+
title: "providerBindings.connection",
|
|
1154
1305
|
type: "string"
|
|
1155
1306
|
}),
|
|
1156
|
-
transport:
|
|
1157
|
-
description: "
|
|
1307
|
+
transport: z12.string().optional().register(globalRegistry10, {
|
|
1308
|
+
description: "Deprecated alias for connection (kept in sync during migration)",
|
|
1158
1309
|
title: "providerBindings.transport",
|
|
1159
1310
|
type: "string"
|
|
1160
1311
|
})
|
|
1161
|
-
}).describe("Provider
|
|
1162
|
-
var ProviderBindingsConfigZod =
|
|
1312
|
+
}).describe("Provider connection binding");
|
|
1313
|
+
var ProviderBindingsConfigZod = z12.record(z12.string(), ProviderBindingConfigZod).default({});
|
|
1163
1314
|
|
|
1164
1315
|
// src/config/Providers.ts
|
|
1165
|
-
import
|
|
1316
|
+
import z14 from "zod";
|
|
1166
1317
|
|
|
1167
1318
|
// src/config/Provider.ts
|
|
1168
1319
|
import {
|
|
@@ -1170,111 +1321,23 @@ import {
|
|
|
1170
1321
|
zodIsFactory,
|
|
1171
1322
|
zodToFactory
|
|
1172
1323
|
} from "@xylabs/sdk-js";
|
|
1173
|
-
import { z as
|
|
1174
|
-
var ProviderConfigZod =
|
|
1175
|
-
moniker:
|
|
1176
|
-
labels:
|
|
1324
|
+
import { z as z13 } from "zod";
|
|
1325
|
+
var ProviderConfigZod = z13.object({
|
|
1326
|
+
moniker: z13.string(),
|
|
1327
|
+
labels: z13.array(z13.string()).optional()
|
|
1177
1328
|
}).describe("Configuration for a Provider");
|
|
1178
1329
|
var isProviderConfig = zodIsFactory(ProviderConfigZod);
|
|
1179
1330
|
var asProviderConfig = zodAsFactory(ProviderConfigZod, "asProviderConfig");
|
|
1180
1331
|
var toProviderConfig = zodToFactory(ProviderConfigZod, "toProviderConfig");
|
|
1181
1332
|
|
|
1182
1333
|
// src/config/Providers.ts
|
|
1183
|
-
var ProvidersConfigZod =
|
|
1184
|
-
|
|
1185
|
-
// src/config/Remote.ts
|
|
1186
|
-
import { globalRegistry as globalRegistry8, z as z11 } from "zod";
|
|
1187
|
-
var RpcRemoteConfigBaseZod = z11.object({
|
|
1188
|
-
protocol: z11.string("http").register(globalRegistry8, {
|
|
1189
|
-
description: "Protocol for the RPC connection",
|
|
1190
|
-
type: "string"
|
|
1191
|
-
})
|
|
1192
|
-
}).describe("Base configuration for the remote RPC");
|
|
1193
|
-
var HttpRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
1194
|
-
protocol: z11.string("http").register(globalRegistry8, {
|
|
1195
|
-
description: "Protocol for the RPC connection",
|
|
1196
|
-
type: "string"
|
|
1197
|
-
}).default("http"),
|
|
1198
|
-
url: z11.string().register(globalRegistry8, {
|
|
1199
|
-
description: "URL for the Chain RPC API",
|
|
1200
|
-
type: "string"
|
|
1201
|
-
})
|
|
1202
|
-
}).describe("Configuration for the remote RPC using Http");
|
|
1203
|
-
var PostMessageRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
1204
|
-
protocol: z11.string().register(globalRegistry8, {
|
|
1205
|
-
description: "Protocol for the RPC connection",
|
|
1206
|
-
type: "string"
|
|
1207
|
-
}).default("postMessage"),
|
|
1208
|
-
networkId: z11.string().register(globalRegistry8, {
|
|
1209
|
-
description: "Network ID to use for the postMessage RPC connection",
|
|
1210
|
-
type: "string"
|
|
1211
|
-
}),
|
|
1212
|
-
sessionId: z11.string().register(globalRegistry8, {
|
|
1213
|
-
description: "Session ID to use for the postMessage RPC connection",
|
|
1214
|
-
type: "string"
|
|
1215
|
-
})
|
|
1216
|
-
}).describe("Configuration for the remote RPC using postMessage");
|
|
1217
|
-
var RpcRemoteConfigZod = z11.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod]).describe("Configuration for a remote RPC connection, either Http or postMessage");
|
|
1218
|
-
var RemoteConfigZod = z11.object({ rpc: RpcRemoteConfigZod.optional() }).describe("Configuration for remote connections, including RPC");
|
|
1219
|
-
|
|
1220
|
-
// src/config/storage/driver/Mongo.ts
|
|
1221
|
-
import { isDefined as isDefined4, isUndefined as isUndefined2 } from "@xylabs/sdk-js";
|
|
1222
|
-
import { globalRegistry as globalRegistry9, z as z12 } from "zod";
|
|
1223
|
-
var MongoConfigZod = z12.object({
|
|
1224
|
-
// TODO: Create from other arguments
|
|
1225
|
-
connectionString: z12.string().nonempty().optional().register(globalRegistry9, {
|
|
1226
|
-
description: "MongoDB connection string",
|
|
1227
|
-
title: "storage.mongo.connectionString",
|
|
1228
|
-
type: "string"
|
|
1229
|
-
}),
|
|
1230
|
-
database: z12.string().nonempty().optional().register(globalRegistry9, {
|
|
1231
|
-
description: "MongoDB database name",
|
|
1232
|
-
title: "storage.mongo.database",
|
|
1233
|
-
type: "string"
|
|
1234
|
-
}),
|
|
1235
|
-
domain: z12.string().nonempty().optional().register(globalRegistry9, {
|
|
1236
|
-
description: "MongoDB domain",
|
|
1237
|
-
title: "storage.mongo.domain",
|
|
1238
|
-
type: "string"
|
|
1239
|
-
}),
|
|
1240
|
-
password: z12.string().nonempty().optional().register(globalRegistry9, {
|
|
1241
|
-
description: "MongoDB password",
|
|
1242
|
-
title: "storage.mongo.password",
|
|
1243
|
-
type: "string"
|
|
1244
|
-
}),
|
|
1245
|
-
username: z12.string().nonempty().optional().register(globalRegistry9, {
|
|
1246
|
-
description: "MongoDB username",
|
|
1247
|
-
title: "storage.mongo.username",
|
|
1248
|
-
type: "string"
|
|
1249
|
-
})
|
|
1250
|
-
});
|
|
1251
|
-
|
|
1252
|
-
// src/config/storage/driver/S3.ts
|
|
1253
|
-
import { isDefined as isDefined5 } from "@xylabs/sdk-js";
|
|
1254
|
-
import { z as z13 } from "zod";
|
|
1255
|
-
var S3BucketConfigZod = z13.object({
|
|
1256
|
-
accessKeyId: z13.string().nonempty().optional().describe("S3-compatible access key id for this bucket (overrides the shared default)"),
|
|
1257
|
-
accountId: z13.string().nonempty().optional().describe("Account id for this bucket; on Cloudflare R2 it forms the endpoint (overrides the shared default)"),
|
|
1258
|
-
bucket: z13.string().nonempty().optional().describe("S3-compatible bucket name"),
|
|
1259
|
-
prefix: z13.string().nonempty().optional().describe("Optional key prefix within the bucket"),
|
|
1260
|
-
readUrl: z13.string().nonempty().optional().describe("Public HTTP/CDN base URL for anonymous reads of this bucket"),
|
|
1261
|
-
secretAccessKey: z13.string().nonempty().optional().describe("S3-compatible secret access key for this bucket (overrides the shared default)")
|
|
1262
|
-
});
|
|
1263
|
-
var S3ConfigZod = z13.object({
|
|
1264
|
-
accessKeyId: z13.string().nonempty().optional().describe("Shared S3-compatible access key id (default for all buckets)"),
|
|
1265
|
-
accountId: z13.string().nonempty().optional().describe("Shared account id (default for all buckets; on Cloudflare R2 it forms the endpoint)"),
|
|
1266
|
-
chainState: S3BucketConfigZod.optional().describe("Bucket for the mutable chain state (the head pointer)"),
|
|
1267
|
-
finalized: S3BucketConfigZod.optional().describe("Bucket for the finalized files (blocks, payloads, manifest)"),
|
|
1268
|
-
index: S3BucketConfigZod.optional().describe("Bucket for the chain index (the step-summary families)"),
|
|
1269
|
-
prefix: z13.string().nonempty().optional().describe("Shared key prefix (default for all buckets)"),
|
|
1270
|
-
secretAccessKey: z13.string().nonempty().optional().describe("Shared S3-compatible secret access key (default for all buckets)")
|
|
1271
|
-
});
|
|
1334
|
+
var ProvidersConfigZod = z14.array(ProviderConfigZod.loose()).describe("Configuration for providers").default([]);
|
|
1272
1335
|
|
|
1273
1336
|
// src/config/storage/Storage.ts
|
|
1274
|
-
import { globalRegistry as
|
|
1275
|
-
var StorageConfigZod =
|
|
1337
|
+
import { globalRegistry as globalRegistry11, z as z15 } from "zod";
|
|
1338
|
+
var StorageConfigZod = z15.object({
|
|
1276
1339
|
mongo: MongoConfigZod.optional().describe("Configuration for the MongoD storage driver"),
|
|
1277
|
-
root:
|
|
1340
|
+
root: z15.string().optional().register(globalRegistry11, {
|
|
1278
1341
|
description: "Root directory for local storage",
|
|
1279
1342
|
title: "storage.root",
|
|
1280
1343
|
type: "string"
|
|
@@ -1283,87 +1346,36 @@ var StorageConfigZod = z14.object({
|
|
|
1283
1346
|
}).describe("Storage configuration options");
|
|
1284
1347
|
|
|
1285
1348
|
// src/config/Telemetry.ts
|
|
1286
|
-
import { globalRegistry as
|
|
1287
|
-
var MetricsScrapeConfigZod =
|
|
1288
|
-
path:
|
|
1349
|
+
import { globalRegistry as globalRegistry12, z as z16 } from "zod";
|
|
1350
|
+
var MetricsScrapeConfigZod = z16.object({
|
|
1351
|
+
path: z16.string().default("/metrics").register(globalRegistry12, {
|
|
1289
1352
|
default: "/metrics",
|
|
1290
1353
|
description: "Path for the metrics scrape endpoint",
|
|
1291
1354
|
title: "telemetry.metrics.scrape.path",
|
|
1292
1355
|
type: "string"
|
|
1293
1356
|
}),
|
|
1294
|
-
port:
|
|
1357
|
+
port: z16.coerce.number().int().positive().optional().register(globalRegistry12, {
|
|
1295
1358
|
description: "Port for the metrics scrape endpoint",
|
|
1296
1359
|
title: "telemetry.metrics.scrape.port",
|
|
1297
1360
|
type: "number"
|
|
1298
1361
|
})
|
|
1299
1362
|
}).describe("Metrics scrape configuration");
|
|
1300
|
-
var MetricsConfigZod =
|
|
1301
|
-
var OpenTelemetryConfigZod =
|
|
1363
|
+
var MetricsConfigZod = z16.object({ scrape: MetricsScrapeConfigZod }).describe("Metrics configuration options");
|
|
1364
|
+
var OpenTelemetryConfigZod = z16.object({
|
|
1302
1365
|
// OpenTelemetry options
|
|
1303
|
-
otlpEndpoint:
|
|
1366
|
+
otlpEndpoint: z16.url().optional().register(globalRegistry12, {
|
|
1304
1367
|
description: "OTLP endpoint for exporting telemetry data",
|
|
1305
1368
|
title: "telemetry.otel.otlpEndpoint",
|
|
1306
1369
|
type: "string"
|
|
1307
1370
|
})
|
|
1308
1371
|
});
|
|
1309
|
-
var TelemetryConfigZod =
|
|
1372
|
+
var TelemetryConfigZod = z16.object({
|
|
1310
1373
|
// Metrics configuration
|
|
1311
1374
|
metrics: MetricsConfigZod.optional().describe("Metrics configuration"),
|
|
1312
1375
|
// OpenTelemetry configuration
|
|
1313
1376
|
otel: OpenTelemetryConfigZod.optional().describe("OpenTelemetry configuration")
|
|
1314
1377
|
}).describe("Telemetry configuration options");
|
|
1315
1378
|
|
|
1316
|
-
// src/config/transports/Transport.ts
|
|
1317
|
-
import { globalRegistry as globalRegistry12, z as z16 } from "zod";
|
|
1318
|
-
var LmdbTransportConfigZod = z16.object({
|
|
1319
|
-
type: z16.literal("lmdb"),
|
|
1320
|
-
root: z16.string().register(globalRegistry12, {
|
|
1321
|
-
description: "Root directory for local LMDB storage",
|
|
1322
|
-
title: "transports.lmdb.root",
|
|
1323
|
-
type: "string"
|
|
1324
|
-
})
|
|
1325
|
-
}).describe("LMDB local storage transport");
|
|
1326
|
-
var MongoTransportConfigZod = z16.object({
|
|
1327
|
-
type: z16.literal("mongo"),
|
|
1328
|
-
connectionString: MongoConfigZod.shape.connectionString,
|
|
1329
|
-
database: MongoConfigZod.shape.database,
|
|
1330
|
-
domain: MongoConfigZod.shape.domain,
|
|
1331
|
-
password: MongoConfigZod.shape.password,
|
|
1332
|
-
username: MongoConfigZod.shape.username
|
|
1333
|
-
}).describe("MongoDB storage transport");
|
|
1334
|
-
var RpcTransportConfigZod = HttpRpcRemoteConfigZod.extend({ type: z16.literal("rpc") }).describe("XL1 JSON-RPC transport");
|
|
1335
|
-
var RestTransportConfigZod = z16.object({
|
|
1336
|
-
type: z16.literal("rest"),
|
|
1337
|
-
baseUrl: z16.string().register(globalRegistry12, {
|
|
1338
|
-
description: "HTTP base URL for REST reads",
|
|
1339
|
-
title: "transports.rest.baseUrl",
|
|
1340
|
-
type: "string"
|
|
1341
|
-
})
|
|
1342
|
-
}).describe("HTTP REST read transport");
|
|
1343
|
-
var S3TransportConfigZod = S3BucketConfigZod.extend({
|
|
1344
|
-
type: z16.literal("s3"),
|
|
1345
|
-
accessKeyId: z16.string().optional(),
|
|
1346
|
-
accountId: z16.string().optional(),
|
|
1347
|
-
secretAccessKey: z16.string().optional()
|
|
1348
|
-
}).describe("S3-compatible object storage transport");
|
|
1349
|
-
var EvmRpcTransportConfigZod = z16.object({
|
|
1350
|
-
type: z16.literal("evm-rpc"),
|
|
1351
|
-
url: z16.string().register(globalRegistry12, {
|
|
1352
|
-
description: "EVM JSON-RPC URL",
|
|
1353
|
-
title: "transports.evm-rpc.url",
|
|
1354
|
-
type: "string"
|
|
1355
|
-
})
|
|
1356
|
-
}).describe("EVM JSON-RPC transport");
|
|
1357
|
-
var TransportConfigZod = z16.discriminatedUnion("type", [
|
|
1358
|
-
LmdbTransportConfigZod,
|
|
1359
|
-
MongoTransportConfigZod,
|
|
1360
|
-
RpcTransportConfigZod,
|
|
1361
|
-
RestTransportConfigZod,
|
|
1362
|
-
S3TransportConfigZod,
|
|
1363
|
-
EvmRpcTransportConfigZod
|
|
1364
|
-
]);
|
|
1365
|
-
var TransportsConfigZod = z16.record(z16.string(), TransportConfigZod).default({});
|
|
1366
|
-
|
|
1367
1379
|
// src/config/Validation.ts
|
|
1368
1380
|
import { XyoAddressZod as XyoAddressZod2 } from "@xyo-network/sdk-js";
|
|
1369
1381
|
import { globalRegistry as globalRegistry13, z as z17 } from "zod";
|
|
@@ -1637,10 +1649,11 @@ var BaseConfigZod = z18.object({
|
|
|
1637
1649
|
dataLake: z18.optional(DataLakeConfigZod).check(z18.describe("Configuration for data lakes")),
|
|
1638
1650
|
evm: z18._default(EvmConfigZod, EvmConfigZod.parse({})).check(z18.describe("Configuration for EVM-backed services")),
|
|
1639
1651
|
log: z18._default(LogConfigZod, LogConfigZod.parse({})).check(z18.describe("Configuration for logging")),
|
|
1640
|
-
|
|
1652
|
+
connections: z18._default(TransportsConfigZod, TransportsConfigZod.parse({})).check(z18.describe("Named connection profiles (rpc, rest, s3, lmdb, mongo, evm-rpc)")),
|
|
1653
|
+
providerBindings: z18._default(ProviderBindingsConfigZod, ProviderBindingsConfigZod.parse({})).check(z18.describe("Per-moniker provider connection bindings")),
|
|
1641
1654
|
providers: z18._default(ProvidersConfigZod, ProvidersConfigZod.parse([])).check(z18.describe("Configuration for providers")),
|
|
1642
1655
|
remote: z18._default(RemoteConfigZod, RemoteConfigZod.parse({})).check(z18.describe("Configuration for remote services")),
|
|
1643
|
-
transports: z18._default(TransportsConfigZod, TransportsConfigZod.parse({})).check(z18.describe("
|
|
1656
|
+
transports: z18._default(TransportsConfigZod, TransportsConfigZod.parse({})).check(z18.describe("Deprecated alias for connections (kept in sync during migration)")),
|
|
1644
1657
|
storage: z18._default(StorageConfigZod, StorageConfigZod.parse({})).check(z18.describe("Configuration for the storage")),
|
|
1645
1658
|
telemetry: z18._default(TelemetryConfigZod, TelemetryConfigZod.parse({})).check(z18.describe("Configuration for telemetry")),
|
|
1646
1659
|
validation: z18._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z18.describe("Configuration for validation"))
|