@aeternity/aepp-sdk 11.0.1 → 12.1.1

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 (444) 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 +20765 -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 +136 -85
  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 +61 -47
  135. package/es/tx/builder/constants.mjs.map +1 -1
  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 -198
  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 -561
  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 -98
  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 +71 -59
  218. package/es/utils/encoder.mjs.map +1 -1
  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 +55 -43
  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 +172 -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 +116 -71
  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/encoder.d.ts +0 -26
  360. package/es/node-pool/index.mjs +0 -188
  361. package/es/node-pool/index.mjs.map +0 -1
  362. package/es/node.mjs +0 -133
  363. package/es/node.mjs.map +0 -1
  364. package/es/other.d.ts +0 -31
  365. package/es/semver-satisfies.d.ts +0 -1
  366. package/es/string.d.ts +0 -26
  367. package/es/tx/builder/field-types.mjs +0 -74
  368. package/es/tx/builder/field-types.mjs.map +0 -1
  369. package/es/tx/tx-object.mjs +0 -283
  370. package/es/tx/tx-object.mjs.map +0 -1
  371. package/es/tx/tx.mjs +0 -938
  372. package/es/tx/tx.mjs.map +0 -1
  373. package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs +0 -132
  374. package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs.map +0 -1
  375. package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs +0 -183
  376. package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs.map +0 -1
  377. package/es/utils/aepp-wallet-communication/connection/index.mjs +0 -87
  378. package/es/utils/aepp-wallet-communication/connection/index.mjs.map +0 -1
  379. package/es/utils/aepp-wallet-communication/content-script-bridge.mjs +0 -98
  380. package/es/utils/aepp-wallet-communication/content-script-bridge.mjs.map +0 -1
  381. package/es/utils/aepp-wallet-communication/helpers.mjs +0 -92
  382. package/es/utils/aepp-wallet-communication/helpers.mjs.map +0 -1
  383. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs +0 -375
  384. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs.map +0 -1
  385. package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs +0 -275
  386. package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs.map +0 -1
  387. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs +0 -541
  388. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs.map +0 -1
  389. package/es/utils/aepp-wallet-communication/schema.mjs +0 -102
  390. package/es/utils/aepp-wallet-communication/schema.mjs.map +0 -1
  391. package/es/utils/aepp-wallet-communication/wallet-detector.mjs +0 -110
  392. package/es/utils/aepp-wallet-communication/wallet-detector.mjs.map +0 -1
  393. package/es/utils/async-init.mjs +0 -64
  394. package/es/utils/async-init.mjs.map +0 -1
  395. package/es/utils/crypto-ts.mjs.map +0 -1
  396. package/es/utils/swagger.mjs +0 -164
  397. package/es/utils/swagger.mjs.map +0 -1
  398. package/src/account/base.js +0 -153
  399. package/src/account/memory.js +0 -83
  400. package/src/account/multiple.js +0 -162
  401. package/src/ae/aens.js +0 -361
  402. package/src/ae/aepp.js +0 -45
  403. package/src/ae/contract.js +0 -148
  404. package/src/ae/index.js +0 -168
  405. package/src/ae/oracle.js +0 -311
  406. package/src/ae/universal.js +0 -47
  407. package/src/ae/wallet.js +0 -50
  408. package/src/chain/index.js +0 -269
  409. package/src/chain/node.js +0 -320
  410. package/src/channel/handlers.js +0 -673
  411. package/src/channel/index.js +0 -903
  412. package/src/channel/internal.js +0 -236
  413. package/src/contract/aci.js +0 -376
  414. package/src/contract/compiler.js +0 -100
  415. package/src/contract/ga/helpers.js +0 -19
  416. package/src/contract/ga/index.js +0 -150
  417. package/src/index.js +0 -89
  418. package/src/node-pool/index.js +0 -172
  419. package/src/node.js +0 -116
  420. package/src/tx/builder/constants.js +0 -100
  421. package/src/tx/builder/field-types.js +0 -61
  422. package/src/tx/builder/helpers.js +0 -334
  423. package/src/tx/builder/index.js +0 -465
  424. package/src/tx/builder/schema.js +0 -1100
  425. package/src/tx/index.js +0 -301
  426. package/src/tx/tx-object.js +0 -187
  427. package/src/tx/tx.js +0 -631
  428. package/src/tx/validator.js +0 -181
  429. package/src/utils/aepp-wallet-communication/connection/browser-runtime.js +0 -119
  430. package/src/utils/aepp-wallet-communication/connection/browser-window-message.js +0 -165
  431. package/src/utils/aepp-wallet-communication/connection/index.js +0 -85
  432. package/src/utils/aepp-wallet-communication/content-script-bridge.js +0 -86
  433. package/src/utils/aepp-wallet-communication/helpers.js +0 -60
  434. package/src/utils/aepp-wallet-communication/rpc/aepp-rpc.js +0 -294
  435. package/src/utils/aepp-wallet-communication/rpc/rpc-client.js +0 -232
  436. package/src/utils/aepp-wallet-communication/rpc/wallet-rpc.js +0 -401
  437. package/src/utils/aepp-wallet-communication/schema.ts +0 -80
  438. package/src/utils/aepp-wallet-communication/wallet-detector.js +0 -92
  439. package/src/utils/async-init.js +0 -45
  440. package/src/utils/crypto.js +0 -219
  441. package/src/utils/hd-wallet.js +0 -100
  442. package/src/utils/json-big.js +0 -26
  443. package/src/utils/keystore.js +0 -219
  444. package/src/utils/swagger.js +0 -156
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/encoder.ts"],"names":["bs58","DecodeError","EncodeError","InvalidChecksumError","PayloadLengthError","PrefixMismatchError","sha256hash","input","sha256","update","digest","base64Types","base58Types","typesLength","ak","ct","ok","ensureValidLength","data","type","length","getChecksum","payload","slice","addChecksum","from","concat","getPayload","buffer","equals","base64","encode","toString","decode","string","base58","requiredPrefix","prefix","encodedPayload","extra","split","decoder","includes","encoder"],"mappings":";;;;AAAA,OAAO,KAAKA,IAAZ,MAAsB,MAAtB;AACA,mBAAuB,QAAvB;;;;SAEEC,W,EACAC,W,EACAC,oB,EACAC,kB,EACAC,mB;AAGF;AACA;AACA;AACA;AACA;AACA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AAmCiB,IAAK,EAAzD,CAAN;;AACX,MAAIkB,cAAc,IAAIA,cAAc,KAAKC,MAAzC,EAAiD;AAC/C,UAAM,IAAIhC,mBAAJ,CAAwBgC,MAAxB,EAAgCD,cAAhC,CAAN;AACD;;AACD,QAAMK,OAAO,GAAI9B,WAAW,CAAC+B,QAAZ,CAAqBL,MAArB,KAAgCP,MAAM,CAACG,MAAxC,IACbrB,WAAW,CAAC8B,QAAZ,CAAqBL,MAArB,KAAgCF,MAAM,CAACF,MAD1C;;AAEA,MAAI,CAACQ,OAAL,EAAc;AACZ,UAAM,IAAIxC,WAAJ,CAAiB,qCAAoCoC,MAAO,EAA5D,CAAN;AACD;;AACD,QAAMf,OAAO,GAAGmB,OAAO,CAACH,cAAD,CAAvB;AACArB,EAAAA,iBAAiB,CAACK,OAAD,EAAUe,MAAV,CAAjB;AACA,SAAOf,OAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASS,MAAT,CAAiBb,IAAjB,EAAwCC,IAAxC,EAAsD;AAC3D,QAAMwB,OAAO,GAAIhC,WAAW,CAAC+B,QAAZ,CAAqBvB,IAArB,KAA8BW,MAAM,CAACC,MAAtC,IACbnB,WAAW,CAAC8B,QAAZ,CAAqBvB,IAArB,KAA8BgB,MAAM,CAACJ,MADxC;;AAEA,MAAI,CAACY,OAAL,EAAc;AACZ,UAAM,IAAIzC,WAAJ,CAAiB,iBAAgBiB,IAAK,EAAtC,CAAN;AACD;;AACDF,EAAAA,iBAAiB,CAACC,IAAD,EAAOC,IAAP,CAAjB;AACA,SAAQ,GAAEA,IAAK,IAAGwB,OAAO,CAACzB,IAAD,CAAO,EAAhC;AACD","sourcesContent":["import * as bs58 from 'bs58'\nimport { sha256 } from 'sha.js'\nimport {\n DecodeError,\n EncodeError,\n InvalidChecksumError,\n PayloadLengthError,\n PrefixMismatchError\n} from './errors'\n\n/**\n * Calculate SHA256 hash of `input`\n * @rtype (input: String) => hash: String\n * @param {Buffer|String} input - Data to hash\n * @return {String} Hash\n */\nexport function sha256hash (input: Buffer | string) {\n return new sha256().update(input).digest()\n}\n\n// based on https://github.com/aeternity/protocol/blob/master/node/api/api_encoding.md\nconst base64Types = ['ba', 'cb', 'or', 'ov', 'pi', 'ss', 'cs', 'ck', 'cv', 'st', 'tx']\nconst base58Types = ['ak', 'bf', 'bs', 'bx', 'ch', 'cm', 'ct', 'kh', 'mh', 'nm', 'ok', 'oq', 'pp', 'sg', 'th']\n// TODO: add all types with a fixed length\nconst typesLength: { [name: string]: number } = {\n ak: 32,\n ct: 32,\n ok: 32\n} as const\n\nfunction ensureValidLength (data: Buffer | string, type: string) {\n if (!typesLength[type]) return\n if (data.length === typesLength[type]) return\n throw new PayloadLengthError(`Payload should be ${typesLength[type]} bytes, got ${data.length} instead`)\n}\n\nconst getChecksum = (payload: Buffer | string) => sha256hash(sha256hash(payload)).slice(0, 4)\n\nconst addChecksum = (input: Buffer | string) => {\n const payload = Buffer.from(input)\n return Buffer.concat([payload, getChecksum(payload)])\n}\n\nfunction getPayload (buffer: Buffer) {\n const payload = buffer.slice(0, -4)\n if (!getChecksum(payload).equals(buffer.slice(-4))) throw new InvalidChecksumError()\n return payload\n}\n\nconst base64 = {\n encode: (buffer: Buffer | string) => addChecksum(buffer).toString('base64'),\n decode: (string: string) => getPayload(Buffer.from(string, 'base64'))\n}\n\nconst base58 = {\n encode: (buffer: Buffer | string) => bs58.encode(addChecksum(buffer)),\n decode: (string: string) => getPayload(bs58.decode(string))\n}\n\n/**\n * Decode data using the default encoding/decoding algorithm\n * @function\n * @alias module:@aeternity/aepp-sdk/es/tx/builder/helpers\n * @param {string} data An Base58/64check encoded and prefixed string (ex tx_..., sg_..., ak_....)\n * @param {string} [requiredPrefix] Ensure that data have this prefix\n * @return {Buffer} Decoded data\n */\nexport function decode (data: string, requiredPrefix?: string) {\n const [prefix, encodedPayload, extra] = data.split('_')\n if (!encodedPayload) throw new DecodeError(`Encoded string missing payload: ${data}`)\n if (extra) throw new DecodeError(`Encoded string have extra parts: ${data}`)\n if (requiredPrefix && requiredPrefix !== prefix) {\n throw new PrefixMismatchError(prefix, requiredPrefix)\n }\n const decoder = (base64Types.includes(prefix) && base64.decode) ||\n (base58Types.includes(prefix) && base58.decode)\n if (!decoder) {\n throw new DecodeError(`Encoded string have unknown type: ${prefix}`)\n }\n const payload = decoder(encodedPayload)\n ensureValidLength(payload, prefix)\n return payload\n}\n\n/**\n * Encode data using the default encoding/decoding algorithm\n * @function\n * @alias module:@aeternity/aepp-sdk/es/tx/builder/helpers\n * @param {Buffer|String} data An decoded data\n * @param {string} type Prefix of Transaction\n * @return {String} Encoded string Base58check or Base64check data\n */\nexport function encode (data: Buffer | string, type: string) {\n const encoder = (base64Types.includes(type) && base64.encode) ||\n (base58Types.includes(type) && base58.encode)\n if (!encoder) {\n throw new EncodeError(`Unknown type: ${type}`)\n }\n ensureValidLength(data, type)\n return `${type}_${encoder(data)}`\n}\n"],"file":"encoder.mjs"}
1
+ {"version":3,"file":"encoder.mjs","names":["Sha256","DecodeError","ArgumentError","InvalidChecksumError","PayloadLengthError","concatBuffers","isKeyOfObject","Encoded","Encoding","sha256hash","input","update","digest","base64Types","ContractBytearray","ContractStoreKey","ContractStoreValue","Transaction","OracleQuery","OracleResponse","State","Poi","StateTrees","CallStateTree","Bytearray","base58Types","KeyBlockHash","MicroBlockHash","BlockPofHash","BlockTxHash","BlockStateHash","Channel","ContractAddress","TxHash","OracleAddress","OracleQueryId","AccountAddress","Signature","Commitment","PeerPubkey","Name","byteSizeForType","ensureValidLength","data","type","reqLen","length","getChecksum","payload","slice","addChecksum","getPayload","buffer","equals","base64","encode","toString","decode","string","from","base58","bs58Encode","bs58Decode","parseType","maybeType","base64Type","find","t","base58Type","join","prefix","encodedPayload","extra","split","encoder"],"sources":["../../src/utils/encoder.ts"],"sourcesContent":["import { encode as bs58Encode, decode as bs58Decode } from 'bs58';\n// js extension is required for mjs build, not importing the whole package to reduce bundle size\n// eslint-disable-next-line import/extensions\nimport Sha256 from 'sha.js/sha256.js';\nimport {\n DecodeError,\n ArgumentError,\n InvalidChecksumError,\n PayloadLengthError,\n} from './errors';\nimport { concatBuffers, isKeyOfObject } from './other';\nimport * as Encoded from './encoder-types';\nimport { Encoding } from './encoder-types';\n\nexport { Encoded, Encoding };\n\n/**\n * Calculate SHA256 hash of `input`\n * @param input - Data to hash\n * @returns Hash\n * @deprecated use `SubtleCrypto.digest` or `sha.js` package instead\n */\nexport function sha256hash(input: Uint8Array | string): Buffer {\n return new Sha256().update(input).digest();\n}\n\n/**\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L177-L202}\n */\nconst base64Types = [\n Encoding.ContractBytearray,\n Encoding.ContractStoreKey,\n Encoding.ContractStoreValue,\n Encoding.Transaction,\n Encoding.OracleQuery,\n Encoding.OracleResponse,\n Encoding.State,\n Encoding.Poi,\n Encoding.StateTrees,\n Encoding.CallStateTree,\n Encoding.Bytearray,\n] as const;\nconst base58Types = [\n Encoding.KeyBlockHash,\n Encoding.MicroBlockHash,\n Encoding.BlockPofHash,\n Encoding.BlockTxHash,\n Encoding.BlockStateHash,\n Encoding.Channel,\n Encoding.ContractAddress,\n Encoding.TxHash,\n Encoding.OracleAddress,\n Encoding.OracleQueryId,\n Encoding.AccountAddress,\n Encoding.Signature,\n Encoding.Commitment,\n Encoding.PeerPubkey,\n Encoding.Name,\n] as const;\n\n/**\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L261-L286}\n */\nconst byteSizeForType = {\n [Encoding.KeyBlockHash]: 32,\n [Encoding.MicroBlockHash]: 32,\n [Encoding.BlockPofHash]: 32,\n [Encoding.BlockTxHash]: 32,\n [Encoding.BlockStateHash]: 32,\n [Encoding.Channel]: 32,\n [Encoding.ContractAddress]: 32,\n [Encoding.TxHash]: 32,\n [Encoding.OracleAddress]: 32,\n [Encoding.OracleQueryId]: 32,\n [Encoding.AccountAddress]: 32,\n [Encoding.Signature]: 64,\n [Encoding.Commitment]: 32,\n [Encoding.PeerPubkey]: 32,\n [Encoding.State]: 32,\n} as const;\n\nfunction ensureValidLength(data: Uint8Array, type: Encoding): void {\n if (!isKeyOfObject(type, byteSizeForType)) return;\n const reqLen = byteSizeForType[type];\n if (reqLen == null || data.length === reqLen) return;\n throw new PayloadLengthError(`Payload should be ${reqLen} bytes, got ${data.length} instead`);\n}\n\nconst getChecksum = (payload: Uint8Array): Buffer => sha256hash(sha256hash(payload)).slice(0, 4);\n\nconst addChecksum = (payload: Uint8Array): Buffer => concatBuffers([payload, getChecksum(payload)]);\n\nfunction getPayload(buffer: Buffer): Buffer {\n const payload = buffer.slice(0, -4);\n if (!getChecksum(payload).equals(buffer.slice(-4))) throw new InvalidChecksumError();\n return payload;\n}\n\nconst base64 = {\n encode: (buffer: Uint8Array) => addChecksum(buffer).toString('base64'),\n decode: (string: string) => getPayload(Buffer.from(string, 'base64')),\n};\n\nconst base58 = {\n encode: (buffer: Uint8Array) => bs58Encode(addChecksum(buffer)),\n decode: (string: string) => getPayload(Buffer.from(bs58Decode(string))),\n};\n\nconst parseType = (maybeType: unknown): [Encoding, typeof base64] => {\n const base64Type = base64Types.find((t) => t === maybeType);\n if (base64Type != null) return [base64Type, base64];\n const base58Type = base58Types.find((t) => t === maybeType);\n if (base58Type != null) return [base58Type, base58];\n throw new ArgumentError('prefix', `one of ${[...base58Types, ...base64Types].join(', ')}`, maybeType);\n};\n\n/**\n * Decode data using the default encoding/decoding algorithm\n * @param data - An Base58/64check encoded and prefixed string\n * (ex tx_..., sg_..., ak_....)\n * @returns Decoded data\n */\nexport function decode(data: Encoded.Any): Buffer {\n const [prefix, encodedPayload, extra] = data.split('_');\n if (encodedPayload == null) throw new DecodeError(`Encoded string missing payload: ${data}`);\n if (extra != null) throw new DecodeError(`Encoded string have extra parts: ${data}`);\n const [type, encoder] = parseType(prefix);\n const payload = encoder.decode(encodedPayload);\n ensureValidLength(payload, type);\n return payload;\n}\n\n/**\n * Encode data using the default encoding/decoding algorithm\n * @param data - An decoded data\n * @param type - Prefix of Transaction\n * @returns Encoded string Base58check or Base64check data\n */\nexport function encode<Type extends Encoding>(\n data: Uint8Array,\n type: Type,\n): Encoded.Generic<Type> {\n const [, encoder] = parseType(type);\n ensureValidLength(data, type);\n return `${type}_${encoder.encode(data)}`;\n}\n"],"mappings":";;;;AAAA,gBAA2D,MAA3D,C,CACA;AACA;;;;;;AACA,OAAOA,MAAP,MAAmB,kBAAnB;SAEEC,W,EACAC,a,EACAC,oB,EACAC,kB;SAEOC,a,EAAeC,a;OACjB,KAAKC,O;SACHC,Q;AAET,SAASD,OAAT,EAAkBC,QAAlB;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,UAAT,CAAoBC,KAApB,EAAwD;EAC7D,OAAO,IAAIV,MAAJ,GAAaW,MAAb,CAAoBD,KAApB,EAA2BE,MAA3B,EAAP;AACD;AAED;AACA;AACA;;AACA,MAAMC,WAAW,GAAG,CAClBL,QAAQ,CAACM,iBADS,EAElBN,QAAQ,CAACO,gBAFS,EAGlBP,QAAQ,CAACQ,kBAHS,EAIlBR,QAAQ,CAACS,WAJS,EAKlBT,QAAQ,CAACU,WALS,EAMlBV,QAAQ,CAACW,cANS,EAOlBX,QAAQ,CAACY,KAPS,EAQlBZ,QAAQ,CAACa,GARS,EASlBb,QAAQ,CAACc,UATS,EAUlBd,QAAQ,CAACe,aAVS,EAWlBf,QAAQ,CAACgB,SAXS,CAApB;AAaA,MAAMC,WAAW,GAAG,CAClBjB,QAAQ,CAACkB,YADS,EAElBlB,QAAQ,CAACmB,cAFS,EAGlBnB,QAAQ,CAACoB,YAHS,EAIlBpB,QAAQ,CAACqB,WAJS,EAKlBrB,QAAQ,CAACsB,cALS,EAMlBtB,QAAQ,CAACuB,OANS,EAOlBvB,QAAQ,CAACwB,eAPS,EAQlBxB,QAAQ,CAACyB,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Q,GAAEA,IAAK,IAAG8B,OAAO,CAACnB,MAAR,CAAeZ,IAAf,CAAqB,EAAvC;AACD"}
@@ -1,284 +1,471 @@
1
- /**
2
- * Error module
3
- * @module @aeternity/aepp-sdk/es/utils/errors
4
- * @example import { BytecodeMismatchError } from '@aeternity/aepp-sdk'
5
- */
1
+ import BigNumber from 'bignumber.js';
6
2
  /**
7
3
  * aepp-sdk originated error
4
+ * @category exception
8
5
  */
