@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
@@ -2,22 +2,27 @@ import { IllegalArgumentError } from "../../../utils/errors.mjs";
2
2
  import { MIN_GAS_PRICE, Tag, MAX_AUTH_FUN_GAS } from "../constants.mjs";
3
3
  import shortUInt from "./short-u-int.mjs";
4
4
  import { buildFee } from "./fee.mjs";
5
- function calculateGasLimitMax(txType, gasMax, rebuildTx) {
6
- return gasMax - +buildFee(txType, rebuildTx(gasMax)).dividedBy(MIN_GAS_PRICE);
5
+ function calculateGasLimitMax(gasMax, rebuildTx, unpackTx, buildTx) {
6
+ return gasMax - +buildFee(rebuildTx(gasMax), unpackTx, buildTx).dividedBy(MIN_GAS_PRICE);
7
7
  }
8
8
  export default {
9
9
  ...shortUInt,
10
- serialize(_value, _ref) {
10
+ serialize(_value, _ref, _ref2) {
11
11
  let {
12
- txType,
12
+ tag,
13
13
  rebuildTx,
14
- gasMax = 6e6,
14
+ unpackTx,
15
+ buildTx,
15
16
  _computingGasLimit
16
17
  } = _ref;
18
+ let {
19
+ gasMax = 6e6
20
+ } = _ref2;
17
21
  if (_computingGasLimit != null) return shortUInt.serialize(_computingGasLimit);
18
- const gasLimitMax = txType === Tag.GaMetaTx ? MAX_AUTH_FUN_GAS : calculateGasLimitMax(txType, gasMax, gasLimit => rebuildTx({
19
- _computingGasLimit: gasLimit
20
- }));
22
+ const gasLimitMax = tag === Tag.GaMetaTx ? MAX_AUTH_FUN_GAS : calculateGasLimitMax(gasMax, gasLimit => rebuildTx({
23
+ _computingGasLimit: gasLimit,
24
+ _pickBiggerFee: true
25
+ }), unpackTx, buildTx);
21
26
  const value = _value !== null && _value !== void 0 ? _value : gasLimitMax;
22
27
  if (value > gasLimitMax) {
23
28
  throw new IllegalArgumentError(`Gas limit ${value} must be less or equal to ${gasLimitMax}`);
@@ -1 +1 @@
1
- {"version":3,"file":"gas-limit.mjs","names":["IllegalArgumentError","MIN_GAS_PRICE","Tag","MAX_AUTH_FUN_GAS","shortUInt","buildFee","calculateGasLimitMax","txType","gasMax","rebuildTx","dividedBy","serialize","_value","_computingGasLimit","gasLimitMax","GaMetaTx","gasLimit","value"],"sources":["../../../../src/tx/builder/field-types/gas-limit.ts"],"sourcesContent":["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"],"mappings":"SAASA,oBAAoB;AAAA,SACpBC,aAAa,EAAEC,GAAG,EAAEC,gBAAgB;AAAA,OACtCC,SAAS;AAAA,SACPC,QAAQ;AAEjB,SAASC,oBAAoB,CAC3BC,MAAW,EACXC,MAAc,EACdC,SAAiC,EACzB;EACR,OAAOD,MAAM,GAAG,CAACH,QAAQ,CAACE,MAAM,EAAEE,SAAS,CAACD,MAAM,CAAC,CAAC,CAACE,SAAS,CAACT,aAAa,CAAC;AAC/E;AAEA,eAAe;EACb,GAAGG,SAAS;EAEZO,SAAS,CACPC,MAA0B,QASlB;IAAA,IARR;MACEL,MAAM;MAAEE,SAAS;MAAED,MAAM,GAAG,GAAG;MAAEK;IAMnC,CAAC;IAED,IAAIA,kBAAkB,IAAI,IAAI,EAAE,OAAOT,SAAS,CAACO,SAAS,CAACE,kBAAkB,CAAC;IAE9E,MAAMC,WAAW,GAAGP,MAAM,KAAKL,GAAG,CAACa,QAAQ,GAAGZ,gBAAgB,GAAGG,oBAAoB,CACnFC,MAAM,EACNC,MAAM,EACLQ,QAAQ,IAAKP,SAAS,CAAC;MAAEI,kBAAkB,EAAEG;IAAS,CAAC,CAAC,CAC1D;IACD,MAAMC,KAAK,GAAGL,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIE,WAAW;IACnC,IAAIG,KAAK,GAAGH,WAAW,EAAE;MACvB,MAAM,IAAId,oBAAoB,CAAE,aAAYiB,KAAM,6BAA4BH,WAAY,EAAC,CAAC;IAC9F;IACA,OAAOV,SAAS,CAACO,SAAS,CAACM,KAAK,CAAC;EACnC;AACF,CAAC"}
1
+ {"version":3,"file":"gas-limit.mjs","names":["IllegalArgumentError","MIN_GAS_PRICE","Tag","MAX_AUTH_FUN_GAS","shortUInt","buildFee","calculateGasLimitMax","gasMax","rebuildTx","unpackTx","buildTx","dividedBy","serialize","_value","_ref","_ref2","tag","_computingGasLimit","gasLimitMax","GaMetaTx","gasLimit","_pickBiggerFee","value"],"sources":["../../../../src/tx/builder/field-types/gas-limit.ts"],"sourcesContent":["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"],"mappings":"SAASA,oBAAoB;AAAA,SACpBC,aAAa,EAAEC,GAAG,EAAEC,gBAAgB;AAAA,OACtCC,SAAS;AAAA,SACPC,QAAQ;AAGjB,SAASC,oBAAoBA,CAC3BC,MAAc,EACdC,SAAiC,EACjCC,QAA6B,EAC7BC,OAA2B,EACnB;EACR,OAAOH,MAAM,GAAG,CAACF,QAAQ,CAACG,SAAS,CAACD,MAAM,CAAC,EAAEE,QAAQ,EAAEC,OAAO,CAAC,CAACC,SAAS,CAACV,aAAa,CAAC;AAC1F;AAEA,eAAe;EACb,GAAGG,SAAS;EAEZQ,SAASA,CACPC,MAA0B,EAAAC,IAAA,EAAAC,KAAA,EAWlB;IAAA,IAVR;MACEC,GAAG;MAAER,SAAS;MAAEC,QAAQ;MAAEC,OAAO;MAAEO;IAOrC,CAAC,GAAAH,IAAA;IAAA,IACD;MAAEP,MAAM,GAAG;IAAyB,CAAC,GAAAQ,KAAA;IAErC,IAAIE,kBAAkB,IAAI,IAAI,EAAE,OAAOb,SAAS,CAACQ,SAAS,CAACK,kBAAkB,CAAC;IAE9E,MAAMC,WAAW,GAAGF,GAAG,KAAKd,GAAG,CAACiB,QAAQ,GAAGhB,gBAAgB,GAAGG,oBAAoB,CAChFC,MAAM,EACLa,QAAQ,IAAKZ,SAAS,CAAC;MAAES,kBAAkB,EAAEG,QAAQ;MAAEC,cAAc,EAAE;IAAK,CAAC,CAAC,EAC/EZ,QAAQ,EACRC,OAAO,CACR;IACD,MAAMY,KAAK,GAAGT,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIK,WAAW;IACnC,IAAII,KAAK,GAAGJ,WAAW,EAAE;MACvB,MAAM,IAAIlB,oBAAoB,CAAE,aAAYsB,KAAM,6BAA4BJ,WAAY,EAAC,CAAC;IAC9F;IACA,OAAOd,SAAS,CAACQ,SAAS,CAACU,KAAK,CAAC;EACnC;AACF,CAAC"}
@@ -1,7 +1,9 @@
1
1
  /// <reference types="node" />
2
2
  declare const _default: {
3
3
  serializeAettos(value?: string | undefined): string;
4
- serialize(value: import("./u-int").Int | undefined, { denomination, ...options }: import("./coin-amount").Options): Buffer;
4
+ serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
5
+ denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
6
+ }): Buffer;
5
7
  deserialize(value: Buffer): string;
6
8
  };
7
9
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"gas-price.mjs","names":["coinAmount","IllegalArgumentError","MIN_GAS_PRICE","serializeAettos","value","toString"],"sources":["../../../../src/tx/builder/field-types/gas-price.ts"],"sourcesContent":["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"],"mappings":"OAAOA,UAAU;AAAA,SACRC,oBAAoB;AAAA,SACpBC,aAAa;AAEtB,eAAe;EACb,GAAGF,UAAU;EAEbG,eAAe,GAA+D;IAAA,IAA9DC,KAAyB,uEAAGF,aAAa,CAACG,QAAQ,EAAE;IAClE,IAAI,CAACD,KAAK,GAAGF,aAAa,EAAE;MAC1B,MAAM,IAAID,oBAAoB,CAAE,aAAYG,KAAK,CAACC,QAAQ,EAAG,wBAAuBH,aAAc,EAAC,CAAC;IACtG;IACA,OAAOE,KAAK;EACd;AACF,CAAC"}
1
+ {"version":3,"file":"gas-price.mjs","names":["coinAmount","IllegalArgumentError","MIN_GAS_PRICE","serializeAettos","value","arguments","length","undefined","toString"],"sources":["../../../../src/tx/builder/field-types/gas-price.ts"],"sourcesContent":["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"],"mappings":"OAAOA,UAAU;AAAA,SACRC,oBAAoB;AAAA,SACpBC,aAAa;AAEtB,eAAe;EACb,GAAGF,UAAU;EAEbG,eAAeA,CAAA,EAA+D;IAAA,IAA9DC,KAAyB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGH,aAAa,CAACM,QAAQ,EAAE;IAClE,IAAI,CAACJ,KAAK,GAAGF,aAAa,EAAE;MAC1B,MAAM,IAAID,oBAAoB,CAAE,aAAYG,KAAK,CAACI,QAAQ,EAAG,wBAAuBN,aAAc,EAAC,CAAC;IACtG;IACA,OAAOE,KAAK;EACd;AACF,CAAC"}
@@ -1,55 +1,100 @@
1
1
  /// <reference types="node" />
2
2
  import _address from './address';
3
- import _addresses from './addresses';
3
+ import _array from './array';
4
+ import _encoded from './encoded';
5
+ import _entry from './entry';
4
6
  import _enumeration from './enumeration';
5
- declare const field: {
6
- serialize(value: string): Buffer;
7
- deserialize(value: Buffer): string;
8
- };
9
- declare const uInt: {
10
- serialize(value: import("./u-int").Int): Buffer;
11
- deserialize(value: Buffer): string;
7
+ import _map from './map';
8
+ import _mptree from './mptree';
9
+ import _nonce from './nonce';
10
+ import _shortUIntConst from './short-u-int-const';
11
+ import _wrapped from './wrapped';
12
+ declare const abiVersion: {
13
+ _getProtocolDetails(c: import("../constants").ConsensusProtocolVersion, tag: import("../constants").Tag): import("../constants").AbiVersion;
14
+ serialize(value: import("../constants").AbiVersion | undefined, { tag }: {
15
+ tag: import("../constants").Tag;
16
+ }, { consensusProtocolVersion }: {
17
+ consensusProtocolVersion?: import("../constants").ConsensusProtocolVersion | undefined;
18
+ }): Buffer;
19
+ prepare(value: import("../constants").AbiVersion | undefined, { tag }: {
20
+ tag: import("../constants").Tag;
21
+ }, options: {
22
+ consensusProtocolVersion?: import("../constants").ConsensusProtocolVersion | undefined;
23
+ onNode?: import("../../..").Node | undefined;
24
+ }): Promise<import("../constants").AbiVersion | undefined>;
25
+ deserialize(buffer: Buffer): import("../constants").AbiVersion;
12
26
  };
13
- declare const shortUInt: {
14
- serialize(value: number): Buffer;
15
- deserialize(value: Buffer): number;
27
+ declare const address: typeof _address;
28
+ declare const array: typeof _array;
29
+ declare const boolean: {
30
+ serialize(value: boolean): Buffer;
31
+ deserialize(buffer: Buffer): boolean;
16
32
  };
17
33
  declare const coinAmount: {
18
34
  serializeAettos(value: string | undefined): string;
19
- serialize(value: import("./u-int").Int | undefined, { denomination, ...options }: import("./coin-amount").Options): Buffer;
35
+ serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
36
+ denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
37
+ }): Buffer;
20
38
  deserialize(value: Buffer): string;
21
39
  };
22
- declare const address: typeof _address;
23
- declare const addresses: typeof _addresses;
40
+ declare const ctVersion: {
41
+ serialize(value: import("./ct-version").CtVersion | undefined, params: {}, { consensusProtocolVersion }: {
42
+ consensusProtocolVersion?: import("../constants").ConsensusProtocolVersion | undefined;
43
+ }): Buffer;
44
+ prepare(value: import("./ct-version").CtVersion | undefined, params: {}, options: {
45
+ consensusProtocolVersion?: import("../constants").ConsensusProtocolVersion | undefined;
46
+ onNode?: import("../../..").Node | undefined;
47
+ }): Promise<import("./ct-version").CtVersion | undefined>;
48
+ deserialize(buffer: Buffer): import("./ct-version").CtVersion;
49
+ };
24
50
  declare const deposit: {
25
- serialize(value: import("./u-int").Int | undefined, options: import("./coin-amount").Options): Buffer;
51
+ serialize(value: import("../constants").Int | undefined, options: {}, parameters: {
52
+ denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
53
+ }): Buffer;
26
54
  serializeAettos(value: string | undefined): string;
27
55
  deserialize(value: Buffer): string;
28
56
  };
57
+ declare const encoded: typeof _encoded;
58
+ declare const entry: typeof _entry;
29
59
  declare const enumeration: typeof _enumeration;
30
60
  declare const fee: {
31
- serializeAettos(_value: string | undefined, { txType, rebuildTx, _computingMinFee }: {
32
- txType: import("../constants").Tag;
33
- rebuildTx: (params: any) => any;
34
- _computingMinFee?: string | undefined;
61
+ serializeAettos(_value: string | undefined, { rebuildTx, unpackTx, buildTx, _computingMinFee, _pickBiggerFee, }: {
62
+ rebuildTx: (params: any) => `tx_${string}`;
63
+ unpackTx: typeof import("..").unpackTx;
64
+ buildTx: typeof import("..").buildTx;
65
+ _computingMinFee?: import("bignumber.js").BigNumber | undefined;
66
+ _pickBiggerFee?: boolean | undefined;
35
67
  }): string;
36
- serialize(value: import("./u-int").Int | undefined, { denomination, ...options }: import("./coin-amount").Options): Buffer;
68
+ serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
69
+ denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
70
+ }): Buffer;
71
+ deserialize(value: Buffer): string;
72
+ };
73
+ declare const field: {
74
+ serialize(value: string): Buffer;
37
75
  deserialize(value: Buffer): string;
38
76
  };
39
77
  declare const gasLimit: {
40
- serialize(_value: number | undefined, { txType, rebuildTx, gasMax, _computingGasLimit, }: {
41
- txType: import("../constants").Tag;
78
+ serialize(_value: number | undefined, { tag, rebuildTx, unpackTx, buildTx, _computingGasLimit, }: {
79
+ tag: import("../constants").Tag;
42
80
  rebuildTx: (params: any) => any;
43
- gasMax: number;
81
+ unpackTx: typeof import("..").unpackTx;
82
+ buildTx: typeof import("..").buildTx;
44
83
  _computingGasLimit?: number | undefined;
84
+ }, { gasMax }: {
85
+ gasMax?: number | undefined;
45
86
  }): Buffer;
46
87
  deserialize(value: Buffer): number;
47
88
  };
48
89
  declare const gasPrice: {
49
90
  serializeAettos(value?: string | undefined): string;
50
- serialize(value: import("./u-int").Int | undefined, { denomination, ...options }: import("./coin-amount").Options): Buffer;
91
+ serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
92
+ denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
93
+ }): Buffer;
51
94
  deserialize(value: Buffer): string;
52
95
  };
96
+ declare const map: typeof _map;
97
+ declare const mptree: typeof _mptree;
53
98
  declare const name: {
54
99
  serialize(value: `${string}.chain`): Buffer;
55
100
  deserialize(value: Buffer): `${string}.chain`;
@@ -58,15 +103,18 @@ declare const nameFee: {
58
103
  serializeAettos(_value: string | undefined, txFields: {
59
104
  name: `${string}.chain`;
60
105
  }): string;
61
- serialize(value: import("./u-int").Int | undefined, txFields: {
106
+ serialize(value: import("../constants").Int | undefined, txFields: {
62
107
  name: `${string}.chain`;
63
- } & import("./coin-amount").Options): Buffer;
108
+ }, parameters: {
109
+ denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
110
+ }): Buffer;
64
111
  deserialize(value: Buffer): string;
65
112
  };
66
113
  declare const nameId: {
67
- serialize(value: `nm_${string}` | `${string}.chain`): Buffer;
114
+ serialize(value: `${string}.chain` | `nm_${string}`): Buffer;
68
115
  deserialize: (value: Buffer) => `nm_${string}`;
69
116
  };
117
+ declare const nonce: typeof _nonce;
70
118
  declare const pointers: {
71
119
  serialize(pointers: (import("../../../apis/node").NamePointer & {
72
120
  id: `ch_${string}` | `ct_${string}` | `ok_${string}` | `ak_${string}` | `cm_${string}` | `nm_${string}`;
@@ -75,8 +123,37 @@ declare const pointers: {
75
123
  id: `ch_${string}` | `ct_${string}` | `ok_${string}` | `ak_${string}` | `cm_${string}` | `nm_${string}`;
76
124
  })[];
77
125
  };
126
+ declare const raw: {
127
+ serialize(buffer: Uint8Array): Buffer;
128
+ deserialize(buffer: Buffer): Buffer;
129
+ };
130
+ declare const shortUInt: {
131
+ serialize(value: number): Buffer;
132
+ deserialize(value: Buffer): number;
133
+ };
134
+ declare const shortUIntConst: typeof _shortUIntConst;
135
+ declare const string: {
136
+ serialize(string: string): Buffer;
137
+ deserialize(buffer: Buffer): string;
138
+ };
139
+ declare const ttl: {
140
+ serialize(value: number | undefined): Buffer;
141
+ prepare(value: number | undefined, params: {}, { onNode, absoluteTtl }: {
142
+ onNode?: import("../../..").Node | undefined;
143
+ absoluteTtl?: boolean | undefined;
144
+ }): Promise<number | undefined>;
145
+ deserialize(value: Buffer): number;
146
+ };
147
+ declare const uInt: {
148
+ serialize(value: import("../constants").Int): Buffer;
149
+ deserialize(value: Buffer): string;
150
+ };
151
+ declare const wrapped: typeof _wrapped;
152
+ export type BinaryData = Buffer | Buffer[] | Buffer[][] | Array<[Buffer, Array<[Buffer, Buffer[]]>]>;
78
153
  export interface Field {
79
- serialize: (value: any, options: any) => Buffer | Buffer[] | Buffer[][];
80
- deserialize: (value: Buffer | Buffer[] | Buffer[][]) => any;
154
+ serialize: (value: any, options: any, parameters: any) => BinaryData;
155
+ prepare?: (value: any, options: any, parameters: any) => Promise<any>;
156
+ deserialize: (value: BinaryData, options: any) => any;
157
+ recursiveType?: boolean;
81
158
  }
82
- export { field, uInt, shortUInt, coinAmount, address, addresses, deposit, enumeration, fee, gasLimit, gasPrice, name, nameFee, nameId, pointers, };
159
+ export { abiVersion, address, array, boolean, coinAmount, ctVersion, deposit, encoded, entry, enumeration, fee, field, gasLimit, gasPrice, map, mptree, name, nameFee, nameId, nonce, pointers, raw, shortUInt, shortUIntConst, string, ttl, uInt, wrapped, };
@@ -1,32 +1,58 @@
1
- import _field from "./field.mjs";
2
- import _uInt from "./u-int.mjs";
3
- import _shortUInt from "./short-u-int.mjs";
4
- import _coinAmount from "./coin-amount.mjs";
1
+ import _abiVersion from "./abi-version.mjs";
5
2
  import _address from "./address.mjs";
6
- import _addresses from "./addresses.mjs";
3
+ import _array from "./array.mjs";
4
+ import _boolean from "./boolean.mjs";
5
+ import _coinAmount from "./coin-amount.mjs";
6
+ import _ctVersion from "./ct-version.mjs";
7
7
  import _deposit from "./deposit.mjs";
8
+ import _encoded from "./encoded.mjs";
9
+ import _entry from "./entry.mjs";
8
10
  import _enumeration from "./enumeration.mjs";
9
11
  import _fee from "./fee.mjs";
12
+ import _field from "./field.mjs";
10
13
  import _gasLimit from "./gas-limit.mjs";
11
14
  import _gasPrice from "./gas-price.mjs";
15
+ import _map from "./map.mjs";
16
+ import _mptree from "./mptree.mjs";
12
17
  import _name from "./name.mjs";
13
18
  import _nameFee from "./name-fee.mjs";
14
19
  import _nameId from "./name-id.mjs";
15
- import _pointers from "./pointers.mjs"; // TODO: remove after fixing https://github.com/Gerrit0/typedoc-plugin-missing-exports/issues/15
16
- const field = _field;
17
- const uInt = _uInt;
18
- const shortUInt = _shortUInt;
19
- const coinAmount = _coinAmount;
20
+ import _nonce from "./nonce.mjs";
21
+ import _pointers from "./pointers.mjs";
22
+ import _raw from "./raw.mjs";
23
+ import _shortUInt from "./short-u-int.mjs";
24
+ import _shortUIntConst from "./short-u-int-const.mjs";
25
+ import _string from "./string.mjs";
26
+ import _ttl from "./ttl.mjs";
27
+ import _uInt from "./u-int.mjs";
28
+ import _wrapped from "./wrapped.mjs"; // TODO: remove after fixing https://github.com/Gerrit0/typedoc-plugin-missing-exports/issues/15
29
+ const abiVersion = _abiVersion;
20
30
  const address = _address;
21
- const addresses = _addresses;
31
+ const array = _array;
32
+ const boolean = _boolean;
33
+ const coinAmount = _coinAmount;
34
+ const ctVersion = _ctVersion;
22
35
  const deposit = _deposit;
36
+ const encoded = _encoded;
37
+ const entry = _entry;
23
38
  const enumeration = _enumeration;
24
39
  const fee = _fee;
40
+ const field = _field;
25
41
  const gasLimit = _gasLimit;
26
42
  const gasPrice = _gasPrice;
43
+ const map = _map;
44
+ const mptree = _mptree;
27
45
  const name = _name;
28
46
  const nameFee = _nameFee;
29
47
  const nameId = _nameId;
48
+ const nonce = _nonce;
30
49
  const pointers = _pointers;
31
- export { field, uInt, shortUInt, coinAmount, address, addresses, deposit, enumeration, fee, gasLimit, gasPrice, name, nameFee, nameId, pointers };
50
+ const raw = _raw;
51
+ const shortUInt = _shortUInt;
52
+ const shortUIntConst = _shortUIntConst;
53
+ const string = _string;
54
+ const ttl = _ttl;
55
+ const uInt = _uInt;
56
+ const wrapped = _wrapped;
57
+ export { abiVersion, address, array, boolean, coinAmount, ctVersion, deposit, encoded, entry, enumeration, fee, field, gasLimit, gasPrice, map, mptree, name, nameFee, nameId, nonce, pointers, raw, shortUInt, shortUIntConst, string, ttl, uInt, wrapped };
32
58
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_field","_uInt","_shortUInt","_coinAmount","_address","_addresses","_deposit","_enumeration","_fee","_gasLimit","_gasPrice","_name","_nameFee","_nameId","_pointers","field","uInt","shortUInt","coinAmount","address","addresses","deposit","enumeration","fee","gasLimit","gasPrice","name","nameFee","nameId","pointers"],"sources":["../../../../src/tx/builder/field-types/index.ts"],"sourcesContent":["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"],"mappings":"OAAOA,MAAM;AAAA,OACNC,KAAK;AAAA,OACLC,UAAU;AAAA,OACVC,WAAW;AAAA,OACXC,QAAQ;AAAA,OACRC,UAAU;AAAA,OACVC,QAAQ;AAAA,OACRC,YAAY;AAAA,OACZC,IAAI;AAAA,OACJC,SAAS;AAAA,OACTC,SAAS;AAAA,OACTC,KAAK;AAAA,OACLC,QAAQ;AAAA,OACRC,OAAO;AAAA,OACPC,SAAS,wBAEhB;AACA,MAAMC,KAAK,GAAGf,MAAM;AACpB,MAAMgB,IAAI,GAAGf,KAAK;AAClB,MAAMgB,SAAS,GAAGf,UAAU;AAC5B,MAAMgB,UAAU,GAAGf,WAAW;AAC9B,MAAMgB,OAAO,GAAGf,QAAQ;AACxB,MAAMgB,SAAS,GAAGf,UAAU;AAC5B,MAAMgB,OAAO,GAAGf,QAAQ;AACxB,MAAMgB,WAAW,GAAGf,YAAY;AAChC,MAAMgB,GAAG,GAAGf,IAAI;AAChB,MAAMgB,QAAQ,GAAGf,SAAS;AAC1B,MAAMgB,QAAQ,GAAGf,SAAS;AAC1B,MAAMgB,IAAI,GAAGf,KAAK;AAClB,MAAMgB,OAAO,GAAGf,QAAQ;AACxB,MAAMgB,MAAM,GAAGf,OAAO;AACtB,MAAMgB,QAAQ,GAAGf,SAAS;AAO1B,SACEC,KAAK,EACLC,IAAI,EACJC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,WAAW,EACXC,GAAG,EACHC,QAAQ,EACRC,QAAQ,EACRC,IAAI,EACJC,OAAO,EACPC,MAAM,EACNC,QAAQ"}
1
+ {"version":3,"file":"index.mjs","names":["_abiVersion","_address","_array","_boolean","_coinAmount","_ctVersion","_deposit","_encoded","_entry","_enumeration","_fee","_field","_gasLimit","_gasPrice","_map","_mptree","_name","_nameFee","_nameId","_nonce","_pointers","_raw","_shortUInt","_shortUIntConst","_string","_ttl","_uInt","_wrapped","abiVersion","address","array","boolean","coinAmount","ctVersion","deposit","encoded","entry","enumeration","fee","field","gasLimit","gasPrice","map","mptree","name","nameFee","nameId","nonce","pointers","raw","shortUInt","shortUIntConst","string","ttl","uInt","wrapped"],"sources":["../../../../src/tx/builder/field-types/index.ts"],"sourcesContent":["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"],"mappings":"OAAOA,WAAW;AAAA,OACXC,QAAQ;AAAA,OACRC,MAAM;AAAA,OACNC,QAAQ;AAAA,OACRC,WAAW;AAAA,OACXC,UAAU;AAAA,OACVC,QAAQ;AAAA,OACRC,QAAQ;AAAA,OACRC,MAAM;AAAA,OACNC,YAAY;AAAA,OACZC,IAAI;AAAA,OACJC,MAAM;AAAA,OACNC,SAAS;AAAA,OACTC,SAAS;AAAA,OACTC,IAAI;AAAA,OACJC,OAAO;AAAA,OACPC,KAAK;AAAA,OACLC,QAAQ;AAAA,OACRC,OAAO;AAAA,OACPC,MAAM;AAAA,OACNC,SAAS;AAAA,OACTC,IAAI;AAAA,OACJC,UAAU;AAAA,OACVC,eAAe;AAAA,OACfC,OAAO;AAAA,OACPC,IAAI;AAAA,OACJC,KAAK;AAAA,OACLC,QAAQ,uBAEf;AACA,MAAMC,UAAU,GAAG5B,WAAW;AAC9B,MAAM6B,OAAO,GAAG5B,QAAQ;AACxB,MAAM6B,KAAK,GAAG5B,MAAM;AACpB,MAAM6B,OAAO,GAAG5B,QAAQ;AACxB,MAAM6B,UAAU,GAAG5B,WAAW;AAC9B,MAAM6B,SAAS,GAAG5B,UAAU;AAC5B,MAAM6B,OAAO,GAAG5B,QAAQ;AACxB,MAAM6B,OAAO,GAAG5B,QAAQ;AACxB,MAAM6B,KAAK,GAAG5B,MAAM;AACpB,MAAM6B,WAAW,GAAG5B,YAAY;AAChC,MAAM6B,GAAG,GAAG5B,IAAI;AAChB,MAAM6B,KAAK,GAAG5B,MAAM;AACpB,MAAM6B,QAAQ,GAAG5B,SAAS;AAC1B,MAAM6B,QAAQ,GAAG5B,SAAS;AAC1B,MAAM6B,GAAG,GAAG5B,IAAI;AAChB,MAAM6B,MAAM,GAAG5B,OAAO;AACtB,MAAM6B,IAAI,GAAG5B,KAAK;AAClB,MAAM6B,OAAO,GAAG5B,QAAQ;AACxB,MAAM6B,MAAM,GAAG5B,OAAO;AACtB,MAAM6B,KAAK,GAAG5B,MAAM;AACpB,MAAM6B,QAAQ,GAAG5B,SAAS;AAC1B,MAAM6B,GAAG,GAAG5B,IAAI;AAChB,MAAM6B,SAAS,GAAG5B,UAAU;AAC5B,MAAM6B,cAAc,GAAG5B,eAAe;AACtC,MAAM6B,MAAM,GAAG5B,OAAO;AACtB,MAAM6B,GAAG,GAAG5B,IAAI;AAChB,MAAM6B,IAAI,GAAG5B,KAAK;AAClB,MAAM6B,OAAO,GAAG5B,QAAQ;AAWxB,SACEC,UAAU,EACVC,OAAO,EACPC,KAAK,EACLC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,OAAO,EACPC,KAAK,EACLC,WAAW,EACXC,GAAG,EACHC,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,GAAG,EACHC,MAAM,EACNC,IAAI,EACJC,OAAO,EACPC,MAAM,EACNC,KAAK,EACLC,QAAQ,EACRC,GAAG,EACHC,SAAS,EACTC,cAAc,EACdC,MAAM,EACNC,GAAG,EACHC,IAAI,EACJC,OAAO"}
@@ -0,0 +1,13 @@
1
+ /// <reference types="node" />
2
+ import { Tag } from '../constants';
3
+ import { Encoding, Encoded } from '../../../utils/encoder';
4
+ import type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';
5
+ export default function genMapField<E extends Encoding, T extends Tag>(encoding: E, tag: T): {
6
+ serialize: (value: Record<Encoded.Generic<E>, any>, options: {
7
+ buildTx: typeof buildTxType;
8
+ }) => Buffer;
9
+ deserialize: (value: Buffer, options: {
10
+ unpackTx: typeof unpackTxType;
11
+ }) => Record<Encoded.Generic<E>, any>;
12
+ recursiveType: true;
13
+ };
@@ -0,0 +1,49 @@
1
+ import { Tag } from "../constants.mjs";
2
+ import { encode, Encoding, decode } from "../../../utils/encoder.mjs";
3
+ export default function genMapField(encoding, tag) {
4
+ return {
5
+ serialize(object, _ref) {
6
+ let {
7
+ buildTx
8
+ } = _ref;
9
+ return decode(buildTx({
10
+ tag: Tag.Mtree,
11
+ values: Object.entries(object).map(_ref2 => {
12
+ let [key, value] = _ref2;
13
+ return {
14
+ tag: Tag.MtreeValue,
15
+ key: decode(key),
16
+ value: decode(buildTx({
17
+ ...value,
18
+ tag
19
+ }))
20
+ };
21
+ })
22
+ }));
23
+ },
24
+ deserialize(buffer, _ref3) {
25
+ let {
26
+ unpackTx
27
+ } = _ref3;
28
+ const {
29
+ values
30
+ } = unpackTx(encode(buffer, Encoding.Transaction), Tag.Mtree);
31
+ return Object.fromEntries(values
32
+ // TODO: remove after resolving https://github.com/aeternity/aeternity/issues/4066
33
+ .filter(_ref4 => {
34
+ let {
35
+ key
36
+ } = _ref4;
37
+ return encoding !== Encoding.ContractAddress || key.length === 32;
38
+ }).map(_ref5 => {
39
+ let {
40
+ key,
41
+ value
42
+ } = _ref5;
43
+ return [encode(key, encoding), unpackTx(encode(value, Encoding.Transaction), tag)];
44
+ }));
45
+ },
46
+ recursiveType: true
47
+ };
48
+ }
49
+ //# sourceMappingURL=map.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.mjs","names":["Tag","encode","Encoding","decode","genMapField","encoding","tag","serialize","object","_ref","buildTx","Mtree","values","Object","entries","map","_ref2","key","value","MtreeValue","deserialize","buffer","_ref3","unpackTx","Transaction","fromEntries","filter","_ref4","ContractAddress","length","_ref5","recursiveType"],"sources":["../../../../src/tx/builder/field-types/map.ts"],"sourcesContent":["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"],"mappings":"SAASA,GAAG;AAAA,SAEVC,MAAM,EAAEC,QAAQ,EAAWC,MAAM;AAInC,eAAe,SAASC,WAAWA,CAAoCC,QAAW,EAAEC,GAAM,EAYxF;EACA,OAAO;IACLC,SAASA,CAACC,MAAM,EAAAC,IAAA,EAAe;MAAA,IAAb;QAAEC;MAAQ,CAAC,GAAAD,IAAA;MAC3B,OAAON,MAAM,CAACO,OAAO,CAAC;QACpBJ,GAAG,EAAEN,GAAG,CAACW,KAAK;QACdC,MAAM,EAAEC,MAAM,CAACC,OAAO,CAACN,MAAM,CAAC,CAACO,GAAG,CAACC,KAAA;UAAA,IAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAAF,KAAA;UAAA,OAAM;YACpDV,GAAG,EAAEN,GAAG,CAACmB,UAAU;YACnBF,GAAG,EAAEd,MAAM,CAACc,GAAG,CAAuB;YACtCC,KAAK,EAAEf,MAAM,CAACO,OAAO,CAAC;cAAE,GAAGQ,KAAY;cAAEZ;YAAI,CAAC,CAAC;UACjD,CAAC;QAAA,CAAC;MACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAEDc,WAAWA,CAACC,MAAM,EAAAC,KAAA,EAAgB;MAAA,IAAd;QAAEC;MAAS,CAAC,GAAAD,KAAA;MAC9B,MAAM;QAAEV;MAAO,CAAC,GAAGW,QAAQ,CAACtB,MAAM,CAACoB,MAAM,EAAEnB,QAAQ,CAACsB,WAAW,CAAC,EAAExB,GAAG,CAACW,KAAK,CAAC;MAC5E,OAAOE,MAAM,CAACY,WAAW,CAACb;MACxB;MAAA,CACCc,MAAM,CAACC,KAAA;QAAA,IAAC;UAAEV;QAAI,CAAC,GAAAU,KAAA;QAAA,OAAKtB,QAAQ,KAAKH,QAAQ,CAAC0B,eAAe,IAAIX,GAAG,CAACY,MAAM,KAAK,EAAE;MAAA,EAAC,CAC/Ed,GAAG,CAACe,KAAA;QAAA,IAAC;UAAEb,GAAG;UAAEC;QAAM,CAAC,GAAAY,KAAA;QAAA,OAAK,CACvB7B,MAAM,CAACgB,GAAG,EAAEZ,QAAQ,CAAC,EACrBkB,QAAQ,CAACtB,MAAM,CAACiB,KAAK,EAAEhB,QAAQ,CAACsB,WAAW,CAAC,EAAElB,GAAG,CAAC,CACnD;MAAA,EAAC,CAAC;IACP,CAAC;IAEDyB,aAAa,EAAE;EACjB,CAAC;AACH"}
@@ -0,0 +1,42 @@
1
+ /// <reference types="node" />
2
+ import { Tag } from '../constants';
3
+ import { Encoded, Encoding } from '../../../utils/encoder';
4
+ import type { unpackTx } from '..';
5
+ import type { TxUnpacked } from '../schema.generated';
6
+ type MPTreeBinary = [Buffer, Array<[Buffer, Buffer[]]>];
7
+ declare class MPTree<E extends Encoding, T extends Tag> {
8
+ #private;
9
+ get isComplete(): boolean;
10
+ /**
11
+ * Deserialize Merkle Patricia Tree
12
+ * @param binary - Binary
13
+ * @param tag - Tag to use to decode value
14
+ * @param unpTx - Implementation of unpackTx use to decode values
15
+ * @returns Merkle Patricia Tree
16
+ */
17
+ constructor(binary: MPTreeBinary, encoding: E, tag: T, unpTx: typeof unpackTx);
18
+ isEqual(tree: MPTree<E, T>): boolean;
19
+ /**
20
+ * Serialize Merkle Patricia Tree
21
+ * @returns Binary
22
+ */
23
+ serialize(): MPTreeBinary;
24
+ /**
25
+ * Retrieve value from Merkle Patricia Tree
26
+ * @param key - The key of the element to retrieve
27
+ * @returns Value associated to the specified key
28
+ */
29
+ get(key: Encoded.Generic<E>): TxUnpacked & {
30
+ tag: T;
31
+ } | undefined;
32
+ toObject(): Record<Encoded.Generic<E>, TxUnpacked & {
33
+ tag: T;
34
+ }>;
35
+ }
36
+ export default function genMPTreeField<E extends Encoding, T extends Tag>(encoding: E, tag: T): {
37
+ serialize: (value: MPTree<E, T>) => MPTreeBinary;
38
+ deserialize: (value: MPTreeBinary, o: {
39
+ unpackTx: typeof unpackTx;
40
+ }) => MPTree<E, T>;
41
+ };
42
+ export {};