@pezkuwi/api-contract 16.5.8 → 16.5.9

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 (384) hide show
  1. package/bundle-pezkuwi-api-contract.js +1 -1
  2. package/cjs/packageInfo.js +1 -1
  3. package/package.json +13 -11
  4. package/packageInfo.js +1 -1
  5. package/build/Abi/index.d.ts +0 -31
  6. package/build/Abi/index.js +0 -359
  7. package/build/Abi/toLatestCompatible.d.ts +0 -15
  8. package/build/Abi/toLatestCompatible.js +0 -30
  9. package/build/Abi/toV1.d.ts +0 -3
  10. package/build/Abi/toV1.js +0 -21
  11. package/build/Abi/toV2.d.ts +0 -3
  12. package/build/Abi/toV2.js +0 -27
  13. package/build/Abi/toV3.d.ts +0 -3
  14. package/build/Abi/toV3.js +0 -10
  15. package/build/Abi/toV4.d.ts +0 -3
  16. package/build/Abi/toV4.js +0 -10
  17. package/build/LICENSE +0 -201
  18. package/build/README.md +0 -3
  19. package/build/augment.d.ts +0 -1
  20. package/build/augment.js +0 -1
  21. package/build/base/Base.d.ts +0 -13
  22. package/build/base/Base.js +0 -40
  23. package/build/base/Blueprint.d.ts +0 -24
  24. package/build/base/Blueprint.js +0 -51
  25. package/build/base/Code.d.ts +0 -22
  26. package/build/base/Code.js +0 -74
  27. package/build/base/Contract.d.ts +0 -25
  28. package/build/base/Contract.js +0 -127
  29. package/build/base/index.d.ts +0 -3
  30. package/build/base/index.js +0 -3
  31. package/build/base/mock.d.ts +0 -3
  32. package/build/base/mock.js +0 -38
  33. package/build/base/types.d.ts +0 -25
  34. package/build/base/types.js +0 -1
  35. package/build/base/util.d.ts +0 -16
  36. package/build/base/util.js +0 -33
  37. package/build/bundle-pezkuwi-api-contract.js +0 -1238
  38. package/build/bundle.d.ts +0 -4
  39. package/build/bundle.js +0 -4
  40. package/build/cjs/Abi/index.d.ts +0 -31
  41. package/build/cjs/Abi/index.js +0 -363
  42. package/build/cjs/Abi/toLatestCompatible.d.ts +0 -15
  43. package/build/cjs/Abi/toLatestCompatible.js +0 -36
  44. package/build/cjs/Abi/toV1.d.ts +0 -3
  45. package/build/cjs/Abi/toV1.js +0 -24
  46. package/build/cjs/Abi/toV2.d.ts +0 -3
  47. package/build/cjs/Abi/toV2.js +0 -30
  48. package/build/cjs/Abi/toV3.d.ts +0 -3
  49. package/build/cjs/Abi/toV3.js +0 -13
  50. package/build/cjs/Abi/toV4.d.ts +0 -3
  51. package/build/cjs/Abi/toV4.js +0 -13
  52. package/build/cjs/augment.d.ts +0 -1
  53. package/build/cjs/augment.js +0 -3
  54. package/build/cjs/base/Base.d.ts +0 -13
  55. package/build/cjs/base/Base.js +0 -44
  56. package/build/cjs/base/Blueprint.d.ts +0 -24
  57. package/build/cjs/base/Blueprint.js +0 -57
  58. package/build/cjs/base/Code.d.ts +0 -22
  59. package/build/cjs/base/Code.js +0 -80
  60. package/build/cjs/base/Contract.d.ts +0 -25
  61. package/build/cjs/base/Contract.js +0 -133
  62. package/build/cjs/base/index.d.ts +0 -3
  63. package/build/cjs/base/index.js +0 -14
  64. package/build/cjs/base/mock.d.ts +0 -3
  65. package/build/cjs/base/mock.js +0 -41
  66. package/build/cjs/base/types.d.ts +0 -25
  67. package/build/cjs/base/types.js +0 -2
  68. package/build/cjs/base/util.d.ts +0 -16
  69. package/build/cjs/base/util.js +0 -42
  70. package/build/cjs/bundle.d.ts +0 -4
  71. package/build/cjs/bundle.js +0 -10
  72. package/build/cjs/index.d.ts +0 -2
  73. package/build/cjs/index.js +0 -5
  74. package/build/cjs/package.json +0 -3
  75. package/build/cjs/packageDetect.d.ts +0 -1
  76. package/build/cjs/packageDetect.js +0 -7
  77. package/build/cjs/packageInfo.d.ts +0 -6
  78. package/build/cjs/packageInfo.js +0 -4
  79. package/build/cjs/promise/index.d.ts +0 -13
  80. package/build/cjs/promise/index.js +0 -23
  81. package/build/cjs/promise/types.d.ts +0 -3
  82. package/build/cjs/promise/types.js +0 -2
  83. package/build/cjs/rx/index.d.ts +0 -13
  84. package/build/cjs/rx/index.js +0 -23
  85. package/build/cjs/rx/types.d.ts +0 -3
  86. package/build/cjs/rx/types.js +0 -2
  87. package/build/cjs/types.d.ts +0 -79
  88. package/build/cjs/types.js +0 -2
  89. package/build/cjs/util.d.ts +0 -5
  90. package/build/cjs/util.js +0 -13
  91. package/build/index.d.ts +0 -2
  92. package/build/index.js +0 -2
  93. package/build/package.json +0 -408
  94. package/build/packageDetect.d.ts +0 -1
  95. package/build/packageDetect.js +0 -5
  96. package/build/packageInfo.d.ts +0 -6
  97. package/build/packageInfo.js +0 -1
  98. package/build/promise/index.d.ts +0 -13
  99. package/build/promise/index.js +0 -17
  100. package/build/promise/types.d.ts +0 -3
  101. package/build/promise/types.js +0 -1
  102. package/build/rx/index.d.ts +0 -13
  103. package/build/rx/index.js +0 -17
  104. package/build/rx/types.d.ts +0 -3
  105. package/build/rx/types.js +0 -1
  106. package/build/types.d.ts +0 -79
  107. package/build/types.js +0 -1
  108. package/build/util.d.ts +0 -5
  109. package/build/util.js +0 -10
  110. package/build-deno/Abi/index.ts +0 -475
  111. package/build-deno/Abi/toLatestCompatible.ts +0 -47
  112. package/build-deno/Abi/toV1.ts +0 -33
  113. package/build-deno/Abi/toV2.ts +0 -56
  114. package/build-deno/Abi/toV3.ts +0 -16
  115. package/build-deno/Abi/toV4.ts +0 -19
  116. package/build-deno/README.md +0 -3
  117. package/build-deno/augment.ts +0 -2
  118. package/build-deno/base/Base.ts +0 -50
  119. package/build-deno/base/Blueprint.ts +0 -88
  120. package/build-deno/base/Code.ts +0 -140
  121. package/build-deno/base/Contract.ts +0 -194
  122. package/build-deno/base/index.ts +0 -4
  123. package/build-deno/base/mock.ts +0 -46
  124. package/build-deno/base/types.ts +0 -38
  125. package/build-deno/base/util.ts +0 -54
  126. package/build-deno/bundle.ts +0 -6
  127. package/build-deno/checkTypes.manual.ts +0 -42
  128. package/build-deno/index.ts +0 -4
  129. package/build-deno/mod.ts +0 -2
  130. package/build-deno/packageDetect.ts +0 -9
  131. package/build-deno/packageInfo.ts +0 -3
  132. package/build-deno/promise/index.ts +0 -28
  133. package/build-deno/promise/types.ts +0 -5
  134. package/build-deno/rx/index.ts +0 -28
  135. package/build-deno/rx/types.ts +0 -5
  136. package/build-deno/test/contracts/index.ts +0 -18
  137. package/build-deno/test/contracts/ink/index.ts +0 -11
  138. package/build-deno/test/contracts/ink/v0/accumulator.wasm +0 -0
  139. package/build-deno/test/contracts/ink/v0/adder.wasm +0 -0
  140. package/build-deno/test/contracts/ink/v0/delegator.wasm +0 -0
  141. package/build-deno/test/contracts/ink/v0/dns.wasm +0 -0
  142. package/build-deno/test/contracts/ink/v0/erc20.wasm +0 -0
  143. package/build-deno/test/contracts/ink/v0/erc721.wasm +0 -0
  144. package/build-deno/test/contracts/ink/v0/flipper.wasm +0 -0
  145. package/build-deno/test/contracts/ink/v0/incrementer.wasm +0 -0
  146. package/build-deno/test/contracts/ink/v0/index.ts +0 -9
  147. package/build-deno/test/contracts/ink/v0/multisig_plain.wasm +0 -0
  148. package/build-deno/test/contracts/ink/v0/subber.wasm +0 -0
  149. package/build-deno/test/contracts/ink/v0/trait-flipper.wasm +0 -0
  150. package/build-deno/test/contracts/ink/v1/index.ts +0 -3
  151. package/build-deno/test/contracts/ink/v2/index.ts +0 -3
  152. package/build-deno/test/contracts/ink/v3/index.ts +0 -3
  153. package/build-deno/test/contracts/ink/v4/erc20.wasm +0 -0
  154. package/build-deno/test/contracts/ink/v4/flipper.wasm +0 -0
  155. package/build-deno/test/contracts/ink/v4/index.ts +0 -5
  156. package/build-deno/test/contracts/ink/v5/erc20.wasm +0 -0
  157. package/build-deno/test/contracts/ink/v5/flipper.wasm +0 -0
  158. package/build-deno/test/contracts/ink/v5/index.ts +0 -6
  159. package/build-deno/test/contracts/ink/v6/erc20.polkavm +0 -0
  160. package/build-deno/test/contracts/ink/v6/index.ts +0 -3
  161. package/build-deno/test/contracts/solang/index.ts +0 -5
  162. package/build-deno/test/contracts/solang/v0/index.ts +0 -2
  163. package/build-deno/test/contracts/solang/v0/ints256.sol +0 -13
  164. package/build-deno/test/contracts/solang/v0/ints256.wasm +0 -0
  165. package/build-deno/test/contracts/user/index.ts +0 -7
  166. package/build-deno/test/contracts/user/v0/assetTransfer.wasm +0 -0
  167. package/build-deno/test/contracts/user/v0/enumExample.wasm +0 -0
  168. package/build-deno/test/contracts/user/v0/index.ts +0 -5
  169. package/build-deno/test/contracts/user/v3/index.ts +0 -2
  170. package/build-deno/test/contracts/user/v4/index.ts +0 -2
  171. package/build-deno/test/contracts/util.ts +0 -12
  172. package/build-deno/types.ts +0 -95
  173. package/build-deno/util.ts +0 -18
  174. package/build-tsc/Abi/index.d.ts +0 -31
  175. package/build-tsc/Abi/toLatestCompatible.d.ts +0 -15
  176. package/build-tsc/Abi/toV1.d.ts +0 -3
  177. package/build-tsc/Abi/toV2.d.ts +0 -3
  178. package/build-tsc/Abi/toV3.d.ts +0 -3
  179. package/build-tsc/Abi/toV4.d.ts +0 -3
  180. package/build-tsc/augment.d.ts +0 -1
  181. package/build-tsc/base/Base.d.ts +0 -13
  182. package/build-tsc/base/Blueprint.d.ts +0 -24
  183. package/build-tsc/base/Code.d.ts +0 -22
  184. package/build-tsc/base/Contract.d.ts +0 -25
  185. package/build-tsc/base/index.d.ts +0 -3
  186. package/build-tsc/base/mock.d.ts +0 -3
  187. package/build-tsc/base/types.d.ts +0 -25
  188. package/build-tsc/base/util.d.ts +0 -16
  189. package/build-tsc/bundle.d.ts +0 -4
  190. package/build-tsc/index.d.ts +0 -2
  191. package/build-tsc/packageDetect.d.ts +0 -1
  192. package/build-tsc/packageInfo.d.ts +0 -6
  193. package/build-tsc/promise/index.d.ts +0 -13
  194. package/build-tsc/promise/types.d.ts +0 -3
  195. package/build-tsc/rx/index.d.ts +0 -13
  196. package/build-tsc/rx/types.d.ts +0 -3
  197. package/build-tsc/types.d.ts +0 -79
  198. package/build-tsc/util.d.ts +0 -5
  199. package/build-tsc-cjs/Abi/index.js +0 -363
  200. package/build-tsc-cjs/Abi/toLatestCompatible.js +0 -36
  201. package/build-tsc-cjs/Abi/toV1.js +0 -24
  202. package/build-tsc-cjs/Abi/toV2.js +0 -30
  203. package/build-tsc-cjs/Abi/toV3.js +0 -13
  204. package/build-tsc-cjs/Abi/toV4.js +0 -13
  205. package/build-tsc-cjs/augment.js +0 -3
  206. package/build-tsc-cjs/base/Base.js +0 -44
  207. package/build-tsc-cjs/base/Blueprint.js +0 -57
  208. package/build-tsc-cjs/base/Code.js +0 -80
  209. package/build-tsc-cjs/base/Contract.js +0 -133
  210. package/build-tsc-cjs/base/index.js +0 -14
  211. package/build-tsc-cjs/base/mock.js +0 -41
  212. package/build-tsc-cjs/base/types.js +0 -2
  213. package/build-tsc-cjs/base/util.js +0 -42
  214. package/build-tsc-cjs/bundle.js +0 -10
  215. package/build-tsc-cjs/index.js +0 -5
  216. package/build-tsc-cjs/packageDetect.js +0 -7
  217. package/build-tsc-cjs/packageInfo.js +0 -4
  218. package/build-tsc-cjs/promise/index.js +0 -23
  219. package/build-tsc-cjs/promise/types.js +0 -2
  220. package/build-tsc-cjs/rx/index.js +0 -23
  221. package/build-tsc-cjs/rx/types.js +0 -2
  222. package/build-tsc-cjs/types.js +0 -2
  223. package/build-tsc-cjs/util.js +0 -13
  224. package/build-tsc-esm/Abi/index.js +0 -359
  225. package/build-tsc-esm/Abi/toLatestCompatible.js +0 -30
  226. package/build-tsc-esm/Abi/toV1.js +0 -21
  227. package/build-tsc-esm/Abi/toV2.js +0 -27
  228. package/build-tsc-esm/Abi/toV3.js +0 -10
  229. package/build-tsc-esm/Abi/toV4.js +0 -10
  230. package/build-tsc-esm/augment.js +0 -1
  231. package/build-tsc-esm/base/Base.js +0 -40
  232. package/build-tsc-esm/base/Blueprint.js +0 -51
  233. package/build-tsc-esm/base/Code.js +0 -74
  234. package/build-tsc-esm/base/Contract.js +0 -127
  235. package/build-tsc-esm/base/index.js +0 -3
  236. package/build-tsc-esm/base/mock.js +0 -38
  237. package/build-tsc-esm/base/types.js +0 -1
  238. package/build-tsc-esm/base/util.js +0 -33
  239. package/build-tsc-esm/bundle.js +0 -4
  240. package/build-tsc-esm/index.js +0 -2
  241. package/build-tsc-esm/packageDetect.js +0 -5
  242. package/build-tsc-esm/packageInfo.js +0 -1
  243. package/build-tsc-esm/promise/index.js +0 -17
  244. package/build-tsc-esm/promise/types.js +0 -1
  245. package/build-tsc-esm/rx/index.js +0 -17
  246. package/build-tsc-esm/rx/types.js +0 -1
  247. package/build-tsc-esm/types.js +0 -1
  248. package/build-tsc-esm/util.js +0 -10
  249. package/src/Abi/Abi.spec.ts +0 -235
  250. package/src/Abi/index.ts +0 -477
  251. package/src/Abi/toLatestCompatible.spec.ts +0 -219
  252. package/src/Abi/toLatestCompatible.ts +0 -52
  253. package/src/Abi/toV1.ts +0 -35
  254. package/src/Abi/toV2.ts +0 -58
  255. package/src/Abi/toV3.ts +0 -18
  256. package/src/Abi/toV4.ts +0 -21
  257. package/src/augment.ts +0 -4
  258. package/src/base/Base.ts +0 -52
  259. package/src/base/Blueprint.ts +0 -90
  260. package/src/base/Code.spec.ts +0 -47
  261. package/src/base/Code.ts +0 -142
  262. package/src/base/Contract.ts +0 -197
  263. package/src/base/index.ts +0 -6
  264. package/src/base/mock.ts +0 -48
  265. package/src/base/types.ts +0 -40
  266. package/src/base/util.ts +0 -56
  267. package/src/bundle.ts +0 -10
  268. package/src/checkTypes.manual.ts +0 -45
  269. package/src/index.ts +0 -6
  270. package/src/mod.ts +0 -4
  271. package/src/packageDetect.ts +0 -13
  272. package/src/packageInfo.ts +0 -6
  273. package/src/promise/index.ts +0 -28
  274. package/src/promise/types.ts +0 -7
  275. package/src/rx/index.ts +0 -28
  276. package/src/rx/types.ts +0 -7
  277. package/src/test/compare/ink_v0_delegator.test.json +0 -47
  278. package/src/test/compare/ink_v0_dns.test.json +0 -232
  279. package/src/test/compare/ink_v0_erc20.test.json +0 -253
  280. package/src/test/compare/ink_v0_erc721.test.json +0 -415
  281. package/src/test/compare/ink_v0_flipper.test.json +0 -9
  282. package/src/test/compare/ink_v0_flipperBundle.test.json +0 -9
  283. package/src/test/compare/ink_v0_incrementer.test.json +0 -9
  284. package/src/test/compare/ink_v0_multisigPlain.test.json +0 -562
  285. package/src/test/compare/ink_v1_flipper.test.json +0 -9
  286. package/src/test/compare/ink_v1_psp22.test.json +0 -531
  287. package/src/test/compare/ink_v2_erc20.test.json +0 -205
  288. package/src/test/compare/ink_v2_flipper.test.json +0 -9
  289. package/src/test/compare/ink_v3_flipper.test.json +0 -9
  290. package/src/test/compare/ink_v3_traitErc20.test.json +0 -205
  291. package/src/test/compare/ink_v4_erc20Contract.test.json +0 -253
  292. package/src/test/compare/ink_v4_erc20Metadata.test.json +0 -253
  293. package/src/test/compare/ink_v4_flipperContract.test.json +0 -155
  294. package/src/test/compare/ink_v4_flipperMetadata.test.json +0 -155
  295. package/src/test/compare/ink_v5_erc20.test.json +0 -370
  296. package/src/test/compare/ink_v5_erc20AnonymousTransferMetadata.test.json +0 -370
  297. package/src/test/compare/ink_v5_erc20Contract.test.json +0 -370
  298. package/src/test/compare/ink_v5_erc20Metadata.test.json +0 -370
  299. package/src/test/compare/ink_v5_flipperContract.test.json +0 -174
  300. package/src/test/compare/ink_v5_flipperMetadata.test.json +0 -174
  301. package/src/test/compare/ink_v6_erc20Contract.test.json +0 -418
  302. package/src/test/compare/ink_v6_erc20Metadata.test.json +0 -418
  303. package/src/test/compare/solang_v0_ints256.test.json +0 -9
  304. package/src/test/compare/user_v0_assetTransfer.test.json +0 -54
  305. package/src/test/compare/user_v0_enumExample.test.json +0 -303
  306. package/src/test/compare/user_v0_recursive.test.json +0 -27
  307. package/src/test/compare/user_v0_withString.test.json +0 -260
  308. package/src/test/compare/user_v3_ask.test.json +0 -71
  309. package/src/test/compare/user_v4_events.test.json +0 -1328
  310. package/src/test/contracts/index.ts +0 -20
  311. package/src/test/contracts/ink/index.ts +0 -13
  312. package/src/test/contracts/ink/v0/accumulator.wasm +0 -0
  313. package/src/test/contracts/ink/v0/adder.wasm +0 -0
  314. package/src/test/contracts/ink/v0/delegator.json +0 -252
  315. package/src/test/contracts/ink/v0/delegator.wasm +0 -0
  316. package/src/test/contracts/ink/v0/dns.json +0 -713
  317. package/src/test/contracts/ink/v0/dns.wasm +0 -0
  318. package/src/test/contracts/ink/v0/erc20.json +0 -704
  319. package/src/test/contracts/ink/v0/erc20.wasm +0 -0
  320. package/src/test/contracts/ink/v0/erc721.json +0 -1197
  321. package/src/test/contracts/ink/v0/erc721.wasm +0 -0
  322. package/src/test/contracts/ink/v0/flipper.contract.json +0 -107
  323. package/src/test/contracts/ink/v0/flipper.json +0 -106
  324. package/src/test/contracts/ink/v0/flipper.wasm +0 -0
  325. package/src/test/contracts/ink/v0/incrementer.json +0 -108
  326. package/src/test/contracts/ink/v0/incrementer.wasm +0 -0
  327. package/src/test/contracts/ink/v0/index.ts +0 -11
  328. package/src/test/contracts/ink/v0/multisig_plain.json +0 -1466
  329. package/src/test/contracts/ink/v0/multisig_plain.wasm +0 -0
  330. package/src/test/contracts/ink/v0/subber.wasm +0 -0
  331. package/src/test/contracts/ink/v0/trait-flipper.json +0 -103
  332. package/src/test/contracts/ink/v0/trait-flipper.wasm +0 -0
  333. package/src/test/contracts/ink/v1/flipper.contract.json +0 -111
  334. package/src/test/contracts/ink/v1/index.ts +0 -6
  335. package/src/test/contracts/ink/v1/psp22_minter_pauser.contract.json +0 -1722
  336. package/src/test/contracts/ink/v2/erc20.contract.json +0 -630
  337. package/src/test/contracts/ink/v2/flipper.contract.json +0 -103
  338. package/src/test/contracts/ink/v2/index.ts +0 -5
  339. package/src/test/contracts/ink/v3/flipper.contract.json +0 -105
  340. package/src/test/contracts/ink/v3/index.ts +0 -6
  341. package/src/test/contracts/ink/v3/trait_erc20.contract.json +0 -631
  342. package/src/test/contracts/ink/v4/erc20.contract.json +0 -1
  343. package/src/test/contracts/ink/v4/erc20.json +0 -821
  344. package/src/test/contracts/ink/v4/erc20.wasm +0 -0
  345. package/src/test/contracts/ink/v4/flipper.contract.json +0 -1
  346. package/src/test/contracts/ink/v4/flipper.json +0 -396
  347. package/src/test/contracts/ink/v4/flipper.wasm +0 -0
  348. package/src/test/contracts/ink/v4/index.ts +0 -7
  349. package/src/test/contracts/ink/v5/erc20.contract.json +0 -1
  350. package/src/test/contracts/ink/v5/erc20.json +0 -1025
  351. package/src/test/contracts/ink/v5/erc20.wasm +0 -0
  352. package/src/test/contracts/ink/v5/erc20_anonymous_transfer.json +0 -1025
  353. package/src/test/contracts/ink/v5/flipper.contract.json +0 -1
  354. package/src/test/contracts/ink/v5/flipper.json +0 -420
  355. package/src/test/contracts/ink/v5/flipper.wasm +0 -0
  356. package/src/test/contracts/ink/v5/index.ts +0 -8
  357. package/src/test/contracts/ink/v6/erc20.contract.json +0 -1
  358. package/src/test/contracts/ink/v6/erc20.json +0 -1081
  359. package/src/test/contracts/ink/v6/erc20.polkavm +0 -0
  360. package/src/test/contracts/ink/v6/index.ts +0 -5
  361. package/src/test/contracts/solang/index.ts +0 -7
  362. package/src/test/contracts/solang/v0/index.ts +0 -4
  363. package/src/test/contracts/solang/v0/ints256.json +0 -113
  364. package/src/test/contracts/solang/v0/ints256.sol +0 -13
  365. package/src/test/contracts/solang/v0/ints256.wasm +0 -0
  366. package/src/test/contracts/user/index.ts +0 -9
  367. package/src/test/contracts/user/v0/assetTransfer.json +0 -299
  368. package/src/test/contracts/user/v0/assetTransfer.wasm +0 -0
  369. package/src/test/contracts/user/v0/enumExample.json +0 -528
  370. package/src/test/contracts/user/v0/enumExample.wasm +0 -0
  371. package/src/test/contracts/user/v0/index.ts +0 -7
  372. package/src/test/contracts/user/v0/recursive.contract.json +0 -1
  373. package/src/test/contracts/user/v0/withString.json +0 -777
  374. package/src/test/contracts/user/v3/ask.json +0 -550
  375. package/src/test/contracts/user/v3/index.ts +0 -4
  376. package/src/test/contracts/user/v4/events.contract.json +0 -2990
  377. package/src/test/contracts/user/v4/index.ts +0 -4
  378. package/src/test/contracts/util.ts +0 -14
  379. package/src/types.ts +0 -98
  380. package/src/util.ts +0 -20
  381. package/tsconfig.build.json +0 -22
  382. package/tsconfig.build.tsbuildinfo +0 -1
  383. package/tsconfig.spec.json +0 -26
  384. package/tsconfig.spec.tsbuildinfo +0 -1