9
6
  export declare abstract class BaseError extends Error {
10
7
  constructor(message: string);
11
8
  }
9
+ /**
10
+ * @category exception
11
+ */
12
12
  export declare class AccountError extends BaseError {
13
13
  constructor(message: string);
14
14
  }
15
+ /**
16
+ * @category exception
17
+ */
15
18
  export declare class AensError extends BaseError {
16
19
  constructor(message: string);
17
20
  }
21
+ /**
22
+ * @category exception
23
+ */
18
24
  export declare class AeppError extends BaseError {
19
25
  constructor(message: string);
20
26
  }
27
+ /**
28
+ * @category exception
29
+ */
21
30
  export declare class ChannelError extends BaseError {
22
31
  constructor(message: string);
23
32
  }
33
+ /**
34
+ * @category exception
35
+ */
24
36
  export declare class CompilerError extends BaseError {
25
37
  constructor(message: string);
26
38
  }
39
+ /**
40
+ * @category exception
41
+ */
27
42
  export declare class ContractError extends BaseError {
28
43
  constructor(message: string);
29
44
  }
45
+ /**
46
+ * @category exception
47
+ */
30
48
  export declare class CryptographyError extends BaseError {
31
49
  constructor(message: string);
32
50
  }
51
+ /**
52
+ * @category exception
53
+ */
33
54
  export declare class NodeError extends BaseError {
34
55
  constructor(message: string);
35
56
  }
