@aeternity/aepp-sdk 9.0.1 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/README.md +15 -14
  2. package/dist/aepp-sdk.browser-script.js +1 -1
  3. package/dist/aepp-sdk.browser-script.js.LICENSE.txt +7 -36
  4. package/dist/aepp-sdk.browser-script.js.map +1 -1
  5. package/dist/aepp-sdk.browser.js +1 -1
  6. package/dist/aepp-sdk.browser.js.map +1 -1
  7. package/dist/aepp-sdk.js +1 -1
  8. package/dist/aepp-sdk.js.map +1 -1
  9. package/es/account/base.mjs +179 -0
  10. package/es/account/base.mjs.map +1 -0
  11. package/es/account/memory.mjs +99 -0
  12. package/es/account/memory.mjs.map +1 -0
  13. package/es/account/multiple.mjs +179 -0
  14. package/es/account/multiple.mjs.map +1 -0
  15. package/es/ae/aens.mjs +404 -0
  16. package/es/ae/aens.mjs.map +1 -0
  17. package/es/ae/{aepp.js → aepp.mjs} +9 -9
  18. package/es/ae/aepp.mjs.map +1 -0
  19. package/es/ae/contract.mjs +159 -0
  20. package/es/ae/contract.mjs.map +1 -0
  21. package/es/ae/index.mjs +207 -0
  22. package/es/ae/index.mjs.map +1 -0
  23. package/es/ae/oracle.mjs +339 -0
  24. package/es/ae/oracle.mjs.map +1 -0
  25. package/es/ae/{universal.js → universal.mjs} +10 -10
  26. package/es/ae/universal.mjs.map +1 -0
  27. package/es/ae/{wallet.js → wallet.mjs} +10 -10
  28. package/es/ae/wallet.mjs.map +1 -0
  29. package/es/aepp-wallet-communication/schema.d.ts +74 -0
  30. package/es/bignumber.d.ts +1 -7
  31. package/es/chain/{index.js → index.mjs} +29 -9
  32. package/es/chain/index.mjs.map +1 -0
  33. package/es/chain/node.mjs +442 -0
  34. package/es/chain/node.mjs.map +1 -0
  35. package/es/channel/handlers.mjs +1110 -0
  36. package/es/channel/handlers.mjs.map +1 -0
  37. package/es/channel/{index.js → index.mjs} +245 -472
  38. package/es/channel/index.mjs.map +1 -0
  39. package/es/channel/internal.mjs +283 -0
  40. package/es/channel/internal.mjs.map +1 -0
  41. package/es/contract/aci.mjs +477 -0
  42. package/es/contract/aci.mjs.map +1 -0
  43. package/es/contract/compiler.mjs +115 -0
  44. package/es/contract/compiler.mjs.map +1 -0
  45. package/es/contract/ga/helpers.mjs +30 -0
  46. package/es/contract/ga/helpers.mjs.map +1 -0
  47. package/es/contract/ga/index.mjs +178 -0
  48. package/es/contract/ga/index.mjs.map +1 -0
  49. package/es/errors.d.ts +284 -0
  50. package/es/index.mjs +57 -0
  51. package/es/index.mjs.map +1 -0
  52. package/es/node-pool/index.mjs +188 -0
  53. package/es/node-pool/index.mjs.map +1 -0
  54. package/es/node.mjs +133 -0
  55. package/es/node.mjs.map +1 -0
  56. package/es/other.d.ts +1 -1
  57. package/es/tx/builder/field-types.mjs +74 -0
  58. package/es/tx/builder/field-types.mjs.map +1 -0
  59. package/es/tx/builder/helpers.mjs +363 -0
  60. package/es/tx/builder/helpers.mjs.map +1 -0
  61. package/es/tx/builder/index.mjs +606 -0
  62. package/es/tx/builder/index.mjs.map +1 -0
  63. package/es/tx/builder/schema.mjs +760 -0
  64. package/es/tx/builder/schema.mjs.map +1 -0
  65. package/es/tx/{index.js → index.mjs} +107 -15
  66. package/es/tx/index.mjs.map +1 -0
  67. package/es/tx/tx-object.mjs +283 -0
  68. package/es/tx/tx-object.mjs.map +1 -0
  69. package/es/tx/tx.mjs +938 -0
  70. package/es/tx/tx.mjs.map +1 -0
  71. package/es/tx/validator.mjs +247 -0
  72. package/es/tx/validator.mjs.map +1 -0
  73. package/es/typings/blakejs/index.d.mjs +2 -0
  74. package/es/typings/blakejs/{index.d.js.map → index.d.mjs.map} +1 -1
  75. package/es/utils/aepp-wallet-communication/connection/{browser-runtime.js → browser-runtime.mjs} +27 -29
  76. package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs.map +1 -0
  77. package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs +183 -0
  78. package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs.map +1 -0
  79. package/es/utils/aepp-wallet-communication/connection/{index.js → index.mjs} +7 -3
  80. package/es/utils/aepp-wallet-communication/connection/index.mjs.map +1 -0
  81. package/es/utils/aepp-wallet-communication/{content-script-bridge.js → content-script-bridge.mjs} +29 -23
  82. package/es/utils/aepp-wallet-communication/content-script-bridge.mjs.map +1 -0
  83. package/es/utils/aepp-wallet-communication/helpers.mjs +92 -0
  84. package/es/utils/aepp-wallet-communication/helpers.mjs.map +1 -0
  85. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs +375 -0
  86. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs.map +1 -0
  87. package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs +275 -0
  88. package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs.map +1 -0
  89. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs +541 -0
  90. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs.map +1 -0
  91. package/es/utils/aepp-wallet-communication/schema.mjs +102 -0
  92. package/es/utils/aepp-wallet-communication/schema.mjs.map +1 -0
  93. package/es/utils/aepp-wallet-communication/wallet-detector.mjs +110 -0
  94. package/es/utils/aepp-wallet-communication/wallet-detector.mjs.map +1 -0
  95. package/es/utils/amount-formatter.mjs +139 -0
  96. package/es/utils/amount-formatter.mjs.map +1 -0
  97. package/es/utils/async-init.mjs +64 -0
  98. package/es/utils/async-init.mjs.map +1 -0
  99. package/es/utils/bignumber.mjs +21 -0
  100. package/es/utils/bignumber.mjs.map +1 -0
  101. package/es/utils/{bytes.js → bytes.mjs} +16 -12
  102. package/es/utils/bytes.mjs.map +1 -0
  103. package/es/utils/{crypto-ts.js → crypto-ts.mjs} +11 -3
  104. package/es/utils/crypto-ts.mjs.map +1 -0
  105. package/es/utils/crypto.mjs +239 -0
  106. package/es/utils/crypto.mjs.map +1 -0
  107. package/es/utils/errors.mjs +689 -0
  108. package/es/utils/errors.mjs.map +1 -0
  109. package/es/utils/hd-wallet.mjs +111 -0
  110. package/es/utils/hd-wallet.mjs.map +1 -0
  111. package/es/utils/json-big.mjs +45 -0
  112. package/es/utils/json-big.mjs.map +1 -0
  113. package/es/utils/keystore.mjs +240 -0
  114. package/es/utils/keystore.mjs.map +1 -0
  115. package/es/utils/mptree.mjs +161 -0
  116. package/es/utils/mptree.mjs.map +1 -0
  117. package/es/utils/other.mjs +43 -0
  118. package/es/utils/other.mjs.map +1 -0
  119. package/es/utils/semver-satisfies.mjs +16 -0
  120. package/es/utils/semver-satisfies.mjs.map +1 -0
  121. package/es/utils/{string.js → string.mjs} +5 -14
  122. package/es/utils/string.mjs.map +1 -0
  123. package/es/utils/swagger.mjs +164 -0
  124. package/es/utils/swagger.mjs.map +1 -0
  125. package/package.json +55 -62
  126. package/src/account/base.js +3 -1
  127. package/src/account/memory.js +13 -8
  128. package/src/account/multiple.js +31 -22
  129. package/src/ae/aens.js +75 -77
  130. package/src/ae/aepp.js +2 -2
  131. package/src/ae/contract.js +27 -291
  132. package/src/ae/index.js +9 -7
  133. package/src/ae/oracle.js +51 -28
  134. package/src/ae/universal.js +4 -2
  135. package/src/ae/wallet.js +2 -2
  136. package/src/chain/index.js +29 -6
  137. package/src/chain/node.js +95 -67
  138. package/src/channel/handlers.js +30 -21
  139. package/src/channel/index.js +44 -20
  140. package/src/channel/internal.js +30 -24
  141. package/src/contract/aci.js +376 -0
  142. package/src/contract/compiler.js +41 -91
  143. package/src/contract/ga/helpers.js +10 -13
  144. package/src/contract/ga/index.js +42 -33
  145. package/src/index.js +9 -10
  146. package/src/node-pool/index.js +29 -17
  147. package/src/node.js +33 -36
  148. package/src/tx/builder/field-types.js +61 -0
  149. package/src/tx/builder/helpers.js +126 -84
  150. package/src/tx/builder/index.js +83 -41
  151. package/src/tx/builder/schema.js +50 -40
  152. package/src/tx/index.js +101 -12
  153. package/src/tx/tx-object.js +35 -15
  154. package/src/tx/tx.js +232 -153
  155. package/src/tx/validator.js +34 -12
  156. package/src/utils/aepp-wallet-communication/connection/browser-runtime.js +11 -5
  157. package/src/utils/aepp-wallet-communication/connection/browser-window-message.js +35 -13
  158. package/src/utils/aepp-wallet-communication/connection/index.js +2 -1
  159. package/src/utils/aepp-wallet-communication/content-script-bridge.js +14 -7
  160. package/src/utils/aepp-wallet-communication/helpers.js +6 -14
  161. package/src/utils/aepp-wallet-communication/rpc/aepp-rpc.js +107 -60
  162. package/src/utils/aepp-wallet-communication/rpc/rpc-client.js +24 -11
  163. package/src/utils/aepp-wallet-communication/rpc/wallet-rpc.js +98 -56
  164. package/src/utils/aepp-wallet-communication/schema.ts +80 -0
  165. package/src/utils/aepp-wallet-communication/wallet-detector.js +6 -2
  166. package/src/utils/amount-formatter.ts +4 -3
  167. package/src/utils/async-init.js +10 -6
  168. package/src/utils/bignumber.ts +3 -10
  169. package/src/utils/bytes.ts +3 -2
  170. package/src/utils/crypto-ts.ts +2 -2
  171. package/src/utils/crypto.js +10 -144
  172. package/src/utils/errors.ts +683 -0
  173. package/src/utils/hd-wallet.js +11 -26
  174. package/src/utils/keystore.js +57 -53
  175. package/src/utils/mptree.ts +12 -6
  176. package/src/utils/other.ts +1 -1
  177. package/src/utils/semver-satisfies.ts +1 -1
  178. package/src/utils/swagger.js +75 -45
  179. package/es/account/base.js +0 -259
  180. package/es/account/base.js.map +0 -1
  181. package/es/account/memory.js +0 -86
  182. package/es/account/memory.js.map +0 -1
  183. package/es/account/multiple.js +0 -267
  184. package/es/account/multiple.js.map +0 -1
  185. package/es/ae/aens.js +0 -829
  186. package/es/ae/aens.js.map +0 -1
  187. package/es/ae/aepp.js.map +0 -1
  188. package/es/ae/contract.js +0 -985
  189. package/es/ae/contract.js.map +0 -1
  190. package/es/ae/index.js +0 -442
  191. package/es/ae/index.js.map +0 -1
  192. package/es/ae/oracle.js +0 -690
  193. package/es/ae/oracle.js.map +0 -1
  194. package/es/ae/universal.js.map +0 -1
  195. package/es/ae/wallet.js.map +0 -1
  196. package/es/chain/index.js.map +0 -1
  197. package/es/chain/node.js +0 -1119
  198. package/es/chain/node.js.map +0 -1
  199. package/es/channel/handlers.js +0 -1601
  200. package/es/channel/handlers.js.map +0 -1
  201. package/es/channel/index.js.map +0 -1
  202. package/es/channel/internal.js +0 -438
  203. package/es/channel/internal.js.map +0 -1
  204. package/es/contract/aci/helpers.js +0 -298
  205. package/es/contract/aci/helpers.js.map +0 -1
  206. package/es/contract/aci/index.js +0 -517
  207. package/es/contract/aci/index.js.map +0 -1
  208. package/es/contract/aci/transformation.js +0 -742
  209. package/es/contract/aci/transformation.js.map +0 -1
  210. package/es/contract/compiler.js +0 -316
  211. package/es/contract/compiler.js.map +0 -1
  212. package/es/contract/ga/helpers.js +0 -120
  213. package/es/contract/ga/helpers.js.map +0 -1
  214. package/es/contract/ga/index.js +0 -307
  215. package/es/contract/ga/index.js.map +0 -1
  216. package/es/contract/index.js +0 -158
  217. package/es/contract/index.js.map +0 -1
  218. package/es/index.js +0 -57
  219. package/es/index.js.map +0 -1
  220. package/es/node-pool/index.js +0 -204
  221. package/es/node-pool/index.js.map +0 -1
  222. package/es/node.js +0 -228
  223. package/es/node.js.map +0 -1
  224. package/es/tx/builder/helpers.js +0 -355
  225. package/es/tx/builder/helpers.js.map +0 -1
  226. package/es/tx/builder/index.js +0 -686
  227. package/es/tx/builder/index.js.map +0 -1
  228. package/es/tx/builder/schema.js +0 -695
  229. package/es/tx/builder/schema.js.map +0 -1
  230. package/es/tx/index.js.map +0 -1
  231. package/es/tx/tx-object.js +0 -297
  232. package/es/tx/tx-object.js.map +0 -1
  233. package/es/tx/tx.js +0 -1757
  234. package/es/tx/tx.js.map +0 -1
  235. package/es/tx/validator.js +0 -344
  236. package/es/tx/validator.js.map +0 -1
  237. package/es/typings/blakejs/index.d.js +0 -2
  238. package/es/utils/aepp-wallet-communication/connection/browser-runtime.js.map +0 -1
  239. package/es/utils/aepp-wallet-communication/connection/browser-window-message.js +0 -211
  240. package/es/utils/aepp-wallet-communication/connection/browser-window-message.js.map +0 -1
  241. package/es/utils/aepp-wallet-communication/connection/index.js.map +0 -1
  242. package/es/utils/aepp-wallet-communication/content-script-bridge.js.map +0 -1
  243. package/es/utils/aepp-wallet-communication/helpers.js +0 -148
  244. package/es/utils/aepp-wallet-communication/helpers.js.map +0 -1
  245. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.js +0 -652
  246. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.js.map +0 -1
  247. package/es/utils/aepp-wallet-communication/rpc/rpc-client.js +0 -285
  248. package/es/utils/aepp-wallet-communication/rpc/rpc-client.js.map +0 -1
  249. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.js +0 -763
  250. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.js.map +0 -1
  251. package/es/utils/aepp-wallet-communication/schema.js +0 -103
  252. package/es/utils/aepp-wallet-communication/schema.js.map +0 -1
  253. package/es/utils/aepp-wallet-communication/wallet-detector.js +0 -135
  254. package/es/utils/aepp-wallet-communication/wallet-detector.js.map +0 -1
  255. package/es/utils/amount-formatter.js +0 -152
  256. package/es/utils/amount-formatter.js.map +0 -1
  257. package/es/utils/async-init.js +0 -103
  258. package/es/utils/async-init.js.map +0 -1
  259. package/es/utils/bignumber.js +0 -36
  260. package/es/utils/bignumber.js.map +0 -1
  261. package/es/utils/bytes.js.map +0 -1
  262. package/es/utils/crypto-ts.js.map +0 -1
  263. package/es/utils/crypto.js +0 -358
  264. package/es/utils/crypto.js.map +0 -1
  265. package/es/utils/hd-wallet.js +0 -148
  266. package/es/utils/hd-wallet.js.map +0 -1
  267. package/es/utils/json-big.js +0 -78
  268. package/es/utils/json-big.js.map +0 -1
  269. package/es/utils/keystore.js +0 -393
  270. package/es/utils/keystore.js.map +0 -1
  271. package/es/utils/mptree.js +0 -198
  272. package/es/utils/mptree.js.map +0 -1
  273. package/es/utils/other.js +0 -93
  274. package/es/utils/other.js.map +0 -1
  275. package/es/utils/semver-satisfies.js +0 -35
  276. package/es/utils/semver-satisfies.js.map +0 -1
  277. package/es/utils/string.js.map +0 -1
  278. package/es/utils/swagger.js +0 -269
  279. package/es/utils/swagger.js.map +0 -1
  280. package/src/contract/aci/helpers.js +0 -140
  281. package/src/contract/aci/index.js +0 -191
  282. package/src/contract/aci/transformation.js +0 -464
  283. package/src/contract/index.js +0 -159
  284. package/src/utils/aepp-wallet-communication/schema.js +0 -110
