@pezkuwi/types-known 16.5.5

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 (64) hide show
  1. package/README.md +3 -0
  2. package/build/bundle.d.ts +3 -0
  3. package/build/chain/index.d.ts +2 -0
  4. package/build/index.d.ts +2 -0
  5. package/build/packageDetect.d.ts +1 -0
  6. package/build/packageInfo.d.ts +6 -0
  7. package/build/spec/centrifuge-chain.d.ts +2 -0
  8. package/build/spec/index.d.ts +2 -0
  9. package/build/spec/kusama.d.ts +2 -0
  10. package/build/spec/node-template.d.ts +2 -0
  11. package/build/spec/node.d.ts +2 -0
  12. package/build/spec/polkadot.d.ts +2 -0
  13. package/build/spec/rococo.d.ts +2 -0
  14. package/build/spec/shell.d.ts +2 -0
  15. package/build/spec/statemine.d.ts +2 -0
  16. package/build/spec/statemint.d.ts +2 -0
  17. package/build/spec/westend.d.ts +2 -0
  18. package/build/spec/westmint.d.ts +2 -0
  19. package/build/upgrades/e2e/index.d.ts +3 -0
  20. package/build/upgrades/e2e/kusama.d.ts +2 -0
  21. package/build/upgrades/e2e/polkadot.d.ts +2 -0
  22. package/build/upgrades/e2e/westend.d.ts +2 -0
  23. package/build/upgrades/index.d.ts +2 -0
  24. package/build/upgrades/manual/index.d.ts +3 -0
  25. package/build/upgrades/manual/kusama.d.ts +2 -0
  26. package/build/upgrades/manual/polkadot.d.ts +2 -0
  27. package/build/upgrades/manual/westend.d.ts +2 -0
  28. package/build/upgrades/types.d.ts +3 -0
  29. package/build/util.d.ts +33 -0
  30. package/package.json +34 -0
  31. package/src/bundle.ts +11 -0
  32. package/src/chain/index.ts +7 -0
  33. package/src/index.ts +6 -0
  34. package/src/mod.ts +4 -0
  35. package/src/packageDetect.ts +12 -0
  36. package/src/packageInfo.ts +6 -0
  37. package/src/spec/centrifuge-chain.ts +116 -0
  38. package/src/spec/index.ts +31 -0
  39. package/src/spec/kusama.ts +258 -0
  40. package/src/spec/node-template.ts +17 -0
  41. package/src/spec/node.ts +17 -0
  42. package/src/spec/polkadot.ts +112 -0
  43. package/src/spec/rococo.ts +73 -0
  44. package/src/spec/shell.ts +15 -0
  45. package/src/spec/statemine.ts +62 -0
  46. package/src/spec/statemint.ts +74 -0
  47. package/src/spec/westend.ts +125 -0
  48. package/src/spec/westmint.ts +62 -0
  49. package/src/upgrades/e2e/index.spec.ts +67 -0
  50. package/src/upgrades/e2e/index.ts +6 -0
  51. package/src/upgrades/e2e/kusama.ts +5372 -0
  52. package/src/upgrades/e2e/polkadot.ts +3712 -0
  53. package/src/upgrades/e2e/westend.ts +6434 -0
  54. package/src/upgrades/index.spec.ts +118 -0
  55. package/src/upgrades/index.ts +40 -0
  56. package/src/upgrades/manual/index.ts +6 -0
  57. package/src/upgrades/manual/kusama.ts +26 -0
  58. package/src/upgrades/manual/polkadot.ts +19 -0
  59. package/src/upgrades/manual/westend.ts +27 -0
  60. package/src/upgrades/types.ts +8 -0
  61. package/src/util.ts +128 -0
  62. package/tsconfig.build.json +17 -0
  63. package/tsconfig.build.tsbuildinfo +1 -0
  64. package/tsconfig.spec.json +19 -0