57
+ /**
58
+ * @category exception
59
+ */
36
60
  export declare class TransactionError extends BaseError {
37
61
  constructor(message: string);
38
62
  }
63
+ /**
64
+ * @category exception
65
+ */
39
66
  export declare class WalletError extends BaseError {
40
67
  constructor(message: string);
41
68
  }
69
+ /**
70
+ * @category exception
71
+ */
42
72
  export declare class ArgumentError extends BaseError {
43
73
  constructor(argumentName: string, requirement: string, argumentValue: any);
44
74
  }
75
+ /**
76
+ * @category exception
77
+ */
45
78
  export declare class IllegalArgumentError extends CryptographyError {
46
79
  constructor(message: string);
47
80
  }
81
+ /**
82
+ * @category exception
83
+ */
48
84
  export declare class ArgumentCountMismatchError extends BaseError {
49
85
  constructor(functionName: string, requiredCount: number, providedCount: number);
50
86
  }
87
+ /**
88
+ * @category exception
89
+ */
51
90
  export declare class InsufficientBalanceError extends BaseError {
52
91
  constructor(message: string);
53
92
  }
54
- export declare class InvalidDenominationError extends BaseError {
55
- constructor(message: string);
56
- }
57
- export declare class InvalidNameError extends BaseError {
58
- constructor(message: string);
59
- }
93
+ /**
94
+ * @category exception
95
+ */
60
96
  export declare class MissingParamError extends BaseError {
61
97
  constructor(message: string);
62
98
  }
