@polkadot/types-known 9.14.1 → 10.0.1
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/bundle.js +2 -5
- package/chain/index.js +0 -4
- package/cjs/bundle.js +8 -34
- package/cjs/chain/index.js +2 -11
- package/cjs/detectOther.js +3 -10
- package/cjs/detectPackage.js +6 -11
- package/cjs/index.js +3 -15
- package/cjs/packageInfo.js +2 -16
- package/cjs/spec/centrifuge-chain.js +99 -93
- package/cjs/spec/index.js +23 -32
- package/cjs/spec/kusama.js +201 -195
- package/cjs/spec/node-template.js +12 -20
- package/cjs/spec/node.js +12 -20
- package/cjs/spec/polkadot.js +77 -82
- package/cjs/spec/rococo.js +52 -59
- package/cjs/spec/shell.js +10 -18
- package/cjs/spec/statemint.js +49 -50
- package/cjs/spec/westend.js +95 -96
- package/cjs/upgrades/e2e/index.js +11 -26
- package/cjs/upgrades/e2e/kusama.js +4176 -14
- package/cjs/upgrades/e2e/polkadot.js +2626 -14
- package/cjs/upgrades/e2e/westend.js +4014 -14
- package/cjs/upgrades/index.js +23 -40
- package/cjs/upgrades/manual/index.js +11 -26
- package/cjs/upgrades/manual/kusama.js +20 -13
- package/cjs/upgrades/manual/polkadot.js +13 -11
- package/cjs/upgrades/manual/westend.js +18 -11
- package/cjs/upgrades/types.js +2 -1
- package/cjs/util.js +55 -105
- package/detectOther.js +0 -3
- package/detectPackage.js +2 -7
- package/index.js +2 -5
- package/package.json +11 -8
- package/packageInfo.js +1 -11
- package/spec/centrifuge-chain.js +95 -84
- package/spec/index.js +20 -25
- package/spec/kusama.js +197 -187
- package/spec/node-template.js +10 -13
- package/spec/node.js +10 -13
- package/spec/polkadot.js +74 -75
- package/spec/rococo.js +48 -52
- package/spec/shell.js +8 -11
- package/spec/statemint.js +45 -42
- package/spec/westend.js +91 -88
- package/upgrades/e2e/index.js +3 -6
- package/upgrades/e2e/kusama.js +4174 -7
- package/upgrades/e2e/polkadot.js +2624 -7
- package/upgrades/e2e/westend.js +4012 -7
- package/upgrades/index.js +17 -25
- package/upgrades/manual/index.js +3 -6
- package/upgrades/manual/kusama.js +18 -6
- package/upgrades/manual/polkadot.js +11 -4
- package/upgrades/manual/westend.js +16 -4
- package/util.js +42 -77
package/cjs/upgrades/index.js
CHANGED
|
@@ -1,46 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _networks = require("@polkadot/networks");
|
|
8
|
-
var _util = require("@polkadot/util");
|
|
9
|
-
var allKnown = _interopRequireWildcard(require("./e2e"));
|
|
10
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
// Copyright 2017-2023 @polkadot/types-known authors & contributors
|
|
13
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
14
|
-
|
|
15
|
-
// testnets are not available in the networks map
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const networks_1 = require("@polkadot/networks");
|
|
5
|
+
const util_1 = require("@polkadot/util");
|
|
6
|
+
const allKnown = tslib_1.__importStar(require("./e2e"));
|
|
16
7
|
const NET_EXTRA = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
westend: {
|
|
9
|
+
genesisHash: ['0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e']
|
|
10
|
+
}
|
|
20
11
|
};
|
|
21
|
-
|
|
22
12
|
/** @internal */
|
|
23
|
-
function mapRaw(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
specVersion: new _util.BN(specVersion)
|
|
38
|
-
};
|
|
39
|
-
})
|
|
40
|
-
};
|
|
13
|
+
function mapRaw([network, versions]) {
|
|
14
|
+
const chain = networks_1.selectableNetworks.find((n) => n.network === network) || NET_EXTRA[network];
|
|
15
|
+
if (!chain) {
|
|
16
|
+
throw new Error(`Unable to find info for chain ${network}`);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
genesisHash: (0, util_1.hexToU8a)(chain.genesisHash[0]),
|
|
20
|
+
network,
|
|
21
|
+
versions: versions.map(([blockNumber, specVersion, apis]) => ({
|
|
22
|
+
apis,
|
|
23
|
+
blockNumber: new util_1.BN(blockNumber),
|
|
24
|
+
specVersion: new util_1.BN(specVersion)
|
|
25
|
+
}))
|
|
26
|
+
};
|
|
41
27
|
}
|
|
42
|
-
|
|
43
|
-
// Type overrides for specific spec types & versions as given in runtimeVersion
|
|
44
28
|
const upgrades = Object.entries(allKnown).map(mapRaw);
|
|
45
|
-
|
|
46
|
-
exports.default = _default;
|
|
29
|
+
exports.default = upgrades;
|
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "polkadot", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return _polkadot.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "westend", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _westend.default;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
var _kusama = _interopRequireDefault(require("./kusama"));
|
|
26
|
-
var _polkadot = _interopRequireDefault(require("./polkadot"));
|
|
27
|
-
var _westend = _interopRequireDefault(require("./westend"));
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.westend = exports.polkadot = exports.kusama = void 0;
|
|
7
|
+
var kusama_1 = require("./kusama");
|
|
8
|
+
Object.defineProperty(exports, "kusama", { enumerable: true, get: function () { return __importDefault(kusama_1).default; } });
|
|
9
|
+
var polkadot_1 = require("./polkadot");
|
|
10
|
+
Object.defineProperty(exports, "polkadot", { enumerable: true, get: function () { return __importDefault(polkadot_1).default; } });
|
|
11
|
+
var westend_1 = require("./westend");
|
|
12
|
+
Object.defineProperty(exports, "westend", { enumerable: true, get: function () { return __importDefault(westend_1).default; } });
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
[
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const upgrades = [
|
|
4
|
+
[0, 1020], [26669, 1021], [38245, 1022], [54248, 1023], [59659, 1024],
|
|
5
|
+
[67651, 1025], [82191, 1027], [83238, 1028], [101503, 1029], [203466, 1030],
|
|
6
|
+
[295787, 1031], [461692, 1032], [504329, 1033], [569327, 1038], [587687, 1039],
|
|
7
|
+
[653183, 1040], [693488, 1042], [901442, 1045], [1375086, 1050], [1445458, 1051],
|
|
8
|
+
[1472960, 1052], [1475648, 1053], [1491596, 1054], [1574408, 1055], [2064961, 1058],
|
|
9
|
+
[2201991, 1062], [2671528, 2005], [2704202, 2007], [2728002, 2008], [2832534, 2011],
|
|
10
|
+
[2962294, 2012], [3240000, 2013], [3274408, 2015], [3323565, 2019], [3534175, 2022],
|
|
11
|
+
[3860281, 2023], [4143129, 2024], [4401242, 2025], [4841367, 2026], [5961600, 2027],
|
|
12
|
+
[6137912, 2028], [6561855, 2029], [7100891, 2030], [7468792, 9010], [7668600, 9030],
|
|
13
|
+
[7812476, 9040], [8010981, 9050], [8073833, 9070], [8555825, 9080], [8945245, 9090],
|
|
14
|
+
[9611377, 9100], [9625129, 9111], [9866422, 9122], [10403784, 9130], [10960765, 9150],
|
|
15
|
+
[11006614, 9151], [11404482, 9160], [11601803, 9170], [12008022, 9180], [12405451, 9190],
|
|
16
|
+
[12665416, 9200], [12909508, 9220], [13109752, 9230], [13555777, 9250], [13727747, 9260],
|
|
17
|
+
[14248044, 9271], [14433840, 9280], [14645900, 9291], [15048375, 9300], [15426015, 9320],
|
|
18
|
+
// we have 9340 via system.setStorage (whitelist.WhitelistedCallDispatched event)
|
|
19
|
+
[15680713, 9340], [15756296, 9350]
|
|
20
|
+
];
|
|
21
|
+
exports.default = upgrades;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const upgrades = [
|
|
4
|
+
[0, 0], [29231, 1], [188836, 5], [199405, 6], [214264, 7],
|
|
5
|
+
[244358, 8], [303079, 9], [314201, 10], [342400, 11], [443963, 12],
|
|
6
|
+
[528470, 13], [687751, 14], [746085, 15], [787923, 16], [799302, 17],
|
|
7
|
+
[1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26],
|
|
8
|
+
[3613564, 27], [3899547, 28], [4345767, 29], [4876134, 30], [5661442, 9050],
|
|
9
|
+
[6321619, 9080], [6713249, 9090], [7217907, 9100], [7229126, 9110], [7560558, 9122],
|
|
10
|
+
[8115869, 9140], [8638103, 9151], [9280179, 9170], [9738717, 9180], [10156856, 9190],
|
|
11
|
+
[10458576, 9200], [10655116, 9220], [10879371, 9230], [11328884, 9250], [11532856, 9260],
|
|
12
|
+
[11933818, 9270], [12217535, 9280], [12245277, 9281], [12532644, 9291], [12876189, 9300]
|
|
13
|
+
];
|
|
14
|
+
exports.default = upgrades;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const upgrades = [
|
|
4
|
+
[214356, 4], [392764, 7], [409740, 8], [809976, 20], [877581, 24],
|
|
5
|
+
[879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29],
|
|
6
|
+
[1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
|
|
7
|
+
[1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44],
|
|
8
|
+
[2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49],
|
|
9
|
+
[5124076, 50], [5478664, 900], [5482450, 9000], [5584305, 9010], [5784566, 9030],
|
|
10
|
+
[5879822, 9031], [5896856, 9032], [5897316, 9033], [6117927, 9050], [6210274, 9070],
|
|
11
|
+
[6379314, 9080], [6979141, 9090], [7568453, 9100], [7766394, 9111], [7911691, 9120],
|
|
12
|
+
[7968866, 9121], [7982889, 9122], [8514322, 9130], [9091726, 9140], [9091774, 9150],
|
|
13
|
+
[9406726, 9160], [9921066, 9170], [10007115, 9180], [10480973, 9190], [10578091, 9200],
|
|
14
|
+
[10678509, 9210], [10811001, 9220], [11096116, 9230], [11409279, 9250], [11584820, 9251],
|
|
15
|
+
[11716837, 9260], [11876919, 9261], [11987927, 9270], [12077324, 9271], [12301871, 9280],
|
|
16
|
+
[12604343, 9290], [12841034, 9300], [13128237, 9310], [13272363, 9320], [13483497, 9330],
|
|
17
|
+
[13649433, 9340], [13761100, 9350]
|
|
18
|
+
];
|
|
19
|
+
exports.default = upgrades;
|
package/cjs/upgrades/types.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/cjs/util.js
CHANGED
|
@@ -1,145 +1,95 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.getSpecHasher = getSpecHasher;
|
|
10
|
-
exports.getSpecRpc = getSpecRpc;
|
|
11
|
-
exports.getSpecRuntime = getSpecRuntime;
|
|
12
|
-
exports.getSpecTypes = getSpecTypes;
|
|
13
|
-
exports.getUpgradeVersion = getUpgradeVersion;
|
|
14
|
-
var _util = require("@polkadot/util");
|
|
15
|
-
var _chain = _interopRequireDefault(require("./chain"));
|
|
16
|
-
var _spec = _interopRequireDefault(require("./spec"));
|
|
17
|
-
var _upgrades = _interopRequireDefault(require("./upgrades"));
|
|
18
|
-
// Copyright 2017-2023 @polkadot/types-known authors & contributors
|
|
19
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
20
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUpgradeVersion = exports.getSpecAlias = exports.getSpecRuntime = exports.getSpecRpc = exports.getSpecHasher = exports.getSpecTypes = exports.getSpecExtensions = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const util_1 = require("@polkadot/util");
|
|
6
|
+
const chain_1 = tslib_1.__importDefault(require("./chain"));
|
|
7
|
+
const spec_1 = tslib_1.__importDefault(require("./spec"));
|
|
8
|
+
const upgrades_1 = tslib_1.__importDefault(require("./upgrades"));
|
|
21
9
|
/**
|
|
22
10
|
* @description Perform the callback function using the stringified spec/chain
|
|
23
11
|
* @internal
|
|
24
12
|
* */
|
|
25
13
|
function withNames(chainName, specName, fn) {
|
|
26
|
-
|
|
14
|
+
return fn(chainName.toString(), specName.toString());
|
|
27
15
|
}
|
|
28
|
-
|
|
29
16
|
/**
|
|
30
17
|
* @descriptionFflatten a VersionedType[] into a Record<string, string>
|
|
31
18
|
* @internal
|
|
32
19
|
* */
|
|
33
|
-
function filterVersions() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
minmax: [min, max]
|
|
39
|
-
} = _ref;
|
|
40
|
-
return (min === undefined || min === null || specVersion >= min) && (max === undefined || max === null || specVersion <= max);
|
|
41
|
-
}).reduce((result, _ref2) => {
|
|
42
|
-
let {
|
|
43
|
-
types
|
|
44
|
-
} = _ref2;
|
|
45
|
-
return (0, _util.objectSpread)(result, types);
|
|
46
|
-
}, {});
|
|
20
|
+
function filterVersions(versions = [], specVersion) {
|
|
21
|
+
return versions
|
|
22
|
+
.filter(({ minmax: [min, max] }) => (min === undefined || min === null || specVersion >= min) &&
|
|
23
|
+
(max === undefined || max === null || specVersion <= max))
|
|
24
|
+
.reduce((result, { types }) => (0, util_1.objectSpread)(result, types), {});
|
|
47
25
|
}
|
|
48
|
-
|
|
49
26
|
/**
|
|
50
27
|
* @description Based on the chain and runtimeVersion, get the applicable signed extensions (ready for registration)
|
|
51
28
|
*/
|
|
52
|
-
function getSpecExtensions(
|
|
53
|
-
|
|
54
|
-
knownTypes
|
|
55
|
-
} = _ref3;
|
|
56
|
-
return withNames(chainName, specName, (c, s) => {
|
|
57
|
-
var _knownTypes$typesBund, _knownTypes$typesBund2, _knownTypes$typesBund3, _knownTypes$typesBund4, _knownTypes$typesBund5, _knownTypes$typesBund6;
|
|
58
|
-
return (0, _util.objectSpread)({}, (_knownTypes$typesBund = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund2 = _knownTypes$typesBund.spec) == null ? void 0 : (_knownTypes$typesBund3 = _knownTypes$typesBund2[s]) == null ? void 0 : _knownTypes$typesBund3.signedExtensions, (_knownTypes$typesBund4 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund5 = _knownTypes$typesBund4.chain) == null ? void 0 : (_knownTypes$typesBund6 = _knownTypes$typesBund5[c]) == null ? void 0 : _knownTypes$typesBund6.signedExtensions);
|
|
59
|
-
});
|
|
29
|
+
function getSpecExtensions({ knownTypes }, chainName, specName) {
|
|
30
|
+
return withNames(chainName, specName, (c, s) => (0, util_1.objectSpread)({}, knownTypes.typesBundle?.spec?.[s]?.signedExtensions, knownTypes.typesBundle?.chain?.[c]?.signedExtensions));
|
|
60
31
|
}
|
|
61
|
-
|
|
32
|
+
exports.getSpecExtensions = getSpecExtensions;
|
|
62
33
|
/**
|
|
63
34
|
* @description Based on the chain and runtimeVersion, get the applicable types (ready for registration)
|
|
64
35
|
*/
|
|
65
|
-
function getSpecTypes(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// The order here is always, based on -
|
|
74
|
-
// - spec then chain
|
|
75
|
-
// - typesBundle takes higher precedence
|
|
76
|
-
// - types is the final catch-all override
|
|
77
|
-
(0, _util.objectSpread)({}, filterVersions(_spec.default[s], _specVersion), filterVersions(_chain.default[c], _specVersion), filterVersions((_knownTypes$typesBund7 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund8 = _knownTypes$typesBund7.spec) == null ? void 0 : (_knownTypes$typesBund9 = _knownTypes$typesBund8[s]) == null ? void 0 : _knownTypes$typesBund9.types, _specVersion), filterVersions((_knownTypes$typesBund10 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund11 = _knownTypes$typesBund10.chain) == null ? void 0 : (_knownTypes$typesBund12 = _knownTypes$typesBund11[c]) == null ? void 0 : _knownTypes$typesBund12.types, _specVersion), (_knownTypes$typesSpec = knownTypes.typesSpec) == null ? void 0 : _knownTypes$typesSpec[s], (_knownTypes$typesChai = knownTypes.typesChain) == null ? void 0 : _knownTypes$typesChai[c], knownTypes.types)
|
|
78
|
-
);
|
|
79
|
-
});
|
|
36
|
+
function getSpecTypes({ knownTypes }, chainName, specName, specVersion) {
|
|
37
|
+
const _specVersion = (0, util_1.bnToBn)(specVersion).toNumber();
|
|
38
|
+
return withNames(chainName, specName, (c, s) =>
|
|
39
|
+
// The order here is always, based on -
|
|
40
|
+
// - spec then chain
|
|
41
|
+
// - typesBundle takes higher precedence
|
|
42
|
+
// - types is the final catch-all override
|
|
43
|
+
(0, util_1.objectSpread)({}, filterVersions(spec_1.default[s], _specVersion), filterVersions(chain_1.default[c], _specVersion), filterVersions(knownTypes.typesBundle?.spec?.[s]?.types, _specVersion), filterVersions(knownTypes.typesBundle?.chain?.[c]?.types, _specVersion), knownTypes.typesSpec?.[s], knownTypes.typesChain?.[c], knownTypes.types));
|
|
80
44
|
}
|
|
81
|
-
|
|
45
|
+
exports.getSpecTypes = getSpecTypes;
|
|
82
46
|
/**
|
|
83
47
|
* @description Based on the chain or spec, return the hasher used
|
|
84
48
|
*/
|
|
85
|
-
function getSpecHasher(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var _knownTypes$typesBund13, _knownTypes$typesBund14, _knownTypes$typesBund15, _knownTypes$typesBund16, _knownTypes$typesBund17, _knownTypes$typesBund18;
|
|
91
|
-
return knownTypes.hasher || ((_knownTypes$typesBund13 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund14 = _knownTypes$typesBund13.chain) == null ? void 0 : (_knownTypes$typesBund15 = _knownTypes$typesBund14[c]) == null ? void 0 : _knownTypes$typesBund15.hasher) || ((_knownTypes$typesBund16 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund17 = _knownTypes$typesBund16.spec) == null ? void 0 : (_knownTypes$typesBund18 = _knownTypes$typesBund17[s]) == null ? void 0 : _knownTypes$typesBund18.hasher) || null;
|
|
92
|
-
});
|
|
49
|
+
function getSpecHasher({ knownTypes }, chainName, specName) {
|
|
50
|
+
return withNames(chainName, specName, (c, s) => knownTypes.hasher ||
|
|
51
|
+
knownTypes.typesBundle?.chain?.[c]?.hasher ||
|
|
52
|
+
knownTypes.typesBundle?.spec?.[s]?.hasher ||
|
|
53
|
+
null);
|
|
93
54
|
}
|
|
94
|
-
|
|
55
|
+
exports.getSpecHasher = getSpecHasher;
|
|
95
56
|
/**
|
|
96
57
|
* @description Based on the chain and runtimeVersion, get the applicable rpc definitions (ready for registration)
|
|
97
58
|
*/
|
|
98
|
-
function getSpecRpc(
|
|
99
|
-
|
|
100
|
-
knownTypes
|
|
101
|
-
} = _ref6;
|
|
102
|
-
return withNames(chainName, specName, (c, s) => {
|
|
103
|
-
var _knownTypes$typesBund19, _knownTypes$typesBund20, _knownTypes$typesBund21, _knownTypes$typesBund22, _knownTypes$typesBund23, _knownTypes$typesBund24;
|
|
104
|
-
return (0, _util.objectSpread)({}, (_knownTypes$typesBund19 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund20 = _knownTypes$typesBund19.spec) == null ? void 0 : (_knownTypes$typesBund21 = _knownTypes$typesBund20[s]) == null ? void 0 : _knownTypes$typesBund21.rpc, (_knownTypes$typesBund22 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund23 = _knownTypes$typesBund22.chain) == null ? void 0 : (_knownTypes$typesBund24 = _knownTypes$typesBund23[c]) == null ? void 0 : _knownTypes$typesBund24.rpc);
|
|
105
|
-
});
|
|
59
|
+
function getSpecRpc({ knownTypes }, chainName, specName) {
|
|
60
|
+
return withNames(chainName, specName, (c, s) => (0, util_1.objectSpread)({}, knownTypes.typesBundle?.spec?.[s]?.rpc, knownTypes.typesBundle?.chain?.[c]?.rpc));
|
|
106
61
|
}
|
|
107
|
-
|
|
62
|
+
exports.getSpecRpc = getSpecRpc;
|
|
108
63
|
/**
|
|
109
64
|
* @description Based on the chain and runtimeVersion, get the applicable runtime definitions (ready for registration)
|
|
110
65
|
*/
|
|
111
|
-
function getSpecRuntime(
|
|
112
|
-
|
|
113
|
-
knownTypes
|
|
114
|
-
} = _ref7;
|
|
115
|
-
return withNames(chainName, specName, (c, s) => {
|
|
116
|
-
var _knownTypes$typesBund25, _knownTypes$typesBund26, _knownTypes$typesBund27, _knownTypes$typesBund28, _knownTypes$typesBund29, _knownTypes$typesBund30;
|
|
117
|
-
return (0, _util.objectSpread)({}, (_knownTypes$typesBund25 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund26 = _knownTypes$typesBund25.spec) == null ? void 0 : (_knownTypes$typesBund27 = _knownTypes$typesBund26[s]) == null ? void 0 : _knownTypes$typesBund27.runtime, (_knownTypes$typesBund28 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund29 = _knownTypes$typesBund28.chain) == null ? void 0 : (_knownTypes$typesBund30 = _knownTypes$typesBund29[c]) == null ? void 0 : _knownTypes$typesBund30.runtime);
|
|
118
|
-
});
|
|
66
|
+
function getSpecRuntime({ knownTypes }, chainName, specName) {
|
|
67
|
+
return withNames(chainName, specName, (c, s) => (0, util_1.objectSpread)({}, knownTypes.typesBundle?.spec?.[s]?.runtime, knownTypes.typesBundle?.chain?.[c]?.runtime));
|
|
119
68
|
}
|
|
120
|
-
|
|
69
|
+
exports.getSpecRuntime = getSpecRuntime;
|
|
121
70
|
/**
|
|
122
71
|
* @description Based on the chain and runtimeVersion, get the applicable alias definitions (ready for registration)
|
|
123
72
|
*/
|
|
124
|
-
function getSpecAlias(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return withNames(chainName, specName, (c, s) => {
|
|
129
|
-
var _knownTypes$typesBund31, _knownTypes$typesBund32, _knownTypes$typesBund33, _knownTypes$typesBund34, _knownTypes$typesBund35, _knownTypes$typesBund36;
|
|
130
|
-
return (
|
|
131
|
-
// as per versions, first spec, then chain then finally non-versioned
|
|
132
|
-
(0, _util.objectSpread)({}, (_knownTypes$typesBund31 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund32 = _knownTypes$typesBund31.spec) == null ? void 0 : (_knownTypes$typesBund33 = _knownTypes$typesBund32[s]) == null ? void 0 : _knownTypes$typesBund33.alias, (_knownTypes$typesBund34 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund35 = _knownTypes$typesBund34.chain) == null ? void 0 : (_knownTypes$typesBund36 = _knownTypes$typesBund35[c]) == null ? void 0 : _knownTypes$typesBund36.alias, knownTypes.typesAlias)
|
|
133
|
-
);
|
|
134
|
-
});
|
|
73
|
+
function getSpecAlias({ knownTypes }, chainName, specName) {
|
|
74
|
+
return withNames(chainName, specName, (c, s) =>
|
|
75
|
+
// as per versions, first spec, then chain then finally non-versioned
|
|
76
|
+
(0, util_1.objectSpread)({}, knownTypes.typesBundle?.spec?.[s]?.alias, knownTypes.typesBundle?.chain?.[c]?.alias, knownTypes.typesAlias));
|
|
135
77
|
}
|
|
136
|
-
|
|
78
|
+
exports.getSpecAlias = getSpecAlias;
|
|
137
79
|
/**
|
|
138
80
|
* @description Returns a version record for known chains where upgrades are being tracked
|
|
139
81
|
*/
|
|
140
82
|
function getUpgradeVersion(genesisHash, blockNumber) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
83
|
+
const known = upgrades_1.default.find((u) => genesisHash.eq(u.genesisHash));
|
|
84
|
+
return known
|
|
85
|
+
? [
|
|
86
|
+
known.versions.reduce((last, version) => {
|
|
87
|
+
return blockNumber.gt(version.blockNumber)
|
|
88
|
+
? version
|
|
89
|
+
: last;
|
|
90
|
+
}, undefined),
|
|
91
|
+
known.versions.find((version) => blockNumber.lte(version.blockNumber))
|
|
92
|
+
]
|
|
93
|
+
: [undefined, undefined];
|
|
94
|
+
}
|
|
95
|
+
exports.getUpgradeVersion = getUpgradeVersion;
|
package/detectOther.js
CHANGED
package/detectPackage.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
// Copyright 2017-2023 @polkadot/types-known authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
// Do not edit, auto-generated by @polkadot/dev
|
|
5
|
-
|
|
6
1
|
import { detectPackage } from '@polkadot/util';
|
|
7
|
-
import others from
|
|
8
|
-
import { packageInfo } from
|
|
2
|
+
import others from './detectOther.js';
|
|
3
|
+
import { packageInfo } from './packageInfo.js';
|
|
9
4
|
detectPackage(packageInfo, null, others);
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"./cjs/detectPackage.js"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"version": "
|
|
23
|
+
"version": "10.0.1",
|
|
24
24
|
"main": "./cjs/index.js",
|
|
25
25
|
"module": "./index.js",
|
|
26
26
|
"types": "./index.d.ts",
|
|
@@ -52,7 +52,10 @@
|
|
|
52
52
|
"require": "./cjs/detectPackage.js",
|
|
53
53
|
"default": "./detectPackage.js"
|
|
54
54
|
},
|
|
55
|
-
"./package.json":
|
|
55
|
+
"./package.json": {
|
|
56
|
+
"require": "./cjs/package.json",
|
|
57
|
+
"default": "./package.json"
|
|
58
|
+
},
|
|
56
59
|
"./packageInfo.js": {
|
|
57
60
|
"types": "./packageInfo.d.ts",
|
|
58
61
|
"require": "./cjs/packageInfo.js",
|
|
@@ -170,11 +173,11 @@
|
|
|
170
173
|
}
|
|
171
174
|
},
|
|
172
175
|
"dependencies": {
|
|
173
|
-
"@
|
|
174
|
-
"@polkadot/
|
|
175
|
-
"@polkadot/types": "
|
|
176
|
-
"@polkadot/types-
|
|
177
|
-
"@polkadot/
|
|
178
|
-
"
|
|
176
|
+
"@polkadot/networks": "^11.0.1",
|
|
177
|
+
"@polkadot/types": "10.0.1",
|
|
178
|
+
"@polkadot/types-codec": "10.0.1",
|
|
179
|
+
"@polkadot/types-create": "10.0.1",
|
|
180
|
+
"@polkadot/util": "^11.0.1",
|
|
181
|
+
"tslib": "^2.5.0"
|
|
179
182
|
}
|
|
180
183
|
}
|
package/packageInfo.js
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
// Do not edit, auto-generated by @polkadot/dev
|
|
5
|
-
|
|
6
|
-
export const packageInfo = {
|
|
7
|
-
name: '@polkadot/types-known',
|
|
8
|
-
path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
|
|
9
|
-
type: 'esm',
|
|
10
|
-
version: '9.14.1'
|
|
11
|
-
};
|
|
1
|
+
export const packageInfo = { name: '@polkadot/types-known', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '10.0.1' };
|