@multiversx/sdk-dapp 5.0.0-alpha.2 → 5.0.0-alpha.4

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 (248) hide show
  1. package/README.md +223 -74
  2. package/out/__chunks__/{chunk-DHLQNKB7.mjs → chunk-46WBKAT4.mjs} +2 -2
  3. package/out/__chunks__/{chunk-HOVFLZIM.mjs → chunk-4NMRZJSQ.mjs} +2 -2
  4. package/out/__chunks__/{chunk-C3KLB5TA.mjs → chunk-4OO7HE5Q.mjs} +1 -1
  5. package/out/__chunks__/{chunk-C3KLB5TA.mjs.map → chunk-4OO7HE5Q.mjs.map} +1 -1
  6. package/out/__chunks__/chunk-55SACSMS.mjs +2 -0
  7. package/out/__chunks__/chunk-55SACSMS.mjs.map +7 -0
  8. package/out/__chunks__/{chunk-42SCXW2U.mjs → chunk-67X3ORNS.mjs} +2 -2
  9. package/out/__chunks__/{chunk-SY63TM6N.mjs → chunk-773UPGVZ.mjs} +2 -2
  10. package/out/__chunks__/{chunk-XS3SFPZ6.mjs → chunk-CRSZQV7V.mjs} +2 -2
  11. package/out/__chunks__/{chunk-IGUBISXF.mjs → chunk-DELLFT6H.mjs} +2 -2
  12. package/out/__chunks__/{chunk-NCUYIZYI.mjs → chunk-DGXP3AZR.mjs} +2 -2
  13. package/out/__chunks__/chunk-EOCZROR3.mjs +2 -0
  14. package/out/__chunks__/chunk-GDSFFLIR.mjs +2 -0
  15. package/out/__chunks__/{chunk-SM5IXWZT.mjs → chunk-HNEBEFTL.mjs} +2 -2
  16. package/out/__chunks__/{chunk-6GNOK3TJ.mjs → chunk-HTPPS2MF.mjs} +1 -1
  17. package/out/__chunks__/chunk-HTPPS2MF.mjs.map +7 -0
  18. package/out/__chunks__/{chunk-YRLMECJT.mjs → chunk-HWH2SKSH.mjs} +2 -2
  19. package/out/__chunks__/{chunk-PVTRVIAK.mjs → chunk-IJX53ZJI.mjs} +2 -2
  20. package/out/__chunks__/{chunk-YVVDA6LN.mjs → chunk-IOKDBFGH.mjs} +1 -1
  21. package/out/__chunks__/{chunk-YVVDA6LN.mjs.map → chunk-IOKDBFGH.mjs.map} +1 -1
  22. package/out/__chunks__/chunk-J7P6SJOM.mjs +2 -0
  23. package/out/__chunks__/chunk-J7P6SJOM.mjs.map +7 -0
  24. package/out/__chunks__/{chunk-C4CJSICS.mjs → chunk-LEVR7744.mjs} +2 -2
  25. package/out/__chunks__/{chunk-ZC3TMTLB.mjs → chunk-LRKA4F33.mjs} +2 -2
  26. package/out/__chunks__/chunk-MHCIV2K5.mjs +2 -0
  27. package/out/__chunks__/chunk-MHCIV2K5.mjs.map +7 -0
  28. package/out/__chunks__/{chunk-LAWWSFCA.mjs → chunk-MJGS5LXB.mjs} +2 -2
  29. package/out/__chunks__/chunk-N7KSN2OU.mjs +2 -0
  30. package/out/__chunks__/chunk-N7KSN2OU.mjs.map +7 -0
  31. package/out/__chunks__/{chunk-ARD5PCMI.mjs → chunk-OSYFYAJA.mjs} +2 -2
  32. package/out/__chunks__/chunk-OZ3OBQJ6.mjs +2 -0
  33. package/out/__chunks__/chunk-OZ3OBQJ6.mjs.map +7 -0
  34. package/out/__chunks__/{chunk-IGKQDUHE.mjs → chunk-PBIRC7U4.mjs} +2 -2
  35. package/out/__chunks__/{chunk-IGKQDUHE.mjs.map → chunk-PBIRC7U4.mjs.map} +2 -2
  36. package/out/__chunks__/{chunk-RNCF2III.mjs → chunk-PMPTCB44.mjs} +2 -2
  37. package/out/__chunks__/{chunk-DZ3UVNJK.mjs → chunk-PUSIK3N4.mjs} +2 -2
  38. package/out/__chunks__/{chunk-KQ3I46X7.mjs → chunk-RCBOU6TT.mjs} +2 -2
  39. package/out/__chunks__/{chunk-4PV6SFXA.mjs → chunk-SVNWQXWC.mjs} +2 -2
  40. package/out/__chunks__/{chunk-3XS5MAKS.mjs → chunk-TCCW2HZK.mjs} +2 -2
  41. package/out/__chunks__/{chunk-KJCZ5HAU.mjs → chunk-TO3DGAQU.mjs} +2 -2
  42. package/out/__chunks__/chunk-U5PPKFAJ.mjs +2 -0
  43. package/out/__chunks__/chunk-U5PPKFAJ.mjs.map +7 -0
  44. package/out/__chunks__/chunk-VMFJUT3G.mjs +2 -0
  45. package/out/__chunks__/chunk-VMFJUT3G.mjs.map +7 -0
  46. package/out/__chunks__/{chunk-7YGJXJUC.mjs → chunk-WUAYFGWU.mjs} +2 -2
  47. package/out/__chunks__/{chunk-SLLCCPCW.mjs → chunk-X7AQOVLN.mjs} +2 -2
  48. package/out/__chunks__/{chunk-ZYZ7BDOH.mjs → chunk-XQLVTH7K.mjs} +2 -2
  49. package/out/__chunks__/{chunk-CUF7MTDG.mjs → chunk-YDXS2C4W.mjs} +2 -2
  50. package/out/__chunks__/{chunk-WTCFHVW3.mjs → chunk-YMME2BFO.mjs} +2 -2
  51. package/out/__chunks__/chunk-YRHMGKLM.mjs +2 -0
  52. package/out/__chunks__/chunk-YRHMGKLM.mjs.map +7 -0
  53. package/out/__mocks__/data/index.mjs +1 -1
  54. package/out/__mocks__/index.mjs +1 -1
  55. package/out/__mocks__/server.mjs +1 -1
  56. package/out/apiCalls/account/getScamAddressData.mjs +1 -1
  57. package/out/apiCalls/index.mjs +1 -1
  58. package/out/constants/UITags.enum.d.ts +2 -2
  59. package/out/constants/UITags.enum.js +2 -2
  60. package/out/constants/UITags.enum.js.map +1 -1
  61. package/out/constants/UITags.enum.mjs +1 -1
  62. package/out/constants/index.mjs +1 -1
  63. package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
  64. package/out/controllers/TransactionsTableController/index.mjs +1 -1
  65. package/out/index.mjs +1 -1
  66. package/out/lib/sdkDappUi.d.ts +2 -2
  67. package/out/lib/sdkDappUi.mjs +1 -1
  68. package/out/managers/NotificationsFeedManager/NotificationsFeedManager.d.ts +1 -1
  69. package/out/managers/NotificationsFeedManager/NotificationsFeedManager.js.map +1 -1
  70. package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
  71. package/out/managers/NotificationsFeedManager/index.mjs +1 -1
  72. package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
  73. package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
  74. package/out/managers/TransactionManager/helpers/getShardOfAddress.mjs +1 -1
  75. package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
  76. package/out/managers/TransactionManager/helpers/isCrossShardTransaction.mjs +1 -1
  77. package/out/managers/TransactionManager/index.mjs +1 -1
  78. package/out/managers/UnlockPanelManager/UnlockPanelManager.d.ts +5 -5
  79. package/out/managers/UnlockPanelManager/UnlockPanelManager.js +5 -5
  80. package/out/managers/UnlockPanelManager/UnlockPanelManager.js.map +1 -1
  81. package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
  82. package/out/managers/UnlockPanelManager/UnlockPanelManager.types.d.ts +17 -9
  83. package/out/managers/UnlockPanelManager/UnlockPanelManager.types.mjs +1 -1
  84. package/out/managers/UnlockPanelManager/index.mjs +1 -1
  85. package/out/managers/index.mjs +1 -1
  86. package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.d.ts +2 -2
  87. package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.js +1 -1
  88. package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.js.map +1 -1
  89. package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
  90. package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
  91. package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
  92. package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
  93. package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
  94. package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
  95. package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
  96. package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
  97. package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
  98. package/out/managers/internal/ToastManager/ToastManager.mjs +1 -1
  99. package/out/managers/internal/ToastManager/helpers/LifetimeManager.mjs +1 -1
  100. package/out/managers/internal/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
  101. package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
  102. package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.d.ts +2 -2
  103. package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.mjs +1 -1
  104. package/out/managers/internal/WalletConnectStateManager/index.mjs +1 -1
  105. package/out/managers/internal/index.mjs +1 -1
  106. package/out/methods/initApp/initApp.mjs +1 -1
  107. package/out/methods/loginInfo/getLoginInfo.d.ts +57 -0
  108. package/out/methods/loginInfo/getLoginInfo.js +14 -0
  109. package/out/methods/loginInfo/getLoginInfo.js.map +1 -0
  110. package/out/methods/loginInfo/getLoginInfo.mjs +2 -0
  111. package/out/methods/loginInfo/getLoginInfo.mjs.map +7 -0
  112. package/out/methods/network/getEgldLabel.js +2 -2
  113. package/out/methods/network/getEgldLabel.js.map +1 -1
  114. package/out/methods/network/getEgldLabel.mjs +1 -1
  115. package/out/methods/network/getExplorerAddress.js +2 -2
  116. package/out/methods/network/getExplorerAddress.js.map +1 -1
  117. package/out/methods/network/getExplorerAddress.mjs +1 -1
  118. package/out/methods/network/getNetworkConfig.d.ts +1 -1
  119. package/out/methods/network/getNetworkConfig.js +2 -2
  120. package/out/methods/network/getNetworkConfig.js.map +1 -1
  121. package/out/methods/network/getNetworkConfig.mjs +1 -1
  122. package/out/methods/transactions/getPendingTransactions.d.ts +1 -0
  123. package/out/methods/transactions/getPendingTransactions.js +10 -0
  124. package/out/methods/transactions/getPendingTransactions.js.map +1 -0
  125. package/out/methods/transactions/getPendingTransactions.mjs +2 -0
  126. package/out/methods/transactions/getPendingTransactions.mjs.map +7 -0
  127. package/out/methods/transactions/getPendingTransactionsSessions.d.ts +1 -0
  128. package/out/methods/transactions/getPendingTransactionsSessions.js +10 -0
  129. package/out/methods/transactions/getPendingTransactionsSessions.js.map +1 -0
  130. package/out/methods/transactions/getPendingTransactionsSessions.mjs +2 -0
  131. package/out/methods/transactions/getPendingTransactionsSessions.mjs.map +7 -0
  132. package/out/methods/transactions/getTransactionSessions.d.ts +1 -0
  133. package/out/methods/transactions/getTransactionSessions.js +10 -0
  134. package/out/methods/transactions/getTransactionSessions.js.map +1 -0
  135. package/out/methods/transactions/getTransactionSessions.mjs +2 -0
  136. package/out/methods/transactions/getTransactionSessions.mjs.map +7 -0
  137. package/out/providers/DappProvider/DappProvider.mjs +1 -1
  138. package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
  139. package/out/providers/DappProvider/helpers/login/login.js +2 -2
  140. package/out/providers/DappProvider/helpers/login/login.js.map +1 -1
  141. package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
  142. package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
  143. package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
  144. package/out/providers/DappProvider/index.mjs +1 -1
  145. package/out/providers/ProviderFactory.mjs +1 -1
  146. package/out/providers/helpers/accountProvider.mjs +1 -1
  147. package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
  148. package/out/providers/helpers/restoreProvider.mjs +1 -1
  149. package/out/providers/index.mjs +1 -1
  150. package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
  151. package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
  152. package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
  153. package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
  154. package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
  155. package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
  156. package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
  157. package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
  158. package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
  159. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
  160. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
  161. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
  162. package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
  163. package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
  164. package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
  165. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
  166. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.js +1 -1
  167. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.js.map +1 -1
  168. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
  169. package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
  170. package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.mjs +1 -1
  171. package/out/providers/strategies/WalletConnectProviderStrategy/index.mjs +1 -1
  172. package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
  173. package/out/providers/strategies/helpers/index.mjs +1 -1
  174. package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
  175. package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
  176. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
  177. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
  178. package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
  179. package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
  180. package/out/providers/strategies/index.mjs +1 -1
  181. package/out/react/transactions/useGetPendingTransactionsSessions.d.ts +1 -1
  182. package/out/react/transactions/useGetPendingTransactionsSessions.js +3 -3
  183. package/out/react/transactions/useGetPendingTransactionsSessions.js.map +1 -1
  184. package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
  185. package/out/react/transactions/useGetPendingTransactionsSessions.mjs.map +3 -3
  186. package/out/store/actions/index.mjs +1 -1
  187. package/out/store/actions/toasts/index.mjs +1 -1
  188. package/out/store/actions/toasts/toastsActions.mjs +1 -1
  189. package/out/utils/account/index.mjs +1 -1
  190. package/out/utils/account/refreshAccount.js +1 -1
  191. package/out/utils/account/refreshAccount.js.map +1 -1
  192. package/out/utils/account/refreshAccount.mjs +1 -1
  193. package/out/utils/createUIElement.mjs +1 -1
  194. package/out/utils/index.mjs +1 -1
  195. package/out/utils/transactions/getInterpretedTransaction/getInterpretedTransaction.mjs +1 -1
  196. package/out/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.mjs +1 -1
  197. package/out/utils/transactions/getInterpretedTransaction/helpers/getShardText.mjs +1 -1
  198. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionIconInfo.mjs +1 -1
  199. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionMessages.mjs +1 -1
  200. package/out/utils/transactions/getInterpretedTransaction/helpers/index.mjs +1 -1
  201. package/out/utils/transactions/getInterpretedTransaction/index.mjs +1 -1
  202. package/package.json +2 -2
  203. package/out/__chunks__/chunk-6GNOK3TJ.mjs.map +0 -7
  204. package/out/__chunks__/chunk-6PTI5SU2.mjs +0 -2
  205. package/out/__chunks__/chunk-6PTI5SU2.mjs.map +0 -7
  206. package/out/__chunks__/chunk-7Q3M4L6V.mjs +0 -2
  207. package/out/__chunks__/chunk-7Q3M4L6V.mjs.map +0 -7
  208. package/out/__chunks__/chunk-7TOTBAGV.mjs +0 -2
  209. package/out/__chunks__/chunk-7TOTBAGV.mjs.map +0 -7
  210. package/out/__chunks__/chunk-HP5OTXWV.mjs +0 -2
  211. package/out/__chunks__/chunk-HP5OTXWV.mjs.map +0 -7
  212. package/out/__chunks__/chunk-IGA7KHXY.mjs +0 -2
  213. package/out/__chunks__/chunk-IGA7KHXY.mjs.map +0 -7
  214. package/out/__chunks__/chunk-S24E3INP.mjs +0 -2
  215. package/out/__chunks__/chunk-S24E3INP.mjs.map +0 -7
  216. package/out/__chunks__/chunk-SGPG7AHK.mjs +0 -2
  217. package/out/__chunks__/chunk-TOGPOKIP.mjs +0 -2
  218. package/out/__chunks__/chunk-TOGPOKIP.mjs.map +0 -7
  219. package/out/__chunks__/chunk-WZNCESVG.mjs +0 -2
  220. package/out/__chunks__/chunk-WZNCESVG.mjs.map +0 -7
  221. package/out/__chunks__/chunk-XU34NXIS.mjs +0 -2
  222. /package/out/__chunks__/{chunk-DHLQNKB7.mjs.map → chunk-46WBKAT4.mjs.map} +0 -0
  223. /package/out/__chunks__/{chunk-HOVFLZIM.mjs.map → chunk-4NMRZJSQ.mjs.map} +0 -0
  224. /package/out/__chunks__/{chunk-42SCXW2U.mjs.map → chunk-67X3ORNS.mjs.map} +0 -0
  225. /package/out/__chunks__/{chunk-SY63TM6N.mjs.map → chunk-773UPGVZ.mjs.map} +0 -0
  226. /package/out/__chunks__/{chunk-XS3SFPZ6.mjs.map → chunk-CRSZQV7V.mjs.map} +0 -0
  227. /package/out/__chunks__/{chunk-IGUBISXF.mjs.map → chunk-DELLFT6H.mjs.map} +0 -0
  228. /package/out/__chunks__/{chunk-NCUYIZYI.mjs.map → chunk-DGXP3AZR.mjs.map} +0 -0
  229. /package/out/__chunks__/{chunk-XU34NXIS.mjs.map → chunk-EOCZROR3.mjs.map} +0 -0
  230. /package/out/__chunks__/{chunk-SGPG7AHK.mjs.map → chunk-GDSFFLIR.mjs.map} +0 -0
  231. /package/out/__chunks__/{chunk-SM5IXWZT.mjs.map → chunk-HNEBEFTL.mjs.map} +0 -0
  232. /package/out/__chunks__/{chunk-YRLMECJT.mjs.map → chunk-HWH2SKSH.mjs.map} +0 -0
  233. /package/out/__chunks__/{chunk-PVTRVIAK.mjs.map → chunk-IJX53ZJI.mjs.map} +0 -0
  234. /package/out/__chunks__/{chunk-C4CJSICS.mjs.map → chunk-LEVR7744.mjs.map} +0 -0
  235. /package/out/__chunks__/{chunk-ZC3TMTLB.mjs.map → chunk-LRKA4F33.mjs.map} +0 -0
  236. /package/out/__chunks__/{chunk-LAWWSFCA.mjs.map → chunk-MJGS5LXB.mjs.map} +0 -0
  237. /package/out/__chunks__/{chunk-ARD5PCMI.mjs.map → chunk-OSYFYAJA.mjs.map} +0 -0
  238. /package/out/__chunks__/{chunk-RNCF2III.mjs.map → chunk-PMPTCB44.mjs.map} +0 -0
  239. /package/out/__chunks__/{chunk-DZ3UVNJK.mjs.map → chunk-PUSIK3N4.mjs.map} +0 -0
  240. /package/out/__chunks__/{chunk-KQ3I46X7.mjs.map → chunk-RCBOU6TT.mjs.map} +0 -0
  241. /package/out/__chunks__/{chunk-4PV6SFXA.mjs.map → chunk-SVNWQXWC.mjs.map} +0 -0
  242. /package/out/__chunks__/{chunk-3XS5MAKS.mjs.map → chunk-TCCW2HZK.mjs.map} +0 -0
  243. /package/out/__chunks__/{chunk-KJCZ5HAU.mjs.map → chunk-TO3DGAQU.mjs.map} +0 -0
  244. /package/out/__chunks__/{chunk-7YGJXJUC.mjs.map → chunk-WUAYFGWU.mjs.map} +0 -0
  245. /package/out/__chunks__/{chunk-SLLCCPCW.mjs.map → chunk-X7AQOVLN.mjs.map} +0 -0
  246. /package/out/__chunks__/{chunk-ZYZ7BDOH.mjs.map → chunk-XQLVTH7K.mjs.map} +0 -0
  247. /package/out/__chunks__/{chunk-CUF7MTDG.mjs.map → chunk-YDXS2C4W.mjs.map} +0 -0
  248. /package/out/__chunks__/{chunk-WTCFHVW3.mjs.map → chunk-YMME2BFO.mjs.map} +0 -0