@@ -440,7 +440,7 @@
440
440
  };
441
441
  }
442
442
 
443
- const packageInfo = { name: '@pezkuwi/api-contract', path: (({ url: (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('bundle-pezkuwi-api-contract.js', document.baseURI).href)) }) && (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('bundle-pezkuwi-api-contract.js', document.baseURI).href))) ? new URL((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('bundle-pezkuwi-api-contract.js', document.baseURI).href))).pathname.substring(0, new URL((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('bundle-pezkuwi-api-contract.js', document.baseURI).href))).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '16.5.8' };
443
+ const packageInfo = { name: '@pezkuwi/api-contract', path: (({ url: (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('bundle-pezkuwi-api-contract.js', document.baseURI).href)) }) && (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('bundle-pezkuwi-api-contract.js', document.baseURI).href))) ? new URL((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('bundle-pezkuwi-api-contract.js', document.baseURI).href))).pathname.substring(0, new URL((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('bundle-pezkuwi-api-contract.js', document.baseURI).href))).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '16.5.9' };
444
444
 
445
445
  function applyOnEvent(result, types, fn, isRevive) {
446
446
  if (result.isInBlock || result.isFinalized) {
@@ -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/api-contract', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '16.5.8' };
4
+ exports.packageInfo = { name: '@pezkuwi/api-contract', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '16.5.9' };
package/package.json CHANGED
@@ -18,10 +18,10 @@
18
18
  "./cjs/packageDetect.js"
19
19
  ],
20
20
  "type": "module",
21
- "version": "16.5.8",
22
- "main": "./cjs/index.js",
23
- "module": "./index.js",
24
- "types": "./index.d.ts",
21
+ "version": "16.5.9",
22
+ "main": "./cjs/cjs/index.js",
23
+ "module": "./cjs/index.js",
24
+ "types": "./cjs/index.d.ts",
25
25
  "exports": {
26
26
  "./cjs/package.json": "./cjs/package.json",
27
27
  "./cjs/*": "./cjs/*.js",
@@ -395,13 +395,15 @@
395
395
  }
396
396
  },
