@aeternity/aepp-sdk 12.1.3 → 13.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (565) 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 +12031 -11231
  7. package/dist/aepp-sdk.js.map +1 -1
  8. package/es/AeSdk.d.ts +7 -3
  9. package/es/AeSdk.mjs +17 -22
  10. package/es/AeSdk.mjs.map +1 -1
  11. package/es/AeSdkAepp.d.ts +6 -5
  12. package/es/AeSdkAepp.mjs +7 -30
  13. package/es/AeSdkAepp.mjs.map +1 -1
  14. package/es/AeSdkBase.d.ts +18 -140
  15. package/es/AeSdkBase.mjs +30 -184
  16. package/es/AeSdkBase.mjs.map +1 -1
  17. package/es/AeSdkMethods.d.ts +123 -0
  18. package/es/AeSdkMethods.mjs +122 -0
  19. package/es/AeSdkMethods.mjs.map +1 -0
  20. package/es/AeSdkWallet.d.ts +7 -21
  21. package/es/AeSdkWallet.mjs +38 -86
  22. package/es/AeSdkWallet.mjs.map +1 -1
  23. package/es/Node.d.ts +11 -15
  24. package/es/Node.mjs +35 -48
  25. package/es/Node.mjs.map +1 -1
  26. package/es/account/Base.d.ts +24 -40
  27. package/es/account/Base.mjs +1 -101
  28. package/es/account/Base.mjs.map +1 -1
  29. package/es/account/Generalized.d.ts +16 -0
  30. package/es/account/Generalized.mjs +113 -0
  31. package/es/account/Generalized.mjs.map +1 -0
  32. package/es/account/Ledger.d.ts +28 -0
  33. package/es/account/Ledger.mjs +102 -0
  34. package/es/account/Ledger.mjs.map +1 -0
  35. package/es/account/LedgerFactory.d.ts +39 -0
  36. package/es/account/LedgerFactory.mjs +81 -0
  37. package/es/account/LedgerFactory.mjs.map +1 -0
  38. package/es/account/Memory.d.ts +13 -17
  39. package/es/account/Memory.mjs +43 -64
  40. package/es/account/Memory.mjs.map +1 -1
  41. package/es/account/Rpc.d.ts +6 -8
  42. package/es/account/Rpc.mjs +14 -32
  43. package/es/account/Rpc.mjs.map +1 -1
  44. package/es/aens.d.ts +4 -4
  45. package/es/aens.mjs +46 -41
  46. package/es/aens.mjs.map +1 -1
  47. package/es/aepp-wallet-communication/connection/Browser.mjs +9 -13
  48. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
  49. package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +1 -0
  50. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +22 -11
  51. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
  52. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +1 -1
  53. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +0 -31
  54. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
  55. package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
  56. package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +3 -3
  57. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +5 -42
  58. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
  59. package/es/aepp-wallet-communication/rpc/types.d.ts +7 -1
  60. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
  61. package/es/aepp-wallet-communication/schema.mjs +14 -68
  62. package/es/aepp-wallet-communication/schema.mjs.map +1 -1
  63. package/es/aepp-wallet-communication/wallet-detector.mjs +0 -3
  64. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
  65. package/es/apis/compiler/compiler.d.ts +23 -29
  66. package/es/apis/compiler/compiler.mjs +128 -189
  67. package/es/apis/compiler/compiler.mjs.map +1 -1
  68. package/es/apis/compiler/index.mjs.map +1 -1
  69. package/es/apis/compiler/models/index.d.ts +82 -135
  70. package/es/apis/compiler/models/index.mjs +1 -47
  71. package/es/apis/compiler/models/index.mjs.map +1 -1
  72. package/es/apis/compiler/models/mappers.d.ts +8 -8
  73. package/es/apis/compiler/models/mappers.mjs +165 -183
  74. package/es/apis/compiler/models/mappers.mjs.map +1 -1
  75. package/es/apis/compiler/models/parameters.d.ts +0 -1
  76. package/es/apis/compiler/models/parameters.mjs +5 -9
  77. package/es/apis/compiler/models/parameters.mjs.map +1 -1
  78. package/es/apis/node/index.mjs.map +1 -1
  79. package/es/apis/node/models/index.d.ts +48 -48
  80. package/es/apis/node/models/mappers.mjs +12 -6
  81. package/es/apis/node/models/mappers.mjs.map +1 -1
  82. package/es/apis/node/models/parameters.mjs.map +1 -1
  83. package/es/apis/node/node.mjs +43 -84
  84. package/es/apis/node/node.mjs.map +1 -1
  85. package/es/chain.d.ts +10 -2
  86. package/es/chain.mjs +37 -59
  87. package/es/chain.mjs.map +1 -1
  88. package/es/channel/Base.d.ts +200 -0
  89. package/es/channel/Base.mjs +293 -0
  90. package/es/channel/Base.mjs.map +1 -0
  91. package/es/channel/Contract.d.ts +248 -0
  92. package/es/channel/Contract.mjs +420 -0
  93. package/es/channel/Contract.mjs.map +1 -0
  94. package/es/channel/Spend.d.ts +219 -0
  95. package/es/channel/Spend.mjs +385 -0
  96. package/es/channel/Spend.mjs.map +1 -0
  97. package/es/channel/handlers.d.ts +8 -21
  98. package/es/channel/handlers.mjs +151 -899
  99. package/es/channel/handlers.mjs.map +1 -1
  100. package/es/channel/internal.d.ts +27 -21
  101. package/es/channel/internal.mjs +101 -191
  102. package/es/channel/internal.mjs.map +1 -1
  103. package/es/contract/Contract.d.ts +210 -0
  104. package/es/contract/Contract.mjs +551 -0
  105. package/es/contract/Contract.mjs.map +1 -0
  106. package/es/contract/compiler/Base.d.ts +81 -0
  107. package/es/contract/compiler/Base.mjs +5 -0
  108. package/es/contract/compiler/Base.mjs.map +1 -0
  109. package/es/contract/compiler/Cli.d.ts +23 -0
  110. package/es/contract/compiler/Cli.mjs +155 -0
  111. package/es/contract/compiler/Cli.mjs.map +1 -0
  112. package/es/contract/compiler/Http.d.ts +32 -0
  113. package/es/contract/compiler/Http.mjs +118 -0
  114. package/es/contract/compiler/Http.mjs.map +1 -0
  115. package/es/contract/compiler/HttpNode.d.ts +17 -0
  116. package/es/contract/compiler/HttpNode.mjs +26 -0
  117. package/es/contract/compiler/HttpNode.mjs.map +1 -0
  118. package/es/contract/compiler/getFileSystem.d.ts +6 -0
  119. package/es/contract/compiler/getFileSystem.mjs +40 -0
  120. package/es/contract/compiler/getFileSystem.mjs.map +1 -0
  121. package/es/contract/ga.d.ts +9 -34
  122. package/es/contract/ga.mjs +29 -112
  123. package/es/contract/ga.mjs.map +1 -1
  124. package/es/index-browser.d.ts +39 -0
  125. package/es/index-browser.mjs +55 -0
  126. package/es/index-browser.mjs.map +1 -0
  127. package/es/index.d.ts +4 -35
  128. package/es/index.mjs +4 -51
  129. package/es/index.mjs.map +1 -1
  130. package/es/oracle.d.ts +5 -5
  131. package/es/oracle.mjs +34 -40
  132. package/es/oracle.mjs.map +1 -1
  133. package/es/spend.d.ts +3 -3
  134. package/es/spend.mjs +18 -23
  135. package/es/spend.mjs.map +1 -1
  136. package/es/tx/builder/constants.d.ts +30 -2
  137. package/es/tx/builder/constants.mjs +43 -14
  138. package/es/tx/builder/constants.mjs.map +1 -1
  139. package/es/tx/builder/field-types/abi-version.d.ts +10 -0
  140. package/es/tx/builder/field-types/abi-version.mjs +20 -0
  141. package/es/tx/builder/field-types/abi-version.mjs.map +1 -0
  142. package/es/tx/builder/field-types/address.d.ts +14 -0
  143. package/es/tx/builder/field-types/address.mjs +51 -0
  144. package/es/tx/builder/field-types/address.mjs.map +1 -0
  145. package/es/tx/builder/field-types/array.d.ts +7 -0
  146. package/es/tx/builder/field-types/array.mjs +11 -0
  147. package/es/tx/builder/field-types/array.mjs.map +1 -0
  148. package/es/tx/builder/field-types/boolean.d.ts +6 -0
  149. package/es/tx/builder/field-types/boolean.mjs +13 -0
  150. package/es/tx/builder/field-types/boolean.mjs.map +1 -0
  151. package/es/tx/builder/field-types/coin-amount.d.ts +2 -3
  152. package/es/tx/builder/field-types/coin-amount.mjs +4 -12
  153. package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
  154. package/es/tx/builder/field-types/ct-version.d.ts +30 -0
  155. package/es/tx/builder/field-types/ct-version.mjs +48 -0
  156. package/es/tx/builder/field-types/ct-version.mjs.map +1 -0
  157. package/es/tx/builder/field-types/deposit.d.ts +1 -2
  158. package/es/tx/builder/field-types/deposit.mjs +2 -4
  159. package/es/tx/builder/field-types/deposit.mjs.map +1 -1
  160. package/es/tx/builder/field-types/encoded.d.ts +6 -0
  161. package/es/tx/builder/field-types/encoded.mjs +21 -0
  162. package/es/tx/builder/field-types/encoded.mjs.map +1 -0
  163. package/es/tx/builder/field-types/entry.d.ts +11 -0
  164. package/es/tx/builder/field-types/entry.mjs +31 -0
  165. package/es/tx/builder/field-types/entry.mjs.map +1 -0
  166. package/es/tx/builder/field-types/enumeration.d.ts +7 -0
  167. package/es/tx/builder/field-types/enumeration.mjs +30 -0
  168. package/es/tx/builder/field-types/enumeration.mjs.map +1 -0
  169. package/es/tx/builder/field-types/fee.d.ts +10 -15
  170. package/es/tx/builder/field-types/fee.mjs +31 -43
  171. package/es/tx/builder/field-types/fee.mjs.map +1 -1
  172. package/es/tx/builder/field-types/field.mjs +0 -2
  173. package/es/tx/builder/field-types/field.mjs.map +1 -1
  174. package/es/tx/builder/field-types/gas-limit.d.ts +5 -2
  175. package/es/tx/builder/field-types/gas-limit.mjs +12 -14
  176. package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
  177. package/es/tx/builder/field-types/gas-price.d.ts +1 -2
  178. package/es/tx/builder/field-types/gas-price.mjs +3 -7
  179. package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
  180. package/es/tx/builder/field-types/index.d.ts +80 -30
  181. package/es/tx/builder/field-types/index.mjs +34 -9
  182. package/es/tx/builder/field-types/index.mjs.map +1 -1
  183. package/es/tx/builder/field-types/mptree.d.ts +37 -0
  184. package/es/tx/builder/field-types/mptree.mjs +268 -0
  185. package/es/tx/builder/field-types/mptree.mjs.map +1 -0
  186. package/es/tx/builder/field-types/name-fee.d.ts +1 -3
  187. package/es/tx/builder/field-types/name-fee.mjs +3 -5
  188. package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
  189. package/es/tx/builder/field-types/name-id.d.ts +1 -4
  190. package/es/tx/builder/field-types/name-id.mjs +5 -10
  191. package/es/tx/builder/field-types/name-id.mjs.map +1 -1
  192. package/es/tx/builder/field-types/name.mjs +0 -2
  193. package/es/tx/builder/field-types/name.mjs.map +1 -1
  194. package/es/tx/builder/field-types/pointers.d.ts +23 -0
  195. package/es/tx/builder/field-types/pointers.mjs +36 -0
  196. package/es/tx/builder/field-types/pointers.mjs.map +1 -0
  197. package/es/tx/builder/field-types/raw.d.ts +6 -0
  198. package/es/tx/builder/field-types/raw.mjs +13 -0
  199. package/es/tx/builder/field-types/raw.mjs.map +1 -0
  200. package/es/tx/builder/field-types/short-u-int-const.d.ts +5 -0
  201. package/es/tx/builder/field-types/short-u-int-const.mjs +16 -0
  202. package/es/tx/builder/field-types/short-u-int-const.mjs.map +1 -0
  203. package/es/tx/builder/field-types/short-u-int.mjs +0 -2
  204. package/es/tx/builder/field-types/short-u-int.mjs.map +1 -1
  205. package/es/tx/builder/field-types/string.d.ts +6 -0
  206. package/es/tx/builder/field-types/string.mjs +10 -0
  207. package/es/tx/builder/field-types/string.mjs.map +1 -0
  208. package/es/tx/builder/field-types/u-int.d.ts +1 -2
  209. package/es/tx/builder/field-types/u-int.mjs +3 -4
  210. package/es/tx/builder/field-types/u-int.mjs.map +1 -1
  211. package/es/tx/builder/helpers.d.ts +2 -32
  212. package/es/tx/builder/helpers.mjs +19 -71
  213. package/es/tx/builder/helpers.mjs.map +1 -1
  214. package/es/tx/builder/index.d.ts +11 -49
  215. package/es/tx/builder/index.mjs +57 -337
  216. package/es/tx/builder/index.mjs.map +1 -1
  217. package/es/tx/builder/schema.d.ts +2367 -667
  218. package/es/tx/builder/schema.mjs +70 -145
  219. package/es/tx/builder/schema.mjs.map +1 -1
  220. package/es/tx/index.d.ts +4 -49
  221. package/es/tx/index.mjs +38 -112
  222. package/es/tx/index.mjs.map +1 -1
  223. package/es/tx/validator.d.ts +4 -6
  224. package/es/tx/validator.mjs +104 -90
  225. package/es/tx/validator.mjs.map +1 -1
  226. package/es/typings/{@aeternity__argon2-browser → @aeternity__aepp-calldata}/index.d.mjs +0 -0
  227. package/es/typings/@aeternity__aepp-calldata/index.d.mjs.map +1 -0
  228. package/es/utils/amount-formatter.mjs +4 -10
  229. package/es/utils/amount-formatter.mjs.map +1 -1
  230. package/es/utils/autorest.d.ts +1 -0
  231. package/es/utils/autorest.mjs +17 -19
  232. package/es/utils/autorest.mjs.map +1 -1
  233. package/es/utils/bignumber.mjs +4 -7
  234. package/es/utils/bignumber.mjs.map +1 -1
  235. package/es/utils/bytes.d.ts +0 -17
  236. package/es/utils/bytes.mjs +6 -35
  237. package/es/utils/bytes.mjs.map +1 -1
  238. package/es/utils/crypto.d.ts +15 -8
  239. package/es/utils/crypto.mjs +40 -40
  240. package/es/utils/crypto.mjs.map +1 -1
  241. package/es/utils/encoder-types.d.ts +28 -28
  242. package/es/utils/encoder-types.mjs +0 -1
  243. package/es/utils/encoder-types.mjs.map +1 -1
  244. package/es/utils/encoder.d.ts +0 -1
  245. package/es/utils/encoder.mjs +7 -15
  246. package/es/utils/encoder.mjs.map +1 -1
  247. package/es/utils/errors.d.ts +15 -14
  248. package/es/utils/errors.mjs +86 -172
  249. package/es/utils/errors.mjs.map +1 -1
  250. package/es/utils/hd-wallet.d.ts +27 -19
  251. package/es/utils/hd-wallet.mjs +42 -26
  252. package/es/utils/hd-wallet.mjs.map +1 -1
  253. package/es/utils/json-big.mjs +0 -8
  254. package/es/utils/json-big.mjs.map +1 -1
  255. package/es/utils/keystore.d.ts +2 -0
  256. package/es/utils/keystore.mjs +37 -36
  257. package/es/utils/keystore.mjs.map +1 -1
  258. package/es/utils/other.d.ts +4 -2
  259. package/es/utils/other.mjs +11 -7
  260. package/es/utils/other.mjs.map +1 -1
  261. package/es/utils/semver-satisfies.mjs +0 -3
  262. package/es/utils/semver-satisfies.mjs.map +1 -1
  263. package/es/utils/string.d.ts +0 -12
  264. package/es/utils/string.mjs +1 -21
  265. package/es/utils/string.mjs.map +1 -1
  266. package/package.json +98 -51
  267. package/src/AeSdk.ts +15 -11
  268. package/src/AeSdkAepp.ts +9 -7
  269. package/src/AeSdkBase.ts +31 -202
  270. package/src/AeSdkMethods.ts +169 -0
  271. package/src/AeSdkWallet.ts +16 -47
  272. package/src/Node.ts +17 -18
  273. package/src/account/Base.ts +29 -75
  274. package/src/account/Generalized.ts +98 -0
  275. package/src/account/Ledger.ts +131 -0
  276. package/src/account/LedgerFactory.ts +86 -0
  277. package/src/account/Memory.ts +46 -60
  278. package/src/account/Rpc.ts +17 -26
  279. package/src/aens.ts +13 -11
  280. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +21 -9
  281. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +3 -3
  282. package/src/aepp-wallet-communication/rpc/RpcClient.ts +4 -4
  283. package/src/aepp-wallet-communication/rpc/types.ts +11 -1
  284. package/src/aepp-wallet-communication/schema.ts +18 -18
  285. package/src/apis/compiler/code-model-v4.yaml +681 -888
  286. package/src/apis/compiler/compiler.ts +113 -154
  287. package/src/apis/compiler/models/index.ts +80 -140
  288. package/src/apis/compiler/models/mappers.ts +165 -183
  289. package/src/apis/compiler/models/parameters.ts +6 -12
  290. package/src/chain.ts +11 -6
  291. package/src/channel/Base.ts +335 -0
  292. package/src/channel/Contract.ts +488 -0
  293. package/src/channel/Spend.ts +408 -0
  294. package/src/channel/handlers.ts +164 -582
  295. package/src/channel/internal.ts +114 -143
  296. package/src/contract/Contract.ts +610 -0
  297. package/src/contract/compiler/Base.ts +94 -0
  298. package/src/contract/compiler/Cli.ts +134 -0
  299. package/src/contract/compiler/Http.ts +124 -0
  300. package/src/contract/compiler/HttpNode.ts +26 -0
  301. package/src/contract/compiler/getFileSystem.ts +42 -0
  302. package/src/contract/ga.ts +23 -106
  303. package/src/index-browser.ts +58 -0
  304. package/src/index.ts +4 -55
  305. package/src/oracle.ts +8 -8
  306. package/src/spend.ts +6 -14
  307. package/src/tx/builder/constants.ts +33 -3
  308. package/src/tx/builder/field-types/abi-version.ts +21 -0
  309. package/src/tx/builder/field-types/address.ts +62 -0
  310. package/src/tx/builder/field-types/array.ts +19 -0
  311. package/src/tx/builder/field-types/boolean.ts +9 -0
  312. package/src/tx/builder/field-types/coin-amount.ts +4 -9
  313. package/src/tx/builder/field-types/ct-version.ts +50 -0
  314. package/src/tx/builder/field-types/deposit.ts +1 -1
  315. package/src/tx/builder/field-types/encoded.ts +27 -0
  316. package/src/tx/builder/field-types/entry.ts +31 -0
  317. package/src/tx/builder/field-types/enumeration.ts +32 -0
  318. package/src/tx/builder/field-types/fee.ts +39 -21
  319. package/src/tx/builder/field-types/gas-limit.ts +13 -8
  320. package/src/tx/builder/field-types/gas-price.ts +0 -2
  321. package/src/tx/builder/field-types/index.ts +54 -15
  322. package/src/tx/builder/field-types/mptree.ts +242 -0
  323. package/src/tx/builder/field-types/name-fee.ts +2 -3
  324. package/src/tx/builder/field-types/name-id.ts +7 -10
  325. package/src/tx/builder/field-types/pointers.ts +41 -0
  326. package/src/tx/builder/field-types/raw.ts +9 -0
  327. package/src/tx/builder/field-types/short-u-int-const.ts +20 -0
  328. package/src/tx/builder/field-types/string.ts +11 -0
  329. package/src/tx/builder/field-types/u-int.ts +4 -5
  330. package/src/tx/builder/helpers.ts +10 -60
  331. package/src/tx/builder/index.ts +65 -308
  332. package/src/tx/builder/schema.ts +280 -341
  333. package/src/tx/index.ts +40 -103
  334. package/src/tx/validator.ts +91 -96
  335. package/src/typings/@aeternity__aepp-calldata/index.d.ts +20 -0
  336. package/src/utils/autorest.ts +16 -1
  337. package/src/utils/bytes.ts +6 -34
  338. package/src/utils/crypto.ts +23 -16
  339. package/src/utils/encoder.ts +0 -1
  340. package/src/utils/errors.ts +22 -25
  341. package/src/utils/hd-wallet.ts +30 -9
  342. package/src/utils/keystore.ts +24 -21
  343. package/src/utils/other.ts +16 -1
  344. package/src/utils/string.ts +0 -20
  345. package/types-legacy/ts4.2/AeSdk.d.ts +41 -0
  346. package/types-legacy/ts4.2/AeSdkAepp.d.ts +71 -0
  347. package/types-legacy/ts4.2/AeSdkBase.d.ts +91 -0
  348. package/types-legacy/ts4.2/AeSdkMethods.d.ts +140 -0
  349. package/types-legacy/ts4.2/AeSdkWallet.d.ts +90 -0
  350. package/types-legacy/ts4.2/Node.d.ts +78 -0
  351. package/types-legacy/ts4.2/account/Base.d.ts +52 -0
  352. package/types-legacy/ts4.2/account/Generalized.d.ts +16 -0
  353. package/types-legacy/ts4.2/account/Ledger.d.ts +28 -0
  354. package/types-legacy/ts4.2/account/LedgerFactory.d.ts +39 -0
  355. package/types-legacy/ts4.2/account/Memory.d.ts +22 -0
  356. package/types-legacy/ts4.2/account/Rpc.d.ts +25 -0
  357. package/types-legacy/ts4.2/aens.d.ts +222 -0
  358. package/types-legacy/ts4.2/aepp-wallet-communication/connection/Browser.d.ts +33 -0
  359. package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserRuntime.d.ts +19 -0
  360. package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +36 -0
  361. package/types-legacy/ts4.2/aepp-wallet-communication/connection-proxy.d.ts +11 -0
  362. package/types-legacy/ts4.2/aepp-wallet-communication/rpc/RpcClient.d.ts +34 -0
  363. package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +83 -0
  364. package/types-legacy/ts4.2/aepp-wallet-communication/schema.d.ts +133 -0
  365. package/types-legacy/ts4.2/aepp-wallet-communication/wallet-detector.d.ts +25 -0
  366. package/types-legacy/ts4.2/apis/compiler/compiler.d.ts +86 -0
  367. package/types-legacy/ts4.2/apis/compiler/index.d.ts +2 -0
  368. package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +195 -0
  369. package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +23 -0
  370. package/types-legacy/ts4.2/apis/compiler/models/parameters.d.ts +12 -0
  371. package/types-legacy/ts4.2/apis/node/index.d.ts +2 -0
  372. package/types-legacy/ts4.2/apis/node/models/index.d.ts +1065 -0
  373. package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +95 -0
  374. package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +17 -0
  375. package/types-legacy/ts4.2/apis/node/node.d.ts +215 -0
  376. package/types-legacy/ts4.2/chain.d.ts +256 -0
  377. package/types-legacy/ts4.2/channel/Base.d.ts +199 -0
  378. package/types-legacy/ts4.2/channel/Contract.d.ts +248 -0
  379. package/types-legacy/ts4.2/channel/Spend.d.ts +219 -0
  380. package/types-legacy/ts4.2/channel/handlers.d.ts +21 -0
  381. package/types-legacy/ts4.2/channel/internal.d.ts +107 -0
  382. package/types-legacy/ts4.2/contract/Contract.d.ts +212 -0
  383. package/types-legacy/ts4.2/contract/compiler/Base.d.ts +81 -0
  384. package/types-legacy/ts4.2/contract/compiler/Cli.d.ts +23 -0
  385. package/types-legacy/ts4.2/contract/compiler/Http.d.ts +32 -0
  386. package/types-legacy/ts4.2/contract/compiler/HttpNode.d.ts +17 -0
  387. package/types-legacy/ts4.2/contract/compiler/getFileSystem.d.ts +6 -0
  388. package/types-legacy/ts4.2/contract/ga.d.ts +44 -0
  389. package/types-legacy/ts4.2/globals.d.ts +16 -0
  390. package/types-legacy/ts4.2/index-browser.d.ts +39 -0
  391. package/types-legacy/ts4.2/index.d.ts +5 -0
  392. package/types-legacy/ts4.2/oracle.d.ts +161 -0
  393. package/types-legacy/ts4.2/spend.d.ts +62 -0
  394. package/types-legacy/ts4.2/tx/builder/constants.d.ts +98 -0
  395. package/types-legacy/ts4.2/tx/builder/field-types/abi-version.d.ts +10 -0
  396. package/types-legacy/ts4.2/tx/builder/field-types/address.d.ts +21 -0
  397. package/types-legacy/ts4.2/tx/builder/field-types/array.d.ts +7 -0
  398. package/types-legacy/ts4.2/tx/builder/field-types/boolean.d.ts +6 -0
  399. package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +12 -0
  400. package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +42 -0
  401. package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +14 -0
  402. package/types-legacy/ts4.2/tx/builder/field-types/encoded.d.ts +6 -0
  403. package/types-legacy/ts4.2/tx/builder/field-types/entry.d.ts +11 -0
  404. package/types-legacy/ts4.2/tx/builder/field-types/enumeration.d.ts +7 -0
  405. package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +20 -0
  406. package/types-legacy/ts4.2/tx/builder/field-types/field.d.ts +6 -0
  407. package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +15 -0
  408. package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +7 -0
  409. package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +129 -0
  410. package/types-legacy/ts4.2/tx/builder/field-types/mptree.d.ts +43 -0
  411. package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +18 -0
  412. package/types-legacy/ts4.2/tx/builder/field-types/name-id.d.ts +11 -0
  413. package/types-legacy/ts4.2/tx/builder/field-types/name.d.ts +13 -0
  414. package/types-legacy/ts4.2/tx/builder/field-types/pointers.d.ts +26 -0
  415. package/types-legacy/ts4.2/tx/builder/field-types/raw.d.ts +6 -0
  416. package/types-legacy/ts4.2/tx/builder/field-types/short-u-int-const.d.ts +5 -0
  417. package/types-legacy/ts4.2/tx/builder/field-types/short-u-int.d.ts +6 -0
  418. package/types-legacy/ts4.2/tx/builder/field-types/string.d.ts +6 -0
  419. package/types-legacy/ts4.2/tx/builder/field-types/u-int.d.ts +7 -0
  420. package/types-legacy/ts4.2/tx/builder/helpers.d.ts +112 -0
  421. package/types-legacy/ts4.2/tx/builder/index.d.ts +50 -0
  422. package/types-legacy/ts4.2/tx/builder/schema.d.ts +4675 -0
  423. package/types-legacy/ts4.2/tx/index.d.ts +19 -0
  424. package/types-legacy/ts4.2/tx/validator.d.ts +18 -0
  425. package/types-legacy/ts4.2/utils/amount-formatter.d.ts +42 -0
  426. package/types-legacy/ts4.2/utils/autorest.d.ts +7 -0
  427. package/types-legacy/ts4.2/utils/bignumber.d.ts +13 -0
  428. package/types-legacy/ts4.2/utils/bytes.d.ts +9 -0
  429. package/types-legacy/ts4.2/utils/crypto.d.ts +95 -0
  430. package/types-legacy/ts4.2/utils/encoder-types.d.ts +61 -0
  431. package/types-legacy/ts4.2/utils/encoder.d.ts +24 -0
  432. package/types-legacy/ts4.2/utils/errors.d.ts +475 -0
  433. package/types-legacy/ts4.2/utils/hd-wallet.d.ts +65 -0
  434. package/types-legacy/ts4.2/utils/json-big.d.ts +5 -0
  435. package/types-legacy/ts4.2/utils/keystore.d.ts +53 -0
  436. package/types-legacy/ts4.2/utils/other.d.ts +31 -0
  437. package/types-legacy/ts4.2/utils/semver-satisfies.d.ts +1 -0
  438. package/types-legacy/ts4.2/utils/string.d.ts +12 -0
  439. package/types-legacy/ts4.5/AeSdk.d.ts +41 -0
  440. package/types-legacy/ts4.5/AeSdkAepp.d.ts +71 -0
  441. package/types-legacy/ts4.5/AeSdkBase.d.ts +91 -0
  442. package/types-legacy/ts4.5/AeSdkMethods.d.ts +140 -0
  443. package/types-legacy/ts4.5/AeSdkWallet.d.ts +90 -0
  444. package/types-legacy/ts4.5/Node.d.ts +78 -0
  445. package/types-legacy/ts4.5/account/Base.d.ts +52 -0
  446. package/types-legacy/ts4.5/account/Generalized.d.ts +16 -0
  447. package/types-legacy/ts4.5/account/Ledger.d.ts +28 -0
  448. package/types-legacy/ts4.5/account/LedgerFactory.d.ts +39 -0
  449. package/types-legacy/ts4.5/account/Memory.d.ts +22 -0
  450. package/types-legacy/ts4.5/account/Rpc.d.ts +25 -0
  451. package/types-legacy/ts4.5/aens.d.ts +222 -0
  452. package/types-legacy/ts4.5/aepp-wallet-communication/connection/Browser.d.ts +33 -0
  453. package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserRuntime.d.ts +19 -0
  454. package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +36 -0
  455. package/types-legacy/ts4.5/aepp-wallet-communication/connection-proxy.d.ts +11 -0
  456. package/types-legacy/ts4.5/aepp-wallet-communication/rpc/RpcClient.d.ts +34 -0
  457. package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +83 -0
  458. package/types-legacy/ts4.5/aepp-wallet-communication/schema.d.ts +133 -0
  459. package/types-legacy/ts4.5/aepp-wallet-communication/wallet-detector.d.ts +25 -0
  460. package/types-legacy/ts4.5/apis/compiler/compiler.d.ts +86 -0
  461. package/types-legacy/ts4.5/apis/compiler/index.d.ts +2 -0
  462. package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +195 -0
  463. package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +23 -0
  464. package/types-legacy/ts4.5/apis/compiler/models/parameters.d.ts +12 -0
  465. package/types-legacy/ts4.5/apis/node/index.d.ts +2 -0
  466. package/types-legacy/ts4.5/apis/node/models/index.d.ts +1065 -0
  467. package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +95 -0
  468. package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +17 -0
  469. package/types-legacy/ts4.5/apis/node/node.d.ts +215 -0
  470. package/types-legacy/ts4.5/chain.d.ts +256 -0
  471. package/types-legacy/ts4.5/channel/Base.d.ts +199 -0
  472. package/types-legacy/ts4.5/channel/Contract.d.ts +248 -0
  473. package/types-legacy/ts4.5/channel/Spend.d.ts +219 -0
  474. package/types-legacy/ts4.5/channel/handlers.d.ts +21 -0
  475. package/types-legacy/ts4.5/channel/internal.d.ts +107 -0
  476. package/types-legacy/ts4.5/contract/Contract.d.ts +212 -0
  477. package/types-legacy/ts4.5/contract/compiler/Base.d.ts +81 -0
  478. package/types-legacy/ts4.5/contract/compiler/Cli.d.ts +23 -0
  479. package/types-legacy/ts4.5/contract/compiler/Http.d.ts +32 -0
  480. package/types-legacy/ts4.5/contract/compiler/HttpNode.d.ts +17 -0
  481. package/types-legacy/ts4.5/contract/compiler/getFileSystem.d.ts +6 -0
  482. package/types-legacy/ts4.5/contract/ga.d.ts +44 -0
  483. package/types-legacy/ts4.5/index-browser.d.ts +39 -0
  484. package/types-legacy/ts4.5/index.d.ts +4 -0
  485. package/types-legacy/ts4.5/oracle.d.ts +161 -0
  486. package/types-legacy/ts4.5/spend.d.ts +62 -0
  487. package/types-legacy/ts4.5/tx/builder/constants.d.ts +98 -0
  488. package/types-legacy/ts4.5/tx/builder/field-types/abi-version.d.ts +10 -0
  489. package/types-legacy/ts4.5/tx/builder/field-types/address.d.ts +21 -0
  490. package/types-legacy/ts4.5/tx/builder/field-types/array.d.ts +7 -0
  491. package/types-legacy/ts4.5/tx/builder/field-types/boolean.d.ts +6 -0
  492. package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +12 -0
  493. package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +42 -0
  494. package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +14 -0
  495. package/types-legacy/ts4.5/tx/builder/field-types/encoded.d.ts +6 -0
  496. package/types-legacy/ts4.5/tx/builder/field-types/entry.d.ts +11 -0
  497. package/types-legacy/ts4.5/tx/builder/field-types/enumeration.d.ts +7 -0
  498. package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +20 -0
  499. package/types-legacy/ts4.5/tx/builder/field-types/field.d.ts +6 -0
  500. package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +15 -0
  501. package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +7 -0
  502. package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +129 -0
  503. package/types-legacy/ts4.5/tx/builder/field-types/mptree.d.ts +43 -0
  504. package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +18 -0
  505. package/types-legacy/ts4.5/tx/builder/field-types/name-id.d.ts +11 -0
  506. package/types-legacy/ts4.5/tx/builder/field-types/name.d.ts +13 -0
  507. package/types-legacy/ts4.5/tx/builder/field-types/pointers.d.ts +26 -0
  508. package/types-legacy/ts4.5/tx/builder/field-types/raw.d.ts +6 -0
  509. package/types-legacy/ts4.5/tx/builder/field-types/short-u-int-const.d.ts +5 -0
  510. package/types-legacy/ts4.5/tx/builder/field-types/short-u-int.d.ts +6 -0
  511. package/types-legacy/ts4.5/tx/builder/field-types/string.d.ts +6 -0
  512. package/types-legacy/ts4.5/tx/builder/field-types/u-int.d.ts +7 -0
  513. package/types-legacy/ts4.5/tx/builder/helpers.d.ts +112 -0
  514. package/types-legacy/ts4.5/tx/builder/index.d.ts +50 -0
  515. package/types-legacy/ts4.5/tx/builder/schema.d.ts +4675 -0
  516. package/types-legacy/ts4.5/tx/index.d.ts +19 -0
  517. package/types-legacy/ts4.5/tx/validator.d.ts +18 -0
  518. package/types-legacy/ts4.5/utils/amount-formatter.d.ts +42 -0
  519. package/types-legacy/ts4.5/utils/autorest.d.ts +7 -0
  520. package/types-legacy/ts4.5/utils/bignumber.d.ts +13 -0
  521. package/types-legacy/ts4.5/utils/bytes.d.ts +9 -0
  522. package/types-legacy/ts4.5/utils/crypto.d.ts +95 -0
  523. package/types-legacy/ts4.5/utils/encoder-types.d.ts +61 -0
  524. package/types-legacy/ts4.5/utils/encoder.d.ts +24 -0
  525. package/types-legacy/ts4.5/utils/errors.d.ts +475 -0
  526. package/types-legacy/ts4.5/utils/hd-wallet.d.ts +65 -0
  527. package/types-legacy/ts4.5/utils/json-big.d.ts +5 -0
  528. package/types-legacy/ts4.5/utils/keystore.d.ts +53 -0
  529. package/types-legacy/ts4.5/utils/other.d.ts +31 -0
  530. package/types-legacy/ts4.5/utils/semver-satisfies.d.ts +1 -0
  531. package/types-legacy/ts4.5/utils/string.d.ts +12 -0
  532. package/es/channel/index.d.ts +0 -625
  533. package/es/channel/index.mjs +0 -975
  534. package/es/channel/index.mjs.map +0 -1
  535. package/es/contract/Compiler.d.ts +0 -18
  536. package/es/contract/Compiler.mjs +0 -68
  537. package/es/contract/Compiler.mjs.map +0 -1
  538. package/es/contract/aci.d.ts +0 -127
  539. package/es/contract/aci.mjs +0 -508
  540. package/es/contract/aci.mjs.map +0 -1
  541. package/es/contract/methods.d.ts +0 -71
  542. package/es/contract/methods.mjs +0 -104
  543. package/es/contract/methods.mjs.map +0 -1
  544. package/es/deprecated/index.d.ts +0 -143
  545. package/es/deprecated/index.mjs +0 -162
  546. package/es/deprecated/index.mjs.map +0 -1
  547. package/es/deprecated/methods.d.ts +0 -18
  548. package/es/deprecated/methods.mjs +0 -26
  549. package/es/deprecated/methods.mjs.map +0 -1
  550. package/es/tx/builder/address.d.ts +0 -25
  551. package/es/tx/builder/address.mjs +0 -45
  552. package/es/tx/builder/address.mjs.map +0 -1
  553. package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +0 -1
  554. package/es/utils/mptree.d.ts +0 -26
  555. package/es/utils/mptree.mjs +0 -165
  556. package/es/utils/mptree.mjs.map +0 -1
  557. package/src/channel/index.ts +0 -1025
  558. package/src/contract/Compiler.ts +0 -67
  559. package/src/contract/aci.ts +0 -537
  560. package/src/contract/methods.ts +0 -123
  561. package/src/deprecated/index.ts +0 -172
  562. package/src/deprecated/methods.ts +0 -25
  563. package/src/tx/builder/address.ts +0 -50
  564. package/src/typings/@aeternity__argon2-browser/index.d.ts +0 -3
  565. package/src/utils/mptree.ts +0 -145
