@aeternity/aepp-sdk 11.0.1 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) 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 +12 -19
  4. package/dist/aepp-sdk.browser-script.js.map +1 -1
  5. package/dist/aepp-sdk.browser.js +1 -1
  6. package/dist/aepp-sdk.browser.js.map +1 -1
  7. package/dist/aepp-sdk.js +1 -1
  8. package/dist/aepp-sdk.js.map +1 -1
  9. package/es/AeSdk.d.ts +37 -0
  10. package/es/AeSdk.mjs +81 -0
  11. package/es/AeSdk.mjs.map +1 -0
  12. package/es/AeSdkAepp.d.ts +69 -0
  13. package/es/AeSdkAepp.mjs +175 -0
  14. package/es/AeSdkAepp.mjs.map +1 -0
  15. package/es/AeSdkBase.d.ts +212 -0
  16. package/es/AeSdkBase.mjs +310 -0
  17. package/es/AeSdkBase.mjs.map +1 -0
  18. package/es/AeSdkWallet.d.ts +103 -0
  19. package/es/AeSdkWallet.mjs +322 -0
  20. package/es/AeSdkWallet.mjs.map +1 -0
  21. package/es/Node.d.ts +44 -0
  22. package/es/Node.mjs +141 -0
  23. package/es/Node.mjs.map +1 -0
  24. package/es/account/Base.d.ts +65 -0
  25. package/es/account/Base.mjs +123 -0
  26. package/es/account/Base.mjs.map +1 -0
  27. package/es/account/Memory.d.ts +25 -0
  28. package/es/account/Memory.mjs +81 -0
  29. package/es/account/Memory.mjs.map +1 -0
  30. package/es/account/Rpc.d.ts +27 -0
  31. package/es/account/Rpc.mjs +79 -0
  32. package/es/account/Rpc.mjs.map +1 -0
  33. package/es/aens.d.ts +209 -0
  34. package/es/aens.mjs +332 -0
  35. package/es/aens.mjs.map +1 -0
  36. package/es/aepp-wallet-communication/connection/Browser.d.ts +32 -0
  37. package/es/aepp-wallet-communication/connection/Browser.mjs +70 -0
  38. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -0
  39. package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +17 -0
  40. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +57 -0
  41. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -0
  42. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +35 -0
  43. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +142 -0
  44. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -0
  45. package/es/aepp-wallet-communication/connection-proxy.d.ts +10 -0
  46. package/{src/utils/crypto-ts.ts → es/aepp-wallet-communication/connection-proxy.mjs} +15 -11
  47. package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -0
  48. package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +33 -0
  49. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +169 -0
  50. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -0
  51. package/es/aepp-wallet-communication/rpc/types.d.ts +77 -0
  52. package/es/aepp-wallet-communication/rpc/types.mjs +3 -0
  53. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -0
  54. package/es/aepp-wallet-communication/schema.d.ts +90 -46
  55. package/es/aepp-wallet-communication/schema.mjs +214 -0
  56. package/es/aepp-wallet-communication/schema.mjs.map +1 -0
  57. package/es/aepp-wallet-communication/wallet-detector.d.ts +24 -0
  58. package/es/aepp-wallet-communication/wallet-detector.mjs +63 -0
  59. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -0
  60. package/es/apis/compiler/compiler.d.ts +92 -0
  61. package/es/apis/compiler/compiler.mjs +576 -0
  62. package/es/apis/compiler/compiler.mjs.map +1 -0
  63. package/es/apis/compiler/index.d.ts +2 -0
  64. package/es/apis/compiler/index.mjs +3 -0
  65. package/es/apis/compiler/index.mjs.map +1 -0
  66. package/es/apis/compiler/models/index.d.ts +248 -0
  67. package/es/apis/compiler/models/index.mjs +48 -0
  68. package/es/apis/compiler/models/index.mjs.map +1 -0
  69. package/es/apis/compiler/models/mappers.d.ts +23 -0
  70. package/es/apis/compiler/models/mappers.mjs +585 -0
  71. package/es/apis/compiler/models/mappers.mjs.map +1 -0
  72. package/es/apis/compiler/models/parameters.d.ts +13 -0
  73. package/es/apis/compiler/models/parameters.mjs +71 -0
  74. package/es/apis/compiler/models/parameters.mjs.map +1 -0
  75. package/es/apis/node/index.d.ts +2 -0
  76. package/es/apis/node/index.mjs +3 -0
  77. package/es/apis/node/index.mjs.map +1 -0
  78. package/es/apis/node/models/index.d.ts +1061 -0
  79. package/es/apis/node/models/index.mjs +2 -0
  80. package/es/apis/node/models/index.mjs.map +1 -0
  81. package/es/apis/node/models/mappers.d.ts +95 -0
  82. package/es/apis/node/models/mappers.mjs +4164 -0
  83. package/es/apis/node/models/mappers.mjs.map +1 -0
  84. package/es/apis/node/models/parameters.d.ts +17 -0
  85. package/es/apis/node/models/parameters.mjs +165 -0
  86. package/es/apis/node/models/parameters.mjs.map +1 -0
  87. package/es/apis/node/node.d.ts +215 -0
  88. package/es/apis/node/node.mjs +1165 -0
  89. package/es/apis/node/node.mjs.map +1 -0
  90. package/es/chain.d.ts +220 -0
  91. package/es/chain.mjs +524 -0
  92. package/es/chain.mjs.map +1 -0
  93. package/es/channel/handlers.d.ts +34 -0
  94. package/es/channel/handlers.mjs +147 -112
  95. package/es/channel/handlers.mjs.map +1 -1
  96. package/es/channel/index.d.ts +634 -0
  97. package/es/channel/index.mjs +898 -900
  98. package/es/channel/index.mjs.map +1 -1
  99. package/es/channel/internal.d.ts +100 -0
  100. package/es/channel/internal.mjs +97 -51
  101. package/es/channel/internal.mjs.map +1 -1
  102. package/es/contract/Compiler.d.ts +17 -0
  103. package/es/contract/Compiler.mjs +67 -0
  104. package/es/contract/Compiler.mjs.map +1 -0
  105. package/es/contract/aci.d.ts +125 -0
  106. package/es/contract/aci.mjs +199 -180
  107. package/es/contract/aci.mjs.map +1 -1
  108. package/es/contract/ga.d.ts +68 -0
  109. package/es/contract/ga.mjs +190 -0
  110. package/es/contract/ga.mjs.map +1 -0
  111. package/es/contract/methods.d.ts +68 -0
  112. package/es/contract/methods.mjs +101 -0
  113. package/es/contract/methods.mjs.map +1 -0
  114. package/es/index.d.ts +32 -0
  115. package/es/index.mjs +32 -40
  116. package/es/index.mjs.map +1 -1
  117. package/es/oracle.d.ts +154 -0
  118. package/es/oracle.mjs +288 -0
  119. package/es/oracle.mjs.map +1 -0
  120. package/es/spend.d.ts +61 -0
  121. package/es/spend.mjs +122 -0
  122. package/es/spend.mjs.map +1 -0
  123. package/es/tx/builder/constants.d.ts +41 -0
  124. package/es/tx/builder/constants.mjs +11 -19
  125. package/es/tx/builder/constants.mjs.map +1 -1
  126. package/es/tx/builder/field-types.d.ts +62 -0
  127. package/es/tx/builder/field-types.mjs +62 -10
  128. package/es/tx/builder/field-types.mjs.map +1 -1
  129. package/es/tx/builder/helpers.d.ts +131 -0
  130. package/es/tx/builder/helpers.mjs +71 -169
  131. package/es/tx/builder/helpers.mjs.map +1 -1
  132. package/es/tx/builder/index.d.ts +75 -0
  133. package/es/tx/builder/index.mjs +141 -323
  134. package/es/tx/builder/index.mjs.map +1 -1
  135. package/es/tx/builder/schema.d.ts +350 -0
  136. package/es/tx/builder/schema.mjs +173 -510
  137. package/es/tx/builder/schema.mjs.map +1 -1
  138. package/es/tx/index.d.ts +63 -0
  139. package/es/tx/index.mjs +171 -265
  140. package/es/tx/index.mjs.map +1 -1
  141. package/es/tx/min-fee.d.ts +20 -0
  142. package/es/tx/min-fee.mjs +148 -0
  143. package/es/tx/min-fee.mjs.map +1 -0
  144. package/es/tx/validator.d.ts +19 -0
  145. package/es/tx/validator.mjs +64 -71
  146. package/es/tx/validator.mjs.map +1 -1
  147. package/es/typings/@aeternity__argon2-browser/index.d.mjs +2 -0
  148. package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +1 -0
  149. package/es/typings/@aeternity__uuid/index.d.mjs +2 -0
  150. package/es/typings/@aeternity__uuid/index.d.mjs.map +1 -0
  151. package/es/typings/bip32-path/index.d.mjs +2 -0
  152. package/es/typings/bip32-path/index.d.mjs.map +1 -0
  153. package/es/typings/blakejs/index.d.mjs.map +1 -1
  154. package/es/typings/tweetnacl-auth/index.d.mjs +2 -0
  155. package/es/typings/tweetnacl-auth/index.d.mjs.map +1 -0
  156. package/es/utils/amount-formatter.d.ts +42 -0
  157. package/es/utils/amount-formatter.mjs +28 -41
  158. package/es/utils/amount-formatter.mjs.map +1 -1
  159. package/es/utils/autorest.d.ts +6 -0
  160. package/es/utils/autorest.mjs +97 -0
  161. package/es/utils/autorest.mjs.map +1 -0
  162. package/es/utils/bignumber.d.ts +13 -0
  163. package/es/utils/bignumber.mjs +10 -8
  164. package/es/utils/bignumber.mjs.map +1 -1
  165. package/es/{bytes.d.ts → utils/bytes.d.ts} +10 -13
  166. package/es/utils/bytes.mjs +10 -14
  167. package/es/utils/bytes.mjs.map +1 -1
  168. package/es/utils/crypto.d.ts +103 -0
  169. package/es/utils/crypto.mjs +60 -68
  170. package/es/utils/crypto.mjs.map +1 -1
  171. package/es/utils/encoder.d.ts +26 -0
  172. package/es/utils/encoder.mjs +47 -51
  173. package/es/utils/encoder.mjs.map +1 -1
  174. package/es/{errors.d.ts → utils/errors.d.ts} +254 -57
  175. package/es/utils/errors.mjs +318 -125
  176. package/es/utils/errors.mjs.map +1 -1
  177. package/es/utils/hd-wallet.d.ts +34 -0
  178. package/es/utils/hd-wallet.mjs +27 -16
  179. package/es/utils/hd-wallet.mjs.map +1 -1
  180. package/es/utils/json-big.d.ts +5 -0
  181. package/es/utils/json-big.mjs +10 -14
  182. package/es/utils/json-big.mjs.map +1 -1
  183. package/es/utils/keystore.d.ts +51 -0
  184. package/es/utils/keystore.mjs +98 -193
  185. package/es/utils/keystore.mjs.map +1 -1
  186. package/es/{mptree.d.ts → utils/mptree.d.ts} +5 -8
  187. package/es/utils/mptree.mjs +13 -14
  188. package/es/utils/mptree.mjs.map +1 -1
  189. package/es/utils/other.d.ts +14 -0
  190. package/es/utils/other.mjs +21 -36
  191. package/es/utils/other.mjs.map +1 -1
  192. package/es/{semver-satisfies.d.ts → utils/semver-satisfies.d.ts} +0 -0
  193. package/es/utils/semver-satisfies.mjs.map +1 -1
  194. package/es/utils/string.d.ts +24 -0
  195. package/es/utils/string.mjs +8 -10
  196. package/es/utils/string.mjs.map +1 -1
  197. package/package.json +49 -39
  198. package/src/AeSdk.ts +65 -0
  199. package/src/AeSdkAepp.ts +167 -0
  200. package/src/AeSdkBase.ts +320 -0
  201. package/src/AeSdkWallet.ts +332 -0
  202. package/src/Node.ts +167 -0
  203. package/src/account/Base.ts +114 -0
  204. package/src/account/Memory.ts +83 -0
  205. package/src/account/Rpc.ts +67 -0
  206. package/src/aens.ts +391 -0
  207. package/src/aepp-wallet-communication/connection/Browser.ts +68 -0
  208. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +58 -0
  209. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +111 -0
  210. package/{es/utils/crypto-ts.mjs → src/aepp-wallet-communication/connection-proxy.ts} +16 -17
  211. package/src/aepp-wallet-communication/rpc/RpcClient.ts +137 -0
  212. package/src/aepp-wallet-communication/rpc/types.ts +66 -0
  213. package/src/aepp-wallet-communication/schema.ts +181 -0
  214. package/src/aepp-wallet-communication/wallet-detector.ts +71 -0
  215. package/src/apis/compiler/code-model-v4.yaml +2649 -0
  216. package/src/apis/compiler/compiler.ts +585 -0
  217. package/src/apis/compiler/index.ts +2 -0
  218. package/src/apis/compiler/models/index.ts +301 -0
  219. package/src/apis/compiler/models/mappers.ts +583 -0
  220. package/src/apis/compiler/models/parameters.ts +93 -0
  221. package/src/apis/node/code-model-v4.yaml +10046 -0
  222. package/src/apis/node/index.ts +2 -0
  223. package/src/apis/node/models/index.ts +1253 -0
  224. package/src/apis/node/models/mappers.ts +4278 -0
  225. package/src/apis/node/models/parameters.ts +188 -0
  226. package/src/apis/node/node.ts +1299 -0
  227. package/src/chain.ts +444 -0
  228. package/src/channel/{handlers.js → handlers.ts} +220 -128
  229. package/src/channel/index.ts +991 -0
  230. package/src/channel/internal.ts +345 -0
  231. package/src/contract/Compiler.ts +66 -0
  232. package/src/contract/aci.ts +529 -0
  233. package/src/contract/ga.ts +178 -0
  234. package/src/contract/methods.ts +118 -0
  235. package/src/index.ts +51 -0
  236. package/src/oracle.ts +342 -0
  237. package/src/spend.ts +152 -0
  238. package/src/tx/builder/{constants.js → constants.ts} +12 -16
  239. package/src/tx/builder/field-types.ts +111 -0
  240. package/src/tx/builder/helpers.ts +253 -0
  241. package/src/tx/builder/index.ts +394 -0
  242. package/src/tx/builder/schema.ts +771 -0
  243. package/src/tx/index.ts +199 -0
  244. package/src/tx/min-fee.ts +136 -0
  245. package/src/tx/validator.ts +226 -0
  246. package/src/typings/@aeternity__argon2-browser/index.d.ts +3 -0
  247. package/src/typings/@aeternity__uuid/index.d.ts +3 -0
  248. package/src/typings/bip32-path/index.d.ts +33 -0
  249. package/src/typings/tweetnacl-auth/index.d.ts +14 -0
  250. package/src/utils/amount-formatter.ts +29 -42
  251. package/src/utils/autorest.ts +90 -0
  252. package/src/utils/bignumber.ts +9 -11
  253. package/src/utils/bytes.ts +12 -14
  254. package/src/utils/crypto.ts +217 -0
  255. package/src/utils/encoder.ts +52 -55
  256. package/src/utils/errors.ts +268 -134
  257. package/src/utils/hd-wallet.ts +134 -0
  258. package/src/utils/json-big.ts +26 -0
  259. package/src/utils/keystore.ts +179 -0
  260. package/src/utils/mptree.ts +14 -14
  261. package/src/utils/other.ts +28 -43
  262. package/src/utils/string.ts +8 -10
  263. package/es/account/base.mjs +0 -179
  264. package/es/account/base.mjs.map +0 -1
  265. package/es/account/memory.mjs +0 -99
  266. package/es/account/memory.mjs.map +0 -1
  267. package/es/account/multiple.mjs +0 -179
  268. package/es/account/multiple.mjs.map +0 -1
  269. package/es/ae/aens.mjs +0 -404
  270. package/es/ae/aens.mjs.map +0 -1
  271. package/es/ae/aepp.mjs +0 -45
  272. package/es/ae/aepp.mjs.map +0 -1
  273. package/es/ae/contract.mjs +0 -159
  274. package/es/ae/contract.mjs.map +0 -1
  275. package/es/ae/index.mjs +0 -207
  276. package/es/ae/index.mjs.map +0 -1
  277. package/es/ae/oracle.mjs +0 -339
  278. package/es/ae/oracle.mjs.map +0 -1
  279. package/es/ae/universal.mjs +0 -45
  280. package/es/ae/universal.mjs.map +0 -1
  281. package/es/ae/wallet.mjs +0 -50
  282. package/es/ae/wallet.mjs.map +0 -1
  283. package/es/amount-formatter.d.ts +0 -58
  284. package/es/bignumber.d.ts +0 -18
  285. package/es/chain/index.mjs +0 -272
  286. package/es/chain/index.mjs.map +0 -1
  287. package/es/chain/node.mjs +0 -442
  288. package/es/chain/node.mjs.map +0 -1
  289. package/es/contract/compiler.mjs +0 -115
  290. package/es/contract/compiler.mjs.map +0 -1
  291. package/es/contract/ga/helpers.mjs +0 -30
  292. package/es/contract/ga/helpers.mjs.map +0 -1
  293. package/es/contract/ga/index.mjs +0 -178
  294. package/es/contract/ga/index.mjs.map +0 -1
  295. package/es/crypto-ts.d.ts +0 -9
  296. package/es/encoder.d.ts +0 -26
  297. package/es/node-pool/index.mjs +0 -188
  298. package/es/node-pool/index.mjs.map +0 -1
  299. package/es/node.mjs +0 -133
  300. package/es/node.mjs.map +0 -1
  301. package/es/other.d.ts +0 -31
  302. package/es/string.d.ts +0 -26
  303. package/es/tx/tx-object.mjs +0 -283
  304. package/es/tx/tx-object.mjs.map +0 -1
  305. package/es/tx/tx.mjs +0 -938
  306. package/es/tx/tx.mjs.map +0 -1
  307. package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs +0 -132
  308. package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs.map +0 -1
  309. package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs +0 -183
  310. package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs.map +0 -1
  311. package/es/utils/aepp-wallet-communication/connection/index.mjs +0 -87
  312. package/es/utils/aepp-wallet-communication/connection/index.mjs.map +0 -1
  313. package/es/utils/aepp-wallet-communication/content-script-bridge.mjs +0 -98
  314. package/es/utils/aepp-wallet-communication/content-script-bridge.mjs.map +0 -1
  315. package/es/utils/aepp-wallet-communication/helpers.mjs +0 -92
  316. package/es/utils/aepp-wallet-communication/helpers.mjs.map +0 -1
  317. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs +0 -375
  318. package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs.map +0 -1
  319. package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs +0 -275
  320. package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs.map +0 -1
  321. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs +0 -541
  322. package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs.map +0 -1
  323. package/es/utils/aepp-wallet-communication/schema.mjs +0 -102
  324. package/es/utils/aepp-wallet-communication/schema.mjs.map +0 -1
  325. package/es/utils/aepp-wallet-communication/wallet-detector.mjs +0 -110
  326. package/es/utils/aepp-wallet-communication/wallet-detector.mjs.map +0 -1
  327. package/es/utils/async-init.mjs +0 -64
  328. package/es/utils/async-init.mjs.map +0 -1
  329. package/es/utils/crypto-ts.mjs.map +0 -1
  330. package/es/utils/swagger.mjs +0 -164
  331. package/es/utils/swagger.mjs.map +0 -1
  332. package/src/account/base.js +0 -153
  333. package/src/account/memory.js +0 -83
  334. package/src/account/multiple.js +0 -162
  335. package/src/ae/aens.js +0 -361
  336. package/src/ae/aepp.js +0 -45
  337. package/src/ae/contract.js +0 -148
  338. package/src/ae/index.js +0 -168
  339. package/src/ae/oracle.js +0 -311
  340. package/src/ae/universal.js +0 -47
  341. package/src/ae/wallet.js +0 -50
  342. package/src/chain/index.js +0 -269
  343. package/src/chain/node.js +0 -320
  344. package/src/channel/index.js +0 -903
  345. package/src/channel/internal.js +0 -236
  346. package/src/contract/aci.js +0 -376
  347. package/src/contract/compiler.js +0 -100
  348. package/src/contract/ga/helpers.js +0 -19
  349. package/src/contract/ga/index.js +0 -150
  350. package/src/index.js +0 -89
  351. package/src/node-pool/index.js +0 -172
  352. package/src/node.js +0 -116
  353. package/src/tx/builder/field-types.js +0 -61
  354. package/src/tx/builder/helpers.js +0 -334
  355. package/src/tx/builder/index.js +0 -465
  356. package/src/tx/builder/schema.js +0 -1100
  357. package/src/tx/index.js +0 -301
  358. package/src/tx/tx-object.js +0 -187
  359. package/src/tx/tx.js +0 -631
  360. package/src/tx/validator.js +0 -181
  361. package/src/utils/aepp-wallet-communication/connection/browser-runtime.js +0 -119
  362. package/src/utils/aepp-wallet-communication/connection/browser-window-message.js +0 -165
  363. package/src/utils/aepp-wallet-communication/connection/index.js +0 -85
  364. package/src/utils/aepp-wallet-communication/content-script-bridge.js +0 -86
  365. package/src/utils/aepp-wallet-communication/helpers.js +0 -60
  366. package/src/utils/aepp-wallet-communication/rpc/aepp-rpc.js +0 -294
  367. package/src/utils/aepp-wallet-communication/rpc/rpc-client.js +0 -232
  368. package/src/utils/aepp-wallet-communication/rpc/wallet-rpc.js +0 -401
  369. package/src/utils/aepp-wallet-communication/schema.ts +0 -80
  370. package/src/utils/aepp-wallet-communication/wallet-detector.js +0 -92
  371. package/src/utils/async-init.js +0 -45
  372. package/src/utils/crypto.js +0 -219
  373. package/src/utils/hd-wallet.js +0 -100
  374. package/src/utils/json-big.js +0 -26
  375. package/src/utils/keystore.js +0 -219
  376. package/src/utils/swagger.js +0 -156
