@aeternity/aepp-sdk 13.0.0-alpha.1 → 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 (388) 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 +1792 -1525
  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.mjs.map +1 -1
  11. package/es/AeSdkMethods.d.ts +11 -12
  12. package/es/AeSdkMethods.mjs +6 -8
  13. package/es/AeSdkMethods.mjs.map +1 -1
  14. package/es/AeSdkWallet.mjs +1 -1
  15. package/es/AeSdkWallet.mjs.map +1 -1
  16. package/es/Node.d.ts +5 -1
  17. package/es/Node.mjs +11 -5
  18. package/es/Node.mjs.map +1 -1
  19. package/es/account/Base.d.ts +11 -6
  20. package/es/account/Base.mjs +0 -17
  21. package/es/account/Base.mjs.map +1 -1
  22. package/es/account/Generalized.mjs +11 -24
  23. package/es/account/Generalized.mjs.map +1 -1
  24. package/es/account/Ledger.mjs.map +1 -1
  25. package/es/account/LedgerFactory.mjs.map +1 -1
  26. package/es/account/Memory.d.ts +2 -1
  27. package/es/account/Memory.mjs +9 -21
  28. package/es/account/Memory.mjs.map +1 -1
  29. package/es/account/Rpc.mjs.map +1 -1
  30. package/es/aens.d.ts +12 -14
  31. package/es/aens.mjs +17 -31
  32. package/es/aens.mjs.map +1 -1
  33. package/es/aepp-wallet-communication/connection/Browser.mjs +0 -16
  34. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
  35. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +0 -16
  36. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
  37. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +0 -16
  38. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
  39. package/es/aepp-wallet-communication/connection-proxy.mjs +0 -17
  40. package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
  41. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +4 -5
  42. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
  43. package/es/aepp-wallet-communication/rpc/types.d.ts +6 -2
  44. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
  45. package/es/aepp-wallet-communication/schema.mjs.map +1 -1
  46. package/es/aepp-wallet-communication/wallet-detector.mjs +0 -16
  47. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
  48. package/es/apis/compiler/compiler.d.ts +1 -1
  49. package/es/apis/compiler/compiler.mjs +4 -20
  50. package/es/apis/compiler/compiler.mjs.map +1 -1
  51. package/es/apis/compiler/models/index.d.ts +3 -2
  52. package/es/apis/compiler/models/index.mjs.map +1 -1
  53. package/es/apis/compiler/models/mappers.d.ts +1 -1
  54. package/es/apis/compiler/models/mappers.mjs +19 -2
  55. package/es/apis/compiler/models/mappers.mjs.map +1 -1
  56. package/es/apis/node/models/index.d.ts +15 -15
  57. package/es/apis/node/models/index.mjs.map +1 -1
  58. package/es/apis/node/models/mappers.d.ts +1 -1
  59. package/es/apis/node/models/mappers.mjs +2 -1
  60. package/es/apis/node/models/mappers.mjs.map +1 -1
  61. package/es/apis/node/models/parameters.d.ts +2 -2
  62. package/es/apis/node/models/parameters.mjs +2 -2
  63. package/es/apis/node/models/parameters.mjs.map +1 -1
  64. package/es/apis/node/node.mjs +3 -19
  65. package/es/apis/node/node.mjs.map +1 -1
  66. package/es/chain.d.ts +8 -8
  67. package/es/chain.mjs +19 -22
  68. package/es/chain.mjs.map +1 -1
  69. package/es/channel/Base.d.ts +25 -12
  70. package/es/channel/Base.mjs +23 -26
  71. package/es/channel/Base.mjs.map +1 -1
  72. package/es/channel/Contract.mjs +8 -21
  73. package/es/channel/Contract.mjs.map +1 -1
  74. package/es/channel/Spend.d.ts +4 -2
  75. package/es/channel/Spend.mjs +0 -16
  76. package/es/channel/Spend.mjs.map +1 -1
  77. package/es/channel/handlers.mjs +6 -18
  78. package/es/channel/handlers.mjs.map +1 -1
  79. package/es/channel/internal.d.ts +19 -2
  80. package/es/channel/internal.mjs +19 -19
  81. package/es/channel/internal.mjs.map +1 -1
  82. package/es/contract/Contract.d.ts +30 -85
  83. package/es/contract/Contract.mjs +174 -211
  84. package/es/contract/Contract.mjs.map +1 -1
  85. package/es/contract/compiler/Base.d.ts +7 -14
  86. package/es/contract/compiler/Base.mjs.map +1 -1
  87. package/es/contract/compiler/Cli.mjs +5 -11
  88. package/es/contract/compiler/Cli.mjs.map +1 -1
  89. package/es/contract/compiler/Http.mjs +6 -30
  90. package/es/contract/compiler/Http.mjs.map +1 -1
  91. package/es/contract/compiler/HttpNode.mjs.map +1 -1
  92. package/es/contract/compiler/getFileSystem.mjs.map +1 -1
  93. package/es/contract/delegation-signature.d.ts +43 -0
  94. package/es/contract/delegation-signature.mjs +45 -0
  95. package/es/contract/delegation-signature.mjs.map +1 -0
  96. package/es/contract/ga.d.ts +23 -7
  97. package/es/contract/ga.mjs +52 -27
  98. package/es/contract/ga.mjs.map +1 -1
  99. package/es/index-browser.d.ts +4 -3
  100. package/es/index-browser.mjs +6 -20
  101. package/es/index-browser.mjs.map +1 -1
  102. package/es/oracle.d.ts +12 -17
  103. package/es/oracle.mjs +28 -48
  104. package/es/oracle.mjs.map +1 -1
  105. package/es/spend.d.ts +19 -27
  106. package/es/spend.mjs +20 -43
  107. package/es/spend.mjs.map +1 -1
  108. package/es/tx/builder/SchemaTypes.d.ts +37 -0
  109. package/es/tx/builder/SchemaTypes.mjs +2 -0
  110. package/es/tx/builder/SchemaTypes.mjs.map +1 -0
  111. package/es/tx/builder/constants.d.ts +4 -2
  112. package/es/tx/builder/constants.mjs +2 -0
  113. package/es/tx/builder/constants.mjs.map +1 -1
  114. package/es/tx/builder/field-types/abi-version.d.ts +11 -2
  115. package/es/tx/builder/field-types/abi-version.mjs +24 -4
  116. package/es/tx/builder/field-types/abi-version.mjs.map +1 -1
  117. package/es/tx/builder/field-types/address.mjs.map +1 -1
  118. package/es/tx/builder/field-types/array.d.ts +1 -1
  119. package/es/tx/builder/field-types/array.mjs.map +1 -1
  120. package/es/tx/builder/field-types/boolean.mjs.map +1 -1
  121. package/es/tx/builder/field-types/coin-amount.d.ts +3 -4
  122. package/es/tx/builder/field-types/coin-amount.mjs +4 -5
  123. package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
  124. package/es/tx/builder/field-types/ct-version.d.ts +22 -3
  125. package/es/tx/builder/field-types/ct-version.mjs +32 -4
  126. package/es/tx/builder/field-types/ct-version.mjs.map +1 -1
  127. package/es/tx/builder/field-types/deposit.d.ts +2 -1
  128. package/es/tx/builder/field-types/deposit.mjs +3 -2
  129. package/es/tx/builder/field-types/deposit.mjs.map +1 -1
  130. package/es/tx/builder/field-types/encoded.d.ts +1 -1
  131. package/es/tx/builder/field-types/encoded.mjs.map +1 -1
  132. package/es/tx/builder/field-types/entry.mjs +3 -0
  133. package/es/tx/builder/field-types/entry.mjs.map +1 -1
  134. package/es/tx/builder/field-types/enumeration.mjs.map +1 -1
  135. package/es/tx/builder/field-types/fee.d.ts +3 -1
  136. package/es/tx/builder/field-types/fee.mjs +5 -1
  137. package/es/tx/builder/field-types/fee.mjs.map +1 -1
  138. package/es/tx/builder/field-types/field.mjs.map +1 -1
  139. package/es/tx/builder/field-types/gas-limit.d.ts +3 -2
  140. package/es/tx/builder/field-types/gas-limit.mjs +4 -2
  141. package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
  142. package/es/tx/builder/field-types/gas-price.d.ts +3 -1
  143. package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
  144. package/es/tx/builder/field-types/index.d.ts +52 -13
  145. package/es/tx/builder/field-types/index.mjs +10 -2
  146. package/es/tx/builder/field-types/index.mjs.map +1 -1
  147. package/es/tx/builder/field-types/map.d.ts +13 -0
  148. package/es/tx/builder/field-types/map.mjs +49 -0
  149. package/es/tx/builder/field-types/map.mjs.map +1 -0
  150. package/es/tx/builder/field-types/mptree.d.ts +7 -2
  151. package/es/tx/builder/field-types/mptree.mjs +5 -7
  152. package/es/tx/builder/field-types/mptree.mjs.map +1 -1
  153. package/es/tx/builder/field-types/name-fee.d.ts +1 -1
  154. package/es/tx/builder/field-types/name-fee.mjs +2 -2
  155. package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
  156. package/es/tx/builder/field-types/name-id.mjs.map +1 -1
  157. package/es/tx/builder/field-types/name.mjs.map +1 -1
  158. package/es/tx/builder/field-types/nonce.d.ts +14 -0
  159. package/es/tx/builder/field-types/nonce.mjs +29 -0
  160. package/es/tx/builder/field-types/nonce.mjs.map +1 -0
  161. package/es/tx/builder/field-types/pointers.mjs.map +1 -1
  162. package/es/tx/builder/field-types/raw.mjs.map +1 -1
  163. package/es/tx/builder/field-types/short-u-int-const.d.ts +4 -2
  164. package/es/tx/builder/field-types/short-u-int-const.mjs +12 -8
  165. package/es/tx/builder/field-types/short-u-int-const.mjs.map +1 -1
  166. package/es/tx/builder/field-types/short-u-int.mjs.map +1 -1
  167. package/es/tx/builder/field-types/string.mjs.map +1 -1
  168. package/es/tx/builder/field-types/ttl.d.ts +11 -0
  169. package/es/tx/builder/field-types/ttl.mjs +21 -0
  170. package/es/tx/builder/field-types/ttl.mjs.map +1 -0
  171. package/es/tx/builder/field-types/u-int.mjs.map +1 -1
  172. package/es/tx/builder/field-types/wrapped.d.ts +14 -0
  173. package/es/tx/builder/field-types/wrapped.mjs +22 -0
  174. package/es/tx/builder/field-types/wrapped.mjs.map +1 -0
  175. package/es/tx/builder/helpers.mjs.map +1 -1
  176. package/es/tx/builder/index.d.ts +20 -20
  177. package/es/tx/builder/index.mjs +54 -64
  178. package/es/tx/builder/index.mjs.map +1 -1
  179. package/es/tx/builder/schema.d.ts +2735 -2865
  180. package/es/tx/builder/schema.generated.d.ts +2011 -0
  181. package/es/tx/builder/schema.generated.mjs +2 -0
  182. package/es/tx/builder/schema.generated.mjs.map +1 -0
  183. package/es/tx/builder/schema.mjs +459 -155
  184. package/es/tx/builder/schema.mjs.map +1 -1
  185. package/es/tx/execution-cost.d.ts +35 -0
  186. package/es/tx/execution-cost.mjs +123 -0
  187. package/es/tx/execution-cost.mjs.map +1 -0
  188. package/es/tx/transaction-signer.d.ts +6 -0
  189. package/es/tx/transaction-signer.mjs +27 -0
  190. package/es/tx/transaction-signer.mjs.map +1 -0
  191. package/es/tx/validator.mjs +60 -109
  192. package/es/tx/validator.mjs.map +1 -1
  193. package/es/utils/amount-formatter.mjs +0 -16
  194. package/es/utils/amount-formatter.mjs.map +1 -1
  195. package/es/utils/autorest.d.ts +3 -2
  196. package/es/utils/autorest.mjs +43 -11
  197. package/es/utils/autorest.mjs.map +1 -1
  198. package/es/utils/bytes.mjs +0 -16
  199. package/es/utils/bytes.mjs.map +1 -1
  200. package/es/utils/crypto.mjs +0 -16
  201. package/es/utils/crypto.mjs.map +1 -1
  202. package/es/utils/encoder.mjs.map +1 -1
  203. package/es/utils/errors.d.ts +14 -31
  204. package/es/utils/errors.mjs +2 -32
  205. package/es/utils/errors.mjs.map +1 -1
  206. package/es/utils/hd-wallet.mjs.map +1 -1
  207. package/es/utils/json-big.mjs.map +1 -1
  208. package/es/utils/keystore.mjs.map +1 -1
  209. package/es/utils/other.d.ts +1 -1
  210. package/es/utils/other.mjs.map +1 -1
  211. package/es/utils/semver-satisfies.mjs.map +1 -1
  212. package/es/utils/string.mjs +0 -17
  213. package/es/utils/string.mjs.map +1 -1
  214. package/package.json +34 -30
  215. package/src/AeSdkMethods.ts +11 -16
  216. package/src/AeSdkWallet.ts +1 -1
  217. package/src/Node.ts +17 -6
  218. package/src/account/Base.ts +11 -22
  219. package/src/account/Generalized.ts +8 -23
  220. package/src/account/Memory.ts +14 -21
  221. package/src/aens.ts +31 -47
  222. package/src/aepp-wallet-communication/connection/Browser.ts +0 -17
  223. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +0 -17
  224. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +0 -17
  225. package/src/aepp-wallet-communication/connection-proxy.ts +0 -17
  226. package/src/aepp-wallet-communication/rpc/types.ts +6 -2
  227. package/src/aepp-wallet-communication/wallet-detector.ts +0 -17
  228. package/src/apis/compiler/compiler.ts +3 -27
  229. package/src/apis/compiler/models/index.ts +3 -2
  230. package/src/apis/compiler/models/mappers.ts +15 -2
  231. package/src/apis/node/models/index.ts +16 -15
  232. package/src/apis/node/models/mappers.ts +2 -1
  233. package/src/apis/node/models/parameters.ts +2 -2
  234. package/src/apis/node/node.ts +3 -27
  235. package/src/chain.ts +28 -27
  236. package/src/channel/Base.ts +33 -33
  237. package/src/channel/Contract.ts +8 -23
  238. package/src/channel/Spend.ts +2 -17
  239. package/src/channel/handlers.ts +5 -18
  240. package/src/channel/internal.ts +40 -22
  241. package/src/contract/Contract.ts +133 -163
  242. package/src/contract/compiler/Base.ts +7 -14
  243. package/src/contract/compiler/Cli.ts +5 -11
  244. package/src/contract/compiler/Http.ts +6 -25
  245. package/src/contract/delegation-signature.ts +56 -0
  246. package/src/contract/ga.ts +53 -32
  247. package/src/index-browser.ts +12 -20
  248. package/src/oracle.ts +46 -56
  249. package/src/spend.ts +33 -67
  250. package/src/tx/builder/SchemaTypes.ts +79 -0
  251. package/src/tx/builder/constants.ts +2 -0
  252. package/src/tx/builder/field-types/abi-version.ts +29 -6
  253. package/src/tx/builder/field-types/array.ts +1 -1
  254. package/src/tx/builder/field-types/coin-amount.ts +6 -4
  255. package/src/tx/builder/field-types/ct-version.ts +37 -4
  256. package/src/tx/builder/field-types/deposit.ts +3 -1
  257. package/src/tx/builder/field-types/encoded.ts +1 -1
  258. package/src/tx/builder/field-types/entry.ts +8 -3
  259. package/src/tx/builder/field-types/fee.ts +6 -4
  260. package/src/tx/builder/field-types/gas-limit.ts +2 -2
  261. package/src/tx/builder/field-types/index.ts +15 -1
  262. package/src/tx/builder/field-types/map.ts +45 -0
  263. package/src/tx/builder/field-types/mptree.ts +4 -3
  264. package/src/tx/builder/field-types/name-fee.ts +2 -1
  265. package/src/tx/builder/field-types/nonce.ts +40 -0
  266. package/src/tx/builder/field-types/short-u-int-const.ts +18 -8
  267. package/src/tx/builder/field-types/ttl.ts +24 -0
  268. package/src/tx/builder/field-types/wrapped.ts +32 -0
  269. package/src/tx/builder/index.ts +57 -71
  270. package/src/tx/builder/schema.generated.ts +2013 -0
  271. package/src/tx/builder/schema.ts +544 -624
  272. package/src/tx/execution-cost.ts +146 -0
  273. package/src/tx/transaction-signer.ts +27 -0
  274. package/src/tx/validator.ts +60 -91
  275. package/src/utils/amount-formatter.ts +0 -16
  276. package/src/utils/autorest.ts +52 -11
  277. package/src/utils/bytes.ts +0 -16
  278. package/src/utils/crypto.ts +0 -16
  279. package/src/utils/errors.ts +15 -44
  280. package/src/utils/string.ts +0 -17
  281. package/types-legacy/ts4.2/AeSdkMethods.d.ts +11 -12
  282. package/types-legacy/ts4.2/Node.d.ts +5 -1
  283. package/types-legacy/ts4.2/account/Base.d.ts +11 -6
  284. package/types-legacy/ts4.2/account/Memory.d.ts +2 -1
  285. package/types-legacy/ts4.2/aens.d.ts +12 -14
  286. package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +6 -2
  287. package/types-legacy/ts4.2/apis/compiler/compiler.d.ts +1 -1
  288. package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +3 -2
  289. package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +1 -1
  290. package/types-legacy/ts4.2/apis/node/models/index.d.ts +15 -15
  291. package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +1 -1
  292. package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +2 -2
  293. package/types-legacy/ts4.2/chain.d.ts +8 -8
  294. package/types-legacy/ts4.2/channel/Base.d.ts +25 -12
  295. package/types-legacy/ts4.2/channel/Spend.d.ts +4 -2
  296. package/types-legacy/ts4.2/channel/internal.d.ts +22 -2
  297. package/types-legacy/ts4.2/contract/Contract.d.ts +29 -84
  298. package/types-legacy/ts4.2/contract/compiler/Base.d.ts +7 -14
  299. package/types-legacy/ts4.2/contract/delegation-signature.d.ts +43 -0
  300. package/types-legacy/ts4.2/contract/ga.d.ts +23 -7
  301. package/types-legacy/ts4.2/index-browser.d.ts +4 -3
  302. package/types-legacy/ts4.2/oracle.d.ts +12 -17
  303. package/types-legacy/ts4.2/spend.d.ts +19 -27
  304. package/types-legacy/ts4.2/tx/builder/SchemaTypes.d.ts +37 -0
  305. package/types-legacy/ts4.2/tx/builder/constants.d.ts +4 -2
  306. package/types-legacy/ts4.2/tx/builder/field-types/abi-version.d.ts +11 -2
  307. package/types-legacy/ts4.2/tx/builder/field-types/array.d.ts +1 -1
  308. package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +3 -4
  309. package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +33 -3
  310. package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +2 -1
  311. package/types-legacy/ts4.2/tx/builder/field-types/encoded.d.ts +1 -1
  312. package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +3 -1
  313. package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +3 -2
  314. package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +3 -1
  315. package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +52 -13
  316. package/types-legacy/ts4.2/tx/builder/field-types/map.d.ts +13 -0
  317. package/types-legacy/ts4.2/tx/builder/field-types/mptree.d.ts +7 -2
  318. package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +1 -1
  319. package/types-legacy/ts4.2/tx/builder/field-types/nonce.d.ts +14 -0
  320. package/types-legacy/ts4.2/tx/builder/field-types/short-u-int-const.d.ts +4 -2
  321. package/types-legacy/ts4.2/tx/builder/field-types/ttl.d.ts +11 -0
  322. package/types-legacy/ts4.2/tx/builder/field-types/wrapped.d.ts +14 -0
  323. package/types-legacy/ts4.2/tx/builder/index.d.ts +23 -20
  324. package/types-legacy/ts4.2/tx/builder/schema.d.ts +2962 -4629
  325. package/types-legacy/ts4.2/tx/builder/schema.generated.d.ts +2011 -0
  326. package/types-legacy/ts4.2/tx/execution-cost.d.ts +35 -0
  327. package/types-legacy/ts4.2/tx/transaction-signer.d.ts +6 -0
  328. package/types-legacy/ts4.2/utils/autorest.d.ts +3 -2
  329. package/types-legacy/ts4.2/utils/errors.d.ts +14 -31
  330. package/types-legacy/ts4.2/utils/other.d.ts +1 -1
  331. package/types-legacy/ts4.5/AeSdkMethods.d.ts +11 -12
  332. package/types-legacy/ts4.5/Node.d.ts +5 -1
  333. package/types-legacy/ts4.5/account/Base.d.ts +11 -6
  334. package/types-legacy/ts4.5/account/Memory.d.ts +2 -1
  335. package/types-legacy/ts4.5/aens.d.ts +12 -14
  336. package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +6 -2
  337. package/types-legacy/ts4.5/apis/compiler/compiler.d.ts +1 -1
  338. package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +3 -2
  339. package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +1 -1
  340. package/types-legacy/ts4.5/apis/node/models/index.d.ts +15 -15
  341. package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +1 -1
  342. package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +2 -2
  343. package/types-legacy/ts4.5/chain.d.ts +8 -8
  344. package/types-legacy/ts4.5/channel/Base.d.ts +25 -12
  345. package/types-legacy/ts4.5/channel/Spend.d.ts +4 -2
  346. package/types-legacy/ts4.5/channel/internal.d.ts +22 -2
  347. package/types-legacy/ts4.5/contract/Contract.d.ts +29 -84
  348. package/types-legacy/ts4.5/contract/compiler/Base.d.ts +7 -14
  349. package/types-legacy/ts4.5/contract/delegation-signature.d.ts +43 -0
  350. package/types-legacy/ts4.5/contract/ga.d.ts +23 -7
  351. package/types-legacy/ts4.5/index-browser.d.ts +4 -3
  352. package/types-legacy/ts4.5/oracle.d.ts +12 -17
  353. package/types-legacy/ts4.5/spend.d.ts +19 -27
  354. package/types-legacy/ts4.5/tx/builder/SchemaTypes.d.ts +37 -0
  355. package/types-legacy/ts4.5/tx/builder/constants.d.ts +4 -2
  356. package/types-legacy/ts4.5/tx/builder/field-types/abi-version.d.ts +11 -2
  357. package/types-legacy/ts4.5/tx/builder/field-types/array.d.ts +1 -1
  358. package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +3 -4
  359. package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +33 -3
  360. package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +2 -1
  361. package/types-legacy/ts4.5/tx/builder/field-types/encoded.d.ts +1 -1
  362. package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +3 -1
  363. package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +3 -2
  364. package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +3 -1
  365. package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +52 -13
  366. package/types-legacy/ts4.5/tx/builder/field-types/map.d.ts +13 -0
  367. package/types-legacy/ts4.5/tx/builder/field-types/mptree.d.ts +7 -2
  368. package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +1 -1
  369. package/types-legacy/ts4.5/tx/builder/field-types/nonce.d.ts +14 -0
  370. package/types-legacy/ts4.5/tx/builder/field-types/short-u-int-const.d.ts +4 -2
  371. package/types-legacy/ts4.5/tx/builder/field-types/ttl.d.ts +11 -0
  372. package/types-legacy/ts4.5/tx/builder/field-types/wrapped.d.ts +14 -0
  373. package/types-legacy/ts4.5/tx/builder/index.d.ts +23 -20
  374. package/types-legacy/ts4.5/tx/builder/schema.d.ts +2962 -4629
  375. package/types-legacy/ts4.5/tx/builder/schema.generated.d.ts +2011 -0
  376. package/types-legacy/ts4.5/tx/execution-cost.d.ts +35 -0
  377. package/types-legacy/ts4.5/tx/transaction-signer.d.ts +6 -0
  378. package/types-legacy/ts4.5/utils/autorest.d.ts +3 -2
  379. package/types-legacy/ts4.5/utils/errors.d.ts +14 -31
  380. package/types-legacy/ts4.5/utils/other.d.ts +1 -1
  381. package/es/tx/index.d.ts +0 -19
  382. package/es/tx/index.mjs +0 -115
  383. package/es/tx/index.mjs.map +0 -1
  384. package/src/apis/compiler/code-model-v4.yaml +0 -2442
  385. package/src/apis/node/code-model-v4.yaml +0 -10080
  386. package/src/tx/index.ts +0 -129
  387. package/types-legacy/ts4.2/tx/index.d.ts +0 -19
  388. package/types-legacy/ts4.5/tx/index.d.ts +0 -19