63
- export declare class NoBrowserFoundError extends BaseError {
64
- constructor();
65
- }
99
+ /**
100
+ * @category exception
101
+ */
66
102
  export declare class NoSerializerFoundError extends BaseError {
67
103
  constructor();
68
104
  }
105
+ /**
106
+ * @category exception
107
+ */
69
108
  export declare class RequestTimedOutError extends BaseError {
70
- constructor(requestTime: number);
109
+ constructor(height: number);
71
110
  }
111
+ /**
112
+ * @category exception
113
+ */
72
114
  export declare class TxTimedOutError extends BaseError {
73
- constructor(blocks: number, th: string, status?: string);
115
+ constructor(blocks: number, th: string);
74
116
  }
117
+ /**
118
+ * @category exception
119
+ */
75
120
  export declare class TypeError extends BaseError {
76
121
  constructor(message: string);
77
122
  }
123
+ /**
124
+ * @category exception
125
+ */
78
126
  export declare class UnsupportedPlatformError extends BaseError {
79
127
  constructor(message: string);
80
128
  }
129
+ /**
130
+ * @category exception
131
+ */
81
132
  export declare class UnsupportedProtocolError extends BaseError {
82
133
  constructor(message: string);
83
134
  }
135
+ /**
136
+ * @category exception
137
+ */
84
138
  export declare class NotImplementedError extends BaseError {
85
139
  constructor(message: string);
86
140
  }
