@xyo-network/chain-orchestration 1.19.16 → 1.19.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/archivists/RejectedTransactions/local.d.ts.map +1 -1
- package/dist/neutral/config/actors/Api.d.ts +22 -22
- package/dist/neutral/config/actors/Bridge.d.ts.map +1 -1
- package/dist/neutral/config/actors/Mempool.d.ts +22 -22
- package/dist/neutral/config/actors/RewardRedemption.d.ts +22 -22
- package/dist/neutral/config/locators/actors/bridgeLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/config/locators/localLocatorFromConfig.d.ts +2 -2
- package/dist/neutral/config/locators/localLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/config/locators/remoteLocatorFromConfig.d.ts +3 -2
- package/dist/neutral/config/locators/remoteLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/config/locators/rootLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/index.mjs +47 -55
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/init/initEvmProvidersIfAvailable.d.ts +2 -2
- package/dist/neutral/init/initEvmProvidersIfAvailable.d.ts.map +1 -1
- package/dist/neutral/init/initWallet.d.ts +1 -1
- package/dist/neutral/init/initWallet.d.ts.map +1 -1
- package/dist/neutral/manifest/getLocator.d.ts +1 -1
- package/dist/neutral/manifest/getLocator.d.ts.map +1 -1
- package/dist/neutral/manifest/loadNode.d.ts +1 -1
- package/dist/neutral/manifest/loadNode.d.ts.map +1 -1
- package/dist/neutral/manifest/nodeManifest.d.ts +1 -1
- package/dist/neutral/manifest/nodeManifest.d.ts.map +1 -1
- package/dist/neutral/manifest/public/index.d.ts +1 -1
- package/dist/neutral/manifest/public/index.d.ts.map +1 -1
- package/package.json +21 -27
- package/src/archivists/RejectedTransactions/local.ts +1 -1
- package/src/config/actors/Api.ts +1 -1
- package/src/config/actors/Bridge.ts +1 -3
- package/src/config/actors/Mempool.ts +1 -1
- package/src/config/actors/Producer.ts +2 -2
- package/src/config/actors/RewardRedemption.ts +1 -1
- package/src/config/locators/actors/bridgeLocatorFromConfig.ts +7 -1
- package/src/config/locators/localLocatorFromConfig.ts +8 -5
- package/src/config/locators/remoteLocatorFromConfig.ts +21 -35
- package/src/config/locators/rootLocatorFromConfig.ts +5 -2
- package/src/init/initActorAccount.ts +1 -1
- package/src/init/initActorSeedPhrase.ts +1 -1
- package/src/init/initEvmProvidersIfAvailable.ts +6 -2
- package/src/init/initWallet.ts +1 -1
- package/src/manifest/getLocator.ts +1 -2
- package/src/manifest/loadNode.ts +1 -1
- package/src/manifest/nodeManifest.ts +1 -1
- package/src/manifest/public/index.ts +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ProviderFactoryLocatorInstance } from '@xyo-network/xl1-sdk';
|
|
2
|
-
export declare function initEvmProvidersIfAvailable(locator: ProviderFactoryLocatorInstance): Promise<ProviderFactoryLocatorInstance
|
|
1
|
+
import type { ChainId, ProviderFactoryLocatorInstance } from '@xyo-network/xl1-sdk';
|
|
2
|
+
export declare function initEvmProvidersIfAvailable(locator: ProviderFactoryLocatorInstance, defaultChainId: ChainId | null): Promise<ProviderFactoryLocatorInstance>;
|
|
3
3
|
//# sourceMappingURL=initEvmProvidersIfAvailable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initEvmProvidersIfAvailable.d.ts","sourceRoot":"","sources":["../../../src/init/initEvmProvidersIfAvailable.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"initEvmProvidersIfAvailable.d.ts","sourceRoot":"","sources":["../../../src/init/initEvmProvidersIfAvailable.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,OAAO,EAEP,8BAA8B,EAC/B,MAAM,sBAAsB,CAAA;AAU7B,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,8BAA8B,EACvC,cAAc,EAAE,OAAO,GAAG,IAAI,GAC7B,OAAO,CAAC,8BAA8B,CAAC,CAyEzC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ActorConfigContext } from '@xyo-network/xl1-sdk';
|
|
2
|
-
export declare function initActorWallet(context: ActorConfigContext, mnemonic?: string): Promise<import("@xyo-network/
|
|
2
|
+
export declare function initActorWallet(context: ActorConfigContext, mnemonic?: string): Promise<import("@xyo-network/sdk-js").WalletInstance>;
|
|
3
3
|
//# sourceMappingURL=initWallet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initWallet.d.ts","sourceRoot":"","sources":["../../../src/init/initWallet.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAI9D,wBAAsB,eAAe,CAAC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,CAAC,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"initWallet.d.ts","sourceRoot":"","sources":["../../../src/init/initWallet.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAI9D,wBAAsB,eAAe,CAAC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,CAAC,EAAE,MAAM,yDAMnF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModuleFactoryLocator } from '@xyo-network/
|
|
1
|
+
import { ModuleFactoryLocator } from '@xyo-network/sdk-js';
|
|
2
2
|
import type { BaseConfigContext } from '@xyo-network/xl1-sdk';
|
|
3
3
|
/**
|
|
4
4
|
* Used for retrieving a locator with the necessary modules registered for testing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocator.d.ts","sourceRoot":"","sources":["../../../src/manifest/getLocator.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"getLocator.d.ts","sourceRoot":"","sources":["../../../src/manifest/getLocator.ts"],"names":[],"mappings":"AAOA,OAAO,EAAmB,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAG7D;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,oBAAoB,iBAAiB,kCA6CtC,CAAA"}
|
|
@@ -4,5 +4,5 @@ import type { BaseConfigContext } from '@xyo-network/xl1-sdk';
|
|
|
4
4
|
* Creates a node with the xyo-chain modules registered
|
|
5
5
|
* @returns A node with the xyo-chain modules registered
|
|
6
6
|
*/
|
|
7
|
-
export declare const loadNode: (context: BaseConfigContext, wallet: WalletInstance) => Promise<import("@xyo-network/
|
|
7
|
+
export declare const loadNode: (context: BaseConfigContext, wallet: WalletInstance) => Promise<import("@xyo-network/sdk-js").MemoryNode<import("@xyo-network/sdk-js").MemoryNodeParams, import("@xyo-network/sdk-js").NodeModuleEventData>>;
|
|
8
8
|
//# sourceMappingURL=loadNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadNode.d.ts","sourceRoot":"","sources":["../../../src/manifest/loadNode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAO7D;;;GAGG;AACH,eAAO,MAAM,QAAQ,GACnB,SAAS,iBAAiB,EAC1B,QAAQ,cAAc,
|
|
1
|
+
{"version":3,"file":"loadNode.d.ts","sourceRoot":"","sources":["../../../src/manifest/loadNode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAO7D;;;GAGG;AACH,eAAO,MAAM,QAAQ,GACnB,SAAS,iBAAiB,EAC1B,QAAQ,cAAc,yJAUvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeManifest.d.ts","sourceRoot":"","sources":["../../../src/manifest/nodeManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"nodeManifest.d.ts","sourceRoot":"","sources":["../../../src/manifest/nodeManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAIjE;;GAEG;AACH,eAAO,MAAM,YAAY,EAAsB,sBAAsB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/manifest/public/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAA0B,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/manifest/public/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAA0B,MAAM,qBAAqB,CAAA;AAajF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,cAAc,EAGhD,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "http://json.schemastore.org/package.json",
|
|
3
2
|
"name": "@xyo-network/chain-orchestration",
|
|
4
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.18",
|
|
5
4
|
"description": "XYO Layer One SDK Orchestration",
|
|
6
5
|
"homepage": "https://xylabs.com",
|
|
7
6
|
"bugs": {
|
|
@@ -39,25 +38,21 @@
|
|
|
39
38
|
"!**/*.test.*"
|
|
40
39
|
],
|
|
41
40
|
"dependencies": {
|
|
42
|
-
"@xyo-network/archivist-lmdb": "~5.3.
|
|
43
|
-
"@xyo-network/archivist-
|
|
44
|
-
"@xyo-network/archivist-
|
|
45
|
-
"@xyo-network/archivist-view": "~5.3.7",
|
|
41
|
+
"@xyo-network/archivist-lmdb": "~5.3.10",
|
|
42
|
+
"@xyo-network/archivist-mongodb": "~5.3.10",
|
|
43
|
+
"@xyo-network/archivist-view": "~5.3.10",
|
|
46
44
|
"@xyo-network/bios": "~7.2.1",
|
|
47
|
-
"@xyo-network/bridge-model": "~5.3.
|
|
48
|
-
"@xyo-network/chain-ethereum": "~1.19.
|
|
49
|
-
"@xyo-network/chain-protocol": "~1.19.
|
|
50
|
-
"@xyo-network/chain-sdk": "~1.19.
|
|
51
|
-
"@xyo-network/chain-services": "~1.19.
|
|
52
|
-
"@xyo-network/chain-telemetry": "~1.19.
|
|
53
|
-
"@xyo-network/chain-utils": "~1.19.
|
|
54
|
-
"@xyo-network/chain-validation": "~1.19.
|
|
55
|
-
"@xyo-network/
|
|
56
|
-
"@xyo-network/
|
|
57
|
-
"@xyo-network/
|
|
58
|
-
"@xyo-network/sdk-js": "~5.3.7",
|
|
59
|
-
"@xyo-network/sentinel-memory": "~5.3.7",
|
|
60
|
-
"@xyo-network/wallet": "~5.3.7",
|
|
45
|
+
"@xyo-network/bridge-model": "~5.3.10",
|
|
46
|
+
"@xyo-network/chain-ethereum": "~1.19.18",
|
|
47
|
+
"@xyo-network/chain-protocol": "~1.19.18",
|
|
48
|
+
"@xyo-network/chain-sdk": "~1.19.18",
|
|
49
|
+
"@xyo-network/chain-services": "~1.19.18",
|
|
50
|
+
"@xyo-network/chain-telemetry": "~1.19.18",
|
|
51
|
+
"@xyo-network/chain-utils": "~1.19.18",
|
|
52
|
+
"@xyo-network/chain-validation": "~1.19.18",
|
|
53
|
+
"@xyo-network/module-abstract": "~5.3.10",
|
|
54
|
+
"@xyo-network/sdk-js": "~5.3.10",
|
|
55
|
+
"@xyo-network/sentinel-memory": "~5.3.10",
|
|
61
56
|
"async-mutex": "~0.5.0"
|
|
62
57
|
},
|
|
63
58
|
"devDependencies": {
|
|
@@ -68,17 +63,16 @@
|
|
|
68
63
|
"@xylabs/ts-scripts-yarn3": "~7.3.2",
|
|
69
64
|
"@xylabs/tsconfig": "~7.3.2",
|
|
70
65
|
"@xylabs/zod": "~5.0.80",
|
|
71
|
-
"@xyo-network/account-model": "~5.3.
|
|
66
|
+
"@xyo-network/account-model": "~5.3.10",
|
|
72
67
|
"@xyo-network/bios-model": "~7.2.1",
|
|
73
|
-
"@xyo-network/
|
|
74
|
-
"@xyo-network/
|
|
75
|
-
"@xyo-network/sdk-js": "~5.3.7",
|
|
68
|
+
"@xyo-network/module-model-mongodb": "~5.3.10",
|
|
69
|
+
"@xyo-network/sdk-js": "~5.3.10",
|
|
76
70
|
"@xyo-network/storage-model": "~7.2.1",
|
|
77
|
-
"@xyo-network/wallet-model": "~5.3.
|
|
78
|
-
"@xyo-network/xl1-sdk": "~1.24.
|
|
71
|
+
"@xyo-network/wallet-model": "~5.3.10",
|
|
72
|
+
"@xyo-network/xl1-sdk": "~1.24.29",
|
|
79
73
|
"axios": "^1.13.5",
|
|
80
74
|
"cosmiconfig": "^9.0.0",
|
|
81
|
-
"eslint": "^9.39.
|
|
75
|
+
"eslint": "^9.39.3",
|
|
82
76
|
"ethers": "^6.16.0",
|
|
83
77
|
"lmdb": "^3.5.1",
|
|
84
78
|
"mongodb": "^7.1.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MemoryArchivist, MemoryArchivistConfigSchema } from '@xyo-network/archivist-memory'
|
|
2
1
|
import type { ArchivistInstance } from '@xyo-network/sdk-js'
|
|
2
|
+
import { MemoryArchivist, MemoryArchivistConfigSchema } from '@xyo-network/sdk-js'
|
|
3
3
|
import { Mutex } from 'async-mutex'
|
|
4
4
|
|
|
5
5
|
const mutex = new Mutex()
|
package/src/config/actors/Api.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AddressZod, HexZod, toAddress, toHex,
|
|
3
|
-
} from '@xylabs/sdk-js'
|
|
4
|
-
import {
|
|
5
3
|
zodAsFactory, zodIsFactory, zodToFactory,
|
|
6
|
-
} from '@xylabs/
|
|
4
|
+
} from '@xylabs/sdk-js'
|
|
7
5
|
import type { ChainId } from '@xyo-network/xl1-sdk'
|
|
8
6
|
import {
|
|
9
7
|
AttoXL1ConvertFactor, BaseConfigContextZod, HostActorConfigZod, XL1,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AddressZod, asAddress } from '@xylabs/sdk-js'
|
|
2
1
|
import {
|
|
2
|
+
AddressZod, asAddress,
|
|
3
3
|
zodAsFactory, zodIsFactory, zodToFactory,
|
|
4
|
-
} from '@xylabs/
|
|
4
|
+
} from '@xylabs/sdk-js'
|
|
5
5
|
import { ActorConfigZod, BaseConfigContextZod } from '@xyo-network/xl1-sdk'
|
|
6
6
|
import { globalRegistry, z } from 'zod'
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/sdk-js'
|
|
2
2
|
import { isDefined, isString } from '@xylabs/sdk-js'
|
|
3
|
-
import { HDWallet } from '@xyo-network/
|
|
3
|
+
import { HDWallet } from '@xyo-network/sdk-js'
|
|
4
4
|
import type {
|
|
5
5
|
ProviderFactoryLocatorInstance, RpcSchemaMap, TransportFactory,
|
|
6
6
|
} from '@xyo-network/xl1-sdk'
|
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
JsonRpcFinalizationViewer,
|
|
17
17
|
JsonRpcMempoolRunner,
|
|
18
18
|
JsonRpcMempoolViewer,
|
|
19
|
+
JsonRpcXyoRunner,
|
|
20
|
+
JsonRpcXyoViewer,
|
|
19
21
|
MempoolRunnerRpcSchemas,
|
|
20
22
|
MempoolViewerRpcSchemas,
|
|
21
23
|
ProviderFactoryLocator,
|
|
@@ -23,6 +25,8 @@ import {
|
|
|
23
25
|
SimpleXyoGatewayRunner,
|
|
24
26
|
SimpleXyoRunner,
|
|
25
27
|
SimpleXyoSigner,
|
|
28
|
+
XyoRunnerRpcSchemas,
|
|
29
|
+
XyoViewerRpcSchemas,
|
|
26
30
|
} from '@xyo-network/xl1-sdk'
|
|
27
31
|
|
|
28
32
|
import type { BridgeConfigContext } from '../../actors/index.ts'
|
|
@@ -57,6 +61,8 @@ export async function bridgeLocatorFromConfig(
|
|
|
57
61
|
{ transport: await transportFactory(FinalizationViewerRpcSchemas) },
|
|
58
62
|
),
|
|
59
63
|
JsonRpcBlockViewer.factory<JsonRpcBlockViewer>(JsonRpcBlockViewer.dependencies, { transport: await transportFactory(BlockViewerRpcSchemas) }),
|
|
64
|
+
JsonRpcXyoRunner.factory<JsonRpcXyoRunner>(JsonRpcXyoRunner.dependencies, { transport: await transportFactory(XyoRunnerRpcSchemas) }),
|
|
65
|
+
JsonRpcXyoViewer.factory<JsonRpcXyoViewer>(JsonRpcXyoViewer.dependencies, { transport: await transportFactory(XyoViewerRpcSchemas) }),
|
|
60
66
|
])
|
|
61
67
|
}
|
|
62
68
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/sdk-js'
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
ActorConfigContext, ChainId, ProviderFactoryLocatorInstance,
|
|
4
|
+
} from '@xyo-network/xl1-sdk'
|
|
3
5
|
import {
|
|
4
6
|
ProviderFactoryLocator,
|
|
5
7
|
SimpleAccountBalanceViewer,
|
|
@@ -8,6 +10,7 @@ import {
|
|
|
8
10
|
SimpleFinalizationViewer,
|
|
9
11
|
SimpleMempoolRunner,
|
|
10
12
|
SimpleMempoolViewer,
|
|
13
|
+
SimpleTransactionViewer,
|
|
11
14
|
SimpleWindowedBlockViewer,
|
|
12
15
|
SimpleXyoConnectionViewer,
|
|
13
16
|
SimpleXyoViewer,
|
|
@@ -21,7 +24,7 @@ import {
|
|
|
21
24
|
export async function localLocatorFromConfig(
|
|
22
25
|
context: ActorConfigContext,
|
|
23
26
|
parent?: ProviderFactoryLocatorInstance,
|
|
24
|
-
): Promise<ProviderFactoryLocatorInstance> {
|
|
27
|
+
): Promise<[ProviderFactoryLocatorInstance, ChainId | null]> {
|
|
25
28
|
const balancesSummaryMap = assertEx(await initBalanceSummaryMap(context), () => 'Balance Summary Map not initialized')
|
|
26
29
|
const transfersSummaryMap = assertEx(await initTransferSummaryMap(context), () => 'Transfer Summary Map not initialized')
|
|
27
30
|
|
|
@@ -35,7 +38,7 @@ export async function localLocatorFromConfig(
|
|
|
35
38
|
wallet,
|
|
36
39
|
)
|
|
37
40
|
|
|
38
|
-
await initFinalizationArchivistIfNeeded(writableChainArchivist, context.config, wallet)
|
|
41
|
+
const [_head, chainId] = await initFinalizationArchivistIfNeeded(writableChainArchivist, context.config, wallet)
|
|
39
42
|
|
|
40
43
|
const locator = new ProviderFactoryLocator({ ...context, locator: parent })
|
|
41
44
|
locator.registerMany([
|
|
@@ -46,11 +49,11 @@ export async function localLocatorFromConfig(
|
|
|
46
49
|
SimpleBlockViewer.factory<SimpleBlockViewer>(SimpleBlockViewer.dependencies, { finalizedArchivist: readonlyChainArchivist }),
|
|
47
50
|
SimpleWindowedBlockViewer.factory<SimpleWindowedBlockViewer>(SimpleWindowedBlockViewer.dependencies, { maxWindowSize: 10_000, syncInterval: 10_000 }),
|
|
48
51
|
SimpleXyoConnectionViewer.factory<SimpleXyoConnectionViewer>(SimpleXyoConnectionViewer.dependencies, {}),
|
|
52
|
+
SimpleTransactionViewer.factory<SimpleTransactionViewer>(SimpleTransactionViewer.dependencies, {}),
|
|
49
53
|
SimpleXyoViewer.factory<SimpleXyoViewer>(SimpleXyoViewer.dependencies, { finalizedArchivist: readonlyChainArchivist }),
|
|
50
54
|
SimpleFinalizationViewer.factory<SimpleFinalizationViewer>(SimpleFinalizationViewer.dependencies, { finalizedArchivist: readonlyChainArchivist }),
|
|
51
55
|
SimpleFinalizationRunner.factory<SimpleFinalizationRunner>(SimpleFinalizationRunner.dependencies, { finalizedArchivist: writableChainArchivist }),
|
|
52
56
|
|
|
53
57
|
])
|
|
54
|
-
locator
|
|
55
|
-
return locator
|
|
58
|
+
return [locator, chainId]
|
|
56
59
|
}
|
|
@@ -1,48 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import type { Promisable } from '@xylabs/sdk-js'
|
|
2
|
+
import type {
|
|
3
|
+
ActorConfigContext, ChainId, ProviderFactoryLocatorInstance,
|
|
4
|
+
} from '@xyo-network/xl1-sdk'
|
|
3
5
|
import {
|
|
6
|
+
JsonRpcAccountBalanceViewer,
|
|
7
|
+
JsonRpcBlockViewer,
|
|
8
|
+
JsonRpcFinalizationViewer,
|
|
9
|
+
JsonRpcMempoolRunner,
|
|
10
|
+
JsonRpcMempoolViewer,
|
|
11
|
+
JsonRpcTransactionViewer,
|
|
12
|
+
JsonRpcXyoViewer,
|
|
4
13
|
ProviderFactoryLocator,
|
|
5
|
-
SimpleAccountBalanceViewer,
|
|
6
|
-
SimpleBlockViewer,
|
|
7
|
-
SimpleFinalizationViewer,
|
|
8
|
-
SimpleMempoolRunner,
|
|
9
|
-
SimpleMempoolViewer,
|
|
10
14
|
SimpleWindowedBlockViewer,
|
|
11
|
-
SimpleXyoViewer,
|
|
12
15
|
} from '@xyo-network/xl1-sdk'
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
initActorWallet, initBalanceSummaryMap,
|
|
16
|
-
initServerNode, initTransferSummaryMap,
|
|
17
|
-
} from '../../init/index.ts'
|
|
18
|
-
|
|
19
|
-
export async function remoteLocatorFromConfig(
|
|
17
|
+
export function remoteLocatorFromConfig(
|
|
20
18
|
context: ActorConfigContext,
|
|
21
19
|
parent?: ProviderFactoryLocatorInstance,
|
|
22
|
-
):
|
|
23
|
-
const balancesSummaryMap = assertEx(await initBalanceSummaryMap(context), () => 'Balance Summary Map not initialized')
|
|
24
|
-
const transfersSummaryMap = assertEx(await initTransferSummaryMap(context), () => 'Transfer Summary Map not initialized')
|
|
25
|
-
|
|
26
|
-
// TODO: this should not be an api wallet, but a server wallet
|
|
27
|
-
const wallet = await initActorWallet(context)
|
|
28
|
-
|
|
29
|
-
const {
|
|
30
|
-
readonlyChainArchivist, pendingTransactionsArchivist, pendingBlocksArchivist,
|
|
31
|
-
} = await initServerNode(
|
|
32
|
-
context,
|
|
33
|
-
wallet,
|
|
34
|
-
)
|
|
35
|
-
|
|
20
|
+
): Promisable<[ProviderFactoryLocatorInstance, ChainId | null]> {
|
|
36
21
|
const locator = new ProviderFactoryLocator({ ...context, locator: parent })
|
|
37
22
|
locator.registerMany([
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
23
|
+
JsonRpcMempoolViewer.factory<JsonRpcMempoolViewer>(JsonRpcMempoolViewer.dependencies, {}),
|
|
24
|
+
JsonRpcMempoolRunner.factory<JsonRpcMempoolRunner>(JsonRpcMempoolRunner.dependencies, {}),
|
|
25
|
+
JsonRpcAccountBalanceViewer.factory<JsonRpcAccountBalanceViewer>(JsonRpcAccountBalanceViewer.dependencies, {}),
|
|
26
|
+
JsonRpcFinalizationViewer.factory<JsonRpcFinalizationViewer>(JsonRpcFinalizationViewer.dependencies, {}),
|
|
27
|
+
JsonRpcBlockViewer.factory<JsonRpcBlockViewer>(JsonRpcBlockViewer.dependencies, {}),
|
|
43
28
|
SimpleWindowedBlockViewer.factory<SimpleWindowedBlockViewer>(SimpleWindowedBlockViewer.dependencies, { maxWindowSize: 10_000, syncInterval: 10_000 }),
|
|
44
|
-
|
|
29
|
+
JsonRpcTransactionViewer.factory<JsonRpcTransactionViewer>(JsonRpcTransactionViewer.dependencies, {}),
|
|
30
|
+
JsonRpcXyoViewer.factory<JsonRpcXyoViewer>(JsonRpcXyoViewer.dependencies, {}),
|
|
45
31
|
])
|
|
46
32
|
locator.freeze()
|
|
47
|
-
return locator
|
|
33
|
+
return [locator, null]
|
|
48
34
|
}
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
SimpleStepRewardsViewer,
|
|
13
13
|
SimpleStepViewer,
|
|
14
14
|
SimpleTimeSyncViewer,
|
|
15
|
+
SimpleTransactionViewer,
|
|
15
16
|
} from '@xyo-network/xl1-sdk'
|
|
16
17
|
|
|
17
18
|
import { initEvmProvidersIfAvailable } from '../../init/index.ts'
|
|
@@ -37,11 +38,13 @@ export async function rootLocatorFromConfig(
|
|
|
37
38
|
SimpleBlockValidationViewer.dependencies,
|
|
38
39
|
{ state: validateHydratedBlockState, protocol: validateHydratedBlock },
|
|
39
40
|
),
|
|
41
|
+
SimpleTransactionViewer.factory<SimpleTransactionViewer>(SimpleTransactionViewer.dependencies, {}),
|
|
40
42
|
])
|
|
41
|
-
|
|
42
|
-
locator = await (isString(config.remote.rpc?.url)
|
|
43
|
+
const [newLocator, chainId] = await (isString(config.remote.rpc?.url)
|
|
43
44
|
? remoteLocatorFromConfig(context, locator)
|
|
44
45
|
: localLocatorFromConfig(context, locator))
|
|
46
|
+
locator = newLocator
|
|
47
|
+
locator = await initEvmProvidersIfAvailable(locator, chainId)
|
|
45
48
|
locator.freeze()
|
|
46
49
|
return locator
|
|
47
50
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/sdk-js'
|
|
2
2
|
import { isDefined, isUndefined } from '@xylabs/sdk-js'
|
|
3
|
-
import { HDWallet } from '@xyo-network/
|
|
3
|
+
import { HDWallet } from '@xyo-network/sdk-js'
|
|
4
4
|
import type { WalletInstance } from '@xyo-network/wallet-model'
|
|
5
5
|
import type { ActorConfigContext } from '@xyo-network/xl1-sdk'
|
|
6
6
|
import { ADDRESS_INDEX, generateXyoBaseWalletFromPhrase } from '@xyo-network/xl1-sdk'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { assertEx, isString } from '@xylabs/sdk-js'
|
|
2
2
|
import type { BiosExternalInterface } from '@xyo-network/bios-model'
|
|
3
|
+
import { HDWallet } from '@xyo-network/sdk-js'
|
|
3
4
|
import type { WalletKind } from '@xyo-network/storage-model'
|
|
4
|
-
import { HDWallet } from '@xyo-network/wallet'
|
|
5
5
|
import type { ActorConfigContext } from '@xyo-network/xl1-sdk'
|
|
6
6
|
|
|
7
7
|
// TODO: Make nodejs version of bios support round tripping mnemonic between boots
|
|
@@ -15,7 +15,11 @@ import {
|
|
|
15
15
|
|
|
16
16
|
import { canUseEvmProvider, initEvmProvider } from '../evm/index.ts'
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
/* TODO: Rename function since it initializes both EVM and non-EVM providers */
|
|
19
|
+
export async function initEvmProvidersIfAvailable(
|
|
20
|
+
locator: ProviderFactoryLocatorInstance,
|
|
21
|
+
defaultChainId: ChainId | null,
|
|
22
|
+
): Promise<ProviderFactoryLocatorInstance> {
|
|
19
23
|
const context = locator.context
|
|
20
24
|
const { logger, config } = context
|
|
21
25
|
if (canUseEvmProvider(context)) {
|
|
@@ -54,7 +58,7 @@ export async function initEvmProvidersIfAvailable(locator: ProviderFactoryLocato
|
|
|
54
58
|
} else {
|
|
55
59
|
logger?.warn('EVM provider not available - running with memory based contract/stake viewers')
|
|
56
60
|
const positions: Position[] = []
|
|
57
|
-
const chainId = assertEx(config.chain.id, () => 'Missing config.chain.
|
|
61
|
+
const chainId = assertEx(config.chain.id ?? defaultChainId, () => 'Missing config.chain.id or defaultChainId (required for non-EVM providers)')
|
|
58
62
|
|
|
59
63
|
// Register the contract events viewer
|
|
60
64
|
locator.register(SimpleStakeEventsViewer.factory<SimpleStakeEventsViewer>(
|
package/src/init/initWallet.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isDefined } from '@xylabs/sdk-js'
|
|
2
2
|
import { boot } from '@xyo-network/bios'
|
|
3
|
-
import { HDWallet } from '@xyo-network/
|
|
3
|
+
import { HDWallet } from '@xyo-network/sdk-js'
|
|
4
4
|
import type { ActorConfigContext } from '@xyo-network/xl1-sdk'
|
|
5
5
|
|
|
6
6
|
import { initActorSeedPhrase } from './initActorSeedPhrase.ts'
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { type BaseMongoSdkPrivateConfig } from '@xylabs/mongo'
|
|
2
2
|
import { isDefined } from '@xylabs/sdk-js'
|
|
3
|
-
import { MemoryArchivist } from '@xyo-network/archivist-memory'
|
|
4
3
|
import { MongoDBArchivistV2, MongoDBArchivistV2Deletable } from '@xyo-network/archivist-mongodb'
|
|
5
4
|
import { ViewArchivist } from '@xyo-network/archivist-view'
|
|
6
5
|
import { initTelemetry } from '@xyo-network/chain-telemetry'
|
|
7
6
|
import { AbstractModule, LoggerModuleStatusReporter } from '@xyo-network/module-abstract'
|
|
8
|
-
import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
|
|
9
7
|
import type { MongoDBModuleParamsV2 } from '@xyo-network/module-model-mongodb'
|
|
8
|
+
import { MemoryArchivist, ModuleFactoryLocator } from '@xyo-network/sdk-js'
|
|
10
9
|
import { MemorySentinel } from '@xyo-network/sentinel-memory'
|
|
11
10
|
import type { BaseConfigContext } from '@xyo-network/xl1-sdk'
|
|
12
11
|
import { hasMongoConfig } from '@xyo-network/xl1-sdk'
|
package/src/manifest/loadNode.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ModuleManifest, PackageManifestPayload } from '@xyo-network/
|
|
1
|
+
import type { ModuleManifest, PackageManifestPayload } from '@xyo-network/sdk-js'
|
|
2
2
|
|
|
3
3
|
import Chain from './Chain.json' with { type: 'json' }
|
|
4
4
|
import Pending from './Pending.json' with { type: 'json' }
|