@xyo-network/chain-mempool 1.19.7 → 1.19.9

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.
Files changed (103) hide show
  1. package/dist/node/MempoolActor.d.ts +20 -0
  2. package/dist/node/MempoolActor.d.ts.map +1 -0
  3. package/dist/node/index.d.ts +2 -1
  4. package/dist/node/index.d.ts.map +1 -1
  5. package/dist/node/index.mjs +87 -385
  6. package/dist/node/index.mjs.map +1 -1
  7. package/dist/node/runMempool.d.ts +4 -0
  8. package/dist/node/runMempool.d.ts.map +1 -0
  9. package/package.json +9 -21
  10. package/src/MempoolActor.ts +83 -0
  11. package/src/index.ts +2 -1
  12. package/src/runMempool.ts +28 -0
  13. package/dist/node/MempoolContext.d.ts +0 -9
  14. package/dist/node/MempoolContext.d.ts.map +0 -1
  15. package/dist/node/helpers/index.d.ts +0 -2
  16. package/dist/node/helpers/index.d.ts.map +0 -1
  17. package/dist/node/helpers/initChainId.d.ts +0 -4
  18. package/dist/node/helpers/initChainId.d.ts.map +0 -1
  19. package/dist/node/manifest/getLocator.d.ts +0 -14
  20. package/dist/node/manifest/getLocator.d.ts.map +0 -1
  21. package/dist/node/manifest/getNode.d.ts +0 -15
  22. package/dist/node/manifest/getNode.d.ts.map +0 -1
  23. package/dist/node/manifest/index.d.ts +0 -6
  24. package/dist/node/manifest/index.d.ts.map +0 -1
  25. package/dist/node/manifest/nodeManifest.d.ts +0 -6
  26. package/dist/node/manifest/nodeManifest.d.ts.map +0 -1
  27. package/dist/node/manifest/private/index.d.ts +0 -5
  28. package/dist/node/manifest/private/index.d.ts.map +0 -1
  29. package/dist/node/manifest/public/index.d.ts +0 -14
  30. package/dist/node/manifest/public/index.d.ts.map +0 -1
  31. package/dist/node/server/app.d.ts +0 -4
  32. package/dist/node/server/app.d.ts.map +0 -1
  33. package/dist/node/server/index.d.ts +0 -11
  34. package/dist/node/server/index.d.ts.map +0 -1
  35. package/dist/node/server/instrumentation.d.ts +0 -9
  36. package/dist/node/server/instrumentation.d.ts.map +0 -1
  37. package/dist/node/server/model.d.ts +0 -5
  38. package/dist/node/server/model.d.ts.map +0 -1
  39. package/dist/node/server/routes/addRoutes.d.ts +0 -3
  40. package/dist/node/server/routes/addRoutes.d.ts.map +0 -1
  41. package/dist/node/server/routes/address/AddressPathParams.d.ts +0 -4
  42. package/dist/node/server/routes/address/AddressPathParams.d.ts.map +0 -1
  43. package/dist/node/server/routes/address/addNodeRoutes.d.ts +0 -3
  44. package/dist/node/server/routes/address/addNodeRoutes.d.ts.map +0 -1
  45. package/dist/node/server/routes/address/get/get.d.ts +0 -4
  46. package/dist/node/server/routes/address/get/get.d.ts.map +0 -1
  47. package/dist/node/server/routes/address/get/index.d.ts +0 -2
  48. package/dist/node/server/routes/address/get/index.d.ts.map +0 -1
  49. package/dist/node/server/routes/address/index.d.ts +0 -2
  50. package/dist/node/server/routes/address/index.d.ts.map +0 -1
  51. package/dist/node/server/routes/address/post/getQueryConfig.d.ts +0 -6
  52. package/dist/node/server/routes/address/post/getQueryConfig.d.ts.map +0 -1
  53. package/dist/node/server/routes/address/post/index.d.ts +0 -2
  54. package/dist/node/server/routes/address/post/index.d.ts.map +0 -1
  55. package/dist/node/server/routes/address/post/post.d.ts +0 -8
  56. package/dist/node/server/routes/address/post/post.d.ts.map +0 -1
  57. package/dist/node/server/routes/dataLake/addDataLakeRoutes.d.ts +0 -3
  58. package/dist/node/server/routes/dataLake/addDataLakeRoutes.d.ts.map +0 -1
  59. package/dist/node/server/routes/dataLake/archivistMiddleware.d.ts +0 -10
  60. package/dist/node/server/routes/dataLake/archivistMiddleware.d.ts.map +0 -1
  61. package/dist/node/server/routes/dataLake/index.d.ts +0 -2
  62. package/dist/node/server/routes/dataLake/index.d.ts.map +0 -1
  63. package/dist/node/server/routes/healthz/addHealthRoutes.d.ts +0 -3
  64. package/dist/node/server/routes/healthz/addHealthRoutes.d.ts.map +0 -1
  65. package/dist/node/server/routes/healthz/index.d.ts +0 -2
  66. package/dist/node/server/routes/healthz/index.d.ts.map +0 -1
  67. package/dist/node/server/routes/index.d.ts +0 -4
  68. package/dist/node/server/routes/index.d.ts.map +0 -1
  69. package/dist/node/server/server.d.ts +0 -11
  70. package/dist/node/server/server.d.ts.map +0 -1
  71. package/src/MempoolContext.ts +0 -12
  72. package/src/global.d.ts +0 -13
  73. package/src/helpers/index.ts +0 -1
  74. package/src/helpers/initChainId.ts +0 -20
  75. package/src/manifest/getLocator.ts +0 -70
  76. package/src/manifest/getNode.ts +0 -32
  77. package/src/manifest/index.ts +0 -5
  78. package/src/manifest/node.json +0 -17
  79. package/src/manifest/nodeManifest.ts +0 -8
  80. package/src/manifest/private/index.ts +0 -4
  81. package/src/manifest/public/Chain.json +0 -63
  82. package/src/manifest/public/Pending.json +0 -35
  83. package/src/manifest/public/index.ts +0 -20
  84. package/src/server/app.ts +0 -31
  85. package/src/server/index.ts +0 -13
  86. package/src/server/instrumentation.ts +0 -15
  87. package/src/server/model.ts +0 -5
  88. package/src/server/routes/addRoutes.ts +0 -11
  89. package/src/server/routes/address/AddressPathParams.ts +0 -3
  90. package/src/server/routes/address/addNodeRoutes.ts +0 -21
  91. package/src/server/routes/address/get/get.ts +0 -30
  92. package/src/server/routes/address/get/index.ts +0 -1
  93. package/src/server/routes/address/index.ts +0 -1
  94. package/src/server/routes/address/post/getQueryConfig.ts +0 -23
  95. package/src/server/routes/address/post/index.ts +0 -1
  96. package/src/server/routes/address/post/post.ts +0 -77
  97. package/src/server/routes/dataLake/addDataLakeRoutes.ts +0 -9
  98. package/src/server/routes/dataLake/archivistMiddleware.ts +0 -85
  99. package/src/server/routes/dataLake/index.ts +0 -1
  100. package/src/server/routes/healthz/addHealthRoutes.ts +0 -14
  101. package/src/server/routes/healthz/index.ts +0 -1
  102. package/src/server/routes/index.ts +0 -3
  103. package/src/server/server.ts +0 -147
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/chain-mempool",
3
- "version": "1.19.7",
3
+ "version": "1.19.9",
4
4
  "description": "XYO Layer One API",
