@xyo-network/chain-orchestration 1.20.28 → 1.21.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/browser/index.mjs +423 -143
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/neutral/config/locators/basicRemoteViewerLocator.d.ts +1 -1
- package/dist/browser/neutral/config/locators/basicRemoteViewerLocator.d.ts.map +1 -1
- package/dist/browser/node/config/capabilities/Backing.d.ts +13 -0
- package/dist/browser/node/config/capabilities/Backing.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/Capability.d.ts +10 -0
- package/dist/browser/node/config/capabilities/Capability.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/ProcessSharedResources.d.ts +37 -0
- package/dist/browser/node/config/capabilities/ProcessSharedResources.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/Provider.d.ts +12 -0
- package/dist/browser/node/config/capabilities/Provider.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/XL1ResolutionContext.d.ts +18 -0
- package/dist/browser/node/config/capabilities/XL1ResolutionContext.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/backings/buildChainStoreBacking.d.ts +36 -0
- package/dist/browser/node/config/capabilities/backings/buildChainStoreBacking.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/backings/buildDlqStoreBacking.d.ts +13 -0
- package/dist/browser/node/config/capabilities/backings/buildDlqStoreBacking.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/backings/buildIndexerStoreBacking.d.ts +57 -0
- package/dist/browser/node/config/capabilities/backings/buildIndexerStoreBacking.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/backings/buildMempoolStoreBacking.d.ts +12 -0
- package/dist/browser/node/config/capabilities/backings/buildMempoolStoreBacking.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/backings/buildValidators.d.ts +14 -0
- package/dist/browser/node/config/capabilities/backings/buildValidators.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/backings/index.d.ts +6 -0
- package/dist/browser/node/config/capabilities/backings/index.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/defaultCapabilityRegistry.d.ts +8 -0
- package/dist/browser/node/config/capabilities/defaultCapabilityRegistry.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/descriptors.d.ts +19 -0
- package/dist/browser/node/config/capabilities/descriptors.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/index.d.ts +11 -0
- package/dist/browser/node/config/capabilities/index.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/locatorFromActorNeeds.d.ts +55 -0
- package/dist/browser/node/config/capabilities/locatorFromActorNeeds.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/networkTier3Descriptors.d.ts +14 -0
- package/dist/browser/node/config/capabilities/networkTier3Descriptors.d.ts.map +1 -0
- package/dist/browser/node/config/capabilities/resolveProviders.d.ts +9 -0
- package/dist/browser/node/config/capabilities/resolveProviders.d.ts.map +1 -0
- package/dist/browser/node/config/index.d.ts +1 -0
- package/dist/browser/node/config/index.d.ts.map +1 -1
- package/dist/browser/node/config/locators/actors/apiLocatorFromConfig.d.ts +1 -1
- package/dist/browser/node/config/locators/actors/apiLocatorFromConfig.d.ts.map +1 -1
- package/dist/browser/node/config/locators/actors/bridgeLocatorFromConfig.d.ts.map +1 -1
- package/dist/browser/node/config/locators/actors/producerLocatorFromConfig.d.ts.map +1 -1
- package/dist/browser/node/config/locators/actors/rewardRedemptionLocatorFromConfig.d.ts.map +1 -1
- package/dist/browser/node/config/locators/basicRemoteViewerLocator.d.ts +1 -1
- package/dist/browser/node/config/locators/basicRemoteViewerLocator.d.ts.map +1 -1
- package/dist/browser/node/config/locators/buildStatelessApiLocator.d.ts +20 -0
- package/dist/browser/node/config/locators/buildStatelessApiLocator.d.ts.map +1 -0
- package/dist/browser/node/config/locators/index.d.ts +1 -0
- package/dist/browser/node/config/locators/index.d.ts.map +1 -1
- package/dist/browser/node/config/locators/localLocatorFromConfig.d.ts +10 -2
- package/dist/browser/node/config/locators/localLocatorFromConfig.d.ts.map +1 -1
- package/dist/browser/node/config/locators/locatorsFromConfig.d.ts.map +1 -1
- package/dist/browser/node/config/tryParseConfig.d.ts +3 -2
- package/dist/browser/node/config/tryParseConfig.d.ts.map +1 -1
- package/dist/browser/shared/actor/index.d.ts +1 -1
- package/dist/browser/shared/actor/index.d.ts.map +1 -1
- package/dist/browser/shared/actor/v3/ActorV3.d.ts +102 -0
- package/dist/browser/shared/actor/v3/ActorV3.d.ts.map +1 -0
- package/dist/browser/shared/actor/v3/index.d.ts +2 -0
- package/dist/browser/shared/actor/v3/index.d.ts.map +1 -0
- package/dist/browser/shared/command/index.d.ts +2 -0
- package/dist/browser/shared/command/index.d.ts.map +1 -0
- package/dist/browser/shared/command/types.d.ts +8 -0
- package/dist/browser/shared/command/types.d.ts.map +1 -0
- package/dist/browser/shared/config/actors/Api.d.ts +22 -10
- package/dist/browser/shared/config/actors/Api.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Bridge.d.ts +22 -10
- package/dist/browser/shared/config/actors/Bridge.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Finalizer.d.ts +16 -10
- package/dist/browser/shared/config/actors/Finalizer.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Mempool.d.ts +10 -10
- package/dist/browser/shared/config/actors/Producer.d.ts +12 -12
- package/dist/browser/shared/config/actors/Producer.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/RewardRedemption.d.ts +10 -10
- package/dist/browser/shared/config/mergeConfig.d.ts +2 -1
- package/dist/browser/shared/config/mergeConfig.d.ts.map +1 -1
- package/dist/browser/shared/index.d.ts +1 -0
- package/dist/browser/shared/index.d.ts.map +1 -1
- package/dist/browser/shared/init/index.d.ts +0 -1
- package/dist/browser/shared/init/index.d.ts.map +1 -1
- package/dist/browser/shared/init/initWallet.d.ts +8 -1
- package/dist/browser/shared/init/initWallet.d.ts.map +1 -1
- package/dist/browser/shared/orchestrator/Orchestrator.d.ts +16 -3
- package/dist/browser/shared/orchestrator/Orchestrator.d.ts.map +1 -1
- package/dist/neutral/index.mjs +423 -143
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/neutral/config/locators/basicRemoteViewerLocator.d.ts +1 -1
- package/dist/neutral/neutral/config/locators/basicRemoteViewerLocator.d.ts.map +1 -1
- package/dist/neutral/node/config/capabilities/Backing.d.ts +13 -0
- package/dist/neutral/node/config/capabilities/Backing.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/Capability.d.ts +10 -0
- package/dist/neutral/node/config/capabilities/Capability.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/ProcessSharedResources.d.ts +37 -0
- package/dist/neutral/node/config/capabilities/ProcessSharedResources.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/Provider.d.ts +12 -0
- package/dist/neutral/node/config/capabilities/Provider.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/XL1ResolutionContext.d.ts +18 -0
- package/dist/neutral/node/config/capabilities/XL1ResolutionContext.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/backings/buildChainStoreBacking.d.ts +36 -0
- package/dist/neutral/node/config/capabilities/backings/buildChainStoreBacking.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/backings/buildDlqStoreBacking.d.ts +13 -0
- package/dist/neutral/node/config/capabilities/backings/buildDlqStoreBacking.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/backings/buildIndexerStoreBacking.d.ts +57 -0
- package/dist/neutral/node/config/capabilities/backings/buildIndexerStoreBacking.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/backings/buildMempoolStoreBacking.d.ts +12 -0
- package/dist/neutral/node/config/capabilities/backings/buildMempoolStoreBacking.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/backings/buildValidators.d.ts +14 -0
- package/dist/neutral/node/config/capabilities/backings/buildValidators.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/backings/index.d.ts +6 -0
- package/dist/neutral/node/config/capabilities/backings/index.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/defaultCapabilityRegistry.d.ts +8 -0
- package/dist/neutral/node/config/capabilities/defaultCapabilityRegistry.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/descriptors.d.ts +19 -0
- package/dist/neutral/node/config/capabilities/descriptors.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/index.d.ts +11 -0
- package/dist/neutral/node/config/capabilities/index.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/locatorFromActorNeeds.d.ts +55 -0
- package/dist/neutral/node/config/capabilities/locatorFromActorNeeds.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/networkTier3Descriptors.d.ts +14 -0
- package/dist/neutral/node/config/capabilities/networkTier3Descriptors.d.ts.map +1 -0
- package/dist/neutral/node/config/capabilities/resolveProviders.d.ts +9 -0
- package/dist/neutral/node/config/capabilities/resolveProviders.d.ts.map +1 -0
- package/dist/neutral/node/config/index.d.ts +1 -0
- package/dist/neutral/node/config/index.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/actors/apiLocatorFromConfig.d.ts +1 -1
- package/dist/neutral/node/config/locators/actors/apiLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/actors/bridgeLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/actors/producerLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/actors/rewardRedemptionLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/basicRemoteViewerLocator.d.ts +1 -1
- package/dist/neutral/node/config/locators/basicRemoteViewerLocator.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/buildStatelessApiLocator.d.ts +20 -0
- package/dist/neutral/node/config/locators/buildStatelessApiLocator.d.ts.map +1 -0
- package/dist/neutral/node/config/locators/index.d.ts +1 -0
- package/dist/neutral/node/config/locators/index.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/localLocatorFromConfig.d.ts +10 -2
- package/dist/neutral/node/config/locators/localLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/node/config/locators/locatorsFromConfig.d.ts.map +1 -1
- package/dist/neutral/node/config/tryParseConfig.d.ts +3 -2
- package/dist/neutral/node/config/tryParseConfig.d.ts.map +1 -1
- package/dist/neutral/shared/actor/index.d.ts +1 -1
- package/dist/neutral/shared/actor/index.d.ts.map +1 -1
- package/dist/neutral/shared/actor/v3/ActorV3.d.ts +102 -0
- package/dist/neutral/shared/actor/v3/ActorV3.d.ts.map +1 -0
- package/dist/neutral/shared/actor/v3/index.d.ts +2 -0
- package/dist/neutral/shared/actor/v3/index.d.ts.map +1 -0
- package/dist/neutral/shared/command/index.d.ts +2 -0
- package/dist/neutral/shared/command/index.d.ts.map +1 -0
- package/dist/neutral/shared/command/types.d.ts +8 -0
- package/dist/neutral/shared/command/types.d.ts.map +1 -0
- package/dist/neutral/shared/config/actors/Api.d.ts +22 -10
- package/dist/neutral/shared/config/actors/Api.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Bridge.d.ts +22 -10
- package/dist/neutral/shared/config/actors/Bridge.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Finalizer.d.ts +16 -10
- package/dist/neutral/shared/config/actors/Finalizer.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Mempool.d.ts +10 -10
- package/dist/neutral/shared/config/actors/Producer.d.ts +12 -12
- package/dist/neutral/shared/config/actors/Producer.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/RewardRedemption.d.ts +10 -10
- package/dist/neutral/shared/config/mergeConfig.d.ts +2 -1
- package/dist/neutral/shared/config/mergeConfig.d.ts.map +1 -1
- package/dist/neutral/shared/index.d.ts +1 -0
- package/dist/neutral/shared/index.d.ts.map +1 -1
- package/dist/neutral/shared/init/index.d.ts +0 -1
- package/dist/neutral/shared/init/index.d.ts.map +1 -1
- package/dist/neutral/shared/init/initWallet.d.ts +8 -1
- package/dist/neutral/shared/init/initWallet.d.ts.map +1 -1
- package/dist/neutral/shared/orchestrator/Orchestrator.d.ts +16 -3
- package/dist/neutral/shared/orchestrator/Orchestrator.d.ts.map +1 -1
- package/dist/node/index.mjs +1186 -308
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/neutral/config/locators/basicRemoteViewerLocator.d.ts +1 -1
- package/dist/node/neutral/config/locators/basicRemoteViewerLocator.d.ts.map +1 -1
- package/dist/node/node/config/capabilities/Backing.d.ts +13 -0
- package/dist/node/node/config/capabilities/Backing.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/Capability.d.ts +10 -0
- package/dist/node/node/config/capabilities/Capability.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/ProcessSharedResources.d.ts +37 -0
- package/dist/node/node/config/capabilities/ProcessSharedResources.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/Provider.d.ts +12 -0
- package/dist/node/node/config/capabilities/Provider.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/XL1ResolutionContext.d.ts +18 -0
- package/dist/node/node/config/capabilities/XL1ResolutionContext.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/backings/buildChainStoreBacking.d.ts +36 -0
- package/dist/node/node/config/capabilities/backings/buildChainStoreBacking.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/backings/buildDlqStoreBacking.d.ts +13 -0
- package/dist/node/node/config/capabilities/backings/buildDlqStoreBacking.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/backings/buildIndexerStoreBacking.d.ts +57 -0
- package/dist/node/node/config/capabilities/backings/buildIndexerStoreBacking.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/backings/buildMempoolStoreBacking.d.ts +12 -0
- package/dist/node/node/config/capabilities/backings/buildMempoolStoreBacking.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/backings/buildValidators.d.ts +14 -0
- package/dist/node/node/config/capabilities/backings/buildValidators.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/backings/index.d.ts +6 -0
- package/dist/node/node/config/capabilities/backings/index.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/defaultCapabilityRegistry.d.ts +8 -0
- package/dist/node/node/config/capabilities/defaultCapabilityRegistry.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/descriptors.d.ts +19 -0
- package/dist/node/node/config/capabilities/descriptors.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/index.d.ts +11 -0
- package/dist/node/node/config/capabilities/index.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/locatorFromActorNeeds.d.ts +55 -0
- package/dist/node/node/config/capabilities/locatorFromActorNeeds.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/networkTier3Descriptors.d.ts +14 -0
- package/dist/node/node/config/capabilities/networkTier3Descriptors.d.ts.map +1 -0
- package/dist/node/node/config/capabilities/resolveProviders.d.ts +9 -0
- package/dist/node/node/config/capabilities/resolveProviders.d.ts.map +1 -0
- package/dist/node/node/config/index.d.ts +1 -0
- package/dist/node/node/config/index.d.ts.map +1 -1
- package/dist/node/node/config/locators/actors/apiLocatorFromConfig.d.ts +1 -1
- package/dist/node/node/config/locators/actors/apiLocatorFromConfig.d.ts.map +1 -1
- package/dist/node/node/config/locators/actors/bridgeLocatorFromConfig.d.ts.map +1 -1
- package/dist/node/node/config/locators/actors/producerLocatorFromConfig.d.ts.map +1 -1
- package/dist/node/node/config/locators/actors/rewardRedemptionLocatorFromConfig.d.ts.map +1 -1
- package/dist/node/node/config/locators/basicRemoteViewerLocator.d.ts +1 -1
- package/dist/node/node/config/locators/basicRemoteViewerLocator.d.ts.map +1 -1
- package/dist/node/node/config/locators/buildStatelessApiLocator.d.ts +20 -0
- package/dist/node/node/config/locators/buildStatelessApiLocator.d.ts.map +1 -0
- package/dist/node/node/config/locators/index.d.ts +1 -0
- package/dist/node/node/config/locators/index.d.ts.map +1 -1
- package/dist/node/node/config/locators/localLocatorFromConfig.d.ts +10 -2
- package/dist/node/node/config/locators/localLocatorFromConfig.d.ts.map +1 -1
- package/dist/node/node/config/locators/locatorsFromConfig.d.ts.map +1 -1
- package/dist/node/node/config/tryParseConfig.d.ts +3 -2
- package/dist/node/node/config/tryParseConfig.d.ts.map +1 -1
- package/dist/node/shared/actor/index.d.ts +1 -1
- package/dist/node/shared/actor/index.d.ts.map +1 -1
- package/dist/node/shared/actor/v3/ActorV3.d.ts +102 -0
- package/dist/node/shared/actor/v3/ActorV3.d.ts.map +1 -0
- package/dist/node/shared/actor/v3/index.d.ts +2 -0
- package/dist/node/shared/actor/v3/index.d.ts.map +1 -0
- package/dist/node/shared/command/index.d.ts +2 -0
- package/dist/node/shared/command/index.d.ts.map +1 -0
- package/dist/node/shared/command/types.d.ts +8 -0
- package/dist/node/shared/command/types.d.ts.map +1 -0
- package/dist/node/shared/config/actors/Api.d.ts +22 -10
- package/dist/node/shared/config/actors/Api.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Bridge.d.ts +22 -10
- package/dist/node/shared/config/actors/Bridge.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Finalizer.d.ts +16 -10
- package/dist/node/shared/config/actors/Finalizer.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Mempool.d.ts +10 -10
- package/dist/node/shared/config/actors/Producer.d.ts +12 -12
- package/dist/node/shared/config/actors/Producer.d.ts.map +1 -1
- package/dist/node/shared/config/actors/RewardRedemption.d.ts +10 -10
- package/dist/node/shared/config/mergeConfig.d.ts +2 -1
- package/dist/node/shared/config/mergeConfig.d.ts.map +1 -1
- package/dist/node/shared/index.d.ts +1 -0
- package/dist/node/shared/index.d.ts.map +1 -1
- package/dist/node/shared/init/index.d.ts +0 -1
- package/dist/node/shared/init/index.d.ts.map +1 -1
- package/dist/node/shared/init/initWallet.d.ts +8 -1
- package/dist/node/shared/init/initWallet.d.ts.map +1 -1
- package/dist/node/shared/orchestrator/Orchestrator.d.ts +16 -3
- package/dist/node/shared/orchestrator/Orchestrator.d.ts.map +1 -1
- package/package.json +129 -124
- package/dist/browser/shared/actor/FinalizerActor.d.ts +0 -26
- package/dist/browser/shared/actor/FinalizerActor.d.ts.map +0 -1
- package/dist/browser/shared/init/initActorAccount.d.ts +0 -4
- package/dist/browser/shared/init/initActorAccount.d.ts.map +0 -1
- package/dist/neutral/shared/actor/FinalizerActor.d.ts +0 -26
- package/dist/neutral/shared/actor/FinalizerActor.d.ts.map +0 -1
- package/dist/neutral/shared/init/initActorAccount.d.ts +0 -4
- package/dist/neutral/shared/init/initActorAccount.d.ts.map +0 -1
- package/dist/node/shared/actor/FinalizerActor.d.ts +0 -26
- package/dist/node/shared/actor/FinalizerActor.d.ts.map +0 -1
- package/dist/node/shared/init/initActorAccount.d.ts +0 -4
- package/dist/node/shared/init/initActorAccount.d.ts.map +0 -1
package/dist/browser/index.mjs
CHANGED
|
@@ -1,78 +1,245 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
|
-
// src/shared/actor/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
// src/shared/actor/v3/ActorV3.ts
|
|
5
|
+
import { AbstractCreatable, assertEx, delay, IdLogger } from "@xylabs/sdk-js";
|
|
6
|
+
import { Semaphore } from "async-mutex";
|
|
7
|
+
import z from "zod";
|
|
8
|
+
var noopCounter = {
|
|
9
|
+
add: /* @__PURE__ */ __name(() => {
|
|
10
|
+
}, "add")
|
|
11
|
+
};
|
|
12
|
+
var noopUpDownCounter = {
|
|
13
|
+
add: /* @__PURE__ */ __name(() => {
|
|
14
|
+
}, "add")
|
|
15
|
+
};
|
|
16
|
+
var noopGauge = {
|
|
17
|
+
record: /* @__PURE__ */ __name(() => {
|
|
18
|
+
}, "record")
|
|
19
|
+
};
|
|
20
|
+
var noopHistogram = {
|
|
21
|
+
record: /* @__PURE__ */ __name(() => {
|
|
22
|
+
}, "record")
|
|
23
|
+
};
|
|
24
|
+
var CreatableNameZod = z.custom((val) => typeof val === "string" && val.length > 0);
|
|
25
|
+
var StatusReporterInstanceZod = z.custom((val) => val !== null && typeof val === "object" && "report" in val);
|
|
26
|
+
var AccountInstanceZod = z.custom((val) => val !== null && typeof val === "object" && "address" in val);
|
|
27
|
+
var ActorParamsV3Zod = z.object({
|
|
28
|
+
account: AccountInstanceZod,
|
|
29
|
+
locator: z.unknown(),
|
|
30
|
+
name: CreatableNameZod,
|
|
31
|
+
statusReporter: StatusReporterInstanceZod.optional()
|
|
32
|
+
});
|
|
33
|
+
function createDeferred() {
|
|
34
|
+
let resolve;
|
|
35
|
+
let reject;
|
|
36
|
+
const promise = new Promise((res, rej) => {
|
|
37
|
+
resolve = res;
|
|
38
|
+
reject = rej;
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
promise,
|
|
42
|
+
resolve,
|
|
43
|
+
reject
|
|
44
|
+
};
|
|
13
45
|
}
|
|
14
|
-
__name(
|
|
15
|
-
var
|
|
46
|
+
__name(createDeferred, "createDeferred");
|
|
47
|
+
var ActorV3 = class extends AbstractCreatable {
|
|
16
48
|
static {
|
|
17
|
-
__name(this, "
|
|
49
|
+
__name(this, "ActorV3");
|
|
18
50
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
51
|
+
_intervals = /* @__PURE__ */ new Map();
|
|
52
|
+
_semaphores = /* @__PURE__ */ new Map();
|
|
53
|
+
_timeouts = /* @__PURE__ */ new Map();
|
|
54
|
+
_logger;
|
|
55
|
+
_readyDeferred = createDeferred();
|
|
56
|
+
_readyError;
|
|
57
|
+
_readyState = "pending";
|
|
58
|
+
get logger() {
|
|
59
|
+
this._logger = new IdLogger(assertEx(this.context.logger, () => `Logger is required in context for actor ${this.name}.`), () => this.name);
|
|
60
|
+
return this._logger;
|
|
26
61
|
}
|
|
27
|
-
get
|
|
28
|
-
return this.
|
|
62
|
+
get readyError() {
|
|
63
|
+
return this._readyError;
|
|
29
64
|
}
|
|
30
|
-
get
|
|
31
|
-
return this.
|
|
65
|
+
get readyState() {
|
|
66
|
+
return this._readyState;
|
|
32
67
|
}
|
|
33
|
-
get
|
|
34
|
-
return this.
|
|
68
|
+
get account() {
|
|
69
|
+
return this.params.account;
|
|
35
70
|
}
|
|
36
|
-
get
|
|
37
|
-
return this.
|
|
71
|
+
get context() {
|
|
72
|
+
return this.locator.context;
|
|
38
73
|
}
|
|
39
|
-
get
|
|
40
|
-
return this.params.
|
|
74
|
+
get locator() {
|
|
75
|
+
return this.params.locator;
|
|
41
76
|
}
|
|
42
|
-
async
|
|
43
|
-
await super.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
77
|
+
static async paramsHandler(params) {
|
|
78
|
+
const baseParams = await super.paramsHandler({
|
|
79
|
+
...params,
|
|
80
|
+
name: params.name ?? "UnknownActor"
|
|
81
|
+
});
|
|
82
|
+
const account = assertEx(params.account, () => `params.account is required for actor ${baseParams.name}.`);
|
|
83
|
+
const locator = assertEx(params.locator, () => `params.locator is required for actor ${baseParams.name}.`);
|
|
84
|
+
return {
|
|
85
|
+
...baseParams,
|
|
86
|
+
account,
|
|
87
|
+
locator
|
|
88
|
+
};
|
|
49
89
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
90
|
+
/**
|
|
91
|
+
* The timer runs until the actor is deactivated (or you manually stop it).
|
|
92
|
+
*/
|
|
93
|
+
registerTimer(timerName, callback, dueTimeMs, periodMs) {
|
|
94
|
+
if (this.status !== "starting") {
|
|
95
|
+
this.logger?.warn(`Cannot register timer '${timerName}' because actor is not starting.`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
let running = false;
|
|
99
|
+
this._semaphores.set(timerName, new Semaphore(1));
|
|
100
|
+
const timeoutId = setTimeout(() => {
|
|
101
|
+
const intervalId = setInterval(() => {
|
|
102
|
+
const semaphore = this._semaphores.get(timerName);
|
|
103
|
+
if (this.status !== "started" || !this._intervals.has(timerName) || !semaphore || running) return;
|
|
104
|
+
if (semaphore.isLocked()) {
|
|
105
|
+
this.logger?.warn(`Skipping timer '${this.name}:${timerName}' execution because previous execution is still running.`);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
semaphore.acquire().then(([, release]) => {
|
|
109
|
+
const startTime = Date.now();
|
|
110
|
+
running = true;
|
|
111
|
+
callback().then(() => {
|
|
112
|
+
const duration = Date.now() - startTime;
|
|
113
|
+
if (duration > periodMs) {
|
|
114
|
+
this.logger?.warn(`Timer '${this.name}:${timerName}' execution took longer (${duration}ms) than the period (${periodMs}ms).`);
|
|
115
|
+
} else if (duration > 5e3) {
|
|
116
|
+
this.logger?.warn(`Timer '${this.name}:${timerName}' execution took longer (${duration}ms) than 5000ms.`);
|
|
117
|
+
}
|
|
118
|
+
}).catch((error) => {
|
|
119
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
120
|
+
this.logger?.error(`Error in timer '${this.name}:${timerName}': ${err.message}`);
|
|
121
|
+
if (err.stack) this.logger?.error(err.stack);
|
|
122
|
+
}).finally(() => {
|
|
123
|
+
release();
|
|
124
|
+
running = false;
|
|
125
|
+
});
|
|
126
|
+
}).catch((error) => {
|
|
127
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
128
|
+
this.logger?.error(`Error acquiring semaphore for timer '${this.name}:${timerName}': ${err.message}`);
|
|
65
129
|
});
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
130
|
+
}, periodMs);
|
|
131
|
+
this._intervals.set(timerName, intervalId);
|
|
132
|
+
}, dueTimeMs);
|
|
133
|
+
this._timeouts.set(timerName, timeoutId);
|
|
134
|
+
this.logger?.debug(`Timer '${this.name}:${timerName}' registered: first call after ${dueTimeMs}ms, recurring every ${periodMs}ms.`);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Invoked by the Orchestrator after `start()` to run the warm-pass.
|
|
138
|
+
* Idempotent: returns immediately if already invoked.
|
|
139
|
+
* Throws if `readyHandler` throws; resolves once `readyHandler` resolves.
|
|
140
|
+
*/
|
|
141
|
+
async runReadyHandler() {
|
|
142
|
+
if (this._readyState !== "pending") return;
|
|
143
|
+
try {
|
|
144
|
+
await this.readyHandler();
|
|
145
|
+
this._readyState = "ready";
|
|
146
|
+
this._readyDeferred.resolve();
|
|
147
|
+
} catch (err) {
|
|
148
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
149
|
+
this._readyState = "failed";
|
|
150
|
+
this._readyError = error;
|
|
151
|
+
this._readyDeferred.reject(error);
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
async stopHandler() {
|
|
156
|
+
await super.stopHandler();
|
|
157
|
+
this.logger?.debug("Stopping all timers...");
|
|
158
|
+
await Promise.all([
|
|
159
|
+
...this._semaphores.values()
|
|
160
|
+
].map(async (semaphore) => {
|
|
161
|
+
while (semaphore.isLocked()) {
|
|
162
|
+
this.logger?.debug("Waiting for running timer task to complete...");
|
|
163
|
+
await delay(500);
|
|
164
|
+
}
|
|
165
|
+
await semaphore.acquire();
|
|
166
|
+
}));
|
|
167
|
+
this._semaphores.clear();
|
|
168
|
+
for (const [, timeoutRef] of this._timeouts.entries()) {
|
|
169
|
+
clearTimeout(timeoutRef);
|
|
170
|
+
}
|
|
171
|
+
this._timeouts.clear();
|
|
172
|
+
for (const [, intervalRef] of this._intervals.entries()) {
|
|
173
|
+
clearInterval(intervalRef);
|
|
174
|
+
}
|
|
175
|
+
this._intervals.clear();
|
|
176
|
+
this.logger?.debug("Stopped.");
|
|
177
|
+
}
|
|
178
|
+
async whenReady(timeoutMs) {
|
|
179
|
+
if (timeoutMs === void 0) {
|
|
180
|
+
await this._readyDeferred.promise;
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
let timer;
|
|
184
|
+
const timeout = new Promise((_, reject) => {
|
|
185
|
+
timer = setTimeout(() => {
|
|
186
|
+
reject(new Error(`Actor ${this.name} did not become ready within ${timeoutMs}ms`));
|
|
187
|
+
}, timeoutMs);
|
|
188
|
+
});
|
|
189
|
+
try {
|
|
190
|
+
await Promise.race([
|
|
191
|
+
this._readyDeferred.promise,
|
|
192
|
+
timeout
|
|
193
|
+
]);
|
|
194
|
+
} finally {
|
|
195
|
+
if (timer) clearTimeout(timer);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Create a `Counter` instrument bound to this actor's meter, or a no-op
|
|
200
|
+
* stub if telemetry is not wired. Always returns a non-undefined value so
|
|
201
|
+
* call sites can drop the optional-chain on `.add()`.
|
|
202
|
+
*
|
|
203
|
+
* TODO: in a future pass, consider folding these single-instrument helpers
|
|
204
|
+
* into a declarative `createActorMeters({ counters: {...}, gauges: {...} })`
|
|
205
|
+
* spec API for actors with many instruments.
|
|
206
|
+
*/
|
|
207
|
+
counter(name, description) {
|
|
208
|
+
return this.meter?.createCounter(name, {
|
|
209
|
+
description
|
|
210
|
+
}) ?? noopCounter;
|
|
211
|
+
}
|
|
212
|
+
/** Create a synchronous `Gauge` instrument, or a no-op stub if telemetry is not wired. */
|
|
213
|
+
gauge(name, description) {
|
|
214
|
+
return this.meter?.createGauge(name, {
|
|
215
|
+
description
|
|
216
|
+
}) ?? noopGauge;
|
|
217
|
+
}
|
|
218
|
+
/** Create a `Histogram` instrument, or a no-op stub if telemetry is not wired. */
|
|
219
|
+
histogram(name, description) {
|
|
220
|
+
return this.meter?.createHistogram(name, {
|
|
221
|
+
description
|
|
222
|
+
}) ?? noopHistogram;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Override in subclasses to prove the actor can do useful work.
|
|
226
|
+
* Default: no-op (the actor declares itself ready as soon as `start()` returns).
|
|
227
|
+
*/
|
|
228
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
229
|
+
async readyHandler() {
|
|
230
|
+
}
|
|
231
|
+
/** Create an `UpDownCounter` instrument, or a no-op stub if telemetry is not wired. */
|
|
232
|
+
upDownCounter(name, description) {
|
|
233
|
+
return this.meter?.createUpDownCounter(name, {
|
|
234
|
+
description
|
|
235
|
+
}) ?? noopUpDownCounter;
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
var Actor = class extends ActorV3 {
|
|
239
|
+
static {
|
|
240
|
+
__name(this, "Actor");
|
|
71
241
|
}
|
|
72
242
|
};
|
|
73
|
-
FinalizerActor = _ts_decorate([
|
|
74
|
-
creatable()
|
|
75
|
-
], FinalizerActor);
|
|
76
243
|
|
|
77
244
|
// src/shared/buildTelemetryConfig.ts
|
|
78
245
|
function buildTelemetryConfig(config, serviceName, serviceVersion, defaultMetricsScrapePort = 9464) {
|
|
@@ -96,16 +263,56 @@ __name(buildTelemetryConfig, "buildTelemetryConfig");
|
|
|
96
263
|
// src/shared/config/actors/Api.ts
|
|
97
264
|
import { zodAsFactory, zodIsFactory, zodToFactory } from "@xylabs/sdk-js";
|
|
98
265
|
import { BaseConfigContextZod, HostActorConfigZod } from "@xyo-network/xl1-sdk";
|
|
99
|
-
import { globalRegistry, z } from "zod";
|
|
100
|
-
var ApiConfigZod = HostActorConfigZod.extend(
|
|
101
|
-
initRewardsCache:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
266
|
+
import { globalRegistry, z as z2 } from "zod";
|
|
267
|
+
var ApiConfigZod = HostActorConfigZod.extend(z2.object({
|
|
268
|
+
initRewardsCache: z2.union([
|
|
269
|
+
z2.number(),
|
|
270
|
+
z2.string(),
|
|
271
|
+
z2.boolean()
|
|
105
272
|
]).transform((v) => v !== "0" && v !== "false" && v !== false && v != 0).default(true).register(globalRegistry, {
|
|
106
273
|
description: "Whether to initialize the rewards cache on startup",
|
|
107
274
|
title: "api.initRewardsCache",
|
|
108
275
|
type: "boolean"
|
|
276
|
+
}),
|
|
277
|
+
/**
|
|
278
|
+
* When `true`, the API actor runs in stateless mode: it holds no local
|
|
279
|
+
* backing-store ownership, never loads the local LMDB/MongoDB node, and
|
|
280
|
+
* federates every JSON-RPC request to upstream owner-actors via `JsonRpc*`
|
|
281
|
+
* providers. Multiple stateless API instances can run behind a load
|
|
282
|
+
* balancer for horizontal scaling. Requires `remote.rpc` to point at the
|
|
283
|
+
* upstream API/Finalizer/Mempool/Indexer surfaces.
|
|
284
|
+
*/
|
|
285
|
+
stateless: z2.union([
|
|
286
|
+
z2.number(),
|
|
287
|
+
z2.string(),
|
|
288
|
+
z2.boolean()
|
|
289
|
+
]).transform((v) => v === "1" || v === "true" || v === true || v == 1).default(false).register(globalRegistry, {
|
|
290
|
+
description: "Run the API actor as a stateless federation node (availableBackings: [network])",
|
|
291
|
+
title: "api.stateless",
|
|
292
|
+
type: "boolean"
|
|
293
|
+
}),
|
|
294
|
+
/**
|
|
295
|
+
* Back-compat for the surface-aware route split. When `true`, `POST /rpc`
|
|
296
|
+
* serves the full `XyoConnection` (both node-surface and indexed-surface
|
|
297
|
+
* methods), preserving pre-Phase-7 behavior for clients that haven't yet
|
|
298
|
+
* migrated to `POST /rpc/indexed`. When `false`, `/rpc` is strictly
|
|
299
|
+
* node-surface only and indexed methods are 404 at `/rpc`.
|
|
300
|
+
*
|
|
301
|
+
* `/rpc/indexed` mounts independently of this flag whenever the locator's
|
|
302
|
+
* connection has any indexed branch.
|
|
303
|
+
*
|
|
304
|
+
* Default `true` for the first release that includes Phase 7 — flip to
|
|
305
|
+
* `false` per environment once external clients (explorers, wallets, dApps)
|
|
306
|
+
* have moved their indexed-method calls to `/rpc/indexed`.
|
|
307
|
+
*/
|
|
308
|
+
legacyMixedRpc: z2.union([
|
|
309
|
+
z2.number(),
|
|
310
|
+
z2.string(),
|
|
311
|
+
z2.boolean()
|
|
312
|
+
]).transform((v) => v !== "0" && v !== "false" && v !== false && v != 0).default(true).register(globalRegistry, {
|
|
313
|
+
description: "Serve the full XyoConnection at POST /rpc (no surface filter). Set false to enforce node-surface-only at /rpc; indexed methods always available at /rpc/indexed regardless.",
|
|
314
|
+
title: "api.legacyMixedRpc",
|
|
315
|
+
type: "boolean"
|
|
109
316
|
})
|
|
110
317
|
}).shape);
|
|
111
318
|
var isApiConfig = zodIsFactory(ApiConfigZod);
|
|
@@ -121,7 +328,7 @@ var toApiConfigContext = zodToFactory(ApiConfigContext, "toApiConfigContext");
|
|
|
121
328
|
// src/shared/config/actors/Bridge.ts
|
|
122
329
|
import { AddressZod, HexZod, toAddress, toHex, zodAsFactory as zodAsFactory2, zodIsFactory as zodIsFactory2, zodToFactory as zodToFactory2 } from "@xylabs/sdk-js";
|
|
123
330
|
import { AttoXL1ConvertFactor, BaseConfigContextZod as BaseConfigContextZod2, HostActorConfigZod as HostActorConfigZod2, XL1 } from "@xyo-network/xl1-sdk";
|
|
124
|
-
import { globalRegistry as globalRegistry2, z as
|
|
331
|
+
import { globalRegistry as globalRegistry2, z as z3 } from "zod";
|
|
125
332
|
var DEFAULT_FIXED_FEE = toHex(XL1(1000n) * AttoXL1ConvertFactor.xl1);
|
|
126
333
|
var DEFAULT_VARIABLE_FEE_BASIS_POINTS = 300;
|
|
127
334
|
var DEFAULT_HARDHAT_BRIDGE_CONTRACT = toAddress("2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6");
|
|
@@ -130,7 +337,8 @@ var DEFAULT_HARDHAT_REMOTE_CHAIN_WALLET_PRIVATE_KEY = toHex("0xac0974bec39a17e36
|
|
|
130
337
|
var DEFAULT_HARDHAT_TOKEN_CONTRACT = toAddress("5FbDB2315678afecb367f032d93F642f64180aa3");
|
|
131
338
|
var DEFAULT_MAX_BRIDGE_AMOUNT = toHex(XL1(1000000n) * AttoXL1ConvertFactor.xl1);
|
|
132
339
|
var DEFAULT_MIN_BRIDGE_AMOUNT = toHex(XL1(1500n) * AttoXL1ConvertFactor.xl1);
|
|
133
|
-
var
|
|
340
|
+
var DEFAULT_SCANNER_INTERVAL_MS = 3e4;
|
|
341
|
+
var BasisPointsZod = z3.coerce.number().int().nonnegative().max(1e4);
|
|
134
342
|
var BridgeConfigZod = HostActorConfigZod2.extend({
|
|
135
343
|
escrowAddress: AddressZod.optional().register(globalRegistry2, {
|
|
136
344
|
description: "Address to which bridge escrow will be sent",
|
|
@@ -166,18 +374,24 @@ var BridgeConfigZod = HostActorConfigZod2.extend({
|
|
|
166
374
|
title: "bridge.minBridgeAmount",
|
|
167
375
|
type: "string"
|
|
168
376
|
}),
|
|
169
|
-
redisHost:
|
|
377
|
+
redisHost: z3.string().default("localhost").register(globalRegistry2, {
|
|
170
378
|
default: "localhost",
|
|
171
379
|
description: "Host for the Bridge Redis instance",
|
|
172
380
|
title: "bridge.redisHost",
|
|
173
381
|
type: "string"
|
|
174
382
|
}),
|
|
175
|
-
redisPort:
|
|
383
|
+
redisPort: z3.coerce.number().int().positive().default(6379).register(globalRegistry2, {
|
|
176
384
|
default: 6379,
|
|
177
385
|
description: "Port for the Bridge Redis instance",
|
|
178
386
|
title: "bridge.redisPort",
|
|
179
387
|
type: "number"
|
|
180
388
|
}),
|
|
389
|
+
scannerIntervalMs: z3.coerce.number().int().positive().default(DEFAULT_SCANNER_INTERVAL_MS).register(globalRegistry2, {
|
|
390
|
+
default: DEFAULT_SCANNER_INTERVAL_MS,
|
|
391
|
+
description: "How often (ms) the EVM->XL1 scanner polls the remote bridge contract for new BridgedToRemote ids confirmed at depth.",
|
|
392
|
+
title: "bridge.scannerIntervalMs",
|
|
393
|
+
type: "number"
|
|
394
|
+
}),
|
|
181
395
|
remoteBridgeContractAddress: AddressZod.default(DEFAULT_HARDHAT_BRIDGE_CONTRACT).register(globalRegistry2, {
|
|
182
396
|
default: DEFAULT_HARDHAT_BRIDGE_CONTRACT,
|
|
183
397
|
description: "Hex representation of remote token address used for bridging",
|
|
@@ -190,6 +404,14 @@ var BridgeConfigZod = HostActorConfigZod2.extend({
|
|
|
190
404
|
title: "bridge.remoteChainId",
|
|
191
405
|
type: "string"
|
|
192
406
|
}),
|
|
407
|
+
remoteConfirmationDepth: z3.union([
|
|
408
|
+
z3.coerce.number().int().nonnegative(),
|
|
409
|
+
z3.literal("finalized")
|
|
410
|
+
]).optional().register(globalRegistry2, {
|
|
411
|
+
description: "Block depth or BlockTag at which the remote (EVM) chain is read as canonical. Numeric: number of confirmations behind head. 'finalized': Casper FFG finalized block. Resolved per-chain by getRemoteConfirmationDepth when unset.",
|
|
412
|
+
title: "bridge.remoteConfirmationDepth",
|
|
413
|
+
type: "string"
|
|
414
|
+
}),
|
|
193
415
|
remoteTokenAddress: HexZod.default(DEFAULT_HARDHAT_TOKEN_CONTRACT).register(globalRegistry2, {
|
|
194
416
|
default: DEFAULT_HARDHAT_TOKEN_CONTRACT,
|
|
195
417
|
description: "Hex representation of remote token address used for bridging",
|
|
@@ -237,10 +459,14 @@ var toBridgeConfigContext = zodToFactory2(BridgeConfigContext, "toBridgeConfigCo
|
|
|
237
459
|
// src/shared/config/actors/Finalizer.ts
|
|
238
460
|
import { AddressZod as AddressZod2, zodAsFactory as zodAsFactory3, zodIsFactory as zodIsFactory3, zodToFactory as zodToFactory3 } from "@xylabs/sdk-js";
|
|
239
461
|
import { BaseConfigContextZod as BaseConfigContextZod3, DEFAULT_MIN_CANDIDATES, HostActorConfigZod as HostActorConfigZod3 } from "@xyo-network/xl1-sdk";
|
|
240
|
-
import { z as
|
|
462
|
+
import { z as z4 } from "zod";
|
|
241
463
|
var FinalizerConfigZod = HostActorConfigZod3.extend({
|
|
242
|
-
allowedProducers:
|
|
243
|
-
|
|
464
|
+
allowedProducers: z4.array(AddressZod2).optional(),
|
|
465
|
+
// Period (ms) between finalizer ticks. Default matches the historical
|
|
466
|
+
// hardcoded value in FinalizerActor; tests can lower it to drive faster
|
|
467
|
+
// block finalization.
|
|
468
|
+
finalizationCheckInterval: z4.coerce.number().default(500),
|
|
469
|
+
minCandidates: z4.number().int().min(0).default(DEFAULT_MIN_CANDIDATES)
|
|
244
470
|
});
|
|
245
471
|
var isFinalizerConfig = zodIsFactory3(FinalizerConfigZod);
|
|
246
472
|
var asFinalizerConfig = zodAsFactory3(FinalizerConfigZod, "asFinalizerConfig");
|
|
@@ -255,13 +481,13 @@ var toFinalizerConfigContext = zodToFactory3(FinalizerConfigContext, "toFinalize
|
|
|
255
481
|
// src/shared/config/actors/Mempool.ts
|
|
256
482
|
import { zodAsFactory as zodAsFactory4, zodIsFactory as zodIsFactory4, zodToFactory as zodToFactory4 } from "@xylabs/sdk-js";
|
|
257
483
|
import { BaseConfigContextZod as BaseConfigContextZod4, HostActorConfigZod as HostActorConfigZod4 } from "@xyo-network/xl1-sdk";
|
|
258
|
-
import { globalRegistry as globalRegistry3, z as
|
|
484
|
+
import { globalRegistry as globalRegistry3, z as z5 } from "zod";
|
|
259
485
|
var DEFAULT_MEMPOOL_BLOCK_PRUNE_INTERVAL = 1e3;
|
|
260
486
|
var DEFAULT_MEMPOOL_TRANSACTION_PRUNE_INTERVAL = 1e3;
|
|
261
487
|
var MempoolConfigZod = HostActorConfigZod4.extend({
|
|
262
|
-
enabled:
|
|
263
|
-
|
|
264
|
-
|
|
488
|
+
enabled: z5.union([
|
|
489
|
+
z5.string(),
|
|
490
|
+
z5.boolean()
|
|
265
491
|
]).default("false").transform((val, ctx) => {
|
|
266
492
|
if (typeof val === "boolean") return val;
|
|
267
493
|
const normalized = val.toLowerCase().trim();
|
|
@@ -282,19 +508,19 @@ var MempoolConfigZod = HostActorConfigZod4.extend({
|
|
|
282
508
|
expected: "boolean",
|
|
283
509
|
message: `Invalid boolean value: "${val}". Use true/false, 1/0, yes/no.`
|
|
284
510
|
});
|
|
285
|
-
return
|
|
511
|
+
return z5.NEVER;
|
|
286
512
|
}).register(globalRegistry3, {
|
|
287
513
|
default: "false",
|
|
288
514
|
description: "Enable the Mempool",
|
|
289
515
|
title: "mempool.enabled",
|
|
290
516
|
type: "boolean"
|
|
291
517
|
}),
|
|
292
|
-
blockPruneInterval:
|
|
518
|
+
blockPruneInterval: z5.coerce.number().default(DEFAULT_MEMPOOL_BLOCK_PRUNE_INTERVAL).register(globalRegistry3, {
|
|
293
519
|
description: "The interval time (in milliseconds) between pending block prune attempts",
|
|
294
520
|
title: "mempool.blockPruneInterval",
|
|
295
521
|
type: "number"
|
|
296
522
|
}),
|
|
297
|
-
transactionPruneInterval:
|
|
523
|
+
transactionPruneInterval: z5.coerce.number().default(DEFAULT_MEMPOOL_TRANSACTION_PRUNE_INTERVAL).register(globalRegistry3, {
|
|
298
524
|
description: "The interval time (in milliseconds) between pending transaction prune attempts",
|
|
299
525
|
title: "mempool.transactionPruneInterval",
|
|
300
526
|
type: "number"
|
|
@@ -311,44 +537,39 @@ var asMempoolConfigContext = zodAsFactory4(MempoolConfigContext, "asMempoolConfi
|
|
|
311
537
|
var toMempoolConfigContext = zodToFactory4(MempoolConfigContext, "toMempoolConfigContext");
|
|
312
538
|
|
|
313
539
|
// src/shared/config/actors/Producer.ts
|
|
314
|
-
import { AddressZod as AddressZod3,
|
|
540
|
+
import { AddressZod as AddressZod3, zodAsFactory as zodAsFactory5, zodIsFactory as zodIsFactory5, zodToFactory as zodToFactory5 } from "@xylabs/sdk-js";
|
|
315
541
|
import { ActorConfigZod, BaseConfigContextZod as BaseConfigContextZod5 } from "@xyo-network/xl1-sdk";
|
|
316
|
-
import { globalRegistry as globalRegistry4, z as
|
|
542
|
+
import { globalRegistry as globalRegistry4, z as z6 } from "zod";
|
|
317
543
|
var DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL = 1e4;
|
|
318
|
-
var ProducerConfigZod = ActorConfigZod.extend(
|
|
319
|
-
allowlist:
|
|
320
|
-
if (typeof val === "string") {
|
|
321
|
-
return val.split(",").map((s) => asAddress(s.trim()));
|
|
322
|
-
}
|
|
323
|
-
return val;
|
|
324
|
-
}, z5.array(AddressZod3).optional().register(globalRegistry4, {
|
|
544
|
+
var ProducerConfigZod = ActorConfigZod.extend(z6.object({
|
|
545
|
+
allowlist: z6.array(AddressZod3).optional().register(globalRegistry4, {
|
|
325
546
|
description: "List of allowed producer addresses, if undefined anyone can participate",
|
|
326
547
|
title: "allowlist",
|
|
327
548
|
type: "array"
|
|
328
|
-
})
|
|
329
|
-
blockProductionCheckInterval:
|
|
549
|
+
}),
|
|
550
|
+
blockProductionCheckInterval: z6.coerce.number().default(DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL).register(globalRegistry4, {
|
|
330
551
|
description: "The interval time (in milliseconds) between block production attempts",
|
|
331
552
|
title: "producer.blockProductionCheckInterval",
|
|
332
553
|
type: "number"
|
|
333
554
|
}),
|
|
334
|
-
disableIntentRedeclaration:
|
|
555
|
+
disableIntentRedeclaration: z6.boolean().optional().register(globalRegistry4, {
|
|
335
556
|
description: "Should the producer skip redeclaring their intent to continue producing blocks",
|
|
336
557
|
title: "producer.disableIntentRedeclaration",
|
|
337
558
|
type: "boolean"
|
|
338
559
|
}),
|
|
339
|
-
heartbeatInterval:
|
|
560
|
+
heartbeatInterval: z6.coerce.number().default(36e5).register(globalRegistry4, {
|
|
340
561
|
description: "The number of milliseconds between heartbeats if no blocks are produced",
|
|
341
562
|
title: "producer.heartbeatInterval",
|
|
342
563
|
type: "number"
|
|
343
564
|
}),
|
|
344
565
|
// TODO: BigInt schema
|
|
345
|
-
minStake:
|
|
566
|
+
minStake: z6.coerce.number().default(1).register(globalRegistry4, {
|
|
346
567
|
description: "Minimum stake required to be a Producer",
|
|
347
568
|
title: "producer.minStake",
|
|
348
569
|
type: "number"
|
|
349
570
|
}),
|
|
350
571
|
// TODO: Address schema
|
|
351
|
-
rewardAddress:
|
|
572
|
+
rewardAddress: z6.string().optional().register(globalRegistry4, {
|
|
352
573
|
description: "Address to receive block rewards",
|
|
353
574
|
title: "producer.rewardAddress",
|
|
354
575
|
type: "string"
|
|
@@ -442,8 +663,8 @@ var ServiceLifetime = {
|
|
|
442
663
|
Transient: "Transient"
|
|
443
664
|
};
|
|
444
665
|
|
|
445
|
-
// src/shared/init/
|
|
446
|
-
import {
|
|
666
|
+
// src/shared/init/initActorSeedPhrase.ts
|
|
667
|
+
import { assertEx as assertEx2, isString } from "@xylabs/sdk-js";
|
|
447
668
|
|
|
448
669
|
// src/shared/init/walletResolution.ts
|
|
449
670
|
import { HDWallet } from "@xyo-network/sdk-js";
|
|
@@ -751,21 +972,7 @@ async function resolveWalletForActor(actorName, accountPath) {
|
|
|
751
972
|
}
|
|
752
973
|
__name(resolveWalletForActor, "resolveWalletForActor");
|
|
753
974
|
|
|
754
|
-
// src/shared/init/initActorAccount.ts
|
|
755
|
-
var actorAccountSingletons = {};
|
|
756
|
-
async function initActorAccount({ config, logger }) {
|
|
757
|
-
const actorName = config.name;
|
|
758
|
-
if (isDefined(actorAccountSingletons[actorName])) return actorAccountSingletons[actorName];
|
|
759
|
-
const accountPath = typeof config.accountPath === "string" ? config.accountPath : void 0;
|
|
760
|
-
const account = await resolveWalletForActor(actorName, accountPath);
|
|
761
|
-
logger?.debug(`[${actorName}] Using wallet address ${account.address}`);
|
|
762
|
-
actorAccountSingletons[actorName] = account;
|
|
763
|
-
return actorAccountSingletons[actorName];
|
|
764
|
-
}
|
|
765
|
-
__name(initActorAccount, "initActorAccount");
|
|
766
|
-
|
|
767
975
|
// src/shared/init/initActorSeedPhrase.ts
|
|
768
|
-
import { assertEx, isString } from "@xylabs/sdk-js";
|
|
769
976
|
async function initActorSeedPhrase(context, bios) {
|
|
770
977
|
const { logger, config } = context;
|
|
771
978
|
const walletKind = config.name;
|
|
@@ -774,12 +981,12 @@ async function initActorSeedPhrase(context, bios) {
|
|
|
774
981
|
if (isString(report?.root.mnemonic)) return report.root.mnemonic;
|
|
775
982
|
const fallback = getBuiltInDevMnemonic();
|
|
776
983
|
logger?.debug(`[${walletKind}] Falling back to built-in development mnemonic`);
|
|
777
|
-
return
|
|
984
|
+
return assertEx2(fallback, () => "Unable to resolve mnemonic");
|
|
778
985
|
}
|
|
779
986
|
__name(initActorSeedPhrase, "initActorSeedPhrase");
|
|
780
987
|
|
|
781
988
|
// src/shared/init/initBridgedModule.ts
|
|
782
|
-
import { assertEx as
|
|
989
|
+
import { assertEx as assertEx3 } from "@xylabs/sdk-js";
|
|
783
990
|
import { asAttachableArchivistInstance, asAttachableModuleInstance } from "@xyo-network/sdk-js";
|
|
784
991
|
import { Mutex } from "async-mutex";
|
|
785
992
|
var initMutex = new Mutex();
|
|
@@ -788,8 +995,8 @@ async function initBridgedModule({ bridge, moduleName }) {
|
|
|
788
995
|
return await initMutex.runExclusive(async () => {
|
|
789
996
|
const existing = bridgedModuleDictionary?.[bridge.address]?.[moduleName];
|
|
790
997
|
if (existing) return existing;
|
|
791
|
-
const mod =
|
|
792
|
-
const moduleInstance =
|
|
998
|
+
const mod = assertEx3(await bridge.resolve(moduleName), () => `Could not resolve ${moduleName}`);
|
|
999
|
+
const moduleInstance = assertEx3(asAttachableModuleInstance(mod), () => `Could not convert ${moduleName} to attachable module instance`);
|
|
793
1000
|
let moduleMap = bridgedModuleDictionary[bridge.address];
|
|
794
1001
|
if (moduleMap === void 0) {
|
|
795
1002
|
moduleMap = {};
|
|
@@ -801,7 +1008,7 @@ async function initBridgedModule({ bridge, moduleName }) {
|
|
|
801
1008
|
}
|
|
802
1009
|
__name(initBridgedModule, "initBridgedModule");
|
|
803
1010
|
async function initBridgedArchivistModule({ bridge, moduleName }) {
|
|
804
|
-
return
|
|
1011
|
+
return assertEx3(asAttachableArchivistInstance(await initBridgedModule({
|
|
805
1012
|
bridge,
|
|
806
1013
|
moduleName
|
|
807
1014
|
})), () => `Could not convert ${moduleName} to attachable archivist instance`);
|
|
@@ -828,41 +1035,65 @@ function initStatusReporter({ logger }) {
|
|
|
828
1035
|
__name(initStatusReporter, "initStatusReporter");
|
|
829
1036
|
|
|
830
1037
|
// src/shared/init/initWallet.ts
|
|
1038
|
+
import { isDefined } from "@xylabs/sdk-js";
|
|
1039
|
+
var actorAccountSingletons = {};
|
|
831
1040
|
async function initActorWallet(context) {
|
|
832
1041
|
const actorName = context.config.name;
|
|
1042
|
+
if (isDefined(actorAccountSingletons[actorName])) return actorAccountSingletons[actorName];
|
|
833
1043
|
const accountPath = typeof context.config.accountPath === "string" ? context.config.accountPath : void 0;
|
|
834
|
-
|
|
1044
|
+
const account = await resolveWalletForActor(actorName, accountPath);
|
|
1045
|
+
context.logger?.debug(`[${actorName}] Using wallet address ${account.address}`);
|
|
1046
|
+
actorAccountSingletons[actorName] = account;
|
|
1047
|
+
return actorAccountSingletons[actorName];
|
|
835
1048
|
}
|
|
836
1049
|
__name(initActorWallet, "initActorWallet");
|
|
837
1050
|
|
|
838
1051
|
// src/shared/orchestrator/Orchestrator.ts
|
|
839
|
-
import { AbstractCreatable, creatable
|
|
840
|
-
function
|
|
1052
|
+
import { AbstractCreatable as AbstractCreatable2, creatable } from "@xylabs/sdk-js";
|
|
1053
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
841
1054
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
842
1055
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
843
1056
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
844
1057
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
845
1058
|
}
|
|
846
|
-
__name(
|
|
847
|
-
var Orchestrator = class extends
|
|
1059
|
+
__name(_ts_decorate, "_ts_decorate");
|
|
1060
|
+
var Orchestrator = class extends AbstractCreatable2 {
|
|
848
1061
|
static {
|
|
849
1062
|
__name(this, "Orchestrator");
|
|
850
1063
|
}
|
|
851
1064
|
actors = [];
|
|
852
|
-
keepAliveHandle = null;
|
|
853
1065
|
running = false;
|
|
1066
|
+
shuttingDown = false;
|
|
1067
|
+
get readyState() {
|
|
1068
|
+
if (this.actors.length === 0) return "pending";
|
|
1069
|
+
if (this.actors.some((a) => isLocalActor(a) && a.readyState === "failed")) return "failed";
|
|
1070
|
+
if (this.actors.every((a) => isLocalActor(a) && a.readyState === "ready")) return "ready";
|
|
1071
|
+
return "pending";
|
|
1072
|
+
}
|
|
1073
|
+
isReady() {
|
|
1074
|
+
return this.readyState === "ready" && !this.shuttingDown;
|
|
1075
|
+
}
|
|
1076
|
+
isShuttingDown() {
|
|
1077
|
+
return this.shuttingDown;
|
|
1078
|
+
}
|
|
854
1079
|
/**
|
|
855
1080
|
* Registers an actor.
|
|
856
1081
|
* (We won't activate the actor until `start()` is called.)
|
|
857
1082
|
*/
|
|
858
1083
|
async registerActor(actor) {
|
|
1084
|
+
this.actors.push(actor);
|
|
859
1085
|
if (this.running) {
|
|
860
1086
|
await actor.start();
|
|
1087
|
+
if (isLocalActor(actor)) {
|
|
1088
|
+
actor.runReadyHandler().catch((err) => {
|
|
1089
|
+
this.logger?.error(`[Orchestrator] Actor [${actor.name}] readyHandler failed: ${formatError(err)}`);
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
861
1092
|
}
|
|
862
|
-
this.actors.push(actor);
|
|
863
1093
|
}
|
|
864
1094
|
/**
|
|
865
|
-
* Starts the orchestrator: activates all actors.
|
|
1095
|
+
* Starts the orchestrator: activates all actors in parallel and kicks off their warm-pass.
|
|
1096
|
+
* `whenReady()` resolves once every actor's `readyHandler` has succeeded.
|
|
866
1097
|
*/
|
|
867
1098
|
async startHandler() {
|
|
868
1099
|
await super.startHandler();
|
|
@@ -870,13 +1101,26 @@ var Orchestrator = class extends AbstractCreatable {
|
|
|
870
1101
|
this.logger?.warn("[Orchestrator] Already started.");
|
|
871
1102
|
return;
|
|
872
1103
|
}
|
|
873
|
-
this.logger?.log(
|
|
1104
|
+
this.logger?.log(`[Orchestrator] Starting ${this.actors.length} actor(s) in parallel...`);
|
|
874
1105
|
this.running = true;
|
|
1106
|
+
const startResults = await Promise.allSettled(this.actors.map((a) => a.start()));
|
|
1107
|
+
const startFailures = startResults.flatMap((r, i) => r.status === "rejected" ? [
|
|
1108
|
+
{
|
|
1109
|
+
actor: this.actors[i],
|
|
1110
|
+
reason: r.reason
|
|
1111
|
+
}
|
|
1112
|
+
] : []);
|
|
1113
|
+
if (startFailures.length > 0) {
|
|
1114
|
+
for (const f of startFailures) this.logger?.error(`[Orchestrator] Actor [${f.actor?.name ?? "?"}] failed to start: ${formatError(f.reason)}`);
|
|
1115
|
+
throw new Error(`[Orchestrator] ${startFailures.length} actor(s) failed to start`);
|
|
1116
|
+
}
|
|
875
1117
|
for (const actor of this.actors) {
|
|
876
|
-
|
|
1118
|
+
if (isLocalActor(actor)) {
|
|
1119
|
+
actor.runReadyHandler().catch((err) => {
|
|
1120
|
+
this.logger?.error(`[Orchestrator] Actor [${actor.name}] readyHandler failed: ${formatError(err)}`);
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
877
1123
|
}
|
|
878
|
-
this.keepAliveHandle = setInterval(() => {
|
|
879
|
-
}, 2147483647);
|
|
880
1124
|
}
|
|
881
1125
|
/**
|
|
882
1126
|
* Stops the orchestrator: deactivates all actors.
|
|
@@ -888,28 +1132,63 @@ var Orchestrator = class extends AbstractCreatable {
|
|
|
888
1132
|
return;
|
|
889
1133
|
}
|
|
890
1134
|
this.logger?.log("[Orchestrator] Stopping...");
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
}
|
|
1135
|
+
this.shuttingDown = true;
|
|
1136
|
+
await Promise.allSettled(this.actors.map((a) => a.stop()));
|
|
894
1137
|
this.running = false;
|
|
895
|
-
|
|
896
|
-
this.logger?.log("[Orchestrator] Stopped
|
|
1138
|
+
this.shuttingDown = false;
|
|
1139
|
+
this.logger?.log("[Orchestrator] Stopped.");
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* Resolves once every actor reports ready. Rejects if any actor's `readyHandler` throws,
|
|
1143
|
+
* or after `timeoutMs` if provided.
|
|
1144
|
+
*/
|
|
1145
|
+
async whenReady(timeoutMs) {
|
|
1146
|
+
const localActors = this.actors.filter(isLocalActor);
|
|
1147
|
+
if (localActors.length === 0) return;
|
|
1148
|
+
if (timeoutMs === void 0) {
|
|
1149
|
+
await Promise.all(localActors.map((a) => a.whenReady()));
|
|
1150
|
+
return;
|
|
1151
|
+
}
|
|
1152
|
+
let timer;
|
|
1153
|
+
const timeout = new Promise((_, reject) => {
|
|
1154
|
+
timer = setTimeout(() => {
|
|
1155
|
+
reject(new Error(`[Orchestrator] Not ready within ${timeoutMs}ms`));
|
|
1156
|
+
}, timeoutMs);
|
|
1157
|
+
});
|
|
1158
|
+
try {
|
|
1159
|
+
await Promise.race([
|
|
1160
|
+
Promise.all(localActors.map((a) => a.whenReady())),
|
|
1161
|
+
timeout
|
|
1162
|
+
]);
|
|
1163
|
+
} finally {
|
|
1164
|
+
if (timer) clearTimeout(timer);
|
|
1165
|
+
}
|
|
897
1166
|
}
|
|
898
1167
|
};
|
|
899
|
-
Orchestrator =
|
|
900
|
-
|
|
1168
|
+
Orchestrator = _ts_decorate([
|
|
1169
|
+
creatable()
|
|
901
1170
|
], Orchestrator);
|
|
1171
|
+
function isLocalActor(actor) {
|
|
1172
|
+
return actor instanceof ActorV3;
|
|
1173
|
+
}
|
|
1174
|
+
__name(isLocalActor, "isLocalActor");
|
|
1175
|
+
function formatError(err) {
|
|
1176
|
+
if (err instanceof Error) return `${err.message}${err.stack ? `
|
|
1177
|
+
${err.stack}` : ""}`;
|
|
1178
|
+
return String(err);
|
|
1179
|
+
}
|
|
1180
|
+
__name(formatError, "formatError");
|
|
902
1181
|
|
|
903
1182
|
// src/shared/provider/SimpleRejectedTransactionsArchivistProvider.ts
|
|
904
|
-
import { assertEx as
|
|
1183
|
+
import { assertEx as assertEx4 } from "@xylabs/sdk-js";
|
|
905
1184
|
import { AbstractCreatableProvider, creatableProvider } from "@xyo-network/xl1-sdk";
|
|
906
|
-
function
|
|
1185
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
907
1186
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
908
1187
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
909
1188
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
910
1189
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
911
1190
|
}
|
|
912
|
-
__name(
|
|
1191
|
+
__name(_ts_decorate2, "_ts_decorate");
|
|
913
1192
|
var RejectedTransactionsArchivistProviderMoniker = "RejectedTransactionsArchivistProvider";
|
|
914
1193
|
var SimpleRejectedTransactionsArchivistProvider = class _SimpleRejectedTransactionsArchivistProvider extends AbstractCreatableProvider {
|
|
915
1194
|
static {
|
|
@@ -927,11 +1206,11 @@ var SimpleRejectedTransactionsArchivistProvider = class _SimpleRejectedTransacti
|
|
|
927
1206
|
static async paramsHandler(params) {
|
|
928
1207
|
return {
|
|
929
1208
|
...await super.paramsHandler(params),
|
|
930
|
-
archivist:
|
|
1209
|
+
archivist: assertEx4(params?.archivist, () => "archivist is required")
|
|
931
1210
|
};
|
|
932
1211
|
}
|
|
933
1212
|
};
|
|
934
|
-
SimpleRejectedTransactionsArchivistProvider =
|
|
1213
|
+
SimpleRejectedTransactionsArchivistProvider = _ts_decorate2([
|
|
935
1214
|
creatableProvider()
|
|
936
1215
|
], SimpleRejectedTransactionsArchivistProvider);
|
|
937
1216
|
|
|
@@ -954,18 +1233,21 @@ function basicRemoteViewerLocator(name, remoteConfig, dataLakeEndpoint, validato
|
|
|
954
1233
|
__name(basicRemoteViewerLocator, "basicRemoteViewerLocator");
|
|
955
1234
|
|
|
956
1235
|
// src/neutral/config/locators/rootLocatorFromConfig.ts
|
|
957
|
-
import { assertEx as
|
|
1236
|
+
import { assertEx as assertEx5 } from "@xylabs/sdk-js";
|
|
958
1237
|
import { commonLocatorFromConfig, remoteLocatorFromConfig } from "@xyo-network/xl1-sdk";
|
|
959
1238
|
async function rootLocatorFromConfig(context, validateDepsOnRegister = false) {
|
|
960
1239
|
const { config } = context;
|
|
961
1240
|
await commonLocatorFromConfig(context, validateDepsOnRegister);
|
|
962
|
-
const locator =
|
|
1241
|
+
const locator = assertEx5(await (config.remote.rpc ? remoteLocatorFromConfig(context, validateDepsOnRegister) : void 0), () => "Root locator could not be created from config. No supported configuration found.");
|
|
963
1242
|
locator.freeze();
|
|
964
1243
|
return locator;
|
|
965
1244
|
}
|
|
966
1245
|
__name(rootLocatorFromConfig, "rootLocatorFromConfig");
|
|
967
1246
|
export {
|
|
1247
|
+
Actor,
|
|
968
1248
|
ActorMnemonicNotAllowedError,
|
|
1249
|
+
ActorParamsV3Zod,
|
|
1250
|
+
ActorV3,
|
|
969
1251
|
ApiConfigContext,
|
|
970
1252
|
ApiConfigZod,
|
|
971
1253
|
BUILT_IN_DEV_MNEMONIC,
|
|
@@ -979,7 +1261,6 @@ export {
|
|
|
979
1261
|
DEFAULT_MEMPOOL_TRANSACTION_PRUNE_INTERVAL,
|
|
980
1262
|
DefaultServiceProvider,
|
|
981
1263
|
DerivationPathCollisionError,
|
|
982
|
-
FinalizerActor,
|
|
983
1264
|
FinalizerConfigContext,
|
|
984
1265
|
FinalizerConfigZod,
|
|
985
1266
|
GENESIS_REWARD_AMOUNT,
|
|
@@ -1023,7 +1304,6 @@ export {
|
|
|
1023
1304
|
getBuiltInDevMnemonic,
|
|
1024
1305
|
getInsecureGenesisRewardMnemonic,
|
|
1025
1306
|
getResolvedWalletReport,
|
|
1026
|
-
initActorAccount,
|
|
1027
1307
|
initActorSeedPhrase,
|
|
1028
1308
|
initActorWallet,
|
|
1029
1309
|
initBridgedArchivistModule,
|