@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
|
@@ -25,8 +25,39 @@ export declare function getFileConfig(searchPlaces?: string[]): Promise<{
|
|
|
25
25
|
logLevel: "error" | "warn" | "info" | "log" | "debug" | "trace";
|
|
26
26
|
silent: boolean;
|
|
27
27
|
};
|
|
28
|
+
connections: Record<string, {
|
|
29
|
+
root: string;
|
|
30
|
+
type: "lmdb";
|
|
31
|
+
access?: "read" | "write" | undefined;
|
|
32
|
+
store?: string | undefined;
|
|
33
|
+
} | {
|
|
34
|
+
type: "mongo";
|
|
35
|
+
connectionString?: string | undefined;
|
|
36
|
+
database?: string | undefined;
|
|
37
|
+
domain?: string | undefined;
|
|
38
|
+
password?: string | undefined;
|
|
39
|
+
username?: string | undefined;
|
|
40
|
+
} | {
|
|
41
|
+
protocol: string;
|
|
42
|
+
url: string;
|
|
43
|
+
type: "rpc";
|
|
44
|
+
} | {
|
|
45
|
+
type: "rest";
|
|
46
|
+
baseUrl: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: "s3";
|
|
49
|
+
bucket?: string | undefined;
|
|
50
|
+
prefix?: string | undefined;
|
|
51
|
+
readUrl?: string | undefined;
|
|
52
|
+
accessKeyId?: string | undefined;
|
|
53
|
+
accountId?: string | undefined;
|
|
54
|
+
secretAccessKey?: string | undefined;
|
|
55
|
+
} | {
|
|
56
|
+
type: "evm-rpc";
|
|
57
|
+
url: string;
|
|
58
|
+
}>;
|
|
28
59
|
providerBindings: Record<string, {
|
|
29
|
-
|
|
60
|
+
connection?: string | undefined;
|
|
30
61
|
transport?: string | undefined;
|
|
31
62
|
}>;
|
|
32
63
|
providers: {
|
|
@@ -45,8 +76,10 @@ export declare function getFileConfig(searchPlaces?: string[]): Promise<{
|
|
|
45
76
|
} | undefined;
|
|
46
77
|
};
|
|
47
78
|
transports: Record<string, {
|
|
48
|
-
type: "lmdb";
|
|
49
79
|
root: string;
|
|
80
|
+
type: "lmdb";
|
|
81
|
+
access?: "read" | "write" | undefined;
|
|
82
|
+
store?: string | undefined;
|
|
50
83
|
} | {
|
|
51
84
|
type: "mongo";
|
|
52
85
|
connectionString?: string | undefined;
|
|
@@ -162,8 +195,39 @@ export declare function getFileConfig(searchPlaces?: string[]): Promise<{
|
|
|
162
195
|
logLevel: "error" | "warn" | "info" | "log" | "debug" | "trace";
|
|
163
196
|
silent: boolean;
|
|
164
197
|
};
|
|
198
|
+
connections: Record<string, {
|
|
199
|
+
root: string;
|
|
200
|
+
type: "lmdb";
|
|
201
|
+
access?: "read" | "write" | undefined;
|
|
202
|
+
store?: string | undefined;
|
|
203
|
+
} | {
|
|
204
|
+
type: "mongo";
|
|
205
|
+
connectionString?: string | undefined;
|
|
206
|
+
database?: string | undefined;
|
|
207
|
+
domain?: string | undefined;
|
|
208
|
+
password?: string | undefined;
|
|
209
|
+
username?: string | undefined;
|
|
210
|
+
} | {
|
|
211
|
+
protocol: string;
|
|
212
|
+
url: string;
|
|
213
|
+
type: "rpc";
|
|
214
|
+
} | {
|
|
215
|
+
type: "rest";
|
|
216
|
+
baseUrl: string;
|
|
217
|
+
} | {
|
|
218
|
+
type: "s3";
|
|
219
|
+
bucket?: string | undefined;
|
|
220
|
+
prefix?: string | undefined;
|
|
221
|
+
readUrl?: string | undefined;
|
|
222
|
+
accessKeyId?: string | undefined;
|
|
223
|
+
accountId?: string | undefined;
|
|
224
|
+
secretAccessKey?: string | undefined;
|
|
225
|
+
} | {
|
|
226
|
+
type: "evm-rpc";
|
|
227
|
+
url: string;
|
|
228
|
+
}>;
|
|
165
229
|
providerBindings: Record<string, {
|
|
166
|
-
|
|
230
|
+
connection?: string | undefined;
|
|
167
231
|
transport?: string | undefined;
|
|
168
232
|
}>;
|
|
169
233
|
providers: {
|
|
@@ -182,8 +246,10 @@ export declare function getFileConfig(searchPlaces?: string[]): Promise<{
|
|
|
182
246
|
} | undefined;
|
|
183
247
|
};
|
|
184
248
|
transports: Record<string, {
|
|
185
|
-
type: "lmdb";
|
|
186
249
|
root: string;
|
|
250
|
+
type: "lmdb";
|
|
251
|
+
access?: "read" | "write" | undefined;
|
|
252
|
+
store?: string | undefined;
|
|
187
253
|
} | {
|
|
188
254
|
type: "mongo";
|
|
189
255
|
connectionString?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFileConfig.d.ts","sourceRoot":"","sources":["../../src/getFileConfig.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,wBAAsB,aAAa,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"getFileConfig.d.ts","sourceRoot":"","sources":["../../src/getFileConfig.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,wBAAsB,aAAa,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiB1D"}
|
|
@@ -31,16 +31,167 @@ var ChainConfigZod = z.object({
|
|
|
31
31
|
})
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
+
// src/config/transports/Transport.ts
|
|
35
|
+
import { globalRegistry as globalRegistry4, z as z5 } from "zod";
|
|
36
|
+
|
|
37
|
+
// src/config/Remote.ts
|
|
38
|
+
import { globalRegistry as globalRegistry2, z as z2 } from "zod";
|
|
39
|
+
var RpcRemoteConfigBaseZod = z2.object({
|
|
40
|
+
protocol: z2.string("http").register(globalRegistry2, {
|
|
41
|
+
description: "Protocol for the RPC connection",
|
|
42
|
+
type: "string"
|
|
43
|
+
})
|
|
44
|
+
}).describe("Base configuration for the remote RPC");
|
|
45
|
+
var HttpRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
46
|
+
protocol: z2.string("http").register(globalRegistry2, {
|
|
47
|
+
description: "Protocol for the RPC connection",
|
|
48
|
+
type: "string"
|
|
49
|
+
}).default("http"),
|
|
50
|
+
url: z2.string().register(globalRegistry2, {
|
|
51
|
+
description: "URL for the Chain RPC API",
|
|
52
|
+
type: "string"
|
|
53
|
+
})
|
|
54
|
+
}).describe("Configuration for the remote RPC using Http");
|
|
55
|
+
var PostMessageRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
56
|
+
protocol: z2.string().register(globalRegistry2, {
|
|
57
|
+
description: "Protocol for the RPC connection",
|
|
58
|
+
type: "string"
|
|
59
|
+
}).default("postMessage"),
|
|
60
|
+
networkId: z2.string().register(globalRegistry2, {
|
|
61
|
+
description: "Network ID to use for the postMessage RPC connection",
|
|
62
|
+
type: "string"
|
|
63
|
+
}),
|
|
64
|
+
sessionId: z2.string().register(globalRegistry2, {
|
|
65
|
+
description: "Session ID to use for the postMessage RPC connection",
|
|
66
|
+
type: "string"
|
|
67
|
+
})
|
|
68
|
+
}).describe("Configuration for the remote RPC using postMessage");
|
|
69
|
+
var RpcRemoteConfigZod = z2.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod]).describe("Configuration for a remote RPC connection, either Http or postMessage");
|
|
70
|
+
var RemoteConfigZod = z2.object({ rpc: RpcRemoteConfigZod.optional() }).describe("Configuration for remote connections, including RPC");
|
|
71
|
+
|
|
72
|
+
// src/config/storage/driver/Mongo.ts
|
|
73
|
+
import { isDefined, isUndefined } from "@xylabs/sdk-js";
|
|
74
|
+
import { globalRegistry as globalRegistry3, z as z3 } from "zod";
|
|
75
|
+
var MongoConfigZod = z3.object({
|
|
76
|
+
// TODO: Create from other arguments
|
|
77
|
+
connectionString: z3.string().nonempty().optional().register(globalRegistry3, {
|
|
78
|
+
description: "MongoDB connection string",
|
|
79
|
+
title: "storage.mongo.connectionString",
|
|
80
|
+
type: "string"
|
|
81
|
+
}),
|
|
82
|
+
database: z3.string().nonempty().optional().register(globalRegistry3, {
|
|
83
|
+
description: "MongoDB database name",
|
|
84
|
+
title: "storage.mongo.database",
|
|
85
|
+
type: "string"
|
|
86
|
+
}),
|
|
87
|
+
domain: z3.string().nonempty().optional().register(globalRegistry3, {
|
|
88
|
+
description: "MongoDB domain",
|
|
89
|
+
title: "storage.mongo.domain",
|
|
90
|
+
type: "string"
|
|
91
|
+
}),
|
|
92
|
+
password: z3.string().nonempty().optional().register(globalRegistry3, {
|
|
93
|
+
description: "MongoDB password",
|
|
94
|
+
title: "storage.mongo.password",
|
|
95
|
+
type: "string"
|
|
96
|
+
}),
|
|
97
|
+
username: z3.string().nonempty().optional().register(globalRegistry3, {
|
|
98
|
+
description: "MongoDB username",
|
|
99
|
+
title: "storage.mongo.username",
|
|
100
|
+
type: "string"
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// src/config/storage/driver/S3.ts
|
|
105
|
+
import { isDefined as isDefined2 } from "@xylabs/sdk-js";
|
|
106
|
+
import { z as z4 } from "zod";
|
|
107
|
+
var S3BucketConfigZod = z4.object({
|
|
108
|
+
accessKeyId: z4.string().nonempty().optional().describe("S3-compatible access key id for this bucket (overrides the shared default)"),
|
|
109
|
+
accountId: z4.string().nonempty().optional().describe("Account id for this bucket; on Cloudflare R2 it forms the endpoint (overrides the shared default)"),
|
|
110
|
+
bucket: z4.string().nonempty().optional().describe("S3-compatible bucket name"),
|
|
111
|
+
prefix: z4.string().nonempty().optional().describe("Optional key prefix within the bucket"),
|
|
112
|
+
readUrl: z4.string().nonempty().optional().describe("Public HTTP/CDN base URL for anonymous reads of this bucket"),
|
|
113
|
+
secretAccessKey: z4.string().nonempty().optional().describe("S3-compatible secret access key for this bucket (overrides the shared default)")
|
|
114
|
+
});
|
|
115
|
+
var S3ConfigZod = z4.object({
|
|
116
|
+
accessKeyId: z4.string().nonempty().optional().describe("Shared S3-compatible access key id (default for all buckets)"),
|
|
117
|
+
accountId: z4.string().nonempty().optional().describe("Shared account id (default for all buckets; on Cloudflare R2 it forms the endpoint)"),
|
|
118
|
+
chainState: S3BucketConfigZod.optional().describe("Bucket for the mutable chain state (the head pointer)"),
|
|
119
|
+
finalized: S3BucketConfigZod.optional().describe("Bucket for the finalized files (blocks, payloads, manifest)"),
|
|
120
|
+
index: S3BucketConfigZod.optional().describe("Bucket for the chain index (the step-summary families)"),
|
|
121
|
+
prefix: z4.string().nonempty().optional().describe("Shared key prefix (default for all buckets)"),
|
|
122
|
+
secretAccessKey: z4.string().nonempty().optional().describe("Shared S3-compatible secret access key (default for all buckets)")
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
// src/config/transports/Transport.ts
|
|
126
|
+
var LmdbTransportConfigZod = z5.object({
|
|
127
|
+
access: z5.enum(["read", "write"]).optional().register(globalRegistry4, {
|
|
128
|
+
description: "Access mode for this LMDB connection (read or write)",
|
|
129
|
+
title: "transports.lmdb.access",
|
|
130
|
+
type: "string"
|
|
131
|
+
}),
|
|
132
|
+
root: z5.string().register(globalRegistry4, {
|
|
133
|
+
description: "Root directory for local LMDB storage",
|
|
134
|
+
title: "transports.lmdb.root",
|
|
135
|
+
type: "string"
|
|
136
|
+
}),
|
|
137
|
+
store: z5.string().optional().register(globalRegistry4, {
|
|
138
|
+
description: "Logical store name within the LMDB root (e.g. finalized-chain, mempool)",
|
|
139
|
+
title: "transports.lmdb.store",
|
|
140
|
+
type: "string"
|
|
141
|
+
}),
|
|
142
|
+
type: z5.literal("lmdb")
|
|
143
|
+
}).describe("LMDB local storage transport");
|
|
144
|
+
var MongoTransportConfigZod = z5.object({
|
|
145
|
+
type: z5.literal("mongo"),
|
|
146
|
+
connectionString: MongoConfigZod.shape.connectionString,
|
|
147
|
+
database: MongoConfigZod.shape.database,
|
|
148
|
+
domain: MongoConfigZod.shape.domain,
|
|
149
|
+
password: MongoConfigZod.shape.password,
|
|
150
|
+
username: MongoConfigZod.shape.username
|
|
151
|
+
}).describe("MongoDB storage transport");
|
|
152
|
+
var RpcTransportConfigZod = HttpRpcRemoteConfigZod.extend({ type: z5.literal("rpc") }).describe("XL1 JSON-RPC transport");
|
|
153
|
+
var RestTransportConfigZod = z5.object({
|
|
154
|
+
type: z5.literal("rest"),
|
|
155
|
+
baseUrl: z5.string().register(globalRegistry4, {
|
|
156
|
+
description: "HTTP base URL for REST reads",
|
|
157
|
+
title: "transports.rest.baseUrl",
|
|
158
|
+
type: "string"
|
|
159
|
+
})
|
|
160
|
+
}).describe("HTTP REST read transport");
|
|
161
|
+
var S3TransportConfigZod = S3BucketConfigZod.extend({
|
|
162
|
+
type: z5.literal("s3"),
|
|
163
|
+
accessKeyId: z5.string().optional(),
|
|
164
|
+
accountId: z5.string().optional(),
|
|
165
|
+
secretAccessKey: z5.string().optional()
|
|
166
|
+
}).describe("S3-compatible object storage transport");
|
|
167
|
+
var EvmRpcTransportConfigZod = z5.object({
|
|
168
|
+
type: z5.literal("evm-rpc"),
|
|
169
|
+
url: z5.string().register(globalRegistry4, {
|
|
170
|
+
description: "EVM JSON-RPC URL",
|
|
171
|
+
title: "transports.evm-rpc.url",
|
|
172
|
+
type: "string"
|
|
173
|
+
})
|
|
174
|
+
}).describe("EVM JSON-RPC transport");
|
|
175
|
+
var TransportConfigZod = z5.discriminatedUnion("type", [
|
|
176
|
+
LmdbTransportConfigZod,
|
|
177
|
+
MongoTransportConfigZod,
|
|
178
|
+
RpcTransportConfigZod,
|
|
179
|
+
RestTransportConfigZod,
|
|
180
|
+
S3TransportConfigZod,
|
|
181
|
+
EvmRpcTransportConfigZod
|
|
182
|
+
]);
|
|
183
|
+
var TransportsConfigZod = z5.record(z5.string(), TransportConfigZod).default({});
|
|
184
|
+
|
|
34
185
|
// src/config/DataLake/DataLake.ts
|
|
35
|
-
import { z as
|
|
186
|
+
import { z as z9 } from "zod";
|
|
36
187
|
|
|
37
188
|
// src/config/DataLake/RestDataLakeConfig.ts
|
|
38
|
-
import { globalRegistry as
|
|
189
|
+
import { globalRegistry as globalRegistry6, z as z7 } from "zod";
|
|
39
190
|
|
|
40
191
|
// src/config/DataLake/DataLakeRemoteConfig.ts
|
|
41
|
-
import { globalRegistry as
|
|
42
|
-
var DataLakeDriverConfigBaseZod =
|
|
43
|
-
driver:
|
|
192
|
+
import { globalRegistry as globalRegistry5, z as z6 } from "zod";
|
|
193
|
+
var DataLakeDriverConfigBaseZod = z6.object({
|
|
194
|
+
driver: z6.string().register(globalRegistry5, {
|
|
44
195
|
description: "Driver for the data lake",
|
|
45
196
|
type: "string"
|
|
46
197
|
})
|
|
@@ -48,55 +199,55 @@ var DataLakeDriverConfigBaseZod = z2.object({
|
|
|
48
199
|
|
|
49
200
|
// src/config/DataLake/RestDataLakeConfig.ts
|
|
50
201
|
var RestDataLakeConfigZod = DataLakeDriverConfigBaseZod.extend({
|
|
51
|
-
driver:
|
|
202
|
+
driver: z7.literal("rest").register(globalRegistry6, {
|
|
52
203
|
description: "Driver for the REST data lake",
|
|
53
204
|
type: "string"
|
|
54
205
|
}),
|
|
55
|
-
url:
|
|
206
|
+
url: z7.string().register(globalRegistry6, {
|
|
56
207
|
description: "URL for the REST data lake",
|
|
57
208
|
type: "string"
|
|
58
209
|
})
|
|
59
210
|
}).describe("Configuration for the REST data lake driver");
|
|
60
211
|
|
|
61
212
|
// src/config/DataLake/RouterDataLakeConfig.ts
|
|
62
|
-
import { globalRegistry as
|
|
63
|
-
var RouterDataLakeConfigZod =
|
|
64
|
-
driver:
|
|
213
|
+
import { globalRegistry as globalRegistry7, z as z8 } from "zod";
|
|
214
|
+
var RouterDataLakeConfigZod = z8.object({
|
|
215
|
+
driver: z8.literal("router").register(globalRegistry7, {
|
|
65
216
|
description: "Driver for the router data lake",
|
|
66
217
|
type: "string"
|
|
67
218
|
}),
|
|
68
|
-
children:
|
|
219
|
+
children: z8.array(z8.lazy(() => DataLakeConfigZod)).register(globalRegistry7, {
|
|
69
220
|
description: "Child data lake drivers",
|
|
70
221
|
type: "array"
|
|
71
222
|
})
|
|
72
223
|
}).describe("Configuration for the router data lake driver");
|
|
73
224
|
|
|
74
225
|
// src/config/DataLake/DataLake.ts
|
|
75
|
-
var DataLakeConfigZod =
|
|
226
|
+
var DataLakeConfigZod = z9.lazy(() => z9.union([RestDataLakeConfigZod, RouterDataLakeConfigZod])).describe("Configuration for a data lake");
|
|
76
227
|
|
|
77
228
|
// src/config/Evm.ts
|
|
78
|
-
import { globalRegistry as
|
|
79
|
-
var EvmInfuraConfigZod =
|
|
80
|
-
projectId:
|
|
229
|
+
import { globalRegistry as globalRegistry8, z as z10 } from "zod";
|
|
230
|
+
var EvmInfuraConfigZod = z10.object({
|
|
231
|
+
projectId: z10.string().optional().register(globalRegistry8, {
|
|
81
232
|
description: "Infura project ID",
|
|
82
233
|
title: "evm.infura.projectId",
|
|
83
234
|
type: "string"
|
|
84
235
|
}),
|
|
85
|
-
projectSecret:
|
|
236
|
+
projectSecret: z10.string().optional().register(globalRegistry8, {
|
|
86
237
|
description: "Infura project secret",
|
|
87
238
|
title: "evm.infura.projectSecret",
|
|
88
239
|
type: "string"
|
|
89
240
|
})
|
|
90
241
|
});
|
|
91
|
-
var EvmJsonRpcConfigZod =
|
|
92
|
-
url:
|
|
242
|
+
var EvmJsonRpcConfigZod = z10.object({
|
|
243
|
+
url: z10.url().optional().register(globalRegistry8, {
|
|
93
244
|
description: "JSON-RPC URL",
|
|
94
245
|
title: "evm.jsonRpc.url",
|
|
95
246
|
type: "string"
|
|
96
247
|
})
|
|
97
248
|
});
|
|
98
|
-
var EvmConfigZod =
|
|
99
|
-
chainId:
|
|
249
|
+
var EvmConfigZod = z10.object({
|
|
250
|
+
chainId: z10.string().optional().register(globalRegistry8, {
|
|
100
251
|
description: "EVM chain ID",
|
|
101
252
|
title: "evm.chainId",
|
|
102
253
|
type: "string"
|
|
@@ -107,17 +258,17 @@ var EvmConfigZod = z6.object({
|
|
|
107
258
|
|
|
108
259
|
// src/config/Log.ts
|
|
109
260
|
import { LogLevel } from "@xylabs/sdk-js";
|
|
110
|
-
import { globalRegistry as
|
|
261
|
+
import { globalRegistry as globalRegistry9, z as z11 } from "zod";
|
|
111
262
|
var LogLevelNames = Object.keys(LogLevel);
|
|
112
|
-
var LogConfigZod =
|
|
113
|
-
logLevel:
|
|
263
|
+
var LogConfigZod = z11.object({
|
|
264
|
+
logLevel: z11.enum(LogLevelNames).default("info").register(globalRegistry9, {
|
|
114
265
|
choices: LogLevelNames,
|
|
115
266
|
default: "info",
|
|
116
267
|
description: "Desired process verbosity",
|
|
117
268
|
title: "logLevel",
|
|
118
269
|
type: "string"
|
|
119
270
|
}),
|
|
120
|
-
silent:
|
|
271
|
+
silent: z11.boolean().default(false).register(globalRegistry9, {
|
|
121
272
|
default: false,
|
|
122
273
|
description: "Whether to run in silent mode",
|
|
123
274
|
title: "silent",
|
|
@@ -126,23 +277,23 @@ var LogConfigZod = z7.object({
|
|
|
126
277
|
});
|
|
127
278
|
|
|
128
279
|
// src/config/ProviderBinding.ts
|
|
129
|
-
import { globalRegistry as
|
|
130
|
-
var ProviderBindingConfigZod =
|
|
131
|
-
|
|
132
|
-
description: "
|
|
133
|
-
title: "providerBindings.
|
|
280
|
+
import { globalRegistry as globalRegistry10, z as z12 } from "zod";
|
|
281
|
+
var ProviderBindingConfigZod = z12.object({
|
|
282
|
+
connection: z12.string().optional().register(globalRegistry10, {
|
|
283
|
+
description: "Named connection from the top-level connections map",
|
|
284
|
+
title: "providerBindings.connection",
|
|
134
285
|
type: "string"
|
|
135
286
|
}),
|
|
136
|
-
transport:
|
|
137
|
-
description: "
|
|
287
|
+
transport: z12.string().optional().register(globalRegistry10, {
|
|
288
|
+
description: "Deprecated alias for connection (kept in sync during migration)",
|
|
138
289
|
title: "providerBindings.transport",
|
|
139
290
|
type: "string"
|
|
140
291
|
})
|
|
141
|
-
}).describe("Provider
|
|
142
|
-
var ProviderBindingsConfigZod =
|
|
292
|
+
}).describe("Provider connection binding");
|
|
293
|
+
var ProviderBindingsConfigZod = z12.record(z12.string(), ProviderBindingConfigZod).default({});
|
|
143
294
|
|
|
144
295
|
// src/config/Providers.ts
|
|
145
|
-
import
|
|
296
|
+
import z14 from "zod";
|
|
146
297
|
|
|
147
298
|
// src/config/Provider.ts
|
|
148
299
|
import {
|
|
@@ -150,111 +301,23 @@ import {
|
|
|
150
301
|
zodIsFactory,
|
|
151
302
|
zodToFactory
|
|
152
303
|
} from "@xylabs/sdk-js";
|
|
153
|
-
import { z as
|
|
154
|
-
var ProviderConfigZod =
|
|
155
|
-
moniker:
|
|
156
|
-
labels:
|
|
304
|
+
import { z as z13 } from "zod";
|
|
305
|
+
var ProviderConfigZod = z13.object({
|
|
306
|
+
moniker: z13.string(),
|
|
307
|
+
labels: z13.array(z13.string()).optional()
|
|
157
308
|
}).describe("Configuration for a Provider");
|
|
158
309
|
var isProviderConfig = zodIsFactory(ProviderConfigZod);
|
|
159
310
|
var asProviderConfig = zodAsFactory(ProviderConfigZod, "asProviderConfig");
|
|
160
311
|
var toProviderConfig = zodToFactory(ProviderConfigZod, "toProviderConfig");
|
|
161
312
|
|
|
162
313
|
// src/config/Providers.ts
|
|
163
|
-
var ProvidersConfigZod =
|
|
164
|
-
|
|
165
|
-
// src/config/Remote.ts
|
|
166
|
-
import { globalRegistry as globalRegistry8, z as z11 } from "zod";
|
|
167
|
-
var RpcRemoteConfigBaseZod = z11.object({
|
|
168
|
-
protocol: z11.string("http").register(globalRegistry8, {
|
|
169
|
-
description: "Protocol for the RPC connection",
|
|
170
|
-
type: "string"
|
|
171
|
-
})
|
|
172
|
-
}).describe("Base configuration for the remote RPC");
|
|
173
|
-
var HttpRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
174
|
-
protocol: z11.string("http").register(globalRegistry8, {
|
|
175
|
-
description: "Protocol for the RPC connection",
|
|
176
|
-
type: "string"
|
|
177
|
-
}).default("http"),
|
|
178
|
-
url: z11.string().register(globalRegistry8, {
|
|
179
|
-
description: "URL for the Chain RPC API",
|
|
180
|
-
type: "string"
|
|
181
|
-
})
|
|
182
|
-
}).describe("Configuration for the remote RPC using Http");
|
|
183
|
-
var PostMessageRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
184
|
-
protocol: z11.string().register(globalRegistry8, {
|
|
185
|
-
description: "Protocol for the RPC connection",
|
|
186
|
-
type: "string"
|
|
187
|
-
}).default("postMessage"),
|
|
188
|
-
networkId: z11.string().register(globalRegistry8, {
|
|
189
|
-
description: "Network ID to use for the postMessage RPC connection",
|
|
190
|
-
type: "string"
|
|
191
|
-
}),
|
|
192
|
-
sessionId: z11.string().register(globalRegistry8, {
|
|
193
|
-
description: "Session ID to use for the postMessage RPC connection",
|
|
194
|
-
type: "string"
|
|
195
|
-
})
|
|
196
|
-
}).describe("Configuration for the remote RPC using postMessage");
|
|
197
|
-
var RpcRemoteConfigZod = z11.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod]).describe("Configuration for a remote RPC connection, either Http or postMessage");
|
|
198
|
-
var RemoteConfigZod = z11.object({ rpc: RpcRemoteConfigZod.optional() }).describe("Configuration for remote connections, including RPC");
|
|
199
|
-
|
|
200
|
-
// src/config/storage/driver/Mongo.ts
|
|
201
|
-
import { isDefined, isUndefined } from "@xylabs/sdk-js";
|
|
202
|
-
import { globalRegistry as globalRegistry9, z as z12 } from "zod";
|
|
203
|
-
var MongoConfigZod = z12.object({
|
|
204
|
-
// TODO: Create from other arguments
|
|
205
|
-
connectionString: z12.string().nonempty().optional().register(globalRegistry9, {
|
|
206
|
-
description: "MongoDB connection string",
|
|
207
|
-
title: "storage.mongo.connectionString",
|
|
208
|
-
type: "string"
|
|
209
|
-
}),
|
|
210
|
-
database: z12.string().nonempty().optional().register(globalRegistry9, {
|
|
211
|
-
description: "MongoDB database name",
|
|
212
|
-
title: "storage.mongo.database",
|
|
213
|
-
type: "string"
|
|
214
|
-
}),
|
|
215
|
-
domain: z12.string().nonempty().optional().register(globalRegistry9, {
|
|
216
|
-
description: "MongoDB domain",
|
|
217
|
-
title: "storage.mongo.domain",
|
|
218
|
-
type: "string"
|
|
219
|
-
}),
|
|
220
|
-
password: z12.string().nonempty().optional().register(globalRegistry9, {
|
|
221
|
-
description: "MongoDB password",
|
|
222
|
-
title: "storage.mongo.password",
|
|
223
|
-
type: "string"
|
|
224
|
-
}),
|
|
225
|
-
username: z12.string().nonempty().optional().register(globalRegistry9, {
|
|
226
|
-
description: "MongoDB username",
|
|
227
|
-
title: "storage.mongo.username",
|
|
228
|
-
type: "string"
|
|
229
|
-
})
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
// src/config/storage/driver/S3.ts
|
|
233
|
-
import { isDefined as isDefined2 } from "@xylabs/sdk-js";
|
|
234
|
-
import { z as z13 } from "zod";
|
|
235
|
-
var S3BucketConfigZod = z13.object({
|
|
236
|
-
accessKeyId: z13.string().nonempty().optional().describe("S3-compatible access key id for this bucket (overrides the shared default)"),
|
|
237
|
-
accountId: z13.string().nonempty().optional().describe("Account id for this bucket; on Cloudflare R2 it forms the endpoint (overrides the shared default)"),
|
|
238
|
-
bucket: z13.string().nonempty().optional().describe("S3-compatible bucket name"),
|
|
239
|
-
prefix: z13.string().nonempty().optional().describe("Optional key prefix within the bucket"),
|
|
240
|
-
readUrl: z13.string().nonempty().optional().describe("Public HTTP/CDN base URL for anonymous reads of this bucket"),
|
|
241
|
-
secretAccessKey: z13.string().nonempty().optional().describe("S3-compatible secret access key for this bucket (overrides the shared default)")
|
|
242
|
-
});
|
|
243
|
-
var S3ConfigZod = z13.object({
|
|
244
|
-
accessKeyId: z13.string().nonempty().optional().describe("Shared S3-compatible access key id (default for all buckets)"),
|
|
245
|
-
accountId: z13.string().nonempty().optional().describe("Shared account id (default for all buckets; on Cloudflare R2 it forms the endpoint)"),
|
|
246
|
-
chainState: S3BucketConfigZod.optional().describe("Bucket for the mutable chain state (the head pointer)"),
|
|
247
|
-
finalized: S3BucketConfigZod.optional().describe("Bucket for the finalized files (blocks, payloads, manifest)"),
|
|
248
|
-
index: S3BucketConfigZod.optional().describe("Bucket for the chain index (the step-summary families)"),
|
|
249
|
-
prefix: z13.string().nonempty().optional().describe("Shared key prefix (default for all buckets)"),
|
|
250
|
-
secretAccessKey: z13.string().nonempty().optional().describe("Shared S3-compatible secret access key (default for all buckets)")
|
|
251
|
-
});
|
|
314
|
+
var ProvidersConfigZod = z14.array(ProviderConfigZod.loose()).describe("Configuration for providers").default([]);
|
|
252
315
|
|
|
253
316
|
// src/config/storage/Storage.ts
|
|
254
|
-
import { globalRegistry as
|
|
255
|
-
var StorageConfigZod =
|
|
317
|
+
import { globalRegistry as globalRegistry11, z as z15 } from "zod";
|
|
318
|
+
var StorageConfigZod = z15.object({
|
|
256
319
|
mongo: MongoConfigZod.optional().describe("Configuration for the MongoD storage driver"),
|
|
257
|
-
root:
|
|
320
|
+
root: z15.string().optional().register(globalRegistry11, {
|
|
258
321
|
description: "Root directory for local storage",
|
|
259
322
|
title: "storage.root",
|
|
260
323
|
type: "string"
|
|
@@ -263,87 +326,36 @@ var StorageConfigZod = z14.object({
|
|
|
263
326
|
}).describe("Storage configuration options");
|
|
264
327
|
|
|
265
328
|
// src/config/Telemetry.ts
|
|
266
|
-
import { globalRegistry as
|
|
267
|
-
var MetricsScrapeConfigZod =
|
|
268
|
-
path:
|
|
329
|
+
import { globalRegistry as globalRegistry12, z as z16 } from "zod";
|
|
330
|
+
var MetricsScrapeConfigZod = z16.object({
|
|
331
|
+
path: z16.string().default("/metrics").register(globalRegistry12, {
|
|
269
332
|
default: "/metrics",
|
|
270
333
|
description: "Path for the metrics scrape endpoint",
|
|
271
334
|
title: "telemetry.metrics.scrape.path",
|
|
272
335
|
type: "string"
|
|
273
336
|
}),
|
|
274
|
-
port:
|
|
337
|
+
port: z16.coerce.number().int().positive().optional().register(globalRegistry12, {
|
|
275
338
|
description: "Port for the metrics scrape endpoint",
|
|
276
339
|
title: "telemetry.metrics.scrape.port",
|
|
277
340
|
type: "number"
|
|
278
341
|
})
|
|
279
342
|
}).describe("Metrics scrape configuration");
|
|
280
|
-
var MetricsConfigZod =
|
|
281
|
-
var OpenTelemetryConfigZod =
|
|
343
|
+
var MetricsConfigZod = z16.object({ scrape: MetricsScrapeConfigZod }).describe("Metrics configuration options");
|
|
344
|
+
var OpenTelemetryConfigZod = z16.object({
|
|
282
345
|
// OpenTelemetry options
|
|
283
|
-
otlpEndpoint:
|
|
346
|
+
otlpEndpoint: z16.url().optional().register(globalRegistry12, {
|
|
284
347
|
description: "OTLP endpoint for exporting telemetry data",
|
|
285
348
|
title: "telemetry.otel.otlpEndpoint",
|
|
286
349
|
type: "string"
|
|
287
350
|
})
|
|
288
351
|
});
|
|
289
|
-
var TelemetryConfigZod =
|
|
352
|
+
var TelemetryConfigZod = z16.object({
|
|
290
353
|
// Metrics configuration
|
|
291
354
|
metrics: MetricsConfigZod.optional().describe("Metrics configuration"),
|
|
292
355
|
// OpenTelemetry configuration
|
|
293
356
|
otel: OpenTelemetryConfigZod.optional().describe("OpenTelemetry configuration")
|
|
294
357
|
}).describe("Telemetry configuration options");
|
|
295
358
|
|
|
296
|
-
// src/config/transports/Transport.ts
|
|
297
|
-
import { globalRegistry as globalRegistry12, z as z16 } from "zod";
|
|
298
|
-
var LmdbTransportConfigZod = z16.object({
|
|
299
|
-
type: z16.literal("lmdb"),
|
|
300
|
-
root: z16.string().register(globalRegistry12, {
|
|
301
|
-
description: "Root directory for local LMDB storage",
|
|
302
|
-
title: "transports.lmdb.root",
|
|
303
|
-
type: "string"
|
|
304
|
-
})
|
|
305
|
-
}).describe("LMDB local storage transport");
|
|
306
|
-
var MongoTransportConfigZod = z16.object({
|
|
307
|
-
type: z16.literal("mongo"),
|
|
308
|
-
connectionString: MongoConfigZod.shape.connectionString,
|
|
309
|
-
database: MongoConfigZod.shape.database,
|
|
310
|
-
domain: MongoConfigZod.shape.domain,
|
|
311
|
-
password: MongoConfigZod.shape.password,
|
|
312
|
-
username: MongoConfigZod.shape.username
|
|
313
|
-
}).describe("MongoDB storage transport");
|
|
314
|
-
var RpcTransportConfigZod = HttpRpcRemoteConfigZod.extend({ type: z16.literal("rpc") }).describe("XL1 JSON-RPC transport");
|
|
315
|
-
var RestTransportConfigZod = z16.object({
|
|
316
|
-
type: z16.literal("rest"),
|
|
317
|
-
baseUrl: z16.string().register(globalRegistry12, {
|
|
318
|
-
description: "HTTP base URL for REST reads",
|
|
319
|
-
title: "transports.rest.baseUrl",
|
|
320
|
-
type: "string"
|
|
321
|
-
})
|
|
322
|
-
}).describe("HTTP REST read transport");
|
|
323
|
-
var S3TransportConfigZod = S3BucketConfigZod.extend({
|
|
324
|
-
type: z16.literal("s3"),
|
|
325
|
-
accessKeyId: z16.string().optional(),
|
|
326
|
-
accountId: z16.string().optional(),
|
|
327
|
-
secretAccessKey: z16.string().optional()
|
|
328
|
-
}).describe("S3-compatible object storage transport");
|
|
329
|
-
var EvmRpcTransportConfigZod = z16.object({
|
|
330
|
-
type: z16.literal("evm-rpc"),
|
|
331
|
-
url: z16.string().register(globalRegistry12, {
|
|
332
|
-
description: "EVM JSON-RPC URL",
|
|
333
|
-
title: "transports.evm-rpc.url",
|
|
334
|
-
type: "string"
|
|
335
|
-
})
|
|
336
|
-
}).describe("EVM JSON-RPC transport");
|
|
337
|
-
var TransportConfigZod = z16.discriminatedUnion("type", [
|
|
338
|
-
LmdbTransportConfigZod,
|
|
339
|
-
MongoTransportConfigZod,
|
|
340
|
-
RpcTransportConfigZod,
|
|
341
|
-
RestTransportConfigZod,
|
|
342
|
-
S3TransportConfigZod,
|
|
343
|
-
EvmRpcTransportConfigZod
|
|
344
|
-
]);
|
|
345
|
-
var TransportsConfigZod = z16.record(z16.string(), TransportConfigZod).default({});
|
|
346
|
-
|
|
347
359
|
// src/config/Validation.ts
|
|
348
360
|
import { XyoAddressZod as XyoAddressZod2 } from "@xyo-network/sdk-js";
|
|
349
361
|
import { globalRegistry as globalRegistry13, z as z17 } from "zod";
|
|
@@ -384,10 +396,11 @@ var BaseConfigZod = z18.object({
|
|
|
384
396
|
dataLake: z18.optional(DataLakeConfigZod).check(z18.describe("Configuration for data lakes")),
|
|
385
397
|
evm: z18._default(EvmConfigZod, EvmConfigZod.parse({})).check(z18.describe("Configuration for EVM-backed services")),
|
|
386
398
|
log: z18._default(LogConfigZod, LogConfigZod.parse({})).check(z18.describe("Configuration for logging")),
|
|
387
|
-
|
|
399
|
+
connections: z18._default(TransportsConfigZod, TransportsConfigZod.parse({})).check(z18.describe("Named connection profiles (rpc, rest, s3, lmdb, mongo, evm-rpc)")),
|
|
400
|
+
providerBindings: z18._default(ProviderBindingsConfigZod, ProviderBindingsConfigZod.parse({})).check(z18.describe("Per-moniker provider connection bindings")),
|
|
388
401
|
providers: z18._default(ProvidersConfigZod, ProvidersConfigZod.parse([])).check(z18.describe("Configuration for providers")),
|
|
389
402
|
remote: z18._default(RemoteConfigZod, RemoteConfigZod.parse({})).check(z18.describe("Configuration for remote services")),
|
|
390
|
-
transports: z18._default(TransportsConfigZod, TransportsConfigZod.parse({})).check(z18.describe("
|
|
403
|
+
transports: z18._default(TransportsConfigZod, TransportsConfigZod.parse({})).check(z18.describe("Deprecated alias for connections (kept in sync during migration)")),
|
|
391
404
|
storage: z18._default(StorageConfigZod, StorageConfigZod.parse({})).check(z18.describe("Configuration for the storage")),
|
|
392
405
|
telemetry: z18._default(TelemetryConfigZod, TelemetryConfigZod.parse({})).check(z18.describe("Configuration for telemetry")),
|
|
393
406
|
validation: z18._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z18.describe("Configuration for validation"))
|