@aeternity/aepp-sdk 11.0.1 → 12.1.1

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 (444) hide show
  1. package/LICENSE +1 -1
  2. package/dist/aepp-sdk.browser-script.js +1 -1
  3. package/dist/aepp-sdk.browser-script.js.LICENSE.txt +0 -22
  4. package/dist/aepp-sdk.browser-script.js.map +1 -1
  5. package/dist/aepp-sdk.browser.js +2 -1
  6. package/dist/aepp-sdk.browser.js.LICENSE.txt +1 -0
  7. package/dist/aepp-sdk.browser.js.map +1 -1
  8. package/dist/aepp-sdk.js +20765 -1
  9. package/dist/aepp-sdk.js.map +1 -1
  10. package/es/AeSdk.d.ts +37 -0
  11. package/es/AeSdk.mjs +81 -0
  12. package/es/AeSdk.mjs.map +1 -0
  13. package/es/AeSdkAepp.d.ts +70 -0
  14. package/es/AeSdkAepp.mjs +176 -0
  15. package/es/AeSdkAepp.mjs.map +1 -0
  16. package/es/AeSdkBase.d.ts +213 -0
  17. package/es/AeSdkBase.mjs +314 -0
  18. package/es/AeSdkBase.mjs.map +1 -0
  19. package/es/AeSdkWallet.d.ts +104 -0
  20. package/es/AeSdkWallet.mjs +326 -0
  21. package/es/AeSdkWallet.mjs.map +1 -0
  22. package/es/Node.d.ts +41 -0
  23. package/es/Node.mjs +147 -0
  24. package/es/Node.mjs.map +1 -0
  25. package/es/account/Base.d.ts +68 -0
  26. package/es/account/Base.mjs +123 -0
  27. package/es/account/Base.mjs.map +1 -0
  28. package/es/account/Memory.d.ts +26 -0
  29. package/es/account/Memory.mjs +103 -0
  30. package/es/account/Memory.mjs.map +1 -0
  31. package/es/account/Rpc.d.ts +27 -0
  32. package/es/account/Rpc.mjs +80 -0
  33. package/es/account/Rpc.mjs.map +1 -0
  34. package/es/aens.d.ts +222 -0
  35. package/es/aens.mjs +338 -0
  36. package/es/aens.mjs.map +1 -0
  37. package/es/aepp-wallet-communication/connection/Browser.d.ts +33 -0
  38. package/es/aepp-wallet-communication/connection/Browser.mjs +73 -0
  39. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -0
  40. package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +18 -0
  41. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +58 -0
  42. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -0
  43. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +36 -0
  44. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +146 -0
  45. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -0
  46. package/es/aepp-wallet-communication/connection-proxy.d.ts +11 -0
  47. package/{src/utils/crypto-ts.ts → es/aepp-wallet-communication/connection-proxy.mjs} +16 -11
  48. package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -0
  49. package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +34 -0
  50. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +169 -0
  51. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -0
  52. package/es/aepp-wallet-communication/rpc/types.d.ts +77 -0
  53. package/es/aepp-wallet-communication/rpc/types.mjs +3 -0
  54. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -0
  55. package/es/aepp-wallet-communication/schema.d.ts +105 -46
  56. package/es/aepp-wallet-communication/schema.mjs +251 -0
  57. package/es/aepp-wallet-communication/schema.mjs.map +1 -0
  58. package/es/aepp-wallet-communication/wallet-detector.d.ts +25 -0
  59. package/es/aepp-wallet-communication/wallet-detector.mjs +62 -0
  60. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -0
  61. package/es/apis/compiler/compiler.d.ts +92 -0
  62. package/es/apis/compiler/compiler.mjs +576 -0
  63. package/es/apis/compiler/compiler.mjs.map +1 -0
  64. package/es/apis/compiler/index.d.ts +2 -0
  65. package/es/apis/compiler/index.mjs +3 -0
  66. package/es/apis/compiler/index.mjs.map +1 -0
  67. package/es/apis/compiler/models/index.d.ts +248 -0
  68. package/es/apis/compiler/models/index.mjs +48 -0
  69. package/es/apis/compiler/models/index.mjs.map +1 -0
  70. package/es/apis/compiler/models/mappers.d.ts +23 -0
  71. package/es/apis/compiler/models/mappers.mjs +585 -0
  72. package/es/apis/compiler/models/mappers.mjs.map +1 -0
  73. package/es/apis/compiler/models/parameters.d.ts +13 -0
  74. package/es/apis/compiler/models/parameters.mjs +71 -0
  75. package/es/apis/compiler/models/parameters.mjs.map +1 -0
  76. package/es/apis/node/index.d.ts +2 -0
  77. package/es/apis/node/index.mjs +3 -0
  78. package/es/apis/node/index.mjs.map +1 -0
  79. package/es/apis/node/models/index.d.ts +1065 -0
  80. package/es/apis/node/models/index.mjs +2 -0
  81. package/es/apis/node/models/index.mjs.map +1 -0
  82. package/es/apis/node/models/mappers.d.ts +95 -0
  83. package/es/apis/node/models/mappers.mjs +4166 -0
  84. package/es/apis/node/models/mappers.mjs.map +1 -0
  85. package/es/apis/node/models/parameters.d.ts +17 -0
  86. package/es/apis/node/models/parameters.mjs +165 -0
  87. package/es/apis/node/models/parameters.mjs.map +1 -0
  88. package/es/apis/node/node.d.ts +215 -0
  89. package/es/apis/node/node.mjs +1165 -0
  90. package/es/apis/node/node.mjs.map +1 -0
  91. package/es/chain.d.ts +248 -0
  92. package/es/chain.mjs +560 -0
  93. package/es/chain.mjs.map +1 -0
  94. package/es/channel/handlers.d.ts +34 -0
  95. package/es/channel/handlers.mjs +164 -131
  96. package/es/channel/handlers.mjs.map +1 -1
  97. package/es/channel/index.d.ts +625 -0
  98. package/es/channel/index.mjs +897 -902
  99. package/es/channel/index.mjs.map +1 -1
  100. package/es/channel/internal.d.ts +101 -0
  101. package/es/channel/internal.mjs +136 -85
  102. package/es/channel/internal.mjs.map +1 -1
  103. package/es/contract/Compiler.d.ts +18 -0
  104. package/es/contract/Compiler.mjs +68 -0
  105. package/es/contract/Compiler.mjs.map +1 -0
  106. package/es/contract/aci.d.ts +127 -0
  107. package/es/contract/aci.mjs +225 -193
  108. package/es/contract/aci.mjs.map +1 -1
  109. package/es/contract/ga.d.ts +69 -0
  110. package/es/contract/ga.mjs +195 -0
  111. package/es/contract/ga.mjs.map +1 -0
  112. package/es/contract/methods.d.ts +71 -0
  113. package/es/contract/methods.mjs +104 -0
  114. package/es/contract/methods.mjs.map +1 -0
  115. package/es/deprecated/index.d.ts +143 -0
  116. package/es/deprecated/index.mjs +162 -0
  117. package/es/deprecated/index.mjs.map +1 -0
  118. package/es/deprecated/methods.d.ts +18 -0
  119. package/es/deprecated/methods.mjs +26 -0
  120. package/es/deprecated/methods.mjs.map +1 -0
  121. package/es/index.d.ts +35 -0
  122. package/es/index.mjs +35 -40
  123. package/es/index.mjs.map +1 -1
  124. package/es/oracle.d.ts +161 -0
  125. package/es/oracle.mjs +306 -0
  126. package/es/oracle.mjs.map +1 -0
  127. package/es/spend.d.ts +62 -0
  128. package/es/spend.mjs +111 -0
  129. package/es/spend.mjs.map +1 -0
  130. package/es/tx/builder/address.d.ts +25 -0
  131. package/es/tx/builder/address.mjs +45 -0
  132. package/es/tx/builder/address.mjs.map +1 -0
  133. package/es/tx/builder/constants.d.ts +70 -0
  134. package/es/tx/builder/constants.mjs +61 -47
  135. package/es/tx/builder/constants.mjs.map +1 -1
  136. package/es/tx/builder/field-types/coin-amount.d.ts +13 -0
  137. package/es/tx/builder/field-types/coin-amount.mjs +26 -0
  138. package/es/tx/builder/field-types/coin-amount.mjs.map +1 -0
  139. package/es/tx/builder/field-types/deposit.d.ts +15 -0
  140. package/es/tx/builder/field-types/deposit.mjs +19 -0
  141. package/es/tx/builder/field-types/deposit.mjs.map +1 -0
  142. package/es/tx/builder/field-types/fee.d.ts +25 -0
  143. package/es/tx/builder/field-types/fee.mjs +150 -0
  144. package/es/tx/builder/field-types/fee.mjs.map +1 -0
  145. package/es/tx/builder/field-types/field.d.ts +6 -0
  146. package/es/tx/builder/field-types/field.mjs +15 -0
  147. package/es/tx/builder/field-types/field.mjs.map +1 -0
  148. package/es/tx/builder/field-types/gas-limit.d.ts +12 -0
  149. package/es/tx/builder/field-types/gas-limit.mjs +33 -0
  150. package/es/tx/builder/field-types/gas-limit.mjs.map +1 -0
  151. package/es/tx/builder/field-types/gas-price.d.ts +8 -0
  152. package/es/tx/builder/field-types/gas-price.mjs +18 -0
  153. package/es/tx/builder/field-types/gas-price.mjs.map +1 -0
  154. package/es/tx/builder/field-types/index.d.ts +70 -0
  155. package/es/tx/builder/field-types/index.mjs +25 -0
  156. package/es/tx/builder/field-types/index.mjs.map +1 -0
  157. package/es/tx/builder/field-types/name-fee.d.ts +20 -0
  158. package/es/tx/builder/field-types/name-fee.mjs +24 -0
  159. package/es/tx/builder/field-types/name-fee.mjs.map +1 -0
  160. package/es/tx/builder/field-types/name-id.d.ts +14 -0
  161. package/es/tx/builder/field-types/name-id.mjs +19 -0
  162. package/es/tx/builder/field-types/name-id.mjs.map +1 -0
  163. package/es/tx/builder/field-types/name.d.ts +13 -0
  164. package/es/tx/builder/field-types/name.mjs +18 -0
  165. package/es/tx/builder/field-types/name.mjs.map +1 -0
  166. package/es/tx/builder/field-types/short-u-int.d.ts +6 -0
  167. package/es/tx/builder/field-types/short-u-int.mjs +12 -0
  168. package/es/tx/builder/field-types/short-u-int.mjs.map +1 -0
  169. package/es/tx/builder/field-types/u-int.d.ts +8 -0
  170. package/es/tx/builder/field-types/u-int.mjs +14 -0
  171. package/es/tx/builder/field-types/u-int.mjs.map +1 -0
  172. package/es/tx/builder/helpers.d.ts +125 -0
  173. package/es/tx/builder/helpers.mjs +94 -198
  174. package/es/tx/builder/helpers.mjs.map +1 -1
  175. package/es/tx/builder/index.d.ts +88 -0
  176. package/es/tx/builder/index.mjs +167 -358
  177. package/es/tx/builder/index.mjs.map +1 -1
  178. package/es/tx/builder/schema.d.ts +1201 -0
  179. package/es/tx/builder/schema.mjs +175 -561
  180. package/es/tx/builder/schema.mjs.map +1 -1
  181. package/es/tx/index.d.ts +64 -0
  182. package/es/tx/index.mjs +151 -265
  183. package/es/tx/index.mjs.map +1 -1
  184. package/es/tx/validator.d.ts +20 -0
  185. package/es/tx/validator.mjs +104 -124
  186. package/es/tx/validator.mjs.map +1 -1
  187. package/es/typings/@aeternity__argon2-browser/index.d.mjs +2 -0
  188. package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +1 -0
  189. package/es/typings/@aeternity__uuid/index.d.mjs +2 -0
  190. package/es/typings/@aeternity__uuid/index.d.mjs.map +1 -0
  191. package/es/typings/bip32-path/index.d.mjs +2 -0
  192. package/es/typings/bip32-path/index.d.mjs.map +1 -0
  193. package/es/typings/blakejs/index.d.mjs.map +1 -1
  194. package/es/typings/sha-js/index.d.mjs +2 -0
  195. package/es/typings/sha-js/index.d.mjs.map +1 -0
  196. package/es/typings/tweetnacl-auth/index.d.mjs +2 -0
  197. package/es/typings/tweetnacl-auth/index.d.mjs.map +1 -0
  198. package/es/utils/amount-formatter.d.ts +42 -0
  199. package/es/utils/amount-formatter.mjs +36 -49
  200. package/es/utils/amount-formatter.mjs.map +1 -1
  201. package/es/utils/autorest.d.ts +6 -0
  202. package/es/utils/autorest.mjs +97 -0
  203. package/es/utils/autorest.mjs.map +1 -0
  204. package/es/utils/bignumber.d.ts +13 -0
  205. package/es/utils/bignumber.mjs +11 -8
  206. package/es/utils/bignumber.mjs.map +1 -1
  207. package/es/{bytes.d.ts → utils/bytes.d.ts} +10 -13
  208. package/es/utils/bytes.mjs +11 -15
  209. package/es/utils/bytes.mjs.map +1 -1
  210. package/es/utils/crypto.d.ts +88 -0
  211. package/es/utils/crypto.mjs +64 -98
  212. package/es/utils/crypto.mjs.map +1 -1
  213. package/es/utils/encoder-types.d.ts +61 -0
  214. package/es/utils/encoder-types.mjs +36 -0
  215. package/es/utils/encoder-types.mjs.map +1 -0
  216. package/es/utils/encoder.d.ts +25 -0
  217. package/es/utils/encoder.mjs +71 -59
  218. package/es/utils/encoder.mjs.map +1 -1
  219. package/es/{errors.d.ts → utils/errors.d.ts} +246 -59
  220. package/es/utils/errors.mjs +313 -136
  221. package/es/utils/errors.mjs.map +1 -1
  222. package/es/utils/hd-wallet.d.ts +50 -0
  223. package/es/utils/hd-wallet.mjs +86 -45
  224. package/es/utils/hd-wallet.mjs.map +1 -1
  225. package/es/utils/json-big.d.ts +5 -0
  226. package/es/utils/json-big.mjs +12 -16
  227. package/es/utils/json-big.mjs.map +1 -1
  228. package/es/utils/keystore.d.ts +51 -0
  229. package/es/utils/keystore.mjs +101 -194
  230. package/es/utils/keystore.mjs.map +1 -1
  231. package/es/{mptree.d.ts → utils/mptree.d.ts} +6 -9
  232. package/es/utils/mptree.mjs +22 -18
  233. package/es/utils/mptree.mjs.map +1 -1
  234. package/es/utils/other.d.ts +20 -0
  235. package/es/utils/other.mjs +32 -35
  236. package/es/utils/other.mjs.map +1 -1
  237. package/es/utils/semver-satisfies.d.ts +1 -0
  238. package/es/utils/semver-satisfies.mjs +2 -2
  239. package/es/utils/semver-satisfies.mjs.map +1 -1
  240. package/es/utils/string.d.ts +24 -0
  241. package/es/utils/string.mjs +8 -10
  242. package/es/utils/string.mjs.map +1 -1
  243. package/package.json +55 -43
  244. package/src/AeSdk.ts +68 -0
  245. package/src/AeSdkAepp.ts +176 -0
  246. package/src/AeSdkBase.ts +338 -0
  247. package/src/AeSdkWallet.ts +348 -0
  248. package/src/Node.ts +173 -0
  249. package/src/account/Base.ts +124 -0
  250. package/src/account/Memory.ts +98 -0
  251. package/src/account/Rpc.ts +69 -0
  252. package/src/aens.ts +407 -0
  253. package/src/aepp-wallet-communication/connection/Browser.ts +71 -0
  254. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +59 -0
  255. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +122 -0
  256. package/{es/utils/crypto-ts.mjs → src/aepp-wallet-communication/connection-proxy.ts} +18 -18
  257. package/src/aepp-wallet-communication/rpc/RpcClient.ts +143 -0
  258. package/src/aepp-wallet-communication/rpc/types.ts +66 -0
  259. package/src/aepp-wallet-communication/schema.ts +224 -0
  260. package/src/aepp-wallet-communication/wallet-detector.ts +72 -0
  261. package/src/apis/compiler/code-model-v4.yaml +2649 -0
  262. package/src/apis/compiler/compiler.ts +585 -0
  263. package/src/apis/compiler/index.ts +2 -0
  264. package/src/apis/compiler/models/index.ts +301 -0
  265. package/src/apis/compiler/models/mappers.ts +583 -0
  266. package/src/apis/compiler/models/parameters.ts +93 -0
  267. package/src/apis/node/code-model-v4.yaml +10080 -0
  268. package/src/apis/node/index.ts +2 -0
  269. package/src/apis/node/models/index.ts +1257 -0
  270. package/src/apis/node/models/mappers.ts +4280 -0
  271. package/src/apis/node/models/parameters.ts +188 -0
  272. package/src/apis/node/node.ts +1299 -0
  273. package/src/chain.ts +502 -0
  274. package/src/channel/handlers.ts +817 -0
  275. package/src/channel/index.ts +1025 -0
  276. package/src/channel/internal.ts +361 -0
  277. package/src/contract/Compiler.ts +67 -0
  278. package/src/contract/aci.ts +538 -0
  279. package/src/contract/ga.ts +199 -0
  280. package/src/contract/methods.ts +123 -0
  281. package/src/deprecated/index.ts +172 -0
  282. package/src/deprecated/methods.ts +25 -0
  283. package/src/index.ts +56 -0
  284. package/src/oracle.ts +364 -0
  285. package/src/spend.ts +164 -0
  286. package/src/tx/builder/address.ts +50 -0
  287. package/src/tx/builder/constants.ts +126 -0
  288. package/src/tx/builder/field-types/coin-amount.ts +27 -0
  289. package/src/tx/builder/field-types/deposit.ts +21 -0
  290. package/src/tx/builder/field-types/fee.ts +143 -0
  291. package/src/tx/builder/field-types/field.ts +9 -0
  292. package/src/tx/builder/field-types/gas-limit.ts +41 -0
  293. package/src/tx/builder/field-types/gas-price.ts +16 -0
  294. package/src/tx/builder/field-types/index.ts +45 -0
  295. package/src/tx/builder/field-types/name-fee.ts +32 -0
  296. package/src/tx/builder/field-types/name-id.ts +20 -0
  297. package/src/tx/builder/field-types/name.ts +18 -0
  298. package/src/tx/builder/field-types/short-u-int.ts +11 -0
  299. package/src/tx/builder/field-types/u-int.ts +16 -0
  300. package/src/tx/builder/helpers.ts +248 -0
  301. package/src/tx/builder/index.ts +400 -0
  302. package/src/tx/builder/schema.ts +727 -0
  303. package/src/tx/index.ts +192 -0
  304. package/src/tx/validator.ts +230 -0
  305. package/src/typings/@aeternity__argon2-browser/index.d.ts +3 -0
  306. package/src/typings/@aeternity__uuid/index.d.ts +5 -0
  307. package/src/typings/bip32-path/index.d.ts +33 -0
  308. package/src/typings/blakejs/index.d.ts +4 -32
  309. package/src/typings/sha-js/index.d.ts +5 -0
  310. package/src/typings/tweetnacl-auth/index.d.ts +14 -0
  311. package/src/utils/amount-formatter.ts +56 -69
  312. package/src/utils/autorest.ts +93 -0
  313. package/src/utils/bignumber.ts +11 -12
  314. package/src/utils/bytes.ts +29 -31
  315. package/src/utils/crypto.ts +205 -0
  316. package/src/utils/encoder-types.ts +63 -0
  317. package/src/utils/encoder.ts +116 -71
  318. package/src/utils/errors.ts +482 -366
  319. package/src/utils/hd-wallet.ts +166 -0
  320. package/src/utils/json-big.ts +27 -0
  321. package/src/utils/keystore.ts +182 -0
  322. package/src/utils/mptree.ts +64 -61
  323. package/src/utils/other.ts +34 -41
  324. package/src/utils/semver-satisfies.ts +15 -11
  325. package/src/utils/string.ts +18 -20
  326. package/es/account/base.mjs +0 -179
  327. package/es/account/base.mjs.map +0 -1
  328. package/es/account/memory.mjs +0 -99
  329. package/es/account/memory.mjs.map +0 -1
  330. package/es/account/multiple.mjs +0 -179
  331. package/es/account/multiple.mjs.map +0 -1
  332. package/es/ae/aens.mjs +0 -404
  333. package/es/ae/aens.mjs.map +0 -1
  334. package/es/ae/aepp.mjs +0 -45
  335. package/es/ae/aepp.mjs.map +0 -1
  336. package/es/ae/contract.mjs +0 -159
  337. package/es/ae/contract.mjs.map +0 -1
  338. package/es/ae/index.mjs +0 -207
  339. package/es/ae/index.mjs.map +0 -1
  340. package/es/ae/oracle.mjs +0 -339
  341. package/es/ae/oracle.mjs.map +0 -1
  342. package/es/ae/universal.mjs +0 -45
  343. package/es/ae/universal.mjs.map +0 -1
  344. package/es/ae/wallet.mjs +0 -50
  345. package/es/ae/wallet.mjs.map +0 -1
  346. package/es/amount-formatter.d.ts +0 -58
  347. package/es/bignumber.d.ts +0 -18
  348. package/es/chain/index.mjs +0 -272
  349. package/es/chain/index.mjs.map +0 -1
  350. package/es/chain/node.mjs +0 -442
  351. package/es/chain/node.mjs.map +0 -1
  352. package/es/contract/compiler.mjs +0 -115
  353. package/es/contract/compiler.mjs.map +0 -1
  354. package/es/contract/ga/helpers.mjs +0 -30
  355. package/es/contract/ga/helpers.mjs.map +0 -1
  356. package/es/contract/ga/index.mjs +0 -178
  357. package/es/contract/ga/index.mjs.map +0 -1
  358. package/es/crypto-ts.d.ts +0 -9
  359. package/es/encoder.d.ts +0 -26
  360. package/es/node-pool/index.mjs +0 -188
  361. package/es/node-pool/index.mjs.map +0 -1
  362. package/es/node.mjs +0 -133
  363. package/es/node.mjs.map +0 -1
  364. package/es/other.d.ts +0 -31
  365. package/es/semver-satisfies.d.ts +0 -1
  366. package/es/string.d.ts +0 -26
  367. package/es/tx/builder/field-types.mjs +0 -74
  368. package/es/tx/builder/field-types.mjs.map +0 -1
  369. package/es/tx/tx-object.mjs +0 -283
  370. package/es/tx/tx-object.mjs.map +0 -1
  371. package/es/tx/tx.mjs +0 -938
  372. package/es/tx/tx.mjs.map +0 -1
  373. package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs +0 -132
  374. package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs.map +0 -1
  375. package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs +0 -183
  376. package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs.map +0 -1
  377. package/es/utils/aepp-wallet-communication/connection/index.mjs +0 -87
  378. package/es/utils/aepp-wallet-communication/connection/index.mjs.map +0 -1
  379. package/es/utils/aepp-wallet-communication/content-script-bridge.mjs +0 -98
  380. package/es/utils/aepp-wallet-communication/content-script-bridge.mjs.map +0 -1
  381. package/es/utils/aepp-wallet-communication/helpers.mjs +0 -92
  382. package/es/utils/aepp-wallet-communication/helpers.mjs.map +0 -1
  383. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs +0 -375
  384. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs.map +0 -1
  385. package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs +0 -275
  386. package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs.map +0 -1
  387. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs +0 -541
  388. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs.map +0 -1
  389. package/es/utils/aepp-wallet-communication/schema.mjs +0 -102
  390. package/es/utils/aepp-wallet-communication/schema.mjs.map +0 -1
  391. package/es/utils/aepp-wallet-communication/wallet-detector.mjs +0 -110
  392. package/es/utils/aepp-wallet-communication/wallet-detector.mjs.map +0 -1
  393. package/es/utils/async-init.mjs +0 -64
  394. package/es/utils/async-init.mjs.map +0 -1
  395. package/es/utils/crypto-ts.mjs.map +0 -1
  396. package/es/utils/swagger.mjs +0 -164
  397. package/es/utils/swagger.mjs.map +0 -1
  398. package/src/account/base.js +0 -153
  399. package/src/account/memory.js +0 -83
  400. package/src/account/multiple.js +0 -162
  401. package/src/ae/aens.js +0 -361
  402. package/src/ae/aepp.js +0 -45
  403. package/src/ae/contract.js +0 -148
  404. package/src/ae/index.js +0 -168
  405. package/src/ae/oracle.js +0 -311
  406. package/src/ae/universal.js +0 -47
  407. package/src/ae/wallet.js +0 -50
  408. package/src/chain/index.js +0 -269
  409. package/src/chain/node.js +0 -320
  410. package/src/channel/handlers.js +0 -673
  411. package/src/channel/index.js +0 -903
  412. package/src/channel/internal.js +0 -236
  413. package/src/contract/aci.js +0 -376
  414. package/src/contract/compiler.js +0 -100
  415. package/src/contract/ga/helpers.js +0 -19
  416. package/src/contract/ga/index.js +0 -150
  417. package/src/index.js +0 -89
  418. package/src/node-pool/index.js +0 -172
  419. package/src/node.js +0 -116
  420. package/src/tx/builder/constants.js +0 -100
  421. package/src/tx/builder/field-types.js +0 -61
  422. package/src/tx/builder/helpers.js +0 -334
  423. package/src/tx/builder/index.js +0 -465
  424. package/src/tx/builder/schema.js +0 -1100
  425. package/src/tx/index.js +0 -301
  426. package/src/tx/tx-object.js +0 -187
  427. package/src/tx/tx.js +0 -631
  428. package/src/tx/validator.js +0 -181
  429. package/src/utils/aepp-wallet-communication/connection/browser-runtime.js +0 -119
  430. package/src/utils/aepp-wallet-communication/connection/browser-window-message.js +0 -165
  431. package/src/utils/aepp-wallet-communication/connection/index.js +0 -85
  432. package/src/utils/aepp-wallet-communication/content-script-bridge.js +0 -86
  433. package/src/utils/aepp-wallet-communication/helpers.js +0 -60
  434. package/src/utils/aepp-wallet-communication/rpc/aepp-rpc.js +0 -294
  435. package/src/utils/aepp-wallet-communication/rpc/rpc-client.js +0 -232
  436. package/src/utils/aepp-wallet-communication/rpc/wallet-rpc.js +0 -401
  437. package/src/utils/aepp-wallet-communication/schema.ts +0 -80
  438. package/src/utils/aepp-wallet-communication/wallet-detector.js +0 -92
  439. package/src/utils/async-init.js +0 -45
  440. package/src/utils/crypto.js +0 -219
  441. package/src/utils/hd-wallet.js +0 -100
  442. package/src/utils/json-big.js +0 -26
  443. package/src/utils/keystore.js +0 -219
  444. package/src/utils/swagger.js +0 -156
