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