@@ -1,25 +1,8 @@
1
- import { sendTransaction, resolveName } from './chain';
2
- import { BuildTxOptions } from './tx';
1
+ import { sendTransaction, resolveName, SendTransactionOptions } from './chain';
2
+ import { BuildTxOptions } from './tx/builder';
3
3
  import { Encoded } from './utils/encoder';
4
4
  import { Tag, AensName } from './tx/builder/constants';
5
5
  import AccountBase from './account/Base';
6
- /**
7
- * Sign and post a transaction to the chain
8
- * @category chain
9
- * @param tx - Transaction
10
- * @param options - Options
11
- * @param options.verify - Verify transaction before broadcast, throw error if not
12
- * valid
13
- * @returns Transaction
14
- */
15
- export declare function send(tx: Encoded.Transaction, options: SendOptions): Promise<SendReturnType>;
16
- type SendOptionsType = Parameters<AccountBase['signTransaction']>[1] & Parameters<typeof sendTransaction>[1] & {
17
- onAccount: AccountBase;
18
- };
19
- export interface SendOptions extends SendOptionsType {
20
- }
21
- interface SendReturnType extends Awaited<ReturnType<typeof sendTransaction>> {
22
- }
23
6
  /**
24
7
  * Send coins to another account
25
8
  * @category chain
@@ -28,24 +11,33 @@ interface SendReturnType extends Awaited<ReturnType<typeof sendTransaction>> {
28
11
  * @param options - Options
29
12
  * @returns Transaction
30
13
  */
