@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
@@ -1,9 +1,10 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
3
  import { w3cwebsocket as W3CWebSocket } from 'websocket';
4
- import { SignTx, ChannelOptions, ChannelState, ChannelHandler, ChannelAction, ChannelStatus, ChannelFsm } from './internal';
4
+ import { Tag } from '../tx/builder/constants';
5
+ import { SignTx, ChannelOptions, ChannelState, ChannelHandler, ChannelAction, ChannelStatus, ChannelFsm, ChannelMessage, ChannelEvents } from './internal';
5
6
  import { Encoded } from '../utils/encoder';
6
- type EventCallback = (...args: any[]) => void;
7
+ import { TxUnpacked } from '../tx/builder/schema.generated';
7
8
  /**
8
9
  * Channel
9
10
  * @example
@@ -31,14 +32,14 @@ export default class Channel {
31
32
  _nextRpcMessageId: number;
32
33
  _rpcCallbacks: Map<number, (message: object) => void>;
33
34
  _fsmId?: Encoded.Bytearray;
34
- _messageQueue: object[];
35
+ _messageQueue: ChannelMessage[];
35
36
  _isMessageQueueLocked: boolean;
36
37
  _actionQueue: ChannelAction[];
37
38
  _isActionQueueLocked: boolean;
38
39
  _status: ChannelStatus;
39
40
  _fsm: ChannelFsm;
40
41
  _websocket: W3CWebSocket;
41
- _state?: Encoded.Transaction;
42
+ _state: Encoded.Transaction | '';
42
43
  _options: ChannelOptions;
43
44
  _channelId?: Encoded.Channel;
44
45
  /**
@@ -99,24 +100,29 @@ export default class Channel {
99
100
  * Possible events:
100
101
  *
101
102
  * - "error"
103
+ * - "stateChanged"
104
+ * - "statusChanged"
105
+ * - "message"
106
+ * - "peerDisconnected"
102
107
  * - "onChainTx"
103
108
  * - "ownWithdrawLocked"
104
109
  * - "withdrawLocked"
105
110
  * - "ownDepositLocked"
106
111
  * - "depositLocked"
112
+ * - "channelReestablished"
113
+ * - "newContract"
107
114
  *
108
- * TODO: the event list looks outdated
109
115
  *
110
116
  * @param eventName - Event name
111
117
  * @param callback - Callback function
112
118
  */
113
- on(eventName: string, callback: EventCallback): void;
119
+ on<E extends keyof ChannelEvents>(eventName: E, callback: ChannelEvents[E]): void;
114
120
  /**
115
121
  * Remove event listener function
116
122
  * @param eventName - Event name
117
123
  * @param callback - Callback function
118
124
  */
119
- off(eventName: string, callback: EventCallback): void;
125
+ off<E extends keyof ChannelEvents>(eventName: E, callback: ChannelEvents[E]): void;
120
126
  /**
121
127
  * Close the connection
122
128
  */
