@aeternity/aepp-sdk 8.2.1 → 10.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 (159) hide show
  1. package/CHANGELOG.md +216 -337
  2. package/README.md +16 -9
  3. package/dist/aepp-sdk.browser-script.js +1 -1
  4. package/dist/aepp-sdk.browser-script.js.LICENSE.txt +0 -9
  5. package/dist/aepp-sdk.browser-script.js.map +1 -1
  6. package/dist/aepp-sdk.browser.js +1 -1
  7. package/dist/aepp-sdk.browser.js.map +1 -1
  8. package/dist/aepp-sdk.js +1 -1
  9. package/dist/aepp-sdk.js.map +1 -1
  10. package/es/account/base.js +36 -120
  11. package/es/account/base.js.map +1 -1
  12. package/es/account/memory.js +17 -19
  13. package/es/account/memory.js.map +1 -1
  14. package/es/account/multiple.js +79 -156
  15. package/es/account/multiple.js.map +1 -1
  16. package/es/ae/aens.js +205 -626
  17. package/es/ae/aens.js.map +1 -1
  18. package/es/ae/contract.js +114 -918
  19. package/es/ae/contract.js.map +1 -1
  20. package/es/ae/index.js +90 -250
  21. package/es/ae/index.js.map +1 -1
  22. package/es/ae/oracle.js +136 -504
  23. package/es/ae/oracle.js.map +1 -1
  24. package/es/ae/universal.js.map +1 -1
  25. package/es/chain/index.js +12 -27
  26. package/es/chain/index.js.map +1 -1
  27. package/es/chain/node.js +289 -1020
  28. package/es/chain/node.js.map +1 -1
  29. package/es/channel/handlers.js +597 -1086
  30. package/es/channel/handlers.js.map +1 -1
  31. package/es/channel/index.js +238 -465
  32. package/es/channel/index.js.map +1 -1
  33. package/es/channel/internal.js +129 -301
  34. package/es/channel/internal.js.map +1 -1
  35. package/es/contract/aci/index.js +328 -495
  36. package/es/contract/aci/index.js.map +1 -1
  37. package/es/contract/aci/transformation.js +35 -711
  38. package/es/contract/aci/transformation.js.map +1 -1
  39. package/es/contract/compiler.js +131 -203
  40. package/es/contract/compiler.js.map +1 -1
  41. package/es/contract/ga/helpers.js +17 -122
  42. package/es/contract/ga/helpers.js.map +1 -1
  43. package/es/contract/ga/index.js +108 -249
  44. package/es/contract/ga/index.js.map +1 -1
  45. package/es/contract/index.js +7 -3
  46. package/es/contract/index.js.map +1 -1
  47. package/es/index.js +3 -3
  48. package/es/index.js.map +1 -1
  49. package/es/node-pool/index.js +57 -74
  50. package/es/node-pool/index.js.map +1 -1
  51. package/es/node.js +65 -161
  52. package/es/node.js.map +1 -1
  53. package/es/other.d.ts +1 -1
  54. package/es/tx/builder/helpers.js +62 -115
  55. package/es/tx/builder/helpers.js.map +1 -1
  56. package/es/tx/builder/index.js +218 -309
  57. package/es/tx/builder/index.js.map +1 -1
  58. package/es/tx/builder/schema.js +586 -573
  59. package/es/tx/builder/schema.js.map +1 -1
  60. package/es/tx/index.js +102 -13
  61. package/es/tx/index.js.map +1 -1
  62. package/es/tx/tx-object.js +114 -138
  63. package/es/tx/tx-object.js.map +1 -1
  64. package/es/tx/tx.js +810 -1586
  65. package/es/tx/tx.js.map +1 -1
  66. package/es/tx/validator.js +191 -426
  67. package/es/tx/validator.js.map +1 -1
  68. package/es/utils/aepp-wallet-communication/connection/browser-runtime.js +20 -23
  69. package/es/utils/aepp-wallet-communication/connection/browser-runtime.js.map +1 -1
  70. package/es/utils/aepp-wallet-communication/connection/browser-window-message.js +53 -80
  71. package/es/utils/aepp-wallet-communication/connection/browser-window-message.js.map +1 -1
  72. package/es/utils/aepp-wallet-communication/connection/index.js +2 -1
  73. package/es/utils/aepp-wallet-communication/connection/index.js.map +1 -1
  74. package/es/utils/aepp-wallet-communication/content-script-bridge.js +24 -19
  75. package/es/utils/aepp-wallet-communication/content-script-bridge.js.map +1 -1
  76. package/es/utils/aepp-wallet-communication/helpers.js +60 -105
  77. package/es/utils/aepp-wallet-communication/helpers.js.map +1 -1
  78. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.js +191 -514
  79. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.js.map +1 -1
  80. package/es/utils/aepp-wallet-communication/rpc/rpc-client.js +78 -93
  81. package/es/utils/aepp-wallet-communication/rpc/rpc-client.js.map +1 -1
  82. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.js +381 -613
  83. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.js.map +1 -1
  84. package/es/utils/aepp-wallet-communication/schema.js +43 -39
  85. package/es/utils/aepp-wallet-communication/schema.js.map +1 -1
  86. package/es/utils/aepp-wallet-communication/wallet-detector.js +32 -58
  87. package/es/utils/aepp-wallet-communication/wallet-detector.js.map +1 -1
  88. package/es/utils/amount-formatter.js +41 -61
  89. package/es/utils/amount-formatter.js.map +1 -1
  90. package/es/utils/async-init.js +28 -64
  91. package/es/utils/async-init.js.map +1 -1
  92. package/es/utils/bignumber.js +3 -11
  93. package/es/utils/bignumber.js.map +1 -1
  94. package/es/utils/bytes.js +5 -9
  95. package/es/utils/bytes.js.map +1 -1
  96. package/es/utils/crypto.js +41 -106
  97. package/es/utils/crypto.js.map +1 -1
  98. package/es/utils/hd-wallet.js +45 -81
  99. package/es/utils/hd-wallet.js.map +1 -1
  100. package/es/utils/json-big.js +16 -49
  101. package/es/utils/json-big.js.map +1 -1
  102. package/es/utils/keystore.js +81 -246
  103. package/es/utils/keystore.js.map +1 -1
  104. package/es/utils/mptree.js +88 -134
  105. package/es/utils/mptree.js.map +1 -1
  106. package/es/utils/other.js +10 -60
  107. package/es/utils/other.js.map +1 -1
  108. package/es/utils/semver-satisfies.js +9 -28
  109. package/es/utils/semver-satisfies.js.map +1 -1
  110. package/es/utils/string.js +4 -13
  111. package/es/utils/string.js.map +1 -1
  112. package/es/utils/swagger.js +87 -224
  113. package/es/utils/swagger.js.map +1 -1
  114. package/package.json +51 -44
  115. package/src/account/base.js +11 -10
  116. package/src/account/multiple.js +24 -18
  117. package/src/ae/aens.js +64 -61
  118. package/src/ae/contract.js +71 -248
  119. package/src/ae/index.js +34 -9
  120. package/src/ae/oracle.js +30 -22
  121. package/src/ae/universal.js +3 -1
  122. package/src/chain/index.js +10 -16
  123. package/src/chain/node.js +38 -38
  124. package/src/channel/handlers.js +10 -4
  125. package/src/channel/index.js +44 -20
  126. package/src/contract/aci/index.js +234 -112
  127. package/src/contract/aci/transformation.js +30 -422
  128. package/src/contract/compiler.js +50 -5
  129. package/src/contract/ga/helpers.js +6 -14
  130. package/src/contract/ga/index.js +28 -28
  131. package/src/contract/index.js +6 -2
  132. package/src/index.js +4 -4
  133. package/src/node-pool/index.js +24 -13
  134. package/src/node.js +29 -30
  135. package/src/tx/builder/helpers.js +31 -56
  136. package/src/tx/builder/index.js +67 -28
  137. package/src/tx/builder/schema.js +79 -121
  138. package/src/tx/index.js +101 -12
  139. package/src/tx/tx-object.js +25 -8
  140. package/src/tx/tx.js +229 -150
  141. package/src/tx/validator.js +134 -202
  142. package/src/utils/aepp-wallet-communication/connection/browser-runtime.js +3 -2
  143. package/src/utils/aepp-wallet-communication/connection/browser-window-message.js +25 -7
  144. package/src/utils/aepp-wallet-communication/connection/index.js +2 -1
  145. package/src/utils/aepp-wallet-communication/content-script-bridge.js +10 -4
  146. package/src/utils/aepp-wallet-communication/helpers.js +4 -2
  147. package/src/utils/aepp-wallet-communication/rpc/aepp-rpc.js +33 -12
  148. package/src/utils/aepp-wallet-communication/rpc/rpc-client.js +9 -5
  149. package/src/utils/aepp-wallet-communication/rpc/wallet-rpc.js +59 -29
  150. package/src/utils/aepp-wallet-communication/schema.js +1 -3
  151. package/src/utils/aepp-wallet-communication/wallet-detector.js +4 -1
  152. package/src/utils/amount-formatter.ts +1 -1
  153. package/src/utils/bignumber.ts +2 -1
  154. package/src/utils/crypto.js +4 -68
  155. package/src/utils/keystore.js +10 -2
  156. package/src/utils/other.ts +1 -1
  157. package/src/utils/semver-satisfies.ts +1 -1
  158. package/src/utils/swagger.js +22 -10
  159. package/src/contract/aci/helpers.js +0 -140
