@xyo-network/xl1-protocol-sdk 1.30.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/block/hydrate/createBoundWitnessHydrator.d.ts +30 -30
- package/dist/neutral/block/hydrate/createBoundWitnessHydrator.d.ts.map +1 -1
- package/dist/neutral/config/Actor.d.ts +50 -56
- package/dist/neutral/config/Actor.d.ts.map +1 -1
- package/dist/neutral/config/Actors.d.ts +65 -66
- package/dist/neutral/config/Actors.d.ts.map +1 -1
- package/dist/neutral/config/Base.d.ts +47 -47
- package/dist/neutral/config/Base.d.ts.map +1 -1
- package/dist/neutral/config/Chain.d.ts +4 -4
- package/dist/neutral/config/Chain.d.ts.map +1 -1
- package/dist/neutral/config/Config.d.ts +96 -98
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/HostActor.d.ts +51 -57
- package/dist/neutral/config/HostActor.d.ts.map +1 -1
- package/dist/neutral/config/Validation.d.ts +2 -2
- package/dist/neutral/context/Actor.d.ts +51 -57
- package/dist/neutral/context/Actor.d.ts.map +1 -1
- package/dist/neutral/context/HostActor.d.ts +53 -59
- package/dist/neutral/context/HostActor.d.ts.map +1 -1
- package/dist/neutral/eip-712/Payloads/EIP712Signature.d.ts +1 -1
- package/dist/neutral/getFileConfig.d.ts +0 -1
- package/dist/neutral/getFileConfig.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.mjs +29 -35
- package/dist/neutral/getFileConfig.mjs.map +3 -3
- package/dist/neutral/index.mjs +90 -126
- package/dist/neutral/index.mjs.map +3 -3
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts +52 -52
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts.map +1 -1
- package/dist/neutral/simple/StakeEventsViewer/SimpleStakeEventsViewer.d.ts +3 -2
- package/dist/neutral/simple/StakeEventsViewer/SimpleStakeEventsViewer.d.ts.map +1 -1
- package/dist/neutral/simple/StakeTotalsViewer/SimpleStakeTotalsViewer.d.ts +3 -2
- package/dist/neutral/simple/StakeTotalsViewer/SimpleStakeTotalsViewer.d.ts.map +1 -1
- package/dist/neutral/simple/StakeViewer/SimpleStakeViewer.d.ts +4 -3
- package/dist/neutral/simple/StakeViewer/SimpleStakeViewer.d.ts.map +1 -1
- package/dist/neutral/simple/TransactionViewer/SimpleTransactionViewer.d.ts +4 -3
- package/dist/neutral/simple/TransactionViewer/SimpleTransactionViewer.d.ts.map +1 -1
- package/dist/neutral/simple/block/SimpleBlockViewer.d.ts +2 -2
- package/dist/neutral/simple/block/SimpleBlockViewer.d.ts.map +1 -1
- package/dist/neutral/simple/blockInvalidation/SimpleBlockInvalidationViewer.d.ts +1 -1
- package/dist/neutral/simple/blockInvalidation/SimpleBlockInvalidationViewer.d.ts.map +1 -1
- package/dist/neutral/simple/blockReward/SimpleBlockRewardViewer.d.ts +4 -3
- package/dist/neutral/simple/blockReward/SimpleBlockRewardViewer.d.ts.map +1 -1
- package/dist/neutral/simple/blockValidation/SimpleBlockValidationViewer.d.ts +2 -1
- package/dist/neutral/simple/blockValidation/SimpleBlockValidationViewer.d.ts.map +1 -1
- package/dist/neutral/simple/chainContractViewer/SimpleChainContractViewer.d.ts +3 -2
- package/dist/neutral/simple/chainContractViewer/SimpleChainContractViewer.d.ts.map +1 -1
- package/dist/neutral/simple/datalake/RestDataLakeRunner.d.ts +3 -3
- package/dist/neutral/simple/datalake/RestDataLakeRunner.d.ts.map +1 -1
- package/dist/neutral/simple/datalake/RestDataLakeViewer.d.ts +3 -2
- package/dist/neutral/simple/datalake/RestDataLakeViewer.d.ts.map +1 -1
- package/dist/neutral/simple/datalake/SimpleDataLakeRunner.d.ts +2 -2
- package/dist/neutral/simple/datalake/SimpleDataLakeRunner.d.ts.map +1 -1
- package/dist/neutral/simple/datalake/SimpleDataLakeViewer.d.ts +3 -2
- package/dist/neutral/simple/datalake/SimpleDataLakeViewer.d.ts.map +1 -1
- package/dist/neutral/simple/finalization/SimpleFinalizationRunner.d.ts +4 -4
- package/dist/neutral/simple/finalization/SimpleFinalizationRunner.d.ts.map +1 -1
- package/dist/neutral/simple/finalization/SimpleFinalizationViewer.d.ts +5 -4
- package/dist/neutral/simple/finalization/SimpleFinalizationViewer.d.ts.map +1 -1
- package/dist/neutral/simple/mempool/SimpleMempoolRunner.d.ts +4 -4
- package/dist/neutral/simple/mempool/SimpleMempoolRunner.d.ts.map +1 -1
- package/dist/neutral/simple/mempool/SimpleMempoolViewer.d.ts +3 -2
- package/dist/neutral/simple/mempool/SimpleMempoolViewer.d.ts.map +1 -1
- package/dist/neutral/simple/runner/SimpleXyoRunner.d.ts +1 -1
- package/dist/neutral/simple/runner/SimpleXyoRunner.d.ts.map +1 -1
- package/dist/neutral/simple/transactionInvalidation/SimpleTransactionInvalidationViewer.d.ts +1 -1
- package/dist/neutral/simple/transactionInvalidation/SimpleTransactionInvalidationViewer.d.ts.map +1 -1
- package/dist/neutral/simple/transactionValidation/SimpleTransactionValidationViewer.d.ts +1 -1
- package/dist/neutral/simple/transactionValidation/SimpleTransactionValidationViewer.d.ts.map +1 -1
- package/dist/neutral/test/index.mjs +29 -41
- package/dist/neutral/test/index.mjs.map +2 -2
- package/package.json +58 -58
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/getFileConfig.ts", "../../src/config/Actor.ts", "../../src/config/Base.ts", "../../src/config/Chain.ts", "../../src/config/DataLake/DataLake.ts", "../../src/config/DataLake/RestDataLakeConfig.ts", "../../src/config/DataLake/DataLakeRemoteConfig.ts", "../../src/config/DataLake/RouterDataLakeConfig.ts", "../../src/config/Evm.ts", "../../src/config/Log.ts", "../../src/config/Providers.ts", "../../src/config/Provider.ts", "../../src/config/Remote.ts", "../../src/config/storage/driver/Mongo.ts", "../../src/config/storage/Storage.ts", "../../src/config/Telemetry.ts", "../../src/config/Validation.ts", "../../src/primitives/uncle/findBestUncle.ts", "../../src/config/Actors.ts", "../../src/config/Config.ts"],
|
|
4
|
-
"sourcesContent": ["import { isDefined, isNull } from '@xylabs/sdk-js'\nimport { cosmiconfig } from 'cosmiconfig'\n\nimport { ConfigZod } from './config/index.ts'\n\n/**\n * The name of the configuration file to search for.\n */\nconst configName = 'xyo'\n\n/**\n * The name of the section within the configuration file to parse.\n */\nconst configSection = 'xl1' // Default section in the config file\n\n/**\n * Attempts to parse the configuration from a file using cosmiconfig.\n * @returns The parsed configuration object if found and valid, otherwise undefined.\n */\nexport async function getFileConfig(searchPlaces?: string[]) {\n const explorer = cosmiconfig(\n configName,\n {\n cache: true,\n searchPlaces,\n },\n )\n const result: unknown = (await explorer.search())?.config\n if (!isNull(result)) {\n const section = (result as Record<string, unknown>)[configSection]\n if (isDefined(section) && typeof section === 'object') {\n return ConfigZod.loose().parse(section)\n }\n }\n return ConfigZod.parse({})\n}\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod'\n\nimport { BaseConfigZod } from './Base.ts'\n\n/**\n * BIP-32 derivation path for an actor wallet.\n *\n * - Absolute form: starts with `m/` (e.g. `m/44'/60'/0'/0/0`). The full path is used as-is,\n * giving the caller complete control over coin type, account, and hardening.\n * - Relative form: a segment list without the `m/` prefix (e.g. `0`, `0/1`, `44'/60'/0'/0/0`).\n * The consumer appends this to its configured root base path.\n *\n * Each segment is a non-negative integer, optionally suffixed with `'` to mark it as hardened.\n */\nexport const AccountPathZod = z.string().regex(\n /^(m(\\/\\d+'?)+|\\d+'?(\\/\\d+'?)*)$/,\n '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\".',\n)\n\n/** ActorConfigZod constant. */\nexport const ActorConfigZod = BaseConfigZod.extend({\n name: z.string(),\n accountPath: AccountPathZod.optional().register(globalRegistry, {\n 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.',\n title: 'accountPath',\n type: 'string',\n }),\n /**\n * @deprecated Use the top-level `healthCheckPort` on `ConfigZod` instead.\n * The system-wide health server covers all actors in a single process; per-actor\n * health ports will be removed in a future major release.\n */\n healthCheckPort: z.coerce.number().optional().register(globalRegistry, {\n description: '[DEPRECATED \u2014 use top-level healthCheckPort] Per-actor health server port.',\n title: 'actor.healthCheckPort',\n type: 'number',\n }),\n})\n\n/** ActorConfig type. */\nexport type ActorConfig = z.infer<typeof ActorConfigZod>\n\n/** Type guard that checks if a value is a valid ActorConfig. */\nexport const isActorConfig = zodIsFactory(ActorConfigZod)\n/** Converts a value to ActorConfig, throwing if invalid. */\nexport const asActorConfig = zodAsFactory(ActorConfigZod, 'asActorConfig')\n/** toActorConfig constant. */\nexport const toActorConfig = zodToFactory(ActorConfigZod, 'toActorConfig')\n", "import { z } from 'zod'\n\nimport { ChainConfigZod } from './Chain.ts'\nimport { DataLakeConfigZod } from './DataLake/index.ts'\nimport { EvmConfigZod } from './Evm.ts'\nimport { LogConfigZod } from './Log.ts'\nimport { ProvidersConfigZod } from './Providers.ts'\nimport { RemoteConfigZod } from './Remote.ts'\nimport { StorageConfigZod } from './storage/index.ts'\nimport { TelemetryConfigZod } from './Telemetry.ts'\nimport { ValidationConfigZod } from './Validation.ts'\n\n/** BaseConfigZod constant. */\nexport const BaseConfigZod = z.object({\n chain: ChainConfigZod.default(ChainConfigZod.parse({})).describe('Configuration for the chain'),\n dataLake: DataLakeConfigZod.optional().describe('Configuration for data lakes'),\n evm: EvmConfigZod.default(EvmConfigZod.parse({})).describe('Configuration for EVM-backed services'),\n log: LogConfigZod.default(LogConfigZod.parse({})).describe('Configuration for logging'),\n providers: ProvidersConfigZod.default(ProvidersConfigZod.parse([])).describe('Configuration for providers'),\n remote: RemoteConfigZod.default(RemoteConfigZod.parse({})).describe('Configuration for remote services'),\n storage: StorageConfigZod.default(StorageConfigZod.parse({})).describe('Configuration for the storage'),\n telemetry: TelemetryConfigZod.default(TelemetryConfigZod.parse({})).describe('Configuration for telemetry'),\n validation: ValidationConfigZod.default(ValidationConfigZod.parse({})).describe('Configuration for validation'),\n})\n\n/** BaseConfig type. */\nexport type BaseConfig = z.infer<typeof BaseConfigZod>\n", "import { AddressZod, HexZod } from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod'\n\n/** ChainConfigZod constant. */\nexport const ChainConfigZod = z.object({\n id: HexZod.optional()\n .register(globalRegistry, {\n description:\n 'The unique identifier for the chain. Should be the staking contract address for contract-backed chains.',\n title: 'chain.id',\n type: 'string',\n }),\n genesisRewardAddress: AddressZod.optional()\n .register(globalRegistry, {\n description:\n 'Address to send the initial genesis rewards to, if a new chain is being created.',\n title: 'chain.genesisRewardAddress',\n type: 'Address',\n }),\n})\n\n/** ChainConfig type. */\nexport type ChainConfig = z.infer<typeof ChainConfigZod>\n", "import { z } from 'zod'\n\nimport { type RestDataLakeConfig, RestDataLakeConfigZod } from './RestDataLakeConfig.ts'\n// eslint-disable-next-line import-x/no-cycle -- intentional cycle for z.lazy recursive type\nimport { type RouterDataLakeConfig, RouterDataLakeConfigZod } from './RouterDataLakeConfig.ts'\n\n/** DataLakeConfig type. */\nexport type DataLakeConfig = RestDataLakeConfig | RouterDataLakeConfig\n\n// z.lazy handles the circular reference between DataLakeConfigZod and RouterDataLakeZod\n/** DataLakeConfigZod constant. */\nexport const DataLakeConfigZod: z.ZodType<DataLakeConfig> = z.lazy(() =>\n z.union([RestDataLakeConfigZod, RouterDataLakeConfigZod])).describe('Configuration for a data lake')\n", "import { globalRegistry, z } from 'zod'\n\nimport { DataLakeDriverConfigBaseZod } from './DataLakeRemoteConfig.ts'\n\n/** RestDataLakeConfigZod constant. */\nexport const RestDataLakeConfigZod = DataLakeDriverConfigBaseZod.extend({\n driver: z.literal('rest').register(globalRegistry, {\n description: 'Driver for the REST data lake',\n type: 'string',\n }),\n url: z.string().register(globalRegistry, {\n description: 'URL for the REST data lake',\n type: 'string',\n }),\n}).describe('Configuration for the REST data lake driver')\n\n/** RestDataLakeConfig type. */\nexport type RestDataLakeConfig = z.infer<typeof RestDataLakeConfigZod>\n", "import { globalRegistry, z } from 'zod'\n\n/** DataLakeDriverConfigBaseZod constant. */\nexport const DataLakeDriverConfigBaseZod = z.object({\n driver: z.string().register(globalRegistry, {\n description: 'Driver for the data lake',\n type: 'string',\n }),\n}).describe('Base configuration for a data lake driver')\n/** DataLakeDriverConfigBase type. */\nexport type DataLakeDriverConfigBase = z.infer<typeof DataLakeDriverConfigBaseZod>\n", "import { globalRegistry, z } from 'zod'\n\nimport type { DataLakeConfig } from './DataLake.ts'\n// eslint-disable-next-line import-x/no-cycle -- intentional cycle for z.lazy recursive type\nimport { DataLakeConfigZod } from './DataLake.ts'\n\n/** Configuration for RouterDataLake. */\nexport interface RouterDataLakeConfig {\n children: DataLakeConfig[]\n driver: 'router'\n}\n\n/** RouterDataLakeConfigZod constant. */\nexport const RouterDataLakeConfigZod: z.ZodType<RouterDataLakeConfig> = z.object({\n driver: z.literal('router').register(globalRegistry, {\n description: 'Driver for the router data lake',\n type: 'string',\n }),\n children: z.array(z.lazy(() => DataLakeConfigZod)).register(globalRegistry, {\n description: 'Child data lake drivers',\n type: 'array',\n }),\n}).describe('Configuration for the router data lake driver')\n", "import { globalRegistry, z } from 'zod'\n\n/** EvmInfuraConfigZod constant. */\nexport const EvmInfuraConfigZod = z.object({\n projectId: z.string().optional().register(globalRegistry, {\n description: 'Infura project ID',\n title: 'evm.infura.projectId',\n type: 'string',\n }),\n projectSecret: z.string().optional().register(globalRegistry, {\n description: 'Infura project secret',\n title: 'evm.infura.projectSecret',\n type: 'string',\n }),\n})\n\n/** EvmJsonRpcConfigZod constant. */\nexport const EvmJsonRpcConfigZod = z.object({\n url: z.url().optional().register(globalRegistry, {\n description: 'JSON-RPC URL',\n title: 'evm.jsonRpc.url',\n type: 'string',\n }),\n})\n\n/** EvmConfigZod constant. */\nexport const EvmConfigZod = z.object({\n chainId: z.string().optional().register(globalRegistry, {\n description: 'EVM chain ID',\n title: 'evm.chainId',\n type: 'string',\n }),\n infura: EvmInfuraConfigZod.optional().describe('Infura Provider configuration'),\n jsonRpc: EvmJsonRpcConfigZod.optional().describe('JSON-RPC Provider configuration'),\n})\n\n/** EvmConfig type. */\nexport type EvmConfig = z.infer<typeof EvmConfigZod>\n", "import type { LogLevelKey } from '@xylabs/sdk-js'\nimport { LogLevel } from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod'\n\nconst LogLevelNames = Object.keys(LogLevel) as [LogLevelKey]\n\n/** LogConfigZod constant. */\nexport const LogConfigZod = z.object({\n logLevel: z.enum(LogLevelNames).default('info').register(globalRegistry, {\n choices: LogLevelNames,\n default: 'info',\n description: 'Desired process verbosity',\n title: 'logLevel',\n type: 'string',\n }),\n silent: z.boolean().default(false).register(globalRegistry, {\n default: false,\n description: 'Whether to run in silent mode',\n title: 'silent',\n type: 'boolean',\n }),\n})\n\n/** LogConfig type. */\nexport type LogConfig = z.infer<typeof LogConfigZod>\n", "import z from 'zod'\n\nimport { ProviderConfigZod } from './Provider.ts'\n\n/** ProvidersConfigZod constant. */\nexport const ProvidersConfigZod = z.array(ProviderConfigZod.loose()).describe('Configuration for providers').default([])\n\n/** ProvidersConfig type. */\nexport type ProvidersConfig = z.infer<typeof ProvidersConfigZod>\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { z } from 'zod'\n\n/** ProviderConfigZod constant. */\nexport const ProviderConfigZod = z.object({\n moniker: z.string(),\n labels: z.array(z.string()).optional(),\n}).describe('Configuration for a Provider')\n\n/** ProviderConfig type. */\nexport type ProviderConfig = z.infer<typeof ProviderConfigZod>\n\n/** Type guard that checks if a value is a valid ProviderConfig. */\nexport const isProviderConfig = zodIsFactory(ProviderConfigZod)\n/** Converts a value to ProviderConfig, throwing if invalid. */\nexport const asProviderConfig = zodAsFactory(ProviderConfigZod, 'asProviderConfig')\n/** toProviderConfig constant. */\nexport const toProviderConfig = zodToFactory(ProviderConfigZod, 'toProviderConfig')\n", "import { globalRegistry, z } from 'zod'\n\n/** RpcRemoteConfigBaseZod constant. */\nexport const RpcRemoteConfigBaseZod = z.object({\n protocol: z.string('http').register(globalRegistry, {\n description: 'Protocol for the RPC connection',\n type: 'string',\n }),\n}).describe('Base configuration for the remote RPC')\n\n/** RpcRemoteConfigBase type. */\nexport type RpcRemoteConfigBase = z.infer<typeof RpcRemoteConfigBaseZod>\n\n/** HttpRpcRemoteConfigZod constant. */\nexport const HttpRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({\n protocol: z.string('http').register(globalRegistry, {\n description: 'Protocol for the RPC connection',\n type: 'string',\n }).default('http'),\n url: z.string().register(globalRegistry, {\n description: 'URL for the Chain RPC API',\n type: 'string',\n }),\n}).describe('Configuration for the remote RPC using Http')\n\n/** HttpRpcRemoteConfig type. */\nexport type HttpRpcRemoteConfig = z.infer<typeof HttpRpcRemoteConfigZod>\n\n/** PostMessageRpcRemoteConfigZod constant. */\nexport const PostMessageRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({\n protocol: z.string().register(globalRegistry, {\n description: 'Protocol for the RPC connection',\n type: 'string',\n }).default('postMessage'),\n networkId: z.string().register(globalRegistry, {\n description: 'Network ID to use for the postMessage RPC connection',\n type: 'string',\n }),\n sessionId: z.string().register(globalRegistry, {\n description: 'Session ID to use for the postMessage RPC connection',\n type: 'string',\n }),\n}).describe('Configuration for the remote RPC using postMessage')\n\n/** PostMessageRpcRemoteConfig type. */\nexport type PostMessageRpcRemoteConfig = z.infer<typeof PostMessageRpcRemoteConfigZod>\n\n/** RpcRemoteConfigZod constant. */\nexport const RpcRemoteConfigZod = z.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod])\n .describe('Configuration for a remote RPC connection, either Http or postMessage')\n\n/** RpcRemoteConfig type. */\nexport type RpcRemoteConfig = z.infer<typeof RpcRemoteConfigZod>\n\n/** RemoteConfigZod constant. */\nexport const RemoteConfigZod = z.object({ rpc: RpcRemoteConfigZod.optional() }).describe('Configuration for remote connections, including RPC')\n\n/** RemoteConfig type. */\nexport type RemoteConfig = z.infer<typeof RemoteConfigZod>\n", "import { isDefined, isUndefined } from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod'\n\n/**\n * Checks if the provided MongoDB configuration contains the fields needed to\n * identify a Mongo target. `username` / `password` are intentionally not\n * required: `mongodb-memory-server` and many production deployments run\n * without auth (or carry credentials inline in the `connectionString` URI).\n * @param config MongoDB configuration object\n * @returns True iff `connectionString`, `database`, and `domain` are all set\n */\nexport const hasMongoConfig = (\n config?: MongoConfig,\n): config is MongoConfig & { connectionString: string; database: string; domain: string } => {\n if (isUndefined(config)) return false\n return (\n isDefined(config.connectionString)\n && isDefined(config.database)\n && isDefined(config.domain)\n )\n}\n\n/** MongoConfigZod constant. */\nexport const MongoConfigZod = z.object({\n // TODO: Create from other arguments\n connectionString: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB connection string',\n title: 'storage.mongo.connectionString',\n type: 'string',\n }),\n database: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB database name',\n title: 'storage.mongo.database',\n type: 'string',\n }),\n domain: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB domain',\n title: 'storage.mongo.domain',\n type: 'string',\n }),\n password: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB password',\n title: 'storage.mongo.password',\n type: 'string',\n }),\n username: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB username',\n title: 'storage.mongo.username',\n type: 'string',\n }),\n})\n\n/** MongoConfig type. */\nexport type MongoConfig = z.infer<typeof MongoConfigZod>\n", "import { globalRegistry, z } from 'zod'\n\nimport { MongoConfigZod } from './driver/index.ts'\n\n/** StorageConfigZod constant. */\nexport const StorageConfigZod = z.object({\n mongo: MongoConfigZod.optional().describe('Configuration for the MongoD storage driver'),\n root: z.string().optional().register(globalRegistry, {\n description: 'Root directory for local storage',\n title: 'storage.root',\n type: 'string',\n }),\n}).describe('Storage configuration options')\n\n/** StorageConfig type. */\nexport type StorageConfig = z.infer<typeof StorageConfigZod>\n", "import { globalRegistry, z } from 'zod'\n\n/** DefaultMetricsScrapePorts constant. */\nexport const DefaultMetricsScrapePorts = {\n api: 9465,\n bridge: 9468,\n mempool: 9466,\n producer: 9464,\n rewardRedemptionApi: 9467,\n}\n\n/** MetricsScrapeConfigZod constant. */\nexport const MetricsScrapeConfigZod = z.object({\n path: z.string().default('/metrics').register(globalRegistry, {\n default: '/metrics',\n description: 'Path for the metrics scrape endpoint',\n title: 'telemetry.metrics.scrape.path',\n type: 'string',\n }),\n port: z.coerce.number().int().positive().optional().register(globalRegistry, {\n description: 'Port for the metrics scrape endpoint',\n title: 'telemetry.metrics.scrape.port',\n type: 'number',\n }),\n}).describe('Metrics scrape configuration')\n\n/** MetricsConfigZod constant. */\nexport const MetricsConfigZod = z.object({ scrape: MetricsScrapeConfigZod }).describe('Metrics configuration options')\n\n/** OpenTelemetryConfigZod constant. */\nexport const OpenTelemetryConfigZod = z.object({\n // OpenTelemetry options\n otlpEndpoint: z.url().optional().register(globalRegistry, {\n description: 'OTLP endpoint for exporting telemetry data',\n title: 'telemetry.otel.otlpEndpoint',\n type: 'string',\n }),\n})\n\n/** TelemetryConfigZod constant. */\nexport const TelemetryConfigZod = z.object({\n // Metrics configuration\n metrics: MetricsConfigZod.optional().describe('Metrics configuration'),\n // OpenTelemetry configuration\n otel: OpenTelemetryConfigZod.optional().describe('OpenTelemetry configuration'),\n}).describe('Telemetry configuration options')\n\n/** TelemetryConfig type. */\nexport type TelemetryConfig = z.infer<typeof TelemetryConfigZod>\n", "import { AddressZod } from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod'\n\nimport { DEFAULT_BACKOFF_MS, DEFAULT_MIN_CANDIDATES } from '../primitives/index.ts'\n\n/** ValidationConfigZod constant. */\nexport const ValidationConfigZod = z.object({\n allowedRewardRedeemers: z.array(AddressZod).optional().register(globalRegistry, {\n description: 'List of allowed reward redeemer addresses, if undefined anyone can participate',\n title: 'allowedRewardRedeemers',\n type: 'array',\n }),\n allowedRewardEscrowAccountSigners: z.array(AddressZod).optional().register(globalRegistry, {\n description: 'List of allowed reward escrow account signer addresses, if undefined anyone can participate',\n title: 'allowedRewardEscrowAccountSigners',\n type: 'array',\n }),\n minCandidates: z.coerce.number().default(DEFAULT_MIN_CANDIDATES).register(globalRegistry, {\n default: DEFAULT_MIN_CANDIDATES,\n description: 'Minimum number of uncle candidates before selecting the best uncle',\n title: 'validation.minCandidates',\n type: 'number',\n }),\n backoffMs: z.coerce.number().default(DEFAULT_BACKOFF_MS).register(globalRegistry, {\n default: DEFAULT_BACKOFF_MS,\n description: 'Back-off timeout in ms. If head age exceeds this, minCandidates is ignored',\n title: 'validation.backoffMs',\n type: 'number',\n }),\n})\n\n/** ValidationConfig type. */\nexport type ValidationConfig = z.infer<typeof ValidationConfigZod>\n", "import type { SignedHydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol-lib'\n\nimport { scoreUncle } from './scoreUncle.ts'\n\n/** Default minimum number of uncle candidates before selecting. */\nexport const DEFAULT_MIN_CANDIDATES = 1\n\n/** Default back-off timeout in milliseconds. If the head has not changed for this long, minCandidates is ignored. */\nexport const DEFAULT_BACKOFF_MS = 120_000\n\n/** Options for findBestUncle block selection. */\nexport interface FindBestUncleOptions {\n /** Back-off timeout in ms. If head age exceeds this, minCandidates is ignored. Default: 120_000. */\n backoffMs?: number\n /** Minimum number of uncle candidates before selecting. Default: 1. */\n minCandidates?: number\n /** Current timestamp in ms. Injectable for testing. Default: Date.now(). */\n now?: number\n}\n\n/** Selects the best uncle chain from candidates using Proof of Perfect scoring. */\nexport function findBestUncle(\n finalizedWindowedChain: SignedHydratedBlockWithHashMeta[],\n uncles: SignedHydratedBlockWithHashMeta[][],\n options?: FindBestUncleOptions,\n): SignedHydratedBlockWithHashMeta[] | undefined {\n if (uncles.length === 0) return undefined\n\n const minCandidates = options?.minCandidates ?? DEFAULT_MIN_CANDIDATES\n const backoffMs = options?.backoffMs ?? DEFAULT_BACKOFF_MS\n const now = options?.now ?? Date.now()\n\n if (uncles.length < minCandidates) {\n const headEpoch = finalizedWindowedChain.at(-1)?.[0].$epoch ?? 0\n const headAge = now - headEpoch\n if (headAge < backoffMs) {\n return undefined\n }\n }\n\n const scores = uncles.map(uncle => ([scoreUncle(finalizedWindowedChain, uncle), uncle] as const)).toSorted((a, b) => b[0] - a[0])\n return scores[0]?.[1]\n}\n", "import z from 'zod'\n\nimport { ActorConfigZod } from './Actor.ts'\n\n/** ActorsConfigZod constant. */\nexport const ActorsConfigZod = z.array(ActorConfigZod.loose()).describe('Actor-specific configurations that override the base configuration when the actor is running').default([])\n\n/** ActorsConfig type. */\nexport type ActorsConfig = z.infer<typeof ActorsConfigZod>\n", "import { globalRegistry, z } from 'zod'\n\nimport { ActorConfigZod } from './Actor.ts'\nimport { ActorsConfigZod } from './Actors.ts'\nimport { BaseConfigZod } from './Base.ts'\nimport type { DeepPartial } from './DeepPartial.ts'\n\n/** ConfigZod constant. */\nexport const ConfigZod = BaseConfigZod.extend({\n actors: ActorsConfigZod,\n healthCheckPort: z.coerce.number().optional().register(globalRegistry, {\n description: 'Port for the system-wide health, readiness, and liveness endpoints (/healthz, /livez, /readyz). Set to 0 to disable.',\n title: 'healthCheckPort',\n type: 'number',\n }),\n}).describe('The complete configuration for the protocol, including global settings and actor-specific overrides')\n\n/** Config type. */\nexport type Config = z.infer<typeof ConfigZod>\n\n/** ResolveConfig helper function. */\nexport function resolveConfig(\n config: DeepPartial<Config>,\n) {\n const parsedConfig = ConfigZod.parse(config)\n const { actors, ...rootConfig } = parsedConfig\n parsedConfig.actors = actors.map((actorConfig) => {\n return ActorConfigZod.loose().parse({ ...rootConfig, ...actorConfig })\n })\n return parsedConfig\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,aAAAA,YAAW,cAAc;AAClC,SAAS,mBAAmB;;;
|
|
6
|
-
"names": ["isDefined", "zodAsFactory", "zodIsFactory", "zodToFactory", "globalRegistry", "z", "z", "z", "globalRegistry", "z", "globalRegistry", "z", "z", "globalRegistry", "globalRegistry", "z", "z", "globalRegistry", "z", "globalRegistry", "z", "globalRegistry", "z", "z", "z", "z", "globalRegistry", "z", "globalRegistry", "z", "z", "globalRegistry", "globalRegistry", "z", "z", "globalRegistry", "globalRegistry", "z", "z", "globalRegistry", "AddressZod", "globalRegistry", "z", "z", "AddressZod", "globalRegistry", "z", "z", "globalRegistry", "zodIsFactory", "zodAsFactory", "zodToFactory", "z", "z", "globalRegistry", "z", "z", "globalRegistry", "isDefined"]
|
|
4
|
+
"sourcesContent": ["import { isDefined, isNull } from '@xylabs/sdk-js'\nimport { cosmiconfig } from 'cosmiconfig'\nimport { z } from 'zod/mini'\n\nimport { ConfigZod } from './config/index.ts'\n\n/**\n * The name of the configuration file to search for.\n */\nconst configName = 'xyo'\n\n/**\n * The name of the section within the configuration file to parse.\n */\nconst configSection = 'xl1' // Default section in the config file\n\n/**\n * Attempts to parse the configuration from a file using cosmiconfig.\n * @returns The parsed configuration object if found and valid, otherwise undefined.\n */\nexport async function getFileConfig(searchPlaces?: string[]) {\n const explorer = cosmiconfig(\n configName,\n {\n cache: true,\n searchPlaces,\n },\n )\n const result: unknown = (await explorer.search())?.config\n if (!isNull(result)) {\n const section = (result as Record<string, unknown>)[configSection]\n if (isDefined(section) && typeof section === 'object') {\n return z.looseObject(ConfigZod.shape).parse(section)\n }\n }\n return ConfigZod.parse({})\n}\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod/mini'\n\nimport { BaseConfigZod } from './Base.ts'\n\n/**\n * BIP-32 derivation path for an actor wallet.\n *\n * - Absolute form: starts with `m/` (e.g. `m/44'/60'/0'/0/0`). The full path is used as-is,\n * giving the caller complete control over coin type, account, and hardening.\n * - Relative form: a segment list without the `m/` prefix (e.g. `0`, `0/1`, `44'/60'/0'/0/0`).\n * The consumer appends this to its configured root base path.\n *\n * Each segment is a non-negative integer, optionally suffixed with `'` to mark it as hardened.\n */\nexport const AccountPathZod = z.string().check(z.regex(\n /^(m(\\/\\d+'?)+|\\d+'?(\\/\\d+'?)*)$/,\n '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\".',\n))\n\n/** ActorConfigZod constant. */\nexport const ActorConfigZod = z.extend(BaseConfigZod, {\n name: z.string(),\n accountPath: z.optional(AccountPathZod).register(globalRegistry, {\n 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.',\n title: 'accountPath',\n type: 'string',\n }),\n})\n\n/** ActorConfig type. */\nexport type ActorConfig = z.infer<typeof ActorConfigZod>\n\n/** Type guard that checks if a value is a valid ActorConfig. */\nexport const isActorConfig = zodIsFactory(ActorConfigZod)\n/** Converts a value to ActorConfig, throwing if invalid. */\nexport const asActorConfig = zodAsFactory(ActorConfigZod, 'asActorConfig')\n/** toActorConfig constant. */\nexport const toActorConfig = zodToFactory(ActorConfigZod, 'toActorConfig')\n", "import { z } from 'zod/mini'\n\nimport { ChainConfigZod } from './Chain.ts'\nimport { DataLakeConfigZod } from './DataLake/index.ts'\nimport { EvmConfigZod } from './Evm.ts'\nimport { LogConfigZod } from './Log.ts'\nimport { ProvidersConfigZod } from './Providers.ts'\nimport { RemoteConfigZod } from './Remote.ts'\nimport { StorageConfigZod } from './storage/index.ts'\nimport { TelemetryConfigZod } from './Telemetry.ts'\nimport { ValidationConfigZod } from './Validation.ts'\n\n/** BaseConfigZod constant. */\nexport const BaseConfigZod = z.object({\n chain: z._default(ChainConfigZod, ChainConfigZod.parse({})).check(z.describe('Configuration for the chain')),\n dataLake: z.optional(DataLakeConfigZod).check(z.describe('Configuration for data lakes')),\n evm: z._default(EvmConfigZod, EvmConfigZod.parse({})).check(z.describe('Configuration for EVM-backed services')),\n log: z._default(LogConfigZod, LogConfigZod.parse({})).check(z.describe('Configuration for logging')),\n providers: z._default(ProvidersConfigZod, ProvidersConfigZod.parse([])).check(z.describe('Configuration for providers')),\n remote: z._default(RemoteConfigZod, RemoteConfigZod.parse({})).check(z.describe('Configuration for remote services')),\n storage: z._default(StorageConfigZod, StorageConfigZod.parse({})).check(z.describe('Configuration for the storage')),\n telemetry: z._default(TelemetryConfigZod, TelemetryConfigZod.parse({})).check(z.describe('Configuration for telemetry')),\n validation: z._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z.describe('Configuration for validation')),\n})\n\n/** BaseConfig type. */\nexport type BaseConfig = z.infer<typeof BaseConfigZod>\n", "import { AddressZod, HexZod } from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod/mini'\n\n/** ChainConfigZod constant. */\nexport const ChainConfigZod = z.object({\n id: z.optional(HexZod)\n .register(globalRegistry, {\n description:\n 'The unique identifier for the chain. Should be the staking contract address for contract-backed chains.',\n title: 'chain.id',\n type: 'string',\n }),\n genesisRewardAddress: z.optional(AddressZod)\n .register(globalRegistry, {\n description:\n 'Address to send the initial genesis rewards to, if a new chain is being created.',\n title: 'chain.genesisRewardAddress',\n type: 'Address',\n }),\n})\n\n/** ChainConfig type. */\nexport type ChainConfig = z.infer<typeof ChainConfigZod>\n", "import { z } from 'zod'\n\nimport { type RestDataLakeConfig, RestDataLakeConfigZod } from './RestDataLakeConfig.ts'\n// eslint-disable-next-line import-x/no-cycle -- intentional cycle for z.lazy recursive type\nimport { type RouterDataLakeConfig, RouterDataLakeConfigZod } from './RouterDataLakeConfig.ts'\n\n/** DataLakeConfig type. */\nexport type DataLakeConfig = RestDataLakeConfig | RouterDataLakeConfig\n\n// z.lazy handles the circular reference between DataLakeConfigZod and RouterDataLakeZod\n/** DataLakeConfigZod constant. */\nexport const DataLakeConfigZod: z.ZodType<DataLakeConfig> = z.lazy(() =>\n z.union([RestDataLakeConfigZod, RouterDataLakeConfigZod])).describe('Configuration for a data lake')\n", "import { globalRegistry, z } from 'zod'\n\nimport { DataLakeDriverConfigBaseZod } from './DataLakeRemoteConfig.ts'\n\n/** RestDataLakeConfigZod constant. */\nexport const RestDataLakeConfigZod = DataLakeDriverConfigBaseZod.extend({\n driver: z.literal('rest').register(globalRegistry, {\n description: 'Driver for the REST data lake',\n type: 'string',\n }),\n url: z.string().register(globalRegistry, {\n description: 'URL for the REST data lake',\n type: 'string',\n }),\n}).describe('Configuration for the REST data lake driver')\n\n/** RestDataLakeConfig type. */\nexport type RestDataLakeConfig = z.infer<typeof RestDataLakeConfigZod>\n", "import { globalRegistry, z } from 'zod'\n\n/** DataLakeDriverConfigBaseZod constant. */\nexport const DataLakeDriverConfigBaseZod = z.object({\n driver: z.string().register(globalRegistry, {\n description: 'Driver for the data lake',\n type: 'string',\n }),\n}).describe('Base configuration for a data lake driver')\n/** DataLakeDriverConfigBase type. */\nexport type DataLakeDriverConfigBase = z.infer<typeof DataLakeDriverConfigBaseZod>\n", "import { globalRegistry, z } from 'zod'\n\nimport type { DataLakeConfig } from './DataLake.ts'\n// eslint-disable-next-line import-x/no-cycle -- intentional cycle for z.lazy recursive type\nimport { DataLakeConfigZod } from './DataLake.ts'\n\n/** Configuration for RouterDataLake. */\nexport interface RouterDataLakeConfig {\n children: DataLakeConfig[]\n driver: 'router'\n}\n\n/** RouterDataLakeConfigZod constant. */\nexport const RouterDataLakeConfigZod: z.ZodType<RouterDataLakeConfig> = z.object({\n driver: z.literal('router').register(globalRegistry, {\n description: 'Driver for the router data lake',\n type: 'string',\n }),\n children: z.array(z.lazy(() => DataLakeConfigZod)).register(globalRegistry, {\n description: 'Child data lake drivers',\n type: 'array',\n }),\n}).describe('Configuration for the router data lake driver')\n", "import { globalRegistry, z } from 'zod'\n\n/** EvmInfuraConfigZod constant. */\nexport const EvmInfuraConfigZod = z.object({\n projectId: z.string().optional().register(globalRegistry, {\n description: 'Infura project ID',\n title: 'evm.infura.projectId',\n type: 'string',\n }),\n projectSecret: z.string().optional().register(globalRegistry, {\n description: 'Infura project secret',\n title: 'evm.infura.projectSecret',\n type: 'string',\n }),\n})\n\n/** EvmJsonRpcConfigZod constant. */\nexport const EvmJsonRpcConfigZod = z.object({\n url: z.url().optional().register(globalRegistry, {\n description: 'JSON-RPC URL',\n title: 'evm.jsonRpc.url',\n type: 'string',\n }),\n})\n\n/** EvmConfigZod constant. */\nexport const EvmConfigZod = z.object({\n chainId: z.string().optional().register(globalRegistry, {\n description: 'EVM chain ID',\n title: 'evm.chainId',\n type: 'string',\n }),\n infura: EvmInfuraConfigZod.optional().describe('Infura Provider configuration'),\n jsonRpc: EvmJsonRpcConfigZod.optional().describe('JSON-RPC Provider configuration'),\n})\n\n/** EvmConfig type. */\nexport type EvmConfig = z.infer<typeof EvmConfigZod>\n", "import type { LogLevelKey } from '@xylabs/sdk-js'\nimport { LogLevel } from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod'\n\nconst LogLevelNames = Object.keys(LogLevel) as [LogLevelKey]\n\n/** LogConfigZod constant. */\nexport const LogConfigZod = z.object({\n logLevel: z.enum(LogLevelNames).default('info').register(globalRegistry, {\n choices: LogLevelNames,\n default: 'info',\n description: 'Desired process verbosity',\n title: 'logLevel',\n type: 'string',\n }),\n silent: z.boolean().default(false).register(globalRegistry, {\n default: false,\n description: 'Whether to run in silent mode',\n title: 'silent',\n type: 'boolean',\n }),\n})\n\n/** LogConfig type. */\nexport type LogConfig = z.infer<typeof LogConfigZod>\n", "import z from 'zod'\n\nimport { ProviderConfigZod } from './Provider.ts'\n\n/** ProvidersConfigZod constant. */\nexport const ProvidersConfigZod = z.array(ProviderConfigZod.loose()).describe('Configuration for providers').default([])\n\n/** ProvidersConfig type. */\nexport type ProvidersConfig = z.infer<typeof ProvidersConfigZod>\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { z } from 'zod'\n\n/** ProviderConfigZod constant. */\nexport const ProviderConfigZod = z.object({\n moniker: z.string(),\n labels: z.array(z.string()).optional(),\n}).describe('Configuration for a Provider')\n\n/** ProviderConfig type. */\nexport type ProviderConfig = z.infer<typeof ProviderConfigZod>\n\n/** Type guard that checks if a value is a valid ProviderConfig. */\nexport const isProviderConfig = zodIsFactory(ProviderConfigZod)\n/** Converts a value to ProviderConfig, throwing if invalid. */\nexport const asProviderConfig = zodAsFactory(ProviderConfigZod, 'asProviderConfig')\n/** toProviderConfig constant. */\nexport const toProviderConfig = zodToFactory(ProviderConfigZod, 'toProviderConfig')\n", "import { globalRegistry, z } from 'zod'\n\n/** RpcRemoteConfigBaseZod constant. */\nexport const RpcRemoteConfigBaseZod = z.object({\n protocol: z.string('http').register(globalRegistry, {\n description: 'Protocol for the RPC connection',\n type: 'string',\n }),\n}).describe('Base configuration for the remote RPC')\n\n/** RpcRemoteConfigBase type. */\nexport type RpcRemoteConfigBase = z.infer<typeof RpcRemoteConfigBaseZod>\n\n/** HttpRpcRemoteConfigZod constant. */\nexport const HttpRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({\n protocol: z.string('http').register(globalRegistry, {\n description: 'Protocol for the RPC connection',\n type: 'string',\n }).default('http'),\n url: z.string().register(globalRegistry, {\n description: 'URL for the Chain RPC API',\n type: 'string',\n }),\n}).describe('Configuration for the remote RPC using Http')\n\n/** HttpRpcRemoteConfig type. */\nexport type HttpRpcRemoteConfig = z.infer<typeof HttpRpcRemoteConfigZod>\n\n/** PostMessageRpcRemoteConfigZod constant. */\nexport const PostMessageRpcRemoteConfigZod = RpcRemoteConfigBaseZod.extend({\n protocol: z.string().register(globalRegistry, {\n description: 'Protocol for the RPC connection',\n type: 'string',\n }).default('postMessage'),\n networkId: z.string().register(globalRegistry, {\n description: 'Network ID to use for the postMessage RPC connection',\n type: 'string',\n }),\n sessionId: z.string().register(globalRegistry, {\n description: 'Session ID to use for the postMessage RPC connection',\n type: 'string',\n }),\n}).describe('Configuration for the remote RPC using postMessage')\n\n/** PostMessageRpcRemoteConfig type. */\nexport type PostMessageRpcRemoteConfig = z.infer<typeof PostMessageRpcRemoteConfigZod>\n\n/** RpcRemoteConfigZod constant. */\nexport const RpcRemoteConfigZod = z.union([HttpRpcRemoteConfigZod, PostMessageRpcRemoteConfigZod])\n .describe('Configuration for a remote RPC connection, either Http or postMessage')\n\n/** RpcRemoteConfig type. */\nexport type RpcRemoteConfig = z.infer<typeof RpcRemoteConfigZod>\n\n/** RemoteConfigZod constant. */\nexport const RemoteConfigZod = z.object({ rpc: RpcRemoteConfigZod.optional() }).describe('Configuration for remote connections, including RPC')\n\n/** RemoteConfig type. */\nexport type RemoteConfig = z.infer<typeof RemoteConfigZod>\n", "import { isDefined, isUndefined } from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod'\n\n/**\n * Checks if the provided MongoDB configuration contains the fields needed to\n * identify a Mongo target. `username` / `password` are intentionally not\n * required: `mongodb-memory-server` and many production deployments run\n * without auth (or carry credentials inline in the `connectionString` URI).\n * @param config MongoDB configuration object\n * @returns True iff `connectionString`, `database`, and `domain` are all set\n */\nexport const hasMongoConfig = (\n config?: MongoConfig,\n): config is MongoConfig & { connectionString: string; database: string; domain: string } => {\n if (isUndefined(config)) return false\n return (\n isDefined(config.connectionString)\n && isDefined(config.database)\n && isDefined(config.domain)\n )\n}\n\n/** MongoConfigZod constant. */\nexport const MongoConfigZod = z.object({\n // TODO: Create from other arguments\n connectionString: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB connection string',\n title: 'storage.mongo.connectionString',\n type: 'string',\n }),\n database: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB database name',\n title: 'storage.mongo.database',\n type: 'string',\n }),\n domain: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB domain',\n title: 'storage.mongo.domain',\n type: 'string',\n }),\n password: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB password',\n title: 'storage.mongo.password',\n type: 'string',\n }),\n username: z.string().nonempty().optional().register(globalRegistry, {\n description: 'MongoDB username',\n title: 'storage.mongo.username',\n type: 'string',\n }),\n})\n\n/** MongoConfig type. */\nexport type MongoConfig = z.infer<typeof MongoConfigZod>\n", "import { globalRegistry, z } from 'zod'\n\nimport { MongoConfigZod } from './driver/index.ts'\n\n/** StorageConfigZod constant. */\nexport const StorageConfigZod = z.object({\n mongo: MongoConfigZod.optional().describe('Configuration for the MongoD storage driver'),\n root: z.string().optional().register(globalRegistry, {\n description: 'Root directory for local storage',\n title: 'storage.root',\n type: 'string',\n }),\n}).describe('Storage configuration options')\n\n/** StorageConfig type. */\nexport type StorageConfig = z.infer<typeof StorageConfigZod>\n", "import { globalRegistry, z } from 'zod'\n\n/** DefaultMetricsScrapePorts constant. */\nexport const DefaultMetricsScrapePorts = {\n api: 9465,\n bridge: 9468,\n mempool: 9466,\n producer: 9464,\n rewardRedemptionApi: 9467,\n}\n\n/** MetricsScrapeConfigZod constant. */\nexport const MetricsScrapeConfigZod = z.object({\n path: z.string().default('/metrics').register(globalRegistry, {\n default: '/metrics',\n description: 'Path for the metrics scrape endpoint',\n title: 'telemetry.metrics.scrape.path',\n type: 'string',\n }),\n port: z.coerce.number().int().positive().optional().register(globalRegistry, {\n description: 'Port for the metrics scrape endpoint',\n title: 'telemetry.metrics.scrape.port',\n type: 'number',\n }),\n}).describe('Metrics scrape configuration')\n\n/** MetricsConfigZod constant. */\nexport const MetricsConfigZod = z.object({ scrape: MetricsScrapeConfigZod }).describe('Metrics configuration options')\n\n/** OpenTelemetryConfigZod constant. */\nexport const OpenTelemetryConfigZod = z.object({\n // OpenTelemetry options\n otlpEndpoint: z.url().optional().register(globalRegistry, {\n description: 'OTLP endpoint for exporting telemetry data',\n title: 'telemetry.otel.otlpEndpoint',\n type: 'string',\n }),\n})\n\n/** TelemetryConfigZod constant. */\nexport const TelemetryConfigZod = z.object({\n // Metrics configuration\n metrics: MetricsConfigZod.optional().describe('Metrics configuration'),\n // OpenTelemetry configuration\n otel: OpenTelemetryConfigZod.optional().describe('OpenTelemetry configuration'),\n}).describe('Telemetry configuration options')\n\n/** TelemetryConfig type. */\nexport type TelemetryConfig = z.infer<typeof TelemetryConfigZod>\n", "import { AddressZod } from '@xylabs/sdk-js'\nimport { globalRegistry, z } from 'zod'\n\nimport { DEFAULT_BACKOFF_MS, DEFAULT_MIN_CANDIDATES } from '../primitives/index.ts'\n\n/** ValidationConfigZod constant. */\nexport const ValidationConfigZod = z.object({\n allowedRewardRedeemers: z.array(AddressZod).optional().register(globalRegistry, {\n description: 'List of allowed reward redeemer addresses, if undefined anyone can participate',\n title: 'allowedRewardRedeemers',\n type: 'array',\n }),\n allowedRewardEscrowAccountSigners: z.array(AddressZod).optional().register(globalRegistry, {\n description: 'List of allowed reward escrow account signer addresses, if undefined anyone can participate',\n title: 'allowedRewardEscrowAccountSigners',\n type: 'array',\n }),\n minCandidates: z.coerce.number().default(DEFAULT_MIN_CANDIDATES).register(globalRegistry, {\n default: DEFAULT_MIN_CANDIDATES,\n description: 'Minimum number of uncle candidates before selecting the best uncle',\n title: 'validation.minCandidates',\n type: 'number',\n }),\n backoffMs: z.coerce.number().default(DEFAULT_BACKOFF_MS).register(globalRegistry, {\n default: DEFAULT_BACKOFF_MS,\n description: 'Back-off timeout in ms. If head age exceeds this, minCandidates is ignored',\n title: 'validation.backoffMs',\n type: 'number',\n }),\n})\n\n/** ValidationConfig type. */\nexport type ValidationConfig = z.infer<typeof ValidationConfigZod>\n", "import type { SignedHydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol-lib'\n\nimport { scoreUncle } from './scoreUncle.ts'\n\n/** Default minimum number of uncle candidates before selecting. */\nexport const DEFAULT_MIN_CANDIDATES = 1\n\n/** Default back-off timeout in milliseconds. If the head has not changed for this long, minCandidates is ignored. */\nexport const DEFAULT_BACKOFF_MS = 120_000\n\n/** Options for findBestUncle block selection. */\nexport interface FindBestUncleOptions {\n /** Back-off timeout in ms. If head age exceeds this, minCandidates is ignored. Default: 120_000. */\n backoffMs?: number\n /** Minimum number of uncle candidates before selecting. Default: 1. */\n minCandidates?: number\n /** Current timestamp in ms. Injectable for testing. Default: Date.now(). */\n now?: number\n}\n\n/** Selects the best uncle chain from candidates using Proof of Perfect scoring. */\nexport function findBestUncle(\n finalizedWindowedChain: SignedHydratedBlockWithHashMeta[],\n uncles: SignedHydratedBlockWithHashMeta[][],\n options?: FindBestUncleOptions,\n): SignedHydratedBlockWithHashMeta[] | undefined {\n if (uncles.length === 0) return undefined\n\n const minCandidates = options?.minCandidates ?? DEFAULT_MIN_CANDIDATES\n const backoffMs = options?.backoffMs ?? DEFAULT_BACKOFF_MS\n const now = options?.now ?? Date.now()\n\n if (uncles.length < minCandidates) {\n const headEpoch = finalizedWindowedChain.at(-1)?.[0].$epoch ?? 0\n const headAge = now - headEpoch\n if (headAge < backoffMs) {\n return undefined\n }\n }\n\n const scores = uncles.map(uncle => ([scoreUncle(finalizedWindowedChain, uncle), uncle] as const)).toSorted((a, b) => b[0] - a[0])\n return scores[0]?.[1]\n}\n", "import { z } from 'zod/mini'\n\nimport { ActorConfigZod } from './Actor.ts'\n\n/** ActorsConfigZod constant. */\nexport const ActorsConfigZod = z._default(\n z.array(z.looseObject(ActorConfigZod.shape)).check(z.describe('Actor-specific configurations that override the base configuration when the actor is running')),\n [],\n)\n\n/** ActorsConfig type. */\nexport type ActorsConfig = z.infer<typeof ActorsConfigZod>\n", "import { globalRegistry, z } from 'zod/mini'\n\nimport { ActorConfigZod } from './Actor.ts'\nimport { ActorsConfigZod } from './Actors.ts'\nimport { BaseConfigZod } from './Base.ts'\nimport type { DeepPartial } from './DeepPartial.ts'\n\n/** ConfigZod constant. */\nexport const ConfigZod = z.extend(BaseConfigZod, {\n actors: ActorsConfigZod,\n healthCheckPort: z.optional(z.coerce.number()).register(globalRegistry, {\n description: 'Port for the system-wide health, readiness, and liveness endpoints (/healthz, /livez, /readyz). Set to 0 to disable.',\n title: 'healthCheckPort',\n type: 'number',\n }),\n}).check(z.describe('The complete configuration for the protocol, including global settings and actor-specific overrides'))\n\n/** Config type. */\nexport type Config = z.infer<typeof ConfigZod>\n\n/** ResolveConfig helper function. */\nexport function resolveConfig(\n config: DeepPartial<Config>,\n) {\n const parsedConfig = ConfigZod.parse(config)\n const {\n actors, healthCheckPort: _healthCheckPort, ...rootConfig\n } = parsedConfig\n parsedConfig.actors = actors.map((actorConfig: z.infer<typeof ActorConfigZod>) => {\n return z.looseObject(ActorConfigZod.shape).parse({ ...rootConfig, ...actorConfig })\n })\n return parsedConfig\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,aAAAA,YAAW,cAAc;AAClC,SAAS,mBAAmB;AAC5B,SAAS,KAAAC,WAAS;;;ACFlB;AAAA,EACE,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,OACvB;AACP,SAAS,kBAAAC,kBAAgB,KAAAC,WAAS;;;ACHlC,SAAS,KAAAC,WAAS;;;ACAlB,SAAS,YAAY,cAAc;AACnC,SAAS,gBAAgB,SAAS;AAG3B,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,IAAI,EAAE,SAAS,MAAM,EAClB,SAAS,gBAAgB;AAAA,IACxB,aACA;AAAA,IACA,OAAO;AAAA,IACP,MAAM;AAAA,EACR,CAAC;AAAA,EACH,sBAAsB,EAAE,SAAS,UAAU,EACxC,SAAS,gBAAgB;AAAA,IACxB,aACA;AAAA,IACA,OAAO;AAAA,IACP,MAAM;AAAA,EACR,CAAC;AACL,CAAC;;;ACnBD,SAAS,KAAAC,UAAS;;;ACAlB,SAAS,kBAAAC,iBAAgB,KAAAC,UAAS;;;ACAlC,SAAS,kBAAAC,iBAAgB,KAAAC,UAAS;AAG3B,IAAM,8BAA8BA,GAAE,OAAO;AAAA,EAClD,QAAQA,GAAE,OAAO,EAAE,SAASD,iBAAgB;AAAA,IAC1C,aAAa;AAAA,IACb,MAAM;AAAA,EACR,CAAC;AACH,CAAC,EAAE,SAAS,2CAA2C;;;ADHhD,IAAM,wBAA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AACjE,QAAIE,WAAU,OAAO,KAAK,OAAO,YAAY,UAAU;AACrD,aAAOC,IAAE,YAAY,UAAU,KAAK,EAAE,MAAM,OAAO;AAAA,IACrD;AAAA,EACF;AACA,SAAO,UAAU,MAAM,CAAC,CAAC;AAC3B;",
|
|
6
|
+
"names": ["isDefined", "z", "zodAsFactory", "zodIsFactory", "zodToFactory", "globalRegistry", "z", "z", "z", "globalRegistry", "z", "globalRegistry", "z", "z", "globalRegistry", "globalRegistry", "z", "z", "globalRegistry", "z", "globalRegistry", "z", "globalRegistry", "z", "z", "z", "z", "globalRegistry", "z", "globalRegistry", "z", "z", "globalRegistry", "globalRegistry", "z", "z", "globalRegistry", "globalRegistry", "z", "z", "globalRegistry", "AddressZod", "globalRegistry", "z", "z", "AddressZod", "globalRegistry", "z", "z", "globalRegistry", "zodIsFactory", "zodAsFactory", "zodToFactory", "z", "z", "globalRegistry", "z", "z", "globalRegistry", "isDefined", "z"]
|
|
7
7
|
}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -477,12 +477,12 @@ import {
|
|
|
477
477
|
PayloadZod,
|
|
478
478
|
WithStorageMetaZod
|
|
479
479
|
} from "@xyo-network/sdk-js";
|
|
480
|
-
import { z } from "zod";
|
|
480
|
+
import { z } from "zod/mini";
|
|
481
481
|
var BoundWitnessWithStorageMetaZod = WithStorageMetaZod(BoundWitnessZod);
|
|
482
482
|
var asBoundWitnessWithStorageMeta = zodAsFactory(BoundWitnessWithStorageMetaZod, "asBoundWitnessWithStorageMeta");
|
|
483
483
|
var HydratedBoundWitnessWithStorageMetaZod = z.tuple([
|
|
484
484
|
BoundWitnessWithStorageMetaZod,
|
|
485
|
-
z.array(WithStorageMetaZod(PayloadZod).
|
|
485
|
+
z.array(z.looseObject(WithStorageMetaZod(PayloadZod).shape))
|
|
486
486
|
]);
|
|
487
487
|
var asHydratedBoundWitnessWithStorageMeta = zodAsFactory(
|
|
488
488
|
HydratedBoundWitnessWithStorageMetaZod,
|
|
@@ -1147,21 +1147,21 @@ import {
|
|
|
1147
1147
|
zodIsFactory as zodIsFactory2,
|
|
1148
1148
|
zodToFactory as zodToFactory2
|
|
1149
1149
|
} from "@xylabs/sdk-js";
|
|
1150
|
-
import { globalRegistry as globalRegistry12, z as z17 } from "zod";
|
|
1150
|
+
import { globalRegistry as globalRegistry12, z as z17 } from "zod/mini";
|
|
1151
1151
|
|
|
1152
1152
|
// src/config/Base.ts
|
|
1153
|
-
import { z as z16 } from "zod";
|
|
1153
|
+
import { z as z16 } from "zod/mini";
|
|
1154
1154
|
|
|
1155
1155
|
// src/config/Chain.ts
|
|
1156
1156
|
import { AddressZod, HexZod } from "@xylabs/sdk-js";
|
|
1157
|
-
import { globalRegistry, z as z2 } from "zod";
|
|
1157
|
+
import { globalRegistry, z as z2 } from "zod/mini";
|
|
1158
1158
|
var ChainConfigZod = z2.object({
|
|
1159
|
-
id:
|
|
1159
|
+
id: z2.optional(HexZod).register(globalRegistry, {
|
|
1160
1160
|
description: "The unique identifier for the chain. Should be the staking contract address for contract-backed chains.",
|
|
1161
1161
|
title: "chain.id",
|
|
1162
1162
|
type: "string"
|
|
1163
1163
|
}),
|
|
1164
|
-
genesisRewardAddress:
|
|
1164
|
+
genesisRewardAddress: z2.optional(AddressZod).register(globalRegistry, {
|
|
1165
1165
|
description: "Address to send the initial genesis rewards to, if a new chain is being created.",
|
|
1166
1166
|
title: "chain.genesisRewardAddress",
|
|
1167
1167
|
type: "Address"
|
|
@@ -2341,38 +2341,28 @@ var ValidationConfigZod = z15.object({
|
|
|
2341
2341
|
|
|
2342
2342
|
// src/config/Base.ts
|
|
2343
2343
|
var BaseConfigZod = z16.object({
|
|
2344
|
-
chain:
|
|
2345
|
-
dataLake:
|
|
2346
|
-
evm:
|
|
2347
|
-
log:
|
|
2348
|
-
providers:
|
|
2349
|
-
remote:
|
|
2350
|
-
storage:
|
|
2351
|
-
telemetry:
|
|
2352
|
-
validation:
|
|
2344
|
+
chain: z16._default(ChainConfigZod, ChainConfigZod.parse({})).check(z16.describe("Configuration for the chain")),
|
|
2345
|
+
dataLake: z16.optional(DataLakeConfigZod).check(z16.describe("Configuration for data lakes")),
|
|
2346
|
+
evm: z16._default(EvmConfigZod, EvmConfigZod.parse({})).check(z16.describe("Configuration for EVM-backed services")),
|
|
2347
|
+
log: z16._default(LogConfigZod, LogConfigZod.parse({})).check(z16.describe("Configuration for logging")),
|
|
2348
|
+
providers: z16._default(ProvidersConfigZod, ProvidersConfigZod.parse([])).check(z16.describe("Configuration for providers")),
|
|
2349
|
+
remote: z16._default(RemoteConfigZod, RemoteConfigZod.parse({})).check(z16.describe("Configuration for remote services")),
|
|
2350
|
+
storage: z16._default(StorageConfigZod, StorageConfigZod.parse({})).check(z16.describe("Configuration for the storage")),
|
|
2351
|
+
telemetry: z16._default(TelemetryConfigZod, TelemetryConfigZod.parse({})).check(z16.describe("Configuration for telemetry")),
|
|
2352
|
+
validation: z16._default(ValidationConfigZod, ValidationConfigZod.parse({})).check(z16.describe("Configuration for validation"))
|
|
2353
2353
|
});
|
|
2354
2354
|
|
|
2355
2355
|
// src/config/Actor.ts
|
|
2356
|
-
var AccountPathZod = z17.string().regex(
|
|
2356
|
+
var AccountPathZod = z17.string().check(z17.regex(
|
|
2357
2357
|
/^(m(\/\d+'?)+|\d+'?(\/\d+'?)*)$/,
|
|
2358
2358
|
`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".`
|
|
2359
|
-
);
|
|
2360
|
-
var ActorConfigZod =
|
|
2359
|
+
));
|
|
2360
|
+
var ActorConfigZod = z17.extend(BaseConfigZod, {
|
|
2361
2361
|
name: z17.string(),
|
|
2362
|
-
accountPath:
|
|
2362
|
+
accountPath: z17.optional(AccountPathZod).register(globalRegistry12, {
|
|
2363
2363
|
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.',
|
|
2364
2364
|
title: "accountPath",
|
|
2365
2365
|
type: "string"
|
|
2366
|
-
}),
|
|
2367
|
-
/**
|
|
2368
|
-
* @deprecated Use the top-level `healthCheckPort` on `ConfigZod` instead.
|
|
2369
|
-
* The system-wide health server covers all actors in a single process; per-actor
|
|
2370
|
-
* health ports will be removed in a future major release.
|
|
2371
|
-
*/
|
|
2372
|
-
healthCheckPort: z17.coerce.number().optional().register(globalRegistry12, {
|
|
2373
|
-
description: "[DEPRECATED \u2014 use top-level healthCheckPort] Per-actor health server port.",
|
|
2374
|
-
title: "actor.healthCheckPort",
|
|
2375
|
-
type: "number"
|
|
2376
2366
|
})
|
|
2377
2367
|
});
|
|
2378
2368
|
var isActorConfig = zodIsFactory2(ActorConfigZod);
|
|
@@ -2380,24 +2370,31 @@ var asActorConfig = zodAsFactory3(ActorConfigZod, "asActorConfig");
|
|
|
2380
2370
|
var toActorConfig = zodToFactory2(ActorConfigZod, "toActorConfig");
|
|
2381
2371
|
|
|
2382
2372
|
// src/config/Actors.ts
|
|
2383
|
-
import z18 from "zod";
|
|
2384
|
-
var ActorsConfigZod = z18.
|
|
2373
|
+
import { z as z18 } from "zod/mini";
|
|
2374
|
+
var ActorsConfigZod = z18._default(
|
|
2375
|
+
z18.array(z18.looseObject(ActorConfigZod.shape)).check(z18.describe("Actor-specific configurations that override the base configuration when the actor is running")),
|
|
2376
|
+
[]
|
|
2377
|
+
);
|
|
2385
2378
|
|
|
2386
2379
|
// src/config/Config.ts
|
|
2387
|
-
import { globalRegistry as globalRegistry13, z as z19 } from "zod";
|
|
2388
|
-
var ConfigZod =
|
|
2380
|
+
import { globalRegistry as globalRegistry13, z as z19 } from "zod/mini";
|
|
2381
|
+
var ConfigZod = z19.extend(BaseConfigZod, {
|
|
2389
2382
|
actors: ActorsConfigZod,
|
|
2390
|
-
healthCheckPort: z19.coerce.number()
|
|
2383
|
+
healthCheckPort: z19.optional(z19.coerce.number()).register(globalRegistry13, {
|
|
2391
2384
|
description: "Port for the system-wide health, readiness, and liveness endpoints (/healthz, /livez, /readyz). Set to 0 to disable.",
|
|
2392
2385
|
title: "healthCheckPort",
|
|
2393
2386
|
type: "number"
|
|
2394
2387
|
})
|
|
2395
|
-
}).describe("The complete configuration for the protocol, including global settings and actor-specific overrides");
|
|
2388
|
+
}).check(z19.describe("The complete configuration for the protocol, including global settings and actor-specific overrides"));
|
|
2396
2389
|
function resolveConfig(config) {
|
|
2397
2390
|
const parsedConfig = ConfigZod.parse(config);
|
|
2398
|
-
const {
|
|
2391
|
+
const {
|
|
2392
|
+
actors,
|
|
2393
|
+
healthCheckPort: _healthCheckPort,
|
|
2394
|
+
...rootConfig
|
|
2395
|
+
} = parsedConfig;
|
|
2399
2396
|
parsedConfig.actors = actors.map((actorConfig) => {
|
|
2400
|
-
return ActorConfigZod.
|
|
2397
|
+
return z19.looseObject(ActorConfigZod.shape).parse({ ...rootConfig, ...actorConfig });
|
|
2401
2398
|
});
|
|
2402
2399
|
return parsedConfig;
|
|
2403
2400
|
}
|
|
@@ -2408,15 +2405,15 @@ import {
|
|
|
2408
2405
|
zodIsFactory as zodIsFactory3,
|
|
2409
2406
|
zodToFactory as zodToFactory3
|
|
2410
2407
|
} from "@xylabs/sdk-js";
|
|
2411
|
-
import { globalRegistry as globalRegistry14, z as z20 } from "zod";
|
|
2412
|
-
var HostActorConfigZod =
|
|
2413
|
-
host: z20.string()
|
|
2408
|
+
import { globalRegistry as globalRegistry14, z as z20 } from "zod/mini";
|
|
2409
|
+
var HostActorConfigZod = z20.extend(ActorConfigZod, {
|
|
2410
|
+
host: z20._default(z20.string(), "localhost").register(globalRegistry14, {
|
|
2414
2411
|
default: "localhost",
|
|
2415
2412
|
description: "Host for the Actor",
|
|
2416
2413
|
title: "host",
|
|
2417
2414
|
type: "string"
|
|
2418
2415
|
}),
|
|
2419
|
-
port: z20.coerce.number()
|
|
2416
|
+
port: z20._default(z20.coerce.number(), 8080).register(globalRegistry14, {
|
|
2420
2417
|
default: 8080,
|
|
2421
2418
|
description: "Port for the Actor",
|
|
2422
2419
|
title: "port",
|
|
@@ -2464,6 +2461,7 @@ import {
|
|
|
2464
2461
|
zodIsFactory as zodIsFactory5,
|
|
2465
2462
|
zodToFactory as zodToFactory5
|
|
2466
2463
|
} from "@xylabs/sdk-js";
|
|
2464
|
+
import { z as z23 } from "zod/mini";
|
|
2467
2465
|
|
|
2468
2466
|
// src/model/CreatableProviderContext.zod.ts
|
|
2469
2467
|
import {
|
|
@@ -2472,17 +2470,17 @@ import {
|
|
|
2472
2470
|
zodToFactory as zodToFactory4
|
|
2473
2471
|
} from "@xylabs/sdk-js";
|
|
2474
2472
|
import { CachingContextZod } from "@xyo-network/xl1-protocol-lib";
|
|
2475
|
-
import { z as z22 } from "zod";
|
|
2473
|
+
import { z as z22 } from "zod/mini";
|
|
2476
2474
|
var RuntimeStatusMonitorZod = z22.custom((val) => val && typeof val === "object");
|
|
2477
2475
|
var ProviderFactoryLocatorZod = z22.lazy(() => z22.custom((val) => val && typeof val === "object" && "context" in val && "registry" in val));
|
|
2478
|
-
var BaseConfigContextZod =
|
|
2479
|
-
config: BaseConfigZod.
|
|
2480
|
-
locator:
|
|
2476
|
+
var BaseConfigContextZod = z22.extend(CachingContextZod, {
|
|
2477
|
+
config: z22.looseObject(BaseConfigZod.shape),
|
|
2478
|
+
locator: z22.optional(ProviderFactoryLocatorZod)
|
|
2481
2479
|
});
|
|
2482
|
-
var CreatableProviderContextZod = z22.lazy(() =>
|
|
2483
|
-
_id: z22.
|
|
2480
|
+
var CreatableProviderContextZod = z22.lazy(() => z22.extend(BaseConfigContextZod, {
|
|
2481
|
+
_id: z22.optional(z22.string()),
|
|
2484
2482
|
locator: ProviderFactoryLocatorZod,
|
|
2485
|
-
statusReporter:
|
|
2483
|
+
statusReporter: z22.optional(RuntimeStatusMonitorZod)
|
|
2486
2484
|
}));
|
|
2487
2485
|
var isBaseConfigContext = zodIsFactory4(BaseConfigContextZod);
|
|
2488
2486
|
var asBaseConfigContext = zodAsFactory5(BaseConfigContextZod, "asBaseConfigContext");
|
|
@@ -2922,7 +2920,7 @@ var bundle2 = (root, transaction) => {
|
|
|
2922
2920
|
};
|
|
2923
2921
|
|
|
2924
2922
|
// src/context/Actor.ts
|
|
2925
|
-
var ActorConfigContext =
|
|
2923
|
+
var ActorConfigContext = z23.extend(BaseConfigContextZod, { config: ActorConfigZod });
|
|
2926
2924
|
var isActorConfigContext = zodIsFactory5(ActorConfigContext);
|
|
2927
2925
|
var asActorConfigContext = zodAsFactory6(ActorConfigContext, "asActorConfigContext");
|
|
2928
2926
|
var toActorConfigContext = zodToFactory5(ActorConfigContext, "toActorConfigContext");
|
|
@@ -3312,7 +3310,8 @@ import {
|
|
|
3312
3310
|
zodIsFactory as zodIsFactory6,
|
|
3313
3311
|
zodToFactory as zodToFactory6
|
|
3314
3312
|
} from "@xylabs/sdk-js";
|
|
3315
|
-
|
|
3313
|
+
import { z as z24 } from "zod/mini";
|
|
3314
|
+
var HostActorConfigContext = z24.extend(BaseConfigContextZod, { config: HostActorConfigZod });
|
|
3316
3315
|
var isHostActorConfigContext = zodIsFactory6(HostActorConfigContext);
|
|
3317
3316
|
var asHostActorConfigContext = zodAsFactory7(HostActorConfigContext, "asHostActorConfigContext");
|
|
3318
3317
|
var toHostActorConfigContext = zodToFactory6(HostActorConfigContext, "toHostActorConfigContext");
|
|
@@ -3353,26 +3352,26 @@ import {
|
|
|
3353
3352
|
asSchema as asSchema2,
|
|
3354
3353
|
isPayloadOfZodType
|
|
3355
3354
|
} from "@xyo-network/sdk-js";
|
|
3356
|
-
import { z as
|
|
3355
|
+
import { z as z26 } from "zod";
|
|
3357
3356
|
|
|
3358
3357
|
// src/eip-712/Types.ts
|
|
3359
|
-
import { z as
|
|
3360
|
-
var TypedDataDomainZod =
|
|
3361
|
-
name:
|
|
3362
|
-
version:
|
|
3363
|
-
chainId:
|
|
3364
|
-
verifyingContract:
|
|
3365
|
-
salt:
|
|
3358
|
+
import { z as z25 } from "zod";
|
|
3359
|
+
var TypedDataDomainZod = z25.object({
|
|
3360
|
+
name: z25.string().nullable().optional(),
|
|
3361
|
+
version: z25.string().nullable().optional(),
|
|
3362
|
+
chainId: z25.union([z25.string(), z25.number(), z25.bigint()]).nullable().optional(),
|
|
3363
|
+
verifyingContract: z25.string().nullable().optional(),
|
|
3364
|
+
salt: z25.union([z25.string(), z25.instanceof(Uint8Array)]).nullable().optional()
|
|
3366
3365
|
});
|
|
3367
|
-
var TypedDataFieldZod =
|
|
3368
|
-
name:
|
|
3369
|
-
type:
|
|
3366
|
+
var TypedDataFieldZod = z25.object({
|
|
3367
|
+
name: z25.string(),
|
|
3368
|
+
type: z25.string()
|
|
3370
3369
|
});
|
|
3371
|
-
var TypedDataTypesZod =
|
|
3372
|
-
var TypedDataValueZod =
|
|
3370
|
+
var TypedDataTypesZod = z25.record(z25.string(), z25.array(TypedDataFieldZod));
|
|
3371
|
+
var TypedDataValueZod = z25.record(z25.string(), z25.any());
|
|
3373
3372
|
|
|
3374
3373
|
// src/eip-712/Payloads/EIP712Data.ts
|
|
3375
|
-
var EIP712DataPayloadFieldsZod =
|
|
3374
|
+
var EIP712DataPayloadFieldsZod = z26.object({
|
|
3376
3375
|
domain: TypedDataDomainZod,
|
|
3377
3376
|
types: TypedDataTypesZod,
|
|
3378
3377
|
values: TypedDataValueZod
|
|
@@ -3390,11 +3389,11 @@ import {
|
|
|
3390
3389
|
asSchema as asSchema3,
|
|
3391
3390
|
isPayloadOfZodType as isPayloadOfZodType2
|
|
3392
3391
|
} from "@xyo-network/sdk-js";
|
|
3393
|
-
import { z as
|
|
3394
|
-
var EIP712SignaturePayloadFieldsZod =
|
|
3395
|
-
address:
|
|
3392
|
+
import { z as z27 } from "zod";
|
|
3393
|
+
var EIP712SignaturePayloadFieldsZod = z27.object({
|
|
3394
|
+
address: z27.string(),
|
|
3396
3395
|
hash: HashZod,
|
|
3397
|
-
signature:
|
|
3396
|
+
signature: z27.string()
|
|
3398
3397
|
});
|
|
3399
3398
|
var EIP712SignaturePayloadSchema = asSchema3("network.xyo.chains.ethereum.eip712.signature", true);
|
|
3400
3399
|
var isEIP712SignaturePayload = isPayloadOfZodType2(
|
|
@@ -4132,12 +4131,12 @@ var HydratedCache = class {
|
|
|
4132
4131
|
};
|
|
4133
4132
|
|
|
4134
4133
|
// src/utils/isZodError.ts
|
|
4135
|
-
import { z as
|
|
4134
|
+
import { z as z28 } from "zod";
|
|
4136
4135
|
var isZodError = (error) => {
|
|
4137
|
-
return error instanceof
|
|
4136
|
+
return error instanceof z28.ZodError;
|
|
4138
4137
|
};
|
|
4139
4138
|
var prettifyZodError = (error) => {
|
|
4140
|
-
return
|
|
4139
|
+
return z28.prettifyError(error);
|
|
4141
4140
|
};
|
|
4142
4141
|
|
|
4143
4142
|
// src/simple/block/SimpleBlockViewer.ts
|
|
@@ -4352,9 +4351,7 @@ SimpleBlockViewer = __decorateClass([
|
|
|
4352
4351
|
], SimpleBlockViewer);
|
|
4353
4352
|
|
|
4354
4353
|
// src/simple/blockReward/SimpleBlockRewardViewer.ts
|
|
4355
|
-
import {
|
|
4356
|
-
BlockRewardViewerMoniker
|
|
4357
|
-
} from "@xyo-network/xl1-protocol-lib";
|
|
4354
|
+
import { BlockRewardViewerMoniker } from "@xyo-network/xl1-protocol-lib";
|
|
4358
4355
|
var SimpleBlockRewardViewer = class extends AbstractCreatableProvider {
|
|
4359
4356
|
moniker = SimpleBlockRewardViewer.defaultMoniker;
|
|
4360
4357
|
allowedRewardForBlock(block) {
|
|
@@ -4508,10 +4505,7 @@ SimpleBlockValidationViewer = __decorateClass([
|
|
|
4508
4505
|
import {
|
|
4509
4506
|
assertEx as assertEx35
|
|
4510
4507
|
} from "@xylabs/sdk-js";
|
|
4511
|
-
import {
|
|
4512
|
-
ChainContractViewerMoniker as ChainContractViewerMoniker2,
|
|
4513
|
-
FinalizationViewerMoniker as FinalizationViewerMoniker2
|
|
4514
|
-
} from "@xyo-network/xl1-protocol-lib";
|
|
4508
|
+
import { ChainContractViewerMoniker as ChainContractViewerMoniker2, FinalizationViewerMoniker as FinalizationViewerMoniker2 } from "@xyo-network/xl1-protocol-lib";
|
|
4515
4509
|
var SimpleChainContractViewer = class extends AbstractCreatableProvider {
|
|
4516
4510
|
moniker = SimpleChainContractViewer.defaultMoniker;
|
|
4517
4511
|
_finalizationViewer;
|
|
@@ -4580,15 +4574,10 @@ var SimpleXyoClient = class {
|
|
|
4580
4574
|
};
|
|
4581
4575
|
|
|
4582
4576
|
// src/simple/datalake/RestDataLakeRunner.ts
|
|
4583
|
-
import {
|
|
4584
|
-
assertEx as assertEx36,
|
|
4585
|
-
exists as exists6
|
|
4586
|
-
} from "@xylabs/sdk-js";
|
|
4577
|
+
import { assertEx as assertEx36, exists as exists6 } from "@xylabs/sdk-js";
|
|
4587
4578
|
import { isAnyPayload as isAnyPayload7, PayloadZodLoose } from "@xyo-network/sdk-js";
|
|
4588
|
-
import {
|
|
4589
|
-
|
|
4590
|
-
} from "@xyo-network/xl1-protocol-lib";
|
|
4591
|
-
import z27 from "zod";
|
|
4579
|
+
import { DataLakeRunnerMoniker } from "@xyo-network/xl1-protocol-lib";
|
|
4580
|
+
import { z as z29 } from "zod/mini";
|
|
4592
4581
|
|
|
4593
4582
|
// src/simple/datalake/AbstractRestDataLake.ts
|
|
4594
4583
|
import { FetchClientError, FetchJsonClient } from "@xylabs/fetch";
|
|
@@ -4661,7 +4650,7 @@ var RestDataLakeRunner = class extends AbstractRestDataLake {
|
|
|
4661
4650
|
}).filter(exists6);
|
|
4662
4651
|
if (allowedItems.length > 0) {
|
|
4663
4652
|
const result = await this.client.post(`${this.params.endpoint}/insert`, allowedItems);
|
|
4664
|
-
return
|
|
4653
|
+
return z29.array(PayloadZodLoose).parse(result.data);
|
|
4665
4654
|
} else {
|
|
4666
4655
|
return [];
|
|
4667
4656
|
}
|
|
@@ -4675,9 +4664,7 @@ RestDataLakeRunner = __decorateClass([
|
|
|
4675
4664
|
], RestDataLakeRunner);
|
|
4676
4665
|
|
|
4677
4666
|
// src/simple/datalake/RestDataLakeViewer.ts
|
|
4678
|
-
import {
|
|
4679
|
-
DataLakeViewerMoniker
|
|
4680
|
-
} from "@xyo-network/xl1-protocol-lib";
|
|
4667
|
+
import { DataLakeViewerMoniker } from "@xyo-network/xl1-protocol-lib";
|
|
4681
4668
|
var RestDataLakeViewer = class extends AbstractRestDataLake {
|
|
4682
4669
|
moniker = RestDataLakeViewer.defaultMoniker;
|
|
4683
4670
|
};
|
|
@@ -4691,9 +4678,7 @@ RestDataLakeViewer = __decorateClass([
|
|
|
4691
4678
|
// src/simple/datalake/SimpleDataLakeRunner.ts
|
|
4692
4679
|
import { exists as exists7 } from "@xylabs/sdk-js";
|
|
4693
4680
|
import { isAnyPayload as isAnyPayload9, PayloadBuilder as PayloadBuilder19 } from "@xyo-network/sdk-js";
|
|
4694
|
-
import {
|
|
4695
|
-
DataLakeRunnerMoniker as DataLakeRunnerMoniker2
|
|
4696
|
-
} from "@xyo-network/xl1-protocol-lib";
|
|
4681
|
+
import { DataLakeRunnerMoniker as DataLakeRunnerMoniker2 } from "@xyo-network/xl1-protocol-lib";
|
|
4697
4682
|
|
|
4698
4683
|
// src/simple/datalake/AbstractSimpleDataLake.ts
|
|
4699
4684
|
import { isAnyPayload as isAnyPayload8 } from "@xyo-network/sdk-js";
|
|
@@ -4760,9 +4745,7 @@ SimpleDataLakeRunner = __decorateClass([
|
|
|
4760
4745
|
], SimpleDataLakeRunner);
|
|
4761
4746
|
|
|
4762
4747
|
// src/simple/datalake/SimpleDataLakeViewer.ts
|
|
4763
|
-
import {
|
|
4764
|
-
DataLakeViewerMoniker as DataLakeViewerMoniker2
|
|
4765
|
-
} from "@xyo-network/xl1-protocol-lib";
|
|
4748
|
+
import { DataLakeViewerMoniker as DataLakeViewerMoniker2 } from "@xyo-network/xl1-protocol-lib";
|
|
4766
4749
|
var SimpleDataLakeViewer = class extends AbstractSimpleDataLake {
|
|
4767
4750
|
moniker = SimpleDataLakeViewer.defaultMoniker;
|
|
4768
4751
|
};
|
|
@@ -4803,9 +4786,7 @@ SimpleFinalizationRunner = __decorateClass([
|
|
|
4803
4786
|
], SimpleFinalizationRunner);
|
|
4804
4787
|
|
|
4805
4788
|
// src/simple/finalization/SimpleFinalizationViewer.ts
|
|
4806
|
-
import {
|
|
4807
|
-
assertEx as assertEx37
|
|
4808
|
-
} from "@xylabs/sdk-js";
|
|
4789
|
+
import { assertEx as assertEx37 } from "@xylabs/sdk-js";
|
|
4809
4790
|
import {
|
|
4810
4791
|
asSignedHydratedBlockWithStorageMeta as asSignedHydratedBlockWithStorageMeta2,
|
|
4811
4792
|
ChainContractViewerMoniker as ChainContractViewerMoniker3,
|
|
@@ -5014,10 +4995,7 @@ import {
|
|
|
5014
4995
|
assertEx as assertEx39,
|
|
5015
4996
|
exists as exists8
|
|
5016
4997
|
} from "@xylabs/sdk-js";
|
|
5017
|
-
import {
|
|
5018
|
-
isPayloadBundle,
|
|
5019
|
-
PayloadBuilder as PayloadBuilder21
|
|
5020
|
-
} from "@xyo-network/sdk-js";
|
|
4998
|
+
import { isPayloadBundle, PayloadBuilder as PayloadBuilder21 } from "@xyo-network/sdk-js";
|
|
5021
4999
|
import {
|
|
5022
5000
|
BlockValidationViewerMoniker as BlockValidationViewerMoniker2,
|
|
5023
5001
|
ChainContractViewerMoniker as ChainContractViewerMoniker4,
|
|
@@ -5445,10 +5423,7 @@ import {
|
|
|
5445
5423
|
isHash as isHash2
|
|
5446
5424
|
} from "@xylabs/sdk-js";
|
|
5447
5425
|
import { isHashMeta as isHashMeta2, isPayloadBundle as isPayloadBundle2 } from "@xyo-network/sdk-js";
|
|
5448
|
-
import {
|
|
5449
|
-
MempoolViewerMoniker as MempoolViewerMoniker2,
|
|
5450
|
-
WindowedBlockViewerMoniker
|
|
5451
|
-
} from "@xyo-network/xl1-protocol-lib";
|
|
5426
|
+
import { MempoolViewerMoniker as MempoolViewerMoniker2, WindowedBlockViewerMoniker } from "@xyo-network/xl1-protocol-lib";
|
|
5452
5427
|
var DEFAULT_MEMPOOL_SELECTION_RATIO = 0.66;
|
|
5453
5428
|
var DEFAULT_DEMOTION_THRESHOLD = 3;
|
|
5454
5429
|
var DEFAULT_HANDOUT_STATS_TTL_BLOCKS = 1e3;
|
|
@@ -5817,10 +5792,7 @@ var MemoryPermissionsStore = class {
|
|
|
5817
5792
|
|
|
5818
5793
|
// src/simple/runner/SimpleXyoRunner.ts
|
|
5819
5794
|
import { PayloadBuilder as PayloadBuilder22 } from "@xyo-network/sdk-js";
|
|
5820
|
-
import {
|
|
5821
|
-
MempoolRunnerMoniker as MempoolRunnerMoniker2,
|
|
5822
|
-
XyoRunnerMoniker
|
|
5823
|
-
} from "@xyo-network/xl1-protocol-lib";
|
|
5795
|
+
import { MempoolRunnerMoniker as MempoolRunnerMoniker2, XyoRunnerMoniker } from "@xyo-network/xl1-protocol-lib";
|
|
5824
5796
|
var SimpleXyoRunner = class extends AbstractCreatableProvider {
|
|
5825
5797
|
moniker = SimpleXyoRunner.defaultMoniker;
|
|
5826
5798
|
_mempoolRunner;
|
|
@@ -5895,9 +5867,7 @@ var SimpleXyoSigner = class _SimpleXyoSigner extends AbstractCreatableProvider {
|
|
|
5895
5867
|
|
|
5896
5868
|
// src/simple/StakeEventsViewer/SimpleStakeEventsViewer.ts
|
|
5897
5869
|
import { isDefined as isDefined20 } from "@xylabs/sdk-js";
|
|
5898
|
-
import {
|
|
5899
|
-
StakeEventsViewerMoniker
|
|
5900
|
-
} from "@xyo-network/xl1-protocol-lib";
|
|
5870
|
+
import { StakeEventsViewerMoniker } from "@xyo-network/xl1-protocol-lib";
|
|
5901
5871
|
var SimpleStakeEventsViewer = class extends AbstractCreatableProvider {
|
|
5902
5872
|
moniker = SimpleStakeEventsViewer.defaultMoniker;
|
|
5903
5873
|
get positions() {
|
|
@@ -6074,13 +6044,10 @@ SimpleStakeTotalsViewer = __decorateClass([
|
|
|
6074
6044
|
// src/simple/StakeViewer/SimpleStakeViewer.ts
|
|
6075
6045
|
import {
|
|
6076
6046
|
asAddress as asAddress4,
|
|
6047
|
+
assertEx as assertEx43,
|
|
6077
6048
|
toAddress as toAddress6
|
|
6078
6049
|
} from "@xylabs/sdk-js";
|
|
6079
|
-
import {
|
|
6080
|
-
import {
|
|
6081
|
-
StakeEventsViewerMoniker as StakeEventsViewerMoniker2,
|
|
6082
|
-
StakeViewerMoniker as StakeViewerMoniker2
|
|
6083
|
-
} from "@xyo-network/xl1-protocol-lib";
|
|
6050
|
+
import { StakeEventsViewerMoniker as StakeEventsViewerMoniker2, StakeViewerMoniker as StakeViewerMoniker2 } from "@xyo-network/xl1-protocol-lib";
|
|
6084
6051
|
var SimpleStakeViewer = class extends AbstractCreatableProvider {
|
|
6085
6052
|
moniker = SimpleStakeViewer.defaultMoniker;
|
|
6086
6053
|
_chainStakeEventsViewer;
|
|
@@ -6442,10 +6409,7 @@ SimpleTransactionValidationViewer = __decorateClass([
|
|
|
6442
6409
|
], SimpleTransactionValidationViewer);
|
|
6443
6410
|
|
|
6444
6411
|
// src/simple/TransactionViewer/SimpleTransactionViewer.ts
|
|
6445
|
-
import {
|
|
6446
|
-
assertEx as assertEx46,
|
|
6447
|
-
exists as exists10
|
|
6448
|
-
} from "@xylabs/sdk-js";
|
|
6412
|
+
import { assertEx as assertEx46, exists as exists10 } from "@xylabs/sdk-js";
|
|
6449
6413
|
import { BoundWitnessSchema } from "@xyo-network/sdk-js";
|
|
6450
6414
|
import {
|
|
6451
6415
|
asSignedHydratedTransactionWithHashMeta,
|
|
@@ -6795,8 +6759,8 @@ var getUrl = (host, port) => {
|
|
|
6795
6759
|
var TODO = true;
|
|
6796
6760
|
|
|
6797
6761
|
// src/validation/schema/Mnemonic.ts
|
|
6798
|
-
import { z as
|
|
6799
|
-
var MnemonicStringZod =
|
|
6762
|
+
import { z as z30 } from "zod";
|
|
6763
|
+
var MnemonicStringZod = z30.string().transform((s) => s.trim().replaceAll(/\s+/g, " ")).refine(
|
|
6800
6764
|
(s) => [12, 15, 18, 21, 24].includes(s.split(" ").length),
|
|
6801
6765
|
{ message: "Mnemonic must contain 12, 15, 18, 21, or 24 words." }
|
|
6802
6766
|
).describe("BIP-39 mnemonic string");
|