@@ -0,0 +1,17 @@
1
+ // Copyright 2017-2025 @polkadot/types-known authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /* eslint-disable sort-keys */
5
+
6
+ import type { OverrideVersionedType } from '@pezkuwi/types/types';
7
+
8
+ export const versioned: OverrideVersionedType[] = [
9
+ {
10
+ minmax: [0, undefined],
11
+ types: {
12
+ // nothing, API tracks master
13
+ // (v2 weights are not yet the default)
14
+ Weight: 'WeightV2'
15
+ }
16
+ }
17
+ ];
@@ -0,0 +1,17 @@
1
+ // Copyright 2017-2025 @polkadot/types-known authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /* eslint-disable sort-keys */
5
+
6
+ import type { OverrideVersionedType } from '@pezkuwi/types/types';
7
+
8
+ export const versioned: OverrideVersionedType[] = [
9
+ {
10
+ minmax: [0, undefined],
11
+ types: {
12
+ // nothing, API tracks master
13
+ // (v2 weights are not yet the default)
14
+ Weight: 'WeightV2'
15
+ }
16
+ }
17
+ ];
@@ -0,0 +1,112 @@
1
+ // Copyright 2017-2025 @polkadot/types-known authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /* eslint-disable sort-keys */
5
+
6
+ import type { OverrideVersionedType } from '@pezkuwi/types/types';
7
+
8
+ const sharedTypes = {
9
+ CompactAssignments: 'CompactAssignmentsWith16',
10
+ DispatchErrorModule: 'DispatchErrorModuleU8',
11
+ RawSolution: 'RawSolutionWith16',
12
+ Keys: 'SessionKeys6',
13
+ ProxyType: {
14
+ _enum: {
15
+ Any: 0,
16
+ NonTransfer: 1,
17
+ Governance: 2,
18
+ Staking: 3,
19
+ UnusedSudoBalances: 4,
20
+ IdentityJudgement: 5,
21
+ CancelProxy: 6,
22
+ Auction: 7
23
+ }
24
+ },
25
+ Weight: 'WeightV1'
26
+ };
27
+
28
+ const addrAccountIdTypes = {
29
+ AccountInfo: 'AccountInfoWithRefCount',
30
+ Address: 'AccountId',
31
+ DispatchErrorModule: 'DispatchErrorModuleU8',
32
+ Keys: 'SessionKeys5',
33
+ LookupSource: 'AccountId',
34
+ ValidatorPrefs: 'ValidatorPrefsWithCommission'
35
+ };
36
+
37
+ // these are override types for Polkadot
38
+ export const versioned: OverrideVersionedType[] = [
39
+ {
40
+ minmax: [0, 10],
41
+ types: {
42
+ ...sharedTypes,
43
+ ...addrAccountIdTypes,
44
+ CompactAssignments: 'CompactAssignmentsTo257',
45
+ OpenTip: 'OpenTipTo225',
46
+ RefCount: 'RefCountTo259',
47
+ ElectionResult: 'ElectionResultToSpec10'
48
+ }
49
+ },
50
+ {
51
+ minmax: [11, 12],
52
+ types: {
53
+ ...sharedTypes,
54
+ ...addrAccountIdTypes,
55
+ CompactAssignments: 'CompactAssignmentsTo257',
56
+ OpenTip: 'OpenTipTo225',
57
+ RefCount: 'RefCountTo259'
58
+ }
59
+ },
60
+ {
61
+ minmax: [13, 22],
62
+ types: {
63
+ ...sharedTypes,
64
+ ...addrAccountIdTypes,
65
+ CompactAssignments: 'CompactAssignmentsTo257',
66
+ RefCount: 'RefCountTo259'
67
+ }
68
+ },
69
+ {
70
+ minmax: [23, 24],
71
+ types: {
72
+ ...sharedTypes,
73
+ ...addrAccountIdTypes,
74
+ RefCount: 'RefCountTo259'
75
+ }
76
+ },
77
+ {
78
+ minmax: [25, 27],
79
+ types: {
80
+ ...sharedTypes,
81
+ ...addrAccountIdTypes
82
+ }
83
+ },
84
+ {
85
+ minmax: [28, 29],
86
+ types: {
87
+ ...sharedTypes,
88
+ AccountInfo: 'AccountInfoWithDualRefCount'
89
+ }
90
+ },
91
+ {
92
+ minmax: [30, 9109],
93
+ types: {
94
+ ...sharedTypes
95
+ }
96
+ },
97
+ {
98
+ // metadata v14
99
+ minmax: [9110, undefined],
100
+ types: {
101
+ Weight: 'WeightV1'
102
+ }
103
+ }
104
+ // ,
105
+ // {
106
+ // // weight v2 introduction
107
+ // minmax: [9300, undefined],
108
+ // types: {
109
+ // Weight: 'WeightV2'
110
+ // }
111
+ // }
112
+ ];
@@ -0,0 +1,73 @@
1
+ // Copyright 2017-2025 @polkadot/types-known authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /* eslint-disable sort-keys */
5
+
6
+ import type { OverrideVersionedType } from '@pezkuwi/types/types';
7
+
8
+ import { mapXcmTypes } from '@pezkuwi/types-create';
9
+
10
+ // structs need to be in order
11
+ /* eslint-disable sort-keys */
12
+
13
+ const sharedTypes = {
14
+ DispatchErrorModule: 'DispatchErrorModuleU8',
15
+ FullIdentification: '()', // No staking, only session (as per config)
16
+ Keys: 'SessionKeys7B',
17
+ Weight: 'WeightV1'
18
+ };
19
+
20
+ export const versioned: OverrideVersionedType[] = [
21
+ {
22
+ minmax: [0, 200],
23
+ types: {
24
+ ...sharedTypes,
25
+ AccountInfo: 'AccountInfoWithDualRefCount',
26
+ Address: 'AccountId',
27
+ LookupSource: 'AccountId'
28
+ }
29
+ },
30
+ {
31
+ minmax: [201, 214],
32
+ types: {
33
+ ...sharedTypes,
34
+ AccountInfo: 'AccountInfoWithDualRefCount'
35
+ }
36
+ },
37
+ {
38
+ minmax: [215, 228],
39
+ types: {
40
+ ...sharedTypes,
41
+ Keys: 'SessionKeys6'
42
+ }
43
+ },
44
+ {
45
+ minmax: [229, 9099],
46
+ types: {
47
+ ...sharedTypes,
48
+ ...mapXcmTypes('V0')
49
+ }
50
+ },
51
+ {
52
+ minmax: [9100, 9105],
53
+ types: {
54
+ ...sharedTypes,
55
+ ...mapXcmTypes('V1')
56
+ }
57
+ },
58
+ {
59
+ // metadata v14
60
+ minmax: [9106, undefined],
61
+ types: {
62
+ Weight: 'WeightV1'
63
+ }
64
+ }
65
+ // ,
66
+ // {
67
+ // // weight v2 introduction
68
+ // minmax: [9300, undefined],
69
+ // types: {
70
+ // Weight: 'WeightV2'
71
+ // }
72
+ // }
73
+ ];
@@ -0,0 +1,15 @@
1
+ // Copyright 2017-2025 @polkadot/types-known authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /* eslint-disable sort-keys */
5
+
6
+ import type { OverrideVersionedType } from '@pezkuwi/types/types';
7
+
8
+ export const versioned: OverrideVersionedType[] = [
9
+ {
10
+ minmax: [0, undefined],
11
+ types: {
12
+ // nothing, limited runtime
13
+ }
14
+ }
15
+ ];
@@ -0,0 +1,62 @@
1
+ // Copyright 2017-2025 @polkadot/types-known authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /* eslint-disable sort-keys */
5
+
6
+ import type { OverrideVersionedType } from '@pezkuwi/types/types';
7
+
8
+ import { mapXcmTypes } from '@pezkuwi/types-create';
9
+
10
+ const sharedTypes = {
11
+ DispatchErrorModule: 'DispatchErrorModuleU8',
12
+ TAssetBalance: 'u128',
13
+ ProxyType: {
14
+ _enum: [
15
+ 'Any',
16
+ 'NonTransfer',
17
+ 'CancelProxy',
18
+ 'Assets',
19
+ 'AssetOwner',
20
+ 'AssetManager',
21
+ 'Staking'
22
+ ]
23
+ },
24
+ Weight: 'WeightV1'
25
+ };
26
+
27
+ // these are override types for Statemine, Westmint
28
+ export const versioned: OverrideVersionedType[] = [
29
+ {
30
+ minmax: [0, 3],
31
+ types: {
32
+ // Enum was modified mid-flight -
33
+ // https://github.com/paritytech/substrate/pull/10382/files#diff-e4e016b33a82268b6208dc974eea841bad47597865a749fee2f937eb6fdf67b4R498
34
+ DispatchError: 'DispatchErrorPre6First',
35
+ ...sharedTypes,
36
+ ...mapXcmTypes('V0')
37
+ }
38
+ },
39
+ {
40
+ minmax: [4, 5],
41
+ types: {
42
+ // As above, see https://github.com/polkadot-js/api/issues/5301
43
+ DispatchError: 'DispatchErrorPre6First',
44
+ ...sharedTypes,
45
+ ...mapXcmTypes('V1')
46
+ }
47
+ },
48
+ {
49
+ // metadata V14
50
+ minmax: [500, 9999],
51
+ types: {
52
+ Weight: 'WeightV1',
53
+ TAssetConversion: 'Option<AssetId>'
54
+ }
55
+ },
56
+ {
57
+ minmax: [10000, undefined],
58
+ types: {
59
+ Weight: 'WeightV1'
60
+ }
61
+ }
62
+ ];
@@ -0,0 +1,74 @@
1
+ // Copyright 2017-2025 @polkadot/types-known authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /* eslint-disable sort-keys */
5
+
6
+ import type { OverrideVersionedType } from '@pezkuwi/types/types';
7
+
8
+ import { mapXcmTypes } from '@pezkuwi/types-create';
9
+
10
+ const sharedTypes = {
11
+ DispatchErrorModule: 'DispatchErrorModuleU8',
12
+ TAssetBalance: 'u128',
13
+ ProxyType: {
14
+ _enum: [
15
+ 'Any',
16
+ 'NonTransfer',
17
+ 'CancelProxy',
18
+ 'Assets',
19
+ 'AssetOwner',
20
+ 'AssetManager',
21
+ 'Staking'
22
+ ]
23
+ },
24
+ Weight: 'WeightV1'
25
+ };
26
+
27
+ // these are override types for Statemine, Statemint, Westmint
28
+ export const versioned: OverrideVersionedType[] = [
29
+ {
30
+ minmax: [0, 3],
31
+ types: {
32
+ // Enum was modified mid-flight -
33
+ // https://github.com/paritytech/substrate/pull/10382/files#diff-e4e016b33a82268b6208dc974eea841bad47597865a749fee2f937eb6fdf67b4R498
34
+ DispatchError: 'DispatchErrorPre6First',
35
+ ...sharedTypes,
36
+ ...mapXcmTypes('V0')
37
+ }
38
+ },
39
+ {
40
+ minmax: [4, 5],
41
+ types: {
42
+ // As above, see https://github.com/polkadot-js/api/issues/5301
43
+ DispatchError: 'DispatchErrorPre6First',
44
+ ...sharedTypes,
45
+ ...mapXcmTypes('V1')
46
+ }
47
+ },
48
+ {
49
+ // metadata V14
50
+ minmax: [500, 1001003],
51
+ types: {
52
+ Weight: 'WeightV1',
53
+ TAssetConversion: 'Option<AssetId>'
54
+ }
55
+ },
56
+ // ref: https://github.com/polkadot-js/api/pull/6208
57
+ // The following patches an issue where polkadot asset hub block 9686187, can't be decoding using xcm v5
58
+ // mappings.
59
+ {
60
+ minmax: [1002000, undefined],
61
+ types: {
62
+ Weight: 'WeightV1',
63
+ ...mapXcmTypes('V4')
64
+ }
65
+ }
66
+ // ,
67
+ // {
68
+ // // weight v2 introduction
69
+ // minmax: [9300, undefined],
70
+ // types: {
71
+ // Weight: 'WeightV2'
72
+ // }
73
+ // }
74
+ ];
@@ -0,0 +1,125 @@
1
+ // Copyright 2017-2025 @polkadot/types-known authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /* eslint-disable sort-keys */
5
+
6
+ import type { OverrideVersionedType } from '@pezkuwi/types/types';
7
+
8
+ import { mapXcmTypes } from '@pezkuwi/types-create';
9
+
10
+ const sharedTypes = {
11
+ // 16 validators
12
+ CompactAssignments: 'CompactAssignmentsWith16',
13
+ DispatchErrorModule: 'DispatchErrorModuleU8',
14
+ RawSolution: 'RawSolutionWith16',
15
+ // general
16
+ Keys: 'SessionKeys6',
17
+ ProxyType: {
18
+ _enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances', 'IdentityJudgement', 'CancelProxy']
19
+ },
20
+ Weight: 'WeightV1'
21
+ };
22
+
23
+ const addrAccountIdTypes = {
24
+ AccountInfo: 'AccountInfoWithRefCount',
25
+ Address: 'AccountId',
26
+ CompactAssignments: 'CompactAssignmentsWith16',
27
+ DispatchErrorModule: 'DispatchErrorModuleU8',
28
+ LookupSource: 'AccountId',
29
+ Keys: 'SessionKeys5',
30
+ RawSolution: 'RawSolutionWith16',
31
+ ValidatorPrefs: 'ValidatorPrefsWithCommission'
32
+ };
33
+
34
+ export const versioned: OverrideVersionedType[] = [
35
+ {
36
+ minmax: [1, 2],
37
+ types: {
38
+ ...sharedTypes,
39
+ ...addrAccountIdTypes,
40
+ CompactAssignments: 'CompactAssignmentsTo257',
41
+ DispatchInfo: 'DispatchInfoTo244',
42
+ Heartbeat: 'HeartbeatTo244',
43
+ Multiplier: 'Fixed64',
44
+ OpenTip: 'OpenTipTo225',
45
+ RefCount: 'RefCountTo259',
46
+ Weight: 'u32'
47
+ }
48
+ },
49
+ {
50
+ minmax: [3, 22],
51
+ types: {
52
+ ...sharedTypes,
53
+ ...addrAccountIdTypes,
54
+ CompactAssignments: 'CompactAssignmentsTo257',
55
+ DispatchInfo: 'DispatchInfoTo244',
56
+ Heartbeat: 'HeartbeatTo244',
57
+ OpenTip: 'OpenTipTo225',
58
+ RefCount: 'RefCountTo259'
59
+ }
60
+ },
61
+ {
62
+ minmax: [23, 42],
63
+ types: {
64
+ ...sharedTypes,
65
+ ...addrAccountIdTypes,
66
+ CompactAssignments: 'CompactAssignmentsTo257',
67
+ DispatchInfo: 'DispatchInfoTo244',
68
+ Heartbeat: 'HeartbeatTo244',
69
+ RefCount: 'RefCountTo259'
70
+ }
71
+ },
72
+ {
73
+ minmax: [43, 44],
74
+ types: {
75
+ ...sharedTypes,
76
+ ...addrAccountIdTypes,
77
+ DispatchInfo: 'DispatchInfoTo244',
78
+ Heartbeat: 'HeartbeatTo244',
79
+ RefCount: 'RefCountTo259'
80
+ }
81
+ },
82
+ {
83
+ minmax: [45, 47],
84
+ types: {
85
+ ...sharedTypes,
86
+ ...addrAccountIdTypes
87
+ }
88
+ },
89
+ {
90
+ minmax: [48, 49],
91
+ types: {
92
+ ...sharedTypes,
93
+ AccountInfo: 'AccountInfoWithDualRefCount'
94
+ }
95
+ },
96
+ {
97
+ minmax: [50, 9099],
98
+ types: {
99
+ ...sharedTypes,
100
+ ...mapXcmTypes('V0')
101
+ }
102
+ },
103
+ {
104
+ minmax: [9100, 9105],
105
+ types: {
106
+ ...sharedTypes,
107
+ ...mapXcmTypes('V1')
108
+ }
109
+ },
110
+ {
111
+ // metadata v14
112
+ minmax: [9106, undefined],
113
+ types: {
114
+ Weight: 'WeightV1'
115
+ }
116
+ }
117
+ // ,
118
+ // {
119
+ // // weight v2 introduction
120
+ // minmax: [9300, undefined],
121
+ // types: {
122
+ // Weight: 'WeightV2'
123
+ // }
124
+ // }
125
+ ];
@@ -0,0 +1,62 @@
1
+ // Copyright 2017-2025 @polkadot/types-known authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /* eslint-disable sort-keys */
5
+
6
+ import type { OverrideVersionedType } from '@pezkuwi/types/types';
7
+
8
+ import { mapXcmTypes } from '@pezkuwi/types-create';
9
+
10
+ const sharedTypes = {
11
+ DispatchErrorModule: 'DispatchErrorModuleU8',
12
+ TAssetBalance: 'u128',
13
+ ProxyType: {
14
+ _enum: [
15
+ 'Any',
16
+ 'NonTransfer',
17
+ 'CancelProxy',
18
+ 'Assets',
19
+ 'AssetOwner',
20
+ 'AssetManager',
21
+ 'Staking'
22
+ ]
23
+ },
24
+ Weight: 'WeightV1'
25
+ };
26
+
27
+ // these are override types for Statemine, Westmint
28
+ export const versioned: OverrideVersionedType[] = [
29
+ {
30
+ minmax: [0, 3],
31
+ types: {
32
+ // Enum was modified mid-flight -
33
+ // https://github.com/paritytech/substrate/pull/10382/files#diff-e4e016b33a82268b6208dc974eea841bad47597865a749fee2f937eb6fdf67b4R498
34
+ DispatchError: 'DispatchErrorPre6First',
35
+ ...sharedTypes,
36
+ ...mapXcmTypes('V0')
37
+ }
38
+ },
39
+ {
40
+ minmax: [4, 5],
41
+ types: {
42
+ // As above, see https://github.com/polkadot-js/api/issues/5301
43
+ DispatchError: 'DispatchErrorPre6First',
44
+ ...sharedTypes,
45
+ ...mapXcmTypes('V1')
46
+ }
47
+ },
48
+ {
49
+ // metadata V14
50
+ minmax: [500, 9434],
51
+ types: {
52
+ Weight: 'WeightV1',
53
+ TAssetConversion: 'Option<AssetId>'
54
+ }
55
+ },
56
+ {
57
+ minmax: [9435, undefined],
58
+ types: {
59
+ Weight: 'WeightV1'
60
+ }
61
+ }
62
+ ];
@@ -0,0 +1,67 @@
1
+ // Copyright 2017-2025 @polkadot/types-known authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /// <reference types="@pezkuwi/dev-test/globals.d.ts" />
5
+
6
+ import type { HexString } from '@pezkuwi/util/types';
7
+ import type { ChainUpgradesExpanded } from '../types.js';
8
+
9
+ import fs from 'node:fs';
10
+
11
+ import { ApiPromise, WsProvider } from '@pezkuwi/api';
12
+ import { stringify } from '@pezkuwi/util';
13
+
14
+ import * as allMan from '../manual/index.js';
15
+ import * as allGen from './index.js';
16
+
17
+ const keys = ['kusama', 'polkadot', 'westend'] as const;
18
+ const urls = {
19
+ 'asset-hub-kusama': 'wss://kusama-asset-hub-rpc.polkadot.io',
20
+ 'asset-hub-polkadot': 'wss://polkadot-asset-hub-rpc.polkadot.io',
21
+ kusama: 'wss://kusama-rpc.polkadot.io',
22
+ polkadot: 'wss://rpc.polkadot.io',
23
+ westend: 'wss://westend-rpc.polkadot.io'
24
+ };
25
+
26
+ for (const chain of keys) {
27
+ describe(`generate ${chain}`, (): void => {
28
+ const avail = allGen[chain];
29
+ const final: ChainUpgradesExpanded = [];
30
+ let api: ApiPromise;
31
+
32
+ beforeAll(async (): Promise<void> => {
33
+ api = await ApiPromise.create({ provider: new WsProvider(urls[chain]) });
34
+ });
35
+
36
+ afterAll(async (): Promise<void> => {
37
+ fs.writeFileSync(`packages/types-known/src/upgrades/e2e/${chain}.ts`, `// Copyright 2017-${new Date().getFullYear()} @polkadot/types-known authors & contributors
38
+ // SPDX-License-Identifier: Apache-2.0
39
+
40
+ // Auto-generated from on-chain data & manual definitions, do not edit
41
+ /* eslint-disable quotes, comma-spacing */
42
+
43
+ import type { ChainUpgradesExpanded } from '../types.js';
44
+
45
+ export const upgrades: ChainUpgradesExpanded = ${stringify(final, 2)};
46
+ `);
47
+ await api.disconnect();
48
+ });
49
+
50
+ for (const [blockNumber, specVersion] of allMan[chain]) {
51
+ // eslint-disable-next-line jest/expect-expect
52
+ it(`blockNumber=${blockNumber}, specVersion=${specVersion}`, async (): Promise<void> => {
53
+ const found = avail.find(([n, s]) => n === blockNumber && s === specVersion);
54
+
55
+ if (found) {
56
+ final.push(found);
57
+ } else {
58
+ const blockHash = await api.rpc.chain.getBlockHash(blockNumber + 1);
59
+ const runtime = await api.rpc.state.getRuntimeVersion(blockHash);
60
+ const apis = runtime.apis.map(([api, version]): [HexString, number] => [api.toHex(), version.toNumber()]);
61
+
62
+ final.push([blockNumber, specVersion, apis]);
63
+ }
64
+ });
65
+ }
66
+ });
67
+ }
@@ -0,0 +1,6 @@
1
+ // Copyright 2017-2025 @polkadot/types-known authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export { upgrades as kusama } from './kusama.js';
5
+ export { upgrades as polkadot } from './polkadot.js';
6
+ export { upgrades as westend } from './westend.js';