package/es/ae/aens.js CHANGED
@@ -1,29 +1,32 @@
1
- import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
2
- import _fromPairs from "ramda/src/fromPairs";
3
- import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
4
- import _merge from "ramda/src/merge";
5
- import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
6
-
7
- function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
8
-
9
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context17; _forEachInstanceProperty(_context17 = ownKeys(Object(source), true)).call(_context17, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context18; _forEachInstanceProperty(_context18 = ownKeys(Object(source))).call(_context18, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
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
+ */
10
17
 
11
- import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
12
- import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
13
- import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
14
- import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
15
- import _Object$freeze from "@babel/runtime-corejs3/core-js-stable/object/freeze";
16
- import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
17
- import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
18
- import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
19
- import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
20
- import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
21
- import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
22
- import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
23
- import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
24
- import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
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
+ */
25
28
  import { salt } from '../utils/crypto';
26
- import { commitmentHash, ensureNameValid, getMinimumNameFee, classify, isAuctionName, validatePointers, encode, produceNameId } from '../tx/builder/helpers';
29
+ import { commitmentHash, ensureNameValid, getMinimumNameFee, isAuctionName, encode, produceNameId } from '../tx/builder/helpers';
27
30
  import Ae from './';
28
31
  import { CLIENT_TTL, NAME_FEE, NAME_TTL } from '../tx/builder/schema';
29
32
  /**
@@ -34,11 +37,11 @@ import { CLIENT_TTL, NAME_FEE, NAME_TTL } from '../tx/builder/schema';
34
37
  * @category async
35
38
  * @param {String} name Name hash
36
39
  * @param {Object} [options={}] options
37
- * @param {(String|Object)} [options.onAccount] onAccount Make operation on specific account from sdk(you pass publickKey) or
38
- * using provided KeyPair(Can be keypair object or MemoryAccount)
39
- * @param {(Number|String|BigNumber)} [options.fee] fee
40
- * @param {(Number|String|BigNumber)} [options.ttl] ttl
41
- * @param {(Number|String|BigNumber)} [options.nonce] nonce
40
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
41
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
42
+ * @param {Number|String|BigNumber} [options.fee] fee
43
+ * @param {Number|String|BigNumber} [options.ttl] ttl
44
+ * @param {Number|String|BigNumber} [options.nonce] nonce
42
45
  * @return {Promise<Object>} Transaction result
43
46
  * @example
44
47
  * const name = 'test.chain'
@@ -49,8 +52,17 @@ import { CLIENT_TTL, NAME_FEE, NAME_TTL } from '../tx/builder/schema';
49
52
  * await nameObject.revoke({ fee, ttl, nonce })
50
53
  */
51
54
 
52
- function revoke(_x) {
53
- return _revoke.apply(this, arguments);
55
+ async function revoke(name) {
56
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
57
+ ensureNameValid(name);
58
+ const opt = { ...this.Ae.defaults,
59
+ ...options
60
+ };
61
+ const nameRevokeTx = await this.nameRevokeTx({ ...opt,
62
+ nameId: produceNameId(name),
63
+ accountId: await this.address(opt)
64
+ });
65
+ return this.send(nameRevokeTx, opt);
54
66
  }
55
67
  /**
56
68
  * Update a name
@@ -59,16 +71,19 @@ function revoke(_x) {
59
71
  * @category async
60
72
  * @alias module:@aeternity/aepp-sdk/es/ae/aens
61
73
  * @param {String} name AENS name
62
- * @param {String[]} pointers Array of name pointers. Can be oracle|account|contract|channel public key
74
+ * @param {Object.<string, string>} pointers Map of pointer keys to corresponding addresses
63
75
  * @param {Object} [options={}]
64
- * @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
65
- * @param {(String|Object)} [options.onAccount] onAccount Make operation on specific account from sdk(you pass publickKey) or
66
- * using provided KeyPair(Can be keypair object or MemoryAccount)
67
- * @param {(Number|String|BigNumber)} [options.fee] fee
68
- * @param {(Number|String|BigNumber)} [options.ttl] ttl
69
- * @param {(Number|String|BigNumber)} [options.nonce] nonce
70
- * @param {(Number|String|BigNumber)} [options.nameTtl=50000] nameTtl Name ttl represented in number of blocks (Max value is 50000 blocks)
71
- * @param {(Number|String|BigNumber)} [options.clientTtl=84600] clientTtl a suggestion as to how long any clients should cache this information
76
+ * @param {Boolean} [options.extendPointers] Get the pointers from the node and merge with provided
77
+ * ones. Pointers with the same type will be overwritten
78
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you
79
+ * pass publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
80
+ * @param {Number|String|BigNumber} [options.fee] fee
81
+ * @param {Number|String|BigNumber} [options.ttl] ttl
82
+ * @param {Number|String|BigNumber} [options.nonce] nonce
83
+ * @param {Number|String|BigNumber} [options.nameTtl=50000] Name ttl represented in number of
84
+ * blocks (Max value is 50000 blocks)
85
+ * @param {Number|String|BigNumber} [options.clientTtl=84600] a suggestion as to how long any
86
+ * clients should cache this information
72
87
  * @return {Promise<Object>}
73
88
  * @throws Invalid pointer array error
74
89
  * @example
@@ -78,56 +93,38 @@ function revoke(_x) {
78
93
  *
79
94
  * await sdkInstance.aensUpdate(name, pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })
80
95
  * // or
81
- * await nameObject.update(pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })
96
+ * await nameObject.update(pointers, { nameTtl, ttl, fee, nonce, clientTtl })
82
97
  */
83
98
 
84
99
 
85
- function _revoke() {
86
- _revoke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(name) {
87
- var options,
88
- opt,
89
- nameRevokeTx,
90
- _args = arguments;
91
- return _regeneratorRuntime.wrap(function _callee$(_context) {
92
- while (1) {
93
- switch (_context.prev = _context.next) {
94
- case 0:
95
- options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
96
- ensureNameValid(name);
97
- opt = _merge(this.Ae.defaults, options);
98
- _context.t0 = this;
99
- _context.t1 = _merge;
100
- _context.t2 = opt;
101
- _context.t3 = produceNameId(name);
102
- _context.next = 9;
103
- return this.address(opt);
104
-
105
- case 9:
106
- _context.t4 = _context.sent;
107
- _context.t5 = {
108
- nameId: _context.t3,
109
- accountId: _context.t4
110
- };
111
- _context.t6 = (0, _context.t1)(_context.t2, _context.t5);
112
- _context.next = 14;
113
- return _context.t0.nameRevokeTx.call(_context.t0, _context.t6);
114
-
115
- case 14:
116
- nameRevokeTx = _context.sent;
117
- return _context.abrupt("return", this.send(nameRevokeTx, opt));
118
-
119
- case 16:
120
- case "end":
121
- return _context.stop();
122
- }
123
- }
124
- }, _callee, this);
125
- }));
126
- return _revoke.apply(this, arguments);
127
- }
128
-
129
- function update(_x2) {
130
- return _update.apply(this, arguments);
100
+ async function update(name) {
101
+ let pointers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
102
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
103
+ ensureNameValid(name);
104
+ const opt = { ...this.Ae.defaults,
105
+ ...options
106
+ };
107
+ const allPointers = { ...(options.extendPointers && Object.fromEntries((await this.getName(name)).pointers.map(_ref => {
108
+ let {
109
+ key,
110
+ id
111
+ } = _ref;
112
+ return [key, id];
113
+ }))),
114
+ ...pointers
115
+ };
116
+ const nameUpdateTx = await this.nameUpdateTx({ ...opt,
117
+ nameId: produceNameId(name),
118
+ accountId: await this.address(opt),
119
+ pointers: Object.entries(allPointers).map(_ref2 => {
120
+ let [key, id] = _ref2;
121
+ return {
122
+ key,
123
+ id
124
+ };
125
+ })
126
+ });
127
+ return this.send(nameUpdateTx, opt);
131
128
  }
132
129
  /**
133
130
  * Transfer a domain to another account
@@ -138,11 +135,11 @@ function update(_x2) {
138
135
  * @param {String} name AENS name
139
136
  * @param {String} account Recipient account publick key
140
137
  * @param {Object} [options={}]
141
- * @param {(String|Object)} [options.onAccount] onAccount Make operation on specific account from sdk(you pass publickKey) or
142
- * using provided KeyPair(Can be keypair object or MemoryAccount)
143
- * @param {(Number|String|BigNumber)} [options.fee] fee
144
- * @param {(Number|String|BigNumber)} [options.ttl] ttl
145
- * @param {(Number|String|BigNumber)} [options.nonce] nonce
138
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
139
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
140
+ * @param {Number|String|BigNumber} [options.fee] fee
141
+ * @param {Number|String|BigNumber} [options.ttl] ttl
142
+ * @param {Number|String|BigNumber} [options.nonce] nonce
146
143
  * @return {Promise<Object>} Transaction result
147
144
  * @example
148
145
  * const name = 'test.chain'
@@ -155,104 +152,18 @@ function update(_x2) {
155
152
  */
156
153
 
157
154
 
158
- function _update() {
159
- _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(name) {
160
- var _context2, _context3;
161
-
162
- var pointers,
163
- options,
164
- opt,
165
- nameUpdateTx,
166
- _args2 = arguments;
167
- return _regeneratorRuntime.wrap(function _callee2$(_context5) {
168
- while (1) {
169
- switch (_context5.prev = _context5.next) {
170
- case 0:
171
- pointers = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : [];
172
- options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {
173
- extendPointers: false
174
- };
175
- ensureNameValid(name);
176
- opt = _merge(this.Ae.defaults, options);
177
-
178
- if (validatePointers(pointers)) {
179
- _context5.next = 6;
180
- break;
181
- }
182
-
183
- throw new Error('Invalid pointers array');
184
-
185
- case 6:
186
- _context5.t0 = _reduceInstanceProperty;
187
- _context5.t1 = _concatInstanceProperty(_context3 = []);
188
- _context5.t2 = _context3;
189
- _context5.t3 = _toConsumableArray;
190
-
191
- if (!options.extendPointers) {
192
- _context5.next = 16;
193
- break;
194
- }
195
-
196
- _context5.next = 13;
197
- return this.getName(name);
198
-
199
- case 13:
200
- _context5.t4 = _context5.sent.pointers;
201
- _context5.next = 17;
202
- break;
203
-
204
- case 16:
205
- _context5.t4 = [];
206
-
207
- case 17:
208
- _context5.t5 = _context5.t4;
209
- _context5.t6 = (0, _context5.t3)(_context5.t5);
210
- _context5.t7 = _toConsumableArray(_mapInstanceProperty(pointers).call(pointers, function (p) {
211
- return _fromPairs([['id', p], ['key', classify(p)]]);
212
- }));
213
- _context5.t8 = _context2 = _context5.t1.call.call(_context5.t1, _context5.t2, _context5.t6, _context5.t7);
214
- pointers = (0, _context5.t0)(_context5.t8).call(_context2, function (acc, el) {
215
- var _context4;
216
-
217
- return _concatInstanceProperty(_context4 = []).call(_context4, _toConsumableArray(_filterInstanceProperty(acc).call(acc, function (p) {
218
- return p.key !== el.key;
219
- })), [el]);
220
- }, []);
221
- _context5.t9 = this;
222
- _context5.t10 = _merge;
223
- _context5.t11 = opt;
224
- _context5.t12 = produceNameId(name);
225
- _context5.next = 28;
226
- return this.address(opt);
227
-
228
- case 28:
229
- _context5.t13 = _context5.sent;
230
- _context5.t14 = pointers;
231
- _context5.t15 = {
232
- nameId: _context5.t12,
233
- accountId: _context5.t13,
234
- pointers: _context5.t14
235
- };
236
- _context5.t16 = (0, _context5.t10)(_context5.t11, _context5.t15);
237
- _context5.next = 34;
238
- return _context5.t9.nameUpdateTx.call(_context5.t9, _context5.t16);
239
-
240
- case 34:
241
- nameUpdateTx = _context5.sent;
242
- return _context5.abrupt("return", this.send(nameUpdateTx, opt));
243
-
244
- case 36:
245
- case "end":
246
- return _context5.stop();
247
- }
248
- }
249
- }, _callee2, this);
250
- }));
251
- return _update.apply(this, arguments);
252
- }
253
-
254
- function transfer(_x3, _x4) {
255
- return _transfer.apply(this, arguments);
155
+ async function transfer(name, account) {
156
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
157
+ ensureNameValid(name);
158
+ const opt = { ...this.Ae.defaults,
159
+ ...options
160
+ };
161
+ const nameTransferTx = await this.nameTransferTx({ ...opt,
162
+ nameId: produceNameId(name),
163
+ accountId: await this.address(opt),
164
+ recipientId: account
165
+ });
166
+ return this.send(nameTransferTx, opt);
256
167
  }
257
168
  /**
258
169
  * Query the AENS name info from the node
@@ -278,54 +189,49 @@ function transfer(_x3, _x4) {
278
189
  */
279
190
 
280
191
 
281
- function _transfer() {
282
- _transfer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(name, account) {
283
- var options,
284
- opt,
285
- nameTransferTx,
286
- _args3 = arguments;
287
- return _regeneratorRuntime.wrap(function _callee3$(_context6) {
288
- while (1) {
289
- switch (_context6.prev = _context6.next) {
290
- case 0:
291
- options = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {};
292
- ensureNameValid(name);
293
- opt = _merge(this.Ae.defaults, options);
294
- _context6.t0 = this;
295
- _context6.t1 = _merge;
296
- _context6.t2 = opt;
297
- _context6.t3 = produceNameId(name);
298
- _context6.next = 9;
299
- return this.address(opt);
300
-
301
- case 9:
302
- _context6.t4 = _context6.sent;
303
- _context6.t5 = account;
304
- _context6.t6 = {
305
- nameId: _context6.t3,
306
- accountId: _context6.t4,
307
- recipientId: _context6.t5
308
- };
309
- _context6.t7 = (0, _context6.t1)(_context6.t2, _context6.t6);
310
- _context6.next = 15;
311
- return _context6.t0.nameTransferTx.call(_context6.t0, _context6.t7);
312
-
313
- case 15:
314
- nameTransferTx = _context6.sent;
315
- return _context6.abrupt("return", this.send(nameTransferTx, opt));
316
-
317
- case 17:
318
- case "end":
319
- return _context6.stop();
320
- }
321
- }
322
- }, _callee3, this);
192
+ async function query(name) {
193
+ var _this = this;
194
+
195
+ let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
196
+ ensureNameValid(name);
197
+ const o = await this.getName(name);
198
+ return Object.freeze(Object.assign(o, {
199
+ pointers: o.pointers || [],
200
+ update: async function (pointers) {
201
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
202
+ return { ...(await _this.aensUpdate(name, pointers, { ...opt,
203
+ ...options
204
+ })),
205
+ ...(await _this.aensQuery(name))
206
+ };
207
+ },
208
+ transfer: async function (account) {
209
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
210
+ return { ...(await _this.aensTransfer(name, account, { ...opt,
211
+ ...options
212
+ })),
213
+ ...(await _this.aensQuery(name))
214
+ };
215
+ },
216
+ revoke: async function () {
217
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
218
+ return _this.aensRevoke(name, { ...opt,
219
+ ...options
220
+ });
221
+ },
222
+ extendTtl: async function () {
223
+ let nameTtl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : NAME_TTL;
224
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
225
+ if (!nameTtl || typeof nameTtl !== 'number' || nameTtl > NAME_TTL) throw new Error('Ttl must be an number and less then 180000 blocks');
226
+ return { ...(await _this.aensUpdate(name, {}, { ...opt,
227
+ ...options,
228
+ nameTtl,
229
+ extendPointers: true
230
+ })),
231
+ ...(await _this.aensQuery(name))
232
+ };
233
+ }
323
234
  }));
324
- return _transfer.apply(this, arguments);
325
- }
326
-
327
- function query(_x5) {
328
- return _query.apply(this, arguments);
329
235
  }
330
236
  /**
331
237
  * Claim a previously preclaimed registration. This can only be done after the
@@ -337,8 +243,8 @@ function query(_x5) {
337
243
  * @param {String} name
338
244
  * @param {Number} salt Salt from pre-claim, or 0 if it's a bid
339
245
  * @param {Object} [options] options
340
- * @param {String|Object} [options.onAccount] onAccount Make operation on specific account from sdk(you pass publickKey) or
341
- * using provided KeyPair(Can be keypair object or MemoryAccount)
246
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
247
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
342
248
  * @param {Number|String|BigNumber} [options.fee] fee
343
249
  * @param {Number|String|BigNumber} [options.ttl] ttl
344
250
  * @param {Number|String|BigNumber} [options.nonce] nonce
@@ -352,201 +258,33 @@ function query(_x5) {
352
258
  */
353
259
 
354
260
 
355
- function _query() {
356
- _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(name) {
357
- var _this = this;
358
-
359
- var opt,
360
- o,
361
- _args8 = arguments;
362
- return _regeneratorRuntime.wrap(function _callee8$(_context12) {
363
- while (1) {
364
- switch (_context12.prev = _context12.next) {
365
- case 0:
366
- opt = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : {};
367
- ensureNameValid(name);
368
- _context12.next = 4;
369
- return this.getName(name);
370
-
371
- case 4:
372
- o = _context12.sent;
373
- return _context12.abrupt("return", _Object$freeze(_Object$assign(o, {
374
- pointers: o.pointers || [],
375
- update: function () {
376
- var _update2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
377
- var pointers,
378
- options,
379
- _args4 = arguments;
380
- return _regeneratorRuntime.wrap(function _callee4$(_context7) {
381
- while (1) {
382
- switch (_context7.prev = _context7.next) {
383
- case 0:
384
- pointers = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : [];
385
- options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
386
- _context7.t0 = _objectSpread;
387
- _context7.t1 = _objectSpread;
388
- _context7.t2 = {};
389
- _context7.next = 7;
390
- return _this.aensUpdate(name, pointers, _merge(opt, options));
391
-
392
- case 7:
393
- _context7.t3 = _context7.sent;
394
- _context7.t4 = (0, _context7.t1)(_context7.t2, _context7.t3);
395
- _context7.next = 11;
396
- return _this.aensQuery(name);
397
-
398
- case 11:
399
- _context7.t5 = _context7.sent;
400
- return _context7.abrupt("return", (0, _context7.t0)(_context7.t4, _context7.t5));
401
-
402
- case 13:
403
- case "end":
404
- return _context7.stop();
405
- }
406
- }
407
- }, _callee4);
408
- }));
409
-
410
- function update() {
411
- return _update2.apply(this, arguments);
412
- }
413
-
414
- return update;
415
- }(),
416
- transfer: function () {
417
- var _transfer2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(account) {
418
- var options,
419
- _args5 = arguments;
420
- return _regeneratorRuntime.wrap(function _callee5$(_context8) {
421
- while (1) {
422
- switch (_context8.prev = _context8.next) {
423
- case 0:
424
- options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
425
- _context8.t0 = _objectSpread;
426
- _context8.t1 = _objectSpread;
427
- _context8.t2 = {};
428
- _context8.next = 6;
429
- return _this.aensTransfer(name, account, _merge(opt, options));
430
-
431
- case 6:
432
- _context8.t3 = _context8.sent;
433
- _context8.t4 = (0, _context8.t1)(_context8.t2, _context8.t3);
434
- _context8.next = 10;
435
- return _this.aensQuery(name);
261
+ async function claim(name, salt, options) {
262
+ ensureNameValid(name);
263
+ const opt = { ...this.Ae.defaults,
264
+ ...options
265
+ };
266
+ const minNameFee = getMinimumNameFee(name);
436
267
 
437
- case 10:
438
- _context8.t5 = _context8.sent;
439
- return _context8.abrupt("return", (0, _context8.t0)(_context8.t4, _context8.t5));
440
-
441
- case 12:
442
- case "end":
443
- return _context8.stop();
444
- }
445
- }
446
- }, _callee5);
447
- }));
448
-
449
- function transfer(_x11) {
450
- return _transfer2.apply(this, arguments);
451
- }
452
-
453
- return transfer;
454
- }(),
455
- revoke: function () {
456
- var _revoke2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
457
- var options,
458
- _args6 = arguments;
459
- return _regeneratorRuntime.wrap(function _callee6$(_context9) {
460
- while (1) {
461
- switch (_context9.prev = _context9.next) {
462
- case 0:
463
- options = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
464
- return _context9.abrupt("return", _this.aensRevoke(name, _merge(opt, options)));
465
-
466
- case 2:
467
- case "end":
468
- return _context9.stop();
469
- }
470
- }
471
- }, _callee6);
472
- }));
473
-
474
- function revoke() {
475
- return _revoke2.apply(this, arguments);
476
- }
477
-
478
- return revoke;
479
- }(),
480
- extendTtl: function () {
481
- var _extendTtl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
482
- var _context10;
483
-
484
- var nameTtl,
485
- options,
486
- _args7 = arguments;
487
- return _regeneratorRuntime.wrap(function _callee7$(_context11) {
488
- while (1) {
489
- switch (_context11.prev = _context11.next) {
490
- case 0:
491
- nameTtl = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : NAME_TTL;
492
- options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
493
-
494
- if (!(!nameTtl || typeof nameTtl !== 'number' || nameTtl > NAME_TTL)) {
495
- _context11.next = 4;
496
- break;
497
- }
498
-
499
- throw new Error('Ttl must be an number and less then 180000 blocks');
500
-
501
- case 4:
502
- _context11.t0 = _objectSpread;
503
- _context11.t1 = _objectSpread;
504
- _context11.t2 = {};
505
- _context11.next = 9;
506
- return _this.aensUpdate(name, _mapInstanceProperty(_context10 = o.pointers).call(_context10, function (p) {
507
- return p.id;
508
- }), _objectSpread(_objectSpread({}, _merge(opt, options)), {}, {
509
- nameTtl: nameTtl
510
- }));
511
-
512
- case 9:
513
- _context11.t3 = _context11.sent;
514
- _context11.t4 = (0, _context11.t1)(_context11.t2, _context11.t3);
515
- _context11.next = 13;
516
- return _this.aensQuery(name);
517
-
518
- case 13:
519
- _context11.t5 = _context11.sent;
520
- return _context11.abrupt("return", (0, _context11.t0)(_context11.t4, _context11.t5));
521
-
522
- case 15:
523
- case "end":
524
- return _context11.stop();
525
- }
526
- }
527
- }, _callee7);
528
- }));
529
-
530
- function extendTtl() {
531
- return _extendTtl.apply(this, arguments);
532
- }
533
-
534
- return extendTtl;
535
- }()
536
- })));
268
+ if (opt.nameFee !== this.Ae.defaults.nameFee && minNameFee.gt(opt.nameFee)) {
269
+ throw new Error(`the provided fee ${opt.nameFee} is not enough to execute the claim, required: ${minNameFee}`);
270
+ }
537
271
 
