@polkadot/types-known 10.4.1 → 10.6.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.
Files changed (65) hide show
  1. package/chain/index.d.ts +1 -2
  2. package/chain/index.js +1 -2
  3. package/cjs/chain/index.js +2 -2
  4. package/cjs/packageInfo.js +1 -1
  5. package/cjs/spec/centrifuge-chain.js +10 -9
  6. package/cjs/spec/index.js +22 -23
  7. package/cjs/spec/kusama.js +72 -31
  8. package/cjs/spec/node-template.js +2 -2
  9. package/cjs/spec/node.js +2 -2
  10. package/cjs/spec/polkadot.js +24 -13
  11. package/cjs/spec/rococo.js +19 -11
  12. package/cjs/spec/shell.js +2 -2
  13. package/cjs/spec/statemint.js +12 -9
  14. package/cjs/spec/westend.js +33 -16
  15. package/cjs/upgrades/e2e/index.js +3 -6
  16. package/cjs/upgrades/e2e/kusama.js +2 -2
  17. package/cjs/upgrades/e2e/polkadot.js +2 -2
  18. package/cjs/upgrades/e2e/westend.js +2 -2
  19. package/cjs/upgrades/index.js +2 -2
  20. package/cjs/upgrades/manual/index.js +3 -6
  21. package/cjs/upgrades/manual/kusama.js +2 -2
  22. package/cjs/upgrades/manual/polkadot.js +2 -2
  23. package/cjs/upgrades/manual/westend.js +2 -2
  24. package/cjs/util.js +36 -18
  25. package/package.json +6 -6
  26. package/packageInfo.js +1 -1
  27. package/spec/centrifuge-chain.d.ts +1 -2
  28. package/spec/centrifuge-chain.js +9 -9
  29. package/spec/index.d.ts +1 -2
  30. package/spec/index.js +10 -11
  31. package/spec/kusama.d.ts +1 -2
  32. package/spec/kusama.js +71 -31
  33. package/spec/node-template.d.ts +1 -2
  34. package/spec/node-template.js +1 -2
  35. package/spec/node.d.ts +1 -2
  36. package/spec/node.js +1 -2
  37. package/spec/polkadot.d.ts +1 -2
  38. package/spec/polkadot.js +23 -13
  39. package/spec/rococo.d.ts +1 -2
  40. package/spec/rococo.js +18 -11
  41. package/spec/shell.d.ts +1 -2
  42. package/spec/shell.js +1 -2
  43. package/spec/statemint.d.ts +1 -2
  44. package/spec/statemint.js +11 -9
  45. package/spec/westend.d.ts +1 -2
  46. package/spec/westend.js +32 -16
  47. package/upgrades/e2e/index.d.ts +3 -3
  48. package/upgrades/e2e/index.js +3 -3
  49. package/upgrades/e2e/kusama.d.ts +1 -2
  50. package/upgrades/e2e/kusama.js +1 -2
  51. package/upgrades/e2e/polkadot.d.ts +1 -2
  52. package/upgrades/e2e/polkadot.js +1 -2
  53. package/upgrades/e2e/westend.d.ts +1 -2
  54. package/upgrades/e2e/westend.js +1 -2
  55. package/upgrades/index.d.ts +1 -2
  56. package/upgrades/index.js +1 -2
  57. package/upgrades/manual/index.d.ts +3 -3
  58. package/upgrades/manual/index.js +3 -3
  59. package/upgrades/manual/kusama.d.ts +1 -2
  60. package/upgrades/manual/kusama.js +1 -2
  61. package/upgrades/manual/polkadot.d.ts +1 -2
  62. package/upgrades/manual/polkadot.js +1 -2
  63. package/upgrades/manual/westend.d.ts +1 -2
  64. package/upgrades/manual/westend.js +1 -2
  65. package/util.js +36 -17
package/upgrades/index.js CHANGED
@@ -22,5 +22,4 @@ function mapRaw([network, versions]) {
22
22
  }))
23
23
  };
24
24
  }
25
- const upgrades = Object.entries(allKnown).map(mapRaw);
26
- export default upgrades;
25
+ export const upgrades = Object.entries(allKnown).map(mapRaw);
@@ -1,3 +1,3 @@
1
- export { default as kusama } from './kusama.js';
2
- export { default as polkadot } from './polkadot.js';
3
- export { default as westend } from './westend.js';
1
+ export { upgrades as kusama } from './kusama.js';
2
+ export { upgrades as polkadot } from './polkadot.js';
3
+ export { upgrades as westend } from './westend.js';
@@ -1,3 +1,3 @@
1
- export { default as kusama } from './kusama.js';
2
- export { default as polkadot } from './polkadot.js';
3
- export { default as westend } from './westend.js';
1
+ export { upgrades as kusama } from './kusama.js';
2
+ export { upgrades as polkadot } from './polkadot.js';
3
+ export { upgrades as westend } from './westend.js';
@@ -1,3 +1,2 @@
1
1
  import type { ChainUpgradesRaw } from '../types.js';
