@pezkuwi/typegen 16.5.18 → 16.5.31

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 (308) hide show
  1. package/{build-tsc-cjs → cjs}/generate/lookup.js +39 -10
  2. package/{build/cjs → cjs}/packageInfo.js +1 -1
  3. package/{build-tsc-cjs → cjs}/util/derived.js +15 -0
  4. package/{build-tsc-cjs → cjs}/util/formatting.js +5 -0
  5. package/generate/lookup.js +39 -10
  6. package/package.json +27 -27
  7. package/{build-tsc-esm/packageInfo.js → packageInfo.js} +1 -1
  8. package/{build/util → util}/derived.js +16 -1
  9. package/{build-tsc-esm/util → util}/formatting.js +5 -0
  10. package/build/LICENSE +0 -201
  11. package/build/README.md +0 -3
  12. package/build/augment.js +0 -2
  13. package/build/bundle.js +0 -2
  14. package/build/cjs/augment.d.ts +0 -2
  15. package/build/cjs/augment.js +0 -4
  16. package/build/cjs/bundle.d.ts +0 -2
  17. package/build/cjs/bundle.js +0 -7
  18. package/build/cjs/extractChain.js +0 -44
  19. package/build/cjs/fromChain.js +0 -95
  20. package/build/cjs/fromDefs.js +0 -82
  21. package/build/cjs/generate/consts.d.ts +0 -5
  22. package/build/cjs/generate/consts.js +0 -91
  23. package/build/cjs/generate/errors.d.ts +0 -4
  24. package/build/cjs/generate/errors.js +0 -59
  25. package/build/cjs/generate/events.d.ts +0 -5
  26. package/build/cjs/generate/events.js +0 -139
  27. package/build/cjs/generate/index.js +0 -23
  28. package/build/cjs/generate/interfaceRegistry.d.ts +0 -4
  29. package/build/cjs/generate/interfaceRegistry.js +0 -64
  30. package/build/cjs/generate/lookup.d.ts +0 -4
  31. package/build/cjs/generate/lookup.js +0 -240
  32. package/build/cjs/generate/query.d.ts +0 -5
  33. package/build/cjs/generate/query.js +0 -140
  34. package/build/cjs/generate/rpc.d.ts +0 -6
  35. package/build/cjs/generate/rpc.js +0 -115
  36. package/build/cjs/generate/runtime.d.ts +0 -7
  37. package/build/cjs/generate/runtime.js +0 -233
  38. package/build/cjs/generate/tsDef.d.ts +0 -16
  39. package/build/cjs/generate/tsDef.js +0 -254
  40. package/build/cjs/generate/tx.d.ts +0 -5
  41. package/build/cjs/generate/tx.js +0 -121
  42. package/build/cjs/generate/types.d.ts +0 -12
  43. package/build/cjs/generate/types.js +0 -16
  44. package/build/cjs/index.js +0 -5
  45. package/build/cjs/interfacesTs.js +0 -28
  46. package/build/cjs/metadataMd.js +0 -652
  47. package/build/cjs/util/assert.js +0 -15
  48. package/build/cjs/util/derived.js +0 -128
  49. package/build/cjs/util/docs.js +0 -10
  50. package/build/cjs/util/file.js +0 -33
  51. package/build/cjs/util/formatting.js +0 -237
  52. package/build/cjs/util/imports.js +0 -126
  53. package/build/cjs/util/index.js +0 -39
  54. package/build/cjs/util/initMeta.js +0 -22
  55. package/build/cjs/util/register.js +0 -10
  56. package/build/cjs/util/wsMeta.js +0 -60
  57. package/build/extractChain.d.ts +0 -1
  58. package/build/extractChain.js +0 -40
  59. package/build/fromChain.d.ts +0 -1
  60. package/build/fromChain.js +0 -91
  61. package/build/fromDefs.d.ts +0 -1
  62. package/build/fromDefs.js +0 -78
  63. package/build/generate/consts.d.ts +0 -5
  64. package/build/generate/consts.js +0 -87
  65. package/build/generate/errors.d.ts +0 -4
  66. package/build/generate/errors.js +0 -55
  67. package/build/generate/events.d.ts +0 -5
  68. package/build/generate/events.js +0 -135
  69. package/build/generate/index.d.ts +0 -10
  70. package/build/generate/index.js +0 -10
  71. package/build/generate/interfaceRegistry.d.ts +0 -4
  72. package/build/generate/interfaceRegistry.js +0 -59
  73. package/build/generate/lookup.d.ts +0 -4
  74. package/build/generate/lookup.js +0 -235
  75. package/build/generate/query.d.ts +0 -5
  76. package/build/generate/query.js +0 -136
  77. package/build/generate/rpc.d.ts +0 -6
  78. package/build/generate/rpc.js +0 -110
  79. package/build/generate/runtime.d.ts +0 -7
  80. package/build/generate/runtime.js +0 -228
  81. package/build/generate/tsDef.d.ts +0 -16
  82. package/build/generate/tsDef.js +0 -246
  83. package/build/generate/tx.d.ts +0 -5
  84. package/build/generate/tx.js +0 -117
  85. package/build/generate/types.d.ts +0 -12
  86. package/build/generate/types.js +0 -13
  87. package/build/index.d.ts +0 -2
  88. package/build/index.js +0 -2
  89. package/build/interfacesTs.d.ts +0 -1
  90. package/build/interfacesTs.js +0 -24
  91. package/build/metadataMd.d.ts +0 -1
  92. package/build/metadataMd.js +0 -648
  93. package/build/package.json +0 -548
  94. package/build/packageDetect.d.ts +0 -1
  95. package/build/packageDetect.js +0 -6
  96. package/build/packageInfo.d.ts +0 -6
  97. package/build/packageInfo.js +0 -1
  98. package/build/scripts/pezkuwi-types-chain-info.mjs +0 -7
  99. package/build/scripts/pezkuwi-types-from-chain.mjs +0 -7
  100. package/build/scripts/pezkuwi-types-from-defs.mjs +0 -7
  101. package/build/scripts/pezkuwi-types-internal-interfaces.mjs +0 -7
  102. package/build/scripts/pezkuwi-types-internal-metadata.mjs +0 -7
  103. package/build/templates/calls.hbs +0 -30
  104. package/build/templates/consts.hbs +0 -28
  105. package/build/templates/docs.hbs +0 -7
  106. package/build/templates/errors.hbs +0 -28
  107. package/build/templates/events.hbs +0 -28
  108. package/build/templates/header.hbs +0 -2
  109. package/build/templates/interfaceRegistry.hbs +0 -15
  110. package/build/templates/lookup/defs-named.hbs +0 -12
  111. package/build/templates/lookup/defs.hbs +0 -15
  112. package/build/templates/lookup/index.hbs +0 -3
  113. package/build/templates/lookup/types.hbs +0 -14
  114. package/build/templates/query.hbs +0 -29
  115. package/build/templates/rpc.hbs +0 -22
  116. package/build/templates/tsDef/index.hbs +0 -3
  117. package/build/templates/tsDef/moduleTypes.hbs +0 -10
  118. package/build/templates/tsDef/types.hbs +0 -7
  119. package/build/templates/tx.hbs +0 -30
  120. package/build/util/assert.d.ts +0 -2
  121. package/build/util/assert.js +0 -10
  122. package/build/util/derived.d.ts +0 -4
  123. package/build/util/docs.d.ts +0 -1
  124. package/build/util/docs.js +0 -6
  125. package/build/util/file.d.ts +0 -2
  126. package/build/util/file.js +0 -28
  127. package/build/util/formatting.d.ts +0 -11
  128. package/build/util/formatting.js +0 -230
  129. package/build/util/imports.d.ts +0 -23
  130. package/build/util/imports.js +0 -121
  131. package/build/util/index.d.ts +0 -16
  132. package/build/util/index.js +0 -34
  133. package/build/util/initMeta.d.ts +0 -12
  134. package/build/util/initMeta.js +0 -19
  135. package/build/util/register.d.ts +0 -4
  136. package/build/util/register.js +0 -7
  137. package/build/util/wsMeta.d.ts +0 -4
  138. package/build/util/wsMeta.js +0 -55
  139. package/build-tsc-cjs/packageDetect.js +0 -8
  140. package/build-tsc-cjs/packageInfo.js +0 -4
  141. package/build-tsc-esm/generate/consts.js +0 -87
  142. package/build-tsc-esm/generate/errors.js +0 -55
  143. package/build-tsc-esm/generate/events.js +0 -135
  144. package/build-tsc-esm/generate/interfaceRegistry.js +0 -59
  145. package/build-tsc-esm/generate/lookup.js +0 -235
  146. package/build-tsc-esm/generate/query.js +0 -136
  147. package/build-tsc-esm/generate/rpc.js +0 -110
  148. package/build-tsc-esm/generate/runtime.js +0 -228
  149. package/build-tsc-esm/generate/tsDef.js +0 -246
  150. package/build-tsc-esm/generate/tx.js +0 -117
  151. package/build-tsc-esm/generate/types.js +0 -13
  152. package/build-tsc-esm/util/derived.js +0 -125
  153. package/src/augment.ts +0 -5
  154. package/src/bundle.ts +0 -5
  155. package/src/extractChain.ts +0 -54
  156. package/src/fromChain.ts +0 -123
  157. package/src/fromDefs.ts +0 -106
  158. package/src/generate/consts.ts +0 -112
  159. package/src/generate/errors.ts +0 -75
  160. package/src/generate/events.ts +0 -165
  161. package/src/generate/index.ts +0 -13
  162. package/src/generate/interfaceRegistry.ts +0 -85
  163. package/src/generate/lookup.ts +0 -322
  164. package/src/generate/query.ts +0 -169
  165. package/src/generate/rpc.ts +0 -158
  166. package/src/generate/runtime.ts +0 -293
  167. package/src/generate/tsDef.ts +0 -321
  168. package/src/generate/tx.ts +0 -152
  169. package/src/generate/types.ts +0 -26
  170. package/src/index.ts +0 -6
  171. package/src/interfacesTs.ts +0 -35
  172. package/src/metadataMd.ts +0 -844
  173. package/src/packageDetect.ts +0 -14
  174. package/src/packageInfo.ts +0 -6
  175. package/src/templates/calls.hbs +0 -30
  176. package/src/templates/consts.hbs +0 -28
  177. package/src/templates/docs.hbs +0 -7
  178. package/src/templates/errors.hbs +0 -28
  179. package/src/templates/events.hbs +0 -28
  180. package/src/templates/header.hbs +0 -2
  181. package/src/templates/interfaceRegistry.hbs +0 -15
  182. package/src/templates/lookup/defs-named.hbs +0 -12
  183. package/src/templates/lookup/defs.hbs +0 -15
  184. package/src/templates/lookup/index.hbs +0 -3
  185. package/src/templates/lookup/types.hbs +0 -14
  186. package/src/templates/query.hbs +0 -29
  187. package/src/templates/rpc.hbs +0 -22
  188. package/src/templates/tsDef/index.hbs +0 -3
  189. package/src/templates/tsDef/moduleTypes.hbs +0 -10
  190. package/src/templates/tsDef/types.hbs +0 -7
  191. package/src/templates/tx.hbs +0 -30
  192. package/src/util/assert.ts +0 -18
  193. package/src/util/derived.spec.ts +0 -58
  194. package/src/util/derived.ts +0 -133
  195. package/src/util/docs.ts +0 -13
  196. package/src/util/file.ts +0 -42
  197. package/src/util/formatting.spec.ts +0 -30
  198. package/src/util/formatting.ts +0 -322
  199. package/src/util/imports.ts +0 -164
  200. package/src/util/index.ts +0 -42
  201. package/src/util/initMeta.ts +0 -37
  202. package/src/util/register.ts +0 -12
  203. package/src/util/wsMeta.ts +0 -70
  204. package/tsconfig.build.json +0 -28
  205. package/tsconfig.build.tsbuildinfo +0 -1
  206. package/tsconfig.scripts.json +0 -19
  207. package/tsconfig.spec.json +0 -17
  208. package/tsconfig.spec.tsbuildinfo +0 -1
  209. /package/{build-tsc/augment.d.ts → augment.d.ts} +0 -0
  210. /package/{build-tsc-esm/augment.js → augment.js} +0 -0
  211. /package/{build-tsc/bundle.d.ts → bundle.d.ts} +0 -0
  212. /package/{build-tsc-esm/bundle.js → bundle.js} +0 -0
  213. /package/{build → cjs}/augment.d.ts +0 -0
  214. /package/{build-tsc-cjs → cjs}/augment.js +0 -0
  215. /package/{build → cjs}/bundle.d.ts +0 -0
  216. /package/{build-tsc-cjs → cjs}/bundle.js +0 -0
  217. /package/{build-tsc → cjs}/extractChain.d.ts +0 -0
  218. /package/{build-tsc-cjs → cjs}/extractChain.js +0 -0
  219. /package/{build-tsc → cjs}/fromChain.d.ts +0 -0
  220. /package/{build-tsc-cjs → cjs}/fromChain.js +0 -0
  221. /package/{build-tsc → cjs}/fromDefs.d.ts +0 -0
  222. /package/{build-tsc-cjs → cjs}/fromDefs.js +0 -0
  223. /package/{build-tsc → cjs}/generate/consts.d.ts +0 -0
  224. /package/{build-tsc-cjs → cjs}/generate/consts.js +0 -0
  225. /package/{build-tsc → cjs}/generate/errors.d.ts +0 -0
  226. /package/{build-tsc-cjs → cjs}/generate/errors.js +0 -0
  227. /package/{build-tsc → cjs}/generate/events.d.ts +0 -0
  228. /package/{build-tsc-cjs → cjs}/generate/events.js +0 -0
  229. /package/{build-tsc → cjs}/generate/index.d.ts +0 -0
  230. /package/{build-tsc-cjs → cjs}/generate/index.js +0 -0
  231. /package/{build-tsc → cjs}/generate/interfaceRegistry.d.ts +0 -0
  232. /package/{build-tsc-cjs → cjs}/generate/interfaceRegistry.js +0 -0
  233. /package/{build-tsc → cjs}/generate/lookup.d.ts +0 -0
  234. /package/{build-tsc → cjs}/generate/query.d.ts +0 -0
  235. /package/{build-tsc-cjs → cjs}/generate/query.js +0 -0
  236. /package/{build-tsc → cjs}/generate/rpc.d.ts +0 -0
  237. /package/{build-tsc-cjs → cjs}/generate/rpc.js +0 -0
  238. /package/{build-tsc → cjs}/generate/runtime.d.ts +0 -0
  239. /package/{build-tsc-cjs → cjs}/generate/runtime.js +0 -0
  240. /package/{build-tsc → cjs}/generate/tsDef.d.ts +0 -0
  241. /package/{build-tsc-cjs → cjs}/generate/tsDef.js +0 -0
  242. /package/{build-tsc → cjs}/generate/tx.d.ts +0 -0
  243. /package/{build-tsc-cjs → cjs}/generate/tx.js +0 -0
  244. /package/{build-tsc → cjs}/generate/types.d.ts +0 -0
  245. /package/{build-tsc-cjs → cjs}/generate/types.js +0 -0
  246. /package/{build-tsc → cjs}/index.d.ts +0 -0
  247. /package/{build-tsc-cjs → cjs}/index.js +0 -0
  248. /package/{build-tsc → cjs}/interfacesTs.d.ts +0 -0
  249. /package/{build-tsc-cjs → cjs}/interfacesTs.js +0 -0
  250. /package/{build-tsc → cjs}/metadataMd.d.ts +0 -0
  251. /package/{build-tsc-cjs → cjs}/metadataMd.js +0 -0
  252. /package/{build/cjs → cjs}/package.json +0 -0
  253. /package/{build-tsc → cjs}/packageDetect.d.ts +0 -0
  254. /package/{build/cjs → cjs}/packageDetect.js +0 -0
  255. /package/{build-tsc → cjs}/packageInfo.d.ts +0 -0
  256. /package/{build-tsc → cjs}/util/assert.d.ts +0 -0
  257. /package/{build-tsc-cjs → cjs}/util/assert.js +0 -0
  258. /package/{build-tsc → cjs}/util/derived.d.ts +0 -0
  259. /package/{build-tsc → cjs}/util/docs.d.ts +0 -0
  260. /package/{build-tsc-cjs → cjs}/util/docs.js +0 -0
  261. /package/{build-tsc → cjs}/util/file.d.ts +0 -0
  262. /package/{build-tsc-cjs → cjs}/util/file.js +0 -0
  263. /package/{build-tsc → cjs}/util/formatting.d.ts +0 -0
  264. /package/{build-tsc → cjs}/util/imports.d.ts +0 -0
  265. /package/{build-tsc-cjs → cjs}/util/imports.js +0 -0
  266. /package/{build-tsc → cjs}/util/index.d.ts +0 -0
  267. /package/{build-tsc-cjs → cjs}/util/index.js +0 -0
  268. /package/{build-tsc → cjs}/util/initMeta.d.ts +0 -0
  269. /package/{build-tsc-cjs → cjs}/util/initMeta.js +0 -0
  270. /package/{build-tsc → cjs}/util/register.d.ts +0 -0
  271. /package/{build-tsc-cjs → cjs}/util/register.js +0 -0
  272. /package/{build-tsc → cjs}/util/wsMeta.d.ts +0 -0
  273. /package/{build-tsc-cjs → cjs}/util/wsMeta.js +0 -0
  274. /package/{build/cjs/extractChain.d.ts → extractChain.d.ts} +0 -0
  275. /package/{build-tsc-esm/extractChain.js → extractChain.js} +0 -0
  276. /package/{build/cjs/fromChain.d.ts → fromChain.d.ts} +0 -0
  277. /package/{build-tsc-esm/fromChain.js → fromChain.js} +0 -0
  278. /package/{build/cjs/fromDefs.d.ts → fromDefs.d.ts} +0 -0
  279. /package/{build-tsc-esm/fromDefs.js → fromDefs.js} +0 -0
  280. /package/{build/cjs/generate → generate}/index.d.ts +0 -0
  281. /package/{build-tsc-esm/generate → generate}/index.js +0 -0
  282. /package/{build/cjs/index.d.ts → index.d.ts} +0 -0
  283. /package/{build-tsc-esm/index.js → index.js} +0 -0
  284. /package/{build/cjs/interfacesTs.d.ts → interfacesTs.d.ts} +0 -0
  285. /package/{build-tsc-esm/interfacesTs.js → interfacesTs.js} +0 -0
  286. /package/{build/cjs/metadataMd.d.ts → metadataMd.d.ts} +0 -0
  287. /package/{build-tsc-esm/metadataMd.js → metadataMd.js} +0 -0
  288. /package/{build/cjs/packageDetect.d.ts → packageDetect.d.ts} +0 -0
  289. /package/{build-tsc-esm/packageDetect.js → packageDetect.js} +0 -0
  290. /package/{build/cjs/packageInfo.d.ts → packageInfo.d.ts} +0 -0
  291. /package/{build/cjs/util → util}/assert.d.ts +0 -0
  292. /package/{build-tsc-esm/util → util}/assert.js +0 -0
  293. /package/{build/cjs/util → util}/derived.d.ts +0 -0
  294. /package/{build/cjs/util → util}/docs.d.ts +0 -0
  295. /package/{build-tsc-esm/util → util}/docs.js +0 -0
  296. /package/{build/cjs/util → util}/file.d.ts +0 -0
  297. /package/{build-tsc-esm/util → util}/file.js +0 -0
  298. /package/{build/cjs/util → util}/formatting.d.ts +0 -0
  299. /package/{build/cjs/util → util}/imports.d.ts +0 -0
  300. /package/{build-tsc-esm/util → util}/imports.js +0 -0
  301. /package/{build/cjs/util → util}/index.d.ts +0 -0
  302. /package/{build-tsc-esm/util → util}/index.js +0 -0
  303. /package/{build/cjs/util → util}/initMeta.d.ts +0 -0
  304. /package/{build-tsc-esm/util → util}/initMeta.js +0 -0
  305. /package/{build/cjs/util → util}/register.d.ts +0 -0
  306. /package/{build-tsc-esm/util → util}/register.js +0 -0
  307. /package/{build/cjs/util → util}/wsMeta.d.ts +0 -0
  308. /package/{build-tsc-esm/util → util}/wsMeta.js +0 -0