package/package.json CHANGED
@@ -1,31 +1,27 @@
1
1
  {
2
2
  "name": "@aeternity/aepp-sdk",
3
- "version": "9.0.1",
3
+ "version": "11.0.0",
4
4
  "description": "SDK for the æternity blockchain",
5
5
  "main": "dist/aepp-sdk.js",
6
6
  "types": "es/index.d.ts",
7
- "module": "es/index.js",
7
+ "module": "es/index.mjs",
8
8
  "browser": {
9
9
  "dist/aepp-sdk.js": "./dist/aepp-sdk.browser.js"
10
10
  },
11
11
  "sideEffects": false,
12
12
  "scripts": {
13
- "build:es": "tsc && babel src --config-file ./babel.esm.config.js --out-dir es --extensions '.js,.ts' --source-maps true",
13
+ "build:es": "tsc && babel src --config-file ./babel.esm.config.js --out-dir es --extensions .js,.ts --out-file-extension .mjs --source-maps true",
14
14
  "build": "webpack --mode=production && npm run build:es",
15
15
  "build:dev": "webpack --mode=development && npm run build:es",
16
16
  "docs:examples": "node tooling/docs/examples-to-md.js examples/node/*.js",
17
17
  "docs:api": "node apidoc.js",
18
- "docs:changelog": "cp CHANGELOG.md docs/CHANGELOG.md",
19
- "lint": "commitlint --from develop --verbose && ts-standard",
20
- "test": "nyc --require @babel/register --require ts-node/register mocha --recursive --exit --timeout 10m",
21
- "report-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
22
- "test:integration:channel,accounts": "nyc --require @babel/register --require ts-node/register mocha './test/integration/@(channel|accounts).js' --exit --timeout 10m",
23
- "test:integration:contract,chain": "nyc --require @babel/register --require ts-node/register mocha './test/integration/@(contract|chain).js' --timeout 10m",
24
- "test:integration:else": "nyc --require @babel/register --require ts-node/register mocha './test/integration/!(channel|accounts|contract|chain).js' --timeout 10m",
25
- "test:unit": "nyc --require @babel/register --require ts-node/register mocha './test/unit/*'",
26
- "test:watch": "mocha --recursive --require @babel/register --require ts-node/register --watch --timeout 10m",
18
+ "lint": "eslint .",
19
+ "test": "nyc mocha './test/unit/' './test/integration/'",
20
+ "test:integration": "nyc mocha './test/integration/'",
21
+ "test:unit": "nyc mocha './test/unit/'",
22
+ "test:watch": "mocha './test/unit/' './test/integration/' --watch",
27
23
  "prepare": "npm run build",
28
- "prepublishOnly": "npm run docs:examples && npm run docs:changelog",
24
+ "prepublishOnly": "npm run docs:examples",
29
25
  "release": "standard-version --skip.tag"
30
26
  },
31
27
  "license": "ISC",
@@ -36,33 +32,27 @@
36
32
  "SDK"
37
33
  ],