5
5
  "homepage": "https://xylabs.com",
6
6
  "bugs": {
@@ -49,39 +49,27 @@
49
49
  "types": "tsc --noEmit -p tsconfig.test.json"
50
50
  },
51
51
  "dependencies": {
52
- "@opentelemetry/instrumentation": "~0.211.0",
53
- "@opentelemetry/instrumentation-express": "~0.59.0",
54
- "@opentelemetry/instrumentation-http": "~0.211.0",
55
- "@xylabs/express": "~5.0.65",
56
- "@xylabs/sdk-js": "~5.0.65",
52
+ "@xylabs/sdk-js": "~5.0.79",
57
53
  "@xyo-network/archivist-model": "~5.3.2",
58
54
  "@xyo-network/boundwitness-model": "~5.3.2",
59
- "@xyo-network/chain-orchestration": "~1.19.7",
60
- "@xyo-network/chain-telemetry": "~1.19.7",
61
- "@xyo-network/chain-utils": "~1.19.7",
62
- "@xyo-network/chain-validation": "~1.19.7",
55
+ "@xyo-network/chain-orchestration": "~1.19.9",
63
56
  "@xyo-network/manifest-model": "~5.3.2",
64
- "@xyo-network/module-abstract": "~5.3.2",
65
57
  "@xyo-network/module-factory-locator": "~5.3.2",
66
58
  "@xyo-network/module-model": "~5.3.2",
67
59
  "@xyo-network/node-model": "~5.3.2",
68
- "@xyo-network/payload-builder": "~5.3.2",
69
60
  "@xyo-network/payload-model": "~5.3.2",
70
61
  "@xyo-network/wallet-model": "~5.3.2",
71
- "@xyo-network/xl1-sdk": "~1.22.30",
72
- "compression": "~1.8.1",
73
- "cors": "~2.8.6",
74
- "express": "~5.2.1",
75
- "http-status-codes": "~2.3.0"
62
+ "@xyo-network/xl1-sdk": "~1.23.14",
63
+ "async-mutex": "^0.5.0"
76
64
  },