@@ -0,0 +1,1299 @@
1
+ import * as coreClient from "@azure/core-client";
2
+ import * as coreRestPipeline from "@azure/core-rest-pipeline";
3
+ import * as Parameters from "./models/parameters";
4
+ import * as Mappers from "./models/mappers";
5
+ import {
6
+ NodeOptionalParams,
7
+ GetTopHeaderOptionalParams,
8
+ GetTopHeaderResponse,
9
+ GetCurrentKeyBlockOptionalParams,
10
+ GetCurrentKeyBlockResponse,
11
+ GetCurrentKeyBlockHashOptionalParams,
12
+ GetCurrentKeyBlockHashResponse,
13
+ GetCurrentKeyBlockHeightOptionalParams,
14
+ GetCurrentKeyBlockHeightResponse,
15
+ GetPendingKeyBlockOptionalParams,
16
+ GetPendingKeyBlockResponse,
17
+ GetKeyBlockByHashOptionalParams,
18
+ GetKeyBlockByHashResponse,
19
+ GetKeyBlockByHeightOptionalParams,
20
+ GetKeyBlockByHeightResponse,
21
+ GetMicroBlockHeaderByHashOptionalParams,
22
+ GetMicroBlockHeaderByHashResponse,
23
+ GetMicroBlockTransactionsByHashOptionalParams,
24
+ GetMicroBlockTransactionsByHashResponse,
25
+ GetMicroBlockTransactionByHashAndIndexOptionalParams,
26
+ GetMicroBlockTransactionByHashAndIndexResponse,
27
+ GetMicroBlockTransactionsCountByHashOptionalParams,
28
+ GetMicroBlockTransactionsCountByHashResponse,
29
+ GetCurrentGenerationOptionalParams,
30
+ GetCurrentGenerationResponse,
31
+ GetGenerationByHashOptionalParams,
32
+ GetGenerationByHashResponse,
33
+ GetGenerationByHeightOptionalParams,
34
+ GetGenerationByHeightResponse,
35
+ GetAccountByPubkeyOptionalParams,
36
+ GetAccountByPubkeyResponse,
37
+ GetAccountByPubkeyAndHeightOptionalParams,
38
+ GetAccountByPubkeyAndHeightResponse,
39
+ GetAccountByPubkeyAndHashOptionalParams,
40
+ GetAccountByPubkeyAndHashResponse,
41
+ GetPendingAccountTransactionsByPubkeyOptionalParams,
42
+ GetPendingAccountTransactionsByPubkeyResponse,
43
+ GetAccountNextNonceOptionalParams,
44
+ GetAccountNextNonceResponse,
45
+ DryRunInput,
46
+ ProtectedDryRunTxsOptionalParams,
47
+ ProtectedDryRunTxsResponse,
48
+ GetTransactionByHashOptionalParams,
49
+ GetTransactionByHashResponse,
50
+ GetTransactionInfoByHashOptionalParams,
51
+ GetTransactionInfoByHashResponse,
52
+ EncodedTx,
53
+ PostTransactionOptionalParams,
54
+ PostTransactionResponse,
55
+ GetContractOptionalParams,
56
+ GetContractResponse,
57
+ GetContractCodeOptionalParams,
58
+ GetContractCodeResponse,
59
+ GetContractPoIOptionalParams,
60
+ GetContractPoIResponse,
61
+ GetOracleByPubkeyOptionalParams,
62
+ GetOracleByPubkeyResponse,
63
+ GetOracleQueriesByPubkeyOptionalParams,
64
+ GetOracleQueriesByPubkeyResponse,
65
+ GetOracleQueryByPubkeyAndQueryIdOptionalParams,
66
+ GetOracleQueryByPubkeyAndQueryIdResponse,
67
+ GetNameEntryByNameOptionalParams,
68
+ GetNameEntryByNameResponse,
69
+ GetChannelByPubkeyOptionalParams,
70
+ GetChannelByPubkeyResponse,
71
+ GetPeerPubkeyOptionalParams,
72
+ GetPeerPubkeyResponse,
73
+ GetStatusOptionalParams,
74
+ GetStatusResponse,
75
+ GetChainEndsOptionalParams,
76
+ GetChainEndsResponse
77
+ } from "./models";
78
+
79
+ export class Node extends coreClient.ServiceClient {
80
+ $host: string;
81
+ intAsString?: boolean;
82
+
83
+ /**
84
+ * Initializes a new instance of the Node class.
85
+ * @param $host server parameter
86
+ * @param options The parameter options
87
+ */
88
+ constructor($host: string, options?: NodeOptionalParams) {
89
+ if ($host === undefined) {
90
+ throw new Error("'$host' cannot be null");
91
+ }
92
+
93
+ // Initializing default values for options
94
+ if (!options) {
95
+ options = {};
96
+ }
97
+ const defaults: NodeOptionalParams = {
98
+ requestContentType: "application/json; charset=utf-8"
99
+ };
100
+
101
+ const packageDetails = `azsdk-js-node/1.0.0-beta.1`;
102
+ const userAgentPrefix =
103
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
104
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
105
+ : `${packageDetails}`;
106
+
107
+ const optionsWithDefaults = {
108
+ ...defaults,
109
+ ...options,
110
+ userAgentOptions: {
111
+ userAgentPrefix
112
+ },
113
+ baseUri: options.endpoint ?? options.baseUri ?? "{$host}"
114
+ };
115
+ super(optionsWithDefaults);
116
+
117
+ if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
118
+ const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
119
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
120
+ (pipelinePolicy) =>
121
+ pipelinePolicy.name ===
122
+ coreRestPipeline.bearerTokenAuthenticationPolicyName
123
+ );
124
+ if (!bearerTokenAuthenticationPolicyFound) {
125
+ this.pipeline.removePolicy({
126
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
127
+ });
128
+ this.pipeline.addPolicy(
129
+ coreRestPipeline.bearerTokenAuthenticationPolicy({
130
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
131
+ challengeCallbacks: {
132
+ authorizeRequestOnChallenge:
133
+ coreClient.authorizeRequestOnClaimChallenge
134
+ }
135
+ })
136
+ );
137
+ }
138
+ }
139
+ // Parameter assignments
140
+ this.$host = $host;
141
+ }
142
+
143
+ /**
144
+ * Get the top header (either key or micro block)
145
+ * @param options The options parameters.
146
+ */
147
+ getTopHeader(
148
+ options?: GetTopHeaderOptionalParams
149
+ ): Promise<GetTopHeaderResponse> {
150
+ return this.sendOperationRequest({ options }, getTopHeaderOperationSpec);
151
+ }
152
+
153
+ /**
154
+ * Get the current key block
155
+ * @param options The options parameters.
156
+ */
157
+ getCurrentKeyBlock(
158
+ options?: GetCurrentKeyBlockOptionalParams
159
+ ): Promise<GetCurrentKeyBlockResponse> {
160
+ return this.sendOperationRequest(
161
+ { options },
162
+ getCurrentKeyBlockOperationSpec
163
+ );
164
+ }
165
+
166
+ /**
167
+ * Get the hash of the current key block
168
+ * @param options The options parameters.
169
+ */
170
+ getCurrentKeyBlockHash(
171
+ options?: GetCurrentKeyBlockHashOptionalParams
172
+ ): Promise<GetCurrentKeyBlockHashResponse> {
173
+ return this.sendOperationRequest(
174
+ { options },
175
+ getCurrentKeyBlockHashOperationSpec
176
+ );
177
+ }
178
+
179
+ /**
180
+ * Get the height of the current key block
181
+ * @param options The options parameters.
182
+ */
183
+ getCurrentKeyBlockHeight(
184
+ options?: GetCurrentKeyBlockHeightOptionalParams
185
+ ): Promise<GetCurrentKeyBlockHeightResponse> {
186
+ return this.sendOperationRequest(
187
+ { options },
188
+ getCurrentKeyBlockHeightOperationSpec
189
+ );
190
+ }
191
+
192
+ /**
193
+ * Get the pending key block
194
+ * @param options The options parameters.
195
+ */
196
+ getPendingKeyBlock(
197
+ options?: GetPendingKeyBlockOptionalParams
198
+ ): Promise<GetPendingKeyBlockResponse> {
199
+ return this.sendOperationRequest(
200
+ { options },
201
+ getPendingKeyBlockOperationSpec
202
+ );
203
+ }
204
+
205
+ /**
206
+ * Get a key block by hash
207
+ * @param hash The hash of the block - either a keyblock or a microblock
208
+ * @param options The options parameters.
209
+ */
210
+ getKeyBlockByHash(
211
+ hash: string,
212
+ options?: GetKeyBlockByHashOptionalParams
213
+ ): Promise<GetKeyBlockByHashResponse> {
214
+ return this.sendOperationRequest(
215
+ { hash, options },
216
+ getKeyBlockByHashOperationSpec
217
+ );
218
+ }
219
+
220
+ /**
221
+ * Get a key block by height
222
+ * @param height The height
223
+ * @param options The options parameters.
224
+ */
225
+ getKeyBlockByHeight(
226
+ height: number,
227
+ options?: GetKeyBlockByHeightOptionalParams
228
+ ): Promise<GetKeyBlockByHeightResponse> {
229
+ return this.sendOperationRequest(
230
+ { height, options },
231
+ getKeyBlockByHeightOperationSpec
232
+ );
233
+ }
234
+
235
+ /**
236
+ * Get a micro block header by hash
237
+ * @param hash The hash of the block - either a keyblock or a microblock
238
+ * @param options The options parameters.
239
+ */
240
+ getMicroBlockHeaderByHash(
241
+ hash: string,
242
+ options?: GetMicroBlockHeaderByHashOptionalParams
243
+ ): Promise<GetMicroBlockHeaderByHashResponse> {
244
+ return this.sendOperationRequest(
245
+ { hash, options },
246
+ getMicroBlockHeaderByHashOperationSpec
247
+ );
248
+ }
249
+
250
+ /**
251
+ * Get micro block transactions by hash
252
+ * @param hash The hash of the micro block
253
+ * @param options The options parameters.
254
+ */
255
+ getMicroBlockTransactionsByHash(
256
+ hash: string,
257
+ options?: GetMicroBlockTransactionsByHashOptionalParams
258
+ ): Promise<GetMicroBlockTransactionsByHashResponse> {
259
+ return this.sendOperationRequest(
260
+ { hash, options },
261
+ getMicroBlockTransactionsByHashOperationSpec
262
+ );
263
+ }
264
+
265
+ /**
266
+ * Get a micro block transaction by hash and index
267
+ * @param hash The hash of the micro block
268
+ * @param index The index of the transaction in a block
269
+ * @param options The options parameters.
270
+ */
271
+ getMicroBlockTransactionByHashAndIndex(
272
+ hash: string,
273
+ index: number,
274
+ options?: GetMicroBlockTransactionByHashAndIndexOptionalParams
275
+ ): Promise<GetMicroBlockTransactionByHashAndIndexResponse> {
276
+ return this.sendOperationRequest(
277
+ { hash, index, options },
278
+ getMicroBlockTransactionByHashAndIndexOperationSpec
279
+ );
280
+ }
281
+
282
+ /**
283
+ * Get micro block transaction count by hash
284
+ * @param hash The hash of the micro block
285
+ * @param options The options parameters.
286
+ */
287
+ getMicroBlockTransactionsCountByHash(
288
+ hash: string,
289
+ options?: GetMicroBlockTransactionsCountByHashOptionalParams
290
+ ): Promise<GetMicroBlockTransactionsCountByHashResponse> {
291
+ return this.sendOperationRequest(
292
+ { hash, options },
293
+ getMicroBlockTransactionsCountByHashOperationSpec
294
+ );
295
+ }
296
+
297
+ /**
298
+ * Get the current generation
299
+ * @param options The options parameters.
300
+ */
301
+ getCurrentGeneration(
302
+ options?: GetCurrentGenerationOptionalParams
303
+ ): Promise<GetCurrentGenerationResponse> {
304
+ return this.sendOperationRequest(
305
+ { options },
306
+ getCurrentGenerationOperationSpec
307
+ );
308
+ }
309
+
310
+ /**
311
+ * Get a generation by hash
312
+ * @param hash The hash of the key block
313
+ * @param options The options parameters.
314
+ */
315
+ getGenerationByHash(
316
+ hash: string,
317
+ options?: GetGenerationByHashOptionalParams
318
+ ): Promise<GetGenerationByHashResponse> {
319
+ return this.sendOperationRequest(
320
+ { hash, options },
321
+ getGenerationByHashOperationSpec
322
+ );
323
+ }
324
+
325
+ /**
326
+ * Get a generation by height
327
+ * @param height The height
328
+ * @param options The options parameters.
329
+ */
330
+ getGenerationByHeight(
331
+ height: number,
332
+ options?: GetGenerationByHeightOptionalParams
333
+ ): Promise<GetGenerationByHeightResponse> {
334
+ return this.sendOperationRequest(
335
+ { height, options },
336
+ getGenerationByHeightOperationSpec
337
+ );
338
+ }
339
+
340
+ /**
341
+ * Get an account by public key
342
+ * @param pubkey The public key of the account
343
+ * @param options The options parameters.
344
+ */
345
+ getAccountByPubkey(
346
+ pubkey: string,
347
+ options?: GetAccountByPubkeyOptionalParams
348
+ ): Promise<GetAccountByPubkeyResponse> {
349
+ return this.sendOperationRequest(
350
+ { pubkey, options },
351
+ getAccountByPubkeyOperationSpec
352
+ );
353
+ }
354
+
355
+ /**
356
+ * Get an account by public key after the opening key block of the generation at height
357
+ * @param pubkey The public key of the account
358
+ * @param height The height
359
+ * @param options The options parameters.
360
+ */
361
+ getAccountByPubkeyAndHeight(
362
+ pubkey: string,
363
+ height: number,
364
+ options?: GetAccountByPubkeyAndHeightOptionalParams
365
+ ): Promise<GetAccountByPubkeyAndHeightResponse> {
366
+ return this.sendOperationRequest(
367
+ { pubkey, height, options },
368
+ getAccountByPubkeyAndHeightOperationSpec
369
+ );
370
+ }
371
+
372
+ /**
373
+ * Get an account by public key after the block indicated by hash. Can be either a micro block or a
374
+ * keyblock hash
375
+ * @param pubkey The public key of the account
376
+ * @param hash The hash of the block - either a keyblock or a microblock
377
+ * @param options The options parameters.
378
+ */
379
+ getAccountByPubkeyAndHash(
380
+ pubkey: string,
381
+ hash: string,
382
+ options?: GetAccountByPubkeyAndHashOptionalParams
383
+ ): Promise<GetAccountByPubkeyAndHashResponse> {
384
+ return this.sendOperationRequest(
385
+ { pubkey, hash, options },
386
+ getAccountByPubkeyAndHashOperationSpec
387
+ );
388
+ }
389
+
390
+ /**
391
+ * Get pending account transactions by public key
392
+ * @param pubkey The public key of the account
393
+ * @param options The options parameters.
394
+ */
395
+ getPendingAccountTransactionsByPubkey(
396
+ pubkey: string,
397
+ options?: GetPendingAccountTransactionsByPubkeyOptionalParams
398
+ ): Promise<GetPendingAccountTransactionsByPubkeyResponse> {
399
+ return this.sendOperationRequest(
400
+ { pubkey, options },
401
+ getPendingAccountTransactionsByPubkeyOperationSpec
402
+ );
403
+ }
404
+
405
+ /**
406
+ * Get an account's next nonce; This is computed according to whatever is the current account nonce and
407
+ * what transactions are currently present in the transaction pool
408
+ * @param pubkey The public key of the account
409
+ * @param options The options parameters.
410
+ */
411
+ getAccountNextNonce(
412
+ pubkey: string,
413
+ options?: GetAccountNextNonceOptionalParams
414
+ ): Promise<GetAccountNextNonceResponse> {
415
+ return this.sendOperationRequest(
416
+ { pubkey, options },
417
+ getAccountNextNonceOperationSpec
418
+ );
419
+ }
420
+
421
+ /**
422
+ * Dry-run transactions on top of a given block. Supports all TXs except GAMetaTx, PayingForTx and
423
+ * OffchainTx. The maximum gas limit of all calls is capped. The maximum gas limit per request is a
424
+ * global node setting. Since DryRunCallReq object do not have a mandatory gas field, if not set a
425
+ * default value of 1000000 is being used instead.
426
+ * @param body transactions
427
+ * @param options The options parameters.
428
+ */
429
+ protectedDryRunTxs(
430
+ body: DryRunInput,
431
+ options?: ProtectedDryRunTxsOptionalParams
432
+ ): Promise<ProtectedDryRunTxsResponse> {
433
+ return this.sendOperationRequest(
434
+ { body, options },
435
+ protectedDryRunTxsOperationSpec
436
+ );
437
+ }
438
+
439
+ /**
440
+ * Get a transaction by hash
441
+ * @param hash The hash of the transaction
442
+ * @param options The options parameters.
443
+ */
444
+ getTransactionByHash(
445
+ hash: string,
446
+ options?: GetTransactionByHashOptionalParams
447
+ ): Promise<GetTransactionByHashResponse> {
448
+ return this.sendOperationRequest(
449
+ { hash, options },
450
+ getTransactionByHashOperationSpec
451
+ );
452
+ }
453
+
454
+ /**
455
+ * @param hash The hash of the transaction
456
+ * @param options The options parameters.
457
+ */
458
+ getTransactionInfoByHash(
459
+ hash: string,
460
+ options?: GetTransactionInfoByHashOptionalParams
461
+ ): Promise<GetTransactionInfoByHashResponse> {
462
+ return this.sendOperationRequest(
463
+ { hash, options },
464
+ getTransactionInfoByHashOperationSpec
465
+ );
466
+ }
467
+
468
+ /**
469
+ * Post a new transaction
470
+ * @param body The new transaction
471
+ * @param options The options parameters.
472
+ */
473
+ postTransaction(
474
+ body: EncodedTx,
475
+ options?: PostTransactionOptionalParams
476
+ ): Promise<PostTransactionResponse> {
477
+ return this.sendOperationRequest(
478
+ { body, options },
479
+ postTransactionOperationSpec
480
+ );
481
+ }
482
+
483
+ /**
484
+ * Get a contract by pubkey
485
+ * @param pubkey Contract pubkey to get proof for
486
+ * @param options The options parameters.
487
+ */
488
+ getContract(
489
+ pubkey: string,
490
+ options?: GetContractOptionalParams
491
+ ): Promise<GetContractResponse> {
492
+ return this.sendOperationRequest(
493
+ { pubkey, options },
494
+ getContractOperationSpec
495
+ );
496
+ }
497
+
498
+ /**
499
+ * Get contract code by pubkey
500
+ * @param pubkey Contract pubkey to get proof for
501
+ * @param options The options parameters.
502
+ */
503
+ getContractCode(
504
+ pubkey: string,
505
+ options?: GetContractCodeOptionalParams
506
+ ): Promise<GetContractCodeResponse> {
507
+ return this.sendOperationRequest(
508
+ { pubkey, options },
509
+ getContractCodeOperationSpec
510
+ );
511
+ }
512
+
513
+ /**
514
+ * Get a proof of inclusion for a contract
515
+ * @param pubkey Contract pubkey to get proof for
516
+ * @param options The options parameters.
517
+ */
518
+ getContractPoI(
519
+ pubkey: string,
520
+ options?: GetContractPoIOptionalParams
521
+ ): Promise<GetContractPoIResponse> {
522
+ return this.sendOperationRequest(
523
+ { pubkey, options },
524
+ getContractPoIOperationSpec
525
+ );
526
+ }
527
+
528
+ /**
529
+ * Get an oracle by public key
530
+ * @param pubkey The public key of the oracle
531
+ * @param options The options parameters.
532
+ */
533
+ getOracleByPubkey(
534
+ pubkey: string,
535
+ options?: GetOracleByPubkeyOptionalParams
536
+ ): Promise<GetOracleByPubkeyResponse> {
537
+ return this.sendOperationRequest(
538
+ { pubkey, options },
539
+ getOracleByPubkeyOperationSpec
540
+ );
541
+ }
542
+
543
+ /**
544
+ * Get oracle queries by public key
545
+ * @param pubkey The public key of the oracle
546
+ * @param options The options parameters.
547
+ */
548
+ getOracleQueriesByPubkey(
549
+ pubkey: string,
550
+ options?: GetOracleQueriesByPubkeyOptionalParams
551
+ ): Promise<GetOracleQueriesByPubkeyResponse> {
552
+ return this.sendOperationRequest(
553
+ { pubkey, options },
554
+ getOracleQueriesByPubkeyOperationSpec
555
+ );
556
+ }
557
+
558
+ /**
559
+ * Get an oracle query by public key and query ID
560
+ * @param pubkey The public key of the oracle
561
+ * @param queryId The ID of the query
562
+ * @param options The options parameters.
563
+ */
564
+ getOracleQueryByPubkeyAndQueryId(
565
+ pubkey: string,
566
+ queryId: string,
567
+ options?: GetOracleQueryByPubkeyAndQueryIdOptionalParams
568
+ ): Promise<GetOracleQueryByPubkeyAndQueryIdResponse> {
569
+ return this.sendOperationRequest(
570
+ { pubkey, queryId, options },
571
+ getOracleQueryByPubkeyAndQueryIdOperationSpec
572
+ );
573
+ }
574
+
575
+ /**
576
+ * Get name entry from naming system
577
+ * @param name The name key of the name entry
578
+ * @param options The options parameters.
579
+ */
580
+ getNameEntryByName(
581
+ name: string,
582
+ options?: GetNameEntryByNameOptionalParams
583
+ ): Promise<GetNameEntryByNameResponse> {
584
+ return this.sendOperationRequest(
585
+ { name, options },
586
+ getNameEntryByNameOperationSpec
587
+ );
588
+ }
589
+
590
+ /**
591
+ * Get channel by public key
592
+ * @param pubkey The pubkey of the channel
593
+ * @param options The options parameters.
594
+ */
595
+ getChannelByPubkey(
596
+ pubkey: string,
597
+ options?: GetChannelByPubkeyOptionalParams
598
+ ): Promise<GetChannelByPubkeyResponse> {
599
+ return this.sendOperationRequest(
600
+ { pubkey, options },
601
+ getChannelByPubkeyOperationSpec
602
+ );
603
+ }
604
+
605
+ /**
606
+ * Get peer public key
607
+ * @param options The options parameters.
608
+ */
609
+ getPeerPubkey(
610
+ options?: GetPeerPubkeyOptionalParams
611
+ ): Promise<GetPeerPubkeyResponse> {
612
+ return this.sendOperationRequest({ options }, getPeerPubkeyOperationSpec);
613
+ }
614
+
615
+ /**
616
+ * Get the status of a node
617
+ * @param options The options parameters.
618
+ */
619
+ getStatus(options?: GetStatusOptionalParams): Promise<GetStatusResponse> {
620
+ return this.sendOperationRequest({ options }, getStatusOperationSpec);
621
+ }
622
+
623
+ /**
624
+ * Get oldest keyblock hashes counting from genesis including orphans
625
+ * @param options The options parameters.
626
+ */
627
+ getChainEnds(
628
+ options?: GetChainEndsOptionalParams
629
+ ): Promise<GetChainEndsResponse> {
630
+ return this.sendOperationRequest({ options }, getChainEndsOperationSpec);
631
+ }
632
+ }
633
+ // Operation Specifications
634
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
635
+
636
+ const getTopHeaderOperationSpec: coreClient.OperationSpec = {
637
+ path: "/v3/headers/top",
638
+ httpMethod: "GET",
639
+ responses: {
640
+ 200: {
641
+ bodyMapper: Mappers.Header
642
+ },
643
+ 404: {
644
+ bodyMapper: Mappers.ErrorModel,
645
+ isError: true
646
+ }
647
+ },
648
+ queryParameters: [Parameters.intAsString],
649
+ urlParameters: [Parameters.$host],
650
+ headerParameters: [Parameters.accept],
651
+ serializer
652
+ };
653
+ const getCurrentKeyBlockOperationSpec: coreClient.OperationSpec = {
654
+ path: "/v3/key-blocks/current",
655
+ httpMethod: "GET",
656
+ responses: {
657
+ 200: {
658
+ bodyMapper: Mappers.KeyBlock
659
+ },
660
+ 404: {
661
+ bodyMapper: Mappers.ErrorModel,
662
+ isError: true
663
+ }
664
+ },
665
+ queryParameters: [Parameters.intAsString],
666
+ urlParameters: [Parameters.$host],
667
+ headerParameters: [Parameters.accept],
668
+ serializer
669
+ };
670
+ const getCurrentKeyBlockHashOperationSpec: coreClient.OperationSpec = {
671
+ path: "/v3/key-blocks/current/hash",
672
+ httpMethod: "GET",
673
+ responses: {
674
+ 200: {
675
+ bodyMapper: Mappers.HashResponse
676
+ },
677
+ 404: {
678
+ bodyMapper: Mappers.ErrorModel,
679
+ isError: true
680
+ }
681
+ },
682
+ queryParameters: [Parameters.intAsString],
683
+ urlParameters: [Parameters.$host],
684
+ headerParameters: [Parameters.accept],
685
+ serializer
686
+ };
687
+ const getCurrentKeyBlockHeightOperationSpec: coreClient.OperationSpec = {
688
+ path: "/v3/key-blocks/current/height",
689
+ httpMethod: "GET",
690
+ responses: {
691
+ 200: {
692
+ bodyMapper: Mappers.HeightResponse
693
+ },
694
+ 404: {
695
+ bodyMapper: Mappers.ErrorModel,
696
+ isError: true
697
+ }
698
+ },
699
+ queryParameters: [Parameters.intAsString],
700
+ urlParameters: [Parameters.$host],
701
+ headerParameters: [Parameters.accept],
702
+ serializer
703
+ };
704
+ const getPendingKeyBlockOperationSpec: coreClient.OperationSpec = {
705
+ path: "/v3/key-blocks/pending",
706
+ httpMethod: "GET",
707
+ responses: {
708
+ 200: {
709
+ bodyMapper: Mappers.KeyBlock
710
+ },
711
+ 400: {
712
+ bodyMapper: Mappers.ErrorModel,
713
+ isError: true
714
+ },
715
+ 404: {
716
+ bodyMapper: Mappers.ErrorModel,
717
+ isError: true
718
+ }
719
+ },
720
+ queryParameters: [Parameters.intAsString],
721
+ urlParameters: [Parameters.$host],
722
+ headerParameters: [Parameters.accept],
723
+ serializer
724
+ };
725
+ const getKeyBlockByHashOperationSpec: coreClient.OperationSpec = {
726
+ path: "/v3/key-blocks/hash/{hash}",
727
+ httpMethod: "GET",
728
+ responses: {
729
+ 200: {
730
+ bodyMapper: Mappers.KeyBlock
731
+ },
732
+ 400: {
733
+ bodyMapper: Mappers.ErrorModel,
734
+ isError: true
735
+ },
736
+ 404: {
737
+ bodyMapper: Mappers.ErrorModel,
738
+ isError: true
739
+ }
740
+ },
741
+ queryParameters: [Parameters.intAsString],
742
+ urlParameters: [Parameters.$host, Parameters.hash],
743
+ headerParameters: [Parameters.accept],
744
+ serializer
745
+ };
746
+ const getKeyBlockByHeightOperationSpec: coreClient.OperationSpec = {
747
+ path: "/v3/key-blocks/height/{height}",
748
+ httpMethod: "GET",
749
+ responses: {
750
+ 200: {
751
+ bodyMapper: Mappers.KeyBlock
752
+ },
753
+ 404: {
754
+ bodyMapper: Mappers.ErrorModel,
755
+ isError: true
756
+ }
757
+ },
758
+ queryParameters: [Parameters.intAsString],
759
+ urlParameters: [Parameters.$host, Parameters.height],
760
+ headerParameters: [Parameters.accept],
761
+ serializer
762
+ };
763
+ const getMicroBlockHeaderByHashOperationSpec: coreClient.OperationSpec = {
764
+ path: "/v3/micro-blocks/hash/{hash}/header",
765
+ httpMethod: "GET",
766
+ responses: {
767
+ 200: {
768
+ bodyMapper: Mappers.MicroBlockHeader
769
+ },
770
+ 400: {
771
+ bodyMapper: Mappers.ErrorModel,
772
+ isError: true
773
+ },
774
+ 404: {
775
+ bodyMapper: Mappers.ErrorModel,
776
+ isError: true
777
+ }
778
+ },
779
+ queryParameters: [Parameters.intAsString],
780
+ urlParameters: [Parameters.$host, Parameters.hash],
781
+ headerParameters: [Parameters.accept],
782
+ serializer
783
+ };
784
+ const getMicroBlockTransactionsByHashOperationSpec: coreClient.OperationSpec = {
785
+ path: "/v3/micro-blocks/hash/{hash}/transactions",
786
+ httpMethod: "GET",
787
+ responses: {
788
+ 200: {
789
+ bodyMapper: Mappers.SignedTxs
790
+ },
791
+ 400: {
792
+ bodyMapper: Mappers.ErrorModel,
793
+ isError: true
794
+ },
795
+ 404: {
796
+ bodyMapper: Mappers.ErrorModel,
797
+ isError: true
798
+ }
799
+ },
800
+ queryParameters: [Parameters.intAsString],
801
+ urlParameters: [Parameters.$host, Parameters.hash],
802
+ headerParameters: [Parameters.accept],
803
+ serializer
804
+ };
805
+ const getMicroBlockTransactionByHashAndIndexOperationSpec: coreClient.OperationSpec = {
806
+ path: "/v3/micro-blocks/hash/{hash}/transactions/index/{index}",
807
+ httpMethod: "GET",
808
+ responses: {
809
+ 200: {
810
+ bodyMapper: Mappers.SignedTx
811
+ },
812
+ 400: {
813
+ bodyMapper: Mappers.ErrorModel,
814
+ isError: true
815
+ },
816
+ 404: {
817
+ bodyMapper: Mappers.ErrorModel,
818
+ isError: true
819
+ }
820
+ },
821
+ queryParameters: [Parameters.intAsString],
822
+ urlParameters: [Parameters.$host, Parameters.hash, Parameters.index],
823
+ headerParameters: [Parameters.accept],
824
+ serializer
825
+ };
826
+ const getMicroBlockTransactionsCountByHashOperationSpec: coreClient.OperationSpec = {
827
+ path: "/v3/micro-blocks/hash/{hash}/transactions/count",
828
+ httpMethod: "GET",
829
+ responses: {
830
+ 200: {
831
+ bodyMapper: Mappers.CountResponse
832
+ },
833
+ 400: {
834
+ bodyMapper: Mappers.ErrorModel,
835
+ isError: true
836
+ },
837
+ 404: {
838
+ bodyMapper: Mappers.ErrorModel,
839
+ isError: true
840
+ }
841
+ },
842
+ queryParameters: [Parameters.intAsString],
843
+ urlParameters: [Parameters.$host, Parameters.hash],
844
+ headerParameters: [Parameters.accept],
845
+ serializer
846
+ };
847
+ const getCurrentGenerationOperationSpec: coreClient.OperationSpec = {
848
+ path: "/v3/generations/current",
849
+ httpMethod: "GET",
850
+ responses: {
851
+ 200: {
852
+ bodyMapper: Mappers.Generation
853
+ },
854
+ 404: {
855
+ bodyMapper: Mappers.ErrorModel,
856
+ isError: true
857
+ }
858
+ },
859
+ queryParameters: [Parameters.intAsString],
860
+ urlParameters: [Parameters.$host],
861
+ headerParameters: [Parameters.accept],
862
+ serializer
863
+ };
864
+ const getGenerationByHashOperationSpec: coreClient.OperationSpec = {
865
+ path: "/v3/generations/hash/{hash}",
866
+ httpMethod: "GET",
867
+ responses: {
868
+ 200: {
869
+ bodyMapper: Mappers.Generation
870
+ },
871
+ 400: {
872
+ bodyMapper: Mappers.ErrorModel,
873
+ isError: true
874
+ },
875
+ 404: {
876
+ bodyMapper: Mappers.ErrorModel,
877
+ isError: true
878
+ }
879
+ },
880
+ queryParameters: [Parameters.intAsString],
881
+ urlParameters: [Parameters.$host, Parameters.hash],
882
+ headerParameters: [Parameters.accept],
883
+ serializer
884
+ };
885
+ const getGenerationByHeightOperationSpec: coreClient.OperationSpec = {
886
+ path: "/v3/generations/height/{height}",
887
+ httpMethod: "GET",
888
+ responses: {
889
+ 200: {
890
+ bodyMapper: Mappers.Generation
891
+ },
892
+ 404: {
893
+ bodyMapper: Mappers.ErrorModel,
894
+ isError: true
895
+ }
896
+ },
897
+ queryParameters: [Parameters.intAsString],
898
+ urlParameters: [Parameters.$host, Parameters.height],
899
+ headerParameters: [Parameters.accept],
900
+ serializer
901
+ };
902
+ const getAccountByPubkeyOperationSpec: coreClient.OperationSpec = {
903
+ path: "/v3/accounts/{pubkey}",
904
+ httpMethod: "GET",
905
+ responses: {
906
+ 200: {
907
+ bodyMapper: Mappers.Account
908
+ },
909
+ 400: {
910
+ bodyMapper: Mappers.ErrorModel,
911
+ isError: true
912
+ },
913
+ 404: {
914
+ bodyMapper: Mappers.ErrorModel,
915
+ isError: true
916
+ }
917
+ },
918
+ queryParameters: [Parameters.intAsString],
919
+ urlParameters: [Parameters.$host, Parameters.pubkey],
920
+ headerParameters: [Parameters.accept],
921
+ serializer
922
+ };
923
+ const getAccountByPubkeyAndHeightOperationSpec: coreClient.OperationSpec = {
924
+ path: "/v3/accounts/{pubkey}/height/{height}",
925
+ httpMethod: "GET",
926
+ responses: {
927
+ 200: {
928
+ bodyMapper: Mappers.Account
929
+ },
930
+ 400: {
931
+ bodyMapper: Mappers.ErrorModel,
932
+ isError: true
933
+ },
934
+ 404: {
935
+ bodyMapper: Mappers.ErrorModel,
936
+ isError: true
937
+ }
938
+ },
939
+ queryParameters: [Parameters.intAsString],
940
+ urlParameters: [Parameters.$host, Parameters.height, Parameters.pubkey],
941
+ headerParameters: [Parameters.accept],
942
+ serializer
943
+ };
944
+ const getAccountByPubkeyAndHashOperationSpec: coreClient.OperationSpec = {
945
+ path: "/v3/accounts/{pubkey}/hash/{hash}",
946
+ httpMethod: "GET",
947
+ responses: {
948
+ 200: {
949
+ bodyMapper: Mappers.Account
950
+ },
951
+ 400: {
952
+ bodyMapper: Mappers.ErrorModel,
953
+ isError: true
954
+ },
955
+ 404: {
956
+ bodyMapper: Mappers.ErrorModel,
957
+ isError: true
958
+ }
959
+ },
960
+ queryParameters: [Parameters.intAsString],
961
+ urlParameters: [Parameters.$host, Parameters.hash, Parameters.pubkey],
962
+ headerParameters: [Parameters.accept],
963
+ serializer
964
+ };
965
+ const getPendingAccountTransactionsByPubkeyOperationSpec: coreClient.OperationSpec = {
966
+ path: "/v3/accounts/{pubkey}/transactions/pending",
967
+ httpMethod: "GET",
968
+ responses: {
969
+ 200: {
970
+ bodyMapper: Mappers.SignedTxs
971
+ },
972
+ 400: {
973
+ bodyMapper: Mappers.ErrorModel,
974
+ isError: true
975
+ },
976
+ 404: {
977
+ bodyMapper: Mappers.ErrorModel,
978
+ isError: true
979
+ }
980
+ },
981
+ queryParameters: [Parameters.intAsString],
982
+ urlParameters: [Parameters.$host, Parameters.pubkey],
983
+ headerParameters: [Parameters.accept],
984
+ serializer
985
+ };
986
+ const getAccountNextNonceOperationSpec: coreClient.OperationSpec = {
987
+ path: "/v3/accounts/{pubkey}/next-nonce",
988
+ httpMethod: "GET",
989
+ responses: {
990
+ 200: {
991
+ bodyMapper: Mappers.NextNonceResponse
992
+ },
993
+ 400: {
994
+ bodyMapper: Mappers.ErrorModel,
995
+ isError: true
996
+ },
997
+ 404: {
998
+ bodyMapper: Mappers.ErrorModel,
999
+ isError: true
1000
+ }
1001
+ },
1002
+ queryParameters: [Parameters.intAsString, Parameters.strategy],
1003
+ urlParameters: [Parameters.$host, Parameters.pubkey],
1004
+ headerParameters: [Parameters.accept],
1005
+ serializer
1006
+ };
1007
+ const protectedDryRunTxsOperationSpec: coreClient.OperationSpec = {
1008
+ path: "/v3/dry-run",
1009
+ httpMethod: "POST",
1010
+ responses: {
1011
+ 200: {
1012
+ bodyMapper: Mappers.DryRunResults
1013
+ },
1014
+ 403: {
1015
+ bodyMapper: Mappers.ErrorModel,
1016
+ isError: true
1017
+ }
1018
+ },
1019
+ requestBody: Parameters.body,
1020
+ queryParameters: [Parameters.intAsString],
1021
+ urlParameters: [Parameters.$host],
1022
+ headerParameters: [Parameters.accept, Parameters.contentType],
1023
+ mediaType: "json",
1024
+ serializer
1025
+ };
1026
+ const getTransactionByHashOperationSpec: coreClient.OperationSpec = {
1027
+ path: "/v3/transactions/{hash}",
1028
+ httpMethod: "GET",
1029
+ responses: {
1030
+ 200: {
1031
+ bodyMapper: Mappers.SignedTx
1032
+ },
1033
+ 400: {
1034
+ bodyMapper: Mappers.ErrorModel,
1035
+ isError: true
1036
+ },
1037
+ 404: {
1038
+ bodyMapper: Mappers.ErrorModel,
1039
+ isError: true
1040
+ }
1041
+ },
1042
+ queryParameters: [Parameters.intAsString],
1043
+ urlParameters: [Parameters.$host, Parameters.hash],
1044
+ headerParameters: [Parameters.accept],
1045
+ serializer
1046
+ };
1047
+ const getTransactionInfoByHashOperationSpec: coreClient.OperationSpec = {
1048
+ path: "/v3/transactions/{hash}/info",
1049
+ httpMethod: "GET",
1050
+ responses: {
1051
+ 200: {
1052
+ bodyMapper: Mappers.TxInfoObject
1053
+ },
1054
+ 400: {
1055
+ bodyMapper: Mappers.ErrorModel,
1056
+ isError: true
1057
+ },
1058
+ 404: {
1059
+ bodyMapper: Mappers.ErrorModel,
1060
+ isError: true
1061
+ }
1062
+ },
1063
+ queryParameters: [Parameters.intAsString],
1064
+ urlParameters: [Parameters.$host, Parameters.hash],
1065
+ headerParameters: [Parameters.accept],
1066
+ serializer
1067
+ };
1068
+ const postTransactionOperationSpec: coreClient.OperationSpec = {
1069
+ path: "/v3/transactions",
1070
+ httpMethod: "POST",
1071
+ responses: {
1072
+ 200: {
1073
+ bodyMapper: Mappers.PostTxResponse
1074
+ },
1075
+ 400: {
1076
+ bodyMapper: Mappers.ErrorModel,
1077
+ isError: true
1078
+ }
1079
+ },
1080
+ requestBody: Parameters.body1,
1081
+ queryParameters: [Parameters.intAsString],
1082
+ urlParameters: [Parameters.$host],
1083
+ headerParameters: [Parameters.accept, Parameters.contentType],
1084
+ mediaType: "json",
1085
+ serializer
1086
+ };
1087
+ const getContractOperationSpec: coreClient.OperationSpec = {
1088
+ path: "/v3/contracts/{pubkey}",
1089
+ httpMethod: "GET",
1090
+ responses: {
1091
+ 200: {
1092
+ bodyMapper: Mappers.ContractObject
1093
+ },
1094
+ 400: {
1095
+ bodyMapper: Mappers.ErrorModel,
1096
+ isError: true
1097
+ },
1098
+ 404: {
1099
+ isError: true
1100
+ }
1101
+ },
1102
+ queryParameters: [Parameters.intAsString],
1103
+ urlParameters: [Parameters.$host, Parameters.pubkey],
1104
+ headerParameters: [Parameters.accept],
1105
+ serializer
1106
+ };
1107
+ const getContractCodeOperationSpec: coreClient.OperationSpec = {
1108
+ path: "/v3/contracts/{pubkey}/code",
1109
+ httpMethod: "GET",
1110
+ responses: {
1111
+ 200: {
1112
+ bodyMapper: Mappers.ByteCode
1113
+ },
1114
+ 400: {
1115
+ bodyMapper: Mappers.ErrorModel,
1116
+ isError: true
1117
+ },
1118
+ 404: {
1119
+ bodyMapper: Mappers.ErrorModel,
1120
+ isError: true
1121
+ }
1122
+ },
1123
+ queryParameters: [Parameters.intAsString],
1124
+ urlParameters: [Parameters.$host, Parameters.pubkey],
1125
+ headerParameters: [Parameters.accept],
1126
+ serializer
1127
+ };
1128
+ const getContractPoIOperationSpec: coreClient.OperationSpec = {
1129
+ path: "/v3/contracts/{pubkey}/poi",
1130
+ httpMethod: "GET",
1131
+ responses: {
1132
+ 200: {
1133
+ bodyMapper: Mappers.PoI
1134
+ },
1135
+ 400: {
1136
+ bodyMapper: Mappers.ErrorModel,
1137
+ isError: true
1138
+ },
1139
+ 404: {
1140
+ bodyMapper: Mappers.ErrorModel,
1141
+ isError: true
1142
+ }
1143
+ },
1144
+ queryParameters: [Parameters.intAsString],
1145
+ urlParameters: [Parameters.$host, Parameters.pubkey],
1146
+ headerParameters: [Parameters.accept],
1147
+ serializer
1148
+ };
1149
+ const getOracleByPubkeyOperationSpec: coreClient.OperationSpec = {
1150
+ path: "/v3/oracles/{pubkey}",
1151
+ httpMethod: "GET",
1152
+ responses: {
1153
+ 200: {
1154
+ bodyMapper: Mappers.RegisteredOracle
1155
+ },
1156
+ 400: {
1157
+ bodyMapper: Mappers.ErrorModel,
1158
+ isError: true
1159
+ },
1160
+ 404: {
1161
+ bodyMapper: Mappers.ErrorModel,
1162
+ isError: true
1163
+ }
1164
+ },
1165
+ queryParameters: [Parameters.intAsString],
1166
+ urlParameters: [Parameters.$host, Parameters.pubkey],
1167
+ headerParameters: [Parameters.accept],
1168
+ serializer
1169
+ };
1170
+ const getOracleQueriesByPubkeyOperationSpec: coreClient.OperationSpec = {
1171
+ path: "/v3/oracles/{pubkey}/queries",
1172
+ httpMethod: "GET",
1173
+ responses: {
1174
+ 200: {
1175
+ bodyMapper: Mappers.OracleQueries
1176
+ },
1177
+ 400: {
1178
+ bodyMapper: Mappers.ErrorModel,
1179
+ isError: true
1180
+ },
1181
+ 404: {
1182
+ bodyMapper: Mappers.ErrorModel,
1183
+ isError: true
1184
+ }
1185
+ },
1186
+ queryParameters: [
1187
+ Parameters.intAsString,
1188
+ Parameters.fromParam,
1189
+ Parameters.limit,
1190
+ Parameters.typeParam
1191
+ ],
1192
+ urlParameters: [Parameters.$host, Parameters.pubkey],
1193
+ headerParameters: [Parameters.accept],
1194
+ serializer
1195
+ };
1196
+ const getOracleQueryByPubkeyAndQueryIdOperationSpec: coreClient.OperationSpec = {
1197
+ path: "/v3/oracles/{pubkey}/queries/{query-id}",
1198
+ httpMethod: "GET",
1199
+ responses: {
1200
+ 200: {
1201
+ bodyMapper: Mappers.OracleQuery
1202
+ },
1203
+ 400: {
1204
+ bodyMapper: Mappers.ErrorModel,
1205
+ isError: true
1206
+ },
1207
+ 404: {
1208
+ bodyMapper: Mappers.ErrorModel,
1209
+ isError: true
1210
+ }
1211
+ },
1212
+ queryParameters: [Parameters.intAsString],
1213
+ urlParameters: [Parameters.$host, Parameters.pubkey, Parameters.queryId],
1214
+ headerParameters: [Parameters.accept],
1215
+ serializer
1216
+ };
1217
+ const getNameEntryByNameOperationSpec: coreClient.OperationSpec = {
1218
+ path: "/v3/names/{name}",
1219
+ httpMethod: "GET",
1220
+ responses: {
1221
+ 200: {
1222
+ bodyMapper: Mappers.NameEntry
1223
+ },
1224
+ 400: {
1225
+ bodyMapper: Mappers.ErrorModel,
1226
+ isError: true
1227
+ },
1228
+ 404: {
1229
+ bodyMapper: Mappers.ErrorModel,
1230
+ isError: true
1231
+ }
1232
+ },
1233
+ queryParameters: [Parameters.intAsString],
1234
+ urlParameters: [Parameters.$host, Parameters.name],
1235
+ headerParameters: [Parameters.accept],
1236
+ serializer
1237
+ };
1238
+ const getChannelByPubkeyOperationSpec: coreClient.OperationSpec = {
1239
+ path: "/v3/channels/{pubkey}",
1240
+ httpMethod: "GET",
1241
+ responses: {
1242
+ 200: {
1243
+ bodyMapper: Mappers.Channel
1244
+ },
1245
+ 400: {
1246
+ bodyMapper: Mappers.ErrorModel,
1247
+ isError: true
1248
+ },
1249
+ 404: {
1250
+ bodyMapper: Mappers.ErrorModel,
1251
+ isError: true
1252
+ }
1253
+ },
1254
+ queryParameters: [Parameters.intAsString],
1255
+ urlParameters: [Parameters.$host, Parameters.pubkey],
1256
+ headerParameters: [Parameters.accept],
1257
+ serializer
1258
+ };
1259
+ const getPeerPubkeyOperationSpec: coreClient.OperationSpec = {
1260
+ path: "/v3/peers/pubkey",
1261
+ httpMethod: "GET",
1262
+ responses: {
1263
+ 200: {
1264
+ bodyMapper: Mappers.PeerPubKey
1265
+ }
1266
+ },
1267
+ queryParameters: [Parameters.intAsString],
1268
+ urlParameters: [Parameters.$host],
1269
+ headerParameters: [Parameters.accept],
1270
+ serializer
1271
+ };
1272
+ const getStatusOperationSpec: coreClient.OperationSpec = {
1273
+ path: "/v3/status",
1274
+ httpMethod: "GET",
1275
+ responses: {
1276
+ 200: {
1277
+ bodyMapper: Mappers.Status
1278
+ }
1279
+ },
1280
+ queryParameters: [Parameters.intAsString],
1281
+ urlParameters: [Parameters.$host],
1282
+ headerParameters: [Parameters.accept],
1283
+ serializer
1284
+ };
1285
+ const getChainEndsOperationSpec: coreClient.OperationSpec = {
1286
+ path: "/v3/status/chain-ends",
1287
+ httpMethod: "GET",
1288
+ responses: {
1289
+ 200: {
1290
+ bodyMapper: {
1291
+ type: { name: "Sequence", element: { type: { name: "String" } } }
1292
+ }
1293
+ }
1294
+ },
1295
+ queryParameters: [Parameters.intAsString],
1296
+ urlParameters: [Parameters.$host],
1297
+ headerParameters: [Parameters.accept],
1298
+ serializer
1299
+ };