31
- export declare function spend(amount: number | string, recipientIdOrName: Encoded.AccountAddress | AensName, options: SpendOptions): ReturnType<typeof send>;
14
+ export declare function spend(amount: number | string, recipientIdOrName: Encoded.AccountAddress | AensName, options: SpendOptions): ReturnType<typeof sendTransaction>;
32
15
  type SpendOptionsType = BuildTxOptions<Tag.SpendTx, 'senderId' | 'recipientId' | 'amount'> & Parameters<typeof resolveName>[2] & {
33
16
  onAccount: AccountBase;
34
- } & SendOptions;
17
+ } & SendTransactionOptions;
35
18
  interface SpendOptions extends SpendOptionsType {
36
19
  }
37
20
  /**
38
- * Send a fraction of coin balance to another account
21
+ * Spend a fraction of coin balance to another account. Useful if needed to drain account balance
22
+ * completely, sending funds to another account (with fraction set to 1).
39
23
  * @category chain
40
24
  * @param fraction - Fraction of balance to spend (between 0 and 1)
41
25
  * @param recipientIdOrName - Address or name of recipient account
42
26
  * @param options - Options
43
- * @returns Transaction
27
+ * @example
28
+ * ```js
29
+ * // `fraction` * 100 = % of AE to be transferred (e.g. `0.42` for 42% or `1` for 100%)
30
+ * const { blockHeight } = await aeSdk.transferFunds(
31
+ * 0.42,
32
+ * 'ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E',
33
+ * );
34
+ * console.log('Transaction mined at', blockHeight);
35
+ * ```
44
36
  */
