@pezkuwi/api 16.5.12 → 16.5.14

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 (376) hide show
  1. package/{build/bundle-pezkuwi-api.js → bundle-pezkuwi-api.js} +1 -1
  2. package/{build/cjs → cjs}/packageInfo.js +1 -1
  3. package/package.json +11 -11
  4. package/{build-tsc-esm/packageInfo.js → packageInfo.js} +1 -1
  5. package/build/LICENSE +0 -201
  6. package/build/README.md +0 -100
  7. package/build/augment.js +0 -1
  8. package/build/base/Decorate.js +0 -752
  9. package/build/base/Events.js +0 -78
  10. package/build/base/Getters.js +0 -207
  11. package/build/base/Init.js +0 -400
  12. package/build/base/find.js +0 -7
  13. package/build/base/index.js +0 -57
  14. package/build/base/types.js +0 -1
  15. package/build/bundle.js +0 -7
  16. package/build/cjs/augment.d.ts +0 -1
  17. package/build/cjs/augment.js +0 -3
  18. package/build/cjs/base/Decorate.d.ts +0 -143
  19. package/build/cjs/base/Decorate.js +0 -756
  20. package/build/cjs/base/Events.d.ts +0 -67
  21. package/build/cjs/base/Events.js +0 -82
  22. package/build/cjs/base/Getters.d.ts +0 -163
  23. package/build/cjs/base/Getters.js +0 -211
  24. package/build/cjs/base/Init.d.ts +0 -44
  25. package/build/cjs/base/Init.js +0 -404
  26. package/build/cjs/base/find.d.ts +0 -3
  27. package/build/cjs/base/find.js +0 -11
  28. package/build/cjs/base/index.d.ts +0 -47
  29. package/build/cjs/base/index.js +0 -61
  30. package/build/cjs/base/types.d.ts +0 -15
  31. package/build/cjs/base/types.js +0 -2
  32. package/build/cjs/bundle.d.ts +0 -7
  33. package/build/cjs/bundle.js +0 -17
  34. package/build/cjs/index.js +0 -5
  35. package/build/cjs/promise/Api.js +0 -195
  36. package/build/cjs/promise/Combinator.js +0 -72
  37. package/build/cjs/promise/decorateMethod.js +0 -75
  38. package/build/cjs/promise/index.js +0 -7
  39. package/build/cjs/promise/types.js +0 -2
  40. package/build/cjs/rx/Api.js +0 -173
  41. package/build/cjs/rx/decorateMethod.js +0 -6
  42. package/build/cjs/rx/index.js +0 -7
  43. package/build/cjs/submittable/Result.js +0 -84
  44. package/build/cjs/submittable/createClass.js +0 -278
  45. package/build/cjs/submittable/createSubmittable.js +0 -8
  46. package/build/cjs/submittable/index.js +0 -7
  47. package/build/cjs/submittable/types.js +0 -2
  48. package/build/cjs/types/calls.js +0 -4
  49. package/build/cjs/types/consts.js +0 -4
  50. package/build/cjs/types/errors.js +0 -4
  51. package/build/cjs/types/events.js +0 -4
  52. package/build/cjs/types/index.js +0 -13
  53. package/build/cjs/types/storage.js +0 -4
  54. package/build/cjs/types/submittable.js +0 -4
  55. package/build/cjs/util/augmentObject.js +0 -84
  56. package/build/cjs/util/decorate.js +0 -17
  57. package/build/cjs/util/filterEvents.js +0 -25
  58. package/build/cjs/util/index.js +0 -11
  59. package/build/cjs/util/isKeyringPair.js +0 -7
  60. package/build/cjs/util/logging.js +0 -5
  61. package/build/cjs/util/validate.js +0 -26
  62. package/build/index.d.ts +0 -2
  63. package/build/index.js +0 -2
  64. package/build/package.json +0 -613
  65. package/build/packageDetect.d.ts +0 -1
  66. package/build/packageDetect.js +0 -8
  67. package/build/packageInfo.d.ts +0 -6
  68. package/build/packageInfo.js +0 -1
  69. package/build/promise/Api.d.ts +0 -158
  70. package/build/promise/Api.js +0 -191
  71. package/build/promise/Combinator.d.ts +0 -12
  72. package/build/promise/Combinator.js +0 -68
  73. package/build/promise/decorateMethod.d.ts +0 -14
  74. package/build/promise/decorateMethod.js +0 -71
  75. package/build/promise/index.d.ts +0 -2
  76. package/build/promise/index.js +0 -2
  77. package/build/promise/types.d.ts +0 -5
  78. package/build/promise/types.js +0 -1
  79. package/build/rx/Api.d.ts +0 -155
  80. package/build/rx/Api.js +0 -169
  81. package/build/rx/decorateMethod.d.ts +0 -3
  82. package/build/rx/decorateMethod.js +0 -3
  83. package/build/rx/index.d.ts +0 -2
  84. package/build/rx/index.js +0 -2
  85. package/build/submittable/Result.d.ts +0 -31
  86. package/build/submittable/Result.js +0 -80
  87. package/build/submittable/createClass.d.ts +0 -12
  88. package/build/submittable/createClass.js +0 -275
  89. package/build/submittable/createSubmittable.d.ts +0 -8
  90. package/build/submittable/createSubmittable.js +0 -5
  91. package/build/submittable/index.d.ts +0 -2
  92. package/build/submittable/index.js +0 -2
  93. package/build/submittable/types.d.ts +0 -1
  94. package/build/submittable/types.js +0 -1
  95. package/build/types/calls.d.ts +0 -1
  96. package/build/types/calls.js +0 -1
  97. package/build/types/consts.d.ts +0 -1
  98. package/build/types/consts.js +0 -1
  99. package/build/types/errors.d.ts +0 -1
  100. package/build/types/errors.js +0 -1
  101. package/build/types/events.d.ts +0 -1
  102. package/build/types/events.js +0 -1
  103. package/build/types/index.d.ts +0 -114
  104. package/build/types/index.js +0 -8
  105. package/build/types/storage.d.ts +0 -1
  106. package/build/types/storage.js +0 -1
  107. package/build/types/submittable.d.ts +0 -1
  108. package/build/types/submittable.js +0 -1
  109. package/build/util/augmentObject.d.ts +0 -9
  110. package/build/util/augmentObject.js +0 -81
  111. package/build/util/decorate.d.ts +0 -16
  112. package/build/util/decorate.js +0 -14
  113. package/build/util/filterEvents.d.ts +0 -6
  114. package/build/util/filterEvents.js +0 -22
  115. package/build/util/index.d.ts +0 -4
  116. package/build/util/index.js +0 -4
  117. package/build/util/isKeyringPair.d.ts +0 -3
  118. package/build/util/isKeyringPair.js +0 -4
  119. package/build/util/logging.d.ts +0 -1
  120. package/build/util/logging.js +0 -2
  121. package/build/util/validate.d.ts +0 -3
  122. package/build/util/validate.js +0 -23
  123. package/build-deno/README.md +0 -95
  124. package/build-deno/augment.ts +0 -2
  125. package/build-deno/base/Decorate.ts +0 -1100
  126. package/build-deno/base/Events.ts +0 -89
  127. package/build-deno/base/Getters.ts +0 -243
  128. package/build-deno/base/Init.ts +0 -523
  129. package/build-deno/base/find.ts +0 -12
  130. package/build-deno/base/index.ts +0 -83
  131. package/build-deno/base/types.ts +0 -17
  132. package/build-deno/bundle.ts +0 -11
  133. package/build-deno/checkTypes.manual.ts +0 -320
  134. package/build-deno/index.ts +0 -4
  135. package/build-deno/mod.ts +0 -2
  136. package/build-deno/packageDetect.ts +0 -12
  137. package/build-deno/packageInfo.ts +0 -3
  138. package/build-deno/promise/Api.ts +0 -212
  139. package/build-deno/promise/Combinator.ts +0 -89
  140. package/build-deno/promise/decorateMethod.ts +0 -111
  141. package/build-deno/promise/index.ts +0 -3
  142. package/build-deno/promise/types.ts +0 -7
  143. package/build-deno/rx/Api.ts +0 -184
  144. package/build-deno/rx/decorateMethod.ts +0 -7
  145. package/build-deno/rx/index.ts +0 -3
  146. package/build-deno/submittable/Result.ts +0 -109
  147. package/build-deno/submittable/createClass.ts +0 -437
  148. package/build-deno/submittable/createSubmittable.ts +0 -17
  149. package/build-deno/submittable/index.ts +0 -3
  150. package/build-deno/submittable/types.ts +0 -2
  151. package/build-deno/test/SingleAccountSigner.ts +0 -51
  152. package/build-deno/test/index.ts +0 -3
  153. package/build-deno/test/logEvents.ts +0 -21
  154. package/build-deno/types/calls.ts +0 -2
  155. package/build-deno/types/consts.ts +0 -2
  156. package/build-deno/types/errors.ts +0 -2
  157. package/build-deno/types/events.ts +0 -2
  158. package/build-deno/types/index.ts +0 -124
  159. package/build-deno/types/storage.ts +0 -2
  160. package/build-deno/types/submittable.ts +0 -2
  161. package/build-deno/util/augmentObject.ts +0 -109
  162. package/build-deno/util/decorate.ts +0 -38
  163. package/build-deno/util/filterEvents.ts +0 -32
  164. package/build-deno/util/index.ts +0 -6
  165. package/build-deno/util/isKeyringPair.ts +0 -9
  166. package/build-deno/util/logging.ts +0 -4
  167. package/build-deno/util/validate.ts +0 -32
  168. package/build-tsc-cjs/packageDetect.js +0 -10
  169. package/build-tsc-cjs/packageInfo.js +0 -4
  170. package/src/augment.ts +0 -4
  171. package/src/base/Decorate.ts +0 -1103
  172. package/src/base/Events.ts +0 -91
  173. package/src/base/Getters.ts +0 -245
  174. package/src/base/Init.ts +0 -525
  175. package/src/base/find.ts +0 -14
  176. package/src/base/index.ts +0 -85
  177. package/src/base/types.ts +0 -19
  178. package/src/bundle.ts +0 -16
  179. package/src/checkTypes.manual.ts +0 -323
  180. package/src/index.ts +0 -6
  181. package/src/mod.ts +0 -4
  182. package/src/packageDetect.ts +0 -16
  183. package/src/packageInfo.ts +0 -6
  184. package/src/promise/Api.ts +0 -214
  185. package/src/promise/Combinator.ts +0 -91
  186. package/src/promise/Combinators.spec.ts +0 -109
  187. package/src/promise/decorateMethod.ts +0 -118
  188. package/src/promise/index.spec.ts +0 -167
  189. package/src/promise/index.ts +0 -5
  190. package/src/promise/types.ts +0 -9
  191. package/src/rx/Api.ts +0 -186
  192. package/src/rx/decorateMethod.ts +0 -9
  193. package/src/rx/index.ts +0 -5
  194. package/src/submittable/Result.ts +0 -111
  195. package/src/submittable/createClass.ts +0 -439
  196. package/src/submittable/createSubmittable.ts +0 -19
  197. package/src/submittable/index.ts +0 -5
  198. package/src/submittable/types.ts +0 -4
  199. package/src/test/SingleAccountSigner.ts +0 -53
  200. package/src/test/index.ts +0 -5
  201. package/src/test/logEvents.ts +0 -24
  202. package/src/types/calls.ts +0 -4
  203. package/src/types/consts.ts +0 -4
  204. package/src/types/errors.ts +0 -4
  205. package/src/types/events.ts +0 -4
  206. package/src/types/index.ts +0 -137
  207. package/src/types/storage.ts +0 -4
  208. package/src/types/submittable.ts +0 -4
  209. package/src/util/augmentObject.spec.ts +0 -54
  210. package/src/util/augmentObject.ts +0 -112
  211. package/src/util/decorate.ts +0 -43
  212. package/src/util/filterEvents.ts +0 -34
  213. package/src/util/index.ts +0 -10
  214. package/src/util/isKeyringPair.ts +0 -11
  215. package/src/util/logging.ts +0 -6
  216. package/src/util/validate.spec.ts +0 -72
  217. package/src/util/validate.ts +0 -36
  218. package/tsconfig.build.json +0 -25
  219. package/tsconfig.build.tsbuildinfo +0 -1
  220. package/tsconfig.spec.json +0 -26
  221. package/tsconfig.spec.tsbuildinfo +0 -1
  222. /package/{build-tsc/augment.d.ts → augment.d.ts} +0 -0
  223. /package/{build-tsc-esm/augment.js → augment.js} +0 -0
  224. /package/{build-tsc/base → base}/Decorate.d.ts +0 -0
  225. /package/{build-tsc-esm/base → base}/Decorate.js +0 -0
  226. /package/{build-tsc/base → base}/Events.d.ts +0 -0
  227. /package/{build-tsc-esm/base → base}/Events.js +0 -0
  228. /package/{build-tsc/base → base}/Getters.d.ts +0 -0
  229. /package/{build-tsc-esm/base → base}/Getters.js +0 -0
  230. /package/{build-tsc/base → base}/Init.d.ts +0 -0
  231. /package/{build-tsc-esm/base → base}/Init.js +0 -0
  232. /package/{build-tsc/base → base}/find.d.ts +0 -0
  233. /package/{build-tsc-esm/base → base}/find.js +0 -0
  234. /package/{build-tsc/base → base}/index.d.ts +0 -0
  235. /package/{build-tsc-esm/base → base}/index.js +0 -0
  236. /package/{build-tsc/base → base}/types.d.ts +0 -0
  237. /package/{build-tsc-esm/base → base}/types.js +0 -0
  238. /package/{build-tsc/bundle.d.ts → bundle.d.ts} +0 -0
  239. /package/{build-tsc-esm/bundle.js → bundle.js} +0 -0
  240. /package/{build → cjs}/augment.d.ts +0 -0
  241. /package/{build-tsc-cjs → cjs}/augment.js +0 -0
  242. /package/{build → cjs}/base/Decorate.d.ts +0 -0
  243. /package/{build-tsc-cjs → cjs}/base/Decorate.js +0 -0
  244. /package/{build → cjs}/base/Events.d.ts +0 -0
  245. /package/{build-tsc-cjs → cjs}/base/Events.js +0 -0
  246. /package/{build → cjs}/base/Getters.d.ts +0 -0
  247. /package/{build-tsc-cjs → cjs}/base/Getters.js +0 -0
  248. /package/{build → cjs}/base/Init.d.ts +0 -0
  249. /package/{build-tsc-cjs → cjs}/base/Init.js +0 -0
  250. /package/{build → cjs}/base/find.d.ts +0 -0
  251. /package/{build-tsc-cjs → cjs}/base/find.js +0 -0
  252. /package/{build → cjs}/base/index.d.ts +0 -0
  253. /package/{build-tsc-cjs → cjs}/base/index.js +0 -0
  254. /package/{build → cjs}/base/types.d.ts +0 -0
  255. /package/{build-tsc-cjs → cjs}/base/types.js +0 -0
  256. /package/{build → cjs}/bundle.d.ts +0 -0
  257. /package/{build-tsc-cjs → cjs}/bundle.js +0 -0
  258. /package/{build-tsc → cjs}/index.d.ts +0 -0
  259. /package/{build-tsc-cjs → cjs}/index.js +0 -0
  260. /package/{build/cjs → cjs}/package.json +0 -0
  261. /package/{build-tsc → cjs}/packageDetect.d.ts +0 -0
  262. /package/{build/cjs → cjs}/packageDetect.js +0 -0
  263. /package/{build-tsc → cjs}/packageInfo.d.ts +0 -0
  264. /package/{build-tsc → cjs}/promise/Api.d.ts +0 -0
  265. /package/{build-tsc-cjs → cjs}/promise/Api.js +0 -0
  266. /package/{build-tsc → cjs}/promise/Combinator.d.ts +0 -0
  267. /package/{build-tsc-cjs → cjs}/promise/Combinator.js +0 -0
  268. /package/{build-tsc → cjs}/promise/decorateMethod.d.ts +0 -0
  269. /package/{build-tsc-cjs → cjs}/promise/decorateMethod.js +0 -0
  270. /package/{build-tsc → cjs}/promise/index.d.ts +0 -0
  271. /package/{build-tsc-cjs → cjs}/promise/index.js +0 -0
  272. /package/{build-tsc → cjs}/promise/types.d.ts +0 -0
  273. /package/{build-tsc-cjs → cjs}/promise/types.js +0 -0
  274. /package/{build-tsc → cjs}/rx/Api.d.ts +0 -0
  275. /package/{build-tsc-cjs → cjs}/rx/Api.js +0 -0
  276. /package/{build-tsc → cjs}/rx/decorateMethod.d.ts +0 -0
  277. /package/{build-tsc-cjs → cjs}/rx/decorateMethod.js +0 -0
  278. /package/{build-tsc → cjs}/rx/index.d.ts +0 -0
  279. /package/{build-tsc-cjs → cjs}/rx/index.js +0 -0
  280. /package/{build-tsc → cjs}/submittable/Result.d.ts +0 -0
  281. /package/{build-tsc-cjs → cjs}/submittable/Result.js +0 -0
  282. /package/{build-tsc → cjs}/submittable/createClass.d.ts +0 -0
  283. /package/{build-tsc-cjs → cjs}/submittable/createClass.js +0 -0
  284. /package/{build-tsc → cjs}/submittable/createSubmittable.d.ts +0 -0
  285. /package/{build-tsc-cjs → cjs}/submittable/createSubmittable.js +0 -0
  286. /package/{build-tsc → cjs}/submittable/index.d.ts +0 -0
  287. /package/{build-tsc-cjs → cjs}/submittable/index.js +0 -0
  288. /package/{build-tsc → cjs}/submittable/types.d.ts +0 -0
  289. /package/{build-tsc-cjs → cjs}/submittable/types.js +0 -0
  290. /package/{build-tsc → cjs}/types/calls.d.ts +0 -0
  291. /package/{build-tsc-cjs → cjs}/types/calls.js +0 -0
  292. /package/{build-tsc → cjs}/types/consts.d.ts +0 -0
  293. /package/{build-tsc-cjs → cjs}/types/consts.js +0 -0
  294. /package/{build-tsc → cjs}/types/errors.d.ts +0 -0
  295. /package/{build-tsc-cjs → cjs}/types/errors.js +0 -0
  296. /package/{build-tsc → cjs}/types/events.d.ts +0 -0
  297. /package/{build-tsc-cjs → cjs}/types/events.js +0 -0
  298. /package/{build-tsc → cjs}/types/index.d.ts +0 -0
  299. /package/{build-tsc-cjs → cjs}/types/index.js +0 -0
  300. /package/{build-tsc → cjs}/types/storage.d.ts +0 -0
  301. /package/{build-tsc-cjs → cjs}/types/storage.js +0 -0
  302. /package/{build-tsc → cjs}/types/submittable.d.ts +0 -0
  303. /package/{build-tsc-cjs → cjs}/types/submittable.js +0 -0
  304. /package/{build-tsc → cjs}/util/augmentObject.d.ts +0 -0
  305. /package/{build-tsc-cjs → cjs}/util/augmentObject.js +0 -0
  306. /package/{build-tsc → cjs}/util/decorate.d.ts +0 -0
  307. /package/{build-tsc-cjs → cjs}/util/decorate.js +0 -0
  308. /package/{build-tsc → cjs}/util/filterEvents.d.ts +0 -0
  309. /package/{build-tsc-cjs → cjs}/util/filterEvents.js +0 -0
  310. /package/{build-tsc → cjs}/util/index.d.ts +0 -0
  311. /package/{build-tsc-cjs → cjs}/util/index.js +0 -0
  312. /package/{build-tsc → cjs}/util/isKeyringPair.d.ts +0 -0
  313. /package/{build-tsc-cjs → cjs}/util/isKeyringPair.js +0 -0
  314. /package/{build-tsc → cjs}/util/logging.d.ts +0 -0
  315. /package/{build-tsc-cjs → cjs}/util/logging.js +0 -0
  316. /package/{build-tsc → cjs}/util/validate.d.ts +0 -0
  317. /package/{build-tsc-cjs → cjs}/util/validate.js +0 -0
  318. /package/{build/cjs/index.d.ts → index.d.ts} +0 -0
  319. /package/{build-tsc-esm/index.js → index.js} +0 -0
  320. /package/{build/cjs/packageDetect.d.ts → packageDetect.d.ts} +0 -0
  321. /package/{build-tsc-esm/packageDetect.js → packageDetect.js} +0 -0
  322. /package/{build/cjs/packageInfo.d.ts → packageInfo.d.ts} +0 -0
  323. /package/{build/cjs/promise → promise}/Api.d.ts +0 -0
  324. /package/{build-tsc-esm/promise → promise}/Api.js +0 -0
  325. /package/{build/cjs/promise → promise}/Combinator.d.ts +0 -0
  326. /package/{build-tsc-esm/promise → promise}/Combinator.js +0 -0
  327. /package/{build/cjs/promise → promise}/decorateMethod.d.ts +0 -0
  328. /package/{build-tsc-esm/promise → promise}/decorateMethod.js +0 -0
  329. /package/{build/cjs/promise → promise}/index.d.ts +0 -0
  330. /package/{build-tsc-esm/promise → promise}/index.js +0 -0
  331. /package/{build/cjs/promise → promise}/types.d.ts +0 -0
  332. /package/{build-tsc-esm/promise → promise}/types.js +0 -0
  333. /package/{build/cjs/rx → rx}/Api.d.ts +0 -0
  334. /package/{build-tsc-esm/rx → rx}/Api.js +0 -0
  335. /package/{build/cjs/rx → rx}/decorateMethod.d.ts +0 -0
  336. /package/{build-tsc-esm/rx → rx}/decorateMethod.js +0 -0
  337. /package/{build/cjs/rx → rx}/index.d.ts +0 -0
  338. /package/{build-tsc-esm/rx → rx}/index.js +0 -0
  339. /package/{build/cjs/submittable → submittable}/Result.d.ts +0 -0
  340. /package/{build-tsc-esm/submittable → submittable}/Result.js +0 -0
  341. /package/{build/cjs/submittable → submittable}/createClass.d.ts +0 -0
  342. /package/{build-tsc-esm/submittable → submittable}/createClass.js +0 -0
  343. /package/{build/cjs/submittable → submittable}/createSubmittable.d.ts +0 -0
  344. /package/{build-tsc-esm/submittable → submittable}/createSubmittable.js +0 -0
  345. /package/{build/cjs/submittable → submittable}/index.d.ts +0 -0
  346. /package/{build-tsc-esm/submittable → submittable}/index.js +0 -0
  347. /package/{build/cjs/submittable → submittable}/types.d.ts +0 -0
  348. /package/{build-tsc-esm/submittable → submittable}/types.js +0 -0
  349. /package/{build/cjs/types → types}/calls.d.ts +0 -0
  350. /package/{build-tsc-esm/types → types}/calls.js +0 -0
  351. /package/{build/cjs/types → types}/consts.d.ts +0 -0
  352. /package/{build-tsc-esm/types → types}/consts.js +0 -0
  353. /package/{build/cjs/types → types}/errors.d.ts +0 -0
  354. /package/{build-tsc-esm/types → types}/errors.js +0 -0
  355. /package/{build/cjs/types → types}/events.d.ts +0 -0
  356. /package/{build-tsc-esm/types → types}/events.js +0 -0
  357. /package/{build/cjs/types → types}/index.d.ts +0 -0
  358. /package/{build-tsc-esm/types → types}/index.js +0 -0
  359. /package/{build/cjs/types → types}/storage.d.ts +0 -0
  360. /package/{build-tsc-esm/types → types}/storage.js +0 -0
  361. /package/{build/cjs/types → types}/submittable.d.ts +0 -0
  362. /package/{build-tsc-esm/types → types}/submittable.js +0 -0
  363. /package/{build/cjs/util → util}/augmentObject.d.ts +0 -0
  364. /package/{build-tsc-esm/util → util}/augmentObject.js +0 -0
  365. /package/{build/cjs/util → util}/decorate.d.ts +0 -0
  366. /package/{build-tsc-esm/util → util}/decorate.js +0 -0
  367. /package/{build/cjs/util → util}/filterEvents.d.ts +0 -0
  368. /package/{build-tsc-esm/util → util}/filterEvents.js +0 -0
  369. /package/{build/cjs/util → util}/index.d.ts +0 -0
  370. /package/{build-tsc-esm/util → util}/index.js +0 -0
  371. /package/{build/cjs/util → util}/isKeyringPair.d.ts +0 -0
  372. /package/{build-tsc-esm/util → util}/isKeyringPair.js +0 -0
  373. /package/{build/cjs/util → util}/logging.d.ts +0 -0
  374. /package/{build-tsc-esm/util → util}/logging.js +0 -0
  375. /package/{build/cjs/util → util}/validate.d.ts +0 -0
  376. /package/{build-tsc-esm/util → util}/validate.js +0 -0