@@ -129,10 +135,18 @@ export default class Channel {
129
135
  * Get current state
130
136
  */
131
137
  state(): Promise<{
132
- calls: Encoded.CallStateTree;
133
- halfSignedTx: Encoded.Transaction | '';
134
- signedTx: Encoded.Transaction;
135
- trees: Encoded.StateTrees;
138
+ calls: TxUnpacked & {
139
+ tag: Tag.CallsMtree;
140
+ };
141
+ halfSignedTx?: TxUnpacked & {
142
+ tag: Tag.SignedTx;
143
+ };
144
+ signedTx?: TxUnpacked & {
145
+ tag: Tag.SignedTx;
146
+ };
147
+ trees: TxUnpacked & {
148
+ tag: Tag.StateTrees;
149
+ };
136
150
  }>;
137
151
  /**
138
152
  * Get current round
@@ -196,4 +210,3 @@ export default class Channel {
196
210
  shutdown(sign: SignTx): Promise<Encoded.Transaction>;
197
211
  static reconnect(options: ChannelOptions, txParams: any): Promise<Channel>;
198
212
  }
199
- export {};
@@ -2,8 +2,8 @@ import BigNumber from 'bignumber.js';
2
2
  import { SignTx, ChannelState } from './internal';
3
3
  import { Encoded } from '../utils/encoder';
4
4
  import Channel from './Base';
5
- import { unpackTx } from '../tx/builder';
6
5
  import { Tag } from '../tx/builder/constants';
6
+ import { TxUnpacked } from '../tx/builder/schema.generated';
7
7
  export default class ChannelSpend extends Channel {
8
8
  /**
9
9
  * Trigger a transfer update
@@ -63,7 +63,9 @@ export default class ChannelSpend extends Channel {
63
63
  poi({ accounts, contracts }: {
64
64
  accounts: Encoded.AccountAddress[];
65
65
  contracts?: Encoded.ContractAddress[];
66
- }): Promise<ReturnType<any>>;
66
+ }): Promise<TxUnpacked & {
67
+ tag: Tag.TreesPoi;
68
+ }>;
67
69
  /**
68
70
  * Get balances
69
71
  *
@@ -2,6 +2,23 @@ import BigNumber from 'bignumber.js';
2
2
  import type Channel from './Base';
3
3
  import { Encoded } from '../utils/encoder';
4
4
  import { BaseError } from '../utils/errors';
5
+ export interface ChannelEvents {
6
+ statusChanged: (status: ChannelStatus) => void;
7
+ stateChanged: (tx: Encoded.Transaction | '') => void;
8
+ depositLocked: () => void;
9
+ ownDepositLocked: () => void;
10
+ withdrawLocked: () => void;
11
+ ownWithdrawLocked: () => void;
12
+ peerDisconnected: () => void;
13
+ channelReestablished: () => void;
14
+ error: (error: Error) => void;
15
+ onChainTx: (tx: Encoded.Transaction, details: {
16
+ info: string;
17
+ type: string;
18
+ }) => void;
19
+ message: (message: string | Object) => void;
20
+ newContract: (contractAddress: Encoded.ContractAddress) => void;
21
+ }
5
22
  export interface ChannelAction {
6
23
  guard: (channel: Channel, state?: ChannelFsm) => boolean;
7
24
  action: (channel: Channel, state?: ChannelFsm) => ChannelFsm;
@@ -92,10 +109,13 @@ interface ChannelMessageError {
92
109
  ];
93
110
  request: ChannelMessage;
94
111
  }
95
- export declare function emit(channel: Channel, ...args: any[]): void;
112
+ export declare function emit<E extends keyof ChannelEvents>(channel: Channel, ...args: [
113
+ E,
114
+ ...Parameters<ChannelEvents[E]>
115
+ ]): void;
96
116
  export type ChannelStatus = 'connecting' | 'connected' | 'accepted' | 'halfSigned' | 'signed' | 'open' | 'closing' | 'closed' | 'died' | 'disconnected';
97
117
  export declare function changeStatus(channel: Channel, newStatus: ChannelStatus): void;
98
- export declare function changeState(channel: Channel, newState: Encoded.Transaction): void;
118
+ export declare function changeState(channel: Channel, newState: Encoded.Transaction | ''): void;
99
119
  export declare function notify(channel: Channel, method: string, params?: object): void;
100
120
  export declare function enqueueAction(channel: Channel, guard: ChannelAction['guard'], action: () => {
101
121
  handler: ChannelHandler;
@@ -7,21 +7,19 @@
7
7
  */
8
8
  import { Encoder as Calldata } from '@aeternity/aepp-calldata';
9
9
  import { Tag, AensName } from '../tx/builder/constants';
10
- import { unpackTx } from '../tx/builder';
11
- import { BuildTxOptions } from '../tx';
12
- import { send, SendOptions } from '../spend';
10
+ import { BuildTxOptions } from '../tx/builder';
13
11
  import { Encoded } from '../utils/encoder';
14
- import { ContractCallObject as NodeContractCallObject, ContractCallReturnType, Event as NodeEvent } from '../apis/node';
12
+ import { ContractCallObject as NodeContractCallObject, Event as NodeEvent } from '../apis/node';
15
13
  import CompilerBase, { Aci } from './compiler/Base';
16
14
  import Node, { TransformNodeType } from '../Node';
17
- import { txDryRun } from '../chain';
15
+ import { txDryRun, sendTransaction, SendTransactionOptions } from '../chain';
18
16
  import AccountBase from '../account/Base';
19
- type FunctionAci = Aci['encodedAci']['contract']['functions'][0];
17
+ import { TxUnpacked } from '../tx/builder/schema.generated';
20
18
  interface Event extends NodeEvent {
21
19
  address: Encoded.ContractAddress;
22
20
  data: Encoded.ContractBytearray;
23
21
  }
24
- export interface ContractCallObject extends NodeContractCallObject {
22
+ export interface ContractCallObject extends TransformNodeType<NodeContractCallObject> {
25
23
  returnValue: Encoded.ContractBytearray;
26
24
  log: Event[];
27
25
  }
@@ -33,11 +31,13 @@ interface DecodedEvent {
33
31
  address: Encoded.ContractAddress;
34
32
  };
35
33
  }
36
- type TxData = Awaited<ReturnType<typeof send>>;
34
+ type TxData = Awaited<ReturnType<typeof sendTransaction>>;
37
35
  interface SendAndProcessReturnType {
38
- result?: TransformNodeType<ContractCallObject>;
36
+ result?: ContractCallObject;
39
37
  hash: TxData['hash'];
40
- tx: Awaited<ReturnType<any>>;
38
+ tx: TxUnpacked & {
39
+ tag: Tag.ContractCallTx | Tag.ContractCreateTx;
40
+ };
41
41
  txData: TxData;
42
42
  rawTx: Encoded.Transaction;
43
43
  }
@@ -45,15 +45,13 @@ export interface ContractMethodsBase {
45
45
  [key: string]: (...args: any[]) => any;
46
46
  }
47
47
  type MethodsToContractApi<M extends ContractMethodsBase> = {
48
- [Name in keyof M]: M[Name] extends (...args: infer Args) => infer Ret ? (...args: [
48
+ [Name in keyof M]: M[Name] extends (...args: infer Args) => any ? (...args: [
49
49
  ...Args,
50
50
  ...[
51
51
  ] | [
52
52
  Name extends 'init' ? Parameters<Contract<M>['$deploy']>[1] : Parameters<Contract<M>['$call']>[2]
53
53
  ]
54
- ]) => Promise<Awaited<ReturnType<Contract<M>['$call']>> & {
55
- decodedResult?: Ret;
56
- }> : never;
54
+ ]) => ReturnType<Contract<M>['$call']> : never;
57
55
  };
58
56
  type ContractWithMethods<M extends ContractMethodsBase> = Contract<M> & MethodsToContractApi<M>;
59
57
  type MethodNames<M extends ContractMethodsBase> = keyof M & string | 'init';
@@ -61,6 +59,15 @@ type MethodParameters<M extends ContractMethodsBase, Fn extends MethodNames<M>>
61
59
  init: any;
62
60
  } ? Parameters<M['init']> : [
63
61
  ] : Parameters<M[Fn]>;