38
34
  "dependencies": {
39
- "@aeternity/bip39": "^0.1.0",
35
+ "@aeternity/aepp-calldata": "^1.1.1",
36
+ "@aeternity/argon2-browser": "^0.1.2",
37
+ "@aeternity/blakejs": "^1.1.2",
40
38
  "@aeternity/json-bigint": "^0.3.1",
41
- "@babel/runtime-corejs3": "^7.14.0",
39
+ "@aeternity/uuid": "^0.0.1",
40
+ "@babel/runtime-corejs3": "^7.17.2",
42
41
  "@stamp/it": "^1.1.0",
43
42
  "@stamp/required": "^1.0.1",
44
43
  "aes-js": "^3.1.2",
45
- "bignumber.js": "^9.0.1",
44
+ "bignumber.js": "^9.0.2",
46
45
  "bip32-path": "^0.4.2",
47
- "blakejs": "^1.1.0",
48
- "bs58check": "^2.1.2",
46
+ "bs58": "^4.0.1",
49
47
  "buffer": "^6.0.3",
50
- "cross-fetch": "^3.1.4",
51
- "crypto-browserify": "^3.12.0",
52
- "ed2curve": "^0.3.0",
48
+ "cross-fetch": "^3.1.5",
53
49
  "events": "^3.3.0",
54
- "joi-browser": "^13.4.0",
55
- "libsodium-wrappers-sumo": "0.7.9",
56
- "path-browserify": "^1.0.1",
57
50
  "process": "^0.11.10",
58
- "ramda": "^0.27.1",
59
- "rlp": "2.2.6",
51
+ "rlp": "^3.0.0",
60
52
  "sha.js": "^2.4.11",
61
- "stream-browserify": "^3.0.0",
62
- "swagger-client": "^3.13.5",
53
+ "swagger-client": "^3.18.4",
63
54
  "tweetnacl": "^1.0.3",
64
55
  "tweetnacl-auth": "^1.0.1",
65
- "uuid": "^8.3.2",
66
56
  "websocket": "^1.0.34"
67
57
  },
