@xyo-network/chain-bridge 1.15.27 → 1.16.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/node/driver/indexer/ChainBlockIteration/ChainHashIterationService.d.ts +2 -1
- package/dist/node/driver/indexer/ChainBlockIteration/ChainHashIterationService.d.ts.map +1 -1
- package/dist/node/driver/indexer/ChainBlocksObservable.d.ts +2 -1
- package/dist/node/driver/indexer/ChainBlocksObservable.d.ts.map +1 -1
- package/dist/node/manifest/getLocator.d.ts.map +1 -1
- package/dist/node/server/routes/address/get/get.d.ts.map +1 -1
- package/package.json +53 -53
- package/src/driver/indexer/ChainBlockIteration/ChainHashIterationService.ts +2 -1
- package/src/driver/indexer/ChainBlocksObservable.ts +2 -3
- package/src/driver/indexer/spec/ChainBlocksObservable.spec.ts +2 -1
- package/src/driver/indexer/spec/ChainHydratedBlocksObservable.spec.ts +2 -2
- package/src/manifest/getLocator.ts +1 -2
- package/src/server/routes/address/get/get.ts +8 -10
|
@@ -4,7 +4,8 @@ import type { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
|
4
4
|
import type { BaseServiceParams } from '@xyo-network/chain-services';
|
|
5
5
|
import { BaseService } from '@xyo-network/chain-services';
|
|
6
6
|
import type { WithStorageMeta } from '@xyo-network/payload-model';
|
|
7
|
-
import { type BlockBoundWitness
|
|
7
|
+
import { type BlockBoundWitness } from '@xyo-network/xl1-protocol';
|
|
8
|
+
import type { ChainIteratorServiceEventData, EventingChainHashIteratorService } from '@xyo-network/xl1-protocol-sdk';
|
|
8
9
|
export interface ChainHashIterationServiceParams extends BaseServiceParams {
|
|
9
10
|
chainArchivist: ArchivistInstance;
|
|
10
11
|
head: BlockBoundWitness;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainHashIterationService.d.ts","sourceRoot":"","sources":["../../../../../src/driver/indexer/ChainBlockIteration/ChainHashIterationService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAIjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAC+B,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ChainHashIterationService.d.ts","sourceRoot":"","sources":["../../../../../src/driver/indexer/ChainBlockIteration/ChainHashIterationService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAIjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAC+B,KAAK,iBAAiB,EAE3D,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,6BAA6B,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAA;AAEpH,MAAM,WAAW,+BAAgC,SAAQ,iBAAiB;IACxE,cAAc,EAAE,iBAAiB,CAAA;IACjC,IAAI,EAAE,iBAAiB,CAAA;CACxB;AAED,qBAAa,yBAA0B,SAAQ,WAAW,CAAC,+BAA+B,EAAE,6BAA6B,CACvH,YAAW,gCAAgC;IAC3C,SAAS,CAAC,YAAY,EAAE,eAAe,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAA;IAEtE,IAAI,cAAc,IAAI,iBAAiB,CAAgD;IAEvF,IAAI,OAAO,IAAI,GAAG,CAA2G;IAE7H,GAAG,CAAC,EAAE,EAAE,IAAI,GAAG,UAAU,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAIlD,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;IAUnD,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,eAAe,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAC;IAKvE,QAAQ,CAAC,KAAK,GAAE,IAAI,GAAG,SAAqB,EAAE,KAAK,GAAE,MAAU,GAAG,OAAO,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAqB/G,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;YAM1C,iDAAiD;YAKjD,yCAAyC;CAMxD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { WithStorageMeta } from '@xyo-network/payload-model';
|
|
2
|
-
import type { BlockBoundWitness
|
|
2
|
+
import type { BlockBoundWitness } from '@xyo-network/xl1-protocol';
|
|
3
|
+
import type { EventingChainBlockNumberIteratorService } from '@xyo-network/xl1-protocol-sdk';
|
|
3
4
|
import type { Observable } from 'rxjs';
|
|
4
5
|
export declare const chainBlocks$: (chainIterator: EventingChainBlockNumberIteratorService) => Observable<WithStorageMeta<BlockBoundWitness>>;
|
|
5
6
|
//# sourceMappingURL=ChainBlocksObservable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainBlocksObservable.d.ts","sourceRoot":"","sources":["../../../../src/driver/indexer/ChainBlocksObservable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ChainBlocksObservable.d.ts","sourceRoot":"","sources":["../../../../src/driver/indexer/ChainBlocksObservable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,KAAK,EAAE,uCAAuC,EAAiB,MAAM,+BAA+B,CAAA;AAC3G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAKtC,eAAO,MAAM,YAAY,GACvB,eAAe,uCAAuC,KACrD,UAAU,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAkC/C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocator.d.ts","sourceRoot":"","sources":["../../../src/manifest/getLocator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"getLocator.d.ts","sourceRoot":"","sources":["../../../src/manifest/getLocator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAW5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAI1E,OAAO,KAAK,EACW,MAAM,EAC5B,MAAM,+BAA+B,CAAA;AAKtC,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAU,SAAS,iBAAiB,kCAqE1D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../../../src/server/routes/address/get/get.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAIzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../../../src/server/routes/address/get/get.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAIzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAsBhE,eAAO,MAAM,UAAU,4OAAwB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/chain-bridge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "XYO Layer One Bridge",
|
|
5
5
|
"homepage": "https://xylabs.com",
|
|
6
6
|
"bugs": {
|
|
@@ -46,33 +46,33 @@
|
|
|
46
46
|
"types": "tsc --noEmit -p tsconfig.test.json"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@opentelemetry/instrumentation": "~0.
|
|
50
|
-
"@opentelemetry/instrumentation-express": "~0.
|
|
51
|
-
"@opentelemetry/instrumentation-http": "~0.
|
|
52
|
-
"@xylabs/creatable": "~5.0.
|
|
53
|
-
"@xylabs/express": "~5.0.
|
|
54
|
-
"@xylabs/hex": "~5.0.
|
|
55
|
-
"@xylabs/logger": "~5.0.
|
|
56
|
-
"@xylabs/mongo": "~5.0.
|
|
57
|
-
"@xylabs/typeof": "~5.0.
|
|
58
|
-
"@xyo-network/archivist-model": "~5.1.
|
|
59
|
-
"@xyo-network/boundwitness-model": "~5.1.
|
|
60
|
-
"@xyo-network/chain-protocol": "~1.
|
|
61
|
-
"@xyo-network/manifest-model": "~5.1.
|
|
62
|
-
"@xyo-network/module-factory-locator": "~5.1.
|
|
63
|
-
"@xyo-network/module-model": "~5.1.
|
|
64
|
-
"@xyo-network/node-model": "~5.1.
|
|
65
|
-
"@xyo-network/payload-builder": "~5.1.
|
|
66
|
-
"@xyo-network/payload-model": "~5.1.
|
|
49
|
+
"@opentelemetry/instrumentation": "~0.208.0",
|
|
50
|
+
"@opentelemetry/instrumentation-express": "~0.57.0",
|
|
51
|
+
"@opentelemetry/instrumentation-http": "~0.208.0",
|
|
52
|
+
"@xylabs/creatable": "~5.0.19",
|
|
53
|
+
"@xylabs/express": "~5.0.19",
|
|
54
|
+
"@xylabs/hex": "~5.0.19",
|
|
55
|
+
"@xylabs/logger": "~5.0.19",
|
|
56
|
+
"@xylabs/mongo": "~5.0.19",
|
|
57
|
+
"@xylabs/typeof": "~5.0.19",
|
|
58
|
+
"@xyo-network/archivist-model": "~5.1.18",
|
|
59
|
+
"@xyo-network/boundwitness-model": "~5.1.18",
|
|
60
|
+
"@xyo-network/chain-protocol": "~1.16.0",
|
|
61
|
+
"@xyo-network/manifest-model": "~5.1.18",
|
|
62
|
+
"@xyo-network/module-factory-locator": "~5.1.18",
|
|
63
|
+
"@xyo-network/module-model": "~5.1.18",
|
|
64
|
+
"@xyo-network/node-model": "~5.1.18",
|
|
65
|
+
"@xyo-network/payload-builder": "~5.1.18",
|
|
66
|
+
"@xyo-network/payload-model": "~5.1.18",
|
|
67
67
|
"@xyo-network/typechain": "~4.0.10",
|
|
68
|
-
"@xyo-network/wallet-model": "~5.1.
|
|
69
|
-
"@xyo-network/xl1-protocol": "~1.
|
|
70
|
-
"@xyo-network/xl1-protocol-sdk": "~1.
|
|
68
|
+
"@xyo-network/wallet-model": "~5.1.18",
|
|
69
|
+
"@xyo-network/xl1-protocol": "~1.13.0",
|
|
70
|
+
"@xyo-network/xl1-protocol-sdk": "~1.16.0",
|
|
71
71
|
"compression": "~1.8.1",
|
|
72
72
|
"cors": "~2.8.5",
|
|
73
73
|
"express": "~5.1.0",
|
|
74
74
|
"http-status-codes": "~2.3.0",
|
|
75
|
-
"mongodb": "~
|
|
75
|
+
"mongodb": "~7.0.0",
|
|
76
76
|
"rxjs": "~7.8.2",
|
|
77
77
|
"uuid": "~13.0.0",
|
|
78
78
|
"zod": "~4.1.12"
|
|
@@ -82,44 +82,44 @@
|
|
|
82
82
|
"@types/cors": "~2.8.19",
|
|
83
83
|
"@types/express": "5.0.5",
|
|
84
84
|
"@types/express-serve-static-core": "~5.1.0",
|
|
85
|
-
"@types/node": "~24.
|
|
86
|
-
"@xylabs/assert": "~5.0.
|
|
87
|
-
"@xylabs/base": "~5.0.
|
|
88
|
-
"@xylabs/delay": "~5.0.
|
|
89
|
-
"@xylabs/object": "~5.0.
|
|
90
|
-
"@xylabs/promise": "~5.0.
|
|
91
|
-
"@xylabs/ts-scripts-yarn3": "~7.
|
|
92
|
-
"@xylabs/tsconfig": "~7.
|
|
93
|
-
"@xyo-network/account": "~5.1.
|
|
94
|
-
"@xyo-network/account-model": "~5.1.
|
|
95
|
-
"@xyo-network/archivist-abstract": "~5.1.
|
|
96
|
-
"@xyo-network/archivist-memory": "~5.1.
|
|
97
|
-
"@xyo-network/archivist-mongodb": "~5.1.
|
|
98
|
-
"@xyo-network/archivist-view": "~5.1.
|
|
85
|
+
"@types/node": "~24.10.0",
|
|
86
|
+
"@xylabs/assert": "~5.0.19",
|
|
87
|
+
"@xylabs/base": "~5.0.19",
|
|
88
|
+
"@xylabs/delay": "~5.0.19",
|
|
89
|
+
"@xylabs/object": "~5.0.19",
|
|
90
|
+
"@xylabs/promise": "~5.0.19",
|
|
91
|
+
"@xylabs/ts-scripts-yarn3": "~7.2.4",
|
|
92
|
+
"@xylabs/tsconfig": "~7.2.4",
|
|
93
|
+
"@xyo-network/account": "~5.1.18",
|
|
94
|
+
"@xyo-network/account-model": "~5.1.18",
|
|
95
|
+
"@xyo-network/archivist-abstract": "~5.1.18",
|
|
96
|
+
"@xyo-network/archivist-memory": "~5.1.18",
|
|
97
|
+
"@xyo-network/archivist-mongodb": "~5.1.18",
|
|
98
|
+
"@xyo-network/archivist-view": "~5.1.18",
|
|
99
99
|
"@xyo-network/bios": "~7.1.1",
|
|
100
100
|
"@xyo-network/bios-model": "~7.1.1",
|
|
101
|
-
"@xyo-network/boundwitness-builder": "~5.1.
|
|
102
|
-
"@xyo-network/chain-modules": "~1.
|
|
103
|
-
"@xyo-network/chain-protocol": "~1.
|
|
104
|
-
"@xyo-network/chain-services": "~1.
|
|
105
|
-
"@xyo-network/chain-telemetry": "~1.
|
|
106
|
-
"@xyo-network/manifest-wrapper": "~5.1.
|
|
107
|
-
"@xyo-network/module-abstract": "~5.1.
|
|
108
|
-
"@xyo-network/module-abstract-mongodb": "~5.1.
|
|
109
|
-
"@xyo-network/module-model-mongodb": "~5.1.
|
|
110
|
-
"@xyo-network/node-memory": "~5.1.
|
|
111
|
-
"@xyo-network/payload-builder": "~5.1.
|
|
112
|
-
"@xyo-network/sentinel-memory": "~5.1.
|
|
113
|
-
"@xyo-network/wallet": "~5.1.
|
|
114
|
-
"@xyo-network/xl1-protocol": "~1.
|
|
101
|
+
"@xyo-network/boundwitness-builder": "~5.1.18",
|
|
102
|
+
"@xyo-network/chain-modules": "~1.16.0",
|
|
103
|
+
"@xyo-network/chain-protocol": "~1.16.0",
|
|
104
|
+
"@xyo-network/chain-services": "~1.16.0",
|
|
105
|
+
"@xyo-network/chain-telemetry": "~1.16.0",
|
|
106
|
+
"@xyo-network/manifest-wrapper": "~5.1.18",
|
|
107
|
+
"@xyo-network/module-abstract": "~5.1.18",
|
|
108
|
+
"@xyo-network/module-abstract-mongodb": "~5.1.18",
|
|
109
|
+
"@xyo-network/module-model-mongodb": "~5.1.18",
|
|
110
|
+
"@xyo-network/node-memory": "~5.1.18",
|
|
111
|
+
"@xyo-network/payload-builder": "~5.1.18",
|
|
112
|
+
"@xyo-network/sentinel-memory": "~5.1.18",
|
|
113
|
+
"@xyo-network/wallet": "~5.1.18",
|
|
114
|
+
"@xyo-network/xl1-protocol": "~1.13.0",
|
|
115
115
|
"dotenv": "~17.2.3",
|
|
116
|
-
"eslint": "^9.39.
|
|
116
|
+
"eslint": "^9.39.1",
|
|
117
117
|
"ethers": "~6.15.0",
|
|
118
118
|
"http-status-codes": "~2.3.0",
|
|
119
119
|
"nodemon": "~3.1.10",
|
|
120
120
|
"tslib": "~2.8.1",
|
|
121
121
|
"typescript": "~5.9.3",
|
|
122
|
-
"vitest": "~
|
|
122
|
+
"vitest": "~4.0.8",
|
|
123
123
|
"vitest-mock-extended": "~3.1.0"
|
|
124
124
|
},
|
|
125
125
|
"engines": {
|
|
@@ -10,9 +10,10 @@ import { BaseService } from '@xyo-network/chain-services'
|
|
|
10
10
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
11
11
|
import type { WithStorageMeta } from '@xyo-network/payload-model'
|
|
12
12
|
import {
|
|
13
|
-
asBlockBoundWitnessWithStorageMeta, type BlockBoundWitness,
|
|
13
|
+
asBlockBoundWitnessWithStorageMeta, type BlockBoundWitness,
|
|
14
14
|
isBlockBoundWitnessWithStorageMeta,
|
|
15
15
|
} from '@xyo-network/xl1-protocol'
|
|
16
|
+
import type { ChainIteratorServiceEventData, EventingChainHashIteratorService } from '@xyo-network/xl1-protocol-sdk'
|
|
16
17
|
|
|
17
18
|
export interface ChainHashIterationServiceParams extends BaseServiceParams {
|
|
18
19
|
chainArchivist: ArchivistInstance
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { isDefined, isUndefined } from '@xylabs/typeof'
|
|
2
2
|
import type { WithStorageMeta } from '@xyo-network/payload-model'
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
} from '@xyo-network/xl1-protocol'
|
|
3
|
+
import type { BlockBoundWitness } from '@xyo-network/xl1-protocol'
|
|
4
|
+
import type { EventingChainBlockNumberIteratorService, HeadEventArgs } from '@xyo-network/xl1-protocol-sdk'
|
|
6
5
|
import type { Observable } from 'rxjs'
|
|
7
6
|
import {
|
|
8
7
|
concatMap, defer, fromEvent, mergeMap,
|
|
@@ -4,7 +4,8 @@ import { MemoryArchivist, MemoryArchivistConfigSchema } from '@xyo-network/archi
|
|
|
4
4
|
import type { ArchivistInstance } from '@xyo-network/archivist-model'
|
|
5
5
|
import { buildRandomChain } from '@xyo-network/chain-protocol'
|
|
6
6
|
import { ChainBlockNumberIterationService } from '@xyo-network/chain-services'
|
|
7
|
-
import type {
|
|
7
|
+
import type { HydratedBlock } from '@xyo-network/xl1-protocol'
|
|
8
|
+
import type { EventingChainBlockNumberIteratorService } from '@xyo-network/xl1-protocol-sdk'
|
|
8
9
|
import {
|
|
9
10
|
flattenHydratedBlocks, getDefaultConfig, readPayloadMapFromStore,
|
|
10
11
|
} from '@xyo-network/xl1-protocol-sdk'
|
|
@@ -5,8 +5,8 @@ import type { ArchivistInstance } from '@xyo-network/archivist-model'
|
|
|
5
5
|
import { buildRandomChain } from '@xyo-network/chain-protocol'
|
|
6
6
|
import { ChainBlockNumberIterationService } from '@xyo-network/chain-services'
|
|
7
7
|
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model'
|
|
8
|
-
import type {
|
|
9
|
-
import type { PayloadMapRead } from '@xyo-network/xl1-protocol-sdk'
|
|
8
|
+
import type { HydratedBlock } from '@xyo-network/xl1-protocol'
|
|
9
|
+
import type { EventingChainBlockNumberIteratorService, PayloadMapRead } from '@xyo-network/xl1-protocol-sdk'
|
|
10
10
|
import {
|
|
11
11
|
flattenHydratedBlocks, getDefaultConfig, readPayloadMapFromStore,
|
|
12
12
|
} from '@xyo-network/xl1-protocol-sdk'
|
|
@@ -10,7 +10,6 @@ import { ViewArchivist } from '@xyo-network/archivist-view'
|
|
|
10
10
|
import {
|
|
11
11
|
AddressBalanceDivinerV2, ArchivistSyncDiviner, HeadValidationDiviner,
|
|
12
12
|
} from '@xyo-network/chain-modules'
|
|
13
|
-
import { MemoryMap } from '@xyo-network/chain-protocol'
|
|
14
13
|
import { initTelemetry } from '@xyo-network/chain-telemetry'
|
|
15
14
|
import { AbstractModule, LoggerModuleStatusReporter } from '@xyo-network/module-abstract'
|
|
16
15
|
import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
|
|
@@ -20,7 +19,7 @@ import { MemorySentinel } from '@xyo-network/sentinel-memory'
|
|
|
20
19
|
import type {
|
|
21
20
|
BalancesStepSummary, Config, MapType,
|
|
22
21
|
} from '@xyo-network/xl1-protocol-sdk'
|
|
23
|
-
import { hasMongoConfig } from '@xyo-network/xl1-protocol-sdk'
|
|
22
|
+
import { hasMongoConfig, MemoryMap } from '@xyo-network/xl1-protocol-sdk'
|
|
24
23
|
|
|
25
24
|
import { MongoMap } from '../driver/index.ts'
|
|
26
25
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { assertEx } from '@xylabs/assert'
|
|
2
1
|
import { asyncHandler } from '@xylabs/express'
|
|
3
|
-
import { asAddress
|
|
4
|
-
import {
|
|
2
|
+
import { asAddress } from '@xylabs/hex'
|
|
3
|
+
import { isDefined } from '@xylabs/typeof'
|
|
4
|
+
import { isModuleName } from '@xyo-network/module-model'
|
|
5
5
|
import type { Payload } from '@xyo-network/payload-model'
|
|
6
6
|
import type { RequestHandler } from 'express'
|
|
7
7
|
import { StatusCodes } from 'http-status-codes'
|
|
@@ -9,22 +9,20 @@ import { StatusCodes } from 'http-status-codes'
|
|
|
9
9
|
import type { AddressPathParams } from '../AddressPathParams.ts'
|
|
10
10
|
|
|
11
11
|
const handler: RequestHandler<AddressPathParams, Payload[]> = async (req, res, next) => {
|
|
12
|
-
const { address:
|
|
12
|
+
const { address: moduleIdentifier } = req.params
|
|
13
13
|
const { node } = req.app
|
|
14
|
-
const address = asAddress(
|
|
15
|
-
if (address
|
|
14
|
+
const address = asAddress(moduleIdentifier)
|
|
15
|
+
if (isDefined(address)) {
|
|
16
16
|
let mod = node.address === address ? node : (await node.resolve(address, { direction: 'down' }))
|
|
17
17
|
if (mod) {
|
|
18
18
|
res.json(await mod.state())
|
|
19
19
|
return
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
if (
|
|
23
|
-
const moduleIdentifier = toAddress(rawAddress)
|
|
22
|
+
if (isModuleName(moduleIdentifier)) {
|
|
24
23
|
const mod = await node.resolve(moduleIdentifier, { direction: 'down' })
|
|
25
24
|
if (mod) {
|
|
26
|
-
|
|
27
|
-
res.redirect(StatusCodes.MOVED_TEMPORARILY, `/${moduleAddress}`)
|
|
25
|
+
res.redirect(StatusCodes.MOVED_TEMPORARILY, `/${mod.address}`)
|
|
28
26
|
return
|
|
29
27
|
}
|
|
30
28
|
}
|