@aeternity/aepp-sdk 13.0.0-alpha.1 → 13.0.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 (394) hide show
  1. package/README.md +1 -1
  2. package/bin/aesophia_cli +0 -0
  3. package/dist/aepp-sdk.browser-script.js +1 -1
  4. package/dist/aepp-sdk.browser-script.js.map +1 -1
  5. package/dist/aepp-sdk.browser.js +1 -1
  6. package/dist/aepp-sdk.browser.js.map +1 -1
  7. package/dist/aepp-sdk.js +1833 -1543
  8. package/dist/aepp-sdk.js.map +1 -1
  9. package/es/AeSdk.mjs.map +1 -1
  10. package/es/AeSdkAepp.d.ts +5 -4
  11. package/es/AeSdkAepp.mjs +13 -17
  12. package/es/AeSdkAepp.mjs.map +1 -1
  13. package/es/AeSdkBase.mjs.map +1 -1
  14. package/es/AeSdkMethods.d.ts +11 -12
  15. package/es/AeSdkMethods.mjs +6 -8
  16. package/es/AeSdkMethods.mjs.map +1 -1
  17. package/es/AeSdkWallet.mjs +1 -1
  18. package/es/AeSdkWallet.mjs.map +1 -1
  19. package/es/Node.d.ts +5 -1
  20. package/es/Node.mjs +11 -5
  21. package/es/Node.mjs.map +1 -1
  22. package/es/account/Base.d.ts +11 -6
  23. package/es/account/Base.mjs +0 -17
  24. package/es/account/Base.mjs.map +1 -1
  25. package/es/account/Generalized.mjs +12 -25
  26. package/es/account/Generalized.mjs.map +1 -1
  27. package/es/account/Ledger.mjs.map +1 -1
  28. package/es/account/LedgerFactory.mjs.map +1 -1
  29. package/es/account/Memory.d.ts +2 -1
  30. package/es/account/Memory.mjs +9 -21
  31. package/es/account/Memory.mjs.map +1 -1
  32. package/es/account/Rpc.mjs.map +1 -1
  33. package/es/aens.d.ts +12 -14
  34. package/es/aens.mjs +17 -31
  35. package/es/aens.mjs.map +1 -1
  36. package/es/aepp-wallet-communication/connection/Browser.mjs +0 -16
  37. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
  38. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +0 -16
  39. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
  40. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +0 -16
  41. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
  42. package/es/aepp-wallet-communication/connection-proxy.mjs +0 -17
  43. package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
  44. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +4 -5
  45. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
  46. package/es/aepp-wallet-communication/rpc/types.d.ts +6 -2
  47. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
  48. package/es/aepp-wallet-communication/schema.mjs.map +1 -1
  49. package/es/aepp-wallet-communication/wallet-detector.mjs +0 -16
  50. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
  51. package/es/apis/compiler/compiler.d.ts +1 -1
  52. package/es/apis/compiler/compiler.mjs +4 -20
  53. package/es/apis/compiler/compiler.mjs.map +1 -1
  54. package/es/apis/compiler/models/index.d.ts +3 -2
  55. package/es/apis/compiler/models/index.mjs.map +1 -1
  56. package/es/apis/compiler/models/mappers.d.ts +1 -1
  57. package/es/apis/compiler/models/mappers.mjs +19 -2
  58. package/es/apis/compiler/models/mappers.mjs.map +1 -1
  59. package/es/apis/node/models/index.d.ts +15 -15
  60. package/es/apis/node/models/index.mjs.map +1 -1
  61. package/es/apis/node/models/mappers.d.ts +1 -1
  62. package/es/apis/node/models/mappers.mjs +2 -1
  63. package/es/apis/node/models/mappers.mjs.map +1 -1
  64. package/es/apis/node/models/parameters.d.ts +2 -2
  65. package/es/apis/node/models/parameters.mjs +2 -2
  66. package/es/apis/node/models/parameters.mjs.map +1 -1
  67. package/es/apis/node/node.mjs +3 -19
  68. package/es/apis/node/node.mjs.map +1 -1
  69. package/es/chain.d.ts +8 -8
  70. package/es/chain.mjs +20 -23
  71. package/es/chain.mjs.map +1 -1
  72. package/es/channel/Base.d.ts +25 -12
  73. package/es/channel/Base.mjs +23 -26
  74. package/es/channel/Base.mjs.map +1 -1
  75. package/es/channel/Contract.mjs +8 -21
  76. package/es/channel/Contract.mjs.map +1 -1
  77. package/es/channel/Spend.d.ts +4 -2
  78. package/es/channel/Spend.mjs +0 -16
  79. package/es/channel/Spend.mjs.map +1 -1
  80. package/es/channel/handlers.mjs +6 -18
  81. package/es/channel/handlers.mjs.map +1 -1
  82. package/es/channel/internal.d.ts +19 -2
  83. package/es/channel/internal.mjs +19 -19
  84. package/es/channel/internal.mjs.map +1 -1
  85. package/es/contract/Contract.d.ts +30 -85
  86. package/es/contract/Contract.mjs +197 -215
  87. package/es/contract/Contract.mjs.map +1 -1
  88. package/es/contract/compiler/Base.d.ts +10 -14
  89. package/es/contract/compiler/Base.mjs.map +1 -1
  90. package/es/contract/compiler/Cli.mjs +5 -11
  91. package/es/contract/compiler/Cli.mjs.map +1 -1
  92. package/es/contract/compiler/Http.mjs +6 -30
  93. package/es/contract/compiler/Http.mjs.map +1 -1
  94. package/es/contract/compiler/HttpNode.mjs.map +1 -1
  95. package/es/contract/compiler/getFileSystem.mjs.map +1 -1
  96. package/es/contract/delegation-signature.d.ts +43 -0
  97. package/es/contract/delegation-signature.mjs +45 -0
  98. package/es/contract/delegation-signature.mjs.map +1 -0
  99. package/es/contract/ga.d.ts +23 -7
  100. package/es/contract/ga.mjs +52 -27
  101. package/es/contract/ga.mjs.map +1 -1
  102. package/es/index-browser.d.ts +5 -4
  103. package/es/index-browser.mjs +7 -21
  104. package/es/index-browser.mjs.map +1 -1
  105. package/es/oracle.d.ts +12 -17
  106. package/es/oracle.mjs +28 -48
  107. package/es/oracle.mjs.map +1 -1
  108. package/es/spend.d.ts +19 -27
  109. package/es/spend.mjs +20 -43
  110. package/es/spend.mjs.map +1 -1
  111. package/es/tx/builder/SchemaTypes.d.ts +37 -0
  112. package/es/tx/builder/SchemaTypes.mjs +2 -0
  113. package/es/tx/builder/SchemaTypes.mjs.map +1 -0
  114. package/es/tx/builder/constants.d.ts +4 -2
  115. package/es/tx/builder/constants.mjs +2 -0
  116. package/es/tx/builder/constants.mjs.map +1 -1
  117. package/es/tx/builder/field-types/abi-version.d.ts +11 -2
  118. package/es/tx/builder/field-types/abi-version.mjs +24 -4
  119. package/es/tx/builder/field-types/abi-version.mjs.map +1 -1
  120. package/es/tx/builder/field-types/address.mjs.map +1 -1
  121. package/es/tx/builder/field-types/array.d.ts +1 -1
  122. package/es/tx/builder/field-types/array.mjs.map +1 -1
  123. package/es/tx/builder/field-types/boolean.mjs.map +1 -1
  124. package/es/tx/builder/field-types/coin-amount.d.ts +3 -4
  125. package/es/tx/builder/field-types/coin-amount.mjs +4 -5
  126. package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
  127. package/es/tx/builder/field-types/ct-version.d.ts +22 -3
  128. package/es/tx/builder/field-types/ct-version.mjs +32 -4
  129. package/es/tx/builder/field-types/ct-version.mjs.map +1 -1
  130. package/es/tx/builder/field-types/deposit.d.ts +2 -1
  131. package/es/tx/builder/field-types/deposit.mjs +3 -2
  132. package/es/tx/builder/field-types/deposit.mjs.map +1 -1
  133. package/es/tx/builder/field-types/encoded.d.ts +1 -1
  134. package/es/tx/builder/field-types/encoded.mjs.map +1 -1
  135. package/es/tx/builder/field-types/entry.mjs +3 -0
  136. package/es/tx/builder/field-types/entry.mjs.map +1 -1
  137. package/es/tx/builder/field-types/enumeration.mjs.map +1 -1
  138. package/es/tx/builder/field-types/fee.d.ts +3 -1
  139. package/es/tx/builder/field-types/fee.mjs +5 -1
  140. package/es/tx/builder/field-types/fee.mjs.map +1 -1
  141. package/es/tx/builder/field-types/field.mjs.map +1 -1
  142. package/es/tx/builder/field-types/gas-limit.d.ts +3 -2
  143. package/es/tx/builder/field-types/gas-limit.mjs +4 -2
  144. package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
  145. package/es/tx/builder/field-types/gas-price.d.ts +3 -1
  146. package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
  147. package/es/tx/builder/field-types/index.d.ts +52 -13
  148. package/es/tx/builder/field-types/index.mjs +10 -2
  149. package/es/tx/builder/field-types/index.mjs.map +1 -1
  150. package/es/tx/builder/field-types/map.d.ts +13 -0
  151. package/es/tx/builder/field-types/map.mjs +49 -0
  152. package/es/tx/builder/field-types/map.mjs.map +1 -0
  153. package/es/tx/builder/field-types/mptree.d.ts +7 -2
  154. package/es/tx/builder/field-types/mptree.mjs +5 -7
  155. package/es/tx/builder/field-types/mptree.mjs.map +1 -1
  156. package/es/tx/builder/field-types/name-fee.d.ts +1 -1
  157. package/es/tx/builder/field-types/name-fee.mjs +2 -2
  158. package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
  159. package/es/tx/builder/field-types/name-id.mjs.map +1 -1
  160. package/es/tx/builder/field-types/name.mjs.map +1 -1
  161. package/es/tx/builder/field-types/nonce.d.ts +14 -0
  162. package/es/tx/builder/field-types/nonce.mjs +29 -0
  163. package/es/tx/builder/field-types/nonce.mjs.map +1 -0
  164. package/es/tx/builder/field-types/pointers.mjs.map +1 -1
  165. package/es/tx/builder/field-types/raw.mjs.map +1 -1
  166. package/es/tx/builder/field-types/short-u-int-const.d.ts +4 -2
  167. package/es/tx/builder/field-types/short-u-int-const.mjs +12 -8
  168. package/es/tx/builder/field-types/short-u-int-const.mjs.map +1 -1
  169. package/es/tx/builder/field-types/short-u-int.mjs.map +1 -1
  170. package/es/tx/builder/field-types/string.mjs.map +1 -1
  171. package/es/tx/builder/field-types/ttl.d.ts +11 -0
  172. package/es/tx/builder/field-types/ttl.mjs +21 -0
  173. package/es/tx/builder/field-types/ttl.mjs.map +1 -0
  174. package/es/tx/builder/field-types/u-int.mjs.map +1 -1
  175. package/es/tx/builder/field-types/wrapped.d.ts +14 -0
  176. package/es/tx/builder/field-types/wrapped.mjs +22 -0
  177. package/es/tx/builder/field-types/wrapped.mjs.map +1 -0
  178. package/es/tx/builder/helpers.mjs.map +1 -1
  179. package/es/tx/builder/index.d.ts +20 -20
  180. package/es/tx/builder/index.mjs +54 -64
  181. package/es/tx/builder/index.mjs.map +1 -1
  182. package/es/tx/builder/schema.d.ts +2735 -2865
  183. package/es/tx/builder/schema.generated.d.ts +2011 -0
  184. package/es/tx/builder/schema.generated.mjs +2 -0
  185. package/es/tx/builder/schema.generated.mjs.map +1 -0
  186. package/es/tx/builder/schema.mjs +459 -155
  187. package/es/tx/builder/schema.mjs.map +1 -1
  188. package/es/tx/execution-cost.d.ts +35 -0
  189. package/es/tx/execution-cost.mjs +123 -0
  190. package/es/tx/execution-cost.mjs.map +1 -0
  191. package/es/tx/transaction-signer.d.ts +6 -0
  192. package/es/tx/transaction-signer.mjs +27 -0
  193. package/es/tx/transaction-signer.mjs.map +1 -0
  194. package/es/tx/validator.mjs +60 -109
  195. package/es/tx/validator.mjs.map +1 -1
  196. package/es/utils/amount-formatter.mjs +0 -16
  197. package/es/utils/amount-formatter.mjs.map +1 -1
  198. package/es/utils/autorest.d.ts +3 -2
  199. package/es/utils/autorest.mjs +43 -11
  200. package/es/utils/autorest.mjs.map +1 -1
  201. package/es/utils/bytes.mjs +0 -16
  202. package/es/utils/bytes.mjs.map +1 -1
  203. package/es/utils/crypto.mjs +0 -16
  204. package/es/utils/crypto.mjs.map +1 -1
  205. package/es/utils/encoder.mjs.map +1 -1
  206. package/es/utils/errors.d.ts +14 -31
  207. package/es/utils/errors.mjs +3 -33
  208. package/es/utils/errors.mjs.map +1 -1
  209. package/es/utils/hd-wallet.mjs.map +1 -1
  210. package/es/utils/json-big.mjs.map +1 -1
  211. package/es/utils/keystore.mjs.map +1 -1
  212. package/es/utils/other.d.ts +1 -1
  213. package/es/utils/other.mjs.map +1 -1
  214. package/es/utils/semver-satisfies.mjs.map +1 -1
  215. package/es/utils/string.mjs +0 -17
  216. package/es/utils/string.mjs.map +1 -1
  217. package/package.json +34 -30
  218. package/src/AeSdkAepp.ts +16 -14
  219. package/src/AeSdkMethods.ts +11 -16
  220. package/src/AeSdkWallet.ts +1 -1
  221. package/src/Node.ts +17 -6
  222. package/src/account/Base.ts +11 -22
  223. package/src/account/Generalized.ts +9 -24
  224. package/src/account/Memory.ts +14 -21
  225. package/src/aens.ts +31 -47
  226. package/src/aepp-wallet-communication/connection/Browser.ts +0 -17
  227. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +0 -17
  228. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +0 -17
  229. package/src/aepp-wallet-communication/connection-proxy.ts +0 -17
  230. package/src/aepp-wallet-communication/rpc/types.ts +7 -2
  231. package/src/aepp-wallet-communication/wallet-detector.ts +0 -17
  232. package/src/apis/compiler/compiler.ts +3 -27
  233. package/src/apis/compiler/models/index.ts +3 -2
  234. package/src/apis/compiler/models/mappers.ts +15 -2
  235. package/src/apis/node/models/index.ts +16 -15
  236. package/src/apis/node/models/mappers.ts +2 -1
  237. package/src/apis/node/models/parameters.ts +2 -2
  238. package/src/apis/node/node.ts +3 -27
  239. package/src/chain.ts +29 -28
  240. package/src/channel/Base.ts +33 -33
  241. package/src/channel/Contract.ts +8 -23
  242. package/src/channel/Spend.ts +2 -17
  243. package/src/channel/handlers.ts +5 -18
  244. package/src/channel/internal.ts +40 -22
  245. package/src/contract/Contract.ts +161 -170
  246. package/src/contract/compiler/Base.ts +10 -14
  247. package/src/contract/compiler/Cli.ts +5 -11
  248. package/src/contract/compiler/Http.ts +6 -25
  249. package/src/contract/delegation-signature.ts +56 -0
  250. package/src/contract/ga.ts +53 -32
  251. package/src/index-browser.ts +15 -21
  252. package/src/oracle.ts +46 -56
  253. package/src/spend.ts +33 -67
  254. package/src/tx/builder/SchemaTypes.ts +79 -0
  255. package/src/tx/builder/constants.ts +2 -0
  256. package/src/tx/builder/field-types/abi-version.ts +29 -6
  257. package/src/tx/builder/field-types/array.ts +1 -1
  258. package/src/tx/builder/field-types/coin-amount.ts +6 -4
  259. package/src/tx/builder/field-types/ct-version.ts +37 -4
  260. package/src/tx/builder/field-types/deposit.ts +3 -1
  261. package/src/tx/builder/field-types/encoded.ts +1 -1
  262. package/src/tx/builder/field-types/entry.ts +8 -3
  263. package/src/tx/builder/field-types/fee.ts +6 -4
  264. package/src/tx/builder/field-types/gas-limit.ts +2 -2
  265. package/src/tx/builder/field-types/index.ts +15 -1
  266. package/src/tx/builder/field-types/map.ts +45 -0
  267. package/src/tx/builder/field-types/mptree.ts +4 -3
  268. package/src/tx/builder/field-types/name-fee.ts +2 -1
  269. package/src/tx/builder/field-types/nonce.ts +40 -0
  270. package/src/tx/builder/field-types/short-u-int-const.ts +18 -8
  271. package/src/tx/builder/field-types/ttl.ts +24 -0
  272. package/src/tx/builder/field-types/wrapped.ts +32 -0
  273. package/src/tx/builder/index.ts +57 -71
  274. package/src/tx/builder/schema.generated.ts +2013 -0
  275. package/src/tx/builder/schema.ts +544 -624
  276. package/src/tx/execution-cost.ts +146 -0
  277. package/src/tx/transaction-signer.ts +27 -0
  278. package/src/tx/validator.ts +60 -91
  279. package/src/utils/amount-formatter.ts +0 -16
  280. package/src/utils/autorest.ts +52 -11
  281. package/src/utils/bytes.ts +0 -16
  282. package/src/utils/crypto.ts +0 -16
  283. package/src/utils/errors.ts +16 -45
  284. package/src/utils/string.ts +0 -17
  285. package/types-legacy/ts4.2/AeSdkAepp.d.ts +5 -4
  286. package/types-legacy/ts4.2/AeSdkMethods.d.ts +11 -12
  287. package/types-legacy/ts4.2/Node.d.ts +5 -1
  288. package/types-legacy/ts4.2/account/Base.d.ts +11 -6
  289. package/types-legacy/ts4.2/account/Memory.d.ts +2 -1
  290. package/types-legacy/ts4.2/aens.d.ts +12 -14
  291. package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +6 -2
  292. package/types-legacy/ts4.2/apis/compiler/compiler.d.ts +1 -1
  293. package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +3 -2
  294. package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +1 -1
  295. package/types-legacy/ts4.2/apis/node/models/index.d.ts +15 -15
  296. package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +1 -1
  297. package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +2 -2
  298. package/types-legacy/ts4.2/chain.d.ts +8 -8
  299. package/types-legacy/ts4.2/channel/Base.d.ts +25 -12
  300. package/types-legacy/ts4.2/channel/Spend.d.ts +4 -2
  301. package/types-legacy/ts4.2/channel/internal.d.ts +22 -2
  302. package/types-legacy/ts4.2/contract/Contract.d.ts +29 -84
  303. package/types-legacy/ts4.2/contract/compiler/Base.d.ts +10 -14
  304. package/types-legacy/ts4.2/contract/delegation-signature.d.ts +43 -0
  305. package/types-legacy/ts4.2/contract/ga.d.ts +23 -7
  306. package/types-legacy/ts4.2/index-browser.d.ts +5 -4
  307. package/types-legacy/ts4.2/oracle.d.ts +12 -17
  308. package/types-legacy/ts4.2/spend.d.ts +19 -27
  309. package/types-legacy/ts4.2/tx/builder/SchemaTypes.d.ts +37 -0
  310. package/types-legacy/ts4.2/tx/builder/constants.d.ts +4 -2
  311. package/types-legacy/ts4.2/tx/builder/field-types/abi-version.d.ts +11 -2
  312. package/types-legacy/ts4.2/tx/builder/field-types/array.d.ts +1 -1
  313. package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +3 -4
  314. package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +33 -3
  315. package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +2 -1
  316. package/types-legacy/ts4.2/tx/builder/field-types/encoded.d.ts +1 -1
  317. package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +3 -1
  318. package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +3 -2
  319. package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +3 -1
  320. package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +52 -13
  321. package/types-legacy/ts4.2/tx/builder/field-types/map.d.ts +13 -0
  322. package/types-legacy/ts4.2/tx/builder/field-types/mptree.d.ts +7 -2
  323. package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +1 -1
  324. package/types-legacy/ts4.2/tx/builder/field-types/nonce.d.ts +14 -0
  325. package/types-legacy/ts4.2/tx/builder/field-types/short-u-int-const.d.ts +4 -2
  326. package/types-legacy/ts4.2/tx/builder/field-types/ttl.d.ts +11 -0
  327. package/types-legacy/ts4.2/tx/builder/field-types/wrapped.d.ts +14 -0
  328. package/types-legacy/ts4.2/tx/builder/index.d.ts +23 -20
  329. package/types-legacy/ts4.2/tx/builder/schema.d.ts +2962 -4629
  330. package/types-legacy/ts4.2/tx/builder/schema.generated.d.ts +2011 -0
  331. package/types-legacy/ts4.2/tx/execution-cost.d.ts +35 -0
  332. package/types-legacy/ts4.2/tx/transaction-signer.d.ts +6 -0
  333. package/types-legacy/ts4.2/utils/autorest.d.ts +3 -2
  334. package/types-legacy/ts4.2/utils/errors.d.ts +14 -31
  335. package/types-legacy/ts4.2/utils/other.d.ts +1 -1
  336. package/types-legacy/ts4.5/AeSdkAepp.d.ts +5 -4
  337. package/types-legacy/ts4.5/AeSdkMethods.d.ts +11 -12
  338. package/types-legacy/ts4.5/Node.d.ts +5 -1
  339. package/types-legacy/ts4.5/account/Base.d.ts +11 -6
  340. package/types-legacy/ts4.5/account/Memory.d.ts +2 -1
  341. package/types-legacy/ts4.5/aens.d.ts +12 -14
  342. package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +6 -2
  343. package/types-legacy/ts4.5/apis/compiler/compiler.d.ts +1 -1
  344. package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +3 -2
  345. package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +1 -1
  346. package/types-legacy/ts4.5/apis/node/models/index.d.ts +15 -15
  347. package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +1 -1
  348. package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +2 -2
  349. package/types-legacy/ts4.5/chain.d.ts +8 -8
  350. package/types-legacy/ts4.5/channel/Base.d.ts +25 -12
  351. package/types-legacy/ts4.5/channel/Spend.d.ts +4 -2
  352. package/types-legacy/ts4.5/channel/internal.d.ts +22 -2
  353. package/types-legacy/ts4.5/contract/Contract.d.ts +29 -84
  354. package/types-legacy/ts4.5/contract/compiler/Base.d.ts +10 -14
  355. package/types-legacy/ts4.5/contract/delegation-signature.d.ts +43 -0
  356. package/types-legacy/ts4.5/contract/ga.d.ts +23 -7
  357. package/types-legacy/ts4.5/index-browser.d.ts +5 -4
  358. package/types-legacy/ts4.5/oracle.d.ts +12 -17
  359. package/types-legacy/ts4.5/spend.d.ts +19 -27
  360. package/types-legacy/ts4.5/tx/builder/SchemaTypes.d.ts +37 -0
  361. package/types-legacy/ts4.5/tx/builder/constants.d.ts +4 -2
  362. package/types-legacy/ts4.5/tx/builder/field-types/abi-version.d.ts +11 -2
  363. package/types-legacy/ts4.5/tx/builder/field-types/array.d.ts +1 -1
  364. package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +3 -4
  365. package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +33 -3
  366. package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +2 -1
  367. package/types-legacy/ts4.5/tx/builder/field-types/encoded.d.ts +1 -1
  368. package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +3 -1
  369. package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +3 -2
  370. package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +3 -1
  371. package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +52 -13
  372. package/types-legacy/ts4.5/tx/builder/field-types/map.d.ts +13 -0
  373. package/types-legacy/ts4.5/tx/builder/field-types/mptree.d.ts +7 -2
  374. package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +1 -1
  375. package/types-legacy/ts4.5/tx/builder/field-types/nonce.d.ts +14 -0
  376. package/types-legacy/ts4.5/tx/builder/field-types/short-u-int-const.d.ts +4 -2
  377. package/types-legacy/ts4.5/tx/builder/field-types/ttl.d.ts +11 -0
  378. package/types-legacy/ts4.5/tx/builder/field-types/wrapped.d.ts +14 -0
  379. package/types-legacy/ts4.5/tx/builder/index.d.ts +23 -20
  380. package/types-legacy/ts4.5/tx/builder/schema.d.ts +2962 -4629
  381. package/types-legacy/ts4.5/tx/builder/schema.generated.d.ts +2011 -0
  382. package/types-legacy/ts4.5/tx/execution-cost.d.ts +35 -0
  383. package/types-legacy/ts4.5/tx/transaction-signer.d.ts +6 -0
  384. package/types-legacy/ts4.5/utils/autorest.d.ts +3 -2
  385. package/types-legacy/ts4.5/utils/errors.d.ts +14 -31
  386. package/types-legacy/ts4.5/utils/other.d.ts +1 -1
  387. package/es/tx/index.d.ts +0 -19
  388. package/es/tx/index.mjs +0 -115
  389. package/es/tx/index.mjs.map +0 -1
  390. package/src/apis/compiler/code-model-v4.yaml +0 -2442
  391. package/src/apis/node/code-model-v4.yaml +0 -10080
  392. package/src/tx/index.ts +0 -129
  393. package/types-legacy/ts4.2/tx/index.d.ts +0 -19
  394. package/types-legacy/ts4.5/tx/index.d.ts +0 -19
