@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,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeExpressionParser = void 0;
4
+ const typeFormulaParser_1 = require("../../abi/typeFormulaParser");
5
+ const errors_1 = require("../../core/errors");
6
+ const types_1 = require("./types");
7
+ class TypeExpressionParser {
8
+ constructor() {
9
+ this.backingTypeFormulaParser = new typeFormulaParser_1.TypeFormulaParser();
10
+ }
11
+ parse(expression) {
12
+ try {
13
+ return this.doParse(expression);
14
+ }
15
+ catch (e) {
16
+ throw new errors_1.ErrTypingSystem(`Failed to parse type expression: ${expression}. Error: ${e}`);
17
+ }
18
+ }
19
+ doParse(expression) {
20
+ const typeFormula = this.backingTypeFormulaParser.parseExpression(expression);
21
+ const type = this.typeFormulaToType(typeFormula);
22
+ return type;
23
+ }
24
+ typeFormulaToType(typeFormula) {
25
+ const typeParameters = typeFormula.typeParameters.map((typeFormula) => this.typeFormulaToType(typeFormula));
26
+ return new types_1.Type(typeFormula.name, typeParameters, undefined, typeFormula.metadata);
27
+ }
28
+ }
29
+ exports.TypeExpressionParser = TypeExpressionParser;
30
+ //# sourceMappingURL=typeExpressionParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeExpressionParser.js","sourceRoot":"","sources":["../../../src/abi/typesystem/typeExpressionParser.ts"],"names":[],"mappings":";;;AACA,mEAAgE;AAChE,8CAAoD;AACpD,mCAA+B;AAE/B,MAAa,oBAAoB;IAG7B;QACI,IAAI,CAAC,wBAAwB,GAAG,IAAI,qCAAiB,EAAE,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,UAAkB;QACpB,IAAI;YACA,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;SACnC;QAAC,OAAO,CAAC,EAAE;YACR,MAAM,IAAI,wBAAe,CAAC,oCAAoC,UAAU,YAAY,CAAC,EAAE,CAAC,CAAC;SAC5F;IACL,CAAC;IAEO,OAAO,CAAC,UAAkB;QAC9B,MAAM,WAAW,GAAG,IAAI,CAAC,wBAAwB,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QAC9E,MAAM,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEO,iBAAiB,CAAC,WAAwB;QAC9C,MAAM,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;QAC5G,OAAO,IAAI,YAAI,CAAC,WAAW,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IACvF,CAAC;CACJ;AAzBD,oDAyBC"}
@@ -0,0 +1,20 @@
1
+ import { CustomType, Type } from "./types";
2
+ export declare class TypeMapper {
3
+ private readonly openTypesFactories;
4
+ private readonly closedTypesMap;
5
+ private readonly learnedTypesMap;
6
+ constructor(learnedTypes?: CustomType[]);
7
+ /**
8
+ * Maps a "raw type" object to a "known (specific) type" object.
9
+ * In the process, it also learns the new type.
10
+ * Can only map types if their dependencies were previously learned (through mapping).
11
+ */
12
+ mapType(type: Type): Type;
13
+ private mapTypeRecursively;
14
+ private learnType;
15
+ private mapStructType;
16
+ private mapEnumType;
17
+ private mapExplicitEnumType;
18
+ private mappedFields;
19
+ private mapGenericType;
20
+ }
@@ -0,0 +1,215 @@
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.TypeMapper = void 0;
23
+ const errors = __importStar(require("../../core/errors"));
24
+ const address_1 = require("./address");
25
+ const algebraic_1 = require("./algebraic");
26
+ const boolean_1 = require("./boolean");
27
+ const bytes_1 = require("./bytes");
28
+ const codeMetadata_1 = require("./codeMetadata");
29
+ const composite_1 = require("./composite");
30
+ const enum_1 = require("./enum");
31
+ const explicit_enum_1 = require("./explicit-enum");
32
+ const fields_1 = require("./fields");
33
+ const generic_1 = require("./generic");
34
+ const genericArray_1 = require("./genericArray");
35
+ const h256_1 = require("./h256");
36
+ const managedDecimal_1 = require("./managedDecimal");
37
+ const managedDecimalSigned_1 = require("./managedDecimalSigned");
38
+ const nothing_1 = require("./nothing");
39
+ const numerical_1 = require("./numerical");
40
+ const string_1 = require("./string");
41
+ const struct_1 = require("./struct");
42
+ const tokenIdentifier_1 = require("./tokenIdentifier");
43
+ const tuple_1 = require("./tuple");
44
+ const variadic_1 = require("./variadic");
45
+ class TypeMapper {
46
+ constructor(learnedTypes = []) {
47
+ this.openTypesFactories = new Map([
48
+ ["Option", (...typeParameters) => new generic_1.OptionType(typeParameters[0])],
49
+ ["List", (...typeParameters) => new generic_1.ListType(typeParameters[0])],
50
+ // For the following open generics, we use a slightly different typing than the one defined by drt-rs-sdk (temporary workaround).
51
+ ["VarArgs", (...typeParameters) => new variadic_1.VariadicType(typeParameters[0])],
52
+ ["MultiResultVec", (...typeParameters) => new variadic_1.VariadicType(typeParameters[0])],
53
+ ["variadic", (...typeParameters) => new variadic_1.VariadicType(typeParameters[0])],
54
+ ["counted-variadic", (...typeParameters) => new variadic_1.VariadicType(typeParameters[0], true)],
55
+ ["OptionalArg", (...typeParameters) => new algebraic_1.OptionalType(typeParameters[0])],
56
+ ["optional", (...typeParameters) => new algebraic_1.OptionalType(typeParameters[0])],
57
+ ["OptionalResult", (...typeParameters) => new algebraic_1.OptionalType(typeParameters[0])],
58
+ ["multi", (...typeParameters) => new composite_1.CompositeType(...typeParameters)],
59
+ ["MultiArg", (...typeParameters) => new composite_1.CompositeType(...typeParameters)],
60
+ ["MultiResult", (...typeParameters) => new composite_1.CompositeType(...typeParameters)],
61
+ ["multi", (...typeParameters) => new composite_1.CompositeType(...typeParameters)],
62
+ // Perhaps we can adjust the ABI generator to only output "tuple", instead of "tupleN"?
63
+ ["tuple", (...typeParameters) => new tuple_1.TupleType(...typeParameters)],
64
+ ["tuple2", (...typeParameters) => new tuple_1.TupleType(...typeParameters)],
65
+ ["tuple3", (...typeParameters) => new tuple_1.TupleType(...typeParameters)],
66
+ ["tuple4", (...typeParameters) => new tuple_1.TupleType(...typeParameters)],
67
+ ["tuple5", (...typeParameters) => new tuple_1.TupleType(...typeParameters)],
68
+ ["tuple6", (...typeParameters) => new tuple_1.TupleType(...typeParameters)],
69
+ ["tuple7", (...typeParameters) => new tuple_1.TupleType(...typeParameters)],
70
+ ["tuple8", (...typeParameters) => new tuple_1.TupleType(...typeParameters)],
71
+ // Known-length arrays.
72
+ // TODO: Handle these in typeExpressionParser!
73
+ ["array2", (...typeParameters) => new genericArray_1.ArrayVecType(2, typeParameters[0])],
74
+ ["array6", (...typeParameters) => new genericArray_1.ArrayVecType(6, typeParameters[0])],
75
+ ["array8", (...typeParameters) => new genericArray_1.ArrayVecType(8, typeParameters[0])],
76
+ ["array16", (...typeParameters) => new genericArray_1.ArrayVecType(16, typeParameters[0])],
77
+ ["array20", (...typeParameters) => new genericArray_1.ArrayVecType(20, typeParameters[0])],
78
+ ["array32", (...typeParameters) => new genericArray_1.ArrayVecType(32, typeParameters[0])],
79
+ ["array46", (...typeParameters) => new genericArray_1.ArrayVecType(46, typeParameters[0])],
80
+ ["array48", (...typeParameters) => new genericArray_1.ArrayVecType(48, typeParameters[0])],
81
+ ["array64", (...typeParameters) => new genericArray_1.ArrayVecType(64, typeParameters[0])],
82
+ ["array128", (...typeParameters) => new genericArray_1.ArrayVecType(128, typeParameters[0])],
83
+ ["array256", (...typeParameters) => new genericArray_1.ArrayVecType(256, typeParameters[0])],
84
+ ["ManagedDecimal", (...metadata) => new managedDecimal_1.ManagedDecimalType(metadata)],
85
+ ["ManagedDecimalSigned", (...metadata) => new managedDecimalSigned_1.ManagedDecimalSignedType(metadata)],
86
+ ]);
87
+ // For closed types, we hold actual type instances instead of type constructors / factories (no type parameters needed).
88
+ this.closedTypesMap = new Map([
89
+ ["u8", new numerical_1.U8Type()],
90
+ ["u16", new numerical_1.U16Type()],
91
+ ["u32", new numerical_1.U32Type()],
92
+ ["u64", new numerical_1.U64Type()],
93
+ ["U64", new numerical_1.U64Type()],
94
+ ["BigUint", new numerical_1.BigUIntType()],
95
+ ["i8", new numerical_1.I8Type()],
96
+ ["i16", new numerical_1.I16Type()],
97
+ ["i32", new numerical_1.I32Type()],
98
+ ["i64", new numerical_1.I64Type()],
99
+ ["Bigint", new numerical_1.BigIntType()],
100
+ ["BigInt", new numerical_1.BigIntType()],
101
+ ["bool", new boolean_1.BooleanType()],
102
+ ["bytes", new bytes_1.BytesType()],
103
+ ["Address", new address_1.AddressType()],
104
+ ["H256", new h256_1.H256Type()],
105
+ ["utf-8 string", new string_1.StringType()],
106
+ ["TokenIdentifier", new tokenIdentifier_1.TokenIdentifierType()],
107
+ ["RewaOrDcdtTokenIdentifier", new tokenIdentifier_1.TokenIdentifierType()],
108
+ ["CodeMetadata", new codeMetadata_1.CodeMetadataType()],
109
+ ["nothing", new nothing_1.NothingType()],
110
+ ["AsyncCall", new nothing_1.NothingType()],
111
+ ]);
112
+ this.learnedTypesMap = new Map();
113
+ // Boostrap from previously learned types, if any.
114
+ for (const type of learnedTypes) {
115
+ if (type.getName() === "ManagedDecimal" || type.getName() === "ManagedDecimalSigned") {
116
+ this.learnedTypesMap.set(`${type.getName()}_${type.getMetadata()}`, type);
117
+ }
118
+ else {
119
+ this.learnedTypesMap.set(type.getName(), type);
120
+ }
121
+ }
122
+ }
123
+ /**
124
+ * Maps a "raw type" object to a "known (specific) type" object.
125
+ * In the process, it also learns the new type.
126
+ * Can only map types if their dependencies were previously learned (through mapping).
127
+ */
128
+ mapType(type) {
129
+ let mappedType = this.mapTypeRecursively(type);
130
+ if (mappedType) {
131
+ // We do not learn generic types (that also have type parameters),
132
+ // we only learn closed, non-generic types.
133
+ // Reason: in the ABI, generic types are unnamed.
134
+ // E.g.: two occurrences of List<Foobar> aren't recognized as a single type (simplification).
135
+ if (!mappedType.isGenericType()) {
136
+ this.learnType(mappedType);
137
+ }
138
+ return mappedType;
139
+ }
140
+ throw new errors.ErrTypingSystem(`Cannot map the type "${type.getName()}" to a known type`);
141
+ }
142
+ mapTypeRecursively(type) {
143
+ let isGeneric = type.isGenericType();
144
+ let hasMetadata = type.hasMetadata();
145
+ let previouslyLearnedType = this.learnedTypesMap.get(type.getName());
146
+ if (previouslyLearnedType) {
147
+ return previouslyLearnedType;
148
+ }
149
+ let knownClosedType = this.closedTypesMap.get(type.getName());
150
+ if (knownClosedType) {
151
+ return knownClosedType;
152
+ }
153
+ if (type.hasExactClass(enum_1.EnumType.ClassName)) {
154
+ // This will call mapType() recursively, for all the enum variant fields.
155
+ return this.mapEnumType(type);
156
+ }
157
+ if (type.hasExactClass(explicit_enum_1.ExplicitEnumType.ClassName)) {
158
+ // This will call mapType() recursively, for all the explicit enum variant fields.
159
+ return this.mapExplicitEnumType(type);
160
+ }
161
+ if (type.hasExactClass(struct_1.StructType.ClassName)) {
162
+ // This will call mapType() recursively, for all the struct's fields.
163
+ return this.mapStructType(type);
164
+ }
165
+ if (isGeneric || hasMetadata) {
166
+ // This will call mapType() recursively, for all the type parameters.
167
+ return this.mapGenericType(type);
168
+ }
169
+ return null;
170
+ }
171
+ learnType(type) {
172
+ if (type.getName() === "ManagedDecimal" || type.getName() === "ManagedDecimalSigned") {
173
+ const learnedTypeKey = `${type.getName()}_${type.getMetadata()}`;
174
+ this.learnedTypesMap.delete(learnedTypeKey);
175
+ this.learnedTypesMap.set(learnedTypeKey, type);
176
+ }
177
+ else {
178
+ const learnedTypeKey = type.getName();
179
+ this.learnedTypesMap.delete(learnedTypeKey);
180
+ this.learnedTypesMap.set(learnedTypeKey, type);
181
+ }
182
+ }
183
+ mapStructType(type) {
184
+ let mappedFields = this.mappedFields(type.getFieldsDefinitions());
185
+ let mappedStruct = new struct_1.StructType(type.getName(), mappedFields);
186
+ return mappedStruct;
187
+ }
188
+ mapEnumType(type) {
189
+ let variants = type.variants.map((variant) => new enum_1.EnumVariantDefinition(variant.name, variant.discriminant, this.mappedFields(variant.getFieldsDefinitions())));
190
+ let mappedEnum = new enum_1.EnumType(type.getName(), variants);
191
+ return mappedEnum;
192
+ }
193
+ mapExplicitEnumType(type) {
194
+ let variants = type.variants.map((variant) => new explicit_enum_1.ExplicitEnumVariantDefinition(variant.name));
195
+ let mappedEnum = new explicit_enum_1.ExplicitEnumType(type.getName(), variants);
196
+ return mappedEnum;
197
+ }
198
+ mappedFields(definitions) {
199
+ return definitions.map((definition) => new fields_1.FieldDefinition(definition.name, definition.description, this.mapType(definition.type)));
200
+ }
201
+ mapGenericType(type) {
202
+ let typeParameters = type.getTypeParameters();
203
+ let mappedTypeParameters = typeParameters.map((item) => this.mapType(item));
204
+ let factory = this.openTypesFactories.get(type.getName());
205
+ if (!factory) {
206
+ throw new errors.ErrTypingSystem(`Cannot map the generic type "${type.getName()}" to a known type`);
207
+ }
208
+ if (type.hasMetadata()) {
209
+ return factory(type.getMetadata());
210
+ }
211
+ return factory(...mappedTypeParameters);
212
+ }
213
+ }
214
+ exports.TypeMapper = TypeMapper;
215
+ //# sourceMappingURL=typeMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeMapper.js","sourceRoot":"","sources":["../../../src/abi/typesystem/typeMapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAC5C,uCAAwC;AACxC,2CAA2C;AAC3C,uCAAwC;AACxC,mCAAoC;AACpC,iDAAkD;AAClD,2CAA4C;AAC5C,iCAAyD;AACzD,mDAAkF;AAClF,qCAA2C;AAC3C,uCAAiD;AACjD,iDAA8C;AAC9C,iCAAkC;AAClC,qDAAsD;AACtD,iEAAkE;AAClE,uCAAwC;AACxC,2CAWqB;AACrB,qCAAsC;AACtC,qCAAsC;AACtC,uDAAwD;AACxD,mCAAoC;AAEpC,yCAA0C;AAK1C,MAAa,UAAU;IAKnB,YAAY,eAA6B,EAAE;QACvC,IAAI,CAAC,kBAAkB,GAAG,IAAI,GAAG,CAAgD;YAC7E,CAAC,QAAQ,EAAE,CAAC,GAAG,cAAsB,EAAE,EAAE,CAAC,IAAI,oBAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5E,CAAC,MAAM,EAAE,CAAC,GAAG,cAAsB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C,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAC9G,CAAC;IACN,CAAC;IAEO,cAAc,CAAC,IAAU;QAC7B,IAAI,cAAc,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC9C,IAAI,oBAAoB,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAE5E,IAAI,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1D,IAAI,CAAC,OAAO,EAAE;YACV,MAAM,IAAI,MAAM,CAAC,eAAe,CAAC,gCAAgC,IAAI,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;SACvG;QACD,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;YACpB,OAAO,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;SACtC;QAED,OAAO,OAAO,CAAC,GAAG,oBAAoB,CAAC,CAAC;IAC5C,CAAC;CACJ;AAzMD,gCAyMC"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * An abstraction that represents a Type. Handles both generic and non-generic types.
3
+ * Once instantiated as a Type, a generic type is "closed" (as opposed to "open").
4
+ */
5
+ export declare class Type {
6
+ static ClassName: string;
7
+ private readonly name;
8
+ private readonly typeParameters;
9
+ private readonly cardinality;
10
+ protected readonly metadata: any;
11
+ constructor(name: string, typeParameters?: Type[], cardinality?: TypeCardinality, metadata?: any);
12
+ getName(): string;
13
+ getClassName(): string;
14
+ getClassHierarchy(): string[];
15
+ /**
16
+ * Gets the fully qualified name of the type, to allow for better (efficient and non-ambiguous) type comparison within the custom typesystem.
17
+ */
18
+ getFullyQualifiedName(): string;
19
+ private getFullNameForGeneric;
20
+ hasExactClass(className: string): boolean;
21
+ hasClassOrSuperclass(className: string): boolean;
22
+ getTypeParameters(): Type[];
23
+ getMetadata(): any;
24
+ isGenericType(): boolean;
25
+ hasMetadata(): boolean;
26
+ getFirstTypeParameter(): Type;
27
+ /**
28
+ * Generates type expressions similar to drt-rs-sdk.
29
+ */
30
+ toString(): string;
31
+ equals(other: Type): boolean;
32
+ static equals(a: Type, b: Type): boolean;
33
+ static equalsMany(a: Type[], b: Type[]): boolean;
34
+ static isAssignableFromMany(a: Type[], b: Type[]): boolean;
35
+ differs(other: Type): boolean;
36
+ valueOf(): string;
37
+ /**
38
+ * Inspired from: https://docs.microsoft.com/en-us/dotnet/api/system.type.isassignablefrom
39
+ * For (most) generics, type invariance is expected (assumed) - neither covariance, nor contravariance are supported yet (will be supported in a next release).
40
+ *
41
+ * One exception though: for {@link OptionType}, we simulate covariance for missing (not provided) values.
42
+ * For example, Option<u32> is assignable from Option<?>.
43
+ * For more details, see the implementation of {@link OptionType} and @{@link OptionalType}.
44
+ *
45
+ * Also see:
46
+ * - https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)
47
+ * - https://docs.microsoft.com/en-us/dotnet/standard/generics/covariance-and-contravariance
48
+ */
49
+ isAssignableFrom(other: Type): boolean;
50
+ private static getFullyQualifiedNamesInHierarchy;
51
+ getNamesOfDependencies(): string[];
52
+ /**
53
+ * Converts the account to a pretty, plain JavaScript object.
54
+ */
55
+ toJSON(): any;
56
+ getCardinality(): TypeCardinality;
57
+ /**
58
+ * A special marker for types within the custom typesystem.
59
+ */
60
+ belongsToTypesystem(): void;
61
+ }
62
+ /**
63
+ * TODO: Simplify this class, keep only what is needed.
64
+ *
65
+ * An abstraction for defining and operating with the cardinality of a (composite or simple) type.
66
+ *
67
+ * Simple types (the ones that are directly encodable) have a fixed cardinality: [lower = 1, upper = 1].
68
+ * Composite types (not directly encodable) do not follow this constraint. For example:
69
+ * - VarArgs: [lower = 0, upper = *]
70
+ * - OptionalResult: [lower = 0, upper = 1]
71
+ */
72
+ export declare class TypeCardinality {
73
+ /**
74
+ * An arbitrarily chosen, reasonably large number.
75
+ */
76
+ private static MaxCardinality;
77
+ private readonly lowerBound;
78
+ private readonly upperBound?;
79
+ private constructor();
80
+ static fixed(value: number): TypeCardinality;
81
+ static variable(value?: number): TypeCardinality;
82
+ isSingular(): boolean;
83
+ isSingularOrNone(): boolean;
84
+ isComposite(): boolean;
85
+ isFixed(): boolean;
86
+ getLowerBound(): number;
87
+ getUpperBound(): number;
88
+ }
89
+ export declare class PrimitiveType extends Type {
90
+ static ClassName: string;
91
+ constructor(name: string);
92
+ getClassName(): string;
93
+ }
94
+ export declare abstract class CustomType extends Type {
95
+ static ClassName: string;
96
+ getClassName(): string;
97
+ }
98
+ export declare abstract class TypedValue {
99
+ static ClassName: string;
100
+ private readonly type;
101
+ constructor(type: Type);
102
+ getClassName(): string;
103
+ getClassHierarchy(): string[];
104
+ getType(): Type;
105
+ abstract equals(other: any): boolean;
106
+ abstract valueOf(): any;
107
+ hasExactClass(className: string): boolean;
108
+ hasClassOrSuperclass(className: string): boolean;
109
+ /**
110
+ * A special marker for values within the custom typesystem.
111
+ */
112
+ belongsToTypesystem(): void;
113
+ }
114
+ export declare abstract class PrimitiveValue extends TypedValue {
115
+ static ClassName: string;
116
+ constructor(type: Type);
117
+ getClassName(): string;
118
+ }
119
+ export declare function isTyped(value: any): boolean;
120
+ export declare class TypePlaceholder extends Type {
121
+ static ClassName: string;
122
+ constructor();
123
+ getClassName(): string;
124
+ }
125
+ export declare class NullType extends Type {
126
+ static ClassName: string;
127
+ constructor();
128
+ getClassName(): string;
129
+ }