@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
@@ -21,10 +21,9 @@
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
- import { assertedType } from '../utils/crypto'
26
+ import { decode } from '../tx/builder/helpers'
28
27
  import AccountBase, { isAccountBase } from './base'
29
28
 
30
29
  /**
@@ -42,7 +41,9 @@ import AccountBase, { isAccountBase } from './base'
42
41
  * @param {String} [options.address] - Address of account to select
43
42
  * @return {Object} AccountMultiple instance
44
43
  * @example
45
- * const accounts = await AccountMultiple({ accounts: [ MemmoryAccount({ keypair: 'keypair_object' }) ] })
44
+ * const accounts = await AccountMultiple({
45
+ * accounts: [MemoryAccount({ keypair: 'keypair_object' })]
46
+ * })
46
47
  * await accounts.addAccount(account, { select: true }) // Add account and make it selected
47
48
  * accounts.removeAccount(address) // Remove account
48
49
  * accounts.selectAccount(address) // Select account
@@ -50,10 +51,11 @@ import AccountBase, { isAccountBase } from './base'
50
51
  */
51
52
  export default AccountBase.compose(AsyncInit, {
52
53
  async init ({ accounts = [], address }) {
53
- this.accounts = R.fromPairs(await Promise.all(accounts.map(async a => [await a.address(), a])))
54
- if (!address) address = Object.keys(this.accounts)[0]
55
- assertedType(address, 'ak')
56
- this.selectedAddress = address
54
+ this.accounts = Object.fromEntries(await Promise.all(
55
+ accounts.map(async a => [await a.address(), a])
56
+ ))
57
+ address = address || Object.keys(this.accounts)[0]
58
+ if (address) this.selectAccount(address)
57
59
  },
58
60
  props: {
59
61
  accounts: {}
@@ -122,26 +124,30 @@ export default AccountBase.compose(AsyncInit, {
122
124
  * @example selectAccount('ak_xxxxxxxx')
123
125
  */
124
126
  selectAccount (address) {
125
- assertedType(address, 'ak')
127
+ decode(address, 'ak')
126
128
  if (!this.accounts[address]) throw new Error(`Account for ${address} not available`)
127
129
  this.selectedAddress = address
128
130
  },
129
131
  /**
130
132
  * Resolves an account
131
- * @param account can be account address (should exist in sdk instance), MemoryAccount or keypair
133
+ * @param account account address (should exist in sdk instance), MemoryAccount or keypair
132
134
  * @returns {AccountBase}
133
135
  * @private
134
136
  */
135
137
  _resolveAccount (account) {
136
- switch (typeof account) {
137
- case 'string':
138
- assertedType(account, 'ak')
139
- if (!this.accounts[account]) throw new Error(`Account for ${account} not available`)
140
- return this.accounts[account]
141
- case 'object':
142
- return isAccountBase(account) ? account : MemoryAccount({ keypair: account })
143
- default:
144
- throw new Error(`Unknown account type: ${typeof account} (account: ${account})`)
138
+ if (account === null) {
139
+ throw new Error('No account or wallet configured')
140
+ } else {
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})`)
150
+ }
145
151
  }
146
152
  }
147
153
  }
package/src/ae/aens.js CHANGED
@@ -26,15 +26,9 @@
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
30
  import {
32
- commitmentHash,
33
- ensureNameValid,
34
- getMinimumNameFee,
35
- classify,
36
- isAuctionName,
37
- validatePointers, encode, produceNameId
31
+ commitmentHash, ensureNameValid, getMinimumNameFee, isAuctionName, encode, produceNameId
38
32
  } from '../tx/builder/helpers'
39
33
  import Ae from './'
40
34
  import { CLIENT_TTL, NAME_FEE, NAME_TTL } from '../tx/builder/schema'
@@ -47,11 +41,11 @@ import { CLIENT_TTL, NAME_FEE, NAME_TTL } from '../tx/builder/schema'
47
41
  * @category async
48
42
  * @param {String} name Name hash
49
43
  * @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
44
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
45
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
46
+ * @param {Number|String|BigNumber} [options.fee] fee
47
+ * @param {Number|String|BigNumber} [options.ttl] ttl
48
+ * @param {Number|String|BigNumber} [options.nonce] nonce
55
49
  * @return {Promise<Object>} Transaction result
56
50
  * @example
57
51
  * const name = 'test.chain'
@@ -63,12 +57,13 @@ import { CLIENT_TTL, NAME_FEE, NAME_TTL } from '../tx/builder/schema'
63
57
  */
64
58
  async function revoke (name, options = {}) {
65
59
  ensureNameValid(name)
66
- const opt = R.merge(this.Ae.defaults, options)
60
+ const opt = { ...this.Ae.defaults, ...options }
67
61
 
68
- const nameRevokeTx = await this.nameRevokeTx(R.merge(opt, {
62
+ const nameRevokeTx = await this.nameRevokeTx({
63
+ ...opt,
69
64
  nameId: produceNameId(name),
70
65
  accountId: await this.address(opt)
71
- }))
66
+ })
72
67
 
73
68
  return this.send(nameRevokeTx, opt)
74
69
  }
@@ -80,16 +75,19 @@ async function revoke (name, options = {}) {
80
75
  * @category async
81
76
  * @alias module:@aeternity/aepp-sdk/es/ae/aens
82
77
  * @param {String} name AENS name
83
- * @param {String[]} pointers Array of name pointers. Can be oracle|account|contract|channel public key
78
+ * @param {Object.<string, string>} pointers Map of pointer keys to corresponding addresses
84
79
  * @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
80
+ * @param {Boolean} [options.extendPointers] Get the pointers from the node and merge with provided
81
+ * ones. Pointers with the same type will be overwritten
82
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you
83
+ * pass publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
84
+ * @param {Number|String|BigNumber} [options.fee] fee
85
+ * @param {Number|String|BigNumber} [options.ttl] ttl
86
+ * @param {Number|String|BigNumber} [options.nonce] nonce
87
+ * @param {Number|String|BigNumber} [options.nameTtl=50000] Name ttl represented in number of
88
+ * blocks (Max value is 50000 blocks)
89
+ * @param {Number|String|BigNumber} [options.clientTtl=84600] a suggestion as to how long any
90
+ * clients should cache this information
93
91
  * @return {Promise<Object>}
94
92
  * @throws Invalid pointer array error
95
93
  * @example
@@ -99,22 +97,24 @@ async function revoke (name, options = {}) {
99
97
  *
100
98
  * await sdkInstance.aensUpdate(name, pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })
101
99
  * // or
102
- * await nameObject.update(pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })
100
+ * await nameObject.update(pointers, { nameTtl, ttl, fee, nonce, clientTtl })
103
101
  */
104
- async function update (name, pointers = [], options = { extendPointers: false }) {
102
+ async function update (name, pointers = {}, options = {}) {
105
103
  ensureNameValid(name)
106
- const opt = R.merge(this.Ae.defaults, options)
107
- if (!validatePointers(pointers)) throw new Error('Invalid pointers array')
104
+ const opt = { ...this.Ae.defaults, ...options }
105
+ const allPointers = {
106
+ ...options.extendPointers && Object.fromEntries(
107
+ (await this.getName(name)).pointers.map(({ key, id }) => [key, id])
108
+ ),
109
+ ...pointers
110
+ }
108
111
 
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, {
112
+ const nameUpdateTx = await this.nameUpdateTx({
113
+ ...opt,
114
114
  nameId: produceNameId(name),
115
115
  accountId: await this.address(opt),
116
- pointers
117
- }))
116
+ pointers: Object.entries(allPointers).map(([key, id]) => ({ key, id }))
117
+ })
118
118
 
119
119
  return this.send(nameUpdateTx, opt)
120
120
  }
@@ -128,11 +128,11 @@ async function update (name, pointers = [], options = { extendPointers: false })
128
128
  * @param {String} name AENS name
129
129
  * @param {String} account Recipient account publick key
130
130
  * @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
131
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
132
+ * publickKey) or 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
136
136
  * @return {Promise<Object>} Transaction result
137
137
  * @example
138
138
  * const name = 'test.chain'
@@ -145,13 +145,14 @@ async function update (name, pointers = [], options = { extendPointers: false })
145
145
  */
146
146
  async function transfer (name, account, options = {}) {
147
147
  ensureNameValid(name)
148
- const opt = R.merge(this.Ae.defaults, options)
148
+ const opt = { ...this.Ae.defaults, ...options }
149
149
 
150
- const nameTransferTx = await this.nameTransferTx(R.merge(opt, {
150
+ const nameTransferTx = await this.nameTransferTx({
151
+ ...opt,
151
152
  nameId: produceNameId(name),
152
153
  accountId: await this.address(opt),
153
154
  recipientId: account
154
- }))
155
+ })
155
156
 
156
157
  return this.send(nameTransferTx, opt)
157
158
  }
@@ -184,25 +185,25 @@ async function query (name, opt = {}) {
184
185
 
185
186
  return Object.freeze(Object.assign(o, {
186
187
  pointers: o.pointers || [],
187
- update: async (pointers = [], options = {}) => {
188
+ update: async (pointers, options = {}) => {
188
189
  return {
189
- ...(await this.aensUpdate(name, pointers, R.merge(opt, options))),
190
+ ...(await this.aensUpdate(name, pointers, { ...opt, ...options })),
190
191
  ...(await this.aensQuery(name))
191
192
  }
192
193
  },
193
194
  transfer: async (account, options = {}) => {
194
195
  return {
195
- ...(await this.aensTransfer(name, account, R.merge(opt, options))),
196
+ ...(await this.aensTransfer(name, account, { ...opt, ...options })),
196
197
  ...(await this.aensQuery(name))
197
198
  }
198
199
  },
199
- revoke: async (options = {}) => this.aensRevoke(name, R.merge(opt, options)),
200
+ revoke: async (options = {}) => this.aensRevoke(name, { ...opt, ...options }),
200
201
  extendTtl: async (nameTtl = NAME_TTL, options = {}) => {
201
202
  if (!nameTtl || typeof nameTtl !== 'number' || nameTtl > NAME_TTL) throw new Error('Ttl must be an number and less then 180000 blocks')
202
203
 
203
204
  return {
204
- ...(await this.aensUpdate(name, o.pointers.map(p => p.id), { ...R.merge(opt, options), nameTtl })),
205
- ...(await this.aensQuery(name))
205
+ ...await this.aensUpdate(name, {}, { ...opt, ...options, nameTtl, extendPointers: true }),
206
+ ...await this.aensQuery(name)
206
207
  }
207
208
  }
208
209
  }))
@@ -218,8 +219,8 @@ async function query (name, opt = {}) {
218
219
  * @param {String} name
219
220
  * @param {Number} salt Salt from pre-claim, or 0 if it's a bid
220
221
  * @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)
222
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
223
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
223
224
  * @param {Number|String|BigNumber} [options.fee] fee
224
225
  * @param {Number|String|BigNumber} [options.ttl] ttl
225
226
  * @param {Number|String|BigNumber} [options.nonce] nonce
@@ -233,18 +234,19 @@ async function query (name, opt = {}) {
233
234
  */
234
235
  async function claim (name, salt, options) {
235
236
  ensureNameValid(name)
236
- const opt = R.merge(this.Ae.defaults, options)
237
+ const opt = { ...this.Ae.defaults, ...options }
237
238
 
238
239
  const minNameFee = getMinimumNameFee(name)
239
240
  if (opt.nameFee !== this.Ae.defaults.nameFee && minNameFee.gt(opt.nameFee)) {
240
241
  throw new Error(`the provided fee ${opt.nameFee} is not enough to execute the claim, required: ${minNameFee}`)
241
242
  }
242
243
  opt.nameFee = opt.nameFee !== this.Ae.defaults.nameFee ? opt.nameFee : minNameFee
243
- const claimTx = await this.nameClaimTx(R.merge(opt, {
244
+ const claimTx = await this.nameClaimTx({
245
+ ...opt,
244
246
  accountId: await this.address(opt),
245
247
  nameSalt: salt,
246
248
  name: encode(name, 'nm')
247
- }))
249
+ })
248
250
 
249
251
  const result = await this.send(claimTx, opt)
250
252
  if (!isAuctionName(name)) {
@@ -262,8 +264,8 @@ async function claim (name, salt, options) {
262
264
  * @alias module:@aeternity/aepp-sdk/es/ae/aens
263
265
  * @param {String} name
264
266
  * @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)
267
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
268
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
267
269
  * @param {Number|String|BigNumber} [options.fee] fee
268
270
  * @param {Number|String|BigNumber} [options.ttl] ttl
269
271
  * @param {Number|String|BigNumber} [options.nonce] nonce
@@ -282,15 +284,16 @@ async function claim (name, salt, options) {
282
284
  */
283
285
  async function preclaim (name, options = {}) {
284
286
  ensureNameValid(name)
285
- const opt = R.merge(this.Ae.defaults, options)
287
+ const opt = { ...this.Ae.defaults, ...options }
286
288
  const _salt = salt()
287
289
  const height = await this.height()
288
290
  const commitmentId = commitmentHash(name, _salt)
289
291
 
290
- const preclaimTx = await this.namePreclaimTx(R.merge(opt, {
292
+ const preclaimTx = await this.namePreclaimTx({
293
+ ...opt,
291
294
  accountId: await this.address(opt),
292
295
  commitmentId
293
- }))
296
+ })
294
297
 
295
298
  const result = await this.send(preclaimTx, opt)
296
299
 
@@ -312,8 +315,8 @@ async function preclaim (name, options = {}) {
312
315
  * @param {String} name Domain name
313
316
  * @param {String|Number} nameFee Name fee (bid fee)
314
317
  * @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)
318
+ * @param {String|Object} [options.onAccount] Make operation on specific account from sdk (you pass
319
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
317
320
  * @param {Number|String|BigNumber} [options.fee] fee
318
321
  * @param {Number|String|BigNumber} [options.ttl] ttl
319
322
  * @param {Number|String|BigNumber} [options.nonce] nonce