@@ -1,25 +1,50 @@
1
- import _field from "./field.mjs";
2
- import _uInt from "./u-int.mjs";
3
- import _shortUInt from "./short-u-int.mjs";
1
+ import _abiVersion from "./abi-version.mjs";
2
+ import _address from "./address.mjs";
3
+ import _array from "./array.mjs";
4
+ import _boolean from "./boolean.mjs";
4
5
  import _coinAmount from "./coin-amount.mjs";
6
+ import _ctVersion from "./ct-version.mjs";
5
7
  import _deposit from "./deposit.mjs";
8
+ import _encoded from "./encoded.mjs";
9
+ import _entry from "./entry.mjs";
10
+ import _enumeration from "./enumeration.mjs";
6
11
  import _fee from "./fee.mjs";
12
+ import _field from "./field.mjs";
7
13
  import _gasLimit from "./gas-limit.mjs";
8
14
  import _gasPrice from "./gas-price.mjs";
15
+ import _mptree from "./mptree.mjs";
9
16
  import _name from "./name.mjs";
10
17
  import _nameFee from "./name-fee.mjs";
11
- import _nameId from "./name-id.mjs"; // TODO: remove after fixing https://github.com/Gerrit0/typedoc-plugin-missing-exports/issues/15
12
-
13
- const field = _field;
14
- const uInt = _uInt;
15
- const shortUInt = _shortUInt;
18
+ import _nameId from "./name-id.mjs";
19
+ import _pointers from "./pointers.mjs";
20
+ import _raw from "./raw.mjs";
21
+ import _shortUInt from "./short-u-int.mjs";
22
+ import _shortUIntConst from "./short-u-int-const.mjs";
23
+ import _string from "./string.mjs";
24
+ import _uInt from "./u-int.mjs"; // TODO: remove after fixing https://github.com/Gerrit0/typedoc-plugin-missing-exports/issues/15
25
+ const abiVersion = _abiVersion;
26
+ const address = _address;
27
+ const array = _array;
28
+ const boolean = _boolean;
16
29
  const coinAmount = _coinAmount;
