@xyo-network/xl1-protocol-sdk 3.0.11 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/Archivists/ArchivistFactory.d.ts +3 -3
- package/dist/neutral/Archivists/ArchivistFactory.d.ts.map +1 -1
- package/dist/neutral/Archivists/MemoryArchivistFactory.d.ts +3 -3
- package/dist/neutral/Archivists/MemoryArchivistFactory.d.ts.map +1 -1
- package/dist/neutral/Archivists/archivistFactoryRegistry.d.ts +3 -3
- package/dist/neutral/Archivists/archivistFactoryRegistry.d.ts.map +1 -1
- package/dist/neutral/CreatableProvider/AbstractCreatableProvider.d.ts +0 -1
- package/dist/neutral/CreatableProvider/AbstractCreatableProvider.d.ts.map +1 -1
- package/dist/neutral/CreatableProvider/CreatableProvider.d.ts +3 -3
- package/dist/neutral/CreatableProvider/CreatableProvider.d.ts.map +1 -1
- package/dist/neutral/capabilities/connectionTypes.d.ts +2 -2
- package/dist/neutral/capabilities/connectionTypes.d.ts.map +1 -1
- package/dist/neutral/capabilities/needsFromProviderBindings.d.ts +2 -2
- package/dist/neutral/capabilities/needsFromProviderBindings.d.ts.map +1 -1
- package/dist/neutral/capabilities/resolveProviders.d.ts +2 -3
- package/dist/neutral/capabilities/resolveProviders.d.ts.map +1 -1
- package/dist/neutral/config/Actor.d.ts +0 -6
- package/dist/neutral/config/Actor.d.ts.map +1 -1
- package/dist/neutral/config/Actors.d.ts +0 -1
- package/dist/neutral/config/Actors.d.ts.map +1 -1
- package/dist/neutral/config/Base.d.ts +0 -1
- package/dist/neutral/config/Base.d.ts.map +1 -1
- package/dist/neutral/config/Config.d.ts +0 -4
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/HostActor.d.ts +0 -6
- package/dist/neutral/config/HostActor.d.ts.map +1 -1
- package/dist/neutral/config/ProviderBinding.d.ts +0 -2
- package/dist/neutral/config/ProviderBinding.d.ts.map +1 -1
- package/dist/neutral/config/{transports/Transport.d.ts → connections/Connection.d.ts} +29 -29
- package/dist/neutral/config/connections/Connection.d.ts.map +1 -0
- package/dist/neutral/config/connections/Mongo.d.ts.map +1 -0
- package/dist/neutral/config/{transports/Rpc.d.ts → connections/RpcRemote.d.ts} +1 -1
- package/dist/neutral/config/connections/RpcRemote.d.ts.map +1 -0
- package/dist/neutral/config/connections/S3.d.ts.map +1 -0
- package/dist/neutral/config/connections/index.d.ts +4 -5
- package/dist/neutral/config/connections/index.d.ts.map +1 -1
- package/dist/neutral/config/index.d.ts +0 -1
- package/dist/neutral/config/index.d.ts.map +1 -1
- package/dist/neutral/config/normalizeConnectionsConfig.d.ts +2 -2
- package/dist/neutral/config/normalizeConnectionsConfig.d.ts.map +1 -1
- package/dist/neutral/context/Actor.d.ts +0 -6
- package/dist/neutral/context/Actor.d.ts.map +1 -1
- package/dist/neutral/context/HostActor.d.ts +0 -6
- package/dist/neutral/context/HostActor.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.d.ts +0 -2
- package/dist/neutral/getFileConfig.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.mjs +37 -42
- package/dist/neutral/getFileConfig.mjs.map +3 -3
- package/dist/neutral/index.mjs +138 -170
- package/dist/neutral/index.mjs.map +4 -4
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts +0 -6
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts.map +1 -1
- package/dist/neutral/test/index.mjs +37 -42
- package/dist/neutral/test/index.mjs.map +3 -3
- package/package.json +6 -6
- package/dist/neutral/config/transports/Mongo.d.ts.map +0 -1
- package/dist/neutral/config/transports/Rpc.d.ts.map +0 -1
- package/dist/neutral/config/transports/S3.d.ts.map +0 -1
- package/dist/neutral/config/transports/Transport.d.ts.map +0 -1
- package/dist/neutral/config/transports/index.d.ts +0 -5
- package/dist/neutral/config/transports/index.d.ts.map +0 -1
- /package/dist/neutral/config/{transports → connections}/Mongo.d.ts +0 -0
- /package/dist/neutral/config/{transports → connections}/S3.d.ts +0 -0
package/dist/neutral/index.mjs
CHANGED
|
@@ -1120,30 +1120,11 @@ function factoryBackingsCompatible(declared, available) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
|
|
1122
1122
|
// src/config/normalizeConnectionsConfig.ts
|
|
1123
|
-
function normalizeProviderBinding(binding) {
|
|
1124
|
-
const connectionName = binding.connection ?? binding.transport;
|
|
1125
|
-
if (connectionName === void 0 || connectionName === "") {
|
|
1126
|
-
return binding;
|
|
1127
|
-
}
|
|
1128
|
-
return {
|
|
1129
|
-
...binding,
|
|
1130
|
-
connection: connectionName,
|
|
1131
|
-
transport: connectionName
|
|
1132
|
-
};
|
|
1133
|
-
}
|
|
1134
|
-
function normalizeProviderBindings(bindings) {
|
|
1135
|
-
const normalized = {};
|
|
1136
|
-
for (const [moniker, binding] of Object.entries(bindings)) {
|
|
1137
|
-
if (binding === void 0) continue;
|
|
1138
|
-
normalized[moniker] = normalizeProviderBinding(binding);
|
|
1139
|
-
}
|
|
1140
|
-
return normalized;
|
|
1141
|
-
}
|
|
1142
1123
|
function normalizeConnectionsConfig(config) {
|
|
1143
1124
|
return {
|
|
1144
1125
|
...config,
|
|
1145
1126
|
connections: config.connections ?? {},
|
|
1146
|
-
providerBindings:
|
|
1127
|
+
providerBindings: config.providerBindings ?? {}
|
|
1147
1128
|
};
|
|
1148
1129
|
}
|
|
1149
1130
|
function hasDeclaredConnectionProfiles(config) {
|
|
@@ -1564,7 +1545,7 @@ function bindMoniker(moniker, wanted, bindings, selectedById, candidatesByMonike
|
|
|
1564
1545
|
}
|
|
1565
1546
|
function connectionNameForMoniker(moniker, options) {
|
|
1566
1547
|
const binding = options.providerBindings?.[moniker];
|
|
1567
|
-
const connectionName = binding?.connection
|
|
1548
|
+
const connectionName = binding?.connection;
|
|
1568
1549
|
if (!isDefined4(connectionName) || connectionName === "") {
|
|
1569
1550
|
throw new UnboundProviderError(moniker);
|
|
1570
1551
|
}
|
|
@@ -1674,7 +1655,7 @@ function needsFromConnectionTypes(config, connectionTypes) {
|
|
|
1674
1655
|
const allowed = new Set(connectionTypes);
|
|
1675
1656
|
const needs = /* @__PURE__ */ new Set();
|
|
1676
1657
|
for (const [moniker, binding] of Object.entries(config.providerBindings)) {
|
|
1677
|
-
const connectionName = binding?.connection
|
|
1658
|
+
const connectionName = binding?.connection;
|
|
1678
1659
|
if (connectionName === void 0 || connectionName === "") {
|
|
1679
1660
|
continue;
|
|
1680
1661
|
}
|
|
@@ -1707,10 +1688,10 @@ import {
|
|
|
1707
1688
|
zodIsFactory as zodIsFactory2,
|
|
1708
1689
|
zodToFactory as zodToFactory2
|
|
1709
1690
|
} from "@xylabs/sdk-js";
|
|
1710
|
-
import { globalRegistry as
|
|
1691
|
+
import { globalRegistry as globalRegistry9, z as z14 } from "zod/mini";
|
|
1711
1692
|
|
|
1712
1693
|
// src/config/Base.ts
|
|
1713
|
-
import { z as
|
|
1694
|
+
import { z as z13 } from "zod/mini";
|
|
1714
1695
|
|
|
1715
1696
|
// src/config/Chain.ts
|
|
1716
1697
|
import { HexZod } from "@xylabs/sdk-js";
|
|
@@ -1729,10 +1710,10 @@ var ChainConfigZod = z2.object({
|
|
|
1729
1710
|
})
|
|
1730
1711
|
});
|
|
1731
1712
|
|
|
1732
|
-
// src/config/
|
|
1713
|
+
// src/config/connections/Connection.ts
|
|
1733
1714
|
import { globalRegistry as globalRegistry3, z as z5 } from "zod";
|
|
1734
1715
|
|
|
1735
|
-
// src/config/
|
|
1716
|
+
// src/config/connections/Mongo.ts
|
|
1736
1717
|
import { globalRegistry as globalRegistry2, z as z3 } from "zod";
|
|
1737
1718
|
var MongoConfigZod = z3.object({
|
|
1738
1719
|
// TODO: Create from other arguments
|
|
@@ -1763,7 +1744,7 @@ var MongoConfigZod = z3.object({
|
|
|
1763
1744
|
})
|
|
1764
1745
|
});
|
|
1765
1746
|
|
|
1766
|
-
// src/config/
|
|
1747
|
+
// src/config/connections/S3.ts
|
|
1767
1748
|
import { z as z4 } from "zod";
|
|
1768
1749
|
var S3BucketConfigZod = z4.object({
|
|
1769
1750
|
accessKeyId: z4.string().nonempty().optional().describe("S3-compatible access key id for this bucket (overrides the shared default)"),
|
|
@@ -1774,108 +1755,142 @@ var S3BucketConfigZod = z4.object({
|
|
|
1774
1755
|
secretAccessKey: z4.string().nonempty().optional().describe("S3-compatible secret access key for this bucket (overrides the shared default)")
|
|
1775
1756
|
});
|
|
1776
1757
|
|
|
1777
|
-
// src/config/
|
|
1778
|
-
var
|
|
1758
|
+
// src/config/connections/Connection.ts
|
|
1759
|
+
var LmdbConnectionConfigZod = z5.object({
|
|
1779
1760
|
access: z5.enum(["read", "write"]).optional().register(globalRegistry3, {
|
|
1780
1761
|
description: "Access mode for this LMDB connection (read or write)",
|
|
1781
|
-
title: "
|
|
1762
|
+
title: "connections.lmdb.access",
|
|
1782
1763
|
type: "string"
|
|
1783
1764
|
}),
|
|
1784
1765
|
root: z5.string().register(globalRegistry3, {
|
|
1785
1766
|
description: "Root directory for local LMDB storage",
|
|
1786
|
-
title: "
|
|
1767
|
+
title: "connections.lmdb.root",
|
|
1787
1768
|
type: "string"
|
|
1788
1769
|
}),
|
|
1789
1770
|
store: z5.string().optional().register(globalRegistry3, {
|
|
1790
1771
|
description: "Logical store name within the LMDB root (e.g. finalized-chain, mempool)",
|
|
1791
|
-
title: "
|
|
1772
|
+
title: "connections.lmdb.store",
|
|
1792
1773
|
type: "string"
|
|
1793
1774
|
}),
|
|
1794
1775
|
type: z5.literal("lmdb")
|
|
1795
|
-
}).describe("LMDB local storage
|
|
1796
|
-
var
|
|
1776
|
+
}).describe("LMDB local storage connection");
|
|
1777
|
+
var MongoConnectionConfigZod = z5.object({
|
|
1797
1778
|
type: z5.literal("mongo"),
|
|
1798
1779
|
connectionString: MongoConfigZod.shape.connectionString,
|
|
1799
1780
|
database: MongoConfigZod.shape.database,
|
|
1800
1781
|
domain: MongoConfigZod.shape.domain,
|
|
1801
1782
|
password: MongoConfigZod.shape.password,
|
|
1802
1783
|
username: MongoConfigZod.shape.username
|
|
1803
|
-
}).describe("MongoDB storage
|
|
1804
|
-
var
|
|
1784
|
+
}).describe("MongoDB storage connection");
|
|
1785
|
+
var RpcConnectionConfigZod = z5.object({
|
|
1805
1786
|
type: z5.literal("rpc"),
|
|
1806
1787
|
protocol: z5.string().default("http").register(globalRegistry3, {
|
|
1807
1788
|
description: "Protocol for the RPC connection (http or postMessage)",
|
|
1808
|
-
title: "
|
|
1789
|
+
title: "connections.rpc.protocol",
|
|
1809
1790
|
type: "string"
|
|
1810
1791
|
}),
|
|
1811
1792
|
url: z5.string().optional().register(globalRegistry3, {
|
|
1812
1793
|
description: "URL for the Chain RPC API (http protocol)",
|
|
1813
|
-
title: "
|
|
1794
|
+
title: "connections.rpc.url",
|
|
1814
1795
|
type: "string"
|
|
1815
1796
|
}),
|
|
1816
1797
|
networkId: z5.string().optional().register(globalRegistry3, {
|
|
1817
1798
|
description: "Network ID for the postMessage RPC connection",
|
|
1818
|
-
title: "
|
|
1799
|
+
title: "connections.rpc.networkId",
|
|
1819
1800
|
type: "string"
|
|
1820
1801
|
}),
|
|
1821
1802
|
sessionId: z5.string().optional().register(globalRegistry3, {
|
|
1822
1803
|
description: "Session ID for the postMessage RPC connection",
|
|
1823
|
-
title: "
|
|
1804
|
+
title: "connections.rpc.sessionId",
|
|
1824
1805
|
type: "string"
|
|
1825
1806
|
})
|
|
1826
|
-
}).describe("XL1 JSON-RPC
|
|
1827
|
-
var
|
|
1807
|
+
}).describe("XL1 JSON-RPC connection");
|
|
1808
|
+
var RestConnectionConfigZod = z5.object({
|
|
1828
1809
|
type: z5.literal("rest"),
|
|
1829
1810
|
baseUrl: z5.string().register(globalRegistry3, {
|
|
1830
1811
|
description: "HTTP base URL for REST reads",
|
|
1831
|
-
title: "
|
|
1812
|
+
title: "connections.rest.baseUrl",
|
|
1832
1813
|
type: "string"
|
|
1833
1814
|
})
|
|
1834
|
-
}).describe("HTTP REST read
|
|
1835
|
-
var
|
|
1815
|
+
}).describe("HTTP REST read connection");
|
|
1816
|
+
var S3ConnectionConfigZod = S3BucketConfigZod.extend({
|
|
1836
1817
|
type: z5.literal("s3"),
|
|
1837
1818
|
accessKeyId: z5.string().optional(),
|
|
1838
1819
|
accountId: z5.string().optional(),
|
|
1839
1820
|
secretAccessKey: z5.string().optional()
|
|
1840
|
-
}).describe("S3-compatible object storage
|
|
1841
|
-
var
|
|
1821
|
+
}).describe("S3-compatible object storage connection");
|
|
1822
|
+
var EvmRpcConnectionConfigZod = z5.object({
|
|
1842
1823
|
type: z5.literal("evm-rpc"),
|
|
1843
1824
|
url: z5.string().register(globalRegistry3, {
|
|
1844
1825
|
description: "EVM JSON-RPC URL",
|
|
1845
|
-
title: "
|
|
1826
|
+
title: "connections.evm-rpc.url",
|
|
1846
1827
|
type: "string"
|
|
1847
1828
|
}),
|
|
1848
1829
|
chainId: z5.string().optional().register(globalRegistry3, {
|
|
1849
1830
|
description: "EVM chain ID for this RPC endpoint; auto-detected from the endpoint when omitted",
|
|
1850
|
-
title: "
|
|
1831
|
+
title: "connections.evm-rpc.chainId",
|
|
1851
1832
|
type: "string"
|
|
1852
1833
|
})
|
|
1853
|
-
}).describe("EVM JSON-RPC
|
|
1854
|
-
var
|
|
1855
|
-
var
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1834
|
+
}).describe("EVM JSON-RPC connection");
|
|
1835
|
+
var MemoryConnectionConfigZod = z5.object({ type: z5.literal("memory") }).describe("In-process memory connection");
|
|
1836
|
+
var ConnectionConfigZod = z5.discriminatedUnion("type", [
|
|
1837
|
+
LmdbConnectionConfigZod,
|
|
1838
|
+
MongoConnectionConfigZod,
|
|
1839
|
+
RpcConnectionConfigZod,
|
|
1840
|
+
RestConnectionConfigZod,
|
|
1841
|
+
S3ConnectionConfigZod,
|
|
1842
|
+
EvmRpcConnectionConfigZod,
|
|
1843
|
+
MemoryConnectionConfigZod
|
|
1863
1844
|
]);
|
|
1864
|
-
var
|
|
1845
|
+
var ConnectionsConfigZod = z5.record(z5.string(), ConnectionConfigZod).default({});
|
|
1846
|
+
|
|
1847
|
+
// src/config/connections/RpcRemote.ts
|
|
1848
|
+
import { globalRegistry as globalRegistry4, z as z6 } from "zod";
|
|
1849
|
+
var RpcRemoteConfigBaseZod = z6.object({
|
|
1850
|
+
protocol: z6.string("http").register(globalRegistry4, {
|
|
1851
|
+
description: "Protocol for the RPC connection",
|
|
1852
|
+
type: "string"
|
|
1853
|
+
})
|
|
1854
|
+
}).describe("Base configuration for the remote RPC");
|
|
1855
|
+
var HttpRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
1856
|
+
protocol: z6.string("http").register(globalRegistry4, {
|
|
1857
|
+
description: "Protocol for the RPC connection",
|
|
1858
|
+
type: "string"
|
|
1859
|
+
}).default("http"),
|
|
1860
|
+
url: z6.string().register(globalRegistry4, {
|
|
1861
|
+
description: "URL for the Chain RPC API",
|
|
1862
|
+
type: "string"
|
|
1863
|
+
})
|
|
1864
|
+
}).describe("Configuration for the remote RPC using Http");
|
|
1865
|
+
var PostMessageRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
1866
|
+
protocol: z6.string().register(globalRegistry4, {
|
|
1867
|
+
description: "Protocol for the RPC connection",
|
|
1868
|
+
type: "string"
|
|
1869
|
+
}).default("postMessage"),
|
|
1870
|
+
networkId: z6.string().register(globalRegistry4, {
|
|
1871
|
+
description: "Network ID to use for the postMessage RPC connection",
|
|
1872
|
+
type: "string"
|
|
1873
|
+
}),
|
|
1874
|
+
sessionId: z6.string().register(globalRegistry4, {
|
|
1875
|
+
description: "Session ID to use for the postMessage RPC connection",
|
|
1876
|
+
type: "string"
|
|
1877
|
+
})
|
|
1878
|
+
}).describe("Configuration for the remote RPC using postMessage");
|
|
1879
|
+
var RpcRemoteConfigZod = z6.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod]).describe("Configuration for a remote RPC connection, either Http or postMessage");
|
|
1865
1880
|
|
|
1866
1881
|
// src/config/Log.ts
|
|
1867
1882
|
import { LogLevel } from "@xylabs/sdk-js";
|
|
1868
|
-
import { globalRegistry as
|
|
1883
|
+
import { globalRegistry as globalRegistry5, z as z7 } from "zod";
|
|
1869
1884
|
var LogLevelNames = Object.keys(LogLevel);
|
|
1870
|
-
var LogConfigZod =
|
|
1871
|
-
logLevel:
|
|
1885
|
+
var LogConfigZod = z7.object({
|
|
1886
|
+
logLevel: z7.enum(LogLevelNames).default("info").register(globalRegistry5, {
|
|
1872
1887
|
choices: LogLevelNames,
|
|
1873
1888
|
default: "info",
|
|
1874
1889
|
description: "Desired process verbosity",
|
|
1875
1890
|
title: "logLevel",
|
|
1876
1891
|
type: "string"
|
|
1877
1892
|
}),
|
|
1878
|
-
silent:
|
|
1893
|
+
silent: z7.boolean().default(false).register(globalRegistry5, {
|
|
1879
1894
|
default: false,
|
|
1880
1895
|
description: "Whether to run in silent mode",
|
|
1881
1896
|
title: "silent",
|
|
@@ -1884,23 +1899,18 @@ var LogConfigZod = z6.object({
|
|
|
1884
1899
|
});
|
|
1885
1900
|
|
|
1886
1901
|
// src/config/ProviderBinding.ts
|
|
1887
|
-
import { globalRegistry as
|
|
1888
|
-
var ProviderBindingConfigZod =
|
|
1889
|
-
connection:
|
|
1902
|
+
import { globalRegistry as globalRegistry6, z as z8 } from "zod";
|
|
1903
|
+
var ProviderBindingConfigZod = z8.object({
|
|
1904
|
+
connection: z8.string().optional().register(globalRegistry6, {
|
|
1890
1905
|
description: "Named connection from the top-level connections map",
|
|
1891
1906
|
title: "providerBindings.connection",
|
|
1892
1907
|
type: "string"
|
|
1893
|
-
}),
|
|
1894
|
-
transport: z7.string().optional().register(globalRegistry5, {
|
|
1895
|
-
description: "Deprecated alias for connection (kept in sync during migration)",
|
|
1896
|
-
title: "providerBindings.transport",
|
|
1897
|
-
type: "string"
|
|
1898
1908
|
})
|
|
1899
1909
|
}).describe("Provider connection binding");
|
|
1900
|
-
var ProviderBindingsConfigZod =
|
|
1910
|
+
var ProviderBindingsConfigZod = z8.record(z8.string(), ProviderBindingConfigZod).default({});
|
|
1901
1911
|
|
|
1902
1912
|
// src/config/Providers.ts
|
|
1903
|
-
import
|
|
1913
|
+
import z10 from "zod";
|
|
1904
1914
|
|
|
1905
1915
|
// src/config/Provider.ts
|
|
1906
1916
|
import {
|
|
@@ -1908,20 +1918,20 @@ import {
|
|
|
1908
1918
|
zodIsFactory,
|
|
1909
1919
|
zodToFactory
|
|
1910
1920
|
} from "@xylabs/sdk-js";
|
|
1911
|
-
import { z as
|
|
1912
|
-
var ProviderConfigZod =
|
|
1913
|
-
moniker:
|
|
1914
|
-
labels:
|
|
1921
|
+
import { z as z9 } from "zod";
|
|
1922
|
+
var ProviderConfigZod = z9.object({
|
|
1923
|
+
moniker: z9.string(),
|
|
1924
|
+
labels: z9.array(z9.string()).optional()
|
|
1915
1925
|
}).describe("Configuration for a Provider");
|
|
1916
1926
|
var isProviderConfig = zodIsFactory(ProviderConfigZod);
|
|
1917
1927
|
var asProviderConfig = zodAsFactory2(ProviderConfigZod, "asProviderConfig");
|
|
1918
1928
|
var toProviderConfig = zodToFactory(ProviderConfigZod, "toProviderConfig");
|
|
1919
1929
|
|
|
1920
1930
|
// src/config/Providers.ts
|
|
1921
|
-
var ProvidersConfigZod =
|
|
1931
|
+
var ProvidersConfigZod = z10.array(ProviderConfigZod.loose()).describe("Configuration for providers").default([]);
|
|
1922
1932
|
|
|
1923
1933
|
// src/config/Telemetry.ts
|
|
1924
|
-
import { globalRegistry as
|
|
1934
|
+
import { globalRegistry as globalRegistry7, z as z11 } from "zod";
|
|
1925
1935
|
var DefaultMetricsScrapePorts = {
|
|
1926
1936
|
api: 9465,
|
|
1927
1937
|
bridge: 9468,
|
|
@@ -1929,29 +1939,29 @@ var DefaultMetricsScrapePorts = {
|
|
|
1929
1939
|
producer: 9464,
|
|
1930
1940
|
rewardRedemptionApi: 9467
|
|
1931
1941
|
};
|
|
1932
|
-
var MetricsScrapeConfigZod =
|
|
1933
|
-
path:
|
|
1942
|
+
var MetricsScrapeConfigZod = z11.object({
|
|
1943
|
+
path: z11.string().default("/metrics").register(globalRegistry7, {
|
|
1934
1944
|
default: "/metrics",
|
|
1935
1945
|
description: "Path for the metrics scrape endpoint",
|
|
1936
1946
|
title: "telemetry.metrics.scrape.path",
|
|
1937
1947
|
type: "string"
|
|
1938
1948
|
}),
|
|
1939
|
-
port:
|
|
1949
|
+
port: z11.coerce.number().int().nonnegative().optional().register(globalRegistry7, {
|
|
1940
1950
|
description: "Port for the metrics scrape endpoint (0 disables the scrape endpoint)",
|
|
1941
1951
|
title: "telemetry.metrics.scrape.port",
|
|
1942
1952
|
type: "number"
|
|
1943
1953
|
})
|
|
1944
1954
|
}).describe("Metrics scrape configuration");
|
|
1945
|
-
var MetricsConfigZod =
|
|
1946
|
-
var OpenTelemetryConfigZod =
|
|
1955
|
+
var MetricsConfigZod = z11.object({ scrape: MetricsScrapeConfigZod }).describe("Metrics configuration options");
|
|
1956
|
+
var OpenTelemetryConfigZod = z11.object({
|
|
1947
1957
|
// OpenTelemetry options
|
|
1948
|
-
otlpEndpoint:
|
|
1958
|
+
otlpEndpoint: z11.url().optional().register(globalRegistry7, {
|
|
1949
1959
|
description: "OTLP endpoint for exporting telemetry data",
|
|
1950
1960
|
title: "telemetry.otel.otlpEndpoint",
|
|
1951
1961
|
type: "string"
|
|
1952
1962
|
})
|
|
1953
1963
|
});
|
|
1954
|
-
var TelemetryConfigZod =
|
|
1964
|
+
var TelemetryConfigZod = z11.object({
|
|
1955
1965
|
// Metrics configuration
|
|
1956
1966
|
metrics: MetricsConfigZod.optional().describe("Metrics configuration"),
|
|
1957
1967
|
// OpenTelemetry configuration
|
|
@@ -1960,7 +1970,7 @@ var TelemetryConfigZod = z10.object({
|
|
|
1960
1970
|
|
|
1961
1971
|
// src/config/Validation.ts
|
|
1962
1972
|
import { XyoAddressZod as XyoAddressZod2 } from "@xyo-network/sdk-js";
|
|
1963
|
-
import { globalRegistry as
|
|
1973
|
+
import { globalRegistry as globalRegistry8, z as z12 } from "zod";
|
|
1964
1974
|
|
|
1965
1975
|
// src/primitives/block/range/blockRangeSteps.ts
|
|
1966
1976
|
import { asXL1BlockNumber as asXL1BlockNumber2, StepSizes as StepSizes3 } from "@xyo-network/xl1-protocol-lib";
|
|
@@ -2878,24 +2888,24 @@ function findUncles(context, finalizedWindowedChain, blocks) {
|
|
|
2878
2888
|
}
|
|
2879
2889
|
|
|
2880
2890
|
// src/config/Validation.ts
|
|
2881
|
-
var ValidationConfigZod =
|
|
2882
|
-
allowedRewardRedeemers:
|
|
2891
|
+
var ValidationConfigZod = z12.object({
|
|
2892
|
+
allowedRewardRedeemers: z12.array(XyoAddressZod2).optional().register(globalRegistry8, {
|
|
2883
2893
|
description: "List of allowed reward redeemer addresses, if undefined anyone can participate",
|
|
2884
2894
|
title: "allowedRewardRedeemers",
|
|
2885
2895
|
type: "array"
|
|
2886
2896
|
}),
|
|
2887
|
-
allowedRewardEscrowAccountSigners:
|
|
2897
|
+
allowedRewardEscrowAccountSigners: z12.array(XyoAddressZod2).optional().register(globalRegistry8, {
|
|
2888
2898
|
description: "List of allowed reward escrow account signer addresses, if undefined anyone can participate",
|
|
2889
2899
|
title: "allowedRewardEscrowAccountSigners",
|
|
2890
2900
|
type: "array"
|
|
2891
2901
|
}),
|
|
2892
|
-
minCandidates:
|
|
2902
|
+
minCandidates: z12.coerce.number().default(DEFAULT_MIN_CANDIDATES).register(globalRegistry8, {
|
|
2893
2903
|
default: DEFAULT_MIN_CANDIDATES,
|
|
2894
2904
|
description: "Minimum number of uncle candidates before selecting the best uncle",
|
|
2895
2905
|
title: "validation.minCandidates",
|
|
2896
2906
|
type: "number"
|
|
2897
2907
|
}),
|
|
2898
|
-
backoffMs:
|
|
2908
|
+
backoffMs: z12.coerce.number().default(DEFAULT_BACKOFF_MS).register(globalRegistry8, {
|
|
2899
2909
|
default: DEFAULT_BACKOFF_MS,
|
|
2900
2910
|
description: "Back-off timeout in ms. If head age exceeds this, minCandidates is ignored",
|
|
2901
2911
|
title: "validation.backoffMs",
|
|
@@ -2904,24 +2914,24 @@ var ValidationConfigZod = z11.object({
|
|
|
2904
2914
|
});
|
|
2905
2915
|
|
|
2906
2916
|
// src/config/Base.ts
|
|
2907
|
-
var BaseConfigZod =
|
|
2908
|
-
chain:
|
|
2909
|
-
log:
|
|
2910
|
-
connections:
|
|
2911
|
-
providerBindings:
|
|
2912
|
-
providers:
|
|
2913
|
-
telemetry:
|
|
2914
|
-
validation:
|
|
2917
|
+
var BaseConfigZod = z13.object({
|
|
2918
|
+
chain: z13._default(ChainConfigZod, ChainConfigZod.parse({})).check(z13.describe("Configuration for the chain")),
|
|
2919
|
+
log: z13._default(LogConfigZod, LogConfigZod.parse({})).check(z13.describe("Configuration for logging")),
|
|
2920
|
+
connections: z13._default(ConnectionsConfigZod, ConnectionsConfigZod.parse({})).check(z13.describe("Named connection profiles (rpc, rest, s3, lmdb, mongo, evm-rpc)")),
|
|
2921
|
+
providerBindings: z13._default(ProviderBindingsConfigZod, ProviderBindingsConfigZod.parse({})).check(z13.describe("Per-moniker provider connection bindings")),
|
|
2922
|
+
providers: z13._default(ProvidersConfigZod, ProvidersConfigZod.parse([])).check(z13.describe("Configuration for providers")),
|
|
2923
|
+
telemetry: z13._default(TelemetryConfigZod, TelemetryConfigZod.parse({})).check(z13.describe("Configuration for telemetry")),
|
|
2924
|
+
validation: z13._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z13.describe("Configuration for validation"))
|
|
2915
2925
|
});
|
|
2916
2926
|
|
|
2917
2927
|
// src/config/Actor.ts
|
|
2918
|
-
var AccountPathZod =
|
|
2928
|
+
var AccountPathZod = z14.string().check(z14.regex(
|
|
2919
2929
|
/^(m(\/\d+'?)+|\d+'?(\/\d+'?)*)$/,
|
|
2920
2930
|
`Invalid BIP-32 derivation path. Use either an absolute path like "m/44'/60'/0'/0/0" or a relative path like "0", "0/1", or "44'/60'/0'/0/0".`
|
|
2921
2931
|
));
|
|
2922
|
-
var ActorConfigZod =
|
|
2923
|
-
name:
|
|
2924
|
-
accountPath:
|
|
2932
|
+
var ActorConfigZod = z14.extend(BaseConfigZod, {
|
|
2933
|
+
name: z14.string(),
|
|
2934
|
+
accountPath: z14.optional(AccountPathZod).register(globalRegistry9, {
|
|
2925
2935
|
description: 'BIP-32 derivation path for the actor wallet. Absolute when it starts with "m/"; otherwise relative to the root wallet base path. Each actor must derive to a distinct path.',
|
|
2926
2936
|
title: "accountPath",
|
|
2927
2937
|
type: "string"
|
|
@@ -2932,22 +2942,22 @@ var asActorConfig = zodAsFactory3(ActorConfigZod, "asActorConfig");
|
|
|
2932
2942
|
var toActorConfig = zodToFactory2(ActorConfigZod, "toActorConfig");
|
|
2933
2943
|
|
|
2934
2944
|
// src/config/Actors.ts
|
|
2935
|
-
import { z as
|
|
2936
|
-
var ActorsConfigZod =
|
|
2937
|
-
|
|
2945
|
+
import { z as z15 } from "zod/mini";
|
|
2946
|
+
var ActorsConfigZod = z15._default(
|
|
2947
|
+
z15.array(z15.looseObject(ActorConfigZod.shape)).check(z15.describe("Actor-specific configurations that override the base configuration when the actor is running")),
|
|
2938
2948
|
[]
|
|
2939
2949
|
);
|
|
2940
2950
|
|
|
2941
2951
|
// src/config/Config.ts
|
|
2942
|
-
import { globalRegistry as
|
|
2943
|
-
var ConfigZod =
|
|
2952
|
+
import { globalRegistry as globalRegistry10, z as z16 } from "zod/mini";
|
|
2953
|
+
var ConfigZod = z16.extend(BaseConfigZod, {
|
|
2944
2954
|
actors: ActorsConfigZod,
|
|
2945
|
-
healthCheckPort:
|
|
2955
|
+
healthCheckPort: z16.optional(z16.coerce.number()).register(globalRegistry10, {
|
|
2946
2956
|
description: "Port for the system-wide health, readiness, and liveness endpoints (/healthz, /livez, /readyz). Set to 0 to disable.",
|
|
2947
2957
|
title: "healthCheckPort",
|
|
2948
2958
|
type: "number"
|
|
2949
2959
|
})
|
|
2950
|
-
}).check(
|
|
2960
|
+
}).check(z16.describe("The complete configuration for the protocol, including global settings and actor-specific overrides"));
|
|
2951
2961
|
function resolveConfig(config) {
|
|
2952
2962
|
const parsedConfig = ConfigZod.parse(config);
|
|
2953
2963
|
const {
|
|
@@ -2956,7 +2966,7 @@ function resolveConfig(config) {
|
|
|
2956
2966
|
...rootConfig
|
|
2957
2967
|
} = parsedConfig;
|
|
2958
2968
|
parsedConfig.actors = actors.map((actorConfig) => {
|
|
2959
|
-
return
|
|
2969
|
+
return z16.looseObject(ActorConfigZod.shape).parse({ ...rootConfig, ...actorConfig });
|
|
2960
2970
|
});
|
|
2961
2971
|
return parsedConfig;
|
|
2962
2972
|
}
|
|
@@ -2967,15 +2977,15 @@ import {
|
|
|
2967
2977
|
zodIsFactory as zodIsFactory3,
|
|
2968
2978
|
zodToFactory as zodToFactory3
|
|
2969
2979
|
} from "@xylabs/sdk-js";
|
|
2970
|
-
import { globalRegistry as
|
|
2971
|
-
var HostActorConfigZod =
|
|
2972
|
-
host:
|
|
2980
|
+
import { globalRegistry as globalRegistry11, z as z17 } from "zod/mini";
|
|
2981
|
+
var HostActorConfigZod = z17.extend(ActorConfigZod, {
|
|
2982
|
+
host: z17._default(z17.string(), "localhost").register(globalRegistry11, {
|
|
2973
2983
|
default: "localhost",
|
|
2974
2984
|
description: "Host for the Actor",
|
|
2975
2985
|
title: "host",
|
|
2976
2986
|
type: "string"
|
|
2977
2987
|
}),
|
|
2978
|
-
port:
|
|
2988
|
+
port: z17._default(z17.coerce.number(), 8080).register(globalRegistry11, {
|
|
2979
2989
|
default: 8080,
|
|
2980
2990
|
description: "Port for the Actor",
|
|
2981
2991
|
title: "port",
|
|
@@ -2996,7 +3006,7 @@ function resolveRestConnectionEndpoint(config, moniker) {
|
|
|
2996
3006
|
const normalized = normalizeConnectionsConfig(config);
|
|
2997
3007
|
const binding = normalized.providerBindings[moniker];
|
|
2998
3008
|
const connectionName = assertEx21(
|
|
2999
|
-
binding?.connection
|
|
3009
|
+
binding?.connection,
|
|
3000
3010
|
() => `Provider "${moniker}" has no providerBindings.connection for REST endpoint resolution`
|
|
3001
3011
|
);
|
|
3002
3012
|
const rest = assertEx21(
|
|
@@ -3037,45 +3047,11 @@ var RPC_MONIKERS = [
|
|
|
3037
3047
|
function synthesizeRpcConnectionBindings() {
|
|
3038
3048
|
const bindings = {};
|
|
3039
3049
|
for (const moniker of RPC_MONIKERS) {
|
|
3040
|
-
bindings[moniker] = { connection: DEFAULT_RPC_CONNECTION
|
|
3050
|
+
bindings[moniker] = { connection: DEFAULT_RPC_CONNECTION };
|
|
3041
3051
|
}
|
|
3042
3052
|
return bindings;
|
|
3043
3053
|
}
|
|
3044
3054
|
|
|
3045
|
-
// src/config/transports/Rpc.ts
|
|
3046
|
-
import { globalRegistry as globalRegistry11, z as z17 } from "zod";
|
|
3047
|
-
var RpcRemoteConfigBaseZod = z17.object({
|
|
3048
|
-
protocol: z17.string("http").register(globalRegistry11, {
|
|
3049
|
-
description: "Protocol for the RPC connection",
|
|
3050
|
-
type: "string"
|
|
3051
|
-
})
|
|
3052
|
-
}).describe("Base configuration for the remote RPC");
|
|
3053
|
-
var HttpRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
3054
|
-
protocol: z17.string("http").register(globalRegistry11, {
|
|
3055
|
-
description: "Protocol for the RPC connection",
|
|
3056
|
-
type: "string"
|
|
3057
|
-
}).default("http"),
|
|
3058
|
-
url: z17.string().register(globalRegistry11, {
|
|
3059
|
-
description: "URL for the Chain RPC API",
|
|
3060
|
-
type: "string"
|
|
3061
|
-
})
|
|
3062
|
-
}).describe("Configuration for the remote RPC using Http");
|
|
3063
|
-
var PostMessageRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({
|
|
3064
|
-
protocol: z17.string().register(globalRegistry11, {
|
|
3065
|
-
description: "Protocol for the RPC connection",
|
|
3066
|
-
type: "string"
|
|
3067
|
-
}).default("postMessage"),
|
|
3068
|
-
networkId: z17.string().register(globalRegistry11, {
|
|
3069
|
-
description: "Network ID to use for the postMessage RPC connection",
|
|
3070
|
-
type: "string"
|
|
3071
|
-
}),
|
|
3072
|
-
sessionId: z17.string().register(globalRegistry11, {
|
|
3073
|
-
description: "Session ID to use for the postMessage RPC connection",
|
|
3074
|
-
type: "string"
|
|
3075
|
-
})
|
|
3076
|
-
}).describe("Configuration for the remote RPC using postMessage");
|
|
3077
|
-
var RpcRemoteConfigZod = z17.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod]).describe("Configuration for a remote RPC connection, either Http or postMessage");
|
|
3078
|
-
|
|
3079
3055
|
// src/config/UsageMeta.ts
|
|
3080
3056
|
import { z as z18 } from "zod";
|
|
3081
3057
|
var DescriptionSchema = z18.string();
|
|
@@ -7850,8 +7826,8 @@ export {
|
|
|
7850
7826
|
COIN_TYPES,
|
|
7851
7827
|
ChainIndexingServiceStateSchema,
|
|
7852
7828
|
ConfigZod,
|
|
7853
|
-
|
|
7854
|
-
|
|
7829
|
+
ConnectionConfigZod,
|
|
7830
|
+
ConnectionsConfigZod,
|
|
7855
7831
|
CreatableProviderContextZod,
|
|
7856
7832
|
DEFAULT_BACKOFF_MS,
|
|
7857
7833
|
DEFAULT_MAX_ATTEMPTS,
|
|
@@ -7863,8 +7839,7 @@ export {
|
|
|
7863
7839
|
EIP712DataPayloadSchema,
|
|
7864
7840
|
EIP712SignaturePayloadFieldsZod,
|
|
7865
7841
|
EIP712SignaturePayloadSchema,
|
|
7866
|
-
|
|
7867
|
-
EvmRpcTransportConfigZod,
|
|
7842
|
+
EvmRpcConnectionConfigZod,
|
|
7868
7843
|
GlobalMetaSchema,
|
|
7869
7844
|
HostActorConfigContext,
|
|
7870
7845
|
HostActorConfigZod,
|
|
@@ -7872,17 +7847,15 @@ export {
|
|
|
7872
7847
|
HydratedBoundWitnessWithStorageMetaZod,
|
|
7873
7848
|
HydratedCache,
|
|
7874
7849
|
JSONSchemaMetaSchema,
|
|
7875
|
-
|
|
7876
|
-
LmdbTransportConfigZod,
|
|
7850
|
+
LmdbConnectionConfigZod,
|
|
7877
7851
|
LoggerStatusReporter,
|
|
7878
7852
|
MemoryArchivistFactory,
|
|
7853
|
+
MemoryConnectionConfigZod,
|
|
7879
7854
|
MemoryPermissionsStore,
|
|
7880
|
-
MemoryTransportConfigZod,
|
|
7881
7855
|
MissingCapabilityError,
|
|
7882
7856
|
MnemonicStringZod,
|
|
7883
7857
|
MongoConfigZod,
|
|
7884
|
-
|
|
7885
|
-
MongoTransportConfigZod,
|
|
7858
|
+
MongoConnectionConfigZod,
|
|
7886
7859
|
PENDING_BLOCKS_ARCHIVIST_ROLE,
|
|
7887
7860
|
PENDING_TRANSACTIONS_ARCHIVIST_ROLE,
|
|
7888
7861
|
PRODUCER_DIVERSITY_BONUS,
|
|
@@ -7897,21 +7870,18 @@ export {
|
|
|
7897
7870
|
ProvidersConfigZod,
|
|
7898
7871
|
REJECTED_BLOCKS_ARCHIVIST_ROLE,
|
|
7899
7872
|
REJECTED_TRANSACTIONS_ARCHIVIST_ROLE,
|
|
7900
|
-
|
|
7873
|
+
RestConnectionConfigZod,
|
|
7901
7874
|
RestDataLakeRunner,
|
|
7902
7875
|
RestDataLakeViewer,
|
|
7903
7876
|
RestSyncViewer,
|
|
7904
|
-
RestTransportConfigZod,
|
|
7905
7877
|
RewardMultipliers,
|
|
7906
|
-
|
|
7878
|
+
RpcConnectionConfigZod,
|
|
7907
7879
|
RpcRemoteConfigBaseZod,
|
|
7908
7880
|
RpcRemoteConfigZod,
|
|
7909
|
-
RpcTransportConfigZod,
|
|
7910
7881
|
RuntimeStatusMonitor,
|
|
7911
7882
|
RuntimeStatusMonitorZod,
|
|
7912
7883
|
S3BucketConfigZod,
|
|
7913
|
-
|
|
7914
|
-
S3TransportConfigZod,
|
|
7884
|
+
S3ConnectionConfigZod,
|
|
7915
7885
|
SchemasStepSummarySchema,
|
|
7916
7886
|
ShiftedBigInt,
|
|
7917
7887
|
SimpleAccountBalanceViewer,
|
|
@@ -7943,8 +7913,6 @@ export {
|
|
|
7943
7913
|
TestGenesisBlockRewardAddress,
|
|
7944
7914
|
TransactionBuilder,
|
|
7945
7915
|
TransfersStepSummarySchema,
|
|
7946
|
-
TransportConfigZod,
|
|
7947
|
-
TransportsConfigZod,
|
|
7948
7916
|
TypedDataDomainZod,
|
|
7949
7917
|
TypedDataFieldZod,
|
|
7950
7918
|
TypedDataTypesZod,
|