@aeternity/aepp-sdk 13.0.0-alpha.1 → 13.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (388) hide show
  1. package/bin/aesophia_cli +0 -0
  2. package/dist/aepp-sdk.browser-script.js +1 -1
  3. package/dist/aepp-sdk.browser-script.js.map +1 -1
  4. package/dist/aepp-sdk.browser.js +1 -1
  5. package/dist/aepp-sdk.browser.js.map +1 -1
  6. package/dist/aepp-sdk.js +1792 -1525
  7. package/dist/aepp-sdk.js.map +1 -1
  8. package/es/AeSdk.mjs.map +1 -1
  9. package/es/AeSdkAepp.mjs.map +1 -1
  10. package/es/AeSdkBase.mjs.map +1 -1
  11. package/es/AeSdkMethods.d.ts +11 -12
  12. package/es/AeSdkMethods.mjs +6 -8
  13. package/es/AeSdkMethods.mjs.map +1 -1
  14. package/es/AeSdkWallet.mjs +1 -1
  15. package/es/AeSdkWallet.mjs.map +1 -1
  16. package/es/Node.d.ts +5 -1
  17. package/es/Node.mjs +11 -5
  18. package/es/Node.mjs.map +1 -1
  19. package/es/account/Base.d.ts +11 -6
  20. package/es/account/Base.mjs +0 -17
  21. package/es/account/Base.mjs.map +1 -1
  22. package/es/account/Generalized.mjs +11 -24
  23. package/es/account/Generalized.mjs.map +1 -1
  24. package/es/account/Ledger.mjs.map +1 -1
  25. package/es/account/LedgerFactory.mjs.map +1 -1
  26. package/es/account/Memory.d.ts +2 -1
  27. package/es/account/Memory.mjs +9 -21
  28. package/es/account/Memory.mjs.map +1 -1
  29. package/es/account/Rpc.mjs.map +1 -1
  30. package/es/aens.d.ts +12 -14
  31. package/es/aens.mjs +17 -31
  32. package/es/aens.mjs.map +1 -1
  33. package/es/aepp-wallet-communication/connection/Browser.mjs +0 -16
  34. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
  35. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +0 -16
  36. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
  37. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +0 -16
  38. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
  39. package/es/aepp-wallet-communication/connection-proxy.mjs +0 -17
  40. package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
  41. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +4 -5
  42. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
  43. package/es/aepp-wallet-communication/rpc/types.d.ts +6 -2
  44. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
  45. package/es/aepp-wallet-communication/schema.mjs.map +1 -1
  46. package/es/aepp-wallet-communication/wallet-detector.mjs +0 -16
  47. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
  48. package/es/apis/compiler/compiler.d.ts +1 -1
  49. package/es/apis/compiler/compiler.mjs +4 -20
  50. package/es/apis/compiler/compiler.mjs.map +1 -1
  51. package/es/apis/compiler/models/index.d.ts +3 -2
  52. package/es/apis/compiler/models/index.mjs.map +1 -1
  53. package/es/apis/compiler/models/mappers.d.ts +1 -1
  54. package/es/apis/compiler/models/mappers.mjs +19 -2
  55. package/es/apis/compiler/models/mappers.mjs.map +1 -1
  56. package/es/apis/node/models/index.d.ts +15 -15
  57. package/es/apis/node/models/index.mjs.map +1 -1
  58. package/es/apis/node/models/mappers.d.ts +1 -1
  59. package/es/apis/node/models/mappers.mjs +2 -1
  60. package/es/apis/node/models/mappers.mjs.map +1 -1
  61. package/es/apis/node/models/parameters.d.ts +2 -2
  62. package/es/apis/node/models/parameters.mjs +2 -2
  63. package/es/apis/node/models/parameters.mjs.map +1 -1
  64. package/es/apis/node/node.mjs +3 -19
  65. package/es/apis/node/node.mjs.map +1 -1
  66. package/es/chain.d.ts +8 -8
  67. package/es/chain.mjs +19 -22
  68. package/es/chain.mjs.map +1 -1
  69. package/es/channel/Base.d.ts +25 -12
  70. package/es/channel/Base.mjs +23 -26
  71. package/es/channel/Base.mjs.map +1 -1
  72. package/es/channel/Contract.mjs +8 -21
  73. package/es/channel/Contract.mjs.map +1 -1
  74. package/es/channel/Spend.d.ts +4 -2
  75. package/es/channel/Spend.mjs +0 -16
  76. package/es/channel/Spend.mjs.map +1 -1
  77. package/es/channel/handlers.mjs +6 -18
  78. package/es/channel/handlers.mjs.map +1 -1
  79. package/es/channel/internal.d.ts +19 -2
  80. package/es/channel/internal.mjs +19 -19
  81. package/es/channel/internal.mjs.map +1 -1
  82. package/es/contract/Contract.d.ts +30 -85
  83. package/es/contract/Contract.mjs +174 -211
  84. package/es/contract/Contract.mjs.map +1 -1
  85. package/es/contract/compiler/Base.d.ts +7 -14
  86. package/es/contract/compiler/Base.mjs.map +1 -1
  87. package/es/contract/compiler/Cli.mjs +5 -11
  88. package/es/contract/compiler/Cli.mjs.map +1 -1
  89. package/es/contract/compiler/Http.mjs +6 -30
  90. package/es/contract/compiler/Http.mjs.map +1 -1
  91. package/es/contract/compiler/HttpNode.mjs.map +1 -1
  92. package/es/contract/compiler/getFileSystem.mjs.map +1 -1
  93. package/es/contract/delegation-signature.d.ts +43 -0
  94. package/es/contract/delegation-signature.mjs +45 -0
  95. package/es/contract/delegation-signature.mjs.map +1 -0
  96. package/es/contract/ga.d.ts +23 -7
  97. package/es/contract/ga.mjs +52 -27
  98. package/es/contract/ga.mjs.map +1 -1
  99. package/es/index-browser.d.ts +4 -3
  100. package/es/index-browser.mjs +6 -20
  101. package/es/index-browser.mjs.map +1 -1
  102. package/es/oracle.d.ts +12 -17
  103. package/es/oracle.mjs +28 -48
  104. package/es/oracle.mjs.map +1 -1
  105. package/es/spend.d.ts +19 -27
  106. package/es/spend.mjs +20 -43
  107. package/es/spend.mjs.map +1 -1
  108. package/es/tx/builder/SchemaTypes.d.ts +37 -0
  109. package/es/tx/builder/SchemaTypes.mjs +2 -0
  110. package/es/tx/builder/SchemaTypes.mjs.map +1 -0
  111. package/es/tx/builder/constants.d.ts +4 -2
  112. package/es/tx/builder/constants.mjs +2 -0
  113. package/es/tx/builder/constants.mjs.map +1 -1
  114. package/es/tx/builder/field-types/abi-version.d.ts +11 -2
  115. package/es/tx/builder/field-types/abi-version.mjs +24 -4
  116. package/es/tx/builder/field-types/abi-version.mjs.map +1 -1
  117. package/es/tx/builder/field-types/address.mjs.map +1 -1
  118. package/es/tx/builder/field-types/array.d.ts +1 -1
  119. package/es/tx/builder/field-types/array.mjs.map +1 -1
  120. package/es/tx/builder/field-types/boolean.mjs.map +1 -1
  121. package/es/tx/builder/field-types/coin-amount.d.ts +3 -4
  122. package/es/tx/builder/field-types/coin-amount.mjs +4 -5
  123. package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
  124. package/es/tx/builder/field-types/ct-version.d.ts +22 -3
  125. package/es/tx/builder/field-types/ct-version.mjs +32 -4
  126. package/es/tx/builder/field-types/ct-version.mjs.map +1 -1
  127. package/es/tx/builder/field-types/deposit.d.ts +2 -1
  128. package/es/tx/builder/field-types/deposit.mjs +3 -2
  129. package/es/tx/builder/field-types/deposit.mjs.map +1 -1
  130. package/es/tx/builder/field-types/encoded.d.ts +1 -1
  131. package/es/tx/builder/field-types/encoded.mjs.map +1 -1
  132. package/es/tx/builder/field-types/entry.mjs +3 -0
  133. package/es/tx/builder/field-types/entry.mjs.map +1 -1
  134. package/es/tx/builder/field-types/enumeration.mjs.map +1 -1
  135. package/es/tx/builder/field-types/fee.d.ts +3 -1
  136. package/es/tx/builder/field-types/fee.mjs +5 -1
  137. package/es/tx/builder/field-types/fee.mjs.map +1 -1
  138. package/es/tx/builder/field-types/field.mjs.map +1 -1
  139. package/es/tx/builder/field-types/gas-limit.d.ts +3 -2
  140. package/es/tx/builder/field-types/gas-limit.mjs +4 -2
  141. package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
  142. package/es/tx/builder/field-types/gas-price.d.ts +3 -1
  143. package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
  144. package/es/tx/builder/field-types/index.d.ts +52 -13
  145. package/es/tx/builder/field-types/index.mjs +10 -2
  146. package/es/tx/builder/field-types/index.mjs.map +1 -1
  147. package/es/tx/builder/field-types/map.d.ts +13 -0
  148. package/es/tx/builder/field-types/map.mjs +49 -0
  149. package/es/tx/builder/field-types/map.mjs.map +1 -0
  150. package/es/tx/builder/field-types/mptree.d.ts +7 -2
  151. package/es/tx/builder/field-types/mptree.mjs +5 -7
  152. package/es/tx/builder/field-types/mptree.mjs.map +1 -1
  153. package/es/tx/builder/field-types/name-fee.d.ts +1 -1
  154. package/es/tx/builder/field-types/name-fee.mjs +2 -2
  155. package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
  156. package/es/tx/builder/field-types/name-id.mjs.map +1 -1
  157. package/es/tx/builder/field-types/name.mjs.map +1 -1
  158. package/es/tx/builder/field-types/nonce.d.ts +14 -0
  159. package/es/tx/builder/field-types/nonce.mjs +29 -0
  160. package/es/tx/builder/field-types/nonce.mjs.map +1 -0
  161. package/es/tx/builder/field-types/pointers.mjs.map +1 -1
  162. package/es/tx/builder/field-types/raw.mjs.map +1 -1
  163. package/es/tx/builder/field-types/short-u-int-const.d.ts +4 -2
  164. package/es/tx/builder/field-types/short-u-int-const.mjs +12 -8
  165. package/es/tx/builder/field-types/short-u-int-const.mjs.map +1 -1
  166. package/es/tx/builder/field-types/short-u-int.mjs.map +1 -1
  167. package/es/tx/builder/field-types/string.mjs.map +1 -1
  168. package/es/tx/builder/field-types/ttl.d.ts +11 -0
  169. package/es/tx/builder/field-types/ttl.mjs +21 -0
  170. package/es/tx/builder/field-types/ttl.mjs.map +1 -0
  171. package/es/tx/builder/field-types/u-int.mjs.map +1 -1
  172. package/es/tx/builder/field-types/wrapped.d.ts +14 -0
  173. package/es/tx/builder/field-types/wrapped.mjs +22 -0
  174. package/es/tx/builder/field-types/wrapped.mjs.map +1 -0
  175. package/es/tx/builder/helpers.mjs.map +1 -1
  176. package/es/tx/builder/index.d.ts +20 -20
  177. package/es/tx/builder/index.mjs +54 -64
  178. package/es/tx/builder/index.mjs.map +1 -1
  179. package/es/tx/builder/schema.d.ts +2735 -2865
  180. package/es/tx/builder/schema.generated.d.ts +2011 -0
  181. package/es/tx/builder/schema.generated.mjs +2 -0
  182. package/es/tx/builder/schema.generated.mjs.map +1 -0
  183. package/es/tx/builder/schema.mjs +459 -155
  184. package/es/tx/builder/schema.mjs.map +1 -1
  185. package/es/tx/execution-cost.d.ts +35 -0
  186. package/es/tx/execution-cost.mjs +123 -0
  187. package/es/tx/execution-cost.mjs.map +1 -0
  188. package/es/tx/transaction-signer.d.ts +6 -0
  189. package/es/tx/transaction-signer.mjs +27 -0
  190. package/es/tx/transaction-signer.mjs.map +1 -0
  191. package/es/tx/validator.mjs +60 -109
  192. package/es/tx/validator.mjs.map +1 -1
  193. package/es/utils/amount-formatter.mjs +0 -16
  194. package/es/utils/amount-formatter.mjs.map +1 -1
  195. package/es/utils/autorest.d.ts +3 -2
  196. package/es/utils/autorest.mjs +43 -11
  197. package/es/utils/autorest.mjs.map +1 -1
  198. package/es/utils/bytes.mjs +0 -16
  199. package/es/utils/bytes.mjs.map +1 -1
  200. package/es/utils/crypto.mjs +0 -16
  201. package/es/utils/crypto.mjs.map +1 -1
  202. package/es/utils/encoder.mjs.map +1 -1
  203. package/es/utils/errors.d.ts +14 -31
  204. package/es/utils/errors.mjs +2 -32
  205. package/es/utils/errors.mjs.map +1 -1
  206. package/es/utils/hd-wallet.mjs.map +1 -1
  207. package/es/utils/json-big.mjs.map +1 -1
  208. package/es/utils/keystore.mjs.map +1 -1
  209. package/es/utils/other.d.ts +1 -1
  210. package/es/utils/other.mjs.map +1 -1
  211. package/es/utils/semver-satisfies.mjs.map +1 -1
  212. package/es/utils/string.mjs +0 -17
  213. package/es/utils/string.mjs.map +1 -1
  214. package/package.json +34 -30
  215. package/src/AeSdkMethods.ts +11 -16
  216. package/src/AeSdkWallet.ts +1 -1
  217. package/src/Node.ts +17 -6
  218. package/src/account/Base.ts +11 -22
  219. package/src/account/Generalized.ts +8 -23
  220. package/src/account/Memory.ts +14 -21
  221. package/src/aens.ts +31 -47
  222. package/src/aepp-wallet-communication/connection/Browser.ts +0 -17
  223. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +0 -17
  224. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +0 -17
  225. package/src/aepp-wallet-communication/connection-proxy.ts +0 -17
  226. package/src/aepp-wallet-communication/rpc/types.ts +6 -2
  227. package/src/aepp-wallet-communication/wallet-detector.ts +0 -17
  228. package/src/apis/compiler/compiler.ts +3 -27
  229. package/src/apis/compiler/models/index.ts +3 -2
  230. package/src/apis/compiler/models/mappers.ts +15 -2
  231. package/src/apis/node/models/index.ts +16 -15
  232. package/src/apis/node/models/mappers.ts +2 -1
  233. package/src/apis/node/models/parameters.ts +2 -2
  234. package/src/apis/node/node.ts +3 -27
  235. package/src/chain.ts +28 -27
  236. package/src/channel/Base.ts +33 -33
  237. package/src/channel/Contract.ts +8 -23
  238. package/src/channel/Spend.ts +2 -17
  239. package/src/channel/handlers.ts +5 -18
  240. package/src/channel/internal.ts +40 -22
  241. package/src/contract/Contract.ts +133 -163
  242. package/src/contract/compiler/Base.ts +7 -14
  243. package/src/contract/compiler/Cli.ts +5 -11
  244. package/src/contract/compiler/Http.ts +6 -25
  245. package/src/contract/delegation-signature.ts +56 -0
  246. package/src/contract/ga.ts +53 -32
  247. package/src/index-browser.ts +12 -20
  248. package/src/oracle.ts +46 -56
  249. package/src/spend.ts +33 -67
  250. package/src/tx/builder/SchemaTypes.ts +79 -0
  251. package/src/tx/builder/constants.ts +2 -0
  252. package/src/tx/builder/field-types/abi-version.ts +29 -6
  253. package/src/tx/builder/field-types/array.ts +1 -1
  254. package/src/tx/builder/field-types/coin-amount.ts +6 -4
  255. package/src/tx/builder/field-types/ct-version.ts +37 -4
  256. package/src/tx/builder/field-types/deposit.ts +3 -1
  257. package/src/tx/builder/field-types/encoded.ts +1 -1
  258. package/src/tx/builder/field-types/entry.ts +8 -3
  259. package/src/tx/builder/field-types/fee.ts +6 -4
  260. package/src/tx/builder/field-types/gas-limit.ts +2 -2
  261. package/src/tx/builder/field-types/index.ts +15 -1
  262. package/src/tx/builder/field-types/map.ts +45 -0
  263. package/src/tx/builder/field-types/mptree.ts +4 -3
  264. package/src/tx/builder/field-types/name-fee.ts +2 -1
  265. package/src/tx/builder/field-types/nonce.ts +40 -0
  266. package/src/tx/builder/field-types/short-u-int-const.ts +18 -8
  267. package/src/tx/builder/field-types/ttl.ts +24 -0
  268. package/src/tx/builder/field-types/wrapped.ts +32 -0
  269. package/src/tx/builder/index.ts +57 -71
  270. package/src/tx/builder/schema.generated.ts +2013 -0
  271. package/src/tx/builder/schema.ts +544 -624
  272. package/src/tx/execution-cost.ts +146 -0
  273. package/src/tx/transaction-signer.ts +27 -0
  274. package/src/tx/validator.ts +60 -91
  275. package/src/utils/amount-formatter.ts +0 -16
  276. package/src/utils/autorest.ts +52 -11
  277. package/src/utils/bytes.ts +0 -16
  278. package/src/utils/crypto.ts +0 -16
  279. package/src/utils/errors.ts +15 -44
  280. package/src/utils/string.ts +0 -17
  281. package/types-legacy/ts4.2/AeSdkMethods.d.ts +11 -12
  282. package/types-legacy/ts4.2/Node.d.ts +5 -1
  283. package/types-legacy/ts4.2/account/Base.d.ts +11 -6
  284. package/types-legacy/ts4.2/account/Memory.d.ts +2 -1
  285. package/types-legacy/ts4.2/aens.d.ts +12 -14
  286. package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +6 -2
  287. package/types-legacy/ts4.2/apis/compiler/compiler.d.ts +1 -1
  288. package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +3 -2
  289. package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +1 -1
  290. package/types-legacy/ts4.2/apis/node/models/index.d.ts +15 -15
  291. package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +1 -1
  292. package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +2 -2
  293. package/types-legacy/ts4.2/chain.d.ts +8 -8
  294. package/types-legacy/ts4.2/channel/Base.d.ts +25 -12
  295. package/types-legacy/ts4.2/channel/Spend.d.ts +4 -2
  296. package/types-legacy/ts4.2/channel/internal.d.ts +22 -2
  297. package/types-legacy/ts4.2/contract/Contract.d.ts +29 -84
  298. package/types-legacy/ts4.2/contract/compiler/Base.d.ts +7 -14
  299. package/types-legacy/ts4.2/contract/delegation-signature.d.ts +43 -0
  300. package/types-legacy/ts4.2/contract/ga.d.ts +23 -7
  301. package/types-legacy/ts4.2/index-browser.d.ts +4 -3
  302. package/types-legacy/ts4.2/oracle.d.ts +12 -17
  303. package/types-legacy/ts4.2/spend.d.ts +19 -27
  304. package/types-legacy/ts4.2/tx/builder/SchemaTypes.d.ts +37 -0
  305. package/types-legacy/ts4.2/tx/builder/constants.d.ts +4 -2
  306. package/types-legacy/ts4.2/tx/builder/field-types/abi-version.d.ts +11 -2
  307. package/types-legacy/ts4.2/tx/builder/field-types/array.d.ts +1 -1
  308. package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +3 -4
  309. package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +33 -3
  310. package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +2 -1
  311. package/types-legacy/ts4.2/tx/builder/field-types/encoded.d.ts +1 -1
  312. package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +3 -1
  313. package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +3 -2
  314. package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +3 -1
  315. package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +52 -13
  316. package/types-legacy/ts4.2/tx/builder/field-types/map.d.ts +13 -0
  317. package/types-legacy/ts4.2/tx/builder/field-types/mptree.d.ts +7 -2
  318. package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +1 -1
  319. package/types-legacy/ts4.2/tx/builder/field-types/nonce.d.ts +14 -0
  320. package/types-legacy/ts4.2/tx/builder/field-types/short-u-int-const.d.ts +4 -2
  321. package/types-legacy/ts4.2/tx/builder/field-types/ttl.d.ts +11 -0
  322. package/types-legacy/ts4.2/tx/builder/field-types/wrapped.d.ts +14 -0
  323. package/types-legacy/ts4.2/tx/builder/index.d.ts +23 -20
  324. package/types-legacy/ts4.2/tx/builder/schema.d.ts +2962 -4629
  325. package/types-legacy/ts4.2/tx/builder/schema.generated.d.ts +2011 -0
  326. package/types-legacy/ts4.2/tx/execution-cost.d.ts +35 -0
  327. package/types-legacy/ts4.2/tx/transaction-signer.d.ts +6 -0
  328. package/types-legacy/ts4.2/utils/autorest.d.ts +3 -2
  329. package/types-legacy/ts4.2/utils/errors.d.ts +14 -31
  330. package/types-legacy/ts4.2/utils/other.d.ts +1 -1
  331. package/types-legacy/ts4.5/AeSdkMethods.d.ts +11 -12
  332. package/types-legacy/ts4.5/Node.d.ts +5 -1
  333. package/types-legacy/ts4.5/account/Base.d.ts +11 -6
  334. package/types-legacy/ts4.5/account/Memory.d.ts +2 -1
  335. package/types-legacy/ts4.5/aens.d.ts +12 -14
  336. package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +6 -2
  337. package/types-legacy/ts4.5/apis/compiler/compiler.d.ts +1 -1
  338. package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +3 -2
  339. package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +1 -1
  340. package/types-legacy/ts4.5/apis/node/models/index.d.ts +15 -15
  341. package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +1 -1
  342. package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +2 -2
  343. package/types-legacy/ts4.5/chain.d.ts +8 -8
  344. package/types-legacy/ts4.5/channel/Base.d.ts +25 -12
  345. package/types-legacy/ts4.5/channel/Spend.d.ts +4 -2
  346. package/types-legacy/ts4.5/channel/internal.d.ts +22 -2
  347. package/types-legacy/ts4.5/contract/Contract.d.ts +29 -84
  348. package/types-legacy/ts4.5/contract/compiler/Base.d.ts +7 -14
  349. package/types-legacy/ts4.5/contract/delegation-signature.d.ts +43 -0
  350. package/types-legacy/ts4.5/contract/ga.d.ts +23 -7
  351. package/types-legacy/ts4.5/index-browser.d.ts +4 -3
  352. package/types-legacy/ts4.5/oracle.d.ts +12 -17
  353. package/types-legacy/ts4.5/spend.d.ts +19 -27
  354. package/types-legacy/ts4.5/tx/builder/SchemaTypes.d.ts +37 -0
  355. package/types-legacy/ts4.5/tx/builder/constants.d.ts +4 -2
  356. package/types-legacy/ts4.5/tx/builder/field-types/abi-version.d.ts +11 -2
  357. package/types-legacy/ts4.5/tx/builder/field-types/array.d.ts +1 -1
  358. package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +3 -4
  359. package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +33 -3
  360. package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +2 -1
  361. package/types-legacy/ts4.5/tx/builder/field-types/encoded.d.ts +1 -1
  362. package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +3 -1
  363. package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +3 -2
  364. package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +3 -1
  365. package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +52 -13
  366. package/types-legacy/ts4.5/tx/builder/field-types/map.d.ts +13 -0
  367. package/types-legacy/ts4.5/tx/builder/field-types/mptree.d.ts +7 -2
  368. package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +1 -1
  369. package/types-legacy/ts4.5/tx/builder/field-types/nonce.d.ts +14 -0
  370. package/types-legacy/ts4.5/tx/builder/field-types/short-u-int-const.d.ts +4 -2
  371. package/types-legacy/ts4.5/tx/builder/field-types/ttl.d.ts +11 -0
  372. package/types-legacy/ts4.5/tx/builder/field-types/wrapped.d.ts +14 -0
  373. package/types-legacy/ts4.5/tx/builder/index.d.ts +23 -20
  374. package/types-legacy/ts4.5/tx/builder/schema.d.ts +2962 -4629
  375. package/types-legacy/ts4.5/tx/builder/schema.generated.d.ts +2011 -0
  376. package/types-legacy/ts4.5/tx/execution-cost.d.ts +35 -0
  377. package/types-legacy/ts4.5/tx/transaction-signer.d.ts +6 -0
  378. package/types-legacy/ts4.5/utils/autorest.d.ts +3 -2
  379. package/types-legacy/ts4.5/utils/errors.d.ts +14 -31
  380. package/types-legacy/ts4.5/utils/other.d.ts +1 -1
  381. package/es/tx/index.d.ts +0 -19
  382. package/es/tx/index.mjs +0 -115
  383. package/es/tx/index.mjs.map +0 -1
  384. package/src/apis/compiler/code-model-v4.yaml +0 -2442
  385. package/src/apis/node/code-model-v4.yaml +0 -10080
  386. package/src/tx/index.ts +0 -129
  387. package/types-legacy/ts4.2/tx/index.d.ts +0 -19
  388. package/types-legacy/ts4.5/tx/index.d.ts +0 -19
