@pezkuwi/types-known 16.5.6 → 16.5.7

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 (266) hide show
  1. package/build/README.md +3 -0
  2. package/build/bundle.js +3 -0
  3. package/build/chain/index.js +1 -0
  4. package/build/cjs/bundle.d.ts +3 -0
  5. package/build/cjs/bundle.js +9 -0
  6. package/build/cjs/chain/index.d.ts +2 -0
  7. package/build/cjs/chain/index.js +4 -0
  8. package/build/cjs/index.js +5 -0
  9. package/build/cjs/packageInfo.js +4 -0
  10. package/build/cjs/spec/centrifuge-chain.js +105 -0
  11. package/build/cjs/spec/dicle.js +118 -0
  12. package/build/cjs/spec/index.js +27 -0
  13. package/build/cjs/spec/node-template.js +13 -0
  14. package/build/cjs/spec/node.js +13 -0
  15. package/build/cjs/spec/pezkuwi.js +105 -0
  16. package/build/cjs/spec/pezkuwichain.js +65 -0
  17. package/build/cjs/spec/shell.js +11 -0
  18. package/build/cjs/spec/statemine.js +55 -0
  19. package/build/cjs/spec/statemint.js +67 -0
  20. package/build/cjs/spec/westmint.js +55 -0
  21. package/build/cjs/spec/zagros.js +118 -0
  22. package/build/cjs/upgrades/e2e/dicle.js +6429 -0
  23. package/build/cjs/upgrades/e2e/index.js +9 -0
  24. package/build/cjs/upgrades/e2e/pezkuwi.js +3707 -0
  25. package/build/cjs/upgrades/e2e/zagros.js +6429 -0
  26. package/build/cjs/upgrades/index.js +35 -0
  27. package/build/cjs/upgrades/manual/dicle.js +25 -0
  28. package/build/cjs/upgrades/manual/index.js +9 -0
  29. package/build/cjs/upgrades/manual/pezkuwi.js +17 -0
  30. package/build/cjs/upgrades/manual/zagros.js +25 -0
  31. package/build/cjs/upgrades/types.js +2 -0
  32. package/build/cjs/util.js +112 -0
  33. package/build/index.d.ts +2 -0
  34. package/build/index.js +2 -0
  35. package/build/package.json +447 -0
  36. package/build/packageDetect.d.ts +1 -0
  37. package/build/packageDetect.js +4 -0
  38. package/build/packageInfo.d.ts +6 -0
  39. package/build/packageInfo.js +1 -0
  40. package/build/spec/centrifuge-chain.d.ts +2 -0
  41. package/build/spec/centrifuge-chain.js +102 -0
  42. package/build/spec/dicle.d.ts +2 -0
  43. package/build/spec/dicle.js +115 -0
  44. package/build/spec/index.d.ts +2 -0
  45. package/build/spec/index.js +24 -0
  46. package/build/spec/node-template.d.ts +2 -0
  47. package/build/spec/node-template.js +10 -0
  48. package/build/spec/node.d.ts +2 -0
  49. package/build/spec/node.js +10 -0
  50. package/build/spec/pezkuwi.d.ts +2 -0
  51. package/build/spec/pezkuwi.js +102 -0
  52. package/build/spec/pezkuwichain.d.ts +2 -0
  53. package/build/spec/pezkuwichain.js +62 -0
  54. package/build/spec/shell.d.ts +2 -0
  55. package/build/spec/shell.js +8 -0
  56. package/build/spec/statemine.d.ts +2 -0
  57. package/build/spec/statemine.js +52 -0
  58. package/build/spec/statemint.d.ts +2 -0
  59. package/build/spec/statemint.js +64 -0
  60. package/build/spec/westmint.d.ts +2 -0
  61. package/build/spec/westmint.js +52 -0
  62. package/build/spec/zagros.d.ts +2 -0
  63. package/build/spec/zagros.js +115 -0
  64. package/build/upgrades/e2e/dicle.d.ts +2 -0
  65. package/build/upgrades/e2e/dicle.js +6426 -0
  66. package/build/upgrades/e2e/index.d.ts +3 -0
  67. package/build/upgrades/e2e/index.js +3 -0
  68. package/build/upgrades/e2e/pezkuwi.d.ts +2 -0
  69. package/build/upgrades/e2e/pezkuwi.js +3704 -0
  70. package/build/upgrades/e2e/zagros.d.ts +2 -0
  71. package/build/upgrades/e2e/zagros.js +6426 -0
  72. package/build/upgrades/index.d.ts +2 -0
  73. package/build/upgrades/index.js +31 -0
  74. package/build/upgrades/manual/dicle.d.ts +2 -0
  75. package/build/upgrades/manual/dicle.js +22 -0
  76. package/build/upgrades/manual/index.d.ts +3 -0
  77. package/build/upgrades/manual/index.js +3 -0
  78. package/build/upgrades/manual/pezkuwi.d.ts +2 -0
  79. package/build/upgrades/manual/pezkuwi.js +14 -0
  80. package/build/upgrades/manual/zagros.d.ts +2 -0
  81. package/build/upgrades/manual/zagros.js +22 -0
  82. package/build/upgrades/types.d.ts +3 -0
  83. package/build/upgrades/types.js +1 -0
  84. package/build/util.d.ts +33 -0
  85. package/build/util.js +103 -0
  86. package/build-deno/README.md +3 -0
  87. package/build-deno/bundle.ts +6 -0
  88. package/build-deno/chain/index.ts +4 -0
  89. package/build-deno/index.ts +4 -0
  90. package/build-deno/mod.ts +2 -0
  91. package/build-deno/packageDetect.ts +8 -0
  92. package/build-deno/packageInfo.ts +3 -0
  93. package/build-deno/spec/centrifuge-chain.ts +114 -0
  94. package/build-deno/spec/dicle.ts +123 -0
  95. package/build-deno/spec/index.ts +28 -0
  96. package/build-deno/spec/node-template.ts +15 -0
  97. package/build-deno/spec/node.ts +15 -0
  98. package/build-deno/spec/pezkuwi.ts +109 -0
  99. package/build-deno/spec/pezkuwichain.ts +70 -0
  100. package/build-deno/spec/shell.ts +13 -0
  101. package/build-deno/spec/statemine.ts +59 -0
  102. package/build-deno/spec/statemint.ts +71 -0
  103. package/build-deno/spec/westmint.ts +59 -0
  104. package/build-deno/spec/zagros.ts +123 -0
  105. package/build-deno/upgrades/e2e/dicle.ts +6431 -0
  106. package/build-deno/upgrades/e2e/index.ts +4 -0
  107. package/build-deno/upgrades/e2e/pezkuwi.ts +3709 -0
  108. package/build-deno/upgrades/e2e/zagros.ts +6431 -0
  109. package/build-deno/upgrades/index.ts +42 -0
  110. package/build-deno/upgrades/manual/dicle.ts +25 -0
  111. package/build-deno/upgrades/manual/index.ts +4 -0
  112. package/build-deno/upgrades/manual/pezkuwi.ts +17 -0
  113. package/build-deno/upgrades/manual/zagros.ts +25 -0
  114. package/build-deno/upgrades/types.ts +6 -0
  115. package/build-deno/util.ts +126 -0
  116. package/build-tsc-cjs/packageDetect.js +6 -0
  117. package/{cjs → build-tsc-cjs}/packageInfo.js +1 -1
  118. package/{cjs → build-tsc-cjs}/upgrades/index.js +7 -1
  119. package/{packageInfo.js → build-tsc-esm/packageInfo.js} +1 -1
  120. package/{upgrades → build-tsc-esm/upgrades}/index.js +7 -1
  121. package/package.json +6 -419
  122. package/src/bundle.ts +11 -0
  123. package/src/chain/index.ts +7 -0
  124. package/src/index.ts +6 -0
  125. package/src/mod.ts +4 -0
  126. package/src/packageDetect.ts +12 -0
  127. package/src/packageInfo.ts +6 -0
  128. package/src/spec/centrifuge-chain.ts +116 -0
  129. package/src/spec/dicle.ts +125 -0
  130. package/src/spec/index.ts +31 -0
  131. package/src/spec/node-template.ts +17 -0
  132. package/src/spec/node.ts +17 -0
  133. package/src/spec/pezkuwi.ts +112 -0
  134. package/src/spec/pezkuwichain.ts +73 -0
  135. package/src/spec/shell.ts +15 -0
  136. package/src/spec/statemine.ts +62 -0
  137. package/src/spec/statemint.ts +74 -0
  138. package/src/spec/westmint.ts +62 -0
  139. package/src/spec/zagros.ts +125 -0
  140. package/src/upgrades/e2e/dicle.ts +6434 -0
  141. package/src/upgrades/e2e/index.spec.ts +66 -0
  142. package/src/upgrades/e2e/index.ts +6 -0
  143. package/src/upgrades/e2e/pezkuwi.ts +3712 -0
  144. package/src/upgrades/e2e/zagros.ts +6434 -0
  145. package/src/upgrades/index.spec.ts +118 -0
  146. package/src/upgrades/index.ts +46 -0
  147. package/src/upgrades/manual/dicle.ts +27 -0
  148. package/src/upgrades/manual/index.ts +6 -0
  149. package/src/upgrades/manual/pezkuwi.ts +19 -0
  150. package/src/upgrades/manual/zagros.ts +27 -0
  151. package/src/upgrades/types.ts +8 -0
  152. package/src/util.ts +128 -0
  153. package/tsconfig.build.json +17 -0
  154. package/tsconfig.build.tsbuildinfo +1 -0
  155. package/tsconfig.spec.json +19 -0
  156. package/tsconfig.spec.tsbuildinfo +1 -0
  157. package/{LICENSE → build/LICENSE} +0 -0
  158. package/{cjs → build}/bundle.d.ts +0 -0
  159. package/{cjs → build}/chain/index.d.ts +0 -0
  160. package/{index.d.ts → build/cjs/index.d.ts} +0 -0
  161. package/{cjs → build/cjs}/package.json +0 -0
  162. package/{packageDetect.d.ts → build/cjs/packageDetect.d.ts} +0 -0
  163. package/{cjs → build/cjs}/packageDetect.js +0 -0
  164. package/{packageInfo.d.ts → build/cjs/packageInfo.d.ts} +0 -0
  165. package/{spec → build/cjs/spec}/centrifuge-chain.d.ts +0 -0
  166. package/{spec → build/cjs/spec}/dicle.d.ts +0 -0
  167. package/{spec → build/cjs/spec}/index.d.ts +0 -0
  168. package/{spec → build/cjs/spec}/node-template.d.ts +0 -0
  169. package/{spec → build/cjs/spec}/node.d.ts +0 -0
  170. package/{spec → build/cjs/spec}/pezkuwi.d.ts +0 -0
  171. package/{spec → build/cjs/spec}/pezkuwichain.d.ts +0 -0
  172. package/{spec → build/cjs/spec}/shell.d.ts +0 -0
  173. package/{spec → build/cjs/spec}/statemine.d.ts +0 -0
  174. package/{spec → build/cjs/spec}/statemint.d.ts +0 -0
  175. package/{spec → build/cjs/spec}/westmint.d.ts +0 -0
  176. package/{spec → build/cjs/spec}/zagros.d.ts +0 -0
  177. package/{upgrades → build/cjs/upgrades}/e2e/dicle.d.ts +0 -0
  178. package/{upgrades → build/cjs/upgrades}/e2e/index.d.ts +0 -0
  179. package/{upgrades → build/cjs/upgrades}/e2e/pezkuwi.d.ts +0 -0
  180. package/{upgrades → build/cjs/upgrades}/e2e/zagros.d.ts +0 -0
  181. package/{upgrades → build/cjs/upgrades}/index.d.ts +0 -0
  182. package/{upgrades → build/cjs/upgrades}/manual/dicle.d.ts +0 -0
  183. package/{upgrades → build/cjs/upgrades}/manual/index.d.ts +0 -0
  184. package/{upgrades → build/cjs/upgrades}/manual/pezkuwi.d.ts +0 -0
  185. package/{upgrades → build/cjs/upgrades}/manual/zagros.d.ts +0 -0
  186. package/{upgrades → build/cjs/upgrades}/types.d.ts +0 -0
  187. package/{util.d.ts → build/cjs/util.d.ts} +0 -0
  188. package/{bundle.d.ts → build-tsc/bundle.d.ts} +0 -0
  189. package/{chain → build-tsc/chain}/index.d.ts +0 -0
  190. package/{cjs → build-tsc}/index.d.ts +0 -0
  191. package/{cjs → build-tsc}/packageDetect.d.ts +0 -0
  192. package/{cjs → build-tsc}/packageInfo.d.ts +0 -0
  193. package/{cjs → build-tsc}/spec/centrifuge-chain.d.ts +0 -0
  194. package/{cjs → build-tsc}/spec/dicle.d.ts +0 -0
  195. package/{cjs → build-tsc}/spec/index.d.ts +0 -0
  196. package/{cjs → build-tsc}/spec/node-template.d.ts +0 -0
  197. package/{cjs → build-tsc}/spec/node.d.ts +0 -0
  198. package/{cjs → build-tsc}/spec/pezkuwi.d.ts +0 -0
  199. package/{cjs → build-tsc}/spec/pezkuwichain.d.ts +0 -0
  200. package/{cjs → build-tsc}/spec/shell.d.ts +0 -0
  201. package/{cjs → build-tsc}/spec/statemine.d.ts +0 -0
  202. package/{cjs → build-tsc}/spec/statemint.d.ts +0 -0
  203. package/{cjs → build-tsc}/spec/westmint.d.ts +0 -0
  204. package/{cjs → build-tsc}/spec/zagros.d.ts +0 -0
  205. package/{cjs → build-tsc}/upgrades/e2e/dicle.d.ts +0 -0
  206. package/{cjs → build-tsc}/upgrades/e2e/index.d.ts +0 -0
  207. package/{cjs → build-tsc}/upgrades/e2e/pezkuwi.d.ts +0 -0
  208. package/{cjs → build-tsc}/upgrades/e2e/zagros.d.ts +0 -0
  209. package/{cjs → build-tsc}/upgrades/index.d.ts +0 -0
  210. package/{cjs → build-tsc}/upgrades/manual/dicle.d.ts +0 -0
  211. package/{cjs → build-tsc}/upgrades/manual/index.d.ts +0 -0
  212. package/{cjs → build-tsc}/upgrades/manual/pezkuwi.d.ts +0 -0
  213. package/{cjs → build-tsc}/upgrades/manual/zagros.d.ts +0 -0
  214. package/{cjs → build-tsc}/upgrades/types.d.ts +0 -0
  215. package/{cjs → build-tsc}/util.d.ts +0 -0
  216. package/{cjs → build-tsc-cjs}/bundle.js +0 -0
  217. package/{cjs → build-tsc-cjs}/chain/index.js +0 -0
  218. package/{cjs → build-tsc-cjs}/index.js +0 -0
  219. package/{cjs → build-tsc-cjs}/spec/centrifuge-chain.js +0 -0
  220. package/{cjs → build-tsc-cjs}/spec/dicle.js +0 -0
  221. package/{cjs → build-tsc-cjs}/spec/index.js +1 -1
  222. package/{cjs → build-tsc-cjs}/spec/node-template.js +0 -0
  223. package/{cjs → build-tsc-cjs}/spec/node.js +0 -0
  224. package/{cjs → build-tsc-cjs}/spec/pezkuwi.js +0 -0
  225. package/{cjs → build-tsc-cjs}/spec/pezkuwichain.js +0 -0
  226. package/{cjs → build-tsc-cjs}/spec/shell.js +0 -0
  227. package/{cjs → build-tsc-cjs}/spec/statemine.js +0 -0
  228. package/{cjs → build-tsc-cjs}/spec/statemint.js +0 -0
  229. package/{cjs → build-tsc-cjs}/spec/westmint.js +0 -0
  230. package/{cjs → build-tsc-cjs}/spec/zagros.js +0 -0
  231. package/{cjs → build-tsc-cjs}/upgrades/e2e/dicle.js +0 -0
  232. package/{cjs → build-tsc-cjs}/upgrades/e2e/index.js +0 -0
  233. package/{cjs → build-tsc-cjs}/upgrades/e2e/pezkuwi.js +0 -0
  234. package/{cjs → build-tsc-cjs}/upgrades/e2e/zagros.js +0 -0
  235. package/{cjs → build-tsc-cjs}/upgrades/manual/dicle.js +0 -0
  236. package/{cjs → build-tsc-cjs}/upgrades/manual/index.js +0 -0
  237. package/{cjs → build-tsc-cjs}/upgrades/manual/pezkuwi.js +0 -0
  238. package/{cjs → build-tsc-cjs}/upgrades/manual/zagros.js +0 -0
  239. package/{cjs → build-tsc-cjs}/upgrades/types.js +0 -0
  240. package/{cjs → build-tsc-cjs}/util.js +0 -0
  241. package/{bundle.js → build-tsc-esm/bundle.js} +0 -0
  242. package/{chain → build-tsc-esm/chain}/index.js +0 -0
  243. package/{index.js → build-tsc-esm/index.js} +0 -0
  244. package/{packageDetect.js → build-tsc-esm/packageDetect.js} +0 -0
  245. package/{spec → build-tsc-esm/spec}/centrifuge-chain.js +0 -0
  246. package/{spec → build-tsc-esm/spec}/dicle.js +0 -0
  247. package/{spec → build-tsc-esm/spec}/index.js +1 -1
  248. /package/{spec → build-tsc-esm/spec}/node-template.js +0 -0
  249. /package/{spec → build-tsc-esm/spec}/node.js +0 -0
  250. /package/{spec → build-tsc-esm/spec}/pezkuwi.js +0 -0
  251. /package/{spec → build-tsc-esm/spec}/pezkuwichain.js +0 -0
  252. /package/{spec → build-tsc-esm/spec}/shell.js +0 -0
  253. /package/{spec → build-tsc-esm/spec}/statemine.js +0 -0
  254. /package/{spec → build-tsc-esm/spec}/statemint.js +0 -0
  255. /package/{spec → build-tsc-esm/spec}/westmint.js +0 -0
  256. /package/{spec → build-tsc-esm/spec}/zagros.js +0 -0
  257. /package/{upgrades → build-tsc-esm/upgrades}/e2e/dicle.js +0 -0
  258. /package/{upgrades → build-tsc-esm/upgrades}/e2e/index.js +0 -0
  259. /package/{upgrades → build-tsc-esm/upgrades}/e2e/pezkuwi.js +0 -0
  260. /package/{upgrades → build-tsc-esm/upgrades}/e2e/zagros.js +0 -0
  261. /package/{upgrades → build-tsc-esm/upgrades}/manual/dicle.js +0 -0
  262. /package/{upgrades → build-tsc-esm/upgrades}/manual/index.js +0 -0
  263. /package/{upgrades → build-tsc-esm/upgrades}/manual/pezkuwi.js +0 -0
  264. /package/{upgrades → build-tsc-esm/upgrades}/manual/zagros.js +0 -0
  265. /package/{upgrades → build-tsc-esm/upgrades}/types.js +0 -0
  266. /package/{util.js → build-tsc-esm/util.js} +0 -0