397
397
  "dependencies": {
398
- "@pezkuwi/api": "workspace:*",
399
- "@pezkuwi/api-augment": "workspace:*",
400
- "@pezkuwi/types": "workspace:*",
401
- "@pezkuwi/types-codec": "workspace:*",
402
- "@pezkuwi/types-create": "workspace:*",
403
- "@pezkuwi/util": "^14.0.1",
404
- "@pezkuwi/util-crypto": "^14.0.1",
398
+ "@pezkuwi/api": "16.5.9",
399
+ "@pezkuwi/api-augment": "16.5.9",
400
+ "@pezkuwi/keyring": "14.0.11",
401
+ "@pezkuwi/types": "16.5.9",
402
+ "@pezkuwi/types-codec": "16.5.9",
403
+ "@pezkuwi/types-create": "16.5.9",
404
+ "@pezkuwi/types-support": "16.5.9",
405
+ "@pezkuwi/util": "14.0.11",
406
+ "@pezkuwi/util-crypto": "14.0.11",
405
407
  "rxjs": "^7.8.1",
406
408
  "tslib": "^2.8.1"
407
409
  }
package/packageInfo.js CHANGED
@@ -1 +1 @@
1
- export const packageInfo = { name: '@pezkuwi/api-contract', 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.8' };
1
+ export const packageInfo = { name: '@pezkuwi/api-contract', 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.9' };
@@ -1,31 +0,0 @@
1
- import type { ChainProperties, ContractMetadataV4, ContractMetadataV5, ContractMetadataV6, ContractProjectInfo, EventRecord } from '@pezkuwi/types/interfaces';
2
- import type { Codec, Registry, TypeDef } from '@pezkuwi/types/types';
3
- import type { AbiConstructor, AbiEvent, AbiMessage, DecodedEvent, DecodedMessage } from '../types.js';
4
- export type ContractMetadataSupported = ContractMetadataV4 | ContractMetadataV5 | ContractMetadataV6;
5
- export declare class Abi {
6
- #private;
7
- readonly events: AbiEvent[];
8
- readonly constructors: AbiConstructor[];
9
- readonly info: ContractProjectInfo;
10
- readonly json: Record<string, unknown>;
11
- readonly messages: AbiMessage[];
12
- readonly metadata: ContractMetadataSupported;
13
- readonly registry: Registry;
14
- readonly environment: Map<string, TypeDef | Codec>;
15
- readonly isRevive: boolean;
16
- constructor(abiJson: Record<string, unknown> | string, chainProperties?: ChainProperties);
17
- /**
18
- * Warning: Unstable API, bound to change
19
- */
20
- decodeEvent(record: EventRecord): DecodedEvent;
21
- /**
22
- * Warning: Unstable API, bound to change
23
- */
24
- decodeConstructor(data: Uint8Array): DecodedMessage;
25
- /**
26
- * Warning: Unstable API, bound to change
27
- */
28
- decodeMessage(data: Uint8Array): DecodedMessage;
29
- findConstructor(constructorOrId: AbiConstructor | string | number): AbiConstructor;
30
- findMessage(messageOrId: AbiMessage | string | number): AbiMessage;
31
- }
@@ -1,359 +0,0 @@
1
- import { Option, TypeRegistry } from '@pezkuwi/types';
2
- import { TypeDefInfo } from '@pezkuwi/types-create';
3
- import { assertReturn, compactAddLength, compactStripLength, isBn, isNumber, isObject, isString, isUndefined, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@pezkuwi/util';
4
- import { convertVersions, enumVersions } from './toLatestCompatible.js';
5
- const l = logger('Abi');
6
- const PRIMITIVE_ALWAYS = ['AccountId', 'AccountId20', 'AccountIndex', 'Address', 'Balance'];
7
- function findMessage(list, messageOrId) {
8
- const message = isNumber(messageOrId)
9
- ? list[messageOrId]
10
- : isString(messageOrId)
11
- ? list.find(({ identifier }) => [identifier, stringCamelCase(identifier)].includes(messageOrId.toString()))
12
- : messageOrId;
13
- return assertReturn(message, () => `Attempted to call an invalid contract interface, ${stringify(messageOrId)}`);
14
- }
15
- function getMetadata(registry, json) {
16
- // this is for V1, V2, V3
17
- const vx = enumVersions.find((v) => isObject(json[v]));
18
- // this was added in V4
19
- const jsonVersion = json.version;
20
- if (!vx && jsonVersion && !enumVersions.find((v) => v === `V${jsonVersion}`)) {
21
- throw new Error(`Unable to handle version ${jsonVersion}`);
22
- }
23
- const metadata = registry.createType('ContractMetadata', vx
24
- ? { [vx]: json[vx] }
25
- : jsonVersion
26
- ? { [`V${jsonVersion}`]: json }
27
- : { V0: json });
28
- const converter = convertVersions.find(([v]) => metadata[`is${v}`]);
29
- if (!converter) {
30
- throw new Error(`Unable to convert ABI with version ${metadata.type} to a supported version`);
31
- }
32
- const upgradedMetadata = converter[1](registry, metadata[`as${converter[0]}`]);
33
- return upgradedMetadata;
34
- }
35
- function isRevive(json) {
36
- const source = json['source'];
37
- const version = json['version'];
38
- const hasContractBinary = typeof source === 'object' &&
39
- source !== null &&
40
- 'contract_binary' in source;
41
- const hasVersion = typeof version === 'number' && version >= 6;
42
- return hasContractBinary || hasVersion;
43
- }
44
- function parseJson(json, chainProperties) {
45
- const registry = new TypeRegistry();
46
- const revive = isRevive(json);
47
- const typeName = revive ? 'ContractReviveProjectInfo' : 'ContractProjectInfo';
48
- const info = registry.createType(typeName, json);
49
- const metadata = getMetadata(registry, json);
50
- const lookup = registry.createType('PortableRegistry', { types: metadata.types }, true);
51
- // attach the lookup to the registry - now the types are known
52
- registry.setLookup(lookup);
53
- if (chainProperties) {
54
- registry.setChainProperties(chainProperties);
55
- }
56
- // warm-up the actual type, pre-use
57
- lookup.types.forEach(({ id }) => lookup.getTypeDef(id));
58
- return [json, registry, metadata, info, revive];
59
- }
60
- /**
61
- * @internal
62
- * Determines if the given input value is a ContractTypeSpec
63
- */
64
- function isTypeSpec(value) {
65
- return !!value && value instanceof Map && !isUndefined(value.type) && !isUndefined(value.displayName);
66
- }
67
- /**
68
- * @internal
69
- * Determines if the given input value is an Option
70
- */
71
- function isOption(value) {
72
- return !!value && value instanceof Option;
73
- }
74
- export class Abi {
75
- events;
76
- constructors;
77
- info;
78
- json;
79
- messages;
80
- metadata;
81
- registry;
82
- environment = new Map();
83
- isRevive;
84
- constructor(abiJson, chainProperties) {
85
- [this.json, this.registry, this.metadata, this.info, this.isRevive] = parseJson(isString(abiJson)
86
- ? JSON.parse(abiJson)
87
- : abiJson, chainProperties);
88
- this.constructors = this.metadata.spec.constructors.map((spec, index) => this.#createMessage(spec, index, {
89
- isConstructor: true,
90
- isDefault: spec.default.isTrue,
91
- isPayable: spec.payable.isTrue,
92
- returnType: spec.returnType.isSome
93
- ? this.registry.lookup.getTypeDef(spec.returnType.unwrap().type)
94
- : null
95
- }));
96
- this.events = this.metadata.spec.events.map((_, index) => this.#createEvent(index));
97
- this.messages = this.metadata.spec.messages.map((spec, index) => this.#createMessage(spec, index, {
98
- isDefault: spec.default.isTrue,
99
- isMutating: spec.mutates.isTrue,
100
- isPayable: spec.payable.isTrue,
101
- returnType: spec.returnType.isSome
102
- ? this.registry.lookup.getTypeDef(spec.returnType.unwrap().type)
103
- : null
104
- }));
105
- // NOTE See the rationale for having Option<...> values in the actual
106
- // ContractEnvironmentV4 structure definition in interfaces/contractsAbi
107
- // (Due to conversions, the fields may not exist)
108
- for (const [key, opt] of this.metadata.spec.environment.entries()) {
109
- if (isOption(opt)) {
110
- if (opt.isSome) {
111
- const value = opt.unwrap();
112
- if (isBn(value)) {
113
- this.environment.set(key, value);
114
- }
115
- else if (isTypeSpec(value)) {
116
- this.environment.set(key, this.registry.lookup.getTypeDef(value.type));
117
- }
118
- else {
119
- throw new Error(`Invalid environment definition for ${key}:: Expected either Number or ContractTypeSpec`);
120
- }
121
- }
122
- }
123
- else {
124
- throw new Error(`Expected Option<*> definition for ${key} in ContractEnvironment`);
125
- }
126
- }
127
- }
128
- /**
129
- * Warning: Unstable API, bound to change
130
- */
131
- decodeEvent(record) {
132
- switch (this.metadata.version.toString()) {
133
- // earlier version are hoisted to v4
134
- case '4':
135
- return this.#decodeEventV4(record);
136
- case '5':
137
- return this.#decodeEventV5(record);
138
- // Latest
139
- default:
140
- return this.#decodeEventV6(record);
141
- }
142
- }
143
- #decodeEventV6 = (record) => {
144
- const topics = record.event.data[2];
145
- // Try to match by signature topic (first topic)
146
- const signatureTopic = topics[0];
147
- const data = record.event.data[1];
148
- if (signatureTopic) {
149
- const event = this.events.find((e) => e.signatureTopic !== undefined && e.signatureTopic !== null && e.signatureTopic === signatureTopic.toHex());
150
- // Early return if event found by signature topic
151
- if (event) {
152
- return event.fromU8a(data);
153
- }
154
- }
155
- // If no event returned yet, it might be anonymous
156
- const amountOfTopics = topics.length;
157
- const potentialEvents = this.events.filter((e) => {
158
- // event can't have a signature topic
159
- if (e.signatureTopic !== null && e.signatureTopic !== undefined) {
160
- return false;
161
- }
162
- // event should have same amount of indexed fields as emitted topics
163
- const amountIndexed = e.args.filter((a) => a.indexed).length;
164
- if (amountIndexed !== amountOfTopics) {
165
- return false;
166
- }
167
- // If all conditions met, it's a potential event
168
- return true;
169
- });
170
- if (potentialEvents.length === 1) {
171
- return potentialEvents[0].fromU8a(data);
172
- }
173
- throw new Error('Unable to determine event');
174
- };
175
- #decodeEventV5 = (record) => {
176
- // Find event by first topic, which potentially is the signature_topic
177
- const signatureTopic = record.topics[0];
178
- const data = record.event.data[1];
179
- if (signatureTopic) {
180
- const event = this.events.find((e) => e.signatureTopic !== undefined && e.signatureTopic !== null && e.signatureTopic === signatureTopic.toHex());
181
- // Early return if event found by signature topic
182
- if (event) {
183
- return event.fromU8a(data);
184
- }
185
- }
186
- // If no event returned yet, it might be anonymous
187
- const amountOfTopics = record.topics.length;
188
- const potentialEvents = this.events.filter((e) => {
189
- // event can't have a signature topic
190
- if (e.signatureTopic !== null && e.signatureTopic !== undefined) {
191
- return false;
192
- }
193
- // event should have same amount of indexed fields as emitted topics
194
- const amountIndexed = e.args.filter((a) => a.indexed).length;
195
- if (amountIndexed !== amountOfTopics) {
196
- return false;
197
- }
198
- // If all conditions met, it's a potential event
199
- return true;
200
- });
201
- if (potentialEvents.length === 1) {
202
- return potentialEvents[0].fromU8a(data);
203
- }
204
- throw new Error('Unable to determine event');
205
- };
206
- #decodeEventV4 = (record) => {
207
- const data = record.event.data[1];
208
- const index = data[0];
209
- const event = this.events[index];
210
- if (!event) {
211
- throw new Error(`Unable to find event with index ${index}`);
212
- }
213
- return event.fromU8a(data.subarray(1));
214
- };
215
- /**
216
- * Warning: Unstable API, bound to change
217
- */
218
- decodeConstructor(data) {
219
- return this.#decodeMessage('message', this.constructors, data);
220
- }
221
- /**
222
- * Warning: Unstable API, bound to change
223
- */
224
- decodeMessage(data) {
225
- return this.#decodeMessage('message', this.messages, data);
226
- }
227
- findConstructor(constructorOrId) {
228
- return findMessage(this.constructors, constructorOrId);
229
- }
230
- findMessage(messageOrId) {
231
- return findMessage(this.messages, messageOrId);
232
- }
233
- #createArgs = (args, spec) => {
234
- return args.map(({ label, type }, index) => {
235
- try {
236
- if (!isObject(type)) {
237
- throw new Error('Invalid type definition found');
238
- }
239
- const displayName = type.displayName.length
240
- ? type.displayName[type.displayName.length - 1].toString()
241
- : undefined;
242
- const camelName = stringCamelCase(label);
243
- if (displayName && PRIMITIVE_ALWAYS.includes(displayName)) {
244
- return {
245
- name: camelName,
246
- type: {
247
- info: TypeDefInfo.Plain,
248
- type: displayName
249
- }
250
- };
251
- }
252
- const typeDef = this.registry.lookup.getTypeDef(type.type);
253
- return {
254
- name: camelName,
255
- type: displayName && !typeDef.type.startsWith(displayName)
256
- ? { displayName, ...typeDef }
257
- : typeDef
258
- };
259
- }
260
- catch (error) {
261
- l.error(`Error expanding argument ${index} in ${stringify(spec)}`);
262
- throw error;
263
- }
264
- });
265
- };
266
- #createMessageParams = (args, spec) => {
267
- return this.#createArgs(args, spec);
268
- };
269
- #createEventParams = (args, spec) => {
270
- const params = this.#createArgs(args, spec);
271
- return params.map((p, index) => ({ ...p, indexed: args[index].indexed.toPrimitive() }));
272
- };
273
- #createEvent = (index) => {
274
- // TODO TypeScript would narrow this type to the correct version,
275
- // but version is `Text` so I need to call `toString()` here,
276
- // which breaks the type inference.
277
- switch (this.metadata.version.toString()) {
278
- case '4':
279
- return this.#createEventV4(this.metadata.spec.events[index], index);
280
- default:
281
- return this.#createEventV5(this.metadata.spec.events[index], index);
282
- }
283
- };
284
- #createEventV5 = (spec, index) => {
285
- const args = this.#createEventParams(spec.args, spec);
286
- const event = {
287
- args,
288
- docs: spec.docs.map((d) => d.toString()),
289
- fromU8a: (data) => ({
290
- args: this.#decodeArgs(args, data),
291
- event
292
- }),
293
- identifier: [spec.module_path, spec.label].join('::'),
294
- index,
295
- signatureTopic: spec.signature_topic.isSome ? spec.signature_topic.unwrap().toHex() : null
296
- };
297
- return event;
298
- };
299
- #createEventV4 = (spec, index) => {
300
- const args = this.#createEventParams(spec.args, spec);
301
- const event = {
302
- args,
303
- docs: spec.docs.map((d) => d.toString()),
304
- fromU8a: (data) => ({
305
- args: this.#decodeArgs(args, data),
306
- event
307
- }),
308
- identifier: spec.label.toString(),
309
- index
310
- };
311
- return event;
312
- };
313
- #createMessage = (spec, index, add = {}) => {
314
- const args = this.#createMessageParams(spec.args, spec);
315
- const identifier = spec.label.toString();
316
- const message = {
317
- ...add,
318
- args,
319
- docs: spec.docs.map((d) => d.toString()),
320
- fromU8a: (data) => ({
321
- args: this.#decodeArgs(args, data),
322
- message
323
- }),
324
- identifier,
325
- index,
326
- isDefault: spec.default.isTrue,
327
- method: stringCamelCase(identifier),
328
- path: identifier.split('::').map((s) => stringCamelCase(s)),
329
- selector: spec.selector,
330
- toU8a: (params) => this.#encodeMessageArgs(spec, args, params)
331
- };
332
- return message;
333
- };
334
- #decodeArgs = (args, data) => {
335
- // for decoding we expect the input to be just the arg data, no selectors
336
- // no length added (this allows use with events as well)
337
- let offset = 0;
338
- return args.map(({ type: { lookupName, type } }) => {
339
- const value = this.registry.createType(lookupName || type, data.subarray(offset));
340
- offset += value.encodedLength;
341
- return value;
342
- });
343
- };
344
- #decodeMessage = (type, list, data) => {
345
- const [, trimmed] = compactStripLength(data);
346
- const selector = trimmed.subarray(0, 4);
347
- const message = list.find((m) => m.selector.eq(selector));
348
- if (!message) {
349
- throw new Error(`Unable to find ${type} with selector ${u8aToHex(selector)}`);
350
- }
351
- return message.fromU8a(trimmed.subarray(4));
352
- };
353
- #encodeMessageArgs = ({ label, selector }, args, data) => {
354
- if (data.length !== args.length) {
355
- throw new Error(`Expected ${args.length} arguments to contract message '${label.toString()}', found ${data.length}`);
356
- }
357
- return compactAddLength(u8aConcat(this.registry.createType('ContractSelector', selector).toU8a(), ...args.map(({ type: { lookupName, type } }, index) => this.registry.createType(lookupName || type, data[index]).toU8a())));
358
- };
359
- }
@@ -1,15 +0,0 @@
1
- import type { ContractMetadataV4, ContractMetadataV5, ContractMetadataV6 } from '@pezkuwi/types/interfaces';
2
- import type { Registry } from '@pezkuwi/types/types';
3
- import type { ContractMetadataSupported } from './index.js';
4
- export declare const enumVersions: readonly ["V6", "V5", "V4", "V3", "V2", "V1"];
5
- type Versions = typeof enumVersions[number] | 'V0';
6
- type Converter = (registry: Registry, vx: any) => ContractMetadataSupported;
7
- export declare function v6ToLatestCompatible(_registry: Registry, v6: ContractMetadataV6): ContractMetadataV6;
8
- export declare function v5ToLatestCompatible(_registry: Registry, v5: ContractMetadataV5): ContractMetadataV5;
9
- export declare function v4ToLatestCompatible(_registry: Registry, v4: ContractMetadataV4): ContractMetadataV4;
10
- export declare const v3ToLatestCompatible: (registry: Registry, input: import("@pezkuwi/types/interfaces").ContractMetadataV3) => ContractMetadataSupported;
11
- export declare const v2ToLatestCompatible: (registry: Registry, input: import("@pezkuwi/types/interfaces").ContractMetadataV2) => ContractMetadataSupported;
12
- export declare const v1ToLatestCompatible: (registry: Registry, input: import("@pezkuwi/types/interfaces").ContractMetadataV1) => ContractMetadataSupported;
13
- export declare const v0ToLatestCompatible: (registry: Registry, input: import("@pezkuwi/types/interfaces").ContractMetadataV0) => ContractMetadataSupported;
14
- export declare const convertVersions: [Versions, Converter][];
15
- export {};
@@ -1,30 +0,0 @@
1
- import { v0ToV1 } from './toV1.js';
2
- import { v1ToV2 } from './toV2.js';
3
- import { v2ToV3 } from './toV3.js';
4
- import { v3ToV4 } from './toV4.js';
5
- export const enumVersions = ['V6', 'V5', 'V4', 'V3', 'V2', 'V1'];
6
- function createConverter(next, step) {
7
- return (registry, input) => next(registry, step(registry, input));
8
- }
9
- export function v6ToLatestCompatible(_registry, v6) {
10
- return v6;
11
- }
12
- export function v5ToLatestCompatible(_registry, v5) {
13
- return v5;
14
- }
15
- export function v4ToLatestCompatible(_registry, v4) {
16
- return v4;
17
- }
18
- export const v3ToLatestCompatible = /*#__PURE__*/ createConverter(v4ToLatestCompatible, v3ToV4);
19
- export const v2ToLatestCompatible = /*#__PURE__*/ createConverter(v3ToLatestCompatible, v2ToV3);
20
- export const v1ToLatestCompatible = /*#__PURE__*/ createConverter(v2ToLatestCompatible, v1ToV2);
21
- export const v0ToLatestCompatible = /*#__PURE__*/ createConverter(v1ToLatestCompatible, v0ToV1);
22
- export const convertVersions = [
23
- ['V6', v6ToLatestCompatible],
24
- ['V5', v5ToLatestCompatible],
25
- ['V4', v4ToLatestCompatible],
26
- ['V3', v3ToLatestCompatible],
27
- ['V2', v2ToLatestCompatible],
28
- ['V1', v1ToLatestCompatible],
29
- ['V0', v0ToLatestCompatible]
30
- ];
@@ -1,3 +0,0 @@
1
- import type { ContractMetadataV0, ContractMetadataV1 } from '@pezkuwi/types/interfaces';
2
- import type { Registry } from '@pezkuwi/types/types';
3
- export declare function v0ToV1(registry: Registry, v0: ContractMetadataV0): ContractMetadataV1;
package/build/Abi/toV1.js DELETED
@@ -1,21 +0,0 @@
1
- import { convertSiV0toV1 } from '@pezkuwi/types';
2
- import { objectSpread } from '@pezkuwi/util';
3
- function v0ToV1Names(all) {
4
- return all.map((e) => objectSpread({}, e, {
5
- name: Array.isArray(e.name)
6
- ? e.name
7
- : [e.name]
8
- }));
9
- }
10
- export function v0ToV1(registry, v0) {
11
- if (!v0.metadataVersion.length) {
12
- throw new Error('Invalid format for V0 (detected) contract metadata');
13
- }
14
- return registry.createType('ContractMetadataV1', objectSpread({}, v0, {
15
- spec: objectSpread({}, v0.spec, {
16
- constructors: v0ToV1Names(v0.spec.constructors),
17
- messages: v0ToV1Names(v0.spec.messages)
18
- }),
19
- types: convertSiV0toV1(registry, v0.types)
20
- }));
21
- }
@@ -1,3 +0,0 @@
1
- import type { ContractMetadataV1, ContractMetadataV2 } from '@pezkuwi/types/interfaces';
2
- import type { Registry } from '@pezkuwi/types/types';
3
- export declare function v1ToV2(registry: Registry, v1: ContractMetadataV1): ContractMetadataV2;
package/build/Abi/toV2.js DELETED
@@ -1,27 +0,0 @@
1
- import { objectSpread } from '@pezkuwi/util';
2
- const ARG_TYPES = {
3
- ContractConstructorSpec: 'ContractMessageParamSpecV2',
4
- ContractEventSpec: 'ContractEventParamSpecV2',
5
- ContractMessageSpec: 'ContractMessageParamSpecV2'
6
- };
7
- function v1ToV2Label(entry) {
8
- return objectSpread({}, entry, {
9
- label: Array.isArray(entry.name)
10
- ? entry.name.join('::')
11
- : entry.name
12
- });
13
- }
14
- function v1ToV2Labels(registry, outType, all) {
15
- return all.map((e) => registry.createType(`${outType}V2`, objectSpread(v1ToV2Label(e), {
16
- args: e.args.map((a) => registry.createType(ARG_TYPES[outType], v1ToV2Label(a)))
17
- })));
18
- }
19
- export function v1ToV2(registry, v1) {
20
- return registry.createType('ContractMetadataV2', objectSpread({}, v1, {
21
- spec: objectSpread({}, v1.spec, {
22
- constructors: v1ToV2Labels(registry, 'ContractConstructorSpec', v1.spec.constructors),
23
- events: v1ToV2Labels(registry, 'ContractEventSpec', v1.spec.events),
24
- messages: v1ToV2Labels(registry, 'ContractMessageSpec', v1.spec.messages)
25
- })
26
- }));
27
- }
@@ -1,3 +0,0 @@
1
- import type { ContractMetadataV2, ContractMetadataV3 } from '@pezkuwi/types/interfaces';
2
- import type { Registry } from '@pezkuwi/types/types';
3
- export declare function v2ToV3(registry: Registry, v2: ContractMetadataV2): ContractMetadataV3;
package/build/Abi/toV3.js DELETED
@@ -1,10 +0,0 @@
1
- import { objectSpread } from '@pezkuwi/util';
2
- export function v2ToV3(registry, v2) {
3
- return registry.createType('ContractMetadataV3', objectSpread({}, v2, {
4
- spec: objectSpread({}, v2.spec, {
5
- constructors: v2.spec.constructors.map((c) =>
6
- // V3 introduces the payable flag on constructors, for <V3, it is always true
7
- registry.createType('ContractConstructorSpecV3', objectSpread({}, c, { payable: true })))
8
- })
9
- }));
10
- }
@@ -1,3 +0,0 @@
1
- import type { ContractMetadataV3, ContractMetadataV4 } from '@pezkuwi/types/interfaces';
2
- import type { Registry } from '@pezkuwi/types/types';
3
- export declare function v3ToV4(registry: Registry, v3: ContractMetadataV3): ContractMetadataV4;
package/build/Abi/toV4.js DELETED
@@ -1,10 +0,0 @@
1
- import { objectSpread } from '@pezkuwi/util';
2
- export function v3ToV4(registry, v3) {
3
- return registry.createType('ContractMetadataV4', objectSpread({}, v3, {
4
- spec: objectSpread({}, v3.spec, {
5
- constructors: v3.spec.constructors.map((c) => registry.createType('ContractConstructorSpecV4', objectSpread({}, c))),
6
- messages: v3.spec.messages.map((m) => registry.createType('ContractMessageSpecV3', objectSpread({}, m)))
7
- }),
8
- version: registry.createType('Text', '4')
9
- }));
10
- }