@xyo-network/xl1-network-model 4.0.6 → 4.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/index.mjs +86 -46
- package/dist/neutral/index.mjs.map +4 -4
- package/dist/neutral/models/Bootstrap.d.ts +2 -2
- package/dist/neutral/models/Bootstrap.d.ts.map +1 -1
- package/dist/neutral/staticRest/layout/chainContractManifest.d.ts +84 -0
- package/dist/neutral/staticRest/layout/chainContractManifest.d.ts.map +1 -0
- package/dist/neutral/staticRest/layout/chainManifest.d.ts +2 -2
- package/dist/neutral/staticRest/layout/index.d.ts +1 -0
- package/dist/neutral/staticRest/layout/index.d.ts.map +1 -1
- package/dist/neutral/staticRest/layout/indexManifest.d.ts +4 -4
- package/dist/neutral/staticRest/paths/chainState.d.ts +2 -0
- package/dist/neutral/staticRest/paths/chainState.d.ts.map +1 -1
- package/package.json +10 -8
package/dist/neutral/index.mjs
CHANGED
|
@@ -8,10 +8,10 @@ var mainnet_default = '<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" view
|
|
|
8
8
|
var testnet_default = '<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><g style="opacity:.5;"><path d="M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z" style="fill:#579fd6;"/><path d="M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z" style="fill:#579fd6;"/><path d="M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z" style="fill:#579fd6;"/><path d="M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z" style="fill:#579fd6;"/></g><path d="M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z" style="fill:#579fd6;"/></svg>';
|
|
9
9
|
|
|
10
10
|
// src/lib/Networks.ts
|
|
11
|
-
import { asHex } from "@
|
|
11
|
+
import { asHex } from "@ariestools/sdk";
|
|
12
12
|
|
|
13
13
|
// src/models/Bootstrap.ts
|
|
14
|
-
import { AsObjectFactory } from "@
|
|
14
|
+
import { AsObjectFactory } from "@ariestools/sdk";
|
|
15
15
|
import { asSchema, isPayloadOfSchemaType } from "@xyo-network/sdk-js";
|
|
16
16
|
var NetworkBootstrapSchema = asSchema("network.xyo.network.bootstrap", true);
|
|
17
17
|
var isNetworkBootstrap = isPayloadOfSchemaType(NetworkBootstrapSchema);
|
|
@@ -106,16 +106,48 @@ var initNetworkNode = async (activeNetwork, wallet) => {
|
|
|
106
106
|
return activeNetworkNode;
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
// src/staticRest/layout/
|
|
109
|
+
// src/staticRest/layout/chainContractManifest.ts
|
|
110
110
|
import {
|
|
111
111
|
zodAsFactory,
|
|
112
112
|
zodIsFactory,
|
|
113
113
|
zodToFactory
|
|
114
|
-
} from "@
|
|
114
|
+
} from "@ariestools/sdk";
|
|
115
|
+
import { ChainIdZod, XL1BlockNumberZod } from "@xyo-network/xl1-protocol-lib";
|
|
115
116
|
import { z } from "zod";
|
|
117
|
+
var ChainContractManifestSchema = "network.xyo.s3.chain.contract";
|
|
118
|
+
var CHAIN_CONTRACT_MANIFEST_VERSION = 1;
|
|
119
|
+
var ChainContractManifestZod = z.object({
|
|
120
|
+
forkedAtBlockNumber: XL1BlockNumberZod.nullable().optional(),
|
|
121
|
+
forkedAtHash: z.string().nullable().optional(),
|
|
122
|
+
forkedChainId: z.nullable(ChainIdZod).optional(),
|
|
123
|
+
minWithdrawalBlocks: z.int().nonnegative(),
|
|
124
|
+
rewardsContract: z.string(),
|
|
125
|
+
schema: z.literal(ChainContractManifestSchema),
|
|
126
|
+
stakingTokenAddress: z.string(),
|
|
127
|
+
version: z.int().positive()
|
|
128
|
+
});
|
|
129
|
+
var isChainContractManifest = zodIsFactory(ChainContractManifestZod);
|
|
130
|
+
var asChainContractManifest = zodAsFactory(ChainContractManifestZod, "asChainContractManifest");
|
|
131
|
+
var toChainContractManifest = zodToFactory(ChainContractManifestZod, "toChainContractManifest");
|
|
132
|
+
function createChainContractManifest(config) {
|
|
133
|
+
return asChainContractManifest({
|
|
134
|
+
...config,
|
|
135
|
+
schema: ChainContractManifestSchema,
|
|
136
|
+
version: CHAIN_CONTRACT_MANIFEST_VERSION
|
|
137
|
+
}, true);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// src/staticRest/layout/chainManifest.ts
|
|
141
|
+
import {
|
|
142
|
+
zodAsFactory as zodAsFactory2,
|
|
143
|
+
zodIsFactory as zodIsFactory2,
|
|
144
|
+
zodToFactory as zodToFactory2
|
|
145
|
+
} from "@ariestools/sdk";
|
|
146
|
+
import { z as z2 } from "zod";
|
|
116
147
|
|
|
117
148
|
// src/staticRest/paths/chainState.ts
|
|
118
149
|
var headPath = () => "chain/head.json";
|
|
150
|
+
var chainContractPath = () => "chain/contract.json";
|
|
119
151
|
|
|
120
152
|
// src/staticRest/paths/finalized.ts
|
|
121
153
|
var manifestPath = () => "manifest.json";
|
|
@@ -174,24 +206,24 @@ function indexSummaryPathTemplate(family) {
|
|
|
174
206
|
// src/staticRest/layout/chainManifest.ts
|
|
175
207
|
var CHAIN_LAYOUT_VERSION = 1;
|
|
176
208
|
var ChainManifestSchema = "network.xyo.s3.chain.manifest";
|
|
177
|
-
var ChainManifestPathsZod =
|
|
178
|
-
blockByHash:
|
|
179
|
-
blockByNumber:
|
|
180
|
-
head:
|
|
181
|
-
payload:
|
|
209
|
+
var ChainManifestPathsZod = z2.object({
|
|
210
|
+
blockByHash: z2.string(),
|
|
211
|
+
blockByNumber: z2.string(),
|
|
212
|
+
head: z2.string(),
|
|
213
|
+
payload: z2.string()
|
|
182
214
|
});
|
|
183
|
-
var ChainManifestZod =
|
|
215
|
+
var ChainManifestZod = z2.object({
|
|
184
216
|
/** Lowest block number available in the bucket (genesis until pruning exists). */
|
|
185
|
-
earliestBlock:
|
|
217
|
+
earliestBlock: z2.int().nonnegative(),
|
|
186
218
|
/** Storage/wire encoding of the published files (also on each object's Content-Encoding). */
|
|
187
|
-
encoding:
|
|
219
|
+
encoding: z2.string(),
|
|
188
220
|
paths: ChainManifestPathsZod,
|
|
189
|
-
schema:
|
|
190
|
-
version:
|
|
221
|
+
schema: z2.literal(ChainManifestSchema),
|
|
222
|
+
version: z2.int().positive()
|
|
191
223
|
});
|
|
192
|
-
var isChainManifest =
|
|
193
|
-
var asChainManifest =
|
|
194
|
-
var toChainManifest =
|
|
224
|
+
var isChainManifest = zodIsFactory2(ChainManifestZod);
|
|
225
|
+
var asChainManifest = zodAsFactory2(ChainManifestZod, "asChainManifest");
|
|
226
|
+
var toChainManifest = zodToFactory2(ChainManifestZod, "toChainManifest");
|
|
195
227
|
function createChainManifest(encoding, earliestBlock = 0) {
|
|
196
228
|
return asChainManifest({
|
|
197
229
|
earliestBlock,
|
|
@@ -204,55 +236,55 @@ function createChainManifest(encoding, earliestBlock = 0) {
|
|
|
204
236
|
|
|
205
237
|
// src/staticRest/layout/indexManifest.ts
|
|
206
238
|
import {
|
|
207
|
-
zodAsFactory as
|
|
208
|
-
zodIsFactory as
|
|
209
|
-
zodToFactory as
|
|
210
|
-
} from "@
|
|
211
|
-
import { z as
|
|
239
|
+
zodAsFactory as zodAsFactory3,
|
|
240
|
+
zodIsFactory as zodIsFactory3,
|
|
241
|
+
zodToFactory as zodToFactory3
|
|
242
|
+
} from "@ariestools/sdk";
|
|
243
|
+
import { z as z3 } from "zod";
|
|
212
244
|
var INDEX_LAYOUT_VERSION = 1;
|
|
213
245
|
var IndexManifestSchema = "network.xyo.s3.index.manifest";
|
|
214
246
|
var IndexHeadSchema = "network.xyo.s3.index.head";
|
|
215
|
-
var IndexManifestFamilyZod =
|
|
247
|
+
var IndexManifestFamilyZod = z3.object({
|
|
216
248
|
/** Highest step level published for this family. */
|
|
217
|
-
maxStep:
|
|
249
|
+
maxStep: z3.int().nonnegative(),
|
|
218
250
|
/** Path template for the family's frames, e.g. `blocks/{level}/{index}.json`. */
|
|
219
|
-
path:
|
|
251
|
+
path: z3.string()
|
|
220
252
|
});
|
|
221
|
-
var indexFamiliesZod =
|
|
253
|
+
var indexFamiliesZod = z3.object({
|
|
222
254
|
balances: IndexManifestFamilyZod,
|
|
223
255
|
blocks: IndexManifestFamilyZod,
|
|
224
256
|
schemas: IndexManifestFamilyZod,
|
|
225
257
|
transfers: IndexManifestFamilyZod
|
|
226
258
|
});
|
|
227
|
-
var IndexManifestZod =
|
|
259
|
+
var IndexManifestZod = z3.object({
|
|
228
260
|
families: indexFamiliesZod,
|
|
229
|
-
schema:
|
|
230
|
-
version:
|
|
261
|
+
schema: z3.literal(IndexManifestSchema),
|
|
262
|
+
version: z3.int().positive()
|
|
231
263
|
});
|
|
232
|
-
var isIndexManifest =
|
|
233
|
-
var asIndexManifest =
|
|
234
|
-
var toIndexManifest =
|
|
235
|
-
var IndexHeadFamiliesZod =
|
|
236
|
-
balances:
|
|
237
|
-
blocks:
|
|
238
|
-
schemas:
|
|
239
|
-
transfers:
|
|
264
|
+
var isIndexManifest = zodIsFactory3(IndexManifestZod);
|
|
265
|
+
var asIndexManifest = zodAsFactory3(IndexManifestZod, "asIndexManifest");
|
|
266
|
+
var toIndexManifest = zodToFactory3(IndexManifestZod, "toIndexManifest");
|
|
267
|
+
var IndexHeadFamiliesZod = z3.object({
|
|
268
|
+
balances: z3.int().nonnegative(),
|
|
269
|
+
blocks: z3.int().nonnegative(),
|
|
270
|
+
schemas: z3.int().nonnegative(),
|
|
271
|
+
transfers: z3.int().nonnegative()
|
|
240
272
|
});
|
|
241
|
-
var IndexHeadZod =
|
|
273
|
+
var IndexHeadZod = z3.object({
|
|
242
274
|
/** Highest block the index is complete through. */
|
|
243
|
-
block:
|
|
275
|
+
block: z3.int().nonnegative(),
|
|
244
276
|
/** Completed frame counts per family. */
|
|
245
277
|
families: IndexHeadFamiliesZod,
|
|
246
278
|
/** Hash of that block. */
|
|
247
|
-
hash:
|
|
248
|
-
schema:
|
|
279
|
+
hash: z3.string(),
|
|
280
|
+
schema: z3.literal(IndexHeadSchema),
|
|
249
281
|
/** ISO-8601 timestamp of the last update. */
|
|
250
|
-
updatedAt:
|
|
251
|
-
version:
|
|
282
|
+
updatedAt: z3.string(),
|
|
283
|
+
version: z3.int().positive()
|
|
252
284
|
});
|
|
253
|
-
var isIndexHead =
|
|
254
|
-
var asIndexHead =
|
|
255
|
-
var toIndexHead =
|
|
285
|
+
var isIndexHead = zodIsFactory3(IndexHeadZod);
|
|
286
|
+
var asIndexHead = zodAsFactory3(IndexHeadZod, "asIndexHead");
|
|
287
|
+
var toIndexHead = zodToFactory3(IndexHeadZod, "toIndexHead");
|
|
256
288
|
function createIndexManifestFamilies(maxSteps) {
|
|
257
289
|
return {
|
|
258
290
|
balances: { maxStep: maxSteps.balances, path: indexSummaryPathTemplate("balances") },
|
|
@@ -333,7 +365,10 @@ var ExplorerLinks = class {
|
|
|
333
365
|
}
|
|
334
366
|
};
|
|
335
367
|
export {
|
|
368
|
+
CHAIN_CONTRACT_MANIFEST_VERSION,
|
|
336
369
|
CHAIN_LAYOUT_VERSION,
|
|
370
|
+
ChainContractManifestSchema,
|
|
371
|
+
ChainContractManifestZod,
|
|
337
372
|
ChainManifestPathsZod,
|
|
338
373
|
ChainManifestSchema,
|
|
339
374
|
ChainManifestZod,
|
|
@@ -354,6 +389,7 @@ export {
|
|
|
354
389
|
NetworkDataLakeUrls,
|
|
355
390
|
SequenceNetwork,
|
|
356
391
|
testnet_default as SequenceNetworkIconString,
|
|
392
|
+
asChainContractManifest,
|
|
357
393
|
asChainManifest,
|
|
358
394
|
asIndexHead,
|
|
359
395
|
asIndexManifest,
|
|
@@ -362,7 +398,9 @@ export {
|
|
|
362
398
|
blockHashPathTemplate,
|
|
363
399
|
blockNumberPath,
|
|
364
400
|
blockNumberPathTemplate,
|
|
401
|
+
chainContractPath,
|
|
365
402
|
chainManifestPathTemplates,
|
|
403
|
+
createChainContractManifest,
|
|
366
404
|
createChainManifest,
|
|
367
405
|
createIndexHead,
|
|
368
406
|
createIndexManifest,
|
|
@@ -376,6 +414,7 @@ export {
|
|
|
376
414
|
indexSummaryPathTemplate,
|
|
377
415
|
initNetworkNode,
|
|
378
416
|
interpolatePathTemplate,
|
|
417
|
+
isChainContractManifest,
|
|
379
418
|
isChainManifest,
|
|
380
419
|
isIndexHead,
|
|
381
420
|
isIndexManifest,
|
|
@@ -383,6 +422,7 @@ export {
|
|
|
383
422
|
manifestPath,
|
|
384
423
|
payloadPath,
|
|
385
424
|
payloadPathTemplate,
|
|
425
|
+
toChainContractManifest,
|
|
386
426
|
toChainManifest,
|
|
387
427
|
toIndexHead,
|
|
388
428
|
toIndexManifest,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/icons/local/local.svg", "../../src/icons/mainnet/mainnet.svg", "../../src/icons/sequence/testnet.svg", "../../src/lib/Networks.ts", "../../src/models/Bootstrap.ts", "../../src/lib/NetworkDataLakeUrls.ts", "../../src/modules/node/getNetworkNode.ts", "../../src/manifest/network.json", "../../src/manifest/networkManifest.ts", "../../src/modules/node/getNetworkNodes.ts", "../../src/modules/node/initNetworkNode.ts", "../../src/staticRest/layout/chainManifest.ts", "../../src/staticRest/paths/chainState.ts", "../../src/staticRest/paths/finalized.ts", "../../src/staticRest/paths/indexPaths.ts", "../../src/staticRest/templates.ts", "../../src/staticRest/layout/indexManifest.ts", "../../src/utils/ExplorerLinks.ts"],
|
|
4
|
-
"sourcesContent": ["<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><g style=\"opacity:.5;\"><path d=\"M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z\" style=\"fill:#f47f00;\"/><path d=\"M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z\" style=\"fill:#f47f00;\"/><path d=\"M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z\" style=\"fill:#f47f00;\"/><path d=\"M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z\" style=\"fill:#f47f00;\"/></g><path d=\"M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z\" style=\"fill:#f47f00;\"/></svg>", "<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><path d=\"M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z\" style=\"fill:#8d8fc6;\"/><path d=\"M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z\" style=\"fill:#eb407a;\"/><path d=\"M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z\" style=\"fill:#579fd6;\"/><path d=\"M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z\" style=\"fill:#f27046;\"/><path d=\"M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z\" style=\"fill:#572aff;\"/></svg>", "<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><g style=\"opacity:.5;\"><path d=\"M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z\" style=\"fill:#579fd6;\"/><path d=\"M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z\" style=\"fill:#579fd6;\"/><path d=\"M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z\" style=\"fill:#579fd6;\"/><path d=\"M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z\" style=\"fill:#579fd6;\"/></g><path d=\"M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z\" style=\"fill:#579fd6;\"/></svg>", "import { asHex } from '@xylabs/sdk'\n\nimport {\n LocalNetworkIconString, MainNetworkIconString, SequenceNetworkIconString,\n} from '../icons/index.ts'\nimport type { NetworkBootstrap, NetworkId } from '../models/index.ts'\nimport { NetworkBootstrapSchema } from '../models/index.ts'\n\n/** Bootstrap configuration for the XYO Layer 1 mainnet. */\nexport const MainNetwork: NetworkBootstrap = {\n chain: asHex('319e667ced10452a117472811130444ded357f26', true),\n description: 'Main Network for XYO Layer 1',\n icon: MainNetworkIconString,\n id: 'mainnet' as NetworkId,\n name: 'Mainnet',\n schema: NetworkBootstrapSchema,\n symbol: 'XL1',\n url: 'https://api.chain.xyo.network',\n explorerUrl: 'https://explore.xyo.network',\n}\n\n/** Bootstrap configuration for the XYO Layer 1 sequence (test) network. */\nexport const SequenceNetwork: NetworkBootstrap = {\n chain: asHex('4b43a753c8024c0e5000e8ac948ac0063ac624bc', true),\n description: 'Test Network for XYO Layer 1',\n icon: SequenceNetworkIconString,\n id: 'sequence' as NetworkId,\n name: 'Sequence',\n schema: NetworkBootstrapSchema,\n symbol: 'XL1',\n url: 'https://beta.api.chain.xyo.network',\n explorerUrl: 'https://beta.explore.xyo.network',\n}\n\n/** Bootstrap configuration for a local development network. */\nexport const LocalNetwork: NetworkBootstrap = {\n description: 'Local Node',\n icon: LocalNetworkIconString,\n id: 'local' as NetworkId,\n name: 'Local',\n schema: NetworkBootstrapSchema,\n symbol: 'XL1',\n url: 'http://localhost:8080',\n explorerUrl: 'http://localhost:3000',\n}\n\n/** Default set of available XYO Layer 1 networks (mainnet, sequence, local). */\nexport const DefaultNetworks: NetworkBootstrap[] = [MainNetwork, SequenceNetwork, LocalNetwork]\n", "import type { Address } from '@xylabs/sdk'\nimport { AsObjectFactory } from '@xylabs/sdk'\nimport type { Payload } from '@xyo-network/sdk-js'\nimport { asSchema, isPayloadOfSchemaType } from '@xyo-network/sdk-js'\nimport type { ChainId } from '@xyo-network/xl1-protocol-lib'\n\nimport type { NetworkId } from './NetworkId.ts'\n\n/** Connection details for accessing a chain endpoint. */\nexport interface ChainConnection {\n /** Chain Identifier - can be a hex (eth contract address) or a string */\n chain?: ChainId\n /** Name of the chain */\n name: string\n /** URL for accessing the network */\n url: string\n}\n\n/** Schema identifier for network bootstrap payloads. */\nexport const NetworkBootstrapSchema = asSchema('network.xyo.network.bootstrap', true)\n/** Schema type for network bootstrap payloads. */\nexport type NetworkBootstrapSchema = typeof NetworkBootstrapSchema\n\n/** Fields describing a chain fork origin. */\nexport interface ChainForkFields {\n /** Block Number at which the chain was forked from */\n forkedAtLastBlockNumber?: string\n /** Hash in the last block the chain was forked from */\n forkedAtLastHash?: string\n /** Address of the forked chain */\n forkedChainId?: Address\n}\n\n/** Core fields describing an XYO network. */\nexport interface NetworkFields {\n /** Description of the network */\n description: string\n /** URL for accessing the network explorer */\n explorerUrl?: string\n /** string representation of the icon (SVG) */\n icon?: string\n /** Machine-readable identifier */\n id: NetworkId\n schema: NetworkBootstrapSchema\n /** Symbol of the network */\n symbol?: string\n}\n\n/** Optional Properties can be found walking the chain to the genesis block */\nexport interface NetworkBootstrapFields extends NetworkFields, ChainForkFields, ChainConnection {}\n\n/** A network bootstrap extended with a flag indicating whether it is a custom network. */\nexport interface Network extends NetworkBootstrap {\n custom: boolean\n}\n\n/** Payload type containing all network bootstrap configuration fields. */\nexport type NetworkBootstrap = Payload<NetworkBootstrapFields, NetworkBootstrapSchema>\n\n/** Type guard that checks whether a payload is a NetworkBootstrap. */\nexport const isNetworkBootstrap = isPayloadOfSchemaType<NetworkBootstrap>(NetworkBootstrapSchema)\n\n/** Optionally casts a value to a Network if it is a valid NetworkBootstrap. */\nexport const asOptionalNetwork = AsObjectFactory.createOptional(isNetworkBootstrap)\n", "import type { GatewayName } from '@xyo-network/xl1-protocol-lib'\n\nimport {\n LocalNetwork, MainNetwork, SequenceNetwork,\n} from './Networks.ts'\n\n/** Map of network IDs to their corresponding Data Lake API URLs. */\nexport const NetworkDataLakeUrls = {\n [MainNetwork.id]: 'https://api.archivist.xyo.network/dataLake',\n [SequenceNetwork.id]: 'https://beta.api.archivist.xyo.network/dataLake',\n [LocalNetwork.id]: 'http://localhost:8080/dataLake',\n} as const satisfies Record<GatewayName, string>\n", "import type { AttachableNodeInstance, WalletInstance } from '@xyo-network/sdk-js'\nimport { ManifestWrapper, ModuleFactoryLocator } from '@xyo-network/sdk-js'\n\nimport { NetworkNodeManifest } from '../../manifest/index.ts'\n\n/**\n * Creates a network node from the network manifest using the provided wallet.\n *\n * @deprecated Bootstrapping an XYO `NodeInstance` via manifest is no longer supported.\n * Use `connectArchivist` from `@xyo-network/xl1-protocol-sdk` for co-located archivist\n * access, or `GatewayBuilder` from `@xyo-network/xl1-gateway` for remote RPC access.\n */\nexport async function getNetworkNode(wallet: WalletInstance): Promise<AttachableNodeInstance> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated shim using deprecated manifest\n const wrapper = new ManifestWrapper(NetworkNodeManifest, wallet, new ModuleFactoryLocator())\n const [node] = await wrapper.loadNodes()\n return node\n}\n", "{\n \"$schema\": \"https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json\",\n \"nodes\": [\n {\n \"config\": {\n \"accountPath\": \"44'/60'/1\",\n \"name\": \"Network\",\n \"schema\": \"network.xyo.node.config\"\n },\n \"modules\": {\n \"private\": [],\n \"public\": []\n }\n }\n ],\n \"schema\": \"network.xyo.manifest\"\n}", "import type { PackageManifestPayload } from '@xyo-network/sdk-js'\n\nimport node from './network.json' with { type: 'json' }\n\n/** @deprecated XYO Node manifest bootstrap is no longer used; wire providers via archivist bindings or JsonRpc instead. */\nexport const NetworkNodeManifest = node as unknown as PackageManifestPayload\n", "import type { AttachableNodeInstance } from '@xyo-network/sdk-js'\n\nconst networkNodeMap = new Map<string, AttachableNodeInstance>()\n\n/** @deprecated Internal cache for deprecated `initNetworkNode`; do not use. */\nexport const getNetworkNodes = () => {\n return networkNodeMap\n}\n", "import type { AttachableNodeInstance, WalletInstance } from '@xyo-network/sdk-js'\n\nimport type { NetworkBootstrap } from '../../models/index.ts'\nimport { getNetworkNode } from './getNetworkNode.ts'\nimport { getNetworkNodes } from './getNetworkNodes.ts'\n\n/** @deprecated Use `connectArchivist` archivist bindings (`@xyo-network/xl1-protocol-sdk`) or `GatewayBuilder` (`@xyo-network/xl1-gateway`) instead of bootstrapping an XYO NodeInstance. */\nexport const initNetworkNode = async (activeNetwork: NetworkBootstrap, wallet: WalletInstance): Promise<AttachableNodeInstance> => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated shim calling deprecated shim\n const networkNodeMap = getNetworkNodes()\n if (networkNodeMap.has(activeNetwork.url)) return networkNodeMap.get(activeNetwork.url)!\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated shim calling deprecated shim\n const activeNetworkNode = await getNetworkNode(wallet)\n networkNodeMap.set(activeNetwork.url, activeNetworkNode)\n\n return activeNetworkNode\n}\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk'\nimport { z } from 'zod'\n\nimport { chainManifestPathTemplates } from '../templates.ts'\n\n/** Bumped when the finalized layout changes shape, so readers can detect a mismatch. */\nexport const CHAIN_LAYOUT_VERSION = 1\n\n/** Schema id for the finalized layout manifest document. */\nexport const ChainManifestSchema = 'network.xyo.s3.chain.manifest' as const\n/** Type literal for the chain manifest schema. */\nexport type ChainManifestSchema = typeof ChainManifestSchema\n\n/** Path templates for the finalized + chain-state files. */\nexport const ChainManifestPathsZod = z.object({\n blockByHash: z.string(),\n blockByNumber: z.string(),\n head: z.string(),\n payload: z.string(),\n})\n\n/** Type for chain manifest path templates. */\nexport type ChainManifestPaths = z.infer<typeof ChainManifestPathsZod>\n\n/** Zod schema for the finalized layout descriptor at `manifestPath()`. */\nexport const ChainManifestZod = z.object({\n /** Lowest block number available in the bucket (genesis until pruning exists). */\n earliestBlock: z.int().nonnegative(),\n /** Storage/wire encoding of the published files (also on each object's Content-Encoding). */\n encoding: z.string(),\n paths: ChainManifestPathsZod,\n schema: z.literal(ChainManifestSchema),\n version: z.int().positive(),\n})\n\n/** The finalized layout descriptor at `manifestPath()`. */\nexport type ChainManifest = z.infer<typeof ChainManifestZod>\n\n/** Type guard that checks if a value is a valid ChainManifest. */\nexport const isChainManifest = zodIsFactory(ChainManifestZod)\n/** Converts a value to ChainManifest, throwing if invalid. */\nexport const asChainManifest = zodAsFactory(ChainManifestZod, 'asChainManifest')\n/** Non-validating cast to ChainManifest. */\nexport const toChainManifest = zodToFactory(ChainManifestZod, 'toChainManifest')\n\n/** Builds a validated chain manifest with path templates derived from the path builders. */\nexport function createChainManifest(encoding: string, earliestBlock = 0): ChainManifest {\n return asChainManifest({\n earliestBlock,\n encoding,\n paths: chainManifestPathTemplates(),\n schema: ChainManifestSchema,\n version: CHAIN_LAYOUT_VERSION,\n }, true)\n}\n", "/**\n * Path builders for the chain-state (mutable) bucket.\n *\n * Paths are relative \u2014 no leading slash \u2014 and joined to a base URL by the consumer.\n */\n\n/** The mutable head pointer: the current head SignedHydratedBlockWithHashMeta. */\nexport const headPath = (): string => 'chain/head.json'\n", "/**\n * Path builders for the finalized (immutable) bucket.\n *\n * Paths are relative \u2014 no leading slash \u2014 and joined to a base URL by the consumer.\n */\n\n/** The finalized layout descriptor (path templates, encoding, version, earliest block). */\nexport const manifestPath = (): string => 'manifest.json'\n\n/** A block by number: SignedHydratedBlockWithHashMeta. */\nexport const blockNumberPath = (block: number): string => `block/number/${block}.json`\n\n/** A block by hash: the same content as its by-number twin. */\nexport const blockHashPath = (hash: string): string => `block/hash/${hash}.json`\n\n/** A payload by hash: WithHashMeta<Payload>. */\nexport const payloadPath = (hash: string): string => `payload/${hash}.json`\n", "import type { IndexSummaryFamily } from '@xyo-network/xl1-protocol-lib'\n\n/**\n * Path builders for the index bucket.\n *\n * The index is a separate, single-writer bucket holding completed step summaries for several\n * families. Paths are relative \u2014 no leading slash \u2014 and joined to a base URL by the consumer.\n */\n\n/** A completed frame's summary for a family, e.g. `blocks/2/5.json`. Immutable once written. */\nexport const indexSummaryPath = (family: IndexSummaryFamily, stepLevel: number, stepIndex: number): string =>\n `${family}/${stepLevel}/${stepIndex}.json`\n\n/** The index layout descriptor (families, max step, encoding, version). */\nexport const indexManifestPath = (): string => 'manifest.json'\n\n/** The indexer's progress watermark (highest block the index is complete through). */\nexport const indexHeadPath = (): string => 'head.json'\n", "import type { IndexSummaryFamily } from '@xyo-network/xl1-protocol-lib'\n\nimport { headPath } from './paths/chainState.ts'\nimport {\n blockHashPath, blockNumberPath, payloadPath,\n} from './paths/finalized.ts'\nimport { indexSummaryPath } from './paths/indexPaths.ts'\n\n/** Sentinel values used when deriving self-describing path templates from concrete builders. */\nconst TEMPLATE_SLOTS = {\n block: 0,\n hash: '0'.repeat(64),\n index: 99,\n level: 42,\n} as const\n\n/**\n * Replaces concrete slot literals in a path with named `{placeholder}` segments.\n * Used to derive manifest path templates from the path builders so the two cannot drift.\n */\nexport function toPathTemplate(path: string, slots: { literal: string; name: string }[]): string {\n let result = path\n for (const { literal, name } of slots) {\n if (!result.includes(literal)) {\n throw new Error(`Template slot \"${literal}\" not found in path \"${path}\"`)\n }\n result = result.split(literal).join(`{${name}}`)\n }\n return result\n}\n\n/** Fills `{placeholder}` segments in a manifest path template. Used in conformance tests. */\nexport function interpolatePathTemplate(template: string, values: Record<string, string | number>): string {\n let result = template\n for (const [key, value] of Object.entries(values)) {\n result = result.split(`{${key}}`).join(String(value))\n }\n return result\n}\n\n/** Self-describing template for `blockNumberPath`. */\nexport const blockNumberPathTemplate = (): string =>\n toPathTemplate(blockNumberPath(TEMPLATE_SLOTS.block), [{ literal: String(TEMPLATE_SLOTS.block), name: 'block' }])\n\n/** Self-describing template for `blockHashPath`. */\nexport const blockHashPathTemplate = (): string =>\n toPathTemplate(blockHashPath(TEMPLATE_SLOTS.hash), [{ literal: TEMPLATE_SLOTS.hash, name: 'hash' }])\n\n/** Self-describing template for `payloadPath`. */\nexport const payloadPathTemplate = (): string =>\n toPathTemplate(payloadPath(TEMPLATE_SLOTS.hash), [{ literal: TEMPLATE_SLOTS.hash, name: 'hash' }])\n\n/** Self-describing templates for finalized + chain-state files carried in the chain manifest. */\nexport function chainManifestPathTemplates(): {\n blockByHash: string\n blockByNumber: string\n head: string\n payload: string\n} {\n return {\n blockByHash: blockHashPathTemplate(),\n blockByNumber: blockNumberPathTemplate(),\n head: headPath(),\n payload: payloadPathTemplate(),\n }\n}\n\n/** Self-describing template for one index summary family, e.g. `blocks/{level}/{index}.json`. */\nexport function indexSummaryPathTemplate(family: IndexSummaryFamily): string {\n const path = indexSummaryPath(family, TEMPLATE_SLOTS.level, TEMPLATE_SLOTS.index)\n return toPathTemplate(path, [\n { literal: String(TEMPLATE_SLOTS.level), name: 'level' },\n { literal: String(TEMPLATE_SLOTS.index), name: 'index' },\n ])\n}\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk'\nimport type { IndexSummaryFamily, IndexWatermark } from '@xyo-network/xl1-protocol-lib'\nimport { z } from 'zod'\n\nimport { indexSummaryPathTemplate } from '../templates.ts'\n\n/** Bumped when the on-disk index layout changes shape, so readers can detect a mismatch. */\nexport const INDEX_LAYOUT_VERSION = 1\n\n/** Schema id for the index manifest document (the static layout descriptor). */\nexport const IndexManifestSchema = 'network.xyo.s3.index.manifest' as const\n/** Type literal for the index manifest schema. */\nexport type IndexManifestSchema = typeof IndexManifestSchema\n\n/** Schema id for the index head document (the progress watermark). */\nexport const IndexHeadSchema = 'network.xyo.s3.index.head' as const\n/** Type literal for the index head schema. */\nexport type IndexHeadSchema = typeof IndexHeadSchema\n\n/** Per-family descriptor carried in the manifest. */\nexport const IndexManifestFamilyZod = z.object({\n /** Highest step level published for this family. */\n maxStep: z.int().nonnegative(),\n /** Path template for the family's frames, e.g. `blocks/{level}/{index}.json`. */\n path: z.string(),\n})\n\n/** Type for one index manifest family descriptor. */\nexport type IndexManifestFamily = z.infer<typeof IndexManifestFamilyZod>\n\nconst indexFamiliesZod = z.object({\n balances: IndexManifestFamilyZod,\n blocks: IndexManifestFamilyZod,\n schemas: IndexManifestFamilyZod,\n transfers: IndexManifestFamilyZod,\n})\n\n/** Zod schema for the static index layout descriptor at `indexManifestPath()`. */\nexport const IndexManifestZod = z.object({\n families: indexFamiliesZod,\n schema: z.literal(IndexManifestSchema),\n version: z.int().positive(),\n})\n\n/** The static index layout descriptor at `indexManifestPath()`. */\nexport type IndexManifest = z.infer<typeof IndexManifestZod>\n\n/** Type guard that checks if a value is a valid IndexManifest. */\nexport const isIndexManifest = zodIsFactory(IndexManifestZod)\n/** Converts a value to IndexManifest, throwing if invalid. */\nexport const asIndexManifest = zodAsFactory(IndexManifestZod, 'asIndexManifest')\n/** Non-validating cast to IndexManifest. */\nexport const toIndexManifest = zodToFactory(IndexManifestZod, 'toIndexManifest')\n\n/** Completed frame counts per family in the index head watermark. */\nexport const IndexHeadFamiliesZod = z.object({\n balances: z.int().nonnegative(),\n blocks: z.int().nonnegative(),\n schemas: z.int().nonnegative(),\n transfers: z.int().nonnegative(),\n})\n\n/** Zod schema for the index progress watermark at `indexHeadPath()`. */\nexport const IndexHeadZod = z.object({\n /** Highest block the index is complete through. */\n block: z.int().nonnegative(),\n /** Completed frame counts per family. */\n families: IndexHeadFamiliesZod,\n /** Hash of that block. */\n hash: z.string(),\n schema: z.literal(IndexHeadSchema),\n /** ISO-8601 timestamp of the last update. */\n updatedAt: z.string(),\n version: z.int().positive(),\n})\n\n/** The index progress watermark at `indexHeadPath()`. */\nexport type IndexHead = z.infer<typeof IndexHeadZod>\n\n/** Type guard that checks if a value is a valid IndexHead. */\nexport const isIndexHead = zodIsFactory(IndexHeadZod)\n/** Converts a value to IndexHead, throwing if invalid. */\nexport const asIndexHead = zodAsFactory(IndexHeadZod, 'asIndexHead')\n/** Non-validating cast to IndexHead. */\nexport const toIndexHead = zodToFactory(IndexHeadZod, 'toIndexHead')\n\n/** Builds per-family manifest descriptors with path templates derived from the path builders. */\nexport function createIndexManifestFamilies(\n maxSteps: Record<IndexSummaryFamily, number>,\n): Record<IndexSummaryFamily, IndexManifestFamily> {\n return {\n balances: { maxStep: maxSteps.balances, path: indexSummaryPathTemplate('balances') },\n blocks: { maxStep: maxSteps.blocks, path: indexSummaryPathTemplate('blocks') },\n schemas: { maxStep: maxSteps.schemas, path: indexSummaryPathTemplate('schemas') },\n transfers: { maxStep: maxSteps.transfers, path: indexSummaryPathTemplate('transfers') },\n }\n}\n\n/** Builds a validated index manifest with path templates derived from the path builders. */\nexport function createIndexManifest(maxSteps: Record<IndexSummaryFamily, number>): IndexManifest {\n return asIndexManifest({\n families: createIndexManifestFamilies(maxSteps),\n schema: IndexManifestSchema,\n version: INDEX_LAYOUT_VERSION,\n }, true)\n}\n\n/** Builds a validated index head watermark from an indexer progress snapshot. */\nexport function createIndexHead(watermark: IndexWatermark, updatedAt?: string): IndexHead {\n const now = new Date()\n const resolvedUpdatedAt = updatedAt ?? now.toISOString()\n return asIndexHead({\n block: watermark.block,\n families: watermark.families,\n hash: watermark.hash,\n schema: IndexHeadSchema,\n updatedAt: resolvedUpdatedAt,\n version: INDEX_LAYOUT_VERSION,\n }, true)\n}\n", "import type { NetworkId } from '../models/index.ts'\n\n/** Builds URLs to pages on an XL1 chain explorer for a specific network. */\nexport class ExplorerLinks {\n readonly explorerUrl: string\n readonly networkId: NetworkId\n\n constructor(explorerUrl: string, networkId: NetworkId) {\n this.explorerUrl = explorerUrl.replace(/\\/+$/, '')\n this.networkId = networkId\n }\n\n /** `{explorerUrl}/xl1/{networkId}/address/{address}` */\n address(address: string): string {\n return `${this.network()}/address/${address}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/addresses` */\n addresses(): string {\n return `${this.network()}/addresses`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/block/{blockHash}` */\n block(blockHash: string): string {\n return `${this.network()}/block/${blockHash}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/block/number/{blockNumber}` */\n blockByNumber(blockNumber: number | string): string {\n return `${this.network()}/block/number/${blockNumber}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/block/{blockHash}/payload/{payloadHash}[/{render}]` */\n blockPayload(blockHash: string, payloadHash: string, render?: string): string {\n const base = `${this.network()}/block/${blockHash}/payload/${payloadHash}`\n return render === undefined ? base : `${base}/${render}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/blocks` */\n blocks(): string {\n return `${this.network()}/blocks`\n }\n\n /** `{explorerUrl}/xl1/{networkId}` */\n network(): string {\n return `${this.explorerUrl}/xl1/${this.networkId}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/transaction/{txHash}` */\n transaction(txHash: string): string {\n return `${this.network()}/transaction/${txHash}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/transaction/{txHash}/payload/{payloadHash}[/{render}]` */\n transactionPayload(txHash: string, payloadHash: string, render?: string): string {\n const base = `${this.network()}/transaction/${txHash}/payload/${payloadHash}`\n return render === undefined ? base : `${base}/${render}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/transactions` */\n transactions(): string {\n return `${this.network()}/transactions`\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAAA;;;ACAA;;;ACAA;;;ACAA,SAAS,aAAa;;;ACCtB,SAAS,uBAAuB;AAEhC,SAAS,UAAU,6BAA6B;AAgBzC,IAAM,yBAAyB,SAAS,iCAAiC,IAAI;AAyC7E,IAAM,qBAAqB,sBAAwC,sBAAsB;AAGzF,IAAM,oBAAoB,gBAAgB,eAAe,kBAAkB;;;ADtD3E,IAAM,cAAgC;AAAA,EAC3C,OAAO,MAAM,4CAA4C,IAAI;AAAA,EAC7D,aAAa;AAAA,EACb,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,aAAa;AACf;AAGO,IAAM,kBAAoC;AAAA,EAC/C,OAAO,MAAM,4CAA4C,IAAI;AAAA,EAC7D,aAAa;AAAA,EACb,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,aAAa;AACf;AAGO,IAAM,eAAiC;AAAA,EAC5C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,aAAa;AACf;AAGO,IAAM,kBAAsC,CAAC,aAAa,iBAAiB,YAAY;;;AExCvF,IAAM,sBAAsB;AAAA,EACjC,CAAC,YAAY,EAAE,GAAG;AAAA,EAClB,CAAC,gBAAgB,EAAE,GAAG;AAAA,EACtB,CAAC,aAAa,EAAE,GAAG;AACrB;;;ACVA,SAAS,iBAAiB,4BAA4B;;;ACDtD;AAAA,EACE,SAAW;AAAA,EACX,OAAS;AAAA,IACP;AAAA,MACE,QAAU;AAAA,QACR,aAAe;AAAA,QACf,MAAQ;AAAA,QACR,QAAU;AAAA,MACZ;AAAA,MACA,SAAW;AAAA,QACT,SAAW,CAAC;AAAA,QACZ,QAAU,CAAC;AAAA,MACb;AAAA,IACF;AAAA,EACF;AAAA,EACA,QAAU;AACZ;;;ACXO,IAAM,sBAAsB;;;AFOnC,eAAsB,eAAe,QAAyD;AAE5F,QAAM,UAAU,IAAI,gBAAgB,qBAAqB,QAAQ,IAAI,qBAAqB,CAAC;AAC3F,QAAM,CAAC,IAAI,IAAI,MAAM,QAAQ,UAAU;AACvC,SAAO;AACT;;;AGfA,IAAM,iBAAiB,oBAAI,IAAoC;AAGxD,IAAM,kBAAkB,MAAM;AACnC,SAAO;AACT;;;ACAO,IAAM,kBAAkB,OAAO,eAAiC,WAA4D;AAEjI,QAAMA,kBAAiB,gBAAgB;AACvC,MAAIA,gBAAe,IAAI,cAAc,GAAG,EAAG,QAAOA,gBAAe,IAAI,cAAc,GAAG;AAGtF,QAAM,oBAAoB,MAAM,eAAe,MAAM;AACrD,EAAAA,gBAAe,IAAI,cAAc,KAAK,iBAAiB;AAEvD,SAAO;AACT;;;ACjBA;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP,SAAS,SAAS;;;ACIX,IAAM,WAAW,MAAc
|
|
6
|
-
"names": ["networkNodeMap", "zodAsFactory", "zodIsFactory", "zodToFactory", "z", "z", "zodIsFactory", "zodAsFactory", "zodToFactory"]
|
|
3
|
+
"sources": ["../../src/icons/local/local.svg", "../../src/icons/mainnet/mainnet.svg", "../../src/icons/sequence/testnet.svg", "../../src/lib/Networks.ts", "../../src/models/Bootstrap.ts", "../../src/lib/NetworkDataLakeUrls.ts", "../../src/modules/node/getNetworkNode.ts", "../../src/manifest/network.json", "../../src/manifest/networkManifest.ts", "../../src/modules/node/getNetworkNodes.ts", "../../src/modules/node/initNetworkNode.ts", "../../src/staticRest/layout/chainContractManifest.ts", "../../src/staticRest/layout/chainManifest.ts", "../../src/staticRest/paths/chainState.ts", "../../src/staticRest/paths/finalized.ts", "../../src/staticRest/paths/indexPaths.ts", "../../src/staticRest/templates.ts", "../../src/staticRest/layout/indexManifest.ts", "../../src/utils/ExplorerLinks.ts"],
|
|
4
|
+
"sourcesContent": ["<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><g style=\"opacity:.5;\"><path d=\"M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z\" style=\"fill:#f47f00;\"/><path d=\"M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z\" style=\"fill:#f47f00;\"/><path d=\"M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z\" style=\"fill:#f47f00;\"/><path d=\"M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z\" style=\"fill:#f47f00;\"/></g><path d=\"M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z\" style=\"fill:#f47f00;\"/></svg>", "<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><path d=\"M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z\" style=\"fill:#8d8fc6;\"/><path d=\"M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z\" style=\"fill:#eb407a;\"/><path d=\"M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z\" style=\"fill:#579fd6;\"/><path d=\"M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z\" style=\"fill:#f27046;\"/><path d=\"M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z\" style=\"fill:#572aff;\"/></svg>", "<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><g style=\"opacity:.5;\"><path d=\"M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z\" style=\"fill:#579fd6;\"/><path d=\"M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z\" style=\"fill:#579fd6;\"/><path d=\"M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z\" style=\"fill:#579fd6;\"/><path d=\"M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z\" style=\"fill:#579fd6;\"/></g><path d=\"M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z\" style=\"fill:#579fd6;\"/></svg>", "import { asHex } from '@ariestools/sdk'\n\nimport {\n LocalNetworkIconString, MainNetworkIconString, SequenceNetworkIconString,\n} from '../icons/index.ts'\nimport type { NetworkBootstrap, NetworkId } from '../models/index.ts'\nimport { NetworkBootstrapSchema } from '../models/index.ts'\n\n/** Bootstrap configuration for the XYO Layer 1 mainnet. */\nexport const MainNetwork: NetworkBootstrap = {\n chain: asHex('319e667ced10452a117472811130444ded357f26', true),\n description: 'Main Network for XYO Layer 1',\n icon: MainNetworkIconString,\n id: 'mainnet' as NetworkId,\n name: 'Mainnet',\n schema: NetworkBootstrapSchema,\n symbol: 'XL1',\n url: 'https://api.chain.xyo.network',\n explorerUrl: 'https://explore.xyo.network',\n}\n\n/** Bootstrap configuration for the XYO Layer 1 sequence (test) network. */\nexport const SequenceNetwork: NetworkBootstrap = {\n chain: asHex('4b43a753c8024c0e5000e8ac948ac0063ac624bc', true),\n description: 'Test Network for XYO Layer 1',\n icon: SequenceNetworkIconString,\n id: 'sequence' as NetworkId,\n name: 'Sequence',\n schema: NetworkBootstrapSchema,\n symbol: 'XL1',\n url: 'https://beta.api.chain.xyo.network',\n explorerUrl: 'https://beta.explore.xyo.network',\n}\n\n/** Bootstrap configuration for a local development network. */\nexport const LocalNetwork: NetworkBootstrap = {\n description: 'Local Node',\n icon: LocalNetworkIconString,\n id: 'local' as NetworkId,\n name: 'Local',\n schema: NetworkBootstrapSchema,\n symbol: 'XL1',\n url: 'http://localhost:8080',\n explorerUrl: 'http://localhost:3000',\n}\n\n/** Default set of available XYO Layer 1 networks (mainnet, sequence, local). */\nexport const DefaultNetworks: NetworkBootstrap[] = [MainNetwork, SequenceNetwork, LocalNetwork]\n", "import type { Address } from '@ariestools/sdk'\nimport { AsObjectFactory } from '@ariestools/sdk'\nimport type { Payload } from '@xyo-network/sdk-js'\nimport { asSchema, isPayloadOfSchemaType } from '@xyo-network/sdk-js'\nimport type { ChainId } from '@xyo-network/xl1-protocol-lib'\n\nimport type { NetworkId } from './NetworkId.ts'\n\n/** Connection details for accessing a chain endpoint. */\nexport interface ChainConnection {\n /** Chain Identifier - can be a hex (eth contract address) or a string */\n chain?: ChainId\n /** Name of the chain */\n name: string\n /** URL for accessing the network */\n url: string\n}\n\n/** Schema identifier for network bootstrap payloads. */\nexport const NetworkBootstrapSchema = asSchema('network.xyo.network.bootstrap', true)\n/** Schema type for network bootstrap payloads. */\nexport type NetworkBootstrapSchema = typeof NetworkBootstrapSchema\n\n/** Fields describing a chain fork origin. */\nexport interface ChainForkFields {\n /** Block Number at which the chain was forked from */\n forkedAtLastBlockNumber?: string\n /** Hash in the last block the chain was forked from */\n forkedAtLastHash?: string\n /** Address of the forked chain */\n forkedChainId?: Address\n}\n\n/** Core fields describing an XYO network. */\nexport interface NetworkFields {\n /** Description of the network */\n description: string\n /** URL for accessing the network explorer */\n explorerUrl?: string\n /** string representation of the icon (SVG) */\n icon?: string\n /** Machine-readable identifier */\n id: NetworkId\n schema: NetworkBootstrapSchema\n /** Symbol of the network */\n symbol?: string\n}\n\n/** Optional Properties can be found walking the chain to the genesis block */\nexport interface NetworkBootstrapFields extends NetworkFields, ChainForkFields, ChainConnection {}\n\n/** A network bootstrap extended with a flag indicating whether it is a custom network. */\nexport interface Network extends NetworkBootstrap {\n custom: boolean\n}\n\n/** Payload type containing all network bootstrap configuration fields. */\nexport type NetworkBootstrap = Payload<NetworkBootstrapFields, NetworkBootstrapSchema>\n\n/** Type guard that checks whether a payload is a NetworkBootstrap. */\nexport const isNetworkBootstrap = isPayloadOfSchemaType<NetworkBootstrap>(NetworkBootstrapSchema)\n\n/** Optionally casts a value to a Network if it is a valid NetworkBootstrap. */\nexport const asOptionalNetwork = AsObjectFactory.createOptional(isNetworkBootstrap)\n", "import type { GatewayName } from '@xyo-network/xl1-protocol-lib'\n\nimport {\n LocalNetwork, MainNetwork, SequenceNetwork,\n} from './Networks.ts'\n\n/** Map of network IDs to their corresponding Data Lake API URLs. */\nexport const NetworkDataLakeUrls = {\n [MainNetwork.id]: 'https://api.archivist.xyo.network/dataLake',\n [SequenceNetwork.id]: 'https://beta.api.archivist.xyo.network/dataLake',\n [LocalNetwork.id]: 'http://localhost:8080/dataLake',\n} as const satisfies Record<GatewayName, string>\n", "import type { AttachableNodeInstance, WalletInstance } from '@xyo-network/sdk-js'\nimport { ManifestWrapper, ModuleFactoryLocator } from '@xyo-network/sdk-js'\n\nimport { NetworkNodeManifest } from '../../manifest/index.ts'\n\n/**\n * Creates a network node from the network manifest using the provided wallet.\n *\n * @deprecated Bootstrapping an XYO `NodeInstance` via manifest is no longer supported.\n * Use `connectArchivist` from `@xyo-network/xl1-protocol-sdk` for co-located archivist\n * access, or `GatewayBuilder` from `@xyo-network/xl1-gateway` for remote RPC access.\n */\nexport async function getNetworkNode(wallet: WalletInstance): Promise<AttachableNodeInstance> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated shim using deprecated manifest\n const wrapper = new ManifestWrapper(NetworkNodeManifest, wallet, new ModuleFactoryLocator())\n const [node] = await wrapper.loadNodes()\n return node\n}\n", "{\n \"$schema\": \"https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json\",\n \"nodes\": [\n {\n \"config\": {\n \"accountPath\": \"44'/60'/1\",\n \"name\": \"Network\",\n \"schema\": \"network.xyo.node.config\"\n },\n \"modules\": {\n \"private\": [],\n \"public\": []\n }\n }\n ],\n \"schema\": \"network.xyo.manifest\"\n}", "import type { PackageManifestPayload } from '@xyo-network/sdk-js'\n\nimport node from './network.json' with { type: 'json' }\n\n/** @deprecated XYO Node manifest bootstrap is no longer used; wire providers via archivist bindings or JsonRpc instead. */\nexport const NetworkNodeManifest = node as unknown as PackageManifestPayload\n", "import type { AttachableNodeInstance } from '@xyo-network/sdk-js'\n\nconst networkNodeMap = new Map<string, AttachableNodeInstance>()\n\n/** @deprecated Internal cache for deprecated `initNetworkNode`; do not use. */\nexport const getNetworkNodes = () => {\n return networkNodeMap\n}\n", "import type { AttachableNodeInstance, WalletInstance } from '@xyo-network/sdk-js'\n\nimport type { NetworkBootstrap } from '../../models/index.ts'\nimport { getNetworkNode } from './getNetworkNode.ts'\nimport { getNetworkNodes } from './getNetworkNodes.ts'\n\n/** @deprecated Use `connectArchivist` archivist bindings (`@xyo-network/xl1-protocol-sdk`) or `GatewayBuilder` (`@xyo-network/xl1-gateway`) instead of bootstrapping an XYO NodeInstance. */\nexport const initNetworkNode = async (activeNetwork: NetworkBootstrap, wallet: WalletInstance): Promise<AttachableNodeInstance> => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated shim calling deprecated shim\n const networkNodeMap = getNetworkNodes()\n if (networkNodeMap.has(activeNetwork.url)) return networkNodeMap.get(activeNetwork.url)!\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- deprecated shim calling deprecated shim\n const activeNetworkNode = await getNetworkNode(wallet)\n networkNodeMap.set(activeNetwork.url, activeNetworkNode)\n\n return activeNetworkNode\n}\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport { ChainIdZod, XL1BlockNumberZod } from '@xyo-network/xl1-protocol-lib'\nimport { z } from 'zod'\n\n/** Schema id for the chain-contract manifest document. */\nexport const ChainContractManifestSchema = 'network.xyo.s3.chain.contract' as const\n/** Type literal for the chain-contract manifest schema. */\nexport type ChainContractManifestSchema = typeof ChainContractManifestSchema\n\n/** Bumped when the manifest shape changes, so readers can detect a mismatch. */\nexport const CHAIN_CONTRACT_MANIFEST_VERSION = 1\n\n/**\n * Zod schema for the static per-chain config at `chainContractPath()`: the reward contract,\n * staking token, minimum withdrawal window, and (optional) fork lineage. Published once \u2014\n * this data doesn't change per block, unlike `chain/head.json`.\n */\nexport const ChainContractManifestZod = z.object({\n forkedAtBlockNumber: XL1BlockNumberZod.nullable().optional(),\n forkedAtHash: z.string().nullable().optional(),\n forkedChainId: z.nullable(ChainIdZod).optional(),\n minWithdrawalBlocks: z.int().nonnegative(),\n rewardsContract: z.string(),\n schema: z.literal(ChainContractManifestSchema),\n stakingTokenAddress: z.string(),\n version: z.int().positive(),\n})\n\n/** The static per-chain contract config at `chainContractPath()`. */\nexport type ChainContractManifest = z.infer<typeof ChainContractManifestZod>\n\n/** Type guard that checks if a value is a valid ChainContractManifest. */\nexport const isChainContractManifest = zodIsFactory(ChainContractManifestZod)\n/** Converts a value to ChainContractManifest, throwing if invalid. */\nexport const asChainContractManifest = zodAsFactory(ChainContractManifestZod, 'asChainContractManifest')\n/** Non-validating cast to ChainContractManifest. */\nexport const toChainContractManifest = zodToFactory(ChainContractManifestZod, 'toChainContractManifest')\n\n/** Builds a validated chain-contract manifest. */\nexport function createChainContractManifest(\n config: Omit<ChainContractManifest, 'schema' | 'version'>,\n): ChainContractManifest {\n return asChainContractManifest({\n ...config,\n schema: ChainContractManifestSchema,\n version: CHAIN_CONTRACT_MANIFEST_VERSION,\n }, true)\n}\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport { z } from 'zod'\n\nimport { chainManifestPathTemplates } from '../templates.ts'\n\n/** Bumped when the finalized layout changes shape, so readers can detect a mismatch. */\nexport const CHAIN_LAYOUT_VERSION = 1\n\n/** Schema id for the finalized layout manifest document. */\nexport const ChainManifestSchema = 'network.xyo.s3.chain.manifest' as const\n/** Type literal for the chain manifest schema. */\nexport type ChainManifestSchema = typeof ChainManifestSchema\n\n/** Path templates for the finalized + chain-state files. */\nexport const ChainManifestPathsZod = z.object({\n blockByHash: z.string(),\n blockByNumber: z.string(),\n head: z.string(),\n payload: z.string(),\n})\n\n/** Type for chain manifest path templates. */\nexport type ChainManifestPaths = z.infer<typeof ChainManifestPathsZod>\n\n/** Zod schema for the finalized layout descriptor at `manifestPath()`. */\nexport const ChainManifestZod = z.object({\n /** Lowest block number available in the bucket (genesis until pruning exists). */\n earliestBlock: z.int().nonnegative(),\n /** Storage/wire encoding of the published files (also on each object's Content-Encoding). */\n encoding: z.string(),\n paths: ChainManifestPathsZod,\n schema: z.literal(ChainManifestSchema),\n version: z.int().positive(),\n})\n\n/** The finalized layout descriptor at `manifestPath()`. */\nexport type ChainManifest = z.infer<typeof ChainManifestZod>\n\n/** Type guard that checks if a value is a valid ChainManifest. */\nexport const isChainManifest = zodIsFactory(ChainManifestZod)\n/** Converts a value to ChainManifest, throwing if invalid. */\nexport const asChainManifest = zodAsFactory(ChainManifestZod, 'asChainManifest')\n/** Non-validating cast to ChainManifest. */\nexport const toChainManifest = zodToFactory(ChainManifestZod, 'toChainManifest')\n\n/** Builds a validated chain manifest with path templates derived from the path builders. */\nexport function createChainManifest(encoding: string, earliestBlock = 0): ChainManifest {\n return asChainManifest({\n earliestBlock,\n encoding,\n paths: chainManifestPathTemplates(),\n schema: ChainManifestSchema,\n version: CHAIN_LAYOUT_VERSION,\n }, true)\n}\n", "/**\n * Path builders for the chain-state (mutable) bucket.\n *\n * Paths are relative \u2014 no leading slash \u2014 and joined to a base URL by the consumer.\n */\n\n/** The mutable head pointer: the current head SignedHydratedBlockWithHashMeta. */\nexport const headPath = (): string => 'chain/head.json'\n\n/** The chain-contract manifest: static per-chain config (rewards contract, staking token, fork info). Published once. */\nexport const chainContractPath = (): string => 'chain/contract.json'\n", "/**\n * Path builders for the finalized (immutable) bucket.\n *\n * Paths are relative \u2014 no leading slash \u2014 and joined to a base URL by the consumer.\n */\n\n/** The finalized layout descriptor (path templates, encoding, version, earliest block). */\nexport const manifestPath = (): string => 'manifest.json'\n\n/** A block by number: SignedHydratedBlockWithHashMeta. */\nexport const blockNumberPath = (block: number): string => `block/number/${block}.json`\n\n/** A block by hash: the same content as its by-number twin. */\nexport const blockHashPath = (hash: string): string => `block/hash/${hash}.json`\n\n/** A payload by hash: WithHashMeta<Payload>. */\nexport const payloadPath = (hash: string): string => `payload/${hash}.json`\n", "import type { IndexSummaryFamily } from '@xyo-network/xl1-protocol-lib'\n\n/**\n * Path builders for the index bucket.\n *\n * The index is a separate, single-writer bucket holding completed step summaries for several\n * families. Paths are relative \u2014 no leading slash \u2014 and joined to a base URL by the consumer.\n */\n\n/** A completed frame's summary for a family, e.g. `blocks/2/5.json`. Immutable once written. */\nexport const indexSummaryPath = (family: IndexSummaryFamily, stepLevel: number, stepIndex: number): string =>\n `${family}/${stepLevel}/${stepIndex}.json`\n\n/** The index layout descriptor (families, max step, encoding, version). */\nexport const indexManifestPath = (): string => 'manifest.json'\n\n/** The indexer's progress watermark (highest block the index is complete through). */\nexport const indexHeadPath = (): string => 'head.json'\n", "import type { IndexSummaryFamily } from '@xyo-network/xl1-protocol-lib'\n\nimport { headPath } from './paths/chainState.ts'\nimport {\n blockHashPath, blockNumberPath, payloadPath,\n} from './paths/finalized.ts'\nimport { indexSummaryPath } from './paths/indexPaths.ts'\n\n/** Sentinel values used when deriving self-describing path templates from concrete builders. */\nconst TEMPLATE_SLOTS = {\n block: 0,\n hash: '0'.repeat(64),\n index: 99,\n level: 42,\n} as const\n\n/**\n * Replaces concrete slot literals in a path with named `{placeholder}` segments.\n * Used to derive manifest path templates from the path builders so the two cannot drift.\n */\nexport function toPathTemplate(path: string, slots: { literal: string; name: string }[]): string {\n let result = path\n for (const { literal, name } of slots) {\n if (!result.includes(literal)) {\n throw new Error(`Template slot \"${literal}\" not found in path \"${path}\"`)\n }\n result = result.split(literal).join(`{${name}}`)\n }\n return result\n}\n\n/** Fills `{placeholder}` segments in a manifest path template. Used in conformance tests. */\nexport function interpolatePathTemplate(template: string, values: Record<string, string | number>): string {\n let result = template\n for (const [key, value] of Object.entries(values)) {\n result = result.split(`{${key}}`).join(String(value))\n }\n return result\n}\n\n/** Self-describing template for `blockNumberPath`. */\nexport const blockNumberPathTemplate = (): string =>\n toPathTemplate(blockNumberPath(TEMPLATE_SLOTS.block), [{ literal: String(TEMPLATE_SLOTS.block), name: 'block' }])\n\n/** Self-describing template for `blockHashPath`. */\nexport const blockHashPathTemplate = (): string =>\n toPathTemplate(blockHashPath(TEMPLATE_SLOTS.hash), [{ literal: TEMPLATE_SLOTS.hash, name: 'hash' }])\n\n/** Self-describing template for `payloadPath`. */\nexport const payloadPathTemplate = (): string =>\n toPathTemplate(payloadPath(TEMPLATE_SLOTS.hash), [{ literal: TEMPLATE_SLOTS.hash, name: 'hash' }])\n\n/** Self-describing templates for finalized + chain-state files carried in the chain manifest. */\nexport function chainManifestPathTemplates(): {\n blockByHash: string\n blockByNumber: string\n head: string\n payload: string\n} {\n return {\n blockByHash: blockHashPathTemplate(),\n blockByNumber: blockNumberPathTemplate(),\n head: headPath(),\n payload: payloadPathTemplate(),\n }\n}\n\n/** Self-describing template for one index summary family, e.g. `blocks/{level}/{index}.json`. */\nexport function indexSummaryPathTemplate(family: IndexSummaryFamily): string {\n const path = indexSummaryPath(family, TEMPLATE_SLOTS.level, TEMPLATE_SLOTS.index)\n return toPathTemplate(path, [\n { literal: String(TEMPLATE_SLOTS.level), name: 'level' },\n { literal: String(TEMPLATE_SLOTS.index), name: 'index' },\n ])\n}\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport type { IndexSummaryFamily, IndexWatermark } from '@xyo-network/xl1-protocol-lib'\nimport { z } from 'zod'\n\nimport { indexSummaryPathTemplate } from '../templates.ts'\n\n/** Bumped when the on-disk index layout changes shape, so readers can detect a mismatch. */\nexport const INDEX_LAYOUT_VERSION = 1\n\n/** Schema id for the index manifest document (the static layout descriptor). */\nexport const IndexManifestSchema = 'network.xyo.s3.index.manifest' as const\n/** Type literal for the index manifest schema. */\nexport type IndexManifestSchema = typeof IndexManifestSchema\n\n/** Schema id for the index head document (the progress watermark). */\nexport const IndexHeadSchema = 'network.xyo.s3.index.head' as const\n/** Type literal for the index head schema. */\nexport type IndexHeadSchema = typeof IndexHeadSchema\n\n/** Per-family descriptor carried in the manifest. */\nexport const IndexManifestFamilyZod = z.object({\n /** Highest step level published for this family. */\n maxStep: z.int().nonnegative(),\n /** Path template for the family's frames, e.g. `blocks/{level}/{index}.json`. */\n path: z.string(),\n})\n\n/** Type for one index manifest family descriptor. */\nexport type IndexManifestFamily = z.infer<typeof IndexManifestFamilyZod>\n\nconst indexFamiliesZod = z.object({\n balances: IndexManifestFamilyZod,\n blocks: IndexManifestFamilyZod,\n schemas: IndexManifestFamilyZod,\n transfers: IndexManifestFamilyZod,\n})\n\n/** Zod schema for the static index layout descriptor at `indexManifestPath()`. */\nexport const IndexManifestZod = z.object({\n families: indexFamiliesZod,\n schema: z.literal(IndexManifestSchema),\n version: z.int().positive(),\n})\n\n/** The static index layout descriptor at `indexManifestPath()`. */\nexport type IndexManifest = z.infer<typeof IndexManifestZod>\n\n/** Type guard that checks if a value is a valid IndexManifest. */\nexport const isIndexManifest = zodIsFactory(IndexManifestZod)\n/** Converts a value to IndexManifest, throwing if invalid. */\nexport const asIndexManifest = zodAsFactory(IndexManifestZod, 'asIndexManifest')\n/** Non-validating cast to IndexManifest. */\nexport const toIndexManifest = zodToFactory(IndexManifestZod, 'toIndexManifest')\n\n/** Completed frame counts per family in the index head watermark. */\nexport const IndexHeadFamiliesZod = z.object({\n balances: z.int().nonnegative(),\n blocks: z.int().nonnegative(),\n schemas: z.int().nonnegative(),\n transfers: z.int().nonnegative(),\n})\n\n/** Zod schema for the index progress watermark at `indexHeadPath()`. */\nexport const IndexHeadZod = z.object({\n /** Highest block the index is complete through. */\n block: z.int().nonnegative(),\n /** Completed frame counts per family. */\n families: IndexHeadFamiliesZod,\n /** Hash of that block. */\n hash: z.string(),\n schema: z.literal(IndexHeadSchema),\n /** ISO-8601 timestamp of the last update. */\n updatedAt: z.string(),\n version: z.int().positive(),\n})\n\n/** The index progress watermark at `indexHeadPath()`. */\nexport type IndexHead = z.infer<typeof IndexHeadZod>\n\n/** Type guard that checks if a value is a valid IndexHead. */\nexport const isIndexHead = zodIsFactory(IndexHeadZod)\n/** Converts a value to IndexHead, throwing if invalid. */\nexport const asIndexHead = zodAsFactory(IndexHeadZod, 'asIndexHead')\n/** Non-validating cast to IndexHead. */\nexport const toIndexHead = zodToFactory(IndexHeadZod, 'toIndexHead')\n\n/** Builds per-family manifest descriptors with path templates derived from the path builders. */\nexport function createIndexManifestFamilies(\n maxSteps: Record<IndexSummaryFamily, number>,\n): Record<IndexSummaryFamily, IndexManifestFamily> {\n return {\n balances: { maxStep: maxSteps.balances, path: indexSummaryPathTemplate('balances') },\n blocks: { maxStep: maxSteps.blocks, path: indexSummaryPathTemplate('blocks') },\n schemas: { maxStep: maxSteps.schemas, path: indexSummaryPathTemplate('schemas') },\n transfers: { maxStep: maxSteps.transfers, path: indexSummaryPathTemplate('transfers') },\n }\n}\n\n/** Builds a validated index manifest with path templates derived from the path builders. */\nexport function createIndexManifest(maxSteps: Record<IndexSummaryFamily, number>): IndexManifest {\n return asIndexManifest({\n families: createIndexManifestFamilies(maxSteps),\n schema: IndexManifestSchema,\n version: INDEX_LAYOUT_VERSION,\n }, true)\n}\n\n/** Builds a validated index head watermark from an indexer progress snapshot. */\nexport function createIndexHead(watermark: IndexWatermark, updatedAt?: string): IndexHead {\n const now = new Date()\n const resolvedUpdatedAt = updatedAt ?? now.toISOString()\n return asIndexHead({\n block: watermark.block,\n families: watermark.families,\n hash: watermark.hash,\n schema: IndexHeadSchema,\n updatedAt: resolvedUpdatedAt,\n version: INDEX_LAYOUT_VERSION,\n }, true)\n}\n", "import type { NetworkId } from '../models/index.ts'\n\n/** Builds URLs to pages on an XL1 chain explorer for a specific network. */\nexport class ExplorerLinks {\n readonly explorerUrl: string\n readonly networkId: NetworkId\n\n constructor(explorerUrl: string, networkId: NetworkId) {\n this.explorerUrl = explorerUrl.replace(/\\/+$/, '')\n this.networkId = networkId\n }\n\n /** `{explorerUrl}/xl1/{networkId}/address/{address}` */\n address(address: string): string {\n return `${this.network()}/address/${address}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/addresses` */\n addresses(): string {\n return `${this.network()}/addresses`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/block/{blockHash}` */\n block(blockHash: string): string {\n return `${this.network()}/block/${blockHash}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/block/number/{blockNumber}` */\n blockByNumber(blockNumber: number | string): string {\n return `${this.network()}/block/number/${blockNumber}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/block/{blockHash}/payload/{payloadHash}[/{render}]` */\n blockPayload(blockHash: string, payloadHash: string, render?: string): string {\n const base = `${this.network()}/block/${blockHash}/payload/${payloadHash}`\n return render === undefined ? base : `${base}/${render}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/blocks` */\n blocks(): string {\n return `${this.network()}/blocks`\n }\n\n /** `{explorerUrl}/xl1/{networkId}` */\n network(): string {\n return `${this.explorerUrl}/xl1/${this.networkId}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/transaction/{txHash}` */\n transaction(txHash: string): string {\n return `${this.network()}/transaction/${txHash}`\n }\n\n /** `{explorerUrl}/xl1/{networkId}/transaction/{txHash}/payload/{payloadHash}[/{render}]` */\n transactionPayload(txHash: string, payloadHash: string, render?: string): string {\n const base = `${this.network()}/transaction/${txHash}/payload/${payloadHash}`\n return render === undefined ? base : `${base}/${render}`\n }\n\n /**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", "zodToFactory", "z", "z", "zodIsFactory", "zodAsFactory", "zodToFactory", "zodAsFactory", "zodIsFactory", "zodToFactory", "z", "z", "zodIsFactory", "zodAsFactory", "zodToFactory"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Address } from '@
|
|
1
|
+
import type { Address } from '@ariestools/sdk';
|
|
2
2
|
import type { Payload } from '@xyo-network/sdk-js';
|
|
3
3
|
import type { ChainId } from '@xyo-network/xl1-protocol-lib';
|
|
4
4
|
import type { NetworkId } from './NetworkId.ts';
|
|
@@ -52,5 +52,5 @@ export type NetworkBootstrap = Payload<NetworkBootstrapFields, NetworkBootstrapS
|
|
|
52
52
|
/** Type guard that checks whether a payload is a NetworkBootstrap. */
|
|
53
53
|
export declare const isNetworkBootstrap: (x?: unknown) => x is NetworkBootstrap;
|
|
54
54
|
/** Optionally casts a value to a Network if it is a valid NetworkBootstrap. */
|
|
55
|
-
export declare const asOptionalNetwork: (value: import("@
|
|
55
|
+
export declare const asOptionalNetwork: (value: import("@ariestools/sdk").AnyNonPromise) => NetworkBootstrap | undefined;
|
|
56
56
|
//# sourceMappingURL=Bootstrap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bootstrap.d.ts","sourceRoot":"","sources":["../../../src/models/Bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Bootstrap.d.ts","sourceRoot":"","sources":["../../../src/models/Bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,yDAAyD;AACzD,MAAM,WAAW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 'zod';
|
|
2
|
+
/** Schema id for the chain-contract manifest document. */
|
|
3
|
+
export declare const ChainContractManifestSchema: "network.xyo.s3.chain.contract";
|
|
4
|
+
/** Type literal for the chain-contract manifest schema. */
|
|
5
|
+
export type ChainContractManifestSchema = typeof ChainContractManifestSchema;
|
|
6
|
+
/** Bumped when the manifest shape changes, so readers can detect a mismatch. */
|
|
7
|
+
export declare const CHAIN_CONTRACT_MANIFEST_VERSION = 1;
|
|
8
|
+
/**
|
|
9
|
+
* Zod schema for the static per-chain config at `chainContractPath()`: the reward contract,
|
|
10
|
+
* staking token, minimum withdrawal window, and (optional) fork lineage. Published once —
|
|
11
|
+
* this data doesn't change per block, unlike `chain/head.json`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ChainContractManifestZod: z.ZodObject<{
|
|
14
|
+
forkedAtBlockNumber: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodInt, z.ZodTransform<import("@xyo-network/xl1-protocol-lib").XL1BlockNumber, number>>>>;
|
|
15
|
+
forkedAtHash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
forkedChainId: z.ZodOptional<z.ZodNullable<import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniTransform<import("@ariestools/sdk").BrandedHex, string>>>>;
|
|
17
|
+
minWithdrawalBlocks: z.ZodInt;
|
|
18
|
+
rewardsContract: z.ZodString;
|
|
19
|
+
schema: z.ZodLiteral<"network.xyo.s3.chain.contract">;
|
|
20
|
+
stakingTokenAddress: z.ZodString;
|
|
21
|
+
version: z.ZodInt;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
/** The static per-chain contract config at `chainContractPath()`. */
|
|
24
|
+
export type ChainContractManifest = z.infer<typeof ChainContractManifestZod>;
|
|
25
|
+
/** Type guard that checks if a value is a valid ChainContractManifest. */
|
|
26
|
+
export declare const isChainContractManifest: <T>(value: T) => value is T & {
|
|
27
|
+
minWithdrawalBlocks: number;
|
|
28
|
+
rewardsContract: string;
|
|
29
|
+
schema: "network.xyo.s3.chain.contract";
|
|
30
|
+
stakingTokenAddress: string;
|
|
31
|
+
version: number;
|
|
32
|
+
forkedAtBlockNumber?: import("@xyo-network/xl1-protocol-lib").XL1BlockNumber | null | undefined;
|
|
33
|
+
forkedAtHash?: string | null | undefined;
|
|
34
|
+
forkedChainId?: import("@ariestools/sdk").BrandedHex | null | undefined;
|
|
35
|
+
};
|
|
36
|
+
/** Converts a value to ChainContractManifest, throwing if invalid. */
|
|
37
|
+
export declare const asChainContractManifest: {
|
|
38
|
+
<T>(value: T): (T & {
|
|
39
|
+
minWithdrawalBlocks: number;
|
|
40
|
+
rewardsContract: string;
|
|
41
|
+
schema: "network.xyo.s3.chain.contract";
|
|
42
|
+
stakingTokenAddress: string;
|
|
43
|
+
version: number;
|
|
44
|
+
forkedAtBlockNumber?: import("@xyo-network/xl1-protocol-lib").XL1BlockNumber | null | undefined;
|
|
45
|
+
forkedAtHash?: string | null | undefined;
|
|
46
|
+
forkedChainId?: import("@ariestools/sdk").BrandedHex | null | undefined;
|
|
47
|
+
}) | undefined;
|
|
48
|
+
<T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
|
|
49
|
+
minWithdrawalBlocks: number;
|
|
50
|
+
rewardsContract: string;
|
|
51
|
+
schema: "network.xyo.s3.chain.contract";
|
|
52
|
+
stakingTokenAddress: string;
|
|
53
|
+
version: number;
|
|
54
|
+
forkedAtBlockNumber?: import("@xyo-network/xl1-protocol-lib").XL1BlockNumber | null | undefined;
|
|
55
|
+
forkedAtHash?: string | null | undefined;
|
|
56
|
+
forkedChainId?: import("@ariestools/sdk").BrandedHex | null | undefined;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/** Non-validating cast to ChainContractManifest. */
|
|
60
|
+
export declare const toChainContractManifest: {
|
|
61
|
+
<T>(value: T): (T & {
|
|
62
|
+
minWithdrawalBlocks: number;
|
|
63
|
+
rewardsContract: string;
|
|
64
|
+
schema: "network.xyo.s3.chain.contract";
|
|
65
|
+
stakingTokenAddress: string;
|
|
66
|
+
version: number;
|
|
67
|
+
forkedAtBlockNumber?: import("@xyo-network/xl1-protocol-lib").XL1BlockNumber | null | undefined;
|
|
68
|
+
forkedAtHash?: string | null | undefined;
|
|
69
|
+
forkedChainId?: import("@ariestools/sdk").BrandedHex | null | undefined;
|
|
70
|
+
}) | undefined;
|
|
71
|
+
<T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
|
|
72
|
+
minWithdrawalBlocks: number;
|
|
73
|
+
rewardsContract: string;
|
|
74
|
+
schema: "network.xyo.s3.chain.contract";
|
|
75
|
+
stakingTokenAddress: string;
|
|
76
|
+
version: number;
|
|
77
|
+
forkedAtBlockNumber?: import("@xyo-network/xl1-protocol-lib").XL1BlockNumber | null | undefined;
|
|
78
|
+
forkedAtHash?: string | null | undefined;
|
|
79
|
+
forkedChainId?: import("@ariestools/sdk").BrandedHex | null | undefined;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
/** Builds a validated chain-contract manifest. */
|
|
83
|
+
export declare function createChainContractManifest(config: Omit<ChainContractManifest, 'schema' | 'version'>): ChainContractManifest;
|
|
84
|
+
//# sourceMappingURL=chainContractManifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chainContractManifest.d.ts","sourceRoot":"","sources":["../../../../src/staticRest/layout/chainContractManifest.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B,EAAG,+BAAwC,CAAA;AACnF,2DAA2D;AAC3D,MAAM,MAAM,2BAA2B,GAAG,OAAO,2BAA2B,CAAA;AAE5E,gFAAgF;AAChF,eAAO,MAAM,+BAA+B,IAAI,CAAA;AAEhD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;iBASnC,CAAA;AAEF,qEAAqE;AACrE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE5E,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB;;;;;;;;;CAAyC,CAAA;AAC7E,sEAAsE;AACtE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;CAAoE,CAAA;AACxG,oDAAoD;AACpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;CAAoE,CAAA;AAExG,kDAAkD;AAClD,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,QAAQ,GAAG,SAAS,CAAC,GACxD,qBAAqB,CAMvB"}
|
|
@@ -56,7 +56,7 @@ export declare const asChainManifest: {
|
|
|
56
56
|
schema: "network.xyo.s3.chain.manifest";
|
|
57
57
|
version: number;
|
|
58
58
|
}) | undefined;
|
|
59
|
-
<T>(value: T, assert: import("@
|
|
59
|
+
<T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
|
|
60
60
|
earliestBlock: number;
|
|
61
61
|
encoding: string;
|
|
62
62
|
paths: {
|
|
@@ -83,7 +83,7 @@ export declare const toChainManifest: {
|
|
|
83
83
|
schema: "network.xyo.s3.chain.manifest";
|
|
84
84
|
version: number;
|
|
85
85
|
}) | undefined;
|
|
86
|
-
<T>(value: T, assert: import("@
|
|
86
|
+
<T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
|
|
87
87
|
earliestBlock: number;
|
|
88
88
|
encoding: string;
|
|
89
89
|
paths: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/staticRest/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/staticRest/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
|
|
@@ -89,7 +89,7 @@ export declare const asIndexManifest: {
|
|
|
89
89
|
schema: "network.xyo.s3.index.manifest";
|
|
90
90
|
version: number;
|
|
91
91
|
}) | undefined;
|
|
92
|
-
<T>(value: T, assert: import("@
|
|
92
|
+
<T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
|
|
93
93
|
families: {
|
|
94
94
|
balances: {
|
|
95
95
|
maxStep: number;
|
|
@@ -136,7 +136,7 @@ export declare const toIndexManifest: {
|
|
|
136
136
|
schema: "network.xyo.s3.index.manifest";
|
|
137
137
|
version: number;
|
|
138
138
|
}) | undefined;
|
|
139
|
-
<T>(value: T, assert: import("@
|
|
139
|
+
<T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
|
|
140
140
|
families: {
|
|
141
141
|
balances: {
|
|
142
142
|
maxStep: number;
|
|
@@ -211,7 +211,7 @@ export declare const asIndexHead: {
|
|
|
211
211
|
updatedAt: string;
|
|
212
212
|
version: number;
|
|
213
213
|
}) | undefined;
|
|
214
|
-
<T>(value: T, assert: import("@
|
|
214
|
+
<T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
|
|
215
215
|
block: number;
|
|
216
216
|
families: {
|
|
217
217
|
balances: number;
|
|
@@ -240,7 +240,7 @@ export declare const toIndexHead: {
|
|
|
240
240
|
updatedAt: string;
|
|
241
241
|
version: number;
|
|
242
242
|
}) | undefined;
|
|
243
|
-
<T>(value: T, assert: import("@
|
|
243
|
+
<T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
|
|
244
244
|
block: number;
|
|
245
245
|
families: {
|
|
246
246
|
balances: number;
|
|
@@ -5,4 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/** The mutable head pointer: the current head SignedHydratedBlockWithHashMeta. */
|
|
7
7
|
export declare const headPath: () => string;
|
|
8
|
+
/** The chain-contract manifest: static per-chain config (rewards contract, staking token, fork info). Published once. */
|
|
9
|
+
export declare const chainContractPath: () => string;
|
|
8
10
|
//# sourceMappingURL=chainState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainState.d.ts","sourceRoot":"","sources":["../../../../src/staticRest/paths/chainState.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kFAAkF;AAClF,eAAO,MAAM,QAAQ,QAAO,MAA2B,CAAA"}
|
|
1
|
+
{"version":3,"file":"chainState.d.ts","sourceRoot":"","sources":["../../../../src/staticRest/paths/chainState.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kFAAkF;AAClF,eAAO,MAAM,QAAQ,QAAO,MAA2B,CAAA;AAEvD,yHAAyH;AACzH,eAAO,MAAM,iBAAiB,QAAO,MAA+B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/xl1-network-model",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.8",
|
|
4
4
|
"description": "XYO Layer One API",
|
|
5
5
|
"homepage": "https://xylabs.com",
|
|
6
6
|
"bugs": {
|
|
@@ -43,20 +43,21 @@
|
|
|
43
43
|
"README.md"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@xyo-network/xl1-protocol-lib": "~4.0.
|
|
46
|
+
"@xyo-network/xl1-protocol-lib": "~4.0.8"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
+
"@ariestools/sdk": "^7.0.3",
|
|
49
50
|
"@bitauth/libauth": "~3.0.0",
|
|
50
51
|
"@noble/post-quantum": "~0.6.1",
|
|
51
52
|
"@opentelemetry/api": "^1.9.1",
|
|
52
53
|
"@opentelemetry/sdk-trace-base": "^2.8.0",
|
|
53
54
|
"@scure/base": "~2.2.0",
|
|
54
55
|
"@scure/bip39": "~2.2.0",
|
|
55
|
-
"@xylabs/geo": "^7.0.
|
|
56
|
-
"@xylabs/sdk": "^7.0
|
|
57
|
-
"@xylabs/threads": "^7.0.
|
|
58
|
-
"@xylabs/toolchain": "~8.5.
|
|
59
|
-
"@xylabs/tsconfig": "~8.5.
|
|
56
|
+
"@xylabs/geo": "^7.0.3",
|
|
57
|
+
"@xylabs/sdk": "^7.0",
|
|
58
|
+
"@xylabs/threads": "^7.0.3",
|
|
59
|
+
"@xylabs/toolchain": "~8.5.11",
|
|
60
|
+
"@xylabs/tsconfig": "~8.5.11",
|
|
60
61
|
"@xyo-network/sdk-js": "~7.0.4",
|
|
61
62
|
"@xyo-network/sdk-protocol": "~7.0.5",
|
|
62
63
|
"ajv": "^8.20.0",
|
|
@@ -70,11 +71,12 @@
|
|
|
70
71
|
"lru-cache": "^11.5.1",
|
|
71
72
|
"observable-fns": "~0.6.1",
|
|
72
73
|
"typescript": "~6.0.3",
|
|
73
|
-
"vite": "^8.1.
|
|
74
|
+
"vite": "^8.1.2",
|
|
74
75
|
"vitest": "~4.1.9",
|
|
75
76
|
"zod": "~4.4.3"
|
|
76
77
|
},
|
|
77
78
|
"peerDependencies": {
|
|
79
|
+
"@ariestools/sdk": "^7.0",
|
|
78
80
|
"@bitauth/libauth": "~3.0",
|
|
79
81
|
"@noble/post-quantum": "~0.6.1",
|
|
80
82
|
"@opentelemetry/api": "^1.9",
|