@aeternity/aepp-sdk 10.0.0 → 12.0.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 (424) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +15 -14
  3. package/dist/aepp-sdk.browser-script.js +1 -1
  4. package/dist/aepp-sdk.browser-script.js.LICENSE.txt +13 -40
  5. package/dist/aepp-sdk.browser-script.js.map +1 -1
  6. package/dist/aepp-sdk.browser.js +1 -1
  7. package/dist/aepp-sdk.browser.js.map +1 -1
  8. package/dist/aepp-sdk.js +1 -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 +69 -0
  14. package/es/AeSdkAepp.mjs +175 -0
  15. package/es/AeSdkAepp.mjs.map +1 -0
  16. package/es/AeSdkBase.d.ts +212 -0
  17. package/es/AeSdkBase.mjs +310 -0
  18. package/es/AeSdkBase.mjs.map +1 -0
  19. package/es/AeSdkWallet.d.ts +103 -0
  20. package/es/AeSdkWallet.mjs +322 -0
  21. package/es/AeSdkWallet.mjs.map +1 -0
  22. package/es/Node.d.ts +44 -0
  23. package/es/Node.mjs +141 -0
  24. package/es/Node.mjs.map +1 -0
  25. package/es/account/Base.d.ts +65 -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 +25 -0
  29. package/es/account/Memory.mjs +81 -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 +79 -0
  33. package/es/account/Rpc.mjs.map +1 -0
  34. package/es/aens.d.ts +209 -0
  35. package/es/aens.mjs +332 -0
  36. package/es/aens.mjs.map +1 -0
  37. package/es/aepp-wallet-communication/connection/Browser.d.ts +32 -0
  38. package/es/aepp-wallet-communication/connection/Browser.mjs +70 -0
  39. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -0
  40. package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +17 -0
  41. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +57 -0
  42. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -0
  43. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +35 -0
  44. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +142 -0
  45. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -0
  46. package/es/aepp-wallet-communication/connection-proxy.d.ts +10 -0
  47. package/{src/utils/crypto-ts.ts → es/aepp-wallet-communication/connection-proxy.mjs} +15 -11
  48. package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -0
  49. package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +33 -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 +118 -0
  56. package/es/aepp-wallet-communication/schema.mjs +214 -0
  57. package/es/aepp-wallet-communication/schema.mjs.map +1 -0
  58. package/es/aepp-wallet-communication/wallet-detector.d.ts +24 -0
  59. package/es/aepp-wallet-communication/wallet-detector.mjs +63 -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 +1061 -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 +4164 -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 +220 -0
  92. package/es/chain.mjs +524 -0
  93. package/es/chain.mjs.map +1 -0
  94. package/es/channel/handlers.d.ts +34 -0
  95. package/es/channel/{handlers.js → handlers.mjs} +163 -130
  96. package/es/channel/handlers.mjs.map +1 -0
  97. package/es/channel/index.d.ts +634 -0
  98. package/es/channel/index.mjs +978 -0
  99. package/es/channel/index.mjs.map +1 -0
  100. package/es/channel/internal.d.ts +100 -0
  101. package/es/channel/internal.mjs +328 -0
  102. package/es/channel/internal.mjs.map +1 -0
  103. package/es/contract/Compiler.d.ts +17 -0
  104. package/es/contract/Compiler.mjs +67 -0
  105. package/es/contract/Compiler.mjs.map +1 -0
  106. package/es/contract/aci.d.ts +125 -0
  107. package/es/contract/aci.mjs +496 -0
  108. package/es/contract/aci.mjs.map +1 -0
  109. package/es/contract/ga.d.ts +68 -0
  110. package/es/contract/ga.mjs +190 -0
  111. package/es/contract/ga.mjs.map +1 -0
  112. package/es/contract/methods.d.ts +68 -0
  113. package/es/contract/methods.mjs +101 -0
  114. package/es/contract/methods.mjs.map +1 -0
  115. package/es/index.d.ts +32 -0
  116. package/es/index.mjs +49 -0
  117. package/es/index.mjs.map +1 -0
  118. package/es/oracle.d.ts +154 -0
  119. package/es/oracle.mjs +288 -0
  120. package/es/oracle.mjs.map +1 -0
  121. package/es/spend.d.ts +61 -0
  122. package/es/spend.mjs +122 -0
  123. package/es/spend.mjs.map +1 -0
  124. package/es/tx/builder/constants.d.ts +41 -0
  125. package/es/tx/builder/constants.mjs +100 -0
  126. package/es/tx/builder/constants.mjs.map +1 -0
  127. package/es/tx/builder/field-types.d.ts +62 -0
  128. package/es/tx/builder/field-types.mjs +126 -0
  129. package/es/tx/builder/field-types.mjs.map +1 -0
  130. package/es/tx/builder/helpers.d.ts +131 -0
  131. package/es/tx/builder/helpers.mjs +223 -0
  132. package/es/tx/builder/helpers.mjs.map +1 -0
  133. package/es/tx/builder/index.d.ts +75 -0
  134. package/es/tx/builder/index.mjs +424 -0
  135. package/es/tx/builder/index.mjs.map +1 -0
  136. package/es/tx/builder/schema.d.ts +350 -0
  137. package/es/tx/builder/schema.mjs +320 -0
  138. package/es/tx/builder/schema.mjs.map +1 -0
  139. package/es/tx/index.d.ts +63 -0
  140. package/es/tx/index.mjs +209 -0
  141. package/es/tx/index.mjs.map +1 -0
  142. package/es/tx/min-fee.d.ts +20 -0
  143. package/es/tx/min-fee.mjs +148 -0
  144. package/es/tx/min-fee.mjs.map +1 -0
  145. package/es/tx/validator.d.ts +19 -0
  146. package/es/tx/validator.mjs +240 -0
  147. package/es/tx/validator.mjs.map +1 -0
  148. package/es/typings/@aeternity__argon2-browser/index.d.mjs +2 -0
  149. package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +1 -0
  150. package/es/typings/@aeternity__uuid/index.d.mjs +2 -0
  151. package/es/typings/@aeternity__uuid/index.d.mjs.map +1 -0
  152. package/es/typings/bip32-path/index.d.mjs +2 -0
  153. package/es/typings/bip32-path/index.d.mjs.map +1 -0
  154. package/es/typings/blakejs/index.d.mjs +2 -0
  155. package/es/typings/blakejs/index.d.mjs.map +1 -0
  156. package/es/typings/tweetnacl-auth/index.d.mjs +2 -0
  157. package/es/typings/tweetnacl-auth/index.d.mjs.map +1 -0
  158. package/es/utils/amount-formatter.d.ts +42 -0
  159. package/es/utils/{amount-formatter.js → amount-formatter.mjs} +38 -44
  160. package/es/utils/amount-formatter.mjs.map +1 -0
  161. package/es/utils/autorest.d.ts +6 -0
  162. package/es/utils/autorest.mjs +97 -0
  163. package/es/utils/autorest.mjs.map +1 -0
  164. package/es/utils/bignumber.d.ts +13 -0
  165. package/es/utils/bignumber.mjs +23 -0
  166. package/es/utils/bignumber.mjs.map +1 -0
  167. package/es/{bytes.d.ts → utils/bytes.d.ts} +10 -13
  168. package/es/utils/{bytes.js → bytes.mjs} +26 -22
  169. package/es/utils/bytes.mjs.map +1 -0
  170. package/es/utils/crypto.d.ts +103 -0
  171. package/es/utils/crypto.mjs +221 -0
  172. package/es/utils/crypto.mjs.map +1 -0
  173. package/es/utils/encoder.d.ts +26 -0
  174. package/es/utils/encoder.mjs +102 -0
  175. package/es/utils/encoder.mjs.map +1 -0
  176. package/es/utils/errors.d.ts +481 -0
  177. package/es/utils/errors.mjs +882 -0
  178. package/es/utils/errors.mjs.map +1 -0
  179. package/es/utils/hd-wallet.d.ts +34 -0
  180. package/es/utils/hd-wallet.mjs +122 -0
  181. package/es/utils/hd-wallet.mjs.map +1 -0
  182. package/es/utils/json-big.d.ts +5 -0
  183. package/es/utils/json-big.mjs +41 -0
  184. package/es/utils/json-big.mjs.map +1 -0
  185. package/es/utils/keystore.d.ts +51 -0
  186. package/es/utils/keystore.mjs +145 -0
  187. package/es/utils/keystore.mjs.map +1 -0
  188. package/es/{mptree.d.ts → utils/mptree.d.ts} +5 -8
  189. package/es/utils/{mptree.js → mptree.mjs} +33 -25
  190. package/es/utils/mptree.mjs.map +1 -0
  191. package/es/utils/other.d.ts +14 -0
  192. package/es/utils/other.mjs +28 -0
  193. package/es/utils/other.mjs.map +1 -0
  194. package/es/{semver-satisfies.d.ts → utils/semver-satisfies.d.ts} +0 -0
  195. package/es/utils/{semver-satisfies.js → semver-satisfies.mjs} +1 -1
  196. package/es/utils/semver-satisfies.mjs.map +1 -0
  197. package/es/utils/string.d.ts +24 -0
  198. package/es/utils/{string.js → string.mjs} +9 -11
  199. package/es/utils/string.mjs.map +1 -0
  200. package/package.json +67 -64
  201. package/src/AeSdk.ts +65 -0
  202. package/src/AeSdkAepp.ts +167 -0
  203. package/src/AeSdkBase.ts +320 -0
  204. package/src/AeSdkWallet.ts +332 -0
  205. package/src/Node.ts +167 -0
  206. package/src/account/Base.ts +114 -0
  207. package/src/account/Memory.ts +83 -0
  208. package/src/account/Rpc.ts +67 -0
  209. package/src/aens.ts +391 -0
  210. package/src/aepp-wallet-communication/connection/Browser.ts +68 -0
  211. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +58 -0
  212. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +111 -0
  213. package/{es/utils/crypto-ts.js → src/aepp-wallet-communication/connection-proxy.ts} +16 -9
  214. package/src/aepp-wallet-communication/rpc/RpcClient.ts +137 -0
  215. package/src/aepp-wallet-communication/rpc/types.ts +66 -0
  216. package/src/aepp-wallet-communication/schema.ts +181 -0
  217. package/src/aepp-wallet-communication/wallet-detector.ts +71 -0
  218. package/src/apis/compiler/code-model-v4.yaml +2649 -0
  219. package/src/apis/compiler/compiler.ts +585 -0
  220. package/src/apis/compiler/index.ts +2 -0
  221. package/src/apis/compiler/models/index.ts +301 -0
  222. package/src/apis/compiler/models/mappers.ts +583 -0
  223. package/src/apis/compiler/models/parameters.ts +93 -0
  224. package/src/apis/node/code-model-v4.yaml +10046 -0
  225. package/src/apis/node/index.ts +2 -0
  226. package/src/apis/node/models/index.ts +1253 -0
  227. package/src/apis/node/models/mappers.ts +4278 -0
  228. package/src/apis/node/models/parameters.ts +188 -0
  229. package/src/apis/node/node.ts +1299 -0
  230. package/src/chain.ts +444 -0
  231. package/src/channel/{handlers.js → handlers.ts} +238 -143
  232. package/src/channel/index.ts +991 -0
  233. package/src/channel/internal.ts +345 -0
  234. package/src/contract/Compiler.ts +66 -0
  235. package/src/contract/aci.ts +529 -0
  236. package/src/contract/ga.ts +178 -0
  237. package/src/contract/methods.ts +118 -0
  238. package/src/index.ts +51 -0
  239. package/src/oracle.ts +342 -0
  240. package/src/spend.ts +152 -0
  241. package/src/tx/builder/constants.ts +96 -0
  242. package/src/tx/builder/field-types.ts +111 -0
  243. package/src/tx/builder/helpers.ts +253 -0
  244. package/src/tx/builder/index.ts +394 -0
  245. package/src/tx/builder/schema.ts +771 -0
  246. package/src/tx/index.ts +199 -0
  247. package/src/tx/min-fee.ts +136 -0
  248. package/src/tx/validator.ts +226 -0
  249. package/src/typings/@aeternity__argon2-browser/index.d.ts +3 -0
  250. package/src/typings/@aeternity__uuid/index.d.ts +3 -0
  251. package/src/typings/bip32-path/index.d.ts +33 -0
  252. package/src/typings/tweetnacl-auth/index.d.ts +14 -0
  253. package/src/utils/amount-formatter.ts +29 -41
  254. package/src/utils/autorest.ts +90 -0
  255. package/src/utils/bignumber.ts +9 -19
  256. package/src/utils/bytes.ts +15 -16
  257. package/src/utils/crypto.ts +217 -0
  258. package/src/utils/encoder.ts +98 -0
  259. package/src/utils/errors.ts +817 -0
  260. package/src/utils/hd-wallet.ts +134 -0
  261. package/src/utils/json-big.ts +26 -0
  262. package/src/utils/keystore.ts +179 -0
  263. package/src/utils/mptree.ts +26 -20
  264. package/src/utils/other.ts +28 -43
  265. package/src/utils/string.ts +8 -10
  266. package/CHANGELOG.md +0 -1603
  267. package/es/account/base.js +0 -169
  268. package/es/account/base.js.map +0 -1
  269. package/es/account/memory.js +0 -84
  270. package/es/account/memory.js.map +0 -1
  271. package/es/account/multiple.js +0 -178
  272. package/es/account/multiple.js.map +0 -1
  273. package/es/ae/aens.js +0 -408
  274. package/es/ae/aens.js.map +0 -1
  275. package/es/ae/aepp.js +0 -45
  276. package/es/ae/aepp.js.map +0 -1
  277. package/es/ae/contract.js +0 -312
  278. package/es/ae/contract.js.map +0 -1
  279. package/es/ae/index.js +0 -206
  280. package/es/ae/index.js.map +0 -1
  281. package/es/ae/oracle.js +0 -322
  282. package/es/ae/oracle.js.map +0 -1
  283. package/es/ae/universal.js +0 -45
  284. package/es/ae/universal.js.map +0 -1
  285. package/es/ae/wallet.js +0 -50
  286. package/es/ae/wallet.js.map +0 -1
  287. package/es/amount-formatter.d.ts +0 -58
  288. package/es/bignumber.d.ts +0 -24
  289. package/es/chain/index.js +0 -256
  290. package/es/chain/index.js.map +0 -1
  291. package/es/chain/node.js +0 -394
  292. package/es/chain/node.js.map +0 -1
  293. package/es/channel/handlers.js.map +0 -1
  294. package/es/channel/index.js +0 -980
  295. package/es/channel/index.js.map +0 -1
  296. package/es/channel/internal.js +0 -266
  297. package/es/channel/internal.js.map +0 -1
  298. package/es/contract/aci/helpers.js +0 -298
  299. package/es/contract/aci/helpers.js.map +0 -1
  300. package/es/contract/aci/index.js +0 -361
  301. package/es/contract/aci/index.js.map +0 -1
  302. package/es/contract/aci/transformation.js +0 -66
  303. package/es/contract/aci/transformation.js.map +0 -1
  304. package/es/contract/compiler.js +0 -244
  305. package/es/contract/compiler.js.map +0 -1
  306. package/es/contract/ga/helpers.js +0 -22
  307. package/es/contract/ga/helpers.js.map +0 -1
  308. package/es/contract/ga/index.js +0 -170
  309. package/es/contract/ga/index.js.map +0 -1
  310. package/es/contract/index.js +0 -162
  311. package/es/contract/index.js.map +0 -1
  312. package/es/crypto-ts.d.ts +0 -9
  313. package/es/index.js +0 -57
  314. package/es/index.js.map +0 -1
  315. package/es/node-pool/index.js +0 -187
  316. package/es/node-pool/index.js.map +0 -1
  317. package/es/node.js +0 -132
  318. package/es/node.js.map +0 -1
  319. package/es/other.d.ts +0 -31
  320. package/es/string.d.ts +0 -26
  321. package/es/tx/builder/helpers.js +0 -305
  322. package/es/tx/builder/helpers.js.map +0 -1
  323. package/es/tx/builder/index.js +0 -595
  324. package/es/tx/builder/index.js.map +0 -1
  325. package/es/tx/builder/schema.js +0 -814
  326. package/es/tx/builder/schema.js.map +0 -1
  327. package/es/tx/index.js +0 -300
  328. package/es/tx/index.js.map +0 -1
  329. package/es/tx/tx-object.js +0 -276
  330. package/es/tx/tx-object.js.map +0 -1
  331. package/es/tx/tx.js +0 -937
  332. package/es/tx/tx.js.map +0 -1
  333. package/es/tx/validator.js +0 -208
  334. package/es/tx/validator.js.map +0 -1
  335. package/es/typings/blakejs/index.d.js +0 -2
  336. package/es/typings/blakejs/index.d.js.map +0 -1
  337. package/es/utils/aepp-wallet-communication/connection/browser-runtime.js +0 -131
  338. package/es/utils/aepp-wallet-communication/connection/browser-runtime.js.map +0 -1
  339. package/es/utils/aepp-wallet-communication/connection/browser-window-message.js +0 -184
  340. package/es/utils/aepp-wallet-communication/connection/browser-window-message.js.map +0 -1
  341. package/es/utils/aepp-wallet-communication/connection/index.js +0 -84
  342. package/es/utils/aepp-wallet-communication/connection/index.js.map +0 -1
  343. package/es/utils/aepp-wallet-communication/content-script-bridge.js +0 -97
  344. package/es/utils/aepp-wallet-communication/content-script-bridge.js.map +0 -1
  345. package/es/utils/aepp-wallet-communication/helpers.js +0 -103
  346. package/es/utils/aepp-wallet-communication/helpers.js.map +0 -1
  347. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.js +0 -329
  348. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.js.map +0 -1
  349. package/es/utils/aepp-wallet-communication/rpc/rpc-client.js +0 -270
  350. package/es/utils/aepp-wallet-communication/rpc/rpc-client.js.map +0 -1
  351. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.js +0 -533
  352. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.js.map +0 -1
  353. package/es/utils/aepp-wallet-communication/schema.js +0 -107
  354. package/es/utils/aepp-wallet-communication/schema.js.map +0 -1
  355. package/es/utils/aepp-wallet-communication/wallet-detector.js +0 -109
  356. package/es/utils/aepp-wallet-communication/wallet-detector.js.map +0 -1
  357. package/es/utils/amount-formatter.js.map +0 -1
  358. package/es/utils/async-init.js +0 -67
  359. package/es/utils/async-init.js.map +0 -1
  360. package/es/utils/bignumber.js +0 -28
  361. package/es/utils/bignumber.js.map +0 -1
  362. package/es/utils/bytes.js.map +0 -1
  363. package/es/utils/crypto-ts.js.map +0 -1
  364. package/es/utils/crypto.js +0 -304
  365. package/es/utils/crypto.js.map +0 -1
  366. package/es/utils/hd-wallet.js +0 -112
  367. package/es/utils/hd-wallet.js.map +0 -1
  368. package/es/utils/json-big.js +0 -45
  369. package/es/utils/json-big.js.map +0 -1
  370. package/es/utils/keystore.js +0 -228
  371. package/es/utils/keystore.js.map +0 -1
  372. package/es/utils/mptree.js.map +0 -1
  373. package/es/utils/other.js +0 -43
  374. package/es/utils/other.js.map +0 -1
  375. package/es/utils/semver-satisfies.js.map +0 -1
  376. package/es/utils/string.js.map +0 -1
  377. package/es/utils/swagger.js +0 -132
  378. package/es/utils/swagger.js.map +0 -1
  379. package/src/account/base.js +0 -153
  380. package/src/account/memory.js +0 -78
  381. package/src/account/multiple.js +0 -154
  382. package/src/ae/aens.js +0 -366
  383. package/src/ae/aepp.js +0 -45
  384. package/src/ae/contract.js +0 -285
  385. package/src/ae/index.js +0 -167
  386. package/src/ae/oracle.js +0 -296
  387. package/src/ae/universal.js +0 -47
  388. package/src/ae/wallet.js +0 -50
  389. package/src/chain/index.js +0 -250
  390. package/src/chain/node.js +0 -293
  391. package/src/channel/index.js +0 -898
  392. package/src/channel/internal.js +0 -231
  393. package/src/contract/aci/index.js +0 -317
  394. package/src/contract/aci/transformation.js +0 -72
  395. package/src/contract/compiler.js +0 -195
  396. package/src/contract/ga/helpers.js +0 -17
  397. package/src/contract/ga/index.js +0 -147
  398. package/src/contract/index.js +0 -163
  399. package/src/index.js +0 -90
  400. package/src/node-pool/index.js +0 -171
  401. package/src/node.js +0 -118
  402. package/src/tx/builder/helpers.js +0 -325
  403. package/src/tx/builder/index.js +0 -460
  404. package/src/tx/builder/schema.js +0 -1211
  405. package/src/tx/index.js +0 -301
  406. package/src/tx/tx-object.js +0 -186
  407. package/src/tx/tx.js +0 -622
  408. package/src/tx/validator.js +0 -161
  409. package/src/utils/aepp-wallet-communication/connection/browser-runtime.js +0 -114
  410. package/src/utils/aepp-wallet-communication/connection/browser-window-message.js +0 -161
  411. package/src/utils/aepp-wallet-communication/connection/index.js +0 -85
  412. package/src/utils/aepp-wallet-communication/content-script-bridge.js +0 -85
  413. package/src/utils/aepp-wallet-communication/helpers.js +0 -70
  414. package/src/utils/aepp-wallet-communication/rpc/aepp-rpc.js +0 -268
  415. package/src/utils/aepp-wallet-communication/rpc/rpc-client.js +0 -223
  416. package/src/utils/aepp-wallet-communication/rpc/wallet-rpc.js +0 -390
  417. package/src/utils/aepp-wallet-communication/schema.js +0 -108
  418. package/src/utils/aepp-wallet-communication/wallet-detector.js +0 -91
  419. package/src/utils/async-init.js +0 -41
  420. package/src/utils/crypto.js +0 -312
  421. package/src/utils/hd-wallet.js +0 -115
  422. package/src/utils/json-big.js +0 -26
  423. package/src/utils/keystore.js +0 -223
  424. package/src/utils/swagger.js +0 -133
