@aeternity/aepp-sdk 11.0.0 → 12.1.0

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 (442) hide show
  1. package/LICENSE +1 -1
  2. package/dist/aepp-sdk.browser-script.js +1 -1
  3. package/dist/aepp-sdk.browser-script.js.LICENSE.txt +0 -22
  4. package/dist/aepp-sdk.browser-script.js.map +1 -1
  5. package/dist/aepp-sdk.browser.js +2 -1
  6. package/dist/aepp-sdk.browser.js.LICENSE.txt +1 -0
  7. package/dist/aepp-sdk.browser.js.map +1 -1
  8. package/dist/aepp-sdk.js +20764 -1
  9. package/dist/aepp-sdk.js.map +1 -1
  10. package/es/AeSdk.d.ts +37 -0
  11. package/es/AeSdk.mjs +81 -0
  12. package/es/AeSdk.mjs.map +1 -0
  13. package/es/AeSdkAepp.d.ts +70 -0
  14. package/es/AeSdkAepp.mjs +176 -0
  15. package/es/AeSdkAepp.mjs.map +1 -0
  16. package/es/AeSdkBase.d.ts +213 -0
  17. package/es/AeSdkBase.mjs +314 -0
  18. package/es/AeSdkBase.mjs.map +1 -0
  19. package/es/AeSdkWallet.d.ts +104 -0
  20. package/es/AeSdkWallet.mjs +326 -0
  21. package/es/AeSdkWallet.mjs.map +1 -0
  22. package/es/Node.d.ts +41 -0
  23. package/es/Node.mjs +147 -0
  24. package/es/Node.mjs.map +1 -0
  25. package/es/account/Base.d.ts +68 -0
  26. package/es/account/Base.mjs +123 -0
  27. package/es/account/Base.mjs.map +1 -0
  28. package/es/account/Memory.d.ts +26 -0
  29. package/es/account/Memory.mjs +103 -0
  30. package/es/account/Memory.mjs.map +1 -0
  31. package/es/account/Rpc.d.ts +27 -0
  32. package/es/account/Rpc.mjs +80 -0
  33. package/es/account/Rpc.mjs.map +1 -0
  34. package/es/aens.d.ts +222 -0
  35. package/es/aens.mjs +338 -0
  36. package/es/aens.mjs.map +1 -0
  37. package/es/aepp-wallet-communication/connection/Browser.d.ts +33 -0
  38. package/es/aepp-wallet-communication/connection/Browser.mjs +73 -0
  39. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -0
  40. package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +18 -0
  41. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +58 -0
  42. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -0
  43. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +36 -0
  44. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +146 -0
  45. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -0
  46. package/es/aepp-wallet-communication/connection-proxy.d.ts +11 -0
  47. package/{src/utils/crypto-ts.ts → es/aepp-wallet-communication/connection-proxy.mjs} +16 -11
  48. package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -0
  49. package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +34 -0
  50. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +169 -0
  51. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -0
  52. package/es/aepp-wallet-communication/rpc/types.d.ts +77 -0
  53. package/es/aepp-wallet-communication/rpc/types.mjs +3 -0
  54. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -0
  55. package/es/aepp-wallet-communication/schema.d.ts +105 -46
  56. package/es/aepp-wallet-communication/schema.mjs +251 -0
  57. package/es/aepp-wallet-communication/schema.mjs.map +1 -0
  58. package/es/aepp-wallet-communication/wallet-detector.d.ts +25 -0
  59. package/es/aepp-wallet-communication/wallet-detector.mjs +62 -0
  60. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -0
  61. package/es/apis/compiler/compiler.d.ts +92 -0
  62. package/es/apis/compiler/compiler.mjs +576 -0
  63. package/es/apis/compiler/compiler.mjs.map +1 -0
  64. package/es/apis/compiler/index.d.ts +2 -0
  65. package/es/apis/compiler/index.mjs +3 -0
  66. package/es/apis/compiler/index.mjs.map +1 -0
  67. package/es/apis/compiler/models/index.d.ts +248 -0
  68. package/es/apis/compiler/models/index.mjs +48 -0
  69. package/es/apis/compiler/models/index.mjs.map +1 -0
  70. package/es/apis/compiler/models/mappers.d.ts +23 -0
  71. package/es/apis/compiler/models/mappers.mjs +585 -0
  72. package/es/apis/compiler/models/mappers.mjs.map +1 -0
  73. package/es/apis/compiler/models/parameters.d.ts +13 -0
  74. package/es/apis/compiler/models/parameters.mjs +71 -0
  75. package/es/apis/compiler/models/parameters.mjs.map +1 -0
  76. package/es/apis/node/index.d.ts +2 -0
  77. package/es/apis/node/index.mjs +3 -0
  78. package/es/apis/node/index.mjs.map +1 -0
  79. package/es/apis/node/models/index.d.ts +1065 -0
  80. package/es/apis/node/models/index.mjs +2 -0
  81. package/es/apis/node/models/index.mjs.map +1 -0
  82. package/es/apis/node/models/mappers.d.ts +95 -0
  83. package/es/apis/node/models/mappers.mjs +4166 -0
  84. package/es/apis/node/models/mappers.mjs.map +1 -0
  85. package/es/apis/node/models/parameters.d.ts +17 -0
  86. package/es/apis/node/models/parameters.mjs +165 -0
  87. package/es/apis/node/models/parameters.mjs.map +1 -0
  88. package/es/apis/node/node.d.ts +215 -0
  89. package/es/apis/node/node.mjs +1165 -0
  90. package/es/apis/node/node.mjs.map +1 -0
  91. package/es/chain.d.ts +248 -0
  92. package/es/chain.mjs +560 -0
  93. package/es/chain.mjs.map +1 -0
  94. package/es/channel/handlers.d.ts +34 -0
  95. package/es/channel/handlers.mjs +164 -131
  96. package/es/channel/handlers.mjs.map +1 -1
  97. package/es/channel/index.d.ts +625 -0
  98. package/es/channel/index.mjs +897 -902
  99. package/es/channel/index.mjs.map +1 -1
  100. package/es/channel/internal.d.ts +101 -0
  101. package/es/channel/internal.mjs +138 -88
  102. package/es/channel/internal.mjs.map +1 -1
  103. package/es/contract/Compiler.d.ts +18 -0
  104. package/es/contract/Compiler.mjs +68 -0
  105. package/es/contract/Compiler.mjs.map +1 -0
  106. package/es/contract/aci.d.ts +127 -0
  107. package/es/contract/aci.mjs +225 -193
  108. package/es/contract/aci.mjs.map +1 -1
  109. package/es/contract/ga.d.ts +69 -0
  110. package/es/contract/ga.mjs +195 -0
  111. package/es/contract/ga.mjs.map +1 -0
  112. package/es/contract/methods.d.ts +71 -0
  113. package/es/contract/methods.mjs +104 -0
  114. package/es/contract/methods.mjs.map +1 -0
  115. package/es/deprecated/index.d.ts +143 -0
  116. package/es/deprecated/index.mjs +162 -0
  117. package/es/deprecated/index.mjs.map +1 -0
  118. package/es/deprecated/methods.d.ts +18 -0
  119. package/es/deprecated/methods.mjs +26 -0
  120. package/es/deprecated/methods.mjs.map +1 -0
  121. package/es/index.d.ts +35 -0
  122. package/es/index.mjs +35 -40
  123. package/es/index.mjs.map +1 -1
  124. package/es/oracle.d.ts +161 -0
  125. package/es/oracle.mjs +306 -0
  126. package/es/oracle.mjs.map +1 -0
  127. package/es/spend.d.ts +62 -0
  128. package/es/spend.mjs +111 -0
  129. package/es/spend.mjs.map +1 -0
  130. package/es/tx/builder/address.d.ts +25 -0
  131. package/es/tx/builder/address.mjs +45 -0
  132. package/es/tx/builder/address.mjs.map +1 -0
  133. package/es/tx/builder/constants.d.ts +70 -0
  134. package/es/tx/builder/constants.mjs +122 -0
  135. package/es/tx/builder/constants.mjs.map +1 -0
  136. package/es/tx/builder/field-types/coin-amount.d.ts +13 -0
  137. package/es/tx/builder/field-types/coin-amount.mjs +26 -0
  138. package/es/tx/builder/field-types/coin-amount.mjs.map +1 -0
  139. package/es/tx/builder/field-types/deposit.d.ts +15 -0
  140. package/es/tx/builder/field-types/deposit.mjs +19 -0
  141. package/es/tx/builder/field-types/deposit.mjs.map +1 -0
  142. package/es/tx/builder/field-types/fee.d.ts +25 -0
  143. package/es/tx/builder/field-types/fee.mjs +150 -0
  144. package/es/tx/builder/field-types/fee.mjs.map +1 -0
  145. package/es/tx/builder/field-types/field.d.ts +6 -0
  146. package/es/tx/builder/field-types/field.mjs +15 -0
  147. package/es/tx/builder/field-types/field.mjs.map +1 -0
  148. package/es/tx/builder/field-types/gas-limit.d.ts +12 -0
  149. package/es/tx/builder/field-types/gas-limit.mjs +33 -0
  150. package/es/tx/builder/field-types/gas-limit.mjs.map +1 -0
  151. package/es/tx/builder/field-types/gas-price.d.ts +8 -0
  152. package/es/tx/builder/field-types/gas-price.mjs +18 -0
  153. package/es/tx/builder/field-types/gas-price.mjs.map +1 -0
  154. package/es/tx/builder/field-types/index.d.ts +70 -0
  155. package/es/tx/builder/field-types/index.mjs +25 -0
  156. package/es/tx/builder/field-types/index.mjs.map +1 -0
  157. package/es/tx/builder/field-types/name-fee.d.ts +20 -0
  158. package/es/tx/builder/field-types/name-fee.mjs +24 -0
  159. package/es/tx/builder/field-types/name-fee.mjs.map +1 -0
  160. package/es/tx/builder/field-types/name-id.d.ts +14 -0
  161. package/es/tx/builder/field-types/name-id.mjs +19 -0
  162. package/es/tx/builder/field-types/name-id.mjs.map +1 -0
  163. package/es/tx/builder/field-types/name.d.ts +13 -0
  164. package/es/tx/builder/field-types/name.mjs +18 -0
  165. package/es/tx/builder/field-types/name.mjs.map +1 -0
  166. package/es/tx/builder/field-types/short-u-int.d.ts +6 -0
  167. package/es/tx/builder/field-types/short-u-int.mjs +12 -0
  168. package/es/tx/builder/field-types/short-u-int.mjs.map +1 -0
  169. package/es/tx/builder/field-types/u-int.d.ts +8 -0
  170. package/es/tx/builder/field-types/u-int.mjs +14 -0
  171. package/es/tx/builder/field-types/u-int.mjs.map +1 -0
  172. package/es/tx/builder/helpers.d.ts +125 -0
  173. package/es/tx/builder/helpers.mjs +94 -240
  174. package/es/tx/builder/helpers.mjs.map +1 -1
  175. package/es/tx/builder/index.d.ts +88 -0
  176. package/es/tx/builder/index.mjs +167 -358
  177. package/es/tx/builder/index.mjs.map +1 -1
  178. package/es/tx/builder/schema.d.ts +1201 -0
  179. package/es/tx/builder/schema.mjs +175 -664
  180. package/es/tx/builder/schema.mjs.map +1 -1
  181. package/es/tx/index.d.ts +64 -0
  182. package/es/tx/index.mjs +151 -265
  183. package/es/tx/index.mjs.map +1 -1
  184. package/es/tx/validator.d.ts +20 -0
  185. package/es/tx/validator.mjs +104 -124
  186. package/es/tx/validator.mjs.map +1 -1
  187. package/es/typings/@aeternity__argon2-browser/index.d.mjs +2 -0
  188. package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +1 -0
  189. package/es/typings/@aeternity__uuid/index.d.mjs +2 -0
  190. package/es/typings/@aeternity__uuid/index.d.mjs.map +1 -0
  191. package/es/typings/bip32-path/index.d.mjs +2 -0
  192. package/es/typings/bip32-path/index.d.mjs.map +1 -0
  193. package/es/typings/blakejs/index.d.mjs.map +1 -1
  194. package/es/typings/sha-js/index.d.mjs +2 -0
  195. package/es/typings/sha-js/index.d.mjs.map +1 -0
  196. package/es/typings/tweetnacl-auth/index.d.mjs +2 -0
  197. package/es/typings/tweetnacl-auth/index.d.mjs.map +1 -0
  198. package/es/utils/amount-formatter.d.ts +42 -0
  199. package/es/utils/amount-formatter.mjs +36 -49
  200. package/es/utils/amount-formatter.mjs.map +1 -1
  201. package/es/utils/autorest.d.ts +6 -0
  202. package/es/utils/autorest.mjs +97 -0
  203. package/es/utils/autorest.mjs.map +1 -0
  204. package/es/utils/bignumber.d.ts +13 -0
  205. package/es/utils/bignumber.mjs +11 -8
  206. package/es/utils/bignumber.mjs.map +1 -1
  207. package/es/{bytes.d.ts → utils/bytes.d.ts} +10 -13
  208. package/es/utils/bytes.mjs +11 -15
  209. package/es/utils/bytes.mjs.map +1 -1
  210. package/es/utils/crypto.d.ts +88 -0
  211. package/es/utils/crypto.mjs +64 -108
  212. package/es/utils/crypto.mjs.map +1 -1
  213. package/es/utils/encoder-types.d.ts +61 -0
  214. package/es/utils/encoder-types.mjs +36 -0
  215. package/es/utils/encoder-types.mjs.map +1 -0
  216. package/es/utils/encoder.d.ts +25 -0
  217. package/es/utils/encoder.mjs +118 -0
  218. package/es/utils/encoder.mjs.map +1 -0
  219. package/es/{errors.d.ts → utils/errors.d.ts} +246 -59
  220. package/es/utils/errors.mjs +313 -136
  221. package/es/utils/errors.mjs.map +1 -1
  222. package/es/utils/hd-wallet.d.ts +50 -0
  223. package/es/utils/hd-wallet.mjs +86 -45
  224. package/es/utils/hd-wallet.mjs.map +1 -1
  225. package/es/utils/json-big.d.ts +5 -0
  226. package/es/utils/json-big.mjs +12 -16
  227. package/es/utils/json-big.mjs.map +1 -1
  228. package/es/utils/keystore.d.ts +51 -0
  229. package/es/utils/keystore.mjs +101 -194
  230. package/es/utils/keystore.mjs.map +1 -1
  231. package/es/{mptree.d.ts → utils/mptree.d.ts} +6 -9
  232. package/es/utils/mptree.mjs +22 -18
  233. package/es/utils/mptree.mjs.map +1 -1
  234. package/es/utils/other.d.ts +20 -0
  235. package/es/utils/other.mjs +32 -35
  236. package/es/utils/other.mjs.map +1 -1
  237. package/es/utils/semver-satisfies.d.ts +1 -0
  238. package/es/utils/semver-satisfies.mjs +2 -2
  239. package/es/utils/semver-satisfies.mjs.map +1 -1
  240. package/es/utils/string.d.ts +24 -0
  241. package/es/utils/string.mjs +8 -10
  242. package/es/utils/string.mjs.map +1 -1
  243. package/package.json +56 -42
  244. package/src/AeSdk.ts +68 -0
  245. package/src/AeSdkAepp.ts +176 -0
  246. package/src/AeSdkBase.ts +338 -0
  247. package/src/AeSdkWallet.ts +348 -0
  248. package/src/Node.ts +173 -0
  249. package/src/account/Base.ts +124 -0
  250. package/src/account/Memory.ts +98 -0
  251. package/src/account/Rpc.ts +69 -0
  252. package/src/aens.ts +407 -0
  253. package/src/aepp-wallet-communication/connection/Browser.ts +71 -0
  254. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +59 -0
  255. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +122 -0
  256. package/{es/utils/crypto-ts.mjs → src/aepp-wallet-communication/connection-proxy.ts} +18 -18
  257. package/src/aepp-wallet-communication/rpc/RpcClient.ts +143 -0
  258. package/src/aepp-wallet-communication/rpc/types.ts +66 -0
  259. package/src/aepp-wallet-communication/schema.ts +224 -0
  260. package/src/aepp-wallet-communication/wallet-detector.ts +72 -0
  261. package/src/apis/compiler/code-model-v4.yaml +2649 -0
  262. package/src/apis/compiler/compiler.ts +585 -0
  263. package/src/apis/compiler/index.ts +2 -0
  264. package/src/apis/compiler/models/index.ts +301 -0
  265. package/src/apis/compiler/models/mappers.ts +583 -0
  266. package/src/apis/compiler/models/parameters.ts +93 -0
  267. package/src/apis/node/code-model-v4.yaml +10080 -0
  268. package/src/apis/node/index.ts +2 -0
  269. package/src/apis/node/models/index.ts +1257 -0
  270. package/src/apis/node/models/mappers.ts +4280 -0
  271. package/src/apis/node/models/parameters.ts +188 -0
  272. package/src/apis/node/node.ts +1299 -0
  273. package/src/chain.ts +502 -0
  274. package/src/channel/handlers.ts +817 -0
  275. package/src/channel/index.ts +1025 -0
  276. package/src/channel/internal.ts +361 -0
  277. package/src/contract/Compiler.ts +67 -0
  278. package/src/contract/aci.ts +538 -0
  279. package/src/contract/ga.ts +199 -0
  280. package/src/contract/methods.ts +123 -0
  281. package/src/deprecated/index.ts +170 -0
  282. package/src/deprecated/methods.ts +25 -0
  283. package/src/index.ts +56 -0
  284. package/src/oracle.ts +364 -0
  285. package/src/spend.ts +164 -0
  286. package/src/tx/builder/address.ts +50 -0
  287. package/src/tx/builder/constants.ts +126 -0
  288. package/src/tx/builder/field-types/coin-amount.ts +27 -0
  289. package/src/tx/builder/field-types/deposit.ts +21 -0
  290. package/src/tx/builder/field-types/fee.ts +143 -0
  291. package/src/tx/builder/field-types/field.ts +9 -0
  292. package/src/tx/builder/field-types/gas-limit.ts +41 -0
  293. package/src/tx/builder/field-types/gas-price.ts +16 -0
  294. package/src/tx/builder/field-types/index.ts +45 -0
  295. package/src/tx/builder/field-types/name-fee.ts +32 -0
  296. package/src/tx/builder/field-types/name-id.ts +20 -0
  297. package/src/tx/builder/field-types/name.ts +18 -0
  298. package/src/tx/builder/field-types/short-u-int.ts +11 -0
  299. package/src/tx/builder/field-types/u-int.ts +16 -0
  300. package/src/tx/builder/helpers.ts +248 -0
  301. package/src/tx/builder/index.ts +400 -0
  302. package/src/tx/builder/schema.ts +727 -0
  303. package/src/tx/index.ts +192 -0
  304. package/src/tx/validator.ts +230 -0
  305. package/src/typings/@aeternity__argon2-browser/index.d.ts +3 -0
  306. package/src/typings/@aeternity__uuid/index.d.ts +5 -0
  307. package/src/typings/bip32-path/index.d.ts +33 -0
  308. package/src/typings/blakejs/index.d.ts +4 -32
  309. package/src/typings/sha-js/index.d.ts +5 -0
  310. package/src/typings/tweetnacl-auth/index.d.ts +14 -0
  311. package/src/utils/amount-formatter.ts +56 -69
  312. package/src/utils/autorest.ts +93 -0
  313. package/src/utils/bignumber.ts +11 -12
  314. package/src/utils/bytes.ts +29 -31
  315. package/src/utils/crypto.ts +205 -0
  316. package/src/utils/encoder-types.ts +63 -0
  317. package/src/utils/encoder.ts +146 -0
  318. package/src/utils/errors.ts +482 -366
  319. package/src/utils/hd-wallet.ts +166 -0
  320. package/src/utils/json-big.ts +27 -0
  321. package/src/utils/keystore.ts +182 -0
  322. package/src/utils/mptree.ts +64 -61
  323. package/src/utils/other.ts +34 -41
  324. package/src/utils/semver-satisfies.ts +15 -11
  325. package/src/utils/string.ts +18 -20
  326. package/es/account/base.mjs +0 -179
  327. package/es/account/base.mjs.map +0 -1
  328. package/es/account/memory.mjs +0 -99
  329. package/es/account/memory.mjs.map +0 -1
  330. package/es/account/multiple.mjs +0 -179
  331. package/es/account/multiple.mjs.map +0 -1
  332. package/es/ae/aens.mjs +0 -404
  333. package/es/ae/aens.mjs.map +0 -1
  334. package/es/ae/aepp.mjs +0 -45
  335. package/es/ae/aepp.mjs.map +0 -1
  336. package/es/ae/contract.mjs +0 -159
  337. package/es/ae/contract.mjs.map +0 -1
  338. package/es/ae/index.mjs +0 -207
  339. package/es/ae/index.mjs.map +0 -1
  340. package/es/ae/oracle.mjs +0 -339
  341. package/es/ae/oracle.mjs.map +0 -1
  342. package/es/ae/universal.mjs +0 -45
  343. package/es/ae/universal.mjs.map +0 -1
  344. package/es/ae/wallet.mjs +0 -50
  345. package/es/ae/wallet.mjs.map +0 -1
  346. package/es/amount-formatter.d.ts +0 -58
  347. package/es/bignumber.d.ts +0 -18
  348. package/es/chain/index.mjs +0 -272
  349. package/es/chain/index.mjs.map +0 -1
  350. package/es/chain/node.mjs +0 -442
  351. package/es/chain/node.mjs.map +0 -1
  352. package/es/contract/compiler.mjs +0 -115
  353. package/es/contract/compiler.mjs.map +0 -1
  354. package/es/contract/ga/helpers.mjs +0 -30
  355. package/es/contract/ga/helpers.mjs.map +0 -1
  356. package/es/contract/ga/index.mjs +0 -178
  357. package/es/contract/ga/index.mjs.map +0 -1
  358. package/es/crypto-ts.d.ts +0 -9
  359. package/es/node-pool/index.mjs +0 -188
  360. package/es/node-pool/index.mjs.map +0 -1
  361. package/es/node.mjs +0 -133
  362. package/es/node.mjs.map +0 -1
  363. package/es/other.d.ts +0 -31
  364. package/es/semver-satisfies.d.ts +0 -1
  365. package/es/string.d.ts +0 -26
  366. package/es/tx/builder/field-types.mjs +0 -74
  367. package/es/tx/builder/field-types.mjs.map +0 -1
  368. package/es/tx/tx-object.mjs +0 -283
  369. package/es/tx/tx-object.mjs.map +0 -1
  370. package/es/tx/tx.mjs +0 -938
  371. package/es/tx/tx.mjs.map +0 -1
  372. package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs +0 -132
  373. package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs.map +0 -1
  374. package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs +0 -183
  375. package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs.map +0 -1
  376. package/es/utils/aepp-wallet-communication/connection/index.mjs +0 -87
  377. package/es/utils/aepp-wallet-communication/connection/index.mjs.map +0 -1
  378. package/es/utils/aepp-wallet-communication/content-script-bridge.mjs +0 -98
  379. package/es/utils/aepp-wallet-communication/content-script-bridge.mjs.map +0 -1
  380. package/es/utils/aepp-wallet-communication/helpers.mjs +0 -92
  381. package/es/utils/aepp-wallet-communication/helpers.mjs.map +0 -1
  382. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs +0 -375
  383. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs.map +0 -1
  384. package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs +0 -275
  385. package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs.map +0 -1
  386. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs +0 -541
  387. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs.map +0 -1
  388. package/es/utils/aepp-wallet-communication/schema.mjs +0 -102
  389. package/es/utils/aepp-wallet-communication/schema.mjs.map +0 -1
  390. package/es/utils/aepp-wallet-communication/wallet-detector.mjs +0 -110
  391. package/es/utils/aepp-wallet-communication/wallet-detector.mjs.map +0 -1
  392. package/es/utils/async-init.mjs +0 -64
  393. package/es/utils/async-init.mjs.map +0 -1
  394. package/es/utils/crypto-ts.mjs.map +0 -1
  395. package/es/utils/swagger.mjs +0 -164
  396. package/es/utils/swagger.mjs.map +0 -1
  397. package/src/account/base.js +0 -153
  398. package/src/account/memory.js +0 -83
  399. package/src/account/multiple.js +0 -162
  400. package/src/ae/aens.js +0 -361
  401. package/src/ae/aepp.js +0 -45
  402. package/src/ae/contract.js +0 -148
  403. package/src/ae/index.js +0 -168
  404. package/src/ae/oracle.js +0 -311
  405. package/src/ae/universal.js +0 -47
  406. package/src/ae/wallet.js +0 -50
  407. package/src/chain/index.js +0 -269
  408. package/src/chain/node.js +0 -320
  409. package/src/channel/handlers.js +0 -673
  410. package/src/channel/index.js +0 -898
  411. package/src/channel/internal.js +0 -237
  412. package/src/contract/aci.js +0 -376
  413. package/src/contract/compiler.js +0 -100
  414. package/src/contract/ga/helpers.js +0 -19
  415. package/src/contract/ga/index.js +0 -150
  416. package/src/index.js +0 -89
  417. package/src/node-pool/index.js +0 -172
  418. package/src/node.js +0 -116
  419. package/src/tx/builder/field-types.js +0 -61
  420. package/src/tx/builder/helpers.js +0 -380
  421. package/src/tx/builder/index.js +0 -465
  422. package/src/tx/builder/schema.js +0 -1197
  423. package/src/tx/index.js +0 -301
  424. package/src/tx/tx-object.js +0 -187
  425. package/src/tx/tx.js +0 -631
  426. package/src/tx/validator.js +0 -181
  427. package/src/utils/aepp-wallet-communication/connection/browser-runtime.js +0 -119
  428. package/src/utils/aepp-wallet-communication/connection/browser-window-message.js +0 -165
  429. package/src/utils/aepp-wallet-communication/connection/index.js +0 -85
  430. package/src/utils/aepp-wallet-communication/content-script-bridge.js +0 -86
  431. package/src/utils/aepp-wallet-communication/helpers.js +0 -60
  432. package/src/utils/aepp-wallet-communication/rpc/aepp-rpc.js +0 -294
  433. package/src/utils/aepp-wallet-communication/rpc/rpc-client.js +0 -232
  434. package/src/utils/aepp-wallet-communication/rpc/wallet-rpc.js +0 -401
  435. package/src/utils/aepp-wallet-communication/schema.ts +0 -80
  436. package/src/utils/aepp-wallet-communication/wallet-detector.js +0 -92
  437. package/src/utils/async-init.js +0 -45
  438. package/src/utils/crypto.js +0 -229
  439. package/src/utils/hd-wallet.js +0 -100
  440. package/src/utils/json-big.js +0 -26
  441. package/src/utils/keystore.js +0 -219
  442. package/src/utils/swagger.js +0 -156
