@pezkuwi/api 16.5.8 → 16.5.10

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 (381) hide show
  1. package/bundle-pezkuwi-api.js +24 -18
  2. package/cjs/packageInfo.js +1 -1
  3. package/cjs/submittable/createClass.js +1 -0
  4. package/package.json +18 -17
  5. package/packageInfo.js +1 -1
  6. package/submittable/createClass.js +1 -0
  7. package/build/LICENSE +0 -201
  8. package/build/README.md +0 -100
  9. package/build/augment.d.ts +0 -1
  10. package/build/augment.js +0 -1
  11. package/build/base/Decorate.d.ts +0 -143
  12. package/build/base/Decorate.js +0 -752
  13. package/build/base/Events.d.ts +0 -67
  14. package/build/base/Events.js +0 -78
  15. package/build/base/Getters.d.ts +0 -163
  16. package/build/base/Getters.js +0 -207
  17. package/build/base/Init.d.ts +0 -44
  18. package/build/base/Init.js +0 -400
  19. package/build/base/find.d.ts +0 -3
  20. package/build/base/find.js +0 -7
  21. package/build/base/index.d.ts +0 -47
  22. package/build/base/index.js +0 -57
  23. package/build/base/types.d.ts +0 -15
  24. package/build/base/types.js +0 -1
  25. package/build/bundle-pezkuwi-api.js +0 -26247
  26. package/build/bundle.d.ts +0 -7
  27. package/build/bundle.js +0 -7
  28. package/build/cjs/augment.d.ts +0 -1
  29. package/build/cjs/augment.js +0 -3
  30. package/build/cjs/base/Decorate.d.ts +0 -143
  31. package/build/cjs/base/Decorate.js +0 -756
  32. package/build/cjs/base/Events.d.ts +0 -67
  33. package/build/cjs/base/Events.js +0 -82
  34. package/build/cjs/base/Getters.d.ts +0 -163
  35. package/build/cjs/base/Getters.js +0 -211
  36. package/build/cjs/base/Init.d.ts +0 -44
  37. package/build/cjs/base/Init.js +0 -404
  38. package/build/cjs/base/find.d.ts +0 -3
  39. package/build/cjs/base/find.js +0 -11
  40. package/build/cjs/base/index.d.ts +0 -47
  41. package/build/cjs/base/index.js +0 -61
  42. package/build/cjs/base/types.d.ts +0 -15
  43. package/build/cjs/base/types.js +0 -2
  44. package/build/cjs/bundle.d.ts +0 -7
  45. package/build/cjs/bundle.js +0 -17
  46. package/build/cjs/index.d.ts +0 -2
  47. package/build/cjs/index.js +0 -5
  48. package/build/cjs/package.json +0 -3
  49. package/build/cjs/packageDetect.d.ts +0 -1
  50. package/build/cjs/packageDetect.js +0 -10
  51. package/build/cjs/packageInfo.d.ts +0 -6
  52. package/build/cjs/packageInfo.js +0 -4
  53. package/build/cjs/promise/Api.d.ts +0 -158
  54. package/build/cjs/promise/Api.js +0 -195
  55. package/build/cjs/promise/Combinator.d.ts +0 -12
  56. package/build/cjs/promise/Combinator.js +0 -72
  57. package/build/cjs/promise/decorateMethod.d.ts +0 -14
  58. package/build/cjs/promise/decorateMethod.js +0 -75
  59. package/build/cjs/promise/index.d.ts +0 -2
  60. package/build/cjs/promise/index.js +0 -7
  61. package/build/cjs/promise/types.d.ts +0 -5
  62. package/build/cjs/promise/types.js +0 -2
  63. package/build/cjs/rx/Api.d.ts +0 -155
  64. package/build/cjs/rx/Api.js +0 -173
  65. package/build/cjs/rx/decorateMethod.d.ts +0 -3
  66. package/build/cjs/rx/decorateMethod.js +0 -6
  67. package/build/cjs/rx/index.d.ts +0 -2
  68. package/build/cjs/rx/index.js +0 -7
  69. package/build/cjs/submittable/Result.d.ts +0 -31
  70. package/build/cjs/submittable/Result.js +0 -84
  71. package/build/cjs/submittable/createClass.d.ts +0 -12
  72. package/build/cjs/submittable/createClass.js +0 -277
  73. package/build/cjs/submittable/createSubmittable.d.ts +0 -8
  74. package/build/cjs/submittable/createSubmittable.js +0 -8
  75. package/build/cjs/submittable/index.d.ts +0 -2
  76. package/build/cjs/submittable/index.js +0 -7
  77. package/build/cjs/submittable/types.d.ts +0 -1
  78. package/build/cjs/submittable/types.js +0 -2
  79. package/build/cjs/types/calls.d.ts +0 -1
  80. package/build/cjs/types/calls.js +0 -4
  81. package/build/cjs/types/consts.d.ts +0 -1
  82. package/build/cjs/types/consts.js +0 -4
  83. package/build/cjs/types/errors.d.ts +0 -1
  84. package/build/cjs/types/errors.js +0 -4
  85. package/build/cjs/types/events.d.ts +0 -1
  86. package/build/cjs/types/events.js +0 -4
  87. package/build/cjs/types/index.d.ts +0 -114
  88. package/build/cjs/types/index.js +0 -13
  89. package/build/cjs/types/storage.d.ts +0 -1
  90. package/build/cjs/types/storage.js +0 -4
  91. package/build/cjs/types/submittable.d.ts +0 -1
  92. package/build/cjs/types/submittable.js +0 -4
  93. package/build/cjs/util/augmentObject.d.ts +0 -9
  94. package/build/cjs/util/augmentObject.js +0 -84
  95. package/build/cjs/util/decorate.d.ts +0 -16
  96. package/build/cjs/util/decorate.js +0 -17
  97. package/build/cjs/util/filterEvents.d.ts +0 -6
  98. package/build/cjs/util/filterEvents.js +0 -25
  99. package/build/cjs/util/index.d.ts +0 -4
  100. package/build/cjs/util/index.js +0 -11
  101. package/build/cjs/util/isKeyringPair.d.ts +0 -3
  102. package/build/cjs/util/isKeyringPair.js +0 -7
  103. package/build/cjs/util/logging.d.ts +0 -1
  104. package/build/cjs/util/logging.js +0 -5
  105. package/build/cjs/util/validate.d.ts +0 -3
  106. package/build/cjs/util/validate.js +0 -26
  107. package/build/index.d.ts +0 -2
  108. package/build/index.js +0 -2
  109. package/build/package.json +0 -612
  110. package/build/packageDetect.d.ts +0 -1
  111. package/build/packageDetect.js +0 -8
  112. package/build/packageInfo.d.ts +0 -6
  113. package/build/packageInfo.js +0 -1
  114. package/build/promise/Api.d.ts +0 -158
  115. package/build/promise/Api.js +0 -191
  116. package/build/promise/Combinator.d.ts +0 -12
  117. package/build/promise/Combinator.js +0 -68
  118. package/build/promise/decorateMethod.d.ts +0 -14
  119. package/build/promise/decorateMethod.js +0 -71
  120. package/build/promise/index.d.ts +0 -2
  121. package/build/promise/index.js +0 -2
  122. package/build/promise/types.d.ts +0 -5
  123. package/build/promise/types.js +0 -1
  124. package/build/rx/Api.d.ts +0 -155
  125. package/build/rx/Api.js +0 -169
  126. package/build/rx/decorateMethod.d.ts +0 -3
  127. package/build/rx/decorateMethod.js +0 -3
  128. package/build/rx/index.d.ts +0 -2
  129. package/build/rx/index.js +0 -2
  130. package/build/submittable/Result.d.ts +0 -31
  131. package/build/submittable/Result.js +0 -80
  132. package/build/submittable/createClass.d.ts +0 -12
  133. package/build/submittable/createClass.js +0 -274
  134. package/build/submittable/createSubmittable.d.ts +0 -8
  135. package/build/submittable/createSubmittable.js +0 -5
  136. package/build/submittable/index.d.ts +0 -2
  137. package/build/submittable/index.js +0 -2
  138. package/build/submittable/types.d.ts +0 -1
  139. package/build/submittable/types.js +0 -1
  140. package/build/types/calls.d.ts +0 -1
  141. package/build/types/calls.js +0 -1
  142. package/build/types/consts.d.ts +0 -1
  143. package/build/types/consts.js +0 -1
  144. package/build/types/errors.d.ts +0 -1
  145. package/build/types/errors.js +0 -1
  146. package/build/types/events.d.ts +0 -1
  147. package/build/types/events.js +0 -1
  148. package/build/types/index.d.ts +0 -114
  149. package/build/types/index.js +0 -8
  150. package/build/types/storage.d.ts +0 -1
  151. package/build/types/storage.js +0 -1
  152. package/build/types/submittable.d.ts +0 -1
  153. package/build/types/submittable.js +0 -1
  154. package/build/util/augmentObject.d.ts +0 -9
  155. package/build/util/augmentObject.js +0 -81
  156. package/build/util/decorate.d.ts +0 -16
  157. package/build/util/decorate.js +0 -14
  158. package/build/util/filterEvents.d.ts +0 -6
  159. package/build/util/filterEvents.js +0 -22
  160. package/build/util/index.d.ts +0 -4
  161. package/build/util/index.js +0 -4
  162. package/build/util/isKeyringPair.d.ts +0 -3
  163. package/build/util/isKeyringPair.js +0 -4
  164. package/build/util/logging.d.ts +0 -1
  165. package/build/util/logging.js +0 -2
  166. package/build/util/validate.d.ts +0 -3
  167. package/build/util/validate.js +0 -23
  168. package/build-deno/README.md +0 -95
  169. package/build-deno/augment.ts +0 -2
  170. package/build-deno/base/Decorate.ts +0 -1100
  171. package/build-deno/base/Events.ts +0 -89
  172. package/build-deno/base/Getters.ts +0 -243
  173. package/build-deno/base/Init.ts +0 -523
  174. package/build-deno/base/find.ts +0 -12
  175. package/build-deno/base/index.ts +0 -83
  176. package/build-deno/base/types.ts +0 -17
  177. package/build-deno/bundle.ts +0 -11
  178. package/build-deno/checkTypes.manual.ts +0 -320
  179. package/build-deno/index.ts +0 -4
  180. package/build-deno/mod.ts +0 -2
  181. package/build-deno/packageDetect.ts +0 -12
  182. package/build-deno/packageInfo.ts +0 -3
  183. package/build-deno/promise/Api.ts +0 -212
  184. package/build-deno/promise/Combinator.ts +0 -89
  185. package/build-deno/promise/decorateMethod.ts +0 -111
  186. package/build-deno/promise/index.ts +0 -3
  187. package/build-deno/promise/types.ts +0 -7
  188. package/build-deno/rx/Api.ts +0 -184
  189. package/build-deno/rx/decorateMethod.ts +0 -7
  190. package/build-deno/rx/index.ts +0 -3
  191. package/build-deno/submittable/Result.ts +0 -109
  192. package/build-deno/submittable/createClass.ts +0 -436
  193. package/build-deno/submittable/createSubmittable.ts +0 -17
  194. package/build-deno/submittable/index.ts +0 -3
  195. package/build-deno/submittable/types.ts +0 -2
  196. package/build-deno/test/SingleAccountSigner.ts +0 -51
  197. package/build-deno/test/index.ts +0 -3
  198. package/build-deno/test/logEvents.ts +0 -21
  199. package/build-deno/types/calls.ts +0 -2
  200. package/build-deno/types/consts.ts +0 -2
  201. package/build-deno/types/errors.ts +0 -2
  202. package/build-deno/types/events.ts +0 -2
  203. package/build-deno/types/index.ts +0 -124
  204. package/build-deno/types/storage.ts +0 -2
  205. package/build-deno/types/submittable.ts +0 -2
  206. package/build-deno/util/augmentObject.ts +0 -109
  207. package/build-deno/util/decorate.ts +0 -38
  208. package/build-deno/util/filterEvents.ts +0 -32
  209. package/build-deno/util/index.ts +0 -6
  210. package/build-deno/util/isKeyringPair.ts +0 -9
  211. package/build-deno/util/logging.ts +0 -4
  212. package/build-deno/util/validate.ts +0 -32
  213. package/build-tsc/augment.d.ts +0 -1
  214. package/build-tsc/base/Decorate.d.ts +0 -143
  215. package/build-tsc/base/Events.d.ts +0 -67
  216. package/build-tsc/base/Getters.d.ts +0 -163
  217. package/build-tsc/base/Init.d.ts +0 -44
  218. package/build-tsc/base/find.d.ts +0 -3
  219. package/build-tsc/base/index.d.ts +0 -47
  220. package/build-tsc/base/types.d.ts +0 -15
  221. package/build-tsc/bundle.d.ts +0 -7
  222. package/build-tsc/index.d.ts +0 -2
  223. package/build-tsc/packageDetect.d.ts +0 -1
  224. package/build-tsc/packageInfo.d.ts +0 -6
  225. package/build-tsc/promise/Api.d.ts +0 -158
  226. package/build-tsc/promise/Combinator.d.ts +0 -12
  227. package/build-tsc/promise/decorateMethod.d.ts +0 -14
  228. package/build-tsc/promise/index.d.ts +0 -2
  229. package/build-tsc/promise/types.d.ts +0 -5
  230. package/build-tsc/rx/Api.d.ts +0 -155
  231. package/build-tsc/rx/decorateMethod.d.ts +0 -3
  232. package/build-tsc/rx/index.d.ts +0 -2
  233. package/build-tsc/submittable/Result.d.ts +0 -31
  234. package/build-tsc/submittable/createClass.d.ts +0 -12
  235. package/build-tsc/submittable/createSubmittable.d.ts +0 -8
  236. package/build-tsc/submittable/index.d.ts +0 -2
  237. package/build-tsc/submittable/types.d.ts +0 -1
  238. package/build-tsc/types/calls.d.ts +0 -1
  239. package/build-tsc/types/consts.d.ts +0 -1
  240. package/build-tsc/types/errors.d.ts +0 -1
  241. package/build-tsc/types/events.d.ts +0 -1
  242. package/build-tsc/types/index.d.ts +0 -114
  243. package/build-tsc/types/storage.d.ts +0 -1
  244. package/build-tsc/types/submittable.d.ts +0 -1
  245. package/build-tsc/util/augmentObject.d.ts +0 -9
  246. package/build-tsc/util/decorate.d.ts +0 -16
  247. package/build-tsc/util/filterEvents.d.ts +0 -6
  248. package/build-tsc/util/index.d.ts +0 -4
  249. package/build-tsc/util/isKeyringPair.d.ts +0 -3
  250. package/build-tsc/util/logging.d.ts +0 -1
  251. package/build-tsc/util/validate.d.ts +0 -3
  252. package/build-tsc-cjs/augment.js +0 -3
  253. package/build-tsc-cjs/base/Decorate.js +0 -756
  254. package/build-tsc-cjs/base/Events.js +0 -82
  255. package/build-tsc-cjs/base/Getters.js +0 -211
  256. package/build-tsc-cjs/base/Init.js +0 -404
  257. package/build-tsc-cjs/base/find.js +0 -11
  258. package/build-tsc-cjs/base/index.js +0 -61
  259. package/build-tsc-cjs/base/types.js +0 -2
  260. package/build-tsc-cjs/bundle.js +0 -17
  261. package/build-tsc-cjs/index.js +0 -5
  262. package/build-tsc-cjs/packageDetect.js +0 -10
  263. package/build-tsc-cjs/packageInfo.js +0 -4
  264. package/build-tsc-cjs/promise/Api.js +0 -195
  265. package/build-tsc-cjs/promise/Combinator.js +0 -72
  266. package/build-tsc-cjs/promise/decorateMethod.js +0 -75
  267. package/build-tsc-cjs/promise/index.js +0 -7
  268. package/build-tsc-cjs/promise/types.js +0 -2
  269. package/build-tsc-cjs/rx/Api.js +0 -173
  270. package/build-tsc-cjs/rx/decorateMethod.js +0 -6
  271. package/build-tsc-cjs/rx/index.js +0 -7
  272. package/build-tsc-cjs/submittable/Result.js +0 -84
  273. package/build-tsc-cjs/submittable/createClass.js +0 -277
  274. package/build-tsc-cjs/submittable/createSubmittable.js +0 -8
  275. package/build-tsc-cjs/submittable/index.js +0 -7
  276. package/build-tsc-cjs/submittable/types.js +0 -2
  277. package/build-tsc-cjs/types/calls.js +0 -4
  278. package/build-tsc-cjs/types/consts.js +0 -4
  279. package/build-tsc-cjs/types/errors.js +0 -4
  280. package/build-tsc-cjs/types/events.js +0 -4
  281. package/build-tsc-cjs/types/index.js +0 -13
  282. package/build-tsc-cjs/types/storage.js +0 -4
  283. package/build-tsc-cjs/types/submittable.js +0 -4
  284. package/build-tsc-cjs/util/augmentObject.js +0 -84
  285. package/build-tsc-cjs/util/decorate.js +0 -17
  286. package/build-tsc-cjs/util/filterEvents.js +0 -25
  287. package/build-tsc-cjs/util/index.js +0 -11
  288. package/build-tsc-cjs/util/isKeyringPair.js +0 -7
  289. package/build-tsc-cjs/util/logging.js +0 -5
  290. package/build-tsc-cjs/util/validate.js +0 -26
  291. package/build-tsc-esm/augment.js +0 -1
  292. package/build-tsc-esm/base/Decorate.js +0 -752
  293. package/build-tsc-esm/base/Events.js +0 -78
  294. package/build-tsc-esm/base/Getters.js +0 -207
  295. package/build-tsc-esm/base/Init.js +0 -400
  296. package/build-tsc-esm/base/find.js +0 -7
  297. package/build-tsc-esm/base/index.js +0 -57
  298. package/build-tsc-esm/base/types.js +0 -1
  299. package/build-tsc-esm/bundle.js +0 -7
  300. package/build-tsc-esm/index.js +0 -2
  301. package/build-tsc-esm/packageDetect.js +0 -8
  302. package/build-tsc-esm/packageInfo.js +0 -1
  303. package/build-tsc-esm/promise/Api.js +0 -191
  304. package/build-tsc-esm/promise/Combinator.js +0 -68
  305. package/build-tsc-esm/promise/decorateMethod.js +0 -71
  306. package/build-tsc-esm/promise/index.js +0 -2
  307. package/build-tsc-esm/promise/types.js +0 -1
  308. package/build-tsc-esm/rx/Api.js +0 -169
  309. package/build-tsc-esm/rx/decorateMethod.js +0 -3
  310. package/build-tsc-esm/rx/index.js +0 -2
  311. package/build-tsc-esm/submittable/Result.js +0 -80
  312. package/build-tsc-esm/submittable/createClass.js +0 -274
  313. package/build-tsc-esm/submittable/createSubmittable.js +0 -5
  314. package/build-tsc-esm/submittable/index.js +0 -2
  315. package/build-tsc-esm/submittable/types.js +0 -1
  316. package/build-tsc-esm/types/calls.js +0 -1
  317. package/build-tsc-esm/types/consts.js +0 -1
  318. package/build-tsc-esm/types/errors.js +0 -1
  319. package/build-tsc-esm/types/events.js +0 -1
  320. package/build-tsc-esm/types/index.js +0 -8
  321. package/build-tsc-esm/types/storage.js +0 -1
  322. package/build-tsc-esm/types/submittable.js +0 -1
  323. package/build-tsc-esm/util/augmentObject.js +0 -81
  324. package/build-tsc-esm/util/decorate.js +0 -14
  325. package/build-tsc-esm/util/filterEvents.js +0 -22
  326. package/build-tsc-esm/util/index.js +0 -4
  327. package/build-tsc-esm/util/isKeyringPair.js +0 -4
  328. package/build-tsc-esm/util/logging.js +0 -2
  329. package/build-tsc-esm/util/validate.js +0 -23
  330. package/src/augment.ts +0 -4
  331. package/src/base/Decorate.ts +0 -1103
  332. package/src/base/Events.ts +0 -91
  333. package/src/base/Getters.ts +0 -245
  334. package/src/base/Init.ts +0 -525
  335. package/src/base/find.ts +0 -14
  336. package/src/base/index.ts +0 -85
  337. package/src/base/types.ts +0 -19
  338. package/src/bundle.ts +0 -16
  339. package/src/checkTypes.manual.ts +0 -323
  340. package/src/index.ts +0 -6
  341. package/src/mod.ts +0 -4
  342. package/src/packageDetect.ts +0 -16
  343. package/src/packageInfo.ts +0 -6
  344. package/src/promise/Api.ts +0 -214
  345. package/src/promise/Combinator.ts +0 -91
  346. package/src/promise/Combinators.spec.ts +0 -109
  347. package/src/promise/decorateMethod.ts +0 -118
  348. package/src/promise/index.spec.ts +0 -167
  349. package/src/promise/index.ts +0 -5
  350. package/src/promise/types.ts +0 -9
  351. package/src/rx/Api.ts +0 -186
  352. package/src/rx/decorateMethod.ts +0 -9
  353. package/src/rx/index.ts +0 -5
  354. package/src/submittable/Result.ts +0 -111
  355. package/src/submittable/createClass.ts +0 -438
  356. package/src/submittable/createSubmittable.ts +0 -19
  357. package/src/submittable/index.ts +0 -5
  358. package/src/submittable/types.ts +0 -4
  359. package/src/test/SingleAccountSigner.ts +0 -53
  360. package/src/test/index.ts +0 -5
  361. package/src/test/logEvents.ts +0 -24
  362. package/src/types/calls.ts +0 -4
  363. package/src/types/consts.ts +0 -4
  364. package/src/types/errors.ts +0 -4
  365. package/src/types/events.ts +0 -4
  366. package/src/types/index.ts +0 -137
  367. package/src/types/storage.ts +0 -4
  368. package/src/types/submittable.ts +0 -4
  369. package/src/util/augmentObject.spec.ts +0 -54
  370. package/src/util/augmentObject.ts +0 -112
  371. package/src/util/decorate.ts +0 -43
  372. package/src/util/filterEvents.ts +0 -34
  373. package/src/util/index.ts +0 -10
  374. package/src/util/isKeyringPair.ts +0 -11
  375. package/src/util/logging.ts +0 -6
  376. package/src/util/validate.spec.ts +0 -72
  377. package/src/util/validate.ts +0 -36
  378. package/tsconfig.build.json +0 -25
  379. package/tsconfig.build.tsbuildinfo +0 -1
  380. package/tsconfig.spec.json +0 -26
  381. package/tsconfig.spec.tsbuildinfo +0 -1
