@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,110 @@
1
+ import { Abi, EndpointDefinition, TypedValue } from "../abi";
2
+ import { TransactionsFactoryConfig } from "../core";
3
+ import { Address } from "../core/address";
4
+ import { Transaction } from "../core/transaction";
5
+ import * as resources from "./resources";
6
+ /**
7
+ * Use this class to create multisig related transactions like creating a new multisig contract,
8
+ * proposing actions, signing actions, and performing actions.
9
+ */
10
+ export declare class MultisigTransactionsFactory {
11
+ private readonly argSerializer;
12
+ private readonly smartContractFactory;
13
+ private readonly config;
14
+ private readonly abi;
15
+ constructor(options: {
16
+ config: TransactionsFactoryConfig;
17
+ abi: Abi;
18
+ });
19
+ /**
20
+ * Creates a transaction to deploy a new multisig contract
21
+ */
22
+ createTransactionForDeploy(sender: Address, options: resources.DeployMultisigContractInput): Transaction;
23
+ /**
24
+ * Proposes adding a new board member
25
+ */
26
+ createTransactionForProposeAddBoardMember(sender: Address, options: resources.ProposeAddBoardMemberInput): Transaction;
27
+ /**
28
+ * Proposes adding a new proposer
29
+ */
30
+ createTransactionForProposeAddProposer(sender: Address, options: resources.ProposeAddProposerInput): Transaction;
31
+ /**
32
+ * Proposes removing a user (board member or proposer)
33
+ */
34
+ createTransactionForProposeRemoveUser(sender: Address, options: resources.ProposeRemoveUserInput): Transaction;
35
+ /**
36
+ * Proposes changing the quorum (minimum signatures required)
37
+ */
38
+ createTransactionForProposeChangeQuorum(sender: Address, options: resources.ProposeChangeQuorumInput): Transaction;
39
+ /**
40
+ * Proposes a transaction that will transfer REWA and/or execute a function
41
+ */
42
+ createTransactionForProposeTransferExecute(sender: Address, options: resources.ProposeTransferExecuteInput): Transaction;
43
+ /**
44
+ * Proposes a transaction that will transfer REWA and/or execute a function
45
+ */
46
+ createTransactionForDeposit(sender: Address, options: resources.DepositExecuteInput): Transaction;
47
+ /**
48
+ * Proposes a transaction that will transfer DCDT tokens and/or execute a function
49
+ */
50
+ createTransactionForProposeTransferExecuteDcdt(sender: Address, options: resources.ProposeTransferExecuteDcdtInput): Transaction;
51
+ private mapTokenPayments;
52
+ /**
53
+ * Proposes an async call to another contract
54
+ */
55
+ createTransactionForProposeAsyncCall(sender: Address, options: resources.ProposeAsyncCallInput): Transaction;
56
+ /**
57
+ * Proposes deploying a smart contract from source
58
+ */
59
+ createTransactionForProposeContractDeployFromSource(sender: Address, options: resources.ProposeContractDeployFromSourceInput): Transaction;
60
+ /**
61
+ * Proposes upgrading a smart contract from source
62
+ */
63
+ createTransactionForProposeContractUpgradeFromSource(sender: Address, options: resources.ProposeContractUpgradeFromSourceInput): Transaction;
64
+ /**
65
+ * Signs an action (by a board member)
66
+ */
67
+ createTransactionForSignAction(sender: Address, options: resources.ActionInput): Transaction;
68
+ /**
69
+ * Signs all actions in a batch
70
+ */
71
+ createTransactionForSignBatch(sender: Address, options: resources.GroupInput): Transaction;
72
+ /**
73
+ * Signs and performs an action in one transaction
74
+ */
75
+ createTransactionForSignAndPerform(sender: Address, options: resources.ActionInput): Transaction;
76
+ /**
77
+ * Signs and performs all actions in a batch
78
+ */
79
+ createTransactionForSignBatchAndPerform(sender: Address, options: resources.GroupInput): Transaction;
80
+ /**
81
+ * Withdraws signature from an action
82
+ */
83
+ createTransactionForUnsign(sender: Address, options: resources.ActionInput): Transaction;
84
+ /**
85
+ * Withdraws signatures from all actions in a batch
86
+ */
87
+ createTransactionForUnsignBatch(sender: Address, options: resources.GroupInput): Transaction;
88
+ /**
89
+ * Removes signatures from outdated board members
90
+ */
91
+ createTransactionForUnsignForOutdatedBoardMembers(sender: Address, options: resources.UnsignForOutdatedBoardMembersInput): Transaction;
92
+ /**
93
+ * Performs an action that has reached quorum
94
+ */
95
+ createTransactionForPerformAction(sender: Address, options: resources.ActionInput): Transaction;
96
+ /**
97
+ * Performs all actions in a batch that have reached quorum
98
+ */
99
+ createTransactionForPerformBatch(sender: Address, options: resources.GroupInput): Transaction;
100
+ /**
101
+ * Discards an action that is no longer needed
102
+ */
103
+ createTransactionForDiscardAction(sender: Address, options: resources.ActionInput): Transaction;
104
+ /**
105
+ * Discards all actions in the provided list
106
+ */
107
+ createTransactionForDiscardBatch(sender: Address, options: resources.DiscardBatchInput): Transaction;
108
+ protected argsToTypedValues(args: any[], endpoint?: EndpointDefinition): TypedValue[];
109
+ private areArgsOfTypedValue;
110
+ }
@@ -0,0 +1,355 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MultisigTransactionsFactory = void 0;
4
+ const abi_1 = require("../abi");
5
+ const core_1 = require("../core");
6
+ const transactionBuilder_1 = require("../core/transactionBuilder");
7
+ const smartContracts_1 = require("../smartContracts");
8
+ const proposeTransferExecuteContractInput_1 = require("./proposeTransferExecuteContractInput");
9
+ /**
10
+ * Use this class to create multisig related transactions like creating a new multisig contract,
11
+ * proposing actions, signing actions, and performing actions.
12
+ */
13
+ class MultisigTransactionsFactory {
14
+ constructor(options) {
15
+ this.config = options.config;
16
+ this.abi = options.abi;
17
+ this.argSerializer = new abi_1.ArgSerializer();
18
+ this.smartContractFactory = new smartContracts_1.SmartContractTransactionsFactory(options);
19
+ }
20
+ /**
21
+ * Creates a transaction to deploy a new multisig contract
22
+ */
23
+ createTransactionForDeploy(sender, options) {
24
+ const boardAddresses = options.board.map((addr) => new abi_1.AddressValue(addr));
25
+ const args = [new abi_1.U32Value(options.quorum), abi_1.VariadicValue.fromItems(...boardAddresses)];
26
+ return this.smartContractFactory.createTransactionForDeploy(sender, {
27
+ bytecode: options.bytecode,
28
+ gasLimit: options.gasLimit,
29
+ isUpgradeable: options.isUpgradeable,
30
+ isReadable: options.isReadable,
31
+ isPayable: options.isPayable,
32
+ isPayableBySmartContract: options.isPayableBySmartContract,
33
+ arguments: args,
34
+ });
35
+ }
36
+ /**
37
+ * Proposes adding a new board member
38
+ */
39
+ createTransactionForProposeAddBoardMember(sender, options) {
40
+ return this.smartContractFactory.createTransactionForExecute(sender, {
41
+ contract: options.multisigContract,
42
+ function: "proposeAddBoardMember",
43
+ gasLimit: options.gasLimit,
44
+ arguments: [options.boardMember],
45
+ });
46
+ }
47
+ /**
48
+ * Proposes adding a new proposer
49
+ */
50
+ createTransactionForProposeAddProposer(sender, options) {
51
+ return this.smartContractFactory.createTransactionForExecute(sender, {
52
+ contract: options.multisigContract,
53
+ function: "proposeAddProposer",
54
+ gasLimit: options.gasLimit,
55
+ arguments: [options.proposer],
56
+ });
57
+ }
58
+ /**
59
+ * Proposes removing a user (board member or proposer)
60
+ */
61
+ createTransactionForProposeRemoveUser(sender, options) {
62
+ return this.smartContractFactory.createTransactionForExecute(sender, {
63
+ contract: options.multisigContract,
64
+ function: "proposeRemoveUser",
65
+ gasLimit: options.gasLimit,
66
+ arguments: [options.userAddress],
67
+ });
68
+ }
69
+ /**
70
+ * Proposes changing the quorum (minimum signatures required)
71
+ */
72
+ createTransactionForProposeChangeQuorum(sender, options) {
73
+ return this.smartContractFactory.createTransactionForExecute(sender, {
74
+ contract: options.multisigContract,
75
+ function: "proposeChangeQuorum",
76
+ gasLimit: options.gasLimit,
77
+ arguments: [options.newQuorum],
78
+ });
79
+ }
80
+ /**
81
+ * Proposes a transaction that will transfer REWA and/or execute a function
82
+ */
83
+ createTransactionForProposeTransferExecute(sender, options) {
84
+ const gasOption = options.optGasLimit ? new abi_1.U64Value(options.optGasLimit) : null;
85
+ let functionCall = [];
86
+ if (options.functionName) {
87
+ const input = proposeTransferExecuteContractInput_1.ProposeTransferExecuteContractInput.newFromTransferExecuteInput({
88
+ multisig: options.multisigContract,
89
+ to: options.to,
90
+ functionName: options.functionName,
91
+ arguments: options.functionArguments,
92
+ abi: options.abi,
93
+ });
94
+ functionCall = input.functionCall;
95
+ }
96
+ return this.smartContractFactory.createTransactionForExecute(sender, {
97
+ contract: options.multisigContract,
98
+ function: "proposeTransferExecute",
99
+ gasLimit: options.gasLimit,
100
+ arguments: [
101
+ new abi_1.AddressValue(options.to),
102
+ new abi_1.BigUIntValue(options.nativeTokenAmount),
103
+ new abi_1.OptionValue(new abi_1.OptionType(new abi_1.U64Type()), gasOption),
104
+ abi_1.VariadicValue.fromItems(...functionCall.map((value) => new abi_1.BytesValue(value))),
105
+ ],
106
+ });
107
+ }
108
+ /**
109
+ * Proposes a transaction that will transfer REWA and/or execute a function
110
+ */
111
+ createTransactionForDeposit(sender, options) {
112
+ return this.smartContractFactory.createTransactionForExecute(sender, {
113
+ contract: options.multisigContract,
114
+ function: "deposit",
115
+ gasLimit: options.gasLimit,
116
+ arguments: [],
117
+ nativeTransferAmount: options.nativeTokenAmount,
118
+ tokenTransfers: options.tokenTransfers,
119
+ });
120
+ }
121
+ /**
122
+ * Proposes a transaction that will transfer DCDT tokens and/or execute a function
123
+ */
124
+ createTransactionForProposeTransferExecuteDcdt(sender, options) {
125
+ const input = proposeTransferExecuteContractInput_1.ProposeTransferExecuteContractInput.newFromTransferExecuteInput({
126
+ multisig: options.multisigContract,
127
+ to: options.to,
128
+ functionName: options.functionName,
129
+ arguments: options.functionArguments,
130
+ abi: options.abi,
131
+ });
132
+ const tokenPayments = this.mapTokenPayments(options);
133
+ const dataParts = [
134
+ "proposeTransferExecuteDcdt",
135
+ ...this.argSerializer.valuesToStrings(abi_1.NativeSerializer.nativeToTypedValues([options.to, tokenPayments, options.optGasLimit, abi_1.VariadicValue.fromItems(...input.functionCall)], this.abi.getEndpoint("proposeTransferExecuteDcdt"))),
136
+ ];
137
+ return new transactionBuilder_1.TransactionBuilder({
138
+ config: this.config,
139
+ sender: sender,
140
+ receiver: options.multisigContract,
141
+ dataParts: dataParts,
142
+ gasLimit: options.gasLimit,
143
+ addDataMovementGas: false,
144
+ }).build();
145
+ }
146
+ mapTokenPayments(options) {
147
+ const tokenComputer = new core_1.TokenComputer();
148
+ const tokens = [];
149
+ for (const token of options.tokens) {
150
+ tokens.push({
151
+ token_identifier: tokenComputer.extractIdentifierFromExtendedIdentifier(token.token.identifier),
152
+ token_nonce: token.token.nonce,
153
+ amount: token.amount,
154
+ });
155
+ }
156
+ return tokens;
157
+ }
158
+ /**
159
+ * Proposes an async call to another contract
160
+ */
161
+ createTransactionForProposeAsyncCall(sender, options) {
162
+ const input = proposeTransferExecuteContractInput_1.ProposeTransferExecuteContractInput.newFromProposeAsyncCallInput({
163
+ multisig: options.multisigContract,
164
+ to: options.to,
165
+ tokenTransfers: options.tokenTransfers,
166
+ functionName: options.functionName,
167
+ arguments: options.functionArguments,
168
+ abi: options.abi,
169
+ });
170
+ return this.smartContractFactory.createTransactionForExecute(sender, {
171
+ contract: options.multisigContract,
172
+ function: "proposeAsyncCall",
173
+ gasLimit: options.gasLimit,
174
+ arguments: [
175
+ new abi_1.AddressValue(options.to),
176
+ new abi_1.BigUIntValue(options.nativeTransferAmount),
177
+ new abi_1.BigUIntValue(options.optGasLimit ?? 0n),
178
+ abi_1.VariadicValue.fromItems(...input.functionCall.map((value) => new abi_1.BytesValue(value))),
179
+ ],
180
+ });
181
+ }
182
+ /**
183
+ * Proposes deploying a smart contract from source
184
+ */
185
+ createTransactionForProposeContractDeployFromSource(sender, options) {
186
+ let args = this.argsToTypedValues(options.arguments, options.abi?.constructorDefinition);
187
+ return this.smartContractFactory.createTransactionForExecute(sender, {
188
+ contract: options.multisigContract,
189
+ function: "proposeSCDeployFromSource",
190
+ gasLimit: options.gasLimit,
191
+ arguments: [
192
+ new abi_1.BigUIntValue(options.amount),
193
+ new abi_1.AddressValue(options.multisigContract),
194
+ new abi_1.CodeMetadataValue(options.codeMetadata),
195
+ abi_1.VariadicValue.fromItems(...args),
196
+ ],
197
+ });
198
+ }
199
+ /**
200
+ * Proposes upgrading a smart contract from source
201
+ */
202
+ createTransactionForProposeContractUpgradeFromSource(sender, options) {
203
+ let args = this.argsToTypedValues(options.arguments, options.abi?.constructorDefinition);
204
+ return this.smartContractFactory.createTransactionForExecute(sender, {
205
+ contract: options.multisigContract,
206
+ function: "proposeSCUpgradeFromSource",
207
+ gasLimit: options.gasLimit,
208
+ arguments: [
209
+ new abi_1.AddressValue(options.multisigContract),
210
+ new abi_1.BigUIntValue(options.amount),
211
+ new abi_1.AddressValue(options.source),
212
+ new abi_1.CodeMetadataValue(options.codeMetadata),
213
+ abi_1.VariadicValue.fromItems(...args),
214
+ ],
215
+ });
216
+ }
217
+ /**
218
+ * Signs an action (by a board member)
219
+ */
220
+ createTransactionForSignAction(sender, options) {
221
+ return this.smartContractFactory.createTransactionForExecute(sender, {
222
+ contract: options.multisigContract,
223
+ function: "sign",
224
+ gasLimit: options.gasLimit,
225
+ arguments: [options.actionId],
226
+ });
227
+ }
228
+ /**
229
+ * Signs all actions in a batch
230
+ */
231
+ createTransactionForSignBatch(sender, options) {
232
+ return this.smartContractFactory.createTransactionForExecute(sender, {
233
+ contract: options.multisigContract,
234
+ function: "signBatch",
235
+ gasLimit: options.gasLimit,
236
+ arguments: [options.groupId],
237
+ });
238
+ }
239
+ /**
240
+ * Signs and performs an action in one transaction
241
+ */
242
+ createTransactionForSignAndPerform(sender, options) {
243
+ return this.smartContractFactory.createTransactionForExecute(sender, {
244
+ contract: options.multisigContract,
245
+ function: "signAndPerform",
246
+ gasLimit: options.gasLimit,
247
+ arguments: [options.actionId],
248
+ });
249
+ }
250
+ /**
251
+ * Signs and performs all actions in a batch
252
+ */
253
+ createTransactionForSignBatchAndPerform(sender, options) {
254
+ return this.smartContractFactory.createTransactionForExecute(sender, {
255
+ contract: options.multisigContract,
256
+ function: "signBatchAndPerform",
257
+ gasLimit: options.gasLimit,
258
+ arguments: [options.groupId],
259
+ });
260
+ }
261
+ /**
262
+ * Withdraws signature from an action
263
+ */
264
+ createTransactionForUnsign(sender, options) {
265
+ return this.smartContractFactory.createTransactionForExecute(sender, {
266
+ contract: options.multisigContract,
267
+ function: "unsign",
268
+ gasLimit: options.gasLimit,
269
+ arguments: [options.actionId],
270
+ });
271
+ }
272
+ /**
273
+ * Withdraws signatures from all actions in a batch
274
+ */
275
+ createTransactionForUnsignBatch(sender, options) {
276
+ return this.smartContractFactory.createTransactionForExecute(sender, {
277
+ contract: options.multisigContract,
278
+ function: "unsignBatch",
279
+ gasLimit: options.gasLimit,
280
+ arguments: [options.groupId],
281
+ });
282
+ }
283
+ /**
284
+ * Removes signatures from outdated board members
285
+ */
286
+ createTransactionForUnsignForOutdatedBoardMembers(sender, options) {
287
+ const outdatedBoardMembers = options.outdatedBoardMembers.map((id) => new abi_1.U32Value(id));
288
+ return this.smartContractFactory.createTransactionForExecute(sender, {
289
+ contract: options.multisigContract,
290
+ function: "unsignForOutdatedBoardMembers",
291
+ gasLimit: options.gasLimit,
292
+ arguments: [new abi_1.U32Value(options.actionId), abi_1.VariadicValue.fromItems(...outdatedBoardMembers)],
293
+ });
294
+ }
295
+ /**
296
+ * Performs an action that has reached quorum
297
+ */
298
+ createTransactionForPerformAction(sender, options) {
299
+ return this.smartContractFactory.createTransactionForExecute(sender, {
300
+ contract: options.multisigContract,
301
+ function: "performAction",
302
+ gasLimit: options.gasLimit,
303
+ arguments: [options.actionId],
304
+ });
305
+ }
306
+ /**
307
+ * Performs all actions in a batch that have reached quorum
308
+ */
309
+ createTransactionForPerformBatch(sender, options) {
310
+ return this.smartContractFactory.createTransactionForExecute(sender, {
311
+ contract: options.multisigContract,
312
+ function: "performBatch",
313
+ gasLimit: options.gasLimit,
314
+ arguments: [options.groupId],
315
+ });
316
+ }
317
+ /**
318
+ * Discards an action that is no longer needed
319
+ */
320
+ createTransactionForDiscardAction(sender, options) {
321
+ return this.smartContractFactory.createTransactionForExecute(sender, {
322
+ contract: options.multisigContract,
323
+ function: "discardAction",
324
+ gasLimit: options.gasLimit,
325
+ arguments: [options.actionId],
326
+ });
327
+ }
328
+ /**
329
+ * Discards all actions in the provided list
330
+ */
331
+ createTransactionForDiscardBatch(sender, options) {
332
+ const actionIdsArgs = options.actionIds.map((id) => new abi_1.U32Value(id));
333
+ return this.smartContractFactory.createTransactionForExecute(sender, {
334
+ contract: options.multisigContract,
335
+ function: "discardBatch",
336
+ gasLimit: options.gasLimit,
337
+ arguments: [abi_1.VariadicValue.fromItems(...actionIdsArgs)],
338
+ });
339
+ }
340
+ argsToTypedValues(args, endpoint) {
341
+ if (endpoint) {
342
+ const typedArgs = abi_1.NativeSerializer.nativeToTypedValues(args, endpoint);
343
+ return typedArgs;
344
+ }
345
+ if (this.areArgsOfTypedValue(args)) {
346
+ return args;
347
+ }
348
+ throw new core_1.Err("Can't convert args to TypedValues");
349
+ }
350
+ areArgsOfTypedValue(args) {
351
+ return args.every((arg) => abi_1.isTyped(arg));
352
+ }
353
+ }
354
+ exports.MultisigTransactionsFactory = MultisigTransactionsFactory;
355
+ //# sourceMappingURL=multisigTransactionsFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multisigTransactionsFactory.js","sourceRoot":"","sources":["../../src/multisig/multisigTransactionsFactory.ts"],"names":[],"mappings":";;;AAAA,gCAiBgB;AAChB,kCAAwE;AAGxE,mEAAgE;AAChE,sDAAqE;AACrE,+FAA4F;AAU5F;;;GAGG;AACH,MAAa,2BAA2B;IAMpC,YAAY,OAAwD;QAChE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,GAAG,GAAG,OA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AI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,aAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,CAAC;CACJ;AA/YD,kEA+YC"}
@@ -0,0 +1,31 @@
1
+ import { Abi } from "../abi";
2
+ import { Address, TransactionOnNetwork } from "../core";
3
+ import { SmartContractDeployOutcome } from "../smartContracts/resources";
4
+ /**
5
+ * Parses the outcome of multisig contract operations
6
+ */
7
+ export declare class MultisigTransactionsOutcomeParser {
8
+ private parser;
9
+ private readonly abi;
10
+ constructor(options: {
11
+ abi: Abi;
12
+ });
13
+ /**
14
+ * Parses the outcome of creating a new multisig contract
15
+ * @param transactionOnNetwork The completed transaction
16
+ * @returns An array of objects containing the new contract addresses
17
+ */
18
+ parseDeploy(transactionOnNetwork: TransactionOnNetwork): SmartContractDeployOutcome;
19
+ /**
20
+ * Parses the outcome of a multisig action proposal
21
+ * @param transactionOnNetwork The completed transaction
22
+ * @returns The action ID that was created
23
+ */
24
+ parseProposeAction(transactionOnNetwork: TransactionOnNetwork): number;
25
+ /**
26
+ * Parses the outcome of a multisig action proposal
27
+ * @param transactionOnNetwork The completed transaction
28
+ * @returns In case of scDeploy returns address else undefined
29
+ */
30
+ parsePerformAction(transactionOnNetwork: TransactionOnNetwork): Address | undefined;
31
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MultisigTransactionsOutcomeParser = void 0;
4
+ const transactionsOutcomeParsers_1 = require("../transactionsOutcomeParsers");
5
+ /**
6
+ * Parses the outcome of multisig contract operations
7
+ */
8
+ class MultisigTransactionsOutcomeParser {
9
+ constructor(options) {
10
+ this.abi = options?.abi;
11
+ this.parser = new transactionsOutcomeParsers_1.SmartContractTransactionsOutcomeParser({ abi: this.abi });
12
+ }
13
+ /**
14
+ * Parses the outcome of creating a new multisig contract
15
+ * @param transactionOnNetwork The completed transaction
16
+ * @returns An array of objects containing the new contract addresses
17
+ */
18
+ parseDeploy(transactionOnNetwork) {
19
+ return this.parser.parseDeploy({ transactionOnNetwork });
20
+ }
21
+ /**
22
+ * Parses the outcome of a multisig action proposal
23
+ * @param transactionOnNetwork The completed transaction
24
+ * @returns The action ID that was created
25
+ */
26
+ parseProposeAction(transactionOnNetwork) {
27
+ const result = this.parser.parseExecute({ transactionOnNetwork });
28
+ return result.values[0];
29
+ }
30
+ /**
31
+ * Parses the outcome of a multisig action proposal
32
+ * @param transactionOnNetwork The completed transaction
33
+ * @returns In case of scDeploy returns address else undefined
34
+ */
35
+ parsePerformAction(transactionOnNetwork) {
36
+ const result = this.parser.parseExecute({ transactionOnNetwork });
37
+ return result.values[0];
38
+ }
39
+ }
40
+ exports.MultisigTransactionsOutcomeParser = MultisigTransactionsOutcomeParser;
41
+ //# sourceMappingURL=multisigTransactionsOutcomeParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multisigTransactionsOutcomeParser.js","sourceRoot":"","sources":["../../src/multisig/multisigTransactionsOutcomeParser.ts"],"names":[],"mappings":";;;AAGA,8EAAuF;AAEvF;;GAEG;AACH,MAAa,iCAAiC;IAI1C,YAAY,OAAqB;QAC7B,IAAI,CAAC,GAAG,GAAG,OAAO,EAAE,GAAG,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,mEAAsC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,oBAA0C;QAClD,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,oBAA0C;QACzD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAC,CAAC;QAElE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,oBAA0C;QACzD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAC,CAAC;QAElE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;CACJ;AAvCD,8EAuCC"}
@@ -0,0 +1,32 @@
1
+ import { Abi } from "../abi";
2
+ import { Address, TokenTransfer } from "../core";
3
+ export declare class ProposeTransferExecuteContractInput {
4
+ multisigContract: Address;
5
+ to: Address;
6
+ gasLimit?: bigint;
7
+ functionCall: any[];
8
+ constructor(options: {
9
+ multisigContract: Address;
10
+ to: Address;
11
+ gasLimit?: bigint;
12
+ functionCall: any[];
13
+ });
14
+ static newFromTransferExecuteInput(options: {
15
+ multisig: Address;
16
+ to: Address;
17
+ functionName: string;
18
+ arguments?: any[];
19
+ optGasLimit?: bigint;
20
+ abi?: Abi;
21
+ }): ProposeTransferExecuteContractInput;
22
+ static newFromProposeAsyncCallInput(options: {
23
+ multisig: Address;
24
+ to: Address;
25
+ tokenTransfers: TokenTransfer[];
26
+ functionName: string;
27
+ arguments: any[];
28
+ optGasLimit?: bigint;
29
+ abi?: Abi;
30
+ }): ProposeTransferExecuteContractInput;
31
+ private static getFunctionCall;
32
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProposeTransferExecuteContractInput = void 0;
4
+ const abi_1 = require("../abi");
5
+ const core_1 = require("../core");
6
+ const constants_1 = require("../core/constants");
7
+ const utils_codec_1 = require("../core/utils.codec");
8
+ const smartContracts_1 = require("../smartContracts");
9
+ class ProposeTransferExecuteContractInput {
10
+ constructor(options) {
11
+ this.multisigContract = options.multisigContract;
12
+ this.to = options.to;
13
+ this.gasLimit = options.gasLimit;
14
+ this.functionCall = options.functionCall;
15
+ }
16
+ static newFromTransferExecuteInput(options) {
17
+ const transactionsFactory = new smartContracts_1.SmartContractTransactionsFactory({
18
+ config: new core_1.TransactionsFactoryConfig({ chainID: "" }),
19
+ abi: options.abi,
20
+ });
21
+ const transaction = transactionsFactory.createTransactionForExecute(core_1.Address.empty(), {
22
+ contract: core_1.Address.empty(),
23
+ function: options.functionName,
24
+ gasLimit: 0n,
25
+ arguments: options.arguments,
26
+ nativeTransferAmount: 0n,
27
+ });
28
+ const functionCall = ProposeTransferExecuteContractInput.getFunctionCall(transaction);
29
+ return new ProposeTransferExecuteContractInput({
30
+ multisigContract: options.multisig,
31
+ to: options.to,
32
+ functionCall: functionCall,
33
+ gasLimit: options.optGasLimit,
34
+ });
35
+ }
36
+ static newFromProposeAsyncCallInput(options) {
37
+ const transactionsFactory = new smartContracts_1.SmartContractTransactionsFactory({
38
+ config: new core_1.TransactionsFactoryConfig({ chainID: "" }),
39
+ abi: options.abi,
40
+ });
41
+ const transaction = transactionsFactory.createTransactionForExecute(core_1.Address.empty(), {
42
+ contract: core_1.Address.empty(),
43
+ function: options.functionName,
44
+ gasLimit: 0n,
45
+ arguments: options.arguments,
46
+ nativeTransferAmount: 0n,
47
+ });
48
+ const functionCall = ProposeTransferExecuteContractInput.getFunctionCall(transaction);
49
+ return new ProposeTransferExecuteContractInput({
50
+ multisigContract: options.multisig,
51
+ to: options.to,
52
+ functionCall: functionCall,
53
+ gasLimit: options.optGasLimit,
54
+ });
55
+ }
56
+ static getFunctionCall(transaction) {
57
+ const functionCallParts = Buffer.from(transaction.data).toString().split(constants_1.ARGUMENTS_SEPARATOR);
58
+ const functionName = functionCallParts[0];
59
+ const functionArguments = functionCallParts.slice(1).map((part) => part.valueOf());
60
+ const functionCall = [new abi_1.BytesValue(Buffer.from(utils_codec_1.utf8ToHex(functionName))), ...functionArguments];
61
+ return functionCall;
62
+ }
63
+ }
64
+ exports.ProposeTransferExecuteContractInput = ProposeTransferExecuteContractInput;
65
+ //# sourceMappingURL=proposeTransferExecuteContractInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proposeTransferExecuteCont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