@pezkuwi/api 16.5.5 → 16.5.8

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 (498) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +12 -12
  3. package/augment.d.ts +1 -0
  4. package/augment.js +1 -0
  5. package/base/Decorate.d.ts +143 -0
  6. package/base/Decorate.js +752 -0
  7. package/base/Events.d.ts +67 -0
  8. package/base/Events.js +78 -0
  9. package/base/Getters.d.ts +163 -0
  10. package/base/Getters.js +207 -0
  11. package/base/Init.d.ts +44 -0
  12. package/base/Init.js +400 -0
  13. package/base/find.d.ts +3 -0
  14. package/base/find.js +7 -0
  15. package/base/index.d.ts +47 -0
  16. package/base/index.js +57 -0
  17. package/base/types.d.ts +15 -0
  18. package/base/types.js +1 -0
  19. package/build/LICENSE +201 -0
  20. package/build/README.md +100 -0
  21. package/build/augment.js +1 -0
  22. package/build/base/Decorate.js +752 -0
  23. package/build/base/Events.js +78 -0
  24. package/build/base/Getters.js +207 -0
  25. package/build/base/Init.js +400 -0
  26. package/build/base/find.js +7 -0
  27. package/build/base/index.d.ts +1 -1
  28. package/build/base/index.js +57 -0
  29. package/build/base/types.js +1 -0
  30. package/build/bundle-pezkuwi-api.js +26247 -0
  31. package/build/bundle.js +7 -0
  32. package/build/cjs/augment.d.ts +1 -0
  33. package/build/cjs/augment.js +3 -0
  34. package/build/cjs/base/Decorate.d.ts +143 -0
  35. package/build/cjs/base/Decorate.js +756 -0
  36. package/build/cjs/base/Events.d.ts +67 -0
  37. package/build/cjs/base/Events.js +82 -0
  38. package/build/cjs/base/Getters.d.ts +163 -0
  39. package/build/cjs/base/Getters.js +211 -0
  40. package/build/cjs/base/Init.d.ts +44 -0
  41. package/build/cjs/base/Init.js +404 -0
  42. package/build/cjs/base/find.d.ts +3 -0
  43. package/build/cjs/base/find.js +11 -0
  44. package/build/cjs/base/index.d.ts +47 -0
  45. package/build/cjs/base/index.js +61 -0
  46. package/build/cjs/base/types.d.ts +15 -0
  47. package/build/cjs/base/types.js +2 -0
  48. package/build/cjs/bundle.d.ts +7 -0
  49. package/build/cjs/bundle.js +17 -0
  50. package/build/cjs/index.d.ts +2 -0
  51. package/build/cjs/index.js +5 -0
  52. package/build/cjs/package.json +3 -0
  53. package/build/cjs/packageDetect.d.ts +1 -0
  54. package/build/cjs/packageDetect.js +10 -0
  55. package/build/cjs/packageInfo.d.ts +6 -0
  56. package/build/cjs/packageInfo.js +4 -0
  57. package/build/cjs/promise/Api.d.ts +158 -0
  58. package/build/cjs/promise/Api.js +195 -0
  59. package/build/cjs/promise/Combinator.d.ts +12 -0
  60. package/build/cjs/promise/Combinator.js +72 -0
  61. package/build/cjs/promise/decorateMethod.d.ts +14 -0
  62. package/build/cjs/promise/decorateMethod.js +75 -0
  63. package/build/cjs/promise/index.d.ts +2 -0
  64. package/build/cjs/promise/index.js +7 -0
  65. package/build/cjs/promise/types.d.ts +5 -0
  66. package/build/cjs/promise/types.js +2 -0
  67. package/build/cjs/rx/Api.d.ts +155 -0
  68. package/build/cjs/rx/Api.js +173 -0
  69. package/build/cjs/rx/decorateMethod.d.ts +3 -0
  70. package/build/cjs/rx/decorateMethod.js +6 -0
  71. package/build/cjs/rx/index.d.ts +2 -0
  72. package/build/cjs/rx/index.js +7 -0
  73. package/build/cjs/submittable/Result.d.ts +31 -0
  74. package/build/cjs/submittable/Result.js +84 -0
  75. package/build/cjs/submittable/createClass.d.ts +12 -0
  76. package/build/cjs/submittable/createClass.js +277 -0
  77. package/build/cjs/submittable/createSubmittable.d.ts +8 -0
  78. package/build/cjs/submittable/createSubmittable.js +8 -0
  79. package/build/cjs/submittable/index.d.ts +2 -0
  80. package/build/cjs/submittable/index.js +7 -0
  81. package/build/cjs/submittable/types.d.ts +1 -0
  82. package/build/cjs/submittable/types.js +2 -0
  83. package/build/cjs/types/calls.d.ts +1 -0
  84. package/build/cjs/types/calls.js +4 -0
  85. package/build/cjs/types/consts.d.ts +1 -0
  86. package/build/cjs/types/consts.js +4 -0
  87. package/build/cjs/types/errors.d.ts +1 -0
  88. package/build/cjs/types/errors.js +4 -0
  89. package/build/cjs/types/events.d.ts +1 -0
  90. package/build/cjs/types/events.js +4 -0
  91. package/build/cjs/types/index.d.ts +114 -0
  92. package/build/cjs/types/index.js +13 -0
  93. package/build/cjs/types/storage.d.ts +1 -0
  94. package/build/cjs/types/storage.js +4 -0
  95. package/build/cjs/types/submittable.d.ts +1 -0
  96. package/build/cjs/types/submittable.js +4 -0
  97. package/build/cjs/util/augmentObject.d.ts +9 -0
  98. package/build/cjs/util/augmentObject.js +84 -0
  99. package/build/cjs/util/decorate.d.ts +16 -0
  100. package/build/cjs/util/decorate.js +17 -0
  101. package/build/cjs/util/filterEvents.d.ts +6 -0
  102. package/build/cjs/util/filterEvents.js +25 -0
  103. package/build/cjs/util/index.d.ts +4 -0
  104. package/build/cjs/util/index.js +11 -0
  105. package/build/cjs/util/isKeyringPair.d.ts +3 -0
  106. package/build/cjs/util/isKeyringPair.js +7 -0
  107. package/build/cjs/util/logging.d.ts +1 -0
  108. package/build/cjs/util/logging.js +5 -0
  109. package/build/cjs/util/validate.d.ts +3 -0
  110. package/build/cjs/util/validate.js +26 -0
  111. package/build/index.js +2 -0
  112. package/build/package.json +612 -0
  113. package/build/packageDetect.js +8 -0
  114. package/build/packageInfo.js +1 -0
  115. package/build/promise/Api.d.ts +2 -2
  116. package/build/promise/Api.js +191 -0
  117. package/build/promise/Combinator.js +68 -0
  118. package/build/promise/decorateMethod.js +71 -0
  119. package/build/promise/index.js +2 -0
  120. package/build/promise/types.js +1 -0
  121. package/build/rx/Api.d.ts +2 -2
  122. package/build/rx/Api.js +169 -0
  123. package/build/rx/decorateMethod.js +3 -0
  124. package/build/rx/index.js +2 -0
  125. package/build/submittable/Result.js +80 -0
  126. package/build/submittable/createClass.js +274 -0
  127. package/build/submittable/createSubmittable.js +5 -0
  128. package/build/submittable/index.js +2 -0
  129. package/build/submittable/types.js +1 -0
  130. package/build/types/calls.js +1 -0
  131. package/build/types/consts.js +1 -0
  132. package/build/types/errors.js +1 -0
  133. package/build/types/events.js +1 -0
  134. package/build/types/index.js +8 -0
  135. package/build/types/storage.js +1 -0
  136. package/build/types/submittable.js +1 -0
  137. package/build/util/augmentObject.js +81 -0
  138. package/build/util/decorate.js +14 -0
  139. package/build/util/filterEvents.js +22 -0
  140. package/build/util/index.js +4 -0
  141. package/build/util/isKeyringPair.js +4 -0
  142. package/build/util/logging.js +2 -0
  143. package/build/util/validate.js +23 -0
  144. package/build-deno/README.md +95 -0
  145. package/build-deno/augment.ts +2 -0
  146. package/build-deno/base/Decorate.ts +1100 -0
  147. package/build-deno/base/Events.ts +89 -0
  148. package/build-deno/base/Getters.ts +243 -0
  149. package/build-deno/base/Init.ts +523 -0
  150. package/build-deno/base/find.ts +12 -0
  151. package/build-deno/base/index.ts +83 -0
  152. package/build-deno/base/types.ts +17 -0
  153. package/build-deno/bundle.ts +11 -0
  154. package/build-deno/checkTypes.manual.ts +320 -0
  155. package/build-deno/index.ts +4 -0
  156. package/build-deno/mod.ts +2 -0
  157. package/build-deno/packageDetect.ts +12 -0
  158. package/build-deno/packageInfo.ts +3 -0
  159. package/build-deno/promise/Api.ts +212 -0
  160. package/build-deno/promise/Combinator.ts +89 -0
  161. package/build-deno/promise/decorateMethod.ts +111 -0
  162. package/build-deno/promise/index.ts +3 -0
  163. package/build-deno/promise/types.ts +7 -0
  164. package/build-deno/rx/Api.ts +184 -0
  165. package/build-deno/rx/decorateMethod.ts +7 -0
  166. package/build-deno/rx/index.ts +3 -0
  167. package/build-deno/submittable/Result.ts +109 -0
  168. package/build-deno/submittable/createClass.ts +436 -0
  169. package/build-deno/submittable/createSubmittable.ts +17 -0
  170. package/build-deno/submittable/index.ts +3 -0
  171. package/build-deno/submittable/types.ts +2 -0
  172. package/build-deno/test/SingleAccountSigner.ts +51 -0
  173. package/build-deno/test/index.ts +3 -0
  174. package/build-deno/test/logEvents.ts +21 -0
  175. package/build-deno/types/calls.ts +2 -0
  176. package/build-deno/types/consts.ts +2 -0
  177. package/build-deno/types/errors.ts +2 -0
  178. package/build-deno/types/events.ts +2 -0
  179. package/build-deno/types/index.ts +124 -0
  180. package/build-deno/types/storage.ts +2 -0
  181. package/build-deno/types/submittable.ts +2 -0
  182. package/build-deno/util/augmentObject.ts +109 -0
  183. package/build-deno/util/decorate.ts +38 -0
  184. package/build-deno/util/filterEvents.ts +32 -0
  185. package/build-deno/util/index.ts +6 -0
  186. package/build-deno/util/isKeyringPair.ts +9 -0
  187. package/build-deno/util/logging.ts +4 -0
  188. package/build-deno/util/validate.ts +32 -0
  189. package/build-tsc/augment.d.ts +1 -0
  190. package/build-tsc/base/Decorate.d.ts +143 -0
  191. package/build-tsc/base/Events.d.ts +67 -0
  192. package/build-tsc/base/Getters.d.ts +163 -0
  193. package/build-tsc/base/Init.d.ts +44 -0
  194. package/build-tsc/base/find.d.ts +3 -0
  195. package/build-tsc/base/index.d.ts +47 -0
  196. package/build-tsc/base/types.d.ts +15 -0
  197. package/build-tsc/bundle.d.ts +7 -0
  198. package/build-tsc/index.d.ts +2 -0
  199. package/build-tsc/packageDetect.d.ts +1 -0
  200. package/build-tsc/packageInfo.d.ts +6 -0
  201. package/build-tsc/promise/Api.d.ts +158 -0
  202. package/build-tsc/promise/Combinator.d.ts +12 -0
  203. package/build-tsc/promise/decorateMethod.d.ts +14 -0
  204. package/build-tsc/promise/index.d.ts +2 -0
  205. package/build-tsc/promise/types.d.ts +5 -0
  206. package/build-tsc/rx/Api.d.ts +155 -0
  207. package/build-tsc/rx/decorateMethod.d.ts +3 -0
  208. package/build-tsc/rx/index.d.ts +2 -0
  209. package/build-tsc/submittable/Result.d.ts +31 -0
  210. package/build-tsc/submittable/createClass.d.ts +12 -0
  211. package/build-tsc/submittable/createSubmittable.d.ts +8 -0
  212. package/build-tsc/submittable/index.d.ts +2 -0
  213. package/build-tsc/submittable/types.d.ts +1 -0
  214. package/build-tsc/types/calls.d.ts +1 -0
  215. package/build-tsc/types/consts.d.ts +1 -0
  216. package/build-tsc/types/errors.d.ts +1 -0
  217. package/build-tsc/types/events.d.ts +1 -0
  218. package/build-tsc/types/index.d.ts +114 -0
  219. package/build-tsc/types/storage.d.ts +1 -0
  220. package/build-tsc/types/submittable.d.ts +1 -0
  221. package/build-tsc/util/augmentObject.d.ts +9 -0
  222. package/build-tsc/util/decorate.d.ts +16 -0
  223. package/build-tsc/util/filterEvents.d.ts +6 -0
  224. package/build-tsc/util/index.d.ts +4 -0
  225. package/build-tsc/util/isKeyringPair.d.ts +3 -0
  226. package/build-tsc/util/logging.d.ts +1 -0
  227. package/build-tsc/util/validate.d.ts +3 -0
  228. package/build-tsc-cjs/augment.js +3 -0
  229. package/build-tsc-cjs/base/Decorate.js +756 -0
  230. package/build-tsc-cjs/base/Events.js +82 -0
  231. package/build-tsc-cjs/base/Getters.js +211 -0
  232. package/build-tsc-cjs/base/Init.js +404 -0
  233. package/build-tsc-cjs/base/find.js +11 -0
  234. package/build-tsc-cjs/base/index.js +61 -0
  235. package/build-tsc-cjs/base/types.js +2 -0
  236. package/build-tsc-cjs/bundle.js +17 -0
  237. package/build-tsc-cjs/index.js +5 -0
  238. package/build-tsc-cjs/packageDetect.js +10 -0
  239. package/build-tsc-cjs/packageInfo.js +4 -0
  240. package/build-tsc-cjs/promise/Api.js +195 -0
  241. package/build-tsc-cjs/promise/Combinator.js +72 -0
  242. package/build-tsc-cjs/promise/decorateMethod.js +75 -0
  243. package/build-tsc-cjs/promise/index.js +7 -0
  244. package/build-tsc-cjs/promise/types.js +2 -0
  245. package/build-tsc-cjs/rx/Api.js +173 -0
  246. package/build-tsc-cjs/rx/decorateMethod.js +6 -0
  247. package/build-tsc-cjs/rx/index.js +7 -0
  248. package/build-tsc-cjs/submittable/Result.js +84 -0
  249. package/build-tsc-cjs/submittable/createClass.js +277 -0
  250. package/build-tsc-cjs/submittable/createSubmittable.js +8 -0
  251. package/build-tsc-cjs/submittable/index.js +7 -0
  252. package/build-tsc-cjs/submittable/types.js +2 -0
  253. package/build-tsc-cjs/types/calls.js +4 -0
  254. package/build-tsc-cjs/types/consts.js +4 -0
  255. package/build-tsc-cjs/types/errors.js +4 -0
  256. package/build-tsc-cjs/types/events.js +4 -0
  257. package/build-tsc-cjs/types/index.js +13 -0
  258. package/build-tsc-cjs/types/storage.js +4 -0
  259. package/build-tsc-cjs/types/submittable.js +4 -0
  260. package/build-tsc-cjs/util/augmentObject.js +84 -0
  261. package/build-tsc-cjs/util/decorate.js +17 -0
  262. package/build-tsc-cjs/util/filterEvents.js +25 -0
  263. package/build-tsc-cjs/util/index.js +11 -0
  264. package/build-tsc-cjs/util/isKeyringPair.js +7 -0
  265. package/build-tsc-cjs/util/logging.js +5 -0
  266. package/build-tsc-cjs/util/validate.js +26 -0
  267. package/build-tsc-esm/augment.js +1 -0
  268. package/build-tsc-esm/base/Decorate.js +752 -0
  269. package/build-tsc-esm/base/Events.js +78 -0
  270. package/build-tsc-esm/base/Getters.js +207 -0
  271. package/build-tsc-esm/base/Init.js +400 -0
  272. package/build-tsc-esm/base/find.js +7 -0
  273. package/build-tsc-esm/base/index.js +57 -0
  274. package/build-tsc-esm/base/types.js +1 -0
  275. package/build-tsc-esm/bundle.js +7 -0
  276. package/build-tsc-esm/index.js +2 -0
  277. package/build-tsc-esm/packageDetect.js +8 -0
  278. package/build-tsc-esm/packageInfo.js +1 -0
  279. package/build-tsc-esm/promise/Api.js +191 -0
  280. package/build-tsc-esm/promise/Combinator.js +68 -0
  281. package/build-tsc-esm/promise/decorateMethod.js +71 -0
  282. package/build-tsc-esm/promise/index.js +2 -0
  283. package/build-tsc-esm/promise/types.js +1 -0
  284. package/build-tsc-esm/rx/Api.js +169 -0
  285. package/build-tsc-esm/rx/decorateMethod.js +3 -0
  286. package/build-tsc-esm/rx/index.js +2 -0
  287. package/build-tsc-esm/submittable/Result.js +80 -0
  288. package/build-tsc-esm/submittable/createClass.js +274 -0
  289. package/build-tsc-esm/submittable/createSubmittable.js +5 -0
  290. package/build-tsc-esm/submittable/index.js +2 -0
  291. package/build-tsc-esm/submittable/types.js +1 -0
  292. package/build-tsc-esm/types/calls.js +1 -0
  293. package/build-tsc-esm/types/consts.js +1 -0
  294. package/build-tsc-esm/types/errors.js +1 -0
  295. package/build-tsc-esm/types/events.js +1 -0
  296. package/build-tsc-esm/types/index.js +8 -0
  297. package/build-tsc-esm/types/storage.js +1 -0
  298. package/build-tsc-esm/types/submittable.js +1 -0
  299. package/build-tsc-esm/util/augmentObject.js +81 -0
  300. package/build-tsc-esm/util/decorate.js +14 -0
  301. package/build-tsc-esm/util/filterEvents.js +22 -0
  302. package/build-tsc-esm/util/index.js +4 -0
  303. package/build-tsc-esm/util/isKeyringPair.js +4 -0
  304. package/build-tsc-esm/util/logging.js +2 -0
  305. package/build-tsc-esm/util/validate.js +23 -0
  306. package/bundle-pezkuwi-api.js +26247 -0
  307. package/bundle.d.ts +7 -0
  308. package/bundle.js +7 -0
  309. package/cjs/augment.d.ts +1 -0
  310. package/cjs/augment.js +3 -0
  311. package/cjs/base/Decorate.d.ts +143 -0
  312. package/cjs/base/Decorate.js +756 -0
  313. package/cjs/base/Events.d.ts +67 -0
  314. package/cjs/base/Events.js +82 -0
  315. package/cjs/base/Getters.d.ts +163 -0
  316. package/cjs/base/Getters.js +211 -0
  317. package/cjs/base/Init.d.ts +44 -0
  318. package/cjs/base/Init.js +404 -0
  319. package/cjs/base/find.d.ts +3 -0
  320. package/cjs/base/find.js +11 -0
  321. package/cjs/base/index.d.ts +47 -0
  322. package/cjs/base/index.js +61 -0
  323. package/cjs/base/types.d.ts +15 -0
  324. package/cjs/base/types.js +2 -0
  325. package/cjs/bundle.d.ts +7 -0
  326. package/cjs/bundle.js +17 -0
  327. package/cjs/index.d.ts +2 -0
  328. package/cjs/index.js +5 -0
  329. package/cjs/package.json +3 -0
  330. package/cjs/packageDetect.d.ts +1 -0
  331. package/cjs/packageDetect.js +10 -0
  332. package/cjs/packageInfo.d.ts +6 -0
  333. package/cjs/packageInfo.js +4 -0
  334. package/cjs/promise/Api.d.ts +158 -0
  335. package/cjs/promise/Api.js +195 -0
  336. package/cjs/promise/Combinator.d.ts +12 -0
  337. package/cjs/promise/Combinator.js +72 -0
  338. package/cjs/promise/decorateMethod.d.ts +14 -0
  339. package/cjs/promise/decorateMethod.js +75 -0
  340. package/cjs/promise/index.d.ts +2 -0
  341. package/cjs/promise/index.js +7 -0
  342. package/cjs/promise/types.d.ts +5 -0
  343. package/cjs/promise/types.js +2 -0
  344. package/cjs/rx/Api.d.ts +155 -0
  345. package/cjs/rx/Api.js +173 -0
  346. package/cjs/rx/decorateMethod.d.ts +3 -0
  347. package/cjs/rx/decorateMethod.js +6 -0
  348. package/cjs/rx/index.d.ts +2 -0
  349. package/cjs/rx/index.js +7 -0
  350. package/cjs/submittable/Result.d.ts +31 -0
  351. package/cjs/submittable/Result.js +84 -0
  352. package/cjs/submittable/createClass.d.ts +12 -0
  353. package/cjs/submittable/createClass.js +277 -0
  354. package/cjs/submittable/createSubmittable.d.ts +8 -0
  355. package/cjs/submittable/createSubmittable.js +8 -0
  356. package/cjs/submittable/index.d.ts +2 -0
  357. package/cjs/submittable/index.js +7 -0
  358. package/cjs/submittable/types.d.ts +1 -0
  359. package/cjs/submittable/types.js +2 -0
  360. package/cjs/types/calls.d.ts +1 -0
  361. package/cjs/types/calls.js +4 -0
  362. package/cjs/types/consts.d.ts +1 -0
  363. package/cjs/types/consts.js +4 -0
  364. package/cjs/types/errors.d.ts +1 -0
  365. package/cjs/types/errors.js +4 -0
  366. package/cjs/types/events.d.ts +1 -0
  367. package/cjs/types/events.js +4 -0
  368. package/cjs/types/index.d.ts +114 -0
  369. package/cjs/types/index.js +13 -0
  370. package/cjs/types/storage.d.ts +1 -0
  371. package/cjs/types/storage.js +4 -0
  372. package/cjs/types/submittable.d.ts +1 -0
  373. package/cjs/types/submittable.js +4 -0
  374. package/cjs/util/augmentObject.d.ts +9 -0
  375. package/cjs/util/augmentObject.js +84 -0
  376. package/cjs/util/decorate.d.ts +16 -0
  377. package/cjs/util/decorate.js +17 -0
  378. package/cjs/util/filterEvents.d.ts +6 -0
  379. package/cjs/util/filterEvents.js +25 -0
  380. package/cjs/util/index.d.ts +4 -0
  381. package/cjs/util/index.js +11 -0
  382. package/cjs/util/isKeyringPair.d.ts +3 -0
  383. package/cjs/util/isKeyringPair.js +7 -0
  384. package/cjs/util/logging.d.ts +1 -0
  385. package/cjs/util/logging.js +5 -0
  386. package/cjs/util/validate.d.ts +3 -0
  387. package/cjs/util/validate.js +26 -0
  388. package/index.d.ts +2 -0
  389. package/index.js +2 -0
  390. package/package.json +588 -22
  391. package/packageDetect.d.ts +1 -0
  392. package/packageDetect.js +8 -0
  393. package/packageInfo.d.ts +6 -0
  394. package/packageInfo.js +1 -0
  395. package/promise/Api.d.ts +158 -0
  396. package/promise/Api.js +191 -0
  397. package/promise/Combinator.d.ts +12 -0
  398. package/promise/Combinator.js +68 -0
  399. package/promise/decorateMethod.d.ts +14 -0
  400. package/promise/decorateMethod.js +71 -0
  401. package/promise/index.d.ts +2 -0
  402. package/promise/index.js +2 -0
  403. package/promise/types.d.ts +5 -0
  404. package/promise/types.js +1 -0
  405. package/rx/Api.d.ts +155 -0
  406. package/rx/Api.js +169 -0
  407. package/rx/decorateMethod.d.ts +3 -0
  408. package/rx/decorateMethod.js +3 -0
  409. package/rx/index.d.ts +2 -0
  410. package/rx/index.js +2 -0
  411. package/src/augment.ts +1 -1
  412. package/src/base/Decorate.ts +1 -1
  413. package/src/base/Events.ts +1 -1
  414. package/src/base/Getters.ts +1 -1
  415. package/src/base/Init.ts +1 -1
  416. package/src/base/find.ts +1 -1
  417. package/src/base/index.ts +1 -1
  418. package/src/base/types.ts +1 -1
  419. package/src/bundle.ts +1 -1
  420. package/src/checkTypes.manual.ts +7 -7
  421. package/src/index.ts +1 -1
  422. package/src/mod.ts +1 -1
  423. package/src/packageDetect.ts +2 -2
  424. package/src/packageInfo.ts +3 -3
  425. package/src/promise/Api.ts +3 -3
  426. package/src/promise/Combinator.ts +1 -1
  427. package/src/promise/Combinators.spec.ts +1 -1
  428. package/src/promise/decorateMethod.ts +1 -1
  429. package/src/promise/index.spec.ts +1 -1
  430. package/src/promise/index.ts +1 -1
  431. package/src/promise/types.ts +1 -1
  432. package/src/rx/Api.ts +3 -3
  433. package/src/rx/decorateMethod.ts +1 -1
  434. package/src/rx/index.ts +1 -1
  435. package/src/submittable/Result.ts +1 -1
  436. package/src/submittable/createClass.ts +1 -1
  437. package/src/submittable/createSubmittable.ts +1 -1
  438. package/src/submittable/index.ts +1 -1
  439. package/src/submittable/types.ts +1 -1
  440. package/src/test/SingleAccountSigner.ts +1 -1
  441. package/src/test/index.ts +1 -1
  442. package/src/test/logEvents.ts +1 -1
  443. package/src/types/calls.ts +1 -1
  444. package/src/types/consts.ts +1 -1
  445. package/src/types/errors.ts +1 -1
  446. package/src/types/events.ts +1 -1
  447. package/src/types/index.ts +1 -1
  448. package/src/types/storage.ts +1 -1
  449. package/src/types/submittable.ts +1 -1
  450. package/src/util/augmentObject.spec.ts +1 -1
  451. package/src/util/augmentObject.ts +1 -1
  452. package/src/util/decorate.ts +1 -1
  453. package/src/util/filterEvents.ts +1 -1
  454. package/src/util/index.ts +1 -1
  455. package/src/util/isKeyringPair.ts +1 -1
  456. package/src/util/logging.ts +1 -1
  457. package/src/util/validate.spec.ts +2 -2
  458. package/src/util/validate.ts +1 -1
  459. package/submittable/Result.d.ts +31 -0
  460. package/submittable/Result.js +80 -0
  461. package/submittable/createClass.d.ts +12 -0
  462. package/submittable/createClass.js +274 -0
  463. package/submittable/createSubmittable.d.ts +8 -0
  464. package/submittable/createSubmittable.js +5 -0
  465. package/submittable/index.d.ts +2 -0
  466. package/submittable/index.js +2 -0
  467. package/submittable/types.d.ts +1 -0
  468. package/submittable/types.js +1 -0
  469. package/tsconfig.build.tsbuildinfo +1 -1
  470. package/tsconfig.spec.tsbuildinfo +1 -0
  471. package/types/calls.d.ts +1 -0
  472. package/types/calls.js +1 -0
  473. package/types/consts.d.ts +1 -0
  474. package/types/consts.js +1 -0
  475. package/types/errors.d.ts +1 -0
  476. package/types/errors.js +1 -0
  477. package/types/events.d.ts +1 -0
  478. package/types/events.js +1 -0
  479. package/types/index.d.ts +114 -0
  480. package/types/index.js +8 -0
  481. package/types/storage.d.ts +1 -0
  482. package/types/storage.js +1 -0
  483. package/types/submittable.d.ts +1 -0
  484. package/types/submittable.js +1 -0
  485. package/util/augmentObject.d.ts +9 -0
  486. package/util/augmentObject.js +81 -0
  487. package/util/decorate.d.ts +16 -0
  488. package/util/decorate.js +14 -0
  489. package/util/filterEvents.d.ts +6 -0
  490. package/util/filterEvents.js +22 -0
  491. package/util/index.d.ts +4 -0
  492. package/util/index.js +4 -0
  493. package/util/isKeyringPair.d.ts +3 -0
  494. package/util/isKeyringPair.js +4 -0
  495. package/util/logging.d.ts +1 -0
  496. package/util/logging.js +2 -0
  497. package/util/validate.d.ts +3 -0
  498. package/util/validate.js +23 -0