@@ -0,0 +1,2 @@
1
+ import type { ChainUpgrades } from '@pezkuwi/types/types';
2
+ export declare const upgrades: ChainUpgrades[];
@@ -0,0 +1,31 @@
1
+ import { selectableNetworks } from '@pezkuwi/networks';
2
+ import { BN, hexToU8a } from '@pezkuwi/util';
3
+ import * as allKnown from './e2e/index.js';
4
+ const NET_EXTRA = {
5
+ dicle: {
6
+ genesisHash: ['0xd9d3cd7c1e5d890d969b957f4c5b71a111bbeeabc968f1d0d4538c2663f080a7']
7
+ },
8
+ pezkuwi: {
9
+ genesisHash: ['0x41693961995d879073269a008d0a52832caa3e0ae73869f02127f3d5daa4934c']
10
+ },
11
+ zagros: {
12
+ genesisHash: ['0x297f5a4d105b4b28312586ff1915572ffe4ee015ff772b76399ecbff25a22026']
13
+ }
14
+ };
15
+ /** @internal */
16
+ function mapRaw([network, versions]) {
17
+ const chain = selectableNetworks.find((n) => n.network === network) || NET_EXTRA[network];
18
+ if (!chain) {
19
+ throw new Error(`Unable to find info for chain ${network}`);
20
+ }
21
+ return {
22
+ genesisHash: hexToU8a(chain.genesisHash[0]),
23
+ network,
24
+ versions: versions.map(([blockNumber, specVersion, apis]) => ({
25
+ apis,
26
+ blockNumber: new BN(blockNumber),
27
+ specVersion: new BN(specVersion)
28
+ }))
29
+ };
30
+ }
31
+ export const upgrades = Object.entries(allKnown).map(mapRaw);
@@ -0,0 +1,2 @@
1
+ import type { ChainUpgradesRaw } from '../types.js';
2
+ export declare const upgrades: ChainUpgradesRaw;
@@ -0,0 +1,22 @@
1
+ export const upgrades = [
2
+ [214356, 4], [392764, 7], [409740, 8], [809976, 20], [877581, 24],
3
+ [879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29],
4
+ [1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
5
+ [1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44],
6
+ [2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49],
7
+ [5124076, 50], [5478664, 900], [5482450, 9000], [5584305, 9010], [5784566, 9030],
8
+ [5879822, 9031], [5896856, 9032], [5897316, 9033], [6117927, 9050], [6210274, 9070],
9
+ [6379314, 9080], [6979141, 9090], [7568453, 9100], [7766394, 9111], [7911691, 9120],
10
+ [7968866, 9121], [7982889, 9122], [8514322, 9130], [9091726, 9140], [9091774, 9150],
11
+ [9406726, 9160], [9921066, 9170], [10007115, 9180], [10480973, 9190], [10578091, 9200],
12
+ [10678509, 9210], [10811001, 9220], [11096116, 9230], [11409279, 9250], [11584820, 9251],
13
+ [11716837, 9260], [11876919, 9261], [11987927, 9270], [12077324, 9271], [12301871, 9280],
14
+ [12604343, 9290], [12841034, 9300], [13128237, 9310], [13272363, 9320], [13483497, 9330],
15
+ [13649433, 9340], [13761100, 9350], [13847400, 9360], [14249200, 9370], [14576855, 9380],
16
+ [14849830, 9390], [15146832, 9400], [15332317, 9401], [15661793, 9420], [16165469, 9430],
17
+ [18293984, 102000], [18293991, 103000], [18451783, 104000], [18679741, 1005000], [19166695, 1006000],
18
+ [19234157, 1006001], [19542944, 1007000], [19621258, 1007001], [19761406, 1008000], [20056997, 1009000],
19
+ [20368318, 1010000], [20649086, 1011000], [21217837, 1011001], [21300429, 1013000], [21460051, 1014000],
20
+ [21925427, 1015000], [22500517, 1016000], [22759684, 1016001], [23056976, 1016002], [23544582, 1017000],
21
+ [24002343, 1017001]
22
+ ];
@@ -0,0 +1,3 @@
1
+ export { upgrades as dicle } from './dicle.js';
2
+ export { upgrades as pezkuwi } from './pezkuwi.js';
3
+ export { upgrades as zagros } from './zagros.js';
@@ -0,0 +1,3 @@
1
+ export { upgrades as dicle } from './dicle.js';
2
+ export { upgrades as pezkuwi } from './pezkuwi.js';
3
+ export { upgrades as zagros } from './zagros.js';
@@ -0,0 +1,2 @@
1
+ import type { ChainUpgradesRaw } from '../types.js';
2
+ export declare const upgrades: ChainUpgradesRaw;
@@ -0,0 +1,14 @@
1
+ export const upgrades = [
2
+ [0, 0], [29231, 1], [188836, 5], [199405, 6], [214264, 7],
3
+ [244358, 8], [303079, 9], [314201, 10], [342400, 11], [443963, 12],
4
+ [528470, 13], [687751, 14], [746085, 15], [787923, 16], [799302, 17],
5
+ [1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26],
6
+ [3613564, 27], [3899547, 28], [4345767, 29], [4876134, 30], [5661442, 9050],
7
+ [6321619, 9080], [6713249, 9090], [7217907, 9100], [7229126, 9110], [7560558, 9122],
8
+ [8115869, 9140], [8638103, 9151], [9280179, 9170], [9738717, 9180], [10156856, 9190],
9
+ [10458576, 9200], [10655116, 9220], [10879371, 9230], [11328884, 9250], [11532856, 9260],
10
+ [11933818, 9270], [12217535, 9280], [12245277, 9281], [12532644, 9291], [12876189, 9300],
11
+ [13800015, 9340], [14188833, 9360], [14543918, 9370], [15978362, 9420], [16450000, 9430],
12
+ [17840000, 9431], [18407475, 1000001], [19551000, 1001002], [20181758, 1001003],
13
+ [20438530, 1002000], [21169168, 1002004], [21455374, 1002005], [21558004, 1002006], [21800141, 1002007]
14
+ ];
@@ -0,0 +1,2 @@
1
+ import type { ChainUpgradesRaw } from '../types.js';
2
+ export declare const upgrades: ChainUpgradesRaw;
@@ -0,0 +1,22 @@
1
+ export const upgrades = [
2
+ [214356, 4], [392764, 7], [409740, 8], [809976, 20], [877581, 24],
3
+ [879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29],
4
+ [1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
5
+ [1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44],
6
+ [2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49],
7
+ [5124076, 50], [5478664, 900], [5482450, 9000], [5584305, 9010], [5784566, 9030],
8
+ [5879822, 9031], [5896856, 9032], [5897316, 9033], [6117927, 9050], [6210274, 9070],
9
+ [6379314, 9080], [6979141, 9090], [7568453, 9100], [7766394, 9111], [7911691, 9120],
10
+ [7968866, 9121], [7982889, 9122], [8514322, 9130], [9091726, 9140], [9091774, 9150],
11
+ [9406726, 9160], [9921066, 9170], [10007115, 9180], [10480973, 9190], [10578091, 9200],
12
+ [10678509, 9210], [10811001, 9220], [11096116, 9230], [11409279, 9250], [11584820, 9251],
13
+ [11716837, 9260], [11876919, 9261], [11987927, 9270], [12077324, 9271], [12301871, 9280],
14
+ [12604343, 9290], [12841034, 9300], [13128237, 9310], [13272363, 9320], [13483497, 9330],
15
+ [13649433, 9340], [13761100, 9350], [13847400, 9360], [14249200, 9370], [14576855, 9380],
16
+ [14849830, 9390], [15146832, 9400], [15332317, 9401], [15661793, 9420], [16165469, 9430],
17
+ [18293984, 102000], [18293991, 103000], [18451783, 104000], [18679741, 1005000], [19166695, 1006000],
18
+ [19234157, 1006001], [19542944, 1007000], [19621258, 1007001], [19761406, 1008000], [20056997, 1009000],
19
+ [20368318, 1010000], [20649086, 1011000], [21217837, 1011001], [21300429, 1013000], [21460051, 1014000],
20
+ [21925427, 1015000], [22500517, 1016000], [22759684, 1016001], [23056976, 1016002], [23544582, 1017000],
21
+ [24002343, 1017001]
22
+ ];
@@ -0,0 +1,3 @@
1
+ import type { HexString } from '@pezkuwi/util/types';
2
+ export type ChainUpgradesRaw = [blockNumber: number, specVersion: number][];
3
+ export type ChainUpgradesExpanded = [blockNumber: number, specVersion: number, runtimeApis: [apiHash: HexString, apiVersion: number][]][];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ import type { ExtDef } from '@pezkuwi/types/extrinsic/signedExtensions/types';
2
+ import type { Hash } from '@pezkuwi/types/interfaces';
3
+ import type { ChainUpgradeVersion, CodecHasher, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, OverrideModuleType, Registry, RegistryTypes } from '@pezkuwi/types/types';
4
+ import type { Text } from '@pezkuwi/types-codec';
5
+ import type { BN } from '@pezkuwi/util';
6
+ /**
7
+ * @description Based on the chain and runtimeVersion, get the applicable signed extensions (ready for registration)
8
+ */
9
+ export declare function getSpecExtensions({ knownTypes }: Registry, chainName: Text | string, specName: Text | string): ExtDef;
10
+ /**
11
+ * @description Based on the chain and runtimeVersion, get the applicable types (ready for registration)
12
+ */
13
+ export declare function getSpecTypes({ knownTypes }: Registry, chainName: Text | string, specName: Text | string, specVersion: bigint | BN | number): RegistryTypes;
14
+ /**
15
+ * @description Based on the chain or spec, return the hasher used
16
+ */
17
+ export declare function getSpecHasher({ knownTypes }: Registry, chainName: Text | string, specName: Text | string): CodecHasher | null;
18
+ /**
19
+ * @description Based on the chain and runtimeVersion, get the applicable rpc definitions (ready for registration)
20
+ */
21
+ export declare function getSpecRpc({ knownTypes }: Registry, chainName: Text | string, specName: Text | string): Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>;
22
+ /**
23
+ * @description Based on the chain and runtimeVersion, get the applicable runtime definitions (ready for registration)
24
+ */
25
+ export declare function getSpecRuntime({ knownTypes }: Registry, chainName: Text | string, specName: Text | string): DefinitionsCall;
26
+ /**
27
+ * @description Based on the chain and runtimeVersion, get the applicable alias definitions (ready for registration)
28
+ */
29
+ export declare function getSpecAlias({ knownTypes }: Registry, chainName: Text | string, specName: Text | string): Record<string, OverrideModuleType>;
30
+ /**
31
+ * @description Returns a version record for known chains where upgrades are being tracked
32
+ */
33
+ export declare function getUpgradeVersion(genesisHash: Hash, blockNumber: BN): [ChainUpgradeVersion | undefined, ChainUpgradeVersion | undefined];
package/build/util.js ADDED
@@ -0,0 +1,103 @@
1
+ import { bnToBn } from '@pezkuwi/util';
2
+ import { typesChain } from './chain/index.js';
3
+ import { typesSpec } from './spec/index.js';
4
+ import { upgrades } from './upgrades/index.js';
5
+ /**
6
+ * @description Perform the callback function using the stringified spec/chain
7
+ * @internal
8
+ * */
9
+ function withNames(chainName, specName, fn) {
10
+ return fn(chainName.toString(), specName.toString());
11
+ }
12
+ /**
13
+ * @descriptionFflatten a VersionedType[] into a Record<string, string>
14
+ * @internal
15
+ * */
16
+ function filterVersions(versions = [], specVersion) {
17
+ return versions
18
+ .filter(({ minmax: [min, max] }) => (min === undefined || min === null || specVersion >= min) &&
19
+ (max === undefined || max === null || specVersion <= max))
20
+ .reduce((result, { types }) => ({ ...result, ...types }), {});
21
+ }
22
+ /**
23
+ * @description Based on the chain and runtimeVersion, get the applicable signed extensions (ready for registration)
24
+ */
25
+ export function getSpecExtensions({ knownTypes }, chainName, specName) {
26
+ return withNames(chainName, specName, (c, s) => ({
27
+ ...(knownTypes.typesBundle?.spec?.[s]?.signedExtensions ?? {}),
28
+ ...(knownTypes.typesBundle?.chain?.[c]?.signedExtensions ?? {})
29
+ }));
30
+ }
31
+ /**
32
+ * @description Based on the chain and runtimeVersion, get the applicable types (ready for registration)
33
+ */
34
+ export function getSpecTypes({ knownTypes }, chainName, specName, specVersion) {
35
+ const _specVersion = bnToBn(specVersion).toNumber();
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
+ }));
49
+ }
50
+ /**
51
+ * @description Based on the chain or spec, return the hasher used
52
+ */
53
+ export function getSpecHasher({ knownTypes }, chainName, specName) {
54
+ return withNames(chainName, specName, (c, s) => knownTypes.hasher ||
55
+ knownTypes.typesBundle?.chain?.[c]?.hasher ||
56
+ knownTypes.typesBundle?.spec?.[s]?.hasher ||
57
+ null);
58
+ }
59
+ /**
60
+ * @description Based on the chain and runtimeVersion, get the applicable rpc definitions (ready for registration)
61
+ */
62
+ export function getSpecRpc({ knownTypes }, chainName, specName) {
63
+ return withNames(chainName, specName, (c, s) => ({
64
+ ...(knownTypes.typesBundle?.spec?.[s]?.rpc ?? {}),
65
+ ...(knownTypes.typesBundle?.chain?.[c]?.rpc ?? {})
66
+ }));
67
+ }
68
+ /**
69
+ * @description Based on the chain and runtimeVersion, get the applicable runtime definitions (ready for registration)
70
+ */
71
+ export function getSpecRuntime({ knownTypes }, chainName, specName) {
72
+ return withNames(chainName, specName, (c, s) => ({
73
+ ...(knownTypes.typesBundle?.spec?.[s]?.runtime ?? {}),
74
+ ...(knownTypes.typesBundle?.chain?.[c]?.runtime ?? {})
75
+ }));
76
+ }
77
+ /**
78
+ * @description Based on the chain and runtimeVersion, get the applicable alias definitions (ready for registration)
79
+ */
80
+ export function getSpecAlias({ knownTypes }, chainName, specName) {
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
+ }));
87
+ }
88
+ /**
89
+ * @description Returns a version record for known chains where upgrades are being tracked
90
+ */
91
+ export function getUpgradeVersion(genesisHash, blockNumber) {
92
+ const known = upgrades.find((u) => genesisHash.eq(u.genesisHash));
93
+ return known
94
+ ? [
95
+ known.versions.reduce((last, version) => {
96
+ return blockNumber.gt(version.blockNumber)
97
+ ? version
98
+ : last;
99
+ }, undefined),
100
+ known.versions.find((version) => blockNumber.lte(version.blockNumber))
101
+ ]
102
+ : [undefined, undefined];
103
+ }
@@ -0,0 +1,3 @@
1
+ # @pezkuwi/types-known
2
+
3
+ Specific known base type overrides (e.g. `Address`, etc) for chains & specs. This does not contain user-specific types.
@@ -0,0 +1,6 @@
1
+
2
+ export { mapXcmTypes } from 'https://deno.land/x/pezkuwi/types-create/mod.ts';
3
+
4
+ export { packageInfo } from './packageInfo.ts';
5
+
6
+ export * from './util.ts';
@@ -0,0 +1,4 @@
1
+
2
+ import type { OverrideVersionedType } from 'https://deno.land/x/pezkuwi/types/types/index.ts';
3
+
4
+ export const typesChain: Record<string, OverrideVersionedType[]> = {};
@@ -0,0 +1,4 @@
1
+
2
+ import './packageDetect.ts';
3
+
4
+ export * from './bundle.ts';
@@ -0,0 +1,2 @@
1
+
2
+ export * from './index.ts';
@@ -0,0 +1,8 @@
1
+
2
+
3
+ import { packageInfo as typesInfo } from 'https://deno.land/x/pezkuwi/types/packageInfo.ts';
4
+ import { detectPackage } from 'https://deno.land/x/pezkuwi/util/mod.ts';
5
+
6
+ import { packageInfo } from './packageInfo.ts';
7
+
8
+ detectPackage(packageInfo, null, [typesInfo]);
@@ -0,0 +1,3 @@
1
+
2
+
3
+ export const packageInfo = { name: '@pezkuwi/types-known', path: new URL(import.meta.url).pathname, type: 'deno', version: '16.5.7' };
@@ -0,0 +1,114 @@
1
+
2
+ /* eslint-disable sort-keys */
3
+
4
+ import type { OverrideVersionedType } from 'https://deno.land/x/pezkuwi/types/types/index.ts';
5
+
6
+ const sharedTypes = {
7
+ // Anchor
8
+ AnchorData: {
9
+ anchoredBlock: 'u64',
10
+ docRoot: 'H256',
11
+ id: 'H256'
12
+ },
13
+ DispatchErrorModule: 'DispatchErrorModuleU8',
14
+ PreCommitData: {
15
+ expirationBlock: 'u64',
16
+ identity: 'H256',
17
+ signingRoot: 'H256'
18
+ },
19
+
20
+ // Fees
21
+ Fee: {
22
+ key: 'Hash',
23
+ price: 'Balance'
24
+ },
25
+
26
+ // MultiAccount
27
+ MultiAccountData: {
28
+ deposit: 'Balance',
29
+ depositor: 'AccountId',
30
+ signatories: 'Vec<AccountId>',
31
+ threshold: 'u16'
32
+ },
33
+
34
+ // Bridge
35
+ ChainId: 'u8',
36
+ DepositNonce: 'u64',
37
+ ResourceId: '[u8; 32]',
38
+ 'chainbridge::ChainId': 'u8',
39
+
40
+ // NFT
41
+ RegistryId: 'H160',
42
+ TokenId: 'U256',
43
+ AssetId: {
44
+ registryId: 'RegistryId',
45
+ tokenId: 'TokenId'
46
+ },
47
+ AssetInfo: {
48
+ metadata: 'Bytes'
49
+ },
50
+ MintInfo: {
51
+ anchorId: 'Hash',
52
+ proofs: 'Vec<ProofMint>',
53
+ staticHashes: '[Hash; 3]'
54
+ },
55
+ Proof: {
56
+ leafHash: 'H256',
57
+ sortedHashes: 'H256'
58
+ },
59
+ ProofMint: {
60
+ hashes: 'Vec<Hash>',
61
+ property: 'Bytes',
62
+ salt: '[u8; 32]',
63
+ value: 'Bytes'
64
+ },
65
+ RegistryInfo: {
66
+ fields: 'Vec<Bytes>',
67
+ ownerCanBurn: 'bool'
68
+ },
69
+
70
+ ProxyType: {
71
+ _enum: [
72
+ 'Any',
73
+ 'NonTransfer',
74
+ 'Governance',
75
+ 'Staking',
76
+ 'NonProxy'
77
+ ]
78
+ }
79
+ };
80
+
81
+ const standaloneTypes = {
82
+ ...sharedTypes,
83
+ AccountInfo: 'AccountInfoWithRefCount',
84
+ Address: 'LookupSource',
85
+ LookupSource: 'IndicesLookupSource',
86
+ Multiplier: 'Fixed64',
87
+ RefCount: 'RefCountTo259'
88
+ };
89
+
90
+ export const versioned: OverrideVersionedType[] = [
91
+ {
92
+ minmax: [240, 243],
93
+ types: {
94
+ ...standaloneTypes,
95
+ ProxyType: {
96
+ _enum: [
97
+ 'Any',
98
+ 'NonTransfer',
99
+ 'Governance',
100
+ 'Staking',
101
+ 'Vesting'
102
+ ]
103
+ }
104
+ }
105
+ },
106
+ {
107
+ minmax: [244, 999],
108
+ types: { ...standaloneTypes }
109
+ },
110
+ {
111
+ minmax: [1000, undefined],
112
+ types: { ...sharedTypes }
113
+ }
114
+ ];
@@ -0,0 +1,123 @@
1
+
2
+ /* eslint-disable sort-keys */
3
+
4
+ import type { OverrideVersionedType } from 'https://deno.land/x/pezkuwi/types/types/index.ts';
5
+
6
+ import { mapXcmTypes } from 'https://deno.land/x/pezkuwi/types-create/mod.ts';
7
+
8
+ const sharedTypes = {
9
+ // 16 validators
10
+ CompactAssignments: 'CompactAssignmentsWith16',
11
+ DispatchErrorModule: 'DispatchErrorModuleU8',
12
+ RawSolution: 'RawSolutionWith16',
13
+ // general
14
+ Keys: 'SessionKeys6',
15
+ ProxyType: {
16
+ _enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances', 'IdentityJudgement', 'CancelProxy']
17
+ },
18
+ Weight: 'WeightV1'
19
+ };
20
+
21
+ const addrAccountIdTypes = {
22
+ AccountInfo: 'AccountInfoWithRefCount',
23
+ Address: 'AccountId',
24
+ CompactAssignments: 'CompactAssignmentsWith16',
25
+ DispatchErrorModule: 'DispatchErrorModuleU8',
26
+ LookupSource: 'AccountId',
27
+ Keys: 'SessionKeys5',
28
+ RawSolution: 'RawSolutionWith16',
29
+ ValidatorPrefs: 'ValidatorPrefsWithCommission'
30
+ };
31
+
32
+ export const versioned: OverrideVersionedType[] = [
33
+ {
34
+ minmax: [1, 2],
35
+ types: {
36
+ ...sharedTypes,
37
+ ...addrAccountIdTypes,
38
+ CompactAssignments: 'CompactAssignmentsTo257',
39
+ DispatchInfo: 'DispatchInfoTo244',
40
+ Heartbeat: 'HeartbeatTo244',
41
+ Multiplier: 'Fixed64',
42
+ OpenTip: 'OpenTipTo225',
43
+ RefCount: 'RefCountTo259',
44
+ Weight: 'u32'
45
+ }
46
+ },
47
+ {
48
+ minmax: [3, 22],
49
+ types: {
50
+ ...sharedTypes,
51
+ ...addrAccountIdTypes,
52
+ CompactAssignments: 'CompactAssignmentsTo257',
53
+ DispatchInfo: 'DispatchInfoTo244',
54
+ Heartbeat: 'HeartbeatTo244',
55
+ OpenTip: 'OpenTipTo225',
56
+ RefCount: 'RefCountTo259'
57
+ }
58
+ },
59
+ {
60
+ minmax: [23, 42],
61
+ types: {
62
+ ...sharedTypes,
63
+ ...addrAccountIdTypes,
64
+ CompactAssignments: 'CompactAssignmentsTo257',
65
+ DispatchInfo: 'DispatchInfoTo244',
66
+ Heartbeat: 'HeartbeatTo244',
67
+ RefCount: 'RefCountTo259'
68
+ }
69
+ },
70
+ {
71
+ minmax: [43, 44],
72
+ types: {
73
+ ...sharedTypes,
74
+ ...addrAccountIdTypes,
75
+ DispatchInfo: 'DispatchInfoTo244',
76
+ Heartbeat: 'HeartbeatTo244',
77
+ RefCount: 'RefCountTo259'
78
+ }
79
+ },
80
+ {
81
+ minmax: [45, 47],
82
+ types: {
83
+ ...sharedTypes,
84
+ ...addrAccountIdTypes
85
+ }
86
+ },
87
+ {
88
+ minmax: [48, 49],
89
+ types: {
90
+ ...sharedTypes,
91
+ AccountInfo: 'AccountInfoWithDualRefCount'
92
+ }
93
+ },
94
+ {
95
+ minmax: [50, 9099],
96
+ types: {
97
+ ...sharedTypes,
98
+ ...mapXcmTypes('V0')
99
+ }
100
+ },
101
+ {
102
+ minmax: [9100, 9105],
103
+ types: {
104
+ ...sharedTypes,
105
+ ...mapXcmTypes('V1')
106
+ }
107
+ },
108
+ {
109
+ // metadata v14
110
+ minmax: [9106, undefined],
111
+ types: {
112
+ Weight: 'WeightV1'
113
+ }
114
+ }
115
+ // ,
116
+ // {
117
+ // // weight v2 introduction
118
+ // minmax: [9300, undefined],
119
+ // types: {
120
+ // Weight: 'WeightV2'
121
+ // }
122
+ // }
123
+ ];
@@ -0,0 +1,28 @@
1
+
2
+ import type { OverrideVersionedType } from 'https://deno.land/x/pezkuwi/types/types/index.ts';
3
+
4
+ import { versioned as centrifugeChain } from './centrifuge-chain.ts';
5
+ import { versioned as dicle } from './dicle.ts';
6
+ import { versioned as node } from './node.ts';
7
+ import { versioned as nodeTemplate } from './node-template.ts';
8
+ import { versioned as pezkuwi } from './pezkuwi.ts';
9
+ import { versioned as pezkuwichain } from './pezkuwichain.ts';
10
+ import { versioned as shell } from './shell.ts';
11
+ import { versioned as statemine } from './statemine.ts';
12
+ import { versioned as statemint } from './statemint.ts';
13
+ import { versioned as westmint } from './westmint.ts';
14
+ import { versioned as zagros } from './zagros.ts';
15
+
16
+ export const typesSpec: Record<string, OverrideVersionedType[]> = {
17
+ 'centrifuge-chain': centrifugeChain,
18
+ dicle,
19
+ node,
20
+ 'node-template': nodeTemplate,
21
+ pezkuwi,
22
+ pezkuwichain,
23
+ shell,
24
+ statemine,
25
+ statemint,
26
+ zagros,
27
+ westmint
28
+ };
@@ -0,0 +1,15 @@
1
+
2
+ /* eslint-disable sort-keys */
3
+
4
+ import type { OverrideVersionedType } from 'https://deno.land/x/pezkuwi/types/types/index.ts';
5
+
6
+ export const versioned: OverrideVersionedType[] = [
7
+ {
8
+ minmax: [0, undefined],
9
+ types: {
10
+ // nothing, API tracks master
11
+ // (v2 weights are not yet the default)
12
+ Weight: 'WeightV2'
13
+ }
14
+ }
15
+ ];
@@ -0,0 +1,15 @@
1
+
2
+ /* eslint-disable sort-keys */
3
+
4
+ import type { OverrideVersionedType } from 'https://deno.land/x/pezkuwi/types/types/index.ts';
5
+
6
+ export const versioned: OverrideVersionedType[] = [
7
+ {
8
+ minmax: [0, undefined],
9
+ types: {
10
+ // nothing, API tracks master
11
+ // (v2 weights are not yet the default)
12
+ Weight: 'WeightV2'
13
+ }
14
+ }
15
+ ];