68
58
  "repository": {
@@ -70,47 +60,50 @@
70
60
  "url": "https://github.com/aeternity/aepp-sdk-js"
71
61
  },
72
62
  "devDependencies": {
73
- "@babel/cli": "7.14.3",
74
- "@babel/core": "7.14.3",
75
- "@babel/node": "7.14.2",
76
- "@babel/plugin-proposal-export-default-from": "7.12.13",
77
- "@babel/plugin-proposal-object-rest-spread": "7.14.4",
78
- "@babel/plugin-transform-runtime": "7.14.3",
79
- "@babel/preset-env": "7.14.4",
80
- "@babel/preset-typescript": "^7.13.0",
81
- "@babel/register": "7.13.16",
82
- "@commitlint/cli": "^12.1.4",
83
- "@commitlint/config-conventional": "^12.1.4",
63
+ "@babel/cli": "^7.17.0",
64
+ "@babel/core": "^7.17.2",
65
+ "@babel/node": "^7.16.8",
66
+ "@babel/plugin-transform-runtime": "^7.17.0",
67
+ "@babel/preset-env": "^7.16.11",
68
+ "@babel/preset-typescript": "^7.16.7",
69
+ "@babel/register": "^7.17.0",
70
+ "@commitlint/cli": "^16.1.0",
71
+ "@commitlint/config-conventional": "^16.0.0",
84
72
  "@types/bn.js": "^5.1.0",
85
- "@types/chai": "^4.2.18",
86
- "@types/mocha": "^8.2.2",
87
- "@types/node": "^15.6.1",
88
- "babel-loader": "^8.2.2",
89
- "babel-plugin-ramda": "^2.0.0",
90
- "chai": "^4.3.4",
73
+ "@types/chai": "^4.3.0",
74
+ "@types/mocha": "^9.1.0",
75
+ "@types/node": "^17.0.17",
76
+ "@typescript-eslint/eslint-plugin": "^5.11.0",
77
+ "@typescript-eslint/parser": "^5.11.0",
78
+ "babel-loader": "^8.2.3",
79
+ "babel-plugin-add-import-extension": "^1.6.0",
80
+ "babel-plugin-import-globals": "^2.0.0",
81
+ "babel-plugin-transform-default-named-imports": "^1.2.2",
82
+ "chai": "^4.3.6",
91
83
  "chai-as-promised": "^7.1.1",
92
- "codecov": "^3.8.2",
93
- "jsdoc-to-markdown": "^7.0.1",
94
- "mocha": "^8.4.0",
84
+ "eslint": "^8.8.0",
85
+ "eslint-config-standard": "^17.0.0-1",
86
+ "jsdoc-to-markdown": "^7.1.1",
87
+ "mocha": "^9.2.0",
95
88
  "nyc": "^15.1.0",
96
- "sinon": "^11.1.1",
89
+ "sinon": "^13.0.1",
97
90
  "source-map": "^0.7.3",
98
- "standard-version": "^9.3.0",
99
- "ts-node": "^10.0.0",
100
- "ts-standard": "^10.0.0",
101
- "typescript": "4.2.4",
102
- "webpack": "^5.38.1",
103
- "webpack-bundle-analyzer": "^4.4.2",
104
- "webpack-cli": "4.7.0"
91
+ "standard-version": "^9.3.2",
92
+ "ts-node": "^10.5.0",
93
+ "typescript": "^4.5.5",
94
+ "webpack": "^5.68.0",
95
+ "webpack-bundle-analyzer": "^4.5.0",
96
+ "webpack-cli": "^4.9.2"
105
97
  },