77
65
  "devDependencies": {
78
66
  "@types/compression": "~1.8.1",
79
67
  "@types/cors": "~2.8.19",
80
68
  "@types/express": "5.0.6",
81
69
  "@types/express-serve-static-core": "~5.1.1",
82
- "@types/node": "~25.2.1",
83
- "@xylabs/mongo": "~5.0.65",
84
- "@xylabs/sdk-js": "~5.0.65",
70
+ "@types/node": "~25.2.3",
71
+ "@xylabs/mongo": "~5.0.79",
72
+ "@xylabs/sdk-js": "~5.0.79",
85
73
  "@xylabs/ts-scripts-yarn3": "~7.3.2",
86
74
  "@xylabs/tsconfig": "~7.3.2",
87
75
  "@xyo-network/account": "~5.3.2",
@@ -98,7 +86,7 @@
98
86
  "@xyo-network/node-memory": "~5.3.2",
99
87
  "@xyo-network/sentinel-memory": "~5.3.2",
100
88
  "@xyo-network/wallet": "~5.3.2",
101
- "@xyo-network/xl1-sdk": "~1.22.30",
89
+ "@xyo-network/xl1-sdk": "~1.23.14",
102
90
  "async-mutex": "~0.5.0",
103
91
  "dotenv": "~17.2.4",
104
92
  "eslint": "^9.39.2",
@@ -0,0 +1,83 @@
1
+ import { creatable } from '@xylabs/sdk-js'
2
+ import {
3
+ ActorParamsV3,
4
+ ActorV3,
5
+ Config,
6
+ MempoolRunner,
7
+ MempoolRunnerMoniker,
8
+ } from '@xyo-network/xl1-sdk'
9
+ import { Mutex } from 'async-mutex'
10
+
11
+ export type MempoolActorParams = ActorParamsV3<{
12
+ config: Config
13
+ }>
14
+
15
+ @creatable()
16
+ export class MempoolActor extends ActorV3<MempoolActorParams> {
17
+ protected _mempoolRunner!: MempoolRunner
18
+
19
+ private _blockTimerId: ReturnType<typeof setInterval> | null = null
20
+ private _blockTimerMutex = new Mutex()
21
+
22
+ private _transactionTimerId: ReturnType<typeof setInterval> | null = null
23
+ private _transactionTimerMutex = new Mutex()
24
+
25
+ protected get mempoolRunner() {
26
+ return this._mempoolRunner
27
+ }
28
+
29
+ override async createHandler() {
30
+ await super.createHandler()
31
+ this._mempoolRunner = await this.locator.getInstance(MempoolRunnerMoniker)
32
+ }
33
+
34
+ override async startHandler() {
35
+ await super.startHandler()
36
+ this.restartTransactionTimer()
37
+ this.restartBlockTimer()
38
+ }
39
+
40
+ override async stopHandler() {
41
+ await super.stopHandler()
42
+ this.stopTransactionTimer()
43
+ this.stopBlockTimer()
44
+ }
45
+
46
+ private restartBlockTimer() {
47
+ this.stopBlockTimer()
48
+ this._blockTimerId = setInterval(() => {
49
+ if (this._blockTimerMutex.isLocked()) {
50
+ return
51
+ }
52
+ void this._blockTimerMutex.runExclusive(async () => {
53
+ await this.mempoolRunner.prunePendingBlocks({ batchSize: 50 })
54
+ })
55
+ }, 1000)
56
+ }
57
+
58
+ private restartTransactionTimer() {
59
+ this.stopTransactionTimer()
60
+ this._transactionTimerId = setInterval(() => {
61
+ if (this._transactionTimerMutex.isLocked()) {
62
+ return
63
+ }
64
+ void this._transactionTimerMutex.runExclusive(async () => {
65
+ await this.mempoolRunner.prunePendingTransactions({ batchSize: 50 })
66
+ })
67
+ }, 1000)
68
+ }
69
+
70
+ private stopBlockTimer() {
71
+ if (this._blockTimerId !== null) {
72
+ clearInterval(this._blockTimerId)
73
+ }
74
+ this._blockTimerId = null
75
+ }
76
+
77
+ private stopTransactionTimer() {
78
+ if (this._transactionTimerId !== null) {
79
+ clearInterval(this._transactionTimerId)
80
+ }
81
+ this._transactionTimerId = null
82
+ }
83
+ }
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
- export * from './server/index.ts'
1
+ export * from './MempoolActor.ts'
2
+ export * from './runMempool.ts'
@@ -0,0 +1,28 @@
1
+ import { exists } from '@xylabs/sdk-js'
2
+ import { initMempoolWallet, type OrchestratorInstance } from '@xyo-network/chain-orchestration'
3
+ import type {
4
+ Config,
5
+ ProviderFactoryLocatorInstance,
6
+ } from '@xyo-network/xl1-sdk'
7
+
8
+ import { MempoolActor } from './MempoolActor.ts'
9
+
10
+ export const runMempool = async (
11
+ config: Config,
12
+ orchestrator: OrchestratorInstance,
13
+ locator: ProviderFactoryLocatorInstance,
14
+ ) => {
15
+ const account = await initMempoolWallet({ config, logger: locator.context.logger })
16
+ // Create actors
17
+ const mempool = await MempoolActor.create({
18
+ account, config, locator,
19
+ })
20
+ const actors = [mempool].filter(exists)
21
+
22
+ for (const actor of actors) {
23
+ // Register the actor with the orchestrator
24
+ await orchestrator.registerActor(actor)
25
+ }
26
+ // Start the orchestrator => automatically activates the actor
27
+ await orchestrator.start()
28
+ }
@@ -1,9 +0,0 @@
1
- import type { NodeInstance } from '@xyo-network/node-model';
2
- import type { WithStorageMeta } from '@xyo-network/payload-model';
3
- import type { BalancesStepSummary, CreatableProviderContext, MapType, TransfersStepSummary } from '@xyo-network/xl1-sdk';
4
- export interface MempoolContext extends CreatableProviderContext {
5
- balancesSummaryMap: MapType<string, WithStorageMeta<BalancesStepSummary>>;
6
- node: NodeInstance;
7
- transfersSummaryMap: MapType<string, WithStorageMeta<TransfersStepSummary>>;
8
- }
9
- //# sourceMappingURL=MempoolContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MempoolContext.d.ts","sourceRoot":"","sources":["../../src/MempoolContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EACV,mBAAmB,EAAE,wBAAwB,EAAE,OAAO,EACtD,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,cAAe,SAAQ,wBAAwB;IAC9D,kBAAkB,EAAE,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,mBAAmB,CAAC,CAAC,CAAA;IACzE,IAAI,EAAE,YAAY,CAAA;IAClB,mBAAmB,EAAE,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAA;CAC5E"}
@@ -1,2 +0,0 @@
1
- export * from './initChainId.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { Config } from '@xyo-network/xl1-sdk';
2
- export declare const canUseChainId: (config: Config) => boolean;
3
- export declare const getChainId: (config: Config) => number;
4
- //# sourceMappingURL=initChainId.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"initChainId.d.ts","sourceRoot":"","sources":["../../../src/helpers/initChainId.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,OAE9C,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,WAUxC,CAAA"}
@@ -1,14 +0,0 @@
1
- import type { Logger } from '@xylabs/sdk-js';
2
- import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator';
3
- import type { Config } from '@xyo-network/xl1-sdk';
4
- export interface GetLocatorContext {
5
- config: Config;
6
- logger?: Logger;
7
- }
8
- /**
9
- * Used for retrieving a locator with the necessary modules registered for testing
10
- * operation of the node (entirely in memory)
11
- * @returns A locator with the necessary modules registered
12
- */
13
- export declare const getLocator: (context: GetLocatorContext) => Promise<ModuleFactoryLocator>;
14
- //# sourceMappingURL=getLocator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getLocator.d.ts","sourceRoot":"","sources":["../../../src/manifest/getLocator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAO5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAG1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAGlD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAU,SAAS,iBAAiB,kCA6C1D,CAAA"}
@@ -1,15 +0,0 @@
1
- import type { Logger } from '@xylabs/sdk-js';
2
- import type { WalletInstance } from '@xyo-network/wallet-model';
3
- import type { Config } from '@xyo-network/xl1-sdk';
4
- export interface GetNodeContext {
5
- config: Config;
6
- logger?: Logger;
7
- wallet: WalletInstance;
8
- }
9
- /**
10
- * Creates a node with the xyo-chain modules registered
11
- * @param context The context to use for the node
12
- * @returns A node with the xyo-chain modules registered
13
- */
14
- export declare const getNode: (context: GetNodeContext) => Promise<import("@xyo-network/node-memory").MemoryNode<import("@xyo-network/node-memory").MemoryNodeParams, import("@xyo-network/node-model").NodeModuleEventData>>;
15
- //# sourceMappingURL=getNode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getNode.d.ts","sourceRoot":"","sources":["../../../src/manifest/getNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAOlD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,cAAc,CAAA;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAU,SAAS,cAAc,uKAUpD,CAAA"}
@@ -1,6 +0,0 @@
1
- export * from './getLocator.ts';
2
- export * from './getNode.ts';
3
- export * from './nodeManifest.ts';
4
- export * from './private/index.ts';
5
- export * from './public/index.ts';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/manifest/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA"}
@@ -1,6 +0,0 @@
1
- import type { PackageManifestPayload } from '@xyo-network/manifest-model';
2
- /**
3
- * Root Node Manifest
4
- */
5
- export declare const NodeManifest: PackageManifestPayload;
6
- //# sourceMappingURL=nodeManifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nodeManifest.d.ts","sourceRoot":"","sources":["../../../src/manifest/nodeManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAIzE;;GAEG;AACH,eAAO,MAAM,YAAY,EAAsB,sBAAsB,CAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Private Child Manifests
3
- */
4
- export declare const PrivateChildManifests: never[];
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/manifest/private/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,qBAAqB,SAAK,CAAA"}
@@ -1,14 +0,0 @@
1
- import type { ModuleManifest, PackageManifestPayload } from '@xyo-network/manifest-model';
2
- /**
3
- * Chain Node Manifest
4
- */
5
- export declare const ChainNodeManifest: PackageManifestPayload;
6
- /**
7
- * Pending Node Manifest
8
- */
9
- export declare const PendingNodeManifest: PackageManifestPayload;
10
- /**
11
- * Public Child Manifests
12
- */
13
- export declare const PublicChildManifests: ModuleManifest[];
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/manifest/public/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAKzF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAuB,sBAAsB,CAAA;AAC3E;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAyB,sBAAsB,CAAA;AAC/E;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,cAAc,EAGhD,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { Express } from 'express';
2
- import type { MempoolContext } from '../MempoolContext.ts';
3
- export declare const getApp: (context: MempoolContext) => Express;
4
- //# sourceMappingURL=app.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/server/app.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAI1D,eAAO,MAAM,MAAM,GAAI,SAAS,cAAc,KAAG,OAiBhD,CAAA"}
@@ -1,11 +0,0 @@
1
- export * from './app.ts';
2
- export * from './server.ts';
3
- import type { NodeInstance } from '@xyo-network/node-model';
4
- declare global {
5
- namespace Express {
6
- interface Application {
7
- node: NodeInstance;
8
- }
9
- }
10
- }
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,OAAO,CAAC;QAChB,UAAU,WAAW;YACnB,IAAI,EAAE,YAAY,CAAA;SACnB;KACF;CACF"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Registers OpenTelemetry instrumentations for HTTP and Express.
3
- * This function is used to set up the necessary instrumentations for monitoring
4
- * HTTP requests and Express applications. Since it monkey patches the Express
5
- * router & middleware system, it should be called before any Express applications
6
- * are defined.
7
- */
8
- export declare const addInstrumentation: () => void;
9
- //# sourceMappingURL=instrumentation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../src/server/instrumentation.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,YAG9B,CAAA"}
@@ -1,5 +0,0 @@
1
- import type { BaseContext, Config } from '@xyo-network/xl1-sdk';
2
- export interface AppContext extends BaseContext {
3
- config: Config;
4
- }
5
- //# sourceMappingURL=model.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/server/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE/D,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,MAAM,EAAE,MAAM,CAAA;CACf"}
@@ -1,3 +0,0 @@
1
- import type { Express } from 'express';
2
- export declare const addRoutes: (app: Express) => void;
3
- //# sourceMappingURL=addRoutes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addRoutes.d.ts","sourceRoot":"","sources":["../../../../src/server/routes/addRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAMtC,eAAO,MAAM,SAAS,GAAI,KAAK,OAAO,SAIrC,CAAA"}
@@ -1,4 +0,0 @@
1
- export type AddressPathParams = {
2
- address: string;
3
- };
4
- //# sourceMappingURL=AddressPathParams.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AddressPathParams.d.ts","sourceRoot":"","sources":["../../../../../src/server/routes/address/AddressPathParams.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Express } from 'express';
2
- export declare const addNodeRoutes: (app: Express) => void;
3
- //# sourceMappingURL=addNodeRoutes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addNodeRoutes.d.ts","sourceRoot":"","sources":["../../../../../src/server/routes/address/addNodeRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAMtC,eAAO,MAAM,aAAa,GAAI,KAAK,OAAO,SAczC,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { Payload } from '@xyo-network/payload-model';
2
- import type { AddressPathParams } from '../AddressPathParams.ts';
3
- export declare const getAddress: (req: import("express").Request<AddressPathParams, Payload[], any, import("qs").ParsedQs, Record<string, any>>, res: import("express").Response<Payload[], Record<string, any>>, next: import("express").NextFunction) => Promise<unknown>;
4
- //# sourceMappingURL=get.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../../../src/server/routes/address/get/get.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAIzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAsBhE,eAAO,MAAM,UAAU,4OAAwB,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './get.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/server/routes/address/get/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './addNodeRoutes.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/server/routes/address/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
@@ -1,6 +0,0 @@
1
- import type { QueryBoundWitness } from '@xyo-network/boundwitness-model';
2
- import type { ModuleConfig, ModuleInstance } from '@xyo-network/module-model';
3
- import type { Payload } from '@xyo-network/payload-model';
4
- import type { Request } from 'express';
5
- export declare const getQueryConfig: (mod: ModuleInstance, req: Request, bw: QueryBoundWitness, payloads?: Payload[]) => ModuleConfig | undefined;
6
- //# sourceMappingURL=getQueryConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getQueryConfig.d.ts","sourceRoot":"","sources":["../../../../../../src/server/routes/address/post/getQueryConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAEtF,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAItC,eAAO,MAAM,cAAc,GAAI,KAAK,cAAc,EAAE,KAAK,OAAO,EAAE,IAAI,iBAAiB,EAAE,WAAW,OAAO,EAAE,KAAG,YAAY,GAAG,SAa9H,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './post.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/server/routes/address/post/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
@@ -1,8 +0,0 @@
1
- import { type QueryBoundWitness } from '@xyo-network/boundwitness-model';
2
- import type { ModuleQueryResult } from '@xyo-network/module-model';
3
- import type { ModuleError, Payload } from '@xyo-network/payload-model';
4
- import type { AddressPathParams } from '../AddressPathParams.ts';
5
- type PostAddressRequestBody = [QueryBoundWitness, undefined | Payload[]];
6
- export declare const postAddress: (req: import("express").Request<AddressPathParams, ModuleError | ModuleQueryResult, PostAddressRequestBody, import("qs").ParsedQs, Record<string, any>>, res: import("express").Response<ModuleError | ModuleQueryResult, Record<string, any>>, next: import("express").NextFunction) => Promise<unknown>;
7
- export {};
8
- //# sourceMappingURL=post.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../../../src/server/routes/address/post/post.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAE7F,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAItE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAGhE,KAAK,sBAAsB,GAAG,CAAC,iBAAiB,EAAE,SAAS,GAAG,OAAO,EAAE,CAAC,CAAA;AA2DxE,eAAO,MAAM,WAAW,2SAAwB,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Express } from 'express';
2
- export declare const addDataLakeRoutes: (app: Express) => void;
3
- //# sourceMappingURL=addDataLakeRoutes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addDataLakeRoutes.d.ts","sourceRoot":"","sources":["../../../../../src/server/routes/dataLake/addDataLakeRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAItC,eAAO,MAAM,iBAAiB,GAAI,KAAK,OAAO,SAI7C,CAAA"}
@@ -1,10 +0,0 @@
1
- import type { ModuleIdentifier } from '@xyo-network/module-model';
2
- import type { NodeInstance } from '@xyo-network/node-model';
3
- import type { Router } from 'express';
4
- type ArchivistMiddlewareOptions = {
5
- archivistModuleIdentifier: ModuleIdentifier;
6
- node: NodeInstance;
7
- };
8
- export declare const archivistMiddleware: (options: ArchivistMiddlewareOptions) => Router;
9
- export {};
10
- //# sourceMappingURL=archivistMiddleware.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"archivistMiddleware.d.ts","sourceRoot":"","sources":["../../../../../src/server/routes/dataLake/archivistMiddleware.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAI3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAiBrC,KAAK,0BAA0B,GAAG;IAChC,yBAAyB,EAAE,gBAAgB,CAAA;IAC3C,IAAI,EAAE,YAAY,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,SAAS,0BAA0B,KAAG,MAkDzE,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './addDataLakeRoutes.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/server/routes/dataLake/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Express } from 'express';
2
- export declare const addHealthRoutes: (app: Express) => void;
3
- //# sourceMappingURL=addHealthRoutes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addHealthRoutes.d.ts","sourceRoot":"","sources":["../../../../../src/server/routes/healthz/addHealthRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGtC,eAAO,MAAM,eAAe,GAAI,KAAK,OAAO,SAU3C,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './addHealthRoutes.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/server/routes/healthz/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './address/index.ts';
2
- export * from './addRoutes.ts';
3
- export * from './healthz/index.ts';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/server/routes/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA"}
@@ -1,11 +0,0 @@
1
- import type { Logger } from '@xylabs/sdk-js';
2
- import type { NodeInstance } from '@xyo-network/node-model';
3
- import type { Config } from '@xyo-network/xl1-sdk';
4
- interface GetServerContext {
5
- config: Config;
6
- logger?: Logger;
7
- node?: NodeInstance;
8
- }
9
- export declare const getServer: (context: GetServerContext) => Promise<import("node:http").Server<typeof import("node:http").IncomingMessage, typeof import("node:http").ServerResponse>>;
10
- export {};
11
- //# sourceMappingURL=server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/server/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAW5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAEV,MAAM,EAEP,MAAM,sBAAsB,CAAA;AAa7B,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,YAAY,CAAA;CACpB;AA+BD,eAAO,MAAM,SAAS,GAAU,SAAS,gBAAgB,+HAkFxD,CAAA"}
@@ -1,12 +0,0 @@
1
- import type { NodeInstance } from '@xyo-network/node-model'
2
- import type { WithStorageMeta } from '@xyo-network/payload-model'
3
- import type {
4
- BalancesStepSummary, CreatableProviderContext, MapType,
5
- TransfersStepSummary,
6
- } from '@xyo-network/xl1-sdk'
7
-
8
- export interface MempoolContext extends CreatableProviderContext {
9
- balancesSummaryMap: MapType<string, WithStorageMeta<BalancesStepSummary>>
10
- node: NodeInstance
11
- transfersSummaryMap: MapType<string, WithStorageMeta<TransfersStepSummary>>
12
- }
package/src/global.d.ts DELETED
@@ -1,13 +0,0 @@
1
- export * from './app.ts'
2
- export * from './server.ts'
3
-
4
- import type { MempoolContext } from './ApiContext.ts'
5
-
6
- declare global {
7
-
8
- namespace Express {
9
- interface Application {
10
- context: MempoolContext
11
- }
12
- }
13
- }
@@ -1 +0,0 @@
1
- export * from './initChainId.ts'
@@ -1,20 +0,0 @@
1
- import {
2
- assertEx, hexFrom, isDefined, isHex,
3
- } from '@xylabs/sdk-js'
4
- import type { Config } from '@xyo-network/xl1-sdk'
5
-
6
- export const canUseChainId = (config: Config): boolean => {
7
- return isDefined(config.evm.chainId)
8
- }
9
-
10
- export const getChainId = (config: Config) => {
11
- const chainId = assertEx(config.evm.chainId, () => 'Missing config.evm.chainId')
12
- if (isHex(chainId, { prefix: true })) {
13
- const hex = hexFrom(chainId)
14
- const parsed = Number.parseInt(hex, 16)
15
- return parsed
16
- } else {
17
- const parsed = Number.parseInt(chainId, 10)
18
- return parsed
19
- }
20
- }