538
- case 6:
539
- case "end":
540
- return _context12.stop();
541
- }
542
- }
543
- }, _callee8, this);
544
- }));
545
- return _query.apply(this, arguments);
546
- }
272
+ opt.nameFee = opt.nameFee !== this.Ae.defaults.nameFee ? opt.nameFee : minNameFee;
273
+ const claimTx = await this.nameClaimTx({ ...opt,
274
+ accountId: await this.address(opt),
275
+ nameSalt: salt,
276
+ name: encode(name, 'nm')
277
+ });
278
+ const result = await this.send(claimTx, opt);
279
+
280
+ if (!isAuctionName(name)) {
281
+ const nameInter = opt.waitMined ? await this.aensQuery(name, opt) : {};
282
+ return Object.assign(result, nameInter);
283
+ }
547
284
 
548
- function claim(_x6, _x7, _x8) {
549
- return _claim.apply(this, arguments);
285
+ return { ...result,
286
+ nameFee: opt.nameFee
287
+ };
550
288
  }
551
289
  /**
552
290
  * Preclaim a name. Sends a hash of the name and a random salt to the node
@@ -556,8 +294,8 @@ function claim(_x6, _x7, _x8) {
556
294
  * @alias module:@aeternity/aepp-sdk/es/ae/aens
557
295
  * @param {String} name
558
296
  * @param {Object} [options={}]
559
- * @param {String|Object} [options.onAccount] onAccount Make operation on specific account from sdk(you pass publickKey) or
560
- * using provided KeyPair(Can be keypair object or MemoryAccount)
297
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
298
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
561
299
  * @param {Number|String|BigNumber} [options.fee] fee
562
300
  * @param {Number|String|BigNumber} [options.ttl] ttl
563
301
  * @param {Number|String|BigNumber} [options.nonce] nonce
@@ -576,96 +314,30 @@ function claim(_x6, _x7, _x8) {
576
314
  */
