@multiversx/sdk-dapp 5.1.4-alpha.1 → 5.1.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 (372) hide show
  1. package/README.md +36 -31
  2. package/out/__chunks__/{chunk-I36BPJED.mjs → chunk-3GZLHBMS.mjs} +2 -2
  3. package/out/__chunks__/chunk-4SJNM6SL.mjs +2 -0
  4. package/out/__chunks__/{chunk-BXVNRLKE.mjs → chunk-5JYWEIVX.mjs} +2 -2
  5. package/out/__chunks__/{chunk-55YZ3IRW.mjs → chunk-5MTV6BYP.mjs} +2 -2
  6. package/out/__chunks__/chunk-6IP7LJSW.mjs +2 -0
  7. package/out/__chunks__/{chunk-V4O3VRWA.mjs → chunk-6M6WCTHW.mjs} +2 -2
  8. package/out/__chunks__/{chunk-B3NG2NOR.mjs → chunk-72FLAB3J.mjs} +2 -2
  9. package/out/__chunks__/chunk-7AU7TZJF.mjs +2 -0
  10. package/out/__chunks__/{chunk-TY7QG7ZT.mjs → chunk-7DECU3EO.mjs} +2 -2
  11. package/out/__chunks__/{chunk-RTADPQGR.mjs → chunk-7ZARUNA4.mjs} +2 -2
  12. package/out/__chunks__/{chunk-X2YQF6XJ.mjs → chunk-AN65FUBF.mjs} +2 -2
  13. package/out/__chunks__/{chunk-KP6LJO7T.mjs → chunk-AN7WTTXJ.mjs} +2 -2
  14. package/out/__chunks__/{chunk-N3F2ZVI3.mjs → chunk-APLLFKCG.mjs} +2 -2
  15. package/out/__chunks__/{chunk-F6JS7XZN.mjs → chunk-ARKNESS3.mjs} +2 -2
  16. package/out/__chunks__/{chunk-UTBU4OCC.mjs → chunk-BMB5EBCD.mjs} +2 -2
  17. package/out/__chunks__/{chunk-A4QPQK4N.mjs → chunk-BN6QVD7B.mjs} +2 -2
  18. package/out/__chunks__/{chunk-63KWCFPE.mjs → chunk-BZ7SOBES.mjs} +2 -2
  19. package/out/__chunks__/{chunk-B3MJTLY7.mjs → chunk-C43JUIS3.mjs} +2 -2
  20. package/out/__chunks__/{chunk-EUUARGU3.mjs → chunk-C6NQEN6N.mjs} +2 -2
  21. package/out/__chunks__/{chunk-OYHNC7AV.mjs → chunk-CDFO2GVK.mjs} +2 -2
  22. package/out/__chunks__/{chunk-OMOTZPAR.mjs → chunk-CS5BSVSE.mjs} +2 -2
  23. package/out/__chunks__/chunk-D3KKYOYF.mjs +2 -0
  24. package/out/__chunks__/chunk-DGHPHAOS.mjs +2 -0
  25. package/out/__chunks__/{chunk-JVUXLR26.mjs → chunk-FBE76A3W.mjs} +2 -2
  26. package/out/__chunks__/{chunk-4I6XFBRI.mjs → chunk-G36BWGZR.mjs} +2 -2
  27. package/out/__chunks__/chunk-GE6T2B4E.mjs +2 -0
  28. package/out/__chunks__/{chunk-QQBMLLIQ.mjs → chunk-GUD6RECQ.mjs} +2 -2
  29. package/out/__chunks__/chunk-HBB7HL5B.mjs +2 -0
  30. package/out/__chunks__/{chunk-3ZM355SG.mjs → chunk-HD6OPS7Q.mjs} +2 -2
  31. package/out/__chunks__/{chunk-T7MRWPJP.mjs → chunk-HFN44NHN.mjs} +2 -2
  32. package/out/__chunks__/{chunk-ROGNJB62.mjs → chunk-HFYBB326.mjs} +2 -2
  33. package/out/__chunks__/{chunk-B2CRU44C.mjs → chunk-HLEGJP45.mjs} +2 -2
  34. package/out/__chunks__/chunk-HO2Y34SD.mjs +2 -0
  35. package/out/__chunks__/{chunk-7RHFBSVM.mjs → chunk-IAQCHY3X.mjs} +2 -2
  36. package/out/__chunks__/chunk-ICF2MAYU.mjs +2 -0
  37. package/out/__chunks__/{chunk-INYX52TZ.mjs.map → chunk-ICF2MAYU.mjs.map} +1 -1
  38. package/out/__chunks__/chunk-IJT27EFF.mjs +2 -0
  39. package/out/__chunks__/{chunk-PQCYKEZA.mjs → chunk-IKCEIZK2.mjs} +2 -2
  40. package/out/__chunks__/{chunk-LWQZ3ODY.mjs → chunk-ISHHMEWX.mjs} +2 -2
  41. package/out/__chunks__/{chunk-KBL2GVO3.mjs → chunk-JFRQ37WV.mjs} +2 -2
  42. package/out/__chunks__/{chunk-3MFQZN6P.mjs → chunk-JKXED2JJ.mjs} +2 -2
  43. package/out/__chunks__/chunk-KGFWVCB5.mjs +2 -0
  44. package/out/__chunks__/{chunk-NDP6HUYZ.mjs → chunk-L5G2CINO.mjs} +2 -2
  45. package/out/__chunks__/{chunk-ASFSZP4U.mjs → chunk-L6FN2IMQ.mjs} +2 -2
  46. package/out/__chunks__/{chunk-I5S54KA7.mjs → chunk-L6P6YGKR.mjs} +2 -2
  47. package/out/__chunks__/{chunk-MBJNMOHO.mjs → chunk-LBCZDKL3.mjs} +2 -2
  48. package/out/__chunks__/{chunk-Z6LX4L3O.mjs → chunk-LNKBLVKB.mjs} +2 -2
  49. package/out/__chunks__/{chunk-4H4K46HN.mjs → chunk-MBHXPTPF.mjs} +2 -2
  50. package/out/__chunks__/chunk-MKUAKB6R.mjs +2 -0
  51. package/out/__chunks__/{chunk-7IS6C4WK.mjs → chunk-MQE7EP66.mjs} +2 -2
  52. package/out/__chunks__/{chunk-CWRVJWQD.mjs → chunk-MVFIZ2UW.mjs} +2 -2
  53. package/out/__chunks__/{chunk-G4SHHDV6.mjs → chunk-MZZNZFMX.mjs} +2 -2
  54. package/out/__chunks__/{chunk-XOM5JS7L.mjs → chunk-NVA7A4D6.mjs} +2 -2
  55. package/out/__chunks__/{chunk-II4C2MOU.mjs → chunk-QG4OP5CW.mjs} +2 -2
  56. package/out/__chunks__/{chunk-QJAIPDD6.mjs → chunk-QNGOARJQ.mjs} +2 -2
  57. package/out/__chunks__/{chunk-2B3CQJ7O.mjs → chunk-QRW74BOT.mjs} +2 -2
  58. package/out/__chunks__/{chunk-O2C5YGWB.mjs → chunk-QUX36OME.mjs} +2 -2
  59. package/out/__chunks__/{chunk-POLYR7OE.mjs → chunk-QXV4PPZE.mjs} +2 -2
  60. package/out/__chunks__/chunk-R3XFYXKM.mjs +2 -0
  61. package/out/__chunks__/{chunk-64YE7QJ5.mjs → chunk-RKIJSY5U.mjs} +2 -2
  62. package/out/__chunks__/{chunk-LRJNWYVD.mjs → chunk-RPHY4POK.mjs} +2 -2
  63. package/out/__chunks__/{chunk-SIRVEQCG.mjs → chunk-TBV26EXY.mjs} +2 -2
  64. package/out/__chunks__/{chunk-7M2YZAHW.mjs → chunk-TF3E3RUT.mjs} +2 -2
  65. package/out/__chunks__/{chunk-RUWJKSCI.mjs → chunk-U4LAMKLU.mjs} +2 -2
  66. package/out/__chunks__/chunk-UKC2J7S5.mjs +2 -0
  67. package/out/__chunks__/{chunk-OI62R74K.mjs → chunk-USYO34PE.mjs} +2 -2
  68. package/out/__chunks__/{chunk-3PH6XWVJ.mjs → chunk-UZSATXTQ.mjs} +2 -2
  69. package/out/__chunks__/chunk-VFIT554C.mjs +2 -0
  70. package/out/__chunks__/{chunk-AHF2YGLI.mjs → chunk-WFSFMRX4.mjs} +2 -2
  71. package/out/__chunks__/{chunk-FDXRQC6M.mjs → chunk-WIH2HALG.mjs} +2 -2
  72. package/out/__chunks__/{chunk-6MVIMW4U.mjs → chunk-WJEJIGZL.mjs} +2 -2
  73. package/out/__chunks__/chunk-WJMZWKHU.mjs +2 -0
  74. package/out/__chunks__/{chunk-GFBHBIES.mjs → chunk-WV7M6B7H.mjs} +2 -2
  75. package/out/__chunks__/{chunk-FJNU5VL6.mjs → chunk-XNFTD5SG.mjs} +2 -2
  76. package/out/__chunks__/{chunk-PPH3RDAS.mjs → chunk-XOZA4RC2.mjs} +2 -2
  77. package/out/__chunks__/{chunk-VNLWRVNS.mjs → chunk-XSQDQMCL.mjs} +2 -2
  78. package/out/__chunks__/{chunk-RQAJIFZS.mjs → chunk-YKKA4F3Z.mjs} +2 -2
  79. package/out/__chunks__/{chunk-2SQW3ZE6.mjs → chunk-YWZJG5RG.mjs} +2 -2
  80. package/out/__chunks__/{chunk-JRF2RFTC.mjs → chunk-Z3I5UBKJ.mjs} +2 -2
  81. package/out/__chunks__/{chunk-X6K7QVBT.mjs → chunk-ZN3MQVUF.mjs} +2 -2
  82. package/out/apiCalls/account/getScamAddressData.mjs +1 -1
  83. package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
  84. package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
  85. package/out/apiCalls/index.mjs +1 -1
  86. package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
  87. package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
  88. package/out/apiCalls/tokens/index.mjs +1 -1
  89. package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
  90. package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
  91. package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
  92. package/out/constants/browser.constants.mjs +1 -1
  93. package/out/constants/index.mjs +1 -1
  94. package/out/constants/storage.constants.mjs +1 -1
  95. package/out/constants/window.constants.cjs +1 -1
  96. package/out/constants/window.constants.cjs.map +1 -1
  97. package/out/constants/window.constants.mjs +1 -1
  98. package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
  99. package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
  100. package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
  101. package/out/controllers/TransactionsTableController/index.mjs +1 -1
  102. package/out/index.mjs +1 -1
  103. package/out/lib/sdkDappUi.mjs +1 -1
  104. package/out/managers/LogoutManager/LogoutManager.mjs +1 -1
  105. package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
  106. package/out/managers/NotificationsFeedManager/index.mjs +1 -1
  107. package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
  108. package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
  109. package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
  110. package/out/managers/TransactionManager/index.mjs +1 -1
  111. package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
  112. package/out/managers/UnlockPanelManager/index.mjs +1 -1
  113. package/out/managers/index.mjs +1 -1
  114. package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
  115. package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
  116. package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
  117. package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
  118. package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
  119. package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
  120. package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
  121. package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
  122. package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
  123. package/out/managers/internal/ToastManager/ToastManager.mjs +1 -1
  124. package/out/managers/internal/ToastManager/helpers/LifetimeManager.mjs +1 -1
  125. package/out/managers/internal/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
  126. package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
  127. package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.mjs +1 -1
  128. package/out/managers/internal/WalletConnectStateManager/index.mjs +1 -1
  129. package/out/managers/internal/index.mjs +1 -1
  130. package/out/methods/account/getAccount.mjs +1 -1
  131. package/out/methods/account/getAccountInfo.mjs +1 -1
  132. package/out/methods/account/getAddress.mjs +1 -1
  133. package/out/methods/account/getIsLoggedIn.mjs +1 -1
  134. package/out/methods/account/getLatestNonce.mjs +1 -1
  135. package/out/methods/initApp/gastStationMetadata/setGasStationMetadata.mjs +1 -1
  136. package/out/methods/initApp/initApp.mjs +1 -1
  137. package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
  138. package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
  139. package/out/methods/loginInfo/getLoginInfo.mjs +1 -1
  140. package/out/methods/network/getEgldLabel.mjs +1 -1
  141. package/out/methods/network/getExplorerAddress.mjs +1 -1
  142. package/out/methods/network/getNetworkConfig.mjs +1 -1
  143. package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.mjs +1 -1
  144. package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.mjs +1 -1
  145. package/out/methods/trackTransactions/helpers/checkTransactionStatus/index.mjs +1 -1
  146. package/out/methods/trackTransactions/helpers/checkTransactionStatus/manageFailedTransactions.mjs +1 -1
  147. package/out/methods/trackTransactions/helpers/getPollingInterval.mjs +1 -1
  148. package/out/methods/trackTransactions/trackTransactions.mjs +1 -1
  149. package/out/methods/transactions/getFailedTransactions.mjs +1 -1
  150. package/out/methods/transactions/getFailedTransactionsSessions.mjs +1 -1
  151. package/out/methods/transactions/getPendingTransactions.mjs +1 -1
  152. package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
  153. package/out/methods/transactions/getSuccessfulTransactions.mjs +1 -1
  154. package/out/methods/transactions/getSuccessfulTransactionsSessions.mjs +1 -1
  155. package/out/methods/transactions/getTransactionSessions.mjs +1 -1
  156. package/out/providers/DappProvider/DappProvider.mjs +1 -1
  157. package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
  158. package/out/providers/DappProvider/helpers/login/helpers/extractAddressFromToken.mjs +1 -1
  159. package/out/providers/DappProvider/helpers/login/helpers/getAccountFromToken.mjs +1 -1
  160. package/out/providers/DappProvider/helpers/login/helpers/getModifiedLoginToken.mjs +1 -1
  161. package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
  162. package/out/providers/DappProvider/helpers/logout/logout.mjs +1 -1
  163. package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
  164. package/out/providers/DappProvider/helpers/signMessage/signMessageWithProvider.mjs +1 -1
  165. package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
  166. package/out/providers/DappProvider/index.mjs +1 -1
  167. package/out/providers/ProviderFactory.mjs +1 -1
  168. package/out/providers/helpers/accountProvider.mjs +1 -1
  169. package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
  170. package/out/providers/helpers/restoreProvider.mjs +1 -1
  171. package/out/providers/index.mjs +1 -1
  172. package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
  173. package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
  174. package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
  175. package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
  176. package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
  177. package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
  178. package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
  179. package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
  180. package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
  181. package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
  182. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
  183. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
  184. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
  185. package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
  186. package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
  187. package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
  188. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
  189. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
  190. package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
  191. package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.mjs +1 -1
  192. package/out/providers/strategies/WalletConnectProviderStrategy/index.mjs +1 -1
  193. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs +1 -1
  194. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs +1 -1
  195. package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.mjs +1 -1
  196. package/out/providers/strategies/WebviewProviderStrategy/index.mjs +1 -1
  197. package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
  198. package/out/providers/strategies/helpers/index.mjs +1 -1
  199. package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
  200. package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
  201. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
  202. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
  203. package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
  204. package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +1 -1
  205. package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
  206. package/out/providers/strategies/index.mjs +1 -1
  207. package/out/react/account/useGetAccount.mjs +1 -1
  208. package/out/react/account/useGetAccountInfo.mjs +1 -1
  209. package/out/react/account/useGetIsLoggedIn.mjs +1 -1
  210. package/out/react/account/useGetLatestNonce.mjs +1 -1
  211. package/out/react/index.mjs +1 -1
  212. package/out/react/loginInfo/useGetLoginInfo.mjs +1 -1
  213. package/out/react/network/useGetNetworkConfig.mjs +1 -1
  214. package/out/react/store/getReactStore.mjs +1 -1
  215. package/out/react/store/useSelector.mjs +1 -1
  216. package/out/react/transactions/useGetFailedTransactions.mjs +1 -1
  217. package/out/react/transactions/useGetFailedTransactionsSessions.mjs +1 -1
  218. package/out/react/transactions/useGetPendingTransactions.mjs +1 -1
  219. package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
  220. package/out/react/transactions/useGetSuccessfulTransactions.mjs +1 -1
  221. package/out/react/transactions/useGetSuccessfulTransactionsSessions.mjs +1 -1
  222. package/out/react/transactions/useGetTransactionSessions.mjs +1 -1
  223. package/out/services/index.mjs +1 -1
  224. package/out/services/nativeAuth/index.mjs +1 -1
  225. package/out/services/nativeAuth/methods/buildNativeAuthConfig.mjs +1 -1
  226. package/out/services/nativeAuth/methods/getDefaultNativeAuthConfig.mjs +1 -1
  227. package/out/services/nativeAuth/methods/index.mjs +1 -1
  228. package/out/services/nativeAuth/nativeAuth.mjs +1 -1
  229. package/out/store/actions/account/accountActions.mjs +1 -1
  230. package/out/store/actions/account/index.mjs +1 -1
  231. package/out/store/actions/cache/cacheActions.mjs +1 -1
  232. package/out/store/actions/cache/index.mjs +1 -1
  233. package/out/store/actions/config/configActions.mjs +1 -1
  234. package/out/store/actions/config/index.mjs +1 -1
  235. package/out/store/actions/index.mjs +1 -1
  236. package/out/store/actions/loginInfo/loginInfoActions.mjs +1 -1
  237. package/out/store/actions/network/index.mjs +1 -1
  238. package/out/store/actions/network/initializeNetwork.mjs +1 -1
  239. package/out/store/actions/network/networkActions.mjs +1 -1
  240. package/out/store/actions/sharedActions/index.mjs +1 -1
  241. package/out/store/actions/sharedActions/sharedActions.mjs +1 -1
  242. package/out/store/actions/toasts/index.mjs +1 -1
  243. package/out/store/actions/toasts/toastsActions.mjs +1 -1
  244. package/out/store/actions/transactions/transactionsActions.mjs +1 -1
  245. package/out/store/actions/ui/index.mjs +1 -1
  246. package/out/store/actions/ui/uiActions.mjs +1 -1
  247. package/out/store/middleware/applyMiddlewares.mjs +1 -1
  248. package/out/store/middleware/index.mjs +1 -1
  249. package/out/store/middleware/logoutMiddleware.mjs +1 -1
  250. package/out/store/storage/index.mjs +1 -1
  251. package/out/store/storage/storageCallback.mjs +1 -1
  252. package/out/store/store.mjs +1 -1
  253. package/out/utils/ComponentFactory.mjs +1 -1
  254. package/out/utils/account/index.mjs +1 -1
  255. package/out/utils/account/refreshAccount.mjs +1 -1
  256. package/out/utils/account/refreshNativeAuthTokenLogin.mjs +1 -1
  257. package/out/utils/index.mjs +1 -1
  258. package/out/utils/transactions/getActiveTransactionsStatus.mjs +1 -1
  259. package/out/utils/transactions/getInterpretedTransaction/getInterpretedTransaction.mjs +1 -1
  260. package/out/utils/transactions/getInterpretedTransaction/helpers/getLockedAccountName.mjs +1 -1
  261. package/out/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.mjs +1 -1
  262. package/out/utils/transactions/getInterpretedTransaction/helpers/getShardText.mjs +1 -1
  263. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionIconInfo.mjs +1 -1
  264. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionMessages.mjs +1 -1
  265. package/out/utils/transactions/getInterpretedTransaction/helpers/index.mjs +1 -1
  266. package/out/utils/transactions/getInterpretedTransaction/index.mjs +1 -1
  267. package/out/utils/transactions/getTransactionsHistory/getTransactionsHistory.mjs +1 -1
  268. package/out/utils/transactions/getTransactionsHistory/helpers/getCachedTransactionListItem.mjs +1 -1
  269. package/out/utils/transactions/getTransactionsHistory/helpers/index.mjs +1 -1
  270. package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.mjs +1 -1
  271. package/out/utils/transactions/getTransactionsHistory/index.mjs +1 -1
  272. package/out/utils/transactions/index.mjs +1 -1
  273. package/out/utils/visual/index.mjs +1 -1
  274. package/out/utils/visual/switchTheme.mjs +1 -1
  275. package/out/utils/window/getIsInIframe.mjs +1 -1
  276. package/out/utils/window/getWindowParentOrigin.mjs +1 -1
  277. package/out/utils/window/index.mjs +1 -1
  278. package/package.json +21 -1
  279. package/out/__chunks__/chunk-3SEYG2TH.mjs +0 -2
  280. package/out/__chunks__/chunk-4GD5ESS7.mjs +0 -2
  281. package/out/__chunks__/chunk-4PCBHSAB.mjs +0 -2
  282. package/out/__chunks__/chunk-5ZCTLMZK.mjs +0 -2
  283. package/out/__chunks__/chunk-C6QF2PWC.mjs +0 -2
  284. package/out/__chunks__/chunk-CN47OMNH.mjs +0 -2
  285. package/out/__chunks__/chunk-GJPOP2QV.mjs +0 -2
  286. package/out/__chunks__/chunk-INYX52TZ.mjs +0 -2
  287. package/out/__chunks__/chunk-NTPPGGDC.mjs +0 -2
  288. package/out/__chunks__/chunk-ORC2SCXO.mjs +0 -2
  289. package/out/__chunks__/chunk-Q2MLVJSP.mjs +0 -2
  290. package/out/__chunks__/chunk-RHB4T45O.mjs +0 -2
  291. package/out/__chunks__/chunk-SKPK57EU.mjs +0 -2
  292. package/out/__chunks__/chunk-U2UYK54X.mjs +0 -2
  293. package/out/__chunks__/chunk-VZSWUP43.mjs +0 -2
  294. package/out/__chunks__/chunk-ZOVDKYFX.mjs +0 -2
  295. /package/out/__chunks__/{chunk-I36BPJED.mjs.map → chunk-3GZLHBMS.mjs.map} +0 -0
  296. /package/out/__chunks__/{chunk-RHB4T45O.mjs.map → chunk-4SJNM6SL.mjs.map} +0 -0
  297. /package/out/__chunks__/{chunk-BXVNRLKE.mjs.map → chunk-5JYWEIVX.mjs.map} +0 -0
  298. /package/out/__chunks__/{chunk-55YZ3IRW.mjs.map → chunk-5MTV6BYP.mjs.map} +0 -0
  299. /package/out/__chunks__/{chunk-NTPPGGDC.mjs.map → chunk-6IP7LJSW.mjs.map} +0 -0
  300. /package/out/__chunks__/{chunk-V4O3VRWA.mjs.map → chunk-6M6WCTHW.mjs.map} +0 -0
  301. /package/out/__chunks__/{chunk-B3NG2NOR.mjs.map → chunk-72FLAB3J.mjs.map} +0 -0
  302. /package/out/__chunks__/{chunk-4GD5ESS7.mjs.map → chunk-7AU7TZJF.mjs.map} +0 -0
  303. /package/out/__chunks__/{chunk-TY7QG7ZT.mjs.map → chunk-7DECU3EO.mjs.map} +0 -0
  304. /package/out/__chunks__/{chunk-RTADPQGR.mjs.map → chunk-7ZARUNA4.mjs.map} +0 -0
  305. /package/out/__chunks__/{chunk-X2YQF6XJ.mjs.map → chunk-AN65FUBF.mjs.map} +0 -0
  306. /package/out/__chunks__/{chunk-KP6LJO7T.mjs.map → chunk-AN7WTTXJ.mjs.map} +0 -0
  307. /package/out/__chunks__/{chunk-N3F2ZVI3.mjs.map → chunk-APLLFKCG.mjs.map} +0 -0
  308. /package/out/__chunks__/{chunk-F6JS7XZN.mjs.map → chunk-ARKNESS3.mjs.map} +0 -0
  309. /package/out/__chunks__/{chunk-UTBU4OCC.mjs.map → chunk-BMB5EBCD.mjs.map} +0 -0
  310. /package/out/__chunks__/{chunk-A4QPQK4N.mjs.map → chunk-BN6QVD7B.mjs.map} +0 -0
  311. /package/out/__chunks__/{chunk-63KWCFPE.mjs.map → chunk-BZ7SOBES.mjs.map} +0 -0
  312. /package/out/__chunks__/{chunk-B3MJTLY7.mjs.map → chunk-C43JUIS3.mjs.map} +0 -0
  313. /package/out/__chunks__/{chunk-EUUARGU3.mjs.map → chunk-C6NQEN6N.mjs.map} +0 -0
  314. /package/out/__chunks__/{chunk-OYHNC7AV.mjs.map → chunk-CDFO2GVK.mjs.map} +0 -0
  315. /package/out/__chunks__/{chunk-OMOTZPAR.mjs.map → chunk-CS5BSVSE.mjs.map} +0 -0
  316. /package/out/__chunks__/{chunk-ORC2SCXO.mjs.map → chunk-D3KKYOYF.mjs.map} +0 -0
  317. /package/out/__chunks__/{chunk-VZSWUP43.mjs.map → chunk-DGHPHAOS.mjs.map} +0 -0
  318. /package/out/__chunks__/{chunk-JVUXLR26.mjs.map → chunk-FBE76A3W.mjs.map} +0 -0
  319. /package/out/__chunks__/{chunk-4I6XFBRI.mjs.map → chunk-G36BWGZR.mjs.map} +0 -0
  320. /package/out/__chunks__/{chunk-GJPOP2QV.mjs.map → chunk-GE6T2B4E.mjs.map} +0 -0
  321. /package/out/__chunks__/{chunk-QQBMLLIQ.mjs.map → chunk-GUD6RECQ.mjs.map} +0 -0
  322. /package/out/__chunks__/{chunk-5ZCTLMZK.mjs.map → chunk-HBB7HL5B.mjs.map} +0 -0
  323. /package/out/__chunks__/{chunk-3ZM355SG.mjs.map → chunk-HD6OPS7Q.mjs.map} +0 -0
  324. /package/out/__chunks__/{chunk-T7MRWPJP.mjs.map → chunk-HFN44NHN.mjs.map} +0 -0
  325. /package/out/__chunks__/{chunk-ROGNJB62.mjs.map → chunk-HFYBB326.mjs.map} +0 -0
  326. /package/out/__chunks__/{chunk-B2CRU44C.mjs.map → chunk-HLEGJP45.mjs.map} +0 -0
  327. /package/out/__chunks__/{chunk-SKPK57EU.mjs.map → chunk-HO2Y34SD.mjs.map} +0 -0
  328. /package/out/__chunks__/{chunk-7RHFBSVM.mjs.map → chunk-IAQCHY3X.mjs.map} +0 -0
  329. /package/out/__chunks__/{chunk-U2UYK54X.mjs.map → chunk-IJT27EFF.mjs.map} +0 -0
  330. /package/out/__chunks__/{chunk-PQCYKEZA.mjs.map → chunk-IKCEIZK2.mjs.map} +0 -0
  331. /package/out/__chunks__/{chunk-LWQZ3ODY.mjs.map → chunk-ISHHMEWX.mjs.map} +0 -0
  332. /package/out/__chunks__/{chunk-KBL2GVO3.mjs.map → chunk-JFRQ37WV.mjs.map} +0 -0
  333. /package/out/__chunks__/{chunk-3MFQZN6P.mjs.map → chunk-JKXED2JJ.mjs.map} +0 -0
  334. /package/out/__chunks__/{chunk-3SEYG2TH.mjs.map → chunk-KGFWVCB5.mjs.map} +0 -0
  335. /package/out/__chunks__/{chunk-NDP6HUYZ.mjs.map → chunk-L5G2CINO.mjs.map} +0 -0
  336. /package/out/__chunks__/{chunk-ASFSZP4U.mjs.map → chunk-L6FN2IMQ.mjs.map} +0 -0
  337. /package/out/__chunks__/{chunk-I5S54KA7.mjs.map → chunk-L6P6YGKR.mjs.map} +0 -0
  338. /package/out/__chunks__/{chunk-MBJNMOHO.mjs.map → chunk-LBCZDKL3.mjs.map} +0 -0
  339. /package/out/__chunks__/{chunk-Z6LX4L3O.mjs.map → chunk-LNKBLVKB.mjs.map} +0 -0
  340. /package/out/__chunks__/{chunk-4H4K46HN.mjs.map → chunk-MBHXPTPF.mjs.map} +0 -0
  341. /package/out/__chunks__/{chunk-4PCBHSAB.mjs.map → chunk-MKUAKB6R.mjs.map} +0 -0
  342. /package/out/__chunks__/{chunk-7IS6C4WK.mjs.map → chunk-MQE7EP66.mjs.map} +0 -0
  343. /package/out/__chunks__/{chunk-CWRVJWQD.mjs.map → chunk-MVFIZ2UW.mjs.map} +0 -0
  344. /package/out/__chunks__/{chunk-G4SHHDV6.mjs.map → chunk-MZZNZFMX.mjs.map} +0 -0
  345. /package/out/__chunks__/{chunk-XOM5JS7L.mjs.map → chunk-NVA7A4D6.mjs.map} +0 -0
  346. /package/out/__chunks__/{chunk-II4C2MOU.mjs.map → chunk-QG4OP5CW.mjs.map} +0 -0
  347. /package/out/__chunks__/{chunk-QJAIPDD6.mjs.map → chunk-QNGOARJQ.mjs.map} +0 -0
  348. /package/out/__chunks__/{chunk-2B3CQJ7O.mjs.map → chunk-QRW74BOT.mjs.map} +0 -0
  349. /package/out/__chunks__/{chunk-O2C5YGWB.mjs.map → chunk-QUX36OME.mjs.map} +0 -0
  350. /package/out/__chunks__/{chunk-POLYR7OE.mjs.map → chunk-QXV4PPZE.mjs.map} +0 -0
  351. /package/out/__chunks__/{chunk-ZOVDKYFX.mjs.map → chunk-R3XFYXKM.mjs.map} +0 -0
  352. /package/out/__chunks__/{chunk-64YE7QJ5.mjs.map → chunk-RKIJSY5U.mjs.map} +0 -0
  353. /package/out/__chunks__/{chunk-LRJNWYVD.mjs.map → chunk-RPHY4POK.mjs.map} +0 -0
  354. /package/out/__chunks__/{chunk-SIRVEQCG.mjs.map → chunk-TBV26EXY.mjs.map} +0 -0
  355. /package/out/__chunks__/{chunk-7M2YZAHW.mjs.map → chunk-TF3E3RUT.mjs.map} +0 -0
  356. /package/out/__chunks__/{chunk-RUWJKSCI.mjs.map → chunk-U4LAMKLU.mjs.map} +0 -0
  357. /package/out/__chunks__/{chunk-C6QF2PWC.mjs.map → chunk-UKC2J7S5.mjs.map} +0 -0
  358. /package/out/__chunks__/{chunk-OI62R74K.mjs.map → chunk-USYO34PE.mjs.map} +0 -0
  359. /package/out/__chunks__/{chunk-3PH6XWVJ.mjs.map → chunk-UZSATXTQ.mjs.map} +0 -0
  360. /package/out/__chunks__/{chunk-CN47OMNH.mjs.map → chunk-VFIT554C.mjs.map} +0 -0
  361. /package/out/__chunks__/{chunk-AHF2YGLI.mjs.map → chunk-WFSFMRX4.mjs.map} +0 -0
  362. /package/out/__chunks__/{chunk-FDXRQC6M.mjs.map → chunk-WIH2HALG.mjs.map} +0 -0
  363. /package/out/__chunks__/{chunk-6MVIMW4U.mjs.map → chunk-WJEJIGZL.mjs.map} +0 -0
  364. /package/out/__chunks__/{chunk-Q2MLVJSP.mjs.map → chunk-WJMZWKHU.mjs.map} +0 -0
  365. /package/out/__chunks__/{chunk-GFBHBIES.mjs.map → chunk-WV7M6B7H.mjs.map} +0 -0
  366. /package/out/__chunks__/{chunk-FJNU5VL6.mjs.map → chunk-XNFTD5SG.mjs.map} +0 -0
  367. /package/out/__chunks__/{chunk-PPH3RDAS.mjs.map → chunk-XOZA4RC2.mjs.map} +0 -0
  368. /package/out/__chunks__/{chunk-VNLWRVNS.mjs.map → chunk-XSQDQMCL.mjs.map} +0 -0
  369. /package/out/__chunks__/{chunk-RQAJIFZS.mjs.map → chunk-YKKA4F3Z.mjs.map} +0 -0
  370. /package/out/__chunks__/{chunk-2SQW3ZE6.mjs.map → chunk-YWZJG5RG.mjs.map} +0 -0
  371. /package/out/__chunks__/{chunk-JRF2RFTC.mjs.map → chunk-Z3I5UBKJ.mjs.map} +0 -0
  372. /package/out/__chunks__/{chunk-X6K7QVBT.mjs.map → chunk-ZN3MQVUF.mjs.map} +0 -0