@@ -1,683 +1,799 @@
1
- /**
2
- * Error module
3
- * @module @aeternity/aepp-sdk/es/utils/errors
4
- * @example import { BytecodeMismatchError } from '@aeternity/aepp-sdk'
5
- */
1
+ // eslint-disable-next-line max-classes-per-file
2
+ import BigNumber from 'bignumber.js';
6
3
 
7
4
  /**
8
5
  * aepp-sdk originated error
6
+ * @category exception
9
7
  */
10
8
  export abstract class BaseError extends Error {
11
- constructor (message: string) {
12
- super(message)
13
- this.name = 'BaseError'
9
+ constructor(message: string) {
10
+ super(message);
11
+ this.name = 'BaseError';
14
12
  }
15
13
  }
16
14
 
15
+ /**
16
+ * @category exception
17
+ */
17
18
  export class AccountError extends BaseError {
18
- constructor (message: string) {
19
- super(message)
20
- this.name = 'AccountError'
19
+ constructor(message: string) {
20
+ super(message);
21
+ this.name = 'AccountError';
21
22
  }
22
23
  }
23
24
 
25
+ /**
26
+ * @category exception
27
+ */
24
28
  export class AensError extends BaseError {
25
- constructor (message: string) {
26
- super(message)
27
- this.name = 'AensError'
29
+ constructor(message: string) {
30
+ super(message);
31
+ this.name = 'AensError';
28
32
  }
29
33
  }
30
34
 
35
+ /**
36
+ * @category exception
37
+ */
31
38
  export class AeppError extends BaseError {
32
- constructor (message: string) {
33
- super(message)
34
- this.name = 'AeppError'
39
+ constructor(message: string) {
40
+ super(message);
41
+ this.name = 'AeppError';
35
42
  }
36
43
  }
37
44
 
45
+ /**
46
+ * @category exception
47
+ */
38
48
  export class ChannelError extends BaseError {
39
- constructor (message: string) {
40
- super(message)
41
- this.name = 'ChannelError'
49
+ constructor(message: string) {
50
+ super(message);
51
+ this.name = 'ChannelError';
42
52
  }
43
53
  }
44
54
 
55
+ /**
56
+ * @category exception
57
+ */
45
58
  export class CompilerError extends BaseError {
46
- constructor (message: string) {
47
- super(message)
48
- this.name = 'CompilerError'
59
+ constructor(message: string) {
60
+ super(message);
61
+ this.name = 'CompilerError';
49
62
  }
50
63
  }
51
64
 
65
+ /**
66
+ * @category exception
67
+ */
52
68
  export class ContractError extends BaseError {
53
- constructor (message: string) {
54
- super(message)
55
- this.name = 'ContractError'
69
+ constructor(message: string) {
70
+ super(message);
71
+ this.name = 'ContractError';
56
72
  }
57
73
  }
58
74
 
75
+ /**
76
+ * @category exception
77
+ */
59
78
  export class CryptographyError extends BaseError {
60
- constructor (message: string) {
61
- super(message)
62
- this.name = 'CryptographyError'
79
+ constructor(message: string) {
80
+ super(message);
81
+ this.name = 'CryptographyError';
63
82
  }
64
83
  }
65
84
 
85
+ /**
86
+ * @category exception
87
+ */
66
88
  export class NodeError extends BaseError {
67
- constructor (message: string) {
68
- super(message)
69
- this.name = 'NodeError'
89
+ constructor(message: string) {
90
+ super(message);
91
+ this.name = 'NodeError';
70
92
  }
71
93
  }
72
94
 
95
+ /**
96
+ * @category exception
97
+ */
73
98
  export class TransactionError extends BaseError {
74
- constructor (message: string) {
75
- super(message)
76
- this.name = 'TransactionError'
99
+ constructor(message: string) {
100
+ super(message);
101
+ this.name = 'TransactionError';
77
102
  }
78
103
  }
79
104
 
105
+ /**
106
+ * @category exception
107
+ */
80
108
  export class WalletError extends BaseError {
81
- constructor (message: string) {
82
- super(message)
83
- this.name = 'WalletError'
109
+ constructor(message: string) {
110
+ super(message);
111
+ this.name = 'WalletError';
84
112
  }
85
113
  }
86
114
 
87
- /* Common error patterns */
115
+ /**
116
+ * @category exception
117
+ */
88
118
  export class ArgumentError extends BaseError {
89
- constructor (argumentName: string, requirement: string, argumentValue: any) {
90
- super(`${argumentName} should be ${requirement}, got ${argumentValue} instead`)
91
- this.name = 'ArgumentError'
119
+ constructor(argumentName: string, requirement: string, argumentValue: any) {
120
+ super(`${argumentName} should be ${requirement}, got ${String(argumentValue)} instead`);
121
+ this.name = 'ArgumentError';
92
122
  }
93
123
  }
94
124
 
125
+ /**
126
+ * @category exception
127
+ */
95
128
  export class IllegalArgumentError extends CryptographyError {
96
- constructor (message: string) {
97
- super(message)
98
- this.name = 'IllegalArgumentError'
129
+ constructor(message: string) {
130
+ super(message);
131
+ this.name = 'IllegalArgumentError';
99
132
  }
100
133
  }
101
134
 
135
+ /**
136
+ * @category exception
137
+ */
102
138
  export class ArgumentCountMismatchError extends BaseError {
103
- constructor (functionName: string, requiredCount: number, providedCount: number) {
104
- super(`${functionName} expects ${requiredCount} arguments, got ${providedCount} instead`)
105
- this.name = 'ArgumentCountMismatchError'
139
+ constructor(functionName: string, requiredCount: number, providedCount: number) {
140
+ super(`${functionName} expects ${requiredCount} arguments, got ${providedCount} instead`);
141
+ this.name = 'ArgumentCountMismatchError';
106
142
  }
107
143
  }
108
144
 
145
+ /**
146
+ * @category exception
147
+ */
109
148
  export class InsufficientBalanceError extends BaseError {
110
- constructor (message: string) {
111
- super(message)
112
- this.name = 'InsufficientBalanceError'
113
- }
114
- }
115
-
116
- export class InvalidDenominationError extends BaseError {
117
- constructor (message: string) {
118
- super(message)
119
- this.name = 'InvalidDenominationError'
120
- }
121
- }
122
-
123
- export class InvalidNameError extends BaseError {
124
- constructor (message: string) {
125
- super(message)
126
- this.name = 'InvalidNameError'
149
+ constructor(message: string) {
150
+ super(message);
151
+ this.name = 'InsufficientBalanceError';
127
152
  }
128
153
  }
129
154
 
155
+ /**
156
+ * @category exception
157
+ */
130
158
  export class MissingParamError extends BaseError {
131
- constructor (message: string) {
132
- super(message)
133
- this.name = 'MissingParamError'
134
- }
135
- }
136
-
137
- export class NoBrowserFoundError extends BaseError {
138
- constructor () {
139
- super('Browser is not detected')
140
- this.name = 'NoBrowserFoundError'
159
+ constructor(message: string) {
160
+ super(message);
161
+ this.name = 'MissingParamError';
141
162
  }
142
163
  }
143
164
 
165
+ /**
166
+ * @category exception
167
+ */
144
168
  export class NoSerializerFoundError extends BaseError {
145
- constructor () {
146
- super('Byte serialization not supported')
147
- this.name = 'NoSerializerFoundError'
169
+ constructor() {
170
+ super('Byte serialization not supported');
171
+ this.name = 'NoSerializerFoundError';
148
172
  }
149
173
  }
150
174
 
175
+ /**
176
+ * @category exception
177
+ */
151
178
  export class RequestTimedOutError extends BaseError {
152
- constructor (requestTime: number);
153
- constructor (requestTime: number, currentHeight?: number, height?: number) {
154
- if (currentHeight !== undefined && height !== undefined) {
155
- super(`Giving up after ${requestTime}ms, current height: ${currentHeight}, desired height: ${height}`)
156
- } else {
157
- super(`Giving up after ${requestTime} ms`)
158
- }
159
- this.name = 'RequestTimedOutError'
179
+ constructor(height: number) {
180
+ super(`Giving up at height ${height}`);
181
+ this.name = 'RequestTimedOutError';
160
182
  }
161
183
  }
162
184
 
185
+ /**
186
+ * @category exception
187
+ */
163
188
  export class TxTimedOutError extends BaseError {
164
- constructor (blocks: number, th: string, status?: string) {
189
+ constructor(blocks: number, th: string) {
165
190
  super([
166
191
  `Giving up after ${blocks} blocks mined`,
167
192
  `transaction hash: ${th}`,
168
- ...status ? [`status: ${status}`] : []
169
- ].join(', '))
170
- this.name = 'TxTimedOutError'
193
+ ].join(', '));
194
+ this.name = 'TxTimedOutError';
171
195
  }
172
196
  }
173
197
 
198
+ /**
199
+ * @category exception
200
+ */
174
201
  export class TypeError extends BaseError {
175
- constructor (message: string) {
176
- super(message)
177
- this.name = 'TypeError'
202
+ constructor(message: string) {
203
+ super(message);
204
+ this.name = 'TypeError';
178
205
  }
179
206
  }
180
207
 
208
+ /**
209
+ * @category exception
210
+ */
181
211
  export class UnsupportedPlatformError extends BaseError {
182
- constructor (message: string) {
183
- super(message)
184
- this.name = 'UnsupportedPlatformError'
212
+ constructor(message: string) {
213
+ super(message);
214
+ this.name = 'UnsupportedPlatformError';
185
215
  }
186
216
  }
187
217
 
218
+ /**
219
+ * @category exception
220
+ */
188
221
  export class UnsupportedProtocolError extends BaseError {
189
- constructor (message: string) {
190
- super(message)
191
- this.name = 'UnsupportedProtocolError'
222
+ constructor(message: string) {
223
+ super(message);
224
+ this.name = 'UnsupportedProtocolError';
192
225
  }
193
226
  }
194
227
 
228
+ /**
229
+ * @category exception
230
+ */
195
231
  export class NotImplementedError extends BaseError {
196
- constructor (message: string) {
197
- super(message)
198
- this.name = 'NotImplementedError'
232
+ constructor(message: string) {
233
+ super(message);
234
+ this.name = 'NotImplementedError';
199
235
  }
200
236
  }
201
237
 
238
+ /**
239
+ * @category exception
240
+ */
202
241
  export class UnsupportedVersionError extends BaseError {
203
- constructor (dependency: string, version: string, geVersion: string, ltVersion: string) {
204
- super(`Unsupported ${dependency} version ${version}. Supported: >= ${geVersion} < ${ltVersion}`)
205
- this.name = 'UnsupportedVersionError'
242
+ constructor(dependency: string, version: string, geVersion: string, ltVersion: string) {
243
+ super(`Unsupported ${dependency} version ${version}. Supported: >= ${geVersion} < ${ltVersion}`);
244
+ this.name = 'UnsupportedVersionError';
206
245
  }
207
246
  }
208
247
 
248
+ /**
249
+ * @category exception
250
+ */
209
251
  export class InternalError extends BaseError {
210
- constructor (message: string) {
211
- super(message)
212
- this.name = 'InternalError'
252
+ constructor(message: string) {
253
+ super(message);
254
+ this.name = 'InternalError';
213
255
  }
214
256
  }
215
257
 
216
- /* keypair an account related errors */
258
+ /**
259
+ * @category exception
260
+ */
261
+ export class UnexpectedTsError extends InternalError {
262
+ constructor(message = 'Expected to not happen, required for TS') {
263
+ super(message);
264
+ this.name = 'UnexpectedTsError';
265
+ }
266
+ }
267
+
268
+ /**
269
+ * @category exception
270
+ */
217
271
  export class InvalidKeypairError extends AccountError {
218
- constructor (message: string) {
219
- super(message)
220
- this.name = 'InvalidKeypairError'
272
+ constructor(message: string) {
273
+ super(message);
274
+ this.name = 'InvalidKeypairError';
221
275
  }
222
276
  }
223
277
 
278
+ /**
279
+ * @category exception
280
+ */
224
281
  export class UnavailableAccountError extends AccountError {
225
- constructor (address: string) {
226
- super(`Account for ${address} not available`)
227
- this.name = 'UnavailableAccountError'
282
+ constructor(address: string) {
283
+ super(`Account for ${address} not available`);
284
+ this.name = 'UnavailableAccountError';
228
285
  }
229
286
  }
230
287
 
231
- /* errors originating from AENS operation */
288
+ /**
289
+ * @category exception
290
+ */
232
291
  export class AensPointerContextError extends AensError {
233
- constructor (nameOrId: string, prefix: string) {
234
- super(`Name ${nameOrId} don't have pointers for ${prefix}`)
235
- this.name = 'AensPointerContextError'
292
+ constructor(nameOrId: string, prefix: string) {
293
+ super(`Name ${nameOrId} don't have pointers for ${prefix}`);
294
+ this.name = 'AensPointerContextError';
236
295
  }
237
296
  }
238
297
 
298
+ /**
299
+ * @category exception
300
+ */
239
301
  export class InsufficientNameFeeError extends AensError {
240
- constructor (nameFee: number, minNameFee: number) {
241
- super(`the provided fee ${nameFee} is not enough to execute the claim, required: ${minNameFee}`)
242
- this.name = 'InsufficientNameFeeError'
302
+ constructor(nameFee: BigNumber, minNameFee: BigNumber) {
303
+ super(`the provided fee ${nameFee.toString()} is not enough to execute the claim, required: ${minNameFee.toString()}`);
304
+ this.name = 'InsufficientNameFeeError';
243
305
  }
244
306
  }
245
307
 
308
+ /**
309
+ * @category exception
310
+ */
246
311
  export class InvalidAensNameError extends AensError {
247
- constructor (message: string) {
248
- super(message)
249
- this.name = 'InvalidAensNameError'
250
- }
251
- }
252
-
253
- /* Aepp Errors */
254
- export class DuplicateCallbackError extends AeppError {
255
- constructor () {
256
- super('Callback Already exist')
257
- this.name = 'DuplicateCallbackError'
312
+ constructor(message: string) {
313
+ super(message);
314
+ this.name = 'InvalidAensNameError';
258
315
  }
259
316
  }
260
317
 
318
+ /**
319
+ * @category exception
320
+ */
261
321
  export class InvalidRpcMessageError extends AeppError {
262
- constructor (message: string) {
263
- super(`Received invalid message: ${message}`)
264
- this.name = 'InvalidRpcMessageError'
322
+ constructor(message: string) {
323
+ super(`Received invalid message: ${message}`);
324
+ this.name = 'InvalidRpcMessageError';
265
325
  }
266
326
  }
267
327
 
328
+ /**
329
+ * @category exception
330
+ */
268
331
  export class MissingCallbackError extends AeppError {
269
- constructor (id: string) {
270
- super(`Can't find callback for this messageId ${id}`)
271
- this.name = 'MissingCallbackError'
332
+ constructor(id: number) {
333
+ super(`Can't find callback for this messageId ${id}`);
334
+ this.name = 'MissingCallbackError';
272
335
  }
273
336
  }
274
337
 
338
+ /**
339
+ * @category exception
340
+ */
275
341
  export class UnAuthorizedAccountError extends AeppError {
276
- constructor (onAccount: string) {
277
- super(`You do not have access to account ${onAccount}`)
278
- this.name = 'UnAuthorizedAccountError'
342
+ constructor(onAccount: string) {
343
+ super(`You do not have access to account ${onAccount}`);
344
+ this.name = 'UnAuthorizedAccountError';
279
345
  }
280
346
  }
281
347
 
348
+ /**
349
+ * @category exception
350
+ */
282
351
  export class UnknownRpcClientError extends AeppError {
283
- constructor (id: string) {
284
- super(`RpcClient with id ${id} do not exist`)
285
- this.name = 'UnknownRpcClientError'
352
+ constructor(id: string) {
353
+ super(`RpcClient with id ${id} do not exist`);
354
+ this.name = 'UnknownRpcClientError';
286
355
  }
287
356
  }
288
357
 
358
+ /**
359
+ * @category exception
360
+ */
289
361
  export class UnsubscribedAccountError extends AeppError {
290
- constructor () {
291
- super('You are not subscribed for an account.')
292
- this.name = 'UnsubscribedAccountError'
362
+ constructor() {
363
+ super('You are not subscribed for an account.');
364
+ this.name = 'UnsubscribedAccountError';
293
365
  }
294
366
  }
295
367
 
296
- /* Channel originated errors */
368
+ /**
369
+ * @category exception
370
+ */
297
371
  export class ChannelCallError extends ChannelError {
298
- constructor (message: string) {
299
- super(message)
300
- this.name = 'ChannelCallError'
372
+ constructor(message: string) {
373
+ super(message);
374
+ this.name = 'ChannelCallError';
301
375
  }
302
376
  }
303
377
 
378
+ /**
379
+ * @category exception
380
+ */
304
381
  export class ChannelConnectionError extends ChannelError {
305
- constructor (message: string) {
306
- super(message)
307
- this.name = 'ChannelConnectionError'
382
+ constructor(message: string) {
383
+ super(message);
384
+ this.name = 'ChannelConnectionError';
308
385
  }
309
386
  }
310
387
 
388
+ /**
389
+ * @category exception
390
+ */
311
391
  export class ChannelPingTimedOutError extends ChannelError {
312
- constructor () {
313
- super('Server pong timed out')
314
- this.name = 'ChannelPingTimedOutError'
392
+ constructor() {
393
+ super('Server pong timed out');
394
+ this.name = 'ChannelPingTimedOutError';
315
395
  }
316
396
  }
317
397
 
398
+ /**
399
+ * @category exception
400
+ */
318
401
  export class UnexpectedChannelMessageError extends ChannelError {
319
- constructor (message: string) {
320
- super(message)
321
- this.name = 'UnexpectedChannelMessageError'
402
+ constructor(message: string) {
403
+ super(message);
404
+ this.name = 'UnexpectedChannelMessageError';
322
405
  }
323
406
  }
324
407
 
408
+ /**
409
+ * @category exception
410
+ */
325
411
  export class UnknownChannelStateError extends ChannelError {
326
- constructor () {
327
- super('State Channels FSM entered unknown state')
328
- this.name = 'UnknownChannelStateError'
412
+ constructor() {
413
+ super('State Channels FSM entered unknown state');
414
+ this.name = 'UnknownChannelStateError';
329
415
  }
330
416
  }
331
417
 
332
- /* compiler issued errors */
333
- /* errors from option validations */
418
+ /**
419
+ * @category exception
420
+ */
334
421
  export class InvalidAuthDataError extends CompilerError {
335
- constructor (message: string) {
336
- super(message)
337
- this.name = 'InvalidAuthDataError'
422
+ constructor(message: string) {
423
+ super(message);
424
+ this.name = 'InvalidAuthDataError';
338
425
  }
339
426
  }
340
427
 
341
- /* contract invocation errors */
428
+ /**
429
+ * @category exception
430
+ */
342
431
  export class BytecodeMismatchError extends ContractError {
343
- constructor (source: string) {
344
- super(`Contract ${source} do not correspond to the bytecode deployed on the chain`)
345
- this.name = 'BytecodeMismatchError'
432
+ constructor(source: string) {
433
+ super(`Contract ${source} do not correspond to the bytecode deployed on the chain`);
434
+ this.name = 'BytecodeMismatchError';
346
435
  }
347
436
  }
348
437
 
438
+ /**
439
+ * @category exception
440
+ */
349
441
  export class DuplicateContractError extends ContractError {
350
- constructor () {
351
- super('Contract already deployed')
352
- this.name = 'DuplicateContractError'
442
+ constructor() {
443
+ super('Contract already deployed');
444
+ this.name = 'DuplicateContractError';
353
445
  }
354
446
  }
355
447
 
448
+ /**
449
+ * @category exception
450
+ */
356
451
  export class InactiveContractError extends ContractError {
357
- constructor (contractAddress: string) {
358
- super(`Contract with address ${contractAddress} not active`)
359
- this.name = 'InactiveContractError'
452
+ constructor(contractAddress: string) {
453
+ super(`Contract with address ${contractAddress} not active`);
454
+ this.name = 'InactiveContractError';
360
455
  }
361
456
  }
362
457
 
458
+ /**
459
+ * @category exception
460
+ */
363
461
  export class InvalidMethodInvocationError extends ContractError {
364
- constructor (message: string) {
365
- super(message)
366
- this.name = 'InvalidMethodInvocationError'
462
+ constructor(message: string) {
463
+ super(message);
464
+ this.name = 'InvalidMethodInvocationError';
367
465
  }
368
466
  }
369
467
 
468
+ /**
469
+ * @category exception
470
+ */
370
471
  export class MissingContractAddressError extends ContractError {
371
- constructor (message: string) {
372
- super(message)
373
- this.name = 'MissingContractAddressError'
472
+ constructor(message: string) {
473
+ super(message);
474
+ this.name = 'MissingContractAddressError';
374
475
  }
375
476
  }
376
477
 
478
+ /**
479
+ * @category exception
480
+ */
377
481
  export class MissingContractDefError extends ContractError {
378
- constructor () {
379
- super('Either ACI or source code is required')
380
- this.name = 'MissingContractDefError'
482
+ constructor() {
483
+ super('Either ACI or source code is required');
484
+ this.name = 'MissingContractDefError';
381
485
  }
382
486
  }
383
487
 
488
+ /**
489
+ * @category exception
490
+ */
384
491
  export class MissingFunctionNameError extends ContractError {
385
- constructor () {
386
- super('Function name is required')
387
- this.name = 'MissingFunctionNameError'
492
+ constructor() {
493
+ super('Function name is required');
494
+ this.name = 'MissingFunctionNameError';
388
495
  }
389
496
  }
390
497
 
498
+ /**
499
+ * @category exception
500
+ */
391
501
  export class NodeInvocationError extends ContractError {
392
- constructor (message?: string) {
393
- message = message ?? ''
394
- super(`Invocation failed${message === '' ? '' : `: "${message}"`}`)
395
- this.name = 'NodeInvocationError'
502
+ transaction: string;
503
+
504
+ constructor(message: string, transaction: string) {
505
+ super(`Invocation failed${message == null ? '' : `: "${message}"`}`);
506
+ this.name = 'NodeInvocationError';
507
+ this.transaction = transaction;
396
508
  }
397
509
  }
398
510
 
511
+ /**
512
+ * @category exception
513
+ */
399
514
  export class NoSuchContractFunctionError extends ContractError {
400
- constructor (name: string) {
401
- super(`Function ${name} doesn't exist in contract`)
402
- this.name = 'NoSuchContractFunctionError'
515
+ constructor(name: string) {
516
+ super(`Function ${name} doesn't exist in contract`);
517
+ this.name = 'NoSuchContractFunctionError';
403
518
  }
404
519
  }
405
520
 
521
+ /**
522
+ * @category exception
523
+ */
406
524
  export class NotPayableFunctionError extends ContractError {
407
- constructor (amount: string, fn: string) {
525
+ constructor(amount: string, fn: string) {
408
526
  super(
409
- `You try to pay "${amount}" to function "${fn}" which is not payable. ` +
410
- 'Only payable function can accept tokens')
411
- this.name = 'NotPayableFunctionError'
527
+ `You try to pay "${amount}" to function "${fn}" which is not payable. `
528
+ + 'Only payable function can accept coins',
529
+ );
530
+ this.name = 'NotPayableFunctionError';
412
531
  }
413
532
  }
414
533
 
534
+ /**
535
+ * @category exception
536
+ */
415
537
  export class MissingEventDefinitionError extends ContractError {
416
- constructor (eventNameHash: string, eventAddress: string) {
538
+ constructor(eventNameHash: string, eventAddress: string) {
417
539
  super(
418
- `Can't find definition of ${eventNameHash} event emitted by ${eventAddress}` +
419
- ' (use omitUnknown option to ignore events like this)'
420
- )
421
- this.name = 'MissingEventDefinitionError'
540
+ `Can't find definition of ${eventNameHash} event emitted by ${eventAddress}`
541
+ + ' (use omitUnknown option to ignore events like this)',
542
+ );
543
+ this.name = 'MissingEventDefinitionError';
422
544
  }
423
545
  }
424
546
 
547
+ /**
548
+ * @category exception
549
+ */
425
550
  export class AmbiguousEventDefinitionError extends ContractError {
426
- constructor (eventAddress: string, matchedEvents: [string, string][]) {
551
+ constructor(eventAddress: string, matchedEvents: Array<[string, string]>) {
427
552
  super(
428
- `Found multiple definitions of "${matchedEvents[0][1]}" event emitted by ${eventAddress}` +
429
- ` in ${matchedEvents.map(([name]) => `"${name}"`).join(', ')} contracts` +
430
- ' (use contractAddressToName option to specify contract name corresponding to address)'
431
- )
432
- this.name = 'AmbiguousEventDefinitionError'
553
+ `Found multiple definitions of "${matchedEvents[0][1]}" event emitted by ${eventAddress}`
554
+ + ` in ${matchedEvents.map(([name]) => `"${name}"`).join(', ')} contracts`
555
+ + ' (use contractAddressToName option to specify contract name corresponding to address)',
556
+ );
557
+ this.name = 'AmbiguousEventDefinitionError';
433
558
  }
434
559
  }
435
560
 
436
- /* cryptography errors */
561
+ /**
562
+ * @category exception
563
+ */
437
564
  export class InvalidChecksumError extends CryptographyError {
438
- constructor () {
439
- super('Invalid checksum')
440
- this.name = 'InvalidChecksumError'
441
- }
442
- }
443
-
444
- export class InvalidDerivationPathError extends CryptographyError {
445
- constructor () {
446
- super('Invalid path')
447
- this.name = 'InvalidDerivationPathError'
448
- }
449
- }
450
-
451
- export class InvalidKeyError extends CryptographyError {
452
- constructor (message: string) {
453
- super(message)
454
- this.name = 'InvalidKeyError'
565
+ constructor() {
566
+ super('Invalid checksum');
567
+ this.name = 'InvalidChecksumError';
455
568
  }
456
569
  }
457
570
 
571
+ /**
572
+ * @category exception
573
+ */
458
574
  export class InvalidPasswordError extends CryptographyError {
459
- constructor (message: string) {
460
- super(message)
461
- this.name = 'InvalidPasswordError'
575
+ constructor() {
576
+ super('Invalid password or nonce');
577
+ this.name = 'InvalidPasswordError';
462
578
  }
463
579
  }
464
580
 
581
+ /**
582
+ * @category exception
583
+ */
465
584
  export class MerkleTreeHashMismatchError extends CryptographyError {
466
- constructor () {
467
- super('Node hash is not equal to provided one')
468
- this.name = 'MerkleTreeHashMismatchError'
585
+ constructor() {
586
+ super('Node hash is not equal to provided one');
587
+ this.name = 'MerkleTreeHashMismatchError';
469
588
  }
470
589
  }
471
590
 
591
+ /**
592
+ * @category exception
593
+ */
472
594
  export class MissingNodeInTreeError extends CryptographyError {
473
- constructor (message: string) {
474
- super(message)
475
- this.name = 'MissingNodeInTreeError'
476
- }
477
- }
478
-
479
- export class UnsupportedAlgorithmError extends CryptographyError {
480
- constructor (algo: string) {
481
- super(algo + ' is not available')
482
- this.name = 'UnsupportedAlgorithmError'
483
- }
484
- }
485
-
486
- export class NotHardenedSegmentError extends CryptographyError {
487
- constructor (message: string) {
488
- super(message)
489
- this.name = 'NotHardenedSegmentError'
595
+ constructor(message: string) {
596
+ super(message);
597
+ this.name = 'MissingNodeInTreeError';
490
598
  }
491
599
  }
492
600
 
601
+ /**
602
+ * @category exception
603
+ */
493
604
  export class UnknownNodeLengthError extends CryptographyError {
494
- constructor (nodeLength: number) {
495
- super(`Unknown node length: ${nodeLength}`)
496
- this.name = 'UnknownNodeLengthError'
605
+ constructor(nodeLength: number) {
606
+ super(`Unknown node length: ${nodeLength}`);
607
+ this.name = 'UnknownNodeLengthError';
497
608
  }
498
609
  }
499
610
 
611
+ /**
612
+ * @category exception
613
+ */
500
614
  export class UnknownPathNibbleError extends CryptographyError {
501
- constructor (nibble: number) {
502
- super(`Unknown path nibble: ${nibble}`)
503
- this.name = 'UnknownPathNibbleError'
504
- }
505
- }
506
-
507
- export class UnsupportedChildIndexError extends CryptographyError {
508
- constructor (index: string) {
509
- super(`Child index #${index} is not supported`)
510
- this.name = 'UnsupportedChildIndexError'
511
- }
512
- }
513
-
514
- /* Node errors */
515
- export class DisconnectedError extends NodeError {
516
- constructor () {
517
- super('Can not get node info. Node is not connected')
518
- this.name = 'DisconnectedError'
615
+ constructor(nibble: number) {
616
+ super(`Unknown path nibble: ${nibble}`);
617
+ this.name = 'UnknownPathNibbleError';
519
618
  }
520
619
  }
521
620
 
621
+ /**
622
+ * @category exception
623
+ */
522
624
  export class DuplicateNodeError extends NodeError {
523
- constructor (name: string) {
524
- super(`Node with name ${name} already exist`)
525
- this.name = 'DuplicateNodeError'
625
+ constructor(name: string) {
626
+ super(`Node with name ${name} already exist`);
627
+ this.name = 'DuplicateNodeError';
526
628
  }
527
629
  }
528
630
 
631
+ /**
632
+ * @category exception
633
+ */
529
634
  export class NodeNotFoundError extends NodeError {
530
- constructor (message: string) {
531
- super(message)
532
- this.name = 'NodeNotFoundError'
635
+ constructor(message: string) {
636
+ super(message);
637
+ this.name = 'NodeNotFoundError';
533
638
  }
534
639
  }
535
640
 
536
- /* transaction related errors */
641
+ /**
642
+ * @category exception
643
+ */
537
644
  export class DecodeError extends TransactionError {
538
- constructor (message: string) {
539
- super(message)
540
- this.name = 'DecodeError'
541
- }
542
- }
543
-
544
- export class EncodeError extends TransactionError {
545
- constructor (message: string) {
546
- super(message)
547
- this.name = 'EncodeError'
645
+ constructor(message: string) {
646
+ super(message);
647
+ this.name = 'DecodeError';
548
648
  }
549
649
  }
550
650
 
651
+ /**
652
+ * @category exception
653
+ */
551
654
  export class PayloadLengthError extends TransactionError {
552
- constructor (message: string) {
553
- super(message)
554
- this.name = 'PayloadLengthError'
655
+ constructor(message: string) {
656
+ super(message);
657
+ this.name = 'PayloadLengthError';
555
658
  }
556
659
  }
557
660
 
661
+ /**
662
+ * @category exception
663
+ */
558
664
  export class DryRunError extends TransactionError {
559
- constructor (message: string) {
560
- super(message)
561
- this.name = 'DryRunError'
665
+ constructor(message: string) {
666
+ super(message);
667
+ this.name = 'DryRunError';
562
668
  }
563
669
  }
564
670
 
671
+ /**
672
+ * @category exception
673
+ */
565
674
  export class IllegalBidFeeError extends TransactionError {
566
- constructor (message: string) {
567
- super(message)
568
- this.name = 'IllegalBidFeeError'
675
+ constructor(message: string) {
676
+ super(message);
677
+ this.name = 'IllegalBidFeeError';
569
678
  }
570
679
  }
571
680
 
681
+ /**
682
+ * @category exception
683
+ */
572
684
  export class InvalidSignatureError extends TransactionError {
573
- constructor (message: string) {
574
- super(message)
575
- this.name = 'InvalidSignatureError'
576
- }
577
- }
578
-
579
- export class InvalidTxError extends TransactionError {
580
- constructor (message: string) {
581
- super(message)
582
- this.name = 'InvalidTxError'
685
+ constructor(message: string) {
686
+ super(message);
687
+ this.name = 'InvalidSignatureError';
583
688
  }
584
689
  }
585
690
 
691
+ /**
692
+ * @category exception
693
+ */
586
694
  export class InvalidTxParamsError extends TransactionError {
587
- constructor (message: string) {
588
- super(message)
589
- this.name = 'InvalidTxParamsError'
590
- }
591
- }
592
-
593
- export class NoDefaultAensPointerError extends TransactionError {
594
- constructor (prefix: string) {
595
- super(`Default AENS pointer key is not defined for ${prefix} prefix`)
596
- this.name = 'NoDefaultAensPointerError'
597
- }
598
- }
599
-
600
- export class PrefixMismatchError extends TransactionError {
601
- constructor (prefix: string, requiredPrefix: string) {
602
- super(`Encoded string have a wrong type: ${prefix} (expected: ${requiredPrefix})`)
603
- this.name = 'PrefixMismatchError'
695
+ constructor(message: string) {
696
+ super(message);
697
+ this.name = 'InvalidTxParamsError';
604
698
  }
605
699
  }
606
700
 
701
+ /**
702
+ * @category exception
703
+ */
607
704
  export class PrefixNotFoundError extends TransactionError {
608
- constructor (tag: string) {
609
- super(`Prefix for id-tag ${tag} not found.`)
610
- this.name = 'PrefixNotFoundError'
705
+ constructor(tag: number) {
706
+ super(`Prefix for id-tag ${tag} not found.`);
707
+ this.name = 'PrefixNotFoundError';
611
708
  }
612
709
  }
613
710
 
711
+ /**
712
+ * @category exception
713
+ */
614
714
  export class SchemaNotFoundError extends TransactionError {
615
- constructor (message: string) {
616
- super(message)
617
- this.name = 'SchemaNotFoundError'
715
+ constructor(schemaName: string, key: string, version: number) {
716
+ super(`Transaction ${schemaName} not implemented for ${key} version ${version}`);
717
+ this.name = 'SchemaNotFoundError';
618
718
  }
619
719
  }
620
720
 
721
+ /**
722
+ * @category exception
723
+ */
621
724
  export class TagNotFoundError extends TransactionError {
622
- constructor (prefix: string) {
623
- super(`Id tag for prefix ${prefix} not found.`)
624
- this.name = 'DecodeError'
725
+ constructor(prefix: string) {
726
+ super(`Id tag for prefix ${prefix} not found.`);
727
+ this.name = 'DecodeError';
625
728
  }
626
729
  }
627
730
 
731
+ /**
732
+ * @category exception
733
+ */
628
734
  export class TxNotInChainError extends TransactionError {
629
- constructor (txHash: string) {
630
- super(`Transaction ${txHash} is removed from chain`)
631
- this.name = 'TxNotInChainError'
735
+ constructor(txHash: string) {
736
+ super(`Transaction ${txHash} is removed from chain`);
737
+ this.name = 'TxNotInChainError';
632
738
  }
633
739
  }
634
740
 
741
+ /**
742
+ * @category exception
743
+ */
635
744
  export class UnknownTxError extends TransactionError {
636
- constructor (message: string) {
637
- super(message)
638
- this.name = 'UnknownTxError'
745
+ constructor(message: string) {
746
+ super(message);
747
+ this.name = 'UnknownTxError';
639
748
  }
640
749
  }
641
750
 
751
+ /**
752
+ * @category exception
753
+ */
642
754
  export class UnsupportedABIversionError extends TransactionError {
643
- constructor (message: string) {
644
- super(message)
645
- this.name = 'UnsupportedABIversionError'
755
+ constructor(message: string) {
756
+ super(message);
757
+ this.name = 'UnsupportedABIversionError';
646
758
  }
647
759
  }
648
760
 
761
+ /**
762
+ * @category exception
763
+ */
649
764
  export class UnsupportedVMversionError extends TransactionError {
650
- constructor (message: string) {
651
- super(message)
652
- this.name = 'UnsupportedVMversionError'
765
+ constructor(message: string) {
766
+ super(message);
767
+ this.name = 'UnsupportedVMversionError';
653
768
  }
654
769
  }
655
770
 
656
- /* Wallet Errors */
771
+ /**
772
+ * @category exception
773
+ */
657
774
  export class AlreadyConnectedError extends WalletError {
658
- constructor (message: string) {
659
- super(message)
660
- this.name = 'AlreadyConnectedError'
661
- }
662
- }
663
-
664
- export class MessageDirectionError extends WalletError {
665
- constructor (message: string) {
666
- super(message)
667
- this.name = 'MessageDirectionError'
775
+ constructor(message: string) {
776
+ super(message);
777
+ this.name = 'AlreadyConnectedError';
668
778
  }
669
779
  }
670
780
 
781
+ /**
782
+ * @category exception
783
+ */
671
784
  export class NoWalletConnectedError extends WalletError {
672
- constructor (message: string) {
673
- super(message)
674
- this.name = 'NoWalletConnectedError'
785
+ constructor(message: string) {
786
+ super(message);
787
+ this.name = 'NoWalletConnectedError';
675
788
  }
676
789
  }
677
790
 
791
+ /**
792
+ * @category exception
793
+ */
678
794
  export class RpcConnectionError extends WalletError {
679
- constructor (message: string) {
680
- super(message)
681
- this.name = 'RpcConnectionError'
795
+ constructor(message: string) {
796
+ super(message);
797
+ this.name = 'RpcConnectionError';
682
798
  }
683
799
  }