62
+ interface GetContractNameByEventOptions {
63
+ contractAddressToName?: {
64
+ [key: string]: string;
65
+ };
66
+ }
67
+ interface GetCallResultByHashReturnType<M extends ContractMethodsBase, Fn extends MethodNames<M>> {
68
+ decodedResult: ReturnType<M[Fn]>;
69
+ decodedEvents?: ReturnType<Contract<M>['$decodeEvents']>;
70
+ }
64
71
  /**
65
72
  * Generate contract ACI object with predefined js methods for contract usage - can be used for
66
73
  * creating a reference to already deployed contracts
@@ -79,56 +86,16 @@ type MethodParameters<M extends ContractMethodsBase, Fn extends MethodNames<M>>
79
86
  * stateful or not
80
87
  */
81
88
  declare class Contract<M extends ContractMethodsBase> {
82
- /**
83
- * Helper to generate a signature to delegate
84
- * - pre-claim/claim/transfer/revoke of a name to a contract.
85
- * - register/extend/respond of an Oracle to a contract.
86
- * @category contract
87
- * @param ids - The list of id's to prepend
88
- * @param _options - Options
89
- * @param _options.omitAddress - Prepend delegation signature with an account address
90
- * @param _options.onAccount - Account to use
91
- * @returns Signature
92
- * @example
93
- * ```js
94
- * const aeSdk = new AeSdk({ ... })
95
- * const contract = await aeSdk.initializeContract({ address: 'ct_asd2ks...' })
96
- * const aensName = 'example.chain'
97
- * const onAccount = new MemoryAccount(...) // Sign with a specific account
98
- * // Preclaim signature
99
- * const preclaimSig = await contract.$createDelegationSignature([], { onAccount })
100
- * // Claim, transfer and revoke signature
101
- * const aensDelegationSig = await contract
102
- * .$createDelegationSignature([aensName], { onAccount })
103
- * ```
104
- * @example
105
- * ```js
106
- * const aeSdk = new AeSdk({ ... })
107
- * const contract = await aeSdk.initializeContract({ address: 'ct_asd2ks...' })
108
- * const oracleQueryId = 'oq_...'
109
- * const onAccount = new MemoryAccount(...) // Sign with a specific account
110
- * // Oracle register and extend signature
111
- * const oracleDelegationSig = await contract.$createDelegationSignature([], { onAccount })
112
- * // Oracle respond signature
113
- * const respondSig = await contract
114
- * .$createDelegationSignature([oracleQueryId], { onAccount, omitAddress: true })
115
- * ```
116
- */
117
- $createDelegationSignature(ids?: Array<Encoded.Any | AensName>, _options?: {
118
- omitAddress?: boolean;
119
- onAccount?: AccountBase;
120
- }): Promise<Uint8Array>;
89
+ #private;
121
90
  /**
122
91
  * Compile contract
123
92
  * @returns bytecode
124
93
  */
125
94
  $compile(): Promise<Encoded.ContractBytearray>;
126
- protected _handleCallError({ returnType, returnValue }: {
127
- returnType: ContractCallReturnType;
128
- returnValue: Encoded.ContractBytearray;
129
- }, transaction: string): void;
130
- protected _sendAndProcess(tx: Encoded.Transaction, options: SendOptions): Promise<SendAndProcessReturnType>;
131
- _estimateGas<Fn extends MethodNames<M>>(name: Fn, params: MethodParameters<M, Fn>, options?: object): Promise<number>;
95
+ $getCallResultByTxHash<Fn extends MethodNames<M>>(hash: Encoded.TxHash, fnName: Fn, options?: Parameters<Contract<M>['$decodeEvents']>[1]): Promise<GetCallResultByHashReturnType<M, Fn> & {
96
+ result: ContractCallObject;
97
+ }>;
98
+ _estimateGas<Fn extends MethodNames<M>>(name: Fn, params: MethodParameters<M, Fn>, options?: Omit<Parameters<Contract<M>['$call']>[2], 'callStatic'>): Promise<number>;
132
99
  /**
133
100
  * Deploy contract
134
101
  * @param params - Contract init function arguments array
@@ -141,12 +108,6 @@ declare class Contract<M extends ContractMethodsBase> {
141
108
  address?: Encoded.ContractAddress;
142
109
  decodedEvents?: ReturnType<Contract<M>['$decodeEvents']>;
143
110
  }>;
144
- /**
145
- * Get function schema from contract ACI object
146
- * @param name - Function name
147
- * @returns function ACI
148
- */
149
- protected _getFunctionACI(name: string): Partial<FunctionAci>;
150
111
  /**
151
112
  * Call contract function
152
113
  * @param fn - Function name
@@ -154,27 +115,11 @@ declare class Contract<M extends ContractMethodsBase> {
154
115
  * @param options - Array of function arguments
155
116
  * @returns CallResult
156
117
  */
157
- $call<Fn extends MethodNames<M>>(fn: Fn, params: MethodParameters<M, Fn>, options?: Partial<BuildTxOptions<Tag.ContractCallTx, 'callerId' | 'contractId' | 'callData'>> & Parameters<Contract<M>['$decodeEvents']>[1] & Omit<Parameters<Contract<M>['_sendAndProcess']>[1], 'onAccount' | 'onNode'> & Omit<Parameters<typeof txDryRun>[2], 'onNode'> & {
118
+ $call<Fn extends MethodNames<M>>(fn: Fn, params: MethodParameters<M, Fn>, options?: Partial<BuildTxOptions<Tag.ContractCallTx, 'callerId' | 'contractId' | 'callData'>> & Parameters<Contract<M>['$decodeEvents']>[1] & Omit<SendTransactionOptions, 'onAccount' | 'onNode'> & Omit<Parameters<typeof txDryRun>[2], 'onNode'> & {
158
119
  onAccount?: AccountBase;
159
120
  onNode?: Node;
160
121
  callStatic?: boolean;
161
- }): Promise<{
162
- decodedResult?: any;
163
- decodedEvents?: ReturnType<Contract<M>['$decodeEvents']>;
164
- } & SendAndProcessReturnType>;
165
- /**
166
- * @param ctAddress - Contract address that emitted event
167
- * @param nameHash - Hash of emitted event name
168
- * @param options - Options
169
- * @returns Contract name
170
- * @throws {@link MissingEventDefinitionError}
171
- * @throws {@link AmbiguousEventDefinitionError}
172
- */
173
- protected _getContractNameByEvent(ctAddress: Encoded.ContractAddress, nameHash: BigInt, { contractAddressToName }: {
174
- contractAddressToName?: {
175
- [key: string]: string;
176
- };
177
- }): string;
122
+ }): Promise<SendAndProcessReturnType & Partial<GetCallResultByHashReturnType<M, Fn>>>;
178
123
  /**
179
124
  * Decode Events
180
125
  * @param events - Array of encoded events (callRes.result.log)
@@ -183,7 +128,7 @@ declare class Contract<M extends ContractMethodsBase> {
183
128
  */
184
129
  $decodeEvents(events: Event[], { omitUnknown, ...opt }?: {
185
130
  omitUnknown?: boolean;
186
- } & Parameters<Contract<M>['_getContractNameByEvent']>[2]): DecodedEvent[];
131
+ } & GetContractNameByEventOptions): DecodedEvent[];
187
132
  static initialize<M extends ContractMethodsBase>({ onCompiler, onNode, bytecode, aci, address, sourceCodePath, sourceCode, fileSystem, validateBytecode, ...otherOptions }: Omit<ConstructorParameters<typeof Contract>[0], 'aci' | 'address'> & {
188
133
  validateBytecode?: boolean;
189
134
  aci?: Aci;
@@ -1,25 +1,21 @@
1
1
  import { Encoded } from '../../utils/encoder';
2
- import { Aci as BaseAci } from '../../apis/compiler';
3
2
  interface FunctionAci {
4
3
  arguments: any[];
5
4
  name: string;
6
5
  payable: boolean;
7
- returns: string;
6
+ returns: any;
8
7
  stateful: boolean;
9
8
  }
10
- export interface Aci extends BaseAci {
11
- encodedAci: {
12
- contract: {
13
- name: string;
14
- event: any;
15
- kind: string;
16
- state: any;
17
- type_defs: any[];
18
- functions: FunctionAci[];
19
- };
9
+ export type Aci = Array<{
10
+ contract?: {
11
+ name: string;
12
+ event?: any;
13
+ functions: FunctionAci[];
14
+ kind: string;
15
+ payable: boolean;
16
+ typedefs: any[];
20
17
  };
21
- externalEncodedAci: any[];
22
- }
18
+ }>;
23
19
  /**
24
20
  * A base class for all compiler implementations
25
21
  */
@@ -0,0 +1,43 @@
1
+ import { Encoded } from '../utils/encoder';
2
+ import { AensName } from '../tx/builder/constants';
3
+ import AccountBase from '../account/Base';
4
+ import Node from '../Node';
5
+ /**
6
+ * Helper to generate a signature to delegate
7
+ * - pre-claim/claim/transfer/revoke of a name to a contract.
8
+ * - register/extend/respond of an Oracle to a contract.
9
+ * @category contract
10
+ * @param contractAddress - Address of contract to delegate access
11
+ * @param ids - The list of id's to prepend
12
+ * @param options - Options
13
+ * @param options.omitAddress - Prepend delegation signature with an account address
14
+ * @param options.onAccount - Account to use
15
+ * @param options.onNode - Node to use
16
+ * @returns Signature
17
+ * @example
18
+ * ```js
19
+ * const aeSdk = new AeSdk({ ... })
20
+ * const contractAddress = 'ct_asd2ks...'
21
+ * const aensName = 'example.chain'
22
+ * const onAccount = new MemoryAccount(...) // Sign with a specific account
23
+ * // Preclaim signature
24
+ * const preclaimSig = await aeSdk.createDelegationSignature(contractAddress, [], { onAccount })
25
+ * // Claim, transfer and revoke signature
26
+ * const aensDelegationSig = await aeSdk
27
+ * .createDelegationSignature(contractAddress, [aensName], { onAccount })
28
+ *
29
+ * const oracleQueryId = 'oq_...'
30
+ * const onAccount = new MemoryAccount(...) // Sign with a specific account
31
+ * // Oracle register and extend signature
32
+ * const oracleDelegationSig = await aeSdk
33
+ * .createDelegationSignature(contractAddress, [], { onAccount })
34
+ * // Oracle respond signature
35
+ * const respondSig = await aeSdk
36
+ * .createDelegationSignature(contractAddress, [oracleQueryId], { onAccount, omitAddress: true })
37
+ * ```
38
+ */
39
+ export default function createDelegationSignature(contractAddress: Encoded.ContractAddress, ids: Array<Encoded.Any | AensName>, options: {
40
+ omitAddress?: boolean;
41
+ onAccount: AccountBase;
42
+ onNode: Node;
43
+ }): Promise<Uint8Array>;
@@ -1,13 +1,14 @@
1
+ /// <reference types="node" />
1
2
  /**
2
3
  * Generalized Account module - routines to use generalized account
3
4
  */
4
- import { Tag } from '../tx/builder/constants';
5
- import { BuildTxOptions } from '../tx';
5
+ import { Int, Tag } from '../tx/builder/constants';
6
+ import { BuildTxOptions } from '../tx/builder';
6
7
  import { Encoded } from '../utils/encoder';
7
8
  import AccountBase from '../account/Base';
8
9
  import Contract from './Contract';
9
- import { SendOptions } from '../spend';
10
10
  import Node from '../Node';
11
+ import { SendTransactionOptions } from '../chain';
11
12
  import CompilerBase from './compiler/Base';
12
13
  /**
13
14
  * Convert current account to GA
@@ -24,21 +25,36 @@ export declare function createGeneralizedAccount(authFnName: string, args: any[]
24
25
  rawTx: Encoded.Transaction;
25
26
  gaContractId: Encoded.ContractAddress;
26
27
  }>>;
27
- interface CreateGeneralizedAccountOptions extends BuildTxOptions<Tag.GaAttachTx, 'authFun' | 'callData' | 'code' | 'ownerId' | 'gasLimit'>, SendOptions, Pick<Parameters<typeof Contract.initialize>[0], 'bytecode' | 'aci' | 'sourceCodePath' | 'sourceCode' | 'fileSystem'> {
28
+ interface CreateGeneralizedAccountOptions extends BuildTxOptions<Tag.GaAttachTx, 'authFun' | 'callData' | 'code' | 'ownerId' | 'gasLimit'>, SendTransactionOptions, Pick<Parameters<typeof Contract.initialize>[0], 'bytecode' | 'aci' | 'sourceCodePath' | 'sourceCode' | 'fileSystem'> {
28
29
  onAccount: AccountBase;
29
30
  onCompiler: CompilerBase;
30
31
  onNode: Node;
31
32
  gasLimit?: number;
32
33
  }
33
34
  /**
34
- * Build a transaction hash the same as `Auth.tx_hash`
35
+ * Build a transaction hash the same as `Auth.tx_hash` by GaMetaTx payload
35
36
  * @category contract
36
37
  * @param transaction - tx-encoded transaction
37
38
  * @param options - Options
39
+ * @param options.fee - GaMetaTx fee, required in Ceres
40
+ * @param options.gasPrice - GaMetaTx gasPrice, required in Ceres
38
41
  * @param options.onNode - Node to use
39
42
  * @returns Transaction hash
40
43
  */
41
- export declare function buildAuthTxHash(transaction: Encoded.Transaction, { onNode }: {
44
+ export declare function buildAuthTxHash(transaction: Encoded.Transaction, { fee, gasPrice, onNode }: {
45
+ fee?: Int;
46
+ gasPrice?: Int;
42
47
  onNode: Node;
43
- }): Promise<Uint8Array>;
48
+ }): Promise<Buffer>;
49
+ /**
50
+ * Build a transaction hash the same as `Auth.tx_hash` by GaMetaTx
51
+ * @category contract
52
+ * @param transaction - tx-encoded signed GaMeta transaction
53
+ * @param options - Options
54
+ * @param options.onNode - Node to use
55
+ * @returns Transaction hash
56
+ */
57
+ export declare function buildAuthTxHashByGaMetaTx(transaction: Encoded.Transaction, { onNode }: {
58
+ onNode: Node;
59
+ }): Promise<Buffer>;
44
60
  export {};
@@ -2,14 +2,15 @@ export * from './chain';
2
2
  export * from './utils/crypto';
3
3
  export * from './utils/keystore';
4
4
  export * from './utils/bytes';
5
- export * from './tx';
6
- export * from './tx/builder';
5
+ export { buildTx, buildTxAsync, buildTxHash, unpackTx, buildContractIdByContractTx, } from './tx/builder';
7
6
  export * from './tx/builder/helpers';
8
7
  export * from './tx/builder/constants';
9
- export * from './tx/builder/schema';
8
+ export { ORACLE_TTL_TYPES, ORACLE_TTL, QUERY_TTL, RESPONSE_TTL, DRY_RUN_ACCOUNT, CallReturnType, } from './tx/builder/schema';
9
+ export { getExecutionCost, getExecutionCostBySignedTx, getExecutionCostUsingNode, } from './tx/execution-cost';
10
+ export { default as getTransactionSignerAddress } from './tx/transaction-signer';
10
11
  export * from './utils/amount-formatter';
11
12
  export * from './utils/hd-wallet';
12
- export { encode, decode, Encoding } from './utils/encoder';
13
+ export { encode, decode, Encoding, Encoded, } from './utils/encoder';
13
14
  export * from './aens';
14
15
  export { default as Contract } from './contract/Contract';
15
16
  export type { ContractMethodsBase } from './contract/Contract';
@@ -5,13 +5,11 @@
5
5
  * https://github.com/aeternity/protocol/blob/master/ORACLE.md in the protocol
6
6
  * repository.
7
7
  */
8
- import BigNumber from 'bignumber.js';
9
- import { send, SendOptions } from './spend';
8
+ import { BuildTxOptions } from './tx/builder';
10
9
  import { ORACLE_TTL_TYPES } from './tx/builder/schema';
11
10
  import { Tag } from './tx/builder/constants';
12
11
  import { Encoded } from './utils/encoder';
13
- import { _getPollInterval } from './chain';
14
- import { BuildTxOptions } from './tx';
12
+ import { _getPollInterval, sendTransaction, SendTransactionOptions } from './chain';
15
13
  import Node from './Node';
16
14
  import AccountBase from './account/Base';
17
15
  type OracleQueries = Awaited<ReturnType<Node['getOracleQueriesByPubkey']>>['oracleQueries'];
@@ -25,7 +23,7 @@ type OracleQueries = Awaited<ReturnType<Node['getOracleQueriesByPubkey']>>['orac
25
23
  * @param options.onNode - Node to use
26
24
  * @returns Callback to stop polling function
27
25
  */
28
- export declare function pollForQueries(oracleId: Encoded.OracleAddress, onQuery: (queries: OracleQueries) => void, { interval, onNode, ...options }: {
26
+ export declare function pollForQueries(oracleId: Encoded.OracleAddress, onQuery: (query: OracleQueries[number]) => void, { interval, onNode, ...options }: {
29
27
  interval?: number;
30
28
  onNode: Node;
31
29
  } & Parameters<typeof _getPollInterval>[1]): () => void;
@@ -55,7 +53,7 @@ export declare function getQueryObject(oracleId: Encoded.OracleAddress, queryId:
55
53
  interface GetQueryObjectReturnType extends Awaited<ReturnType<Node['getOracleQueryByPubkeyAndQueryId']>> {
56
54
  decodedQuery: string;
57
55
  decodedResponse: string;
58
- respond: (response: string, options?: Parameters<typeof respondToQuery>[3]) => ReturnType<typeof respondToQuery>;
56
+ respond: (response: string, options?: Parameters<typeof respondToQuery>[2]) => ReturnType<typeof respondToQuery>;
59
57
  pollForResponse: (options?: Parameters<typeof pollForQueryResponse>[2]) => ReturnType<typeof pollForQueryResponse>;
60
58
  }
61
59
  /**
@@ -71,8 +69,8 @@ interface GetQueryObjectReturnType extends Awaited<ReturnType<Node['getOracleQue
71
69
  * @param options.ttl - Transaction time to leave
72
70
  * @returns Query object
73
71
  */
74
- export declare function postQueryToOracle(oracleId: Encoded.OracleAddress, query: string, options: PostQueryToOracleOptions): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getQueryObject>>>;
75
- type PostQueryToOracleOptionsType = Parameters<typeof send>[1] & Parameters<typeof getQueryObject>[2] & BuildTxOptions<Tag.OracleQueryTx, 'oracleId' | 'senderId' | 'query' | 'queryTtlType' | 'queryTtlValue' | 'responseTtlType' | 'responseTtlValue'> & {
72
+ export declare function postQueryToOracle(oracleId: Encoded.OracleAddress, query: string, options: PostQueryToOracleOptions): Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getQueryObject>>>;
73
+ type PostQueryToOracleOptionsType = Parameters<typeof sendTransaction>[1] & Parameters<typeof getQueryObject>[2] & BuildTxOptions<Tag.OracleQueryTx, 'oracleId' | 'senderId' | 'query' | 'queryTtlType' | 'queryTtlValue' | 'responseTtlType' | 'responseTtlValue'> & {
76
74
  queryTtlType?: ORACLE_TTL_TYPES;
77
75
  queryTtlValue?: number;
78
76
  responseTtlType?: ORACLE_TTL_TYPES;
@@ -83,7 +81,6 @@ interface PostQueryToOracleOptions extends PostQueryToOracleOptionsType {
83
81
  /**
84
82
  * Extend oracle ttl
85
83
  * @category oracle
86
- * @param oracleId - Oracle public key
87
84
  * @param options - Options object
88
85
  * @param options.fee - fee Transaction fee
89
86
  * @param options.ttl - Transaction time to leave
@@ -91,8 +88,8 @@ interface PostQueryToOracleOptions extends PostQueryToOracleOptionsType {
91
88
  * @param options.oracleTtlValue - Oracle time to leave for extend
92
89
  * @returns Oracle object
93
90
  */
94
- export declare function extendOracleTtl(oracleId: Encoded.OracleAddress, options: ExtendOracleTtlOptions): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>>;
95
- type ExtendOracleTtlOptionsType = SendOptions & Parameters<typeof getOracleObject>[1] & BuildTxOptions<Tag.OracleExtendTx, 'oracleTtlType' | 'oracleTtlValue' | 'callerId' | 'oracleId'> & {
91
+ export declare function extendOracleTtl(options: ExtendOracleTtlOptions): Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>>;
92
+ type ExtendOracleTtlOptionsType = SendTransactionOptions & Parameters<typeof getOracleObject>[1] & BuildTxOptions<Tag.OracleExtendTx, 'oracleTtlType' | 'oracleTtlValue' | 'callerId' | 'oracleId'> & {
96
93
  oracleTtlType?: ORACLE_TTL_TYPES;
97
94
  oracleTtlValue?: number;
98
95
  };
@@ -101,7 +98,6 @@ interface ExtendOracleTtlOptions extends ExtendOracleTtlOptionsType {
101
98
  /**
102
99
  * Extend oracle ttl
103
100
  * @category oracle
104
- * @param oracleId - Oracle public key
105
101
  * @param queryId - Oracle query id
106
102
  * @param response - Oracle query response
107
103
  * @param options - Options object
@@ -110,8 +106,8 @@ interface ExtendOracleTtlOptions extends ExtendOracleTtlOptionsType {
110
106
  * @param options.ttl - Transaction time to leave
111
107
  * @returns Oracle object
112
108
  */
113
- export declare function respondToQuery(oracleId: Encoded.OracleAddress, queryId: Encoded.OracleQueryId, response: string, options: RespondToQueryOptions): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>>;
114
- type RespondToQueryOptionsType = SendOptions & Parameters<typeof getOracleObject>[1] & BuildTxOptions<Tag.OracleResponseTx, 'callerId' | 'oracleId' | 'queryId' | 'response' | 'responseTtlType' | 'responseTtlValue'> & {
109
+ export declare function respondToQuery(queryId: Encoded.OracleQueryId, response: string, options: RespondToQueryOptions): Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>>;
110
+ type RespondToQueryOptionsType = SendTransactionOptions & Parameters<typeof getOracleObject>[1] & BuildTxOptions<Tag.OracleResponseTx, 'callerId' | 'oracleId' | 'queryId' | 'response' | 'responseTtlType' | 'responseTtlValue'> & {
115
111
  responseTtlType?: ORACLE_TTL_TYPES;
116
112
  responseTtlValue?: number;
117
113
  };
@@ -150,9 +146,8 @@ interface GetOracleObjectReturnType extends Awaited<ReturnType<Node['getOracleBy
150
146
  * @param options.ttl - Transaction time to leave
151
147
  * @returns Oracle object
152
148
  */
153
- export declare function registerOracle(queryFormat: string, responseFormat: string, options: RegisterOracleOptions): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>>;
154
- type RegisterOracleOptionsType = SendOptions & Parameters<typeof getOracleObject>[1] & BuildTxOptions<Tag.OracleRegisterTx, 'accountId' | 'queryFormat' | 'responseFormat' | 'queryFee' | 'oracleTtlType' | 'oracleTtlValue'> & {
155
- queryFee?: number | string | BigNumber;
149
+ export declare function registerOracle(queryFormat: string, responseFormat: string, options: RegisterOracleOptions): Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>>;
150
+ type RegisterOracleOptionsType = SendTransactionOptions & Parameters<typeof getOracleObject>[1] & BuildTxOptions<Tag.OracleRegisterTx, 'accountId' | 'queryFormat' | 'responseFormat' | 'oracleTtlType' | 'oracleTtlValue'> & {
156
151
  oracleTtlType?: ORACLE_TTL_TYPES;
157
152
  oracleTtlValue?: number;
158
153
  };