@@ -0,0 +1,123 @@
1
+ import _buffer from "buffer";
2
+ const {
3
+ Buffer: _Buffer
4
+ } = _buffer;
5
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
6
+
7
+ /*
8
+ * ISC License (ISC)
9
+ * Copyright (c) 2022 aeternity developers
10
+ *
11
+ * Permission to use, copy, modify, and/or distribute this software for any
12
+ * purpose with or without fee is hereby granted, provided that the above
13
+ * copyright notice and this permission notice appear in all copies.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
16
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
17
+ * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
18
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
19
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
+ * PERFORMANCE OF THIS SOFTWARE.
22
+ */
23
+ import { messageToHash, verifyMessage as verifyMessageCrypto, hash } from "../utils/crypto.mjs";
24
+ import { buildTx } from "../tx/builder/index.mjs";
25
+ import { decode } from "../utils/encoder.mjs";
26
+ import { Tag } from "../tx/builder/constants.mjs";
27
+ import { getNetworkId } from "../Node.mjs";
28
+ import { concatBuffers } from "../utils/other.mjs";
29
+
30
+ /**
31
+ * Check is provided object looks like an instance of AccountBase
32
+ * @param acc - Object to check
33
+ */
34
+ export const isAccountBase = acc => !['sign', 'address', 'signTransaction', 'signMessage'].some(f => typeof acc[f] !== 'function');
35
+ /**
36
+ * Account is one of the three basic building blocks of an
37
+ * {@link AeSdk} and provides access to a signing key pair.
38
+ */
39
+
40
+ export default class AccountBase {
41
+ /**
42
+ * @param options - Options
43
+ * @param options.networkId - Using for signing transactions
44
+ */
45
+ constructor() {
46
+ var _this$networkId;
47
+
48
+ let {
49
+ networkId
50
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
51
+
52
+ _defineProperty(this, "getNetworkId", getNetworkId);
53
+
54
+ (_this$networkId = this.networkId) !== null && _this$networkId !== void 0 ? _this$networkId : this.networkId = networkId;
55
+ }
56
+ /**
57
+ * Sign encoded transaction
58
+ * @param tx - Transaction to sign
59
+ * @param opt - Options
60
+ * @param opt.innerTx - Sign as inner transaction for PayingFor
61
+ * @returns Signed transaction
62
+ */
63
+
64
+
65
+ async signTransaction(tx) {
66
+ let {
67
+ innerTx,
68
+ networkId,
69
+ ...options
70
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
71
+ const prefixes = [await this.getNetworkId({
72
+ networkId
73
+ })];
74
+ if (innerTx === true) prefixes.push('inner_tx');
75
+ const rlpBinaryTx = decode(tx);
76
+ const txWithNetworkId = concatBuffers([_Buffer.from(prefixes.join('-')), hash(rlpBinaryTx)]);
77
+ const signatures = [await this.sign(txWithNetworkId, options)];
78
+ return buildTx({
79
+ encodedTx: rlpBinaryTx,
80
+ signatures
81
+ }, Tag.SignedTx).tx;
82
+ }
83
+ /**
84
+ * Get network Id
85
+ * @returns Network Id
86
+ */
87
+
88
+
89
+ /**
90
+ * Sign message
91
+ * @param message - Message to sign
92
+ * @param opt - Options
93
+ * @returns Signature as hex string of Uint8Array
94
+ */
95
+ async signMessage(message) {
96
+ let {
97
+ returnHex = false,
98
+ ...options
99
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
100
+ const sig = await this.sign(messageToHash(message), options);
101
+ return returnHex ? _Buffer.from(sig).toString('hex') : sig;
102
+ }
103
+ /**
104
+ * Verify message
105
+ * @param message - Message to verify
106
+ * @param signature - Signature
107
+ * @param options - Options
108
+ */
109
+
110
+
111
+ async verifyMessage(message, signature, options) {
112
+ return verifyMessageCrypto(message, typeof signature === 'string' ? _Buffer.from(signature, 'hex') : signature, decode(await this.address(options)));
113
+ }
114
+ /**
115
+ * Sign data blob
116
+ * @param data - Data blob to sign
117
+ * @param options - Options
118
+ * @returns Signed data blob
119
+ */
120
+
121
+
122
+ }
123
+ //# sourceMappingURL=Base.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Base.mjs","names":["messageToHash","verifyMessage","verifyMessageCrypto","hash","buildTx","decode","Tag","getNetworkId","concatBuffers","isAccountBase","acc","some","f","AccountBase","constructor","networkId","signTransaction","tx","innerTx","options","prefixes","push","rlpBinaryTx","txWithNetworkId","from","join","signatures","sign","encodedTx","SignedTx","signMessage","message","returnHex","sig","toString","signature","address"],"sources":["../../src/account/Base.ts"],"sourcesContent":["/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport { messageToHash, verifyMessage as verifyMessageCrypto, hash } from '../utils/crypto';\nimport { buildTx } from '../tx/builder';\nimport { decode, Encoded } from '../utils/encoder';\nimport { Tag } from '../tx/builder/constants';\nimport { getNetworkId } from '../Node';\nimport { concatBuffers } from '../utils/other';\nimport type { createMetaTx } from '../contract/ga';\n\n/**\n * Check is provided object looks like an instance of AccountBase\n * @param acc - Object to check\n */\nexport const isAccountBase = (acc: AccountBase | any): boolean => (\n !['sign', 'address', 'signTransaction', 'signMessage'].some((f) => typeof acc[f] !== 'function')\n);\n\n/**\n * Account is one of the three basic building blocks of an\n * {@link AeSdk} and provides access to a signing key pair.\n */\nexport default abstract class AccountBase {\n networkId?: string;\n\n /**\n * @param options - Options\n * @param options.networkId - Using for signing transactions\n */\n constructor({ networkId }: { networkId?: string } = {}) {\n this.networkId ??= networkId;\n }\n\n /**\n * Sign encoded transaction\n * @param tx - Transaction to sign\n * @param opt - Options\n * @param opt.innerTx - Sign as inner transaction for PayingFor\n * @returns Signed transaction\n */\n async signTransaction(\n tx: Encoded.Transaction,\n { innerTx, networkId, ...options }: {\n innerTx?: boolean;\n networkId?: string;\n authData?: Parameters<typeof createMetaTx>[1];\n authFun?: Parameters<typeof createMetaTx>[2];\n } & Omit<Partial<Parameters<typeof createMetaTx>[3]>, 'onAccount'> = {},\n ): Promise<Encoded.Transaction> {\n const prefixes = [await this.getNetworkId({ networkId })];\n if (innerTx === true) prefixes.push('inner_tx');\n const rlpBinaryTx = decode(tx);\n const txWithNetworkId = concatBuffers([Buffer.from(prefixes.join('-')), hash(rlpBinaryTx)]);\n\n const signatures = [await this.sign(txWithNetworkId, options)];\n return buildTx({ encodedTx: rlpBinaryTx, signatures }, Tag.SignedTx).tx;\n }\n\n /**\n * Get network Id\n * @returns Network Id\n */\n readonly getNetworkId = getNetworkId;\n\n /**\n * Sign message\n * @param message - Message to sign\n * @param opt - Options\n * @returns Signature as hex string of Uint8Array\n */\n async signMessage(\n message: string,\n { returnHex = false, ...options }: { returnHex?: boolean } = {},\n ): Promise<string | Uint8Array> {\n const sig = await this.sign(messageToHash(message), options);\n return returnHex ? Buffer.from(sig).toString('hex') : sig;\n }\n\n /**\n * Verify message\n * @param message - Message to verify\n * @param signature - Signature\n * @param options - Options\n */\n async verifyMessage(\n message: string,\n signature: string | Uint8Array,\n options?: object,\n ): Promise<boolean> {\n return verifyMessageCrypto(\n message,\n typeof signature === 'string' ? Buffer.from(signature, 'hex') : signature,\n decode(await this.address(options)),\n );\n }\n\n /**\n * Sign data blob\n * @param data - Data blob to sign\n * @param options - Options\n * @returns Signed data blob\n */\n abstract sign(data: string | Uint8Array, options?: any): Promise<Uint8Array>;\n\n /**\n * Obtain account address\n * @returns Public account address\n */\n abstract address(opt?: object): Promise<Encoded.AccountAddress>;\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SACSA,a,EAAeC,aAAa,IAAIC,mB,EAAqBC,I;SACrDC,O;SACAC,M;SACAC,G;SACAC,Y;SACAC,a;;AAGT;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAIC,GAAD,IAC3B,CAAC,CAAC,MAAD,EAAS,SAAT,EAAoB,iBAApB,EAAuC,aAAvC,EAAsDC,IAAtD,CAA4DC,CAAD,IAAO,OAAOF,GAAG,CAACE,CAAD,CAAV,KAAkB,UAApF,CADI;AAIP;AACA;AACA;AACA;;AACA,eAAe,MAAeC,WAAf,CAA2B;EAGxC;AACF;AACA;AACA;EACEC,WAAW,GAA6C;IAAA;;IAAA,IAA5C;MAAEC;IAAF,CAA4C,uEAAJ,EAAI;;IAAA,sCAiChCR,YAjCgC;;IACtD,wBAAKQ,SAAL,kEAAKA,SAAL,GAAmBA,SAAnB;EACD;EAED;AACF;AACA;AACA;AACA;AACA;AACA;;;EACuB,MAAfC,eAAe,CACnBC,EADmB,EAQW;IAAA,IAN9B;MAAEC,OAAF;MAAWH,SAAX;MAAsB,GAAGI;IAAzB,CAM8B,uEADuC,EACvC;IAC9B,MAAMC,QAAQ,GAAG,CAAC,MAAM,KAAKb,YAAL,CAAkB;MAAEQ;IAAF,CAAlB,CAAP,CAAjB;IACA,IAAIG,OAAO,KAAK,IAAhB,EAAsBE,QAAQ,CAACC,IAAT,CAAc,UAAd;IACtB,MAAMC,WAAW,GAAGjB,MAAM,CAACY,EAAD,CAA1B;IACA,MAAMM,eAAe,GAAGf,aAAa,CAAC,CAAC,QAAOgB,IAAP,CAAYJ,QAAQ,CAACK,IAAT,CAAc,GAAd,CAAZ,CAAD,EAAkCtB,IAAI,CAACmB,WAAD,CAAtC,CAAD,CAArC;IAEA,MAAMI,UAAU,GAAG,CAAC,MAAM,KAAKC,IAAL,CAAUJ,eAAV,EAA2BJ,OAA3B,CAAP,CAAnB;IACA,OAAOf,OAAO,CAAC;MAAEwB,SAAS,EAAEN,WAAb;MAA0BI;IAA1B,CAAD,EAAyCpB,GAAG,CAACuB,QAA7C,CAAP,CAA8DZ,EAArE;EACD;EAED;AACF;AACA;AACA;;;EAGE;AACF;AACA;AACA;AACA;AACA;EACmB,MAAXa,WAAW,CACfC,OADe,EAGe;IAAA,IAD9B;MAAEC,SAAS,GAAG,KAAd;MAAqB,GAAGb;IAAxB,CAC8B,uEAD+B,EAC/B;IAC9B,MAAMc,GAAG,GAAG,MAAM,KAAKN,IAAL,CAAU3B,aAAa,CAAC+B,OAAD,CAAvB,EAAkCZ,OAAlC,CAAlB;IACA,OAAOa,SAAS,GAAG,QAAOR,IAAP,CAAYS,GAAZ,EAAiBC,QAAjB,CAA0B,KAA1B,CAAH,GAAsCD,GAAtD;EACD;EAED;AACF;AACA;AACA;AACA;AACA;;;EACqB,MAAbhC,aAAa,CACjB8B,OADiB,EAEjBI,SAFiB,EAGjBhB,OAHiB,EAIC;IAClB,OAAOjB,mBAAmB,CACxB6B,OADwB,EAExB,OAAOI,SAAP,KAAqB,QAArB,GAAgC,QAAOX,IAAP,CAAYW,SAAZ,EAAuB,KAAvB,CAAhC,GAAgEA,SAFxC,EAGxB9B,MAAM,CAAC,MAAM,KAAK+B,OAAL,CAAajB,OAAb,CAAP,CAHkB,CAA1B;EAKD;EAED;AACF;AACA;AACA;AACA;AACA;;;AA/E0C"}
@@ -0,0 +1,26 @@
1
+ import AccountBase from './Base';
2
+ import { Encoded } from '../utils/encoder';
3
+ export interface Keypair {
4
+ publicKey: Encoded.AccountAddress;
5
+ secretKey: string | Uint8Array;
6
+ }
7
+ /**
8
+ * In-memory account class
9
+ */
10
+ export default class AccountMemory extends AccountBase {
11
+ isGa: boolean;
12
+ /**
13
+ * @param options - Options
14
+ * @param options.keypair - Key pair to use
15
+ * @param options.keypair.publicKey - Public key
16
+ * @param options.keypair.secretKey - Private key
17
+ * @param options.gaId - Address of generalized account
18
+ */
19
+ constructor({ keypair, gaId, ...options }: {
20
+ keypair?: Keypair;
21
+ gaId?: Encoded.AccountAddress;
22
+ } & ConstructorParameters<typeof AccountBase>[0]);
23
+ sign(data: string | Uint8Array): Promise<Uint8Array>;
24
+ signTransaction(tx: Encoded.Transaction, options?: Parameters<AccountBase['signTransaction']>[1]): Promise<Encoded.Transaction>;
25
+ address(): Promise<Encoded.AccountAddress>;
26
+ }
@@ -0,0 +1,103 @@
1
+ import _buffer from "buffer";
2
+ const {
3
+ Buffer: _Buffer
4
+ } = _buffer;
5
+
6
+ /*
7
+ * ISC License (ISC)
8
+ * Copyright (c) 2018 aeternity developers
9
+ *
10
+ * Permission to use, copy, modify, and/or distribute this software for any
11
+ * purpose with or without fee is hereby granted, provided that the above
12
+ * copyright notice and this permission notice appear in all copies.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
+ * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
+ * PERFORMANCE OF THIS SOFTWARE.
21
+ */
22
+ import AccountBase from "./Base.mjs";
23
+ import { sign, isValidKeypair } from "../utils/crypto.mjs";
24
+ import { isHex } from "../utils/string.mjs";
25
+ import { ArgumentError, InvalidKeypairError, MissingParamError } from "../utils/errors.mjs";
26
+ import { decode } from "../utils/encoder.mjs";
27
+ import { createMetaTx } from "../contract/ga.mjs";
28
+ const secrets = new WeakMap();
29
+
30
+ /**
31
+ * In-memory account class
32
+ */
33
+ export default class AccountMemory extends AccountBase {
34
+ /**
35
+ * @param options - Options
36
+ * @param options.keypair - Key pair to use
37
+ * @param options.keypair.publicKey - Public key
38
+ * @param options.keypair.secretKey - Private key
39
+ * @param options.gaId - Address of generalized account
40
+ */
41
+ constructor(_ref) {
42
+ let {
43
+ keypair,
44
+ gaId,
45
+ ...options
46
+ } = _ref;
47
+ super(options);
48
+ this.isGa = gaId != null;
49
+
50
+ if (this.isGa && gaId != null) {
51
+ decode(gaId);
52
+ secrets.set(this, {
53
+ publicKey: gaId
54
+ });
55
+ return;
56
+ }
57
+
58
+ if (keypair == null) throw new MissingParamError('Either gaId or keypair is required');
59
+ if (!_Buffer.isBuffer(keypair.secretKey) && typeof keypair.secretKey === 'string' && !isHex(keypair.secretKey)) throw new InvalidKeypairError('Secret key must be hex string or Buffer');
60
+ const secretKey = typeof keypair.secretKey === 'string' ? _Buffer.from(keypair.secretKey, 'hex') : keypair.secretKey;
61
+
62
+ if (!isValidKeypair(secretKey, decode(keypair.publicKey))) {
63
+ throw new InvalidKeypairError('Invalid Key Pair');
64
+ }
65
+
66
+ secrets.set(this, {
67
+ secretKey,
68
+ publicKey: keypair.publicKey
69
+ });
70
+ }
71
+
72
+ async sign(data) {
73
+ if (this.isGa) throw new InvalidKeypairError('You are trying to sign data using generalized account without keypair');
74
+ return sign(data, secrets.get(this).secretKey);
75
+ }
76
+
77
+ async signTransaction(tx) {
78
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
79
+ if (!this.isGa || options.innerTx === true) return super.signTransaction(tx, options);
80
+ const {
81
+ authData,
82
+ authFun,
83
+ onCompiler,
84
+ onNode
85
+ } = options;
86
+
87
+ if (authFun == null || authData == null || onCompiler == null || onNode == null) {
88
+ throw new ArgumentError('authData, authFun, onCompiler, onNode', 'provided', null);
89
+ }
90
+
91
+ return createMetaTx(tx, authData, authFun, {
92
+ onCompiler,
93
+ onNode,
94
+ onAccount: this
95
+ });
96
+ }
97
+
98
+ async address() {
99
+ return secrets.get(this).publicKey;
100
+ }
101
+
102
+ }
103
+ //# sourceMappingURL=Memory.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Memory.mjs","names":["AccountBase","sign","isValidKeypair","isHex","ArgumentError","InvalidKeypairError","MissingParamError","decode","createMetaTx","secrets","WeakMap","AccountMemory","constructor","keypair","gaId","options","isGa","set","publicKey","isBuffer","secretKey","from","data","get","signTransaction","tx","innerTx","authData","authFun","onCompiler","onNode","onAccount","address"],"sources":["../../src/account/Memory.ts"],"sourcesContent":["/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport AccountBase from './Base';\nimport { sign, isValidKeypair } from '../utils/crypto';\nimport { isHex } from '../utils/string';\nimport { ArgumentError, InvalidKeypairError, MissingParamError } from '../utils/errors';\nimport { decode, Encoded } from '../utils/encoder';\nimport { createMetaTx } from '../contract/ga';\n\nconst secrets = new WeakMap();\n\nexport interface Keypair {\n publicKey: Encoded.AccountAddress;\n secretKey: string | Uint8Array;\n}\n\n/**\n * In-memory account class\n */\nexport default class AccountMemory extends AccountBase {\n isGa: boolean;\n\n /**\n * @param options - Options\n * @param options.keypair - Key pair to use\n * @param options.keypair.publicKey - Public key\n * @param options.keypair.secretKey - Private key\n * @param options.gaId - Address of generalized account\n */\n constructor(\n { keypair, gaId, ...options }: { keypair?: Keypair; gaId?: Encoded.AccountAddress }\n & ConstructorParameters<typeof AccountBase>[0],\n ) {\n super(options);\n\n this.isGa = gaId != null;\n if (this.isGa && gaId != null) {\n decode(gaId);\n secrets.set(this, { publicKey: gaId });\n return;\n }\n\n if (keypair == null) throw new MissingParamError('Either gaId or keypair is required');\n\n if (\n !Buffer.isBuffer(keypair.secretKey)\n && typeof keypair.secretKey === 'string' && !isHex(keypair.secretKey)\n ) throw new InvalidKeypairError('Secret key must be hex string or Buffer');\n const secretKey = typeof keypair.secretKey === 'string'\n ? Buffer.from(keypair.secretKey, 'hex')\n : keypair.secretKey;\n if (!isValidKeypair(secretKey, decode(keypair.publicKey))) {\n throw new InvalidKeypairError('Invalid Key Pair');\n }\n\n secrets.set(this, {\n secretKey,\n publicKey: keypair.publicKey,\n });\n }\n\n async sign(data: string | Uint8Array): Promise<Uint8Array> {\n if (this.isGa) throw new InvalidKeypairError('You are trying to sign data using generalized account without keypair');\n return sign(data, secrets.get(this).secretKey);\n }\n\n async signTransaction(\n tx: Encoded.Transaction,\n options: Parameters<AccountBase['signTransaction']>[1] = {},\n ): Promise<Encoded.Transaction> {\n if (!this.isGa || options.innerTx === true) return super.signTransaction(tx, options);\n const {\n authData, authFun, onCompiler, onNode,\n } = options;\n if (authFun == null || authData == null || onCompiler == null || onNode == null) {\n throw new ArgumentError('authData, authFun, onCompiler, onNode', 'provided', null);\n }\n return createMetaTx(tx, authData, authFun, { onCompiler, onNode, onAccount: this });\n }\n\n async address(): Promise<Encoded.AccountAddress> {\n return secrets.get(this).publicKey;\n }\n}\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;OACOA,W;SACEC,I,EAAMC,c;SACNC,K;SACAC,a,EAAeC,mB,EAAqBC,iB;SACpCC,M;SACAC,Y;AAET,MAAMC,OAAO,GAAG,IAAIC,OAAJ,EAAhB;;AAOA;AACA;AACA;AACA,eAAe,MAAMC,aAAN,SAA4BX,WAA5B,CAAwC;EAGrD;AACF;AACA;AACA;AACA;AACA;AACA;EACEY,WAAW,OAGT;IAAA,IAFA;MAAEC,OAAF;MAAWC,IAAX;MAAiB,GAAGC;IAApB,CAEA;IACA,MAAMA,OAAN;IAEA,KAAKC,IAAL,GAAYF,IAAI,IAAI,IAApB;;IACA,IAAI,KAAKE,IAAL,IAAaF,IAAI,IAAI,IAAzB,EAA+B;MAC7BP,MAAM,CAACO,IAAD,CAAN;MACAL,OAAO,CAACQ,GAAR,CAAY,IAAZ,EAAkB;QAAEC,SAAS,EAAEJ;MAAb,CAAlB;MACA;IACD;;IAED,IAAID,OAAO,IAAI,IAAf,EAAqB,MAAM,IAAIP,iBAAJ,CAAsB,oCAAtB,CAAN;IAErB,IACE,CAAC,QAAOa,QAAP,CAAgBN,OAAO,CAACO,SAAxB,CAAD,IACG,OAAOP,OAAO,CAACO,SAAf,KAA6B,QADhC,IAC4C,CAACjB,KAAK,CAACU,OAAO,CAACO,SAAT,CAFpD,EAGE,MAAM,IAAIf,mBAAJ,CAAwB,yCAAxB,CAAN;IACF,MAAMe,SAAS,GAAG,OAAOP,OAAO,CAACO,SAAf,KAA6B,QAA7B,GACd,QAAOC,IAAP,CAAYR,OAAO,CAACO,SAApB,EAA+B,KAA/B,CADc,GAEdP,OAAO,CAACO,SAFZ;;IAGA,IAAI,CAAClB,cAAc,CAACkB,SAAD,EAAYb,MAAM,CAACM,OAAO,CAACK,SAAT,CAAlB,CAAnB,EAA2D;MACzD,MAAM,IAAIb,mBAAJ,CAAwB,kBAAxB,CAAN;IACD;;IAEDI,OAAO,CAACQ,GAAR,CAAY,IAAZ,EAAkB;MAChBG,SADgB;MAEhBF,SAAS,EAAEL,OAAO,CAACK;IAFH,CAAlB;EAID;;EAES,MAAJjB,IAAI,CAACqB,IAAD,EAAiD;IACzD,IAAI,KAAKN,IAAT,EAAe,MAAM,IAAIX,mBAAJ,CAAwB,uEAAxB,CAAN;IACf,OAAOJ,IAAI,CAACqB,IAAD,EAAOb,OAAO,CAACc,GAAR,CAAY,IAAZ,EAAkBH,SAAzB,CAAX;EACD;;EAEoB,MAAfI,eAAe,CACnBC,EADmB,EAGW;IAAA,IAD9BV,OAC8B,uEAD2B,EAC3B;IAC9B,IAAI,CAAC,KAAKC,IAAN,IAAcD,OAAO,CAACW,OAAR,KAAoB,IAAtC,EAA4C,OAAO,MAAMF,eAAN,CAAsBC,EAAtB,EAA0BV,OAA1B,CAAP;IAC5C,MAAM;MACJY,QADI;MACMC,OADN;MACeC,UADf;MAC2BC;IAD3B,IAEFf,OAFJ;;IAGA,IAAIa,OAAO,IAAI,IAAX,IAAmBD,QAAQ,IAAI,IAA/B,IAAuCE,UAAU,IAAI,IAArD,IAA6DC,MAAM,IAAI,IAA3E,EAAiF;MAC/E,MAAM,IAAI1B,aAAJ,CAAkB,uCAAlB,EAA2D,UAA3D,EAAuE,IAAvE,CAAN;IACD;;IACD,OAAOI,YAAY,CAACiB,EAAD,EAAKE,QAAL,EAAeC,OAAf,EAAwB;MAAEC,UAAF;MAAcC,MAAd;MAAsBC,SAAS,EAAE;IAAjC,CAAxB,CAAnB;EACD;;EAEY,MAAPC,OAAO,GAAoC;IAC/C,OAAOvB,OAAO,CAACc,GAAR,CAAY,IAAZ,EAAkBL,SAAzB;EACD;;AA/DoD"}
@@ -0,0 +1,27 @@
1
+ import AccountBase from './Base';
2
+ import { Encoded } from '../utils/encoder';
3
+ /**
4
+ * Account provided by wallet
5
+ * @param params - Params
6
+ * @param params.rpcClient - RpcClient instance
7
+ * @param params.address - RPC account address
8
+ * @returns AccountRpc instance
9
+ */
10
+ export default class AccountRpc extends AccountBase {
11
+ _rpcClient: any;
12
+ _address: Encoded.AccountAddress;
13
+ constructor({ rpcClient, address, ...options }: {
14
+ rpcClient: any;
15
+ address: Encoded.AccountAddress;
16
+ } & ConstructorParameters<typeof AccountBase>[0]);
17
+ sign(): Promise<Uint8Array>;
18
+ address(): Promise<Encoded.AccountAddress>;
19
+ /**
20
+ * @returns Signed transaction
21
+ */
22
+ signTransaction(tx: Encoded.Transaction, { innerTx, networkId }?: Parameters<AccountBase['signTransaction']>[1]): Promise<Encoded.Transaction>;
23
+ /**
24
+ * @returns Signed message
25
+ */
26
+ signMessage(message: string, { returnHex }?: Parameters<AccountBase['signMessage']>[1]): Promise<string | Uint8Array>;
27
+ }
@@ -0,0 +1,80 @@
1
+ import _buffer from "buffer";
2
+ const {
3
+ Buffer: _Buffer
4
+ } = _buffer;
5
+ import AccountBase from "./Base.mjs";
6
+ import { METHODS } from "../aepp-wallet-communication/schema.mjs";
7
+ import { NotImplementedError } from "../utils/errors.mjs";
8
+
9
+ /**
10
+ * Account provided by wallet
11
+ * @param params - Params
12
+ * @param params.rpcClient - RpcClient instance
13
+ * @param params.address - RPC account address
14
+ * @returns AccountRpc instance
15
+ */
16
+ export default class AccountRpc extends AccountBase {
17
+ constructor(_ref) {
18
+ let {
19
+ rpcClient,
20
+ address,
21
+ ...options
22
+ } = _ref;
23
+ super(options);
24
+ this._rpcClient = rpcClient;
25
+ this._address = address;
26
+ } // eslint-disable-next-line class-methods-use-this
27
+
28
+
29
+ async sign() {
30
+ throw new NotImplementedError('RAW signing using wallet');
31
+ }
32
+
33
+ async address() {
34
+ return this._address;
35
+ }
36
+ /**
37
+ * @returns Signed transaction
38
+ */
39
+
40
+
41
+ async signTransaction(tx) {
42
+ let {
43
+ innerTx,
44
+ networkId
45
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46
+ if (innerTx != null) throw new NotImplementedError('innerTx option in AccountRpc');
47
+ const res = await this._rpcClient.request(METHODS.sign, {
48
+ onAccount: this._address,
49
+ tx,
50
+ returnSigned: true,
51
+
52
+ /**
53
+ * @deprecated Wallet provided networkId will be used (current network)
54
+ * required to maintain backward compatibility with wallets using SDK v11.0.1 and below
55
+ * @see {@link https://github.com/aeternity/aepp-sdk-js/commit/153fd89a52c4eab39fcd659b356b36d32129c1ba}
56
+ */
57
+ networkId
58
+ });
59
+ return res.signedTransaction;
60
+ }
61
+ /**
62
+ * @returns Signed message
63
+ */
64
+
65
+
66
+ async signMessage(message) {
67
+ let {
68
+ returnHex = false
69
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
70
+ const {
71
+ signature
72
+ } = await this._rpcClient.request(METHODS.signMessage, {
73
+ onAccount: this._address,
74
+ message
75
+ });
76
+ return returnHex ? signature : _Buffer.from(signature, 'hex');
77
+ }
78
+
79
+ }
80
+ //# sourceMappingURL=Rpc.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Rpc.mjs","names":["AccountBase","METHODS","NotImplementedError","AccountRpc","constructor","rpcClient","address","options","_rpcClient","_address","sign","signTransaction","tx","innerTx","networkId","res","request","onAccount","returnSigned","signedTransaction","signMessage","message","returnHex","signature","from"],"sources":["../../src/account/Rpc.ts"],"sourcesContent":["import AccountBase from './Base';\nimport { METHODS } from '../aepp-wallet-communication/schema';\nimport { NotImplementedError } from '../utils/errors';\nimport { Encoded } from '../utils/encoder';\n\n/**\n * Account provided by wallet\n * @param params - Params\n * @param params.rpcClient - RpcClient instance\n * @param params.address - RPC account address\n * @returns AccountRpc instance\n */\nexport default class AccountRpc extends AccountBase {\n _rpcClient: any;\n\n _address: Encoded.AccountAddress;\n\n constructor(\n { rpcClient, address, ...options }: { rpcClient: any; address: Encoded.AccountAddress }\n & ConstructorParameters<typeof AccountBase>[0],\n ) {\n super(options);\n this._rpcClient = rpcClient;\n this._address = address;\n }\n\n // eslint-disable-next-line class-methods-use-this\n async sign(): Promise<Uint8Array> {\n throw new NotImplementedError('RAW signing using wallet');\n }\n\n async address(): Promise<Encoded.AccountAddress> {\n return this._address;\n }\n\n /**\n * @returns Signed transaction\n */\n async signTransaction(\n tx: Encoded.Transaction,\n { innerTx, networkId }: Parameters<AccountBase['signTransaction']>[1] = {},\n ): Promise<Encoded.Transaction> {\n if (innerTx != null) throw new NotImplementedError('innerTx option in AccountRpc');\n const res = await this._rpcClient.request(METHODS.sign, {\n onAccount: this._address,\n tx,\n returnSigned: true,\n /**\n * @deprecated Wallet provided networkId will be used (current network)\n * required to maintain backward compatibility with wallets using SDK v11.0.1 and below\n * @see {@link https://github.com/aeternity/aepp-sdk-js/commit/153fd89a52c4eab39fcd659b356b36d32129c1ba}\n */\n networkId,\n });\n return res.signedTransaction;\n }\n\n /**\n * @returns Signed message\n */\n async signMessage(\n message: string,\n { returnHex = false }: Parameters<AccountBase['signMessage']>[1] = {},\n ): Promise<string | Uint8Array> {\n const { signature } = await this._rpcClient\n .request(METHODS.signMessage, { onAccount: this._address, message });\n return returnHex ? signature : Buffer.from(signature, 'hex');\n }\n}\n"],"mappings":";;;;OAAOA,W;SACEC,O;SACAC,mB;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,UAAN,SAAyBH,WAAzB,CAAqC;EAKlDI,WAAW,OAGT;IAAA,IAFA;MAAEC,SAAF;MAAaC,OAAb;MAAsB,GAAGC;IAAzB,CAEA;IACA,MAAMA,OAAN;IACA,KAAKC,UAAL,GAAkBH,SAAlB;IACA,KAAKI,QAAL,GAAgBH,OAAhB;EACD,CAZiD,CAclD;;;EACU,MAAJI,IAAI,GAAwB;IAChC,MAAM,IAAIR,mBAAJ,CAAwB,0BAAxB,CAAN;EACD;;EAEY,MAAPI,OAAO,GAAoC;IAC/C,OAAO,KAAKG,QAAZ;EACD;EAED;AACF;AACA;;;EACuB,MAAfE,eAAe,CACnBC,EADmB,EAGW;IAAA,IAD9B;MAAEC,OAAF;MAAWC;IAAX,CAC8B,uEAD0C,EAC1C;IAC9B,IAAID,OAAO,IAAI,IAAf,EAAqB,MAAM,IAAIX,mBAAJ,CAAwB,8BAAxB,CAAN;IACrB,MAAMa,GAAG,GAAG,MAAM,KAAKP,UAAL,CAAgBQ,OAAhB,CAAwBf,OAAO,CAACS,IAAhC,EAAsC;MACtDO,SAAS,EAAE,KAAKR,QADsC;MAEtDG,EAFsD;MAGtDM,YAAY,EAAE,IAHwC;;MAItD;AACN;AACA;AACA;AACA;MACMJ;IATsD,CAAtC,CAAlB;IAWA,OAAOC,GAAG,CAACI,iBAAX;EACD;EAED;AACF;AACA;;;EACmB,MAAXC,WAAW,CACfC,OADe,EAGe;IAAA,IAD9B;MAAEC,SAAS,GAAG;IAAd,CAC8B,uEADqC,EACrC;IAC9B,MAAM;MAAEC;IAAF,IAAgB,MAAM,KAAKf,UAAL,CACzBQ,OADyB,CACjBf,OAAO,CAACmB,WADS,EACI;MAAEH,SAAS,EAAE,KAAKR,QAAlB;MAA4BY;IAA5B,CADJ,CAA5B;IAEA,OAAOC,SAAS,GAAGC,SAAH,GAAe,QAAOC,IAAP,CAAYD,SAAZ,EAAuB,KAAvB,CAA/B;EACD;;AAvDiD"}
package/es/aens.d.ts ADDED
@@ -0,0 +1,222 @@
1
+ /// <reference types="node" />
2
+ /**
3
+ * Aens methods - routines to interact with the æternity naming system
4
+ *
5
+ * The high-level description of the naming system is
6
+ * https://github.com/aeternity/protocol/blob/master/AENS.md in the protocol
7
+ * repository.
8
+ */
9
+ import BigNumber from 'bignumber.js';
10
+ import { Tag, AensName } from './tx/builder/constants';
11
+ import { Encoded } from './utils/encoder';
12
+ import { send, SendOptions } from './spend';
13
+ import { getName } from './chain';
14
+ import { BuildTxOptions } from './tx';
15
+ import { TransformNodeType } from './Node';
16
+ import { NameEntry, NamePointer } from './apis/node';
17
+ import AccountBase from './account/Base';
18
+ interface KeyPointers {
19
+ [key: string]: string | Buffer;
20
+ }
21
+ /**
22
+ * Revoke a name
23
+ * @category AENS
24
+ * @param name - Name hash
25
+ * @param options - Options
26
+ * @param options.onAccount - Make operation on specific account from sdk (you pass
27
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
28
+ * @param options.fee - fee
29
+ * @param options.ttl - ttl
30
+ * @param options.nonce - nonce
31
+ * @returns Transaction result
32
+ * @example
33
+ * ```js
34
+ * const name = 'test.chain'
35
+ * const nameObject = await sdkInstance.aensQuery(name)
36
+ *
37
+ * await sdkInstance.aensRevoke(name, { fee, ttl , nonce })
38
+ * // or
39
+ * await nameObject.revoke({ fee, ttl, nonce })
40
+ * ```
41
+ */
42
+ export declare function aensRevoke(name: AensName, options: AensRevokeOptions): ReturnType<typeof send>;
43
+ interface AensRevokeOptions extends BuildTxOptions<Tag.NameRevokeTx, 'nameId' | 'accountId'>, SendOptions {
44
+ }
45
+ /**
46
+ * Update a name
47
+ * @category AENS
48
+ * @param name - AENS name
49
+ * @param pointers - Map of pointer keys to corresponding addresses
50
+ * @param options - Options
51
+ * @param options.extendPointers - Get the pointers from the node and merge with provided
52
+ * ones. Pointers with the same type will be overwritten
53
+ * @param options.onAccount - Make operation on specific account from sdk (you
54
+ * pass publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
55
+ * @param options.fee - fee
56
+ * @param options.ttl - ttl
57
+ * @param options.nonce - nonce
58
+ * @param options.nameTtl - Name ttl represented in number of
59
+ * blocks (Max value is 50000 blocks)
60
+ * @param options.clientTtl=84600 a suggestion as to how long any
61
+ * clients should cache this information
62
+ * @throws Invalid pointer array error
63
+ * @example
64
+ * ```js
65
+ * const name = 'test.chain'
66
+ * const pointersArray = ['ak_asd23dasdas...,' 'ct_asdf34fasdasd...']
67
+ * const nameObject = await sdkInstance.aensQuery(name)
68
+ *
69
+ * await sdkInstance.aensUpdate(name, pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })
70
+ * // or
71
+ * await nameObject.update(pointers, { nameTtl, ttl, fee, nonce, clientTtl })
72
+ * ```
73
+ */
74
+ export declare function aensUpdate(name: AensName, pointers: KeyPointers, { extendPointers, ...options }: AensUpdateOptions): ReturnType<typeof send>;
75
+ interface AensUpdateOptions extends BuildTxOptions<Tag.NameUpdateTx, 'nameId' | 'accountId' | 'pointers' | 'clientTtl' | 'nameTtl'>, SendOptions {
76
+ extendPointers?: boolean;
77
+ clientTtl?: number;
78
+ nameTtl?: number;
79
+ }
80
+ /**
81
+ * Transfer a domain to another account
82
+ * @category AENS
83
+ * @param name - AENS name
84
+ * @param account - Recipient account publick key
85
+ * @param options - Options
86
+ * @param options.onAccount - Make operation on specific account from sdk (you pass
87
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
88
+ * @param options.fee - fee
89
+ * @param options.ttl - ttl
90
+ * @param options.nonce - nonce
91
+ * @returns Transaction result
92
+ * @example
93
+ * ```js
94
+ * const name = 'test.chain'
95
+ * const recipientPub = 'ak_asd23dasdas...'
96
+ * const nameObject = await sdkInstance.aensQuery(name)
97
+ *
98
+ * await sdkInstance.aensTransfer(name, recipientPub, { ttl, fee, nonce })
99
+ * // or
100
+ * await nameObject.transfer(recipientPub, { ttl, fee, nonce })
101
+ * ```
102
+ */
103
+ export declare function aensTransfer(name: AensName, account: Encoded.AccountAddress, options: AensTransferOptions): ReturnType<typeof send>;
104
+ interface AensTransferOptions extends BuildTxOptions<Tag.NameTransferTx, 'nameId' | 'accountId' | 'recipientId'>, SendOptions {
105
+ }
106
+ /**
107
+ * Query the AENS name info from the node
108
+ * and return the object with info and predefined functions for manipulating name
109
+ * @category AENS
110
+ * @param name - AENS name
111
+ * @param opt - Options
112
+ * @returns
113
+ * @example
114
+ * ```js
115
+ * const nameObject = sdkInstance.aensQuery('test.chain')
116
+ * console.log(nameObject)
117
+ * {
118
+ * id, // name hash
119
+ * pointers, // array of pointers
120
+ * update, // Update name function
121
+ * extendTtl, // Extend Ttl name function
122
+ * transfer, // Transfer name function
123
+ * revoke // Revoke name function
124
+ * }
125
+ * ```
126
+ */
127
+ export declare function aensQuery(name: AensName, opt: Parameters<typeof getName>[1] & Parameters<typeof aensUpdate>[2] & Parameters<typeof aensTransfer>[2]): Promise<Readonly<TransformNodeType<NameEntry> & {
128
+ id: Encoded.Name;
129
+ owner: Encoded.AccountAddress;
130
+ pointers: KeyPointers | NamePointer[];
131
+ ttl: number;
132
+ update: (pointers: KeyPointers, options?: Omit<Parameters<typeof aensQuery>[1], 'onNode' | 'onCompiler' | 'onAccount'> & {
133
+ onAccount?: AccountBase;
134
+ }) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;
135
+ transfer: (account: Encoded.AccountAddress, options?: Parameters<typeof aensQuery>[1]) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;
136
+ revoke: (options?: Omit<Parameters<typeof aensRevoke>[1], 'onNode' | 'onCompiler' | 'onAccount'> & {
137
+ onAccount?: AccountBase;
138
+ }) => ReturnType<typeof aensRevoke>;
139
+ extendTtl: (nameTtl: number, options?: Omit<Parameters<typeof aensQuery>[1], 'onNode' | 'onCompiler' | 'onAccount'>) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;
140
+ }>>;
141
+ /**
142
+ * Claim a previously preclaimed registration. This can only be done after the
143
+ * preclaim step
144
+ * @category AENS
145
+ * @param name - AENS name
146
+ * @param salt - Salt from pre-claim, or 0 if it's a bid
147
+ * @param options - options
148
+ * @param options.onAccount - Make operation on specific account from sdk (you pass
149
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
150
+ * @param options.fee - fee
151
+ * @param options.ttl - ttl
152
+ * @param options.nonce - nonce
153
+ * @param options.nameFee - Name Fee (By default calculated by sdk)
154
+ * @returns the result of the claim
155
+ * @example
156
+ * ```js
157
+ * const name = 'test.chain'
158
+ * const salt = preclaimResult.salt // salt from pre-claim transaction
159
+ *
160
+ * await sdkInstance.aensClaim(name, salt, { ttl, fee, nonce, nameFee })
161
+ * ```
162
+ */
163
+ export declare function aensClaim(name: AensName, salt: number, options: AensClaimOptions): Promise<AensClaimReturnType>;
164
+ declare type AensClaimOptionsType = BuildTxOptions<Tag.NameClaimTx, 'accountId' | 'nameSalt' | 'name'> & SendOptions & Parameters<typeof aensQuery>[1];
165
+ interface AensClaimOptions extends AensClaimOptionsType {
166
+ }
167
+ interface AensClaimReturnType extends Awaited<ReturnType<typeof send>>, Partial<Awaited<ReturnType<typeof aensQuery>>> {
168
+ }
169
+ /**
170
+ * Preclaim a name. Sends a hash of the name and a random salt to the node
171
+ * @category AENS
172
+ * @param name - AENS name
173
+ * @param options - Options
174
+ * @param options.onAccount - Make operation on specific account from sdk (you pass
175
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
176
+ * @param options.fee - fee
177
+ * @param options.ttl - ttl
178
+ * @param options.nonce - nonce
179
+ * @example
180
+ * ```js
181
+ * const name = 'test.chain'
182
+ * const salt = preclaimResult.salt // salt from pre-claim transaction
183
+ *
184
+ * await sdkInstance.aensPreclaim(name, { ttl, fee, nonce })
185
+ * {
186
+ * ...transactionResult,
187
+ * claim, // Claim function (options={}) => claimTransactionResult
188
+ * salt,
189
+ * commitmentId
190
+ * }
191
+ * ```
192
+ */
193
+ export declare function aensPreclaim(name: AensName, options: AensPreclaimOptions): Promise<Readonly<Awaited<ReturnType<typeof send>> & {
194
+ height: number;
195
+ salt: number;
196
+ commitmentId: string;
197
+ claim: (opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>;
198
+ }>>;
199
+ interface AensPreclaimOptions extends BuildTxOptions<Tag.NamePreclaimTx, 'accountId' | 'commitmentId'>, SendOptions, AensClaimOptions {
200
+ }
201
+ /**
202
+ * Bid to name auction
203
+ * @category AENS
204
+ * @param name - Domain name
205
+ * @param nameFee - Name fee (bid fee)
206
+ * @param options - Options
207
+ * @param options.onAccount - Make operation on specific account from sdk (you pass
208
+ * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)
209
+ * @param options.fee - fee
210
+ * @param options.ttl - ttl
211
+ * @param options.nonce - nonce
212
+ * @returns Transaction result
213
+ * @example
214
+ * ```js
215
+ * const name = 'test.chain'
216
+ * const bidFee = computeBidFee(name, startFee, incrementPercentage)
217
+ *
218
+ * await sdkInstance.aensBid(name, 213109412839123, { ttl, fee, nonce })
219
+ * ```
220
+ */
221
+ export declare function aensBid(name: AensName, nameFee: number | string | BigNumber, options: Omit<Parameters<typeof aensClaim>[2], 'nameFee'>): ReturnType<typeof aensClaim>;
222
+ export {};