45
- export declare function transferFunds(fraction: number | string, recipientIdOrName: AensName | Encoded.AccountAddress, options: TransferFundsOptions): ReturnType<typeof send>;
37
+ export declare function transferFunds(fraction: number | string, recipientIdOrName: AensName | Encoded.AccountAddress, options: TransferFundsOptions): ReturnType<typeof sendTransaction>;
46
38
  type TransferFundsOptionsType = BuildTxOptions<Tag.SpendTx, 'senderId' | 'recipientId' | 'amount'> & Parameters<typeof resolveName>[2] & {
47
39
  onAccount: AccountBase;
48
- } & SendOptions;
40
+ } & SendTransactionOptions;
49
41
  interface TransferFundsOptions extends TransferFundsOptionsType {
50
42
  }
51
43
  /**
@@ -55,8 +47,8 @@ interface TransferFundsOptions extends TransferFundsOptionsType {
55
47
  * @param options - Options
56
48
  * @returns Object Transaction
57
49
  */
58
- export declare function payForTransaction(transaction: Encoded.Transaction, options: PayForTransactionOptions): ReturnType<typeof send>;
59
- interface PayForTransactionOptions extends BuildTxOptions<Tag.PayingForTx, 'payerId' | 'tx'>, SendOptions {
50
+ export declare function payForTransaction(transaction: Encoded.Transaction, options: PayForTransactionOptions): ReturnType<typeof sendTransaction>;
51
+ interface PayForTransactionOptions extends BuildTxOptions<Tag.PayingForTx, 'payerId' | 'tx' | 'onNode'>, SendTransactionOptions {
60
52
  onAccount: AccountBase;
61
53
  }
62
54
  export {};
@@ -0,0 +1,37 @@
1
+ import { Field as OriginalField } from './field-types';
2
+ import { UnionToIntersection } from '../../utils/other';
3
+ export interface Field extends OriginalField {
4
+ serialize: (...args: any[]) => any;
5
+ }
6
+ type NullablePartial<T, NK extends keyof T = {
7
+ [K in keyof T]: undefined extends T[K] ? K : never;
8
+ }[keyof T]> = Partial<Pick<T, NK>> & Omit<T, NK>;
9
+ type Or<A, B> = A extends undefined ? B : A;
10
+ type TxParamsBySchemaInternal<SchemaItem> = {
11
+ -readonly [key in keyof SchemaItem]: SchemaItem[key] extends Field ? Parameters<SchemaItem[key]['serialize']>[0] : never;
12
+ };
13
+ type TxParamsBySchemaInternalParams<SchemaItem, SchemaItemValues = SchemaItem[keyof SchemaItem]> = UnionToIntersection<SchemaItemValues extends Field ? Or<Parameters<SchemaItemValues['serialize']>[2], {}> : never>;
14
+ type PickIsRec<SchemaItem, Recursive extends boolean> = {
15
+ [Key in keyof SchemaItem as SchemaItem[Key] extends Field & {
16
+ recursiveType: true;
17
+ } ? (Recursive extends true ? Key : never) : (Recursive extends true ? never : Key)]: SchemaItem[Key];
18
+ };
19
+ type TxParamsBySchema<SchemaItem> = SchemaItem extends Object ? TxParamsBySchemaInternal<PickIsRec<SchemaItem, true>> & NullablePartial<TxParamsBySchemaInternal<PickIsRec<SchemaItem, false>>> & TxParamsBySchemaInternalParams<PickIsRec<SchemaItem, false>> : never;
20
+ type TxParamsAsyncBySchemaInternal<SchemaItem> = {
21
+ -readonly [key in keyof SchemaItem]: SchemaItem[key] extends Field & {
22
+ prepare: Function;
23
+ } ? Parameters<SchemaItem[key]['prepare']>[0] : SchemaItem[key] extends Field ? Parameters<SchemaItem[key]['serialize']>[0] : never;
24
+ };
25
+ type TxParamsAsyncBySchemaInternalParams<SchemaItem, SchemaItemValues = SchemaItem[keyof SchemaItem]> = UnionToIntersection<SchemaItemValues extends Field & {
26
+ prepare: Function;
27
+ } ? Or<Parameters<SchemaItemValues['prepare']>[2], {}> : {}>;
28
+ type TxParamsAsyncBySchema<SchemaItem> = SchemaItem extends Object ? TxParamsAsyncBySchemaInternal<PickIsRec<SchemaItem, true>> & NullablePartial<TxParamsAsyncBySchemaInternal<PickIsRec<SchemaItem, false>>> & TxParamsAsyncBySchemaInternalParams<PickIsRec<SchemaItem, false>> & TxParamsBySchemaInternalParams<PickIsRec<SchemaItem, false>> : never;
29
+ type TxUnpackedBySchema<SchemaItem> = {
30
+ -readonly [key in keyof SchemaItem]: SchemaItem[key] extends Field ? ReturnType<SchemaItem[key]['deserialize']> : never;
31
+ };
32
+ export default interface SchemaTypes<Schema extends readonly any[], SchemaItems = Schema[number]> {
33
+ TxParams: TxParamsBySchema<SchemaItems>;
34
+ TxParamsAsync: TxParamsAsyncBySchema<SchemaItems>;
35
+ TxUnpacked: TxUnpackedBySchema<SchemaItems>;
36
+ }
37
+ export {};
@@ -16,7 +16,8 @@ export declare const NAME_BID_RANGES: {
16
16
  [k: string]: BigNumber;
17
17
  };
18
18
  export declare enum ConsensusProtocolVersion {
19
- Iris = 5
19
+ Iris = 5,
20
+ Ceres = 6
20
21
  }
21
22
  /**
22
23
  * @category transaction builder
@@ -94,5 +95,6 @@ export declare enum Tag {
94
95
  AccountsMtree = 626,
95
96
  GaAttachTx = 80,
96
97
  GaMetaTx = 81,
97
- PayingForTx = 82
98
+ PayingForTx = 82,
99
+ GaMetaTxAuthData = 810
98
100
  }
@@ -1,10 +1,19 @@
1
1
  /// <reference types="node" />
2
2
  import { Tag, ConsensusProtocolVersion, AbiVersion } from '../constants';
3
+ import Node from '../../../Node';
3
4
  declare const _default: {
4
- serialize(value: AbiVersion | undefined, { tag, consensusProtocolVersion }: {
5
+ _getProtocolDetails(c: ConsensusProtocolVersion, tag: Tag): AbiVersion;
6
+ serialize(value: AbiVersion | undefined, { tag }: {
5
7
  tag: Tag;
6
- consensusProtocolVersion: ConsensusProtocolVersion;
8
+ }, { consensusProtocolVersion }: {
9
+ consensusProtocolVersion?: ConsensusProtocolVersion | undefined;
7
10
  }): Buffer;
11
+ prepare(value: AbiVersion | undefined, { tag }: {
12
+ tag: Tag;
13
+ }, options: {
14
+ consensusProtocolVersion?: ConsensusProtocolVersion;
15
+ onNode?: Node;
16
+ }): Promise<AbiVersion | undefined>;
8
17
  deserialize(buffer: Buffer): AbiVersion;
9
18
  };
10
19
  export default _default;
@@ -2,6 +2,6 @@ export default function genArrayField<Input, Output, Binary>(itemHandler: {
2
2
  serialize: (value: Input, params: unknown) => Binary;
3
3
  deserialize: (value: Binary, params: unknown) => Output;
4
4
  }): {
5
- serialize: (value: Input[], params: unknown) => Binary[];
5
+ serialize: (value: readonly Input[], params: unknown) => Binary[];
6
6
  deserialize: (value: Binary[], params: unknown) => Output[];
7
7
  };
@@ -1,12 +1,11 @@
1
1
  /// <reference types="node" />
2
2
  import { Int } from '../constants';
3
3
  import { AE_AMOUNT_FORMATS } from '../../../utils/amount-formatter';
4
- export interface Options {
5
- denomination?: AE_AMOUNT_FORMATS;
6
- }
7
4
  declare const _default: {
8
5
  serializeAettos(value: string | undefined): string;
9
- serialize(value: Int | undefined, { denomination, ...options }: Options): Buffer;
6
+ serialize(value: Int | undefined, params: {}, { denomination }: {
7
+ denomination?: AE_AMOUNT_FORMATS | undefined;
8
+ }): Buffer;
10
9
  deserialize(value: Buffer): string;
11
10
  };
12
11
  export default _default;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { ConsensusProtocolVersion, VmVersion, AbiVersion } from '../constants';
3
+ import Node from '../../../Node';
3
4
  export declare const ProtocolToVmAbi: {
4
5
  readonly 5: {
5
6
  readonly 'contract-create': {
@@ -23,7 +24,32 @@ export declare const ProtocolToVmAbi: {
23
24
  ];
24
25
  readonly abiVersion: readonly [
25
26
  AbiVersion.NoAbi,
26
- AbiVersion.Sophia
27
+ AbiVersion.Fate
28
+ ];
29
+ };
30
+ };
31
+ readonly 6: {
32
+ readonly 'contract-create': {
33
+ readonly vmVersion: readonly [
34
+ VmVersion.Fate2
35
+ ];
36
+ readonly abiVersion: readonly [
37
+ AbiVersion.Fate
38
+ ];
39
+ };
40
+ readonly 'contract-call': {
41
+ readonly vmVersion: readonly [
42
+ ];
43
+ readonly abiVersion: readonly [
44
+ AbiVersion.Fate
45
+ ];
46
+ };
47
+ readonly 'oracle-call': {
48
+ readonly vmVersion: readonly [
49
+ ];
50
+ readonly abiVersion: readonly [
51
+ AbiVersion.NoAbi,
52
+ AbiVersion.Fate
27
53
  ];
28
54
  };
29
55
  };
@@ -34,9 +60,13 @@ export interface CtVersion {
34
60
  }
35
61
  export declare function getProtocolDetails(protocolVersion: ConsensusProtocolVersion, type: 'contract-create' | 'contract-call' | 'oracle-call'): CtVersion;
36
62
  declare const _default: {
37
- serialize(value: CtVersion | undefined, { consensusProtocolVersion }: {
38
- consensusProtocolVersion: ConsensusProtocolVersion;
63
+ serialize(value: CtVersion | undefined, params: {}, { consensusProtocolVersion }: {
64
+ consensusProtocolVersion?: ConsensusProtocolVersion | undefined;
39
65
  }): Buffer;
66
+ prepare(value: CtVersion | undefined, params: {}, options: {
67
+ consensusProtocolVersion?: ConsensusProtocolVersion;
68
+ onNode?: Node;
69
+ }): Promise<CtVersion | undefined>;
40
70
  deserialize(buffer: Buffer): CtVersion;
41
71
  };
42
72
  export default _default;
@@ -5,9 +5,10 @@ declare const _default: {
5
5
  /**
6
6
  * @param value - Deposit value in string format. Should be equal to '0'.
7
7
  * @param options - Options
8
+ * @param parameters - Parameters
8
9
  * @returns Deposit value Buffer.
9
10
  */
10
- serialize(value: Int | undefined, options: Parameters<(typeof coinAmount)['serialize']>[1]): Buffer;
11
+ serialize(value: Int | undefined, options: Parameters<(typeof coinAmount)['serialize']>[1], parameters: Parameters<(typeof coinAmount)['serialize']>[2]): Buffer;
11
12
  serializeAettos(value: string | undefined): string;
12
13
  deserialize(value: Buffer): string;
13
14
  };
