@sravankumar02/sdk-core 1.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 (561) hide show
  1. package/LICENSE +11 -0
  2. package/README.md +94 -0
  3. package/out/abi/argSerializer.d.ts +45 -0
  4. package/out/abi/argSerializer.js +171 -0
  5. package/out/abi/argSerializer.js.map +1 -0
  6. package/out/abi/argumentErrorContext.d.ts +12 -0
  7. package/out/abi/argumentErrorContext.js +34 -0
  8. package/out/abi/argumentErrorContext.js.map +1 -0
  9. package/out/abi/code.d.ts +23 -0
  10. package/out/abi/code.js +41 -0
  11. package/out/abi/code.js.map +1 -0
  12. package/out/abi/codec/address.d.ts +24 -0
  13. package/out/abi/codec/address.js +41 -0
  14. package/out/abi/codec/address.js.map +1 -0
  15. package/out/abi/codec/arrayVec.d.ts +11 -0
  16. package/out/abi/codec/arrayVec.js +39 -0
  17. package/out/abi/codec/arrayVec.js.map +1 -0
  18. package/out/abi/codec/binary.d.ts +30 -0
  19. package/out/abi/codec/binary.js +134 -0
  20. package/out/abi/codec/binary.js.map +1 -0
  21. package/out/abi/codec/binaryCodecUtils.d.ts +6 -0
  22. package/out/abi/codec/binaryCodecUtils.js +35 -0
  23. package/out/abi/codec/binaryCodecUtils.js.map +1 -0
  24. package/out/abi/codec/boolean.d.ts +13 -0
  25. package/out/abi/codec/boolean.js +57 -0
  26. package/out/abi/codec/boolean.js.map +1 -0
  27. package/out/abi/codec/bytes.d.ts +11 -0
  28. package/out/abi/codec/bytes.js +30 -0
  29. package/out/abi/codec/bytes.js.map +1 -0
  30. package/out/abi/codec/codemetadata.d.ts +8 -0
  31. package/out/abi/codec/codemetadata.js +23 -0
  32. package/out/abi/codec/codemetadata.js.map +1 -0
  33. package/out/abi/codec/constants.d.ts +1 -0
  34. package/out/abi/codec/constants.js +5 -0
  35. package/out/abi/codec/constants.js.map +1 -0
  36. package/out/abi/codec/enum.d.ts +13 -0
  37. package/out/abi/codec/enum.js +49 -0
  38. package/out/abi/codec/enum.js.map +1 -0
  39. package/out/abi/codec/explicit-enum.d.ts +10 -0
  40. package/out/abi/codec/explicit-enum.js +30 -0
  41. package/out/abi/codec/explicit-enum.js.map +1 -0
  42. package/out/abi/codec/fields.d.ts +9 -0
  43. package/out/abi/codec/fields.js +31 -0
  44. package/out/abi/codec/fields.js.map +1 -0
  45. package/out/abi/codec/h256.d.ts +24 -0
  46. package/out/abi/codec/h256.js +39 -0
  47. package/out/abi/codec/h256.js.map +1 -0
  48. package/out/abi/codec/index.d.ts +6 -0
  49. package/out/abi/codec/index.js +19 -0
  50. package/out/abi/codec/index.js.map +1 -0
  51. package/out/abi/codec/list.d.ts +14 -0
  52. package/out/abi/codec/list.js +67 -0
  53. package/out/abi/codec/list.js.map +1 -0
  54. package/out/abi/codec/managedDecimal.d.ts +11 -0
  55. package/out/abi/codec/managedDecimal.js +53 -0
  56. package/out/abi/codec/managedDecimal.js.map +1 -0
  57. package/out/abi/codec/managedDecimalSigned.d.ts +11 -0
  58. package/out/abi/codec/managedDecimalSigned.js +53 -0
  59. package/out/abi/codec/managedDecimalSigned.js.map +1 -0
  60. package/out/abi/codec/nothing.d.ts +8 -0
  61. package/out/abi/codec/nothing.js +20 -0
  62. package/out/abi/codec/nothing.js.map +1 -0
  63. package/out/abi/codec/numerical.d.ts +13 -0
  64. package/out/abi/codec/numerical.js +122 -0
  65. package/out/abi/codec/numerical.js.map +1 -0
  66. package/out/abi/codec/option.d.ts +14 -0
  67. package/out/abi/codec/option.js +66 -0
  68. package/out/abi/codec/option.js.map +1 -0
  69. package/out/abi/codec/primitive.d.ts +20 -0
  70. package/out/abi/codec/primitive.js +81 -0
  71. package/out/abi/codec/primitive.js.map +1 -0
  72. package/out/abi/codec/string.d.ts +9 -0
  73. package/out/abi/codec/string.js +28 -0
  74. package/out/abi/codec/string.js.map +1 -0
  75. package/out/abi/codec/struct.d.ts +11 -0
  76. package/out/abi/codec/struct.js +30 -0
  77. package/out/abi/codec/struct.js.map +1 -0
  78. package/out/abi/codec/tokenIdentifier.d.ts +9 -0
  79. package/out/abi/codec/tokenIdentifier.js +28 -0
  80. package/out/abi/codec/tokenIdentifier.js.map +1 -0
  81. package/out/abi/codec/tuple.d.ts +11 -0
  82. package/out/abi/codec/tuple.js +23 -0
  83. package/out/abi/codec/tuple.js.map +1 -0
  84. package/out/abi/codec/utils.d.ts +20 -0
  85. package/out/abi/codec/utils.js +69 -0
  86. package/out/abi/codec/utils.js.map +1 -0
  87. package/out/abi/function.d.ts +24 -0
  88. package/out/abi/function.js +56 -0
  89. package/out/abi/function.js.map +1 -0
  90. package/out/abi/index.d.ts +12 -0
  91. package/out/abi/index.js +25 -0
  92. package/out/abi/index.js.map +1 -0
  93. package/out/abi/interaction.d.ts +67 -0
  94. package/out/abi/interaction.js +146 -0
  95. package/out/abi/interaction.js.map +1 -0
  96. package/out/abi/interface.d.ts +85 -0
  97. package/out/abi/interface.js +3 -0
  98. package/out/abi/interface.js.map +1 -0
  99. package/out/abi/nativeSerializer.d.ts +27 -0
  100. package/out/abi/nativeSerializer.js +343 -0
  101. package/out/abi/nativeSerializer.js.map +1 -0
  102. package/out/abi/query.d.ts +18 -0
  103. package/out/abi/query.js +19 -0
  104. package/out/abi/query.js.map +1 -0
  105. package/out/abi/returnCode.d.ts +26 -0
  106. package/out/abi/returnCode.js +45 -0
  107. package/out/abi/returnCode.js.map +1 -0
  108. package/out/abi/smartContract.d.ts +74 -0
  109. package/out/abi/smartContract.js +208 -0
  110. package/out/abi/smartContract.js.map +1 -0
  111. package/out/abi/typeFormula.d.ts +7 -0
  112. package/out/abi/typeFormula.js +20 -0
  113. package/out/abi/typeFormula.js.map +1 -0
  114. package/out/abi/typeFormulaParser.d.ts +14 -0
  115. package/out/abi/typeFormulaParser.js +126 -0
  116. package/out/abi/typeFormulaParser.js.map +1 -0
  117. package/out/abi/typesystem/abi.d.ts +64 -0
  118. package/out/abi/typesystem/abi.js +208 -0
  119. package/out/abi/typesystem/abi.js.map +1 -0
  120. package/out/abi/typesystem/address.d.ts +23 -0
  121. package/out/abi/typesystem/address.js +41 -0
  122. package/out/abi/typesystem/address.js.map +1 -0
  123. package/out/abi/typesystem/algebraic.d.ts +24 -0
  124. package/out/abi/typesystem/algebraic.js +59 -0
  125. package/out/abi/typesystem/algebraic.js.map +1 -0
  126. package/out/abi/typesystem/boolean.d.ts +24 -0
  127. package/out/abi/typesystem/boolean.js +46 -0
  128. package/out/abi/typesystem/boolean.js.map +1 -0
  129. package/out/abi/typesystem/bytes.d.ts +28 -0
  130. package/out/abi/typesystem/bytes.js +58 -0
  131. package/out/abi/typesystem/bytes.js.map +1 -0
  132. package/out/abi/typesystem/codeMetadata.d.ts +11 -0
  133. package/out/abi/typesystem/codeMetadata.js +24 -0
  134. package/out/abi/typesystem/codeMetadata.js.map +1 -0
  135. package/out/abi/typesystem/collections.d.ts +9 -0
  136. package/out/abi/typesystem/collections.js +32 -0
  137. package/out/abi/typesystem/collections.js.map +1 -0
  138. package/out/abi/typesystem/composite.d.ts +16 -0
  139. package/out/abi/typesystem/composite.js +53 -0
  140. package/out/abi/typesystem/composite.js.map +1 -0
  141. package/out/abi/typesystem/endpoint.d.ts +41 -0
  142. package/out/abi/typesystem/endpoint.js +78 -0
  143. package/out/abi/typesystem/endpoint.js.map +1 -0
  144. package/out/abi/typesystem/enum.d.ts +51 -0
  145. package/out/abi/typesystem/enum.js +137 -0
  146. package/out/abi/typesystem/enum.js.map +1 -0
  147. package/out/abi/typesystem/event.d.ts +25 -0
  148. package/out/abi/typesystem/event.js +36 -0
  149. package/out/abi/typesystem/event.js.map +1 -0
  150. package/out/abi/typesystem/explicit-enum.d.ts +33 -0
  151. package/out/abi/typesystem/explicit-enum.js +63 -0
  152. package/out/abi/typesystem/explicit-enum.js.map +1 -0
  153. package/out/abi/typesystem/factory.d.ts +4 -0
  154. package/out/abi/typesystem/factory.js +19 -0
  155. package/out/abi/typesystem/factory.js.map +1 -0
  156. package/out/abi/typesystem/fields.d.ts +24 -0
  157. package/out/abi/typesystem/fields.js +90 -0
  158. package/out/abi/typesystem/fields.js.map +1 -0
  159. package/out/abi/typesystem/generic.d.ts +47 -0
  160. package/out/abi/typesystem/generic.js +120 -0
  161. package/out/abi/typesystem/generic.js.map +1 -0
  162. package/out/abi/typesystem/genericArray.d.ts +17 -0
  163. package/out/abi/typesystem/genericArray.js +44 -0
  164. package/out/abi/typesystem/genericArray.js.map +1 -0
  165. package/out/abi/typesystem/h256.d.ts +18 -0
  166. package/out/abi/typesystem/h256.js +35 -0
  167. package/out/abi/typesystem/h256.js.map +1 -0
  168. package/out/abi/typesystem/index.d.ts +33 -0
  169. package/out/abi/typesystem/index.js +46 -0
  170. package/out/abi/typesystem/index.js.map +1 -0
  171. package/out/abi/typesystem/managedDecimal.d.ts +26 -0
  172. package/out/abi/typesystem/managedDecimal.js +62 -0
  173. package/out/abi/typesystem/managedDecimal.js.map +1 -0
  174. package/out/abi/typesystem/managedDecimalSigned.d.ts +26 -0
  175. package/out/abi/typesystem/managedDecimalSigned.js +62 -0
  176. package/out/abi/typesystem/managedDecimalSigned.js.map +1 -0
  177. package/out/abi/typesystem/matchers.d.ts +51 -0
  178. package/out/abi/typesystem/matchers.js +185 -0
  179. package/out/abi/typesystem/matchers.js.map +1 -0
  180. package/out/abi/typesystem/nothing.d.ts +13 -0
  181. package/out/abi/typesystem/nothing.js +31 -0
  182. package/out/abi/typesystem/nothing.js.map +1 -0
  183. package/out/abi/typesystem/numerical.d.ts +130 -0
  184. package/out/abi/typesystem/numerical.js +286 -0
  185. package/out/abi/typesystem/numerical.js.map +1 -0
  186. package/out/abi/typesystem/string.d.ts +26 -0
  187. package/out/abi/typesystem/string.js +51 -0
  188. package/out/abi/typesystem/string.js.map +1 -0
  189. package/out/abi/typesystem/struct.d.ts +30 -0
  190. package/out/abi/typesystem/struct.js +78 -0
  191. package/out/abi/typesystem/struct.js.map +1 -0
  192. package/out/abi/typesystem/tokenIdentifier.d.ts +21 -0
  193. package/out/abi/typesystem/tokenIdentifier.js +51 -0
  194. package/out/abi/typesystem/tokenIdentifier.js.map +1 -0
  195. package/out/abi/typesystem/tuple.d.ts +16 -0
  196. package/out/abi/typesystem/tuple.js +71 -0
  197. package/out/abi/typesystem/tuple.js.map +1 -0
  198. package/out/abi/typesystem/typeExpressionParser.d.ts +8 -0
  199. package/out/abi/typesystem/typeExpressionParser.js +30 -0
  200. package/out/abi/typesystem/typeExpressionParser.js.map +1 -0
  201. package/out/abi/typesystem/typeMapper.d.ts +20 -0
  202. package/out/abi/typesystem/typeMapper.js +215 -0
  203. package/out/abi/typesystem/typeMapper.js.map +1 -0
  204. package/out/abi/typesystem/types.d.ts +129 -0
  205. package/out/abi/typesystem/types.js +285 -0
  206. package/out/abi/typesystem/types.js.map +1 -0
  207. package/out/abi/typesystem/variadic.d.ts +35 -0
  208. package/out/abi/typesystem/variadic.js +81 -0
  209. package/out/abi/typesystem/variadic.js.map +1 -0
  210. package/out/accountManagement/accountController.d.ts +18 -0
  211. package/out/accountManagement/accountController.js +54 -0
  212. package/out/accountManagement/accountController.js.map +1 -0
  213. package/out/accountManagement/accountTransactionsFactory.d.ts +27 -0
  214. package/out/accountManagement/accountTransactionsFactory.js +78 -0
  215. package/out/accountManagement/accountTransactionsFactory.js.map +1 -0
  216. package/out/accountManagement/index.d.ts +3 -0
  217. package/out/accountManagement/index.js +16 -0
  218. package/out/accountManagement/index.js.map +1 -0
  219. package/out/accountManagement/resources.d.ts +8 -0
  220. package/out/accountManagement/resources.js +3 -0
  221. package/out/accountManagement/resources.js.map +1 -0
  222. package/out/accounts/account.d.ts +94 -0
  223. package/out/accounts/account.js +154 -0
  224. package/out/accounts/account.js.map +1 -0
  225. package/out/accounts/index.d.ts +1 -0
  226. package/out/accounts/index.js +14 -0
  227. package/out/accounts/index.js.map +1 -0
  228. package/out/core/address.d.ts +105 -0
  229. package/out/core/address.js +313 -0
  230. package/out/core/address.js.map +1 -0
  231. package/out/core/asyncTimer.d.ts +27 -0
  232. package/out/core/asyncTimer.js +91 -0
  233. package/out/core/asyncTimer.js.map +1 -0
  234. package/out/core/baseController.d.ts +16 -0
  235. package/out/core/baseController.js +34 -0
  236. package/out/core/baseController.js.map +1 -0
  237. package/out/core/codeMetadata.d.ts +74 -0
  238. package/out/core/codeMetadata.js +146 -0
  239. package/out/core/codeMetadata.js.map +1 -0
  240. package/out/core/compatibility.d.ts +10 -0
  241. package/out/core/compatibility.js +22 -0
  242. package/out/core/compatibility.js.map +1 -0
  243. package/out/core/config.d.ts +15 -0
  244. package/out/core/config.js +20 -0
  245. package/out/core/config.js.map +1 -0
  246. package/out/core/constants.d.ts +28 -0
  247. package/out/core/constants.js +32 -0
  248. package/out/core/constants.js.map +1 -0
  249. package/out/core/errors.d.ts +279 -0
  250. package/out/core/errors.js +437 -0
  251. package/out/core/errors.js.map +1 -0
  252. package/out/core/globals.d.ts +0 -0
  253. package/out/core/globals.js +5 -0
  254. package/out/core/globals.js.map +1 -0
  255. package/out/core/index.d.ts +21 -0
  256. package/out/core/index.js +35 -0
  257. package/out/core/index.js.map +1 -0
  258. package/out/core/interfaces.d.ts +40 -0
  259. package/out/core/interfaces.js +3 -0
  260. package/out/core/interfaces.js.map +1 -0
  261. package/out/core/logger.d.ts +17 -0
  262. package/out/core/logger.js +50 -0
  263. package/out/core/logger.js.map +1 -0
  264. package/out/core/message.d.ts +57 -0
  265. package/out/core/message.js +71 -0
  266. package/out/core/message.js.map +1 -0
  267. package/out/core/networkParams.d.ts +57 -0
  268. package/out/core/networkParams.js +112 -0
  269. package/out/core/networkParams.js.map +1 -0
  270. package/out/core/reflection.d.ts +1 -0
  271. package/out/core/reflection.js +14 -0
  272. package/out/core/reflection.js.map +1 -0
  273. package/out/core/signature.d.ts +17 -0
  274. package/out/core/signature.js +82 -0
  275. package/out/core/signature.js.map +1 -0
  276. package/out/core/smartContractQuery.d.ts +35 -0
  277. package/out/core/smartContractQuery.js +34 -0
  278. package/out/core/smartContractQuery.js.map +1 -0
  279. package/out/core/tokenTransfersDataBuilder.d.ts +10 -0
  280. package/out/core/tokenTransfersDataBuilder.js +44 -0
  281. package/out/core/tokenTransfersDataBuilder.js.map +1 -0
  282. package/out/core/tokens.d.ts +130 -0
  283. package/out/core/tokens.js +287 -0
  284. package/out/core/tokens.js.map +1 -0
  285. package/out/core/transaction.d.ts +263 -0
  286. package/out/core/transaction.js +323 -0
  287. package/out/core/transaction.js.map +1 -0
  288. package/out/core/transactionBuilder.d.ts +32 -0
  289. package/out/core/transactionBuilder.js +45 -0
  290. package/out/core/transactionBuilder.js.map +1 -0
  291. package/out/core/transactionComputer.d.ts +51 -0
  292. package/out/core/transactionComputer.js +163 -0
  293. package/out/core/transactionComputer.js.map +1 -0
  294. package/out/core/transactionEvents.d.ts +17 -0
  295. package/out/core/transactionEvents.js +27 -0
  296. package/out/core/transactionEvents.js.map +1 -0
  297. package/out/core/transactionLogs.d.ts +11 -0
  298. package/out/core/transactionLogs.js +38 -0
  299. package/out/core/transactionLogs.js.map +1 -0
  300. package/out/core/transactionOnNetwork.d.ts +40 -0
  301. package/out/core/transactionOnNetwork.js +164 -0
  302. package/out/core/transactionOnNetwork.js.map +1 -0
  303. package/out/core/transactionStatus.d.ts +45 -0
  304. package/out/core/transactionStatus.js +71 -0
  305. package/out/core/transactionStatus.js.map +1 -0
  306. package/out/core/transactionWatcher.d.ts +48 -0
  307. package/out/core/transactionWatcher.js +148 -0
  308. package/out/core/transactionWatcher.js.map +1 -0
  309. package/out/core/transactionsFactoryConfig.d.ts +54 -0
  310. package/out/core/transactionsFactoryConfig.js +66 -0
  311. package/out/core/transactionsFactoryConfig.js.map +1 -0
  312. package/out/core/utils.codec.d.ts +8 -0
  313. package/out/core/utils.codec.js +75 -0
  314. package/out/core/utils.codec.js.map +1 -0
  315. package/out/core/utils.d.ts +20 -0
  316. package/out/core/utils.js +86 -0
  317. package/out/core/utils.js.map +1 -0
  318. package/out/delegation/delegationController.d.ts +37 -0
  319. package/out/delegation/delegationController.js +215 -0
  320. package/out/delegation/delegationController.js.map +1 -0
  321. package/out/delegation/delegationTransactionsFactory.d.ts +48 -0
  322. package/out/delegation/delegationTransactionsFactory.js +311 -0
  323. package/out/delegation/delegationTransactionsFactory.js.map +1 -0
  324. package/out/delegation/delegationTransactionsOutcomeParser.d.ts +10 -0
  325. package/out/delegation/delegationTransactionsOutcomeParser.js +35 -0
  326. package/out/delegation/delegationTransactionsOutcomeParser.js.map +1 -0
  327. package/out/delegation/index.d.ts +4 -0
  328. package/out/delegation/index.js +17 -0
  329. package/out/delegation/index.js.map +1 -0
  330. package/out/delegation/resources.d.ts +38 -0
  331. package/out/delegation/resources.js +3 -0
  332. package/out/delegation/resources.js.map +1 -0
  333. package/out/entrypoints/config.d.ts +29 -0
  334. package/out/entrypoints/config.js +36 -0
  335. package/out/entrypoints/config.js.map +1 -0
  336. package/out/entrypoints/entrypoints.d.ts +92 -0
  337. package/out/entrypoints/entrypoints.js +203 -0
  338. package/out/entrypoints/entrypoints.js.map +1 -0
  339. package/out/entrypoints/index.d.ts +2 -0
  340. package/out/entrypoints/index.js +15 -0
  341. package/out/entrypoints/index.js.map +1 -0
  342. package/out/governance/governanceController.d.ts +33 -0
  343. package/out/governance/governanceController.js +205 -0
  344. package/out/governance/governanceController.js.map +1 -0
  345. package/out/governance/governanceTransactionsFactory.d.ts +16 -0
  346. package/out/governance/governanceTransactionsFactory.js +99 -0
  347. package/out/governance/governanceTransactionsFactory.js.map +1 -0
  348. package/out/governance/governanceTransactionsOutcomeParser.d.ts +15 -0
  349. package/out/governance/governanceTransactionsOutcomeParser.js +99 -0
  350. package/out/governance/governanceTransactionsOutcomeParser.js.map +1 -0
  351. package/out/governance/index.d.ts +4 -0
  352. package/out/governance/index.js +17 -0
  353. package/out/governance/index.js.map +1 -0
  354. package/out/governance/resources.d.ts +82 -0
  355. package/out/governance/resources.js +11 -0
  356. package/out/governance/resources.js.map +1 -0
  357. package/out/index.d.ts +19 -0
  358. package/out/index.js +32 -0
  359. package/out/index.js.map +1 -0
  360. package/out/multisig/index.d.ts +3 -0
  361. package/out/multisig/index.js +16 -0
  362. package/out/multisig/index.js.map +1 -0
  363. package/out/multisig/multisigController.d.ts +221 -0
  364. package/out/multisig/multisigController.js +540 -0
  365. package/out/multisig/multisigController.js.map +1 -0
  366. package/out/multisig/multisigTransactionsFactory.d.ts +110 -0
  367. package/out/multisig/multisigTransactionsFactory.js +355 -0
  368. package/out/multisig/multisigTransactionsFactory.js.map +1 -0
  369. package/out/multisig/multisigTransactionsOutcomeParser.d.ts +31 -0
  370. package/out/multisig/multisigTransactionsOutcomeParser.js +41 -0
  371. package/out/multisig/multisigTransactionsOutcomeParser.js.map +1 -0
  372. package/out/multisig/proposeTransferExecuteContractInput.d.ts +32 -0
  373. package/out/multisig/proposeTransferExecuteContractInput.js +65 -0
  374. package/out/multisig/proposeTransferExecuteContractInput.js.map +1 -0
  375. package/out/multisig/resources.d.ts +182 -0
  376. package/out/multisig/resources.js +125 -0
  377. package/out/multisig/resources.js.map +1 -0
  378. package/out/networkProviders/accountAwaiter.d.ts +35 -0
  379. package/out/networkProviders/accountAwaiter.js +67 -0
  380. package/out/networkProviders/accountAwaiter.js.map +1 -0
  381. package/out/networkProviders/accounts.d.ts +55 -0
  382. package/out/networkProviders/accounts.js +154 -0
  383. package/out/networkProviders/accounts.js.map +1 -0
  384. package/out/networkProviders/apiNetworkProvider.d.ts +48 -0
  385. package/out/networkProviders/apiNetworkProvider.js +235 -0
  386. package/out/networkProviders/apiNetworkProvider.js.map +1 -0
  387. package/out/networkProviders/blocks.d.ts +48 -0
  388. package/out/networkProviders/blocks.js +76 -0
  389. package/out/networkProviders/blocks.js.map +1 -0
  390. package/out/networkProviders/config.d.ts +6 -0
  391. package/out/networkProviders/config.js +18 -0
  392. package/out/networkProviders/config.js.map +1 -0
  393. package/out/networkProviders/constants.d.ts +9 -0
  394. package/out/networkProviders/constants.js +16 -0
  395. package/out/networkProviders/constants.js.map +1 -0
  396. package/out/networkProviders/contractQueryRequest.d.ts +6 -0
  397. package/out/networkProviders/contractQueryRequest.js +20 -0
  398. package/out/networkProviders/contractQueryRequest.js.map +1 -0
  399. package/out/networkProviders/index.d.ts +11 -0
  400. package/out/networkProviders/index.js +28 -0
  401. package/out/networkProviders/index.js.map +1 -0
  402. package/out/networkProviders/interface.d.ts +110 -0
  403. package/out/networkProviders/interface.js +3 -0
  404. package/out/networkProviders/interface.js.map +1 -0
  405. package/out/networkProviders/networkConfig.d.ts +48 -0
  406. package/out/networkProviders/networkConfig.js +41 -0
  407. package/out/networkProviders/networkConfig.js.map +1 -0
  408. package/out/networkProviders/networkProviderConfig.d.ts +4 -0
  409. package/out/networkProviders/networkProviderConfig.js +3 -0
  410. package/out/networkProviders/networkProviderConfig.js.map +1 -0
  411. package/out/networkProviders/networkStatus.d.ts +31 -0
  412. package/out/networkProviders/networkStatus.js +31 -0
  413. package/out/networkProviders/networkStatus.js.map +1 -0
  414. package/out/networkProviders/proxyNetworkProvider.d.ts +51 -0
  415. package/out/networkProviders/proxyNetworkProvider.js +261 -0
  416. package/out/networkProviders/proxyNetworkProvider.js.map +1 -0
  417. package/out/networkProviders/resources.d.ts +12 -0
  418. package/out/networkProviders/resources.js +29 -0
  419. package/out/networkProviders/resources.js.map +1 -0
  420. package/out/networkProviders/tokenDefinitions.d.ts +49 -0
  421. package/out/networkProviders/tokenDefinitions.js +152 -0
  422. package/out/networkProviders/tokenDefinitions.js.map +1 -0
  423. package/out/networkProviders/tokens.d.ts +40 -0
  424. package/out/networkProviders/tokens.js +106 -0
  425. package/out/networkProviders/tokens.js.map +1 -0
  426. package/out/networkProviders/userAgent.d.ts +2 -0
  427. package/out/networkProviders/userAgent.js +30 -0
  428. package/out/networkProviders/userAgent.js.map +1 -0
  429. package/out/proto/compiled.d.ts +2 -0
  430. package/out/proto/compiled.js +719 -0
  431. package/out/proto/compiled.js.map +1 -0
  432. package/out/proto/index.d.ts +5 -0
  433. package/out/proto/index.js +18 -0
  434. package/out/proto/index.js.map +1 -0
  435. package/out/proto/serializer.d.ts +22 -0
  436. package/out/proto/serializer.js +114 -0
  437. package/out/proto/serializer.js.map +1 -0
  438. package/out/smartContracts/index.d.ts +4 -0
  439. package/out/smartContracts/index.js +17 -0
  440. package/out/smartContracts/index.js.map +1 -0
  441. package/out/smartContracts/resources.d.ts +38 -0
  442. package/out/smartContracts/resources.js +3 -0
  443. package/out/smartContracts/resources.js.map +1 -0
  444. package/out/smartContracts/smartContractController.d.ts +32 -0
  445. package/out/smartContracts/smartContractController.js +128 -0
  446. package/out/smartContracts/smartContractController.js.map +1 -0
  447. package/out/smartContracts/smartContractTransactionsFactory.d.ts +42 -0
  448. package/out/smartContracts/smartContractTransactionsFactory.js +165 -0
  449. package/out/smartContracts/smartContractTransactionsFactory.js.map +1 -0
  450. package/out/smartContracts/smartContractTransactionsOutcomeParser.d.ts +28 -0
  451. package/out/smartContracts/smartContractTransactionsOutcomeParser.js +189 -0
  452. package/out/smartContracts/smartContractTransactionsOutcomeParser.js.map +1 -0
  453. package/out/tokenManagement/index.d.ts +4 -0
  454. package/out/tokenManagement/index.js +17 -0
  455. package/out/tokenManagement/index.js.map +1 -0
  456. package/out/tokenManagement/resources.d.ts +220 -0
  457. package/out/tokenManagement/resources.js +3 -0
  458. package/out/tokenManagement/resources.js.map +1 -0
  459. package/out/tokenManagement/tokenManagementController.d.ts +108 -0
  460. package/out/tokenManagement/tokenManagementController.js +582 -0
  461. package/out/tokenManagement/tokenManagementController.js.map +1 -0
  462. package/out/tokenManagement/tokenManagementTransactionsFactory.d.ts +82 -0
  463. package/out/tokenManagement/tokenManagementTransactionsFactory.js +684 -0
  464. package/out/tokenManagement/tokenManagementTransactionsFactory.js.map +1 -0
  465. package/out/tokenManagement/tokenManagementTransactionsOutcomeParser.d.ts +109 -0
  466. package/out/tokenManagement/tokenManagementTransactionsOutcomeParser.js +356 -0
  467. package/out/tokenManagement/tokenManagementTransactionsOutcomeParser.js.map +1 -0
  468. package/out/tokenOperations/codec.d.ts +7 -0
  469. package/out/tokenOperations/codec.js +55 -0
  470. package/out/tokenOperations/codec.js.map +1 -0
  471. package/out/transactionsOutcomeParsers/index.d.ts +4 -0
  472. package/out/transactionsOutcomeParsers/index.js +17 -0
  473. package/out/transactionsOutcomeParsers/index.js.map +1 -0
  474. package/out/transactionsOutcomeParsers/resources.d.ts +23 -0
  475. package/out/transactionsOutcomeParsers/resources.js +48 -0
  476. package/out/transactionsOutcomeParsers/resources.js.map +1 -0
  477. package/out/transactionsOutcomeParsers/transactionEventsParser.d.ts +16 -0
  478. package/out/transactionsOutcomeParsers/transactionEventsParser.js +48 -0
  479. package/out/transactionsOutcomeParsers/transactionEventsParser.js.map +1 -0
  480. package/out/transfers/index.d.ts +3 -0
  481. package/out/transfers/index.js +16 -0
  482. package/out/transfers/index.js.map +1 -0
  483. package/out/transfers/resources.d.ts +17 -0
  484. package/out/transfers/resources.js +3 -0
  485. package/out/transfers/resources.js.map +1 -0
  486. package/out/transfers/transferTransactionsFactory.d.ts +32 -0
  487. package/out/transfers/transferTransactionsFactory.js +131 -0
  488. package/out/transfers/transferTransactionsFactory.js.map +1 -0
  489. package/out/transfers/transfersControllers.d.ts +11 -0
  490. package/out/transfers/transfersControllers.js +43 -0
  491. package/out/transfers/transfersControllers.js.map +1 -0
  492. package/out/wallet/assertions.d.ts +3 -0
  493. package/out/wallet/assertions.js +12 -0
  494. package/out/wallet/assertions.js.map +1 -0
  495. package/out/wallet/crypto/constants.d.ts +6 -0
  496. package/out/wallet/crypto/constants.js +11 -0
  497. package/out/wallet/crypto/constants.js.map +1 -0
  498. package/out/wallet/crypto/decryptor.d.ts +5 -0
  499. package/out/wallet/crypto/decryptor.js +29 -0
  500. package/out/wallet/crypto/decryptor.js.map +1 -0
  501. package/out/wallet/crypto/derivationParams.d.ts +23 -0
  502. package/out/wallet/crypto/derivationParams.js +38 -0
  503. package/out/wallet/crypto/derivationParams.js.map +1 -0
  504. package/out/wallet/crypto/encryptedData.d.ts +15 -0
  505. package/out/wallet/crypto/encryptedData.js +52 -0
  506. package/out/wallet/crypto/encryptedData.js.map +1 -0
  507. package/out/wallet/crypto/encryptor.d.ts +14 -0
  508. package/out/wallet/crypto/encryptor.js +39 -0
  509. package/out/wallet/crypto/encryptor.js.map +1 -0
  510. package/out/wallet/crypto/index.d.ts +7 -0
  511. package/out/wallet/crypto/index.js +20 -0
  512. package/out/wallet/crypto/index.js.map +1 -0
  513. package/out/wallet/crypto/pubkeyDecryptor.d.ts +6 -0
  514. package/out/wallet/crypto/pubkeyDecryptor.js +38 -0
  515. package/out/wallet/crypto/pubkeyDecryptor.js.map +1 -0
  516. package/out/wallet/crypto/pubkeyEncryptor.d.ts +6 -0
  517. package/out/wallet/crypto/pubkeyEncryptor.js +54 -0
  518. package/out/wallet/crypto/pubkeyEncryptor.js.map +1 -0
  519. package/out/wallet/crypto/randomness.d.ts +7 -0
  520. package/out/wallet/crypto/randomness.js +15 -0
  521. package/out/wallet/crypto/randomness.js.map +1 -0
  522. package/out/wallet/crypto/x25519EncryptedData.d.ts +15 -0
  523. package/out/wallet/crypto/x25519EncryptedData.js +37 -0
  524. package/out/wallet/crypto/x25519EncryptedData.js.map +1 -0
  525. package/out/wallet/index.d.ts +11 -0
  526. package/out/wallet/index.js +24 -0
  527. package/out/wallet/index.js.map +1 -0
  528. package/out/wallet/keypair.d.ts +12 -0
  529. package/out/wallet/keypair.js +32 -0
  530. package/out/wallet/keypair.js.map +1 -0
  531. package/out/wallet/mnemonic.d.ts +13 -0
  532. package/out/wallet/mnemonic.js +74 -0
  533. package/out/wallet/mnemonic.js.map +1 -0
  534. package/out/wallet/pem.d.ts +8 -0
  535. package/out/wallet/pem.js +60 -0
  536. package/out/wallet/pem.js.map +1 -0
  537. package/out/wallet/pemEntry.d.ts +10 -0
  538. package/out/wallet/pemEntry.js +73 -0
  539. package/out/wallet/pemEntry.js.map +1 -0
  540. package/out/wallet/userKeys.d.ts +23 -0
  541. package/out/wallet/userKeys.js +99 -0
  542. package/out/wallet/userKeys.js.map +1 -0
  543. package/out/wallet/userPem.d.ts +15 -0
  544. package/out/wallet/userPem.js +51 -0
  545. package/out/wallet/userPem.js.map +1 -0
  546. package/out/wallet/userSigner.d.ts +16 -0
  547. package/out/wallet/userSigner.js +41 -0
  548. package/out/wallet/userSigner.js.map +1 -0
  549. package/out/wallet/userVerifier.d.ts +18 -0
  550. package/out/wallet/userVerifier.js +27 -0
  551. package/out/wallet/userVerifier.js.map +1 -0
  552. package/out/wallet/userWallet.d.ts +54 -0
  553. package/out/wallet/userWallet.js +206 -0
  554. package/out/wallet/userWallet.js.map +1 -0
  555. package/out/wallet/validatorKeys.d.ts +26 -0
  556. package/out/wallet/validatorKeys.js +77 -0
  557. package/out/wallet/validatorKeys.js.map +1 -0
  558. package/out/wallet/validatorSigner.d.ts +10 -0
  559. package/out/wallet/validatorSigner.js +25 -0
  560. package/out/wallet/validatorSigner.js.map +1 -0
  561. package/package.json +84 -0
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionStatus = void 0;
4
+ /**
5
+ * An abstraction for handling and interpreting the "status" field of a transaction.
6
+ */
7
+ class TransactionStatus {
8
+ /**
9
+ * Creates a new TransactionStatus object.
10
+ */
11
+ constructor(status) {
12
+ this.status = (status || "").toLowerCase();
13
+ }
14
+ /**
15
+ * Creates an unknown status.
16
+ */
17
+ static createUnknown() {
18
+ return new TransactionStatus("unknown");
19
+ }
20
+ /**
21
+ * Returns whether the transaction is pending (e.g. in mempool).
22
+ */
23
+ isPending() {
24
+ return this.status == "received" || this.status == "pending";
25
+ }
26
+ /**
27
+ * Returns whether the transaction has been executed (not necessarily with success).
28
+ * @deprecated This will be remove next version, please use {@link isCompleted} instead.
29
+ */
30
+ isExecuted() {
31
+ return this.isSuccessful() || this.isFailed() || this.isInvalid();
32
+ }
33
+ /**
34
+ * Returns whether the transaction has been conpleted (not necessarily with success).
35
+ */
36
+ isCompleted() {
37
+ return this.isSuccessful() || this.isFailed() || this.isInvalid();
38
+ }
39
+ /**
40
+ * Returns whether the transaction has been executed successfully.
41
+ */
42
+ isSuccessful() {
43
+ return this.status == "executed" || this.status == "success" || this.status == "successful";
44
+ }
45
+ /**
46
+ * Returns whether the transaction has been executed, but with a failure.
47
+ */
48
+ isFailed() {
49
+ return this.status == "fail" || this.status == "failed" || this.status == "unsuccessful" || this.isInvalid();
50
+ }
51
+ /**
52
+ * Returns whether the transaction has been executed, but marked as invalid (e.g. due to "insufficient funds").
53
+ */
54
+ isInvalid() {
55
+ return this.status == "invalid";
56
+ }
57
+ toString() {
58
+ return this.status;
59
+ }
60
+ valueOf() {
61
+ return this.status;
62
+ }
63
+ equals(other) {
64
+ if (!other) {
65
+ return false;
66
+ }
67
+ return this.status == other.status;
68
+ }
69
+ }
70
+ exports.TransactionStatus = TransactionStatus;
71
+ //# sourceMappingURL=transactionStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactionStatus.js","sourceRoot":"","sources":["../../src/core/transactionStatus.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,iBAAiB;IAM1B;;OAEG;IACH,YAAY,MAAc;QACtB,IAAI,CAAC,MAAM,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC/C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa;QAChB,OAAO,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,SAAS;QACL,OAAO,IAAI,CAAC,MAAM,IAAI,UAAU,IAAI,IAAI,CAAC,MAAM,IAAI,SAAS,CAAC;IACjE,CAAC;IAED;;;OAGG;IACH,UAAU;QACN,OAAO,IAAI,CAAC,YAAY,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,WAAW;QACP,OAAO,IAAI,CAAC,YAAY,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,YAAY;QACR,OAAO,IAAI,CAAC,MAAM,IAAI,UAAU,IAAI,IAAI,CAAC,MAAM,IAAI,SAAS,IAAI,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC;IAChG,CAAC;IAED;;OAEG;IACH,QAAQ;QACJ,OAAO,IAAI,CAAC,MAAM,IAAI,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,QAAQ,IAAI,IAAI,CAAC,MAAM,IAAI,cAAc,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;IACjH,CAAC;IAED;;OAEG;IACH,SAAS;QACL,OAAO,IAAI,CAAC,MAAM,IAAI,SAAS,CAAC;IACpC,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,KAAwB;QAC3B,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC;IACvC,CAAC;CACJ;AA9ED,8CA8EC"}
@@ -0,0 +1,48 @@
1
+ import { Err } from "./errors";
2
+ import { ITransactionFetcher } from "./interfaces";
3
+ import { TransactionEvent } from "./transactionEvents";
4
+ import { TransactionOnNetwork } from "./transactionOnNetwork";
5
+ import { TransactionStatus } from "./transactionStatus";
6
+ export declare type PredicateIsAwaitedStatus = (status: TransactionStatus) => boolean;
7
+ /**
8
+ * TransactionWatcher allows one to continuously watch (monitor), by means of polling, the status of a given transaction.
9
+ */
10
+ export declare class TransactionWatcher {
11
+ private static DefaultPollingInterval;
12
+ private static DefaultTimeout;
13
+ private static DefaultPatience;
14
+ static NoopOnStatusReceived: (_: TransactionStatus) => void;
15
+ protected readonly fetcher: ITransactionFetcher;
16
+ protected readonly pollingIntervalMilliseconds: number;
17
+ protected readonly timeoutMilliseconds: number;
18
+ protected readonly patienceMilliseconds: number;
19
+ /**
20
+ * A transaction watcher (awaiter).
21
+ *
22
+ * @param fetcher The transaction fetcher
23
+ * @param options The options
24
+ * @param options.pollingIntervalMilliseconds The polling interval, in milliseconds
25
+ * @param options.timeoutMilliseconds The timeout, in milliseconds
26
+ * @param options.patienceMilliseconds The patience: an extra time (in milliseconds) to wait, after the transaction has reached its desired status. Currently there's a delay between the moment a transaction is marked as "completed" and the moment its outcome (contract results, events and logs) is available.
27
+ */
28
+ constructor(fetcher: ITransactionFetcher, options?: {
29
+ pollingIntervalMilliseconds?: number;
30
+ timeoutMilliseconds?: number;
31
+ patienceMilliseconds?: number;
32
+ });
33
+ /**
34
+ * Waits until the transaction reaches the "pending" status.
35
+ * @param txHash The hex-encoded transaction hash
36
+ */
37
+ awaitPending(txHash: string): Promise<TransactionOnNetwork>;
38
+ /**
39
+ * Waits until the transaction is completely processed.
40
+ * @param txHash The transaction hash
41
+ */
42
+ awaitCompleted(txHash: string): Promise<TransactionOnNetwork>;
43
+ awaitAllEvents(txHash: string, events: string[]): Promise<TransactionOnNetwork>;
44
+ awaitAnyEvent(txHash: string, events: string[]): Promise<TransactionOnNetwork>;
45
+ awaitOnCondition(txHash: string, condition: (data: TransactionOnNetwork) => boolean): Promise<TransactionOnNetwork>;
46
+ protected awaitConditionally<TData>(isSatisfied: (data: TData) => boolean, doFetch: () => Promise<TData>, createError: () => Err): Promise<TData>;
47
+ protected getAllTransactionEvents(transaction: TransactionOnNetwork): TransactionEvent[];
48
+ }
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionWatcher = void 0;
4
+ const asyncTimer_1 = require("./asyncTimer");
5
+ const errors_1 = require("./errors");
6
+ const logger_1 = require("./logger");
7
+ /**
8
+ * TransactionWatcher allows one to continuously watch (monitor), by means of polling, the status of a given transaction.
9
+ */
10
+ class TransactionWatcher {
11
+ /**
12
+ * A transaction watcher (awaiter).
13
+ *
14
+ * @param fetcher The transaction fetcher
15
+ * @param options The options
16
+ * @param options.pollingIntervalMilliseconds The polling interval, in milliseconds
17
+ * @param options.timeoutMilliseconds The timeout, in milliseconds
18
+ * @param options.patienceMilliseconds The patience: an extra time (in milliseconds) to wait, after the transaction has reached its desired status. Currently there's a delay between the moment a transaction is marked as "completed" and the moment its outcome (contract results, events and logs) is available.
19
+ */
20
+ constructor(fetcher, options = {}) {
21
+ this.fetcher = new TransactionFetcherWithTracing(fetcher);
22
+ this.pollingIntervalMilliseconds =
23
+ options.pollingIntervalMilliseconds || TransactionWatcher.DefaultPollingInterval;
24
+ this.timeoutMilliseconds = options.timeoutMilliseconds || TransactionWatcher.DefaultTimeout;
25
+ this.patienceMilliseconds = options.patienceMilliseconds || TransactionWatcher.DefaultPatience;
26
+ }
27
+ /**
28
+ * Waits until the transaction reaches the "pending" status.
29
+ * @param txHash The hex-encoded transaction hash
30
+ */
31
+ async awaitPending(txHash) {
32
+ const isPending = (transaction) => transaction.status.isPending();
33
+ const doFetch = async () => {
34
+ return await this.fetcher.getTransaction(txHash);
35
+ };
36
+ const errorProvider = () => new errors_1.ErrExpectedTransactionStatusNotReached();
37
+ return this.awaitConditionally(isPending, doFetch, errorProvider);
38
+ }
39
+ /**
40
+ * Waits until the transaction is completely processed.
41
+ * @param txHash The transaction hash
42
+ */
43
+ async awaitCompleted(txHash) {
44
+ const isCompleted = (transactionOnNetwork) => {
45
+ return transactionOnNetwork.status.isCompleted();
46
+ };
47
+ const doFetch = async () => {
48
+ return await this.fetcher.getTransaction(txHash);
49
+ };
50
+ const errorProvider = () => new errors_1.ErrExpectedTransactionStatusNotReached();
51
+ return this.awaitConditionally(isCompleted, doFetch, errorProvider);
52
+ }
53
+ async awaitAllEvents(txHash, events) {
54
+ const foundAllEvents = (transactionOnNetwork) => {
55
+ const allEventIdentifiers = this.getAllTransactionEvents(transactionOnNetwork).map((event) => event.identifier);
56
+ const allAreFound = events.every((event) => allEventIdentifiers.includes(event));
57
+ return allAreFound;
58
+ };
59
+ const doFetch = async () => {
60
+ return await this.fetcher.getTransaction(txHash);
61
+ };
62
+ const errorProvider = () => new errors_1.ErrExpectedTransactionEventsNotFound();
63
+ return this.awaitConditionally(foundAllEvents, doFetch, errorProvider);
64
+ }
65
+ async awaitAnyEvent(txHash, events) {
66
+ const foundAnyEvent = (transactionOnNetwork) => {
67
+ const allEventIdentifiers = this.getAllTransactionEvents(transactionOnNetwork).map((event) => event.identifier);
68
+ const anyIsFound = events.find((event) => allEventIdentifiers.includes(event)) != undefined;
69
+ return anyIsFound;
70
+ };
71
+ const doFetch = async () => {
72
+ return await this.fetcher.getTransaction(txHash);
73
+ };
74
+ const errorProvider = () => new errors_1.ErrExpectedTransactionEventsNotFound();
75
+ return this.awaitConditionally(foundAnyEvent, doFetch, errorProvider);
76
+ }
77
+ async awaitOnCondition(txHash, condition) {
78
+ const doFetch = async () => {
79
+ return await this.fetcher.getTransaction(txHash);
80
+ };
81
+ const errorProvider = () => new errors_1.ErrExpectedTransactionStatusNotReached();
82
+ return this.awaitConditionally(condition, doFetch, errorProvider);
83
+ }
84
+ async awaitConditionally(isSatisfied, doFetch, createError) {
85
+ const periodicTimer = new asyncTimer_1.AsyncTimer("watcher:periodic");
86
+ const patienceTimer = new asyncTimer_1.AsyncTimer("watcher:patience");
87
+ const timeoutTimer = new asyncTimer_1.AsyncTimer("watcher:timeout");
88
+ let stop = false;
89
+ let fetchedData = undefined;
90
+ let satisfied = false;
91
+ timeoutTimer.start(this.timeoutMilliseconds).finally(() => {
92
+ timeoutTimer.stop();
93
+ stop = true;
94
+ });
95
+ while (!stop) {
96
+ await periodicTimer.start(this.pollingIntervalMilliseconds);
97
+ try {
98
+ fetchedData = await doFetch();
99
+ satisfied = isSatisfied(fetchedData);
100
+ if (satisfied || stop) {
101
+ break;
102
+ }
103
+ }
104
+ catch (error) {
105
+ logger_1.Logger.debug("TransactionWatcher.awaitConditionally(): cannot (yet) fetch data.");
106
+ if (error instanceof errors_1.ErrIsCompletedFieldIsMissingOnTransaction) {
107
+ throw error;
108
+ }
109
+ if (!(error instanceof errors_1.Err)) {
110
+ throw error;
111
+ }
112
+ }
113
+ }
114
+ // The patience timer isn't subject to the timeout constraints.
115
+ if (satisfied) {
116
+ await patienceTimer.start(this.patienceMilliseconds);
117
+ }
118
+ if (!timeoutTimer.isStopped()) {
119
+ timeoutTimer.stop();
120
+ }
121
+ if (!fetchedData || !satisfied) {
122
+ throw createError();
123
+ }
124
+ return fetchedData;
125
+ }
126
+ getAllTransactionEvents(transaction) {
127
+ const result = [...transaction.logs.events];
128
+ for (const resultItem of transaction.smartContractResults) {
129
+ result.push(...resultItem.logs?.events);
130
+ }
131
+ return result;
132
+ }
133
+ }
134
+ exports.TransactionWatcher = TransactionWatcher;
135
+ TransactionWatcher.DefaultPollingInterval = 6000;
136
+ TransactionWatcher.DefaultTimeout = TransactionWatcher.DefaultPollingInterval * 15;
137
+ TransactionWatcher.DefaultPatience = 0;
138
+ TransactionWatcher.NoopOnStatusReceived = (_) => { };
139
+ class TransactionFetcherWithTracing {
140
+ constructor(fetcher) {
141
+ this.fetcher = fetcher;
142
+ }
143
+ async getTransaction(txHash) {
144
+ logger_1.Logger.debug(`transactionWatcher, getTransaction(${txHash})`);
145
+ return await this.fetcher.getTransaction(txHash);
146
+ }
147
+ }
148
+ //# sourceMappingURL=transactionWatcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactionWatcher.js","sourceRoot":"","sources":["../../src/core/transactionWatcher.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,qCAKkB;AAElB,qCAAkC;AAOlC;;GAEG;AACH,MAAa,kBAAkB;IAY3B;;;;;;;;OAQG;IACH,YACI,OAA4B,EAC5B,UAII,EAAE;QAEN,IAAI,CAAC,OAAO,GAAG,IAAI,6BAA6B,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,2BAA2B;Y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CAAC,cAAc,CAAC,MAAc;QAC/B,eAAM,CAAC,KAAK,CAAC,sCAAsC,MAAM,GAAG,CAAC,CAAC;QAC9D,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;CACJ"}
@@ -0,0 +1,54 @@
1
+ export declare class TransactionsFactoryConfig {
2
+ chainID: string;
3
+ addressHrp: string;
4
+ minGasLimit: bigint;
5
+ gasLimitPerByte: bigint;
6
+ gasLimitIssue: bigint;
7
+ gasLimitToggleBurnRoleGlobally: bigint;
8
+ gasLimitDcdtLocalMint: bigint;
9
+ gasLimitDcdtLocalBurn: bigint;
10
+ gasLimitSetSpecialRole: bigint;
11
+ gasLimitPausing: bigint;
12
+ gasLimitFreezing: bigint;
13
+ gasLimitWiping: bigint;
14
+ gasLimitDcdtNftCreate: bigint;
15
+ gasLimitDcdtNftUpdateAttributes: bigint;
16
+ gasLimitDcdtNftAddQuantity: bigint;
17
+ gasLimitDcdtNftBurn: bigint;
18
+ gasLimitStorePerByte: bigint;
19
+ issueCost: bigint;
20
+ gasLimitStake: bigint;
21
+ gasLimitUnstake: bigint;
22
+ gasLimitUnbond: bigint;
23
+ gasLimitCreateDelegationContract: bigint;
24
+ gasLimitDelegationOperations: bigint;
25
+ additionalGasLimitPerValidatorNode: bigint;
26
+ additionalGasLimitForDelegationOperations: bigint;
27
+ gasLimitDCDTTransfer: bigint;
28
+ gasLimitDCDTNFTTransfer: bigint;
29
+ gasLimitMultiDCDTNFTTransfer: bigint;
30
+ gasLimitSaveKeyValue: bigint;
31
+ gasLimitPersistPerByte: bigint;
32
+ gasLimitSetGuardian: bigint;
33
+ gasLimitGuardAccount: bigint;
34
+ gasLimitUnguardAccount: bigint;
35
+ gasLimitClaimDeveloperRewards: bigint;
36
+ gasLimitChangeOwnerAddress: bigint;
37
+ gasLimitDcdtModifyRoyalties: bigint;
38
+ gasLimitDcdtModifyCreator: bigint;
39
+ gasLimitDcdtMetadataUpdate: bigint;
40
+ gasLimitSetNewUris: bigint;
41
+ gasLimitNftMetadataRecreate: bigint;
42
+ gasLimitNftChangeToDynamic: bigint;
43
+ gasLimitUpdateTokenId: bigint;
44
+ gasLimitRegisterDynamic: bigint;
45
+ gasLimitForProposal: bigint;
46
+ gasLimitForVote: bigint;
47
+ gasLimitForClosingProposal: bigint;
48
+ gasLimitForClearProposals: bigint;
49
+ gasLimitForChangeConfig: bigint;
50
+ gasLimitForClaimAccumulatedFees: bigint;
51
+ constructor(options: {
52
+ chainID: string;
53
+ });
54
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionsFactoryConfig = void 0;
4
+ const config_1 = require("./config");
5
+ class TransactionsFactoryConfig {
6
+ constructor(options) {
7
+ // General-purpose configuration
8
+ this.chainID = options.chainID;
9
+ this.addressHrp = config_1.LibraryConfig.DefaultAddressHrp;
10
+ this.minGasLimit = 50000n;
11
+ this.gasLimitPerByte = 1500n;
12
+ // Configuration for token operations
13
+ this.gasLimitIssue = 60000000n;
14
+ this.gasLimitToggleBurnRoleGlobally = 60000000n;
15
+ this.gasLimitDcdtLocalMint = 300000n;
16
+ this.gasLimitDcdtLocalBurn = 300000n;
17
+ this.gasLimitSetSpecialRole = 60000000n;
18
+ this.gasLimitPausing = 60000000n;
19
+ this.gasLimitFreezing = 60000000n;
20
+ this.gasLimitWiping = 60000000n;
21
+ this.gasLimitDcdtNftCreate = 3000000n;
22
+ this.gasLimitDcdtNftUpdateAttributes = 50000n;
23
+ this.gasLimitDcdtNftAddQuantity = 50000n;
24
+ this.gasLimitDcdtNftBurn = 50000n;
25
+ this.gasLimitStorePerByte = 10000n;
26
+ this.issueCost = 50000000000000000n;
27
+ this.gasLimitDcdtModifyRoyalties = 60000000n;
28
+ this.gasLimitDcdtModifyCreator = 60000000n;
29
+ this.gasLimitDcdtMetadataUpdate = 60000000n;
30
+ this.gasLimitSetNewUris = 60000000n;
31
+ this.gasLimitNftMetadataRecreate = 60000000n;
32
+ this.gasLimitNftChangeToDynamic = 60000000n;
33
+ this.gasLimitUpdateTokenId = 60000000n;
34
+ this.gasLimitRegisterDynamic = 60000000n;
35
+ // Configuration for delegation operations
36
+ this.gasLimitStake = 5000000n;
37
+ this.gasLimitUnstake = 5000000n;
38
+ this.gasLimitUnbond = 5000000n;
39
+ this.gasLimitCreateDelegationContract = 50000000n;
40
+ this.gasLimitDelegationOperations = 1000000n;
41
+ this.additionalGasLimitPerValidatorNode = 6000000n;
42
+ this.additionalGasLimitForDelegationOperations = 10000000n;
43
+ // Configuration for account operations
44
+ this.gasLimitSaveKeyValue = 100000n;
45
+ this.gasLimitPersistPerByte = 1000n;
46
+ this.gasLimitSetGuardian = 250000n;
47
+ this.gasLimitGuardAccount = 250000n;
48
+ this.gasLimitUnguardAccount = 250000n;
49
+ // Configuration for token transfers
50
+ this.gasLimitDCDTTransfer = 200000n;
51
+ this.gasLimitDCDTNFTTransfer = 200000n;
52
+ this.gasLimitMultiDCDTNFTTransfer = 200000n;
53
+ // Configuration for smart contract operations
54
+ this.gasLimitClaimDeveloperRewards = 6000000n;
55
+ this.gasLimitChangeOwnerAddress = 6000000n;
56
+ // Configuration for governance operations
57
+ this.gasLimitForProposal = 50000000n;
58
+ this.gasLimitForVote = 5000000n;
59
+ this.gasLimitForClosingProposal = 50000000n;
60
+ this.gasLimitForClearProposals = 50000000n;
61
+ this.gasLimitForChangeConfig = 50000000n;
62
+ this.gasLimitForClaimAccumulatedFees = 1000000n;
63
+ }
64
+ }
65
+ exports.TransactionsFactoryConfig = TransactionsFactoryConfig;
66
+ //# sourceMappingURL=transactionsFactoryConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactionsFactoryConfig.js","sourceRoot":"","sources":["../../src/core/transactionsFactoryConfig.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AAEzC,MAAa,yBAAyB;IAmDlC,YAAY,OAA4B;QACpC,gCAAgC;QAChC,IAAI,CA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Q,CAAC;QAC9B,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;QAChC,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC;QAC/B,IAAI,CAAC,gCAAgC,GAAG,SAAS,CAAC;QAClD,IAAI,CAAC,4BAA4B,GAAG,QAAQ,CAAC;QAC7C,IAAI,CAAC,kCAAkC,GAAG,QAAQ,CAAC;QACnD,IAAI,CAAC,yCAAyC,GAAG,SAAS,CAAC;QAE3D,uCAAuC;QACvC,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC;QACpC,IAAI,CAAC,sBAAsB,GAAG,KAAK,CAAC;QACpC,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC;QACnC,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC;QACpC,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC;QAEtC,oCAAoC;QACpC,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC;QACpC,IAAI,CAAC,uBAAuB,GAAG,OAAO,CAAC;QACvC,IAAI,CAAC,4BAA4B,GAAG,OAAO,CAAC;QAE5C,8CAA8C;QAC9C,IAAI,CAAC,6BAA6B,GAAG,QAAQ,CAAC;QAC9C,IAAI,CAAC,0BAA0B,GAAG,QAAQ,CAAC;QAE3C,0CAA0C;QAC1C,IAAI,CAAC,mBAAmB,GAAG,SAAW,CAAC;QACvC,IAAI,CAAC,eAAe,GAAG,QAAU,CAAC;QAClC,IAAI,CAAC,0BAA0B,GAAG,SAAW,CAAC;QAC9C,IAAI,CAAC,yBAAyB,GAAG,SAAW,CAAC;QAC7C,IAAI,CAAC,uBAAuB,GAAG,SAAW,CAAC;QAC3C,IAAI,CAAC,+BAA+B,GAAG,QAAU,CAAC;IACtD,CAAC;CACJ;AAnHD,8DAmHC"}
@@ -0,0 +1,8 @@
1
+ import BigNumber from "bignumber.js";
2
+ export declare function numberToPaddedHex(value: bigint | number | BigNumber.Value): string;
3
+ export declare function isPaddedHex(input: string): boolean;
4
+ export declare function zeroPadStringIfOddLength(input: string): string;
5
+ export declare function utf8ToHex(value: string): string;
6
+ export declare function boolToHex(value: boolean): string;
7
+ export declare function byteArrayToHex(byteArray: Uint8Array): string;
8
+ export declare function bigIntToHex(value: BigNumber.Value): string;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.bigIntToHex = exports.byteArrayToHex = exports.boolToHex = exports.utf8ToHex = exports.zeroPadStringIfOddLength = exports.isPaddedHex = exports.numberToPaddedHex = void 0;
26
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
27
+ const contractsCodecUtils = __importStar(require("../abi/codec/utils"));
28
+ function numberToPaddedHex(value) {
29
+ let hexableNumber;
30
+ if (typeof value === "bigint" || typeof value === "number") {
31
+ hexableNumber = value;
32
+ }
33
+ else {
34
+ hexableNumber = new bignumber_js_1.default(value);
35
+ }
36
+ const hex = hexableNumber.toString(16);
37
+ return zeroPadStringIfOddLength(hex);
38
+ }
39
+ exports.numberToPaddedHex = numberToPaddedHex;
40
+ function isPaddedHex(input) {
41
+ input = input || "";
42
+ let decodedThenEncoded = Buffer.from(input, "hex").toString("hex");
43
+ return input.toUpperCase() == decodedThenEncoded.toUpperCase();
44
+ }
45
+ exports.isPaddedHex = isPaddedHex;
46
+ function zeroPadStringIfOddLength(input) {
47
+ input = input || "";
48
+ if (input.length % 2 == 1) {
49
+ return "0" + input;
50
+ }
51
+ return input;
52
+ }
53
+ exports.zeroPadStringIfOddLength = zeroPadStringIfOddLength;
54
+ function utf8ToHex(value) {
55
+ const hex = Buffer.from(value).toString("hex");
56
+ return zeroPadStringIfOddLength(hex);
57
+ }
58
+ exports.utf8ToHex = utf8ToHex;
59
+ function boolToHex(value) {
60
+ return utf8ToHex(value.toString());
61
+ }
62
+ exports.boolToHex = boolToHex;
63
+ function byteArrayToHex(byteArray) {
64
+ const hexString = Buffer.from(byteArray).toString("hex");
65
+ return zeroPadStringIfOddLength(hexString);
66
+ }
67
+ exports.byteArrayToHex = byteArrayToHex;
68
+ function bigIntToHex(value) {
69
+ if (value == 0) {
70
+ return "";
71
+ }
72
+ return contractsCodecUtils.getHexMagnitudeOfBigInt(value);
73
+ }
74
+ exports.bigIntToHex = bigIntToHex;
75
+ //# sourceMappingURL=utils.codec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.codec.js","sourceRoot":"","sources":["../../src/core/utils.codec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,wEAA0D;AAE1D,SAAgB,iBAAiB,CAAC,KAAwC;IACtE,IAAI,aAAmD,CAAC;IAExD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QACxD,aAAa,GAAG,KAAK,CAAC;KACzB;SAAM;QACH,aAAa,GAAG,IAAI,sBAAS,CAAC,KAAK,CAAC,CAAC;KACxC;IAED,MAAM,GAAG,GAAG,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC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CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAND,kCAMC"}
@@ -0,0 +1,20 @@
1
+ export declare function guardTrue(value: boolean, what: string): void;
2
+ export declare function guardValueIsSet(name: string, value?: any | null | undefined): void;
3
+ export declare function guardValueIsSetWithMessage(message: string, value?: any | null | undefined): void;
4
+ export declare function guardSameLength(a: any[], b: any[]): void;
5
+ export declare function guardLength(withLength: {
6
+ length?: number;
7
+ }, expectedLength: number): void;
8
+ export declare function guardNotEmpty(value: {
9
+ isEmpty?: () => boolean;
10
+ length?: number;
11
+ }, what: string): void;
12
+ export declare function guardEmpty(value: {
13
+ isEmpty?: () => boolean;
14
+ length?: number;
15
+ }, what: string): void;
16
+ export declare function isEmpty(value: {
17
+ isEmpty?: () => boolean;
18
+ length?: number;
19
+ }): boolean;
20
+ export declare function getAxios(): any;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.getAxios = exports.isEmpty = exports.guardEmpty = exports.guardNotEmpty = exports.guardLength = exports.guardSameLength = exports.guardValueIsSetWithMessage = exports.guardValueIsSet = exports.guardTrue = void 0;
23
+ const errors = __importStar(require("./errors"));
24
+ // TODO: Create a class called "Guard". Add the following as member functions.
25
+ function guardTrue(value, what) {
26
+ if (!value) {
27
+ throw new errors.ErrInvariantFailed(`[<${what}>] isn't true`);
28
+ }
29
+ }
30
+ exports.guardTrue = guardTrue;
31
+ // TODO: merge with guardValueIsSetWithMessage
32
+ function guardValueIsSet(name, value) {
33
+ guardValueIsSetWithMessage(`${name} isn't set (null or undefined)`, value);
34
+ }
35
+ exports.guardValueIsSet = guardValueIsSet;
36
+ // TODO: merge with guardValueIsSet
37
+ function guardValueIsSetWithMessage(message, value) {
38
+ if (value == null || value === undefined) {
39
+ throw new errors.ErrInvariantFailed(message);
40
+ }
41
+ }
42
+ exports.guardValueIsSetWithMessage = guardValueIsSetWithMessage;
43
+ function guardSameLength(a, b) {
44
+ a = a || [];
45
+ b = b || [];
46
+ if (a.length != b.length) {
47
+ throw new errors.ErrInvariantFailed("arrays do not have the same length");
48
+ }
49
+ }
50
+ exports.guardSameLength = guardSameLength;
51
+ function guardLength(withLength, expectedLength) {
52
+ let actualLength = withLength.length || 0;
53
+ if (actualLength != expectedLength) {
54
+ throw new errors.ErrInvariantFailed(`wrong length, expected: ${expectedLength}, actual: ${actualLength}`);
55
+ }
56
+ }
57
+ exports.guardLength = guardLength;
58
+ function guardNotEmpty(value, what) {
59
+ if (isEmpty(value)) {
60
+ throw new errors.ErrInvariantFailed(`${what} is empty`);
61
+ }
62
+ }
63
+ exports.guardNotEmpty = guardNotEmpty;
64
+ function guardEmpty(value, what) {
65
+ if (!isEmpty(value)) {
66
+ throw new errors.ErrInvariantFailed(`${what} is not empty`);
67
+ }
68
+ }
69
+ exports.guardEmpty = guardEmpty;
70
+ function isEmpty(value) {
71
+ if (value.isEmpty) {
72
+ return value.isEmpty();
73
+ }
74
+ return value.length === 0;
75
+ }
76
+ exports.isEmpty = isEmpty;
77
+ function getAxios() {
78
+ try {
79
+ return require("axios");
80
+ }
81
+ catch (error) {
82
+ throw new Error("axios is required but not installed. Please install axios to make network requests.");
83
+ }
84
+ }
85
+ exports.getAxios = getAxios;
86
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AAEnC,8EAA8E;AAE9E,SAAgB,SAAS,CAAC,KAAc,EAAE,IAAY;IAClD,IAAI,CAAC,KAAK,EAAE;QACR,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC,KAAK,IAAI,eAAe,CAAC,CAAC;KACjE;AACL,CAAC;AAJD,8BAIC;AAED,8CAA8C;AAC9C,SAAgB,eAAe,CAAC,IAAY,EAAE,KAA8B;IACxE,0BAA0B,CAAC,GAAG,IAAI,gCAAgC,EAAE,KAAK,CAAC,CAAC;AAC/E,CAAC;AAFD,0CAEC;AAED,mCAAmC;AACnC,SAAgB,0BAA0B,CAAC,OAAe,EAAE,KAA8B;IACtF,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACtC,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;KAChD;AACL,CAAC;AAJD,gEAIC;AAED,SAAgB,eAAe,CAAC,CAAQ,EAAE,CAAQ;IAC9C,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IACZ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAEZ,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,EAAE;QACtB,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC,oCAAoC,CAAC,CAAC;KAC7E;AACL,CAAC;AAPD,0CAOC;AAED,SAAgB,WAAW,CAAC,UAA+B,EAAE,cAAsB;IAC/E,IAAI,YAAY,GAAG,UAAU,CAAC,MAAM,IAAI,CAAC,CAAC;IAE1C,IAAI,YAAY,IAAI,cAAc,EAAE;QAChC,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC,2BAA2B,cAAc,aAAa,YAAY,EAAE,CAAC,CAAC;KAC7G;AACL,CAAC;AAND,kCAMC;AAED,SAAgB,aAAa,CAAC,KAAmD,EAAE,IAAY;IAC3F,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;QAChB,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC,GAAG,IAAI,WAAW,CAAC,CAAC;KAC3D;AACL,CAAC;AAJD,sCAIC;AAED,SAAgB,UAAU,CAAC,KAAmD,EAAE,IAAY;IACxF,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACjB,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC,GAAG,IAAI,eAAe,CAAC,CAAC;KAC/D;AACL,CAAC;AAJD,gCAIC;AAED,SAAgB,OAAO,CAAC,KAAmD;IACvE,IAAI,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;KAC1B;IAED,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;AAC9B,CAAC;AAND,0BAMC;AAED,SAAgB,QAAQ;IACpB,IAAI;QACA,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;KAC3B;IAAC,OAAO,KAAK,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,qFAAqF,CAAC,CAAC;KAC1G;AACL,CAAC;AAND,4BAMC"}
@@ -0,0 +1,37 @@
1
+ import { BaseController, BaseControllerInput, IAccount, Transaction, TransactionOnNetwork } from "../core";
2
+ import { INetworkProvider } from "../networkProviders/interface";
3
+ import * as resources from "./resources";
4
+ export declare class DelegationController extends BaseController {
5
+ private transactionAwaiter;
6
+ private factory;
7
+ private parser;
8
+ constructor(options: {
9
+ chainID: string;
10
+ networkProvider: INetworkProvider;
11
+ });
12
+ createTransactionForNewDelegationContract(sender: IAccount, nonce: bigint, options: resources.NewDelegationContractInput & BaseControllerInput): Promise<Transaction>;
13
+ awaitCompletedCreateNewDelegationContract(txHash: string): Promise<{
14
+ contractAddress: string;
15
+ }[]>;
16
+ parseCreateNewDelegationContract(transactionOnNetwork: TransactionOnNetwork): {
17
+ contractAddress: string;
18
+ }[];
19
+ createTransactionForAddingNodes(sender: IAccount, nonce: bigint, options: resources.AddNodesInput & BaseControllerInput): Promise<Transaction>;
20
+ createTransactionForRemovingNodes(sender: IAccount, nonce: bigint, options: resources.ManageNodesInput & BaseControllerInput): Promise<Transaction>;
21
+ createTransactionForStakingNodes(sender: IAccount, nonce: bigint, options: resources.ManageNodesInput & BaseControllerInput): Promise<Transaction>;
22
+ createTransactionForUnbondingNodes(sender: IAccount, nonce: bigint, options: resources.ManageNodesInput & BaseControllerInput): Promise<Transaction>;
23
+ createTransactionForUnstakingNodes(sender: IAccount, nonce: bigint, options: resources.ManageNodesInput & BaseControllerInput): Promise<Transaction>;
24
+ createTransactionForUnjailingNodes(sender: IAccount, nonce: bigint, options: resources.UnjailingNodesInput & BaseControllerInput): Promise<Transaction>;
25
+ createTransactionForChangingServiceFee(sender: IAccount, nonce: bigint, options: resources.ChangeServiceFee & BaseControllerInput): Promise<Transaction>;
26
+ createTransactionForModifyingDelegationCap(sender: IAccount, nonce: bigint, options: resources.ModifyDelegationCapInput & BaseControllerInput): Promise<Transaction>;
27
+ createTransactionForSettingAutomaticActivation(sender: IAccount, nonce: bigint, options: resources.ManageDelegationContractInput & BaseControllerInput): Promise<Transaction>;
28
+ createTransactionForUnsettingAutomaticActivation(sender: IAccount, nonce: bigint, options: resources.ManageDelegationContractInput & BaseControllerInput): Promise<Transaction>;
29
+ createTransactionForSettingCapCheckOnRedelegateRewards(sender: IAccount, nonce: bigint, options: resources.ManageDelegationContractInput & BaseControllerInput): Promise<Transaction>;
30
+ createTransactionForUnsettingCapCheckOnRedelegateRewards(sender: IAccount, nonce: bigint, options: resources.ManageDelegationContractInput & BaseControllerInput): Promise<Transaction>;
31
+ createTransactionForSettingMetadata(sender: IAccount, nonce: bigint, options: resources.SetContractMetadataInput & BaseControllerInput): Promise<Transaction>;
32
+ createTransactionForDelegating(sender: IAccount, nonce: bigint, options: resources.DelegateActionsInput & BaseControllerInput): Promise<Transaction>;
33
+ createTransactionForClaimingRewards(sender: IAccount, nonce: bigint, options: resources.ManageDelegationContractInput & BaseControllerInput): Promise<Transaction>;
34
+ createTransactionForRedelegatingRewards(sender: IAccount, nonce: bigint, options: resources.ManageDelegationContractInput & BaseControllerInput): Promise<Transaction>;
35
+ createTransactionForUndelegating(sender: IAccount, nonce: bigint, options: resources.DelegateActionsInput & BaseControllerInput): Promise<Transaction>;
36
+ createTransactionForWithdrawing(sender: IAccount, nonce: bigint, options: resources.ManageDelegationContractInput & BaseControllerInput): Promise<Transaction>;
37
+ }