@polkadot/types-known 6.12.1 → 6.12.2-3
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 +30 -158
- package/bundle.d.ts +1 -33
- package/bundle.js +2 -115
- package/package.json +4 -99
- package/packageInfo.cjs +1 -1
- package/packageInfo.js +1 -1
- package/chain/index.cjs +0 -12
- package/chain/index.d.ts +0 -3
- package/chain/index.js +0 -5
- package/knownOrigins.cjs +0 -32
- package/knownOrigins.d.ts +0 -1
- package/knownOrigins.js +0 -25
- package/modules.cjs +0 -111
- package/modules.d.ts +0 -3
- package/modules.js +0 -104
- package/spec/centrifuge-chain.cjs +0 -98
- package/spec/centrifuge-chain.d.ts +0 -3
- package/spec/centrifuge-chain.js +0 -89
- package/spec/index.cjs +0 -45
- package/spec/index.d.ts +0 -3
- package/spec/index.js +0 -26
- package/spec/kusama.cjs +0 -177
- package/spec/kusama.d.ts +0 -3
- package/spec/kusama.js +0 -167
- package/spec/node-template.cjs +0 -17
- package/spec/node-template.d.ts +0 -3
- package/spec/node-template.js +0 -10
- package/spec/node.cjs +0 -17
- package/spec/node.d.ts +0 -3
- package/spec/node.js +0 -10
- package/spec/polkadot.cjs +0 -74
- package/spec/polkadot.d.ts +0 -3
- package/spec/polkadot.js +0 -65
- package/spec/rococo.cjs +0 -53
- package/spec/rococo.d.ts +0 -3
- package/spec/rococo.js +0 -43
- package/spec/shell.cjs +0 -17
- package/spec/shell.d.ts +0 -3
- package/spec/shell.js +0 -10
- package/spec/statemint.cjs +0 -35
- package/spec/statemint.d.ts +0 -3
- package/spec/statemint.js +0 -25
- package/spec/westend.cjs +0 -90
- package/spec/westend.d.ts +0 -3
- package/spec/westend.js +0 -80
- package/upgrades/index.cjs +0 -66
- package/upgrades/index.d.ts +0 -3
- package/upgrades/index.js +0 -47
- package/upgrades/kusama.cjs +0 -11
- package/upgrades/kusama.d.ts +0 -3
- package/upgrades/kusama.js +0 -4
- package/upgrades/polkadot.cjs +0 -11
- package/upgrades/polkadot.d.ts +0 -3
- package/upgrades/polkadot.js +0 -4
- package/upgrades/types.cjs +0 -1
- package/upgrades/types.d.ts +0 -1
- package/upgrades/types.js +0 -1
- package/upgrades/westend.cjs +0 -11
- package/upgrades/westend.d.ts +0 -3
- package/upgrades/westend.js +0 -4
- package/xcm.cjs +0 -20
- package/xcm.d.ts +0 -2
- package/xcm.js +0 -9
package/bundle.cjs
CHANGED
|
@@ -1,27 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
exports
|
|
15
|
-
|
|
6
|
+
Object.defineProperty(exports, "getSpecAlias", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _types.getSpecAlias;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "getSpecExtensions", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _types.getSpecExtensions;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "getSpecHasher", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _types.getSpecHasher;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "getSpecRpc", {
|
|
16
25
|
enumerable: true,
|
|
17
26
|
get: function () {
|
|
18
|
-
return
|
|
27
|
+
return _types.getSpecRpc;
|
|
19
28
|
}
|
|
20
29
|
});
|
|
21
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "getSpecTypes", {
|
|
22
31
|
enumerable: true,
|
|
23
32
|
get: function () {
|
|
24
|
-
return
|
|
33
|
+
return _types.getSpecTypes;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "getUpgradeVersion", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _types.getUpgradeVersion;
|
|
25
40
|
}
|
|
26
41
|
});
|
|
27
42
|
Object.defineProperty(exports, "packageInfo", {
|
|
@@ -31,149 +46,6 @@ Object.defineProperty(exports, "packageInfo", {
|
|
|
31
46
|
}
|
|
32
47
|
});
|
|
33
48
|
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
var _index = _interopRequireDefault(require("./chain/index.cjs"));
|
|
37
|
-
|
|
38
|
-
var _modules = _interopRequireDefault(require("./modules.cjs"));
|
|
39
|
-
|
|
40
|
-
var _index2 = _interopRequireDefault(require("./spec/index.cjs"));
|
|
41
|
-
|
|
42
|
-
var _index3 = _interopRequireDefault(require("./upgrades/index.cjs"));
|
|
43
|
-
|
|
44
|
-
var _knownOrigins = require("./knownOrigins.cjs");
|
|
45
|
-
|
|
46
|
-
var _packageInfo = require("./packageInfo.cjs");
|
|
47
|
-
|
|
48
|
-
var _xcm = require("./xcm.cjs");
|
|
49
|
-
|
|
50
|
-
// Copyright 2017-2021 @polkadot/types-known authors & contributors
|
|
51
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
52
|
-
function withNames(chainName, specName, fn) {
|
|
53
|
-
return fn(chainName.toString(), specName.toString());
|
|
54
|
-
} // flatten a VersionedType[] into a Record<string, string>
|
|
55
|
-
|
|
56
|
-
/** @internal */
|
|
57
|
-
|
|
58
|
-
|
|
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 (0, _util.objectSpread)(result, types);
|
|
72
|
-
}, {});
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* @description Get types for specific modules (metadata override)
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
function getModuleTypes(_ref3, section) {
|
|
80
|
-
var _knownTypes$typesAlia;
|
|
81
|
-
|
|
82
|
-
let {
|
|
83
|
-
knownTypes
|
|
84
|
-
} = _ref3;
|
|
85
|
-
return (0, _util.objectSpread)({}, _modules.default[section], (_knownTypes$typesAlia = knownTypes.typesAlias) === null || _knownTypes$typesAlia === void 0 ? void 0 : _knownTypes$typesAlia[section]);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* @description Based on the chain and runtimeVersion, get the applicable signed extensions (ready for registration)
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
function getSpecExtensions(_ref4, chainName, specName) {
|
|
93
|
-
let {
|
|
94
|
-
knownTypes
|
|
95
|
-
} = _ref4;
|
|
96
|
-
return withNames(chainName, specName, (c, s) => {
|
|
97
|
-
var _knownTypes$typesBund, _knownTypes$typesBund2, _knownTypes$typesBund3, _knownTypes$typesBund4, _knownTypes$typesBund5, _knownTypes$typesBund6;
|
|
98
|
-
|
|
99
|
-
return (0, _util.objectSpread)({}, (_knownTypes$typesBund = knownTypes.typesBundle) === null || _knownTypes$typesBund === void 0 ? void 0 : (_knownTypes$typesBund2 = _knownTypes$typesBund.spec) === null || _knownTypes$typesBund2 === void 0 ? void 0 : (_knownTypes$typesBund3 = _knownTypes$typesBund2[s]) === null || _knownTypes$typesBund3 === void 0 ? void 0 : _knownTypes$typesBund3.signedExtensions, (_knownTypes$typesBund4 = knownTypes.typesBundle) === null || _knownTypes$typesBund4 === void 0 ? void 0 : (_knownTypes$typesBund5 = _knownTypes$typesBund4.chain) === null || _knownTypes$typesBund5 === void 0 ? void 0 : (_knownTypes$typesBund6 = _knownTypes$typesBund5[c]) === null || _knownTypes$typesBund6 === void 0 ? void 0 : _knownTypes$typesBund6.signedExtensions);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* @description Based on the chain and runtimeVersion, get the applicable types (ready for registration)
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
function getSpecTypes(_ref5, chainName, specName, specVersion) {
|
|
108
|
-
let {
|
|
109
|
-
knownTypes
|
|
110
|
-
} = _ref5;
|
|
111
|
-
|
|
112
|
-
const _specVersion = (0, _util.bnToBn)(specVersion).toNumber();
|
|
113
|
-
|
|
114
|
-
return withNames(chainName, specName, (c, s) => {
|
|
115
|
-
var _knownTypes$typesBund7, _knownTypes$typesBund8, _knownTypes$typesBund9, _knownTypes$typesBund10, _knownTypes$typesBund11, _knownTypes$typesBund12, _knownTypes$typesSpec, _knownTypes$typesChai;
|
|
116
|
-
|
|
117
|
-
return (// The order here is always, based on -
|
|
118
|
-
// - spec then chain
|
|
119
|
-
// - typesBundle takes higher precedence
|
|
120
|
-
// - types is the final catch-all override
|
|
121
|
-
(0, _util.objectSpread)({}, filterVersions(_index2.default[s], _specVersion), filterVersions(_index.default[c], _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[s]) === 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[c]) === null || _knownTypes$typesBund12 === void 0 ? void 0 : _knownTypes$typesBund12.types, _specVersion), (_knownTypes$typesSpec = knownTypes.typesSpec) === null || _knownTypes$typesSpec === void 0 ? void 0 : _knownTypes$typesSpec[s], (_knownTypes$typesChai = knownTypes.typesChain) === null || _knownTypes$typesChai === void 0 ? void 0 : _knownTypes$typesChai[c], knownTypes.types)
|
|
122
|
-
);
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function getSpecHasher(_ref6, chainName, specName) {
|
|
127
|
-
let {
|
|
128
|
-
knownTypes
|
|
129
|
-
} = _ref6;
|
|
130
|
-
return withNames(chainName, specName, (c, s) => {
|
|
131
|
-
var _knownTypes$typesBund13, _knownTypes$typesBund14, _knownTypes$typesBund15, _knownTypes$typesBund16, _knownTypes$typesBund17, _knownTypes$typesBund18;
|
|
132
|
-
|
|
133
|
-
return knownTypes.hasher || ((_knownTypes$typesBund13 = knownTypes.typesBundle) === null || _knownTypes$typesBund13 === void 0 ? void 0 : (_knownTypes$typesBund14 = _knownTypes$typesBund13.chain) === null || _knownTypes$typesBund14 === void 0 ? void 0 : (_knownTypes$typesBund15 = _knownTypes$typesBund14[c]) === null || _knownTypes$typesBund15 === void 0 ? void 0 : _knownTypes$typesBund15.hasher) || ((_knownTypes$typesBund16 = knownTypes.typesBundle) === null || _knownTypes$typesBund16 === void 0 ? void 0 : (_knownTypes$typesBund17 = _knownTypes$typesBund16.spec) === null || _knownTypes$typesBund17 === void 0 ? void 0 : (_knownTypes$typesBund18 = _knownTypes$typesBund17[s]) === null || _knownTypes$typesBund18 === void 0 ? void 0 : _knownTypes$typesBund18.hasher) || null;
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* @description Based on the chain and runtimeVersion, get the applicable rpc definitions (ready for registration)
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
function getSpecRpc(_ref7, chainName, specName) {
|
|
142
|
-
let {
|
|
143
|
-
knownTypes
|
|
144
|
-
} = _ref7;
|
|
145
|
-
return withNames(chainName, specName, (c, s) => {
|
|
146
|
-
var _knownTypes$typesBund19, _knownTypes$typesBund20, _knownTypes$typesBund21, _knownTypes$typesBund22, _knownTypes$typesBund23, _knownTypes$typesBund24;
|
|
147
|
-
|
|
148
|
-
return (0, _util.objectSpread)({}, (_knownTypes$typesBund19 = knownTypes.typesBundle) === null || _knownTypes$typesBund19 === void 0 ? void 0 : (_knownTypes$typesBund20 = _knownTypes$typesBund19.spec) === null || _knownTypes$typesBund20 === void 0 ? void 0 : (_knownTypes$typesBund21 = _knownTypes$typesBund20[s]) === null || _knownTypes$typesBund21 === void 0 ? void 0 : _knownTypes$typesBund21.rpc, (_knownTypes$typesBund22 = knownTypes.typesBundle) === null || _knownTypes$typesBund22 === void 0 ? void 0 : (_knownTypes$typesBund23 = _knownTypes$typesBund22.chain) === null || _knownTypes$typesBund23 === void 0 ? void 0 : (_knownTypes$typesBund24 = _knownTypes$typesBund23[c]) === null || _knownTypes$typesBund24 === void 0 ? void 0 : _knownTypes$typesBund24.rpc);
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* @description Based on the chain and runtimeVersion, get the applicable alias definitions (ready for registration)
|
|
153
|
-
*/
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
function getSpecAlias(_ref8, chainName, specName) {
|
|
157
|
-
let {
|
|
158
|
-
knownTypes
|
|
159
|
-
} = _ref8;
|
|
160
|
-
return withNames(chainName, specName, (c, s) => {
|
|
161
|
-
var _knownTypes$typesBund25, _knownTypes$typesBund26, _knownTypes$typesBund27, _knownTypes$typesBund28, _knownTypes$typesBund29, _knownTypes$typesBund30;
|
|
162
|
-
|
|
163
|
-
return (// as per versions, first spec, then chain then finally non-versioned
|
|
164
|
-
(0, _util.objectSpread)({}, (_knownTypes$typesBund25 = knownTypes.typesBundle) === null || _knownTypes$typesBund25 === void 0 ? void 0 : (_knownTypes$typesBund26 = _knownTypes$typesBund25.spec) === null || _knownTypes$typesBund26 === void 0 ? void 0 : (_knownTypes$typesBund27 = _knownTypes$typesBund26[s]) === null || _knownTypes$typesBund27 === void 0 ? void 0 : _knownTypes$typesBund27.alias, (_knownTypes$typesBund28 = knownTypes.typesBundle) === null || _knownTypes$typesBund28 === void 0 ? void 0 : (_knownTypes$typesBund29 = _knownTypes$typesBund28.chain) === null || _knownTypes$typesBund29 === void 0 ? void 0 : (_knownTypes$typesBund30 = _knownTypes$typesBund29[c]) === null || _knownTypes$typesBund30 === void 0 ? void 0 : _knownTypes$typesBund30.alias, knownTypes.typesAlias)
|
|
165
|
-
);
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* @description Returns a version record for known chains where upgrades are being tracked
|
|
170
|
-
*/
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
function getUpgradeVersion(genesisHash, blockNumber) {
|
|
174
|
-
const known = _index3.default.find(u => genesisHash.eq(u.genesisHash));
|
|
49
|
+
var _types = require("@polkadot/types");
|
|
175
50
|
|
|
176
|
-
|
|
177
|
-
return blockNumber.gt(version.blockNumber) ? version : last;
|
|
178
|
-
}, undefined), known.versions.find(version => blockNumber.lte(version.blockNumber))] : [undefined, undefined];
|
|
179
|
-
}
|
|
51
|
+
var _packageInfo = require("./packageInfo.cjs");
|
package/bundle.d.ts
CHANGED
|
@@ -1,34 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { Text } from '@polkadot/types';
|
|
3
|
-
import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
|
|
4
|
-
import type { Hash } from '@polkadot/types/interfaces';
|
|
5
|
-
import type { ChainUpgradeVersion, CodecHasher, DefinitionRpc, DefinitionRpcSub, OverrideModuleType, Registry, RegistryTypes } from '@polkadot/types/types';
|
|
6
|
-
import type { BN } from '@polkadot/util';
|
|
7
|
-
export { knownOrigins } from './knownOrigins';
|
|
1
|
+
export { getSpecAlias, getSpecExtensions, getSpecHasher, getSpecRpc, getSpecTypes, getUpgradeVersion } from '@polkadot/types';
|
|
8
2
|
export { packageInfo } from './packageInfo';
|
|
9
|
-
export { mapXcmTypes } from './xcm';
|
|
10
|
-
/**
|
|
11
|
-
* @description Get types for specific modules (metadata override)
|
|
12
|
-
*/
|
|
13
|
-
export declare function getModuleTypes({ knownTypes }: Registry, section: string): OverrideModuleType;
|
|
14
|
-
/**
|
|
15
|
-
* @description Based on the chain and runtimeVersion, get the applicable signed extensions (ready for registration)
|
|
16
|
-
*/
|
|
17
|
-
export declare function getSpecExtensions({ knownTypes }: Registry, chainName: Text | string, specName: Text | string): ExtDef;
|
|
18
|
-
/**
|
|
19
|
-
* @description Based on the chain and runtimeVersion, get the applicable types (ready for registration)
|
|
20
|
-
*/
|
|
21
|
-
export declare function getSpecTypes({ knownTypes }: Registry, chainName: Text | string, specName: Text | string, specVersion: bigint | BN | number): RegistryTypes;
|
|
22
|
-
export declare function getSpecHasher({ knownTypes }: Registry, chainName: Text | string, specName: Text | string): CodecHasher | null;
|
|
23
|
-
/**
|
|
24
|
-
* @description Based on the chain and runtimeVersion, get the applicable rpc definitions (ready for registration)
|
|
25
|
-
*/
|
|
26
|
-
export declare function getSpecRpc({ knownTypes }: Registry, chainName: Text | string, specName: Text | string): Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>;
|
|
27
|
-
/**
|
|
28
|
-
* @description Based on the chain and runtimeVersion, get the applicable alias definitions (ready for registration)
|
|
29
|
-
*/
|
|
30
|
-
export declare function getSpecAlias({ knownTypes }: Registry, chainName: Text | string, specName: Text | string): Record<string, OverrideModuleType>;
|
|
31
|
-
/**
|
|
32
|
-
* @description Returns a version record for known chains where upgrades are being tracked
|
|
33
|
-
*/
|
|
34
|
-
export declare function getUpgradeVersion(genesisHash: Hash, blockNumber: BN): [ChainUpgradeVersion | undefined, ChainUpgradeVersion | undefined];
|
package/bundle.js
CHANGED
|
@@ -1,117 +1,4 @@
|
|
|
1
1
|
// Copyright 2017-2021 @polkadot/types-known authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import typesModules from "./modules.js";
|
|
6
|
-
import typesSpec from "./spec/index.js";
|
|
7
|
-
import upgrades from "./upgrades/index.js";
|
|
8
|
-
export { knownOrigins } from "./knownOrigins.js";
|
|
9
|
-
export { packageInfo } from "./packageInfo.js";
|
|
10
|
-
export { mapXcmTypes } from "./xcm.js";
|
|
11
|
-
|
|
12
|
-
function withNames(chainName, specName, fn) {
|
|
13
|
-
return fn(chainName.toString(), specName.toString());
|
|
14
|
-
} // flatten a VersionedType[] into a Record<string, string>
|
|
15
|
-
|
|
16
|
-
/** @internal */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function filterVersions(versions = [], specVersion) {
|
|
20
|
-
return versions.filter(({
|
|
21
|
-
minmax: [min, max]
|
|
22
|
-
}) => (isUndefined(min) || isNull(min) || specVersion >= min) && (isUndefined(max) || isNull(max) || specVersion <= max)).reduce((result, {
|
|
23
|
-
types
|
|
24
|
-
}) => objectSpread(result, types), {});
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @description Get types for specific modules (metadata override)
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export function getModuleTypes({
|
|
32
|
-
knownTypes
|
|
33
|
-
}, section) {
|
|
34
|
-
var _knownTypes$typesAlia;
|
|
35
|
-
|
|
36
|
-
return objectSpread({}, typesModules[section], (_knownTypes$typesAlia = knownTypes.typesAlias) === null || _knownTypes$typesAlia === void 0 ? void 0 : _knownTypes$typesAlia[section]);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @description Based on the chain and runtimeVersion, get the applicable signed extensions (ready for registration)
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
export function getSpecExtensions({
|
|
43
|
-
knownTypes
|
|
44
|
-
}, chainName, specName) {
|
|
45
|
-
return withNames(chainName, specName, (c, s) => {
|
|
46
|
-
var _knownTypes$typesBund, _knownTypes$typesBund2, _knownTypes$typesBund3, _knownTypes$typesBund4, _knownTypes$typesBund5, _knownTypes$typesBund6;
|
|
47
|
-
|
|
48
|
-
return objectSpread({}, (_knownTypes$typesBund = knownTypes.typesBundle) === null || _knownTypes$typesBund === void 0 ? void 0 : (_knownTypes$typesBund2 = _knownTypes$typesBund.spec) === null || _knownTypes$typesBund2 === void 0 ? void 0 : (_knownTypes$typesBund3 = _knownTypes$typesBund2[s]) === null || _knownTypes$typesBund3 === void 0 ? void 0 : _knownTypes$typesBund3.signedExtensions, (_knownTypes$typesBund4 = knownTypes.typesBundle) === null || _knownTypes$typesBund4 === void 0 ? void 0 : (_knownTypes$typesBund5 = _knownTypes$typesBund4.chain) === null || _knownTypes$typesBund5 === void 0 ? void 0 : (_knownTypes$typesBund6 = _knownTypes$typesBund5[c]) === null || _knownTypes$typesBund6 === void 0 ? void 0 : _knownTypes$typesBund6.signedExtensions);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* @description Based on the chain and runtimeVersion, get the applicable types (ready for registration)
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
export function getSpecTypes({
|
|
56
|
-
knownTypes
|
|
57
|
-
}, chainName, specName, specVersion) {
|
|
58
|
-
const _specVersion = bnToBn(specVersion).toNumber();
|
|
59
|
-
|
|
60
|
-
return withNames(chainName, specName, (c, s) => {
|
|
61
|
-
var _knownTypes$typesBund7, _knownTypes$typesBund8, _knownTypes$typesBund9, _knownTypes$typesBund10, _knownTypes$typesBund11, _knownTypes$typesBund12, _knownTypes$typesSpec, _knownTypes$typesChai;
|
|
62
|
-
|
|
63
|
-
return (// The order here is always, based on -
|
|
64
|
-
// - spec then chain
|
|
65
|
-
// - typesBundle takes higher precedence
|
|
66
|
-
// - types is the final catch-all override
|
|
67
|
-
objectSpread({}, filterVersions(typesSpec[s], _specVersion), filterVersions(typesChain[c], _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[s]) === 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[c]) === null || _knownTypes$typesBund12 === void 0 ? void 0 : _knownTypes$typesBund12.types, _specVersion), (_knownTypes$typesSpec = knownTypes.typesSpec) === null || _knownTypes$typesSpec === void 0 ? void 0 : _knownTypes$typesSpec[s], (_knownTypes$typesChai = knownTypes.typesChain) === null || _knownTypes$typesChai === void 0 ? void 0 : _knownTypes$typesChai[c], knownTypes.types)
|
|
68
|
-
);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
export function getSpecHasher({
|
|
72
|
-
knownTypes
|
|
73
|
-
}, chainName, specName) {
|
|
74
|
-
return withNames(chainName, specName, (c, s) => {
|
|
75
|
-
var _knownTypes$typesBund13, _knownTypes$typesBund14, _knownTypes$typesBund15, _knownTypes$typesBund16, _knownTypes$typesBund17, _knownTypes$typesBund18;
|
|
76
|
-
|
|
77
|
-
return knownTypes.hasher || ((_knownTypes$typesBund13 = knownTypes.typesBundle) === null || _knownTypes$typesBund13 === void 0 ? void 0 : (_knownTypes$typesBund14 = _knownTypes$typesBund13.chain) === null || _knownTypes$typesBund14 === void 0 ? void 0 : (_knownTypes$typesBund15 = _knownTypes$typesBund14[c]) === null || _knownTypes$typesBund15 === void 0 ? void 0 : _knownTypes$typesBund15.hasher) || ((_knownTypes$typesBund16 = knownTypes.typesBundle) === null || _knownTypes$typesBund16 === void 0 ? void 0 : (_knownTypes$typesBund17 = _knownTypes$typesBund16.spec) === null || _knownTypes$typesBund17 === void 0 ? void 0 : (_knownTypes$typesBund18 = _knownTypes$typesBund17[s]) === null || _knownTypes$typesBund18 === void 0 ? void 0 : _knownTypes$typesBund18.hasher) || null;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* @description Based on the chain and runtimeVersion, get the applicable rpc definitions (ready for registration)
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
export function getSpecRpc({
|
|
85
|
-
knownTypes
|
|
86
|
-
}, chainName, specName) {
|
|
87
|
-
return withNames(chainName, specName, (c, s) => {
|
|
88
|
-
var _knownTypes$typesBund19, _knownTypes$typesBund20, _knownTypes$typesBund21, _knownTypes$typesBund22, _knownTypes$typesBund23, _knownTypes$typesBund24;
|
|
89
|
-
|
|
90
|
-
return objectSpread({}, (_knownTypes$typesBund19 = knownTypes.typesBundle) === null || _knownTypes$typesBund19 === void 0 ? void 0 : (_knownTypes$typesBund20 = _knownTypes$typesBund19.spec) === null || _knownTypes$typesBund20 === void 0 ? void 0 : (_knownTypes$typesBund21 = _knownTypes$typesBund20[s]) === null || _knownTypes$typesBund21 === void 0 ? void 0 : _knownTypes$typesBund21.rpc, (_knownTypes$typesBund22 = knownTypes.typesBundle) === null || _knownTypes$typesBund22 === void 0 ? void 0 : (_knownTypes$typesBund23 = _knownTypes$typesBund22.chain) === null || _knownTypes$typesBund23 === void 0 ? void 0 : (_knownTypes$typesBund24 = _knownTypes$typesBund23[c]) === null || _knownTypes$typesBund24 === void 0 ? void 0 : _knownTypes$typesBund24.rpc);
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* @description Based on the chain and runtimeVersion, get the applicable alias definitions (ready for registration)
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
|
-
export function getSpecAlias({
|
|
98
|
-
knownTypes
|
|
99
|
-
}, chainName, specName) {
|
|
100
|
-
return withNames(chainName, specName, (c, s) => {
|
|
101
|
-
var _knownTypes$typesBund25, _knownTypes$typesBund26, _knownTypes$typesBund27, _knownTypes$typesBund28, _knownTypes$typesBund29, _knownTypes$typesBund30;
|
|
102
|
-
|
|
103
|
-
return (// as per versions, first spec, then chain then finally non-versioned
|
|
104
|
-
objectSpread({}, (_knownTypes$typesBund25 = knownTypes.typesBundle) === null || _knownTypes$typesBund25 === void 0 ? void 0 : (_knownTypes$typesBund26 = _knownTypes$typesBund25.spec) === null || _knownTypes$typesBund26 === void 0 ? void 0 : (_knownTypes$typesBund27 = _knownTypes$typesBund26[s]) === null || _knownTypes$typesBund27 === void 0 ? void 0 : _knownTypes$typesBund27.alias, (_knownTypes$typesBund28 = knownTypes.typesBundle) === null || _knownTypes$typesBund28 === void 0 ? void 0 : (_knownTypes$typesBund29 = _knownTypes$typesBund28.chain) === null || _knownTypes$typesBund29 === void 0 ? void 0 : (_knownTypes$typesBund30 = _knownTypes$typesBund29[c]) === null || _knownTypes$typesBund30 === void 0 ? void 0 : _knownTypes$typesBund30.alias, knownTypes.typesAlias)
|
|
105
|
-
);
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* @description Returns a version record for known chains where upgrades are being tracked
|
|
110
|
-
*/
|
|
111
|
-
|
|
112
|
-
export function getUpgradeVersion(genesisHash, blockNumber) {
|
|
113
|
-
const known = upgrades.find(u => genesisHash.eq(u.genesisHash));
|
|
114
|
-
return known ? [known.versions.reduce((last, version) => {
|
|
115
|
-
return blockNumber.gt(version.blockNumber) ? version : last;
|
|
116
|
-
}, undefined), known.versions.find(version => blockNumber.lte(version.blockNumber))] : [undefined, undefined];
|
|
117
|
-
}
|
|
3
|
+
export { getSpecAlias, getSpecExtensions, getSpecHasher, getSpecRpc, getSpecTypes, getUpgradeVersion } from '@polkadot/types';
|
|
4
|
+
export { packageInfo } from "./packageInfo.js";
|
package/package.json
CHANGED
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"./detectPackage.cjs"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"version": "6.12.
|
|
23
|
+
"version": "6.12.2-3",
|
|
24
24
|
"main": "index.js",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@babel/runtime": "^7.16.
|
|
26
|
+
"@babel/runtime": "^7.16.5",
|
|
27
27
|
"@polkadot/networks": "^8.1.2",
|
|
28
|
-
"@polkadot/types": "6.12.
|
|
28
|
+
"@polkadot/types": "6.12.2-3",
|
|
29
29
|
"@polkadot/util": "^8.1.2"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
@@ -38,113 +38,18 @@
|
|
|
38
38
|
"default": "./bundle.js"
|
|
39
39
|
},
|
|
40
40
|
"./bundle.d.ts": "./bundle.d.ts",
|
|
41
|
-
"./chain": {
|
|
42
|
-
"require": "./chain/index.cjs",
|
|
43
|
-
"default": "./chain/index.js"
|
|
44
|
-
},
|
|
45
|
-
"./chain/index.d.ts": "./chain/index.d.ts",
|
|
46
41
|
"./detectPackage": {
|
|
47
42
|
"require": "./detectPackage.cjs",
|
|
48
43
|
"default": "./detectPackage.js"
|
|
49
44
|
},
|
|
50
45
|
"./detectPackage.d.ts": "./detectPackage.d.ts",
|
|
51
46
|
"./index.d.ts": "./index.d.ts",
|
|
52
|
-
"./knownOrigins": {
|
|
53
|
-
"require": "./knownOrigins.cjs",
|
|
54
|
-
"default": "./knownOrigins.js"
|
|
55
|
-
},
|
|
56
|
-
"./knownOrigins.d.ts": "./knownOrigins.d.ts",
|
|
57
|
-
"./modules": {
|
|
58
|
-
"require": "./modules.cjs",
|
|
59
|
-
"default": "./modules.js"
|
|
60
|
-
},
|
|
61
|
-
"./modules.d.ts": "./modules.d.ts",
|
|
62
47
|
"./package.json": "./package.json",
|
|
63
48
|
"./packageInfo": {
|
|
64
49
|
"require": "./packageInfo.cjs",
|
|
65
50
|
"default": "./packageInfo.js"
|
|
66
51
|
},
|
|
67
52
|
"./packageInfo.d.ts": "./packageInfo.d.ts",
|
|
68
|
-
"./README.md": "./README.md"
|
|
69
|
-
"./spec": {
|
|
70
|
-
"require": "./spec/index.cjs",
|
|
71
|
-
"default": "./spec/index.js"
|
|
72
|
-
},
|
|
73
|
-
"./spec/centrifuge-chain": {
|
|
74
|
-
"require": "./spec/centrifuge-chain.cjs",
|
|
75
|
-
"default": "./spec/centrifuge-chain.js"
|
|
76
|
-
},
|
|
77
|
-
"./spec/centrifuge-chain.d.ts": "./spec/centrifuge-chain.d.ts",
|
|
78
|
-
"./spec/index.d.ts": "./spec/index.d.ts",
|
|
79
|
-
"./spec/kusama": {
|
|
80
|
-
"require": "./spec/kusama.cjs",
|
|
81
|
-
"default": "./spec/kusama.js"
|
|
82
|
-
},
|
|
83
|
-
"./spec/kusama.d.ts": "./spec/kusama.d.ts",
|
|
84
|
-
"./spec/node": {
|
|
85
|
-
"require": "./spec/node.cjs",
|
|
86
|
-
"default": "./spec/node.js"
|
|
87
|
-
},
|
|
88
|
-
"./spec/node-template": {
|
|
89
|
-
"require": "./spec/node-template.cjs",
|
|
90
|
-
"default": "./spec/node-template.js"
|
|
91
|
-
},
|
|
92
|
-
"./spec/node-template.d.ts": "./spec/node-template.d.ts",
|
|
93
|
-
"./spec/node.d.ts": "./spec/node.d.ts",
|
|
94
|
-
"./spec/polkadot": {
|
|
95
|
-
"require": "./spec/polkadot.cjs",
|
|
96
|
-
"default": "./spec/polkadot.js"
|
|
97
|
-
},
|
|
98
|
-
"./spec/polkadot.d.ts": "./spec/polkadot.d.ts",
|
|
99
|
-
"./spec/rococo": {
|
|
100
|
-
"require": "./spec/rococo.cjs",
|
|
101
|
-
"default": "./spec/rococo.js"
|
|
102
|
-
},
|
|
103
|
-
"./spec/rococo.d.ts": "./spec/rococo.d.ts",
|
|
104
|
-
"./spec/shell": {
|
|
105
|
-
"require": "./spec/shell.cjs",
|
|
106
|
-
"default": "./spec/shell.js"
|
|
107
|
-
},
|
|
108
|
-
"./spec/shell.d.ts": "./spec/shell.d.ts",
|
|
109
|
-
"./spec/statemint": {
|
|
110
|
-
"require": "./spec/statemint.cjs",
|
|
111
|
-
"default": "./spec/statemint.js"
|
|
112
|
-
},
|
|
113
|
-
"./spec/statemint.d.ts": "./spec/statemint.d.ts",
|
|
114
|
-
"./spec/westend": {
|
|
115
|
-
"require": "./spec/westend.cjs",
|
|
116
|
-
"default": "./spec/westend.js"
|
|
117
|
-
},
|
|
118
|
-
"./spec/westend.d.ts": "./spec/westend.d.ts",
|
|
119
|
-
"./upgrades": {
|
|
120
|
-
"require": "./upgrades/index.cjs",
|
|
121
|
-
"default": "./upgrades/index.js"
|
|
122
|
-
},
|
|
123
|
-
"./upgrades/index.d.ts": "./upgrades/index.d.ts",
|
|
124
|
-
"./upgrades/kusama": {
|
|
125
|
-
"require": "./upgrades/kusama.cjs",
|
|
126
|
-
"default": "./upgrades/kusama.js"
|
|
127
|
-
},
|
|
128
|
-
"./upgrades/kusama.d.ts": "./upgrades/kusama.d.ts",
|
|
129
|
-
"./upgrades/polkadot": {
|
|
130
|
-
"require": "./upgrades/polkadot.cjs",
|
|
131
|
-
"default": "./upgrades/polkadot.js"
|
|
132
|
-
},
|
|
133
|
-
"./upgrades/polkadot.d.ts": "./upgrades/polkadot.d.ts",
|
|
134
|
-
"./upgrades/types": {
|
|
135
|
-
"require": "./upgrades/types.cjs",
|
|
136
|
-
"default": "./upgrades/types.js"
|
|
137
|
-
},
|
|
138
|
-
"./upgrades/types.d.ts": "./upgrades/types.d.ts",
|
|
139
|
-
"./upgrades/westend": {
|
|
140
|
-
"require": "./upgrades/westend.cjs",
|
|
141
|
-
"default": "./upgrades/westend.js"
|
|
142
|
-
},
|
|
143
|
-
"./upgrades/westend.d.ts": "./upgrades/westend.d.ts",
|
|
144
|
-
"./xcm": {
|
|
145
|
-
"require": "./xcm.cjs",
|
|
146
|
-
"default": "./xcm.js"
|
|
147
|
-
},
|
|
148
|
-
"./xcm.d.ts": "./xcm.d.ts"
|
|
53
|
+
"./README.md": "./README.md"
|
|
149
54
|
}
|
|
150
55
|
}
|
package/packageInfo.cjs
CHANGED
package/packageInfo.js
CHANGED
package/chain/index.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
// Copyright 2017-2021 @polkadot/types-known authors & contributors
|
|
8
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
-
// Type overrides based on specific nodes
|
|
10
|
-
const typesChain = {};
|
|
11
|
-
var _default = typesChain;
|
|
12
|
-
exports.default = _default;
|
package/chain/index.d.ts
DELETED
package/chain/index.js
DELETED
package/knownOrigins.cjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.knownOrigins = void 0;
|
|
7
|
-
// Copyright 2017-2021 @polkadot/types authors & contributors
|
|
8
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
-
// We want predictive ordering (manually managed)
|
|
10
|
-
|
|
11
|
-
/* eslint-disable sort-keys */
|
|
12
|
-
// Since we don't have insight into the origin specification, we can only define what we know about
|
|
13
|
-
// in a pure Substrate/Polkadot implementation, any other custom origins won't be handled at all
|
|
14
|
-
const knownOrigins = {
|
|
15
|
-
//
|
|
16
|
-
// (1) Defaults from Substrate
|
|
17
|
-
//
|
|
18
|
-
Council: 'CollectiveOrigin',
|
|
19
|
-
System: 'SystemOrigin',
|
|
20
|
-
TechnicalCommittee: 'CollectiveOrigin',
|
|
21
|
-
//
|
|
22
|
-
// (2) Defaults from Polkadot
|
|
23
|
-
//
|
|
24
|
-
Xcm: 'XcmOrigin',
|
|
25
|
-
XcmPallet: 'XcmOrigin',
|
|
26
|
-
//
|
|
27
|
-
// (3) Defaults from Acala
|
|
28
|
-
//
|
|
29
|
-
Authority: 'AuthorityOrigin',
|
|
30
|
-
GeneralCouncil: 'CollectiveOrigin'
|
|
31
|
-
};
|
|
32
|
-
exports.knownOrigins = knownOrigins;
|
package/knownOrigins.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const knownOrigins: Record<string, string>;
|
package/knownOrigins.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Copyright 2017-2021 @polkadot/types authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
// We want predictive ordering (manually managed)
|
|
4
|
-
|
|
5
|
-
/* eslint-disable sort-keys */
|
|
6
|
-
// Since we don't have insight into the origin specification, we can only define what we know about
|
|
7
|
-
// in a pure Substrate/Polkadot implementation, any other custom origins won't be handled at all
|
|
8
|
-
export const knownOrigins = {
|
|
9
|
-
//
|
|
10
|
-
// (1) Defaults from Substrate
|
|
11
|
-
//
|
|
12
|
-
Council: 'CollectiveOrigin',
|
|
13
|
-
System: 'SystemOrigin',
|
|
14
|
-
TechnicalCommittee: 'CollectiveOrigin',
|
|
15
|
-
//
|
|
16
|
-
// (2) Defaults from Polkadot
|
|
17
|
-
//
|
|
18
|
-
Xcm: 'XcmOrigin',
|
|
19
|
-
XcmPallet: 'XcmOrigin',
|
|
20
|
-
//
|
|
21
|
-
// (3) Defaults from Acala
|
|
22
|
-
//
|
|
23
|
-
Authority: 'AuthorityOrigin',
|
|
24
|
-
GeneralCouncil: 'CollectiveOrigin'
|
|
25
|
-
};
|