2
- declare const upgrades: ChainUpgradesRaw;
3
- export default upgrades;
2
+ export declare const upgrades: ChainUpgradesRaw;
@@ -1,4 +1,4 @@
1
- const upgrades = [
1
+ export const upgrades = [
2
2
  [0, 1020], [26669, 1021], [38245, 1022], [54248, 1023], [59659, 1024],
3
3
  [67651, 1025], [82191, 1027], [83238, 1028], [101503, 1029], [203466, 1030],
4
4
  [295787, 1031], [461692, 1032], [504329, 1033], [569327, 1038], [587687, 1039],
@@ -16,4 +16,3 @@ const upgrades = [
16
16
  // we have 9340 via system.setStorage (whitelist.WhitelistedCallDispatched event)
17
17
  [15680713, 9340], [15756296, 9350]
18
18
  ];
19
- export default upgrades;
@@ -1,3 +1,2 @@
1
1
  import type { ChainUpgradesRaw } from '../types.js';
2
- declare const upgrades: ChainUpgradesRaw;
3
- export default upgrades;
2
+ export declare const upgrades: ChainUpgradesRaw;
@@ -1,4 +1,4 @@
1
- const upgrades = [
1
+ export const upgrades = [
2
2
  [0, 0], [29231, 1], [188836, 5], [199405, 6], [214264, 7],
3
3
  [244358, 8], [303079, 9], [314201, 10], [342400, 11], [443963, 12],
4
4
  [528470, 13], [687751, 14], [746085, 15], [787923, 16], [799302, 17],
@@ -9,4 +9,3 @@ const upgrades = [
9
9
  [10458576, 9200], [10655116, 9220], [10879371, 9230], [11328884, 9250], [11532856, 9260],
10
10
  [11933818, 9270], [12217535, 9280], [12245277, 9281], [12532644, 9291], [12876189, 9300]
11
11
  ];
12
- export default upgrades;
@@ -1,3 +1,2 @@
1
1
  import type { ChainUpgradesRaw } from '../types.js';
2
- declare const upgrades: ChainUpgradesRaw;
3
- export default upgrades;
2
+ export declare const upgrades: ChainUpgradesRaw;
@@ -1,4 +1,4 @@
1
- const upgrades = [
1
+ export const upgrades = [
2
2
  [214356, 4], [392764, 7], [409740, 8], [809976, 20], [877581, 24],
3
3
  [879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29],
4
4
  [1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
@@ -14,4 +14,3 @@ const upgrades = [
14
14
  [12604343, 9290], [12841034, 9300], [13128237, 9310], [13272363, 9320], [13483497, 9330],
15
15
  [13649433, 9340], [13761100, 9350]
16
16
  ];
17
- export default upgrades;
package/util.js CHANGED
@@ -1,7 +1,7 @@
1
- import { bnToBn, objectSpread } from '@polkadot/util';
2
- import typesChain from './chain/index.js';
3
- import typesSpec from './spec/index.js';
4
- import upgrades from './upgrades/index.js';
1
+ import { bnToBn } from '@polkadot/util';
2
+ import { typesChain } from './chain/index.js';
3
+ import { typesSpec } from './spec/index.js';
4
+ import { upgrades } from './upgrades/index.js';
5
5
  /**
6
6
  * @description Perform the callback function using the stringified spec/chain
7
7
  * @internal
@@ -17,25 +17,35 @@ function filterVersions(versions = [], specVersion) {
17
17
  return versions
18
18
  .filter(({ minmax: [min, max] }) => (min === undefined || min === null || specVersion >= min) &&
19
19
  (max === undefined || max === null || specVersion <= max))
20
- .reduce((result, { types }) => objectSpread(result, types), {});
20
+ .reduce((result, { types }) => ({ ...result, ...types }), {});
21
21
  }
22
22
  /**
23
23
  * @description Based on the chain and runtimeVersion, get the applicable signed extensions (ready for registration)
24
24
  */
25
25
  export function getSpecExtensions({ knownTypes }, chainName, specName) {
26
- return withNames(chainName, specName, (c, s) => objectSpread({}, knownTypes.typesBundle?.spec?.[s]?.signedExtensions, knownTypes.typesBundle?.chain?.[c]?.signedExtensions));
26
+ return withNames(chainName, specName, (c, s) => ({
27
+ ...(knownTypes.typesBundle?.spec?.[s]?.signedExtensions ?? {}),
28
+ ...(knownTypes.typesBundle?.chain?.[c]?.signedExtensions ?? {})
29
+ }));
27
30
  }
28
31
  /**
29
32
  * @description Based on the chain and runtimeVersion, get the applicable types (ready for registration)
30
33
  */
31
34
  export function getSpecTypes({ knownTypes }, chainName, specName, specVersion) {
32
35
  const _specVersion = bnToBn(specVersion).toNumber();
33
- return withNames(chainName, specName, (c, s) =>
34
- // The order here is always, based on -
35
- // - spec then chain
36
- // - typesBundle takes higher precedence
37
- // - types is the final catch-all override
38
- objectSpread({}, filterVersions(typesSpec[s], _specVersion), filterVersions(typesChain[c], _specVersion), filterVersions(knownTypes.typesBundle?.spec?.[s]?.types, _specVersion), filterVersions(knownTypes.typesBundle?.chain?.[c]?.types, _specVersion), knownTypes.typesSpec?.[s], knownTypes.typesChain?.[c], knownTypes.types));
36
+ return withNames(chainName, specName, (c, s) => ({
37
+ // The order here is always, based on -
38
+ // - spec then chain
39
+ // - typesBundle takes higher precedence
40
+ // - types is the final catch-all override
41
+ ...filterVersions(typesSpec[s], _specVersion),
42
+ ...filterVersions(typesChain[c], _specVersion),
43
+ ...filterVersions(knownTypes.typesBundle?.spec?.[s]?.types, _specVersion),
44
+ ...filterVersions(knownTypes.typesBundle?.chain?.[c]?.types, _specVersion),
45
+ ...(knownTypes.typesSpec?.[s] ?? {}),
46
+ ...(knownTypes.typesChain?.[c] ?? {}),
47
+ ...(knownTypes.types ?? {})
48
+ }));
39
49
  }
40
50
  /**
41
51
  * @description Based on the chain or spec, return the hasher used
@@ -50,21 +60,30 @@ export function getSpecHasher({ knownTypes }, chainName, specName) {
50
60
  * @description Based on the chain and runtimeVersion, get the applicable rpc definitions (ready for registration)
51
61
  */
52
62
  export function getSpecRpc({ knownTypes }, chainName, specName) {
53
- return withNames(chainName, specName, (c, s) => objectSpread({}, knownTypes.typesBundle?.spec?.[s]?.rpc, knownTypes.typesBundle?.chain?.[c]?.rpc));
63
+ return withNames(chainName, specName, (c, s) => ({
64
+ ...(knownTypes.typesBundle?.spec?.[s]?.rpc ?? {}),
65
+ ...(knownTypes.typesBundle?.chain?.[c]?.rpc ?? {})
66
+ }));
54
67
  }
55
68
  /**
56
69
  * @description Based on the chain and runtimeVersion, get the applicable runtime definitions (ready for registration)
57
70
  */
58
71
  export function getSpecRuntime({ knownTypes }, chainName, specName) {
59
- return withNames(chainName, specName, (c, s) => objectSpread({}, knownTypes.typesBundle?.spec?.[s]?.runtime, knownTypes.typesBundle?.chain?.[c]?.runtime));
72
+ return withNames(chainName, specName, (c, s) => ({
73
+ ...(knownTypes.typesBundle?.spec?.[s]?.runtime ?? {}),
74
+ ...(knownTypes.typesBundle?.chain?.[c]?.runtime ?? {})
75
+ }));
60
76
  }
61
77
  /**
62
78
  * @description Based on the chain and runtimeVersion, get the applicable alias definitions (ready for registration)
63
79
  */
64
80
  export function getSpecAlias({ knownTypes }, chainName, specName) {
65
- return withNames(chainName, specName, (c, s) =>
66
- // as per versions, first spec, then chain then finally non-versioned
67
- objectSpread({}, knownTypes.typesBundle?.spec?.[s]?.alias, knownTypes.typesBundle?.chain?.[c]?.alias, knownTypes.typesAlias));
81
+ return withNames(chainName, specName, (c, s) => ({
82
+ // as per versions, first spec, then chain then finally non-versioned
83
+ ...(knownTypes.typesBundle?.spec?.[s]?.alias ?? {}),
84
+ ...(knownTypes.typesBundle?.chain?.[c]?.alias ?? {}),
85
+ ...(knownTypes.typesAlias ?? {})
86
+ }));
68
87
  }
69
88
  /**
70
89
  * @description Returns a version record for known chains where upgrades are being tracked