package/build/rx/Api.js DELETED
@@ -1,169 +0,0 @@
1
- import { from } from 'rxjs';
2
- import { objectSpread } from '@pezkuwi/util';
3
- import { ApiBase } from '../base/index.js';
4
- import { toRxMethod } from './decorateMethod.js';
5
- /**
6
- * # @pezkuwi/api/rx
7
- *
8
- * ## Overview
9
- *
10
- * @name ApiRx
11
- *
12
- * @description
13
- * ApiRx is a powerful RxJS Observable wrapper around the RPC and interfaces on the Pezkuwi network. As a full Observable API, all interface calls return RxJS Observables, including the static `.create(...)`. In the same fashion and subscription-based methods return long-running Observables that update with the latest values.
14
- *
15
- * The API is well suited to real-time applications where the latest state is needed, unlocking the subscription-based features of Pezkuwi (and Bizinikiwi) clients. Some familiarity with RxJS is a requirement to use the API, however just understanding `.subscribe` and `.pipe` on Observables will unlock full-scale use thereof.
16
- *
17
- * @see [[ApiPromise]]
18
- *
19
- * ## Usage
20
- *
21
- * Making rpc calls -
22
- * <BR>
23
- *
24
- * ```javascript
25
- * import ApiRx from '@pezkuwi/api/rx';
26
- *
27
- * // initialize via Promise & static create
28
- * const api = await ApiRx.create().toPromise();
29
- *
30
- * // make a call to retrieve the current network head
31
- * api.rpc.chain.subscribeNewHeads().subscribe((header) => {
32
- * console.log(`Chain is at #${header.number}`);
33
- * });
34
- * ```
35
- * <BR>
36
- *
37
- * Subscribing to chain state -
38
- * <BR>
39
- *
40
- * ```javascript
41
- * import { combineLatest, pairwise, switchMap } from 'rxjs';
42
- * import { ApiRx, WsProvider } from '@pezkuwi/api';
43
- *
44
- *
45
- * // initialize a provider with a specific endpoint
46
- * const provider = new WsProvider('wss://example.com:9944')
47
- *
48
- * // initialize via isReady & new with specific provider
49
- * new ApiRx({ provider })
50
- * .isReady
51
- * .pipe(
52
- * switchMap((api) =>
53
- * combineLatest([
54
- * api.query.timestamp.blockPeriod(),
55
- * api.query.timestamp.now().pipe(pairwise())
56
- * ])
57
- * )
58
- * )
59
- * .subscribe(([blockPeriod, timestamp]) => {
60
- * const elapsed = timestamp[1].toNumber() - timestamp[0].toNumber();
61
- * console.log(`timestamp ${timestamp[1]} \nelapsed ${elapsed} \n(${blockPeriod}s target)`);
62
- * });
63
- * ```
64
- * <BR>
65
- *
66
- * Submitting a transaction -
67
- * <BR>
68
- *
69
- * ```javascript
70
- * import { first, switchMap } from 'rxjs';
71
- * import ApiRx from '@pezkuwi/api/rx';
72
- *
73
- * // import the test keyring (already has dev keys for Alice, Bob, Charlie, Eve & Ferdie)
74
- * import testingPairs from '@pezkuwi/keyring/testingPairs';
75
- * const keyring = testingPairs();
76
- *
77
- * // get api via Promise
78
- * const api = await ApiRx.create().toPromise();
79
- *
80
- * // retrieve nonce for the account
81
- * api.query.system
82
- * .account(keyring.alice.address)
83
- * .pipe(
84
- * first(),
85
- * // pipe nonce into transfer
86
- * switchMap(([nonce]) =>
87
- * api.tx.balances
88
- * // create transfer
89
- * .transferAllowDeath(keyring.bob.address, 12345)
90
- * // sign the transaction
91
- * .sign(keyring.alice, { nonce })
92
- * // send the transaction
93
- * .send()
94
- * )
95
- * )
96
- * // subscribe to overall result
97
- * .subscribe(({ status }) => {
98
- * if (status.isInBlock) {
99
- * console.log('Completed at block hash', status.asFinalized.toHex());
100
- * }
101
- * });
102
- * ```
103
- */
104
- export class ApiRx extends ApiBase {
105
- #isReadyRx;
106
- /**
107
- * @description Create an instance of the ApiRx class
108
- * @param options Options to create an instance. Can be either [[ApiOptions]] or [[WsProvider]]
109
- * @example
110
- * <BR>
111
- *
112
- * ```javascript
113
- * import { switchMap } from 'rxjs';
114
- * import Api from '@pezkuwi/api/rx';
115
- *
116
- * new Api().isReady
117
- * .pipe(
118
- * switchMap((api) =>
119
- * api.rpc.chain.subscribeNewHeads()
120
- * ))
121
- * .subscribe((header) => {
122
- * console.log(`new block #${header.number.toNumber()}`);
123
- * });
124
- * ```
125
- */
126
- constructor(options) {
127
- super(options, 'rxjs', toRxMethod);
128
- this.#isReadyRx = from(
129
- // You can create an observable from an event, however my mind groks this form better
130
- new Promise((resolve) => {
131
- super.on('ready', () => resolve(this));
132
- }));
133
- }
134
- /**
135
- * @description Creates an ApiRx instance using the supplied provider. Returns an Observable containing the actual Api instance.
136
- * @param options options that is passed to the class constructor. Can be either [[ApiOptions]] or [[WsProvider]]
137
- * @example
138
- * <BR>
139
- *
140
- * ```javascript
141
- * import { switchMap } from 'rxjs';
142
- * import Api from '@pezkuwi/api/rx';
143
- *
144
- * Api.create()
145
- * .pipe(
146
- * switchMap((api) =>
147
- * api.rpc.chain.subscribeNewHeads()
148
- * ))
149
- * .subscribe((header) => {
150
- * console.log(`new block #${header.number.toNumber()}`);
151
- * });
152
- * ```
153
- */
154
- static create(options) {
155
- return new ApiRx(options).isReady;
156
- }
157
- /**
158
- * @description Observable that returns the first time we are connected and loaded
159
- */
160
- get isReady() {
161
- return this.#isReadyRx;
162
- }
163
- /**
164
- * @description Returns a clone of this ApiRx instance (new underlying provider connection)
165
- */
166
- clone() {
167
- return new ApiRx(objectSpread({}, this._options, { source: this }));
168
- }
169
- }
@@ -1,3 +0,0 @@
1
- import type { Codec } from '@pezkuwi/types/types';
2
- import type { DecorateFn } from '../types/index.js';
3
- export declare function toRxMethod<M extends DecorateFn<Codec>>(method: M): M;
@@ -1,3 +0,0 @@
1
- export function toRxMethod(method) {
2
- return method;
3
- }
@@ -1,2 +0,0 @@
1
- export { ApiRx } from './Api.js';
2
- export { toRxMethod } from './decorateMethod.js';
package/build/rx/index.js DELETED
@@ -1,2 +0,0 @@
1
- export { ApiRx } from './Api.js';
2
- export { toRxMethod } from './decorateMethod.js';
@@ -1,31 +0,0 @@
1
- import type { BlockNumber, DispatchError, DispatchInfo, EventRecord, ExtrinsicStatus, Hash } from '@pezkuwi/types/interfaces';
2
- import type { AnyJson, ISubmittableResult } from '@pezkuwi/types/types';
3
- import type { SubmittableResultValue } from './types.js';
4
- export declare class SubmittableResult implements ISubmittableResult {
5
- readonly dispatchError?: DispatchError | undefined;
6
- readonly dispatchInfo?: DispatchInfo | undefined;
7
- readonly internalError?: Error | undefined;
8
- readonly events: EventRecord[];
9
- readonly status: ExtrinsicStatus;
10
- readonly txHash: Hash;
11
- readonly txIndex?: number | undefined;
12
- readonly blockNumber?: BlockNumber | undefined;
13
- constructor({ blockNumber, dispatchError, dispatchInfo, events, internalError, status, txHash, txIndex }: SubmittableResultValue);
14
- get isCompleted(): boolean;
15
- get isError(): boolean;
16
- get isFinalized(): boolean;
17
- get isInBlock(): boolean;
18
- get isWarning(): boolean;
19
- /**
20
- * @description Filters EventRecords for the specified method & section (there could be multiple)
21
- */
22
- filterRecords(section: string, method: string | string[]): EventRecord[];
23
- /**
24
- * @description Finds an EventRecord for the specified method & section
25
- */
26
- findRecord(section: string, method: string | string[]): EventRecord | undefined;
27
- /**
28
- * @description Creates a human representation of the output
29
- */
30
- toHuman(isExtended?: boolean): AnyJson;
31
- }
@@ -1,80 +0,0 @@
1
- const recordIdentity = (record) => record;
2
- function filterAndApply(events, section, methods, onFound) {
3
- return events
4
- .filter(({ event }) => section === event.section &&
5
- methods.includes(event.method))
6
- .map((record) => onFound(record));
7
- }
8
- function getDispatchError({ event: { data: [dispatchError] } }) {
9
- return dispatchError;
10
- }
11
- function getDispatchInfo({ event: { data, method } }) {
12
- return method === 'ExtrinsicSuccess'
13
- ? data[0]
14
- : data[1];
15
- }
16
- function extractError(events = []) {
17
- return filterAndApply(events, 'system', ['ExtrinsicFailed'], getDispatchError)[0];
18
- }
19
- function extractInfo(events = []) {
20
- return filterAndApply(events, 'system', ['ExtrinsicFailed', 'ExtrinsicSuccess'], getDispatchInfo)[0];
21
- }
22
- export class SubmittableResult {
23
- dispatchError;
24
- dispatchInfo;
25
- internalError;
26
- events;
27
- status;
28
- txHash;
29
- txIndex;
30
- blockNumber;
31
- constructor({ blockNumber, dispatchError, dispatchInfo, events, internalError, status, txHash, txIndex }) {
32
- this.dispatchError = dispatchError || extractError(events);
33
- this.dispatchInfo = dispatchInfo || extractInfo(events);
34
- this.events = events || [];
35
- this.internalError = internalError;
36
- this.status = status;
37
- this.txHash = txHash;
38
- this.txIndex = txIndex;
39
- this.blockNumber = blockNumber;
40
- }
41
- get isCompleted() {
42
- return this.isError || this.status.isInBlock || this.status.isFinalized;
43
- }
44
- get isError() {
45
- return this.status.isDropped || this.status.isFinalityTimeout || this.status.isInvalid || this.status.isUsurped;
46
- }
47
- get isFinalized() {
48
- return this.status.isFinalized;
49
- }
50
- get isInBlock() {
51
- return this.status.isInBlock;
52
- }
53
- get isWarning() {
54
- return this.status.isRetracted;
55
- }
56
- /**
57
- * @description Filters EventRecords for the specified method & section (there could be multiple)
58
- */
59
- filterRecords(section, method) {
60
- return filterAndApply(this.events, section, Array.isArray(method) ? method : [method], recordIdentity);
61
- }
62
- /**
63
- * @description Finds an EventRecord for the specified method & section
64
- */
65
- findRecord(section, method) {
66
- return this.filterRecords(section, method)[0];
67
- }
68
- /**
69
- * @description Creates a human representation of the output
70
- */
71
- toHuman(isExtended) {
72
- return {
73
- dispatchError: this.dispatchError?.toHuman(),
74
- dispatchInfo: this.dispatchInfo?.toHuman(),
75
- events: this.events.map((e) => e.toHuman(isExtended)),
76
- internalError: this.internalError?.message.toString(),
77
- status: this.status.toHuman(isExtended)
78
- };
79
- }
80
- }
@@ -1,12 +0,0 @@
1
- import type { CodecClass } from '@pezkuwi/types/types';
2
- import type { ApiBase } from '../base/index.js';
3
- import type { ApiInterfaceRx, ApiTypes } from '../types/index.js';
4
- import type { SubmittableExtrinsic } from './types.js';
5
- interface SubmittableOptions<ApiType extends ApiTypes> {
6
- api: ApiInterfaceRx;
7
- apiType: ApiTypes;
8
- blockHash?: Uint8Array | undefined;
9
- decorateMethod: ApiBase<ApiType>['_decorateMethod'];
10
- }
11
- export declare function createClass<ApiType extends ApiTypes>({ api, apiType, blockHash, decorateMethod }: SubmittableOptions<ApiType>): CodecClass<SubmittableExtrinsic<ApiType>>;
12
- export {};
@@ -1,275 +0,0 @@
1
- import { catchError, first, map, mergeMap, of, switchMap, tap } from 'rxjs';
2
- import { identity, isBn, isFunction, isNumber, isString, isU8a, objectSpread } from '@pezkuwi/util';
3
- import { filterEvents, isKeyringPair } from '../util/index.js';
4
- import { SubmittableResult } from './Result.js';
5
- function makeEraOptions(api, registry, partialOptions, { header, mortalLength, nonce }) {
6
- if (!header) {
7
- if (partialOptions.era && !partialOptions.blockHash) {
8
- throw new Error('Expected blockHash to be passed alongside non-immortal era options');
9
- }
10
- if (isNumber(partialOptions.era)) {
11
- // since we have no header, it is immortal, remove any option overrides
12
- // so we only supply the genesisHash and no era to the construction
13
- delete partialOptions.era;
14
- delete partialOptions.blockHash;
15
- }
16
- return makeSignOptions(api, partialOptions, { nonce });
17
- }
18
- return makeSignOptions(api, partialOptions, {
19
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
- blockHash: header.hash,
21
- era: registry.createTypeUnsafe('ExtrinsicEra', [{
22
- current: header.number,
23
- period: partialOptions.era || mortalLength
24
- }]),
25
- nonce
26
- });
27
- }
28
- function makeSignAndSendOptions(partialOptions, statusCb) {
29
- let options = {};
30
- if (isFunction(partialOptions)) {
31
- statusCb = partialOptions;
32
- }
33
- else {
34
- options = objectSpread({}, partialOptions);
35
- }
36
- return [options, statusCb];
37
- }
38
- function makeSignOptions(api, partialOptions, extras) {
39
- return objectSpread({ blockHash: api.genesisHash, genesisHash: api.genesisHash }, partialOptions, extras, { runtimeVersion: api.runtimeVersion, signedExtensions: api.registry.signedExtensions, version: api.extrinsicType });
40
- }
41
- function optionsOrNonce(partialOptions = {}) {
42
- return isBn(partialOptions) || isNumber(partialOptions)
43
- ? { nonce: partialOptions }
44
- : partialOptions;
45
- }
46
- export function createClass({ api, apiType, blockHash, decorateMethod }) {
47
- // an instance of the base extrinsic for us to extend
48
- const ExtrinsicBase = api.registry.createClass('Extrinsic');
49
- const extrinsicInfoMap = new WeakMap();
50
- class Submittable extends ExtrinsicBase {
51
- #ignoreStatusCb;
52
- #transformResult = (identity);
53
- constructor(registry, extrinsic) {
54
- super(registry, extrinsic, { version: api.extrinsicType });
55
- this.#ignoreStatusCb = apiType === 'rxjs';
56
- }
57
- get hasDryRun() {
58
- return isFunction(api.rpc.system?.dryRun);
59
- }
60
- get hasPaymentInfo() {
61
- return isFunction(api.call.transactionPaymentApi?.queryInfo);
62
- }
63
- // dry run an extrinsic
64
- dryRun(account, optionsOrHash) {
65
- if (!this.hasDryRun) {
66
- throw new Error('The system.dryRun RPC call is not available in your environment');
67
- }
68
- if (blockHash || isString(optionsOrHash) || isU8a(optionsOrHash)) {
69
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
70
- return decorateMethod(() => api.rpc.system.dryRun(this.toHex(), blockHash || optionsOrHash));
71
- }
72
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-call
73
- return decorateMethod(() => this.#observeSign(account, optionsOrHash).pipe(switchMap(() => api.rpc.system.dryRun(this.toHex()))))();
74
- }
75
- // calculate the payment info for this transaction (if signed and submitted)
76
- paymentInfo(account, optionsOrHash) {
77
- if (!this.hasPaymentInfo) {
78
- throw new Error('The transactionPaymentApi.queryInfo runtime call is not available in your environment');
79
- }
80
- if (blockHash || isString(optionsOrHash) || isU8a(optionsOrHash)) {
81
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
82
- return decorateMethod(() => api.callAt(blockHash || optionsOrHash).pipe(switchMap((callAt) => {
83
- const u8a = this.toU8a();
84
- return callAt.transactionPaymentApi.queryInfo(u8a, u8a.length);
85
- })));
86
- }
87
- const [allOptions] = makeSignAndSendOptions(optionsOrHash);
88
- const address = isKeyringPair(account) ? account.address : account.toString();
89
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-call
90
- return decorateMethod(() => api.derive.tx.signingInfo(address, allOptions.nonce, allOptions.era).pipe(first(), switchMap((signingInfo) => {
91
- // setup our options (same way as in signAndSend)
92
- const eraOptions = makeEraOptions(api, this.registry, allOptions, signingInfo);
93
- const signOptions = makeSignOptions(api, eraOptions, {});
94
- // 1. Don't use the internal objects inside the new tx (hence toU8a)
95
- // 2. Don't override the data from existing signed extrinsics
96
- // 3. Ensure that this object stays intact, with no new sign after operation
97
- const u8a = api.tx(this.toU8a()).signFake(address, signOptions).toU8a();
98
- return api.call.transactionPaymentApi.queryInfo(u8a, u8a.length);
99
- })))();
100
- }
101
- // send implementation for both immediate Hash and statusCb variants
102
- send(statusCb) {
103
- const isSubscription = api.hasSubscriptions && (this.#ignoreStatusCb || !!statusCb);
104
- const updatedInfo = extrinsicInfoMap.get(this);
105
- extrinsicInfoMap.delete(this);
106
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-call
107
- return decorateMethod(isSubscription
108
- ? () => this.#observeSubscribe(updatedInfo)
109
- : () => this.#observeSend(updatedInfo))(statusCb);
110
- }
111
- /**
112
- * @description Signs a transaction, returning `this` to allow chaining. E.g.: `signAsync(...).send()`. Like `.signAndSend` this will retrieve the nonce and blockHash to send the tx with.
113
- */
114
- signAsync(account, partialOptions) {
115
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-call
116
- return decorateMethod(() => this.#observeSign(account, partialOptions).pipe(map((info) => {
117
- // If we got a full signed transaction from the signer, attach it
118
- if (info.signedTransaction) {
119
- const extrinsic = new Submittable(api.registry, info.signedTransaction);
120
- extrinsicInfoMap.set(this, info);
121
- return extrinsic;
122
- }
123
- // Fallback if signer didn’t return signedTransaction
124
- return this;
125
- })))();
126
- }
127
- // signAndSend implementation for all 3 cases above
128
- signAndSend(account, partialOptions, optionalStatusCb) {
129
- const [options, statusCb] = makeSignAndSendOptions(partialOptions, optionalStatusCb);
130
- const isSubscription = api.hasSubscriptions && (this.#ignoreStatusCb || !!statusCb);
131
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-call
132
- return decorateMethod(() => this.#observeSign(account, options).pipe(switchMap((info) => isSubscription
133
- ? this.#observeSubscribe(info)
134
- : this.#observeSend(info))) // FIXME This is wrong, SubmittableResult is _not_ a codec
135
- )(statusCb);
136
- }
137
- // adds a transform to the result, applied before result is returned
138
- withResultTransform(transform) {
139
- this.#transformResult = transform;
140
- return this;
141
- }
142
- #observeSign = (account, partialOptions) => {
143
- const address = isKeyringPair(account) ? account.address : account.toString();
144
- const options = optionsOrNonce(partialOptions);
145
- return api.derive.tx.signingInfo(address, options.nonce, options.era).pipe(first(), mergeMap(async (signingInfo) => {
146
- const eraOptions = makeEraOptions(api, this.registry, options, signingInfo);
147
- let updateId = -1;
148
- let signedTx = null;
149
- if (isKeyringPair(account)) {
150
- this.sign(account, eraOptions);
151
- }
152
- else {
153
- const result = await this.#signViaSigner(address, eraOptions, signingInfo.header);
154
- updateId = result.id;
155
- if (result.signedTransaction) {
156
- signedTx = result.signedTransaction;
157
- }
158
- }
159
- return { options: eraOptions, signedTransaction: signedTx, updateId };
160
- }));
161
- };
162
- #observeStatus = (txHash, status) => {
163
- if (!status.isFinalized && !status.isInBlock) {
164
- return of(this.#transformResult(new SubmittableResult({
165
- status,
166
- txHash
167
- })));
168
- }
169
- const blockHash = status.isInBlock
170
- ? status.asInBlock
171
- : status.asFinalized;
172
- return api.derive.tx.events(blockHash).pipe(map(({ block, events }) => this.#transformResult(new SubmittableResult({
173
- ...filterEvents(txHash, block, events, status),
174
- status,
175
- txHash
176
- }))), catchError((internalError) => of(this.#transformResult(new SubmittableResult({
177
- internalError,
178
- status,
179
- txHash
180
- })))));
181
- };
182
- #observeSend = (info) => {
183
- return api.rpc.author.submitExtrinsic(info?.signedTransaction || this).pipe(tap((hash) => {
184
- this.#updateSigner(hash, info);
185
- }));
186
- };
187
- #observeSubscribe = (info) => {
188
- const txHash = this.hash;
189
- return api.rpc.author.submitAndWatchExtrinsic(info?.signedTransaction || this).pipe(switchMap((status) => this.#observeStatus(txHash, status)), tap((status) => {
190
- this.#updateSigner(status, info);
191
- }));
192
- };
193
- #signViaSigner = async (address, options, header) => {
194
- const signer = options.signer || api.signer;
195
- const allowCallDataAlteration = options.allowCallDataAlteration ?? true;
196
- if (!signer) {
197
- throw new Error('No signer specified, either via api.setSigner or via sign options. You possibly need to pass through an explicit keypair for the origin so it can be used for signing.');
198
- }
199
- const payload = this.registry.createTypeUnsafe('SignerPayload', [objectSpread({}, options, {
200
- address,
201
- blockNumber: header ? header.number : 0,
202
- method: this.method
203
- })]);
204
- let result;
205
- if (isFunction(signer.signPayload)) {
206
- result = await signer.signPayload(payload.toPayload());
207
- if (result.signedTransaction && !options.withSignedTransaction) {
208
- throw new Error('The `signedTransaction` field may not be submitted when `withSignedTransaction` is disabled');
209
- }
210
- if (result.signedTransaction && options.withSignedTransaction) {
211
- const ext = this.registry.createTypeUnsafe('Extrinsic', [result.signedTransaction]);
212
- const newSignerPayload = this.registry.createTypeUnsafe('SignerPayload', [objectSpread({}, {
213
- address,
214
- assetId: ext.assetId && ext.assetId.isSome ? ext.assetId.toHex() : null,
215
- blockHash: payload.blockHash,
216
- blockNumber: header ? header.number : 0,
217
- era: ext.era.toHex(),
218
- genesisHash: payload.genesisHash,
219
- metadataHash: ext.metadataHash ? ext.metadataHash.toHex() : null,
220
- method: ext.method.toHex(),
221
- mode: ext.mode ? ext.mode.toHex() : null,
222
- nonce: ext.nonce.toHex(),
223
- runtimeVersion: payload.runtimeVersion,
224
- signedExtensions: payload.signedExtensions,
225
- tip: ext.tip ? ext.tip.toHex() : null,
226
- version: payload.version
227
- })]);
228
- if (!ext.isSigned) {
229
- throw new Error(`When using the signedTransaction field, the transaction must be signed. Recieved isSigned: ${ext.isSigned}`);
230
- }
231
- if (!allowCallDataAlteration) {
232
- this.#validateSignedTransaction(payload, ext);
233
- }
234
- // This is only used for signAsync - signAndSend does not need to adjust the super payload or
235
- // add the signature.
236
- super.addSignature(address, result.signature, newSignerPayload.toPayload());
237
- return { id: result.id, signedTransaction: result.signedTransaction };
238
- }
239
- }
240
- else if (isFunction(signer.signRaw)) {
241
- result = await signer.signRaw(payload.toRaw());
242
- }
243
- else {
244
- throw new Error('Invalid signer interface, it should implement either signPayload or signRaw (or both)');
245
- }
246
- // Here we explicitly call `toPayload()` again instead of working with an object
247
- // (reference) as passed to the signer. This means that we are sure that the
248
- // payload data is not modified from our inputs, but the signer
249
- super.addSignature(address, result.signature, payload.toPayload());
250
- return { id: result.id };
251
- };
252
- #updateSigner = (status, info) => {
253
- if (info && (info.updateId !== -1)) {
254
- const { options, updateId } = info;
255
- const signer = options.signer || api.signer;
256
- if (signer && isFunction(signer.update)) {
257
- signer.update(updateId, status);
258
- }
259
- }
260
- };
261
- /**
262
- * When a signer includes `signedTransaction` within the SignerResult this will validate
263
- * specific fields within the signed extrinsic against the original payload that was passed
264
- * to the signer.
265
- */
266
- #validateSignedTransaction = (signerPayload, signedExt) => {
267
- const payload = signerPayload.toPayload();
268
- const errMsg = (field) => `signAndSend: ${field} does not match the original payload`;
269
- if (payload.method !== signedExt.method.toHex()) {
270
- throw new Error(errMsg('call data'));
271
- }
272
- };
273
- }
274
- return Submittable;
275
- }
@@ -1,8 +0,0 @@
1
- import type { Call } from '@pezkuwi/types/interfaces';
2
- import type { Registry } from '@pezkuwi/types-codec/types';
3
- import type { ApiBase } from '../base/index.js';
4
- import type { ApiInterfaceRx, ApiTypes } from '../types/index.js';
5
- import type { SubmittableExtrinsic } from './types.js';
6
- type Creator<ApiType extends ApiTypes> = (extrinsic: Call | Uint8Array | string) => SubmittableExtrinsic<ApiType>;
7
- export declare function createSubmittable<ApiType extends ApiTypes>(apiType: ApiTypes, api: ApiInterfaceRx, decorateMethod: ApiBase<ApiType>['_decorateMethod'], registry?: Registry, blockHash?: Uint8Array): Creator<ApiType>;
8
- export {};
@@ -1,5 +0,0 @@
1
- import { createClass } from './createClass.js';
2
- export function createSubmittable(apiType, api, decorateMethod, registry, blockHash) {
3
- const Submittable = createClass({ api, apiType, blockHash, decorateMethod });
4
- return (extrinsic) => new Submittable(registry || api.registry, extrinsic);
5
- }
@@ -1,2 +0,0 @@
1
- export { createSubmittable } from './createSubmittable.js';
2
- export { SubmittableResult } from './Result.js';
@@ -1,2 +0,0 @@
1
- export { createSubmittable } from './createSubmittable.js';
2
- export { SubmittableResult } from './Result.js';
@@ -1 +0,0 @@
1
- export type { AddressOrPair, SignerOptions, SubmittableDryRunResult, SubmittableExtrinsic, SubmittablePaymentResult, SubmittableResultResult, SubmittableResultSubscription, SubmittableResultValue } from '@pezkuwi/api-base/types';
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from '@pezkuwi/api-base/types/calls';
@@ -1 +0,0 @@
1
- export * from '@pezkuwi/api-base/types/calls';
@@ -1 +0,0 @@
1
- export * from '@pezkuwi/api-base/types/consts';
@@ -1 +0,0 @@
1
- export * from '@pezkuwi/api-base/types/consts';
@@ -1 +0,0 @@
1
- export * from '@pezkuwi/api-base/types/errors';
@@ -1 +0,0 @@
1
- export * from '@pezkuwi/api-base/types/errors';
@@ -1 +0,0 @@
1
- export * from '@pezkuwi/api-base/types/events';
@@ -1 +0,0 @@
1
- export * from '@pezkuwi/api-base/types/events';