@aeternity/aepp-sdk 13.2.1 → 13.3.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 (509) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/bin/aesophia_cli +0 -0
  4. package/bin/aesophia_cli_8 +0 -0
  5. package/dist/aepp-sdk.browser-script.js +1 -1
  6. package/dist/aepp-sdk.browser-script.js.map +1 -1
  7. package/dist/aepp-sdk.browser.js +1 -1
  8. package/dist/aepp-sdk.browser.js.map +1 -1
  9. package/dist/aepp-sdk.js +7288 -9464
  10. package/dist/aepp-sdk.js.map +1 -1
  11. package/es/AeSdk.d.ts +3 -0
  12. package/es/AeSdk.mjs +12 -12
  13. package/es/AeSdk.mjs.map +1 -1
  14. package/es/AeSdkAepp.d.ts +0 -1
  15. package/es/AeSdkAepp.mjs +12 -16
  16. package/es/AeSdkAepp.mjs.map +1 -1
  17. package/es/AeSdkBase.d.ts +61 -6
  18. package/es/AeSdkBase.mjs +150 -69
  19. package/es/AeSdkBase.mjs.map +1 -1
  20. package/es/AeSdkMethods.d.ts +19 -7
  21. package/es/AeSdkMethods.mjs +39 -38
  22. package/es/AeSdkMethods.mjs.map +1 -1
  23. package/es/AeSdkWallet.mjs +86 -55
  24. package/es/AeSdkWallet.mjs.map +1 -1
  25. package/es/Middleware.d.ts +1 -1
  26. package/es/Middleware.mjs +32 -28
  27. package/es/Middleware.mjs.map +1 -1
  28. package/es/MiddlewareSubscriber.mjs +5 -14
  29. package/es/MiddlewareSubscriber.mjs.map +1 -1
  30. package/es/Node.d.ts +11 -3
  31. package/es/Node.mjs +65 -57
  32. package/es/Node.mjs.map +1 -1
  33. package/es/account/Base.d.ts +39 -3
  34. package/es/account/Base.mjs +35 -1
  35. package/es/account/Base.mjs.map +1 -1
  36. package/es/account/Generalized.d.ts +2 -0
  37. package/es/account/Generalized.mjs +15 -6
  38. package/es/account/Generalized.mjs.map +1 -1
  39. package/es/account/Ledger.d.ts +2 -0
  40. package/es/account/Ledger.mjs +14 -5
  41. package/es/account/Ledger.mjs.map +1 -1
  42. package/es/account/LedgerFactory.mjs +4 -6
  43. package/es/account/LedgerFactory.mjs.map +1 -1
  44. package/es/account/Memory.d.ts +15 -4
  45. package/es/account/Memory.mjs +96 -31
  46. package/es/account/Memory.mjs.map +1 -1
  47. package/es/account/Rpc.d.ts +16 -5
  48. package/es/account/Rpc.mjs +94 -21
  49. package/es/account/Rpc.mjs.map +1 -1
  50. package/es/aens.d.ts +17 -44
  51. package/es/aens.mjs +32 -71
  52. package/es/aens.mjs.map +1 -1
  53. package/es/aepp-wallet-communication/connection/Browser.mjs +3 -4
  54. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
  55. package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +3 -0
  56. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +7 -5
  57. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
  58. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +8 -9
  59. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
  60. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +7 -7
  61. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
  62. package/es/aepp-wallet-communication/rpc/types.d.ts +14 -0
  63. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
  64. package/es/aepp-wallet-communication/schema.d.ts +2 -0
  65. package/es/aepp-wallet-communication/schema.mjs +2 -0
  66. package/es/aepp-wallet-communication/schema.mjs.map +1 -1
  67. package/es/aepp-wallet-communication/wallet-detector.d.ts +2 -5
  68. package/es/aepp-wallet-communication/wallet-detector.mjs +13 -9
  69. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
  70. package/es/apis/compiler/compiler.mjs.map +1 -1
  71. package/es/apis/compiler/models/index.d.ts +1 -0
  72. package/es/apis/compiler/models/index.mjs.map +1 -1
  73. package/es/apis/compiler/models/mappers.mjs +13 -0
  74. package/es/apis/compiler/models/mappers.mjs.map +1 -1
  75. package/es/apis/compiler/models/parameters.mjs.map +1 -1
  76. package/es/apis/middleware/middleware.d.ts +23 -5
  77. package/es/apis/middleware/middleware.mjs +114 -18
  78. package/es/apis/middleware/middleware.mjs.map +1 -1
  79. package/es/apis/middleware/models/index.d.ts +164 -15
  80. package/es/apis/middleware/models/index.mjs +53 -3
  81. package/es/apis/middleware/models/index.mjs.map +1 -1
  82. package/es/apis/middleware/models/mappers.d.ts +8 -1
  83. package/es/apis/middleware/models/mappers.mjs +376 -3
  84. package/es/apis/middleware/models/mappers.mjs.map +1 -1
  85. package/es/apis/middleware/models/parameters.d.ts +6 -3
  86. package/es/apis/middleware/models/parameters.mjs +38 -11
  87. package/es/apis/middleware/models/parameters.mjs.map +1 -1
  88. package/es/apis/node/models/index.d.ts +66 -2
  89. package/es/apis/node/models/index.mjs.map +1 -1
  90. package/es/apis/node/models/mappers.d.ts +5 -1
  91. package/es/apis/node/models/mappers.mjs +229 -7
  92. package/es/apis/node/models/mappers.mjs.map +1 -1
  93. package/es/apis/node/models/parameters.d.ts +2 -2
  94. package/es/apis/node/models/parameters.mjs +2 -2
  95. package/es/apis/node/models/parameters.mjs.map +1 -1
  96. package/es/apis/node/node.d.ts +24 -3
  97. package/es/apis/node/node.mjs +135 -3
  98. package/es/apis/node/node.mjs.map +1 -1
  99. package/es/chain.d.ts +14 -44
  100. package/es/chain.mjs +125 -219
  101. package/es/chain.mjs.map +1 -1
  102. package/es/channel/Base.d.ts +3 -47
  103. package/es/channel/Base.mjs +21 -54
  104. package/es/channel/Base.mjs.map +1 -1
  105. package/es/channel/Contract.d.ts +16 -25
  106. package/es/channel/Contract.mjs +39 -63
  107. package/es/channel/Contract.mjs.map +1 -1
  108. package/es/channel/Spend.d.ts +0 -8
  109. package/es/channel/Spend.mjs +17 -29
  110. package/es/channel/Spend.mjs.map +1 -1
  111. package/es/channel/handlers.mjs +1 -1
  112. package/es/channel/handlers.mjs.map +1 -1
  113. package/es/channel/internal.d.ts +104 -5
  114. package/es/channel/internal.mjs +26 -34
  115. package/es/channel/internal.mjs.map +1 -1
  116. package/es/contract/Contract.d.ts +10 -2
  117. package/es/contract/Contract.mjs +83 -79
  118. package/es/contract/Contract.mjs.map +1 -1
  119. package/es/contract/compiler/Base.d.ts +14 -8
  120. package/es/contract/compiler/Base.mjs.map +1 -1
  121. package/es/contract/compiler/Cli.d.ts +12 -11
  122. package/es/contract/compiler/Cli.mjs +52 -25
  123. package/es/contract/compiler/Cli.mjs.map +1 -1
  124. package/es/contract/compiler/Cli8.d.ts +13 -0
  125. package/es/contract/compiler/Cli8.mjs +22 -0
  126. package/es/contract/compiler/Cli8.mjs.map +1 -0
  127. package/es/contract/compiler/Http.d.ts +3 -9
  128. package/es/contract/compiler/Http.mjs +28 -16
  129. package/es/contract/compiler/Http.mjs.map +1 -1
  130. package/es/contract/compiler/HttpNode.d.ts +2 -5
  131. package/es/contract/compiler/HttpNode.mjs.map +1 -1
  132. package/es/contract/delegation-signature.d.ts +2 -1
  133. package/es/contract/delegation-signature.mjs +18 -14
  134. package/es/contract/delegation-signature.mjs.map +1 -1
  135. package/es/contract/ga.d.ts +1 -2
  136. package/es/contract/ga.mjs +23 -25
  137. package/es/contract/ga.mjs.map +1 -1
  138. package/es/deprecated.d.ts +48 -0
  139. package/es/deprecated.mjs +66 -1
  140. package/es/deprecated.mjs.map +1 -1
  141. package/es/index-browser.d.ts +11 -6
  142. package/es/index-browser.mjs +10 -6
  143. package/es/index-browser.mjs.map +1 -1
  144. package/es/index.d.ts +1 -0
  145. package/es/index.mjs +1 -0
  146. package/es/index.mjs.map +1 -1
  147. package/es/oracle.d.ts +6 -37
  148. package/es/oracle.mjs +32 -66
  149. package/es/oracle.mjs.map +1 -1
  150. package/es/send-transaction.d.ts +53 -0
  151. package/es/send-transaction.mjs +109 -0
  152. package/es/send-transaction.mjs.map +1 -0
  153. package/es/spend.d.ts +4 -3
  154. package/es/spend.mjs +6 -1
  155. package/es/spend.mjs.map +1 -1
  156. package/es/tx/builder/common.d.ts +29 -0
  157. package/es/tx/builder/common.mjs +42 -0
  158. package/es/tx/builder/common.mjs.map +1 -0
  159. package/es/tx/builder/constants.d.ts +6 -5
  160. package/es/tx/builder/constants.mjs +7 -15
  161. package/es/tx/builder/constants.mjs.map +1 -1
  162. package/es/tx/builder/delegation/index.d.ts +20 -0
  163. package/es/tx/builder/delegation/index.mjs +24 -0
  164. package/es/tx/builder/delegation/index.mjs.map +1 -0
  165. package/es/tx/builder/delegation/schema.d.ts +130 -0
  166. package/es/tx/builder/delegation/schema.generated.d.ts +141 -0
  167. package/es/tx/builder/delegation/schema.generated.mjs +2 -0
  168. package/es/tx/builder/delegation/schema.generated.mjs.map +1 -0
  169. package/es/tx/builder/delegation/schema.mjs +54 -0
  170. package/es/tx/builder/delegation/schema.mjs.map +1 -0
  171. package/es/tx/builder/field-types/abi-version.mjs +8 -11
  172. package/es/tx/builder/field-types/abi-version.mjs.map +1 -1
  173. package/es/tx/builder/field-types/address.mjs +1 -4
  174. package/es/tx/builder/field-types/address.mjs.map +1 -1
  175. package/es/tx/builder/field-types/coin-amount.d.ts +2 -2
  176. package/es/tx/builder/field-types/coin-amount.mjs +6 -6
  177. package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
  178. package/es/tx/builder/field-types/ct-version.d.ts +1 -1
  179. package/es/tx/builder/field-types/ct-version.mjs +4 -5
  180. package/es/tx/builder/field-types/ct-version.mjs.map +1 -1
  181. package/es/tx/builder/field-types/entry.mjs +7 -13
  182. package/es/tx/builder/field-types/entry.mjs.map +1 -1
  183. package/es/tx/builder/field-types/fee.d.ts +19 -11
  184. package/es/tx/builder/field-types/fee.mjs +57 -39
  185. package/es/tx/builder/field-types/fee.mjs.map +1 -1
  186. package/es/tx/builder/field-types/gas-limit.mjs +13 -15
  187. package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
  188. package/es/tx/builder/field-types/gas-price.d.ts +10 -2
  189. package/es/tx/builder/field-types/gas-price.mjs +53 -4
  190. package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
  191. package/es/tx/builder/field-types/index.d.ts +31 -29
  192. package/es/tx/builder/field-types/index.mjs +31 -29
  193. package/es/tx/builder/field-types/index.mjs.map +1 -1
  194. package/es/tx/builder/field-types/map.mjs +20 -31
  195. package/es/tx/builder/field-types/map.mjs.map +1 -1
  196. package/es/tx/builder/field-types/mptree.mjs +14 -29
  197. package/es/tx/builder/field-types/mptree.mjs.map +1 -1
  198. package/es/tx/builder/field-types/name-fee.d.ts +1 -1
  199. package/es/tx/builder/field-types/name-fee.mjs +1 -1
  200. package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
  201. package/es/tx/builder/field-types/nonce.d.ts +1 -0
  202. package/es/tx/builder/field-types/nonce.mjs +2 -0
  203. package/es/tx/builder/field-types/nonce.mjs.map +1 -1
  204. package/es/tx/builder/field-types/pointers.mjs +4 -7
  205. package/es/tx/builder/field-types/pointers.mjs.map +1 -1
  206. package/es/tx/builder/field-types/pointers2.d.ts +23 -0
  207. package/es/tx/builder/field-types/pointers2.mjs +65 -0
  208. package/es/tx/builder/field-types/pointers2.mjs.map +1 -0
  209. package/es/tx/builder/field-types/query-fee.d.ts +19 -0
  210. package/es/tx/builder/field-types/query-fee.mjs +20 -0
  211. package/es/tx/builder/field-types/query-fee.mjs.map +1 -0
  212. package/es/tx/builder/field-types/ttl.d.ts +9 -1
  213. package/es/tx/builder/field-types/ttl.mjs +19 -8
  214. package/es/tx/builder/field-types/ttl.mjs.map +1 -1
  215. package/es/tx/builder/field-types/with-default.d.ts +7 -0
  216. package/es/tx/builder/field-types/with-default.mjs +9 -0
  217. package/es/tx/builder/field-types/with-default.mjs.map +1 -0
  218. package/es/tx/builder/field-types/with-formatting.d.ts +7 -0
  219. package/es/tx/builder/field-types/with-formatting.mjs +9 -0
  220. package/es/tx/builder/field-types/with-formatting.mjs.map +1 -0
  221. package/es/tx/builder/field-types/wrapped.mjs +6 -8
  222. package/es/tx/builder/field-types/wrapped.mjs.map +1 -1
  223. package/es/tx/builder/helpers.d.ts +2 -2
  224. package/es/tx/builder/helpers.mjs +12 -21
  225. package/es/tx/builder/helpers.mjs.map +1 -1
  226. package/es/tx/builder/index.d.ts +17 -10
  227. package/es/tx/builder/index.mjs +39 -65
  228. package/es/tx/builder/index.mjs.map +1 -1
  229. package/es/tx/builder/schema.d.ts +478 -257
  230. package/es/tx/builder/schema.generated.d.ts +39 -3
  231. package/es/tx/builder/schema.generated.mjs.map +1 -1
  232. package/es/tx/builder/schema.mjs +48 -36
  233. package/es/tx/builder/schema.mjs.map +1 -1
  234. package/es/tx/execution-cost.d.ts +6 -5
  235. package/es/tx/execution-cost.mjs +16 -17
  236. package/es/tx/execution-cost.mjs.map +1 -1
  237. package/es/tx/transaction-signer.mjs +1 -4
  238. package/es/tx/transaction-signer.mjs.map +1 -1
  239. package/es/tx/validator.mjs +61 -42
  240. package/es/tx/validator.mjs.map +1 -1
  241. package/es/utils/amount-formatter.mjs +15 -22
  242. package/es/utils/amount-formatter.mjs.map +1 -1
  243. package/es/utils/autorest.d.ts +2 -3
  244. package/es/utils/autorest.mjs +41 -25
  245. package/es/utils/autorest.mjs.map +1 -1
  246. package/es/utils/bytes.mjs +1 -2
  247. package/es/utils/bytes.mjs.map +1 -1
  248. package/es/utils/crypto.d.ts +9 -5
  249. package/es/utils/crypto.mjs +18 -14
  250. package/es/utils/crypto.mjs.map +1 -1
  251. package/es/utils/errors.d.ts +6 -0
  252. package/es/utils/errors.mjs +12 -6
  253. package/es/utils/errors.mjs.map +1 -1
  254. package/es/utils/hd-wallet.d.ts +2 -0
  255. package/es/utils/hd-wallet.mjs +6 -5
  256. package/es/utils/hd-wallet.mjs.map +1 -1
  257. package/es/utils/json-big.mjs +2 -10
  258. package/es/utils/json-big.mjs.map +1 -1
  259. package/es/utils/jwt.d.ts +53 -0
  260. package/es/utils/jwt.mjs +120 -0
  261. package/es/utils/jwt.mjs.map +1 -0
  262. package/es/utils/keystore.d.ts +6 -2
  263. package/es/utils/keystore.mjs +8 -16
  264. package/es/utils/keystore.mjs.map +1 -1
  265. package/es/utils/typed-data.d.ts +0 -2
  266. package/es/utils/typed-data.mjs +8 -23
  267. package/es/utils/typed-data.mjs.map +1 -1
  268. package/es/utils/wrap-proxy.d.ts +2 -0
  269. package/es/utils/wrap-proxy.mjs +15 -0
  270. package/es/utils/wrap-proxy.mjs.map +1 -0
  271. package/package.json +57 -51
  272. package/src/AeSdk.ts +3 -0
  273. package/src/AeSdkAepp.ts +0 -1
  274. package/src/AeSdkBase.ts +97 -10
  275. package/src/AeSdkMethods.ts +37 -33
  276. package/src/AeSdkWallet.ts +22 -3
  277. package/src/Middleware.ts +17 -9
  278. package/src/MiddlewareSubscriber.ts +1 -1
  279. package/src/Node.ts +51 -21
  280. package/src/account/Base.ts +62 -3
  281. package/src/account/Generalized.ts +10 -0
  282. package/src/account/Ledger.ts +10 -0
  283. package/src/account/Memory.ts +83 -9
  284. package/src/account/Rpc.ts +69 -6
  285. package/src/aens.ts +35 -56
  286. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +3 -0
  287. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +2 -2
  288. package/src/aepp-wallet-communication/rpc/RpcClient.ts +4 -2
  289. package/src/aepp-wallet-communication/rpc/types.ts +14 -1
  290. package/src/aepp-wallet-communication/schema.ts +2 -0
  291. package/src/aepp-wallet-communication/wallet-detector.ts +10 -10
  292. package/src/apis/compiler/compiler.ts +93 -93
  293. package/src/apis/compiler/models/index.ts +1 -0
  294. package/src/apis/compiler/models/mappers.ts +178 -165
  295. package/src/apis/compiler/models/parameters.ts +18 -18
  296. package/src/apis/middleware/middleware.ts +462 -341
  297. package/src/apis/middleware/models/index.ts +258 -56
  298. package/src/apis/middleware/models/mappers.ts +2357 -1919
  299. package/src/apis/middleware/models/parameters.ts +172 -142
  300. package/src/apis/node/models/index.ts +79 -2
  301. package/src/apis/node/models/mappers.ts +1529 -1302
  302. package/src/apis/node/models/parameters.ts +51 -51
  303. package/src/apis/node/node.ts +420 -275
  304. package/src/chain.ts +42 -128
  305. package/src/channel/Base.ts +14 -47
  306. package/src/channel/Contract.ts +18 -26
  307. package/src/channel/Spend.ts +0 -8
  308. package/src/channel/internal.ts +115 -13
  309. package/src/contract/Contract.ts +36 -12
  310. package/src/contract/compiler/Base.ts +15 -8
  311. package/src/contract/compiler/Cli.ts +44 -23
  312. package/src/contract/compiler/Cli8.ts +17 -0
  313. package/src/contract/compiler/Http.ts +24 -14
  314. package/src/contract/compiler/HttpNode.ts +2 -2
  315. package/src/contract/delegation-signature.ts +11 -5
  316. package/src/contract/ga.ts +4 -3
  317. package/src/deprecated.ts +55 -1
  318. package/src/index-browser.ts +18 -11
  319. package/src/index.ts +1 -0
  320. package/src/oracle.ts +11 -54
  321. package/src/send-transaction.ts +136 -0
  322. package/src/spend.ts +25 -11
  323. package/src/tx/builder/common.ts +74 -0
  324. package/src/tx/builder/constants.ts +7 -9
  325. package/src/tx/builder/delegation/index.ts +28 -0
  326. package/src/tx/builder/delegation/schema.generated.ts +143 -0
  327. package/src/tx/builder/delegation/schema.ts +61 -0
  328. package/src/tx/builder/field-types/coin-amount.ts +3 -2
  329. package/src/tx/builder/field-types/ct-version.ts +1 -1
  330. package/src/tx/builder/field-types/entry.ts +1 -4
  331. package/src/tx/builder/field-types/fee.ts +72 -44
  332. package/src/tx/builder/field-types/gas-limit.ts +4 -4
  333. package/src/tx/builder/field-types/gas-price.ts +59 -3
  334. package/src/tx/builder/field-types/index.ts +31 -59
  335. package/src/tx/builder/field-types/name-fee.ts +1 -1
  336. package/src/tx/builder/field-types/nonce.ts +7 -1
  337. package/src/tx/builder/field-types/pointers2.ts +62 -0
  338. package/src/tx/builder/field-types/query-fee.ts +25 -0
  339. package/src/tx/builder/field-types/ttl.ts +13 -3
  340. package/src/tx/builder/field-types/with-default.ts +18 -0
  341. package/src/tx/builder/field-types/with-formatting.ts +18 -0
  342. package/src/tx/builder/helpers.ts +2 -2
  343. package/src/tx/builder/index.ts +42 -59
  344. package/src/tx/builder/schema.generated.ts +39 -3
  345. package/src/tx/builder/schema.ts +55 -29
  346. package/src/tx/execution-cost.ts +6 -5
  347. package/src/tx/validator.ts +31 -5
  348. package/src/utils/autorest.ts +37 -28
  349. package/src/utils/crypto.ts +24 -14
  350. package/src/utils/errors.ts +10 -0
  351. package/src/utils/hd-wallet.ts +2 -0
  352. package/src/utils/jwt.ts +126 -0
  353. package/src/utils/keystore.ts +6 -2
  354. package/src/utils/typed-data.ts +4 -30
  355. package/src/utils/wrap-proxy.ts +24 -0
  356. package/types-legacy/ts4.2/AeSdk.d.ts +3 -0
  357. package/types-legacy/ts4.2/AeSdkAepp.d.ts +0 -1
  358. package/types-legacy/ts4.2/AeSdkBase.d.ts +61 -6
  359. package/types-legacy/ts4.2/AeSdkMethods.d.ts +19 -7
  360. package/types-legacy/ts4.2/Middleware.d.ts +1 -1
  361. package/types-legacy/ts4.2/Node.d.ts +15 -2
  362. package/types-legacy/ts4.2/account/Base.d.ts +39 -3
  363. package/types-legacy/ts4.2/account/Generalized.d.ts +2 -0
  364. package/types-legacy/ts4.2/account/Ledger.d.ts +2 -0
  365. package/types-legacy/ts4.2/account/Memory.d.ts +15 -4
  366. package/types-legacy/ts4.2/account/Rpc.d.ts +16 -5
  367. package/types-legacy/ts4.2/aens.d.ts +17 -44
  368. package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserRuntime.d.ts +3 -0
  369. package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +14 -0
  370. package/types-legacy/ts4.2/aepp-wallet-communication/schema.d.ts +2 -0
  371. package/types-legacy/ts4.2/aepp-wallet-communication/wallet-detector.d.ts +2 -5
  372. package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +1 -0
  373. package/types-legacy/ts4.2/apis/middleware/middleware.d.ts +23 -5
  374. package/types-legacy/ts4.2/apis/middleware/models/index.d.ts +164 -15
  375. package/types-legacy/ts4.2/apis/middleware/models/mappers.d.ts +8 -1
  376. package/types-legacy/ts4.2/apis/middleware/models/parameters.d.ts +6 -3
  377. package/types-legacy/ts4.2/apis/node/models/index.d.ts +66 -2
  378. package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +5 -1
  379. package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +2 -2
  380. package/types-legacy/ts4.2/apis/node/node.d.ts +24 -3
  381. package/types-legacy/ts4.2/chain.d.ts +14 -44
  382. package/types-legacy/ts4.2/channel/Base.d.ts +3 -47
  383. package/types-legacy/ts4.2/channel/Contract.d.ts +16 -25
  384. package/types-legacy/ts4.2/channel/Spend.d.ts +0 -8
  385. package/types-legacy/ts4.2/channel/internal.d.ts +104 -5
  386. package/types-legacy/ts4.2/contract/Contract.d.ts +10 -2
  387. package/types-legacy/ts4.2/contract/compiler/Base.d.ts +14 -8
  388. package/types-legacy/ts4.2/contract/compiler/Cli.d.ts +12 -11
  389. package/types-legacy/ts4.2/contract/compiler/Cli8.d.ts +13 -0
  390. package/types-legacy/ts4.2/contract/compiler/Http.d.ts +3 -9
  391. package/types-legacy/ts4.2/contract/compiler/HttpNode.d.ts +2 -5
  392. package/types-legacy/ts4.2/contract/delegation-signature.d.ts +2 -1
  393. package/types-legacy/ts4.2/contract/ga.d.ts +1 -2
  394. package/types-legacy/ts4.2/deprecated.d.ts +48 -0
  395. package/types-legacy/ts4.2/index-browser.d.ts +11 -6
  396. package/types-legacy/ts4.2/index.d.ts +1 -0
  397. package/types-legacy/ts4.2/oracle.d.ts +6 -37
  398. package/types-legacy/ts4.2/send-transaction.d.ts +53 -0
  399. package/types-legacy/ts4.2/spend.d.ts +4 -3
  400. package/types-legacy/ts4.2/tx/builder/common.d.ts +32 -0
  401. package/types-legacy/ts4.2/tx/builder/constants.d.ts +6 -5
  402. package/types-legacy/ts4.2/tx/builder/delegation/index.d.ts +20 -0
  403. package/types-legacy/ts4.2/tx/builder/delegation/schema.d.ts +136 -0
  404. package/types-legacy/ts4.2/tx/builder/delegation/schema.generated.d.ts +141 -0
  405. package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +2 -2
  406. package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +1 -1
  407. package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +19 -11
  408. package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +10 -2
  409. package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +31 -29
  410. package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +1 -1
  411. package/types-legacy/ts4.2/tx/builder/field-types/nonce.d.ts +1 -0
  412. package/types-legacy/ts4.2/tx/builder/field-types/pointers2.d.ts +26 -0
  413. package/types-legacy/ts4.2/tx/builder/field-types/query-fee.d.ts +19 -0
  414. package/types-legacy/ts4.2/tx/builder/field-types/ttl.d.ts +9 -1
  415. package/types-legacy/ts4.2/tx/builder/field-types/with-default.d.ts +7 -0
  416. package/types-legacy/ts4.2/tx/builder/field-types/with-formatting.d.ts +7 -0
  417. package/types-legacy/ts4.2/tx/builder/helpers.d.ts +2 -2
  418. package/types-legacy/ts4.2/tx/builder/index.d.ts +17 -10
  419. package/types-legacy/ts4.2/tx/builder/schema.d.ts +482 -257
  420. package/types-legacy/ts4.2/tx/builder/schema.generated.d.ts +39 -3
  421. package/types-legacy/ts4.2/tx/execution-cost.d.ts +6 -5
  422. package/types-legacy/ts4.2/utils/autorest.d.ts +2 -3
  423. package/types-legacy/ts4.2/utils/crypto.d.ts +9 -5
  424. package/types-legacy/ts4.2/utils/errors.d.ts +6 -0
  425. package/types-legacy/ts4.2/utils/hd-wallet.d.ts +2 -0
  426. package/types-legacy/ts4.2/utils/jwt.d.ts +53 -0
  427. package/types-legacy/ts4.2/utils/keystore.d.ts +6 -2
  428. package/types-legacy/ts4.2/utils/typed-data.d.ts +0 -2
  429. package/types-legacy/ts4.2/utils/wrap-proxy.d.ts +2 -0
  430. package/types-legacy/ts4.5/AeSdk.d.ts +3 -0
  431. package/types-legacy/ts4.5/AeSdkAepp.d.ts +0 -1
  432. package/types-legacy/ts4.5/AeSdkBase.d.ts +61 -6
  433. package/types-legacy/ts4.5/AeSdkMethods.d.ts +19 -7
  434. package/types-legacy/ts4.5/Middleware.d.ts +1 -1
  435. package/types-legacy/ts4.5/Node.d.ts +15 -2
  436. package/types-legacy/ts4.5/account/Base.d.ts +39 -3
  437. package/types-legacy/ts4.5/account/Generalized.d.ts +2 -0
  438. package/types-legacy/ts4.5/account/Ledger.d.ts +2 -0
  439. package/types-legacy/ts4.5/account/Memory.d.ts +15 -4
  440. package/types-legacy/ts4.5/account/Rpc.d.ts +16 -5
  441. package/types-legacy/ts4.5/aens.d.ts +17 -44
  442. package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserRuntime.d.ts +3 -0
  443. package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +14 -0
  444. package/types-legacy/ts4.5/aepp-wallet-communication/schema.d.ts +2 -0
  445. package/types-legacy/ts4.5/aepp-wallet-communication/wallet-detector.d.ts +2 -5
  446. package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +1 -0
  447. package/types-legacy/ts4.5/apis/middleware/middleware.d.ts +23 -5
  448. package/types-legacy/ts4.5/apis/middleware/models/index.d.ts +164 -15
  449. package/types-legacy/ts4.5/apis/middleware/models/mappers.d.ts +8 -1
  450. package/types-legacy/ts4.5/apis/middleware/models/parameters.d.ts +6 -3
  451. package/types-legacy/ts4.5/apis/node/models/index.d.ts +66 -2
  452. package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +5 -1
  453. package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +2 -2
  454. package/types-legacy/ts4.5/apis/node/node.d.ts +24 -3
  455. package/types-legacy/ts4.5/chain.d.ts +14 -44
  456. package/types-legacy/ts4.5/channel/Base.d.ts +3 -47
  457. package/types-legacy/ts4.5/channel/Contract.d.ts +16 -25
  458. package/types-legacy/ts4.5/channel/Spend.d.ts +0 -8
  459. package/types-legacy/ts4.5/channel/internal.d.ts +104 -5
  460. package/types-legacy/ts4.5/contract/Contract.d.ts +10 -2
  461. package/types-legacy/ts4.5/contract/compiler/Base.d.ts +14 -8
  462. package/types-legacy/ts4.5/contract/compiler/Cli.d.ts +12 -11
  463. package/types-legacy/ts4.5/contract/compiler/Cli8.d.ts +13 -0
  464. package/types-legacy/ts4.5/contract/compiler/Http.d.ts +3 -9
  465. package/types-legacy/ts4.5/contract/compiler/HttpNode.d.ts +2 -5
  466. package/types-legacy/ts4.5/contract/delegation-signature.d.ts +2 -1
  467. package/types-legacy/ts4.5/contract/ga.d.ts +1 -2
  468. package/types-legacy/ts4.5/deprecated.d.ts +48 -0
  469. package/types-legacy/ts4.5/index-browser.d.ts +11 -6
  470. package/types-legacy/ts4.5/index.d.ts +1 -0
  471. package/types-legacy/ts4.5/oracle.d.ts +6 -37
  472. package/types-legacy/ts4.5/send-transaction.d.ts +53 -0
  473. package/types-legacy/ts4.5/spend.d.ts +4 -3
  474. package/types-legacy/ts4.5/tx/builder/common.d.ts +32 -0
  475. package/types-legacy/ts4.5/tx/builder/constants.d.ts +6 -5
  476. package/types-legacy/ts4.5/tx/builder/delegation/index.d.ts +20 -0
  477. package/types-legacy/ts4.5/tx/builder/delegation/schema.d.ts +136 -0
  478. package/types-legacy/ts4.5/tx/builder/delegation/schema.generated.d.ts +141 -0
  479. package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +2 -2
  480. package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +1 -1
  481. package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +19 -11
  482. package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +10 -2
  483. package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +31 -29
  484. package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +1 -1
  485. package/types-legacy/ts4.5/tx/builder/field-types/nonce.d.ts +1 -0
  486. package/types-legacy/ts4.5/tx/builder/field-types/pointers2.d.ts +26 -0
  487. package/types-legacy/ts4.5/tx/builder/field-types/query-fee.d.ts +19 -0
  488. package/types-legacy/ts4.5/tx/builder/field-types/ttl.d.ts +9 -1
  489. package/types-legacy/ts4.5/tx/builder/field-types/with-default.d.ts +7 -0
  490. package/types-legacy/ts4.5/tx/builder/field-types/with-formatting.d.ts +7 -0
  491. package/types-legacy/ts4.5/tx/builder/helpers.d.ts +2 -2
  492. package/types-legacy/ts4.5/tx/builder/index.d.ts +17 -10
  493. package/types-legacy/ts4.5/tx/builder/schema.d.ts +482 -257
  494. package/types-legacy/ts4.5/tx/builder/schema.generated.d.ts +39 -3
  495. package/types-legacy/ts4.5/tx/execution-cost.d.ts +6 -5
  496. package/types-legacy/ts4.5/utils/autorest.d.ts +2 -3
  497. package/types-legacy/ts4.5/utils/crypto.d.ts +9 -5
  498. package/types-legacy/ts4.5/utils/errors.d.ts +6 -0
  499. package/types-legacy/ts4.5/utils/hd-wallet.d.ts +2 -0
  500. package/types-legacy/ts4.5/utils/jwt.d.ts +53 -0
  501. package/types-legacy/ts4.5/utils/keystore.d.ts +6 -2
  502. package/types-legacy/ts4.5/utils/typed-data.d.ts +0 -2
  503. package/types-legacy/ts4.5/utils/wrap-proxy.d.ts +2 -0
  504. package/es/tx/builder/field-types/deposit.d.ts +0 -15
  505. package/es/tx/builder/field-types/deposit.mjs +0 -18
  506. package/es/tx/builder/field-types/deposit.mjs.map +0 -1
  507. package/src/tx/builder/field-types/deposit.ts +0 -23
  508. package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +0 -15
  509. package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +0 -15
