@aeternity/aepp-sdk 13.2.2 → 13.3.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 (494) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/bin/aesophia_cli +0 -0
  4. package/bin/aesophia_cli_8 +0 -0
  5. package/dist/aepp-sdk.browser-script.js +1 -1
  6. package/dist/aepp-sdk.browser-script.js.map +1 -1
  7. package/dist/aepp-sdk.browser.js +1 -1
  8. package/dist/aepp-sdk.browser.js.map +1 -1
  9. package/dist/aepp-sdk.js +9171 -7086
  10. package/dist/aepp-sdk.js.map +1 -1
  11. package/es/AeSdk.d.ts +3 -0
  12. package/es/AeSdk.mjs +12 -12
  13. package/es/AeSdk.mjs.map +1 -1
  14. package/es/AeSdkAepp.d.ts +0 -1
  15. package/es/AeSdkAepp.mjs +12 -16
  16. package/es/AeSdkAepp.mjs.map +1 -1
  17. package/es/AeSdkBase.d.ts +61 -6
  18. package/es/AeSdkBase.mjs +150 -69
  19. package/es/AeSdkBase.mjs.map +1 -1
  20. package/es/AeSdkMethods.d.ts +19 -7
  21. package/es/AeSdkMethods.mjs +39 -38
  22. package/es/AeSdkMethods.mjs.map +1 -1
  23. package/es/AeSdkWallet.mjs +86 -55
  24. package/es/AeSdkWallet.mjs.map +1 -1
  25. package/es/Middleware.mjs +31 -27
  26. package/es/Middleware.mjs.map +1 -1
  27. package/es/MiddlewareSubscriber.mjs +5 -14
  28. package/es/MiddlewareSubscriber.mjs.map +1 -1
  29. package/es/Node.d.ts +10 -2
  30. package/es/Node.mjs +53 -54
  31. package/es/Node.mjs.map +1 -1
  32. package/es/account/Base.d.ts +39 -3
  33. package/es/account/Base.mjs +35 -1
  34. package/es/account/Base.mjs.map +1 -1
  35. package/es/account/Generalized.d.ts +2 -0
  36. package/es/account/Generalized.mjs +15 -6
  37. package/es/account/Generalized.mjs.map +1 -1
  38. package/es/account/Ledger.d.ts +2 -0
  39. package/es/account/Ledger.mjs +14 -5
  40. package/es/account/Ledger.mjs.map +1 -1
  41. package/es/account/LedgerFactory.mjs +4 -6
  42. package/es/account/LedgerFactory.mjs.map +1 -1
  43. package/es/account/Memory.d.ts +15 -4
  44. package/es/account/Memory.mjs +96 -31
  45. package/es/account/Memory.mjs.map +1 -1
  46. package/es/account/Rpc.d.ts +16 -5
  47. package/es/account/Rpc.mjs +94 -21
  48. package/es/account/Rpc.mjs.map +1 -1
  49. package/es/aens.d.ts +17 -44
  50. package/es/aens.mjs +32 -71
  51. package/es/aens.mjs.map +1 -1
  52. package/es/aepp-wallet-communication/connection/Browser.mjs +3 -4
  53. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
  54. package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +3 -0
  55. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +7 -5
  56. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
  57. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +8 -9
  58. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
  59. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +7 -7
  60. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
  61. package/es/aepp-wallet-communication/rpc/types.d.ts +14 -0
  62. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
  63. package/es/aepp-wallet-communication/schema.d.ts +2 -0
  64. package/es/aepp-wallet-communication/schema.mjs +2 -0
  65. package/es/aepp-wallet-communication/schema.mjs.map +1 -1
  66. package/es/aepp-wallet-communication/wallet-detector.mjs +4 -5
  67. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
  68. package/es/apis/compiler/compiler.mjs.map +1 -1
  69. package/es/apis/compiler/models/index.d.ts +1 -0
  70. package/es/apis/compiler/models/index.mjs.map +1 -1
  71. package/es/apis/compiler/models/mappers.mjs +13 -0
  72. package/es/apis/compiler/models/mappers.mjs.map +1 -1
  73. package/es/apis/compiler/models/parameters.mjs.map +1 -1
  74. package/es/apis/middleware/middleware.d.ts +23 -5
  75. package/es/apis/middleware/middleware.mjs +114 -18
  76. package/es/apis/middleware/middleware.mjs.map +1 -1
  77. package/es/apis/middleware/models/index.d.ts +164 -15
  78. package/es/apis/middleware/models/index.mjs +53 -3
  79. package/es/apis/middleware/models/index.mjs.map +1 -1
  80. package/es/apis/middleware/models/mappers.d.ts +8 -1
  81. package/es/apis/middleware/models/mappers.mjs +376 -3
  82. package/es/apis/middleware/models/mappers.mjs.map +1 -1
  83. package/es/apis/middleware/models/parameters.d.ts +6 -3
  84. package/es/apis/middleware/models/parameters.mjs +38 -11
  85. package/es/apis/middleware/models/parameters.mjs.map +1 -1
  86. package/es/apis/node/models/index.d.ts +66 -2
  87. package/es/apis/node/models/index.mjs.map +1 -1
  88. package/es/apis/node/models/mappers.d.ts +5 -1
  89. package/es/apis/node/models/mappers.mjs +229 -7
  90. package/es/apis/node/models/mappers.mjs.map +1 -1
  91. package/es/apis/node/models/parameters.d.ts +2 -2
  92. package/es/apis/node/models/parameters.mjs +2 -2
  93. package/es/apis/node/models/parameters.mjs.map +1 -1
  94. package/es/apis/node/node.d.ts +24 -3
  95. package/es/apis/node/node.mjs +135 -3
  96. package/es/apis/node/node.mjs.map +1 -1
  97. package/es/chain.d.ts +14 -44
  98. package/es/chain.mjs +125 -219
  99. package/es/chain.mjs.map +1 -1
  100. package/es/channel/Base.d.ts +3 -47
  101. package/es/channel/Base.mjs +21 -54
  102. package/es/channel/Base.mjs.map +1 -1
  103. package/es/channel/Contract.d.ts +16 -25
  104. package/es/channel/Contract.mjs +39 -63
  105. package/es/channel/Contract.mjs.map +1 -1
  106. package/es/channel/Spend.d.ts +0 -8
  107. package/es/channel/Spend.mjs +17 -29
  108. package/es/channel/Spend.mjs.map +1 -1
  109. package/es/channel/handlers.mjs +1 -1
  110. package/es/channel/handlers.mjs.map +1 -1
  111. package/es/channel/internal.d.ts +104 -5
  112. package/es/channel/internal.mjs +26 -34
  113. package/es/channel/internal.mjs.map +1 -1
  114. package/es/contract/Contract.d.ts +9 -1
  115. package/es/contract/Contract.mjs +67 -73
  116. package/es/contract/Contract.mjs.map +1 -1
  117. package/es/contract/compiler/Base.d.ts +14 -8
  118. package/es/contract/compiler/Base.mjs.map +1 -1
  119. package/es/contract/compiler/Cli.d.ts +5 -9
  120. package/es/contract/compiler/Cli.mjs +45 -23
  121. package/es/contract/compiler/Cli.mjs.map +1 -1
  122. package/es/contract/compiler/Cli8.d.ts +13 -0
  123. package/es/contract/compiler/Cli8.mjs +22 -0
  124. package/es/contract/compiler/Cli8.mjs.map +1 -0
  125. package/es/contract/compiler/Http.d.ts +3 -9
  126. package/es/contract/compiler/Http.mjs +28 -16
  127. package/es/contract/compiler/Http.mjs.map +1 -1
  128. package/es/contract/compiler/HttpNode.d.ts +2 -5
  129. package/es/contract/compiler/HttpNode.mjs.map +1 -1
  130. package/es/contract/delegation-signature.d.ts +2 -1
  131. package/es/contract/delegation-signature.mjs +18 -14
  132. package/es/contract/delegation-signature.mjs.map +1 -1
  133. package/es/contract/ga.d.ts +1 -2
  134. package/es/contract/ga.mjs +23 -25
  135. package/es/contract/ga.mjs.map +1 -1
  136. package/es/deprecated.d.ts +38 -0
  137. package/es/deprecated.mjs +45 -0
  138. package/es/deprecated.mjs.map +1 -1
  139. package/es/index-browser.d.ts +10 -5
  140. package/es/index-browser.mjs +9 -5
  141. package/es/index-browser.mjs.map +1 -1
  142. package/es/index.d.ts +1 -0
  143. package/es/index.mjs +1 -0
  144. package/es/index.mjs.map +1 -1
  145. package/es/oracle.d.ts +6 -37
  146. package/es/oracle.mjs +32 -66
  147. package/es/oracle.mjs.map +1 -1
  148. package/es/send-transaction.d.ts +53 -0
  149. package/es/send-transaction.mjs +109 -0
  150. package/es/send-transaction.mjs.map +1 -0
  151. package/es/spend.d.ts +4 -3
  152. package/es/spend.mjs +6 -1
  153. package/es/spend.mjs.map +1 -1
  154. package/es/tx/builder/common.d.ts +29 -0
  155. package/es/tx/builder/common.mjs +42 -0
  156. package/es/tx/builder/common.mjs.map +1 -0
  157. package/es/tx/builder/constants.d.ts +4 -4
  158. package/es/tx/builder/constants.mjs +6 -15
  159. package/es/tx/builder/constants.mjs.map +1 -1
  160. package/es/tx/builder/delegation/index.d.ts +20 -0
  161. package/es/tx/builder/delegation/index.mjs +24 -0
  162. package/es/tx/builder/delegation/index.mjs.map +1 -0
  163. package/es/tx/builder/delegation/schema.d.ts +130 -0
  164. package/es/tx/builder/delegation/schema.generated.d.ts +141 -0
  165. package/es/tx/builder/delegation/schema.generated.mjs +2 -0
  166. package/es/tx/builder/delegation/schema.generated.mjs.map +1 -0
  167. package/es/tx/builder/delegation/schema.mjs +54 -0
  168. package/es/tx/builder/delegation/schema.mjs.map +1 -0
  169. package/es/tx/builder/field-types/abi-version.mjs +8 -11
  170. package/es/tx/builder/field-types/abi-version.mjs.map +1 -1
  171. package/es/tx/builder/field-types/address.mjs +1 -4
  172. package/es/tx/builder/field-types/address.mjs.map +1 -1
  173. package/es/tx/builder/field-types/coin-amount.d.ts +2 -2
  174. package/es/tx/builder/field-types/coin-amount.mjs +6 -6
  175. package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
  176. package/es/tx/builder/field-types/ct-version.mjs +3 -4
  177. package/es/tx/builder/field-types/ct-version.mjs.map +1 -1
  178. package/es/tx/builder/field-types/entry.mjs +7 -13
  179. package/es/tx/builder/field-types/entry.mjs.map +1 -1
  180. package/es/tx/builder/field-types/fee.d.ts +19 -11
  181. package/es/tx/builder/field-types/fee.mjs +56 -38
  182. package/es/tx/builder/field-types/fee.mjs.map +1 -1
  183. package/es/tx/builder/field-types/gas-limit.mjs +13 -15
  184. package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
  185. package/es/tx/builder/field-types/gas-price.d.ts +10 -2
  186. package/es/tx/builder/field-types/gas-price.mjs +52 -3
  187. package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
  188. package/es/tx/builder/field-types/index.d.ts +31 -29
  189. package/es/tx/builder/field-types/index.mjs +31 -29
  190. package/es/tx/builder/field-types/index.mjs.map +1 -1
  191. package/es/tx/builder/field-types/map.mjs +20 -31
  192. package/es/tx/builder/field-types/map.mjs.map +1 -1
  193. package/es/tx/builder/field-types/mptree.mjs +14 -29
  194. package/es/tx/builder/field-types/mptree.mjs.map +1 -1
  195. package/es/tx/builder/field-types/name-fee.d.ts +1 -1
  196. package/es/tx/builder/field-types/name-fee.mjs +1 -1
  197. package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
  198. package/es/tx/builder/field-types/nonce.d.ts +1 -0
  199. package/es/tx/builder/field-types/nonce.mjs +2 -0
  200. package/es/tx/builder/field-types/nonce.mjs.map +1 -1
  201. package/es/tx/builder/field-types/pointers.mjs +4 -7
  202. package/es/tx/builder/field-types/pointers.mjs.map +1 -1
  203. package/es/tx/builder/field-types/pointers2.d.ts +23 -0
  204. package/es/tx/builder/field-types/pointers2.mjs +65 -0
  205. package/es/tx/builder/field-types/pointers2.mjs.map +1 -0
  206. package/es/tx/builder/field-types/query-fee.d.ts +19 -0
  207. package/es/tx/builder/field-types/query-fee.mjs +20 -0
  208. package/es/tx/builder/field-types/query-fee.mjs.map +1 -0
  209. package/es/tx/builder/field-types/ttl.d.ts +9 -1
  210. package/es/tx/builder/field-types/ttl.mjs +19 -8
  211. package/es/tx/builder/field-types/ttl.mjs.map +1 -1
  212. package/es/tx/builder/field-types/with-default.d.ts +7 -0
  213. package/es/tx/builder/field-types/with-default.mjs +9 -0
  214. package/es/tx/builder/field-types/with-default.mjs.map +1 -0
  215. package/es/tx/builder/field-types/with-formatting.d.ts +7 -0
  216. package/es/tx/builder/field-types/with-formatting.mjs +9 -0
  217. package/es/tx/builder/field-types/with-formatting.mjs.map +1 -0
  218. package/es/tx/builder/field-types/wrapped.mjs +6 -8
  219. package/es/tx/builder/field-types/wrapped.mjs.map +1 -1
  220. package/es/tx/builder/helpers.d.ts +2 -2
  221. package/es/tx/builder/helpers.mjs +12 -21
  222. package/es/tx/builder/helpers.mjs.map +1 -1
  223. package/es/tx/builder/index.d.ts +17 -10
  224. package/es/tx/builder/index.mjs +39 -65
  225. package/es/tx/builder/index.mjs.map +1 -1
  226. package/es/tx/builder/schema.d.ts +478 -257
  227. package/es/tx/builder/schema.generated.d.ts +39 -3
  228. package/es/tx/builder/schema.generated.mjs.map +1 -1
  229. package/es/tx/builder/schema.mjs +48 -36
  230. package/es/tx/builder/schema.mjs.map +1 -1
  231. package/es/tx/execution-cost.d.ts +6 -5
  232. package/es/tx/execution-cost.mjs +16 -17
  233. package/es/tx/execution-cost.mjs.map +1 -1
  234. package/es/tx/transaction-signer.mjs +1 -4
  235. package/es/tx/transaction-signer.mjs.map +1 -1
  236. package/es/tx/validator.mjs +61 -42
  237. package/es/tx/validator.mjs.map +1 -1
  238. package/es/utils/amount-formatter.mjs +15 -22
  239. package/es/utils/amount-formatter.mjs.map +1 -1
  240. package/es/utils/autorest.d.ts +2 -3
  241. package/es/utils/autorest.mjs +40 -24
  242. package/es/utils/autorest.mjs.map +1 -1
  243. package/es/utils/bytes.mjs +1 -2
  244. package/es/utils/bytes.mjs.map +1 -1
  245. package/es/utils/crypto.d.ts +8 -4
  246. package/es/utils/crypto.mjs +17 -13
  247. package/es/utils/crypto.mjs.map +1 -1
  248. package/es/utils/errors.d.ts +6 -0
  249. package/es/utils/errors.mjs +12 -6
  250. package/es/utils/errors.mjs.map +1 -1
  251. package/es/utils/hd-wallet.d.ts +2 -0
  252. package/es/utils/hd-wallet.mjs +6 -5
  253. package/es/utils/hd-wallet.mjs.map +1 -1
  254. package/es/utils/json-big.mjs +2 -10
  255. package/es/utils/json-big.mjs.map +1 -1
  256. package/es/utils/jwt.d.ts +53 -0
  257. package/es/utils/jwt.mjs +120 -0
  258. package/es/utils/jwt.mjs.map +1 -0
  259. package/es/utils/keystore.d.ts +6 -2
  260. package/es/utils/keystore.mjs +8 -16
  261. package/es/utils/keystore.mjs.map +1 -1
  262. package/es/utils/typed-data.mjs +1 -0
  263. package/es/utils/typed-data.mjs.map +1 -1
  264. package/es/utils/wrap-proxy.d.ts +2 -0
  265. package/es/utils/wrap-proxy.mjs +15 -0
  266. package/es/utils/wrap-proxy.mjs.map +1 -0
  267. package/package.json +57 -51
  268. package/src/AeSdk.ts +3 -0
  269. package/src/AeSdkAepp.ts +0 -1
  270. package/src/AeSdkBase.ts +97 -10
  271. package/src/AeSdkMethods.ts +37 -33
  272. package/src/AeSdkWallet.ts +22 -3
  273. package/src/Middleware.ts +16 -8
  274. package/src/MiddlewareSubscriber.ts +1 -1
  275. package/src/Node.ts +37 -18
  276. package/src/account/Base.ts +62 -3
  277. package/src/account/Generalized.ts +10 -0
  278. package/src/account/Ledger.ts +10 -0
  279. package/src/account/Memory.ts +83 -9
  280. package/src/account/Rpc.ts +69 -6
  281. package/src/aens.ts +35 -56
  282. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +3 -0
  283. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +2 -2
  284. package/src/aepp-wallet-communication/rpc/RpcClient.ts +4 -2
  285. package/src/aepp-wallet-communication/rpc/types.ts +13 -0
  286. package/src/aepp-wallet-communication/schema.ts +2 -0
  287. package/src/apis/compiler/compiler.ts +93 -93
  288. package/src/apis/compiler/models/index.ts +1 -0
  289. package/src/apis/compiler/models/mappers.ts +178 -165
  290. package/src/apis/compiler/models/parameters.ts +18 -18
  291. package/src/apis/middleware/middleware.ts +462 -341
  292. package/src/apis/middleware/models/index.ts +258 -56
  293. package/src/apis/middleware/models/mappers.ts +2357 -1919
  294. package/src/apis/middleware/models/parameters.ts +172 -142
  295. package/src/apis/node/models/index.ts +79 -2
  296. package/src/apis/node/models/mappers.ts +1529 -1302
  297. package/src/apis/node/models/parameters.ts +51 -51
  298. package/src/apis/node/node.ts +420 -275
  299. package/src/chain.ts +42 -128
  300. package/src/channel/Base.ts +14 -47
  301. package/src/channel/Contract.ts +18 -26
  302. package/src/channel/Spend.ts +0 -8
  303. package/src/channel/internal.ts +115 -13
  304. package/src/contract/Contract.ts +26 -8
  305. package/src/contract/compiler/Base.ts +15 -8
  306. package/src/contract/compiler/Cli.ts +37 -21
  307. package/src/contract/compiler/Cli8.ts +17 -0
  308. package/src/contract/compiler/Http.ts +24 -14
  309. package/src/contract/compiler/HttpNode.ts +2 -2
  310. package/src/contract/delegation-signature.ts +11 -5
  311. package/src/contract/ga.ts +4 -3
  312. package/src/deprecated.ts +36 -0
  313. package/src/index-browser.ts +14 -7
  314. package/src/index.ts +1 -0
  315. package/src/oracle.ts +11 -54
  316. package/src/send-transaction.ts +136 -0
  317. package/src/spend.ts +25 -11
  318. package/src/tx/builder/common.ts +74 -0
  319. package/src/tx/builder/constants.ts +6 -9
  320. package/src/tx/builder/delegation/index.ts +28 -0
  321. package/src/tx/builder/delegation/schema.generated.ts +143 -0
  322. package/src/tx/builder/delegation/schema.ts +61 -0
  323. package/src/tx/builder/field-types/coin-amount.ts +3 -2
  324. package/src/tx/builder/field-types/entry.ts +1 -4
  325. package/src/tx/builder/field-types/fee.ts +71 -43
  326. package/src/tx/builder/field-types/gas-limit.ts +4 -4
  327. package/src/tx/builder/field-types/gas-price.ts +58 -2
  328. package/src/tx/builder/field-types/index.ts +31 -59
  329. package/src/tx/builder/field-types/name-fee.ts +1 -1
  330. package/src/tx/builder/field-types/nonce.ts +7 -1
  331. package/src/tx/builder/field-types/pointers2.ts +62 -0
  332. package/src/tx/builder/field-types/query-fee.ts +25 -0
  333. package/src/tx/builder/field-types/ttl.ts +13 -3
  334. package/src/tx/builder/field-types/with-default.ts +18 -0
  335. package/src/tx/builder/field-types/with-formatting.ts +18 -0
  336. package/src/tx/builder/helpers.ts +2 -2
  337. package/src/tx/builder/index.ts +42 -59
  338. package/src/tx/builder/schema.generated.ts +39 -3
  339. package/src/tx/builder/schema.ts +55 -29
  340. package/src/tx/execution-cost.ts +6 -5
  341. package/src/tx/validator.ts +31 -5
  342. package/src/utils/autorest.ts +36 -27
  343. package/src/utils/crypto.ts +23 -13
  344. package/src/utils/errors.ts +10 -0
  345. package/src/utils/hd-wallet.ts +2 -0
  346. package/src/utils/jwt.ts +126 -0
  347. package/src/utils/keystore.ts +6 -2
  348. package/src/utils/wrap-proxy.ts +24 -0
  349. package/types-legacy/ts4.2/AeSdk.d.ts +3 -0
  350. package/types-legacy/ts4.2/AeSdkAepp.d.ts +0 -1
  351. package/types-legacy/ts4.2/AeSdkBase.d.ts +61 -6
  352. package/types-legacy/ts4.2/AeSdkMethods.d.ts +19 -7
  353. package/types-legacy/ts4.2/Node.d.ts +14 -1
  354. package/types-legacy/ts4.2/account/Base.d.ts +39 -3
  355. package/types-legacy/ts4.2/account/Generalized.d.ts +2 -0
  356. package/types-legacy/ts4.2/account/Ledger.d.ts +2 -0
  357. package/types-legacy/ts4.2/account/Memory.d.ts +15 -4
  358. package/types-legacy/ts4.2/account/Rpc.d.ts +16 -5
  359. package/types-legacy/ts4.2/aens.d.ts +17 -44
  360. package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserRuntime.d.ts +3 -0
  361. package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +14 -0
  362. package/types-legacy/ts4.2/aepp-wallet-communication/schema.d.ts +2 -0
  363. package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +1 -0
  364. package/types-legacy/ts4.2/apis/middleware/middleware.d.ts +23 -5
  365. package/types-legacy/ts4.2/apis/middleware/models/index.d.ts +164 -15
  366. package/types-legacy/ts4.2/apis/middleware/models/mappers.d.ts +8 -1
  367. package/types-legacy/ts4.2/apis/middleware/models/parameters.d.ts +6 -3
  368. package/types-legacy/ts4.2/apis/node/models/index.d.ts +66 -2
  369. package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +5 -1
  370. package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +2 -2
  371. package/types-legacy/ts4.2/apis/node/node.d.ts +24 -3
  372. package/types-legacy/ts4.2/chain.d.ts +14 -44
  373. package/types-legacy/ts4.2/channel/Base.d.ts +3 -47
  374. package/types-legacy/ts4.2/channel/Contract.d.ts +16 -25
  375. package/types-legacy/ts4.2/channel/Spend.d.ts +0 -8
  376. package/types-legacy/ts4.2/channel/internal.d.ts +104 -5
  377. package/types-legacy/ts4.2/contract/Contract.d.ts +9 -1
  378. package/types-legacy/ts4.2/contract/compiler/Base.d.ts +14 -8
  379. package/types-legacy/ts4.2/contract/compiler/Cli.d.ts +5 -9
  380. package/types-legacy/ts4.2/contract/compiler/Cli8.d.ts +13 -0
  381. package/types-legacy/ts4.2/contract/compiler/Http.d.ts +3 -9
  382. package/types-legacy/ts4.2/contract/compiler/HttpNode.d.ts +2 -5
  383. package/types-legacy/ts4.2/contract/delegation-signature.d.ts +2 -1
  384. package/types-legacy/ts4.2/contract/ga.d.ts +1 -2
  385. package/types-legacy/ts4.2/deprecated.d.ts +38 -0
  386. package/types-legacy/ts4.2/index-browser.d.ts +10 -5
  387. package/types-legacy/ts4.2/index.d.ts +1 -0
  388. package/types-legacy/ts4.2/oracle.d.ts +6 -37
  389. package/types-legacy/ts4.2/send-transaction.d.ts +53 -0
  390. package/types-legacy/ts4.2/spend.d.ts +4 -3
  391. package/types-legacy/ts4.2/tx/builder/common.d.ts +32 -0
  392. package/types-legacy/ts4.2/tx/builder/constants.d.ts +4 -4
  393. package/types-legacy/ts4.2/tx/builder/delegation/index.d.ts +20 -0
  394. package/types-legacy/ts4.2/tx/builder/delegation/schema.d.ts +136 -0
  395. package/types-legacy/ts4.2/tx/builder/delegation/schema.generated.d.ts +141 -0
  396. package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +2 -2
  397. package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +19 -11
  398. package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +10 -2
  399. package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +31 -29
  400. package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +1 -1
  401. package/types-legacy/ts4.2/tx/builder/field-types/nonce.d.ts +1 -0
  402. package/types-legacy/ts4.2/tx/builder/field-types/pointers2.d.ts +26 -0
  403. package/types-legacy/ts4.2/tx/builder/field-types/query-fee.d.ts +19 -0
  404. package/types-legacy/ts4.2/tx/builder/field-types/ttl.d.ts +9 -1
  405. package/types-legacy/ts4.2/tx/builder/field-types/with-default.d.ts +7 -0
  406. package/types-legacy/ts4.2/tx/builder/field-types/with-formatting.d.ts +7 -0
  407. package/types-legacy/ts4.2/tx/builder/helpers.d.ts +2 -2
  408. package/types-legacy/ts4.2/tx/builder/index.d.ts +17 -10
  409. package/types-legacy/ts4.2/tx/builder/schema.d.ts +482 -257
  410. package/types-legacy/ts4.2/tx/builder/schema.generated.d.ts +39 -3
  411. package/types-legacy/ts4.2/tx/execution-cost.d.ts +6 -5
  412. package/types-legacy/ts4.2/utils/autorest.d.ts +2 -3
  413. package/types-legacy/ts4.2/utils/crypto.d.ts +8 -4
  414. package/types-legacy/ts4.2/utils/errors.d.ts +6 -0
  415. package/types-legacy/ts4.2/utils/hd-wallet.d.ts +2 -0
  416. package/types-legacy/ts4.2/utils/jwt.d.ts +53 -0
  417. package/types-legacy/ts4.2/utils/keystore.d.ts +6 -2
  418. package/types-legacy/ts4.2/utils/wrap-proxy.d.ts +2 -0
  419. package/types-legacy/ts4.5/AeSdk.d.ts +3 -0
  420. package/types-legacy/ts4.5/AeSdkAepp.d.ts +0 -1
  421. package/types-legacy/ts4.5/AeSdkBase.d.ts +61 -6
  422. package/types-legacy/ts4.5/AeSdkMethods.d.ts +19 -7
  423. package/types-legacy/ts4.5/Node.d.ts +14 -1
  424. package/types-legacy/ts4.5/account/Base.d.ts +39 -3
  425. package/types-legacy/ts4.5/account/Generalized.d.ts +2 -0
  426. package/types-legacy/ts4.5/account/Ledger.d.ts +2 -0
  427. package/types-legacy/ts4.5/account/Memory.d.ts +15 -4
  428. package/types-legacy/ts4.5/account/Rpc.d.ts +16 -5
  429. package/types-legacy/ts4.5/aens.d.ts +17 -44
  430. package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserRuntime.d.ts +3 -0
  431. package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +14 -0
  432. package/types-legacy/ts4.5/aepp-wallet-communication/schema.d.ts +2 -0
  433. package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +1 -0
  434. package/types-legacy/ts4.5/apis/middleware/middleware.d.ts +23 -5
  435. package/types-legacy/ts4.5/apis/middleware/models/index.d.ts +164 -15
  436. package/types-legacy/ts4.5/apis/middleware/models/mappers.d.ts +8 -1
  437. package/types-legacy/ts4.5/apis/middleware/models/parameters.d.ts +6 -3
  438. package/types-legacy/ts4.5/apis/node/models/index.d.ts +66 -2
  439. package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +5 -1
  440. package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +2 -2
  441. package/types-legacy/ts4.5/apis/node/node.d.ts +24 -3
  442. package/types-legacy/ts4.5/chain.d.ts +14 -44
  443. package/types-legacy/ts4.5/channel/Base.d.ts +3 -47
  444. package/types-legacy/ts4.5/channel/Contract.d.ts +16 -25
  445. package/types-legacy/ts4.5/channel/Spend.d.ts +0 -8
  446. package/types-legacy/ts4.5/channel/internal.d.ts +104 -5
  447. package/types-legacy/ts4.5/contract/Contract.d.ts +9 -1
  448. package/types-legacy/ts4.5/contract/compiler/Base.d.ts +14 -8
  449. package/types-legacy/ts4.5/contract/compiler/Cli.d.ts +5 -9
  450. package/types-legacy/ts4.5/contract/compiler/Cli8.d.ts +13 -0
  451. package/types-legacy/ts4.5/contract/compiler/Http.d.ts +3 -9
  452. package/types-legacy/ts4.5/contract/compiler/HttpNode.d.ts +2 -5
  453. package/types-legacy/ts4.5/contract/delegation-signature.d.ts +2 -1
  454. package/types-legacy/ts4.5/contract/ga.d.ts +1 -2
  455. package/types-legacy/ts4.5/deprecated.d.ts +38 -0
  456. package/types-legacy/ts4.5/index-browser.d.ts +10 -5
  457. package/types-legacy/ts4.5/index.d.ts +1 -0
  458. package/types-legacy/ts4.5/oracle.d.ts +6 -37
  459. package/types-legacy/ts4.5/send-transaction.d.ts +53 -0
  460. package/types-legacy/ts4.5/spend.d.ts +4 -3
  461. package/types-legacy/ts4.5/tx/builder/common.d.ts +32 -0
  462. package/types-legacy/ts4.5/tx/builder/constants.d.ts +4 -4
  463. package/types-legacy/ts4.5/tx/builder/delegation/index.d.ts +20 -0
  464. package/types-legacy/ts4.5/tx/builder/delegation/schema.d.ts +136 -0
  465. package/types-legacy/ts4.5/tx/builder/delegation/schema.generated.d.ts +141 -0
  466. package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +2 -2
  467. package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +19 -11
  468. package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +10 -2
  469. package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +31 -29
  470. package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +1 -1
  471. package/types-legacy/ts4.5/tx/builder/field-types/nonce.d.ts +1 -0
  472. package/types-legacy/ts4.5/tx/builder/field-types/pointers2.d.ts +26 -0
  473. package/types-legacy/ts4.5/tx/builder/field-types/query-fee.d.ts +19 -0
  474. package/types-legacy/ts4.5/tx/builder/field-types/ttl.d.ts +9 -1
  475. package/types-legacy/ts4.5/tx/builder/field-types/with-default.d.ts +7 -0
  476. package/types-legacy/ts4.5/tx/builder/field-types/with-formatting.d.ts +7 -0
  477. package/types-legacy/ts4.5/tx/builder/helpers.d.ts +2 -2
  478. package/types-legacy/ts4.5/tx/builder/index.d.ts +17 -10
  479. package/types-legacy/ts4.5/tx/builder/schema.d.ts +482 -257
  480. package/types-legacy/ts4.5/tx/builder/schema.generated.d.ts +39 -3
  481. package/types-legacy/ts4.5/tx/execution-cost.d.ts +6 -5
  482. package/types-legacy/ts4.5/utils/autorest.d.ts +2 -3
  483. package/types-legacy/ts4.5/utils/crypto.d.ts +8 -4
  484. package/types-legacy/ts4.5/utils/errors.d.ts +6 -0
  485. package/types-legacy/ts4.5/utils/hd-wallet.d.ts +2 -0
  486. package/types-legacy/ts4.5/utils/jwt.d.ts +53 -0
  487. package/types-legacy/ts4.5/utils/keystore.d.ts +6 -2
  488. package/types-legacy/ts4.5/utils/wrap-proxy.d.ts +2 -0
  489. package/es/tx/builder/field-types/deposit.d.ts +0 -15
  490. package/es/tx/builder/field-types/deposit.mjs +0 -18
  491. package/es/tx/builder/field-types/deposit.mjs.map +0 -1
  492. package/src/tx/builder/field-types/deposit.ts +0 -23
  493. package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +0 -15
  494. package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +0 -15