141
+ /**
142
+ * @category exception
143
+ */
87
144
  export declare class UnsupportedVersionError extends BaseError {
88
145
  constructor(dependency: string, version: string, geVersion: string, ltVersion: string);
89
146
  }
147
+ /**
148
+ * @category exception
149
+ */
90
150
  export declare class InternalError extends BaseError {
91
151
  constructor(message: string);
92
152
  }
153
+ /**
154
+ * @category exception
155
+ */
156
+ export declare class UnexpectedTsError extends InternalError {
157
+ constructor(message?: string);
158
+ }
159
+ /**
160
+ * @category exception
161
+ */
93
162
  export declare class InvalidKeypairError extends AccountError {
94
163
  constructor(message: string);
95
164
  }
165
+ /**
166
+ * @category exception
167
+ */
96
168
  export declare class UnavailableAccountError extends AccountError {
97
169
  constructor(address: string);
98
170
  }
171
+ /**
172
+ * @category exception
173
+ */
99
174
  export declare class AensPointerContextError extends AensError {
100
175
  constructor(nameOrId: string, prefix: string);
101
176
  }
177
+ /**
178
+ * @category exception
179
+ */
102
180
  export declare class InsufficientNameFeeError extends AensError {
103
- constructor(nameFee: number, minNameFee: number);
181
+ constructor(nameFee: BigNumber, minNameFee: BigNumber);
104
182
  }