@@ -0,0 +1,124 @@
1
+
2
+ import type { ApiTypes, DeriveCustom, QueryableStorageMulti } from 'https://deno.land/x/pezkuwi/api-base/types/index.ts';
3
+ import type { ApiInterfaceRx as ApiInterfaceBase } from 'https://deno.land/x/pezkuwi/api-base/types/api.ts';
4
+ import type { QueryableCalls } from 'https://deno.land/x/pezkuwi/api-base/types/calls.ts';
5
+ import type { QueryableConsts } from 'https://deno.land/x/pezkuwi/api-base/types/consts.ts';
6
+ import type { DecoratedErrors } from 'https://deno.land/x/pezkuwi/api-base/types/errors.ts';
7
+ import type { DecoratedEvents } from 'https://deno.land/x/pezkuwi/api-base/types/events.ts';
8
+ import type { QueryableStorage } from 'https://deno.land/x/pezkuwi/api-base/types/storage.ts';
9
+ import type { ProviderInterface, ProviderInterfaceEmitted } from 'https://deno.land/x/pezkuwi/rpc-provider/types.ts';
10
+ import type { ExtDef } from 'https://deno.land/x/pezkuwi/types/extrinsic/signedExtensions/types.ts';
11
+ import type { Call, Extrinsic, Hash, RuntimeVersionPartial } from 'https://deno.land/x/pezkuwi/types/interfaces/index.ts';
12
+ import type { CallFunction, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, RegisteredTypes, Registry, RegistryError, SignatureOptions, Signer } from 'https://deno.land/x/pezkuwi/types/types/index.ts';
13
+ import type { BN } from 'https://deno.land/x/pezkuwi/util/mod.ts';
14
+ import type { HexString } from 'https://deno.land/x/pezkuwi/util/types.ts';
15
+ import type { ApiBase } from '../base/index.ts';
16
+ import type { SubmittableExtrinsic } from '../types/submittable.ts';
17
+ import type { AllDerives } from '../util/decorate.ts';
18
+
19
+ export type { Signer, SignerResult } from 'https://deno.land/x/pezkuwi/types/types/index.ts';
20
+
21
+ export { ApiBase } from '../base/index.ts';
22
+
23
+ export * from 'https://deno.land/x/pezkuwi/api/types/calls.ts';
24
+ export * from 'https://deno.land/x/pezkuwi/api/types/consts.ts';
25
+ export * from 'https://deno.land/x/pezkuwi/api/types/errors.ts';
26
+ export * from 'https://deno.land/x/pezkuwi/api/types/events.ts';
27
+ export * from 'https://deno.land/x/pezkuwi/api/types/storage.ts';
28
+ export * from 'https://deno.land/x/pezkuwi/api/types/submittable.ts';
29
+ export * from 'https://deno.land/x/pezkuwi/api-base/types/index.ts';
30
+
31
+ export interface ApiInterfaceRx extends ApiInterfaceBase {
32
+ derive: AllDerives<'rxjs'>;
33
+ }
34
+
35
+ export interface ApiOptions extends RegisteredTypes {
36
+ /**
37
+ * @description Add custom derives to be injected
38
+ */
39
+ derives?: DeriveCustom;
40
+ /**
41
+ * @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)
42
+ */
43
+ initWasm?: boolean;
44
+ /**
45
+ * @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.
46
+ */
47
+ isPedantic?: boolean;
48
+ /**
49
+ * @description pre-bundles is a map of 'genesis hash and runtime spec version' as key to a metadata hex string
50
+ * if genesis hash and runtime spec version matches, then use metadata, else fetch it from chain
51
+ */
52
+ metadata?: Record<string, HexString>;
53
+ /**
54
+ * @description Don't display any warnings on initialization (missing RPC methods & runtime calls)
55
+ */
56
+ noInitWarn?: boolean;
57
+ /**
58
+ * @description Transport Provider from rpc-provider. If not specified, it will default to
59
+ * connecting to a WsProvider connecting localhost with the default port, i.e. `ws://127.0.0.1:9944`
60
+ */
61
+ provider?: ProviderInterface;
62
+ /**
63
+ * @description A type registry to use along with this instance
64
+ */
65
+ registry?: Registry;
66
+ /**
67
+ * @description User-defined RPC methods
68
+ */
69
+ rpc?: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>;
70
+ /**
71
+ * @description Defines the size of the cache for the rpc-core. Defaults to 1024 * 10 * 10.
72
+ */
73
+ rpcCacheCapacity?: number;
74
+ /**
75
+ * @description Overrides for state_call usage (this will be removed in some future version)
76
+ */
77
+ runtime?: DefinitionsCall;
78
+ /**
79
+ * @description Any chain-specific signed extensions that are now well-known
80
+ */
81
+ signedExtensions?: ExtDef;
82
+ /**
83
+ * @description An external signer which will be used to sign extrinsic when account passed in is not KeyringPair
84
+ */
85
+ signer?: Signer;
86
+ /**
87
+ * @description The source object to use for runtime information (only used when cloning)
88
+ */
89
+ source?: ApiBase<any>;
90
+ /**
91
+ * @description Throws an error when the initial connection fails (same as isReadyOrError)
92
+ */
93
+ throwOnConnect?: boolean;
94
+ /**
95
+ * @description Throws an error when some types are unknown (useful with throwOnConnect)
96
+ */
97
+ throwOnUnknown?: boolean;
98
+ }
99
+
100
+ export type ApiInterfaceEvents = ProviderInterfaceEmitted | 'ready' | 'decorated';
101
+
102
+ export interface SignerOptions extends SignatureOptions {
103
+ blockNumber: BN;
104
+ genesisHash: Hash;
105
+ }
106
+
107
+ export interface ApiDecoration<ApiType extends ApiTypes> {
108
+ call: QueryableCalls<ApiType>;
109
+ consts: QueryableConsts<ApiType>;
110
+ errors: DecoratedErrors<ApiType>;
111
+ events: DecoratedEvents<ApiType>;
112
+ query: QueryableStorage<ApiType>;
113
+ registry: Registry;
114
+ runtimeVersion: RuntimeVersionPartial;
115
+ rx: {
116
+ call: QueryableCalls<'rxjs'>;
117
+ query: QueryableStorage<'rxjs'>;
118
+ };
119
+ tx: (extrinsic: Call | Extrinsic | Uint8Array | string) => SubmittableExtrinsic<ApiType>;
120
+
121
+ findCall (callIndex: Uint8Array | string): CallFunction;
122
+ findError (errorIndex: Uint8Array | string): RegistryError;
123
+ queryMulti: QueryableStorageMulti<ApiType>;
124
+ }
@@ -0,0 +1,2 @@
1
+
2
+ export * from 'https://deno.land/x/pezkuwi/api-base/types/storage.ts';
@@ -0,0 +1,2 @@
1
+
2
+ export * from 'https://deno.land/x/pezkuwi/api-base/types/submittable.ts';
@@ -0,0 +1,109 @@
1
+
2
+ import { lazyMethods, logger, objectClear } from 'https://deno.land/x/pezkuwi/util/mod.ts';
3
+
4
+ type Sections <T> = Record<string, Methods<T>>;
5
+
6
+ type Methods <T> = Record<string, T>;
7
+
8
+ type StringsStrings = [string[], string[]];
9
+
10
+ const l = logger('api/augment');
11
+
12
+ function logLength (type: 'added' | 'removed', values: string[], and: string[] = []): string {
13
+ return values.length
14
+ ? ` ${values.length} ${type}${and.length ? ' and' : ''}`
15
+ : '';
16
+ }
17
+
18
+ function logValues (type: 'added' | 'removed', values: string[]): string {
19
+ return values.length
20
+ ? `\n\t${type.padStart(7)}: ${values.sort().join(', ')}`
21
+ : '';
22
+ }
23
+
24
+ function warn (prefix: string, type: 'calls' | 'modules', [added, removed]: StringsStrings): void {
25
+ if (added.length || removed.length) {
26
+ l.warn(`api.${prefix}: Found${logLength('added', added, removed)}${logLength('removed', removed)} ${type}:${logValues('added', added)}${logValues('removed', removed)}`);
27
+ }
28
+ }
29
+
30
+ function findSectionExcludes (a: string[], b: string[]): string[] {
31
+ return a.filter((s) => !b.includes(s));
32
+ }
33
+
34
+ function findSectionIncludes (a: string[], b: string[]): string[] {
35
+ return a.filter((s) => b.includes(s));
36
+ }
37
+
38
+ function extractSections <T> (src: Sections<T>, dst: Sections<T>): StringsStrings {
39
+ const srcSections = Object.keys(src);
40
+ const dstSections = Object.keys(dst);
41
+
42
+ return [
43
+ findSectionExcludes(srcSections, dstSections),
44
+ findSectionExcludes(dstSections, srcSections)
45
+ ];
46
+ }
47
+
48
+ function findMethodExcludes <T> (src: Sections<T>, dst: Sections<T>): string[] {
49
+ const srcSections = Object.keys(src);
50
+ const dstSections = findSectionIncludes(Object.keys(dst), srcSections);
51
+ const excludes: string[] = [];
52
+
53
+ for (let s = 0, scount = dstSections.length; s < scount; s++) {
54
+ const section = dstSections[s];
55
+ const srcMethods = Object.keys(src[section]);
56
+ const dstMethods = Object.keys(dst[section]);
57
+
58
+ for (let d = 0, mcount = dstMethods.length; d < mcount; d++) {
59
+ const method = dstMethods[d];
60
+
61
+ if (!srcMethods.includes(method)) {
62
+ excludes.push(`${section}.${method}`);
63
+ }
64
+ }
65
+ }
66
+
67
+ return excludes;
68
+ }
69
+
70
+ function extractMethods <T> (src: Sections<T>, dst: Sections<T>): StringsStrings {
71
+ return [
72
+ findMethodExcludes(dst, src),
73
+ findMethodExcludes(src, dst)
74
+ ];
75
+ }
76
+
77
+ /**
78
+ * @description Takes a decorated api section (e.g. api.tx) and augment it with the details. It does not override what is
79
+ * already available, but rather just adds new missing items into the result object.
80
+ * @internal
81
+ */
82
+ export function augmentObject <T> (prefix: string | null, src: Sections<T>, dst: Sections<T>, fromEmpty = false): Sections<T> {
83
+ fromEmpty && objectClear(dst);
84
+
85
+ // NOTE: This part is slightly problematic since it will get the
86
+ // values for at least all the sections and the names of the methods
87
+ // (Since methods won't be decorated before lazy, this _may_ be ok)
88
+ if (prefix && Object.keys(dst).length) {
89
+ warn(prefix, 'modules', extractSections(src, dst));
90
+ warn(prefix, 'calls', extractMethods(src, dst));
91
+ }
92
+
93
+ const sections = Object.keys(src);
94
+
95
+ for (let i = 0, count = sections.length; i < count; i++) {
96
+ const section = sections[i];
97
+ const methods = src[section];
98
+
99
+ // We don't set here with a lazy interface, we decorate based
100
+ // on the top-level structure (this bypasses adding lazy onto lazy)
101
+ if (!dst[section]) {
102
+ dst[section] = {};
103
+ }
104
+
105
+ lazyMethods(dst[section], Object.keys(methods), (m: string) => methods[m]);
106
+ }
107
+
108
+ return dst;
109
+ }
@@ -0,0 +1,38 @@
1
+
2
+ import type { ExactDerive } from 'https://deno.land/x/pezkuwi/api-derive/mod.ts';
3
+ import type { AnyFunction } from 'https://deno.land/x/pezkuwi/types/types/index.ts';
4
+ import type { ApiTypes, DecorateMethod, MethodResult } from '../types/index.ts';
5
+
6
+ import { lazyDeriveSection } from 'https://deno.land/x/pezkuwi/api-derive/mod.ts';
7
+
8
+ type AnyDeriveSection = Record<string, AnyFunction>;
9
+
10
+ type AnyDerive = Record<string, AnyDeriveSection>;
11
+
12
+ type DeriveSection<ApiType extends ApiTypes, Section extends AnyDeriveSection> = {
13
+ [M in keyof Section]: MethodResult<ApiType, Section[M]>
14
+ };
15
+
16
+ export type AllDerives<ApiType extends ApiTypes> = {
17
+ [S in keyof ExactDerive]: DeriveSection<ApiType, ExactDerive[S]>
18
+ };
19
+
20
+ /**
21
+ * This is a section decorator which keeps all type information.
22
+ */
23
+ export function decorateDeriveSections<ApiType extends ApiTypes> (decorateMethod: DecorateMethod<ApiType>, derives: AnyDerive): AllDerives<ApiType> {
24
+ const getKeys = (s: string) =>
25
+ Object.keys(derives[s]);
26
+
27
+ const creator = (s: string, m: string) =>
28
+ decorateMethod(derives[s][m]) as AnyFunction;
29
+
30
+ const result: AnyDerive = {};
31
+ const names = Object.keys(derives);
32
+
33
+ for (let i = 0, count = names.length; i < count; i++) {
34
+ lazyDeriveSection(result, names[i], getKeys, creator);
35
+ }
36
+
37
+ return result as AllDerives<ApiType>;
38
+ }
@@ -0,0 +1,32 @@
1
+
2
+ import type { BlockNumber, EventRecord, ExtrinsicStatus, H256, SignedBlock } from 'https://deno.land/x/pezkuwi/types/interfaces/index.ts';
3
+
4
+ import { isCompact } from 'https://deno.land/x/pezkuwi/util/mod.ts';
5
+
6
+ import { l } from './logging.ts';
7
+
8
+ export function filterEvents (txHash: H256, { block: { extrinsics, header } }: SignedBlock, allEvents: EventRecord[], status: ExtrinsicStatus): { events?: EventRecord[], txIndex?: number, blockNumber?: BlockNumber } {
9
+ // extrinsics to hashes
10
+ for (const [txIndex, x] of extrinsics.entries()) {
11
+ if (x.hash.eq(txHash)) {
12
+ return {
13
+ blockNumber: isCompact<BlockNumber>(header.number) ? header.number.unwrap() : header.number,
14
+ events: allEvents.filter(({ phase }) =>
15
+ phase.isApplyExtrinsic &&
16
+ phase.asApplyExtrinsic.eqn(txIndex)
17
+ ),
18
+ txIndex
19
+ };
20
+ }
21
+ }
22
+
23
+ // if we do get the block after finalized, it _should_ be there
24
+ // only warn on filtering with isInBlock (finalization finalizes after)
25
+ if (status.isInBlock) {
26
+ const allHashes = extrinsics.map((x) => x.hash.toHex());
27
+
28
+ l.warn(`block ${header.hash.toHex()}: Unable to find extrinsic ${txHash.toHex()} inside ${allHashes.join(', ')}`);
29
+ }
30
+
31
+ return {};
32
+ }
@@ -0,0 +1,6 @@
1
+
2
+ export { filterEvents } from './filterEvents.ts';
3
+ export { isKeyringPair } from './isKeyringPair.ts';
4
+ export { l } from './logging.ts';
5
+
6
+ export * from './decorate.ts';
@@ -0,0 +1,9 @@
1
+
2
+ import type { AccountId, Address } from 'https://deno.land/x/pezkuwi/types/interfaces/index.ts';
3
+ import type { IKeyringPair } from 'https://deno.land/x/pezkuwi/types/types/index.ts';
4
+
5
+ import { isFunction } from 'https://deno.land/x/pezkuwi/util/mod.ts';
6
+
7
+ export function isKeyringPair (account: string | IKeyringPair | AccountId | Address): account is IKeyringPair {
8
+ return isFunction((account as IKeyringPair).sign);
9
+ }
@@ -0,0 +1,4 @@
1
+
2
+ import { logger } from 'https://deno.land/x/pezkuwi/util/mod.ts';
3
+
4
+ export const l = /*#__PURE__*/ logger('api/util');
@@ -0,0 +1,32 @@
1
+
2
+ import type { SiLookupTypeId } from 'https://deno.land/x/pezkuwi/types/interfaces/index.ts';
3
+ import type { StorageEntry } from 'https://deno.land/x/pezkuwi/types/primitive/types.ts';
4
+ import type { Registry } from 'https://deno.land/x/pezkuwi/types/types/index.ts';
5
+
6
+ import { isUndefined } from 'https://deno.land/x/pezkuwi/util/mod.ts';
7
+
8
+ function sig ({ lookup }: Registry, { method, section }: StorageEntry, args: SiLookupTypeId[]): string {
9
+ return `${section}.${method}(${args.map((a) => lookup.getTypeDef(a).type).join(', ')})`;
10
+ }
11
+
12
+ export function extractStorageArgs (registry: Registry, creator: StorageEntry, _args: unknown[]): [StorageEntry, unknown[]] {
13
+ const args = _args.filter((a) => !isUndefined(a));
14
+
15
+ if (creator.meta.type.isPlain) {
16
+ if (args.length !== 0) {
17
+ throw new Error(`${sig(registry, creator, [])} does not take any arguments, ${args.length} found`);
18
+ }
19
+ } else {
20
+ const { hashers, key } = creator.meta.type.asMap;
21
+ const keys = hashers.length === 1
22
+ ? [key]
23
+ : registry.lookup.getSiType(key).def.asTuple.map((t) => t);
24
+
25
+ if (args.length !== keys.length) {
26
+ throw new Error(`${sig(registry, creator, keys)} is a map, requiring ${keys.length} arguments, ${args.length} found`);
27
+ }
28
+ }
29
+
30
+ // pass as tuple
31
+ return [creator, args];
32
+ }
@@ -0,0 +1 @@
1
+ import '@pezkuwi/api-augment';
@@ -0,0 +1,143 @@
1
+ import type { Observable } from 'rxjs';
2
+ import type { AugmentedCall, QueryableCalls } from '@pezkuwi/api-base/types';
3
+ import type { RpcInterface } from '@pezkuwi/rpc-core/types';
4
+ import type { Metadata, Text, Vec } from '@pezkuwi/types';
5
+ import type { Hash, RuntimeApiMethodMetadataV16, RuntimeVersion } from '@pezkuwi/types/interfaces';
6
+ import type { DecoratedMeta } from '@pezkuwi/types/metadata/decorate/types';
7
+ import type { AnyFunction, Codec, DefinitionCall, DefinitionCallNamed, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, DefinitionsCallEntry, DetectCodec, Registry, RegistryTypes } from '@pezkuwi/types/types';
8
+ import type { HexString } from '@pezkuwi/util/types';
9
+ import type { ApiDecoration, ApiInterfaceRx, ApiOptions, ApiTypes, DecoratedErrors, DecoratedEvents, DecoratedRpc, DecorateMethod, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types/index.js';
10
+ import type { AllDerives } from '../util/decorate.js';
11
+ import type { VersionedRegistry } from './types.js';
12
+ import { BehaviorSubject } from 'rxjs';
13
+ import { RpcCore } from '@pezkuwi/rpc-core';
14
+ import { BN } from '@pezkuwi/util';
15
+ import { Events } from './Events.js';
16
+ interface FullDecoration<ApiType extends ApiTypes> {
17
+ createdAt?: Uint8Array | undefined;
18
+ decoratedApi: ApiDecoration<ApiType>;
19
+ decoratedMeta: DecoratedMeta;
20
+ }
21
+ export declare abstract class Decorate<ApiType extends ApiTypes> extends Events {
22
+ #private;
23
+ protected __phantom: BN;
24
+ protected _type: ApiTypes;
25
+ protected _call: QueryableCalls<ApiType>;
26
+ protected _consts: QueryableConsts<ApiType>;
27
+ protected _derive?: ReturnType<Decorate<ApiType>['_decorateDerive']>;
28
+ protected _errors: DecoratedErrors<ApiType>;
29
+ protected _events: DecoratedEvents<ApiType>;
30
+ protected _extrinsics?: SubmittableExtrinsics<ApiType>;
31
+ protected _extrinsicType: number;
32
+ protected _genesisHash?: Hash;
33
+ protected _isConnected: BehaviorSubject<boolean>;
34
+ protected _isReady: boolean;
35
+ protected _query: QueryableStorage<ApiType>;
36
+ protected _queryMulti?: QueryableStorageMulti<ApiType>;
37
+ protected _rpc?: DecoratedRpc<ApiType, RpcInterface>;
38
+ protected _rpcCore: RpcCore & RpcInterface;
39
+ protected _runtimeMap: Record<HexString, string>;
40
+ protected _runtimeChain?: Text;
41
+ protected _runtimeMetadata?: Metadata;
42
+ protected _runtimeVersion?: RuntimeVersion;
43
+ protected _rx: ApiInterfaceRx;
44
+ protected readonly _options: ApiOptions;
45
+ /**
46
+ * This is the one and only method concrete children classes need to implement.
47
+ * It's a higher-order function, which takes one argument
48
+ * `method: Method extends (...args: any[]) => Observable<any>`
49
+ * (and one optional `options`), and should return the user facing method.
50
+ * For example:
51
+ * - For ApiRx, `decorateMethod` should just be identity, because the input
52
+ * function is already an Observable
53
+ * - For ApiPromise, `decorateMethod` should return a function that takes all
54
+ * the parameters from `method`, adds an optional `callback` argument, and
55
+ * returns a Promise.
56
+ *
57
+ * We could easily imagine other user-facing interfaces, which are simply
58
+ * implemented by transforming the Observable to Stream/Iterator/Kefir/Bacon
59
+ * via `decorateMethod`.
60
+ */
61
+ protected _decorateMethod: DecorateMethod<ApiType>;
62
+ /**
63
+ * @description Create an instance of the class
64
+ *
65
+ * @param options Options object to create API instance or a Provider instance
66
+ *
67
+ * @example
68
+ * <BR>
69
+ *
70
+ * ```javascript
71
+ * import Api from '@pezkuwi/api/promise';
72
+ *
73
+ * const api = new Api().isReady();
74
+ *
75
+ * api.rpc.subscribeNewHeads((header) => {
76
+ * console.log(`new block #${header.number.toNumber()}`);
77
+ * });
78
+ * ```
79
+ */
80
+ constructor(options: ApiOptions, type: ApiTypes, decorateMethod: DecorateMethod<ApiType>);
81
+ abstract at(blockHash: Uint8Array | string, knownVersion?: RuntimeVersion): Promise<ApiDecoration<ApiType>>;
82
+ /**
83
+ * @description Return the current used registry
84
+ */
85
+ get registry(): Registry;
86
+ /**
87
+ * @description Creates an instance of a type as registered
88
+ */
89
+ createType<T extends Codec = Codec, K extends string = string>(type: K, ...params: unknown[]): DetectCodec<T, K>;
90
+ /**
91
+ * @description Register additional user-defined of chain-specific types in the type registry
92
+ */
93
+ registerTypes(types?: RegistryTypes): void;
94
+ /**
95
+ * @returns `true` if the API operates with subscriptions
96
+ */
97
+ get hasSubscriptions(): boolean;
98
+ /**
99
+ * @returns `true` if the API decorate multi-key queries
100
+ */
101
+ get supportMulti(): boolean;
102
+ protected _emptyDecorated(registry: Registry, blockHash?: Uint8Array): ApiDecoration<ApiType>;
103
+ protected _createDecorated(registry: VersionedRegistry<ApiType>, fromEmpty: boolean, decoratedApi: ApiDecoration<ApiType> | null, blockHash?: Uint8Array): FullDecoration<ApiType>;
104
+ protected _injectMetadata(registry: VersionedRegistry<ApiType>, fromEmpty?: boolean): void;
105
+ /**
106
+ * @deprecated
107
+ * backwards compatible endpoint for metadata injection, may be removed in the future (However, it is still useful for testing injection)
108
+ */
109
+ injectMetadata(metadata: Metadata, fromEmpty?: boolean, registry?: Registry): void;
110
+ private _decorateFunctionMeta;
111
+ protected _filterRpc(methods: string[], additional: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>): void;
112
+ protected _filterRpcMethods(exposed: string[]): void;
113
+ private _rpcSubmitter;
114
+ protected _decorateRpc<ApiType extends ApiTypes>(rpc: RpcCore & RpcInterface, decorateMethod: DecorateMethod<ApiType>, input?: Partial<DecoratedRpc<ApiType, RpcInterface>>): DecoratedRpc<ApiType, RpcInterface>;
115
+ protected _addRuntimeDef(result: DefinitionsCall, additional?: DefinitionsCall): void;
116
+ protected _getRuntimeDefs(registry: Registry, specName: Text, chain?: Text | string): [string, DefinitionsCallEntry[]][];
117
+ protected _getMethods(registry: Registry, methods: Vec<RuntimeApiMethodMetadataV16>): Record<string, DefinitionCall>;
118
+ protected _getRuntimeDefsViaMetadata(registry: Registry): [string, DefinitionsCallEntry[]][];
119
+ protected _decorateCalls<ApiType extends ApiTypes>({ registry, runtimeVersion: { apis, specName, specVersion } }: VersionedRegistry<any>, decorateMethod: DecorateMethod<ApiType>, blockHash?: Uint8Array | string | null): QueryableCalls<ApiType>;
120
+ protected _decorateCall<ApiType extends ApiTypes>(registry: Registry, def: DefinitionCallNamed, stateCall: (method: string, bytes: Uint8Array) => Observable<Codec>, decorateMethod: DecorateMethod<ApiType>): AugmentedCall<ApiType>;
121
+ protected _decorateMulti<ApiType extends ApiTypes>(decorateMethod: DecorateMethod<ApiType>): QueryableStorageMulti<ApiType>;
122
+ protected _decorateMultiAt<ApiType extends ApiTypes>(atApi: ApiDecoration<ApiType>, decorateMethod: DecorateMethod<ApiType>, blockHash: Uint8Array | string): QueryableStorageMulti<ApiType>;
123
+ protected _decorateExtrinsics<ApiType extends ApiTypes>({ tx }: DecoratedMeta, decorateMethod: DecorateMethod<ApiType>): SubmittableExtrinsics<ApiType>;
124
+ private _decorateExtrinsicEntry;
125
+ protected _decorateStorage<ApiType extends ApiTypes>({ query, registry }: DecoratedMeta, decorateMethod: DecorateMethod<ApiType>, blockHash?: Uint8Array): QueryableStorage<ApiType>;
126
+ private _decorateStorageEntry;
127
+ private _decorateStorageEntryAt;
128
+ private _queueStorage;
129
+ private _decorateStorageCall;
130
+ private _retrieveMulti;
131
+ private _retrieveMapKeys;
132
+ private _retrieveMapKeysPaged;
133
+ private _retrieveMapEntries;
134
+ private _retrieveMapEntriesPaged;
135
+ protected _decorateDeriveRx(decorateMethod: DecorateMethod<ApiType>): AllDerives<'rxjs'>;
136
+ protected _decorateDerive(decorateMethod: DecorateMethod<ApiType>): AllDerives<ApiType>;
137
+ /**
138
+ * Put the `this.onCall` function of ApiRx here, because it is needed by
139
+ * `api._rx`.
140
+ */
141
+ protected _rxDecorateMethod: <Method extends AnyFunction>(method: Method) => Method;
142
+ }
143
+ export {};
@@ -0,0 +1,67 @@
1
+ import type { ApiInterfaceEvents } from '../types/index.js';
2
+ export declare class Events {
3
+ #private;
4
+ protected emit(type: ApiInterfaceEvents, ...args: unknown[]): boolean;
5
+ /**
6
+ * @description Attach an eventemitter handler to listen to a specific event
7
+ *
8
+ * @param type The type of event to listen to. Available events are `connected`, `disconnected`, `ready` and `error`
9
+ * @param handler The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments.
10
+ *
11
+ * @example
12
+ * <BR>
13
+ *
14
+ * ```javascript
15
+ * api.on('connected', (): void => {
16
+ * console.log('API has been connected to the endpoint');
17
+ * });
18
+ *
19
+ * api.on('disconnected', (): void => {
20
+ * console.log('API has been disconnected from the endpoint');
21
+ * });
22
+ * ```
23
+ */
24
+ on(type: ApiInterfaceEvents, handler: (...args: any[]) => any): this;
25
+ /**
26
+ * @description Remove the given eventemitter handler
27
+ *
28
+ * @param type The type of event the callback was attached to. Available events are `connected`, `disconnected`, `ready` and `error`
29
+ * @param handler The callback to unregister.
30
+ *
31
+ * @example
32
+ * <BR>
33
+ *
34
+ * ```javascript
35
+ * const handler = (): void => {
36
+ * console.log('Connected !);
37
+ * };
38
+ *
39
+ * // Start listening
40
+ * api.on('connected', handler);
41
+ *
42
+ * // Stop listening
43
+ * api.off('connected', handler);
44
+ * ```
45
+ */
46
+ off(type: ApiInterfaceEvents, handler: (...args: any[]) => any): this;
47
+ /**
48
+ * @description Attach an one-time eventemitter handler to listen to a specific event
49
+ *
50
+ * @param type The type of event to listen to. Available events are `connected`, `disconnected`, `ready` and `error`
51
+ * @param handler The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments.
52
+ *
53
+ * @example
54
+ * <BR>
55
+ *
56
+ * ```javascript
57
+ * api.once('connected', (): void => {
58
+ * console.log('API has been connected to the endpoint');
59
+ * });
60
+ *
61
+ * api.once('disconnected', (): void => {
62
+ * console.log('API has been disconnected from the endpoint');
63
+ * });
64
+ * ```
65
+ */
66
+ once(type: ApiInterfaceEvents, handler: (...args: any[]) => any): this;
67
+ }