30
+ const ctVersion = _ctVersion;
17
31
  const deposit = _deposit;
32
+ const encoded = _encoded;
33
+ const entry = _entry;
34
+ const enumeration = _enumeration;
18
35
  const fee = _fee;
36
+ const field = _field;
19
37
  const gasLimit = _gasLimit;
20
38
  const gasPrice = _gasPrice;
39
+ const mptree = _mptree;
21
40
  const name = _name;
22
41
  const nameFee = _nameFee;
23
42
  const nameId = _nameId;
24
- export { field, uInt, shortUInt, coinAmount, deposit, fee, gasLimit, gasPrice, name, nameFee, nameId };
43
+ const pointers = _pointers;
44
+ const raw = _raw;
45
+ const shortUInt = _shortUInt;
46
+ const shortUIntConst = _shortUIntConst;
47
+ const string = _string;
48
+ const uInt = _uInt;
49
+ export { abiVersion, address, array, boolean, coinAmount, ctVersion, deposit, encoded, entry, enumeration, fee, field, gasLimit, gasPrice, mptree, name, nameFee, nameId, pointers, raw, shortUInt, shortUIntConst, string, uInt };
25
50
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_field","_uInt","_shortUInt","_coinAmount","_deposit","_fee","_gasLimit","_gasPrice","_name","_nameFee","_nameId","field","uInt","shortUInt","coinAmount","deposit","fee","gasLimit","gasPrice","name","nameFee","nameId"],"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';\n\nimport _deposit from './deposit';\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';\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;\n\nconst deposit = _deposit;\nconst fee = _fee;\nconst gasLimit = _gasLimit;\nconst gasPrice = _gasPrice;\nconst name = _name;\nconst nameFee = _nameFee;\nconst nameId = _nameId;\n\nexport type Field = typeof field | typeof uInt | typeof shortUInt | typeof coinAmount\n | typeof deposit | typeof fee | typeof gasLimit | typeof gasPrice | typeof name | typeof nameFee\n | typeof nameId;\n\nexport {\n field,\n uInt,\n shortUInt,\n coinAmount,\n\n deposit,\n fee,\n gasLimit,\n gasPrice,\n name,\n nameFee,\n nameId,\n};\n"],"mappings":"OAAOA,M;OACAC,K;OACAC,U;OACAC,W;OAEAC,Q;OACAC,I;OACAC,S;OACAC,S;OACAC,K;OACAC,Q;OACAC,O,uBAEP;;AACA,MAAMC,KAAK,GAAGX,MAAd;AACA,MAAMY,IAAI,GAAGX,KAAb;AACA,MAAMY,SAAS,GAAGX,UAAlB;AACA,MAAMY,UAAU,GAAGX,WAAnB;AAEA,MAAMY,OAAO,GAAGX,QAAhB;AACA,MAAMY,GAAG,GAAGX,IAAZ;AACA,MAAMY,QAAQ,GAAGX,SAAjB;AACA,MAAMY,QAAQ,GAAGX,SAAjB;AACA,MAAMY,IAAI,GAAGX,KAAb;AACA,MAAMY,OAAO,GAAGX,QAAhB;AACA,MAAMY,MAAM,GAAGX,OAAf;AAMA,SACEC,KADF,EAEEC,IAFF,EAGEC,SAHF,EAIEC,UAJF,EAMEC,OANF,EAOEC,GAPF,EAQEC,QARF,EASEC,QATF,EAUEC,IAVF,EAWEC,OAXF,EAYEC,MAZF"}
1
+ {"version":3,"file":"index.mjs","names":["_abiVersion","_address","_array","_boolean","_coinAmount","_ctVersion","_deposit","_encoded","_entry","_enumeration","_fee","_field","_gasLimit","_gasPrice","_mptree","_name","_nameFee","_nameId","_pointers","_raw","_shortUInt","_shortUIntConst","_string","_uInt","abiVersion","address","array","boolean","coinAmount","ctVersion","deposit","encoded","entry","enumeration","fee","field","gasLimit","gasPrice","mptree","name","nameFee","nameId","pointers","raw","shortUInt","shortUIntConst","string","uInt"],"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 _mptree from './mptree';\nimport _name from './name';\nimport _nameFee from './name-fee';\nimport _nameId from './name-id';\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 _uInt from './u-int';\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 mptree = _mptree;\nconst name = _name;\nconst nameFee = _nameFee;\nconst nameId = _nameId;\nconst pointers = _pointers;\nconst raw = _raw;\nconst shortUInt = _shortUInt;\nconst shortUIntConst = _shortUIntConst;\nconst string = _string;\nconst uInt = _uInt;\n\nexport type BinaryData = Buffer | Buffer[] | Buffer[][]\n| Array<[Buffer, Array<[Buffer, Buffer[]]>]>;\nexport interface Field {\n serialize: (value: any, options: any) => BinaryData;\n deserialize: (value: BinaryData, options: any) => any;\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 mptree,\n name,\n nameFee,\n nameId,\n pointers,\n raw,\n shortUInt,\n shortUIntConst,\n string,\n uInt,\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,OAAO;AAAA,OACPC,KAAK;AAAA,OACLC,QAAQ;AAAA,OACRC,OAAO;AAAA,OACPC,SAAS;AAAA,OACTC,IAAI;AAAA,OACJC,UAAU;AAAA,OACVC,eAAe;AAAA,OACfC,OAAO;AAAA,OACPC,KAAK,qBAEZ;AACA,MAAMC,UAAU,GAAGxB,WAAW;AAC9B,MAAMyB,OAAO,GAAGxB,QAAQ;AACxB,MAAMyB,KAAK,GAAGxB,MAAM;AACpB,MAAMyB,OAAO,GAAGxB,QAAQ;AACxB,MAAMyB,UAAU,GAAGxB,WAAW;AAC9B,MAAMyB,SAAS,GAAGxB,UAAU;AAC5B,MAAMyB,OAAO,GAAGxB,QAAQ;AACxB,MAAMyB,OAAO,GAAGxB,QAAQ;AACxB,MAAMyB,KAAK,GAAGxB,MAAM;AACpB,MAAMyB,WAAW,GAAGxB,YAAY;AAChC,MAAMyB,GAAG,GAAGxB,IAAI;AAChB,MAAMyB,KAAK,GAAGxB,MAAM;AACpB,MAAMyB,QAAQ,GAAGxB,SAAS;AAC1B,MAAMyB,QAAQ,GAAGxB,SAAS;AAC1B,MAAMyB,MAAM,GAAGxB,OAAO;AACtB,MAAMyB,IAAI,GAAGxB,KAAK;AAClB,MAAMyB,OAAO,GAAGxB,QAAQ;AACxB,MAAMyB,MAAM,GAAGxB,OAAO;AACtB,MAAMyB,QAAQ,GAAGxB,SAAS;AAC1B,MAAMyB,GAAG,GAAGxB,IAAI;AAChB,MAAMyB,SAAS,GAAGxB,UAAU;AAC5B,MAAMyB,cAAc,GAAGxB,eAAe;AACtC,MAAMyB,MAAM,GAAGxB,OAAO;AACtB,MAAMyB,IAAI,GAAGxB,KAAK;AASlB,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,MAAM,EACNC,IAAI,EACJC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,GAAG,EACHC,SAAS,EACTC,cAAc,EACdC,MAAM,EACNC,IAAI"}
@@ -0,0 +1,37 @@
1
+ /// <reference types="node" />
2
+ import { Tag } from '../constants';
3
+ import { Encoded, Encoding } from '../../../utils/encoder';
4
+ import type { unpackTx } from '..';
5
+ type MPTreeBinary = [Buffer, Array<[Buffer, Buffer[]]>];
6
+ declare class MPTree<E extends Encoding, T extends Tag> {
7
+ #private;
8
+ get isComplete(): boolean;
9
+ /**
10
+ * Deserialize Merkle Patricia Tree
11
+ * @param binary - Binary
12
+ * @param tag - Tag to use to decode value
13
+ * @param unpTx - Implementation of unpackTx use to decode values
14
+ * @returns Merkle Patricia Tree
15
+ */
16
+ constructor(binary: MPTreeBinary, encoding: E, tag: T, unpTx: typeof unpackTx);
17
+ isEqual(tree: MPTree<E, T>): boolean;
18
+ /**
19
+ * Serialize Merkle Patricia Tree
20
+ * @returns Binary
21
+ */
22
+ serialize(): MPTreeBinary;
23
+ /**
24
+ * Retrieve value from Merkle Patricia Tree
25
+ * @param key - The key of the element to retrieve
26
+ * @returns Value associated to the specified key
27
+ */
28
+ get(key: Encoded.Generic<E>): ReturnType<typeof unpackTx<T>> | undefined;
29
+ toObject(): Record<Encoded.Any, ReturnType<typeof unpackTx<T>>>;
30
+ }
31
+ export default function genMPTreeField<E extends Encoding, T extends Tag>(encoding: E, tag: T): {
32
+ serialize: (value: MPTree<E, T>) => MPTreeBinary;
33
+ deserialize: (value: MPTreeBinary, o: {
34
+ unpackTx: typeof unpackTx;
35
+ }) => MPTree<E, T>;
36
+ };
37
+ export {};
@@ -0,0 +1,268 @@
1
+ import _buffer from "buffer";
2
+ const {
3
+ Buffer: _Buffer
4
+ } = _buffer;
5
+ import _classPrivateFieldSet from "@babel/runtime-corejs3/helpers/classPrivateFieldSet";
6
+ import _classPrivateFieldGet from "@babel/runtime-corejs3/helpers/classPrivateFieldGet";
7
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
8
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
9
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
10
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
11
+ function _classStaticPrivateMethodGet(receiver, classConstructor, method) { _classCheckPrivateStaticAccess(receiver, classConstructor); return method; }
12
+ function _classCheckPrivateStaticAccess(receiver, classConstructor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } }
13
+ import _rlp from 'rlp';
14
+ const {
15
+ encode: rlpEncode
16
+ } = _rlp;
17
+ import { hash } from "../../../utils/crypto.mjs";
18
+ import { MerkleTreeHashMismatchError, MissingNodeInTreeError, UnknownPathNibbleError, UnexpectedTsError, UnknownNodeLengthError, InternalError } from "../../../utils/errors.mjs";
19
+ import { decode, encode, Encoding } from "../../../utils/encoder.mjs";
20
+ var NodeType;
21
+ (function (NodeType) {
22
+ NodeType[NodeType["Branch"] = 0] = "Branch";
23
+ NodeType[NodeType["Extension"] = 1] = "Extension";
24
+ NodeType[NodeType["Leaf"] = 2] = "Leaf";
25
+ })(NodeType || (NodeType = {}));
26
+ var _rootHash = /*#__PURE__*/new WeakMap();
27
+ var _isComplete = /*#__PURE__*/new WeakMap();
28
+ var _nodes = /*#__PURE__*/new WeakMap();
29
+ var _encoding = /*#__PURE__*/new WeakMap();
30
+ var _tag = /*#__PURE__*/new WeakMap();
31
+ var _unpackTx = /*#__PURE__*/new WeakMap();
32
+ var _getRaw = /*#__PURE__*/new WeakSet();
33
+ var _entriesRaw = /*#__PURE__*/new WeakSet();
34
+ class MPTree {
35
+ get isComplete() {
36
+ return _classPrivateFieldGet(this, _isComplete);
37
+ }
38
+ /**
39
+ * Deserialize Merkle Patricia Tree
40
+ * @param binary - Binary
41
+ * @param tag - Tag to use to decode value
42
+ * @param unpTx - Implementation of unpackTx use to decode values
43
+ * @returns Merkle Patricia Tree
44
+ */
45
+ constructor(binary, encoding, tag, unpTx) {
46
+ _classPrivateMethodInitSpec(this, _entriesRaw);
47
+ _classPrivateMethodInitSpec(this, _getRaw);
48
+ _classPrivateFieldInitSpec(this, _rootHash, {
49
+ writable: true,
50
+ value: void 0
51
+ });
52
+ _classPrivateFieldInitSpec(this, _isComplete, {
53
+ writable: true,
54
+ value: true
55
+ });
56
+ _classPrivateFieldInitSpec(this, _nodes, {
57
+ writable: true,
58
+ value: void 0
59
+ });
60
+ _classPrivateFieldInitSpec(this, _encoding, {
61
+ writable: true,
62
+ value: void 0
63
+ });
64
+ _classPrivateFieldInitSpec(this, _tag, {
65
+ writable: true,
66
+ value: void 0
67
+ });
68
+ _classPrivateFieldInitSpec(this, _unpackTx, {
69
+ writable: true,
70
+ value: void 0
71
+ });
72
+ _classPrivateFieldSet(this, _encoding, encoding);
73
+ _classPrivateFieldSet(this, _tag, tag);
74
+ _classPrivateFieldSet(this, _unpackTx, unpTx);
75
+ _classPrivateFieldSet(this, _rootHash, binary[0].toString('hex'));
76
+ _classPrivateFieldSet(this, _nodes, Object.fromEntries(binary[1].map(node => [node[0].toString('hex'), node[1]])));
77
+ if (_classPrivateFieldGet(this, _nodes)[_classPrivateFieldGet(this, _rootHash)] == null) {
78
+ if (Object.keys(_classPrivateFieldGet(this, _nodes)).length !== 0) {
79
+ throw new MissingNodeInTreeError('Can\'t find a node by root hash');
80
+ }
81
+ _classPrivateFieldSet(this, _isComplete, false);
82
+ return;
83
+ }
84
+ Object.entries(_classPrivateFieldGet(this, _nodes)).forEach(_ref => {
85
+ let [key, node] = _ref;
86
+ if (_classStaticPrivateMethodGet(MPTree, MPTree, _nodeHash).call(MPTree, node) !== key) throw new MerkleTreeHashMismatchError();
87
+ const {
88
+ type
89
+ } = _classStaticPrivateMethodGet(MPTree, MPTree, _parseNode).call(MPTree, node);
90
+ switch (type) {
91
+ case NodeType.Branch:
92
+ node.slice(0, 16).filter(n => n.length).forEach(n => {
93
+ // TODO: enable after resolving https://github.com/aeternity/aeternity/issues/4066
94
+ // if (n.length !== 32) {
95
+ // throw new ArgumentError('MPTree branch item length', 32, n.length);
96
+ // }
97
+ if (_classPrivateFieldGet(this, _nodes)[n.toString('hex')] == null) _classPrivateFieldSet(this, _isComplete, false);
98
+ });
99
+ break;
100
+ case NodeType.Extension:
101
+ if (_classPrivateFieldGet(this, _nodes)[node[1].toString('hex')] == null) {
102
+ throw new MissingNodeInTreeError('Can\'t find a node by hash in extension node');
103
+ }
104
+ break;
105
+ case NodeType.Leaf:
106
+ break;
107
+ default:
108
+ throw new InternalError(`Unknown MPTree node type: ${type}`);
109
+ }
110
+ });
111
+ }
112
+ isEqual(tree) {
113
+ return _classPrivateFieldGet(this, _rootHash) === _classPrivateFieldGet(tree, _rootHash);
114
+ }
115
+ /**
116
+ * Serialize Merkle Patricia Tree
117
+ * @returns Binary
118
+ */
119
+ serialize() {
120
+ return [_Buffer.from(_classPrivateFieldGet(this, _rootHash), 'hex'), Object.entries(_classPrivateFieldGet(this, _nodes)).map(_ref2 => {
121
+ let [mptHash, value] = _ref2;
122
+ return [_Buffer.from(mptHash, 'hex'), value];
123
+ })];
124
+ }
125
+
126
+ /**
127
+ * Retrieve value from Merkle Patricia Tree
128
+ * @param _key - The key of the element to retrieve
129
+ * @returns Value associated to the specified key
130
+ */
131
+
132
+ /**
133
+ * Retrieve value from Merkle Patricia Tree
134
+ * @param key - The key of the element to retrieve
135
+ * @returns Value associated to the specified key
136
+ */
137
+ get(key) {
138
+ const d = _classPrivateMethodGet(this, _getRaw, _getRaw2).call(this, decode(key).toString('hex'));
139
+ if (d == null) return d;
140
+ return _classPrivateFieldGet(this, _unpackTx).call(this, encode(d, Encoding.Transaction), _classPrivateFieldGet(this, _tag));
141
+ }
142
+ toObject() {
143
+ return Object.fromEntries(_classPrivateMethodGet(this, _entriesRaw, _entriesRaw2).call(this) // TODO: remove after resolving https://github.com/aeternity/aeternity/issues/4066
144
+ .filter(_ref3 => {
145
+ let [k] = _ref3;
146
+ return _classPrivateFieldGet(this, _encoding) !== Encoding.ContractAddress || k.length !== 66;
147
+ }).map(_ref4 => {
148
+ let [k, v] = _ref4;
149
+ return [encode(_Buffer.from(k, 'hex'), _classPrivateFieldGet(this, _encoding)), _classPrivateFieldGet(this, _unpackTx).call(this, encode(v, Encoding.Transaction), _classPrivateFieldGet(this, _tag))];
150
+ }));
151
+ }
152
+ }
153
+ function _nodeHash(node) {
154
+ return _Buffer.from(hash(rlpEncode(node))).toString('hex');
155
+ }
156
+ function _parseNode(node) {
157
+ switch (node.length) {
158
+ case 17:
159
+ return {
160
+ type: NodeType.Branch,
161
+ ...(node[16].length !== 0 && {
162
+ value: node[16]
163
+ })
164
+ };
165
+ case 2:
166
+ {
167
+ const nibble = node[0][0] >> 4; // eslint-disable-line no-bitwise
168
+ if (nibble > 3) throw new UnknownPathNibbleError(nibble);
169
+ const type = nibble <= 1 ? NodeType.Extension : NodeType.Leaf;
170
+ const slice = [0, 2].includes(nibble) ? 2 : 1;
171
+ return {
172
+ type,
173
+ ...(type === NodeType.Leaf && {
174
+ value: node[1]
175
+ }),
176
+ path: node[0].toString('hex').slice(slice)
177
+ };
178
+ }
179
+ default:
180
+ throw new UnknownNodeLengthError(node.length);
181
+ }
182
+ }
183
+ function _getRaw2(_key) {
184
+ let searchFrom = _classPrivateFieldGet(this, _rootHash);
185
+ let key = _key;
186
+ while (true) {
187
+ // eslint-disable-line no-constant-condition
188
+ const node = _classPrivateFieldGet(this, _nodes)[searchFrom];
189
+ if (node == null) {
190
+ if (!this.isComplete) return undefined;
191
+ throw new InternalError('Can\'t find node in complete tree');
192
+ }
193
+ const {
194
+ type,
195
+ value,
196
+ path
197
+ } = _classStaticPrivateMethodGet(MPTree, MPTree, _parseNode).call(MPTree, node);
198
+ switch (type) {
199
+ case NodeType.Branch:
200
+ if (key.length === 0) return value;
201
+ searchFrom = node[+`0x${key[0]}`].toString('hex');
202
+ key = key.substring(1);
203
+ break;
204
+ case NodeType.Extension:
205
+ if (key.substring(0, path === null || path === void 0 ? void 0 : path.length) !== path) return undefined;
206
+ searchFrom = node[1].toString('hex');
207
+ key = key.substring(path.length);
208
+ break;
209
+ case NodeType.Leaf:
210
+ if (path !== key) return undefined;
211
+ return value;
212
+ default:
213
+ throw new InternalError(`Unknown MPTree node type: ${type}`);
214
+ }
215
+ }
216
+ }
217
+ function _entriesRaw2() {
218
+ const entries = [];
219
+ const rec = (searchFrom, key) => {
220
+ const node = _classPrivateFieldGet(this, _nodes)[searchFrom];
221
+ if (node == null) {
222
+ if (!this.isComplete) return;
223
+ throw new InternalError('Can\'t find node in complete tree');
224
+ }
225
+ const {
226
+ type,
227
+ value,
228
+ path
229
+ } = _classStaticPrivateMethodGet(MPTree, MPTree, _parseNode).call(MPTree, node);
230
+ switch (type) {
231
+ case NodeType.Branch:
232
+ node.slice(0, 16).map((t, idx) => [t, idx]).filter(_ref6 => {
233
+ let [t] = _ref6;
234
+ return t.length;
235
+ }).forEach(_ref7 => {
236
+ let [t, idx] = _ref7;
237
+ return rec(t.toString('hex'), key + idx.toString(16));
238
+ });
239
+ if (value != null) entries.push([key, value]);
240
+ break;
241
+ case NodeType.Extension:
242
+ rec(node[1].toString('hex'), key + path);
243
+ break;
244
+ case NodeType.Leaf:
245
+ if (value == null) throw new UnexpectedTsError();
246
+ entries.push([key + path, value]);
247
+ break;
248
+ default:
249
+ throw new InternalError(`Unknown MPTree node type: ${type}`);
250
+ }
251
+ };
252
+ rec(_classPrivateFieldGet(this, _rootHash), '');
253
+ return entries;
254
+ }
255
+ export default function genMPTreeField(encoding, tag) {
256
+ return {
257
+ serialize(value) {
258
+ return value.serialize();
259
+ },
260
+ deserialize(value, _ref5) {
261
+ let {
262
+ unpackTx
263
+ } = _ref5;
264
+ return new MPTree(value, encoding, tag, unpackTx);
265
+ }
266
+ };
267
+ }
268
+ //# sourceMappingURL=mptree.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mptree.mjs","names":["hash","MerkleTreeHashMismatchError","MissingNodeInTreeError","UnknownPathNibbleError","UnexpectedTsError","UnknownNodeLengthError","InternalError","decode","encode","Encoding","NodeType","MPTree","isComplete","constructor","binary","encoding","tag","unpTx","toString","Object","fromEntries","map","node","keys","length","entries","forEach","key","type","Branch","slice","filter","n","Extension","Leaf","isEqual","tree","serialize","from","mptHash","value","get","d","Transaction","toObject","k","ContractAddress","v","rlpEncode","nibble","includes","path","_key","searchFrom","undefined","substring","rec","t","idx","push","genMPTreeField","deserialize","unpackTx"],"sources":["../../../../src/tx/builder/field-types/mptree.ts"],"sourcesContent":["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 '..';\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>): ReturnType<typeof unpackTx<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.Any, ReturnType<typeof unpackTx<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 ]));\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"],"mappings":";;;;;;;;;;;;AAAA,iBAA2C,KAAK;AAAC;EAAA;AAAA;AAAA,SAExCA,IAAI;AAAA,SAEXC,2BAA2B,EAC3BC,sBAAsB,EACtBC,sBAAsB,EACtBC,iBAAiB,EACjBC,sBAAsB,EACtBC,aAAa;AAAA,SAGbC,MAAM,EAAEC,MAAM,EAAWC,QAAQ;AAAA,IAI9BC,QAAQ;AAAA,WAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;AAAA,GAARA,QAAQ,KAARA,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQb,MAAMC,MAAM,CAAoC;EAK9C,IAAIC,UAAU,GAAY;IACxB,6BAAO,IAAI;EACb;EAcA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAW,CAACC,MAAoB,EAAEC,QAAW,EAAEC,GAAM,EAAEC,KAAsB,EAAE;IAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;MAAA;MAAA,OAzBjE;IAAI;IAAA;MAAA;MAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IA0BhB,0BAAI,aAAaF,QAAQ;IACzB,0BAAI,QAAQC,GAAG;IACf,0BAAI,a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AES,GAAG,GAAG+B,GAAG,CAACxC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAAA,EAAC;QACxE,IAAIsB,KAAK,IAAI,IAAI,EAAEf,OAAO,CAACkC,IAAI,CAAC,CAAChC,GAAG,EAAEa,KAAK,CAAC,CAAC;QAC7C;MACF,KAAK9B,QAAQ,CAACuB,SAAS;QACrBuB,GAAG,CAAClC,IAAI,CAAC,CAAC,CAAC,CAACJ,QAAQ,CAAC,KAAK,CAAC,EAAES,GAAG,GAAGwB,IAAI,CAAC;QACxC;MACF,KAAKzC,QAAQ,CAACwB,IAAI;QAChB,IAAIM,KAAK,IAAI,IAAI,EAAE,MAAM,IAAIpC,iBAAiB,EAAE;QAChDqB,OAAO,CAACkC,IAAI,CAAC,CAAChC,GAAG,GAAGwB,IAAI,EAAEX,KAAK,CAAC,CAAC;QACjC;MACF;QACE,MAAM,IAAIlC,aAAa,CAAE,6BAA4BsB,IAAK,EAAC,CAAC;IAAC;EAEnE,CAAC;EACD4B,GAAG,uBAAC,IAAI,cAAY,EAAE,CAAC;EACvB,OAAO/B,OAAO;AAChB;AAaF,eAAe,SAASmC,cAAc,CAAoC7C,QAAW,EAAEC,GAAM,EAG3F;EACA,OAAO;IACLqB,SAAS,CAACG,KAAK,EAAE;MACf,OAAOA,KAAK,CAACH,SAAS,EAAE;IAC1B,CAAC;IAEDwB,WAAW,CAACrB,KAAK,SAAgB;MAAA,IAAd;QAAEsB;MAAS,CAAC;MAC7B,OAAO,IAAInD,MAAM,CAAC6B,KAAK,EAAEzB,QAAQ,EAAEC,GAAG,EAAE8C,QAAQ,CAAC;IACnD;EACF,CAAC;AACH"}
@@ -1,7 +1,6 @@
1
1
  /// <reference types="node" />