@@ -0,0 +1,142 @@
1
+ import _classPrivateFieldGet from "@babel/runtime-corejs3/helpers/classPrivateFieldGet";
2
+ import _classPrivateFieldSet from "@babel/runtime-corejs3/helpers/classPrivateFieldSet";
3
+
4
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
5
+
6
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
7
+
8
+ /*
9
+ * ISC License (ISC)
10
+ * Copyright (c) 2022 aeternity developers
11
+ *
12
+ * Permission to use, copy, modify, and/or distribute this software for any
13
+ * purpose with or without fee is hereby granted, provided that the above
14
+ * copyright notice and this permission notice appear in all copies.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
17
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18
+ * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
19
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
20
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
21
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
+ * PERFORMANCE OF THIS SOFTWARE.
23
+ */
24
+ import BrowserConnection from "./Browser.mjs";
25
+ import { MESSAGE_DIRECTION } from "../schema.mjs";
26
+ import { InternalError, RpcConnectionError } from "../../utils/errors.mjs";
27
+
28
+ var _onDisconnect = /*#__PURE__*/new WeakMap();
29
+
30
+ var _target = /*#__PURE__*/new WeakMap();
31
+
32
+ var _self = /*#__PURE__*/new WeakMap();
33
+
34
+ /**
35
+ * Browser window Post Message connector module
36
+ */
37
+ export default class BrowserWindowMessageConnection extends BrowserConnection {
38
+ /**
39
+ * @param options - Options
40
+ * @param options.target Target window for message
41
+ * @param options.self Host window for message
42
+ * @param options.origin Origin of receiver
43
+ * @param options.sendDirection Wrapping messages into additional struct
44
+ * `({ type: 'to_aepp' || 'to_waellet', data })`
45
+ * Used for handling messages between content script and page
46
+ * @param options.receiveDirection Unwrapping messages from additional struct
47
+ */
48
+ constructor() {
49
+ let {
50
+ target,
51
+ self = window,
52
+ origin,
53
+ sendDirection,
54
+ receiveDirection = MESSAGE_DIRECTION.to_aepp,
55
+ ...options
56
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
57
+ super(options);
58
+
59
+ _classPrivateFieldInitSpec(this, _onDisconnect, {
60
+ writable: true,
61
+ value: void 0
62
+ });
63
+
64
+ _classPrivateFieldInitSpec(this, _target, {
65
+ writable: true,
66
+ value: void 0
67
+ });
68
+
69
+ _classPrivateFieldInitSpec(this, _self, {
70
+ writable: true,
71
+ value: void 0
72
+ });
73
+
74
+ _classPrivateFieldSet(this, _target, target);
75
+
76
+ _classPrivateFieldSet(this, _self, self);
77
+
78
+ this.origin = origin;
79
+ this.sendDirection = sendDirection;
80
+ this.receiveDirection = receiveDirection;
81
+ }
82
+
83
+ isConnected() {
84
+ return this.listener != null;
85
+ }
86
+
87
+ connect(onMessage, onDisconnect) {
88
+ super.connect(onMessage, onDisconnect);
89
+
90
+ this.listener = message => {
91
+ if (typeof message.data !== 'object') return;
92
+ if (this.origin != null && this.origin !== message.origin) return;
93
+ if (_classPrivateFieldGet(this, _target) != null && _classPrivateFieldGet(this, _target) !== message.source) return;
94
+ this.receiveMessage(message);
95
+ let {
96
+ data
97
+ } = message;
98
+
99
+ if (data.type != null) {
100
+ if (message.data.type !== this.receiveDirection) return;
101
+ data = data.data;
102
+ }
103
+
104
+ onMessage(data, message.origin, message.source);
105
+ };
106
+
107
+ _classPrivateFieldGet(this, _self).addEventListener('message', this.listener);
108
+
109
+ _classPrivateFieldSet(this, _onDisconnect, onDisconnect);
110
+ }
111
+
112
+ disconnect() {
113
+ super.disconnect();
114
+
115
+ if (this.listener == null || _classPrivateFieldGet(this, _onDisconnect) == null) {
116
+ throw new InternalError('Expected to not happen, required for TS');
117
+ }
118
+
119
+ _classPrivateFieldGet(this, _self).removeEventListener('message', this.listener);
120
+
121
+ delete this.listener;
122
+
123
+ _classPrivateFieldGet(this, _onDisconnect).call(this);
124
+
125
+ _classPrivateFieldSet(this, _onDisconnect, undefined);
126
+ }
127
+
128
+ sendMessage(msg) {
129
+ var _this$origin;
130
+
131
+ if (_classPrivateFieldGet(this, _target) == null) throw new RpcConnectionError('Can\'t send messages without target');
132
+ const message = this.sendDirection != null ? {
133
+ type: this.sendDirection,
134
+ data: msg
135
+ } : msg;
136
+ super.sendMessage(message);
137
+
138
+ _classPrivateFieldGet(this, _target).postMessage(message, (_this$origin = this.origin) !== null && _this$origin !== void 0 ? _this$origin : '*');
139
+ }
140
+
141
+ }
142
+ //# sourceMappingURL=BrowserWindowMessage.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrowserWindowMessage.mjs","names":["BrowserConnection","MESSAGE_DIRECTION","InternalError","RpcConnectionError","BrowserWindowMessageConnection","constructor","target","self","window","origin","sendDirection","receiveDirection","to_aepp","options","isConnected","listener","connect","onMessage","onDisconnect","message","data","source","receiveMessage","type","addEventListener","disconnect","removeEventListener","undefined","sendMessage","msg","postMessage"],"sources":["../../../src/aepp-wallet-communication/connection/BrowserWindowMessage.ts"],"sourcesContent":["/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport BrowserConnection from './Browser'\nimport { MESSAGE_DIRECTION } from '../schema'\nimport { InternalError, RpcConnectionError } from '../../utils/errors'\n\nexport type ImplPostMessage = Pick<Window, 'addEventListener' | 'removeEventListener' | 'postMessage'>\n\n/**\n * Browser window Post Message connector module\n */\nexport default class BrowserWindowMessageConnection extends BrowserConnection {\n origin?: string\n sendDirection?: MESSAGE_DIRECTION\n receiveDirection: MESSAGE_DIRECTION\n listener?: (this: Window, ev: MessageEvent<any>) => void\n #onDisconnect?: () => void\n #target?: ImplPostMessage\n #self: ImplPostMessage\n\n /**\n * @param options - Options\n * @param options.target Target window for message\n * @param options.self Host window for message\n * @param options.origin Origin of receiver\n * @param options.sendDirection Wrapping messages into additional struct\n * `({ type: 'to_aepp' || 'to_waellet', data })`\n * Used for handling messages between content script and page\n * @param options.receiveDirection Unwrapping messages from additional struct\n */\n constructor ({\n target,\n self = window,\n origin,\n sendDirection,\n receiveDirection = MESSAGE_DIRECTION.to_aepp,\n ...options\n }: {\n target?: ImplPostMessage\n self?: ImplPostMessage\n origin?: string\n sendDirection?: MESSAGE_DIRECTION\n receiveDirection?: MESSAGE_DIRECTION\n debug?: boolean\n } = {}) {\n super(options)\n this.#target = target\n this.#self = self\n this.origin = origin\n this.sendDirection = sendDirection\n this.receiveDirection = receiveDirection\n }\n\n isConnected (): boolean {\n return this.listener != null\n }\n\n connect (\n onMessage: (message: any, origin: string, source: MessageEventSource | null) => void,\n onDisconnect: () => void\n ): void {\n super.connect(onMessage, onDisconnect)\n this.listener = (message: MessageEvent<any>) => {\n if (typeof message.data !== 'object') return\n if (this.origin != null && this.origin !== message.origin) return\n if (this.#target != null && this.#target !== message.source) return\n this.receiveMessage(message)\n let { data } = message\n if (data.type != null) {\n if (message.data.type !== this.receiveDirection) return\n data = data.data\n }\n onMessage(data, message.origin, message.source)\n }\n this.#self.addEventListener('message', this.listener)\n this.#onDisconnect = onDisconnect\n }\n\n disconnect (): void {\n super.disconnect()\n if (this.listener == null || this.#onDisconnect == null) {\n throw new InternalError('Expected to not happen, required for TS')\n }\n this.#self.removeEventListener('message', this.listener)\n delete this.listener\n this.#onDisconnect()\n this.#onDisconnect = undefined\n }\n\n sendMessage (msg: any): void {\n if (this.#target == null) throw new RpcConnectionError('Can\\'t send messages without target')\n const message = this.sendDirection != null ? { type: this.sendDirection, data: msg } : msg\n super.sendMessage(message)\n this.#target.postMessage(message, this.origin ?? '*')\n }\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;OAEOA,iB;SACEC,iB;SACAC,a,EAAeC,kB;;;;;;;;AAIxB;AACA;AACA;AACA,eAAe,MAAMC,8BAAN,SAA6CJ,iBAA7C,CAA+D;EAS5E;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,WAAW,GAcH;IAAA,IAdK;MACXC,MADW;MAEXC,IAAI,GAAGC,MAFI;MAGXC,MAHW;MAIXC,aAJW;MAKXC,gBAAgB,GAAGV,iBAAiB,CAACW,OAL1B;MAMX,GAAGC;IANQ,CAcL,uEAAJ,EAAI;IACN,MAAMA,OAAN;;IADM;MAAA;MAAA;IAAA;;IAAA;MAAA;MAAA;IAAA;;IAAA;MAAA;MAAA;IAAA;;IAEN,qCAAeP,MAAf;;IACA,mCAAaC,IAAb;;IACA,KAAKE,MAAL,GAAcA,MAAd;IACA,KAAKC,aAAL,GAAqBA,aAArB;IACA,KAAKC,gBAAL,GAAwBA,gBAAxB;EACD;;EAEDG,WAAW,GAAa;IACtB,OAAO,KAAKC,QAAL,IAAiB,IAAxB;EACD;;EAEDC,OAAO,CACLC,SADK,EAELC,YAFK,EAGC;IACN,MAAMF,OAAN,CAAcC,SAAd,EAAyBC,YAAzB;;IACA,KAAKH,QAAL,GAAiBI,OAAD,IAAgC;MAC9C,IAAI,OAAOA,OAAO,CAACC,IAAf,KAAwB,QAA5B,EAAsC;MACtC,IAAI,KAAKX,MAAL,IAAe,IAAf,IAAuB,KAAKA,MAAL,KAAgBU,OAAO,CAACV,MAAnD,EAA2D;MAC3D,IAAI,wCAAgB,IAAhB,IAAwB,yCAAiBU,OAAO,CAACE,MAArD,EAA6D;MAC7D,KAAKC,cAAL,CAAoBH,OAApB;MACA,IAAI;QAAEC;MAAF,IAAWD,OAAf;;MACA,IAAIC,IAAI,CAACG,IAAL,IAAa,IAAjB,EAAuB;QACrB,IAAIJ,OAAO,CAACC,IAAR,CAAaG,IAAb,KAAsB,KAAKZ,gBAA/B,EAAiD;QACjDS,IAAI,GAAGA,IAAI,CAACA,IAAZ;MACD;;MACDH,SAAS,CAACG,IAAD,EAAOD,OAAO,CAACV,MAAf,EAAuBU,OAAO,CAACE,MAA/B,CAAT;IACD,CAXD;;IAYA,mCAAWG,gBAAX,CAA4B,SAA5B,EAAuC,KAAKT,QAA5C;;IACA,2CAAqBG,YAArB;EACD;;EAEDO,UAAU,GAAU;IAClB,MAAMA,UAAN;;IACA,IAAI,KAAKV,QAAL,IAAiB,IAAjB,IAAyB,8CAAsB,IAAnD,EAAyD;MACvD,MAAM,IAAIb,aAAJ,CAAkB,yCAAlB,CAAN;IACD;;IACD,mCAAWwB,mBAAX,CAA+B,SAA/B,EAA0C,KAAKX,QAA/C;;IACA,OAAO,KAAKA,QAAZ;;IACA;;IACA,2CAAqBY,SAArB;EACD;;EAEDC,WAAW,CAAEC,GAAF,EAAkB;IAAA;;IAC3B,IAAI,wCAAgB,IAApB,EAA0B,MAAM,IAAI1B,kBAAJ,CAAuB,qCAAvB,CAAN;IAC1B,MAAMgB,OAAO,GAAG,KAAKT,aAAL,IAAsB,IAAtB,GAA6B;MAAEa,IAAI,EAAE,KAAKb,aAAb;MAA4BU,IAAI,EAAES;IAAlC,CAA7B,GAAuEA,GAAvF;IACA,MAAMD,WAAN,CAAkBT,OAAlB;;IACA,qCAAaW,WAAb,CAAyBX,OAAzB,kBAAkC,KAAKV,MAAvC,uDAAiD,GAAjD;EACD;;AAnF2E"}
@@ -0,0 +1,10 @@
1
+ import BrowserConnection from './connection/Browser';
2
+ /**
3
+ * Browser connection proxy
4
+ * Provide functionality to easily forward messages from one connection to another and back
5
+ * @param con1 - first connection
6
+ * @param con2 - second connection
7
+ * @returns a function to stop proxying
8
+ */
9
+ declare const _default: (con1: BrowserConnection, con2: BrowserConnection) => () => void;
10
+ export default _default;
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * ISC License (ISC)
3
- * Copyright 2021 aeternity developers
3
+ * Copyright (c) 2022 aeternity developers
4
4
  *
5
5
  * Permission to use, copy, modify, and/or distribute this software for any
6
6
  * purpose with or without fee is hereby granted, provided that the above
@@ -15,15 +15,19 @@
15
15
  * PERFORMANCE OF THIS SOFTWARE.
16
16
  */
17
17
 
18
- import { blake2b } from 'blakejs'
19
- import type { Data } from 'blakejs'
20
-
21
18
  /**
22
- * Calculate 256bits Blake2b hash of `input`
23
- * @rtype (input: String) => hash: String
24
- * @param {Data} input - Data to hash
25
- * @return {Buffer} Hash
19
+ * Browser connection proxy
20
+ * Provide functionality to easily forward messages from one connection to another and back
21
+ * @param con1 - first connection
22
+ * @param con2 - second connection
23
+ * @returns a function to stop proxying
26
24
  */
27
- export function hash (input: Data): Buffer {
28
- return Buffer.from(blake2b(input, null, 32)) // 256 bits
29
- }
25
+ export default ((con1, con2) => {
26
+ con1.connect(msg => con2.sendMessage(msg), () => con2.disconnect());
27
+ con2.connect(msg => con1.sendMessage(msg), () => con1.disconnect());
28
+ return () => {
29
+ con1.disconnect();
30
+ con2.disconnect();
31
+ };
32
+ });
33
+ //# sourceMappingURL=connection-proxy.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-proxy.mjs","names":["con1","con2","connect","msg","sendMessage","disconnect"],"sources":["../../src/aepp-wallet-communication/connection-proxy.ts"],"sourcesContent":["/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport BrowserConnection from './connection/Browser'\n\n/**\n * Browser connection proxy\n * Provide functionality to easily forward messages from one connection to another and back\n * @param con1 - first connection\n * @param con2 - second connection\n * @returns a function to stop proxying\n */\nexport default (con1: BrowserConnection, con2: BrowserConnection): () => void => {\n con1.connect((msg: any) => con2.sendMessage(msg), () => con2.disconnect())\n con2.connect((msg: any) => con1.sendMessage(msg), () => con1.disconnect())\n\n return () => {\n con1.disconnect()\n con2.disconnect()\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,CAACA,IAAD,EAA0BC,IAA1B,KAAkE;EAC/ED,IAAI,CAACE,OAAL,CAAcC,GAAD,IAAcF,IAAI,CAACG,WAAL,CAAiBD,GAAjB,CAA3B,EAAkD,MAAMF,IAAI,CAACI,UAAL,EAAxD;EACAJ,IAAI,CAACC,OAAL,CAAcC,GAAD,IAAcH,IAAI,CAACI,WAAL,CAAiBD,GAAjB,CAA3B,EAAkD,MAAMH,IAAI,CAACK,UAAL,EAAxD;EAEA,OAAO,MAAM;IACXL,IAAI,CAACK,UAAL;IACAJ,IAAI,CAACI,UAAL;EACD,CAHD;AAID,CARD"}
@@ -0,0 +1,33 @@
1
+ import BrowserConnection from '../connection/Browser';
2
+ declare type RpcApiHandler = (p?: any) => any | undefined;
3
+ declare type RpcApi<Api> = {
4
+ [k in keyof Api]: RpcApiHandler;
5
+ };
6
+ declare type WithOrigin<Api extends RpcApi<Api>> = {
7
+ [k in keyof Api]: (p: Parameters<Api[k]>[0], origin: string) => ReturnType<Api[k]>;
8
+ };
9
+ /**
10
+ * Contain functionality for using RPC conection
11
+ * @param connection - Connection object
12
+ * @param onDisconnect - Disconnect callback
13
+ * @param methods - Object containing handlers for each request by name
14
+ */
15
+ export default class RpcClient<RemoteApi extends RpcApi<RemoteApi>, LocalApi extends RpcApi<LocalApi>> {
16
+ #private;
17
+ connection: BrowserConnection;
18
+ constructor(connection: BrowserConnection, onDisconnect: () => void, methods: WithOrigin<LocalApi>);
19
+ /**
20
+ * Make a request
21
+ * @param name - Method name
22
+ * @param params - Method params
23
+ * @returns Promise which will be resolved after receiving response message
24
+ */
25
+ request<Name extends keyof RemoteApi>(name: Name, params: Parameters<RemoteApi[Name]>[0]): Promise<ReturnType<RemoteApi[Name]>>;
26
+ /**
27
+ * Make a notification
28
+ * @param name - Method name
29
+ * @param params - Method params
30
+ */
31
+ notify<Name extends keyof RemoteApi>(name: Name, params: Parameters<RemoteApi[Name]>[0]): void;
32
+ }
33
+ export {};
@@ -0,0 +1,169 @@
1
+ import _classPrivateFieldGet from "@babel/runtime-corejs3/helpers/classPrivateFieldGet";
2
+ import _classPrivateFieldSet from "@babel/runtime-corejs3/helpers/classPrivateFieldSet";
3
+
4
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
5
+
6
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
7
+
8
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
9
+
10
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
11
+
12
+ import { RpcError, RpcInternalError, RpcMethodNotFoundError } from "../schema.mjs";
13
+ import { InvalidRpcMessageError, MissingCallbackError } from "../../utils/errors.mjs";
14
+
15
+ var _callbacks = /*#__PURE__*/new WeakMap();
16
+
17
+ var _messageId = /*#__PURE__*/new WeakMap();
18
+
19
+ var _methods = /*#__PURE__*/new WeakMap();
20
+
21
+ var _handleMessage = /*#__PURE__*/new WeakSet();
22
+
23
+ var _sendRequest = /*#__PURE__*/new WeakSet();
24
+
25
+ var _sendResponse = /*#__PURE__*/new WeakSet();
26
+
27
+ var _processResponse = /*#__PURE__*/new WeakSet();
28
+
29
+ /**
30
+ * Contain functionality for using RPC conection
31
+ * @param connection - Connection object
32
+ * @param onDisconnect - Disconnect callback
33
+ * @param methods - Object containing handlers for each request by name
34
+ */
35
+ export default class RpcClient {
36
+ constructor(connection, onDisconnect, methods) {
37
+ _classPrivateMethodInitSpec(this, _processResponse);
38
+
39
+ _classPrivateMethodInitSpec(this, _sendResponse);
40
+
41
+ _classPrivateMethodInitSpec(this, _sendRequest);
42
+
43
+ _classPrivateMethodInitSpec(this, _handleMessage);
44
+
45
+ _classPrivateFieldInitSpec(this, _callbacks, {
46
+ writable: true,
47
+ value: new Map()
48
+ });
49
+
50
+ _classPrivateFieldInitSpec(this, _messageId, {
51
+ writable: true,
52
+ value: 0
53
+ });
54
+
55
+ _classPrivateFieldInitSpec(this, _methods, {
56
+ writable: true,
57
+ value: void 0
58
+ });
59
+
60
+ this.connection = connection;
61
+
62
+ _classPrivateFieldSet(this, _methods, methods);
63
+
64
+ connection.connect(_classPrivateMethodGet(this, _handleMessage, _handleMessage2).bind(this), onDisconnect);
65
+ }
66
+
67
+ /**
68
+ * Make a request
69
+ * @param name - Method name
70
+ * @param params - Method params
71
+ * @returns Promise which will be resolved after receiving response message
72
+ */
73
+ async request(name, params) {
74
+ var _this$messageId;
75
+
76
+ _classPrivateMethodGet(this, _sendRequest, _sendRequest2).call(this, _classPrivateFieldSet(this, _messageId, (_this$messageId = _classPrivateFieldGet(this, _messageId), ++_this$messageId)), name, params);
77
+
78
+ return await new Promise((resolve, reject) => {
79
+ _classPrivateFieldGet(this, _callbacks).set(_classPrivateFieldGet(this, _messageId), {
80
+ resolve,
81
+ reject
82
+ });
83
+ });
84
+ }
85
+ /**
86
+ * Make a notification
87
+ * @param name - Method name
88
+ * @param params - Method params
89
+ */
90
+
91
+
92
+ notify(name, params) {
93
+ _classPrivateMethodGet(this, _sendRequest, _sendRequest2).call(this, undefined, name, params);
94
+ }
95
+ /**
96
+ * Process response message
97
+ * @param msg - Message object
98
+ */
99
+
100
+
101
+ }
102
+
103
+ async function _handleMessage2(msg, origin) {
104
+ if ((msg === null || msg === void 0 ? void 0 : msg.jsonrpc) !== '2.0') throw new InvalidRpcMessageError(JSON.stringify(msg));
105
+
106
+ if ('result' in msg || 'error' in msg) {
107
+ _classPrivateMethodGet(this, _processResponse, _processResponse2).call(this, msg);
108
+
109
+ return;
110
+ }
111
+
112
+ const request = msg;
113
+ let result, error;
114
+
115
+ try {
116
+ if (!(request.method in _classPrivateFieldGet(this, _methods))) throw new RpcMethodNotFoundError();
117
+ const methodName = request.method;
118
+ result = await _classPrivateFieldGet(this, _methods)[methodName](request.params, origin);
119
+ } catch (e) {
120
+ error = e instanceof RpcError ? e : new RpcInternalError();
121
+ }
122
+
123
+ if (request.id != null) {
124
+ _classPrivateMethodGet(this, _sendResponse, _sendResponse2).call(this, request.id, request.method, result, error);
125
+ }
126
+ }
127
+
128
+ function _sendRequest2(id, method, params) {
129
+ this.connection.sendMessage({
130
+ jsonrpc: '2.0',
131
+ ...(id != null ? {
132
+ id
133
+ } : {}),
134
+ method,
135
+ ...(params != null ? {
136
+ params
137
+ } : {})
138
+ });
139
+ }
140
+
141
+ function _sendResponse2(id, method, // TODO: remove as far it is not required in JSON RPC
142
+ result, error) {
143
+ this.connection.sendMessage({
144
+ jsonrpc: '2.0',
145
+ id,
146
+ method,
147
+ ...(error != null ? {
148
+ error
149
+ } : {
150
+ result
151
+ })
152
+ });
153
+ }
154
+
155
+ function _processResponse2(_ref) {
156
+ let {
157
+ id,
158
+ error,
159
+ result
160
+ } = _ref;
161
+
162
+ const callbacks = _classPrivateFieldGet(this, _callbacks).get(id);
163
+
164
+ if (callbacks == null) throw new MissingCallbackError(id);
165
+ if (error != null) callbacks.reject(RpcError.deserialize(error));else callbacks.resolve(result);
166
+
167
+ _classPrivateFieldGet(this, _callbacks).delete(id);
168
+ }
169
+ //# sourceMappingURL=RpcClient.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RpcClient.mjs","names":["RpcError","RpcInternalError","RpcMethodNotFoundError","InvalidRpcMessageError","MissingCallbackError","RpcClient","constructor","connection","onDisconnect","methods","Map","connect","bind","request","name","params","Promise","resolve","reject","set","notify","undefined","msg","origin","jsonrpc","JSON","stringify","result","error","method","methodName","e","id","sendMessage","callbacks","get","deserialize","delete"],"sources":["../../../src/aepp-wallet-communication/rpc/RpcClient.ts"],"sourcesContent":["import { RpcError, RpcInternalError, RpcMethodNotFoundError } from '../schema'\nimport BrowserConnection from '../connection/Browser'\nimport { InvalidRpcMessageError, MissingCallbackError } from '../../utils/errors'\n\ninterface JsonRpcRequest {\n jsonrpc: '2.0'\n id: number\n method: string\n params?: any\n}\n\ninterface JsonRpcResponse {\n jsonrpc: '2.0'\n id: number\n method: string\n result?: any\n error?: {\n code: number\n message: string\n data?: any\n }\n}\n\ntype RpcApiHandler = (p?: any) => any | undefined\ntype RpcApi<Api> = { [k in keyof Api]: RpcApiHandler }\ntype WithOrigin<Api extends RpcApi<Api>> = {\n [k in keyof Api]: (p: Parameters<Api[k]>[0], origin: string) => ReturnType<Api[k]>\n}\n\n/**\n * Contain functionality for using RPC conection\n * @param connection - Connection object\n * @param onDisconnect - Disconnect callback\n * @param methods - Object containing handlers for each request by name\n */\nexport default class RpcClient <\n RemoteApi extends RpcApi<RemoteApi>, LocalApi extends RpcApi<LocalApi>\n> {\n connection: BrowserConnection\n #callbacks = new Map<number, { resolve: (v: any) => void, reject: (e: Error) => void }>()\n #messageId = 0\n #methods: WithOrigin<LocalApi>\n\n constructor (\n connection: BrowserConnection,\n onDisconnect: () => void,\n methods: WithOrigin<LocalApi>\n ) {\n this.connection = connection\n this.#methods = methods\n connection.connect(this.#handleMessage.bind(this), onDisconnect)\n }\n\n async #handleMessage (msg: JsonRpcRequest | JsonRpcResponse, origin: string): Promise<void> {\n if (msg?.jsonrpc !== '2.0') throw new InvalidRpcMessageError(JSON.stringify(msg))\n if ('result' in msg || 'error' in msg) {\n this.#processResponse(msg)\n return\n }\n\n const request = msg as JsonRpcRequest\n let result, error\n try {\n if (!(request.method in this.#methods)) throw new RpcMethodNotFoundError()\n const methodName = request.method as keyof LocalApi\n result = await this.#methods[methodName](request.params, origin)\n } catch (e) {\n error = e instanceof RpcError ? e : new RpcInternalError()\n }\n if (request.id != null) {\n this.#sendResponse(request.id, request.method as keyof LocalApi, result, error)\n }\n }\n\n #sendRequest (\n id: number | undefined,\n method: keyof RemoteApi | keyof LocalApi,\n params?: any\n ): void {\n this.connection.sendMessage({\n jsonrpc: '2.0',\n ...id != null ? { id } : {},\n method,\n ...params != null ? { params } : {}\n })\n }\n\n #sendResponse (\n id: number,\n method: keyof RemoteApi | keyof LocalApi, // TODO: remove as far it is not required in JSON RPC\n result?: any,\n error?: any\n ): void {\n this.connection.sendMessage({\n jsonrpc: '2.0',\n id,\n method,\n ...error != null ? { error } : { result }\n })\n }\n\n /**\n * Make a request\n * @param name - Method name\n * @param params - Method params\n * @returns Promise which will be resolved after receiving response message\n */\n async request<Name extends keyof RemoteApi> (\n name: Name, params: Parameters<RemoteApi[Name]>[0]\n ): Promise<ReturnType<RemoteApi[Name]>> {\n this.#sendRequest(++this.#messageId, name, params)\n return await new Promise((resolve, reject) => {\n this.#callbacks.set(this.#messageId, { resolve, reject })\n })\n }\n\n /**\n * Make a notification\n * @param name - Method name\n * @param params - Method params\n */\n notify<Name extends keyof RemoteApi> (name: Name, params: Parameters<RemoteApi[Name]>[0]): void {\n this.#sendRequest(undefined, name, params)\n }\n\n /**\n * Process response message\n * @param msg - Message object\n */\n #processResponse ({ id, error, result }: { id: number, error?: any, result?: any }): void {\n const callbacks = this.#callbacks.get(id)\n if (callbacks == null) throw new MissingCallbackError(id)\n if (error != null) callbacks.reject(RpcError.deserialize(error))\n else callbacks.resolve(result)\n this.#callbacks.delete(id)\n }\n}\n"],"mappings":"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"}
@@ -0,0 +1,77 @@
1
+ import { send } from '../../spend';
2
+ import { EncodedData } from '../../utils/encoder';
3
+ import { METHODS, SUBSCRIPTION_TYPES, WALLET_TYPE } from '../schema';
4
+ export interface WalletInfo {
5
+ id: string;
6
+ name: string;
7
+ networkId: string;
8
+ origin: string;
9
+ type: WALLET_TYPE;
10
+ }
11
+ export interface Accounts {
12
+ connected: {
13
+ [pub: EncodedData<'ak'>]: {};
14
+ };
15
+ current: {
16
+ [pub: EncodedData<'ak'>]: {};
17
+ };
18
+ }
19
+ export interface Node {
20
+ name: string;
21
+ url: string;
22
+ }
23
+ export interface Network {
24
+ networkId: string;
25
+ node?: Node;
26
+ }
27
+ declare type Icons = Array<{
28
+ src: string;
29
+ sizes?: string;
30
+ type?: string;
31
+ purpose?: string;
32
+ }>;
33
+ export declare const RPC_VERSION = 1;
34
+ export interface WalletApi {
35
+ [METHODS.connect]: (p: {
36
+ name: string;
37
+ icons?: Icons;
38
+ version: typeof RPC_VERSION;
39
+ connectNode: boolean;
40
+ }) => Promise<WalletInfo & {
41
+ node?: Node;
42
+ }>;
43
+ [METHODS.closeConnection]: (p: any) => void;
44
+ [METHODS.subscribeAddress]: (p: {
45
+ type: SUBSCRIPTION_TYPES;
46
+ value: 'connected' | 'current';
47
+ }) => Promise<{
48
+ subscription: Array<'connected' | 'current'>;
49
+ address: Accounts;
50
+ }>;
51
+ [METHODS.address]: () => Promise<Array<EncodedData<'ak'>>>;
52
+ [METHODS.sign]: ((p: {
53
+ tx: EncodedData<'tx'>;
54
+ onAccount: EncodedData<'ak'>;
55
+ returnSigned: boolean;
56
+ }) => Promise<{
57
+ /**
58
+ * @deprecated this is not a hash at all, will be removed later at the same time
59
+ * as dropping ability to broadcast transaction by wallet
60
+ */
61
+ transactionHash?: Awaited<ReturnType<typeof send>>;
62
+ signedTransaction?: EncodedData<'tx'>;
63
+ }>);
64
+ [METHODS.signMessage]: (p: {
65
+ message: string;
66
+ onAccount: EncodedData<'ak'>;
67
+ }) => Promise<{
68
+ signature: string;
69
+ }>;
70
+ }
71
+ export interface AeppApi {
72
+ [METHODS.updateAddress]: (a: Accounts) => void;
73
+ [METHODS.updateNetwork]: (a: Network) => void;
74
+ [METHODS.readyToConnect]: (w: WalletInfo) => void;
75
+ [METHODS.closeConnection]: (p: any) => void;
76
+ }
77
+ export {};
@@ -0,0 +1,3 @@
1
+ import { METHODS } from "../schema.mjs";
2
+ export const RPC_VERSION = 1;
3
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","names":["METHODS","RPC_VERSION"],"sources":["../../../src/aepp-wallet-communication/rpc/types.ts"],"sourcesContent":["import { send } from '../../spend'\nimport { EncodedData } from '../../utils/encoder'\nimport { METHODS, SUBSCRIPTION_TYPES, WALLET_TYPE } from '../schema'\n\nexport interface WalletInfo {\n id: string\n name: string\n networkId: string\n origin: string\n type: WALLET_TYPE\n}\n\nexport interface Accounts {\n connected: { [pub: EncodedData<'ak'>]: {} }\n current: { [pub: EncodedData<'ak'>]: {} }\n}\n\nexport interface Node {\n name: string\n url: string\n}\n\nexport interface Network {\n networkId: string\n node?: Node\n}\n\ntype Icons = Array<{ src: string, sizes?: string, type?: string, purpose?: string }>\n\nexport const RPC_VERSION = 1\n\nexport interface WalletApi {\n [METHODS.connect]: (\n p: { name: string, icons?: Icons, version: typeof RPC_VERSION, connectNode: boolean }\n ) => Promise<WalletInfo & { node?: Node }>\n\n [METHODS.closeConnection]: (p: any) => void\n\n [METHODS.subscribeAddress]: (\n p: { type: SUBSCRIPTION_TYPES, value: 'connected' | 'current' }\n ) => Promise<{ subscription: Array<'connected' | 'current'>, address: Accounts }>\n\n [METHODS.address]: () => Promise<Array<EncodedData<'ak'>>>\n\n [METHODS.sign]: ((\n p: { tx: EncodedData<'tx'>, onAccount: EncodedData<'ak'>, returnSigned: boolean }\n ) => Promise<{\n /**\n * @deprecated this is not a hash at all, will be removed later at the same time\n * as dropping ability to broadcast transaction by wallet\n */\n transactionHash?: Awaited<ReturnType<typeof send>>\n signedTransaction?: EncodedData<'tx'>\n }>)\n\n [METHODS.signMessage]: (\n p: { message: string, onAccount: EncodedData<'ak'> }\n ) => Promise<{ signature: string }>\n}\n\nexport interface AeppApi {\n [METHODS.updateAddress]: (a: Accounts) => void\n [METHODS.updateNetwork]: (a: Network) => void\n [METHODS.readyToConnect]: (w: WalletInfo) => void\n [METHODS.closeConnection]: (p: any) => void\n}\n"],"mappings":"SAESA,O;AA2BT,OAAO,MAAMC,WAAW,GAAG,CAApB"}
@@ -0,0 +1,118 @@
1
+ import { EncodedData } from '../utils/encoder';
2
+ import { BaseError } from '../utils/errors';
3
+ export declare const enum MESSAGE_DIRECTION {
4
+ to_waellet = "to_waellet",
5
+ to_aepp = "to_aepp"
6
+ }
7
+ export declare const enum WALLET_TYPE {
8
+ window = "window",
9
+ extension = "extension"
10
+ }
11
+ export declare const enum SUBSCRIPTION_TYPES {
12
+ subscribe = "subscribe",
13
+ unsubscribe = "unsubscribe"
14
+ }
15
+ export declare const enum METHODS {
16
+ readyToConnect = "connection.announcePresence",
17
+ updateAddress = "address.update",
18
+ address = "address.get",
19
+ connect = "connection.open",
20
+ sign = "transaction.sign",
21
+ signMessage = "message.sign",
22
+ subscribeAddress = "address.subscribe",
23
+ updateNetwork = "networkId.update",
24
+ closeConnection = "connection.close"
25
+ }
26
+ export declare const enum RPC_STATUS {
27
+ CONNECTED = "CONNECTED",
28
+ DISCONNECTED = "DISCONNECTED",
29
+ WAITING_FOR_CONNECTION_REQUEST = "WAITING_FOR_CONNECTION_REQUEST"
30
+ }
31
+ interface RpcErrorAsJson {
32
+ code: number;
33
+ message: string;
34
+ data?: any;
35
+ }
36
+ /**
37
+ * @category exception
38
+ */
39
+ export declare abstract class RpcError extends BaseError {
40
+ static code: number;
41
+ code: number;
42
+ data?: any;
43
+ toJSON(): RpcErrorAsJson;
44
+ static deserialize(json: RpcErrorAsJson): RpcError;
45
+ }
46
+ /**
47
+ * @category exception
48
+ */
49
+ export declare class RpcInvalidTransactionError extends RpcError {
50
+ static code: number;
51
+ code: number;
52
+ constructor(data?: any);
53
+ }
54
+ /**
55
+ * @category exception
56
+ */
57
+ export declare class RpcBroadcastError extends RpcError {
58
+ static code: number;
59
+ code: number;
60
+ constructor(data?: any);
61
+ }
62
+ /**
63
+ * @category exception
64
+ */
65
+ export declare class RpcRejectedByUserError extends RpcError {
66
+ static code: number;
67
+ code: number;
68
+ constructor(data?: any);
69
+ }
70
+ /**
71
+ * @category exception
72
+ */
73
+ export declare class RpcUnsupportedProtocolError extends RpcError {
74
+ static code: number;
75
+ code: number;
76
+ constructor();
77
+ }
78
+ /**
79
+ * @category exception
80
+ */
81
+ export declare class RpcConnectionDenyError extends RpcError {
82
+ static code: number;
83
+ code: number;
84
+ constructor(data?: any);
85
+ }
86
+ /**
87
+ * @category exception
88
+ */
89
+ export declare class RpcNotAuthorizeError extends RpcError {
90
+ static code: number;
91
+ code: number;
92
+ constructor();
93
+ }
94
+ /**
95
+ * @category exception
96
+ */
97
+ export declare class RpcPermissionDenyError extends RpcError {
98
+ static code: number;
99
+ code: number;
100
+ constructor(address: EncodedData<'ak'>);
101
+ }
102
+ /**
103
+ * @category exception
104
+ */
105
+ export declare class RpcInternalError extends RpcError {
106
+ static code: number;
107
+ code: number;
108
+ constructor();
109
+ }
110
+ /**
111
+ * @category exception
112
+ */
113
+ export declare class RpcMethodNotFoundError extends RpcError {
114
+ static code: number;
115
+ code: number;
116
+ constructor();
117
+ }
118
+ export {};