@polkadot/types-known 6.5.3-9 → 6.6.2-10
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.cjs +43 -24
- package/package.json +5 -5
- package/packageInfo.cjs +1 -1
- package/packageInfo.js +1 -1
- package/upgrades/index.cjs +9 -5
package/bundle.cjs
CHANGED
|
@@ -56,23 +56,32 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
56
56
|
// flatten a VersionedType[] into a Record<string, string>
|
|
57
57
|
|
|
58
58
|
/** @internal */
|
|
59
|
-
function filterVersions(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
function filterVersions() {
|
|
60
|
+
let versions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
61
|
+
let specVersion = arguments.length > 1 ? arguments[1] : undefined;
|
|
62
|
+
return versions.filter(_ref => {
|
|
63
|
+
let {
|
|
64
|
+
minmax: [min, max]
|
|
65
|
+
} = _ref;
|
|
66
|
+
return ((0, _util.isUndefined)(min) || (0, _util.isNull)(min) || specVersion >= min) && ((0, _util.isUndefined)(max) || (0, _util.isNull)(max) || specVersion <= max);
|
|
67
|
+
}).reduce((result, _ref2) => {
|
|
68
|
+
let {
|
|
69
|
+
types
|
|
70
|
+
} = _ref2;
|
|
71
|
+
return _objectSpread(_objectSpread({}, result), types);
|
|
72
|
+
}, {});
|
|
65
73
|
}
|
|
66
74
|
/**
|
|
67
75
|
* @description Get types for specific modules (metadata override)
|
|
68
76
|
*/
|
|
69
77
|
|
|
70
78
|
|
|
71
|
-
function getModuleTypes({
|
|
72
|
-
knownTypes
|
|
73
|
-
}, section) {
|
|
79
|
+
function getModuleTypes(_ref3, section) {
|
|
74
80
|
var _knownTypes$typesAlia;
|
|
75
81
|
|
|
82
|
+
let {
|
|
83
|
+
knownTypes
|
|
84
|
+
} = _ref3;
|
|
76
85
|
return _objectSpread(_objectSpread({}, _modules.default[section] || {}), ((_knownTypes$typesAlia = knownTypes.typesAlias) === null || _knownTypes$typesAlia === void 0 ? void 0 : _knownTypes$typesAlia[section]) || {});
|
|
77
86
|
}
|
|
78
87
|
/**
|
|
@@ -80,11 +89,13 @@ function getModuleTypes({
|
|
|
80
89
|
*/
|
|
81
90
|
|
|
82
91
|
|
|
83
|
-
function getSpecExtensions({
|
|
84
|
-
knownTypes
|
|
85
|
-
}, chainName, specName) {
|
|
92
|
+
function getSpecExtensions(_ref4, chainName, specName) {
|
|
86
93
|
var _knownTypes$typesBund, _knownTypes$typesBund2, _knownTypes$typesBund3, _knownTypes$typesBund4, _knownTypes$typesBund5, _knownTypes$typesBund6;
|
|
87
94
|
|
|
95
|
+
let {
|
|
96
|
+
knownTypes
|
|
97
|
+
} = _ref4;
|
|
98
|
+
|
|
88
99
|
const _chainName = chainName.toString();
|
|
89
100
|
|
|
90
101
|
const _specName = specName.toString();
|
|
@@ -96,11 +107,13 @@ function getSpecExtensions({
|
|
|
96
107
|
*/
|
|
97
108
|
|
|
98
109
|
|
|
99
|
-
function getSpecTypes({
|
|
100
|
-
knownTypes
|
|
101
|
-
}, chainName, specName, specVersion) {
|
|
110
|
+
function getSpecTypes(_ref5, chainName, specName, specVersion) {
|
|
102
111
|
var _knownTypes$typesBund7, _knownTypes$typesBund8, _knownTypes$typesBund9, _knownTypes$typesBund10, _knownTypes$typesBund11, _knownTypes$typesBund12, _knownTypes$typesSpec, _knownTypes$typesChai;
|
|
103
112
|
|
|
113
|
+
let {
|
|
114
|
+
knownTypes
|
|
115
|
+
} = _ref5;
|
|
116
|
+
|
|
104
117
|
const _chainName = chainName.toString();
|
|
105
118
|
|
|
106
119
|
const _specName = specName.toString();
|
|
@@ -114,11 +127,13 @@ function getSpecTypes({
|
|
|
114
127
|
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, filterVersions(_index2.default[_specName], _specVersion)), filterVersions(_index.default[_chainName], _specVersion)), filterVersions((_knownTypes$typesBund7 = knownTypes.typesBundle) === null || _knownTypes$typesBund7 === void 0 ? void 0 : (_knownTypes$typesBund8 = _knownTypes$typesBund7.spec) === null || _knownTypes$typesBund8 === void 0 ? void 0 : (_knownTypes$typesBund9 = _knownTypes$typesBund8[_specName]) === null || _knownTypes$typesBund9 === void 0 ? void 0 : _knownTypes$typesBund9.types, _specVersion)), filterVersions((_knownTypes$typesBund10 = knownTypes.typesBundle) === null || _knownTypes$typesBund10 === void 0 ? void 0 : (_knownTypes$typesBund11 = _knownTypes$typesBund10.chain) === null || _knownTypes$typesBund11 === void 0 ? void 0 : (_knownTypes$typesBund12 = _knownTypes$typesBund11[_chainName]) === null || _knownTypes$typesBund12 === void 0 ? void 0 : _knownTypes$typesBund12.types, _specVersion)), ((_knownTypes$typesSpec = knownTypes.typesSpec) === null || _knownTypes$typesSpec === void 0 ? void 0 : _knownTypes$typesSpec[_specName]) || {}), ((_knownTypes$typesChai = knownTypes.typesChain) === null || _knownTypes$typesChai === void 0 ? void 0 : _knownTypes$typesChai[_chainName]) || {}), knownTypes.types || {});
|
|
115
128
|
}
|
|
116
129
|
|
|
117
|
-
function getSpecHasher({
|
|
118
|
-
knownTypes
|
|
119
|
-
}, chainName, specName) {
|
|
130
|
+
function getSpecHasher(_ref6, chainName, specName) {
|
|
120
131
|
var _knownTypes$typesBund13, _knownTypes$typesBund14, _knownTypes$typesBund15, _knownTypes$typesBund16, _knownTypes$typesBund17, _knownTypes$typesBund18;
|
|
121
132
|
|
|
133
|
+
let {
|
|
134
|
+
knownTypes
|
|
135
|
+
} = _ref6;
|
|
136
|
+
|
|
122
137
|
const _chainName = chainName.toString();
|
|
123
138
|
|
|
124
139
|
const _specName = specName.toString();
|
|
@@ -130,11 +145,13 @@ function getSpecHasher({
|
|
|
130
145
|
*/
|
|
131
146
|
|
|
132
147
|
|
|
133
|
-
function getSpecRpc({
|
|
134
|
-
knownTypes
|
|
135
|
-
}, chainName, specName) {
|
|
148
|
+
function getSpecRpc(_ref7, chainName, specName) {
|
|
136
149
|
var _knownTypes$typesBund19, _knownTypes$typesBund20, _knownTypes$typesBund21, _knownTypes$typesBund22, _knownTypes$typesBund23, _knownTypes$typesBund24;
|
|
137
150
|
|
|
151
|
+
let {
|
|
152
|
+
knownTypes
|
|
153
|
+
} = _ref7;
|
|
154
|
+
|
|
138
155
|
const _chainName = chainName.toString();
|
|
139
156
|
|
|
140
157
|
const _specName = specName.toString();
|
|
@@ -146,11 +163,13 @@ function getSpecRpc({
|
|
|
146
163
|
*/
|
|
147
164
|
|
|
148
165
|
|
|
149
|
-
function getSpecAlias({
|
|
150
|
-
knownTypes
|
|
151
|
-
}, chainName, specName) {
|
|
166
|
+
function getSpecAlias(_ref8, chainName, specName) {
|
|
152
167
|
var _knownTypes$typesBund25, _knownTypes$typesBund26, _knownTypes$typesBund27, _knownTypes$typesBund28, _knownTypes$typesBund29, _knownTypes$typesBund30;
|
|
153
168
|
|
|
169
|
+
let {
|
|
170
|
+
knownTypes
|
|
171
|
+
} = _ref8;
|
|
172
|
+
|
|
154
173
|
const _chainName = chainName.toString();
|
|
155
174
|
|
|
156
175
|
const _specName = specName.toString(); // as per versions, first spec, then chain then finally non-versioned
|
package/package.json
CHANGED
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"./detectPackage.cjs"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"version": "6.
|
|
23
|
+
"version": "6.6.2-10",
|
|
24
24
|
"main": "index.js",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@babel/runtime": "^7.
|
|
27
|
-
"@polkadot/networks": "^7.
|
|
28
|
-
"@polkadot/types": "6.
|
|
29
|
-
"@polkadot/util": "^7.
|
|
26
|
+
"@babel/runtime": "^7.16.0",
|
|
27
|
+
"@polkadot/networks": "^7.7.1",
|
|
28
|
+
"@polkadot/types": "6.6.2-10",
|
|
29
|
+
"@polkadot/util": "^7.7.1"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
".": {
|
package/packageInfo.cjs
CHANGED
package/packageInfo.js
CHANGED
package/upgrades/index.cjs
CHANGED
|
@@ -43,16 +43,20 @@ function checkOrder(network, versions) {
|
|
|
43
43
|
/** @internal */
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
function mapRaw(
|
|
46
|
+
function mapRaw(_ref) {
|
|
47
|
+
let [network, versions] = _ref;
|
|
47
48
|
const chain = _networks.selectableNetworks.find(n => n.network === network) || NET_EXTRA[network];
|
|
48
49
|
(0, _util.assert)(chain, () => `Unable to find info for chain ${network}`);
|
|
49
50
|
return {
|
|
50
51
|
genesisHash: (0, _util.hexToU8a)(chain.genesisHash[0]),
|
|
51
52
|
network,
|
|
52
|
-
versions: checkOrder(network, versions).map(
|
|
53
|
-
blockNumber
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
versions: checkOrder(network, versions).map(_ref2 => {
|
|
54
|
+
let [blockNumber, specVersion] = _ref2;
|
|
55
|
+
return {
|
|
56
|
+
blockNumber: new _util.BN(blockNumber),
|
|
57
|
+
specVersion: new _util.BN(specVersion)
|
|
58
|
+
};
|
|
59
|
+
})
|
|
56
60
|
};
|
|
57
61
|
} // Type overrides for specific spec types & versions as given in runtimeVersion
|
|
58
62
|
|