@substrate/api-sidecar 20.8.0 → 20.9.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/build/package.json +1 -1
- package/build/src/Specs.js +1 -0
- package/build/src/Specs.js.map +1 -1
- package/build/src/chains-config/assetHubKusamaControllers.js +1 -0
- package/build/src/chains-config/assetHubKusamaControllers.js.map +1 -1
- package/build/src/chains-config/assetHubNextWestendControllers.js +1 -0
- package/build/src/chains-config/assetHubNextWestendControllers.js.map +1 -1
- package/build/src/chains-config/assetHubPolkadotControllers.js +1 -0
- package/build/src/chains-config/assetHubPolkadotControllers.js.map +1 -1
- package/build/src/chains-config/assetHubWestendControllers.js +1 -0
- package/build/src/chains-config/assetHubWestendControllers.js.map +1 -1
- package/build/src/chains-config/defaultControllers.js +1 -0
- package/build/src/chains-config/defaultControllers.js.map +1 -1
- package/build/src/chains-config/index.js +8 -1
- package/build/src/chains-config/index.js.map +1 -1
- package/build/src/chains-config/kusamaControllers.js +1 -0
- package/build/src/chains-config/kusamaControllers.js.map +1 -1
- package/build/src/chains-config/polkadotControllers.js +1 -0
- package/build/src/chains-config/polkadotControllers.js.map +1 -1
- package/build/src/chains-config/westendControllers.js +1 -0
- package/build/src/chains-config/westendControllers.js.map +1 -1
- package/build/src/controllers/AbstractController.d.ts +1 -1
- package/build/src/controllers/AbstractController.js +8 -7
- package/build/src/controllers/AbstractController.js.map +1 -1
- package/build/src/controllers/blocks/BlocksController.js +251 -186
- package/build/src/controllers/blocks/BlocksController.js.map +1 -1
- package/build/src/controllers/blocks/BlocksExtrinsicsController.js +52 -48
- package/build/src/controllers/blocks/BlocksExtrinsicsController.js.map +1 -1
- package/build/src/controllers/blocks/BlocksParaInclusionsController.d.ts +19 -0
- package/build/src/controllers/blocks/BlocksParaInclusionsController.js +52 -0
- package/build/src/controllers/blocks/BlocksParaInclusionsController.js.map +1 -0
- package/build/src/controllers/blocks/BlocksRawExtrinsicsController.js +18 -14
- package/build/src/controllers/blocks/BlocksRawExtrinsicsController.js.map +1 -1
- package/build/src/controllers/blocks/index.d.ts +1 -0
- package/build/src/controllers/blocks/index.js +3 -1
- package/build/src/controllers/blocks/index.js.map +1 -1
- package/build/src/controllers/index.d.ts +5 -3
- package/build/src/controllers/index.js +3 -1
- package/build/src/controllers/index.js.map +1 -1
- package/build/src/controllers/rc/blocks/RcBlocksParaInclusionsController.d.ts +19 -0
- package/build/src/controllers/rc/blocks/RcBlocksParaInclusionsController.js +59 -0
- package/build/src/controllers/rc/blocks/RcBlocksParaInclusionsController.js.map +1 -0
- package/build/src/controllers/rc/blocks/index.d.ts +1 -0
- package/build/src/controllers/rc/blocks/index.js +3 -1
- package/build/src/controllers/rc/blocks/index.js.map +1 -1
- package/build/src/services/blocks/BlocksParaInclusionsService.d.ts +17 -0
- package/build/src/services/blocks/BlocksParaInclusionsService.js +85 -0
- package/build/src/services/blocks/BlocksParaInclusionsService.js.map +1 -0
- package/build/src/services/blocks/index.d.ts +1 -0
- package/build/src/services/blocks/index.js +1 -0
- package/build/src/services/blocks/index.js.map +1 -1
- package/build/src/types/responses/BlockParaInclusions.d.ts +77 -0
- package/build/src/types/responses/BlockParaInclusions.js +18 -0
- package/build/src/types/responses/BlockParaInclusions.js.map +1 -0
- package/build/src/types/responses/index.d.ts +1 -0
- package/build/src/types/responses/index.js +1 -0
- package/build/src/types/responses/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -33,58 +33,62 @@ class BlocksExtrinsicsController extends AbstractController_1.default {
|
|
|
33
33
|
const useRcBlockArg = useRcBlock === 'true';
|
|
34
34
|
if (useRcBlockArg) {
|
|
35
35
|
// Treat the blockId parameter as a relay chain block identifier
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!hash) {
|
|
36
|
+
const rcAtResults = await this.getHashFromRcAt(blockId);
|
|
37
|
+
// Return empty array if no Asset Hub blocks found
|
|
38
|
+
if (rcAtResults.length === 0) {
|
|
40
39
|
BlocksExtrinsicsController.sanitizedSend(res, []);
|
|
41
40
|
return;
|
|
42
41
|
}
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
this.
|
|
42
|
+
// Process each Asset Hub block found
|
|
43
|
+
const results = [];
|
|
44
|
+
for (const { ahHash, rcBlockNumber } of rcAtResults) {
|
|
45
|
+
const eventDocsArg = eventDocs === 'true';
|
|
46
|
+
const extrinsicDocsArg = extrinsicDocs === 'true';
|
|
47
|
+
const noFeesArg = noFees === 'true';
|
|
48
|
+
const options = {
|
|
49
|
+
eventDocs: eventDocsArg,
|
|
50
|
+
extrinsicDocs: extrinsicDocsArg,
|
|
51
|
+
checkFinalized: true,
|
|
52
|
+
queryFinalizedHead: false,
|
|
53
|
+
omitFinalizedTag: true,
|
|
54
|
+
noFees: noFeesArg,
|
|
55
|
+
checkDecodedXcm: false,
|
|
56
|
+
paraId: undefined,
|
|
57
|
+
useEvmAddressFormat: useEvmFormat === 'true',
|
|
58
|
+
};
|
|
59
|
+
const cacheKey = ahHash.toString() +
|
|
60
|
+
Number(options.eventDocs) +
|
|
61
|
+
Number(options.extrinsicDocs) +
|
|
62
|
+
Number(options.checkFinalized) +
|
|
63
|
+
Number(options.noFees) +
|
|
64
|
+
Number(options.checkDecodedXcm) +
|
|
65
|
+
Number(options.useEvmAddressFormat);
|
|
66
|
+
const isBlockCached = this.blockStore.get(cacheKey);
|
|
67
|
+
const historicApi = await this.api.at(ahHash);
|
|
68
|
+
const block = isBlockCached ? isBlockCached : await this.service.fetchBlock(ahHash, historicApi, options);
|
|
69
|
+
if (!isBlockCached) {
|
|
70
|
+
this.blockStore.set(cacheKey, block);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Verify our param `extrinsicIndex` is an integer represented as a string
|
|
74
|
+
*/
|
|
75
|
+
this.parseNumberOrThrow(extrinsicIndex, '`exstrinsicIndex` path param is not a number');
|
|
76
|
+
/**
|
|
77
|
+
* Change extrinsicIndex from a type string to a number before passing it
|
|
78
|
+
* into any service.
|
|
79
|
+
*/
|
|
80
|
+
const index = parseInt(extrinsicIndex, 10);
|
|
81
|
+
const extrinsic = this.service.fetchExtrinsicByIndex(block, index);
|
|
82
|
+
const apiAt = await this.api.at(ahHash);
|
|
83
|
+
const ahTimestamp = await apiAt.query.timestamp.now();
|
|
84
|
+
const enhancedResult = {
|
|
85
|
+
...extrinsic,
|
|
86
|
+
rcBlockNumber,
|
|
87
|
+
ahTimestamp: ahTimestamp.toString(),
|
|
88
|
+
};
|
|
89
|
+
results.push(enhancedResult);
|
|
69
90
|
}
|
|
70
|
-
|
|
71
|
-
* Verify our param `extrinsicIndex` is an integer represented as a string
|
|
72
|
-
*/
|
|
73
|
-
this.parseNumberOrThrow(extrinsicIndex, '`exstrinsicIndex` path param is not a number');
|
|
74
|
-
/**
|
|
75
|
-
* Change extrinsicIndex from a type string to a number before passing it
|
|
76
|
-
* into any service.
|
|
77
|
-
*/
|
|
78
|
-
const index = parseInt(extrinsicIndex, 10);
|
|
79
|
-
const extrinsic = this.service.fetchExtrinsicByIndex(block, index);
|
|
80
|
-
const apiAt = await this.api.at(hash);
|
|
81
|
-
const ahTimestamp = await apiAt.query.timestamp.now();
|
|
82
|
-
const enhancedResult = {
|
|
83
|
-
...extrinsic,
|
|
84
|
-
rcBlockNumber,
|
|
85
|
-
ahTimestamp: ahTimestamp.toString(),
|
|
86
|
-
};
|
|
87
|
-
BlocksExtrinsicsController.sanitizedSend(res, [enhancedResult]);
|
|
91
|
+
BlocksExtrinsicsController.sanitizedSend(res, results);
|
|
88
92
|
}
|
|
89
93
|
else {
|
|
90
94
|
const hash = await this.getHashForBlock(blockId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlocksExtrinsicsController.js","sourceRoot":"","sources":["../../../../src/controllers/blocks/BlocksExtrinsicsController.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;AAMxE,wDAA+D;AAC/D,6CAA+C;AAG/C,+EAAuD;AAEvD,MAAqB,0BAA2B,SAAQ,4BAAiC;IAIxF,YAAY,GAAW,EAAE,OAA0B;QAClD,KAAK,CACJ,GAAG,EACH,6BAA6B,EAC7B,IAAI,wBAAa,CAAC,GAAG,EAAE,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,cAAc,CAAC,CACzE,CAAC;QAUH;;;;WAIG;QACK,4BAAuB,GAAsE,KAAK,EACzG,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,EAC9G,GAAG,EACa,EAAE;YAClB,MAAM,aAAa,GAAG,UAAU,KAAK,MAAM,CAAC;YAE5C,IAAI,aAAa,EAAE,CAAC;gBACnB,gEAAgE;gBAChE,MAAM,
|
|
1
|
+
{"version":3,"file":"BlocksExtrinsicsController.js","sourceRoot":"","sources":["../../../../src/controllers/blocks/BlocksExtrinsicsController.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,g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AC,QAAQ,EAAE,SAAS,CAAC,CAAC,AAA1B,CAA2B;kBAH7B,0BAA0B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BlocksParaInclusionsService } from '../../services';
|
|
2
|
+
import AbstractController from '../AbstractController';
|
|
3
|
+
/**
|
|
4
|
+
* Controller for /blocks/{blockId}/para-inclusions endpoint
|
|
5
|
+
* Returns all decoded parachain inclusion information for a relay chain block
|
|
6
|
+
*/
|
|
7
|
+
export default class BlocksParaInclusionsController extends AbstractController<BlocksParaInclusionsService> {
|
|
8
|
+
static controllerName: string;
|
|
9
|
+
static requiredPallets: string[][];
|
|
10
|
+
constructor(api: string);
|
|
11
|
+
protected initRoutes(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Get all parachain inclusions for a relay chain block
|
|
14
|
+
*
|
|
15
|
+
* @param blockId - The relay chain block identifier (hash or number)
|
|
16
|
+
* @param paraId - Optional parachain ID to filter results
|
|
17
|
+
*/
|
|
18
|
+
private getParaInclusions;
|
|
19
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
|
|
3
|
+
// This file is part of Substrate API Sidecar.
|
|
4
|
+
//
|
|
5
|
+
// Substrate API Sidecar is free software: you can redistribute it and/or modify
|
|
6
|
+
// it under the terms of the GNU General Public License as published by
|
|
7
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
// (at your option) any later version.
|
|
9
|
+
//
|
|
10
|
+
// This program is distributed in the hope that it will be useful,
|
|
11
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
// GNU General Public License for more details.
|
|
14
|
+
//
|
|
15
|
+
// You should have received a copy of the GNU General Public License
|
|
16
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const services_1 = require("../../services");
|
|
22
|
+
const AbstractController_1 = __importDefault(require("../AbstractController"));
|
|
23
|
+
/**
|
|
24
|
+
* Controller for /blocks/{blockId}/para-inclusions endpoint
|
|
25
|
+
* Returns all decoded parachain inclusion information for a relay chain block
|
|
26
|
+
*/
|
|
27
|
+
class BlocksParaInclusionsController extends AbstractController_1.default {
|
|
28
|
+
constructor(api) {
|
|
29
|
+
super(api, '/blocks/:blockId/para-inclusions', new services_1.BlocksParaInclusionsService(api));
|
|
30
|
+
/**
|
|
31
|
+
* Get all parachain inclusions for a relay chain block
|
|
32
|
+
*
|
|
33
|
+
* @param blockId - The relay chain block identifier (hash or number)
|
|
34
|
+
* @param paraId - Optional parachain ID to filter results
|
|
35
|
+
*/
|
|
36
|
+
this.getParaInclusions = async ({ params: { blockId }, query: { paraId } }, res) => {
|
|
37
|
+
const hash = await this.getHashForBlock(blockId);
|
|
38
|
+
const paraIdFilter = paraId
|
|
39
|
+
? this.parseNumberOrThrow(paraId, 'paraId must be a valid integer')
|
|
40
|
+
: undefined;
|
|
41
|
+
BlocksParaInclusionsController.sanitizedSend(res, await this.service.fetchParaInclusions(hash, paraIdFilter));
|
|
42
|
+
};
|
|
43
|
+
this.initRoutes();
|
|
44
|
+
}
|
|
45
|
+
initRoutes() {
|
|
46
|
+
this.safeMountAsyncGetHandlers([['', this.getParaInclusions]]);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
BlocksParaInclusionsController.controllerName = 'BlocksParaInclusions';
|
|
50
|
+
BlocksParaInclusionsController.requiredPallets = [['ParaInclusion']];
|
|
51
|
+
exports.default = BlocksParaInclusionsController;
|
|
52
|
+
//# sourceMappingURL=BlocksParaInclusionsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlocksParaInclus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C,eAAe,CAAC,CAAC,AAAtB,CAAuB;kBAFzB,8BAA8B"}
|
|
@@ -34,22 +34,26 @@ class BlocksRawExtrinsicsController extends AbstractController_1.default {
|
|
|
34
34
|
let rawBlock;
|
|
35
35
|
if (useRcBlockArg) {
|
|
36
36
|
// Treat the blockId parameter as a relay chain block identifier
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (!hash) {
|
|
37
|
+
const rcAtResults = await this.getHashFromRcAt(blockId);
|
|
38
|
+
// Return empty array if no Asset Hub blocks found
|
|
39
|
+
if (rcAtResults.length === 0) {
|
|
41
40
|
BlocksRawExtrinsicsController.sanitizedSend(res, []);
|
|
42
41
|
return;
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
// Process each Asset Hub block found
|
|
44
|
+
const results = [];
|
|
45
|
+
for (const { ahHash, rcBlockNumber } of rcAtResults) {
|
|
46
|
+
rawBlock = await this.service.fetchBlockRaw(ahHash);
|
|
47
|
+
const apiAt = await this.api.at(ahHash);
|
|
48
|
+
const ahTimestamp = await apiAt.query.timestamp.now();
|
|
49
|
+
const enhancedResult = {
|
|
50
|
+
...rawBlock,
|
|
51
|
+
rcBlockNumber,
|
|
52
|
+
ahTimestamp: ahTimestamp.toString(),
|
|
53
|
+
};
|
|
54
|
+
results.push(enhancedResult);
|
|
55
|
+
}
|
|
56
|
+
BlocksRawExtrinsicsController.sanitizedSend(res, results);
|
|
53
57
|
}
|
|
54
58
|
else {
|
|
55
59
|
const hash = await this.getHashForBlock(blockId);
|
|
@@ -58,7 +62,7 @@ class BlocksRawExtrinsicsController extends AbstractController_1.default {
|
|
|
58
62
|
}
|
|
59
63
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
60
64
|
const path = route.path;
|
|
61
|
-
if (res.locals.metrics) {
|
|
65
|
+
if (res.locals.metrics && rawBlock) {
|
|
62
66
|
const extrinsics_per_block_metrics = res.locals.metrics.registry['sas_extrinsics_per_block'];
|
|
63
67
|
extrinsics_per_block_metrics
|
|
64
68
|
.labels({ method: method, route: path, status_code: res.statusCode })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlocksRawExtrinsicsController.js","sourceRoot":"","sources":["../../../../src/controllers/blocks/BlocksRawExtrinsicsController.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;AAIxE,wDAA+D;AAC/D,6CAA+C;AAG/C,+EAAuD;AAEvD,MAAqB,6BAA8B,SAAQ,4BAAiC;IAG3F,YAAY,GAAW,EAAE,OAA0B;QAClD,KAAK,CACJ,GAAG,EACH,iCAAiC,EACjC,IAAI,wBAAa,CAAC,GAAG,EAAE,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,cAAc,CAAC,CACzE,CAAC;QASH;;;;WAIG;QACK,0BAAqB,GAAgE,KAAK,EACjG,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAC7D,GAAG,EACa,EAAE;YAClB,MAAM,aAAa,GAAG,UAAU,KAAK,MAAM,CAAC;YAE5C,IAAI,QAAQ,CAAC;YACb,IAAI,aAAa,EAAE,CAAC;gBACnB,gEAAgE;gBAChE,MAAM,
|
|
1
|
+
{"version":3,"file":"BlocksRawExtrinsicsController.js","sourceRoot":"","sources":["../../../../src/controllers/blocks/BlocksRawExtrinsicsController.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFA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EAAE,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC;;AAdM,4CAAc,GAAG,qBAAqB,AAAxB,CAAyB;AACvC,6CAAe,GAAG,EAAE,AAAL,CAAM;kBAFR,6BAA6B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as Blocks } from './BlocksController';
|
|
2
2
|
export { default as BlocksExtrinsics } from './BlocksExtrinsicsController';
|
|
3
|
+
export { default as BlocksParaInclusions } from './BlocksParaInclusionsController';
|
|
3
4
|
export { default as BlocksRawExtrinsics } from './BlocksRawExtrinsicsController';
|
|
4
5
|
export { default as BlocksTrace } from './BlocksTraceController';
|
|
@@ -18,11 +18,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.BlocksTrace = exports.BlocksRawExtrinsics = exports.BlocksExtrinsics = exports.Blocks = void 0;
|
|
21
|
+
exports.BlocksTrace = exports.BlocksRawExtrinsics = exports.BlocksParaInclusions = exports.BlocksExtrinsics = exports.Blocks = void 0;
|
|
22
22
|
var BlocksController_1 = require("./BlocksController");
|
|
23
23
|
Object.defineProperty(exports, "Blocks", { enumerable: true, get: function () { return __importDefault(BlocksController_1).default; } });
|
|
24
24
|
var BlocksExtrinsicsController_1 = require("./BlocksExtrinsicsController");
|
|
25
25
|
Object.defineProperty(exports, "BlocksExtrinsics", { enumerable: true, get: function () { return __importDefault(BlocksExtrinsicsController_1).default; } });
|
|
26
|
+
var BlocksParaInclusionsController_1 = require("./BlocksParaInclusionsController");
|
|
27
|
+
Object.defineProperty(exports, "BlocksParaInclusions", { enumerable: true, get: function () { return __importDefault(BlocksParaInclusionsController_1).default; } });
|
|
26
28
|
var BlocksRawExtrinsicsController_1 = require("./BlocksRawExtrinsicsController");
|
|
27
29
|
Object.defineProperty(exports, "BlocksRawExtrinsics", { enumerable: true, get: function () { return __importDefault(BlocksRawExtrinsicsController_1).default; } });
|
|
28
30
|
var BlocksTraceController_1 = require("./BlocksTraceController");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controllers/blocks/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;;AAExE,uDAAuD;AAA9C,2HAAA,OAAO,OAAU;AAC1B,2EAA2E;AAAlE,+IAAA,OAAO,OAAoB;AACpC,iFAAiF;AAAxE,qJAAA,OAAO,OAAuB;AACvC,iEAAiE;AAAxD,qIAAA,OAAO,OAAe"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controllers/blocks/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;;AAExE,uDAAuD;AAA9C,2HAAA,OAAO,OAAU;AAC1B,2EAA2E;AAAlE,+IAAA,OAAO,OAAoB;AACpC,mFAAmF;AAA1E,uJAAA,OAAO,OAAwB;AACxC,iFAAiF;AAAxE,qJAAA,OAAO,OAAuB;AACvC,iEAAiE;AAAxD,qIAAA,OAAO,OAAe"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AccountsAssets, AccountsBalanceInfo, AccountsCompare, AccountsConvert, AccountsPoolAssets, AccountsProxyInfo, AccountsStakingInfo, AccountsStakingPayouts, AccountsValidate, AccountsVestingInfo } from './accounts';
|
|
2
2
|
import { AhmInfo } from './ahm';
|
|
3
|
-
import { Blocks, BlocksExtrinsics, BlocksRawExtrinsics, BlocksTrace } from './blocks';
|
|
3
|
+
import { Blocks, BlocksExtrinsics, BlocksParaInclusions, BlocksRawExtrinsics, BlocksTrace } from './blocks';
|
|
4
4
|
import { ContractsInk } from './contracts';
|
|
5
5
|
import { CoretimeChain, CoretimeGeneric } from './coretime';
|
|
6
6
|
import { NodeNetwork, NodeTransactionPool, NodeVersion } from './node';
|
|
7
7
|
import { PalletsAssetConversion, PalletsAssets, PalletsConsts, PalletsDispatchables, PalletsErrors, PalletsEvents, PalletsForeignAssets, PalletsNominationPools, PalletsOnGoingReferenda, PalletsPoolAssets, PalletsStakingProgress, PalletsStakingValidators, PalletsStorage } from './pallets';
|
|
8
8
|
import { Paras, ParasInclusion } from './paras';
|
|
9
9
|
import { RcAccountsBalanceInfo, RcAccountsProxyInfo, RcAccountsStakingInfo, RcAccountsStakingPayouts, RcAccountsVestingInfo } from './rc/accounts';
|
|
10
|
-
import { RcBlocks, RcBlocksExtrinsics, RcBlocksRawExtrinsics, RcBlocksTrace } from './rc/blocks';
|
|
10
|
+
import { RcBlocks, RcBlocksExtrinsics, RcBlocksParaInclusions, RcBlocksRawExtrinsics, RcBlocksTrace } from './rc/blocks';
|
|
11
11
|
import { RcNodeNetwork, RcNodeTransactionPool, RcNodeVersion } from './rc/node';
|
|
12
12
|
import { RcPalletsConsts, RcPalletsDispatchables, RcPalletsErrors, RcPalletsEvents, RcPalletsOnGoingReferenda, RcPalletsStakingProgress, RcPalletsStakingValidators, RcPalletsStorage } from './rc/pallets';
|
|
13
13
|
import { RcRuntimeCode, RcRuntimeMetadata, RcRuntimeSpec } from './rc/runtime';
|
|
@@ -20,8 +20,9 @@ export declare const controllers: {
|
|
|
20
20
|
AhmInfo: typeof AhmInfo;
|
|
21
21
|
Blocks: typeof Blocks;
|
|
22
22
|
BlocksExtrinsics: typeof BlocksExtrinsics;
|
|
23
|
-
|
|
23
|
+
BlocksParaInclusions: typeof BlocksParaInclusions;
|
|
24
24
|
BlocksRawExtrinsics: typeof BlocksRawExtrinsics;
|
|
25
|
+
BlocksTrace: typeof BlocksTrace;
|
|
25
26
|
AccountsAssets: typeof AccountsAssets;
|
|
26
27
|
AccountsBalanceInfo: typeof AccountsBalanceInfo;
|
|
27
28
|
AccountsCompare: typeof AccountsCompare;
|
|
@@ -56,6 +57,7 @@ export declare const controllers: {
|
|
|
56
57
|
RcAccountsVestingInfo: typeof RcAccountsVestingInfo;
|
|
57
58
|
RcBlocks: typeof RcBlocks;
|
|
58
59
|
RcBlocksExtrinsics: typeof RcBlocksExtrinsics;
|
|
60
|
+
RcBlocksParaInclusions: typeof RcBlocksParaInclusions;
|
|
59
61
|
RcBlocksRawExtrinsics: typeof RcBlocksRawExtrinsics;
|
|
60
62
|
RcBlocksTrace: typeof RcBlocksTrace;
|
|
61
63
|
RcPalletsConsts: typeof RcPalletsConsts;
|
|
@@ -38,8 +38,9 @@ exports.controllers = {
|
|
|
38
38
|
AhmInfo: ahm_1.AhmInfo,
|
|
39
39
|
Blocks: blocks_1.Blocks,
|
|
40
40
|
BlocksExtrinsics: blocks_1.BlocksExtrinsics,
|
|
41
|
-
|
|
41
|
+
BlocksParaInclusions: blocks_1.BlocksParaInclusions,
|
|
42
42
|
BlocksRawExtrinsics: blocks_1.BlocksRawExtrinsics,
|
|
43
|
+
BlocksTrace: blocks_1.BlocksTrace,
|
|
43
44
|
AccountsAssets: accounts_1.AccountsAssets,
|
|
44
45
|
AccountsBalanceInfo: accounts_1.AccountsBalanceInfo,
|
|
45
46
|
AccountsCompare: accounts_1.AccountsCompare,
|
|
@@ -74,6 +75,7 @@ exports.controllers = {
|
|
|
74
75
|
RcAccountsVestingInfo: accounts_2.RcAccountsVestingInfo,
|
|
75
76
|
RcBlocks: blocks_2.RcBlocks,
|
|
76
77
|
RcBlocksExtrinsics: blocks_2.RcBlocksExtrinsics,
|
|
78
|
+
RcBlocksParaInclusions: blocks_2.RcBlocksParaInclusions,
|
|
77
79
|
RcBlocksRawExtrinsics: blocks_2.RcBlocksRawExtrinsics,
|
|
78
80
|
RcBlocksTrace: blocks_2.RcBlocksTrace,
|
|
79
81
|
RcPalletsConsts: pallets_2.RcPalletsConsts,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;AAExE,yCAWoB;AACpB,+BAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;AAExE,yCAWoB;AACpB,+BAAgC;AAChC,qCAA4G;AAC5G,2CAA2C;AAC3C,yCAA4D;AAC5D,iCAAuE;AACvE,uCAcmB;AACnB,mCAAgD;AAChD,4CAMuB;AACvB,wCAMqB;AACrB,oCAAgF;AAChF,0CASsB;AACtB,0CAA+E;AAC/E,uCAAsE;AACtE,+CAAkH;AAClH;;GAEG;AACU,QAAA,WAAW,GAAG;IAC1B,OAAO,EAAP,aAAO;IACP,MAAM,EAAN,eAAM;IACN,gBAAgB,EAAhB,yBAAgB;IAChB,oBAAoB,EAApB,6BAAoB;IACpB,mBAAmB,EAAnB,4BAAmB;IACn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A1B,oCAA0B;IAC1B,gBAAgB,EAAhB,0BAAgB;IAChB,aAAa,EAAb,uBAAa;IACb,iBAAiB,EAAjB,2BAAiB;IACjB,aAAa,EAAb,uBAAa;IACb,aAAa,EAAb,oBAAa;IACb,qBAAqB,EAArB,4BAAqB;IACrB,aAAa,EAAb,oBAAa;IACb,WAAW,EAAX,qBAAW;IACX,eAAe,EAAf,yBAAe;IACf,WAAW,EAAX,qBAAW;IACX,iBAAiB,EAAjB,+BAAiB;IACjB,sBAAsB,EAAtB,oCAAsB;IACtB,mBAAmB,EAAnB,iCAAmB;IACnB,iBAAiB,EAAjB,+BAAiB;IACjB,KAAK,EAAL,aAAK;IACL,cAAc,EAAd,sBAAc;IACd,eAAe,EAAf,0BAAe;IACf,aAAa,EAAb,wBAAa;CACb,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BlocksParaInclusionsService } from '../../../services';
|
|
2
|
+
import AbstractController from '../../AbstractController';
|
|
3
|
+
/**
|
|
4
|
+
* Controller for /rc/blocks/{blockId}/para-inclusions endpoint
|
|
5
|
+
* Returns all decoded parachain inclusion information for a relay chain block
|
|
6
|
+
*/
|
|
7
|
+
export default class RcBlocksParaInclusionsController extends AbstractController<BlocksParaInclusionsService> {
|
|
8
|
+
static controllerName: string;
|
|
9
|
+
static requiredPallets: string[][];
|
|
10
|
+
constructor(_api: string);
|
|
11
|
+
protected initRoutes(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Get all parachain inclusions for a relay chain block
|
|
14
|
+
*
|
|
15
|
+
* @param blockId - The relay chain block identifier (hash or number)
|
|
16
|
+
* @param paraId - Optional parachain ID to filter results
|
|
17
|
+
*/
|
|
18
|
+
private getParaInclusions;
|
|
19
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
|
|
3
|
+
// This file is part of Substrate API Sidecar.
|
|
4
|
+
//
|
|
5
|
+
// Substrate API Sidecar is free software: you can redistribute it and/or modify
|
|
6
|
+
// it under the terms of the GNU General Public License as published by
|
|
7
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
// (at your option) any later version.
|
|
9
|
+
//
|
|
10
|
+
// This program is distributed in the hope that it will be useful,
|
|
11
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
// GNU General Public License for more details.
|
|
14
|
+
//
|
|
15
|
+
// You should have received a copy of the GNU General Public License
|
|
16
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const apiRegistry_1 = require("../../../apiRegistry");
|
|
22
|
+
const services_1 = require("../../../services");
|
|
23
|
+
const AbstractController_1 = __importDefault(require("../../AbstractController"));
|
|
24
|
+
/**
|
|
25
|
+
* Controller for /rc/blocks/{blockId}/para-inclusions endpoint
|
|
26
|
+
* Returns all decoded parachain inclusion information for a relay chain block
|
|
27
|
+
*/
|
|
28
|
+
class RcBlocksParaInclusionsController extends AbstractController_1.default {
|
|
29
|
+
constructor(_api) {
|
|
30
|
+
var _a;
|
|
31
|
+
const rcApiSpecName = (_a = apiRegistry_1.ApiPromiseRegistry.getSpecNameByType('relay')) === null || _a === void 0 ? void 0 : _a.values();
|
|
32
|
+
const rcSpecName = rcApiSpecName ? Array.from(rcApiSpecName)[0] : undefined;
|
|
33
|
+
if (!rcSpecName) {
|
|
34
|
+
throw new Error('Relay chain API spec name is not defined.');
|
|
35
|
+
}
|
|
36
|
+
super(rcSpecName, '/rc/blocks/:blockId/para-inclusions', new services_1.BlocksParaInclusionsService(rcSpecName));
|
|
37
|
+
/**
|
|
38
|
+
* Get all parachain inclusions for a relay chain block
|
|
39
|
+
*
|
|
40
|
+
* @param blockId - The relay chain block identifier (hash or number)
|
|
41
|
+
* @param paraId - Optional parachain ID to filter results
|
|
42
|
+
*/
|
|
43
|
+
this.getParaInclusions = async ({ params: { blockId }, query: { paraId } }, res) => {
|
|
44
|
+
const hash = await this.getHashForBlock(blockId);
|
|
45
|
+
const paraIdFilter = paraId
|
|
46
|
+
? this.parseNumberOrThrow(paraId, 'paraId must be a valid integer')
|
|
47
|
+
: undefined;
|
|
48
|
+
RcBlocksParaInclusionsController.sanitizedSend(res, await this.service.fetchParaInclusions(hash, paraIdFilter));
|
|
49
|
+
};
|
|
50
|
+
this.initRoutes();
|
|
51
|
+
}
|
|
52
|
+
initRoutes() {
|
|
53
|
+
this.safeMountAsyncGetHandlers([['', this.getParaInclusions]]);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
RcBlocksParaInclusionsController.controllerName = 'RcBlocksParaInclusions';
|
|
57
|
+
RcBlocksParaInclusionsController.requiredPallets = [['ParaInclusion']];
|
|
58
|
+
exports.default = RcBlocksParaInclusionsController;
|
|
59
|
+
//# sourceMappingURL=RcBlocksParaInclusionsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RcBlocksParaInclusionsController.js","sourceRoot":"","sources":["../../../../../src/controllers/rc/blocks/RcBlocksParaInclusionsController.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;AAIxE,sDAA0D;AAC1D,gDAAgE;AAEhE,kFAA0D;AAE1D;;;GAGG;AACH,MAAqB,gCAAiC,SAAQ,4BAA+C;IAI5G,YAAY,IAAY;;QACvB,MAAM,aAAa,GAAG,MAAA,gCAAkB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default as RcBlocks } from './RcBlocksController';
|
|
2
2
|
export { default as RcBlocksExtrinsics } from './RcBlocksExtrinsicsController';
|
|
3
|
+
export { default as RcBlocksParaInclusions } from './RcBlocksParaInclusionsController';
|
|
3
4
|
export { default as RcBlocksRawExtrinsics } from './RcBlocksRawExtrinsicsController';
|
|
4
5
|
export { default as RcBlocksTrace } from './RcBlocksTraceController';
|
|
@@ -18,11 +18,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.RcBlocksTrace = exports.RcBlocksRawExtrinsics = exports.RcBlocksExtrinsics = exports.RcBlocks = void 0;
|
|
21
|
+
exports.RcBlocksTrace = exports.RcBlocksRawExtrinsics = exports.RcBlocksParaInclusions = exports.RcBlocksExtrinsics = exports.RcBlocks = void 0;
|
|
22
22
|
var RcBlocksController_1 = require("./RcBlocksController");
|
|
23
23
|
Object.defineProperty(exports, "RcBlocks", { enumerable: true, get: function () { return __importDefault(RcBlocksController_1).default; } });
|
|
24
24
|
var RcBlocksExtrinsicsController_1 = require("./RcBlocksExtrinsicsController");
|
|
25
25
|
Object.defineProperty(exports, "RcBlocksExtrinsics", { enumerable: true, get: function () { return __importDefault(RcBlocksExtrinsicsController_1).default; } });
|
|
26
|
+
var RcBlocksParaInclusionsController_1 = require("./RcBlocksParaInclusionsController");
|
|
27
|
+
Object.defineProperty(exports, "RcBlocksParaInclusions", { enumerable: true, get: function () { return __importDefault(RcBlocksParaInclusionsController_1).default; } });
|
|
26
28
|
var RcBlocksRawExtrinsicsController_1 = require("./RcBlocksRawExtrinsicsController");
|
|
27
29
|
Object.defineProperty(exports, "RcBlocksRawExtrinsics", { enumerable: true, get: function () { return __importDefault(RcBlocksRawExtrinsicsController_1).default; } });
|
|
28
30
|
var RcBlocksTraceController_1 = require("./RcBlocksTraceController");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/controllers/rc/blocks/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;;AAExE,2DAA2D;AAAlD,+HAAA,OAAO,OAAY;AAC5B,+EAA+E;AAAtE,mJAAA,OAAO,OAAsB;AACtC,qFAAqF;AAA5E,yJAAA,OAAO,OAAyB;AACzC,qEAAqE;AAA5D,yIAAA,OAAO,OAAiB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/controllers/rc/blocks/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;;AAExE,2DAA2D;AAAlD,+HAAA,OAAO,OAAY;AAC5B,+EAA+E;AAAtE,mJAAA,OAAO,OAAsB;AACtC,uFAAuF;AAA9E,2JAAA,OAAO,OAA0B;AAC1C,qFAAqF;AAA5E,yJAAA,OAAO,OAAyB;AACzC,qEAAqE;AAA5D,yIAAA,OAAO,OAAiB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BlockHash } from '@polkadot/types/interfaces';
|
|
2
|
+
import { IBlockParaInclusions } from '../../types/responses';
|
|
3
|
+
import { AbstractService } from '../AbstractService';
|
|
4
|
+
/**
|
|
5
|
+
* Service for fetching parachain inclusion information from relay chain blocks
|
|
6
|
+
*/
|
|
7
|
+
export declare class BlocksParaInclusionsService extends AbstractService {
|
|
8
|
+
constructor(api: string);
|
|
9
|
+
/**
|
|
10
|
+
* Fetch all decoded parachain inclusion information for a relay chain block
|
|
11
|
+
*
|
|
12
|
+
* @param hash - The relay chain block hash to query
|
|
13
|
+
* @param paraIdFilter - Optional parachain ID to filter results
|
|
14
|
+
* @returns IBlockParaInclusions containing all parachain inclusions in the block
|
|
15
|
+
*/
|
|
16
|
+
fetchParaInclusions(hash: BlockHash, paraIdFilter?: number): Promise<IBlockParaInclusions>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
|
|
3
|
+
// This file is part of Substrate API Sidecar.
|
|
4
|
+
//
|
|
5
|
+
// Substrate API Sidecar is free software: you can redistribute it and/or modify
|
|
6
|
+
// it under the terms of the GNU General Public License as published by
|
|
7
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
// (at your option) any later version.
|
|
9
|
+
//
|
|
10
|
+
// This program is distributed in the hope that it will be useful,
|
|
11
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
// GNU General Public License for more details.
|
|
14
|
+
//
|
|
15
|
+
// You should have received a copy of the GNU General Public License
|
|
16
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.BlocksParaInclusionsService = void 0;
|
|
19
|
+
const http_errors_1 = require("http-errors");
|
|
20
|
+
const AbstractService_1 = require("../AbstractService");
|
|
21
|
+
/**
|
|
22
|
+
* Service for fetching parachain inclusion information from relay chain blocks
|
|
23
|
+
*/
|
|
24
|
+
class BlocksParaInclusionsService extends AbstractService_1.AbstractService {
|
|
25
|
+
constructor(api) {
|
|
26
|
+
super(api);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Fetch all decoded parachain inclusion information for a relay chain block
|
|
30
|
+
*
|
|
31
|
+
* @param hash - The relay chain block hash to query
|
|
32
|
+
* @param paraIdFilter - Optional parachain ID to filter results
|
|
33
|
+
* @returns IBlockParaInclusions containing all parachain inclusions in the block
|
|
34
|
+
*/
|
|
35
|
+
async fetchParaInclusions(hash, paraIdFilter) {
|
|
36
|
+
const { api } = this;
|
|
37
|
+
const [apiAt, header] = await Promise.all([api.at(hash), api.rpc.chain.getHeader(hash)]);
|
|
38
|
+
const events = await apiAt.query.system.events();
|
|
39
|
+
const inclusionEvents = events.filter((record) => {
|
|
40
|
+
return record.event.section === 'paraInclusion' && record.event.method === 'CandidateIncluded';
|
|
41
|
+
});
|
|
42
|
+
if (inclusionEvents.length === 0) {
|
|
43
|
+
throw new http_errors_1.BadRequest(`Block ${header.number.toString()} on chain ${this.specName} doesn't have the paraInclusion event`);
|
|
44
|
+
}
|
|
45
|
+
const inclusions = inclusionEvents.map((record) => {
|
|
46
|
+
const eventData = record.event.data;
|
|
47
|
+
const candidateReceipt = eventData[0].toJSON();
|
|
48
|
+
const descriptor = candidateReceipt.descriptor;
|
|
49
|
+
const headData = eventData[1];
|
|
50
|
+
const header = apiAt.registry.createType('Header', headData);
|
|
51
|
+
const paraBlockNumber = header.number.toNumber();
|
|
52
|
+
const paraBlockHash = header.hash.toString();
|
|
53
|
+
const coreIndex = eventData[2].toString();
|
|
54
|
+
const groupIndex = eventData[3].toString();
|
|
55
|
+
return {
|
|
56
|
+
paraId: descriptor.paraId.toString(),
|
|
57
|
+
paraBlockNumber,
|
|
58
|
+
paraBlockHash,
|
|
59
|
+
descriptor: {
|
|
60
|
+
relayParent: descriptor.relayParent.toString(),
|
|
61
|
+
persistedValidationDataHash: descriptor.persistedValidationDataHash.toString(),
|
|
62
|
+
povHash: descriptor.povHash.toString(),
|
|
63
|
+
erasureRoot: descriptor.erasureRoot.toString(),
|
|
64
|
+
paraHead: descriptor.paraHead.toString(),
|
|
65
|
+
validationCodeHash: descriptor.validationCodeHash.toString(),
|
|
66
|
+
},
|
|
67
|
+
commitmentsHash: candidateReceipt.commitmentsHash.toString(),
|
|
68
|
+
coreIndex,
|
|
69
|
+
groupIndex,
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
const filteredInclusions = paraIdFilter !== undefined
|
|
73
|
+
? inclusions.filter((inclusion) => parseInt(inclusion.paraId) === paraIdFilter)
|
|
74
|
+
: inclusions;
|
|
75
|
+
return {
|
|
76
|
+
at: {
|
|
77
|
+
hash: hash.toString(),
|
|
78
|
+
height: header.number.toString(),
|
|
79
|
+
},
|
|
80
|
+
inclusions: filteredInclusions.sort((a, b) => parseInt(a.paraId) - parseInt(b.paraId)),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.BlocksParaInclusionsService = BlocksParaInclusionsService;
|
|
85
|
+
//# sourceMappingURL=BlocksParaInclusionsService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlocksParaInclusionsService.js","sourceRoot":"","sources":["../../../../src/services/blocks/BlocksParaInclusionsService.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;AAIxE,6CAAyC;AAGzC,wDAAqD;AAErD;;GAEG;AACH,MAAa,2BAA4B,SAAQ,iCAAe;IAC/D,YAAY,GAAW;QACtB,KAAK,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,mBAAmB,CAAC,IAAe,EAAE,YAAqB;QAC/D,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAErB,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAA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