106
98
  "files": [
107
99
  "dist",
108
100
  "src",
109
101
  "es"
110
102
  ],
111
- "ts-standard": {
112
- "ignore": [
113
- "examples/**/*.js"
114
- ]
115
- }
103
+ "browserslist": [
104
+ "> 1%",
105
+ "last 2 versions",
106
+ "not dead",
107
+ "not ie 11"
108
+ ]
116
109
  }
@@ -85,7 +85,9 @@ async function signMessage (message, opt = { returnHex: false }) {
85
85
  * Verify message
86
86
  * @instance
87
87
  * @category async
88
- * @rtype (msg: String, signature: String, publicKey: String) => signature: Promise[String], throws: Error
88
+ * @rtype (
89
+ * msg: String, signature: String, publicKey: String
90
+ * ) => signature: Promise[String], throws: Error
89
91
  * @param {String} message - Message to verify
90
92
  * @param {String} signature - Signature
91
93
  * @param {Object} opt - Options
@@ -23,9 +23,10 @@
23
23
  */
24
24
 
25
25
  import AccountBase from './base'
26
- import { sign, isAddressValid, isValidKeypair } from '../utils/crypto'
26
+ import { sign, isValidKeypair } from '../utils/crypto'
27
27
  import { isHex } from '../utils/string'
28
28
  import { decode } from '../tx/builder/helpers'
29
+ import { InvalidKeypairError } from '../utils/errors'
29
30
 
30
31
  const secrets = new WeakMap()
31
32
 
@@ -44,21 +45,25 @@ export default AccountBase.compose({
44
45
  init ({ keypair, gaId }) {
45
46
  this.isGa = !!gaId
46
47
  if (gaId) {
47
- if (!isAddressValid(gaId)) throw new Error('Invalid GA address')
48
+ decode(gaId)
48
49
  secrets.set(this, { publicKey: gaId })
49
50
  return
50
51
  }
51
52
 
52
- if (!keypair || typeof keypair !== 'object') throw new Error('KeyPair must be an object')
53
- if (!keypair.secretKey || !keypair.publicKey) throw new Error('KeyPair must must have "secretKey", "publicKey" properties')
54
- if (typeof keypair.publicKey !== 'string' || keypair.publicKey.indexOf('ak_') === -1) throw new Error('Public Key must be a base58c string with "ak_" prefix')
53
+ if (!keypair || typeof keypair !== 'object') throw new InvalidKeypairError('KeyPair must be an object')
54
+ if (!keypair.secretKey || !keypair.publicKey) {
55
+ throw new InvalidKeypairError('KeyPair must must have "secretKey", "publicKey" properties')
56
+ }
57
+ if (typeof keypair.publicKey !== 'string' || keypair.publicKey.indexOf('ak_') === -1) {
58
+ throw new InvalidKeypairError('Public Key must be a base58c string with "ak_" prefix')
59
+ }
55
60
  if (
56
61
  !Buffer.isBuffer(keypair.secretKey) &&
57
62
  (typeof keypair.secretKey === 'string' && !isHex(keypair.secretKey))
58
- ) throw new Error('Secret key must be hex string or Buffer')
63
+ ) throw new InvalidKeypairError('Secret key must be hex string or Buffer')
59
64
 
60
65
  const pubBuffer = Buffer.from(decode(keypair.publicKey, 'ak'))
61
- if (!isValidKeypair(Buffer.from(keypair.secretKey, 'hex'), pubBuffer)) throw new Error('Invalid Key Pair')
66
+ if (!isValidKeypair(Buffer.from(keypair.secretKey, 'hex'), pubBuffer)) throw new InvalidKeypairError('Invalid Key Pair')
62
67
 
63
68
  secrets.set(this, {
64
69
  secretKey: Buffer.isBuffer(keypair.secretKey) ? keypair.secretKey : Buffer.from(keypair.secretKey, 'hex'),
@@ -68,7 +73,7 @@ export default AccountBase.compose({
68
73
  props: { isGa: false },
69
74
  methods: {
70
75
  sign (data) {
71
- if (this.isGa) throw new Error('You are trying to sign data using GA account without keypair')
76
+ if (this.isGa) throw new InvalidKeypairError('You are trying to sign data using generalized account without keypair')
72
77
  return Promise.resolve(sign(data, secrets.get(this).secretKey))
73
78
  },
74
79
  address () {
@@ -21,11 +21,14 @@
21
21
  * @export AccountMultiple
22
22
  */
23
23
 
24
- import * as R from 'ramda'
25
24
  import AsyncInit from '../utils/async-init'
26
25
  import MemoryAccount from './memory'
27
26
  import { decode } from '../tx/builder/helpers'
28
27
  import AccountBase, { isAccountBase } from './base'
28
+ import {
29
+ UnavailableAccountError,
30
+ TypeError
31
+ } from '../utils/errors'
29
32
 
30
33
  /**
31
34
  * AccountMultiple stamp
@@ -42,7 +45,9 @@ import AccountBase, { isAccountBase } from './base'
42
45
  * @param {String} [options.address] - Address of account to select
43
46
  * @return {Object} AccountMultiple instance
44
47
  * @example
45
- * const accounts = await AccountMultiple({ accounts: [ MemmoryAccount({ keypair: 'keypair_object' }) ] })
48
+ * const accounts = await AccountMultiple({
49
+ * accounts: [MemoryAccount({ keypair: 'keypair_object' })]
50
+ * })
46
51
  * await accounts.addAccount(account, { select: true }) // Add account and make it selected
47
52
  * accounts.removeAccount(address) // Remove account
48
53
  * accounts.selectAccount(address) // Select account
@@ -50,15 +55,11 @@ import AccountBase, { isAccountBase } from './base'
50
55
  */
51
56
  export default AccountBase.compose(AsyncInit, {
52
57
  async init ({ accounts = [], address }) {
53
- /* An Account maynot be required for the Node/Chain methods */
54
- if (Array.isArray(accounts) && accounts.length) {
55
- this.accounts = R.fromPairs(await Promise.all(accounts.map(async a => [await a.address(), a])))
56
- if (!address) address = Object.keys(this.accounts)[0]
57
- decode(address, 'ak')
58
- this.selectedAddress = address
59
- } else {
60
- console.warn('No account/accounts supplied')
61
- }
58
+ this.accounts = Object.fromEntries(await Promise.all(
59
+ accounts.map(async a => [await a.address(), a])
60
+ ))
61
+ address = address || Object.keys(this.accounts)[0]
62
+ if (address) this.selectAccount(address)
62
63
  },
63
64
  props: {
64
65
  accounts: {}
@@ -128,25 +129,33 @@ export default AccountBase.compose(AsyncInit, {
128
129
  */
129
130
  selectAccount (address) {
130
131
  decode(address, 'ak')
131
- if (!this.accounts[address]) throw new Error(`Account for ${address} not available`)
132
+ if (!this.accounts[address]) throw new UnavailableAccountError(address)
132
133
  this.selectedAddress = address
133
134
  },
134
135
  /**
135
136
  * Resolves an account
136
- * @param account can be account address (should exist in sdk instance), MemoryAccount or keypair
137
+ * @param account account address (should exist in sdk instance), MemoryAccount or keypair
137
138
  * @returns {AccountBase}
138
139
  * @private
139
140
  */
140
141
  _resolveAccount (account) {
141
- switch (typeof account) {
142
- case 'string':
143
- decode(account, 'ak')
144
- if (!this.accounts[account]) throw new Error(`Account for ${account} not available`)
145
- return this.accounts[account]
146
- case 'object':
147
- return isAccountBase(account) ? account : MemoryAccount({ keypair: account })
148
- default:
149
- throw new Error(`Unknown account type: ${typeof account} (account: ${account})`)
142
+ if (account === null) {
143
+ throw new TypeError(
144
+ 'Account should be an address (ak-prefixed string), ' +
145
+ 'keypair, or instance of account base, got null instead')
146
+ } else {
147
+ switch (typeof account) {
148
+ case 'string':
149
+ decode(account, 'ak')
150
+ if (!this.accounts[account]) throw new UnavailableAccountError(account)
151
+ return this.accounts[account]
152
+ case 'object':
153
+ return isAccountBase(account) ? account : MemoryAccount({ keypair: account })
154
+ default:
155
+ throw new TypeError(
156
+ 'Account should be an address (ak-prefixed string), ' +
157
+ `keypair, or instance of account base, got ${account} instead`)
158
+ }
150
159
  }
151
160
  }
152
161
  }
package/src/ae/aens.js CHANGED
@@ -26,18 +26,11 @@
26
26
  * @example import { Aens } from '@aeternity/aepp-sdk'
27
27
  */
28
28
 
29
- import * as R from 'ramda'
30
29
  import { salt } from '../utils/crypto'
31
- import {
32
- commitmentHash,
33
- ensureNameValid,
34
- getMinimumNameFee,
35
- classify,
36
- isAuctionName,
37
- validatePointers, encode, produceNameId
38
- } from '../tx/builder/helpers'
30
+ import { commitmentHash, ensureNameValid, isAuctionName } from '../tx/builder/helpers'
39
31
  import Ae from './'
40
- import { CLIENT_TTL, NAME_FEE, NAME_TTL } from '../tx/builder/schema'
32
+ import { CLIENT_TTL, NAME_TTL } from '../tx/builder/schema'
33
+ import { ArgumentError } from '../utils/errors'
41
34
 
42
35
  /**
43
36
  * Revoke a name
@@ -47,11 +40,11 @@ import { CLIENT_TTL, NAME_FEE, NAME_TTL } from '../tx/builder/schema'
47
40
  * @category async
48
41
  * @param {String} name Name hash
49
42
  * @param {Object} [options={}] options
50
- * @param {(String|Object)} [options.onAccount] onAccount Make operation on specific account from sdk(you pass publickKey) or
51
- * using provided KeyPair(Can be keypair object or MemoryAccount)
52
- * @param {(Number|String|BigNumber)} [options.fee] fee
53
- * @param {(Number|String|BigNumber)} [options.ttl] ttl
54
- * @param {(Number|String|BigNumber)} [options.nonce] nonce
43
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
44
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
45
+ * @param {Number|String|BigNumber} [options.fee] fee
46
+ * @param {Number|String|BigNumber} [options.ttl] ttl
47
+ * @param {Number|String|BigNumber} [options.nonce] nonce
55
48
  * @return {Promise<Object>} Transaction result
56
49
  * @example
57
50
  * const name = 'test.chain'
@@ -63,12 +56,13 @@ import { CLIENT_TTL, NAME_FEE, NAME_TTL } from '../tx/builder/schema'
63
56
  */
64
57
  async function revoke (name, options = {}) {
65
58
  ensureNameValid(name)
66
- const opt = R.merge(this.Ae.defaults, options)
59
+ const opt = { ...this.Ae.defaults, ...options }
67
60
 
68
- const nameRevokeTx = await this.nameRevokeTx(R.merge(opt, {
69
- nameId: produceNameId(name),
61
+ const nameRevokeTx = await this.nameRevokeTx({
62
+ ...opt,
63
+ nameId: name,
70
64
  accountId: await this.address(opt)
71
- }))
65
+ })
72
66
 
73
67
  return this.send(nameRevokeTx, opt)
74
68
  }
@@ -80,16 +74,19 @@ async function revoke (name, options = {}) {
80
74
  * @category async
81
75
  * @alias module:@aeternity/aepp-sdk/es/ae/aens
82
76
  * @param {String} name AENS name
83
- * @param {String[]} pointers Array of name pointers. Can be oracle|account|contract|channel public key
77
+ * @param {Object.<string, string>} pointers Map of pointer keys to corresponding addresses
84
78
  * @param {Object} [options={}]
85
- * @param {Boolean} [options.extendPointers=false] extendPointers Get the pointers from the node and merge with provided one. Pointers with the same type will be overwrited
86
- * @param {(String|Object)} [options.onAccount] onAccount Make operation on specific account from sdk(you pass publickKey) or
87
- * using provided KeyPair(Can be keypair object or MemoryAccount)
88
- * @param {(Number|String|BigNumber)} [options.fee] fee
89
- * @param {(Number|String|BigNumber)} [options.ttl] ttl
90
- * @param {(Number|String|BigNumber)} [options.nonce] nonce
91
- * @param {(Number|String|BigNumber)} [options.nameTtl=50000] nameTtl Name ttl represented in number of blocks (Max value is 50000 blocks)
92
- * @param {(Number|String|BigNumber)} [options.clientTtl=84600] clientTtl a suggestion as to how long any clients should cache this information
79
+ * @param {Boolean} [options.extendPointers] Get the pointers from the node and merge with provided
80
+ * ones. Pointers with the same type will be overwritten
81
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you
82
+ * pass publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
83
+ * @param {Number|String|BigNumber} [options.fee] fee
84
+ * @param {Number|String|BigNumber} [options.ttl] ttl
85
+ * @param {Number|String|BigNumber} [options.nonce] nonce
86
+ * @param {Number|String|BigNumber} [options.nameTtl=50000] Name ttl represented in number of
87
+ * blocks (Max value is 50000 blocks)
88
+ * @param {Number|String|BigNumber} [options.clientTtl=84600] a suggestion as to how long any
89
+ * clients should cache this information
93
90
  * @return {Promise<Object>}
94
91
  * @throws Invalid pointer array error
95
92
  * @example
@@ -99,22 +96,24 @@ async function revoke (name, options = {}) {
99
96
  *
100
97
  * await sdkInstance.aensUpdate(name, pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })
101
98
  * // or
102
- * await nameObject.update(pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })
99
+ * await nameObject.update(pointers, { nameTtl, ttl, fee, nonce, clientTtl })
103
100
  */
104
- async function update (name, pointers = [], options = { extendPointers: false }) {
101
+ async function update (name, pointers = {}, options = {}) {
105
102
  ensureNameValid(name)
106
- const opt = R.merge(this.Ae.defaults, options)
107
- if (!validatePointers(pointers)) throw new Error('Invalid pointers array')
103
+ const opt = { ...this.Ae.defaults, ...options }
104
+ const allPointers = {
105
+ ...options.extendPointers && Object.fromEntries(
106
+ (await this.getName(name)).pointers.map(({ key, id }) => [key, id])
107
+ ),
108
+ ...pointers
109
+ }
108
110
 
109
- pointers = [
110
- ...options.extendPointers ? (await this.getName(name)).pointers : [],
111
- ...pointers.map(p => R.fromPairs([['id', p], ['key', classify(p)]]))
112
- ].reduce((acc, el) => [...acc.filter(p => p.key !== el.key), el], [])
113
- const nameUpdateTx = await this.nameUpdateTx(R.merge(opt, {
114
- nameId: produceNameId(name),
111
+ const nameUpdateTx = await this.nameUpdateTx({
112
+ ...opt,
113
+ nameId: name,
115
114
  accountId: await this.address(opt),
116
- pointers
117
- }))
115
+ pointers: Object.entries(allPointers).map(([key, id]) => ({ key, id }))
116
+ })
118
117
 
119
118
  return this.send(nameUpdateTx, opt)
120
119
  }
@@ -128,11 +127,11 @@ async function update (name, pointers = [], options = { extendPointers: false })
128
127
  * @param {String} name AENS name
129
128
  * @param {String} account Recipient account publick key
130
129
  * @param {Object} [options={}]
131
- * @param {(String|Object)} [options.onAccount] onAccount Make operation on specific account from sdk(you pass publickKey) or
132
- * using provided KeyPair(Can be keypair object or MemoryAccount)
133
- * @param {(Number|String|BigNumber)} [options.fee] fee
134
- * @param {(Number|String|BigNumber)} [options.ttl] ttl
135
- * @param {(Number|String|BigNumber)} [options.nonce] nonce
130
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
131
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
132
+ * @param {Number|String|BigNumber} [options.fee] fee
133
+ * @param {Number|String|BigNumber} [options.ttl] ttl
134
+ * @param {Number|String|BigNumber} [options.nonce] nonce
136
135
  * @return {Promise<Object>} Transaction result
137
136
  * @example
138
137
  * const name = 'test.chain'
@@ -145,13 +144,14 @@ async function update (name, pointers = [], options = { extendPointers: false })
145
144
  */
146
145
  async function transfer (name, account, options = {}) {
147
146
  ensureNameValid(name)
148
- const opt = R.merge(this.Ae.defaults, options)
147
+ const opt = { ...this.Ae.defaults, ...options }
149
148
 
150
- const nameTransferTx = await this.nameTransferTx(R.merge(opt, {
151
- nameId: produceNameId(name),
149
+ const nameTransferTx = await this.nameTransferTx({
150
+ ...opt,
151
+ nameId: name,
152
152
  accountId: await this.address(opt),
153
153
  recipientId: account
154
- }))
154
+ })
155
155
 
156
156
  return this.send(nameTransferTx, opt)
157
157
  }
@@ -184,25 +184,27 @@ async function query (name, opt = {}) {
184
184
 
185
185
  return Object.freeze(Object.assign(o, {
186
186
  pointers: o.pointers || [],
187
- update: async (pointers = [], options = {}) => {
187
+ update: async (pointers, options = {}) => {
188
188
  return {
189
- ...(await this.aensUpdate(name, pointers, R.merge(opt, options))),
189
+ ...(await this.aensUpdate(name, pointers, { ...opt, ...options })),
190
190
  ...(await this.aensQuery(name))
191
191
  }
192
192
  },
193
193
  transfer: async (account, options = {}) => {
194
194
  return {
195
- ...(await this.aensTransfer(name, account, R.merge(opt, options))),
195
+ ...(await this.aensTransfer(name, account, { ...opt, ...options })),
196
196
  ...(await this.aensQuery(name))
197
197
  }
198
198
  },
199
- revoke: async (options = {}) => this.aensRevoke(name, R.merge(opt, options)),
199
+ revoke: async (options = {}) => this.aensRevoke(name, { ...opt, ...options }),
200
200
  extendTtl: async (nameTtl = NAME_TTL, options = {}) => {
201
- if (!nameTtl || typeof nameTtl !== 'number' || nameTtl > NAME_TTL) throw new Error('Ttl must be an number and less then 180000 blocks')
201
+ if (typeof nameTtl !== 'number' || nameTtl > NAME_TTL || nameTtl <= 0) {
202
+ throw new ArgumentError('nameTtl', `a number between 1 and ${NAME_TTL} blocks`, nameTtl)
203
+ }
202
204
 
203
205
  return {
204
- ...(await this.aensUpdate(name, o.pointers.map(p => p.id), { ...R.merge(opt, options), nameTtl })),
205
- ...(await this.aensQuery(name))
206
+ ...await this.aensUpdate(name, {}, { ...opt, ...options, nameTtl, extendPointers: true }),
207
+ ...await this.aensQuery(name)
206
208
  }
207
209
  }
208
210
  }))
@@ -218,8 +220,8 @@ async function query (name, opt = {}) {
218
220
  * @param {String} name
219
221
  * @param {Number} salt Salt from pre-claim, or 0 if it's a bid
220
222
  * @param {Object} [options] options
221
- * @param {String|Object} [options.onAccount] onAccount Make operation on specific account from sdk(you pass publickKey) or
222
- * using provided KeyPair(Can be keypair object or MemoryAccount)
223
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
224
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
223
225
  * @param {Number|String|BigNumber} [options.fee] fee
224
226
  * @param {Number|String|BigNumber} [options.ttl] ttl
225
227
  * @param {Number|String|BigNumber} [options.nonce] nonce
@@ -233,18 +235,14 @@ async function query (name, opt = {}) {
233
235
  */
234
236
  async function claim (name, salt, options) {
235
237
  ensureNameValid(name)
236
- const opt = R.merge(this.Ae.defaults, options)
238
+ const opt = { ...this.Ae.defaults, ...options }
237
239
 
238
- const minNameFee = getMinimumNameFee(name)
239
- if (opt.nameFee !== this.Ae.defaults.nameFee && minNameFee.gt(opt.nameFee)) {
240
- throw new Error(`the provided fee ${opt.nameFee} is not enough to execute the claim, required: ${minNameFee}`)
241
- }
242
- opt.nameFee = opt.nameFee !== this.Ae.defaults.nameFee ? opt.nameFee : minNameFee
243
- const claimTx = await this.nameClaimTx(R.merge(opt, {
240
+ const claimTx = await this.nameClaimTx({
241
+ ...opt,
244
242
  accountId: await this.address(opt),
245
243
  nameSalt: salt,
246
- name: encode(name, 'nm')
247
- }))
244
+ name
245
+ })
248
246
 
249
247
  const result = await this.send(claimTx, opt)
250
248
  if (!isAuctionName(name)) {
@@ -262,8 +260,8 @@ async function claim (name, salt, options) {
262
260
  * @alias module:@aeternity/aepp-sdk/es/ae/aens
263
261
  * @param {String} name
264
262
  * @param {Object} [options={}]
265
- * @param {String|Object} [options.onAccount] onAccount Make operation on specific account from sdk(you pass publickKey) or
266
- * using provided KeyPair(Can be keypair object or MemoryAccount)
263
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
264
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
267
265
  * @param {Number|String|BigNumber} [options.fee] fee
268
266
  * @param {Number|String|BigNumber} [options.ttl] ttl
269
267
  * @param {Number|String|BigNumber} [options.nonce] nonce
@@ -282,15 +280,16 @@ async function claim (name, salt, options) {
282
280
  */
283
281
  async function preclaim (name, options = {}) {
284
282
  ensureNameValid(name)
285
- const opt = R.merge(this.Ae.defaults, options)
283
+ const opt = { ...this.Ae.defaults, ...options }
286
284
  const _salt = salt()
287
285
  const height = await this.height()
288
286
  const commitmentId = commitmentHash(name, _salt)
289
287
 
290
- const preclaimTx = await this.namePreclaimTx(R.merge(opt, {
288
+ const preclaimTx = await this.namePreclaimTx({
289
+ ...opt,
291
290
  accountId: await this.address(opt),
292
291
  commitmentId
293
- }))
292
+ })
294
293
 
295
294
  const result = await this.send(preclaimTx, opt)
296
295
 
@@ -312,8 +311,8 @@ async function preclaim (name, options = {}) {
312
311
  * @param {String} name Domain name
313
312
  * @param {String|Number} nameFee Name fee (bid fee)
314
313
  * @param {Object} [options={}]
315
- * @param {String|Object} [options.onAccount] onAccount Make operation on specific account from sdk(you pass publickKey) or
316
- * using provided KeyPair(Can be keypair object or MemoryAccount)
314
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
315
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
317
316
  * @param {Number|String|BigNumber} [options.fee] fee
318
317
  * @param {Number|String|BigNumber} [options.ttl] ttl
319
318
  * @param {Number|String|BigNumber} [options.nonce] nonce
@@ -324,7 +323,7 @@ async function preclaim (name, options = {}) {
324
323
  *
325
324
  * await sdkInstance.aensBid(name, 213109412839123, { ttl, fee, nonce })
326
325
  */
327
- async function bid (name, nameFee = NAME_FEE, options = {}) {
326
+ async function bid (name, nameFee, options = {}) {
328
327
  return this.aensClaim(name, 0, { ...options, nameFee, vsn: 2 })
329
328
  }
330
329
 
@@ -353,8 +352,7 @@ const Aens = Ae.compose({
353
352
  Ae: {
354
353
  defaults: {
355
354
  clientTtl: CLIENT_TTL,
356
- nameTtl: NAME_TTL, // aec_governance:name_claim_max_expiration() => 50000
357
- nameFee: NAME_FEE
355
+ nameTtl: NAME_TTL // aec_governance:name_claim_max_expiration() => 50000
358
356
  }
359
357
  }
360
358
  }
package/src/ae/aepp.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * ISC License (ISC)
3
- * Copyright (c) 2018 aeternity developers
3
+ * Copyright (c) 2021 aeternity developers
4
4
  *
5
5
  * Permission to use, copy, modify, and/or distribute this software for any
6
6
  * purpose with or without fee is hereby granted, provided that the above
@@ -24,7 +24,7 @@
24
24
 
25
25
  import Ae from './'
26
26
  import Aens from './aens'
27
- import { ContractWithCompiler as Contract } from './contract'
27
+ import Contract from './contract'
28
28
  import AeppRpc from '../utils/aepp-wallet-communication/rpc/aepp-rpc'
29
29
  import Chain from '../chain/node'
30
30
  import Tx from '../tx/tx'