@@ -163,16 +163,45 @@ function generateLookupTypes(registry, filtered, destDir, subPath) {
163
163
  ...(0, index_js_1.createImports)({ '@pezkuwi/types/interfaces': defaultDefinitions }, { types: {} }),
164
164
  interfaces: []
165
165
  };
166
- const items = filtered
167
- .map(([, typeDef]) => {
168
- // Deep rebrand the type names (including nested sub types) before generating interfaces
169
- const rebranded = deepRebrandTypeDef(typeDef);
170
- return rebranded.lookupNameRoot && rebranded.lookupName
171
- ? (0, index_js_1.exportInterface)(rebranded.lookupIndex, rebranded.lookupName, rebranded.lookupNameRoot)
172
- : tsDef_js_1.typeEncoders[rebranded.info](registry, imports.definitions, rebranded, imports);
173
- })
174
- .filter((t) => !!t)
175
- .map((t) => t.replace(/\nexport /, '\n'));
166
+ // Special type mappings: PezkuwiChain types that should extend standard types
167
+ const TYPE_MAPPINGS = {
168
+ PezspCoreCryptoAccountId32: 'AccountId32',
169
+ PezspRuntimeMultiAddress: 'MultiAddress'
170
+ };
171
+ // Add imports for AccountId32 and MultiAddress - needed for all lookup files that use TYPE_MAPPINGS
172
+ const runtimePath = '@pezkuwi/types/interfaces/runtime';
173
+ if (imports.localTypes[runtimePath]) {
174
+ imports.localTypes[runtimePath]['AccountId32'] = true;
175
+ imports.localTypes[runtimePath]['MultiAddress'] = true;
176
+ }
177
+ // For non-bizinikiwi files, add base type definitions at the start
178
+ const baseTypeDefs = [];
179
+ if (subPath && subPath !== 'bizinikiwi') {
180
+ // Add PezspCoreCryptoAccountId32 and PezspRuntimeMultiAddress definitions
181
+ // These extend the standard types and are needed in all lookup files
182
+ baseTypeDefs.push(' /** @name PezspCoreCryptoAccountId32 (0) */\n interface PezspCoreCryptoAccountId32 extends AccountId32 {}', ' /** @name PezspRuntimeMultiAddress (1) */\n interface PezspRuntimeMultiAddress extends MultiAddress {}');
183
+ }
184
+ const items = [
185
+ ...baseTypeDefs,
186
+ ...filtered
187
+ .map(([, typeDef]) => {
188
+ // Deep rebrand the type names (including nested sub types) before generating interfaces
189
+ const rebranded = deepRebrandTypeDef(typeDef);
190
+ // Check for special type mappings first - skip if already in base types for this file
191
+ if (rebranded.lookupName && TYPE_MAPPINGS[rebranded.lookupName]) {
192
+ // For bizinikiwi, include the mapping; for others, skip (already in baseTypeDefs)
193
+ if (subPath === 'bizinikiwi') {
194
+ return (0, index_js_1.exportInterface)(rebranded.lookupIndex, rebranded.lookupName, TYPE_MAPPINGS[rebranded.lookupName]);
195
+ }
196
+ return null;
197
+ }
198
+ return rebranded.lookupNameRoot && rebranded.lookupName
199
+ ? (0, index_js_1.exportInterface)(rebranded.lookupIndex, rebranded.lookupName, rebranded.lookupNameRoot)
200
+ : tsDef_js_1.typeEncoders[rebranded.info](registry, imports.definitions, rebranded, imports);
201
+ })
202
+ .filter((t) => !!t)
203
+ .map((t) => t.replace(/\nexport /, '\n'))
204
+ ];
176
205
  (0, index_js_1.writeFile)(node_path_1.default.join(destDir, `types${subPath ? `-${subPath}` : ''}.ts`), () => generateLookupTypesTmpl({
177
206
  headerType: 'defs',
178
207
  imports,
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.packageInfo = void 0;
4
- exports.packageInfo = { name: '@pezkuwi/typegen', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '16.5.18' };
4
+ exports.packageInfo = { name: '@pezkuwi/typegen', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '16.5.31' };
@@ -32,6 +32,16 @@ function getSimilarTypes(registry, definitions, _type, imports) {
32
32
  else if (type === '()') {
33
33
  return ['null'];
34
34
  }
35
+ // Handle lookup types by name pattern before class-based checks
36
+ // Lookup types like PezspRuntimeMultiAddress may not be properly registered as children of GenericMultiAddress
37
+ if (type.includes('MultiAddress') || type.endsWith('RuntimeMultiAddress')) {
38
+ possibleTypes.push('AccountId', 'AccountIndex', 'Address', 'LookupSource', 'string', 'Uint8Array');
39
+ return possibleTypes;
40
+ }
41
+ else if (type.includes('AccountId32') || type.endsWith('CryptoAccountId32')) {
42
+ possibleTypes.push('string', 'Uint8Array');
43
+ return possibleTypes;
44
+ }
35
45
  const Clazz = registry.createClass(type);
36
46
  if ((0, util_1.isChildClass)(types_codec_1.Vec, Clazz)) {
37
47
  const vecDef = (0, types_create_1.getTypeDef)(type);
@@ -56,6 +66,11 @@ function getSimilarTypes(registry, definitions, _type, imports) {
56
66
  }
57
67
  }
58
68
  }
69
+ else if ((0, util_1.isChildClass)(generic_1.GenericMultiAddress, Clazz)) {
70
+ // MultiAddress can accept string addresses, Uint8Array, or various address variants
71
+ // Check before Enum since GenericMultiAddress extends Enum
72
+ possibleTypes.push('AccountId', 'AccountIndex', 'Address', 'LookupSource', 'string', 'Uint8Array');
73
+ }
59
74
  else if ((0, util_1.isChildClass)(types_codec_1.Enum, Clazz)) {
60
75
  const { defKeys, isBasic } = new Clazz(registry);
61
76
  const keys = defKeys.filter((v) => !v.startsWith('__Unused'));
@@ -187,6 +187,11 @@ const formatters = {
187
187
  [types_create_1.TypeDefInfo.VecFixed]: (registry, typeDef, definitions, imports, withShortcut) => {
188
188
  const sub = typeDef.sub;
189
189
  if (sub.type === 'u8') {
190
+ // Use lookupName if available (e.g., PezspCoreCryptoAccountId32) instead of generic U8aFixed
191
+ if (typeDef.lookupName) {
192
+ (0, imports_js_1.setImports)(definitions, imports, [rebrandTypeName(typeDef.lookupName)]);
193
+ return rebrandTypeName(typeDef.lookupName);
194
+ }
190
195
  (0, imports_js_1.setImports)(definitions, imports, ['U8aFixed']);
191
196
  return 'U8aFixed';
192
197
  }
@@ -158,16 +158,45 @@ function generateLookupTypes(registry, filtered, destDir, subPath) {
158
158
  ...createImports({ '@pezkuwi/types/interfaces': defaultDefinitions }, { types: {} }),
159
159
  interfaces: []
160
160
  };
161
- const items = filtered
162
- .map(([, typeDef]) => {
163
- // Deep rebrand the type names (including nested sub types) before generating interfaces
164
- const rebranded = deepRebrandTypeDef(typeDef);
165
- return rebranded.lookupNameRoot && rebranded.lookupName
166
- ? exportInterface(rebranded.lookupIndex, rebranded.lookupName, rebranded.lookupNameRoot)
167
- : typeEncoders[rebranded.info](registry, imports.definitions, rebranded, imports);
168
- })
169
- .filter((t) => !!t)
170
- .map((t) => t.replace(/\nexport /, '\n'));
161
+ // Special type mappings: PezkuwiChain types that should extend standard types
162
+ const TYPE_MAPPINGS = {
163
+ PezspCoreCryptoAccountId32: 'AccountId32',
164
+ PezspRuntimeMultiAddress: 'MultiAddress'
165
+ };
166
+ // Add imports for AccountId32 and MultiAddress - needed for all lookup files that use TYPE_MAPPINGS
167
+ const runtimePath = '@pezkuwi/types/interfaces/runtime';
168
+ if (imports.localTypes[runtimePath]) {
169
+ imports.localTypes[runtimePath]['AccountId32'] = true;
170
+ imports.localTypes[runtimePath]['MultiAddress'] = true;
171
+ }
172
+ // For non-bizinikiwi files, add base type definitions at the start
173
+ const baseTypeDefs = [];
174
+ if (subPath && subPath !== 'bizinikiwi') {
175
+ // Add PezspCoreCryptoAccountId32 and PezspRuntimeMultiAddress definitions
176
+ // These extend the standard types and are needed in all lookup files
177
+ baseTypeDefs.push(' /** @name PezspCoreCryptoAccountId32 (0) */\n interface PezspCoreCryptoAccountId32 extends AccountId32 {}', ' /** @name PezspRuntimeMultiAddress (1) */\n interface PezspRuntimeMultiAddress extends MultiAddress {}');
178
+ }
179
+ const items = [
180
+ ...baseTypeDefs,
181
+ ...filtered
182
+ .map(([, typeDef]) => {
183
+ // Deep rebrand the type names (including nested sub types) before generating interfaces
184
+ const rebranded = deepRebrandTypeDef(typeDef);
185
+ // Check for special type mappings first - skip if already in base types for this file
186
+ if (rebranded.lookupName && TYPE_MAPPINGS[rebranded.lookupName]) {
187
+ // For bizinikiwi, include the mapping; for others, skip (already in baseTypeDefs)
188
+ if (subPath === 'bizinikiwi') {
189
+ return exportInterface(rebranded.lookupIndex, rebranded.lookupName, TYPE_MAPPINGS[rebranded.lookupName]);
190
+ }
191
+ return null;
192
+ }
193
+ return rebranded.lookupNameRoot && rebranded.lookupName
194
+ ? exportInterface(rebranded.lookupIndex, rebranded.lookupName, rebranded.lookupNameRoot)
195
+ : typeEncoders[rebranded.info](registry, imports.definitions, rebranded, imports);
196
+ })
197
+ .filter((t) => !!t)
198
+ .map((t) => t.replace(/\nexport /, '\n'))
199
+ ];
171
200
  writeFile(path.join(destDir, `types${subPath ? `-${subPath}` : ''}.ts`), () => generateLookupTypesTmpl({
172
201
  headerType: 'defs',
173
202
  imports,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "author": "Jaco Greeff <jacogr@gmail.com>",
2
+ "author": "PezkuwiChain <dev@pezkuwichain.io>",
3
3
  "bugs": "https://github.com/pezkuwichain/pezkuwi-api/issues",
4
4
  "description": "Type generation scripts",
5
5
  "engines": {
@@ -18,10 +18,7 @@
18
18
  "./cjs/packageDetect.js"
19
19
  ],
20
20
  "type": "module",
21
- "types": "./index.d.ts",
22
- "version": "16.5.18",
23
- "main": "./cjs/index.js",
24
- "module": "./index.js",
21
+ "version": "16.5.31",
25
22
  "bin": {
26
23
  "pezkuwi-types-chain-info": "./scripts/pezkuwi-types-chain-info.mjs",
27
24
  "pezkuwi-types-from-chain": "./scripts/pezkuwi-types-from-chain.mjs",
@@ -29,7 +26,12 @@
29
26
  "pezkuwi-types-internal-interfaces": "./scripts/pezkuwi-types-internal-interfaces.mjs",
30
27
  "pezkuwi-types-internal-metadata": "./scripts/pezkuwi-types-internal-metadata.mjs"
31
28
  },
29
+ "main": "./cjs/index.js",
30
+ "module": "./cjs/index.js",
31
+ "types": "./cjs/index.d.ts",
32
32
  "exports": {
33
+ "./cjs/package.json": "./cjs/package.json",
34
+ "./cjs/*": "./cjs/*.js",
33
35
  ".": {
34
36
  "module": {
35
37
  "types": "./index.d.ts",
@@ -72,8 +74,6 @@
72
74
  "default": "./bundle.js"
73
75
  }
74
76
  },
75
- "./cjs/*": "./cjs/*.js",
76
- "./cjs/package.json": "./cjs/package.json",
77
77
  "./extractChain": {
78
78
  "module": {
79
79
  "types": "./extractChain.d.ts",
@@ -330,7 +330,7 @@
330
330
  "default": "./packageDetect.js"
331
331
  }
332
332
  },
333
- "./packageInfo": {
333
+ "./packageInfo.js": {
334
334
  "module": {
335
335
  "types": "./packageInfo.d.ts",
336
336
  "default": "./packageInfo.js"
@@ -344,7 +344,7 @@
344
344
  "default": "./packageInfo.js"
345
345
  }
346
346
  },
347
- "./packageInfo.js": {
347
+ "./packageInfo": {
348
348
  "module": {
349
349
  "types": "./packageInfo.d.ts",
350
350
  "default": "./packageInfo.js"
@@ -358,16 +358,16 @@
358
358
  "default": "./packageInfo.js"
359
359
  }
360
360
  },
361
- "./scripts/pezkuwi-types-chain-info": "./scripts/pezkuwi-types-chain-info.mjs",
362
361
  "./scripts/pezkuwi-types-chain-info.mjs": "./scripts/pezkuwi-types-chain-info.mjs",
363
- "./scripts/pezkuwi-types-from-chain": "./scripts/pezkuwi-types-from-chain.mjs",
362
+ "./scripts/pezkuwi-types-chain-info": "./scripts/pezkuwi-types-chain-info.mjs",
364
363
  "./scripts/pezkuwi-types-from-chain.mjs": "./scripts/pezkuwi-types-from-chain.mjs",
365
- "./scripts/pezkuwi-types-from-defs": "./scripts/pezkuwi-types-from-defs.mjs",
364
+ "./scripts/pezkuwi-types-from-chain": "./scripts/pezkuwi-types-from-chain.mjs",
366
365
  "./scripts/pezkuwi-types-from-defs.mjs": "./scripts/pezkuwi-types-from-defs.mjs",
367
- "./scripts/pezkuwi-types-internal-interfaces": "./scripts/pezkuwi-types-internal-interfaces.mjs",
366
+ "./scripts/pezkuwi-types-from-defs": "./scripts/pezkuwi-types-from-defs.mjs",
368
367
  "./scripts/pezkuwi-types-internal-interfaces.mjs": "./scripts/pezkuwi-types-internal-interfaces.mjs",
369
- "./scripts/pezkuwi-types-internal-metadata": "./scripts/pezkuwi-types-internal-metadata.mjs",
368
+ "./scripts/pezkuwi-types-internal-interfaces": "./scripts/pezkuwi-types-internal-interfaces.mjs",
370
369
  "./scripts/pezkuwi-types-internal-metadata.mjs": "./scripts/pezkuwi-types-internal-metadata.mjs",
370
+ "./scripts/pezkuwi-types-internal-metadata": "./scripts/pezkuwi-types-internal-metadata.mjs",
371
371
  "./templates/calls.hbs": "./templates/calls.hbs",
372
372
  "./templates/consts.hbs": "./templates/consts.hbs",
373
373
  "./templates/docs.hbs": "./templates/docs.hbs",
@@ -527,19 +527,19 @@
527
527
  }
528
528
  },
529
529
  "dependencies": {
530
- "@pezkuwi/api": "16.5.9",
531
- "@pezkuwi/api-augment": "16.5.9",
532
- "@pezkuwi/api-derive": "16.5.9",
533
- "@pezkuwi/rpc-augment": "16.5.9",
534
- "@pezkuwi/rpc-provider": "16.5.9",
535
- "@pezkuwi/types": "16.5.9",
536
- "@pezkuwi/types-augment": "16.5.9",
537
- "@pezkuwi/types-codec": "16.5.9",
538
- "@pezkuwi/types-create": "16.5.9",
539
- "@pezkuwi/types-support": "16.5.9",
540
- "@pezkuwi/util": "14.0.11",
541
- "@pezkuwi/util-crypto": "14.0.11",
542
- "@pezkuwi/x-ws": "14.0.11",
530
+ "@pezkuwi/api": "16.5.31",
531
+ "@pezkuwi/api-augment": "16.5.31",
532
+ "@pezkuwi/api-derive": "16.5.31",
533
+ "@pezkuwi/rpc-augment": "16.5.31",
534
+ "@pezkuwi/rpc-provider": "16.5.31",
535
+ "@pezkuwi/types": "16.5.31",
536
+ "@pezkuwi/types-augment": "16.5.31",
537
+ "@pezkuwi/types-codec": "16.5.31",
538
+ "@pezkuwi/types-create": "16.5.31",
539
+ "@pezkuwi/types-support": "16.5.31",
540
+ "@pezkuwi/util": "14.0.20",
541
+ "@pezkuwi/util-crypto": "14.0.20",
542
+ "@pezkuwi/x-ws": "14.0.20",
543
543
  "comment-parser": "^1.4.1",
544
544
  "handlebars": "^4.7.8",
545
545
  "tslib": "^2.8.1",
@@ -1 +1 @@
1
- export const packageInfo = { name: '@pezkuwi/typegen', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '16.5.18' };
1
+ export const packageInfo = { name: '@pezkuwi/typegen', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '16.5.31' };
@@ -1,4 +1,4 @@
1
- import { GenericAccountId, GenericCall, GenericLookupSource, GenericVote } from '@pezkuwi/types/generic';
1
+ import { GenericAccountId, GenericCall, GenericLookupSource, GenericMultiAddress, GenericVote } from '@pezkuwi/types/generic';
2
2
  import { AllConvictions } from '@pezkuwi/types/interfaces/democracy/definitions';
3
3
  import { AbstractInt, bool, Compact, Enum, Null, Option, Struct, Tuple, Vec, WrapperKeepOpaque, WrapperOpaque } from '@pezkuwi/types-codec';
4
4
  import { getTypeDef, TypeDefInfo } from '@pezkuwi/types-create';
@@ -29,6 +29,16 @@ export function getSimilarTypes(registry, definitions, _type, imports) {
29
29
  else if (type === '()') {
30
30
  return ['null'];
31
31
  }
32
+ // Handle lookup types by name pattern before class-based checks
33
+ // Lookup types like PezspRuntimeMultiAddress may not be properly registered as children of GenericMultiAddress
34
+ if (type.includes('MultiAddress') || type.endsWith('RuntimeMultiAddress')) {
35
+ possibleTypes.push('AccountId', 'AccountIndex', 'Address', 'LookupSource', 'string', 'Uint8Array');
36
+ return possibleTypes;
37
+ }
38
+ else if (type.includes('AccountId32') || type.endsWith('CryptoAccountId32')) {
39
+ possibleTypes.push('string', 'Uint8Array');
40
+ return possibleTypes;
41
+ }
32
42
  const Clazz = registry.createClass(type);
33
43
  if (isChildClass(Vec, Clazz)) {
34
44
  const vecDef = getTypeDef(type);
@@ -53,6 +63,11 @@ export function getSimilarTypes(registry, definitions, _type, imports) {
53
63
  }
54
64
  }
55
65
  }
66
+ else if (isChildClass(GenericMultiAddress, Clazz)) {
67
+ // MultiAddress can accept string addresses, Uint8Array, or various address variants
68
+ // Check before Enum since GenericMultiAddress extends Enum
69
+ possibleTypes.push('AccountId', 'AccountIndex', 'Address', 'LookupSource', 'string', 'Uint8Array');
70
+ }
56
71
  else if (isChildClass(Enum, Clazz)) {
57
72
  const { defKeys, isBasic } = new Clazz(registry);
58
73
  const keys = defKeys.filter((v) => !v.startsWith('__Unused'));
@@ -180,6 +180,11 @@ const formatters = {
180
180
  [TypeDefInfo.VecFixed]: (registry, typeDef, definitions, imports, withShortcut) => {
181
181
  const sub = typeDef.sub;
182
182
  if (sub.type === 'u8') {
183
+ // Use lookupName if available (e.g., PezspCoreCryptoAccountId32) instead of generic U8aFixed
184
+ if (typeDef.lookupName) {
185
+ setImports(definitions, imports, [rebrandTypeName(typeDef.lookupName)]);
186
+ return rebrandTypeName(typeDef.lookupName);
187
+ }
183
188
  setImports(definitions, imports, ['U8aFixed']);
184
189
  return 'U8aFixed';
185
190
  }
package/build/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
package/build/README.md DELETED
@@ -1,3 +0,0 @@
1
- # @pezkuwi/typegen
2
-
3
- A collection of type generation scripts, allowing the input of metadata and definitions for the creation of TS outputs.
package/build/augment.js DELETED
@@ -1,2 +0,0 @@
1
- import '@pezkuwi/api-augment';
2
- import '@pezkuwi/rpc-augment';
package/build/bundle.js DELETED
@@ -1,2 +0,0 @@
1
- export { packageInfo } from './packageInfo.js';
2
- export { formatType } from './util/formatting.js';
@@ -1,2 +0,0 @@
1
- import '@pezkuwi/api-augment';
2
- import '@pezkuwi/rpc-augment';
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("@pezkuwi/api-augment");
4
- require("@pezkuwi/rpc-augment");
@@ -1,2 +0,0 @@
1
- export { packageInfo } from './packageInfo.js';
2
- export { formatType } from './util/formatting.js';
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatType = exports.packageInfo = void 0;
4
- var packageInfo_js_1 = require("./packageInfo.js");
5
- Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
6
- var formatting_js_1 = require("./util/formatting.js");
7
- Object.defineProperty(exports, "formatType", { enumerable: true, get: function () { return formatting_js_1.formatType; } });
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.main = main;
4
- const tslib_1 = require("tslib");
5
- const node_process_1 = tslib_1.__importDefault(require("node:process"));
6
- const yargs_1 = tslib_1.__importDefault(require("yargs"));
7
- const helpers_1 = require("yargs/helpers");
8
- const api_1 = require("@pezkuwi/api");
9
- /** @internal */
10
- async function run(ws) {
11
- const provider = new api_1.WsProvider(ws);
12
- const api = await api_1.ApiPromise.create({ provider, throwOnConnect: true });
13
- const [chain, props] = await Promise.all([
14
- api.rpc.system.chain(),
15
- api.rpc.system.properties()
16
- ]);
17
- // output the chain info, for easy re-use
18
- console.error(`// Generated via 'yarn run chain:info ${ws}'\n\nexport default {\n chain: '${chain.toString()}',\n genesisHash: '${api.genesisHash.toHex()}',\n specVersion: ${api.runtimeVersion.specVersion.toNumber()},\n ss58Format: ${props.ss58Format.unwrapOr(42).toString()},\n tokenDecimals: ${props.tokenDecimals.unwrapOr(0).toString()},\n tokenSymbol: '${props.tokenSymbol.unwrapOr('UNIT').toString()}',\n metaCalls: '${Buffer.from(api.runtimeMetadata.asCallsOnly.toU8a()).toString('base64')}'\n};`);
19
- // show any missing types
20
- api.runtimeMetadata.getUniqTypes(false);
21
- }
22
- function main() {
23
- // retrieve and parse arguments - we do this globally, since this is a single command
24
- const { ws } = (0, yargs_1.default)((0, helpers_1.hideBin)(node_process_1.default.argv))
25
- .usage('Usage: [options]')
26
- .wrap(120)
27
- .strict()
28
- .options({
29
- ws: {
30
- default: 'ws://127.0.0.1:9944',
31
- description: 'The API endpoint to connect to, e.g. wss://dicle-rpc.pezkuwi.io',
32
- required: true,
33
- type: 'string'
34
- }
35
- }).argv;
36
- run(ws)
37
- .then(() => {
38
- node_process_1.default.exit(0);
39
- })
40
- .catch((error) => {
41
- console.error('FATAL:', error.message);
42
- node_process_1.default.exit(-1);
43
- });
44
- }