@@ -1 +1 @@
1
- {"version":3,"file":"other.mjs","names":["RestError","pause","duration","Promise","resolve","setTimeout","mapObject","object","fn","Object","fromEntries","entries","map","isWebpack4Buffer","concat","Uint8Array","from","error","concatBuffers","list","totalLength","el","isKeyOfObject","key","isItemOfArray","item","array","includes","isAccountNotFoundError","statusCode","message"],"sources":["../../src/utils/other.ts"],"sourcesContent":["import { RestError } from '@azure/core-rest-pipeline';\n\nexport const pause = async (duration: number): Promise<void> => new Promise((resolve) => {\n setTimeout(resolve, duration);\n});\n\nexport const mapObject = <InputV, OutputV>(\n object: { [k: string]: InputV },\n fn: (\n value: [string, InputV], index: number, array: Array<[string, InputV]>\n ) => [number | string, OutputV],\n): { [k: string]: OutputV } => Object.fromEntries(Object.entries(object).map(fn));\n\n// remove after dropping webpack4 support\nconst isWebpack4Buffer = (() => {\n try {\n Buffer.concat([Uint8Array.from([])]);\n return false;\n } catch (error) {\n return true;\n }\n})();\n\nexport const concatBuffers = isWebpack4Buffer\n ? (list: readonly Uint8Array[], totalLength?: number): Buffer => (\n Buffer.concat(list.map((el) => Buffer.from(el)), totalLength)\n )\n : Buffer.concat;\n\n/**\n * Object key type guard\n * @param key - Maybe object key\n * @param object - Object\n */\nexport function isKeyOfObject<T extends object>(\n key: string | number | symbol,\n object: T,\n): key is keyof T {\n return key in object;\n}\n\n/**\n * Array item type guard\n * @param item - Maybe array item\n * @param array - Array\n */\nexport function isItemOfArray<T>(item: any, array: readonly T[]): item is T {\n return array.includes(item);\n}\n\nexport function isAccountNotFoundError(error: Error): boolean {\n return error instanceof RestError && error.statusCode === 404\n && error.message.includes('Account not found');\n}\n\n// based on https://stackoverflow.com/a/50375286/6176994\nexport type UnionToIntersection<Union> =\n (Union extends any ? (k: Union) => void : never) extends ((k: infer Intersection) => void)\n ? Intersection : never;\n"],"mappings":";;;;AAAA,SAASA,SAAS,QAAQ,2BAA2B;AAErD,OAAO,MAAMC,KAAK,GAAG,MAAOC,QAAgB,IAAoB,IAAIC,OAAO,CAAEC,OAAO,IAAK;EACvFC,UAAU,CAACD,OAAO,EAAEF,QAAQ,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,MAAMI,SAAS,GAAG,CACvBC,MAA+B,EAC/BC,EAE+B,KACFC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACJ,MAAM,CAAC,CAACK,GAAG,CAACJ,EAAE,CAAC,CAAC;;AAEjF;AACA,MAAMK,gBAAgB,GAAG,CAAC,MAAM;EAC9B,IAAI;IACF,QAAOC,MAAM,CAAC,CAACC,UAAU,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,OAAO,KAAK;EACd,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,OAAO,IAAI;EACb;AACF,CAAC,GAAG;AAEJ,OAAO,MAAMC,aAAa,GAAGL,gBAAgB,GACzC,CAACM,IAA2B,EAAEC,WAAoB,KAClD,QAAON,MAAM,CAACK,IAAI,CAACP,GAAG,CAAES,EAAE,IAAK,QAAOL,IAAI,CAACK,EAAE,CAAC,CAAC,EAAED,WAAW,CAC7D,GACC,QAAON,MAAM;;AAEjB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASQ,aAAa,CAC3BC,GAA6B,EAC7BhB,MAAS,EACO;EAChB,OAAOgB,GAAG,IAAIhB,MAAM;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASiB,aAAa,CAAIC,IAAS,EAAEC,KAAmB,EAAa;EAC1E,OAAOA,KAAK,CAACC,QAAQ,CAACF,IAAI,CAAC;AAC7B;AAEA,OAAO,SAASG,sBAAsB,CAACX,KAAY,EAAW;EAC5D,OAAOA,KAAK,YAAYjB,SAAS,IAAIiB,KAAK,CAACY,UAAU,KAAK,GAAG,IACxDZ,KAAK,CAACa,OAAO,CAACH,QAAQ,CAAC,mBAAmB,CAAC;AAClD;;AAEA"}
1
+ {"version":3,"file":"other.mjs","names":["RestError","pause","duration","Promise","resolve","setTimeout","mapObject","object","fn","Object","fromEntries","entries","map","isWebpack4Buffer","_Buffer","concat","Uint8Array","from","error","concatBuffers","list","totalLength","el","isKeyOfObject","key","isItemOfArray","item","array","includes","isAccountNotFoundError","statusCode","message"],"sources":["../../src/utils/other.ts"],"sourcesContent":["import { RestError } from '@azure/core-rest-pipeline';\n\nexport const pause = async (duration: number): Promise<void> => new Promise((resolve) => {\n setTimeout(resolve, duration);\n});\n\nexport const mapObject = <InputV, OutputV>(\n object: { [k: string]: InputV },\n fn: (\n value: [string, InputV], index: number, array: Array<[string, InputV]>\n ) => [number | string, OutputV],\n): { [k: string]: OutputV } => Object.fromEntries(Object.entries(object).map(fn));\n\n// remove after dropping webpack4 support\nconst isWebpack4Buffer = (() => {\n try {\n Buffer.concat([Uint8Array.from([])]);\n return false;\n } catch (error) {\n return true;\n }\n})();\n\nexport const concatBuffers = isWebpack4Buffer\n ? (list: readonly Uint8Array[], totalLength?: number): Buffer => (\n Buffer.concat(list.map((el) => Buffer.from(el)), totalLength)\n )\n : Buffer.concat;\n\n/**\n * Object key type guard\n * @param key - Maybe object key\n * @param object - Object\n */\nexport function isKeyOfObject<T extends object>(\n key: string | number | symbol,\n object: T,\n): key is keyof T {\n return key in object;\n}\n\n/**\n * Array item type guard\n * @param item - Maybe array item\n * @param array - Array\n */\nexport function isItemOfArray<T>(item: any, array: readonly T[]): item is T {\n return array.includes(item);\n}\n\nexport function isAccountNotFoundError(error: Error): boolean {\n return error instanceof RestError && error.statusCode === 404\n && error.message.includes('Account not found');\n}\n\n// based on https://stackoverflow.com/a/50375286/6176994\nexport type UnionToIntersection<Union> =\n (Union extends any ? (k: Union) => void : never) extends ((k: infer Intersection) => void)\n ? Intersection : never;\n"],"mappings":";;;;AAAA,SAASA,SAAS,QAAQ,2BAA2B;AAErD,OAAO,MAAMC,KAAK,GAAG,MAAOC,QAAgB,IAAoB,IAAIC,OAAO,CAAEC,OAAO,IAAK;EACvFC,UAAU,CAACD,OAAO,EAAEF,QAAQ,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,MAAMI,SAAS,GAAGA,CACvBC,MAA+B,EAC/BC,EAE+B,KACFC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACJ,MAAM,CAAC,CAACK,GAAG,CAACJ,EAAE,CAAC,CAAC;;AAEjF;AACA,MAAMK,gBAAgB,GAAG,CAAC,MAAM;EAC9B,IAAI;IACFC,OAAA,CAAOC,MAAM,CAAC,CAACC,UAAU,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,OAAO,KAAK;EACd,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,OAAO,IAAI;EACb;AACF,CAAC,GAAG;AAEJ,OAAO,MAAMC,aAAa,GAAGN,gBAAgB,GACzC,CAACO,IAA2B,EAAEC,WAAoB,KAClDP,OAAA,CAAOC,MAAM,CAACK,IAAI,CAACR,GAAG,CAAEU,EAAE,IAAKR,OAAA,CAAOG,IAAI,CAACK,EAAE,CAAC,CAAC,EAAED,WAAW,CAC7D,GACCP,OAAA,CAAOC,MAAM;;AAEjB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASQ,aAAaA,CAC3BC,GAA6B,EAC7BjB,MAAS,EACO;EAChB,OAAOiB,GAAG,IAAIjB,MAAM;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASkB,aAAaA,CAAIC,IAAS,EAAEC,KAAmB,EAAa;EAC1E,OAAOA,KAAK,CAACC,QAAQ,CAACF,IAAI,CAAC;AAC7B;AAEA,OAAO,SAASG,sBAAsBA,CAACX,KAAY,EAAW;EAC5D,OAAOA,KAAK,YAAYlB,SAAS,IAAIkB,KAAK,CAACY,UAAU,KAAK,GAAG,IACxDZ,KAAK,CAACa,OAAO,CAACH,QAAQ,CAAC,mBAAmB,CAAC;AAClD;;AAEA"}
@@ -1 +1 @@
1
- {"version":3,"file":"semver-satisfies.mjs","names":["semverSatisfies","version","geVersion","ltVersion","getComponents","v","split","map","i","versionComponents","geComponents","ltComponents","base","Math","max","componentsToNumber","components","reverse","reduce","acc","n","idx","vNumber","geNumber","ltNumber"],"sources":["../../src/utils/semver-satisfies.ts"],"sourcesContent":["export default function semverSatisfies(\n version: string,\n geVersion: string,\n ltVersion: string,\n): boolean {\n const getComponents = (v: string): number[] => v\n .split(/[-+]/)[0].split('.').map((i) => +i);\n\n const versionComponents = getComponents(version);\n const geComponents = getComponents(geVersion);\n const ltComponents = getComponents(ltVersion);\n\n const base = Math.max(...versionComponents, ...geComponents, ...ltComponents) + 1;\n const componentsToNumber = (components: number[]): number => components.reverse()\n .reduce((acc, n, idx) => acc + n * base ** idx, 0);\n\n const vNumber = componentsToNumber(versionComponents);\n const geNumber = componentsToNumber(geComponents);\n const ltNumber = componentsToNumber(ltComponents);\n return vNumber >= geNumber && vNumber < ltNumber;\n}\n"],"mappings":"AAAA,eAAe,SAASA,eAAe,CACrCC,OAAe,EACfC,SAAiB,EACjBC,SAAiB,EACR;EACT,MAAMC,aAAa,GAAIC,CAAS,IAAeA,CAAC,CAC7CC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAACA,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAEC,CAAC,IAAK,CAACA,CAAC,CAAC;EAE7C,MAAMC,iBAAiB,GAAGL,aAAa,CAACH,OAAO,CAAC;EAChD,MAAMS,YAAY,GAAGN,aAAa,CAACF,SAAS,CAAC;EAC7C,MAAMS,YAAY,GAAGP,aAAa,CAACD,SAAS,CAAC;EAE7C,MAAMS,IAAI,GAAGC,IAAI,CAACC,GAAG,CAAC,GAAGL,iBAAiB,EAAE,GAAGC,YAAY,EAAE,GAAGC,YAAY,CAAC,GAAG,CAAC;EACjF,MAAMI,kBAAkB,GAAIC,UAAoB,IAAaA,UAAU,CAACC,OAAO,EAAE,CAC9EC,MAAM,CAAC,CAACC,GAAG,EAAEC,CAAC,EAAEC,GAAG,KAAKF,GAAG,GAAGC,CAAC,GAAGR,IAAI,IAAIS,GAAG,EAAE,CAAC,CAAC;EAEpD,MAAMC,OAAO,GAAGP,kBAAkB,CAACN,iBAAiB,CAAC;EACrD,MAAMc,QAAQ,GAAGR,kBAAkB,CAACL,YAAY,CAAC;EACjD,MAAMc,QAAQ,GAAGT,kBAAkB,CAACJ,YAAY,CAAC;EACjD,OAAOW,OAAO,IAAIC,QAAQ,IAAID,OAAO,GAAGE,QAAQ;AAClD"}
1
+ {"version":3,"file":"semver-satisfies.mjs","names":["semverSatisfies","version","geVersion","ltVersion","getComponents","v","split","map","i","versionComponents","geComponents","ltComponents","base","Math","max","componentsToNumber","components","reverse","reduce","acc","n","idx","vNumber","geNumber","ltNumber"],"sources":["../../src/utils/semver-satisfies.ts"],"sourcesContent":["export default function semverSatisfies(\n version: string,\n geVersion: string,\n ltVersion: string,\n): boolean {\n const getComponents = (v: string): number[] => v\n .split(/[-+]/)[0].split('.').map((i) => +i);\n\n const versionComponents = getComponents(version);\n const geComponents = getComponents(geVersion);\n const ltComponents = getComponents(ltVersion);\n\n const base = Math.max(...versionComponents, ...geComponents, ...ltComponents) + 1;\n const componentsToNumber = (components: number[]): number => components.reverse()\n .reduce((acc, n, idx) => acc + n * base ** idx, 0);\n\n const vNumber = componentsToNumber(versionComponents);\n const geNumber = componentsToNumber(geComponents);\n const ltNumber = componentsToNumber(ltComponents);\n return vNumber >= geNumber && vNumber < ltNumber;\n}\n"],"mappings":"AAAA,eAAe,SAASA,eAAeA,CACrCC,OAAe,EACfC,SAAiB,EACjBC,SAAiB,EACR;EACT,MAAMC,aAAa,GAAIC,CAAS,IAAeA,CAAC,CAC7CC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAACA,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAEC,CAAC,IAAK,CAACA,CAAC,CAAC;EAE7C,MAAMC,iBAAiB,GAAGL,aAAa,CAACH,OAAO,CAAC;EAChD,MAAMS,YAAY,GAAGN,aAAa,CAACF,SAAS,CAAC;EAC7C,MAAMS,YAAY,GAAGP,aAAa,CAACD,SAAS,CAAC;EAE7C,MAAMS,IAAI,GAAGC,IAAI,CAACC,GAAG,CAAC,GAAGL,iBAAiB,EAAE,GAAGC,YAAY,EAAE,GAAGC,YAAY,CAAC,GAAG,CAAC;EACjF,MAAMI,kBAAkB,GAAIC,UAAoB,IAAaA,UAAU,CAACC,OAAO,EAAE,CAC9EC,MAAM,CAAC,CAACC,GAAG,EAAEC,CAAC,EAAEC,GAAG,KAAKF,GAAG,GAAGC,CAAC,GAAGR,IAAI,IAAIS,GAAG,EAAE,CAAC,CAAC;EAEpD,MAAMC,OAAO,GAAGP,kBAAkB,CAACN,iBAAiB,CAAC;EACrD,MAAMc,QAAQ,GAAGR,kBAAkB,CAACL,YAAY,CAAC;EACjD,MAAMc,QAAQ,GAAGT,kBAAkB,CAACJ,YAAY,CAAC;EACjD,OAAOW,OAAO,IAAIC,QAAQ,IAAID,OAAO,GAAGE,QAAQ;AAClD"}
@@ -1,20 +1,3 @@
1
- /*
2
- * ISC License (ISC)
3
- * Copyright 2018 aeternity developers
4
- *
5
- * Permission to use, copy, modify, and/or distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
8
- *
9
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
- * PERFORMANCE OF THIS SOFTWARE.
16
- */
17
-
18
1
  /**
19
2
  * Convert string from snake_case to PascalCase
20
3
  * @param s - String to convert
@@ -1 +1 @@
1
- {"version":3,"file":"string.mjs","names":["snakeToPascal","s","replace","match","toUpperCase","pascalToSnake","toLowerCase"],"sources":["../../src/utils/string.ts"],"sourcesContent":["/*\n * ISC License (ISC)\n * Copyright 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Convert string from snake_case to PascalCase\n * @param s - String to convert\n * @returns Converted string\n */\nexport function snakeToPascal(s: string): string {\n return s.replace(/_./g, (match) => match[1].toUpperCase());\n}\n\n/**\n * Convert string from PascalCase to snake_case\n * @param s - String to convert\n * @returns Converted string\n */\nexport function pascalToSnake(s: string): string {\n return s.replace(/[A-Z]/g, (match) => `_${match.toLowerCase()}`);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAa,CAACC,CAAS,EAAU;EAC/C,OAAOA,CAAC,CAACC,OAAO,CAAC,KAAK,EAAGC,KAAK,IAAKA,KAAK,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAa,CAACJ,CAAS,EAAU;EAC/C,OAAOA,CAAC,CAACC,OAAO,CAAC,QAAQ,EAAGC,KAAK,IAAM,IAAGA,KAAK,CAACG,WAAW,EAAG,EAAC,CAAC;AAClE"}
1
+ {"version":3,"file":"string.mjs","names":["snakeToPascal","s","replace","match","toUpperCase","pascalToSnake","toLowerCase"],"sources":["../../src/utils/string.ts"],"sourcesContent":["/**\n * Convert string from snake_case to PascalCase\n * @param s - String to convert\n * @returns Converted string\n */\nexport function snakeToPascal(s: string): string {\n return s.replace(/_./g, (match) => match[1].toUpperCase());\n}\n\n/**\n * Convert string from PascalCase to snake_case\n * @param s - String to convert\n * @returns Converted string\n */\nexport function pascalToSnake(s: string): string {\n return s.replace(/[A-Z]/g, (match) => `_${match.toLowerCase()}`);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAaA,CAACC,CAAS,EAAU;EAC/C,OAAOA,CAAC,CAACC,OAAO,CAAC,KAAK,EAAGC,KAAK,IAAKA,KAAK,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACJ,CAAS,EAAU;EAC/C,OAAOA,CAAC,CAACC,OAAO,CAAC,QAAQ,EAAGC,KAAK,IAAM,IAAGA,KAAK,CAACG,WAAW,EAAG,EAAC,CAAC;AAClE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeternity/aepp-sdk",
3
- "version": "13.0.0-alpha.1",
3
+ "version": "13.0.0-beta.0",
4
4
  "description": "SDK for the æternity blockchain",
5
5
  "main": "dist/aepp-sdk.js",
6
6
  "types": "es/index.d.ts",
@@ -34,8 +34,9 @@
34
34
  "build:assets": "node tooling/fetch-aesophia-cli.mjs",
35
35
  "build:types": "tsc && node tooling/downlevel/run.mjs",
36
36
  "build:es": "babel src --config-file ./babel.esm.config.js --out-dir es --extensions .js,.ts --out-file-extension .mjs --source-maps true",
37
- "build:api": "node tooling/autorest/compiler-prepare.mjs && autorest tooling/autorest/compiler.yaml --output-artifact:code-model-v4 && autorest tooling/autorest/node.yaml --output-artifact:code-model-v4",
38
- "build": "npm run build:api && webpack && npm run build:types && npm run build:es && npm run build:assets",
37
+ "build:api": "node tooling/autorest/compiler-prepare.mjs && autorest tooling/autorest/compiler.yaml && autorest tooling/autorest/node.yaml",
38
+ "build:generate": "tooling/generate-schema.ts",
39
+ "build": "npm run build:api && npm run build:generate && webpack && npm run build:types && npm run build:es && npm run build:assets",
39
40
  "docs:examples": "node tooling/docs/examples-to-md.js examples/node/*.mjs",
40
41
  "docs:api": "typedoc",
41
42
  "commitlint": "commitlint --from develop",
@@ -48,7 +49,8 @@
48
49
  "prepare": "npm run build",
49
50
  "prepublishOnly": "test/examples.sh && npm run docs:examples && npm run docs:api",
50
51
  "release": "standard-version --skip.tag --infile docs/CHANGELOG.md",
51
- "release-alpha": "npm run release -- --prerelease alpha"
52
+ "release-alpha": "npm run release -- --prerelease alpha",
53
+ "release-beta": "npm run release -- --prerelease beta"
52
54
  },
53
55
  "license": "ISC",
54
56
  "keywords": [
@@ -58,18 +60,19 @@
58
60
  "SDK"
59
61
  ],
60
62
  "dependencies": {
61
- "@aeternity/aepp-calldata": "^1.3.0",
63
+ "@aeternity/aepp-calldata": "github:aeternity/aepp-calldata-js#3320455210221e59bff1198389ccfd5851598513",
62
64
  "@aeternity/argon2": "^0.0.1",
63
65
  "@aeternity/uuid": "^0.0.1",
64
66
  "@azure/core-client": "1.6.0",
65
- "@azure/core-rest-pipeline": "^1.10.0",
66
- "@babel/runtime-corejs3": "^7.20.7",
67
- "@ledgerhq/hw-transport": "^6.27.9",
67
+ "@azure/core-rest-pipeline": "^1.10.1",
68
+ "@babel/runtime-corejs3": "^7.21.0",
69
+ "@ledgerhq/hw-transport": "^6.28.1",
68
70
  "@types/aes-js": "^3.1.1",
69
71
  "@types/json-bigint": "^1.0.1",
72
+ "@types/node": "~18.11.9",
70
73
  "@types/sha.js": "^2.4.0",
71
- "@types/uuid": "^9.0.0",
72
- "@types/webextension-polyfill": "^0.9.2",
74
+ "@types/uuid": "^9.0.1",
75
+ "@types/webextension-polyfill": "^0.10.0",
73
76
  "@types/websocket": "^1.0.5",
74
77
  "aes-js": "^3.1.2",
75
78
  "bignumber.js": "^9.1.1",
@@ -92,36 +95,35 @@
92
95
  "url": "https://github.com/aeternity/aepp-sdk-js"
93
96
  },
94
97
  "devDependencies": {
95
- "@babel/cli": "^7.20.7",
96
- "@babel/core": "^7.20.7",
98
+ "@babel/cli": "^7.21.0",
99
+ "@babel/core": "^7.21.0",
97
100
  "@babel/node": "^7.20.7",
98
- "@babel/plugin-transform-runtime": "^7.19.6",
101
+ "@babel/plugin-transform-runtime": "^7.21.0",
99
102
  "@babel/preset-env": "^7.20.2",
100
- "@babel/preset-typescript": "^7.18.6",
101
- "@babel/register": "^7.18.9",
102
- "@commitlint/cli": "^17.3.0",
103
- "@commitlint/config-conventional": "^17.3.0",
104
- "@ledgerhq/hw-transport-mocker": "^6.27.9",
105
- "@ledgerhq/hw-transport-node-hid-singleton": "^6.28.6",
106
- "@ledgerhq/hw-transport-webusb": "^6.27.9",
103
+ "@babel/preset-typescript": "^7.21.0",
104
+ "@babel/register": "^7.21.0",
105
+ "@commitlint/cli": "^17.4.4",
106
+ "@commitlint/config-conventional": "^17.4.4",
107
+ "@ledgerhq/hw-transport-mocker": "^6.27.12",
108
+ "@ledgerhq/hw-transport-node-hid-singleton": "^6.28.9",
109
+ "@ledgerhq/hw-transport-webusb": "^6.27.12",
107
110
  "@types/chai": "^4.3.4",
108
111
  "@types/chai-as-promised": "^7.1.5",
109
112
  "@types/mocha": "^10.0.1",
110
113
  "@types/node-hid": "^1.3.1",
111
114
  "@types/sinon": "^10.0.13",
112
- "@typescript-eslint/eslint-plugin": "^5.47.1",
113
- "@typescript-eslint/parser": "^5.47.1",
114
- "autorest": "^3.6.2",
115
- "babel-loader": "^9.1.0",
115
+ "@typescript-eslint/eslint-plugin": "^5.54.0",
116
+ "@typescript-eslint/parser": "^5.54.0",
117
+ "autorest": "^3.6.3",
118
+ "babel-loader": "^9.1.2",
116
119
  "babel-plugin-add-import-extension": "^1.6.0",
117
120
  "babel-plugin-import-globals": "^2.0.0",
118
121
  "babel-plugin-transform-default-named-imports": "^1.2.2",
119
122
  "babel-plugin-transform-import-meta": "^2.2.0",
120
123
  "chai": "^4.3.7",
121
124
  "chai-as-promised": "^7.1.1",
122
- "cross-fetch": "^3.1.5",
123
125
  "downlevel-dts": "github:aeternity/downlevel-dts",
124
- "eslint": "^8.30.0",
126
+ "eslint": "^8.35.0",
125
127
  "eslint-config-airbnb-base": "^15.0.0",
126
128
  "eslint-config-airbnb-typescript": "^17.0.0",
127
129
  "eslint-plugin-rulesdir": "^0.2.2",
@@ -132,11 +134,12 @@
132
134
  "sinon": "^15.0.1",
133
135
  "source-map": "^0.7.4",
134
136
  "standard-version": "^9.5.0",
135
- "typedoc": "^0.23.23",
137
+ "ts-node": "^10.9.1",
138
+ "typedoc": "^0.23.26",
136
139
  "typedoc-plugin-missing-exports": "^1.0.0",
137
- "typescript": "^4.9.4",
140
+ "typescript": "^4.9.5",
138
141
  "webpack": "^5.75.0",
139
- "webpack-bundle-analyzer": "^4.7.0",
142
+ "webpack-bundle-analyzer": "^4.8.0",
140
143
  "webpack-cli": "^5.0.1"
141
144
  },
142
145
  "files": [
@@ -166,5 +169,6 @@
166
169
  },
167
170
  "engines": {
168
171
  "node": ">=14.19.0"
169
- }
172
+ },
173
+ "packageManager": "npm@8.19.3"
170
174
  }
