@substrate/api-sidecar 20.7.3 → 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 +2 -0
- package/build/src/chains-config/assetHubKusamaControllers.js.map +1 -1
- package/build/src/chains-config/assetHubNextWestendControllers.js +2 -0
- package/build/src/chains-config/assetHubNextWestendControllers.js.map +1 -1
- package/build/src/chains-config/assetHubPolkadotControllers.js +2 -0
- package/build/src/chains-config/assetHubPolkadotControllers.js.map +1 -1
- package/build/src/chains-config/assetHubWestendControllers.js +2 -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 +7 -4
- package/build/src/controllers/index.js +4 -1
- package/build/src/controllers/index.js.map +1 -1
- package/build/src/controllers/paras/ParasInclusionController.d.ts +16 -0
- package/build/src/controllers/paras/ParasInclusionController.js +71 -0
- package/build/src/controllers/paras/ParasInclusionController.js.map +1 -0
- package/build/src/controllers/paras/index.d.ts +1 -0
- package/build/src/controllers/paras/index.js +3 -1
- package/build/src/controllers/paras/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/services/paras/ParasInclusionService.d.ts +24 -0
- package/build/src/services/paras/ParasInclusionService.js +110 -0
- package/build/src/services/paras/ParasInclusionService.js.map +1 -0
- package/build/src/services/paras/index.d.ts +1 -0
- package/build/src/services/paras/index.js +1 -0
- package/build/src/services/paras/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/ParachainInclusion.d.ts +8 -0
- package/build/src/types/responses/ParachainInclusion.js +18 -0
- package/build/src/types/responses/ParachainInclusion.js.map +1 -0
- package/build/src/types/responses/index.d.ts +2 -0
- package/build/src/types/responses/index.js +2 -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,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,WAAW,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;gBAExD,kDAAkD;gBAClD,IAAI,W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AAK,CAAC,CAAC;gBAEnE,0BAA0B,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;YAC1D,CAAC;QACF,CAAC,CAAC;QAhJD,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,CAAC;IAES,UAAU;QACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,6BAAkB,CAAC,CAAC;QAC/C,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,kBAAkB,EAAE,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;IACtF,CAAC;;AAfM,yCAAc,GAAG,kBAAkB,AAArB,CAAsB;AACpC,0CAAe,GAAG,CAAC,CAAC,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":"BlocksParaInclusionsController.js","sourceRoot":"","sources":["../../../../src/controllers/blocks/BlocksParaInclusionsController.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,6CAA6D;AAE7D,+EAAuD;AAEvD;;;GAGG;AACH,MAAqB,8BAA+B,SAAQ,4BAA+C;IAI1G,YAAY,GAAW;QACtB,KAAK,CAAC,GAAG,EAAE,kCAAkC,EAAE,IAAI,sCAA2B,CAAC,GAAG,CAAC,CAAC,CAAC;QAQtF;;;;;WAKG;QACK,sBAAiB,GAAiC,KAAK,EAC9D,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAC1C,GAAG,EACa,EAAE;YAClB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAEjD,MAAM,YAAY,GAAG,MAAM;gBAC1B,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAgB,EAAE,gCAAgC,CAAC;gBAC7E,CAAC,CAAC,SAAS,CAAC;YAEb,8BAA8B,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;QAC/G,CAAC,CAAC;QAxBD,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;IAES,UAAU;QACnB,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC;;AAVM,6CAAc,GAAG,sBAAsB,AAAzB,CAA0B;AACxC,8CAAe,GAAG,CAAC,CAAC,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,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,WAAW,GAA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AA4B,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAqB,CAAC;gBACjH,4BAA4B;qBAC1B,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC;qBACpE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACvC,CAAC;QACF,CAAC,CAAC;QA9DD,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;IAES,UAAU;QACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,6BAAkB,CAAC,CAAC;QAC/C,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,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
|
-
import { Paras } from './paras';
|
|
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;
|
|
@@ -80,6 +82,7 @@ export declare const controllers: {
|
|
|
80
82
|
TransactionMaterial: typeof TransactionMaterial;
|
|
81
83
|
TransactionSubmit: typeof TransactionSubmit;
|
|
82
84
|
Paras: typeof Paras;
|
|
85
|
+
ParasInclusion: typeof ParasInclusion;
|
|
83
86
|
CoretimeGeneric: typeof CoretimeGeneric;
|
|
84
87
|
CoretimeChain: typeof CoretimeChain;
|
|
85
88
|
};
|
|
@@ -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,
|
|
@@ -98,6 +100,7 @@ exports.controllers = {
|
|
|
98
100
|
TransactionMaterial: transaction_1.TransactionMaterial,
|
|
99
101
|
TransactionSubmit: transaction_1.TransactionSubmit,
|
|
100
102
|
Paras: paras_1.Paras,
|
|
103
|
+
ParasInclusion: paras_1.ParasInclusion,
|
|
101
104
|
CoretimeGeneric: coretime_1.CoretimeGeneric,
|
|
102
105
|
CoretimeChain: coretime_1.CoretimeChain,
|
|
103
106
|
};
|
|
@@ -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;IACnB,WAAW,EAAX,oBAAW;IACX,cAAc,EAAd,yBAAc;IACd,mBAAmB,EAAnB,8BAAmB;IACnB,eAAe,EAAf,0BAAe;IACf,eAAe,EAAf,0BAAe;IACf,kBAAkB,EAAlB,6BAA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ACb,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,16 @@
|
|
|
1
|
+
import { ParasInclusionService } from '../../services';
|
|
2
|
+
import AbstractController from '../AbstractController';
|
|
3
|
+
export default class ParasInclusionController extends AbstractController<ParasInclusionService> {
|
|
4
|
+
static controllerName: string;
|
|
5
|
+
static requiredPallets: string[][];
|
|
6
|
+
constructor(api: string);
|
|
7
|
+
protected initRoutes(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Get inclusion information for a specific parachain block.
|
|
10
|
+
*
|
|
11
|
+
* @param number - The parachain block number
|
|
12
|
+
* @param at - Optional relay chain block hash to search from
|
|
13
|
+
* @param depth - Optional search depth (must be divisible by 5, defaults to 10)
|
|
14
|
+
*/
|
|
15
|
+
private getParachainInclusion;
|
|
16
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
class ParasInclusionController extends AbstractController_1.default {
|
|
24
|
+
constructor(api) {
|
|
25
|
+
super(api, '', new services_1.ParasInclusionService(api));
|
|
26
|
+
/**
|
|
27
|
+
* Get inclusion information for a specific parachain block.
|
|
28
|
+
*
|
|
29
|
+
* @param number - The parachain block number
|
|
30
|
+
* @param at - Optional relay chain block hash to search from
|
|
31
|
+
* @param depth - Optional search depth (must be divisible by 5, defaults to 10)
|
|
32
|
+
*/
|
|
33
|
+
this.getParachainInclusion = async ({ params: { number }, query: { depth } }, res) => {
|
|
34
|
+
const [hash, paraId] = await Promise.all([
|
|
35
|
+
this.getHashFromAt(number),
|
|
36
|
+
this.api.query.parachainInfo.parachainId(),
|
|
37
|
+
]);
|
|
38
|
+
// Validate and parse depth parameter
|
|
39
|
+
let searchDepth = 10; // default
|
|
40
|
+
if (depth) {
|
|
41
|
+
const parsedDepth = parseInt(depth, 10);
|
|
42
|
+
if (isNaN(parsedDepth) || parsedDepth <= 0) {
|
|
43
|
+
ParasInclusionController.sanitizedSend(res, { error: 'Invalid depth parameter. Must be a positive integer.' });
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (parsedDepth % 5 !== 0) {
|
|
47
|
+
ParasInclusionController.sanitizedSend(res, {
|
|
48
|
+
error: 'Depth parameter must be divisible by 5 for optimal performance.',
|
|
49
|
+
});
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (parsedDepth > 100) {
|
|
53
|
+
ParasInclusionController.sanitizedSend(res, {
|
|
54
|
+
error: 'Depth parameter cannot exceed 100 to prevent excessive network requests.',
|
|
55
|
+
});
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
searchDepth = parsedDepth;
|
|
59
|
+
}
|
|
60
|
+
ParasInclusionController.sanitizedSend(res, await this.service.getParachainInclusion(hash, paraId, number, searchDepth));
|
|
61
|
+
};
|
|
62
|
+
this.initRoutes();
|
|
63
|
+
}
|
|
64
|
+
initRoutes() {
|
|
65
|
+
this.safeMountAsyncGetHandlers([['/paras/:number/inclusion', this.getParachainInclusion]]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
ParasInclusionController.controllerName = 'ParasInclusion';
|
|
69
|
+
ParasInclusionController.requiredPallets = [['parachainInfo']];
|
|
70
|
+
exports.default = ParasInclusionController;
|
|
71
|
+
//# sourceMappingURL=ParasInclusionController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParasInclusionController.js","sourceRoot":"","sources":["../../../../src/controllers/paras/ParasInclusionController.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;;;;;AAKxE,6CAAuD;AAEvD,+EAAuD;AAEvD,MAAqB,wBAAyB,SAAQ,4BAAyC;IAI9F,YAAY,GAAW;QACtB,KAAK,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,gCAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;QAQhD;;;;;;WAMG;QACK,0BAAqB,GAAiC,KAAK,EAClE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,E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C,CAAC,0BAA0B,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAC5F,CAAC;;AAVM,uCAAc,GAAG,gBAAgB,AAAnB,CAAoB;AAClC,wCAAe,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC,AAAtB,CAAuB;kBAFzB,wBAAwB"}
|
|
@@ -18,7 +18,9 @@ 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.Paras = void 0;
|
|
21
|
+
exports.ParasInclusion = exports.Paras = void 0;
|
|
22
22
|
var ParasController_1 = require("./ParasController");
|
|
23
23
|
Object.defineProperty(exports, "Paras", { enumerable: true, get: function () { return __importDefault(ParasController_1).default; } });
|
|
24
|
+
var ParasInclusionController_1 = require("./ParasInclusionController");
|
|
25
|
+
Object.defineProperty(exports, "ParasInclusion", { enumerable: true, get: function () { return __importDefault(ParasInclusionController_1).default; } });
|
|
24
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controllers/paras/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,qDAAqD;AAA5C,yHAAA,OAAO,OAAS"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controllers/paras/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,qDAAqD;AAA5C,yHAAA,OAAO,OAAS;AACzB,uEAAuE;AAA9D,2IAAA,OAAO,OAAkB"}
|
|
@@ -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,CAAC,iBAAiB,CAAC,OAAO,CAAC,0CAAE,MAAM,EAAE,CAAC;QAC9E,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5E,IAAI,CAAC,UAAU,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC9D,CAAC;QAED,KAAK,CAAC,UAAU,EAAE,qCAAqC,EAAE,IAAI,sCAA2B,CAAC,UAAU,CAAC,CAAC,CAAC;QAQvG;;;;;WAKG;QACK,sBAAiB,GAAiC,KAAK,EAC9D,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAC1C,GAAG,EACa,EAAE;YAClB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAEjD,MAAM,YAAY,GAAG,MAAM;gBAC1B,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAgB,EAAE,gCAAgC,CAAC;gBAC7E,CAAC,CAAC,SAAS,CAAC;YAEb,gCAAgC,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;QACjH,CAAC,CAAC;QAxBD,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;IAES,UAAU;QACnB,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC;;AAhBM,+CAAc,GAAG,wBAAwB,AAA3B,CAA4B;AAC1C,gDAAe,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC,AAAtB,CAAuB;kBAFzB,gCAAgC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { 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';
|