@aeternity/aepp-sdk 12.1.3 → 13.0.0-alpha.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 (475) hide show
  1. package/dist/aepp-sdk.browser-script.js +1 -1
  2. package/dist/aepp-sdk.browser-script.js.map +1 -1
  3. package/dist/aepp-sdk.browser.js +1 -1
  4. package/dist/aepp-sdk.browser.js.map +1 -1
  5. package/dist/aepp-sdk.js +6580 -8859
  6. package/dist/aepp-sdk.js.map +1 -1
  7. package/es/AeSdk.d.ts +7 -3
  8. package/es/AeSdk.mjs +17 -22
  9. package/es/AeSdk.mjs.map +1 -1
  10. package/es/AeSdkAepp.d.ts +6 -5
  11. package/es/AeSdkAepp.mjs +7 -30
  12. package/es/AeSdkAepp.mjs.map +1 -1
  13. package/es/AeSdkBase.d.ts +18 -140
  14. package/es/AeSdkBase.mjs +27 -185
  15. package/es/AeSdkBase.mjs.map +1 -1
  16. package/es/AeSdkMethods.d.ts +124 -0
  17. package/es/AeSdkMethods.mjs +122 -0
  18. package/es/AeSdkMethods.mjs.map +1 -0
  19. package/es/AeSdkWallet.d.ts +7 -21
  20. package/es/AeSdkWallet.mjs +38 -86
  21. package/es/AeSdkWallet.mjs.map +1 -1
  22. package/es/Node.d.ts +7 -12
  23. package/es/Node.mjs +34 -47
  24. package/es/Node.mjs.map +1 -1
  25. package/es/account/Base.d.ts +24 -40
  26. package/es/account/Base.mjs +1 -101
  27. package/es/account/Base.mjs.map +1 -1
  28. package/es/account/Generalized.d.ts +16 -0
  29. package/es/account/Generalized.mjs +111 -0
  30. package/es/account/Generalized.mjs.map +1 -0
  31. package/es/account/Ledger.d.ts +28 -0
  32. package/es/account/Ledger.mjs +101 -0
  33. package/es/account/Ledger.mjs.map +1 -0
  34. package/es/account/LedgerFactory.d.ts +39 -0
  35. package/es/account/LedgerFactory.mjs +81 -0
  36. package/es/account/LedgerFactory.mjs.map +1 -0
  37. package/es/account/Memory.d.ts +13 -17
  38. package/es/account/Memory.mjs +43 -65
  39. package/es/account/Memory.mjs.map +1 -1
  40. package/es/account/Rpc.d.ts +6 -8
  41. package/es/account/Rpc.mjs +14 -32
  42. package/es/account/Rpc.mjs.map +1 -1
  43. package/es/aens.d.ts +3 -3
  44. package/es/aens.mjs +42 -41
  45. package/es/aens.mjs.map +1 -1
  46. package/es/aepp-wallet-communication/connection/Browser.mjs +9 -13
  47. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
  48. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +3 -7
  49. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
  50. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +1 -1
  51. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +0 -31
  52. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
  53. package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
  54. package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +3 -3
  55. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +4 -41
  56. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
  57. package/es/aepp-wallet-communication/rpc/types.d.ts +7 -1
  58. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
  59. package/es/aepp-wallet-communication/schema.mjs +14 -68
  60. package/es/aepp-wallet-communication/schema.mjs.map +1 -1
  61. package/es/aepp-wallet-communication/wallet-detector.mjs +0 -3
  62. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
  63. package/es/apis/compiler/compiler.d.ts +23 -29
  64. package/es/apis/compiler/compiler.mjs +128 -189
  65. package/es/apis/compiler/compiler.mjs.map +1 -1
  66. package/es/apis/compiler/index.mjs.map +1 -1
  67. package/es/apis/compiler/models/index.d.ts +82 -135
  68. package/es/apis/compiler/models/index.mjs +1 -47
  69. package/es/apis/compiler/models/index.mjs.map +1 -1
  70. package/es/apis/compiler/models/mappers.d.ts +8 -8
  71. package/es/apis/compiler/models/mappers.mjs +165 -183
  72. package/es/apis/compiler/models/mappers.mjs.map +1 -1
  73. package/es/apis/compiler/models/parameters.d.ts +0 -1
  74. package/es/apis/compiler/models/parameters.mjs +5 -9
  75. package/es/apis/compiler/models/parameters.mjs.map +1 -1
  76. package/es/apis/node/index.mjs.map +1 -1
  77. package/es/apis/node/models/index.d.ts +48 -48
  78. package/es/apis/node/models/mappers.mjs +12 -6
  79. package/es/apis/node/models/mappers.mjs.map +1 -1
  80. package/es/apis/node/models/parameters.mjs.map +1 -1
  81. package/es/apis/node/node.mjs +43 -84
  82. package/es/apis/node/node.mjs.map +1 -1
  83. package/es/chain.d.ts +1 -1
  84. package/es/chain.mjs +33 -58
  85. package/es/chain.mjs.map +1 -1
  86. package/es/channel/Base.d.ts +195 -0
  87. package/es/channel/Base.mjs +290 -0
  88. package/es/channel/Base.mjs.map +1 -0
  89. package/es/channel/Contract.d.ts +247 -0
  90. package/es/channel/Contract.mjs +420 -0
  91. package/es/channel/Contract.mjs.map +1 -0
  92. package/es/channel/Spend.d.ts +217 -0
  93. package/es/channel/Spend.mjs +383 -0
  94. package/es/channel/Spend.mjs.map +1 -0
  95. package/es/channel/handlers.d.ts +8 -21
  96. package/es/channel/handlers.mjs +141 -891
  97. package/es/channel/handlers.mjs.map +1 -1
  98. package/es/channel/internal.d.ts +27 -21
  99. package/es/channel/internal.mjs +98 -190
  100. package/es/channel/internal.mjs.map +1 -1
  101. package/es/contract/{Compiler.d.ts → CompilerHttp.d.ts} +3 -3
  102. package/es/contract/{Compiler.mjs → CompilerHttp.mjs} +8 -13
  103. package/es/contract/CompilerHttp.mjs.map +1 -0
  104. package/es/contract/Contract.d.ts +235 -0
  105. package/es/contract/Contract.mjs +534 -0
  106. package/es/contract/Contract.mjs.map +1 -0
  107. package/es/contract/ga.d.ts +7 -33
  108. package/es/contract/ga.mjs +20 -112
  109. package/es/contract/ga.mjs.map +1 -1
  110. package/es/index.d.ts +9 -6
  111. package/es/index.mjs +8 -6
  112. package/es/index.mjs.map +1 -1
  113. package/es/oracle.d.ts +5 -5
  114. package/es/oracle.mjs +33 -39
  115. package/es/oracle.mjs.map +1 -1
  116. package/es/spend.d.ts +3 -3
  117. package/es/spend.mjs +17 -20
  118. package/es/spend.mjs.map +1 -1
  119. package/es/tx/builder/constants.d.ts +2 -1
  120. package/es/tx/builder/constants.mjs +12 -12
  121. package/es/tx/builder/constants.mjs.map +1 -1
  122. package/es/tx/builder/field-types/address.d.ts +15 -0
  123. package/es/tx/builder/field-types/address.mjs +42 -0
  124. package/es/tx/builder/field-types/address.mjs.map +1 -0
  125. package/es/tx/builder/field-types/addresses.d.ts +6 -0
  126. package/es/tx/builder/field-types/addresses.mjs +13 -0
  127. package/es/tx/builder/field-types/addresses.mjs.map +1 -0
  128. package/es/tx/builder/field-types/coin-amount.d.ts +1 -2
  129. package/es/tx/builder/field-types/coin-amount.mjs +4 -12
  130. package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
  131. package/es/tx/builder/field-types/deposit.d.ts +0 -1
  132. package/es/tx/builder/field-types/deposit.mjs +2 -4
  133. package/es/tx/builder/field-types/deposit.mjs.map +1 -1
  134. package/es/tx/builder/field-types/enumeration.d.ts +5 -0
  135. package/es/tx/builder/field-types/enumeration.mjs +21 -0
  136. package/es/tx/builder/field-types/enumeration.mjs.map +1 -0
  137. package/es/tx/builder/field-types/fee.d.ts +1 -9
  138. package/es/tx/builder/field-types/fee.mjs +9 -25
  139. package/es/tx/builder/field-types/fee.mjs.map +1 -1
  140. package/es/tx/builder/field-types/field.mjs +0 -2
  141. package/es/tx/builder/field-types/field.mjs.map +1 -1
  142. package/es/tx/builder/field-types/gas-limit.mjs +4 -9
  143. package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
  144. package/es/tx/builder/field-types/gas-price.d.ts +1 -2
  145. package/es/tx/builder/field-types/gas-price.mjs +3 -7
  146. package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
  147. package/es/tx/builder/field-types/index.d.ts +23 -11
  148. package/es/tx/builder/field-types/index.mjs +10 -3
  149. package/es/tx/builder/field-types/index.mjs.map +1 -1
  150. package/es/tx/builder/field-types/name-fee.d.ts +0 -1
  151. package/es/tx/builder/field-types/name-fee.mjs +3 -5
  152. package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
  153. package/es/tx/builder/field-types/name-id.d.ts +1 -4
  154. package/es/tx/builder/field-types/name-id.mjs +4 -10
  155. package/es/tx/builder/field-types/name-id.mjs.map +1 -1
  156. package/es/tx/builder/field-types/name.mjs +0 -2
  157. package/es/tx/builder/field-types/name.mjs.map +1 -1
  158. package/es/tx/builder/field-types/pointers.d.ts +23 -0
  159. package/es/tx/builder/field-types/pointers.mjs +36 -0
  160. package/es/tx/builder/field-types/pointers.mjs.map +1 -0
  161. package/es/tx/builder/field-types/short-u-int.mjs +0 -2
  162. package/es/tx/builder/field-types/short-u-int.mjs.map +1 -1
  163. package/es/tx/builder/field-types/u-int.d.ts +1 -1
  164. package/es/tx/builder/field-types/u-int.mjs +3 -4
  165. package/es/tx/builder/field-types/u-int.mjs.map +1 -1
  166. package/es/tx/builder/helpers.d.ts +2 -32
  167. package/es/tx/builder/helpers.mjs +19 -71
  168. package/es/tx/builder/helpers.mjs.map +1 -1
  169. package/es/tx/builder/index.d.ts +1 -21
  170. package/es/tx/builder/index.mjs +29 -148
  171. package/es/tx/builder/index.mjs.map +1 -1
  172. package/es/tx/builder/schema.d.ts +336 -176
  173. package/es/tx/builder/schema.mjs +71 -78
  174. package/es/tx/builder/schema.mjs.map +1 -1
  175. package/es/tx/index.d.ts +3 -33
  176. package/es/tx/index.mjs +26 -43
  177. package/es/tx/index.mjs.map +1 -1
  178. package/es/tx/validator.d.ts +2 -2
  179. package/es/tx/validator.mjs +86 -59
  180. package/es/tx/validator.mjs.map +1 -1
  181. package/es/typings/{@aeternity__argon2-browser → @aeternity__aepp-calldata}/index.d.mjs +0 -0
  182. package/es/typings/@aeternity__aepp-calldata/index.d.mjs.map +1 -0
  183. package/es/utils/amount-formatter.mjs +4 -10
  184. package/es/utils/amount-formatter.mjs.map +1 -1
  185. package/es/utils/autorest.d.ts +1 -0
  186. package/es/utils/autorest.mjs +17 -19
  187. package/es/utils/autorest.mjs.map +1 -1
  188. package/es/utils/bignumber.mjs +4 -7
  189. package/es/utils/bignumber.mjs.map +1 -1
  190. package/es/utils/bytes.d.ts +0 -17
  191. package/es/utils/bytes.mjs +6 -35
  192. package/es/utils/bytes.mjs.map +1 -1
  193. package/es/utils/crypto.d.ts +15 -8
  194. package/es/utils/crypto.mjs +40 -40
  195. package/es/utils/crypto.mjs.map +1 -1
  196. package/es/utils/encoder-types.d.ts +28 -28
  197. package/es/utils/encoder-types.mjs +0 -1
  198. package/es/utils/encoder-types.mjs.map +1 -1
  199. package/es/utils/encoder.d.ts +0 -1
  200. package/es/utils/encoder.mjs +7 -15
  201. package/es/utils/encoder.mjs.map +1 -1
  202. package/es/utils/errors.d.ts +12 -6
  203. package/es/utils/errors.mjs +87 -163
  204. package/es/utils/errors.mjs.map +1 -1
  205. package/es/utils/hd-wallet.d.ts +27 -19
  206. package/es/utils/hd-wallet.mjs +42 -26
  207. package/es/utils/hd-wallet.mjs.map +1 -1
  208. package/es/utils/json-big.mjs +0 -8
  209. package/es/utils/json-big.mjs.map +1 -1
  210. package/es/utils/keystore.d.ts +2 -0
  211. package/es/utils/keystore.mjs +37 -36
  212. package/es/utils/keystore.mjs.map +1 -1
  213. package/es/utils/mptree.d.ts +1 -1
  214. package/es/utils/mptree.mjs +4 -26
  215. package/es/utils/mptree.mjs.map +1 -1
  216. package/es/utils/other.d.ts +3 -1
  217. package/es/utils/other.mjs +11 -7
  218. package/es/utils/other.mjs.map +1 -1
  219. package/es/utils/semver-satisfies.mjs +0 -3
  220. package/es/utils/semver-satisfies.mjs.map +1 -1
  221. package/es/utils/string.d.ts +0 -12
  222. package/es/utils/string.mjs +1 -21
  223. package/es/utils/string.mjs.map +1 -1
  224. package/package.json +86 -47
  225. package/src/AeSdk.ts +15 -11
  226. package/src/AeSdkAepp.ts +9 -7
  227. package/src/AeSdkBase.ts +28 -202
  228. package/src/AeSdkMethods.ts +170 -0
  229. package/src/AeSdkWallet.ts +16 -47
  230. package/src/Node.ts +11 -15
  231. package/src/account/Base.ts +29 -75
  232. package/src/account/Generalized.ts +98 -0
  233. package/src/account/Ledger.ts +131 -0
  234. package/src/account/LedgerFactory.ts +86 -0
  235. package/src/account/Memory.ts +46 -60
  236. package/src/account/Rpc.ts +17 -26
  237. package/src/aens.ts +10 -9
  238. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +5 -4
  239. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +3 -3
  240. package/src/aepp-wallet-communication/rpc/RpcClient.ts +2 -2
  241. package/src/aepp-wallet-communication/rpc/types.ts +11 -1
  242. package/src/aepp-wallet-communication/schema.ts +18 -18
  243. package/src/apis/compiler/code-model-v4.yaml +681 -888
  244. package/src/apis/compiler/compiler.ts +113 -154
  245. package/src/apis/compiler/models/index.ts +80 -140
  246. package/src/apis/compiler/models/mappers.ts +165 -183
  247. package/src/apis/compiler/models/parameters.ts +6 -12
  248. package/src/chain.ts +6 -3
  249. package/src/channel/Base.ts +327 -0
  250. package/src/channel/Contract.ts +487 -0
  251. package/src/channel/Spend.ts +403 -0
  252. package/src/channel/handlers.ts +154 -573
  253. package/src/channel/internal.ts +113 -142
  254. package/src/contract/{Compiler.ts → CompilerHttp.ts} +5 -5
  255. package/src/contract/Contract.ts +620 -0
  256. package/src/contract/ga.ts +18 -104
  257. package/src/index.ts +9 -8
  258. package/src/oracle.ts +7 -7
  259. package/src/spend.ts +5 -13
  260. package/src/tx/builder/constants.ts +1 -0
  261. package/src/tx/builder/field-types/address.ts +52 -0
  262. package/src/tx/builder/field-types/addresses.ts +18 -0
  263. package/src/tx/builder/field-types/coin-amount.ts +2 -8
  264. package/src/tx/builder/field-types/enumeration.ts +21 -0
  265. package/src/tx/builder/field-types/fee.ts +1 -3
  266. package/src/tx/builder/field-types/gas-limit.ts +2 -2
  267. package/src/tx/builder/field-types/gas-price.ts +0 -2
  268. package/src/tx/builder/field-types/index.ts +16 -6
  269. package/src/tx/builder/field-types/name-fee.ts +1 -1
  270. package/src/tx/builder/field-types/name-id.ts +7 -10
  271. package/src/tx/builder/field-types/pointers.ts +41 -0
  272. package/src/tx/builder/field-types/u-int.ts +3 -2
  273. package/src/tx/builder/helpers.ts +10 -60
  274. package/src/tx/builder/index.ts +6 -65
  275. package/src/tx/builder/schema.ts +89 -100
  276. package/src/tx/index.ts +19 -15
  277. package/src/tx/validator.ts +36 -18
  278. package/src/typings/@aeternity__aepp-calldata/index.d.ts +20 -0
  279. package/src/utils/autorest.ts +16 -1
  280. package/src/utils/bytes.ts +5 -33
  281. package/src/utils/crypto.ts +23 -16
  282. package/src/utils/encoder.ts +0 -1
  283. package/src/utils/errors.ts +18 -12
  284. package/src/utils/hd-wallet.ts +30 -9
  285. package/src/utils/keystore.ts +24 -21
  286. package/src/utils/other.ts +16 -1
  287. package/src/utils/string.ts +0 -20
  288. package/types-legacy/ts4.2/AeSdk.d.ts +41 -0
  289. package/types-legacy/ts4.2/AeSdkAepp.d.ts +71 -0
  290. package/types-legacy/ts4.2/AeSdkBase.d.ts +91 -0
  291. package/types-legacy/ts4.2/AeSdkMethods.d.ts +141 -0
  292. package/types-legacy/ts4.2/AeSdkWallet.d.ts +90 -0
  293. package/types-legacy/ts4.2/Node.d.ts +78 -0
  294. package/types-legacy/ts4.2/account/Base.d.ts +52 -0
  295. package/types-legacy/ts4.2/account/Generalized.d.ts +16 -0
  296. package/types-legacy/ts4.2/account/Ledger.d.ts +28 -0
  297. package/types-legacy/ts4.2/account/LedgerFactory.d.ts +39 -0
  298. package/types-legacy/ts4.2/account/Memory.d.ts +22 -0
  299. package/types-legacy/ts4.2/account/Rpc.d.ts +25 -0
  300. package/types-legacy/ts4.2/aens.d.ts +222 -0
  301. package/types-legacy/ts4.2/aepp-wallet-communication/connection/Browser.d.ts +33 -0
  302. package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserRuntime.d.ts +18 -0
  303. package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +36 -0
  304. package/types-legacy/ts4.2/aepp-wallet-communication/connection-proxy.d.ts +11 -0
  305. package/types-legacy/ts4.2/aepp-wallet-communication/rpc/RpcClient.d.ts +34 -0
  306. package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +83 -0
  307. package/types-legacy/ts4.2/aepp-wallet-communication/schema.d.ts +133 -0
  308. package/types-legacy/ts4.2/aepp-wallet-communication/wallet-detector.d.ts +25 -0
  309. package/types-legacy/ts4.2/apis/compiler/compiler.d.ts +86 -0
  310. package/types-legacy/ts4.2/apis/compiler/index.d.ts +2 -0
  311. package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +195 -0
  312. package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +23 -0
  313. package/types-legacy/ts4.2/apis/compiler/models/parameters.d.ts +12 -0
  314. package/types-legacy/ts4.2/apis/node/index.d.ts +2 -0
  315. package/types-legacy/ts4.2/apis/node/models/index.d.ts +1065 -0
  316. package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +95 -0
  317. package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +17 -0
  318. package/types-legacy/ts4.2/apis/node/node.d.ts +215 -0
  319. package/types-legacy/ts4.2/chain.d.ts +248 -0
  320. package/types-legacy/ts4.2/channel/Base.d.ts +194 -0
  321. package/types-legacy/ts4.2/channel/Contract.d.ts +247 -0
  322. package/types-legacy/ts4.2/channel/Spend.d.ts +217 -0
  323. package/types-legacy/ts4.2/channel/handlers.d.ts +21 -0
  324. package/types-legacy/ts4.2/channel/internal.d.ts +107 -0
  325. package/types-legacy/ts4.2/contract/CompilerHttp.d.ts +18 -0
  326. package/types-legacy/ts4.2/contract/Contract.d.ts +237 -0
  327. package/types-legacy/ts4.2/contract/ga.d.ts +43 -0
  328. package/types-legacy/ts4.2/globals.d.ts +16 -0
  329. package/types-legacy/ts4.2/index.d.ts +39 -0
  330. package/types-legacy/ts4.2/oracle.d.ts +161 -0
  331. package/types-legacy/ts4.2/spend.d.ts +62 -0
  332. package/types-legacy/ts4.2/tx/builder/constants.d.ts +71 -0
  333. package/types-legacy/ts4.2/tx/builder/field-types/address.d.ts +22 -0
  334. package/types-legacy/ts4.2/tx/builder/field-types/addresses.d.ts +6 -0
  335. package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +12 -0
  336. package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +14 -0
  337. package/types-legacy/ts4.2/tx/builder/field-types/enumeration.d.ts +5 -0
  338. package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +17 -0
  339. package/types-legacy/ts4.2/tx/builder/field-types/field.d.ts +6 -0
  340. package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +12 -0
  341. package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +7 -0
  342. package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +85 -0
  343. package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +19 -0
  344. package/types-legacy/ts4.2/tx/builder/field-types/name-id.d.ts +11 -0
  345. package/types-legacy/ts4.2/tx/builder/field-types/name.d.ts +13 -0
  346. package/types-legacy/ts4.2/tx/builder/field-types/pointers.d.ts +26 -0
  347. package/types-legacy/ts4.2/tx/builder/field-types/short-u-int.d.ts +6 -0
  348. package/types-legacy/ts4.2/tx/builder/field-types/u-int.d.ts +8 -0
  349. package/types-legacy/ts4.2/tx/builder/helpers.d.ts +112 -0
  350. package/types-legacy/ts4.2/tx/builder/index.d.ts +68 -0
  351. package/types-legacy/ts4.2/tx/builder/schema.d.ts +2963 -0
  352. package/types-legacy/ts4.2/tx/index.d.ts +34 -0
  353. package/types-legacy/ts4.2/tx/validator.d.ts +20 -0
  354. package/types-legacy/ts4.2/utils/amount-formatter.d.ts +42 -0
  355. package/types-legacy/ts4.2/utils/autorest.d.ts +7 -0
  356. package/types-legacy/ts4.2/utils/bignumber.d.ts +13 -0
  357. package/types-legacy/ts4.2/utils/bytes.d.ts +9 -0
  358. package/types-legacy/ts4.2/utils/crypto.d.ts +95 -0
  359. package/types-legacy/ts4.2/utils/encoder-types.d.ts +61 -0
  360. package/types-legacy/ts4.2/utils/encoder.d.ts +24 -0
  361. package/types-legacy/ts4.2/utils/errors.d.ts +480 -0
  362. package/types-legacy/ts4.2/utils/hd-wallet.d.ts +65 -0
  363. package/types-legacy/ts4.2/utils/json-big.d.ts +5 -0
  364. package/types-legacy/ts4.2/utils/keystore.d.ts +53 -0
  365. package/types-legacy/ts4.2/utils/mptree.d.ts +32 -0
  366. package/types-legacy/ts4.2/utils/other.d.ts +31 -0
  367. package/types-legacy/ts4.2/utils/semver-satisfies.d.ts +1 -0
  368. package/types-legacy/ts4.2/utils/string.d.ts +12 -0
  369. package/types-legacy/ts4.5/AeSdk.d.ts +41 -0
  370. package/types-legacy/ts4.5/AeSdkAepp.d.ts +71 -0
  371. package/types-legacy/ts4.5/AeSdkBase.d.ts +91 -0
  372. package/types-legacy/ts4.5/AeSdkMethods.d.ts +141 -0
  373. package/types-legacy/ts4.5/AeSdkWallet.d.ts +90 -0
  374. package/types-legacy/ts4.5/Node.d.ts +78 -0
  375. package/types-legacy/ts4.5/account/Base.d.ts +52 -0
  376. package/types-legacy/ts4.5/account/Generalized.d.ts +16 -0
  377. package/types-legacy/ts4.5/account/Ledger.d.ts +28 -0
  378. package/types-legacy/ts4.5/account/LedgerFactory.d.ts +39 -0
  379. package/types-legacy/ts4.5/account/Memory.d.ts +22 -0
  380. package/types-legacy/ts4.5/account/Rpc.d.ts +25 -0
  381. package/types-legacy/ts4.5/aens.d.ts +222 -0
  382. package/types-legacy/ts4.5/aepp-wallet-communication/connection/Browser.d.ts +33 -0
  383. package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserRuntime.d.ts +18 -0
  384. package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +36 -0
  385. package/types-legacy/ts4.5/aepp-wallet-communication/connection-proxy.d.ts +11 -0
  386. package/types-legacy/ts4.5/aepp-wallet-communication/rpc/RpcClient.d.ts +34 -0
  387. package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +83 -0
  388. package/types-legacy/ts4.5/aepp-wallet-communication/schema.d.ts +133 -0
  389. package/types-legacy/ts4.5/aepp-wallet-communication/wallet-detector.d.ts +25 -0
  390. package/types-legacy/ts4.5/apis/compiler/compiler.d.ts +86 -0
  391. package/types-legacy/ts4.5/apis/compiler/index.d.ts +2 -0
  392. package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +195 -0
  393. package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +23 -0
  394. package/types-legacy/ts4.5/apis/compiler/models/parameters.d.ts +12 -0
  395. package/types-legacy/ts4.5/apis/node/index.d.ts +2 -0
  396. package/types-legacy/ts4.5/apis/node/models/index.d.ts +1065 -0
  397. package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +95 -0
  398. package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +17 -0
  399. package/types-legacy/ts4.5/apis/node/node.d.ts +215 -0
  400. package/types-legacy/ts4.5/chain.d.ts +248 -0
  401. package/types-legacy/ts4.5/channel/Base.d.ts +194 -0
  402. package/types-legacy/ts4.5/channel/Contract.d.ts +247 -0
  403. package/types-legacy/ts4.5/channel/Spend.d.ts +217 -0
  404. package/types-legacy/ts4.5/channel/handlers.d.ts +21 -0
  405. package/types-legacy/ts4.5/channel/internal.d.ts +107 -0
  406. package/types-legacy/ts4.5/contract/CompilerHttp.d.ts +18 -0
  407. package/types-legacy/ts4.5/contract/Contract.d.ts +237 -0
  408. package/types-legacy/ts4.5/contract/ga.d.ts +43 -0
  409. package/types-legacy/ts4.5/index.d.ts +38 -0
  410. package/types-legacy/ts4.5/oracle.d.ts +161 -0
  411. package/types-legacy/ts4.5/spend.d.ts +62 -0
  412. package/types-legacy/ts4.5/tx/builder/constants.d.ts +71 -0
  413. package/types-legacy/ts4.5/tx/builder/field-types/address.d.ts +22 -0
  414. package/types-legacy/ts4.5/tx/builder/field-types/addresses.d.ts +6 -0
  415. package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +12 -0
  416. package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +14 -0
  417. package/types-legacy/ts4.5/tx/builder/field-types/enumeration.d.ts +5 -0
  418. package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +17 -0
  419. package/types-legacy/ts4.5/tx/builder/field-types/field.d.ts +6 -0
  420. package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +12 -0
  421. package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +7 -0
  422. package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +85 -0
  423. package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +19 -0
  424. package/types-legacy/ts4.5/tx/builder/field-types/name-id.d.ts +11 -0
  425. package/types-legacy/ts4.5/tx/builder/field-types/name.d.ts +13 -0
  426. package/types-legacy/ts4.5/tx/builder/field-types/pointers.d.ts +26 -0
  427. package/types-legacy/ts4.5/tx/builder/field-types/short-u-int.d.ts +6 -0
  428. package/types-legacy/ts4.5/tx/builder/field-types/u-int.d.ts +8 -0
  429. package/types-legacy/ts4.5/tx/builder/helpers.d.ts +112 -0
  430. package/types-legacy/ts4.5/tx/builder/index.d.ts +68 -0
  431. package/types-legacy/ts4.5/tx/builder/schema.d.ts +2963 -0
  432. package/types-legacy/ts4.5/tx/index.d.ts +34 -0
  433. package/types-legacy/ts4.5/tx/validator.d.ts +20 -0
  434. package/types-legacy/ts4.5/utils/amount-formatter.d.ts +42 -0
  435. package/types-legacy/ts4.5/utils/autorest.d.ts +7 -0
  436. package/types-legacy/ts4.5/utils/bignumber.d.ts +13 -0
  437. package/types-legacy/ts4.5/utils/bytes.d.ts +9 -0
  438. package/types-legacy/ts4.5/utils/crypto.d.ts +95 -0
  439. package/types-legacy/ts4.5/utils/encoder-types.d.ts +61 -0
  440. package/types-legacy/ts4.5/utils/encoder.d.ts +24 -0
  441. package/types-legacy/ts4.5/utils/errors.d.ts +480 -0
  442. package/types-legacy/ts4.5/utils/hd-wallet.d.ts +65 -0
  443. package/types-legacy/ts4.5/utils/json-big.d.ts +5 -0
  444. package/types-legacy/ts4.5/utils/keystore.d.ts +53 -0
  445. package/types-legacy/ts4.5/utils/mptree.d.ts +32 -0
  446. package/types-legacy/ts4.5/utils/other.d.ts +31 -0
  447. package/types-legacy/ts4.5/utils/semver-satisfies.d.ts +1 -0
  448. package/types-legacy/ts4.5/utils/string.d.ts +12 -0
  449. package/es/channel/index.d.ts +0 -625
  450. package/es/channel/index.mjs +0 -975
  451. package/es/channel/index.mjs.map +0 -1
  452. package/es/contract/Compiler.mjs.map +0 -1
  453. package/es/contract/aci.d.ts +0 -127
  454. package/es/contract/aci.mjs +0 -508
  455. package/es/contract/aci.mjs.map +0 -1
  456. package/es/contract/methods.d.ts +0 -71
  457. package/es/contract/methods.mjs +0 -104
  458. package/es/contract/methods.mjs.map +0 -1
  459. package/es/deprecated/index.d.ts +0 -143
  460. package/es/deprecated/index.mjs +0 -162
  461. package/es/deprecated/index.mjs.map +0 -1
  462. package/es/deprecated/methods.d.ts +0 -18
  463. package/es/deprecated/methods.mjs +0 -26
  464. package/es/deprecated/methods.mjs.map +0 -1
  465. package/es/tx/builder/address.d.ts +0 -25
  466. package/es/tx/builder/address.mjs +0 -45
  467. package/es/tx/builder/address.mjs.map +0 -1
  468. package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +0 -1
  469. package/src/channel/index.ts +0 -1025
  470. package/src/contract/aci.ts +0 -537
  471. package/src/contract/methods.ts +0 -123
  472. package/src/deprecated/index.ts +0 -172
  473. package/src/deprecated/methods.ts +0 -25
  474. package/src/tx/builder/address.ts +0 -50
  475. package/src/typings/@aeternity__argon2-browser/index.d.ts +0 -3