@@ -3,15 +3,14 @@ import * as aensMethods from './aens';
3
3
  import * as spendMethods from './spend';
4
4
  import * as oracleMethods from './oracle';
5
5
  import Contract, { ContractMethodsBase } from './contract/Contract';
6
+ import createDelegationSignature from './contract/delegation-signature';
6
7
  import * as contractGaMethods from './contract/ga';
7
- import { _buildTx } from './tx';
8
+ import { buildTxAsync } from './tx/builder';
8
9
  import { mapObject, UnionToIntersection } from './utils/other';
9
10
  import Node from './Node';
10
- import { AE_AMOUNT_FORMATS } from './utils/amount-formatter';
11
- import { Tag } from './tx/builder/constants';
11
+ import { TxParamsAsync } from './tx/builder/schema.generated';
12
12
  import AccountBase from './account/Base';
13
13
  import { Encoded } from './utils/encoder';
14
- import CompilerBase from './contract/compiler/Base';
15
14
  import { ArgumentError, NotImplementedError, TypeError } from './utils/errors';
16
15
 
17
16
  export type OnAccount = Encoded.AccountAddress | AccountBase | undefined;
@@ -40,6 +39,7 @@ const methods = {
40
39
  ...aensMethods,
41
40
  ...spendMethods,
42
41
  ...oracleMethods,
42
+ createDelegationSignature,
43
43
  ...contractGaMethods,
44
44
  } as const;