package/README.md CHANGED
@@ -8,12 +8,12 @@ MultiversX Front-End SDK for JavaScript and TypeScript (written in TypeScript).
8
8
 
9
9
  It is built for applications that use any of the following technologies:
10
10
 
11
- - React
11
+ - React (example: [Template Dapp](https://github.com/multiversx/mx-template-dapp))
12
12
  - Angular
13
13
  - Vue
14
- - Any other JavaScript framework (e.g. Solid.js etc.)
14
+ - Any other JavaScript framework (e.g. Solid.js etc.) (example: [Solid.js Dapp](https://github.com/multiversx/mx-solidjs-template-dapp))
15
15
  - React Native
16
- - Next.js
16
+ - Next.js (example: [Next.js Dapp](https://github.com/multiversx/mx-template-dapp-nextjs))
17
17
 
18
18
  ## GitHub project
19
19
 
@@ -60,7 +60,7 @@ Also, make sure you run your app on `https`, not `http`, otherwise some provider
60
60
  npm install
61
61
  ```
62
62
 
63
- If you're transitioning from @multiversx/sdk-dapp, you can check out the [Migration guide PR](https://github.com/multiversx/mx-template-dapp/pull/264) of Template Dapp
63
+ If you're transitioning from `@multiversx/sdk-dapp@4.x`, you can check out the [Migration guide](https://github.com/multiversx/mx-template-dapp/blob/0eb7bc6194195b6c364b8010023d351d914db65e/MIGRATION_GUIDE.md) and [migration PR](https://github.com/multiversx/mx-template-dapp/pull/343) of Template Dapp
64
64
 
65
65
  ## Usage
66
66
 
@@ -81,18 +81,18 @@ Having this knowledge, we can consider several steps needed to put a dApp togeth
81
81
  | 1 | Configuration | - storage configuration (e.g. sessionStorage, localStorage etc.)<br>- chain configuration<br>- custom provider configuration (adding / disabling / changing providers) |
82
82
  | 2 | Provider interaction | - logging in and out<br>- signing transactions / messages |
83
83
  | 3 | Presenting data | - get store data (e.g. account balance, account address etc.)<br>- use components to display data (e.g. balance, address, transactions list) |
84
- | 4 | Transactions | - sending transactions<br>- tracking transactions |
84
+ | 4 | Transactions | - sending transactions<br>- tracking transactions<br>- displayingtransactions history |
85
85
 
86
86
  Each of these steps will be explained in more detail in the following sections.
87
87
 
88
88
  ### 1. Configuration
89
89
 
90
- Before your application bootstraps, you need to configure the storage, the network, and the signing providers. This is done by calling the `initApp` method from the `core/methods` folder.
90
+ Before your application bootstraps, you need to configure the storage, the network, and the signing providers. This is done by calling the `initApp` method from the `methods` folder. It is recommended to call this method in the `index.tsx` to ensure the sdk-dapp internal functions are initialized before rendering the app.
91
91
 
92
92
  ```typescript
93
93
  // index.tsx
94
- import { initApp } from '@multiversx/sdk-dapp/out/core/methods/initApp/initApp';
95
- import type { InitAppType } from '@multiversx/sdk-dapp/out/core/methods/initApp/initApp.types';
94
+ import { initApp } from '@multiversx/sdk-dapp/out/methods/initApp/initApp';
95
+ import type { InitAppType } from '@multiversx/sdk-dapp/out/methods/initApp/initApp.types';
96
96
  import { EnvironmentsEnum } from '@multiversx/sdk-dapp/out/types/enums.types';
97
97
  import { App } from "./App";
98
98
 
@@ -116,11 +116,59 @@ initApp(config).then(() => {
116
116
 
117
117
  ### 2. Provider interaction
118
118
 
119
- Once your dApp has loaded, the first user action is logging in with a chosen provider.
119
+ Once your dApp has loaded, the first user action is logging in with a chosen provider. There are two ways to perform a login, namely using the `UnlockPanelManager` and programatic login using the `ProviderFactory`.
120
+
121
+ #### 2.1 Using the `UnlockPanelManager`
122
+ By using the provided UI, you get the benefit of having all supported providers ready for login in a side panel. You simply need to link the `unlockPanelManager.openUnlockPanel` to a user action.
120
123
 
121
124
  ```typescript
122
- import { ProviderTypeEnum } from '@multiversx/sdk-dapp/out/core/providers/types/providerFactory.types';
123
- import { ProviderFactory } from '@multiversx/sdk-dapp/out/core/providers/ProviderFactory';
125
+ import { UnlockPanelManager } from '@multiversx/sdk-dapp/out/managers/UnlockPanelManager';
126
+ import { ProviderFactory } from '@multiversx/sdk-dapp/out/providers/ProviderFactory';
127
+
128
+ export const ConnectButton = () => {
129
+ const unlockPanelManager = UnlockPanelManager.init({
130
+ loginHandler: () => {
131
+ navigate('/dashboard');
132
+ },
133
+ onClose: () => { // optional action to be performed when the user closes the Unlock Panel
134
+ navigate('/');
135
+ },
136
+ });
137
+ const handleOpenUnlockPanel = () => {
138
+ unlockPanelManager.openUnlockPanel();
139
+ };
140
+ return <Button onClick={handleOpenUnlockPanel}>Connect</Button>;
141
+ };
142
+
143
+ ```
144
+
145
+ If you want to perform some actions as soon as the user has logged in, you will need to call `ProviderFactory.create` inside a handler accepting arguments.
146
+
147
+ ```typescript
148
+ export const AdvancedConnectButton = () => {
149
+ const unlockPanelManager = UnlockPanelManager.init({
150
+ loginHandler: async ({ type, anchor }) => {
151
+ const provider = await ProviderFactory.create({
152
+ type,
153
+ anchor
154
+ });
155
+ const { address, signature } = await provider.login();
156
+ navigate(`/dashboard?address=${address}`;
157
+ }
158
+ });
159
+ const handleOpenUnlockPanel = () => {
160
+ unlockPanelManager.openUnlockPanel();
161
+ };
162
+ return <Button onClick={handleOpenUnlockPanel}>Advanced Connect</Button>;
163
+ };
164
+
165
+ ```
166
+
167
+ #### 2.2 Programatic login using the `ProviderFactory`
168
+ If you want to login using your custom UI, you can link user actions to specific providers by calling the `ProviderFactory`.
169
+
170
+ ```typescript
171
+ import { ProviderTypeEnum } from '@multiversx/sdk-dapp/out/providers/types/providerFactory.types';
124
172
 
125
173
  const provider = await ProviderFactory.create({
126
174
  type: ProviderTypeEnum.extension
@@ -128,15 +176,28 @@ const provider = await ProviderFactory.create({
128
176
  await provider.login();
129
177
  ```
130
178
 
131
- ### 3. Displaying user data
179
+ ### 3. Displaying app data
132
180
 
133
181
  Depending on the framework, you can either use hooks or selectors to get the user details:
134
182
 
135
- #### React hooks solution:
183
+ #### 3.1 React hooks
184
+
185
+ If you are using React, all hooks can be found under the `/out/react` folder. All store information can be accessed via different hooks but below you will find the main hook related to most common use cases
186
+
187
+ ```bash
188
+ out/react/
189
+ ├── account/useGetAccount ### access account data like address, balance and nonce
190
+ ├── loginInfo/useGetLoginInfo ### access login data like accessToken and provider type
191
+ ├── network/useGetNetworkConfig ### access network information like chainId and egldLabel
192
+ ├── store/useSelector ### make use of the useSelector hook for querying the store via selectors
193
+ └── transactions/useGetTransactionSessions ### access all current and historic transaction sessions
194
+ ```
195
+
196
+ Below is an example of using the hooks to display the user address and balance.
136
197
 
137
198
  ```typescript
138
- import { useGetAccount } from '@multiversx/sdk-dapp/out/store/selectors/hooks/account/useGetAccount';
139
- import { useGetNetworkConfig } from '@multiversx/sdk-dapp/out/store/selectors/hooks/network/useGetNetworkConfig';
199
+ import { useGetAccount } from '@multiversx/sdk-dapp/out/react/account/useGetAccount';
200
+ import { useGetNetworkConfig } from '@multiversx/sdk-dapp/out/react/network/useGetNetworkConfig';
140
201
 
141
202
  const account = useGetAccount();
142
203
  const {
@@ -147,40 +208,62 @@ console.log(account.address);
147
208
  console.log(`${account.balance} ${egldLabel}`);
148
209
  ```
149
210
 
150
- #### Store selector functions:
211
+ #### 3.2 Store selector functions:
212
+
213
+ If you are not using the React ecosystem, you can use store selectors to get the store data, but note that information will not be reactive unless you subscribe to store changes.
151
214
 
152
215
  ```typescript
153
- import { getAccount } from '@multiversx/sdk-dapp/out/core/methods/account/getAccount';
154
- import { getNetworkConfig } from '@multiversx/sdk-dapp/out/core/methods/network/getNetworkConfig';
216
+ import { getAccount } from '@multiversx/sdk-dapp/out/methods/account/getAccount';
217
+ import { getNetworkConfig } from '@multiversx/sdk-dapp/out/methods/network/getNetworkConfig';
155
218
 
156
219
  const account = getAccount();
157
220
  const { egldLabel } = getNetworkConfig();
158
221
  ```
159
222
 
223
+ In order to get live updates you may need to subscribe to the store like this:
224
+
225
+ ```typescript
226
+ import { createSignal, onCleanup } from 'solid-js';
227
+ import { getStore } from '@multiversx/sdk-dapp/out/store/store';
228
+
229
+ export function useStore() {
230
+ const store = getStore();
231
+ const [state, setState] = createSignal(store.getState());
232
+
233
+ const unsubscribe = store.subscribe((newState) => {
234
+ setState(newState);
235
+ });
236
+
237
+ onCleanup(() => unsubscribe());
238
+
239
+ return state;
240
+ }
241
+ ```
242
+
160
243
  ### 4. Transactions
161
244
 
162
- #### Signing transactions
245
+ #### 4.1 Signing transactions
163
246
 
164
- To sign transactions, you first need to create the `Transaction` object then pass it to the initialized provider.
247
+ To sign transactions, you first need to create the `Transaction` object, then pass it to the initialized provider.
165
248
 
166
249
  ```typescript
167
- import { Transaction, TransactionPayload } from '@multiversx/sdk-core/out';
250
+ import { Address, Transaction, TransactionPayload } from '@multiversx/sdk-core';
168
251
  import {
169
252
  GAS_PRICE,
170
253
  GAS_LIMIT
171
254
  } from '@multiversx/sdk-dapp/out/constants/mvx.constants';
172
- import { getAccountProvider } from '@multiversx/sdk-dapp/out/core/providers/helpers/accountProvider';
255
+ import { getAccountProvider } from '@multiversx/sdk-dapp/out/providers/helpers/accountProvider';
173
256
  import { refreshAccount } from '@multiversx/sdk-dapp/out/utils/account/refreshAccount';
174
257
 
175
258
  const pongTransaction = new Transaction({
176
- value: '0',
259
+ value: BigInt(0),
177
260
  data: new TransactionPayload('pong'),
178
- receiver: contractAddress,
179
- gasLimit: GAS_LIMIT,
180
- gasPrice: GAS_PRICE,
261
+ receiver: Address.newFromBech32(contractAddress),
262
+ gasLimit: BigInt(GAS_LIMIT),
263
+ gasPrice: BigInt(GAS_PRICE),
181
264
  chainID: network.chainId,
182
- nonce: account.nonce,
183
- sender: account.address,
265
+ nonce: BigInt(account.nonce),
266
+ sender: Address.newFromBech32(account.address),
184
267
  version: 1
185
268
  });
186
269
 
@@ -189,22 +272,77 @@ const provider = getAccountProvider();
189
272
  const signedTransactions = await provider.signTransactions(transactions);
190
273
  ```
191
274
 
192
- #### Sending and tracking transactions
275
+ #### 4.2 Sending and tracking transactions
193
276
 
194
- Then, to send the transactions, you need to use the `TransactionManager` class and pass in the signedTransactions to the send method. You can optionally track the transactions by using the track method. This will create a toast notification with the transaction hash and its status.
277
+ Then, to send the transactions, you need to use the `TransactionManager` class and pass in the `signedTransactions` to the `send` method. You can then track the transactions by using the `track` method. This will create a toast notification with the transaction hash and its status.
195
278
 
196
279
  ```typescript
197
- import { TransactionManager } from '@multiversx/sdk-dapp/out/core/managers/TransactionManager';
280
+ import { TransactionManager } from '@multiversx/sdk-dapp/out/managers/TransactionManager';
281
+ import type { TransactionsDisplayInfoType } from '@multiversx/sdk-dapp/out/types/transactions.types';
282
+
198
283
 
199
284
  const txManager = TransactionManager.getInstance();
200
- await txManager.send(signedTransactions);
201
- await txManager.track(signedTransactions);
285
+ const sentTransactions = await txManager.send(signedTransactions);
286
+
287
+ const toastInformation: TransactionsDisplayInfoType = {
288
+ processingMessage: 'Processing transactions',
289
+ errorMessage: 'An error has occurred during transaction execution',
290
+ successMessage: 'Transactions executed'
291
+ }
292
+
293
+ const sessionId = await txManager.track(sentTransactions, {
294
+ transactionsDisplayInfo: toastInformation
295
+ });
202
296
  ```
203
297
 
204
- Once the transactions are executed on the blockchain, the flow ends with the user logging out.
298
+ #### 4.3 Using the Notifications Feed
299
+
300
+ The Notifications Feed is a component that displays **session transactions** in a list. Internally it gets initialized in the `initApp` method. It can be accessed via the `NotificationManager.getInstance()` method.
301
+ Once the user logs out of the dApp, all transactions displayed by the Notifications Feed are removed from the store. Note that you can switch between toast notifications and Notifications Feed by pressing the View All button above the current pending transaction toast in the UI.
205
302
 
206
303
  ```typescript
207
- import { getAccountProvider } from '@multiversx/sdk-dapp/out/core/providers/helpers/accountProvider';
304
+ const notificationManager = NotificationManager.getInstance();
305
+ notificationManager.openNotificationsFeed();
306
+ ```
307
+
308
+ #### 4.4 Inspecting transactions
309
+
310
+ You can find both methods and hooks to access transactions data, as seen in the table below.
311
+
312
+ **Table 2**. Inspectig transactions
313
+ | # | Helper | Description | React hook equivalent |
314
+ |---|------|-------------|----|
315
+ | | `methods/transactions` | path | `react/transactions` |
316
+ | 1 | `getTransactionSessions()` | returns all trabsaction sessions |`useGetTransactionSessions()` |
317
+ | 2 | `getPendingTransactionsSessions()` | returns an array of pending sessions | `useGetPendingTransactionsSessions()`|
318
+ | 3 | `getPendingTransactions()` | returns an array of signed transactions | `useGetPendingTransactions()` |
319
+
320
+ There is a way to inspect store information regarding a specific transaction, using the `transactionsSliceSelector`. An example is shown below:
321
+
322
+ ```typescript
323
+ import {
324
+ pendingTransactionsSessionsSelector,
325
+ transactionsSliceSelector
326
+ } from '@multiversx/sdk-dapp/out/store/selectors/transactionsSelector';
327
+ import { getStore } from '@multiversx/sdk-dapp/out/store/store';
328
+
329
+ const store = getStore(); // or use useStore hook for reactivity
330
+ const pendingSessions = pendingTransactionsSessionsSelector(store.getState());
331
+ const allTransactionSessions = transactionsSliceSelector(store.getState());
332
+
333
+ const isSessionIdPending =
334
+ Object.keys(pendingSessions).includes(sessionId);
335
+ const currentSession = allTransactionSessions[sessionId];
336
+ const currentSessionStatus = currentSession?.status;
337
+ const currentTransaction = currentSession?.transactions?.[0];
338
+ const currentTransactionStatus = currentTransaction?.status;
339
+ ```
340
+
341
+ #### 4.5 Logging out
342
+ The user journey ends with calling the `provider.logout()` method.
343
+
344
+ ```typescript
345
+ import { getAccountProvider } from '@multiversx/sdk-dapp/out/providers/helpers/accountProvider';
208
346
  const provider = getAccountProvider();
209
347
  await provider.logout();
210
348
  ```
@@ -213,7 +351,7 @@ await provider.logout();
213
351
 
214
352
  We have seen in the previous chapter what are the minimal steps to get up and running with a blockchain interaction using sdk-dapp. Next we will detail each element mentioned above
215
353
 
216
- **Table 2**. Elements needed to build a dApp
354
+ **Table 3**. Elements needed to build a dApp
217
355
  | # | Type | Description |
218
356
  |---|------|-------------|
219
357
  | 1 | Network | Chain configuration |
@@ -223,50 +361,54 @@ We have seen in the previous chapter what are the minimal steps to get up and ru
223
361
  | 5 | UI Components | Displaying UI information like balance, public keys etc. |
224
362
 
225
363
  Since these are mixtures of business logic and UI components, the library is split into several folders to make it easier to navigate.
226
- When inspecting the package, there is more content under `src`, but the main folders of interest are:
364
+ When inspecting the package, there is more content under `src`, but the folders of interest are:
365
+
227
366
 
228
367
  ```bash
229
368
  src/
230
369
  ├── apiCalls/ ### methods for interacting with the API
231
370
  ├── constants/ ### useful constants from the ecosystem like ledger error codes, default gas limits for transactions etc.
232
- ├── controllers/ ### business logic for UI elements like transactions and amount formatting
233
- ├── core/ ### hosting the provider class, and all implementations for different signing providers
371
+ ├── controllers/ ### business logic for UI elements that are not bound to the store
372
+ ├── managers/ ### business logic for UI elements that are bound to the store
373
+ ├── providers/ ### signing providers
374
+ ├── methods/ ### utility functions to query and update the store
375
+ ├── react/ ### react hooks to query the store
234
376
  └── store/ ### store initialization, middleware, slices, selectors and actions
235
377
  ```
236
378
 
237
379
  Conceptually, these can be split into 3 main parts:
238
380
 
239
- - First is the business logic in `apiCalls`, `constants` and `core` (signing providers).
381
+ - First is the business logic in `apiCalls`, `constants`, `providers` and `methods`
240
382
  - Then comes the persistence layer hosted in the `store` folder, using [Zustand](https://zustand.docs.pmnd.rs/) under the hood.
241
- - Last are the UI components hosted in [@multiversx/sdk-dapp](https://github.com/multiversx/mx-sdk-dapp-ui) with some components controlled on demand by classes defined in `controlles`
383
+ - Last are the UI components hosted in [@multiversx/sdk-dapp-ui](https://github.com/multiversx/mx-sdk-dapp-ui) with some components controlled on demand by classes defined in `controlles` and `managers`
242
384
 
243
- Next, we will take the elements from Table 2 and detail them in the following sections.
385
+ Next, we will take the elements from Table 3 and detail them in the following sections.
244
386
 
245
387
  ### 1. Network
246
388
 
247
389
  The network configuration is done in the `initApp` method, where you can make several confgurations like:
248
390
 
249
- - specifying the environment (devnet, testnet, mainnet)
391
+ - specifying the environment (`devnet`, `testnet`, `mainnet`)
250
392
  - overriding certain network parameters like wallet address, explorer address etc.
251
393
 
252
394
  Once the network is configured, the `network` slice in the store will hold the network configuration.
253
395
 
254
- To query different network parameters, you can use the `getNetworkConfig` method from the `core/methods/network` folder.
396
+ To query different network parameters, you can use the `getNetworkConfig` method from the `methods/network` folder.
255
397
 
256
398
  ### 2. Provider
257
399
 
258
- The provider is the main class that handles the signing of transactions and messages. It is initialized in the `initApp` method and can be accessed via the `getAccountProvider` method from the `core/providers/helpers` folder.
400
+ The provider is the main class that handles the signing of transactions and messages. It is initialized in the `initApp` method and can be accessed via the `getAccountProvider` method from the `providers/helpers` folder.
259
401
 
260
402
  #### Initialization
261
403
 
262
- It's important to initialize it on app load (this is take care of by `initApp`), since it restores the session from the store and allows signing transactions without the need to make a new login.
404
+ An existing provider is initialized on app load (this is take care of by `initApp`), since it restores the session from the store and allows signing transactions without the need of making a new login.
263
405
 
264
406
  #### Creating a custom provider
265
407
 
266
408
  If you need to create a custom signing provider, make sure to extend the `IProvider` interface and implement all required methods (see example [here](https://github.com/multiversx/mx-template-dapp/tree/main/src/provider)). Next step would be to include it in the `customProviders` array in the `initApp` method or add it to the [window object](https://github.com/multiversx/mx-template-dapp/tree/main/src/initConfig). Last step is to login using the custom provider.
267
409
 
268
410
  ```typescript
269
- import { ProviderTypeEnum } from '@multiversx/sdk-dapp/out/core/providers/types/providerFactory.types';
411
+ import { ProviderTypeEnum } from '@multiversx/sdk-dapp/out/providers/types/providerFactory.types';
270
412
 
271
413
  const ADDITIONAL_PROVIDERS = {
272
414
  myCustomProvider: 'myCustomProvider'
@@ -292,12 +434,12 @@ Once the provider is initialized, you can get a reference to it using the `getAc
292
434
 
293
435
  #### Getting account data
294
436
 
295
- Once the user logs in, a call is made to the API for fetching the account data. This data is persisted in the store and is accessible through helpers found in `core/methods/account`. These functions are:
437
+ Once the user logs in, a call is made to the API for fetching the account data. This data is persisted in the store and is accessible through helpers found in `methods/account`. These functions are:
296
438
 
297
- **Table 3**. Getting account data
439
+ **Table 4**. Getting account data
298
440
  | # | Helper | Description | React hook equivalent |
299
441
  |---|------|-------------|----|
300
- | | `core/methods/account` | path | `store/selectors/hooks/account` |
442
+ | | `methods/account` | path | `react/account` |
301
443
  | 1 | `getAccount()` | returns all account data |`useGetAccount()` |
302
444
  | 2 | `getAddress()` | returns just the user's public key | `useGetAddress()`|
303
445
  | 3 | `getIsLoggedIn()` | returns a login status boolean | `useGetIsLoggedIn()` |
@@ -305,13 +447,13 @@ Once the user logs in, a call is made to the API for fetching the account data.
305
447
 
306
448
  #### Nonce management
307
449
 
308
- sdk-dapp has a mechanism that does its best to manage the account nonce. For example, if the user sends a transaction, the nonce gets incremented on the client so that if he sends a new transaction, it will have the correct increased nonce. If you want to make sure the nonce is in sync with the API account, you can call `refreshAccount()` as shown above in the **Signing transactions** section.
450
+ `sdk-dapp` has a mechanism that does its best to manage the account nonce. For example, if the user sends a transaction, the nonce gets incremented on the client so that if a new transaction is sent, it will have the correct increased nonce. If you want to make sure the nonce is in sync with the API account, you can call `refreshAccount()` as shown above in the **Signing transactions** section.
309
451
 
310
452
  ### 4. Transactions Manager
311
453
 
312
454
  #### Overview
313
455
 
314
- The `TransactionManager` is a class that handles sending and tracking transactions in the MultiversX ecosystem. It provides methods to send single and batch transactions while handling tracking, error management, and toasts for user notifications. It is initialized in the `initApp` method and can be accessed via `TransactionManager.getInstance()`.
456
+ The `TransactionManager` is a class that handles sending and tracking transactions in the MultiversX ecosystem. It provides methods to send either single or batch transactions. It also handles tracking, error management, and toast notifications for user feedback. It is initialized in the `initApp` method and can be accessed via `TransactionManager.getInstance()`.
315
457
 
316
458
  #### Features
317
459
 
@@ -324,15 +466,15 @@ The `TransactionManager` is a class that handles sending and tracking transactio
324
466
 
325
467
  The transaction lifecycle consists of the following steps:
326
468
 
327
- 1. **Creating** a `Transaction` object using the `@multiversx/sdk-core provider`
469
+ 1. **Creating** a `Transaction` object from `@multiversx/sdk-core`
328
470
  2. **Signing** the transaction with the initialized provider and receiving a `SignedTransactionType` object
329
471
  3. **Sending** the signed transaction using TransactionManager's `send()` function. Signed transactions can be sent in 2 ways:
330
472
 
331
- **Table 4**. Sending signed transactions
473
+ **Table 5**. Sending signed transactions
332
474
  | # | Signature | Method | Description |
333
475
  |---|------|-------------|-------------|
334
476
  | 1 | `send([tx1, tx2])` | `POST` to `/transactions` | Transactions are executed in parallel
335
- | 2 | `send([[tx1, tx2], [tx3]])` | `POST` to `/batch` | First batch of two transactions is executed, and the second batch of one transaction waits for the finished results, and is then executed
477
+ | 2 | `send([[tx1, tx2], [tx3]])` | `POST` to `/batch` | **a)** 1<sup>st</sup> batch of two transactions is executed, **b)** the 2<sup>nd</sup> batch of one transaction waits for the finished results, **c)** and once the 1<sup>st</sup> batch is finished, the 2<sup>nd</sup> batch is executed
336
478
 
337
479
  4. **Tracking** transactions is made by using `transactionManager.track()`. Since the `send()` function returns the same arguments it has received, the same array payload can be passed into the `track()` method. Under the hood, status updates are received via a WebSocket or polling mechanism.
338
480
  Once a transaction array is tracked, it gets associated with a `sessionId`, returned by the `track()` method and stored in the `transactions` slice. Depending on the array's type (plain/batch), the session's status varies from initial (`pending`/`invalid`/`sent`) to final (`successful`/`failed`/`timedOut`).
@@ -370,22 +512,23 @@ createCustomToast({
370
512
  6. **Error Handling & Recovery** is done through a custom toast that prompts the user to take appropriate action.
371
513
 
372
514
  #### Methods
515
+ ___
373
516
 
374
- 1. Sending Transactions
517
+ #### 1. Sending Transactions
375
518
 
376
519
  In this way, all transactions are sent simultaneously. There is no limit to the number of transactions contained in the array.
377
520
 
378
- ```ts
521
+ ```typescript
379
522
  const transactionManager = TransactionManager.getInstance();
380
523
  const parallelTransactions: SigendTransactionType[] = [tx1, tx2, tx3, tx4];
381
524
  const sentTransactions = await transactionManager.send(parallelTransactions);
382
525
  ```
383
526
 
384
- 2. Sending Batch Transactions
527
+ #### 2. Sending Batch Transactions
385
528
 
386
529
  In this sequential case, each batch waits for the previous one to complete.
387
530
 
388
- ```ts
531
+ ```typescript
389
532
  const transactionManager = TransactionManager.getInstance();
390
533
  const batchTransactions: SignedTransactionType[][] = [
391
534
  [tx1, tx2],
@@ -394,11 +537,11 @@ const batchTransactions: SignedTransactionType[][] = [
394
537
  const sentTransactions = await transactionManager.send(batchTransactions);
395
538
  ```
396
539
 
397
- 3. Tracking Transactions
540
+ #### 3. Tracking Transactions
398
541
 
399
542
  The basic option is to use the built-in tracking, which displays toast notifications with default messages.
400
543
 
401
- ```ts
544
+ ```typescript
402
545
  const sessionId = await transactionManager.track(
403
546
  sentTransactions
404
547
  // { disableToasts: true } optionally disable toast notifications
@@ -407,7 +550,7 @@ const sessionId = await transactionManager.track(
407
550
 
408
551
  If you want to provide more human-friendly messages to your users, you can enable tracking with custom toast messages:
409
552
 
410
- ```ts
553
+ ```typescript
411
554
  const sessionId = await transactionManager.track(sentTransactions, {
412
555
  transactionsDisplayInfo: {
413
556
  errorMessage: 'Failed adding stake',
@@ -417,16 +560,16 @@ const sessionId = await transactionManager.track(sentTransactions, {
417
560
  });
418
561
  ```
419
562
 
420
- **Tracking transactions without being logged in**
563
+ #### 3.1 Tracking transactions without being logged in
421
564
 
422
565
  If your application needs to track transactions sent by a server and the user does not need to login to see the outcome of these transactions, there are several steps that you need to do to enable this process.
423
566
 
424
567
  Step 1. Enabling the tracking mechanism
425
568
 
426
- By default the tracking mechanism is enabled only after the user logs in. That is the moment when the WebSocket connection is established. If you want to enable tracking before the user logs in, you need to call the `trackTransactions` method from the `core/methods/trackTransactions` folder. This method will enable a polling mechanism.
569
+ By default the tracking mechanism is enabled only after the user logs in. That is the moment when the WebSocket connection is established. If you want to enable tracking before the user logs in, you need to call the `trackTransactions` method from the `methods/trackTransactions` folder. This method will enable a polling mechanism.
427
570
 
428
571
  ```typescript
429
- import { trackTransactions } from '@multiversx/sdk-dapp/out/core/methods/trackTransactions/trackTransactions';
572
+ import { trackTransactions } from '@multiversx/sdk-dapp/out/methods/trackTransactions/trackTransactions';
430
573
 
431
574
  initApp(config).then(async () => {
432
575
  await trackTransactions(); // enable here since by default tracking will be enabled only after login
@@ -434,10 +577,12 @@ initApp(config).then(async () => {
434
577
  });
435
578
  ```
436
579
 
580
+ Step 2. Tracking transactions
581
+
437
582
  Then, you can track transactions by calling the `track` method from the `TransactionManager` class with a plain transaction containing the transaction hash.
438
583
 
439
584
  ```typescript
440
- import { Transaction, TransactionsConverter } from '@multiversx/sdk-core/out';
585
+ import { Transaction, TransactionsConverter } from '@multiversx/sdk-core';
441
586
 
442
587
  const tManager = TransactionManager.getInstance();
443
588
  const txConverter = new TransactionsConverter();
@@ -449,11 +594,11 @@ const plainTransaction = { ...transaction.toPlainObject(), hash };
449
594
  await tManager.track([plainTransaction]);
450
595
  ```
451
596
 
452
- #### Advanced Usage
597
+ #### 3.2 Advanced Usage
453
598
 
454
599
  If you need to check the status of the signed transactions, you can query the store direclty using the `sessionId` returned by the `track()` method.
455
600
 
456
- ```ts
601
+ ```typescript
457
602
  import { getStore } from '@multiversx/sdk-dapp/out/store/store';
458
603
  import { transactionsSliceSelector } from '@multiversx/sdk-dapp/out/store/selectors/transactionsSelector';
459
604
 
@@ -467,13 +612,17 @@ Object.entries(state).forEach(([sessionKey, data]) => {
467
612
 
468
613
  ### 5. UI Components
469
614
 
470
- sdk-dapp needs to make use of visual elements for allowing the user to interact with some providers (like the ledger), or to display messages to the user (like idle states or toasts). These visual elements consitst of webcomponents hosted in the `@multiversx/sdk-dapp-ui` package. Thus, sdk-dapp does not hold any UI elements, just business logic that controls external components. We can consider two types of UI components: internal and external. They are differentiated by the way they are controlled: private components are controlled by sdk-dapp's signing or logging in flows, while public components can be controlled by the dApp.
615
+ `sdk-dapp` needs to make use of visual elements for allowing the user to interact with some providers (like the ledger), or to display messages to the user (like idle states or toasts). These visual elements consitst of webcomponents hosted in the `@multiversx/sdk-dapp-ui` package. Thus, `sdk-dapp` does not hold any UI elements, just business logic that controls external components. We can consider two types of UI components: internal and public. They are differentiated by the way they are controlled: internal components are controlled by `sdk-dapp`'s signing or logging in flows, while public components should be controlled by the dApp.
616
+
617
+ #### 5.1 Public components
618
+
619
+ The public components are the ones that are used in the dApp and are controlled by the dApp. They are defined in the `@multiversx/sdk-dapp-ui` package.
471
620
 
472
- #### Public components
621
+ // TODO: add examples
473
622
 
474
- #### Private components
623
+ #### 5.2 Internal components
475
624
 
476
- The way private components are controlled are trough a [pub-sub pattern](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern) called EventBus. Each webcomponent has a method of exposing its EventBus, thus allowing sdk-dapp to get a reference to it and use it for communication.
625
+ The way internal components are controlled are trough a [pub-sub pattern](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern) called EventBus. Each webcomponent has a method of exposing its EventBus, thus allowing `sdk-dapp` to get a reference to it and use it for communication.
477
626
 
478
627
  ```mermaid
479
628
  flowchart LR
@@ -482,13 +631,13 @@ flowchart LR
482
631
 
483
632
  ```typescript
484
633
  const modalElement = await createUIElement<LedgerConnectModal>(
485
- 'ledger-connect-panel'
634
+ 'mvx-ledger-connect-panel'
486
635
  );
487
636
  const eventBus = await modalElement.getEventBus();
488
637
  eventBus.publish('TRANSACTION_TOAST_DATA_UPDATE', someData);
489
638
  ```
490
639
 
491
- If you want to override private components and create your own, you can implement a similar strategy, of course by respecting each webcomponent's API (see an interface example [here](https://github.com/multiversx/mx-sdk-dapp/blob/main/src/core/providers/strategies/LedgerProviderStrategy/types/ledger.types.ts)).
640
+ If you want to override private components and create your own, you can implement a similar strategy by respecting each webcomponent's API (see an interface example [here](https://github.com/multiversx/mx-sdk-dapp/blob/main/src/providers/strategies/LedgerProviderStrategy/types/ledger.types.ts)).
492
641
 
493
642
  ## Debugging your dApp
494
643
 
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-LAWWSFCA.mjs";import{a as y}from"./chunk-OYA4AQFY.mjs";import{a as f}from"./chunk-GUHNF5RM.mjs";import{a as c}from"./chunk-42SCXW2U.mjs";import{a as I}from"./chunk-ARD5PCMI.mjs";import{a as l}from"./chunk-C4CJSICS.mjs";import{a as w}from"./chunk-ZYZ7BDOH.mjs";import{a as u}from"./chunk-3XS5MAKS.mjs";import{n as m,o as n,p as P}from"./chunk-S24E3INP.mjs";import{a as p}from"./chunk-6746F2FY.mjs";import{a as s}from"./chunk-CN4RHVUE.mjs";import{IframeLoginTypes as b}from"@multiversx/sdk-web-wallet-iframe-provider/out/constants";var d=class{static set customProviders(t){this._customProviders=t}static get customProviders(){return this._customProviders}static async create({type:t,anchor:o}){let e=null;switch(t){case"extension":{e=await new I().createProvider();break}case"crossWindow":{e=await new l().createProvider();break}case"ledger":{e=await new u().createProvider({anchor:o}),await g.getInstance().init();break}case"metamask":{e=await new c({type:b.metamask}).createProvider();break}case"passkey":{e=await new c({type:b.passkey}).createProvider();break}case"walletConnect":{e=await new w().createProvider({anchor:o});break}case"webview":{e=await new f().createProvider();break}default:{let r=p();for(let a of this._customProviders)a.type===t&&(e=await a.constructor({address:r,anchor:o}));break}}if(!e)throw new Error("Unable to create provider");e.getType=()=>t;let v=new m(e);n(v);let i=t;s(i);let k=["crossWindow","metamask","passkey"].includes(i);return y(k?{skipLoginMethod:i}:null),v}static async destroy(){P().cancelLogin(),n(null),s("")}};d._customProviders=[];export{d as a};
2
- //# sourceMappingURL=chunk-DHLQNKB7.mjs.map
1
+ import{a as g}from"./chunk-MJGS5LXB.mjs";import{a as y}from"./chunk-OYA4AQFY.mjs";import{a as f}from"./chunk-GUHNF5RM.mjs";import{a as c}from"./chunk-67X3ORNS.mjs";import{a as I}from"./chunk-OSYFYAJA.mjs";import{a as l}from"./chunk-LEVR7744.mjs";import{a as w}from"./chunk-XQLVTH7K.mjs";import{a as u}from"./chunk-TCCW2HZK.mjs";import{n as m,o as n,p as P}from"./chunk-J7P6SJOM.mjs";import{a as p}from"./chunk-6746F2FY.mjs";import{a as s}from"./chunk-CN4RHVUE.mjs";import{IframeLoginTypes as b}from"@multiversx/sdk-web-wallet-iframe-provider/out/constants";var d=class{static set customProviders(t){this._customProviders=t}static get customProviders(){return this._customProviders}static async create({type:t,anchor:o}){let e=null;switch(t){case"extension":{e=await new I().createProvider();break}case"crossWindow":{e=await new l().createProvider();break}case"ledger":{e=await new u().createProvider({anchor:o}),await g.getInstance().init();break}case"metamask":{e=await new c({type:b.metamask}).createProvider();break}case"passkey":{e=await new c({type:b.passkey}).createProvider();break}case"walletConnect":{e=await new w().createProvider({anchor:o});break}case"webview":{e=await new f().createProvider();break}default:{let r=p();for(let a of this._customProviders)a.type===t&&(e=await a.constructor({address:r,anchor:o}));break}}if(!e)throw new Error("Unable to create provider");e.getType=()=>t;let v=new m(e);n(v);let i=t;s(i);let k=["crossWindow","metamask","passkey"].includes(i);return y(k?{skipLoginMethod:i}:null),v}static async destroy(){P().cancelLogin(),n(null),s("")}};d._customProviders=[];export{d as a};
2
+ //# sourceMappingURL=chunk-46WBKAT4.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as f}from"./chunk-FRDR4A7Z.mjs";import{a as g}from"./chunk-BQL3NILA.mjs";import{p as c}from"./chunk-S24E3INP.mjs";import{u as n}from"./chunk-CN4RHVUE.mjs";import{g as a}from"./chunk-LTF535HP.mjs";import{e as l}from"./chunk-VNLGNNIL.mjs";import{HWProvider as m}from"@multiversx/sdk-hw-provider";async function A(u){let v=g(),d=u?.shouldInitProvider||!v,o=l(n()),t=a(n()),r=c(),i=new m,I=async()=>{let e=o?.index!=null;if(r instanceof m&&r.isInitialized())return e&&await r.setAddressIndex(o.index),r;if(d&&!await i.init())throw new Error("Failed to initialize Ledger Provider");return e&&await i.setAddressIndex(o.index),i};try{if(!d&&t)return{ledgerProvider:i,ledgerConfig:{version:t.version,dataEnabled:t.hasContractDataEnabled}};let e=await I(),s=await f(e);return{ledgerProvider:e,ledgerConfig:s}}catch(e){throw console.error("Could not initialize ledger app",e),e}}export{A as a};
2
- //# sourceMappingURL=chunk-HOVFLZIM.mjs.map
1
+ import{a as f}from"./chunk-FRDR4A7Z.mjs";import{a as g}from"./chunk-BQL3NILA.mjs";import{p as c}from"./chunk-J7P6SJOM.mjs";import{u as n}from"./chunk-CN4RHVUE.mjs";import{g as a}from"./chunk-LTF535HP.mjs";import{e as l}from"./chunk-VNLGNNIL.mjs";import{HWProvider as m}from"@multiversx/sdk-hw-provider";async function A(u){let v=g(),d=u?.shouldInitProvider||!v,o=l(n()),t=a(n()),r=c(),i=new m,I=async()=>{let e=o?.index!=null;if(r instanceof m&&r.isInitialized())return e&&await r.setAddressIndex(o.index),r;if(d&&!await i.init())throw new Error("Failed to initialize Ledger Provider");return e&&await i.setAddressIndex(o.index),i};try{if(!d&&t)return{ledgerProvider:i,ledgerConfig:{version:t.version,dataEnabled:t.hasContractDataEnabled}};let e=await I(),s=await f(e);return{ledgerProvider:e,ledgerConfig:s}}catch(e){throw console.error("Could not initialize ledger app",e),e}}export{A as a};
2
+ //# sourceMappingURL=chunk-4NMRZJSQ.mjs.map
@@ -1,2 +1,2 @@
1
1
  import{u as e}from"./chunk-CN4RHVUE.mjs";import{b as r}from"./chunk-SAAOQW7P.mjs";function d(t=e()){return r(t).explorerAddress}export{d as a};
2
- //# sourceMappingURL=chunk-C3KLB5TA.mjs.map
2
+ //# sourceMappingURL=chunk-4OO7HE5Q.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/methods/network/getExplorerAddress.ts"],
4
- "sourcesContent": ["import { networkSelector } from 'store/selectors';\nimport { getState } from 'store/store';\n\nexport function getExplorerAddress(state = getState()) {\n return networkSelector(state).explorerAddress;\n}\n"],
4
+ "sourcesContent": ["import { networkSelector } from 'store/selectors/networkSelectors';\nimport { getState } from 'store/store';\n\nexport function getExplorerAddress(state = getState()) {\n return networkSelector(state).explorerAddress;\n}\n"],
5
5
  "mappings": "kFAGO,SAASA,EAAmBC,EAAQC,EAAS,EAAG,CACrD,OAAOC,EAAgBF,CAAK,EAAE,eAChC",
6
6
  "names": ["getExplorerAddress", "state", "getState", "networkSelector"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ var e=(N=>(N.LEDGER_CONNECT="mvx-ledger-connect",N.NOTIFICATIONS_FEED="mvx-notifications-feed",N.PENDING_TRANSACTIONS_PANEL="mvx-pending-transactions-panel",N.SIGN_TRANSACTIONS_PANEL="mvx-sign-transactions-panel",N.TOAST_LIST="mvx-toast-list",N.WALLET_CONNECT="mvx-wallet-connect",N.UNLOCK_PANEL="mvx-unlock-panel",N))(e||{});export{e as a};
2
+ //# sourceMappingURL=chunk-55SACSMS.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/constants/UITags.enum.ts"],
4
+ "sourcesContent": ["export enum UITagsEnum {\n LEDGER_CONNECT = 'mvx-ledger-connect',\n NOTIFICATIONS_FEED = 'mvx-notifications-feed',\n PENDING_TRANSACTIONS_PANEL = 'mvx-pending-transactions-panel',\n SIGN_TRANSACTIONS_PANEL = 'mvx-sign-transactions-panel',\n TOAST_LIST = 'mvx-toast-list',\n WALLET_CONNECT = 'mvx-wallet-connect',\n UNLOCK_PANEL = 'mvx-unlock-panel'\n}\n"],
5
+ "mappings": "AAAO,IAAKA,OACVA,EAAA,eAAiB,qBACjBA,EAAA,mBAAqB,yBACrBA,EAAA,2BAA6B,iCAC7BA,EAAA,wBAA0B,8BAC1BA,EAAA,WAAa,iBACbA,EAAA,eAAiB,qBACjBA,EAAA,aAAe,mBAPLA,OAAA",
6
+ "names": ["UITagsEnum"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-VLHG5NVE.mjs";import{a as c}from"./chunk-KQ3I46X7.mjs";import{a as p}from"./chunk-NCUYIZYI.mjs";import{a}from"./chunk-CBIH5QMT.mjs";import{u as o}from"./chunk-CN4RHVUE.mjs";import{b as n}from"./chunk-SAAOQW7P.mjs";import{a as e}from"./chunk-2X7ENE6Y.mjs";import{IframeProvider as l}from"@multiversx/sdk-web-wallet-iframe-provider/out";var g=class extends d{constructor({type:r,address:i}){super(i);this.provider=null;this.type=null;this._signTransactions=null;this._signMessage=null;this.createProvider=async()=>{this.initialize();let r=n(o());if(!this.type)throw new Error("Invalid provider type.");return this.provider||(this.provider=l.getInstance(),await this.provider.init()),this.provider.setLoginType(this.type),this.provider.setWalletUrl(String(r.iframeWalletAddress)),this._signTransactions=this.provider.signTransactions.bind(this.provider),this._signMessage=this.provider.signMessage.bind(this.provider),this._login=this.provider.login.bind(this.provider),this.buildProvider()};this.buildProvider=()=>{let{address:r}=a();if(!this.provider)throw new Error("Provider is not initialized.");let i=this.provider;return i.setAccount({address:this.address||r}),i.signTransactions=this.signTransactions,i.signMessage=this.signMessage,i.login=this.login,i.cancelLogin=this.cancelLogin,i};this.signTransactions=async r=>{if(!this.provider||!this._signTransactions)throw new Error("Provider is not initialized.");let{manager:i,onClose:s}=await p({cancelAction:this.provider.cancelAction.bind(this.provider)});i.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",s),this.type&&i.updateData({name:e.iframe,type:this.type});try{return await this._signTransactions(r)}catch(t){throw await s({shouldCancelAction:!0}),t}finally{i.closeUI()}};this.signMessage=async r=>{if(!this.provider||!this._signMessage||!this.type)throw new Error("Provider is not initialized.");return await c({message:r,handleSignMessage:this._signMessage.bind(this.provider),cancelAction:this.provider.cancelAction.bind(this.provider),providerType:e[this.type]})};this.type=r}cancelAction(){return this.provider?.cancelAction?.bind(this.provider)()}};export{g as a};
2
- //# sourceMappingURL=chunk-42SCXW2U.mjs.map
1
+ import{a as d}from"./chunk-VLHG5NVE.mjs";import{a as c}from"./chunk-RCBOU6TT.mjs";import{a as p}from"./chunk-DGXP3AZR.mjs";import{a}from"./chunk-CBIH5QMT.mjs";import{u as o}from"./chunk-CN4RHVUE.mjs";import{b as n}from"./chunk-SAAOQW7P.mjs";import{a as e}from"./chunk-2X7ENE6Y.mjs";import{IframeProvider as l}from"@multiversx/sdk-web-wallet-iframe-provider/out";var g=class extends d{constructor({type:r,address:i}){super(i);this.provider=null;this.type=null;this._signTransactions=null;this._signMessage=null;this.createProvider=async()=>{this.initialize();let r=n(o());if(!this.type)throw new Error("Invalid provider type.");return this.provider||(this.provider=l.getInstance(),await this.provider.init()),this.provider.setLoginType(this.type),this.provider.setWalletUrl(String(r.iframeWalletAddress)),this._signTransactions=this.provider.signTransactions.bind(this.provider),this._signMessage=this.provider.signMessage.bind(this.provider),this._login=this.provider.login.bind(this.provider),this.buildProvider()};this.buildProvider=()=>{let{address:r}=a();if(!this.provider)throw new Error("Provider is not initialized.");let i=this.provider;return i.setAccount({address:this.address||r}),i.signTransactions=this.signTransactions,i.signMessage=this.signMessage,i.login=this.login,i.cancelLogin=this.cancelLogin,i};this.signTransactions=async r=>{if(!this.provider||!this._signTransactions)throw new Error("Provider is not initialized.");let{manager:i,onClose:s}=await p({cancelAction:this.provider.cancelAction.bind(this.provider)});i.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",s),this.type&&i.updateData({name:e.iframe,type:this.type});try{return await this._signTransactions(r)}catch(t){throw await s({shouldCancelAction:!0}),t}finally{i.closeUI()}};this.signMessage=async r=>{if(!this.provider||!this._signMessage||!this.type)throw new Error("Provider is not initialized.");return await c({message:r,handleSignMessage:this._signMessage.bind(this.provider),cancelAction:this.provider.cancelAction.bind(this.provider),providerType:e[this.type]})};this.type=r}cancelAction(){return this.provider?.cancelAction?.bind(this.provider)()}};export{g as a};
2
+ //# sourceMappingURL=chunk-67X3ORNS.mjs.map