577
315
 
578
316
 
579
- function _claim() {
580
- _claim = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(name, salt, options) {
581
- var opt, minNameFee, _context13, claimTx, result, nameInter;
582
-
583
- return _regeneratorRuntime.wrap(function _callee9$(_context14) {
584
- while (1) {
585
- switch (_context14.prev = _context14.next) {
586
- case 0:
587
- ensureNameValid(name);
588
- opt = _merge(this.Ae.defaults, options);
589
- minNameFee = getMinimumNameFee(name);
590
-
591
- if (!(opt.nameFee !== this.Ae.defaults.nameFee && minNameFee.gt(opt.nameFee))) {
592
- _context14.next = 5;
593
- break;
594
- }
595
-
596
- throw new Error(_concatInstanceProperty(_context13 = "the provided fee ".concat(opt.nameFee, " is not enough to execute the claim, required: ")).call(_context13, minNameFee));
597
-
598
- case 5:
599
- opt.nameFee = opt.nameFee !== this.Ae.defaults.nameFee ? opt.nameFee : minNameFee;
600
- _context14.t0 = this;
601
- _context14.t1 = _merge;
602
- _context14.t2 = opt;
603
- _context14.next = 11;
604
- return this.address(opt);
605
-
606
- case 11:
607
- _context14.t3 = _context14.sent;
608
- _context14.t4 = salt;
609
- _context14.t5 = encode(name, 'nm');
610
- _context14.t6 = {
611
- accountId: _context14.t3,
612
- nameSalt: _context14.t4,
613
- name: _context14.t5
614
- };
615
- _context14.t7 = (0, _context14.t1)(_context14.t2, _context14.t6);
616
- _context14.next = 18;
617
- return _context14.t0.nameClaimTx.call(_context14.t0, _context14.t7);
618
-
619
- case 18:
620
- claimTx = _context14.sent;
621
- _context14.next = 21;
622
- return this.send(claimTx, opt);
623
-
624
- case 21:
625
- result = _context14.sent;
626
-
627
- if (isAuctionName(name)) {
628
- _context14.next = 32;
629
- break;
630
- }
631
-
632
- if (!opt.waitMined) {
633
- _context14.next = 29;
634
- break;
635
- }
636
-
637
- _context14.next = 26;
638
- return this.aensQuery(name, opt);
639
-
640
- case 26:
641
- _context14.t8 = _context14.sent;
642
- _context14.next = 30;
643
- break;
644
-
645
- case 29:
646
- _context14.t8 = {};
647
-
648
- case 30:
649
- nameInter = _context14.t8;
650
- return _context14.abrupt("return", _Object$assign(result, nameInter));
651
-
652
- case 32:
653
- return _context14.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
654
- nameFee: opt.nameFee
655
- }));
656
-
657
- case 33:
658
- case "end":
659
- return _context14.stop();
660
- }
661
- }
662
- }, _callee9, this);
663
- }));
664
- return _claim.apply(this, arguments);
665
- }
666
-
667
- function preclaim(_x9) {
668
- return _preclaim.apply(this, arguments);
317
+ async function preclaim(name) {
318
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
319
+ ensureNameValid(name);
320
+ const opt = { ...this.Ae.defaults,
321
+ ...options
322
+ };
323
+
324
+ const _salt = salt();
325
+
326
+ const height = await this.height();
327
+ const commitmentId = commitmentHash(name, _salt);
328
+ const preclaimTx = await this.namePreclaimTx({ ...opt,
329
+ accountId: await this.address(opt),
330
+ commitmentId
331
+ });
332
+ const result = await this.send(preclaimTx, opt);
333
+ return Object.freeze({ ...result,
334
+ height,
335
+ claim: options => this.aensClaim(name, _salt, { ...options,
336
+ onAccount: opt.onAccount
337
+ }),
338
+ salt: _salt,
339
+ commitmentId
340
+ });
669
341
  }
670
342
  /**
671
343
  * Bid to name auction
@@ -676,8 +348,8 @@ function preclaim(_x9) {
676
348
  * @param {String} name Domain name
677
349
  * @param {String|Number} nameFee Name fee (bid fee)
678
350
  * @param {Object} [options={}]
679
- * @param {String|Object} [options.onAccount] onAccount Make operation on specific account from sdk(you pass publickKey) or
680
- * using provided KeyPair(Can be keypair object or MemoryAccount)
351
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
352
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
681
353
  * @param {Number|String|BigNumber} [options.fee] fee
682
354
  * @param {Number|String|BigNumber} [options.ttl] ttl
683
355
  * @param {Number|String|BigNumber} [options.nonce] nonce
@@ -690,80 +362,13 @@ function preclaim(_x9) {
690
362
  */
691
363
 
692
364
 
693
- function _preclaim() {
694
- _preclaim = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(name) {
695
- var _this2 = this;
696
-
697
- var options,
698
- opt,
699
- _salt,
700
- height,
701
- commitmentId,
702
- preclaimTx,
703
- result,
704
- _args10 = arguments;
705
-
706
- return _regeneratorRuntime.wrap(function _callee10$(_context15) {
707
- while (1) {
708
- switch (_context15.prev = _context15.next) {
709
- case 0:
710
- options = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {};
711
- ensureNameValid(name);
712
- opt = _merge(this.Ae.defaults, options);
713
- _salt = salt();
714
- _context15.next = 6;
715
- return this.height();
716
-
717
- case 6:
718
- height = _context15.sent;
719
- commitmentId = commitmentHash(name, _salt);
720
- _context15.t0 = this;
721
- _context15.t1 = _merge;
722
- _context15.t2 = opt;
723
- _context15.next = 13;
724
- return this.address(opt);
725
-
726
- case 13:
727
- _context15.t3 = _context15.sent;
728
- _context15.t4 = commitmentId;
729
- _context15.t5 = {
730
- accountId: _context15.t3,
731
- commitmentId: _context15.t4
732
- };
733
- _context15.t6 = (0, _context15.t1)(_context15.t2, _context15.t5);
734
- _context15.next = 19;
735
- return _context15.t0.namePreclaimTx.call(_context15.t0, _context15.t6);
736
-
737
- case 19:
738
- preclaimTx = _context15.sent;
739
- _context15.next = 22;
740
- return this.send(preclaimTx, opt);
741
-
742
- case 22:
743
- result = _context15.sent;
744
- return _context15.abrupt("return", _Object$freeze(_objectSpread(_objectSpread({}, result), {}, {
745
- height: height,
746
- claim: function claim(options) {
747
- return _this2.aensClaim(name, _salt, _objectSpread(_objectSpread({}, options), {}, {
748
- onAccount: opt.onAccount
749
- }));
750
- },
751
- salt: _salt,
752
- commitmentId: commitmentId
753
- })));
754
-
755
- case 24:
756
- case "end":
757
- return _context15.stop();
758
- }
759
- }
760
- }, _callee10, this);
761
- }));
762
- return _preclaim.apply(this, arguments);
763
- }
764
-
765
- function bid(_x10) {
766
- return _bid.apply(this, arguments);
365
+ async function bid(name) {
366
+ let nameFee = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NAME_FEE;
367
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
368
+ return this.aensClaim(name, 0, { ...options,
369
+ nameFee,
370
+ vsn: 2
371
+ });
767
372
  }
768
373
  /**
769
374
  * Aens Stamp
@@ -778,33 +383,7 @@ function bid(_x10) {
778
383
  */
779
384
 
780
385
 
781
- function _bid() {
782
- _bid = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(name) {
783
- var nameFee,
784
- options,
785
- _args11 = arguments;
786
- return _regeneratorRuntime.wrap(function _callee11$(_context16) {
787
- while (1) {
788
- switch (_context16.prev = _context16.next) {
789
- case 0:
790
- nameFee = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : NAME_FEE;
791
- options = _args11.length > 2 && _args11[2] !== undefined ? _args11[2] : {};
792
- return _context16.abrupt("return", this.aensClaim(name, 0, _objectSpread(_objectSpread({}, options), {}, {
793
- nameFee: nameFee,
794
- vsn: 2
795
- })));
796
-
797
- case 3:
798
- case "end":
799
- return _context16.stop();
800
- }
801
- }
802
- }, _callee11, this);
803
- }));
804
- return _bid.apply(this, arguments);
805
- }
806
-
807
- var Aens = Ae.compose({
386
+ const Aens = Ae.compose({
808
387
  methods: {
809
388
  aensQuery: query,
810
389
  aensPreclaim: preclaim,