@@ -1 +1 @@
1
- {"version":3,"file":"BrowserWindowMessage.mjs","names":["BrowserConnection","MESSAGE_DIRECTION","InternalError","RpcConnectionError","_onDisconnect","WeakMap","_target","_self","BrowserWindowMessageConnection","constructor","target","self","window","origin","sendDirection","receiveDirection","to_aepp","options","arguments","length","undefined","_classPrivateFieldInitSpec","writable","value","_classPrivateFieldSet","isConnected","listener","connect","onMessage","onDisconnect","message","_message$data$jsonrpc","_message$data$data","data","jsonrpc","_classPrivateFieldGet","source","receiveMessage","type","addEventListener","disconnect","removeEventListener","call","sendMessage","msg","_this$origin","postMessage"],"sources":["../../../src/aepp-wallet-communication/connection/BrowserWindowMessage.ts"],"sourcesContent":["import 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 * @category aepp wallet communication\n */\nexport default class BrowserWindowMessageConnection extends BrowserConnection {\n origin?: string;\n\n sendDirection?: MESSAGE_DIRECTION;\n\n receiveDirection: MESSAGE_DIRECTION;\n\n listener?: (this: Window, ev: MessageEvent<any>) => void;\n\n #onDisconnect?: () => void;\n\n #target?: ImplPostMessage;\n\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 override 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 // TODO: strict validate origin and source instead of checking message structure\n if (\n typeof message.data !== 'object'\n || (message.data.jsonrpc ?? message.data.data?.jsonrpc) !== '2.0'\n ) 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 override 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 override 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":";;;;OAAOA,iBAAiB;AAAA,SACfC,iBAAiB;AAAA,SACjBC,aAAa,EAAEC,kBAAkB;AAAA,IAAAC,aAAA,oBAAAC,OAAA;AAAA,IAAAC,OAAA,oBAAAD,OAAA;AAAA,IAAAE,KAAA,oBAAAF,OAAA;AAI1C;AACA;AACA;AACA;AACA,eAAe,MAAMG,8BAA8B,SAASR,iBAAiB,CAAC;EAe5E;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACES,WAAWA,CAAA,EAcH;IAAA,IAdI;MACVC,MAAM;MACNC,IAAI,GAAGC,MAAM;MACbC,MAAM;MACNC,aAAa;MACbC,gBAAgB,GAAGd,iBAAiB,CAACe,OAAO;MAC5C,GAAGC;IAQL,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IACJ,KAAK,CAACD,OAAO,CAAC;IAACI,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EAAA7B,OAAA,EAASwC,WAAW,CAAChB,OAAO,GAAAe,YAAA,GAAE,IAAI,CAAChC,MAAM,cAAAgC,YAAA,cAAAA,YAAA,GAAI,GAAG,CAAC;EACvD;AACF"}
1
+ {"version":3,"file":"BrowserWindowMessage.mjs","names":["BrowserConnection","MESSAGE_DIRECTION","InternalError","RpcConnectionError","_onDisconnect","WeakMap","_target","_self","BrowserWindowMessageConnection","constructor","target","self","window","origin","sendDirection","receiveDirection","to_aepp","options","_classPrivateFieldInitSpec","writable","value","_classPrivateFieldSet","isConnected","listener","connect","onMessage","onDisconnect","message","_message$data$jsonrpc","_message$data$data","data","jsonrpc","_classPrivateFieldGet","source","receiveMessage","type","addEventListener","disconnect","removeEventListener","call","undefined","sendMessage","msg","_this$origin","postMessage"],"sources":["../../../src/aepp-wallet-communication/connection/BrowserWindowMessage.ts"],"sourcesContent":["import 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 * @category aepp wallet communication\n */\nexport default class BrowserWindowMessageConnection extends BrowserConnection {\n origin?: string;\n\n sendDirection?: MESSAGE_DIRECTION;\n\n receiveDirection: MESSAGE_DIRECTION;\n\n listener?: (this: Window, ev: MessageEvent<any>) => void;\n\n #onDisconnect?: () => void;\n\n readonly #target?: ImplPostMessage;\n\n readonly #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 override 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 // TODO: strict validate origin and source instead of checking message structure\n if (\n typeof message.data !== 'object'\n || (message.data.jsonrpc ?? message.data.data?.jsonrpc) !== '2.0'\n ) 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 override 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 override 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":";;;;OAAOA,iBAAiB;AAAA,SACfC,iBAAiB;AAAA,SACjBC,aAAa,EAAEC,kBAAkB;AAAA,IAAAC,aAAA,oBAAAC,OAAA;AAAA,IAAAC,OAAA,oBAAAD,OAAA;AAAA,IAAAE,KAAA,oBAAAF,OAAA;AAI1C;AACA;AACA;AACA;AACA,eAAe,MAAMG,8BAA8B,SAASR,iBAAiB,CAAC;EAe5E;AACF;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CAAC,qCAAqC,CAAC;IAC7F,MAAMwB,OAAO,GAAG,IAAI,CAACb,aAAa,IAAI,IAAI,GAAG;MAAEqB,IAAI,EAAE,IAAI,CAACrB,aAAa;MAAEgB,IAAI,EAAEY;IAAI,CAAC,GAAGA,GAAG;IAC1F,KAAK,CAACD,WAAW,CAACd,OAAO,CAAC;IAC1BK,qBAAA,KAAI,EAAA1B,OAAA,EAASsC,WAAW,CAACjB,OAAO,GAAAgB,YAAA,GAAE,IAAI,CAAC9B,MAAM,cAAA8B,YAAA,cAAAA,YAAA,GAAI,GAAG,CAAC;EACvD;AACF"}
@@ -3,7 +3,8 @@ import _classPrivateFieldSet from "@babel/runtime-corejs3/helpers/classPrivateFi
3
3
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
4
4
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
5
5
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
6
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
6
+ function _classPrivateMethodGet(receiver, privateSet, fn) { _assertClassBrand(privateSet, receiver); return fn; }
7
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
7
8
  import { RpcError, RpcInternalError, RpcMethodNotFoundError } from "../schema.mjs";
8
9
  import { InvalidRpcMessageError, MissingCallbackError } from "../../utils/errors.mjs";
9
10
  import { ensureError } from "../../utils/other.mjs";
@@ -120,12 +121,11 @@ result, error) {
120
121
  })