@@ -4,19 +4,16 @@
4
4
  // # RLP version number
5
5
  // # https://github.com/aeternity/protocol/blob/master/serializations.md#binary-serialization
6
6
  import { Tag } from "./constants.mjs";
7
- import { uInt, shortUInt, coinAmount, name, nameId, nameFee, deposit, gasLimit, gasPrice, fee, address, pointers, entry, enumeration, mptree, shortUIntConst, string, encoded, raw, array, boolean, ctVersion, abiVersion } from "./field-types/index.mjs";
7
+ import { uInt, shortUInt, coinAmount, name, nameId, nameFee, deposit, gasLimit, gasPrice, fee, address, pointers, entry, enumeration, mptree, shortUIntConst, string, encoded, raw, array, boolean, ctVersion, abiVersion, ttl, nonce, map, wrapped } from "./field-types/index.mjs";
8
8
  import { Encoding } from "../../utils/encoder.mjs";
9
9
  import { idTagToEncoding } from "./field-types/address.mjs";
10
10
  export let ORACLE_TTL_TYPES;
11
11
 
12
- // # TRANSACTION DEFAULT TTL
12
+ // # ORACLE
13
13
  (function (ORACLE_TTL_TYPES) {
14
14
  ORACLE_TTL_TYPES[ORACLE_TTL_TYPES["delta"] = 0] = "delta";
15
15
  ORACLE_TTL_TYPES[ORACLE_TTL_TYPES["block"] = 1] = "block";
16
16
  })(ORACLE_TTL_TYPES || (ORACLE_TTL_TYPES = {}));