@@ -2,5 +2,5 @@
2
2
  import { Encoded, Encoding } from '../../../utils/encoder';
3
3
  export default function genEncodedField<E extends Encoding, Optional extends boolean = false>(encoding: E, optional?: Optional): {
4
4
  serialize: Optional extends true ? (value?: Encoded.Generic<E>) => Buffer : (value: Encoded.Generic<E>) => Buffer;
5
- deserialize: (value: Buffer) => Encoded.Generic<Encoding>;
5
+ deserialize: (value: Buffer) => Encoded.Generic<E>;
6
6
  };
@@ -14,7 +14,9 @@ declare const _default: {
14
14
  _computingMinFee?: BigNumber | undefined;
15
15
  _pickBiggerFee?: boolean | undefined;
16
16
  }): string;
17
- serialize(value: import("../constants").Int | undefined, { denomination, ...options }: import("./coin-amount").Options): Buffer;
17
+ serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
18
+ denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
19
+ }): Buffer;
18
20
  deserialize(value: Buffer): string;
19
21
  };
20
22
  export default _default;
@@ -2,13 +2,14 @@
2
2
  import { Tag } from '../constants';
3
3
  import type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';
4
4
  declare const _default: {
5
- serialize(_value: number | undefined, { tag, rebuildTx, unpackTx, buildTx, gasMax, _computingGasLimit, }: {
5
+ serialize(_value: number | undefined, { tag, rebuildTx, unpackTx, buildTx, _computingGasLimit, }: {
6
6
  tag: Tag;
7
7
  rebuildTx: (params: any) => any;
8
8
  unpackTx: typeof unpackTxType;
9
9
  buildTx: typeof buildTxType;
10
- gasMax: number;
11
10
  _computingGasLimit?: number | undefined;
11
+ }, { gasMax }: {
12
+ gasMax?: number | undefined;
12
13
  }): Buffer;
13
14
  deserialize(value: Buffer): number;
14
15
  };
@@ -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("../constants").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;
@@ -4,13 +4,24 @@ import _array from './array';
4
4
  import _encoded from './encoded';
5
5
  import _entry from './entry';
6
6
  import _enumeration from './enumeration';
7
+ import _map from './map';
7
8
  import _mptree from './mptree';
9
+ import _nonce from './nonce';
8
10
  import _shortUIntConst from './short-u-int-const';
11
+ import _wrapped from './wrapped';
9
12
  declare const abiVersion: {
10
- serialize(value: import("../constants").AbiVersion | undefined, { tag, consensusProtocolVersion }: {
13
+ _getProtocolDetails(c: import("../constants").ConsensusProtocolVersion, tag: import("../constants").Tag): import("../constants").AbiVersion;
14
+ serialize(value: import("../constants").AbiVersion | undefined, { tag }: {
11
15
  tag: import("../constants").Tag;
12
- consensusProtocolVersion: import("../constants").ConsensusProtocolVersion;
16
+ }, { consensusProtocolVersion }: {
17
+ consensusProtocolVersion?: import("../constants").ConsensusProtocolVersion | undefined;
13
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>;
14
25
  deserialize(buffer: Buffer): import("../constants").AbiVersion;
15
26
  };
16
27
  declare const address: typeof _address;
@@ -21,17 +32,25 @@ declare const boolean: {
21
32
  };
22
33
  declare const coinAmount: {
23
34
  serializeAettos(value: string | undefined): string;
24
- serialize(value: import("../constants").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;
25
38
  deserialize(value: Buffer): string;
26
39
  };
27
40
  declare const ctVersion: {
28
- serialize(value: import("./ct-version").CtVersion | undefined, { consensusProtocolVersion }: {
29
- consensusProtocolVersion: import("../constants").ConsensusProtocolVersion;
41
+ serialize(value: import("./ct-version").CtVersion | undefined, params: {}, { consensusProtocolVersion }: {
42
+ consensusProtocolVersion?: import("../constants").ConsensusProtocolVersion | undefined;
30
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>;
31
48
  deserialize(buffer: Buffer): import("./ct-version").CtVersion;
32
49
  };
33
50
  declare const deposit: {
34
- serialize(value: import("../constants").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;
35
54
  serializeAettos(value: string | undefined): string;
36
55
  deserialize(value: Buffer): string;
37
56
  };
@@ -46,7 +65,9 @@ declare const fee: {
46
65
  _computingMinFee?: import("bignumber.js").BigNumber | undefined;
47
66
  _pickBiggerFee?: boolean | undefined;
48
67
  }): string;
49
- serialize(value: import("../constants").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;
50
71
  deserialize(value: Buffer): string;
51
72
  };
52
73
  declare const field: {
@@ -54,21 +75,25 @@ declare const field: {
54
75
  deserialize(value: Buffer): string;
55
76
  };
56
77
  declare const gasLimit: {
57
- serialize(_value: number | undefined, { tag, rebuildTx, unpackTx, buildTx, gasMax, _computingGasLimit, }: {
78
+ serialize(_value: number | undefined, { tag, rebuildTx, unpackTx, buildTx, _computingGasLimit, }: {
58
79
  tag: import("../constants").Tag;
59
80
  rebuildTx: (params: any) => any;
60
81
  unpackTx: typeof import("..").unpackTx;
61
82
  buildTx: typeof import("..").buildTx;
62
- gasMax: number;
63
83
  _computingGasLimit?: number | undefined;
84
+ }, { gasMax }: {
85
+ gasMax?: number | undefined;
64
86
  }): Buffer;
65
87
  deserialize(value: Buffer): number;
66
88
  };
67
89
  declare const gasPrice: {
68
90
  serializeAettos(value?: string | undefined): string;
69
- serialize(value: import("../constants").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;
70
94
  deserialize(value: Buffer): string;
71
95
  };
96
+ declare const map: typeof _map;
72
97
  declare const mptree: typeof _mptree;
73
98
  declare const name: {
74
99
  serialize(value: `${string}.chain`): Buffer;
@@ -80,13 +105,16 @@ declare const nameFee: {
80
105
  }): string;
81
106
  serialize(value: import("../constants").Int | undefined, txFields: {
82
107
  name: `${string}.chain`;
83
- } & import("./coin-amount").Options): Buffer;
108
+ }, parameters: {
109
+ denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
110
+ }): Buffer;
84
111
  deserialize(value: Buffer): string;
85
112
  };
86
113
  declare const nameId: {
87
114
  serialize(value: `${string}.chain` | `nm_${string}`): Buffer;
88
115
  deserialize: (value: Buffer) => `nm_${string}`;
89
116
  };
117
+ declare const nonce: typeof _nonce;
90
118
  declare const pointers: {
91
119
  serialize(pointers: (import("../../../apis/node").NamePointer & {
92
120
  id: `ch_${string}` | `ct_${string}` | `ok_${string}` | `ak_${string}` | `cm_${string}` | `nm_${string}`;
@@ -111,10 +139,19 @@ declare const string: {
111
139
  serialize(string: string): Buffer;
112
140
  deserialize(buffer: Buffer): string;
113
141
  };
142
+ declare const ttl: {
143
+ serialize(value: number | undefined): Buffer;
144
+ prepare(value: number | undefined, params: {}, { onNode, absoluteTtl }: {
145
+ onNode?: import("../../..").Node | undefined;
146
+ absoluteTtl?: boolean | undefined;
147
+ }): Promise<number | undefined>;
148
+ deserialize(value: Buffer): number;
149
+ };
114
150
  declare const uInt: {
115
151
  serialize(value: import("../constants").Int): Buffer;
116
152
  deserialize(value: Buffer): string;
117
153
  };
154
+ declare const wrapped: typeof _wrapped;
118
155
  export type BinaryData = Buffer | Buffer[] | Buffer[][] | Array<[
119
156
  Buffer,
120
157
  Array<[
@@ -123,7 +160,9 @@ export type BinaryData = Buffer | Buffer[] | Buffer[][] | Array<[
123
160
  ]>
124
161
  ]>;
125
162
  export interface Field {
126
- serialize: (value: any, options: any) => BinaryData;
163
+ serialize: (value: any, options: any, parameters: any) => BinaryData;
164
+ prepare?: (value: any, options: any, parameters: any) => Promise<any>;
127
165
  deserialize: (value: BinaryData, options: any) => any;
166
+ recursiveType?: boolean;
128
167
  }
129
- 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, };
168
+ 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, };
@@ -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
+ };
@@ -2,6 +2,7 @@
2
2
  import { Tag } from '../constants';
3
3
  import { Encoded, Encoding } from '../../../utils/encoder';
4
4
  import type { unpackTx } from '..';
5
+ import type { TxUnpacked } from '../schema.generated';
5
6
  type MPTreeBinary = [
6
7
  Buffer,
7
8
  Array<[
@@ -31,8 +32,12 @@ declare class MPTree<E extends Encoding, T extends Tag> {
31
32
  * @param key - The key of the element to retrieve
32
33
  * @returns Value associated to the specified key
33
34
  */
34
- get(key: Encoded.Generic<E>): ReturnType<any> | undefined;
35
- toObject(): Record<Encoded.Any, ReturnType<any>>;
35
+ get(key: Encoded.Generic<E>): TxUnpacked & {
36
+ tag: T;
37
+ } | undefined;
38
+ toObject(): Record<Encoded.Generic<E>, TxUnpacked & {
39
+ tag: T;
40
+ }>;
36
41
  }
37
42
  export default function genMPTreeField<E extends Encoding, T extends Tag>(encoding: E, tag: T): {
38
43
  serialize: (value: MPTree<E, T>) => MPTreeBinary;
@@ -12,7 +12,7 @@ declare const _default: {
12
12
  */
13
13
  serialize(value: Int | undefined, txFields: {
14
14
  name: AensName;
15
- } & Parameters<(typeof coinAmount)['serialize']>[1]): Buffer;
15
+ } & Parameters<(typeof coinAmount)['serialize']>[1], parameters: Parameters<(typeof coinAmount)['serialize']>[2]): Buffer;
16
16
  deserialize(value: Buffer): string;
17
17
  };
18
18
  export default _default;
@@ -0,0 +1,14 @@
1
+ /// <reference types="node" />
2
+ import Node from '../../../Node';
3
+ import { NextNonceStrategy } from '../../../apis/node';
4
+ export default function genNonceField<SenderKey extends string>(senderKey: SenderKey): {
5
+ serialize: (value: number) => Buffer;
6
+ prepare: (value: number | undefined, params: {}, options: {
7
+ [key in SenderKey]: string;
8
+ } & {
9
+ strategy?: NextNonceStrategy;
10
+ onNode?: Node;
11
+ }) => Promise<number>;
12
+ deserialize: (value: Buffer) => number;
13
+ senderKey: string;
14
+ };
@@ -1,5 +1,7 @@
1
1
  /// <reference types="node" />
2
- export default function genShortUIntConstField<Value extends number>(value: Value): {
3
- serialize: (value?: Value) => Buffer;
2
+ export default function genShortUIntConstField<Value extends number, Optional extends boolean = false>(constValue: Value, optional?: Optional): {
3
+ serialize: Optional extends true ? (value?: Value) => Buffer : (value: Value) => Buffer;
4
4
  deserialize: (value: Buffer) => Value;
5
+ constValue: Value;
6
+ constValueOptional: boolean;
5
7
  };
@@ -0,0 +1,11 @@
1
+ /// <reference types="node" />
2
+ import Node from '../../../Node';
3
+ declare const _default: {
4
+ serialize(value: number | undefined): Buffer;
5
+ prepare(value: number | undefined, params: {}, { onNode, absoluteTtl }: {
6
+ onNode?: Node | undefined;
7
+ absoluteTtl?: boolean | undefined;
8
+ }): Promise<number | undefined>;
9
+ deserialize(value: Buffer): number;
10
+ };
11
+ export default _default;
@@ -0,0 +1,14 @@
1
+ /// <reference types="node" />
2
+ import { Tag } from '../constants';
3
+ import type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';
4
+ type TagWrapping = Tag.AccountsMtree | Tag.CallsMtree | Tag.ChannelsMtree | Tag.ContractsMtree | Tag.NameserviceMtree | Tag.OraclesMtree;
5
+ export default function genWrappedField<T extends TagWrapping>(tag: T): {
6
+ serialize: (value: any, options: {
7
+ buildTx: typeof buildTxType;
8
+ }) => Buffer;
9
+ deserialize: (value: Buffer, options: {
10
+ unpackTx: typeof unpackTxType;
11
+ }) => any;
12
+ recursiveType: true;
13
+ };
14
+ export {};
@@ -1,39 +1,42 @@
1
1
  import { Encoded, Encoding } from '../../utils/encoder';
2
- import { AE_AMOUNT_FORMATS } from '../../utils/amount-formatter';
3
- import { RawTxObject, TxTypeSchemas } from './schema';
2
+ import { Field } from './field-types';
3
+ import { TxUnpacked, TxParams, TxParamsAsync } from './schema.generated';
4
4
  import { Tag } from './constants';
5
+ /**
6
+ * JavaScript-based Transaction builder
7
+ */
8
+ export declare function getSchema(tag: Tag, version?: number): Array<[
9
+ string,
10
+ Field
11
+ ]>;
5
12
  /**
6
13
  * Build transaction hash
7
14
  * @category transaction builder
8
15
  * @param params - Object with tx params
9
16
  * @param options - options
10
- * @param options.denomination - Denomination of amounts
11
17
  * @param options.prefix - Prefix of transaction
12
- * @throws {@link InvalidTxParamsError}
13
- * @returns object
14
- * @returns object.tx Base64Check transaction hash with 'tx_' prefix
15
- * @returns object.rlpEncoded rlp encoded transaction
16
- * @returns object.binary binary transaction
18
+ * @returns object Base64Check transaction hash with 'tx_' prefix
17
19
  */
18
- export declare function buildTx<TxType extends Tag, E extends Encoding = Encoding.Transaction>(params: {
19
- tag: TxType;
20
- version?: number;
21
- } & Omit<TxTypeSchemas[TxType], 'tag' | 'version'> & (TxType extends Tag.ContractCreateTx | Tag.ContractCallTx | Tag.ChannelOffChainUpdateCallContract | Tag.GaAttachTx | Tag.GaMetaTx ? {
22
- gasMax?: number;
23
- } : {}), { prefix, denomination, }?: {
20
+ export declare function buildTx<E extends Encoding = Encoding.Transaction>(params: TxParams, { prefix, }?: {
24
21
  prefix?: E;
25
- denomination?: AE_AMOUNT_FORMATS;
26
22
  }): Encoded.Generic<E>;
23
+ export type BuildTxOptions<TxType extends Tag, OmitFields extends string> = Omit<TxParamsAsync & {
24
+ tag: TxType;
25
+ }, 'tag' | OmitFields>;
27
26
  /**
28
- * Unpack transaction hash
27
+ * @category transaction builder
28
+ */
29
+ export declare function buildTxAsync(params: TxParamsAsync): Promise<Encoded.Transaction>;
30
+ /**
31
+ * Unpack transaction encoded as string
29
32
  * @category transaction builder
30
33
  * @param encodedTx - Transaction to unpack
31
34
  * @param txType - Expected transaction type
32
- * @returns object
33
- * @returns object.tx Object with transaction param's
34
- * @returns object.txType Transaction type
35
+ * @returns Object with transaction param's
35
36
  */
36
- export declare function unpackTx<TxType extends Tag>(encodedTx: Encoded.Transaction | Encoded.Poi, txType?: TxType): RawTxObject<TxTypeSchemas[TxType]>;
37
+ export declare function unpackTx<TxType extends Tag>(encodedTx: Encoded.Transaction | Encoded.Poi | Encoded.StateTrees | Encoded.CallStateTree, txType?: TxType): TxUnpacked & {
38
+ tag: TxType;
39
+ };
37
40
  /**
38
41
  * Build a transaction hash
39
42
  * @category transaction builder