@aeternity/aepp-sdk 13.0.0-alpha.0 → 13.0.0-beta.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 (481) hide show
  1. package/bin/aesophia_cli +0 -0
  2. package/dist/aepp-sdk.browser-script.js +1 -1
  3. package/dist/aepp-sdk.browser-script.js.map +1 -1
  4. package/dist/aepp-sdk.browser.js +1 -1
  5. package/dist/aepp-sdk.browser.js.map +1 -1
  6. package/dist/aepp-sdk.js +5595 -2249
  7. package/dist/aepp-sdk.js.map +1 -1
  8. package/es/AeSdk.mjs.map +1 -1
  9. package/es/AeSdkAepp.mjs.map +1 -1
  10. package/es/AeSdkBase.d.ts +3 -3
  11. package/es/AeSdkBase.mjs +4 -0
  12. package/es/AeSdkBase.mjs.map +1 -1
  13. package/es/AeSdkMethods.d.ts +12 -14
  14. package/es/AeSdkMethods.mjs +6 -8
  15. package/es/AeSdkMethods.mjs.map +1 -1
  16. package/es/AeSdkWallet.mjs +1 -1
  17. package/es/AeSdkWallet.mjs.map +1 -1
  18. package/es/Node.d.ts +9 -4
  19. package/es/Node.mjs +12 -6
  20. package/es/Node.mjs.map +1 -1
  21. package/es/account/Base.d.ts +13 -8
  22. package/es/account/Base.mjs +0 -17
  23. package/es/account/Base.mjs.map +1 -1
  24. package/es/account/Generalized.mjs +14 -25
  25. package/es/account/Generalized.mjs.map +1 -1
  26. package/es/account/Ledger.mjs +2 -1
  27. package/es/account/Ledger.mjs.map +1 -1
  28. package/es/account/LedgerFactory.mjs.map +1 -1
  29. package/es/account/Memory.d.ts +2 -1
  30. package/es/account/Memory.mjs +11 -22
  31. package/es/account/Memory.mjs.map +1 -1
  32. package/es/account/Rpc.mjs.map +1 -1
  33. package/es/aens.d.ts +12 -14
  34. package/es/aens.mjs +22 -32
  35. package/es/aens.mjs.map +1 -1
  36. package/es/aepp-wallet-communication/connection/Browser.mjs +0 -16
  37. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
  38. package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +1 -0
  39. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +19 -20
  40. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
  41. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +0 -16
  42. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
  43. package/es/aepp-wallet-communication/connection-proxy.mjs +0 -17
  44. package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
  45. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +5 -6
  46. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
  47. package/es/aepp-wallet-communication/rpc/types.d.ts +6 -2
  48. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
  49. package/es/aepp-wallet-communication/schema.mjs.map +1 -1
  50. package/es/aepp-wallet-communication/wallet-detector.mjs +0 -16
  51. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
  52. package/es/apis/compiler/compiler.d.ts +1 -1
  53. package/es/apis/compiler/compiler.mjs +4 -20
  54. package/es/apis/compiler/compiler.mjs.map +1 -1
  55. package/es/apis/compiler/models/index.d.ts +3 -2
  56. package/es/apis/compiler/models/index.mjs.map +1 -1
  57. package/es/apis/compiler/models/mappers.d.ts +1 -1
  58. package/es/apis/compiler/models/mappers.mjs +19 -2
  59. package/es/apis/compiler/models/mappers.mjs.map +1 -1
  60. package/es/apis/node/models/index.d.ts +15 -15
  61. package/es/apis/node/models/index.mjs.map +1 -1
  62. package/es/apis/node/models/mappers.d.ts +1 -1
  63. package/es/apis/node/models/mappers.mjs +2 -1
  64. package/es/apis/node/models/mappers.mjs.map +1 -1
  65. package/es/apis/node/models/parameters.d.ts +2 -2
  66. package/es/apis/node/models/parameters.mjs +2 -2
  67. package/es/apis/node/models/parameters.mjs.map +1 -1
  68. package/es/apis/node/node.mjs +3 -19
  69. package/es/apis/node/node.mjs.map +1 -1
  70. package/es/chain.d.ts +17 -9
  71. package/es/chain.mjs +23 -23
  72. package/es/chain.mjs.map +1 -1
  73. package/es/channel/Base.d.ts +27 -9
  74. package/es/channel/Base.mjs +27 -27
  75. package/es/channel/Base.mjs.map +1 -1
  76. package/es/channel/Contract.d.ts +8 -7
  77. package/es/channel/Contract.mjs +8 -21
  78. package/es/channel/Contract.mjs.map +1 -1
  79. package/es/channel/Spend.d.ts +5 -1
  80. package/es/channel/Spend.mjs +4 -18
  81. package/es/channel/Spend.mjs.map +1 -1
  82. package/es/channel/handlers.mjs +16 -26
  83. package/es/channel/handlers.mjs.map +1 -1
  84. package/es/channel/internal.d.ts +19 -2
  85. package/es/channel/internal.mjs +22 -20
  86. package/es/channel/internal.mjs.map +1 -1
  87. package/es/contract/Contract.d.ts +43 -123
  88. package/es/contract/Contract.mjs +230 -250
  89. package/es/contract/Contract.mjs.map +1 -1
  90. package/es/contract/compiler/Base.d.ts +74 -0
  91. package/es/contract/compiler/Base.mjs +5 -0
  92. package/es/contract/compiler/Base.mjs.map +1 -0
  93. package/es/contract/compiler/Cli.d.ts +23 -0
  94. package/es/contract/compiler/Cli.mjs +149 -0
  95. package/es/contract/compiler/Cli.mjs.map +1 -0
  96. package/es/contract/compiler/Http.d.ts +32 -0
  97. package/es/contract/compiler/Http.mjs +94 -0
  98. package/es/contract/compiler/Http.mjs.map +1 -0
  99. package/es/contract/compiler/HttpNode.d.ts +17 -0
  100. package/es/contract/compiler/HttpNode.mjs +26 -0
  101. package/es/contract/compiler/HttpNode.mjs.map +1 -0
  102. package/es/contract/compiler/getFileSystem.d.ts +6 -0
  103. package/es/contract/compiler/getFileSystem.mjs +40 -0
  104. package/es/contract/compiler/getFileSystem.mjs.map +1 -0
  105. package/es/contract/delegation-signature.d.ts +43 -0
  106. package/es/contract/delegation-signature.mjs +45 -0
  107. package/es/contract/delegation-signature.mjs.map +1 -0
  108. package/es/contract/ga.d.ts +27 -10
  109. package/es/contract/ga.mjs +63 -29
  110. package/es/contract/ga.mjs.map +1 -1
  111. package/es/index-browser.d.ts +40 -0
  112. package/es/index-browser.mjs +41 -0
  113. package/es/index-browser.mjs.map +1 -0
  114. package/es/index.d.ts +4 -38
  115. package/es/index.mjs +4 -53
  116. package/es/index.mjs.map +1 -1
  117. package/es/oracle.d.ts +12 -17
  118. package/es/oracle.mjs +29 -49
  119. package/es/oracle.mjs.map +1 -1
  120. package/es/spend.d.ts +19 -27
  121. package/es/spend.mjs +21 -46
  122. package/es/spend.mjs.map +1 -1
  123. package/es/tx/builder/SchemaTypes.d.ts +37 -0
  124. package/es/tx/builder/SchemaTypes.mjs +2 -0
  125. package/es/tx/builder/SchemaTypes.mjs.map +1 -0
  126. package/es/tx/builder/constants.d.ts +31 -2
  127. package/es/tx/builder/constants.mjs +34 -3
  128. package/es/tx/builder/constants.mjs.map +1 -1
  129. package/es/tx/builder/field-types/abi-version.d.ts +19 -0
  130. package/es/tx/builder/field-types/abi-version.mjs +40 -0
  131. package/es/tx/builder/field-types/abi-version.mjs.map +1 -0
  132. package/es/tx/builder/field-types/address.d.ts +5 -6
  133. package/es/tx/builder/field-types/address.mjs +17 -8
  134. package/es/tx/builder/field-types/address.mjs.map +1 -1
  135. package/es/tx/builder/field-types/array.d.ts +7 -0
  136. package/es/tx/builder/field-types/array.mjs +11 -0
  137. package/es/tx/builder/field-types/array.mjs.map +1 -0
  138. package/es/tx/builder/field-types/boolean.d.ts +6 -0
  139. package/es/tx/builder/field-types/boolean.mjs +13 -0
  140. package/es/tx/builder/field-types/boolean.mjs.map +1 -0
  141. package/es/tx/builder/field-types/coin-amount.d.ts +4 -5
  142. package/es/tx/builder/field-types/coin-amount.mjs +4 -5
  143. package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
  144. package/es/tx/builder/field-types/ct-version.d.ts +49 -0
  145. package/es/tx/builder/field-types/ct-version.mjs +76 -0
  146. package/es/tx/builder/field-types/ct-version.mjs.map +1 -0
  147. package/es/tx/builder/field-types/deposit.d.ts +3 -2
  148. package/es/tx/builder/field-types/deposit.mjs +3 -2
  149. package/es/tx/builder/field-types/deposit.mjs.map +1 -1
  150. package/es/tx/builder/field-types/encoded.d.ts +6 -0
  151. package/es/tx/builder/field-types/encoded.mjs +21 -0
  152. package/es/tx/builder/field-types/encoded.mjs.map +1 -0
  153. package/es/tx/builder/field-types/entry.d.ts +11 -0
  154. package/es/tx/builder/field-types/entry.mjs +34 -0
  155. package/es/tx/builder/field-types/entry.mjs.map +1 -0
  156. package/es/tx/builder/field-types/enumeration.d.ts +5 -3
  157. package/es/tx/builder/field-types/enumeration.mjs +11 -2
  158. package/es/tx/builder/field-types/enumeration.mjs.map +1 -1
  159. package/es/tx/builder/field-types/fee.d.ts +12 -7
  160. package/es/tx/builder/field-types/fee.mjs +28 -20
  161. package/es/tx/builder/field-types/fee.mjs.map +1 -1
  162. package/es/tx/builder/field-types/field.mjs.map +1 -1
  163. package/es/tx/builder/field-types/gas-limit.d.ts +7 -3
  164. package/es/tx/builder/field-types/gas-limit.mjs +13 -8
  165. package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
  166. package/es/tx/builder/field-types/gas-price.d.ts +3 -1
  167. package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
  168. package/es/tx/builder/field-types/index.d.ts +107 -30
  169. package/es/tx/builder/field-types/index.mjs +38 -12
  170. package/es/tx/builder/field-types/index.mjs.map +1 -1
  171. package/es/tx/builder/field-types/map.d.ts +13 -0
  172. package/es/tx/builder/field-types/map.mjs +49 -0
  173. package/es/tx/builder/field-types/map.mjs.map +1 -0
  174. package/es/tx/builder/field-types/mptree.d.ts +42 -0
  175. package/es/tx/builder/field-types/mptree.mjs +266 -0
  176. package/es/tx/builder/field-types/mptree.mjs.map +1 -0
  177. package/es/tx/builder/field-types/name-fee.d.ts +2 -3
  178. package/es/tx/builder/field-types/name-fee.mjs +2 -2
  179. package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
  180. package/es/tx/builder/field-types/name-id.mjs +2 -1
  181. package/es/tx/builder/field-types/name-id.mjs.map +1 -1
  182. package/es/tx/builder/field-types/name.mjs.map +1 -1
  183. package/es/tx/builder/field-types/nonce.d.ts +14 -0
  184. package/es/tx/builder/field-types/nonce.mjs +29 -0
  185. package/es/tx/builder/field-types/nonce.mjs.map +1 -0
  186. package/es/tx/builder/field-types/pointers.mjs +2 -2
  187. package/es/tx/builder/field-types/pointers.mjs.map +1 -1
  188. package/es/tx/builder/field-types/raw.d.ts +6 -0
  189. package/es/tx/builder/field-types/raw.mjs +13 -0
  190. package/es/tx/builder/field-types/raw.mjs.map +1 -0
  191. package/es/tx/builder/field-types/short-u-int-const.d.ts +7 -0
  192. package/es/tx/builder/field-types/short-u-int-const.mjs +20 -0
  193. package/es/tx/builder/field-types/short-u-int-const.mjs.map +1 -0
  194. package/es/tx/builder/field-types/short-u-int.mjs.map +1 -1
  195. package/es/tx/builder/field-types/string.d.ts +6 -0
  196. package/es/tx/builder/field-types/string.mjs +10 -0
  197. package/es/tx/builder/field-types/string.mjs.map +1 -0
  198. package/es/tx/builder/field-types/ttl.d.ts +11 -0
  199. package/es/tx/builder/field-types/ttl.mjs +21 -0
  200. package/es/tx/builder/field-types/ttl.mjs.map +1 -0
  201. package/es/tx/builder/field-types/u-int.d.ts +1 -2
  202. package/es/tx/builder/field-types/u-int.mjs.map +1 -1
  203. package/es/tx/builder/field-types/wrapped.d.ts +14 -0
  204. package/es/tx/builder/field-types/wrapped.mjs +22 -0
  205. package/es/tx/builder/field-types/wrapped.mjs.map +1 -0
  206. package/es/tx/builder/helpers.mjs.map +1 -1
  207. package/es/tx/builder/index.d.ts +18 -36
  208. package/es/tx/builder/index.mjs +65 -236
  209. package/es/tx/builder/index.mjs.map +1 -1
  210. package/es/tx/builder/schema.d.ts +2734 -1324
  211. package/es/tx/builder/schema.generated.d.ts +2011 -0
  212. package/es/tx/builder/schema.generated.mjs +2 -0
  213. package/es/tx/builder/schema.generated.mjs.map +1 -0
  214. package/es/tx/builder/schema.mjs +459 -223
  215. package/es/tx/builder/schema.mjs.map +1 -1
  216. package/es/tx/execution-cost.d.ts +35 -0
  217. package/es/tx/execution-cost.mjs +123 -0
  218. package/es/tx/execution-cost.mjs.map +1 -0
  219. package/es/tx/transaction-signer.d.ts +6 -0
  220. package/es/tx/transaction-signer.mjs +27 -0
  221. package/es/tx/transaction-signer.mjs.map +1 -0
  222. package/es/tx/validator.d.ts +3 -5
  223. package/es/tx/validator.mjs +91 -153
  224. package/es/tx/validator.mjs.map +1 -1
  225. package/es/utils/amount-formatter.mjs +0 -16
  226. package/es/utils/amount-formatter.mjs.map +1 -1
  227. package/es/utils/autorest.d.ts +3 -2
  228. package/es/utils/autorest.mjs +43 -11
  229. package/es/utils/autorest.mjs.map +1 -1
  230. package/es/utils/bytes.mjs +1 -17
  231. package/es/utils/bytes.mjs.map +1 -1
  232. package/es/utils/crypto.mjs +0 -16
  233. package/es/utils/crypto.mjs.map +1 -1
  234. package/es/utils/encoder.mjs.map +1 -1
  235. package/es/utils/errors.d.ts +16 -38
  236. package/es/utils/errors.mjs +3 -43
  237. package/es/utils/errors.mjs.map +1 -1
  238. package/es/utils/hd-wallet.mjs.map +1 -1
  239. package/es/utils/json-big.mjs.map +1 -1
  240. package/es/utils/keystore.mjs.map +1 -1
  241. package/es/utils/other.mjs.map +1 -1
  242. package/es/utils/semver-satisfies.mjs.map +1 -1
  243. package/es/utils/string.mjs +0 -17
  244. package/es/utils/string.mjs.map +1 -1
  245. package/package.json +52 -40
  246. package/src/AeSdkBase.ts +6 -3
  247. package/src/AeSdkMethods.ts +12 -18
  248. package/src/AeSdkWallet.ts +1 -1
  249. package/src/Node.ts +23 -9
  250. package/src/account/Base.ts +13 -24
  251. package/src/account/Generalized.ts +9 -24
  252. package/src/account/Ledger.ts +1 -1
  253. package/src/account/Memory.ts +15 -22
  254. package/src/aens.ts +34 -49
  255. package/src/aepp-wallet-communication/connection/Browser.ts +0 -17
  256. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +18 -24
  257. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +0 -17
  258. package/src/aepp-wallet-communication/connection-proxy.ts +0 -17
  259. package/src/aepp-wallet-communication/rpc/RpcClient.ts +2 -2
  260. package/src/aepp-wallet-communication/rpc/types.ts +6 -2
  261. package/src/aepp-wallet-communication/wallet-detector.ts +0 -17
  262. package/src/apis/compiler/compiler.ts +3 -27
  263. package/src/apis/compiler/models/index.ts +3 -2
  264. package/src/apis/compiler/models/mappers.ts +15 -2
  265. package/src/apis/node/models/index.ts +16 -15
  266. package/src/apis/node/models/mappers.ts +2 -1
  267. package/src/apis/node/models/parameters.ts +2 -2
  268. package/src/apis/node/node.ts +3 -27
  269. package/src/chain.ts +33 -30
  270. package/src/channel/Base.ts +39 -31
  271. package/src/channel/Contract.ts +18 -32
  272. package/src/channel/Spend.ts +8 -18
  273. package/src/channel/handlers.ts +14 -26
  274. package/src/channel/internal.ts +41 -23
  275. package/src/contract/Contract.ts +188 -228
  276. package/src/contract/compiler/Base.ts +87 -0
  277. package/src/contract/compiler/Cli.ts +128 -0
  278. package/src/contract/compiler/Http.ts +105 -0
  279. package/src/contract/compiler/HttpNode.ts +26 -0
  280. package/src/contract/compiler/getFileSystem.ts +42 -0
  281. package/src/contract/delegation-signature.ts +56 -0
  282. package/src/contract/ga.ts +61 -37
  283. package/src/index-browser.ts +50 -0
  284. package/src/index.ts +4 -56
  285. package/src/oracle.ts +47 -57
  286. package/src/spend.ts +34 -68
  287. package/src/tx/builder/SchemaTypes.ts +79 -0
  288. package/src/tx/builder/constants.ts +34 -3
  289. package/src/tx/builder/field-types/abi-version.ts +44 -0
  290. package/src/tx/builder/field-types/address.ts +23 -13
  291. package/src/tx/builder/field-types/array.ts +19 -0
  292. package/src/tx/builder/field-types/boolean.ts +9 -0
  293. package/src/tx/builder/field-types/coin-amount.ts +8 -5
  294. package/src/tx/builder/field-types/ct-version.ts +83 -0
  295. package/src/tx/builder/field-types/deposit.ts +4 -2
  296. package/src/tx/builder/field-types/encoded.ts +27 -0
  297. package/src/tx/builder/field-types/entry.ts +36 -0
  298. package/src/tx/builder/field-types/enumeration.ts +15 -4
  299. package/src/tx/builder/field-types/fee.ts +41 -19
  300. package/src/tx/builder/field-types/gas-limit.ts +13 -8
  301. package/src/tx/builder/field-types/index.ts +60 -17
  302. package/src/tx/builder/field-types/map.ts +45 -0
  303. package/src/tx/builder/field-types/mptree.ts +243 -0
  304. package/src/tx/builder/field-types/name-fee.ts +3 -3
  305. package/src/tx/builder/field-types/name-id.ts +1 -1
  306. package/src/tx/builder/field-types/nonce.ts +40 -0
  307. package/src/tx/builder/field-types/pointers.ts +2 -2
  308. package/src/tx/builder/field-types/raw.ts +9 -0
  309. package/src/tx/builder/field-types/short-u-int-const.ts +30 -0
  310. package/src/tx/builder/field-types/string.ts +11 -0
  311. package/src/tx/builder/field-types/ttl.ts +24 -0
  312. package/src/tx/builder/field-types/u-int.ts +1 -3
  313. package/src/tx/builder/field-types/wrapped.ts +32 -0
  314. package/src/tx/builder/index.ts +82 -280
  315. package/src/tx/builder/schema.generated.ts +2013 -0
  316. package/src/tx/builder/schema.ts +536 -666
  317. package/src/tx/execution-cost.ts +146 -0
  318. package/src/tx/transaction-signer.ts +27 -0
  319. package/src/tx/validator.ts +100 -154
  320. package/src/utils/amount-formatter.ts +0 -16
  321. package/src/utils/autorest.ts +52 -11
  322. package/src/utils/bytes.ts +1 -17
  323. package/src/utils/crypto.ts +0 -16
  324. package/src/utils/errors.ts +18 -56
  325. package/src/utils/string.ts +0 -17
  326. package/types-legacy/ts4.2/AeSdkBase.d.ts +3 -3
  327. package/types-legacy/ts4.2/AeSdkMethods.d.ts +12 -14
  328. package/types-legacy/ts4.2/Node.d.ts +8 -4
  329. package/types-legacy/ts4.2/account/Base.d.ts +13 -8
  330. package/types-legacy/ts4.2/account/Memory.d.ts +2 -1
  331. package/types-legacy/ts4.2/aens.d.ts +12 -14
  332. package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserRuntime.d.ts +1 -0
  333. package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +6 -2
  334. package/types-legacy/ts4.2/apis/compiler/compiler.d.ts +1 -1
  335. package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +3 -2
  336. package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +1 -1
  337. package/types-legacy/ts4.2/apis/node/models/index.d.ts +15 -15
  338. package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +1 -1
  339. package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +2 -2
  340. package/types-legacy/ts4.2/chain.d.ts +17 -9
  341. package/types-legacy/ts4.2/channel/Base.d.ts +27 -9
  342. package/types-legacy/ts4.2/channel/Contract.d.ts +8 -7
  343. package/types-legacy/ts4.2/channel/Spend.d.ts +5 -1
  344. package/types-legacy/ts4.2/channel/internal.d.ts +22 -2
  345. package/types-legacy/ts4.2/contract/Contract.d.ts +42 -122
  346. package/types-legacy/ts4.2/contract/compiler/Base.d.ts +74 -0
  347. package/types-legacy/ts4.2/contract/compiler/Cli.d.ts +23 -0
  348. package/types-legacy/ts4.2/contract/compiler/Http.d.ts +32 -0
  349. package/types-legacy/ts4.2/contract/compiler/HttpNode.d.ts +17 -0
  350. package/types-legacy/ts4.2/contract/compiler/getFileSystem.d.ts +6 -0
  351. package/types-legacy/ts4.2/contract/delegation-signature.d.ts +43 -0
  352. package/types-legacy/ts4.2/contract/ga.d.ts +27 -10
  353. package/types-legacy/ts4.2/index-browser.d.ts +40 -0
  354. package/types-legacy/ts4.2/index.d.ts +4 -38
  355. package/types-legacy/ts4.2/oracle.d.ts +12 -17
  356. package/types-legacy/ts4.2/spend.d.ts +19 -27
  357. package/types-legacy/ts4.2/tx/builder/SchemaTypes.d.ts +37 -0
  358. package/types-legacy/ts4.2/tx/builder/constants.d.ts +31 -2
  359. package/types-legacy/ts4.2/tx/builder/field-types/abi-version.d.ts +19 -0
  360. package/types-legacy/ts4.2/tx/builder/field-types/address.d.ts +11 -12
  361. package/types-legacy/ts4.2/tx/builder/field-types/array.d.ts +7 -0
  362. package/types-legacy/ts4.2/tx/builder/field-types/boolean.d.ts +6 -0
  363. package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +4 -5
  364. package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +72 -0
  365. package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +3 -2
  366. package/types-legacy/ts4.2/tx/builder/field-types/encoded.d.ts +6 -0
  367. package/types-legacy/ts4.2/tx/builder/field-types/entry.d.ts +11 -0
  368. package/types-legacy/ts4.2/tx/builder/field-types/enumeration.d.ts +5 -3
  369. package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +12 -7
  370. package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +7 -3
  371. package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +3 -1
  372. package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +113 -30
  373. package/types-legacy/ts4.2/tx/builder/field-types/map.d.ts +13 -0
  374. package/types-legacy/ts4.2/tx/builder/field-types/mptree.d.ts +48 -0
  375. package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +2 -3
  376. package/types-legacy/ts4.2/tx/builder/field-types/nonce.d.ts +14 -0
  377. package/types-legacy/ts4.2/tx/builder/field-types/raw.d.ts +6 -0
  378. package/types-legacy/ts4.2/tx/builder/field-types/short-u-int-const.d.ts +7 -0
  379. package/types-legacy/ts4.2/tx/builder/field-types/string.d.ts +6 -0
  380. package/types-legacy/ts4.2/tx/builder/field-types/ttl.d.ts +11 -0
  381. package/types-legacy/ts4.2/tx/builder/field-types/u-int.d.ts +1 -2
  382. package/types-legacy/ts4.2/tx/builder/field-types/wrapped.d.ts +14 -0
  383. package/types-legacy/ts4.2/tx/builder/index.d.ts +21 -36
  384. package/types-legacy/ts4.2/tx/builder/schema.d.ts +2971 -2926
  385. package/types-legacy/ts4.2/tx/builder/schema.generated.d.ts +2011 -0
  386. package/types-legacy/ts4.2/tx/execution-cost.d.ts +35 -0
  387. package/types-legacy/ts4.2/tx/transaction-signer.d.ts +6 -0
  388. package/types-legacy/ts4.2/tx/validator.d.ts +3 -5
  389. package/types-legacy/ts4.2/utils/autorest.d.ts +3 -2
  390. package/types-legacy/ts4.2/utils/errors.d.ts +16 -38
  391. package/types-legacy/ts4.5/AeSdkBase.d.ts +3 -3
  392. package/types-legacy/ts4.5/AeSdkMethods.d.ts +12 -14
  393. package/types-legacy/ts4.5/Node.d.ts +8 -4
  394. package/types-legacy/ts4.5/account/Base.d.ts +13 -8
  395. package/types-legacy/ts4.5/account/Memory.d.ts +2 -1
  396. package/types-legacy/ts4.5/aens.d.ts +12 -14
  397. package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserRuntime.d.ts +1 -0
  398. package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +6 -2
  399. package/types-legacy/ts4.5/apis/compiler/compiler.d.ts +1 -1
  400. package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +3 -2
  401. package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +1 -1
  402. package/types-legacy/ts4.5/apis/node/models/index.d.ts +15 -15
  403. package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +1 -1
  404. package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +2 -2
  405. package/types-legacy/ts4.5/chain.d.ts +17 -9
  406. package/types-legacy/ts4.5/channel/Base.d.ts +27 -9
  407. package/types-legacy/ts4.5/channel/Contract.d.ts +8 -7
  408. package/types-legacy/ts4.5/channel/Spend.d.ts +5 -1
  409. package/types-legacy/ts4.5/channel/internal.d.ts +22 -2
  410. package/types-legacy/ts4.5/contract/Contract.d.ts +42 -122
  411. package/types-legacy/ts4.5/contract/compiler/Base.d.ts +74 -0
  412. package/types-legacy/ts4.5/contract/compiler/Cli.d.ts +23 -0
  413. package/types-legacy/ts4.5/contract/compiler/Http.d.ts +32 -0
  414. package/types-legacy/ts4.5/contract/compiler/HttpNode.d.ts +17 -0
  415. package/types-legacy/ts4.5/contract/compiler/getFileSystem.d.ts +6 -0
  416. package/types-legacy/ts4.5/contract/delegation-signature.d.ts +43 -0
  417. package/types-legacy/ts4.5/contract/ga.d.ts +27 -10
  418. package/types-legacy/ts4.5/index-browser.d.ts +40 -0
  419. package/types-legacy/ts4.5/index.d.ts +4 -38
  420. package/types-legacy/ts4.5/oracle.d.ts +12 -17
  421. package/types-legacy/ts4.5/spend.d.ts +19 -27
  422. package/types-legacy/ts4.5/tx/builder/SchemaTypes.d.ts +37 -0
  423. package/types-legacy/ts4.5/tx/builder/constants.d.ts +31 -2
  424. package/types-legacy/ts4.5/tx/builder/field-types/abi-version.d.ts +19 -0
  425. package/types-legacy/ts4.5/tx/builder/field-types/address.d.ts +11 -12
  426. package/types-legacy/ts4.5/tx/builder/field-types/array.d.ts +7 -0
  427. package/types-legacy/ts4.5/tx/builder/field-types/boolean.d.ts +6 -0
  428. package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +4 -5
  429. package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +72 -0
  430. package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +3 -2
  431. package/types-legacy/ts4.5/tx/builder/field-types/encoded.d.ts +6 -0
  432. package/types-legacy/ts4.5/tx/builder/field-types/entry.d.ts +11 -0
  433. package/types-legacy/ts4.5/tx/builder/field-types/enumeration.d.ts +5 -3
  434. package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +12 -7
  435. package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +7 -3
  436. package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +3 -1
  437. package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +113 -30
  438. package/types-legacy/ts4.5/tx/builder/field-types/map.d.ts +13 -0
  439. package/types-legacy/ts4.5/tx/builder/field-types/mptree.d.ts +48 -0
  440. package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +2 -3
  441. package/types-legacy/ts4.5/tx/builder/field-types/nonce.d.ts +14 -0
  442. package/types-legacy/ts4.5/tx/builder/field-types/raw.d.ts +6 -0
  443. package/types-legacy/ts4.5/tx/builder/field-types/short-u-int-const.d.ts +7 -0
  444. package/types-legacy/ts4.5/tx/builder/field-types/string.d.ts +6 -0
  445. package/types-legacy/ts4.5/tx/builder/field-types/ttl.d.ts +11 -0
  446. package/types-legacy/ts4.5/tx/builder/field-types/u-int.d.ts +1 -2
  447. package/types-legacy/ts4.5/tx/builder/field-types/wrapped.d.ts +14 -0
  448. package/types-legacy/ts4.5/tx/builder/index.d.ts +21 -36
  449. package/types-legacy/ts4.5/tx/builder/schema.d.ts +2971 -2926
  450. package/types-legacy/ts4.5/tx/builder/schema.generated.d.ts +2011 -0
  451. package/types-legacy/ts4.5/tx/execution-cost.d.ts +35 -0
  452. package/types-legacy/ts4.5/tx/transaction-signer.d.ts +6 -0
  453. package/types-legacy/ts4.5/tx/validator.d.ts +3 -5
  454. package/types-legacy/ts4.5/utils/autorest.d.ts +3 -2
  455. package/types-legacy/ts4.5/utils/errors.d.ts +16 -38
  456. package/es/contract/CompilerHttp.d.ts +0 -18
  457. package/es/contract/CompilerHttp.mjs +0 -63
  458. package/es/contract/CompilerHttp.mjs.map +0 -1
  459. package/es/tx/builder/field-types/addresses.d.ts +0 -6
  460. package/es/tx/builder/field-types/addresses.mjs +0 -13
  461. package/es/tx/builder/field-types/addresses.mjs.map +0 -1
  462. package/es/tx/index.d.ts +0 -34
  463. package/es/tx/index.mjs +0 -172
  464. package/es/tx/index.mjs.map +0 -1
  465. package/es/utils/mptree.d.ts +0 -26
  466. package/es/utils/mptree.mjs +0 -143
  467. package/es/utils/mptree.mjs.map +0 -1
  468. package/src/apis/compiler/code-model-v4.yaml +0 -2442
  469. package/src/apis/node/code-model-v4.yaml +0 -10080
  470. package/src/contract/CompilerHttp.ts +0 -67
  471. package/src/tx/builder/field-types/addresses.ts +0 -18
  472. package/src/tx/index.ts +0 -196
  473. package/src/utils/mptree.ts +0 -145
  474. package/types-legacy/ts4.2/contract/CompilerHttp.d.ts +0 -18
  475. package/types-legacy/ts4.2/tx/builder/field-types/addresses.d.ts +0 -6
  476. package/types-legacy/ts4.2/tx/index.d.ts +0 -34
  477. package/types-legacy/ts4.2/utils/mptree.d.ts +0 -32
  478. package/types-legacy/ts4.5/contract/CompilerHttp.d.ts +0 -18
  479. package/types-legacy/ts4.5/tx/builder/field-types/addresses.d.ts +0 -6
  480. package/types-legacy/ts4.5/tx/index.d.ts +0 -34
  481. package/types-legacy/ts4.5/utils/mptree.d.ts +0 -32
@@ -1 +1 @@
1
- {"version":3,"file":"aepp-sdk.browser.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,6BAA8BA,QAAQ,UAAWA,QAAQ,gBAAiBA,QAAQ,sBAAuBA,QAAQ,OAAQA,QAAQ,QAASA,QAAQ,aAAcA,QAAQ,mBAAoBA,QAAQ,mBAAoBA,QAAQ,qBAAsBA,QAAQ,kBAAmBA,QAAQ,cAAeA,QAAQ,UAAWA,QAAQ,4BAA6BA,QAAQ,eAAgBA,QAAQ,UAAWA,QAAQ,cAC3Z,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,4BAA6B,SAAU,eAAgB,qBAAsB,MAAO,OAAQ,YAAa,kBAAmB,kBAAmB,oBAAqB,iBAAkB,aAAc,SAAU,2BAA4B,cAAe,SAAU,aAAcJ,GAC/P,iBAAZC,QACdA,QAAmB,UAAID,EAAQG,QAAQ,6BAA8BA,QAAQ,UAAWA,QAAQ,gBAAiBA,QAAQ,sBAAuBA,QAAQ,OAAQA,QAAQ,QAASA,QAAQ,aAAcA,QAAQ,mBAAoBA,QAAQ,mBAAoBA,QAAQ,qBAAsBA,QAAQ,kBAAmBA,QAAQ,cAAeA,QAAQ,UAAWA,QAAQ,4BAA6BA,QAAQ,eAAgBA,QAAQ,UAAWA,QAAQ,cA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AClBhN,KAAKq5B,KAAKkxB,YAAYv9C,EACxB,CAEA6tC,cACE,OAAO76C,KAAKq5B,KAAKmuB,UAAU0D,cAC7B","sources":["webpack://Aeternity/webpack/universalModuleDefinition","webpack://Aeternity/./node_modules/blakejs/blake2b.js","webpack://Aeternity/./node_modules/blakejs/util.js","webpack://Aeternity/./node_modules/core-js-pure/actual/object/define-property.js","webpack://Aeternity/./node_modules/core-js-pure/es/object/define-property.js","webpack://Aeternity/./node_modules/core-js-pure/features/object/define-property.js","webpack://Aeternity/./node_modules/core-js-pure/full/object/define-property.js","webpack://Aeternity/./node_modules/core-js-pure/internals/a-callable.js","webpack://Aeternity/./node_modules/core-js-pure/internals/an-object.js","webpack://Aeternity/./node_modules/core-js-pure/internals/classof-raw.js","webpack://Aeternity/./node_modules/core-js-pure/internals/create-non-enumerable-property.js","webpack://Aeternity/./node_modules/core-js-pure/internals/create-property-descriptor.js","webpack://Aeternity/./node_modules/core-js-pure/internals/define-global-property.js","webpack://Aeternity/./node_modules/core-js-pure/internals/descriptors.js","webpack://Aeternity/./node_modules/core-js-pure/internals/document-all.js","webpack://Aeternity/./node_modules/core-js-pure/internals/document-create-element.js","webpack://Aeternity/./node_modules/core-js-pure/internals/engine-user-agent.js","webpack://Aeternity/./node_modules/core-js-pure/internals/engine-v8-version.js","webpack://Aeternity/./node_modules/core-js-pure/internals/export.js","webpack://Aeternity/./node_modules/core-js-pure/internals/fails.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-apply.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-bind-context.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-bind-native.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-call.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-uncurry-this-clause.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-uncurry-this.js","webpack://Aeternity/./node_modules/core-js-pure/internals/get-built-in.js","webpack://Aeternity/./node_modules/core-js-pure/internals/get-method.js","webpack://Aeternity/./node_modules/core-js-pure/internals/global.js","webpack://Aeternity/./node_modules/core-js-pure/internals/has-own-property.js","webpack://Aeternity/./node_modules/core-js-pure/internals/ie8-dom-define.js","webpack://Aeternity/./node_modules/core-js-pure/internals/indexed-object.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-callable.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-forced.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-null-or-undefined.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-object.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-pure.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-symbol.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-define-property.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-is-prototype-of.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-property-is-enumerable.js","webpack://Aeternity/./node_modules/core-js-pure/internals/ordinary-to-primitive.js","webpack://Aeternity/./node_modules/core-js-pure/internals/path.js","webpack://Aeternity/./node_modules/core-js-pure/internals/require-object-coercible.js","webpack://Aeternity/./node_modules/core-js-pure/internals/shared-store.js","webpack://Aeternity/./node_modules/core-js-pure/internals/shared.js","webpack://Aeternity/./node_modules/core-js-pure/internals/symbol-constructor-detection.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-indexed-object.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-object.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-primitive.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-property-key.js","webpack://Aeternity/./node_modules/core-js-pure/internals/try-to-string.js","webpack://Aeternity/./node_modules/core-js-pure/internals/uid.js","webpack://Aeternity/./node_modules/core-js-pure/internals/use-symbol-as-uid.js","webpack://Aeternity/./node_modules/core-js-pure/internals/v8-prototype-define-bug.js","webpack://Aeternity/./node_modules/core-js-pure/internals/well-known-symbol.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.object.define-property.js","webpack://Aeternity/./node_modules/core-js-pure/stable/object/define-property.js","webpack://Aeternity/./node_modules/inherits/inherits_browser.js","webpack://Aeternity/./node_modules/safe-buffer/index.js","webpack://Aeternity/./node_modules/sha.js/hash.js","webpack://Aeternity/./node_modules/sha.js/sha256.js","webpack://Aeternity/external umd \"@aeternity/aepp-calldata\"","webpack://Aeternity/external umd \"@aeternity/argon2\"","webpack://Aeternity/external umd \"@aeternity/uuid\"","webpack://Aeternity/external umd \"@azure/core-client\"","webpack://Aeternity/external umd \"@azure/core-rest-pipeline\"","webpack://Aeternity/external umd \"aes-js\"","webpack://Aeternity/external umd \"bignumber.js\"","webpack://Aeternity/external umd \"bip32-path\"","webpack://Aeternity/external umd \"bs58\"","webpack://Aeternity/external umd \"buffer\"","webpack://Aeternity/external umd \"events\"","webpack://Aeternity/external umd \"json-bigint\"","webpack://Aeternity/external umd \"rlp\"","webpack://Aeternity/external umd \"tweetnacl\"","webpack://Aeternity/external umd \"tweetnacl-auth\"","webpack://Aeternity/external umd \"varuint-bitcoin\"","webpack://Aeternity/external umd \"websocket\"","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/core-js/object/define-property.js","webpack://Aeternity/webpack/bootstrap","webpack://Aeternity/webpack/runtime/compat get default export","webpack://Aeternity/webpack/runtime/define property getters","webpack://Aeternity/webpack/runtime/global","webpack://Aeternity/webpack/runtime/hasOwnProperty shorthand","webpack://Aeternity/webpack/runtime/make namespace object","webpack://Aeternity/./src/utils/bignumber.ts","webpack://Aeternity/./src/utils/errors.ts","webpack://Aeternity/./src/utils/amount-formatter.ts","webpack://Aeternity/./src/utils/other.ts","webpack://Aeternity/./src/utils/encoder-types.ts","webpack://Aeternity/./src/utils/encoder.ts","webpack://Aeternity/./src/utils/crypto.ts","webpack://Aeternity/./src/tx/builder/constants.ts","webpack://Aeternity/./src/utils/bytes.ts","webpack://Aeternity/./src/tx/builder/helpers.ts","webpack://Aeternity/./src/tx/builder/field-types/u-int.ts","webpack://Aeternity/./src/tx/builder/field-types/short-u-int.ts","webpack://Aeternity/./src/tx/builder/field-types/coin-amount.ts","webpack://Aeternity/./src/tx/builder/field-types/address.ts","webpack://Aeternity/./src/tx/builder/field-types/deposit.ts","webpack://Aeternity/./src/tx/builder/field-types/fee.ts","webpack://Aeternity/./src/tx/builder/field-types/gas-limit.ts","webpack://Aeternity/./src/tx/builder/field-types/gas-price.ts","webpack://Aeternity/./src/tx/builder/field-types/field.ts","webpack://Aeternity/./src/tx/builder/field-types/name.ts","webpack://Aeternity/./src/tx/builder/field-types/name-fee.ts","webpack://Aeternity/./src/tx/builder/field-types/name-id.ts","webpack://Aeternity/./src/tx/builder/field-types/pointers.ts","webpack://Aeternity/./src/tx/builder/field-types/index.ts","webpack://Aeternity/./src/tx/builder/field-types/addresses.ts","webpack://Aeternity/./src/tx/builder/field-types/enumeration.ts","webpack://Aeternity/./src/tx/builder/schema.ts","webpack://Aeternity/./src/utils/mptree.ts","webpack://Aeternity/./src/tx/builder/index.ts","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/classExtractFieldDescriptor.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/classPrivateFieldGet.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/classApplyDescriptorGet.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/classPrivateFieldSet.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/classApplyDescriptorSet.js","webpack://Aeternity/./src/utils/semver-satisfies.ts","webpack://Aeternity/./src/utils/autorest.ts","webpack://Aeternity/./src/apis/node/models/mappers.ts","webpack://Aeternity/./src/apis/node/models/parameters.ts","webpack://Aeternity/./src/apis/node/node.ts","webpack://Aeternity/./src/Node.ts","webpack://Aeternity/./src/tx/validator.ts","webpack://Aeternity/./src/chain.ts","webpack://Aeternity/./src/utils/keystore.ts","webpack://Aeternity/./src/tx/index.ts","webpack://Aeternity/./src/utils/hd-wallet.ts","webpack://Aeternity/./src/spend.ts","webpack://Aeternity/./src/aens.ts","webpack://Aeternity/./src/contract/Contract.ts","webpack://Aeternity/./src/oracle.ts","webpack://Aeternity/./src/contract/ga.ts","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/defineProperty.js","webpack://Aeternity/./src/AeSdkMethods.ts","webpack://Aeternity/./src/AeSdkBase.ts","webpack://Aeternity/./src/AeSdk.ts","webpack://Aeternity/./src/account/Base.ts","webpack://Aeternity/./src/aepp-wallet-communication/schema.ts","webpack://Aeternity/./src/account/Rpc.ts","webpack://Aeternity/./src/aepp-wallet-communication/rpc/RpcClient.ts","webpack://Aeternity/./src/AeSdkAepp.ts","webpack://Aeternity/./src/aepp-wallet-communication/rpc/types.ts","webpack://Aeternity/./src/utils/json-big.ts","webpack://Aeternity/./src/AeSdkWallet.ts","webpack://Aeternity/./src/account/Memory.ts","webpack://Aeternity/./src/account/Generalized.ts","webpack://Aeternity/./src/account/Ledger.ts","webpack://Aeternity/./src/account/LedgerFactory.ts","webpack://Aeternity/./src/apis/compiler/models/mappers.ts","webpack://Aeternity/./src/apis/compiler/models/parameters.ts","webpack://Aeternity/./src/apis/compiler/compiler.ts","webpack://Aeternity/./src/contract/CompilerHttp.ts","webpack://Aeternity/./src/utils/string.ts","webpack://Aeternity/./src/channel/internal.ts","webpack://Aeternity/./src/channel/handlers.ts","webpack://Aeternity/./src/channel/Base.ts","webpack://Aeternity/./src/channel/Spend.ts","webpack://Aeternity/./src/channel/Contract.ts","webpack://Aeternity/./src/aepp-wallet-communication/connection-proxy.ts","webpack://Aeternity/./src/aepp-wallet-communication/connection/Browser.ts","webpack://Aeternity/./src/aepp-wallet-communication/connection/BrowserWindowMessage.ts","webpack://Aeternity/./src/aepp-wallet-communication/wallet-detector.ts","webpack://Aeternity/./src/aepp-wallet-communication/connection/BrowserRuntime.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@azure/core-rest-pipeline\"), require(\"buffer\"), require(\"bignumber.js\"), require(\"@azure/core-client\"), require(\"rlp\"), require(\"bs58\"), require(\"tweetnacl\"), require(\"varuint-bitcoin\"), require(\"@aeternity/uuid\"), require(\"@aeternity/argon2\"), require(\"tweetnacl-auth\"), require(\"bip32-path\"), require(\"aes-js\"), require(\"@aeternity/aepp-calldata\"), require(\"json-bigint\"), require(\"events\"), require(\"websocket\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@azure/core-rest-pipeline\", \"buffer\", \"bignumber.js\", \"@azure/core-client\", \"rlp\", \"bs58\", \"tweetnacl\", \"varuint-bitcoin\", \"@aeternity/uuid\", \"@aeternity/argon2\", \"tweetnacl-auth\", \"bip32-path\", \"aes-js\", \"@aeternity/aepp-calldata\", \"json-bigint\", \"events\", \"websocket\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Aeternity\"] = factory(require(\"@azure/core-rest-pipeline\"), require(\"buffer\"), require(\"bignumber.js\"), require(\"@azure/core-client\"), require(\"rlp\"), require(\"bs58\"), require(\"tweetnacl\"), require(\"varuint-bitcoin\"), require(\"@aeternity/uuid\"), require(\"@aeternity/argon2\"), require(\"tweetnacl-auth\"), require(\"bip32-path\"), require(\"aes-js\"), require(\"@aeternity/aepp-calldata\"), require(\"json-bigint\"), require(\"events\"), require(\"websocket\"));\n\telse\n\t\troot[\"Aeternity\"] = factory(root[\"@azure/core-rest-pipeline\"], root[\"buffer\"], root[\"bignumber.js\"], root[\"@azure/core-client\"], root[\"rlp\"], root[\"bs58\"], root[\"tweetnacl\"], root[\"varuint-bitcoin\"], root[\"@aeternity/uuid\"], root[\"@aeternity/argon2\"], root[\"tweetnacl-auth\"], root[\"bip32-path\"], root[\"aes-js\"], root[\"@aeternity/aepp-calldata\"], root[\"json-bigint\"], root[\"events\"], root[\"websocket\"]);\n})(self, function(__WEBPACK_EXTERNAL_MODULE__5039__, __WEBPACK_EXTERNAL_MODULE__9408__, __WEBPACK_EXTERNAL_MODULE__5192__, __WEBPACK_EXTERNAL_MODULE__4711__, __WEBPACK_EXTERNAL_MODULE__3485__, __WEBPACK_EXTERNAL_MODULE__3783__, __WEBPACK_EXTERNAL_MODULE__79__, __WEBPACK_EXTERNAL_MODULE__7480__, __WEBPACK_EXTERNAL_MODULE__3983__, __WEBPACK_EXTERNAL_MODULE__7417__, __WEBPACK_EXTERNAL_MODULE__9882__, __WEBPACK_EXTERNAL_MODULE__1986__, __WEBPACK_EXTERNAL_MODULE__8236__, __WEBPACK_EXTERNAL_MODULE__7946__, __WEBPACK_EXTERNAL_MODULE__2716__, __WEBPACK_EXTERNAL_MODULE__3735__, __WEBPACK_EXTERNAL_MODULE__8079__) {\nreturn ","// Blake2B in pure Javascript\n// Adapted from the reference implementation in RFC7693\n// Ported to Javascript by DC - https://github.com/dcposch\n\nconst util = require('./util')\n\n// 64-bit unsigned addition\n// Sets v[a,a+1] += v[b,b+1]\n// v should be a Uint32Array\nfunction ADD64AA (v, a, b) {\n const o0 = v[a] + v[b]\n let o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}\n\n// 64-bit unsigned addition\n// Sets v[a,a+1] += b\n// b0 is the low 32 bits of b, b1 represents the high 32 bits\nfunction ADD64AC (v, a, b0, b1) {\n let o0 = v[a] + b0\n if (b0 < 0) {\n o0 += 0x100000000\n }\n let o1 = v[a + 1] + b1\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}\n\n// Little-endian byte access\nfunction B2B_GET32 (arr, i) {\n return arr[i] ^ (arr[i + 1] << 8) ^ (arr[i + 2] << 16) ^ (arr[i + 3] << 24)\n}\n\n// G Mixing function\n// The ROTRs are inlined for speed\nfunction B2B_G (a, b, c, d, ix, iy) {\n const x0 = m[ix]\n const x1 = m[ix + 1]\n const y0 = m[iy]\n const y1 = m[iy + 1]\n\n ADD64AA(v, a, b) // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s\n ADD64AC(v, a, x0, x1) // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits\n let xor0 = v[d] ^ v[a]\n let xor1 = v[d + 1] ^ v[a + 1]\n v[d] = xor1\n v[d + 1] = xor0\n\n ADD64AA(v, c, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor0 >>> 24) ^ (xor1 << 8)\n v[b + 1] = (xor1 >>> 24) ^ (xor0 << 8)\n\n ADD64AA(v, a, b)\n ADD64AC(v, a, y0, y1)\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits\n xor0 = v[d] ^ v[a]\n xor1 = v[d + 1] ^ v[a + 1]\n v[d] = (xor0 >>> 16) ^ (xor1 << 16)\n v[d + 1] = (xor1 >>> 16) ^ (xor0 << 16)\n\n ADD64AA(v, c, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor1 >>> 31) ^ (xor0 << 1)\n v[b + 1] = (xor0 >>> 31) ^ (xor1 << 1)\n}\n\n// Initialization Vector\nconst BLAKE2B_IV32 = new Uint32Array([\n 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372,\n 0x5f1d36f1, 0xa54ff53a, 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c,\n 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19\n])\n\nconst SIGMA8 = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13,\n 6, 1, 12, 0, 2, 11, 7, 5, 3, 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1,\n 9, 4, 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, 9, 0, 5, 7, 2, 4,\n 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5,\n 15, 14, 1, 9, 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, 13, 11, 7,\n 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, 6, 15, 14, 9, 11, 3, 0, 8, 12, 2,\n 13, 7, 1, 4, 10, 5, 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, 0,\n 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13, 6,\n 1, 12, 0, 2, 11, 7, 5, 3\n]\n\n// These are offsets into a uint64 buffer.\n// Multiply them all by 2 to make them offsets into a uint32 buffer,\n// because this is Javascript and we don't have uint64s\nconst SIGMA82 = new Uint8Array(\n SIGMA8.map(function (x) {\n return x * 2\n })\n)\n\n// Compression function. 'last' flag indicates last block.\n// Note we're representing 16 uint64s as 32 uint32s\nconst v = new Uint32Array(32)\nconst m = new Uint32Array(32)\nfunction blake2bCompress (ctx, last) {\n let i = 0\n\n // init work variables\n for (i = 0; i < 16; i++) {\n v[i] = ctx.h[i]\n v[i + 16] = BLAKE2B_IV32[i]\n }\n\n // low 64 bits of offset\n v[24] = v[24] ^ ctx.t\n v[25] = v[25] ^ (ctx.t / 0x100000000)\n // high 64 bits not supported, offset may not be higher than 2**53-1\n\n // last block flag set ?\n if (last) {\n v[28] = ~v[28]\n v[29] = ~v[29]\n }\n\n // get little-endian words\n for (i = 0; i < 32; i++) {\n m[i] = B2B_GET32(ctx.b, 4 * i)\n }\n\n // twelve rounds of mixing\n // uncomment the DebugPrint calls to log the computation\n // and match the RFC sample documentation\n // util.debugPrint(' m[16]', m, 64)\n for (i = 0; i < 12; i++) {\n // util.debugPrint(' (i=' + (i < 10 ? ' ' : '') + i + ') v[16]', v, 64)\n B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1])\n B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3])\n B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5])\n B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7])\n B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9])\n B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11])\n B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13])\n B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15])\n }\n // util.debugPrint(' (i=12) v[16]', v, 64)\n\n for (i = 0; i < 16; i++) {\n ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16]\n }\n // util.debugPrint('h[8]', ctx.h, 64)\n}\n\n// reusable parameterBlock\nconst parameterBlock = new Uint8Array([\n 0,\n 0,\n 0,\n 0, // 0: outlen, keylen, fanout, depth\n 0,\n 0,\n 0,\n 0, // 4: leaf length, sequential mode\n 0,\n 0,\n 0,\n 0, // 8: node offset\n 0,\n 0,\n 0,\n 0, // 12: node offset\n 0,\n 0,\n 0,\n 0, // 16: node depth, inner length, rfu\n 0,\n 0,\n 0,\n 0, // 20: rfu\n 0,\n 0,\n 0,\n 0, // 24: rfu\n 0,\n 0,\n 0,\n 0, // 28: rfu\n 0,\n 0,\n 0,\n 0, // 32: salt\n 0,\n 0,\n 0,\n 0, // 36: salt\n 0,\n 0,\n 0,\n 0, // 40: salt\n 0,\n 0,\n 0,\n 0, // 44: salt\n 0,\n 0,\n 0,\n 0, // 48: personal\n 0,\n 0,\n 0,\n 0, // 52: personal\n 0,\n 0,\n 0,\n 0, // 56: personal\n 0,\n 0,\n 0,\n 0 // 60: personal\n])\n\n// Creates a BLAKE2b hashing context\n// Requires an output length between 1 and 64 bytes\n// Takes an optional Uint8Array key\n// Takes an optinal Uint8Array salt\n// Takes an optinal Uint8Array personal\nfunction blake2bInit (outlen, key, salt, personal) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n if (salt && salt.length !== 16) {\n throw new Error('Illegal salt, expected Uint8Array with length is 16')\n }\n if (personal && personal.length !== 16) {\n throw new Error('Illegal personal, expected Uint8Array with length is 16')\n }\n\n // state, 'param block'\n const ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n }\n\n // initialize parameterBlock before usage\n parameterBlock.fill(0)\n parameterBlock[0] = outlen\n if (key) parameterBlock[1] = key.length\n parameterBlock[2] = 1 // fanout\n parameterBlock[3] = 1 // depth\n if (salt) parameterBlock.set(salt, 32)\n if (personal) parameterBlock.set(personal, 48)\n\n // initialize hash state\n for (let i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4)\n }\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key)\n // at the end\n ctx.c = 128\n }\n\n return ctx\n}\n\n// Updates a BLAKE2b streaming hash\n// Requires hash context and Uint8Array (byte array)\nfunction blake2bUpdate (ctx, input) {\n for (let i = 0; i < input.length; i++) {\n if (ctx.c === 128) {\n // buffer full ?\n ctx.t += ctx.c // add counters\n blake2bCompress(ctx, false) // compress (not last)\n ctx.c = 0 // counter to zero\n }\n ctx.b[ctx.c++] = input[i]\n }\n}\n\n// Completes a BLAKE2b streaming hash\n// Returns a Uint8Array containing the message digest\nfunction blake2bFinal (ctx) {\n ctx.t += ctx.c // mark last block offset\n\n while (ctx.c < 128) {\n // fill up with zeros\n ctx.b[ctx.c++] = 0\n }\n blake2bCompress(ctx, true) // final block flag = 1\n\n // little endian convert and store\n const out = new Uint8Array(ctx.outlen)\n for (let i = 0; i < ctx.outlen; i++) {\n out[i] = ctx.h[i >> 2] >> (8 * (i & 3))\n }\n return out\n}\n\n// Computes the BLAKE2B hash of a string or byte array, and returns a Uint8Array\n//\n// Returns a n-byte Uint8Array\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer or Uint8Array\n// - key - optional key Uint8Array, up to 64 bytes\n// - outlen - optional output length in bytes, default 64\n// - salt - optional salt bytes, string, Buffer or Uint8Array\n// - personal - optional personal bytes, string, Buffer or Uint8Array\nfunction blake2b (input, key, outlen, salt, personal) {\n // preprocess inputs\n outlen = outlen || 64\n input = util.normalizeInput(input)\n if (salt) {\n salt = util.normalizeInput(salt)\n }\n if (personal) {\n personal = util.normalizeInput(personal)\n }\n\n // do the math\n const ctx = blake2bInit(outlen, key, salt, personal)\n blake2bUpdate(ctx, input)\n return blake2bFinal(ctx)\n}\n\n// Computes the BLAKE2B hash of a string or byte array\n//\n// Returns an n-byte hash in hex, all lowercase\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer, or Uint8Array\n// - key - optional key Uint8Array, up to 64 bytes\n// - outlen - optional output length in bytes, default 64\n// - salt - optional salt bytes, string, Buffer or Uint8Array\n// - personal - optional personal bytes, string, Buffer or Uint8Array\nfunction blake2bHex (input, key, outlen, salt, personal) {\n const output = blake2b(input, key, outlen, salt, personal)\n return util.toHex(output)\n}\n\nmodule.exports = {\n blake2b: blake2b,\n blake2bHex: blake2bHex,\n blake2bInit: blake2bInit,\n blake2bUpdate: blake2bUpdate,\n blake2bFinal: blake2bFinal\n}\n","const ERROR_MSG_INPUT = 'Input must be an string, Buffer or Uint8Array'\n\n// For convenience, let people hash a string, not just a Uint8Array\nfunction normalizeInput (input) {\n let ret\n if (input instanceof Uint8Array) {\n ret = input\n } else if (typeof input === 'string') {\n const encoder = new TextEncoder()\n ret = encoder.encode(input)\n } else {\n throw new Error(ERROR_MSG_INPUT)\n }\n return ret\n}\n\n// Converts a Uint8Array to a hexadecimal string\n// For example, toHex([255, 0, 255]) returns \"ff00ff\"\nfunction toHex (bytes) {\n return Array.prototype.map\n .call(bytes, function (n) {\n return (n < 16 ? '0' : '') + n.toString(16)\n })\n .join('')\n}\n\n// Converts any value in [0...2^32-1] to an 8-character hex string\nfunction uint32ToHex (val) {\n return (0x100000000 + val).toString(16).substring(1)\n}\n\n// For debugging: prints out hash state in the same format as the RFC\n// sample computation exactly, so that you can diff\nfunction debugPrint (label, arr, size) {\n let msg = '\\n' + label + ' = '\n for (let i = 0; i < arr.length; i += 2) {\n if (size === 32) {\n msg += uint32ToHex(arr[i]).toUpperCase()\n msg += ' '\n msg += uint32ToHex(arr[i + 1]).toUpperCase()\n } else if (size === 64) {\n msg += uint32ToHex(arr[i + 1]).toUpperCase()\n msg += uint32ToHex(arr[i]).toUpperCase()\n } else throw new Error('Invalid size ' + size)\n if (i % 6 === 4) {\n msg += '\\n' + new Array(label.length + 4).join(' ')\n } else if (i < arr.length - 2) {\n msg += ' '\n }\n }\n console.log(msg)\n}\n\n// For performance testing: generates N bytes of input, hashes M times\n// Measures and prints MB/second hash performance each time\nfunction testSpeed (hashFn, N, M) {\n let startMs = new Date().getTime()\n\n const input = new Uint8Array(N)\n for (let i = 0; i < N; i++) {\n input[i] = i % 256\n }\n const genMs = new Date().getTime()\n console.log('Generated random input in ' + (genMs - startMs) + 'ms')\n startMs = genMs\n\n for (let i = 0; i < M; i++) {\n const hashHex = hashFn(input)\n const hashMs = new Date().getTime()\n const ms = hashMs - startMs\n startMs = hashMs\n console.log('Hashed in ' + ms + 'ms: ' + hashHex.substring(0, 20) + '...')\n console.log(\n Math.round((N / (1 << 20) / (ms / 1000)) * 100) / 100 + ' MB PER SECOND'\n )\n }\n}\n\nmodule.exports = {\n normalizeInput: normalizeInput,\n toHex: toHex,\n debugPrint: debugPrint,\n testSpeed: testSpeed\n}\n","var parent = require('../../stable/object/define-property');\n\nmodule.exports = parent;\n","require('../../modules/es.object.define-property');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nvar defineProperty = module.exports = function defineProperty(it, key, desc) {\n return Object.defineProperty(it, key, desc);\n};\n\nif (Object.defineProperty.sham) defineProperty.sham = true;\n","module.exports = require('../../full/object/define-property');\n","var parent = require('../../actual/object/define-property');\n\nmodule.exports = parent;\n","var isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a function');\n};\n","var isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw $TypeError($String(argument) + ' is not an object');\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var documentAll = typeof document == 'object' && document.all;\n\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\nvar IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;\n\nmodule.exports = {\n all: documentAll,\n IS_HTMLDDA: IS_HTMLDDA\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","'use strict';\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar isCallable = require('../internals/is-callable');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar isForced = require('../internals/is-forced');\nvar path = require('../internals/path');\nvar bind = require('../internals/function-bind-context');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof Wrapper) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return apply(NativeConstructor, this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;\n\n var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;\n\n // bind timers to global for call from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changs in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n createNonEnumerableProperty(target, key, resultProperty);\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);\n // export real prototype methods\n if (options.real && targetPrototype && !targetPrototype[key]) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n","var uncurryThis = require('../internals/function-uncurry-this-clause');\nvar aCallable = require('../internals/a-callable');\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","var classofRaw = require('../internals/classof-raw');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = function (fn) {\n // Nashorn bug:\n // https://github.com/zloirock/core-js/issues/1128\n // https://github.com/zloirock/core-js/issues/1130\n if (classofRaw(fn) === 'Function') return uncurryThis(fn);\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n","var path = require('../internals/path');\nvar global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (variable) {\n return isCallable(variable) ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n","var aCallable = require('../internals/a-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","var $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = $documentAll.IS_HTMLDDA ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n","var isCallable = require('../internals/is-callable');\nvar $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\nmodule.exports = $documentAll.IS_HTMLDDA ? function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;\n} : function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","module.exports = true;\n","var getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","var call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw $TypeError(\"Can't convert object to primitive value\");\n};\n","module.exports = {};\n","var isNullOrUndefined = require('../internals/is-null-or-undefined');\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var global = require('../internals/global');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.26.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n return !String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","var call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","var $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar symbolFor = Symbol && Symbol['for'];\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {\n var description = 'Symbol.' + name;\n if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {\n WellKnownSymbolsStore[name] = Symbol[name];\n } else if (USE_SYMBOL_AS_UID && symbolFor) {\n WellKnownSymbolsStore[name] = symbolFor(description);\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol(description);\n }\n } return WellKnownSymbolsStore[name];\n};\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar defineProperty = require('../internals/object-define-property').f;\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\n// eslint-disable-next-line es/no-object-defineproperty -- safe\n$({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {\n defineProperty: defineProperty\n});\n","var parent = require('../../es/object/define-property');\n\nmodule.exports = parent;\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","var Buffer = require('safe-buffer').Buffer\n\n// prototype class for hash functions\nfunction Hash (blockSize, finalSize) {\n this._block = Buffer.alloc(blockSize)\n this._finalSize = finalSize\n this._blockSize = blockSize\n this._len = 0\n}\n\nHash.prototype.update = function (data, enc) {\n if (typeof data === 'string') {\n enc = enc || 'utf8'\n data = Buffer.from(data, enc)\n }\n\n var block = this._block\n var blockSize = this._blockSize\n var length = data.length\n var accum = this._len\n\n for (var offset = 0; offset < length;) {\n var assigned = accum % blockSize\n var remainder = Math.min(length - offset, blockSize - assigned)\n\n for (var i = 0; i < remainder; i++) {\n block[assigned + i] = data[offset + i]\n }\n\n accum += remainder\n offset += remainder\n\n if ((accum % blockSize) === 0) {\n this._update(block)\n }\n }\n\n this._len += length\n return this\n}\n\nHash.prototype.digest = function (enc) {\n var rem = this._len % this._blockSize\n\n this._block[rem] = 0x80\n\n // zero (rem + 1) trailing bits, where (rem + 1) is the smallest\n // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize\n this._block.fill(0, rem + 1)\n\n if (rem >= this._finalSize) {\n this._update(this._block)\n this._block.fill(0)\n }\n\n var bits = this._len * 8\n\n // uint32\n if (bits <= 0xffffffff) {\n this._block.writeUInt32BE(bits, this._blockSize - 4)\n\n // uint64\n } else {\n var lowBits = (bits & 0xffffffff) >>> 0\n var highBits = (bits - lowBits) / 0x100000000\n\n this._block.writeUInt32BE(highBits, this._blockSize - 8)\n this._block.writeUInt32BE(lowBits, this._blockSize - 4)\n }\n\n this._update(this._block)\n var hash = this._hash()\n\n return enc ? hash.toString(enc) : hash\n}\n\nHash.prototype._update = function () {\n throw new Error('_update must be implemented by subclass')\n}\n\nmodule.exports = Hash\n","/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\n 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\n 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\n 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\n 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\n 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\n 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\n 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\n 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\n 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\n 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\n]\n\nvar W = new Array(64)\n\nfunction Sha256 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha256, Hash)\n\nSha256.prototype.init = function () {\n this._a = 0x6a09e667\n this._b = 0xbb67ae85\n this._c = 0x3c6ef372\n this._d = 0xa54ff53a\n this._e = 0x510e527f\n this._f = 0x9b05688c\n this._g = 0x1f83d9ab\n this._h = 0x5be0cd19\n\n return this\n}\n\nfunction ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)\n}\n\nfunction sigma1 (x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)\n}\n\nfunction gamma0 (x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)\n}\n\nfunction gamma1 (x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)\n}\n\nSha256.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n var f = this._f | 0\n var g = this._g | 0\n var h = this._h | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0\n\n for (var j = 0; j < 64; ++j) {\n var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0\n var T2 = (sigma0(a) + maj(a, b, c)) | 0\n\n h = g\n g = f\n f = e\n e = (d + T1) | 0\n d = c\n c = b\n b = a\n a = (T1 + T2) | 0\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n this._f = (f + this._f) | 0\n this._g = (g + this._g) | 0\n this._h = (h + this._h) | 0\n}\n\nSha256.prototype._hash = function () {\n var H = Buffer.allocUnsafe(32)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n H.writeInt32BE(this._h, 28)\n\n return H\n}\n\nmodule.exports = Sha256\n","module.exports = __WEBPACK_EXTERNAL_MODULE__7946__;","module.exports = __WEBPACK_EXTERNAL_MODULE__7417__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3983__;","module.exports = __WEBPACK_EXTERNAL_MODULE__4711__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5039__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8236__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5192__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1986__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3783__;","module.exports = __WEBPACK_EXTERNAL_MODULE__9408__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3735__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2716__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3485__;","module.exports = __WEBPACK_EXTERNAL_MODULE__79__;","module.exports = __WEBPACK_EXTERNAL_MODULE__9882__;","module.exports = __WEBPACK_EXTERNAL_MODULE__7480__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8079__;","module.exports = require(\"core-js-pure/features/object/define-property\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Big Number Helpers\n */\nimport BigNumber from 'bignumber.js';\n\n/**\n * Check if value is BigNumber, Number, BigInt or number string representation\n * @param number - number to check\n */\nexport const isBigNumber = (number: string | number | bigint | BigNumber): boolean => {\n if (typeof number === 'bigint') return true;\n return ['number', 'object', 'string'].includes(typeof number)\n // eslint-disable-next-line no-restricted-globals\n && (!isNaN(number as number) || Number.isInteger(number) || BigNumber.isBigNumber(number));\n};\n\n/**\n * BigNumber ceil operation\n */\nexport const ceil = (bigNumber: BigNumber): BigNumber => bigNumber\n .integerValue(BigNumber.ROUND_CEIL);\n","// eslint-disable-next-line max-classes-per-file\nimport BigNumber from 'bignumber.js';\n\n/**\n * aepp-sdk originated error\n * @category exception\n */\nexport abstract class BaseError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'BaseError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AccountError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AensError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AensError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AeppError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AeppError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelError';\n }\n}\n\n/**\n * @category exception\n */\nexport class CompilerError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'CompilerError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ContractError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'ContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class CryptographyError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'CryptographyError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'NodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TransactionError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'TransactionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class WalletError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'WalletError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ArgumentError extends BaseError {\n constructor(argumentName: string, requirement: string, argumentValue: any) {\n super(`${argumentName} should be ${requirement}, got ${String(argumentValue)} instead`);\n this.name = 'ArgumentError';\n }\n}\n\n/**\n * @category exception\n */\nexport class IllegalArgumentError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'IllegalArgumentError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ArgumentCountMismatchError extends BaseError {\n constructor(functionName: string, requiredCount: number, providedCount: number) {\n super(`${functionName} expects ${requiredCount} arguments, got ${providedCount} instead`);\n this.name = 'ArgumentCountMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InsufficientBalanceError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'InsufficientBalanceError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingParamError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingParamError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NoSerializerFoundError extends BaseError {\n constructor() {\n super('Byte serialization not supported');\n this.name = 'NoSerializerFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class RequestTimedOutError extends BaseError {\n constructor(height: number) {\n super(`Giving up at height ${height}`);\n this.name = 'RequestTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TxTimedOutError extends BaseError {\n constructor(blocks: number, th: string) {\n super([\n `Giving up after ${blocks} blocks mined`,\n `transaction hash: ${th}`,\n ].join(', '));\n this.name = 'TxTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TypeError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'TypeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedPlatformError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedPlatformError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedProtocolError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedProtocolError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NotImplementedError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'NotImplementedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedVersionError extends BaseError {\n constructor(dependency: string, version: string, geVersion: string, ltVersion: string) {\n super(`Unsupported ${dependency} version ${version}. Supported: >= ${geVersion} < ${ltVersion}`);\n this.name = 'UnsupportedVersionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InternalError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'InternalError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnexpectedTsError extends InternalError {\n constructor(message = 'Expected to not happen, required for TS') {\n super(message);\n this.name = 'UnexpectedTsError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnavailableAccountError extends AccountError {\n constructor(address: string) {\n super(`Account for ${address} not available`);\n this.name = 'UnavailableAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AensPointerContextError extends AensError {\n constructor(nameOrId: string, prefix: string) {\n super(`Name ${nameOrId} don't have pointers for ${prefix}`);\n this.name = 'AensPointerContextError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InsufficientNameFeeError extends AensError {\n constructor(nameFee: BigNumber, minNameFee: BigNumber) {\n super(`the provided fee ${nameFee.toString()} is not enough to execute the claim, required: ${minNameFee.toString()}`);\n this.name = 'InsufficientNameFeeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidAensNameError extends AensError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidAensNameError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidRpcMessageError extends AeppError {\n constructor(message: string) {\n super(`Received invalid message: ${message}`);\n this.name = 'InvalidRpcMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingCallbackError extends AeppError {\n constructor(id: number) {\n super(`Can't find callback for this messageId ${id}`);\n this.name = 'MissingCallbackError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnAuthorizedAccountError extends AeppError {\n constructor(onAccount: string) {\n super(`You do not have access to account ${onAccount}`);\n this.name = 'UnAuthorizedAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownRpcClientError extends AeppError {\n constructor(id: string) {\n super(`RpcClient with id ${id} do not exist`);\n this.name = 'UnknownRpcClientError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsubscribedAccountError extends AeppError {\n constructor() {\n super('You are not subscribed for an account.');\n this.name = 'UnsubscribedAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelCallError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelCallError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelConnectionError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelConnectionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelPingTimedOutError extends ChannelError {\n constructor() {\n super('Server pong timed out');\n this.name = 'ChannelPingTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnexpectedChannelMessageError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'UnexpectedChannelMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelIncomingMessageError extends ChannelError {\n handlerError: BaseError;\n\n incomingMessage: { [key: string]: any };\n\n constructor(handlerError: BaseError, incomingMessage: { [key: string]: any }) {\n super(handlerError.message);\n this.handlerError = handlerError;\n this.incomingMessage = incomingMessage;\n this.name = 'ChannelIncomingMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownChannelStateError extends ChannelError {\n constructor() {\n super('State Channels FSM entered unknown state');\n this.name = 'UnknownChannelStateError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidAuthDataError extends CompilerError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidAuthDataError';\n }\n}\n\n/**\n * @category exception\n */\nexport class BytecodeMismatchError extends ContractError {\n constructor(source: string) {\n super(`Contract ${source} do not correspond to the bytecode deployed on the chain`);\n this.name = 'BytecodeMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DuplicateContractError extends ContractError {\n constructor() {\n super('Contract already deployed');\n this.name = 'DuplicateContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InactiveContractError extends ContractError {\n constructor(contractAddress: string) {\n super(`Contract with address ${contractAddress} not active`);\n this.name = 'InactiveContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidMethodInvocationError extends ContractError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidMethodInvocationError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingContractAddressError extends ContractError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingContractAddressError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingContractDefError extends ContractError {\n constructor() {\n super('Either ACI or source code is required');\n this.name = 'MissingContractDefError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingFunctionNameError extends ContractError {\n constructor() {\n super('Function name is required');\n this.name = 'MissingFunctionNameError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeInvocationError extends ContractError {\n transaction: string;\n\n constructor(message: string, transaction: string) {\n super(`Invocation failed${message == null ? '' : `: \"${message}\"`}`);\n this.name = 'NodeInvocationError';\n this.transaction = transaction;\n }\n}\n\n/**\n * @category exception\n */\nexport class NoSuchContractFunctionError extends ContractError {\n constructor(name: string) {\n super(`Function ${name} doesn't exist in contract`);\n this.name = 'NoSuchContractFunctionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NotPayableFunctionError extends ContractError {\n constructor(amount: string, fn: string) {\n super(\n `You try to pay \"${amount}\" to function \"${fn}\" which is not payable. `\n + 'Only payable function can accept coins',\n );\n this.name = 'NotPayableFunctionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingEventDefinitionError extends ContractError {\n constructor(eventNameHash: string, eventAddress: string) {\n super(\n `Can't find definition of ${eventNameHash} event emitted by ${eventAddress}`\n + ' (use omitUnknown option to ignore events like this)',\n );\n this.name = 'MissingEventDefinitionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AmbiguousEventDefinitionError extends ContractError {\n constructor(eventAddress: string, matchedEvents: Array<[string, string]>) {\n super(\n `Found multiple definitions of \"${matchedEvents[0][1]}\" event with different types emitted by`\n + ` ${eventAddress} in ${matchedEvents.map(([name]) => `\"${name}\"`).join(', ')} contracts`\n + ' (use contractAddressToName option to specify contract name corresponding to address)',\n );\n this.name = 'AmbiguousEventDefinitionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidChecksumError extends CryptographyError {\n constructor() {\n super('Invalid checksum');\n this.name = 'InvalidChecksumError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidPasswordError extends CryptographyError {\n constructor() {\n super('Invalid password or nonce');\n this.name = 'InvalidPasswordError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MerkleTreeHashMismatchError extends CryptographyError {\n constructor() {\n super('Node hash is not equal to provided one');\n this.name = 'MerkleTreeHashMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingNodeInTreeError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingNodeInTreeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownNodeLengthError extends CryptographyError {\n constructor(nodeLength: number) {\n super(`Unknown node length: ${nodeLength}`);\n this.name = 'UnknownNodeLengthError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownPathNibbleError extends CryptographyError {\n constructor(nibble: number) {\n super(`Unknown path nibble: ${nibble}`);\n this.name = 'UnknownPathNibbleError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DuplicateNodeError extends NodeError {\n constructor(name: string) {\n super(`Node with name ${name} already exist`);\n this.name = 'DuplicateNodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeNotFoundError extends NodeError {\n constructor(message: string) {\n super(message);\n this.name = 'NodeNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DecodeError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'DecodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class PayloadLengthError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'PayloadLengthError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DryRunError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'DryRunError';\n }\n}\n\n/**\n * @category exception\n */\nexport class IllegalBidFeeError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'IllegalBidFeeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidSignatureError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidSignatureError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidTxParamsError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidTxParamsError';\n }\n}\n\n/**\n * @category exception\n */\nexport class PrefixNotFoundError extends TransactionError {\n constructor(tag: number) {\n super(`Prefix for id-tag ${tag} not found.`);\n this.name = 'PrefixNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class SchemaNotFoundError extends TransactionError {\n constructor(schemaName: string, key: string, version: number) {\n super(`Transaction ${schemaName} not implemented for ${key} version ${version}`);\n this.name = 'SchemaNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TagNotFoundError extends TransactionError {\n constructor(prefix: string) {\n super(`Id tag for prefix ${prefix} not found.`);\n this.name = 'DecodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TxNotInChainError extends TransactionError {\n constructor(txHash: string) {\n super(`Transaction ${txHash} is removed from chain`);\n this.name = 'TxNotInChainError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownTxError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'UnknownTxError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedABIversionError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedABIversionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedVMversionError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedVMversionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AlreadyConnectedError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'AlreadyConnectedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NoWalletConnectedError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'NoWalletConnectedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class RpcConnectionError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'RpcConnectionError';\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport { isBigNumber } from './bignumber';\nimport { ArgumentError } from './errors';\n\nexport enum AE_AMOUNT_FORMATS {\n AE = 'ae',\n MILI_AE = 'miliAE',\n MICRO_AE = 'microAE',\n NANO_AE = 'nanoAE',\n PICO_AE = 'picoAE',\n FEMTO_AE = 'femtoAE',\n AETTOS = 'aettos',\n}\n\n/**\n * DENOMINATION_MAGNITUDE\n */\nconst DENOMINATION_MAGNITUDE = {\n [AE_AMOUNT_FORMATS.AE]: 0,\n [AE_AMOUNT_FORMATS.MILI_AE]: -3,\n [AE_AMOUNT_FORMATS.MICRO_AE]: -6,\n [AE_AMOUNT_FORMATS.NANO_AE]: -9,\n [AE_AMOUNT_FORMATS.PICO_AE]: -12,\n [AE_AMOUNT_FORMATS.FEMTO_AE]: -15,\n [AE_AMOUNT_FORMATS.AETTOS]: -18,\n} as const;\n\n/**\n * Convert amount from one to other denomination\n * @param value - amount to convert\n * @param options - options\n * @param options.denomination - denomination of amount, can be ['ae', 'aettos']\n * @param options.targetDenomination - target denomination,\n * can be ['ae', 'aettos']\n */\nexport const formatAmount = (\n value: string | number | bigint | BigNumber,\n { denomination = AE_AMOUNT_FORMATS.AETTOS, targetDenomination = AE_AMOUNT_FORMATS.AETTOS }:\n { denomination?: AE_AMOUNT_FORMATS; targetDenomination?: AE_AMOUNT_FORMATS },\n): string => {\n if (!isBigNumber(value)) throw new ArgumentError('value', 'a number', value);\n\n return new BigNumber(typeof value === 'bigint' ? value.toString() : value)\n .shiftedBy(DENOMINATION_MAGNITUDE[denomination] - DENOMINATION_MAGNITUDE[targetDenomination])\n .toFixed();\n};\n\n/**\n * Convert amount to AE\n * @param value - amount to convert\n * @param options - options\n * @param options.denomination - denomination of amount, can be ['ae', 'aettos']\n */\nexport const toAe = (\n value: string | number | BigNumber,\n { denomination = AE_AMOUNT_FORMATS.AETTOS }: { denomination?: AE_AMOUNT_FORMATS } = {},\n): string => formatAmount(value, { denomination, targetDenomination: AE_AMOUNT_FORMATS.AE });\n\n/**\n * Convert amount to aettos\n * @param value - amount to convert\n * @param options - options\n * @param options.denomination - denomination of amount, can be ['ae', 'aettos']\n */\nexport const toAettos = (\n value: string | number | BigNumber,\n { denomination = AE_AMOUNT_FORMATS.AE }: { denomination?: AE_AMOUNT_FORMATS } = {},\n): string => formatAmount(value, { denomination });\n\ninterface Prefix {\n name: string;\n magnitude: number;\n}\n\nconst prefixes: Prefix[] = [\n { name: 'exa', magnitude: 18 },\n { name: 'giga', magnitude: 9 },\n { name: '', magnitude: 0 },\n { name: 'pico', magnitude: -12 },\n];\n\nconst getNearestPrefix = (exponent: number): Prefix => prefixes.reduce((p, n) => (\n Math.abs(n.magnitude - exponent) < Math.abs(p.magnitude - exponent) ? n : p));\n\nconst getLowerBoundPrefix = (exponent: number): Prefix => prefixes\n .find((p) => p.magnitude <= exponent) ?? prefixes[prefixes.length - 1];\n\nexport default (rawValue: string | number | BigNumber): string => {\n const value: BigNumber = new BigNumber(rawValue);\n\n const exp = value.e ?? 0;\n const { name, magnitude } = (exp < 0 ? getNearestPrefix : getLowerBoundPrefix)(exp);\n const v = value\n .shiftedBy(-magnitude)\n .precision(9 + Math.min(exp - magnitude, 0))\n .toFixed();\n return `${v}${name !== '' ? ' ' : ''}${name}`;\n};\n","import { RestError } from '@azure/core-rest-pipeline';\n\nexport const pause = async (duration: number): Promise<void> => new Promise((resolve) => {\n setTimeout(resolve, duration);\n});\n\nexport const mapObject = <InputV, OutputV>(\n object: { [k: string]: InputV },\n fn: (\n value: [string, InputV], index: number, array: Array<[string, InputV]>\n ) => [number | string, OutputV],\n): { [k: string]: OutputV } => Object.fromEntries(Object.entries(object).map(fn));\n\n// remove after dropping webpack4 support\nconst isWebpack4Buffer = (() => {\n try {\n Buffer.concat([Uint8Array.from([])]);\n return false;\n } catch (error) {\n return true;\n }\n})();\n\nexport const concatBuffers = isWebpack4Buffer\n ? (list: readonly Uint8Array[], totalLength?: number): Buffer => (\n Buffer.concat(list.map((el) => Buffer.from(el)), totalLength)\n )\n : Buffer.concat;\n\n/**\n * Object key type guard\n * @param key - Maybe object key\n * @param object - Object\n */\nexport function isKeyOfObject<T extends object>(\n key: string | number | symbol,\n object: T,\n): key is keyof T {\n return key in object;\n}\n\n/**\n * Array item type guard\n * @param item - Maybe array item\n * @param array - Array\n */\nexport function isItemOfArray<T>(item: any, array: readonly T[]): item is T {\n return array.includes(item);\n}\n\nexport function isAccountNotFoundError(error: Error): boolean {\n return error instanceof RestError && error.statusCode === 404\n && error.message.includes('Account not found');\n}\n\n// based on https://stackoverflow.com/a/50375286/6176994\nexport type UnionToIntersection<Union> =\n (Union extends any ? (k: Union) => void : never) extends ((k: infer Intersection) => void)\n ? Intersection : never;\n","/**\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/master/node/api/api_encoding.md}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L205-L230}\n */\nexport enum Encoding {\n KeyBlockHash = 'kh',\n MicroBlockHash = 'mh',\n BlockPofHash = 'bf',\n BlockTxHash = 'bx',\n BlockStateHash = 'bs',\n Channel = 'ch',\n ContractAddress = 'ct',\n ContractBytearray = 'cb',\n ContractStoreKey = 'ck',\n ContractStoreValue = 'cv',\n Transaction = 'tx',\n TxHash = 'th',\n OracleAddress = 'ok',\n OracleQuery = 'ov',\n OracleQueryId = 'oq',\n OracleResponse = 'or',\n AccountAddress = 'ak',\n Signature = 'sg',\n Commitment = 'cm',\n PeerPubkey = 'pp',\n Name = 'nm',\n State = 'st',\n Poi = 'pi',\n StateTrees = 'ss',\n CallStateTree = 'cs',\n Bytearray = 'ba',\n}\n\nexport type KeyBlockHash = `${Encoding.KeyBlockHash}_${string}`;\nexport type MicroBlockHash = `${Encoding.MicroBlockHash}_${string}`;\nexport type BlockPofHash = `${Encoding.BlockPofHash}_${string}`;\nexport type BlockTxHash = `${Encoding.BlockTxHash}_${string}`;\nexport type BlockStateHash = `${Encoding.BlockStateHash}_${string}`;\nexport type Channel = `${Encoding.Channel}_${string}`;\nexport type ContractAddress = `${Encoding.ContractAddress}_${string}`;\nexport type ContractBytearray = `${Encoding.ContractBytearray}_${string}`;\nexport type ContractStoreKey = `${Encoding.ContractStoreKey}_${string}`;\nexport type ContractStoreValue = `${Encoding.ContractStoreValue}_${string}`;\nexport type Transaction = `${Encoding.Transaction}_${string}`;\nexport type TxHash = `${Encoding.TxHash}_${string}`;\nexport type OracleAddress = `${Encoding.OracleAddress}_${string}`;\nexport type OracleQuery = `${Encoding.OracleQuery}_${string}`;\nexport type OracleQueryId = `${Encoding.OracleQueryId}_${string}`;\nexport type OracleResponse = `${Encoding.OracleResponse}_${string}`;\nexport type AccountAddress = `${Encoding.AccountAddress}_${string}`;\nexport type Signature = `${Encoding.Signature}_${string}`;\nexport type Commitment = `${Encoding.Commitment}_${string}`;\nexport type PeerPubkey = `${Encoding.PeerPubkey}_${string}`;\nexport type Name = `${Encoding.Name}_${string}`;\nexport type State = `${Encoding.State}_${string}`;\nexport type Poi = `${Encoding.Poi}_${string}`;\nexport type StateTrees = `${Encoding.StateTrees}_${string}`;\nexport type CallStateTree = `${Encoding.CallStateTree}_${string}`;\nexport type Bytearray = `${Encoding.Bytearray}_${string}`;\n\nexport type Generic<Type extends Encoding> = `${Type}_${string}`;\nexport type Any = `${Encoding}_${string}`;\n","import { encode as bs58Encode, decode as bs58Decode } from 'bs58';\n// js extension is required for mjs build, not importing the whole package to reduce bundle size\n// eslint-disable-next-line import/extensions\nimport Sha256 from 'sha.js/sha256.js';\nimport {\n DecodeError,\n ArgumentError,\n InvalidChecksumError,\n PayloadLengthError,\n} from './errors';\nimport { concatBuffers, isKeyOfObject } from './other';\nimport * as Encoded from './encoder-types';\nimport { Encoding } from './encoder-types';\n\nexport { Encoded, Encoding };\n\n/**\n * Calculate SHA256 hash of `input`\n * @param input - Data to hash\n * @returns Hash\n */\nexport function sha256hash(input: Uint8Array | string): Buffer {\n return new Sha256().update(input).digest();\n}\n\n/**\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L177-L202}\n */\nconst base64Types = [\n Encoding.ContractBytearray,\n Encoding.ContractStoreKey,\n Encoding.ContractStoreValue,\n Encoding.Transaction,\n Encoding.OracleQuery,\n Encoding.OracleResponse,\n Encoding.State,\n Encoding.Poi,\n Encoding.StateTrees,\n Encoding.CallStateTree,\n Encoding.Bytearray,\n] as const;\nconst base58Types = [\n Encoding.KeyBlockHash,\n Encoding.MicroBlockHash,\n Encoding.BlockPofHash,\n Encoding.BlockTxHash,\n Encoding.BlockStateHash,\n Encoding.Channel,\n Encoding.ContractAddress,\n Encoding.TxHash,\n Encoding.OracleAddress,\n Encoding.OracleQueryId,\n Encoding.AccountAddress,\n Encoding.Signature,\n Encoding.Commitment,\n Encoding.PeerPubkey,\n Encoding.Name,\n] as const;\n\n/**\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L261-L286}\n */\nconst byteSizeForType = {\n [Encoding.KeyBlockHash]: 32,\n [Encoding.MicroBlockHash]: 32,\n [Encoding.BlockPofHash]: 32,\n [Encoding.BlockTxHash]: 32,\n [Encoding.BlockStateHash]: 32,\n [Encoding.Channel]: 32,\n [Encoding.ContractAddress]: 32,\n [Encoding.TxHash]: 32,\n [Encoding.OracleAddress]: 32,\n [Encoding.OracleQueryId]: 32,\n [Encoding.AccountAddress]: 32,\n [Encoding.Signature]: 64,\n [Encoding.Commitment]: 32,\n [Encoding.PeerPubkey]: 32,\n [Encoding.State]: 32,\n} as const;\n\nfunction ensureValidLength(data: Uint8Array, type: Encoding): void {\n if (!isKeyOfObject(type, byteSizeForType)) return;\n const reqLen = byteSizeForType[type];\n if (reqLen == null || data.length === reqLen) return;\n throw new PayloadLengthError(`Payload should be ${reqLen} bytes, got ${data.length} instead`);\n}\n\nconst getChecksum = (payload: Uint8Array): Buffer => sha256hash(sha256hash(payload)).slice(0, 4);\n\nconst addChecksum = (payload: Uint8Array): Buffer => concatBuffers([payload, getChecksum(payload)]);\n\nfunction getPayload(buffer: Buffer): Buffer {\n const payload = buffer.slice(0, -4);\n if (!getChecksum(payload).equals(buffer.slice(-4))) throw new InvalidChecksumError();\n return payload;\n}\n\nconst base64 = {\n encode: (buffer: Uint8Array) => addChecksum(buffer).toString('base64'),\n decode: (string: string) => getPayload(Buffer.from(string, 'base64')),\n};\n\nconst base58 = {\n encode: (buffer: Uint8Array) => bs58Encode(addChecksum(buffer)),\n decode: (string: string) => getPayload(Buffer.from(bs58Decode(string))),\n};\n\nconst parseType = (maybeType: unknown): [Encoding, typeof base64] => {\n const base64Type = base64Types.find((t) => t === maybeType);\n if (base64Type != null) return [base64Type, base64];\n const base58Type = base58Types.find((t) => t === maybeType);\n if (base58Type != null) return [base58Type, base58];\n throw new ArgumentError('prefix', `one of ${[...base58Types, ...base64Types].join(', ')}`, maybeType);\n};\n\n/**\n * Decode data using the default encoding/decoding algorithm\n * @param data - An Base58/64check encoded and prefixed string\n * (ex tx_..., sg_..., ak_....)\n * @returns Decoded data\n */\nexport function decode(data: Encoded.Any): Buffer {\n const [prefix, encodedPayload, extra] = data.split('_');\n if (encodedPayload == null) throw new DecodeError(`Encoded string missing payload: ${data}`);\n if (extra != null) throw new DecodeError(`Encoded string have extra parts: ${data}`);\n const [type, encoder] = parseType(prefix);\n const payload = encoder.decode(encodedPayload);\n ensureValidLength(payload, type);\n return payload;\n}\n\n/**\n * Encode data using the default encoding/decoding algorithm\n * @param data - An decoded data\n * @param type - Prefix of Transaction\n * @returns Encoded string Base58check or Base64check data\n */\nexport function encode<Type extends Encoding>(\n data: Uint8Array,\n type: Type,\n): Encoded.Generic<Type> {\n const [, encoder] = parseType(type);\n ensureValidLength(data, type);\n return `${type}_${encoder.encode(data)}`;\n}\n","/*\n * ISC License (ISC)\n * Copyright 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport nacl, { SignKeyPair } from 'tweetnacl';\n// js extension is required for mjs build, not importing the whole package to reduce bundle size\n// eslint-disable-next-line import/extensions\nimport { blake2b } from 'blakejs/blake2b.js';\nimport { encode as varuintEncode } from 'varuint-bitcoin';\n\nimport { concatBuffers } from './other';\nimport {\n decode, encode, Encoded, Encoding,\n} from './encoder';\n\n/**\n * Generate address from secret key\n * @param secret - Private key as hex string\n * @returns Public key encoded as address\n */\nexport function getAddressFromPriv(secret: string | Uint8Array): Encoded.AccountAddress {\n const secretBuffer = typeof secret === 'string' ? Buffer.from(secret, 'hex') : secret;\n const keys = nacl.sign.keyPair.fromSecretKey(secretBuffer);\n return encode(keys.publicKey, Encoding.AccountAddress);\n}\n\n/**\n * Check if address is valid\n * @param address - Address\n * @param prefix - Transaction prefix. Default: 'ak'\n * @returns is valid\n */\nexport function isAddressValid(\n address: string,\n prefix: Encoding = Encoding.AccountAddress,\n): boolean {\n try {\n decode(address as Encoded.Generic<typeof prefix>);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Generate a random salt (positive integer)\n * @returns random salt\n */\nexport function genSalt(): number {\n const [random] = new BigUint64Array(nacl.randomBytes(8).buffer);\n return Number(random % BigInt(Number.MAX_SAFE_INTEGER));\n}\n\n/**\n * Converts a positive integer to the smallest possible\n * representation in a binary digit representation\n * @param value - Value to encode\n * @returns Encoded number\n */\nexport function encodeUnsigned(value: number): Buffer {\n const binary = Buffer.allocUnsafe(4);\n binary.writeUInt32BE(value);\n return binary.slice(binary.findIndex((i) => i !== 0));\n}\n\n/**\n * Calculate 256bits Blake2b hash of `input`\n * @param input - Data to hash\n * @returns Hash\n */\nexport function hash(input: string | Uint8Array): Buffer {\n return Buffer.from(blake2b(input, undefined, 32)); // 256 bits\n}\n\n// Todo Duplicated in tx builder. remove\n/**\n * Compute contract address\n * @category contract\n * @param owner - Address of contract owner\n * @param nonce - Round when contract was created\n * @returns Contract address\n */\nexport function encodeContractAddress(\n owner: Encoded.AccountAddress,\n nonce: number,\n): Encoded.ContractAddress {\n const publicKey = decode(owner);\n const binary = concatBuffers([publicKey, encodeUnsigned(nonce)]);\n return encode(hash(binary), Encoding.ContractAddress);\n}\n\n// KEY-PAIR HELPERS\n\n/**\n * Generate keyPair from secret key\n * @param secret - secret key\n * @returns Object with Private(privateKey) and Public(publicKey) keys\n */\nexport function generateKeyPairFromSecret(secret: Uint8Array): SignKeyPair {\n return nacl.sign.keyPair.fromSecretKey(secret);\n}\n\n/**\n * Generate a random ED25519 keypair\n * @param raw - Whether to return raw (binary) keys\n * @returns Key pair\n */\nexport function generateKeyPair(raw: true): { publicKey: Buffer; secretKey: Buffer };\nexport function generateKeyPair(raw?: false): {\n publicKey: Encoded.AccountAddress; secretKey: string;\n};\nexport function generateKeyPair(raw = false): {\n publicKey: Encoded.AccountAddress | Buffer;\n secretKey: string | Buffer;\n} {\n const keyPair = nacl.sign.keyPair();\n const publicBuffer = Buffer.from(keyPair.publicKey);\n const secretBuffer = Buffer.from(keyPair.secretKey);\n\n if (raw) {\n return {\n publicKey: publicBuffer,\n secretKey: secretBuffer,\n };\n }\n return {\n publicKey: encode(publicBuffer, Encoding.AccountAddress),\n secretKey: secretBuffer.toString('hex'),\n };\n}\n\n// SIGNATURES\n\n/**\n * Generate signature\n * @param data - Data to sign\n * @param privateKey - Key to sign with\n * @returns Signature\n */\nexport function sign(data: string | Uint8Array, privateKey: string | Uint8Array): Uint8Array {\n return nacl.sign.detached(Buffer.from(data), Buffer.from(privateKey));\n}\n\n/**\n * Verify that signature was signed by public key\n * @param data - Data that was signed\n * @param signature - Signature of data\n * @param address - Address to verify against\n * @returns is data was signed by address\n */\nexport function verify(\n data: Uint8Array,\n signature: Uint8Array,\n address: Encoded.AccountAddress,\n): boolean {\n return nacl.sign.detached.verify(data, signature, decode(address));\n}\n\nexport function messageToHash(message: string): Buffer {\n const p = Buffer.from('aeternity Signed Message:\\n', 'utf8');\n const msg = Buffer.from(message, 'utf8');\n return hash(concatBuffers([varuintEncode(p.length), p, varuintEncode(msg.length), msg]));\n}\n\nexport function signMessage(message: string, privateKey: string | Buffer): Uint8Array {\n return sign(messageToHash(message), privateKey);\n}\n\n/**\n * Verify that message was signed by address\n * @param message - Message that was signed\n * @param signature - Signature of message\n * @param address - Address to verify against\n * @returns is data was signed by address\n */\nexport function verifyMessage(\n message: string,\n signature: Uint8Array,\n address: Encoded.AccountAddress,\n): boolean {\n return verify(messageToHash(message), signature, address);\n}\n\n/**\n * Check key pair for validity\n *\n * Sign a message, and then verifying that signature\n * @param privateKey - Private key to verify\n * @param publicKey - Public key to verify as hex string\n * @returns Valid?\n */\nexport function isValidKeypair(\n privateKey: string | Uint8Array,\n publicKey: string | Uint8Array,\n): boolean {\n const message = Buffer.from('TheMessage');\n const signature = sign(message, privateKey);\n const publicKeyBuffer = typeof publicKey === 'string' ? Buffer.from(publicKey, 'hex') : publicKey;\n return verify(message, signature, encode(publicKeyBuffer, Encoding.AccountAddress));\n}\n","import BigNumber from 'bignumber.js';\nimport { mapObject } from '../../utils/other';\n\nexport const MAX_AUTH_FUN_GAS = 50000;\n// # AENS\nexport type AensName = `${string}.chain`;\nexport const NAME_TTL = 180000;\n// # max number of block into the future that the name is going to be available\n// # https://github.com/aeternity/protocol/blob/epoch-v0.22.0/AENS.md#update\n// # https://github.com/aeternity/protocol/blob/44a93d3aab957ca820183c3520b9daf6b0fedff4/AENS.md#aens-entry\nexport const NAME_MAX_TTL = 36000;\nexport const NAME_MAX_CLIENT_TTL = 84600;\nexport const CLIENT_TTL = NAME_MAX_CLIENT_TTL;\nexport const MIN_GAS_PRICE = 1e9;\n// # see https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L67\nexport const NAME_FEE_MULTIPLIER = 1e14; // 100000000000000\nexport const NAME_FEE_BID_INCREMENT = 0.05; // # the increment is in percentage\n// # see https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L272\nexport const NAME_BID_TIMEOUT_BLOCKS = 480; // # ~1 day\n// # this is the max length for a domain that requires a base fee to be paid\nexport const NAME_MAX_LENGTH_FEE = 31;\nexport const NAME_BID_MAX_LENGTH = 12; // # this is the max length for a domain to be part of a bid\n// # https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L290\n// # https://github.com/aeternity/protocol/blob/master/AENS.md#protocol-fees-and-protection-times\n// # bid ranges:\nexport const NAME_BID_RANGES = mapObject({\n 31: 3,\n 30: 5,\n 29: 8,\n 28: 13,\n 27: 21,\n 26: 34,\n 25: 55,\n 24: 89,\n 23: 144,\n 22: 233,\n 21: 377,\n 20: 610,\n 19: 987,\n 18: 1597,\n 17: 2584,\n 16: 4181,\n 15: 6765,\n 14: 10946,\n 13: 17711,\n 12: 28657,\n 11: 46368,\n 10: 75025,\n 9: 121393,\n 8: 196418,\n 7: 317811,\n 6: 514229,\n 5: 832040,\n 4: 1346269,\n 3: 2178309,\n 2: 3524578,\n 1: 5702887,\n}, ([key, value]) => [key, new BigNumber(value).times(NAME_FEE_MULTIPLIER)]);\n\n/**\n * Enum with tag types\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/serializations.md#binary-serialization}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_chain_objects.erl#L39-L97}\n */\n// TODO: implement serialisation for commented-out tags\nexport enum Tag {\n Account = 10,\n SignedTx = 11,\n SpendTx = 12,\n // Oracle = 20,\n // OracleQuery = 21,\n OracleRegisterTx = 22,\n OracleQueryTx = 23,\n OracleResponseTx = 24,\n OracleExtendTx = 25,\n // Name = 30,\n // NameCommitment = 31,\n NameClaimTx = 32,\n NamePreclaimTx = 33,\n NameUpdateTx = 34,\n NameRevokeTx = 35,\n NameTransferTx = 36,\n // NameAuction = 37,\n Contract = 40,\n ContractCall = 41,\n ContractCreateTx = 42,\n ContractCallTx = 43,\n ChannelCreateTx = 50,\n // ChannelSetDelegatesTx = 501,\n ChannelDepositTx = 51,\n ChannelWithdrawTx = 52,\n ChannelForceProgressTx = 521,\n ChannelCloseMutualTx = 53,\n ChannelCloseSoloTx = 54,\n ChannelSlashTx = 55,\n ChannelSettleTx = 56,\n ChannelOffChainTx = 57,\n ChannelOffChainUpdateTransfer = 570,\n ChannelOffChainUpdateDeposit = 571,\n ChannelOffChainUpdateWithdraw = 572,\n ChannelOffChainUpdateCreateContract = 573,\n ChannelOffChainUpdateCallContract = 574,\n // ChannelOffChainUpdateMeta = 576,\n ChannelClientReconnectTx = 575,\n Channel = 58,\n ChannelSnapshotSoloTx = 59,\n TreesPoi = 60,\n // TreesDb = 61,\n StateTrees = 62,\n Mtree = 63,\n MtreeValue = 64,\n ContractsMtree = 621,\n CallsMtree = 622,\n ChannelsMtree = 623,\n NameserviceMtree = 624,\n OraclesMtree = 625,\n AccountsMtree = 626,\n CompilerSophia = 70,\n GaAttachTx = 80,\n GaMetaTx = 81,\n PayingForTx = 82,\n // KeyBlock = 100,\n // MicroBlock = 101,\n // LightMicroBlock = 102,\n // Pof = 200,\n}\n","/*\n * ISC License (ISC)\n * Copyright 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport { NoSerializerFoundError, TypeError } from './errors';\n\n/**\n * Convert string, number, or BigNumber to byte array\n * @param val - value to convert\n * @param big - enables force conversion to BigNumber\n * @returns Buffer\n */\n// eslint-disable-next-line import/prefer-default-export\nexport function toBytes(val?: null | string | number | BigNumber, big = false): Buffer {\n // Encode a value to bytes.\n // If the value is an int it will be encoded as bytes big endian\n // Raises ValueError if the input is not an int or string\n\n if (val === undefined || val === null) return Buffer.from([]);\n if (Number.isInteger(val) || BigNumber.isBigNumber(val) || big) {\n if (!BigNumber.isBigNumber(val)) val = new BigNumber(val);\n if (!val.isInteger()) throw new TypeError(`Unexpected not integer value: ${val.toFixed()}`);\n let hexString = val.toString(16);\n if (hexString.length % 2 === 1) hexString = `0${hexString}`;\n return Buffer.from(hexString, 'hex');\n }\n if (typeof val === 'string') {\n return Buffer.from(val);\n }\n throw new NoSerializerFoundError();\n}\n","import BigNumber from 'bignumber.js';\nimport { genSalt, hash } from '../../utils/crypto';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../utils/encoder';\nimport { toBytes } from '../../utils/bytes';\nimport { concatBuffers } from '../../utils/other';\nimport {\n AensName,\n NAME_BID_RANGES,\n NAME_BID_TIMEOUT_BLOCKS,\n NAME_FEE_BID_INCREMENT,\n NAME_MAX_LENGTH_FEE,\n} from './constants';\nimport { ceil } from '../../utils/bignumber';\nimport { ArgumentError, IllegalBidFeeError } from '../../utils/errors';\n\n/**\n * JavaScript-based Transaction builder helper function's\n */\n\n/**\n * Build a contract public key\n * @category contract\n * @param ownerId - The public key of the owner account\n * @param nonce - the nonce of the transaction\n * @returns Contract public key\n */\nexport function buildContractId(\n ownerId: Encoded.AccountAddress,\n nonce: number | BigNumber,\n): Encoded.ContractAddress {\n const ownerIdAndNonce = Buffer.from([...decode(ownerId), ...toBytes(nonce)]);\n const b2bHash = hash(ownerIdAndNonce);\n return encode(b2bHash, Encoding.ContractAddress);\n}\n\n/**\n * Build a oracle query id\n * @category oracle\n * @param senderId - The public key of the sender account\n * @param nonce - the nonce of the transaction\n * @param oracleId - The oracle public key\n * @returns Contract public key\n */\nexport function oracleQueryId(\n senderId: Encoded.AccountAddress,\n nonce: number | BigNumber | string,\n oracleId: Encoded.OracleAddress,\n): Encoded.OracleQueryId {\n function _int32(val: number | string | BigNumber): Buffer {\n const nonceBE = toBytes(val, true);\n return concatBuffers([Buffer.alloc(32 - nonceBE.length), nonceBE]);\n }\n\n const b2bHash = hash(\n Buffer.from([...decode(senderId), ..._int32(nonce), ...decode(oracleId)]),\n );\n return encode(b2bHash, Encoding.OracleQueryId);\n}\n\n/**\n * Encode an AENS name\n * @category AENS\n * @param name - Name to encode\n * @returns `nm_` prefixed encoded AENS name\n */\nexport function produceNameId(name: AensName): Encoded.Name {\n return encode(hash(name.toLowerCase()), Encoding.Name);\n}\n\n/**\n * Generate the commitment hash by hashing the salt and\n * name, base 58 encoding the result and prepending 'cm_'\n * @category transaction builder\n * @param name - Name to be registered\n * @param salt - Random number\n * @returns Commitment hash\n */\nexport function commitmentHash(\n name: AensName,\n salt: number = genSalt(),\n): Encoded.Commitment {\n return encode(\n hash(concatBuffers([\n Buffer.from(name.toLowerCase()),\n Buffer.from(salt.toString(16).padStart(64, '0'), 'hex'),\n ])),\n Encoding.Commitment,\n );\n}\n\n/**\n * Utility function to convert bytes to int\n * @category transaction builder\n * @param buf - Value\n * @returns Buffer Buffer from number(BigEndian)\n */\nexport function readInt(buf: Buffer = Buffer.from([])): string {\n return new BigNumber(Buffer.from(buf).toString('hex'), 16).toString(10);\n}\n\nconst AENS_SUFFIX = '.chain';\n\n/**\n * Is AENS name valid\n * @category AENS\n * @param name - AENS name\n */\nexport function isNameValid(name: string): name is AensName {\n // TODO: probably there are stronger requirements\n return name.endsWith(AENS_SUFFIX);\n}\n\nconst encodingToPointerKey = [\n [Encoding.AccountAddress, 'account_pubkey'],\n [Encoding.OracleAddress, 'oracle_pubkey'],\n [Encoding.ContractAddress, 'contract_pubkey'],\n [Encoding.Channel, 'channel'],\n] as const;\n\n/**\n * @category AENS\n * @param identifier - account/oracle/contract address, or channel\n * @returns default AENS pointer key\n */\nexport function getDefaultPointerKey(\n identifier: Encoded.Generic<typeof encodingToPointerKey[number][0]>,\n): typeof encodingToPointerKey[number][1] {\n decode(identifier);\n const encoding = identifier.substring(0, 2);\n const result = encodingToPointerKey.find(([e]) => e === encoding)?.[1];\n if (result != null) return result;\n throw new ArgumentError(\n 'identifier',\n `prefixed with one of ${encodingToPointerKey.map(([e]) => `${e}_`).join(', ')}`,\n identifier,\n );\n}\n\n/**\n * Get the minimum AENS name fee\n * @category AENS\n * @param name - the AENS name to get the fee for\n * @returns the minimum fee for the AENS name auction\n */\nexport function getMinimumNameFee(name: AensName): BigNumber {\n const nameLength = name.length - AENS_SUFFIX.length;\n return NAME_BID_RANGES[Math.min(nameLength, NAME_MAX_LENGTH_FEE)];\n}\n\n/**\n * Compute bid fee for AENS auction\n * @category AENS\n * @param name - the AENS name to get the fee for\n * @param options - Options\n * @param options.startFee - Auction start fee\n * @param options.increment - Bid multiplier(In percentage, must be between 0 and 1)\n * @returns Bid fee\n */\nexport function computeBidFee(\n name: AensName,\n { startFee, increment = NAME_FEE_BID_INCREMENT }:\n { startFee?: number | string | BigNumber; increment?: number } = {},\n): BigNumber {\n if (!(Number(increment) === increment && increment % 1 !== 0)) throw new IllegalBidFeeError(`Increment must be float. Current increment ${increment}`);\n if (increment < NAME_FEE_BID_INCREMENT) throw new IllegalBidFeeError(`minimum increment percentage is ${NAME_FEE_BID_INCREMENT}`);\n // FIXME: increment should be used somehow here\n return ceil(\n new BigNumber(startFee ?? getMinimumNameFee(name))\n .times(new BigNumber(NAME_FEE_BID_INCREMENT).plus(1)),\n );\n}\n\n/**\n * Compute auction end height\n * @category AENS\n * @param name - Name to compute auction end for\n * @param claimHeight - Auction starting height\n * @see {@link https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L273}\n * @returns Auction end height\n */\nexport function computeAuctionEndBlock(name: AensName, claimHeight: number): number {\n const length = name.length - AENS_SUFFIX.length;\n const h = (length <= 4 ? 62 * NAME_BID_TIMEOUT_BLOCKS : null)\n ?? (length <= 8 ? 31 * NAME_BID_TIMEOUT_BLOCKS : null)\n ?? (length <= 12 ? NAME_BID_TIMEOUT_BLOCKS : null)\n ?? 0;\n return h + claimHeight;\n}\n\n/**\n * Is name accept going to auction\n * @category AENS\n */\nexport function isAuctionName(name: AensName): boolean {\n return name.length < 13 + AENS_SUFFIX.length;\n}\n","import BigNumber from 'bignumber.js';\nimport { readInt } from '../helpers';\nimport { ArgumentError } from '../../../utils/errors';\nimport { toBytes } from '../../../utils/bytes';\n\nexport type Int = number | string | BigNumber;\n\nexport default {\n serialize(value: Int): Buffer {\n if (value < 0) throw new ArgumentError('value', 'greater or equal to 0', value);\n return toBytes(value, true);\n },\n\n deserialize(value: Buffer): string {\n return readInt(value);\n },\n};\n","import uInt from './u-int';\n\nexport default {\n serialize(value: number): Buffer {\n return uInt.serialize(value);\n },\n\n deserialize(value: Buffer): number {\n return +uInt.deserialize(value);\n },\n};\n","import uInt, { Int } from './u-int';\nimport { AE_AMOUNT_FORMATS, formatAmount } from '../../../utils/amount-formatter';\n\nexport interface Options { denomination?: AE_AMOUNT_FORMATS }\n\nexport default {\n ...uInt,\n\n serializeAettos(value: string | undefined): string {\n return value ?? '0';\n },\n\n serialize(value: Int | undefined, { denomination, ...options }: Options): Buffer {\n return uInt.serialize(\n this.serializeAettos(\n value != null ? formatAmount(value, { denomination }) : value,\n options,\n ),\n );\n },\n};\n","import { PrefixNotFoundError, TagNotFoundError } from '../../../utils/errors';\nimport { toBytes } from '../../../utils/bytes';\nimport { decode, encode, Encoding } from '../../../utils/encoder';\nimport { isItemOfArray } from '../../../utils/other';\n\n/**\n * Map of prefix to ID tag constant\n * @see {@link https://github.com/aeternity/protocol/blob/master/serializations.md#the-id-type}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_id.erl#L97-L102}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L163-L168}\n */\nconst idTagToEncoding = [\n Encoding.AccountAddress,\n Encoding.Name,\n Encoding.Commitment,\n Encoding.OracleAddress,\n Encoding.ContractAddress,\n Encoding.Channel,\n] as const;\n\nexport type AddressEncodings = typeof idTagToEncoding[number];\n\nexport default function genAddressField<Encoding extends AddressEncodings>(): {\n serialize: (value: `${Encoding}_${string}`) => Buffer;\n deserialize: (value: Buffer) => `${Encoding}_${string}`;\n} {\n return {\n /**\n * Utility function to create and _id type\n * @param hashId - Encoded hash\n * @returns Buffer Buffer with ID tag and decoded HASh\n */\n serialize(hashId) {\n const encoding = hashId.slice(0, 2);\n if (!isItemOfArray(encoding, idTagToEncoding)) throw new TagNotFoundError(encoding);\n const idTag = idTagToEncoding.indexOf(encoding) + 1;\n return Buffer.from([...toBytes(idTag), ...decode(hashId)]);\n },\n\n /**\n * Utility function to read and _id type\n * @param buf - Data\n * @returns Encoded hash string with prefix\n */\n deserialize(buf) {\n const idTag = Buffer.from(buf).readUIntBE(0, 1);\n const encoding = idTagToEncoding[idTag - 1];\n if (encoding == null) throw new PrefixNotFoundError(idTag);\n return encode(buf.subarray(1), encoding) as `${Encoding}_${string}`;\n },\n };\n}\n","import coinAmount from './coin-amount';\nimport { Int } from './u-int';\nimport { IllegalArgumentError } from '../../../utils/errors';\n\nexport default {\n ...coinAmount,\n\n /**\n * @param value - Deposit value in string format. Should be equal to '0'.\n * @param options - Options\n * @returns Deposit value Buffer.\n */\n serialize(\n value: Int | undefined,\n options: Parameters<typeof coinAmount['serialize']>[1],\n ): Buffer {\n value ??= 0;\n if (+value !== 0) throw new IllegalArgumentError(`Contract deposit is not refundable, so it should be equal 0, got ${value.toString()} instead`);\n return coinAmount.serialize(value, options);\n },\n};\n","import BigNumber from 'bignumber.js';\nimport { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE, Tag } from '../constants';\nimport coinAmount from './coin-amount';\nimport { isKeyOfObject } from '../../../utils/other';\n\nconst BASE_GAS = 15000;\nconst GAS_PER_BYTE = 20;\nconst KEY_BLOCK_INTERVAL = 3;\n\n/**\n * Calculate the Base fee gas\n * @see {@link https://github.com/aeternity/protocol/blob/master/consensus/README.md#gas}\n * @param txType - The transaction type\n * @returns The base fee\n * @example\n * ```js\n * TX_FEE_BASE('channelForceProgress') => new BigNumber(30 * 15000)\n * ```\n */\nconst TX_FEE_BASE_GAS = (txType: Tag): BigNumber => {\n const feeFactors = {\n [Tag.ChannelForceProgressTx]: 30,\n [Tag.ChannelOffChainTx]: 0,\n [Tag.ChannelOffChainUpdateCallContract]: 0,\n [Tag.ChannelOffChainUpdateCreateContract]: 0,\n [Tag.ChannelOffChainUpdateDeposit]: 0,\n [Tag.ChannelOffChainUpdateWithdraw]: 0,\n [Tag.ChannelOffChainUpdateTransfer]: 0,\n [Tag.ContractCreateTx]: 5,\n [Tag.ContractCallTx]: 12,\n [Tag.GaAttachTx]: 5,\n [Tag.GaMetaTx]: 5,\n [Tag.PayingForTx]: 1 / 5,\n } as const;\n const factor = feeFactors[txType as keyof typeof feeFactors] ?? 1;\n return new BigNumber(factor * BASE_GAS);\n};\n\n/**\n * Calculate fee for Other types of transactions\n * @see {@link https://github.com/aeternity/protocol/blob/master/consensus/README.md#gas}\n * @param txType - The transaction type\n * @param txSize - The transaction size\n * @returns parameters - The transaction parameters\n * @returns parameters.relativeTtl - The relative ttl\n * @returns parameters.innerTxSize - The size of the inner transaction\n * @returns The Other fee\n * @example\n * ```js\n * TX_FEE_OTHER_GAS('oracleResponse',10, { relativeTtl: 10, innerTxSize: 10 })\n * => new BigNumber(10).times(20).plus(Math.ceil(32000 * 10 / Math.floor(60 * 24 * 365 / 2)))\n * ```\n */\nconst TX_FEE_OTHER_GAS = (\n txType: Tag,\n txSize: number,\n { relativeTtl, innerTxSize }: { relativeTtl: number; innerTxSize: number },\n): BigNumber => {\n switch (txType) {\n case Tag.OracleRegisterTx:\n case Tag.OracleExtendTx:\n case Tag.OracleQueryTx:\n case Tag.OracleResponseTx:\n return new BigNumber(txSize)\n .times(GAS_PER_BYTE)\n .plus(\n Math.ceil((32000 * relativeTtl) / Math.floor((60 * 24 * 365) / KEY_BLOCK_INTERVAL)),\n );\n case Tag.GaMetaTx:\n case Tag.PayingForTx:\n return new BigNumber(txSize).minus(innerTxSize).times(GAS_PER_BYTE);\n default:\n return new BigNumber(txSize).times(GAS_PER_BYTE);\n }\n};\n\nfunction getOracleRelativeTtl(params: any, txType: Tag): number {\n const ttlKeys = {\n [Tag.OracleRegisterTx]: 'oracleTtlValue',\n [Tag.OracleExtendTx]: 'oracleTtlValue',\n [Tag.OracleQueryTx]: 'queryTtlValue',\n [Tag.OracleResponseTx]: 'responseTtlValue',\n } as const;\n\n if (!isKeyOfObject(txType, ttlKeys)) return 1;\n return params[ttlKeys[txType]];\n}\n\n/**\n * Calculate fee based on tx type and params\n */\nexport function buildFee(txType: Tag, buildTx: any): BigNumber {\n const { rlpEncoded: { length }, txObject } = buildTx;\n\n return TX_FEE_BASE_GAS(txType)\n .plus(TX_FEE_OTHER_GAS(txType, length, {\n relativeTtl: getOracleRelativeTtl(txObject, txType),\n innerTxSize: [Tag.GaMetaTx, Tag.PayingForTx].includes(txType)\n ? txObject.tx.tx.encodedTx.rlpEncoded.length\n : 0,\n }))\n .times(MIN_GAS_PRICE);\n}\n\n/**\n * Calculate min fee\n * @category transaction builder\n * @param txType - Transaction type\n * @param rebuildTx - Callback to get built transaction with specific fee\n */\nfunction calculateMinFee(\n txType: Tag,\n rebuildTx: (value: BigNumber) => any,\n): BigNumber {\n let fee = new BigNumber(0);\n let previousFee;\n do {\n previousFee = fee;\n fee = buildFee(txType, rebuildTx(fee));\n } while (!fee.eq(previousFee));\n return fee;\n}\n\nexport default {\n ...coinAmount,\n\n serializeAettos(\n _value: string | undefined,\n { txType, rebuildTx, _computingMinFee }:\n { txType: Tag; rebuildTx: (params: any) => any; _computingMinFee?: string },\n ): string {\n if (_computingMinFee != null) return _computingMinFee;\n const minFee = calculateMinFee(txType, (fee) => rebuildTx({ _computingMinFee: fee }));\n const value = new BigNumber(_value ?? minFee);\n if (minFee.gt(value)) {\n throw new IllegalArgumentError(`Fee ${value.toString()} must be bigger then ${minFee}`);\n }\n return value.toFixed();\n },\n};\n","import { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE, Tag, MAX_AUTH_FUN_GAS } from '../constants';\nimport shortUInt from './short-u-int';\nimport { buildFee } from './fee';\n\nfunction calculateGasLimitMax(\n txType: Tag,\n gasMax: number,\n rebuildTx: (value: number) => any,\n): number {\n return gasMax - +buildFee(txType, rebuildTx(gasMax)).dividedBy(MIN_GAS_PRICE);\n}\n\nexport default {\n ...shortUInt,\n\n serialize(\n _value: number | undefined,\n {\n txType, rebuildTx, gasMax = 6e6, _computingGasLimit,\n }: {\n txType: Tag;\n rebuildTx: (params: any) => any;\n gasMax: number;\n _computingGasLimit?: number;\n },\n ): Buffer {\n if (_computingGasLimit != null) return shortUInt.serialize(_computingGasLimit);\n\n const gasLimitMax = txType === Tag.GaMetaTx ? MAX_AUTH_FUN_GAS : calculateGasLimitMax(\n txType,\n gasMax,\n (gasLimit) => rebuildTx({ _computingGasLimit: gasLimit }),\n );\n const value = _value ?? gasLimitMax;\n if (value > gasLimitMax) {\n throw new IllegalArgumentError(`Gas limit ${value} must be less or equal to ${gasLimitMax}`);\n }\n return shortUInt.serialize(value);\n },\n};\n","import coinAmount from './coin-amount';\nimport { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE } from '../constants';\n\nexport default {\n ...coinAmount,\n\n serializeAettos(value: string | undefined = MIN_GAS_PRICE.toString()): string {\n if (+value < MIN_GAS_PRICE) {\n throw new IllegalArgumentError(`Gas price ${value.toString()} must be bigger then ${MIN_GAS_PRICE}`);\n }\n return value;\n },\n};\n","export default {\n serialize(value: string): Buffer {\n return Buffer.from(value);\n },\n\n deserialize(value: Buffer): string {\n return value.toString();\n },\n};\n","import field from './field';\nimport { AensName } from '../constants';\n\nexport default {\n /**\n * @param value - AENS name\n */\n serialize(value: AensName): Buffer {\n return field.serialize(value);\n },\n\n /**\n * @param value - AENS name\n */\n deserialize(value: Buffer): AensName {\n return field.deserialize(value) as AensName;\n },\n};\n","import BigNumber from 'bignumber.js';\nimport { getMinimumNameFee } from '../helpers';\nimport { InsufficientNameFeeError } from '../../../utils/errors';\nimport { Int } from './u-int';\nimport coinAmount from './coin-amount';\nimport { AensName } from '../constants';\n\nexport default {\n ...coinAmount,\n\n serializeAettos(\n _value: string | undefined,\n txFields: { name: AensName },\n ): string {\n const minNameFee = getMinimumNameFee(txFields.name);\n const value = new BigNumber(_value ?? minNameFee);\n if (minNameFee.gt(value)) throw new InsufficientNameFeeError(value, minNameFee);\n return value.toFixed();\n },\n\n /**\n * @param value - AENS name fee Buffer\n * @param txFields - Transaction fields\n * @param txFields.name - AENS Name in transaction\n */\n serialize(\n value: Int | undefined,\n txFields: { name: AensName } & Parameters<typeof coinAmount['serialize']>[1],\n ): Buffer {\n return coinAmount.serialize.call(this, value, txFields);\n },\n};\n","import { AensName } from '../constants';\nimport { produceNameId, isNameValid } from '../helpers';\nimport address from './address';\nimport { Encoded, Encoding } from '../../../utils/encoder';\n\nconst addressName = address<Encoding.Name>();\n\nexport default {\n ...addressName,\n\n /**\n * @param value - AENS name ID\n */\n serialize(value: AensName | Encoded.Name): Buffer {\n return addressName.serialize(isNameValid(value) ? produceNameId(value) : value);\n },\n};\n","import { NamePointer as NamePointerString } from '../../../apis/node';\nimport { toBytes } from '../../../utils/bytes';\nimport { Encoded } from '../../../utils/encoder';\nimport { IllegalArgumentError } from '../../../utils/errors';\nimport address, { AddressEncodings } from './address';\n\nconst addressAny = address<AddressEncodings>();\n\n// TODO: remove after fixing node types\ntype NamePointer = NamePointerString & {\n id: Encoded.Generic<AddressEncodings>;\n};\n\nexport default {\n /**\n * Helper function to build pointers for name update TX\n * @param pointers - Array of pointers\n * `([ { key: 'account_pubkey', id: 'ak_32klj5j23k23j5423l434l2j3423'} ])`\n * @returns Serialized pointers array\n */\n serialize(pointers: NamePointer[]): Buffer[][] {\n if (pointers.length > 32) {\n throw new IllegalArgumentError(`Expected 32 pointers or less, got ${pointers.length} instead`);\n }\n\n return pointers.map(\n (pointer) => [toBytes(pointer.key), addressAny.serialize(pointer.id)],\n );\n },\n\n /**\n * Helper function to read pointers from name update TX\n * @param pointers - Array of pointers\n * @returns Deserialize pointer array\n */\n deserialize(pointers: Array<[key: Buffer, id: Buffer]>): NamePointer[] {\n return pointers.map(\n ([key, id]) => ({ key: key.toString(), id: addressAny.deserialize(id) }),\n );\n },\n};\n","import _field from './field';\nimport _uInt from './u-int';\nimport _shortUInt from './short-u-int';\nimport _coinAmount from './coin-amount';\nimport _address from './address';\nimport _addresses from './addresses';\nimport _deposit from './deposit';\nimport _enumeration from './enumeration';\nimport _fee from './fee';\nimport _gasLimit from './gas-limit';\nimport _gasPrice from './gas-price';\nimport _name from './name';\nimport _nameFee from './name-fee';\nimport _nameId from './name-id';\nimport _pointers from './pointers';\n\n// TODO: remove after fixing https://github.com/Gerrit0/typedoc-plugin-missing-exports/issues/15\nconst field = _field;\nconst uInt = _uInt;\nconst shortUInt = _shortUInt;\nconst coinAmount = _coinAmount;\nconst address = _address;\nconst addresses = _addresses;\nconst deposit = _deposit;\nconst enumeration = _enumeration;\nconst fee = _fee;\nconst gasLimit = _gasLimit;\nconst gasPrice = _gasPrice;\nconst name = _name;\nconst nameFee = _nameFee;\nconst nameId = _nameId;\nconst pointers = _pointers;\n\nexport interface Field {\n serialize: (value: any, options: any) => Buffer | Buffer[] | Buffer[][];\n deserialize: (value: Buffer | Buffer[] | Buffer[][]) => any;\n}\n\nexport {\n field,\n uInt,\n shortUInt,\n coinAmount,\n address,\n addresses,\n deposit,\n enumeration,\n fee,\n gasLimit,\n gasPrice,\n name,\n nameFee,\n nameId,\n pointers,\n};\n","import genAddressField, { AddressEncodings } from './address';\n\nexport default function genAddressesField<Encoding extends AddressEncodings>(): {\n serialize: (value: Array<`${Encoding}_${string}`>) => Buffer[];\n deserialize: (value: Buffer[]) => Array<`${Encoding}_${string}`>;\n} {\n const address = genAddressField<Encoding>();\n\n return {\n serialize(addresses) {\n return addresses.map(address.serialize);\n },\n\n deserialize(addresses) {\n return addresses.map(address.deserialize);\n },\n };\n}\n","import { ArgumentError } from '../../../utils/errors';\n\nexport default function genEnumerationField<Enum extends number>(): {\n serialize: (value: Enum) => Buffer;\n deserialize: (value: Buffer) => Enum;\n} {\n return {\n serialize(value) {\n if (typeof value !== 'number') throw new ArgumentError('value', 'to be a number', value);\n if (value > 0xff) throw new ArgumentError('value', 'to be less than 256', value);\n return Buffer.from([value]);\n },\n\n deserialize(buffer) {\n if (buffer.length !== 1) {\n throw new ArgumentError('buffer', 'to have single element', buffer.length);\n }\n return buffer[0] as Enum;\n },\n };\n}\n","/**\n * Transaction Schema for TxBuilder\n */\n// # RLP version number\n// # https://github.com/aeternity/protocol/blob/master/serializations.md#binary-serialization\n\nimport BigNumber from 'bignumber.js';\nimport { Tag } from './constants';\nimport {\n Field, uInt, shortUInt, coinAmount, name, nameId, nameFee, deposit, gasLimit, gasPrice, fee,\n address, addresses, pointers, enumeration,\n} from './field-types';\nimport { Encoded, Encoding } from '../../utils/encoder';\nimport MPTree from '../../utils/mptree';\nimport { UnionToIntersection } from '../../utils/other';\nimport { AddressEncodings } from './field-types/address';\n\nexport enum ORACLE_TTL_TYPES {\n delta = 0,\n block = 1,\n}\n\n// # TRANSACTION DEFAULT TTL\nexport const TX_TTL = 0;\n// # ORACLE\nexport const QUERY_FEE = 30000;\nexport const ORACLE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 500 };\nexport const QUERY_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };\nexport const RESPONSE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };\n// # CONTRACT\nexport const DRY_RUN_ACCOUNT = {\n pub: 'ak_11111111111111111111111111111111273Yts',\n amount: 100000000000000000000000000000000000n,\n} as const;\n\nexport type TxField = [\n name: string,\n type: FIELD_TYPES | Field,\n prefix?: Encoding | Encoding[],\n];\n\n/**\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}\n */\nexport enum VM_VERSIONS {\n NO_VM = 0,\n SOPHIA = 1,\n SOPHIA_IMPROVEMENTS_MINERVA = 3,\n SOPHIA_IMPROVEMENTS_FORTUNA = 4,\n FATE = 5,\n SOPHIA_IMPROVEMENTS_LIMA = 6,\n FATE_2 = 7,\n}\n\n/**\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}\n */\nexport enum ABI_VERSIONS {\n NO_ABI = 0,\n SOPHIA = 1,\n FATE = 3,\n}\n\nexport enum CallReturnType {\n Ok = 0,\n Error = 1,\n Revert = 2,\n}\n\n/**\n * @category transaction builder\n */\nexport enum PROTOCOL_VERSIONS {\n IRIS = 5,\n}\n\n// First abi/vm by default\nexport const PROTOCOL_VM_ABI = {\n [PROTOCOL_VERSIONS.IRIS]: {\n [Tag.ContractCreateTx]: {\n vmVersion: [VM_VERSIONS.FATE_2], abiVersion: [ABI_VERSIONS.FATE],\n },\n // TODO: Ensure that AEVM (SOPHIA?) is still available here\n [Tag.ContractCallTx]: {\n vmVersion: [], abiVersion: [ABI_VERSIONS.FATE, ABI_VERSIONS.SOPHIA],\n },\n [Tag.OracleRegisterTx]: {\n vmVersion: [], abiVersion: [ABI_VERSIONS.NO_ABI, ABI_VERSIONS.SOPHIA],\n },\n },\n} as const;\n\ntype PrefixType<Prefix> = Prefix extends Encoding\n ? Encoded.Generic<Prefix>\n : Prefix extends readonly Encoding[]\n ? Encoded.Generic<Prefix[number]>\n : Encoded.Generic<any>;\n\n/**\n * @category transaction builder\n */\nexport interface CtVersion {\n vmVersion: VM_VERSIONS;\n abiVersion: ABI_VERSIONS;\n}\n\n/**\n * @category transaction builder\n */\nexport enum FIELD_TYPES {\n string,\n binary,\n bool,\n hex,\n rlpBinary,\n rlpBinaries,\n rawBinary,\n signatures,\n offChainUpdates,\n callStack,\n proofOfInclusion,\n mptrees,\n ctVersion,\n sophiaCodeTypeInfo,\n payload,\n stateTree,\n}\n\ninterface BuildFieldTypes<Prefix extends undefined | Encoding | readonly Encoding[]> {\n [FIELD_TYPES.string]: string;\n [FIELD_TYPES.binary]: PrefixType<Prefix>;\n [FIELD_TYPES.bool]: Boolean;\n [FIELD_TYPES.hex]: string;\n [FIELD_TYPES.rlpBinary]: any;\n [FIELD_TYPES.rlpBinaries]: any[];\n [FIELD_TYPES.rawBinary]: Uint8Array;\n [FIELD_TYPES.signatures]: Uint8Array[];\n [FIELD_TYPES.offChainUpdates]: any;\n [FIELD_TYPES.callStack]: any;\n [FIELD_TYPES.proofOfInclusion]: any;\n [FIELD_TYPES.mptrees]: MPTree[];\n [FIELD_TYPES.ctVersion]: CtVersion;\n [FIELD_TYPES.sophiaCodeTypeInfo]: any;\n [FIELD_TYPES.payload]: string | undefined;\n [FIELD_TYPES.stateTree]: any;\n}\n\ntype TxElem = readonly [string, FIELD_TYPES | Field]\n| readonly [string, FIELD_TYPES, Encoding | readonly Encoding[]];\n\ntype BuildTxArgBySchemaType<\n Type extends FIELD_TYPES | Field,\n Prefix extends undefined | Encoding | readonly Encoding[],\n> =\n Type extends Field\n ? Parameters<Type['serialize']>[0]\n : Type extends FIELD_TYPES\n ? BuildFieldTypes<Prefix>[Type]\n : never;\n\ntype NullablePartial<\n T,\n NK extends keyof T = { [K in keyof T]: undefined extends T[K] ? K : never }[keyof T],\n> = Partial<Pick<T, NK>> & Omit<T, NK>;\n\ntype BuildTxArgBySchema<SchemaLine> =\n UnionToIntersection<\n SchemaLine extends ReadonlyArray<infer Elem>\n ? Elem extends TxElem\n ? NullablePartial<{ [k in Elem[0]]: BuildTxArgBySchemaType<Elem[1], Elem[2]> }>\n : never\n : never\n >;\n\nexport type RawTxObject<Tx extends TxSchema> = {\n [k in keyof Tx]-?: Tx[k] extends BigNumber ? string : Tx[k]\n};\n\nconst BASE_TX = [\n ['tag', shortUInt],\n ['VSN', shortUInt],\n] as const;\n\nexport const TX_SCHEMA = {\n [Tag.Account]: {\n 1: [\n ...BASE_TX,\n ['nonce', shortUInt],\n ['balance', uInt],\n ],\n 2: [\n ...BASE_TX,\n ['flags', uInt],\n ['nonce', shortUInt],\n ['balance', uInt],\n ['gaContract', address<Encoding.ContractAddress | Encoding.Name>()],\n ['gaAuthFun', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.SignedTx]: {\n 1: [\n ...BASE_TX,\n ['signatures', FIELD_TYPES.signatures],\n ['encodedTx', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.SpendTx]: {\n 1: [\n ...BASE_TX,\n ['senderId', address<Encoding.AccountAddress>()],\n ['recipientId', address<Encoding.AccountAddress | Encoding.Name>()],\n ['amount', coinAmount],\n ['fee', fee],\n ['ttl', shortUInt],\n ['nonce', shortUInt],\n ['payload', FIELD_TYPES.payload],\n ],\n },\n [Tag.NamePreclaimTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', address<Encoding.AccountAddress>()],\n ['nonce', shortUInt],\n ['commitmentId', address<Encoding.Commitment>()],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.NameClaimTx]: {\n 2: [\n ...BASE_TX,\n ['accountId', address<Encoding.AccountAddress>()],\n ['nonce', shortUInt],\n ['name', name],\n ['nameSalt', uInt],\n ['nameFee', nameFee],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.NameUpdateTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', address<Encoding.AccountAddress>()],\n ['nonce', shortUInt],\n ['nameId', nameId],\n ['nameTtl', shortUInt],\n ['pointers', pointers],\n ['clientTtl', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.NameTransferTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', address<Encoding.AccountAddress>()],\n ['nonce', shortUInt],\n ['nameId', nameId],\n ['recipientId', address<Encoding.AccountAddress | Encoding.Name>()],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.NameRevokeTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', address<Encoding.AccountAddress>()],\n ['nonce', shortUInt],\n ['nameId', nameId],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.Contract]: {\n 1: [\n ...BASE_TX,\n ['owner', address<Encoding.AccountAddress>()],\n ['ctVersion', FIELD_TYPES.ctVersion],\n ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['log', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['active', FIELD_TYPES.bool],\n ['referers', addresses<Encoding.AccountAddress>()],\n ['deposit', deposit],\n ],\n },\n [Tag.ContractCreateTx]: {\n 1: [\n ...BASE_TX,\n ['ownerId', address<Encoding.AccountAddress>()],\n ['nonce', shortUInt],\n ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['ctVersion', FIELD_TYPES.ctVersion],\n ['fee', fee],\n ['ttl', shortUInt],\n ['deposit', deposit],\n ['amount', coinAmount],\n ['gasLimit', gasLimit],\n ['gasPrice', gasPrice],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.ContractCallTx]: {\n 1: [\n ...BASE_TX,\n ['callerId', address<Encoding.AccountAddress>()],\n ['nonce', shortUInt],\n ['contractId', address<Encoding.ContractAddress | Encoding.Name>()],\n ['abiVersion', enumeration<ABI_VERSIONS>()],\n ['fee', fee],\n ['ttl', shortUInt],\n ['amount', coinAmount],\n ['gasLimit', gasLimit],\n ['gasPrice', gasPrice],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.ContractCall]: {\n 1: [\n ...BASE_TX,\n ['callerId', address<Encoding.AccountAddress>()],\n ['callerNonce', shortUInt],\n ['height', shortUInt],\n ['contractId', address<Encoding.ContractAddress>()],\n ['gasPrice', gasPrice],\n ['gasUsed', shortUInt],\n ['returnValue', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['returnType', enumeration<CallReturnType>()],\n // TODO: add serialization for\n // <log> :: [ { <address> :: id, [ <topics> :: binary() ], <data> :: binary() } ]\n ['log', FIELD_TYPES.rawBinary],\n ],\n },\n [Tag.OracleRegisterTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', address<Encoding.AccountAddress>()],\n ['nonce', shortUInt],\n ['queryFormat', FIELD_TYPES.string],\n ['responseFormat', FIELD_TYPES.string],\n ['queryFee', coinAmount],\n ['oracleTtlType', enumeration<ORACLE_TTL_TYPES>()],\n ['oracleTtlValue', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ['abiVersion', enumeration<ABI_VERSIONS>()],\n ],\n },\n [Tag.OracleExtendTx]: {\n 1: [\n ...BASE_TX,\n ['oracleId', address<Encoding.OracleAddress | Encoding.Name>()],\n ['nonce', shortUInt],\n ['oracleTtlType', enumeration<ORACLE_TTL_TYPES>()],\n ['oracleTtlValue', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.OracleQueryTx]: {\n 1: [\n ...BASE_TX,\n ['senderId', address<Encoding.AccountAddress>()],\n ['nonce', shortUInt],\n ['oracleId', address<Encoding.OracleAddress | Encoding.Name>()],\n ['query', FIELD_TYPES.string],\n ['queryFee', coinAmount],\n ['queryTtlType', enumeration<ORACLE_TTL_TYPES>()],\n ['queryTtlValue', shortUInt],\n ['responseTtlType', enumeration<ORACLE_TTL_TYPES>()],\n ['responseTtlValue', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.OracleResponseTx]: {\n 1: [\n ...BASE_TX,\n ['oracleId', address<Encoding.OracleAddress>()],\n ['nonce', shortUInt],\n ['queryId', FIELD_TYPES.binary, Encoding.OracleQueryId],\n ['response', FIELD_TYPES.string],\n ['responseTtlType', enumeration<ORACLE_TTL_TYPES>()],\n ['responseTtlValue', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.ChannelCreateTx]: {\n 2: [\n ...BASE_TX,\n ['initiator', address<Encoding.AccountAddress>()],\n ['initiatorAmount', uInt],\n ['responder', address<Encoding.AccountAddress>()],\n ['responderAmount', uInt],\n ['channelReserve', uInt],\n ['lockPeriod', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['initiatorDelegateIds', FIELD_TYPES.string],\n ['responderDelegateIds', FIELD_TYPES.string],\n ['stateHash', FIELD_TYPES.binary, Encoding.State],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelCloseMutualTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', address<Encoding.Channel>()],\n ['fromId', address<Encoding.AccountAddress>()],\n ['initiatorAmountFinal', uInt],\n ['responderAmountFinal', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelCloseSoloTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', address<Encoding.Channel>()],\n ['fromId', address<Encoding.AccountAddress>()],\n ['payload', FIELD_TYPES.binary, Encoding.Transaction],\n ['poi', FIELD_TYPES.binary, Encoding.Poi],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelSlashTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', address<Encoding.Channel>()],\n ['fromId', address<Encoding.AccountAddress>()],\n ['payload', FIELD_TYPES.binary, Encoding.Transaction],\n ['poi', FIELD_TYPES.binary, Encoding.Poi],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelDepositTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', address<Encoding.Channel>()],\n ['fromId', address<Encoding.AccountAddress>()],\n ['amount', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['stateHash', FIELD_TYPES.binary, Encoding.State],\n ['round', shortUInt],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelWithdrawTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', address<Encoding.Channel>()],\n ['toId', address<Encoding.AccountAddress>()],\n ['amount', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['stateHash', FIELD_TYPES.binary, Encoding.State],\n ['round', shortUInt],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelSettleTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', address<Encoding.Channel>()],\n ['fromId', address<Encoding.AccountAddress>()],\n ['initiatorAmountFinal', uInt],\n ['responderAmountFinal', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelForceProgressTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', address<Encoding.Channel>()],\n ['fromId', address<Encoding.AccountAddress>()],\n ['payload', FIELD_TYPES.binary, Encoding.Transaction],\n ['round', shortUInt],\n ['update', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['stateHash', FIELD_TYPES.binary, Encoding.State],\n ['offChainTrees', FIELD_TYPES.stateTree],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelOffChainTx]: {\n 2: [\n ...BASE_TX,\n ['channelId', address<Encoding.Channel>()],\n ['round', shortUInt],\n ['stateHash', FIELD_TYPES.binary, Encoding.State],\n ],\n },\n [Tag.Channel]: {\n 3: [\n ...BASE_TX,\n ['initiator', address<Encoding.AccountAddress>()],\n ['responder', address<Encoding.AccountAddress>()],\n ['channelAmount', uInt],\n ['initiatorAmount', uInt],\n ['responderAmount', uInt],\n ['channelReserve', uInt],\n ['initiatorDelegateIds', addresses<AddressEncodings>()],\n ['responderDelegateIds', addresses<AddressEncodings>()],\n ['stateHash', FIELD_TYPES.hex],\n ['round', shortUInt],\n ['soloRound', uInt],\n ['lockPeriod', uInt],\n ['lockedUntil', uInt],\n ['initiatorAuth', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['responderAuth', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.ChannelSnapshotSoloTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', address<Encoding.Channel>()],\n ['fromId', address<Encoding.AccountAddress>()],\n ['payload', FIELD_TYPES.binary, Encoding.Transaction],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelOffChainUpdateTransfer]: {\n 1: [\n ...BASE_TX,\n ['from', address<Encoding.AccountAddress>()],\n ['to', address<Encoding.AccountAddress>()],\n ['amount', uInt],\n ],\n },\n [Tag.ChannelOffChainUpdateDeposit]: {\n 1: [\n ...BASE_TX,\n ['from', address<Encoding.AccountAddress>()],\n ['amount', uInt],\n ],\n },\n [Tag.ChannelOffChainUpdateWithdraw]: {\n 1: [\n ...BASE_TX,\n ['from', address<Encoding.AccountAddress>()],\n ['amount', uInt],\n ],\n },\n [Tag.ChannelOffChainUpdateCreateContract]: {\n 1: [\n ...BASE_TX,\n ['owner', address<Encoding.AccountAddress>()],\n ['ctVersion', FIELD_TYPES.ctVersion],\n ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['deposit', uInt],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.ChannelOffChainUpdateCallContract]: {\n 1: [\n ...BASE_TX,\n ['caller', address<Encoding.AccountAddress>()],\n ['contract', address<Encoding.ContractAddress>()],\n ['abiVersion', enumeration<ABI_VERSIONS>()],\n ['amount', uInt],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['callStack', FIELD_TYPES.callStack],\n ['gasPrice', gasPrice],\n ['gasLimit', gasLimit],\n ],\n },\n [Tag.ChannelClientReconnectTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', address<Encoding.Channel>()],\n ['round', shortUInt],\n ['role', FIELD_TYPES.string],\n ['pubkey', address<Encoding.AccountAddress>()],\n ],\n },\n [Tag.TreesPoi]: {\n 1: [\n ...BASE_TX,\n ['accounts', FIELD_TYPES.mptrees],\n ['calls', FIELD_TYPES.mptrees],\n ['channels', FIELD_TYPES.mptrees],\n ['contracts', FIELD_TYPES.mptrees],\n ['ns', FIELD_TYPES.mptrees],\n ['oracles', FIELD_TYPES.mptrees],\n ],\n },\n [Tag.StateTrees]: {\n 1: [\n ...BASE_TX,\n ['contracts', FIELD_TYPES.rlpBinary],\n ['calls', FIELD_TYPES.rlpBinary],\n ['channels', FIELD_TYPES.rlpBinary],\n ['ns', FIELD_TYPES.rlpBinary],\n ['oracles', FIELD_TYPES.rlpBinary],\n ['accounts', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.Mtree]: {\n 1: [\n ...BASE_TX,\n ['values', FIELD_TYPES.rlpBinaries],\n ],\n },\n [Tag.MtreeValue]: {\n 1: [\n ...BASE_TX,\n ['key', FIELD_TYPES.hex],\n ['value', FIELD_TYPES.rawBinary],\n ],\n },\n [Tag.ContractsMtree]: {\n 1: [\n ...BASE_TX,\n ['contracts', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.CallsMtree]: {\n 1: [\n ...BASE_TX,\n ['calls', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.ChannelsMtree]: {\n 1: [\n ...BASE_TX,\n ['channels', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.NameserviceMtree]: {\n 1: [\n ...BASE_TX,\n ['mtree', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.OraclesMtree]: {\n 1: [\n ...BASE_TX,\n ['otree', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.AccountsMtree]: {\n 1: [\n ...BASE_TX,\n ['accounts', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.GaAttachTx]: {\n 1: [\n ...BASE_TX,\n ['ownerId', address<Encoding.AccountAddress>()],\n ['nonce', shortUInt],\n ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['authFun', FIELD_TYPES.rawBinary],\n ['ctVersion', FIELD_TYPES.ctVersion],\n ['fee', fee],\n ['ttl', shortUInt],\n ['gasLimit', gasLimit],\n ['gasPrice', gasPrice],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.GaMetaTx]: {\n 2: [\n ...BASE_TX,\n ['gaId', address<Encoding.AccountAddress>()],\n ['authData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['abiVersion', enumeration<ABI_VERSIONS>()],\n ['fee', fee],\n ['gasLimit', gasLimit],\n ['gasPrice', gasPrice],\n ['tx', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.PayingForTx]: {\n 1: [\n ...BASE_TX,\n ['payerId', address<Encoding.AccountAddress>()],\n ['nonce', shortUInt],\n ['fee', fee],\n ['tx', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.CompilerSophia]: {\n 3: [\n ...BASE_TX,\n ['sourceCodeHash', FIELD_TYPES.rawBinary],\n ['typeInfo', FIELD_TYPES.sophiaCodeTypeInfo],\n ['byteCode', FIELD_TYPES.rawBinary],\n ['compilerVersion', FIELD_TYPES.string],\n ['payable', FIELD_TYPES.bool],\n ],\n },\n} as const;\n\nexport type TxTypeSchemas = {\n [key in Tag]: BuildTxArgBySchema<\n typeof TX_SCHEMA[key][keyof typeof TX_SCHEMA[key]]\n >\n};\n\nexport type TxSchema = TxTypeSchemas[Tag];\nexport type TxParamsCommon = Partial<UnionToIntersection<TxSchema>>;\n","/*\n * ISC License (ISC)\n * Copyright (c) 2021 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/* eslint-disable default-case */\nimport { encode as rlpEncode } from 'rlp';\nimport type { Input } from 'rlp';\nimport { hash } from './crypto';\nimport {\n MerkleTreeHashMismatchError,\n MissingNodeInTreeError,\n UnknownPathNibbleError,\n UnknownNodeLengthError,\n} from './errors';\n\nenum NodeType {\n Branch,\n Extension,\n Leaf,\n}\n\nexport type MPTreeBinary = [Buffer, Array<[Buffer, Buffer[]]>];\n\nexport default class MPTree {\n private readonly rootHash: string;\n\n private readonly nodes: { [key: string]: Buffer[] };\n\n private static nodeHash(node: Input): string {\n return Buffer.from(hash(rlpEncode(node))).toString('hex');\n }\n\n /**\n * Deserialize Merkle Patricia Tree\n * @param binary - Binary\n * @returns Merkle Patricia Tree\n */\n constructor(binary: MPTreeBinary) {\n this.rootHash = binary[0].toString('hex');\n this.nodes = Object.fromEntries(\n binary[1].map((node) => [node[0].toString('hex'), node[1]]),\n );\n\n if (this.nodes[this.rootHash] === undefined) throw new MissingNodeInTreeError('Can\\'t find a node by root hash');\n Object.entries(this.nodes).forEach(([key, node]) => {\n if (MPTree.nodeHash(node) !== key) throw new MerkleTreeHashMismatchError();\n const { type, payload } = MPTree.parseNode(node);\n switch (type) {\n case NodeType.Branch:\n payload\n .slice(0, 16)\n .filter((n) => n.length)\n .forEach((n) => {\n if (this.nodes[n.toString('hex')] === undefined) {\n throw new MissingNodeInTreeError('Can\\'t find a node by hash in branch node');\n }\n });\n break;\n case NodeType.Extension:\n if (this.nodes[payload[0].toString('hex')] === undefined) {\n throw new MissingNodeInTreeError('Can\\'t find a node by hash in extension node');\n }\n }\n });\n }\n\n isEqual(tree: MPTree): boolean {\n return this.rootHash === tree.rootHash;\n }\n\n private static parseNode(node: Buffer[]): {\n type: NodeType;\n payload: Buffer[];\n path: string | null;\n } {\n switch (node.length) {\n case 17:\n return { type: NodeType.Branch, payload: node, path: null };\n case 2: {\n const nibble = node[0][0] >> 4; // eslint-disable-line no-bitwise\n if (nibble > 3) throw new UnknownPathNibbleError(nibble);\n const type = nibble <= 1 ? NodeType.Extension : NodeType.Leaf;\n const slice = [0, 2].includes(nibble) ? 2 : 1;\n return { type, payload: [node[1]], path: node[0].toString('hex').slice(slice) };\n }\n default:\n throw new UnknownNodeLengthError(node.length);\n }\n }\n\n /**\n * Serialize Merkle Patricia Tree\n * @returns Binary\n */\n serialize(): MPTreeBinary {\n return [\n Buffer.from(this.rootHash, 'hex'),\n Object.entries(this.nodes).map(([mptHash, value]) => ([\n Buffer.from(mptHash, 'hex'),\n value,\n ])),\n ];\n }\n\n /**\n * Retrieve value from Merkle Patricia Tree\n * @param _key - The key of the element to retrieve\n * @returns Value associated to the specified key\n */\n get(_key: string): Buffer | undefined {\n let searchFrom = this.rootHash;\n let key = _key;\n while (true) { // eslint-disable-line no-constant-condition\n const { type, payload, path } = MPTree.parseNode(this.nodes[searchFrom]);\n switch (type) {\n case NodeType.Branch:\n if (key.length === 0) return payload[16];\n searchFrom = payload[+`0x${key[0]}`].toString('hex');\n key = key.substring(1);\n break;\n case NodeType.Extension:\n if (key.substring(0, path?.length) !== path) return undefined;\n searchFrom = payload[0].toString('hex');\n key = key.substring(path.length);\n break;\n case NodeType.Leaf:\n if (path !== key) return undefined;\n return payload[0];\n }\n }\n }\n}\n","import { decode as rlpDecode, encode as rlpEncode, NestedUint8Array } from 'rlp';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../utils/encoder';\nimport { AE_AMOUNT_FORMATS } from '../../utils/amount-formatter';\nimport { hash } from '../../utils/crypto';\nimport { Field } from './field-types';\nimport {\n FIELD_TYPES,\n RawTxObject,\n TX_SCHEMA,\n TxField,\n TxParamsCommon,\n TxSchema,\n TxTypeSchemas,\n} from './schema';\nimport { Tag } from './constants';\nimport { buildContractId, readInt } from './helpers';\nimport { toBytes } from '../../utils/bytes';\nimport MPTree, { MPTreeBinary } from '../../utils/mptree';\nimport {\n ArgumentError,\n DecodeError,\n InvalidTxParamsError,\n SchemaNotFoundError,\n} from '../../utils/errors';\nimport { isKeyOfObject } from '../../utils/other';\n\n/**\n * JavaScript-based Transaction builder\n */\n\n// SERIALIZE AND DESERIALIZE PART\nfunction deserializeField(\n value: any,\n type: FIELD_TYPES | Field,\n prefix?: Encoding | Encoding[],\n): any {\n if (value == null) return '';\n switch (type) {\n case FIELD_TYPES.ctVersion: {\n const [vm, , abi] = value;\n return {\n vmVersion: readInt(Buffer.from([vm])),\n abiVersion: readInt(Buffer.from([abi])),\n };\n }\n case FIELD_TYPES.bool:\n return value[0] === 1;\n case FIELD_TYPES.binary:\n return encode(value, prefix as Encoding);\n case FIELD_TYPES.stateTree:\n return encode(value, Encoding.StateTrees);\n case FIELD_TYPES.string:\n return value.toString();\n case FIELD_TYPES.payload:\n return encode(value, Encoding.Bytearray);\n case FIELD_TYPES.rlpBinary:\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return unpackTx(encode(value, Encoding.Transaction));\n case FIELD_TYPES.rlpBinaries:\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return value.map((v: Buffer) => unpackTx(encode(v, Encoding.Transaction)));\n case FIELD_TYPES.rawBinary:\n return value;\n case FIELD_TYPES.hex:\n return value.toString('hex');\n case FIELD_TYPES.offChainUpdates:\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return value.map((v: Buffer) => unpackTx(encode(v, Encoding.Transaction)));\n case FIELD_TYPES.callStack:\n // TODO: fix this\n return [readInt(value)];\n case FIELD_TYPES.mptrees:\n return value.map((t: MPTreeBinary) => new MPTree(t));\n case FIELD_TYPES.sophiaCodeTypeInfo:\n return value.reduce(\n (acc: object, [funHash, fnName, argType, outType]: [\n funHash: Buffer,\n fnName: string,\n argType: string,\n outType: string,\n ]) => ({\n ...acc,\n [fnName.toString()]: { funHash, argType, outType },\n }),\n {},\n );\n default:\n if (typeof type === 'number') return value;\n return type.deserialize(value);\n }\n}\n\nfunction serializeField(value: any, type: FIELD_TYPES | Field, params: any): any {\n switch (type) {\n case FIELD_TYPES.bool:\n return Buffer.from([(value === true) ? 1 : 0]);\n case FIELD_TYPES.binary:\n return decode(value);\n case FIELD_TYPES.stateTree:\n return decode(value);\n case FIELD_TYPES.hex:\n return Buffer.from(value, 'hex');\n case FIELD_TYPES.signatures:\n return value.map(Buffer.from);\n case FIELD_TYPES.payload:\n return typeof value === 'string' && value.split('_')[0] === 'ba'\n ? decode(value as Encoded.Bytearray)\n : toBytes(value);\n case FIELD_TYPES.string:\n return toBytes(value);\n case FIELD_TYPES.rlpBinary:\n return value.rlpEncoded ?? value;\n case FIELD_TYPES.mptrees:\n return value.map((t: MPTree) => t.serialize());\n case FIELD_TYPES.ctVersion:\n return Buffer.from([...toBytes(value.vmVersion), 0, ...toBytes(value.abiVersion)]);\n default:\n if (typeof type === 'number') return value;\n return type.serialize(value, params);\n }\n}\n\nfunction validateField(\n value: any,\n type: FIELD_TYPES | Field,\n): string | undefined {\n // All fields are required\n if (value == null) return 'Field is required';\n\n // Validate type of value\n switch (type) {\n case FIELD_TYPES.ctVersion:\n if (!(Boolean(value.abiVersion) && Boolean(value.vmVersion))) {\n return 'Value must be an object with \"vmVersion\" and \"abiVersion\" fields';\n }\n return undefined;\n default:\n return undefined;\n }\n}\n\n/**\n * Validate transaction params\n * @category transaction builder\n * @param params - Object with tx params\n * @param schema - Transaction schema\n * @param excludeKeys - Array of keys to exclude for validation\n * @returns Object with validation errors\n */\nfunction validateParams(\n params: any,\n schema: TxField[],\n { excludeKeys = [] }: { excludeKeys: string[] },\n): object {\n const optionalFields = ['payload', 'nameFee', 'deposit', 'gasPrice', 'fee', 'gasLimit', 'amount'];\n return Object.fromEntries(\n schema\n // TODO: allow optional keys in schema\n .filter(([key]) => !excludeKeys.includes(key) && !optionalFields.includes(key))\n .map(([key, type]) => [key, validateField(params[key], type)])\n .filter(([, message]) => message),\n );\n}\n\n/**\n * Unpack binary transaction\n * @category transaction builder\n * @param binary - Array with binary transaction field's\n * @param schema - Transaction schema\n * @returns Object with transaction field's\n */\nfunction unpackRawTx<Tx extends TxSchema>(\n binary: Uint8Array | NestedUint8Array,\n schema: TxField[],\n): RawTxObject<Tx> {\n return schema\n .reduce<any>(\n (\n acc,\n [key, fieldType, prefix],\n index,\n ) => Object.assign(acc, { [key]: deserializeField(binary[index], fieldType, prefix) }),\n {},\n );\n}\n\n/**\n * @category transaction builder\n */\nexport interface BuiltTx<Tx extends TxSchema, Prefix extends Encoding> {\n tx: Encoded.Generic<Prefix>;\n rlpEncoded: Uint8Array;\n binary: Uint8Array;\n txObject: RawTxObject<Tx>;\n}\n\n/**\n * Build transaction hash\n * @category transaction builder\n * @param _params - Object with tx params\n * @param type - Transaction type\n * @param options - options\n * @param options.excludeKeys - Array of keys to exclude for validation and build\n * @param options.denomination - Denomination of amounts\n * @param options.prefix - Prefix of transaction\n * @throws {@link InvalidTxParamsError}\n * @returns object\n * @returns object.tx Base64Check transaction hash with 'tx_' prefix\n * @returns object.rlpEncoded rlp encoded transaction\n * @returns object.binary binary transaction\n */\nexport function buildTx<TxType extends Tag, Prefix>(\n _params: Omit<TxTypeSchemas[TxType], 'tag' | 'VSN'> & { VSN?: number },\n type: TxType,\n {\n excludeKeys = [],\n prefix = Encoding.Transaction,\n vsn,\n denomination = AE_AMOUNT_FORMATS.AETTOS,\n }: {\n excludeKeys?: string[];\n prefix?: Encoding;\n vsn?: number;\n denomination?: AE_AMOUNT_FORMATS;\n } = {},\n): BuiltTx<TxSchema, Prefix extends Encoding ? Prefix : Encoding.Transaction> {\n const schemas = TX_SCHEMA[type];\n\n vsn ??= Math.max(...Object.keys(schemas).map((a) => +a));\n if (!isKeyOfObject(vsn, schemas)) throw new SchemaNotFoundError('serialization', Tag[type], vsn);\n\n const schema = schemas[vsn] as unknown as TxField[];\n\n const params = _params as TxParamsCommon & { onNode: Node; denomination?: AE_AMOUNT_FORMATS };\n params.VSN = vsn;\n params.tag = type;\n params.denomination = denomination;\n const filteredSchema = schema.filter(([key]) => !excludeKeys.includes(key));\n\n // Validation\n const valid = validateParams(params, schema, { excludeKeys });\n if (Object.keys(valid).length > 0) {\n throw new InvalidTxParamsError(`Transaction build error. ${JSON.stringify(valid)}`);\n }\n\n const binary = filteredSchema\n .map(([key, fieldType]: [keyof TxSchema, FIELD_TYPES, Encoding]) => (\n serializeField(\n params[key],\n fieldType,\n {\n ...params,\n txType: type,\n rebuildTx: (overrideParams: any) => buildTx(\n { ...params, ...overrideParams },\n type,\n {\n excludeKeys, prefix: Encoding.Transaction, vsn, denomination,\n },\n ),\n },\n )\n ))\n .filter((e) => e !== undefined);\n\n const rlpEncoded = rlpEncode(binary);\n const tx = encode(rlpEncoded, prefix);\n return {\n tx,\n rlpEncoded,\n binary,\n txObject: unpackRawTx<TxTypeSchemas[Tag]>(binary, schema),\n } as any;\n}\n\n/**\n * @category transaction builder\n */\nexport interface TxUnpacked<Tx extends TxSchema> {\n txType: Tag;\n tx: RawTxObject<Tx>;\n rlpEncoded: Uint8Array;\n}\n/**\n * Unpack transaction hash\n * @category transaction builder\n * @param encodedTx - Transaction to unpack\n * @param txType - Expected transaction type\n * @returns object\n * @returns object.tx Object with transaction param's\n * @returns object.txType Transaction type\n */\nexport function unpackTx<TxType extends Tag>(\n encodedTx: Encoded.Transaction | Encoded.Poi,\n txType?: TxType,\n): TxUnpacked<TxTypeSchemas[TxType]> {\n const rlpEncoded = decode(encodedTx);\n const binary = rlpDecode(rlpEncoded);\n const objId = +readInt(binary[0] as Buffer);\n if (!isKeyOfObject(objId, TX_SCHEMA)) throw new DecodeError(`Unknown transaction tag: ${objId}`);\n if (txType != null && txType !== objId) throw new DecodeError(`Expected transaction to have ${Tag[txType]} tag, got ${Tag[objId]} instead`);\n const vsn = +readInt(binary[1] as Buffer);\n if (!isKeyOfObject(vsn, TX_SCHEMA[objId])) throw new SchemaNotFoundError('deserialization', `tag ${objId}`, vsn);\n const schema = TX_SCHEMA[objId][vsn];\n return {\n txType: objId,\n tx: unpackRawTx<TxTypeSchemas[TxType]>(binary, schema),\n rlpEncoded,\n };\n}\n\n/**\n * Build a transaction hash\n * @category transaction builder\n * @param rawTx - base64 or rlp encoded transaction\n * @returns Transaction hash\n */\nexport function buildTxHash(rawTx: Encoded.Transaction | Uint8Array): Encoded.TxHash {\n const data = typeof rawTx === 'string' && rawTx.startsWith('tx_')\n ? decode(rawTx)\n : rawTx;\n return encode(hash(data), Encoding.TxHash);\n}\n\n/**\n * Build a contract public key by contractCreateTx or gaAttach\n * @category contract\n * @param contractTx - Transaction\n * @returns Contract public key\n */\nexport function buildContractIdByContractTx(\n contractTx: Encoded.Transaction,\n): Encoded.ContractAddress {\n const { txType, tx } = unpackTx<Tag.ContractCreateTx | Tag.GaAttachTx>(contractTx);\n if (![Tag.ContractCreateTx, Tag.GaAttachTx].includes(txType)) {\n throw new ArgumentError('contractCreateTx', 'a contractCreateTx or gaAttach', txType);\n }\n return buildContractId(tx.ownerId, +tx.nonce);\n}\n","export default function _classExtractFieldDescriptor(receiver, privateMap, action) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to \" + action + \" private field on non-instance\");\n }\n return privateMap.get(receiver);\n}","import classApplyDescriptorGet from \"./classApplyDescriptorGet.js\";\nimport classExtractFieldDescriptor from \"./classExtractFieldDescriptor.js\";\nexport default function _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"get\");\n return classApplyDescriptorGet(receiver, descriptor);\n}","export default function _classApplyDescriptorGet(receiver, descriptor) {\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n return descriptor.value;\n}","import classApplyDescriptorSet from \"./classApplyDescriptorSet.js\";\nimport classExtractFieldDescriptor from \"./classExtractFieldDescriptor.js\";\nexport default function _classPrivateFieldSet(receiver, privateMap, value) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"set\");\n classApplyDescriptorSet(receiver, descriptor, value);\n return value;\n}","export default function _classApplyDescriptorSet(receiver, descriptor, value) {\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n throw new TypeError(\"attempted to set read only private field\");\n }\n descriptor.value = value;\n }\n}","export default function semverSatisfies(\n version: string,\n geVersion: string,\n ltVersion: string,\n): boolean {\n const getComponents = (v: string): number[] => v\n .split(/[-+]/)[0].split('.').map((i) => +i);\n\n const versionComponents = getComponents(version);\n const geComponents = getComponents(geVersion);\n const ltComponents = getComponents(ltVersion);\n\n const base = Math.max(...versionComponents, ...geComponents, ...ltComponents) + 1;\n const componentsToNumber = (components: number[]): number => components.reverse()\n .reduce((acc, n, idx) => acc + n * base ** idx, 0);\n\n const vNumber = componentsToNumber(versionComponents);\n const geNumber = componentsToNumber(geComponents);\n const ltNumber = componentsToNumber(ltComponents);\n return vNumber >= geNumber && vNumber < ltNumber;\n}\n","import { RestError, PipelineResponse, PipelinePolicy } from '@azure/core-rest-pipeline';\nimport { AdditionalPolicyConfig } from '@azure/core-client';\nimport { pause } from './other';\nimport semverSatisfies from './semver-satisfies';\nimport { UnsupportedVersionError } from './errors';\n\nexport const genRequestQueuesPolicy = (): AdditionalPolicyConfig => {\n const requestQueues = new Map<string, Promise<unknown>>();\n\n return {\n policy: {\n name: 'request-queues',\n async sendRequest(request, next) {\n const key = request.headers.get('__queue');\n request.headers.delete('__queue');\n const getResponse = async (): Promise<PipelineResponse> => next(request);\n if (key == null) return getResponse();\n const req = (requestQueues.get(key) ?? Promise.resolve()).then(getResponse, getResponse);\n // TODO: remove after fixing https://github.com/aeternity/aeternity/issues/3803\n // gap to ensure that node won't reject the nonce\n requestQueues.set(key, req.then(async () => pause(750)));\n return req;\n },\n },\n position: 'perCall',\n };\n};\n\nexport const genCombineGetRequestsPolicy = (): AdditionalPolicyConfig => {\n const pendingGetRequests = new Map<string, Promise<PipelineResponse>>();\n\n return {\n policy: {\n name: 'combine-get-requests',\n async sendRequest(request, next) {\n if (request.method !== 'GET') return next(request);\n const key = JSON.stringify([request.url, request.body]);\n const response = pendingGetRequests.get(key) ?? next(request);\n pendingGetRequests.set(key, response);\n try {\n return await response;\n } finally {\n pendingGetRequests.delete(key);\n }\n },\n },\n position: 'perCall',\n };\n};\n\nexport const genAggressiveCacheGetResponsesPolicy = (): PipelinePolicy => {\n const getRequests = new Map<string, Promise<PipelineResponse>>();\n\n return {\n name: 'aggressive-cache-get-responses',\n async sendRequest(request, next) {\n if (request.method !== 'GET') return next(request);\n const key = JSON.stringify([request.url, request.body]);\n const response = getRequests.get(key) ?? next(request);\n getRequests.set(key, response);\n return response;\n },\n };\n};\n\nexport const genErrorFormatterPolicy = (\n getMessage: (b: any) => string,\n): AdditionalPolicyConfig => ({\n policy: {\n name: 'error-formatter',\n async sendRequest(request, next) {\n try {\n return await next(request);\n } catch (error) {\n if (!(error instanceof RestError) || error.request == null) throw error;\n if (error.response?.bodyAsText == null) throw error;\n\n let body;\n try {\n body = JSON.parse(error.response.bodyAsText);\n } catch (e) {\n throw error;\n }\n error.message = `${new URL(error.request.url).pathname.slice(1)} error`;\n const message = getMessage(body);\n if (message !== '') error.message += `:${message}`;\n throw error;\n }\n },\n },\n position: 'perCall',\n});\n\nexport const genVersionCheckPolicy = (\n name: string,\n ignorePath: string,\n versionPromise: Promise<string>,\n geVersion: string,\n ltVersion: string,\n): PipelinePolicy => ({\n name: 'version-check',\n async sendRequest(request, next) {\n if (new URL(request.url).pathname === ignorePath) return next(request);\n const args = [await versionPromise, geVersion, ltVersion] as const;\n if (!semverSatisfies(...args)) throw new UnsupportedVersionError(name, ...args);\n return next(request);\n },\n});\n","import * as coreClient from \"@azure/core-client\";\n\nexport const Header: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Header\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevHash: {\n serializedName: \"prev_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevKeyHash: {\n serializedName: \"prev_key_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n miner: {\n serializedName: \"miner\",\n type: {\n name: \"String\"\n }\n },\n beneficiary: {\n serializedName: \"beneficiary\",\n type: {\n name: \"String\"\n }\n },\n target: {\n serializedName: \"target\",\n type: {\n name: \"String\"\n }\n },\n pow: {\n constraints: {\n MinItems: 42,\n MaxItems: 42\n },\n serializedName: \"pow\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n time: {\n serializedName: \"time\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n info: {\n serializedName: \"info\",\n type: {\n name: \"String\"\n }\n },\n pofHash: {\n serializedName: \"pof_hash\",\n type: {\n name: \"String\"\n }\n },\n txsHash: {\n serializedName: \"txs_hash\",\n type: {\n name: \"String\"\n }\n },\n signature: {\n serializedName: \"signature\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ErrorModel: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorModel\",\n modelProperties: {\n reason: {\n serializedName: \"reason\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const KeyBlock: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"KeyBlock\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevHash: {\n serializedName: \"prev_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevKeyHash: {\n serializedName: \"prev_key_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n miner: {\n serializedName: \"miner\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n beneficiary: {\n serializedName: \"beneficiary\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n target: {\n serializedName: \"target\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pow: {\n constraints: {\n MinItems: 42,\n MaxItems: 42\n },\n serializedName: \"pow\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n time: {\n serializedName: \"time\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n info: {\n serializedName: \"info\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const HashResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"HashResponse\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const HeightResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"HeightResponse\",\n modelProperties: {\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const MicroBlockHeader: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"MicroBlockHeader\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pofHash: {\n serializedName: \"pof_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevHash: {\n serializedName: \"prev_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevKeyHash: {\n serializedName: \"prev_key_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n txsHash: {\n serializedName: \"txs_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n signature: {\n serializedName: \"signature\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n time: {\n serializedName: \"time\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SignedTxs: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SignedTxs\",\n modelProperties: {\n transactions: {\n serializedName: \"transactions\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const SignedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SignedTx\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"Tx\"\n }\n },\n blockHeight: {\n serializedName: \"block_height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n blockHash: {\n serializedName: \"block_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n signatures: {\n serializedName: \"signatures\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Tx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Tx\",\n uberParent: \"Tx\",\n polymorphicDiscriminator: {\n serializedName: \"type\",\n clientName: \"type\"\n },\n modelProperties: {\n recipientId: {\n serializedName: \"recipient_id\",\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n type: {\n name: \"String\"\n }\n },\n initiatorId: {\n serializedName: \"initiator_id\",\n type: {\n name: \"String\"\n }\n },\n initiatorAmount: {\n serializedName: \"initiator_amount\",\n type: {\n name: \"String\"\n }\n },\n responderId: {\n serializedName: \"responder_id\",\n type: {\n name: \"String\"\n }\n },\n responderAmount: {\n serializedName: \"responder_amount\",\n type: {\n name: \"String\"\n }\n },\n channelReserve: {\n serializedName: \"channel_reserve\",\n type: {\n name: \"String\"\n }\n },\n lockPeriod: {\n serializedName: \"lock_period\",\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n type: {\n name: \"String\"\n }\n },\n delegateIds: {\n serializedName: \"delegate_ids\",\n type: {\n name: \"Composite\",\n className: \"Delegates\"\n }\n },\n channelId: {\n serializedName: \"channel_id\",\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n type: {\n name: \"String\"\n }\n },\n toId: {\n serializedName: \"to_id\",\n type: {\n name: \"String\"\n }\n },\n update: {\n serializedName: \"update\",\n type: {\n name: \"Composite\",\n className: \"OffChainUpdate\"\n }\n },\n offchainTrees: {\n serializedName: \"offchain_trees\",\n type: {\n name: \"String\"\n }\n },\n initiatorAmountFinal: {\n serializedName: \"initiator_amount_final\",\n type: {\n name: \"String\"\n }\n },\n responderAmountFinal: {\n serializedName: \"responder_amount_final\",\n type: {\n name: \"String\"\n }\n },\n poi: {\n serializedName: \"poi\",\n type: {\n name: \"String\"\n }\n },\n initiatorDelegateIds: {\n serializedName: \"initiator_delegate_ids\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n responderDelegateIds: {\n serializedName: \"responder_delegate_ids\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n queryFormat: {\n serializedName: \"query_format\",\n type: {\n name: \"String\"\n }\n },\n responseFormat: {\n serializedName: \"response_format\",\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n type: {\n name: \"String\"\n }\n },\n oracleTtl: {\n serializedName: \"oracle_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n type: {\n name: \"String\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n type: {\n name: \"String\"\n }\n },\n query: {\n serializedName: \"query\",\n type: {\n name: \"String\"\n }\n },\n queryTtl: {\n serializedName: \"query_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n queryId: {\n serializedName: \"query_id\",\n type: {\n name: \"String\"\n }\n },\n response: {\n serializedName: \"response\",\n type: {\n name: \"String\"\n }\n },\n commitmentId: {\n serializedName: \"commitment_id\",\n type: {\n name: \"String\"\n }\n },\n name: {\n serializedName: \"name\",\n type: {\n name: \"String\"\n }\n },\n nameSalt: {\n serializedName: \"name_salt\",\n type: {\n name: \"String\"\n }\n },\n nameFee: {\n serializedName: \"name_fee\",\n type: {\n name: \"String\"\n }\n },\n nameId: {\n serializedName: \"name_id\",\n type: {\n name: \"String\"\n }\n },\n nameTtl: {\n serializedName: \"name_ttl\",\n type: {\n name: \"String\"\n }\n },\n pointers: {\n serializedName: \"pointers\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"NamePointer\"\n }\n }\n }\n },\n clientTtl: {\n serializedName: \"client_ttl\",\n type: {\n name: \"String\"\n }\n },\n ownerId: {\n serializedName: \"owner_id\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n type: {\n name: \"String\"\n }\n },\n deposit: {\n serializedName: \"deposit\",\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n type: {\n name: \"String\"\n }\n },\n callerId: {\n serializedName: \"caller_id\",\n type: {\n name: \"String\"\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n type: {\n name: \"String\"\n }\n },\n authFun: {\n constraints: {\n Pattern: new RegExp(\"^(0x|0X)?[a-fA-F0-9]+$\")\n },\n serializedName: \"auth_fun\",\n type: {\n name: \"String\"\n }\n },\n gaId: {\n serializedName: \"ga_id\",\n type: {\n name: \"String\"\n }\n },\n authData: {\n serializedName: \"auth_data\",\n type: {\n name: \"String\"\n }\n },\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n },\n payerId: {\n serializedName: \"payer_id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\n \"SpendTx\",\n \"ChannelCreateTx\",\n \"ChannelDepositTx\",\n \"ChannelWithdrawTx\",\n \"ChannelForceProgressTx\",\n \"ChannelCloseMutualTx\",\n \"ChannelCloseSoloTx\",\n \"ChannelSlashTx\",\n \"ChannelSettleTx\",\n \"ChannelSnapshotSoloTx\",\n \"ChannelSetDelegatesTx\",\n \"OracleRegisterTx\",\n \"OracleExtendTx\",\n \"OracleQueryTx\",\n \"OracleRespondTx\",\n \"NamePreclaimTx\",\n \"NameClaimTx\",\n \"NameUpdateTx\",\n \"NameTransferTx\",\n \"NameRevokeTx\",\n \"ContractCreateTx\",\n \"ContractCallTx\",\n \"GAAttachTx\",\n \"GAMetaTx\",\n \"PayingForTx\"\n ]\n }\n }\n }\n }\n};\n\nexport const Delegates: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Delegates\",\n modelProperties: {\n initiator: {\n serializedName: \"initiator\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n responder: {\n serializedName: \"responder\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const OffChainUpdate: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OffChainUpdate\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: {\n serializedName: \"op\",\n clientName: \"op\"\n },\n modelProperties: {\n op: {\n serializedName: \"op\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const RelativeTTL: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\",\n modelProperties: {\n type: {\n defaultValue: \"delta\",\n isConstant: true,\n serializedName: \"type\",\n type: {\n name: \"String\"\n }\n },\n value: {\n serializedName: \"value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Ttl: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Ttl\",\n modelProperties: {\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"delta\", \"block\"]\n }\n },\n value: {\n serializedName: \"value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NamePointer: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NamePointer\",\n modelProperties: {\n key: {\n serializedName: \"key\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CountResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CountResponse\",\n modelProperties: {\n count: {\n serializedName: \"count\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Generation: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Generation\",\n modelProperties: {\n keyBlock: {\n serializedName: \"key_block\",\n type: {\n name: \"Composite\",\n className: \"KeyBlock\"\n }\n },\n microBlocks: {\n serializedName: \"micro_blocks\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Account: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Account\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n balance: {\n serializedName: \"balance\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payable: {\n serializedName: \"payable\",\n type: {\n name: \"Boolean\"\n }\n },\n kind: {\n serializedName: \"kind\",\n type: {\n name: \"Enum\",\n allowedValues: [\"basic\", \"generalized\"]\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n type: {\n name: \"String\"\n }\n },\n authFun: {\n serializedName: \"auth_fun\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NextNonceResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NextNonceResponse\",\n modelProperties: {\n nextNonce: {\n serializedName: \"next_nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DryRunInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunInput\",\n modelProperties: {\n top: {\n serializedName: \"top\",\n type: {\n name: \"String\"\n }\n },\n accounts: {\n serializedName: \"accounts\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"DryRunAccount\"\n }\n }\n }\n },\n txs: {\n serializedName: \"txs\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"DryRunInputItem\"\n }\n }\n }\n },\n txEvents: {\n defaultValue: false,\n serializedName: \"tx_events\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\n\nexport const DryRunAccount: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunAccount\",\n modelProperties: {\n pubKey: {\n serializedName: \"pub_key\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DryRunInputItem: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunInputItem\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"String\"\n }\n },\n callReq: {\n serializedName: \"call_req\",\n type: {\n name: \"Composite\",\n className: \"DryRunCallReq\"\n }\n }\n }\n }\n};\n\nexport const DryRunCallReq: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunCallReq\",\n modelProperties: {\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contract: {\n serializedName: \"contract\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n type: {\n name: \"String\"\n }\n },\n caller: {\n serializedName: \"caller\",\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n type: {\n name: \"String\"\n }\n },\n context: {\n serializedName: \"context\",\n type: {\n name: \"Composite\",\n className: \"DryRunCallContext\"\n }\n }\n }\n }\n};\n\nexport const DryRunCallContext: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunCallContext\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"String\"\n }\n },\n txHash: {\n serializedName: \"tx_hash\",\n type: {\n name: \"String\"\n }\n },\n stateful: {\n serializedName: \"stateful\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\n\nexport const DryRunResults: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunResults\",\n modelProperties: {\n results: {\n serializedName: \"results\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"DryRunResult\"\n }\n }\n }\n },\n txEvents: {\n serializedName: \"tx_events\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n }\n }\n};\n\nexport const DryRunResult: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunResult\",\n modelProperties: {\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n result: {\n serializedName: \"result\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n reason: {\n serializedName: \"reason\",\n type: {\n name: \"String\"\n }\n },\n callObj: {\n serializedName: \"call_obj\",\n type: {\n name: \"Composite\",\n className: \"ContractCallObject\"\n }\n }\n }\n }\n};\n\nexport const ContractCallObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractCallObject\",\n modelProperties: {\n callerId: {\n serializedName: \"caller_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callerNonce: {\n serializedName: \"caller_nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasUsed: {\n serializedName: \"gas_used\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n log: {\n serializedName: \"log\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"Event\"\n }\n }\n }\n },\n returnValue: {\n serializedName: \"return_value\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n returnType: {\n serializedName: \"return_type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"ok\", \"error\", \"revert\"]\n }\n }\n }\n }\n};\n\nexport const Event: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Event\",\n modelProperties: {\n address: {\n serializedName: \"address\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topics: {\n serializedName: \"topics\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n data: {\n serializedName: \"data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const TxInfoObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"TxInfoObject\",\n modelProperties: {\n callInfo: {\n serializedName: \"call_info\",\n type: {\n name: \"Composite\",\n className: \"ContractCallObject\"\n }\n },\n gaInfo: {\n serializedName: \"ga_info\",\n type: {\n name: \"Composite\",\n className: \"GAObject\"\n }\n },\n txInfo: {\n serializedName: \"tx_info\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const GAObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"GAObject\",\n modelProperties: {\n callerId: {\n serializedName: \"caller_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasUsed: {\n serializedName: \"gas_used\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n returnValue: {\n serializedName: \"return_value\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n returnType: {\n serializedName: \"return_type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"ok\", \"error\"]\n }\n },\n innerObject: {\n serializedName: \"inner_object\",\n type: {\n name: \"Composite\",\n className: \"TxInfoObject\"\n }\n }\n }\n }\n};\n\nexport const EncodedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EncodedTx\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PostTxResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PostTxResponse\",\n modelProperties: {\n txHash: {\n serializedName: \"tx_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ContractObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractObject\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ownerId: {\n serializedName: \"owner_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n active: {\n serializedName: \"active\",\n required: true,\n type: {\n name: \"Boolean\"\n }\n },\n referrerIds: {\n serializedName: \"referrer_ids\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n deposit: {\n serializedName: \"deposit\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ByteCode: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ByteCode\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PoI: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PoI\",\n modelProperties: {\n poi: {\n serializedName: \"poi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const RegisteredOracle: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"RegisteredOracle\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFormat: {\n serializedName: \"query_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseFormat: {\n serializedName: \"response_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleQueries: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleQueries\",\n modelProperties: {\n oracleQueries: {\n serializedName: \"oracle_queries\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"OracleQuery\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const OracleQuery: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleQuery\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n senderNonce: {\n serializedName: \"sender_nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n query: {\n serializedName: \"query\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n response: {\n serializedName: \"response\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameEntry: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameEntry\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n owner: {\n serializedName: \"owner\",\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pointers: {\n serializedName: \"pointers\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"NamePointer\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Channel: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Channel\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorId: {\n serializedName: \"initiator_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderId: {\n serializedName: \"responder_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n channelAmount: {\n serializedName: \"channel_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmount: {\n serializedName: \"initiator_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmount: {\n serializedName: \"responder_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n channelReserve: {\n serializedName: \"channel_reserve\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n delegateIds: {\n serializedName: \"delegate_ids\",\n type: {\n name: \"Composite\",\n className: \"Delegates\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n soloRound: {\n serializedName: \"solo_round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lockPeriod: {\n serializedName: \"lock_period\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lockedUntil: {\n serializedName: \"locked_until\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerPubKey: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerPubKey\",\n modelProperties: {\n pubkey: {\n serializedName: \"pubkey\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Status: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Status\",\n modelProperties: {\n genesisKeyBlockHash: {\n serializedName: \"genesis_key_block_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n solutions: {\n serializedName: \"solutions\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n difficulty: {\n serializedName: \"difficulty\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n syncing: {\n serializedName: \"syncing\",\n required: true,\n type: {\n name: \"Boolean\"\n }\n },\n syncProgress: {\n constraints: {\n InclusiveMaximum: 100,\n InclusiveMinimum: 0\n },\n serializedName: \"sync_progress\",\n type: {\n name: \"Number\"\n }\n },\n listening: {\n serializedName: \"listening\",\n required: true,\n type: {\n name: \"Boolean\"\n }\n },\n protocols: {\n serializedName: \"protocols\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"Protocol\"\n }\n }\n }\n },\n nodeVersion: {\n serializedName: \"node_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nodeRevision: {\n serializedName: \"node_revision\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n peerCount: {\n serializedName: \"peer_count\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n peerConnections: {\n serializedName: \"peer_connections\",\n type: {\n name: \"Composite\",\n className: \"PeerConnections\"\n }\n },\n pendingTransactionsCount: {\n serializedName: \"pending_transactions_count\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n networkId: {\n serializedName: \"network_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n peerPubkey: {\n serializedName: \"peer_pubkey\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topKeyBlockHash: {\n serializedName: \"top_key_block_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topBlockHeight: {\n serializedName: \"top_block_height\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Protocol: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Protocol\",\n modelProperties: {\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n effectiveAtHeight: {\n serializedName: \"effective_at_height\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerConnections: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerConnections\",\n modelProperties: {\n inbound: {\n serializedName: \"inbound\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n outbound: {\n serializedName: \"outbound\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SpendTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SpendTx\",\n modelProperties: {\n recipientId: {\n serializedName: \"recipient_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleRegisterTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleRegisterTx\",\n modelProperties: {\n queryFormat: {\n serializedName: \"query_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseFormat: {\n serializedName: \"response_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n oracleTtl: {\n serializedName: \"oracle_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleExtendTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleExtendTx\",\n modelProperties: {\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n oracleTtl: {\n serializedName: \"oracle_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleQueryTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleQueryTx\",\n modelProperties: {\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n query: {\n serializedName: \"query\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryTtl: {\n serializedName: \"query_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleRespondTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleRespondTx\",\n modelProperties: {\n queryId: {\n serializedName: \"query_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n response: {\n serializedName: \"response\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NamePreclaimTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NamePreclaimTx\",\n modelProperties: {\n commitmentId: {\n serializedName: \"commitment_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameClaimTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameClaimTx\",\n modelProperties: {\n name: {\n serializedName: \"name\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nameSalt: {\n serializedName: \"name_salt\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nameFee: {\n serializedName: \"name_fee\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameUpdateTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameUpdateTx\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nameTtl: {\n serializedName: \"name_ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pointers: {\n serializedName: \"pointers\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"NamePointer\"\n }\n }\n }\n },\n clientTtl: {\n serializedName: \"client_ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameTransferTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameTransferTx\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n recipientId: {\n serializedName: \"recipient_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameRevokeTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameRevokeTx\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CommitmentId: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CommitmentId\",\n modelProperties: {\n commitmentId: {\n serializedName: \"commitment_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameHash: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameHash\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelCreateTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelCreateTx\",\n modelProperties: {\n initiatorId: {\n serializedName: \"initiator_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmount: {\n serializedName: \"initiator_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderId: {\n serializedName: \"responder_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmount: {\n serializedName: \"responder_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n channelReserve: {\n serializedName: \"channel_reserve\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lockPeriod: {\n serializedName: \"lock_period\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n delegateIds: {\n serializedName: \"delegate_ids\",\n type: {\n name: \"Composite\",\n className: \"Delegates\"\n }\n }\n }\n }\n};\n\nexport const ChannelDepositTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelDepositTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelWithdrawTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelWithdrawTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n toId: {\n serializedName: \"to_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelForceProgressTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelForceProgressTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n update: {\n serializedName: \"update\",\n type: {\n name: \"Composite\",\n className: \"OffChainUpdate\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n offchainTrees: {\n serializedName: \"offchain_trees\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelCloseMutualTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelCloseMutualTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmountFinal: {\n serializedName: \"initiator_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmountFinal: {\n serializedName: \"responder_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelCloseSoloTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelCloseSoloTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n poi: {\n serializedName: \"poi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSlashTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSlashTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n poi: {\n serializedName: \"poi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSettleTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSettleTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmountFinal: {\n serializedName: \"initiator_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmountFinal: {\n serializedName: \"responder_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSnapshotSoloTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSnapshotSoloTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSetDelegatesTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSetDelegatesTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorDelegateIds: {\n serializedName: \"initiator_delegate_ids\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n responderDelegateIds: {\n serializedName: \"responder_delegate_ids\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PubKey: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PubKey\",\n modelProperties: {\n pubKey: {\n serializedName: \"pub_key\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerDetails: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerDetails\",\n modelProperties: {\n host: {\n serializedName: \"host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n port: {\n serializedName: \"port\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n firstSeen: {\n serializedName: \"first_seen\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lastSeen: {\n serializedName: \"last_seen\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n genesisHash: {\n serializedName: \"genesis_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topHash: {\n serializedName: \"top_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topDifficulty: {\n serializedName: \"top_difficulty\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n networkId: {\n serializedName: \"network_id\",\n type: {\n name: \"String\"\n }\n },\n nodeVersion: {\n serializedName: \"node_version\",\n type: {\n name: \"String\"\n }\n },\n nodeRevision: {\n serializedName: \"node_revision\",\n type: {\n name: \"String\"\n }\n },\n nodeVendor: {\n serializedName: \"node_vendor\",\n type: {\n name: \"String\"\n }\n },\n nodeOs: {\n serializedName: \"node_os\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Peers: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Peers\",\n modelProperties: {\n peers: {\n serializedName: \"peers\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n blocked: {\n serializedName: \"blocked\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const PeerCount: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerCount\",\n modelProperties: {\n connected: {\n serializedName: \"connected\",\n type: {\n name: \"Composite\",\n className: \"PeerCountConnected\"\n }\n },\n available: {\n serializedName: \"available\",\n type: {\n name: \"Composite\",\n className: \"PeerCountAvailable\"\n }\n },\n blocked: {\n serializedName: \"blocked\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerCountConnected: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerCountConnected\",\n modelProperties: {\n inbound: {\n serializedName: \"inbound\",\n type: {\n name: \"String\"\n }\n },\n outbound: {\n serializedName: \"outbound\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerCountAvailable: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerCountAvailable\",\n modelProperties: {\n verified: {\n serializedName: \"verified\",\n type: {\n name: \"String\"\n }\n },\n unverified: {\n serializedName: \"unverified\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ContractCreateTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractCreateTx\",\n modelProperties: {\n ownerId: {\n serializedName: \"owner_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n deposit: {\n serializedName: \"deposit\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ContractCallTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractCallTx\",\n modelProperties: {\n callerId: {\n serializedName: \"caller_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const UnsignedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"UnsignedTx\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const TokenSupply: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"TokenSupply\",\n modelProperties: {\n accounts: {\n serializedName: \"accounts\",\n type: {\n name: \"String\"\n }\n },\n contracts: {\n serializedName: \"contracts\",\n type: {\n name: \"String\"\n }\n },\n contractOracles: {\n serializedName: \"contract_oracles\",\n type: {\n name: \"String\"\n }\n },\n locked: {\n serializedName: \"locked\",\n type: {\n name: \"String\"\n }\n },\n oracles: {\n serializedName: \"oracles\",\n type: {\n name: \"String\"\n }\n },\n oracleQueries: {\n serializedName: \"oracle_queries\",\n type: {\n name: \"String\"\n }\n },\n pendingRewards: {\n serializedName: \"pending_rewards\",\n type: {\n name: \"String\"\n }\n },\n total: {\n serializedName: \"total\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const GAAttachTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"GAAttachTx\",\n modelProperties: {\n ownerId: {\n serializedName: \"owner_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n authFun: {\n constraints: {\n Pattern: new RegExp(\"^(0x|0X)?[a-fA-F0-9]+$\")\n },\n serializedName: \"auth_fun\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const GAMetaTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"GAMetaTx\",\n modelProperties: {\n gaId: {\n serializedName: \"ga_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n authData: {\n serializedName: \"auth_data\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n }\n }\n }\n};\n\nexport const PayingForTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PayingForTx\",\n modelProperties: {\n payerId: {\n serializedName: \"payer_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n }\n }\n }\n};\n\nexport const CheckTxInPoolResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CheckTxInPoolResponse\",\n modelProperties: {\n status: {\n serializedName: \"status\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainTransfer: coreClient.CompositeMapper = {\n serializedName: \"OffChainTransfer\",\n type: {\n name: \"Composite\",\n className: \"OffChainTransfer\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n from: {\n serializedName: \"from\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n to: {\n serializedName: \"to\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainWithdrawal: coreClient.CompositeMapper = {\n serializedName: \"OffChainWithdrawal\",\n type: {\n name: \"Composite\",\n className: \"OffChainWithdrawal\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n to: {\n serializedName: \"to\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainDeposit: coreClient.CompositeMapper = {\n serializedName: \"OffChainDeposit\",\n type: {\n name: \"Composite\",\n className: \"OffChainDeposit\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n from: {\n serializedName: \"from\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainNewContract: coreClient.CompositeMapper = {\n serializedName: \"OffChainNewContract\",\n type: {\n name: \"Composite\",\n className: \"OffChainNewContract\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n owner: {\n serializedName: \"owner\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n type: {\n name: \"Composite\",\n className: \"ByteCode\"\n }\n },\n deposit: {\n serializedName: \"deposit\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainCallContract: coreClient.CompositeMapper = {\n serializedName: \"OffChainCallContract\",\n type: {\n name: \"Composite\",\n className: \"OffChainCallContract\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n caller: {\n serializedName: \"caller\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contract: {\n serializedName: \"contract\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CreateContractUnsignedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CreateContractUnsignedTx\",\n modelProperties: {\n ...UnsignedTx.type.modelProperties,\n contractId: {\n serializedName: \"contract_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport let discriminators = {\n \"Tx.undefined\": Tx,\n OffChainUpdate: OffChainUpdate,\n \"OffChainUpdate.OffChainTransfer\": OffChainTransfer,\n \"OffChainUpdate.OffChainWithdrawal\": OffChainWithdrawal,\n \"OffChainUpdate.OffChainDeposit\": OffChainDeposit,\n \"OffChainUpdate.OffChainNewContract\": OffChainNewContract,\n \"OffChainUpdate.OffChainCallContract\": OffChainCallContract\n};\n","import {\n OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport {\n DryRunInput as DryRunInputMapper,\n EncodedTx as EncodedTxMapper\n} from \"../models/mappers\";\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const $host: OperationURLParameter = {\n parameterPath: \"$host\",\n mapper: {\n serializedName: \"$host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const intAsString: OperationQueryParameter = {\n parameterPath: \"intAsString\",\n mapper: {\n defaultValue: false,\n serializedName: \"int-as-string\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n\nexport const hash: OperationURLParameter = {\n parameterPath: \"hash\",\n mapper: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const height: OperationURLParameter = {\n parameterPath: \"height\",\n mapper: {\n constraints: {\n InclusiveMaximum: 18446744073709552000,\n InclusiveMinimum: 0\n },\n serializedName: \"height\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const index: OperationURLParameter = {\n parameterPath: \"index\",\n mapper: {\n constraints: {\n InclusiveMinimum: 1\n },\n serializedName: \"index\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const pubkey: OperationURLParameter = {\n parameterPath: \"pubkey\",\n mapper: {\n serializedName: \"pubkey\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const strategy: OperationQueryParameter = {\n parameterPath: [\"options\", \"strategy\"],\n mapper: {\n defaultValue: \"max\",\n serializedName: \"strategy\",\n type: {\n name: \"Enum\",\n allowedValues: [\"max\", \"continuity\"]\n }\n }\n};\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const body: OperationParameter = {\n parameterPath: \"body\",\n mapper: DryRunInputMapper\n};\n\nexport const body1: OperationParameter = {\n parameterPath: \"body\",\n mapper: EncodedTxMapper\n};\n\nexport const fromParam: OperationQueryParameter = {\n parameterPath: [\"options\", \"from\"],\n mapper: {\n serializedName: \"from\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const limit: OperationQueryParameter = {\n parameterPath: [\"options\", \"limit\"],\n mapper: {\n defaultValue: 20,\n constraints: {\n InclusiveMaximum: 1000,\n InclusiveMinimum: 1\n },\n serializedName: \"limit\",\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const typeParam: OperationQueryParameter = {\n parameterPath: [\"options\", \"type\"],\n mapper: {\n defaultValue: \"all\",\n serializedName: \"type\",\n type: {\n name: \"Enum\",\n allowedValues: [\"open\", \"closed\", \"all\"]\n }\n }\n};\n\nexport const queryId: OperationURLParameter = {\n parameterPath: \"queryId\",\n mapper: {\n serializedName: \"query-id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const name: OperationURLParameter = {\n parameterPath: \"name\",\n mapper: {\n serializedName: \"name\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n","import * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n NodeOptionalParams,\n GetTopHeaderOptionalParams,\n GetTopHeaderResponse,\n GetCurrentKeyBlockOptionalParams,\n GetCurrentKeyBlockResponse,\n GetCurrentKeyBlockHashOptionalParams,\n GetCurrentKeyBlockHashResponse,\n GetCurrentKeyBlockHeightOptionalParams,\n GetCurrentKeyBlockHeightResponse,\n GetPendingKeyBlockOptionalParams,\n GetPendingKeyBlockResponse,\n GetKeyBlockByHashOptionalParams,\n GetKeyBlockByHashResponse,\n GetKeyBlockByHeightOptionalParams,\n GetKeyBlockByHeightResponse,\n GetMicroBlockHeaderByHashOptionalParams,\n GetMicroBlockHeaderByHashResponse,\n GetMicroBlockTransactionsByHashOptionalParams,\n GetMicroBlockTransactionsByHashResponse,\n GetMicroBlockTransactionByHashAndIndexOptionalParams,\n GetMicroBlockTransactionByHashAndIndexResponse,\n GetMicroBlockTransactionsCountByHashOptionalParams,\n GetMicroBlockTransactionsCountByHashResponse,\n GetCurrentGenerationOptionalParams,\n GetCurrentGenerationResponse,\n GetGenerationByHashOptionalParams,\n GetGenerationByHashResponse,\n GetGenerationByHeightOptionalParams,\n GetGenerationByHeightResponse,\n GetAccountByPubkeyOptionalParams,\n GetAccountByPubkeyResponse,\n GetAccountByPubkeyAndHeightOptionalParams,\n GetAccountByPubkeyAndHeightResponse,\n GetAccountByPubkeyAndHashOptionalParams,\n GetAccountByPubkeyAndHashResponse,\n GetPendingAccountTransactionsByPubkeyOptionalParams,\n GetPendingAccountTransactionsByPubkeyResponse,\n GetAccountNextNonceOptionalParams,\n GetAccountNextNonceResponse,\n DryRunInput,\n ProtectedDryRunTxsOptionalParams,\n ProtectedDryRunTxsResponse,\n GetTransactionByHashOptionalParams,\n GetTransactionByHashResponse,\n GetTransactionInfoByHashOptionalParams,\n GetTransactionInfoByHashResponse,\n EncodedTx,\n PostTransactionOptionalParams,\n PostTransactionResponse,\n GetContractOptionalParams,\n GetContractResponse,\n GetContractCodeOptionalParams,\n GetContractCodeResponse,\n GetContractPoIOptionalParams,\n GetContractPoIResponse,\n GetOracleByPubkeyOptionalParams,\n GetOracleByPubkeyResponse,\n GetOracleQueriesByPubkeyOptionalParams,\n GetOracleQueriesByPubkeyResponse,\n GetOracleQueryByPubkeyAndQueryIdOptionalParams,\n GetOracleQueryByPubkeyAndQueryIdResponse,\n GetNameEntryByNameOptionalParams,\n GetNameEntryByNameResponse,\n GetChannelByPubkeyOptionalParams,\n GetChannelByPubkeyResponse,\n GetPeerPubkeyOptionalParams,\n GetPeerPubkeyResponse,\n GetStatusOptionalParams,\n GetStatusResponse,\n GetChainEndsOptionalParams,\n GetChainEndsResponse\n} from \"./models\";\n\nexport class Node extends coreClient.ServiceClient {\n $host: string;\n intAsString?: boolean;\n\n /**\n * Initializes a new instance of the Node class.\n * @param $host server parameter\n * @param options The parameter options\n */\n constructor($host: string, options?: NodeOptionalParams) {\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: NodeOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-node/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 baseUri: options.endpoint ?? options.baseUri ?? \"{$host}\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\n // Parameter assignments\n this.$host = $host;\n }\n\n /**\n * Get the top header (either key or micro block)\n * @param options The options parameters.\n */\n getTopHeader(\n options?: GetTopHeaderOptionalParams\n ): Promise<GetTopHeaderResponse> {\n return this.sendOperationRequest({ options }, getTopHeaderOperationSpec);\n }\n\n /**\n * Get the current key block\n * @param options The options parameters.\n */\n getCurrentKeyBlock(\n options?: GetCurrentKeyBlockOptionalParams\n ): Promise<GetCurrentKeyBlockResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentKeyBlockOperationSpec\n );\n }\n\n /**\n * Get the hash of the current key block\n * @param options The options parameters.\n */\n getCurrentKeyBlockHash(\n options?: GetCurrentKeyBlockHashOptionalParams\n ): Promise<GetCurrentKeyBlockHashResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentKeyBlockHashOperationSpec\n );\n }\n\n /**\n * Get the height of the current key block\n * @param options The options parameters.\n */\n getCurrentKeyBlockHeight(\n options?: GetCurrentKeyBlockHeightOptionalParams\n ): Promise<GetCurrentKeyBlockHeightResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentKeyBlockHeightOperationSpec\n );\n }\n\n /**\n * Get the pending key block\n * @param options The options parameters.\n */\n getPendingKeyBlock(\n options?: GetPendingKeyBlockOptionalParams\n ): Promise<GetPendingKeyBlockResponse> {\n return this.sendOperationRequest(\n { options },\n getPendingKeyBlockOperationSpec\n );\n }\n\n /**\n * Get a key block by hash\n * @param hash The hash of the block - either a keyblock or a microblock\n * @param options The options parameters.\n */\n getKeyBlockByHash(\n hash: string,\n options?: GetKeyBlockByHashOptionalParams\n ): Promise<GetKeyBlockByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getKeyBlockByHashOperationSpec\n );\n }\n\n /**\n * Get a key block by height\n * @param height The height\n * @param options The options parameters.\n */\n getKeyBlockByHeight(\n height: number,\n options?: GetKeyBlockByHeightOptionalParams\n ): Promise<GetKeyBlockByHeightResponse> {\n return this.sendOperationRequest(\n { height, options },\n getKeyBlockByHeightOperationSpec\n );\n }\n\n /**\n * Get a micro block header by hash\n * @param hash The hash of the block - either a keyblock or a microblock\n * @param options The options parameters.\n */\n getMicroBlockHeaderByHash(\n hash: string,\n options?: GetMicroBlockHeaderByHashOptionalParams\n ): Promise<GetMicroBlockHeaderByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getMicroBlockHeaderByHashOperationSpec\n );\n }\n\n /**\n * Get micro block transactions by hash\n * @param hash The hash of the micro block\n * @param options The options parameters.\n */\n getMicroBlockTransactionsByHash(\n hash: string,\n options?: GetMicroBlockTransactionsByHashOptionalParams\n ): Promise<GetMicroBlockTransactionsByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getMicroBlockTransactionsByHashOperationSpec\n );\n }\n\n /**\n * Get a micro block transaction by hash and index\n * @param hash The hash of the micro block\n * @param index The index of the transaction in a block\n * @param options The options parameters.\n */\n getMicroBlockTransactionByHashAndIndex(\n hash: string,\n index: number,\n options?: GetMicroBlockTransactionByHashAndIndexOptionalParams\n ): Promise<GetMicroBlockTransactionByHashAndIndexResponse> {\n return this.sendOperationRequest(\n { hash, index, options },\n getMicroBlockTransactionByHashAndIndexOperationSpec\n );\n }\n\n /**\n * Get micro block transaction count by hash\n * @param hash The hash of the micro block\n * @param options The options parameters.\n */\n getMicroBlockTransactionsCountByHash(\n hash: string,\n options?: GetMicroBlockTransactionsCountByHashOptionalParams\n ): Promise<GetMicroBlockTransactionsCountByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getMicroBlockTransactionsCountByHashOperationSpec\n );\n }\n\n /**\n * Get the current generation\n * @param options The options parameters.\n */\n getCurrentGeneration(\n options?: GetCurrentGenerationOptionalParams\n ): Promise<GetCurrentGenerationResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentGenerationOperationSpec\n );\n }\n\n /**\n * Get a generation by hash\n * @param hash The hash of the key block\n * @param options The options parameters.\n */\n getGenerationByHash(\n hash: string,\n options?: GetGenerationByHashOptionalParams\n ): Promise<GetGenerationByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getGenerationByHashOperationSpec\n );\n }\n\n /**\n * Get a generation by height\n * @param height The height\n * @param options The options parameters.\n */\n getGenerationByHeight(\n height: number,\n options?: GetGenerationByHeightOptionalParams\n ): Promise<GetGenerationByHeightResponse> {\n return this.sendOperationRequest(\n { height, options },\n getGenerationByHeightOperationSpec\n );\n }\n\n /**\n * Get an account by public key\n * @param pubkey The public key of the account\n * @param options The options parameters.\n */\n getAccountByPubkey(\n pubkey: string,\n options?: GetAccountByPubkeyOptionalParams\n ): Promise<GetAccountByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getAccountByPubkeyOperationSpec\n );\n }\n\n /**\n * Get an account by public key after the opening key block of the generation at height\n * @param pubkey The public key of the account\n * @param height The height\n * @param options The options parameters.\n */\n getAccountByPubkeyAndHeight(\n pubkey: string,\n height: number,\n options?: GetAccountByPubkeyAndHeightOptionalParams\n ): Promise<GetAccountByPubkeyAndHeightResponse> {\n return this.sendOperationRequest(\n { pubkey, height, options },\n getAccountByPubkeyAndHeightOperationSpec\n );\n }\n\n /**\n * Get an account by public key after the block indicated by hash. Can be either a micro block or a\n * keyblock hash\n * @param pubkey The public key of the account\n * @param hash The hash of the block - either a keyblock or a microblock\n * @param options The options parameters.\n */\n getAccountByPubkeyAndHash(\n pubkey: string,\n hash: string,\n options?: GetAccountByPubkeyAndHashOptionalParams\n ): Promise<GetAccountByPubkeyAndHashResponse> {\n return this.sendOperationRequest(\n { pubkey, hash, options },\n getAccountByPubkeyAndHashOperationSpec\n );\n }\n\n /**\n * Get pending account transactions by public key\n * @param pubkey The public key of the account\n * @param options The options parameters.\n */\n getPendingAccountTransactionsByPubkey(\n pubkey: string,\n options?: GetPendingAccountTransactionsByPubkeyOptionalParams\n ): Promise<GetPendingAccountTransactionsByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getPendingAccountTransactionsByPubkeyOperationSpec\n );\n }\n\n /**\n * Get an account's next nonce; This is computed according to whatever is the current account nonce and\n * what transactions are currently present in the transaction pool\n * @param pubkey The public key of the account\n * @param options The options parameters.\n */\n getAccountNextNonce(\n pubkey: string,\n options?: GetAccountNextNonceOptionalParams\n ): Promise<GetAccountNextNonceResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getAccountNextNonceOperationSpec\n );\n }\n\n /**\n * Dry-run transactions on top of a given block. Supports all TXs except GAMetaTx, PayingForTx and\n * OffchainTx. The maximum gas limit of all calls is capped. The maximum gas limit per request is a\n * global node setting. Since DryRunCallReq object do not have a mandatory gas field, if not set a\n * default value of 1000000 is being used instead.\n * @param body transactions\n * @param options The options parameters.\n */\n protectedDryRunTxs(\n body: DryRunInput,\n options?: ProtectedDryRunTxsOptionalParams\n ): Promise<ProtectedDryRunTxsResponse> {\n return this.sendOperationRequest(\n { body, options },\n protectedDryRunTxsOperationSpec\n );\n }\n\n /**\n * Get a transaction by hash\n * @param hash The hash of the transaction\n * @param options The options parameters.\n */\n getTransactionByHash(\n hash: string,\n options?: GetTransactionByHashOptionalParams\n ): Promise<GetTransactionByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getTransactionByHashOperationSpec\n );\n }\n\n /**\n * @param hash The hash of the transaction\n * @param options The options parameters.\n */\n getTransactionInfoByHash(\n hash: string,\n options?: GetTransactionInfoByHashOptionalParams\n ): Promise<GetTransactionInfoByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getTransactionInfoByHashOperationSpec\n );\n }\n\n /**\n * Post a new transaction\n * @param body The new transaction\n * @param options The options parameters.\n */\n postTransaction(\n body: EncodedTx,\n options?: PostTransactionOptionalParams\n ): Promise<PostTransactionResponse> {\n return this.sendOperationRequest(\n { body, options },\n postTransactionOperationSpec\n );\n }\n\n /**\n * Get a contract by pubkey\n * @param pubkey Contract pubkey to get proof for\n * @param options The options parameters.\n */\n getContract(\n pubkey: string,\n options?: GetContractOptionalParams\n ): Promise<GetContractResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getContractOperationSpec\n );\n }\n\n /**\n * Get contract code by pubkey\n * @param pubkey Contract pubkey to get proof for\n * @param options The options parameters.\n */\n getContractCode(\n pubkey: string,\n options?: GetContractCodeOptionalParams\n ): Promise<GetContractCodeResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getContractCodeOperationSpec\n );\n }\n\n /**\n * Get a proof of inclusion for a contract\n * @param pubkey Contract pubkey to get proof for\n * @param options The options parameters.\n */\n getContractPoI(\n pubkey: string,\n options?: GetContractPoIOptionalParams\n ): Promise<GetContractPoIResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getContractPoIOperationSpec\n );\n }\n\n /**\n * Get an oracle by public key\n * @param pubkey The public key of the oracle\n * @param options The options parameters.\n */\n getOracleByPubkey(\n pubkey: string,\n options?: GetOracleByPubkeyOptionalParams\n ): Promise<GetOracleByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getOracleByPubkeyOperationSpec\n );\n }\n\n /**\n * Get oracle queries by public key\n * @param pubkey The public key of the oracle\n * @param options The options parameters.\n */\n getOracleQueriesByPubkey(\n pubkey: string,\n options?: GetOracleQueriesByPubkeyOptionalParams\n ): Promise<GetOracleQueriesByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getOracleQueriesByPubkeyOperationSpec\n );\n }\n\n /**\n * Get an oracle query by public key and query ID\n * @param pubkey The public key of the oracle\n * @param queryId The ID of the query\n * @param options The options parameters.\n */\n getOracleQueryByPubkeyAndQueryId(\n pubkey: string,\n queryId: string,\n options?: GetOracleQueryByPubkeyAndQueryIdOptionalParams\n ): Promise<GetOracleQueryByPubkeyAndQueryIdResponse> {\n return this.sendOperationRequest(\n { pubkey, queryId, options },\n getOracleQueryByPubkeyAndQueryIdOperationSpec\n );\n }\n\n /**\n * Get name entry from naming system\n * @param name The name key of the name entry\n * @param options The options parameters.\n */\n getNameEntryByName(\n name: string,\n options?: GetNameEntryByNameOptionalParams\n ): Promise<GetNameEntryByNameResponse> {\n return this.sendOperationRequest(\n { name, options },\n getNameEntryByNameOperationSpec\n );\n }\n\n /**\n * Get channel by public key\n * @param pubkey The pubkey of the channel\n * @param options The options parameters.\n */\n getChannelByPubkey(\n pubkey: string,\n options?: GetChannelByPubkeyOptionalParams\n ): Promise<GetChannelByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getChannelByPubkeyOperationSpec\n );\n }\n\n /**\n * Get peer public key\n * @param options The options parameters.\n */\n getPeerPubkey(\n options?: GetPeerPubkeyOptionalParams\n ): Promise<GetPeerPubkeyResponse> {\n return this.sendOperationRequest({ options }, getPeerPubkeyOperationSpec);\n }\n\n /**\n * Get the status of a node\n * @param options The options parameters.\n */\n getStatus(options?: GetStatusOptionalParams): Promise<GetStatusResponse> {\n return this.sendOperationRequest({ options }, getStatusOperationSpec);\n }\n\n /**\n * Get oldest keyblock hashes counting from genesis including orphans\n * @param options The options parameters.\n */\n getChainEnds(\n options?: GetChainEndsOptionalParams\n ): Promise<GetChainEndsResponse> {\n return this.sendOperationRequest({ options }, getChainEndsOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getTopHeaderOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/headers/top\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Header\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentKeyBlockOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/current\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentKeyBlockHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/current/hash\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.HashResponse\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentKeyBlockHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/current/height\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.HeightResponse\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPendingKeyBlockOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/pending\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getKeyBlockByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/hash/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getKeyBlockByHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/height/{height}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.height],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockHeaderByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/header\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MicroBlockHeader\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockTransactionsByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/transactions\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTxs\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockTransactionByHashAndIndexOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/transactions/index/{index}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTx\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash, Parameters.index],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockTransactionsCountByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/transactions/count\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CountResponse\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentGenerationOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/generations/current\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Generation\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getGenerationByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/generations/hash/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Generation\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getGenerationByHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/generations/height/{height}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Generation\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.height],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Account\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountByPubkeyAndHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/height/{height}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Account\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.height, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountByPubkeyAndHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/hash/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Account\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPendingAccountTransactionsByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/transactions/pending\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTxs\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountNextNonceOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/next-nonce\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.NextNonceResponse\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString, Parameters.strategy],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst protectedDryRunTxsOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/dry-run\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DryRunResults\n },\n 403: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body,\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getTransactionByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/transactions/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTx\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getTransactionInfoByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/transactions/{hash}/info\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.TxInfoObject\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst postTransactionOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/transactions\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.PostTxResponse\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body1,\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getContractOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/contracts/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ContractObject\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getContractCodeOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/contracts/{pubkey}/code\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ByteCode\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getContractPoIOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/contracts/{pubkey}/poi\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PoI\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getOracleByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/oracles/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.RegisteredOracle\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getOracleQueriesByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/oracles/{pubkey}/queries\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OracleQueries\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [\n Parameters.intAsString,\n Parameters.fromParam,\n Parameters.limit,\n Parameters.typeParam\n ],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getOracleQueryByPubkeyAndQueryIdOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/oracles/{pubkey}/queries/{query-id}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OracleQuery\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey, Parameters.queryId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getNameEntryByNameOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/names/{name}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.NameEntry\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.name],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getChannelByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/channels/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Channel\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPeerPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/peers/pubkey\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PeerPubKey\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getStatusOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/status\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Status\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getChainEndsOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/status/chain-ends\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Sequence\", element: { type: { name: \"String\" } } }\n }\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\n","// eslint-disable-next-line max-classes-per-file\nimport BigNumber from 'bignumber.js';\nimport { OperationArguments, OperationSpec } from '@azure/core-client';\nimport {\n genRequestQueuesPolicy, genCombineGetRequestsPolicy, genErrorFormatterPolicy,\n genVersionCheckPolicy,\n} from './utils/autorest';\nimport { Node as NodeApi, NodeOptionalParams, ErrorModel } from './apis/node';\nimport { mapObject } from './utils/other';\nimport { Encoded } from './utils/encoder';\n\nconst bigIntPropertyNames = [\n 'balance', 'queryFee', 'fee', 'amount', 'nameFee', 'channelAmount',\n 'initiatorAmount', 'responderAmount', 'channelReserve', 'initiatorAmountFinal',\n 'responderAmountFinal', 'gasPrice', 'deposit',\n] as const;\n\nconst numberPropertyNames = [\n 'time', 'gas', 'gasUsed', 'nameSalt',\n 'nonce', 'nextNonce', 'height', 'blockHeight', 'top', 'topBlockHeight',\n 'ttl', 'nameTtl', 'clientTtl',\n 'inbound', 'outbound', 'peerCount', 'pendingTransactionsCount', 'effectiveAtHeight',\n 'version', 'solutions', 'round',\n] as const;\n\nclass NodeTransformed extends NodeApi {\n override async sendOperationRequest(\n operationArguments: OperationArguments,\n operationSpec: OperationSpec,\n ): Promise<any> {\n const args = mapObject(\n operationArguments,\n ([key, value]) => [key, this.#encodeArg(value)],\n ) as OperationArguments;\n return this.#decodeRes(await super.sendOperationRequest(args, operationSpec));\n }\n\n #mapData(data: any, transform: {\n bigInt: (v: any) => any;\n number: (v: any) => any;\n }): unknown {\n if (Array.isArray(data)) return data.map((d) => this.#mapData(d, transform));\n if (data != null && typeof data === 'object') {\n return mapObject(data, ([key, value]) => {\n if (value == null) return [key, value];\n if (bigIntPropertyNames.some((k) => k === key)) return [key, transform.bigInt(value)];\n if (numberPropertyNames.some((k) => k === key)) return [key, transform.number(value)];\n return [key, this.#mapData(value, transform)];\n });\n }\n return data;\n }\n\n #encodeArg(data: any): any {\n return this.#mapData(data, {\n bigInt: (value) => {\n if (value instanceof BigNumber) return value.toFixed();\n return value.toString();\n },\n number: (value) => value.toString(),\n });\n }\n\n #decodeRes(data: any): any {\n return this.#mapData(data, {\n bigInt: (value) => BigInt(value),\n number: (value) => +value,\n });\n }\n}\n\ntype BigIntPropertyNames = typeof bigIntPropertyNames[number];\ntype NumberPropertyNames = typeof numberPropertyNames[number];\ntype PreserveOptional<NewType, OrigType> =\n OrigType extends undefined ? NewType | undefined : NewType;\nexport type TransformNodeType<Type> =\n Type extends (...args: infer Args) => infer Ret\n ? (...args: TransformNodeType<Args>) => TransformNodeType<Ret>\n : Type extends [infer Item, ...infer Rest]\n ? [TransformNodeType<Item>, ...TransformNodeType<Rest>]\n : Type extends Array<infer Item>\n ? Array<TransformNodeType<Item>>\n : Type extends Promise<infer T>\n ? Promise<TransformNodeType<T>>\n : Type extends { [P in any]: any }\n ? {\n [Property in keyof Type]:\n Property extends BigIntPropertyNames\n ? PreserveOptional<bigint, Type[Property]>\n : Property extends NumberPropertyNames\n ? PreserveOptional<number, Type[Property]>\n : Property extends 'txHash'\n ? PreserveOptional<Encoded.TxHash, Type[Property]>\n : TransformNodeType<Type[Property]>\n }\n : Type;\ntype NodeTransformedApi = new (...args: ConstructorParameters<typeof NodeApi>) => {\n [Name in keyof InstanceType<typeof NodeApi>]:\n Name extends 'pipeline' | 'sendRequest' | 'sendOperationRequest'\n ? NodeApi[Name] : TransformNodeType<NodeApi[Name]>\n};\n\nexport interface NodeInfo {\n url: string;\n nodeNetworkId: string;\n version: string;\n consensusProtocolVersion: number;\n}\n\nexport default class Node extends (NodeTransformed as unknown as NodeTransformedApi) {\n #networkIdPromise?: Promise<string>;\n\n /**\n * @param url - Url for node API\n * @param options - Options\n * @param options.ignoreVersion - Don't check node version\n */\n constructor(\n url: string,\n { ignoreVersion = false, ...options }: NodeOptionalParams & { ignoreVersion?: boolean } = {},\n ) {\n // eslint-disable-next-line constructor-super\n super(url, {\n allowInsecureConnection: true,\n additionalPolicies: [\n genRequestQueuesPolicy(),\n genCombineGetRequestsPolicy(),\n genErrorFormatterPolicy((body: ErrorModel) => ` ${body.reason}`),\n ],\n ...options,\n });\n if (!ignoreVersion) {\n const statusPromise = this.getStatus();\n const versionPromise = statusPromise.then(({ nodeVersion }) => nodeVersion);\n this.#networkIdPromise = statusPromise.then(({ networkId }) => networkId);\n this.pipeline.addPolicy(\n genVersionCheckPolicy('node', '/v3/status', versionPromise, '6.2.0', '7.0.0'),\n );\n }\n this.intAsString = true;\n }\n\n async getNetworkId(): Promise<string> {\n this.#networkIdPromise ??= this.getStatus().then(({ networkId }) => networkId);\n return this.#networkIdPromise;\n }\n\n async getNodeInfo(): Promise<NodeInfo> {\n const {\n nodeVersion: version,\n networkId: nodeNetworkId,\n protocols,\n topBlockHeight,\n } = await this.getStatus();\n const consensusProtocolVersion = protocols\n .filter(({ effectiveAtHeight }) => topBlockHeight >= effectiveAtHeight)\n .reduce(\n (acc, p) => (p.effectiveAtHeight > acc.effectiveAtHeight ? p : acc),\n { effectiveAtHeight: -1, version: 0 },\n )\n .version;\n return {\n url: this.$host,\n nodeNetworkId,\n version,\n consensusProtocolVersion,\n };\n }\n}\n","import BigNumber from 'bignumber.js';\nimport { hash, verify } from '../utils/crypto';\nimport {\n CtVersion,\n PROTOCOL_VM_ABI,\n RawTxObject,\n TxParamsCommon,\n TxSchema,\n TxTypeSchemas,\n} from './builder/schema';\nimport { Tag } from './builder/constants';\nimport { TxUnpacked, unpackTx } from './builder';\nimport { UnsupportedProtocolError } from '../utils/errors';\nimport { concatBuffers, isAccountNotFoundError, isKeyOfObject } from '../utils/other';\nimport { encode, Encoded, Encoding } from '../utils/encoder';\nimport Node, { TransformNodeType } from '../Node';\nimport { Account } from '../apis/node';\nimport { genAggressiveCacheGetResponsesPolicy } from '../utils/autorest';\n\nexport interface ValidatorResult {\n message: string;\n key: string;\n checkedKeys: string[];\n}\n\ntype Validator = (\n tx: {\n encodedTx: TxUnpacked<TxSchema>;\n signatures: Buffer[];\n tx: TxUnpacked<TxSchema> & {\n tx: TxTypeSchemas[Tag.SignedTx];\n };\n nonce?: number;\n ttl?: number;\n amount?: number;\n fee?: number;\n nameFee?: number;\n ctVersion?: Partial<CtVersion>;\n abiVersion?: number;\n contractId?: Encoded.ContractAddress;\n },\n options: {\n // TODO: remove after fixing node types\n account?: TransformNodeType<Account> & { id: Encoded.AccountAddress };\n nodeNetworkId: string;\n parentTxTypes: Tag[];\n node: Node;\n txType: Tag;\n height: number;\n consensusProtocolVersion: number;\n }\n) => ValidatorResult[] | Promise<ValidatorResult[]>;\n\nconst validators: Validator[] = [];\n\nconst getSenderAddress = (\n tx: TxParamsCommon | RawTxObject<TxSchema>,\n): Encoded.AccountAddress | undefined => [\n 'senderId', 'accountId', 'ownerId', 'callerId',\n 'oracleId', 'fromId', 'initiator', 'gaId', 'payerId',\n]\n .map((key: keyof TxSchema) => tx[key])\n .filter((a) => a)\n .map((a) => a?.toString().replace(/^ok_/, 'ak_'))[0] as Encoded.AccountAddress | undefined;\n\n/**\n * Transaction Validator\n * This function validates some of transaction properties,\n * to make sure it can be posted it to the chain\n * @category transaction builder\n * @param transaction - Base64Check-encoded transaction\n * @param nodeNotCached - Node to validate transaction against\n * @param parentTxTypes - Types of parent transactions\n * @returns Array with verification errors\n * @example const errors = await verifyTransaction(transaction, node)\n */\nexport default async function verifyTransaction(\n transaction: Encoded.Transaction | Encoded.Poi,\n nodeNotCached: Node,\n parentTxTypes: Tag[] = [],\n): Promise<ValidatorResult[]> {\n let node = nodeNotCached;\n if (\n !node.pipeline.getOrderedPolicies()\n .some(({ name }) => name === 'aggressive-cache-get-responses')\n ) {\n node = new Node(nodeNotCached.$host, { ignoreVersion: true });\n node.pipeline.addPolicy(genAggressiveCacheGetResponsesPolicy());\n }\n\n const { tx, txType } = unpackTx<Tag.SignedTx>(transaction);\n const address = getSenderAddress(tx)\n ?? (txType === Tag.SignedTx ? getSenderAddress(tx.encodedTx.tx) : undefined);\n const [account, { height }, { consensusProtocolVersion, nodeNetworkId }] = await Promise.all([\n address == null\n ? undefined\n : node.getAccountByPubkey(address)\n .catch((error) => {\n if (!isAccountNotFoundError(error)) throw error;\n return { id: address, balance: 0n, nonce: 0 };\n })\n // TODO: remove after fixing https://github.com/aeternity/aepp-sdk-js/issues/1537\n .then((acc) => ({ ...acc, id: acc.id as Encoded.AccountAddress })),\n node.getCurrentKeyBlockHeight(),\n node.getNodeInfo(),\n ]);\n\n return (await Promise.all(\n validators.map((v) => v(\n tx as any,\n {\n txType, node, account, height, consensusProtocolVersion, nodeNetworkId, parentTxTypes,\n },\n )),\n )).flat();\n}\n\nvalidators.push(\n ({ encodedTx, signatures }, { account, nodeNetworkId, parentTxTypes }) => {\n if ((encodedTx ?? signatures) === undefined) return [];\n if (account == null) return [];\n if (signatures.length !== 1) return []; // TODO: Support multisignature?\n const prefix = Buffer.from([\n nodeNetworkId,\n ...parentTxTypes.includes(Tag.PayingForTx) ? ['inner_tx'] : [],\n ].join('-'));\n const txWithNetworkId = concatBuffers([prefix, encodedTx.rlpEncoded]);\n const txHashWithNetworkId = concatBuffers([prefix, hash(encodedTx.rlpEncoded)]);\n if (verify(txWithNetworkId, signatures[0], account.id)\n || verify(txHashWithNetworkId, signatures[0], account.id)) return [];\n return [{\n message: 'Signature cannot be verified, please ensure that you transaction have'\n + ' the correct prefix and the correct private key for the sender address',\n key: 'InvalidSignature',\n checkedKeys: ['encodedTx', 'signatures'],\n }];\n },\n async ({ encodedTx, tx }, { node, parentTxTypes, txType }) => {\n if ((encodedTx ?? tx) === undefined) return [];\n return verifyTransaction(\n encode((encodedTx ?? tx).rlpEncoded, Encoding.Transaction),\n node,\n [...parentTxTypes, txType],\n );\n },\n ({ ttl }, { height }) => {\n if (ttl === undefined) return [];\n ttl = +ttl;\n if (ttl === 0 || ttl >= height) return [];\n return [{\n message: `TTL ${ttl} is already expired, current height is ${height}`,\n key: 'ExpiredTTL',\n checkedKeys: ['ttl'],\n }];\n },\n ({\n amount, fee, nameFee, tx,\n }, { account, parentTxTypes, txType }) => {\n if (account == null) return [];\n if ((amount ?? fee ?? nameFee) === undefined) return [];\n fee ??= 0;\n const cost = new BigNumber(fee).plus(nameFee ?? 0).plus(amount ?? 0)\n .plus(txType === Tag.PayingForTx ? (tx.tx.encodedTx.tx).fee : 0)\n .minus(parentTxTypes.includes(Tag.PayingForTx) ? fee : 0);\n if (cost.lte(account.balance.toString())) return [];\n return [{\n message: `Account balance ${account.balance.toString()} is not enough to execute the transaction that costs ${cost.toFixed()}`,\n key: 'InsufficientBalance',\n checkedKeys: ['amount', 'fee', 'nameFee'],\n }];\n },\n ({ signatures }, { account, txType }) => {\n if (account == null) return [];\n let message;\n if (txType === Tag.SignedTx && account.kind === 'generalized' && signatures.length !== 0) {\n message = 'Generalized account can\\'t be used to generate SignedTx with signatures';\n }\n if (txType === Tag.GaMetaTx && account.kind === 'basic') {\n message = 'Basic account can\\'t be used to generate GaMetaTx';\n }\n if (message == null) return [];\n return [{ message, key: 'InvalidAccountType', checkedKeys: ['tag'] }];\n },\n ({ nonce }, { account, parentTxTypes }) => {\n if (nonce == null || account == null || parentTxTypes.includes(Tag.GaMetaTx)) return [];\n nonce = +nonce;\n const validNonce = account.nonce + 1;\n if (nonce === validNonce) return [];\n return [{\n ...nonce < validNonce\n ? {\n message: `Nonce ${nonce} is already used, valid nonce is ${validNonce}`,\n key: 'NonceAlreadyUsed',\n }\n : {\n message: `Nonce ${nonce} is too high, valid nonce is ${validNonce}`,\n key: 'NonceHigh',\n },\n checkedKeys: ['nonce'],\n }];\n },\n ({ ctVersion, abiVersion }, { txType, consensusProtocolVersion }) => {\n if (!isKeyOfObject(consensusProtocolVersion, PROTOCOL_VM_ABI)) {\n throw new UnsupportedProtocolError(`Unsupported protocol: ${consensusProtocolVersion}`);\n }\n const protocol = PROTOCOL_VM_ABI[consensusProtocolVersion];\n\n // If not contract create tx\n if (ctVersion == null) ctVersion = { abiVersion };\n const txProtocol = protocol[txType as keyof typeof protocol];\n if (txProtocol == null) return [];\n if (Object.entries(ctVersion).some(\n ([\n key,\n value,\n ]: [\n key:keyof typeof txProtocol,\n value:any]) => !(txProtocol[key].includes(+value as never)),\n )) {\n return [{\n message: `ABI/VM version ${JSON.stringify(ctVersion)} is wrong, supported is: ${JSON.stringify(txProtocol)}`,\n key: 'VmAndAbiVersionMismatch',\n checkedKeys: ['ctVersion', 'abiVersion'],\n }];\n }\n return [];\n },\n async ({ contractId }, { txType, node }) => {\n if (Tag.ContractCallTx !== txType) return [];\n contractId = contractId as Encoded.ContractAddress;\n try {\n const { active } = await node.getContract(contractId);\n if (active) return [];\n return [{\n message: `Contract ${contractId} is not active`,\n key: 'ContractNotActive',\n checkedKeys: ['contractId'],\n }];\n } catch (error) {\n if (error.response?.parsedBody?.reason == null) throw error;\n return [{\n message: error.response.parsedBody.reason,\n key: 'ContractNotFound',\n checkedKeys: ['contractId'],\n }];\n }\n },\n);\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport { AE_AMOUNT_FORMATS, formatAmount } from './utils/amount-formatter';\nimport verifyTransaction, { ValidatorResult } from './tx/validator';\nimport { isAccountNotFoundError, pause } from './utils/other';\nimport { isNameValid, produceNameId } from './tx/builder/helpers';\nimport { DRY_RUN_ACCOUNT } from './tx/builder/schema';\nimport { AensName } from './tx/builder/constants';\nimport {\n AensPointerContextError, DryRunError, InvalidAensNameError, TransactionError,\n TxTimedOutError, TxNotInChainError, InternalError,\n} from './utils/errors';\nimport Node, { TransformNodeType } from './Node';\nimport {\n Account as AccountNode, ByteCode, ContractObject, DryRunResult, DryRunResults,\n Generation, KeyBlock, MicroBlockHeader, NameEntry, SignedTx,\n} from './apis/node';\nimport { decode, Encoded, Encoding } from './utils/encoder';\nimport AccountBase from './account/Base';\n\n/**\n * @category chain\n */\nexport function _getPollInterval(\n type: 'block' | 'microblock',\n { _expectedMineRate = 180000, _microBlockCycle = 3000, _maxPollInterval = 5000 }:\n { _expectedMineRate?: number; _microBlockCycle?: number; _maxPollInterval?: number },\n): number {\n const base = {\n block: _expectedMineRate,\n microblock: _microBlockCycle,\n }[type];\n return Math.min(base / 3, _maxPollInterval);\n}\n\n/**\n * @category exception\n */\nexport class InvalidTxError extends TransactionError {\n validation: ValidatorResult[];\n\n transaction: Encoded.Transaction;\n\n constructor(\n message: string,\n validation: ValidatorResult[],\n transaction: Encoded.Transaction,\n ) {\n super(message);\n this.name = 'InvalidTxError';\n this.validation = validation;\n this.transaction = transaction;\n }\n}\n\n/**\n * Obtain current height of the chain\n * @category chain\n * @returns Current chain height\n */\nexport async function getHeight({ onNode }: { onNode: Node }): Promise<number> {\n return (await onNode.getCurrentKeyBlockHeight()).height;\n}\n\n/**\n * Wait for a transaction to be mined\n * @category chain\n * @param th - The hash of transaction to poll\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.blocks - Number of blocks mined after which to fail\n * @param options.onNode - Node to use\n * @returns The transaction as it was mined\n */\nexport async function poll(\n th: Encoded.TxHash,\n {\n blocks = 10, interval, onNode, ...options\n }:\n { blocks?: number; interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<TransformNodeType<SignedTx>> {\n interval ??= _getPollInterval('microblock', options);\n const max = await getHeight({ onNode }) + blocks;\n do {\n const tx = await onNode.getTransactionByHash(th);\n if (tx.blockHeight !== -1) return tx;\n await pause(interval);\n } while (await getHeight({ onNode }) < max);\n throw new TxTimedOutError(blocks, th);\n}\n\n/**\n * Wait for the chain to reach a specific height\n * @category chain\n * @param height - Height to wait for\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.onNode - Node to use\n * @returns Current chain height\n */\nexport async function awaitHeight(\n height: number,\n { interval, onNode, ...options }:\n { interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<number> {\n interval ??= _getPollInterval('block', options);\n let currentHeight;\n do {\n if (currentHeight != null) await pause(interval);\n currentHeight = (await onNode.getCurrentKeyBlockHeight()).height;\n } while (currentHeight < height);\n return currentHeight;\n}\n\n/**\n * Wait for transaction confirmation\n * @category chain\n * @param txHash - Transaction hash\n * @param options - Options\n * @param options.confirm - Number of micro blocks to wait for transaction confirmation\n * @param options.onNode - Node to use\n * @returns Current Height\n */\nexport async function waitForTxConfirm(\n txHash: Encoded.TxHash,\n { confirm = 3, onNode, ...options }:\n { confirm?: number; onNode: Node } & Parameters<typeof awaitHeight>[1],\n): Promise<number> {\n const { blockHeight } = await onNode.getTransactionByHash(txHash);\n const height = await awaitHeight(blockHeight + confirm, { onNode, ...options });\n const { blockHeight: newBlockHeight } = await onNode.getTransactionByHash(txHash);\n switch (newBlockHeight) {\n case -1:\n throw new TxNotInChainError(txHash);\n case blockHeight:\n return height;\n default:\n return waitForTxConfirm(txHash, { onNode, confirm, ...options });\n }\n}\n\n/**\n * Submit a signed transaction for mining\n * @category chain\n * @param tx - Transaction to submit\n * @param options - Options\n * @param options.onNode - Node to use\n * @param options.onAccount - Account to use\n * @param options.verify - Verify transaction before sending\n * @param options.waitMined - Ensure that transaction get into block\n * @param options.confirm - Number of micro blocks that should be mined after tx get included\n * @returns Transaction details\n */\nexport async function sendTransaction(\n tx: Encoded.Transaction,\n {\n onNode, onAccount, verify = true, waitMined = true, confirm, ...options\n }:\n SendTransactionOptions,\n): Promise<SendTransactionReturnType> {\n if (verify) {\n const validation = await verifyTransaction(tx, onNode);\n if (validation.length > 0) {\n const message = `Transaction verification errors: ${\n validation.map((v: { message: string }) => v.message).join(', ')}`;\n throw new InvalidTxError(message, validation, tx);\n }\n }\n\n try {\n let __queue;\n try {\n __queue = onAccount != null ? `tx-${onAccount.address}` : null;\n } catch (error) {\n __queue = null;\n }\n const { txHash } = await onNode.postTransaction(\n { tx },\n __queue != null ? { requestOptions: { customHeaders: { __queue } } } : {},\n );\n\n if (waitMined) {\n const pollResult = await poll(txHash, { onNode, ...options });\n const txData = {\n ...pollResult,\n hash: pollResult.hash as Encoded.TxHash,\n rawTx: tx,\n };\n // wait for transaction confirmation\n if (confirm != null && (confirm === true || confirm > 0)) {\n const c = typeof confirm === 'boolean' ? undefined : confirm;\n return {\n ...txData,\n confirmationHeight: await waitForTxConfirm(txHash, { onNode, confirm: c, ...options }),\n };\n }\n return txData;\n }\n return { hash: txHash, rawTx: tx };\n } catch (error) {\n throw Object.assign(error, {\n rawTx: tx,\n verifyTx: async () => verifyTransaction(tx, onNode),\n });\n }\n}\n\ntype SendTransactionOptionsType = {\n onNode: Node;\n onAccount?: AccountBase;\n verify?: boolean;\n waitMined?: boolean;\n confirm?: boolean | number;\n} & Parameters<typeof poll>[1] & Omit<Parameters<typeof waitForTxConfirm>[1], 'confirm'>;\ninterface SendTransactionOptions extends SendTransactionOptionsType {}\ninterface SendTransactionReturnType extends Partial<TransformNodeType<SignedTx>> {\n hash: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n confirmationHeight?: number;\n}\n\n/**\n * Get account by account public key\n * @category chain\n * @param address - Account address (public key)\n * @param options - Options\n * @param options.height - Get account on specific block by block height\n * @param options.hash - Get account on specific block by micro block hash or key block hash\n * @param options.onNode - Node to use\n */\nexport async function getAccount(\n address: Encoded.AccountAddress | Encoded.ContractAddress,\n { height, hash, onNode }:\n { height?: number; hash?: Encoded.KeyBlockHash | Encoded.MicroBlockHash; onNode: Node },\n): Promise<TransformNodeType<AccountNode>> {\n if (height != null) return onNode.getAccountByPubkeyAndHeight(address, height);\n if (hash != null) return onNode.getAccountByPubkeyAndHash(address, hash);\n return onNode.getAccountByPubkey(address);\n}\n\n/**\n * Request the balance of specified account\n * @category chain\n * @param address - The public account address to obtain the balance for\n * @param options - Options\n * @param options.format\n * @param options.height - The chain height at which to obtain the balance for\n * (default: top of chain)\n * @param options.hash - The block hash on which to obtain the balance for (default: top of chain)\n */\nexport async function getBalance(\n address: Encoded.AccountAddress | Encoded.ContractAddress,\n { format = AE_AMOUNT_FORMATS.AETTOS, ...options }:\n { format?: AE_AMOUNT_FORMATS } & Parameters<typeof getAccount>[1],\n): Promise<string> {\n const { balance } = await getAccount(address, options).catch((error) => {\n if (!isAccountNotFoundError(error)) throw error;\n return { balance: 0n };\n });\n\n return formatAmount(balance, { targetDenomination: format });\n}\n\n/**\n * Obtain current generation\n * @category chain\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Current Generation\n */\nexport async function getCurrentGeneration(\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n return onNode.getCurrentGeneration();\n}\n\n/**\n * Get generation by hash or height\n * @category chain\n * @param hashOrHeight - Generation hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Generation\n */\nexport async function getGeneration(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n if (typeof hashOrHeight === 'number') return onNode.getGenerationByHeight(hashOrHeight);\n return onNode.getGenerationByHash(hashOrHeight);\n}\n\n/**\n * Get micro block transactions\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Transactions\n */\nexport async function getMicroBlockTransactions(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<SignedTx[]>> {\n return (await onNode.getMicroBlockTransactionsByHash(hash)).transactions;\n}\n\n/**\n * Get key block\n * @category chain\n * @param hashOrHeight - Key block hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Key Block\n */\nexport async function getKeyBlock(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<KeyBlock>> {\n if (typeof hashOrHeight === 'number') return onNode.getKeyBlockByHeight(hashOrHeight);\n return onNode.getKeyBlockByHash(hashOrHeight);\n}\n\n/**\n * Get micro block header\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Micro block header\n */\nexport async function getMicroBlockHeader(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<MicroBlockHeader>> {\n return onNode.getMicroBlockHeaderByHash(hash);\n}\n\ninterface TxDryRunArguments {\n tx: Encoded.Transaction;\n accountAddress: Encoded.AccountAddress;\n top?: number;\n txEvents?: any;\n resolve: Function;\n reject: Function;\n}\nconst txDryRunRequests: Map<string, TxDryRunArguments[] & { timeout?: NodeJS.Timeout }> = new Map();\n\nasync function txDryRunHandler(key: string, onNode: Node): Promise<void> {\n const rs = txDryRunRequests.get(key);\n txDryRunRequests.delete(key);\n if (rs == null) throw new InternalError('Can\\'t get dry-run request');\n\n let dryRunRes;\n try {\n dryRunRes = await onNode.protectedDryRunTxs({\n top: rs[0].top,\n txEvents: rs[0].txEvents,\n txs: rs.map((req) => ({ tx: req.tx })),\n accounts: Array.from(new Set(rs.map((req) => req.accountAddress)))\n .map((pubKey) => ({ pubKey, amount: DRY_RUN_ACCOUNT.amount })),\n });\n } catch (error) {\n rs.forEach(({ reject }) => reject(error));\n return;\n }\n\n const { results, txEvents } = dryRunRes;\n results.forEach(({ result, reason, ...resultPayload }, idx) => {\n const {\n resolve, reject, tx, accountAddress,\n } = rs[idx];\n if (result === 'ok') resolve({ ...resultPayload, txEvents });\n else reject(Object.assign(new DryRunError(reason as string), { tx, accountAddress }));\n });\n}\n\n/**\n * Transaction dry-run\n * @category chain\n * @param tx - transaction to execute\n * @param accountAddress - address that will be used to execute transaction\n * @param options - Options\n * @param options.top - hash of block on which to make dry-run\n * @param options.txEvents - collect and return on-chain tx events that would result from the call\n * @param options.combine - Enables combining of similar requests to a single dry-run call\n * @param options.onNode - Node to use\n */\nexport async function txDryRun(\n tx: Encoded.Transaction,\n accountAddress: Encoded.AccountAddress,\n {\n top, txEvents, combine, onNode,\n }:\n { top?: number; txEvents?: boolean; combine?: boolean; onNode: Node },\n): Promise<{\n txEvents?: TransformNodeType<DryRunResults['txEvents']>;\n } & TransformNodeType<DryRunResult>> {\n const key = combine === true ? [top, txEvents].join() : 'immediate';\n const requests = txDryRunRequests.get(key) ?? [];\n txDryRunRequests.set(key, requests);\n return new Promise((resolve, reject) => {\n requests.push({\n tx, accountAddress, top, txEvents, resolve, reject,\n });\n if (combine !== true) {\n void txDryRunHandler(key, onNode);\n return;\n }\n requests.timeout ??= setTimeout(() => { void txDryRunHandler(key, onNode); });\n });\n}\n\n/**\n * Get contract byte code\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContractByteCode(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ByteCode>> {\n return onNode.getContractCode(contractId);\n}\n\n/**\n * Get contract entry\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContract(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ContractObject>> {\n return onNode.getContract(contractId);\n}\n\n/**\n * Get name entry\n * @category AENS\n * @param name - AENS name\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getName(\n name: AensName,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<NameEntry>> {\n return onNode.getNameEntryByName(name);\n}\n\n/**\n * Resolve AENS name and return name hash\n * @category AENS\n * @param nameOrId - AENS name or address\n * @param key - in AENS pointers record\n * @param options - Options\n * @param options.verify - To ensure that name exist and have a corresponding pointer\n * // TODO: avoid that to don't trust to current api gateway\n * @param options.resolveByNode - Enables pointer resolving using node\n * @param options.onNode - Node to use\n * @returns Address or AENS name hash\n */\nexport async function resolveName <\n Type extends Encoding.AccountAddress | Encoding.ContractAddress,\n>(\n nameOrId: AensName | Encoded.Generic<Type>,\n key: string,\n { verify = true, resolveByNode = false, onNode }:\n { verify?: boolean; resolveByNode?: boolean; onNode: Node },\n): Promise<Encoded.Generic<Type | Encoding.Name>> {\n if (isNameValid(nameOrId)) {\n if (verify || resolveByNode) {\n const name = await onNode.getNameEntryByName(nameOrId);\n const pointer = name.pointers.find((p) => p.key === key);\n if (pointer == null) throw new AensPointerContextError(nameOrId, key);\n if (resolveByNode) return pointer.id as Encoded.Generic<Type>;\n }\n return produceNameId(nameOrId);\n }\n try {\n decode(nameOrId);\n return nameOrId;\n } catch (error) {\n throw new InvalidAensNameError(`Invalid name or address: ${nameOrId}`);\n }\n}\n","import nacl from 'tweetnacl';\nimport { v4 as uuid } from '@aeternity/uuid';\nimport { hash, argon2id } from '@aeternity/argon2';\nimport { getAddressFromPriv } from './crypto';\nimport { InvalidPasswordError } from './errors';\n\nconst DERIVED_KEY_FUNCTIONS = {\n async argon2id(\n pass: string | Uint8Array,\n salt: string | Uint8Array,\n params: Partial<Keystore['crypto']['kdf_params']>,\n ): Promise<Uint8Array> {\n const { memlimit_kib: memoryCost, opslimit: timeCost } = params;\n\n return hash(pass, {\n hashLength: 32,\n salt,\n timeCost,\n memoryCost,\n type: argon2id,\n });\n },\n};\n\nconst CRYPTO_FUNCTIONS = {\n 'xsalsa20-poly1305': {\n encrypt: nacl.secretbox,\n decrypt(...args: Parameters<typeof nacl.secretbox.open>): Uint8Array {\n const res = nacl.secretbox.open(...args);\n if (res == null) throw new InvalidPasswordError();\n return res;\n },\n },\n};\n\nexport interface Keystore {\n name: string;\n version: 1;\n public_key: string;\n id: string;\n crypto: {\n secret_type: 'ed25519';\n symmetric_alg: keyof typeof CRYPTO_FUNCTIONS;\n ciphertext: string;\n cipher_params: {\n nonce: string;\n };\n kdf: keyof typeof DERIVED_KEY_FUNCTIONS;\n kdf_params: {\n memlimit_kib: number;\n opslimit: number;\n parallelism: number;\n salt: string;\n };\n };\n}\n\nconst CRYPTO_DEFAULTS = {\n secret_type: 'ed25519',\n symmetric_alg: 'xsalsa20-poly1305',\n kdf: 'argon2id',\n kdf_params: {\n memlimit_kib: 65536,\n opslimit: 3,\n parallelism: 1,\n },\n} as const;\n\n/**\n * Symmetric private key encryption using secret (derived) key.\n * @category keystore\n * @param plaintext - Data to be encrypted.\n * @param key - Secret key.\n * @param nonce - Randomly generated nonce.\n * @param algo - Encryption algorithm.\n * @returns Encrypted data.\n */\nfunction encrypt(\n plaintext: Uint8Array,\n key: Uint8Array,\n nonce: Uint8Array,\n algo: keyof typeof CRYPTO_FUNCTIONS = CRYPTO_DEFAULTS.symmetric_alg,\n): Uint8Array {\n return CRYPTO_FUNCTIONS[algo].encrypt(plaintext, nonce, key);\n}\n\n/**\n * Symmetric private key decryption using secret (derived) key.\n * @category keystore\n * @param ciphertext - Data to be decrypted.\n * @param key - Secret key.\n * @param nonce - Nonce from key-object.\n * @param algo - Encryption algorithm.\n * @returns Decrypted data.\n */\nfunction decrypt(\n ciphertext: Uint8Array,\n key: Uint8Array,\n nonce: Uint8Array,\n algo: keyof typeof CRYPTO_FUNCTIONS = CRYPTO_DEFAULTS.symmetric_alg,\n): Uint8Array {\n return CRYPTO_FUNCTIONS[algo].decrypt(ciphertext, nonce, key);\n}\n\n/**\n * Derive secret key from password with key derivation function.\n * @category keystore\n * @param password - User-supplied password.\n * @param nonce - Randomly generated nonce.\n * @param kdf - Key derivation function.\n * @param kdfParams - KDF parameters.\n * @returns Secret key derived from password.\n */\nasync function deriveKey(\n password: string | Uint8Array,\n nonce: string | Uint8Array,\n kdf: Keystore['crypto']['kdf'],\n kdfParams: Omit<Keystore['crypto']['kdf_params'], 'salt'>,\n): Promise<Uint8Array> {\n return DERIVED_KEY_FUNCTIONS[kdf](password, nonce, kdfParams);\n}\n\n/**\n * Recover plaintext private key from secret-storage key object.\n * @category keystore\n * @param password - Keystore object password.\n * @param keystore - Keystore object.\n * @returns Plaintext private key.\n */\nexport async function recover(\n password: string | Uint8Array,\n { crypto }: Keystore,\n): Promise<string> {\n const salt = Buffer.from(crypto.kdf_params.salt, 'hex');\n return Buffer.from(decrypt(\n Buffer.from(crypto.ciphertext, 'hex'),\n await deriveKey(password, salt, crypto.kdf, crypto.kdf_params),\n Buffer.from(crypto.cipher_params.nonce, 'hex'),\n crypto.symmetric_alg,\n )).toString('hex');\n}\n\n/**\n * Export private key to keystore secret-storage format.\n * @category keystore\n * @param name - Key name.\n * @param password - User-supplied password.\n * @param privateKey - Private key as hex-string or a Buffer.\n * @param nonce - Randomly generated 24byte nonce.\n * @param salt - Randomly generated 16byte salt.\n * @param options - Encryption parameters.\n * @param options.kdf - Key derivation function.\n * @param options.kdf_params - KDF parameters.\n */\nexport async function dump(\n name: string,\n password: string | Uint8Array,\n privateKey: string | Uint8Array,\n nonce: Uint8Array = nacl.randomBytes(24),\n salt: Uint8Array = nacl.randomBytes(16),\n options?: Partial<Keystore['crypto']>,\n): Promise<Keystore> {\n const opt = { ...CRYPTO_DEFAULTS, ...options };\n const derivedKey = await deriveKey(password, salt, opt.kdf, opt.kdf_params);\n const payload = typeof privateKey === 'string' ? Buffer.from(privateKey, 'hex') : privateKey;\n return {\n name,\n version: 1,\n public_key: getAddressFromPriv(payload),\n id: uuid(),\n crypto: {\n secret_type: opt.secret_type,\n symmetric_alg: opt.symmetric_alg,\n ciphertext: Buffer.from(\n encrypt(payload, derivedKey, nonce, opt.symmetric_alg),\n ).toString('hex'),\n cipher_params: { nonce: Buffer.from(nonce).toString('hex') },\n kdf: opt.kdf,\n kdf_params: {\n ...opt.kdf_params,\n salt: Buffer.from(salt).toString('hex'),\n },\n },\n };\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Transaction methods\n *\n * This is implementation of [Tx](api/tx.md) relays\n * the creation of transactions to {@link Node}.\n * These methods provide ability to create native transactions.\n */\nimport BigNumber from 'bignumber.js';\nimport {\n ABI_VERSIONS, CtVersion, PROTOCOL_VM_ABI, TX_TTL, TxParamsCommon,\n} from './builder/schema';\nimport { Tag } from './builder/constants';\nimport {\n ArgumentError, UnsupportedProtocolError, UnknownTxError, InvalidTxParamsError,\n} from '../utils/errors';\nimport Node from '../Node';\nimport { Encoded } from '../utils/encoder';\nimport { buildTx as syncBuildTx, unpackTx } from './builder/index';\nimport { isAccountNotFoundError, isKeyOfObject } from '../utils/other';\nimport { AE_AMOUNT_FORMATS } from '../utils/amount-formatter';\n\ntype Int = number | string | BigNumber;\n\nexport type BuildTxOptions <TxType extends Tag, OmitFields extends string> =\n Omit<Parameters<typeof _buildTx<TxType>>[1], OmitFields>;\n\n/**\n * Validated vm/abi version or get default based on transaction type and NODE version\n * @category transaction builder\n * @param txType - Type of transaction\n * @param ctVersion - Object with vm and abi version fields\n * @returns Object with vm/abi version\n */\nasync function getVmVersion(\n txType: Tag.ContractCreateTx, ctVersion: Partial<CtVersion> & { onNode: Node }\n): Promise<CtVersion>;\nasync function getVmVersion(\n txType: Tag, ctVersion: Partial<Pick<CtVersion, 'abiVersion'>> & { onNode: Node }\n): Promise<Pick<CtVersion, 'abiVersion'>>;\nasync function getVmVersion(\n txType: Tag,\n { vmVersion, abiVersion, onNode }: Partial<CtVersion> & { onNode: Node },\n): Promise<Partial<CtVersion>> {\n const { consensusProtocolVersion } = await onNode.getNodeInfo();\n if (!isKeyOfObject(consensusProtocolVersion, PROTOCOL_VM_ABI)) {\n throw new UnsupportedProtocolError('Not supported consensus protocol version');\n }\n const supportedProtocol = PROTOCOL_VM_ABI[consensusProtocolVersion];\n if (!isKeyOfObject(txType, supportedProtocol)) {\n throw new UnknownTxError('Not supported tx type');\n }\n const protocolForTX = supportedProtocol[txType];\n abiVersion ??= protocolForTX.abiVersion[0];\n vmVersion ??= protocolForTX.vmVersion[0];\n return { vmVersion, abiVersion };\n}\n\n/**\n * Calculate fee, get absolute ttl (ttl + height), get account nonce\n * @category transaction builder\n * @param txType - Type of transaction\n * @param params - Object which contains all tx data\n * @returns Object with account nonce, absolute ttl and transaction fee\n */\nasync function prepareTxParams(\n txType: Tag,\n {\n senderId,\n nonce,\n ttl = TX_TTL,\n absoluteTtl,\n strategy,\n onNode,\n }: {\n senderId: Encoded.AccountAddress;\n absoluteTtl?: boolean;\n strategy?: 'continuity' | 'max';\n onNode: Node;\n } & Pick<TxParamsCommon, 'nonce' | 'ttl'>,\n): Promise<{ ttl: number; nonce: number }> {\n nonce ??= (\n await onNode.getAccountNextNonce(senderId, { strategy }).catch((error) => {\n if (!isAccountNotFoundError(error)) throw error;\n return { nextNonce: 1 };\n })\n ).nextNonce;\n\n if (ttl !== 0) {\n if (ttl < 0) throw new ArgumentError('ttl', 'greater or equal to 0', ttl);\n ttl += absoluteTtl === true ? 0 : (await onNode.getCurrentKeyBlock()).height;\n }\n\n return { ttl, nonce };\n}\n\n// TODO: find a better name or rearrange methods\n/**\n * @category transaction builder\n */\nexport async function _buildTx<TxType extends Tag>(\n txType: TxType,\n { denomination, absoluteTtl, ..._params }:\n Omit<Parameters<typeof syncBuildTx<TxType, 'tx'>>[0], 'fee' | 'nonce' | 'ttl' | 'ctVersion' | 'abiVersion'>\n & {\n onNode: Node;\n fee?: Int;\n nonce?: number;\n ttl?: number;\n denomination?: AE_AMOUNT_FORMATS;\n absoluteTtl?: boolean;\n }\n & (TxType extends Tag.OracleExtendTx | Tag.OracleResponseTx\n ? { callerId: Encoded.AccountAddress } : {})\n & (TxType extends Tag.ContractCreateTx | Tag.GaAttachTx ? { ctVersion?: CtVersion } : {})\n & (TxType extends Tag.ContractCallTx | Tag.OracleRegisterTx\n ? { abiVersion?: ABI_VERSIONS } : {}),\n): Promise<Encoded.Transaction> {\n // TODO: avoid this assertion\n const params = _params as unknown as TxParamsCommon & { onNode: Node };\n let senderKey: keyof TxParamsCommon | '<absent>';\n switch (txType) {\n case Tag.SpendTx:\n case Tag.OracleQueryTx:\n senderKey = 'senderId';\n break;\n case Tag.NameClaimTx:\n case Tag.NameUpdateTx:\n case Tag.NameRevokeTx:\n case Tag.NameTransferTx:\n case Tag.NamePreclaimTx:\n case Tag.OracleRegisterTx:\n senderKey = 'accountId';\n break;\n case Tag.ContractCreateTx:\n case Tag.GaAttachTx:\n senderKey = 'ownerId';\n break;\n case Tag.GaMetaTx:\n senderKey = 'gaId';\n break;\n case Tag.ContractCallTx:\n case Tag.OracleExtendTx:\n case Tag.OracleResponseTx:\n senderKey = 'callerId';\n break;\n case Tag.ChannelCloseSoloTx:\n case Tag.ChannelSlashTx:\n case Tag.ChannelSettleTx:\n case Tag.ChannelSnapshotSoloTx:\n senderKey = 'fromId';\n break;\n case Tag.PayingForTx:\n senderKey = 'payerId';\n break;\n default:\n throw new ArgumentError('txType', 'valid transaction type', txType);\n }\n // TODO: move specific cases to field-types\n if ([Tag.ContractCreateTx, Tag.GaAttachTx].includes(txType)) {\n params.ctVersion = await getVmVersion(\n Tag.ContractCreateTx,\n { ...params, ...params.ctVersion },\n );\n }\n if ([Tag.ContractCallTx, Tag.GaMetaTx].includes(txType)) {\n params.abiVersion = (await getVmVersion(Tag.ContractCallTx, params)).abiVersion;\n }\n if (txType === Tag.OracleRegisterTx) {\n params.abiVersion ??= ABI_VERSIONS.NO_ABI;\n }\n if (txType === Tag.PayingForTx) {\n params.tx = unpackTx(params.tx);\n }\n const senderId = params[senderKey];\n // TODO: do this check on TypeScript level\n if (senderId == null) throw new InvalidTxParamsError(`Transaction field ${senderKey} is missed`);\n const extraParams = await prepareTxParams(txType, { ...params, senderId, absoluteTtl });\n return syncBuildTx({ ...params, ...extraParams } as any, txType, { denomination }).tx;\n}\n","import nacl from 'tweetnacl';\nimport { full as hmac } from 'tweetnacl-auth';\nimport { fromString } from 'bip32-path';\nimport aesjs from 'aes-js';\nimport { sha256hash, encode, Encoding } from './encoder';\nimport { CryptographyError } from './errors';\nimport { concatBuffers } from './other';\n\nconst Ecb = aesjs.ModeOfOperation.ecb;\n\n// TODO: use mnemonic encryption instead of AES\n/**\n * Encrypt given data using `password`\n * @param password - Password to encrypt with\n * @param binaryData - Data to encrypt\n * @returns Encrypted data\n */\nfunction encryptKey(password: string, binaryData: Uint8Array): Uint8Array {\n const hashedPasswordBytes = sha256hash(password);\n const aesEcb = new Ecb(hashedPasswordBytes);\n return aesEcb.encrypt(binaryData);\n}\n\n/**\n * Decrypt given data using `password`\n * @param password - Password to decrypt with\n * @param encrypted - Data to decrypt\n * @returns Decrypted data\n */\nfunction decryptKey(password: string, encrypted: Uint8Array): Uint8Array {\n const encryptedBytes = Buffer.from(encrypted);\n const hashedPasswordBytes = sha256hash(password);\n const aesEcb = new Ecb(hashedPasswordBytes);\n return aesEcb.decrypt(encryptedBytes);\n}\n\n/**\n * @category exception\n */\nexport class DerivationError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'DerivationError';\n }\n}\n\nconst ED25519_CURVE = Buffer.from('ed25519 seed');\nconst HARDENED_OFFSET = 0x80000000;\n\ninterface KeyTreeNode {\n secretKey: Uint8Array;\n chainCode: Uint8Array;\n}\n\ninterface HDWallet {\n secretKey: string;\n chainCode: string;\n}\n\ninterface Account {\n secretKey: string;\n publicKey: string;\n}\n\ntype Dec<N extends number> = [-1, 0, 1, 2, 3, 4][N];\ntype Bip32PathT<MaxLen extends number, H extends 'H' | 'h' | '\\''> = MaxLen extends -1\n ? `${number}${H}`\n : Bip32PathT<Dec<MaxLen>, H> | `${Bip32PathT<Dec<MaxLen>, H>}/${number}${H}`;\ntype Bip32Path<MaxLen extends number> =\n '' | Bip32PathT<MaxLen, 'H'> | Bip32PathT<MaxLen, 'h'> | Bip32PathT<MaxLen, '\\''>;\n\n/**\n * @category hd-wallet\n */\nexport function deriveChild({ secretKey, chainCode }: KeyTreeNode, index: number): KeyTreeNode {\n if (index < HARDENED_OFFSET) {\n throw new DerivationError(`Segment ${index} is not hardened`);\n }\n const indexBuffer = Buffer.allocUnsafe(4);\n indexBuffer.writeUInt32BE(index, 0);\n\n const data = concatBuffers([Buffer.alloc(1, 0), secretKey, indexBuffer]);\n\n const I = hmac(data, chainCode);\n const IL = I.slice(0, 32);\n const IR = I.slice(32);\n return {\n secretKey: IL,\n chainCode: IR,\n };\n}\n\n/**\n * @category hd-wallet\n */\nexport function derivePathFromKey(path: Bip32Path<5>, key: KeyTreeNode): KeyTreeNode {\n const segments = path === '' ? [] : fromString(path).toPathArray();\n segments.forEach((segment, i) => {\n if (segment < HARDENED_OFFSET) {\n throw new DerivationError(`Segment #${i + 1} is not hardened`);\n }\n });\n\n return segments.reduce((parentKey, segment) => deriveChild(parentKey, segment), key);\n}\n\n/**\n * @category hd-wallet\n */\nexport function getMasterKeyFromSeed(seed: Uint8Array): KeyTreeNode {\n const I = hmac(seed, ED25519_CURVE);\n const IL = I.slice(0, 32);\n const IR = I.slice(32);\n return {\n secretKey: IL,\n chainCode: IR,\n };\n}\n\n/**\n * @category hd-wallet\n */\nexport function derivePathFromSeed(path: 'm' | `m/${Bip32Path<5>}`, seed: Uint8Array): KeyTreeNode {\n if (!['m', 'm/'].includes(path.slice(0, 2))) {\n throw new DerivationError('Root element is required');\n }\n const masterKey = getMasterKeyFromSeed(seed);\n return derivePathFromKey(path.slice(2) as Bip32Path<5>, masterKey);\n}\n\nfunction formatAccount(keys: nacl.SignKeyPair): Account {\n const { secretKey, publicKey } = keys;\n return {\n secretKey: Buffer.from(secretKey).toString('hex'),\n publicKey: encode(publicKey, Encoding.AccountAddress),\n };\n}\n\n/**\n * @category hd-wallet\n */\nexport function getKeyPair(secretKey: Uint8Array): nacl.SignKeyPair {\n return nacl.sign.keyPair.fromSeed(secretKey);\n}\n\n/**\n * @category hd-wallet\n */\nexport function generateSaveHDWalletFromSeed(seed: Uint8Array, password: string): HDWallet {\n const walletKey = derivePathFromSeed('m/44h/457h', seed);\n return {\n secretKey: Buffer.from(encryptKey(password, walletKey.secretKey)).toString('hex'),\n chainCode: Buffer.from(encryptKey(password, walletKey.chainCode)).toString('hex'),\n };\n}\n\n/**\n * @category hd-wallet\n */\nexport function getSaveHDWalletAccounts(\n saveHDWallet: HDWallet,\n password: string,\n accountCount: number,\n): Account[] {\n const walletKey = {\n secretKey: decryptKey(password, Buffer.from(saveHDWallet.secretKey, 'hex')),\n chainCode: decryptKey(password, Buffer.from(saveHDWallet.chainCode, 'hex')),\n };\n return (new Array(accountCount)).fill(undefined)\n .map((_, idx) => formatAccount(getKeyPair(derivePathFromKey(`${idx}h/0h/0h`, walletKey).secretKey)));\n}\n\n/**\n * @category hd-wallet\n */\nexport const getHdWalletAccountFromSeed = (\n seed: Uint8Array,\n accountIdx: number,\n): Account & { idx: number } => {\n const walletKey = derivePathFromSeed('m/44h/457h', seed);\n const derived = derivePathFromKey(`${accountIdx}h/0h/0h`, walletKey);\n const keyPair = getKeyPair(derived.secretKey);\n return {\n ...formatAccount(keyPair),\n idx: accountIdx,\n };\n};\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport { sendTransaction, getBalance, resolveName } from './chain';\nimport { _buildTx, BuildTxOptions } from './tx';\nimport { buildTxHash, unpackTx } from './tx/builder';\nimport { ArgumentError } from './utils/errors';\nimport { Encoded, Encoding } from './utils/encoder';\nimport { Tag, AensName } from './tx/builder/constants';\nimport AccountBase from './account/Base';\n\n/**\n * Sign and post a transaction to the chain\n * @category chain\n * @param tx - Transaction\n * @param options - Options\n * @param options.verify - Verify transaction before broadcast, throw error if not\n * valid\n * @returns Transaction\n */\nexport async function send(\n tx: Encoded.Transaction,\n options: SendOptions,\n): Promise<SendReturnType> {\n const signed = await options.onAccount.signTransaction(tx, {\n ...options,\n networkId: await options.onNode.getNetworkId(),\n });\n\n return options.innerTx === true\n ? { hash: buildTxHash(signed), rawTx: signed }\n : sendTransaction(signed, options);\n}\n\ntype SendOptionsType = Parameters<AccountBase['signTransaction']>[1]\n& Parameters<typeof sendTransaction>[1] & { onAccount: AccountBase };\nexport interface SendOptions extends SendOptionsType {}\ninterface SendReturnType extends Awaited<ReturnType<typeof sendTransaction>> {}\n\n/**\n * Send coins to another account\n * @category chain\n * @param amount - Amount to spend\n * @param recipientIdOrName - Address or name of recipient account\n * @param options - Options\n * @returns Transaction\n */\nexport async function spend(\n amount: number | string,\n recipientIdOrName: Encoded.AccountAddress | AensName,\n options: SpendOptions,\n): ReturnType<typeof send> {\n return send(\n await _buildTx(Tag.SpendTx, {\n ...options,\n senderId: options.onAccount.address,\n recipientId: await resolveName<Encoding.AccountAddress>(\n recipientIdOrName,\n 'account_pubkey',\n options,\n ),\n amount,\n }),\n options,\n );\n}\n\ntype SpendOptionsType = BuildTxOptions<Tag.SpendTx, 'senderId' | 'recipientId' | 'amount'>\n& Parameters<typeof resolveName>[2] & { onAccount: AccountBase } & SendOptions;\ninterface SpendOptions extends SpendOptionsType {}\n\n// TODO: Rename to spendFraction\n/**\n * Send a fraction of coin balance to another account\n * @category chain\n * @param fraction - Fraction of balance to spend (between 0 and 1)\n * @param recipientIdOrName - Address or name of recipient account\n * @param options - Options\n * @returns Transaction\n */\nexport async function transferFunds(\n fraction: number | string,\n recipientIdOrName: AensName | Encoded.AccountAddress,\n options: TransferFundsOptions,\n): ReturnType<typeof send> {\n if (fraction < 0 || fraction > 1) {\n throw new ArgumentError('fraction', 'a number between 0 and 1', fraction);\n }\n const recipientId = await resolveName<Encoding.AccountAddress>(\n recipientIdOrName,\n 'account_pubkey',\n options,\n );\n const senderId = options.onAccount.address;\n const balance = new BigNumber(\n await getBalance.bind(options.onAccount)(senderId, options),\n );\n const desiredAmount = balance.times(fraction).integerValue(BigNumber.ROUND_HALF_UP);\n const { tx: { fee } } = unpackTx(\n await _buildTx(Tag.SpendTx, {\n ...options, senderId, recipientId, amount: desiredAmount,\n }),\n Tag.SpendTx,\n );\n // Reducing of the amount may reduce transaction fee, so this is not completely accurate\n const amount = desiredAmount.plus(fee).gt(balance) ? balance.minus(fee) : desiredAmount;\n return send(\n await _buildTx(Tag.SpendTx, {\n ...options, senderId, recipientId, amount,\n }),\n options,\n );\n}\n\ntype TransferFundsOptionsType = BuildTxOptions<Tag.SpendTx, 'senderId' | 'recipientId' | 'amount'>\n& Parameters<typeof resolveName>[2] & { onAccount: AccountBase } & SendOptions;\ninterface TransferFundsOptions extends TransferFundsOptionsType {}\n\n/**\n * Submit transaction of another account paying for it (fee and gas)\n * @category chain\n * @param transaction - tx_<base64>-encoded transaction\n * @param options - Options\n * @returns Object Transaction\n */\nexport async function payForTransaction(\n transaction: Encoded.Transaction,\n options: PayForTransactionOptions,\n): ReturnType<typeof send> {\n return send(\n await _buildTx(\n Tag.PayingForTx,\n { ...options, payerId: options.onAccount.address, tx: transaction },\n ),\n options,\n );\n}\n\ninterface PayForTransactionOptions extends\n BuildTxOptions<Tag.PayingForTx, 'payerId' | 'tx'>, SendOptions {\n onAccount: AccountBase;\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Aens methods - routines to interact with the æternity naming system\n *\n * The high-level description of the naming system is\n * https://github.com/aeternity/protocol/blob/master/AENS.md in the protocol\n * repository.\n */\n\nimport BigNumber from 'bignumber.js';\nimport { genSalt } from './utils/crypto';\nimport { commitmentHash, isAuctionName } from './tx/builder/helpers';\nimport {\n CLIENT_TTL, NAME_TTL, Tag, AensName,\n} from './tx/builder/constants';\nimport { ArgumentError } from './utils/errors';\nimport { Encoded } from './utils/encoder';\nimport { send, SendOptions } from './spend';\nimport { getName, getHeight } from './chain';\nimport { _buildTx, BuildTxOptions } from './tx';\nimport { TransformNodeType } from './Node';\nimport { NameEntry, NamePointer } from './apis/node';\nimport AccountBase from './account/Base';\nimport { AddressEncodings } from './tx/builder/field-types/address';\n\ninterface KeyPointers {\n [key: string]: Encoded.Generic<AddressEncodings>;\n}\n\n/**\n * Revoke a name\n * @category AENS\n * @param name - Name hash\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @returns Transaction result\n * @example\n * ```js\n * const name = 'test.chain'\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensRevoke(name, { fee, ttl , nonce })\n * // or\n * await nameObject.revoke({ fee, ttl, nonce })\n * ```\n */\nexport async function aensRevoke(\n name: AensName,\n options: AensRevokeOptions,\n): ReturnType<typeof send> {\n const nameRevokeTx = await _buildTx(Tag.NameRevokeTx, {\n ...options,\n nameId: name,\n accountId: options.onAccount.address,\n });\n return send(nameRevokeTx, options);\n}\n\ninterface AensRevokeOptions extends\n BuildTxOptions<Tag.NameRevokeTx, 'nameId' | 'accountId'>,\n SendOptions {}\n\n/**\n * Update a name\n * @category AENS\n * @param name - AENS name\n * @param pointers - Map of pointer keys to corresponding addresses\n * @param options - Options\n * @param options.extendPointers - Get the pointers from the node and merge with provided\n * ones. Pointers with the same type will be overwritten\n * @param options.onAccount - Make operation on specific account from sdk (you\n * pass publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @param options.nameTtl - Name ttl represented in number of\n * blocks (Max value is 50000 blocks)\n * @param options.clientTtl=84600 a suggestion as to how long any\n * clients should cache this information\n * @throws Invalid pointer array error\n * @example\n * ```js\n * const name = 'test.chain'\n * const pointersArray = ['ak_asd23dasdas...,' 'ct_asdf34fasdasd...']\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensUpdate(name, pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })\n * // or\n * await nameObject.update(pointers, { nameTtl, ttl, fee, nonce, clientTtl })\n * ```\n */\nexport async function aensUpdate(\n name: AensName,\n pointers: KeyPointers,\n { extendPointers, ...options }: AensUpdateOptions,\n): ReturnType<typeof send> {\n const allPointers = {\n ...extendPointers === true && Object.fromEntries(\n (await getName(name, options)).pointers.map(({ key, id }) => [key, id]),\n ),\n ...pointers,\n };\n\n const nameUpdateTx = await _buildTx(Tag.NameUpdateTx, {\n clientTtl: CLIENT_TTL,\n nameTtl: NAME_TTL,\n ...options,\n nameId: name,\n accountId: options.onAccount.address,\n pointers: Object.entries(allPointers)\n .map(([key, id]: [string, Encoded.Generic<AddressEncodings>]) => ({ key, id })),\n });\n\n return send(nameUpdateTx, options);\n}\n\ninterface AensUpdateOptions extends\n BuildTxOptions<Tag.NameUpdateTx, 'nameId' | 'accountId' | 'pointers' | 'clientTtl' | 'nameTtl'>,\n SendOptions {\n extendPointers?: boolean;\n clientTtl?: number;\n nameTtl?: number;\n}\n\n/**\n * Transfer a domain to another account\n * @category AENS\n * @param name - AENS name\n * @param account - Recipient account publick key\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @returns Transaction result\n * @example\n * ```js\n * const name = 'test.chain'\n * const recipientPub = 'ak_asd23dasdas...'\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensTransfer(name, recipientPub, { ttl, fee, nonce })\n * // or\n * await nameObject.transfer(recipientPub, { ttl, fee, nonce })\n * ```\n */\nexport async function aensTransfer(\n name: AensName,\n account: Encoded.AccountAddress,\n options: AensTransferOptions,\n): ReturnType<typeof send> {\n const nameTransferTx = await _buildTx(Tag.NameTransferTx, {\n ...options,\n nameId: name,\n accountId: options.onAccount.address,\n recipientId: account,\n });\n\n return send(nameTransferTx, options);\n}\n\ninterface AensTransferOptions extends\n BuildTxOptions<Tag.NameTransferTx, 'nameId' | 'accountId' | 'recipientId'>,\n SendOptions {}\n\n/**\n * Query the AENS name info from the node\n * and return the object with info and predefined functions for manipulating name\n * @category AENS\n * @param name - AENS name\n * @param opt - Options\n * @returns\n * @example\n * ```js\n * const nameObject = sdkInstance.aensQuery('test.chain')\n * console.log(nameObject)\n * {\n * id, // name hash\n * pointers, // array of pointers\n * update, // Update name function\n * extendTtl, // Extend Ttl name function\n * transfer, // Transfer name function\n * revoke // Revoke name function\n * }\n * ```\n */\nexport async function aensQuery(\n name: AensName,\n opt: Parameters<typeof getName>[1] & Parameters<typeof aensUpdate>[2]\n & Parameters<typeof aensTransfer>[2],\n): Promise<Readonly<\n TransformNodeType<NameEntry> & {\n id: Encoded.Name;\n owner: Encoded.AccountAddress;\n pointers: KeyPointers | NamePointer[];\n ttl: number;\n update: (\n pointers: KeyPointers,\n options?: Omit<Parameters<typeof aensQuery>[1], 'onNode' | 'onCompiler' | 'onAccount'> & {\n onAccount?: AccountBase;\n }\n ) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;\n transfer: (\n account: Encoded.AccountAddress,\n options?: Parameters<typeof aensQuery>[1]\n ) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;\n revoke: (options?: Omit<Parameters<typeof aensRevoke>[1], 'onNode' | 'onCompiler' | 'onAccount'> & {\n onAccount?: AccountBase;\n }\n ) => ReturnType<typeof aensRevoke>;\n extendTtl: (\n nameTtl: number,\n options?: Omit<Parameters<typeof aensQuery>[1], 'onNode' | 'onCompiler' | 'onAccount'>\n ) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;\n }\n >> {\n const nameEntry = await getName(name, opt);\n return Object.freeze({\n ...nameEntry,\n id: nameEntry.id as Encoded.Name,\n owner: nameEntry.owner as Encoded.AccountAddress,\n async update(pointers, options) {\n return {\n ...await aensUpdate(name, pointers, { ...opt, ...options }),\n ...await aensQuery(name, { ...opt, ...options }),\n };\n },\n async transfer(account, options) {\n return {\n ...await aensTransfer(name, account, { ...opt, ...options }),\n ...await aensQuery(name, { ...opt, ...options }),\n };\n },\n async revoke(options) {\n return aensRevoke(name, { ...opt, ...options });\n },\n async extendTtl(nameTtl = NAME_TTL, options = {}) {\n if (nameTtl > NAME_TTL || nameTtl <= 0) {\n throw new ArgumentError('nameTtl', `a number between 1 and ${NAME_TTL} blocks`, nameTtl);\n }\n\n return {\n ...await aensUpdate(name, {}, {\n ...opt, ...options, nameTtl, extendPointers: true,\n }),\n ...await aensQuery(name, { ...opt, ...options }),\n };\n },\n });\n}\n\n/**\n * Claim a previously preclaimed registration. This can only be done after the\n * preclaim step\n * @category AENS\n * @param name - AENS name\n * @param salt - Salt from pre-claim, or 0 if it's a bid\n * @param options - options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @param options.nameFee - Name Fee (By default calculated by sdk)\n * @returns the result of the claim\n * @example\n * ```js\n * const name = 'test.chain'\n * const salt = preclaimResult.salt // salt from pre-claim transaction\n *\n * await sdkInstance.aensClaim(name, salt, { ttl, fee, nonce, nameFee })\n * ```\n */\nexport async function aensClaim(\n name: AensName,\n salt: number,\n options: AensClaimOptions,\n): Promise<AensClaimReturnType> {\n const claimTx = await _buildTx(Tag.NameClaimTx, {\n ...options,\n accountId: options.onAccount.address,\n nameSalt: salt,\n name,\n });\n\n const result = await send(claimTx, options);\n if (!isAuctionName(name)) {\n const nameInter = result.blockHeight != null && result.blockHeight > 0\n ? await aensQuery(name, options)\n : {};\n return Object.assign(result, nameInter);\n }\n return result;\n}\n\ntype AensClaimOptionsType = BuildTxOptions<Tag.NameClaimTx, 'accountId' | 'nameSalt' | 'name'>\n& SendOptions & Parameters<typeof aensQuery>[1];\ninterface AensClaimOptions extends AensClaimOptionsType {}\ninterface AensClaimReturnType extends\n Awaited<ReturnType<typeof send>>,\n Partial<Awaited<ReturnType<typeof aensQuery>>> {}\n\n/**\n * Preclaim a name. Sends a hash of the name and a random salt to the node\n * @category AENS\n * @param name - AENS name\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @example\n * ```js\n * const name = 'test.chain'\n * const salt = preclaimResult.salt // salt from pre-claim transaction\n *\n * await sdkInstance.aensPreclaim(name, { ttl, fee, nonce })\n * {\n * ...transactionResult,\n * claim, // Claim function (options={}) => claimTransactionResult\n * salt,\n * commitmentId\n * }\n * ```\n */\nexport async function aensPreclaim(name: AensName, options: AensPreclaimOptions): Promise<Readonly<\nAwaited<ReturnType<typeof send>> & {\n height: number;\n salt: number;\n commitmentId: string;\n claim: (opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>;\n}\n>> {\n const salt = genSalt();\n const height = await getHeight(options);\n const commitmentId = commitmentHash(name, salt);\n\n const preclaimTx = await _buildTx(Tag.NamePreclaimTx, {\n ...options,\n accountId: options.onAccount.address,\n commitmentId,\n });\n\n return Object.freeze({\n ...await send(preclaimTx, options),\n height,\n salt,\n commitmentId,\n async claim(opts?: Parameters<typeof aensClaim>[2]) {\n return aensClaim(name, salt, { ...options, ...opts });\n },\n });\n}\n\ninterface AensPreclaimOptions extends\n BuildTxOptions<Tag.NamePreclaimTx, 'accountId' | 'commitmentId'>,\n SendOptions,\n AensClaimOptions {}\n\n/**\n * Bid to name auction\n * @category AENS\n * @param name - Domain name\n * @param nameFee - Name fee (bid fee)\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @returns Transaction result\n * @example\n * ```js\n * const name = 'test.chain'\n * const bidFee = computeBidFee(name, startFee, incrementPercentage)\n *\n * await sdkInstance.aensBid(name, 213109412839123, { ttl, fee, nonce })\n * ```\n */\nexport async function aensBid(\n name: AensName,\n nameFee: number | string | BigNumber,\n options: Omit<Parameters<typeof aensClaim>[2], 'nameFee'>,\n): ReturnType<typeof aensClaim> {\n return aensClaim(name, 0, { ...options, nameFee });\n}\n","/*\n* ISC License (ISC)\n* Copyright (c) 2022 aeternity developers\n*\n* Permission to use, copy, modify, and/or distribute this software for any\n* purpose with or without fee is hereby granted, provided that the above\n* copyright notice and this permission notice appear in all copies.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n* PERFORMANCE OF THIS SOFTWARE.\n*/\n\n/**\n * Contract module - routines to interact with the æternity contract\n *\n * High level documentation of the contracts are available at\n * https://github.com/aeternity/protocol/tree/master/contracts and\n */\n\nimport { Encoder as Calldata } from '@aeternity/aepp-calldata';\nimport { DRY_RUN_ACCOUNT } from '../tx/builder/schema';\nimport { Tag, AensName } from '../tx/builder/constants';\nimport { buildContractIdByContractTx, unpackTx } from '../tx/builder';\nimport { _buildTx } from '../tx';\nimport { send } from '../spend';\nimport { decode, Encoded } from '../utils/encoder';\nimport {\n MissingContractDefError,\n MissingContractAddressError,\n InactiveContractError,\n BytecodeMismatchError,\n DuplicateContractError,\n MissingFunctionNameError,\n InvalidMethodInvocationError,\n NotPayableFunctionError,\n TypeError,\n NodeInvocationError,\n IllegalArgumentError,\n NoSuchContractFunctionError,\n MissingEventDefinitionError,\n AmbiguousEventDefinitionError,\n UnexpectedTsError,\n InternalError,\n NoWalletConnectedError,\n} from '../utils/errors';\nimport { hash as calcHash } from '../utils/crypto';\nimport { Aci as BaseAci } from '../apis/compiler';\nimport {\n ContractCallObject as NodeContractCallObject, ContractCallReturnType, Event as NodeEvent,\n} from '../apis/node';\nimport CompilerHttp from './CompilerHttp';\nimport Node, { TransformNodeType } from '../Node';\nimport {\n getAccount, getContract, getContractByteCode, getKeyBlock, resolveName, txDryRun,\n} from '../chain';\nimport AccountBase from '../account/Base';\nimport { concatBuffers } from '../utils/other';\nimport { isNameValid, produceNameId } from '../tx/builder/helpers';\n\ninterface FunctionACI {\n arguments: any[];\n name: string;\n payable: boolean;\n returns: string;\n stateful: boolean;\n}\n\ninterface Aci extends BaseAci {\n encodedAci: {\n contract: {\n name: string;\n event: any;\n kind: string;\n state: any;\n type_defs: any[];\n functions: FunctionACI[];\n };\n };\n externalEncodedAci: any[];\n}\n\ninterface Event extends NodeEvent {\n address: Encoded.ContractAddress;\n data: Encoded.ContractBytearray;\n}\n\nexport interface ContractCallObject extends NodeContractCallObject {\n returnValue: Encoded.ContractBytearray;\n log: Event[];\n}\n\ninterface DecodedEvent {\n name: string;\n args: unknown[];\n contract: {\n name: string;\n address: Encoded.ContractAddress;\n };\n}\n\ntype TxData = Awaited<ReturnType<typeof send>>;\n\ninterface SendAndProcessReturnType {\n result?: TransformNodeType<ContractCallObject>;\n hash: TxData['hash'];\n tx: Awaited<ReturnType<typeof unpackTx<Tag.ContractCallTx | Tag.ContractCreateTx>>>;\n txData: TxData;\n rawTx: Encoded.Transaction;\n}\n\nexport interface ContractMethodsBase { [key: string]: (...args: any[]) => any }\n\ntype MethodsToContractApi<M extends ContractMethodsBase> = {\n [Name in keyof M]:\n M[Name] extends (...args: infer Args) => infer Ret\n ? (...args: [\n ...Args,\n ...[] | [Name extends 'init'\n ? Parameters<Contract<M>['$deploy']>[1] : Parameters<Contract<M>['$call']>[2]],\n ]) => Promise<\n Awaited<ReturnType<Contract<M>['$call']>> &\n { decodedResult?: Ret }\n >\n : never\n};\n\ntype ContractWithMethods<M extends ContractMethodsBase> = Contract<M> & MethodsToContractApi<M>;\n\ntype MethodNames<M extends ContractMethodsBase> = keyof M & string | 'init';\n\ntype MethodParameters<M extends ContractMethodsBase, Fn extends MethodNames<M>> =\n Fn extends 'init'\n ? M extends { init: any } ? Parameters<M['init']> : []\n : Parameters<M[Fn]>;\n\n/**\n * Generate contract ACI object with predefined js methods for contract usage - can be used for\n * creating a reference to already deployed contracts\n * @category contract\n * @param options - Options object\n * @returns JS Contract API\n * @example\n * ```js\n * const contractIns = await aeSdk.initializeContract({ sourceCode })\n * await contractIns.$deploy([321]) or await contractIns.init(321)\n * const callResult = await contractIns.$call('setState', [123])\n * const staticCallResult = await contractIns.$call('setState', [123], { callStatic: true })\n * ```\n * Also you can call contract like: `await contractIns.setState(123, options)`\n * Then sdk decide to make on-chain or static call(dry-run API) transaction based on function is\n * stateful or not\n */\nclass Contract<M extends ContractMethodsBase> {\n /**\n * Helper to generate a signature to delegate\n * - pre-claim/claim/transfer/revoke of a name to a contract.\n * - register/extend/respond of an Oracle to a contract.\n * @category contract\n * @param ids - The list of id's to prepend\n * @param _options - Options\n * @param _options.omitAddress - Prepend delegation signature with an account address\n * @param _options.onAccount - Account to use\n * @returns Signature\n * @example\n * ```js\n * const aeSdk = new AeSdk({ ... })\n * const contract = await aeSdk.initializeContract({ address: 'ct_asd2ks...' })\n * const aensName = 'example.chain'\n * const onAccount = new MemoryAccount(...) // Sign with a specific account\n * // Preclaim signature\n * const preclaimSig = await contract.$createDelegationSignature([], { onAccount })\n * // Claim, transfer and revoke signature\n * const aensDelegationSig = await contract\n * .$createDelegationSignature([aensName], { onAccount })\n * ```\n * @example\n * ```js\n * const aeSdk = new AeSdk({ ... })\n * const contract = await aeSdk.initializeContract({ address: 'ct_asd2ks...' })\n * const oracleQueryId = 'oq_...'\n * const onAccount = new MemoryAccount(...) // Sign with a specific account\n * // Oracle register and extend signature\n * const oracleDelegationSig = await contract.$createDelegationSignature([], { onAccount })\n * // Oracle respond signature\n * const respondSig = await contract\n * .$createDelegationSignature([oracleQueryId], { onAccount, omitAddress: true })\n * ```\n */\n async $createDelegationSignature(\n ids: Array<Encoded.Any | AensName> = [],\n _options?: { omitAddress?: boolean; onAccount?: AccountBase },\n ): Promise<Uint8Array> {\n const options = { ...this.$options, ..._options };\n const contractId = this.$options.address;\n if (options.onAccount == null) throw new IllegalArgumentError('Can\\'t create delegation signature without account');\n if (contractId == null) throw new MissingContractAddressError('Can\\'t create delegation signature without address');\n return options.onAccount.sign(\n concatBuffers([\n Buffer.from(await options.onNode.getNetworkId()),\n ...options.omitAddress === true ? [] : [decode(options.onAccount.address)],\n ...ids.map((e) => (isNameValid(e) ? produceNameId(e) : e)).map((e) => decode(e)),\n decode(contractId),\n ]),\n options,\n );\n }\n\n /**\n * Compile contract\n * @returns bytecode\n */\n async $compile(): Promise<Encoded.ContractBytearray> {\n if (this.$options.bytecode != null) return this.$options.bytecode;\n if (this.$options.sourceCode == null) throw new IllegalArgumentError('Can\\'t compile without source code');\n this.$options.bytecode = (await this.$options.onCompiler.compileContract({\n code: this.$options.sourceCode, options: { fileSystem: this.$options.fileSystem },\n })).bytecode as Encoded.ContractBytearray;\n return this.$options.bytecode;\n }\n\n protected _handleCallError(\n { returnType, returnValue }: {\n returnType: ContractCallReturnType;\n returnValue: Encoded.ContractBytearray;\n },\n transaction: string,\n ): void {\n let message: string;\n switch (returnType) {\n case 'ok': return;\n case 'revert':\n message = this._calldata.decodeFateString(returnValue);\n break;\n case 'error':\n message = decode(returnValue).toString();\n break;\n default:\n throw new InternalError(`Unknown return type: ${returnType}`);\n }\n throw new NodeInvocationError(message, transaction);\n }\n\n protected async _sendAndProcess(\n tx: Encoded.Transaction,\n options: any,\n ): Promise<SendAndProcessReturnType> {\n options = { ...this.$options, ...options };\n const txData = await send(tx, options);\n const result = {\n hash: txData.hash,\n tx: unpackTx<Tag.ContractCallTx | Tag.ContractCreateTx>(txData.rawTx),\n txData,\n rawTx: txData.rawTx,\n };\n if (txData.blockHeight == null) return result;\n const { callInfo } = await this.$options.onNode.getTransactionInfoByHash(txData.hash);\n Object.assign(result.txData, callInfo); // TODO: don't duplicate data in result\n // @ts-expect-error TODO api should be updated to match types\n this._handleCallError(callInfo, tx);\n return { ...result, result: callInfo as TransformNodeType<ContractCallObject> };\n }\n\n async _estimateGas<Fn extends MethodNames<M>>(\n name: Fn,\n params: MethodParameters<M, Fn>,\n options: object = {},\n ): Promise<number> {\n const { result } = await this.$call(name, params, { ...options, callStatic: true });\n if (result == null) throw new UnexpectedTsError();\n const { gasUsed } = result;\n // taken from https://github.com/aeternity/aepp-sdk-js/issues/1286#issuecomment-977814771\n return Math.floor(gasUsed * 1.25);\n }\n\n /**\n * Deploy contract\n * @param params - Contract init function arguments array\n * @param options - Options\n * @returns deploy info\n */\n async $deploy(\n params: MethodParameters<M, 'init'>,\n options?: Parameters<Contract<M>['$call']>[2] & Parameters<Contract<M>['_sendAndProcess']>[1],\n ): Promise<Omit<SendAndProcessReturnType, 'hash'> & {\n transaction?: Encoded.TxHash;\n owner?: Encoded.AccountAddress;\n address?: Encoded.ContractAddress;\n }> {\n const opt = { ...this.$options, ...options };\n if (this.$options.bytecode == null) await this.$compile();\n if (opt.callStatic === true) return this.$call('init', params, opt);\n if (this.$options.address != null) throw new DuplicateContractError();\n\n const ownerId = opt.onAccount.address;\n const tx = await _buildTx(Tag.ContractCreateTx, {\n ...opt,\n gasLimit: opt.gasLimit ?? await this._estimateGas('init', params, opt),\n callData: this._calldata.encode(this._name, 'init', params),\n code: this.$options.bytecode,\n ownerId,\n });\n this.$options.address = buildContractIdByContractTx(tx);\n const { hash, ...other } = await this._sendAndProcess(tx, opt);\n return {\n ...other,\n owner: ownerId,\n transaction: hash,\n address: this.$options.address,\n };\n }\n\n /**\n * Get function schema from contract ACI object\n * @param name - Function name\n * @returns function ACI\n */\n protected _getFunctionACI(name: string): Partial<FunctionACI> {\n const fn = this._aci.encodedAci.contract.functions.find(\n (f: { name: string }) => f.name === name,\n );\n if (fn != null) {\n return fn;\n }\n if (name === 'init') return { payable: false };\n throw new NoSuchContractFunctionError(`Function ${name} doesn't exist in contract`);\n }\n\n /**\n * Call contract function\n * @param fn - Function name\n * @param params - Array of function arguments\n * @param options - Array of function arguments\n * @returns CallResult\n */\n async $call<Fn extends MethodNames<M>>(\n fn: Fn,\n params: MethodParameters<M, Fn>,\n options: object = {},\n ): Promise<{\n decodedResult?: any;\n decodedEvents?: ReturnType<Contract<M>['$decodeEvents']>;\n } & SendAndProcessReturnType> {\n const opt = { ...this.$options, ...options };\n const fnACI = this._getFunctionACI(fn);\n const contractId = this.$options.address;\n const { onNode } = opt;\n\n if (fn == null) throw new MissingFunctionNameError();\n if (fn === 'init' && opt.callStatic === false) throw new InvalidMethodInvocationError('\"init\" can be called only via dryRun');\n if (fn !== 'init' && opt.amount > 0 && fnACI.payable === false) throw new NotPayableFunctionError(opt.amount, fn);\n\n let callerId;\n try {\n callerId = opt.onAccount.address;\n } catch (error) {\n const useFallbackAccount = opt.callStatic === true && (\n (error instanceof TypeError && error.message === 'Account should be an address (ak-prefixed string), or instance of AccountBase, got undefined instead')\n || (error instanceof NoWalletConnectedError)\n );\n if (!useFallbackAccount) throw error;\n callerId = DRY_RUN_ACCOUNT.pub;\n }\n const callData = this._calldata.encode(this._name, fn, params);\n\n let res: any;\n if (opt.callStatic === true) {\n if (typeof opt.top === 'number') {\n opt.top = (await getKeyBlock(opt.top, { onNode })).hash;\n }\n const txOpt = { ...opt, onNode, callData };\n if (opt.nonce == null && opt.top != null) {\n opt.nonce = (await getAccount(callerId, { hash: opt.top, onNode })).nonce + 1;\n }\n let tx;\n if (fn === 'init') {\n if (this.$options.bytecode == null) throw new IllegalArgumentError('Can\\'t dry-run \"init\" without bytecode');\n tx = await _buildTx(\n Tag.ContractCreateTx,\n { ...txOpt, code: this.$options.bytecode, ownerId: callerId },\n );\n } else {\n if (contractId == null) throw new MissingContractAddressError('Can\\'t dry-run contract without address');\n tx = await _buildTx(Tag.ContractCallTx, { ...txOpt, callerId, contractId });\n }\n\n const { callObj, ...dryRunOther } = await txDryRun(tx, callerId, opt);\n if (callObj == null) throw new UnexpectedTsError();\n this._handleCallError({\n returnType: callObj.returnType as ContractCallReturnType,\n returnValue: callObj.returnValue as Encoded.ContractBytearray,\n }, tx);\n res = { ...dryRunOther, tx: unpackTx(tx), result: callObj };\n } else {\n if (contractId == null) throw new MissingContractAddressError('Can\\'t call contract without address');\n const tx = await _buildTx(Tag.ContractCallTx, {\n ...opt,\n gasLimit: opt.gasLimit ?? await this._estimateGas(fn, params, opt),\n callerId,\n contractId,\n callData,\n });\n res = await this._sendAndProcess(tx, opt);\n }\n if (opt.callStatic === true || res.txData.blockHeight != null) {\n res.decodedResult = fnACI.returns != null && fnACI.returns !== 'unit' && fn !== 'init'\n && this._calldata.decode(this._name, fn, res.result.returnValue);\n res.decodedEvents = this.$decodeEvents(res.result.log, opt);\n }\n return res;\n }\n\n /**\n * @param ctAddress - Contract address that emitted event\n * @param nameHash - Hash of emitted event name\n * @param options - Options\n * @returns Contract name\n * @throws {@link MissingEventDefinitionError}\n * @throws {@link AmbiguousEventDefinitionError}\n */\n protected _getContractNameByEvent(\n ctAddress: Encoded.ContractAddress,\n nameHash: BigInt,\n { contractAddressToName }: {\n contractAddressToName?: { [key: Encoded.ContractAddress]: string };\n },\n ): string {\n const addressToName = { ...this.$options.contractAddressToName, ...contractAddressToName };\n if (addressToName[ctAddress] != null) return addressToName[ctAddress];\n\n // TODO: consider using a third-party library\n const isEqual = (a: any, b: any): boolean => JSON.stringify(a) === JSON.stringify(b);\n\n const matchedEvents = [this._aci.encodedAci, ...this._aci.externalEncodedAci]\n .filter(({ contract }) => contract?.event)\n .map(({ contract }) => [contract.name, contract.event.variant])\n .map(([name, events]) => events.map((event: {}) => (\n [name, Object.keys(event)[0], Object.values(event)[0]]\n )))\n .flat()\n .filter(([, eventName]) => BigInt(`0x${calcHash(eventName).toString('hex')}`) === nameHash)\n .filter(([, , type], idx, arr) => !arr.slice(0, idx).some((el) => isEqual(el[2], type)));\n switch (matchedEvents.length) {\n case 0: throw new MissingEventDefinitionError(nameHash.toString(), ctAddress);\n case 1: return matchedEvents[0][0];\n default: throw new AmbiguousEventDefinitionError(ctAddress, matchedEvents);\n }\n }\n\n /**\n * Decode Events\n * @param events - Array of encoded events (callRes.result.log)\n * @param options - Options\n * @returns DecodedEvents\n */\n $decodeEvents(\n events: Event[],\n { omitUnknown, ...opt }: { omitUnknown?: boolean } &\n Parameters<Contract<M>['_getContractNameByEvent']>[2] = {},\n ): DecodedEvent[] {\n return events\n .map((event) => {\n const topics = event.topics.map((t: string | number) => BigInt(t));\n let contractName;\n try {\n contractName = this._getContractNameByEvent(event.address, topics[0], opt);\n } catch (error) {\n if ((omitUnknown ?? false) && error instanceof MissingEventDefinitionError) return null;\n throw error;\n }\n const decoded = this._calldata.decodeEvent(contractName, event.data, topics);\n const [name, args] = Object.entries(decoded)[0];\n return {\n name,\n args,\n contract: {\n name: contractName,\n address: event.address,\n },\n };\n }).filter((e: DecodedEvent | null): e is DecodedEvent => e != null);\n }\n\n static async initialize<M extends ContractMethodsBase>(\n {\n onCompiler,\n onNode,\n sourceCode,\n bytecode,\n aci,\n address,\n fileSystem,\n validateBytecode,\n ...otherOptions\n }: Omit<ConstructorParameters<typeof Contract>[0], 'aci' | 'address'> & {\n validateBytecode?: boolean;\n aci?: Aci;\n address?: Encoded.ContractAddress | AensName;\n },\n ): Promise<ContractWithMethods<M>> {\n if (aci == null && sourceCode != null) {\n // TODO: should be fixed when the compiledAci interface gets updated\n aci = await onCompiler.generateACI({ code: sourceCode, options: { fileSystem } }) as Aci;\n }\n if (aci == null) throw new MissingContractDefError();\n\n if (address != null) {\n address = await resolveName(\n address,\n 'contract_pubkey',\n { resolveByNode: true, onNode },\n ) as Encoded.ContractAddress;\n }\n\n if (address == null && sourceCode == null && bytecode == null) {\n throw new MissingContractAddressError('Can\\'t create instance by ACI without address');\n }\n\n if (address != null) {\n const contract = await getContract(address, { onNode });\n if (contract.active == null) throw new InactiveContractError(address);\n }\n\n if (validateBytecode != null) {\n if (address == null) throw new MissingContractAddressError('Can\\'t validate bytecode without contract address');\n const onChanBytecode = (await getContractByteCode(address, { onNode })).bytecode;\n const isValid: boolean = sourceCode != null\n ? await onCompiler.validateByteCode(\n { bytecode: onChanBytecode, source: sourceCode, options: { fileSystem } },\n ).then(() => true, () => false)\n : bytecode === onChanBytecode;\n if (!isValid) throw new BytecodeMismatchError(sourceCode != null ? 'source code' : 'bytecode');\n }\n\n return new ContractWithMethods<M>({\n onCompiler, onNode, sourceCode, bytecode, aci, address, fileSystem, ...otherOptions,\n });\n }\n\n _aci: Aci;\n\n _name: string;\n\n _calldata: Calldata;\n\n $options: {\n sourceCode?: string;\n bytecode?: Encoded.ContractBytearray;\n address?: Encoded.ContractAddress;\n onCompiler: CompilerHttp;\n onNode: Node;\n omitUnknown?: boolean;\n contractAddressToName?: { [key: Encoded.ContractAddress]: string };\n [key: string]: any;\n };\n\n constructor({ aci, ...otherOptions }: {\n onAccount?: AccountBase;\n onCompiler: CompilerHttp;\n onNode: Node;\n sourceCode?: string;\n bytecode?: Encoded.ContractBytearray;\n aci: Aci;\n address?: Encoded.ContractAddress;\n fileSystem?: Record<string, string>;\n [key: string]: any;\n }) {\n this._aci = aci;\n this._name = aci.encodedAci.contract.name;\n this._calldata = new Calldata([aci.encodedAci, ...aci.externalEncodedAci]);\n this.$options = { callStatic: false, ...otherOptions };\n\n /**\n * Generate proto function based on contract function using Contract ACI schema\n * All function can be called like:\n * ```js\n * await contract.testFunction()\n * ```\n * then sdk will decide to use dry-run or send tx\n * on-chain base on if function stateful or not.\n * Also, you can manually do that:\n * ```js\n * await contract.testFunction({ callStatic: true }) // use call-static (dry-run)\n * await contract.testFunction({ callStatic: false }) // send tx on-chain\n * ```\n */\n Object.assign(\n this,\n Object.fromEntries(this._aci.encodedAci.contract.functions\n .map(({ name, arguments: aciArgs, stateful }: FunctionACI) => {\n const callStatic = name !== 'init' && !stateful;\n return [\n name,\n async (...args: any) => {\n const options = args.length === aciArgs.length + 1 ? args.pop() : {};\n if (typeof options !== 'object') throw new TypeError(`Options should be an object: ${options}`);\n if (name === 'init') return this.$deploy(args, { callStatic, ...options });\n return this.$call(name, args, { callStatic, ...options });\n },\n ];\n })),\n );\n }\n}\n\ninterface ContractWithMethodsClass {\n new <M extends ContractMethodsBase>(\n options: ConstructorParameters<typeof Contract>[0],\n ): ContractWithMethods<M>;\n initialize: typeof Contract['initialize'];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nconst ContractWithMethods: ContractWithMethodsClass = Contract as any;\n\nexport default ContractWithMethods;\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Oracle methods - routines to interact with the æternity oracle system\n *\n * The high-level description of the oracle system is\n * https://github.com/aeternity/protocol/blob/master/ORACLE.md in the protocol\n * repository.\n */\n\nimport BigNumber from 'bignumber.js';\nimport { send, SendOptions } from './spend';\nimport { mapObject, pause } from './utils/other';\nimport { oracleQueryId } from './tx/builder/helpers';\nimport { unpackTx } from './tx/builder';\nimport {\n ORACLE_TTL,\n ORACLE_TTL_TYPES,\n QUERY_FEE,\n QUERY_TTL,\n RESPONSE_TTL,\n} from './tx/builder/schema';\nimport { Tag } from './tx/builder/constants';\nimport { RequestTimedOutError } from './utils/errors';\nimport {\n decode, encode, Encoded, Encoding,\n} from './utils/encoder';\nimport { _getPollInterval, getHeight } from './chain';\nimport { _buildTx, BuildTxOptions } from './tx';\nimport Node from './Node';\nimport AccountBase from './account/Base';\n\ntype OracleQueries = Awaited<ReturnType<Node['getOracleQueriesByPubkey']>>['oracleQueries'];\n\n/**\n * Poll for oracle queries\n * @category oracle\n * @param oracleId - Oracle public key\n * @param onQuery - OnQuery callback\n * @param options - Options object\n * @param options.interval - Poll interval(default: 5000)\n * @param options.onNode - Node to use\n * @returns Callback to stop polling function\n */\nexport function pollForQueries(\n oracleId: Encoded.OracleAddress,\n onQuery: (queries: OracleQueries) => void,\n { interval, onNode, ...options }: { interval?: number; onNode: Node }\n & Parameters<typeof _getPollInterval>[1],\n): () => void {\n interval ??= _getPollInterval('microblock', options);\n const knownQueryIds = new Set();\n const checkNewQueries = async (): Promise<void> => {\n const queries = ((await onNode.getOracleQueriesByPubkey(oracleId)).oracleQueries ?? [])\n .filter(({ id }) => !knownQueryIds.has(id));\n queries.forEach(({ id }) => knownQueryIds.add(id));\n if (queries.length > 0) onQuery(queries);\n };\n\n let stopped = false;\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n (async () => {\n while (!stopped) { // eslint-disable-line no-unmodified-loop-condition\n // TODO: allow to handle this error somehow\n await checkNewQueries().catch(console.error);\n await pause(interval);\n }\n })();\n return () => { stopped = true; };\n}\n\n/**\n * Poll for oracle query response\n * @category oracle\n * @param oracleId - Oracle public key\n * @param queryId - Oracle Query id\n * @param options - Options object\n * @param options.interval - Poll interval\n * @param options.onNode - Node to use\n * @returns OracleQuery object\n */\nexport async function pollForQueryResponse(\n oracleId: Encoded.OracleAddress,\n queryId: Encoded.OracleQueryId,\n { interval, onNode, ...options }:\n { interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<string> {\n interval ??= _getPollInterval('microblock', options);\n let height;\n let ttl;\n let response;\n do {\n ({ response, ttl } = await onNode.getOracleQueryByPubkeyAndQueryId(oracleId, queryId));\n const responseBuffer = decode(response as Encoded.OracleResponse);\n if (responseBuffer.length > 0) return responseBuffer.toString();\n await pause(interval);\n height = await getHeight({ onNode });\n } while (ttl >= height);\n throw new RequestTimedOutError(height);\n}\n\n/**\n * Constructor for OracleQuery Object (helper object for using OracleQuery)\n * @category oracle\n * @param oracleId - Oracle public key\n * @param queryId - Oracle Query id\n * @param options - Options\n * @returns OracleQuery object\n */\nexport async function getQueryObject(\n oracleId: Encoded.OracleAddress,\n queryId: Encoded.OracleQueryId,\n options: RespondToQueryOptions & Parameters<typeof pollForQueryResponse>[2],\n): Promise<GetQueryObjectReturnType> {\n const record = await options.onNode.getOracleQueryByPubkeyAndQueryId(oracleId, queryId);\n return {\n ...record,\n decodedQuery: decode(record.query as Encoded.OracleQueryId).toString(),\n decodedResponse: decode(record.response as Encoded.OracleResponse).toString(),\n respond: async (response, opt) => (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n respondToQuery(oracleId, queryId, response, { ...options, ...opt })\n ),\n pollForResponse: async (opt) => pollForQueryResponse(oracleId, queryId, { ...options, ...opt }),\n };\n}\n\ninterface GetQueryObjectReturnType extends Awaited<ReturnType<Node['getOracleQueryByPubkeyAndQueryId']>> {\n decodedQuery: string;\n decodedResponse: string;\n respond: (response: string, options?: Parameters<typeof respondToQuery>[3]) =>\n ReturnType<typeof respondToQuery>;\n pollForResponse: (options?: Parameters<typeof pollForQueryResponse>[2]) =>\n ReturnType<typeof pollForQueryResponse>;\n}\n\n/**\n * Post query to oracle\n * @category oracle\n * @param oracleId - Oracle public key\n * @param query - Oracle query object\n * @param options - Options object\n * @param options.queryTtl - queryTtl Oracle query time to leave\n * @param options.responseTtl - queryFee Oracle query response time to leave\n * @param options.queryFee - queryFee Oracle query fee\n * @param options.fee - fee Transaction fee\n * @param options.ttl - Transaction time to leave\n * @returns Query object\n */\nexport async function postQueryToOracle(\n oracleId: Encoded.OracleAddress,\n query: string,\n options: PostQueryToOracleOptions,\n): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getQueryObject>>> {\n options.queryFee ??= (await options.onNode.getOracleByPubkey(oracleId)).queryFee.toString();\n const senderId = options.onAccount.address;\n\n const oracleQueryTx = await _buildTx(Tag.OracleQueryTx, {\n queryTtlType: QUERY_TTL.type,\n queryTtlValue: QUERY_TTL.value,\n responseTtlType: RESPONSE_TTL.type,\n responseTtlValue: RESPONSE_TTL.value,\n ...options,\n oracleId,\n senderId,\n query,\n });\n const { nonce } = unpackTx(oracleQueryTx, Tag.OracleQueryTx).tx;\n const queryId = oracleQueryId(senderId, nonce, oracleId);\n return {\n ...await send(oracleQueryTx, options),\n ...await getQueryObject(oracleId, queryId, options),\n };\n}\n\ntype PostQueryToOracleOptionsType = Parameters<typeof send>[1]\n& Parameters<typeof getQueryObject>[2]\n& BuildTxOptions<Tag.OracleQueryTx, 'oracleId' | 'senderId' | 'query' | 'queryTtlType' | 'queryTtlValue' | 'responseTtlType' | 'responseTtlValue'>\n& {\n queryTtlType?: ORACLE_TTL_TYPES;\n queryTtlValue?: number;\n responseTtlType?: ORACLE_TTL_TYPES;\n responseTtlValue?: number;\n};\ninterface PostQueryToOracleOptions extends PostQueryToOracleOptionsType {}\n\n/**\n * Extend oracle ttl\n * @category oracle\n * @param oracleId - Oracle public key\n * @param options - Options object\n * @param options.fee - fee Transaction fee\n * @param options.ttl - Transaction time to leave\n * @param options.oracleTtlType - Oracle time to leave for extend\n * @param options.oracleTtlValue - Oracle time to leave for extend\n * @returns Oracle object\n */\nexport async function extendOracleTtl(\n oracleId: Encoded.OracleAddress,\n options: ExtendOracleTtlOptions,\n): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>> {\n const oracleExtendTx = await _buildTx(Tag.OracleExtendTx, {\n oracleTtlType: ORACLE_TTL.type,\n oracleTtlValue: ORACLE_TTL.value,\n ...options,\n callerId: options.onAccount.address,\n oracleId,\n });\n return {\n ...await send(oracleExtendTx, options),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n ...await getOracleObject(oracleId, options),\n };\n}\n\ntype ExtendOracleTtlOptionsType = SendOptions & Parameters<typeof getOracleObject>[1]\n& BuildTxOptions<Tag.OracleExtendTx, 'oracleTtlType' | 'oracleTtlValue' | 'callerId' | 'oracleId'>\n& { oracleTtlType?: ORACLE_TTL_TYPES; oracleTtlValue?: number };\ninterface ExtendOracleTtlOptions extends ExtendOracleTtlOptionsType {}\n\n/**\n * Extend oracle ttl\n * @category oracle\n * @param oracleId - Oracle public key\n * @param queryId - Oracle query id\n * @param response - Oracle query response\n * @param options - Options object\n * @param options.responseTtl - responseTtl Query response time to leave\n * @param options.fee - Transaction fee\n * @param options.ttl - Transaction time to leave\n * @returns Oracle object\n */\nexport async function respondToQuery(\n oracleId: Encoded.OracleAddress,\n queryId: Encoded.OracleQueryId,\n response: string,\n options: RespondToQueryOptions,\n): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>> {\n const oracleRespondTx = await _buildTx(Tag.OracleResponseTx, {\n responseTtlType: RESPONSE_TTL.type,\n responseTtlValue: RESPONSE_TTL.value,\n ...options,\n callerId: options.onAccount.address,\n oracleId,\n queryId,\n response,\n });\n return {\n ...await send(oracleRespondTx, options),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n ...await getOracleObject(oracleId, options),\n };\n}\n\ntype RespondToQueryOptionsType = SendOptions & Parameters<typeof getOracleObject>[1]\n& BuildTxOptions<Tag.OracleResponseTx, 'callerId' | 'oracleId' | 'queryId' | 'response' | 'responseTtlType' | 'responseTtlValue'>\n& { responseTtlType?: ORACLE_TTL_TYPES; responseTtlValue?: number };\ninterface RespondToQueryOptions extends RespondToQueryOptionsType {}\n\n/**\n * Constructor for Oracle Object (helper object for using Oracle)\n * @category oracle\n * @param oracleId - Oracle public key\n * @param options - Options\n * @returns Oracle object\n */\nexport async function getOracleObject(\n oracleId: Encoded.OracleAddress,\n options: { onNode: Node; onAccount: AccountBase },\n): Promise<GetOracleObjectReturnType> {\n return {\n ...await options.onNode.getOracleByPubkey(oracleId),\n queries: (await options.onNode.getOracleQueriesByPubkey(oracleId)).oracleQueries,\n ...mapObject<Function, Function>(\n {\n pollQueries: pollForQueries,\n postQuery: postQueryToOracle,\n respondToQuery,\n extendOracle: extendOracleTtl,\n getQuery: getQueryObject,\n },\n ([name, handler]) => [\n name,\n (...args: any) => {\n const lastArg = args[args.length - 1];\n if (lastArg != null && typeof lastArg === 'object' && lastArg.constructor === Object) {\n Object.assign(lastArg, { ...options, ...lastArg });\n } else args.push(options);\n return handler(oracleId, ...args);\n },\n ],\n ),\n } as any;\n}\n\ninterface GetOracleObjectReturnType extends Awaited<ReturnType<Node['getOracleByPubkey']>> {\n id: Encoded.OracleAddress;\n queries: OracleQueries;\n // TODO: replace getOracleObject with a class\n pollQueries: (cb: Parameters<typeof pollForQueries>[1]) => ReturnType<typeof pollForQueries>;\n postQuery: Function;\n respondToQuery: Function;\n extendOracle: Function;\n getQuery: Function;\n}\n\n/**\n * Register oracle\n * @category oracle\n * @param queryFormat - Format of query\n * @param responseFormat - Format of query response\n * @param options - Options\n * @param options.queryFee - Oracle query Fee\n * @param options - Options object\n * @param options.abiVersion - Always 0 (do not use virtual machine)\n * @param options.fee - Transaction fee\n * @param options.ttl - Transaction time to leave\n * @returns Oracle object\n */\nexport async function registerOracle(\n queryFormat: string,\n responseFormat: string,\n options: RegisterOracleOptions,\n): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>> {\n const accountId = options.onAccount.address;\n const oracleRegisterTx = await _buildTx(Tag.OracleRegisterTx, {\n queryFee: QUERY_FEE,\n oracleTtlValue: ORACLE_TTL.value,\n oracleTtlType: ORACLE_TTL.type,\n ...options,\n accountId,\n queryFormat,\n responseFormat,\n });\n return {\n ...await send(oracleRegisterTx, options),\n ...await getOracleObject(encode(decode(accountId), Encoding.OracleAddress), options),\n };\n}\n\ntype RegisterOracleOptionsType = SendOptions & Parameters<typeof getOracleObject>[1]\n& BuildTxOptions<Tag.OracleRegisterTx, 'accountId' | 'queryFormat' | 'responseFormat' | 'queryFee' | 'oracleTtlType' | 'oracleTtlValue'>\n& {\n queryFee?: number | string | BigNumber;\n oracleTtlType?: ORACLE_TTL_TYPES;\n oracleTtlValue?: number;\n};\ninterface RegisterOracleOptions extends RegisterOracleOptionsType {}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Generalized Account module - routines to use generalized account\n */\n\nimport { Tag } from '../tx/builder/constants';\nimport { buildContractIdByContractTx } from '../tx/builder';\nimport { _buildTx, BuildTxOptions } from '../tx';\nimport { hash } from '../utils/crypto';\nimport { decode, Encoded } from '../utils/encoder';\nimport { IllegalArgumentError } from '../utils/errors';\nimport { concatBuffers } from '../utils/other';\nimport AccountBase from '../account/Base';\nimport Contract from './Contract';\nimport { send, SendOptions } from '../spend';\nimport Node from '../Node';\nimport { getAccount } from '../chain';\nimport CompilerHttp from './CompilerHttp';\n\n/**\n * Convert current account to GA\n * @category contract\n * @param authFnName - Authorization function name\n * @param sourceCode - Auth contract source code\n * @param args - init arguments\n * @param options - Options\n * @returns General Account Object\n */\nexport async function createGeneralizedAccount(\n authFnName: string,\n sourceCode: string,\n args: any[],\n {\n onAccount, onCompiler, onNode, ...options\n }: CreateGeneralizedAccountOptions,\n): Promise<Readonly<{\n owner: Encoded.AccountAddress;\n transaction: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n gaContractId: Encoded.ContractAddress;\n }>> {\n const ownerId = onAccount.address;\n if ((await getAccount(ownerId, { onNode })).kind === 'generalized') {\n throw new IllegalArgumentError(`Account ${ownerId} is already GA`);\n }\n\n const contract = await Contract.initialize<{ init: (...a: any[]) => void }>({\n onAccount, onCompiler, onNode, sourceCode,\n });\n\n const tx = await _buildTx(Tag.GaAttachTx, {\n ...options,\n onNode,\n code: await contract.$compile(),\n gasLimit: options.gasLimit ?? await contract._estimateGas('init', args, options),\n ownerId,\n callData: contract._calldata.encode(contract._name, 'init', args),\n authFun: hash(authFnName),\n });\n const contractId = buildContractIdByContractTx(tx);\n const { hash: transaction, rawTx } = await send(tx, {\n onNode, onAccount, onCompiler, ...options,\n });\n\n return Object.freeze({\n owner: ownerId,\n transaction,\n rawTx,\n gaContractId: contractId,\n });\n}\n\ninterface CreateGeneralizedAccountOptions extends\n BuildTxOptions<Tag.GaAttachTx, 'authFun' | 'callData' | 'code' | 'ownerId' | 'gasLimit'>,\n SendOptions {\n onAccount: AccountBase;\n onCompiler: CompilerHttp;\n onNode: Node;\n gasLimit?: number;\n}\n\n/**\n * Build a transaction hash the same as `Auth.tx_hash`\n * @category contract\n * @param transaction - tx-encoded transaction\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Transaction hash\n */\nexport async function buildAuthTxHash(\n transaction: Encoded.Transaction,\n { onNode }: { onNode: Node },\n): Promise<Uint8Array> {\n return new Uint8Array(hash(\n concatBuffers([Buffer.from(await onNode.getNetworkId()), decode(transaction)]),\n ));\n}\n","import _Object$defineProperty from \"@babel/runtime-corejs3/core-js/object/define-property\";\nexport default function _defineProperty(obj, key, value) {\n if (key in obj) {\n _Object$defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import * as chainMethods from './chain';\nimport * as aensMethods from './aens';\nimport * as spendMethods from './spend';\nimport * as oracleMethods from './oracle';\nimport Contract, { ContractMethodsBase } from './contract/Contract';\nimport * as contractGaMethods from './contract/ga';\nimport { _buildTx } from './tx';\nimport { mapObject, UnionToIntersection } from './utils/other';\nimport Node from './Node';\nimport { AE_AMOUNT_FORMATS } from './utils/amount-formatter';\nimport { Tag } from './tx/builder/constants';\nimport AccountBase from './account/Base';\nimport { Encoded } from './utils/encoder';\nimport CompilerHttp from './contract/CompilerHttp';\nimport { ArgumentError, NotImplementedError, TypeError } from './utils/errors';\n\nexport type OnAccount = Encoded.AccountAddress | AccountBase | undefined;\n\nexport function getValueOrErrorProxy<Value extends object>(valueCb: () => Value): Value {\n return new Proxy({}, {\n ...Object.fromEntries([\n 'apply', 'construct', 'defineProperty', 'deleteProperty', 'getOwnPropertyDescriptor',\n 'getPrototypeOf', 'isExtensible', 'ownKeys', 'preventExtensions', 'set', 'setPrototypeOf',\n ].map((name) => [name, () => { throw new NotImplementedError(`${name} proxy request`); }])),\n get(t: {}, property: string | symbol, receiver: any) {\n const target = valueCb();\n const value = Reflect.get(target, property, receiver);\n return typeof value === 'function' ? value.bind(target) : value;\n },\n has(t: {}, property: string | symbol) {\n return Reflect.has(valueCb(), property);\n },\n }) as Value;\n}\n\nconst { InvalidTxError: _2, ...chainMethodsOther } = chainMethods;\n\nconst methods = {\n ...chainMethodsOther,\n ...aensMethods,\n ...spendMethods,\n ...oracleMethods,\n ...contractGaMethods,\n} as const;\n\ntype Decrement<Number extends number> = [-1, 0, 1, 2, 3, 4, 5][Number];\ntype GetMethodsOptions <Methods extends { [key: string]: Function }> =\n {\n [Name in keyof Methods]:\n Methods[Name] extends (...args: infer Args) => any\n ? Args[Decrement<Args['length']>] : never\n };\ntype MethodsOptions = GetMethodsOptions<typeof methods>;\ninterface AeSdkMethodsOptions\n extends Partial<UnionToIntersection<MethodsOptions[keyof MethodsOptions]>> {\n nodes?: Array<{ name: string; instance: Node }>;\n}\n\n/**\n * AeSdkMethods is the composition of:\n * - chain methods\n * - tx methods\n * - aens methods\n * - spend methods\n * - oracle methods\n * - contract methods\n * - contract ga methods\n *\n * While these methods can be used separately, this class provides a handy way to store\n * their context (current account, network, and compiler to use).\n */\nclass AeSdkMethods {\n _options: AeSdkMethodsOptions = { denomination: AE_AMOUNT_FORMATS.AETTOS };\n\n /**\n * @param options - Options\n */\n constructor(options: AeSdkMethodsOptions = {}) {\n Object.assign(this._options, options);\n }\n\n /**\n * Resolves an account\n * @param account - ak-address, instance of AccountBase, or keypair\n */\n // eslint-disable-next-line class-methods-use-this\n _resolveAccount(account?: OnAccount): AccountBase {\n if (typeof account === 'string') throw new NotImplementedError('Address in AccountResolver');\n if (typeof account === 'object') return account;\n throw new TypeError(\n 'Account should be an address (ak-prefixed string), '\n + `or instance of AccountBase, got ${String(account)} instead`,\n );\n }\n\n _getOptions(): AeSdkMethodsOptions & { onAccount: AccountBase } {\n return {\n ...this._options,\n onAccount: getValueOrErrorProxy(() => this._resolveAccount()),\n };\n }\n\n async buildTx<TxType extends Tag>(\n txType: TxType,\n options: Omit<Parameters<typeof _buildTx<TxType>>[1], 'onNode'> & { onNode?: Node },\n ): Promise<Encoded.Transaction> {\n // @ts-expect-error TODO: need to figure out what's wrong here\n return _buildTx<TxType>(txType, {\n ...this._getOptions(),\n ...options,\n });\n }\n\n async initializeContract<Methods extends ContractMethodsBase>(\n options?: Omit<Parameters<typeof Contract.initialize>[0], 'onNode' | 'onCompiler'> &\n { onNode?: Node; onCompiler?: CompilerHttp },\n ): Promise<Contract<Methods>> {\n const { onNode, onCompiler, ...otherOptions } = this._getOptions();\n if (onCompiler == null || onNode == null) {\n throw new ArgumentError('onCompiler, onNode', 'provided', null);\n }\n return Contract.initialize<Methods>({\n ...otherOptions,\n onNode,\n onCompiler,\n ...options,\n });\n }\n}\n\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T];\n\ntype OptionalIfNotRequired<T extends [any]> = RequiredKeys<T[0]> extends never ? T | [] : T;\n\ntype MakeOptional<Options> = OptionalIfNotRequired<[\n Omit<Options, 'onNode' | 'onCompiler' | 'onAccount'>\n & { onNode?: Node; onCompiler?: CompilerHttp; onAccount?: OnAccount },\n]>;\n\ntype TransformMethods <Methods extends { [key: string]: Function }> =\n {\n [Name in keyof Methods]:\n Methods[Name] extends (...args: [...infer Args, infer Options]) => infer Ret\n ? (...args: [...Args, ...MakeOptional<Options>]) => Ret\n : never\n };\n\ninterface AeSdkMethodsTransformed extends TransformMethods<typeof methods> {}\n\nObject.assign(AeSdkMethods.prototype, mapObject<Function, Function>(\n methods,\n ([name, handler]) => [\n name,\n function methodWrapper(...args: any[]) {\n args.length = handler.length;\n const options = args[args.length - 1];\n args[args.length - 1] = {\n ...this._getOptions(),\n ...options,\n ...options?.onAccount != null && { onAccount: this._resolveAccount(options.onAccount) },\n };\n return handler(...args);\n },\n ],\n));\n\nexport default AeSdkMethods as new (options?: ConstructorParameters<typeof AeSdkMethods>[0]) =>\nAeSdkMethods & AeSdkMethodsTransformed;\n","import Node from './Node';\nimport AccountBase from './account/Base';\nimport { CompilerError, DuplicateNodeError, NodeNotFoundError } from './utils/errors';\nimport { Encoded } from './utils/encoder';\nimport CompilerHttp from './contract/CompilerHttp';\nimport AeSdkMethods, { OnAccount, getValueOrErrorProxy } from './AeSdkMethods';\n\ntype NodeInfo = Awaited<ReturnType<Node['getNodeInfo']>> & { name: string };\n\n/**\n * Basic AeSdk class implements:\n * - node selector,\n * - integrated compiler support,\n * - wrappers of account methods mapped to the current account.\n */\nexport default class AeSdkBase extends AeSdkMethods {\n pool: Map<string, Node> = new Map();\n\n selectedNodeName?: string;\n\n /**\n * @param options - Options\n * @param options.nodes - Array of nodes\n */\n constructor(\n { nodes = [], ...options }: ConstructorParameters<typeof AeSdkMethods>[0] & {\n nodes?: Array<{ name: string; instance: Node }>;\n } = {},\n ) {\n super(options);\n\n nodes.forEach(({ name, instance }, i) => this.addNode(name, instance, i === 0));\n }\n\n get compilerApi(): CompilerHttp {\n if (this._options.onCompiler == null) {\n throw new CompilerError('You can\\'t use Compiler API. Compiler is not ready!');\n }\n return this._options.onCompiler;\n }\n\n get api(): Node {\n this.ensureNodeConnected();\n return this.pool.get(this.selectedNodeName) as Node;\n }\n\n /**\n * Add Node\n * @param name - Node name\n * @param node - Node instance\n * @param select - Select this node as current\n * @example\n * ```js\n * // add and select new node with name 'testNode'\n * aeSdkBase.addNode('testNode', new Node({ url }), true)\n * ```\n */\n addNode(name: string, node: Node, select = false): void {\n if (this.pool.has(name)) throw new DuplicateNodeError(name);\n\n this.pool.set(name, node);\n if (select || this.selectedNodeName == null) {\n this.selectNode(name);\n }\n }\n\n /**\n * Select Node\n * @param name - Node name\n * @example\n * nodePool.selectNode('testNode')\n */\n selectNode(name: string): void {\n if (!this.pool.has(name)) throw new NodeNotFoundError(`Node with name ${name} not in pool`);\n this.selectedNodeName = name;\n }\n\n /**\n * Check if you have selected node\n * @example\n * nodePool.isNodeConnected()\n */\n isNodeConnected(): this is AeSdkBase & { selectedNodeName: string } {\n return this.selectedNodeName != null;\n }\n\n protected ensureNodeConnected(): asserts this is AeSdkBase & { selectedNodeName: string } {\n if (!this.isNodeConnected()) {\n throw new NodeNotFoundError('You can\\'t use Node API. Node is not connected or not defined!');\n }\n }\n\n /**\n * Get information about node\n * @example\n * ```js\n * nodePool.getNodeInfo() // { name, version, networkId, protocol, ... }\n * ```\n */\n async getNodeInfo(): Promise<NodeInfo> {\n this.ensureNodeConnected();\n return {\n name: this.selectedNodeName,\n ...await this.api.getNodeInfo(),\n };\n }\n\n /**\n * Get array of available nodes\n * @example\n * nodePool.getNodesInPool()\n */\n async getNodesInPool(): Promise<NodeInfo[]> {\n return Promise.all(\n Array.from(this.pool.entries()).map(async ([name, node]) => ({\n name,\n ...await node.getNodeInfo(),\n })),\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n addresses(): Encoded.AccountAddress[] {\n return [];\n }\n\n get address(): Encoded.AccountAddress {\n return this._resolveAccount().address;\n }\n\n async sign(\n data: string | Uint8Array,\n { onAccount, ...options }: { onAccount?: OnAccount } = {},\n ): Promise<Uint8Array> {\n return this._resolveAccount(onAccount).sign(data, options);\n }\n\n async signTransaction(\n tx: Encoded.Transaction,\n { onAccount, ...options }: { onAccount?: OnAccount } & Parameters<AccountBase['signTransaction']>[1] = {},\n ): Promise<Encoded.Transaction> {\n const networkId = this.selectedNodeName !== null ? await this.api.getNetworkId() : undefined;\n return this._resolveAccount(onAccount).signTransaction(tx, { networkId, ...options });\n }\n\n async signMessage(\n message: string,\n { onAccount, ...options }: { onAccount?: OnAccount } & Parameters<AccountBase['signMessage']>[1] = {},\n ): Promise<Uint8Array> {\n return this._resolveAccount(onAccount).signMessage(message, options);\n }\n\n override _getOptions(): {\n onNode: Node;\n onAccount: AccountBase;\n onCompiler: CompilerHttp;\n } {\n return {\n ...super._getOptions(),\n onNode: getValueOrErrorProxy(() => this.api),\n onCompiler: getValueOrErrorProxy(() => this.compilerApi),\n };\n }\n}\n","import AeSdkBase from './AeSdkBase';\nimport { OnAccount } from './AeSdkMethods';\nimport AccountBase from './account/Base';\nimport { decode, Encoded } from './utils/encoder';\nimport { UnavailableAccountError } from './utils/errors';\n\nexport default class AeSdk extends AeSdkBase {\n accounts: { [key: Encoded.AccountAddress]: AccountBase } = {};\n\n selectedAddress?: Encoded.AccountAddress;\n\n constructor(\n { accounts, ...options }: { accounts?: AccountBase[] }\n & ConstructorParameters<typeof AeSdkBase>[0] = {},\n ) {\n super(options);\n accounts?.forEach((account, idx) => this.addAccount(account, { select: idx === 0 }));\n }\n\n override _resolveAccount(account: OnAccount = this.selectedAddress): AccountBase {\n if (typeof account === 'string') {\n const address = account as Encoded.AccountAddress;\n decode(address);\n if (this.accounts[address] == null) throw new UnavailableAccountError(account);\n account = this.accounts[address];\n }\n return super._resolveAccount(account);\n }\n\n /**\n * Get accounts addresses\n * @example addresses()\n */\n override addresses(): Encoded.AccountAddress[] {\n return Object.keys(this.accounts) as Encoded.AccountAddress[];\n }\n\n /**\n * Add specific account\n * @param account - Account instance\n * @param options - Options\n * @param options.select - Select account\n * @example addAccount(account)\n */\n addAccount(account: AccountBase, { select }: { select?: boolean } = {}): void {\n const { address } = account;\n this.accounts[address] = account;\n if (select === true) this.selectAccount(address);\n }\n\n /**\n * Remove specific account\n * @param address - Address of account to remove\n * @example removeAccount(address)\n */\n removeAccount(address: Encoded.AccountAddress): void {\n if (this.accounts[address] == null) throw new UnavailableAccountError(address);\n delete this.accounts[address]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n if (this.selectedAddress === address) delete this.selectedAddress;\n }\n\n /**\n * Select specific account\n * @param address - Address of account to select\n * @example selectAccount('ak_xxxxxxxx')\n */\n selectAccount(address: Encoded.AccountAddress): void {\n decode(address);\n if (this.accounts[address] == null) throw new UnavailableAccountError(address);\n this.selectedAddress = address;\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport { Encoded } from '../utils/encoder';\nimport Node from '../Node';\nimport CompilerHttp from '../contract/CompilerHttp';\n\n/**\n * Account is one of the three basic building blocks of an\n * {@link AeSdk} and provides access to a signing key pair.\n */\nexport default abstract class AccountBase {\n /**\n * Sign encoded transaction\n * @param tx - Transaction to sign\n * @param options - Options\n * @param options.innerTx - Sign as inner transaction for PayingFor\n * @param options.authData - Object with gaMeta params\n * @returns Signed transaction\n */\n abstract signTransaction(\n tx: Encoded.Transaction,\n options: {\n innerTx?: boolean;\n networkId?: string;\n authData?: {\n gasLimit?: number;\n callData?: Encoded.ContractBytearray;\n sourceCode?: string;\n args?: any[];\n };\n onNode?: Node;\n onCompiler?: CompilerHttp;\n aeppOrigin?: string;\n aeppRpcClientId?: string;\n },\n ): Promise<Encoded.Transaction>;\n\n /**\n * Sign message\n * @param message - Message to sign\n * @param options - Options\n * @returns Signature as hex string of Uint8Array\n */\n abstract signMessage(\n message: string,\n options?: {\n aeppOrigin?: string;\n aeppRpcClientId?: string;\n },\n ): Promise<Uint8Array>;\n\n /**\n * Sign data blob\n * @param data - Data blob to sign\n * @param options - Options\n * @returns Signed data blob\n */\n abstract sign(data: string | Uint8Array, options?: any): Promise<Uint8Array>;\n\n /**\n * Account address\n */\n readonly address: Encoded.AccountAddress;\n}\n","// 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 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 RpcBroadcastError extends RpcError {\n static override code = 3;\n\n override code = 3;\n\n constructor(data?: any) {\n super('Broadcast failed');\n this.data = data;\n this.name = 'RpcBroadcastError';\n }\n}\nrpcErrors.push(RpcBroadcastError);\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","import AccountBase from './Base';\nimport { METHODS } from '../aepp-wallet-communication/schema';\nimport { ArgumentError, NotImplementedError, UnsupportedProtocolError } from '../utils/errors';\nimport { Encoded } from '../utils/encoder';\nimport RpcClient from '../aepp-wallet-communication/rpc/RpcClient';\nimport { AeppApi, WalletApi } from '../aepp-wallet-communication/rpc/types';\n\n/**\n * Account provided by wallet\n * @param params - Params\n * @param params.rpcClient - RpcClient instance\n * @param params.address - RPC account address\n * @returns AccountRpc instance\n */\nexport default class AccountRpc extends AccountBase {\n _rpcClient: RpcClient<WalletApi, AeppApi>;\n\n override readonly address: Encoded.AccountAddress;\n\n constructor(rpcClient: RpcClient<WalletApi, AeppApi>, address: Encoded.AccountAddress) {\n super();\n this._rpcClient = rpcClient;\n this.address = address;\n }\n\n // eslint-disable-next-line class-methods-use-this\n async sign(): Promise<Uint8Array> {\n throw new NotImplementedError('RAW signing using wallet');\n }\n\n /**\n * @returns Signed transaction\n */\n override async signTransaction(\n tx: Encoded.Transaction,\n { innerTx, networkId }: Parameters<AccountBase['signTransaction']>[1] = {},\n ): Promise<Encoded.Transaction> {\n if (innerTx != null) throw new NotImplementedError('innerTx option in AccountRpc');\n if (networkId == null) throw new ArgumentError('networkId', 'provided', networkId);\n const res = await this._rpcClient.request(METHODS.sign, {\n onAccount: this.address,\n tx,\n returnSigned: true,\n networkId,\n });\n if (res.signedTransaction == null) {\n throw new UnsupportedProtocolError('signedTransaction is missed in wallet response');\n }\n return res.signedTransaction;\n }\n\n /**\n * @returns Signed message\n */\n override async signMessage(message: string): Promise<Uint8Array> {\n const { signature } = await this._rpcClient\n .request(METHODS.signMessage, { onAccount: this.address, message });\n return Buffer.from(signature, 'hex');\n }\n}\n","import { RpcError, RpcInternalError, RpcMethodNotFoundError } from '../schema';\nimport BrowserConnection from '../connection/Browser';\nimport { InvalidRpcMessageError, MissingCallbackError } from '../../utils/errors';\n\ninterface JsonRpcRequest {\n jsonrpc: '2.0';\n id: number;\n method: string;\n params?: any;\n}\n\ninterface JsonRpcResponse {\n jsonrpc: '2.0';\n id: number;\n method: string;\n result?: any;\n error?: {\n code: number;\n message: string;\n data?: any;\n };\n}\n\ntype RpcApiHandler = (p?: any) => any | undefined;\ntype RpcApi<Api> = { [k in keyof Api]: RpcApiHandler };\ntype WithOrigin<Api extends RpcApi<Api>> = {\n [k in keyof Api]: (p: Parameters<Api[k]>[0], origin: string) => ReturnType<Api[k]>\n};\n\n/**\n * Contain functionality for using RPC conection\n * @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;\n try {\n if (!(request.method in this.#methods)) throw new RpcMethodNotFoundError();\n const methodName = request.method as keyof LocalApi;\n result = await this.#methods[methodName](request.params, origin);\n } catch (e) {\n error = e instanceof RpcError ? e : new RpcInternalError();\n }\n if (request.id != null) {\n this.#sendResponse(request.id, request.method as keyof LocalApi, result, error);\n }\n }\n\n #sendRequest(\n id: number | undefined,\n method: keyof RemoteApi | keyof LocalApi,\n params?: any,\n ): void {\n this.connection.sendMessage({\n jsonrpc: '2.0',\n ...id != null ? { id } : {},\n method,\n ...params != null ? { params } : {},\n });\n }\n\n #sendResponse(\n id: number,\n method: keyof RemoteApi | keyof LocalApi, // TODO: remove as far it is not required in JSON RPC\n result?: any,\n error?: any,\n ): void {\n this.connection.sendMessage({\n jsonrpc: '2.0',\n id,\n method,\n ...error != null ? { error } : { result },\n });\n }\n\n /**\n * Make a request\n * @param name - Method name\n * @param params - Method params\n * @returns Promise which will be resolved after receiving response message\n */\n async request<Name extends keyof RemoteApi>(\n name: Name,\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","import AeSdkBase from './AeSdkBase';\nimport { OnAccount } from './AeSdkMethods';\nimport AccountBase from './account/Base';\nimport AccountRpc from './account/Rpc';\nimport { decode, Encoded } from './utils/encoder';\nimport {\n Accounts, RPC_VERSION, WalletInfo, Network, WalletApi, AeppApi,\n} from './aepp-wallet-communication/rpc/types';\nimport RpcClient from './aepp-wallet-communication/rpc/RpcClient';\nimport { METHODS, SUBSCRIPTION_TYPES } from './aepp-wallet-communication/schema';\nimport {\n AlreadyConnectedError,\n NoWalletConnectedError,\n UnsubscribedAccountError,\n UnAuthorizedAccountError,\n RpcConnectionError,\n} from './utils/errors';\nimport Node from './Node';\nimport BrowserConnection from './aepp-wallet-communication/connection/Browser';\n\n/**\n * RPC handler for AEPP side\n * Contain functionality for wallet interaction and connect it to sdk\n * @category aepp wallet communication\n */\nexport default class AeSdkAepp extends AeSdkBase {\n name: string;\n\n onAddressChange: (a: Accounts) => void;\n\n onDisconnect: (p: any) => void;\n\n onNetworkChange: (a: Network) => void;\n\n rpcClient?: RpcClient<WalletApi, AeppApi>;\n\n _accounts?: Accounts;\n\n /**\n * @param options - Options\n * @param options.name - Aepp name\n * @param options.onAddressChange - Call-back function for update address event\n * @param options.onDisconnect - Call-back function for disconnect event\n * @param options.onNetworkChange - Call-back function for update network event\n */\n constructor({\n name,\n onAddressChange = () => {},\n onDisconnect = () => {},\n onNetworkChange = () => {},\n ...other\n }: {\n name: string;\n onAddressChange?: (a: Accounts) => void;\n onDisconnect?: (p: any) => void;\n onNetworkChange?: (a: Network) => void;\n } & ConstructorParameters<typeof AeSdkBase>[0]) {\n super(other);\n this.onAddressChange = onAddressChange;\n this.onDisconnect = onDisconnect;\n this.onNetworkChange = onNetworkChange;\n this.name = name;\n }\n\n override _resolveAccount(account: OnAccount = this.addresses()[0]): AccountBase {\n if (typeof account === 'string') {\n const address = account as Encoded.AccountAddress;\n decode(address);\n if (!this.addresses().includes(address)) throw new UnAuthorizedAccountError(address);\n this._ensureConnected();\n account = new AccountRpc(this.rpcClient, address);\n }\n if (account == null) this._ensureAccountAccess();\n return super._resolveAccount(account);\n }\n\n override addresses(): Encoded.AccountAddress[] {\n if (this._accounts == null) return [];\n const current = Object.keys(this._accounts.current)[0];\n return [\n ...current != null ? [current] : [], ...Object.keys(this._accounts.connected),\n ] as Encoded.AccountAddress[];\n }\n\n /**\n * Connect to wallet\n * @param connection - Wallet connection object\n * @param options - Options\n * @param options.connectNode - Request wallet to bind node\n * @param options.name - Node name\n * @param options.select - Select this node as current\n */\n async connectToWallet(\n connection: BrowserConnection,\n { connectNode = false, name = 'wallet-node', select = false }:\n { connectNode?: boolean; name?: string; select?: boolean } = {},\n ): Promise<WalletInfo> {\n if (this.rpcClient != null) throw new AlreadyConnectedError('You are already connected to wallet');\n let disconnectParams: any;\n const client = new RpcClient<WalletApi, AeppApi>(\n connection,\n () => {\n delete this.rpcClient;\n delete this._accounts;\n this.onDisconnect(disconnectParams);\n },\n {\n [METHODS.updateAddress]: (params) => {\n this._accounts = params;\n this.onAddressChange(params);\n },\n [METHODS.updateNetwork]: (params) => {\n const { node } = params;\n if (node != null) this.addNode(node.name, new Node(node.url), true);\n this.onNetworkChange(params);\n },\n [METHODS.closeConnection]: (params) => {\n disconnectParams = params;\n client.connection.disconnect();\n },\n [METHODS.readyToConnect]: () => {},\n },\n );\n const { node, ...walletInfo } = await client\n .request(METHODS.connect, { name: this.name, version: RPC_VERSION, connectNode });\n if (connectNode) {\n if (node == null) throw new RpcConnectionError('Missing URLs of the Node');\n this.addNode(name, new Node(node.url), select);\n }\n this.rpcClient = client;\n return walletInfo;\n }\n\n /**\n * Disconnect from wallet\n */\n disconnectWallet(): void {\n this._ensureConnected();\n this.rpcClient.notify(METHODS.closeConnection, { reason: 'bye' });\n this.rpcClient.connection.disconnect();\n }\n\n /**\n * Ask addresses from wallet\n * @returns Addresses from wallet\n */\n async askAddresses(): Promise<Encoded.AccountAddress[]> {\n this._ensureAccountAccess();\n return this.rpcClient.request(METHODS.address, undefined);\n }\n\n /**\n * Subscribe for addresses from wallet\n * @param type - Subscription type\n * @param value - Should be one of 'current' (the selected account), 'connected' (all)\n * @returns Accounts from wallet\n */\n async subscribeAddress(\n type: SUBSCRIPTION_TYPES,\n value: 'current' | 'connected',\n ): Promise<ReturnType<WalletApi[METHODS.subscribeAddress]>> {\n this._ensureConnected();\n const result = await this.rpcClient.request(METHODS.subscribeAddress, { type, value });\n this._accounts = result.address;\n return result;\n }\n\n _ensureConnected(): asserts this is AeSdkAepp & { rpcClient: NonNullable<AeSdkAepp['rpcClient']> } {\n if (this.rpcClient != null) return;\n throw new NoWalletConnectedError('You are not connected to Wallet');\n }\n\n _ensureAccountAccess(): asserts this is AeSdkAepp & { rpcClient: NonNullable<AeSdkAepp['rpcClient']> } {\n this._ensureConnected();\n if (this.addresses().length !== 0) return;\n throw new UnsubscribedAccountError();\n }\n}\n","import { send } from '../../spend';\nimport { Encoded } from '../../utils/encoder';\nimport { METHODS, SUBSCRIPTION_TYPES, WALLET_TYPE } from '../schema';\n\nexport interface WalletInfo {\n id: string;\n name: string;\n networkId: string;\n origin: string;\n type: WALLET_TYPE;\n}\n\nexport interface Accounts {\n connected: { [pub: Encoded.AccountAddress]: {} };\n current: { [pub: Encoded.AccountAddress]: {} };\n}\n\nexport interface Node {\n name: string;\n url: string;\n}\n\nexport interface Network {\n networkId: string;\n node?: Node;\n}\n\ntype Icons = Array<{ src: string; sizes?: string; type?: string; purpose?: string }>;\n\nexport const RPC_VERSION = 1;\n\nexport interface WalletApi {\n [METHODS.connect]: (\n p: { name: string; icons?: Icons; version: typeof RPC_VERSION; connectNode: boolean }\n ) => Promise<WalletInfo & { node?: Node }>;\n\n [METHODS.closeConnection]: (p: any) => void;\n\n [METHODS.subscribeAddress]: (\n p: { type: SUBSCRIPTION_TYPES; value: 'connected' | 'current' }\n ) => Promise<{ subscription: Array<'connected' | 'current'>; address: Accounts }>;\n\n [METHODS.address]: () => Promise<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 }\n ) => Promise<{\n /**\n * @deprecated this is not a hash at all, will be removed later at the same time\n * as dropping ability to broadcast transaction by wallet\n */\n transactionHash?: Awaited<ReturnType<typeof send>>;\n signedTransaction?: Encoded.Transaction;\n }>);\n\n [METHODS.signMessage]: (\n p: { message: string; onAccount: Encoded.AccountAddress }\n ) => Promise<{ signature: string }>;\n}\n\nexport interface AeppApi {\n [METHODS.updateAddress]: (a: Accounts) => void;\n [METHODS.updateNetwork]: (a: Network) => void;\n [METHODS.readyToConnect]: (w: WalletInfo) => void;\n [METHODS.closeConnection]: (p: any) => void;\n}\n","import JsonBig from 'json-bigint';\nimport BigNumber from 'bignumber.js';\nimport { mapObject } from './other';\n\nconst jsonBig = JsonBig({ storeAsString: true });\n\nconst convertValuesToBigNumbers = (value: any): any => {\n if (typeof value === 'object' && value !== null && value.constructor === Object) {\n return mapObject(value, ([k, v]) => [k, convertValuesToBigNumbers(v)]);\n }\n if (Array.isArray(value)) {\n return value.map((item) => convertValuesToBigNumbers(item));\n }\n if (typeof value === 'string' && new BigNumber(value).toString(10) === value) {\n const bn = new BigNumber(value);\n bn.toJSON = () => bn.toString(10);\n return bn;\n }\n return value;\n};\n\nexport default {\n stringify: (...args: Parameters<typeof JsonBig['stringify']>): string => (\n jsonBig.stringify(convertValuesToBigNumbers(args[0]), ...args.slice(1))\n ),\n parse: jsonBig.parse,\n};\n","import { v4 as uuid } from '@aeternity/uuid';\nimport AeSdk from './AeSdk';\nimport verifyTransaction from './tx/validator';\nimport RpcClient from './aepp-wallet-communication/rpc/RpcClient';\nimport {\n METHODS, RPC_STATUS, SUBSCRIPTION_TYPES, WALLET_TYPE,\n RpcBroadcastError, RpcInvalidTransactionError,\n RpcNotAuthorizeError, RpcPermissionDenyError, RpcUnsupportedProtocolError,\n} from './aepp-wallet-communication/schema';\nimport { InternalError, UnknownRpcClientError } from './utils/errors';\nimport AccountBase from './account/Base';\nimport BrowserConnection from './aepp-wallet-communication/connection/Browser';\nimport {\n Accounts,\n AeppApi,\n Network,\n RPC_VERSION,\n WalletApi,\n WalletInfo,\n} from './aepp-wallet-communication/rpc/types';\nimport { Encoded } from './utils/encoder';\nimport jsonBig from './utils/json-big';\n\ntype RpcClientWallet = RpcClient<AeppApi, WalletApi>;\n\ntype OnConnection = (\n clientId: string, params: Omit<Parameters<WalletApi[METHODS.connect]>[0], 'version'>, origin: string\n) => void;\n\ntype OnSubscription = (\n clientId: string, params: Parameters<WalletApi[METHODS.subscribeAddress]>[0], origin: string\n) => void;\n\ntype OnDisconnect = (\n clientId: string, params: Parameters<WalletApi[METHODS.closeConnection]>[0]\n) => void;\n\ntype OnAskAccounts = (\n clientId: string, params: undefined, origin: string\n) => void;\n\ninterface RpcClientsInfo {\n id: string;\n status: RPC_STATUS;\n connectNode: boolean;\n addressSubscription: Set<'connected' | 'current'>;\n rpc: RpcClientWallet;\n}\n\n/**\n * Contain functionality for aepp interaction and managing multiple aepps\n * @category aepp wallet communication\n */\nexport default class AeSdkWallet extends AeSdk {\n id: string;\n\n _type: WALLET_TYPE;\n\n name: string;\n\n _clients = new Map<string, RpcClientsInfo>();\n\n onConnection: OnConnection;\n\n onSubscription: OnSubscription;\n\n onDisconnect: OnDisconnect;\n\n onAskAccounts: OnAskAccounts;\n\n /**\n * @param options - Options\n * @param options.name - Wallet name\n * @param options.id - Wallet id\n * @param options.type - Wallet type\n * @param options.onConnection - Call-back function for incoming AEPP connection\n * @param options.onSubscription - Call-back function for incoming AEPP account subscription\n * @param options.onAskAccounts - Call-back function for incoming AEPP get address request\n * @param options.onDisconnect - Call-back function for disconnect event\n */\n constructor({\n name,\n id,\n type,\n onConnection,\n onSubscription,\n onDisconnect,\n onAskAccounts,\n ...options\n }: {\n id: string;\n type: WALLET_TYPE;\n name: string;\n onConnection: OnConnection;\n onSubscription: OnSubscription;\n onDisconnect: OnDisconnect;\n onAskAccounts: OnAskAccounts;\n } & ConstructorParameters<typeof AeSdk>[0]) {\n super(options);\n this.onConnection = onConnection;\n this.onSubscription = onSubscription;\n this.onDisconnect = onDisconnect;\n this.onAskAccounts = onAskAccounts;\n this.name = name;\n this.id = id;\n this._type = type;\n }\n\n _pushAccountsToApps(): void {\n if (this._clients == null) return;\n Array.from(this._clients.keys())\n .filter((clientId) => this._isRpcClientSubscribed(clientId))\n .map((clientId) => this._getClient(clientId).rpc)\n .forEach((client) => client.notify(METHODS.updateAddress, this.getAccounts()));\n }\n\n override selectAccount(address: Encoded.AccountAddress): void {\n super.selectAccount(address);\n this._pushAccountsToApps();\n }\n\n override addAccount(account: AccountBase, options?: Parameters<AeSdk['addAccount']>[1]): void {\n super.addAccount(account, options);\n this._pushAccountsToApps();\n }\n\n _getNode(): { node: Network['node'] } {\n this.ensureNodeConnected();\n return { node: { url: this.api.$host, name: this.selectedNodeName } };\n }\n\n override async selectNode(name: string): Promise<void> {\n super.selectNode(name);\n const networkId = await this.api.getNetworkId();\n Array.from(this._clients.keys())\n .filter((clientId) => this._isRpcClientConnected(clientId))\n .map((clientId) => this._getClient(clientId))\n .forEach((client) => {\n client.rpc.notify(METHODS.updateNetwork, {\n networkId,\n ...client.connectNode && this._getNode(),\n });\n });\n }\n\n _getClient(clientId: string): RpcClientsInfo {\n const client = this._clients.get(clientId);\n if (client == null) throw new UnknownRpcClientError(clientId);\n return client;\n }\n\n _isRpcClientSubscribed(clientId: string): boolean {\n return this._isRpcClientConnected(clientId)\n && this._getClient(clientId).addressSubscription.size !== 0;\n }\n\n _isRpcClientConnected(clientId: string): boolean {\n return RPC_STATUS.CONNECTED === this._getClient(clientId).status\n && this._getClient(clientId).rpc.connection.isConnected();\n }\n\n _disconnectRpcClient(clientId: string): void {\n const client = this._getClient(clientId);\n client.rpc.connection.disconnect();\n client.status = RPC_STATUS.DISCONNECTED;\n client.addressSubscription = new Set();\n }\n\n /**\n * Remove specific RpcClient by ID\n * @param id - Client ID\n */\n removeRpcClient(id: string): void {\n this._disconnectRpcClient(id);\n this._clients.delete(id);\n }\n\n /**\n * Add new client by AEPP connection\n * @param clientConnection - AEPP connection object\n * @returns Client ID\n */\n addRpcClient(clientConnection: BrowserConnection): string {\n // @TODO detect if aepp has some history based on origin????\n // if yes use this instance for connection\n const id = uuid();\n let disconnectParams: any;\n const client: RpcClientsInfo = {\n id,\n status: RPC_STATUS.WAITING_FOR_CONNECTION_REQUEST,\n addressSubscription: new Set(),\n connectNode: false,\n rpc: new RpcClient<AeppApi, WalletApi>(\n clientConnection,\n () => {\n this._clients.delete(id);\n this.onDisconnect(id, disconnectParams); // also related info\n },\n {\n [METHODS.closeConnection]: (params) => {\n disconnectParams = params;\n this._disconnectRpcClient(id);\n },\n // Store client info and prepare two fn for each client `connect` and `denyConnection`\n // which automatically prepare and send response for that client\n [METHODS.connect]: async ({\n name, version, icons, connectNode,\n }, origin) => {\n if (version !== RPC_VERSION) throw new RpcUnsupportedProtocolError();\n\n await this.onConnection(id, { name, icons, connectNode }, origin);\n client.status = RPC_STATUS.CONNECTED;\n client.connectNode = connectNode;\n return {\n ...await this.getWalletInfo(),\n ...connectNode && this._getNode(),\n };\n },\n [METHODS.subscribeAddress]: async ({ type, value }, origin) => {\n if (!this._isRpcClientConnected(id)) throw new RpcNotAuthorizeError();\n\n await this.onSubscription(id, { type, value }, origin);\n\n switch (type) {\n case SUBSCRIPTION_TYPES.subscribe:\n client.addressSubscription.add(value);\n break;\n case SUBSCRIPTION_TYPES.unsubscribe:\n client.addressSubscription.delete(value);\n break;\n default:\n throw new InternalError(`Unknown subscription type: ${type}`);\n }\n\n return {\n subscription: Array.from(client.addressSubscription),\n address: this.getAccounts(),\n };\n },\n [METHODS.address]: async (params, origin) => {\n if (!this._isRpcClientSubscribed(id)) throw new RpcNotAuthorizeError();\n await this.onAskAccounts(id, params, origin);\n return this.addresses();\n },\n [METHODS.sign]: async ({ tx, onAccount = this.address, returnSigned }, origin) => {\n if (!this._isRpcClientConnected(id)) throw new RpcNotAuthorizeError();\n if (!this.addresses().includes(onAccount)) {\n throw new RpcPermissionDenyError(onAccount);\n }\n\n const parameters = { onAccount, aeppOrigin: origin, aeppRpcClientId: id };\n if (returnSigned) {\n return { signedTransaction: await this.signTransaction(tx, parameters) };\n }\n try {\n return jsonBig.parse(jsonBig.stringify({\n transactionHash: await this.send(tx, { ...parameters, verify: false }),\n }));\n } catch (error) {\n const validation = await verifyTransaction(tx, this.api);\n if (validation.length > 0) throw new RpcInvalidTransactionError(validation);\n throw new RpcBroadcastError(error.message);\n }\n },\n [METHODS.signMessage]: async ({ message, onAccount = this.address }, origin) => {\n if (!this._isRpcClientConnected(id)) throw new RpcNotAuthorizeError();\n if (!this.addresses().includes(onAccount)) {\n throw new RpcPermissionDenyError(onAccount);\n }\n\n const parameters = { onAccount, aeppOrigin: origin, aeppRpcClientId: id };\n return {\n signature: Buffer.from(await this.signMessage(message, parameters)).toString('hex'),\n };\n },\n },\n ),\n };\n this._clients.set(id, client);\n return id;\n }\n\n /**\n * Send shareWalletInfo message to notify AEPP about wallet\n * @param clientId - ID of RPC client send message to\n */\n async shareWalletInfo(clientId: string): Promise<void> {\n this._getClient(clientId).rpc.notify(METHODS.readyToConnect, await this.getWalletInfo());\n }\n\n /**\n * Get Wallet info object\n * @returns Object with wallet information\n */\n async getWalletInfo(): Promise<WalletInfo> {\n return {\n id: this.id,\n name: this.name,\n networkId: await this.api.getNetworkId(),\n origin: window.location.origin,\n type: this._type,\n };\n }\n\n /**\n * Get Wallet accounts\n * @returns Object with accounts information (\\{ connected: Object, current: Object \\})\n */\n getAccounts(): Accounts {\n return {\n current: this.selectedAddress != null ? { [this.selectedAddress]: {} } : {},\n connected: this.addresses()\n .filter((a) => a !== this.selectedAddress)\n .reduce((acc, a) => ({ ...acc, [a]: {} }), {}),\n };\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport AccountBase from './Base';\nimport {\n generateKeyPairFromSecret, sign, generateKeyPair, hash, messageToHash,\n} from '../utils/crypto';\nimport { ArgumentError } from '../utils/errors';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../utils/encoder';\nimport { concatBuffers } from '../utils/other';\nimport { buildTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\n\nconst secretKeys = new WeakMap();\n\n/**\n * In-memory account class\n */\nexport default class AccountMemory extends AccountBase {\n override readonly address: Encoded.AccountAddress;\n\n /**\n * @param secretKey - Secret key\n */\n constructor(secretKey: string | Uint8Array) {\n super();\n secretKey = typeof secretKey === 'string' ? Buffer.from(secretKey, 'hex') : secretKey;\n if (secretKey.length !== 64) {\n throw new ArgumentError('secretKey', '64 bytes', secretKey.length);\n }\n secretKeys.set(this, secretKey);\n this.address = encode(\n generateKeyPairFromSecret(secretKeys.get(this)).publicKey,\n Encoding.AccountAddress,\n );\n }\n\n /**\n * Generates a new AccountMemory using a random secret key\n */\n static generate(): AccountMemory {\n return new AccountMemory(generateKeyPair().secretKey);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n override async sign(data: string | Uint8Array, options?: any): Promise<Uint8Array> {\n return sign(data, secretKeys.get(this));\n }\n\n override async signTransaction(\n tx: Encoded.Transaction,\n { innerTx, networkId, ...options }: { innerTx?: boolean; networkId?: string } = {},\n ): Promise<Encoded.Transaction> {\n if (networkId == null) {\n throw new ArgumentError('networkId', 'provided', networkId);\n }\n const prefixes = [networkId];\n if (innerTx === true) prefixes.push('inner_tx');\n const rlpBinaryTx = decode(tx);\n const txWithNetworkId = concatBuffers([Buffer.from(prefixes.join('-')), hash(rlpBinaryTx)]);\n\n const signatures = [await this.sign(txWithNetworkId, options)];\n return buildTx({ encodedTx: rlpBinaryTx, signatures }, Tag.SignedTx).tx;\n }\n\n override async signMessage(message: string, options?: any): Promise<Uint8Array> {\n return this.sign(messageToHash(message), options);\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport AccountBase from './Base';\nimport {\n ArgumentError,\n InternalError,\n InvalidAuthDataError,\n NotImplementedError,\n} from '../utils/errors';\nimport { decode, Encoded } from '../utils/encoder';\nimport { getAccount } from '../chain';\nimport Contract from '../contract/Contract';\nimport { _buildTx } from '../tx';\nimport { Tag } from '../tx/builder/constants';\nimport { buildTx } from '../tx/builder';\n\n/**\n * Generalized account class\n */\nexport default class AccountGeneralized extends AccountBase {\n override readonly address: Encoded.AccountAddress;\n\n #authFun?: string;\n\n /**\n * @param address - Address of generalized account\n */\n constructor(address: Encoded.AccountAddress) {\n super();\n decode(address);\n this.address = address;\n }\n\n // eslint-disable-next-line class-methods-use-this\n override async sign(): Promise<Uint8Array> {\n throw new NotImplementedError('Can\\'t sign using generalized account');\n }\n\n // eslint-disable-next-line class-methods-use-this\n override async signMessage(): Promise<Uint8Array> {\n throw new NotImplementedError('Can\\'t sign using generalized account');\n }\n\n override async signTransaction(\n tx: Encoded.Transaction,\n { authData, onCompiler, onNode }: Parameters<AccountBase['signTransaction']>[1],\n ): Promise<Encoded.Transaction> {\n if (authData == null || onCompiler == null || onNode == null) {\n throw new ArgumentError('authData, onCompiler, onNode', 'provided', null);\n }\n const {\n callData, sourceCode, args, gasLimit,\n } = authData;\n\n const authCallData = callData ?? await (async () => {\n if (this.#authFun == null) {\n const account = await getAccount(this.address, { onNode });\n if (account.kind !== 'generalized') {\n throw new ArgumentError('account kind', 'generalized', account.kind);\n }\n this.#authFun = account.authFun;\n }\n if (this.#authFun == null) {\n throw new InternalError('Account in generalised, but authFun not provided');\n }\n\n if (sourceCode == null || args == null) {\n throw new InvalidAuthDataError('Auth data must contain source code and arguments.');\n }\n const contract = await Contract.initialize({ onCompiler, onNode, sourceCode });\n return contract._calldata.encode(contract._name, this.#authFun, args);\n })();\n\n const gaMetaTx = await _buildTx(Tag.GaMetaTx, {\n tx: buildTx({ encodedTx: decode(tx), signatures: [] }, Tag.SignedTx).rlpEncoded,\n gaId: this.address,\n authData: authCallData,\n gasLimit,\n nonce: 0,\n onNode,\n });\n return buildTx({ encodedTx: decode(gaMetaTx), signatures: [] }, Tag.SignedTx).tx;\n }\n}\n","import type Transport from '@ledgerhq/hw-transport';\nimport AccountBase from './Base';\nimport { ArgumentError, NotImplementedError } from '../utils/errors';\nimport { decode, Encoded } from '../utils/encoder';\nimport { buildTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\n\nexport const CLA = 0xe0;\nexport const GET_ADDRESS = 0x02;\nexport const SIGN_TRANSACTION = 0x04;\nexport const GET_APP_CONFIGURATION = 0x06;\nexport const SIGN_PERSONAL_MESSAGE = 0x08;\n\n/**\n * Ledger wallet account class\n */\nexport default class AccountLedger extends AccountBase {\n readonly transport: Transport;\n\n override readonly address: Encoded.AccountAddress;\n\n readonly index: number;\n\n /**\n * @param transport - Connection to Ledger to use\n * @param index - Index of account\n * @param address - Address of account\n */\n constructor(transport: Transport, index: number, address: Encoded.AccountAddress) {\n super();\n this.transport = transport;\n this.index = index;\n this.address = address;\n const scrambleKey = 'w0w';\n transport.decorateAppAPIMethods(this, ['signTransaction', 'signMessage'], scrambleKey);\n }\n\n // eslint-disable-next-line class-methods-use-this\n override async sign(): Promise<Uint8Array> {\n throw new NotImplementedError('RAW signing using Ledger HW');\n }\n\n override async signTransaction(\n tx: Encoded.Transaction,\n { innerTx, networkId }: { innerTx?: boolean; networkId?: string } = {},\n ): Promise<Encoded.Transaction> {\n if (innerTx != null) throw new NotImplementedError('innerTx option in AccountLedger');\n if (networkId == null) throw new ArgumentError('networkId', 'provided', networkId);\n\n const rawTx = decode(tx);\n let offset = 0;\n const headerLength = 4 + 1 + 4;\n const networkIdBuffer = Buffer.from(networkId);\n const toSend = [];\n while (offset !== rawTx.length) {\n const maxChunkSize = offset === 0 ? 150 - headerLength - networkIdBuffer.length : 150;\n const chunkSize = offset + maxChunkSize > rawTx.length\n ? rawTx.length - offset : maxChunkSize;\n const buffer = Buffer.alloc(\n offset === 0 ? headerLength + networkIdBuffer.length + chunkSize : chunkSize,\n );\n if (offset === 0) {\n let bufferOffset = buffer.writeUInt32BE(this.index, 0);\n bufferOffset = buffer.writeUInt32BE(rawTx.length, bufferOffset);\n bufferOffset = buffer.writeUInt8(networkIdBuffer.length, bufferOffset);\n bufferOffset += networkIdBuffer.copy(\n buffer,\n bufferOffset,\n 0,\n networkIdBuffer.length,\n );\n rawTx.copy(buffer, bufferOffset, 0, 150 - bufferOffset);\n } else {\n rawTx.copy(buffer, 0, offset, offset + chunkSize);\n }\n toSend.push(buffer);\n offset += chunkSize;\n }\n const response = await toSend.reduce(\n async (previous, data, i) => {\n await previous;\n return this.transport.send(\n CLA,\n SIGN_TRANSACTION,\n i === 0 ? 0x00 : 0x80,\n 0x00,\n data,\n );\n },\n Promise.resolve(Buffer.alloc(0)),\n );\n const signatures = [response.subarray(0, 64)];\n\n return buildTx({ encodedTx: rawTx, signatures }, Tag.SignedTx).tx;\n }\n\n override async signMessage(messageStr: string): Promise<Uint8Array> {\n let offset = 0;\n const message = Buffer.from(messageStr);\n const toSend = [];\n while (offset !== message.length) {\n const maxChunkSize = offset === 0 ? 150 - 4 - 4 : 150;\n const chunkSize = offset + maxChunkSize > message.length\n ? message.length - offset : maxChunkSize;\n const buffer = Buffer.alloc(offset === 0 ? 4 + 4 + chunkSize : chunkSize);\n if (offset === 0) {\n buffer.writeUInt32BE(this.index, 0);\n buffer.writeUInt32BE(message.length, 4);\n message.copy(buffer, 4 + 4, offset, offset + chunkSize);\n } else {\n message.copy(buffer, 0, offset, offset + chunkSize);\n }\n toSend.push(buffer);\n offset += chunkSize;\n }\n const response = await toSend.reduce(\n async (previous, data, i) => {\n await previous;\n return this.transport.send(\n CLA,\n SIGN_PERSONAL_MESSAGE,\n i === 0 ? 0x00 : 0x80,\n 0x00,\n data,\n );\n },\n Promise.resolve(Buffer.alloc(0)),\n );\n return response.subarray(0, 64);\n }\n}\n","import type Transport from '@ledgerhq/hw-transport';\nimport AccountLedger, { CLA, GET_ADDRESS, GET_APP_CONFIGURATION } from './Ledger';\nimport { UnsupportedVersionError } from '../utils/errors';\nimport { Encoded } from '../utils/encoder';\nimport semverSatisfies from '../utils/semver-satisfies';\nimport Node from '../Node';\n\n/**\n * A factory class that generates instances of AccountLedger based on provided transport.\n */\nexport default class AccountLedgerFactory {\n readonly transport: Transport;\n\n private readonly versionCheckPromise: Promise<void>;\n\n /**\n * @param transport - Connection to Ledger to use\n */\n constructor(transport: Transport) {\n this.transport = transport;\n this.versionCheckPromise = this.getAppConfiguration().then(({ version }) => {\n const args = [version, '0.4.4', '0.5.0'] as const;\n if (!semverSatisfies(...args)) throw new UnsupportedVersionError('app on ledger', ...args);\n });\n const scrambleKey = 'w0w';\n transport.decorateAppAPIMethods(this, ['getAddress', 'getAppConfiguration'], scrambleKey);\n }\n\n /**\n * @returns the version of app installed on Ledger wallet\n */\n async getAppConfiguration(): Promise<{ version: string }> {\n await this.versionCheckPromise;\n const response = await this.transport.send(CLA, GET_APP_CONFIGURATION, 0x00, 0x00);\n return {\n version: [response[1], response[2], response[3]].join('.'),\n };\n }\n\n /**\n * Get `ak_`-prefixed address for a given account index.\n * @param accountIndex - Index of account\n * @param verify - Ask user to confirm address by showing it on the device screen\n */\n async getAddress(accountIndex: number, verify = false): Promise<Encoded.AccountAddress> {\n await this.versionCheckPromise;\n const buffer = Buffer.alloc(4);\n buffer.writeUInt32BE(accountIndex, 0);\n const response = await this.transport.send(\n CLA,\n GET_ADDRESS,\n verify ? 0x01 : 0x00,\n 0x00,\n buffer,\n );\n const addressLength = response[0];\n return response.subarray(1, 1 + addressLength).toString('ascii') as Encoded.AccountAddress;\n }\n\n /**\n * Get an instance of AccountLedger for a given account index.\n * @param accountIndex - Index of account\n */\n async initialize(accountIndex: number): Promise<AccountLedger> {\n await this.versionCheckPromise;\n return new AccountLedger(this.transport, accountIndex, await this.getAddress(accountIndex));\n }\n\n /**\n * Discovers accounts on Ledger that already have been used (has any on-chain transactions).\n * It returns an empty array if none of accounts been used.\n * If a used account is preceded by an unused account then it would be ignored.\n * @param node - Instance of Node to get account information from\n */\n async discover(node: Node): Promise<AccountLedger[]> {\n let index = 0;\n const result = [];\n let account;\n do {\n if (account != null) result.push(account);\n account = await this.initialize(index);\n index += 1;\n } while (await node.getAccountByPubkey(account.address).then(() => true, () => false));\n return result;\n }\n}\n","import * as coreClient from \"@azure/core-client\";\n\nexport const Contract: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Contract\",\n modelProperties: {\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n }\n }\n }\n};\n\nexport const CompileOpts: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompileOpts\",\n modelProperties: {\n fileSystem: {\n serializedName: \"file_system\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n },\n srcFile: {\n serializedName: \"src_file\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Aci: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Aci\",\n modelProperties: {\n encodedAci: {\n serializedName: \"encoded_aci\",\n required: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n },\n externalEncodedAci: {\n serializedName: \"external_encoded_aci\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n },\n interface: {\n serializedName: \"interface\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CompilerError: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompilerError\",\n modelProperties: {\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pos: {\n serializedName: \"pos\",\n type: {\n name: \"Composite\",\n className: \"ErrorPos\"\n }\n },\n message: {\n serializedName: \"message\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n context: {\n serializedName: \"context\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ErrorPos: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorPos\",\n modelProperties: {\n file: {\n serializedName: \"file\",\n type: {\n name: \"String\"\n }\n },\n line: {\n serializedName: \"line\",\n required: true,\n type: {\n name: \"Number\"\n }\n },\n col: {\n serializedName: \"col\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n }\n }\n};\n\nexport const ByteCode: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ByteCode\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SophiaCallResultInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SophiaCallResultInput\",\n modelProperties: {\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callResult: {\n serializedName: \"call-result\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callValue: {\n serializedName: \"call-value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const BytecodeCallResultInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"BytecodeCallResultInput\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callResult: {\n serializedName: \"call-result\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callValue: {\n serializedName: \"call-value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodedCallresult: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodedCallresult\",\n modelProperties: {\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n result: {\n serializedName: \"result\",\n required: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n};\n\nexport const FunctionCallInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"FunctionCallInput\",\n modelProperties: {\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n arguments: {\n serializedName: \"arguments\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Calldata: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Calldata\",\n modelProperties: {\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodeCalldataBytecode: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodeCalldataBytecode\",\n modelProperties: {\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodedCalldata: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodedCalldata\",\n modelProperties: {\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n arguments: {\n serializedName: \"arguments\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n }\n }\n};\n\nexport const ErrorModel: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorModel\",\n modelProperties: {\n reason: {\n serializedName: \"reason\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodeCalldataSource: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodeCalldataSource\",\n modelProperties: {\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ByteCodeInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ByteCodeInput\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const FateAssembler: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"FateAssembler\",\n modelProperties: {\n fateAssembler: {\n serializedName: \"fate-assembler\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ValidateByteCodeInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ValidateByteCodeInput\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n }\n }\n }\n};\n\nexport const CompilerVersion: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompilerVersion\",\n modelProperties: {\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ApiVersion: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ApiVersion\",\n modelProperties: {\n apiVersion: {\n serializedName: \"api-version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SophiaBinaryData: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SophiaBinaryData\",\n modelProperties: {\n sophiaType: {\n serializedName: \"sophia-type\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n data: {\n serializedName: \"data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SophiaJsonData: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SophiaJsonData\",\n modelProperties: {\n data: {\n serializedName: \"data\",\n required: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n};\n","import { OperationParameter, OperationURLParameter } from \"@azure/core-client\";\nimport {\n Contract as ContractMapper,\n SophiaCallResultInput as SophiaCallResultInputMapper,\n BytecodeCallResultInput as BytecodeCallResultInputMapper,\n FunctionCallInput as FunctionCallInputMapper,\n DecodeCalldataBytecode as DecodeCalldataBytecodeMapper,\n DecodeCalldataSource as DecodeCalldataSourceMapper,\n ByteCodeInput as ByteCodeInputMapper,\n ValidateByteCodeInput as ValidateByteCodeInputMapper\n} from \"../models/mappers\";\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const body: OperationParameter = {\n parameterPath: \"body\",\n mapper: ContractMapper\n};\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const $host: OperationURLParameter = {\n parameterPath: \"$host\",\n mapper: {\n serializedName: \"$host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const body1: OperationParameter = {\n parameterPath: \"body\",\n mapper: SophiaCallResultInputMapper\n};\n\nexport const body2: OperationParameter = {\n parameterPath: \"body\",\n mapper: BytecodeCallResultInputMapper\n};\n\nexport const body3: OperationParameter = {\n parameterPath: \"body\",\n mapper: FunctionCallInputMapper\n};\n\nexport const body4: OperationParameter = {\n parameterPath: \"body\",\n mapper: DecodeCalldataBytecodeMapper\n};\n\nexport const body5: OperationParameter = {\n parameterPath: \"body\",\n mapper: DecodeCalldataSourceMapper\n};\n\nexport const body6: OperationParameter = {\n parameterPath: \"body\",\n mapper: ByteCodeInputMapper\n};\n\nexport const body7: OperationParameter = {\n parameterPath: \"body\",\n mapper: ValidateByteCodeInputMapper\n};\n","import * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\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 baseUri: options.endpoint ?? options.baseUri ?? \"{$host}\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\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\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: Mappers.Aci\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.ByteCode\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","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport { Compiler as CompilerApi, ErrorModel, CompilerError } from '../apis/compiler';\nimport { genErrorFormatterPolicy, genVersionCheckPolicy } from '../utils/autorest';\n\ntype GeneralCompilerError = ErrorModel & {\n info?: object;\n parameter?: string;\n};\n\n/**\n * Contract Compiler over HTTP\n *\n * This class include api call's related to contract compiler functionality.\n * @category contract\n * @example CompilerHttp('COMPILER_URL')\n */\nexport default class CompilerHttp extends CompilerApi {\n /**\n * @param compilerUrl - Url for compiler API\n * @param options - Options\n * @param options.ignoreVersion - Don't check compiler version\n */\n constructor(compilerUrl: string, { ignoreVersion }: { ignoreVersion?: boolean } = {}) {\n super(compilerUrl, {\n allowInsecureConnection: true,\n additionalPolicies: [\n genErrorFormatterPolicy((body: GeneralCompilerError | CompilerError[]) => {\n let message = '';\n if ('reason' in body) {\n message += ` ${body.reason\n }${body.parameter != null ? ` in ${body.parameter}` : ''\n // TODO: revising after improving documentation https://github.com/aeternity/aesophia_http/issues/78\n }${body.info != null ? ` (${JSON.stringify(body.info)})` : ''}`;\n }\n if (Array.isArray(body)) {\n message += `\\n${body\n .map((e) => `${e.type}:${e.pos.line}:${e.pos.col}: ${e.message}${e.context != null ? `(${e.context})` : ''}`)\n .map((e) => e.trim()) // TODO: remove after fixing https://github.com/aeternity/aesophia_http/issues/80\n .join('\\n')}`;\n }\n return message;\n }),\n ],\n });\n if (ignoreVersion !== true) {\n const versionPromise = this.apiVersion().then(({ apiVersion }) => apiVersion);\n this.pipeline.addPolicy(\n genVersionCheckPolicy('compiler', '/api-version', versionPromise, '7.0.1', '8.0.0'),\n );\n }\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Convert string from snake_case to PascalCase\n * @param s - String to convert\n * @returns Converted string\n */\nexport function snakeToPascal(s: string): string {\n return s.replace(/_./g, (match) => match[1].toUpperCase());\n}\n\n/**\n * Convert string from PascalCase to snake_case\n * @param s - String to convert\n * @returns Converted string\n */\nexport function pascalToSnake(s: string): string {\n return s.replace(/[A-Z]/g, (match) => `_${match.toLowerCase()}`);\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport { w3cwebsocket as W3CWebSocket } from 'websocket';\nimport BigNumber from 'bignumber.js';\nimport type Channel from './Base';\nimport JsonBig from '../utils/json-big';\nimport { pascalToSnake } from '../utils/string';\nimport { Encoded } from '../utils/encoder';\nimport {\n BaseError,\n ChannelCallError,\n ChannelPingTimedOutError,\n UnexpectedTsError,\n UnknownChannelStateError,\n ChannelIncomingMessageError,\n ChannelError,\n} from '../utils/errors';\n\nexport interface ChannelAction {\n guard: (channel: Channel, state?: ChannelFsm) => boolean;\n action: (channel: Channel, state?: ChannelFsm) => ChannelFsm;\n}\n\ninterface SignOptions {\n updates?: any[];\n [k: string]: any;\n}\nexport type SignTxWithTag = (tag: string, tx: Encoded.Transaction, options?: SignOptions) => (\n Promise<Encoded.Transaction>\n);\n// TODO: SignTx shouldn't return number or null\nexport type SignTx = (tx: Encoded.Transaction, options?: SignOptions) => (\n Promise<Encoded.Transaction | number | null>\n);\n\nexport interface ChannelOptions {\n existingFsmId?: Encoded.Bytearray;\n url: string;\n\n /**\n * @see {@link https://github.com/aeternity/protocol/blob/6734de2e4c7cce7e5e626caa8305fb535785131d/node/api/channels_api_usage.md#channel-establishing-parameters}\n */\n initiatorId: Encoded.AccountAddress;\n responderId: Encoded.AccountAddress;\n lockPeriod: number;\n pushAmount: number;\n initiatorAmount: BigNumber;\n responderAmount: BigNumber;\n channelReserve?: BigNumber | number;\n ttl?: number;\n host: string;\n port: number;\n role: 'initiator' | 'responder';\n minimumDepthStrategy?: 'txfee' | 'plain';\n minimumDepth?: number;\n fee?: BigNumber | number;\n gasPrice?: BigNumber | number;\n\n signedTx?: string;\n existingChannelId?: string;\n offChainTx?: string;\n reconnectTx?: string;\n timeoutIdle?: number;\n timeoutFundingCreate?: number;\n timeoutFundingSign?: number;\n timeoutFundingLock?: number;\n timeoutSign?: number;\n timeoutAccept?: number;\n timeoutInitialized?: number;\n timeoutAwaitingOpen?: number;\n statePassword?: string;\n debug: boolean;\n sign: SignTxWithTag;\n offchainTx?: string;\n}\n\nexport interface ChannelHandler extends Function {\n enter?: Function;\n}\n\nexport interface ChannelState {\n signedTx: Encoded.Transaction;\n resolve: (r?: any) => void;\n reject: (e: BaseError) => void;\n sign: SignTx;\n handler?: ChannelHandler;\n onOnChainTx?: (tx: Encoded.Transaction) => void;\n onOwnWithdrawLocked?: () => void;\n onWithdrawLocked?: () => void;\n onOwnDepositLocked?: () => void;\n onDepositLocked?: () => void;\n closeTx?: string;\n}\n\nexport interface ChannelFsm {\n handler: ChannelHandler;\n state?: ChannelState | {\n resolve: Function;\n reject: Function;\n };\n}\n\nexport interface ChannelMessage {\n id?: number;\n method: string;\n params: any;\n payload?: any;\n data?: any;\n error?: ChannelMessageError;\n}\n\ninterface ChannelMessageError {\n code: number;\n message: string;\n data: [{\n message: string;\n code: number;\n }];\n request: ChannelMessage;\n}\n\n// Send ping message every 10 seconds\nconst PING_TIMEOUT_MS = 10000;\n// Close connection if pong message is not received within 15 seconds\nconst PONG_TIMEOUT_MS = 15000;\n\nexport function emit(channel: Channel, ...args: any[]): void {\n const [eventName, ...rest] = args;\n channel._eventEmitter.emit(eventName, ...rest);\n}\n\nfunction enterState(channel: Channel, nextState: ChannelFsm): void {\n if (nextState == null) {\n throw new UnknownChannelStateError();\n }\n channel._fsm = nextState;\n if (nextState?.handler?.enter != null) {\n nextState.handler.enter(channel);\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n void dequeueAction(channel);\n}\n\n// TODO: rewrite to enum\nexport type ChannelStatus = 'connecting' | 'connected' | 'accepted' | 'halfSigned' | 'signed'\n| 'open' | 'closing' | 'closed' | 'died' | 'disconnected';\n\nexport function changeStatus(channel: Channel, newStatus: ChannelStatus): void {\n if (newStatus === channel._status) return;\n channel._status = newStatus;\n emit(channel, 'statusChanged', newStatus);\n}\n\nexport function changeState(channel: Channel, newState: Encoded.Transaction): void {\n channel._state = newState;\n emit(channel, 'stateChanged', newState);\n}\n\nfunction send(channel: Channel, message: ChannelMessage): void {\n if (channel._options.debug) console.log('Send message: ', message);\n channel._websocket.send(JsonBig.stringify({ jsonrpc: '2.0', ...message }));\n}\n\nexport function notify(channel: Channel, method: string, params: object = {}): void {\n send(channel, { method, params });\n}\n\nasync function dequeueAction(channel: Channel): Promise<void> {\n if (channel._isActionQueueLocked) return;\n const queue = channel._actionQueue;\n if (queue.length === 0) return;\n const index = queue.findIndex((action) => action.guard(channel, channel._fsm));\n if (index === -1) return;\n channel._actionQueue = queue.filter((_, i) => index !== i);\n channel._isActionQueueLocked = true;\n const nextState: ChannelFsm = await queue[index].action(channel, channel._fsm);\n channel._isActionQueueLocked = false;\n enterState(channel, nextState);\n}\n\nexport async function enqueueAction(\n channel: Channel,\n guard: ChannelAction['guard'],\n action: () => { handler: ChannelHandler; state?: Partial<ChannelState> },\n): Promise<any> {\n const promise = new Promise((resolve, reject) => {\n channel._actionQueue.push({\n guard,\n action() {\n const res = action();\n return { ...res, state: { ...res.state, resolve, reject } };\n },\n });\n });\n void dequeueAction(channel);\n return promise;\n}\n\nasync function handleMessage(channel: Channel, message: object): Promise<void> {\n const { handler, state: st } = channel._fsm;\n enterState(channel, await Promise.resolve(handler(channel, message, st)));\n}\n\nasync function dequeueMessage(channel: Channel): Promise<void> {\n if (channel._isMessageQueueLocked) return;\n channel._isMessageQueueLocked = true;\n while (channel._messageQueue.length > 0) {\n const message = channel._messageQueue.shift();\n if (message == null) throw new UnexpectedTsError();\n try {\n await handleMessage(channel, message);\n } catch (error) {\n emit(channel, 'error', new ChannelIncomingMessageError(error, message));\n }\n }\n channel._isMessageQueueLocked = false;\n}\n\nexport function disconnect(channel: Channel): void {\n channel._websocket.close();\n clearTimeout(channel._pingTimeoutId);\n}\n\nfunction ping(channel: Channel): void {\n clearTimeout(channel._pingTimeoutId);\n channel._pingTimeoutId = setTimeout(() => {\n notify(channel, 'channels.system', { action: 'ping' });\n channel._pingTimeoutId = setTimeout(() => {\n disconnect(channel);\n emit(channel, 'error', new ChannelPingTimedOutError());\n }, PONG_TIMEOUT_MS);\n }, PING_TIMEOUT_MS);\n}\n\nfunction onMessage(channel: Channel, data: string): void {\n const message = JsonBig.parse(data);\n if (channel._options.debug) console.log('Receive message: ', message);\n if (message.id != null) {\n const callback = channel._rpcCallbacks.get(message.id);\n if (callback == null) {\n emit(channel, 'error', new ChannelError(`Can't find callback by id: ${message.id}`));\n return;\n }\n try {\n callback(message);\n } finally {\n channel._rpcCallbacks.delete(message.id);\n }\n return;\n }\n if (message.method === 'channels.message') {\n emit(channel, 'message', message.params.data.message);\n return;\n }\n if (message.method === 'channels.system.pong') {\n if (message.params.channel_id === channel._channelId || channel._channelId == null) {\n ping(channel);\n }\n return;\n }\n channel._messageQueue.push(message);\n void dequeueMessage(channel);\n}\n\nexport async function call(channel: Channel, method: string, params: any): Promise<any> {\n return new Promise((resolve, reject) => {\n const id = channel._nextRpcMessageId;\n channel._nextRpcMessageId += 1;\n channel._rpcCallbacks.set(id, (\n message: { result: PromiseLike<any>; error?: ChannelMessageError },\n ) => {\n if (message.error != null) {\n const details = message.error.data[0].message ?? '';\n reject(new ChannelCallError(message.error.message + details));\n } else resolve(message.result);\n });\n send(channel, { method, id, params });\n });\n}\n\nexport async function initialize(\n channel: Channel,\n connectionHandler: Function,\n openHandler: Function,\n { url, ...channelOptions }: ChannelOptions,\n): Promise<void> {\n channel._options = { url, ...channelOptions };\n channel._fsm = { handler: connectionHandler };\n\n const wsUrl = new URL(url);\n Object.entries(channelOptions)\n .filter(([key]) => !['sign', 'debug'].includes(key))\n .forEach(([key, value]) => wsUrl.searchParams.set(pascalToSnake(key), value.toString()));\n wsUrl.searchParams.set('protocol', 'json-rpc');\n changeStatus(channel, 'connecting');\n channel._websocket = new W3CWebSocket(wsUrl.toString());\n await new Promise<void>((resolve, reject) => {\n Object.assign(channel._websocket, {\n onerror: reject,\n onopen: async () => {\n resolve();\n changeStatus(channel, 'connected');\n if (channelOptions.reconnectTx != null) {\n enterState(channel, { handler: openHandler });\n const signedTx = (await call(channel, 'channels.get.offchain_state', {})).signed_tx;\n changeState(channel, signedTx);\n }\n ping(channel);\n },\n onclose: () => {\n changeStatus(channel, 'disconnected');\n clearTimeout(channel._pingTimeoutId);\n },\n onmessage: ({ data }: { data: string }) => onMessage(channel, data),\n });\n });\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n/* eslint-disable consistent-return */\n/* eslint-disable default-case */\n/* eslint-disable @typescript-eslint/no-use-before-define */\nimport {\n ChannelState,\n changeStatus,\n changeState,\n call,\n notify,\n emit,\n disconnect,\n ChannelMessage,\n ChannelFsm,\n SignTx,\n ChannelStatus,\n} from './internal';\nimport { unpackTx, buildTx } from '../tx/builder';\nimport { encode, Encoded, Encoding } from '../utils/encoder';\nimport {\n IllegalArgumentError,\n InsufficientBalanceError,\n ChannelConnectionError,\n UnexpectedChannelMessageError,\n ChannelError,\n} from '../utils/errors';\nimport type Channel from './Base';\nimport { Tag } from '../tx/builder/constants';\n\nexport async function appendSignature(\n tx: Encoded.Transaction,\n signFn: SignTx,\n): Promise<Encoded.Transaction | number | null> {\n const { signatures, encodedTx } = unpackTx(tx, Tag.SignedTx).tx;\n const result = await signFn(encode(encodedTx.rlpEncoded, Encoding.Transaction));\n if (typeof result === 'string') {\n const { tx: signedTx } = unpackTx(result, Tag.SignedTx);\n return buildTx({\n signatures: signatures.concat(signedTx.signatures),\n encodedTx: signedTx.encodedTx.rlpEncoded,\n }, Tag.SignedTx).tx;\n }\n return result;\n}\n\nexport async function signAndNotify(\n channel: Channel,\n method: string,\n data: {\n tx?: Encoded.Transaction;\n signed_tx?: Encoded.Transaction;\n },\n signFn: SignTx,\n): Promise<boolean> {\n let signedTx;\n if (data.tx != null) signedTx = await signFn(data.tx);\n else if (data.signed_tx != null) signedTx = await appendSignature(data.signed_tx, signFn);\n else throw new ChannelError('Can\\'t find transaction in message');\n const isError = typeof signedTx !== 'string';\n const key = data.tx != null ? 'tx' : 'signed_tx';\n notify(channel, method, isError ? { error: signedTx ?? 1 } : { [key]: signedTx });\n return isError;\n}\n\nexport function handleUnexpectedMessage(\n _channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n state?.reject?.(Object.assign(\n new UnexpectedChannelMessageError(`Unexpected message received:\\n\\n${JSON.stringify(message)}`),\n { wsMessage: message },\n ));\n return { handler: channelOpen };\n}\n\nexport function awaitingCompletion(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n onSuccess?: typeof handleUnexpectedMessage,\n): ChannelFsm {\n if (onSuccess != null && message.method === 'channels.update') {\n return onSuccess(channel, message, state);\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n if (message.error != null) {\n const codes = message.error.data.map((d) => d.code);\n if (codes.includes(1001)) {\n state.reject(new InsufficientBalanceError('Insufficient balance'));\n } else if (codes.includes(1002)) {\n state.reject(new IllegalArgumentError('Amount cannot be negative'));\n } else {\n state.reject(new ChannelConnectionError(message.error.message));\n }\n return { handler: channelOpen };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingConnection(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n if (message.method === 'channels.info') {\n const channelInfoStatus: string = message.params.data.event;\n\n let nextStatus: ChannelStatus | null = null;\n if (channelInfoStatus === 'channel_accept') nextStatus = 'accepted';\n if (channelInfoStatus === 'funding_created') nextStatus = 'halfSigned';\n if (nextStatus != null) {\n changeStatus(channel, nextStatus);\n return { handler: awaitingChannelCreateTx };\n }\n\n if (message.params.data.event === 'channel_reestablished') {\n return { handler: awaitingOpenConfirmation };\n }\n if (message.params.data.event === 'fsm_up') {\n channel._fsmId = message.params.data.fsm_id;\n return { handler: awaitingConnection };\n }\n return { handler: awaitingConnection };\n }\n if (message.method === 'channels.error') {\n emit(channel, 'error', new ChannelConnectionError(message?.payload?.message));\n return { handler: channelClosed };\n }\n}\n\nexport async function awaitingReconnection(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm> {\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'fsm_up') {\n channel._fsmId = message.params.data.fsm_id;\n changeState(channel, (await call(channel, 'channels.get.offchain_state', {})).signed_tx);\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingChannelCreateTx(\n channel: Channel,\n message: ChannelMessage,\n): Promise<ChannelFsm | undefined> {\n const tag = channel._options.role === 'initiator' ? 'initiator_sign' : 'responder_sign';\n if (message.method === `channels.sign.${tag}`) {\n await signAndNotify(\n channel,\n `channels.${tag}`,\n message.params.data,\n async (tx) => channel._options.sign(tag, tx),\n );\n return { handler: awaitingOnChainTx };\n }\n}\n\nexport function awaitingOnChainTx(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n function awaitingBlockInclusion(_: Channel, message2: ChannelMessage): ChannelFsm | undefined {\n if (message2.method === 'channels.info') {\n switch (message2.params.data.event) {\n case 'funding_created':\n case 'own_funding_locked':\n return { handler: awaitingBlockInclusion };\n case 'funding_locked':\n return { handler: awaitingOpenConfirmation };\n }\n }\n if (message2.method === 'channels.on_chain_tx') {\n emit(channel, 'onChainTx', message2.params.data.tx, {\n info: message2.params.data.info,\n type: message2.params.data.type,\n });\n return { handler: awaitingBlockInclusion };\n }\n }\n\n if (message.method === 'channels.on_chain_tx') {\n const { info } = message.params.data;\n const { role } = channel._options;\n if ((info === 'funding_signed' && role === 'initiator')\n || (info === 'funding_created' && role === 'responder')) {\n return { handler: awaitingBlockInclusion };\n }\n }\n if (\n message.method === 'channels.info'\n && message.params.data.event === 'funding_signed'\n && channel._options.role === 'initiator'\n ) {\n channel._channelId = message.params.channel_id;\n changeStatus(channel, 'signed');\n return { handler: awaitingOnChainTx };\n }\n}\n\nfunction awaitingOpenConfirmation(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n if (message.method === 'channels.info' && message.params.data.event === 'open') {\n channel._channelId = message.params.channel_id;\n return {\n handler(_: Channel, message2: ChannelMessage): ChannelFsm | undefined {\n if (message2.method === 'channels.update') {\n changeState(channel, message2.params.data.state);\n return { handler: channelOpen };\n }\n },\n };\n }\n}\n\nexport async function channelOpen(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n switch (message.method) {\n case 'channels.info':\n switch (message.params.data.event) {\n case 'update':\n case 'withdraw_created':\n case 'deposit_created':\n return { handler: awaitingTxSignRequest };\n case 'own_withdraw_locked':\n case 'withdraw_locked':\n case 'own_deposit_locked':\n case 'deposit_locked':\n case 'peer_disconnected':\n case 'channel_reestablished':\n case 'open':\n // TODO: Better handling of peer_disconnected event.\n //\n // We should enter intermediate state where offchain transactions\n // are blocked until channel is reestablished.\n emit(channel, message.params.data.event);\n return { handler: channelOpen };\n case 'fsm_up':\n channel._fsmId = message.params.data.fsm_id;\n return { handler: channelOpen };\n case 'timeout':\n case 'close_mutual':\n return { handler: channelOpen };\n case 'closing':\n changeStatus(channel, 'closing');\n return { handler: channelOpen };\n case 'closed_confirmed':\n changeStatus(channel, 'closed');\n return { handler: channelClosed };\n case 'died':\n changeStatus(channel, 'died');\n return { handler: channelClosed };\n case 'shutdown':\n return { handler: channelOpen };\n }\n break;\n case 'channels.on_chain_tx':\n emit(channel, 'onChainTx', message.params.data.tx, {\n info: message.params.data.info,\n type: message.params.data.type,\n });\n return { handler: channelOpen };\n case 'channels.leave':\n // TODO: emit event\n return { handler: channelOpen };\n case 'channels.update':\n changeState(channel, message.params.data.state);\n return { handler: channelOpen };\n case 'channels.sign.shutdown_sign_ack':\n return awaitingTxSignRequest(channel, message, state);\n }\n}\nchannelOpen.enter = (channel: Channel) => {\n changeStatus(channel, 'open');\n};\n\nasync function awaitingTxSignRequest(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm> {\n const [, tag] = message.method.match(/^channels\\.sign\\.([^.]+)$/) ?? [];\n if (tag == null) return handleUnexpectedMessage(channel, message, state);\n const isError = await signAndNotify(\n channel,\n `channels.${tag}`,\n message.params.data,\n async (tx) => channel._options.sign(tag, tx, { updates: message.params.data.updates }),\n );\n\n function awaitingUpdateConflict(_: Channel, message2: ChannelMessage): ChannelFsm {\n if (message2.error != null) {\n return { handler: awaitingUpdateConflict, state };\n }\n if (message2.method === 'channels.conflict') {\n return { handler: channelOpen };\n }\n return handleUnexpectedMessage(channel, message2, state);\n }\n return isError ? { handler: awaitingUpdateConflict, state } : { handler: channelOpen };\n}\n\nexport async function awaitingShutdownTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm> {\n if (message.method !== 'channels.sign.shutdown_sign') {\n return handleUnexpectedMessage(channel, message, state);\n }\n await signAndNotify(\n channel,\n 'channels.shutdown_sign',\n message.params.data,\n async (tx) => state.sign(tx),\n );\n return {\n handler(_: Channel, message2: ChannelMessage): ChannelFsm {\n if (message2.method !== 'channels.on_chain_tx') {\n return handleUnexpectedMessage(channel, message2, state);\n }\n // state.resolve(message.params.data.tx)\n return { handler: channelClosed, state };\n },\n state,\n };\n}\n\nexport function awaitingLeave(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.leave') {\n state.resolve({ channelId: message.params.channel_id, signedTx: message.params.data.state });\n disconnect(channel);\n return { handler: channelClosed };\n }\n if (message.method === 'channels.error') {\n state.reject(new ChannelConnectionError(message.data.message));\n return { handler: channelOpen };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function channelClosed(\n _channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (state == null) return { handler: channelClosed };\n if (message.params.data.event === 'closing') return { handler: channelClosed, state };\n if (message.params.data.info === 'channel_closed') {\n state.closeTx = message.params.data.tx;\n return { handler: channelClosed, state };\n }\n if (message.params.data.event === 'closed_confirmed') {\n state.resolve(state.closeTx);\n return { handler: channelClosed };\n }\n return { handler: channelClosed, state };\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport { EventEmitter } from 'events';\nimport { w3cwebsocket as W3CWebSocket } from 'websocket';\nimport { snakeToPascal } from '../utils/string';\nimport { buildTx, unpackTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\nimport * as handlers from './handlers';\nimport {\n initialize,\n enqueueAction,\n notify,\n call,\n disconnect as channelDisconnect,\n SignTx,\n ChannelOptions,\n ChannelState,\n ChannelHandler,\n ChannelAction,\n ChannelStatus,\n ChannelFsm,\n} from './internal';\nimport { ChannelError } from '../utils/errors';\nimport { Encoded } from '../utils/encoder';\n\nfunction snakeToPascalObjKeys<Type>(obj: object): Type {\n return Object.entries(obj).reduce((result, [key, val]) => ({\n ...result,\n [snakeToPascal(key)]: val,\n }), {}) as Type;\n}\n\ntype EventCallback = (...args: any[]) => void;\n\n/**\n * Channel\n * @example\n * ```js\n * await Channel.initialize({\n * url: 'ws://localhost:3001',\n * role: 'initiator'\n * initiatorId: 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * responderId: 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E',\n * initiatorAmount: 1e18,\n * responderAmount: 1e18,\n * pushAmount: 0,\n * channelReserve: 0,\n * ttl: 1000,\n * host: 'localhost',\n * port: 3002,\n * lockPeriod: 10,\n * async sign (tag, tx) => await account.signTransaction(tx)\n * })\n * ```\n */\nexport default class Channel {\n _eventEmitter = new EventEmitter();\n\n _pingTimeoutId: NodeJS.Timeout;\n\n _nextRpcMessageId = 0;\n\n _rpcCallbacks = new Map<number, (message: object) => void>();\n\n _fsmId?: Encoded.Bytearray;\n\n _messageQueue: object[] = [];\n\n _isMessageQueueLocked = false;\n\n _actionQueue: ChannelAction[] = [];\n\n _isActionQueueLocked = false;\n\n _status: ChannelStatus = 'disconnected';\n\n _fsm: ChannelFsm;\n\n _websocket: W3CWebSocket;\n\n _state?: Encoded.Transaction;\n\n _options: ChannelOptions;\n\n _channelId?: Encoded.Channel;\n\n /**\n * @param options - Channel params\n * @param options.url - Channel url (for example: \"ws://localhost:3001\")\n * @param options.role - Participant role (\"initiator\" or \"responder\")\n * @param options.initiatorId - Initiator's public key\n * @param options.responderId - Responder's public key\n * @param options.pushAmount - Initial deposit in favour of the responder by the initiator\n * @param options.initiatorAmount - Amount of coins the initiator has committed to\n * the channel\n * @param options.responderAmount - Amount of coins the responder has committed to\n * the channel\n * @param options.channelReserve - The minimum amount both peers need to maintain\n * @param options.ttl - Minimum block height to include the channel_create_tx\n * @param options.host - Host of the responder's node\n * @param options.port - The port of the responders node\n * @param options.lockPeriod - Amount of blocks for disputing a solo close\n * @param options.minimumDepthStrategy - How to calculate minimum depth (default: txfee)\n * @param options.minimumDepth - The minimum amount of blocks to be mined\n * @param options.fee - The fee to be used for the channel open transaction\n * @param options.gasPrice - Used for the fee computation of the channel open transaction\n * @param options.existingChannelId - Existing channel id (required if reestablishing a\n * channel)\n * @param options.offchainTx - Offchain transaction (required if reestablishing\n * a channel)\n * @param options.timeoutIdle - The time waiting for a new event to be initiated\n * (default: 600000)\n * @param options.timeoutFundingCreate - The time waiting for the initiator to produce\n * the create channel transaction after the noise session had been established (default: 120000)\n * @param options.timeoutFundingSign - The time frame the other client has to sign an\n * off-chain update after our client had initiated and signed it. This applies only for double\n * signed on-chain intended updates: channel create transaction, deposit, withdrawal and etc.\n * (default: 120000)\n * @param options.timeoutFundingLock - The time frame the other client has to confirm an\n * on-chain transaction reaching maturity (passing minimum depth) after the local node has\n * detected this. This applies only for double signed on-chain intended updates: channel create\n * transaction, deposit, withdrawal and etc. (default: 360000)\n * @param options.timeoutSign - The time frame the client has to return a signed\n * off-chain update or to decline it. This applies for all off-chain updates (default: 500000)\n * @param options.timeoutAccept - The time frame the other client has to react to an\n * event. This applies for all off-chain updates that are not meant to land on-chain, as well as\n * some special cases: opening a noise connection, mutual closing acknowledgement and\n * reestablishing an existing channel (default: 120000)\n * @param options.timeoutInitialized - the time frame the responder has to accept an\n * incoming noise session. Applicable only for initiator (default: timeout_accept's value)\n * @param options.timeoutAwaitingOpen - The time frame the initiator has to start an\n * outgoing noise session to the responder's node. Applicable only for responder (default:\n * timeout_idle's value)\n * @param options.debug=false - Log websocket communication\n * @param options.sign - Function which verifies and signs transactions\n */\n static async initialize(options: ChannelOptions): Promise<Channel> {\n return Channel._initialize(new Channel(), options);\n }\n\n static async _initialize<T extends Channel>(channel: T, options: ChannelOptions): Promise<T> {\n await initialize(\n channel,\n options.existingFsmId != null ? handlers.awaitingReconnection : handlers.awaitingConnection,\n handlers.channelOpen,\n options,\n );\n return channel;\n }\n\n /**\n * Register event listener function\n *\n * Possible events:\n *\n * - \"error\"\n * - \"onChainTx\"\n * - \"ownWithdrawLocked\"\n * - \"withdrawLocked\"\n * - \"ownDepositLocked\"\n * - \"depositLocked\"\n *\n * TODO: the event list looks outdated\n *\n * @param eventName - Event name\n * @param callback - Callback function\n */\n // TODO define specific callback type depending on the event name\n on(eventName: string, callback: EventCallback): void {\n this._eventEmitter.on(eventName, callback);\n }\n\n /**\n * Remove event listener function\n * @param eventName - Event name\n * @param callback - Callback function\n */\n off(eventName: string, callback: EventCallback): void {\n this._eventEmitter.removeListener(eventName, callback);\n }\n\n /**\n * Close the connection\n */\n disconnect(): void {\n return channelDisconnect(this);\n }\n\n /**\n * Get current status\n */\n status(): ChannelStatus {\n return this._status;\n }\n\n /**\n * Get current state\n */\n async state(): Promise<ChannelState> {\n return snakeToPascalObjKeys(await call(this, 'channels.get.offchain_state', {}));\n }\n\n /**\n * Get current round\n *\n * If round cannot be determined (for example when channel has not been opened)\n * it will return `null`.\n */\n round(): number | null {\n if (this._state == null) {\n return null;\n }\n const { txType, tx } = unpackTx(this._state, Tag.SignedTx).tx.encodedTx;\n switch (txType) {\n case Tag.ChannelCreateTx:\n return 1;\n case Tag.ChannelOffChainTx:\n case Tag.ChannelWithdrawTx:\n case Tag.ChannelDepositTx:\n return tx.round;\n default:\n return null;\n }\n }\n\n /**\n * Get channel id\n *\n */\n id(): Encoded.Channel {\n if (this._channelId == null) throw new ChannelError('Channel is not initialized');\n return this._channelId;\n }\n\n /**\n * Get channel's fsm id\n *\n */\n fsmId(): Encoded.Bytearray {\n if (this._fsmId == null) throw new ChannelError('Channel is not initialized');\n return this._fsmId;\n }\n\n protected async enqueueAction(\n action: () => { handler: ChannelHandler; state?: Partial<ChannelState> },\n ): Promise<any> {\n return enqueueAction(\n this,\n (channel, state) => state?.handler === handlers.channelOpen,\n action,\n );\n }\n\n /**\n * Leave channel\n *\n * It is possible to leave a channel and then later reestablish the channel\n * off-chain state and continue operation. When a leave method is called,\n * the channel fsm passes it on to the peer fsm, reports the current mutually\n * signed state and then terminates.\n *\n * The channel can be reestablished by instantiating another Channel instance\n * with two extra params: existingChannelId and offchainTx (returned from leave\n * method as channelId and signedTx respectively).\n *\n * @example\n * ```js\n * channel.leave().then(({ channelId, signedTx }) => {\n * console.log(channelId)\n * console.log(signedTx)\n * })\n * ```\n */\n async leave(): Promise<{ channelId: Encoded.Bytearray; signedTx: Encoded.Transaction }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.leave');\n return { handler: handlers.awaitingLeave };\n });\n }\n\n /**\n * Trigger mutual close\n *\n * At any moment after the channel is opened, a closing procedure can be triggered.\n * This can be done by either of the parties. The process is similar to the off-chain updates.\n *\n * @param sign - Function which verifies and signs mutual close transaction\n * @example\n * ```js\n * channel.shutdown(\n * async (tx) => await account.signTransaction(tx)\n * ).then(tx => console.log('on_chain_tx', tx))\n * ```\n */\n async shutdown(sign: SignTx): Promise<Encoded.Transaction> {\n return this.enqueueAction(() => {\n notify(this, 'channels.shutdown');\n return {\n handler: handlers.awaitingShutdownTx,\n state: { sign },\n };\n });\n }\n\n static async reconnect(options: ChannelOptions, txParams: any): Promise<Channel> {\n const { sign } = options;\n\n return Channel.initialize({\n ...options,\n reconnectTx: await sign('reconnect', buildTx(txParams, Tag.ChannelClientReconnectTx).tx),\n });\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport {\n notify, call, SignTx, ChannelState, ChannelMessage, ChannelFsm, changeState,\n} from './internal';\nimport { Encoded } from '../utils/encoder';\nimport { pause } from '../utils/other';\nimport Channel from './Base';\nimport { ChannelConnectionError } from '../utils/errors';\nimport {\n awaitingCompletion, channelOpen, handleUnexpectedMessage, signAndNotify,\n} from './handlers';\n\nexport default class ChannelSpend extends Channel {\n /**\n * Trigger a transfer update\n *\n * The transfer update is moving coins from one channel account to another.\n * The update is a change to be applied on top of the latest state.\n *\n * Sender and receiver are the channel parties. Both the initiator and responder\n * can take those roles. Any public key outside the channel is considered invalid.\n *\n * @param from - Sender's public address\n * @param to - Receiver's public address\n * @param amount - Transaction amount\n * @param sign - Function which verifies and signs offchain transaction\n * @param metadata - Metadata\n\n * @example\n * ```js\n * channel.update(\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E',\n * 10,\n * async (tx) => await account.signTransaction(tx)\n * ).then(({ accepted, signedTx }) =>\n * if (accepted) {\n * console.log('Update has been accepted')\n * }\n * )\n * ```\n */\n async update(\n from: Encoded.AccountAddress,\n to: Encoded.AccountAddress,\n amount: number | BigNumber,\n sign: SignTx,\n metadata: string[] = [],\n ): Promise<{\n accepted: boolean;\n signedTx?: Encoded.Transaction;\n errorCode?: number;\n errorMessage?: string;\n }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.update.new', {\n from, to, amount, meta: metadata,\n });\n\n const awaitingOffChainTx = async (\n _: Channel,\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> => {\n if (message.method === 'channels.sign.update') {\n const isError = await signAndNotify(\n this,\n 'channels.update',\n message.params.data,\n async (tx) => sign(tx, { updates: message.params.data.updates }),\n );\n if (isError) return { handler: awaitingOffChainTx, state };\n return {\n handler: (_2: Channel, message2: ChannelMessage): ChannelFsm => (\n awaitingCompletion(this, message2, state, () => {\n changeState(this, message2.params.data.state);\n state.resolve({ accepted: true, signedTx: message2.params.data.state });\n return { handler: channelOpen };\n })\n ),\n state,\n };\n }\n if (message.method === 'channels.error') {\n state.reject(new ChannelConnectionError(message.data.message));\n return { handler: channelOpen };\n }\n return awaitingCompletion(this, message, state);\n };\n\n return { handler: awaitingOffChainTx };\n });\n }\n\n /**\n * Get proof of inclusion\n *\n * If a certain address of an account or a contract is not found\n * in the state tree - the response is an error.\n *\n * @param addresses - Addresses\n * @param addresses.accounts - List of account addresses to include in poi\n * @param addresses.contracts - List of contract addresses to include in poi\n * @example\n * ```js\n * channel.poi({\n * accounts: [\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E'\n * ],\n * contracts: ['ct_2dCUAWYZdrWfACz3a2faJeKVTVrfDYxCQHCqAt5zM15f3u2UfA']\n * }).then(poi => console.log(poi))\n * ```\n */\n async poi(\n { accounts, contracts }: {\n accounts: Encoded.AccountAddress[];\n contracts?: Encoded.ContractAddress[];\n },\n ): Promise<Encoded.Poi> {\n return (await call(this, 'channels.get.poi', { accounts, contracts })).poi;\n }\n\n /**\n * Get balances\n *\n * The accounts param contains a list of addresses to fetch balances of.\n * Those can be either account balances or a contract ones, encoded as an account addresses.\n *\n * If a certain account address had not being found in the state tree - it is simply\n * skipped in the response.\n *\n * @param accounts - List of addresses to fetch balances from\n * @example\n * ```js\n * channel.balances([\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E'\n * 'ct_2dCUAWYZdrWfACz3a2faJeKVTVrfDYxCQHCqAt5zM15f3u2UfA'\n * ]).then(balances =>\n * console.log(balances['ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH'])\n * )\n * ```\n */\n async balances(\n accounts: Encoded.AccountAddress[],\n ): Promise<{ [key: Encoded.AccountAddress]: string }> {\n return Object.fromEntries(\n (await call(this, 'channels.get.balances', { accounts }))\n .map((item: {\n account: Encoded.AccountAddress;\n balance: string;\n }) => [item.account, item.balance]),\n );\n }\n\n private async awaitingActionTx(\n action: 'deposit' | 'withdraw',\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> {\n if (message.method !== `channels.sign.${action}_tx`) {\n return handleUnexpectedMessage(this, message, state);\n }\n\n const awaitingActionCompletion = (_: Channel, message2: ChannelMessage): ChannelFsm => {\n if (message2.method === 'channels.on_chain_tx') {\n state.onOnChainTx?.(message2.params.data.tx);\n return { handler: awaitingActionCompletion, state };\n }\n if (\n message2.method === 'channels.info'\n && [`own_${action}_locked`, `${action}_locked`].includes(message2.params.data.event)\n ) {\n const Action = action === 'deposit' ? 'Deposit' : 'Withdraw';\n const isOwn: boolean = message2.params.data.event.startsWith('own_');\n state[`on${isOwn ? 'Own' : ''}${Action}Locked`]?.();\n return { handler: awaitingActionCompletion, state };\n }\n return awaitingCompletion(this, message2, state, () => {\n changeState(this, message2.params.data.state);\n state.resolve({ accepted: true, signedTx: message2.params.data.state });\n return { handler: channelOpen };\n });\n };\n\n const { sign } = state;\n await signAndNotify(\n this,\n `channels.${action}_tx`,\n message.params.data,\n async (tx) => sign(tx, { updates: message.params.data.updates }),\n );\n return { handler: awaitingActionCompletion, state };\n }\n\n /**\n * Withdraw coins from the channel\n *\n * After the channel had been opened any of the participants can initiate a withdrawal.\n * The process closely resembles the update. The most notable difference is that the\n * transaction has been co-signed: it is channel_withdraw_tx and after the procedure\n * is finished - it is being posted on-chain.\n *\n * Any of the participants can initiate a withdrawal. The only requirements are:\n *\n * - Channel is already opened\n * - No off-chain update/deposit/withdrawal is currently being performed\n * - Channel is not being closed or in a solo closing state\n * - The withdrawal amount must be equal to or greater than zero, and cannot exceed\n * the available balance on the channel (minus the channel_reserve)\n *\n * After the other party had signed the withdraw transaction, the transaction is posted\n * on-chain and onOnChainTx callback is called with on-chain transaction as first argument.\n * After computing transaction hash it can be tracked on the chain: entering the mempool,\n * block inclusion and a number of confirmations.\n *\n * After the minimum_depth block confirmations onOwnWithdrawLocked callback is called\n * (without any arguments).\n *\n * When the other party had confirmed that the block height needed is reached\n * onWithdrawLocked callback is called (without any arguments).\n *\n * @param amount - Amount of coins to withdraw\n * @param sign - Function which verifies and signs withdraw transaction\n * @param callbacks - Callbacks\n * @param callbacks.onOnChainTx - Called when withdraw transaction has been posted\n * on chain\n * @param callbacks.onOwnWithdrawLocked\n * @param callbacks.onWithdrawLocked\n * @example\n * ```js\n * channel.withdraw(\n * 100,\n * async (tx) => await account.signTransaction(tx),\n * { onOnChainTx: (tx) => console.log('on_chain_tx', tx) }\n * ).then(({ accepted, signedTx }) => {\n * if (accepted) {\n * console.log('Withdrawal has been accepted')\n * } else {\n * console.log('Withdrawal has been rejected')\n * }\n * })\n * ```\n */\n async withdraw(\n amount: number | BigNumber,\n sign: SignTx,\n { onOnChainTx, onOwnWithdrawLocked, onWithdrawLocked }:\n Pick<ChannelState, 'onOnChainTx' | 'onOwnWithdrawLocked' | 'onWithdrawLocked'> = {},\n ): Promise<{ accepted: boolean; signedTx: Encoded.Transaction }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.withdraw', { amount });\n return {\n handler: async (\n _: Channel,\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> => (\n this.awaitingActionTx('withdraw', message, state)\n ),\n state: {\n sign,\n onOnChainTx,\n onOwnWithdrawLocked,\n onWithdrawLocked,\n },\n };\n });\n }\n\n /**\n * Deposit coins into the channel\n *\n * After the channel had been opened any of the participants can initiate a deposit.\n * The process closely resembles the update. The most notable difference is that the\n * transaction has been co-signed: it is channel_deposit_tx and after the procedure\n * is finished - it is being posted on-chain.\n *\n * Any of the participants can initiate a deposit. The only requirements are:\n *\n * - Channel is already opened\n * - No off-chain update/deposit/withdrawal is currently being performed\n * - Channel is not being closed or in a solo closing state\n * - The deposit amount must be equal to or greater than zero, and cannot exceed\n * the available balance on the channel (minus the channel_reserve)\n *\n * After the other party had signed the deposit transaction, the transaction is posted\n * on-chain and onOnChainTx callback is called with on-chain transaction as first argument.\n * After computing transaction hash it can be tracked on the chain: entering the mempool,\n * block inclusion and a number of confirmations.\n *\n * After the minimum_depth block confirmations onOwnDepositLocked callback is called\n * (without any arguments).\n *\n * When the other party had confirmed that the block height needed is reached\n * onDepositLocked callback is called (without any arguments).\n *\n * @param amount - Amount of coins to deposit\n * @param sign - Function which verifies and signs deposit transaction\n * @param callbacks - Callbacks\n * @param callbacks.onOnChainTx - Called when deposit transaction has been posted\n * on chain\n * @param callbacks.onOwnDepositLocked\n * @param callbacks.onDepositLocked\n * @example\n * ```js\n * channel.deposit(\n * 100,\n * async (tx) => await account.signTransaction(tx),\n * { onOnChainTx: (tx) => console.log('on_chain_tx', tx) }\n * ).then(({ accepted, state }) => {\n * if (accepted) {\n * console.log('Deposit has been accepted')\n * console.log('The new state is:', state)\n * } else {\n * console.log('Deposit has been rejected')\n * }\n * })\n * ```\n */\n async deposit(\n amount: number | BigNumber,\n sign: SignTx,\n { onOnChainTx, onOwnDepositLocked, onDepositLocked }:\n Pick<ChannelState, 'onOnChainTx' | 'onOwnDepositLocked' | 'onDepositLocked'> = {},\n ): Promise<{ accepted: boolean; state: ChannelState }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.deposit', { amount });\n return {\n handler: async (\n _: Channel,\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> => (\n this.awaitingActionTx('deposit', message, state)\n ),\n state: {\n sign,\n onOnChainTx,\n onOwnDepositLocked,\n onDepositLocked,\n },\n };\n });\n }\n\n /**\n * Send generic message\n *\n * If message is an object it will be serialized into JSON string\n * before sending.\n *\n * If there is ongoing update that has not yet been finished the message\n * will be sent after that update is finalized.\n *\n * @param message - Message\n * @param recipient - Address of the recipient\n * @example\n * ```js\n * channel.sendMessage(\n * 'hello world',\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH'\n * )\n * ```\n */\n async sendMessage(\n message: string | object,\n recipient: Encoded.AccountAddress,\n ): Promise<void> {\n const info = typeof message === 'object' ? JSON.stringify(message) : message;\n if (this.status() === 'connecting') {\n await new Promise<void>((resolve) => {\n const onStatusChanged = (status: string): void => {\n if (status === 'connecting') return;\n resolve();\n this.off('statusChanged', onStatusChanged);\n };\n this.on('statusChanged', onStatusChanged);\n });\n // For some reason we can't immediately send a message when connection is\n // established. Thus we wait 500ms which seems to work.\n await pause(500);\n }\n notify(this, 'channels.message', { info, to: recipient });\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport { snakeToPascal } from '../utils/string';\nimport { MIN_GAS_PRICE, Tag } from '../tx/builder/constants';\nimport {\n signAndNotify,\n awaitingCompletion,\n channelClosed,\n channelOpen,\n handleUnexpectedMessage,\n} from './handlers';\nimport {\n notify, call, SignTx, ChannelState, ChannelOptions, ChannelMessage, ChannelFsm, changeState, emit,\n} from './internal';\nimport { Encoded } from '../utils/encoder';\nimport { ContractCallReturnType } from '../apis/node';\nimport { ContractCallObject } from '../contract/Contract';\nimport Channel from './Base';\nimport ChannelSpend from './Spend';\nimport { UnexpectedChannelMessageError } from '../utils/errors';\nimport { unpackTx } from '../tx/builder';\nimport { encodeContractAddress } from '../utils/crypto';\n\nfunction snakeToPascalObjKeys<Type>(obj: object): Type {\n return Object.entries(obj).reduce((result, [key, val]) => ({\n ...result,\n [snakeToPascal(key)]: val,\n }), {}) as Type;\n}\n\ninterface CallContractOptions {\n amount?: number | BigNumber;\n callData?: Encoded.ContractBytearray;\n abiVersion?: number;\n contract?: Encoded.ContractAddress;\n returnValue?: any;\n gasUsed?: number | BigNumber;\n gasPrice?: number | BigNumber;\n height?: number;\n callerNonce?: number;\n log?: any;\n returnType?: ContractCallReturnType;\n}\n\ninterface Contract {\n abiVersion: number;\n active: boolean;\n deposit: number | BigNumber;\n id: string;\n ownerId: string;\n referrerIds: string[];\n vmVersion: number;\n}\n\nexport default class ChannelContract extends ChannelSpend {\n static override async initialize(options: ChannelOptions): Promise<ChannelContract> {\n return Channel._initialize(new ChannelContract(), options);\n }\n\n /**\n * Trigger create contract update\n *\n * The create contract update is creating a contract inside the channel's internal state tree.\n * The update is a change to be applied on top of the latest state.\n *\n * That would create a contract with the poster being the owner of it. Poster commits initially\n * a deposit amount of coins to the new contract.\n *\n * @param options - Options\n * @param options.code - Api encoded compiled AEVM byte code\n * @param options.callData - Api encoded compiled AEVM call data for the code\n * @param options.deposit - Initial amount the owner of the contract commits to it\n * @param options.vmVersion - Version of the Virtual Machine\n * @param options.abiVersion - Version of the Application Binary Interface\n * @param sign - Function which verifies and signs create contract transaction\n * @example\n * ```js\n * channel.createContract({\n * code: 'cb_HKtpipK4aCgYb17wZ...',\n * callData: 'cb_1111111111111111...',\n * deposit: 10,\n * vmVersion: 3,\n * abiVersion: 1\n * }).then(({ accepted, signedTx, address }) => {\n * if (accepted) {\n * console.log('New contract has been created')\n * console.log('Contract address:', address)\n * } else {\n * console.log('New contract has been rejected')\n * }\n * })\n * ```\n */\n async createContract(\n {\n code, callData, deposit, vmVersion, abiVersion,\n }: {\n code: Encoded.ContractBytearray;\n callData: Encoded.ContractBytearray;\n deposit: number | BigNumber;\n vmVersion: number;\n abiVersion: number;\n },\n sign: SignTx,\n ): Promise<{\n accepted: boolean; signedTx: Encoded.Transaction; address: Encoded.ContractAddress;\n }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.update.new_contract', {\n code,\n call_data: callData,\n deposit,\n vm_version: vmVersion,\n abi_version: abiVersion,\n });\n return {\n handler: async (\n _: Channel,\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> => {\n if (message.method !== 'channels.sign.update') {\n return handleUnexpectedMessage(this, message, state);\n }\n await signAndNotify(\n this,\n 'channels.update',\n message.params.data,\n async (tx) => state.sign(tx),\n );\n return {\n handler: (\n _2: Channel,\n message2: ChannelMessage,\n state2: ChannelState,\n ): ChannelFsm => (\n awaitingCompletion(this, message2, state2, () => {\n const { round } = unpackTx(message2.params.data.state, Tag.SignedTx)\n .tx.encodedTx.tx;\n const addressKey = this._options.role === 'initiator'\n ? 'initiatorId' : 'responderId';\n const owner = this._options[addressKey];\n changeState(this, message2.params.data.state);\n state2.resolve({\n accepted: true,\n address: encodeContractAddress(owner, round),\n signedTx: message2.params.data.state,\n });\n return { handler: channelOpen };\n })\n ),\n state,\n };\n },\n state: { sign },\n };\n });\n }\n\n /**\n * Trigger call a contract update\n *\n * The call contract update is calling a preexisting contract inside the channel's\n * internal state tree. The update is a change to be applied on top of the latest state.\n *\n * That would call a contract with the poster being the caller of it. Poster commits\n * an amount of coins to the contract.\n *\n * The call would also create a call object inside the channel state tree. It contains\n * the result of the contract call.\n *\n * It is worth mentioning that the gas is not consumed, because this is an off-chain\n * contract call. It would be consumed if it were an on-chain one. This could happen\n * if a call with a similar computation amount is to be forced on-chain.\n *\n * @param options - Options\n * @param options.amount - Amount the caller of the contract commits to it\n * @param options.callData - ABI encoded compiled AEVM call data for the code\n * @param options.contract - Address of the contract to call\n * @param options.abiVersion - Version of the ABI\n * @param sign - Function which verifies and signs contract call transaction\n * @example\n * ```js\n * channel.callContract({\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * callData: 'cb_1111111111111111...',\n * amount: 0,\n * abiVersion: 1\n * }).then(({ accepted, signedTx }) => {\n * if (accepted) {\n * console.log('Contract called succesfully')\n * } else {\n * console.log('Contract call has been rejected')\n * }\n * })\n * ```\n */\n async callContract(\n {\n amount, callData, contract, abiVersion,\n }: CallContractOptions,\n sign: SignTx,\n ): Promise<{ accepted: boolean; signedTx: Encoded.Transaction }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.update.call_contract', {\n amount,\n call_data: callData,\n contract_id: contract,\n abi_version: abiVersion,\n });\n return {\n handler: async (\n _: Channel,\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> => {\n if (message.method !== 'channels.sign.update') {\n return handleUnexpectedMessage(this, message, state);\n }\n await signAndNotify(\n this,\n 'channels.update',\n message.params.data,\n async (tx) => state.sign(tx, { updates: message.params.data.updates }),\n );\n return {\n handler: (\n _2: Channel,\n message2: ChannelMessage,\n state2: ChannelState,\n ): ChannelFsm => (\n awaitingCompletion(this, message2, state2, () => {\n changeState(this, message2.params.data.state);\n state2.resolve({ accepted: true, signedTx: message2.params.data.state });\n return { handler: channelOpen };\n })\n ),\n state,\n };\n },\n state: { sign },\n };\n });\n }\n\n /**\n * Trigger a force progress contract call\n * This call is going on-chain\n * @param options - Options\n * @param options.amount - Amount the caller of the contract commits to it\n * @param options.callData - ABI encoded compiled AEVM call data for the code\n * @param options.contract - Address of the contract to call\n * @param options.abiVersion - Version of the ABI\n * @param options.gasPrice=1000000000]\n * @param options.gasLimit=1000000]\n * @param sign - Function which verifies and signs contract force progress transaction\n * @param callbacks - Callbacks\n * @example\n * ```js\n * channel.forceProgress({\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * callData: 'cb_1111111111111111...',\n * amount: 0,\n * abiVersion: 1,\n * gasPrice: 1000005554\n * }).then(({ accepted, signedTx }) => {\n * if (accepted) {\n * console.log('Contract force progress call successful')\n * } else {\n * console.log('Contract force progress call has been rejected')\n * }\n * })\n * ```\n */\n async forceProgress(\n {\n amount, callData, contract, abiVersion, gasLimit = 1000000, gasPrice = MIN_GAS_PRICE,\n }: {\n amount: number;\n callData: Encoded.ContractBytearray;\n contract: Encoded.ContractAddress;\n abiVersion: number;\n gasLimit?: number;\n gasPrice?: number;\n },\n sign: SignTx,\n { onOnChainTx }: Pick<ChannelState, 'onOnChainTx'> = {},\n ): Promise<{\n accepted: boolean;\n signedTx: Encoded.Transaction;\n tx: Encoded.Transaction | Uint8Array;\n }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.force_progress', {\n amount,\n call_data: callData,\n contract_id: contract,\n abi_version: abiVersion,\n gas_price: gasPrice,\n gas: gasLimit,\n });\n return {\n handler: async (\n _: Channel,\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> => {\n if (message.method !== 'channels.sign.force_progress_tx') {\n return handleUnexpectedMessage(this, message, state);\n }\n await signAndNotify(\n this,\n 'channels.force_progress_sign',\n message.params.data,\n async (tx) => state.sign(tx, { updates: message.params.data.updates }),\n );\n return {\n handler: (\n _2: Channel,\n message2: ChannelMessage,\n state2: ChannelState,\n ): ChannelFsm => {\n if (message2.method === 'channels.on_chain_tx') {\n state2.onOnChainTx?.(message2.params.data.tx);\n emit(this, 'onChainTx', message2.params.data.tx, {\n info: message2.params.data.info,\n type: message2.params.data.type,\n });\n state2.resolve({ accepted: true, tx: message2.params.data.tx });\n // TODO: shouldn't be unexpected message in this case\n }\n return handleUnexpectedMessage(this, message2, state2);\n },\n state,\n };\n },\n state: { sign, onOnChainTx },\n };\n });\n }\n\n /**\n * Call contract using dry-run\n *\n * In order to get the result of a potential contract call, one might need to\n * dry-run a contract call. It takes the exact same arguments as a call would\n * and returns the call object.\n *\n * The call is executed in the channel's state, but it does not impact the state\n * whatsoever. It uses as an environment the latest channel's state and the current\n * top of the blockchain as seen by the node.\n *\n * @param options - Options\n * @param options.amount - Amount the caller of the contract commits to it\n * @param options.callData - ABI encoded compiled AEVM call data for the code\n * @param options.contract - Address of the contract to call\n * @param options.abiVersion - Version of the ABI\n * @example\n * ```js\n * channel.callContractStatic({\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * callData: 'cb_1111111111111111...',\n * amount: 0,\n * abiVersion: 1\n * }).then(({ returnValue, gasUsed }) => {\n * console.log('Returned value:', returnValue)\n * console.log('Gas used:', gasUsed)\n * })\n * ```\n */\n async callContractStatic(\n {\n amount, callData, contract, abiVersion,\n }: {\n amount: number;\n callData: Encoded.ContractBytearray;\n contract: Encoded.ContractAddress;\n abiVersion: number;\n },\n ): Promise<CallContractOptions> {\n return snakeToPascalObjKeys(await call(this, 'channels.dry_run.call_contract', {\n amount,\n call_data: callData,\n contract_id: contract,\n abi_version: abiVersion,\n }));\n }\n\n /**\n * Get contract call result\n *\n * The combination of a caller, contract and a round of execution determines the\n * contract call. Providing an incorrect set of those results in an error response.\n *\n * @param options - Options\n * @param options.caller - Address of contract caller\n * @param options.contract - Address of the contract\n * @param options.round - Round when contract was called\n * @example\n * ```js\n * channel.getContractCall({\n * caller: 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * round: 3\n * }).then(({ returnType, returnValue }) => {\n * if (returnType === 'ok') console.log(returnValue)\n * })\n * ```\n */\n async getContractCall(\n { caller, contract, round }: {\n caller: Encoded.AccountAddress;\n contract: Encoded.ContractAddress;\n round: number;\n },\n ): Promise<ContractCallObject> {\n return snakeToPascalObjKeys(\n await call(this, 'channels.get.contract_call', {\n caller_id: caller,\n contract_id: contract,\n round,\n }),\n );\n }\n\n /**\n * Get the latest contract state\n *\n * @param contract - Address of the contract\n * @example\n * ```js\n * channel.getContractState(\n * 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa'\n * ).then(({ contract }) => {\n * console.log('deposit:', contract.deposit)\n * })\n * ```\n */\n async getContractState(\n contract: Encoded.ContractAddress,\n ): Promise<{ contract: Contract; contractState: object }> {\n const result = await call(this, 'channels.get.contract', { pubkey: contract });\n return snakeToPascalObjKeys({\n ...result,\n contract: snakeToPascalObjKeys(result.contract),\n });\n }\n\n /**\n * Clean up all locally stored contract calls\n *\n * Contract calls are kept locally in order for the participant to be able to look them up.\n * They consume memory and in order for the participant to free it - one can prune all messages.\n * This cleans up all locally stored contract calls and those will no longer be available for\n * fetching and inspection.\n */\n async cleanContractCalls(): Promise<void> {\n return this.enqueueAction(() => {\n notify(this, 'channels.clean_contract_calls');\n return {\n handler(_: Channel, message: ChannelMessage, state: ChannelState): ChannelFsm {\n if (message.method === 'channels.calls_pruned.reply') {\n state.resolve();\n return { handler: channelOpen };\n }\n state.reject(new UnexpectedChannelMessageError('Unexpected message received'));\n return { handler: channelClosed };\n },\n };\n });\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport BrowserConnection from './connection/Browser';\n\n/**\n * Browser connection proxy\n * Provide functionality to easily forward messages from one connection to another and back\n * @category aepp wallet communication\n * @param con1 - first connection\n * @param con2 - second connection\n * @returns a function to stop proxying\n */\nexport default (con1: BrowserConnection, con2: BrowserConnection): () => void => {\n con1.connect((msg: any) => con2.sendMessage(msg), () => con2.disconnect());\n con2.connect((msg: any) => con1.sendMessage(msg), () => con1.disconnect());\n\n return () => {\n con1.disconnect();\n con2.disconnect();\n };\n};\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport { AlreadyConnectedError, NoWalletConnectedError } from '../../utils/errors';\n\n/**\n * Browser connection base interface\n * @category aepp wallet communication\n */\nexport default abstract class BrowserConnection {\n debug: boolean;\n\n protected constructor({ debug = false }: { debug?: boolean }) {\n this.debug = debug;\n }\n\n /**\n * Connect\n * @param onMessage - Message handler\n * @param onDisconnect - trigger when runtime connection in closed\n */\n connect(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onMessage: (message: any, origin: string, source: any) => void,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDisconnect: () => void,\n ): void {\n if (this.isConnected()) throw new AlreadyConnectedError('You already connected');\n }\n\n /**\n * Disconnect\n */\n disconnect(): void {\n if (!this.isConnected()) throw new NoWalletConnectedError('You dont have connection. Please connect before');\n }\n\n /**\n * Receive message\n */\n protected receiveMessage(message: any): void {\n if (this.debug) console.log('Receive message:', message);\n }\n\n /**\n * Send message\n */\n sendMessage(message: any): void {\n if (this.debug) console.log('Send message:', message);\n }\n\n /**\n * Check if connected\n * @returns Is connected\n */\n abstract isConnected(): boolean;\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport BrowserConnection from './Browser';\nimport { MESSAGE_DIRECTION } from '../schema';\nimport { InternalError, RpcConnectionError } from '../../utils/errors';\n\nexport type ImplPostMessage = Pick<Window, 'addEventListener' | 'removeEventListener' | 'postMessage'>;\n\n/**\n * Browser window Post Message connector module\n * @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","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport BrowserConnection from './connection/Browser';\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 if (Object.keys(wallets).length > 0) onDetected({ wallets });\n\n return () => connection.disconnect();\n};\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport { Runtime } from 'webextension-polyfill';\nimport BrowserConnection from './Browser';\n\n/**\n * BrowserRuntimeConnection\n * Handle browser runtime communication\n * @category aepp wallet communication\n */\nexport default class BrowserRuntimeConnection extends BrowserConnection {\n port: Runtime.Port;\n\n constructor({ port, ...options }: { port: Runtime.Port; debug: boolean }) {\n super(options);\n this.port = port;\n }\n\n override disconnect(): void {\n super.disconnect();\n this.port.disconnect();\n }\n\n override connect(\n onMessage: (message: any, origin: string, source: Runtime.Port) => void,\n onDisconnect: () => void,\n ): void {\n super.connect(onMessage, onDisconnect);\n this.port.onMessage.addListener((message, port) => {\n this.receiveMessage(message);\n // TODO: make `origin` optional because sender url is not available on aepp side\n onMessage(message, port.sender?.url ?? '', port);\n });\n this.port.onDisconnect.addListener(onDisconnect);\n }\n\n override sendMessage(message: any): void {\n super.sendMessage(message);\n this.port.postMessage(message);\n }\n\n isConnected(): boolean {\n return this.port.onMessage.hasListeners();\n }\n}\n"],"names":["root","factory","exports","module","require","define","amd","self","__WEBPACK_EXTERNAL_MODULE__5039__","__WEBPACK_EXTERNAL_MODULE__9408__","__WEBPACK_EXTERNAL_MODULE__5192__","__WEBPACK_EXTERNAL_MODULE__4711__","__WEBPACK_EXTERNAL_MODULE__3485__","__WEBPACK_EXTERNAL_MODULE__3783__","__WEBPACK_EXTERNAL_MODULE__79__","__WEBPACK_EXTERNAL_MODULE__7480__","__WEBPACK_EXTERNAL_MODULE__3983__","__WEBPACK_EXTERNAL_MODULE__7417__","__WEBPACK_EXTERNAL_MODULE__9882__","__WEBPACK_EXTERNAL_MODULE__1986__","__WEBPACK_EXTERNAL_MODULE__8236__","__WEBPACK_EXTERNAL_MODULE__7946__","__WEBPACK_EXTERNAL_MODULE__2716__","__WEBPACK_EXTERNAL_MODULE__3735__","__WEBPACK_EXTERNAL_MODULE__8079__","util","ADD64AA","v","a","b","o0","o1","ADD64AC","b0","b1","B2B_GET32","arr","i","B2B_G","c","d","ix","iy","x0","m","x1","y0","y1","xor0","xor1","BLAKE2B_IV32","Uint32Array","SIGMA82","Uint8Array","map","x","blake2bCompress","ctx","last","h","t","parameterBlock","blake2bInit","outlen","key","salt","personal","Error","length","fill","set","blake2bUpdate","input","blake2bFinal","out","blake2b","normalizeInput","blake2bHex","output","toHex","uint32ToHex","val","toString","substring","ret","TextEncoder","encode","bytes","Array","prototype","call","n","join","debugPrint","label","size","msg","toUpperCase","console","log","testSpeed","hashFn","N","M","startMs","Date","getTime","genMs","hashHex","hashMs","ms","Math","round","parent","Object","defineProperty","it","desc","sham","isCallable","tryToString","$TypeError","TypeError","argument","isObject","$String","String","uncurryThis","stringSlice","slice","DESCRIPTORS","definePropertyModule","createPropertyDescriptor","object","value","f","bitmap","enumerable","configurable","writable","global","error","fails","get","documentAll","document","all","IS_HTMLDDA","undefined","EXISTS","createElement","getBuiltIn","match","version","userAgent","process","Deno","versions","v8","split","apply","getOwnPropertyDescriptor","isForced","path","bind","createNonEnumerableProperty","hasOwn","wrapConstructor","NativeConstructor","Wrapper","this","arguments","options","source","USE_NATIVE","VIRTUAL_PROTOTYPE","sourceProperty","targetProperty","nativeProperty","resultProperty","descriptor","TARGET","target","GLOBAL","STATIC","stat","PROTO","proto","nativeSource","targetPrototype","forced","dontCallGetSet","wrap","real","exec","NATIVE_BIND","FunctionPrototype","Function","Reflect","aCallable","fn","that","test","hasOwnProperty","classofRaw","uncurryThisWithBind","aFunction","variable","namespace","method","isNullOrUndefined","V","P","func","check","globalThis","window","g","toObject","classof","$Object","propertyIsEnumerable","$documentAll","replacement","feature","detection","data","normalize","POLYFILL","NATIVE","string","replace","toLowerCase","isPrototypeOf","USE_SYMBOL_AS_UID","$Symbol","IE8_DOM_DEFINE","V8_PROTOTYPE_DEFINE_BUG","anObject","toPropertyKey","$defineProperty","$getOwnPropertyDescriptor","O","Attributes","current","propertyIsEnumerableModule","toIndexedObject","$propertyIsEnumerable","NASHORN_BUG","pref","valueOf","defineGlobalProperty","SHARED","store","IS_PURE","push","mode","copyright","license","V8_VERSION","getOwnPropertySymbols","symbol","Symbol","IndexedObject","requireObjectCoercible","isSymbol","getMethod","ordinaryToPrimitive","wellKnownSymbol","TO_PRIMITIVE","result","exoticToPrim","toPrimitive","id","postfix","random","NATIVE_SYMBOL","iterator","shared","uid","WellKnownSymbolsStore","symbolFor","createWellKnownSymbol","withoutSetter","name","description","$","create","ctor","superCtor","super_","constructor","TempCtor","buffer","Buffer","copyProps","src","dst","SafeBuffer","arg","encodingOrOffset","from","alloc","allocUnsafe","allocUnsafeSlow","encoding","buf","SlowBuffer","Hash","blockSize","finalSize","_block","_finalSize","_blockSize","_len","update","enc","block","accum","offset","assigned","remainder","min","_update","digest","rem","bits","writeUInt32BE","lowBits","highBits","hash","_hash","inherits","K","W","Sha256","init","_w","ch","y","z","maj","sigma0","sigma1","gamma0","_a","_b","_c","_d","_e","_f","_g","_h","e","readInt32BE","j","T1","T2","H","writeInt32BE","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","obj","prop","r","toStringTag","ceil","bigNumber","integerValue","BigNumber","BaseError","message","super","AccountError","AensError","AeppError","ChannelError","CompilerError","ContractError","CryptographyError","NodeError","TransactionError","WalletError","ArgumentError","argumentName","requirement","argumentValue","IllegalArgumentError","ArgumentCountMismatchError","functionName","requiredCount","providedCount","InsufficientBalanceError","MissingParamError","NoSerializerFoundError","RequestTimedOutError","height","TxTimedOutError","blocks","th","UnsupportedPlatformError","UnsupportedProtocolError","NotImplementedError","UnsupportedVersionError","dependency","geVersion","ltVersion","InternalError","UnexpectedTsError","UnavailableAccountError","address","AensPointerContextError","nameOrId","prefix","InsufficientNameFeeError","nameFee","minNameFee","InvalidAensNameError","InvalidRpcMessageError","MissingCallbackError","UnAuthorizedAccountError","onAccount","UnknownRpcClientError","UnsubscribedAccountError","ChannelCallError","ChannelConnectionError","ChannelPingTimedOutError","UnexpectedChannelMessageError","ChannelIncomingMessageError","handlerError","incomingMessage","UnknownChannelStateError","InvalidAuthDataError","BytecodeMismatchError","DuplicateContractError","InactiveContractError","contractAddress","InvalidMethodInvocationError","MissingContractAddressError","MissingContractDefError","MissingFunctionNameError","NodeInvocationError","transaction","NoSuchContractFunctionError","NotPayableFunctionError","amount","MissingEventDefinitionError","eventNameHash","eventAddress","AmbiguousEventDefinitionError","matchedEvents","InvalidChecksumError","InvalidPasswordError","MerkleTreeHashMismatchError","MissingNodeInTreeError","UnknownNodeLengthError","nodeLength","UnknownPathNibbleError","nibble","DuplicateNodeError","NodeNotFoundError","DecodeError","PayloadLengthError","DryRunError","IllegalBidFeeError","InvalidSignatureError","InvalidTxParamsError","PrefixNotFoundError","tag","SchemaNotFoundError","schemaName","TagNotFoundError","TxNotInChainError","txHash","UnknownTxError","UnsupportedABIversionError","UnsupportedVMversionError","AlreadyConnectedError","NoWalletConnectedError","RpcConnectionError","AE_AMOUNT_FORMATS","DENOMINATION_MAGNITUDE","AE","MILI_AE","MICRO_AE","NANO_AE","PICO_AE","FEMTO_AE","AETTOS","formatAmount","denomination","targetDenomination","number","includes","isNaN","Number","isInteger","shiftedBy","toFixed","toAe","toAettos","pause","async","Promise","resolve","setTimeout","duration","mapObject","fromEntries","entries","concatBuffers","concat","list","totalLength","el","isKeyOfObject","isAccountNotFoundError","RestError","statusCode","Encoding","sha256hash","base64Types","ContractBytearray","ContractStoreKey","ContractStoreValue","Transaction","OracleQuery","OracleResponse","State","Poi","StateTrees","CallStateTree","Bytearray","base58Types","KeyBlockHash","MicroBlockHash","BlockPofHash","BlockTxHash","BlockStateHash","Channel","ContractAddress","TxHash","OracleAddress","OracleQueryId","AccountAddress","Signature","Commitment","PeerPubkey","Name","byteSizeForType","ensureValidLength","type","reqLen","getChecksum","payload","addChecksum","getPayload","equals","base64","decode","base58","bs58Encode","bs58Decode","parseType","maybeType","base64Type","find","base58Type","encodedPayload","extra","encoder","getAddressFromPriv","secret","secretBuffer","nacl","publicKey","isAddressValid","genSalt","BigUint64Array","BigInt","MAX_SAFE_INTEGER","encodeUnsigned","binary","findIndex","encodeContractAddress","owner","nonce","generateKeyPairFromSecret","generateKeyPair","raw","keyPair","publicBuffer","secretKey","sign","privateKey","verify","signature","messageToHash","p","varuintEncode","signMessage","verifyMessage","isValidKeypair","MAX_AUTH_FUN_GAS","NAME_TTL","NAME_MAX_TTL","NAME_MAX_CLIENT_TTL","CLIENT_TTL","MIN_GAS_PRICE","NAME_FEE_MULTIPLIER","NAME_FEE_BID_INCREMENT","NAME_BID_TIMEOUT_BLOCKS","NAME_MAX_LENGTH_FEE","NAME_BID_MAX_LENGTH","NAME_BID_RANGES","times","Tag","toBytes","big","hexString","buildContractId","ownerId","oracleQueryId","senderId","oracleId","nonceBE","_int32","produceNameId","commitmentHash","padStart","readInt","AENS_SUFFIX","isNameValid","endsWith","encodingToPointerKey","getDefaultPointerKey","identifier","getMinimumNameFee","nameLength","computeBidFee","startFee","increment","plus","computeAuctionEndBlock","claimHeight","isAuctionName","serialize","deserialize","uInt","serializeAettos","idTagToEncoding","genAddressField","hashId","item","idTag","indexOf","readUIntBE","subarray","coinAmount","getOracleRelativeTtl","params","txType","ttlKeys","OracleRegisterTx","OracleExtendTx","OracleQueryTx","OracleResponseTx","buildFee","buildTx","rlpEncoded","txObject","factor","ChannelForceProgressTx","ChannelOffChainTx","ChannelOffChainUpdateCallContract","ChannelOffChainUpdateCreateContract","ChannelOffChainUpdateDeposit","ChannelOffChainUpdateWithdraw","ChannelOffChainUpdateTransfer","ContractCreateTx","ContractCallTx","GaAttachTx","GaMetaTx","PayingForTx","TX_FEE_BASE_GAS","txSize","relativeTtl","innerTxSize","floor","minus","TX_FEE_OTHER_GAS","tx","encodedTx","_value","rebuildTx","_computingMinFee","minFee","previousFee","fee","eq","calculateMinFee","gt","shortUInt","gasMax","_computingGasLimit","gasLimitMax","dividedBy","calculateGasLimitMax","gasLimit","field","txFields","addressName","addressAny","_uInt","_shortUInt","_coinAmount","_address","addresses","deposit","_deposit","enumeration","_fee","_gasLimit","gasPrice","_gasPrice","_name","_nameFee","nameId","_nameId","pointers","pointer","ORACLE_TTL_TYPES","TX_TTL","QUERY_FEE","ORACLE_TTL","delta","QUERY_TTL","RESPONSE_TTL","DRY_RUN_ACCOUNT","pub","VM_VERSIONS","ABI_VERSIONS","CallReturnType","PROTOCOL_VERSIONS","PROTOCOL_VM_ABI","IRIS","vmVersion","FATE_2","abiVersion","FATE","SOPHIA","NO_ABI","FIELD_TYPES","BASE_TX","TX_SCHEMA","Account","SignedTx","signatures","rlpBinary","SpendTx","NamePreclaimTx","NameClaimTx","NameUpdateTx","NameTransferTx","NameRevokeTx","Contract","ctVersion","bool","ContractCall","rawBinary","ChannelCreateTx","ChannelCloseMutualTx","ChannelCloseSoloTx","ChannelSlashTx","ChannelDepositTx","ChannelWithdrawTx","ChannelSettleTx","stateTree","hex","ChannelSnapshotSoloTx","callStack","ChannelClientReconnectTx","TreesPoi","mptrees","Mtree","rlpBinaries","MtreeValue","ContractsMtree","CallsMtree","ChannelsMtree","NameserviceMtree","OraclesMtree","AccountsMtree","CompilerSophia","sophiaCodeTypeInfo","NodeType","MPTree","node","rlpEncode","rootHash","nodes","forEach","nodeHash","parseNode","Branch","filter","Extension","isEqual","tree","Leaf","mptHash","_key","searchFrom","deserializeField","vm","abi","unpackTx","offChainUpdates","reduce","acc","funHash","fnName","argType","outType","serializeField","validateField","Boolean","validateParams","schema","excludeKeys","optionalFields","unpackRawTx","index","fieldType","assign","_params","vsn","schemas","max","keys","VSN","filteredSchema","valid","JSON","stringify","overrideParams","rlpDecode","objId","buildTxHash","rawTx","startsWith","buildContractIdByContractTx","contractTx","_classExtractFieldDescriptor","receiver","privateMap","action","has","_classPrivateFieldGet","_classPrivateFieldSet","semverSatisfies","getComponents","versionComponents","geComponents","ltComponents","base","componentsToNumber","components","reverse","idx","vNumber","geNumber","ltNumber","genRequestQueuesPolicy","requestQueues","Map","policy","request","next","headers","delete","getResponse","req","then","position","genCombineGetRequestsPolicy","pendingGetRequests","url","body","response","genAggressiveCacheGetResponsesPolicy","getRequests","genErrorFormatterPolicy","getMessage","bodyAsText","parse","URL","pathname","genVersionCheckPolicy","ignorePath","versionPromise","args","Header","className","modelProperties","serializedName","required","prevHash","prevKeyHash","stateHash","miner","beneficiary","pow","constraints","MinItems","MaxItems","element","time","info","pofHash","txsHash","ErrorModel","reason","KeyBlock","HashResponse","HeightResponse","MicroBlockHeader","SignedTxs","transactions","blockHeight","blockHash","Tx","uberParent","polymorphicDiscriminator","clientName","recipientId","ttl","initiatorId","initiatorAmount","responderId","responderAmount","channelReserve","lockPeriod","delegateIds","channelId","fromId","toId","offchainTrees","initiatorAmountFinal","responderAmountFinal","poi","initiatorDelegateIds","responderDelegateIds","queryFormat","responseFormat","queryFee","oracleTtl","accountId","query","queryTtl","responseTtl","queryId","commitmentId","nameSalt","nameTtl","clientTtl","code","gas","callData","callerId","contractId","authFun","Pattern","RegExp","gaId","authData","payerId","allowedValues","Delegates","initiator","responder","OffChainUpdate","op","RelativeTTL","defaultValue","isConstant","Ttl","NamePointer","CountResponse","count","Generation","keyBlock","microBlocks","balance","payable","kind","NextNonceResponse","nextNonce","DryRunInput","top","accounts","txs","txEvents","DryRunAccount","pubKey","DryRunInputItem","callReq","DryRunCallReq","calldata","contract","caller","context","DryRunCallContext","stateful","DryRunResults","results","DryRunResult","callObj","ContractCallObject","callerNonce","gasUsed","returnValue","returnType","Event","topics","TxInfoObject","callInfo","gaInfo","txInfo","GAObject","innerObject","EncodedTx","PostTxResponse","ContractObject","active","referrerIds","ByteCode","bytecode","PoI","RegisteredOracle","OracleQueries","oracleQueries","senderNonce","NameEntry","channelAmount","soloRound","lockedUntil","PeerPubKey","pubkey","Status","genesisKeyBlockHash","solutions","difficulty","syncing","syncProgress","InclusiveMaximum","InclusiveMinimum","listening","protocols","nodeVersion","nodeRevision","peerCount","peerConnections","pendingTransactionsCount","networkId","peerPubkey","topKeyBlockHash","topBlockHeight","Protocol","effectiveAtHeight","PeerConnections","inbound","outbound","OracleRespondTx","CommitmentId","NameHash","ChannelSetDelegatesTx","PubKey","PeerDetails","host","port","firstSeen","lastSeen","genesisHash","topHash","topDifficulty","nodeVendor","nodeOs","Peers","peers","blocked","PeerCount","connected","available","PeerCountConnected","PeerCountAvailable","verified","unverified","UnsignedTx","TokenSupply","contracts","contractOracles","locked","oracles","pendingRewards","total","GAAttachTx","GAMetaTx","CheckTxInPoolResponse","status","OffChainTransfer","to","OffChainWithdrawal","OffChainDeposit","OffChainNewContract","OffChainCallContract","CreateContractUnsignedTx","discriminators","accept","parameterPath","mapper","$host","skipEncoding","intAsString","contentType","DryRunInputMapper","body1","EncodedTxMapper","Node","coreClient","packageDetails","userAgentPrefix","userAgentOptions","optionsWithDefaults","requestContentType","baseUri","endpoint","pipeline","getOrderedPolicies","some","pipelinePolicy","coreRestPipeline","removePolicy","addPolicy","scopes","challengeCallbacks","authorizeRequestOnChallenge","getTopHeader","sendOperationRequest","getTopHeaderOperationSpec","getCurrentKeyBlock","getCurrentKeyBlockOperationSpec","getCurrentKeyBlockHash","getCurrentKeyBlockHashOperationSpec","getCurrentKeyBlockHeight","getCurrentKeyBlockHeightOperationSpec","getPendingKeyBlock","getPendingKeyBlockOperationSpec","getKeyBlockByHash","getKeyBlockByHashOperationSpec","getKeyBlockByHeight","getKeyBlockByHeightOperationSpec","getMicroBlockHeaderByHash","getMicroBlockHeaderByHashOperationSpec","getMicroBlockTransactionsByHash","getMicroBlockTransactionsByHashOperationSpec","getMicroBlockTransactionByHashAndIndex","getMicroBlockTransactionByHashAndIndexOperationSpec","getMicroBlockTransactionsCountByHash","getMicroBlockTransactionsCountByHashOperationSpec","getCurrentGeneration","getCurrentGenerationOperationSpec","getGenerationByHash","getGenerationByHashOperationSpec","getGenerationByHeight","getGenerationByHeightOperationSpec","getAccountByPubkey","getAccountByPubkeyOperationSpec","getAccountByPubkeyAndHeight","getAccountByPubkeyAndHeightOperationSpec","getAccountByPubkeyAndHash","getAccountByPubkeyAndHashOperationSpec","getPendingAccountTransactionsByPubkey","getPendingAccountTransactionsByPubkeyOperationSpec","getAccountNextNonce","getAccountNextNonceOperationSpec","protectedDryRunTxs","protectedDryRunTxsOperationSpec","getTransactionByHash","getTransactionByHashOperationSpec","getTransactionInfoByHash","getTransactionInfoByHashOperationSpec","postTransaction","postTransactionOperationSpec","getContract","getContractOperationSpec","getContractCode","getContractCodeOperationSpec","getContractPoI","getContractPoIOperationSpec","getOracleByPubkey","getOracleByPubkeyOperationSpec","getOracleQueriesByPubkey","getOracleQueriesByPubkeyOperationSpec","getOracleQueryByPubkeyAndQueryId","getOracleQueryByPubkeyAndQueryIdOperationSpec","getNameEntryByName","getNameEntryByNameOperationSpec","getChannelByPubkey","getChannelByPubkeyOperationSpec","getPeerPubkey","getPeerPubkeyOperationSpec","getStatus","getStatusOperationSpec","getChainEnds","getChainEndsOperationSpec","serializer","Mappers","httpMethod","responses","bodyMapper","isError","queryParameters","Parameters","urlParameters","headerParameters","requestBody","mediaType","bigIntPropertyNames","numberPropertyNames","NodeTransformed","NodeApi","operationArguments","operationSpec","transform","isArray","k","bigInt","ignoreVersion","allowInsecureConnection","additionalPolicies","statusPromise","nodeNetworkId","consensusProtocolVersion","validators","getSenderAddress","verifyTransaction","nodeNotCached","parentTxTypes","account","catch","getNodeInfo","flat","_getPollInterval","_expectedMineRate","_microBlockCycle","_maxPollInterval","microblock","txWithNetworkId","txHashWithNetworkId","checkedKeys","cost","lte","validNonce","txProtocol","parsedBody","InvalidTxError","validation","getHeight","onNode","poll","interval","awaitHeight","currentHeight","waitForTxConfirm","confirm","newBlockHeight","sendTransaction","waitMined","__queue","requestOptions","customHeaders","pollResult","txData","confirmationHeight","verifyTx","getAccount","getBalance","format","getGeneration","hashOrHeight","getMicroBlockTransactions","getKeyBlock","getMicroBlockHeader","txDryRunRequests","txDryRunHandler","rs","dryRunRes","Set","accountAddress","reject","resultPayload","txDryRun","combine","requests","timeout","getContractByteCode","getName","resolveName","resolveByNode","DERIVED_KEY_FUNCTIONS","pass","memlimit_kib","memoryCost","opslimit","timeCost","hashLength","argon2id","CRYPTO_FUNCTIONS","encrypt","decrypt","res","CRYPTO_DEFAULTS","secret_type","symmetric_alg","kdf","kdf_params","parallelism","plaintext","algo","deriveKey","password","kdfParams","recover","crypto","ciphertext","cipher_params","dump","opt","derivedKey","public_key","uuid","getVmVersion","supportedProtocol","protocolForTX","_buildTx","absoluteTtl","senderKey","extraParams","strategy","prepareTxParams","syncBuildTx","Ecb","aesjs","encryptKey","binaryData","hashedPasswordBytes","decryptKey","encrypted","encryptedBytes","DerivationError","ED25519_CURVE","HARDENED_OFFSET","deriveChild","chainCode","indexBuffer","I","hmac","derivePathFromKey","segments","fromString","toPathArray","segment","parentKey","getMasterKeyFromSeed","seed","derivePathFromSeed","masterKey","formatAccount","getKeyPair","generateSaveHDWalletFromSeed","walletKey","getSaveHDWalletAccounts","saveHDWallet","accountCount","_","getHdWalletAccountFromSeed","accountIdx","send","signed","signTransaction","getNetworkId","innerTx","spend","recipientIdOrName","transferFunds","fraction","desiredAmount","payForTransaction","aensRevoke","aensUpdate","extendPointers","allPointers","aensTransfer","aensQuery","nameEntry","freeze","aensClaim","claimTx","nameInter","aensPreclaim","preclaimTx","opts","aensBid","ContractWithMethods","ids","_options","$options","omitAddress","sourceCode","onCompiler","compileContract","fileSystem","_handleCallError","_calldata","decodeFateString","$call","callStatic","$compile","_estimateGas","other","_sendAndProcess","_getFunctionACI","_aci","encodedAci","functions","fnACI","txOpt","dryRunOther","decodedResult","returns","decodedEvents","$decodeEvents","_getContractNameByEvent","ctAddress","nameHash","contractAddressToName","addressToName","externalEncodedAci","event","variant","events","values","eventName","calcHash","omitUnknown","contractName","decoded","decodeEvent","static","aci","validateBytecode","otherOptions","generateACI","onChanBytecode","validateByteCode","Calldata","aciArgs","pop","$deploy","pollForQueries","onQuery","knownQueryIds","checkNewQueries","queries","add","stopped","pollForQueryResponse","responseBuffer","getQueryObject","record","decodedQuery","decodedResponse","respond","respondToQuery","pollForResponse","postQueryToOracle","oracleQueryTx","queryTtlType","queryTtlValue","responseTtlType","responseTtlValue","extendOracleTtl","oracleExtendTx","oracleTtlType","oracleTtlValue","getOracleObject","oracleRespondTx","pollQueries","postQuery","extendOracle","getQuery","handler","lastArg","registerOracle","oracleRegisterTx","createGeneralizedAccount","authFnName","gaContractId","buildAuthTxHash","_defineProperty","getValueOrErrorProxy","valueCb","Proxy","property","_2","chainMethodsOther","chainMethods","methods","aensMethods","spendMethods","oracleMethods","contractGaMethods","AeSdkMethods","_resolveAccount","_getOptions","AeSdkBase","instance","addNode","compilerApi","api","ensureNodeConnected","pool","selectedNodeName","select","selectNode","isNodeConnected","AeSdk","addAccount","selectedAddress","selectAccount","removeAccount","AccountBase","MESSAGE_DIRECTION","WALLET_TYPE","SUBSCRIPTION_TYPES","METHODS","RPC_STATUS","rpcErrors","RpcError","toJSON","json","RpcErr","cl","RpcInvalidTransactionError","RpcBroadcastError","RpcRejectedByUserError","RpcUnsupportedProtocolError","RpcConnectionDenyError","RpcNotAuthorizeError","RpcPermissionDenyError","RpcInternalError","RpcMethodNotFoundError","AccountRpc","rpcClient","_rpcClient","returnSigned","signedTransaction","RpcClient","connection","onDisconnect","connect","notify","origin","jsonrpc","methodName","sendMessage","callbacks","AeSdkAepp","onAddressChange","onNetworkChange","_ensureConnected","_ensureAccountAccess","_accounts","disconnectParams","connectNode","client","updateAddress","updateNetwork","closeConnection","disconnect","readyToConnect","walletInfo","disconnectWallet","subscribeAddress","jsonBig","JsonBig","storeAsString","convertValuesToBigNumbers","bn","AeSdkWallet","onConnection","onSubscription","onAskAccounts","_type","_pushAccountsToApps","_clients","clientId","_isRpcClientSubscribed","_getClient","rpc","getAccounts","_getNode","_isRpcClientConnected","addressSubscription","CONNECTED","isConnected","_disconnectRpcClient","DISCONNECTED","removeRpcClient","addRpcClient","clientConnection","WAITING_FOR_CONNECTION_REQUEST","icons","getWalletInfo","subscribe","unsubscribe","subscription","parameters","aeppOrigin","aeppRpcClientId","transactionHash","location","secretKeys","WeakMap","AccountMemory","prefixes","rlpBinaryTx","AccountGeneralized","authCallData","gaMetaTx","CLA","AccountLedger","transport","decorateAppAPIMethods","networkIdBuffer","toSend","maxChunkSize","chunkSize","bufferOffset","writeUInt8","copy","previous","messageStr","AccountLedgerFactory","versionCheckPromise","getAppConfiguration","accountIndex","addressLength","getAddress","initialize","CompileOpts","srcFile","Aci","interface","pos","ErrorPos","file","line","col","SophiaCallResultInput","function","callResult","callValue","BytecodeCallResultInput","DecodedCallresult","FunctionCallInput","DecodeCalldataBytecode","DecodedCalldata","DecodeCalldataSource","ByteCodeInput","FateAssembler","fateAssembler","ValidateByteCodeInput","CompilerVersion","ApiVersion","apiVersion","SophiaBinaryData","sophiaType","SophiaJsonData","ContractMapper","SophiaCallResultInputMapper","body2","BytecodeCallResultInputMapper","body3","FunctionCallInputMapper","body4","DecodeCalldataBytecodeMapper","body5","DecodeCalldataSourceMapper","body6","ByteCodeInputMapper","body7","ValidateByteCodeInputMapper","Compiler","generateACIOperationSpec","compileContractOperationSpec","decodeCallResult","decodeCallResultOperationSpec","decodeCallResultBytecode","decodeCallResultBytecodeOperationSpec","encodeCalldata","encodeCalldataOperationSpec","decodeCalldataBytecode","decodeCalldataBytecodeOperationSpec","decodeCalldataSource","decodeCalldataSourceOperationSpec","getFateAssemblerCode","getFateAssemblerCodeOperationSpec","validateByteCodeOperationSpec","getCompilerVersion","getCompilerVersionOperationSpec","versionOperationSpec","apiVersionOperationSpec","apiOperationSpec","CompilerHttp","CompilerApi","compilerUrl","parameter","trim","snakeToPascal","s","emit","channel","rest","_eventEmitter","enterState","nextState","_fsm","enter","dequeueAction","changeStatus","newStatus","_status","changeState","newState","_state","debug","_websocket","_isActionQueueLocked","queue","_actionQueue","guard","handleMessage","state","st","close","clearTimeout","_pingTimeoutId","ping","_nextRpcMessageId","_rpcCallbacks","details","signAndNotify","signFn","signedTx","signed_tx","appendSignature","handleUnexpectedMessage","_channel","wsMessage","channelOpen","awaitingCompletion","onSuccess","accepted","errorCode","error_code","errorMessage","error_msg","codes","awaitingConnection","channelInfoStatus","nextStatus","awaitingChannelCreateTx","awaitingOpenConfirmation","_fsmId","fsm_id","channelClosed","awaitingReconnection","role","awaitingOnChainTx","awaitingBlockInclusion","message2","_channelId","channel_id","awaitingTxSignRequest","updates","awaitingUpdateConflict","awaitingShutdownTx","awaitingLeave","closeTx","EventEmitter","_initialize","connectionHandler","openHandler","channelOptions","wsUrl","searchParams","W3CWebSocket","onerror","onopen","reconnectTx","onclose","onmessage","_messageQueue","_isMessageQueueLocked","shift","dequeueMessage","callback","onMessage","existingFsmId","handlers","on","off","removeListener","channelDisconnect","fsmId","promise","enqueueAction","txParams","ChannelSpend","metadata","meta","awaitingOffChainTx","awaitingActionCompletion","onOnChainTx","Action","isOwn","onOwnWithdrawLocked","onWithdrawLocked","awaitingActionTx","onOwnDepositLocked","onDepositLocked","recipient","onStatusChanged","snakeToPascalObjKeys","ChannelContract","call_data","vm_version","abi_version","state2","addressKey","contract_id","gas_price","caller_id","con1","con2","BrowserConnection","receiveMessage","BrowserWindowMessageConnection","sendDirection","receiveDirection","to_aepp","listener","addEventListener","removeEventListener","postMessage","onDetected","wallets","wallet","getConnection","isExtension","to_waellet","newWallet","BrowserRuntimeConnection","addListener","sender","hasListeners"],"sourceRoot":""}
1
+ {"version":3,"file":"aepp-sdk.browser.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD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AnwB,KAAIg+D,IAAY,IAChDh+D,KAAKspC,KAAK6gB,aAAaiU,YAAYjuC,GAAAnwB,KAAIg+D,IAAY,GACrD,CAESnT,YAAYnxC,GACnBC,MAAMkxC,YAAYnxC,GAClB1Z,KAAKspC,KAAKk0B,YAAY9jD,EACxB,CAEA2zC,cACE,OAA0B,MAAnBl9B,GAAAnwB,KAAIg+D,GACb","sources":["webpack://Aeternity/webpack/universalModuleDefinition","webpack://Aeternity/./node_modules/blakejs/blake2b.js","webpack://Aeternity/./node_modules/blakejs/util.js","webpack://Aeternity/./node_modules/core-js-pure/actual/object/define-property.js","webpack://Aeternity/./node_modules/core-js-pure/actual/symbol/index.js","webpack://Aeternity/./node_modules/core-js-pure/actual/symbol/iterator.js","webpack://Aeternity/./node_modules/core-js-pure/actual/symbol/to-primitive.js","webpack://Aeternity/./node_modules/core-js-pure/es/object/define-property.js","webpack://Aeternity/./node_modules/core-js-pure/es/symbol/index.js","webpack://Aeternity/./node_modules/core-js-pure/es/symbol/iterator.js","webpack://Aeternity/./node_modules/core-js-pure/es/symbol/to-primitive.js","webpack://Aeternity/./node_modules/core-js-pure/features/object/define-property.js","webpack://Aeternity/./node_modules/core-js-pure/features/symbol/index.js","webpack://Aeternity/./node_modules/core-js-pure/features/symbol/iterator.js","webpack://Aeternity/./node_modules/core-js-pure/features/symbol/to-primitive.js","webpack://Aeternity/./node_modules/core-js-pure/full/object/define-property.js","webpack://Aeternity/./node_modules/core-js-pure/full/symbol/index.js","webpack://Aeternity/./node_modules/core-js-pure/full/symbol/iterator.js","webpack://Aeternity/./node_modules/core-js-pure/full/symbol/to-primitive.js","webpack://Aeternity/./node_modules/core-js-pure/internals/a-callable.js","webpack://Aeternity/./node_modules/core-js-pure/internals/a-possible-prototype.js","webpack://Aeternity/./node_modules/core-js-pure/internals/add-to-unscopables.js","webpack://Aeternity/./node_modules/core-js-pure/internals/an-object.js","webpack://Aeternity/./node_modules/core-js-pure/internals/array-includes.js","webpack://Aeternity/./node_modules/core-js-pure/internals/array-iteration.js","webpack://Aeternity/./node_modules/core-js-pure/internals/array-method-has-species-support.js","webpack://Aeternity/./node_modules/core-js-pure/internals/array-slice-simple.js","webpack://Aeternity/./node_modules/core-js-pure/internals/array-slice.js","webpack://Aeternity/./node_modules/core-js-pure/internals/array-species-constructor.js","webpack://Aeternity/./node_modules/core-js-pure/internals/array-species-create.js","webpack://Aeternity/./node_modules/core-js-pure/internals/classof-raw.js","webpack://Aeternity/./node_modules/core-js-pure/internals/classof.js","webpack://Aeternity/./node_modules/core-js-pure/internals/correct-prototype-getter.js","webpack://Aeternity/./node_modules/core-js-pure/internals/create-iter-result-object.js","webpack://Aeternity/./node_modules/core-js-pure/internals/create-non-enumerable-property.js","webpack://Aeternity/./node_modules/core-js-pure/internals/create-property-descriptor.js","webpack://Aeternity/./node_modules/core-js-pure/internals/create-property.js","webpack://Aeternity/./node_modules/core-js-pure/internals/define-built-in-accessor.js","webpack://Aeternity/./node_modules/core-js-pure/internals/define-built-in.js","webpack://Aeternity/./node_modules/core-js-pure/internals/define-global-property.js","webpack://Aeternity/./node_modules/core-js-pure/internals/descriptors.js","webpack://Aeternity/./node_modules/core-js-pure/internals/document-all.js","webpack://Aeternity/./node_modules/core-js-pure/internals/document-create-element.js","webpack://Aeternity/./node_modules/core-js-pure/internals/does-not-exceed-safe-integer.js","webpack://Aeternity/./node_modules/core-js-pure/internals/dom-iterables.js","webpack://Aeternity/./node_modules/core-js-pure/internals/engine-user-agent.js","webpack://Aeternity/./node_modules/core-js-pure/internals/engine-v8-version.js","webpack://Aeternity/./node_modules/core-js-pure/internals/enum-bug-keys.js","webpack://Aeternity/./node_modules/core-js-pure/internals/export.js","webpack://Aeternity/./node_modules/core-js-pure/internals/fails.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-apply.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-bind-context.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-bind-native.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-call.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-name.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-uncurry-this-accessor.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-uncurry-this-clause.js","webpack://Aeternity/./node_modules/core-js-pure/internals/function-uncurry-this.js","webpack://Aeternity/./node_modules/core-js-pure/internals/get-built-in.js","webpack://Aeternity/./node_modules/core-js-pure/internals/get-json-replacer-function.js","webpack://Aeternity/./node_modules/core-js-pure/internals/get-method.js","webpack://Aeternity/./node_modules/core-js-pure/internals/global.js","webpack://Aeternity/./node_modules/core-js-pure/internals/has-own-property.js","webpack://Aeternity/./node_modules/core-js-pure/internals/hidden-keys.js","webpack://Aeternity/./node_modules/core-js-pure/internals/html.js","webpack://Aeternity/./node_modules/core-js-pure/internals/ie8-dom-define.js","webpack://Aeternity/./node_modules/core-js-pure/internals/indexed-object.js","webpack://Aeternity/./node_modules/core-js-pure/internals/inspect-source.js","webpack://Aeternity/./node_modules/core-js-pure/internals/internal-state.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-array.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-callable.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-constructor.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-forced.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-null-or-undefined.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-object.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-pure.js","webpack://Aeternity/./node_modules/core-js-pure/internals/is-symbol.js","webpack://Aeternity/./node_modules/core-js-pure/internals/iterator-create-constructor.js","webpack://Aeternity/./node_modules/core-js-pure/internals/iterator-define.js","webpack://Aeternity/./node_modules/core-js-pure/internals/iterators-core.js","webpack://Aeternity/./node_modules/core-js-pure/internals/iterators.js","webpack://Aeternity/./node_modules/core-js-pure/internals/length-of-array-like.js","webpack://Aeternity/./node_modules/core-js-pure/internals/math-trunc.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-create.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-define-properties.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-define-property.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-get-own-property-names-external.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-get-own-property-names.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-get-own-property-symbols.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-get-prototype-of.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-is-prototype-of.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-keys-internal.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-keys.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-property-is-enumerable.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-set-prototype-of.js","webpack://Aeternity/./node_modules/core-js-pure/internals/object-to-string.js","webpack://Aeternity/./node_modules/core-js-pure/internals/ordinary-to-primitive.js","webpack://Aeternity/./node_modules/core-js-pure/internals/path.js","webpack://Aeternity/./node_modules/core-js-pure/internals/require-object-coercible.js","webpack://Aeternity/./node_modules/core-js-pure/internals/set-to-string-tag.js","webpack://Aeternity/./node_modules/core-js-pure/internals/shared-key.js","webpack://Aeternity/./node_modules/core-js-pure/internals/shared-store.js","webpack://Aeternity/./node_modules/core-js-pure/internals/shared.js","webpack://Aeternity/./node_modules/core-js-pure/internals/string-multibyte.js","webpack://Aeternity/./node_modules/core-js-pure/internals/symbol-constructor-detection.js","webpack://Aeternity/./node_modules/core-js-pure/internals/symbol-define-to-primitive.js","webpack://Aeternity/./node_modules/core-js-pure/internals/symbol-registry-detection.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-absolute-index.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-indexed-object.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-integer-or-infinity.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-length.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-object.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-primitive.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-property-key.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-string-tag-support.js","webpack://Aeternity/./node_modules/core-js-pure/internals/to-string.js","webpack://Aeternity/./node_modules/core-js-pure/internals/try-to-string.js","webpack://Aeternity/./node_modules/core-js-pure/internals/uid.js","webpack://Aeternity/./node_modules/core-js-pure/internals/use-symbol-as-uid.js","webpack://Aeternity/./node_modules/core-js-pure/internals/v8-prototype-define-bug.js","webpack://Aeternity/./node_modules/core-js-pure/internals/weak-map-basic-detection.js","webpack://Aeternity/./node_modules/core-js-pure/internals/well-known-symbol-define.js","webpack://Aeternity/./node_modules/core-js-pure/internals/well-known-symbol-wrapped.js","webpack://Aeternity/./node_modules/core-js-pure/internals/well-known-symbol.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.array.concat.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.array.iterator.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.json.stringify.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.json.to-string-tag.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.object.define-property.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.object.get-own-property-symbols.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.string.iterator.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.async-iterator.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.constructor.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.for.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.has-instance.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.is-concat-spreadable.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.iterator.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.key-for.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.match-all.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.match.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.replace.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.search.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.species.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.split.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.to-primitive.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.to-string-tag.js","webpack://Aeternity/./node_modules/core-js-pure/modules/es.symbol.unscopables.js","webpack://Aeternity/./node_modules/core-js-pure/modules/esnext.symbol.async-dispose.js","webpack://Aeternity/./node_modules/core-js-pure/modules/esnext.symbol.dispose.js","webpack://Aeternity/./node_modules/core-js-pure/modules/esnext.symbol.is-registered.js","webpack://Aeternity/./node_modules/core-js-pure/modules/esnext.symbol.is-well-known.js","webpack://Aeternity/./node_modules/core-js-pure/modules/esnext.symbol.matcher.js","webpack://Aeternity/./node_modules/core-js-pure/modules/esnext.symbol.metadata-key.js","webpack://Aeternity/./node_modules/core-js-pure/modules/esnext.symbol.metadata.js","webpack://Aeternity/./node_modules/core-js-pure/modules/esnext.symbol.observable.js","webpack://Aeternity/./node_modules/core-js-pure/modules/esnext.symbol.pattern-match.js","webpack://Aeternity/./node_modules/core-js-pure/modules/esnext.symbol.replace-all.js","webpack://Aeternity/./node_modules/core-js-pure/modules/web.dom-collections.iterator.js","webpack://Aeternity/./node_modules/core-js-pure/stable/object/define-property.js","webpack://Aeternity/./node_modules/core-js-pure/stable/symbol/index.js","webpack://Aeternity/./node_modules/core-js-pure/stable/symbol/iterator.js","webpack://Aeternity/./node_modules/core-js-pure/stable/symbol/to-primitive.js","webpack://Aeternity/./node_modules/inherits/inherits_browser.js","webpack://Aeternity/./node_modules/safe-buffer/index.js","webpack://Aeternity/./node_modules/sha.js/hash.js","webpack://Aeternity/./node_modules/sha.js/sha256.js","webpack://Aeternity/external umd \"@aeternity/aepp-calldata\"","webpack://Aeternity/external umd \"@aeternity/argon2\"","webpack://Aeternity/external umd \"@aeternity/uuid\"","webpack://Aeternity/external umd \"@azure/core-client\"","webpack://Aeternity/external umd \"@azure/core-rest-pipeline\"","webpack://Aeternity/external umd \"aes-js\"","webpack://Aeternity/external umd \"bignumber.js\"","webpack://Aeternity/external umd \"bip32-path\"","webpack://Aeternity/external umd \"bs58\"","webpack://Aeternity/external umd \"buffer\"","webpack://Aeternity/external umd \"events\"","webpack://Aeternity/external umd \"json-bigint\"","webpack://Aeternity/external umd \"rlp\"","webpack://Aeternity/external umd \"tweetnacl\"","webpack://Aeternity/external umd \"tweetnacl-auth\"","webpack://Aeternity/external umd \"varuint-bitcoin\"","webpack://Aeternity/external umd \"websocket\"","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/core-js/object/define-property.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/core-js/symbol.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/core-js/symbol/iterator.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/core-js/symbol/to-primitive.js","webpack://Aeternity/webpack/bootstrap","webpack://Aeternity/webpack/runtime/compat get default export","webpack://Aeternity/webpack/runtime/define property getters","webpack://Aeternity/webpack/runtime/global","webpack://Aeternity/webpack/runtime/hasOwnProperty shorthand","webpack://Aeternity/webpack/runtime/make namespace object","webpack://Aeternity/./src/utils/bignumber.ts","webpack://Aeternity/./src/utils/errors.ts","webpack://Aeternity/./src/utils/amount-formatter.ts","webpack://Aeternity/./src/utils/other.ts","webpack://Aeternity/./src/utils/encoder-types.ts","webpack://Aeternity/./src/utils/encoder.ts","webpack://Aeternity/./src/utils/crypto.ts","webpack://Aeternity/./src/tx/builder/constants.ts","webpack://Aeternity/./src/tx/builder/field-types/ct-version.ts","webpack://Aeternity/./src/tx/builder/field-types/abi-version.ts","webpack://Aeternity/./src/utils/bytes.ts","webpack://Aeternity/./src/tx/builder/field-types/address.ts","webpack://Aeternity/./src/tx/builder/field-types/boolean.ts","webpack://Aeternity/./src/tx/builder/helpers.ts","webpack://Aeternity/./src/tx/builder/field-types/u-int.ts","webpack://Aeternity/./src/tx/builder/field-types/coin-amount.ts","webpack://Aeternity/./src/tx/builder/field-types/deposit.ts","webpack://Aeternity/./src/tx/builder/field-types/fee.ts","webpack://Aeternity/./src/tx/builder/field-types/short-u-int.ts","webpack://Aeternity/./src/tx/builder/field-types/gas-limit.ts","webpack://Aeternity/./src/tx/builder/field-types/gas-price.ts","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/classExtractFieldDescriptor.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/classPrivateFieldSet.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/classApplyDescriptorSet.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/classPrivateFieldGet.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/classApplyDescriptorGet.js","webpack://Aeternity/./src/tx/builder/field-types/mptree.ts","webpack://Aeternity/./src/tx/builder/field-types/field.ts","webpack://Aeternity/./src/tx/builder/field-types/name.ts","webpack://Aeternity/./src/tx/builder/field-types/name-fee.ts","webpack://Aeternity/./src/tx/builder/field-types/name-id.ts","webpack://Aeternity/./src/tx/builder/field-types/pointers.ts","webpack://Aeternity/./src/tx/builder/field-types/raw.ts","webpack://Aeternity/./src/tx/builder/field-types/string.ts","webpack://Aeternity/./src/tx/builder/field-types/ttl.ts","webpack://Aeternity/./src/tx/builder/field-types/index.ts","webpack://Aeternity/./src/tx/builder/field-types/array.ts","webpack://Aeternity/./src/tx/builder/field-types/encoded.ts","webpack://Aeternity/./src/tx/builder/field-types/entry.ts","webpack://Aeternity/./src/tx/builder/field-types/enumeration.ts","webpack://Aeternity/./src/tx/builder/field-types/map.ts","webpack://Aeternity/./src/tx/builder/field-types/nonce.ts","webpack://Aeternity/./src/tx/builder/field-types/short-u-int-const.ts","webpack://Aeternity/./src/tx/builder/field-types/wrapped.ts","webpack://Aeternity/./src/tx/builder/schema.ts","webpack://Aeternity/./src/tx/builder/index.ts","webpack://Aeternity/./src/utils/semver-satisfies.ts","webpack://Aeternity/./src/utils/autorest.ts","webpack://Aeternity/./src/apis/node/models/mappers.ts","webpack://Aeternity/./src/apis/node/models/parameters.ts","webpack://Aeternity/./src/apis/node/node.ts","webpack://Aeternity/./src/Node.ts","webpack://Aeternity/./src/tx/transaction-signer.ts","webpack://Aeternity/./src/account/Base.ts","webpack://Aeternity/./src/account/Memory.ts","webpack://Aeternity/./src/tx/execution-cost.ts","webpack://Aeternity/./src/tx/validator.ts","webpack://Aeternity/./src/chain.ts","webpack://Aeternity/./src/utils/keystore.ts","webpack://Aeternity/./src/utils/hd-wallet.ts","webpack://Aeternity/./src/aens.ts","webpack://Aeternity/./src/contract/Contract.ts","webpack://Aeternity/./src/oracle.ts","webpack://Aeternity/./src/spend.ts","webpack://Aeternity/./src/contract/ga.ts","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/typeof.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/defineProperty.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/toPropertyKey.js","webpack://Aeternity/./node_modules/@babel/runtime-corejs3/helpers/esm/toPrimitive.js","webpack://Aeternity/./src/AeSdkMethods.ts","webpack://Aeternity/./src/contract/delegation-signature.ts","webpack://Aeternity/./src/AeSdkBase.ts","webpack://Aeternity/./src/AeSdk.ts","webpack://Aeternity/./src/aepp-wallet-communication/schema.ts","webpack://Aeternity/./src/account/Rpc.ts","webpack://Aeternity/./src/aepp-wallet-communication/rpc/RpcClient.ts","webpack://Aeternity/./src/AeSdkAepp.ts","webpack://Aeternity/./src/aepp-wallet-communication/rpc/types.ts","webpack://Aeternity/./src/utils/json-big.ts","webpack://Aeternity/./src/AeSdkWallet.ts","webpack://Aeternity/./src/account/Generalized.ts","webpack://Aeternity/./src/account/Ledger.ts","webpack://Aeternity/./src/account/LedgerFactory.ts","webpack://Aeternity/./src/contract/compiler/Base.ts","webpack://Aeternity/./src/apis/compiler/models/mappers.ts","webpack://Aeternity/./src/apis/compiler/models/parameters.ts","webpack://Aeternity/./src/apis/compiler/compiler.ts","webpack://Aeternity/./src/contract/compiler/Http.ts","webpack://Aeternity/./src/utils/string.ts","webpack://Aeternity/./src/channel/internal.ts","webpack://Aeternity/./src/channel/handlers.ts","webpack://Aeternity/./src/channel/Base.ts","webpack://Aeternity/./src/channel/Spend.ts","webpack://Aeternity/./src/channel/Contract.ts","webpack://Aeternity/./src/aepp-wallet-communication/connection-proxy.ts","webpack://Aeternity/./src/aepp-wallet-communication/connection/Browser.ts","webpack://Aeternity/./src/aepp-wallet-communication/connection/BrowserWindowMessage.ts","webpack://Aeternity/./src/aepp-wallet-communication/wallet-detector.ts","webpack://Aeternity/./src/aepp-wallet-communication/connection/BrowserRuntime.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@azure/core-rest-pipeline\"), require(\"buffer\"), require(\"rlp\"), require(\"bignumber.js\"), require(\"bs58\"), require(\"tweetnacl\"), require(\"varuint-bitcoin\"), require(\"@azure/core-client\"), require(\"@aeternity/uuid\"), require(\"@aeternity/argon2\"), require(\"tweetnacl-auth\"), require(\"bip32-path\"), require(\"aes-js\"), require(\"@aeternity/aepp-calldata\"), require(\"json-bigint\"), require(\"events\"), require(\"websocket\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@azure/core-rest-pipeline\", \"buffer\", \"rlp\", \"bignumber.js\", \"bs58\", \"tweetnacl\", \"varuint-bitcoin\", \"@azure/core-client\", \"@aeternity/uuid\", \"@aeternity/argon2\", \"tweetnacl-auth\", \"bip32-path\", \"aes-js\", \"@aeternity/aepp-calldata\", \"json-bigint\", \"events\", \"websocket\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Aeternity\"] = factory(require(\"@azure/core-rest-pipeline\"), require(\"buffer\"), require(\"rlp\"), require(\"bignumber.js\"), require(\"bs58\"), require(\"tweetnacl\"), require(\"varuint-bitcoin\"), require(\"@azure/core-client\"), require(\"@aeternity/uuid\"), require(\"@aeternity/argon2\"), require(\"tweetnacl-auth\"), require(\"bip32-path\"), require(\"aes-js\"), require(\"@aeternity/aepp-calldata\"), require(\"json-bigint\"), require(\"events\"), require(\"websocket\"));\n\telse\n\t\troot[\"Aeternity\"] = factory(root[\"@azure/core-rest-pipeline\"], root[\"buffer\"], root[\"rlp\"], root[\"bignumber.js\"], root[\"bs58\"], root[\"tweetnacl\"], root[\"varuint-bitcoin\"], root[\"@azure/core-client\"], root[\"@aeternity/uuid\"], root[\"@aeternity/argon2\"], root[\"tweetnacl-auth\"], root[\"bip32-path\"], root[\"aes-js\"], root[\"@aeternity/aepp-calldata\"], root[\"json-bigint\"], root[\"events\"], root[\"websocket\"]);\n})(self, function(__WEBPACK_EXTERNAL_MODULE__5039__, __WEBPACK_EXTERNAL_MODULE__9408__, __WEBPACK_EXTERNAL_MODULE__3485__, __WEBPACK_EXTERNAL_MODULE__5192__, __WEBPACK_EXTERNAL_MODULE__3783__, __WEBPACK_EXTERNAL_MODULE__79__, __WEBPACK_EXTERNAL_MODULE__7480__, __WEBPACK_EXTERNAL_MODULE__4711__, __WEBPACK_EXTERNAL_MODULE__3983__, __WEBPACK_EXTERNAL_MODULE__7417__, __WEBPACK_EXTERNAL_MODULE__9882__, __WEBPACK_EXTERNAL_MODULE__1986__, __WEBPACK_EXTERNAL_MODULE__8236__, __WEBPACK_EXTERNAL_MODULE__7946__, __WEBPACK_EXTERNAL_MODULE__2716__, __WEBPACK_EXTERNAL_MODULE__3735__, __WEBPACK_EXTERNAL_MODULE__8079__) {\nreturn ","// Blake2B in pure Javascript\n// Adapted from the reference implementation in RFC7693\n// Ported to Javascript by DC - https://github.com/dcposch\n\nconst util = require('./util')\n\n// 64-bit unsigned addition\n// Sets v[a,a+1] += v[b,b+1]\n// v should be a Uint32Array\nfunction ADD64AA (v, a, b) {\n const o0 = v[a] + v[b]\n let o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}\n\n// 64-bit unsigned addition\n// Sets v[a,a+1] += b\n// b0 is the low 32 bits of b, b1 represents the high 32 bits\nfunction ADD64AC (v, a, b0, b1) {\n let o0 = v[a] + b0\n if (b0 < 0) {\n o0 += 0x100000000\n }\n let o1 = v[a + 1] + b1\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}\n\n// Little-endian byte access\nfunction B2B_GET32 (arr, i) {\n return arr[i] ^ (arr[i + 1] << 8) ^ (arr[i + 2] << 16) ^ (arr[i + 3] << 24)\n}\n\n// G Mixing function\n// The ROTRs are inlined for speed\nfunction B2B_G (a, b, c, d, ix, iy) {\n const x0 = m[ix]\n const x1 = m[ix + 1]\n const y0 = m[iy]\n const y1 = m[iy + 1]\n\n ADD64AA(v, a, b) // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s\n ADD64AC(v, a, x0, x1) // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits\n let xor0 = v[d] ^ v[a]\n let xor1 = v[d + 1] ^ v[a + 1]\n v[d] = xor1\n v[d + 1] = xor0\n\n ADD64AA(v, c, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor0 >>> 24) ^ (xor1 << 8)\n v[b + 1] = (xor1 >>> 24) ^ (xor0 << 8)\n\n ADD64AA(v, a, b)\n ADD64AC(v, a, y0, y1)\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits\n xor0 = v[d] ^ v[a]\n xor1 = v[d + 1] ^ v[a + 1]\n v[d] = (xor0 >>> 16) ^ (xor1 << 16)\n v[d + 1] = (xor1 >>> 16) ^ (xor0 << 16)\n\n ADD64AA(v, c, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor1 >>> 31) ^ (xor0 << 1)\n v[b + 1] = (xor0 >>> 31) ^ (xor1 << 1)\n}\n\n// Initialization Vector\nconst BLAKE2B_IV32 = new Uint32Array([\n 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372,\n 0x5f1d36f1, 0xa54ff53a, 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c,\n 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19\n])\n\nconst SIGMA8 = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13,\n 6, 1, 12, 0, 2, 11, 7, 5, 3, 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1,\n 9, 4, 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, 9, 0, 5, 7, 2, 4,\n 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5,\n 15, 14, 1, 9, 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, 13, 11, 7,\n 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, 6, 15, 14, 9, 11, 3, 0, 8, 12, 2,\n 13, 7, 1, 4, 10, 5, 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, 0,\n 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13, 6,\n 1, 12, 0, 2, 11, 7, 5, 3\n]\n\n// These are offsets into a uint64 buffer.\n// Multiply them all by 2 to make them offsets into a uint32 buffer,\n// because this is Javascript and we don't have uint64s\nconst SIGMA82 = new Uint8Array(\n SIGMA8.map(function (x) {\n return x * 2\n })\n)\n\n// Compression function. 'last' flag indicates last block.\n// Note we're representing 16 uint64s as 32 uint32s\nconst v = new Uint32Array(32)\nconst m = new Uint32Array(32)\nfunction blake2bCompress (ctx, last) {\n let i = 0\n\n // init work variables\n for (i = 0; i < 16; i++) {\n v[i] = ctx.h[i]\n v[i + 16] = BLAKE2B_IV32[i]\n }\n\n // low 64 bits of offset\n v[24] = v[24] ^ ctx.t\n v[25] = v[25] ^ (ctx.t / 0x100000000)\n // high 64 bits not supported, offset may not be higher than 2**53-1\n\n // last block flag set ?\n if (last) {\n v[28] = ~v[28]\n v[29] = ~v[29]\n }\n\n // get little-endian words\n for (i = 0; i < 32; i++) {\n m[i] = B2B_GET32(ctx.b, 4 * i)\n }\n\n // twelve rounds of mixing\n // uncomment the DebugPrint calls to log the computation\n // and match the RFC sample documentation\n // util.debugPrint(' m[16]', m, 64)\n for (i = 0; i < 12; i++) {\n // util.debugPrint(' (i=' + (i < 10 ? ' ' : '') + i + ') v[16]', v, 64)\n B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1])\n B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3])\n B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5])\n B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7])\n B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9])\n B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11])\n B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13])\n B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15])\n }\n // util.debugPrint(' (i=12) v[16]', v, 64)\n\n for (i = 0; i < 16; i++) {\n ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16]\n }\n // util.debugPrint('h[8]', ctx.h, 64)\n}\n\n// reusable parameterBlock\nconst parameterBlock = new Uint8Array([\n 0,\n 0,\n 0,\n 0, // 0: outlen, keylen, fanout, depth\n 0,\n 0,\n 0,\n 0, // 4: leaf length, sequential mode\n 0,\n 0,\n 0,\n 0, // 8: node offset\n 0,\n 0,\n 0,\n 0, // 12: node offset\n 0,\n 0,\n 0,\n 0, // 16: node depth, inner length, rfu\n 0,\n 0,\n 0,\n 0, // 20: rfu\n 0,\n 0,\n 0,\n 0, // 24: rfu\n 0,\n 0,\n 0,\n 0, // 28: rfu\n 0,\n 0,\n 0,\n 0, // 32: salt\n 0,\n 0,\n 0,\n 0, // 36: salt\n 0,\n 0,\n 0,\n 0, // 40: salt\n 0,\n 0,\n 0,\n 0, // 44: salt\n 0,\n 0,\n 0,\n 0, // 48: personal\n 0,\n 0,\n 0,\n 0, // 52: personal\n 0,\n 0,\n 0,\n 0, // 56: personal\n 0,\n 0,\n 0,\n 0 // 60: personal\n])\n\n// Creates a BLAKE2b hashing context\n// Requires an output length between 1 and 64 bytes\n// Takes an optional Uint8Array key\n// Takes an optinal Uint8Array salt\n// Takes an optinal Uint8Array personal\nfunction blake2bInit (outlen, key, salt, personal) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n if (salt && salt.length !== 16) {\n throw new Error('Illegal salt, expected Uint8Array with length is 16')\n }\n if (personal && personal.length !== 16) {\n throw new Error('Illegal personal, expected Uint8Array with length is 16')\n }\n\n // state, 'param block'\n const ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n }\n\n // initialize parameterBlock before usage\n parameterBlock.fill(0)\n parameterBlock[0] = outlen\n if (key) parameterBlock[1] = key.length\n parameterBlock[2] = 1 // fanout\n parameterBlock[3] = 1 // depth\n if (salt) parameterBlock.set(salt, 32)\n if (personal) parameterBlock.set(personal, 48)\n\n // initialize hash state\n for (let i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4)\n }\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key)\n // at the end\n ctx.c = 128\n }\n\n return ctx\n}\n\n// Updates a BLAKE2b streaming hash\n// Requires hash context and Uint8Array (byte array)\nfunction blake2bUpdate (ctx, input) {\n for (let i = 0; i < input.length; i++) {\n if (ctx.c === 128) {\n // buffer full ?\n ctx.t += ctx.c // add counters\n blake2bCompress(ctx, false) // compress (not last)\n ctx.c = 0 // counter to zero\n }\n ctx.b[ctx.c++] = input[i]\n }\n}\n\n// Completes a BLAKE2b streaming hash\n// Returns a Uint8Array containing the message digest\nfunction blake2bFinal (ctx) {\n ctx.t += ctx.c // mark last block offset\n\n while (ctx.c < 128) {\n // fill up with zeros\n ctx.b[ctx.c++] = 0\n }\n blake2bCompress(ctx, true) // final block flag = 1\n\n // little endian convert and store\n const out = new Uint8Array(ctx.outlen)\n for (let i = 0; i < ctx.outlen; i++) {\n out[i] = ctx.h[i >> 2] >> (8 * (i & 3))\n }\n return out\n}\n\n// Computes the BLAKE2B hash of a string or byte array, and returns a Uint8Array\n//\n// Returns a n-byte Uint8Array\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer or Uint8Array\n// - key - optional key Uint8Array, up to 64 bytes\n// - outlen - optional output length in bytes, default 64\n// - salt - optional salt bytes, string, Buffer or Uint8Array\n// - personal - optional personal bytes, string, Buffer or Uint8Array\nfunction blake2b (input, key, outlen, salt, personal) {\n // preprocess inputs\n outlen = outlen || 64\n input = util.normalizeInput(input)\n if (salt) {\n salt = util.normalizeInput(salt)\n }\n if (personal) {\n personal = util.normalizeInput(personal)\n }\n\n // do the math\n const ctx = blake2bInit(outlen, key, salt, personal)\n blake2bUpdate(ctx, input)\n return blake2bFinal(ctx)\n}\n\n// Computes the BLAKE2B hash of a string or byte array\n//\n// Returns an n-byte hash in hex, all lowercase\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer, or Uint8Array\n// - key - optional key Uint8Array, up to 64 bytes\n// - outlen - optional output length in bytes, default 64\n// - salt - optional salt bytes, string, Buffer or Uint8Array\n// - personal - optional personal bytes, string, Buffer or Uint8Array\nfunction blake2bHex (input, key, outlen, salt, personal) {\n const output = blake2b(input, key, outlen, salt, personal)\n return util.toHex(output)\n}\n\nmodule.exports = {\n blake2b: blake2b,\n blake2bHex: blake2bHex,\n blake2bInit: blake2bInit,\n blake2bUpdate: blake2bUpdate,\n blake2bFinal: blake2bFinal\n}\n","const ERROR_MSG_INPUT = 'Input must be an string, Buffer or Uint8Array'\n\n// For convenience, let people hash a string, not just a Uint8Array\nfunction normalizeInput (input) {\n let ret\n if (input instanceof Uint8Array) {\n ret = input\n } else if (typeof input === 'string') {\n const encoder = new TextEncoder()\n ret = encoder.encode(input)\n } else {\n throw new Error(ERROR_MSG_INPUT)\n }\n return ret\n}\n\n// Converts a Uint8Array to a hexadecimal string\n// For example, toHex([255, 0, 255]) returns \"ff00ff\"\nfunction toHex (bytes) {\n return Array.prototype.map\n .call(bytes, function (n) {\n return (n < 16 ? '0' : '') + n.toString(16)\n })\n .join('')\n}\n\n// Converts any value in [0...2^32-1] to an 8-character hex string\nfunction uint32ToHex (val) {\n return (0x100000000 + val).toString(16).substring(1)\n}\n\n// For debugging: prints out hash state in the same format as the RFC\n// sample computation exactly, so that you can diff\nfunction debugPrint (label, arr, size) {\n let msg = '\\n' + label + ' = '\n for (let i = 0; i < arr.length; i += 2) {\n if (size === 32) {\n msg += uint32ToHex(arr[i]).toUpperCase()\n msg += ' '\n msg += uint32ToHex(arr[i + 1]).toUpperCase()\n } else if (size === 64) {\n msg += uint32ToHex(arr[i + 1]).toUpperCase()\n msg += uint32ToHex(arr[i]).toUpperCase()\n } else throw new Error('Invalid size ' + size)\n if (i % 6 === 4) {\n msg += '\\n' + new Array(label.length + 4).join(' ')\n } else if (i < arr.length - 2) {\n msg += ' '\n }\n }\n console.log(msg)\n}\n\n// For performance testing: generates N bytes of input, hashes M times\n// Measures and prints MB/second hash performance each time\nfunction testSpeed (hashFn, N, M) {\n let startMs = new Date().getTime()\n\n const input = new Uint8Array(N)\n for (let i = 0; i < N; i++) {\n input[i] = i % 256\n }\n const genMs = new Date().getTime()\n console.log('Generated random input in ' + (genMs - startMs) + 'ms')\n startMs = genMs\n\n for (let i = 0; i < M; i++) {\n const hashHex = hashFn(input)\n const hashMs = new Date().getTime()\n const ms = hashMs - startMs\n startMs = hashMs\n console.log('Hashed in ' + ms + 'ms: ' + hashHex.substring(0, 20) + '...')\n console.log(\n Math.round((N / (1 << 20) / (ms / 1000)) * 100) / 100 + ' MB PER SECOND'\n )\n }\n}\n\nmodule.exports = {\n normalizeInput: normalizeInput,\n toHex: toHex,\n debugPrint: debugPrint,\n testSpeed: testSpeed\n}\n","var parent = require('../../stable/object/define-property');\n\nmodule.exports = parent;\n","var parent = require('../../stable/symbol');\n\nrequire('../../modules/esnext.symbol.dispose');\n\nmodule.exports = parent;\n","var parent = require('../../stable/symbol/iterator');\n\nmodule.exports = parent;\n","var parent = require('../../stable/symbol/to-primitive');\n\nmodule.exports = parent;\n","require('../../modules/es.object.define-property');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nvar defineProperty = module.exports = function defineProperty(it, key, desc) {\n return Object.defineProperty(it, key, desc);\n};\n\nif (Object.defineProperty.sham) defineProperty.sham = true;\n","require('../../modules/es.array.concat');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.symbol');\nrequire('../../modules/es.symbol.async-iterator');\nrequire('../../modules/es.symbol.description');\nrequire('../../modules/es.symbol.has-instance');\nrequire('../../modules/es.symbol.is-concat-spreadable');\nrequire('../../modules/es.symbol.iterator');\nrequire('../../modules/es.symbol.match');\nrequire('../../modules/es.symbol.match-all');\nrequire('../../modules/es.symbol.replace');\nrequire('../../modules/es.symbol.search');\nrequire('../../modules/es.symbol.species');\nrequire('../../modules/es.symbol.split');\nrequire('../../modules/es.symbol.to-primitive');\nrequire('../../modules/es.symbol.to-string-tag');\nrequire('../../modules/es.symbol.unscopables');\nrequire('../../modules/es.json.to-string-tag');\nrequire('../../modules/es.math.to-string-tag');\nrequire('../../modules/es.reflect.to-string-tag');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Symbol;\n","require('../../modules/es.array.iterator');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.string.iterator');\nrequire('../../modules/es.symbol.iterator');\nvar WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');\n\nmodule.exports = WrappedWellKnownSymbolModule.f('iterator');\n","require('../../modules/es.date.to-primitive');\nrequire('../../modules/es.symbol.to-primitive');\nvar WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');\n\nmodule.exports = WrappedWellKnownSymbolModule.f('toPrimitive');\n","module.exports = require('../../full/object/define-property');\n","module.exports = require('../../full/symbol');\n","module.exports = require('../../full/symbol/iterator');\n","module.exports = require('../../full/symbol/to-primitive');\n","var parent = require('../../actual/object/define-property');\n\nmodule.exports = parent;\n","var parent = require('../../actual/symbol');\nrequire('../../modules/esnext.symbol.async-dispose');\nrequire('../../modules/esnext.symbol.is-registered');\nrequire('../../modules/esnext.symbol.is-well-known');\nrequire('../../modules/esnext.symbol.matcher');\nrequire('../../modules/esnext.symbol.metadata-key');\nrequire('../../modules/esnext.symbol.observable');\n// TODO: Remove from `core-js@4`\nrequire('../../modules/esnext.symbol.metadata');\nrequire('../../modules/esnext.symbol.pattern-match');\nrequire('../../modules/esnext.symbol.replace-all');\n\nmodule.exports = parent;\n","var parent = require('../../actual/symbol/iterator');\n\nmodule.exports = parent;\n","var parent = require('../../actual/symbol/to-primitive');\n\nmodule.exports = parent;\n","var isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a function');\n};\n","var isCallable = require('../internals/is-callable');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","module.exports = function () { /* empty */ };\n","var isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw $TypeError($String(argument) + ' is not an object');\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var bind = require('../internals/function-bind-context');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar IndexedObject = require('../internals/indexed-object');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\nvar push = uncurryThis([].push);\n\n// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation\nvar createMethod = function (TYPE) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var IS_FILTER_REJECT = TYPE == 7;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n return function ($this, callbackfn, that, specificCreate) {\n var O = toObject($this);\n var self = IndexedObject(O);\n var boundFunction = bind(callbackfn, that);\n var length = lengthOfArrayLike(self);\n var index = 0;\n var create = specificCreate || arraySpeciesCreate;\n var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;\n var value, result;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n value = self[index];\n result = boundFunction(value, index, O);\n if (TYPE) {\n if (IS_MAP) target[index] = result; // map\n else if (result) switch (TYPE) {\n case 3: return true; // some\n case 5: return value; // find\n case 6: return index; // findIndex\n case 2: push(target, value); // filter\n } else switch (TYPE) {\n case 4: return false; // every\n case 7: push(target, value); // filterReject\n }\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.forEach` method\n // https://tc39.es/ecma262/#sec-array.prototype.foreach\n forEach: createMethod(0),\n // `Array.prototype.map` method\n // https://tc39.es/ecma262/#sec-array.prototype.map\n map: createMethod(1),\n // `Array.prototype.filter` method\n // https://tc39.es/ecma262/#sec-array.prototype.filter\n filter: createMethod(2),\n // `Array.prototype.some` method\n // https://tc39.es/ecma262/#sec-array.prototype.some\n some: createMethod(3),\n // `Array.prototype.every` method\n // https://tc39.es/ecma262/#sec-array.prototype.every\n every: createMethod(4),\n // `Array.prototype.find` method\n // https://tc39.es/ecma262/#sec-array.prototype.find\n find: createMethod(5),\n // `Array.prototype.findIndex` method\n // https://tc39.es/ecma262/#sec-array.prototype.findIndex\n findIndex: createMethod(6),\n // `Array.prototype.filterReject` method\n // https://github.com/tc39/proposal-array-filtering\n filterReject: createMethod(7)\n};\n","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (METHOD_NAME) {\n // We can't use this feature detection in V8 since it causes\n // deoptimization and serious performance degradation\n // https://github.com/zloirock/core-js/issues/677\n return V8_VERSION >= 51 || !fails(function () {\n var array = [];\n var constructor = array.constructor = {};\n constructor[SPECIES] = function () {\n return { foo: 1 };\n };\n return array[METHOD_NAME](Boolean).foo !== 1;\n });\n};\n","var toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar createProperty = require('../internals/create-property');\n\nvar $Array = Array;\nvar max = Math.max;\n\nmodule.exports = function (O, start, end) {\n var length = lengthOfArrayLike(O);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n var result = $Array(max(fin - k, 0));\n for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis([].slice);\n","var isArray = require('../internals/is-array');\nvar isConstructor = require('../internals/is-constructor');\nvar isObject = require('../internals/is-object');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\nvar $Array = Array;\n\n// a part of `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray) {\n var C;\n if (isArray(originalArray)) {\n C = originalArray.constructor;\n // cross-realm fallback\n if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;\n else if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? $Array : C;\n};\n","var arraySpeciesConstructor = require('../internals/array-species-constructor');\n\n// `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray, length) {\n return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n // eslint-disable-next-line es/no-object-getprototypeof -- required for testing\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","// `CreateIterResultObject` abstract operation\n// https://tc39.es/ecma262/#sec-createiterresultobject\nmodule.exports = function (value, done) {\n return { value: value, done: done };\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","'use strict';\nvar toPropertyKey = require('../internals/to-property-key');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","var defineProperty = require('../internals/object-define-property');\n\nmodule.exports = function (target, name, descriptor) {\n return defineProperty.f(target, name, descriptor);\n};\n","var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (target, key, value, options) {\n if (options && options.enumerable) target[key] = value;\n else createNonEnumerableProperty(target, key, value);\n return target;\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var documentAll = typeof document == 'object' && document.all;\n\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nvar IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;\n\nmodule.exports = {\n all: documentAll,\n IS_HTMLDDA: IS_HTMLDDA\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var $TypeError = TypeError;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991\n\nmodule.exports = function (it) {\n if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');\n return it;\n};\n","// iterable DOM collections\n// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods\nmodule.exports = {\n CSSRuleList: 0,\n CSSStyleDeclaration: 0,\n CSSValueList: 0,\n ClientRectList: 0,\n DOMRectList: 0,\n DOMStringList: 0,\n DOMTokenList: 1,\n DataTransferItemList: 0,\n FileList: 0,\n HTMLAllCollection: 0,\n HTMLCollection: 0,\n HTMLFormElement: 0,\n HTMLSelectElement: 0,\n MediaList: 0,\n MimeTypeArray: 0,\n NamedNodeMap: 0,\n NodeList: 1,\n PaintRequestList: 0,\n Plugin: 0,\n PluginArray: 0,\n SVGLengthList: 0,\n SVGNumberList: 0,\n SVGPathSegList: 0,\n SVGPointList: 0,\n SVGStringList: 0,\n SVGTransformList: 0,\n SourceBufferList: 0,\n StyleSheetList: 0,\n TextTrackCueList: 0,\n TextTrackList: 0,\n TouchList: 0\n};\n","module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","'use strict';\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar isCallable = require('../internals/is-callable');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar isForced = require('../internals/is-forced');\nvar path = require('../internals/path');\nvar bind = require('../internals/function-bind-context');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof Wrapper) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return apply(NativeConstructor, this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;\n\n var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;\n\n // bind methods to global for calling from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changes in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n createNonEnumerableProperty(target, key, resultProperty);\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);\n // export real prototype methods\n if (options.real && targetPrototype && (FORCED || !targetPrototype[key])) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n","var uncurryThis = require('../internals/function-uncurry-this-clause');\nvar aCallable = require('../internals/a-callable');\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\n\nmodule.exports = function (object, key, method) {\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));\n } catch (error) { /* empty */ }\n};\n","var classofRaw = require('../internals/classof-raw');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = function (fn) {\n // Nashorn bug:\n // https://github.com/zloirock/core-js/issues/1128\n // https://github.com/zloirock/core-js/issues/1130\n if (classofRaw(fn) === 'Function') return uncurryThis(fn);\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n","var path = require('../internals/path');\nvar global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (variable) {\n return isCallable(variable) ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar isArray = require('../internals/is-array');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof-raw');\nvar toString = require('../internals/to-string');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (replacer) {\n if (isCallable(replacer)) return replacer;\n if (!isArray(replacer)) return;\n var rawLength = replacer.length;\n var keys = [];\n for (var i = 0; i < rawLength; i++) {\n var element = replacer[i];\n if (typeof element == 'string') push(keys, element);\n else if (typeof element == 'number' || classof(element) == 'Number' || classof(element) == 'String') push(keys, toString(element));\n }\n var keysLength = keys.length;\n var root = true;\n return function (key, value) {\n if (root) {\n root = false;\n return value;\n }\n if (isArray(this)) return value;\n for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;\n };\n};\n","var aCallable = require('../internals/a-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","module.exports = {};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n /* eslint-disable no-self-assign -- prototype methods protection */\n store.get = store.get;\n store.has = store.has;\n store.set = store.set;\n /* eslint-enable no-self-assign -- prototype methods protection */\n set = function (it, metadata) {\n if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n store.set(it, metadata);\n return metadata;\n };\n get = function (it) {\n return store.get(it) || {};\n };\n has = function (it) {\n return store.has(it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","var classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(argument) {\n return classof(argument) == 'Array';\n};\n","var $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = $documentAll.IS_HTMLDDA ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof');\nvar getBuiltIn = require('../internals/get-built-in');\nvar inspectSource = require('../internals/inspect-source');\n\nvar noop = function () { /* empty */ };\nvar empty = [];\nvar construct = getBuiltIn('Reflect', 'construct');\nvar constructorRegExp = /^\\s*(?:class|function)\\b/;\nvar exec = uncurryThis(constructorRegExp.exec);\nvar INCORRECT_TO_STRING = !constructorRegExp.exec(noop);\n\nvar isConstructorModern = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n try {\n construct(noop, empty, argument);\n return true;\n } catch (error) {\n return false;\n }\n};\n\nvar isConstructorLegacy = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n switch (classof(argument)) {\n case 'AsyncFunction':\n case 'GeneratorFunction':\n case 'AsyncGeneratorFunction': return false;\n }\n try {\n // we can't check .prototype since constructors produced by .bind haven't it\n // `Function#toString` throws on some built-it function in some legacy engines\n // (for example, `DOMQuad` and similar in FF41-)\n return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));\n } catch (error) {\n return true;\n }\n};\n\nisConstructorLegacy.sham = true;\n\n// `IsConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-isconstructor\nmodule.exports = !construct || fails(function () {\n var called;\n return isConstructorModern(isConstructorModern.call)\n || !isConstructorModern(Object)\n || !isConstructorModern(function () { called = true; })\n || called;\n}) ? isConstructorLegacy : isConstructorModern;\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n","var isCallable = require('../internals/is-callable');\nvar $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\nmodule.exports = $documentAll.IS_HTMLDDA ? function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;\n} : function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","module.exports = true;\n","var getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar IS_PURE = require('../internals/is-pure');\nvar FunctionName = require('../internals/function-name');\nvar isCallable = require('../internals/is-callable');\nvar createIteratorConstructor = require('../internals/iterator-create-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar PROPER_FUNCTION_NAME = FunctionName.PROPER;\nvar CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {\n defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array.prototype.{ values, @@iterator }.name in V8 / FF\n if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {\n createNonEnumerableProperty(IterablePrototype, 'name', VALUES);\n } else {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return call(nativeIterator, this); };\n }\n }\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n defineBuiltIn(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });\n }\n Iterators[NAME] = defaultIterator;\n\n return methods;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar create = require('../internals/object-create');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\n// `%IteratorPrototype%` object\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\n/* eslint-disable es/no-array-prototype-keys -- safe */\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nvar NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {\n var test = {};\n // FF44- legacy iterators case\n return IteratorPrototype[ITERATOR].call(test) !== test;\n});\n\nif (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};\nelse if (IS_PURE) IteratorPrototype = create(IteratorPrototype);\n\n// `%IteratorPrototype%[@@iterator]()` method\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator\nif (!isCallable(IteratorPrototype[ITERATOR])) {\n defineBuiltIn(IteratorPrototype, ITERATOR, function () {\n return this;\n });\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","module.exports = {};\n","var toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","/* global ActiveXObject -- old IE, WSH */\nvar anObject = require('../internals/an-object');\nvar definePropertiesModule = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n activeXDocument = new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = typeof document != 'undefined'\n ? document.domain && activeXDocument\n ? NullProtoObjectViaActiveX(activeXDocument) // old IE\n : NullProtoObjectViaIFrame()\n : NullProtoObjectViaActiveX(activeXDocument); // WSH\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.es/ecma262/#sec-object.create\n// eslint-disable-next-line es/no-object-create -- safe\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : definePropertiesModule.f(result, Properties);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.es/ecma262/#sec-object.defineproperties\n// eslint-disable-next-line es/no-object-defineproperties -- safe\nexports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var props = toIndexedObject(Properties);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","/* eslint-disable es/no-object-getownpropertynames -- safe */\nvar classof = require('../internals/classof-raw');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar $getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar arraySlice = require('../internals/array-slice-simple');\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return $getOwnPropertyNames(it);\n } catch (error) {\n return arraySlice(windowNames);\n }\n};\n\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && classof(it) == 'Window'\n ? getWindowNames(it)\n : $getOwnPropertyNames(toIndexedObject(it));\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n","var hasOwn = require('../internals/has-own-property');\nvar isCallable = require('../internals/is-callable');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar $Object = Object;\nvar ObjectPrototype = $Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.getprototypeof\n// eslint-disable-next-line es/no-object-getprototypeof -- safe\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {\n var object = toObject(O);\n if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];\n var constructor = object.constructor;\n if (isCallable(constructor) && object instanceof constructor) {\n return constructor.prototype;\n } return object instanceof $Object ? ObjectPrototype : null;\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.es/ecma262/#sec-object.keys\n// eslint-disable-next-line es/no-object-keys -- safe\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","/* eslint-disable no-proto -- safe */\nvar uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classof = require('../internals/classof');\n\n// `Object.prototype.toString` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.tostring\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n","var call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw $TypeError(\"Can't convert object to primitive value\");\n};\n","module.exports = {};\n","var isNullOrUndefined = require('../internals/is-null-or-undefined');\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar defineProperty = require('../internals/object-define-property').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar toString = require('../internals/object-to-string');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (it, TAG, STATIC, SET_METHOD) {\n if (it) {\n var target = STATIC ? it : it.prototype;\n if (!hasOwn(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {\n createNonEnumerableProperty(target, 'toString', toString);\n }\n }\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","var global = require('../internals/global');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.29.0',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar stringSlice = uncurryThis(''.slice);\n\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = toString(requireObjectCoercible($this));\n var position = toIntegerOrInfinity(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = charCodeAt(S, position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING\n ? charAt(S, position)\n : first\n : CONVERT_TO_STRING\n ? stringSlice(S, position, position + 2)\n : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.es/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n return !String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","var call = require('../internals/function-call');\nvar getBuiltIn = require('../internals/get-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar defineBuiltIn = require('../internals/define-built-in');\n\nmodule.exports = function () {\n var Symbol = getBuiltIn('Symbol');\n var SymbolPrototype = Symbol && Symbol.prototype;\n var valueOf = SymbolPrototype && SymbolPrototype.valueOf;\n var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {\n // `Symbol.prototype[@@toPrimitive]` method\n // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive\n // eslint-disable-next-line no-unused-vars -- required for .length\n defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {\n return call(valueOf, this);\n }, { arity: 1 });\n }\n};\n","var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\n/* eslint-disable es/no-symbol -- safe */\nmodule.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","var call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var classof = require('../internals/classof');\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n","var $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));\n","var path = require('../internals/path');\nvar hasOwn = require('../internals/has-own-property');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (NAME) {\n var Symbol = path.Symbol || (path.Symbol = {});\n if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {\n value: wrappedWellKnownSymbolModule.f(NAME)\n });\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nexports.f = wellKnownSymbol;\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar Symbol = global.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');\nvar createProperty = require('../internals/create-property');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\n\n// We can't use this feature detection in V8 since it causes\n// deoptimization and serious performance degradation\n// https://github.com/zloirock/core-js/issues/679\nvar IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n});\n\nvar isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n};\n\nvar FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat');\n\n// `Array.prototype.concat` method\n// https://tc39.es/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n concat: function concat(arg) {\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = lengthOfArrayLike(E);\n doesNotExceedSafeInteger(n + len);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n doesNotExceedSafeInteger(n + 1);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n});\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineProperty = require('../internals/object-define-property').f;\nvar defineIterator = require('../internals/iterator-define');\nvar createIterResultObject = require('../internals/create-iter-result-object');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.es/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.es/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.es/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.es/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return createIterResultObject(undefined, true);\n }\n if (kind == 'keys') return createIterResultObject(index, false);\n if (kind == 'values') return createIterResultObject(target[index], false);\n return createIterResultObject([index, target[index]], false);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.es/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.es/ecma262/#sec-createmappedargumentsobject\nvar values = Iterators.Arguments = Iterators.Array;\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n// V8 ~ Chrome 45- bug\nif (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {\n defineProperty(values, 'name', { value: 'values' });\n} catch (error) { /* empty */ }\n","var $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar isSymbol = require('../internals/is-symbol');\nvar arraySlice = require('../internals/array-slice');\nvar getReplacerFunction = require('../internals/get-json-replacer-function');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nvar $String = String;\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar exec = uncurryThis(/./.exec);\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar replace = uncurryThis(''.replace);\nvar numberToString = uncurryThis(1.0.toString);\n\nvar tester = /[\\uD800-\\uDFFF]/g;\nvar low = /^[\\uD800-\\uDBFF]$/;\nvar hi = /^[\\uDC00-\\uDFFF]$/;\n\nvar WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {\n var symbol = getBuiltIn('Symbol')();\n // MS Edge converts symbol values to JSON as {}\n return $stringify([symbol]) != '[null]'\n // WebKit converts symbol values to JSON as null\n || $stringify({ a: symbol }) != '{}'\n // V8 throws on boxed symbols\n || $stringify(Object(symbol)) != '{}';\n});\n\n// https://github.com/tc39/proposal-well-formed-stringify\nvar ILL_FORMED_UNICODE = fails(function () {\n return $stringify('\\uDF06\\uD834') !== '\"\\\\udf06\\\\ud834\"'\n || $stringify('\\uDEAD') !== '\"\\\\udead\"';\n});\n\nvar stringifyWithSymbolsFix = function (it, replacer) {\n var args = arraySlice(arguments);\n var $replacer = getReplacerFunction(replacer);\n if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined\n args[1] = function (key, value) {\n // some old implementations (like WebKit) could pass numbers as keys\n if (isCallable($replacer)) value = call($replacer, this, $String(key), value);\n if (!isSymbol(value)) return value;\n };\n return apply($stringify, null, args);\n};\n\nvar fixIllFormed = function (match, offset, string) {\n var prev = charAt(string, offset - 1);\n var next = charAt(string, offset + 1);\n if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {\n return '\\\\u' + numberToString(charCodeAt(match, 0), 16);\n } return match;\n};\n\nif ($stringify) {\n // `JSON.stringify` method\n // https://tc39.es/ecma262/#sec-json.stringify\n $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n stringify: function stringify(it, replacer, space) {\n var args = arraySlice(arguments);\n var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);\n return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;\n }\n });\n}\n","var global = require('../internals/global');\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// JSON[@@toStringTag] property\n// https://tc39.es/ecma262/#sec-json-@@tostringtag\nsetToStringTag(global.JSON, 'JSON', true);\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar defineProperty = require('../internals/object-define-property').f;\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\n// eslint-disable-next-line es/no-object-defineproperty -- safe\n$({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {\n defineProperty: defineProperty\n});\n","var $ = require('../internals/export');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar fails = require('../internals/fails');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar toObject = require('../internals/to-object');\n\n// V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\nvar FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });\n\n// `Object.getOwnPropertySymbols` method\n// https://tc39.es/ecma262/#sec-object.getownpropertysymbols\n$({ target: 'Object', stat: true, forced: FORCED }, {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];\n }\n});\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar toString = require('../internals/to-string');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/iterator-define');\nvar createIterResultObject = require('../internals/create-iter-result-object');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: toString(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return createIterResultObject(undefined, true);\n point = charAt(string, index);\n state.index += point.length;\n return createIterResultObject(point, false);\n});\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.asyncIterator` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.asynciterator\ndefineWellKnownSymbol('asyncIterator');\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar fails = require('../internals/fails');\nvar hasOwn = require('../internals/has-own-property');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar anObject = require('../internals/an-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar $toString = require('../internals/to-string');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar nativeObjectCreate = require('../internals/object-create');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\nvar definePropertiesModule = require('../internals/object-define-properties');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar shared = require('../internals/shared');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar uid = require('../internals/uid');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\nvar defineSymbolToPrimitive = require('../internals/symbol-define-to-primitive');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\nvar $forEach = require('../internals/array-iteration').forEach;\n\nvar HIDDEN = sharedKey('hidden');\nvar SYMBOL = 'Symbol';\nvar PROTOTYPE = 'prototype';\n\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(SYMBOL);\n\nvar ObjectPrototype = Object[PROTOTYPE];\nvar $Symbol = global.Symbol;\nvar SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];\nvar TypeError = global.TypeError;\nvar QObject = global.QObject;\nvar nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\nvar nativeDefineProperty = definePropertyModule.f;\nvar nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;\nvar nativePropertyIsEnumerable = propertyIsEnumerableModule.f;\nvar push = uncurryThis([].push);\n\nvar AllSymbols = shared('symbols');\nvar ObjectPrototypeSymbols = shared('op-symbols');\nvar WellKnownSymbolsStore = shared('wks');\n\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDescriptor = DESCRIPTORS && fails(function () {\n return nativeObjectCreate(nativeDefineProperty({}, 'a', {\n get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (O, P, Attributes) {\n var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);\n if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];\n nativeDefineProperty(O, P, Attributes);\n if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {\n nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);\n }\n} : nativeDefineProperty;\n\nvar wrap = function (tag, description) {\n var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);\n setInternalState(symbol, {\n type: SYMBOL,\n tag: tag,\n description: description\n });\n if (!DESCRIPTORS) symbol.description = description;\n return symbol;\n};\n\nvar $defineProperty = function defineProperty(O, P, Attributes) {\n if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);\n anObject(O);\n var key = toPropertyKey(P);\n anObject(Attributes);\n if (hasOwn(AllSymbols, key)) {\n if (!Attributes.enumerable) {\n if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));\n O[HIDDEN][key] = true;\n } else {\n if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;\n Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });\n } return setSymbolDescriptor(O, key, Attributes);\n } return nativeDefineProperty(O, key, Attributes);\n};\n\nvar $defineProperties = function defineProperties(O, Properties) {\n anObject(O);\n var properties = toIndexedObject(Properties);\n var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));\n $forEach(keys, function (key) {\n if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);\n });\n return O;\n};\n\nvar $create = function create(O, Properties) {\n return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);\n};\n\nvar $propertyIsEnumerable = function propertyIsEnumerable(V) {\n var P = toPropertyKey(V);\n var enumerable = call(nativePropertyIsEnumerable, this, P);\n if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;\n return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]\n ? enumerable : true;\n};\n\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {\n var it = toIndexedObject(O);\n var key = toPropertyKey(P);\n if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;\n var descriptor = nativeGetOwnPropertyDescriptor(it, key);\n if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {\n descriptor.enumerable = true;\n }\n return descriptor;\n};\n\nvar $getOwnPropertyNames = function getOwnPropertyNames(O) {\n var names = nativeGetOwnPropertyNames(toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);\n });\n return result;\n};\n\nvar $getOwnPropertySymbols = function (O) {\n var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;\n var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {\n push(result, AllSymbols[key]);\n }\n });\n return result;\n};\n\n// `Symbol` constructor\n// https://tc39.es/ecma262/#sec-symbol-constructor\nif (!NATIVE_SYMBOL) {\n $Symbol = function Symbol() {\n if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');\n var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);\n var tag = uid(description);\n var setter = function (value) {\n if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);\n if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));\n };\n if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });\n return wrap(tag, description);\n };\n\n SymbolPrototype = $Symbol[PROTOTYPE];\n\n defineBuiltIn(SymbolPrototype, 'toString', function toString() {\n return getInternalState(this).tag;\n });\n\n defineBuiltIn($Symbol, 'withoutSetter', function (description) {\n return wrap(uid(description), description);\n });\n\n propertyIsEnumerableModule.f = $propertyIsEnumerable;\n definePropertyModule.f = $defineProperty;\n definePropertiesModule.f = $defineProperties;\n getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;\n getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;\n getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;\n\n wrappedWellKnownSymbolModule.f = function (name) {\n return wrap(wellKnownSymbol(name), name);\n };\n\n if (DESCRIPTORS) {\n // https://github.com/tc39/proposal-Symbol-description\n defineBuiltInAccessor(SymbolPrototype, 'description', {\n configurable: true,\n get: function description() {\n return getInternalState(this).description;\n }\n });\n if (!IS_PURE) {\n defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });\n }\n }\n}\n\n$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {\n Symbol: $Symbol\n});\n\n$forEach(objectKeys(WellKnownSymbolsStore), function (name) {\n defineWellKnownSymbol(name);\n});\n\n$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {\n useSetter: function () { USE_SETTER = true; },\n useSimple: function () { USE_SETTER = false; }\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {\n // `Object.create` method\n // https://tc39.es/ecma262/#sec-object.create\n create: $create,\n // `Object.defineProperty` method\n // https://tc39.es/ecma262/#sec-object.defineproperty\n defineProperty: $defineProperty,\n // `Object.defineProperties` method\n // https://tc39.es/ecma262/#sec-object.defineproperties\n defineProperties: $defineProperties,\n // `Object.getOwnPropertyDescriptor` method\n // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {\n // `Object.getOwnPropertyNames` method\n // https://tc39.es/ecma262/#sec-object.getownpropertynames\n getOwnPropertyNames: $getOwnPropertyNames\n});\n\n// `Symbol.prototype[@@toPrimitive]` method\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive\ndefineSymbolToPrimitive();\n\n// `Symbol.prototype[@@toStringTag]` property\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag\nsetToStringTag($Symbol, SYMBOL);\n\nhiddenKeys[HIDDEN] = true;\n","var $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar hasOwn = require('../internals/has-own-property');\nvar toString = require('../internals/to-string');\nvar shared = require('../internals/shared');\nvar NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection');\n\nvar StringToSymbolRegistry = shared('string-to-symbol-registry');\nvar SymbolToStringRegistry = shared('symbol-to-string-registry');\n\n// `Symbol.for` method\n// https://tc39.es/ecma262/#sec-symbol.for\n$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {\n 'for': function (key) {\n var string = toString(key);\n if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];\n var symbol = getBuiltIn('Symbol')(string);\n StringToSymbolRegistry[string] = symbol;\n SymbolToStringRegistry[symbol] = string;\n return symbol;\n }\n});\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.hasInstance` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.hasinstance\ndefineWellKnownSymbol('hasInstance');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.isConcatSpreadable` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.isconcatspreadable\ndefineWellKnownSymbol('isConcatSpreadable');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.iterator` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.iterator\ndefineWellKnownSymbol('iterator');\n","// TODO: Remove this module from `core-js@4` since it's split to modules listed below\nrequire('../modules/es.symbol.constructor');\nrequire('../modules/es.symbol.for');\nrequire('../modules/es.symbol.key-for');\nrequire('../modules/es.json.stringify');\nrequire('../modules/es.object.get-own-property-symbols');\n","var $ = require('../internals/export');\nvar hasOwn = require('../internals/has-own-property');\nvar isSymbol = require('../internals/is-symbol');\nvar tryToString = require('../internals/try-to-string');\nvar shared = require('../internals/shared');\nvar NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection');\n\nvar SymbolToStringRegistry = shared('symbol-to-string-registry');\n\n// `Symbol.keyFor` method\n// https://tc39.es/ecma262/#sec-symbol.keyfor\n$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');\n if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];\n }\n});\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.matchAll` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.matchall\ndefineWellKnownSymbol('matchAll');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.match` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.match\ndefineWellKnownSymbol('match');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.replace` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.replace\ndefineWellKnownSymbol('replace');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.search` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.search\ndefineWellKnownSymbol('search');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.species` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.species\ndefineWellKnownSymbol('species');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.split` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.split\ndefineWellKnownSymbol('split');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\nvar defineSymbolToPrimitive = require('../internals/symbol-define-to-primitive');\n\n// `Symbol.toPrimitive` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.toprimitive\ndefineWellKnownSymbol('toPrimitive');\n\n// `Symbol.prototype[@@toPrimitive]` method\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive\ndefineSymbolToPrimitive();\n","var getBuiltIn = require('../internals/get-built-in');\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// `Symbol.toStringTag` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.tostringtag\ndefineWellKnownSymbol('toStringTag');\n\n// `Symbol.prototype[@@toStringTag]` property\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag\nsetToStringTag(getBuiltIn('Symbol'), 'Symbol');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.unscopables` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.unscopables\ndefineWellKnownSymbol('unscopables');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.asyncDispose` well-known symbol\n// https://github.com/tc39/proposal-async-explicit-resource-management\ndefineWellKnownSymbol('asyncDispose');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.dispose` well-known symbol\n// https://github.com/tc39/proposal-explicit-resource-management\ndefineWellKnownSymbol('dispose');\n","var $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar Symbol = getBuiltIn('Symbol');\nvar keyFor = Symbol.keyFor;\nvar thisSymbolValue = uncurryThis(Symbol.prototype.valueOf);\n\n// `Symbol.isRegistered` method\n// https://tc39.es/proposal-symbol-predicates/#sec-symbol-isregistered\n$({ target: 'Symbol', stat: true }, {\n isRegistered: function isRegistered(value) {\n try {\n return keyFor(thisSymbolValue(value)) !== undefined;\n } catch (error) {\n return false;\n }\n }\n});\n","var $ = require('../internals/export');\nvar shared = require('../internals/shared');\nvar getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isSymbol = require('../internals/is-symbol');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar Symbol = getBuiltIn('Symbol');\nvar $isWellKnown = Symbol.isWellKnown;\nvar getOwnPropertyNames = getBuiltIn('Object', 'getOwnPropertyNames');\nvar thisSymbolValue = uncurryThis(Symbol.prototype.valueOf);\nvar WellKnownSymbolsStore = shared('wks');\n\nfor (var i = 0, symbolKeys = getOwnPropertyNames(Symbol), symbolKeysLength = symbolKeys.length; i < symbolKeysLength; i++) {\n // some old engines throws on access to some keys like `arguments` or `caller`\n try {\n var symbolKey = symbolKeys[i];\n if (isSymbol(Symbol[symbolKey])) wellKnownSymbol(symbolKey);\n } catch (error) { /* empty */ }\n}\n\n// `Symbol.isWellKnown` method\n// https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknown\n// We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected\n$({ target: 'Symbol', stat: true, forced: true }, {\n isWellKnown: function isWellKnown(value) {\n if ($isWellKnown && $isWellKnown(value)) return true;\n try {\n var symbol = thisSymbolValue(value);\n for (var j = 0, keys = getOwnPropertyNames(WellKnownSymbolsStore), keysLength = keys.length; j < keysLength; j++) {\n if (WellKnownSymbolsStore[keys[j]] == symbol) return true;\n }\n } catch (error) { /* empty */ }\n return false;\n }\n});\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.matcher` well-known symbol\n// https://github.com/tc39/proposal-pattern-matching\ndefineWellKnownSymbol('matcher');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.metadataKey` well-known symbol\n// https://github.com/tc39/proposal-decorator-metadata\ndefineWellKnownSymbol('metadataKey');\n","// TODO: Remove from `core-js@4`\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.metadata` well-known symbol\n// https://github.com/tc39/proposal-decorators\ndefineWellKnownSymbol('metadata');\n","var defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.observable` well-known symbol\n// https://github.com/tc39/proposal-observable\ndefineWellKnownSymbol('observable');\n","// TODO: remove from `core-js@4`\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.patternMatch` well-known symbol\n// https://github.com/tc39/proposal-pattern-matching\ndefineWellKnownSymbol('patternMatch');\n","// TODO: remove from `core-js@4`\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\ndefineWellKnownSymbol('replaceAll');\n","require('../modules/es.array.iterator');\nvar DOMIterables = require('../internals/dom-iterables');\nvar global = require('../internals/global');\nvar classof = require('../internals/classof');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {\n createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n Iterators[COLLECTION_NAME] = Iterators.Array;\n}\n","var parent = require('../../es/object/define-property');\n\nmodule.exports = parent;\n","var parent = require('../../es/symbol');\nrequire('../../modules/web.dom-collections.iterator');\n\nmodule.exports = parent;\n","var parent = require('../../es/symbol/iterator');\nrequire('../../modules/web.dom-collections.iterator');\n\nmodule.exports = parent;\n","var parent = require('../../es/symbol/to-primitive');\n\nmodule.exports = parent;\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","var Buffer = require('safe-buffer').Buffer\n\n// prototype class for hash functions\nfunction Hash (blockSize, finalSize) {\n this._block = Buffer.alloc(blockSize)\n this._finalSize = finalSize\n this._blockSize = blockSize\n this._len = 0\n}\n\nHash.prototype.update = function (data, enc) {\n if (typeof data === 'string') {\n enc = enc || 'utf8'\n data = Buffer.from(data, enc)\n }\n\n var block = this._block\n var blockSize = this._blockSize\n var length = data.length\n var accum = this._len\n\n for (var offset = 0; offset < length;) {\n var assigned = accum % blockSize\n var remainder = Math.min(length - offset, blockSize - assigned)\n\n for (var i = 0; i < remainder; i++) {\n block[assigned + i] = data[offset + i]\n }\n\n accum += remainder\n offset += remainder\n\n if ((accum % blockSize) === 0) {\n this._update(block)\n }\n }\n\n this._len += length\n return this\n}\n\nHash.prototype.digest = function (enc) {\n var rem = this._len % this._blockSize\n\n this._block[rem] = 0x80\n\n // zero (rem + 1) trailing bits, where (rem + 1) is the smallest\n // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize\n this._block.fill(0, rem + 1)\n\n if (rem >= this._finalSize) {\n this._update(this._block)\n this._block.fill(0)\n }\n\n var bits = this._len * 8\n\n // uint32\n if (bits <= 0xffffffff) {\n this._block.writeUInt32BE(bits, this._blockSize - 4)\n\n // uint64\n } else {\n var lowBits = (bits & 0xffffffff) >>> 0\n var highBits = (bits - lowBits) / 0x100000000\n\n this._block.writeUInt32BE(highBits, this._blockSize - 8)\n this._block.writeUInt32BE(lowBits, this._blockSize - 4)\n }\n\n this._update(this._block)\n var hash = this._hash()\n\n return enc ? hash.toString(enc) : hash\n}\n\nHash.prototype._update = function () {\n throw new Error('_update must be implemented by subclass')\n}\n\nmodule.exports = Hash\n","/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\n 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\n 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\n 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\n 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\n 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\n 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\n 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\n 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\n 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\n 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\n]\n\nvar W = new Array(64)\n\nfunction Sha256 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha256, Hash)\n\nSha256.prototype.init = function () {\n this._a = 0x6a09e667\n this._b = 0xbb67ae85\n this._c = 0x3c6ef372\n this._d = 0xa54ff53a\n this._e = 0x510e527f\n this._f = 0x9b05688c\n this._g = 0x1f83d9ab\n this._h = 0x5be0cd19\n\n return this\n}\n\nfunction ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)\n}\n\nfunction sigma1 (x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)\n}\n\nfunction gamma0 (x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)\n}\n\nfunction gamma1 (x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)\n}\n\nSha256.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n var f = this._f | 0\n var g = this._g | 0\n var h = this._h | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0\n\n for (var j = 0; j < 64; ++j) {\n var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0\n var T2 = (sigma0(a) + maj(a, b, c)) | 0\n\n h = g\n g = f\n f = e\n e = (d + T1) | 0\n d = c\n c = b\n b = a\n a = (T1 + T2) | 0\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n this._f = (f + this._f) | 0\n this._g = (g + this._g) | 0\n this._h = (h + this._h) | 0\n}\n\nSha256.prototype._hash = function () {\n var H = Buffer.allocUnsafe(32)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n H.writeInt32BE(this._h, 28)\n\n return H\n}\n\nmodule.exports = Sha256\n","module.exports = __WEBPACK_EXTERNAL_MODULE__7946__;","module.exports = __WEBPACK_EXTERNAL_MODULE__7417__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3983__;","module.exports = __WEBPACK_EXTERNAL_MODULE__4711__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5039__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8236__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5192__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1986__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3783__;","module.exports = __WEBPACK_EXTERNAL_MODULE__9408__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3735__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2716__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3485__;","module.exports = __WEBPACK_EXTERNAL_MODULE__79__;","module.exports = __WEBPACK_EXTERNAL_MODULE__9882__;","module.exports = __WEBPACK_EXTERNAL_MODULE__7480__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8079__;","module.exports = require(\"core-js-pure/features/object/define-property\");","module.exports = require(\"core-js-pure/features/symbol\");","module.exports = require(\"core-js-pure/features/symbol/iterator\");","module.exports = require(\"core-js-pure/features/symbol/to-primitive\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Big Number Helpers\n */\nimport BigNumber from 'bignumber.js';\n\n/**\n * Check if value is BigNumber, Number, BigInt or number string representation\n * @param number - number to check\n */\nexport const isBigNumber = (number: string | number | bigint | BigNumber): boolean => {\n if (typeof number === 'bigint') return true;\n return ['number', 'object', 'string'].includes(typeof number)\n // eslint-disable-next-line no-restricted-globals\n && (!isNaN(number as number) || Number.isInteger(number) || BigNumber.isBigNumber(number));\n};\n\n/**\n * BigNumber ceil operation\n */\nexport const ceil = (bigNumber: BigNumber): BigNumber => bigNumber\n .integerValue(BigNumber.ROUND_CEIL);\n","// eslint-disable-next-line max-classes-per-file\nimport BigNumber from 'bignumber.js';\nimport { AensName, Int } from '../tx/builder/constants';\nimport * as Encoded from './encoder-types';\n\n/**\n * aepp-sdk originated error\n * @category exception\n */\nexport abstract class BaseError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'BaseError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AccountError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AensError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AensError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AeppError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AeppError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelError';\n }\n}\n\n/**\n * @category exception\n */\nexport class CompilerError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'CompilerError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ContractError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'ContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class CryptographyError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'CryptographyError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'NodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TransactionError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'TransactionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class WalletError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'WalletError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ArgumentError extends BaseError {\n constructor(argumentName: string, requirement: unknown, argumentValue: unknown) {\n super(`${argumentName} should be ${requirement}, got ${argumentValue} instead`);\n this.name = 'ArgumentError';\n }\n}\n\n/**\n * @category exception\n */\nexport class IllegalArgumentError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'IllegalArgumentError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ArgumentCountMismatchError extends BaseError {\n constructor(functionName: string, requiredCount: number, providedCount: number) {\n super(`${functionName} expects ${requiredCount} arguments, got ${providedCount} instead`);\n this.name = 'ArgumentCountMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InsufficientBalanceError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'InsufficientBalanceError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingParamError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingParamError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NoSerializerFoundError extends BaseError {\n constructor() {\n super('Byte serialization not supported');\n this.name = 'NoSerializerFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class RequestTimedOutError extends BaseError {\n constructor(height: number) {\n super(`Giving up at height ${height}`);\n this.name = 'RequestTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TxTimedOutError extends BaseError {\n constructor(blocks: number, th: Encoded.TxHash) {\n super([\n `Giving up after ${blocks} blocks mined`,\n `transaction hash: ${th}`,\n ].join(', '));\n this.name = 'TxTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TypeError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'TypeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedPlatformError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedPlatformError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedProtocolError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedProtocolError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NotImplementedError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'NotImplementedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedVersionError extends BaseError {\n constructor(dependency: string, version: string, geVersion: string, ltVersion: string) {\n super(`Unsupported ${dependency} version ${version}. Supported: >= ${geVersion} < ${ltVersion}`);\n this.name = 'UnsupportedVersionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InternalError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'InternalError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnexpectedTsError extends InternalError {\n constructor(message = 'Expected to not happen, required for TS') {\n super(message);\n this.name = 'UnexpectedTsError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnavailableAccountError extends AccountError {\n constructor(address: Encoded.AccountAddress) {\n super(`Account for ${address} not available`);\n this.name = 'UnavailableAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AensPointerContextError extends AensError {\n constructor(nameOrId: AensName | Encoded.Name, prefix: string) {\n super(`Name ${nameOrId} don't have pointers for ${prefix}`);\n this.name = 'AensPointerContextError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InsufficientNameFeeError extends AensError {\n constructor(nameFee: BigNumber, minNameFee: BigNumber) {\n super(`the provided fee ${nameFee.toString()} is not enough to execute the claim, required: ${minNameFee.toString()}`);\n this.name = 'InsufficientNameFeeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidAensNameError extends AensError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidAensNameError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidRpcMessageError extends AeppError {\n constructor(message: string) {\n super(`Received invalid message: ${message}`);\n this.name = 'InvalidRpcMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingCallbackError extends AeppError {\n constructor(id: number) {\n super(`Can't find callback for this messageId ${id}`);\n this.name = 'MissingCallbackError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnAuthorizedAccountError extends AeppError {\n constructor(onAccount: Encoded.AccountAddress) {\n super(`You do not have access to account ${onAccount}`);\n this.name = 'UnAuthorizedAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownRpcClientError extends AeppError {\n constructor(id: string) {\n super(`RpcClient with id ${id} do not exist`);\n this.name = 'UnknownRpcClientError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsubscribedAccountError extends AeppError {\n constructor() {\n super('You are not subscribed for an account.');\n this.name = 'UnsubscribedAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelCallError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelCallError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelConnectionError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelConnectionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelPingTimedOutError extends ChannelError {\n constructor() {\n super('Server pong timed out');\n this.name = 'ChannelPingTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnexpectedChannelMessageError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'UnexpectedChannelMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelIncomingMessageError extends ChannelError {\n handlerError: BaseError;\n\n incomingMessage: { [key: string]: any };\n\n constructor(handlerError: BaseError, incomingMessage: { [key: string]: any }) {\n super(handlerError.message);\n this.handlerError = handlerError;\n this.incomingMessage = incomingMessage;\n this.name = 'ChannelIncomingMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownChannelStateError extends ChannelError {\n constructor() {\n super('State Channels FSM entered unknown state');\n this.name = 'UnknownChannelStateError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidAuthDataError extends CompilerError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidAuthDataError';\n }\n}\n\n/**\n * @category exception\n */\nexport class BytecodeMismatchError extends ContractError {\n constructor(source: 'source code' | 'bytecode') {\n super(`Contract ${source} do not correspond to the bytecode deployed on the chain`);\n this.name = 'BytecodeMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DuplicateContractError extends ContractError {\n constructor() {\n super('Contract already deployed');\n this.name = 'DuplicateContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InactiveContractError extends ContractError {\n constructor(contractAddress: Encoded.ContractAddress) {\n super(`Contract with address ${contractAddress} not active`);\n this.name = 'InactiveContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidMethodInvocationError extends ContractError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidMethodInvocationError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingContractAddressError extends ContractError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingContractAddressError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingContractDefError extends ContractError {\n constructor() {\n super('Either ACI or source code is required');\n this.name = 'MissingContractDefError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingFunctionNameError extends ContractError {\n constructor() {\n super('Function name is required');\n this.name = 'MissingFunctionNameError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeInvocationError extends ContractError {\n transaction?: Encoded.Transaction;\n\n constructor(message: string, transaction?: Encoded.Transaction) {\n super(`Invocation failed${message == null ? '' : `: \"${message}\"`}`);\n this.name = 'NodeInvocationError';\n this.transaction = transaction;\n }\n}\n\n/**\n * @category exception\n */\nexport class NoSuchContractFunctionError extends ContractError {\n constructor(name: string) {\n super(`Function ${name} doesn't exist in contract`);\n this.name = 'NoSuchContractFunctionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NotPayableFunctionError extends ContractError {\n constructor(amount: Int, fn: string) {\n super(\n `You try to pay \"${amount}\" to function \"${fn}\" which is not payable. `\n + 'Only payable function can accept coins',\n );\n this.name = 'NotPayableFunctionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingEventDefinitionError extends ContractError {\n constructor(eventNameHash: string, eventAddress: Encoded.ContractAddress) {\n super(\n `Can't find definition of ${eventNameHash} event emitted by ${eventAddress}`\n + ' (use omitUnknown option to ignore events like this)',\n );\n this.name = 'MissingEventDefinitionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AmbiguousEventDefinitionError extends ContractError {\n constructor(eventAddress: Encoded.ContractAddress, matchedEvents: Array<[string, string]>) {\n super(\n `Found multiple definitions of \"${matchedEvents[0][1]}\" event with different types emitted by`\n + ` ${eventAddress} in ${matchedEvents.map(([name]) => `\"${name}\"`).join(', ')} contracts`\n + ' (use contractAddressToName option to specify contract name corresponding to address)',\n );\n this.name = 'AmbiguousEventDefinitionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidChecksumError extends CryptographyError {\n constructor() {\n super('Invalid checksum');\n this.name = 'InvalidChecksumError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidPasswordError extends CryptographyError {\n constructor() {\n super('Invalid password or nonce');\n this.name = 'InvalidPasswordError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MerkleTreeHashMismatchError extends CryptographyError {\n constructor() {\n super('Node hash is not equal to provided one');\n this.name = 'MerkleTreeHashMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingNodeInTreeError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingNodeInTreeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownNodeLengthError extends CryptographyError {\n constructor(nodeLength: number) {\n super(`Unknown node length: ${nodeLength}`);\n this.name = 'UnknownNodeLengthError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownPathNibbleError extends CryptographyError {\n constructor(nibble: number) {\n super(`Unknown path nibble: ${nibble}`);\n this.name = 'UnknownPathNibbleError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DuplicateNodeError extends NodeError {\n constructor(name: string) {\n super(`Node with name ${name} already exist`);\n this.name = 'DuplicateNodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeNotFoundError extends NodeError {\n constructor(message: string) {\n super(message);\n this.name = 'NodeNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DecodeError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'DecodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class PayloadLengthError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'PayloadLengthError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DryRunError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'DryRunError';\n }\n}\n\n/**\n * @category exception\n */\nexport class IllegalBidFeeError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'IllegalBidFeeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidSignatureError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidSignatureError';\n }\n}\n\n/**\n * @category exception\n */\nexport class PrefixNotFoundError extends TransactionError {\n constructor(tag: number) {\n super(`Prefix for id-tag ${tag} not found.`);\n this.name = 'PrefixNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class SchemaNotFoundError extends TransactionError {\n constructor(key: string, version: number) {\n super(`Transaction schema not implemented for tag ${key} version ${version}`);\n this.name = 'SchemaNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TagNotFoundError extends TransactionError {\n constructor(prefix: string) {\n super(`Id tag for prefix ${prefix} not found.`);\n this.name = 'DecodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TxNotInChainError extends TransactionError {\n constructor(txHash: Encoded.TxHash) {\n super(`Transaction ${txHash} is removed from chain`);\n this.name = 'TxNotInChainError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AlreadyConnectedError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'AlreadyConnectedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NoWalletConnectedError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'NoWalletConnectedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class RpcConnectionError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'RpcConnectionError';\n }\n}\n","import BigNumber from 'bignumber.js';\nimport { isBigNumber } from './bignumber';\nimport { ArgumentError } from './errors';\n\nexport enum AE_AMOUNT_FORMATS {\n AE = 'ae',\n MILI_AE = 'miliAE',\n MICRO_AE = 'microAE',\n NANO_AE = 'nanoAE',\n PICO_AE = 'picoAE',\n FEMTO_AE = 'femtoAE',\n AETTOS = 'aettos',\n}\n\n/**\n * DENOMINATION_MAGNITUDE\n */\nconst DENOMINATION_MAGNITUDE = {\n [AE_AMOUNT_FORMATS.AE]: 0,\n [AE_AMOUNT_FORMATS.MILI_AE]: -3,\n [AE_AMOUNT_FORMATS.MICRO_AE]: -6,\n [AE_AMOUNT_FORMATS.NANO_AE]: -9,\n [AE_AMOUNT_FORMATS.PICO_AE]: -12,\n [AE_AMOUNT_FORMATS.FEMTO_AE]: -15,\n [AE_AMOUNT_FORMATS.AETTOS]: -18,\n} as const;\n\n/**\n * Convert amount from one to other denomination\n * @param value - amount to convert\n * @param options - options\n * @param options.denomination - denomination of amount, can be ['ae', 'aettos']\n * @param options.targetDenomination - target denomination,\n * can be ['ae', 'aettos']\n */\nexport const formatAmount = (\n value: string | number | bigint | BigNumber,\n { denomination = AE_AMOUNT_FORMATS.AETTOS, targetDenomination = AE_AMOUNT_FORMATS.AETTOS }:\n { denomination?: AE_AMOUNT_FORMATS; targetDenomination?: AE_AMOUNT_FORMATS },\n): string => {\n if (!isBigNumber(value)) throw new ArgumentError('value', 'a number', value);\n\n return new BigNumber(typeof value === 'bigint' ? value.toString() : value)\n .shiftedBy(DENOMINATION_MAGNITUDE[denomination] - DENOMINATION_MAGNITUDE[targetDenomination])\n .toFixed();\n};\n\n/**\n * Convert amount to AE\n * @param value - amount to convert\n * @param options - options\n * @param options.denomination - denomination of amount, can be ['ae', 'aettos']\n */\nexport const toAe = (\n value: string | number | BigNumber,\n { denomination = AE_AMOUNT_FORMATS.AETTOS }: { denomination?: AE_AMOUNT_FORMATS } = {},\n): string => formatAmount(value, { denomination, targetDenomination: AE_AMOUNT_FORMATS.AE });\n\n/**\n * Convert amount to aettos\n * @param value - amount to convert\n * @param options - options\n * @param options.denomination - denomination of amount, can be ['ae', 'aettos']\n */\nexport const toAettos = (\n value: string | number | BigNumber,\n { denomination = AE_AMOUNT_FORMATS.AE }: { denomination?: AE_AMOUNT_FORMATS } = {},\n): string => formatAmount(value, { denomination });\n\ninterface Prefix {\n name: string;\n magnitude: number;\n}\n\nconst prefixes: Prefix[] = [\n { name: 'exa', magnitude: 18 },\n { name: 'giga', magnitude: 9 },\n { name: '', magnitude: 0 },\n { name: 'pico', magnitude: -12 },\n];\n\nconst getNearestPrefix = (exponent: number): Prefix => prefixes.reduce((p, n) => (\n Math.abs(n.magnitude - exponent) < Math.abs(p.magnitude - exponent) ? n : p));\n\nconst getLowerBoundPrefix = (exponent: number): Prefix => prefixes\n .find((p) => p.magnitude <= exponent) ?? prefixes[prefixes.length - 1];\n\nexport default (rawValue: string | number | BigNumber): string => {\n const value: BigNumber = new BigNumber(rawValue);\n\n const exp = value.e ?? 0;\n const { name, magnitude } = (exp < 0 ? getNearestPrefix : getLowerBoundPrefix)(exp);\n const v = value\n .shiftedBy(-magnitude)\n .precision(9 + Math.min(exp - magnitude, 0))\n .toFixed();\n return `${v}${name !== '' ? ' ' : ''}${name}`;\n};\n","import { RestError } from '@azure/core-rest-pipeline';\n\nexport const pause = async (duration: number): Promise<void> => new Promise((resolve) => {\n setTimeout(resolve, duration);\n});\n\nexport const mapObject = <InputV, OutputV>(\n object: { [k: string]: InputV },\n fn: (\n value: [string, InputV], index: number, array: Array<[string, InputV]>\n ) => [number | string, OutputV],\n): { [k: string]: OutputV } => Object.fromEntries(Object.entries(object).map(fn));\n\n// remove after dropping webpack4 support\nconst isWebpack4Buffer = (() => {\n try {\n Buffer.concat([Uint8Array.from([])]);\n return false;\n } catch (error) {\n return true;\n }\n})();\n\nexport const concatBuffers = isWebpack4Buffer\n ? (list: readonly Uint8Array[], totalLength?: number): Buffer => (\n Buffer.concat(list.map((el) => Buffer.from(el)), totalLength)\n )\n : Buffer.concat;\n\n/**\n * Object key type guard\n * @param key - Maybe object key\n * @param object - Object\n */\nexport function isKeyOfObject<T extends object>(\n key: string | number | symbol,\n object: T,\n): key is keyof T {\n return key in object;\n}\n\n/**\n * Array item type guard\n * @param item - Maybe array item\n * @param array - Array\n */\nexport function isItemOfArray<T>(item: any, array: readonly T[]): item is T {\n return array.includes(item);\n}\n\nexport function isAccountNotFoundError(error: Error): boolean {\n return error instanceof RestError && error.statusCode === 404\n && error.message.includes('Account not found');\n}\n\n// based on https://stackoverflow.com/a/50375286/6176994\nexport type UnionToIntersection<Union> =\n (Union extends any ? (k: Union) => void : never) extends ((k: infer Intersection) => void)\n ? Intersection : never;\n","/**\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/master/node/api/api_encoding.md}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L205-L230}\n */\nexport enum Encoding {\n KeyBlockHash = 'kh',\n MicroBlockHash = 'mh',\n BlockPofHash = 'bf',\n BlockTxHash = 'bx',\n BlockStateHash = 'bs',\n Channel = 'ch',\n ContractAddress = 'ct',\n ContractBytearray = 'cb',\n ContractStoreKey = 'ck',\n ContractStoreValue = 'cv',\n Transaction = 'tx',\n TxHash = 'th',\n OracleAddress = 'ok',\n OracleQuery = 'ov',\n OracleQueryId = 'oq',\n OracleResponse = 'or',\n AccountAddress = 'ak',\n Signature = 'sg',\n Commitment = 'cm',\n PeerPubkey = 'pp',\n Name = 'nm',\n State = 'st',\n Poi = 'pi',\n StateTrees = 'ss',\n CallStateTree = 'cs',\n Bytearray = 'ba',\n}\n\nexport type KeyBlockHash = `${Encoding.KeyBlockHash}_${string}`;\nexport type MicroBlockHash = `${Encoding.MicroBlockHash}_${string}`;\nexport type BlockPofHash = `${Encoding.BlockPofHash}_${string}`;\nexport type BlockTxHash = `${Encoding.BlockTxHash}_${string}`;\nexport type BlockStateHash = `${Encoding.BlockStateHash}_${string}`;\nexport type Channel = `${Encoding.Channel}_${string}`;\nexport type ContractAddress = `${Encoding.ContractAddress}_${string}`;\nexport type ContractBytearray = `${Encoding.ContractBytearray}_${string}`;\nexport type ContractStoreKey = `${Encoding.ContractStoreKey}_${string}`;\nexport type ContractStoreValue = `${Encoding.ContractStoreValue}_${string}`;\nexport type Transaction = `${Encoding.Transaction}_${string}`;\nexport type TxHash = `${Encoding.TxHash}_${string}`;\nexport type OracleAddress = `${Encoding.OracleAddress}_${string}`;\nexport type OracleQuery = `${Encoding.OracleQuery}_${string}`;\nexport type OracleQueryId = `${Encoding.OracleQueryId}_${string}`;\nexport type OracleResponse = `${Encoding.OracleResponse}_${string}`;\nexport type AccountAddress = `${Encoding.AccountAddress}_${string}`;\nexport type Signature = `${Encoding.Signature}_${string}`;\nexport type Commitment = `${Encoding.Commitment}_${string}`;\nexport type PeerPubkey = `${Encoding.PeerPubkey}_${string}`;\nexport type Name = `${Encoding.Name}_${string}`;\nexport type State = `${Encoding.State}_${string}`;\nexport type Poi = `${Encoding.Poi}_${string}`;\nexport type StateTrees = `${Encoding.StateTrees}_${string}`;\nexport type CallStateTree = `${Encoding.CallStateTree}_${string}`;\nexport type Bytearray = `${Encoding.Bytearray}_${string}`;\n\nexport type Generic<Type extends Encoding> = `${Type}_${string}`;\nexport type Any = `${Encoding}_${string}`;\n","import { encode as bs58Encode, decode as bs58Decode } from 'bs58';\n// js extension is required for mjs build, not importing the whole package to reduce bundle size\n// eslint-disable-next-line import/extensions\nimport Sha256 from 'sha.js/sha256.js';\nimport {\n DecodeError,\n ArgumentError,\n InvalidChecksumError,\n PayloadLengthError,\n} from './errors';\nimport { concatBuffers, isKeyOfObject } from './other';\nimport * as Encoded from './encoder-types';\nimport { Encoding } from './encoder-types';\n\nexport { Encoded, Encoding };\n\n/**\n * Calculate SHA256 hash of `input`\n * @param input - Data to hash\n * @returns Hash\n */\nexport function sha256hash(input: Uint8Array | string): Buffer {\n return new Sha256().update(input).digest();\n}\n\n/**\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L177-L202}\n */\nconst base64Types = [\n Encoding.ContractBytearray,\n Encoding.ContractStoreKey,\n Encoding.ContractStoreValue,\n Encoding.Transaction,\n Encoding.OracleQuery,\n Encoding.OracleResponse,\n Encoding.State,\n Encoding.Poi,\n Encoding.StateTrees,\n Encoding.CallStateTree,\n Encoding.Bytearray,\n] as const;\nconst base58Types = [\n Encoding.KeyBlockHash,\n Encoding.MicroBlockHash,\n Encoding.BlockPofHash,\n Encoding.BlockTxHash,\n Encoding.BlockStateHash,\n Encoding.Channel,\n Encoding.ContractAddress,\n Encoding.TxHash,\n Encoding.OracleAddress,\n Encoding.OracleQueryId,\n Encoding.AccountAddress,\n Encoding.Signature,\n Encoding.Commitment,\n Encoding.PeerPubkey,\n Encoding.Name,\n] as const;\n\n/**\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L261-L286}\n */\nconst byteSizeForType = {\n [Encoding.KeyBlockHash]: 32,\n [Encoding.MicroBlockHash]: 32,\n [Encoding.BlockPofHash]: 32,\n [Encoding.BlockTxHash]: 32,\n [Encoding.BlockStateHash]: 32,\n [Encoding.Channel]: 32,\n [Encoding.ContractAddress]: 32,\n [Encoding.TxHash]: 32,\n [Encoding.OracleAddress]: 32,\n [Encoding.OracleQueryId]: 32,\n [Encoding.AccountAddress]: 32,\n [Encoding.Signature]: 64,\n [Encoding.Commitment]: 32,\n [Encoding.PeerPubkey]: 32,\n [Encoding.State]: 32,\n} as const;\n\nfunction ensureValidLength(data: Uint8Array, type: Encoding): void {\n if (!isKeyOfObject(type, byteSizeForType)) return;\n const reqLen = byteSizeForType[type];\n if (reqLen == null || data.length === reqLen) return;\n throw new PayloadLengthError(`Payload should be ${reqLen} bytes, got ${data.length} instead`);\n}\n\nconst getChecksum = (payload: Uint8Array): Buffer => sha256hash(sha256hash(payload)).slice(0, 4);\n\nconst addChecksum = (payload: Uint8Array): Buffer => concatBuffers([payload, getChecksum(payload)]);\n\nfunction getPayload(buffer: Buffer): Buffer {\n const payload = buffer.slice(0, -4);\n if (!getChecksum(payload).equals(buffer.slice(-4))) throw new InvalidChecksumError();\n return payload;\n}\n\nconst base64 = {\n encode: (buffer: Uint8Array) => addChecksum(buffer).toString('base64'),\n decode: (string: string) => getPayload(Buffer.from(string, 'base64')),\n};\n\nconst base58 = {\n encode: (buffer: Uint8Array) => bs58Encode(addChecksum(buffer)),\n decode: (string: string) => getPayload(Buffer.from(bs58Decode(string))),\n};\n\nconst parseType = (maybeType: unknown): [Encoding, typeof base64] => {\n const base64Type = base64Types.find((t) => t === maybeType);\n if (base64Type != null) return [base64Type, base64];\n const base58Type = base58Types.find((t) => t === maybeType);\n if (base58Type != null) return [base58Type, base58];\n throw new ArgumentError('prefix', `one of ${[...base58Types, ...base64Types].join(', ')}`, maybeType);\n};\n\n/**\n * Decode data using the default encoding/decoding algorithm\n * @param data - An Base58/64check encoded and prefixed string\n * (ex tx_..., sg_..., ak_....)\n * @returns Decoded data\n */\nexport function decode(data: Encoded.Any): Buffer {\n const [prefix, encodedPayload, extra] = data.split('_');\n if (encodedPayload == null) throw new DecodeError(`Encoded string missing payload: ${data}`);\n if (extra != null) throw new DecodeError(`Encoded string have extra parts: ${data}`);\n const [type, encoder] = parseType(prefix);\n const payload = encoder.decode(encodedPayload);\n ensureValidLength(payload, type);\n return payload;\n}\n\n/**\n * Encode data using the default encoding/decoding algorithm\n * @param data - An decoded data\n * @param type - Prefix of Transaction\n * @returns Encoded string Base58check or Base64check data\n */\nexport function encode<Type extends Encoding>(\n data: Uint8Array,\n type: Type,\n): Encoded.Generic<Type> {\n const [, encoder] = parseType(type);\n ensureValidLength(data, type);\n return `${type}_${encoder.encode(data)}`;\n}\n","import nacl, { SignKeyPair } from 'tweetnacl';\n// js extension is required for mjs build, not importing the whole package to reduce bundle size\n// eslint-disable-next-line import/extensions\nimport { blake2b } from 'blakejs/blake2b.js';\nimport { encode as varuintEncode } from 'varuint-bitcoin';\n\nimport { concatBuffers } from './other';\nimport {\n decode, encode, Encoded, Encoding,\n} from './encoder';\n\n/**\n * Generate address from secret key\n * @param secret - Private key as hex string\n * @returns Public key encoded as address\n */\nexport function getAddressFromPriv(secret: string | Uint8Array): Encoded.AccountAddress {\n const secretBuffer = typeof secret === 'string' ? Buffer.from(secret, 'hex') : secret;\n const keys = nacl.sign.keyPair.fromSecretKey(secretBuffer);\n return encode(keys.publicKey, Encoding.AccountAddress);\n}\n\n/**\n * Check if address is valid\n * @param address - Address\n * @param prefix - Transaction prefix. Default: 'ak'\n * @returns is valid\n */\nexport function isAddressValid(\n address: string,\n prefix: Encoding = Encoding.AccountAddress,\n): boolean {\n try {\n decode(address as Encoded.Generic<typeof prefix>);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Generate a random salt (positive integer)\n * @returns random salt\n */\nexport function genSalt(): number {\n const [random] = new BigUint64Array(nacl.randomBytes(8).buffer);\n return Number(random % BigInt(Number.MAX_SAFE_INTEGER));\n}\n\n/**\n * Converts a positive integer to the smallest possible\n * representation in a binary digit representation\n * @param value - Value to encode\n * @returns Encoded number\n */\nexport function encodeUnsigned(value: number): Buffer {\n const binary = Buffer.allocUnsafe(4);\n binary.writeUInt32BE(value);\n return binary.slice(binary.findIndex((i) => i !== 0));\n}\n\n/**\n * Calculate 256bits Blake2b hash of `input`\n * @param input - Data to hash\n * @returns Hash\n */\nexport function hash(input: string | Uint8Array): Buffer {\n return Buffer.from(blake2b(input, undefined, 32)); // 256 bits\n}\n\n// Todo Duplicated in tx builder. remove\n/**\n * Compute contract address\n * @category contract\n * @param owner - Address of contract owner\n * @param nonce - Round when contract was created\n * @returns Contract address\n */\nexport function encodeContractAddress(\n owner: Encoded.AccountAddress,\n nonce: number,\n): Encoded.ContractAddress {\n const publicKey = decode(owner);\n const binary = concatBuffers([publicKey, encodeUnsigned(nonce)]);\n return encode(hash(binary), Encoding.ContractAddress);\n}\n\n// KEY-PAIR HELPERS\n\n/**\n * Generate keyPair from secret key\n * @param secret - secret key\n * @returns Object with Private(privateKey) and Public(publicKey) keys\n */\nexport function generateKeyPairFromSecret(secret: Uint8Array): SignKeyPair {\n return nacl.sign.keyPair.fromSecretKey(secret);\n}\n\n/**\n * Generate a random ED25519 keypair\n * @param raw - Whether to return raw (binary) keys\n * @returns Key pair\n */\nexport function generateKeyPair(raw: true): { publicKey: Buffer; secretKey: Buffer };\nexport function generateKeyPair(raw?: false): {\n publicKey: Encoded.AccountAddress; secretKey: string;\n};\nexport function generateKeyPair(raw = false): {\n publicKey: Encoded.AccountAddress | Buffer;\n secretKey: string | Buffer;\n} {\n const keyPair = nacl.sign.keyPair();\n const publicBuffer = Buffer.from(keyPair.publicKey);\n const secretBuffer = Buffer.from(keyPair.secretKey);\n\n if (raw) {\n return {\n publicKey: publicBuffer,\n secretKey: secretBuffer,\n };\n }\n return {\n publicKey: encode(publicBuffer, Encoding.AccountAddress),\n secretKey: secretBuffer.toString('hex'),\n };\n}\n\n// SIGNATURES\n\n/**\n * Generate signature\n * @param data - Data to sign\n * @param privateKey - Key to sign with\n * @returns Signature\n */\nexport function sign(data: string | Uint8Array, privateKey: string | Uint8Array): Uint8Array {\n return nacl.sign.detached(Buffer.from(data), Buffer.from(privateKey));\n}\n\n/**\n * Verify that signature was signed by public key\n * @param data - Data that was signed\n * @param signature - Signature of data\n * @param address - Address to verify against\n * @returns is data was signed by address\n */\nexport function verify(\n data: Uint8Array,\n signature: Uint8Array,\n address: Encoded.AccountAddress,\n): boolean {\n return nacl.sign.detached.verify(data, signature, decode(address));\n}\n\nexport function messageToHash(message: string): Buffer {\n const p = Buffer.from('aeternity Signed Message:\\n', 'utf8');\n const msg = Buffer.from(message, 'utf8');\n return hash(concatBuffers([varuintEncode(p.length), p, varuintEncode(msg.length), msg]));\n}\n\nexport function signMessage(message: string, privateKey: string | Buffer): Uint8Array {\n return sign(messageToHash(message), privateKey);\n}\n\n/**\n * Verify that message was signed by address\n * @param message - Message that was signed\n * @param signature - Signature of message\n * @param address - Address to verify against\n * @returns is data was signed by address\n */\nexport function verifyMessage(\n message: string,\n signature: Uint8Array,\n address: Encoded.AccountAddress,\n): boolean {\n return verify(messageToHash(message), signature, address);\n}\n\n/**\n * Check key pair for validity\n *\n * Sign a message, and then verifying that signature\n * @param privateKey - Private key to verify\n * @param publicKey - Public key to verify as hex string\n * @returns Valid?\n */\nexport function isValidKeypair(\n privateKey: string | Uint8Array,\n publicKey: string | Uint8Array,\n): boolean {\n const message = Buffer.from('TheMessage');\n const signature = sign(message, privateKey);\n const publicKeyBuffer = typeof publicKey === 'string' ? Buffer.from(publicKey, 'hex') : publicKey;\n return verify(message, signature, encode(publicKeyBuffer, Encoding.AccountAddress));\n}\n","import BigNumber from 'bignumber.js';\nimport { mapObject } from '../../utils/other';\n\nexport const MAX_AUTH_FUN_GAS = 50000;\nexport type Int = number | string | BigNumber;\n// # AENS\nexport type AensName = `${string}.chain`;\nexport const NAME_TTL = 180000;\n// # max number of block into the future that the name is going to be available\n// # https://github.com/aeternity/protocol/blob/epoch-v0.22.0/AENS.md#update\n// # https://github.com/aeternity/protocol/blob/44a93d3aab957ca820183c3520b9daf6b0fedff4/AENS.md#aens-entry\nexport const NAME_MAX_TTL = 36000;\nexport const NAME_MAX_CLIENT_TTL = 84600;\nexport const CLIENT_TTL = NAME_MAX_CLIENT_TTL;\nexport const MIN_GAS_PRICE = 1e9;\n// # see https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L67\nexport const NAME_FEE_MULTIPLIER = 1e14; // 100000000000000\nexport const NAME_FEE_BID_INCREMENT = 0.05; // # the increment is in percentage\n// # see https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L272\nexport const NAME_BID_TIMEOUT_BLOCKS = 480; // # ~1 day\n// # this is the max length for a domain that requires a base fee to be paid\nexport const NAME_MAX_LENGTH_FEE = 31;\nexport const NAME_BID_MAX_LENGTH = 12; // # this is the max length for a domain to be part of a bid\n// # https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L290\n// # https://github.com/aeternity/protocol/blob/master/AENS.md#protocol-fees-and-protection-times\n// # bid ranges:\nexport const NAME_BID_RANGES = mapObject({\n 31: 3,\n 30: 5,\n 29: 8,\n 28: 13,\n 27: 21,\n 26: 34,\n 25: 55,\n 24: 89,\n 23: 144,\n 22: 233,\n 21: 377,\n 20: 610,\n 19: 987,\n 18: 1597,\n 17: 2584,\n 16: 4181,\n 15: 6765,\n 14: 10946,\n 13: 17711,\n 12: 28657,\n 11: 46368,\n 10: 75025,\n 9: 121393,\n 8: 196418,\n 7: 317811,\n 6: 514229,\n 5: 832040,\n 4: 1346269,\n 3: 2178309,\n 2: 3524578,\n 1: 5702887,\n}, ([key, value]) => [key, new BigNumber(value).times(NAME_FEE_MULTIPLIER)]);\n\nexport enum ConsensusProtocolVersion {\n Iris = 5,\n Ceres = 6,\n}\n\n/**\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}\n */\nexport enum VmVersion {\n NoVm = 0,\n Sophia = 1,\n SophiaImprovementsMinerva = 3,\n SophiaImprovementsFortuna = 4,\n Fate = 5,\n SophiaImprovementsLima = 6,\n Fate2 = 7,\n}\n\n/**\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}\n */\nexport enum AbiVersion {\n NoAbi = 0,\n Sophia = 1,\n Fate = 3,\n}\n\n/**\n * Enum with tag types\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/serializations.md#binary-serialization}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_chain_objects.erl#L39-L97}\n */\n// TODO: implement serialisation for commented-out tags\nexport enum Tag {\n Account = 10,\n SignedTx = 11,\n SpendTx = 12,\n Oracle = 20,\n // OracleQuery = 21,\n OracleRegisterTx = 22,\n OracleQueryTx = 23,\n OracleResponseTx = 24,\n OracleExtendTx = 25,\n Name = 30,\n // NameCommitment = 31,\n NameClaimTx = 32,\n NamePreclaimTx = 33,\n NameUpdateTx = 34,\n NameRevokeTx = 35,\n NameTransferTx = 36,\n // NameAuction = 37,\n Contract = 40,\n ContractCall = 41,\n ContractCreateTx = 42,\n ContractCallTx = 43,\n ChannelCreateTx = 50,\n // ChannelSetDelegatesTx = 501,\n ChannelDepositTx = 51,\n ChannelWithdrawTx = 52,\n ChannelForceProgressTx = 521,\n ChannelCloseMutualTx = 53,\n ChannelCloseSoloTx = 54,\n ChannelSlashTx = 55,\n ChannelSettleTx = 56,\n ChannelOffChainTx = 57,\n ChannelOffChainUpdateTransfer = 570,\n ChannelOffChainUpdateDeposit = 571,\n ChannelOffChainUpdateWithdraw = 572,\n ChannelOffChainUpdateCreateContract = 573,\n ChannelOffChainUpdateCallContract = 574,\n // ChannelOffChainUpdateMeta = 576,\n ChannelClientReconnectTx = 575,\n Channel = 58,\n ChannelSnapshotSoloTx = 59,\n TreesPoi = 60,\n // TreesDb = 61,\n StateTrees = 62,\n Mtree = 63,\n MtreeValue = 64,\n ContractsMtree = 621,\n CallsMtree = 622,\n ChannelsMtree = 623,\n NameserviceMtree = 624,\n OraclesMtree = 625,\n AccountsMtree = 626,\n // CompilerSophia = 70,\n GaAttachTx = 80,\n GaMetaTx = 81,\n PayingForTx = 82,\n GaMetaTxAuthData = 810,\n // KeyBlock = 100,\n // MicroBlock = 101,\n // LightMicroBlock = 102,\n // Pof = 200,\n}\n","import { ConsensusProtocolVersion, VmVersion, AbiVersion } from '../constants';\nimport Node from '../../../Node';\n\n/*\n * First abi/vm by default\n * @see {@link https://github.com/aeternity/protocol/blob/71cf111/contracts/contract_vms.md#virtual-machines-on-the-æternity-blockchain}\n */\nexport const ProtocolToVmAbi = {\n [ConsensusProtocolVersion.Iris]: {\n 'contract-create': {\n vmVersion: [VmVersion.Fate2], abiVersion: [AbiVersion.Fate],\n },\n 'contract-call': {\n vmVersion: [], abiVersion: [AbiVersion.Fate, AbiVersion.Sophia],\n },\n 'oracle-call': {\n vmVersion: [], abiVersion: [AbiVersion.NoAbi, AbiVersion.Fate],\n },\n },\n [ConsensusProtocolVersion.Ceres]: {\n 'contract-create': {\n vmVersion: [VmVersion.Fate2], abiVersion: [AbiVersion.Fate],\n },\n 'contract-call': {\n vmVersion: [], abiVersion: [AbiVersion.Fate],\n },\n 'oracle-call': {\n vmVersion: [], abiVersion: [AbiVersion.NoAbi, AbiVersion.Fate],\n },\n },\n} as const;\n\nexport interface CtVersion {\n vmVersion: VmVersion;\n abiVersion: AbiVersion;\n}\n\nexport function getProtocolDetails(\n protocolVersion: ConsensusProtocolVersion,\n type: 'contract-create' | 'contract-call' | 'oracle-call',\n): CtVersion {\n const protocol = ProtocolToVmAbi[protocolVersion][type];\n return {\n vmVersion: protocol.vmVersion[0] ?? VmVersion.Fate2,\n abiVersion: protocol.abiVersion[0],\n };\n}\n\nexport default {\n serialize(\n value: CtVersion | undefined,\n params: {},\n { consensusProtocolVersion = ConsensusProtocolVersion.Iris }:\n { consensusProtocolVersion?: ConsensusProtocolVersion },\n ): Buffer {\n value ??= getProtocolDetails(consensusProtocolVersion, 'contract-create');\n\n return Buffer.from([value.vmVersion, 0, value.abiVersion]);\n },\n\n async prepare(\n value: CtVersion | undefined,\n params: {},\n // TODO: { consensusProtocolVersion: ConsensusProtocolVersion } | { onNode: Node } | {}\n options: { consensusProtocolVersion?: ConsensusProtocolVersion; onNode?: Node },\n ): Promise<CtVersion | undefined> {\n if (value != null) return value;\n if (options.consensusProtocolVersion != null) return undefined;\n if (Object.keys(ConsensusProtocolVersion).length === 2) return undefined;\n if (options.onNode != null) {\n return getProtocolDetails(\n (await options.onNode.getNodeInfo()).consensusProtocolVersion,\n 'contract-create',\n );\n }\n return undefined;\n },\n\n deserialize(buffer: Buffer): CtVersion {\n const [vm, , abi] = buffer;\n return { vmVersion: +vm, abiVersion: +abi };\n },\n};\n","import { Tag, ConsensusProtocolVersion, AbiVersion } from '../constants';\nimport { getProtocolDetails } from './ct-version';\nimport Node from '../../../Node';\n\nexport default {\n _getProtocolDetails(c: ConsensusProtocolVersion, tag: Tag): AbiVersion {\n const kind = Tag.ContractCallTx === tag || Tag.GaMetaTx === tag\n ? 'contract-call' : 'oracle-call';\n return getProtocolDetails(c, kind).abiVersion;\n },\n\n serialize(\n value: AbiVersion | undefined,\n { tag }: { tag: Tag },\n { consensusProtocolVersion = ConsensusProtocolVersion.Iris }:\n { consensusProtocolVersion?: ConsensusProtocolVersion },\n ): Buffer {\n const result = value ?? this._getProtocolDetails(consensusProtocolVersion, tag);\n\n return Buffer.from([result]);\n },\n\n async prepare(\n value: AbiVersion | undefined,\n { tag }: { tag: Tag },\n // TODO: { consensusProtocolVersion: ConsensusProtocolVersion } | { onNode: Node } | {}\n options: { consensusProtocolVersion?: ConsensusProtocolVersion; onNode?: Node },\n ): Promise<AbiVersion | undefined> {\n if (value != null) return value;\n if (options.consensusProtocolVersion != null) return undefined;\n if (Object.keys(ConsensusProtocolVersion).length === 2) return undefined;\n if (options.onNode != null) {\n return this._getProtocolDetails(\n (await options.onNode.getNodeInfo()).consensusProtocolVersion,\n tag,\n );\n }\n return undefined;\n },\n\n deserialize(buffer: Buffer): AbiVersion {\n return buffer[0];\n },\n};\n","import BigNumber from 'bignumber.js';\nimport { NoSerializerFoundError, TypeError } from './errors';\n\n/**\n * Convert string, number, or BigNumber to byte array\n * @param val - value to convert\n * @param big - enables force conversion to BigNumber\n * @returns Buffer\n */\n// eslint-disable-next-line import/prefer-default-export\nexport function toBytes(val?: null | string | number | BigNumber, big = false): Buffer {\n // Encode a value to bytes.\n // If the value is an int it will be encoded as bytes big endian\n // Raises ValueError if the input is not an int or string\n\n if (val == null) return Buffer.from([]);\n if (Number.isInteger(val) || BigNumber.isBigNumber(val) || big) {\n if (!BigNumber.isBigNumber(val)) val = new BigNumber(val);\n if (!val.isInteger()) throw new TypeError(`Unexpected not integer value: ${val.toFixed()}`);\n let hexString = val.toString(16);\n if (hexString.length % 2 === 1) hexString = `0${hexString}`;\n return Buffer.from(hexString, 'hex');\n }\n if (typeof val === 'string') {\n return Buffer.from(val);\n }\n throw new NoSerializerFoundError();\n}\n","import { ArgumentError, PrefixNotFoundError, TagNotFoundError } from '../../../utils/errors';\nimport { toBytes } from '../../../utils/bytes';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../../utils/encoder';\nimport { isItemOfArray } from '../../../utils/other';\n\n/**\n * Map of prefix to ID tag constant\n * @see {@link https://github.com/aeternity/protocol/blob/master/serializations.md#the-id-type}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_id.erl#L97-L102}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L163-L168}\n */\nexport const idTagToEncoding = [\n Encoding.AccountAddress,\n Encoding.Name,\n Encoding.Commitment,\n Encoding.OracleAddress,\n Encoding.ContractAddress,\n Encoding.Channel,\n] as const;\n\nexport type AddressEncodings = typeof idTagToEncoding[number];\n\nexport default function genAddressField<Encoding extends AddressEncodings>(\n ...encodings: Encoding[]\n): {\n serialize: (value: Encoded.Generic<Encoding>) => Buffer;\n deserialize: (value: Buffer) => Encoded.Generic<Encoding>;\n } {\n return {\n /**\n * Utility function to create and _id type\n * @param hashId - Encoded hash\n * @returns Buffer Buffer with ID tag and decoded HASh\n */\n serialize(hashId) {\n const enc = hashId.slice(0, 2);\n if (!isItemOfArray(enc, idTagToEncoding)) throw new TagNotFoundError(enc);\n if (!isItemOfArray(enc, encodings)) {\n throw new ArgumentError('Address encoding', encodings.join(', '), enc);\n }\n const idTag = idTagToEncoding.indexOf(enc) + 1;\n return Buffer.from([...toBytes(idTag), ...decode(hashId)]);\n },\n\n /**\n * Utility function to read and _id type\n * @param buf - Data\n * @returns Encoded hash string with prefix\n */\n deserialize(buf) {\n const idTag = Buffer.from(buf).readUIntBE(0, 1);\n const enc = idTagToEncoding[idTag - 1];\n if (enc == null) throw new PrefixNotFoundError(idTag);\n if (!isItemOfArray(enc, encodings)) {\n throw new ArgumentError('Address encoding', encodings.join(', '), enc);\n }\n return encode(buf.subarray(1), enc) as Encoded.Generic<Encoding>;\n },\n };\n}\n","export default {\n serialize(value: boolean): Buffer {\n return Buffer.from([value ? 1 : 0]);\n },\n\n deserialize(buffer: Buffer): boolean {\n return buffer[0] === 1;\n },\n};\n","import BigNumber from 'bignumber.js';\nimport { genSalt, hash } from '../../utils/crypto';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../utils/encoder';\nimport { toBytes } from '../../utils/bytes';\nimport { concatBuffers } from '../../utils/other';\nimport {\n AensName,\n NAME_BID_RANGES,\n NAME_BID_TIMEOUT_BLOCKS,\n NAME_FEE_BID_INCREMENT,\n NAME_MAX_LENGTH_FEE,\n} from './constants';\nimport { ceil } from '../../utils/bignumber';\nimport { ArgumentError, IllegalBidFeeError } from '../../utils/errors';\n\n/**\n * JavaScript-based Transaction builder helper function's\n */\n\n/**\n * Build a contract public key\n * @category contract\n * @param ownerId - The public key of the owner account\n * @param nonce - the nonce of the transaction\n * @returns Contract public key\n */\nexport function buildContractId(\n ownerId: Encoded.AccountAddress,\n nonce: number | BigNumber,\n): Encoded.ContractAddress {\n const ownerIdAndNonce = Buffer.from([...decode(ownerId), ...toBytes(nonce)]);\n const b2bHash = hash(ownerIdAndNonce);\n return encode(b2bHash, Encoding.ContractAddress);\n}\n\n/**\n * Build a oracle query id\n * @category oracle\n * @param senderId - The public key of the sender account\n * @param nonce - the nonce of the transaction\n * @param oracleId - The oracle public key\n * @returns Contract public key\n */\nexport function oracleQueryId(\n senderId: Encoded.AccountAddress,\n nonce: number | BigNumber | string,\n oracleId: Encoded.OracleAddress,\n): Encoded.OracleQueryId {\n function _int32(val: number | string | BigNumber): Buffer {\n const nonceBE = toBytes(val, true);\n return concatBuffers([Buffer.alloc(32 - nonceBE.length), nonceBE]);\n }\n\n const b2bHash = hash(\n Buffer.from([...decode(senderId), ..._int32(nonce), ...decode(oracleId)]),\n );\n return encode(b2bHash, Encoding.OracleQueryId);\n}\n\n/**\n * Encode an AENS name\n * @category AENS\n * @param name - Name to encode\n * @returns `nm_` prefixed encoded AENS name\n */\nexport function produceNameId(name: AensName): Encoded.Name {\n return encode(hash(name.toLowerCase()), Encoding.Name);\n}\n\n/**\n * Generate the commitment hash by hashing the salt and\n * name, base 58 encoding the result and prepending 'cm_'\n * @category transaction builder\n * @param name - Name to be registered\n * @param salt - Random number\n * @returns Commitment hash\n */\nexport function commitmentHash(\n name: AensName,\n salt: number = genSalt(),\n): Encoded.Commitment {\n return encode(\n hash(concatBuffers([\n Buffer.from(name.toLowerCase()),\n Buffer.from(salt.toString(16).padStart(64, '0'), 'hex'),\n ])),\n Encoding.Commitment,\n );\n}\n\n/**\n * Utility function to convert bytes to int\n * @category transaction builder\n * @param buf - Value\n * @returns Buffer Buffer from number(BigEndian)\n */\nexport function readInt(buf: Buffer = Buffer.from([])): string {\n return new BigNumber(Buffer.from(buf).toString('hex'), 16).toString(10);\n}\n\nconst AENS_SUFFIX = '.chain';\n\n/**\n * Is AENS name valid\n * @category AENS\n * @param name - AENS name\n */\nexport function isNameValid(name: string): name is AensName {\n // TODO: probably there are stronger requirements\n return name.endsWith(AENS_SUFFIX);\n}\n\nconst encodingToPointerKey = [\n [Encoding.AccountAddress, 'account_pubkey'],\n [Encoding.OracleAddress, 'oracle_pubkey'],\n [Encoding.ContractAddress, 'contract_pubkey'],\n [Encoding.Channel, 'channel'],\n] as const;\n\n/**\n * @category AENS\n * @param identifier - account/oracle/contract address, or channel\n * @returns default AENS pointer key\n */\nexport function getDefaultPointerKey(\n identifier: Encoded.Generic<typeof encodingToPointerKey[number][0]>,\n): typeof encodingToPointerKey[number][1] {\n decode(identifier);\n const encoding = identifier.substring(0, 2);\n const result = encodingToPointerKey.find(([e]) => e === encoding)?.[1];\n if (result != null) return result;\n throw new ArgumentError(\n 'identifier',\n `prefixed with one of ${encodingToPointerKey.map(([e]) => `${e}_`).join(', ')}`,\n identifier,\n );\n}\n\n/**\n * Get the minimum AENS name fee\n * @category AENS\n * @param name - the AENS name to get the fee for\n * @returns the minimum fee for the AENS name auction\n */\nexport function getMinimumNameFee(name: AensName): BigNumber {\n const nameLength = name.length - AENS_SUFFIX.length;\n return NAME_BID_RANGES[Math.min(nameLength, NAME_MAX_LENGTH_FEE)];\n}\n\n/**\n * Compute bid fee for AENS auction\n * @category AENS\n * @param name - the AENS name to get the fee for\n * @param options - Options\n * @param options.startFee - Auction start fee\n * @param options.increment - Bid multiplier(In percentage, must be between 0 and 1)\n * @returns Bid fee\n */\nexport function computeBidFee(\n name: AensName,\n { startFee, increment = NAME_FEE_BID_INCREMENT }:\n { startFee?: number | string | BigNumber; increment?: number } = {},\n): BigNumber {\n if (!(Number(increment) === increment && increment % 1 !== 0)) throw new IllegalBidFeeError(`Increment must be float. Current increment ${increment}`);\n if (increment < NAME_FEE_BID_INCREMENT) throw new IllegalBidFeeError(`minimum increment percentage is ${NAME_FEE_BID_INCREMENT}`);\n // FIXME: increment should be used somehow here\n return ceil(\n new BigNumber(startFee ?? getMinimumNameFee(name))\n .times(new BigNumber(NAME_FEE_BID_INCREMENT).plus(1)),\n );\n}\n\n/**\n * Compute auction end height\n * @category AENS\n * @param name - Name to compute auction end for\n * @param claimHeight - Auction starting height\n * @see {@link https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L273}\n * @returns Auction end height\n */\nexport function computeAuctionEndBlock(name: AensName, claimHeight: number): number {\n const length = name.length - AENS_SUFFIX.length;\n const h = (length <= 4 ? 62 * NAME_BID_TIMEOUT_BLOCKS : null)\n ?? (length <= 8 ? 31 * NAME_BID_TIMEOUT_BLOCKS : null)\n ?? (length <= 12 ? NAME_BID_TIMEOUT_BLOCKS : null)\n ?? 0;\n return h + claimHeight;\n}\n\n/**\n * Is name accept going to auction\n * @category AENS\n */\nexport function isAuctionName(name: AensName): boolean {\n return name.length < 13 + AENS_SUFFIX.length;\n}\n","import { readInt } from '../helpers';\nimport { Int } from '../constants';\nimport { ArgumentError } from '../../../utils/errors';\nimport { toBytes } from '../../../utils/bytes';\n\nexport default {\n serialize(value: Int): Buffer {\n if (value < 0) throw new ArgumentError('value', 'greater or equal to 0', value);\n return toBytes(value, true);\n },\n\n deserialize(value: Buffer): string {\n return readInt(value);\n },\n};\n","import uInt from './u-int';\nimport { Int } from '../constants';\nimport { AE_AMOUNT_FORMATS, formatAmount } from '../../../utils/amount-formatter';\n\nexport default {\n ...uInt,\n\n serializeAettos(value: string | undefined): string {\n return value ?? '0';\n },\n\n serialize(\n value: Int | undefined,\n params: {},\n { denomination = AE_AMOUNT_FORMATS.AETTOS }: { denomination?: AE_AMOUNT_FORMATS },\n ): Buffer {\n return uInt.serialize(\n this.serializeAettos(\n value != null ? formatAmount(value, { denomination }) : value,\n params,\n ),\n );\n },\n};\n","import coinAmount from './coin-amount';\nimport { Int } from '../constants';\nimport { IllegalArgumentError } from '../../../utils/errors';\n\nexport default {\n ...coinAmount,\n\n /**\n * @param value - Deposit value in string format. Should be equal to '0'.\n * @param options - Options\n * @param parameters - Parameters\n * @returns Deposit value Buffer.\n */\n serialize(\n value: Int | undefined,\n options: Parameters<typeof coinAmount['serialize']>[1],\n parameters: Parameters<typeof coinAmount['serialize']>[2],\n ): Buffer {\n value ??= 0;\n if (+value !== 0) throw new IllegalArgumentError(`Contract deposit is not refundable, so it should be equal 0, got ${value.toString()} instead`);\n return coinAmount.serialize(value, options, parameters);\n },\n};\n","import BigNumber from 'bignumber.js';\nimport { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE, Tag } from '../constants';\nimport coinAmount from './coin-amount';\nimport { isKeyOfObject } from '../../../utils/other';\nimport { decode, Encoded } from '../../../utils/encoder';\nimport type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';\n\nconst BASE_GAS = 15000;\nconst GAS_PER_BYTE = 20;\nconst KEY_BLOCK_INTERVAL = 3;\n\n/**\n * Calculate the Base fee gas\n * @see {@link https://github.com/aeternity/protocol/blob/master/consensus/README.md#gas}\n * @param txType - The transaction type\n * @returns The base fee\n * @example\n * ```js\n * TX_FEE_BASE('channelForceProgress') => new BigNumber(30 * 15000)\n * ```\n */\nconst TX_FEE_BASE_GAS = (txType: Tag): BigNumber => {\n const feeFactors = {\n [Tag.ChannelForceProgressTx]: 30,\n [Tag.ChannelOffChainTx]: 0,\n [Tag.ChannelOffChainUpdateCallContract]: 0,\n [Tag.ChannelOffChainUpdateCreateContract]: 0,\n [Tag.ChannelOffChainUpdateDeposit]: 0,\n [Tag.ChannelOffChainUpdateWithdraw]: 0,\n [Tag.ChannelOffChainUpdateTransfer]: 0,\n [Tag.ContractCreateTx]: 5,\n [Tag.ContractCallTx]: 12,\n [Tag.GaAttachTx]: 5,\n [Tag.GaMetaTx]: 5,\n [Tag.PayingForTx]: 1 / 5,\n } as const;\n const factor = feeFactors[txType as keyof typeof feeFactors] ?? 1;\n return new BigNumber(factor * BASE_GAS);\n};\n\n/**\n * Calculate fee for Other types of transactions\n * @see {@link https://github.com/aeternity/protocol/blob/master/consensus/README.md#gas}\n * @param txType - The transaction type\n * @param txSize - The transaction size\n * @returns parameters - The transaction parameters\n * @returns parameters.relativeTtl - The relative ttl\n * @returns parameters.innerTxSize - The size of the inner transaction\n * @returns The Other fee\n * @example\n * ```js\n * TX_FEE_OTHER_GAS('oracleResponse',10, { relativeTtl: 10, innerTxSize: 10 })\n * => new BigNumber(10).times(20).plus(Math.ceil(32000 * 10 / Math.floor(60 * 24 * 365 / 2)))\n * ```\n */\nconst TX_FEE_OTHER_GAS = (\n txType: Tag,\n txSize: number,\n { relativeTtl, innerTxSize }: { relativeTtl: number; innerTxSize: number },\n): BigNumber => {\n switch (txType) {\n case Tag.OracleRegisterTx:\n case Tag.OracleExtendTx:\n case Tag.OracleQueryTx:\n case Tag.OracleResponseTx:\n return new BigNumber(txSize)\n .times(GAS_PER_BYTE)\n .plus(\n Math.ceil((32000 * relativeTtl) / Math.floor((60 * 24 * 365) / KEY_BLOCK_INTERVAL)),\n );\n case Tag.GaMetaTx:\n case Tag.PayingForTx:\n return new BigNumber(txSize).minus(innerTxSize).times(GAS_PER_BYTE);\n default:\n return new BigNumber(txSize).times(GAS_PER_BYTE);\n }\n};\n\nfunction getOracleRelativeTtl(params: any): number {\n const ttlKeys = {\n [Tag.OracleRegisterTx]: 'oracleTtlValue',\n [Tag.OracleExtendTx]: 'oracleTtlValue',\n [Tag.OracleQueryTx]: 'queryTtlValue',\n [Tag.OracleResponseTx]: 'responseTtlValue',\n } as const;\n\n const { tag } = params;\n if (!isKeyOfObject(tag, ttlKeys)) return 1;\n return params[ttlKeys[tag]];\n}\n\n/**\n * Calculate fee based on tx type and params\n */\nexport function buildFee(\n builtTx: Encoded.Transaction,\n unpackTx: typeof unpackTxType,\n buildTx: typeof buildTxType,\n): BigNumber {\n const { length } = decode(builtTx);\n const txObject = unpackTx(builtTx);\n\n let innerTxSize = 0;\n if (txObject.tag === Tag.GaMetaTx || txObject.tag === Tag.PayingForTx) {\n innerTxSize = decode(buildTx(txObject.tx.encodedTx)).length;\n }\n\n return TX_FEE_BASE_GAS(txObject.tag)\n .plus(TX_FEE_OTHER_GAS(txObject.tag, length, {\n relativeTtl: getOracleRelativeTtl(txObject), innerTxSize,\n }))\n .times(MIN_GAS_PRICE);\n}\n\n/**\n * Calculate min fee\n * @category transaction builder\n * @param rebuildTx - Callback to get built transaction with specific fee\n */\nfunction calculateMinFee(\n rebuildTx: (value: BigNumber) => Encoded.Transaction,\n unpackTx: typeof unpackTxType,\n buildTx: typeof buildTxType,\n): BigNumber {\n let fee = new BigNumber(0);\n let previousFee;\n do {\n previousFee = fee;\n fee = buildFee(rebuildTx(fee), unpackTx, buildTx);\n } while (!fee.eq(previousFee));\n return fee;\n}\n\nexport default {\n ...coinAmount,\n\n serializeAettos(\n _value: string | undefined,\n {\n rebuildTx, unpackTx, buildTx, _computingMinFee, _pickBiggerFee,\n }: {\n rebuildTx: (params: any) => Encoded.Transaction;\n unpackTx: typeof unpackTxType;\n buildTx: typeof buildTxType;\n _computingMinFee?: BigNumber;\n _pickBiggerFee?: boolean;\n },\n ): string {\n if (_computingMinFee != null) return _computingMinFee.toFixed();\n const minFee = calculateMinFee(\n (fee) => rebuildTx({ _computingMinFee: fee }),\n unpackTx,\n buildTx,\n );\n const value = new BigNumber(_value ?? minFee);\n if (minFee.gt(value)) {\n if (_pickBiggerFee === true) return minFee.toFixed();\n throw new IllegalArgumentError(`Fee ${value.toString()} must be bigger then ${minFee}`);\n }\n return value.toFixed();\n },\n};\n","import uInt from './u-int';\n\nexport default {\n serialize(value: number): Buffer {\n return uInt.serialize(value);\n },\n\n deserialize(value: Buffer): number {\n return +uInt.deserialize(value);\n },\n};\n","import { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE, Tag, MAX_AUTH_FUN_GAS } from '../constants';\nimport shortUInt from './short-u-int';\nimport { buildFee } from './fee';\nimport type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';\n\nfunction calculateGasLimitMax(\n gasMax: number,\n rebuildTx: (value: number) => any,\n unpackTx: typeof unpackTxType,\n buildTx: typeof buildTxType,\n): number {\n return gasMax - +buildFee(rebuildTx(gasMax), unpackTx, buildTx).dividedBy(MIN_GAS_PRICE);\n}\n\nexport default {\n ...shortUInt,\n\n serialize(\n _value: number | undefined,\n {\n tag, rebuildTx, unpackTx, buildTx, _computingGasLimit,\n }: {\n tag: Tag;\n rebuildTx: (params: any) => any;\n unpackTx: typeof unpackTxType;\n buildTx: typeof buildTxType;\n _computingGasLimit?: number;\n },\n { gasMax = 6e6 }: { gasMax?: number },\n ): Buffer {\n if (_computingGasLimit != null) return shortUInt.serialize(_computingGasLimit);\n\n const gasLimitMax = tag === Tag.GaMetaTx ? MAX_AUTH_FUN_GAS : calculateGasLimitMax(\n gasMax,\n (gasLimit) => rebuildTx({ _computingGasLimit: gasLimit, _pickBiggerFee: true }),\n unpackTx,\n buildTx,\n );\n const value = _value ?? gasLimitMax;\n if (value > gasLimitMax) {\n throw new IllegalArgumentError(`Gas limit ${value} must be less or equal to ${gasLimitMax}`);\n }\n return shortUInt.serialize(value);\n },\n};\n","import coinAmount from './coin-amount';\nimport { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE } from '../constants';\n\nexport default {\n ...coinAmount,\n\n serializeAettos(value: string | undefined = MIN_GAS_PRICE.toString()): string {\n if (+value < MIN_GAS_PRICE) {\n throw new IllegalArgumentError(`Gas price ${value.toString()} must be bigger then ${MIN_GAS_PRICE}`);\n }\n return value;\n },\n};\n","export default function _classExtractFieldDescriptor(receiver, privateMap, action) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to \" + action + \" private field on non-instance\");\n }\n return privateMap.get(receiver);\n}","import classApplyDescriptorSet from \"./classApplyDescriptorSet.js\";\nimport classExtractFieldDescriptor from \"./classExtractFieldDescriptor.js\";\nexport default function _classPrivateFieldSet(receiver, privateMap, value) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"set\");\n classApplyDescriptorSet(receiver, descriptor, value);\n return value;\n}","export default function _classApplyDescriptorSet(receiver, descriptor, value) {\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n throw new TypeError(\"attempted to set read only private field\");\n }\n descriptor.value = value;\n }\n}","import classApplyDescriptorGet from \"./classApplyDescriptorGet.js\";\nimport classExtractFieldDescriptor from \"./classExtractFieldDescriptor.js\";\nexport default function _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"get\");\n return classApplyDescriptorGet(receiver, descriptor);\n}","export default function _classApplyDescriptorGet(receiver, descriptor) {\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n return descriptor.value;\n}","import { encode as rlpEncode, Input } from 'rlp';\nimport { Tag } from '../constants';\nimport { hash } from '../../../utils/crypto';\nimport {\n MerkleTreeHashMismatchError,\n MissingNodeInTreeError,\n UnknownPathNibbleError,\n UnexpectedTsError,\n UnknownNodeLengthError,\n InternalError,\n} from '../../../utils/errors';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../../utils/encoder';\nimport type { unpackTx } from '..';\nimport type { TxUnpacked } from '../schema.generated';\n\nenum NodeType {\n Branch,\n Extension,\n Leaf,\n}\n\ntype MPTreeBinary = [Buffer, Array<[Buffer, Buffer[]]>];\n\nclass MPTree<E extends Encoding, T extends Tag> {\n readonly #rootHash: string;\n\n #isComplete = true;\n\n get isComplete(): boolean {\n return this.#isComplete;\n }\n\n readonly #nodes: { [key: string]: Buffer[] };\n\n readonly #encoding: E;\n\n readonly #tag: T;\n\n readonly #unpackTx: typeof unpackTx;\n\n static #nodeHash(node: Input): string {\n return Buffer.from(hash(rlpEncode(node))).toString('hex');\n }\n\n /**\n * Deserialize Merkle Patricia Tree\n * @param binary - Binary\n * @param tag - Tag to use to decode value\n * @param unpTx - Implementation of unpackTx use to decode values\n * @returns Merkle Patricia Tree\n */\n constructor(binary: MPTreeBinary, encoding: E, tag: T, unpTx: typeof unpackTx) {\n this.#encoding = encoding;\n this.#tag = tag;\n this.#unpackTx = unpTx;\n this.#rootHash = binary[0].toString('hex');\n this.#nodes = Object.fromEntries(\n binary[1].map((node) => [node[0].toString('hex'), node[1]]),\n );\n\n if (this.#nodes[this.#rootHash] == null) {\n if (Object.keys(this.#nodes).length !== 0) {\n throw new MissingNodeInTreeError('Can\\'t find a node by root hash');\n }\n this.#isComplete = false;\n return;\n }\n Object.entries(this.#nodes).forEach(([key, node]) => {\n if (MPTree.#nodeHash(node) !== key) throw new MerkleTreeHashMismatchError();\n const { type } = MPTree.#parseNode(node);\n switch (type) {\n case NodeType.Branch:\n node\n .slice(0, 16)\n .filter((n) => n.length)\n .forEach((n) => {\n // TODO: enable after resolving https://github.com/aeternity/aeternity/issues/4066\n // if (n.length !== 32) {\n // throw new ArgumentError('MPTree branch item length', 32, n.length);\n // }\n if (this.#nodes[n.toString('hex')] == null) this.#isComplete = false;\n });\n break;\n case NodeType.Extension:\n if (this.#nodes[node[1].toString('hex')] == null) {\n throw new MissingNodeInTreeError('Can\\'t find a node by hash in extension node');\n }\n break;\n case NodeType.Leaf:\n break;\n default:\n throw new InternalError(`Unknown MPTree node type: ${type}`);\n }\n });\n }\n\n isEqual(tree: MPTree<E, T>): boolean {\n return this.#rootHash === tree.#rootHash;\n }\n\n static #parseNode(node: Buffer[]): { type: NodeType; value?: Buffer; path?: string } {\n switch (node.length) {\n case 17:\n return {\n type: NodeType.Branch,\n ...node[16].length !== 0 && { value: node[16] },\n };\n case 2: {\n const nibble = node[0][0] >> 4; // eslint-disable-line no-bitwise\n if (nibble > 3) throw new UnknownPathNibbleError(nibble);\n const type = nibble <= 1 ? NodeType.Extension : NodeType.Leaf;\n const slice = [0, 2].includes(nibble) ? 2 : 1;\n return {\n type,\n ...type === NodeType.Leaf && { value: node[1] },\n path: node[0].toString('hex').slice(slice),\n };\n }\n default:\n throw new UnknownNodeLengthError(node.length);\n }\n }\n\n /**\n * Serialize Merkle Patricia Tree\n * @returns Binary\n */\n serialize(): MPTreeBinary {\n return [\n Buffer.from(this.#rootHash, 'hex'),\n Object.entries(this.#nodes).map(([mptHash, value]) => ([\n Buffer.from(mptHash, 'hex'),\n value,\n ])),\n ];\n }\n\n /**\n * Retrieve value from Merkle Patricia Tree\n * @param _key - The key of the element to retrieve\n * @returns Value associated to the specified key\n */\n #getRaw(_key: string): Buffer | undefined {\n let searchFrom = this.#rootHash;\n let key = _key;\n while (true) { // eslint-disable-line no-constant-condition\n const node = this.#nodes[searchFrom];\n if (node == null) {\n if (!this.isComplete) return undefined;\n throw new InternalError('Can\\'t find node in complete tree');\n }\n const { type, value, path } = MPTree.#parseNode(node);\n switch (type) {\n case NodeType.Branch:\n if (key.length === 0) return value;\n searchFrom = node[+`0x${key[0]}`].toString('hex');\n key = key.substring(1);\n break;\n case NodeType.Extension:\n if (key.substring(0, path?.length) !== path) return undefined;\n searchFrom = node[1].toString('hex');\n key = key.substring(path.length);\n break;\n case NodeType.Leaf:\n if (path !== key) return undefined;\n return value;\n default:\n throw new InternalError(`Unknown MPTree node type: ${type}`);\n }\n }\n }\n\n /**\n * Retrieve value from Merkle Patricia Tree\n * @param key - The key of the element to retrieve\n * @returns Value associated to the specified key\n */\n get(key: Encoded.Generic<E>): TxUnpacked & { tag: T } | undefined {\n const d = this.#getRaw(decode(key).toString('hex'));\n if (d == null) return d;\n return this.#unpackTx(encode(d, Encoding.Transaction), this.#tag);\n }\n\n #entriesRaw(): Array<[string, Buffer]> {\n const entries: Array<[string, Buffer]> = [];\n const rec = (searchFrom: string, key: string): void => {\n const node = this.#nodes[searchFrom];\n if (node == null) {\n if (!this.isComplete) return;\n throw new InternalError('Can\\'t find node in complete tree');\n }\n const { type, value, path } = MPTree.#parseNode(node);\n switch (type) {\n case NodeType.Branch:\n node\n .slice(0, 16)\n .map((t, idx): [typeof t, number] => [t, idx])\n .filter(([t]) => t.length)\n .forEach(([t, idx]) => rec(t.toString('hex'), key + idx.toString(16)));\n if (value != null) entries.push([key, value]);\n break;\n case NodeType.Extension:\n rec(node[1].toString('hex'), key + path);\n break;\n case NodeType.Leaf:\n if (value == null) throw new UnexpectedTsError();\n entries.push([key + path, value]);\n break;\n default:\n throw new InternalError(`Unknown MPTree node type: ${type}`);\n }\n };\n rec(this.#rootHash, '');\n return entries;\n }\n\n toObject(): Record<Encoded.Generic<E>, TxUnpacked & { tag: T }> {\n return Object.fromEntries(this.#entriesRaw()\n // TODO: remove after resolving https://github.com/aeternity/aeternity/issues/4066\n .filter(([k]) => this.#encoding !== Encoding.ContractAddress || k.length !== 66)\n .map(([k, v]) => [\n encode(Buffer.from(k, 'hex'), this.#encoding),\n this.#unpackTx(encode(v, Encoding.Transaction), this.#tag),\n ])) as Record<Encoded.Generic<E>, TxUnpacked & { tag: T }>;\n }\n}\n\nexport default function genMPTreeField<E extends Encoding, T extends Tag>(encoding: E, tag: T): {\n serialize: (value: MPTree<E, T>) => MPTreeBinary;\n deserialize: (value: MPTreeBinary, o: { unpackTx: typeof unpackTx }) => MPTree<E, T>;\n} {\n return {\n serialize(value) {\n return value.serialize();\n },\n\n deserialize(value, { unpackTx }) {\n return new MPTree(value, encoding, tag, unpackTx);\n },\n };\n}\n","export default {\n serialize(value: string): Buffer {\n return Buffer.from(value);\n },\n\n deserialize(value: Buffer): string {\n return value.toString();\n },\n};\n","import field from './field';\nimport { AensName } from '../constants';\n\nexport default {\n /**\n * @param value - AENS name\n */\n serialize(value: AensName): Buffer {\n return field.serialize(value);\n },\n\n /**\n * @param value - AENS name\n */\n deserialize(value: Buffer): AensName {\n return field.deserialize(value) as AensName;\n },\n};\n","import BigNumber from 'bignumber.js';\nimport { getMinimumNameFee } from '../helpers';\nimport { InsufficientNameFeeError } from '../../../utils/errors';\nimport coinAmount from './coin-amount';\nimport { AensName, Int } from '../constants';\n\nexport default {\n ...coinAmount,\n\n serializeAettos(\n _value: string | undefined,\n txFields: { name: AensName },\n ): string {\n const minNameFee = getMinimumNameFee(txFields.name);\n const value = new BigNumber(_value ?? minNameFee);\n if (minNameFee.gt(value)) throw new InsufficientNameFeeError(value, minNameFee);\n return value.toFixed();\n },\n\n /**\n * @param value - AENS name fee Buffer\n * @param txFields - Transaction fields\n * @param txFields.name - AENS Name in transaction\n */\n serialize(\n value: Int | undefined,\n txFields: { name: AensName } & Parameters<typeof coinAmount['serialize']>[1],\n parameters: Parameters<typeof coinAmount['serialize']>[2],\n ): Buffer {\n return coinAmount.serialize.call(this, value, txFields, parameters);\n },\n};\n","import { AensName } from '../constants';\nimport { produceNameId, isNameValid } from '../helpers';\nimport address from './address';\nimport { Encoded, Encoding } from '../../../utils/encoder';\n\nconst addressName = address(Encoding.Name);\n\nexport default {\n ...addressName,\n\n /**\n * @param value - AENS name ID\n */\n serialize(value: AensName | Encoded.Name): Buffer {\n return addressName.serialize(isNameValid(value) ? produceNameId(value) : value);\n },\n};\n","import { NamePointer as NamePointerString } from '../../../apis/node';\nimport { toBytes } from '../../../utils/bytes';\nimport { Encoded } from '../../../utils/encoder';\nimport { IllegalArgumentError } from '../../../utils/errors';\nimport address, { AddressEncodings, idTagToEncoding } from './address';\n\nconst addressAny = address(...idTagToEncoding);\n\n// TODO: remove after fixing node types\ntype NamePointer = NamePointerString & {\n id: Encoded.Generic<AddressEncodings>;\n};\n\nexport default {\n /**\n * Helper function to build pointers for name update TX\n * @param pointers - Array of pointers\n * `([ { key: 'account_pubkey', id: 'ak_32klj5j23k23j5423l434l2j3423'} ])`\n * @returns Serialized pointers array\n */\n serialize(pointers: NamePointer[]): Buffer[][] {\n if (pointers.length > 32) {\n throw new IllegalArgumentError(`Expected 32 pointers or less, got ${pointers.length} instead`);\n }\n\n return pointers.map(\n (pointer) => [toBytes(pointer.key), addressAny.serialize(pointer.id)],\n );\n },\n\n /**\n * Helper function to read pointers from name update TX\n * @param pointers - Array of pointers\n * @returns Deserialize pointer array\n */\n deserialize(pointers: Array<[key: Buffer, id: Buffer]>): NamePointer[] {\n return pointers.map(\n ([key, id]) => ({ key: key.toString(), id: addressAny.deserialize(id) }),\n );\n },\n};\n","export default {\n serialize(buffer: Uint8Array): Buffer {\n return Buffer.from(buffer);\n },\n\n deserialize(buffer: Buffer): Buffer {\n return buffer;\n },\n};\n","import { toBytes } from '../../../utils/bytes';\n\nexport default {\n serialize(string: string): Buffer {\n return toBytes(string);\n },\n\n deserialize(buffer: Buffer): string {\n return buffer.toString();\n },\n};\n","import shortUInt from './short-u-int';\nimport Node from '../../../Node';\nimport { ArgumentError } from '../../../utils/errors';\n\nexport default {\n ...shortUInt,\n\n serialize(value: number | undefined): Buffer {\n return shortUInt.serialize(value ?? 0);\n },\n\n async prepare(\n value: number | undefined,\n params: {},\n // TODO: { absoluteTtl: true } | { absoluteTtl: false, onNode: Node }\n { onNode, absoluteTtl }: { onNode?: Node; absoluteTtl?: boolean },\n ) {\n if (absoluteTtl !== true && value !== 0 && value != null) {\n if (onNode == null) throw new ArgumentError('onNode', 'provided', onNode);\n value += (await onNode.getCurrentKeyBlock()).height;\n }\n return value;\n },\n};\n","import _abiVersion from './abi-version';\nimport _address from './address';\nimport _array from './array';\nimport _boolean from './boolean';\nimport _coinAmount from './coin-amount';\nimport _ctVersion from './ct-version';\nimport _deposit from './deposit';\nimport _encoded from './encoded';\nimport _entry from './entry';\nimport _enumeration from './enumeration';\nimport _fee from './fee';\nimport _field from './field';\nimport _gasLimit from './gas-limit';\nimport _gasPrice from './gas-price';\nimport _map from './map';\nimport _mptree from './mptree';\nimport _name from './name';\nimport _nameFee from './name-fee';\nimport _nameId from './name-id';\nimport _nonce from './nonce';\nimport _pointers from './pointers';\nimport _raw from './raw';\nimport _shortUInt from './short-u-int';\nimport _shortUIntConst from './short-u-int-const';\nimport _string from './string';\nimport _ttl from './ttl';\nimport _uInt from './u-int';\nimport _wrapped from './wrapped';\n\n// TODO: remove after fixing https://github.com/Gerrit0/typedoc-plugin-missing-exports/issues/15\nconst abiVersion = _abiVersion;\nconst address = _address;\nconst array = _array;\nconst boolean = _boolean;\nconst coinAmount = _coinAmount;\nconst ctVersion = _ctVersion;\nconst deposit = _deposit;\nconst encoded = _encoded;\nconst entry = _entry;\nconst enumeration = _enumeration;\nconst fee = _fee;\nconst field = _field;\nconst gasLimit = _gasLimit;\nconst gasPrice = _gasPrice;\nconst map = _map;\nconst mptree = _mptree;\nconst name = _name;\nconst nameFee = _nameFee;\nconst nameId = _nameId;\nconst nonce = _nonce;\nconst pointers = _pointers;\nconst raw = _raw;\nconst shortUInt = _shortUInt;\nconst shortUIntConst = _shortUIntConst;\nconst string = _string;\nconst ttl = _ttl;\nconst uInt = _uInt;\nconst wrapped = _wrapped;\n\nexport type BinaryData = Buffer | Buffer[] | Buffer[][]\n| Array<[Buffer, Array<[Buffer, Buffer[]]>]>;\nexport interface Field {\n serialize: (value: any, options: any, parameters: any) => BinaryData;\n prepare?: (value: any, options: any, parameters: any) => Promise<any>;\n deserialize: (value: BinaryData, options: any) => any;\n recursiveType?: boolean;\n}\n\nexport {\n abiVersion,\n address,\n array,\n boolean,\n coinAmount,\n ctVersion,\n deposit,\n encoded,\n entry,\n enumeration,\n fee,\n field,\n gasLimit,\n gasPrice,\n map,\n mptree,\n name,\n nameFee,\n nameId,\n nonce,\n pointers,\n raw,\n shortUInt,\n shortUIntConst,\n string,\n ttl,\n uInt,\n wrapped,\n};\n","export default function genArrayField<Input, Output, Binary>(\n itemHandler: {\n serialize: (value: Input, params: unknown) => Binary;\n deserialize: (value: Binary, params: unknown) => Output;\n },\n): {\n serialize: (value: readonly Input[], params: unknown) => Binary[];\n deserialize: (value: Binary[], params: unknown) => Output[];\n } {\n return {\n serialize(items, params) {\n return items.map((item) => itemHandler.serialize(item, params));\n },\n\n deserialize(buffers, params) {\n return buffers.map((buffer) => itemHandler.deserialize(buffer, params));\n },\n };\n}\n","import {\n decode, encode, Encoded, Encoding,\n} from '../../../utils/encoder';\nimport { ArgumentError } from '../../../utils/errors';\n\nexport default function genEncodedField<E extends Encoding, Optional extends boolean = false>(\n encoding: E,\n optional?: Optional,\n): {\n serialize: Optional extends true\n ? (value?: Encoded.Generic<E>) => Buffer : (value: Encoded.Generic<E>) => Buffer;\n deserialize: (value: Buffer) => Encoded.Generic<E>;\n } {\n return {\n serialize(encodedData?: Encoded.Generic<E>) {\n if (encodedData == null) {\n if (optional === true) return Buffer.from([]);\n throw new ArgumentError('Encoded data', 'provided', encodedData);\n }\n return decode(encodedData);\n },\n\n deserialize(buffer) {\n return encode(buffer, encoding);\n },\n };\n}\n","import {\n decode, encode, Encoded, Encoding,\n} from '../../../utils/encoder';\nimport { Tag } from '../constants';\nimport { ArgumentError } from '../../../utils/errors';\nimport type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';\n\nexport default function genEntryField<T extends Tag = Tag>(tag?: T): {\n serialize: (\n // TODO: replace with `TxParams & { tag: T }`,\n // but fix TS2502 value is referenced directly or indirectly in its own type annotation\n value: any,\n options: { buildTx: typeof buildTxType },\n ) => Buffer;\n deserialize: (\n value: Buffer, options: { unpackTx: typeof unpackTxType },\n // TODO: replace with `TxUnpacked & { tag: T }`,\n // TS2577 Return type annotation circularly references itself\n ) => any;\n} {\n return {\n serialize(txParams, { buildTx }) {\n if (ArrayBuffer.isView(txParams)) return Buffer.from(txParams as any);\n if (typeof txParams === 'string' && txParams.startsWith('tx_')) {\n return decode(txParams as Encoded.Transaction);\n }\n return decode(buildTx({ ...txParams, ...tag != null && { tag } }));\n },\n\n deserialize(buf, { unpackTx }) {\n const tx = unpackTx(encode(buf, Encoding.Transaction));\n if (tag != null && tx.tag !== tag) throw new ArgumentError('Tag', tag, tx.tag);\n return tx;\n },\n };\n}\n","import { ArgumentError } from '../../../utils/errors';\nimport { isItemOfArray } from '../../../utils/other';\n\nexport default function genEnumerationField<\n Enum extends { [key: string]: number | string },\n>(enm: Enum): {\n serialize: (value: Enum[keyof Enum]) => Buffer;\n deserialize: (value: Buffer) => Enum[keyof Enum];\n} {\n const values = Object.values(enm).filter((v) => typeof v === 'number');\n return {\n serialize(value) {\n if (typeof value !== 'number') throw new ArgumentError('value', 'to be a number', value);\n if (value > 0xff) throw new ArgumentError('value', 'to be less than 256', value);\n if (!isItemOfArray(value, values)) {\n throw new ArgumentError('value', 'to be a value of Enum', value);\n }\n return Buffer.from([value]);\n },\n\n deserialize(buffer) {\n if (buffer.length !== 1) {\n throw new ArgumentError('buffer', 'to have single element', buffer.length);\n }\n const value = buffer[0];\n if (!isItemOfArray(value, values)) {\n throw new ArgumentError('value', 'to be a value of Enum', value);\n }\n return value as Enum[keyof Enum];\n },\n };\n}\n","import { Tag } from '../constants';\nimport {\n encode, Encoding, Encoded, decode,\n} from '../../../utils/encoder';\nimport type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';\n\nexport default function genMapField<E extends Encoding, T extends Tag>(encoding: E, tag: T): {\n serialize: (\n // TODO: replace with `TxParams & { tag: T }`,\n // but fix TS2502 value is referenced directly or indirectly in its own type annotation\n value: Record<Encoded.Generic<E>, any>, options: { buildTx: typeof buildTxType }\n ) => Buffer;\n deserialize: (\n value: Buffer, options: { unpackTx: typeof unpackTxType },\n // TODO: replace with `TxUnpacked & { tag: T }`,\n // TS2577 Return type annotation circularly references itself\n ) => Record<Encoded.Generic<E>, any>;\n recursiveType: true;\n} {\n return {\n serialize(object, { buildTx }) {\n return decode(buildTx({\n tag: Tag.Mtree,\n values: Object.entries(object).map(([key, value]) => ({\n tag: Tag.MtreeValue,\n key: decode(key as Encoded.Generic<E>),\n value: decode(buildTx({ ...value as any, tag })),\n })),\n }));\n },\n\n deserialize(buffer, { unpackTx }) {\n const { values } = unpackTx(encode(buffer, Encoding.Transaction), Tag.Mtree);\n return Object.fromEntries(values\n // TODO: remove after resolving https://github.com/aeternity/aeternity/issues/4066\n .filter(({ key }) => encoding !== Encoding.ContractAddress || key.length === 32)\n .map(({ key, value }) => [\n encode(key, encoding),\n unpackTx(encode(value, Encoding.Transaction), tag),\n ])) as Record<Encoded.Generic<E>, any>;\n },\n\n recursiveType: true,\n };\n}\n","import { isAccountNotFoundError } from '../../../utils/other';\nimport shortUInt from './short-u-int';\nimport Node from '../../../Node';\nimport { ArgumentError } from '../../../utils/errors';\nimport { NextNonceStrategy } from '../../../apis/node';\n\nexport default function genNonceField<SenderKey extends string>(senderKey: SenderKey): {\n serialize: (value: number) => Buffer;\n // TODO: (value: number) => Promise<number> | (value: undefined, ...) => Promise<number>\n prepare: (\n value: number | undefined,\n params: {},\n // TODO: replace `string` with AddressEncodings\n options: { [key in SenderKey]: string } & { strategy?: NextNonceStrategy; onNode?: Node },\n ) => Promise<number>;\n deserialize: (value: Buffer) => number;\n senderKey: string;\n} {\n return {\n ...shortUInt,\n\n async prepare(value, params, options) {\n if (value != null) return value;\n const { onNode, strategy } = options;\n const senderId = options[senderKey];\n const requirement = 'provided (or provide `nonce` instead)';\n if (onNode == null) throw new ArgumentError('onNode', requirement, onNode);\n if (senderId == null) throw new ArgumentError('senderId', requirement, senderId);\n return (\n await onNode.getAccountNextNonce(senderId.replace(/^ok_/, 'ak_'), { strategy })\n .catch((error) => {\n if (!isAccountNotFoundError(error)) throw error;\n return { nextNonce: 1 };\n })\n ).nextNonce;\n },\n\n senderKey,\n };\n}\n","import { ArgumentError } from '../../../utils/errors';\nimport shortUInt from './short-u-int';\n\nexport default function genShortUIntConstField<\n Value extends number, Optional extends boolean = false,\n>(constValue: Value, optional?: Optional): {\n serialize: Optional extends true ? (value?: Value) => Buffer : (value: Value) => Buffer;\n deserialize: (value: Buffer) => Value;\n constValue: Value;\n constValueOptional: boolean;\n} {\n return {\n serialize(value?: Value) {\n if ((optional !== true || value != null) && value !== constValue) {\n throw new ArgumentError('ShortUIntConst', constValue, value);\n }\n return shortUInt.serialize(constValue);\n },\n\n deserialize(buf) {\n const value = shortUInt.deserialize(buf);\n if (value !== constValue) throw new ArgumentError('ShortUIntConst', constValue, value);\n return constValue;\n },\n\n constValue,\n\n constValueOptional: optional === true,\n };\n}\n","import { Tag } from '../constants';\nimport { encode, Encoding, decode } from '../../../utils/encoder';\nimport type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';\n\ntype TagWrapping = Tag.AccountsMtree | Tag.CallsMtree | Tag.ChannelsMtree | Tag.ContractsMtree\n| Tag.NameserviceMtree | Tag.OraclesMtree;\n\nexport default function genWrappedField<T extends TagWrapping>(tag: T): {\n serialize: (\n // TODO: replace with `(TxParams & { tag: T })['payload']`,\n // but fix TS2502 value is referenced directly or indirectly in its own type annotation\n value: any, options: { buildTx: typeof buildTxType }\n ) => Buffer;\n deserialize: (\n value: Buffer, options: { unpackTx: typeof unpackTxType },\n // TODO: replace with `(TxUnpacked & { tag: T })['payload']`,\n // TS2577 Return type annotation circularly references itself\n ) => any;\n recursiveType: true;\n} {\n return {\n serialize(payload, { buildTx }) {\n return decode(buildTx({ tag, payload }));\n },\n\n deserialize(buffer, { unpackTx }) {\n return unpackTx<TagWrapping>(encode(buffer, Encoding.Transaction), tag).payload;\n },\n\n recursiveType: true,\n };\n}\n","/**\n * Transaction Schema for TxBuilder\n */\n// # RLP version number\n// # https://github.com/aeternity/protocol/blob/master/serializations.md#binary-serialization\n\nimport { Tag } from './constants';\nimport SchemaTypes from './SchemaTypes';\nimport {\n uInt, shortUInt, coinAmount, name, nameId, nameFee, deposit, gasLimit, gasPrice, fee,\n address, pointers, entry, enumeration, mptree, shortUIntConst, string, encoded, raw,\n array, boolean, ctVersion, abiVersion, ttl, nonce, map, wrapped,\n} from './field-types';\nimport { Encoded, Encoding } from '../../utils/encoder';\nimport { idTagToEncoding } from './field-types/address';\n\nexport enum ORACLE_TTL_TYPES {\n delta = 0,\n block = 1,\n}\n\n// # ORACLE\nexport const ORACLE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 500 };\nexport const QUERY_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };\nexport const RESPONSE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };\n// # CONTRACT\nexport const DRY_RUN_ACCOUNT = {\n pub: 'ak_11111111111111111111111111111111273Yts',\n amount: 100000000000000000000000000000000000n,\n} as const;\n\nexport enum CallReturnType {\n Ok = 0,\n Error = 1,\n Revert = 2,\n}\n\n// TODO: figure out how to omit overriding types of recursive fields\ninterface EntryAny {\n serialize: (value: TxParams | Uint8Array | Encoded.Transaction) => Buffer;\n deserialize: (value: Buffer) => TxUnpacked;\n recursiveType: true;\n}\n\nconst entryAny = entry() as unknown as EntryAny;\n\ninterface EntrySignedTx {\n serialize: (value: TxParams & { tag: Tag.SignedTx } | Uint8Array | Encoded.Transaction) => Buffer;\n deserialize: (value: Buffer) => TxUnpacked & { tag: Tag.SignedTx };\n recursiveType: true;\n}\n\nconst entrySignedTx = entry(Tag.SignedTx) as unknown as EntrySignedTx;\n\ninterface EntryMtreeValueArray {\n serialize: (\n value: Array<TxParams & { tag: Tag.MtreeValue } | Uint8Array | Encoded.Transaction>,\n ) => Buffer[];\n deserialize: (value: Buffer[]) => Array<TxUnpacked & { tag: Tag.MtreeValue }>;\n recursiveType: true;\n}\n\nconst entryMtreeValueArray = array(entry(Tag.MtreeValue)) as unknown as EntryMtreeValueArray;\n\ninterface EntryTreesPoi {\n serialize: (value: TxParams & { tag: Tag.TreesPoi } | Uint8Array | Encoded.Transaction) => Buffer;\n deserialize: (value: Buffer) => TxUnpacked & { tag: Tag.TreesPoi };\n recursiveType: true;\n}\n\nconst entryTreesPoi = entry(Tag.TreesPoi) as unknown as EntryTreesPoi;\n\ninterface MapContracts {\n serialize: (\n value: Record<Encoded.ContractAddress, TxParams & { tag: Tag.Contract }>,\n ) => Buffer;\n deserialize: (\n value: Buffer,\n ) => Record<Encoded.ContractAddress, TxUnpacked & { tag: Tag.Contract }>;\n recursiveType: true;\n}\n\nconst mapContracts = map(Encoding.ContractAddress, Tag.Contract) as unknown as MapContracts;\n\ninterface MapAccounts {\n serialize: (\n value: Record<Encoded.AccountAddress, TxParams & { tag: Tag.Account }>,\n ) => Buffer;\n deserialize: (value: Buffer) => Record<Encoded.AccountAddress, TxUnpacked & { tag: Tag.Account }>;\n recursiveType: true;\n}\n\nconst mapAccounts = map(Encoding.AccountAddress, Tag.Account) as unknown as MapAccounts;\n\ninterface MapCalls {\n serialize: (\n value: Record<Encoded.Bytearray, TxParams & { tag: Tag.ContractCall }>,\n ) => Buffer;\n deserialize: (value: Buffer) => Record<Encoded.Bytearray, TxUnpacked & { tag: Tag.ContractCall }>;\n recursiveType: true;\n}\n\nconst mapCalls = map(Encoding.Bytearray, Tag.ContractCall) as unknown as MapCalls;\n\ninterface MapChannels {\n serialize: (\n value: Record<Encoded.Channel, TxParams & { tag: Tag.Channel }>,\n ) => Buffer;\n deserialize: (value: Buffer) => Record<Encoded.Channel, TxUnpacked & { tag: Tag.Channel }>;\n recursiveType: true;\n}\n\nconst mapChannels = map(Encoding.Channel, Tag.Channel) as unknown as MapChannels;\n\ninterface MapNames {\n serialize: (\n value: Record<Encoded.Name, TxParams & { tag: Tag.Name }>,\n ) => Buffer;\n deserialize: (value: Buffer) => Record<Encoded.Name, TxUnpacked & { tag: Tag.Name }>;\n recursiveType: true;\n}\n\nconst mapNames = map(Encoding.Name, Tag.Name) as unknown as MapNames;\n\ninterface MapOracles {\n serialize: (\n value: Record<Encoded.OracleAddress, TxParams & { tag: Tag.Oracle }>,\n ) => Buffer;\n deserialize: (value: Buffer) => Record<Encoded.OracleAddress, TxUnpacked & { tag: Tag.Oracle }>;\n recursiveType: true;\n}\n\nconst mapOracles = map(Encoding.OracleAddress, Tag.Oracle) as unknown as MapOracles;\n\n/**\n * @see {@link https://github.com/aeternity/protocol/blob/c007deeac4a01e401238412801ac7084ac72d60e/serializations.md#accounts-version-1-basic-accounts}\n */\nexport const txSchema = [{\n tag: shortUIntConst(Tag.Account),\n version: shortUIntConst(1),\n nonce: shortUInt,\n balance: uInt,\n}, {\n tag: shortUIntConst(Tag.Account),\n version: shortUIntConst(2, true),\n flags: uInt,\n nonce: shortUInt,\n balance: uInt,\n gaContract: address(Encoding.ContractAddress, Encoding.Name),\n gaAuthFun: encoded(Encoding.ContractBytearray),\n}, {\n tag: shortUIntConst(Tag.SignedTx),\n version: shortUIntConst(1, true),\n signatures: array(raw),\n encodedTx: entryAny,\n}, {\n tag: shortUIntConst(Tag.SpendTx),\n version: shortUIntConst(1, true),\n senderId: address(Encoding.AccountAddress),\n recipientId: address(Encoding.AccountAddress, Encoding.Name),\n amount: coinAmount,\n fee,\n ttl,\n nonce: nonce('senderId'),\n payload: encoded(Encoding.Bytearray, true),\n}, {\n tag: shortUIntConst(Tag.Name),\n version: shortUIntConst(1, true),\n accountId: address(Encoding.AccountAddress),\n nameTtl: shortUInt,\n status: raw,\n clientTtl: shortUInt,\n pointers,\n}, {\n tag: shortUIntConst(Tag.NamePreclaimTx),\n version: shortUIntConst(1, true),\n accountId: address(Encoding.AccountAddress),\n nonce: nonce('accountId'),\n commitmentId: address(Encoding.Commitment),\n fee,\n ttl,\n}, {\n tag: shortUIntConst(Tag.NameClaimTx),\n version: shortUIntConst(2, true),\n accountId: address(Encoding.AccountAddress),\n nonce: nonce('accountId'),\n name,\n nameSalt: uInt,\n nameFee,\n fee,\n ttl,\n}, {\n tag: shortUIntConst(Tag.NameUpdateTx),\n version: shortUIntConst(1, true),\n accountId: address(Encoding.AccountAddress),\n nonce: nonce('accountId'),\n nameId,\n nameTtl: shortUInt,\n pointers,\n clientTtl: shortUInt,\n fee,\n ttl,\n}, {\n tag: shortUIntConst(Tag.NameTransferTx),\n version: shortUIntConst(1, true),\n accountId: address(Encoding.AccountAddress),\n nonce: nonce('accountId'),\n nameId,\n recipientId: address(Encoding.AccountAddress, Encoding.Name),\n fee,\n ttl,\n}, {\n tag: shortUIntConst(Tag.NameRevokeTx),\n version: shortUIntConst(1, true),\n accountId: address(Encoding.AccountAddress),\n nonce: nonce('accountId'),\n nameId,\n fee,\n ttl,\n}, {\n tag: shortUIntConst(Tag.Contract),\n version: shortUIntConst(1, true),\n owner: address(Encoding.AccountAddress),\n ctVersion,\n code: encoded(Encoding.ContractBytearray),\n log: encoded(Encoding.ContractBytearray),\n active: boolean,\n referers: array(address(Encoding.AccountAddress)),\n deposit,\n}, {\n tag: shortUIntConst(Tag.ContractCreateTx),\n version: shortUIntConst(1, true),\n ownerId: address(Encoding.AccountAddress),\n nonce: nonce('ownerId'),\n code: encoded(Encoding.ContractBytearray),\n ctVersion,\n fee,\n ttl,\n deposit,\n amount: coinAmount,\n gasLimit,\n gasPrice,\n callData: encoded(Encoding.ContractBytearray),\n}, {\n tag: shortUIntConst(Tag.ContractCallTx),\n version: shortUIntConst(1, true),\n callerId: address(Encoding.AccountAddress),\n nonce: nonce('callerId'),\n contractId: address(Encoding.ContractAddress, Encoding.Name),\n abiVersion,\n fee,\n ttl,\n amount: coinAmount,\n gasLimit,\n gasPrice,\n callData: encoded(Encoding.ContractBytearray),\n}, {\n tag: shortUIntConst(Tag.ContractCall),\n version: shortUIntConst(2, true),\n callerId: address(Encoding.AccountAddress),\n callerNonce: shortUInt,\n height: shortUInt,\n contractId: address(Encoding.ContractAddress),\n // TODO: rename after resolving https://github.com/aeternity/protocol/issues/506\n gasPrice: uInt,\n gasUsed: shortUInt,\n returnValue: encoded(Encoding.ContractBytearray),\n returnType: enumeration(CallReturnType),\n // TODO: add serialization for\n // <log> :: [ { <address> :: id, [ <topics> :: binary() }, <data> :: binary() } ]\n log: array(raw),\n}, {\n tag: shortUIntConst(Tag.Oracle),\n version: shortUIntConst(1, true),\n accountId: address(Encoding.AccountAddress),\n queryFormat: string,\n responseFormat: string,\n queryFee: coinAmount,\n oracleTtlValue: shortUInt,\n abiVersion,\n}, {\n tag: shortUIntConst(Tag.OracleRegisterTx),\n version: shortUIntConst(1, true),\n accountId: address(Encoding.AccountAddress),\n nonce: nonce('accountId'),\n queryFormat: string,\n responseFormat: string,\n queryFee: coinAmount,\n oracleTtlType: enumeration(ORACLE_TTL_TYPES),\n oracleTtlValue: shortUInt,\n fee,\n ttl,\n abiVersion,\n}, {\n tag: shortUIntConst(Tag.OracleExtendTx),\n version: shortUIntConst(1, true),\n oracleId: address(Encoding.OracleAddress, Encoding.Name),\n nonce: nonce('oracleId'),\n oracleTtlType: enumeration(ORACLE_TTL_TYPES),\n oracleTtlValue: shortUInt,\n fee,\n ttl,\n}, {\n tag: shortUIntConst(Tag.OracleQueryTx),\n version: shortUIntConst(1, true),\n senderId: address(Encoding.AccountAddress),\n nonce: nonce('senderId'),\n oracleId: address(Encoding.OracleAddress, Encoding.Name),\n query: string,\n queryFee: coinAmount,\n queryTtlType: enumeration(ORACLE_TTL_TYPES),\n queryTtlValue: shortUInt,\n responseTtlType: enumeration(ORACLE_TTL_TYPES),\n responseTtlValue: shortUInt,\n fee,\n ttl,\n}, {\n tag: shortUIntConst(Tag.OracleResponseTx),\n version: shortUIntConst(1, true),\n oracleId: address(Encoding.OracleAddress),\n nonce: nonce('oracleId'),\n queryId: encoded(Encoding.OracleQueryId),\n response: string,\n responseTtlType: enumeration(ORACLE_TTL_TYPES),\n responseTtlValue: shortUInt,\n fee,\n ttl,\n}, {\n tag: shortUIntConst(Tag.ChannelCreateTx),\n version: shortUIntConst(2, true),\n initiator: address(Encoding.AccountAddress),\n initiatorAmount: uInt,\n responder: address(Encoding.AccountAddress),\n responderAmount: uInt,\n channelReserve: uInt,\n lockPeriod: uInt,\n ttl,\n fee,\n initiatorDelegateIds: array(address(...idTagToEncoding)),\n responderDelegateIds: array(address(...idTagToEncoding)),\n stateHash: encoded(Encoding.State),\n nonce: nonce('initiator'),\n}, {\n tag: shortUIntConst(Tag.ChannelCloseMutualTx),\n version: shortUIntConst(1, true),\n channelId: address(Encoding.Channel),\n fromId: address(Encoding.AccountAddress),\n initiatorAmountFinal: uInt,\n responderAmountFinal: uInt,\n ttl,\n fee,\n nonce: nonce('fromId'),\n}, {\n tag: shortUIntConst(Tag.ChannelCloseSoloTx),\n version: shortUIntConst(1, true),\n channelId: address(Encoding.Channel),\n fromId: address(Encoding.AccountAddress),\n payload: encoded(Encoding.Transaction),\n poi: entryTreesPoi,\n ttl,\n fee,\n nonce: nonce('fromId'),\n}, {\n tag: shortUIntConst(Tag.ChannelSlashTx),\n version: shortUIntConst(1, true),\n channelId: address(Encoding.Channel),\n fromId: address(Encoding.AccountAddress),\n payload: encoded(Encoding.Transaction),\n poi: entryTreesPoi,\n ttl,\n fee,\n nonce: nonce('fromId'),\n}, {\n tag: shortUIntConst(Tag.ChannelDepositTx),\n version: shortUIntConst(1, true),\n channelId: address(Encoding.Channel),\n fromId: address(Encoding.AccountAddress),\n amount: uInt,\n ttl,\n fee,\n stateHash: encoded(Encoding.State),\n round: shortUInt,\n nonce: nonce('fromId'),\n}, {\n tag: shortUIntConst(Tag.ChannelWithdrawTx),\n version: shortUIntConst(1, true),\n channelId: address(Encoding.Channel),\n toId: address(Encoding.AccountAddress),\n amount: uInt,\n ttl,\n fee,\n stateHash: encoded(Encoding.State),\n round: shortUInt,\n nonce: nonce('fromId'),\n}, {\n tag: shortUIntConst(Tag.ChannelSettleTx),\n version: shortUIntConst(1, true),\n channelId: address(Encoding.Channel),\n fromId: address(Encoding.AccountAddress),\n initiatorAmountFinal: uInt,\n responderAmountFinal: uInt,\n ttl,\n fee,\n nonce: nonce('fromId'),\n}, {\n tag: shortUIntConst(Tag.ChannelForceProgressTx),\n version: shortUIntConst(1, true),\n channelId: address(Encoding.Channel),\n fromId: address(Encoding.AccountAddress),\n payload: encoded(Encoding.Transaction),\n round: shortUInt,\n update: encoded(Encoding.ContractBytearray),\n stateHash: encoded(Encoding.State),\n offChainTrees: encoded(Encoding.StateTrees),\n ttl,\n fee,\n nonce: nonce('fromId'),\n}, {\n tag: shortUIntConst(Tag.ChannelOffChainTx),\n version: shortUIntConst(2, true),\n channelId: address(Encoding.Channel),\n round: shortUInt,\n stateHash: encoded(Encoding.State),\n}, {\n tag: shortUIntConst(Tag.Channel),\n version: shortUIntConst(3, true),\n initiator: address(Encoding.AccountAddress),\n responder: address(Encoding.AccountAddress),\n channelAmount: uInt,\n initiatorAmount: uInt,\n responderAmount: uInt,\n channelReserve: uInt,\n initiatorDelegateIds: array(address(...idTagToEncoding)),\n responderDelegateIds: array(address(...idTagToEncoding)),\n stateHash: encoded(Encoding.State),\n round: shortUInt,\n soloRound: uInt,\n lockPeriod: uInt,\n lockedUntil: uInt,\n initiatorAuth: encoded(Encoding.ContractBytearray),\n responderAuth: encoded(Encoding.ContractBytearray),\n}, {\n tag: shortUIntConst(Tag.ChannelSnapshotSoloTx),\n version: shortUIntConst(1, true),\n channelId: address(Encoding.Channel),\n fromId: address(Encoding.AccountAddress),\n payload: encoded(Encoding.Transaction),\n ttl,\n fee,\n nonce: nonce('fromId'),\n}, {\n tag: shortUIntConst(Tag.ChannelOffChainUpdateTransfer),\n version: shortUIntConst(1, true),\n from: address(Encoding.AccountAddress),\n to: address(Encoding.AccountAddress),\n amount: uInt,\n}, {\n tag: shortUIntConst(Tag.ChannelOffChainUpdateDeposit),\n version: shortUIntConst(1, true),\n from: address(Encoding.AccountAddress),\n amount: uInt,\n}, {\n tag: shortUIntConst(Tag.ChannelOffChainUpdateWithdraw),\n version: shortUIntConst(1, true),\n from: address(Encoding.AccountAddress),\n amount: uInt,\n}, {\n tag: shortUIntConst(Tag.ChannelOffChainUpdateCreateContract),\n version: shortUIntConst(1, true),\n owner: address(Encoding.AccountAddress),\n ctVersion,\n code: encoded(Encoding.ContractBytearray),\n deposit: uInt,\n callData: encoded(Encoding.ContractBytearray),\n}, {\n tag: shortUIntConst(Tag.ChannelOffChainUpdateCallContract),\n version: shortUIntConst(1, true),\n caller: address(Encoding.AccountAddress),\n contract: address(Encoding.ContractAddress),\n abiVersion,\n amount: uInt,\n callData: encoded(Encoding.ContractBytearray),\n callStack: raw,\n gasPrice,\n gasLimit,\n}, {\n tag: shortUIntConst(Tag.ChannelClientReconnectTx),\n version: shortUIntConst(1, true),\n channelId: address(Encoding.Channel),\n round: shortUInt,\n role: string,\n pubkey: address(Encoding.AccountAddress),\n}, {\n tag: shortUIntConst(Tag.TreesPoi),\n version: shortUIntConst(1, true),\n // TODO: inline an extra wrapping array after resolving https://github.com/aeternity/protocol/issues/505\n accounts: array(mptree(Encoding.AccountAddress, Tag.Account)),\n calls: array(mptree(Encoding.Bytearray, Tag.ContractCall)),\n channels: array(mptree(Encoding.Channel, Tag.Channel)),\n contracts: array(mptree(Encoding.ContractAddress, Tag.Contract)),\n ns: array(mptree(Encoding.Name, Tag.Name)),\n oracles: array(mptree(Encoding.OracleAddress, Tag.Oracle)),\n}, {\n tag: shortUIntConst(Tag.StateTrees),\n version: shortUIntConst(0, true),\n contracts: wrapped(Tag.ContractsMtree) as unknown as MapContracts,\n calls: wrapped(Tag.CallsMtree) as unknown as MapCalls,\n channels: wrapped(Tag.ChannelsMtree) as unknown as MapChannels,\n ns: wrapped(Tag.NameserviceMtree) as unknown as MapNames,\n oracles: wrapped(Tag.OraclesMtree) as unknown as MapOracles,\n accounts: wrapped(Tag.AccountsMtree) as unknown as MapAccounts,\n}, {\n tag: shortUIntConst(Tag.Mtree),\n version: shortUIntConst(1, true),\n values: entryMtreeValueArray,\n}, {\n tag: shortUIntConst(Tag.MtreeValue),\n version: shortUIntConst(1, true),\n key: raw,\n value: raw,\n}, {\n tag: shortUIntConst(Tag.ContractsMtree),\n version: shortUIntConst(1, true),\n payload: mapContracts,\n}, {\n tag: shortUIntConst(Tag.CallsMtree),\n version: shortUIntConst(1, true),\n payload: mapCalls,\n}, {\n tag: shortUIntConst(Tag.ChannelsMtree),\n version: shortUIntConst(1, true),\n payload: mapChannels,\n}, {\n tag: shortUIntConst(Tag.NameserviceMtree),\n version: shortUIntConst(1, true),\n payload: mapNames,\n}, {\n tag: shortUIntConst(Tag.OraclesMtree),\n version: shortUIntConst(1, true),\n payload: mapOracles,\n}, {\n tag: shortUIntConst(Tag.AccountsMtree),\n version: shortUIntConst(1, true),\n payload: mapAccounts,\n}, {\n tag: shortUIntConst(Tag.GaAttachTx),\n version: shortUIntConst(1, true),\n ownerId: address(Encoding.AccountAddress),\n nonce: nonce('ownerId'),\n code: encoded(Encoding.ContractBytearray),\n authFun: raw,\n ctVersion,\n fee,\n ttl,\n gasLimit,\n gasPrice,\n callData: encoded(Encoding.ContractBytearray),\n}, {\n tag: shortUIntConst(Tag.GaMetaTx),\n version: shortUIntConst(2, true),\n gaId: address(Encoding.AccountAddress),\n authData: encoded(Encoding.ContractBytearray),\n abiVersion,\n fee,\n gasLimit,\n gasPrice,\n tx: entrySignedTx,\n}, {\n tag: shortUIntConst(Tag.PayingForTx),\n version: shortUIntConst(1, true),\n payerId: address(Encoding.AccountAddress),\n nonce: nonce('payerId'),\n fee,\n tx: entrySignedTx,\n}, {\n tag: shortUIntConst(Tag.GaMetaTxAuthData),\n version: shortUIntConst(1, true),\n fee: coinAmount,\n gasPrice,\n txHash: encoded(Encoding.TxHash),\n}] as const;\n\ntype TxSchema = SchemaTypes<typeof txSchema>;\nexport type TxParams = TxSchema['TxParams'];\nexport type TxParamsAsync = TxSchema['TxParamsAsync'];\nexport type TxUnpacked = TxSchema['TxUnpacked'];\n","import { decode as rlpDecode, encode as rlpEncode } from 'rlp';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../utils/encoder';\nimport { hash } from '../../utils/crypto';\nimport { BinaryData, Field } from './field-types';\nimport { txSchema } from './schema';\nimport { TxUnpacked, TxParams, TxParamsAsync } from './schema.generated';\nimport { Tag } from './constants';\nimport { buildContractId, readInt } from './helpers';\nimport { ArgumentError, DecodeError, SchemaNotFoundError } from '../../utils/errors';\n\n/**\n * JavaScript-based Transaction builder\n */\n\nexport function getSchema(tag: Tag, version?: number): Array<[string, Field]> {\n const schemas = txSchema.filter((s) => s.tag.constValue === tag);\n if (schemas.length === 0) throw new SchemaNotFoundError(`${Tag[tag]} (${tag})`, 0);\n version ??= Math.max(...schemas.map((schema) => schema.version.constValue));\n const schema = schemas.find((s) => s.version.constValue === version);\n if (schema == null) throw new SchemaNotFoundError(`${Tag[tag]} (${tag})`, version);\n return Object.entries(schema);\n}\n\n/**\n * Build transaction hash\n * @category transaction builder\n * @param params - Object with tx params\n * @param options - options\n * @param options.prefix - Prefix of transaction\n * @returns object Base64Check transaction hash with 'tx_' prefix\n */\nexport function buildTx<\n E extends Encoding = Encoding.Transaction,\n>(\n params: TxParams,\n {\n prefix,\n }: {\n prefix?: E;\n } = {},\n): Encoded.Generic<E> {\n const schema = getSchema(params.tag, params.version);\n\n const binary = schema.map(([key, field]) => (\n field.serialize(\n // @ts-expect-error the type of `params[key]` can't be determined accurately\n params[key],\n {\n ...params,\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n unpackTx,\n buildTx,\n rebuildTx: (overrideParams: any) => buildTx(\n { ...params, ...overrideParams },\n ),\n },\n params,\n )\n ));\n\n // @ts-expect-error looks like a TypeScript edge case\n return encode(rlpEncode(binary), prefix ?? Encoding.Transaction);\n}\n\nexport type BuildTxOptions <TxType extends Tag, OmitFields extends string> =\n Omit<TxParamsAsync & { tag: TxType }, 'tag' | OmitFields>;\n\n/**\n * @category transaction builder\n */\nexport async function buildTxAsync(params: TxParamsAsync): Promise<Encoded.Transaction> {\n await Promise.all(\n getSchema(params.tag, params.version)\n .map(async ([key, field]) => {\n if (field.prepare == null) return;\n // @ts-expect-error the type of `params[key]` can't be determined accurately\n params[key] = await field.prepare(params[key], params, params);\n }),\n );\n\n // @ts-expect-error after preparation properties should be compatible with sync tx builder\n return buildTx(params);\n}\n\n/**\n * Unpack transaction encoded as string\n * @category transaction builder\n * @param encodedTx - Transaction to unpack\n * @param txType - Expected transaction type\n * @returns Object with transaction param's\n */\nexport function unpackTx<TxType extends Tag>(\n encodedTx: Encoded.Transaction | Encoded.Poi | Encoded.StateTrees | Encoded.CallStateTree,\n txType?: TxType,\n): TxUnpacked & { tag: TxType } {\n const binary = rlpDecode(decode(encodedTx));\n const tag = +readInt(binary[0] as Buffer);\n const version = +readInt(binary[1] as Buffer);\n const schema = getSchema(tag, version);\n if (txType != null && txType !== tag) throw new DecodeError(`Expected transaction to have ${Tag[txType]} tag, got ${Tag[tag]} instead`);\n if (binary.length !== schema.length) {\n throw new ArgumentError('Transaction RLP length', schema.length, binary.length);\n }\n return schema.reduce<any>(\n (acc, [name, field], index) => {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n const deserialized = field.deserialize(binary[index] as BinaryData, { unpackTx });\n return { ...acc, [name]: deserialized };\n },\n {},\n ) as any;\n}\n\n/**\n * Build a transaction hash\n * @category transaction builder\n * @param rawTx - base64 or rlp encoded transaction\n * @returns Transaction hash\n */\nexport function buildTxHash(rawTx: Encoded.Transaction | Uint8Array): Encoded.TxHash {\n const data = typeof rawTx === 'string' && rawTx.startsWith('tx_')\n ? decode(rawTx)\n : rawTx;\n return encode(hash(data), Encoding.TxHash);\n}\n\n/**\n * Build a contract public key by contractCreateTx or gaAttach\n * @category contract\n * @param contractTx - Transaction\n * @returns Contract public key\n */\nexport function buildContractIdByContractTx(\n contractTx: Encoded.Transaction,\n): Encoded.ContractAddress {\n const params = unpackTx(contractTx);\n if (Tag.ContractCreateTx !== params.tag && Tag.GaAttachTx !== params.tag) {\n throw new ArgumentError('contractTx', 'a contractCreateTx or gaAttach', params.tag);\n }\n return buildContractId(params.ownerId, params.nonce);\n}\n","export default function semverSatisfies(\n version: string,\n geVersion: string,\n ltVersion: string,\n): boolean {\n const getComponents = (v: string): number[] => v\n .split(/[-+]/)[0].split('.').map((i) => +i);\n\n const versionComponents = getComponents(version);\n const geComponents = getComponents(geVersion);\n const ltComponents = getComponents(ltVersion);\n\n const base = Math.max(...versionComponents, ...geComponents, ...ltComponents) + 1;\n const componentsToNumber = (components: number[]): number => components.reverse()\n .reduce((acc, n, idx) => acc + n * base ** idx, 0);\n\n const vNumber = componentsToNumber(versionComponents);\n const geNumber = componentsToNumber(geComponents);\n const ltNumber = componentsToNumber(ltComponents);\n return vNumber >= geNumber && vNumber < ltNumber;\n}\n","import { RestError, PipelineResponse, PipelinePolicy } from '@azure/core-rest-pipeline';\nimport { AdditionalPolicyConfig } from '@azure/core-client';\nimport { pause } from './other';\nimport semverSatisfies from './semver-satisfies';\nimport { UnexpectedTsError, UnsupportedVersionError } from './errors';\n\nexport const genRequestQueuesPolicy = (): AdditionalPolicyConfig => {\n const requestQueues = new Map<string, Promise<unknown>>();\n\n return {\n policy: {\n name: 'request-queues',\n async sendRequest(request, next) {\n const key = request.headers.get('__queue');\n request.headers.delete('__queue');\n const getResponse = async (): Promise<PipelineResponse> => next(request);\n if (key == null) return getResponse();\n const req = (requestQueues.get(key) ?? Promise.resolve()).then(getResponse, getResponse);\n // TODO: remove after fixing https://github.com/aeternity/aeternity/issues/3803\n // gap to ensure that node won't reject the nonce\n requestQueues.set(key, req.then(async () => pause(750)));\n return req;\n },\n },\n position: 'perCall',\n };\n};\n\nexport const genCombineGetRequestsPolicy = (): AdditionalPolicyConfig => {\n const pendingGetRequests = new Map<string, Promise<PipelineResponse>>();\n\n return {\n policy: {\n name: 'combine-get-requests',\n async sendRequest(request, next) {\n if (request.method !== 'GET') return next(request);\n const key = JSON.stringify([request.url, request.body]);\n const response = pendingGetRequests.get(key) ?? next(request);\n pendingGetRequests.set(key, response);\n try {\n return await response;\n } finally {\n pendingGetRequests.delete(key);\n }\n },\n },\n position: 'perCall',\n };\n};\n\nexport const genAggressiveCacheGetResponsesPolicy = (): AdditionalPolicyConfig => {\n const getRequests = new Map<string, Promise<PipelineResponse>>();\n\n return {\n policy: {\n name: 'aggressive-cache-get-responses',\n async sendRequest(request, next) {\n if (request.method !== 'GET') return next(request);\n const key = JSON.stringify([request.url, request.body]);\n const response = getRequests.get(key) ?? next(request);\n getRequests.set(key, response);\n return response;\n },\n },\n position: 'perCall',\n };\n};\n\nexport const genErrorFormatterPolicy = (\n getMessage: (b: any) => string,\n): AdditionalPolicyConfig => ({\n policy: {\n name: 'error-formatter',\n async sendRequest(request, next) {\n try {\n return await next(request);\n } catch (error) {\n if (!(error instanceof RestError) || error.request == null) throw error;\n if (error.response?.bodyAsText == null) throw error;\n\n let body;\n try {\n body = JSON.parse(error.response.bodyAsText);\n } catch (e) {\n throw error;\n }\n error.message = `${new URL(error.request.url).pathname.slice(1)} error`;\n const message = getMessage(body);\n if (message !== '') error.message += `:${message}`;\n throw error;\n }\n },\n },\n position: 'perCall',\n});\n\nexport const genVersionCheckPolicy = (\n name: string,\n ignorePath: string,\n versionPromise: Promise<string | Error>,\n geVersion: string,\n ltVersion: string,\n): PipelinePolicy => ({\n name: 'version-check',\n async sendRequest(request, next) {\n if (new URL(request.url).pathname === ignorePath) return next(request);\n const version = await versionPromise;\n if (version instanceof Error) throw version;\n const args = [version, geVersion, ltVersion] as const;\n if (!semverSatisfies(...args)) throw new UnsupportedVersionError(name, ...args);\n return next(request);\n },\n});\n\nexport const genRetryOnFailurePolicy = (\n retryCount: number,\n retryOverallDelay: number,\n): AdditionalPolicyConfig => ({\n policy: {\n name: 'retry-on-failure',\n async sendRequest(request, next) {\n const statusesToNotRetry = [200, 400, 403];\n\n const intervals = new Array(retryCount).fill(0)\n .map((_, idx) => ((idx + 1) / retryCount) ** 2);\n const intervalSum = intervals.reduce((a, b) => a + b);\n const intervalsInMs = intervals.map((el) => (el / intervalSum) * retryOverallDelay);\n\n let error: Error | undefined;\n for (let attempt = 0; attempt <= retryCount; attempt += 1) {\n if (error != null) {\n if (\n !(error instanceof RestError)\n || statusesToNotRetry.includes(error.response?.status ?? 0)\n ) throw error;\n await pause(intervalsInMs[attempt - 1]);\n }\n try {\n return await next(request);\n } catch (e) {\n error = e;\n }\n }\n if (error == null) throw new UnexpectedTsError();\n throw error;\n },\n },\n position: 'perCall',\n});\n","import * as coreClient from \"@azure/core-client\";\n\nexport const Header: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Header\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevHash: {\n serializedName: \"prev_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevKeyHash: {\n serializedName: \"prev_key_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n miner: {\n serializedName: \"miner\",\n type: {\n name: \"String\"\n }\n },\n beneficiary: {\n serializedName: \"beneficiary\",\n type: {\n name: \"String\"\n }\n },\n target: {\n serializedName: \"target\",\n type: {\n name: \"String\"\n }\n },\n pow: {\n constraints: {\n MinItems: 42,\n MaxItems: 42\n },\n serializedName: \"pow\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n time: {\n serializedName: \"time\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n info: {\n serializedName: \"info\",\n type: {\n name: \"String\"\n }\n },\n pofHash: {\n serializedName: \"pof_hash\",\n type: {\n name: \"String\"\n }\n },\n txsHash: {\n serializedName: \"txs_hash\",\n type: {\n name: \"String\"\n }\n },\n signature: {\n serializedName: \"signature\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ErrorModel: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorModel\",\n modelProperties: {\n reason: {\n serializedName: \"reason\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const KeyBlock: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"KeyBlock\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevHash: {\n serializedName: \"prev_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevKeyHash: {\n serializedName: \"prev_key_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n miner: {\n serializedName: \"miner\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n beneficiary: {\n serializedName: \"beneficiary\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n target: {\n serializedName: \"target\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pow: {\n constraints: {\n MinItems: 42,\n MaxItems: 42\n },\n serializedName: \"pow\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n time: {\n serializedName: \"time\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n info: {\n serializedName: \"info\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const HashResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"HashResponse\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const HeightResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"HeightResponse\",\n modelProperties: {\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const MicroBlockHeader: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"MicroBlockHeader\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pofHash: {\n serializedName: \"pof_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevHash: {\n serializedName: \"prev_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevKeyHash: {\n serializedName: \"prev_key_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n txsHash: {\n serializedName: \"txs_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n signature: {\n serializedName: \"signature\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n time: {\n serializedName: \"time\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SignedTxs: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SignedTxs\",\n modelProperties: {\n transactions: {\n serializedName: \"transactions\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const SignedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SignedTx\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"Tx\"\n }\n },\n blockHeight: {\n serializedName: \"block_height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n blockHash: {\n serializedName: \"block_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n signatures: {\n serializedName: \"signatures\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Tx: coreClient.CompositeMapper = {\n serializedName: \"Tx\",\n type: {\n name: \"Composite\",\n className: \"Tx\",\n uberParent: \"Tx\",\n polymorphicDiscriminator: {\n serializedName: \"type\",\n clientName: \"type\"\n },\n modelProperties: {\n recipientId: {\n serializedName: \"recipient_id\",\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n type: {\n name: \"String\"\n }\n },\n initiatorId: {\n serializedName: \"initiator_id\",\n type: {\n name: \"String\"\n }\n },\n initiatorAmount: {\n serializedName: \"initiator_amount\",\n type: {\n name: \"String\"\n }\n },\n responderId: {\n serializedName: \"responder_id\",\n type: {\n name: \"String\"\n }\n },\n responderAmount: {\n serializedName: \"responder_amount\",\n type: {\n name: \"String\"\n }\n },\n channelReserve: {\n serializedName: \"channel_reserve\",\n type: {\n name: \"String\"\n }\n },\n lockPeriod: {\n serializedName: \"lock_period\",\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n type: {\n name: \"String\"\n }\n },\n delegateIds: {\n serializedName: \"delegate_ids\",\n type: {\n name: \"Composite\",\n className: \"Delegates\"\n }\n },\n channelId: {\n serializedName: \"channel_id\",\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n type: {\n name: \"String\"\n }\n },\n toId: {\n serializedName: \"to_id\",\n type: {\n name: \"String\"\n }\n },\n update: {\n serializedName: \"update\",\n type: {\n name: \"Composite\",\n className: \"OffChainUpdate\"\n }\n },\n offchainTrees: {\n serializedName: \"offchain_trees\",\n type: {\n name: \"String\"\n }\n },\n initiatorAmountFinal: {\n serializedName: \"initiator_amount_final\",\n type: {\n name: \"String\"\n }\n },\n responderAmountFinal: {\n serializedName: \"responder_amount_final\",\n type: {\n name: \"String\"\n }\n },\n poi: {\n serializedName: \"poi\",\n type: {\n name: \"String\"\n }\n },\n initiatorDelegateIds: {\n serializedName: \"initiator_delegate_ids\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n responderDelegateIds: {\n serializedName: \"responder_delegate_ids\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n queryFormat: {\n serializedName: \"query_format\",\n type: {\n name: \"String\"\n }\n },\n responseFormat: {\n serializedName: \"response_format\",\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n type: {\n name: \"String\"\n }\n },\n oracleTtl: {\n serializedName: \"oracle_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n type: {\n name: \"String\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n type: {\n name: \"String\"\n }\n },\n query: {\n serializedName: \"query\",\n type: {\n name: \"String\"\n }\n },\n queryTtl: {\n serializedName: \"query_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n queryId: {\n serializedName: \"query_id\",\n type: {\n name: \"String\"\n }\n },\n response: {\n serializedName: \"response\",\n type: {\n name: \"String\"\n }\n },\n commitmentId: {\n serializedName: \"commitment_id\",\n type: {\n name: \"String\"\n }\n },\n name: {\n serializedName: \"name\",\n type: {\n name: \"String\"\n }\n },\n nameSalt: {\n serializedName: \"name_salt\",\n type: {\n name: \"String\"\n }\n },\n nameFee: {\n serializedName: \"name_fee\",\n type: {\n name: \"String\"\n }\n },\n nameId: {\n serializedName: \"name_id\",\n type: {\n name: \"String\"\n }\n },\n nameTtl: {\n serializedName: \"name_ttl\",\n type: {\n name: \"String\"\n }\n },\n pointers: {\n serializedName: \"pointers\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"NamePointer\"\n }\n }\n }\n },\n clientTtl: {\n serializedName: \"client_ttl\",\n type: {\n name: \"String\"\n }\n },\n ownerId: {\n serializedName: \"owner_id\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n type: {\n name: \"String\"\n }\n },\n deposit: {\n serializedName: \"deposit\",\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n type: {\n name: \"String\"\n }\n },\n callerId: {\n serializedName: \"caller_id\",\n type: {\n name: \"String\"\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n type: {\n name: \"String\"\n }\n },\n authFun: {\n constraints: {\n Pattern: new RegExp(\"^(0x|0X)?[a-fA-F0-9]+$\")\n },\n serializedName: \"auth_fun\",\n type: {\n name: \"String\"\n }\n },\n gaId: {\n serializedName: \"ga_id\",\n type: {\n name: \"String\"\n }\n },\n authData: {\n serializedName: \"auth_data\",\n type: {\n name: \"String\"\n }\n },\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n },\n payerId: {\n serializedName: \"payer_id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\n \"SpendTx\",\n \"ChannelCreateTx\",\n \"ChannelDepositTx\",\n \"ChannelWithdrawTx\",\n \"ChannelForceProgressTx\",\n \"ChannelCloseMutualTx\",\n \"ChannelCloseSoloTx\",\n \"ChannelSlashTx\",\n \"ChannelSettleTx\",\n \"ChannelSnapshotSoloTx\",\n \"ChannelSetDelegatesTx\",\n \"OracleRegisterTx\",\n \"OracleExtendTx\",\n \"OracleQueryTx\",\n \"OracleRespondTx\",\n \"NamePreclaimTx\",\n \"NameClaimTx\",\n \"NameUpdateTx\",\n \"NameTransferTx\",\n \"NameRevokeTx\",\n \"ContractCreateTx\",\n \"ContractCallTx\",\n \"GAAttachTx\",\n \"GAMetaTx\",\n \"PayingForTx\"\n ]\n }\n }\n }\n }\n};\n\nexport const Delegates: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Delegates\",\n modelProperties: {\n initiator: {\n serializedName: \"initiator\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n responder: {\n serializedName: \"responder\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const OffChainUpdate: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OffChainUpdate\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: {\n serializedName: \"op\",\n clientName: \"op\"\n },\n modelProperties: {\n op: {\n serializedName: \"op\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const RelativeTTL: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\",\n modelProperties: {\n type: {\n defaultValue: \"delta\",\n isConstant: true,\n serializedName: \"type\",\n type: {\n name: \"String\"\n }\n },\n value: {\n serializedName: \"value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Ttl: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Ttl\",\n modelProperties: {\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"delta\", \"block\"]\n }\n },\n value: {\n serializedName: \"value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NamePointer: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NamePointer\",\n modelProperties: {\n key: {\n serializedName: \"key\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CountResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CountResponse\",\n modelProperties: {\n count: {\n serializedName: \"count\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Generation: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Generation\",\n modelProperties: {\n keyBlock: {\n serializedName: \"key_block\",\n type: {\n name: \"Composite\",\n className: \"KeyBlock\"\n }\n },\n microBlocks: {\n serializedName: \"micro_blocks\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Account: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Account\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n balance: {\n serializedName: \"balance\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payable: {\n serializedName: \"payable\",\n type: {\n name: \"Boolean\"\n }\n },\n kind: {\n serializedName: \"kind\",\n type: {\n name: \"Enum\",\n allowedValues: [\"basic\", \"generalized\"]\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n type: {\n name: \"String\"\n }\n },\n authFun: {\n serializedName: \"auth_fun\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NextNonceResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NextNonceResponse\",\n modelProperties: {\n nextNonce: {\n serializedName: \"next_nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DryRunInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunInput\",\n modelProperties: {\n top: {\n serializedName: \"top\",\n type: {\n name: \"String\"\n }\n },\n accounts: {\n serializedName: \"accounts\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"DryRunAccount\"\n }\n }\n }\n },\n txs: {\n serializedName: \"txs\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"DryRunInputItem\"\n }\n }\n }\n },\n txEvents: {\n defaultValue: false,\n serializedName: \"tx_events\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\n\nexport const DryRunAccount: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunAccount\",\n modelProperties: {\n pubKey: {\n serializedName: \"pub_key\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DryRunInputItem: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunInputItem\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"String\"\n }\n },\n callReq: {\n serializedName: \"call_req\",\n type: {\n name: \"Composite\",\n className: \"DryRunCallReq\"\n }\n }\n }\n }\n};\n\nexport const DryRunCallReq: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunCallReq\",\n modelProperties: {\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contract: {\n serializedName: \"contract\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n type: {\n name: \"String\"\n }\n },\n caller: {\n serializedName: \"caller\",\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n type: {\n name: \"String\"\n }\n },\n context: {\n serializedName: \"context\",\n type: {\n name: \"Composite\",\n className: \"DryRunCallContext\"\n }\n }\n }\n }\n};\n\nexport const DryRunCallContext: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunCallContext\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"String\"\n }\n },\n txHash: {\n serializedName: \"tx_hash\",\n type: {\n name: \"String\"\n }\n },\n stateful: {\n serializedName: \"stateful\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\n\nexport const DryRunResults: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunResults\",\n modelProperties: {\n results: {\n serializedName: \"results\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"DryRunResult\"\n }\n }\n }\n },\n txEvents: {\n serializedName: \"tx_events\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n }\n }\n};\n\nexport const DryRunResult: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunResult\",\n modelProperties: {\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n result: {\n serializedName: \"result\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n reason: {\n serializedName: \"reason\",\n type: {\n name: \"String\"\n }\n },\n callObj: {\n serializedName: \"call_obj\",\n type: {\n name: \"Composite\",\n className: \"ContractCallObject\"\n }\n }\n }\n }\n};\n\nexport const ContractCallObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractCallObject\",\n modelProperties: {\n callerId: {\n serializedName: \"caller_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callerNonce: {\n serializedName: \"caller_nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasUsed: {\n serializedName: \"gas_used\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n log: {\n serializedName: \"log\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"Event\"\n }\n }\n }\n },\n returnValue: {\n serializedName: \"return_value\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n returnType: {\n serializedName: \"return_type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"ok\", \"error\", \"revert\"]\n }\n }\n }\n }\n};\n\nexport const Event: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Event\",\n modelProperties: {\n address: {\n serializedName: \"address\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topics: {\n serializedName: \"topics\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n data: {\n serializedName: \"data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const TxInfoObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"TxInfoObject\",\n modelProperties: {\n callInfo: {\n serializedName: \"call_info\",\n type: {\n name: \"Composite\",\n className: \"ContractCallObject\"\n }\n },\n gaInfo: {\n serializedName: \"ga_info\",\n type: {\n name: \"Composite\",\n className: \"GAObject\"\n }\n },\n txInfo: {\n serializedName: \"tx_info\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const GAObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"GAObject\",\n modelProperties: {\n callerId: {\n serializedName: \"caller_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasUsed: {\n serializedName: \"gas_used\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n returnValue: {\n serializedName: \"return_value\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n returnType: {\n serializedName: \"return_type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"ok\", \"error\"]\n }\n },\n innerObject: {\n serializedName: \"inner_object\",\n type: {\n name: \"Composite\",\n className: \"TxInfoObject\"\n }\n }\n }\n }\n};\n\nexport const EncodedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EncodedTx\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PostTxResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PostTxResponse\",\n modelProperties: {\n txHash: {\n serializedName: \"tx_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ContractObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractObject\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ownerId: {\n serializedName: \"owner_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n active: {\n serializedName: \"active\",\n required: true,\n type: {\n name: \"Boolean\"\n }\n },\n referrerIds: {\n serializedName: \"referrer_ids\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n deposit: {\n serializedName: \"deposit\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ByteCode: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ByteCode\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PoI: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PoI\",\n modelProperties: {\n poi: {\n serializedName: \"poi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const RegisteredOracle: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"RegisteredOracle\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFormat: {\n serializedName: \"query_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseFormat: {\n serializedName: \"response_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleQueries: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleQueries\",\n modelProperties: {\n oracleQueries: {\n serializedName: \"oracle_queries\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"OracleQuery\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const OracleQuery: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleQuery\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n senderNonce: {\n serializedName: \"sender_nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n query: {\n serializedName: \"query\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n response: {\n serializedName: \"response\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameEntry: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameEntry\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n owner: {\n serializedName: \"owner\",\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pointers: {\n serializedName: \"pointers\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"NamePointer\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Channel: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Channel\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorId: {\n serializedName: \"initiator_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderId: {\n serializedName: \"responder_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n channelAmount: {\n serializedName: \"channel_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmount: {\n serializedName: \"initiator_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmount: {\n serializedName: \"responder_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n channelReserve: {\n serializedName: \"channel_reserve\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n delegateIds: {\n serializedName: \"delegate_ids\",\n type: {\n name: \"Composite\",\n className: \"Delegates\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n soloRound: {\n serializedName: \"solo_round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lockPeriod: {\n serializedName: \"lock_period\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lockedUntil: {\n serializedName: \"locked_until\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerPubKey: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerPubKey\",\n modelProperties: {\n pubkey: {\n serializedName: \"pubkey\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Status: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Status\",\n modelProperties: {\n genesisKeyBlockHash: {\n serializedName: \"genesis_key_block_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n solutions: {\n serializedName: \"solutions\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n difficulty: {\n serializedName: \"difficulty\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n syncing: {\n serializedName: \"syncing\",\n required: true,\n type: {\n name: \"Boolean\"\n }\n },\n syncProgress: {\n constraints: {\n InclusiveMaximum: 100,\n InclusiveMinimum: 0\n },\n serializedName: \"sync_progress\",\n type: {\n name: \"Number\"\n }\n },\n listening: {\n serializedName: \"listening\",\n required: true,\n type: {\n name: \"Boolean\"\n }\n },\n protocols: {\n serializedName: \"protocols\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"Protocol\"\n }\n }\n }\n },\n nodeVersion: {\n serializedName: \"node_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nodeRevision: {\n serializedName: \"node_revision\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n peerCount: {\n serializedName: \"peer_count\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n peerConnections: {\n serializedName: \"peer_connections\",\n type: {\n name: \"Composite\",\n className: \"PeerConnections\"\n }\n },\n pendingTransactionsCount: {\n serializedName: \"pending_transactions_count\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n networkId: {\n serializedName: \"network_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n peerPubkey: {\n serializedName: \"peer_pubkey\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topKeyBlockHash: {\n serializedName: \"top_key_block_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topBlockHeight: {\n serializedName: \"top_block_height\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Protocol: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Protocol\",\n modelProperties: {\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n effectiveAtHeight: {\n serializedName: \"effective_at_height\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerConnections: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerConnections\",\n modelProperties: {\n inbound: {\n serializedName: \"inbound\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n outbound: {\n serializedName: \"outbound\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SpendTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SpendTx\",\n modelProperties: {\n recipientId: {\n serializedName: \"recipient_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleRegisterTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleRegisterTx\",\n modelProperties: {\n queryFormat: {\n serializedName: \"query_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseFormat: {\n serializedName: \"response_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n oracleTtl: {\n serializedName: \"oracle_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleExtendTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleExtendTx\",\n modelProperties: {\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n oracleTtl: {\n serializedName: \"oracle_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleQueryTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleQueryTx\",\n modelProperties: {\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n query: {\n serializedName: \"query\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryTtl: {\n serializedName: \"query_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleRespondTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleRespondTx\",\n modelProperties: {\n queryId: {\n serializedName: \"query_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n response: {\n serializedName: \"response\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NamePreclaimTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NamePreclaimTx\",\n modelProperties: {\n commitmentId: {\n serializedName: \"commitment_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameClaimTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameClaimTx\",\n modelProperties: {\n name: {\n serializedName: \"name\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nameSalt: {\n serializedName: \"name_salt\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nameFee: {\n serializedName: \"name_fee\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameUpdateTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameUpdateTx\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nameTtl: {\n serializedName: \"name_ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pointers: {\n serializedName: \"pointers\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"NamePointer\"\n }\n }\n }\n },\n clientTtl: {\n serializedName: \"client_ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameTransferTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameTransferTx\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n recipientId: {\n serializedName: \"recipient_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameRevokeTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameRevokeTx\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CommitmentId: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CommitmentId\",\n modelProperties: {\n commitmentId: {\n serializedName: \"commitment_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameHash: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameHash\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelCreateTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelCreateTx\",\n modelProperties: {\n initiatorId: {\n serializedName: \"initiator_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmount: {\n serializedName: \"initiator_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderId: {\n serializedName: \"responder_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmount: {\n serializedName: \"responder_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n channelReserve: {\n serializedName: \"channel_reserve\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lockPeriod: {\n serializedName: \"lock_period\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n delegateIds: {\n serializedName: \"delegate_ids\",\n type: {\n name: \"Composite\",\n className: \"Delegates\"\n }\n }\n }\n }\n};\n\nexport const ChannelDepositTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelDepositTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelWithdrawTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelWithdrawTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n toId: {\n serializedName: \"to_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelForceProgressTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelForceProgressTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n update: {\n serializedName: \"update\",\n type: {\n name: \"Composite\",\n className: \"OffChainUpdate\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n offchainTrees: {\n serializedName: \"offchain_trees\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelCloseMutualTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelCloseMutualTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmountFinal: {\n serializedName: \"initiator_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmountFinal: {\n serializedName: \"responder_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelCloseSoloTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelCloseSoloTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n poi: {\n serializedName: \"poi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSlashTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSlashTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n poi: {\n serializedName: \"poi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSettleTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSettleTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmountFinal: {\n serializedName: \"initiator_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmountFinal: {\n serializedName: \"responder_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSnapshotSoloTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSnapshotSoloTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSetDelegatesTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSetDelegatesTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorDelegateIds: {\n serializedName: \"initiator_delegate_ids\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n responderDelegateIds: {\n serializedName: \"responder_delegate_ids\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PubKey: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PubKey\",\n modelProperties: {\n pubKey: {\n serializedName: \"pub_key\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerDetails: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerDetails\",\n modelProperties: {\n host: {\n serializedName: \"host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n port: {\n serializedName: \"port\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n firstSeen: {\n serializedName: \"first_seen\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lastSeen: {\n serializedName: \"last_seen\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n genesisHash: {\n serializedName: \"genesis_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topHash: {\n serializedName: \"top_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topDifficulty: {\n serializedName: \"top_difficulty\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n networkId: {\n serializedName: \"network_id\",\n type: {\n name: \"String\"\n }\n },\n nodeVersion: {\n serializedName: \"node_version\",\n type: {\n name: \"String\"\n }\n },\n nodeRevision: {\n serializedName: \"node_revision\",\n type: {\n name: \"String\"\n }\n },\n nodeVendor: {\n serializedName: \"node_vendor\",\n type: {\n name: \"String\"\n }\n },\n nodeOs: {\n serializedName: \"node_os\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Peers: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Peers\",\n modelProperties: {\n peers: {\n serializedName: \"peers\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n blocked: {\n serializedName: \"blocked\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const PeerCount: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerCount\",\n modelProperties: {\n connected: {\n serializedName: \"connected\",\n type: {\n name: \"Composite\",\n className: \"PeerCountConnected\"\n }\n },\n available: {\n serializedName: \"available\",\n type: {\n name: \"Composite\",\n className: \"PeerCountAvailable\"\n }\n },\n blocked: {\n serializedName: \"blocked\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerCountConnected: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerCountConnected\",\n modelProperties: {\n inbound: {\n serializedName: \"inbound\",\n type: {\n name: \"String\"\n }\n },\n outbound: {\n serializedName: \"outbound\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerCountAvailable: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerCountAvailable\",\n modelProperties: {\n verified: {\n serializedName: \"verified\",\n type: {\n name: \"String\"\n }\n },\n unverified: {\n serializedName: \"unverified\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ContractCreateTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractCreateTx\",\n modelProperties: {\n ownerId: {\n serializedName: \"owner_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n deposit: {\n serializedName: \"deposit\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ContractCallTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractCallTx\",\n modelProperties: {\n callerId: {\n serializedName: \"caller_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const UnsignedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"UnsignedTx\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const TokenSupply: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"TokenSupply\",\n modelProperties: {\n accounts: {\n serializedName: \"accounts\",\n type: {\n name: \"String\"\n }\n },\n contracts: {\n serializedName: \"contracts\",\n type: {\n name: \"String\"\n }\n },\n contractOracles: {\n serializedName: \"contract_oracles\",\n type: {\n name: \"String\"\n }\n },\n locked: {\n serializedName: \"locked\",\n type: {\n name: \"String\"\n }\n },\n oracles: {\n serializedName: \"oracles\",\n type: {\n name: \"String\"\n }\n },\n oracleQueries: {\n serializedName: \"oracle_queries\",\n type: {\n name: \"String\"\n }\n },\n pendingRewards: {\n serializedName: \"pending_rewards\",\n type: {\n name: \"String\"\n }\n },\n total: {\n serializedName: \"total\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const GAAttachTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"GAAttachTx\",\n modelProperties: {\n ownerId: {\n serializedName: \"owner_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n authFun: {\n constraints: {\n Pattern: new RegExp(\"^(0x|0X)?[a-fA-F0-9]+$\")\n },\n serializedName: \"auth_fun\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const GAMetaTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"GAMetaTx\",\n modelProperties: {\n gaId: {\n serializedName: \"ga_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n authData: {\n serializedName: \"auth_data\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n }\n }\n }\n};\n\nexport const PayingForTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PayingForTx\",\n modelProperties: {\n payerId: {\n serializedName: \"payer_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n }\n }\n }\n};\n\nexport const CheckTxInPoolResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CheckTxInPoolResponse\",\n modelProperties: {\n status: {\n serializedName: \"status\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainTransfer: coreClient.CompositeMapper = {\n serializedName: \"OffChainTransfer\",\n type: {\n name: \"Composite\",\n className: \"OffChainTransfer\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n from: {\n serializedName: \"from\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n to: {\n serializedName: \"to\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainWithdrawal: coreClient.CompositeMapper = {\n serializedName: \"OffChainWithdrawal\",\n type: {\n name: \"Composite\",\n className: \"OffChainWithdrawal\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n to: {\n serializedName: \"to\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainDeposit: coreClient.CompositeMapper = {\n serializedName: \"OffChainDeposit\",\n type: {\n name: \"Composite\",\n className: \"OffChainDeposit\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n from: {\n serializedName: \"from\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainNewContract: coreClient.CompositeMapper = {\n serializedName: \"OffChainNewContract\",\n type: {\n name: \"Composite\",\n className: \"OffChainNewContract\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n owner: {\n serializedName: \"owner\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n type: {\n name: \"Composite\",\n className: \"ByteCode\"\n }\n },\n deposit: {\n serializedName: \"deposit\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainCallContract: coreClient.CompositeMapper = {\n serializedName: \"OffChainCallContract\",\n type: {\n name: \"Composite\",\n className: \"OffChainCallContract\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n caller: {\n serializedName: \"caller\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contract: {\n serializedName: \"contract\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CreateContractUnsignedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CreateContractUnsignedTx\",\n modelProperties: {\n ...UnsignedTx.type.modelProperties,\n contractId: {\n serializedName: \"contract_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport let discriminators = {\n \"Tx.Tx\": Tx,\n OffChainUpdate: OffChainUpdate,\n \"OffChainUpdate.OffChainTransfer\": OffChainTransfer,\n \"OffChainUpdate.OffChainWithdrawal\": OffChainWithdrawal,\n \"OffChainUpdate.OffChainDeposit\": OffChainDeposit,\n \"OffChainUpdate.OffChainNewContract\": OffChainNewContract,\n \"OffChainUpdate.OffChainCallContract\": OffChainCallContract\n};\n","import {\n OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport {\n DryRunInput as DryRunInputMapper,\n EncodedTx as EncodedTxMapper\n} from \"../models/mappers\";\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const $host: OperationURLParameter = {\n parameterPath: \"$host\",\n mapper: {\n serializedName: \"$host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const intAsString: OperationQueryParameter = {\n parameterPath: \"intAsString\",\n mapper: {\n defaultValue: false,\n serializedName: \"int-as-string\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n\nexport const hash: OperationURLParameter = {\n parameterPath: \"hash\",\n mapper: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const height: OperationURLParameter = {\n parameterPath: \"height\",\n mapper: {\n constraints: {\n InclusiveMaximum: 18446744073709552000,\n InclusiveMinimum: 0\n },\n serializedName: \"height\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const index: OperationURLParameter = {\n parameterPath: \"index\",\n mapper: {\n constraints: {\n InclusiveMinimum: 1\n },\n serializedName: \"index\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const pubkey: OperationURLParameter = {\n parameterPath: \"pubkey\",\n mapper: {\n serializedName: \"pubkey\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const strategy: OperationQueryParameter = {\n parameterPath: [\"options\", \"strategy\"],\n mapper: {\n defaultValue: \"max\",\n serializedName: \"strategy\",\n type: {\n name: \"Enum\",\n allowedValues: [\"max\", \"continuity\"]\n }\n }\n};\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const body: OperationParameter = {\n parameterPath: \"body\",\n mapper: DryRunInputMapper\n};\n\nexport const body1: OperationParameter = {\n parameterPath: \"body\",\n mapper: EncodedTxMapper\n};\n\nexport const from: OperationQueryParameter = {\n parameterPath: [\"options\", \"from\"],\n mapper: {\n serializedName: \"from\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const limit: OperationQueryParameter = {\n parameterPath: [\"options\", \"limit\"],\n mapper: {\n defaultValue: 20,\n constraints: {\n InclusiveMaximum: 1000,\n InclusiveMinimum: 1\n },\n serializedName: \"limit\",\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const type: OperationQueryParameter = {\n parameterPath: [\"options\", \"type\"],\n mapper: {\n defaultValue: \"all\",\n serializedName: \"type\",\n type: {\n name: \"Enum\",\n allowedValues: [\"open\", \"closed\", \"all\"]\n }\n }\n};\n\nexport const queryId: OperationURLParameter = {\n parameterPath: \"queryId\",\n mapper: {\n serializedName: \"query-id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const name: OperationURLParameter = {\n parameterPath: \"name\",\n mapper: {\n serializedName: \"name\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n","import * as coreClient from \"@azure/core-client\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n NodeOptionalParams,\n GetTopHeaderOptionalParams,\n GetTopHeaderResponse,\n GetCurrentKeyBlockOptionalParams,\n GetCurrentKeyBlockResponse,\n GetCurrentKeyBlockHashOptionalParams,\n GetCurrentKeyBlockHashResponse,\n GetCurrentKeyBlockHeightOptionalParams,\n GetCurrentKeyBlockHeightResponse,\n GetPendingKeyBlockOptionalParams,\n GetPendingKeyBlockResponse,\n GetKeyBlockByHashOptionalParams,\n GetKeyBlockByHashResponse,\n GetKeyBlockByHeightOptionalParams,\n GetKeyBlockByHeightResponse,\n GetMicroBlockHeaderByHashOptionalParams,\n GetMicroBlockHeaderByHashResponse,\n GetMicroBlockTransactionsByHashOptionalParams,\n GetMicroBlockTransactionsByHashResponse,\n GetMicroBlockTransactionByHashAndIndexOptionalParams,\n GetMicroBlockTransactionByHashAndIndexResponse,\n GetMicroBlockTransactionsCountByHashOptionalParams,\n GetMicroBlockTransactionsCountByHashResponse,\n GetCurrentGenerationOptionalParams,\n GetCurrentGenerationResponse,\n GetGenerationByHashOptionalParams,\n GetGenerationByHashResponse,\n GetGenerationByHeightOptionalParams,\n GetGenerationByHeightResponse,\n GetAccountByPubkeyOptionalParams,\n GetAccountByPubkeyResponse,\n GetAccountByPubkeyAndHeightOptionalParams,\n GetAccountByPubkeyAndHeightResponse,\n GetAccountByPubkeyAndHashOptionalParams,\n GetAccountByPubkeyAndHashResponse,\n GetPendingAccountTransactionsByPubkeyOptionalParams,\n GetPendingAccountTransactionsByPubkeyResponse,\n GetAccountNextNonceOptionalParams,\n GetAccountNextNonceResponse,\n DryRunInput,\n ProtectedDryRunTxsOptionalParams,\n ProtectedDryRunTxsResponse,\n GetTransactionByHashOptionalParams,\n GetTransactionByHashResponse,\n GetTransactionInfoByHashOptionalParams,\n GetTransactionInfoByHashResponse,\n EncodedTx,\n PostTransactionOptionalParams,\n PostTransactionResponse,\n GetContractOptionalParams,\n GetContractResponse,\n GetContractCodeOptionalParams,\n GetContractCodeResponse,\n GetContractPoIOptionalParams,\n GetContractPoIResponse,\n GetOracleByPubkeyOptionalParams,\n GetOracleByPubkeyResponse,\n GetOracleQueriesByPubkeyOptionalParams,\n GetOracleQueriesByPubkeyResponse,\n GetOracleQueryByPubkeyAndQueryIdOptionalParams,\n GetOracleQueryByPubkeyAndQueryIdResponse,\n GetNameEntryByNameOptionalParams,\n GetNameEntryByNameResponse,\n GetChannelByPubkeyOptionalParams,\n GetChannelByPubkeyResponse,\n GetPeerPubkeyOptionalParams,\n GetPeerPubkeyResponse,\n GetStatusOptionalParams,\n GetStatusResponse,\n GetChainEndsOptionalParams,\n GetChainEndsResponse\n} from \"./models\";\n\nexport class Node extends coreClient.ServiceClient {\n $host: string;\n intAsString?: boolean;\n\n /**\n * Initializes a new instance of the Node class.\n * @param $host server parameter\n * @param options The parameter options\n */\n constructor($host: string, options?: NodeOptionalParams) {\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: NodeOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-node/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 * Get the top header (either key or micro block)\n * @param options The options parameters.\n */\n getTopHeader(\n options?: GetTopHeaderOptionalParams\n ): Promise<GetTopHeaderResponse> {\n return this.sendOperationRequest({ options }, getTopHeaderOperationSpec);\n }\n\n /**\n * Get the current key block\n * @param options The options parameters.\n */\n getCurrentKeyBlock(\n options?: GetCurrentKeyBlockOptionalParams\n ): Promise<GetCurrentKeyBlockResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentKeyBlockOperationSpec\n );\n }\n\n /**\n * Get the hash of the current key block\n * @param options The options parameters.\n */\n getCurrentKeyBlockHash(\n options?: GetCurrentKeyBlockHashOptionalParams\n ): Promise<GetCurrentKeyBlockHashResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentKeyBlockHashOperationSpec\n );\n }\n\n /**\n * Get the height of the current key block\n * @param options The options parameters.\n */\n getCurrentKeyBlockHeight(\n options?: GetCurrentKeyBlockHeightOptionalParams\n ): Promise<GetCurrentKeyBlockHeightResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentKeyBlockHeightOperationSpec\n );\n }\n\n /**\n * Get the pending key block\n * @param options The options parameters.\n */\n getPendingKeyBlock(\n options?: GetPendingKeyBlockOptionalParams\n ): Promise<GetPendingKeyBlockResponse> {\n return this.sendOperationRequest(\n { options },\n getPendingKeyBlockOperationSpec\n );\n }\n\n /**\n * Get a key block by hash\n * @param hash The hash of the block - either a keyblock or a microblock\n * @param options The options parameters.\n */\n getKeyBlockByHash(\n hash: string,\n options?: GetKeyBlockByHashOptionalParams\n ): Promise<GetKeyBlockByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getKeyBlockByHashOperationSpec\n );\n }\n\n /**\n * Get a key block by height\n * @param height The height\n * @param options The options parameters.\n */\n getKeyBlockByHeight(\n height: number,\n options?: GetKeyBlockByHeightOptionalParams\n ): Promise<GetKeyBlockByHeightResponse> {\n return this.sendOperationRequest(\n { height, options },\n getKeyBlockByHeightOperationSpec\n );\n }\n\n /**\n * Get a micro block header by hash\n * @param hash The hash of the block - either a keyblock or a microblock\n * @param options The options parameters.\n */\n getMicroBlockHeaderByHash(\n hash: string,\n options?: GetMicroBlockHeaderByHashOptionalParams\n ): Promise<GetMicroBlockHeaderByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getMicroBlockHeaderByHashOperationSpec\n );\n }\n\n /**\n * Get micro block transactions by hash\n * @param hash The hash of the micro block\n * @param options The options parameters.\n */\n getMicroBlockTransactionsByHash(\n hash: string,\n options?: GetMicroBlockTransactionsByHashOptionalParams\n ): Promise<GetMicroBlockTransactionsByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getMicroBlockTransactionsByHashOperationSpec\n );\n }\n\n /**\n * Get a micro block transaction by hash and index\n * @param hash The hash of the micro block\n * @param index The index of the transaction in a block\n * @param options The options parameters.\n */\n getMicroBlockTransactionByHashAndIndex(\n hash: string,\n index: number,\n options?: GetMicroBlockTransactionByHashAndIndexOptionalParams\n ): Promise<GetMicroBlockTransactionByHashAndIndexResponse> {\n return this.sendOperationRequest(\n { hash, index, options },\n getMicroBlockTransactionByHashAndIndexOperationSpec\n );\n }\n\n /**\n * Get micro block transaction count by hash\n * @param hash The hash of the micro block\n * @param options The options parameters.\n */\n getMicroBlockTransactionsCountByHash(\n hash: string,\n options?: GetMicroBlockTransactionsCountByHashOptionalParams\n ): Promise<GetMicroBlockTransactionsCountByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getMicroBlockTransactionsCountByHashOperationSpec\n );\n }\n\n /**\n * Get the current generation\n * @param options The options parameters.\n */\n getCurrentGeneration(\n options?: GetCurrentGenerationOptionalParams\n ): Promise<GetCurrentGenerationResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentGenerationOperationSpec\n );\n }\n\n /**\n * Get a generation by hash\n * @param hash The hash of the key block\n * @param options The options parameters.\n */\n getGenerationByHash(\n hash: string,\n options?: GetGenerationByHashOptionalParams\n ): Promise<GetGenerationByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getGenerationByHashOperationSpec\n );\n }\n\n /**\n * Get a generation by height\n * @param height The height\n * @param options The options parameters.\n */\n getGenerationByHeight(\n height: number,\n options?: GetGenerationByHeightOptionalParams\n ): Promise<GetGenerationByHeightResponse> {\n return this.sendOperationRequest(\n { height, options },\n getGenerationByHeightOperationSpec\n );\n }\n\n /**\n * Get an account by public key\n * @param pubkey The public key of the account\n * @param options The options parameters.\n */\n getAccountByPubkey(\n pubkey: string,\n options?: GetAccountByPubkeyOptionalParams\n ): Promise<GetAccountByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getAccountByPubkeyOperationSpec\n );\n }\n\n /**\n * Get an account by public key after the opening key block of the generation at height\n * @param pubkey The public key of the account\n * @param height The height\n * @param options The options parameters.\n */\n getAccountByPubkeyAndHeight(\n pubkey: string,\n height: number,\n options?: GetAccountByPubkeyAndHeightOptionalParams\n ): Promise<GetAccountByPubkeyAndHeightResponse> {\n return this.sendOperationRequest(\n { pubkey, height, options },\n getAccountByPubkeyAndHeightOperationSpec\n );\n }\n\n /**\n * Get an account by public key after the block indicated by hash. Can be either a micro block or a\n * keyblock hash\n * @param pubkey The public key of the account\n * @param hash The hash of the block - either a keyblock or a microblock\n * @param options The options parameters.\n */\n getAccountByPubkeyAndHash(\n pubkey: string,\n hash: string,\n options?: GetAccountByPubkeyAndHashOptionalParams\n ): Promise<GetAccountByPubkeyAndHashResponse> {\n return this.sendOperationRequest(\n { pubkey, hash, options },\n getAccountByPubkeyAndHashOperationSpec\n );\n }\n\n /**\n * Get pending account transactions by public key\n * @param pubkey The public key of the account\n * @param options The options parameters.\n */\n getPendingAccountTransactionsByPubkey(\n pubkey: string,\n options?: GetPendingAccountTransactionsByPubkeyOptionalParams\n ): Promise<GetPendingAccountTransactionsByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getPendingAccountTransactionsByPubkeyOperationSpec\n );\n }\n\n /**\n * Get an account's next nonce; This is computed according to whatever is the current account nonce and\n * what transactions are currently present in the transaction pool\n * @param pubkey The public key of the account\n * @param options The options parameters.\n */\n getAccountNextNonce(\n pubkey: string,\n options?: GetAccountNextNonceOptionalParams\n ): Promise<GetAccountNextNonceResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getAccountNextNonceOperationSpec\n );\n }\n\n /**\n * Dry-run transactions on top of a given block. Supports all TXs except GAMetaTx, PayingForTx and\n * OffchainTx. The maximum gas limit of all calls is capped. The maximum gas limit per request is a\n * global node setting. Since DryRunCallReq object do not have a mandatory gas field, if not set a\n * default value of 1000000 is being used instead.\n * @param body transactions\n * @param options The options parameters.\n */\n protectedDryRunTxs(\n body: DryRunInput,\n options?: ProtectedDryRunTxsOptionalParams\n ): Promise<ProtectedDryRunTxsResponse> {\n return this.sendOperationRequest(\n { body, options },\n protectedDryRunTxsOperationSpec\n );\n }\n\n /**\n * Get a transaction by hash\n * @param hash The hash of the transaction\n * @param options The options parameters.\n */\n getTransactionByHash(\n hash: string,\n options?: GetTransactionByHashOptionalParams\n ): Promise<GetTransactionByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getTransactionByHashOperationSpec\n );\n }\n\n /**\n * @param hash The hash of the transaction\n * @param options The options parameters.\n */\n getTransactionInfoByHash(\n hash: string,\n options?: GetTransactionInfoByHashOptionalParams\n ): Promise<GetTransactionInfoByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getTransactionInfoByHashOperationSpec\n );\n }\n\n /**\n * Post a new transaction\n * @param body The new transaction\n * @param options The options parameters.\n */\n postTransaction(\n body: EncodedTx,\n options?: PostTransactionOptionalParams\n ): Promise<PostTransactionResponse> {\n return this.sendOperationRequest(\n { body, options },\n postTransactionOperationSpec\n );\n }\n\n /**\n * Get a contract by pubkey\n * @param pubkey Contract pubkey to get proof for\n * @param options The options parameters.\n */\n getContract(\n pubkey: string,\n options?: GetContractOptionalParams\n ): Promise<GetContractResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getContractOperationSpec\n );\n }\n\n /**\n * Get contract code by pubkey\n * @param pubkey Contract pubkey to get proof for\n * @param options The options parameters.\n */\n getContractCode(\n pubkey: string,\n options?: GetContractCodeOptionalParams\n ): Promise<GetContractCodeResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getContractCodeOperationSpec\n );\n }\n\n /**\n * Get a proof of inclusion for a contract\n * @param pubkey Contract pubkey to get proof for\n * @param options The options parameters.\n */\n getContractPoI(\n pubkey: string,\n options?: GetContractPoIOptionalParams\n ): Promise<GetContractPoIResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getContractPoIOperationSpec\n );\n }\n\n /**\n * Get an oracle by public key\n * @param pubkey The public key of the oracle\n * @param options The options parameters.\n */\n getOracleByPubkey(\n pubkey: string,\n options?: GetOracleByPubkeyOptionalParams\n ): Promise<GetOracleByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getOracleByPubkeyOperationSpec\n );\n }\n\n /**\n * Get oracle queries by public key\n * @param pubkey The public key of the oracle\n * @param options The options parameters.\n */\n getOracleQueriesByPubkey(\n pubkey: string,\n options?: GetOracleQueriesByPubkeyOptionalParams\n ): Promise<GetOracleQueriesByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getOracleQueriesByPubkeyOperationSpec\n );\n }\n\n /**\n * Get an oracle query by public key and query ID\n * @param pubkey The public key of the oracle\n * @param queryId The ID of the query\n * @param options The options parameters.\n */\n getOracleQueryByPubkeyAndQueryId(\n pubkey: string,\n queryId: string,\n options?: GetOracleQueryByPubkeyAndQueryIdOptionalParams\n ): Promise<GetOracleQueryByPubkeyAndQueryIdResponse> {\n return this.sendOperationRequest(\n { pubkey, queryId, options },\n getOracleQueryByPubkeyAndQueryIdOperationSpec\n );\n }\n\n /**\n * Get name entry from naming system\n * @param name The name key of the name entry\n * @param options The options parameters.\n */\n getNameEntryByName(\n name: string,\n options?: GetNameEntryByNameOptionalParams\n ): Promise<GetNameEntryByNameResponse> {\n return this.sendOperationRequest(\n { name, options },\n getNameEntryByNameOperationSpec\n );\n }\n\n /**\n * Get channel by public key\n * @param pubkey The pubkey of the channel\n * @param options The options parameters.\n */\n getChannelByPubkey(\n pubkey: string,\n options?: GetChannelByPubkeyOptionalParams\n ): Promise<GetChannelByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getChannelByPubkeyOperationSpec\n );\n }\n\n /**\n * Get peer public key\n * @param options The options parameters.\n */\n getPeerPubkey(\n options?: GetPeerPubkeyOptionalParams\n ): Promise<GetPeerPubkeyResponse> {\n return this.sendOperationRequest({ options }, getPeerPubkeyOperationSpec);\n }\n\n /**\n * Get the status of a node\n * @param options The options parameters.\n */\n getStatus(options?: GetStatusOptionalParams): Promise<GetStatusResponse> {\n return this.sendOperationRequest({ options }, getStatusOperationSpec);\n }\n\n /**\n * Get oldest keyblock hashes counting from genesis including orphans\n * @param options The options parameters.\n */\n getChainEnds(\n options?: GetChainEndsOptionalParams\n ): Promise<GetChainEndsResponse> {\n return this.sendOperationRequest({ options }, getChainEndsOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getTopHeaderOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/headers/top\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Header\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentKeyBlockOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/current\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentKeyBlockHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/current/hash\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.HashResponse\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentKeyBlockHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/current/height\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.HeightResponse\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPendingKeyBlockOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/pending\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getKeyBlockByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/hash/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getKeyBlockByHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/height/{height}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.height],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockHeaderByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/header\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MicroBlockHeader\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockTransactionsByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/transactions\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTxs\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockTransactionByHashAndIndexOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/transactions/index/{index}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTx\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash, Parameters.index],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockTransactionsCountByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/transactions/count\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CountResponse\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentGenerationOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/generations/current\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Generation\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getGenerationByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/generations/hash/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Generation\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getGenerationByHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/generations/height/{height}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Generation\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.height],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Account\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountByPubkeyAndHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/height/{height}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Account\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.height, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountByPubkeyAndHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/hash/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Account\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPendingAccountTransactionsByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/transactions/pending\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTxs\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountNextNonceOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/next-nonce\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.NextNonceResponse\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString, Parameters.strategy],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst protectedDryRunTxsOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/dry-run\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DryRunResults\n },\n 403: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body,\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getTransactionByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/transactions/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTx\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getTransactionInfoByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/transactions/{hash}/info\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.TxInfoObject\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst postTransactionOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/transactions\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.PostTxResponse\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body1,\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getContractOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/contracts/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ContractObject\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getContractCodeOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/contracts/{pubkey}/code\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ByteCode\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getContractPoIOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/contracts/{pubkey}/poi\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PoI\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getOracleByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/oracles/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.RegisteredOracle\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getOracleQueriesByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/oracles/{pubkey}/queries\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OracleQueries\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [\n Parameters.intAsString,\n Parameters.from,\n Parameters.limit,\n Parameters.type\n ],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getOracleQueryByPubkeyAndQueryIdOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/oracles/{pubkey}/queries/{query-id}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OracleQuery\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey, Parameters.queryId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getNameEntryByNameOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/names/{name}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.NameEntry\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.name],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getChannelByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/channels/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Channel\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPeerPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/peers/pubkey\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PeerPubKey\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getStatusOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/status\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Status\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getChainEndsOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/status/chain-ends\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Sequence\", element: { type: { name: \"String\" } } }\n }\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\n","// eslint-disable-next-line max-classes-per-file\nimport BigNumber from 'bignumber.js';\nimport { OperationArguments, OperationSpec } from '@azure/core-client';\nimport {\n genRequestQueuesPolicy, genCombineGetRequestsPolicy, genErrorFormatterPolicy,\n genVersionCheckPolicy, genRetryOnFailurePolicy,\n} from './utils/autorest';\nimport { Node as NodeApi, NodeOptionalParams, ErrorModel } from './apis/node';\nimport { mapObject } from './utils/other';\nimport { Encoded } from './utils/encoder';\nimport { ConsensusProtocolVersion } from './tx/builder/constants';\n\nconst bigIntPropertyNames = [\n 'balance', 'queryFee', 'fee', 'amount', 'nameFee', 'channelAmount',\n 'initiatorAmount', 'responderAmount', 'channelReserve', 'initiatorAmountFinal',\n 'responderAmountFinal', 'gasPrice', 'deposit',\n] as const;\n\nconst numberPropertyNames = [\n 'time', 'gas', 'gasUsed', 'nameSalt',\n 'nonce', 'nextNonce', 'height', 'blockHeight', 'topBlockHeight',\n 'ttl', 'nameTtl', 'clientTtl',\n 'inbound', 'outbound', 'peerCount', 'pendingTransactionsCount', 'effectiveAtHeight',\n 'version', 'solutions', 'round',\n] as const;\n\nclass NodeTransformed extends NodeApi {\n override async sendOperationRequest(\n operationArguments: OperationArguments,\n operationSpec: OperationSpec,\n ): Promise<any> {\n const args = mapObject(\n operationArguments,\n ([key, value]) => [key, this.#encodeArg(value)],\n ) as OperationArguments;\n return this.#decodeRes(await super.sendOperationRequest(args, operationSpec));\n }\n\n #mapData(data: any, transform: {\n bigInt: (v: any) => any;\n number: (v: any) => any;\n }): unknown {\n if (Array.isArray(data)) return data.map((d) => this.#mapData(d, transform));\n if (data != null && typeof data === 'object') {\n return mapObject(data, ([key, value]) => {\n if (value == null) return [key, value];\n if (bigIntPropertyNames.some((k) => k === key)) return [key, transform.bigInt(value)];\n if (numberPropertyNames.some((k) => k === key)) return [key, transform.number(value)];\n return [key, this.#mapData(value, transform)];\n });\n }\n return data;\n }\n\n #encodeArg(data: any): any {\n return this.#mapData(data, {\n bigInt: (value) => {\n if (value instanceof BigNumber) return value.toFixed();\n return value.toString();\n },\n number: (value) => value.toString(),\n });\n }\n\n #decodeRes(data: any): any {\n return this.#mapData(data, {\n bigInt: (value) => BigInt(value),\n number: (value) => +value,\n });\n }\n}\n\ntype BigIntPropertyNames = typeof bigIntPropertyNames[number];\ntype NumberPropertyNames = typeof numberPropertyNames[number];\ntype PreserveOptional<NewType, OrigType> =\n OrigType extends undefined ? NewType | undefined : NewType;\nexport type TransformNodeType<Type> =\n Type extends (...args: infer Args) => infer Ret\n ? (...args: TransformNodeType<Args>) => TransformNodeType<Ret>\n : Type extends [infer Item, ...infer Rest]\n ? [TransformNodeType<Item>, ...TransformNodeType<Rest>]\n : Type extends Array<infer Item>\n ? Array<TransformNodeType<Item>>\n : Type extends Promise<infer T>\n ? Promise<TransformNodeType<T>>\n : Type extends { [P in any]: any }\n ? {\n [Property in keyof Type]:\n Property extends BigIntPropertyNames\n ? PreserveOptional<bigint, Type[Property]>\n : Property extends NumberPropertyNames\n ? PreserveOptional<number, Type[Property]>\n : Property extends 'txHash'\n ? PreserveOptional<Encoded.TxHash, Type[Property]>\n : Property extends 'bytecode'\n ? PreserveOptional<Encoded.ContractBytearray, Type[Property]>\n : TransformNodeType<Type[Property]>\n }\n : Type;\ntype NodeTransformedApi = new (...args: ConstructorParameters<typeof NodeApi>) => {\n [Name in keyof InstanceType<typeof NodeApi>]:\n Name extends 'pipeline' | 'sendRequest' | 'sendOperationRequest'\n ? NodeApi[Name] : TransformNodeType<NodeApi[Name]>\n};\n\nexport interface NodeInfo {\n url: string;\n nodeNetworkId: string;\n version: string;\n consensusProtocolVersion: ConsensusProtocolVersion;\n}\n\nexport default class Node extends (NodeTransformed as unknown as NodeTransformedApi) {\n #networkIdPromise?: Promise<string | Error>;\n\n /**\n * @param url - Url for node API\n * @param options - Options\n * @param options.ignoreVersion - Don't check node version\n * @param options.retryCount - Amount of extra requests to do in case of failure\n * @param options.retryOverallDelay - Time in ms to wait between all retries\n */\n constructor(\n url: string,\n {\n ignoreVersion = false, retryCount = 3, retryOverallDelay = 800, ...options\n }: NodeOptionalParams & {\n ignoreVersion?: boolean;\n retryCount?: number;\n retryOverallDelay?: number;\n } = {},\n ) {\n // eslint-disable-next-line constructor-super\n super(url, {\n allowInsecureConnection: true,\n additionalPolicies: [\n genRequestQueuesPolicy(),\n genCombineGetRequestsPolicy(),\n genRetryOnFailurePolicy(retryCount, retryOverallDelay),\n genErrorFormatterPolicy((body: ErrorModel) => ` ${body.reason}`),\n ],\n ...options,\n });\n if (!ignoreVersion) {\n const statusPromise = this.getStatus();\n const versionPromise = statusPromise.then(({ nodeVersion }) => nodeVersion, (error) => error);\n this.#networkIdPromise = statusPromise.then(({ networkId }) => networkId, (error) => error);\n this.pipeline.addPolicy(\n genVersionCheckPolicy('node', '/v3/status', versionPromise, '6.2.0', '7.0.0'),\n );\n }\n this.intAsString = true;\n }\n\n async getNetworkId(): Promise<string> {\n this.#networkIdPromise ??= this.getStatus().then(({ networkId }) => networkId);\n const networkId = await this.#networkIdPromise;\n if (networkId instanceof Error) throw networkId;\n return networkId;\n }\n\n async getNodeInfo(): Promise<NodeInfo> {\n const {\n nodeVersion: version,\n networkId: nodeNetworkId,\n protocols,\n topBlockHeight,\n } = await this.getStatus();\n const consensusProtocolVersion = protocols\n .filter(({ effectiveAtHeight }) => topBlockHeight >= effectiveAtHeight)\n .reduce(\n (acc, p) => (p.effectiveAtHeight > acc.effectiveAtHeight ? p : acc),\n { effectiveAtHeight: -1, version: 0 },\n )\n .version;\n return {\n url: this.$host,\n nodeNetworkId,\n version,\n consensusProtocolVersion,\n };\n }\n}\n","import { Encoded } from '../utils/encoder';\nimport { buildTx, getSchema, unpackTx } from './builder';\nimport { Tag } from './builder/constants';\nimport { TransactionError, UnexpectedTsError } from '../utils/errors';\n\n/**\n * Returns account address that signed a transaction\n * @param transaction - transaction to get a signer of\n */\nexport default function getTransactionSignerAddress(\n transaction: Encoded.Transaction,\n): Encoded.AccountAddress {\n const params = unpackTx(transaction);\n switch (params.tag) {\n case Tag.SignedTx:\n return getTransactionSignerAddress(buildTx(params.encodedTx));\n case Tag.GaMetaTx:\n return params.gaId;\n default:\n }\n\n const nonce = getSchema(params.tag, params.version).find(([name]) => name === 'nonce')?.[1];\n if (nonce == null) throw new TransactionError(`Transaction doesn't have nonce: ${Tag[params.tag]}`);\n if (!('senderKey' in nonce)) throw new UnexpectedTsError();\n const address = params[nonce.senderKey as keyof typeof params] as unknown as string;\n return address.replace(/^ok_/, 'ak_') as Encoded.AccountAddress;\n}\n","import { Encoded } from '../utils/encoder';\nimport Node from '../Node';\nimport CompilerBase from '../contract/compiler/Base';\nimport { Int } from '../tx/builder/constants';\n\ninterface AuthData {\n fee?: Int;\n gasLimit?: number;\n gasPrice?: Int;\n callData?: Encoded.ContractBytearray;\n sourceCode?: string;\n args?: any[];\n}\n\n/**\n * Account is one of the three basic building blocks of an\n * {@link AeSdk} and provides access to a signing key pair.\n */\nexport default abstract class AccountBase {\n /**\n * Sign encoded transaction\n * @param tx - Transaction to sign\n * @param options - Options\n * @param options.innerTx - Sign as inner transaction for PayingFor\n * @param options.authData - Object with gaMeta params\n * @returns Signed transaction\n */\n abstract signTransaction(\n tx: Encoded.Transaction,\n options: {\n innerTx?: boolean;\n networkId?: string;\n authData?: AuthData | ((tx: Encoded.Transaction) => Promise<AuthData>);\n onNode?: Node;\n onCompiler?: CompilerBase;\n aeppOrigin?: string;\n aeppRpcClientId?: string;\n },\n ): Promise<Encoded.Transaction>;\n\n /**\n * Sign message\n * @param message - Message to sign\n * @param options - Options\n * @returns Signature as hex string of Uint8Array\n */\n abstract signMessage(\n message: string,\n options?: {\n aeppOrigin?: string;\n aeppRpcClientId?: string;\n },\n ): Promise<Uint8Array>;\n\n /**\n * Sign data blob\n * @param data - Data blob to sign\n * @param options - Options\n * @returns Signed data blob\n */\n abstract sign(data: string | Uint8Array, options?: any): Promise<Uint8Array>;\n\n /**\n * Account address\n */\n readonly address: Encoded.AccountAddress;\n}\n","import AccountBase from './Base';\nimport {\n generateKeyPairFromSecret, sign, generateKeyPair, hash, messageToHash,\n} from '../utils/crypto';\nimport { ArgumentError } from '../utils/errors';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../utils/encoder';\nimport { concatBuffers } from '../utils/other';\nimport { buildTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\n\nconst secretKeys = new WeakMap();\n\nexport function getBufferToSign(\n transaction: Encoded.Transaction,\n networkId: string,\n innerTx: boolean,\n): Uint8Array {\n const prefixes = [networkId];\n if (innerTx) prefixes.push('inner_tx');\n const rlpBinaryTx = decode(transaction);\n return concatBuffers([Buffer.from(prefixes.join('-')), hash(rlpBinaryTx)]);\n}\n\n/**\n * In-memory account class\n */\nexport default class AccountMemory extends AccountBase {\n override readonly address: Encoded.AccountAddress;\n\n /**\n * @param secretKey - Secret key\n */\n constructor(secretKey: string | Uint8Array) {\n super();\n secretKey = typeof secretKey === 'string' ? Buffer.from(secretKey, 'hex') : secretKey;\n if (secretKey.length !== 64) {\n throw new ArgumentError('secretKey', '64 bytes', secretKey.length);\n }\n secretKeys.set(this, secretKey);\n this.address = encode(\n generateKeyPairFromSecret(secretKeys.get(this)).publicKey,\n Encoding.AccountAddress,\n );\n }\n\n /**\n * Generates a new AccountMemory using a random secret key\n */\n static generate(): AccountMemory {\n return new AccountMemory(generateKeyPair().secretKey);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n override async sign(data: string | Uint8Array, options?: any): Promise<Uint8Array> {\n return sign(data, secretKeys.get(this));\n }\n\n override async signTransaction(\n transaction: Encoded.Transaction,\n { innerTx, networkId, ...options }: { innerTx?: boolean; networkId?: string } = {},\n ): Promise<Encoded.Transaction> {\n if (networkId == null) {\n throw new ArgumentError('networkId', 'provided', networkId);\n }\n const rlpBinaryTx = decode(transaction);\n const txWithNetworkId = getBufferToSign(transaction, networkId, innerTx === true);\n\n const signatures = [await this.sign(txWithNetworkId, options)];\n return buildTx({ tag: Tag.SignedTx, encodedTx: rlpBinaryTx, signatures });\n }\n\n override async signMessage(message: string, options?: any): Promise<Uint8Array> {\n return this.sign(messageToHash(message), options);\n }\n}\n","import { Encoded } from '../utils/encoder';\nimport { buildTx, buildTxHash, unpackTx } from './builder';\nimport { Tag } from './builder/constants';\nimport { verify } from '../utils/crypto';\nimport { getBufferToSign } from '../account/Memory';\nimport { IllegalArgumentError, InternalError, TransactionError } from '../utils/errors';\nimport Node from '../Node';\nimport getTransactionSignerAddress from './transaction-signer';\n\n/**\n * Calculates the cost of transaction execution\n * Provides an upper cost of contract-call-related transactions because of `gasLimit`.\n * Also assumes that oracle query fee is 0 unless it is provided in options.\n * @param transaction - Transaction to calculate the cost of\n * @param innerTx - Should be provided if transaction wrapped with Tag.PayingForTx\n * @param gasUsed - Amount of gas actually used to make calculation more accurate\n * @param queryFee - Oracle query fee\n * @param isInitiator - Is transaction signer an initiator of state channel\n */\nexport function getExecutionCost(\n transaction: Encoded.Transaction,\n {\n innerTx, gasUsed, queryFee, isInitiator,\n }: {\n innerTx?: 'fee-payer' | 'freeloader';\n gasUsed?: number;\n queryFee?: string;\n isInitiator?: boolean;\n } = {},\n): bigint {\n const params = unpackTx(transaction);\n if (params.tag === Tag.SignedTx) {\n throw new IllegalArgumentError('Transaction shouldn\\'t be a SignedTx, use `getExecutionCostBySignedTx` instead');\n }\n\n let res = 0n;\n if ('fee' in params && innerTx !== 'freeloader') {\n res += BigInt(params.fee);\n }\n if (params.tag === Tag.NameClaimTx) {\n res += BigInt(params.nameFee);\n }\n if (params.tag === Tag.OracleQueryTx) {\n res += BigInt(params.queryFee);\n }\n if (params.tag === Tag.OracleResponseTx) {\n res -= BigInt(queryFee ?? 0);\n }\n if (params.tag === Tag.ChannelSettleTx) {\n if (isInitiator === true) res -= BigInt(params.initiatorAmountFinal);\n if (isInitiator === false) res -= BigInt(params.responderAmountFinal);\n }\n if (\n ((params.tag === Tag.SpendTx && params.senderId !== params.recipientId)\n || params.tag === Tag.ContractCreateTx || params.tag === Tag.ContractCallTx\n || params.tag === Tag.ChannelDepositTx) && innerTx !== 'fee-payer'\n ) {\n res += BigInt(params.amount);\n }\n if (params.tag === Tag.ContractCreateTx) res += BigInt(params.deposit);\n if (\n (params.tag === Tag.ContractCreateTx || params.tag === Tag.ContractCallTx\n || params.tag === Tag.GaAttachTx || params.tag === Tag.GaMetaTx)\n && innerTx !== 'freeloader'\n ) {\n res += BigInt(params.gasPrice) * BigInt(gasUsed ?? params.gasLimit);\n }\n if (params.tag === Tag.GaMetaTx || params.tag === Tag.PayingForTx) {\n res += getExecutionCost(\n buildTx(params.tx.encodedTx),\n params.tag === Tag.PayingForTx ? { innerTx: 'fee-payer' } : {},\n );\n }\n return res;\n}\n\n/**\n * Calculates the cost of signed transaction execution\n * @param transaction - Transaction to calculate the cost of\n * @param networkId - Network id used to sign the transaction\n * @param options - Options\n */\nexport function getExecutionCostBySignedTx(\n transaction: Encoded.Transaction,\n networkId: string,\n options?: Omit<Parameters<typeof getExecutionCost>[1], 'innerTx'>,\n): bigint {\n const params = unpackTx(transaction, Tag.SignedTx);\n if (params.encodedTx.tag === Tag.GaMetaTx) {\n return getExecutionCost(buildTx(params.encodedTx), options);\n }\n\n const tx = buildTx(params.encodedTx);\n const address = getTransactionSignerAddress(tx);\n const [isInnerTx, isNotInnerTx] = [true, false]\n .map((f) => verify(getBufferToSign(tx, networkId, f), params.signatures[0], address));\n if (!isInnerTx && !isNotInnerTx) throw new TransactionError('Can\\'t verify signature');\n return getExecutionCost(\n buildTx(params.encodedTx),\n { ...isInnerTx && { innerTx: 'freeloader' }, ...options },\n );\n}\n\n/**\n * Calculates the cost of signed and not signed transaction execution using node\n * @param transaction - Transaction to calculate the cost of\n * @param node - Node to use\n * @param isMined - Is transaction already mined or not\n * @param options - Options\n */\nexport async function getExecutionCostUsingNode(\n transaction: Encoded.Transaction,\n node: Node,\n { isMined, ...options }: { isMined?: boolean } & Parameters<typeof getExecutionCost>[1] = {},\n): Promise<bigint> {\n let params = unpackTx(transaction);\n const isSignedTx = params.tag === Tag.SignedTx;\n const txHash = isSignedTx && isMined === true && buildTxHash(transaction);\n if (params.tag === Tag.SignedTx) params = params.encodedTx;\n\n // TODO: set gasUsed for PayingForTx after solving https://github.com/aeternity/aeternity/issues/4087\n if (\n options.gasUsed == null && txHash !== false\n && [Tag.ContractCreateTx, Tag.ContractCallTx, Tag.GaAttachTx, Tag.GaMetaTx].includes(params.tag)\n ) {\n const { callInfo, gaInfo } = await node.getTransactionInfoByHash(txHash);\n const combinedInfo = callInfo ?? gaInfo;\n if (combinedInfo == null) {\n throw new InternalError(`callInfo and gaInfo is not available for transaction ${txHash}`);\n }\n options.gasUsed = combinedInfo.gasUsed;\n }\n\n if (options.queryFee == null && Tag.OracleResponseTx === params.tag) {\n options.queryFee = (await node.getOracleByPubkey(params.oracleId)).queryFee.toString();\n }\n\n if (options.isInitiator == null && Tag.ChannelSettleTx === params.tag && isMined !== true) {\n const { initiatorId } = await node.getChannelByPubkey(params.channelId);\n options.isInitiator = params.fromId === initiatorId;\n }\n\n return isSignedTx\n ? getExecutionCostBySignedTx(transaction, await node.getNetworkId(), options)\n : getExecutionCost(transaction, options);\n}\n","import { hash, verify } from '../utils/crypto';\nimport { TxUnpacked } from './builder/schema.generated';\nimport { CtVersion, ProtocolToVmAbi } from './builder/field-types/ct-version';\nimport { Tag, ConsensusProtocolVersion } from './builder/constants';\nimport { buildTx, unpackTx } from './builder';\nimport { concatBuffers, isAccountNotFoundError } from '../utils/other';\nimport { Encoded, decode } from '../utils/encoder';\nimport Node, { TransformNodeType } from '../Node';\nimport { Account } from '../apis/node';\nimport { genAggressiveCacheGetResponsesPolicy } from '../utils/autorest';\nimport { UnexpectedTsError } from '../utils/errors';\nimport getTransactionSignerAddress from './transaction-signer';\nimport { getExecutionCostUsingNode } from './execution-cost';\n\nexport interface ValidatorResult {\n message: string;\n key: string;\n checkedKeys: string[];\n}\n\ntype Validator = (\n tx: TxUnpacked,\n options: {\n // TODO: remove after fixing node types\n account: TransformNodeType<Account> & { id: Encoded.AccountAddress };\n nodeNetworkId: string;\n parentTxTypes: Tag[];\n node: Node;\n height: number;\n consensusProtocolVersion: ConsensusProtocolVersion;\n }\n) => ValidatorResult[] | Promise<ValidatorResult[]>;\n\nconst validators: Validator[] = [];\n\nasync function verifyTransactionInternal(\n tx: TxUnpacked,\n node: Node,\n parentTxTypes: Tag[],\n): Promise<ValidatorResult[]> {\n const address = getTransactionSignerAddress(buildTx(tx));\n const [account, { height }, { consensusProtocolVersion, nodeNetworkId }] = await Promise.all([\n node.getAccountByPubkey(address)\n .catch((error) => {\n if (!isAccountNotFoundError(error)) throw error;\n return { id: address, balance: 0n, nonce: 0 };\n })\n // TODO: remove after fixing https://github.com/aeternity/aepp-sdk-js/issues/1537\n .then((acc) => ({ ...acc, id: acc.id as Encoded.AccountAddress })),\n node.getCurrentKeyBlockHeight(),\n node.getNodeInfo(),\n ]);\n\n return (await Promise.all(\n validators.map(async (v) => v(\n tx,\n {\n node, account, height, consensusProtocolVersion, nodeNetworkId, parentTxTypes,\n },\n )),\n )).flat();\n}\n\n/**\n * Transaction Validator\n * This function validates some transaction properties,\n * to make sure it can be posted it to the chain\n * @category transaction builder\n * @param transaction - Base64Check-encoded transaction\n * @param nodeNotCached - Node to validate transaction against\n * @returns Array with verification errors\n * @example const errors = await verifyTransaction(transaction, node)\n */\nexport default async function verifyTransaction(\n transaction: Parameters<typeof unpackTx>[0],\n nodeNotCached: Node,\n): Promise<ValidatorResult[]> {\n const node = new Node(nodeNotCached.$host, {\n ignoreVersion: true,\n pipeline: nodeNotCached.pipeline.clone(),\n additionalPolicies: [genAggressiveCacheGetResponsesPolicy()],\n });\n return verifyTransactionInternal(unpackTx(transaction), node, []);\n}\n\nvalidators.push(\n (tx, { account, nodeNetworkId, parentTxTypes }) => {\n if (tx.tag !== Tag.SignedTx) return [];\n const { encodedTx, signatures } = tx;\n if ((encodedTx ?? signatures) == null) return [];\n if (signatures.length !== 1) return []; // TODO: Support multisignature like in state channels\n const prefix = Buffer.from([\n nodeNetworkId,\n ...parentTxTypes.includes(Tag.PayingForTx) ? ['inner_tx'] : [],\n ].join('-'));\n const txBinary = decode(buildTx(encodedTx));\n const txWithNetworkId = concatBuffers([prefix, txBinary]);\n const txHashWithNetworkId = concatBuffers([prefix, hash(txBinary)]);\n if (verify(txWithNetworkId, signatures[0], account.id)\n || verify(txHashWithNetworkId, signatures[0], account.id)) return [];\n return [{\n message: 'Signature cannot be verified, please ensure that you transaction have'\n + ' the correct prefix and the correct private key for the sender address',\n key: 'InvalidSignature',\n checkedKeys: ['encodedTx', 'signatures'],\n }];\n },\n async (tx, { node, parentTxTypes }) => {\n let nestedTx;\n if ('encodedTx' in tx) nestedTx = tx.encodedTx;\n if ('tx' in tx) nestedTx = tx.tx;\n if (nestedTx == null) return [];\n return verifyTransactionInternal(nestedTx, node, [...parentTxTypes, tx.tag]);\n },\n (tx, { height }) => {\n if (!('ttl' in tx)) return [];\n if (tx.ttl === 0 || tx.ttl >= height) return [];\n return [{\n message: `TTL ${tx.ttl} is already expired, current height is ${height}`,\n key: 'ExpiredTTL',\n checkedKeys: ['ttl'],\n }];\n },\n async (tx, { account, parentTxTypes, node }) => {\n if (parentTxTypes.length !== 0) return [];\n const cost = await getExecutionCostUsingNode(buildTx(tx), node).catch(() => 0n);\n if (cost <= account.balance) return [];\n return [{\n message: `Account balance ${account.balance} is not enough to execute the transaction that costs ${cost}`,\n key: 'InsufficientBalance',\n checkedKeys: ['amount', 'fee', 'nameFee', 'gasLimit', 'gasPrice'],\n }];\n },\n (tx, { account }) => {\n let message;\n if (tx.tag === Tag.SignedTx && account.kind === 'generalized' && tx.signatures.length !== 0) {\n message = 'Generalized account can\\'t be used to generate SignedTx with signatures';\n }\n if (tx.tag === Tag.GaMetaTx && account.kind === 'basic') {\n message = 'Basic account can\\'t be used to generate GaMetaTx';\n }\n if (message == null) return [];\n return [{ message, key: 'InvalidAccountType', checkedKeys: ['tag'] }];\n },\n // TODO: revert nonce check\n (tx, { consensusProtocolVersion }) => {\n const oracleCall = Tag.Oracle === tx.tag || Tag.OracleRegisterTx === tx.tag;\n const contractCreate = Tag.ContractCreateTx === tx.tag || Tag.GaAttachTx === tx.tag;\n const contractCall = Tag.ContractCallTx === tx.tag || Tag.GaMetaTx === tx.tag;\n const type = (oracleCall ? 'oracle-call' : null)\n ?? (contractCreate ? 'contract-create' : null)\n ?? (contractCall ? 'contract-call' : null);\n if (type == null) return [];\n const protocol = ProtocolToVmAbi[consensusProtocolVersion][type] as {\n abiVersion: readonly any[];\n vmVersion: readonly any[];\n };\n\n let ctVersion: Partial<CtVersion> | undefined;\n if ('abiVersion' in tx) ctVersion = { abiVersion: tx.abiVersion };\n if ('ctVersion' in tx) ctVersion = tx.ctVersion;\n if (ctVersion == null) throw new UnexpectedTsError();\n if (\n !protocol.abiVersion.includes(ctVersion.abiVersion)\n || (contractCreate && !protocol.vmVersion.includes(ctVersion.vmVersion))\n ) {\n return [{\n message: `ABI/VM version ${JSON.stringify(ctVersion)} is wrong, supported is: ${JSON.stringify(protocol)}`,\n key: 'VmAndAbiVersionMismatch',\n checkedKeys: ['ctVersion', 'abiVersion'],\n }];\n }\n return [];\n },\n async (tx, { node }) => {\n if (Tag.ContractCallTx !== tx.tag) return [];\n try {\n const { active } = await node.getContract(tx.contractId);\n if (active) return [];\n return [{\n message: `Contract ${tx.contractId} is not active`,\n key: 'ContractNotActive',\n checkedKeys: ['contractId'],\n }];\n } catch (error) {\n if (error.response?.parsedBody?.reason == null) throw error;\n return [{\n message: error.response.parsedBody.reason,\n key: 'ContractNotFound',\n checkedKeys: ['contractId'],\n }];\n }\n },\n);\n","import { AE_AMOUNT_FORMATS, formatAmount } from './utils/amount-formatter';\nimport verifyTransaction, { ValidatorResult } from './tx/validator';\nimport { isAccountNotFoundError, pause } from './utils/other';\nimport { isNameValid, produceNameId } from './tx/builder/helpers';\nimport { DRY_RUN_ACCOUNT } from './tx/builder/schema';\nimport { AensName } from './tx/builder/constants';\nimport {\n AensPointerContextError, DryRunError, InvalidAensNameError, TransactionError,\n TxTimedOutError, TxNotInChainError, InternalError,\n} from './utils/errors';\nimport Node, { TransformNodeType } from './Node';\nimport {\n Account as AccountNode, ByteCode, ContractObject, DryRunResult, DryRunResults,\n Generation, KeyBlock, MicroBlockHeader, NameEntry, SignedTx,\n} from './apis/node';\nimport {\n decode, encode, Encoded, Encoding,\n} from './utils/encoder';\nimport AccountBase from './account/Base';\nimport { buildTxHash } from './tx/builder';\n\n/**\n * @category chain\n */\nexport function _getPollInterval(\n type: 'block' | 'microblock',\n { _expectedMineRate = 180000, _microBlockCycle = 3000, _maxPollInterval = 5000 }:\n { _expectedMineRate?: number; _microBlockCycle?: number; _maxPollInterval?: number },\n): number {\n const base = {\n block: _expectedMineRate,\n microblock: _microBlockCycle,\n }[type];\n return Math.min(base / 3, _maxPollInterval);\n}\n\n/**\n * @category exception\n */\nexport class InvalidTxError extends TransactionError {\n validation: ValidatorResult[];\n\n transaction: Encoded.Transaction;\n\n constructor(\n message: string,\n validation: ValidatorResult[],\n transaction: Encoded.Transaction,\n ) {\n super(message);\n this.name = 'InvalidTxError';\n this.validation = validation;\n this.transaction = transaction;\n }\n}\n\n/**\n * Obtain current height of the chain\n * @category chain\n * @returns Current chain height\n */\nexport async function getHeight({ onNode }: { onNode: Node }): Promise<number> {\n return (await onNode.getCurrentKeyBlockHeight()).height;\n}\n\n/**\n * Wait for a transaction to be mined\n * @category chain\n * @param th - The hash of transaction to poll\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.blocks - Number of blocks mined after which to fail\n * @param options.onNode - Node to use\n * @returns The transaction as it was mined\n */\nexport async function poll(\n th: Encoded.TxHash,\n {\n blocks = 10, interval, onNode, ...options\n }:\n { blocks?: number; interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<TransformNodeType<SignedTx>> {\n interval ??= _getPollInterval('microblock', options);\n const max = await getHeight({ onNode }) + blocks;\n do {\n const tx = await onNode.getTransactionByHash(th);\n if (tx.blockHeight !== -1) return tx;\n await pause(interval);\n } while (await getHeight({ onNode }) < max);\n throw new TxTimedOutError(blocks, th);\n}\n\n/**\n * Wait for the chain to reach a specific height\n * @category chain\n * @param height - Height to wait for\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.onNode - Node to use\n * @returns Current chain height\n */\nexport async function awaitHeight(\n height: number,\n { interval, onNode, ...options }:\n { interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<number> {\n interval ??= _getPollInterval('block', options);\n let currentHeight;\n do {\n if (currentHeight != null) await pause(interval);\n currentHeight = (await onNode.getCurrentKeyBlockHeight()).height;\n } while (currentHeight < height);\n return currentHeight;\n}\n\n/**\n * Wait for transaction confirmation\n * @category chain\n * @param txHash - Transaction hash\n * @param options - Options\n * @param options.confirm - Number of micro blocks to wait for transaction confirmation\n * @param options.onNode - Node to use\n * @returns Current Height\n */\nexport async function waitForTxConfirm(\n txHash: Encoded.TxHash,\n { confirm = 3, onNode, ...options }:\n { confirm?: number; onNode: Node } & Parameters<typeof awaitHeight>[1],\n): Promise<number> {\n const { blockHeight } = await onNode.getTransactionByHash(txHash);\n const height = await awaitHeight(blockHeight + confirm, { onNode, ...options });\n const { blockHeight: newBlockHeight } = await onNode.getTransactionByHash(txHash);\n switch (newBlockHeight) {\n case -1:\n throw new TxNotInChainError(txHash);\n case blockHeight:\n return height;\n default:\n return waitForTxConfirm(txHash, { onNode, confirm, ...options });\n }\n}\n\n/**\n * Signs and submits transaction for mining\n * @category chain\n * @param txUnsigned - Transaction to sign and submit\n * @param options - Options\n * @param options.onNode - Node to use\n * @param options.onAccount - Account to use\n * @param options.verify - Verify transaction before broadcast, throw error if not\n * @param options.waitMined - Ensure that transaction get into block\n * @param options.confirm - Number of micro blocks that should be mined after tx get included\n * @returns Transaction details\n */\nexport async function sendTransaction(\n txUnsigned: Encoded.Transaction,\n {\n onNode, onAccount, verify = true, waitMined = true, confirm, innerTx, ...options\n }:\n SendTransactionOptions,\n): Promise<SendTransactionReturnType> {\n const tx = await onAccount.signTransaction(txUnsigned, {\n ...options,\n onNode,\n innerTx,\n networkId: await onNode.getNetworkId(),\n });\n\n if (innerTx === true) return { hash: buildTxHash(tx), rawTx: tx };\n\n if (verify) {\n const validation = await verifyTransaction(tx, onNode);\n if (validation.length > 0) {\n const message = `Transaction verification errors: ${\n validation.map((v: { message: string }) => v.message).join(', ')}`;\n throw new InvalidTxError(message, validation, tx);\n }\n }\n\n try {\n let __queue;\n try {\n __queue = onAccount != null ? `tx-${onAccount.address}` : null;\n } catch (error) {\n __queue = null;\n }\n const { txHash } = await onNode.postTransaction(\n { tx },\n __queue != null ? { requestOptions: { customHeaders: { __queue } } } : {},\n );\n\n if (waitMined) {\n const pollResult = await poll(txHash, { onNode, ...options });\n const txData = {\n ...pollResult,\n hash: pollResult.hash as Encoded.TxHash,\n rawTx: tx,\n };\n // wait for transaction confirmation\n if (confirm != null && (confirm === true || confirm > 0)) {\n const c = typeof confirm === 'boolean' ? undefined : confirm;\n return {\n ...txData,\n confirmationHeight: await waitForTxConfirm(txHash, { onNode, confirm: c, ...options }),\n };\n }\n return txData;\n }\n return { hash: txHash, rawTx: tx };\n } catch (error) {\n throw Object.assign(error, {\n rawTx: tx,\n verifyTx: async () => verifyTransaction(tx, onNode),\n });\n }\n}\n\ntype SendTransactionOptionsType = {\n onNode: Node;\n onAccount: AccountBase;\n verify?: boolean;\n waitMined?: boolean;\n confirm?: boolean | number;\n} & Parameters<typeof poll>[1] & Omit<Parameters<typeof waitForTxConfirm>[1], 'confirm'>\n& Parameters<AccountBase['signTransaction']>[1];\nexport interface SendTransactionOptions extends SendTransactionOptionsType {}\ninterface SendTransactionReturnType extends Partial<TransformNodeType<SignedTx>> {\n hash: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n confirmationHeight?: number;\n}\n\n/**\n * Get account by account public key\n * @category chain\n * @param address - Account address (public key)\n * @param options - Options\n * @param options.height - Get account on specific block by block height\n * @param options.hash - Get account on specific block by micro block hash or key block hash\n * @param options.onNode - Node to use\n */\nexport async function getAccount(\n address: Encoded.AccountAddress | Encoded.ContractAddress,\n { height, hash, onNode }:\n { height?: number; hash?: Encoded.KeyBlockHash | Encoded.MicroBlockHash; onNode: Node },\n): Promise<TransformNodeType<AccountNode>> {\n if (height != null) return onNode.getAccountByPubkeyAndHeight(address, height);\n if (hash != null) return onNode.getAccountByPubkeyAndHash(address, hash);\n return onNode.getAccountByPubkey(address);\n}\n\n/**\n * Request the balance of specified account\n * @category chain\n * @param address - The public account address to obtain the balance for\n * @param options - Options\n * @param options.format\n * @param options.height - The chain height at which to obtain the balance for\n * (default: top of chain)\n * @param options.hash - The block hash on which to obtain the balance for (default: top of chain)\n */\nexport async function getBalance(\n address: Encoded.AccountAddress | Encoded.ContractAddress | Encoded.OracleAddress,\n { format = AE_AMOUNT_FORMATS.AETTOS, ...options }:\n { format?: AE_AMOUNT_FORMATS } & Parameters<typeof getAccount>[1],\n): Promise<string> {\n const addr = address.startsWith('ok_')\n ? encode(decode(address), Encoding.AccountAddress)\n : address as Encoded.AccountAddress | Encoded.ContractAddress;\n\n const { balance } = await getAccount(addr, options).catch((error) => {\n if (!isAccountNotFoundError(error)) throw error;\n return { balance: 0n };\n });\n\n return formatAmount(balance, { targetDenomination: format });\n}\n\n/**\n * Obtain current generation\n * @category chain\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Current Generation\n */\nexport async function getCurrentGeneration(\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n return onNode.getCurrentGeneration();\n}\n\n/**\n * Get generation by hash or height\n * @category chain\n * @param hashOrHeight - Generation hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Generation\n */\nexport async function getGeneration(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n if (typeof hashOrHeight === 'number') return onNode.getGenerationByHeight(hashOrHeight);\n return onNode.getGenerationByHash(hashOrHeight);\n}\n\n/**\n * Get micro block transactions\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Transactions\n */\nexport async function getMicroBlockTransactions(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<SignedTx[]>> {\n return (await onNode.getMicroBlockTransactionsByHash(hash)).transactions;\n}\n\n/**\n * Get key block\n * @category chain\n * @param hashOrHeight - Key block hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Key Block\n */\nexport async function getKeyBlock(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<KeyBlock>> {\n if (typeof hashOrHeight === 'number') return onNode.getKeyBlockByHeight(hashOrHeight);\n return onNode.getKeyBlockByHash(hashOrHeight);\n}\n\n/**\n * Get micro block header\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Micro block header\n */\nexport async function getMicroBlockHeader(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<MicroBlockHeader>> {\n return onNode.getMicroBlockHeaderByHash(hash);\n}\n\ninterface TxDryRunArguments {\n tx: Encoded.Transaction;\n accountAddress: Encoded.AccountAddress;\n top?: number | Encoded.KeyBlockHash | Encoded.MicroBlockHash;\n txEvents?: any;\n resolve: Function;\n reject: Function;\n}\nconst txDryRunRequests: Map<string, TxDryRunArguments[] & { timeout?: NodeJS.Timeout }> = new Map();\n\nasync function txDryRunHandler(key: string, onNode: Node): Promise<void> {\n const rs = txDryRunRequests.get(key);\n txDryRunRequests.delete(key);\n if (rs == null) throw new InternalError('Can\\'t get dry-run request');\n\n let dryRunRes;\n try {\n const top = typeof rs[0].top === 'number'\n ? (await getKeyBlock(rs[0].top, { onNode })).hash : rs[0].top;\n dryRunRes = await onNode.protectedDryRunTxs({\n top,\n txEvents: rs[0].txEvents,\n txs: rs.map((req) => ({ tx: req.tx })),\n accounts: Array.from(new Set(rs.map((req) => req.accountAddress)))\n .map((pubKey) => ({ pubKey, amount: DRY_RUN_ACCOUNT.amount })),\n });\n } catch (error) {\n rs.forEach(({ reject }) => reject(error));\n return;\n }\n\n const { results, txEvents } = dryRunRes;\n results.forEach(({ result, reason, ...resultPayload }, idx) => {\n const {\n resolve, reject, tx, accountAddress,\n } = rs[idx];\n if (result === 'ok') resolve({ ...resultPayload, txEvents });\n else reject(Object.assign(new DryRunError(reason as string), { tx, accountAddress }));\n });\n}\n\n/**\n * Transaction dry-run\n * @category chain\n * @param tx - transaction to execute\n * @param accountAddress - address that will be used to execute transaction\n * @param options - Options\n * @param options.top - hash of block on which to make dry-run\n * @param options.txEvents - collect and return on-chain tx events that would result from the call\n * @param options.combine - Enables combining of similar requests to a single dry-run call\n * @param options.onNode - Node to use\n */\nexport async function txDryRun(\n tx: Encoded.Transaction,\n accountAddress: Encoded.AccountAddress,\n {\n top, txEvents, combine, onNode,\n }:\n { top?: TxDryRunArguments['top']; txEvents?: boolean; combine?: boolean; onNode: Node },\n): Promise<{\n txEvents?: TransformNodeType<DryRunResults['txEvents']>;\n } & TransformNodeType<DryRunResult>> {\n const key = combine === true ? [top, txEvents].join() : 'immediate';\n const requests = txDryRunRequests.get(key) ?? [];\n txDryRunRequests.set(key, requests);\n return new Promise((resolve, reject) => {\n requests.push({\n tx, accountAddress, top, txEvents, resolve, reject,\n });\n if (combine !== true) {\n void txDryRunHandler(key, onNode);\n return;\n }\n requests.timeout ??= setTimeout(() => { void txDryRunHandler(key, onNode); });\n });\n}\n\n/**\n * Get contract byte code\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContractByteCode(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ByteCode>> {\n return onNode.getContractCode(contractId);\n}\n\n/**\n * Get contract entry\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContract(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ContractObject>> {\n return onNode.getContract(contractId);\n}\n\n/**\n * Get name entry\n * @category AENS\n * @param name - AENS name\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getName(\n name: AensName,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<NameEntry>> {\n return onNode.getNameEntryByName(name);\n}\n\n/**\n * Resolve AENS name and return name hash\n * @category AENS\n * @param nameOrId - AENS name or address\n * @param key - in AENS pointers record\n * @param options - Options\n * @param options.verify - To ensure that name exist and have a corresponding pointer\n * // TODO: avoid that to don't trust to current api gateway\n * @param options.resolveByNode - Enables pointer resolving using node\n * @param options.onNode - Node to use\n * @returns Address or AENS name hash\n */\nexport async function resolveName <\n Type extends Encoding.AccountAddress | Encoding.ContractAddress,\n>(\n nameOrId: AensName | Encoded.Generic<Type>,\n key: string,\n { verify = true, resolveByNode = false, onNode }:\n { verify?: boolean; resolveByNode?: boolean; onNode: Node },\n): Promise<Encoded.Generic<Type | Encoding.Name>> {\n if (isNameValid(nameOrId)) {\n if (verify || resolveByNode) {\n const name = await onNode.getNameEntryByName(nameOrId);\n const pointer = name.pointers.find((p) => p.key === key);\n if (pointer == null) throw new AensPointerContextError(nameOrId, key);\n if (resolveByNode) return pointer.id as Encoded.Generic<Type>;\n }\n return produceNameId(nameOrId);\n }\n try {\n decode(nameOrId);\n return nameOrId;\n } catch (error) {\n throw new InvalidAensNameError(`Invalid name or address: ${nameOrId}`);\n }\n}\n","import nacl from 'tweetnacl';\nimport { v4 as uuid } from '@aeternity/uuid';\nimport { hash, argon2id } from '@aeternity/argon2';\nimport { getAddressFromPriv } from './crypto';\nimport { InvalidPasswordError } from './errors';\n\nconst DERIVED_KEY_FUNCTIONS = {\n async argon2id(\n pass: string | Uint8Array,\n salt: string | Uint8Array,\n params: Partial<Keystore['crypto']['kdf_params']>,\n ): Promise<Uint8Array> {\n const { memlimit_kib: memoryCost, opslimit: timeCost } = params;\n\n return hash(pass, {\n hashLength: 32,\n salt,\n timeCost,\n memoryCost,\n type: argon2id,\n });\n },\n};\n\nconst CRYPTO_FUNCTIONS = {\n 'xsalsa20-poly1305': {\n encrypt: nacl.secretbox,\n decrypt(...args: Parameters<typeof nacl.secretbox.open>): Uint8Array {\n const res = nacl.secretbox.open(...args);\n if (res == null) throw new InvalidPasswordError();\n return res;\n },\n },\n};\n\nexport interface Keystore {\n name: string;\n version: 1;\n public_key: string;\n id: string;\n crypto: {\n secret_type: 'ed25519';\n symmetric_alg: keyof typeof CRYPTO_FUNCTIONS;\n ciphertext: string;\n cipher_params: {\n nonce: string;\n };\n kdf: keyof typeof DERIVED_KEY_FUNCTIONS;\n kdf_params: {\n memlimit_kib: number;\n opslimit: number;\n parallelism: number;\n salt: string;\n };\n };\n}\n\nconst CRYPTO_DEFAULTS = {\n secret_type: 'ed25519',\n symmetric_alg: 'xsalsa20-poly1305',\n kdf: 'argon2id',\n kdf_params: {\n memlimit_kib: 65536,\n opslimit: 3,\n parallelism: 1,\n },\n} as const;\n\n/**\n * Symmetric private key encryption using secret (derived) key.\n * @category keystore\n * @param plaintext - Data to be encrypted.\n * @param key - Secret key.\n * @param nonce - Randomly generated nonce.\n * @param algo - Encryption algorithm.\n * @returns Encrypted data.\n */\nfunction encrypt(\n plaintext: Uint8Array,\n key: Uint8Array,\n nonce: Uint8Array,\n algo: keyof typeof CRYPTO_FUNCTIONS = CRYPTO_DEFAULTS.symmetric_alg,\n): Uint8Array {\n return CRYPTO_FUNCTIONS[algo].encrypt(plaintext, nonce, key);\n}\n\n/**\n * Symmetric private key decryption using secret (derived) key.\n * @category keystore\n * @param ciphertext - Data to be decrypted.\n * @param key - Secret key.\n * @param nonce - Nonce from key-object.\n * @param algo - Encryption algorithm.\n * @returns Decrypted data.\n */\nfunction decrypt(\n ciphertext: Uint8Array,\n key: Uint8Array,\n nonce: Uint8Array,\n algo: keyof typeof CRYPTO_FUNCTIONS = CRYPTO_DEFAULTS.symmetric_alg,\n): Uint8Array {\n return CRYPTO_FUNCTIONS[algo].decrypt(ciphertext, nonce, key);\n}\n\n/**\n * Derive secret key from password with key derivation function.\n * @category keystore\n * @param password - User-supplied password.\n * @param nonce - Randomly generated nonce.\n * @param kdf - Key derivation function.\n * @param kdfParams - KDF parameters.\n * @returns Secret key derived from password.\n */\nasync function deriveKey(\n password: string | Uint8Array,\n nonce: string | Uint8Array,\n kdf: Keystore['crypto']['kdf'],\n kdfParams: Omit<Keystore['crypto']['kdf_params'], 'salt'>,\n): Promise<Uint8Array> {\n return DERIVED_KEY_FUNCTIONS[kdf](password, nonce, kdfParams);\n}\n\n/**\n * Recover plaintext private key from secret-storage key object.\n * @category keystore\n * @param password - Keystore object password.\n * @param keystore - Keystore object.\n * @returns Plaintext private key.\n */\nexport async function recover(\n password: string | Uint8Array,\n { crypto }: Keystore,\n): Promise<string> {\n const salt = Buffer.from(crypto.kdf_params.salt, 'hex');\n return Buffer.from(decrypt(\n Buffer.from(crypto.ciphertext, 'hex'),\n await deriveKey(password, salt, crypto.kdf, crypto.kdf_params),\n Buffer.from(crypto.cipher_params.nonce, 'hex'),\n crypto.symmetric_alg,\n )).toString('hex');\n}\n\n/**\n * Export private key to keystore secret-storage format.\n * @category keystore\n * @param name - Key name.\n * @param password - User-supplied password.\n * @param privateKey - Private key as hex-string or a Buffer.\n * @param nonce - Randomly generated 24byte nonce.\n * @param salt - Randomly generated 16byte salt.\n * @param options - Encryption parameters.\n * @param options.kdf - Key derivation function.\n * @param options.kdf_params - KDF parameters.\n */\nexport async function dump(\n name: string,\n password: string | Uint8Array,\n privateKey: string | Uint8Array,\n nonce: Uint8Array = nacl.randomBytes(24),\n salt: Uint8Array = nacl.randomBytes(16),\n options?: Partial<Keystore['crypto']>,\n): Promise<Keystore> {\n const opt = { ...CRYPTO_DEFAULTS, ...options };\n const derivedKey = await deriveKey(password, salt, opt.kdf, opt.kdf_params);\n const payload = typeof privateKey === 'string' ? Buffer.from(privateKey, 'hex') : privateKey;\n return {\n name,\n version: 1,\n public_key: getAddressFromPriv(payload),\n id: uuid(),\n crypto: {\n secret_type: opt.secret_type,\n symmetric_alg: opt.symmetric_alg,\n ciphertext: Buffer.from(\n encrypt(payload, derivedKey, nonce, opt.symmetric_alg),\n ).toString('hex'),\n cipher_params: { nonce: Buffer.from(nonce).toString('hex') },\n kdf: opt.kdf,\n kdf_params: {\n ...opt.kdf_params,\n salt: Buffer.from(salt).toString('hex'),\n },\n },\n };\n}\n","import nacl from 'tweetnacl';\nimport { full as hmac } from 'tweetnacl-auth';\nimport { fromString } from 'bip32-path';\nimport aesjs from 'aes-js';\nimport { sha256hash, encode, Encoding } from './encoder';\nimport { CryptographyError } from './errors';\nimport { concatBuffers } from './other';\n\nconst Ecb = aesjs.ModeOfOperation.ecb;\n\n// TODO: use mnemonic encryption instead of AES\n/**\n * Encrypt given data using `password`\n * @param password - Password to encrypt with\n * @param binaryData - Data to encrypt\n * @returns Encrypted data\n */\nfunction encryptKey(password: string, binaryData: Uint8Array): Uint8Array {\n const hashedPasswordBytes = sha256hash(password);\n const aesEcb = new Ecb(hashedPasswordBytes);\n return aesEcb.encrypt(binaryData);\n}\n\n/**\n * Decrypt given data using `password`\n * @param password - Password to decrypt with\n * @param encrypted - Data to decrypt\n * @returns Decrypted data\n */\nfunction decryptKey(password: string, encrypted: Uint8Array): Uint8Array {\n const encryptedBytes = Buffer.from(encrypted);\n const hashedPasswordBytes = sha256hash(password);\n const aesEcb = new Ecb(hashedPasswordBytes);\n return aesEcb.decrypt(encryptedBytes);\n}\n\n/**\n * @category exception\n */\nexport class DerivationError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'DerivationError';\n }\n}\n\nconst ED25519_CURVE = Buffer.from('ed25519 seed');\nconst HARDENED_OFFSET = 0x80000000;\n\ninterface KeyTreeNode {\n secretKey: Uint8Array;\n chainCode: Uint8Array;\n}\n\ninterface HDWallet {\n secretKey: string;\n chainCode: string;\n}\n\ninterface Account {\n secretKey: string;\n publicKey: string;\n}\n\ntype Dec<N extends number> = [-1, 0, 1, 2, 3, 4][N];\ntype Bip32PathT<MaxLen extends number, H extends 'H' | 'h' | '\\''> = MaxLen extends -1\n ? `${number}${H}`\n : Bip32PathT<Dec<MaxLen>, H> | `${Bip32PathT<Dec<MaxLen>, H>}/${number}${H}`;\ntype Bip32Path<MaxLen extends number> =\n '' | Bip32PathT<MaxLen, 'H'> | Bip32PathT<MaxLen, 'h'> | Bip32PathT<MaxLen, '\\''>;\n\n/**\n * @category hd-wallet\n */\nexport function deriveChild({ secretKey, chainCode }: KeyTreeNode, index: number): KeyTreeNode {\n if (index < HARDENED_OFFSET) {\n throw new DerivationError(`Segment ${index} is not hardened`);\n }\n const indexBuffer = Buffer.allocUnsafe(4);\n indexBuffer.writeUInt32BE(index, 0);\n\n const data = concatBuffers([Buffer.alloc(1, 0), secretKey, indexBuffer]);\n\n const I = hmac(data, chainCode);\n const IL = I.slice(0, 32);\n const IR = I.slice(32);\n return {\n secretKey: IL,\n chainCode: IR,\n };\n}\n\n/**\n * @category hd-wallet\n */\nexport function derivePathFromKey(path: Bip32Path<5>, key: KeyTreeNode): KeyTreeNode {\n const segments = path === '' ? [] : fromString(path).toPathArray();\n segments.forEach((segment, i) => {\n if (segment < HARDENED_OFFSET) {\n throw new DerivationError(`Segment #${i + 1} is not hardened`);\n }\n });\n\n return segments.reduce((parentKey, segment) => deriveChild(parentKey, segment), key);\n}\n\n/**\n * @category hd-wallet\n */\nexport function getMasterKeyFromSeed(seed: Uint8Array): KeyTreeNode {\n const I = hmac(seed, ED25519_CURVE);\n const IL = I.slice(0, 32);\n const IR = I.slice(32);\n return {\n secretKey: IL,\n chainCode: IR,\n };\n}\n\n/**\n * @category hd-wallet\n */\nexport function derivePathFromSeed(path: 'm' | `m/${Bip32Path<5>}`, seed: Uint8Array): KeyTreeNode {\n if (!['m', 'm/'].includes(path.slice(0, 2))) {\n throw new DerivationError('Root element is required');\n }\n const masterKey = getMasterKeyFromSeed(seed);\n return derivePathFromKey(path.slice(2) as Bip32Path<5>, masterKey);\n}\n\nfunction formatAccount(keys: nacl.SignKeyPair): Account {\n const { secretKey, publicKey } = keys;\n return {\n secretKey: Buffer.from(secretKey).toString('hex'),\n publicKey: encode(publicKey, Encoding.AccountAddress),\n };\n}\n\n/**\n * @category hd-wallet\n */\nexport function getKeyPair(secretKey: Uint8Array): nacl.SignKeyPair {\n return nacl.sign.keyPair.fromSeed(secretKey);\n}\n\n/**\n * @category hd-wallet\n */\nexport function generateSaveHDWalletFromSeed(seed: Uint8Array, password: string): HDWallet {\n const walletKey = derivePathFromSeed('m/44h/457h', seed);\n return {\n secretKey: Buffer.from(encryptKey(password, walletKey.secretKey)).toString('hex'),\n chainCode: Buffer.from(encryptKey(password, walletKey.chainCode)).toString('hex'),\n };\n}\n\n/**\n * @category hd-wallet\n */\nexport function getSaveHDWalletAccounts(\n saveHDWallet: HDWallet,\n password: string,\n accountCount: number,\n): Account[] {\n const walletKey = {\n secretKey: decryptKey(password, Buffer.from(saveHDWallet.secretKey, 'hex')),\n chainCode: decryptKey(password, Buffer.from(saveHDWallet.chainCode, 'hex')),\n };\n return (new Array(accountCount)).fill(undefined)\n .map((_, idx) => formatAccount(getKeyPair(derivePathFromKey(`${idx}h/0h/0h`, walletKey).secretKey)));\n}\n\n/**\n * @category hd-wallet\n */\nexport const getHdWalletAccountFromSeed = (\n seed: Uint8Array,\n accountIdx: number,\n): Account & { idx: number } => {\n const walletKey = derivePathFromSeed('m/44h/457h', seed);\n const derived = derivePathFromKey(`${accountIdx}h/0h/0h`, walletKey);\n const keyPair = getKeyPair(derived.secretKey);\n return {\n ...formatAccount(keyPair),\n idx: accountIdx,\n };\n};\n","/**\n * Aens methods - routines to interact with the æternity naming system\n *\n * The high-level description of the naming system is\n * https://github.com/aeternity/protocol/blob/master/AENS.md in the protocol\n * repository.\n */\n\nimport BigNumber from 'bignumber.js';\nimport { genSalt } from './utils/crypto';\nimport { commitmentHash, isAuctionName } from './tx/builder/helpers';\nimport {\n CLIENT_TTL, NAME_TTL, Tag, AensName,\n} from './tx/builder/constants';\nimport { ArgumentError } from './utils/errors';\nimport { Encoded } from './utils/encoder';\nimport { sendTransaction, SendTransactionOptions, getName } from './chain';\nimport { buildTxAsync, BuildTxOptions } from './tx/builder';\nimport { TransformNodeType } from './Node';\nimport { NameEntry, NamePointer } from './apis/node';\nimport AccountBase from './account/Base';\nimport { AddressEncodings } from './tx/builder/field-types/address';\n\ninterface KeyPointers {\n [key: string]: Encoded.Generic<AddressEncodings>;\n}\n\n/**\n * Revoke a name\n * @category AENS\n * @param name - Name hash\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @returns Transaction result\n * @example\n * ```js\n * const name = 'test.chain'\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensRevoke(name, { fee, ttl , nonce })\n * // or\n * await nameObject.revoke({ fee, ttl, nonce })\n * ```\n */\nexport async function aensRevoke(\n name: AensName,\n options: AensRevokeOptions,\n): ReturnType<typeof sendTransaction> {\n const nameRevokeTx = await buildTxAsync({\n ...options,\n tag: Tag.NameRevokeTx,\n nameId: name,\n accountId: options.onAccount.address,\n });\n return sendTransaction(nameRevokeTx, options);\n}\n\ninterface AensRevokeOptions extends\n BuildTxOptions<Tag.NameRevokeTx, 'nameId' | 'accountId' | 'onNode'>,\n SendTransactionOptions {}\n\n/**\n * Update a name\n * @category AENS\n * @param name - AENS name\n * @param pointers - Map of pointer keys to corresponding addresses\n * @param options - Options\n * @param options.extendPointers - Get the pointers from the node and merge with provided\n * ones. Pointers with the same type will be overwritten\n * @param options.onAccount - Make operation on specific account from sdk (you\n * pass publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @param options.nameTtl - Name ttl represented in number of\n * blocks (Max value is 50000 blocks)\n * @param options.clientTtl=84600 a suggestion as to how long any\n * clients should cache this information\n * @throws Invalid pointer array error\n * @example\n * ```js\n * const name = 'test.chain'\n * const pointersArray = ['ak_asd23dasdas...,' 'ct_asdf34fasdasd...']\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensUpdate(name, pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })\n * // or\n * await nameObject.update(pointers, { nameTtl, ttl, fee, nonce, clientTtl })\n * ```\n */\nexport async function aensUpdate(\n name: AensName,\n pointers: KeyPointers,\n { extendPointers, ...options }: AensUpdateOptions,\n): ReturnType<typeof sendTransaction> {\n const allPointers = {\n ...extendPointers === true && Object.fromEntries(\n (await getName(name, options)).pointers.map(({ key, id }) => [key, id]),\n ),\n ...pointers,\n };\n\n const nameUpdateTx = await buildTxAsync({\n clientTtl: CLIENT_TTL,\n nameTtl: NAME_TTL,\n ...options,\n tag: Tag.NameUpdateTx,\n nameId: name,\n accountId: options.onAccount.address,\n pointers: Object.entries(allPointers)\n .map(([key, id]: [string, Encoded.Generic<AddressEncodings>]) => ({ key, id })),\n });\n\n return sendTransaction(nameUpdateTx, options);\n}\n\ninterface AensUpdateOptions extends\n BuildTxOptions<Tag.NameUpdateTx, 'nameId' | 'accountId' | 'pointers' | 'clientTtl' | 'nameTtl' | 'onNode'>,\n SendTransactionOptions {\n extendPointers?: boolean;\n clientTtl?: number;\n nameTtl?: number;\n}\n\n/**\n * Transfer a domain to another account\n * @category AENS\n * @param name - AENS name\n * @param account - Recipient account publick key\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @returns Transaction result\n * @example\n * ```js\n * const name = 'test.chain'\n * const recipientPub = 'ak_asd23dasdas...'\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensTransfer(name, recipientPub, { ttl, fee, nonce })\n * // or\n * await nameObject.transfer(recipientPub, { ttl, fee, nonce })\n * ```\n */\nexport async function aensTransfer(\n name: AensName,\n account: Encoded.AccountAddress,\n options: AensTransferOptions,\n): ReturnType<typeof sendTransaction> {\n const nameTransferTx = await buildTxAsync({\n ...options,\n tag: Tag.NameTransferTx,\n nameId: name,\n accountId: options.onAccount.address,\n recipientId: account,\n });\n\n return sendTransaction(nameTransferTx, options);\n}\n\ninterface AensTransferOptions extends\n BuildTxOptions<Tag.NameTransferTx, 'nameId' | 'accountId' | 'recipientId' | 'onNode'>,\n SendTransactionOptions {}\n\n/**\n * Query the AENS name info from the node\n * and return the object with info and predefined functions for manipulating name\n * @category AENS\n * @param name - AENS name\n * @param opt - Options\n * @returns\n * @example\n * ```js\n * const nameObject = sdkInstance.aensQuery('test.chain')\n * console.log(nameObject)\n * {\n * id, // name hash\n * pointers, // array of pointers\n * update, // Update name function\n * extendTtl, // Extend Ttl name function\n * transfer, // Transfer name function\n * revoke // Revoke name function\n * }\n * ```\n */\nexport async function aensQuery(\n name: AensName,\n opt: Parameters<typeof getName>[1] & Parameters<typeof aensUpdate>[2]\n & Parameters<typeof aensTransfer>[2],\n): Promise<Readonly<\n TransformNodeType<NameEntry> & {\n id: Encoded.Name;\n owner: Encoded.AccountAddress;\n pointers: KeyPointers | NamePointer[];\n ttl: number;\n update: (\n pointers: KeyPointers,\n options?: Omit<Parameters<typeof aensQuery>[1], 'onNode' | 'onCompiler' | 'onAccount'> & {\n onAccount?: AccountBase;\n }\n ) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;\n transfer: (\n account: Encoded.AccountAddress,\n options?: Parameters<typeof aensQuery>[1]\n ) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;\n revoke: (options?: Omit<Parameters<typeof aensRevoke>[1], 'onNode' | 'onCompiler' | 'onAccount'> & {\n onAccount?: AccountBase;\n }\n ) => ReturnType<typeof aensRevoke>;\n extendTtl: (\n nameTtl: number,\n options?: Omit<Parameters<typeof aensQuery>[1], 'onNode' | 'onCompiler' | 'onAccount'>\n ) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;\n }\n >> {\n const nameEntry = await getName(name, opt);\n return Object.freeze({\n ...nameEntry,\n id: nameEntry.id as Encoded.Name,\n owner: nameEntry.owner as Encoded.AccountAddress,\n async update(pointers, options) {\n return {\n ...await aensUpdate(name, pointers, { ...opt, ...options }),\n ...await aensQuery(name, { ...opt, ...options }),\n };\n },\n async transfer(account, options) {\n return {\n ...await aensTransfer(name, account, { ...opt, ...options }),\n ...await aensQuery(name, { ...opt, ...options }),\n };\n },\n async revoke(options) {\n return aensRevoke(name, { ...opt, ...options });\n },\n async extendTtl(nameTtl = NAME_TTL, options = {}) {\n if (nameTtl > NAME_TTL || nameTtl <= 0) {\n throw new ArgumentError('nameTtl', `a number between 1 and ${NAME_TTL} blocks`, nameTtl);\n }\n\n return {\n ...await aensUpdate(name, {}, {\n ...opt, ...options, nameTtl, extendPointers: true,\n }),\n ...await aensQuery(name, { ...opt, ...options }),\n };\n },\n });\n}\n\n/**\n * Claim a previously preclaimed registration. This can only be done after the\n * preclaim step\n * @category AENS\n * @param name - AENS name\n * @param salt - Salt from pre-claim, or 0 if it's a bid\n * @param options - options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @param options.nameFee - Name Fee (By default calculated by sdk)\n * @returns the result of the claim\n * @example\n * ```js\n * const name = 'test.chain'\n * const salt = preclaimResult.salt // salt from pre-claim transaction\n *\n * await sdkInstance.aensClaim(name, salt, { ttl, fee, nonce, nameFee })\n * ```\n */\nexport async function aensClaim(\n name: AensName,\n salt: number,\n options: AensClaimOptions,\n): Promise<AensClaimReturnType> {\n const claimTx = await buildTxAsync({\n ...options,\n tag: Tag.NameClaimTx,\n accountId: options.onAccount.address,\n nameSalt: salt,\n name,\n });\n\n const result = await sendTransaction(claimTx, options);\n if (!isAuctionName(name)) {\n const nameInter = result.blockHeight != null && result.blockHeight > 0\n ? await aensQuery(name, options)\n : {};\n return Object.assign(result, nameInter);\n }\n return result;\n}\n\ntype AensClaimOptionsType = BuildTxOptions<Tag.NameClaimTx, 'accountId' | 'nameSalt' | 'name'>\n& SendTransactionOptions & Parameters<typeof aensQuery>[1];\ninterface AensClaimOptions extends AensClaimOptionsType {}\ninterface AensClaimReturnType extends\n Awaited<ReturnType<typeof sendTransaction>>,\n Partial<Awaited<ReturnType<typeof aensQuery>>> {}\n\n/**\n * Preclaim a name. Sends a hash of the name and a random salt to the node\n * @category AENS\n * @param name - AENS name\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @example\n * ```js\n * const name = 'test.chain'\n * const salt = preclaimResult.salt // salt from pre-claim transaction\n *\n * await sdkInstance.aensPreclaim(name, { ttl, fee, nonce })\n * {\n * ...transactionResult,\n * claim, // Claim function (options={}) => claimTransactionResult\n * salt,\n * commitmentId\n * }\n * ```\n */\nexport async function aensPreclaim(name: AensName, options: AensPreclaimOptions): Promise<Readonly<\nAwaited<ReturnType<typeof sendTransaction>> & {\n salt: number;\n commitmentId: string;\n claim: (opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>;\n}\n>> {\n const salt = genSalt();\n const commitmentId = commitmentHash(name, salt);\n\n const preclaimTx = await buildTxAsync({\n ...options,\n tag: Tag.NamePreclaimTx,\n accountId: options.onAccount.address,\n commitmentId,\n });\n\n return Object.freeze({\n ...await sendTransaction(preclaimTx, options),\n salt,\n commitmentId,\n async claim(opts?: Parameters<typeof aensClaim>[2]) {\n const { version, ...otherOptions } = options;\n return aensClaim(name, salt, { ...otherOptions, ...opts });\n },\n });\n}\n\ninterface AensPreclaimOptions extends\n BuildTxOptions<Tag.NamePreclaimTx, 'accountId' | 'commitmentId' | 'onNode'>,\n SendTransactionOptions,\n Omit<AensClaimOptions, 'version'> {}\n\n/**\n * Bid to name auction\n * @category AENS\n * @param name - Domain name\n * @param nameFee - Name fee (bid fee)\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @returns Transaction result\n * @example\n * ```js\n * const name = 'test.chain'\n * const bidFee = computeBidFee(name, startFee, incrementPercentage)\n *\n * await sdkInstance.aensBid(name, 213109412839123, { ttl, fee, nonce })\n * ```\n */\nexport async function aensBid(\n name: AensName,\n nameFee: number | string | BigNumber,\n options: Omit<Parameters<typeof aensClaim>[2], 'nameFee'>,\n): ReturnType<typeof aensClaim> {\n return aensClaim(name, 0, { ...options, nameFee });\n}\n","/**\n * Contract module - routines to interact with the æternity contract\n *\n * High level documentation of the contracts are available at\n * https://github.com/aeternity/protocol/tree/master/contracts and\n */\n\nimport { Encoder as Calldata } from '@aeternity/aepp-calldata';\nimport { DRY_RUN_ACCOUNT } from '../tx/builder/schema';\nimport { Tag, AensName } from '../tx/builder/constants';\nimport {\n buildContractIdByContractTx, unpackTx, buildTxAsync, BuildTxOptions, buildTxHash,\n} from '../tx/builder';\nimport { decode, Encoded } from '../utils/encoder';\nimport {\n MissingContractDefError,\n MissingContractAddressError,\n InactiveContractError,\n BytecodeMismatchError,\n DuplicateContractError,\n MissingFunctionNameError,\n InvalidMethodInvocationError,\n NotPayableFunctionError,\n TypeError,\n NodeInvocationError,\n IllegalArgumentError,\n NoSuchContractFunctionError,\n MissingEventDefinitionError,\n AmbiguousEventDefinitionError,\n UnexpectedTsError,\n InternalError,\n NoWalletConnectedError,\n ContractError,\n} from '../utils/errors';\nimport { hash as calcHash } from '../utils/crypto';\nimport {\n ContractCallObject as NodeContractCallObject, Event as NodeEvent,\n} from '../apis/node';\nimport CompilerBase, { Aci } from './compiler/Base';\nimport Node, { TransformNodeType } from '../Node';\nimport {\n getAccount, getContract, getContractByteCode, resolveName, txDryRun, sendTransaction,\n SendTransactionOptions,\n} from '../chain';\nimport AccountBase from '../account/Base';\nimport { TxUnpacked } from '../tx/builder/schema.generated';\n\ntype ContractAci = NonNullable<Aci[0]['contract']>;\ntype FunctionAci = ContractAci['functions'][0];\n\ninterface Event extends NodeEvent {\n address: Encoded.ContractAddress;\n data: Encoded.ContractBytearray;\n}\n\nexport interface ContractCallObject extends TransformNodeType<NodeContractCallObject> {\n returnValue: Encoded.ContractBytearray;\n log: Event[];\n}\n\ninterface DecodedEvent {\n name: string;\n args: unknown[];\n contract: {\n name: string;\n address: Encoded.ContractAddress;\n };\n}\n\ntype TxData = Awaited<ReturnType<typeof sendTransaction>>;\n\ninterface SendAndProcessReturnType {\n result?: ContractCallObject;\n hash: TxData['hash'];\n tx: TxUnpacked & { tag: Tag.ContractCallTx | Tag.ContractCreateTx };\n txData: TxData;\n rawTx: Encoded.Transaction;\n}\n\nexport interface ContractMethodsBase { [key: string]: (...args: any[]) => any }\n\ntype MethodsToContractApi<M extends ContractMethodsBase> = {\n [Name in keyof M]:\n M[Name] extends (...args: infer Args) => any\n ? (...args: [\n ...Args,\n ...[] | [Name extends 'init'\n ? Parameters<Contract<M>['$deploy']>[1] : Parameters<Contract<M>['$call']>[2]],\n ]) => ReturnType<Contract<M>['$call']>\n : never\n};\n\ntype ContractWithMethods<M extends ContractMethodsBase> = Contract<M> & MethodsToContractApi<M>;\n\ntype MethodNames<M extends ContractMethodsBase> = keyof M & string | 'init';\n\ntype MethodParameters<M extends ContractMethodsBase, Fn extends MethodNames<M>> =\n Fn extends 'init'\n ? M extends { init: any } ? Parameters<M['init']> : []\n : Parameters<M[Fn]>;\n\ninterface GetContractNameByEventOptions {\n contractAddressToName?: { [key: Encoded.ContractAddress]: string };\n}\n\ninterface GetCallResultByHashReturnType<M extends ContractMethodsBase, Fn extends MethodNames<M>> {\n decodedResult: ReturnType<M[Fn]>;\n decodedEvents?: ReturnType<Contract<M>['$decodeEvents']>;\n}\n\n/**\n * Generate contract ACI object with predefined js methods for contract usage - can be used for\n * creating a reference to already deployed contracts\n * @category contract\n * @param options - Options object\n * @returns JS Contract API\n * @example\n * ```js\n * const contractIns = await aeSdk.initializeContract({ sourceCode })\n * await contractIns.$deploy([321]) or await contractIns.init(321)\n * const callResult = await contractIns.$call('setState', [123])\n * const staticCallResult = await contractIns.$call('setState', [123], { callStatic: true })\n * ```\n * Also you can call contract like: `await contractIns.setState(123, options)`\n * Then sdk decide to make on-chain or static call(dry-run API) transaction based on function is\n * stateful or not\n */\nclass Contract<M extends ContractMethodsBase> {\n /**\n * Compile contract\n * @returns bytecode\n */\n async $compile(): Promise<Encoded.ContractBytearray> {\n if (this.$options.bytecode != null) return this.$options.bytecode;\n if (this.$options.sourceCode == null) throw new IllegalArgumentError('Can\\'t compile without source code');\n if (this.$options.onCompiler == null) throw new IllegalArgumentError('Can\\'t compile without compiler');\n this.$options.bytecode = (await this.$options.onCompiler\n .compileBySourceCode(this.$options.sourceCode, this.$options.fileSystem)\n ).bytecode;\n return this.$options.bytecode;\n }\n\n #getCallResult<Fn extends MethodNames<M>>(\n { returnType, returnValue, log }: ContractCallObject,\n fnName: Fn,\n transaction: Encoded.Transaction | undefined,\n options: Parameters<Contract<M>['$decodeEvents']>[1],\n ): GetCallResultByHashReturnType<M, Fn> {\n let message: string;\n switch (returnType) {\n case 'ok': {\n const fnAci = this.#getFunctionAci(fnName);\n return {\n decodedResult: this._calldata.decode(this._name, fnAci.name, returnValue),\n decodedEvents: this.$decodeEvents(log, options),\n };\n }\n case 'revert':\n message = this._calldata.decodeFateString(returnValue);\n break;\n case 'error':\n message = decode(returnValue).toString();\n break;\n default:\n throw new InternalError(`Unknown return type: ${returnType}`);\n }\n throw new NodeInvocationError(message, transaction);\n }\n\n async #sendAndProcess<Fn extends MethodNames<M>>(\n tx: Encoded.Transaction,\n fnName: Fn,\n options: SendTransactionOptions & Parameters<Contract<M>['$getCallResultByTxHash']>[2],\n ): Promise<SendAndProcessReturnType & Partial<GetCallResultByHashReturnType<M, Fn>>> {\n const txData = await sendTransaction(tx, { ...this.$options, ...options });\n return {\n hash: txData.hash,\n tx: unpackTx<Tag.ContractCallTx | Tag.ContractCreateTx>(txData.rawTx),\n txData,\n rawTx: txData.rawTx,\n ...txData.blockHeight != null && (\n await this.$getCallResultByTxHash(txData.hash, fnName, options)\n ),\n };\n }\n\n async $getCallResultByTxHash<Fn extends MethodNames<M>>(\n hash: Encoded.TxHash,\n fnName: Fn,\n options?: Parameters<Contract<M>['$decodeEvents']>[1],\n ): Promise<GetCallResultByHashReturnType<M, Fn> & { result: ContractCallObject }> {\n const { callInfo } = await this.$options.onNode.getTransactionInfoByHash(hash);\n if (callInfo == null) {\n throw new ContractError(`callInfo is not available for transaction ${hash}`);\n }\n const callInfoTyped = callInfo as ContractCallObject;\n return {\n ...this.#getCallResult(callInfoTyped, fnName, undefined, options),\n result: callInfoTyped,\n };\n }\n\n async _estimateGas<Fn extends MethodNames<M>>(\n name: Fn,\n params: MethodParameters<M, Fn>,\n options: Omit<Parameters<Contract<M>['$call']>[2], 'callStatic'> = {},\n ): Promise<number> {\n const { result } = await this.$call(name, params, { ...options, callStatic: true });\n if (result == null) throw new UnexpectedTsError();\n const { gasUsed } = result;\n // taken from https://github.com/aeternity/aepp-sdk-js/issues/1286#issuecomment-977814771\n return Math.floor(gasUsed * 1.25);\n }\n\n /**\n * Deploy contract\n * @param params - Contract init function arguments array\n * @param options - Options\n * @returns deploy info\n */\n async $deploy(\n params: MethodParameters<M, 'init'>,\n options?: Parameters<Contract<M>['$call']>[2]\n & Partial<BuildTxOptions<Tag.ContractCreateTx, 'ownerId' | 'code' | 'callData'>>,\n ): Promise<Omit<SendAndProcessReturnType, 'hash'> & {\n transaction?: Encoded.TxHash;\n owner?: Encoded.AccountAddress;\n address?: Encoded.ContractAddress;\n decodedEvents?: ReturnType<Contract<M>['$decodeEvents']>;\n }> {\n const { callStatic, ...opt } = { ...this.$options, ...options };\n if (this.$options.bytecode == null) await this.$compile();\n if (callStatic === true) return this.$call('init', params, { ...opt, callStatic });\n if (this.$options.address != null) throw new DuplicateContractError();\n\n if (opt.onAccount == null) throw new IllegalArgumentError('Can\\'t deploy without account');\n const ownerId = opt.onAccount.address;\n if (this.$options.bytecode == null) throw new IllegalArgumentError('Can\\'t deploy without bytecode');\n const tx = await buildTxAsync({\n ...opt,\n tag: Tag.ContractCreateTx,\n gasLimit: opt.gasLimit ?? await this._estimateGas('init', params, opt),\n callData: this._calldata.encode(this._name, 'init', params),\n code: this.$options.bytecode,\n ownerId,\n });\n this.$options.address = buildContractIdByContractTx(tx);\n const { hash, ...other } = await this.#sendAndProcess(\n tx,\n 'init',\n { ...opt, onAccount: opt.onAccount },\n );\n return {\n ...other,\n ...other.result?.log != null && {\n decodedEvents: this.$decodeEvents(other.result.log, opt),\n },\n owner: ownerId,\n transaction: hash,\n address: this.$options.address,\n };\n }\n\n /**\n * Get function schema from contract ACI object\n * @param name - Function name\n * @returns function ACI\n */\n #getFunctionAci(name: string): FunctionAci {\n const fn = this.#aciContract.functions.find(\n (f: { name: string }) => f.name === name,\n );\n if (fn != null) {\n return fn;\n }\n if (name === 'init') {\n return {\n arguments: [], name: 'init', payable: false, returns: 'unit', stateful: true,\n };\n }\n throw new NoSuchContractFunctionError(`Function ${name} doesn't exist in contract`);\n }\n\n /**\n * Call contract function\n * @param fn - Function name\n * @param params - Array of function arguments\n * @param options - Array of function arguments\n * @returns CallResult\n */\n async $call<Fn extends MethodNames<M>>(\n fn: Fn,\n params: MethodParameters<M, Fn>,\n options: Partial<BuildTxOptions<Tag.ContractCallTx, 'callerId' | 'contractId' | 'callData'>>\n & Parameters<Contract<M>['$decodeEvents']>[1]\n & Omit<SendTransactionOptions, 'onAccount' | 'onNode'>\n & Omit<Parameters<typeof txDryRun>[2], 'onNode'>\n & { onAccount?: AccountBase; onNode?: Node; callStatic?: boolean } = {},\n ): Promise<SendAndProcessReturnType & Partial<GetCallResultByHashReturnType<M, Fn>>> {\n const { callStatic, top, ...opt } = { ...this.$options, ...options };\n const fnAci = this.#getFunctionAci(fn);\n const contractId = this.$options.address;\n const { onNode } = opt;\n\n if (fn == null) throw new MissingFunctionNameError();\n if (fn === 'init' && callStatic !== true) throw new InvalidMethodInvocationError('\"init\" can be called only via dryRun');\n if (fn !== 'init' && opt.amount != null && opt.amount > 0 && !fnAci.payable) {\n throw new NotPayableFunctionError(opt.amount, fn);\n }\n\n let callerId;\n try {\n if (opt.onAccount == null) throw new InternalError('Use fallback account');\n callerId = opt.onAccount.address;\n } catch (error) {\n const useFallbackAccount = callStatic === true && (\n (error instanceof TypeError && error.message === 'Account should be an address (ak-prefixed string), or instance of AccountBase, got undefined instead')\n || (error instanceof NoWalletConnectedError)\n );\n if (!useFallbackAccount) throw error;\n callerId = DRY_RUN_ACCOUNT.pub;\n }\n const callData = this._calldata.encode(this._name, fn, params);\n\n if (callStatic === true) {\n if (opt.nonce == null && top != null) {\n const topKey = typeof top === 'number' ? 'height' : 'hash';\n opt.nonce = (await getAccount(callerId, { [topKey]: top, onNode })).nonce + 1;\n }\n const txOpt = { ...opt, onNode, callData };\n let tx;\n if (fn === 'init') {\n if (this.$options.bytecode == null) throw new IllegalArgumentError('Can\\'t dry-run \"init\" without bytecode');\n tx = await buildTxAsync({\n ...txOpt, tag: Tag.ContractCreateTx, code: this.$options.bytecode, ownerId: callerId,\n });\n } else {\n if (contractId == null) throw new MissingContractAddressError('Can\\'t dry-run contract without address');\n tx = await buildTxAsync({\n ...txOpt, tag: Tag.ContractCallTx, callerId, contractId,\n });\n }\n\n const { callObj, ...dryRunOther } = await txDryRun(tx, callerId, { ...opt, top });\n if (callObj == null) {\n throw new InternalError(`callObj is not available for transaction ${tx}`);\n }\n const callInfoTyped = callObj as ContractCallObject;\n return {\n ...dryRunOther,\n ...this.#getCallResult(callInfoTyped, fn, tx, opt),\n tx: unpackTx(tx),\n result: callInfoTyped,\n rawTx: tx,\n hash: buildTxHash(tx),\n txData: undefined as any,\n };\n }\n\n if (top != null) throw new IllegalArgumentError('Can\\'t handle `top` option in on-chain contract call');\n if (contractId == null) throw new MissingContractAddressError('Can\\'t call contract without address');\n const tx = await buildTxAsync({\n ...opt,\n tag: Tag.ContractCallTx,\n gasLimit: opt.gasLimit ?? await this._estimateGas(fn, params, opt),\n callerId,\n contractId,\n callData,\n });\n if (opt.onAccount == null) throw new IllegalArgumentError('Can\\'t call contract on chain without account');\n return this.#sendAndProcess(tx, fn, { ...opt, onAccount: opt.onAccount });\n }\n\n /**\n * @param ctAddress - Contract address that emitted event\n * @param nameHash - Hash of emitted event name\n * @param options - Options\n * @returns Contract name\n * @throws {@link MissingEventDefinitionError}\n * @throws {@link AmbiguousEventDefinitionError}\n */\n #getContractNameByEvent(\n ctAddress: Encoded.ContractAddress,\n nameHash: BigInt,\n { contractAddressToName }: GetContractNameByEventOptions,\n ): string {\n const addressToName = { ...this.$options.contractAddressToName, ...contractAddressToName };\n if (addressToName[ctAddress] != null) return addressToName[ctAddress];\n\n // TODO: consider using a third-party library\n const isEqual = (a: any, b: any): boolean => JSON.stringify(a) === JSON.stringify(b);\n\n const contracts = this._aci\n .map(({ contract }) => contract)\n .filter((contract) => contract?.event) as ContractAci[];\n const matchedEvents = contracts\n .map((contract) => [contract.name, contract.event.variant])\n .map(([name, events]) => events.map((event: {}) => (\n [name, Object.keys(event)[0], Object.values(event)[0]]\n )))\n .flat()\n .filter(([, eventName]) => BigInt(`0x${calcHash(eventName).toString('hex')}`) === nameHash)\n .filter(([, , type], idx, arr) => !arr.slice(0, idx).some((el) => isEqual(el[2], type)));\n switch (matchedEvents.length) {\n case 0: throw new MissingEventDefinitionError(nameHash.toString(), ctAddress);\n case 1: return matchedEvents[0][0];\n default: throw new AmbiguousEventDefinitionError(ctAddress, matchedEvents);\n }\n }\n\n /**\n * Decode Events\n * @param events - Array of encoded events (callRes.result.log)\n * @param options - Options\n * @returns DecodedEvents\n */\n $decodeEvents(\n events: Event[],\n { omitUnknown, ...opt }: { omitUnknown?: boolean } & GetContractNameByEventOptions = {},\n ): DecodedEvent[] {\n return events\n .map((event) => {\n const topics = event.topics.map((t: string | number) => BigInt(t));\n let contractName;\n try {\n contractName = this.#getContractNameByEvent(event.address, topics[0], opt);\n } catch (error) {\n if ((omitUnknown ?? false) && error instanceof MissingEventDefinitionError) return null;\n throw error;\n }\n const decoded = this._calldata.decodeEvent(contractName, event.data, topics);\n const [name, args] = Object.entries(decoded)[0];\n return {\n name,\n args,\n contract: {\n name: contractName,\n address: event.address,\n },\n };\n }).filter((e: DecodedEvent | null): e is DecodedEvent => e != null);\n }\n\n static async initialize<M extends ContractMethodsBase>(\n {\n onCompiler,\n onNode,\n bytecode,\n aci,\n address,\n sourceCodePath,\n sourceCode,\n fileSystem,\n validateBytecode,\n ...otherOptions\n }: Omit<ConstructorParameters<typeof Contract>[0], 'aci' | 'address'> & {\n validateBytecode?: boolean;\n aci?: Aci;\n address?: Encoded.ContractAddress | AensName;\n },\n ): Promise<ContractWithMethods<M>> {\n if (aci == null && onCompiler != null) {\n let res;\n if (sourceCodePath != null) res = await onCompiler.compile(sourceCodePath);\n if (sourceCode != null) res = await onCompiler.compileBySourceCode(sourceCode, fileSystem);\n if (res != null) {\n aci = res.aci;\n bytecode ??= res.bytecode;\n }\n }\n if (aci == null) throw new MissingContractDefError();\n\n if (address != null) {\n address = await resolveName(\n address,\n 'contract_pubkey',\n { resolveByNode: true, onNode },\n ) as Encoded.ContractAddress;\n }\n\n if (address == null && sourceCode == null && bytecode == null) {\n throw new MissingContractAddressError('Can\\'t create instance by ACI without address');\n }\n\n if (address != null) {\n const contract = await getContract(address, { onNode });\n if (contract.active == null) throw new InactiveContractError(address);\n }\n\n if (validateBytecode === true) {\n if (address == null) throw new MissingContractAddressError('Can\\'t validate bytecode without contract address');\n const onChanBytecode = (await getContractByteCode(address, { onNode })).bytecode;\n let isValid = false;\n if (bytecode != null) isValid = bytecode === onChanBytecode;\n else if (sourceCode != null) {\n if (onCompiler == null) throw new IllegalArgumentError('Can\\'t validate bytecode without compiler');\n isValid = await onCompiler.validateBySourceCode(onChanBytecode, sourceCode, fileSystem);\n }\n if (!isValid) throw new BytecodeMismatchError(sourceCode != null ? 'source code' : 'bytecode');\n }\n\n return new ContractWithMethods<M>({\n onCompiler, onNode, sourceCode, bytecode, aci, address, fileSystem, ...otherOptions,\n });\n }\n\n _aci: Aci;\n\n #aciContract: ContractAci;\n\n _name: string;\n\n _calldata: Calldata;\n\n $options: Omit<ConstructorParameters<typeof Contract>[0], 'aci'>;\n\n constructor({ aci, ...otherOptions }: {\n onCompiler?: CompilerBase;\n onNode: Node;\n bytecode?: Encoded.ContractBytearray;\n aci: Aci;\n address?: Encoded.ContractAddress;\n sourceCodePath?: Parameters<CompilerBase['compile']>[0];\n sourceCode?: Parameters<CompilerBase['compileBySourceCode']>[0];\n fileSystem?: Parameters<CompilerBase['compileBySourceCode']>[1];\n } & Parameters<Contract<M>['$deploy']>[1]) {\n this._aci = aci;\n const aciLast = aci[aci.length - 1];\n if (aciLast.contract == null) {\n throw new IllegalArgumentError(`The last 'aci' item should have 'contract' key, got ${Object.keys(aciLast)} keys instead`);\n }\n this.#aciContract = aciLast.contract;\n this._name = this.#aciContract.name;\n this._calldata = new Calldata(aci);\n this.$options = otherOptions;\n\n /**\n * Generate proto function based on contract function using Contract ACI schema\n * All function can be called like:\n * ```js\n * await contract.testFunction()\n * ```\n * then sdk will decide to use dry-run or send tx\n * on-chain base on if function stateful or not.\n * Also, you can manually do that:\n * ```js\n * await contract.testFunction({ callStatic: true }) // use call-static (dry-run)\n * await contract.testFunction({ callStatic: false }) // send tx on-chain\n * ```\n */\n Object.assign(\n this,\n Object.fromEntries(this.#aciContract.functions\n .map(({ name, arguments: aciArgs, stateful }: FunctionAci) => {\n const callStatic = name !== 'init' && !stateful;\n return [\n name,\n async (...args: any) => {\n const options = args.length === aciArgs.length + 1 ? args.pop() : {};\n if (typeof options !== 'object') throw new TypeError(`Options should be an object: ${options}`);\n if (name === 'init') return this.$deploy(args, { callStatic, ...options });\n return this.$call(name, args, { callStatic, ...options });\n },\n ];\n })),\n );\n }\n}\n\ninterface ContractWithMethodsClass {\n new <M extends ContractMethodsBase>(\n options: ConstructorParameters<typeof Contract>[0],\n ): ContractWithMethods<M>;\n initialize: typeof Contract['initialize'];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nconst ContractWithMethods: ContractWithMethodsClass = Contract as any;\n\nexport default ContractWithMethods;\n","/**\n * Oracle methods - routines to interact with the æternity oracle system\n *\n * The high-level description of the oracle system is\n * https://github.com/aeternity/protocol/blob/master/ORACLE.md in the protocol\n * repository.\n */\n\nimport { mapObject, pause } from './utils/other';\nimport { oracleQueryId } from './tx/builder/helpers';\nimport { unpackTx, buildTxAsync, BuildTxOptions } from './tx/builder';\nimport {\n ORACLE_TTL,\n ORACLE_TTL_TYPES,\n QUERY_TTL,\n RESPONSE_TTL,\n} from './tx/builder/schema';\nimport { Tag } from './tx/builder/constants';\nimport { RequestTimedOutError } from './utils/errors';\nimport {\n decode, encode, Encoded, Encoding,\n} from './utils/encoder';\nimport {\n _getPollInterval, getHeight, sendTransaction, SendTransactionOptions,\n} from './chain';\nimport Node from './Node';\nimport AccountBase from './account/Base';\n\ntype OracleQueries = Awaited<ReturnType<Node['getOracleQueriesByPubkey']>>['oracleQueries'];\n\n/**\n * Poll for oracle queries\n * @category oracle\n * @param oracleId - Oracle public key\n * @param onQuery - OnQuery callback\n * @param options - Options object\n * @param options.interval - Poll interval(default: 5000)\n * @param options.onNode - Node to use\n * @returns Callback to stop polling function\n */\nexport function pollForQueries(\n oracleId: Encoded.OracleAddress,\n onQuery: (query: OracleQueries[number]) => void,\n { interval, onNode, ...options }: { interval?: number; onNode: Node }\n & Parameters<typeof _getPollInterval>[1],\n): () => void {\n interval ??= _getPollInterval('microblock', options);\n const knownQueryIds = new Set();\n const checkNewQueries = async (): Promise<void> => {\n const queries = ((await onNode.getOracleQueriesByPubkey(oracleId)).oracleQueries ?? [])\n .filter(({ id }) => !knownQueryIds.has(id));\n queries.forEach((query) => {\n knownQueryIds.add(query.id);\n onQuery(query);\n });\n };\n\n let stopped = false;\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n (async () => {\n while (!stopped) { // eslint-disable-line no-unmodified-loop-condition\n // TODO: allow to handle this error somehow\n await checkNewQueries().catch(console.error);\n await pause(interval);\n }\n })();\n return () => { stopped = true; };\n}\n\n/**\n * Poll for oracle query response\n * @category oracle\n * @param oracleId - Oracle public key\n * @param queryId - Oracle Query id\n * @param options - Options object\n * @param options.interval - Poll interval\n * @param options.onNode - Node to use\n * @returns OracleQuery object\n */\nexport async function pollForQueryResponse(\n oracleId: Encoded.OracleAddress,\n queryId: Encoded.OracleQueryId,\n { interval, onNode, ...options }:\n { interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<string> {\n interval ??= _getPollInterval('microblock', options);\n let height;\n let ttl;\n let response;\n do {\n ({ response, ttl } = await onNode.getOracleQueryByPubkeyAndQueryId(oracleId, queryId));\n const responseBuffer = decode(response as Encoded.OracleResponse);\n if (responseBuffer.length > 0) return responseBuffer.toString();\n await pause(interval);\n height = await getHeight({ onNode });\n } while (ttl >= height);\n throw new RequestTimedOutError(height);\n}\n\n/**\n * Constructor for OracleQuery Object (helper object for using OracleQuery)\n * @category oracle\n * @param oracleId - Oracle public key\n * @param queryId - Oracle Query id\n * @param options - Options\n * @returns OracleQuery object\n */\nexport async function getQueryObject(\n oracleId: Encoded.OracleAddress,\n queryId: Encoded.OracleQueryId,\n options: RespondToQueryOptions & Parameters<typeof pollForQueryResponse>[2],\n): Promise<GetQueryObjectReturnType> {\n const record = await options.onNode.getOracleQueryByPubkeyAndQueryId(oracleId, queryId);\n return {\n ...record,\n decodedQuery: decode(record.query as Encoded.OracleQueryId).toString(),\n decodedResponse: decode(record.response as Encoded.OracleResponse).toString(),\n respond: async (response, opt) => (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n respondToQuery(queryId, response, { ...options, ...opt })\n ),\n pollForResponse: async (opt) => pollForQueryResponse(oracleId, queryId, { ...options, ...opt }),\n };\n}\n\ninterface GetQueryObjectReturnType extends Awaited<ReturnType<Node['getOracleQueryByPubkeyAndQueryId']>> {\n decodedQuery: string;\n decodedResponse: string;\n respond: (response: string, options?: Parameters<typeof respondToQuery>[2]) =>\n ReturnType<typeof respondToQuery>;\n pollForResponse: (options?: Parameters<typeof pollForQueryResponse>[2]) =>\n ReturnType<typeof pollForQueryResponse>;\n}\n\n/**\n * Post query to oracle\n * @category oracle\n * @param oracleId - Oracle public key\n * @param query - Oracle query object\n * @param options - Options object\n * @param options.queryTtl - queryTtl Oracle query time to leave\n * @param options.responseTtl - queryFee Oracle query response time to leave\n * @param options.queryFee - queryFee Oracle query fee\n * @param options.fee - fee Transaction fee\n * @param options.ttl - Transaction time to leave\n * @returns Query object\n */\nexport async function postQueryToOracle(\n oracleId: Encoded.OracleAddress,\n query: string,\n options: PostQueryToOracleOptions,\n): Promise<\n Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getQueryObject>>\n > {\n options.queryFee ??= (await options.onNode.getOracleByPubkey(oracleId)).queryFee.toString();\n const senderId = options.onAccount.address;\n\n const oracleQueryTx = await buildTxAsync({\n queryTtlType: QUERY_TTL.type,\n queryTtlValue: QUERY_TTL.value,\n responseTtlType: RESPONSE_TTL.type,\n responseTtlValue: RESPONSE_TTL.value,\n ...options,\n tag: Tag.OracleQueryTx,\n oracleId,\n senderId,\n query,\n });\n const { nonce } = unpackTx(oracleQueryTx, Tag.OracleQueryTx);\n const queryId = oracleQueryId(senderId, nonce, oracleId);\n return {\n ...await sendTransaction(oracleQueryTx, options),\n ...await getQueryObject(oracleId, queryId, options),\n };\n}\n\ntype PostQueryToOracleOptionsType = Parameters<typeof sendTransaction>[1]\n& Parameters<typeof getQueryObject>[2]\n& BuildTxOptions<Tag.OracleQueryTx, 'oracleId' | 'senderId' | 'query' | 'queryTtlType' | 'queryTtlValue' | 'responseTtlType' | 'responseTtlValue'>\n& {\n queryTtlType?: ORACLE_TTL_TYPES;\n queryTtlValue?: number;\n responseTtlType?: ORACLE_TTL_TYPES;\n responseTtlValue?: number;\n};\ninterface PostQueryToOracleOptions extends PostQueryToOracleOptionsType {}\n\n/**\n * Extend oracle ttl\n * @category oracle\n * @param options - Options object\n * @param options.fee - fee Transaction fee\n * @param options.ttl - Transaction time to leave\n * @param options.oracleTtlType - Oracle time to leave for extend\n * @param options.oracleTtlValue - Oracle time to leave for extend\n * @returns Oracle object\n */\nexport async function extendOracleTtl(options: ExtendOracleTtlOptions): Promise<\nAwaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>\n> {\n const oracleId = encode(decode(options.onAccount.address), Encoding.OracleAddress);\n const oracleExtendTx = await buildTxAsync({\n oracleTtlType: ORACLE_TTL.type,\n oracleTtlValue: ORACLE_TTL.value,\n ...options,\n tag: Tag.OracleExtendTx,\n oracleId,\n });\n return {\n ...await sendTransaction(oracleExtendTx, options),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n ...await getOracleObject(oracleId, options),\n };\n}\n\ntype ExtendOracleTtlOptionsType = SendTransactionOptions & Parameters<typeof getOracleObject>[1]\n& BuildTxOptions<Tag.OracleExtendTx, 'oracleTtlType' | 'oracleTtlValue' | 'callerId' | 'oracleId'>\n& { oracleTtlType?: ORACLE_TTL_TYPES; oracleTtlValue?: number };\ninterface ExtendOracleTtlOptions extends ExtendOracleTtlOptionsType {}\n\n/**\n * Extend oracle ttl\n * @category oracle\n * @param queryId - Oracle query id\n * @param response - Oracle query response\n * @param options - Options object\n * @param options.responseTtl - responseTtl Query response time to leave\n * @param options.fee - Transaction fee\n * @param options.ttl - Transaction time to leave\n * @returns Oracle object\n */\nexport async function respondToQuery(\n queryId: Encoded.OracleQueryId,\n response: string,\n options: RespondToQueryOptions,\n): Promise<\n Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>\n > {\n const oracleId = encode(decode(options.onAccount.address), Encoding.OracleAddress);\n const oracleRespondTx = await buildTxAsync({\n responseTtlType: RESPONSE_TTL.type,\n responseTtlValue: RESPONSE_TTL.value,\n ...options,\n tag: Tag.OracleResponseTx,\n oracleId,\n queryId,\n response,\n });\n return {\n ...await sendTransaction(oracleRespondTx, options),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n ...await getOracleObject(oracleId, options),\n };\n}\n\ntype RespondToQueryOptionsType = SendTransactionOptions & Parameters<typeof getOracleObject>[1]\n& BuildTxOptions<Tag.OracleResponseTx, 'callerId' | 'oracleId' | 'queryId' | 'response' | 'responseTtlType' | 'responseTtlValue'>\n& { responseTtlType?: ORACLE_TTL_TYPES; responseTtlValue?: number };\ninterface RespondToQueryOptions extends RespondToQueryOptionsType {}\n\n/**\n * Constructor for Oracle Object (helper object for using Oracle)\n * @category oracle\n * @param oracleId - Oracle public key\n * @param options - Options\n * @returns Oracle object\n */\nexport async function getOracleObject(\n oracleId: Encoded.OracleAddress,\n options: { onNode: Node; onAccount: AccountBase },\n): Promise<GetOracleObjectReturnType> {\n return {\n ...await options.onNode.getOracleByPubkey(oracleId),\n queries: (await options.onNode.getOracleQueriesByPubkey(oracleId)).oracleQueries,\n ...mapObject<Function, Function>(\n {\n pollQueries: pollForQueries,\n postQuery: postQueryToOracle,\n respondToQuery,\n extendOracle: extendOracleTtl,\n getQuery: getQueryObject,\n },\n ([name, handler]) => [\n name,\n (...args: any) => {\n const lastArg = args[args.length - 1];\n if (lastArg != null && typeof lastArg === 'object' && lastArg.constructor === Object) {\n Object.assign(lastArg, { ...options, ...lastArg });\n } else args.push(options);\n return handler(\n ...['extendOracle', 'respondToQuery'].includes(name) ? [] : [oracleId],\n ...args,\n );\n },\n ],\n ),\n } as any;\n}\n\ninterface GetOracleObjectReturnType extends Awaited<ReturnType<Node['getOracleByPubkey']>> {\n id: Encoded.OracleAddress;\n queries: OracleQueries;\n // TODO: replace getOracleObject with a class\n pollQueries: (cb: Parameters<typeof pollForQueries>[1]) => ReturnType<typeof pollForQueries>;\n postQuery: Function;\n respondToQuery: Function;\n extendOracle: Function;\n getQuery: Function;\n}\n\n/**\n * Register oracle\n * @category oracle\n * @param queryFormat - Format of query\n * @param responseFormat - Format of query response\n * @param options - Options\n * @param options.queryFee - Oracle query Fee\n * @param options - Options object\n * @param options.abiVersion - Always 0 (do not use virtual machine)\n * @param options.fee - Transaction fee\n * @param options.ttl - Transaction time to leave\n * @returns Oracle object\n */\nexport async function registerOracle(\n queryFormat: string,\n responseFormat: string,\n options: RegisterOracleOptions,\n): Promise<\n Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>\n > {\n const accountId = options.onAccount.address;\n const oracleRegisterTx = await buildTxAsync({\n oracleTtlValue: ORACLE_TTL.value,\n oracleTtlType: ORACLE_TTL.type,\n ...options,\n tag: Tag.OracleRegisterTx,\n accountId,\n queryFormat,\n responseFormat,\n });\n return {\n ...await sendTransaction(oracleRegisterTx, options),\n ...await getOracleObject(encode(decode(accountId), Encoding.OracleAddress), options),\n };\n}\n\ntype RegisterOracleOptionsType = SendTransactionOptions & Parameters<typeof getOracleObject>[1]\n& BuildTxOptions<Tag.OracleRegisterTx, 'accountId' | 'queryFormat' | 'responseFormat' | 'oracleTtlType' | 'oracleTtlValue'>\n& {\n oracleTtlType?: ORACLE_TTL_TYPES;\n oracleTtlValue?: number;\n};\ninterface RegisterOracleOptions extends RegisterOracleOptionsType {}\n","import BigNumber from 'bignumber.js';\nimport {\n sendTransaction, getBalance, resolveName, SendTransactionOptions,\n} from './chain';\nimport { buildTxAsync, BuildTxOptions, unpackTx } from './tx/builder';\nimport { ArgumentError } from './utils/errors';\nimport { Encoded, Encoding } from './utils/encoder';\nimport { Tag, AensName } from './tx/builder/constants';\nimport AccountBase from './account/Base';\n\n/**\n * Send coins to another account\n * @category chain\n * @param amount - Amount to spend\n * @param recipientIdOrName - Address or name of recipient account\n * @param options - Options\n * @returns Transaction\n */\nexport async function spend(\n amount: number | string,\n recipientIdOrName: Encoded.AccountAddress | AensName,\n options: SpendOptions,\n): ReturnType<typeof sendTransaction> {\n return sendTransaction(\n await buildTxAsync({\n ...options,\n tag: Tag.SpendTx,\n senderId: options.onAccount.address,\n recipientId: await resolveName<Encoding.AccountAddress>(\n recipientIdOrName,\n 'account_pubkey',\n options,\n ),\n amount,\n }),\n options,\n );\n}\n\ntype SpendOptionsType = BuildTxOptions<Tag.SpendTx, 'senderId' | 'recipientId' | 'amount'>\n& Parameters<typeof resolveName>[2] & { onAccount: AccountBase } & SendTransactionOptions;\ninterface SpendOptions extends SpendOptionsType {}\n\n// TODO: Rename to spendFraction\n/**\n * Spend a fraction of coin balance to another account. Useful if needed to drain account balance\n * completely, sending funds to another account (with fraction set to 1).\n * @category chain\n * @param fraction - Fraction of balance to spend (between 0 and 1)\n * @param recipientIdOrName - Address or name of recipient account\n * @param options - Options\n * @example\n * ```js\n * // `fraction` * 100 = % of AE to be transferred (e.g. `0.42` for 42% or `1` for 100%)\n * const { blockHeight } = await aeSdk.transferFunds(\n * 0.42,\n * 'ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E',\n * );\n * console.log('Transaction mined at', blockHeight);\n * ```\n */\nexport async function transferFunds(\n fraction: number | string,\n recipientIdOrName: AensName | Encoded.AccountAddress,\n options: TransferFundsOptions,\n): ReturnType<typeof sendTransaction> {\n if (fraction < 0 || fraction > 1) {\n throw new ArgumentError('fraction', 'a number between 0 and 1', fraction);\n }\n const recipientId = await resolveName<Encoding.AccountAddress>(\n recipientIdOrName,\n 'account_pubkey',\n options,\n );\n const senderId = options.onAccount.address;\n const balance = new BigNumber(\n await getBalance.bind(options.onAccount)(senderId, options),\n );\n const desiredAmount = balance.times(fraction).integerValue(BigNumber.ROUND_HALF_UP);\n const { fee } = unpackTx(\n await buildTxAsync({\n ...options, tag: Tag.SpendTx, senderId, recipientId, amount: desiredAmount,\n }),\n Tag.SpendTx,\n );\n // Reducing of the amount may reduce transaction fee, so this is not completely accurate\n const amount = desiredAmount.plus(fee).gt(balance) ? balance.minus(fee) : desiredAmount;\n return sendTransaction(\n await buildTxAsync({\n ...options, tag: Tag.SpendTx, senderId, recipientId, amount,\n }),\n options,\n );\n}\n\ntype TransferFundsOptionsType = BuildTxOptions<Tag.SpendTx, 'senderId' | 'recipientId' | 'amount'>\n& Parameters<typeof resolveName>[2] & { onAccount: AccountBase } & SendTransactionOptions;\ninterface TransferFundsOptions extends TransferFundsOptionsType {}\n\n/**\n * Submit transaction of another account paying for it (fee and gas)\n * @category chain\n * @param transaction - tx_<base64>-encoded transaction\n * @param options - Options\n * @returns Object Transaction\n */\nexport async function payForTransaction(\n transaction: Encoded.Transaction,\n options: PayForTransactionOptions,\n): ReturnType<typeof sendTransaction> {\n return sendTransaction(\n await buildTxAsync({\n ...options, tag: Tag.PayingForTx, payerId: options.onAccount.address, tx: transaction,\n }),\n options,\n );\n}\n\ninterface PayForTransactionOptions extends\n BuildTxOptions<Tag.PayingForTx, 'payerId' | 'tx' | 'onNode'>, SendTransactionOptions {\n onAccount: AccountBase;\n}\n","/**\n * Generalized Account module - routines to use generalized account\n */\n\nimport { ConsensusProtocolVersion, Int, Tag } from '../tx/builder/constants';\nimport {\n buildContractIdByContractTx, buildTx, buildTxAsync, BuildTxOptions, unpackTx,\n} from '../tx/builder';\nimport { hash } from '../utils/crypto';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../utils/encoder';\nimport { ArgumentError, IllegalArgumentError } from '../utils/errors';\nimport { concatBuffers } from '../utils/other';\nimport AccountBase from '../account/Base';\nimport Contract from './Contract';\nimport Node from '../Node';\nimport { sendTransaction, SendTransactionOptions, getAccount } from '../chain';\nimport CompilerBase from './compiler/Base';\n\n/**\n * Convert current account to GA\n * @category contract\n * @param authFnName - Authorization function name\n * @param sourceCode - Auth contract source code\n * @param args - init arguments\n * @param options - Options\n * @returns General Account Object\n */\nexport async function createGeneralizedAccount(\n authFnName: string,\n args: any[],\n {\n onAccount, onCompiler, onNode, bytecode, aci, sourceCodePath, sourceCode, fileSystem, ...options\n }: CreateGeneralizedAccountOptions,\n): Promise<Readonly<{\n owner: Encoded.AccountAddress;\n transaction: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n gaContractId: Encoded.ContractAddress;\n }>> {\n const ownerId = onAccount.address;\n if ((await getAccount(ownerId, { onNode })).kind === 'generalized') {\n throw new IllegalArgumentError(`Account ${ownerId} is already GA`);\n }\n\n const contract = await Contract.initialize<{ init: (...a: any[]) => void }>({\n onAccount, onCompiler, onNode, bytecode, aci, sourceCodePath, sourceCode, fileSystem,\n });\n\n const tx = await buildTxAsync({\n ...options,\n tag: Tag.GaAttachTx,\n onNode,\n code: await contract.$compile(),\n gasLimit: options.gasLimit ?? await contract._estimateGas('init', args, options),\n ownerId,\n callData: contract._calldata.encode(contract._name, 'init', args),\n authFun: hash(authFnName),\n });\n const contractId = buildContractIdByContractTx(tx);\n const { hash: transaction, rawTx } = await sendTransaction(tx, {\n onNode, onAccount, onCompiler, ...options,\n });\n\n return Object.freeze({\n owner: ownerId,\n transaction,\n rawTx,\n gaContractId: contractId,\n });\n}\n\ninterface CreateGeneralizedAccountOptions extends\n BuildTxOptions<Tag.GaAttachTx, 'authFun' | 'callData' | 'code' | 'ownerId' | 'gasLimit'>,\n SendTransactionOptions,\n Pick<\n Parameters<typeof Contract.initialize>[0],\n 'bytecode' | 'aci' | 'sourceCodePath' | 'sourceCode' | 'fileSystem'\n > {\n onAccount: AccountBase;\n onCompiler: CompilerBase;\n onNode: Node;\n gasLimit?: number;\n}\n\n/**\n * Build a transaction hash the same as `Auth.tx_hash` by GaMetaTx payload\n * @category contract\n * @param transaction - tx-encoded transaction\n * @param options - Options\n * @param options.fee - GaMetaTx fee, required in Ceres\n * @param options.gasPrice - GaMetaTx gasPrice, required in Ceres\n * @param options.onNode - Node to use\n * @returns Transaction hash\n */\nexport async function buildAuthTxHash(\n transaction: Encoded.Transaction,\n { fee, gasPrice, onNode }: { fee?: Int; gasPrice?: Int; onNode: Node },\n): Promise<Buffer> {\n const { nodeNetworkId, consensusProtocolVersion } = await onNode.getNodeInfo();\n let payload = hash(concatBuffers([Buffer.from(nodeNetworkId), decode(transaction)]));\n if (consensusProtocolVersion === ConsensusProtocolVersion.Ceres) {\n if (fee == null) throw new ArgumentError('fee', 'provided (in Ceres)', fee);\n if (gasPrice == null) throw new ArgumentError('gasPrice', 'provided (in Ceres)', gasPrice);\n payload = hash(decode(buildTx({\n tag: Tag.GaMetaTxAuthData,\n fee,\n gasPrice,\n txHash: encode(payload, Encoding.TxHash),\n })));\n }\n return payload;\n}\n\n/**\n * Build a transaction hash the same as `Auth.tx_hash` by GaMetaTx\n * @category contract\n * @param transaction - tx-encoded signed GaMeta transaction\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Transaction hash\n */\nexport async function buildAuthTxHashByGaMetaTx(\n transaction: Encoded.Transaction,\n { onNode }: { onNode: Node },\n): Promise<Buffer> {\n const txParams = unpackTx(transaction, Tag.SignedTx);\n if (txParams.encodedTx.tag !== Tag.GaMetaTx) {\n throw new ArgumentError('transaction', 'to include GaMetaTx', Tag[txParams.encodedTx.tag]);\n }\n return buildAuthTxHash(buildTx(txParams.encodedTx.tx.encodedTx), {\n fee: txParams.encodedTx.fee,\n gasPrice: txParams.encodedTx.gasPrice,\n onNode,\n });\n}\n","import _Symbol from \"@babel/runtime-corejs3/core-js/symbol\";\nimport _Symbol$iterator from \"@babel/runtime-corejs3/core-js/symbol/iterator\";\nexport default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof _Symbol && \"symbol\" == typeof _Symbol$iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof _Symbol && obj.constructor === _Symbol && obj !== _Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import _Object$defineProperty from \"@babel/runtime-corejs3/core-js/object/define-property\";\nimport toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n _Object$defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nimport _Symbol$toPrimitive from \"@babel/runtime-corejs3/core-js/symbol/to-primitive\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[_Symbol$toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import * as chainMethods from './chain';\nimport * as aensMethods from './aens';\nimport * as spendMethods from './spend';\nimport * as oracleMethods from './oracle';\nimport Contract, { ContractMethodsBase } from './contract/Contract';\nimport createDelegationSignature from './contract/delegation-signature';\nimport * as contractGaMethods from './contract/ga';\nimport { buildTxAsync } from './tx/builder';\nimport { mapObject, UnionToIntersection } from './utils/other';\nimport Node from './Node';\nimport { TxParamsAsync } from './tx/builder/schema.generated';\nimport AccountBase from './account/Base';\nimport { Encoded } from './utils/encoder';\nimport { ArgumentError, NotImplementedError, TypeError } from './utils/errors';\n\nexport type OnAccount = Encoded.AccountAddress | AccountBase | undefined;\n\nexport function getValueOrErrorProxy<Value extends object>(valueCb: () => Value): Value {\n return new Proxy({}, {\n ...Object.fromEntries([\n 'apply', 'construct', 'defineProperty', 'deleteProperty', 'getOwnPropertyDescriptor',\n 'getPrototypeOf', 'isExtensible', 'ownKeys', 'preventExtensions', 'set', 'setPrototypeOf',\n ].map((name) => [name, () => { throw new NotImplementedError(`${name} proxy request`); }])),\n get(t: {}, property: string | symbol, receiver: any) {\n const target = valueCb();\n const value = Reflect.get(target, property, receiver);\n return typeof value === 'function' ? value.bind(target) : value;\n },\n has(t: {}, property: string | symbol) {\n return Reflect.has(valueCb(), property);\n },\n }) as Value;\n}\n\nconst { InvalidTxError: _2, ...chainMethodsOther } = chainMethods;\n\nconst methods = {\n ...chainMethodsOther,\n ...aensMethods,\n ...spendMethods,\n ...oracleMethods,\n createDelegationSignature,\n ...contractGaMethods,\n} as const;\n\ntype Decrement<Number extends number> = [-1, 0, 1, 2, 3, 4, 5][Number];\ntype GetMethodsOptions <Methods extends { [key: string]: Function }> =\n {\n [Name in keyof Methods]:\n Methods[Name] extends (...args: infer Args) => any\n ? Args[Decrement<Args['length']>] : never\n };\ntype MethodsOptions = GetMethodsOptions<typeof methods>;\ninterface AeSdkMethodsOptions\n extends Partial<UnionToIntersection<MethodsOptions[keyof MethodsOptions]>> {\n nodes?: Array<{ name: string; instance: Node }>;\n}\n\n/**\n * AeSdkMethods is the composition of:\n * - chain methods\n * - tx methods\n * - aens methods\n * - spend methods\n * - oracle methods\n * - contract methods\n * - contract ga methods\n *\n * While these methods can be used separately, this class provides a handy way to store\n * their context (current account, network, and compiler to use).\n */\nclass AeSdkMethods {\n _options: AeSdkMethodsOptions = {};\n\n /**\n * @param options - Options\n */\n constructor(options: AeSdkMethodsOptions = {}) {\n Object.assign(this._options, options);\n }\n\n /**\n * Resolves an account\n * @param account - ak-address, instance of AccountBase, or keypair\n */\n // eslint-disable-next-line class-methods-use-this\n _resolveAccount(account?: OnAccount): AccountBase {\n if (typeof account === 'string') throw new NotImplementedError('Address in AccountResolver');\n if (typeof account === 'object') return account;\n throw new TypeError(\n 'Account should be an address (ak-prefixed string), '\n + `or instance of AccountBase, got ${String(account)} instead`,\n );\n }\n\n _getOptions(): AeSdkMethodsOptions & { onAccount: AccountBase } {\n return {\n ...this._options,\n onAccount: getValueOrErrorProxy(() => this._resolveAccount()),\n };\n }\n\n async buildTx(options: TxParamsAsync): Promise<Encoded.Transaction> {\n return buildTxAsync({ ...this._getOptions(), ...options });\n }\n\n async initializeContract<Methods extends ContractMethodsBase>(\n options?: Omit<Parameters<typeof Contract.initialize>[0], 'onNode'> & { onNode?: Node },\n ): Promise<Contract<Methods>> {\n const { onNode, onCompiler, ...otherOptions } = this._getOptions();\n if (onCompiler == null || onNode == null) {\n throw new ArgumentError('onCompiler, onNode', 'provided', null);\n }\n return Contract.initialize<Methods>({\n ...otherOptions,\n onNode,\n onCompiler,\n ...options,\n });\n }\n}\n\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T];\n\ntype OptionalIfNotRequired<T extends [any]> = RequiredKeys<T[0]> extends never ? T | [] : T;\n\ntype ReplaceOnAccount<Options> = Options extends { onAccount: any }\n ? Omit<Options, 'onAccount'> & { onAccount: OnAccount } : Options;\n\ntype MakeOptional<Options> = OptionalIfNotRequired<[\n Omit<Options, 'onNode' | 'onCompiler' | 'onAccount'> & Partial<ReplaceOnAccount<Options>>,\n]>;\n\ntype TransformMethods <Methods extends { [key: string]: Function }> =\n {\n [Name in keyof Methods]:\n Methods[Name] extends (...args: [...infer Args, infer Options]) => infer Ret\n ? (...args: [...Args, ...MakeOptional<Options>]) => Ret\n : never\n };\n\ninterface AeSdkMethodsTransformed extends TransformMethods<typeof methods> {}\n\nObject.assign(AeSdkMethods.prototype, mapObject<Function, Function>(\n methods,\n ([name, handler]) => [\n name,\n function methodWrapper(...args: any[]) {\n args.length = handler.length;\n const options = args[args.length - 1];\n args[args.length - 1] = {\n ...this._getOptions(),\n ...options,\n ...options?.onAccount != null && { onAccount: this._resolveAccount(options.onAccount) },\n };\n return handler(...args);\n },\n ],\n));\n\nexport default AeSdkMethods as new (options?: ConstructorParameters<typeof AeSdkMethods>[0]) =>\nAeSdkMethods & AeSdkMethodsTransformed;\n","import { decode, Encoded } from '../utils/encoder';\nimport { AensName } from '../tx/builder/constants';\nimport AccountBase from '../account/Base';\nimport { concatBuffers } from '../utils/other';\nimport { isNameValid, produceNameId } from '../tx/builder/helpers';\nimport Node from '../Node';\n\n/**\n * Helper to generate a signature to delegate\n * - pre-claim/claim/transfer/revoke of a name to a contract.\n * - register/extend/respond of an Oracle to a contract.\n * @category contract\n * @param contractAddress - Address of contract to delegate access\n * @param ids - The list of id's to prepend\n * @param options - Options\n * @param options.omitAddress - Prepend delegation signature with an account address\n * @param options.onAccount - Account to use\n * @param options.onNode - Node to use\n * @returns Signature\n * @example\n * ```js\n * const aeSdk = new AeSdk({ ... })\n * const contractAddress = 'ct_asd2ks...'\n * const aensName = 'example.chain'\n * const onAccount = new MemoryAccount(...) // Sign with a specific account\n * // Preclaim signature\n * const preclaimSig = await aeSdk.createDelegationSignature(contractAddress, [], { onAccount })\n * // Claim, transfer and revoke signature\n * const aensDelegationSig = await aeSdk\n * .createDelegationSignature(contractAddress, [aensName], { onAccount })\n *\n * const oracleQueryId = 'oq_...'\n * const onAccount = new MemoryAccount(...) // Sign with a specific account\n * // Oracle register and extend signature\n * const oracleDelegationSig = await aeSdk\n * .createDelegationSignature(contractAddress, [], { onAccount })\n * // Oracle respond signature\n * const respondSig = await aeSdk\n * .createDelegationSignature(contractAddress, [oracleQueryId], { onAccount, omitAddress: true })\n * ```\n */\nexport default async function createDelegationSignature(\n contractAddress: Encoded.ContractAddress,\n ids: Array<Encoded.Any | AensName>,\n options: { omitAddress?: boolean; onAccount: AccountBase; onNode: Node },\n): Promise<Uint8Array> {\n return options.onAccount.sign(\n concatBuffers([\n Buffer.from(await options.onNode.getNetworkId()),\n ...options.omitAddress === true ? [] : [decode(options.onAccount.address)],\n ...ids.map((e) => (isNameValid(e) ? produceNameId(e) : e)).map((e) => decode(e)),\n decode(contractAddress),\n ]),\n options,\n );\n}\n","import Node from './Node';\nimport AccountBase from './account/Base';\nimport { CompilerError, DuplicateNodeError, NodeNotFoundError } from './utils/errors';\nimport { Encoded } from './utils/encoder';\nimport CompilerBase from './contract/compiler/Base';\nimport AeSdkMethods, { OnAccount, getValueOrErrorProxy } from './AeSdkMethods';\n\ntype NodeInfo = Awaited<ReturnType<Node['getNodeInfo']>> & { name: string };\n\n/**\n * Basic AeSdk class implements:\n * - node selector,\n * - integrated compiler support,\n * - wrappers of account methods mapped to the current account.\n */\nexport default class AeSdkBase extends AeSdkMethods {\n pool: Map<string, Node> = new Map();\n\n selectedNodeName?: string;\n\n /**\n * @param options - Options\n * @param options.nodes - Array of nodes\n */\n constructor(\n { nodes = [], ...options }: ConstructorParameters<typeof AeSdkMethods>[0] & {\n nodes?: Array<{ name: string; instance: Node }>;\n } = {},\n ) {\n super(options);\n\n nodes.forEach(({ name, instance }, i) => this.addNode(name, instance, i === 0));\n }\n\n // TODO: consider dropping this getter, because:\n // compiler is not intended to be used separately any more (functionality limited to sdk needs)\n // and user creates its instance by himself\n get compilerApi(): CompilerBase {\n if (this._options.onCompiler == null) {\n throw new CompilerError('You can\\'t use Compiler API. Compiler is not ready!');\n }\n return this._options.onCompiler;\n }\n\n get api(): Node {\n this.ensureNodeConnected();\n return this.pool.get(this.selectedNodeName) as Node;\n }\n\n /**\n * Add Node\n * @param name - Node name\n * @param node - Node instance\n * @param select - Select this node as current\n * @example\n * ```js\n * // add and select new node with name 'testNode'\n * aeSdkBase.addNode('testNode', new Node({ url }), true)\n * ```\n */\n addNode(name: string, node: Node, select = false): void {\n if (this.pool.has(name)) throw new DuplicateNodeError(name);\n\n this.pool.set(name, node);\n if (select || this.selectedNodeName == null) {\n this.selectNode(name);\n }\n }\n\n /**\n * Select Node\n * @param name - Node name\n * @example\n * nodePool.selectNode('testNode')\n */\n selectNode(name: string): void {\n if (!this.pool.has(name)) throw new NodeNotFoundError(`Node with name ${name} not in pool`);\n this.selectedNodeName = name;\n }\n\n /**\n * Check if you have selected node\n * @example\n * nodePool.isNodeConnected()\n */\n isNodeConnected(): this is AeSdkBase & { selectedNodeName: string } {\n return this.selectedNodeName != null;\n }\n\n protected ensureNodeConnected(): asserts this is AeSdkBase & { selectedNodeName: string } {\n if (!this.isNodeConnected()) {\n throw new NodeNotFoundError('You can\\'t use Node API. Node is not connected or not defined!');\n }\n }\n\n /**\n * Get information about node\n * @example\n * ```js\n * nodePool.getNodeInfo() // { name, version, networkId, protocol, ... }\n * ```\n */\n async getNodeInfo(): Promise<NodeInfo> {\n this.ensureNodeConnected();\n return {\n name: this.selectedNodeName,\n ...await this.api.getNodeInfo(),\n };\n }\n\n /**\n * Get array of available nodes\n * @example\n * nodePool.getNodesInPool()\n */\n async getNodesInPool(): Promise<NodeInfo[]> {\n return Promise.all(\n Array.from(this.pool.entries()).map(async ([name, node]) => ({\n name,\n ...await node.getNodeInfo(),\n })),\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n addresses(): Encoded.AccountAddress[] {\n return [];\n }\n\n get address(): Encoded.AccountAddress {\n return this._resolveAccount().address;\n }\n\n async sign(\n data: string | Uint8Array,\n { onAccount, ...options }: { onAccount?: OnAccount } = {},\n ): Promise<Uint8Array> {\n return this._resolveAccount(onAccount).sign(data, options);\n }\n\n async signTransaction(\n tx: Encoded.Transaction,\n { onAccount, ...options }: { onAccount?: OnAccount } & Parameters<AccountBase['signTransaction']>[1] = {},\n ): Promise<Encoded.Transaction> {\n const networkId = this.selectedNodeName !== null ? await this.api.getNetworkId() : undefined;\n return this._resolveAccount(onAccount).signTransaction(tx, { networkId, ...options });\n }\n\n async signMessage(\n message: string,\n { onAccount, ...options }: { onAccount?: OnAccount } & Parameters<AccountBase['signMessage']>[1] = {},\n ): Promise<Uint8Array> {\n return this._resolveAccount(onAccount).signMessage(message, options);\n }\n\n override _getOptions(): {\n onNode: Node;\n onAccount: AccountBase;\n onCompiler: CompilerBase;\n } {\n return {\n ...super._getOptions(),\n onNode: getValueOrErrorProxy(() => this.api),\n onCompiler: getValueOrErrorProxy(() => this.compilerApi),\n };\n }\n}\n","import AeSdkBase from './AeSdkBase';\nimport { OnAccount } from './AeSdkMethods';\nimport AccountBase from './account/Base';\nimport { decode, Encoded } from './utils/encoder';\nimport { UnavailableAccountError } from './utils/errors';\n\nexport default class AeSdk extends AeSdkBase {\n accounts: { [key: Encoded.AccountAddress]: AccountBase } = {};\n\n selectedAddress?: Encoded.AccountAddress;\n\n constructor(\n { accounts, ...options }: { accounts?: AccountBase[] }\n & ConstructorParameters<typeof AeSdkBase>[0] = {},\n ) {\n super(options);\n accounts?.forEach((account, idx) => this.addAccount(account, { select: idx === 0 }));\n }\n\n override _resolveAccount(account: OnAccount = this.selectedAddress): AccountBase {\n if (typeof account === 'string') {\n const address = account as Encoded.AccountAddress;\n decode(address);\n if (this.accounts[address] == null) throw new UnavailableAccountError(account);\n account = this.accounts[address];\n }\n return super._resolveAccount(account);\n }\n\n /**\n * Get accounts addresses\n * @example addresses()\n */\n override addresses(): Encoded.AccountAddress[] {\n return Object.keys(this.accounts) as Encoded.AccountAddress[];\n }\n\n /**\n * Add specific account\n * @param account - Account instance\n * @param options - Options\n * @param options.select - Select account\n * @example addAccount(account)\n */\n addAccount(account: AccountBase, { select }: { select?: boolean } = {}): void {\n const { address } = account;\n this.accounts[address] = account;\n if (select === true) this.selectAccount(address);\n }\n\n /**\n * Remove specific account\n * @param address - Address of account to remove\n * @example removeAccount(address)\n */\n removeAccount(address: Encoded.AccountAddress): void {\n if (this.accounts[address] == null) throw new UnavailableAccountError(address);\n delete this.accounts[address]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n if (this.selectedAddress === address) delete this.selectedAddress;\n }\n\n /**\n * Select specific account\n * @param address - Address of account to select\n * @example selectAccount('ak_xxxxxxxx')\n */\n selectAccount(address: Encoded.AccountAddress): void {\n decode(address);\n if (this.accounts[address] == null) throw new UnavailableAccountError(address);\n this.selectedAddress = address;\n }\n}\n","// 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 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 RpcBroadcastError extends RpcError {\n static override code = 3;\n\n override code = 3;\n\n constructor(data?: any) {\n super('Broadcast failed');\n this.data = data;\n this.name = 'RpcBroadcastError';\n }\n}\nrpcErrors.push(RpcBroadcastError);\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","import AccountBase from './Base';\nimport { METHODS } from '../aepp-wallet-communication/schema';\nimport { ArgumentError, NotImplementedError, UnsupportedProtocolError } from '../utils/errors';\nimport { Encoded } from '../utils/encoder';\nimport RpcClient from '../aepp-wallet-communication/rpc/RpcClient';\nimport { AeppApi, WalletApi } from '../aepp-wallet-communication/rpc/types';\n\n/**\n * Account provided by wallet\n * @param params - Params\n * @param params.rpcClient - RpcClient instance\n * @param params.address - RPC account address\n * @returns AccountRpc instance\n */\nexport default class AccountRpc extends AccountBase {\n _rpcClient: RpcClient<WalletApi, AeppApi>;\n\n override readonly address: Encoded.AccountAddress;\n\n constructor(rpcClient: RpcClient<WalletApi, AeppApi>, address: Encoded.AccountAddress) {\n super();\n this._rpcClient = rpcClient;\n this.address = address;\n }\n\n // eslint-disable-next-line class-methods-use-this\n async sign(): Promise<Uint8Array> {\n throw new NotImplementedError('RAW signing using wallet');\n }\n\n /**\n * @returns Signed transaction\n */\n override async signTransaction(\n tx: Encoded.Transaction,\n { innerTx, networkId }: Parameters<AccountBase['signTransaction']>[1] = {},\n ): Promise<Encoded.Transaction> {\n if (innerTx != null) throw new NotImplementedError('innerTx option in AccountRpc');\n if (networkId == null) throw new ArgumentError('networkId', 'provided', networkId);\n const res = await this._rpcClient.request(METHODS.sign, {\n onAccount: this.address,\n tx,\n returnSigned: true,\n networkId,\n });\n if (res.signedTransaction == null) {\n throw new UnsupportedProtocolError('signedTransaction is missed in wallet response');\n }\n return res.signedTransaction;\n }\n\n /**\n * @returns Signed message\n */\n override async signMessage(message: string): Promise<Uint8Array> {\n const { signature } = await this._rpcClient\n .request(METHODS.signMessage, { onAccount: this.address, message });\n return Buffer.from(signature, 'hex');\n }\n}\n","import { RpcError, RpcInternalError, RpcMethodNotFoundError } from '../schema';\nimport BrowserConnection from '../connection/Browser';\nimport { InvalidRpcMessageError, MissingCallbackError } from '../../utils/errors';\n\ninterface JsonRpcRequest {\n jsonrpc: '2.0';\n id: number;\n method: string;\n params?: any;\n}\n\ninterface JsonRpcResponse {\n jsonrpc: '2.0';\n id: number;\n method: string;\n result?: any;\n error?: {\n code: number;\n message: string;\n data?: any;\n };\n}\n\ntype RpcApiHandler = (p?: any) => any | undefined;\ntype RpcApi<Api> = { [k in keyof Api]: RpcApiHandler };\ntype WithOrigin<Api extends RpcApi<Api>> = {\n [k in keyof Api]: (p: Parameters<Api[k]>[0], origin: string) => ReturnType<Api[k]>\n};\n\n/**\n * Contain functionality for using RPC conection\n * @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;\n try {\n if (!(request.method in this.#methods)) throw new RpcMethodNotFoundError();\n const methodName = request.method as keyof LocalApi;\n result = await this.#methods[methodName](request.params, origin);\n } catch (e) {\n error = e instanceof RpcError ? e : new RpcInternalError();\n }\n if (request.id != null) {\n this.#sendResponse(request.id, request.method as keyof LocalApi, result, error);\n }\n }\n\n #sendRequest(\n id: number | undefined,\n method: keyof RemoteApi | keyof LocalApi,\n params?: any,\n ): void {\n this.connection.sendMessage({\n jsonrpc: '2.0',\n ...id != null ? { id } : {},\n method,\n ...params != null ? { params } : {},\n });\n }\n\n #sendResponse(\n id: number,\n method: keyof RemoteApi | keyof LocalApi, // TODO: remove as far it is not required in JSON RPC\n result?: any,\n error?: 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","import AeSdkBase from './AeSdkBase';\nimport { OnAccount } from './AeSdkMethods';\nimport AccountBase from './account/Base';\nimport AccountRpc from './account/Rpc';\nimport { decode, Encoded } from './utils/encoder';\nimport {\n Accounts, RPC_VERSION, WalletInfo, Network, WalletApi, AeppApi,\n} from './aepp-wallet-communication/rpc/types';\nimport RpcClient from './aepp-wallet-communication/rpc/RpcClient';\nimport { METHODS, SUBSCRIPTION_TYPES } from './aepp-wallet-communication/schema';\nimport {\n AlreadyConnectedError,\n NoWalletConnectedError,\n UnsubscribedAccountError,\n UnAuthorizedAccountError,\n RpcConnectionError,\n} from './utils/errors';\nimport Node from './Node';\nimport BrowserConnection from './aepp-wallet-communication/connection/Browser';\n\n/**\n * RPC handler for AEPP side\n * Contain functionality for wallet interaction and connect it to sdk\n * @category aepp wallet communication\n */\nexport default class AeSdkAepp extends AeSdkBase {\n name: string;\n\n onAddressChange: (a: Accounts) => void;\n\n onDisconnect: (p: any) => void;\n\n onNetworkChange: (a: Network) => void;\n\n rpcClient?: RpcClient<WalletApi, AeppApi>;\n\n _accounts?: Accounts;\n\n /**\n * @param options - Options\n * @param options.name - Aepp name\n * @param options.onAddressChange - Call-back function for update address event\n * @param options.onDisconnect - Call-back function for disconnect event\n * @param options.onNetworkChange - Call-back function for update network event\n */\n constructor({\n name,\n onAddressChange = () => {},\n onDisconnect = () => {},\n onNetworkChange = () => {},\n ...other\n }: {\n name: string;\n onAddressChange?: (a: Accounts) => void;\n onDisconnect?: (p: any) => void;\n onNetworkChange?: (a: Network) => void;\n } & ConstructorParameters<typeof AeSdkBase>[0]) {\n super(other);\n this.onAddressChange = onAddressChange;\n this.onDisconnect = onDisconnect;\n this.onNetworkChange = onNetworkChange;\n this.name = name;\n }\n\n override _resolveAccount(account: OnAccount = this.addresses()[0]): AccountBase {\n if (typeof account === 'string') {\n const address = account as Encoded.AccountAddress;\n decode(address);\n if (!this.addresses().includes(address)) throw new UnAuthorizedAccountError(address);\n this._ensureConnected();\n account = new AccountRpc(this.rpcClient, address);\n }\n if (account == null) this._ensureAccountAccess();\n return super._resolveAccount(account);\n }\n\n override addresses(): Encoded.AccountAddress[] {\n if (this._accounts == null) return [];\n const current = Object.keys(this._accounts.current)[0];\n return [\n ...current != null ? [current] : [], ...Object.keys(this._accounts.connected),\n ] as Encoded.AccountAddress[];\n }\n\n /**\n * Connect to wallet\n * @param connection - Wallet connection object\n * @param options - Options\n * @param options.connectNode - Request wallet to bind node\n * @param options.name - Node name\n * @param options.select - Select this node as current\n */\n async connectToWallet(\n connection: BrowserConnection,\n { connectNode = false, name = 'wallet-node', select = false }:\n { connectNode?: boolean; name?: string; select?: boolean } = {},\n ): Promise<WalletInfo> {\n if (this.rpcClient != null) throw new AlreadyConnectedError('You are already connected to wallet');\n let disconnectParams: any;\n const client = new RpcClient<WalletApi, AeppApi>(\n connection,\n () => {\n delete this.rpcClient;\n delete this._accounts;\n this.onDisconnect(disconnectParams);\n },\n {\n [METHODS.updateAddress]: (params) => {\n this._accounts = params;\n this.onAddressChange(params);\n },\n [METHODS.updateNetwork]: (params) => {\n const { node } = params;\n if (node != null) this.addNode(node.name, new Node(node.url), true);\n this.onNetworkChange(params);\n },\n [METHODS.closeConnection]: (params) => {\n disconnectParams = params;\n client.connection.disconnect();\n },\n [METHODS.readyToConnect]: () => {},\n },\n );\n const { node, ...walletInfo } = await client\n .request(METHODS.connect, { name: this.name, version: RPC_VERSION, connectNode });\n if (connectNode) {\n if (node == null) throw new RpcConnectionError('Missing URLs of the Node');\n this.addNode(name, new Node(node.url), select);\n }\n this.rpcClient = client;\n return walletInfo;\n }\n\n /**\n * Disconnect from wallet\n */\n disconnectWallet(): void {\n this._ensureConnected();\n this.rpcClient.notify(METHODS.closeConnection, { reason: 'bye' });\n this.rpcClient.connection.disconnect();\n }\n\n /**\n * Ask addresses from wallet\n * @returns Addresses from wallet\n */\n async askAddresses(): Promise<Encoded.AccountAddress[]> {\n this._ensureAccountAccess();\n return this.rpcClient.request(METHODS.address, undefined);\n }\n\n /**\n * Subscribe for addresses from wallet\n * @param type - Subscription type\n * @param value - Should be one of 'current' (the selected account), 'connected' (all)\n * @returns Accounts from wallet\n */\n async subscribeAddress(\n type: SUBSCRIPTION_TYPES,\n value: 'current' | 'connected',\n ): Promise<ReturnType<WalletApi[METHODS.subscribeAddress]>> {\n this._ensureConnected();\n const result = await this.rpcClient.request(METHODS.subscribeAddress, { type, value });\n this._accounts = result.address;\n return result;\n }\n\n _ensureConnected(): asserts this is AeSdkAepp & { rpcClient: NonNullable<AeSdkAepp['rpcClient']> } {\n if (this.rpcClient != null) return;\n throw new NoWalletConnectedError('You are not connected to Wallet');\n }\n\n _ensureAccountAccess(): asserts this is AeSdkAepp & { rpcClient: NonNullable<AeSdkAepp['rpcClient']> } {\n this._ensureConnected();\n if (this.addresses().length !== 0) return;\n throw new UnsubscribedAccountError();\n }\n}\n","import { Encoded } from '../../utils/encoder';\nimport { METHODS, SUBSCRIPTION_TYPES, WALLET_TYPE } from '../schema';\nimport { TransformNodeType } from '../../Node';\nimport { SignedTx } from '../../apis/node';\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 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 }\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\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","import JsonBig from 'json-bigint';\nimport BigNumber from 'bignumber.js';\nimport { mapObject } from './other';\n\nconst jsonBig = JsonBig({ storeAsString: true });\n\nconst convertValuesToBigNumbers = (value: any): any => {\n if (typeof value === 'object' && value !== null && value.constructor === Object) {\n return mapObject(value, ([k, v]) => [k, convertValuesToBigNumbers(v)]);\n }\n if (Array.isArray(value)) {\n return value.map((item) => convertValuesToBigNumbers(item));\n }\n if (typeof value === 'string' && new BigNumber(value).toString(10) === value) {\n const bn = new BigNumber(value);\n bn.toJSON = () => bn.toString(10);\n return bn;\n }\n return value;\n};\n\nexport default {\n stringify: (...args: Parameters<typeof JsonBig['stringify']>): string => (\n jsonBig.stringify(convertValuesToBigNumbers(args[0]), ...args.slice(1))\n ),\n parse: jsonBig.parse,\n};\n","import { v4 as uuid } from '@aeternity/uuid';\nimport AeSdk from './AeSdk';\nimport verifyTransaction from './tx/validator';\nimport RpcClient from './aepp-wallet-communication/rpc/RpcClient';\nimport {\n METHODS, RPC_STATUS, SUBSCRIPTION_TYPES, WALLET_TYPE,\n RpcBroadcastError, RpcInvalidTransactionError,\n RpcNotAuthorizeError, RpcPermissionDenyError, RpcUnsupportedProtocolError,\n} from './aepp-wallet-communication/schema';\nimport { InternalError, UnknownRpcClientError } from './utils/errors';\nimport AccountBase from './account/Base';\nimport BrowserConnection from './aepp-wallet-communication/connection/Browser';\nimport {\n Accounts,\n AeppApi,\n Network,\n RPC_VERSION,\n WalletApi,\n WalletInfo,\n} from './aepp-wallet-communication/rpc/types';\nimport { Encoded } from './utils/encoder';\nimport jsonBig from './utils/json-big';\n\ntype RpcClientWallet = RpcClient<AeppApi, WalletApi>;\n\ntype OnConnection = (\n clientId: string, params: Omit<Parameters<WalletApi[METHODS.connect]>[0], 'version'>, origin: string\n) => void;\n\ntype OnSubscription = (\n clientId: string, params: Parameters<WalletApi[METHODS.subscribeAddress]>[0], origin: string\n) => void;\n\ntype OnDisconnect = (\n clientId: string, params: Parameters<WalletApi[METHODS.closeConnection]>[0]\n) => void;\n\ntype OnAskAccounts = (\n clientId: string, params: undefined, origin: string\n) => void;\n\ninterface RpcClientsInfo {\n id: string;\n status: RPC_STATUS;\n connectNode: boolean;\n addressSubscription: Set<'connected' | 'current'>;\n rpc: RpcClientWallet;\n}\n\n/**\n * Contain functionality for aepp interaction and managing multiple aepps\n * @category aepp wallet communication\n */\nexport default class AeSdkWallet extends AeSdk {\n id: string;\n\n _type: WALLET_TYPE;\n\n name: string;\n\n _clients = new Map<string, RpcClientsInfo>();\n\n onConnection: OnConnection;\n\n onSubscription: OnSubscription;\n\n onDisconnect: OnDisconnect;\n\n onAskAccounts: OnAskAccounts;\n\n /**\n * @param options - Options\n * @param options.name - Wallet name\n * @param options.id - Wallet id\n * @param options.type - Wallet type\n * @param options.onConnection - Call-back function for incoming AEPP connection\n * @param options.onSubscription - Call-back function for incoming AEPP account subscription\n * @param options.onAskAccounts - Call-back function for incoming AEPP get address request\n * @param options.onDisconnect - Call-back function for disconnect event\n */\n constructor({\n name,\n id,\n type,\n onConnection,\n onSubscription,\n onDisconnect,\n onAskAccounts,\n ...options\n }: {\n id: string;\n type: WALLET_TYPE;\n name: string;\n onConnection: OnConnection;\n onSubscription: OnSubscription;\n onDisconnect: OnDisconnect;\n onAskAccounts: OnAskAccounts;\n } & ConstructorParameters<typeof AeSdk>[0]) {\n super(options);\n this.onConnection = onConnection;\n this.onSubscription = onSubscription;\n this.onDisconnect = onDisconnect;\n this.onAskAccounts = onAskAccounts;\n this.name = name;\n this.id = id;\n this._type = type;\n }\n\n _pushAccountsToApps(): void {\n if (this._clients == null) return;\n Array.from(this._clients.keys())\n .filter((clientId) => this._isRpcClientSubscribed(clientId))\n .map((clientId) => this._getClient(clientId).rpc)\n .forEach((client) => client.notify(METHODS.updateAddress, this.getAccounts()));\n }\n\n override selectAccount(address: Encoded.AccountAddress): void {\n super.selectAccount(address);\n this._pushAccountsToApps();\n }\n\n override addAccount(account: AccountBase, options?: Parameters<AeSdk['addAccount']>[1]): void {\n super.addAccount(account, options);\n this._pushAccountsToApps();\n }\n\n _getNode(): { node: Network['node'] } {\n this.ensureNodeConnected();\n return { node: { url: this.api.$host, name: this.selectedNodeName } };\n }\n\n override async selectNode(name: string): Promise<void> {\n super.selectNode(name);\n const networkId = await this.api.getNetworkId();\n Array.from(this._clients.keys())\n .filter((clientId) => this._isRpcClientConnected(clientId))\n .map((clientId) => this._getClient(clientId))\n .forEach((client) => {\n client.rpc.notify(METHODS.updateNetwork, {\n networkId,\n ...client.connectNode && this._getNode(),\n });\n });\n }\n\n _getClient(clientId: string): RpcClientsInfo {\n const client = this._clients.get(clientId);\n if (client == null) throw new UnknownRpcClientError(clientId);\n return client;\n }\n\n _isRpcClientSubscribed(clientId: string): boolean {\n return this._isRpcClientConnected(clientId)\n && this._getClient(clientId).addressSubscription.size !== 0;\n }\n\n _isRpcClientConnected(clientId: string): boolean {\n return RPC_STATUS.CONNECTED === this._getClient(clientId).status\n && this._getClient(clientId).rpc.connection.isConnected();\n }\n\n _disconnectRpcClient(clientId: string): void {\n const client = this._getClient(clientId);\n client.rpc.connection.disconnect();\n client.status = RPC_STATUS.DISCONNECTED;\n client.addressSubscription = new Set();\n }\n\n /**\n * Remove specific RpcClient by ID\n * @param id - Client ID\n */\n removeRpcClient(id: string): void {\n this._disconnectRpcClient(id);\n this._clients.delete(id);\n }\n\n /**\n * Add new client by AEPP connection\n * @param clientConnection - AEPP connection object\n * @returns Client ID\n */\n addRpcClient(clientConnection: BrowserConnection): string {\n // @TODO detect if aepp has some history based on origin????\n // if yes use this instance for connection\n const id = uuid();\n let disconnectParams: any;\n const client: RpcClientsInfo = {\n id,\n status: RPC_STATUS.WAITING_FOR_CONNECTION_REQUEST,\n addressSubscription: new Set(),\n connectNode: false,\n rpc: new RpcClient<AeppApi, WalletApi>(\n clientConnection,\n () => {\n this._clients.delete(id);\n this.onDisconnect(id, disconnectParams); // also related info\n },\n {\n [METHODS.closeConnection]: (params) => {\n disconnectParams = params;\n this._disconnectRpcClient(id);\n },\n // Store client info and prepare two fn for each client `connect` and `denyConnection`\n // which automatically prepare and send response for that client\n [METHODS.connect]: async ({\n name, version, icons, connectNode,\n }, origin) => {\n if (version !== RPC_VERSION) throw new RpcUnsupportedProtocolError();\n\n await this.onConnection(id, { name, icons, connectNode }, origin);\n client.status = RPC_STATUS.CONNECTED;\n client.connectNode = connectNode;\n return {\n ...await this.getWalletInfo(),\n ...connectNode && this._getNode(),\n };\n },\n [METHODS.subscribeAddress]: async ({ type, value }, origin) => {\n if (!this._isRpcClientConnected(id)) throw new RpcNotAuthorizeError();\n\n await this.onSubscription(id, { type, value }, origin);\n\n switch (type) {\n case SUBSCRIPTION_TYPES.subscribe:\n client.addressSubscription.add(value);\n break;\n case SUBSCRIPTION_TYPES.unsubscribe:\n client.addressSubscription.delete(value);\n break;\n default:\n throw new InternalError(`Unknown subscription type: ${type}`);\n }\n\n return {\n subscription: Array.from(client.addressSubscription),\n address: this.getAccounts(),\n };\n },\n [METHODS.address]: async (params, origin) => {\n if (!this._isRpcClientSubscribed(id)) throw new RpcNotAuthorizeError();\n await this.onAskAccounts(id, params, origin);\n return this.addresses();\n },\n [METHODS.sign]: async ({ tx, onAccount = this.address, returnSigned }, origin) => {\n if (!this._isRpcClientConnected(id)) throw new RpcNotAuthorizeError();\n if (!this.addresses().includes(onAccount)) {\n throw new RpcPermissionDenyError(onAccount);\n }\n\n const parameters = { onAccount, aeppOrigin: origin, aeppRpcClientId: id };\n if (returnSigned) {\n return { signedTransaction: await this.signTransaction(tx, parameters) };\n }\n try {\n return jsonBig.parse(jsonBig.stringify({\n transactionHash: await this.sendTransaction(tx, { ...parameters, verify: false }),\n }));\n } catch (error) {\n const validation = await verifyTransaction(tx, this.api);\n if (validation.length > 0) throw new RpcInvalidTransactionError(validation);\n throw new RpcBroadcastError(error.message);\n }\n },\n [METHODS.signMessage]: async ({ message, onAccount = this.address }, origin) => {\n if (!this._isRpcClientConnected(id)) throw new RpcNotAuthorizeError();\n if (!this.addresses().includes(onAccount)) {\n throw new RpcPermissionDenyError(onAccount);\n }\n\n const parameters = { onAccount, aeppOrigin: origin, aeppRpcClientId: id };\n return {\n signature: Buffer.from(await this.signMessage(message, parameters)).toString('hex'),\n };\n },\n },\n ),\n };\n this._clients.set(id, client);\n return id;\n }\n\n /**\n * Send shareWalletInfo message to notify AEPP about wallet\n * @param clientId - ID of RPC client send message to\n */\n async shareWalletInfo(clientId: string): Promise<void> {\n this._getClient(clientId).rpc.notify(METHODS.readyToConnect, await this.getWalletInfo());\n }\n\n /**\n * Get Wallet info object\n * @returns Object with wallet information\n */\n async getWalletInfo(): Promise<WalletInfo> {\n return {\n id: this.id,\n name: this.name,\n networkId: await this.api.getNetworkId(),\n origin: window.location.origin,\n type: this._type,\n };\n }\n\n /**\n * Get Wallet accounts\n * @returns Object with accounts information (\\{ connected: Object, current: Object \\})\n */\n getAccounts(): Accounts {\n return {\n current: this.selectedAddress != null ? { [this.selectedAddress]: {} } : {},\n connected: this.addresses()\n .filter((a) => a !== this.selectedAddress)\n .reduce((acc, a) => ({ ...acc, [a]: {} }), {}),\n };\n }\n}\n","import AccountBase from './Base';\nimport {\n ArgumentError,\n InternalError,\n InvalidAuthDataError,\n NotImplementedError,\n} from '../utils/errors';\nimport { decode, Encoded } from '../utils/encoder';\nimport { getAccount } from '../chain';\nimport Contract from '../contract/Contract';\nimport { buildTxAsync, buildTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\n\n/**\n * Generalized account class\n */\nexport default class AccountGeneralized extends AccountBase {\n override readonly address: Encoded.AccountAddress;\n\n #authFun?: string;\n\n /**\n * @param address - Address of generalized account\n */\n constructor(address: Encoded.AccountAddress) {\n super();\n decode(address);\n this.address = address;\n }\n\n // eslint-disable-next-line class-methods-use-this\n override async sign(): Promise<Uint8Array> {\n throw new NotImplementedError('Can\\'t sign using generalized account');\n }\n\n // eslint-disable-next-line class-methods-use-this\n override async signMessage(): Promise<Uint8Array> {\n throw new NotImplementedError('Can\\'t sign using generalized account');\n }\n\n override async signTransaction(\n tx: Encoded.Transaction,\n { authData, onCompiler, onNode }: Parameters<AccountBase['signTransaction']>[1],\n ): Promise<Encoded.Transaction> {\n if (authData == null || onCompiler == null || onNode == null) {\n throw new ArgumentError('authData, onCompiler, onNode', 'provided', null);\n }\n const {\n callData, sourceCode, args, fee, gasLimit, gasPrice,\n } = typeof authData === 'function' ? await authData(tx) : authData;\n\n const authCallData = callData ?? await (async () => {\n if (this.#authFun == null) {\n const account = await getAccount(this.address, { onNode });\n if (account.kind !== 'generalized') {\n throw new ArgumentError('account kind', 'generalized', account.kind);\n }\n this.#authFun = account.authFun;\n }\n if (this.#authFun == null) {\n throw new InternalError('Account in generalised, but authFun not provided');\n }\n\n if (sourceCode == null || args == null) {\n throw new InvalidAuthDataError('Auth data must contain source code and arguments.');\n }\n const contract = await Contract.initialize({ onCompiler, onNode, sourceCode });\n return contract._calldata.encode(contract._name, this.#authFun, args);\n })();\n\n const gaMetaTx = await buildTxAsync({\n tag: Tag.GaMetaTx,\n tx: { tag: Tag.SignedTx, encodedTx: decode(tx), signatures: [] },\n gaId: this.address,\n authData: authCallData,\n fee,\n gasLimit,\n gasPrice,\n onNode,\n });\n return buildTx({ tag: Tag.SignedTx, encodedTx: decode(gaMetaTx), signatures: [] });\n }\n}\n","import type Transport from '@ledgerhq/hw-transport';\nimport AccountBase from './Base';\nimport { ArgumentError, NotImplementedError } from '../utils/errors';\nimport { decode, Encoded } from '../utils/encoder';\nimport { buildTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\n\nexport const CLA = 0xe0;\nexport const GET_ADDRESS = 0x02;\nexport const SIGN_TRANSACTION = 0x04;\nexport const GET_APP_CONFIGURATION = 0x06;\nexport const SIGN_PERSONAL_MESSAGE = 0x08;\n\n/**\n * Ledger wallet account class\n */\nexport default class AccountLedger extends AccountBase {\n readonly transport: Transport;\n\n override readonly address: Encoded.AccountAddress;\n\n readonly index: number;\n\n /**\n * @param transport - Connection to Ledger to use\n * @param index - Index of account\n * @param address - Address of account\n */\n constructor(transport: Transport, index: number, address: Encoded.AccountAddress) {\n super();\n this.transport = transport;\n this.index = index;\n this.address = address;\n const scrambleKey = 'w0w';\n transport.decorateAppAPIMethods(this, ['signTransaction', 'signMessage'], scrambleKey);\n }\n\n // eslint-disable-next-line class-methods-use-this\n override async sign(): Promise<Uint8Array> {\n throw new NotImplementedError('RAW signing using Ledger HW');\n }\n\n override async signTransaction(\n tx: Encoded.Transaction,\n { innerTx, networkId }: { innerTx?: boolean; networkId?: string } = {},\n ): Promise<Encoded.Transaction> {\n if (innerTx != null) throw new NotImplementedError('innerTx option in AccountLedger');\n if (networkId == null) throw new ArgumentError('networkId', 'provided', networkId);\n\n const rawTx = decode(tx);\n let offset = 0;\n const headerLength = 4 + 1 + 4;\n const networkIdBuffer = Buffer.from(networkId);\n const toSend = [];\n while (offset !== rawTx.length) {\n const maxChunkSize = offset === 0 ? 150 - headerLength - networkIdBuffer.length : 150;\n const chunkSize = offset + maxChunkSize > rawTx.length\n ? rawTx.length - offset : maxChunkSize;\n const buffer = Buffer.alloc(\n offset === 0 ? headerLength + networkIdBuffer.length + chunkSize : chunkSize,\n );\n if (offset === 0) {\n let bufferOffset = buffer.writeUInt32BE(this.index, 0);\n bufferOffset = buffer.writeUInt32BE(rawTx.length, bufferOffset);\n bufferOffset = buffer.writeUInt8(networkIdBuffer.length, bufferOffset);\n bufferOffset += networkIdBuffer.copy(\n buffer,\n bufferOffset,\n 0,\n networkIdBuffer.length,\n );\n rawTx.copy(buffer, bufferOffset, 0, 150 - bufferOffset);\n } else {\n rawTx.copy(buffer, 0, offset, offset + chunkSize);\n }\n toSend.push(buffer);\n offset += chunkSize;\n }\n const response = await toSend.reduce(\n async (previous, data, i) => {\n await previous;\n return this.transport.send(\n CLA,\n SIGN_TRANSACTION,\n i === 0 ? 0x00 : 0x80,\n 0x00,\n data,\n );\n },\n Promise.resolve(Buffer.alloc(0)),\n );\n const signatures = [response.subarray(0, 64)];\n\n return buildTx({ tag: Tag.SignedTx, encodedTx: rawTx, signatures });\n }\n\n override async signMessage(messageStr: string): Promise<Uint8Array> {\n let offset = 0;\n const message = Buffer.from(messageStr);\n const toSend = [];\n while (offset !== message.length) {\n const maxChunkSize = offset === 0 ? 150 - 4 - 4 : 150;\n const chunkSize = offset + maxChunkSize > message.length\n ? message.length - offset : maxChunkSize;\n const buffer = Buffer.alloc(offset === 0 ? 4 + 4 + chunkSize : chunkSize);\n if (offset === 0) {\n buffer.writeUInt32BE(this.index, 0);\n buffer.writeUInt32BE(message.length, 4);\n message.copy(buffer, 4 + 4, offset, offset + chunkSize);\n } else {\n message.copy(buffer, 0, offset, offset + chunkSize);\n }\n toSend.push(buffer);\n offset += chunkSize;\n }\n const response = await toSend.reduce(\n async (previous, data, i) => {\n await previous;\n return this.transport.send(\n CLA,\n SIGN_PERSONAL_MESSAGE,\n i === 0 ? 0x00 : 0x80,\n 0x00,\n data,\n );\n },\n Promise.resolve(Buffer.alloc(0)),\n );\n return response.subarray(0, 64);\n }\n}\n","import type Transport from '@ledgerhq/hw-transport';\nimport AccountLedger, { CLA, GET_ADDRESS, GET_APP_CONFIGURATION } from './Ledger';\nimport { UnsupportedVersionError } from '../utils/errors';\nimport { Encoded } from '../utils/encoder';\nimport semverSatisfies from '../utils/semver-satisfies';\nimport Node from '../Node';\n\n/**\n * A factory class that generates instances of AccountLedger based on provided transport.\n */\nexport default class AccountLedgerFactory {\n readonly transport: Transport;\n\n private readonly versionCheckPromise: Promise<void>;\n\n /**\n * @param transport - Connection to Ledger to use\n */\n constructor(transport: Transport) {\n this.transport = transport;\n this.versionCheckPromise = this.getAppConfiguration().then(({ version }) => {\n const args = [version, '0.4.4', '0.5.0'] as const;\n if (!semverSatisfies(...args)) throw new UnsupportedVersionError('app on ledger', ...args);\n });\n const scrambleKey = 'w0w';\n transport.decorateAppAPIMethods(this, ['getAddress', 'getAppConfiguration'], scrambleKey);\n }\n\n /**\n * @returns the version of app installed on Ledger wallet\n */\n async getAppConfiguration(): Promise<{ version: string }> {\n await this.versionCheckPromise;\n const response = await this.transport.send(CLA, GET_APP_CONFIGURATION, 0x00, 0x00);\n return {\n version: [response[1], response[2], response[3]].join('.'),\n };\n }\n\n /**\n * Get `ak_`-prefixed address for a given account index.\n * @param accountIndex - Index of account\n * @param verify - Ask user to confirm address by showing it on the device screen\n */\n async getAddress(accountIndex: number, verify = false): Promise<Encoded.AccountAddress> {\n await this.versionCheckPromise;\n const buffer = Buffer.alloc(4);\n buffer.writeUInt32BE(accountIndex, 0);\n const response = await this.transport.send(\n CLA,\n GET_ADDRESS,\n verify ? 0x01 : 0x00,\n 0x00,\n buffer,\n );\n const addressLength = response[0];\n return response.subarray(1, 1 + addressLength).toString('ascii') as Encoded.AccountAddress;\n }\n\n /**\n * Get an instance of AccountLedger for a given account index.\n * @param accountIndex - Index of account\n */\n async initialize(accountIndex: number): Promise<AccountLedger> {\n await this.versionCheckPromise;\n return new AccountLedger(this.transport, accountIndex, await this.getAddress(accountIndex));\n }\n\n /**\n * Discovers accounts on Ledger that already have been used (has any on-chain transactions).\n * It returns an empty array if none of accounts been used.\n * If a used account is preceded by an unused account then it would be ignored.\n * @param node - Instance of Node to get account information from\n */\n async discover(node: Node): Promise<AccountLedger[]> {\n let index = 0;\n const result = [];\n let account;\n do {\n if (account != null) result.push(account);\n account = await this.initialize(index);\n index += 1;\n } while (await node.getAccountByPubkey(account.address).then(() => true, () => false));\n return result;\n }\n}\n","import { Encoded } from '../../utils/encoder';\n\ninterface FunctionAci {\n arguments: any[];\n name: string;\n payable: boolean;\n returns: any;\n stateful: boolean;\n}\n\nexport type Aci = Array<{\n contract?: {\n name: string;\n event?: any;\n functions: FunctionAci[];\n };\n}>;\n\n/**\n * A base class for all compiler implementations\n */\nexport default abstract class CompilerBase {\n /**\n * Compile contract by contract's path\n * Available only in Node.js\n * @param path - Path to contract source code\n * @returns ACI and bytecode\n */\n abstract compile(path: string): Promise<{\n bytecode: Encoded.ContractBytearray;\n aci: Aci;\n }>;\n\n /**\n * Compile contract by contract's source code\n * @param sourceCode - Contract source code as string\n * @param fileSystem - A map of contract filename to the corresponding contract source code to\n * include into the main contract\n * @example\n * ```js\n * {\n * 'library.aes': 'namespace TestLib =\\n function sum(x: int, y: int) : int = x + y'\n * }\n * ```\n * @returns ACI and bytecode\n */\n abstract compileBySourceCode(\n sourceCode: string,\n fileSystem?: Record<string, string>,\n ): Promise<{\n bytecode: Encoded.ContractBytearray;\n aci: Aci;\n }>;\n\n /**\n * Verify that a contract bytecode is the result of compiling the given source code\n * Available only in Node.js\n * @param bytecode - Contract bytecode to verify\n * @param path - Path to contract source code\n * @returns ACI and bytecode\n */\n abstract validate(bytecode: Encoded.ContractBytearray, path: string): Promise<boolean>;\n\n /**\n * Verify that a contract bytecode is the result of compiling the given source code\n * @param bytecode - Contract bytecode to verify\n * @param sourceCode - Contract source code as string\n * @param fileSystem - A map of contract filename to the corresponding contract source code to\n * include into the main contract\n * @example\n * ```js\n * {\n * 'library.aes': 'namespace TestLib =\\n function sum(x: int, y: int) : int = x + y'\n * }\n * ```\n */\n abstract validateBySourceCode(\n bytecode: Encoded.ContractBytearray,\n sourceCode: string,\n fileSystem?: Record<string, string>,\n ): Promise<boolean>;\n\n /**\n * @returns Compiler version\n */\n abstract version(): Promise<string>;\n}\n","import * as coreClient from \"@azure/core-client\";\n\nexport const Contract: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Contract\",\n modelProperties: {\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n }\n }\n }\n};\n\nexport const CompileOpts: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompileOpts\",\n modelProperties: {\n fileSystem: {\n serializedName: \"file_system\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n },\n srcFile: {\n serializedName: \"src_file\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Aci: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Aci\",\n modelProperties: {\n encodedAci: {\n serializedName: \"encoded_aci\",\n required: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n },\n externalEncodedAci: {\n serializedName: \"external_encoded_aci\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n },\n interface: {\n serializedName: \"interface\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CompilerError: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompilerError\",\n modelProperties: {\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pos: {\n serializedName: \"pos\",\n type: {\n name: \"Composite\",\n className: \"ErrorPos\"\n }\n },\n message: {\n serializedName: \"message\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n context: {\n serializedName: \"context\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ErrorPos: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorPos\",\n modelProperties: {\n file: {\n serializedName: \"file\",\n type: {\n name: \"String\"\n }\n },\n line: {\n serializedName: \"line\",\n required: true,\n type: {\n name: \"Number\"\n }\n },\n col: {\n serializedName: \"col\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n }\n }\n};\n\nexport const CompileResult: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompileResult\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n aci: {\n serializedName: \"aci\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n }\n }\n};\n\nexport const SophiaCallResultInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SophiaCallResultInput\",\n modelProperties: {\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callResult: {\n serializedName: \"call-result\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callValue: {\n serializedName: \"call-value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const BytecodeCallResultInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"BytecodeCallResultInput\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callResult: {\n serializedName: \"call-result\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callValue: {\n serializedName: \"call-value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodedCallresult: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodedCallresult\",\n modelProperties: {\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n result: {\n serializedName: \"result\",\n required: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n};\n\nexport const FunctionCallInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"FunctionCallInput\",\n modelProperties: {\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n arguments: {\n serializedName: \"arguments\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Calldata: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Calldata\",\n modelProperties: {\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodeCalldataBytecode: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodeCalldataBytecode\",\n modelProperties: {\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodedCalldata: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodedCalldata\",\n modelProperties: {\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n arguments: {\n serializedName: \"arguments\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n }\n }\n};\n\nexport const ErrorModel: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorModel\",\n modelProperties: {\n reason: {\n serializedName: \"reason\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodeCalldataSource: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodeCalldataSource\",\n modelProperties: {\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ByteCodeInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ByteCodeInput\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const FateAssembler: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"FateAssembler\",\n modelProperties: {\n fateAssembler: {\n serializedName: \"fate-assembler\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ValidateByteCodeInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ValidateByteCodeInput\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n }\n }\n }\n};\n\nexport const CompilerVersion: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompilerVersion\",\n modelProperties: {\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ApiVersion: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ApiVersion\",\n modelProperties: {\n apiVersion: {\n serializedName: \"api-version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SophiaBinaryData: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SophiaBinaryData\",\n modelProperties: {\n sophiaType: {\n serializedName: \"sophia-type\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n data: {\n serializedName: \"data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SophiaJsonData: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SophiaJsonData\",\n modelProperties: {\n data: {\n serializedName: \"data\",\n required: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n};\n","import { OperationParameter, OperationURLParameter } from \"@azure/core-client\";\nimport {\n Contract as ContractMapper,\n SophiaCallResultInput as SophiaCallResultInputMapper,\n BytecodeCallResultInput as BytecodeCallResultInputMapper,\n FunctionCallInput as FunctionCallInputMapper,\n DecodeCalldataBytecode as DecodeCalldataBytecodeMapper,\n DecodeCalldataSource as DecodeCalldataSourceMapper,\n ByteCodeInput as ByteCodeInputMapper,\n ValidateByteCodeInput as ValidateByteCodeInputMapper\n} from \"../models/mappers\";\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const body: OperationParameter = {\n parameterPath: \"body\",\n mapper: ContractMapper\n};\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const $host: OperationURLParameter = {\n parameterPath: \"$host\",\n mapper: {\n serializedName: \"$host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const body1: OperationParameter = {\n parameterPath: \"body\",\n mapper: SophiaCallResultInputMapper\n};\n\nexport const body2: OperationParameter = {\n parameterPath: \"body\",\n mapper: BytecodeCallResultInputMapper\n};\n\nexport const body3: OperationParameter = {\n parameterPath: \"body\",\n mapper: FunctionCallInputMapper\n};\n\nexport const body4: OperationParameter = {\n parameterPath: \"body\",\n mapper: DecodeCalldataBytecodeMapper\n};\n\nexport const body5: OperationParameter = {\n parameterPath: \"body\",\n mapper: DecodeCalldataSourceMapper\n};\n\nexport const body6: OperationParameter = {\n parameterPath: \"body\",\n mapper: ByteCodeInputMapper\n};\n\nexport const body7: OperationParameter = {\n parameterPath: \"body\",\n mapper: ValidateByteCodeInputMapper\n};\n","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: Mappers.Aci\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","import { RestError } from '@azure/core-rest-pipeline';\nimport {\n Compiler as CompilerApi,\n ErrorModel,\n CompilerError as CompilerErrorApi,\n} from '../../apis/compiler';\nimport { genErrorFormatterPolicy, genVersionCheckPolicy } from '../../utils/autorest';\nimport CompilerBase, { Aci } from './Base';\nimport { Encoded } from '../../utils/encoder';\nimport { CompilerError, NotImplementedError } from '../../utils/errors';\n\ntype GeneralCompilerError = ErrorModel & {\n info?: object;\n parameter?: string;\n};\n\n/**\n * Contract Compiler over HTTP\n *\n * This class include api call's related to contract compiler functionality.\n * @category contract\n * @example CompilerHttp('COMPILER_URL')\n */\nexport default class CompilerHttp extends CompilerBase {\n readonly api: CompilerApi;\n\n /**\n * @param compilerUrl - Url for compiler API\n * @param options - Options\n * @param options.ignoreVersion - Don't check compiler version\n */\n constructor(compilerUrl: string, { ignoreVersion }: { ignoreVersion?: boolean } = {}) {\n super();\n this.api = new CompilerApi(compilerUrl, {\n allowInsecureConnection: true,\n additionalPolicies: [\n genErrorFormatterPolicy((body: GeneralCompilerError | CompilerErrorApi[]) => {\n let message = '';\n if ('reason' in body) {\n message += ` ${body.reason\n }${body.parameter != null ? ` in ${body.parameter}` : ''\n // TODO: revising after improving documentation https://github.com/aeternity/aesophia_http/issues/78\n }${body.info != null ? ` (${JSON.stringify(body.info)})` : ''}`;\n }\n if (Array.isArray(body)) {\n message += `\\n${body\n .map((e) => `${e.type}:${e.pos.line}:${e.pos.col}: ${e.message}${e.context != null ? ` (${e.context})` : ''}`)\n .join('\\n')}`;\n }\n return message;\n }),\n ],\n });\n if (ignoreVersion !== true) {\n const versionPromise = this.api.apiVersion()\n .then(({ apiVersion }) => apiVersion, (error) => error);\n this.api.pipeline.addPolicy(\n genVersionCheckPolicy('compiler', '/api-version', versionPromise, '7.1.1', '8.0.0'),\n );\n }\n }\n\n async compileBySourceCode(\n sourceCode: string,\n fileSystem?: Record<string, string>,\n ): Promise<{ bytecode: Encoded.ContractBytearray; aci: Aci }> {\n try {\n const res = await this.api.compileContract({ code: sourceCode, options: { fileSystem } });\n // TODO: should be fixed when the compiledAci interface gets updated\n return res as { bytecode: Encoded.ContractBytearray; aci: Aci };\n } catch (error) {\n if (error instanceof RestError && error.statusCode === 400) {\n throw new CompilerError(error.message.replace(/^aci error:/, 'compile error:'));\n }\n throw error;\n }\n }\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n async compile(path: string): Promise<{ bytecode: Encoded.ContractBytearray; aci: Aci }> {\n throw new NotImplementedError('File system access, use CompilerHttpNode instead');\n }\n\n async validateBySourceCode(\n bytecode: Encoded.ContractBytearray,\n sourceCode: string,\n fileSystem?: Record<string, string>,\n ): Promise<boolean> {\n try {\n await this.api.validateByteCode({ bytecode, source: sourceCode, options: { fileSystem } });\n return true;\n } catch {\n return false;\n }\n }\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n async validate(bytecode: Encoded.ContractBytearray, path: string): Promise<boolean> {\n throw new NotImplementedError('File system access, use CompilerHttpNode instead');\n }\n\n async version(): Promise<string> {\n return (await this.api.version()).version;\n }\n}\n","/**\n * Convert string from snake_case to PascalCase\n * @param s - String to convert\n * @returns Converted string\n */\nexport function snakeToPascal(s: string): string {\n return s.replace(/_./g, (match) => match[1].toUpperCase());\n}\n\n/**\n * Convert string from PascalCase to snake_case\n * @param s - String to convert\n * @returns Converted string\n */\nexport function pascalToSnake(s: string): string {\n return s.replace(/[A-Z]/g, (match) => `_${match.toLowerCase()}`);\n}\n","import { w3cwebsocket as W3CWebSocket } from 'websocket';\nimport BigNumber from 'bignumber.js';\nimport type Channel from './Base';\nimport JsonBig from '../utils/json-big';\nimport { pascalToSnake } from '../utils/string';\nimport { Encoded } from '../utils/encoder';\nimport {\n BaseError,\n ChannelCallError,\n ChannelPingTimedOutError,\n UnexpectedTsError,\n UnknownChannelStateError,\n ChannelIncomingMessageError,\n ChannelError,\n} from '../utils/errors';\nimport { encodeContractAddress } from '../utils/crypto';\nimport { buildTx } from '../tx/builder';\n\nexport interface ChannelEvents {\n statusChanged: (status: ChannelStatus) => void;\n stateChanged: (tx: Encoded.Transaction | '') => void;\n depositLocked: () => void;\n ownDepositLocked: () => void;\n withdrawLocked: () => void;\n ownWithdrawLocked: () => void;\n peerDisconnected: () => void;\n channelReestablished: () => void;\n error: (error: Error) => void;\n onChainTx: (tx: Encoded.Transaction, details: { info: string; type: string }) => void;\n message: (message: string | Object) => void;\n newContract: (contractAddress: Encoded.ContractAddress) => void;\n}\n\nexport interface ChannelAction {\n guard: (channel: Channel, state?: ChannelFsm) => boolean;\n action: (channel: Channel, state?: ChannelFsm) => ChannelFsm;\n}\n\ninterface SignOptions {\n updates?: any[];\n [k: string]: any;\n}\nexport type SignTxWithTag = (tag: string, tx: Encoded.Transaction, options?: SignOptions) => (\n Promise<Encoded.Transaction>\n);\n// TODO: SignTx shouldn't return number or null\nexport type SignTx = (tx: Encoded.Transaction, options?: SignOptions) => (\n Promise<Encoded.Transaction | number | null>\n);\n\nexport interface ChannelOptions {\n existingFsmId?: Encoded.Bytearray;\n url: string;\n\n /**\n * @see {@link https://github.com/aeternity/protocol/blob/6734de2e4c7cce7e5e626caa8305fb535785131d/node/api/channels_api_usage.md#channel-establishing-parameters}\n */\n initiatorId: Encoded.AccountAddress;\n responderId: Encoded.AccountAddress;\n lockPeriod: number;\n pushAmount: number;\n initiatorAmount: BigNumber;\n responderAmount: BigNumber;\n channelReserve?: BigNumber | number;\n ttl?: number;\n host: string;\n port: number;\n role: 'initiator' | 'responder';\n minimumDepthStrategy?: 'txfee' | 'plain';\n minimumDepth?: number;\n fee?: BigNumber | number;\n gasPrice?: BigNumber | number;\n\n signedTx?: string;\n existingChannelId?: string;\n offChainTx?: string;\n reconnectTx?: string;\n timeoutIdle?: number;\n timeoutFundingCreate?: number;\n timeoutFundingSign?: number;\n timeoutFundingLock?: number;\n timeoutSign?: number;\n timeoutAccept?: number;\n timeoutInitialized?: number;\n timeoutAwaitingOpen?: number;\n statePassword?: string;\n debug: boolean;\n sign: SignTxWithTag;\n offchainTx?: string;\n}\n\nexport interface ChannelHandler extends Function {\n enter?: Function;\n}\n\nexport interface ChannelState {\n signedTx: Encoded.Transaction;\n resolve: (r?: any) => void;\n reject: (e: BaseError) => void;\n sign: SignTx;\n handler?: ChannelHandler;\n onOnChainTx?: (tx: Encoded.Transaction) => void;\n onOwnWithdrawLocked?: () => void;\n onWithdrawLocked?: () => void;\n onOwnDepositLocked?: () => void;\n onDepositLocked?: () => void;\n closeTx?: string;\n}\n\nexport interface ChannelFsm {\n handler: ChannelHandler;\n state?: ChannelState | {\n resolve: Function;\n reject: Function;\n };\n}\n\nexport interface ChannelMessage {\n id?: number;\n method: string;\n params: any;\n payload?: any;\n data?: any;\n error?: ChannelMessageError;\n}\n\ninterface ChannelMessageError {\n code: number;\n message: string;\n data: [{\n message: string;\n code: number;\n }];\n request: ChannelMessage;\n}\n\n// Send ping message every 10 seconds\nconst PING_TIMEOUT_MS = 10000;\n// Close connection if pong message is not received within 15 seconds\nconst PONG_TIMEOUT_MS = 15000;\n\nexport function emit<E extends keyof ChannelEvents>(\n channel: Channel,\n ...args: [E, ...Parameters<ChannelEvents[E]>]\n): void {\n const [eventName, ...rest] = args;\n channel._eventEmitter.emit(eventName, ...rest);\n}\n\nfunction enterState(channel: Channel, nextState: ChannelFsm): void {\n if (nextState == null) {\n throw new UnknownChannelStateError();\n }\n channel._fsm = nextState;\n if (nextState?.handler?.enter != null) {\n nextState.handler.enter(channel);\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n void dequeueAction(channel);\n}\n\n// TODO: rewrite to enum\nexport type ChannelStatus = 'connecting' | 'connected' | 'accepted' | 'halfSigned' | 'signed'\n| 'open' | 'closing' | 'closed' | 'died' | 'disconnected';\n\nexport function changeStatus(channel: Channel, newStatus: ChannelStatus): void {\n if (newStatus === channel._status) return;\n channel._status = newStatus;\n emit(channel, 'statusChanged', newStatus);\n}\n\nexport function changeState(channel: Channel, newState: Encoded.Transaction | ''): void {\n channel._state = newState;\n emit(channel, 'stateChanged', newState);\n}\n\nfunction send(channel: Channel, message: ChannelMessage): void {\n if (channel._options.debug) console.log('Send message: ', message);\n channel._websocket.send(JsonBig.stringify({ jsonrpc: '2.0', ...message }));\n}\n\nexport function notify(channel: Channel, method: string, params: object = {}): void {\n send(channel, { method, params });\n}\n\nasync function dequeueAction(channel: Channel): Promise<void> {\n if (channel._isActionQueueLocked) return;\n const queue = channel._actionQueue;\n if (queue.length === 0) return;\n const index = queue.findIndex((action) => action.guard(channel, channel._fsm));\n if (index === -1) return;\n channel._actionQueue = queue.filter((_, i) => index !== i);\n channel._isActionQueueLocked = true;\n const nextState: ChannelFsm = await queue[index].action(channel, channel._fsm);\n channel._isActionQueueLocked = false;\n enterState(channel, nextState);\n}\n\nexport async function enqueueAction(\n channel: Channel,\n guard: ChannelAction['guard'],\n action: () => { handler: ChannelHandler; state?: Partial<ChannelState> },\n): Promise<any> {\n const promise = new Promise((resolve, reject) => {\n channel._actionQueue.push({\n guard,\n action() {\n const res = action();\n return { ...res, state: { ...res.state, resolve, reject } };\n },\n });\n });\n void dequeueAction(channel);\n return promise;\n}\n\nasync function handleMessage(channel: Channel, message: ChannelMessage): Promise<void> {\n const { handler, state: st } = channel._fsm;\n const nextState = await Promise.resolve(handler(channel, message, st));\n enterState(channel, nextState);\n // TODO: emit message and handler name (?) to move this code to Contract constructor\n if (\n message?.params?.data?.updates?.[0]?.op === 'OffChainNewContract'\n // if name is channelOpen, the contract was created by other participant\n && nextState?.handler.name === 'channelOpen'\n ) {\n const round = channel.round();\n if (round == null) throw new UnexpectedTsError('Round is null');\n const owner = message?.params?.data?.updates?.[0]?.owner;\n emit(channel, 'newContract', encodeContractAddress(owner, round + 1));\n }\n}\n\nasync function dequeueMessage(channel: Channel): Promise<void> {\n if (channel._isMessageQueueLocked) return;\n channel._isMessageQueueLocked = true;\n while (channel._messageQueue.length > 0) {\n const message = channel._messageQueue.shift();\n if (message == null) throw new UnexpectedTsError();\n try {\n await handleMessage(channel, message);\n } catch (error) {\n emit(channel, 'error', new ChannelIncomingMessageError(error, message));\n }\n }\n channel._isMessageQueueLocked = false;\n}\n\nexport function disconnect(channel: Channel): void {\n channel._websocket.close();\n clearTimeout(channel._pingTimeoutId);\n}\n\nfunction ping(channel: Channel): void {\n clearTimeout(channel._pingTimeoutId);\n channel._pingTimeoutId = setTimeout(() => {\n notify(channel, 'channels.system', { action: 'ping' });\n channel._pingTimeoutId = setTimeout(() => {\n disconnect(channel);\n emit(channel, 'error', new ChannelPingTimedOutError());\n }, PONG_TIMEOUT_MS);\n }, PING_TIMEOUT_MS);\n}\n\nfunction onMessage(channel: Channel, data: string): void {\n const message = JsonBig.parse(data);\n if (channel._options.debug) console.log('Receive message: ', message);\n if (message.id != null) {\n const callback = channel._rpcCallbacks.get(message.id);\n if (callback == null) {\n emit(channel, 'error', new ChannelError(`Can't find callback by id: ${message.id}`));\n return;\n }\n try {\n callback(message);\n } finally {\n channel._rpcCallbacks.delete(message.id);\n }\n return;\n }\n if (message.method === 'channels.message') {\n emit(channel, 'message', message.params.data.message);\n return;\n }\n if (message.method === 'channels.system.pong') {\n if (message.params.channel_id === channel._channelId || channel._channelId == null) {\n ping(channel);\n }\n return;\n }\n channel._messageQueue.push(message);\n void dequeueMessage(channel);\n}\n\nexport async function call(channel: Channel, method: string, params: any): Promise<any> {\n return new Promise((resolve, reject) => {\n const id = channel._nextRpcMessageId;\n channel._nextRpcMessageId += 1;\n channel._rpcCallbacks.set(id, (\n message: { result: PromiseLike<any>; error?: ChannelMessageError },\n ) => {\n if (message.error != null) {\n const details = message.error.data[0].message ?? '';\n reject(new ChannelCallError(message.error.message + details));\n } else resolve(message.result);\n });\n send(channel, { method, id, params });\n });\n}\n\nexport async function initialize(\n channel: Channel,\n connectionHandler: Function,\n openHandler: Function,\n { url, ...channelOptions }: ChannelOptions,\n): Promise<void> {\n channel._options = { url, ...channelOptions };\n channel._fsm = { handler: connectionHandler };\n\n const wsUrl = new URL(url);\n Object.entries(channelOptions)\n .filter(([key]) => !['sign', 'debug'].includes(key))\n .forEach(([key, value]) => wsUrl.searchParams.set(pascalToSnake(key), value.toString()));\n wsUrl.searchParams.set('protocol', 'json-rpc');\n changeStatus(channel, 'connecting');\n channel._websocket = new W3CWebSocket(wsUrl.toString());\n await new Promise<void>((resolve, reject) => {\n Object.assign(channel._websocket, {\n onerror: reject,\n onopen: async () => {\n resolve();\n changeStatus(channel, 'connected');\n if (channelOptions.reconnectTx != null) {\n enterState(channel, { handler: openHandler });\n const { signedTx } = await channel.state();\n if (signedTx == null) {\n throw new ChannelError('`signedTx` missed in state while reconnection');\n }\n changeState(channel, buildTx(signedTx));\n }\n ping(channel);\n },\n onclose: () => {\n changeStatus(channel, 'disconnected');\n clearTimeout(channel._pingTimeoutId);\n },\n onmessage: ({ data }: { data: string }) => onMessage(channel, data),\n });\n });\n}\n","/* eslint-disable consistent-return */\n/* eslint-disable default-case */\n/* eslint-disable @typescript-eslint/no-use-before-define */\nimport {\n ChannelState,\n changeStatus,\n changeState,\n notify,\n emit,\n disconnect,\n ChannelMessage,\n ChannelFsm,\n SignTx,\n ChannelStatus,\n ChannelEvents,\n} from './internal';\nimport { unpackTx, buildTx } from '../tx/builder';\nimport { decode, Encoded } from '../utils/encoder';\nimport {\n IllegalArgumentError,\n InsufficientBalanceError,\n ChannelConnectionError,\n UnexpectedChannelMessageError,\n ChannelError,\n} from '../utils/errors';\nimport type Channel from './Base';\nimport { Tag } from '../tx/builder/constants';\nimport { snakeToPascal } from '../utils/string';\n\nexport async function appendSignature(\n tx: Encoded.Transaction,\n signFn: SignTx,\n): Promise<Encoded.Transaction | number | null> {\n const { signatures, encodedTx } = unpackTx(tx, Tag.SignedTx);\n const payloadTx = buildTx(encodedTx);\n const result = await signFn(payloadTx);\n if (typeof result === 'string') {\n const { signatures: signatures2 } = unpackTx(result, Tag.SignedTx);\n return buildTx({\n tag: Tag.SignedTx,\n signatures: signatures.concat(signatures2),\n encodedTx: decode(payloadTx),\n });\n }\n return result;\n}\n\nexport async function signAndNotify(\n channel: Channel,\n method: string,\n data: {\n tx?: Encoded.Transaction;\n signed_tx?: Encoded.Transaction;\n },\n signFn: SignTx,\n): Promise<boolean> {\n let signedTx;\n if (data.tx != null) signedTx = await signFn(data.tx);\n else if (data.signed_tx != null) signedTx = await appendSignature(data.signed_tx, signFn);\n else throw new ChannelError('Can\\'t find transaction in message');\n const isError = typeof signedTx !== 'string';\n const key = data.tx != null ? 'tx' : 'signed_tx';\n notify(channel, method, isError ? { error: signedTx ?? 1 } : { [key]: signedTx });\n return isError;\n}\n\nexport function handleUnexpectedMessage(\n _channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n state?.reject?.(Object.assign(\n new UnexpectedChannelMessageError(`Unexpected message received:\\n\\n${JSON.stringify(message)}`),\n { wsMessage: message },\n ));\n return { handler: channelOpen };\n}\n\nexport function awaitingCompletion(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n onSuccess?: typeof handleUnexpectedMessage,\n): ChannelFsm {\n if (onSuccess != null && message.method === 'channels.update') {\n return onSuccess(channel, message, state);\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n if (message.error != null) {\n const codes = message.error.data.map((d) => d.code);\n if (codes.includes(1001)) {\n state.reject(new InsufficientBalanceError('Insufficient balance'));\n } else if (codes.includes(1002)) {\n state.reject(new IllegalArgumentError('Amount cannot be negative'));\n } else {\n state.reject(new ChannelConnectionError(message.error.message));\n }\n return { handler: channelOpen };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingConnection(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n if (message.method === 'channels.info') {\n const channelInfoStatus: string = message.params.data.event;\n\n let nextStatus: ChannelStatus | null = null;\n if (channelInfoStatus === 'channel_accept') nextStatus = 'accepted';\n if (channelInfoStatus === 'funding_created') nextStatus = 'halfSigned';\n if (nextStatus != null) {\n changeStatus(channel, nextStatus);\n return { handler: awaitingChannelCreateTx };\n }\n\n if (message.params.data.event === 'channel_reestablished') {\n return { handler: awaitingOpenConfirmation };\n }\n if (message.params.data.event === 'fsm_up') {\n channel._fsmId = message.params.data.fsm_id;\n return { handler: awaitingConnection };\n }\n return { handler: awaitingConnection };\n }\n if (message.method === 'channels.error') {\n emit(channel, 'error', new ChannelConnectionError(message?.payload?.message));\n return { handler: channelClosed };\n }\n}\n\nexport async function awaitingReconnection(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm> {\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'fsm_up') {\n channel._fsmId = message.params.data.fsm_id;\n const { signedTx } = await channel.state();\n changeState(channel, signedTx == null ? '' : buildTx(signedTx));\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingChannelCreateTx(\n channel: Channel,\n message: ChannelMessage,\n): Promise<ChannelFsm | undefined> {\n const tag = channel._options.role === 'initiator' ? 'initiator_sign' : 'responder_sign';\n if (message.method === `channels.sign.${tag}`) {\n await signAndNotify(\n channel,\n `channels.${tag}`,\n message.params.data,\n async (tx) => channel._options.sign(tag, tx),\n );\n return { handler: awaitingOnChainTx };\n }\n}\n\nexport function awaitingOnChainTx(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n function awaitingBlockInclusion(_: Channel, message2: ChannelMessage): ChannelFsm | undefined {\n if (message2.method === 'channels.info') {\n switch (message2.params.data.event) {\n case 'funding_created':\n case 'own_funding_locked':\n return { handler: awaitingBlockInclusion };\n case 'funding_locked':\n return { handler: awaitingOpenConfirmation };\n }\n }\n if (message2.method === 'channels.on_chain_tx') {\n emit(channel, 'onChainTx', message2.params.data.tx, {\n info: message2.params.data.info,\n type: message2.params.data.type,\n });\n return { handler: awaitingBlockInclusion };\n }\n }\n\n if (message.method === 'channels.on_chain_tx') {\n const { info } = message.params.data;\n const { role } = channel._options;\n if ((info === 'funding_signed' && role === 'initiator')\n || (info === 'funding_created' && role === 'responder')) {\n return { handler: awaitingBlockInclusion };\n }\n }\n if (\n message.method === 'channels.info'\n && message.params.data.event === 'funding_signed'\n && channel._options.role === 'initiator'\n ) {\n channel._channelId = message.params.channel_id;\n changeStatus(channel, 'signed');\n return { handler: awaitingOnChainTx };\n }\n}\n\nfunction awaitingOpenConfirmation(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n if (message.method === 'channels.info' && message.params.data.event === 'open') {\n channel._channelId = message.params.channel_id;\n return {\n handler(_: Channel, message2: ChannelMessage): ChannelFsm | undefined {\n if (message2.method === 'channels.update') {\n changeState(channel, message2.params.data.state);\n return { handler: channelOpen };\n }\n },\n };\n }\n}\n\nexport async function channelOpen(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n switch (message.method) {\n case 'channels.info':\n switch (message.params.data.event) {\n case 'update':\n case 'withdraw_created':\n case 'deposit_created':\n return { handler: awaitingTxSignRequest };\n case 'own_withdraw_locked':\n case 'withdraw_locked':\n case 'own_deposit_locked':\n case 'deposit_locked':\n case 'peer_disconnected':\n case 'channel_reestablished':\n case 'open':\n // TODO: Better handling of peer_disconnected event.\n //\n // We should enter intermediate state where offchain transactions\n // are blocked until channel is reestablished.\n emit(channel, snakeToPascal(message.params.data.event) as keyof ChannelEvents);\n return { handler: channelOpen };\n case 'fsm_up':\n channel._fsmId = message.params.data.fsm_id;\n return { handler: channelOpen };\n case 'timeout':\n case 'close_mutual':\n return { handler: channelOpen };\n case 'closing':\n changeStatus(channel, 'closing');\n return { handler: channelOpen };\n case 'closed_confirmed':\n changeStatus(channel, 'closed');\n return { handler: channelClosed };\n case 'died':\n changeStatus(channel, 'died');\n return { handler: channelClosed };\n case 'shutdown':\n return { handler: channelOpen };\n }\n break;\n case 'channels.on_chain_tx':\n emit(channel, 'onChainTx', message.params.data.tx, {\n info: message.params.data.info,\n type: message.params.data.type,\n });\n return { handler: channelOpen };\n case 'channels.leave':\n // TODO: emit event\n return { handler: channelOpen };\n case 'channels.update':\n changeState(channel, message.params.data.state);\n return { handler: channelOpen };\n case 'channels.sign.shutdown_sign_ack':\n return awaitingTxSignRequest(channel, message, state);\n }\n}\nchannelOpen.enter = (channel: Channel) => {\n changeStatus(channel, 'open');\n};\n\nasync function awaitingTxSignRequest(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm> {\n const [, tag] = message.method.match(/^channels\\.sign\\.([^.]+)$/) ?? [];\n if (tag == null) return handleUnexpectedMessage(channel, message, state);\n const isError = await signAndNotify(\n channel,\n `channels.${tag}`,\n message.params.data,\n async (tx) => channel._options.sign(tag, tx, { updates: message.params.data.updates }),\n );\n\n function awaitingUpdateConflict(_: Channel, message2: ChannelMessage): ChannelFsm {\n if (message2.error != null) {\n return { handler: awaitingUpdateConflict, state };\n }\n if (message2.method === 'channels.conflict') {\n return { handler: channelOpen };\n }\n return handleUnexpectedMessage(channel, message2, state);\n }\n return isError ? { handler: awaitingUpdateConflict, state } : { handler: channelOpen };\n}\n\nexport async function awaitingShutdownTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm> {\n if (message.method !== 'channels.sign.shutdown_sign') {\n return handleUnexpectedMessage(channel, message, state);\n }\n await signAndNotify(\n channel,\n 'channels.shutdown_sign',\n message.params.data,\n async (tx) => state.sign(tx),\n );\n return {\n handler(_: Channel, message2: ChannelMessage): ChannelFsm {\n if (message2.method !== 'channels.on_chain_tx') {\n return handleUnexpectedMessage(channel, message2, state);\n }\n // state.resolve(message.params.data.tx)\n return { handler: channelClosed, state };\n },\n state,\n };\n}\n\nexport function awaitingLeave(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.leave') {\n state.resolve({ channelId: message.params.channel_id, signedTx: message.params.data.state });\n disconnect(channel);\n return { handler: channelClosed };\n }\n if (message.method === 'channels.error') {\n state.reject(new ChannelConnectionError(message.data.message));\n return { handler: channelOpen };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function channelClosed(\n _channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (state == null) return { handler: channelClosed };\n if (message.params.data.event === 'closing') return { handler: channelClosed, state };\n if (message.params.data.info === 'channel_closed') {\n state.closeTx = message.params.data.tx;\n return { handler: channelClosed, state };\n }\n if (message.params.data.event === 'closed_confirmed') {\n state.resolve(state.closeTx);\n return { handler: channelClosed };\n }\n return { handler: channelClosed, state };\n}\n","import { EventEmitter } from 'events';\nimport { w3cwebsocket as W3CWebSocket } from 'websocket';\nimport { snakeToPascal } from '../utils/string';\nimport { buildTx, unpackTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\nimport * as handlers from './handlers';\nimport {\n initialize,\n enqueueAction,\n notify,\n call,\n disconnect as channelDisconnect,\n SignTx,\n ChannelOptions,\n ChannelState,\n ChannelHandler,\n ChannelAction,\n ChannelStatus,\n ChannelFsm,\n ChannelMessage,\n ChannelEvents,\n} from './internal';\nimport { ChannelError } from '../utils/errors';\nimport { Encoded } from '../utils/encoder';\nimport { TxUnpacked } from '../tx/builder/schema.generated';\n\nfunction snakeToPascalObjKeys<Type>(obj: object): Type {\n return Object.entries(obj).reduce((result, [key, val]) => ({\n ...result,\n [snakeToPascal(key)]: val,\n }), {}) as Type;\n}\n\n/**\n * Channel\n * @example\n * ```js\n * await Channel.initialize({\n * url: 'ws://localhost:3001',\n * role: 'initiator'\n * initiatorId: 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * responderId: 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E',\n * initiatorAmount: 1e18,\n * responderAmount: 1e18,\n * pushAmount: 0,\n * channelReserve: 0,\n * ttl: 1000,\n * host: 'localhost',\n * port: 3002,\n * lockPeriod: 10,\n * async sign (tag, tx) => await account.signTransaction(tx)\n * })\n * ```\n */\nexport default class Channel {\n _eventEmitter = new EventEmitter();\n\n _pingTimeoutId: NodeJS.Timeout;\n\n _nextRpcMessageId = 0;\n\n _rpcCallbacks = new Map<number, (message: object) => void>();\n\n _fsmId?: Encoded.Bytearray;\n\n _messageQueue: ChannelMessage[] = [];\n\n _isMessageQueueLocked = false;\n\n _actionQueue: ChannelAction[] = [];\n\n _isActionQueueLocked = false;\n\n _status: ChannelStatus = 'disconnected';\n\n _fsm: ChannelFsm;\n\n _websocket: W3CWebSocket;\n\n _state: Encoded.Transaction | '' = '';\n\n _options: ChannelOptions;\n\n _channelId?: Encoded.Channel;\n\n /**\n * @param options - Channel params\n * @param options.url - Channel url (for example: \"ws://localhost:3001\")\n * @param options.role - Participant role (\"initiator\" or \"responder\")\n * @param options.initiatorId - Initiator's public key\n * @param options.responderId - Responder's public key\n * @param options.pushAmount - Initial deposit in favour of the responder by the initiator\n * @param options.initiatorAmount - Amount of coins the initiator has committed to\n * the channel\n * @param options.responderAmount - Amount of coins the responder has committed to\n * the channel\n * @param options.channelReserve - The minimum amount both peers need to maintain\n * @param options.ttl - Minimum block height to include the channel_create_tx\n * @param options.host - Host of the responder's node\n * @param options.port - The port of the responders node\n * @param options.lockPeriod - Amount of blocks for disputing a solo close\n * @param options.minimumDepthStrategy - How to calculate minimum depth (default: txfee)\n * @param options.minimumDepth - The minimum amount of blocks to be mined\n * @param options.fee - The fee to be used for the channel open transaction\n * @param options.gasPrice - Used for the fee computation of the channel open transaction\n * @param options.existingChannelId - Existing channel id (required if reestablishing a\n * channel)\n * @param options.offchainTx - Offchain transaction (required if reestablishing\n * a channel)\n * @param options.timeoutIdle - The time waiting for a new event to be initiated\n * (default: 600000)\n * @param options.timeoutFundingCreate - The time waiting for the initiator to produce\n * the create channel transaction after the noise session had been established (default: 120000)\n * @param options.timeoutFundingSign - The time frame the other client has to sign an\n * off-chain update after our client had initiated and signed it. This applies only for double\n * signed on-chain intended updates: channel create transaction, deposit, withdrawal and etc.\n * (default: 120000)\n * @param options.timeoutFundingLock - The time frame the other client has to confirm an\n * on-chain transaction reaching maturity (passing minimum depth) after the local node has\n * detected this. This applies only for double signed on-chain intended updates: channel create\n * transaction, deposit, withdrawal and etc. (default: 360000)\n * @param options.timeoutSign - The time frame the client has to return a signed\n * off-chain update or to decline it. This applies for all off-chain updates (default: 500000)\n * @param options.timeoutAccept - The time frame the other client has to react to an\n * event. This applies for all off-chain updates that are not meant to land on-chain, as well as\n * some special cases: opening a noise connection, mutual closing acknowledgement and\n * reestablishing an existing channel (default: 120000)\n * @param options.timeoutInitialized - the time frame the responder has to accept an\n * incoming noise session. Applicable only for initiator (default: timeout_accept's value)\n * @param options.timeoutAwaitingOpen - The time frame the initiator has to start an\n * outgoing noise session to the responder's node. Applicable only for responder (default:\n * timeout_idle's value)\n * @param options.debug=false - Log websocket communication\n * @param options.sign - Function which verifies and signs transactions\n */\n static async initialize(options: ChannelOptions): Promise<Channel> {\n return Channel._initialize(new Channel(), options);\n }\n\n static async _initialize<T extends Channel>(channel: T, options: ChannelOptions): Promise<T> {\n await initialize(\n channel,\n options.existingFsmId != null ? handlers.awaitingReconnection : handlers.awaitingConnection,\n handlers.channelOpen,\n options,\n );\n return channel;\n }\n\n /**\n * Register event listener function\n *\n * Possible events:\n *\n * - \"error\"\n * - \"stateChanged\"\n * - \"statusChanged\"\n * - \"message\"\n * - \"peerDisconnected\"\n * - \"onChainTx\"\n * - \"ownWithdrawLocked\"\n * - \"withdrawLocked\"\n * - \"ownDepositLocked\"\n * - \"depositLocked\"\n * - \"channelReestablished\"\n * - \"newContract\"\n *\n *\n * @param eventName - Event name\n * @param callback - Callback function\n */\n on<E extends keyof ChannelEvents>(eventName: E, callback: ChannelEvents[E]): void {\n this._eventEmitter.on(eventName, callback);\n }\n\n /**\n * Remove event listener function\n * @param eventName - Event name\n * @param callback - Callback function\n */\n off<E extends keyof ChannelEvents>(eventName: E, callback: ChannelEvents[E]): void {\n this._eventEmitter.removeListener(eventName, callback);\n }\n\n /**\n * Close the connection\n */\n disconnect(): void {\n return channelDisconnect(this);\n }\n\n /**\n * Get current status\n */\n status(): ChannelStatus {\n return this._status;\n }\n\n /**\n * Get current state\n */\n async state(): Promise<{\n calls: TxUnpacked & { tag: Tag.CallsMtree };\n halfSignedTx?: TxUnpacked & { tag: Tag.SignedTx };\n signedTx?: TxUnpacked & { tag: Tag.SignedTx };\n trees: TxUnpacked & { tag: Tag.StateTrees };\n }> {\n const res = snakeToPascalObjKeys<{\n calls: Encoded.CallStateTree;\n halfSignedTx: Encoded.Transaction | '';\n signedTx: Encoded.Transaction | '';\n trees: Encoded.StateTrees;\n }>(await call(this, 'channels.get.offchain_state', {}));\n return {\n calls: unpackTx(res.calls, Tag.CallsMtree),\n ...res.halfSignedTx !== '' && { halfSignedTx: unpackTx(res.halfSignedTx, Tag.SignedTx) },\n ...res.signedTx !== '' && { signedTx: unpackTx(res.signedTx, Tag.SignedTx) },\n trees: unpackTx(res.trees, Tag.StateTrees),\n };\n }\n\n /**\n * Get current round\n *\n * If round cannot be determined (for example when channel has not been opened)\n * it will return `null`.\n */\n round(): number | null {\n if (this._state === '') {\n return null;\n }\n const params = unpackTx(this._state, Tag.SignedTx).encodedTx;\n switch (params.tag) {\n case Tag.ChannelCreateTx:\n return 1;\n case Tag.ChannelOffChainTx:\n case Tag.ChannelWithdrawTx:\n case Tag.ChannelDepositTx:\n return params.round;\n default:\n return null;\n }\n }\n\n /**\n * Get channel id\n *\n */\n id(): Encoded.Channel {\n if (this._channelId == null) throw new ChannelError('Channel is not initialized');\n return this._channelId;\n }\n\n /**\n * Get channel's fsm id\n *\n */\n fsmId(): Encoded.Bytearray {\n if (this._fsmId == null) throw new ChannelError('Channel is not initialized');\n return this._fsmId;\n }\n\n protected async enqueueAction(\n action: () => { handler: ChannelHandler; state?: Partial<ChannelState> },\n ): Promise<any> {\n return enqueueAction(\n this,\n (channel, state) => state?.handler === handlers.channelOpen,\n action,\n );\n }\n\n /**\n * Leave channel\n *\n * It is possible to leave a channel and then later reestablish the channel\n * off-chain state and continue operation. When a leave method is called,\n * the channel fsm passes it on to the peer fsm, reports the current mutually\n * signed state and then terminates.\n *\n * The channel can be reestablished by instantiating another Channel instance\n * with two extra params: existingChannelId and offchainTx (returned from leave\n * method as channelId and signedTx respectively).\n *\n * @example\n * ```js\n * channel.leave().then(({ channelId, signedTx }) => {\n * console.log(channelId)\n * console.log(signedTx)\n * })\n * ```\n */\n async leave(): Promise<{ channelId: Encoded.Bytearray; signedTx: Encoded.Transaction }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.leave');\n return { handler: handlers.awaitingLeave };\n });\n }\n\n /**\n * Trigger mutual close\n *\n * At any moment after the channel is opened, a closing procedure can be triggered.\n * This can be done by either of the parties. The process is similar to the off-chain updates.\n *\n * @param sign - Function which verifies and signs mutual close transaction\n * @example\n * ```js\n * channel.shutdown(\n * async (tx) => await account.signTransaction(tx)\n * ).then(tx => console.log('on_chain_tx', tx))\n * ```\n */\n async shutdown(sign: SignTx): Promise<Encoded.Transaction> {\n return this.enqueueAction(() => {\n notify(this, 'channels.shutdown');\n return {\n handler: handlers.awaitingShutdownTx,\n state: { sign },\n };\n });\n }\n\n static async reconnect(options: ChannelOptions, txParams: any): Promise<Channel> {\n const { sign } = options;\n\n return Channel.initialize({\n ...options,\n reconnectTx: await sign(\n 'reconnect',\n buildTx({ ...txParams, tag: Tag.ChannelClientReconnectTx }),\n ),\n });\n }\n}\n","import BigNumber from 'bignumber.js';\nimport {\n notify, call, SignTx, ChannelState, ChannelMessage, ChannelFsm, changeState,\n} from './internal';\nimport { Encoded } from '../utils/encoder';\nimport { pause } from '../utils/other';\nimport Channel from './Base';\nimport { ChannelConnectionError } from '../utils/errors';\nimport {\n awaitingCompletion, channelOpen, handleUnexpectedMessage, signAndNotify,\n} from './handlers';\nimport { unpackTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\nimport { TxUnpacked } from '../tx/builder/schema.generated';\n\nexport default class ChannelSpend extends Channel {\n /**\n * Trigger a transfer update\n *\n * The transfer update is moving coins from one channel account to another.\n * The update is a change to be applied on top of the latest state.\n *\n * Sender and receiver are the channel parties. Both the initiator and responder\n * can take those roles. Any public key outside the channel is considered invalid.\n *\n * @param from - Sender's public address\n * @param to - Receiver's public address\n * @param amount - Transaction amount\n * @param sign - Function which verifies and signs offchain transaction\n * @param metadata - Metadata\n\n * @example\n * ```js\n * channel.update(\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E',\n * 10,\n * async (tx) => await account.signTransaction(tx)\n * ).then(({ accepted, signedTx }) =>\n * if (accepted) {\n * console.log('Update has been accepted')\n * }\n * )\n * ```\n */\n async update(\n from: Encoded.AccountAddress,\n to: Encoded.AccountAddress,\n amount: number | BigNumber,\n sign: SignTx,\n metadata: string[] = [],\n ): Promise<{\n accepted: boolean;\n signedTx?: Encoded.Transaction;\n errorCode?: number;\n errorMessage?: string;\n }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.update.new', {\n from, to, amount, meta: metadata,\n });\n\n const awaitingOffChainTx = async (\n _: Channel,\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> => {\n if (message.method === 'channels.sign.update') {\n const isError = await signAndNotify(\n this,\n 'channels.update',\n message.params.data,\n async (tx) => sign(tx, { updates: message.params.data.updates }),\n );\n if (isError) return { handler: awaitingOffChainTx, state };\n return {\n handler: (_2: Channel, message2: ChannelMessage): ChannelFsm => (\n awaitingCompletion(this, message2, state, () => {\n changeState(this, message2.params.data.state);\n state.resolve({ accepted: true, signedTx: message2.params.data.state });\n return { handler: channelOpen };\n })\n ),\n state,\n };\n }\n if (message.method === 'channels.error') {\n state.reject(new ChannelConnectionError(message.data.message));\n return { handler: channelOpen };\n }\n return awaitingCompletion(this, message, state);\n };\n\n return { handler: awaitingOffChainTx };\n });\n }\n\n /**\n * Get proof of inclusion\n *\n * If a certain address of an account or a contract is not found\n * in the state tree - the response is an error.\n *\n * @param addresses - Addresses\n * @param addresses.accounts - List of account addresses to include in poi\n * @param addresses.contracts - List of contract addresses to include in poi\n * @example\n * ```js\n * channel.poi({\n * accounts: [\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E'\n * ],\n * contracts: ['ct_2dCUAWYZdrWfACz3a2faJeKVTVrfDYxCQHCqAt5zM15f3u2UfA']\n * }).then(poi => console.log(poi))\n * ```\n */\n async poi(\n { accounts, contracts }: {\n accounts: Encoded.AccountAddress[];\n contracts?: Encoded.ContractAddress[];\n },\n ): Promise<TxUnpacked & { tag: Tag.TreesPoi }> {\n return unpackTx(\n (await call(this, 'channels.get.poi', { accounts, contracts })).poi,\n Tag.TreesPoi,\n );\n }\n\n /**\n * Get balances\n *\n * The accounts param contains a list of addresses to fetch balances of.\n * Those can be either account balances or a contract ones, encoded as an account addresses.\n *\n * If a certain account address had not being found in the state tree - it is simply\n * skipped in the response.\n *\n * @param accounts - List of addresses to fetch balances from\n * @example\n * ```js\n * channel.balances([\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E'\n * 'ct_2dCUAWYZdrWfACz3a2faJeKVTVrfDYxCQHCqAt5zM15f3u2UfA'\n * ]).then(balances =>\n * console.log(balances['ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH'])\n * )\n * ```\n */\n async balances(\n accounts: Encoded.AccountAddress[],\n ): Promise<{ [key: Encoded.AccountAddress]: string }> {\n return Object.fromEntries(\n (await call(this, 'channels.get.balances', { accounts }))\n .map((item: {\n account: Encoded.AccountAddress;\n balance: string;\n }) => [item.account, item.balance]),\n );\n }\n\n private async awaitingActionTx(\n action: 'deposit' | 'withdraw',\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> {\n if (message.method !== `channels.sign.${action}_tx`) {\n return handleUnexpectedMessage(this, message, state);\n }\n\n const awaitingActionCompletion = (_: Channel, message2: ChannelMessage): ChannelFsm => {\n if (message2.method === 'channels.on_chain_tx') {\n state.onOnChainTx?.(message2.params.data.tx);\n return { handler: awaitingActionCompletion, state };\n }\n if (\n message2.method === 'channels.info'\n && [`own_${action}_locked`, `${action}_locked`].includes(message2.params.data.event)\n ) {\n const Action = action === 'deposit' ? 'Deposit' : 'Withdraw';\n const isOwn: boolean = message2.params.data.event.startsWith('own_');\n state[`on${isOwn ? 'Own' : ''}${Action}Locked`]?.();\n return { handler: awaitingActionCompletion, state };\n }\n return awaitingCompletion(this, message2, state, () => {\n changeState(this, message2.params.data.state);\n state.resolve({ accepted: true, signedTx: message2.params.data.state });\n return { handler: channelOpen };\n });\n };\n\n const { sign } = state;\n await signAndNotify(\n this,\n `channels.${action}_tx`,\n message.params.data,\n async (tx) => sign(tx, { updates: message.params.data.updates }),\n );\n return { handler: awaitingActionCompletion, state };\n }\n\n /**\n * Withdraw coins from the channel\n *\n * After the channel had been opened any of the participants can initiate a withdrawal.\n * The process closely resembles the update. The most notable difference is that the\n * transaction has been co-signed: it is channel_withdraw_tx and after the procedure\n * is finished - it is being posted on-chain.\n *\n * Any of the participants can initiate a withdrawal. The only requirements are:\n *\n * - Channel is already opened\n * - No off-chain update/deposit/withdrawal is currently being performed\n * - Channel is not being closed or in a solo closing state\n * - The withdrawal amount must be equal to or greater than zero, and cannot exceed\n * the available balance on the channel (minus the channel_reserve)\n *\n * After the other party had signed the withdraw transaction, the transaction is posted\n * on-chain and onOnChainTx callback is called with on-chain transaction as first argument.\n * After computing transaction hash it can be tracked on the chain: entering the mempool,\n * block inclusion and a number of confirmations.\n *\n * After the minimum_depth block confirmations onOwnWithdrawLocked callback is called\n * (without any arguments).\n *\n * When the other party had confirmed that the block height needed is reached\n * onWithdrawLocked callback is called (without any arguments).\n *\n * @param amount - Amount of coins to withdraw\n * @param sign - Function which verifies and signs withdraw transaction\n * @param callbacks - Callbacks\n * @param callbacks.onOnChainTx - Called when withdraw transaction has been posted\n * on chain\n * @param callbacks.onOwnWithdrawLocked\n * @param callbacks.onWithdrawLocked\n * @example\n * ```js\n * channel.withdraw(\n * 100,\n * async (tx) => await account.signTransaction(tx),\n * { onOnChainTx: (tx) => console.log('on_chain_tx', tx) }\n * ).then(({ accepted, signedTx }) => {\n * if (accepted) {\n * console.log('Withdrawal has been accepted')\n * } else {\n * console.log('Withdrawal has been rejected')\n * }\n * })\n * ```\n */\n async withdraw(\n amount: number | BigNumber,\n sign: SignTx,\n { onOnChainTx, onOwnWithdrawLocked, onWithdrawLocked }:\n Pick<ChannelState, 'onOnChainTx' | 'onOwnWithdrawLocked' | 'onWithdrawLocked'> = {},\n ): Promise<{ accepted: boolean; signedTx: Encoded.Transaction }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.withdraw', { amount });\n return {\n handler: async (\n _: Channel,\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> => (\n this.awaitingActionTx('withdraw', message, state)\n ),\n state: {\n sign,\n onOnChainTx,\n onOwnWithdrawLocked,\n onWithdrawLocked,\n },\n };\n });\n }\n\n /**\n * Deposit coins into the channel\n *\n * After the channel had been opened any of the participants can initiate a deposit.\n * The process closely resembles the update. The most notable difference is that the\n * transaction has been co-signed: it is channel_deposit_tx and after the procedure\n * is finished - it is being posted on-chain.\n *\n * Any of the participants can initiate a deposit. The only requirements are:\n *\n * - Channel is already opened\n * - No off-chain update/deposit/withdrawal is currently being performed\n * - Channel is not being closed or in a solo closing state\n * - The deposit amount must be equal to or greater than zero, and cannot exceed\n * the available balance on the channel (minus the channel_reserve)\n *\n * After the other party had signed the deposit transaction, the transaction is posted\n * on-chain and onOnChainTx callback is called with on-chain transaction as first argument.\n * After computing transaction hash it can be tracked on the chain: entering the mempool,\n * block inclusion and a number of confirmations.\n *\n * After the minimum_depth block confirmations onOwnDepositLocked callback is called\n * (without any arguments).\n *\n * When the other party had confirmed that the block height needed is reached\n * onDepositLocked callback is called (without any arguments).\n *\n * @param amount - Amount of coins to deposit\n * @param sign - Function which verifies and signs deposit transaction\n * @param callbacks - Callbacks\n * @param callbacks.onOnChainTx - Called when deposit transaction has been posted\n * on chain\n * @param callbacks.onOwnDepositLocked\n * @param callbacks.onDepositLocked\n * @example\n * ```js\n * channel.deposit(\n * 100,\n * async (tx) => await account.signTransaction(tx),\n * { onOnChainTx: (tx) => console.log('on_chain_tx', tx) }\n * ).then(({ accepted, state }) => {\n * if (accepted) {\n * console.log('Deposit has been accepted')\n * console.log('The new state is:', state)\n * } else {\n * console.log('Deposit has been rejected')\n * }\n * })\n * ```\n */\n async deposit(\n amount: number | BigNumber,\n sign: SignTx,\n { onOnChainTx, onOwnDepositLocked, onDepositLocked }:\n Pick<ChannelState, 'onOnChainTx' | 'onOwnDepositLocked' | 'onDepositLocked'> = {},\n ): Promise<{ accepted: boolean; state: ChannelState }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.deposit', { amount });\n return {\n handler: async (\n _: Channel,\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> => (\n this.awaitingActionTx('deposit', message, state)\n ),\n state: {\n sign,\n onOnChainTx,\n onOwnDepositLocked,\n onDepositLocked,\n },\n };\n });\n }\n\n /**\n * Send generic message\n *\n * If message is an object it will be serialized into JSON string\n * before sending.\n *\n * If there is ongoing update that has not yet been finished the message\n * will be sent after that update is finalized.\n *\n * @param message - Message\n * @param recipient - Address of the recipient\n * @example\n * ```js\n * channel.sendMessage(\n * 'hello world',\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH'\n * )\n * ```\n */\n async sendMessage(\n message: string | object,\n recipient: Encoded.AccountAddress,\n ): Promise<void> {\n const info = typeof message === 'object' ? JSON.stringify(message) : message;\n if (this.status() === 'connecting') {\n await new Promise<void>((resolve) => {\n const onStatusChanged = (status: string): void => {\n if (status === 'connecting') return;\n resolve();\n this.off('statusChanged', onStatusChanged);\n };\n this.on('statusChanged', onStatusChanged);\n });\n // For some reason we can't immediately send a message when connection is\n // established. Thus we wait 500ms which seems to work.\n await pause(500);\n }\n notify(this, 'channels.message', { info, to: recipient });\n }\n}\n","import BigNumber from 'bignumber.js';\nimport { snakeToPascal } from '../utils/string';\nimport {\n MIN_GAS_PRICE, Tag, AbiVersion, VmVersion,\n} from '../tx/builder/constants';\nimport {\n signAndNotify,\n awaitingCompletion,\n channelClosed,\n channelOpen,\n handleUnexpectedMessage,\n} from './handlers';\nimport {\n notify, call, SignTx, ChannelState, ChannelOptions, ChannelMessage, ChannelFsm, changeState, emit,\n} from './internal';\nimport { Encoded } from '../utils/encoder';\nimport { ContractCallReturnType } from '../apis/node';\nimport { ContractCallObject } from '../contract/Contract';\nimport Channel from './Base';\nimport ChannelSpend from './Spend';\nimport { ChannelError, UnexpectedChannelMessageError } from '../utils/errors';\nimport { unpackTx } from '../tx/builder';\nimport { encodeContractAddress } from '../utils/crypto';\n\nfunction snakeToPascalObjKeys<Type>(obj: object): Type {\n return Object.entries(obj).reduce((result, [key, val]) => ({\n ...result,\n [snakeToPascal(key)]: val,\n }), {}) as Type;\n}\n\ninterface CallContractOptions {\n amount?: number | BigNumber;\n callData?: Encoded.ContractBytearray;\n abiVersion?: AbiVersion;\n contract?: Encoded.ContractAddress;\n returnValue?: any;\n gasUsed?: number | BigNumber;\n gasPrice?: number | BigNumber;\n height?: number;\n callerNonce?: number;\n log?: any;\n returnType?: ContractCallReturnType;\n}\n\ninterface Contract {\n abiVersion: AbiVersion;\n active: boolean;\n deposit: number | BigNumber;\n id: string;\n ownerId: string;\n referrerIds: string[];\n vmVersion: VmVersion;\n}\n\nexport default class ChannelContract extends ChannelSpend {\n static override async initialize(options: ChannelOptions): Promise<ChannelContract> {\n return Channel._initialize(new ChannelContract(), options);\n }\n\n /**\n * Trigger create contract update\n *\n * The create contract update is creating a contract inside the channel's internal state tree.\n * The update is a change to be applied on top of the latest state.\n *\n * That would create a contract with the poster being the owner of it. Poster commits initially\n * a deposit amount of coins to the new contract.\n *\n * @param options - Options\n * @param options.code - Api encoded compiled AEVM byte code\n * @param options.callData - Api encoded compiled AEVM call data for the code\n * @param options.deposit - Initial amount the owner of the contract commits to it\n * @param options.vmVersion - Version of the Virtual Machine\n * @param options.abiVersion - Version of the Application Binary Interface\n * @param sign - Function which verifies and signs create contract transaction\n * @example\n * ```js\n * channel.createContract({\n * code: 'cb_HKtpipK4aCgYb17wZ...',\n * callData: 'cb_1111111111111111...',\n * deposit: 10,\n * vmVersion: 3,\n * abiVersion: 1\n * }).then(({ accepted, signedTx, address }) => {\n * if (accepted) {\n * console.log('New contract has been created')\n * console.log('Contract address:', address)\n * } else {\n * console.log('New contract has been rejected')\n * }\n * })\n * ```\n */\n async createContract(\n {\n code, callData, deposit, vmVersion, abiVersion,\n }: {\n code: Encoded.ContractBytearray;\n callData: Encoded.ContractBytearray;\n deposit: number | BigNumber;\n vmVersion: VmVersion;\n abiVersion: AbiVersion;\n },\n sign: SignTx,\n ): Promise<{\n accepted: boolean; signedTx: Encoded.Transaction; address: Encoded.ContractAddress;\n }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.update.new_contract', {\n code,\n call_data: callData,\n deposit,\n vm_version: vmVersion,\n abi_version: abiVersion,\n });\n return {\n handler: async (\n _: Channel,\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> => {\n if (message.method !== 'channels.sign.update') {\n return handleUnexpectedMessage(this, message, state);\n }\n await signAndNotify(\n this,\n 'channels.update',\n message.params.data,\n async (tx) => state.sign(tx),\n );\n return {\n handler: (\n _2: Channel,\n message2: ChannelMessage,\n state2: ChannelState,\n ): ChannelFsm => (\n awaitingCompletion(this, message2, state2, () => {\n const params = unpackTx(message2.params.data.state, Tag.SignedTx).encodedTx;\n if (params.tag !== Tag.ChannelOffChainTx) {\n throw new ChannelError(`Tag should be ${Tag[Tag.ChannelOffChainTx]}, got ${Tag[params.tag]} instead`);\n }\n const addressKey = this._options.role === 'initiator'\n ? 'initiatorId' : 'responderId';\n const owner = this._options[addressKey];\n changeState(this, message2.params.data.state);\n const address = encodeContractAddress(owner, params.round);\n emit(this, 'newContract', address);\n state2.resolve({ accepted: true, address, signedTx: message2.params.data.state });\n return { handler: channelOpen };\n })\n ),\n state,\n };\n },\n state: { sign },\n };\n });\n }\n\n /**\n * Trigger call a contract update\n *\n * The call contract update is calling a preexisting contract inside the channel's\n * internal state tree. The update is a change to be applied on top of the latest state.\n *\n * That would call a contract with the poster being the caller of it. Poster commits\n * an amount of coins to the contract.\n *\n * The call would also create a call object inside the channel state tree. It contains\n * the result of the contract call.\n *\n * It is worth mentioning that the gas is not consumed, because this is an off-chain\n * contract call. It would be consumed if it were an on-chain one. This could happen\n * if a call with a similar computation amount is to be forced on-chain.\n *\n * @param options - Options\n * @param options.amount - Amount the caller of the contract commits to it\n * @param options.callData - ABI encoded compiled AEVM call data for the code\n * @param options.contract - Address of the contract to call\n * @param options.abiVersion - Version of the ABI\n * @param sign - Function which verifies and signs contract call transaction\n * @example\n * ```js\n * channel.callContract({\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * callData: 'cb_1111111111111111...',\n * amount: 0,\n * abiVersion: 1\n * }).then(({ accepted, signedTx }) => {\n * if (accepted) {\n * console.log('Contract called succesfully')\n * } else {\n * console.log('Contract call has been rejected')\n * }\n * })\n * ```\n */\n async callContract(\n {\n amount, callData, contract, abiVersion,\n }: CallContractOptions,\n sign: SignTx,\n ): Promise<{ accepted: boolean; signedTx: Encoded.Transaction }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.update.call_contract', {\n amount,\n call_data: callData,\n contract_id: contract,\n abi_version: abiVersion,\n });\n return {\n handler: async (\n _: Channel,\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> => {\n if (message.method !== 'channels.sign.update') {\n return handleUnexpectedMessage(this, message, state);\n }\n await signAndNotify(\n this,\n 'channels.update',\n message.params.data,\n async (tx) => state.sign(tx, { updates: message.params.data.updates }),\n );\n return {\n handler: (\n _2: Channel,\n message2: ChannelMessage,\n state2: ChannelState,\n ): ChannelFsm => (\n awaitingCompletion(this, message2, state2, () => {\n changeState(this, message2.params.data.state);\n state2.resolve({ accepted: true, signedTx: message2.params.data.state });\n return { handler: channelOpen };\n })\n ),\n state,\n };\n },\n state: { sign },\n };\n });\n }\n\n /**\n * Trigger a force progress contract call\n * This call is going on-chain\n * @param options - Options\n * @param options.amount - Amount the caller of the contract commits to it\n * @param options.callData - ABI encoded compiled AEVM call data for the code\n * @param options.contract - Address of the contract to call\n * @param options.abiVersion - Version of the ABI\n * @param options.gasPrice=1000000000]\n * @param options.gasLimit=1000000]\n * @param sign - Function which verifies and signs contract force progress transaction\n * @param callbacks - Callbacks\n * @example\n * ```js\n * channel.forceProgress({\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * callData: 'cb_1111111111111111...',\n * amount: 0,\n * abiVersion: 1,\n * gasPrice: 1000005554\n * }).then(({ accepted, signedTx }) => {\n * if (accepted) {\n * console.log('Contract force progress call successful')\n * } else {\n * console.log('Contract force progress call has been rejected')\n * }\n * })\n * ```\n */\n async forceProgress(\n {\n amount, callData, contract, abiVersion, gasLimit = 1000000, gasPrice = MIN_GAS_PRICE,\n }: {\n amount: number;\n callData: Encoded.ContractBytearray;\n contract: Encoded.ContractAddress;\n abiVersion: AbiVersion;\n gasLimit?: number;\n gasPrice?: number;\n },\n sign: SignTx,\n { onOnChainTx }: Pick<ChannelState, 'onOnChainTx'> = {},\n ): Promise<{\n accepted: boolean;\n signedTx: Encoded.Transaction;\n tx: Encoded.Transaction | Uint8Array;\n }> {\n return this.enqueueAction(() => {\n notify(this, 'channels.force_progress', {\n amount,\n call_data: callData,\n contract_id: contract,\n abi_version: abiVersion,\n gas_price: gasPrice,\n gas: gasLimit,\n });\n return {\n handler: async (\n _: Channel,\n message: ChannelMessage,\n state: ChannelState,\n ): Promise<ChannelFsm> => {\n if (message.method !== 'channels.sign.force_progress_tx') {\n return handleUnexpectedMessage(this, message, state);\n }\n await signAndNotify(\n this,\n 'channels.force_progress_sign',\n message.params.data,\n async (tx) => state.sign(tx, { updates: message.params.data.updates }),\n );\n return {\n handler: (\n _2: Channel,\n message2: ChannelMessage,\n state2: ChannelState,\n ): ChannelFsm => {\n if (message2.method === 'channels.on_chain_tx') {\n state2.onOnChainTx?.(message2.params.data.tx);\n emit(this, 'onChainTx', message2.params.data.tx, {\n info: message2.params.data.info,\n type: message2.params.data.type,\n });\n state2.resolve({ accepted: true, tx: message2.params.data.tx });\n // TODO: shouldn't be unexpected message in this case\n }\n return handleUnexpectedMessage(this, message2, state2);\n },\n state,\n };\n },\n state: { sign, onOnChainTx },\n };\n });\n }\n\n /**\n * Call contract using dry-run\n *\n * In order to get the result of a potential contract call, one might need to\n * dry-run a contract call. It takes the exact same arguments as a call would\n * and returns the call object.\n *\n * The call is executed in the channel's state, but it does not impact the state\n * whatsoever. It uses as an environment the latest channel's state and the current\n * top of the blockchain as seen by the node.\n *\n * @param options - Options\n * @param options.amount - Amount the caller of the contract commits to it\n * @param options.callData - ABI encoded compiled AEVM call data for the code\n * @param options.contract - Address of the contract to call\n * @param options.abiVersion - Version of the ABI\n * @example\n * ```js\n * channel.callContractStatic({\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * callData: 'cb_1111111111111111...',\n * amount: 0,\n * abiVersion: 1\n * }).then(({ returnValue, gasUsed }) => {\n * console.log('Returned value:', returnValue)\n * console.log('Gas used:', gasUsed)\n * })\n * ```\n */\n async callContractStatic(\n {\n amount, callData, contract, abiVersion,\n }: {\n amount: number;\n callData: Encoded.ContractBytearray;\n contract: Encoded.ContractAddress;\n abiVersion: AbiVersion;\n },\n ): Promise<CallContractOptions> {\n return snakeToPascalObjKeys(await call(this, 'channels.dry_run.call_contract', {\n amount,\n call_data: callData,\n contract_id: contract,\n abi_version: abiVersion,\n }));\n }\n\n /**\n * Get contract call result\n *\n * The combination of a caller, contract and a round of execution determines the\n * contract call. Providing an incorrect set of those results in an error response.\n *\n * @param options - Options\n * @param options.caller - Address of contract caller\n * @param options.contract - Address of the contract\n * @param options.round - Round when contract was called\n * @example\n * ```js\n * channel.getContractCall({\n * caller: 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * round: 3\n * }).then(({ returnType, returnValue }) => {\n * if (returnType === 'ok') console.log(returnValue)\n * })\n * ```\n */\n async getContractCall(\n { caller, contract, round }: {\n caller: Encoded.AccountAddress;\n contract: Encoded.ContractAddress;\n round: number;\n },\n ): Promise<ContractCallObject> {\n return snakeToPascalObjKeys(\n await call(this, 'channels.get.contract_call', {\n caller_id: caller,\n contract_id: contract,\n round,\n }),\n );\n }\n\n /**\n * Get the latest contract state\n *\n * @param contract - Address of the contract\n * @example\n * ```js\n * channel.getContractState(\n * 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa'\n * ).then(({ contract }) => {\n * console.log('deposit:', contract.deposit)\n * })\n * ```\n */\n async getContractState(\n contract: Encoded.ContractAddress,\n ): Promise<{ contract: Contract; contractState: object }> {\n const result = await call(this, 'channels.get.contract', { pubkey: contract });\n return snakeToPascalObjKeys({\n ...result,\n contract: snakeToPascalObjKeys(result.contract),\n });\n }\n\n /**\n * Clean up all locally stored contract calls\n *\n * Contract calls are kept locally in order for the participant to be able to look them up.\n * They consume memory and in order for the participant to free it - one can prune all messages.\n * This cleans up all locally stored contract calls and those will no longer be available for\n * fetching and inspection.\n */\n async cleanContractCalls(): Promise<void> {\n return this.enqueueAction(() => {\n notify(this, 'channels.clean_contract_calls');\n return {\n handler(_: Channel, message: ChannelMessage, state: ChannelState): ChannelFsm {\n if (message.method === 'channels.calls_pruned.reply') {\n state.resolve();\n return { handler: channelOpen };\n }\n state.reject(new UnexpectedChannelMessageError('Unexpected message received'));\n return { handler: channelClosed };\n },\n };\n });\n }\n}\n","import BrowserConnection from './connection/Browser';\n\n/**\n * Browser connection proxy\n * Provide functionality to easily forward messages from one connection to another and back\n * @category aepp wallet communication\n * @param con1 - first connection\n * @param con2 - second connection\n * @returns a function to stop proxying\n */\nexport default (con1: BrowserConnection, con2: BrowserConnection): () => void => {\n con1.connect((msg: any) => con2.sendMessage(msg), () => con2.disconnect());\n con2.connect((msg: any) => con1.sendMessage(msg), () => con1.disconnect());\n\n return () => {\n con1.disconnect();\n con2.disconnect();\n };\n};\n","import { AlreadyConnectedError, NoWalletConnectedError } from '../../utils/errors';\n\n/**\n * Browser connection base interface\n * @category aepp wallet communication\n */\nexport default abstract class BrowserConnection {\n debug: boolean;\n\n protected constructor({ debug = false }: { debug?: boolean }) {\n this.debug = debug;\n }\n\n /**\n * Connect\n * @param onMessage - Message handler\n * @param onDisconnect - trigger when runtime connection in closed\n */\n connect(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onMessage: (message: any, origin: string, source: any) => void,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDisconnect: () => void,\n ): void {\n if (this.isConnected()) throw new AlreadyConnectedError('You already connected');\n }\n\n /**\n * Disconnect\n */\n disconnect(): void {\n if (!this.isConnected()) throw new NoWalletConnectedError('You dont have connection. Please connect before');\n }\n\n /**\n * Receive message\n */\n protected receiveMessage(message: any): void {\n if (this.debug) console.log('Receive message:', message);\n }\n\n /**\n * Send message\n */\n sendMessage(message: any): void {\n if (this.debug) console.log('Send message:', message);\n }\n\n /**\n * Check if connected\n * @returns Is connected\n */\n abstract isConnected(): boolean;\n}\n","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","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 if (Object.keys(wallets).length > 0) onDetected({ wallets });\n\n return () => connection.disconnect();\n};\n","import { Runtime } from 'webextension-polyfill';\nimport BrowserConnection from './Browser';\nimport { UnexpectedTsError } from '../../utils/errors';\n\n/**\n * BrowserRuntimeConnection\n * Handle browser runtime communication\n * @category aepp wallet communication\n */\nexport default class BrowserRuntimeConnection extends BrowserConnection {\n port: Runtime.Port;\n\n #listeners?: [(message: any, port: Runtime.Port) => void, () => void];\n\n constructor({ port, ...options }: { port: Runtime.Port; debug: boolean }) {\n super(options);\n this.port = port;\n }\n\n override disconnect(): void {\n super.disconnect();\n this.port.disconnect();\n if (this.#listeners == null) throw new UnexpectedTsError();\n this.port.onMessage.removeListener(this.#listeners[0]);\n this.port.onDisconnect.removeListener(this.#listeners[1]);\n this.#listeners = undefined;\n }\n\n override connect(\n onMessage: (message: any, origin: string, source: Runtime.Port) => void,\n onDisconnect: () => void,\n ): void {\n super.connect(onMessage, onDisconnect);\n this.#listeners = [\n (message, port) => {\n this.receiveMessage(message);\n // TODO: make `origin` optional because sender url is not available on aepp side\n onMessage(message, port.sender?.url ?? '', port);\n },\n onDisconnect,\n ];\n this.port.onMessage.addListener(this.#listeners[0]);\n this.port.onDisconnect.addListener(this.#listeners[1]);\n }\n\n override sendMessage(message: any): void {\n super.sendMessage(message);\n this.port.postMessage(message);\n }\n\n isConnected(): boolean {\n return this.#listeners != null;\n }\n}\n"],"names":["root","factory","exports","module","require","define","amd","self","__WEBPACK_EXTERNAL_MODULE__5039__","__WEBPACK_EXTERNAL_MODULE__9408__","__WEBPACK_EXTERNAL_MODULE__3485__","__WEBPACK_EXTERNAL_MODULE__5192__","__WEBPACK_EXTERNAL_MODULE__3783__","__WEBPACK_EXTERNAL_MODULE__79__","__WEBPACK_EXTERNAL_MODULE__7480__","__WEBPACK_EXTERNAL_MODULE__4711__","__WEBPACK_EXTERNAL_MODULE__3983__","__WEBPACK_EXTERNAL_MODULE__7417__","__WEBPACK_EXTERNAL_MODULE__9882__","__WEBPACK_EXTERNAL_MODULE__1986__","__WEBPACK_EXTERNAL_MODULE__8236__","__WEBPACK_EXTERNAL_MODULE__7946__","__WEBPACK_EXTERNAL_MODULE__2716__","__WEBPACK_EXTERNAL_MODULE__3735__","__WEBPACK_EXTERNAL_MODULE__8079__","util","ADD64AA","v","a","b","o0","o1","ADD64AC","b0","b1","B2B_GET32","arr","i","B2B_G","c","d","ix","iy","x0","m","x1","y0","y1","xor0","xor1","BLAKE2B_IV32","Uint32Array","SIGMA82","Uint8Array","map","x","blake2bCompress","ctx","last","h","t","parameterBlock","blake2bInit","outlen","key","salt","personal","Error","length","fill","set","blake2bUpdate","input","blake2bFinal","out","blake2b","normalizeInput","blake2bHex","output","toHex","uint32ToHex","val","toString","substring","ret","TextEncoder","encode","bytes","Array","prototype","call","n","join","debugPrint","label","size","msg","toUpperCase","console","log","testSpeed","hashFn","N","M","startMs","Date","getTime","genMs","hashHex","hashMs","ms","Math","round","parent","Object","defineProperty","it","desc","sham","path","Symbol","WrappedWellKnownSymbolModule","f","isCallable","tryToString","$TypeError","TypeError","argument","$String","String","isObject","toIndexedObject","toAbsoluteIndex","lengthOfArrayLike","createMethod","IS_INCLUDES","$this","el","fromIndex","value","O","index","includes","indexOf","bind","uncurryThis","IndexedObject","toObject","arraySpeciesCreate","push","TYPE","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","IS_FILTER_REJECT","NO_HOLES","callbackfn","that","specificCreate","result","boundFunction","create","target","undefined","forEach","filter","some","every","find","findIndex","filterReject","fails","wellKnownSymbol","V8_VERSION","SPECIES","METHOD_NAME","array","constructor","foo","Boolean","createProperty","$Array","max","start","end","k","fin","slice","isArray","isConstructor","originalArray","C","arraySpeciesConstructor","stringSlice","TO_STRING_TAG_SUPPORT","classofRaw","TO_STRING_TAG","$Object","CORRECT_ARGUMENTS","arguments","tag","error","tryGet","callee","F","getPrototypeOf","done","DESCRIPTORS","definePropertyModule","createPropertyDescriptor","object","bitmap","enumerable","configurable","writable","toPropertyKey","propertyKey","name","descriptor","createNonEnumerableProperty","options","global","get","documentAll","document","all","IS_HTMLDDA","EXISTS","createElement","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","navigator","userAgent","match","version","process","Deno","versions","v8","split","apply","getOwnPropertyDescriptor","isForced","hasOwn","wrapConstructor","NativeConstructor","Wrapper","this","source","FORCED","USE_NATIVE","VIRTUAL_PROTOTYPE","sourceProperty","targetProperty","nativeProperty","resultProperty","TARGET","GLOBAL","STATIC","stat","PROTO","proto","nativeSource","targetPrototype","forced","dontCallGetSet","wrap","real","exec","NATIVE_BIND","FunctionPrototype","Function","Reflect","aCallable","fn","test","hasOwnProperty","getDescriptor","PROPER","CONFIGURABLE","method","uncurryThisWithBind","aFunction","variable","namespace","classof","replacer","rawLength","keys","element","keysLength","j","isNullOrUndefined","V","P","func","check","globalThis","window","g","getBuiltIn","propertyIsEnumerable","store","functionToString","inspectSource","has","NATIVE_WEAK_MAP","shared","sharedKey","hiddenKeys","OBJECT_ALREADY_INITIALIZED","WeakMap","state","metadata","facade","STATE","enforce","getterFor","type","$documentAll","noop","empty","construct","constructorRegExp","INCORRECT_TO_STRING","isConstructorModern","isConstructorLegacy","called","replacement","feature","detection","data","normalize","POLYFILL","NATIVE","string","replace","toLowerCase","isPrototypeOf","USE_SYMBOL_AS_UID","$Symbol","IteratorPrototype","setToStringTag","Iterators","returnThis","IteratorConstructor","NAME","next","ENUMERABLE_NEXT","$","IS_PURE","FunctionName","createIteratorConstructor","setPrototypeOf","defineBuiltIn","IteratorsCore","PROPER_FUNCTION_NAME","CONFIGURABLE_FUNCTION_NAME","BUGGY_SAFARI_ITERATORS","ITERATOR","KEYS","VALUES","ENTRIES","Iterable","DEFAULT","IS_SET","CurrentIteratorPrototype","methods","KEY","getIterationMethod","KIND","defaultIterator","IterablePrototype","INCORRECT_VALUES_NAME","nativeIterator","anyNativeIterator","entries","values","PrototypeOfArrayIteratorPrototype","arrayIterator","toLength","obj","ceil","floor","trunc","activeXDocument","anObject","definePropertiesModule","enumBugKeys","html","documentCreateElement","PROTOTYPE","SCRIPT","IE_PROTO","EmptyConstructor","scriptTag","content","LT","NullProtoObjectViaActiveX","write","close","temp","parentWindow","NullProtoObject","ActiveXObject","iframeDocument","iframe","JS","domain","style","display","appendChild","src","contentWindow","open","Properties","V8_PROTOTYPE_DEFINE_BUG","objectKeys","defineProperties","props","IE8_DOM_DEFINE","$defineProperty","$getOwnPropertyDescriptor","ENUMERABLE","WRITABLE","Attributes","current","propertyIsEnumerableModule","$getOwnPropertyNames","arraySlice","windowNames","getOwnPropertyNames","getWindowNames","internalObjectKeys","concat","getOwnPropertySymbols","CORRECT_PROTOTYPE_GETTER","ObjectPrototype","names","$propertyIsEnumerable","NASHORN_BUG","uncurryThisAccessor","aPossiblePrototype","setter","CORRECT_SETTER","__proto__","pref","valueOf","TAG","SET_METHOD","uid","defineGlobalProperty","SHARED","mode","copyright","license","toIntegerOrInfinity","requireObjectCoercible","charAt","charCodeAt","CONVERT_TO_STRING","pos","first","second","S","position","codeAt","symbol","SymbolPrototype","TO_PRIMITIVE","hint","arity","NATIVE_SYMBOL","keyFor","min","integer","number","isSymbol","getMethod","ordinaryToPrimitive","exoticToPrim","toPrimitive","id","postfix","random","iterator","wrappedWellKnownSymbolModule","WellKnownSymbolsStore","createWellKnownSymbol","withoutSetter","doesNotExceedSafeInteger","arrayMethodHasSpeciesSupport","IS_CONCAT_SPREADABLE","IS_CONCAT_SPREADABLE_SUPPORT","isConcatSpreadable","spreadable","arg","len","E","A","addToUnscopables","InternalStateModule","defineIterator","createIterResultObject","ARRAY_ITERATOR","setInternalState","getInternalState","iterated","kind","Arguments","getReplacerFunction","$stringify","numberToString","tester","low","hi","WRONG_SYMBOLS_CONVERSION","ILL_FORMED_UNICODE","stringifyWithSymbolsFix","args","$replacer","fixIllFormed","offset","prev","stringify","space","JSON","getOwnPropertySymbolsModule","$getOwnPropertySymbols","STRING_ITERATOR","point","defineWellKnownSymbol","$toString","nativeObjectCreate","getOwnPropertyNamesModule","getOwnPropertyNamesExternal","getOwnPropertyDescriptorModule","defineBuiltInAccessor","defineSymbolToPrimitive","$forEach","HIDDEN","SYMBOL","QObject","nativeGetOwnPropertyDescriptor","nativeDefineProperty","nativeGetOwnPropertyNames","nativePropertyIsEnumerable","AllSymbols","ObjectPrototypeSymbols","USE_SETTER","findChild","setSymbolDescriptor","ObjectPrototypeDescriptor","description","$defineProperties","properties","IS_OBJECT_PROTOTYPE","unsafe","useSetter","useSimple","NATIVE_SYMBOL_REGISTRY","StringToSymbolRegistry","SymbolToStringRegistry","sym","thisSymbolValue","isRegistered","$isWellKnown","isWellKnown","symbolKeys","symbolKeysLength","symbolKey","DOMIterables","COLLECTION_NAME","Collection","CollectionPrototype","ctor","superCtor","super_","TempCtor","buffer","Buffer","copyProps","dst","SafeBuffer","encodingOrOffset","from","alloc","allocUnsafe","allocUnsafeSlow","encoding","buf","SlowBuffer","Hash","blockSize","finalSize","_block","_finalSize","_blockSize","_len","update","enc","block","accum","assigned","remainder","_update","digest","rem","bits","writeUInt32BE","lowBits","highBits","hash","_hash","inherits","K","W","Sha256","init","_w","ch","y","z","maj","sigma0","sigma1","gamma0","_a","_b","_c","_d","_e","_f","_g","_h","e","readInt32BE","T1","T2","H","writeInt32BE","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","prop","r","toStringTag","bigNumber","integerValue","BigNumber","BaseError","message","super","AccountError","AensError","AeppError","ChannelError","CompilerError","ContractError","CryptographyError","NodeError","TransactionError","WalletError","ArgumentError","argumentName","requirement","argumentValue","IllegalArgumentError","ArgumentCountMismatchError","functionName","requiredCount","providedCount","InsufficientBalanceError","MissingParamError","NoSerializerFoundError","RequestTimedOutError","height","TxTimedOutError","blocks","th","UnsupportedPlatformError","UnsupportedProtocolError","NotImplementedError","UnsupportedVersionError","dependency","geVersion","ltVersion","InternalError","UnexpectedTsError","UnavailableAccountError","address","AensPointerContextError","nameOrId","prefix","InsufficientNameFeeError","nameFee","minNameFee","InvalidAensNameError","InvalidRpcMessageError","MissingCallbackError","UnAuthorizedAccountError","onAccount","UnknownRpcClientError","UnsubscribedAccountError","ChannelCallError","ChannelConnectionError","ChannelPingTimedOutError","UnexpectedChannelMessageError","ChannelIncomingMessageError","handlerError","incomingMessage","UnknownChannelStateError","InvalidAuthDataError","BytecodeMismatchError","DuplicateContractError","InactiveContractError","contractAddress","InvalidMethodInvocationError","MissingContractAddressError","MissingContractDefError","MissingFunctionNameError","NodeInvocationError","transaction","NoSuchContractFunctionError","NotPayableFunctionError","amount","MissingEventDefinitionError","eventNameHash","eventAddress","AmbiguousEventDefinitionError","matchedEvents","_ref","InvalidChecksumError","InvalidPasswordError","MerkleTreeHashMismatchError","MissingNodeInTreeError","UnknownNodeLengthError","nodeLength","UnknownPathNibbleError","nibble","DuplicateNodeError","NodeNotFoundError","DecodeError","PayloadLengthError","DryRunError","IllegalBidFeeError","InvalidSignatureError","PrefixNotFoundError","SchemaNotFoundError","TagNotFoundError","TxNotInChainError","txHash","AlreadyConnectedError","NoWalletConnectedError","RpcConnectionError","AE_AMOUNT_FORMATS","DENOMINATION_MAGNITUDE","AE","MILI_AE","MICRO_AE","NANO_AE","PICO_AE","FEMTO_AE","AETTOS","formatAmount","denomination","targetDenomination","isNaN","Number","isInteger","shiftedBy","toFixed","toAe","toAettos","pause","async","Promise","resolve","setTimeout","duration","mapObject","fromEntries","concatBuffers","list","totalLength","isKeyOfObject","isItemOfArray","item","isAccountNotFoundError","RestError","statusCode","Encoding","sha256hash","base64Types","ContractBytearray","ContractStoreKey","ContractStoreValue","Transaction","OracleQuery","OracleResponse","State","Poi","StateTrees","CallStateTree","Bytearray","base58Types","KeyBlockHash","MicroBlockHash","BlockPofHash","BlockTxHash","BlockStateHash","Channel","ContractAddress","TxHash","OracleAddress","OracleQueryId","AccountAddress","Signature","Commitment","PeerPubkey","Name","byteSizeForType","ensureValidLength","reqLen","getChecksum","payload","addChecksum","getPayload","equals","base64","decode","base58","bs58Encode","bs58Decode","parseType","maybeType","base64Type","base58Type","encodedPayload","extra","encoder","getAddressFromPriv","secret","secretBuffer","nacl","publicKey","isAddressValid","genSalt","BigUint64Array","BigInt","MAX_SAFE_INTEGER","encodeUnsigned","binary","encodeContractAddress","owner","nonce","generateKeyPairFromSecret","generateKeyPair","raw","keyPair","publicBuffer","secretKey","sign","privateKey","verify","signature","messageToHash","p","varuintEncode","signMessage","verifyMessage","isValidKeypair","MAX_AUTH_FUN_GAS","NAME_TTL","NAME_MAX_TTL","NAME_MAX_CLIENT_TTL","CLIENT_TTL","MIN_GAS_PRICE","NAME_FEE_MULTIPLIER","NAME_FEE_BID_INCREMENT","NAME_BID_TIMEOUT_BLOCKS","NAME_MAX_LENGTH_FEE","NAME_BID_MAX_LENGTH","NAME_BID_RANGES","times","ConsensusProtocolVersion","VmVersion","AbiVersion","Tag","ProtocolToVmAbi","Iris","vmVersion","Fate2","abiVersion","Fate","Sophia","NoAbi","Ceres","getProtocolDetails","protocolVersion","_protocol$vmVersion$","protocol","serialize","params","_value","consensusProtocolVersion","onNode","getNodeInfo","deserialize","vm","abi","_getProtocolDetails","ContractCallTx","GaMetaTx","_ref2","_ref3","toBytes","big","hexString","idTagToEncoding","genAddressField","encodings","_key","hashId","idTag","readUIntBE","subarray","buildContractId","ownerId","oracleQueryId","senderId","oracleId","nonceBE","_int32","produceNameId","commitmentHash","padStart","readInt","AENS_SUFFIX","isNameValid","endsWith","encodingToPointerKey","getDefaultPointerKey","identifier","getMinimumNameFee","nameLength","computeBidFee","startFee","increment","plus","computeAuctionEndBlock","claimHeight","_ref4","_ref5","isAuctionName","uInt","serializeAettos","coinAmount","parameters","TX_FEE_BASE_GAS","txType","_feeFactors","factor","ChannelForceProgressTx","ChannelOffChainTx","ChannelOffChainUpdateCallContract","ChannelOffChainUpdateCreateContract","ChannelOffChainUpdateDeposit","ChannelOffChainUpdateWithdraw","ChannelOffChainUpdateTransfer","ContractCreateTx","GaAttachTx","PayingForTx","TX_FEE_OTHER_GAS","txSize","relativeTtl","innerTxSize","OracleRegisterTx","OracleExtendTx","OracleQueryTx","OracleResponseTx","minus","getOracleRelativeTtl","ttlKeys","buildFee","builtTx","unpackTx","buildTx","txObject","tx","encodedTx","rebuildTx","_computingMinFee","_pickBiggerFee","minFee","previousFee","fee","eq","calculateMinFee","gt","shortUInt","_computingGasLimit","gasMax","gasLimitMax","dividedBy","calculateGasLimitMax","gasLimit","_classExtractFieldDescriptor","receiver","privateMap","action","_classPrivateFieldSet","_classPrivateFieldGet","NodeType","_rootHash","_isComplete","_nodes","_encoding","_tag","_unpackTx","_getRaw","WeakSet","_entriesRaw","MPTree","isComplete","unpTx","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","node","_classStaticPrivateMethodGet","_nodeHash","_parseNode","Branch","Extension","Leaf","isEqual","tree","mptHash","_classPrivateMethodGet","_getRaw2","_entriesRaw2","rlpEncode","searchFrom","rec","idx","_ref6","_ref7","field","txFields","addressName","addressAny","pointers","pointer","absoluteTtl","getCurrentKeyBlock","_abiVersion","_address","itemHandler","items","buffers","boolean","_boolean","_coinAmount","ctVersion","_ctVersion","deposit","_deposit","encoded","optional","encodedData","entry","txParams","ArrayBuffer","isView","startsWith","enumeration","enm","_fee","_gasLimit","gasPrice","_gasPrice","Mtree","MtreeValue","recursiveType","mptree","_name","_nameFee","nameId","_nameId","senderKey","strategy","getAccountNextNonce","catch","nextNonce","_pointers","_raw","_shortUInt","shortUIntConst","constValue","constValueOptional","_string","ttl","_ttl","_uInt","wrapped","ORACLE_TTL_TYPES","ORACLE_TTL","delta","QUERY_TTL","RESPONSE_TTL","DRY_RUN_ACCOUNT","pub","CallReturnType","entryAny","entrySignedTx","SignedTx","entryMtreeValueArray","entryTreesPoi","TreesPoi","mapContracts","Contract","mapAccounts","Account","mapCalls","ContractCall","mapChannels","mapNames","mapOracles","Oracle","txSchema","balance","flags","gaContract","gaAuthFun","signatures","SpendTx","recipientId","accountId","nameTtl","status","clientTtl","NamePreclaimTx","commitmentId","NameClaimTx","nameSalt","NameUpdateTx","NameTransferTx","NameRevokeTx","code","active","referers","callData","callerId","contractId","callerNonce","gasUsed","returnValue","returnType","queryFormat","responseFormat","queryFee","oracleTtlValue","oracleTtlType","query","queryTtlType","queryTtlValue","responseTtlType","responseTtlValue","queryId","response","ChannelCreateTx","initiator","initiatorAmount","responder","responderAmount","channelReserve","lockPeriod","initiatorDelegateIds","responderDelegateIds","stateHash","ChannelCloseMutualTx","channelId","fromId","initiatorAmountFinal","responderAmountFinal","ChannelCloseSoloTx","poi","ChannelSlashTx","ChannelDepositTx","ChannelWithdrawTx","toId","ChannelSettleTx","offChainTrees","channelAmount","soloRound","lockedUntil","initiatorAuth","responderAuth","ChannelSnapshotSoloTx","to","caller","contract","callStack","ChannelClientReconnectTx","role","pubkey","accounts","calls","channels","contracts","ns","oracles","ContractsMtree","CallsMtree","ChannelsMtree","NameserviceMtree","OraclesMtree","AccountsMtree","authFun","gaId","authData","payerId","GaMetaTxAuthData","getSchema","_version","schemas","s","schema","overrideParams","buildTxAsync","prepare","rlpDecode","reduce","acc","buildTxHash","rawTx","buildContractIdByContractTx","contractTx","semverSatisfies","getComponents","versionComponents","geComponents","ltComponents","base","componentsToNumber","components","reverse","vNumber","geNumber","ltNumber","genRequestQueuesPolicy","requestQueues","Map","policy","request","_requestQueues$get","headers","delete","getResponse","req","then","genCombineGetRequestsPolicy","pendingGetRequests","_pendingGetRequests$g","url","body","genAggressiveCacheGetResponsesPolicy","getRequests","_getRequests$get","genErrorFormatterPolicy","getMessage","bodyAsText","parse","URL","pathname","genVersionCheckPolicy","ignorePath","versionPromise","genRetryOnFailurePolicy","retryCount","retryOverallDelay","statusesToNotRetry","intervals","_","intervalSum","intervalsInMs","attempt","_error$response$statu","Header","className","modelProperties","serializedName","required","prevHash","prevKeyHash","miner","beneficiary","pow","constraints","MinItems","MaxItems","time","info","pofHash","txsHash","ErrorModel","reason","KeyBlock","HashResponse","HeightResponse","MicroBlockHeader","SignedTxs","transactions","blockHeight","blockHash","Tx","uberParent","polymorphicDiscriminator","clientName","initiatorId","responderId","delegateIds","offchainTrees","oracleTtl","queryTtl","responseTtl","gas","Pattern","RegExp","allowedValues","Delegates","OffChainUpdate","op","RelativeTTL","defaultValue","isConstant","Ttl","NamePointer","CountResponse","count","Generation","keyBlock","microBlocks","payable","NextNonceResponse","DryRunInput","top","txs","txEvents","DryRunAccount","pubKey","DryRunInputItem","callReq","DryRunCallReq","calldata","context","DryRunCallContext","stateful","DryRunResults","results","DryRunResult","callObj","ContractCallObject","Event","topics","TxInfoObject","callInfo","gaInfo","txInfo","GAObject","innerObject","EncodedTx","PostTxResponse","ContractObject","referrerIds","ByteCode","bytecode","PoI","RegisteredOracle","OracleQueries","oracleQueries","senderNonce","NameEntry","PeerPubKey","Status","genesisKeyBlockHash","solutions","difficulty","syncing","syncProgress","InclusiveMaximum","InclusiveMinimum","listening","protocols","nodeVersion","nodeRevision","peerCount","peerConnections","pendingTransactionsCount","networkId","peerPubkey","topKeyBlockHash","topBlockHeight","Protocol","effectiveAtHeight","PeerConnections","inbound","outbound","OracleRespondTx","CommitmentId","NameHash","ChannelSetDelegatesTx","PubKey","PeerDetails","host","port","firstSeen","lastSeen","genesisHash","topHash","topDifficulty","nodeVendor","nodeOs","Peers","peers","blocked","PeerCount","connected","available","PeerCountConnected","PeerCountAvailable","verified","unverified","UnsignedTx","TokenSupply","contractOracles","locked","pendingRewards","total","GAAttachTx","GAMetaTx","CheckTxInPoolResponse","OffChainTransfer","OffChainWithdrawal","OffChainDeposit","OffChainNewContract","OffChainCallContract","CreateContractUnsignedTx","discriminators","accept","parameterPath","mapper","$host","skipEncoding","intAsString","contentType","DryRunInputMapper","body1","EncodedTxMapper","Node","coreClient","_options$endpoint","packageDetails","userAgentPrefix","userAgentOptions","requestContentType","endpoint","baseUri","getTopHeader","sendOperationRequest","getTopHeaderOperationSpec","getCurrentKeyBlockOperationSpec","getCurrentKeyBlockHash","getCurrentKeyBlockHashOperationSpec","getCurrentKeyBlockHeight","getCurrentKeyBlockHeightOperationSpec","getPendingKeyBlock","getPendingKeyBlockOperationSpec","getKeyBlockByHash","getKeyBlockByHashOperationSpec","getKeyBlockByHeight","getKeyBlockByHeightOperationSpec","getMicroBlockHeaderByHash","getMicroBlockHeaderByHashOperationSpec","getMicroBlockTransactionsByHash","getMicroBlockTransactionsByHashOperationSpec","getMicroBlockTransactionByHashAndIndex","getMicroBlockTransactionByHashAndIndexOperationSpec","getMicroBlockTransactionsCountByHash","getMicroBlockTransactionsCountByHashOperationSpec","getCurrentGeneration","getCurrentGenerationOperationSpec","getGenerationByHash","getGenerationByHashOperationSpec","getGenerationByHeight","getGenerationByHeightOperationSpec","getAccountByPubkey","getAccountByPubkeyOperationSpec","getAccountByPubkeyAndHeight","getAccountByPubkeyAndHeightOperationSpec","getAccountByPubkeyAndHash","getAccountByPubkeyAndHashOperationSpec","getPendingAccountTransactionsByPubkey","getPendingAccountTransactionsByPubkeyOperationSpec","getAccountNextNonceOperationSpec","protectedDryRunTxs","protectedDryRunTxsOperationSpec","getTransactionByHash","getTransactionByHashOperationSpec","getTransactionInfoByHash","getTransactionInfoByHashOperationSpec","postTransaction","postTransactionOperationSpec","getContract","getContractOperationSpec","getContractCode","getContractCodeOperationSpec","getContractPoI","getContractPoIOperationSpec","getOracleByPubkey","getOracleByPubkeyOperationSpec","getOracleQueriesByPubkey","getOracleQueriesByPubkeyOperationSpec","getOracleQueryByPubkeyAndQueryId","getOracleQueryByPubkeyAndQueryIdOperationSpec","getNameEntryByName","getNameEntryByNameOperationSpec","getChannelByPubkey","getChannelByPubkeyOperationSpec","getPeerPubkey","getPeerPubkeyOperationSpec","getStatus","getStatusOperationSpec","getChainEnds","getChainEndsOperationSpec","serializer","Mappers","httpMethod","responses","bodyMapper","isError","queryParameters","Parameters","urlParameters","headerParameters","requestBody","mediaType","bigIntPropertyNames","numberPropertyNames","_mapData","_encodeArg","_decodeRes","NodeTransformed","NodeApi","operationArguments","operationSpec","_encodeArg2","_decodeRes2","_mapData2","transform","bigInt","_networkIdPromise","ignoreVersion","allowInsecureConnection","additionalPolicies","statusPromise","pipeline","addPolicy","_classPrivateFieldGet2","nodeNetworkId","getTransactionSignerAddress","AccountBase","secretKeys","getBufferToSign","innerTx","prefixes","rlpBinaryTx","AccountMemory","static","txWithNetworkId","getExecutionCost","isInitiator","res","getExecutionCostBySignedTx","isInnerTx","isNotInnerTx","getExecutionCostUsingNode","isMined","isSignedTx","combinedInfo","getNetworkId","validators","verifyTransactionInternal","parentTxTypes","account","flat","verifyTransaction","nodeNotCached","clone","_getPollInterval","_expectedMineRate","_microBlockCycle","_maxPollInterval","microblock","txBinary","txHashWithNetworkId","checkedKeys","nestedTx","cost","_ref8","oracleCall","contractCreate","contractCall","_ref9","parsedBody","InvalidTxError","validation","getHeight","poll","_interval","interval","awaitHeight","_interval2","currentHeight","waitForTxConfirm","confirm","newBlockHeight","sendTransaction","txUnsigned","waitMined","signTransaction","__queue","requestOptions","customHeaders","pollResult","txData","confirmationHeight","assign","verifyTx","getAccount","getBalance","format","addr","getGeneration","hashOrHeight","_ref10","getMicroBlockTransactions","_ref11","getKeyBlock","_ref12","getMicroBlockHeader","_ref13","txDryRunRequests","txDryRunHandler","rs","dryRunRes","Set","accountAddress","_ref14","reject","_ref15","resultPayload","txDryRun","_ref16","_txDryRunRequests$get","combine","requests","_requests$timeout","timeout","getContractByteCode","_ref17","_ref18","getName","_ref19","resolveName","_ref20","resolveByNode","DERIVED_KEY_FUNCTIONS","pass","memlimit_kib","memoryCost","opslimit","timeCost","hashLength","argon2id","CRYPTO_FUNCTIONS","encrypt","decrypt","CRYPTO_DEFAULTS","secret_type","symmetric_alg","kdf","kdf_params","parallelism","plaintext","algo","deriveKey","password","kdfParams","recover","crypto","ciphertext","cipher_params","dump","opt","derivedKey","public_key","uuid","Ecb","aesjs","encryptKey","binaryData","hashedPasswordBytes","decryptKey","encrypted","encryptedBytes","DerivationError","ED25519_CURVE","HARDENED_OFFSET","deriveChild","chainCode","indexBuffer","I","hmac","derivePathFromKey","segments","fromString","toPathArray","segment","parentKey","getMasterKeyFromSeed","seed","derivePathFromSeed","masterKey","formatAccount","getKeyPair","generateSaveHDWalletFromSeed","walletKey","getSaveHDWalletAccounts","saveHDWallet","accountCount","getHdWalletAccountFromSeed","accountIdx","aensRevoke","aensUpdate","extendPointers","allPointers","aensTransfer","aensQuery","nameEntry","freeze","aensClaim","claimTx","nameInter","aensPreclaim","preclaimTx","opts","otherOptions","aensBid","_getCallResult","_sendAndProcess","_getFunctionAci","_getContractNameByEvent","_aciContract","_getCallResult2","fnName","fnAci","_getFunctionAci2","decodedResult","_calldata","decodedEvents","$decodeEvents","decodeFateString","_sendAndProcess2","$options","$getCallResultByTxHash","functions","returns","_getContractNameByEvent2","ctAddress","nameHash","contractAddressToName","addressToName","_aci","event","variant","events","eventName","calcHash","ContractWithMethods","sourceCode","onCompiler","compileBySourceCode","fileSystem","callInfoTyped","$call","callStatic","_opt$gasLimit","$compile","_estimateGas","other","_opt$gasLimit2","topKey","txOpt","dryRunOther","omitUnknown","contractName","decoded","decodeEvent","aci","sourceCodePath","validateBytecode","_bytecode","compile","onChanBytecode","isValid","validateBySourceCode","_this","aciLast","Calldata","aciArgs","pop","$deploy","pollForQueries","onQuery","knownQueryIds","checkNewQueries","_await$onNode$getOrac","add","stopped","pollForQueryResponse","responseBuffer","getQueryObject","record","decodedQuery","decodedResponse","respond","respondToQuery","pollForResponse","postQueryToOracle","_options$queryFee","oracleQueryTx","extendOracleTtl","oracleExtendTx","getOracleObject","oracleRespondTx","queries","pollQueries","postQuery","extendOracle","getQuery","handler","lastArg","registerOracle","oracleRegisterTx","spend","recipientIdOrName","transferFunds","fraction","desiredAmount","payForTransaction","createGeneralizedAccount","authFnName","_options$gasLimit","gaContractId","buildAuthTxHash","buildAuthTxHashByGaMetaTx","_typeof","_defineProperty","prim","getValueOrErrorProxy","valueCb","Proxy","property","_2","chainMethodsOther","chainMethods","aensMethods","spendMethods","oracleMethods","createDelegationSignature","ids","omitAddress","contractGaMethods","AeSdkMethods","_options","_resolveAccount","_getOptions","AeSdkBase","nodes","instance","addNode","compilerApi","api","ensureNodeConnected","pool","selectedNodeName","select","selectNode","isNodeConnected","addresses","AeSdk","addAccount","selectedAddress","selectAccount","removeAccount","MESSAGE_DIRECTION","WALLET_TYPE","SUBSCRIPTION_TYPES","METHODS","RPC_STATUS","rpcErrors","RpcError","toJSON","json","RpcErr","cl","RpcInvalidTransactionError","RpcBroadcastError","RpcRejectedByUserError","RpcUnsupportedProtocolError","RpcConnectionDenyError","RpcNotAuthorizeError","RpcPermissionDenyError","RpcInternalError","RpcMethodNotFoundError","AccountRpc","rpcClient","_rpcClient","returnSigned","signedTransaction","_callbacks","_messageId","_methods","_handleMessage","_sendRequest","_sendResponse","_processResponse","RpcClient","connection","onDisconnect","connect","_handleMessage2","_sendRequest2","notify","origin","jsonrpc","_processResponse2","methodName","_sendResponse2","sendMessage","callbacks","AeSdkAepp","onAddressChange","onNetworkChange","_ensureConnected","_ensureAccountAccess","_accounts","disconnectParams","connectNode","client","updateAddress","updateNetwork","closeConnection","disconnect","readyToConnect","walletInfo","disconnectWallet","subscribeAddress","jsonBig","JsonBig","storeAsString","convertValuesToBigNumbers","bn","AeSdkWallet","onConnection","onSubscription","onAskAccounts","_type","_pushAccountsToApps","_clients","clientId","_isRpcClientSubscribed","_getClient","rpc","getAccounts","_getNode","_isRpcClientConnected","addressSubscription","CONNECTED","isConnected","_disconnectRpcClient","DISCONNECTED","removeRpcClient","addRpcClient","clientConnection","WAITING_FOR_CONNECTION_REQUEST","icons","getWalletInfo","subscribe","unsubscribe","subscription","aeppOrigin","aeppRpcClientId","transactionHash","location","_authFun","AccountGeneralized","authCallData","gaMetaTx","CLA","AccountLedger","transport","decorateAppAPIMethods","networkIdBuffer","toSend","maxChunkSize","chunkSize","bufferOffset","writeUInt8","copy","previous","send","messageStr","AccountLedgerFactory","versionCheckPromise","getAppConfiguration","accountIndex","addressLength","getAddress","initialize","CompilerBase","CompileOpts","srcFile","Aci","encodedAci","externalEncodedAci","interface","ErrorPos","file","line","col","CompileResult","SophiaCallResultInput","function","callResult","callValue","BytecodeCallResultInput","DecodedCallresult","FunctionCallInput","DecodeCalldataBytecode","DecodedCalldata","DecodeCalldataSource","ByteCodeInput","FateAssembler","fateAssembler","ValidateByteCodeInput","CompilerVersion","ApiVersion","apiVersion","SophiaBinaryData","sophiaType","SophiaJsonData","ContractMapper","SophiaCallResultInputMapper","body2","BytecodeCallResultInputMapper","body3","FunctionCallInputMapper","body4","DecodeCalldataBytecodeMapper","body5","DecodeCalldataSourceMapper","body6","ByteCodeInputMapper","body7","ValidateByteCodeInputMapper","Compiler","generateACI","generateACIOperationSpec","compileContract","compileContractOperationSpec","decodeCallResult","decodeCallResultOperationSpec","decodeCallResultBytecode","decodeCallResultBytecodeOperationSpec","encodeCalldata","encodeCalldataOperationSpec","decodeCalldataBytecode","decodeCalldataBytecodeOperationSpec","decodeCalldataSource","decodeCalldataSourceOperationSpec","getFateAssemblerCode","getFateAssemblerCodeOperationSpec","validateByteCode","validateByteCodeOperationSpec","getCompilerVersion","getCompilerVersionOperationSpec","versionOperationSpec","apiVersionOperationSpec","apiOperationSpec","CompilerHttp","compilerUrl","CompilerApi","parameter","snakeToPascal","PING_TIMEOUT_MS","PONG_TIMEOUT_MS","emit","channel","rest","_eventEmitter","enterState","nextState","_fsm","enter","dequeueAction","changeStatus","newStatus","_status","changeState","newState","_state","debug","_websocket","_isActionQueueLocked","queue","_actionQueue","guard","handleMessage","st","updates","clearTimeout","_pingTimeoutId","ping","_nextRpcMessageId","_rpcCallbacks","_message$error$data$","details","signAndNotify","signFn","_signedTx","signedTx","signed_tx","payloadTx","signatures2","appendSignature","handleUnexpectedMessage","_channel","wsMessage","channelOpen","awaitingCompletion","onSuccess","accepted","errorCode","error_code","errorMessage","error_msg","codes","awaitingConnection","channelInfoStatus","nextStatus","awaitingChannelCreateTx","awaitingOpenConfirmation","_fsmId","fsm_id","channelClosed","awaitingReconnection","awaitingOnChainTx","awaitingBlockInclusion","message2","_channelId","channel_id","awaitingTxSignRequest","_message$method$match","awaitingUpdateConflict","awaitingShutdownTx","awaitingLeave","closeTx","EventEmitter","_initialize","connectionHandler","openHandler","channelOptions","wsUrl","searchParams","W3CWebSocket","onerror","onopen","reconnectTx","onclose","onmessage","_messageQueue","_isMessageQueueLocked","shift","dequeueMessage","callback","onMessage","existingFsmId","handlers","on","off","removeListener","channelDisconnect","halfSignedTx","trees","fsmId","promise","enqueueAction","ChannelSpend","meta","awaitingOffChainTx","awaitingActionCompletion","onOnChainTx","Action","isOwn","onOwnWithdrawLocked","onWithdrawLocked","awaitingActionTx","onOwnDepositLocked","onDepositLocked","recipient","onStatusChanged","snakeToPascalObjKeys","ChannelContract","call_data","vm_version","abi_version","state2","addressKey","contract_id","gas_price","caller_id","con1","con2","BrowserConnection","receiveMessage","_onDisconnect","_target","_self","BrowserWindowMessageConnection","sendDirection","receiveDirection","to_aepp","listener","_message$data$jsonrpc","addEventListener","removeEventListener","_this$origin","postMessage","onDetected","wallets","wallet","getConnection","isExtension","to_waellet","newWallet","_listeners","BrowserRuntimeConnection","_port$sender$url","sender","addListener"],"sourceRoot":""}