@aeternity/aepp-sdk 11.0.0 → 12.1.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 (442) hide show
  1. package/LICENSE +1 -1
  2. package/dist/aepp-sdk.browser-script.js +1 -1
  3. package/dist/aepp-sdk.browser-script.js.LICENSE.txt +0 -22
  4. package/dist/aepp-sdk.browser-script.js.map +1 -1
  5. package/dist/aepp-sdk.browser.js +2 -1
  6. package/dist/aepp-sdk.browser.js.LICENSE.txt +1 -0
  7. package/dist/aepp-sdk.browser.js.map +1 -1
  8. package/dist/aepp-sdk.js +20764 -1
  9. package/dist/aepp-sdk.js.map +1 -1
  10. package/es/AeSdk.d.ts +37 -0
  11. package/es/AeSdk.mjs +81 -0
  12. package/es/AeSdk.mjs.map +1 -0
  13. package/es/AeSdkAepp.d.ts +70 -0
  14. package/es/AeSdkAepp.mjs +176 -0
  15. package/es/AeSdkAepp.mjs.map +1 -0
  16. package/es/AeSdkBase.d.ts +213 -0
  17. package/es/AeSdkBase.mjs +314 -0
  18. package/es/AeSdkBase.mjs.map +1 -0
  19. package/es/AeSdkWallet.d.ts +104 -0
  20. package/es/AeSdkWallet.mjs +326 -0
  21. package/es/AeSdkWallet.mjs.map +1 -0
  22. package/es/Node.d.ts +41 -0
  23. package/es/Node.mjs +147 -0
  24. package/es/Node.mjs.map +1 -0
  25. package/es/account/Base.d.ts +68 -0
  26. package/es/account/Base.mjs +123 -0
  27. package/es/account/Base.mjs.map +1 -0
  28. package/es/account/Memory.d.ts +26 -0
  29. package/es/account/Memory.mjs +103 -0
  30. package/es/account/Memory.mjs.map +1 -0
  31. package/es/account/Rpc.d.ts +27 -0
  32. package/es/account/Rpc.mjs +80 -0
  33. package/es/account/Rpc.mjs.map +1 -0
  34. package/es/aens.d.ts +222 -0
  35. package/es/aens.mjs +338 -0
  36. package/es/aens.mjs.map +1 -0
  37. package/es/aepp-wallet-communication/connection/Browser.d.ts +33 -0
  38. package/es/aepp-wallet-communication/connection/Browser.mjs +73 -0
  39. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -0
  40. package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +18 -0
  41. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +58 -0
  42. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -0
  43. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +36 -0
  44. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +146 -0
  45. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -0
  46. package/es/aepp-wallet-communication/connection-proxy.d.ts +11 -0
  47. package/{src/utils/crypto-ts.ts → es/aepp-wallet-communication/connection-proxy.mjs} +16 -11
  48. package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -0
  49. package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +34 -0
  50. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +169 -0
  51. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -0
  52. package/es/aepp-wallet-communication/rpc/types.d.ts +77 -0
  53. package/es/aepp-wallet-communication/rpc/types.mjs +3 -0
  54. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -0
  55. package/es/aepp-wallet-communication/schema.d.ts +105 -46
  56. package/es/aepp-wallet-communication/schema.mjs +251 -0
  57. package/es/aepp-wallet-communication/schema.mjs.map +1 -0
  58. package/es/aepp-wallet-communication/wallet-detector.d.ts +25 -0
  59. package/es/aepp-wallet-communication/wallet-detector.mjs +62 -0
  60. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -0
  61. package/es/apis/compiler/compiler.d.ts +92 -0
  62. package/es/apis/compiler/compiler.mjs +576 -0
  63. package/es/apis/compiler/compiler.mjs.map +1 -0
  64. package/es/apis/compiler/index.d.ts +2 -0
  65. package/es/apis/compiler/index.mjs +3 -0
  66. package/es/apis/compiler/index.mjs.map +1 -0
  67. package/es/apis/compiler/models/index.d.ts +248 -0
  68. package/es/apis/compiler/models/index.mjs +48 -0
  69. package/es/apis/compiler/models/index.mjs.map +1 -0
  70. package/es/apis/compiler/models/mappers.d.ts +23 -0
  71. package/es/apis/compiler/models/mappers.mjs +585 -0
  72. package/es/apis/compiler/models/mappers.mjs.map +1 -0
  73. package/es/apis/compiler/models/parameters.d.ts +13 -0
  74. package/es/apis/compiler/models/parameters.mjs +71 -0
  75. package/es/apis/compiler/models/parameters.mjs.map +1 -0
  76. package/es/apis/node/index.d.ts +2 -0
  77. package/es/apis/node/index.mjs +3 -0
  78. package/es/apis/node/index.mjs.map +1 -0
  79. package/es/apis/node/models/index.d.ts +1065 -0
  80. package/es/apis/node/models/index.mjs +2 -0
  81. package/es/apis/node/models/index.mjs.map +1 -0
  82. package/es/apis/node/models/mappers.d.ts +95 -0
  83. package/es/apis/node/models/mappers.mjs +4166 -0
  84. package/es/apis/node/models/mappers.mjs.map +1 -0
  85. package/es/apis/node/models/parameters.d.ts +17 -0
  86. package/es/apis/node/models/parameters.mjs +165 -0
  87. package/es/apis/node/models/parameters.mjs.map +1 -0
  88. package/es/apis/node/node.d.ts +215 -0
  89. package/es/apis/node/node.mjs +1165 -0
  90. package/es/apis/node/node.mjs.map +1 -0
  91. package/es/chain.d.ts +248 -0
  92. package/es/chain.mjs +560 -0
  93. package/es/chain.mjs.map +1 -0
  94. package/es/channel/handlers.d.ts +34 -0
  95. package/es/channel/handlers.mjs +164 -131
  96. package/es/channel/handlers.mjs.map +1 -1
  97. package/es/channel/index.d.ts +625 -0
  98. package/es/channel/index.mjs +897 -902
  99. package/es/channel/index.mjs.map +1 -1
  100. package/es/channel/internal.d.ts +101 -0
  101. package/es/channel/internal.mjs +138 -88
  102. package/es/channel/internal.mjs.map +1 -1
  103. package/es/contract/Compiler.d.ts +18 -0
  104. package/es/contract/Compiler.mjs +68 -0
  105. package/es/contract/Compiler.mjs.map +1 -0
  106. package/es/contract/aci.d.ts +127 -0
  107. package/es/contract/aci.mjs +225 -193
  108. package/es/contract/aci.mjs.map +1 -1
  109. package/es/contract/ga.d.ts +69 -0
  110. package/es/contract/ga.mjs +195 -0
  111. package/es/contract/ga.mjs.map +1 -0
  112. package/es/contract/methods.d.ts +71 -0
  113. package/es/contract/methods.mjs +104 -0
  114. package/es/contract/methods.mjs.map +1 -0
  115. package/es/deprecated/index.d.ts +143 -0
  116. package/es/deprecated/index.mjs +162 -0
  117. package/es/deprecated/index.mjs.map +1 -0
  118. package/es/deprecated/methods.d.ts +18 -0
  119. package/es/deprecated/methods.mjs +26 -0
  120. package/es/deprecated/methods.mjs.map +1 -0
  121. package/es/index.d.ts +35 -0
  122. package/es/index.mjs +35 -40
  123. package/es/index.mjs.map +1 -1
  124. package/es/oracle.d.ts +161 -0
  125. package/es/oracle.mjs +306 -0
  126. package/es/oracle.mjs.map +1 -0
  127. package/es/spend.d.ts +62 -0
  128. package/es/spend.mjs +111 -0
  129. package/es/spend.mjs.map +1 -0
  130. package/es/tx/builder/address.d.ts +25 -0
  131. package/es/tx/builder/address.mjs +45 -0
  132. package/es/tx/builder/address.mjs.map +1 -0
  133. package/es/tx/builder/constants.d.ts +70 -0
  134. package/es/tx/builder/constants.mjs +122 -0
  135. package/es/tx/builder/constants.mjs.map +1 -0
  136. package/es/tx/builder/field-types/coin-amount.d.ts +13 -0
  137. package/es/tx/builder/field-types/coin-amount.mjs +26 -0
  138. package/es/tx/builder/field-types/coin-amount.mjs.map +1 -0
  139. package/es/tx/builder/field-types/deposit.d.ts +15 -0
  140. package/es/tx/builder/field-types/deposit.mjs +19 -0
  141. package/es/tx/builder/field-types/deposit.mjs.map +1 -0
  142. package/es/tx/builder/field-types/fee.d.ts +25 -0
  143. package/es/tx/builder/field-types/fee.mjs +150 -0
  144. package/es/tx/builder/field-types/fee.mjs.map +1 -0
  145. package/es/tx/builder/field-types/field.d.ts +6 -0
  146. package/es/tx/builder/field-types/field.mjs +15 -0
  147. package/es/tx/builder/field-types/field.mjs.map +1 -0
  148. package/es/tx/builder/field-types/gas-limit.d.ts +12 -0
  149. package/es/tx/builder/field-types/gas-limit.mjs +33 -0
  150. package/es/tx/builder/field-types/gas-limit.mjs.map +1 -0
  151. package/es/tx/builder/field-types/gas-price.d.ts +8 -0
  152. package/es/tx/builder/field-types/gas-price.mjs +18 -0
  153. package/es/tx/builder/field-types/gas-price.mjs.map +1 -0
  154. package/es/tx/builder/field-types/index.d.ts +70 -0
  155. package/es/tx/builder/field-types/index.mjs +25 -0
  156. package/es/tx/builder/field-types/index.mjs.map +1 -0
  157. package/es/tx/builder/field-types/name-fee.d.ts +20 -0
  158. package/es/tx/builder/field-types/name-fee.mjs +24 -0
  159. package/es/tx/builder/field-types/name-fee.mjs.map +1 -0
  160. package/es/tx/builder/field-types/name-id.d.ts +14 -0
  161. package/es/tx/builder/field-types/name-id.mjs +19 -0
  162. package/es/tx/builder/field-types/name-id.mjs.map +1 -0
  163. package/es/tx/builder/field-types/name.d.ts +13 -0
  164. package/es/tx/builder/field-types/name.mjs +18 -0
  165. package/es/tx/builder/field-types/name.mjs.map +1 -0
  166. package/es/tx/builder/field-types/short-u-int.d.ts +6 -0
  167. package/es/tx/builder/field-types/short-u-int.mjs +12 -0
  168. package/es/tx/builder/field-types/short-u-int.mjs.map +1 -0
  169. package/es/tx/builder/field-types/u-int.d.ts +8 -0
  170. package/es/tx/builder/field-types/u-int.mjs +14 -0
  171. package/es/tx/builder/field-types/u-int.mjs.map +1 -0
  172. package/es/tx/builder/helpers.d.ts +125 -0
  173. package/es/tx/builder/helpers.mjs +94 -240
  174. package/es/tx/builder/helpers.mjs.map +1 -1
  175. package/es/tx/builder/index.d.ts +88 -0
  176. package/es/tx/builder/index.mjs +167 -358
  177. package/es/tx/builder/index.mjs.map +1 -1
  178. package/es/tx/builder/schema.d.ts +1201 -0
  179. package/es/tx/builder/schema.mjs +175 -664
  180. package/es/tx/builder/schema.mjs.map +1 -1
  181. package/es/tx/index.d.ts +64 -0
  182. package/es/tx/index.mjs +151 -265
  183. package/es/tx/index.mjs.map +1 -1
  184. package/es/tx/validator.d.ts +20 -0
  185. package/es/tx/validator.mjs +104 -124
  186. package/es/tx/validator.mjs.map +1 -1
  187. package/es/typings/@aeternity__argon2-browser/index.d.mjs +2 -0
  188. package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +1 -0
  189. package/es/typings/@aeternity__uuid/index.d.mjs +2 -0
  190. package/es/typings/@aeternity__uuid/index.d.mjs.map +1 -0
  191. package/es/typings/bip32-path/index.d.mjs +2 -0
  192. package/es/typings/bip32-path/index.d.mjs.map +1 -0
  193. package/es/typings/blakejs/index.d.mjs.map +1 -1
  194. package/es/typings/sha-js/index.d.mjs +2 -0
  195. package/es/typings/sha-js/index.d.mjs.map +1 -0
  196. package/es/typings/tweetnacl-auth/index.d.mjs +2 -0
  197. package/es/typings/tweetnacl-auth/index.d.mjs.map +1 -0
  198. package/es/utils/amount-formatter.d.ts +42 -0
  199. package/es/utils/amount-formatter.mjs +36 -49
  200. package/es/utils/amount-formatter.mjs.map +1 -1
  201. package/es/utils/autorest.d.ts +6 -0
  202. package/es/utils/autorest.mjs +97 -0
  203. package/es/utils/autorest.mjs.map +1 -0
  204. package/es/utils/bignumber.d.ts +13 -0
  205. package/es/utils/bignumber.mjs +11 -8
  206. package/es/utils/bignumber.mjs.map +1 -1
  207. package/es/{bytes.d.ts → utils/bytes.d.ts} +10 -13
  208. package/es/utils/bytes.mjs +11 -15
  209. package/es/utils/bytes.mjs.map +1 -1
  210. package/es/utils/crypto.d.ts +88 -0
  211. package/es/utils/crypto.mjs +64 -108
  212. package/es/utils/crypto.mjs.map +1 -1
  213. package/es/utils/encoder-types.d.ts +61 -0
  214. package/es/utils/encoder-types.mjs +36 -0
  215. package/es/utils/encoder-types.mjs.map +1 -0
  216. package/es/utils/encoder.d.ts +25 -0
  217. package/es/utils/encoder.mjs +118 -0
  218. package/es/utils/encoder.mjs.map +1 -0
  219. package/es/{errors.d.ts → utils/errors.d.ts} +246 -59
  220. package/es/utils/errors.mjs +313 -136
  221. package/es/utils/errors.mjs.map +1 -1
  222. package/es/utils/hd-wallet.d.ts +50 -0
  223. package/es/utils/hd-wallet.mjs +86 -45
  224. package/es/utils/hd-wallet.mjs.map +1 -1
  225. package/es/utils/json-big.d.ts +5 -0
  226. package/es/utils/json-big.mjs +12 -16
  227. package/es/utils/json-big.mjs.map +1 -1
  228. package/es/utils/keystore.d.ts +51 -0
  229. package/es/utils/keystore.mjs +101 -194
  230. package/es/utils/keystore.mjs.map +1 -1
  231. package/es/{mptree.d.ts → utils/mptree.d.ts} +6 -9
  232. package/es/utils/mptree.mjs +22 -18
  233. package/es/utils/mptree.mjs.map +1 -1
  234. package/es/utils/other.d.ts +20 -0
  235. package/es/utils/other.mjs +32 -35
  236. package/es/utils/other.mjs.map +1 -1
  237. package/es/utils/semver-satisfies.d.ts +1 -0
  238. package/es/utils/semver-satisfies.mjs +2 -2
  239. package/es/utils/semver-satisfies.mjs.map +1 -1
  240. package/es/utils/string.d.ts +24 -0
  241. package/es/utils/string.mjs +8 -10
  242. package/es/utils/string.mjs.map +1 -1
  243. package/package.json +56 -42
  244. package/src/AeSdk.ts +68 -0
  245. package/src/AeSdkAepp.ts +176 -0
  246. package/src/AeSdkBase.ts +338 -0
  247. package/src/AeSdkWallet.ts +348 -0
  248. package/src/Node.ts +173 -0
  249. package/src/account/Base.ts +124 -0
  250. package/src/account/Memory.ts +98 -0
  251. package/src/account/Rpc.ts +69 -0
  252. package/src/aens.ts +407 -0
  253. package/src/aepp-wallet-communication/connection/Browser.ts +71 -0
  254. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +59 -0
  255. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +122 -0
  256. package/{es/utils/crypto-ts.mjs → src/aepp-wallet-communication/connection-proxy.ts} +18 -18
  257. package/src/aepp-wallet-communication/rpc/RpcClient.ts +143 -0
  258. package/src/aepp-wallet-communication/rpc/types.ts +66 -0
  259. package/src/aepp-wallet-communication/schema.ts +224 -0
  260. package/src/aepp-wallet-communication/wallet-detector.ts +72 -0
  261. package/src/apis/compiler/code-model-v4.yaml +2649 -0
  262. package/src/apis/compiler/compiler.ts +585 -0
  263. package/src/apis/compiler/index.ts +2 -0
  264. package/src/apis/compiler/models/index.ts +301 -0
  265. package/src/apis/compiler/models/mappers.ts +583 -0
  266. package/src/apis/compiler/models/parameters.ts +93 -0
  267. package/src/apis/node/code-model-v4.yaml +10080 -0
  268. package/src/apis/node/index.ts +2 -0
  269. package/src/apis/node/models/index.ts +1257 -0
  270. package/src/apis/node/models/mappers.ts +4280 -0
  271. package/src/apis/node/models/parameters.ts +188 -0
  272. package/src/apis/node/node.ts +1299 -0
  273. package/src/chain.ts +502 -0
  274. package/src/channel/handlers.ts +817 -0
  275. package/src/channel/index.ts +1025 -0
  276. package/src/channel/internal.ts +361 -0
  277. package/src/contract/Compiler.ts +67 -0
  278. package/src/contract/aci.ts +538 -0
  279. package/src/contract/ga.ts +199 -0
  280. package/src/contract/methods.ts +123 -0
  281. package/src/deprecated/index.ts +170 -0
  282. package/src/deprecated/methods.ts +25 -0
  283. package/src/index.ts +56 -0
  284. package/src/oracle.ts +364 -0
  285. package/src/spend.ts +164 -0
  286. package/src/tx/builder/address.ts +50 -0
  287. package/src/tx/builder/constants.ts +126 -0
  288. package/src/tx/builder/field-types/coin-amount.ts +27 -0
  289. package/src/tx/builder/field-types/deposit.ts +21 -0
  290. package/src/tx/builder/field-types/fee.ts +143 -0
  291. package/src/tx/builder/field-types/field.ts +9 -0
  292. package/src/tx/builder/field-types/gas-limit.ts +41 -0
  293. package/src/tx/builder/field-types/gas-price.ts +16 -0
  294. package/src/tx/builder/field-types/index.ts +45 -0
  295. package/src/tx/builder/field-types/name-fee.ts +32 -0
  296. package/src/tx/builder/field-types/name-id.ts +20 -0
  297. package/src/tx/builder/field-types/name.ts +18 -0
  298. package/src/tx/builder/field-types/short-u-int.ts +11 -0
  299. package/src/tx/builder/field-types/u-int.ts +16 -0
  300. package/src/tx/builder/helpers.ts +248 -0
  301. package/src/tx/builder/index.ts +400 -0
  302. package/src/tx/builder/schema.ts +727 -0
  303. package/src/tx/index.ts +192 -0
  304. package/src/tx/validator.ts +230 -0
  305. package/src/typings/@aeternity__argon2-browser/index.d.ts +3 -0
  306. package/src/typings/@aeternity__uuid/index.d.ts +5 -0
  307. package/src/typings/bip32-path/index.d.ts +33 -0
  308. package/src/typings/blakejs/index.d.ts +4 -32
  309. package/src/typings/sha-js/index.d.ts +5 -0
  310. package/src/typings/tweetnacl-auth/index.d.ts +14 -0
  311. package/src/utils/amount-formatter.ts +56 -69
  312. package/src/utils/autorest.ts +93 -0
  313. package/src/utils/bignumber.ts +11 -12
  314. package/src/utils/bytes.ts +29 -31
  315. package/src/utils/crypto.ts +205 -0
  316. package/src/utils/encoder-types.ts +63 -0
  317. package/src/utils/encoder.ts +146 -0
  318. package/src/utils/errors.ts +482 -366
  319. package/src/utils/hd-wallet.ts +166 -0
  320. package/src/utils/json-big.ts +27 -0
  321. package/src/utils/keystore.ts +182 -0
  322. package/src/utils/mptree.ts +64 -61
  323. package/src/utils/other.ts +34 -41
  324. package/src/utils/semver-satisfies.ts +15 -11
  325. package/src/utils/string.ts +18 -20
  326. package/es/account/base.mjs +0 -179
  327. package/es/account/base.mjs.map +0 -1
  328. package/es/account/memory.mjs +0 -99
  329. package/es/account/memory.mjs.map +0 -1
  330. package/es/account/multiple.mjs +0 -179
  331. package/es/account/multiple.mjs.map +0 -1
  332. package/es/ae/aens.mjs +0 -404
  333. package/es/ae/aens.mjs.map +0 -1
  334. package/es/ae/aepp.mjs +0 -45
  335. package/es/ae/aepp.mjs.map +0 -1
  336. package/es/ae/contract.mjs +0 -159
  337. package/es/ae/contract.mjs.map +0 -1
  338. package/es/ae/index.mjs +0 -207
  339. package/es/ae/index.mjs.map +0 -1
  340. package/es/ae/oracle.mjs +0 -339
  341. package/es/ae/oracle.mjs.map +0 -1
  342. package/es/ae/universal.mjs +0 -45
  343. package/es/ae/universal.mjs.map +0 -1
  344. package/es/ae/wallet.mjs +0 -50
  345. package/es/ae/wallet.mjs.map +0 -1
  346. package/es/amount-formatter.d.ts +0 -58
  347. package/es/bignumber.d.ts +0 -18
  348. package/es/chain/index.mjs +0 -272
  349. package/es/chain/index.mjs.map +0 -1
  350. package/es/chain/node.mjs +0 -442
  351. package/es/chain/node.mjs.map +0 -1
  352. package/es/contract/compiler.mjs +0 -115
  353. package/es/contract/compiler.mjs.map +0 -1
  354. package/es/contract/ga/helpers.mjs +0 -30
  355. package/es/contract/ga/helpers.mjs.map +0 -1
  356. package/es/contract/ga/index.mjs +0 -178
  357. package/es/contract/ga/index.mjs.map +0 -1
  358. package/es/crypto-ts.d.ts +0 -9
  359. package/es/node-pool/index.mjs +0 -188
  360. package/es/node-pool/index.mjs.map +0 -1
  361. package/es/node.mjs +0 -133
  362. package/es/node.mjs.map +0 -1
  363. package/es/other.d.ts +0 -31
  364. package/es/semver-satisfies.d.ts +0 -1
  365. package/es/string.d.ts +0 -26
  366. package/es/tx/builder/field-types.mjs +0 -74
  367. package/es/tx/builder/field-types.mjs.map +0 -1
  368. package/es/tx/tx-object.mjs +0 -283
  369. package/es/tx/tx-object.mjs.map +0 -1
  370. package/es/tx/tx.mjs +0 -938
  371. package/es/tx/tx.mjs.map +0 -1
  372. package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs +0 -132
  373. package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs.map +0 -1
  374. package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs +0 -183
  375. package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs.map +0 -1
  376. package/es/utils/aepp-wallet-communication/connection/index.mjs +0 -87
  377. package/es/utils/aepp-wallet-communication/connection/index.mjs.map +0 -1
  378. package/es/utils/aepp-wallet-communication/content-script-bridge.mjs +0 -98
  379. package/es/utils/aepp-wallet-communication/content-script-bridge.mjs.map +0 -1
  380. package/es/utils/aepp-wallet-communication/helpers.mjs +0 -92
  381. package/es/utils/aepp-wallet-communication/helpers.mjs.map +0 -1
  382. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs +0 -375
  383. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs.map +0 -1
  384. package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs +0 -275
  385. package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs.map +0 -1
  386. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs +0 -541
  387. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs.map +0 -1
  388. package/es/utils/aepp-wallet-communication/schema.mjs +0 -102
  389. package/es/utils/aepp-wallet-communication/schema.mjs.map +0 -1
  390. package/es/utils/aepp-wallet-communication/wallet-detector.mjs +0 -110
  391. package/es/utils/aepp-wallet-communication/wallet-detector.mjs.map +0 -1
  392. package/es/utils/async-init.mjs +0 -64
  393. package/es/utils/async-init.mjs.map +0 -1
  394. package/es/utils/crypto-ts.mjs.map +0 -1
  395. package/es/utils/swagger.mjs +0 -164
  396. package/es/utils/swagger.mjs.map +0 -1
  397. package/src/account/base.js +0 -153
  398. package/src/account/memory.js +0 -83
  399. package/src/account/multiple.js +0 -162
  400. package/src/ae/aens.js +0 -361
  401. package/src/ae/aepp.js +0 -45
  402. package/src/ae/contract.js +0 -148
  403. package/src/ae/index.js +0 -168
  404. package/src/ae/oracle.js +0 -311
  405. package/src/ae/universal.js +0 -47
  406. package/src/ae/wallet.js +0 -50
  407. package/src/chain/index.js +0 -269
  408. package/src/chain/node.js +0 -320
  409. package/src/channel/handlers.js +0 -673
  410. package/src/channel/index.js +0 -898
  411. package/src/channel/internal.js +0 -237
  412. package/src/contract/aci.js +0 -376
  413. package/src/contract/compiler.js +0 -100
  414. package/src/contract/ga/helpers.js +0 -19
  415. package/src/contract/ga/index.js +0 -150
  416. package/src/index.js +0 -89
  417. package/src/node-pool/index.js +0 -172
  418. package/src/node.js +0 -116
  419. package/src/tx/builder/field-types.js +0 -61
  420. package/src/tx/builder/helpers.js +0 -380
  421. package/src/tx/builder/index.js +0 -465
  422. package/src/tx/builder/schema.js +0 -1197
  423. package/src/tx/index.js +0 -301
  424. package/src/tx/tx-object.js +0 -187
  425. package/src/tx/tx.js +0 -631
  426. package/src/tx/validator.js +0 -181
  427. package/src/utils/aepp-wallet-communication/connection/browser-runtime.js +0 -119
  428. package/src/utils/aepp-wallet-communication/connection/browser-window-message.js +0 -165
  429. package/src/utils/aepp-wallet-communication/connection/index.js +0 -85
  430. package/src/utils/aepp-wallet-communication/content-script-bridge.js +0 -86
  431. package/src/utils/aepp-wallet-communication/helpers.js +0 -60
  432. package/src/utils/aepp-wallet-communication/rpc/aepp-rpc.js +0 -294
  433. package/src/utils/aepp-wallet-communication/rpc/rpc-client.js +0 -232
  434. package/src/utils/aepp-wallet-communication/rpc/wallet-rpc.js +0 -401
  435. package/src/utils/aepp-wallet-communication/schema.ts +0 -80
  436. package/src/utils/aepp-wallet-communication/wallet-detector.js +0 -92
  437. package/src/utils/async-init.js +0 -45
  438. package/src/utils/crypto.js +0 -229
  439. package/src/utils/hd-wallet.js +0 -100
  440. package/src/utils/json-big.js +0 -26
  441. package/src/utils/keystore.js +0 -219
  442. package/src/utils/swagger.js +0 -156
