@multiversx/sdk-dapp 5.0.0 → 5.0.1

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 (380) hide show
  1. package/out/__chunks__/chunk-2A4BH65X.mjs +2 -0
  2. package/out/__chunks__/{chunk-NQ6SJRHZ.mjs → chunk-2EV6M7VE.mjs} +2 -2
  3. package/out/__chunks__/{chunk-4XP7BVJD.mjs → chunk-2R5LWF2W.mjs} +2 -2
  4. package/out/__chunks__/{chunk-6P7EXGAB.mjs → chunk-3AARPJLE.mjs} +2 -2
  5. package/out/__chunks__/{chunk-FZFKEGPM.mjs → chunk-3L3E75PE.mjs} +2 -2
  6. package/out/__chunks__/{chunk-2SIHYJET.mjs → chunk-3POGSGSD.mjs} +2 -2
  7. package/out/__chunks__/{chunk-BVLXVOIC.mjs → chunk-3ZB7JXE7.mjs} +2 -2
  8. package/out/__chunks__/{chunk-6RGWVDNQ.mjs → chunk-45ZH7OXW.mjs} +2 -2
  9. package/out/__chunks__/{chunk-B7ZKW5ML.mjs → chunk-4EU55YPS.mjs} +2 -2
  10. package/out/__chunks__/{chunk-JZ7434LN.mjs → chunk-4MZZTC2O.mjs} +2 -2
  11. package/out/__chunks__/{chunk-CVPP4HQE.mjs → chunk-4WAEN6KC.mjs} +2 -2
  12. package/out/__chunks__/chunk-5AJYN23S.mjs +2 -0
  13. package/out/__chunks__/{chunk-BG6QTPZ4.mjs → chunk-5HHIOEWB.mjs} +2 -2
  14. package/out/__chunks__/{chunk-NJPTQNCT.mjs → chunk-6AI3AGZ4.mjs} +2 -2
  15. package/out/__chunks__/{chunk-4YU2DWHA.mjs → chunk-6KWXVSHC.mjs} +2 -2
  16. package/out/__chunks__/chunk-6LDLCMZI.mjs +2 -0
  17. package/out/__chunks__/chunk-7JIHOTRV.mjs +2 -0
  18. package/out/__chunks__/chunk-7Q275OU5.mjs +2 -0
  19. package/out/__chunks__/{chunk-BOAJJ4FX.mjs → chunk-7Z3LULCU.mjs} +2 -2
  20. package/out/__chunks__/{chunk-VXLJWKLG.mjs → chunk-AG6XMOI3.mjs} +2 -2
  21. package/out/__chunks__/{chunk-XPYJSDNF.mjs → chunk-AODYWSUW.mjs} +2 -2
  22. package/out/__chunks__/{chunk-GT2HLNE7.mjs → chunk-AROH3QTC.mjs} +2 -2
  23. package/out/__chunks__/{chunk-3NFKZZ7W.mjs → chunk-AWX5SSJV.mjs} +2 -2
  24. package/out/__chunks__/{chunk-VQAKIVIO.mjs → chunk-CSHGMI74.mjs} +2 -2
  25. package/out/__chunks__/{chunk-V2C7APME.mjs → chunk-CSTNJXBE.mjs} +2 -2
  26. package/out/__chunks__/chunk-CWQ4LFF5.mjs +2 -0
  27. package/out/__chunks__/{chunk-2S5FRZJR.mjs → chunk-EHU5RQBI.mjs} +2 -2
  28. package/out/__chunks__/{chunk-42LFLNPA.mjs → chunk-EKQLIEZD.mjs} +2 -2
  29. package/out/__chunks__/{chunk-FSCOQWQN.mjs → chunk-F32BTVEV.mjs} +2 -2
  30. package/out/__chunks__/chunk-F5V7QBOX.mjs +2 -0
  31. package/out/__chunks__/{chunk-745QCLQC.mjs → chunk-FIKCZQ2J.mjs} +2 -2
  32. package/out/__chunks__/{chunk-MRV6OG7P.mjs → chunk-FWJIV6IK.mjs} +2 -2
  33. package/out/__chunks__/chunk-FYSGC7MW.mjs +2 -0
  34. package/out/__chunks__/chunk-FZUIOPJF.mjs +2 -0
  35. package/out/__chunks__/{chunk-ISPOZQQO.mjs → chunk-GNZBRVMQ.mjs} +2 -2
  36. package/out/__chunks__/{chunk-P32DZ2CO.mjs → chunk-HCLEWSLP.mjs} +2 -2
  37. package/out/__chunks__/{chunk-VFAKQ7NM.mjs → chunk-HVAT2QP5.mjs} +2 -2
  38. package/out/__chunks__/{chunk-4QDHGYT4.mjs → chunk-IAKBA5XK.mjs} +2 -2
  39. package/out/__chunks__/{chunk-YKRSCVRE.mjs → chunk-J66NP5YS.mjs} +2 -2
  40. package/out/__chunks__/{chunk-GFTTAANM.mjs → chunk-JK5DKI6N.mjs} +2 -2
  41. package/out/__chunks__/{chunk-PHNC5JMP.mjs → chunk-JYG4XQGL.mjs} +2 -2
  42. package/out/__chunks__/chunk-JYG4XQGL.mjs.map +7 -0
  43. package/out/__chunks__/{chunk-HUITKXBO.mjs → chunk-KGDFAELQ.mjs} +2 -2
  44. package/out/__chunks__/{chunk-RBUHL65H.mjs → chunk-KPKKMTAV.mjs} +2 -2
  45. package/out/__chunks__/chunk-LX6L54F3.mjs +2 -0
  46. package/out/__chunks__/{chunk-I6BXGQLQ.mjs → chunk-LXGUUE34.mjs} +2 -2
  47. package/out/__chunks__/{chunk-H7BJSM6C.mjs → chunk-MK3PM2DT.mjs} +2 -2
  48. package/out/__chunks__/{chunk-SLH6IQJJ.mjs → chunk-MVWJW7DI.mjs} +2 -2
  49. package/out/__chunks__/{chunk-HXXZKQRJ.mjs → chunk-NV24F4LU.mjs} +2 -2
  50. package/out/__chunks__/chunk-O2IPPL6D.mjs +2 -0
  51. package/out/__chunks__/chunk-O75VXVPG.mjs +2 -0
  52. package/out/__chunks__/{chunk-6D2RBTVV.mjs → chunk-OP3F2KDT.mjs} +2 -2
  53. package/out/__chunks__/chunk-OPLNE5E4.mjs +2 -0
  54. package/out/__chunks__/{chunk-254WMLVS.mjs → chunk-P36YE74A.mjs} +2 -2
  55. package/out/__chunks__/chunk-P6A7X5MA.mjs +2 -0
  56. package/out/__chunks__/{chunk-TNXSVX5O.mjs → chunk-PKQWIPKE.mjs} +2 -2
  57. package/out/__chunks__/chunk-PY3U6O6G.mjs +2 -0
  58. package/out/__chunks__/{chunk-4TZC3NF3.mjs → chunk-PYBAW4QY.mjs} +2 -2
  59. package/out/__chunks__/{chunk-RFKBUN7S.mjs → chunk-RQ6IYTUI.mjs} +2 -2
  60. package/out/__chunks__/chunk-RXQV73QD.mjs +2 -0
  61. package/out/__chunks__/{chunk-U34BNBOX.mjs → chunk-SAHYDY7R.mjs} +2 -2
  62. package/out/__chunks__/{chunk-BQ2I655N.mjs → chunk-T25ZUXIB.mjs} +2 -2
  63. package/out/__chunks__/{chunk-FAOCLLIW.mjs → chunk-T2QCATZQ.mjs} +2 -2
  64. package/out/__chunks__/chunk-T4GLLB7R.mjs +2 -0
  65. package/out/__chunks__/{chunk-L4QPPHVR.mjs.map → chunk-T4GLLB7R.mjs.map} +1 -1
  66. package/out/__chunks__/{chunk-6G7ATMU7.mjs → chunk-TCXS5HPN.mjs} +2 -2
  67. package/out/__chunks__/{chunk-INWUHEQN.mjs → chunk-U5KZZ3SL.mjs} +2 -2
  68. package/out/__chunks__/{chunk-2EFXW7IG.mjs → chunk-UA3COBIJ.mjs} +2 -2
  69. package/out/__chunks__/{chunk-S4WKQEYF.mjs → chunk-UUCTTBX3.mjs} +2 -2
  70. package/out/__chunks__/{chunk-BHAZ2W52.mjs → chunk-V4LGVF2H.mjs} +2 -2
  71. package/out/__chunks__/chunk-VODKTFMS.mjs +2 -0
  72. package/out/__chunks__/{chunk-WPXNKIUP.mjs.map → chunk-VODKTFMS.mjs.map} +3 -3
  73. package/out/__chunks__/{chunk-ZWVYAOKB.mjs → chunk-WW5FDETV.mjs} +2 -2
  74. package/out/__chunks__/chunk-X2BF4TGY.mjs +2 -0
  75. package/out/__chunks__/{chunk-KSMSBTTQ.mjs → chunk-X34UQOZD.mjs} +2 -2
  76. package/out/__chunks__/{chunk-QSYQIJEO.mjs → chunk-X4ZHTAK3.mjs} +2 -2
  77. package/out/__chunks__/{chunk-O2DO3WJJ.mjs → chunk-XF7JEPPX.mjs} +2 -2
  78. package/out/__chunks__/{chunk-ID7WYMJZ.mjs → chunk-XT7JL5LN.mjs} +2 -2
  79. package/out/__chunks__/{chunk-D5SD7UPB.mjs → chunk-YJPW44AG.mjs} +2 -2
  80. package/out/__chunks__/{chunk-CJQAA4EP.mjs → chunk-YLFF3FGK.mjs} +2 -2
  81. package/out/__chunks__/{chunk-NPZ5PO2W.mjs → chunk-Z6USXJA6.mjs} +2 -2
  82. package/out/__chunks__/{chunk-YO3ATAA6.mjs → chunk-ZJO25VCQ.mjs} +2 -2
  83. package/out/__chunks__/{chunk-AF2QSDSV.mjs → chunk-ZOWAHQJJ.mjs} +2 -2
  84. package/out/__chunks__/{chunk-IXUYZYD2.mjs → chunk-ZOYKRLX3.mjs} +2 -2
  85. package/out/apiCalls/account/getScamAddressData.mjs +1 -1
  86. package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
  87. package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
  88. package/out/apiCalls/index.mjs +1 -1
  89. package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
  90. package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
  91. package/out/apiCalls/tokens/index.mjs +1 -1
  92. package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
  93. package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
  94. package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
  95. package/out/constants/browser.constants.mjs +1 -1
  96. package/out/constants/index.mjs +1 -1
  97. package/out/constants/storage.constants.mjs +1 -1
  98. package/out/constants/window.constants.mjs +1 -1
  99. package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
  100. package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
  101. package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
  102. package/out/controllers/TransactionsTableController/index.mjs +1 -1
  103. package/out/index.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.js +15 -5
  108. package/out/managers/TransactionManager/TransactionManager.js.map +1 -1
  109. package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
  110. package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
  111. package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
  112. package/out/managers/TransactionManager/index.mjs +1 -1
  113. package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
  114. package/out/managers/UnlockPanelManager/index.mjs +1 -1
  115. package/out/managers/index.mjs +1 -1
  116. package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
  117. package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
  118. package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
  119. package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
  120. package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
  121. package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
  122. package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
  123. package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
  124. package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
  125. package/out/managers/internal/ToastManager/ToastManager.mjs +1 -1
  126. package/out/managers/internal/ToastManager/helpers/LifetimeManager.mjs +1 -1
  127. package/out/managers/internal/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
  128. package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
  129. package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.mjs +1 -1
  130. package/out/managers/internal/WalletConnectStateManager/index.mjs +1 -1
  131. package/out/managers/internal/index.mjs +1 -1
  132. package/out/methods/account/getAccount.mjs +1 -1
  133. package/out/methods/account/getAccountInfo.mjs +1 -1
  134. package/out/methods/account/getAddress.mjs +1 -1
  135. package/out/methods/account/getIsLoggedIn.mjs +1 -1
  136. package/out/methods/account/getLatestNonce.mjs +1 -1
  137. package/out/methods/initApp/gastStationMetadata/setGasStationMetadata.mjs +1 -1
  138. package/out/methods/initApp/initApp.mjs +1 -1
  139. package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
  140. package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
  141. package/out/methods/loginInfo/getLoginInfo.mjs +1 -1
  142. package/out/methods/network/getEgldLabel.mjs +1 -1
  143. package/out/methods/network/getExplorerAddress.mjs +1 -1
  144. package/out/methods/network/getNetworkConfig.mjs +1 -1
  145. package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.mjs +1 -1
  146. package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.mjs +1 -1
  147. package/out/methods/trackTransactions/helpers/checkTransactionStatus/index.mjs +1 -1
  148. package/out/methods/trackTransactions/helpers/checkTransactionStatus/manageFailedTransactions.mjs +1 -1
  149. package/out/methods/trackTransactions/helpers/getPollingInterval.mjs +1 -1
  150. package/out/methods/trackTransactions/trackTransactions.mjs +1 -1
  151. package/out/methods/transactions/getFailedTransactions.mjs +1 -1
  152. package/out/methods/transactions/getFailedTransactionsSessions.mjs +1 -1
  153. package/out/methods/transactions/getPendingTransactions.mjs +1 -1
  154. package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
  155. package/out/methods/transactions/getSuccessfulTransactions.mjs +1 -1
  156. package/out/methods/transactions/getSuccessfulTransactionsSessions.mjs +1 -1
  157. package/out/methods/transactions/getTransactionSessions.mjs +1 -1
  158. package/out/providers/DappProvider/DappProvider.mjs +1 -1
  159. package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
  160. package/out/providers/DappProvider/helpers/login/helpers/extractAddressFromToken.mjs +1 -1
  161. package/out/providers/DappProvider/helpers/login/helpers/getAccountFromToken.mjs +1 -1
  162. package/out/providers/DappProvider/helpers/login/helpers/getModifiedLoginToken.mjs +1 -1
  163. package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
  164. package/out/providers/DappProvider/helpers/logout/logout.mjs +1 -1
  165. package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
  166. package/out/providers/DappProvider/helpers/signMessage/signMessageWithProvider.mjs +1 -1
  167. package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
  168. package/out/providers/DappProvider/index.mjs +1 -1
  169. package/out/providers/ProviderFactory.js +1 -5
  170. package/out/providers/ProviderFactory.js.map +1 -1
  171. package/out/providers/ProviderFactory.mjs +1 -1
  172. package/out/providers/helpers/accountProvider.mjs +1 -1
  173. package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
  174. package/out/providers/helpers/restoreProvider.mjs +1 -1
  175. package/out/providers/index.mjs +1 -1
  176. package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
  177. package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
  178. package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
  179. package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
  180. package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
  181. package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
  182. package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
  183. package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
  184. package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
  185. package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
  186. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
  187. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
  188. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
  189. package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
  190. package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
  191. package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
  192. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
  193. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
  194. package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
  195. package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.mjs +1 -1
  196. package/out/providers/strategies/WalletConnectProviderStrategy/index.mjs +1 -1
  197. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs +1 -1
  198. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs +1 -1
  199. package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.mjs +1 -1
  200. package/out/providers/strategies/WebviewProviderStrategy/index.mjs +1 -1
  201. package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
  202. package/out/providers/strategies/helpers/index.mjs +1 -1
  203. package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
  204. package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
  205. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
  206. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
  207. package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
  208. package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +1 -1
  209. package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
  210. package/out/providers/strategies/index.mjs +1 -1
  211. package/out/react/account/useGetAccount.mjs +1 -1
  212. package/out/react/account/useGetAccountInfo.mjs +1 -1
  213. package/out/react/account/useGetIsLoggedIn.mjs +1 -1
  214. package/out/react/account/useGetLatestNonce.mjs +1 -1
  215. package/out/react/index.mjs +1 -1
  216. package/out/react/loginInfo/useGetLoginInfo.mjs +1 -1
  217. package/out/react/network/useGetNetworkConfig.mjs +1 -1
  218. package/out/react/store/getReactStore.mjs +1 -1
  219. package/out/react/store/useSelector.mjs +1 -1
  220. package/out/react/transactions/useGetFailedTransactions.mjs +1 -1
  221. package/out/react/transactions/useGetFailedTransactionsSessions.mjs +1 -1
  222. package/out/react/transactions/useGetPendingTransactions.mjs +1 -1
  223. package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
  224. package/out/react/transactions/useGetSuccessfulTransactions.mjs +1 -1
  225. package/out/react/transactions/useGetSuccessfulTransactionsSessions.mjs +1 -1
  226. package/out/react/transactions/useGetTransactionSessions.mjs +1 -1
  227. package/out/services/index.mjs +1 -1
  228. package/out/services/nativeAuth/index.mjs +1 -1
  229. package/out/services/nativeAuth/methods/buildNativeAuthConfig.mjs +1 -1
  230. package/out/services/nativeAuth/methods/getDefaultNativeAuthConfig.mjs +1 -1
  231. package/out/services/nativeAuth/methods/index.mjs +1 -1
  232. package/out/services/nativeAuth/nativeAuth.mjs +1 -1
  233. package/out/store/actions/account/accountActions.mjs +1 -1
  234. package/out/store/actions/account/index.mjs +1 -1
  235. package/out/store/actions/cache/cacheActions.mjs +1 -1
  236. package/out/store/actions/cache/index.mjs +1 -1
  237. package/out/store/actions/config/configActions.mjs +1 -1
  238. package/out/store/actions/config/index.mjs +1 -1
  239. package/out/store/actions/index.mjs +1 -1
  240. package/out/store/actions/loginInfo/loginInfoActions.mjs +1 -1
  241. package/out/store/actions/network/index.mjs +1 -1
  242. package/out/store/actions/network/initializeNetwork.mjs +1 -1
  243. package/out/store/actions/network/networkActions.mjs +1 -1
  244. package/out/store/actions/sharedActions/index.mjs +1 -1
  245. package/out/store/actions/sharedActions/sharedActions.mjs +1 -1
  246. package/out/store/actions/toasts/index.mjs +1 -1
  247. package/out/store/actions/toasts/toastsActions.mjs +1 -1
  248. package/out/store/actions/transactions/transactionsActions.mjs +1 -1
  249. package/out/store/actions/ui/index.mjs +1 -1
  250. package/out/store/actions/ui/uiActions.mjs +1 -1
  251. package/out/store/middleware/applyMiddlewares.mjs +1 -1
  252. package/out/store/middleware/index.mjs +1 -1
  253. package/out/store/middleware/logoutMiddleware.mjs +1 -1
  254. package/out/store/storage/index.mjs +1 -1
  255. package/out/store/storage/storageCallback.mjs +1 -1
  256. package/out/store/store.mjs +1 -1
  257. package/out/utils/ComponentFactory.mjs +1 -1
  258. package/out/utils/account/index.mjs +1 -1
  259. package/out/utils/account/refreshAccount.mjs +1 -1
  260. package/out/utils/account/refreshNativeAuthTokenLogin.mjs +1 -1
  261. package/out/utils/index.mjs +1 -1
  262. package/out/utils/transactions/getActiveTransactionsStatus.mjs +1 -1
  263. package/out/utils/transactions/getInterpretedTransaction/getInterpretedTransaction.mjs +1 -1
  264. package/out/utils/transactions/getInterpretedTransaction/helpers/getLockedAccountName.mjs +1 -1
  265. package/out/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.mjs +1 -1
  266. package/out/utils/transactions/getInterpretedTransaction/helpers/getShardText.mjs +1 -1
  267. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionIconInfo.mjs +1 -1
  268. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionMessages.mjs +1 -1
  269. package/out/utils/transactions/getInterpretedTransaction/helpers/index.mjs +1 -1
  270. package/out/utils/transactions/getInterpretedTransaction/index.mjs +1 -1
  271. package/out/utils/transactions/getTransactionsHistory/getTransactionsHistory.mjs +1 -1
  272. package/out/utils/transactions/getTransactionsHistory/helpers/getCachedTransactionListItem.mjs +1 -1
  273. package/out/utils/transactions/getTransactionsHistory/helpers/index.mjs +1 -1
  274. package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.mjs +1 -1
  275. package/out/utils/transactions/getTransactionsHistory/index.mjs +1 -1
  276. package/out/utils/transactions/index.mjs +1 -1
  277. package/out/utils/visual/index.mjs +1 -1
  278. package/out/utils/visual/switchTheme.mjs +1 -1
  279. package/out/utils/window/getIsInIframe.mjs +1 -1
  280. package/out/utils/window/getWindowParentOrigin.mjs +1 -1
  281. package/out/utils/window/index.mjs +1 -1
  282. package/package.json +1 -1
  283. package/out/__chunks__/chunk-4AKPP7B3.mjs +0 -2
  284. package/out/__chunks__/chunk-4YZQBDUE.mjs +0 -2
  285. package/out/__chunks__/chunk-4ZZJX7E7.mjs +0 -2
  286. package/out/__chunks__/chunk-5LB2KNTP.mjs +0 -2
  287. package/out/__chunks__/chunk-5OM6KD5S.mjs +0 -2
  288. package/out/__chunks__/chunk-6GNNYFMN.mjs +0 -2
  289. package/out/__chunks__/chunk-6ZL2QC74.mjs +0 -2
  290. package/out/__chunks__/chunk-CBF72LQF.mjs +0 -2
  291. package/out/__chunks__/chunk-CIY7IH2N.mjs +0 -2
  292. package/out/__chunks__/chunk-DGYPNF4O.mjs +0 -2
  293. package/out/__chunks__/chunk-E7BYYSVM.mjs +0 -2
  294. package/out/__chunks__/chunk-I37JLMZH.mjs +0 -2
  295. package/out/__chunks__/chunk-IBSC2B7Q.mjs +0 -2
  296. package/out/__chunks__/chunk-L4QPPHVR.mjs +0 -2
  297. package/out/__chunks__/chunk-N2RYRHHL.mjs +0 -2
  298. package/out/__chunks__/chunk-PHNC5JMP.mjs.map +0 -7
  299. package/out/__chunks__/chunk-RSUHZ7IH.mjs +0 -2
  300. package/out/__chunks__/chunk-WPXNKIUP.mjs +0 -2
  301. package/out/__chunks__/chunk-YA5U6YEL.mjs +0 -2
  302. package/out/__chunks__/chunk-Z4OHB36I.mjs +0 -2
  303. /package/out/__chunks__/{chunk-E7BYYSVM.mjs.map → chunk-2A4BH65X.mjs.map} +0 -0
  304. /package/out/__chunks__/{chunk-NQ6SJRHZ.mjs.map → chunk-2EV6M7VE.mjs.map} +0 -0
  305. /package/out/__chunks__/{chunk-4XP7BVJD.mjs.map → chunk-2R5LWF2W.mjs.map} +0 -0
  306. /package/out/__chunks__/{chunk-6P7EXGAB.mjs.map → chunk-3AARPJLE.mjs.map} +0 -0
  307. /package/out/__chunks__/{chunk-FZFKEGPM.mjs.map → chunk-3L3E75PE.mjs.map} +0 -0
  308. /package/out/__chunks__/{chunk-2SIHYJET.mjs.map → chunk-3POGSGSD.mjs.map} +0 -0
  309. /package/out/__chunks__/{chunk-BVLXVOIC.mjs.map → chunk-3ZB7JXE7.mjs.map} +0 -0
  310. /package/out/__chunks__/{chunk-6RGWVDNQ.mjs.map → chunk-45ZH7OXW.mjs.map} +0 -0
  311. /package/out/__chunks__/{chunk-B7ZKW5ML.mjs.map → chunk-4EU55YPS.mjs.map} +0 -0
  312. /package/out/__chunks__/{chunk-JZ7434LN.mjs.map → chunk-4MZZTC2O.mjs.map} +0 -0
  313. /package/out/__chunks__/{chunk-CVPP4HQE.mjs.map → chunk-4WAEN6KC.mjs.map} +0 -0
  314. /package/out/__chunks__/{chunk-DGYPNF4O.mjs.map → chunk-5AJYN23S.mjs.map} +0 -0
  315. /package/out/__chunks__/{chunk-BG6QTPZ4.mjs.map → chunk-5HHIOEWB.mjs.map} +0 -0
  316. /package/out/__chunks__/{chunk-NJPTQNCT.mjs.map → chunk-6AI3AGZ4.mjs.map} +0 -0
  317. /package/out/__chunks__/{chunk-4YU2DWHA.mjs.map → chunk-6KWXVSHC.mjs.map} +0 -0
  318. /package/out/__chunks__/{chunk-5OM6KD5S.mjs.map → chunk-6LDLCMZI.mjs.map} +0 -0
  319. /package/out/__chunks__/{chunk-N2RYRHHL.mjs.map → chunk-7JIHOTRV.mjs.map} +0 -0
  320. /package/out/__chunks__/{chunk-6ZL2QC74.mjs.map → chunk-7Q275OU5.mjs.map} +0 -0
  321. /package/out/__chunks__/{chunk-BOAJJ4FX.mjs.map → chunk-7Z3LULCU.mjs.map} +0 -0
  322. /package/out/__chunks__/{chunk-VXLJWKLG.mjs.map → chunk-AG6XMOI3.mjs.map} +0 -0
  323. /package/out/__chunks__/{chunk-XPYJSDNF.mjs.map → chunk-AODYWSUW.mjs.map} +0 -0
  324. /package/out/__chunks__/{chunk-GT2HLNE7.mjs.map → chunk-AROH3QTC.mjs.map} +0 -0
  325. /package/out/__chunks__/{chunk-3NFKZZ7W.mjs.map → chunk-AWX5SSJV.mjs.map} +0 -0
  326. /package/out/__chunks__/{chunk-VQAKIVIO.mjs.map → chunk-CSHGMI74.mjs.map} +0 -0
  327. /package/out/__chunks__/{chunk-V2C7APME.mjs.map → chunk-CSTNJXBE.mjs.map} +0 -0
  328. /package/out/__chunks__/{chunk-6GNNYFMN.mjs.map → chunk-CWQ4LFF5.mjs.map} +0 -0
  329. /package/out/__chunks__/{chunk-2S5FRZJR.mjs.map → chunk-EHU5RQBI.mjs.map} +0 -0
  330. /package/out/__chunks__/{chunk-42LFLNPA.mjs.map → chunk-EKQLIEZD.mjs.map} +0 -0
  331. /package/out/__chunks__/{chunk-FSCOQWQN.mjs.map → chunk-F32BTVEV.mjs.map} +0 -0
  332. /package/out/__chunks__/{chunk-I37JLMZH.mjs.map → chunk-F5V7QBOX.mjs.map} +0 -0
  333. /package/out/__chunks__/{chunk-745QCLQC.mjs.map → chunk-FIKCZQ2J.mjs.map} +0 -0
  334. /package/out/__chunks__/{chunk-MRV6OG7P.mjs.map → chunk-FWJIV6IK.mjs.map} +0 -0
  335. /package/out/__chunks__/{chunk-CBF72LQF.mjs.map → chunk-FYSGC7MW.mjs.map} +0 -0
  336. /package/out/__chunks__/{chunk-4AKPP7B3.mjs.map → chunk-FZUIOPJF.mjs.map} +0 -0
  337. /package/out/__chunks__/{chunk-ISPOZQQO.mjs.map → chunk-GNZBRVMQ.mjs.map} +0 -0
  338. /package/out/__chunks__/{chunk-P32DZ2CO.mjs.map → chunk-HCLEWSLP.mjs.map} +0 -0
  339. /package/out/__chunks__/{chunk-VFAKQ7NM.mjs.map → chunk-HVAT2QP5.mjs.map} +0 -0
  340. /package/out/__chunks__/{chunk-4QDHGYT4.mjs.map → chunk-IAKBA5XK.mjs.map} +0 -0
  341. /package/out/__chunks__/{chunk-YKRSCVRE.mjs.map → chunk-J66NP5YS.mjs.map} +0 -0
  342. /package/out/__chunks__/{chunk-GFTTAANM.mjs.map → chunk-JK5DKI6N.mjs.map} +0 -0
  343. /package/out/__chunks__/{chunk-HUITKXBO.mjs.map → chunk-KGDFAELQ.mjs.map} +0 -0
  344. /package/out/__chunks__/{chunk-RBUHL65H.mjs.map → chunk-KPKKMTAV.mjs.map} +0 -0
  345. /package/out/__chunks__/{chunk-5LB2KNTP.mjs.map → chunk-LX6L54F3.mjs.map} +0 -0
  346. /package/out/__chunks__/{chunk-I6BXGQLQ.mjs.map → chunk-LXGUUE34.mjs.map} +0 -0
  347. /package/out/__chunks__/{chunk-H7BJSM6C.mjs.map → chunk-MK3PM2DT.mjs.map} +0 -0
  348. /package/out/__chunks__/{chunk-SLH6IQJJ.mjs.map → chunk-MVWJW7DI.mjs.map} +0 -0
  349. /package/out/__chunks__/{chunk-HXXZKQRJ.mjs.map → chunk-NV24F4LU.mjs.map} +0 -0
  350. /package/out/__chunks__/{chunk-4ZZJX7E7.mjs.map → chunk-O2IPPL6D.mjs.map} +0 -0
  351. /package/out/__chunks__/{chunk-RSUHZ7IH.mjs.map → chunk-O75VXVPG.mjs.map} +0 -0
  352. /package/out/__chunks__/{chunk-6D2RBTVV.mjs.map → chunk-OP3F2KDT.mjs.map} +0 -0
  353. /package/out/__chunks__/{chunk-CIY7IH2N.mjs.map → chunk-OPLNE5E4.mjs.map} +0 -0
  354. /package/out/__chunks__/{chunk-254WMLVS.mjs.map → chunk-P36YE74A.mjs.map} +0 -0
  355. /package/out/__chunks__/{chunk-IBSC2B7Q.mjs.map → chunk-P6A7X5MA.mjs.map} +0 -0
  356. /package/out/__chunks__/{chunk-TNXSVX5O.mjs.map → chunk-PKQWIPKE.mjs.map} +0 -0
  357. /package/out/__chunks__/{chunk-4YZQBDUE.mjs.map → chunk-PY3U6O6G.mjs.map} +0 -0
  358. /package/out/__chunks__/{chunk-4TZC3NF3.mjs.map → chunk-PYBAW4QY.mjs.map} +0 -0
  359. /package/out/__chunks__/{chunk-RFKBUN7S.mjs.map → chunk-RQ6IYTUI.mjs.map} +0 -0
  360. /package/out/__chunks__/{chunk-Z4OHB36I.mjs.map → chunk-RXQV73QD.mjs.map} +0 -0
  361. /package/out/__chunks__/{chunk-U34BNBOX.mjs.map → chunk-SAHYDY7R.mjs.map} +0 -0
  362. /package/out/__chunks__/{chunk-BQ2I655N.mjs.map → chunk-T25ZUXIB.mjs.map} +0 -0
  363. /package/out/__chunks__/{chunk-FAOCLLIW.mjs.map → chunk-T2QCATZQ.mjs.map} +0 -0
  364. /package/out/__chunks__/{chunk-6G7ATMU7.mjs.map → chunk-TCXS5HPN.mjs.map} +0 -0
  365. /package/out/__chunks__/{chunk-INWUHEQN.mjs.map → chunk-U5KZZ3SL.mjs.map} +0 -0
  366. /package/out/__chunks__/{chunk-2EFXW7IG.mjs.map → chunk-UA3COBIJ.mjs.map} +0 -0
  367. /package/out/__chunks__/{chunk-S4WKQEYF.mjs.map → chunk-UUCTTBX3.mjs.map} +0 -0
  368. /package/out/__chunks__/{chunk-BHAZ2W52.mjs.map → chunk-V4LGVF2H.mjs.map} +0 -0
  369. /package/out/__chunks__/{chunk-ZWVYAOKB.mjs.map → chunk-WW5FDETV.mjs.map} +0 -0
  370. /package/out/__chunks__/{chunk-YA5U6YEL.mjs.map → chunk-X2BF4TGY.mjs.map} +0 -0
  371. /package/out/__chunks__/{chunk-KSMSBTTQ.mjs.map → chunk-X34UQOZD.mjs.map} +0 -0
  372. /package/out/__chunks__/{chunk-QSYQIJEO.mjs.map → chunk-X4ZHTAK3.mjs.map} +0 -0
  373. /package/out/__chunks__/{chunk-O2DO3WJJ.mjs.map → chunk-XF7JEPPX.mjs.map} +0 -0
  374. /package/out/__chunks__/{chunk-ID7WYMJZ.mjs.map → chunk-XT7JL5LN.mjs.map} +0 -0
  375. /package/out/__chunks__/{chunk-D5SD7UPB.mjs.map → chunk-YJPW44AG.mjs.map} +0 -0
  376. /package/out/__chunks__/{chunk-CJQAA4EP.mjs.map → chunk-YLFF3FGK.mjs.map} +0 -0
  377. /package/out/__chunks__/{chunk-NPZ5PO2W.mjs.map → chunk-Z6USXJA6.mjs.map} +0 -0
  378. /package/out/__chunks__/{chunk-YO3ATAA6.mjs.map → chunk-ZJO25VCQ.mjs.map} +0 -0
  379. /package/out/__chunks__/{chunk-AF2QSDSV.mjs.map → chunk-ZOWAHQJJ.mjs.map} +0 -0
  380. /package/out/__chunks__/{chunk-IXUYZYD2.mjs.map → chunk-ZOYKRLX3.mjs.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{u as o}from"./chunk-IAKBA5XK.mjs";import{a as t}from"./chunk-QJSB5NX4.mjs";function n(r=o()){return t(r)}export{n as a};
2
+ //# sourceMappingURL=chunk-2A4BH65X.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as I}from"./chunk-PJDJEPY2.mjs";import{a as l}from"./chunk-IBSC2B7Q.mjs";import{a as f}from"./chunk-Z4OHB36I.mjs";import{j as m,k as d,l as p,n as u}from"./chunk-65L5EBBL.mjs";import{a as T}from"./chunk-XPYJSDNF.mjs";var q=async({toastList:S,transactionsSessions:g,account:o,existingCompletedTransactions:y=[]})=>{let n=[],a=[...y],r=l(),F=f();for(let t of S.transactionToasts){let e=g[t.toastId];if(!e?.status)continue;let{status:s,transactions:C,transactionsDisplayInfo:P}=e,x=await T({transactions:C,address:o.address,explorerAddress:r,egldLabel:F}),A=u(s),E=p(s),L=d(s),i=A||E||L,v=m(s),{startTime:R,endTime:b}=t;if(i&&a.some(h=>h.toastId===t.toastId))continue;let c=I({toastId:t.toastId,address:o.address,status:s,transactions:x,transactionsDisplayInfo:P,explorerAddress:r,startTime:R,endTime:b});i&&a.push(c),v&&n.push(c)}return{pendingTransactionToasts:n,completedTransactionToasts:a}};export{q as a};
2
- //# sourceMappingURL=chunk-NQ6SJRHZ.mjs.map
1
+ import{a as I}from"./chunk-PJDJEPY2.mjs";import{a as l}from"./chunk-P6A7X5MA.mjs";import{a as f}from"./chunk-RXQV73QD.mjs";import{j as m,k as d,l as p,n as u}from"./chunk-65L5EBBL.mjs";import{a as T}from"./chunk-AODYWSUW.mjs";var q=async({toastList:S,transactionsSessions:g,account:o,existingCompletedTransactions:y=[]})=>{let n=[],a=[...y],r=l(),F=f();for(let t of S.transactionToasts){let e=g[t.toastId];if(!e?.status)continue;let{status:s,transactions:C,transactionsDisplayInfo:P}=e,x=await T({transactions:C,address:o.address,explorerAddress:r,egldLabel:F}),A=u(s),E=p(s),L=d(s),i=A||E||L,v=m(s),{startTime:R,endTime:b}=t;if(i&&a.some(h=>h.toastId===t.toastId))continue;let c=I({toastId:t.toastId,address:o.address,status:s,transactions:x,transactionsDisplayInfo:P,explorerAddress:r,startTime:R,endTime:b});i&&a.push(c),v&&n.push(c)}return{pendingTransactionToasts:n,completedTransactionToasts:a}};export{q as a};
2
+ //# sourceMappingURL=chunk-2EV6M7VE.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-BOAJJ4FX.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-4XP7BVJD.mjs.map
1
+ import{a as i}from"./chunk-7Z3LULCU.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-2R5LWF2W.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-BQ2I655N.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-6P7EXGAB.mjs.map
1
+ import{a as t}from"./chunk-T25ZUXIB.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-3AARPJLE.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{s as u}from"./chunk-4QDHGYT4.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-FZFKEGPM.mjs.map
1
+ import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{s as u}from"./chunk-IAKBA5XK.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-3L3E75PE.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-E7BYYSVM.mjs";import{a as f}from"./chunk-P32DZ2CO.mjs";import{a as g}from"./chunk-CVPP4HQE.mjs";import{b as a}from"./chunk-4QDHGYT4.mjs";import{c as s,g as r}from"./chunk-R53MCZI6.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-2SIHYJET.mjs.map
1
+ import{a as u}from"./chunk-2A4BH65X.mjs";import{a as f}from"./chunk-HCLEWSLP.mjs";import{a as g}from"./chunk-4WAEN6KC.mjs";import{b as a}from"./chunk-IAKBA5XK.mjs";import{c as s,g as r}from"./chunk-R53MCZI6.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-3POGSGSD.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as V}from"./chunk-7Z7IX367.mjs";import{a as B}from"./chunk-VCQBYNNS.mjs";import{a as $}from"./chunk-O3V4TGXK.mjs";import{a as _}from"./chunk-AV4HSXYZ.mjs";import{a as U}from"./chunk-RBZC4PEU.mjs";import{a as R}from"./chunk-ROZAXUMC.mjs";import{a as M}from"./chunk-BETSOJFK.mjs";import{a as w}from"./chunk-YTFYVPZO.mjs";import{a as O}from"./chunk-YGI3KXMZ.mjs";import{a as x}from"./chunk-GT2HLNE7.mjs";import{a as v}from"./chunk-RYIJWGFA.mjs";import{t as G}from"./chunk-I6BXGQLQ.mjs";import{a as L}from"./chunk-IBSC2B7Q.mjs";import{a as h}from"./chunk-BRJNX4JF.mjs";import{a as b,c as C,f as u}from"./chunk-J4CPYFK6.mjs";import{a as P}from"./chunk-KD2IQ32V.mjs";import{c as f}from"./chunk-TI37DKBT.mjs";import{k as A}from"./chunk-LHEH7L4L.mjs";import{a as F}from"./chunk-L4QPPHVR.mjs";import{BigNumber as yt}from"bignumber.js";async function Kt({allTransactions:T,currentScreenIndex:m,egldLabel:o,network:e,gasPriceData:c,price:S,address:p,username:z,shard:j,signedIndexes:i,parsedTransactionsByDataField:q}){let t=T[m],H=t?.transaction?.sender.toString(),K=t?.transaction,D=null,y=null,W=R({egldLabel:o,sender:H,apiAddress:e.apiAddress,address:p,parsedTransactionsByDataField:q}),a=t.transaction.toPlainObject(),n=await W(t),d=!n?.transactionTokenInfo?.tokenId,{tokenId:g,nonce:l,amount:I=""}=n?.transactionTokenInfo??{},Z=g&&l&&l.length>0?`${g}-${l}`:g,J=await x({tokenId:Z}),{esdtPrice:Q,tokenDecimals:X,type:r,identifier:s,tokenImageUrl:Y}=J;if(r==="SemiFungibleESDT"||r==="NonFungibleESDT")y={type:r,identifier:s,amount:I,imageURL:Y};else{let E=({addCommas:Dt})=>u({input:d?t.transaction.value.toString():I,decimals:d?Number(e.decimals):X,digits:Number(e.digits),showLastNonZeroDecimal:!1,addCommas:Dt}),ut=E({addCommas:!0}),ft=E({addCommas:!1}),Tt=Number(d?S:Q),St=O({amount:ft,usd:Tt,addEqualSign:!0});D={identifier:(s===A?o:s)??o,amount:ut,usdValue:St}}let{feeLimitFormatted:tt,feeInFiatLimit:nt}=w({transaction:K,price:S}),ot=$({shard:j,initialGasPrice:c.initialGasPrice,transaction:a,gasStationMetadata:e.gasStationMetadata}),et=_({transaction:a,gasPriceData:c}),it=G().getType(),at=v(it),N=T.length,rt=i.length>0?i[i.length-1]+1:0,st=f(t.transaction.data.toString()??""),k=U(n?.transactionTokenInfo),mt=M({data:st,identifier:s,highlight:k}),ct=L(),pt=h({to:`/${P}/${p}`,explorerAddress:ct}),dt=N===1||n?.needsSigning&&!i.includes(m),gt=u({input:et.toString(),decimals:C,addCommas:!0,digits:b}),lt=new yt(a.gasLimit).toFormat({decimalSeparator:",",groupSeparator:".",groupSize:3});return{commonData:{receiver:a.receiver.toString(),data:f(t.transaction.data.toString()??""),decodedData:mt,gasPrice:gt,gasLimit:lt,explorerLink:pt,ppu:c.ppu,ppuOptions:ot,egldLabel:o,tokenType:V(r),feeLimit:tt,feeInFiatLimit:nt,transactionsCount:N,currentIndex:m,currentIndexToSign:rt,highlight:k,scCall:B(n?.transactionTokenInfo),needsSigning:dt,isEditable:n?.needsSigning,providerName:at,address:p,username:z,origin:F.location?.origin},tokenTransaction:D,fungibleTransaction:y}}export{Kt as a};
2
- //# sourceMappingURL=chunk-BVLXVOIC.mjs.map
1
+ import{a as V}from"./chunk-7Z7IX367.mjs";import{a as B}from"./chunk-VCQBYNNS.mjs";import{a as $}from"./chunk-O3V4TGXK.mjs";import{a as _}from"./chunk-AV4HSXYZ.mjs";import{a as U}from"./chunk-RBZC4PEU.mjs";import{a as R}from"./chunk-ROZAXUMC.mjs";import{a as M}from"./chunk-BETSOJFK.mjs";import{a as w}from"./chunk-YTFYVPZO.mjs";import{a as O}from"./chunk-YGI3KXMZ.mjs";import{a as x}from"./chunk-AROH3QTC.mjs";import{a as v}from"./chunk-RYIJWGFA.mjs";import{t as G}from"./chunk-LXGUUE34.mjs";import{a as L}from"./chunk-P6A7X5MA.mjs";import{a as h}from"./chunk-BRJNX4JF.mjs";import{a as b,c as C,f as u}from"./chunk-J4CPYFK6.mjs";import{a as P}from"./chunk-KD2IQ32V.mjs";import{c as f}from"./chunk-TI37DKBT.mjs";import{k as A}from"./chunk-LHEH7L4L.mjs";import{a as F}from"./chunk-T4GLLB7R.mjs";import{BigNumber as yt}from"bignumber.js";async function Kt({allTransactions:T,currentScreenIndex:m,egldLabel:o,network:e,gasPriceData:c,price:S,address:p,username:z,shard:j,signedIndexes:i,parsedTransactionsByDataField:q}){let t=T[m],H=t?.transaction?.sender.toString(),K=t?.transaction,D=null,y=null,W=R({egldLabel:o,sender:H,apiAddress:e.apiAddress,address:p,parsedTransactionsByDataField:q}),a=t.transaction.toPlainObject(),n=await W(t),d=!n?.transactionTokenInfo?.tokenId,{tokenId:g,nonce:l,amount:I=""}=n?.transactionTokenInfo??{},Z=g&&l&&l.length>0?`${g}-${l}`:g,J=await x({tokenId:Z}),{esdtPrice:Q,tokenDecimals:X,type:r,identifier:s,tokenImageUrl:Y}=J;if(r==="SemiFungibleESDT"||r==="NonFungibleESDT")y={type:r,identifier:s,amount:I,imageURL:Y};else{let E=({addCommas:Dt})=>u({input:d?t.transaction.value.toString():I,decimals:d?Number(e.decimals):X,digits:Number(e.digits),showLastNonZeroDecimal:!1,addCommas:Dt}),ut=E({addCommas:!0}),ft=E({addCommas:!1}),Tt=Number(d?S:Q),St=O({amount:ft,usd:Tt,addEqualSign:!0});D={identifier:(s===A?o:s)??o,amount:ut,usdValue:St}}let{feeLimitFormatted:tt,feeInFiatLimit:nt}=w({transaction:K,price:S}),ot=$({shard:j,initialGasPrice:c.initialGasPrice,transaction:a,gasStationMetadata:e.gasStationMetadata}),et=_({transaction:a,gasPriceData:c}),it=G().getType(),at=v(it),N=T.length,rt=i.length>0?i[i.length-1]+1:0,st=f(t.transaction.data.toString()??""),k=U(n?.transactionTokenInfo),mt=M({data:st,identifier:s,highlight:k}),ct=L(),pt=h({to:`/${P}/${p}`,explorerAddress:ct}),dt=N===1||n?.needsSigning&&!i.includes(m),gt=u({input:et.toString(),decimals:C,addCommas:!0,digits:b}),lt=new yt(a.gasLimit).toFormat({decimalSeparator:",",groupSeparator:".",groupSize:3});return{commonData:{receiver:a.receiver.toString(),data:f(t.transaction.data.toString()??""),decodedData:mt,gasPrice:gt,gasLimit:lt,explorerLink:pt,ppu:c.ppu,ppuOptions:ot,egldLabel:o,tokenType:V(r),feeLimit:tt,feeInFiatLimit:nt,transactionsCount:N,currentIndex:m,currentIndexToSign:rt,highlight:k,scCall:B(n?.transactionTokenInfo),needsSigning:dt,isEditable:n?.needsSigning,providerName:at,address:p,username:z,origin:F.location?.origin},tokenTransaction:D,fungibleTransaction:y}}export{Kt as a};
2
+ //# sourceMappingURL=chunk-3ZB7JXE7.mjs.map
@@ -1,2 +1,2 @@
1
- import{u as r}from"./chunk-4QDHGYT4.mjs";import{b as e}from"./chunk-SAAOQW7P.mjs";var d=s=>{let o=e(r()),t=s??o.apiAddress;return t.endsWith("/")?t.slice(0,-1):t};export{d as a};
2
- //# sourceMappingURL=chunk-6RGWVDNQ.mjs.map
1
+ import{u as r}from"./chunk-IAKBA5XK.mjs";import{b as e}from"./chunk-SAAOQW7P.mjs";var d=s=>{let o=e(r()),t=s??o.apiAddress;return t.endsWith("/")?t.slice(0,-1):t};export{d as a};
2
+ //# sourceMappingURL=chunk-45ZH7OXW.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-AF2QSDSV.mjs";import{b as r}from"./chunk-FZFKEGPM.mjs";import{u as i}from"./chunk-4QDHGYT4.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";async function M({shard:t,apiAddress:s}){if(t!=null)try{let a=await n(t,s);if(!a?.[t]?.lastBlock)return;let e=o(i());(!e.gasStationMetadata||!e.gasStationMetadata[t]||e.gasStationMetadata[t].lastBlock!==a[t].lastBlock)&&r({...e,gasStationMetadata:{...e.gasStationMetadata,...a}})}catch(a){console.error("Error fetching gas station metadata:",a)}}export{M as a};
2
- //# sourceMappingURL=chunk-B7ZKW5ML.mjs.map
1
+ import{a as n}from"./chunk-ZOWAHQJJ.mjs";import{b as r}from"./chunk-3L3E75PE.mjs";import{u as i}from"./chunk-IAKBA5XK.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";async function M({shard:t,apiAddress:s}){if(t!=null)try{let a=await n(t,s);if(!a?.[t]?.lastBlock)return;let e=o(i());(!e.gasStationMetadata||!e.gasStationMetadata[t]||e.gasStationMetadata[t].lastBlock!==a[t].lastBlock)&&r({...e,gasStationMetadata:{...e.gasStationMetadata,...a}})}catch(a){console.error("Error fetching gas station metadata:",a)}}export{M as a};
2
+ //# sourceMappingURL=chunk-4EU55YPS.mjs.map
@@ -1,2 +1,2 @@
1
- import{s as a}from"./chunk-4QDHGYT4.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-JZ7434LN.mjs.map
1
+ import{s as a}from"./chunk-IAKBA5XK.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-4MZZTC2O.mjs.map
@@ -1,2 +1,2 @@
1
- import{u as e}from"./chunk-4QDHGYT4.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";import{a as i}from"./chunk-CKTFPRJS.mjs";var n="https://api.multiversx.com",s=60*60*24,a=5*60,d=t=>{let r=o(e());return{origin:t?.origin||i().origin,apiAddress:t?.apiAddress||r.apiAddress||n,expirySeconds:t?.expirySeconds||s,tokenExpirationToastWarningSeconds:t?.tokenExpirationToastWarningSeconds||a}};export{d as a};
2
- //# sourceMappingURL=chunk-CVPP4HQE.mjs.map
1
+ import{u as e}from"./chunk-IAKBA5XK.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";import{a as i}from"./chunk-CKTFPRJS.mjs";var n="https://api.multiversx.com",s=60*60*24,a=5*60,d=t=>{let r=o(e());return{origin:t?.origin||i().origin,apiAddress:t?.apiAddress||r.apiAddress||n,expirySeconds:t?.expirySeconds||s,tokenExpirationToastWarningSeconds:t?.tokenExpirationToastWarningSeconds||a}};export{d as a};
2
+ //# sourceMappingURL=chunk-4WAEN6KC.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-F5V7QBOX.mjs";function S(e){return t()(e)}export{S as a};
2
+ //# sourceMappingURL=chunk-5AJYN23S.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as B}from"./chunk-5OM6KD5S.mjs";import{a as b}from"./chunk-NPZ5PO2W.mjs";import{a as k}from"./chunk-QXC4D3AC.mjs";import{a as R}from"./chunk-OD4ANAAQ.mjs";import{a as D}from"./chunk-BVLXVOIC.mjs";import{a as I}from"./chunk-AV4HSXYZ.mjs";import{a as j}from"./chunk-YTFYVPZO.mjs";import{a as _}from"./chunk-3NFKZZ7W.mjs";import{a as A}from"./chunk-MRV6OG7P.mjs";import{a as O}from"./chunk-Z4OHB36I.mjs";import{u as x}from"./chunk-4QDHGYT4.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-J4CPYFK6.mjs";import{a as w}from"./chunk-R53MCZI6.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard:E,username:h}}=B(),g=v(x()),C=O(),{allTransactions:e,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(e.map(t=>t.transaction));let l=Y?.price,a=0,T=async()=>{let c=e[a]?.transaction,i=Number(c.nonce);try{n.updateIsLoading(!0);let{commonData:r,tokenTransaction:o,fungibleTransaction:s}=await D({allTransactions:e,currentScreenIndex:a,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:h,shard:E,signedIndexes:p,parsedTransactionsByDataField:L});o&&n.updateTokenTransaction(o),s&&n.updateNonFungibleTransaction(s.type,s),n.updateCommonData(r)}catch(r){console.error(`Error fetching common data for transaction at index ${a}:`,r)}finally{n.updateIsLoading(!1)}},$=()=>{a>0&&(a--,T())},q=(t=0)=>{let i=e[a].transaction,r=Number(i.nonce);n.updateGasPriceMap({nonce:r,ppu:t}),n.updateCommonData({ppu:t});let o=i.toPlainObject(),s=I({transaction:o,gasPriceData:n.ppuMap[r]}),P=w.newFromPlainObject({...o,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:t})},J=async()=>{M(new Error("Transaction signing cancelled by user")),await b(),n.closeUI()},f=()=>{a<n.transactionsCount-1&&(a++,T())},Q=async()=>{let c=e[a].transaction,i=Number(c.nonce),{commonData:r}=await D({allTransactions:e,currentScreenIndex:a,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:h,shard:E,signedIndexes:p,parsedTransactionsByDataField:L});if(!r.needsSigning)return p.push(a),f();let o=c.toPlainObject(),s=o.nonce,P=I({transaction:o,gasPriceData:n.ppuMap[s]}),u=w.newFromPlainObject({...o,gasPrice:P});try{let m=await H([u]);m&&(p.push(a),d.push(m[0]));let nn=a===e.length-1,an=e.filter(S=>S.needsSigning),tn=d.length===an.length;if(nn&&tn){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[t,c]of V)n.subscribeToEventBus(t,c)}Z(),await T()})}export{Dn as a};
2
- //# sourceMappingURL=chunk-BG6QTPZ4.mjs.map
1
+ import{a as B}from"./chunk-6LDLCMZI.mjs";import{a as b}from"./chunk-Z6USXJA6.mjs";import{a as k}from"./chunk-QXC4D3AC.mjs";import{a as R}from"./chunk-OD4ANAAQ.mjs";import{a as D}from"./chunk-3ZB7JXE7.mjs";import{a as I}from"./chunk-AV4HSXYZ.mjs";import{a as j}from"./chunk-YTFYVPZO.mjs";import{a as _}from"./chunk-AWX5SSJV.mjs";import{a as A}from"./chunk-FWJIV6IK.mjs";import{a as O}from"./chunk-RXQV73QD.mjs";import{u as x}from"./chunk-IAKBA5XK.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-J4CPYFK6.mjs";import{a as w}from"./chunk-R53MCZI6.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard:E,username:h}}=B(),g=v(x()),C=O(),{allTransactions:e,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(e.map(t=>t.transaction));let l=Y?.price,a=0,T=async()=>{let c=e[a]?.transaction,i=Number(c.nonce);try{n.updateIsLoading(!0);let{commonData:r,tokenTransaction:o,fungibleTransaction:s}=await D({allTransactions:e,currentScreenIndex:a,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:h,shard:E,signedIndexes:p,parsedTransactionsByDataField:L});o&&n.updateTokenTransaction(o),s&&n.updateNonFungibleTransaction(s.type,s),n.updateCommonData(r)}catch(r){console.error(`Error fetching common data for transaction at index ${a}:`,r)}finally{n.updateIsLoading(!1)}},$=()=>{a>0&&(a--,T())},q=(t=0)=>{let i=e[a].transaction,r=Number(i.nonce);n.updateGasPriceMap({nonce:r,ppu:t}),n.updateCommonData({ppu:t});let o=i.toPlainObject(),s=I({transaction:o,gasPriceData:n.ppuMap[r]}),P=w.newFromPlainObject({...o,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:t})},J=async()=>{M(new Error("Transaction signing cancelled by user")),await b(),n.closeUI()},f=()=>{a<n.transactionsCount-1&&(a++,T())},Q=async()=>{let c=e[a].transaction,i=Number(c.nonce),{commonData:r}=await D({allTransactions:e,currentScreenIndex:a,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:h,shard:E,signedIndexes:p,parsedTransactionsByDataField:L});if(!r.needsSigning)return p.push(a),f();let o=c.toPlainObject(),s=o.nonce,P=I({transaction:o,gasPriceData:n.ppuMap[s]}),u=w.newFromPlainObject({...o,gasPrice:P});try{let m=await H([u]);m&&(p.push(a),d.push(m[0]));let nn=a===e.length-1,an=e.filter(S=>S.needsSigning),tn=d.length===an.length;if(nn&&tn){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[t,c]of V)n.subscribeToEventBus(t,c)}Z(),await T()})}export{Dn as a};
2
+ //# sourceMappingURL=chunk-5HHIOEWB.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-55W25Q35.mjs";import{a as r}from"./chunk-XPYJSDNF.mjs";import e from"lodash.isempty";var p=async({transactionsSessions:t,address:i,explorerAddress:a,egldLabel:o})=>{if(e(t))return[];let n=s(t);return r({transactions:n,address:i,explorerAddress:a,egldLabel:o})};export{p as a};
2
- //# sourceMappingURL=chunk-NJPTQNCT.mjs.map
1
+ import{a as s}from"./chunk-55W25Q35.mjs";import{a as r}from"./chunk-AODYWSUW.mjs";import e from"lodash.isempty";var p=async({transactionsSessions:t,address:i,explorerAddress:a,egldLabel:o})=>{if(e(t))return[];let n=s(t);return r({transactions:n,address:i,explorerAddress:a,egldLabel:o})};export{p as a};
2
+ //# sourceMappingURL=chunk-6AI3AGZ4.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-VMFJUT3G.mjs";import{a as e}from"./chunk-L4QPPHVR.mjs";var n=class{static get create(){return this.createComponent}static set create(t){this.createComponent=t}};n.createComponent=async({name:t,anchor:o})=>{if(await r(e),!e.document)return{};let m=e.document.createElement(t);return(o||e.document.body).appendChild(m),await customElements.whenDefined(t),m};export{n as a};
2
- //# sourceMappingURL=chunk-4YU2DWHA.mjs.map
1
+ import{a as r}from"./chunk-VMFJUT3G.mjs";import{a as e}from"./chunk-T4GLLB7R.mjs";var n=class{static get create(){return this.createComponent}static set create(t){this.createComponent=t}};n.createComponent=async({name:t,anchor:o})=>{if(await r(e),!e.document)return{};let m=e.document.createElement(t);return(o||e.document.body).appendChild(m),await customElements.whenDefined(t),m};export{n as a};
2
+ //# sourceMappingURL=chunk-6KWXVSHC.mjs.map
@@ -0,0 +1,2 @@
1
+ import{u as o}from"./chunk-IAKBA5XK.mjs";import{b as t}from"./chunk-QJSB5NX4.mjs";function c(r=o()){return t(r)}export{c as a};
2
+ //# sourceMappingURL=chunk-6LDLCMZI.mjs.map
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-CAA4VJRH.mjs";import{u as o}from"./chunk-IAKBA5XK.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-7JIHOTRV.mjs.map
@@ -0,0 +1,2 @@
1
+ import{u as t}from"./chunk-IAKBA5XK.mjs";import{c as r}from"./chunk-QJSB5NX4.mjs";function m(e=t()){return r(e)}export{m as a};
2
+ //# sourceMappingURL=chunk-7Q275OU5.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-4YU2DWHA.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-BOAJJ4FX.mjs.map
1
+ import{a as s}from"./chunk-6KWXVSHC.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-7Z3LULCU.mjs.map
@@ -1,2 +1,2 @@
1
- import{l as p,s as e}from"./chunk-4QDHGYT4.mjs";import{c as i}from"./chunk-R53MCZI6.mjs";var T=()=>e().setState(p),m=({address:o,providerType:d})=>{e().setState(({account:r,loginInfo:t})=>{r.address=o,r.publicKey=new i(o).hex(),t&&(t.providerType=d)},!1,"loginAction")};export{T as a,m as b};
2
- //# sourceMappingURL=chunk-VXLJWKLG.mjs.map
1
+ import{l as p,s as e}from"./chunk-IAKBA5XK.mjs";import{c as i}from"./chunk-R53MCZI6.mjs";var T=()=>e().setState(p),m=({address:o,providerType:d})=>{e().setState(({account:r,loginInfo:t})=>{r.address=o,r.publicKey=new i(o).hex(),t&&(t.providerType=d)},!1,"loginAction")};export{T as a,m as b};
2
+ //# sourceMappingURL=chunk-AG6XMOI3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-H7BJSM6C.mjs";import{a as p}from"./chunk-JZ7434LN.mjs";import{a as d}from"./chunk-RSUHZ7IH.mjs";import{a as T}from"./chunk-LUDF7ZUR.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-XPYJSDNF.mjs.map
1
+ import{a as h}from"./chunk-MK3PM2DT.mjs";import{a as p}from"./chunk-4MZZTC2O.mjs";import{a as d}from"./chunk-O75VXVPG.mjs";import{a as T}from"./chunk-LUDF7ZUR.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-AODYWSUW.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-HBQQS6GA.mjs";import{u as m}from"./chunk-4QDHGYT4.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-GT2HLNE7.mjs.map
1
+ import{a as g}from"./chunk-HBQQS6GA.mjs";import{u as m}from"./chunk-IAKBA5XK.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-AROH3QTC.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-FKBLKOLI.mjs";import{a as t}from"./chunk-U64LDJTG.mjs";import{a as o}from"./chunk-E7BYYSVM.mjs";import{u as n}from"./chunk-4QDHGYT4.mjs";import{b as e}from"./chunk-SAAOQW7P.mjs";var w=async r=>{let{isGuarded:s}=o();if(!i({isGuarded:s,transactions:r}))return r;let a=r[0].getSender().bech32().toString(),{walletAddress:d}=e(n());return await(await t({address:a,walletUrl:d}))?.guardTransactions(r)||[]};export{w as a};
2
- //# sourceMappingURL=chunk-3NFKZZ7W.mjs.map
1
+ import{a as i}from"./chunk-FKBLKOLI.mjs";import{a as t}from"./chunk-U64LDJTG.mjs";import{a as o}from"./chunk-2A4BH65X.mjs";import{u as n}from"./chunk-IAKBA5XK.mjs";import{b as e}from"./chunk-SAAOQW7P.mjs";var w=async r=>{let{isGuarded:s}=o();if(!i({isGuarded:s,transactions:r}))return r;let a=r[0].getSender().bech32().toString(),{walletAddress:d}=e(n());return await(await t({address:a,walletUrl:d}))?.guardTransactions(r)||[]};export{w as a};
2
+ //# sourceMappingURL=chunk-AWX5SSJV.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as o,c as i}from"./chunk-QJGFIK7H.mjs";import{t as g}from"./chunk-I6BXGQLQ.mjs";import{s as u}from"./chunk-4QDHGYT4.mjs";import{a as p}from"./chunk-QJSB5NX4.mjs";import{a as h,c as l,g as c}from"./chunk-R53MCZI6.mjs";import{a as y}from"./chunk-L4QPPHVR.mjs";var M=class{constructor({onLoginCancelled:e}){this.handlers=new Map;this.store=u();this.isLoginInitiated=!1;this.handleMessage=this.handleMessage.bind(this),this.handleLoginCancelled=e}startListening(){y.addEventListener("message",this.handleMessage)}stopListening(){y.removeEventListener("message",this.handleMessage)}registerEvent(e,s){this.handlers.set(e,s)}unregisterEvent(e){this.handlers.delete(e)}async handleMessage(e){let s=e.data?.type;if(typeof s=="string"&&this.handlers.has(s))return this.handlers.get(s)?.(e);switch(s){case o.finalizeHandshakeRequest:this.handshake({event:e});break;case o.signMessageRequest:this.signMessage({event:e,payload:e.data.payload});break;case o.loginRequest:this.isLoginInitiated=!0,this.login({event:e,payload:e.data.payload});break;case o.signTransactionsRequest:this.signTransactions({event:e});break;case i.cancelResponse:case"cancelAction":this.isLoginInitiated&&await this.handleLoginCancelled();break;default:break}}async login({event:e,payload:s}){let a=s?.token;if(a)try{let{address:t}=p(this.store.getState()),r=g(),n=new c({address:new l(t),data:new Uint8Array(Buffer.from(a))}),d=(await r.signMessage(n))?.signature??"";e.source?.postMessage({type:i.loginResponse,payload:{data:{address:t,signature:Buffer.from(d).toString("hex")}}},{targetOrigin:e.origin})}catch{this.isLoginInitiated&&this.handleLoginCancelled()}finally{this.isLoginInitiated=!1}}handshake({event:e}){let s=Date.now().toString();e.source?.postMessage({type:i.finalizeHandshakeResponse,payload:{data:s}},{targetOrigin:e.origin})}async signMessage({event:e,payload:s}){let{address:a}=p(this.store.getState()),{message:t}=s;try{let r=new c({address:new l(a),data:new Uint8Array(Buffer.from(t))}),d=(await g().signMessage(r))?.signature??"";e.source?.postMessage({type:i.signMessageResponse,payload:{data:{signature:Buffer.from(d).toString("hex"),status:"signed"}}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign message")}}async signTransactions({event:e}){let s=g(),{payload:a}=e.data;if(Array.isArray(a))try{let t=a.map(n=>h.newFromPlainObject(n)),r=await s.signTransactions(t);e.source?.postMessage({type:i.signTransactionsResponse,payload:{data:r.map(n=>n.toPlainObject())}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign transactions")}}};export{M as a};
2
- //# sourceMappingURL=chunk-VQAKIVIO.mjs.map
1
+ import{b as o,c as i}from"./chunk-QJGFIK7H.mjs";import{t as g}from"./chunk-LXGUUE34.mjs";import{s as u}from"./chunk-IAKBA5XK.mjs";import{a as p}from"./chunk-QJSB5NX4.mjs";import{a as h,c as l,g as c}from"./chunk-R53MCZI6.mjs";import{a as y}from"./chunk-T4GLLB7R.mjs";var M=class{constructor({onLoginCancelled:e}){this.handlers=new Map;this.store=u();this.isLoginInitiated=!1;this.handleMessage=this.handleMessage.bind(this),this.handleLoginCancelled=e}startListening(){y.addEventListener("message",this.handleMessage)}stopListening(){y.removeEventListener("message",this.handleMessage)}registerEvent(e,s){this.handlers.set(e,s)}unregisterEvent(e){this.handlers.delete(e)}async handleMessage(e){let s=e.data?.type;if(typeof s=="string"&&this.handlers.has(s))return this.handlers.get(s)?.(e);switch(s){case o.finalizeHandshakeRequest:this.handshake({event:e});break;case o.signMessageRequest:this.signMessage({event:e,payload:e.data.payload});break;case o.loginRequest:this.isLoginInitiated=!0,this.login({event:e,payload:e.data.payload});break;case o.signTransactionsRequest:this.signTransactions({event:e});break;case i.cancelResponse:case"cancelAction":this.isLoginInitiated&&await this.handleLoginCancelled();break;default:break}}async login({event:e,payload:s}){let a=s?.token;if(a)try{let{address:t}=p(this.store.getState()),r=g(),n=new c({address:new l(t),data:new Uint8Array(Buffer.from(a))}),d=(await r.signMessage(n))?.signature??"";e.source?.postMessage({type:i.loginResponse,payload:{data:{address:t,signature:Buffer.from(d).toString("hex")}}},{targetOrigin:e.origin})}catch{this.isLoginInitiated&&this.handleLoginCancelled()}finally{this.isLoginInitiated=!1}}handshake({event:e}){let s=Date.now().toString();e.source?.postMessage({type:i.finalizeHandshakeResponse,payload:{data:s}},{targetOrigin:e.origin})}async signMessage({event:e,payload:s}){let{address:a}=p(this.store.getState()),{message:t}=s;try{let r=new c({address:new l(a),data:new Uint8Array(Buffer.from(t))}),d=(await g().signMessage(r))?.signature??"";e.source?.postMessage({type:i.signMessageResponse,payload:{data:{signature:Buffer.from(d).toString("hex"),status:"signed"}}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign message")}}async signTransactions({event:e}){let s=g(),{payload:a}=e.data;if(Array.isArray(a))try{let t=a.map(n=>h.newFromPlainObject(n)),r=await s.signTransactions(t);e.source?.postMessage({type:i.signTransactionsResponse,payload:{data:r.map(n=>n.toPlainObject())}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign transactions")}}};export{M as a};
2
+ //# sourceMappingURL=chunk-CSHGMI74.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-2EFXW7IG.mjs";async function i(a){let n=e.getInstance();return await n.openUI(),{manager:n,onClose:async({shouldCancelAction:t=!0}={})=>{n.closeUI(),t&&a?.cancelAction&&await a.cancelAction()}}}export{i as a};
2
- //# sourceMappingURL=chunk-V2C7APME.mjs.map
1
+ import{a as e}from"./chunk-UA3COBIJ.mjs";async function i(a){let n=e.getInstance();return await n.openUI(),{manager:n,onClose:async({shouldCancelAction:t=!0}={})=>{n.closeUI(),t&&a?.cancelAction&&await a.cancelAction()}}}export{i as a};
2
+ //# sourceMappingURL=chunk-CSTNJXBE.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-6AI3AGZ4.mjs";var o={async getTransactionsHistory(s){return await t(s)}};export{o as a};
2
+ //# sourceMappingURL=chunk-CWQ4LFF5.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-V2C7APME.mjs";import{a as e}from"./chunk-6ZL2QC74.mjs";import{a as i}from"./chunk-TI73UXGG.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-2S5FRZJR.mjs.map
1
+ import{a as s}from"./chunk-CSTNJXBE.mjs";import{a as e}from"./chunk-7Q275OU5.mjs";import{a as i}from"./chunk-TI73UXGG.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-EHU5RQBI.mjs.map
@@ -1,2 +1,2 @@
1
- import{e as o,f as a,g as i,h as r}from"./chunk-TQA3JDNV.mjs";import{u as c}from"./chunk-4QDHGYT4.mjs";function b(){let t=c(),l=r(t),u=i(t),T=a(t),d=o(t),e=Object.keys(d)?.length>0,n=!e&&Object.keys(l)?.length>0,s=!e&&!n&&Object.keys(u)?.length>0,f=!e&&!n&&!s&&Object.keys(T).length>0;return{pending:e,timedOut:n,fail:s,success:f}}export{b as a};
2
- //# sourceMappingURL=chunk-42LFLNPA.mjs.map
1
+ import{e as o,f as a,g as i,h as r}from"./chunk-TQA3JDNV.mjs";import{u as c}from"./chunk-IAKBA5XK.mjs";function b(){let t=c(),l=r(t),u=i(t),T=a(t),d=o(t),e=Object.keys(d)?.length>0,n=!e&&Object.keys(l)?.length>0,s=!e&&!n&&Object.keys(u)?.length>0,f=!e&&!n&&!s&&Object.keys(T).length>0;return{pending:e,timedOut:n,fail:s,success:f}}export{b as a};
2
+ //# sourceMappingURL=chunk-EKQLIEZD.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-CVPP4HQE.mjs";var i=e=>{let t=a();return{origin:e?.origin??t.origin,blockHashShard:e?.blockHashShard,expirySeconds:e?.expirySeconds??t.expirySeconds,apiAddress:e?.apiAddress??t.apiAddress,tokenExpirationToastWarningSeconds:e?.tokenExpirationToastWarningSeconds??t.tokenExpirationToastWarningSeconds,extraInfo:e?.extraInfo??{},gatewayUrl:e?.gatewayUrl,extraRequestHeaders:e?.extraRequestHeaders??{}}};export{i as a};
2
- //# sourceMappingURL=chunk-FSCOQWQN.mjs.map
1
+ import{a}from"./chunk-4WAEN6KC.mjs";var i=e=>{let t=a();return{origin:e?.origin??t.origin,blockHashShard:e?.blockHashShard,expirySeconds:e?.expirySeconds??t.expirySeconds,apiAddress:e?.apiAddress??t.apiAddress,tokenExpirationToastWarningSeconds:e?.tokenExpirationToastWarningSeconds??t.tokenExpirationToastWarningSeconds,extraInfo:e?.extraInfo??{},gatewayUrl:e?.gatewayUrl,extraRequestHeaders:e?.extraRequestHeaders??{}}};export{i as a};
2
+ //# sourceMappingURL=chunk-F32BTVEV.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-EMIDMARK.mjs";import{s as e}from"./chunk-IAKBA5XK.mjs";var m=()=>t(e());export{m as a};
2
+ //# sourceMappingURL=chunk-F5V7QBOX.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-U34BNBOX.mjs";import{a as S}from"./chunk-SLH6IQJJ.mjs";import{a as o}from"./chunk-FMQYLMTU.mjs";import{a as y}from"./chunk-MFUQ5NBC.mjs";import{b as i,c as f}from"./chunk-O2DO3WJJ.mjs";import{l}from"./chunk-65L5EBBL.mjs";var u={};async function d({serverTransaction:e,sessionId:t,isSequential:c}){let{hash:a,status:r,results:m,invalidTransaction:n,hasStatusChanged:p}=e;try{if(u[a]>30){i({sessionId:t,status:"timedOut"}),await o({sessionId:t,status:"timedOut"});return}if(n&&!c||r==="sent"){u[a]=u[a]?u[a]+1:1;return}if(c&&!r){let s=f({sessionId:t,transaction:e});await o({sessionId:t,status:s});return}if(p){let s=f({sessionId:t,transaction:e});await o({sessionId:t,status:s})}l(r)&&await S({sessionId:t,hash:a,results:m})}catch(T){console.error(T),i({sessionId:t,status:"timedOut"}),await o({sessionId:t,status:"timedOut"})}}async function R({sessionId:e,transactionBatch:t,isSequential:c}){try{if(t==null)return;let a=y(t),r=await h(a);for(let n of r)await d({serverTransaction:n,sessionId:e,isSequential:c});if(r.every(n=>n.status!=="pending")){if(r.every(s=>s.status==="success"))return i({sessionId:e,status:"success"});if(r.some(s=>s.status==="fail"))return i({sessionId:e,status:"fail"});if(r.every(s=>s.invalidTransaction))return i({sessionId:e,status:"invalid"})}}catch(a){console.error(a)}}export{R as a};
2
- //# sourceMappingURL=chunk-745QCLQC.mjs.map
1
+ import{a as h}from"./chunk-SAHYDY7R.mjs";import{a as S}from"./chunk-MVWJW7DI.mjs";import{a as o}from"./chunk-FMQYLMTU.mjs";import{a as y}from"./chunk-MFUQ5NBC.mjs";import{b as i,c as f}from"./chunk-XF7JEPPX.mjs";import{l}from"./chunk-65L5EBBL.mjs";var u={};async function d({serverTransaction:e,sessionId:t,isSequential:c}){let{hash:a,status:r,results:m,invalidTransaction:n,hasStatusChanged:p}=e;try{if(u[a]>30){i({sessionId:t,status:"timedOut"}),await o({sessionId:t,status:"timedOut"});return}if(n&&!c||r==="sent"){u[a]=u[a]?u[a]+1:1;return}if(c&&!r){let s=f({sessionId:t,transaction:e});await o({sessionId:t,status:s});return}if(p){let s=f({sessionId:t,transaction:e});await o({sessionId:t,status:s})}l(r)&&await S({sessionId:t,hash:a,results:m})}catch(T){console.error(T),i({sessionId:t,status:"timedOut"}),await o({sessionId:t,status:"timedOut"})}}async function R({sessionId:e,transactionBatch:t,isSequential:c}){try{if(t==null)return;let a=y(t),r=await h(a);for(let n of r)await d({serverTransaction:n,sessionId:e,isSequential:c});if(r.every(n=>n.status!=="pending")){if(r.every(s=>s.status==="success"))return i({sessionId:e,status:"success"});if(r.some(s=>s.status==="fail"))return i({sessionId:e,status:"fail"});if(r.every(s=>s.invalidTransaction))return i({sessionId:e,status:"invalid"})}}catch(a){console.error(a)}}export{R as a};
2
+ //# sourceMappingURL=chunk-FIKCZQ2J.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-ID7WYMJZ.mjs";import{c as e}from"./chunk-MGFIOCA4.mjs";var o=class i extends s{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE_SIGN_TRANSACTIONS",uiTag:"mvx-sign-transactions-panel"});this.addressesPerPage=10;this._ppuMap={};this.initialData={commonData:{transactionsCount:0,currentIndexToSign:0,egldLabel:"",currentIndex:0,ppuOptions:[],address:"",origin:""},tokenTransaction:null,nftTransaction:null,sftTransaction:null};this.data={...this.initialData}}static getInstance(){return i.instance||(i.instance=new i),i.instance}get transactionsCount(){return this.data.commonData.transactionsCount}initializeGasPriceMap(a){let t=0;a.filter(n=>n!=null).forEach(n=>{let r=n?Number(n.gasPrice):0;this.updateGasPriceMap({nonce:Number(n.nonce),ppu:t,initialGasPrice:r})}),this.updateCommonData({ppu:t})}updateGasPriceMap({nonce:a,ppu:t,initialGasPrice:n}){this._ppuMap[a]={...this._ppuMap[a],ppu:t},n&&(this._ppuMap[a].initialGasPrice=n)}updateCommonData(a){this.data.commonData={...this.data.commonData,...a},this.notifyDataUpdate()}updateIsLoading(a){this.data.isLoading=a,this.notifyDataUpdate()}updateTokenTransaction(a){this.data.tokenTransaction=a,this.data.sftTransaction=null,this.data.nftTransaction=null,this.notifyDataUpdate()}updateNonFungibleTransaction(a,t){switch(a){case"NonFungibleESDT":this.data.nftTransaction=t,this.data.tokenTransaction=null,this.data.sftTransaction=null;break;case"SemiFungibleESDT":this.data.sftTransaction=t,this.data.nftTransaction=null,this.data.tokenTransaction=null;break;default:break}this.notifyDataUpdate()}get currentScreenIndex(){return this.data.commonData.currentIndex}get ppuMap(){return this._ppuMap}async setupEventListeners(){this.eventBus&&this.subscribeToEventBus("CLOSE_SIGN_TRANSACTIONS",this.closeUI.bind(this))}};export{o as a};
2
- //# sourceMappingURL=chunk-MRV6OG7P.mjs.map
1
+ import{a as s}from"./chunk-XT7JL5LN.mjs";import{c as e}from"./chunk-MGFIOCA4.mjs";var o=class i extends s{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE_SIGN_TRANSACTIONS",uiTag:"mvx-sign-transactions-panel"});this.addressesPerPage=10;this._ppuMap={};this.initialData={commonData:{transactionsCount:0,currentIndexToSign:0,egldLabel:"",currentIndex:0,ppuOptions:[],address:"",origin:""},tokenTransaction:null,nftTransaction:null,sftTransaction:null};this.data={...this.initialData}}static getInstance(){return i.instance||(i.instance=new i),i.instance}get transactionsCount(){return this.data.commonData.transactionsCount}initializeGasPriceMap(a){let t=0;a.filter(n=>n!=null).forEach(n=>{let r=n?Number(n.gasPrice):0;this.updateGasPriceMap({nonce:Number(n.nonce),ppu:t,initialGasPrice:r})}),this.updateCommonData({ppu:t})}updateGasPriceMap({nonce:a,ppu:t,initialGasPrice:n}){this._ppuMap[a]={...this._ppuMap[a],ppu:t},n&&(this._ppuMap[a].initialGasPrice=n)}updateCommonData(a){this.data.commonData={...this.data.commonData,...a},this.notifyDataUpdate()}updateIsLoading(a){this.data.isLoading=a,this.notifyDataUpdate()}updateTokenTransaction(a){this.data.tokenTransaction=a,this.data.sftTransaction=null,this.data.nftTransaction=null,this.notifyDataUpdate()}updateNonFungibleTransaction(a,t){switch(a){case"NonFungibleESDT":this.data.nftTransaction=t,this.data.tokenTransaction=null,this.data.sftTransaction=null;break;case"SemiFungibleESDT":this.data.sftTransaction=t,this.data.nftTransaction=null,this.data.tokenTransaction=null;break;default:break}this.notifyDataUpdate()}get currentScreenIndex(){return this.data.commonData.currentIndex}get ppuMap(){return this._ppuMap}async setupEventListeners(){this.eventBus&&this.subscribeToEventBus("CLOSE_SIGN_TRANSACTIONS",this.closeUI.bind(this))}};export{o as a};
2
+ //# sourceMappingURL=chunk-FWJIV6IK.mjs.map
@@ -0,0 +1,2 @@
1
+ import{s as e}from"./chunk-IAKBA5XK.mjs";var o=t=>e().setState(({ui:n})=>{n.isSidePanelOpen=t},!1,"setIsSidePanelOpen");export{o as a};
2
+ //# sourceMappingURL=chunk-FYSGC7MW.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-T4GLLB7R.mjs";var o=()=>a.localStorage;export{o as a};
2
+ //# sourceMappingURL=chunk-FZUIOPJF.mjs.map
@@ -1,2 +1,2 @@
1
- import{s as c}from"./chunk-4QDHGYT4.mjs";import{a as o}from"./chunk-BRBIUWAW.mjs";var r=e=>{c().setState(({account:t})=>{let s=t.address===e.address;t.accounts={[t.address]:s?e:o}},!1,"setAccount")},u=e=>c().setState(({account:t})=>{t.ledgerAccount=e},!1,"setLedgerAccount"),p=e=>c().setState(({account:t})=>{t.walletConnectAccount=e},!1,"setWalletConnectAccount"),l=e=>c().setState(({account:t})=>{t.websocketEvent={timestamp:Date.now(),message:e}},!1,"setWebsocketEvent"),m=e=>c().setState(({account:t})=>{t.websocketBatchEvent={timestamp:Date.now(),data:e}},!1,"setWebsocketBatchEvent"),A=e=>{c().setState(({account:t})=>{t.accounts[t.address].nonce=e},!1,"setAccountNonce")};export{r as a,u as b,p as c,l as d,m as e,A as f};
2
- //# sourceMappingURL=chunk-ISPOZQQO.mjs.map
1
+ import{s as c}from"./chunk-IAKBA5XK.mjs";import{a as o}from"./chunk-BRBIUWAW.mjs";var r=e=>{c().setState(({account:t})=>{let s=t.address===e.address;t.accounts={[t.address]:s?e:o}},!1,"setAccount")},u=e=>c().setState(({account:t})=>{t.ledgerAccount=e},!1,"setLedgerAccount"),p=e=>c().setState(({account:t})=>{t.walletConnectAccount=e},!1,"setWalletConnectAccount"),l=e=>c().setState(({account:t})=>{t.websocketEvent={timestamp:Date.now(),message:e}},!1,"setWebsocketEvent"),m=e=>c().setState(({account:t})=>{t.websocketBatchEvent={timestamp:Date.now(),data:e}},!1,"setWebsocketBatchEvent"),A=e=>{c().setState(({account:t})=>{t.accounts[t.address].nonce=e},!1,"setAccountNonce")};export{r as a,u as b,p as c,l as d,m as e,A as f};
2
+ //# sourceMappingURL=chunk-GNZBRVMQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-FSCOQWQN.mjs";import{a as g}from"./chunk-3S57OP4Z.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-P32DZ2CO.mjs.map
1
+ import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-F32BTVEV.mjs";import{a as g}from"./chunk-3S57OP4Z.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-HCLEWSLP.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-L4QPPHVR.mjs";import{createJSONStorage as o}from"zustand/middleware";var r={persistReducersStorageType:"localStorage"},i=e?o(()=>e[r.persistReducersStorageType]):void 0,p=new Map;export{r as a,i as b,p as c};
2
- //# sourceMappingURL=chunk-VFAKQ7NM.mjs.map
1
+ import{a as e}from"./chunk-T4GLLB7R.mjs";import{createJSONStorage as o}from"zustand/middleware";var r={persistReducersStorageType:"localStorage"},i=e?o(()=>e[r.persistReducersStorageType]):void 0,p=new Map;export{r as a,i as b,p as c};
2
+ //# sourceMappingURL=chunk-HVAT2QP5.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as s,f as l}from"./chunk-QJSB5NX4.mjs";import{f as a}from"./chunk-VNLGNNIL.mjs";import{a as d,b as L}from"./chunk-NLRDRI7Q.mjs";import{a as k}from"./chunk-4AKPP7B3.mjs";import{a as v}from"./chunk-KRWR77QE.mjs";import{b as y}from"./chunk-A7FTKX2A.mjs";import{a as g,b as c}from"./chunk-7BP53CXF.mjs";import{a as f,b as m}from"./chunk-X4XULIVT.mjs";import{a as T}from"./chunk-CYCS3K6Q.mjs";import{a as S,b as u}from"./chunk-VKEESSBI.mjs";import{a as x}from"./chunk-2DNGCNYM.mjs";import{a as I}from"./chunk-NB7A4C7L.mjs";import{c as p}from"./chunk-R53MCZI6.mjs";import{createJSONStorage as h,devtools as O,persist as V}from"zustand/middleware";import{immer as H}from"zustand/middleware/immer";import{createStore as N}from"zustand/vanilla";var A=e=>{e.account=g,e.loginInfo=f,e.transactions=d,e.toasts=S};function R(){return new Date().setHours(new Date().getHours()+24)}function w(e){if(e==null){E();return}b(e)}var C=e=>{let t=l(e),n=a(e),{address:i,publicKey:M}=s(e);if(i&&M!==new p(i).hex()&&A(e),!t)return;if(n==null){w(R());return}let P=Date.now();n-P<0&&(w(null),o().setState(A))};var W=(e,t)=>{C(e)};var z=e=>{let t=N(O(V(H((...n)=>({network:x(...n),account:c(...n),loginInfo:m(...n),config:T(...n),transactions:L(...n),toasts:u(...n),cache:y(...n),ui:I(...n)})),{name:"sdk-dapp-store",storage:h(e)})));return t.subscribe(W),t},r,D=e=>{r=e},o=()=>(r||D(z(()=>new v)),r),ae=(e=k)=>D(z(e)),pe=()=>o().getState();var fe=e=>o().setState(({loginInfo:t})=>{t.providerType=e},!1,"setProviderType"),me=e=>o().setState(({loginInfo:t})=>{t.tokenLogin=e},!1,"setTokenLogin"),Se=e=>o().setState(({loginInfo:t})=>{if(t.tokenLogin!=null){t.tokenLogin.loginToken=e;return}t.tokenLogin={loginToken:e}},!1,"setLoginToken"),ue=e=>o().setState(({loginInfo:t})=>{t?.tokenLogin!=null&&(t.tokenLogin.signature=e)},!1,"setTokenLoginSignature"),de=e=>o().setState(({loginInfo:t})=>{t.walletLogin=e},!1,"setWalletLogin"),Le=e=>o().setState(({loginInfo:t})=>{t.walletConnectLogin=e},!1,"setWalletConnectLogin"),xe=e=>o().setState(({loginInfo:t})=>{t.ledgerLogin=e},!1,"setLedgerLogin"),Te=e=>o().setState(({loginInfo:t})=>{t.logoutRoute=e},!1,"setLogoutRoute"),ye=e=>o().setState(({loginInfo:t})=>{t.isWalletConnectV2Initialized=e},!1,"setIsWalletConnectV2Initialized"),E=()=>o().setState(({loginInfo:e})=>{e.loginExpiresAt=null},!1,"removeLoginExpiresAt"),b=e=>o().setState(({loginInfo:t})=>{t.loginExpiresAt=e},!1,"addLoginExpiresAt");export{fe as a,me as b,Se as c,ue as d,de as e,Le as f,xe as g,Te as h,ye as i,E as j,b as k,A as l,R as m,w as n,C as o,W as p,z as q,D as r,o as s,ae as t,pe as u};
2
- //# sourceMappingURL=chunk-4QDHGYT4.mjs.map
1
+ import{b as s,f as l}from"./chunk-QJSB5NX4.mjs";import{f as a}from"./chunk-VNLGNNIL.mjs";import{a as d,b as L}from"./chunk-NLRDRI7Q.mjs";import{a as k}from"./chunk-FZUIOPJF.mjs";import{a as v}from"./chunk-KRWR77QE.mjs";import{b as y}from"./chunk-A7FTKX2A.mjs";import{a as g,b as c}from"./chunk-7BP53CXF.mjs";import{a as f,b as m}from"./chunk-X4XULIVT.mjs";import{a as T}from"./chunk-CYCS3K6Q.mjs";import{a as S,b as u}from"./chunk-VKEESSBI.mjs";import{a as x}from"./chunk-2DNGCNYM.mjs";import{a as I}from"./chunk-NB7A4C7L.mjs";import{c as p}from"./chunk-R53MCZI6.mjs";import{createJSONStorage as h,devtools as O,persist as V}from"zustand/middleware";import{immer as H}from"zustand/middleware/immer";import{createStore as N}from"zustand/vanilla";var A=e=>{e.account=g,e.loginInfo=f,e.transactions=d,e.toasts=S};function R(){return new Date().setHours(new Date().getHours()+24)}function w(e){if(e==null){E();return}b(e)}var C=e=>{let t=l(e),n=a(e),{address:i,publicKey:M}=s(e);if(i&&M!==new p(i).hex()&&A(e),!t)return;if(n==null){w(R());return}let P=Date.now();n-P<0&&(w(null),o().setState(A))};var W=(e,t)=>{C(e)};var z=e=>{let t=N(O(V(H((...n)=>({network:x(...n),account:c(...n),loginInfo:m(...n),config:T(...n),transactions:L(...n),toasts:u(...n),cache:y(...n),ui:I(...n)})),{name:"sdk-dapp-store",storage:h(e)})));return t.subscribe(W),t},r,D=e=>{r=e},o=()=>(r||D(z(()=>new v)),r),ae=(e=k)=>D(z(e)),pe=()=>o().getState();var fe=e=>o().setState(({loginInfo:t})=>{t.providerType=e},!1,"setProviderType"),me=e=>o().setState(({loginInfo:t})=>{t.tokenLogin=e},!1,"setTokenLogin"),Se=e=>o().setState(({loginInfo:t})=>{if(t.tokenLogin!=null){t.tokenLogin.loginToken=e;return}t.tokenLogin={loginToken:e}},!1,"setLoginToken"),ue=e=>o().setState(({loginInfo:t})=>{t?.tokenLogin!=null&&(t.tokenLogin.signature=e)},!1,"setTokenLoginSignature"),de=e=>o().setState(({loginInfo:t})=>{t.walletLogin=e},!1,"setWalletLogin"),Le=e=>o().setState(({loginInfo:t})=>{t.walletConnectLogin=e},!1,"setWalletConnectLogin"),xe=e=>o().setState(({loginInfo:t})=>{t.ledgerLogin=e},!1,"setLedgerLogin"),Te=e=>o().setState(({loginInfo:t})=>{t.logoutRoute=e},!1,"setLogoutRoute"),ye=e=>o().setState(({loginInfo:t})=>{t.isWalletConnectV2Initialized=e},!1,"setIsWalletConnectV2Initialized"),E=()=>o().setState(({loginInfo:e})=>{e.loginExpiresAt=null},!1,"removeLoginExpiresAt"),b=e=>o().setState(({loginInfo:t})=>{t.loginExpiresAt=e},!1,"addLoginExpiresAt");export{fe as a,me as b,Se as c,ue as d,de as e,Le as f,xe as g,Te as h,ye as i,E as j,b as k,A as l,R as m,w as n,C as o,W as p,z as q,D as r,o as s,ae as t,pe as u};
2
+ //# sourceMappingURL=chunk-IAKBA5XK.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-4TZC3NF3.mjs";import{a as r}from"./chunk-B2UIPHJ3.mjs";var o=()=>{try{return!r()||!e()?!1:window.self!==window.top}catch{return!0}};export{o as a};
2
- //# sourceMappingURL=chunk-YKRSCVRE.mjs.map
1
+ import{a as e}from"./chunk-PYBAW4QY.mjs";import{a as r}from"./chunk-B2UIPHJ3.mjs";var o=()=>{try{return!r()||!e()?!1:window.self!==window.top}catch{return!0}};export{o as a};
2
+ //# sourceMappingURL=chunk-J66NP5YS.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as N}from"./chunk-Q2Q4XN4M.mjs";import{b}from"./chunk-6D2RBTVV.mjs";import{d as C,e as I}from"./chunk-ISPOZQQO.mjs";import{s as p}from"./chunk-4QDHGYT4.mjs";import{b as E}from"./chunk-SAAOQW7P.mjs";import{a as y}from"./chunk-MGQ373AO.mjs";import{b as t}from"./chunk-GGBMHKR4.mjs";import{io as L}from"socket.io-client";var U=3e3,d=3,k=500,W=1e3,M=1e3,S="batchUpdated",w="connect",O="connect_error",A="disconnect";async function K(l){let{apiAddress:_,websocketUrl:g}=E(p().getState());if(!l)throw new Error("Websocket could not be initialized: address missing");let o=null,n=null,c=e=>{t.status=e,b(e)},R=e=>{o&&clearTimeout(o),o=setTimeout(()=>{C(e)},W)},h=e=>{n&&clearTimeout(n),n=setTimeout(()=>{I(e)},W)},D=()=>{let e=t.instance;e&&(e.off(O),e.off(w),e.off(S),e.off(A),e.close(),console.log("Websocket disconnected.")),c("not_initialized"),t.instance=null,o&&clearTimeout(o),n&&clearTimeout(n)},m=y(async()=>{let e=async(i=d,a=k)=>{let f=0,r=null,s=null,T=async()=>{if(f>=i){console.warn("WebSocket reconnection failed after max attempts."),c("not_initialized");return}f++,t.instance?.off(),t.instance?.close(),t.instance=null;try{await m(),r=setTimeout(()=>{t.instance?.connected||(s=setTimeout(T,a))},M)}catch{s=setTimeout(T,a)}};return T(),()=>{r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null)}};c("pending");let u=g??await N(_);if(!u){c("not_initialized");return}t.instance=L(u,{forceNew:!0,reconnection:!0,reconnectionAttempts:d,timeout:U,query:{address:l}}),t.instance.onAny(R),t.instance.on(S,h),t.instance.on(w,()=>{console.log("Websocket connected."),c("completed")}),t.instance.on(O,async i=>{console.warn("Websocket connect error: ",i.message),(await e())()}),t.instance.on(A,async()=>{console.warn("Websocket disconnected. Trying to reconnect..."),(await e())()})},{retries:2,delay:k});return t.status==="not_initialized"&&!t.instance?.active&&await m(),{closeConnection:D}}export{K as a};
2
- //# sourceMappingURL=chunk-GFTTAANM.mjs.map
1
+ import{a as N}from"./chunk-Q2Q4XN4M.mjs";import{b}from"./chunk-OP3F2KDT.mjs";import{d as C,e as I}from"./chunk-GNZBRVMQ.mjs";import{s as p}from"./chunk-IAKBA5XK.mjs";import{b as E}from"./chunk-SAAOQW7P.mjs";import{a as y}from"./chunk-MGQ373AO.mjs";import{b as t}from"./chunk-GGBMHKR4.mjs";import{io as L}from"socket.io-client";var U=3e3,d=3,k=500,W=1e3,M=1e3,S="batchUpdated",w="connect",O="connect_error",A="disconnect";async function K(l){let{apiAddress:_,websocketUrl:g}=E(p().getState());if(!l)throw new Error("Websocket could not be initialized: address missing");let o=null,n=null,c=e=>{t.status=e,b(e)},R=e=>{o&&clearTimeout(o),o=setTimeout(()=>{C(e)},W)},h=e=>{n&&clearTimeout(n),n=setTimeout(()=>{I(e)},W)},D=()=>{let e=t.instance;e&&(e.off(O),e.off(w),e.off(S),e.off(A),e.close(),console.log("Websocket disconnected.")),c("not_initialized"),t.instance=null,o&&clearTimeout(o),n&&clearTimeout(n)},m=y(async()=>{let e=async(i=d,a=k)=>{let f=0,r=null,s=null,T=async()=>{if(f>=i){console.warn("WebSocket reconnection failed after max attempts."),c("not_initialized");return}f++,t.instance?.off(),t.instance?.close(),t.instance=null;try{await m(),r=setTimeout(()=>{t.instance?.connected||(s=setTimeout(T,a))},M)}catch{s=setTimeout(T,a)}};return T(),()=>{r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null)}};c("pending");let u=g??await N(_);if(!u){c("not_initialized");return}t.instance=L(u,{forceNew:!0,reconnection:!0,reconnectionAttempts:d,timeout:U,query:{address:l}}),t.instance.onAny(R),t.instance.on(S,h),t.instance.on(w,()=>{console.log("Websocket connected."),c("completed")}),t.instance.on(O,async i=>{console.warn("Websocket connect error: ",i.message),(await e())()}),t.instance.on(A,async()=>{console.warn("Websocket disconnected. Trying to reconnect..."),(await e())()})},{retries:2,delay:k});return t.status==="not_initialized"&&!t.instance?.active&&await m(),{closeConnection:D}}export{K as a};
2
+ //# sourceMappingURL=chunk-JK5DKI6N.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as ce}from"./chunk-OZ4ZZI3H.mjs";import{a as de}from"./chunk-M3YL36ZL.mjs";import{a as oe}from"./chunk-HXXZKQRJ.mjs";import{a as R}from"./chunk-4XP7BVJD.mjs";import{a as ne}from"./chunk-254WMLVS.mjs";import{a as ie}from"./chunk-FAOCLLIW.mjs";import{a as u}from"./chunk-CIY7IH2N.mjs";import{a as te}from"./chunk-YUFPUG5O.mjs";import{a as le}from"./chunk-D5SD7UPB.mjs";import{a as p}from"./chunk-2S5FRZJR.mjs";import{a as re}from"./chunk-V2C7APME.mjs";import{a as ae}from"./chunk-BG6QTPZ4.mjs";import{a as se}from"./chunk-3NFKZZ7W.mjs";import{a as ee}from"./chunk-QJGFIK7H.mjs";import{b as Z}from"./chunk-4Z3DZ2A3.mjs";import{e as w,f as Q}from"./chunk-FFHVVGYW.mjs";import{j as Y,l as N,r as S,s as C,t as b}from"./chunk-I6BXGQLQ.mjs";import{a as I}from"./chunk-RFKBUN7S.mjs";import{g as X}from"./chunk-CAA4VJRH.mjs";import{a as $}from"./chunk-6ZL2QC74.mjs";import{a as U}from"./chunk-4TBVQD27.mjs";import{a as J}from"./chunk-VXLJWKLG.mjs";import{a as j,s as K,u as l}from"./chunk-4QDHGYT4.mjs";import{f as B}from"./chunk-QJSB5NX4.mjs";import{b as E,c as H}from"./chunk-SAAOQW7P.mjs";import{a as G}from"./chunk-VNLGNNIL.mjs";import{b as q,c as F}from"./chunk-6JM4DPOH.mjs";import{a as L}from"./chunk-VMFJUT3G.mjs";import{a as c}from"./chunk-TI73UXGG.mjs";import{a as n}from"./chunk-S2FQWSUO.mjs";import{a as M}from"./chunk-L4QPPHVR.mjs";import{IframeLoginTypes as ve}from"@multiversx/sdk-web-wallet-iframe-provider/out/constants";var y=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 oe({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!u())return;await R.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ae({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 pe({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await ie({shouldInitProvider:!0});this.provider=r}catch(r){throw Y({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 n.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 L(M),await this.initLegderConnectManager(this.options?.anchor);let e=R.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((o,a)=>ne({manager:e,resolve:o,reject:a,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ue=3e4,fe=5e3,we=3e3,z=class s{constructor(){this.store=K();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=G(i),r=B(i);return!!(e===n.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=Z(l());if(!(!this.shouldCheckConnection()||i))try{await b().getProvider().getAddress()}catch{if(N.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,fe)}},ue))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new y({shouldInitProvider:!0});await i.init();let e=new S(i);i.getType=()=>n.ledger,C(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,N.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:we,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 s.instance||(s.instance=new s),s.instance}};var W=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 o=await this.provider.signTransactions(e)??[];return await se(o)}catch(o){throw await r({shouldCancelAction:!0}),o}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=ee.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 n.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 ye}from"@multiversx/sdk-extension-provider/out/extensionProvider";var _=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(o){throw await t({shouldCancelAction:!1}),o}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=ye.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 n.extension}};var Pe={passkey:n.passkey,metamask:n.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(o){throw await t({shouldCancelAction:!0}),o}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 Pe[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 ge}from"@multiversx/sdk-wallet-connect-provider/out";var me=[w.CANCEL_ACTION,w.SIGN_LOGIN_TOKEN],x=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;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(o){throw await t({shouldCancelAction:!0}),await this.sendCustomRequest({method:w.CANCEL_ACTION,action:ge.CANCEL_ACTION}),o}finally{r.closeUI()}};this.cancelAction=async()=>{await this.sendCustomRequest({method:w.CANCEL_ACTION,action:ge.CANCEL_ACTION})};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.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 n.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 L(M),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:o}=await this.provider.connect({methods:this.methods}),a=this.config.walletConnectDeepLink??U.walletConnectDeepLink;this._approval=o,I.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${a}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!u())return;await I.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=u(),t=H(l());if(q(l())&&me.push(w.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let h={onClientLogin:()=>{},onClientLogout:()=>{J()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:O={},walletConnectV2RelayAddress:D=""}=e,P=new Q(h,t,D,m,O);return await P.init(),{walletConnectProvider:P,dappMethods:me}}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=I.getInstance(),{uri:o="",approval:a}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??U.walletConnectDeepLink;t.updateData({wcURI:o,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(o)}`});let v=await this.provider.login({approval:a,token:e?.token}),{address:h="",signature:m=""}=v??{};return t.handleClose({isLoginFinished:!!h}),{address:h,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:o="",signature:a=""}=t??{};return I.getInstance().handleClose({isLoginFinished:!!o}),{address:o,signature:a}}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 n.extension:{r=new _;break}case n.crossWindow:{r=new W;break}case n.ledger:{r=new y({anchor:e}),await z.getInstance().init();break}case n.metamask:{r=new T({type:ve.metamask});break}case n.passkey:{r=new T({type:ve.passkey});break}case n.walletConnect:{let d=F(l());if(!d?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new x({anchor:e,...d});break}case n.webview:{r=new le;break}default:{let d=$();for(let v of this._customProviders)v.type===i&&(r=await v.constructor({address:d,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=u(),o=new S(r);t&&C(o);let a=[n.crossWindow,n.metamask,n.passkey].includes(i);return ce(a?{skipLoginMethod:i}:null),o}static async destroy(){b().cancelLogin(),C(null),j(n.none)}};A._customProviders=[];var Ce=(s,i)=>s.some(e=>e.type===i);async function g({message:s,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(o,a)=>{let{manager:d,onClose:v}=await re({cancelAction:e}),h=Object.values(A.customProviders),m=h.reduce((f,V)=>(f[V.type]=V.name,f),{}),O={...c,...m},D=async()=>{await v({shouldCancelAction:!0}),a({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",D);let P=Ce(h,r)?r:n.none;d.updateData({name:O[P],type:P});try{let f=await i(s);o(f)}catch(f){await v({shouldCancelAction:!0}),a(f)}finally{d.closeUI()}})}async function pe({message:s,handleSignMessage:i}){try{return await g({message:s,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=te(e);throw r?{message:r}:e}}export{pe as a,y as b,z as c,A as d,g as e,W as f,_ as g,T as h,x as i};
2
- //# sourceMappingURL=chunk-PHNC5JMP.mjs.map
1
+ import{a as ce}from"./chunk-OZ4ZZI3H.mjs";import{a as de}from"./chunk-M3YL36ZL.mjs";import{a as oe}from"./chunk-NV24F4LU.mjs";import{a as R}from"./chunk-2R5LWF2W.mjs";import{a as ne}from"./chunk-P36YE74A.mjs";import{a as ie}from"./chunk-T2QCATZQ.mjs";import{a as C}from"./chunk-OPLNE5E4.mjs";import{a as te}from"./chunk-YUFPUG5O.mjs";import{a as le}from"./chunk-YJPW44AG.mjs";import{a as p}from"./chunk-EHU5RQBI.mjs";import{a as re}from"./chunk-CSTNJXBE.mjs";import{a as ae}from"./chunk-5HHIOEWB.mjs";import{a as se}from"./chunk-AWX5SSJV.mjs";import{a as ee}from"./chunk-QJGFIK7H.mjs";import{b as Z}from"./chunk-4Z3DZ2A3.mjs";import{e as u,f as Q}from"./chunk-FFHVVGYW.mjs";import{j as Y,l as N,r as S,s as I,t as b}from"./chunk-LXGUUE34.mjs";import{a as P}from"./chunk-RQ6IYTUI.mjs";import{g as X}from"./chunk-CAA4VJRH.mjs";import{a as $}from"./chunk-7Q275OU5.mjs";import{a as U}from"./chunk-4TBVQD27.mjs";import{a as J}from"./chunk-AG6XMOI3.mjs";import{a as j,s as K,u as l}from"./chunk-IAKBA5XK.mjs";import{f as B}from"./chunk-QJSB5NX4.mjs";import{b as E,c as H}from"./chunk-SAAOQW7P.mjs";import{a as G}from"./chunk-VNLGNNIL.mjs";import{b as q,c as F}from"./chunk-6JM4DPOH.mjs";import{a as L}from"./chunk-VMFJUT3G.mjs";import{a as d}from"./chunk-TI73UXGG.mjs";import{a as o}from"./chunk-S2FQWSUO.mjs";import{a as M}from"./chunk-T4GLLB7R.mjs";import{IframeLoginTypes as ve}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 oe({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!C())return;await R.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ae({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 pe({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await ie({shouldInitProvider:!0});this.provider=r}catch(r){throw Y({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 L(M),await this.initLegderConnectManager(this.options?.anchor);let e=R.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((n,s)=>ne({manager:e,resolve:n,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ue=3e4,fe=5e3,we=3e3,z=class a{constructor(){this.store=K();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=G(i),r=B(i);return!!(e===o.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=Z(l());if(!(!this.shouldCheckConnection()||i))try{await b().getProvider().getAddress()}catch{if(N.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,fe)}},ue))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new f({shouldInitProvider:!0});await i.init();let e=new S(i);i.getType=()=>o.ledger,I(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,N.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:we,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 W=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 se(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:d.crossWindow})};this.walletAddress=e?.walletAddress,this.provider=ee.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 ye}from"@multiversx/sdk-extension-provider/out/extensionProvider";var _=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:d.extension})};this.provider=ye.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 Pe={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:d[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 Pe[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 ge}from"@multiversx/sdk-wallet-connect-provider/out";var me=[u.CANCEL_ACTION,u.SIGN_LOGIN_TOKEN],x=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;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}),await this.sendCustomRequest({method:u.CANCEL_ACTION,action:ge.CANCEL_ACTION}),n}finally{r.closeUI()}};this.cancelAction=async()=>{await this.sendCustomRequest({method:u.CANCEL_ACTION,action:ge.CANCEL_ACTION})};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:d.extension})};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 L(M),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??U.walletConnectDeepLink;this._approval=n,P.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!C())return;await P.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=C(),t=H(l());if(q(l())&&me.push(u.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{J()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:O={},walletConnectV2RelayAddress:D=""}=e,y=new Q(v,t,D,m,O);return await y.init(),{walletConnectProvider:y,dappMethods:me}}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=P.getInstance(),{uri:n="",approval:s}=await this.provider.connect({methods:this.methods}),c=this.config.walletConnectDeepLink??U.walletConnectDeepLink;t.updateData({wcURI:n,walletConnectDeepLink:`${c}?wallet-connect=${encodeURIComponent(n)}`});let w=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=w??{};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 P.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 _;break}case o.crossWindow:{r=new W;break}case o.ledger:{r=new f({anchor:e}),await z.getInstance().init();break}case o.metamask:{r=new T({type:ve.metamask});break}case o.passkey:{r=new T({type:ve.passkey});break}case o.walletConnect:{let s=F(l());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new x({anchor:e,...s});break}case o.webview:{r=new le;break}default:{let s=$();for(let c of this._customProviders)c.type===i&&(r=await c.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new S(r);I(t);let n=[o.crossWindow,o.metamask,o.passkey].includes(i);return ce(n?{skipLoginMethod:i}:null),t}static async destroy(){b().cancelLogin(),I(null),j(o.none)}};A._customProviders=[];var Ce=(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:c,onClose:w}=await re({cancelAction:e}),v=Object.values(A.customProviders),m=v.reduce((h,V)=>(h[V.type]=V.name,h),{}),O={...d,...m},D=async()=>{await w({shouldCancelAction:!0}),s({message:"Signing canceled"})};c.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",D);let y=Ce(v,r)?r:o.none;c.updateData({name:O[y],type:y});try{let h=await i(a);n(h)}catch(h){await w({shouldCancelAction:!0}),s(h)}finally{c.closeUI()}})}async function pe({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:d.ledger})}catch(e){let{errorMessage:r}=te(e);throw r?{message:r}:e}}export{pe as a,f as b,z as c,A as d,g as e,W as f,_ as g,T as h,x as i};
2
+ //# sourceMappingURL=chunk-JYG4XQGL.mjs.map