121
122
  });
122
123
  }
123
- function _processResponse2(_ref) {
124
- let {
125
- id,
126
- error,
127
- result
128
- } = _ref;
124
+ function _processResponse2({
125
+ id,
126
+ error,
127
+ result
128
+ }) {
129
129
  const callbacks = _classPrivateFieldGet(this, _callbacks).get(id);
130
130
  if (callbacks == null) throw new MissingCallbackError(id);
131
131
  if (error != null) callbacks.reject(RpcError.deserialize(error));else callbacks.resolve(result);
@@ -1 +1 @@
1
- {"version":3,"file":"RpcClient.mjs","names":["RpcError","RpcInternalError","RpcMethodNotFoundError","InvalidRpcMessageError","MissingCallbackError","ensureError","_callbacks","WeakMap","_messageId","_methods","_handleMessage","WeakSet","_sendRequest","_sendResponse","_processResponse","RpcClient","constructor","connection","onDisconnect","methods","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","writable","value","Map","_classPrivateFieldSet","connect","_classPrivateMethodGet","_handleMessage2","bind","request","name","params","_sendRequest2","call","_classPrivateFieldGet","Promise","resolve","reject","set","notify","undefined","msg","origin","jsonrpc","JSON","stringify","_processResponse2","result","error","method","methodName","e","id","_sendResponse2","sendMessage","toJSON","_ref","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';\nimport { ensureError } from '../../utils/other';\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 * @category aepp wallet communication\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\n #callbacks = new Map<number, { resolve: (v: any) => void; reject: (e: Error) => void }>();\n\n #messageId = 0;\n\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;\n let error: Error | undefined;\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 ensureError(e);\n error = e;\n }\n if (request.id != null) {\n this.#sendResponse(\n request.id,\n request.method as keyof LocalApi,\n result,\n error == null || error instanceof RpcError ? error : new RpcInternalError(),\n );\n }\n if (error != null && !(error instanceof RpcError)) throw error;\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?: RpcError,\n ): void {\n this.connection.sendMessage({\n jsonrpc: '2.0',\n id,\n method,\n ...error != null ? { error: error.toJSON() } : { 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,\n params: Parameters<RemoteApi[Name]>[0],\n ): Promise<ReturnType<RemoteApi[Name]>> {\n this.#sendRequest(this.#messageId += 1, name, params);\n return 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":";;;;;;SAASA,QAAQ,EAAEC,gBAAgB,EAAEC,sBAAsB;AAAA,SAElDC,sBAAsB,EAAEC,oBAAoB;AAAA,SAC5CC,WAAW;AAAA,IAAAC,UAAA,oBAAAC,OAAA;AAAA,IAAAC,UAAA,oBAAAD,OAAA;AAAA,IAAAE,QAAA,oBAAAF,OAAA;AAAA,IAAAG,cAAA,oBAAAC,OAAA;AAAA,IAAAC,YAAA,oBAAAD,OAAA;AAAA,IAAAE,aAAA,oBAAAF,OAAA;AAAA,IAAAG,gBAAA,oBAAAH,OAAA;AA2BpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMI,SAAS,CAE5B;EASAC,WAAWA,CACTC,UAA6B,EAC7BC,YAAwB,EACxBC,OAA6B,EAC7B;IAuFF;AACF;AACA;AACA;IAHEC,2BAAA,OAAAN,gBAAA;IAAAM,2BAAA,OAAAP,aAAA;IAAAO,2BAAA,OAAAR,YAAA;IAAAQ,2BAAA,OAAAV,cAAA;IAAAW,0BAAA,OAAAf,UAAA;MAAAgB,QAAA;MAAAC,KAAA,EAjGa,IAAIC,GAAG,CAAoE;IAAC;IAAAH,0BAAA,OAAAb,UAAA;MAAAc,QAAA;MAAAC,KAAA,EAE5E;IAAC;IAAAF,0BAAA,O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AGlB,MAAM,IAAI,IAAI,GAAG;MAAEA;IAAO,CAAC,GAAG,CAAC,CAAC;EACrC,CAAC,CAAC;AACJ;AAAC,SAAAsB,eAGCD,EAAU,EACVH,MAAwC;AAAE;AAC1CF,MAAY,EACZC,KAAgB,EACV;EACN,IAAI,CAAChC,UAAU,CAACsC,WAAW,CAAC;IAC1BX,OAAO,EAAE,KAAK;IACdS,EAAE;IACFH,MAAM;IACN,IAAGD,KAAK,IAAI,IAAI,GAAG;MAAEA,KAAK,EAAEA,KAAK,CAACO,MAAM,CAAC;IAAE,CAAC,GAAG;MAAER;IAAO,CAAC;EAC3D,CAAC,CAAC;AACJ;AAAC,SAAAD,kBAAAU,IAAA,EA+BwF;EAAA,IAAxE;IAAEJ,EAAE;IAAEJ,KAAK;IAAED;EAAkD,CAAC,GAAAS,IAAA;EAC/E,MAAMC,SAAS,GAAGvB,qBAAA,KAAI,EAAA7B,UAAA,EAAYqD,GAAG,CAACN,EAAE,CAAC;EACzC,IAAIK,SAAS,IAAI,IAAI,EAAE,MAAM,IAAItD,oBAAoB,CAACiD,EAAE,CAAC;EACzD,IAAIJ,KAAK,IAAI,IAAI,EAAES,SAAS,CAACpB,MAAM,CAACtC,QAAQ,CAAC4D,WAAW,CAACX,KAAK,CAAC,CAAC,CAAC,KAC5DS,SAAS,CAACrB,OAAO,CAACW,MAAM,CAAC;EAC9Bb,qBAAA,KAAI,EAAA7B,UAAA,EAAYuD,MAAM,CAACR,EAAE,CAAC;AAC5B"}
1
+ {"version":3,"file":"RpcClient.mjs","names":["RpcError","RpcInternalError","RpcMethodNotFoundError","InvalidRpcMessageError","MissingCallbackError","ensureError","_callbacks","WeakMap","_messageId","_methods","_handleMessage","WeakSet","_sendRequest","_sendResponse","_processResponse","RpcClient","constructor","connection","onDisconnect","methods","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","writable","value","Map","_classPrivateFieldSet","connect","_classPrivateMethodGet","_handleMessage2","bind","request","name","params","_sendRequest2","call","_classPrivateFieldGet","Promise","resolve","reject","set","notify","undefined","msg","origin","jsonrpc","JSON","stringify","_processResponse2","result","error","method","methodName","e","id","_sendResponse2","sendMessage","toJSON","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';\nimport { ensureError } from '../../utils/other';\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 * @category aepp wallet communication\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\n readonly #callbacks = (\n new Map<number, { resolve: (v: any) => void; reject: (e: Error) => void }>()\n );\n\n #messageId = 0;\n\n readonly #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;\n let error: Error | undefined;\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 ensureError(e);\n error = e;\n }\n if (request.id != null) {\n this.#sendResponse(\n request.id,\n request.method as keyof LocalApi,\n result,\n error == null || error instanceof RpcError ? error : new RpcInternalError(),\n );\n }\n if (error != null && !(error instanceof RpcError)) throw error;\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?: RpcError,\n ): void {\n this.connection.sendMessage({\n jsonrpc: '2.0',\n id,\n method,\n ...error != null ? { error: error.toJSON() } : { 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,\n params: Parameters<RemoteApi[Name]>[0],\n ): Promise<ReturnType<RemoteApi[Name]>> {\n this.#sendRequest(this.#messageId += 1, name, params);\n return 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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EJ,KAAK;EAAED;AAAkD,CAAC,EAAQ;EACvF,MAAMS,SAAS,GAAGtB,qBAAA,KAAI,EAAA7B,UAAA,EAAYoD,GAAG,CAACL,EAAE,CAAC;EACzC,IAAII,SAAS,IAAI,IAAI,EAAE,MAAM,IAAIrD,oBAAoB,CAACiD,EAAE,CAAC;EACzD,IAAIJ,KAAK,IAAI,IAAI,EAAEQ,SAAS,CAACnB,MAAM,CAACtC,QAAQ,CAAC2D,WAAW,CAACV,KAAK,CAAC,CAAC,CAAC,KAC5DQ,SAAS,CAACpB,OAAO,CAACW,MAAM,CAAC;EAC9Bb,qBAAA,KAAI,EAAA7B,UAAA,EAAYsD,MAAM,CAACP,EAAE,CAAC;AAC5B"}
@@ -52,6 +52,12 @@ export interface WalletApi {
52
52
  address: Accounts;
53
53
  }>;
54
54
  [METHODS.address]: () => Promise<Encoded.AccountAddress[]>;
55
+ [METHODS.unsafeSign]: (p: {
56
+ data: Encoded.Bytearray;
57
+ onAccount: Encoded.AccountAddress;
58
+ }) => Promise<{
59
+ signature: Encoded.Signature;
60
+ }>;
55
61
  [METHODS.sign]: ((p: {
56
62
  tx: Encoded.Transaction;
57
63
  onAccount: Encoded.AccountAddress;
@@ -92,6 +98,14 @@ export interface WalletApi {
92
98
  contractAddress: Encoded.ContractAddress;
93
99
  name?: AensName;
94
100
  oracleQueryId?: Encoded.OracleQueryId;
101
+ allNames?: boolean;
102
+ isOracle?: boolean;
103
+ onAccount: Encoded.AccountAddress;
104
+ }) => Promise<{
105
+ signature: Encoded.Signature;
106
+ }>;
107
+ [METHODS.signDelegation]: (p: {
108
+ delegation: Encoded.Bytearray;
95
109
  onAccount: Encoded.AccountAddress;
96
110
  }) => Promise<{
97
111
  signature: Encoded.Signature;
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","names":["METHODS","RPC_VERSION"],"sources":["../../../src/aepp-wallet-communication/rpc/types.ts"],"sourcesContent":["import { Encoded } from '../../utils/encoder';\nimport { Domain, AciValue } from '../../utils/typed-data';\nimport { METHODS, SUBSCRIPTION_TYPES, WALLET_TYPE } from '../schema';\nimport { TransformNodeType } from '../../Node';\nimport { SignedTx } from '../../apis/node';\nimport { AensName } from '../../tx/builder/constants';\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: Encoded.AccountAddress]: {} };\n current: { [pub: Encoded.AccountAddress]: {} };\n}\n\nexport interface Node {\n // TODO: name is not used, can be removed\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<Encoded.AccountAddress[]>;\n\n [METHODS.sign]: ((\n p: {\n tx: Encoded.Transaction;\n onAccount: Encoded.AccountAddress;\n returnSigned: boolean;\n /**\n * @deprecated Wallet provided networkId will be used (current network)\n * required to maintain backward compatibility with wallets using SDK v11.0.1 and below\n * @see {@link https://github.com/aeternity/aepp-sdk-js/commit/153fd89a52c4eab39fcd659b356b36d32129c1ba}\n */\n networkId: string;\n innerTx?: boolean;\n }\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?: Partial<TransformNodeType<SignedTx>> & {\n hash: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n };\n signedTransaction?: Encoded.Transaction;\n }>);\n\n [METHODS.signMessage]: (\n p: { message: string; onAccount: Encoded.AccountAddress }\n ) => Promise<{ signature: string }>;\n\n [METHODS.signTypedData]: (\n p: {\n domain: Domain;\n aci: AciValue;\n data: Encoded.ContractBytearray;\n onAccount: Encoded.AccountAddress;\n },\n ) => Promise<{ signature: Encoded.Signature }>;\n\n [METHODS.signDelegationToContract]: (\n p: {\n contractAddress: Encoded.ContractAddress;\n name?: AensName;\n oracleQueryId?: Encoded.OracleQueryId;\n onAccount: Encoded.AccountAddress;\n },\n ) => Promise<{ signature: Encoded.Signature }>;\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,OAAO;AA+BhB,OAAO,MAAMC,WAAW,GAAG,CAAC"}
1
+ {"version":3,"file":"types.mjs","names":["METHODS","RPC_VERSION"],"sources":["../../../src/aepp-wallet-communication/rpc/types.ts"],"sourcesContent":["import { Encoded } from '../../utils/encoder';\nimport { Domain, AciValue } from '../../utils/typed-data';\nimport { METHODS, SUBSCRIPTION_TYPES, WALLET_TYPE } from '../schema';\nimport { TransformNodeType } from '../../Node';\nimport { SignedTx } from '../../apis/node';\nimport { AensName } from '../../tx/builder/constants';\n\nexport interface WalletInfo {\n id: string;\n name: string;\n networkId: string;\n origin: string; // TODO: origin needs to be provided by transport\n type: WALLET_TYPE;\n}\n\nexport interface Accounts {\n connected: { [pub: Encoded.AccountAddress]: {} };\n current: { [pub: Encoded.AccountAddress]: {} };\n}\n\nexport interface Node {\n // TODO: name is not used, can be removed\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<Encoded.AccountAddress[]>;\n\n [METHODS.unsafeSign]: (\n p: { data: Encoded.Bytearray; onAccount: Encoded.AccountAddress }\n ) => Promise<{ signature: Encoded.Signature }>;\n\n [METHODS.sign]: ((\n p: {\n tx: Encoded.Transaction;\n onAccount: Encoded.AccountAddress;\n returnSigned: boolean;\n /**\n * @deprecated Wallet provided networkId will be used (current network)\n * required to maintain backward compatibility with wallets using SDK v11.0.1 and below\n * @see {@link https://github.com/aeternity/aepp-sdk-js/commit/153fd89a52c4eab39fcd659b356b36d32129c1ba}\n */\n networkId: string;\n innerTx?: boolean;\n }\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?: Partial<TransformNodeType<SignedTx>> & {\n hash: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n };\n signedTransaction?: Encoded.Transaction;\n }>);\n\n [METHODS.signMessage]: (\n p: { message: string; onAccount: Encoded.AccountAddress }\n ) => Promise<{ signature: string }>;\n\n [METHODS.signTypedData]: (\n p: {\n domain: Domain;\n aci: AciValue;\n data: Encoded.ContractBytearray;\n onAccount: Encoded.AccountAddress;\n },\n ) => Promise<{ signature: Encoded.Signature }>;\n\n [METHODS.signDelegationToContract]: (\n p: {\n contractAddress: Encoded.ContractAddress;\n name?: AensName;\n oracleQueryId?: Encoded.OracleQueryId;\n allNames?: boolean;\n isOracle?: boolean;\n onAccount: Encoded.AccountAddress;\n },\n ) => Promise<{ signature: Encoded.Signature }>;\n\n [METHODS.signDelegation]: (\n p: {\n delegation: Encoded.Bytearray;\n onAccount: Encoded.AccountAddress;\n },\n ) => Promise<{ signature: Encoded.Signature }>;\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,OAAO;AA+BhB,OAAO,MAAMC,WAAW,GAAG,CAAC"}
@@ -29,10 +29,12 @@ export declare const enum METHODS {
29
29
  updateAddress = "address.update",
30
30
  address = "address.get",
31
31
  connect = "connection.open",
32
+ unsafeSign = "data.unsafeSign",
32
33
  sign = "transaction.sign",
33
34
  signMessage = "message.sign",
34
35
  signTypedData = "typedData.sign",
35
36
  signDelegationToContract = "delegationToContract.sign",
37
+ signDelegation = "delegation.sign",
36
38
  subscribeAddress = "address.subscribe",
37
39
  updateNetwork = "networkId.update",
38
40
  closeConnection = "connection.close"
@@ -36,10 +36,12 @@ export let METHODS = /*#__PURE__*/function (METHODS) {
36
36
  METHODS["updateAddress"] = "address.update";
37
37
  METHODS["address"] = "address.get";
38
38
  METHODS["connect"] = "connection.open";
39
+ METHODS["unsafeSign"] = "data.unsafeSign";
39
40
  METHODS["sign"] = "transaction.sign";
40
41
  METHODS["signMessage"] = "message.sign";
41
42
  METHODS["signTypedData"] = "typedData.sign";
42
43
  METHODS["signDelegationToContract"] = "delegationToContract.sign";
44
+ METHODS["signDelegation"] = "delegation.sign";
43
45
  METHODS["subscribeAddress"] = "address.subscribe";
44
46
  METHODS["updateNetwork"] = "networkId.update";
45
47
  METHODS["closeConnection"] = "connection.close";
@@ -1 +1 @@
1
- {"version":3,"file":"schema.mjs","names":["BaseError","InternalError","MESSAGE_DIRECTION","WALLET_TYPE","SUBSCRIPTION_TYPES","METHODS","RPC_STATUS","rpcErrors","RpcError","toJSON","code","message","data","deserialize","json","RpcErr","find","cl","RpcInvalidTransactionError","constructor","_defineProperty","name","push","RpcRejectedByUserError","RpcUnsupportedProtocolError","RpcConnectionDenyError","RpcNotAuthorizeError","RpcPermissionDenyError","address","RpcInternalError","RpcMethodNotFoundError"],"sources":["../../src/aepp-wallet-communication/schema.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { Encoded } from '../utils/encoder';\nimport { BaseError, InternalError } from '../utils/errors';\n\n/**\n * @category aepp wallet communication\n */\nexport const enum MESSAGE_DIRECTION {\n to_waellet = 'to_waellet',\n to_aepp = 'to_aepp',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum WALLET_TYPE {\n window = 'window',\n extension = 'extension',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum SUBSCRIPTION_TYPES {\n subscribe = 'subscribe',\n unsubscribe = 'unsubscribe',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum METHODS {\n readyToConnect = 'connection.announcePresence',\n updateAddress = 'address.update',\n address = 'address.get',\n connect = 'connection.open',\n sign = 'transaction.sign',\n signMessage = 'message.sign',\n signTypedData = 'typedData.sign',\n signDelegationToContract = 'delegationToContract.sign',\n subscribeAddress = 'address.subscribe',\n updateNetwork = 'networkId.update',\n closeConnection = 'connection.close',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum RPC_STATUS {\n CONNECTED = 'CONNECTED',\n DISCONNECTED = 'DISCONNECTED',\n WAITING_FOR_CONNECTION_REQUEST = 'WAITING_FOR_CONNECTION_REQUEST',\n}\n\ninterface RpcErrorAsJson {\n code: number;\n message: string;\n data?: any;\n}\n\nconst rpcErrors: Array<(new (data?: any) => RpcError) & { code: number }> = [];\n\n/**\n * @category exception\n */\nexport abstract class RpcError extends BaseError {\n static code: number;\n\n code!: number;\n\n data?: any;\n\n toJSON(): RpcErrorAsJson {\n return {\n code: this.code,\n message: this.message,\n data: this.data,\n };\n }\n\n static deserialize(json: RpcErrorAsJson): RpcError {\n const RpcErr = rpcErrors.find((cl) => cl.code === json.code);\n if (RpcErr == null) throw new InternalError(`Can't find RpcError with code: ${json.code}`);\n return new RpcErr(json.data);\n }\n}\n\n/**\n * @category exception\n */\nexport class RpcInvalidTransactionError extends RpcError {\n static override code = 2;\n\n override code = 2;\n\n constructor(data?: any) {\n super('Invalid transaction');\n this.data = data;\n this.name = 'RpcInvalidTransactionError';\n }\n}\nrpcErrors.push(RpcInvalidTransactionError);\n\n/**\n * @category exception\n */\nexport class RpcRejectedByUserError extends RpcError {\n static override code = 4;\n\n override code = 4;\n\n constructor(data?: any) {\n super('Operation rejected by user');\n this.data = data;\n this.name = 'RpcRejectedByUserError';\n }\n}\nrpcErrors.push(RpcRejectedByUserError);\n\n/**\n * @category exception\n */\nexport class RpcUnsupportedProtocolError extends RpcError {\n static override code = 5;\n\n override code = 5;\n\n constructor() {\n super('Unsupported Protocol Version');\n this.name = 'RpcUnsupportedProtocolError';\n }\n}\nrpcErrors.push(RpcUnsupportedProtocolError);\n\n/**\n * @category exception\n */\nexport class RpcConnectionDenyError extends RpcError {\n static override code = 9;\n\n override code = 9;\n\n constructor(data?: any) {\n super('Wallet deny your connection request');\n this.data = data;\n this.name = 'RpcConnectionDenyError';\n }\n}\nrpcErrors.push(RpcConnectionDenyError);\n\n/**\n * @category exception\n */\nexport class RpcNotAuthorizeError extends RpcError {\n static override code = 10;\n\n override code = 10;\n\n constructor() {\n super('You are not connected to the wallet');\n this.name = 'RpcNotAuthorizeError';\n }\n}\nrpcErrors.push(RpcNotAuthorizeError);\n\n/**\n * @category exception\n */\nexport class RpcPermissionDenyError extends RpcError {\n static override code = 11;\n\n override code = 11;\n\n constructor(address: Encoded.AccountAddress) {\n super(`You are not subscribed for account ${address}`);\n this.data = address;\n this.name = 'RpcPermissionDenyError';\n }\n}\nrpcErrors.push(RpcPermissionDenyError);\n\n/**\n * @category exception\n */\nexport class RpcInternalError extends RpcError {\n static override code = 12;\n\n override code = 12;\n\n constructor() {\n super('The peer failed to execute your request due to unknown error');\n this.name = 'RpcInternalError';\n }\n}\nrpcErrors.push(RpcInternalError);\n\n/**\n * @category exception\n */\nexport class RpcMethodNotFoundError extends RpcError {\n static override code = -32601;\n\n override code = -32601;\n\n constructor() {\n super('Method not found');\n this.name = 'RpcMethodNotFoundError';\n }\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;IAIpB,IAAI,CAACC,IAAI,GAAG,wBAAwB;EACtC;AACF;AAACD,eAAA,CATYU,sBAAsB,UACV,CAAC,KAAK;AAS/BvB,SAAS,CAACe,IAAI,CAACQ,sBAAsB,CAAC"}
1
+ {"version":3,"file":"schema.mjs","names":["BaseError","InternalError","MESSAGE_DIRECTION","WALLET_TYPE","SUBSCRIPTION_TYPES","METHODS","RPC_STATUS","rpcErrors","RpcError","toJSON","code","message","data","deserialize","json","RpcErr","find","cl","RpcInvalidTransactionError","constructor","_defineProperty","name","push","RpcRejectedByUserError","RpcUnsupportedProtocolError","RpcConnectionDenyError","RpcNotAuthorizeError","RpcPermissionDenyError","address","RpcInternalError","RpcMethodNotFoundError"],"sources":["../../src/aepp-wallet-communication/schema.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { Encoded } from '../utils/encoder';\nimport { BaseError, InternalError } from '../utils/errors';\n\n/**\n * @category aepp wallet communication\n */\nexport const enum MESSAGE_DIRECTION {\n to_waellet = 'to_waellet',\n to_aepp = 'to_aepp',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum WALLET_TYPE {\n window = 'window',\n extension = 'extension',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum SUBSCRIPTION_TYPES {\n subscribe = 'subscribe',\n unsubscribe = 'unsubscribe',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum METHODS {\n readyToConnect = 'connection.announcePresence',\n updateAddress = 'address.update',\n address = 'address.get',\n connect = 'connection.open',\n unsafeSign = 'data.unsafeSign',\n sign = 'transaction.sign',\n signMessage = 'message.sign',\n signTypedData = 'typedData.sign',\n signDelegationToContract = 'delegationToContract.sign',\n signDelegation = 'delegation.sign',\n subscribeAddress = 'address.subscribe',\n updateNetwork = 'networkId.update',\n closeConnection = 'connection.close',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum RPC_STATUS {\n CONNECTED = 'CONNECTED',\n DISCONNECTED = 'DISCONNECTED',\n WAITING_FOR_CONNECTION_REQUEST = 'WAITING_FOR_CONNECTION_REQUEST',\n}\n\ninterface RpcErrorAsJson {\n code: number;\n message: string;\n data?: any;\n}\n\nconst rpcErrors: Array<(new (data?: any) => RpcError) & { code: number }> = [];\n\n/**\n * @category exception\n */\nexport abstract class RpcError extends BaseError {\n static code: number;\n\n code!: number;\n\n data?: any;\n\n toJSON(): RpcErrorAsJson {\n return {\n code: this.code,\n message: this.message,\n data: this.data,\n };\n }\n\n static deserialize(json: RpcErrorAsJson): RpcError {\n const RpcErr = rpcErrors.find((cl) => cl.code === json.code);\n if (RpcErr == null) throw new InternalError(`Can't find RpcError with code: ${json.code}`);\n return new RpcErr(json.data);\n }\n}\n\n/**\n * @category exception\n */\nexport class RpcInvalidTransactionError extends RpcError {\n static override code = 2;\n\n override code = 2;\n\n constructor(data?: any) {\n super('Invalid transaction');\n this.data = data;\n this.name = 'RpcInvalidTransactionError';\n }\n}\nrpcErrors.push(RpcInvalidTransactionError);\n\n/**\n * @category exception\n */\nexport class RpcRejectedByUserError extends RpcError {\n static override code = 4;\n\n override code = 4;\n\n constructor(data?: any) {\n super('Operation rejected by user');\n this.data = data;\n this.name = 'RpcRejectedByUserError';\n }\n}\nrpcErrors.push(RpcRejectedByUserError);\n\n/**\n * @category exception\n */\nexport class RpcUnsupportedProtocolError extends RpcError {\n static override code = 5;\n\n override code = 5;\n\n constructor() {\n super('Unsupported Protocol Version');\n this.name = 'RpcUnsupportedProtocolError';\n }\n}\nrpcErrors.push(RpcUnsupportedProtocolError);\n\n/**\n * @category exception\n */\nexport class RpcConnectionDenyError extends RpcError {\n static override code = 9;\n\n override code = 9;\n\n constructor(data?: any) {\n super('Wallet deny your connection request');\n this.data = data;\n this.name = 'RpcConnectionDenyError';\n }\n}\nrpcErrors.push(RpcConnectionDenyError);\n\n/**\n * @category exception\n */\nexport class RpcNotAuthorizeError extends RpcError {\n static override code = 10;\n\n override code = 10;\n\n constructor() {\n super('You are not connected to the wallet');\n this.name = 'RpcNotAuthorizeError';\n }\n}\nrpcErrors.push(RpcNotAuthorizeError);\n\n/**\n * @category exception\n */\nexport class RpcPermissionDenyError extends RpcError {\n static override code = 11;\n\n override code = 11;\n\n constructor(address: Encoded.AccountAddress) {\n super(`You are not subscribed for account ${address}`);\n this.data = address;\n this.name = 'RpcPermissionDenyError';\n }\n}\nrpcErrors.push(RpcPermissionDenyError);\n\n/**\n * @category exception\n */\nexport class RpcInternalError extends RpcError {\n static override code = 12;\n\n override code = 12;\n\n constructor() {\n super('The peer failed to execute your request due to unknown error');\n this.name = 'RpcInternalError';\n }\n}\nrpcErrors.push(RpcInternalError);\n\n/**\n * @category exception\n */\nexport class RpcMethodNotFoundError extends RpcError {\n static override code = -32601;\n\n override code = -32601;\n\n constructor() {\n super('Method not found');\n this.name = 'RpcMethodNotFoundError';\n }\n}\nrpcErrors.push(RpcMethodNotFoundError);\n"],"mappings":";AAAA;AAAA,SAESA,SAAS,EAAEC,aAAa;AAEjC;AACA;AACA;AACA,WAAkBC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;;AAKnC;AACA;AACA;AACA,WAAkBC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;;AAK7B;AACA;AACA;AACA,WAAkBC,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;;AAKpC;AACA;AACA;AACA,WAAkBC,OAAO,0BAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAA,OAAPA,OAAO;AAAA;;AAgBzB;AACA;AACA;AACA,WAAkBC,UAAU,0BAAVA,UAAU;E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;AACF;AAACD,eAAA,CAVYO,sBAAsB,UACV,EAAE;AAU3BpB,SAAS,CAACe,IAAI,CAACK,sBAAsB,CAAC;;AAEtC;AACA;AACA;AACA,OAAO,MAAME,gBAAgB,SAASrB,QAAQ,CAAC;EAK7CW,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,8DAA8D,CAAC;IAACC,eAAA,eAHxD,EAAE;IAIhB,IAAI,CAACC,IAAI,GAAG,kBAAkB;EAChC;AACF;AAACD,eAAA,CATYS,gBAAgB,UACJ,EAAE;AAS3BtB,SAAS,CAACe,IAAI,CAACO,gBAAgB,CAAC;;AAEhC;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,SAAStB,QAAQ,CAAC;EAKnDW,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,kBAAkB,CAAC;IAACC,eAAA,eAHZ,CAAC,KAAK;IAIpB,IAAI,CAACC,IAAI,GAAG,wBAAwB;EACtC;AACF;AAACD,eAAA,CATYU,sBAAsB,UACV,CAAC,KAAK;AAS/BvB,SAAS,CAACe,IAAI,CAACQ,sBAAsB,CAAC"}
@@ -1,11 +1,8 @@
1
1
  import BrowserConnection from './connection/Browser';
2
2
  import BrowserWindowMessageConnection from './connection/BrowserWindowMessage';
3
+ import { WalletInfo } from './rpc/types';
3
4
  interface Wallet {
4
- info: {
5
- id: string;
6
- type: string;
7
- origin: string;
8
- };
5
+ info: WalletInfo;
9
6
  getConnection: () => BrowserWindowMessageConnection;
10
7
  }
11
8
  interface Wallets {
@@ -11,21 +11,25 @@ import { UnsupportedPlatformError } from "../utils/errors.mjs";
11
11
  export default ((connection, onDetected) => {
12
12
  if (window == null) throw new UnsupportedPlatformError('Window object not found, you can run wallet detector only in browser');
13
13
  const wallets = {};
14
- connection.connect((_ref, origin, source) => {
15
- let {
16
- method,
17
- params
18
- } = _ref;
14
+ connection.connect(({
15
+ method,
16
+ params
17
+ }, origin, source) => {
19
18
  if (method !== METHODS.readyToConnect || wallets[params.id] != null) return;
20
19
  const wallet = {
21
20
  info: params,
22
21
  getConnection() {
23
- const isExtension = params.type === 'extension';
24
22
  return new BrowserWindowMessageConnection({
25
- sendDirection: isExtension ? MESSAGE_DIRECTION.to_waellet : undefined,
26
- receiveDirection: isExtension ? MESSAGE_DIRECTION.to_aepp : undefined,
27
23
  target: source,
28
- origin: isExtension ? window.origin : params.origin
24
+ ...(params.type === 'extension' ? {
25
+ sendDirection: MESSAGE_DIRECTION.to_waellet,
26
+ receiveDirection: MESSAGE_DIRECTION.to_aepp,
27
+ ...(window.origin !== 'null' && {
28
+ origin: window.origin
29
+ })
30
+ } : {
31
+ origin: params.origin
32
+ })
29
33
  });
30
34
  }
31
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-detector.mjs","names":["BrowserWindowMessageConnection","MESSAGE_DIRECTION","METHODS","UnsupportedPlatformError","connection","onDetected","window","wallets","connect","_ref","origin","source","method","params","readyToConnect","id","wallet","info","getConnection","isExtension","type","sendDirection","to_waellet","undefined","receiveDirection","to_aepp","target","newWallet","disconnect"],"sources":["../../src/aepp-wallet-communication/wallet-detector.ts"],"sourcesContent":["import BrowserConnection from './connection/Browser';\nimport BrowserWindowMessageConnection from './connection/BrowserWindowMessage';\nimport { MESSAGE_DIRECTION, METHODS } from './schema';\nimport { UnsupportedPlatformError } from '../utils/errors';\n\ninterface Wallet {\n info: {\n id: string;\n type: string;\n origin: string;\n };\n getConnection: () => BrowserWindowMessageConnection;\n}\ninterface Wallets { [key: string]: Wallet }\n\n/**\n * A function to detect available wallets\n * @category aepp wallet communication\n * @param connection - connection to use to detect wallets\n * @param onDetected - call-back function which trigger on new wallet\n * @returns a function to stop scanning\n */\nexport default (\n connection: BrowserConnection,\n onDetected: ({ wallets, newWallet }: { wallets: Wallets; newWallet: Wallet }) => void,\n): () => void => {\n if (window == null) throw new UnsupportedPlatformError('Window object not found, you can run wallet detector only in browser');\n const wallets: Wallets = {};\n\n connection.connect((\n { method, params }: { method: string; params: Wallet['info'] },\n origin: string,\n source: Window,\n ) => {\n if (method !== METHODS.readyToConnect || wallets[params.id] != null) return;\n\n const wallet = {\n info: params,\n getConnection() {\n const isExtension = params.type === 'extension';\n return new BrowserWindowMessageConnection({\n sendDirection: isExtension ? MESSAGE_DIRECTION.to_waellet : undefined,\n receiveDirection: isExtension ? MESSAGE_DIRECTION.to_aepp : undefined,\n target: source,\n origin: isExtension ? window.origin : params.origin,\n });\n },\n };\n wallets[wallet.info.id] = wallet;\n onDetected({ wallets, newWallet: wallet });\n }, () => {});\n\n return () => connection.disconnect();\n};\n"],"mappings":"OACOA,8BAA8B;AAAA,SAC5BC,iBAAiB,EAAEC,OAAO;AAAA,SAC1BC,wBAAwB;AAYjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,CACbC,UAA6B,EAC7BC,UAAqF,KACtE;EACf,IAAIC,MAAM,IAAI,IAAI,EAAE,MAAM,IAAIH,wBAAwB,CAAC,sEAAsE,CAAC;EAC9H,MAAMI,OAAgB,GAAG,CAAC,CAAC;EAE3BH,UAAU,CAACI,OAAO,CAAC,CAAAC,IAAA,EAEjBC,MAAc,EACdC,MAAc,KACX;IAAA,IAHH;MAAEC,MAAM;MAAEC;IAAmD,CAAC,GAAAJ,IAAA;IAI9D,IAAIG,MAAM,KAAKV,OAAO,CAACY,cAAc,IAAIP,OAAO,CAACM,MAAM,CAACE,EAAE,CAAC,IAAI,IAAI,EAAE;IAErE,MAAMC,MAAM,GAAG;MACbC,IAAI,EAAEJ,MAAM;MACZK,aAAaA,CAAA,EAAG;QACd,MAAMC,WAAW,GAAGN,MAAM,CAACO,IAAI,KAAK,WAAW;QAC/C,OAAO,IAAIpB,8BAA8B,CAAC;UACxCqB,aAAa,EAAEF,WAAW,GAAGlB,iBAAiB,CAACqB,UAAU,GAAGC,SAAS;UACrEC,gBAAgB,EAAEL,WAAW,GAAGlB,iBAAiB,CAACwB,OAAO,GAAGF,SAAS;UACrEG,MAAM,EAAEf,MAAM;UACdD,MAAM,EAAES,WAAW,GAAGb,MAAM,CAACI,MAAM,GAAGG,MAAM,CAACH;QAC/C,CAAC,CAAC;MACJ;IACF,CAAC;IACDH,OAAO,CAACS,MAAM,CAACC,IAAI,CAACF,EAAE,CAAC,GAAGC,MAAM;IAChCX,UAAU,CAAC;MAAEE,OAAO;MAAEoB,SAAS,EAAEX;IAAO,CAAC,CAAC;EAC5C,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;EAEZ,OAAO,MAAMZ,UAAU,CAACwB,UAAU,CAAC,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"wallet-detector.mjs","names":["BrowserWindowMessageConnection","MESSAGE_DIRECTION","METHODS","UnsupportedPlatformError","connection","onDetected","window","wallets","connect","method","params","origin","source","readyToConnect","id","wallet","info","getConnection","target","type","sendDirection","to_waellet","receiveDirection","to_aepp","newWallet","disconnect"],"sources":["../../src/aepp-wallet-communication/wallet-detector.ts"],"sourcesContent":["import BrowserConnection from './connection/Browser';\nimport BrowserWindowMessageConnection from './connection/BrowserWindowMessage';\nimport { MESSAGE_DIRECTION, METHODS } from './schema';\nimport { WalletInfo } from './rpc/types';\nimport { UnsupportedPlatformError } from '../utils/errors';\n\ninterface Wallet {\n info: WalletInfo;\n getConnection: () => BrowserWindowMessageConnection;\n}\ninterface Wallets { [key: string]: Wallet }\n\n/**\n * A function to detect available wallets\n * @category aepp wallet communication\n * @param connection - connection to use to detect wallets\n * @param onDetected - call-back function which trigger on new wallet\n * @returns a function to stop scanning\n */\nexport default (\n connection: BrowserConnection,\n onDetected: ({ wallets, newWallet }: { wallets: Wallets; newWallet: Wallet }) => void,\n): () => void => {\n if (window == null) throw new UnsupportedPlatformError('Window object not found, you can run wallet detector only in browser');\n const wallets: Wallets = {};\n\n connection.connect((\n { method, params }: { method: string; params: WalletInfo },\n origin: string,\n source: Window,\n ) => {\n if (method !== METHODS.readyToConnect || wallets[params.id] != null) return;\n\n const wallet = {\n info: params,\n getConnection() {\n return new BrowserWindowMessageConnection({\n target: source,\n ...params.type === 'extension' ? {\n sendDirection: MESSAGE_DIRECTION.to_waellet,\n receiveDirection: MESSAGE_DIRECTION.to_aepp,\n ...window.origin !== 'null' && { origin: window.origin },\n } : {\n origin: params.origin,\n },\n });\n },\n };\n wallets[wallet.info.id] = wallet;\n onDetected({ wallets, newWallet: wallet });\n }, () => {});\n\n return () => connection.disconnect();\n};\n"],"mappings":"OACOA,8BAA8B;AAAA,SAC5BC,iBAAiB,EAAEC,OAAO;AAAA,SAE1BC,wBAAwB;AAQjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,CACbC,UAA6B,EAC7BC,UAAqF,KACtE;EACf,IAAIC,MAAM,IAAI,IAAI,EAAE,MAAM,IAAIH,wBAAwB,CAAC,sEAAsE,CAAC;EAC9H,MAAMI,OAAgB,GAAG,CAAC,CAAC;EAE3BH,UAAU,CAACI,OAAO,CAAC,CACjB;IAAEC,MAAM;IAAEC;EAA+C,CAAC,EAC1DC,MAAc,EACdC,MAAc,KACX;IACH,IAAIH,MAAM,KAAKP,OAAO,CAACW,cAAc,IAAIN,OAAO,CAACG,MAAM,CAACI,EAAE,CAAC,IAAI,IAAI,EAAE;IAErE,MAAMC,MAAM,GAAG;MACbC,IAAI,EAAEN,MAAM;MACZO,aAAaA,CAAA,EAAG;QACd,OAAO,IAAIjB,8BAA8B,CAAC;UACxCkB,MAAM,EAAEN,MAAM;UACd,IAAGF,MAAM,CAACS,IAAI,KAAK,WAAW,GAAG;YAC/BC,aAAa,EAAEnB,iBAAiB,CAACoB,UAAU;YAC3CC,gBAAgB,EAAErB,iBAAiB,CAACsB,OAAO;YAC3C,IAAGjB,MAAM,CAACK,MAAM,KAAK,MAAM,IAAI;cAAEA,MAAM,EAAEL,MAAM,CAACK;YAAO,CAAC;UAC1D,CAAC,GAAG;YACFA,MAAM,EAAED,MAAM,CAACC;UACjB,CAAC;QACH,CAAC,CAAC;MACJ;IACF,CAAC;IACDJ,OAAO,CAACQ,MAAM,CAACC,IAAI,CAACF,EAAE,CAAC,GAAGC,MAAM;IAChCV,UAAU,CAAC;MAAEE,OAAO;MAAEiB,SAAS,EAAET;IAAO,CAAC,CAAC;EAC5C,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;EAEZ,OAAO,MAAMX,UAAU,CAACqB,UAAU,CAAC,CAAC;AACtC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"compiler.mjs","names":["coreClient","Parameters","Mappers","Compiler","ServiceClient","constructor","$host","options","_ref","_options$endpoint","undefined","Error","defaults","requestContentType","packageDetails","userAgentPrefix","userAgentOptions","optionsWithDefaults","endpoint","baseUri","generateACI","body","sendOperationRequest","generateACIOperationSpec","compileContract","compileContractOperationSpec","decodeCallResult","decodeCallResultOperationSpec","decodeCallResultBytecode","decodeCallResultBytecodeOperationSpec","encodeCalldata","encodeCalldataOperationSpec","decodeCalldataBytecode","decodeCalldataBytecodeOperationSpec","decodeCalldataSource","decodeCalldataSourceOperationSpec","getFateAssemblerCode","getFateAssemblerCodeOperationSpec","validateByteCode","validateByteCodeOperationSpec","getCompilerVersion","getCompilerVersionOperationSpec","version","versionOperationSpec","apiVersion","apiVersionOperationSpec","api","apiOperationSpec","serializer","createSerializer","path","httpMethod","responses","bodyMapper","type","name","element","value","className","isError","requestBody","urlParameters","headerParameters","contentType","accept","mediaType","CompileResult","body1","DecodedCallresult","body2","Calldata","body3","DecodedCalldata","ErrorModel","body4","body5","FateAssembler","body6","body7","CompilerVersion","ApiVersion"],"sources":["../../../src/apis/compiler/compiler.ts"],"sourcesContent":["import * as coreClient from \"@azure/core-client\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n CompilerOptionalParams,\n Contract,\n GenerateACIOptionalParams,\n GenerateACIResponse,\n CompileContractOptionalParams,\n CompileContractResponse,\n SophiaCallResultInput,\n DecodeCallResultOptionalParams,\n DecodeCallResultResponse,\n BytecodeCallResultInput,\n DecodeCallResultBytecodeOptionalParams,\n DecodeCallResultBytecodeResponse,\n FunctionCallInput,\n EncodeCalldataOptionalParams,\n EncodeCalldataResponse,\n DecodeCalldataBytecode,\n DecodeCalldataBytecodeOptionalParams,\n DecodeCalldataBytecodeResponse,\n DecodeCalldataSource,\n DecodeCalldataSourceOptionalParams,\n DecodeCalldataSourceResponse,\n ByteCodeInput,\n GetFateAssemblerCodeOptionalParams,\n GetFateAssemblerCodeResponse,\n ValidateByteCodeInput,\n ValidateByteCodeOptionalParams,\n GetCompilerVersionOptionalParams,\n GetCompilerVersionResponse,\n VersionOptionalParams,\n VersionResponse,\n ApiVersionOptionalParams,\n ApiVersionResponse,\n ApiOptionalParams,\n ApiResponse\n} from \"./models\";\n\nexport class Compiler extends coreClient.ServiceClient {\n $host: string;\n\n /**\n * Initializes a new instance of the Compiler class.\n * @param $host server parameter\n * @param options The parameter options\n */\n constructor($host: string, options?: CompilerOptionalParams) {\n if ($host === undefined) {\n throw new Error(\"'$host' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: CompilerOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-compiler/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{$host}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.$host = $host;\n }\n\n /**\n * Generate an Aeternity Contract Interface (ACI) for contract\n * @param body contract code\n * @param options The options parameters.\n */\n generateACI(\n body: Contract,\n options?: GenerateACIOptionalParams\n ): Promise<GenerateACIResponse> {\n return this.sendOperationRequest(\n { body, options },\n generateACIOperationSpec\n );\n }\n\n /**\n * Compile a sophia contract from source and return byte code and ACI\n * @param body contract code\n * @param options The options parameters.\n */\n compileContract(\n body: Contract,\n options?: CompileContractOptionalParams\n ): Promise<CompileContractResponse> {\n return this.sendOperationRequest(\n { body, options },\n compileContractOperationSpec\n );\n }\n\n /**\n * Decode the result of contract call\n * @param body Binary data in Sophia ABI format\n * @param options The options parameters.\n */\n decodeCallResult(\n body: SophiaCallResultInput,\n options?: DecodeCallResultOptionalParams\n ): Promise<DecodeCallResultResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCallResultOperationSpec\n );\n }\n\n /**\n * Decode the result of contract call from Bytecode\n * @param body Call result + compiled contract\n * @param options The options parameters.\n */\n decodeCallResultBytecode(\n body: BytecodeCallResultInput,\n options?: DecodeCallResultBytecodeOptionalParams\n ): Promise<DecodeCallResultBytecodeResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCallResultBytecodeOperationSpec\n );\n }\n\n /**\n * Encode Sophia function call according to sophia ABI.\n * @param body Sophia function call - contract code + function name + arguments\n * @param options The options parameters.\n */\n encodeCalldata(\n body: FunctionCallInput,\n options?: EncodeCalldataOptionalParams\n ): Promise<EncodeCalldataResponse> {\n return this.sendOperationRequest(\n { body, options },\n encodeCalldataOperationSpec\n );\n }\n\n /**\n * Identify function name and arguments in Calldata for a compiled contract\n * @param body Calldata + compiled contract\n * @param options The options parameters.\n */\n decodeCalldataBytecode(\n body: DecodeCalldataBytecode,\n options?: DecodeCalldataBytecodeOptionalParams\n ): Promise<DecodeCalldataBytecodeResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCalldataBytecodeOperationSpec\n );\n }\n\n /**\n * Identify function name and arguments in Calldata for a (partial) contract\n * @param body Calldata + contract (stub) code\n * @param options The options parameters.\n */\n decodeCalldataSource(\n body: DecodeCalldataSource,\n options?: DecodeCalldataSourceOptionalParams\n ): Promise<DecodeCalldataSourceResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCalldataSourceOperationSpec\n );\n }\n\n /**\n * Get FATE assembler code from bytecode\n * @param body contract byte array\n * @param options The options parameters.\n */\n getFateAssemblerCode(\n body: ByteCodeInput,\n options?: GetFateAssemblerCodeOptionalParams\n ): Promise<GetFateAssemblerCodeResponse> {\n return this.sendOperationRequest(\n { body, options },\n getFateAssemblerCodeOperationSpec\n );\n }\n\n /**\n * Verify that an encoded byte array is the result of compiling a given contract\n * @param body contract byte array and source code\n * @param options The options parameters.\n */\n validateByteCode(\n body: ValidateByteCodeInput,\n options?: ValidateByteCodeOptionalParams\n ): Promise<void> {\n return this.sendOperationRequest(\n { body, options },\n validateByteCodeOperationSpec\n );\n }\n\n /**\n * Extract compiler version from bytecode\n * @param body contract byte array\n * @param options The options parameters.\n */\n getCompilerVersion(\n body: ByteCodeInput,\n options?: GetCompilerVersionOptionalParams\n ): Promise<GetCompilerVersionResponse> {\n return this.sendOperationRequest(\n { body, options },\n getCompilerVersionOperationSpec\n );\n }\n\n /**\n * Get the version of the underlying Sophia compiler version\n * @param options The options parameters.\n */\n version(options?: VersionOptionalParams): Promise<VersionResponse> {\n return this.sendOperationRequest({ options }, versionOperationSpec);\n }\n\n /**\n * Get the version of the API\n * @param options The options parameters.\n */\n apiVersion(options?: ApiVersionOptionalParams): Promise<ApiVersionResponse> {\n return this.sendOperationRequest({ options }, apiVersionOperationSpec);\n }\n\n /**\n * Get the Api description\n * @param options The options parameters.\n */\n api(options?: ApiOptionalParams): Promise<ApiResponse> {\n return this.sendOperationRequest({ options }, apiOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst generateACIOperationSpec: coreClient.OperationSpec = {\n path: \"/aci\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: {\n type: { name: \"Dictionary\", value: { type: { name: \"any\" } } }\n }\n }\n }\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst compileContractOperationSpec: coreClient.OperationSpec = {\n path: \"/compile\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CompileResult\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeCallResultOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-call-result\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: { type: { name: \"any\" } }\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body1,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeCallResultBytecodeOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-call-result/bytecode\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DecodedCallresult\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body2,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst encodeCalldataOperationSpec: coreClient.OperationSpec = {\n path: \"/encode-calldata\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.Calldata\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body3,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeCalldataBytecodeOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-calldata/bytecode\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DecodedCalldata\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body4,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeCalldataSourceOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-calldata/source\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DecodedCalldata\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body5,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst getFateAssemblerCodeOperationSpec: coreClient.OperationSpec = {\n path: \"/fate-assembler\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.FateAssembler\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body6,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst validateByteCodeOperationSpec: coreClient.OperationSpec = {\n path: \"/validate-byte-code\",\n httpMethod: \"POST\",\n responses: {\n 200: {},\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body7,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst getCompilerVersionOperationSpec: coreClient.OperationSpec = {\n path: \"/compiler-version\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CompilerVersion\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body6,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst versionOperationSpec: coreClient.OperationSpec = {\n path: \"/version\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CompilerVersion\n },\n 500: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst apiVersionOperationSpec: coreClient.OperationSpec = {\n path: \"/api-version\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ApiVersion\n },\n 500: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst apiOperationSpec: coreClient.OperationSpec = {\n path: \"/api\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Dictionary\", value: { type: { name: \"any\" } } }\n }\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\n"],"mappings":"AAAA,OAAO,KAAKA,UAAU,MAAM,oBAAoB;AAAC,OAC1C,KAAKC,UAAU;AAAA,OACf,KAAKC,OAAO;AAsCnB,OAAO,MAAMC,QAAQ,SAASH,UAAU,CAACI,aAAa,CAAC;EAGrD;AACF;AACA;AACA;AACA;EACEC,WAAWA,CAACC,KAAa,EAAEC,OAAgC,EAAE;IAAA,IAAAC,IAAA,EAAAC,iBAAA;IAC3D,IAAIH,KAAK,KAAKI,SAAS,EAAE;MACvB,MAAM,IAAIC,KAAK,CAAC,wBAAwB,CAAC;IAC3C;;IAEA;IACA,IAAI,CAACJ,OAAO,EAAE;MACZA,OAAO,GAAG,CAAC,CAA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IACD,GAAG,EAAE;MACHF,UAAU,EAAEnD,OAAO,CAACuE,UAAU;MAC9Bd,OAAO,EAAE;IACX;EACF,CAAC;EACDE,aAAa,EAAE,CAAC5D,UAAU,CAACK,KAAK,CAAC;EACjCwD,gBAAgB,EAAE,CAAC7D,UAAU,CAAC+D,MAAM,CAAC;EACrChB;AACF,CAAC"}
1
+ {"version":3,"file":"compiler.mjs","names":["coreClient","Parameters","Mappers","Compiler","ServiceClient","constructor","$host","options","_ref","_options$endpoint","undefined","Error","defaults","requestContentType","packageDetails","userAgentPrefix","userAgentOptions","optionsWithDefaults","endpoint","baseUri","generateACI","body","sendOperationRequest","generateACIOperationSpec","compileContract","compileContractOperationSpec","decodeCallResult","decodeCallResultOperationSpec","decodeCallResultBytecode","decodeCallResultBytecodeOperationSpec","encodeCalldata","encodeCalldataOperationSpec","decodeCalldataBytecode","decodeCalldataBytecodeOperationSpec","decodeCalldataSource","decodeCalldataSourceOperationSpec","getFateAssemblerCode","getFateAssemblerCodeOperationSpec","validateByteCode","validateByteCodeOperationSpec","getCompilerVersion","getCompilerVersionOperationSpec","version","versionOperationSpec","apiVersion","apiVersionOperationSpec","api","apiOperationSpec","serializer","createSerializer","path","httpMethod","responses","bodyMapper","type","name","element","value","className","isError","requestBody","urlParameters","headerParameters","contentType","accept","mediaType","CompileResult","body1","DecodedCallresult","body2","Calldata","body3","DecodedCalldata","ErrorModel","body4","body5","FateAssembler","body6","body7","CompilerVersion","ApiVersion"],"sources":["../../../src/apis/compiler/compiler.ts"],"sourcesContent":["import * as coreClient from \"@azure/core-client\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n CompilerOptionalParams,\n Contract,\n GenerateACIOptionalParams,\n GenerateACIResponse,\n CompileContractOptionalParams,\n CompileContractResponse,\n SophiaCallResultInput,\n DecodeCallResultOptionalParams,\n DecodeCallResultResponse,\n BytecodeCallResultInput,\n DecodeCallResultBytecodeOptionalParams,\n DecodeCallResultBytecodeResponse,\n FunctionCallInput,\n EncodeCalldataOptionalParams,\n EncodeCalldataResponse,\n DecodeCalldataBytecode,\n DecodeCalldataBytecodeOptionalParams,\n DecodeCalldataBytecodeResponse,\n DecodeCalldataSource,\n DecodeCalldataSourceOptionalParams,\n DecodeCalldataSourceResponse,\n ByteCodeInput,\n GetFateAssemblerCodeOptionalParams,\n GetFateAssemblerCodeResponse,\n ValidateByteCodeInput,\n ValidateByteCodeOptionalParams,\n GetCompilerVersionOptionalParams,\n GetCompilerVersionResponse,\n VersionOptionalParams,\n VersionResponse,\n ApiVersionOptionalParams,\n ApiVersionResponse,\n ApiOptionalParams,\n ApiResponse,\n} from \"./models\";\n\nexport class Compiler extends coreClient.ServiceClient {\n $host: string;\n\n /**\n * Initializes a new instance of the Compiler class.\n * @param $host server parameter\n * @param options The parameter options\n */\n constructor($host: string, options?: CompilerOptionalParams) {\n if ($host === undefined) {\n throw new Error(\"'$host' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: CompilerOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n };\n\n const packageDetails = `azsdk-js-compiler/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{$host}\",\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.$host = $host;\n }\n\n /**\n * Generate an Aeternity Contract Interface (ACI) for contract\n * @param body contract code\n * @param options The options parameters.\n */\n generateACI(\n body: Contract,\n options?: GenerateACIOptionalParams,\n ): Promise<GenerateACIResponse> {\n return this.sendOperationRequest(\n { body, options },\n generateACIOperationSpec,\n );\n }\n\n /**\n * Compile a sophia contract from source and return byte code and ACI\n * @param body contract code\n * @param options The options parameters.\n */\n compileContract(\n body: Contract,\n options?: CompileContractOptionalParams,\n ): Promise<CompileContractResponse> {\n return this.sendOperationRequest(\n { body, options },\n compileContractOperationSpec,\n );\n }\n\n /**\n * Decode the result of contract call\n * @param body Binary data in Sophia ABI format\n * @param options The options parameters.\n */\n decodeCallResult(\n body: SophiaCallResultInput,\n options?: DecodeCallResultOptionalParams,\n ): Promise<DecodeCallResultResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCallResultOperationSpec,\n );\n }\n\n /**\n * Decode the result of contract call from Bytecode\n * @param body Call result + compiled contract\n * @param options The options parameters.\n */\n decodeCallResultBytecode(\n body: BytecodeCallResultInput,\n options?: DecodeCallResultBytecodeOptionalParams,\n ): Promise<DecodeCallResultBytecodeResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCallResultBytecodeOperationSpec,\n );\n }\n\n /**\n * Encode Sophia function call according to sophia ABI.\n * @param body Sophia function call - contract code + function name + arguments\n * @param options The options parameters.\n */\n encodeCalldata(\n body: FunctionCallInput,\n options?: EncodeCalldataOptionalParams,\n ): Promise<EncodeCalldataResponse> {\n return this.sendOperationRequest(\n { body, options },\n encodeCalldataOperationSpec,\n );\n }\n\n /**\n * Identify function name and arguments in Calldata for a compiled contract\n * @param body Calldata + compiled contract\n * @param options The options parameters.\n */\n decodeCalldataBytecode(\n body: DecodeCalldataBytecode,\n options?: DecodeCalldataBytecodeOptionalParams,\n ): Promise<DecodeCalldataBytecodeResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCalldataBytecodeOperationSpec,\n );\n }\n\n /**\n * Identify function name and arguments in Calldata for a (partial) contract\n * @param body Calldata + contract (stub) code\n * @param options The options parameters.\n */\n decodeCalldataSource(\n body: DecodeCalldataSource,\n options?: DecodeCalldataSourceOptionalParams,\n ): Promise<DecodeCalldataSourceResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCalldataSourceOperationSpec,\n );\n }\n\n /**\n * Get FATE assembler code from bytecode\n * @param body contract byte array\n * @param options The options parameters.\n */\n getFateAssemblerCode(\n body: ByteCodeInput,\n options?: GetFateAssemblerCodeOptionalParams,\n ): Promise<GetFateAssemblerCodeResponse> {\n return this.sendOperationRequest(\n { body, options },\n getFateAssemblerCodeOperationSpec,\n );\n }\n\n /**\n * Verify that an encoded byte array is the result of compiling a given contract\n * @param body contract byte array and source code\n * @param options The options parameters.\n */\n validateByteCode(\n body: ValidateByteCodeInput,\n options?: ValidateByteCodeOptionalParams,\n ): Promise<void> {\n return this.sendOperationRequest(\n { body, options },\n validateByteCodeOperationSpec,\n );\n }\n\n /**\n * Extract compiler version from bytecode\n * @param body contract byte array\n * @param options The options parameters.\n */\n getCompilerVersion(\n body: ByteCodeInput,\n options?: GetCompilerVersionOptionalParams,\n ): Promise<GetCompilerVersionResponse> {\n return this.sendOperationRequest(\n { body, options },\n getCompilerVersionOperationSpec,\n );\n }\n\n /**\n * Get the version of the underlying Sophia compiler version\n * @param options The options parameters.\n */\n version(options?: VersionOptionalParams): Promise<VersionResponse> {\n return this.sendOperationRequest({ options }, versionOperationSpec);\n }\n\n /**\n * Get the version of the API\n * @param options The options parameters.\n */\n apiVersion(options?: ApiVersionOptionalParams): Promise<ApiVersionResponse> {\n return this.sendOperationRequest({ options }, apiVersionOperationSpec);\n }\n\n /**\n * Get the Api description\n * @param options The options parameters.\n */\n api(options?: ApiOptionalParams): Promise<ApiResponse> {\n return this.sendOperationRequest({ options }, apiOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst generateACIOperationSpec: coreClient.OperationSpec = {\n path: \"/aci\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: {\n type: { name: \"Dictionary\", value: { type: { name: \"any\" } } },\n },\n },\n },\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } },\n },\n },\n isError: true,\n },\n },\n requestBody: Parameters.body,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst compileContractOperationSpec: coreClient.OperationSpec = {\n path: \"/compile\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CompileResult,\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } },\n },\n },\n isError: true,\n },\n },\n requestBody: Parameters.body,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst decodeCallResultOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-call-result\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: { type: { name: \"any\" } },\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } },\n },\n },\n isError: true,\n },\n },\n requestBody: Parameters.body1,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst decodeCallResultBytecodeOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-call-result/bytecode\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DecodedCallresult,\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } },\n },\n },\n isError: true,\n },\n },\n requestBody: Parameters.body2,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst encodeCalldataOperationSpec: coreClient.OperationSpec = {\n path: \"/encode-calldata\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.Calldata,\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } },\n },\n },\n isError: true,\n },\n },\n requestBody: Parameters.body3,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst decodeCalldataBytecodeOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-calldata/bytecode\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DecodedCalldata,\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true,\n },\n },\n requestBody: Parameters.body4,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst decodeCalldataSourceOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-calldata/source\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DecodedCalldata,\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } },\n },\n },\n isError: true,\n },\n },\n requestBody: Parameters.body5,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst getFateAssemblerCodeOperationSpec: coreClient.OperationSpec = {\n path: \"/fate-assembler\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.FateAssembler,\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true,\n },\n },\n requestBody: Parameters.body6,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst validateByteCodeOperationSpec: coreClient.OperationSpec = {\n path: \"/validate-byte-code\",\n httpMethod: \"POST\",\n responses: {\n 200: {},\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } },\n },\n },\n isError: true,\n },\n },\n requestBody: Parameters.body7,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst getCompilerVersionOperationSpec: coreClient.OperationSpec = {\n path: \"/compiler-version\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CompilerVersion,\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true,\n },\n },\n requestBody: Parameters.body6,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst versionOperationSpec: coreClient.OperationSpec = {\n path: \"/version\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CompilerVersion,\n },\n 500: {\n bodyMapper: Mappers.ErrorModel,\n isError: true,\n },\n },\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst apiVersionOperationSpec: coreClient.OperationSpec = {\n path: \"/api-version\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ApiVersion,\n },\n 500: {\n bodyMapper: Mappers.ErrorModel,\n isError: true,\n },\n },\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst apiOperationSpec: coreClient.OperationSpec = {\n path: \"/api\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Dictionary\", value: { type: { name: \"any\" } } },\n },\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true,\n },\n },\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"],"mappings":"AAAA,OAAO,KAAKA,UAAU,MAAM,oBAAoB;AAAC,OAC1C,KAAKC,UAAU;AAAA,OACf,KAAKC,OAAO;AAsCnB,OAAO,MAAMC,QAAQ,SAASH,UAAU,CAACI,aAAa,CAAC;EAGrD;AACF;AACA;AACA;AACA;EACEC,WAAWA,CAACC,KAAa,EAAEC,OAAgC,EAAE;IAAA,IAAAC,IAAA,EAAAC,iBAAA;IAC3D,IAAIH,KAAK,KAAKI,SAAS,EAAE;MACvB,MAAM,IAAIC,KAAK,CAAC,wBAAwB,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AE;YAAEH,IAAI,EAAE;cAAEC,IAAI,EAAE;YAAM;UAAE;QAAE;MAC/D;IACF,CAAC;IACD,GAAG,EAAE;MACHF,UAAU,EAAEnD,OAAO,CAACuE,UAAU;MAC9Bd,OAAO,EAAE;IACX;EACF,CAAC;EACDE,aAAa,EAAE,CAAC5D,UAAU,CAACK,KAAK,CAAC;EACjCwD,gBAAgB,EAAE,CAAC7D,UAAU,CAAC+D,MAAM,CAAC;EACrChB;AACF,CAAC"}
@@ -24,6 +24,7 @@ export interface CompileResult {
24
24
  /** Prefixed (cb_) Base64Check encoded byte array */
25
25
  bytecode: string;
26
26
  aci: Record<string, unknown>[];
27
+ warnings: CompilerError[];
27
28
  }
28
29
  export interface SophiaCallResultInput {
29
30
  /** (Possibly partial) Sophia contract code/interface */
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/apis/compiler/models/index.ts"],"sourcesContent":["import * as coreClient from \"@azure/core-client\";\n\nexport interface Contract {\n code: string;\n options?: CompileOpts;\n}\n\nexport interface CompileOpts {\n /** An explicit file system, mapping file names to file content */\n fileSystem?: Record<string, unknown>;\n /** Name of contract source file - only used in error messages */\n srcFile?: string;\n}\n\nexport interface CompilerError {\n type: string;\n pos: ErrorPos;\n message: string;\n context?: string;\n}\n\nexport interface ErrorPos {\n file?: string;\n line: number;\n col: number;\n}\n\nexport interface CompileResult {\n /** Prefixed (cb_) Base64Check encoded byte array */\n bytecode: string;\n aci: Record<string, unknown>[];\n}\n\nexport interface SophiaCallResultInput {\n /** (Possibly partial) Sophia contract code/interface */\n source: string;\n options?: CompileOpts;\n /** Name of the called function */\n function: string;\n /** Call result type (ok | revert | error) */\n callResult: string;\n /** Call result value (ABI encoded data or error string) */\n callValue: string;\n}\n\nexport interface BytecodeCallResultInput {\n /** Compiled contract */\n bytecode: string;\n /** Name of the called function */\n function: string;\n /** Call result type (ok | revert | error) */\n callResult: string;\n /** Call result value (ABI encoded data or error string) */\n callValue: string;\n}\n\nexport interface DecodedCallresult {\n function: string;\n /** Any object */\n result: Record<string, unknown>;\n}\n\nexport interface FunctionCallInput {\n /** (Possibly partial) Sophia contract code */\n source: string;\n options?: CompileOpts;\n /** Name of function to call */\n function: string;\n /** Array of function call arguments */\n arguments: string[];\n}\n\nexport interface Calldata {\n /** Prefixed (cb_) Base64Check encoded byte array */\n calldata: string;\n}\n\nexport interface DecodeCalldataBytecode {\n /** Calldata to dissect */\n calldata: string;\n /** Compiled contract */\n bytecode: string;\n}\n\nexport interface DecodedCalldata {\n function: string;\n arguments: Record<string, unknown>[];\n}\n\nexport interface ErrorModel {\n reason: string;\n}\n\nexport interface DecodeCalldataSource {\n /** (Possibly partial) Sophia contract code */\n source: string;\n options?: CompileOpts;\n /** Calldata to dissect */\n calldata: string;\n /** Name of the function to call */\n function: string;\n}\n\nexport interface ByteCodeInput {\n /** Compiled contract */\n bytecode: string;\n}\n\nexport interface FateAssembler {\n /** Fate assembler code */\n fateAssembler: string;\n}\n\nexport interface ValidateByteCodeInput {\n /** Compiled contract */\n bytecode: string;\n /** Sophia contract source code */\n source: string;\n options?: CompileOpts;\n}\n\nexport interface CompilerVersion {\n /** Sophia compiler version */\n version: string;\n}\n\nexport interface ApiVersion {\n /** API compiler version */\n apiVersion: string;\n}\n\nexport interface SophiaBinaryData {\n sophiaType: string;\n data: string;\n}\n\nexport interface SophiaJsonData {\n /** Any object */\n data: Record<string, unknown>;\n}\n\n/** Optional parameters. */\nexport interface GenerateACIOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the generateACI operation. */\nexport type GenerateACIResponse = Record<string, unknown>[];\n\n/** Optional parameters. */\nexport interface CompileContractOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the compileContract operation. */\nexport type CompileContractResponse = CompileResult;\n\n/** Optional parameters. */\nexport interface DecodeCallResultOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the decodeCallResult operation. */\nexport type DecodeCallResultResponse = {\n /** The parsed response body. */\n body: any;\n};\n\n/** Optional parameters. */\nexport interface DecodeCallResultBytecodeOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the decodeCallResultBytecode operation. */\nexport type DecodeCallResultBytecodeResponse = DecodedCallresult;\n\n/** Optional parameters. */\nexport interface EncodeCalldataOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the encodeCalldata operation. */\nexport type EncodeCalldataResponse = Calldata;\n\n/** Optional parameters. */\nexport interface DecodeCalldataBytecodeOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the decodeCalldataBytecode operation. */\nexport type DecodeCalldataBytecodeResponse = DecodedCalldata;\n\n/** Optional parameters. */\nexport interface DecodeCalldataSourceOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the decodeCalldataSource operation. */\nexport type DecodeCalldataSourceResponse = DecodedCalldata;\n\n/** Optional parameters. */\nexport interface GetFateAssemblerCodeOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the getFateAssemblerCode operation. */\nexport type GetFateAssemblerCodeResponse = FateAssembler;\n\n/** Optional parameters. */\nexport interface ValidateByteCodeOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface GetCompilerVersionOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the getCompilerVersion operation. */\nexport type GetCompilerVersionResponse = CompilerVersion;\n\n/** Optional parameters. */\nexport interface VersionOptionalParams extends coreClient.OperationOptions {}\n\n/** Contains response data for the version operation. */\nexport type VersionResponse = CompilerVersion;\n\n/** Optional parameters. */\nexport interface ApiVersionOptionalParams extends coreClient.OperationOptions {}\n\n/** Contains response data for the apiVersion operation. */\nexport type ApiVersionResponse = ApiVersion;\n\n/** Optional parameters. */\nexport interface ApiOptionalParams extends coreClient.OperationOptions {}\n\n/** Contains response data for the api operation. */\nexport type ApiResponse = Record<string, unknown>;\n\n/** Optional parameters. */\nexport interface CompilerOptionalParams\n extends coreClient.ServiceClientOptions {\n /** Overrides client endpoint. */\n endpoint?: string;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/apis/compiler/models/index.ts"],"sourcesContent":["import * as coreClient from \"@azure/core-client\";\n\nexport interface Contract {\n code: string;\n options?: CompileOpts;\n}\n\nexport interface CompileOpts {\n /** An explicit file system, mapping file names to file content */\n fileSystem?: Record<string, unknown>;\n /** Name of contract source file - only used in error messages */\n srcFile?: string;\n}\n\nexport interface CompilerError {\n type: string;\n pos: ErrorPos;\n message: string;\n context?: string;\n}\n\nexport interface ErrorPos {\n file?: string;\n line: number;\n col: number;\n}\n\nexport interface CompileResult {\n /** Prefixed (cb_) Base64Check encoded byte array */\n bytecode: string;\n aci: Record<string, unknown>[];\n warnings: CompilerError[];\n}\n\nexport interface SophiaCallResultInput {\n /** (Possibly partial) Sophia contract code/interface */\n source: string;\n options?: CompileOpts;\n /** Name of the called function */\n function: string;\n /** Call result type (ok | revert | error) */\n callResult: string;\n /** Call result value (ABI encoded data or error string) */\n callValue: string;\n}\n\nexport interface BytecodeCallResultInput {\n /** Compiled contract */\n bytecode: string;\n /** Name of the called function */\n function: string;\n /** Call result type (ok | revert | error) */\n callResult: string;\n /** Call result value (ABI encoded data or error string) */\n callValue: string;\n}\n\nexport interface DecodedCallresult {\n function: string;\n /** Any object */\n result: Record<string, unknown>;\n}\n\nexport interface FunctionCallInput {\n /** (Possibly partial) Sophia contract code */\n source: string;\n options?: CompileOpts;\n /** Name of function to call */\n function: string;\n /** Array of function call arguments */\n arguments: string[];\n}\n\nexport interface Calldata {\n /** Prefixed (cb_) Base64Check encoded byte array */\n calldata: string;\n}\n\nexport interface DecodeCalldataBytecode {\n /** Calldata to dissect */\n calldata: string;\n /** Compiled contract */\n bytecode: string;\n}\n\nexport interface DecodedCalldata {\n function: string;\n arguments: Record<string, unknown>[];\n}\n\nexport interface ErrorModel {\n reason: string;\n}\n\nexport interface DecodeCalldataSource {\n /** (Possibly partial) Sophia contract code */\n source: string;\n options?: CompileOpts;\n /** Calldata to dissect */\n calldata: string;\n /** Name of the function to call */\n function: string;\n}\n\nexport interface ByteCodeInput {\n /** Compiled contract */\n bytecode: string;\n}\n\nexport interface FateAssembler {\n /** Fate assembler code */\n fateAssembler: string;\n}\n\nexport interface ValidateByteCodeInput {\n /** Compiled contract */\n bytecode: string;\n /** Sophia contract source code */\n source: string;\n options?: CompileOpts;\n}\n\nexport interface CompilerVersion {\n /** Sophia compiler version */\n version: string;\n}\n\nexport interface ApiVersion {\n /** API compiler version */\n apiVersion: string;\n}\n\nexport interface SophiaBinaryData {\n sophiaType: string;\n data: string;\n}\n\nexport interface SophiaJsonData {\n /** Any object */\n data: Record<string, unknown>;\n}\n\n/** Optional parameters. */\nexport interface GenerateACIOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the generateACI operation. */\nexport type GenerateACIResponse = Record<string, unknown>[];\n\n/** Optional parameters. */\nexport interface CompileContractOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the compileContract operation. */\nexport type CompileContractResponse = CompileResult;\n\n/** Optional parameters. */\nexport interface DecodeCallResultOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the decodeCallResult operation. */\nexport type DecodeCallResultResponse = {\n /** The parsed response body. */\n body: any;\n};\n\n/** Optional parameters. */\nexport interface DecodeCallResultBytecodeOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the decodeCallResultBytecode operation. */\nexport type DecodeCallResultBytecodeResponse = DecodedCallresult;\n\n/** Optional parameters. */\nexport interface EncodeCalldataOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the encodeCalldata operation. */\nexport type EncodeCalldataResponse = Calldata;\n\n/** Optional parameters. */\nexport interface DecodeCalldataBytecodeOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the decodeCalldataBytecode operation. */\nexport type DecodeCalldataBytecodeResponse = DecodedCalldata;\n\n/** Optional parameters. */\nexport interface DecodeCalldataSourceOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the decodeCalldataSource operation. */\nexport type DecodeCalldataSourceResponse = DecodedCalldata;\n\n/** Optional parameters. */\nexport interface GetFateAssemblerCodeOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the getFateAssemblerCode operation. */\nexport type GetFateAssemblerCodeResponse = FateAssembler;\n\n/** Optional parameters. */\nexport interface ValidateByteCodeOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface GetCompilerVersionOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the getCompilerVersion operation. */\nexport type GetCompilerVersionResponse = CompilerVersion;\n\n/** Optional parameters. */\nexport interface VersionOptionalParams extends coreClient.OperationOptions {}\n\n/** Contains response data for the version operation. */\nexport type VersionResponse = CompilerVersion;\n\n/** Optional parameters. */\nexport interface ApiVersionOptionalParams extends coreClient.OperationOptions {}\n\n/** Contains response data for the apiVersion operation. */\nexport type ApiVersionResponse = ApiVersion;\n\n/** Optional parameters. */\nexport interface ApiOptionalParams extends coreClient.OperationOptions {}\n\n/** Contains response data for the api operation. */\nexport type ApiResponse = Record<string, unknown>;\n\n/** Optional parameters. */\nexport interface CompilerOptionalParams\n extends coreClient.ServiceClientOptions {\n /** Overrides client endpoint. */\n endpoint?: string;\n}\n"],"mappings":""}
@@ -136,6 +136,19 @@ export const CompileResult = {
136
136
  }
137
137
  }
138
138
  }
139
+ },
140
+ warnings: {
141
+ serializedName: "warnings",
142
+ required: true,
143
+ type: {
144
+ name: "Sequence",
145
+ element: {
146
+ type: {
147
+ name: "Composite",
148
+ className: "CompilerError"
149
+ }
150
+ }
151
+ }
139
152
  }
140
153
  }
141
154
  }