@@ -1,43 +1,40 @@
1
1
  import { AE_AMOUNT_FORMATS } from './utils/amount-formatter';
2
- import { ValidatorResult } from './tx/validator';
3
2
  import { AensName } from './tx/builder/constants';
4
- import { TransactionError } from './utils/errors';
5
3
  import Node, { TransformNodeType } from './Node';
6
4
  import { Account as AccountNode, ByteCode, ContractObject, DryRunResult, DryRunResults, Generation, KeyBlock, MicroBlockHeader, NameEntry, SignedTx } from './apis/node';
7
5
  import { Encoded, Encoding } from './utils/encoder';
8
- import AccountBase from './account/Base';
9
6
  /**
10
7
  * @category chain
8
+ * @param type - Type
9
+ * @param options - Options
11
10
  */
12
11
  export declare function _getPollInterval(type: 'block' | 'microblock', // TODO: rename to 'key-block' | 'micro-block'
13
- { _expectedMineRate, _microBlockCycle, _maxPollInterval }: {
12
+ { _expectedMineRate, _microBlockCycle }: {
14
13
  _expectedMineRate?: number;
15
14
  _microBlockCycle?: number;
16
- _maxPollInterval?: number;
17
15
  }): number;
18
- /**
19
- * @category exception
20
- */
21
- export declare class InvalidTxError extends TransactionError {
22
- validation: ValidatorResult[];
23
- transaction: Encoded.Transaction;
24
- constructor(message: string, validation: ValidatorResult[], transaction: Encoded.Transaction);
25
- }
26
16
  /**
27
17
  * Obtain current height of the chain
28
18
  * @category chain
19
+ * @param options - Options
20
+ * @param options.cached - Get height from the cache. The lag behind the actual height shouldn't
21
+ * be more than 1 block. Use if needed to reduce requests count, and approximate value can be used.
22
+ * For example, for timeout check in transaction status polling.
29
23
  * @returns Current chain height
30
24
  */
31
- export declare function getHeight({ onNode }: {
25
+ export declare function getHeight({ cached, ...options }: {
32
26
  onNode: Node;
33
- }): Promise<number>;
27
+ cached?: boolean;
28
+ } & Parameters<typeof _getPollInterval>[1]): Promise<number>;
34
29
  /**
35
- * Wait for a transaction to be mined
30
+ * Return transaction details if it is mined, fail otherwise.
31
+ * If the transaction has ttl specified then would wait till it leaves the mempool.
32
+ * Otherwise would fail if a specified amount of blocks were mined.
36
33
  * @category chain
37
34
  * @param th - The hash of transaction to poll
38
35
  * @param options - Options
39
36
  * @param options.interval - Interval (in ms) at which to poll the chain
40
- * @param options.blocks - Number of blocks mined after which to fail
37
+ * @param options.blocks - Number of blocks mined after which to fail if transaction ttl is not set
41
38
  * @param options.onNode - Node to use
42
39
  * @returns The transaction as it was mined
43
40
  */
@@ -72,33 +69,6 @@ export declare function waitForTxConfirm(txHash: Encoded.TxHash, { confirm, onNo
72
69
  confirm?: number;
73
70
  onNode: Node;
74
71
  } & Parameters<typeof awaitHeight>[1]): Promise<number>;
75
- /**
76
- * Signs and submits transaction for mining
77
- * @category chain
78
- * @param txUnsigned - Transaction to sign and submit
79
- * @param options - Options
80
- * @param options.onNode - Node to use
81
- * @param options.onAccount - Account to use
82
- * @param options.verify - Verify transaction before broadcast, throw error if not
83
- * @param options.waitMined - Ensure that transaction get into block
84
- * @param options.confirm - Number of micro blocks that should be mined after tx get included
85
- * @returns Transaction details
86
- */
87
- export declare function sendTransaction(txUnsigned: Encoded.Transaction, { onNode, onAccount, verify, waitMined, confirm, innerTx, ...options }: SendTransactionOptions): Promise<SendTransactionReturnType>;
88
- type SendTransactionOptionsType = {
89
- onNode: Node;
90
- onAccount: AccountBase;
91
- verify?: boolean;
92
- waitMined?: boolean;
93
- confirm?: boolean | number;
94
- } & Parameters<typeof poll>[1] & Omit<Parameters<typeof waitForTxConfirm>[1], 'confirm'> & Parameters<AccountBase['signTransaction']>[1];
95
- export interface SendTransactionOptions extends SendTransactionOptionsType {
96
- }
97
- interface SendTransactionReturnType extends Partial<TransformNodeType<SignedTx>> {
98
- hash: Encoded.TxHash;
99
- rawTx: Encoded.Transaction;
100
- confirmationHeight?: number;
101
- }
102
72
  /**
103
73
  * Get account by account public key
104
74
  * @category chain
@@ -27,6 +27,7 @@ import { TxUnpacked } from '../tx/builder/schema.generated';
27
27
  * ```
28
28
  */
29
29
  export default class Channel {
30
+ #private;
30
31
  _eventEmitter: EventEmitter;
31
32
  _pingTimeoutId: NodeJS.Timeout;
32
33
  _nextRpcMessageId: number;
@@ -42,55 +43,10 @@ export default class Channel {
42
43
  _state: Encoded.Transaction | '';
43
44
  _options: ChannelOptions;
44
45
  _channelId?: Encoded.Channel;
46
+ protected constructor();
47
+ _debug(...args: any[]): void;
45
48
  /**
46
49
  * @param options - Channel params
47
- * @param options.url - Channel url (for example: "ws://localhost:3001")
48
- * @param options.role - Participant role ("initiator" or "responder")
49
- * @param options.initiatorId - Initiator's public key
50
- * @param options.responderId - Responder's public key
51
- * @param options.pushAmount - Initial deposit in favour of the responder by the initiator
52
- * @param options.initiatorAmount - Amount of coins the initiator has committed to
53
- * the channel
54
- * @param options.responderAmount - Amount of coins the responder has committed to
55
- * the channel
56
- * @param options.channelReserve - The minimum amount both peers need to maintain
57
- * @param options.ttl - Minimum block height to include the channel_create_tx
58
- * @param options.host - Host of the responder's node
59
- * @param options.port - The port of the responders node
60
- * @param options.lockPeriod - Amount of blocks for disputing a solo close
61
- * @param options.minimumDepthStrategy - How to calculate minimum depth (default: txfee)
62
- * @param options.minimumDepth - The minimum amount of blocks to be mined
63
- * @param options.fee - The fee to be used for the channel open transaction
64
- * @param options.gasPrice - Used for the fee computation of the channel open transaction
65
- * @param options.existingChannelId - Existing channel id (required if reestablishing a
66
- * channel)
67
- * @param options.offchainTx - Offchain transaction (required if reestablishing
68
- * a channel)
69
- * @param options.timeoutIdle - The time waiting for a new event to be initiated
70
- * (default: 600000)
71
- * @param options.timeoutFundingCreate - The time waiting for the initiator to produce
72
- * the create channel transaction after the noise session had been established (default: 120000)
73
- * @param options.timeoutFundingSign - The time frame the other client has to sign an
74
- * off-chain update after our client had initiated and signed it. This applies only for double
75
- * signed on-chain intended updates: channel create transaction, deposit, withdrawal and etc.
76
- * (default: 120000)
77
- * @param options.timeoutFundingLock - The time frame the other client has to confirm an
78
- * on-chain transaction reaching maturity (passing minimum depth) after the local node has
79
- * detected this. This applies only for double signed on-chain intended updates: channel create
80
- * transaction, deposit, withdrawal and etc. (default: 360000)
81
- * @param options.timeoutSign - The time frame the client has to return a signed
82
- * off-chain update or to decline it. This applies for all off-chain updates (default: 500000)
83
- * @param options.timeoutAccept - The time frame the other client has to react to an
84
- * event. This applies for all off-chain updates that are not meant to land on-chain, as well as
85
- * some special cases: opening a noise connection, mutual closing acknowledgement and
86
- * reestablishing an existing channel (default: 120000)
87
- * @param options.timeoutInitialized - the time frame the responder has to accept an
88
- * incoming noise session. Applicable only for initiator (default: timeout_accept's value)
89
- * @param options.timeoutAwaitingOpen - The time frame the initiator has to start an
90
- * outgoing noise session to the responder's node. Applicable only for responder (default:
91
- * timeout_idle's value)
92
- * @param options.debug=false - Log websocket communication
93
- * @param options.sign - Function which verifies and signs transactions
94
50
  */
95
51
  static initialize(options: ChannelOptions): Promise<Channel>;
96
52
  static _initialize<T extends Channel>(channel: T, options: ChannelOptions): Promise<T>;
@@ -6,10 +6,24 @@ import { ContractCallReturnType } from '../apis/node';
6
6
  import { ContractCallObject } from '../contract/Contract';
7
7
  import ChannelSpend from './Spend';
8
8
  interface CallContractOptions {
9
+ /**
10
+ * Amount the caller of the contract commits to it
11
+ */
9
12
  amount?: number | BigNumber;
13
+ /**
14
+ * ABI encoded compiled AEVM call data for the code
15
+ */
10
16
  callData?: Encoded.ContractBytearray;
17
+ /**
18
+ * Version of the ABI
19
+ */
11
20
  abiVersion?: AbiVersion;
21
+ /**
22
+ * Address of the contract to call
23
+ */
12
24
  contract?: Encoded.ContractAddress;
25
+ }
26
+ interface CallContractResult extends CallContractOptions {
13
27
  returnValue?: any;
14
28
  gasUsed?: number | BigNumber;
15
29
  gasPrice?: number | BigNumber;
@@ -91,10 +105,6 @@ export default class ChannelContract extends ChannelSpend {
91
105
  * if a call with a similar computation amount is to be forced on-chain.
92
106
  *
93
107
  * @param options - Options
94
- * @param options.amount - Amount the caller of the contract commits to it
95
- * @param options.callData - ABI encoded compiled AEVM call data for the code
96
- * @param options.contract - Address of the contract to call
97
- * @param options.abiVersion - Version of the ABI
98
108
  * @param sign - Function which verifies and signs contract call transaction
99
109
  * @example
100
110
  * ```js
@@ -120,12 +130,6 @@ export default class ChannelContract extends ChannelSpend {
120
130
  * Trigger a force progress contract call
121
131
  * This call is going on-chain
122
132
  * @param options - Options
123
- * @param options.amount - Amount the caller of the contract commits to it
124
- * @param options.callData - ABI encoded compiled AEVM call data for the code
125
- * @param options.contract - Address of the contract to call
126
- * @param options.abiVersion - Version of the ABI
127
- * @param options.gasPrice=1000000000]
128
- * @param options.gasLimit=1000000]
129
133
  * @param sign - Function which verifies and signs contract force progress transaction
130
134
  * @param callbacks - Callbacks
131
135
  * @example
@@ -145,11 +149,7 @@ export default class ChannelContract extends ChannelSpend {
145
149
  * })
146
150
  * ```
147
151
  */
148
- forceProgress({ amount, callData, contract, abiVersion, gasLimit, gasPrice, }: {
149
- amount: number;
150
- callData: Encoded.ContractBytearray;
151
- contract: Encoded.ContractAddress;
152
- abiVersion: AbiVersion;
152
+ forceProgress({ amount, callData, contract, abiVersion, gasLimit, gasPrice, }: CallContractOptions & {
153
153
  gasLimit?: number;
154
154
  gasPrice?: number;
155
155
  }, sign: SignTx, { onOnChainTx }?: Pick<ChannelState, 'onOnChainTx'>): Promise<{
@@ -169,10 +169,6 @@ export default class ChannelContract extends ChannelSpend {
169
169
  * top of the blockchain as seen by the node.
170
170
  *
171
171
  * @param options - Options
172
- * @param options.amount - Amount the caller of the contract commits to it
173
- * @param options.callData - ABI encoded compiled AEVM call data for the code
174
- * @param options.contract - Address of the contract to call
175
- * @param options.abiVersion - Version of the ABI
176
172
  * @example
177
173
  * ```js
178
174
  * channel.callContractStatic({
@@ -186,12 +182,7 @@ export default class ChannelContract extends ChannelSpend {
186
182
  * })
187
183
  * ```
188
184
  */
189
- callContractStatic({ amount, callData, contract, abiVersion, }: {
190
- amount: number;
191
- callData: Encoded.ContractBytearray;
192
- contract: Encoded.ContractAddress;
193
- abiVersion: AbiVersion;
194
- }): Promise<CallContractOptions>;
185
+ callContractStatic({ amount, callData, contract, abiVersion, }: CallContractOptions): Promise<CallContractResult>;
195
186
  /**
196
187
  * Get contract call result
197
188
  *
@@ -121,10 +121,6 @@ export default class ChannelSpend extends Channel {
121
121
  * @param amount - Amount of coins to withdraw
122
122
  * @param sign - Function which verifies and signs withdraw transaction
123
123
  * @param callbacks - Callbacks
124
- * @param callbacks.onOnChainTx - Called when withdraw transaction has been posted
125
- * on chain
126
- * @param callbacks.onOwnWithdrawLocked
127
- * @param callbacks.onWithdrawLocked
128
124
  * @example
129
125
  * ```js
130
126
  * channel.withdraw(
@@ -174,10 +170,6 @@ export default class ChannelSpend extends Channel {
174
170
  * @param amount - Amount of coins to deposit
175
171
  * @param sign - Function which verifies and signs deposit transaction
176
172
  * @param callbacks - Callbacks
177
- * @param callbacks.onOnChainTx - Called when deposit transaction has been posted
178
- * on chain
179
- * @param callbacks.onOwnDepositLocked
180
- * @param callbacks.onDepositLocked
181
173
  * @example
182
174
  * ```js
183
175
  * channel.deposit(
@@ -29,41 +29,137 @@ interface SignOptions {
29
29
  }
30
30
  export type SignTxWithTag = (tag: string, tx: Encoded.Transaction, options?: SignOptions) => (Promise<Encoded.Transaction>);
31
31
  export type SignTx = (tx: Encoded.Transaction, options?: SignOptions) => (Promise<Encoded.Transaction | number | null>);
32
+ /**
33
+ * @see {@link https://github.com/aeternity/protocol/blob/6734de2e4c7cce7e5e626caa8305fb535785131d/node/api/channels_api_usage.md#channel-establishing-parameters}
34
+ */
32
35
  export interface ChannelOptions {
33
36
  existingFsmId?: Encoded.Bytearray;
37
+ /**
38
+ * Channel url (for example: "ws://localhost:3001")
39
+ */
34
40
  url: string;
35
41
  /**
36
- * @see {@link https://github.com/aeternity/protocol/blob/6734de2e4c7cce7e5e626caa8305fb535785131d/node/api/channels_api_usage.md#channel-establishing-parameters}
42
+ * Initiator's public key
37
43
  */
38
44
  initiatorId: Encoded.AccountAddress;
45
+ /**
46
+ * Responder's public key
47
+ */
39
48
  responderId: Encoded.AccountAddress;
49
+ /**
50
+ * Amount of blocks for disputing a solo close
51
+ */
40
52
  lockPeriod: number;
53
+ /**
54
+ * Initial deposit in favour of the responder by the initiator
55
+ */
41
56
  pushAmount: number;
42
- initiatorAmount: BigNumber;
43
- responderAmount: BigNumber;
57
+ /**
58
+ * Amount of coins the initiator has committed to the channel
59
+ */
60
+ initiatorAmount: BigNumber | number;
61
+ /**
62
+ * Amount of coins the responder has committed to the channel
63
+ */
64
+ responderAmount: BigNumber | number;
65
+ /**
66
+ * The minimum amount both peers need to maintain
67
+ */
44
68
  channelReserve?: BigNumber | number;
69
+ /**
70
+ * Minimum block height to include the channel_create_tx
71
+ */
45
72
  ttl?: number;
73
+ /**
74
+ * Host of the responder's node
75
+ */
46
76
  host: string;
77
+ /**
78
+ * The port of the responders node
79
+ */
47
80
  port: number;
81
+ /**
82
+ * Participant role
83
+ */
48
84
  role: 'initiator' | 'responder';
85
+ /**
86
+ * How to calculate minimum depth (default: txfee)
87
+ */
49
88
  minimumDepthStrategy?: 'txfee' | 'plain';
89
+ /**
90
+ * The minimum amount of blocks to be mined
91
+ */
50
92
  minimumDepth?: number;
93
+ /**
94
+ * The fee to be used for the channel open transaction
95
+ */
51
96
  fee?: BigNumber | number;
97
+ /**
98
+ * Used for the fee computation of the channel open transaction
99
+ */
52
100
  gasPrice?: BigNumber | number;
53
101
  signedTx?: string;
102
+ /**
103
+ * Existing channel id (required if reestablishing a channel)
104
+ */
54
105
  existingChannelId?: string;
106
+ /**
107
+ * Offchain transaction (required if reestablishing a channel)
108
+ */
55
109
  offChainTx?: string;
56
110
  reconnectTx?: string;
111
+ /**
112
+ * The time waiting for a new event to be initiated (default: 600000)
113
+ */
57
114
  timeoutIdle?: number;
115
+ /**
116
+ * The time waiting for the initiator to produce the create channel transaction after the noise
117
+ * session had been established (default: 120000)
118
+ */
58
119
  timeoutFundingCreate?: number;
120
+ /**
121
+ * The time frame the other client has to sign an off-chain update after our client had initiated
122
+ * and signed it. This applies only for double signed on-chain intended updates: channel create
123
+ * transaction, deposit, withdrawal and etc. (default: 120000)
124
+ */
59
125
  timeoutFundingSign?: number;
126
+ /**
127
+ * The time frame the other client has to confirm an on-chain transaction reaching maturity
128
+ * (passing minimum depth) after the local node has detected this. This applies only for double
129
+ * signed on-chain intended updates: channel create transaction, deposit, withdrawal and etc.
130
+ * (default: 360000)
131
+ */
60
132
  timeoutFundingLock?: number;
133
+ /**
134
+ * The time frame the client has to return a signed off-chain update or to decline it.
135
+ * This applies for all off-chain updates (default: 500000)
136
+ */
61
137
  timeoutSign?: number;
138
+ /**
139
+ * The time frame the other client has to react to an event. This applies for all off-chain
140
+ * updates that are not meant to land on-chain, as well as some special cases: opening a noise
141
+ * connection, mutual closing acknowledgement and reestablishing an existing channel
142
+ * (default: 120000)
143
+ */
62
144
  timeoutAccept?: number;
145
+ /**
146
+ * the time frame the responder has to accept an incoming noise session.
147
+ * Applicable only for initiator (default: timeout_accept's value)
148
+ */
63
149
  timeoutInitialized?: number;
150
+ /**
151
+ * The time frame the initiator has to start an outgoing noise session to the responder's node.
152
+ * Applicable only for responder (default: timeout_idle's value)
153
+ */
64
154
  timeoutAwaitingOpen?: number;
65
155
  statePassword?: string;
66
- debug: boolean;
156
+ /**
157
+ * Log websocket communication and state changes
158
+ */
159
+ debug?: boolean;
160
+ /**
161
+ * Function which verifies and signs transactions
162
+ */
67
163
  sign: SignTxWithTag;
68
164
  offchainTx?: string;
69
165
  }
@@ -76,6 +172,9 @@ export interface ChannelState {
76
172
  reject: (e: BaseError) => void;
77
173
  sign: SignTx;
78
174
  handler?: ChannelHandler;
175
+ /**
176
+ * Called when transaction has been posted on chain
177
+ */
79
178
  onOnChainTx?: (tx: Encoded.Transaction) => void;
80
179
  onOwnWithdrawLocked?: () => void;
81
180
  onWithdrawLocked?: () => void;
@@ -114,7 +213,7 @@ export declare function emit<E extends keyof ChannelEvents>(channel: Channel, ..
114
213
  ...Parameters<ChannelEvents[E]>
115
214
  ]): void;
116
215
  export type ChannelStatus = 'connecting' | 'connected' | 'accepted' | 'halfSigned' | 'signed' | 'open' | 'closing' | 'closed' | 'died' | 'disconnected';
117
- export declare function changeStatus(channel: Channel, newStatus: ChannelStatus): void;
216
+ export declare function changeStatus(channel: Channel, newStatus: ChannelStatus, debug?: unknown): void;
118
217
  export declare function changeState(channel: Channel, newState: Encoded.Transaction | ''): void;
119
218
  export declare function notify(channel: Channel, method: string, params?: object): void;
120
219
  export declare function enqueueAction(channel: Channel, guard: ChannelAction['guard'], action: () => {
@@ -11,7 +11,8 @@ import { Encoded } from '../utils/encoder';
11
11
  import { ContractCallObject as NodeContractCallObject, Event as NodeEvent } from '../apis/node';
12
12
  import CompilerBase, { Aci } from './compiler/Base';
13
13
  import Node, { TransformNodeType } from '../Node';
14
- import { txDryRun, sendTransaction, SendTransactionOptions } from '../chain';
14
+ import { txDryRun } from '../chain';
15
+ import { sendTransaction, SendTransactionOptions } from '../send-transaction';
15
16
  import AccountBase from '../account/Base';
16
17
  import { TxUnpacked } from '../tx/builder/schema.generated';
17
18
  interface Event extends NodeEvent {
@@ -137,12 +138,19 @@ declare class Contract<M extends ContractMethodsBase> {
137
138
  _name: string;
138
139
  _calldata: Calldata;
139
140
  $options: Omit<ConstructorParameters<typeof Contract>[0], 'aci'>;
141
+ /**
142
+ * @param options - Options
143
+ */
140
144
  constructor({ aci, ...otherOptions }: {
141
145
  onCompiler?: CompilerBase;
142
146
  onNode: Node;
143
147
  bytecode?: Encoded.ContractBytearray;
144
148
  aci: Aci;
145
149
  address?: Encoded.ContractAddress;
150
+ /**
151
+ * Supported only in Ceres
152
+ */
153
+ name?: AensName;
146
154
  sourceCodePath?: Parameters<CompilerBase['compile']>[0];
147
155
  sourceCode?: Parameters<CompilerBase['compileBySourceCode']>[0];
148
156
  fileSystem?: Parameters<CompilerBase['compileBySourceCode']>[1];
@@ -16,6 +16,18 @@ export type Aci = Array<{
16
16
  typedefs: any[];
17
17
  };
18
18
  }>;
19
+ export type CompileResult = Promise<{
20
+ bytecode: Encoded.ContractBytearray;
21
+ aci: Aci;
22
+ warnings: Array<{
23
+ message: string;
24
+ pos: {
25
+ file?: string;
26
+ line: number;
27
+ col: number;
28
+ };
29
+ }>;
30
+ }>;
19
31
  /**
20
32
  * A base class for all compiler implementations
21
33
  */
@@ -26,10 +38,7 @@ export default abstract class CompilerBase {
26
38
  * @param path - Path to contract source code
27
39
  * @returns ACI and bytecode
28
40
  */
29
- abstract compile(path: string): Promise<{
30
- bytecode: Encoded.ContractBytearray;
31
- aci: Aci;
32
- }>;
41
+ abstract compile(path: string): CompileResult;
33
42
  /**
34
43
  * Compile contract by contract's source code
35
44
  * @param sourceCode - Contract source code as string
@@ -43,10 +52,7 @@ export default abstract class CompilerBase {
43
52
  * ```
44
53
  * @returns ACI and bytecode
45
54
  */
46
- abstract compileBySourceCode(sourceCode: string, fileSystem?: Record<string, string>): Promise<{
47
- bytecode: Encoded.ContractBytearray;
48
- aci: Aci;
49
- }>;
55
+ abstract compileBySourceCode(sourceCode: string, fileSystem?: Record<string, string>): CompileResult;
50
56
  /**
51
57
  * Generate contract's ACI by contract's path
52
58
  * Available only in Node.js
@@ -1,8 +1,10 @@
1
- import CompilerBase, { Aci } from './Base';
1
+ import CompilerBase, { Aci, CompileResult } from './Base';
2
2
  import { Encoded } from '../../utils/encoder';
3
+ export declare const getPackagePath: () => string;
3
4
  /**
4
5
  * A wrapper around aesophia_cli, available only in Node.js.
5
6
  * Requires Erlang installed, assumes that `escript` is available in PATH.
7
+ * @category contract
6
8
  */
7
9
  export default class CompilerCli extends CompilerBase {
8
10
  #private;
@@ -14,14 +16,8 @@ export default class CompilerCli extends CompilerBase {
14
16
  constructor(compilerPath?: string, { ignoreVersion }?: {
15
17
  ignoreVersion?: boolean;
16
18
  });
17
- compile(path: string): Promise<{
18
- bytecode: Encoded.ContractBytearray;
19
- aci: Aci;
20
- }>;
21
- compileBySourceCode(sourceCode: string, fileSystem?: Record<string, string>): Promise<{
22
- bytecode: Encoded.ContractBytearray;
23
- aci: Aci;
24
- }>;
19
+ compile(path: string): CompileResult;
20
+ compileBySourceCode(sourceCode: string, fileSystem?: Record<string, string>): CompileResult;
25
21
  generateAci(path: string): Promise<Aci>;
26
22
  generateAciBySourceCode(sourceCode: string, fileSystem?: Record<string, string>): Promise<Aci>;
27
23
  validate(bytecode: Encoded.ContractBytearray, path: string): Promise<boolean>;
@@ -0,0 +1,13 @@
1
+ import CompilerCli from './Cli';
2
+ /**
3
+ * @category contract
4
+ */
5
+ export default class CompilerCli8 extends CompilerCli {
6
+ /**
7
+ * @param options - Options
8
+ * @param options.ignoreVersion - Don't ensure that the compiler is supported
9
+ */
10
+ constructor({ ignoreVersion }?: {
11
+ ignoreVersion?: boolean;
12
+ });
13
+ }
@@ -1,5 +1,5 @@
1
1
  import { Compiler as CompilerApi } from '../../apis/compiler';
2
- import CompilerBase, { Aci } from './Base';
2
+ import CompilerBase, { Aci, CompileResult } from './Base';
3
3
  import { Encoded } from '../../utils/encoder';
4
4
  /**
5
5
  * Contract Compiler over HTTP
@@ -18,14 +18,8 @@ export default class CompilerHttp extends CompilerBase {
18
18
  constructor(compilerUrl: string, { ignoreVersion }?: {
19
19
  ignoreVersion?: boolean;
20
20
  });
21
- compileBySourceCode(sourceCode: string, fileSystem?: Record<string, string>): Promise<{
22
- bytecode: Encoded.ContractBytearray;
23
- aci: Aci;
24
- }>;
25
- compile(path: string): Promise<{
26
- bytecode: Encoded.ContractBytearray;
27
- aci: Aci;
28
- }>;
21
+ compileBySourceCode(sourceCode: string, fileSystem?: Record<string, string>): CompileResult;
22
+ compile(path: string): CompileResult;
29
23
  generateAciBySourceCode(sourceCode: string, fileSystem?: Record<string, string>): Promise<Aci>;
30
24
  generateAci(path: string): Promise<Aci>;
31
25
  validateBySourceCode(bytecode: Encoded.ContractBytearray, sourceCode: string, fileSystem?: Record<string, string>): Promise<boolean>;
@@ -1,5 +1,5 @@
1
1
  import HttpBrowser from './Http';
2
- import { Aci } from './Base';
2
+ import { Aci, CompileResult } from './Base';
3
3
  import { Encoded } from '../../utils/encoder';
4
4
  /**
5
5
  * Contract Compiler over HTTP for Nodejs
@@ -9,10 +9,7 @@ import { Encoded } from '../../utils/encoder';
9
9
  * @example CompilerHttpNode('COMPILER_URL')
10
10
  */
11
11
  export default class CompilerHttpNode extends HttpBrowser {
12
- compile(path: string): Promise<{
13
- bytecode: Encoded.ContractBytearray;
14
- aci: Aci;
15
- }>;
12
+ compile(path: string): CompileResult;
16
13
  generateAci(path: string): Promise<Aci>;
17
14
  validate(bytecode: Encoded.ContractBytearray, path: string): Promise<boolean>;
18
15
  }
@@ -37,8 +37,9 @@ import Node from '../Node';
37
37
  * .createDelegationSignature(contractAddress, [oracleQueryId], { onAccount, omitAddress: true })
38
38
  * ```
39
39
  */
40
- export default function createDelegationSignature(contractAddress: Encoded.ContractAddress, ids: Array<Encoded.Any | AensName>, { onAccount, omitAddress, ...options }: {
40
+ export default function createDelegationSignature(contractAddress: Encoded.ContractAddress, ids: Array<Encoded.Any | AensName>, { onAccount, omitAddress, isOracle, ...options }: {
41
41
  omitAddress?: boolean;
42
42
  onAccount: AccountBase;
43
+ isOracle?: boolean;
43
44
  onNode: Node;
44
45
  }): Promise<Uint8Array>;
@@ -8,13 +8,12 @@ import { Encoded } from '../utils/encoder';
8
8
  import AccountBase from '../account/Base';
9
9
  import Contract from './Contract';
10
10
  import Node from '../Node';
11
- import { SendTransactionOptions } from '../chain';
11
+ import { SendTransactionOptions } from '../send-transaction';
12
12
  import CompilerBase from './compiler/Base';
13
13
  /**
14
14
  * Convert current account to GA
15
15
  * @category contract
16
16
  * @param authFnName - Authorization function name
17
- * @param sourceCode - Auth contract source code
18
17
  * @param args - init arguments
19
18
  * @param options - Options
20
19
  * @returns General Account Object
@@ -1,6 +1,7 @@
1
1
  import { AciValue } from './utils/typed-data';
2
2
  import { Encoded } from './utils/encoder';
3
3
  import { RpcError } from './aepp-wallet-communication/schema';
4
+ import { ORACLE_TTL_TYPES } from './tx/builder/schema';
4
5
  /**
5
6
  * @category exception
6
7
  * @deprecated this exception is not thrown anymore
@@ -22,3 +23,40 @@ export declare function encodeFateValue(value: unknown, aci: AciValue): Encoded.
22
23
  * @deprecated use ContractByteArrayEncoder:decodeWithType from \@aeternity/aepp-calldata
23
24
  */
24
25
  export declare function decodeFateValue(value: Encoded.ContractBytearray, aci: AciValue): any;
26
+ /**
27
+ * @deprecated inlined in buildTx or use `180000`
28
+ */
29
+ export declare const NAME_TTL = 180000;
30
+ /**
31
+ * @deprecated inlined in buildTx or use `36000`
32
+ */
33
+ export declare const NAME_MAX_TTL = 36000;
34
+ /**
35
+ * @deprecated inlined in buildTx or use `60 * 60`
36
+ */
37
+ export declare const NAME_MAX_CLIENT_TTL: number;
38
+ /**
39
+ * @deprecated inlined in buildTx or use `60 * 60`
40
+ */
41
+ export declare const CLIENT_TTL: number;
42
+ /**
43
+ * @deprecated inlined in buildTx or use `{ type: ORACLE_TTL_TYPES.delta, value: 500 }`
44
+ */
45
+ export declare const ORACLE_TTL: {
46
+ type: ORACLE_TTL_TYPES;
47
+ value: number;
48
+ };
49
+ /**
50
+ * @deprecated inlined in buildTx or use `{ type: ORACLE_TTL_TYPES.delta, value: 10 }`
51
+ */
52
+ export declare const QUERY_TTL: {
53
+ type: ORACLE_TTL_TYPES;
54
+ value: number;
55
+ };
56
+ /**
57
+ * @deprecated inlined in buildTx or use `{ type: ORACLE_TTL_TYPES.delta, value: 10 }`
58
+ */
59
+ export declare const RESPONSE_TTL: {
60
+ type: ORACLE_TTL_TYPES;
61
+ value: number;
62
+ };