17
- export const TX_TTL = 0;
18
- // # ORACLE
19
- export const QUERY_FEE = 30000;
20
17
  export const ORACLE_TTL = {
21
18
  type: ORACLE_TTL_TYPES.delta,
22
19
  value: 500
@@ -35,162 +32,469 @@ export const DRY_RUN_ACCOUNT = {
35
32
  amount: 100000000000000000000000000000000000n
36
33
  };
37
34
  export let CallReturnType;
35
+
36
+ // TODO: figure out how to omit overriding types of recursive fields
38
37
  (function (CallReturnType) {
39
38
  CallReturnType[CallReturnType["Ok"] = 0] = "Ok";
40
39
  CallReturnType[CallReturnType["Error"] = 1] = "Error";
41
40
  CallReturnType[CallReturnType["Revert"] = 2] = "Revert";
42
41
  })(CallReturnType || (CallReturnType = {}));
42
+ const entryAny = entry();
43
+ const entrySignedTx = entry(Tag.SignedTx);
44
+ const entryMtreeValueArray = array(entry(Tag.MtreeValue));
45
+ const entryTreesPoi = entry(Tag.TreesPoi);
46
+ const mapContracts = map(Encoding.ContractAddress, Tag.Contract);
47
+ const mapAccounts = map(Encoding.AccountAddress, Tag.Account);
48
+ const mapCalls = map(Encoding.Bytearray, Tag.ContractCall);
49
+ const mapChannels = map(Encoding.Channel, Tag.Channel);
50
+ const mapNames = map(Encoding.Name, Tag.Name);
51
+ const mapOracles = map(Encoding.OracleAddress, Tag.Oracle);
52
+
43
53
  /**
44
54
  * @see {@link https://github.com/aeternity/protocol/blob/c007deeac4a01e401238412801ac7084ac72d60e/serializations.md#accounts-version-1-basic-accounts}
45
55
  */
46
- export const TX_SCHEMA = {
47
- [Tag.Account]: {
48
- 1: [['tag', shortUIntConst(Tag.Account)], ['version', shortUIntConst(1)], ['nonce', shortUInt], ['balance', uInt]],
49
- 2: [['tag', shortUIntConst(Tag.Account)], ['version', shortUIntConst(2)], ['flags', uInt], ['nonce', shortUInt], ['balance', uInt], ['gaContract', address(Encoding.ContractAddress, Encoding.Name)], ['gaAuthFun', encoded(Encoding.ContractBytearray)]]
50
- },
51
- [Tag.SignedTx]: {
52
- 1: [['tag', shortUIntConst(Tag.SignedTx)], ['version', shortUIntConst(1)], ['signatures', array(raw)], ['encodedTx', entry()]]
53
- },
54
- [Tag.SpendTx]: {
55
- 1: [['tag', shortUIntConst(Tag.SpendTx)], ['version', shortUIntConst(1)], ['senderId', address(Encoding.AccountAddress)], ['recipientId', address(Encoding.AccountAddress, Encoding.Name)], ['amount', coinAmount], ['fee', fee], ['ttl', shortUInt], ['nonce', shortUInt], ['payload', encoded(Encoding.Bytearray, true)]]
56
- },
57
- [Tag.Name]: {
58
- 1: [['tag', shortUIntConst(Tag.Name)], ['version', shortUIntConst(1)], ['accountId', address(Encoding.AccountAddress)], ['nameTtl', shortUInt], ['status', raw], ['clientTtl', shortUInt], ['pointers', pointers]]
59
- },
60
- [Tag.NamePreclaimTx]: {
61
- 1: [['tag', shortUIntConst(Tag.NamePreclaimTx)], ['version', shortUIntConst(1)], ['accountId', address(Encoding.AccountAddress)], ['nonce', shortUInt], ['commitmentId', address(Encoding.Commitment)], ['fee', fee], ['ttl', shortUInt]]
62
- },
63
- [Tag.NameClaimTx]: {
64
- 2: [['tag', shortUIntConst(Tag.NameClaimTx)], ['version', shortUIntConst(2)], ['accountId', address(Encoding.AccountAddress)], ['nonce', shortUInt], ['name', name], ['nameSalt', uInt], ['nameFee', nameFee], ['fee', fee], ['ttl', shortUInt]]
65
- },
66
- [Tag.NameUpdateTx]: {
67
- 1: [['tag', shortUIntConst(Tag.NameUpdateTx)], ['version', shortUIntConst(1)], ['accountId', address(Encoding.AccountAddress)], ['nonce', shortUInt], ['nameId', nameId], ['nameTtl', shortUInt], ['pointers', pointers], ['clientTtl', shortUInt], ['fee', fee], ['ttl', shortUInt]]
68
- },
69
- [Tag.NameTransferTx]: {
70
- 1: [['tag', shortUIntConst(Tag.NameTransferTx)], ['version', shortUIntConst(1)], ['accountId', address(Encoding.AccountAddress)], ['nonce', shortUInt], ['nameId', nameId], ['recipientId', address(Encoding.AccountAddress, Encoding.Name)], ['fee', fee], ['ttl', shortUInt]]
71
- },
72
- [Tag.NameRevokeTx]: {
73
- 1: [['tag', shortUIntConst(Tag.NameRevokeTx)], ['version', shortUIntConst(1)], ['accountId', address(Encoding.AccountAddress)], ['nonce', shortUInt], ['nameId', nameId], ['fee', fee], ['ttl', shortUInt]]
74
- },
75
- [Tag.Contract]: {
76
- 1: [['tag', shortUIntConst(Tag.Contract)], ['version', shortUIntConst(1)], ['owner', address(Encoding.AccountAddress)], ['ctVersion', ctVersion], ['code', encoded(Encoding.ContractBytearray)], ['log', encoded(Encoding.ContractBytearray)], ['active', boolean], ['referers', array(address(Encoding.AccountAddress))], ['deposit', deposit]]
77
- },
78
- [Tag.ContractCreateTx]: {
79
- 1: [['tag', shortUIntConst(Tag.ContractCreateTx)], ['version', shortUIntConst(1)], ['ownerId', address(Encoding.AccountAddress)], ['nonce', shortUInt], ['code', encoded(Encoding.ContractBytearray)], ['ctVersion', ctVersion], ['fee', fee], ['ttl', shortUInt], ['deposit', deposit], ['amount', coinAmount], ['gasLimit', gasLimit], ['gasPrice', gasPrice], ['callData', encoded(Encoding.ContractBytearray)]]
80
- },
81
- [Tag.ContractCallTx]: {
82
- 1: [['tag', shortUIntConst(Tag.ContractCallTx)], ['version', shortUIntConst(1)], ['callerId', address(Encoding.AccountAddress)], ['nonce', shortUInt], ['contractId', address(Encoding.ContractAddress, Encoding.Name)], ['abiVersion', abiVersion], ['fee', fee], ['ttl', shortUInt], ['amount', coinAmount], ['gasLimit', gasLimit], ['gasPrice', gasPrice], ['callData', encoded(Encoding.ContractBytearray)]]
83
- },
84
- [Tag.ContractCall]: {
85
- 1: [['tag', shortUIntConst(Tag.ContractCall)], ['version', shortUIntConst(1)], ['callerId', address(Encoding.AccountAddress)], ['callerNonce', shortUInt], ['height', shortUInt], ['contractId', address(Encoding.ContractAddress)], ['gasPrice', gasPrice], ['gasUsed', shortUInt], ['returnValue', encoded(Encoding.ContractBytearray)], ['returnType', enumeration(CallReturnType)],
86
- // TODO: add serialization for
87
- // <log> :: [ { <address> :: id, [ <topics> :: binary() ], <data> :: binary() } ]
88
- ['log', raw]]
89
- },
90
- [Tag.Oracle]: {
91
- 1: [['tag', shortUIntConst(Tag.Oracle)], ['version', shortUIntConst(1)], ['accountId', address(Encoding.AccountAddress)], ['queryFormat', string], ['responseFormat', string], ['queryFee', coinAmount], ['oracleTtlValue', shortUInt], ['abiVersion', abiVersion]]
92
- },
93
- [Tag.OracleRegisterTx]: {
94
- 1: [['tag', shortUIntConst(Tag.OracleRegisterTx)], ['version', shortUIntConst(1)], ['accountId', address(Encoding.AccountAddress)], ['nonce', shortUInt], ['queryFormat', string], ['responseFormat', string], ['queryFee', coinAmount], ['oracleTtlType', enumeration(ORACLE_TTL_TYPES)], ['oracleTtlValue', shortUInt], ['fee', fee], ['ttl', shortUInt], ['abiVersion', abiVersion]]
95
- },
96
- [Tag.OracleExtendTx]: {
97
- 1: [['tag', shortUIntConst(Tag.OracleExtendTx)], ['version', shortUIntConst(1)], ['oracleId', address(Encoding.OracleAddress, Encoding.Name)], ['nonce', shortUInt], ['oracleTtlType', enumeration(ORACLE_TTL_TYPES)], ['oracleTtlValue', shortUInt], ['fee', fee], ['ttl', shortUInt]]
98
- },
99
- [Tag.OracleQueryTx]: {
100
- 1: [['tag', shortUIntConst(Tag.OracleQueryTx)], ['version', shortUIntConst(1)], ['senderId', address(Encoding.AccountAddress)], ['nonce', shortUInt], ['oracleId', address(Encoding.OracleAddress, Encoding.Name)], ['query', string], ['queryFee', coinAmount], ['queryTtlType', enumeration(ORACLE_TTL_TYPES)], ['queryTtlValue', shortUInt], ['responseTtlType', enumeration(ORACLE_TTL_TYPES)], ['responseTtlValue', shortUInt], ['fee', fee], ['ttl', shortUInt]]
101
- },
102
- [Tag.OracleResponseTx]: {
103
- 1: [['tag', shortUIntConst(Tag.OracleResponseTx)], ['version', shortUIntConst(1)], ['oracleId', address(Encoding.OracleAddress)], ['nonce', shortUInt], ['queryId', encoded(Encoding.OracleQueryId)], ['response', string], ['responseTtlType', enumeration(ORACLE_TTL_TYPES)], ['responseTtlValue', shortUInt], ['fee', fee], ['ttl', shortUInt]]
104
- },
105
- [Tag.ChannelCreateTx]: {
106
- 2: [['tag', shortUIntConst(Tag.ChannelCreateTx)], ['version', shortUIntConst(2)], ['initiator', address(Encoding.AccountAddress)], ['initiatorAmount', uInt], ['responder', address(Encoding.AccountAddress)], ['responderAmount', uInt], ['channelReserve', uInt], ['lockPeriod', uInt], ['ttl', shortUInt], ['fee', fee], ['initiatorDelegateIds', array(address(...idTagToEncoding))], ['responderDelegateIds', array(address(...idTagToEncoding))], ['stateHash', encoded(Encoding.State)], ['nonce', shortUInt]]
107
- },
108
- [Tag.ChannelCloseMutualTx]: {
109
- 1: [['tag', shortUIntConst(Tag.ChannelCloseMutualTx)], ['version', shortUIntConst(1)], ['channelId', address(Encoding.Channel)], ['fromId', address(Encoding.AccountAddress)], ['initiatorAmountFinal', uInt], ['responderAmountFinal', uInt], ['ttl', shortUInt], ['fee', fee], ['nonce', shortUInt]]
110
- },
111
- [Tag.ChannelCloseSoloTx]: {
112
- 1: [['tag', shortUIntConst(Tag.ChannelCloseSoloTx)], ['version', shortUIntConst(1)], ['channelId', address(Encoding.Channel)], ['fromId', address(Encoding.AccountAddress)], ['payload', encoded(Encoding.Transaction)], ['poi', entry(Tag.TreesPoi)], ['ttl', shortUInt], ['fee', fee], ['nonce', shortUInt]]
113
- },
114
- [Tag.ChannelSlashTx]: {
115
- 1: [['tag', shortUIntConst(Tag.ChannelSlashTx)], ['version', shortUIntConst(1)], ['channelId', address(Encoding.Channel)], ['fromId', address(Encoding.AccountAddress)], ['payload', encoded(Encoding.Transaction)], ['poi', entry(Tag.TreesPoi)], ['ttl', shortUInt], ['fee', fee], ['nonce', shortUInt]]
116
- },
117
- [Tag.ChannelDepositTx]: {
118
- 1: [['tag', shortUIntConst(Tag.ChannelDepositTx)], ['version', shortUIntConst(1)], ['channelId', address(Encoding.Channel)], ['fromId', address(Encoding.AccountAddress)], ['amount', uInt], ['ttl', shortUInt], ['fee', fee], ['stateHash', encoded(Encoding.State)], ['round', shortUInt], ['nonce', shortUInt]]
119
- },
120
- [Tag.ChannelWithdrawTx]: {
121
- 1: [['tag', shortUIntConst(Tag.ChannelWithdrawTx)], ['version', shortUIntConst(1)], ['channelId', address(Encoding.Channel)], ['toId', address(Encoding.AccountAddress)], ['amount', uInt], ['ttl', shortUInt], ['fee', fee], ['stateHash', encoded(Encoding.State)], ['round', shortUInt], ['nonce', shortUInt]]
122
- },
123
- [Tag.ChannelSettleTx]: {
124
- 1: [['tag', shortUIntConst(Tag.ChannelSettleTx)], ['version', shortUIntConst(1)], ['channelId', address(Encoding.Channel)], ['fromId', address(Encoding.AccountAddress)], ['initiatorAmountFinal', uInt], ['responderAmountFinal', uInt], ['ttl', shortUInt], ['fee', fee], ['nonce', shortUInt]]
125
- },
126
- [Tag.ChannelForceProgressTx]: {
127
- 1: [['tag', shortUIntConst(Tag.ChannelForceProgressTx)], ['version', shortUIntConst(1)], ['channelId', address(Encoding.Channel)], ['fromId', address(Encoding.AccountAddress)], ['payload', encoded(Encoding.Transaction)], ['round', shortUInt], ['update', encoded(Encoding.ContractBytearray)], ['stateHash', encoded(Encoding.State)], ['offChainTrees', encoded(Encoding.StateTrees)], ['ttl', shortUInt], ['fee', fee], ['nonce', shortUInt]]
128
- },
129
- [Tag.ChannelOffChainTx]: {
130
- 2: [['tag', shortUIntConst(Tag.ChannelOffChainTx)], ['version', shortUIntConst(2)], ['channelId', address(Encoding.Channel)], ['round', shortUInt], ['stateHash', encoded(Encoding.State)]]
131
- },
132
- [Tag.Channel]: {
133
- 3: [['tag', shortUIntConst(Tag.Channel)], ['version', shortUIntConst(3)], ['initiator', address(Encoding.AccountAddress)], ['responder', address(Encoding.AccountAddress)], ['channelAmount', uInt], ['initiatorAmount', uInt], ['responderAmount', uInt], ['channelReserve', uInt], ['initiatorDelegateIds', array(address(...idTagToEncoding))], ['responderDelegateIds', array(address(...idTagToEncoding))], ['stateHash', encoded(Encoding.State)], ['round', shortUInt], ['soloRound', uInt], ['lockPeriod', uInt], ['lockedUntil', uInt], ['initiatorAuth', encoded(Encoding.ContractBytearray)], ['responderAuth', encoded(Encoding.ContractBytearray)]]
134
- },
135
- [Tag.ChannelSnapshotSoloTx]: {
136
- 1: [['tag', shortUIntConst(Tag.ChannelSnapshotSoloTx)], ['version', shortUIntConst(1)], ['channelId', address(Encoding.Channel)], ['fromId', address(Encoding.AccountAddress)], ['payload', encoded(Encoding.Transaction)], ['ttl', shortUInt], ['fee', fee], ['nonce', shortUInt]]
137
- },
138
- [Tag.ChannelOffChainUpdateTransfer]: {
139
- 1: [['tag', shortUIntConst(Tag.ChannelOffChainUpdateTransfer)], ['version', shortUIntConst(1)], ['from', address(Encoding.AccountAddress)], ['to', address(Encoding.AccountAddress)], ['amount', uInt]]
140
- },
141
- [Tag.ChannelOffChainUpdateDeposit]: {
142
- 1: [['tag', shortUIntConst(Tag.ChannelOffChainUpdateDeposit)], ['version', shortUIntConst(1)], ['from', address(Encoding.AccountAddress)], ['amount', uInt]]
143
- },
144
- [Tag.ChannelOffChainUpdateWithdraw]: {
145
- 1: [['tag', shortUIntConst(Tag.ChannelOffChainUpdateWithdraw)], ['version', shortUIntConst(1)], ['from', address(Encoding.AccountAddress)], ['amount', uInt]]
146
- },
147
- [Tag.ChannelOffChainUpdateCreateContract]: {
148
- 1: [['tag', shortUIntConst(Tag.ChannelOffChainUpdateCreateContract)], ['version', shortUIntConst(1)], ['owner', address(Encoding.AccountAddress)], ['ctVersion', ctVersion], ['code', encoded(Encoding.ContractBytearray)], ['deposit', uInt], ['callData', encoded(Encoding.ContractBytearray)]]
149
- },
150
- [Tag.ChannelOffChainUpdateCallContract]: {
151
- 1: [['tag', shortUIntConst(Tag.ChannelOffChainUpdateCallContract)], ['version', shortUIntConst(1)], ['caller', address(Encoding.AccountAddress)], ['contract', address(Encoding.ContractAddress)], ['abiVersion', abiVersion], ['amount', uInt], ['callData', encoded(Encoding.ContractBytearray)], ['callStack', raw], ['gasPrice', gasPrice], ['gasLimit', gasLimit]]
152
- },
153
- [Tag.ChannelClientReconnectTx]: {
154
- 1: [['tag', shortUIntConst(Tag.ChannelClientReconnectTx)], ['version', shortUIntConst(1)], ['channelId', address(Encoding.Channel)], ['round', shortUInt], ['role', string], ['pubkey', address(Encoding.AccountAddress)]]
155
- },
156
- [Tag.TreesPoi]: {
157
- 1: [['tag', shortUIntConst(Tag.TreesPoi)], ['version', shortUIntConst(1)], ['accounts', array(mptree(Encoding.AccountAddress, Tag.Account))], ['calls', array(mptree(Encoding.Bytearray, Tag.ContractCall))], ['channels', array(mptree(Encoding.Channel, Tag.Channel))], ['contracts', array(mptree(Encoding.ContractAddress, Tag.Contract))], ['ns', array(mptree(Encoding.Name, Tag.Name))], ['oracles', array(mptree(Encoding.OracleAddress, Tag.Oracle))]]
158
- },
159
- [Tag.StateTrees]: {
160
- 1: [['tag', shortUIntConst(Tag.StateTrees)], ['version', shortUIntConst(1)], ['contracts', entry()], ['calls', entry()], ['channels', entry()], ['ns', entry()], ['oracles', entry()], ['accounts', entry()]]
161
- },
162
- [Tag.Mtree]: {
163
- 1: [['tag', shortUIntConst(Tag.Mtree)], ['version', shortUIntConst(1)], ['values', array(entry())]]
164
- },
165
- [Tag.MtreeValue]: {
166
- 1: [['tag', shortUIntConst(Tag.MtreeValue)], ['version', shortUIntConst(1)], ['key', raw], ['value', raw]]
167
- },
168
- [Tag.ContractsMtree]: {
169
- 1: [['tag', shortUIntConst(Tag.ContractsMtree)], ['version', shortUIntConst(1)], ['contracts', entry()]]
170
- },
171
- [Tag.CallsMtree]: {
172
- 1: [['tag', shortUIntConst(Tag.CallsMtree)], ['version', shortUIntConst(1)], ['calls', entry()]]
173
- },
174
- [Tag.ChannelsMtree]: {
175
- 1: [['tag', shortUIntConst(Tag.ChannelsMtree)], ['version', shortUIntConst(1)], ['channels', entry()]]
176
- },
177
- [Tag.NameserviceMtree]: {
178
- 1: [['tag', shortUIntConst(Tag.NameserviceMtree)], ['version', shortUIntConst(1)], ['mtree', entry()]]
179
- },
180
- [Tag.OraclesMtree]: {
181
- 1: [['tag', shortUIntConst(Tag.OraclesMtree)], ['version', shortUIntConst(1)], ['otree', entry()]]
182
- },
183
- [Tag.AccountsMtree]: {
184
- 1: [['tag', shortUIntConst(Tag.AccountsMtree)], ['version', shortUIntConst(1)], ['accounts', entry()]]
185
- },
186
- [Tag.GaAttachTx]: {
187
- 1: [['tag', shortUIntConst(Tag.GaAttachTx)], ['version', shortUIntConst(1)], ['ownerId', address(Encoding.AccountAddress)], ['nonce', shortUInt], ['code', encoded(Encoding.ContractBytearray)], ['authFun', raw], ['ctVersion', ctVersion], ['fee', fee], ['ttl', shortUInt], ['gasLimit', gasLimit], ['gasPrice', gasPrice], ['callData', encoded(Encoding.ContractBytearray)]]
188
- },
189
- [Tag.GaMetaTx]: {
190
- 2: [['tag', shortUIntConst(Tag.GaMetaTx)], ['version', shortUIntConst(2)], ['gaId', address(Encoding.AccountAddress)], ['authData', encoded(Encoding.ContractBytearray)], ['abiVersion', abiVersion], ['fee', fee], ['gasLimit', gasLimit], ['gasPrice', gasPrice], ['tx', entry()]]
191
- },
192
- [Tag.PayingForTx]: {
193
- 1: [['tag', shortUIntConst(Tag.PayingForTx)], ['version', shortUIntConst(1)], ['payerId', address(Encoding.AccountAddress)], ['nonce', shortUInt], ['fee', fee], ['tx', entry()]]
194
- }
195
- };
56
+ export const txSchema = [{
57
+ tag: shortUIntConst(Tag.Account),
58
+ version: shortUIntConst(1),
59
+ nonce: shortUInt,
60
+ balance: uInt
61
+ }, {
62
+ tag: shortUIntConst(Tag.Account),
63
+ version: shortUIntConst(2, true),
64
+ flags: uInt,
65
+ nonce: shortUInt,
66
+ balance: uInt,
67
+ gaContract: address(Encoding.ContractAddress, Encoding.Name),
68
+ gaAuthFun: encoded(Encoding.ContractBytearray)
69
+ }, {
70
+ tag: shortUIntConst(Tag.SignedTx),
71
+ version: shortUIntConst(1, true),
72
+ signatures: array(raw),
73
+ encodedTx: entryAny
74
+ }, {
75
+ tag: shortUIntConst(Tag.SpendTx),
76
+ version: shortUIntConst(1, true),
77
+ senderId: address(Encoding.AccountAddress),
78
+ recipientId: address(Encoding.AccountAddress, Encoding.Name),
79
+ amount: coinAmount,
80
+ fee,
81
+ ttl,
82
+ nonce: nonce('senderId'),
83
+ payload: encoded(Encoding.Bytearray, true)
84
+ }, {
85
+ tag: shortUIntConst(Tag.Name),
86
+ version: shortUIntConst(1, true),
87
+ accountId: address(Encoding.AccountAddress),
88
+ nameTtl: shortUInt,
89
+ status: raw,
90
+ clientTtl: shortUInt,
91
+ pointers
92
+ }, {
93
+ tag: shortUIntConst(Tag.NamePreclaimTx),
94
+ version: shortUIntConst(1, true),
95
+ accountId: address(Encoding.AccountAddress),
96
+ nonce: nonce('accountId'),
97
+ commitmentId: address(Encoding.Commitment),
98
+ fee,
99
+ ttl
100
+ }, {
101
+ tag: shortUIntConst(Tag.NameClaimTx),
102
+ version: shortUIntConst(2, true),
103
+ accountId: address(Encoding.AccountAddress),
104
+ nonce: nonce('accountId'),
105
+ name,
106
+ nameSalt: uInt,
107
+ nameFee,
108
+ fee,
109
+ ttl
110
+ }, {
111
+ tag: shortUIntConst(Tag.NameUpdateTx),
112
+ version: shortUIntConst(1, true),
113
+ accountId: address(Encoding.AccountAddress),
114
+ nonce: nonce('accountId'),
115
+ nameId,
116
+ nameTtl: shortUInt,
117
+ pointers,
118
+ clientTtl: shortUInt,
119
+ fee,
120
+ ttl
121
+ }, {
122
+ tag: shortUIntConst(Tag.NameTransferTx),
123
+ version: shortUIntConst(1, true),
124
+ accountId: address(Encoding.AccountAddress),
125
+ nonce: nonce('accountId'),
126
+ nameId,
127
+ recipientId: address(Encoding.AccountAddress, Encoding.Name),
128
+ fee,
129
+ ttl
130
+ }, {
131
+ tag: shortUIntConst(Tag.NameRevokeTx),
132
+ version: shortUIntConst(1, true),
133
+ accountId: address(Encoding.AccountAddress),
134
+ nonce: nonce('accountId'),
135
+ nameId,
136
+ fee,
137
+ ttl
138
+ }, {
139
+ tag: shortUIntConst(Tag.Contract),
140
+ version: shortUIntConst(1, true),
141
+ owner: address(Encoding.AccountAddress),
142
+ ctVersion,
143
+ code: encoded(Encoding.ContractBytearray),
144
+ log: encoded(Encoding.ContractBytearray),
145
+ active: boolean,
146
+ referers: array(address(Encoding.AccountAddress)),
147
+ deposit
148
+ }, {
149
+ tag: shortUIntConst(Tag.ContractCreateTx),
150
+ version: shortUIntConst(1, true),
151
+ ownerId: address(Encoding.AccountAddress),
152
+ nonce: nonce('ownerId'),
153
+ code: encoded(Encoding.ContractBytearray),
154
+ ctVersion,
155
+ fee,
156
+ ttl,
157
+ deposit,
158
+ amount: coinAmount,
159
+ gasLimit,
160
+ gasPrice,
161
+ callData: encoded(Encoding.ContractBytearray)
162
+ }, {
163
+ tag: shortUIntConst(Tag.ContractCallTx),
164
+ version: shortUIntConst(1, true),
165
+ callerId: address(Encoding.AccountAddress),
166
+ nonce: nonce('callerId'),
167
+ contractId: address(Encoding.ContractAddress, Encoding.Name),
168
+ abiVersion,
169
+ fee,
170
+ ttl,
171
+ amount: coinAmount,
172
+ gasLimit,
173
+ gasPrice,
174
+ callData: encoded(Encoding.ContractBytearray)
175
+ }, {
176
+ tag: shortUIntConst(Tag.ContractCall),
177
+ version: shortUIntConst(2, true),
178
+ callerId: address(Encoding.AccountAddress),
179
+ callerNonce: shortUInt,
180
+ height: shortUInt,
181
+ contractId: address(Encoding.ContractAddress),
182
+ // TODO: rename after resolving https://github.com/aeternity/protocol/issues/506
183
+ gasPrice: uInt,
184
+ gasUsed: shortUInt,
185
+ returnValue: encoded(Encoding.ContractBytearray),
186
+ returnType: enumeration(CallReturnType),
187
+ // TODO: add serialization for
188
+ // <log> :: [ { <address> :: id, [ <topics> :: binary() }, <data> :: binary() } ]
189
+ log: array(raw)
190
+ }, {
191
+ tag: shortUIntConst(Tag.Oracle),
192
+ version: shortUIntConst(1, true),
193
+ accountId: address(Encoding.AccountAddress),
194
+ queryFormat: string,
195
+ responseFormat: string,
196
+ queryFee: coinAmount,
197
+ oracleTtlValue: shortUInt,
198
+ abiVersion
199
+ }, {
200
+ tag: shortUIntConst(Tag.OracleRegisterTx),
201
+ version: shortUIntConst(1, true),
202
+ accountId: address(Encoding.AccountAddress),
203
+ nonce: nonce('accountId'),
204
+ queryFormat: string,
205
+ responseFormat: string,
206
+ queryFee: coinAmount,
207
+ oracleTtlType: enumeration(ORACLE_TTL_TYPES),
208
+ oracleTtlValue: shortUInt,
209
+ fee,
210
+ ttl,
211
+ abiVersion
212
+ }, {
213
+ tag: shortUIntConst(Tag.OracleExtendTx),
214
+ version: shortUIntConst(1, true),
215
+ oracleId: address(Encoding.OracleAddress, Encoding.Name),
216
+ nonce: nonce('oracleId'),
217
+ oracleTtlType: enumeration(ORACLE_TTL_TYPES),
218
+ oracleTtlValue: shortUInt,
219
+ fee,
220
+ ttl
221
+ }, {
222
+ tag: shortUIntConst(Tag.OracleQueryTx),
223
+ version: shortUIntConst(1, true),
224
+ senderId: address(Encoding.AccountAddress),
225
+ nonce: nonce('senderId'),
226
+ oracleId: address(Encoding.OracleAddress, Encoding.Name),
227
+ query: string,
228
+ queryFee: coinAmount,
229
+ queryTtlType: enumeration(ORACLE_TTL_TYPES),
230
+ queryTtlValue: shortUInt,
231
+ responseTtlType: enumeration(ORACLE_TTL_TYPES),
232
+ responseTtlValue: shortUInt,
233
+ fee,
234
+ ttl
235
+ }, {
236
+ tag: shortUIntConst(Tag.OracleResponseTx),
237
+ version: shortUIntConst(1, true),
238
+ oracleId: address(Encoding.OracleAddress),
239
+ nonce: nonce('oracleId'),
240
+ queryId: encoded(Encoding.OracleQueryId),
241
+ response: string,
242
+ responseTtlType: enumeration(ORACLE_TTL_TYPES),
243
+ responseTtlValue: shortUInt,
244
+ fee,
245
+ ttl
246
+ }, {
247
+ tag: shortUIntConst(Tag.ChannelCreateTx),
248
+ version: shortUIntConst(2, true),
249
+ initiator: address(Encoding.AccountAddress),
250
+ initiatorAmount: uInt,
251
+ responder: address(Encoding.AccountAddress),
252
+ responderAmount: uInt,
253
+ channelReserve: uInt,
254
+ lockPeriod: uInt,
255
+ ttl,
256
+ fee,
257
+ initiatorDelegateIds: array(address(...idTagToEncoding)),
258
+ responderDelegateIds: array(address(...idTagToEncoding)),
259
+ stateHash: encoded(Encoding.State),
260
+ nonce: nonce('initiator')
261
+ }, {
262
+ tag: shortUIntConst(Tag.ChannelCloseMutualTx),
263
+ version: shortUIntConst(1, true),
264
+ channelId: address(Encoding.Channel),
265
+ fromId: address(Encoding.AccountAddress),
266
+ initiatorAmountFinal: uInt,
267
+ responderAmountFinal: uInt,
268
+ ttl,
269
+ fee,
270
+ nonce: nonce('fromId')
271
+ }, {
272
+ tag: shortUIntConst(Tag.ChannelCloseSoloTx),
273
+ version: shortUIntConst(1, true),
274
+ channelId: address(Encoding.Channel),
275
+ fromId: address(Encoding.AccountAddress),
276
+ payload: encoded(Encoding.Transaction),
277
+ poi: entryTreesPoi,
278
+ ttl,
279
+ fee,
280
+ nonce: nonce('fromId')
281
+ }, {
282
+ tag: shortUIntConst(Tag.ChannelSlashTx),
283
+ version: shortUIntConst(1, true),
284
+ channelId: address(Encoding.Channel),
285
+ fromId: address(Encoding.AccountAddress),
286
+ payload: encoded(Encoding.Transaction),
287
+ poi: entryTreesPoi,
288
+ ttl,
289
+ fee,
290
+ nonce: nonce('fromId')
291
+ }, {
292
+ tag: shortUIntConst(Tag.ChannelDepositTx),
293
+ version: shortUIntConst(1, true),
294
+ channelId: address(Encoding.Channel),
295
+ fromId: address(Encoding.AccountAddress),
296
+ amount: uInt,
297
+ ttl,
298
+ fee,
299
+ stateHash: encoded(Encoding.State),
300
+ round: shortUInt,
301
+ nonce: nonce('fromId')
302
+ }, {
303
+ tag: shortUIntConst(Tag.ChannelWithdrawTx),
304
+ version: shortUIntConst(1, true),
305
+ channelId: address(Encoding.Channel),
306
+ toId: address(Encoding.AccountAddress),
307
+ amount: uInt,
308
+ ttl,
309
+ fee,
310
+ stateHash: encoded(Encoding.State),
311
+ round: shortUInt,
312
+ nonce: nonce('fromId')
313
+ }, {
314
+ tag: shortUIntConst(Tag.ChannelSettleTx),
315
+ version: shortUIntConst(1, true),
316
+ channelId: address(Encoding.Channel),
317
+ fromId: address(Encoding.AccountAddress),
318
+ initiatorAmountFinal: uInt,
319
+ responderAmountFinal: uInt,
320
+ ttl,
321
+ fee,
322
+ nonce: nonce('fromId')
323
+ }, {
324
+ tag: shortUIntConst(Tag.ChannelForceProgressTx),
325
+ version: shortUIntConst(1, true),
326
+ channelId: address(Encoding.Channel),
327
+ fromId: address(Encoding.AccountAddress),
328
+ payload: encoded(Encoding.Transaction),
329
+ round: shortUInt,
330
+ update: encoded(Encoding.ContractBytearray),
331
+ stateHash: encoded(Encoding.State),
332
+ offChainTrees: encoded(Encoding.StateTrees),
333
+ ttl,
334
+ fee,
335
+ nonce: nonce('fromId')
336
+ }, {
337
+ tag: shortUIntConst(Tag.ChannelOffChainTx),
338
+ version: shortUIntConst(2, true),
339
+ channelId: address(Encoding.Channel),
340
+ round: shortUInt,
341
+ stateHash: encoded(Encoding.State)
342
+ }, {
343
+ tag: shortUIntConst(Tag.Channel),
344
+ version: shortUIntConst(3, true),
345
+ initiator: address(Encoding.AccountAddress),
346
+ responder: address(Encoding.AccountAddress),
347
+ channelAmount: uInt,
348
+ initiatorAmount: uInt,
349
+ responderAmount: uInt,
350
+ channelReserve: uInt,
351
+ initiatorDelegateIds: array(address(...idTagToEncoding)),
352
+ responderDelegateIds: array(address(...idTagToEncoding)),
353
+ stateHash: encoded(Encoding.State),
354
+ round: shortUInt,
355
+ soloRound: uInt,
356
+ lockPeriod: uInt,
357
+ lockedUntil: uInt,
358
+ initiatorAuth: encoded(Encoding.ContractBytearray),
359
+ responderAuth: encoded(Encoding.ContractBytearray)
360
+ }, {
361
+ tag: shortUIntConst(Tag.ChannelSnapshotSoloTx),
362
+ version: shortUIntConst(1, true),
363
+ channelId: address(Encoding.Channel),
364
+ fromId: address(Encoding.AccountAddress),
365
+ payload: encoded(Encoding.Transaction),
366
+ ttl,
367
+ fee,
368
+ nonce: nonce('fromId')
369
+ }, {
370
+ tag: shortUIntConst(Tag.ChannelOffChainUpdateTransfer),
371
+ version: shortUIntConst(1, true),
372
+ from: address(Encoding.AccountAddress),
373
+ to: address(Encoding.AccountAddress),
374
+ amount: uInt
375
+ }, {
376
+ tag: shortUIntConst(Tag.ChannelOffChainUpdateDeposit),
377
+ version: shortUIntConst(1, true),
378
+ from: address(Encoding.AccountAddress),
379
+ amount: uInt
380
+ }, {
381
+ tag: shortUIntConst(Tag.ChannelOffChainUpdateWithdraw),
382
+ version: shortUIntConst(1, true),
383
+ from: address(Encoding.AccountAddress),
384
+ amount: uInt
385
+ }, {
386
+ tag: shortUIntConst(Tag.ChannelOffChainUpdateCreateContract),
387
+ version: shortUIntConst(1, true),
388
+ owner: address(Encoding.AccountAddress),
389
+ ctVersion,
390
+ code: encoded(Encoding.ContractBytearray),
391
+ deposit: uInt,
392
+ callData: encoded(Encoding.ContractBytearray)
393
+ }, {
394
+ tag: shortUIntConst(Tag.ChannelOffChainUpdateCallContract),
395
+ version: shortUIntConst(1, true),
396
+ caller: address(Encoding.AccountAddress),
397
+ contract: address(Encoding.ContractAddress),
398
+ abiVersion,
399
+ amount: uInt,
400
+ callData: encoded(Encoding.ContractBytearray),
401
+ callStack: raw,
402
+ gasPrice,
403
+ gasLimit
404
+ }, {
405
+ tag: shortUIntConst(Tag.ChannelClientReconnectTx),
406
+ version: shortUIntConst(1, true),
407
+ channelId: address(Encoding.Channel),
408
+ round: shortUInt,
409
+ role: string,
410
+ pubkey: address(Encoding.AccountAddress)
411
+ }, {
412
+ tag: shortUIntConst(Tag.TreesPoi),
413
+ version: shortUIntConst(1, true),
414
+ // TODO: inline an extra wrapping array after resolving https://github.com/aeternity/protocol/issues/505
415
+ accounts: array(mptree(Encoding.AccountAddress, Tag.Account)),
416
+ calls: array(mptree(Encoding.Bytearray, Tag.ContractCall)),
417
+ channels: array(mptree(Encoding.Channel, Tag.Channel)),
418
+ contracts: array(mptree(Encoding.ContractAddress, Tag.Contract)),
419
+ ns: array(mptree(Encoding.Name, Tag.Name)),
420
+ oracles: array(mptree(Encoding.OracleAddress, Tag.Oracle))
421
+ }, {
422
+ tag: shortUIntConst(Tag.StateTrees),
423
+ version: shortUIntConst(0, true),
424
+ contracts: wrapped(Tag.ContractsMtree),
425
+ calls: wrapped(Tag.CallsMtree),
426
+ channels: wrapped(Tag.ChannelsMtree),
427
+ ns: wrapped(Tag.NameserviceMtree),
428
+ oracles: wrapped(Tag.OraclesMtree),
429
+ accounts: wrapped(Tag.AccountsMtree)
430
+ }, {
431
+ tag: shortUIntConst(Tag.Mtree),
432
+ version: shortUIntConst(1, true),
433
+ values: entryMtreeValueArray
434
+ }, {
435
+ tag: shortUIntConst(Tag.MtreeValue),
436
+ version: shortUIntConst(1, true),
437
+ key: raw,
438
+ value: raw
439
+ }, {
440
+ tag: shortUIntConst(Tag.ContractsMtree),
441
+ version: shortUIntConst(1, true),
442
+ payload: mapContracts
443
+ }, {
444
+ tag: shortUIntConst(Tag.CallsMtree),
445
+ version: shortUIntConst(1, true),
446
+ payload: mapCalls
447
+ }, {
448
+ tag: shortUIntConst(Tag.ChannelsMtree),
449
+ version: shortUIntConst(1, true),
450
+ payload: mapChannels
451
+ }, {
452
+ tag: shortUIntConst(Tag.NameserviceMtree),
453
+ version: shortUIntConst(1, true),
454
+ payload: mapNames
455
+ }, {
456
+ tag: shortUIntConst(Tag.OraclesMtree),
457
+ version: shortUIntConst(1, true),
458
+ payload: mapOracles
459
+ }, {
460
+ tag: shortUIntConst(Tag.AccountsMtree),
461
+ version: shortUIntConst(1, true),
462
+ payload: mapAccounts
463
+ }, {
464
+ tag: shortUIntConst(Tag.GaAttachTx),
465
+ version: shortUIntConst(1, true),
466
+ ownerId: address(Encoding.AccountAddress),
467
+ nonce: nonce('ownerId'),
468
+ code: encoded(Encoding.ContractBytearray),
469
+ authFun: raw,
470
+ ctVersion,
471
+ fee,
472
+ ttl,
473
+ gasLimit,
474
+ gasPrice,
475
+ callData: encoded(Encoding.ContractBytearray)
476
+ }, {
477
+ tag: shortUIntConst(Tag.GaMetaTx),
478
+ version: shortUIntConst(2, true),
479
+ gaId: address(Encoding.AccountAddress),
480
+ authData: encoded(Encoding.ContractBytearray),
481
+ abiVersion,
482
+ fee,
483
+ gasLimit,
484
+ gasPrice,
485
+ tx: entrySignedTx
486
+ }, {
487
+ tag: shortUIntConst(Tag.PayingForTx),
488
+ version: shortUIntConst(1, true),
489
+ payerId: address(Encoding.AccountAddress),
490
+ nonce: nonce('payerId'),
491
+ fee,
492
+ tx: entrySignedTx
493
+ }, {
494
+ tag: shortUIntConst(Tag.GaMetaTxAuthData),
495
+ version: shortUIntConst(1, true),
496
+ fee: coinAmount,
497
+ gasPrice,
498
+ txHash: encoded(Encoding.TxHash)
499
+ }];
196
500
  //# sourceMappingURL=schema.mjs.map