183
+ /**
184
+ * @category exception
185
+ */
105
186
  export declare class InvalidAensNameError extends AensError {
106
187
  constructor(message: string);
107
188
  }
108
- export declare class DuplicateCallbackError extends AeppError {
109
- constructor();
110
- }
189
+ /**
190
+ * @category exception
191
+ */
111
192
  export declare class InvalidRpcMessageError extends AeppError {
112
193
  constructor(message: string);
113
194
  }
195
+ /**
196
+ * @category exception
197
+ */
114
198
  export declare class MissingCallbackError extends AeppError {
115
- constructor(id: string);
199
+ constructor(id: number);
116
200
  }
201
+ /**
202
+ * @category exception
203
+ */
117
204
  export declare class UnAuthorizedAccountError extends AeppError {
118
205
  constructor(onAccount: string);
119
206
  }
207
+ /**
208
+ * @category exception
209
+ */
120
210
  export declare class UnknownRpcClientError extends AeppError {
121
211
  constructor(id: string);
122
212
  }
213
+ /**
214
+ * @category exception
215
+ */
123
216
  export declare class UnsubscribedAccountError extends AeppError {
124
217
  constructor();
125
218
  }
219
+ /**
220
+ * @category exception
221
+ */
126
222
  export declare class ChannelCallError extends ChannelError {
127
223
  constructor(message: string);
128
224
  }