package/README.md CHANGED
@@ -50,6 +50,7 @@ or
50
50
  ```bash
51
51
  yarn add @multiversx/sdk-dapp
52
52
  ```
53
+
53
54
  > **Note:** Make sure you run your app on `https`, not `http`, otherwise some providers will not work.
54
55
 
55
56
  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/main/MIGRATION_GUIDE.md) and the [migration PR](https://github.com/multiversx/mx-template-dapp/pull/343) of Template Dapp
@@ -118,6 +119,7 @@ initApp(config).then(() => {
118
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: using the `UnlockPanelManager` and programmatic login using the `ProviderFactory`.
119
120
 
120
121
  #### 2.1 Using the `UnlockPanelManager`
122
+
121
123
  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.
122
124
 
123
125
  ```typescript
@@ -141,17 +143,18 @@ export const ConnectButton = () => {
141
143
  };
142
144
 
143
145
  ```
146
+
144
147
  Once the user has logged in, if `nativeAuth` is configured in the `initApp` method, an automatic logout will be performed upon native auth expiration. Before the actual logout is performed, the `LogoutManager` will show a warning toast to the user. This toast can be customized by passing a `tokenExpirationToastWarningSeconds` to the `nativeAuth` config.
145
148
 
146
149
  ```typescript
147
150
  // in initApp config
148
151
  const config: InitAppType = {
149
- // ...
150
- nativeAuth: {
152
+ // ...
153
+ nativeAuth: {
151
154
  expirySeconds: 30, // test auto logout after 30 seconds
152
155
  tokenExpirationToastWarningSeconds: 10 // show warning toast 10 seconds before auto logout
153
- },
154
- }
156
+ }
157
+ };
155
158
  ```
156
159
 
157
160
  You have the option to stop this behavior by calling `LogoutManager.getInstance().stop()` after the user has logged in.
@@ -162,11 +165,11 @@ import { LogoutManager } from '@multiversx/sdk-dapp/out/managers/LogoutManager/L
162
165
  loginHandler: () => {
163
166
  navigate('/dashboard');
164
167
  // optional, to stop the automatic logout upon native auth expiration
165
- LogoutManager.getInstance().stop();
168
+ LogoutManager.getInstance().stop();
166
169
  },
167
170
  ```
168
171
 
169
- 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.
172
+ 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.
170
173
 
171
174
  ```typescript
172
175
  export const AdvancedConnectButton = () => {
@@ -189,6 +192,7 @@ export const AdvancedConnectButton = () => {
189
192
  ```
190
193
 
191
194
  #### 2.2 Programatic login using the `ProviderFactory`
195
+
192
196
  If you want to login using your custom UI, you can link user actions to specific providers by calling the `ProviderFactory`.
193
197
 
194
198
  ```typescript
@@ -308,7 +312,6 @@ Then, to send the transactions, you need to use the `TransactionManager` class a
308
312
  import { TransactionManager } from '@multiversx/sdk-dapp/out/managers/TransactionManager';
309
313
  import type { TransactionsDisplayInfoType } from '@multiversx/sdk-dapp/out/types/transactions.types';
310
314
 
311
-
312
315
  const txManager = TransactionManager.getInstance();
313
316
 
314
317
  const sentTransactions = await txManager.send(signedTransactions);
@@ -317,16 +320,16 @@ const toastInformation: TransactionsDisplayInfoType = {
317
320
  processingMessage: 'Processing transactions',
318
321
  errorMessage: 'An error has occurred during transaction execution',
319
322
  successMessage: 'Transactions executed'
320
- }
323
+ };
321
324
 
322
325
  const sessionId = await txManager.track(sentTransactions, {
323
- transactionsDisplayInfo: toastInformation,
326
+ transactionsDisplayInfo: toastInformation
324
327
  });
325
328
  ```
326
329
 
327
330
  #### 4.3 Using the Notifications Feed
328
331
 
329
- 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.
332
+ 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.
330
333
  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.
331
334
 
332
335
  ```typescript
@@ -363,8 +366,7 @@ const store = getStore(); // or use useStore hook for reactivity
363
366
  const pendingSessions = pendingTransactionsSessionsSelector(store.getState());
364
367
  const allTransactionSessions = transactionsSliceSelector(store.getState());
365
368
 
366
- const isSessionIdPending =
367
- Object.keys(pendingSessions).includes(sessionId);
369
+ const isSessionIdPending = Object.keys(pendingSessions).includes(sessionId);
368
370
  const currentSession = allTransactionSessions[sessionId];
369
371
  const currentSessionStatus = currentSession?.status;
370
372
  const currentTransaction = currentSession?.transactions?.[0];
@@ -372,6 +374,7 @@ const currentTransactionStatus = currentTransaction?.status;
372
374
  ```
373
375
 
374
376
  #### 4.5 Logging out
377
+
375
378
  The user journey ends with calling the `provider.logout()` method.
376
379
 
377
380
  ```typescript
@@ -396,7 +399,6 @@ We have seen in the previous chapter what are the minimal steps to get up and ru
396
399
  Since these are mixtures of business logic and UI components, the library is split into several folders to make it easier to navigate.
397
400
  When inspecting the package, there is more content under `src`, but the folders of interest are:
398
401
 
399
-
400
402
  ```bash
401
403
  src/
402
404
  ├── apiCalls/ ### methods for interacting with the API
@@ -513,7 +515,7 @@ The transaction lifecycle consists of the following steps:
513
515
  | 7 | `getSuccessfulTransactions()` | returns an array of successful transactions | `useGetSuccessfulTransactions()`|
514
516
 
515
517
  5. **User feedback** is provided through toast notifications, which are triggered to inform about transactions' progress. Additional tracking details can be optionally displayed in the toast UI.
516
- There is an option to add custom toast messages by using the `createCustomToast` helper.
518
+ There is an option to add custom toast messages by using the `createCustomToast` helper.
517
519
 
518
520
  ```ts
519
521
  import { createRoot } from 'react-dom/client';
@@ -538,14 +540,19 @@ createCustomToast({
538
540
  message: 'This is a custom toast',
539
541
  title: 'My custom toast'
540
542
  });
541
-
543
+
544
+
545
+ // closing a custom toast
546
+ const toastManager = ToastManager.getInstance();
547
+ toastManager.closeToast('custom-toast') // toastId
542
548
 
543
549
  ```
544
550
 
545
551
  6. **Error Handling & Recovery** is done through a custom toast that prompts the user to take appropriate action.
546
552
 
547
553
  #### Methods
548
- ___
554
+
555
+ ---
549
556
 
550
557
  #### 1. Sending Transactions
551
558
 
@@ -579,12 +586,14 @@ import { TransactionManagerTrackOptionsType } from '@multiversx/sdk-dapp/out/man
579
586
 
580
587
  const options: TransactionManagerTrackOptionsType = {
581
588
  disableToasts: false, // `false` by default
582
- transactionsDisplayInfo: { // `undefined` by default
589
+ transactionsDisplayInfo: {
590
+ // `undefined` by default
583
591
  errorMessage: 'Failed adding stake',
584
592
  successMessage: 'Stake successfully added',
585
593
  processingMessage: 'Staking in progress'
586
594
  },
587
- sessionInformation: { // `undefined` by default. Use to perform additional actions based on the session information
595
+ sessionInformation: {
596
+ // `undefined` by default. Use to perform additional actions based on the session information
588
597
  stakeAmount: '1000000000000000000000000'
589
598
  }
590
599
  };
@@ -670,22 +679,21 @@ The business logic for these components is served by a controller. The component
670
679
  ```tsx
671
680
  import { TransactionsTableController } from '@multiversx/sdk-dapp/out/controllers/TransactionsTableController';
672
681
  import { MvxTransactionsTable } from '@multiversx/sdk-dapp-ui/react';
673
-
674
- const processedTransactions = await TransactionsTableController.processTransactions({
675
- address,
676
- egldLabel: network.egldLabel,
677
- explorerAddress: network.explorerAddress,
678
- transactions
679
- });
682
+
683
+ const processedTransactions =
684
+ await TransactionsTableController.processTransactions({
685
+ address,
686
+ egldLabel: network.egldLabel,
687
+ explorerAddress: network.explorerAddress,
688
+ transactions
689
+ });
680
690
 
681
691
  // and use like this:
682
692
  <MvxTransactionsTable transactions={processedTransaction} />;
683
-
684
693
  ```
685
694
 
686
695
  - `MvxFormatAmount` - used to format the amount of the user's balance
687
696
 
688
-
689
697
  ```tsx
690
698
  import { MvxFormatAmount } from '@multiversx/sdk-dapp-ui/react';
691
699
  import { MvxFormatAmountPropsType } from '@multiversx/sdk-dapp-ui/types';
@@ -693,9 +701,7 @@ export { DECIMALS, DIGITS } from '@multiversx/sdk-dapp-utils/out/constants';
693
701
  import { FormatAmountController } from '@multiversx/sdk-dapp/out/controllers/FormatAmountController';
694
702
  export { useGetNetworkConfig } from '@multiversx/sdk-dapp/out/react/network/useGetNetworkConfig';
695
703
 
696
-
697
- interface IFormatAmountProps
698
- extends Partial<MvxFormatAmountPropsType> {
704
+ interface IFormatAmountProps extends Partial<MvxFormatAmountPropsType> {
699
705
  value: string;
700
706
  className?: string;
701
707
  }
@@ -728,7 +734,6 @@ export const FormatAmount = (props: IFormatAmountProps) => {
728
734
  };
729
735
  ```
730
736
 
731
-
732
737
  #### 5.2 Internal components (advanced usage)
733
738
 
734
739
  The way internal components are controlled is through 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.
@@ -1,2 +1,2 @@
1
- import{j as p,q as e}from"./chunk-7IS6C4WK.mjs";import{c as i}from"./chunk-NTEMINYA.mjs";var T=()=>e().setState(p),a=({address:o,providerType:d})=>{e().setState(({account:r,loginInfo:t})=>{r.address=o,r.publicKey=new i(o).toHex(),t&&(t.providerType=d)},!1,"loginAction")};export{T as a,a as b};
2
- //# sourceMappingURL=chunk-I36BPJED.mjs.map
1
+ import{j as p,q as e}from"./chunk-MQE7EP66.mjs";import{c as i}from"./chunk-NTEMINYA.mjs";var T=()=>e().setState(p),a=({address:o,providerType:d})=>{e().setState(({account:r,loginInfo:t})=>{r.address=o,r.publicKey=new i(o).toHex(),t&&(t.providerType=d)},!1,"loginAction")};export{T as a,a as b};
2
+ //# sourceMappingURL=chunk-3GZLHBMS.mjs.map
@@ -0,0 +1,2 @@
1
+ import{s as o}from"./chunk-MQE7EP66.mjs";import{b as t}from"./chunk-UERJ6AKK.mjs";function c(r=o()){return t(r)}export{c as a};
2
+ //# sourceMappingURL=chunk-4SJNM6SL.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as T}from"./chunk-Q2Q4XN4M.mjs";import{b as u}from"./chunk-LRJNWYVD.mjs";import{d as m,e as l}from"./chunk-RQAJIFZS.mjs";import{q as a}from"./chunk-7IS6C4WK.mjs";import{b as r}from"./chunk-SAAOQW7P.mjs";import{b as t}from"./chunk-GGBMHKR4.mjs";import{io as y}from"socket.io-client";var A=3e3,g=3,w=500,E=1e3,f="batchUpdated",p="connect",N="connect_error",b="disconnect";async function M(i){let{apiAddress:k,websocketUrl:I}=r(a().getState());if(!i)throw new Error("Websocket could not be initialized: address missing");let o=null,n=null,c=e=>{t.status=e,u(e)},d=e=>{o&&clearTimeout(o),o=setTimeout(()=>{m(e)},E)},C=e=>{n&&clearTimeout(n),n=setTimeout(()=>{l(e)},E)},W=()=>{let e=t.instance;e&&(e.off(N),e.off(p),e.off(f),e.off(b),e.close(),console.log("Websocket disconnected.")),c("not_initialized"),t.instance=null,o&&clearTimeout(o),n&&clearTimeout(n)},S=async()=>{c("pending");let e=I??await T(k);if(!e){c("not_initialized");return}t.instance=y(e,{forceNew:!0,reconnection:!0,reconnectionAttempts:g,reconnectionDelay:w,timeout:A,query:{address:i}}),t.instance.onAny(d),t.instance.on(f,C),t.instance.on(p,()=>{console.log("Websocket connected."),c("completed")}),t.instance.on(N,s=>{console.warn("Websocket connect error: ",s.message)}),t.instance.on(b,s=>{console.warn("Websocket disconnected: ",s),c("pending")})};return t.status==="not_initialized"&&!t.instance?.active&&await S(),{closeConnection:W}}export{M as a};
2
- //# sourceMappingURL=chunk-BXVNRLKE.mjs.map
1
+ import{a as T}from"./chunk-Q2Q4XN4M.mjs";import{b as u}from"./chunk-RPHY4POK.mjs";import{d as m,e as l}from"./chunk-YKKA4F3Z.mjs";import{q as a}from"./chunk-MQE7EP66.mjs";import{b as r}from"./chunk-SAAOQW7P.mjs";import{b as t}from"./chunk-GGBMHKR4.mjs";import{io as y}from"socket.io-client";var A=3e3,g=3,w=500,E=1e3,f="batchUpdated",p="connect",N="connect_error",b="disconnect";async function M(i){let{apiAddress:k,websocketUrl:I}=r(a().getState());if(!i)throw new Error("Websocket could not be initialized: address missing");let o=null,n=null,c=e=>{t.status=e,u(e)},d=e=>{o&&clearTimeout(o),o=setTimeout(()=>{m(e)},E)},C=e=>{n&&clearTimeout(n),n=setTimeout(()=>{l(e)},E)},W=()=>{let e=t.instance;e&&(e.off(N),e.off(p),e.off(f),e.off(b),e.close(),console.log("Websocket disconnected.")),c("not_initialized"),t.instance=null,o&&clearTimeout(o),n&&clearTimeout(n)},S=async()=>{c("pending");let e=I??await T(k);if(!e){c("not_initialized");return}t.instance=y(e,{forceNew:!0,reconnection:!0,reconnectionAttempts:g,reconnectionDelay:w,timeout:A,query:{address:i}}),t.instance.onAny(d),t.instance.on(f,C),t.instance.on(p,()=>{console.log("Websocket connected."),c("completed")}),t.instance.on(N,s=>{console.warn("Websocket connect error: ",s.message)}),t.instance.on(b,s=>{console.warn("Websocket disconnected: ",s),c("pending")})};return t.status==="not_initialized"&&!t.instance?.active&&await S(),{closeConnection:W}}export{M as a};
2
+ //# sourceMappingURL=chunk-5JYWEIVX.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-63KWCFPE.mjs";var c=class n extends i{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-ledger-connect"});this.addressesPerPage=10;this.allAccounts=[];this.initialConnectScreenData={};this.connectScreenData={...this.initialConnectScreenData};this.initialAccountScreenData={accounts:this.allAccounts,startIndex:0,addressesPerPage:this.addressesPerPage,isLoading:!0};this.accountScreenData={...this.initialAccountScreenData};this.initialConfirmScreenData={selectedAddress:"",explorerLink:""};this.confirmScreenData={...this.initialConfirmScreenData};this.initialData={connectScreenData:this.initialConnectScreenData,accountScreenData:this.initialAccountScreenData,confirmScreenData:this.initialConfirmScreenData};this.data=this.getInitialData()}static getInstance(){return n.instance||(n.instance=new n),n.instance}updateAllAccounts(e){this.allAccounts=e,this.accountScreenData.accounts=e}updateStartIndex(e){this.accountScreenData.startIndex=e}updateConnectScreen(e){this.connectScreenData={...this.connectScreenData,...e},this.data.confirmScreenData=null,this.data.accountScreenData=null,this.data.connectScreenData=this.connectScreenData,this.notifyDataUpdate()}updateAccountScreen(e){this.accountScreenData={...this.accountScreenData,...e},this.data.confirmScreenData=null,this.data.accountScreenData=this.accountScreenData,this.notifyDataUpdate()}updateConfirmScreen(e){this.confirmScreenData={...this.confirmScreenData,...e},this.data.accountScreenData=null,this.data.confirmScreenData=this.confirmScreenData,this.notifyDataUpdate()}getAccountScreenData(){return this.data.accountScreenData}getConfirmScreenData(){return this.data.confirmScreenData}getAllAccounts(){return this.allAccounts}subscribeToProviderInit({handleRetry:e,handleCancel:t}){this.eventBus&&(this.eventBus.subscribe("CONNECT_DEVICE",e),this.eventBus.subscribe("CLOSE",t),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}unsubscribeFromProviderInit({handleRetry:e,handleCancel:t}){this.eventBus&&(this.eventBus.unsubscribe("CONNECT_DEVICE",e),this.eventBus.unsubscribe("CLOSE",t),this.eventBus.unsubscribe("UI_DISCONNECTED",this.destroy.bind(this)))}subscribeToAuthEvents({handleCancel:e,handleAccessWallet:t,handleGoToPage:a}){this.eventBus&&(this.eventBus.subscribe("CLOSE",e),this.eventBus.subscribe("ACCESS_WALLET",t),this.eventBus.subscribe("GO_TO_PAGE",a))}unsubscribeFromAuthEvents({handleCancel:e,handleAccessWallet:t,handleGoToPage:a}){this.eventBus&&(this.eventBus.unsubscribe("CLOSE",e),this.eventBus.unsubscribe("ACCESS_WALLET",t),this.eventBus.unsubscribe("GO_TO_PAGE",a))}handleClose(){this.anchor?this.anchor?.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy()}resetData(){this.accountScreenData={...this.initialAccountScreenData},this.confirmScreenData={...this.initialConfirmScreenData},this.connectScreenData={...this.initialConnectScreenData},super.resetData()}async setupEventListeners(){this.eventBus&&this.eventBus.subscribe("CLOSE",this.handleClose.bind(this))}};export{c as a};
2
- //# sourceMappingURL=chunk-55YZ3IRW.mjs.map
1
+ import{a as i}from"./chunk-BZ7SOBES.mjs";var c=class n extends i{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-ledger-connect"});this.addressesPerPage=10;this.allAccounts=[];this.initialConnectScreenData={};this.connectScreenData={...this.initialConnectScreenData};this.initialAccountScreenData={accounts:this.allAccounts,startIndex:0,addressesPerPage:this.addressesPerPage,isLoading:!0};this.accountScreenData={...this.initialAccountScreenData};this.initialConfirmScreenData={selectedAddress:"",explorerLink:""};this.confirmScreenData={...this.initialConfirmScreenData};this.initialData={connectScreenData:this.initialConnectScreenData,accountScreenData:this.initialAccountScreenData,confirmScreenData:this.initialConfirmScreenData};this.data=this.getInitialData()}static getInstance(){return n.instance||(n.instance=new n),n.instance}updateAllAccounts(e){this.allAccounts=e,this.accountScreenData.accounts=e}updateStartIndex(e){this.accountScreenData.startIndex=e}updateConnectScreen(e){this.connectScreenData={...this.connectScreenData,...e},this.data.confirmScreenData=null,this.data.accountScreenData=null,this.data.connectScreenData=this.connectScreenData,this.notifyDataUpdate()}updateAccountScreen(e){this.accountScreenData={...this.accountScreenData,...e},this.data.confirmScreenData=null,this.data.accountScreenData=this.accountScreenData,this.notifyDataUpdate()}updateConfirmScreen(e){this.confirmScreenData={...this.confirmScreenData,...e},this.data.accountScreenData=null,this.data.confirmScreenData=this.confirmScreenData,this.notifyDataUpdate()}getAccountScreenData(){return this.data.accountScreenData}getConfirmScreenData(){return this.data.confirmScreenData}getAllAccounts(){return this.allAccounts}subscribeToProviderInit({handleRetry:e,handleCancel:t}){this.eventBus&&(this.eventBus.subscribe("CONNECT_DEVICE",e),this.eventBus.subscribe("CLOSE",t),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}unsubscribeFromProviderInit({handleRetry:e,handleCancel:t}){this.eventBus&&(this.eventBus.unsubscribe("CONNECT_DEVICE",e),this.eventBus.unsubscribe("CLOSE",t),this.eventBus.unsubscribe("UI_DISCONNECTED",this.destroy.bind(this)))}subscribeToAuthEvents({handleCancel:e,handleAccessWallet:t,handleGoToPage:a}){this.eventBus&&(this.eventBus.subscribe("CLOSE",e),this.eventBus.subscribe("ACCESS_WALLET",t),this.eventBus.subscribe("GO_TO_PAGE",a))}unsubscribeFromAuthEvents({handleCancel:e,handleAccessWallet:t,handleGoToPage:a}){this.eventBus&&(this.eventBus.unsubscribe("CLOSE",e),this.eventBus.unsubscribe("ACCESS_WALLET",t),this.eventBus.unsubscribe("GO_TO_PAGE",a))}handleClose(){this.anchor?this.anchor?.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy()}resetData(){this.accountScreenData={...this.initialAccountScreenData},this.confirmScreenData={...this.initialConfirmScreenData},this.connectScreenData={...this.initialConnectScreenData},super.resetData()}async setupEventListeners(){this.eventBus&&this.eventBus.subscribe("CLOSE",this.handleClose.bind(this))}};export{c as a};
2
+ //# sourceMappingURL=chunk-5MTV6BYP.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-UZSATXTQ.mjs";var o={async getTransactionsHistory(s){return await t(s)}};export{o as a};
2
+ //# sourceMappingURL=chunk-6IP7LJSW.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{q as u}from"./chunk-7IS6C4WK.mjs";import{a as c}from"./chunk-SQVKVA7X.mjs";import{a as i}from"./chunk-ULUZWP2P.mjs";var e=o=>u().setState(({network:r})=>{r.network={...r.network,...o}},!1,"initializeNetworkConfig");var y=async({customNetworkConfig:o={},environment:r})=>{let d=!o?.skipFetchFromServer,g=o?.apiAddress,n=r&&r in i,p=n?i[r]:{},s={...c,...p,...o},t={...s,apiTimeout:String(s.apiTimeout)},N=p?.apiAddress;if(!n&&d){let a=g||N,m=await w(a),f=t.roundDuration?null:await l(a);if(f!=null&&(t.roundDuration=f.erd_round_duration),m!=null){let k={...t,...m,...o};return e(k),k}}return e(t),t};export{y as a,e as b};
2
- //# sourceMappingURL=chunk-V4O3VRWA.mjs.map
1
+ import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{q as u}from"./chunk-MQE7EP66.mjs";import{a as c}from"./chunk-SQVKVA7X.mjs";import{a as i}from"./chunk-ULUZWP2P.mjs";var e=o=>u().setState(({network:r})=>{r.network={...r.network,...o}},!1,"initializeNetworkConfig");var y=async({customNetworkConfig:o={},environment:r})=>{let d=!o?.skipFetchFromServer,g=o?.apiAddress,n=r&&r in i,p=n?i[r]:{},s={...c,...p,...o},t={...s,apiTimeout:String(s.apiTimeout)},N=p?.apiAddress;if(!n&&d){let a=g||N,m=await w(a),f=t.roundDuration?null:await l(a);if(f!=null&&(t.roundDuration=f.erd_round_duration),m!=null){let k={...t,...m,...o};return e(k),k}}return e(t),t};export{y as a,e as b};
2
+ //# sourceMappingURL=chunk-6M6WCTHW.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-SUBC3H4J.mjs";import{a as t}from"./chunk-U64LDJTG.mjs";import{a as n}from"./chunk-SKPK57EU.mjs";import{s as e}from"./chunk-7IS6C4WK.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";var w=async r=>{let{isGuarded:i}=n();if(!s({isGuarded:i,transactions:r}))return r;let a=r[0].sender.toBech32(),{walletAddress:d}=o(e());return await(await t({address:a,walletUrl:d}))?.guardTransactions(r)||[]};export{w as a};
2
- //# sourceMappingURL=chunk-B3NG2NOR.mjs.map
1
+ import{a as s}from"./chunk-SUBC3H4J.mjs";import{a as t}from"./chunk-U64LDJTG.mjs";import{a as n}from"./chunk-HO2Y34SD.mjs";import{s as e}from"./chunk-MQE7EP66.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";var w=async r=>{let{isGuarded:i}=n();if(!s({isGuarded:i,transactions:r}))return r;let a=r[0].sender.toBech32(),{walletAddress:d}=o(e());return await(await t({address:a,walletUrl:d}))?.guardTransactions(r)||[]};export{w as a};
2
+ //# sourceMappingURL=chunk-72FLAB3J.mjs.map
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-2IUBMLF4.mjs";import{s as o}from"./chunk-MQE7EP66.mjs";import{e as t}from"./chunk-SAAOQW7P.mjs";function m(){let r=t(o());return r?Math.max(1e3,r/2):9e4}export{m as a};
2
+ //# sourceMappingURL=chunk-7AU7TZJF.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as w}from"./chunk-QXC4D3AC.mjs";import{a as g}from"./chunk-YGI3KXMZ.mjs";import{a as b}from"./chunk-Q2MLVJSP.mjs";import{a as m}from"./chunk-NZYB675D.mjs";import{f}from"./chunk-PJWJZHIS.mjs";import x from"bignumber.js";var F=async({manager:e,provider:d})=>{if(!e||!d)throw new Error("Provider is not initialized.");let{network:u}=b(),s=e.getAccountScreenData()?.startIndex||0,r=e.getAllAccounts(),a=await w({baseURL:u.apiAddress}),l=o=>o.index>=s&&o.index<s+e.addressesPerPage,I=r.reduce((o,n)=>Object.assign(o,{[n.index]:n}),{}),A=r.filter(l),y=!!I[s];if(e.updateAccountScreen({isLoading:!y}),A.length>0){e.updateAccountScreen({accounts:A});return}try{let o=Math.floor(s/e.addressesPerPage),n=await d.getAccounts(o,e.addressesPerPage),L=n.map((t,c)=>({address:t,balance:"...",index:c+s})),P=[...r,...L],h=n.map(t=>m({address:t,baseURL:u.apiAddress})),j=await Promise.all(h),i=P.reduce((t,c)=>Object.assign(t,{[c.address]:c}),{});j.forEach(t=>{if(!t||!a||!a.price)return;let c=new x(t.balance),S=c.dividedBy(x(10).pow(18)).toFormat(4).toString();if(c.isNaN())return;let U=g({amount:f({input:t.balance}),usd:a?.price});i[t.address].balance=S,i[t.address].usdValue=U});let p=Object.values(i).sort((t,c)=>t.index-c.index),O=p.filter(l);e.updateAllAccounts(p),e.updateAccountScreen({accounts:O,isLoading:!1})}catch(o){console.error("Failed to fetch accounts:",o)}};export{F as a};
2
- //# sourceMappingURL=chunk-TY7QG7ZT.mjs.map
1
+ import{a as w}from"./chunk-QXC4D3AC.mjs";import{a as g}from"./chunk-YGI3KXMZ.mjs";import{a as b}from"./chunk-WJMZWKHU.mjs";import{a as m}from"./chunk-NZYB675D.mjs";import{f}from"./chunk-PJWJZHIS.mjs";import x from"bignumber.js";var F=async({manager:e,provider:d})=>{if(!e||!d)throw new Error("Provider is not initialized.");let{network:u}=b(),s=e.getAccountScreenData()?.startIndex||0,r=e.getAllAccounts(),a=await w({baseURL:u.apiAddress}),l=o=>o.index>=s&&o.index<s+e.addressesPerPage,I=r.reduce((o,n)=>Object.assign(o,{[n.index]:n}),{}),A=r.filter(l),y=!!I[s];if(e.updateAccountScreen({isLoading:!y}),A.length>0){e.updateAccountScreen({accounts:A});return}try{let o=Math.floor(s/e.addressesPerPage),n=await d.getAccounts(o,e.addressesPerPage),L=n.map((t,c)=>({address:t,balance:"...",index:c+s})),P=[...r,...L],h=n.map(t=>m({address:t,baseURL:u.apiAddress})),j=await Promise.all(h),i=P.reduce((t,c)=>Object.assign(t,{[c.address]:c}),{});j.forEach(t=>{if(!t||!a||!a.price)return;let c=new x(t.balance),S=c.dividedBy(x(10).pow(18)).toFormat(4).toString();if(c.isNaN())return;let U=g({amount:f({input:t.balance}),usd:a?.price});i[t.address].balance=S,i[t.address].usdValue=U});let p=Object.values(i).sort((t,c)=>t.index-c.index),O=p.filter(l);e.updateAllAccounts(p),e.updateAccountScreen({accounts:O,isLoading:!1})}catch(o){console.error("Failed to fetch accounts:",o)}};export{F as a};
2
+ //# sourceMappingURL=chunk-7DECU3EO.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-DLWDO7M6.mjs";import{d as p}from"./chunk-X2YQF6XJ.mjs";import{v as n}from"./chunk-X6K7QVBT.mjs";import{s as m}from"./chunk-7IS6C4WK.mjs";import{d as t}from"./chunk-VNLGNNIL.mjs";import{a as e}from"./chunk-PLUWBWJ2.mjs";import{a as f}from"./chunk-AHF2YGLI.mjs";async function u(){let i=s(),o=f()||i?e.webview:t(m());if(!o)return;let r=await p.create({type:o});if(!r)throw new Error("Provider not found");(i||o===e.webview&&r.isInitialized())&&await r.login(),n(r)}export{u as a};
2
- //# sourceMappingURL=chunk-RTADPQGR.mjs.map
1
+ import{a as s}from"./chunk-DLWDO7M6.mjs";import{d as p}from"./chunk-AN65FUBF.mjs";import{v as n}from"./chunk-ZN3MQVUF.mjs";import{s as m}from"./chunk-MQE7EP66.mjs";import{d as t}from"./chunk-VNLGNNIL.mjs";import{a as e}from"./chunk-PLUWBWJ2.mjs";import{a as f}from"./chunk-WFSFMRX4.mjs";async function u(){let i=s(),o=f()||i?e.webview:t(m());if(!o)return;let r=await p.create({type:o});if(!r)throw new Error("Provider not found");(i||o===e.webview&&r.isInitialized())&&await r.login(),n(r)}export{u as a};
2
+ //# sourceMappingURL=chunk-7ZARUNA4.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as de}from"./chunk-M3YL36ZL.mjs";import{a as se}from"./chunk-AQ6D3F5K.mjs";import{a as te}from"./chunk-VNLWRVNS.mjs";import{a as U}from"./chunk-55YZ3IRW.mjs";import{a as ie}from"./chunk-II4C2MOU.mjs";import{a as re}from"./chunk-JVUXLR26.mjs";import{a as ee}from"./chunk-YUFPUG5O.mjs";import{a as ae}from"./chunk-3MFQZN6P.mjs";import{a as p}from"./chunk-OYHNC7AV.mjs";import{a as Z}from"./chunk-Z6LX4L3O.mjs";import{a as ne}from"./chunk-B3MJTLY7.mjs";import{a as oe}from"./chunk-B3NG2NOR.mjs";import{a as Q}from"./chunk-QJGFIK7H.mjs";import{b as J}from"./chunk-4Z3DZ2A3.mjs";import{b as I,c as Y}from"./chunk-NRXYSTRW.mjs";import{j as $,l as O,u as M,v as C,w as L}from"./chunk-X6K7QVBT.mjs";import{a as y}from"./chunk-T7MRWPJP.mjs";import{a as P}from"./chunk-VZSWUP43.mjs";import{a as q}from"./chunk-5ZCTLMZK.mjs";import{a as D}from"./chunk-4TBVQD27.mjs";import{a as X}from"./chunk-I36BPJED.mjs";import{g as K}from"./chunk-2IUBMLF4.mjs";import{a as F,q as j,s as l}from"./chunk-7IS6C4WK.mjs";import{f as R}from"./chunk-UERJ6AKK.mjs";import{b as E,c as V}from"./chunk-SAAOQW7P.mjs";import{a as B}from"./chunk-VNLGNNIL.mjs";import{b as H,c as G}from"./chunk-6JM4DPOH.mjs";import{a as c}from"./chunk-CDQ2BNUD.mjs";import{a as o}from"./chunk-PLUWBWJ2.mjs";import{IframeLoginTypes as pe}from"@multiversx/sdk-web-wallet-iframe-provider/out/constants";var f=class extends p{constructor({address:e,anchor:r,shouldInitProvider:t}){super(e);this.provider=null;this.config=null;this.ledgerLogin=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");if(!e||typeof e.addressIndex!="number")throw new Error("Missing addressIndex for Ledger login");let{address:r,signature:t}=await this.provider.login({addressIndex:e.addressIndex});return{address:r,signature:t??""}};this.loginOperation=async e=>{if(!this.provider||!this.config)throw new Error("Provider is not initialized.");return await te({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!P())return;await U.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ne({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ce({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await re({shouldInitProvider:!0});this.provider=r}catch(r){throw $({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.ledger}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){await this.initLegderConnectManager(this.options?.anchor);let e=U.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((n,s)=>ie({manager:e,resolve:n,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ve=3e4,me=5e3,he=3e3,S=class a{constructor(){this.store=j();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=B(i),r=R(i);return!!(e===o.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=J(l());if(!(!this.shouldCheckConnection()||i))try{await L().getProvider().getAddress()}catch{if(O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"times",iconClassName:"warning",message:"Unlock your device to continue signing transactions",title:"Ledger disconnected"}),this.reset(),this.recreateProviderInterval)return;this.recreateProviderInterval=setInterval(this.reconnectProvider,me)}},ve))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new f({shouldInitProvider:!0});await i.init();let e=new M(i);i.getType=()=>o.ledger,C(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:he,icon:"check",iconClassName:"success",message:"Your device is ready to sign transactions",title:"Ledger reconnected"}),this.startCheckConnectionLoop()}catch{console.log("Unable to reconnect to Ledger")}};this.reset=()=>{clearInterval(this.connectionCheckInterval??0),this.connectionCheckInterval=null}}static getInstance(){return a.instance||(a.instance=new a),a.instance}};var k=class extends p{constructor(e){super(e?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{onClose:r,manager:t}=await this.initSignState();try{let n=await this.provider.signTransactions(e)??[];return await oe(n)}catch(n){throw await r({shouldCancelAction:!0}),n}finally{t.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.crossWindow})};this.walletAddress=e?.walletAddress,this.provider=Q.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=E(l()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return o.crossWindow}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{ExtensionProvider as ue}from"@multiversx/sdk-extension-provider/out/extensionProvider";var z=class extends p{constructor(e){super(e);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)??[]}catch(n){throw await t({shouldCancelAction:!1}),n}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension})};this.provider=ue.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return o.extension}};var fe={passkey:o.passkey,metamask:o.metamask},T=class extends p{constructor({type:e,address:r,walletUrl:t}){super(r);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)}catch(n){throw await t({shouldCancelAction:!0}),n}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider||!this.type)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c[this.type]})};this.type=e,this.walletUrl=t??"",this.provider=de.getInstance(),this._login=this.provider.login.bind(this.provider)}init(){return this.initializeAddress(),this.initializeWalletUrl(),this.initializeProvider()}initializeWalletUrl(){if(this.walletUrl)return;let e=E(l());if(!e.iframeWalletAddress)throw new Error("Invalid walletUrl");this.walletUrl=e.iframeWalletAddress}async initializeProvider(){return await this.provider.init(),this.address&&this.setAccount({address:this.address}),this.provider.setLoginType(this.type),this.provider.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return fe[this.type]}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{OptionalOperation as ye}from"@multiversx/sdk-wallet-connect-provider/out";var le=[I.CANCEL_ACTION,I.SIGN_LOGIN_TOKEN],_=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;this.cancelActionAbortController=null;this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();this.cancelActionAbortController=new AbortController;let n=this.cancelActionAbortController.signal;try{let s=new Promise((h,v)=>{n.addEventListener("abort",()=>{v(new Error("cancelled by user"))})});return await Promise.race([this.provider.signTransactions(e),s])}catch(s){throw await t({shouldCancelAction:!0}),s}finally{r.closeUI()}};this.cancelAction=async()=>{this.sendCustomRequest({method:I.CANCEL_ACTION,action:ye.CANCEL_ACTION}),this.cancelActionAbortController?.abort()};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");this.cancelActionAbortController=new AbortController;let r=this.cancelActionAbortController.signal,t=new Promise((s,d)=>{r.addEventListener("abort",()=>{d(new Error("cancelled by user"))})});return await Promise.race([g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension}),t])};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.walletConnect}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return Promise.resolve(this.provider.getAddress())}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){if(await this.initWalletConnectManager(),!this.config)throw new Error("Invalid WalletConnect setup");let{walletConnectProvider:e,dappMethods:r}=await this.createWalletConnectProvider(this.config);this.provider=e,this.methods=r;let{uri:t="",approval:n}=await this.provider.connect({methods:this.methods}),s=this.config.walletConnectDeepLink??D.walletConnectDeepLink;this._approval=n,y.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!P())return;await y.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=P(),t=V(l());if(H(l())&&le.push(I.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{X()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:x={},walletConnectV2RelayAddress:W=""}=e,w=new Y(v,t,W,m,x);return await w.init(),{walletConnectProvider:w,dappMethods:le}}catch(m){throw console.error("Unable to connect",m),r&&await this.logout(),m}}async login(e){if(!this.provider)throw new Error("Provider is not initialized. Call createProvider first.");let r=async()=>{if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.init();let t=y.getInstance(),{uri:n="",approval:s}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??D.walletConnectDeepLink;t.updateData({wcURI:n,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(n)}`});let h=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=h??{};return t.handleClose({isLoginFinished:!!v}),{address:v,signature:m}}catch{return await r()}};if(!this._approval)throw new Error("Approval or login is not initialized");try{let t=await this.provider.login({approval:this._approval.bind(this),token:e?.token}),{address:n="",signature:s=""}=t??{};return y.getInstance().handleClose({isLoginFinished:!!n}),{address:n,signature:s}}catch(t){return console.error("User rejected connection proposal",t),await r()}}async sendCustomRequest({action:e,method:r}){if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.sendCustomRequest?.({request:{method:r,params:{action:e}}})}catch(t){console.error("Unable to send event",t)}}};var A=class{static set customProviders(i){this._customProviders=i}static get customProviders(){return this._customProviders}static async create({type:i,anchor:e}){let r=null;switch(i){case o.extension:{r=new z;break}case o.crossWindow:{r=new k;break}case o.ledger:{r=new f({anchor:e}),await S.getInstance().init();break}case o.metamask:{r=new T({type:pe.metamask});break}case o.passkey:{r=new T({type:pe.passkey});break}case o.walletConnect:{let s=G(l());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new _({anchor:e,...s});break}case o.webview:{r=new ae;break}default:{let s=q();for(let d of this._customProviders)d.type===i&&(r=await d.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new M(r);C(t);let n=[o.crossWindow,o.metamask,o.passkey].includes(i);return se(n?{skipLoginMethod:i}:null),t}static async destroy(){L().cancelLogin(),C(null),F(o.none)}};A._customProviders=[];var Pe=(a,i)=>a.some(e=>e.type===i);async function g({message:a,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(n,s)=>{let{manager:d,onClose:h}=await Z({cancelAction:e}),v=Object.values(A.customProviders),m=v.reduce((u,N)=>(u[N.type]=N.name,u),{}),x={...c,...m},W=async()=>{await h({shouldCancelAction:!0}),s({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",W);let w=Pe(v,r)?r:o.none;d.updateData({name:x[w],type:w});try{let u=await i(a);n(u)}catch(u){await h({shouldCancelAction:!0}),s(u)}finally{d.closeUI()}})}async function ce({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=ee(e);throw r?{message:r}:e}}export{ce as a,f as b,S as c,A as d,g as e,k as f,z as g,T as h,_ as i};
2
- //# sourceMappingURL=chunk-X2YQF6XJ.mjs.map
1
+ import{a as de}from"./chunk-M3YL36ZL.mjs";import{a as se}from"./chunk-AQ6D3F5K.mjs";import{a as te}from"./chunk-XSQDQMCL.mjs";import{a as U}from"./chunk-5MTV6BYP.mjs";import{a as ie}from"./chunk-QG4OP5CW.mjs";import{a as re}from"./chunk-FBE76A3W.mjs";import{a as ee}from"./chunk-YUFPUG5O.mjs";import{a as ae}from"./chunk-JKXED2JJ.mjs";import{a as p}from"./chunk-CDFO2GVK.mjs";import{a as Z}from"./chunk-LNKBLVKB.mjs";import{a as ne}from"./chunk-C43JUIS3.mjs";import{a as oe}from"./chunk-72FLAB3J.mjs";import{a as Q}from"./chunk-QJGFIK7H.mjs";import{b as J}from"./chunk-4Z3DZ2A3.mjs";import{b as I,c as Y}from"./chunk-NRXYSTRW.mjs";import{j as $,l as O,u as M,v as C,w as L}from"./chunk-ZN3MQVUF.mjs";import{a as y}from"./chunk-HFN44NHN.mjs";import{a as P}from"./chunk-DGHPHAOS.mjs";import{a as q}from"./chunk-HBB7HL5B.mjs";import{a as D}from"./chunk-4TBVQD27.mjs";import{a as X}from"./chunk-3GZLHBMS.mjs";import{g as K}from"./chunk-2IUBMLF4.mjs";import{a as F,q as j,s as l}from"./chunk-MQE7EP66.mjs";import{f as R}from"./chunk-UERJ6AKK.mjs";import{b as E,c as V}from"./chunk-SAAOQW7P.mjs";import{a as B}from"./chunk-VNLGNNIL.mjs";import{b as H,c as G}from"./chunk-6JM4DPOH.mjs";import{a as c}from"./chunk-CDQ2BNUD.mjs";import{a as o}from"./chunk-PLUWBWJ2.mjs";import{IframeLoginTypes as pe}from"@multiversx/sdk-web-wallet-iframe-provider/out/constants";var f=class extends p{constructor({address:e,anchor:r,shouldInitProvider:t}){super(e);this.provider=null;this.config=null;this.ledgerLogin=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");if(!e||typeof e.addressIndex!="number")throw new Error("Missing addressIndex for Ledger login");let{address:r,signature:t}=await this.provider.login({addressIndex:e.addressIndex});return{address:r,signature:t??""}};this.loginOperation=async e=>{if(!this.provider||!this.config)throw new Error("Provider is not initialized.");return await te({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!P())return;await U.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ne({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ce({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await re({shouldInitProvider:!0});this.provider=r}catch(r){throw $({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.ledger}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){await this.initLegderConnectManager(this.options?.anchor);let e=U.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((n,s)=>ie({manager:e,resolve:n,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ve=3e4,me=5e3,he=3e3,S=class a{constructor(){this.store=j();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=B(i),r=R(i);return!!(e===o.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=J(l());if(!(!this.shouldCheckConnection()||i))try{await L().getProvider().getAddress()}catch{if(O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"times",iconClassName:"warning",message:"Unlock your device to continue signing transactions",title:"Ledger disconnected"}),this.reset(),this.recreateProviderInterval)return;this.recreateProviderInterval=setInterval(this.reconnectProvider,me)}},ve))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new f({shouldInitProvider:!0});await i.init();let e=new M(i);i.getType=()=>o.ledger,C(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:he,icon:"check",iconClassName:"success",message:"Your device is ready to sign transactions",title:"Ledger reconnected"}),this.startCheckConnectionLoop()}catch{console.log("Unable to reconnect to Ledger")}};this.reset=()=>{clearInterval(this.connectionCheckInterval??0),this.connectionCheckInterval=null}}static getInstance(){return a.instance||(a.instance=new a),a.instance}};var k=class extends p{constructor(e){super(e?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{onClose:r,manager:t}=await this.initSignState();try{let n=await this.provider.signTransactions(e)??[];return await oe(n)}catch(n){throw await r({shouldCancelAction:!0}),n}finally{t.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.crossWindow})};this.walletAddress=e?.walletAddress,this.provider=Q.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=E(l()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return o.crossWindow}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{ExtensionProvider as ue}from"@multiversx/sdk-extension-provider/out/extensionProvider";var z=class extends p{constructor(e){super(e);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)??[]}catch(n){throw await t({shouldCancelAction:!1}),n}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension})};this.provider=ue.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return o.extension}};var fe={passkey:o.passkey,metamask:o.metamask},T=class extends p{constructor({type:e,address:r,walletUrl:t}){super(r);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)}catch(n){throw await t({shouldCancelAction:!0}),n}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider||!this.type)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c[this.type]})};this.type=e,this.walletUrl=t??"",this.provider=de.getInstance(),this._login=this.provider.login.bind(this.provider)}init(){return this.initializeAddress(),this.initializeWalletUrl(),this.initializeProvider()}initializeWalletUrl(){if(this.walletUrl)return;let e=E(l());if(!e.iframeWalletAddress)throw new Error("Invalid walletUrl");this.walletUrl=e.iframeWalletAddress}async initializeProvider(){return await this.provider.init(),this.address&&this.setAccount({address:this.address}),this.provider.setLoginType(this.type),this.provider.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return fe[this.type]}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{OptionalOperation as ye}from"@multiversx/sdk-wallet-connect-provider/out";var le=[I.CANCEL_ACTION,I.SIGN_LOGIN_TOKEN],_=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;this.cancelActionAbortController=null;this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();this.cancelActionAbortController=new AbortController;let n=this.cancelActionAbortController.signal;try{let s=new Promise((h,v)=>{n.addEventListener("abort",()=>{v(new Error("cancelled by user"))})});return await Promise.race([this.provider.signTransactions(e),s])}catch(s){throw await t({shouldCancelAction:!0}),s}finally{r.closeUI()}};this.cancelAction=async()=>{this.sendCustomRequest({method:I.CANCEL_ACTION,action:ye.CANCEL_ACTION}),this.cancelActionAbortController?.abort()};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");this.cancelActionAbortController=new AbortController;let r=this.cancelActionAbortController.signal,t=new Promise((s,d)=>{r.addEventListener("abort",()=>{d(new Error("cancelled by user"))})});return await Promise.race([g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension}),t])};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.walletConnect}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return Promise.resolve(this.provider.getAddress())}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){if(await this.initWalletConnectManager(),!this.config)throw new Error("Invalid WalletConnect setup");let{walletConnectProvider:e,dappMethods:r}=await this.createWalletConnectProvider(this.config);this.provider=e,this.methods=r;let{uri:t="",approval:n}=await this.provider.connect({methods:this.methods}),s=this.config.walletConnectDeepLink??D.walletConnectDeepLink;this._approval=n,y.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!P())return;await y.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=P(),t=V(l());if(H(l())&&le.push(I.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{X()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:x={},walletConnectV2RelayAddress:W=""}=e,w=new Y(v,t,W,m,x);return await w.init(),{walletConnectProvider:w,dappMethods:le}}catch(m){throw console.error("Unable to connect",m),r&&await this.logout(),m}}async login(e){if(!this.provider)throw new Error("Provider is not initialized. Call createProvider first.");let r=async()=>{if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.init();let t=y.getInstance(),{uri:n="",approval:s}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??D.walletConnectDeepLink;t.updateData({wcURI:n,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(n)}`});let h=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=h??{};return t.handleClose({isLoginFinished:!!v}),{address:v,signature:m}}catch{return await r()}};if(!this._approval)throw new Error("Approval or login is not initialized");try{let t=await this.provider.login({approval:this._approval.bind(this),token:e?.token}),{address:n="",signature:s=""}=t??{};return y.getInstance().handleClose({isLoginFinished:!!n}),{address:n,signature:s}}catch(t){return console.error("User rejected connection proposal",t),await r()}}async sendCustomRequest({action:e,method:r}){if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.sendCustomRequest?.({request:{method:r,params:{action:e}}})}catch(t){console.error("Unable to send event",t)}}};var A=class{static set customProviders(i){this._customProviders=i}static get customProviders(){return this._customProviders}static async create({type:i,anchor:e}){let r=null;switch(i){case o.extension:{r=new z;break}case o.crossWindow:{r=new k;break}case o.ledger:{r=new f({anchor:e}),await S.getInstance().init();break}case o.metamask:{r=new T({type:pe.metamask});break}case o.passkey:{r=new T({type:pe.passkey});break}case o.walletConnect:{let s=G(l());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new _({anchor:e,...s});break}case o.webview:{r=new ae;break}default:{let s=q();for(let d of this._customProviders)d.type===i&&(r=await d.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new M(r);C(t);let n=[o.crossWindow,o.metamask,o.passkey].includes(i);return se(n?{skipLoginMethod:i}:null),t}static async destroy(){L().cancelLogin(),C(null),F(o.none)}};A._customProviders=[];var Pe=(a,i)=>a.some(e=>e.type===i);async function g({message:a,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(n,s)=>{let{manager:d,onClose:h}=await Z({cancelAction:e}),v=Object.values(A.customProviders),m=v.reduce((u,N)=>(u[N.type]=N.name,u),{}),x={...c,...m},W=async()=>{await h({shouldCancelAction:!0}),s({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",W);let w=Pe(v,r)?r:o.none;d.updateData({name:x[w],type:w});try{let u=await i(a);n(u)}catch(u){await h({shouldCancelAction:!0}),s(u)}finally{d.closeUI()}})}async function ce({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=ee(e);throw r?{message:r}:e}}export{ce as a,f as b,S as c,A as d,g as e,k as f,z as g,T as h,_ as i};
2
+ //# sourceMappingURL=chunk-AN65FUBF.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-FDXRQC6M.mjs";var i=async a=>{let r=a.map(s=>s.hash),n=await e(r);return a.map(s=>{let t=n.find(o=>o?.txHash===s.hash);return{...s,status:t?.status,invalidTransaction:t==null,results:t?.results??[],previousStatus:s.status?.toString()||"",hasStatusChanged:!!(t&&t.status!==s.status)}})};export{i as a};
2
- //# sourceMappingURL=chunk-KP6LJO7T.mjs.map
1
+ import{a as e}from"./chunk-WIH2HALG.mjs";var i=async a=>{let r=a.map(s=>s.hash),n=await e(r);return a.map(s=>{let t=n.find(o=>o?.txHash===s.hash);return{...s,status:t?.status,invalidTransaction:t==null,results:t?.results??[],previousStatus:s.status?.toString()||"",hasStatusChanged:!!(t&&t.status!==s.status)}})};export{i as a};
2
+ //# sourceMappingURL=chunk-AN7WTTXJ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-L3MWDI6J.mjs";import{q as i}from"./chunk-7IS6C4WK.mjs";var g=({transactions:s,transactionsDisplayInfo:a,status:e,sessionInformation:t})=>{let o=Date.now().toString();return i().setState(({transactions:n})=>{n[o]={transactions:s,status:e,transactionsDisplayInfo:a,interpretedTransactions:{},sessionInformation:t}},!1,"createTransactionsSession"),o},T=({sessionId:s,status:a,errorMessage:e})=>{i().setState(({transactions:t})=>{t[s].status=a,t[s].errorMessage=e},!1,"updateTransactionsSession")},y=({sessionId:s,transaction:a})=>{let e=null;return i().setState(({transactions:t})=>{let o=t[s]?.transactions;if(o!=null){t[s].transactions=o.map(r=>r.hash===a.hash?{...r,...a??{}}:r);let n=u([...t[s].transactions]);n&&(T({sessionId:s,status:n}),e=n)}},!1,"updateTransactionStatus"),e},h=()=>{i().setState(({transactions:s,toasts:a})=>{let t=Object.keys(s).filter(n=>{let r=s[n];if(!r)return!1;let{status:c}=r;return!(c==="pending"||c==="signed"||c==="sent")});t.forEach(n=>{delete s[n]});let o=a.transactionToasts.filter(n=>!t.includes(n.toastId));a.transactionToasts=o},!1,"clearCompletedTransactions")};export{g as a,T as b,y as c,h as d};
2
- //# sourceMappingURL=chunk-N3F2ZVI3.mjs.map
1
+ import{a as u}from"./chunk-L3MWDI6J.mjs";import{q as i}from"./chunk-MQE7EP66.mjs";var g=({transactions:s,transactionsDisplayInfo:a,status:e,sessionInformation:t})=>{let o=Date.now().toString();return i().setState(({transactions:n})=>{n[o]={transactions:s,status:e,transactionsDisplayInfo:a,interpretedTransactions:{},sessionInformation:t}},!1,"createTransactionsSession"),o},T=({sessionId:s,status:a,errorMessage:e})=>{i().setState(({transactions:t})=>{t[s].status=a,t[s].errorMessage=e},!1,"updateTransactionsSession")},y=({sessionId:s,transaction:a})=>{let e=null;return i().setState(({transactions:t})=>{let o=t[s]?.transactions;if(o!=null){t[s].transactions=o.map(r=>r.hash===a.hash?{...r,...a??{}}:r);let n=u([...t[s].transactions]);n&&(T({sessionId:s,status:n}),e=n)}},!1,"updateTransactionStatus"),e},h=()=>{i().setState(({transactions:s,toasts:a})=>{let t=Object.keys(s).filter(n=>{let r=s[n];if(!r)return!1;let{status:c}=r;return!(c==="pending"||c==="signed"||c==="sent")});t.forEach(n=>{delete s[n]});let o=a.transactionToasts.filter(n=>!t.includes(n.toastId));a.transactionToasts=o},!1,"clearCompletedTransactions")};export{g as a,T as b,y as c,h as d};
2
+ //# sourceMappingURL=chunk-APLLFKCG.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-4H4K46HN.mjs";async function g({originalLoginToken:i,extraInfoData:n,address:o}){let e=await t({loginToken:i,extraInfoData:n}),s=n.multisig||n.impersonate||o;return{address:e!=null?s:o,modifiedLoginToken:e}}export{g as a};
2
- //# sourceMappingURL=chunk-F6JS7XZN.mjs.map
1
+ import{a as t}from"./chunk-MBHXPTPF.mjs";async function g({originalLoginToken:i,extraInfoData:n,address:o}){let e=await t({loginToken:i,extraInfoData:n}),s=n.multisig||n.impersonate||o;return{address:e!=null?s:o,modifiedLoginToken:e}}export{g as a};
2
+ //# sourceMappingURL=chunk-ARKNESS3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-INYX52TZ.mjs";function r(t){try{if(!e)return;e.document.documentElement.dataset.mvxTheme=t}catch{console.log("Error switching the theme!")}}export{r as a};
2
- //# sourceMappingURL=chunk-UTBU4OCC.mjs.map
1
+ import{a as e}from"./chunk-ICF2MAYU.mjs";function r(t){try{if(!e)return;e.document.documentElement.dataset.mvxTheme=t}catch{console.log("Error switching the theme!")}}export{r as a};
2
+ //# sourceMappingURL=chunk-BMB5EBCD.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-LGAWIVRO.mjs";import{s as m}from"./chunk-7IS6C4WK.mjs";import{b as a}from"./chunk-SAAOQW7P.mjs";import{o as s,u as o}from"./chunk-KD2IQ32V.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";async function I({tokenId:n}){let t=a(m()),r={tokenDecimals:Number(t.decimals),tokenLabel:"",tokenImageUrl:""},{isNft:k}=c(n),i=n,p=k?s:o;if(!i)return r;try{let e=await g(`${t.apiAddress}/${p}/${i}`),l=e?e?.decimals:Number(t.decimals),f=e?e?.name:"",T=e?e?.assets?.svgUrl??e?.media?.[0]?.thumbnailUrl:"";return{tokenDecimals:l,tokenLabel:f,type:e?.type,tokenImageUrl:T,identifier:e?.identifier,assets:e?.assets,esdtPrice:e?.price,ticker:e?.ticker,name:e?.name}}catch(e){return{...r,error:`${e}`}}}export{I as a};
2
- //# sourceMappingURL=chunk-A4QPQK4N.mjs.map
1
+ import{a as g}from"./chunk-LGAWIVRO.mjs";import{s as m}from"./chunk-MQE7EP66.mjs";import{b as a}from"./chunk-SAAOQW7P.mjs";import{o as s,u as o}from"./chunk-KD2IQ32V.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";async function I({tokenId:n}){let t=a(m()),r={tokenDecimals:Number(t.decimals),tokenLabel:"",tokenImageUrl:""},{isNft:k}=c(n),i=n,p=k?s:o;if(!i)return r;try{let e=await g(`${t.apiAddress}/${p}/${i}`),l=e?e?.decimals:Number(t.decimals),f=e?e?.name:"",T=e?e?.assets?.svgUrl??e?.media?.[0]?.thumbnailUrl:"";return{tokenDecimals:l,tokenLabel:f,type:e?.type,tokenImageUrl:T,identifier:e?.identifier,assets:e?.assets,esdtPrice:e?.price,ticker:e?.ticker,name:e?.name}}catch(e){return{...r,error:`${e}`}}}export{I as a};
2
+ //# sourceMappingURL=chunk-BN6QVD7B.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-OI62R74K.mjs";var a=class{constructor({uiDataUpdateEvent:t,uiTag:e}){this.eventBus=null;this.uiElement=null;this.isCreatingElement=!1;this.unsubscribeFunctions=new Map;this.uiDataUpdateEvent=t,this.uiTag=e,this.data=this.getInitialData()}async init(t){this.anchor=t,await this.createUIElement(t),await this.setupEventListeners()}updateData(t){this.data={...this.data,...t},this.notifyDataUpdate()}subscribeToEventBus(t,e){if(!this.eventBus)throw new Error("eventBus is not initialized");let i=this.eventBus?.subscribe(t,e);if(i){let n=this.unsubscribeFunctions.get(t)||[];n.push(i),this.unsubscribeFunctions.set(t,n)}}notifyDataUpdate(){this.eventBus?.publish(this.uiDataUpdateEvent,this.data)}destroy(){this.unsubscribeFunctions.forEach(t=>t.forEach(e=>e())),this.unsubscribeFunctions.clear(),this.eventBus=null,this.uiElement?.remove?.(),this.uiElement=null}getInitialData(){return this.initialData}resetData(){this.data=this.getInitialData()}async createUIElement(t=this.anchor){if(this.isCreatingElement||this.uiElement)return this.uiElement;if(this.isCreatingElement=!0,this.uiElement=await s.create({name:this.uiTag,anchor:t}),this.isCreatingElement=!1,!this.uiElement)throw new Error(`Failed to create ${this.uiTag} element`);if(this.eventBus||(this.eventBus=await this.uiElement.getEventBus()),!this.eventBus)throw new Error("eventBus is not initialized");return this.uiElement}};export{a};
2
- //# sourceMappingURL=chunk-63KWCFPE.mjs.map
1
+ import{a as s}from"./chunk-USYO34PE.mjs";var a=class{constructor({uiDataUpdateEvent:t,uiTag:e}){this.eventBus=null;this.uiElement=null;this.isCreatingElement=!1;this.unsubscribeFunctions=new Map;this.uiDataUpdateEvent=t,this.uiTag=e,this.data=this.getInitialData()}async init(t){this.anchor=t,await this.createUIElement(t),await this.setupEventListeners()}updateData(t){this.data={...this.data,...t},this.notifyDataUpdate()}subscribeToEventBus(t,e){if(!this.eventBus)throw new Error("eventBus is not initialized");let i=this.eventBus?.subscribe(t,e);if(i){let n=this.unsubscribeFunctions.get(t)||[];n.push(i),this.unsubscribeFunctions.set(t,n)}}notifyDataUpdate(){this.eventBus?.publish(this.uiDataUpdateEvent,this.data)}destroy(){this.unsubscribeFunctions.forEach(t=>t.forEach(e=>e())),this.unsubscribeFunctions.clear(),this.eventBus=null,this.uiElement?.remove?.(),this.uiElement=null}getInitialData(){return this.initialData}resetData(){this.data=this.getInitialData()}async createUIElement(t=this.anchor){if(this.isCreatingElement||this.uiElement)return this.uiElement;if(this.isCreatingElement=!0,this.uiElement=await s.create({name:this.uiTag,anchor:t}),this.isCreatingElement=!1,!this.uiElement)throw new Error(`Failed to create ${this.uiTag} element`);if(this.eventBus||(this.eventBus=await this.uiElement.getEventBus()),!this.eventBus)throw new Error("eventBus is not initialized");return this.uiElement}};export{a};
2
+ //# sourceMappingURL=chunk-BZ7SOBES.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as B}from"./chunk-RHB4T45O.mjs";import{a as b}from"./chunk-NDP6HUYZ.mjs";import{a as k}from"./chunk-QXC4D3AC.mjs";import{a as D}from"./chunk-G4SHHDV6.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as _}from"./chunk-B3NG2NOR.mjs";import{a as R}from"./chunk-YY724VZR.mjs";import{a as j}from"./chunk-URJQWHBM.mjs";import{a as A}from"./chunk-MBJNMOHO.mjs";import{a as O}from"./chunk-ZOVDKYFX.mjs";import{s as x}from"./chunk-7IS6C4WK.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-PJWJZHIS.mjs";import{a as w}from"./chunk-NTEMINYA.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard:h,username:E}}=B(),g=v(x()),C=O(),{allTransactions:r,parsedTransactionsByDataField:L}=R(z),p=[],n=A.getInstance();if(await n.openUI(),!n)throw new Error("Unable to establish connection with sign screens");let W=async()=>{await b(),n.closeUI()};return n.subscribeToEventBus("CLOSE_SIGN_TRANSACTIONS",W),new Promise(async(X,M)=>{let d=[],Y=await k({baseURL:g.apiAddress});n.notifyDataUpdate(),n.initializeGasPriceMap(r.map(a=>a.transaction));let l=Y?.price,t=0,T=async()=>{let c=r[t]?.transaction,i=Number(c.nonce);try{n.updateIsLoading(!0);let{commonData:o,tokenTransaction:e,fungibleTransaction:s}=await D({allTransactions:r,currentScreenIndex:t,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:h,signedIndexes:p,parsedTransactionsByDataField:L});e&&n.updateTokenTransaction(e),s&&n.updateNonFungibleTransaction(s.type,s),n.updateCommonData(o)}catch(o){throw console.error(`Error fetching common data for transaction at index ${t}:`,o),o}finally{n.updateIsLoading(!1)}},$=()=>{t>0&&(t--,T())},q=(a=0)=>{let i=r[t].transaction,o=Number(i.nonce);n.updateGasPriceMap({nonce:o,ppu:a}),n.updateCommonData({ppu:a});let e=i.toPlainObject(),s=I({transaction:e,gasPriceData:n.ppuMap[o]}),P=w.newFromPlainObject({...e,gasPrice:s}),u=j({transaction:P,price:l}),m=F({input:s.toString(),decimals:U,addCommas:!0,digits:G});n.updateCommonData({feeLimit:u.feeLimitFormatted,feeInFiatLimit:u.feeInFiatLimit,gasPrice:m,ppu:a})},J=async()=>{M(new Error("Transaction signing cancelled by user")),await b(),n.closeUI()},f=()=>{t<n.transactionsCount-1&&(t++,T())},Q=async()=>{let c=r[t].transaction,i=Number(c.nonce),{commonData:o}=await D({allTransactions:r,currentScreenIndex:t,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:h,signedIndexes:p,parsedTransactionsByDataField:L});if(!o.needsSigning)return p.push(t),f();let e=c.toPlainObject(),s=e.nonce,P=I({transaction:e,gasPriceData:n.ppuMap[s]}),u=w.newFromPlainObject({...e,gasPrice:P});try{let m=await H([u]);m&&(p.push(t),d.push(m[0]));let nn=t===r.length-1,tn=r.filter(S=>S.needsSigning),an=d.length===tn.length;if(nn&&an){let S=await K(d);return n.closeUI(),X(S)}f()}catch(m){n.closeUI(),M(m)}},V=new Map([["NEXT_SIGN_TRANSACTIONS",f],["CONFIRM_SIGN_TRANSACTIONS",Q],["CLOSE_SIGN_TRANSACTIONS",J],["BACK_SIGN_TRANSACTIONS",$],["SET_PPU_SIGN_TRANSACTIONS",q]]);function Z(){for(let[a,c]of V)n.subscribeToEventBus(a,c)}Z(),await T()})}export{Dn as a};
2
- //# sourceMappingURL=chunk-B3MJTLY7.mjs.map
1
+ import{a as B}from"./chunk-4SJNM6SL.mjs";import{a as b}from"./chunk-L5G2CINO.mjs";import{a as k}from"./chunk-QXC4D3AC.mjs";import{a as D}from"./chunk-MZZNZFMX.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as _}from"./chunk-72FLAB3J.mjs";import{a as R}from"./chunk-YY724VZR.mjs";import{a as j}from"./chunk-URJQWHBM.mjs";import{a as A}from"./chunk-LBCZDKL3.mjs";import{a as O}from"./chunk-R3XFYXKM.mjs";import{s as x}from"./chunk-MQE7EP66.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-PJWJZHIS.mjs";import{a as w}from"./chunk-NTEMINYA.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard:h,username:E}}=B(),g=v(x()),C=O(),{allTransactions:r,parsedTransactionsByDataField:L}=R(z),p=[],n=A.getInstance();if(await n.openUI(),!n)throw new Error("Unable to establish connection with sign screens");let W=async()=>{await b(),n.closeUI()};return n.subscribeToEventBus("CLOSE_SIGN_TRANSACTIONS",W),new Promise(async(X,M)=>{let d=[],Y=await k({baseURL:g.apiAddress});n.notifyDataUpdate(),n.initializeGasPriceMap(r.map(a=>a.transaction));let l=Y?.price,t=0,T=async()=>{let c=r[t]?.transaction,i=Number(c.nonce);try{n.updateIsLoading(!0);let{commonData:o,tokenTransaction:e,fungibleTransaction:s}=await D({allTransactions:r,currentScreenIndex:t,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:h,signedIndexes:p,parsedTransactionsByDataField:L});e&&n.updateTokenTransaction(e),s&&n.updateNonFungibleTransaction(s.type,s),n.updateCommonData(o)}catch(o){throw console.error(`Error fetching common data for transaction at index ${t}:`,o),o}finally{n.updateIsLoading(!1)}},$=()=>{t>0&&(t--,T())},q=(a=0)=>{let i=r[t].transaction,o=Number(i.nonce);n.updateGasPriceMap({nonce:o,ppu:a}),n.updateCommonData({ppu:a});let e=i.toPlainObject(),s=I({transaction:e,gasPriceData:n.ppuMap[o]}),P=w.newFromPlainObject({...e,gasPrice:s}),u=j({transaction:P,price:l}),m=F({input:s.toString(),decimals:U,addCommas:!0,digits:G});n.updateCommonData({feeLimit:u.feeLimitFormatted,feeInFiatLimit:u.feeInFiatLimit,gasPrice:m,ppu:a})},J=async()=>{M(new Error("Transaction signing cancelled by user")),await b(),n.closeUI()},f=()=>{t<n.transactionsCount-1&&(t++,T())},Q=async()=>{let c=r[t].transaction,i=Number(c.nonce),{commonData:o}=await D({allTransactions:r,currentScreenIndex:t,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:h,signedIndexes:p,parsedTransactionsByDataField:L});if(!o.needsSigning)return p.push(t),f();let e=c.toPlainObject(),s=e.nonce,P=I({transaction:e,gasPriceData:n.ppuMap[s]}),u=w.newFromPlainObject({...e,gasPrice:P});try{let m=await H([u]);m&&(p.push(t),d.push(m[0]));let nn=t===r.length-1,tn=r.filter(S=>S.needsSigning),an=d.length===tn.length;if(nn&&an){let S=await K(d);return n.closeUI(),X(S)}f()}catch(m){n.closeUI(),M(m)}},V=new Map([["NEXT_SIGN_TRANSACTIONS",f],["CONFIRM_SIGN_TRANSACTIONS",Q],["CLOSE_SIGN_TRANSACTIONS",J],["BACK_SIGN_TRANSACTIONS",$],["SET_PPU_SIGN_TRANSACTIONS",q]]);function Z(){for(let[a,c]of V)n.subscribeToEventBus(a,c)}Z(),await T()})}export{Dn as a};
2
+ //# sourceMappingURL=chunk-C43JUIS3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-INYX52TZ.mjs";var i=String(o?.navigator?.userAgent),t=/^((?!chrome|android).)*safari/i.test(i),r=/firefox/i.test(i)&&/windows/i.test(i),n=t||r;export{t as a,n as b};
2
- //# sourceMappingURL=chunk-EUUARGU3.mjs.map
1
+ import{a as o}from"./chunk-ICF2MAYU.mjs";var i=String(o?.navigator?.userAgent),t=/^((?!chrome|android).)*safari/i.test(i),r=/firefox/i.test(i)&&/windows/i.test(i),n=t||r;export{t as a,n as b};
2
+ //# sourceMappingURL=chunk-C6NQEN6N.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-Z6LX4L3O.mjs";import{a as e}from"./chunk-5ZCTLMZK.mjs";import{a as i}from"./chunk-CDQ2BNUD.mjs";var a=class{constructor(o){this.address="";this._login=null;this.loginAbortController=null;this.cancelLogin=()=>{this.loginAbortController&&this.loginAbortController.abort(),this.cancelAction?.(),this.loginAbortController=null};this.loginOperation=async o=>{if(!this._login)throw new Error("Provider is not initialized.");let r=await this._login(o);if(!r?.address)throw new Error("Provider is not initialized.");return{...r,address:r.address,signature:r.signature??""}};this.initializeAddress=()=>{if(this.address)return;let o=e();o&&(this.address=o)};this.cancelAction=void 0;this.address=o??""}getAccount(){throw new Error("Method not implemented.")}signTransaction(o,r){throw new Error("Method not implemented.")}async login(o){if(!this._login)throw new Error("Provider is not initialized.");this.loginAbortController&&this.loginAbortController.abort();let r=new AbortController;this.loginAbortController=r;let t=r.signal;try{let n=new Promise((p,c)=>{t.addEventListener("abort",()=>{c(new Error("Login cancelled"))})}),l=await Promise.race([this.loginOperation(o),n]);return this.loginAbortController=null,l}catch(n){throw this.loginAbortController=null,n}}async initSignState(){let{onClose:o,manager:r}=await s({cancelAction:this.cancelAction?.bind(this)}),t=this.getType();return r.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",o),r.updateData({name:i[t],type:t}),{onClose:o,manager:r}}};export{a};
2
- //# sourceMappingURL=chunk-OYHNC7AV.mjs.map
1
+ import{a as s}from"./chunk-LNKBLVKB.mjs";import{a as e}from"./chunk-HBB7HL5B.mjs";import{a as i}from"./chunk-CDQ2BNUD.mjs";var a=class{constructor(o){this.address="";this._login=null;this.loginAbortController=null;this.cancelLogin=()=>{this.loginAbortController&&this.loginAbortController.abort(),this.cancelAction?.(),this.loginAbortController=null};this.loginOperation=async o=>{if(!this._login)throw new Error("Provider is not initialized.");let r=await this._login(o);if(!r?.address)throw new Error("Provider is not initialized.");return{...r,address:r.address,signature:r.signature??""}};this.initializeAddress=()=>{if(this.address)return;let o=e();o&&(this.address=o)};this.cancelAction=void 0;this.address=o??""}getAccount(){throw new Error("Method not implemented.")}signTransaction(o,r){throw new Error("Method not implemented.")}async login(o){if(!this._login)throw new Error("Provider is not initialized.");this.loginAbortController&&this.loginAbortController.abort();let r=new AbortController;this.loginAbortController=r;let t=r.signal;try{let n=new Promise((p,c)=>{t.addEventListener("abort",()=>{c(new Error("Login cancelled"))})}),l=await Promise.race([this.loginOperation(o),n]);return this.loginAbortController=null,l}catch(n){throw this.loginAbortController=null,n}}async initSignState(){let{onClose:o,manager:r}=await s({cancelAction:this.cancelAction?.bind(this)}),t=this.getType();return r.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",o),r.updateData({name:i[t],type:t}),{onClose:o,manager:r}}};export{a};
2
+ //# sourceMappingURL=chunk-CDFO2GVK.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as s}from"./chunk-NTOY6GTP.mjs";import{c as r,d as a}from"./chunk-2IUBMLF4.mjs";import{s as e}from"./chunk-7IS6C4WK.mjs";import{a as n}from"./chunk-UERJ6AKK.mjs";var u=t=>{let o=0,i=n(e())?.shard;return S(t)?(t.forEach(c=>{let m=s(c,i);o+=m?5*6e3:6e3}),o):(o=s(t,i)?5*6e3:6e3,o)};export{u as a};
2
- //# sourceMappingURL=chunk-OMOTZPAR.mjs.map
1
+ import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as s}from"./chunk-NTOY6GTP.mjs";import{c as r,d as a}from"./chunk-2IUBMLF4.mjs";import{s as e}from"./chunk-MQE7EP66.mjs";import{a as n}from"./chunk-UERJ6AKK.mjs";var u=t=>{let o=0,i=n(e())?.shard;return S(t)?(t.forEach(c=>{let m=s(c,i);o+=m?5*6e3:6e3}),o):(o=s(t,i)?5*6e3:6e3,o)};export{u as a};
2
+ //# sourceMappingURL=chunk-CS5BSVSE.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-IJT27EFF.mjs";function S(e){return t()(e)}export{S as a};
2
+ //# sourceMappingURL=chunk-D3KKYOYF.mjs.map
@@ -0,0 +1,2 @@
1
+ import{s as e}from"./chunk-MQE7EP66.mjs";import{f as t}from"./chunk-UERJ6AKK.mjs";function n(o=e()){return t(o)}export{n as a};
2
+ //# sourceMappingURL=chunk-DGHPHAOS.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as f}from"./chunk-FRDR4A7Z.mjs";import{w as g}from"./chunk-X6K7QVBT.mjs";import{a as c}from"./chunk-VZSWUP43.mjs";import{s as n}from"./chunk-7IS6C4WK.mjs";import{g as a}from"./chunk-UERJ6AKK.mjs";import{e as l}from"./chunk-VNLGNNIL.mjs";import{HWProvider as m}from"@multiversx/sdk-hw-provider";async function A(u){let v=c(),d=u?.shouldInitProvider||!v,o=l(n()),t=a(n()),r=g(),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-JVUXLR26.mjs.map
1
+ import{a as f}from"./chunk-FRDR4A7Z.mjs";import{w as g}from"./chunk-ZN3MQVUF.mjs";import{a as c}from"./chunk-DGHPHAOS.mjs";import{s as n}from"./chunk-MQE7EP66.mjs";import{g as a}from"./chunk-UERJ6AKK.mjs";import{e as l}from"./chunk-VNLGNNIL.mjs";import{HWProvider as m}from"@multiversx/sdk-hw-provider";async function A(u){let v=c(),d=u?.shouldInitProvider||!v,o=l(n()),t=a(n()),r=g(),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-FBE76A3W.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as k}from"./chunk-QJAIPDD6.mjs";import{a as T}from"./chunk-XCVEFI4B.mjs";import{a as i}from"./chunk-W5MTQBQF.mjs";import{a as m}from"./chunk-UNBTFF6K.mjs";import{a as l}from"./chunk-U3UMCTU6.mjs";import{c as d}from"./chunk-PJWJZHIS.mjs";import{a as o}from"./chunk-7CELSV4S.mjs";var p=class{static async processTransactions({address:u,egldLabel:v,explorerAddress:g,transactions:L}){let f=L.map(e=>m({address:u,explorerAddress:g,transaction:e}));return await Promise.all(f.map(async e=>{let s=e.receiverAssets?.name.replace(/\p{Emoji}/gu,""),a=e.senderAssets?.name.replace(/\p{Emoji}/gu,""),{senderLockedAccount:h,receiverLockedAccount:D}=await k({receiver:e.receiver,sender:e.sender,tokenId:e.tokenIdentifier}),{egldValueData:t,tokenValueData:n,nftValueData:r}=T({transaction:e}),x=r?.token.type==="MetaESDT"?void 0:r?.badgeText,c=l.getData({input:t?.value??n?.value??r?.value??"",decimals:t?.decimals??n?.decimals??r?.decimals??d,digits:2}),y={badge:x??void 0,collection:n?.token.collection??r?.token.collection,egldLabel:t?v:"",link:n?.tokenExplorerLink??r?.tokenExplorerLink,linkText:n?.tokenLinkText??r?.tokenLinkText,name:n?.token.name??r?.token.name,showFormattedAmount:!!(t||n?.tokenFormattedAmount||r?.tokenFormattedAmount),svgUrl:n?.token.svgUrl??r?.token.svgUrl,ticker:n?.token.ticker??r?.token.ticker,titleText:n?.titleText??r?.titleText,valueDecimal:c.valueDecimal,valueInteger:c.valueInteger},w=i(e.receiverShard),A=i(e.senderShard);return{age:e.transactionDetails.age,direction:e.transactionDetails.direction,method:e.transactionDetails.method,iconInfo:e.transactionDetails.iconInfo,link:e.links.transactionLink??"",txHash:e.txHash,receiver:{address:e.receiver,name:s??"",description:`${s??e.receiver} (${e.receiver})`,isContract:o(e.receiver),isTokenLocked:!!D,link:e.links.receiverLink??"",shard:w,shardLink:e.links.receiverLink,showLink:e.transactionDetails.direction!=="In"},sender:{address:e.sender,name:a??"",description:`${a??e.sender} (${e.sender})`,isContract:o(e.sender),isTokenLocked:!!h,link:e.links.senderLink??"",shard:A,shardLink:e.links.senderShardLink,showLink:e.transactionDetails.direction!=="Out"},value:y}}))}};export{p as a};
2
- //# sourceMappingURL=chunk-4I6XFBRI.mjs.map
1
+ import{a as k}from"./chunk-QNGOARJQ.mjs";import{a as T}from"./chunk-XCVEFI4B.mjs";import{a as i}from"./chunk-W5MTQBQF.mjs";import{a as m}from"./chunk-UNBTFF6K.mjs";import{a as l}from"./chunk-U3UMCTU6.mjs";import{c as d}from"./chunk-PJWJZHIS.mjs";import{a as o}from"./chunk-7CELSV4S.mjs";var p=class{static async processTransactions({address:u,egldLabel:v,explorerAddress:g,transactions:L}){let f=L.map(e=>m({address:u,explorerAddress:g,transaction:e}));return await Promise.all(f.map(async e=>{let s=e.receiverAssets?.name.replace(/\p{Emoji}/gu,""),a=e.senderAssets?.name.replace(/\p{Emoji}/gu,""),{senderLockedAccount:h,receiverLockedAccount:D}=await k({receiver:e.receiver,sender:e.sender,tokenId:e.tokenIdentifier}),{egldValueData:t,tokenValueData:n,nftValueData:r}=T({transaction:e}),x=r?.token.type==="MetaESDT"?void 0:r?.badgeText,c=l.getData({input:t?.value??n?.value??r?.value??"",decimals:t?.decimals??n?.decimals??r?.decimals??d,digits:2}),y={badge:x??void 0,collection:n?.token.collection??r?.token.collection,egldLabel:t?v:"",link:n?.tokenExplorerLink??r?.tokenExplorerLink,linkText:n?.tokenLinkText??r?.tokenLinkText,name:n?.token.name??r?.token.name,showFormattedAmount:!!(t||n?.tokenFormattedAmount||r?.tokenFormattedAmount),svgUrl:n?.token.svgUrl??r?.token.svgUrl,ticker:n?.token.ticker??r?.token.ticker,titleText:n?.titleText??r?.titleText,valueDecimal:c.valueDecimal,valueInteger:c.valueInteger},w=i(e.receiverShard),A=i(e.senderShard);return{age:e.transactionDetails.age,direction:e.transactionDetails.direction,method:e.transactionDetails.method,iconInfo:e.transactionDetails.iconInfo,link:e.links.transactionLink??"",txHash:e.txHash,receiver:{address:e.receiver,name:s??"",description:`${s??e.receiver} (${e.receiver})`,isContract:o(e.receiver),isTokenLocked:!!D,link:e.links.receiverLink??"",shard:w,shardLink:e.links.receiverLink,showLink:e.transactionDetails.direction!=="In"},sender:{address:e.sender,name:a??"",description:`${a??e.sender} (${e.sender})`,isContract:o(e.sender),isTokenLocked:!!h,link:e.links.senderLink??"",shard:A,shardLink:e.links.senderShardLink,showLink:e.transactionDetails.direction!=="Out"},value:y}}))}};export{p as a};
2
+ //# sourceMappingURL=chunk-G36BWGZR.mjs.map
@@ -0,0 +1,2 @@
1
+ import{q as n}from"./chunk-MQE7EP66.mjs";import{b as t}from"./chunk-UTWIKUIK.mjs";var c=a=>t(`transaction-${a}`)(n().getState())??null;export{c as a};
2
+ //# sourceMappingURL=chunk-GE6T2B4E.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-SKPK57EU.mjs";import{a as f}from"./chunk-3ZM355SG.mjs";import{a as g}from"./chunk-GFBHBIES.mjs";import{b as a}from"./chunk-7IS6C4WK.mjs";import{c as s,g as r}from"./chunk-NTEMINYA.mjs";var v=async({signMessageCallback:m,nativeAuthClientConfig:o})=>{let{address:t}=u(),c=g(),i=f(o||c),e=await i.initialize({noCache:!!o});if(!e)return null;let h=new r({address:new s(t),data:Buffer.from(`${t}${e}`)}),n=await m(h,{});if(!n?.signature)throw"Message not signed";return a({loginToken:e,signature:Buffer.from(n.signature).toString("hex")}),i.getToken({address:t,token:e,signature:Buffer.from(n.signature).toString("hex")})};export{v as a};
2
- //# sourceMappingURL=chunk-QQBMLLIQ.mjs.map
1
+ import{a as u}from"./chunk-HO2Y34SD.mjs";import{a as f}from"./chunk-HD6OPS7Q.mjs";import{a as g}from"./chunk-WV7M6B7H.mjs";import{b as a}from"./chunk-MQE7EP66.mjs";import{c as s,g as r}from"./chunk-NTEMINYA.mjs";var v=async({signMessageCallback:m,nativeAuthClientConfig:o})=>{let{address:t}=u(),c=g(),i=f(o||c),e=await i.initialize({noCache:!!o});if(!e)return null;let h=new r({address:new s(t),data:Buffer.from(`${t}${e}`)}),n=await m(h,{});if(!n?.signature)throw"Message not signed";return a({loginToken:e,signature:Buffer.from(n.signature).toString("hex")}),i.getToken({address:t,token:e,signature:Buffer.from(n.signature).toString("hex")})};export{v as a};
2
+ //# sourceMappingURL=chunk-GUD6RECQ.mjs.map
@@ -0,0 +1,2 @@
1
+ import{s as t}from"./chunk-MQE7EP66.mjs";import{c as r}from"./chunk-UERJ6AKK.mjs";function m(e=t()){return r(e)}export{m as a};
2
+ //# sourceMappingURL=chunk-HBB7HL5B.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-3S57OP4Z.mjs";import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-RUWJKSCI.mjs";import{NativeAuthClient as y}from"@multiversx/sdk-native-auth-client";var H=f=>{let{origin:o,apiAddress:i,expirySeconds:r,blockHashShard:s,extraInfo:u,gatewayUrl:d,extraRequestHeaders:k}=h(f),e=new y({origin:o,apiUrl:i,expirySeconds:r,blockHashShard:s,gatewayUrl:d,extraRequestHeaders:k});return{initialize:async t=>{if(!i||!o)return"";let a=()=>e.getCurrentBlockHash(),n=t?.latestBlockInfo;n??=await g({apiAddress:i,blockHashShard:s,getBlockHash:a,noCache:t?.noCache});let{hash:p,timestamp:c}=n,m=e.encodeValue(JSON.stringify({...t?.extraInfo??u,...c?{timestamp:c}:{}}));return`${e.encodeValue(o)}.${p}.${r}.${m}`},getToken:({address:t,token:a,signature:n})=>e.getToken(t,a,n),getTokenExpiration:l}};export{H as a};
2
- //# sourceMappingURL=chunk-3ZM355SG.mjs.map
1
+ import{a as g}from"./chunk-3S57OP4Z.mjs";import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-U4LAMKLU.mjs";import{NativeAuthClient as y}from"@multiversx/sdk-native-auth-client";var H=f=>{let{origin:o,apiAddress:i,expirySeconds:r,blockHashShard:s,extraInfo:u,gatewayUrl:d,extraRequestHeaders:k}=h(f),e=new y({origin:o,apiUrl:i,expirySeconds:r,blockHashShard:s,gatewayUrl:d,extraRequestHeaders:k});return{initialize:async t=>{if(!i||!o)return"";let a=()=>e.getCurrentBlockHash(),n=t?.latestBlockInfo;n??=await g({apiAddress:i,blockHashShard:s,getBlockHash:a,noCache:t?.noCache});let{hash:p,timestamp:c}=n,m=e.encodeValue(JSON.stringify({...t?.extraInfo??u,...c?{timestamp:c}:{}}));return`${e.encodeValue(o)}.${p}.${r}.${m}`},getToken:({address:t,token:a,signature:n})=>e.getToken(t,a,n),getTokenExpiration:l}};export{H as a};
2
+ //# sourceMappingURL=chunk-HD6OPS7Q.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-63KWCFPE.mjs";var n=class t extends e{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-wallet-connect"});this.initialData={wcURI:"",walletConnectDeepLink:""};this.data={...this.initialData}}static getInstance(){return t.instance||(t.instance=new t),t.instance}handleClose(a){a?.isLoginFinished||(this.anchor?this.anchor.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy())}async setupEventListeners(){this.eventBus&&(this.eventBus.subscribe("CLOSE",this.handleClose.bind(this)),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}};export{n as a};
2
- //# sourceMappingURL=chunk-T7MRWPJP.mjs.map
1
+ import{a as e}from"./chunk-BZ7SOBES.mjs";var n=class t extends e{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-wallet-connect"});this.initialData={wcURI:"",walletConnectDeepLink:""};this.data={...this.initialData}}static getInstance(){return t.instance||(t.instance=new t),t.instance}handleClose(a){a?.isLoginFinished||(this.anchor?this.anchor.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy())}async setupEventListeners(){this.eventBus&&(this.eventBus.subscribe("CLOSE",this.handleClose.bind(this)),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}};export{n as a};
2
+ //# sourceMappingURL=chunk-HFN44NHN.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-FDXRQC6M.mjs";import{a as p}from"./chunk-7RHFBSVM.mjs";import{a as d}from"./chunk-GJPOP2QV.mjs";import{a as T}from"./chunk-3L7HZ2SO.mjs";var f=a=>a.sort((i,o)=>o.timestamp-i.timestamp),H=async({transactions:a,address:i,explorerAddress:o,egldLabel:g})=>{let e=[],r=[];if(a.forEach(s=>{let t=d(s.hash);t?e.push(t):r.push(s.hash)}),r.length===0)return f(e);let c=await h(r),I=c.map(s=>s.txHash),m=r.filter(s=>!I.includes(s));if(m.length>0){let t=a.filter(n=>m.includes(n.hash)).map(n=>({...n,txHash:n.hash,price:0,status:"pending",gasUsed:0,miniBlockHash:"",receiverShard:0,round:0,senderShard:0,timestamp:Date.now()}));c.push(...t)}return c.forEach(s=>{let t=T({transaction:s,address:i,explorerAddress:o,egldLabel:g});t.status!=="pending"&&p({key:`transaction-${s.txHash}`,value:t}),e.push(t)}),f(e)};export{H as a};
2
- //# sourceMappingURL=chunk-ROGNJB62.mjs.map
1
+ import{a as h}from"./chunk-WIH2HALG.mjs";import{a as p}from"./chunk-IAQCHY3X.mjs";import{a as d}from"./chunk-GE6T2B4E.mjs";import{a as T}from"./chunk-3L7HZ2SO.mjs";var f=a=>a.sort((i,o)=>o.timestamp-i.timestamp),H=async({transactions:a,address:i,explorerAddress:o,egldLabel:g})=>{let e=[],r=[];if(a.forEach(s=>{let t=d(s.hash);t?e.push(t):r.push(s.hash)}),r.length===0)return f(e);let c=await h(r),I=c.map(s=>s.txHash),m=r.filter(s=>!I.includes(s));if(m.length>0){let t=a.filter(n=>m.includes(n.hash)).map(n=>({...n,txHash:n.hash,price:0,status:"pending",gasUsed:0,miniBlockHash:"",receiverShard:0,round:0,senderShard:0,timestamp:Date.now()}));c.push(...t)}return c.forEach(s=>{let t=T({transaction:s,address:i,explorerAddress:o,egldLabel:g});t.status!=="pending"&&p({key:`transaction-${s.txHash}`,value:t}),e.push(t)}),f(e)};export{H as a};
2
+ //# sourceMappingURL=chunk-HFYBB326.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-XOM5JS7L.mjs";import{a}from"./chunk-5ZCTLMZK.mjs";import{a as u}from"./chunk-I36BPJED.mjs";import{c as n}from"./chunk-LWQZ3ODY.mjs";import{a as s}from"./chunk-INYX52TZ.mjs";var c=(o,t)=>{let r=`sdk-dapp-logout-event-${o}`,e=t.getItem(r);e&&o!==e||(t.setItem(r,o),t.removeItem(r))};async function L({provider:o,options:t={shouldBroadcastLogoutAcrossTabs:!0}}){let r=a();t.shouldBroadcastLogoutAcrossTabs&&s.localStorage&&c(r,s.localStorage);try{return u(),n.forEach(g=>g()),n.clear(),i.closeConnectionRef?.(),await o.logout()}catch(e){return console.error("Logging out error:",e),!1}}export{L as a};
2
- //# sourceMappingURL=chunk-B2CRU44C.mjs.map
1
+ import{a as i}from"./chunk-NVA7A4D6.mjs";import{a}from"./chunk-HBB7HL5B.mjs";import{a as u}from"./chunk-3GZLHBMS.mjs";import{c as n}from"./chunk-ISHHMEWX.mjs";import{a as s}from"./chunk-ICF2MAYU.mjs";var c=(o,t)=>{let r=`sdk-dapp-logout-event-${o}`,e=t.getItem(r);e&&o!==e||(t.setItem(r,o),t.removeItem(r))};async function L({provider:o,options:t={shouldBroadcastLogoutAcrossTabs:!0}}){let r=a();t.shouldBroadcastLogoutAcrossTabs&&s.localStorage&&c(r,s.localStorage);try{return u(),n.forEach(g=>g()),n.clear(),i.closeConnectionRef?.(),await o.logout()}catch(e){return console.error("Logging out error:",e),!1}}export{L as a};
2
+ //# sourceMappingURL=chunk-HLEGJP45.mjs.map
@@ -0,0 +1,2 @@
1
+ import{s as o}from"./chunk-MQE7EP66.mjs";import{a as t}from"./chunk-UERJ6AKK.mjs";function n(r=o()){return t(r)}export{n as a};
2
+ //# sourceMappingURL=chunk-HO2Y34SD.mjs.map
@@ -1,2 +1,2 @@
1
- import{q as a}from"./chunk-7IS6C4WK.mjs";var r=({key:e,value:t})=>{a().setState(({cache:c})=>{c[e]=t},!1,"saveToCache")},s=e=>{a().setState(({cache:t})=>{delete t[e]},!1,"removeFromCache")},h=()=>{a().setState(({cache:e})=>{Object.keys(e).forEach(t=>{delete e[t]})},!1,"clearCache")};export{r as a,s as b,h as c};
2
- //# sourceMappingURL=chunk-7RHFBSVM.mjs.map
1
+ import{q as a}from"./chunk-MQE7EP66.mjs";var r=({key:e,value:t})=>{a().setState(({cache:c})=>{c[e]=t},!1,"saveToCache")},s=e=>{a().setState(({cache:t})=>{delete t[e]},!1,"removeFromCache")},h=()=>{a().setState(({cache:e})=>{Object.keys(e).forEach(t=>{delete e[t]})},!1,"clearCache")};export{r as a,s as b,h as c};
2
+ //# sourceMappingURL=chunk-IAQCHY3X.mjs.map
@@ -0,0 +1,2 @@
1
+ var o=typeof window<"u"?window:{},n="5.1.4";export{o as a,n as b};
2
+ //# sourceMappingURL=chunk-ICF2MAYU.mjs.map