45
45
 
@@ -70,7 +70,7 @@ interface AeSdkMethodsOptions
70
70
  * their context (current account, network, and compiler to use).
71
71
  */
72
72
  class AeSdkMethods {
73
- _options: AeSdkMethodsOptions = { denomination: AE_AMOUNT_FORMATS.AETTOS };
73
+ _options: AeSdkMethodsOptions = {};
74
74
 
75
75
  /**
76
76
  * @param options - Options
@@ -100,15 +100,8 @@ class AeSdkMethods {
100
100
  };
101
101
  }
102
102
 
103
- async buildTx<TxType extends Tag>(
104
- txType: TxType,
105
- options: Omit<Parameters<typeof _buildTx<TxType>>[1], 'onNode'> & { onNode?: Node },
106
- ): Promise<Encoded.Transaction> {
107
- // @ts-expect-error TODO: need to figure out what's wrong here
108
- return _buildTx<TxType>(txType, {
109
- ...this._getOptions(),
110
- ...options,
111
- });
103
+ async buildTx(options: TxParamsAsync): Promise<Encoded.Transaction> {
104
+ return buildTxAsync({ ...this._getOptions(), ...options });
112
105
  }
113
106
 
114
107
  async initializeContract<Methods extends ContractMethodsBase>(
@@ -133,9 +126,11 @@ type RequiredKeys<T> = {
133
126
 
134
127
  type OptionalIfNotRequired<T extends [any]> = RequiredKeys<T[0]> extends never ? T | [] : T;
135
128
 
129
+ type ReplaceOnAccount<Options> = Options extends { onAccount: any }
130
+ ? Omit<Options, 'onAccount'> & { onAccount: OnAccount } : Options;
131
+
136
132
  type MakeOptional<Options> = OptionalIfNotRequired<[
137
- Omit<Options, 'onNode' | 'onCompiler' | 'onAccount'>
138
- & { onNode?: Node; onCompiler?: CompilerBase; onAccount?: OnAccount },
133
+ Omit<Options, 'onNode' | 'onCompiler' | 'onAccount'> & Partial<ReplaceOnAccount<Options>>,
139
134
  ]>;
140
135
 
141
136
  type TransformMethods <Methods extends { [key: string]: Function }> =
@@ -254,7 +254,7 @@ export default class AeSdkWallet extends AeSdk {
254
254
  }
255
255
  try {
256
256
  return jsonBig.parse(jsonBig.stringify({
257
- transactionHash: await this.send(tx, { ...parameters, verify: false }),
257
+ transactionHash: await this.sendTransaction(tx, { ...parameters, verify: false }),
258
258
  }));
259
259
  } catch (error) {
260
260
  const validation = await verifyTransaction(tx, this.api);
package/src/Node.ts CHANGED
@@ -3,7 +3,7 @@ import BigNumber from 'bignumber.js';
3
3
  import { OperationArguments, OperationSpec } from '@azure/core-client';
4
4
  import {
5
5
  genRequestQueuesPolicy, genCombineGetRequestsPolicy, genErrorFormatterPolicy,
6
- genVersionCheckPolicy,
6
+ genVersionCheckPolicy, genRetryOnFailurePolicy,
7
7
  } from './utils/autorest';
8
8
  import { Node as NodeApi, NodeOptionalParams, ErrorModel } from './apis/node';
9
9
  import { mapObject } from './utils/other';
@@ -111,16 +111,24 @@ export interface NodeInfo {
111
111
  }
112
112
 
113
113
  export default class Node extends (NodeTransformed as unknown as NodeTransformedApi) {
114
- #networkIdPromise?: Promise<string>;
114
+ #networkIdPromise?: Promise<string | Error>;
115
115
 
116
116
  /**
117
117
  * @param url - Url for node API
118
118
  * @param options - Options
119
119
  * @param options.ignoreVersion - Don't check node version
120
+ * @param options.retryCount - Amount of extra requests to do in case of failure
121
+ * @param options.retryOverallDelay - Time in ms to wait between all retries
120
122
  */
121
123
  constructor(
122
124
  url: string,
123
- { ignoreVersion = false, ...options }: NodeOptionalParams & { ignoreVersion?: boolean } = {},
125
+ {
126
+ ignoreVersion = false, retryCount = 3, retryOverallDelay = 800, ...options
127
+ }: NodeOptionalParams & {
128
+ ignoreVersion?: boolean;
129
+ retryCount?: number;
130
+ retryOverallDelay?: number;
131
+ } = {},
124
132
  ) {
125
133
  // eslint-disable-next-line constructor-super
126
134
  super(url, {
@@ -128,14 +136,15 @@ export default class Node extends (NodeTransformed as unknown as NodeTransformed
128
136
  additionalPolicies: [
129
137
  genRequestQueuesPolicy(),
130
138
  genCombineGetRequestsPolicy(),
139
+ genRetryOnFailurePolicy(retryCount, retryOverallDelay),
131
140
  genErrorFormatterPolicy((body: ErrorModel) => ` ${body.reason}`),
132
141
  ],
133
142
  ...options,
134
143
  });
135
144
  if (!ignoreVersion) {
136
145
  const statusPromise = this.getStatus();
137
- const versionPromise = statusPromise.then(({ nodeVersion }) => nodeVersion);
138
- this.#networkIdPromise = statusPromise.then(({ networkId }) => networkId);
146
+ const versionPromise = statusPromise.then(({ nodeVersion }) => nodeVersion, (error) => error);
147
+ this.#networkIdPromise = statusPromise.then(({ networkId }) => networkId, (error) => error);
139
148
  this.pipeline.addPolicy(
140
149
  genVersionCheckPolicy('node', '/v3/status', versionPromise, '6.2.0', '7.0.0'),
141
150
  );
@@ -145,7 +154,9 @@ export default class Node extends (NodeTransformed as unknown as NodeTransformed
145
154
 
146
155
  async getNetworkId(): Promise<string> {
147
156
  this.#networkIdPromise ??= this.getStatus().then(({ networkId }) => networkId);
148
- return this.#networkIdPromise;
157
+ const networkId = await this.#networkIdPromise;
158
+ if (networkId instanceof Error) throw networkId;
159
+ return networkId;
149
160
  }
150
161
 
151
162
  async getNodeInfo(): Promise<NodeInfo> {
@@ -1,22 +1,16 @@
1
- /*
2
- * ISC License (ISC)
3
- * Copyright (c) 2022 aeternity developers
4
- *
5
- * Permission to use, copy, modify, and/or distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
8
- *
9
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
- * PERFORMANCE OF THIS SOFTWARE.
16
- */
17
1
  import { Encoded } from '../utils/encoder';
18
2
  import Node from '../Node';
19
3
  import CompilerBase from '../contract/compiler/Base';
4
+ import { Int } from '../tx/builder/constants';
5
+
6
+ interface AuthData {
7
+ fee?: Int;
8
+ gasLimit?: number;
9
+ gasPrice?: Int;
10
+ callData?: Encoded.ContractBytearray;
11
+ sourceCode?: string;
12
+ args?: any[];
13
+ }
20
14
 
21
15
  /**
22
16
  * Account is one of the three basic building blocks of an
@@ -36,12 +30,7 @@ export default abstract class AccountBase {
36
30
  options: {
37
31
  innerTx?: boolean;
38
32
  networkId?: string;
39
- authData?: {
40
- gasLimit?: number;
41
- callData?: Encoded.ContractBytearray;
42
- sourceCode?: string;
43
- args?: any[];
44
- };
33
+ authData?: AuthData | ((tx: Encoded.Transaction) => Promise<AuthData>);
45
34
  onNode?: Node;
46
35
  onCompiler?: CompilerBase;
47
36
  aeppOrigin?: string;
@@ -1,19 +1,3 @@
1
- /*
2
- * ISC License (ISC)
3
- * Copyright (c) 2022 aeternity developers
4
- *
5
- * Permission to use, copy, modify, and/or distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
8
- *
9
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
- * PERFORMANCE OF THIS SOFTWARE.
16
- */
17
1
  import AccountBase from './Base';
18
2
  import {
19
3
  ArgumentError,
@@ -24,9 +8,8 @@ import {
24
8
  import { decode, Encoded } from '../utils/encoder';
25
9
  import { getAccount } from '../chain';
26
10
  import Contract from '../contract/Contract';
27
- import { _buildTx } from '../tx';
11
+ import { buildTxAsync, buildTx } from '../tx/builder';
28
12
  import { Tag } from '../tx/builder/constants';
29
- import { buildTx } from '../tx/builder';
30
13
 
31
14
  /**
32
15
  * Generalized account class
@@ -63,8 +46,8 @@ export default class AccountGeneralized extends AccountBase {
63
46
  throw new ArgumentError('authData, onCompiler, onNode', 'provided', null);
64
47
  }
65
48
  const {
66
- callData, sourceCode, args, gasLimit,
67
- } = authData;
49
+ callData, sourceCode, args, fee, gasLimit, gasPrice,
50
+ } = typeof authData === 'function' ? await authData(tx) : authData;
68
51
 
69
52
  const authCallData = callData ?? await (async () => {
70
53
  if (this.#authFun == null) {
@@ -85,12 +68,14 @@ export default class AccountGeneralized extends AccountBase {
85
68
  return contract._calldata.encode(contract._name, this.#authFun, args);
86
69
  })();
87
70
 
88
- const gaMetaTx = await _buildTx(Tag.GaMetaTx, {
89
- tx: decode(buildTx({ tag: Tag.SignedTx, encodedTx: decode(tx), signatures: [] })),
71
+ const gaMetaTx = await buildTxAsync({
72
+ tag: Tag.GaMetaTx,
73
+ tx: { tag: Tag.SignedTx, encodedTx: decode(tx), signatures: [] },
90
74
  gaId: this.address,
91
75
  authData: authCallData,
76
+ fee,
92
77
  gasLimit,
93
- nonce: 0,
78
+ gasPrice,
94
79
  onNode,
95
80
  });
96
81
  return buildTx({ tag: Tag.SignedTx, encodedTx: decode(gaMetaTx), signatures: [] });
@@ -1,19 +1,3 @@
1
- /*
2
- * ISC License (ISC)
3
- * Copyright (c) 2022 aeternity developers
4
- *
5
- * Permission to use, copy, modify, and/or distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
8
- *
9
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
- * PERFORMANCE OF THIS SOFTWARE.
16
- */
17
1
  import AccountBase from './Base';
18
2
  import {
19
3
  generateKeyPairFromSecret, sign, generateKeyPair, hash, messageToHash,
@@ -28,6 +12,17 @@ import { Tag } from '../tx/builder/constants';
28
12
 
29
13
  const secretKeys = new WeakMap();
30
14
 
15
+ export function getBufferToSign(
16
+ transaction: Encoded.Transaction,
17
+ networkId: string,
18
+ innerTx: boolean,
19
+ ): Uint8Array {
20
+ const prefixes = [networkId];
21
+ if (innerTx) prefixes.push('inner_tx');
22
+ const rlpBinaryTx = decode(transaction);
23
+ return concatBuffers([Buffer.from(prefixes.join('-')), hash(rlpBinaryTx)]);
24
+ }
25
+
31
26
  /**
32
27
  * In-memory account class
33
28
  */
@@ -63,16 +58,14 @@ export default class AccountMemory extends AccountBase {
63
58
  }
64
59
 
65
60
  override async signTransaction(
66
- tx: Encoded.Transaction,
61
+ transaction: Encoded.Transaction,
67
62
  { innerTx, networkId, ...options }: { innerTx?: boolean; networkId?: string } = {},
68
63
  ): Promise<Encoded.Transaction> {
69
64
  if (networkId == null) {
70
65
  throw new ArgumentError('networkId', 'provided', networkId);
71
66
  }
72
- const prefixes = [networkId];
73
- if (innerTx === true) prefixes.push('inner_tx');
74
- const rlpBinaryTx = decode(tx);
75
- const txWithNetworkId = concatBuffers([Buffer.from(prefixes.join('-')), hash(rlpBinaryTx)]);
67
+ const rlpBinaryTx = decode(transaction);
68
+ const txWithNetworkId = getBufferToSign(transaction, networkId, innerTx === true);
76
69
 
77
70
  const signatures = [await this.sign(txWithNetworkId, options)];
78
71
  return buildTx({ tag: Tag.SignedTx, encodedTx: rlpBinaryTx, signatures });