225
+ /**
226
+ * @category exception
227
+ */
129
228
  export declare class ChannelConnectionError extends ChannelError {
130
229
  constructor(message: string);
131
230
  }
231
+ /**
232
+ * @category exception
233
+ */
132
234
  export declare class ChannelPingTimedOutError extends ChannelError {
133
235
  constructor();
134
236
  }
237
+ /**
238
+ * @category exception
239
+ */
135
240
  export declare class UnexpectedChannelMessageError extends ChannelError {
136
241
  constructor(message: string);
137
242
  }
243
+ /**
244
+ * @category exception
245
+ */
138
246
  export declare class UnknownChannelStateError extends ChannelError {
139
247
  constructor();
140
248
  }
249
+ /**
250
+ * @category exception
251
+ */
141
252
  export declare class InvalidAuthDataError extends CompilerError {
142
253
  constructor(message: string);
143
254
  }
255
+ /**
256
+ * @category exception
257
+ */
144
258
  export declare class BytecodeMismatchError extends ContractError {
145
259
  constructor(source: string);
146
260
  }
261
+ /**
262
+ * @category exception
263
+ */
147
264
  export declare class DuplicateContractError extends ContractError {
148
265
  constructor();
149
266
  }
267
+ /**
268
+ * @category exception
269
+ */
150
270
  export declare class InactiveContractError extends ContractError {
151
271
  constructor(contractAddress: string);
152
272
  }
273
+ /**
274
+ * @category exception
275
+ */
153
276
  export declare class InvalidMethodInvocationError extends ContractError {
154
277
  constructor(message: string);
155
278
  }
279
+ /**
280
+ * @category exception
281
+ */
156
282
  export declare class MissingContractAddressError extends ContractError {
157
283
  constructor(message: string);
158
284
  }
285
+ /**
286
+ * @category exception
287
+ */
159
288
  export declare class MissingContractDefError extends ContractError {
160
289
  constructor();
161
290
  }
291
+ /**
292
+ * @category exception
293
+ */
162
294
  export declare class MissingFunctionNameError extends ContractError {
163
295
  constructor();
164
296
  }
297
+ /**
298
+ * @category exception
299
+ */
165
300
  export declare class NodeInvocationError extends ContractError {
166
- constructor(message?: string);
301
+ transaction: string;
302
+ constructor(message: string, transaction: string);
167
303
  }
304
+ /**
305
+ * @category exception
306
+ */
168
307
  export declare class NoSuchContractFunctionError extends ContractError {
169
308
  constructor(name: string);
170
309
  }
310
+ /**
311
+ * @category exception
312
+ */
171
313
  export declare class NotPayableFunctionError extends ContractError {
172
314
  constructor(amount: string, fn: string);
173
315
  }
316
+ /**
317
+ * @category exception
318
+ */
174
319
  export declare class MissingEventDefinitionError extends ContractError {
175
320
  constructor(eventNameHash: string, eventAddress: string);
176
321
  }
322
+ /**
323
+ * @category exception
324
+ */
177
325
  export declare class AmbiguousEventDefinitionError extends ContractError {
178
- constructor(eventAddress: string, matchedEvents: [string, string][]);
326
+ constructor(eventAddress: string, matchedEvents: Array<[string, string]>);
179
327
  }
328
+ /**
329
+ * @category exception
330
+ */
180
331
  export declare class InvalidChecksumError extends CryptographyError {
181
332
  constructor();
182
333
  }
183
- export declare class InvalidDerivationPathError extends CryptographyError {
184
- constructor();
185
- }
186
- export declare class InvalidKeyError extends CryptographyError {
187
- constructor(message: string);
188
- }
334
+ /**
335
+ * @category exception
336
+ */
189
337
  export declare class InvalidPasswordError extends CryptographyError {
190
- constructor(message: string);
338
+ constructor();
191
339
  }
340
+ /**
341
+ * @category exception
342
+ */
192
343
  export declare class MerkleTreeHashMismatchError extends CryptographyError {
193
344
  constructor();
194
345
  }
346
+ /**
347
+ * @category exception
348
+ */
195
349
  export declare class MissingNodeInTreeError extends CryptographyError {
196
350
  constructor(message: string);
197
351
  }