@@ -1,114 +0,0 @@
1
- import type { ApiTypes, DeriveCustom, QueryableStorageMulti } from '@pezkuwi/api-base/types';
2
- import type { ApiInterfaceRx as ApiInterfaceBase } from '@pezkuwi/api-base/types/api';
3
- import type { QueryableCalls } from '@pezkuwi/api-base/types/calls';
4
- import type { QueryableConsts } from '@pezkuwi/api-base/types/consts';
5
- import type { DecoratedErrors } from '@pezkuwi/api-base/types/errors';
6
- import type { DecoratedEvents } from '@pezkuwi/api-base/types/events';
7
- import type { QueryableStorage } from '@pezkuwi/api-base/types/storage';
8
- import type { ProviderInterface, ProviderInterfaceEmitted } from '@pezkuwi/rpc-provider/types';
9
- import type { ExtDef } from '@pezkuwi/types/extrinsic/signedExtensions/types';
10
- import type { Call, Extrinsic, Hash, RuntimeVersionPartial } from '@pezkuwi/types/interfaces';
11
- import type { CallFunction, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, RegisteredTypes, Registry, RegistryError, SignatureOptions, Signer } from '@pezkuwi/types/types';
12
- import type { BN } from '@pezkuwi/util';
13
- import type { HexString } from '@pezkuwi/util/types';
14
- import type { ApiBase } from '../base/index.js';
15
- import type { SubmittableExtrinsic } from '../types/submittable.js';
16
- import type { AllDerives } from '../util/decorate.js';
17
- export type { Signer, SignerResult } from '@pezkuwi/types/types';
18
- export { ApiBase } from '../base/index.js';
19
- export * from '@pezkuwi/api/types/calls';
20
- export * from '@pezkuwi/api/types/consts';
21
- export * from '@pezkuwi/api/types/errors';
22
- export * from '@pezkuwi/api/types/events';
23
- export * from '@pezkuwi/api/types/storage';
24
- export * from '@pezkuwi/api/types/submittable';
25
- export * from '@pezkuwi/api-base/types';
26
- export interface ApiInterfaceRx extends ApiInterfaceBase {
27
- derive: AllDerives<'rxjs'>;
28
- }
29
- export interface ApiOptions extends RegisteredTypes {
30
- /**
31
- * @description Add custom derives to be injected
32
- */
33
- derives?: DeriveCustom;
34
- /**
35
- * @description Control the initialization of the wasm libraries. When not specified, it defaults to `true`, initializing the wasm libraries, set to `false` to not initialize wasm. (No sr25519 support)
36
- */
37
- initWasm?: boolean;
38
- /**
39
- * @description Controls the checking of storage values once they have been contructed. When not specified this defaults to `true`. Set to `false` to forgo any checking on storage results.
40
- */
41
- isPedantic?: boolean;
42
- /**
43
- * @description pre-bundles is a map of 'genesis hash and runtime spec version' as key to a metadata hex string
44
- * if genesis hash and runtime spec version matches, then use metadata, else fetch it from chain
45
- */
46
- metadata?: Record<string, HexString>;
47
- /**
48
- * @description Don't display any warnings on initialization (missing RPC methods & runtime calls)
49
- */
50
- noInitWarn?: boolean;
51
- /**
52
- * @description Transport Provider from rpc-provider. If not specified, it will default to
53
- * connecting to a WsProvider connecting localhost with the default port, i.e. `ws://127.0.0.1:9944`
54
- */
55
- provider?: ProviderInterface;
56
- /**
57
- * @description A type registry to use along with this instance
58
- */
59
- registry?: Registry;
60
- /**
61
- * @description User-defined RPC methods
62
- */
63
- rpc?: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>;
64
- /**
65
- * @description Defines the size of the cache for the rpc-core. Defaults to 1024 * 10 * 10.
66
- */
67
- rpcCacheCapacity?: number;
68
- /**
69
- * @description Overrides for state_call usage (this will be removed in some future version)
70
- */
71
- runtime?: DefinitionsCall;
72
- /**
73
- * @description Any chain-specific signed extensions that are now well-known
74
- */
75
- signedExtensions?: ExtDef;
76
- /**
77
- * @description An external signer which will be used to sign extrinsic when account passed in is not KeyringPair
78
- */
79
- signer?: Signer;
80
- /**
81
- * @description The source object to use for runtime information (only used when cloning)
82
- */
83
- source?: ApiBase<any>;
84
- /**
85
- * @description Throws an error when the initial connection fails (same as isReadyOrError)
86
- */
87
- throwOnConnect?: boolean;
88
- /**
89
- * @description Throws an error when some types are unknown (useful with throwOnConnect)
90
- */
91
- throwOnUnknown?: boolean;
92
- }
93
- export type ApiInterfaceEvents = ProviderInterfaceEmitted | 'ready' | 'decorated';
94
- export interface SignerOptions extends SignatureOptions {
95
- blockNumber: BN;
96
- genesisHash: Hash;
97
- }
98
- export interface ApiDecoration<ApiType extends ApiTypes> {
99
- call: QueryableCalls<ApiType>;
100
- consts: QueryableConsts<ApiType>;
101
- errors: DecoratedErrors<ApiType>;
102
- events: DecoratedEvents<ApiType>;
103
- query: QueryableStorage<ApiType>;
104
- registry: Registry;
105
- runtimeVersion: RuntimeVersionPartial;
106
- rx: {
107
- call: QueryableCalls<'rxjs'>;
108
- query: QueryableStorage<'rxjs'>;
109
- };
110
- tx: (extrinsic: Call | Extrinsic | Uint8Array | string) => SubmittableExtrinsic<ApiType>;
111
- findCall(callIndex: Uint8Array | string): CallFunction;
112
- findError(errorIndex: Uint8Array | string): RegistryError;
113
- queryMulti: QueryableStorageMulti<ApiType>;
114
- }
@@ -1,8 +0,0 @@
1
- export { ApiBase } from '../base/index.js';
2
- export * from '@pezkuwi/api/types/calls';
3
- export * from '@pezkuwi/api/types/consts';
4
- export * from '@pezkuwi/api/types/errors';
5
- export * from '@pezkuwi/api/types/events';
6
- export * from '@pezkuwi/api/types/storage';
7
- export * from '@pezkuwi/api/types/submittable';
8
- export * from '@pezkuwi/api-base/types';
@@ -1 +0,0 @@
1
- export * from '@pezkuwi/api-base/types/storage';
@@ -1 +0,0 @@
1
- export * from '@pezkuwi/api-base/types/storage';
@@ -1 +0,0 @@
1
- export * from '@pezkuwi/api-base/types/submittable';
@@ -1 +0,0 @@
1
- export * from '@pezkuwi/api-base/types/submittable';
@@ -1,9 +0,0 @@
1
- type Sections<T> = Record<string, Methods<T>>;
2
- type Methods<T> = Record<string, T>;
3
- /**
4
- * @description Takes a decorated api section (e.g. api.tx) and augment it with the details. It does not override what is
5
- * already available, but rather just adds new missing items into the result object.
6
- * @internal
7
- */
8
- export declare function augmentObject<T>(prefix: string | null, src: Sections<T>, dst: Sections<T>, fromEmpty?: boolean): Sections<T>;
9
- export {};
@@ -1,81 +0,0 @@
1
- import { lazyMethods, logger, objectClear } from '@pezkuwi/util';
2
- const l = logger('api/augment');
3
- function logLength(type, values, and = []) {
4
- return values.length
5
- ? ` ${values.length} ${type}${and.length ? ' and' : ''}`
6
- : '';
7
- }
8
- function logValues(type, values) {
9
- return values.length
10
- ? `\n\t${type.padStart(7)}: ${values.sort().join(', ')}`
11
- : '';
12
- }
13
- function warn(prefix, type, [added, removed]) {
14
- if (added.length || removed.length) {
15
- l.warn(`api.${prefix}: Found${logLength('added', added, removed)}${logLength('removed', removed)} ${type}:${logValues('added', added)}${logValues('removed', removed)}`);
16
- }
17
- }
18
- function findSectionExcludes(a, b) {
19
- return a.filter((s) => !b.includes(s));
20
- }
21
- function findSectionIncludes(a, b) {
22
- return a.filter((s) => b.includes(s));
23
- }
24
- function extractSections(src, dst) {
25
- const srcSections = Object.keys(src);
26
- const dstSections = Object.keys(dst);
27
- return [
28
- findSectionExcludes(srcSections, dstSections),
29
- findSectionExcludes(dstSections, srcSections)
30
- ];
31
- }
32
- function findMethodExcludes(src, dst) {
33
- const srcSections = Object.keys(src);
34
- const dstSections = findSectionIncludes(Object.keys(dst), srcSections);
35
- const excludes = [];
36
- for (let s = 0, scount = dstSections.length; s < scount; s++) {
37
- const section = dstSections[s];
38
- const srcMethods = Object.keys(src[section]);
39
- const dstMethods = Object.keys(dst[section]);
40
- for (let d = 0, mcount = dstMethods.length; d < mcount; d++) {
41
- const method = dstMethods[d];
42
- if (!srcMethods.includes(method)) {
43
- excludes.push(`${section}.${method}`);
44
- }
45
- }
46
- }
47
- return excludes;
48
- }
49
- function extractMethods(src, dst) {
50
- return [
51
- findMethodExcludes(dst, src),
52
- findMethodExcludes(src, dst)
53
- ];
54
- }
55
- /**
56
- * @description Takes a decorated api section (e.g. api.tx) and augment it with the details. It does not override what is
57
- * already available, but rather just adds new missing items into the result object.
58
- * @internal
59
- */
60
- export function augmentObject(prefix, src, dst, fromEmpty = false) {
61
- fromEmpty && objectClear(dst);
62
- // NOTE: This part is slightly problematic since it will get the
63
- // values for at least all the sections and the names of the methods
64
- // (Since methods won't be decorated before lazy, this _may_ be ok)
65
- if (prefix && Object.keys(dst).length) {
66
- warn(prefix, 'modules', extractSections(src, dst));
67
- warn(prefix, 'calls', extractMethods(src, dst));
68
- }
69
- const sections = Object.keys(src);
70
- for (let i = 0, count = sections.length; i < count; i++) {
71
- const section = sections[i];
72
- const methods = src[section];
73
- // We don't set here with a lazy interface, we decorate based
74
- // on the top-level structure (this bypasses adding lazy onto lazy)
75
- if (!dst[section]) {
76
- dst[section] = {};
77
- }
78
- lazyMethods(dst[section], Object.keys(methods), (m) => methods[m]);
79
- }
80
- return dst;
81
- }
@@ -1,16 +0,0 @@
1
- import type { ExactDerive } from '@pezkuwi/api-derive';
2
- import type { AnyFunction } from '@pezkuwi/types/types';
3
- import type { ApiTypes, DecorateMethod, MethodResult } from '../types/index.js';
4
- type AnyDeriveSection = Record<string, AnyFunction>;
5
- type AnyDerive = Record<string, AnyDeriveSection>;
6
- type DeriveSection<ApiType extends ApiTypes, Section extends AnyDeriveSection> = {
7
- [M in keyof Section]: MethodResult<ApiType, Section[M]>;
8
- };
9
- export type AllDerives<ApiType extends ApiTypes> = {
10
- [S in keyof ExactDerive]: DeriveSection<ApiType, ExactDerive[S]>;
11
- };
12
- /**
13
- * This is a section decorator which keeps all type information.
14
- */
15
- export declare function decorateDeriveSections<ApiType extends ApiTypes>(decorateMethod: DecorateMethod<ApiType>, derives: AnyDerive): AllDerives<ApiType>;
16
- export {};
@@ -1,14 +0,0 @@
1
- import { lazyDeriveSection } from '@pezkuwi/api-derive';
2
- /**
3
- * This is a section decorator which keeps all type information.
4
- */
5
- export function decorateDeriveSections(decorateMethod, derives) {
6
- const getKeys = (s) => Object.keys(derives[s]);
7
- const creator = (s, m) => decorateMethod(derives[s][m]);
8
- const result = {};
9
- const names = Object.keys(derives);
10
- for (let i = 0, count = names.length; i < count; i++) {
11
- lazyDeriveSection(result, names[i], getKeys, creator);
12
- }
13
- return result;
14
- }
@@ -1,6 +0,0 @@
1
- import type { BlockNumber, EventRecord, ExtrinsicStatus, H256, SignedBlock } from '@pezkuwi/types/interfaces';
2
- export declare function filterEvents(txHash: H256, { block: { extrinsics, header } }: SignedBlock, allEvents: EventRecord[], status: ExtrinsicStatus): {
3
- events?: EventRecord[];
4
- txIndex?: number;
5
- blockNumber?: BlockNumber;
6
- };
@@ -1,22 +0,0 @@
1
- import { isCompact } from '@pezkuwi/util';
2
- import { l } from './logging.js';
3
- export function filterEvents(txHash, { block: { extrinsics, header } }, allEvents, status) {
4
- // extrinsics to hashes
5
- for (const [txIndex, x] of extrinsics.entries()) {
6
- if (x.hash.eq(txHash)) {
7
- return {
8
- blockNumber: isCompact(header.number) ? header.number.unwrap() : header.number,
9
- events: allEvents.filter(({ phase }) => phase.isApplyExtrinsic &&
10
- phase.asApplyExtrinsic.eqn(txIndex)),
11
- txIndex
12
- };
13
- }
14
- }
15
- // if we do get the block after finalized, it _should_ be there
16
- // only warn on filtering with isInBlock (finalization finalizes after)
17
- if (status.isInBlock) {
18
- const allHashes = extrinsics.map((x) => x.hash.toHex());
19
- l.warn(`block ${header.hash.toHex()}: Unable to find extrinsic ${txHash.toHex()} inside ${allHashes.join(', ')}`);
20
- }
21
- return {};
22
- }
@@ -1,4 +0,0 @@
1
- export { filterEvents } from './filterEvents.js';
2
- export { isKeyringPair } from './isKeyringPair.js';
3
- export { l } from './logging.js';
4
- export * from './decorate.js';
@@ -1,4 +0,0 @@
1
- export { filterEvents } from './filterEvents.js';
2
- export { isKeyringPair } from './isKeyringPair.js';
3
- export { l } from './logging.js';
4
- export * from './decorate.js';
@@ -1,3 +0,0 @@
1
- import type { AccountId, Address } from '@pezkuwi/types/interfaces';
2
- import type { IKeyringPair } from '@pezkuwi/types/types';
3
- export declare function isKeyringPair(account: string | IKeyringPair | AccountId | Address): account is IKeyringPair;
@@ -1,4 +0,0 @@
1
- import { isFunction } from '@pezkuwi/util';
2
- export function isKeyringPair(account) {
3
- return isFunction(account.sign);
4
- }
@@ -1 +0,0 @@
1
- export declare const l: import("@pezkuwi/util/types").Logger;
@@ -1,2 +0,0 @@
1
- import { logger } from '@pezkuwi/util';
2
- export const l = /*#__PURE__*/ logger('api/util');
@@ -1,3 +0,0 @@
1
- import type { StorageEntry } from '@pezkuwi/types/primitive/types';
2
- import type { Registry } from '@pezkuwi/types/types';
3
- export declare function extractStorageArgs(registry: Registry, creator: StorageEntry, _args: unknown[]): [StorageEntry, unknown[]];
@@ -1,23 +0,0 @@
1
- import { isUndefined } from '@pezkuwi/util';
2
- function sig({ lookup }, { method, section }, args) {
3
- return `${section}.${method}(${args.map((a) => lookup.getTypeDef(a).type).join(', ')})`;
4
- }
5
- export function extractStorageArgs(registry, creator, _args) {
6
- const args = _args.filter((a) => !isUndefined(a));
7
- if (creator.meta.type.isPlain) {
8
- if (args.length !== 0) {
9
- throw new Error(`${sig(registry, creator, [])} does not take any arguments, ${args.length} found`);
10
- }
11
- }
12
- else {
13
- const { hashers, key } = creator.meta.type.asMap;
14
- const keys = hashers.length === 1
15
- ? [key]
16
- : registry.lookup.getSiType(key).def.asTuple.map((t) => t);
17
- if (args.length !== keys.length) {
18
- throw new Error(`${sig(registry, creator, keys)} is a map, requiring ${keys.length} arguments, ${args.length} found`);
19
- }
20
- }
21
- // pass as tuple
22
- return [creator, args];
23
- }
@@ -1,95 +0,0 @@
1
- # @pezkuwi/api
2
-
3
- The Pezkuwi-JS API provides easy-to-use wrappers around JSONRPC calls that flow from an application to a node. It handles all the encoding and decoding or parameters, provides access to RPC functions and allows for the query of chain state and the submission of transactions.
4
-
5
- The API wrappers provide a standard interface for use -
6
-
7
- - A static `.create(<optional ApiOptions>)` that returns an API instance when connected, decorated and ready-to use. ApiOptions can include an optional WsProvider and optional custom type definitions `{ provider: <Optional WsProvider>, types: <Optional RegistryTypes> }`.
8
- - The above is just a wrapper for `new Api(<optional ApiOptions>) `, exposing the `isReady` getter
9
- - `api.rpc.<section>.<method>` provides access to actual RPC calls, be it for queries, submission or retrieving chain information
10
- - [RPC (node interface)](https://js.pezkuwichain.app/docs/bizinikiwi/rpc)
11
- - `api.query.<section>.<method>` provides access to chain state queries. These are dynamically populated based on what the runtime provides
12
- - [Storage chain state (runtime node interface)](https://js.pezkuwichain.app/docs/bizinikiwi/storage)
13
- - `api.tx.<section>.<method>` provides the ability to create a transaction, like chain state, this list is populated from a runtime query
14
- - [Extrinsics (runtime node interface)](https://js.pezkuwichain.app/docs/bizinikiwi/extrinsics)
15
- - `api.consts.<section>.<constant>` provides access to the module constants (parameter types).
16
- - [Constants (runtime node interface)](https://js.pezkuwichain.app/docs/bizinikiwi/constants)
17
-
18
- ## API Selection
19
-
20
- There are two flavours of the API provided, one allowing a standard interface via JavaScript Promises and the second provides an Observable wrapper using [RxJS](https://github.com/ReactiveX/rxjs). Depending on your use-case and familiarity, you can choose either (or even both) for your application.
21
-
22
- - [[ApiPromise]] All interface calls returns Promises, including the static `.create(...)`. Additionally any subscription method uses `(value) => {}` callbacks, returning the value as the subscription is updated.
23
- - [[ApiRx]] All interface calls return RxJS Observables, including the static `.create(...)`. In the same fashion subscription-based methods return long-running Observables that update with the latest values.
24
-
25
- ## Dynamic by default
26
-
27
- Bizinikiwi (upon which Pezkuwi is built) uses on-chain WASM runtimes, allowing for upgradability. Each runtime defining the actual chain extrinsics (submitted transactions and block intrinsics) as well as available entries in the chain state. Due to this, the API endpoints for queries and transactions are dynamically populated from the running chain.
28
-
29
- Due to this dynamic nature, this API departs from traditional APIs which only has fixed endpoints, driving use by what is available by the runtime. As a start, this generic nature has a learning curve, although the provided documentation, examples and linked documentation tries to make that experience as seamless as possible.
30
-
31
- ## Installation & import
32
-
33
- Installation -
34
-
35
- ```
36
- npm install --save @pezkuwi/api
37
- ```
38
-
39
- Subscribing to blocks via Promise-based API -
40
-
41
- ```javascript
42
- import { ApiPromise } from 'https://deno.land/x/pezkuwi/api/mod.ts';
43
-
44
- const api = await ApiPromise.create();
45
-
46
- api.rpc.chain.subscribeNewHeads((header) => {
47
- console.log(`Chain is at #${header.number}`);
48
- });
49
- ```
50
-
51
- Subscribing to blocks via RxJS-based API -
52
-
53
- ```javascript
54
- import { ApiRx } from 'https://deno.land/x/pezkuwi/api/mod.ts';
55
-
56
- const api = await ApiRx.create().toPromise();
57
-
58
- api.rpc.chain.subscribeNewHeads().subscribe((header) => {
59
- console.log(`Chain is at #${header.number}`);
60
- });
61
- ```
62
-
63
- ## Registering custom types
64
-
65
- Additional types used by runtime modules can be added when a new instance of the API is created. This is necessary if the runtime modules use types which are not available in the base Bizinikiwi runtime.
66
-
67
- ```javascript
68
- import { ApiPromise } from 'https://deno.land/x/pezkuwi/api/mod.ts';
69
-
70
- const api = await ApiPromise.create({
71
- types: {
72
- CustomTypesExample: {
73
- "id": "u32",
74
- "data": "Vec<u8>",
75
- "deposit": "Balance",
76
- "owner": "AccountId",
77
- "application_expiry": "Moment",
78
- "whitelisted": "bool",
79
- "challenge_id": "u32"
80
- }
81
- }
82
- });
83
- ```
84
-
85
- ## Users
86
-
87
- Some of the users of the API (let us know if you are missing from the list), include -
88
-
89
- - [Pezkuwi-JS UI](https://github.com/pezkuwichain/pezkuwi-apps) A user-interface that allows you to make transactions, query the network or participate in actions on the network such as referendums and staking
90
- - [KodaDot](https://github.com/vue-pezkuwi/apps) ([twitter](https://twitter.com/KodaDot)) - Vue.js web wallet, governance dashboard and aspiring performance (lightweight) alternative to original apps, mobile-first.
91
- - [Polkabot](https://gitlab.com/Polkabot) Polkabot is a Matrix chatbot that keeps an eye on the Pezkuwi network. You can see Polkabot in action in https://matrix.to/#/#pezkuwi-network-status:matrix.org
92
- - [Polkawallet.io](https://polkawallet.io) and [Polkawallet (Github)](https://github.com/polkawallet-io/polkawallet-RN/) A mobile wallet for the Pezkuwi network to manage funds and make transactions, available on both Androind and iOS
93
- - [PolkaStats.io](https://polkastats.io), [PolkaStats frontend GitHub repository](https://github.com/Colm3na/polkastats-v2) and [PolkaStats backend GitHub repository](https://github.com/Colm3na/polkastats-backend-v2) Pezkuwi network statistics (currently Zagros and Alexander). Shows network information and staking details from validators and intentions.
94
- - [Pezkuwi API Server (GitHub)](https://github.com/SimplyVC/pezkuwi_api_server) A lightweight server for querying Pezkuwi nodes from any language, built primarily as a backend for [PANIC for Pezkuwi (GitHub)](https://github.com/SimplyVC/panic_pezkuwi/), a validator monitoring and alerting tool.
95
- - [Identity Registrar #1 from Chevdor on Zagros, Zagros and Pezkuwi](https://www.chevdor.com/tags/registrar/)
@@ -1,2 +0,0 @@
1
-
2
- import 'https://deno.land/x/pezkuwi/api-augment/mod.ts';