2
- import { Int } from './u-int';
3
2
  import coinAmount from './coin-amount';
4
- import { AensName } from '../constants';
3
+ import { AensName, Int } from '../constants';
5
4
  declare const _default: {
6
5
  serializeAettos(_value: string | undefined, txFields: {
7
6
  name: AensName;
@@ -14,7 +13,6 @@ declare const _default: {
14
13
  serialize(value: Int | undefined, txFields: {
15
14
  name: AensName;
16
15
  } & Parameters<(typeof coinAmount)['serialize']>[1]): Buffer;
17
- serializeOptional(value: Int | undefined, { denomination, ...options }: import("./coin-amount").Options): Buffer;
18
16
  deserialize(value: Buffer): string;
19
17
  };
20
18
  export default _default;
@@ -2,23 +2,21 @@ import BigNumber from 'bignumber.js';
2
2
  import { getMinimumNameFee } from "../helpers.mjs";
3
3
  import { InsufficientNameFeeError } from "../../../utils/errors.mjs";
4
4
  import coinAmount from "./coin-amount.mjs";
5
- export default { ...coinAmount,
6
-
5
+ export default {
6
+ ...coinAmount,
7
7
  serializeAettos(_value, txFields) {
8
8
  const minNameFee = getMinimumNameFee(txFields.name);
9
9
  const value = new BigNumber(_value !== null && _value !== void 0 ? _value : minNameFee);
10
10
  if (minNameFee.gt(value)) throw new InsufficientNameFeeError(value, minNameFee);
11
11
  return value.toFixed();
12
12
  },
13
-
14
13
  /**
15
14
  * @param value - AENS name fee Buffer
16
15
  * @param txFields - Transaction fields
17
16
  * @param txFields.name - AENS Name in transaction
18
17
  */
19
18
  serialize(value, txFields) {
20
- return coinAmount.serializeOptional.call(this, value, txFields);
19
+ return coinAmount.serialize.call(this, value, txFields);
21
20
  }
22
-
23
21
  };
24
22
  //# sourceMappingURL=name-fee.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"name-fee.mjs","names":["BigNumber","getMinimumNameFee","InsufficientNameFeeError","coinAmount","serializeAettos","_value","txFields","minNameFee","name","value","gt","toFixed","serialize","serializeOptional","call"],"sources":["../../../../src/tx/builder/field-types/name-fee.ts"],"sourcesContent":["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.serializeOptional.call(this, value, txFields);\n },\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,cAAtB;SACSC,iB;SACAC,wB;OAEFC,U;AAGP,eAAe,EACb,GAAGA,UADU;;EAGbC,eAAe,CACbC,MADa,EAEbC,QAFa,EAGL;IACR,MAAMC,UAAU,GAAGN,iBAAiB,CAACK,QAAQ,CAACE,IAAV,CAApC;IACA,MAAMC,KAAK,GAAG,IAAIT,SAAJ,CAAcK,MAAd,aAAcA,MAAd,cAAcA,MAAd,GAAwBE,UAAxB,CAAd;IACA,IAAIA,UAAU,CAACG,EAAX,CAAcD,KAAd,CAAJ,EAA0B,MAAM,IAAIP,wBAAJ,CAA6BO,KAA7B,EAAoCF,UAApC,CAAN;IAC1B,OAAOE,KAAK,CAACE,OAAN,EAAP;EACD,CAXY;;EAab;AACF;AACA;AACA;AACA;EACEC,SAAS,CACPH,KADO,EAEPH,QAFO,EAGC;IACR,OAAOH,UAAU,CAACU,iBAAX,CAA6BC,IAA7B,CAAkC,IAAlC,EAAwCL,KAAxC,EAA+CH,QAA/C,CAAP;EACD;;AAvBY,CAAf"}
1
+ {"version":3,"file":"name-fee.mjs","names":["BigNumber","getMinimumNameFee","InsufficientNameFeeError","coinAmount","serializeAettos","_value","txFields","minNameFee","name","value","gt","toFixed","serialize","call"],"sources":["../../../../src/tx/builder/field-types/name-fee.ts"],"sourcesContent":["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 ): Buffer {\n return coinAmount.serialize.call(this, value, txFields);\n },\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,cAAc;AAAC,SAC5BC,iBAAiB;AAAA,SACjBC,wBAAwB;AAAA,OAC1BC,UAAU;AAGjB,eAAe;EACb,GAAGA,UAAU;EAEbC,eAAe,CACbC,MAA0B,EAC1BC,QAA4B,EACpB;IACR,MAAMC,UAAU,GAAGN,iBAAiB,CAACK,QAAQ,CAACE,IAAI,CAAC;IACnD,MAAMC,KAAK,GAAG,IAAIT,SAAS,CAACK,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIE,UAAU,CAAC;IACjD,IAAIA,UAAU,CAACG,EAAE,CAACD,KAAK,CAAC,EAAE,MAAM,IAAIP,wBAAwB,CAACO,KAAK,EAAEF,UAAU,CAAC;IAC/E,OAAOE,KAAK,CAACE,OAAO,EAAE;EACxB,CAAC;EAED;AACF;AACA;AACA;AACA;EACEC,SAAS,CACPH,KAAsB,EACtBH,QAA4E,EACpE;IACR,OAAOH,UAAU,CAACS,SAAS,CAACC,IAAI,CAAC,IAAI,EAAEJ,KAAK,EAAEH,QAAQ,CAAC;EACzD;AACF,CAAC"}
@@ -6,9 +6,6 @@ declare const _default: {
6
6
  * @param value - AENS name ID
7
7
  */
8
8
  serialize(value: AensName | Encoded.Name): Buffer;
9
- /**
10
- * @param value - AENS name ID Buffer
11
- */
12
- deserialize(value: Buffer): Encoded.Name;
9
+ deserialize: (value: Buffer) => `nm_${string}`;
13
10
  };
14
11
  export default _default;
@@ -1,19 +1,14 @@
1
1
  import { produceNameId, isNameValid } from "../helpers.mjs";
2
- import { writeId, readId } from "../address.mjs";
2
+ import address from "./address.mjs";
3
+ import { Encoding } from "../../../utils/encoder.mjs";
4
+ const addressName = address(Encoding.Name);
3
5
  export default {
6
+ ...addressName,
4
7
  /**
5
8
  * @param value - AENS name ID
6
9
  */
7
10
  serialize(value) {
8
- return writeId(isNameValid(value) ? produceNameId(value) : value);
9
- },
10
-
11
- /**
12
- * @param value - AENS name ID Buffer
13
- */
14
- deserialize(value) {
15
- return readId(value);
11
+ return addressName.serialize(isNameValid(value) ? produceNameId(value) : value);
16
12
  }
17
-
18
13
  };
19
14
  //# sourceMappingURL=name-id.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"name-id.mjs","names":["produceNameId","isNameValid","writeId","readId","serialize","value","deserialize"],"sources":["../../../../src/tx/builder/field-types/name-id.ts"],"sourcesContent":["import { AensName } from '../constants';\nimport { produceNameId, isNameValid } from '../helpers';\nimport { writeId, readId } from '../address';\nimport { Encoded } from '../../../utils/encoder';\n\nexport default {\n /**\n * @param value - AENS name ID\n */\n serialize(value: AensName | Encoded.Name): Buffer {\n return writeId(isNameValid(value) ? produceNameId(value) : value);\n },\n\n /**\n * @param value - AENS name ID Buffer\n */\n deserialize(value: Buffer): Encoded.Name {\n return readId(value) as Encoded.Name;\n },\n};\n"],"mappings":"SACSA,a,EAAeC,W;SACfC,O,EAASC,M;AAGlB,eAAe;EACb;AACF;AACA;EACEC,SAAS,CAACC,KAAD,EAAyC;IAChD,OAAOH,OAAO,CAACD,WAAW,CAACI,KAAD,CAAX,GAAqBL,aAAa,CAACK,KAAD,CAAlC,GAA4CA,KAA7C,CAAd;EACD,CANY;;EAQb;AACF;AACA;EACEC,WAAW,CAACD,KAAD,EAA8B;IACvC,OAAOF,MAAM,CAACE,KAAD,CAAb;EACD;;AAbY,CAAf"}
1
+ {"version":3,"file":"name-id.mjs","names":["produceNameId","isNameValid","address","Encoding","addressName","Name","serialize","value"],"sources":["../../../../src/tx/builder/field-types/name-id.ts"],"sourcesContent":["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"],"mappings":"SACSA,aAAa,EAAEC,WAAW;AAAA,OAC5BC,OAAO;AAAA,SACIC,QAAQ;AAE1B,MAAMC,WAAW,GAAGF,OAAO,CAACC,QAAQ,CAACE,IAAI,CAAC;AAE1C,eAAe;EACb,GAAGD,WAAW;EAEd;AACF;AACA;EACEE,SAAS,CAACC,KAA8B,EAAU;IAChD,OAAOH,WAAW,CAACE,SAAS,CAACL,WAAW,CAACM,KAAK,CAAC,GAAGP,aAAa,CAACO,KAAK,CAAC,GAAGA,KAAK,CAAC;EACjF;AACF,CAAC"}
@@ -6,13 +6,11 @@ export default {
6
6
  serialize(value) {
7
7
  return field.serialize(value);
8
8
  },
9
-
10
9
  /**
11
10
  * @param value - AENS name
12
11
  */
13
12
  deserialize(value) {
14
13
  return field.deserialize(value);
15
14
  }
16
-
17
15
  };
18
16
  //# sourceMappingURL=name.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"name.mjs","names":["field","serialize","value","deserialize"],"sources":["../../../../src/tx/builder/field-types/name.ts"],"sourcesContent":["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"],"mappings":"OAAOA,K;AAGP,eAAe;EACb;AACF;AACA;EACEC,SAAS,CAACC,KAAD,EAA0B;IACjC,OAAOF,KAAK,CAACC,SAAN,CAAgBC,KAAhB,CAAP;EACD,CANY;;EAQb;AACF;AACA;EACEC,WAAW,CAACD,KAAD,EAA0B;IACnC,OAAOF,KAAK,CAACG,WAAN,CAAkBD,KAAlB,CAAP;EACD;;AAbY,CAAf"}
1
+ {"version":3,"file":"name.mjs","names":["field","serialize","value","deserialize"],"sources":["../../../../src/tx/builder/field-types/name.ts"],"sourcesContent":["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"],"mappings":"OAAOA,KAAK;AAGZ,eAAe;EACb;AACF;AACA;EACEC,SAAS,CAACC,KAAe,EAAU;IACjC,OAAOF,KAAK,CAACC,SAAS,CAACC,KAAK,CAAC;EAC/B,CAAC;EAED;AACF;AACA;EACEC,WAAW,CAACD,KAAa,EAAY;IACnC,OAAOF,KAAK,CAACG,WAAW,CAACD,KAAK,CAAC;EACjC;AACF,CAAC"}
@@ -0,0 +1,23 @@
1
+ /// <reference types="node" />
2
+ import { NamePointer as NamePointerString } from '../../../apis/node';
3
+ import { Encoded } from '../../../utils/encoder';
4
+ import { AddressEncodings } from './address';
5
+ type NamePointer = NamePointerString & {
6
+ id: Encoded.Generic<AddressEncodings>;
7
+ };
8
+ declare const _default: {
9
+ /**
10
+ * Helper function to build pointers for name update TX
11
+ * @param pointers - Array of pointers
12
+ * `([ { key: 'account_pubkey', id: 'ak_32klj5j23k23j5423l434l2j3423'} ])`
13
+ * @returns Serialized pointers array
14
+ */
15
+ serialize(pointers: NamePointer[]): Buffer[][];
16
+ /**
17
+ * Helper function to read pointers from name update TX
18
+ * @param pointers - Array of pointers
19
+ * @returns Deserialize pointer array
20
+ */
21
+ deserialize(pointers: Array<[key: Buffer, id: Buffer]>): NamePointer[];
22
+ };
23
+ export default _default;
@@ -0,0 +1,36 @@
1
+ import { toBytes } from "../../../utils/bytes.mjs";
2
+ import { IllegalArgumentError } from "../../../utils/errors.mjs";
3
+ import address, { idTagToEncoding } from "./address.mjs";
4
+ const addressAny = address(...idTagToEncoding);
5
+
6
+ // TODO: remove after fixing node types
7
+
8
+ export default {
9
+ /**
10
+ * Helper function to build pointers for name update TX
11
+ * @param pointers - Array of pointers
12
+ * `([ { key: 'account_pubkey', id: 'ak_32klj5j23k23j5423l434l2j3423'} ])`
13
+ * @returns Serialized pointers array
14
+ */
15
+ serialize(pointers) {
16
+ if (pointers.length > 32) {
17
+ throw new IllegalArgumentError(`Expected 32 pointers or less, got ${pointers.length} instead`);
18
+ }
19
+ return pointers.map(pointer => [toBytes(pointer.key), addressAny.serialize(pointer.id)]);
20
+ },
21
+ /**
22
+ * Helper function to read pointers from name update TX
23
+ * @param pointers - Array of pointers
24
+ * @returns Deserialize pointer array
25
+ */
26
+ deserialize(pointers) {
27
+ return pointers.map(_ref => {
28
+ let [key, id] = _ref;
29
+ return {
30
+ key: key.toString(),
31
+ id: addressAny.deserialize(id)
32
+ };
33
+ });
34
+ }
35
+ };
36
+ //# sourceMappingURL=pointers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointers.mjs","names":["toBytes","IllegalArgumentError","address","idTagToEncoding","addressAny","serialize","pointers","length","map","pointer","key","id","deserialize","toString"],"sources":["../../../../src/tx/builder/field-types/pointers.ts"],"sourcesContent":["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"],"mappings":"SACSA,OAAO;AAAA,SAEPC,oBAAoB;AAAA,OACtBC,OAAO,IAAsBC,eAAe;AAEnD,MAAMC,UAAU,GAAGF,OAAO,CAAC,GAAGC,eAAe,CAAC;;AAE9C;;AAKA,eAAe;EACb;AACF;AACA;AACA;AACA;AACA;EACEE,SAAS,CAACC,QAAuB,EAAc;IAC7C,IAAIA,QAAQ,CAACC,MAAM,GAAG,EAAE,EAAE;MACxB,MAAM,IAAIN,oBAAoB,CAAE,qCAAoCK,QAAQ,CAACC,MAAO,UAAS,CAAC;IAChG;IAEA,OAAOD,QAAQ,CAACE,GAAG,CAChBC,OAAO,IAAK,CAACT,OAAO,CAACS,OAAO,CAACC,GAAG,CAAC,EAAEN,UAAU,CAACC,SAAS,CAACI,OAAO,CAACE,EAAE,CAAC,CAAC,CACtE;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEC,WAAW,CAACN,QAA0C,EAAiB;IACrE,OAAOA,QAAQ,CAACE,GAAG,CACjB;MAAA,IAAC,CAACE,GAAG,EAAEC,EAAE,CAAC;MAAA,OAAM;QAAED,GAAG,EAAEA,GAAG,CAACG,QAAQ,EAAE;QAAEF,EAAE,EAAEP,UAAU,CAACQ,WAAW,CAACD,EAAE;MAAE,CAAC;IAAA,CAAC,CACzE;EACH;AACF,CAAC"}
@@ -0,0 +1,6 @@
1
+ /// <reference types="node" />
2
+ declare const _default: {
3
+ serialize(buffer: Uint8Array): Buffer;
4
+ deserialize(buffer: Buffer): Buffer;
5
+ };
6
+ export default _default;