198
- export declare class UnsupportedAlgorithmError extends CryptographyError {
199
- constructor(algo: string);
200
- }
201
- export declare class NotHardenedSegmentError extends CryptographyError {
202
- constructor(message: string);
203
- }
352
+ /**
353
+ * @category exception
354
+ */
204
355
  export declare class UnknownNodeLengthError extends CryptographyError {
205
356
  constructor(nodeLength: number);
206
357
  }
358
+ /**
359
+ * @category exception
360
+ */
207
361
  export declare class UnknownPathNibbleError extends CryptographyError {
208
362
  constructor(nibble: number);
209
363
  }
210
- export declare class UnsupportedChildIndexError extends CryptographyError {
211
- constructor(index: string);
212
- }
213
- export declare class DisconnectedError extends NodeError {
214
- constructor();
215
- }
364
+ /**
365
+ * @category exception
366
+ */
216
367
  export declare class DuplicateNodeError extends NodeError {
217
368
  constructor(name: string);
218
369
  }
370
+ /**
371
+ * @category exception
372
+ */
219
373
  export declare class NodeNotFoundError extends NodeError {
220
374
  constructor(message: string);
221
375
  }
376
+ /**
377
+ * @category exception
378
+ */
222
379
  export declare class DecodeError extends TransactionError {
223
380
  constructor(message: string);
224
381
  }
225
- export declare class EncodeError extends TransactionError {
226
- constructor(message: string);
227
- }
382
+ /**
383
+ * @category exception
384
+ */
228
385
  export declare class PayloadLengthError extends TransactionError {
229
386
  constructor(message: string);
230
387
  }
388
+ /**
389
+ * @category exception
390
+ */
231
391
  export declare class DryRunError extends TransactionError {
232
392
  constructor(message: string);
233
393
  }
394
+ /**
395
+ * @category exception
396
+ */
234
397
  export declare class IllegalBidFeeError extends TransactionError {
235
398
  constructor(message: string);
236
399
  }
400
+ /**
401
+ * @category exception
402
+ */
237
403
  export declare class InvalidSignatureError extends TransactionError {
238
404
  constructor(message: string);
239
405
  }
240
- export declare class InvalidTxError extends TransactionError {
241
- constructor(message: string);
242
- }
406
+ /**
407
+ * @category exception
408
+ */
243
409
  export declare class InvalidTxParamsError extends TransactionError {
244
410
  constructor(message: string);
245
411
  }
246
- export declare class NoDefaultAensPointerError extends TransactionError {
247
- constructor(prefix: string);
248
- }
249
- export declare class PrefixMismatchError extends TransactionError {
250
- constructor(prefix: string, requiredPrefix: string);
251
- }
412
+ /**
413
+ * @category exception
414
+ */
252
415
  export declare class PrefixNotFoundError extends TransactionError {
253
- constructor(tag: string);
416
+ constructor(tag: number);
254
417
  }
418
+ /**
419
+ * @category exception
420
+ */
255
421
  export declare class SchemaNotFoundError extends TransactionError {
256
- constructor(message: string);
422
+ constructor(schemaName: string, key: string, version: number);
257
423
  }
424
+ /**
425
+ * @category exception
426
+ */
258
427
  export declare class TagNotFoundError extends TransactionError {
259
428
  constructor(prefix: string);
260
429
  }
430
+ /**
431
+ * @category exception
432
+ */
261
433
  export declare class TxNotInChainError extends TransactionError {
262
434
  constructor(txHash: string);
263
435
  }
436
+ /**
437
+ * @category exception
438
+ */
264
439
  export declare class UnknownTxError extends TransactionError {
265
440
  constructor(message: string);
266
441
  }
442
+ /**
443
+ * @category exception
444
+ */
267
445
  export declare class UnsupportedABIversionError extends TransactionError {
268
446
  constructor(message: string);
269
447
  }
448
+ /**
449
+ * @category exception
450
+ */
270
451
  export declare class UnsupportedVMversionError extends TransactionError {
271
452
  constructor(message: string);
272
453
  }
454
+ /**
455
+ * @category exception
456
+ */
273
457
  export declare class AlreadyConnectedError extends WalletError {
274
458
  constructor(message: string);
275
459
  }
276
- export declare class MessageDirectionError extends WalletError {
277
- constructor(message: string);
278
- }
460
+ /**
461
+ * @category exception
462
+ */
279
463
  export declare class NoWalletConnectedError extends WalletError {
280
464
  constructor(message: string);
281
465
  }
466
+ /**
467
+ * @category exception
468
+ */
282
469
  export declare class RpcConnectionError extends WalletError {
283
470
  constructor(message: string);
284
471
  }