@@ -1,104 +0,0 @@
1
- import _buffer from "buffer";
2
- const {
3
- Buffer: _Buffer
4
- } = _buffer;
5
-
6
- /*
7
- * ISC License (ISC)
8
- * Copyright (c) 2022 aeternity developers
9
- *
10
- * Permission to use, copy, modify, and/or distribute this software for any
11
- * purpose with or without fee is hereby granted, provided that the above
12
- * copyright notice and this permission notice appear in all copies.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
- * PERFORMANCE OF THIS SOFTWARE.
21
- */
22
-
23
- /**
24
- * Contract module - routines to interact with the æternity contract
25
- *
26
- * High level documentation of the contracts are available at
27
- * https://github.com/aeternity/protocol/tree/master/contracts and
28
- */
29
- import { produceNameId } from "../tx/builder/helpers.mjs";
30
- import { concatBuffers } from "../utils/other.mjs";
31
- import { decode } from "../utils/encoder.mjs";
32
- export { default as getContractInstance } from "./aci.mjs";
33
- /**
34
- * Utility method to create a delegate signature for a contract
35
- * @category contract
36
- * @param ids - The list of id's to prepend
37
- * @param opt - Options
38
- * @param opt.onNode - Node to use
39
- * @param opt.onAccount - Account to use
40
- * @returns Signature in hex representation
41
- */
42
-
43
- async function delegateSignatureCommon(ids, _ref) {
44
- let {
45
- onAccount,
46
- onNode,
47
- ...opt
48
- } = _ref;
49
- const signature = await onAccount.sign(concatBuffers([_Buffer.from((await onNode.getStatus()).networkId), ...ids.map(e => decode(e))]), opt);
50
- return _Buffer.from(signature).toString('hex');
51
- }
52
- /**
53
- * Helper to generate a signature to delegate pre-claim/claim/transfer/revoke of a name to
54
- * a contract.
55
- * @category contract
56
- * @param contractId - Contract Id
57
- * @param opt - Options
58
- * @param opt.name - The name
59
- * @returns Signature for delegation
60
- * @example
61
- * ```js
62
- * const aeSdk = new AeSdk({ ... })
63
- * const contractId = 'ct_asd2ks...' // contract address
64
- * const name = 'example.chain' // AENS name
65
- * const onAccount = await aeSdk.address() // Sign with a specific account
66
- * // Preclaim signature
67
- * const preclaimSig = await aeSdk.createAensDelegationSignature(contractId, { onAccount: current })
68
- * // Claim, transfer and revoke signature
69
- * const aensDelegationSig = await contract.createAensDelegationSignature(
70
- * contractId, { name, onAccount: current }
71
- * )
72
- * ```
73
- */
74
-
75
-
76
- export async function createAensDelegationSignature(contractId, opt) {
77
- return delegateSignatureCommon([await opt.onAccount.address(opt), ...(opt.name != null ? [produceNameId(opt.name)] : []), contractId], opt);
78
- }
79
- /**
80
- * Helper to generate a signature to delegate register/extend/respond of a Oracle to a contract.
81
- * @category contract
82
- * @param contractId - Contract Id
83
- * @param opt - Options
84
- * @param opt.queryId - Oracle Query Id
85
- * @returns Signature for delegation
86
- * @example
87
- * ```js
88
- * const aeSdk = new AeSdk({ ... })
89
- * const contractId = 'ct_asd2ks...' // contract address
90
- * const queryId = 'oq_...' // Oracle Query Id
91
- * const onAccount = await aeSdk.address() // Sign with a specific account
92
- * // Oracle register and extend signature
93
- * const oracleDelegationSig = await aeSdk.createOracleDelegationSignature(contractId)
94
- * // Oracle respond signature
95
- * const respondSig = await aeSdk.createOracleDelegationSignature(contractId, { queryId })
96
- * ```
97
- */
98
-
99
- export async function createOracleDelegationSignature(contractId, opt) {
100
- var _opt$queryId;
101
-
102
- return delegateSignatureCommon([(_opt$queryId = opt.queryId) !== null && _opt$queryId !== void 0 ? _opt$queryId : await opt.onAccount.address(opt), contractId], opt);
103
- }
104
- //# sourceMappingURL=methods.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"methods.mjs","names":["produceNameId","concatBuffers","decode","default","getContractInstance","delegateSignatureCommon","ids","onAccount","onNode","opt","signature","sign","from","getStatus","networkId","map","e","toString","createAensDelegationSignature","contractId","address","name","createOracleDelegationSignature","queryId"],"sources":["../../src/contract/methods.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 */\n\n/**\n * Contract module - routines to interact with the æternity contract\n *\n * High level documentation of the contracts are available at\n * https://github.com/aeternity/protocol/tree/master/contracts and\n */\n\nimport { AensName } from '../tx/builder/constants';\nimport { produceNameId } from '../tx/builder/helpers';\nimport { concatBuffers } from '../utils/other';\nimport { decode, Encoded } from '../utils/encoder';\nimport AccountBase from '../account/Base';\nimport Node from '../Node';\n\nexport { default as getContractInstance } from './aci';\n\n/**\n * Utility method to create a delegate signature for a contract\n * @category contract\n * @param ids - The list of id's to prepend\n * @param opt - Options\n * @param opt.onNode - Node to use\n * @param opt.onAccount - Account to use\n * @returns Signature in hex representation\n */\nasync function delegateSignatureCommon(\n ids: Encoded.Any[],\n { onAccount, onNode, ...opt }:\n { onAccount: AccountBase; onNode: Node } & Parameters<AccountBase['sign']>[1],\n): Promise<string> {\n const signature = await onAccount.sign(\n concatBuffers([\n Buffer.from((await onNode.getStatus()).networkId),\n ...ids.map((e) => decode(e)),\n ]),\n opt,\n );\n return Buffer.from(signature).toString('hex');\n}\n\n/**\n * Helper to generate a signature to delegate pre-claim/claim/transfer/revoke of a name to\n * a contract.\n * @category contract\n * @param contractId - Contract Id\n * @param opt - Options\n * @param opt.name - The name\n * @returns Signature for delegation\n * @example\n * ```js\n * const aeSdk = new AeSdk({ ... })\n * const contractId = 'ct_asd2ks...' // contract address\n * const name = 'example.chain' // AENS name\n * const onAccount = await aeSdk.address() // Sign with a specific account\n * // Preclaim signature\n * const preclaimSig = await aeSdk.createAensDelegationSignature(contractId, { onAccount: current })\n * // Claim, transfer and revoke signature\n * const aensDelegationSig = await contract.createAensDelegationSignature(\n * contractId, { name, onAccount: current }\n * )\n * ```\n */\nexport async function createAensDelegationSignature(\n contractId: Encoded.ContractAddress,\n opt: Parameters<AccountBase['address']>[0] & Parameters<typeof delegateSignatureCommon>[1] &\n { name?: AensName },\n): Promise<string> {\n return delegateSignatureCommon(\n [\n await opt.onAccount.address(opt),\n ...opt.name != null ? [produceNameId(opt.name)] : [],\n contractId,\n ],\n opt,\n );\n}\n\n/**\n * Helper to generate a signature to delegate register/extend/respond of a Oracle to a contract.\n * @category contract\n * @param contractId - Contract Id\n * @param opt - Options\n * @param opt.queryId - Oracle Query Id\n * @returns Signature for delegation\n * @example\n * ```js\n * const aeSdk = new AeSdk({ ... })\n * const contractId = 'ct_asd2ks...' // contract address\n * const queryId = 'oq_...' // Oracle Query Id\n * const onAccount = await aeSdk.address() // Sign with a specific account\n * // Oracle register and extend signature\n * const oracleDelegationSig = await aeSdk.createOracleDelegationSignature(contractId)\n * // Oracle respond signature\n * const respondSig = await aeSdk.createOracleDelegationSignature(contractId, { queryId })\n * ```\n */\nexport async function createOracleDelegationSignature(\n contractId: Encoded.ContractAddress,\n opt: Parameters<AccountBase['address']>[0] & Parameters<typeof delegateSignatureCommon>[1] &\n { queryId?: Encoded.OracleQueryId },\n): Promise<string> {\n return delegateSignatureCommon(\n [opt.queryId ?? await opt.onAccount.address(opt), contractId],\n opt,\n );\n}\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;SAGSA,a;SACAC,a;SACAC,M;SAIAC,OAAO,IAAIC,mB;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAeC,uBAAf,CACEC,GADF,QAImB;EAAA,IAFjB;IAAEC,SAAF;IAAaC,MAAb;IAAqB,GAAGC;EAAxB,CAEiB;EACjB,MAAMC,SAAS,GAAG,MAAMH,SAAS,CAACI,IAAV,CACtBV,aAAa,CAAC,CACZ,QAAOW,IAAP,CAAY,CAAC,MAAMJ,MAAM,CAACK,SAAP,EAAP,EAA2BC,SAAvC,CADY,EAEZ,GAAGR,GAAG,CAACS,GAAJ,CAASC,CAAD,IAAOd,MAAM,CAACc,CAAD,CAArB,CAFS,CAAD,CADS,EAKtBP,GALsB,CAAxB;EAOA,OAAO,QAAOG,IAAP,CAAYF,SAAZ,EAAuBO,QAAvB,CAAgC,KAAhC,CAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,eAAeC,6BAAf,CACLC,UADK,EAELV,GAFK,EAIY;EACjB,OAAOJ,uBAAuB,CAC5B,CACE,MAAMI,GAAG,CAACF,SAAJ,CAAca,OAAd,CAAsBX,GAAtB,CADR,EAEE,IAAGA,GAAG,CAACY,IAAJ,IAAY,IAAZ,GAAmB,CAACrB,aAAa,CAACS,GAAG,CAACY,IAAL,CAAd,CAAnB,GAA+C,EAAlD,CAFF,EAGEF,UAHF,CAD4B,EAM5BV,GAN4B,CAA9B;AAQD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,eAAea,+BAAf,CACLH,UADK,EAELV,GAFK,EAIY;EAAA;;EACjB,OAAOJ,uBAAuB,CAC5B,iBAACI,GAAG,CAACc,OAAL,uDAAgB,MAAMd,GAAG,CAACF,SAAJ,CAAca,OAAd,CAAsBX,GAAtB,CAAtB,EAAkDU,UAAlD,CAD4B,EAE5BV,GAF4B,CAA9B;AAID"}
@@ -1,143 +0,0 @@
1
- import BigNumber from 'bignumber.js';
2
- import { Tag } from '../tx/builder/constants';
3
- import { TxParamsCommon } from '../tx/builder/schema';
4
- import { AE_AMOUNT_FORMATS } from '../utils/amount-formatter';
5
- import { Encoding } from '../utils/encoder';
6
- export * from './methods';
7
- /**
8
- * @deprecated use NamePointer from apis/node instead
9
- * @hidden
10
- */
11
- export interface Pointer {
12
- key: string;
13
- id: string;
14
- }
15
- /**
16
- * @deprecated use genSalt instead
17
- * @hidden
18
- */
19
- export declare function salt(): number;
20
- /**
21
- * @deprecated use genSalt instead
22
- * @hidden
23
- */
24
- export declare const createSalt: typeof salt;
25
- /**
26
- * Calculate min fee
27
- * @category transaction builder
28
- * @param txType - Transaction type
29
- * @param options - Options object
30
- * @param options.params - Tx params
31
- * @deprecated use buildTx to generate transaction, unpack it and refer to `fee` field
32
- * @hidden
33
- * @example
34
- * ```js
35
- * calculateMinFee('spendTx', { gasLimit, params })
36
- * ```
37
- */
38
- export declare function calculateMinFee(txType: Tag, { params, vsn, denomination }: CalculateMinFeeOptions): BigNumber;
39
- interface CalculateMinFeeOptions {
40
- params: TxParamsCommon;
41
- vsn?: number;
42
- denomination?: AE_AMOUNT_FORMATS;
43
- }
44
- /**
45
- * @deprecated Maximum gas limit depends on transaction size, this value is outdated,
46
- * sdk check/provides gasLimit by itself while building a transaction
47
- * @hidden
48
- */
49
- export declare const GAS_MAX: number;
50
- /**
51
- * @deprecated use `Tag`
52
- * @hidden
53
- */
54
- export declare enum TX_TYPE {
55
- account = 10,
56
- signed = 11,
57
- spend = 12,
58
- oracleRegister = 22,
59
- oracleQuery = 23,
60
- oracleResponse = 24,
61
- oracleExtend = 25,
62
- nameClaim = 32,
63
- namePreClaim = 33,
64
- nameUpdate = 34,
65
- nameRevoke = 35,
66
- nameTransfer = 36,
67
- contract = 40,
68
- contractCallResult = 41,
69
- contractCreate = 42,
70
- contractCall = 43,
71
- channelCreate = 50,
72
- channelDeposit = 51,
73
- channelWithdraw = 52,
74
- channelCloseMutual = 53,
75
- channelCloseSolo = 54,
76
- channelSlash = 55,
77
- channelSettle = 56,
78
- channelOffChain = 57,
79
- channel = 58,
80
- channelSnapshotSolo = 59,
81
- proofOfInclusion = 60,
82
- stateTrees = 62,
83
- merklePatriciaTree = 63,
84
- merklePatriciaTreeValue = 64,
85
- sophiaByteCode = 70,
86
- gaAttach = 80,
87
- gaMeta = 81,
88
- payingFor = 82,
89
- channelForceProgress = 521,
90
- channelOffChainUpdateTransfer = 570,
91
- channelOffChainUpdateDeposit = 571,
92
- channelOffChainUpdateWithdrawal = 572,
93
- channelOffChainCreateContract = 573,
94
- channelOffChainCallContract = 574,
95
- channelReconnect = 575,
96
- contractsTree = 621,
97
- contractCallsTree = 622,
98
- channelsTree = 623,
99
- nameserviceTree = 624,
100
- oraclesTree = 625,
101
- accountsTree = 626
102
- }
103
- /**
104
- * @deprecated use `readId`, `writeId`
105
- * @hidden
106
- */
107
- export declare const ID_TAG: {
108
- readonly account: 1;
109
- readonly name: 2;
110
- readonly commitment: 3;
111
- readonly oracle: 4;
112
- readonly contract: 5;
113
- readonly channel: 6;
114
- };
115
- /**
116
- * @deprecated use `readId`, `writeId`
117
- * @hidden
118
- */
119
- export declare const PREFIX_ID_TAG: {
120
- readonly ak: 1;
121
- readonly nm: 2;
122
- readonly cm: 3;
123
- readonly ok: 4;
124
- readonly ct: 5;
125
- readonly ch: 6;
126
- };
127
- /**
128
- * @deprecated use `readId`, `writeId`
129
- * @hidden
130
- */
131
- export declare const ID_TAG_PREFIX: {
132
- [k: string]: Encoding;
133
- };
134
- /**
135
- * @deprecated use `getDefaultPointerKey`
136
- * @hidden
137
- */
138
- export declare enum POINTER_KEY_BY_PREFIX {
139
- ak = "account_pubkey",
140
- ok = "oracle_pubkey",
141
- ct = "contract_pubkey",
142
- ch = "channel"
143
- }
@@ -1,162 +0,0 @@
1
- import { buildTx } from "../tx/builder/index.mjs";
2
- import { calculateMinFee as calculateMinFeeInternal } from "../tx/builder/field-types/fee.mjs";
3
- import { mapObject } from "../utils/other.mjs";
4
- export * from "./methods.mjs";
5
- /**
6
- * @deprecated use NamePointer from apis/node instead
7
- * @hidden
8
- */
9
-
10
- /**
11
- * @deprecated use genSalt instead
12
- * @hidden
13
- */
14
- export function salt() {
15
- return Math.floor(Math.random() * Math.floor(Number.MAX_SAFE_INTEGER));
16
- }
17
- /**
18
- * @deprecated use genSalt instead
19
- * @hidden
20
- */
21
-
22
- export const createSalt = salt;
23
- /**
24
- * Calculate min fee
25
- * @category transaction builder
26
- * @param txType - Transaction type
27
- * @param options - Options object
28
- * @param options.params - Tx params
29
- * @deprecated use buildTx to generate transaction, unpack it and refer to `fee` field
30
- * @hidden
31
- * @example
32
- * ```js
33
- * calculateMinFee('spendTx', { gasLimit, params })
34
- * ```
35
- */
36
-
37
- export function calculateMinFee(txType, _ref) {
38
- let {
39
- params,
40
- vsn,
41
- denomination
42
- } = _ref;
43
- return calculateMinFeeInternal(txType, fee => // @ts-expect-error anyway this planned to be removed
44
- buildTx({ ...params,
45
- _computingMinFee: fee
46
- }, txType, {
47
- vsn,
48
- denomination
49
- }));
50
- }
51
-
52
- /**
53
- * @deprecated Maximum gas limit depends on transaction size, this value is outdated,
54
- * sdk check/provides gasLimit by itself while building a transaction
55
- * @hidden
56
- */
57
- export const GAS_MAX = 1600000 - 21000;
58
- /**
59
- * @deprecated use `Tag`
60
- * @hidden
61
- */
62
-
63
- export let TX_TYPE;
64
- /**
65
- * @deprecated use `readId`, `writeId`
66
- * @hidden
67
- */
68
-
69
- (function (TX_TYPE) {
70
- TX_TYPE[TX_TYPE["account"] = 10] = "account";
71
- TX_TYPE[TX_TYPE["signed"] = 11] = "signed";
72
- TX_TYPE[TX_TYPE["spend"] = 12] = "spend";
73
- TX_TYPE[TX_TYPE["oracleRegister"] = 22] = "oracleRegister";
74
- TX_TYPE[TX_TYPE["oracleQuery"] = 23] = "oracleQuery";
75
- TX_TYPE[TX_TYPE["oracleResponse"] = 24] = "oracleResponse";
76
- TX_TYPE[TX_TYPE["oracleExtend"] = 25] = "oracleExtend";
77
- TX_TYPE[TX_TYPE["nameClaim"] = 32] = "nameClaim";
78
- TX_TYPE[TX_TYPE["namePreClaim"] = 33] = "namePreClaim";
79
- TX_TYPE[TX_TYPE["nameUpdate"] = 34] = "nameUpdate";
80
- TX_TYPE[TX_TYPE["nameRevoke"] = 35] = "nameRevoke";
81
- TX_TYPE[TX_TYPE["nameTransfer"] = 36] = "nameTransfer";
82
- TX_TYPE[TX_TYPE["contract"] = 40] = "contract";
83
- TX_TYPE[TX_TYPE["contractCallResult"] = 41] = "contractCallResult";
84
- TX_TYPE[TX_TYPE["contractCreate"] = 42] = "contractCreate";
85
- TX_TYPE[TX_TYPE["contractCall"] = 43] = "contractCall";
86
- TX_TYPE[TX_TYPE["channelCreate"] = 50] = "channelCreate";
87
- TX_TYPE[TX_TYPE["channelDeposit"] = 51] = "channelDeposit";
88
- TX_TYPE[TX_TYPE["channelWithdraw"] = 52] = "channelWithdraw";
89
- TX_TYPE[TX_TYPE["channelCloseMutual"] = 53] = "channelCloseMutual";
90
- TX_TYPE[TX_TYPE["channelCloseSolo"] = 54] = "channelCloseSolo";
91
- TX_TYPE[TX_TYPE["channelSlash"] = 55] = "channelSlash";
92
- TX_TYPE[TX_TYPE["channelSettle"] = 56] = "channelSettle";
93
- TX_TYPE[TX_TYPE["channelOffChain"] = 57] = "channelOffChain";
94
- TX_TYPE[TX_TYPE["channel"] = 58] = "channel";
95
- TX_TYPE[TX_TYPE["channelSnapshotSolo"] = 59] = "channelSnapshotSolo";
96
- TX_TYPE[TX_TYPE["proofOfInclusion"] = 60] = "proofOfInclusion";
97
- TX_TYPE[TX_TYPE["stateTrees"] = 62] = "stateTrees";
98
- TX_TYPE[TX_TYPE["merklePatriciaTree"] = 63] = "merklePatriciaTree";
99
- TX_TYPE[TX_TYPE["merklePatriciaTreeValue"] = 64] = "merklePatriciaTreeValue";
100
- TX_TYPE[TX_TYPE["sophiaByteCode"] = 70] = "sophiaByteCode";
101
- TX_TYPE[TX_TYPE["gaAttach"] = 80] = "gaAttach";
102
- TX_TYPE[TX_TYPE["gaMeta"] = 81] = "gaMeta";
103
- TX_TYPE[TX_TYPE["payingFor"] = 82] = "payingFor";
104
- TX_TYPE[TX_TYPE["channelForceProgress"] = 521] = "channelForceProgress";
105
- TX_TYPE[TX_TYPE["channelOffChainUpdateTransfer"] = 570] = "channelOffChainUpdateTransfer";
106
- TX_TYPE[TX_TYPE["channelOffChainUpdateDeposit"] = 571] = "channelOffChainUpdateDeposit";
107
- TX_TYPE[TX_TYPE["channelOffChainUpdateWithdrawal"] = 572] = "channelOffChainUpdateWithdrawal";
108
- TX_TYPE[TX_TYPE["channelOffChainCreateContract"] = 573] = "channelOffChainCreateContract";
109
- TX_TYPE[TX_TYPE["channelOffChainCallContract"] = 574] = "channelOffChainCallContract";
110
- TX_TYPE[TX_TYPE["channelReconnect"] = 575] = "channelReconnect";
111
- TX_TYPE[TX_TYPE["contractsTree"] = 621] = "contractsTree";
112
- TX_TYPE[TX_TYPE["contractCallsTree"] = 622] = "contractCallsTree";
113
- TX_TYPE[TX_TYPE["channelsTree"] = 623] = "channelsTree";
114
- TX_TYPE[TX_TYPE["nameserviceTree"] = 624] = "nameserviceTree";
115
- TX_TYPE[TX_TYPE["oraclesTree"] = 625] = "oraclesTree";
116
- TX_TYPE[TX_TYPE["accountsTree"] = 626] = "accountsTree";
117
- })(TX_TYPE || (TX_TYPE = {}));
118
-
119
- export const ID_TAG = {
120
- account: 1,
121
- name: 2,
122
- commitment: 3,
123
- oracle: 4,
124
- contract: 5,
125
- channel: 6
126
- };
127
- /**
128
- * @deprecated use `readId`, `writeId`
129
- * @hidden
130
- */
131
-
132
- export const PREFIX_ID_TAG = {
133
- ak: ID_TAG.account,
134
- nm: ID_TAG.name,
135
- cm: ID_TAG.commitment,
136
- ok: ID_TAG.oracle,
137
- ct: ID_TAG.contract,
138
- ch: ID_TAG.channel
139
- };
140
- /**
141
- * @deprecated use `readId`, `writeId`
142
- * @hidden
143
- */
144
-
145
- export const ID_TAG_PREFIX = mapObject(PREFIX_ID_TAG, _ref2 => {
146
- let [key, value] = _ref2;
147
- return [value, key];
148
- });
149
- /**
150
- * @deprecated use `getDefaultPointerKey`
151
- * @hidden
152
- */
153
-
154
- export let POINTER_KEY_BY_PREFIX;
155
-
156
- (function (POINTER_KEY_BY_PREFIX) {
157
- POINTER_KEY_BY_PREFIX["ak"] = "account_pubkey";
158
- POINTER_KEY_BY_PREFIX["ok"] = "oracle_pubkey";
159
- POINTER_KEY_BY_PREFIX["ct"] = "contract_pubkey";
160
- POINTER_KEY_BY_PREFIX["ch"] = "channel";
161
- })(POINTER_KEY_BY_PREFIX || (POINTER_KEY_BY_PREFIX = {}));
162
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":["buildTx","calculateMinFee","calculateMinFeeInternal","mapObject","salt","Math","floor","random","Number","MAX_SAFE_INTEGER","createSalt","txType","params","vsn","denomination","fee","_computingMinFee","GAS_MAX","TX_TYPE","ID_TAG","account","name","commitment","oracle","contract","channel","PREFIX_ID_TAG","ak","nm","cm","ok","ct","ch","ID_TAG_PREFIX","key","value","POINTER_KEY_BY_PREFIX"],"sources":["../../src/deprecated/index.ts"],"sourcesContent":["import BigNumber from 'bignumber.js';\nimport { buildTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\nimport { calculateMinFee as calculateMinFeeInternal } from '../tx/builder/field-types/fee';\nimport { TxParamsCommon } from '../tx/builder/schema';\nimport { AE_AMOUNT_FORMATS } from '../utils/amount-formatter';\nimport { mapObject } from '../utils/other';\nimport { Encoding } from '../utils/encoder';\n\nexport * from './methods';\n\n/**\n * @deprecated use NamePointer from apis/node instead\n * @hidden\n */\nexport interface Pointer {\n key: string;\n id: string;\n}\n\n/**\n * @deprecated use genSalt instead\n * @hidden\n */\nexport function salt(): number {\n return Math.floor(Math.random() * Math.floor(Number.MAX_SAFE_INTEGER));\n}\n\n/**\n * @deprecated use genSalt instead\n * @hidden\n */\nexport const createSalt = salt;\n\n/**\n * Calculate min fee\n * @category transaction builder\n * @param txType - Transaction type\n * @param options - Options object\n * @param options.params - Tx params\n * @deprecated use buildTx to generate transaction, unpack it and refer to `fee` field\n * @hidden\n * @example\n * ```js\n * calculateMinFee('spendTx', { gasLimit, params })\n * ```\n */\nexport function calculateMinFee(\n txType: Tag,\n { params, vsn, denomination }: CalculateMinFeeOptions,\n): BigNumber {\n return calculateMinFeeInternal(\n txType,\n (fee: BigNumber) => (\n // @ts-expect-error anyway this planned to be removed\n buildTx({ ...params, _computingMinFee: fee }, txType, { vsn, denomination })\n ),\n );\n}\n\ninterface CalculateMinFeeOptions {\n params: TxParamsCommon;\n vsn?: number;\n denomination?: AE_AMOUNT_FORMATS;\n}\n\n/**\n * @deprecated Maximum gas limit depends on transaction size, this value is outdated,\n * sdk check/provides gasLimit by itself while building a transaction\n * @hidden\n */\nexport const GAS_MAX = 1600000 - 21000;\n\n/**\n * @deprecated use `Tag`\n * @hidden\n */\nexport enum TX_TYPE {\n account = 10,\n signed = 11,\n spend = 12,\n oracleRegister = 22,\n oracleQuery = 23,\n oracleResponse = 24,\n oracleExtend = 25,\n nameClaim = 32,\n namePreClaim = 33,\n nameUpdate = 34,\n nameRevoke = 35,\n nameTransfer = 36,\n contract = 40,\n contractCallResult = 41,\n contractCreate = 42,\n contractCall = 43,\n channelCreate = 50,\n channelDeposit = 51,\n channelWithdraw = 52,\n channelCloseMutual = 53,\n channelCloseSolo = 54,\n channelSlash = 55,\n channelSettle = 56,\n channelOffChain = 57,\n channel = 58,\n channelSnapshotSolo = 59,\n proofOfInclusion = 60,\n stateTrees = 62,\n merklePatriciaTree = 63,\n merklePatriciaTreeValue = 64,\n sophiaByteCode = 70,\n gaAttach = 80,\n gaMeta = 81,\n payingFor = 82,\n channelForceProgress = 521,\n channelOffChainUpdateTransfer = 570,\n channelOffChainUpdateDeposit = 571,\n channelOffChainUpdateWithdrawal = 572,\n channelOffChainCreateContract = 573,\n channelOffChainCallContract = 574,\n channelReconnect = 575,\n contractsTree = 621,\n contractCallsTree = 622,\n channelsTree = 623,\n nameserviceTree = 624,\n oraclesTree = 625,\n accountsTree = 626,\n}\n\n/**\n * @deprecated use `readId`, `writeId`\n * @hidden\n */\nexport const ID_TAG = {\n account: 1,\n name: 2,\n commitment: 3,\n oracle: 4,\n contract: 5,\n channel: 6,\n} as const;\n\n/**\n * @deprecated use `readId`, `writeId`\n * @hidden\n */\nexport const PREFIX_ID_TAG = {\n ak: ID_TAG.account,\n nm: ID_TAG.name,\n cm: ID_TAG.commitment,\n ok: ID_TAG.oracle,\n ct: ID_TAG.contract,\n ch: ID_TAG.channel,\n} as const;\n\n/**\n * @deprecated use `readId`, `writeId`\n * @hidden\n */\nexport const ID_TAG_PREFIX = mapObject(\n PREFIX_ID_TAG,\n ([key, value]: [Encoding, number]) => [value, key],\n);\n\n/**\n * @deprecated use `getDefaultPointerKey`\n * @hidden\n */\nexport enum POINTER_KEY_BY_PREFIX {\n ak = 'account_pubkey',\n ok = 'oracle_pubkey',\n ct = 'contract_pubkey',\n ch = 'channel',\n}\n"],"mappings":"SACSA,O;SAEAC,eAAe,IAAIC,uB;SAGnBC,S;;AAKT;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA,OAAO,SAASC,IAAT,GAAwB;EAC7B,OAAOC,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACE,MAAL,KAAgBF,IAAI,CAACC,KAAL,CAAWE,MAAM,CAACC,gBAAlB,CAA3B,CAAP;AACD;AAED;AACA;AACA;AACA;;AACA,OAAO,MAAMC,UAAU,GAAGN,IAAnB;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASH,eAAT,CACLU,MADK,QAGM;EAAA,IADX;IAAEC,MAAF;IAAUC,GAAV;IAAeC;EAAf,CACW;EACX,OAAOZ,uBAAuB,CAC5BS,MAD4B,EAE3BI,GAAD,IACE;EACAf,OAAO,CAAC,EAAE,GAAGY,MAAL;IAAaI,gBAAgB,EAAED;EAA/B,CAAD,EAAuCJ,MAAvC,EAA+C;IAAEE,GAAF;IAAOC;EAAP,CAA/C,CAJmB,CAA9B;AAOD;;AAQD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,OAAO,GAAG,UAAU,KAA1B;AAEP;AACA;AACA;AACA;;AACA,WAAYC,OAAZ;AAkDA;AACA;AACA;AACA;;WArDYA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;EAAAA,O,CAAAA,O;GAAAA,O,KAAAA,O;;AAsDZ,OAAO,MAAMC,MAAM,GAAG;EACpBC,OAAO,EAAE,CADW;EAEpBC,IAAI,EAAE,CAFc;EAGpBC,UAAU,EAAE,CAHQ;EAIpBC,MAAM,EAAE,CAJY;EAKpBC,QAAQ,EAAE,CALU;EAMpBC,OAAO,EAAE;AANW,CAAf;AASP;AACA;AACA;AACA;;AACA,OAAO,MAAMC,aAAa,GAAG;EAC3BC,EAAE,EAAER,MAAM,CAACC,OADgB;EAE3BQ,EAAE,EAAET,MAAM,CAACE,IAFgB;EAG3BQ,EAAE,EAAEV,MAAM,CAACG,UAHgB;EAI3BQ,EAAE,EAAEX,MAAM,CAACI,MAJgB;EAK3BQ,EAAE,EAAEZ,MAAM,CAACK,QALgB;EAM3BQ,EAAE,EAAEb,MAAM,CAACM;AANgB,CAAtB;AASP;AACA;AACA;AACA;;AACA,OAAO,MAAMQ,aAAa,GAAG9B,SAAS,CACpCuB,aADoC,EAEpC;EAAA,IAAC,CAACQ,GAAD,EAAMC,KAAN,CAAD;EAAA,OAAsC,CAACA,KAAD,EAAQD,GAAR,CAAtC;AAAA,CAFoC,CAA/B;AAKP;AACA;AACA;AACA;;AACA,WAAYE,qBAAZ;;WAAYA,qB;EAAAA,qB;EAAAA,qB;EAAAA,qB;EAAAA,qB;GAAAA,qB,KAAAA,qB"}
@@ -1,18 +0,0 @@
1
- import { Encoded } from '../utils/encoder';
2
- import { createMetaTx } from '../contract/ga';
3
- import Node from '../Node';
4
- /**
5
- * @deprecated Use createMetaTx instead
6
- * @hidden
7
- */
8
- export declare function signUsingGA(tx: Encoded.Transaction, { authData, authFun, ...options }: {
9
- authData: Parameters<typeof createMetaTx>[1];
10
- authFun: Parameters<typeof createMetaTx>[2];
11
- } & Parameters<typeof createMetaTx>[3]): Promise<Encoded.Transaction>;
12
- /**
13
- * @deprecated Use getHeight instead
14
- * @hidden
15
- */
16
- export declare function height({ onNode }: {
17
- onNode: Node;
18
- }): Promise<number>;
@@ -1,26 +0,0 @@
1
- import { createMetaTx } from "../contract/ga.mjs";
2
-
3
- /**
4
- * @deprecated Use createMetaTx instead
5
- * @hidden
6
- */
7
- export async function signUsingGA(tx, _ref) {
8
- let {
9
- authData,
10
- authFun,
11
- ...options
12
- } = _ref;
13
- return createMetaTx(tx, authData, authFun, options);
14
- }
15
- /**
16
- * @deprecated Use getHeight instead
17
- * @hidden
18
- */
19
-
20
- export async function height(_ref2) {
21
- let {
22
- onNode
23
- } = _ref2;
24
- return (await onNode.getCurrentKeyBlockHeight()).height;
25
- }
26
- //# sourceMappingURL=methods.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"methods.mjs","names":["createMetaTx","signUsingGA","tx","authData","authFun","options","height","onNode","getCurrentKeyBlockHeight"],"sources":["../../src/deprecated/methods.ts"],"sourcesContent":["import { Encoded } from '../utils/encoder';\nimport { createMetaTx } from '../contract/ga';\nimport Node from '../Node';\n\n/**\n * @deprecated Use createMetaTx instead\n * @hidden\n */\nexport async function signUsingGA(\n tx: Encoded.Transaction,\n { authData, authFun, ...options }: {\n authData: Parameters<typeof createMetaTx>[1];\n authFun: Parameters<typeof createMetaTx>[2];\n } & Parameters<typeof createMetaTx>[3],\n): Promise<Encoded.Transaction> {\n return createMetaTx(tx, authData, authFun, options);\n}\n\n/**\n * @deprecated Use getHeight instead\n * @hidden\n */\nexport async function height({ onNode }: { onNode: Node }): Promise<number> {\n return (await onNode.getCurrentKeyBlockHeight()).height;\n}\n"],"mappings":"SACSA,Y;;AAGT;AACA;AACA;AACA;AACA,OAAO,eAAeC,WAAf,CACLC,EADK,QAMyB;EAAA,IAJ9B;IAAEC,QAAF;IAAYC,OAAZ;IAAqB,GAAGC;EAAxB,CAI8B;EAC9B,OAAOL,YAAY,CAACE,EAAD,EAAKC,QAAL,EAAeC,OAAf,EAAwBC,OAAxB,CAAnB;AACD;AAED;AACA;AACA;AACA;;AACA,OAAO,eAAeC,MAAf,QAAqE;EAAA,IAA/C;IAAEC;EAAF,CAA+C;EAC1E,OAAO,CAAC,MAAMA,MAAM,CAACC,wBAAP,EAAP,EAA0CF,MAAjD;AACD"}
@@ -1,25 +0,0 @@
1
- /// <reference types="node" />
2
- import { Encoded } from '../../utils/encoder';
3
- /**
4
- * Map of prefix to ID tag constant
5
- * @see {@link https://github.com/aeternity/protocol/blob/master/serializations.md#the-id-type}
6
- * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_id.erl#L97-L102}
7
- * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L163-L168}
8
- */
9
- declare const idTagToEncoding: readonly [Encoded.Encoding.AccountAddress, Encoded.Encoding.Name, Encoded.Encoding.Commitment, Encoded.Encoding.OracleAddress, Encoded.Encoding.ContractAddress, Encoded.Encoding.Channel];
10
- declare type AddressEncodings = typeof idTagToEncoding[number];
11
- /**
12
- * Utility function to create and _id type
13
- * @category transaction builder
14
- * @param hashId - Encoded hash
15
- * @returns Buffer Buffer with ID tag and decoded HASh
16
- */
17
- export declare function writeId(hashId: Encoded.Generic<AddressEncodings>): Buffer;
18
- /**
19
- * Utility function to read and _id type
20
- * @category transaction builder
21
- * @param buf - Data
22
- * @returns Encoided hash string with prefix
23
- */
24
- export declare function readId(buf: Buffer): Encoded.Generic<AddressEncodings>;
25
- export {};
@@ -1,45 +0,0 @@
1
- import _buffer from "buffer";
2
- const {
3
- Buffer: _Buffer
4
- } = _buffer;
5
- import { ArgumentError, PrefixNotFoundError, TagNotFoundError } from "../../utils/errors.mjs";
6
- import { toBytes } from "../../utils/bytes.mjs";
7
- import { decode, encode, Encoding } from "../../utils/encoder.mjs";
8
- import { isItemOfArray } from "../../utils/other.mjs";
9
- /**
10
- * Map of prefix to ID tag constant
11
- * @see {@link https://github.com/aeternity/protocol/blob/master/serializations.md#the-id-type}
12
- * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_id.erl#L97-L102}
13
- * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L163-L168}
14
- */
15
-
16
- const idTagToEncoding = [Encoding.AccountAddress, Encoding.Name, Encoding.Commitment, Encoding.OracleAddress, Encoding.ContractAddress, Encoding.Channel];
17
-
18
- /**
19
- * Utility function to create and _id type
20
- * @category transaction builder
21
- * @param hashId - Encoded hash
22
- * @returns Buffer Buffer with ID tag and decoded HASh
23
- */
24
- export function writeId(hashId) {
25
- if (typeof hashId !== 'string') throw new ArgumentError('hashId', 'a string', hashId);
26
- const encoding = hashId.slice(0, 2);
27
- if (!isItemOfArray(encoding, idTagToEncoding)) throw new TagNotFoundError(encoding);
28
- const idTag = idTagToEncoding.indexOf(encoding) + 1;
29
- return _Buffer.from([...toBytes(idTag), ...decode(hashId)]);
30
- }
31
- /**
32
- * Utility function to read and _id type
33
- * @category transaction builder
34
- * @param buf - Data
35
- * @returns Encoided hash string with prefix
36
- */
37
-
38
- export function readId(buf) {
39
- const idTag = _Buffer.from(buf).readUIntBE(0, 1);
40
-
41
- const encoding = idTagToEncoding[idTag - 1];
42
- if (encoding == null) throw new PrefixNotFoundError(idTag);
43
- return encode(buf.slice(1, buf.length), encoding);
44
- }
45
- //# sourceMappingURL=address.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"address.mjs","names":["ArgumentError","PrefixNotFoundError","TagNotFoundError","toBytes","decode","encode","Encoding","isItemOfArray","idTagToEncoding","AccountAddress","Name","Commitment","OracleAddress","ContractAddress","Channel","writeId","hashId","encoding","slice","idTag","indexOf","from","readId","buf","readUIntBE","length"],"sources":["../../../src/tx/builder/address.ts"],"sourcesContent":["import { ArgumentError, PrefixNotFoundError, TagNotFoundError } from '../../utils/errors';\nimport { toBytes } from '../../utils/bytes';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../utils/encoder';\nimport { isItemOfArray } from '../../utils/other';\n\n/**\n * Map of prefix to ID tag constant\n * @see {@link https://github.com/aeternity/protocol/blob/master/serializations.md#the-id-type}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_id.erl#L97-L102}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L163-L168}\n */\nconst idTagToEncoding = [\n Encoding.AccountAddress,\n Encoding.Name,\n Encoding.Commitment,\n Encoding.OracleAddress,\n Encoding.ContractAddress,\n Encoding.Channel,\n] as const;\n\ntype AddressEncodings = typeof idTagToEncoding[number];\n\n/**\n * Utility function to create and _id type\n * @category transaction builder\n * @param hashId - Encoded hash\n * @returns Buffer Buffer with ID tag and decoded HASh\n */\nexport function writeId(hashId: Encoded.Generic<AddressEncodings>): Buffer {\n if (typeof hashId !== 'string') throw new ArgumentError('hashId', 'a string', hashId);\n const encoding = hashId.slice(0, 2);\n if (!isItemOfArray(encoding, idTagToEncoding)) throw new TagNotFoundError(encoding);\n const idTag = idTagToEncoding.indexOf(encoding) + 1;\n return Buffer.from([...toBytes(idTag), ...decode(hashId)]);\n}\n\n/**\n * Utility function to read and _id type\n * @category transaction builder\n * @param buf - Data\n * @returns Encoided hash string with prefix\n */\nexport function readId(buf: Buffer): Encoded.Generic<AddressEncodings> {\n const idTag = Buffer.from(buf).readUIntBE(0, 1);\n const encoding = idTagToEncoding[idTag - 1];\n if (encoding == null) throw new PrefixNotFoundError(idTag);\n return encode(buf.slice(1, buf.length), encoding);\n}\n"],"mappings":";;;;SAASA,a,EAAeC,mB,EAAqBC,gB;SACpCC,O;SAEPC,M,EAAQC,M,EAAiBC,Q;SAElBC,a;AAET;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,eAAe,GAAG,CACtBF,QAAQ,CAACG,cADa,EAEtBH,QAAQ,CAACI,IAFa,EAGtBJ,QAAQ,CAACK,UAHa,EAItBL,QAAQ,CAACM,aAJa,EAKtBN,QAAQ,CAACO,eALa,EAMtBP,QAAQ,CAACQ,OANa,CAAxB;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,OAAT,CAAiBC,MAAjB,EAAoE;EACzE,IAAI,OAAOA,MAAP,KAAkB,QAAtB,EAAgC,MAAM,IAAIhB,aAAJ,CAAkB,QAAlB,EAA4B,UAA5B,EAAwCgB,MAAxC,CAAN;EAChC,MAAMC,QAAQ,GAAGD,MAAM,CAACE,KAAP,CAAa,CAAb,EAAgB,CAAhB,CAAjB;EACA,IAAI,CAACX,aAAa,CAACU,QAAD,EAAWT,eAAX,CAAlB,EAA+C,MAAM,IAAIN,gBAAJ,CAAqBe,QAArB,CAAN;EAC/C,MAAME,KAAK,GAAGX,eAAe,CAACY,OAAhB,CAAwBH,QAAxB,IAAoC,CAAlD;EACA,OAAO,QAAOI,IAAP,CAAY,CAAC,GAAGlB,OAAO,CAACgB,KAAD,CAAX,EAAoB,GAAGf,MAAM,CAACY,MAAD,CAA7B,CAAZ,CAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASM,MAAT,CAAgBC,GAAhB,EAAgE;EACrE,MAAMJ,KAAK,GAAG,QAAOE,IAAP,CAAYE,GAAZ,EAAiBC,UAAjB,CAA4B,CAA5B,EAA+B,CAA/B,CAAd;;EACA,MAAMP,QAAQ,GAAGT,eAAe,CAACW,KAAK,GAAG,CAAT,CAAhC;EACA,IAAIF,QAAQ,IAAI,IAAhB,EAAsB,MAAM,IAAIhB,mBAAJ,CAAwBkB,KAAxB,CAAN;EACtB,OAAOd,MAAM,CAACkB,GAAG,CAACL,KAAJ,CAAU,CAAV,EAAaK,GAAG,CAACE,MAAjB,CAAD,EAA2BR,QAA3B,CAAb;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mjs","names":[],"sources":["../../../src/typings/@aeternity__argon2-browser/index.d.ts"],"sourcesContent":["declare module '@aeternity/argon2-browser/dist/argon2-bundled.min.js' {\n export * from 'argon2-browser';\n}\n"],"mappings":""}