package/es/ae/aens.mjs DELETED
@@ -1,404 +0,0 @@
1
- /*
2
- * ISC License (ISC)
3
- * Copyright (c) 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
- /**
19
- * Aens module - routines to interact with the æternity naming system
20
- *
21
- * The high-level description of the naming system is
22
- * https://github.com/aeternity/protocol/blob/master/AENS.md in the protocol
23
- * repository.
24
- * @module @aeternity/aepp-sdk/es/ae/aens
25
- * @export Aens
26
- * @example import { Aens } from '@aeternity/aepp-sdk'
27
- */
28
- import { salt } from "../utils/crypto.mjs";
29
- import { commitmentHash, ensureNameValid, isAuctionName } from "../tx/builder/helpers.mjs";
30
- import Ae from "./index.mjs";
31
- import { CLIENT_TTL, NAME_TTL } from "../tx/builder/schema.mjs";
32
- import { ArgumentError } from "../utils/errors.mjs";
33
- /**
34
- * Revoke a name
35
- * @instance
36
- * @function
37
- * @alias module:@aeternity/aepp-sdk/es/ae/aens
38
- * @category async
39
- * @param {String} name Name hash
40
- * @param {Object} [options={}] options
41
- * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
42
- * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
43
- * @param {Number|String|BigNumber} [options.fee] fee
44
- * @param {Number|String|BigNumber} [options.ttl] ttl
45
- * @param {Number|String|BigNumber} [options.nonce] nonce
46
- * @return {Promise<Object>} Transaction result
47
- * @example
48
- * const name = 'test.chain'
49
- * const nameObject = await sdkInstance.aensQuery(name)
50
- *
51
- * await sdkInstance.aensRevoke(name, { fee, ttl , nonce })
52
- * // or
53
- * await nameObject.revoke({ fee, ttl, nonce })
54
- */
55
-
56
- async function revoke(name) {
57
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
58
- ensureNameValid(name);
59
- const opt = { ...this.Ae.defaults,
60
- ...options
61
- };
62
- const nameRevokeTx = await this.nameRevokeTx({ ...opt,
63
- nameId: name,
64
- accountId: await this.address(opt)
65
- });
66
- return this.send(nameRevokeTx, opt);
67
- }
68
- /**
69
- * Update a name
70
- * @instance
71
- * @function
72
- * @category async
73
- * @alias module:@aeternity/aepp-sdk/es/ae/aens
74
- * @param {String} name AENS name
75
- * @param {Object.<string, string>} pointers Map of pointer keys to corresponding addresses
76
- * @param {Object} [options={}]
77
- * @param {Boolean} [options.extendPointers] Get the pointers from the node and merge with provided
78
- * ones. Pointers with the same type will be overwritten
79
- * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you
80
- * pass publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
81
- * @param {Number|String|BigNumber} [options.fee] fee
82
- * @param {Number|String|BigNumber} [options.ttl] ttl
83
- * @param {Number|String|BigNumber} [options.nonce] nonce
84
- * @param {Number|String|BigNumber} [options.nameTtl=50000] Name ttl represented in number of
85
- * blocks (Max value is 50000 blocks)
86
- * @param {Number|String|BigNumber} [options.clientTtl=84600] a suggestion as to how long any
87
- * clients should cache this information
88
- * @return {Promise<Object>}
89
- * @throws Invalid pointer array error
90
- * @example
91
- * const name = 'test.chain'
92
- * const pointersArray = ['ak_asd23dasdas...,' 'ct_asdf34fasdasd...']
93
- * const nameObject = await sdkInstance.aensQuery(name)
94
- *
95
- * await sdkInstance.aensUpdate(name, pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })
96
- * // or
97
- * await nameObject.update(pointers, { nameTtl, ttl, fee, nonce, clientTtl })
98
- */
99
-
100
-
101
- async function update(name) {
102
- let pointers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
103
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
104
- ensureNameValid(name);
105
- const opt = { ...this.Ae.defaults,
106
- ...options
107
- };
108
- const allPointers = { ...(options.extendPointers && Object.fromEntries((await this.getName(name)).pointers.map(_ref => {
109
- let {
110
- key,
111
- id
112
- } = _ref;
113
- return [key, id];
114
- }))),
115
- ...pointers
116
- };
117
- const nameUpdateTx = await this.nameUpdateTx({ ...opt,
118
- nameId: name,
119
- accountId: await this.address(opt),
120
- pointers: Object.entries(allPointers).map(_ref2 => {
121
- let [key, id] = _ref2;
122
- return {
123
- key,
124
- id
125
- };
126
- })
127
- });
128
- return this.send(nameUpdateTx, opt);
129
- }
130
- /**
131
- * Transfer a domain to another account
132
- * @instance
133
- * @function
134
- * @category async
135
- * @alias module:@aeternity/aepp-sdk/es/ae/aens
136
- * @param {String} name AENS name
137
- * @param {String} account Recipient account publick key
138
- * @param {Object} [options={}]
139
- * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
140
- * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
141
- * @param {Number|String|BigNumber} [options.fee] fee
142
- * @param {Number|String|BigNumber} [options.ttl] ttl
143
- * @param {Number|String|BigNumber} [options.nonce] nonce
144
- * @return {Promise<Object>} Transaction result
145
- * @example
146
- * const name = 'test.chain'
147
- * const recipientPub = 'ak_asd23dasdas...'
148
- * const nameObject = await sdkInstance.aensQuery(name)
149
- *
150
- * await sdkInstance.aensTransfer(name, recipientPub, { ttl, fee, nonce })
151
- * // or
152
- * await nameObject.transfer(recipientPub, { ttl, fee, nonce })
153
- */
154
-
155
-
156
- async function transfer(name, account) {
157
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
158
- ensureNameValid(name);
159
- const opt = { ...this.Ae.defaults,
160
- ...options
161
- };
162
- const nameTransferTx = await this.nameTransferTx({ ...opt,
163
- nameId: name,
164
- accountId: await this.address(opt),
165
- recipientId: account
166
- });
167
- return this.send(nameTransferTx, opt);
168
- }
169
- /**
170
- * Query the AENS name info from the node
171
- * and return the object with info and predefined functions for manipulating name
172
- * @instance
173
- * @function
174
- * @category async
175
- * @alias module:@aeternity/aepp-sdk/es/ae/aens
176
- * @param {String} name
177
- * @param {Object} opt Options
178
- * @return {Promise<Object>}
179
- * @example
180
- * const nameObject = sdkInstance.aensQuery('test.chain')
181
- * console.log(nameObject)
182
- * {
183
- * id, // name hash
184
- * pointers, // array of pointers
185
- * update, // Update name function
186
- * extendTtl, // Extend Ttl name function
187
- * transfer, // Transfer name function
188
- * revoke // Revoke name function
189
- * }
190
- */
191
-
192
-
193
- async function query(name) {
194
- var _this = this;
195
-
196
- let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
197
- ensureNameValid(name);
198
- const o = await this.getName(name);
199
- return Object.freeze(Object.assign(o, {
200
- pointers: o.pointers || [],
201
- update: async function (pointers) {
202
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
203
- return { ...(await _this.aensUpdate(name, pointers, { ...opt,
204
- ...options
205
- })),
206
- ...(await _this.aensQuery(name))
207
- };
208
- },
209
- transfer: async function (account) {
210
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
211
- return { ...(await _this.aensTransfer(name, account, { ...opt,
212
- ...options
213
- })),
214
- ...(await _this.aensQuery(name))
215
- };
216
- },
217
- revoke: async function () {
218
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
219
- return _this.aensRevoke(name, { ...opt,
220
- ...options
221
- });
222
- },
223
- extendTtl: async function () {
224
- let nameTtl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : NAME_TTL;
225
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
226
-
227
- if (typeof nameTtl !== 'number' || nameTtl > NAME_TTL || nameTtl <= 0) {
228
- throw new ArgumentError('nameTtl', `a number between 1 and ${NAME_TTL} blocks`, nameTtl);
229
- }
230
-
231
- return { ...(await _this.aensUpdate(name, {}, { ...opt,
232
- ...options,
233
- nameTtl,
234
- extendPointers: true
235
- })),
236
- ...(await _this.aensQuery(name))
237
- };
238
- }
239
- }));
240
- }
241
- /**
242
- * Claim a previously preclaimed registration. This can only be done after the
243
- * preclaim step
244
- * @instance
245
- * @function
246
- * @category async
247
- * @alias module:@aeternity/aepp-sdk/es/ae/aens
248
- * @param {String} name
249
- * @param {Number} salt Salt from pre-claim, or 0 if it's a bid
250
- * @param {Object} [options] options
251
- * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
252
- * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
253
- * @param {Number|String|BigNumber} [options.fee] fee
254
- * @param {Number|String|BigNumber} [options.ttl] ttl
255
- * @param {Number|String|BigNumber} [options.nonce] nonce
256
- * @param {Number|String} [options.nameFee] Name Fee (By default calculated by sdk)
257
- * @return {Promise<Object>} the result of the claim
258
- * @example
259
- * const name = 'test.chain'
260
- * const salt = preclaimResult.salt // salt from pre-claim transaction
261
- *
262
- * await sdkInstance.aensClaim(name, salt, { ttl, fee, nonce, nameFee })
263
- */
264
-
265
-
266
- async function claim(name, salt, options) {
267
- ensureNameValid(name);
268
- const opt = { ...this.Ae.defaults,
269
- ...options
270
- };
271
- const claimTx = await this.nameClaimTx({ ...opt,
272
- accountId: await this.address(opt),
273
- nameSalt: salt,
274
- name
275
- });
276
- const result = await this.send(claimTx, opt);
277
-
278
- if (!isAuctionName(name)) {
279
- const nameInter = opt.waitMined ? await this.aensQuery(name, opt) : {};
280
- return Object.assign(result, nameInter);
281
- }
282
-
283
- return { ...result,
284
- nameFee: opt.nameFee
285
- };
286
- }
287
- /**
288
- * Preclaim a name. Sends a hash of the name and a random salt to the node
289
- * @instance
290
- * @function
291
- * @category async
292
- * @alias module:@aeternity/aepp-sdk/es/ae/aens
293
- * @param {String} name
294
- * @param {Object} [options={}]
295
- * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
296
- * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
297
- * @param {Number|String|BigNumber} [options.fee] fee
298
- * @param {Number|String|BigNumber} [options.ttl] ttl
299
- * @param {Number|String|BigNumber} [options.nonce] nonce
300
- * @return {Promise<Object>}
301
- * @example
302
- * const name = 'test.chain'
303
- * const salt = preclaimResult.salt // salt from pre-claim transaction
304
- *
305
- * await sdkInstance.aensPreclaim(name, { ttl, fee, nonce })
306
- * {
307
- * ...transactionResult,
308
- * claim, // Claim function (options={}) => claimTransactionResult
309
- * salt,
310
- * commitmentId
311
- * }
312
- */
313
-
314
-
315
- async function preclaim(name) {
316
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
317
- ensureNameValid(name);
318
- const opt = { ...this.Ae.defaults,
319
- ...options
320
- };
321
-
322
- const _salt = salt();
323
-
324
- const height = await this.height();
325
- const commitmentId = commitmentHash(name, _salt);
326
- const preclaimTx = await this.namePreclaimTx({ ...opt,
327
- accountId: await this.address(opt),
328
- commitmentId
329
- });
330
- const result = await this.send(preclaimTx, opt);
331
- return Object.freeze({ ...result,
332
- height,
333
- claim: options => this.aensClaim(name, _salt, { ...options,
334
- onAccount: opt.onAccount
335
- }),
336
- salt: _salt,
337
- commitmentId
338
- });
339
- }
340
- /**
341
- * Bid to name auction
342
- * @instance
343
- * @function
344
- * @category async
345
- * @alias module:@aeternity/aepp-sdk/es/ae/aens
346
- * @param {String} name Domain name
347
- * @param {String|Number} nameFee Name fee (bid fee)
348
- * @param {Object} [options={}]
349
- * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
350
- * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
351
- * @param {Number|String|BigNumber} [options.fee] fee
352
- * @param {Number|String|BigNumber} [options.ttl] ttl
353
- * @param {Number|String|BigNumber} [options.nonce] nonce
354
- * @return {Promise<Object>} Transaction result
355
- * @example
356
- * const name = 'test.chain'
357
- * const bidFee = computeBidFee(name, startFee, incrementPercentage)
358
- *
359
- * await sdkInstance.aensBid(name, 213109412839123, { ttl, fee, nonce })
360
- */
361
-
362
-
363
- async function bid(name, nameFee) {
364
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
365
- return this.aensClaim(name, 0, { ...options,
366
- nameFee,
367
- vsn: 2
368
- });
369
- }
370
- /**
371
- * Aens Stamp
372
- *
373
- * Aens provides name-system related methods atop
374
- * {@link module:@aeternity/aepp-sdk/es/ae--Ae} clients.
375
- * @function
376
- * @alias module:@aeternity/aepp-sdk/es/ae/aens
377
- * @rtype Stamp
378
- * @param {Object} [options={}] - Initializer object
379
- * @return {Object} Aens instance
380
- */
381
-
382
-
383
- const Aens = Ae.compose({
384
- methods: {
385
- aensQuery: query,
386
- aensPreclaim: preclaim,
387
- aensClaim: claim,
388
- aensUpdate: update,
389
- aensTransfer: transfer,
390
- aensRevoke: revoke,
391
- aensBid: bid
392
- },
393
- deepProps: {
394
- Ae: {
395
- defaults: {
396
- clientTtl: CLIENT_TTL,
397
- nameTtl: NAME_TTL // aec_governance:name_claim_max_expiration() => 50000
398
-
399
- }
400
- }
401
- }
402
- });
403
- export default Aens;
404
- //# sourceMappingURL=aens.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/ae/aens.js"],"names":["salt","commitmentHash","ensureNameValid","isAuctionName","Ae","CLIENT_TTL","NAME_TTL","ArgumentError","revoke","name","options","opt","defaults","nameRevokeTx","nameId","accountId","address","send","update","pointers","allPointers","extendPointers","Object","fromEntries","getName","map","key","id","nameUpdateTx","entries","transfer","account","nameTransferTx","recipientId","query","o","freeze","assign","aensUpdate","aensQuery","aensTransfer","aensRevoke","extendTtl","nameTtl","claim","claimTx","nameClaimTx","nameSalt","result","nameInter","waitMined","nameFee","preclaim","_salt","height","commitmentId","preclaimTx","namePreclaimTx","aensClaim","onAccount","bid","vsn","Aens","compose","methods","aensPreclaim","aensBid","deepProps","clientTtl"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAESA,I;SACAC,c,EAAgBC,e,EAAiBC,a;OACnCC,E;SACEC,U,EAAYC,Q;SACZC,a;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAeC,MAAf,CAAuBC,IAAvB,EAA2C;AAAA,MAAdC,OAAc,uEAA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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,eAAeK,GAAf,CAAoBnD,IAApB,EAA0B0C,OAA1B,EAAiD;AAAA,MAAdzC,OAAc,uEAAJ,EAAI;AAC/C,SAAO,KAAKgD,SAAL,CAAejD,IAAf,EAAqB,CAArB,EAAwB,EAAE,GAAGC,OAAL;AAAcyC,IAAAA,OAAd;AAAuBU,IAAAA,GAAG,EAAE;AAA5B,GAAxB,CAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,IAAI,GAAG1D,EAAE,CAAC2D,OAAH,CAAW;AACtBC,EAAAA,OAAO,EAAE;AACPzB,IAAAA,SAAS,EAAEL,KADJ;AAEP+B,IAAAA,YAAY,EAAEb,QAFP;AAGPM,IAAAA,SAAS,EAAEd,KAHJ;AAIPN,IAAAA,UAAU,EAAEpB,MAJL;AAKPsB,IAAAA,YAAY,EAAEV,QALP;AAMPW,IAAAA,UAAU,EAAEjC,MANL;AAOP0D,IAAAA,OAAO,EAAEN;AAPF,GADa;AAUtBO,EAAAA,SAAS,EAAE;AACT/D,IAAAA,EAAE,EAAE;AACFQ,MAAAA,QAAQ,EAAE;AACRwD,QAAAA,SAAS,EAAE/D,UADH;AAERsC,QAAAA,OAAO,EAAErC,QAFD,CAEU;;AAFV;AADR;AADK;AAVW,CAAX,CAAb;AAoBA,eAAewD,IAAf","sourcesContent":["/*\n * ISC License (ISC)\n * Copyright (c) 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 * Aens module - routines to interact with the æternity naming system\n *\n * The high-level description of the naming system is\n * https://github.com/aeternity/protocol/blob/master/AENS.md in the protocol\n * repository.\n * @module @aeternity/aepp-sdk/es/ae/aens\n * @export Aens\n * @example import { Aens } from '@aeternity/aepp-sdk'\n */\n\nimport { salt } from '../utils/crypto'\nimport { commitmentHash, ensureNameValid, isAuctionName } from '../tx/builder/helpers'\nimport Ae from './'\nimport { CLIENT_TTL, NAME_TTL } from '../tx/builder/schema'\nimport { ArgumentError } from '../utils/errors'\n\n/**\n * Revoke a name\n * @instance\n * @function\n * @alias module:@aeternity/aepp-sdk/es/ae/aens\n * @category async\n * @param {String} name Name hash\n * @param {Object} [options={}] options\n * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param {Number|String|BigNumber} [options.fee] fee\n * @param {Number|String|BigNumber} [options.ttl] ttl\n * @param {Number|String|BigNumber} [options.nonce] nonce\n * @return {Promise<Object>} Transaction result\n * @example\n * const name = 'test.chain'\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensRevoke(name, { fee, ttl , nonce })\n * // or\n * await nameObject.revoke({ fee, ttl, nonce })\n */\nasync function revoke (name, options = {}) {\n ensureNameValid(name)\n const opt = { ...this.Ae.defaults, ...options }\n\n const nameRevokeTx = await this.nameRevokeTx({\n ...opt,\n nameId: name,\n accountId: await this.address(opt)\n })\n\n return this.send(nameRevokeTx, opt)\n}\n\n/**\n * Update a name\n * @instance\n * @function\n * @category async\n * @alias module:@aeternity/aepp-sdk/es/ae/aens\n * @param {String} name AENS name\n * @param {Object.<string, string>} pointers Map of pointer keys to corresponding addresses\n * @param {Object} [options={}]\n * @param {Boolean} [options.extendPointers] Get the pointers from the node and merge with provided\n * ones. Pointers with the same type will be overwritten\n * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you\n * pass publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param {Number|String|BigNumber} [options.fee] fee\n * @param {Number|String|BigNumber} [options.ttl] ttl\n * @param {Number|String|BigNumber} [options.nonce] nonce\n * @param {Number|String|BigNumber} [options.nameTtl=50000] Name ttl represented in number of\n * blocks (Max value is 50000 blocks)\n * @param {Number|String|BigNumber} [options.clientTtl=84600] a suggestion as to how long any\n * clients should cache this information\n * @return {Promise<Object>}\n * @throws Invalid pointer array error\n * @example\n * const name = 'test.chain'\n * const pointersArray = ['ak_asd23dasdas...,' 'ct_asdf34fasdasd...']\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensUpdate(name, pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })\n * // or\n * await nameObject.update(pointers, { nameTtl, ttl, fee, nonce, clientTtl })\n */\nasync function update (name, pointers = {}, options = {}) {\n ensureNameValid(name)\n const opt = { ...this.Ae.defaults, ...options }\n const allPointers = {\n ...options.extendPointers && Object.fromEntries(\n (await this.getName(name)).pointers.map(({ key, id }) => [key, id])\n ),\n ...pointers\n }\n\n const nameUpdateTx = await this.nameUpdateTx({\n ...opt,\n nameId: name,\n accountId: await this.address(opt),\n pointers: Object.entries(allPointers).map(([key, id]) => ({ key, id }))\n })\n\n return this.send(nameUpdateTx, opt)\n}\n\n/**\n * Transfer a domain to another account\n * @instance\n * @function\n * @category async\n * @alias module:@aeternity/aepp-sdk/es/ae/aens\n * @param {String} name AENS name\n * @param {String} account Recipient account publick key\n * @param {Object} [options={}]\n * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param {Number|String|BigNumber} [options.fee] fee\n * @param {Number|String|BigNumber} [options.ttl] ttl\n * @param {Number|String|BigNumber} [options.nonce] nonce\n * @return {Promise<Object>} Transaction result\n * @example\n * const name = 'test.chain'\n * const recipientPub = 'ak_asd23dasdas...'\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensTransfer(name, recipientPub, { ttl, fee, nonce })\n * // or\n * await nameObject.transfer(recipientPub, { ttl, fee, nonce })\n */\nasync function transfer (name, account, options = {}) {\n ensureNameValid(name)\n const opt = { ...this.Ae.defaults, ...options }\n\n const nameTransferTx = await this.nameTransferTx({\n ...opt,\n nameId: name,\n accountId: await this.address(opt),\n recipientId: account\n })\n\n return this.send(nameTransferTx, opt)\n}\n\n/**\n * Query the AENS name info from the node\n * and return the object with info and predefined functions for manipulating name\n * @instance\n * @function\n * @category async\n * @alias module:@aeternity/aepp-sdk/es/ae/aens\n * @param {String} name\n * @param {Object} opt Options\n * @return {Promise<Object>}\n * @example\n * const nameObject = sdkInstance.aensQuery('test.chain')\n * console.log(nameObject)\n * {\n * id, // name hash\n * pointers, // array of pointers\n * update, // Update name function\n * extendTtl, // Extend Ttl name function\n * transfer, // Transfer name function\n * revoke // Revoke name function\n * }\n */\nasync function query (name, opt = {}) {\n ensureNameValid(name)\n const o = await this.getName(name)\n\n return Object.freeze(Object.assign(o, {\n pointers: o.pointers || [],\n update: async (pointers, options = {}) => {\n return {\n ...(await this.aensUpdate(name, pointers, { ...opt, ...options })),\n ...(await this.aensQuery(name))\n }\n },\n transfer: async (account, options = {}) => {\n return {\n ...(await this.aensTransfer(name, account, { ...opt, ...options })),\n ...(await this.aensQuery(name))\n }\n },\n revoke: async (options = {}) => this.aensRevoke(name, { ...opt, ...options }),\n extendTtl: async (nameTtl = NAME_TTL, options = {}) => {\n if (typeof nameTtl !== 'number' || nameTtl > NAME_TTL || nameTtl <= 0) {\n throw new ArgumentError('nameTtl', `a number between 1 and ${NAME_TTL} blocks`, nameTtl)\n }\n\n return {\n ...await this.aensUpdate(name, {}, { ...opt, ...options, nameTtl, extendPointers: true }),\n ...await this.aensQuery(name)\n }\n }\n }))\n}\n\n/**\n * Claim a previously preclaimed registration. This can only be done after the\n * preclaim step\n * @instance\n * @function\n * @category async\n * @alias module:@aeternity/aepp-sdk/es/ae/aens\n * @param {String} name\n * @param {Number} salt Salt from pre-claim, or 0 if it's a bid\n * @param {Object} [options] options\n * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param {Number|String|BigNumber} [options.fee] fee\n * @param {Number|String|BigNumber} [options.ttl] ttl\n * @param {Number|String|BigNumber} [options.nonce] nonce\n * @param {Number|String} [options.nameFee] Name Fee (By default calculated by sdk)\n * @return {Promise<Object>} the result of the claim\n * @example\n * const name = 'test.chain'\n * const salt = preclaimResult.salt // salt from pre-claim transaction\n *\n * await sdkInstance.aensClaim(name, salt, { ttl, fee, nonce, nameFee })\n */\nasync function claim (name, salt, options) {\n ensureNameValid(name)\n const opt = { ...this.Ae.defaults, ...options }\n\n const claimTx = await this.nameClaimTx({\n ...opt,\n accountId: await this.address(opt),\n nameSalt: salt,\n name\n })\n\n const result = await this.send(claimTx, opt)\n if (!isAuctionName(name)) {\n const nameInter = opt.waitMined ? await this.aensQuery(name, opt) : {}\n return Object.assign(result, nameInter)\n }\n return { ...result, nameFee: opt.nameFee }\n}\n\n/**\n * Preclaim a name. Sends a hash of the name and a random salt to the node\n * @instance\n * @function\n * @category async\n * @alias module:@aeternity/aepp-sdk/es/ae/aens\n * @param {String} name\n * @param {Object} [options={}]\n * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param {Number|String|BigNumber} [options.fee] fee\n * @param {Number|String|BigNumber} [options.ttl] ttl\n * @param {Number|String|BigNumber} [options.nonce] nonce\n * @return {Promise<Object>}\n * @example\n * const name = 'test.chain'\n * const salt = preclaimResult.salt // salt from pre-claim transaction\n *\n * await sdkInstance.aensPreclaim(name, { ttl, fee, nonce })\n * {\n * ...transactionResult,\n * claim, // Claim function (options={}) => claimTransactionResult\n * salt,\n * commitmentId\n * }\n */\nasync function preclaim (name, options = {}) {\n ensureNameValid(name)\n const opt = { ...this.Ae.defaults, ...options }\n const _salt = salt()\n const height = await this.height()\n const commitmentId = commitmentHash(name, _salt)\n\n const preclaimTx = await this.namePreclaimTx({\n ...opt,\n accountId: await this.address(opt),\n commitmentId\n })\n\n const result = await this.send(preclaimTx, opt)\n\n return Object.freeze({\n ...result,\n height,\n claim: options => this.aensClaim(name, _salt, { ...options, onAccount: opt.onAccount }),\n salt: _salt,\n commitmentId\n })\n}\n\n/**\n * Bid to name auction\n * @instance\n * @function\n * @category async\n * @alias module:@aeternity/aepp-sdk/es/ae/aens\n * @param {String} name Domain name\n * @param {String|Number} nameFee Name fee (bid fee)\n * @param {Object} [options={}]\n * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param {Number|String|BigNumber} [options.fee] fee\n * @param {Number|String|BigNumber} [options.ttl] ttl\n * @param {Number|String|BigNumber} [options.nonce] nonce\n * @return {Promise<Object>} Transaction result\n * @example\n * const name = 'test.chain'\n * const bidFee = computeBidFee(name, startFee, incrementPercentage)\n *\n * await sdkInstance.aensBid(name, 213109412839123, { ttl, fee, nonce })\n */\nasync function bid (name, nameFee, options = {}) {\n return this.aensClaim(name, 0, { ...options, nameFee, vsn: 2 })\n}\n\n/**\n * Aens Stamp\n *\n * Aens provides name-system related methods atop\n * {@link module:@aeternity/aepp-sdk/es/ae--Ae} clients.\n * @function\n * @alias module:@aeternity/aepp-sdk/es/ae/aens\n * @rtype Stamp\n * @param {Object} [options={}] - Initializer object\n * @return {Object} Aens instance\n */\nconst Aens = Ae.compose({\n methods: {\n aensQuery: query,\n aensPreclaim: preclaim,\n aensClaim: claim,\n aensUpdate: update,\n aensTransfer: transfer,\n aensRevoke: revoke,\n aensBid: bid\n },\n deepProps: {\n Ae: {\n defaults: {\n clientTtl: CLIENT_TTL,\n nameTtl: NAME_TTL // aec_governance:name_claim_max_expiration() => 50000\n }\n }\n }\n})\n\nexport default Aens\n"],"file":"aens.mjs"}
package/es/ae/aepp.mjs DELETED
@@ -1,45 +0,0 @@
1
- /*
2
- * ISC License (ISC)
3
- * Copyright (c) 2021 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
- /**
19
- * Aepp module
20
- * @module @aeternity/aepp-sdk/es/ae/aepp
21
- * @export Aepp
22
- * @example import { RpcAepp } from '@aeternity/aepp-sdk'
23
- */
24
- import Ae from "./index.mjs";
25
- import Aens from "./aens.mjs";
26
- import Contract from "./contract.mjs";
27
- import AeppRpc from "../utils/aepp-wallet-communication/rpc/aepp-rpc.mjs";
28
- import Chain from "../chain/node.mjs";
29
- import Tx from "../tx/tx.mjs";
30
- import Oracle from "./oracle.mjs";
31
- /**
32
- * Aepp Stamp
33
- *
34
- * Aepp provides base functionality.
35
- * Expected to use this stamp with a Wallet.
36
- * {@link module:@aeternity/aepp-sdk/es/ae--Ae} clients.
37
- * @function
38
- * @alias module:@aeternity/aepp-sdk/es/ae/aepp
39
- * @rtype Stamp
40
- * @param {Object} [options={}] - Initializer object
41
- * @return {Object} Aepp instance
42
- */
43
-
44
- export default Ae.compose(Tx, Oracle, Contract, Aens, Chain, AeppRpc);
45
- //# sourceMappingURL=aepp.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/ae/aepp.js"],"names":["Ae","Aens","Contract","AeppRpc","Chain","Tx","Oracle","compose"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;OAEOA,E;OACAC,I;OACAC,Q;OACAC,O;OACAC,K;OACAC,E;OACAC,M;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAeN,EAAE,CAACO,OAAH,CAAWF,EAAX,EAAeC,MAAf,EAAuBJ,QAAvB,EAAiCD,IAAjC,EAAuCG,KAAvC,EAA8CD,OAA9C,CAAf","sourcesContent":["/*\n * ISC License (ISC)\n * Copyright (c) 2021 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 * Aepp module\n * @module @aeternity/aepp-sdk/es/ae/aepp\n * @export Aepp\n * @example import { RpcAepp } from '@aeternity/aepp-sdk'\n */\n\nimport Ae from './'\nimport Aens from './aens'\nimport Contract from './contract'\nimport AeppRpc from '../utils/aepp-wallet-communication/rpc/aepp-rpc'\nimport Chain from '../chain/node'\nimport Tx from '../tx/tx'\nimport Oracle from './oracle'\n\n/**\n * Aepp Stamp\n *\n * Aepp provides base functionality.\n * Expected to use this stamp with a Wallet.\n * {@link module:@aeternity/aepp-sdk/es/ae--Ae} clients.\n * @function\n * @alias module:@aeternity/aepp-sdk/es/ae/aepp\n * @rtype Stamp\n * @param {Object} [options={}] - Initializer object\n * @return {Object} Aepp instance\n */\nexport default Ae.compose(Tx, Oracle, Contract, Aens, Chain, AeppRpc)\n"],"file":"aepp.mjs"}
@@ -1,159 +0,0 @@
1
- import _buffer from "buffer";
2
- const {
3
- Buffer: _Buffer
4
- } = _buffer;
5
-
6
- /*
7
- * ISC License (ISC)
8
- * Copyright (c) 2021 aeternity developers
9
- *
10
- * Permission to use, copy, modify, and/or distribute this software for any
11
- * purpose with or without fee is hereby granted, provided that the above
12
- * copyright notice and this permission notice appear in all copies.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
- * PERFORMANCE OF THIS SOFTWARE.
21
- */
22
-
23
- /**
24
- * Contract module - routines to interact with the æternity contract
25
- *
26
- * High level documentation of the contracts are available at
27
- * https://github.com/aeternity/protocol/tree/master/contracts and
28
- *
29
- * @module @aeternity/aepp-sdk/es/ae/contract
30
- * @export Contract
31
- * @example import { Contract } from '@aeternity/aepp-sdk'
32
- */
33
- import Ae from "./index.mjs";
34
- import ContractCompilerHttp from "../contract/compiler.mjs";
35
- import getContractInstance from "../contract/aci.mjs";
36
- import { AMOUNT, MIN_GAS_PRICE } from "../tx/builder/schema.mjs";
37
- import { decode, produceNameId } from "../tx/builder/helpers.mjs";
38
- /**
39
- * Utility method to create a delegate signature for a contract
40
- * @function
41
- * @alias module:@aeternity/aepp-sdk/es/ae/contract
42
- * @category async
43
- * @param {String[]} ids The list of id's to prepend
44
- * @param {Object} [opt={}] options
45
- * @param {{ onAccount: String | Object }} [opt={}] opt Options
46
- * @return {Promise<String>} Signature in hex representation
47
- */
48
-
49
- async function delegateSignatureCommon() {
50
- let ids = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
51
- let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52
- const signature = await this.sign(_Buffer.concat([_Buffer.from(this.getNetworkId(opt)), ...ids.map(e => decode(e))]), opt);
53
- return _Buffer.from(signature).toString('hex');
54
- }
55
- /**
56
- * Helper to generate a signature to delegate pre-claim/claim/transfer/revoke of a name to
57
- * a contract.
58
- * @function
59
- * @alias module:@aeternity/aepp-sdk/es/ae/contract
60
- * @category async
61
- * @param {String} contractId Contract Id
62
- * @param {String} [name] The name
63
- * @param {{ onAccount: String | Object }} [opt={}] opt Options
64
- * @return {Promise<String>} Signature for delegation
65
- * @example
66
- * const aeSdk = await Universal({ ... })
67
- * const contractId = 'ct_asd2ks...' // contract address
68
- * const name = 'example.chain' // AENS name
69
- * const onAccount = await aeSdk.address() // Sign with a specific account
70
- * // Preclaim signature
71
- * const params = { contractId }
72
- * const preclaimSig = await aeSdk.createAensDelegationSignature(params, { onAccount: current })
73
- * // Claim, transfer and revoke signature
74
- * const params = { contractId, name }
75
- * const aensDelegationSig = await contract.createAensDelegationSignature(
76
- * params, name, { onAccount: current }
77
- * )
78
- */
79
-
80
-
81
- async function createAensDelegationSignature(_ref) {
82
- let {
83
- contractId,
84
- name
85
- } = _ref;
86
- let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
87
- return this.delegateSignatureCommon([await this.address(opt), ...(name ? [produceNameId(name)] : []), contractId], opt);
88
- }
89
- /**
90
- * Helper to generate a signature to delegate register/extend/respond of a Oracle to a contract.
91
- * @function
92
- * @alias module:@aeternity/aepp-sdk/es/ae/contract
93
- * @category async
94
- * @param {String} contractId Contract Id
95
- * @param {String} [queryId] Oracle Query Id
96
- * @param {{ onAccount: String | Object }} [opt={}] opt Options
97
- * @return {Promise<String>} Signature for delegation
98
- * @example
99
- * const aeSdk = await Universal({ ... })
100
- * const contractId = 'ct_asd2ks...' // contract address
101
- * const queryId = 'oq_...' // Oracle Query Id
102
- * const onAccount = await aeSdk.address() // Sign with a specific account
103
- * // Oracle register and extend signature
104
- * const params = { contractId }
105
- * const oracleDelegationSig = await contract.createOracleDelegationSignature(params, { onAccount })
106
- * // Oracle respond signature
107
- * const params = { contractId, queryId }
108
- * const respondSig = await contract.createOracleDelegationSignature(params, queryId)
109
- */
110
-
111
-
112
- async function createOracleDelegationSignature(_ref2) {
113
- let {
114
- contractId,
115
- queryId
116
- } = _ref2;
117
- let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
118
- return this.delegateSignatureCommon([...(queryId ? [queryId] : []), contractId], opt);
119
- }
120
- /**
121
- * Contract Stamp
122
- *
123
- * Provide contract implementation
124
- * {@link module:@aeternity/aepp-sdk/es/ae--Ae} clients.
125
- * @function
126
- * @alias module:@aeternity/aepp-sdk/es/ae/contract
127
- * @rtype Stamp
128
- * @param {Object} [options={}] - Initializer object
129
- * @return {Object} Contract instance
130
- * @example
131
- * import { Transaction, MemoryAccount, ChainNode } from '@aeternity/aepp-sdk
132
- *
133
- * const ContractWithAE = await Contract
134
- * .compose(Transaction, MemoryAccount, ChainNode) // AE implementation
135
- * const client = await ContractWithAe({ url, internalUrl, compilerUrl, keypair, ... })
136
- *
137
- */
138
-
139
-
140
- export default Ae.compose(ContractCompilerHttp, {
141
- methods: {
142
- getContractInstance,
143
- // Delegation for contract
144
- delegateSignatureCommon,
145
- // AENS
146
- createAensDelegationSignature,
147
- // Oracle
148
- createOracleDelegationSignature
149
- },
150
- deepProps: {
151
- Ae: {
152
- defaults: {
153
- gasPrice: MIN_GAS_PRICE,
154
- amount: AMOUNT
155
- }
156
- }
157
- }
158
- });
159
- //# sourceMappingURL=contract.mjs.map