@multiversx/sdk-dapp 5.0.7 → 5.0.9

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 (381) hide show
  1. package/out/__chunks__/{chunk-JWGB5GYU.mjs → chunk-24HERUCI.mjs} +2 -2
  2. package/out/__chunks__/chunk-2GP5IQEP.mjs +2 -0
  3. package/out/__chunks__/{chunk-Z7T2J6XD.mjs → chunk-3XWVDTZU.mjs} +2 -2
  4. package/out/__chunks__/{chunk-BVL47QTP.mjs → chunk-427U5CPN.mjs} +2 -2
  5. package/out/__chunks__/{chunk-CQAZ3LJW.mjs → chunk-4IX36KYO.mjs} +2 -2
  6. package/out/__chunks__/chunk-4NCS6I7W.mjs +2 -0
  7. package/out/__chunks__/chunk-5JCA5OZE.mjs +2 -0
  8. package/out/__chunks__/{chunk-MONQ4RXB.mjs.map → chunk-5JCA5OZE.mjs.map} +1 -1
  9. package/out/__chunks__/chunk-5QYT3EHL.mjs +2 -0
  10. package/out/__chunks__/{chunk-5CABF4XT.mjs → chunk-5UEXMF4C.mjs} +2 -2
  11. package/out/__chunks__/{chunk-WWMW5EIR.mjs → chunk-66U2DKC2.mjs} +2 -2
  12. package/out/__chunks__/{chunk-2Z53M64I.mjs → chunk-6HYLHYFC.mjs} +2 -2
  13. package/out/__chunks__/{chunk-TZ25MLSW.mjs → chunk-6LHWOVT5.mjs} +2 -2
  14. package/out/__chunks__/{chunk-TUT2EPC2.mjs → chunk-6SIVER36.mjs} +2 -2
  15. package/out/__chunks__/chunk-6SUMRGIJ.mjs +2 -0
  16. package/out/__chunks__/{chunk-V4H5P3MS.mjs → chunk-7PI3RH5C.mjs} +2 -2
  17. package/out/__chunks__/{chunk-NKLRQJVY.mjs → chunk-7RNNI3LI.mjs} +2 -2
  18. package/out/__chunks__/{chunk-5C2ZAHTB.mjs → chunk-A5F6KBRA.mjs} +2 -2
  19. package/out/__chunks__/{chunk-N3NTEUD2.mjs → chunk-AE67HPX7.mjs} +2 -2
  20. package/out/__chunks__/{chunk-VDDLODBL.mjs → chunk-AG5FZ7D2.mjs} +2 -2
  21. package/out/__chunks__/chunk-BAX6BDHT.mjs +2 -0
  22. package/out/__chunks__/chunk-BDYK46XE.mjs +2 -0
  23. package/out/__chunks__/{chunk-YILAZW7P.mjs → chunk-BFX6KRJB.mjs} +2 -2
  24. package/out/__chunks__/{chunk-AEZWP25S.mjs → chunk-BLYQZ3AK.mjs} +2 -2
  25. package/out/__chunks__/{chunk-LJBVZK5V.mjs → chunk-CVCNSUVX.mjs} +2 -2
  26. package/out/__chunks__/{chunk-S6ZQLKKX.mjs → chunk-DPO6NAIN.mjs} +2 -2
  27. package/out/__chunks__/{chunk-NBZUJ5VZ.mjs → chunk-DQZXAQEQ.mjs} +2 -2
  28. package/out/__chunks__/chunk-DSA7OV2X.mjs +2 -0
  29. package/out/__chunks__/{chunk-OWNMDLKO.mjs → chunk-DWJNMLII.mjs} +2 -2
  30. package/out/__chunks__/{chunk-VQFQUFLP.mjs → chunk-DY5F22IP.mjs} +2 -2
  31. package/out/__chunks__/{chunk-5BLRRK4B.mjs → chunk-EFPESRFQ.mjs} +2 -2
  32. package/out/__chunks__/{chunk-MXKOONHC.mjs → chunk-EXIQ5AWW.mjs} +2 -2
  33. package/out/__chunks__/{chunk-42CVZ3GV.mjs → chunk-F535UPIT.mjs} +2 -2
  34. package/out/__chunks__/chunk-FCLLSOVB.mjs +2 -0
  35. package/out/__chunks__/{chunk-F755MYC5.mjs → chunk-FTQV2IFE.mjs} +2 -2
  36. package/out/__chunks__/{chunk-75WEAHW3.mjs → chunk-FZOPS56M.mjs} +2 -2
  37. package/out/__chunks__/{chunk-MKHSCAMQ.mjs → chunk-GHY2IAO2.mjs} +2 -2
  38. package/out/__chunks__/{chunk-E2ODPOVS.mjs → chunk-GSKKORU3.mjs} +2 -2
  39. package/out/__chunks__/{chunk-6Z4GXMSW.mjs → chunk-GYKFRG4G.mjs} +2 -2
  40. package/out/__chunks__/{chunk-AJS7FS66.mjs → chunk-HOLYCMSD.mjs} +2 -2
  41. package/out/__chunks__/{chunk-H3EGIL75.mjs → chunk-HP2XWN3H.mjs} +2 -2
  42. package/out/__chunks__/{chunk-UJDX67YT.mjs → chunk-IB4WJ3BB.mjs} +2 -2
  43. package/out/__chunks__/{chunk-TYN5TMRZ.mjs → chunk-IHIBTL4N.mjs} +2 -2
  44. package/out/__chunks__/{chunk-T26S2V72.mjs → chunk-ITZYC6JK.mjs} +2 -2
  45. package/out/__chunks__/{chunk-SVXVYH6P.mjs → chunk-J2PJZYN7.mjs} +2 -2
  46. package/out/__chunks__/{chunk-N6MC53DJ.mjs → chunk-JHX7G7CK.mjs} +2 -2
  47. package/out/__chunks__/{chunk-FKFHOXVI.mjs → chunk-JTGLYVXN.mjs} +2 -2
  48. package/out/__chunks__/{chunk-7DP77WJU.mjs → chunk-KH555PP2.mjs} +2 -2
  49. package/out/__chunks__/{chunk-VXWZLNHI.mjs → chunk-KJ2ESZS3.mjs} +2 -2
  50. package/out/__chunks__/{chunk-C754AWVZ.mjs → chunk-L6XUG4LZ.mjs} +2 -2
  51. package/out/__chunks__/{chunk-NHDP33GP.mjs → chunk-M7WN35GY.mjs} +2 -2
  52. package/out/__chunks__/{chunk-MTLAUGMZ.mjs → chunk-MHXYO7AM.mjs} +2 -2
  53. package/out/__chunks__/{chunk-WIXDQ3KW.mjs → chunk-NFJWSGDN.mjs} +2 -2
  54. package/out/__chunks__/chunk-O5DNWY4U.mjs +2 -0
  55. package/out/__chunks__/{chunk-LZITSA2G.mjs → chunk-OVDQU4VC.mjs} +2 -2
  56. package/out/__chunks__/chunk-PFKDWDRA.mjs +2 -0
  57. package/out/__chunks__/{chunk-3HMCWJHQ.mjs → chunk-PIRUXLWE.mjs} +2 -2
  58. package/out/__chunks__/{chunk-XY4G3LLQ.mjs → chunk-Q4K3273X.mjs} +2 -2
  59. package/out/__chunks__/chunk-QEEDUPWM.mjs +2 -0
  60. package/out/__chunks__/{chunk-MMBSMAYP.mjs → chunk-RQ226FTC.mjs} +2 -2
  61. package/out/__chunks__/chunk-RZIJVETL.mjs +2 -0
  62. package/out/__chunks__/{chunk-RDPREOPG.mjs → chunk-SC752S7S.mjs} +2 -2
  63. package/out/__chunks__/{chunk-34TZ56ZL.mjs → chunk-SKGX7AQR.mjs} +2 -2
  64. package/out/__chunks__/chunk-SSAPDI4J.mjs +2 -0
  65. package/out/__chunks__/chunk-SSRQGUCG.mjs +2 -0
  66. package/out/__chunks__/{chunk-A2W4YT2Y.mjs → chunk-T6YT7SWN.mjs} +2 -2
  67. package/out/__chunks__/{chunk-2JDGOX23.mjs → chunk-TAMBWEVQ.mjs} +2 -2
  68. package/out/__chunks__/{chunk-QMO7HUJF.mjs → chunk-TGGB2GBZ.mjs} +2 -2
  69. package/out/__chunks__/{chunk-2UIRKC76.mjs → chunk-TJSRZTXV.mjs} +2 -2
  70. package/out/__chunks__/{chunk-JLVA2UHR.mjs → chunk-TMZ5BZOT.mjs} +2 -2
  71. package/out/__chunks__/{chunk-KMSI4FA6.mjs → chunk-UBDGFC5C.mjs} +2 -2
  72. package/out/__chunks__/{chunk-6JS7TNJC.mjs → chunk-UMIK4KBK.mjs} +2 -2
  73. package/out/__chunks__/{chunk-32AIQ4N3.mjs → chunk-V4HIQSD2.mjs} +2 -2
  74. package/out/__chunks__/{chunk-P6TVAEN3.mjs → chunk-WYW7WKVT.mjs} +2 -2
  75. package/out/__chunks__/{chunk-SNJKYJAD.mjs → chunk-X66WRHHQ.mjs} +2 -2
  76. package/out/__chunks__/chunk-XF4GSZXO.mjs +2 -0
  77. package/out/__chunks__/chunk-XGW2RCOF.mjs +2 -0
  78. package/out/__chunks__/chunk-XOES4EZI.mjs +2 -0
  79. package/out/__chunks__/{chunk-NJB4MIRD.mjs.map → chunk-XOES4EZI.mjs.map} +2 -2
  80. package/out/__chunks__/{chunk-PQYZODUA.mjs → chunk-XPUAJV6J.mjs} +2 -2
  81. package/out/__chunks__/{chunk-LJZO6JVX.mjs → chunk-YLU2JO7A.mjs} +2 -2
  82. package/out/__chunks__/{chunk-YOJAS3PK.mjs → chunk-Z2ZFJH7M.mjs} +2 -2
  83. package/out/__chunks__/{chunk-2MQKUZ3H.mjs → chunk-ZEE2PRLQ.mjs} +2 -2
  84. package/out/__chunks__/{chunk-KRB3XH4K.mjs → chunk-ZZSCDW7F.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.cjs +1 -1
  99. package/out/constants/window.constants.cjs.map +1 -1
  100. package/out/constants/window.constants.mjs +1 -1
  101. package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
  102. package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
  103. package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
  104. package/out/controllers/TransactionsTableController/index.mjs +1 -1
  105. package/out/index.mjs +1 -1
  106. package/out/lib/sdkDappUi.mjs +1 -1
  107. package/out/managers/LogoutManager/LogoutManager.mjs +1 -1
  108. package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
  109. package/out/managers/NotificationsFeedManager/index.mjs +1 -1
  110. package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
  111. package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
  112. package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
  113. package/out/managers/TransactionManager/index.mjs +1 -1
  114. package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
  115. package/out/managers/UnlockPanelManager/index.mjs +1 -1
  116. package/out/managers/index.mjs +1 -1
  117. package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
  118. package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
  119. package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
  120. package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
  121. package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
  122. package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
  123. package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
  124. package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
  125. package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
  126. package/out/managers/internal/ToastManager/ToastManager.mjs +1 -1
  127. package/out/managers/internal/ToastManager/helpers/LifetimeManager.mjs +1 -1
  128. package/out/managers/internal/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
  129. package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
  130. package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.mjs +1 -1
  131. package/out/managers/internal/WalletConnectStateManager/index.mjs +1 -1
  132. package/out/managers/internal/index.mjs +1 -1
  133. package/out/methods/account/getAccount.mjs +1 -1
  134. package/out/methods/account/getAccountInfo.mjs +1 -1
  135. package/out/methods/account/getAddress.mjs +1 -1
  136. package/out/methods/account/getIsLoggedIn.mjs +1 -1
  137. package/out/methods/account/getLatestNonce.mjs +1 -1
  138. package/out/methods/initApp/gastStationMetadata/setGasStationMetadata.mjs +1 -1
  139. package/out/methods/initApp/initApp.mjs +1 -1
  140. package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
  141. package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
  142. package/out/methods/loginInfo/getLoginInfo.mjs +1 -1
  143. package/out/methods/network/getEgldLabel.mjs +1 -1
  144. package/out/methods/network/getExplorerAddress.mjs +1 -1
  145. package/out/methods/network/getNetworkConfig.mjs +1 -1
  146. package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.mjs +1 -1
  147. package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.mjs +1 -1
  148. package/out/methods/trackTransactions/helpers/checkTransactionStatus/index.mjs +1 -1
  149. package/out/methods/trackTransactions/helpers/checkTransactionStatus/manageFailedTransactions.mjs +1 -1
  150. package/out/methods/trackTransactions/helpers/getPollingInterval.mjs +1 -1
  151. package/out/methods/trackTransactions/trackTransactions.mjs +1 -1
  152. package/out/methods/transactions/getFailedTransactions.mjs +1 -1
  153. package/out/methods/transactions/getFailedTransactionsSessions.mjs +1 -1
  154. package/out/methods/transactions/getPendingTransactions.mjs +1 -1
  155. package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
  156. package/out/methods/transactions/getSuccessfulTransactions.mjs +1 -1
  157. package/out/methods/transactions/getSuccessfulTransactionsSessions.mjs +1 -1
  158. package/out/methods/transactions/getTransactionSessions.mjs +1 -1
  159. package/out/providers/DappProvider/DappProvider.mjs +1 -1
  160. package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
  161. package/out/providers/DappProvider/helpers/login/helpers/extractAddressFromToken.mjs +1 -1
  162. package/out/providers/DappProvider/helpers/login/helpers/getAccountFromToken.mjs +1 -1
  163. package/out/providers/DappProvider/helpers/login/helpers/getModifiedLoginToken.mjs +1 -1
  164. package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
  165. package/out/providers/DappProvider/helpers/logout/logout.mjs +1 -1
  166. package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
  167. package/out/providers/DappProvider/helpers/signMessage/signMessageWithProvider.mjs +1 -1
  168. package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
  169. package/out/providers/DappProvider/index.mjs +1 -1
  170. package/out/providers/ProviderFactory.mjs +1 -1
  171. package/out/providers/helpers/accountProvider.mjs +1 -1
  172. package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
  173. package/out/providers/helpers/restoreProvider.mjs +1 -1
  174. package/out/providers/index.mjs +1 -1
  175. package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
  176. package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
  177. package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
  178. package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
  179. package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
  180. package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
  181. package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
  182. package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
  183. package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
  184. package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
  185. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
  186. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
  187. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
  188. package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
  189. package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
  190. package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
  191. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
  192. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
  193. package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
  194. package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.mjs +1 -1
  195. package/out/providers/strategies/WalletConnectProviderStrategy/index.mjs +1 -1
  196. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs +1 -1
  197. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs +1 -1
  198. package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.mjs +1 -1
  199. package/out/providers/strategies/WebviewProviderStrategy/index.mjs +1 -1
  200. package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
  201. package/out/providers/strategies/helpers/index.mjs +1 -1
  202. package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
  203. package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
  204. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
  205. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
  206. package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
  207. package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +1 -1
  208. package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
  209. package/out/providers/strategies/index.mjs +1 -1
  210. package/out/react/account/useGetAccount.mjs +1 -1
  211. package/out/react/account/useGetAccountInfo.mjs +1 -1
  212. package/out/react/account/useGetIsLoggedIn.mjs +1 -1
  213. package/out/react/account/useGetLatestNonce.mjs +1 -1
  214. package/out/react/index.mjs +1 -1
  215. package/out/react/loginInfo/useGetLoginInfo.mjs +1 -1
  216. package/out/react/network/useGetNetworkConfig.mjs +1 -1
  217. package/out/react/store/getReactStore.mjs +1 -1
  218. package/out/react/store/useSelector.mjs +1 -1
  219. package/out/react/transactions/useGetFailedTransactions.mjs +1 -1
  220. package/out/react/transactions/useGetFailedTransactionsSessions.mjs +1 -1
  221. package/out/react/transactions/useGetPendingTransactions.mjs +1 -1
  222. package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
  223. package/out/react/transactions/useGetSuccessfulTransactions.mjs +1 -1
  224. package/out/react/transactions/useGetSuccessfulTransactionsSessions.mjs +1 -1
  225. package/out/react/transactions/useGetTransactionSessions.mjs +1 -1
  226. package/out/services/index.mjs +1 -1
  227. package/out/services/nativeAuth/index.mjs +1 -1
  228. package/out/services/nativeAuth/methods/buildNativeAuthConfig.mjs +1 -1
  229. package/out/services/nativeAuth/methods/getDefaultNativeAuthConfig.mjs +1 -1
  230. package/out/services/nativeAuth/methods/index.mjs +1 -1
  231. package/out/services/nativeAuth/nativeAuth.mjs +1 -1
  232. package/out/store/actions/account/accountActions.mjs +1 -1
  233. package/out/store/actions/account/index.mjs +1 -1
  234. package/out/store/actions/cache/cacheActions.mjs +1 -1
  235. package/out/store/actions/cache/index.mjs +1 -1
  236. package/out/store/actions/config/configActions.mjs +1 -1
  237. package/out/store/actions/config/index.mjs +1 -1
  238. package/out/store/actions/index.mjs +1 -1
  239. package/out/store/actions/loginInfo/loginInfoActions.mjs +1 -1
  240. package/out/store/actions/network/index.mjs +1 -1
  241. package/out/store/actions/network/initializeNetwork.mjs +1 -1
  242. package/out/store/actions/network/networkActions.mjs +1 -1
  243. package/out/store/actions/sharedActions/index.mjs +1 -1
  244. package/out/store/actions/sharedActions/sharedActions.mjs +1 -1
  245. package/out/store/actions/toasts/index.mjs +1 -1
  246. package/out/store/actions/toasts/toastsActions.mjs +1 -1
  247. package/out/store/actions/transactions/transactionsActions.mjs +1 -1
  248. package/out/store/actions/ui/index.mjs +1 -1
  249. package/out/store/actions/ui/uiActions.mjs +1 -1
  250. package/out/store/middleware/applyMiddlewares.mjs +1 -1
  251. package/out/store/middleware/index.mjs +1 -1
  252. package/out/store/middleware/logoutMiddleware.mjs +1 -1
  253. package/out/store/storage/index.mjs +1 -1
  254. package/out/store/storage/storageCallback.mjs +1 -1
  255. package/out/store/store.mjs +1 -1
  256. package/out/utils/ComponentFactory.mjs +1 -1
  257. package/out/utils/account/index.mjs +1 -1
  258. package/out/utils/account/refreshAccount.mjs +1 -1
  259. package/out/utils/account/refreshNativeAuthTokenLogin.mjs +1 -1
  260. package/out/utils/index.mjs +1 -1
  261. package/out/utils/transactions/getActiveTransactionsStatus.mjs +1 -1
  262. package/out/utils/transactions/getInterpretedTransaction/getInterpretedTransaction.mjs +1 -1
  263. package/out/utils/transactions/getInterpretedTransaction/helpers/getLockedAccountName.mjs +1 -1
  264. package/out/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.mjs +1 -1
  265. package/out/utils/transactions/getInterpretedTransaction/helpers/getShardText.mjs +1 -1
  266. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionIconInfo.mjs +1 -1
  267. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionMessages.mjs +1 -1
  268. package/out/utils/transactions/getInterpretedTransaction/helpers/index.mjs +1 -1
  269. package/out/utils/transactions/getInterpretedTransaction/index.mjs +1 -1
  270. package/out/utils/transactions/getTransactionsHistory/getTransactionsHistory.mjs +1 -1
  271. package/out/utils/transactions/getTransactionsHistory/helpers/getCachedTransactionListItem.mjs +1 -1
  272. package/out/utils/transactions/getTransactionsHistory/helpers/index.mjs +1 -1
  273. package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.mjs +1 -1
  274. package/out/utils/transactions/getTransactionsHistory/index.mjs +1 -1
  275. package/out/utils/transactions/index.mjs +1 -1
  276. package/out/utils/visual/index.mjs +1 -1
  277. package/out/utils/visual/switchTheme.cjs +2 -1
  278. package/out/utils/visual/switchTheme.cjs.map +2 -2
  279. package/out/utils/visual/switchTheme.mjs +1 -1
  280. package/out/utils/window/getIsInIframe.mjs +1 -1
  281. package/out/utils/window/getWindowParentOrigin.mjs +1 -1
  282. package/out/utils/window/index.mjs +1 -1
  283. package/package.json +2 -2
  284. package/out/__chunks__/chunk-2R3RBEEL.mjs +0 -2
  285. package/out/__chunks__/chunk-47F7OLNB.mjs +0 -2
  286. package/out/__chunks__/chunk-5Y4EYF6Z.mjs +0 -2
  287. package/out/__chunks__/chunk-APEM4HDI.mjs +0 -2
  288. package/out/__chunks__/chunk-ARV3XIYY.mjs +0 -2
  289. package/out/__chunks__/chunk-F3LAQULB.mjs +0 -2
  290. package/out/__chunks__/chunk-FNMPZS4S.mjs +0 -2
  291. package/out/__chunks__/chunk-GHNNJ64D.mjs +0 -2
  292. package/out/__chunks__/chunk-GS33DJTW.mjs +0 -2
  293. package/out/__chunks__/chunk-KEBJ4ZXE.mjs +0 -2
  294. package/out/__chunks__/chunk-KXH4SFJV.mjs +0 -2
  295. package/out/__chunks__/chunk-MONQ4RXB.mjs +0 -2
  296. package/out/__chunks__/chunk-NJB4MIRD.mjs +0 -2
  297. package/out/__chunks__/chunk-NNNFX3FU.mjs +0 -2
  298. package/out/__chunks__/chunk-RUARSP3Z.mjs +0 -2
  299. package/out/__chunks__/chunk-SIHP75SP.mjs +0 -2
  300. package/out/__chunks__/chunk-WADOAKBZ.mjs +0 -2
  301. package/out/__chunks__/chunk-X6ITADSX.mjs +0 -2
  302. /package/out/__chunks__/{chunk-JWGB5GYU.mjs.map → chunk-24HERUCI.mjs.map} +0 -0
  303. /package/out/__chunks__/{chunk-2R3RBEEL.mjs.map → chunk-2GP5IQEP.mjs.map} +0 -0
  304. /package/out/__chunks__/{chunk-Z7T2J6XD.mjs.map → chunk-3XWVDTZU.mjs.map} +0 -0
  305. /package/out/__chunks__/{chunk-BVL47QTP.mjs.map → chunk-427U5CPN.mjs.map} +0 -0
  306. /package/out/__chunks__/{chunk-CQAZ3LJW.mjs.map → chunk-4IX36KYO.mjs.map} +0 -0
  307. /package/out/__chunks__/{chunk-RUARSP3Z.mjs.map → chunk-4NCS6I7W.mjs.map} +0 -0
  308. /package/out/__chunks__/{chunk-GHNNJ64D.mjs.map → chunk-5QYT3EHL.mjs.map} +0 -0
  309. /package/out/__chunks__/{chunk-5CABF4XT.mjs.map → chunk-5UEXMF4C.mjs.map} +0 -0
  310. /package/out/__chunks__/{chunk-WWMW5EIR.mjs.map → chunk-66U2DKC2.mjs.map} +0 -0
  311. /package/out/__chunks__/{chunk-2Z53M64I.mjs.map → chunk-6HYLHYFC.mjs.map} +0 -0
  312. /package/out/__chunks__/{chunk-TZ25MLSW.mjs.map → chunk-6LHWOVT5.mjs.map} +0 -0
  313. /package/out/__chunks__/{chunk-TUT2EPC2.mjs.map → chunk-6SIVER36.mjs.map} +0 -0
  314. /package/out/__chunks__/{chunk-GS33DJTW.mjs.map → chunk-6SUMRGIJ.mjs.map} +0 -0
  315. /package/out/__chunks__/{chunk-V4H5P3MS.mjs.map → chunk-7PI3RH5C.mjs.map} +0 -0
  316. /package/out/__chunks__/{chunk-NKLRQJVY.mjs.map → chunk-7RNNI3LI.mjs.map} +0 -0
  317. /package/out/__chunks__/{chunk-5C2ZAHTB.mjs.map → chunk-A5F6KBRA.mjs.map} +0 -0
  318. /package/out/__chunks__/{chunk-N3NTEUD2.mjs.map → chunk-AE67HPX7.mjs.map} +0 -0
  319. /package/out/__chunks__/{chunk-VDDLODBL.mjs.map → chunk-AG5FZ7D2.mjs.map} +0 -0
  320. /package/out/__chunks__/{chunk-ARV3XIYY.mjs.map → chunk-BAX6BDHT.mjs.map} +0 -0
  321. /package/out/__chunks__/{chunk-X6ITADSX.mjs.map → chunk-BDYK46XE.mjs.map} +0 -0
  322. /package/out/__chunks__/{chunk-YILAZW7P.mjs.map → chunk-BFX6KRJB.mjs.map} +0 -0
  323. /package/out/__chunks__/{chunk-AEZWP25S.mjs.map → chunk-BLYQZ3AK.mjs.map} +0 -0
  324. /package/out/__chunks__/{chunk-LJBVZK5V.mjs.map → chunk-CVCNSUVX.mjs.map} +0 -0
  325. /package/out/__chunks__/{chunk-S6ZQLKKX.mjs.map → chunk-DPO6NAIN.mjs.map} +0 -0
  326. /package/out/__chunks__/{chunk-NBZUJ5VZ.mjs.map → chunk-DQZXAQEQ.mjs.map} +0 -0
  327. /package/out/__chunks__/{chunk-F3LAQULB.mjs.map → chunk-DSA7OV2X.mjs.map} +0 -0
  328. /package/out/__chunks__/{chunk-OWNMDLKO.mjs.map → chunk-DWJNMLII.mjs.map} +0 -0
  329. /package/out/__chunks__/{chunk-VQFQUFLP.mjs.map → chunk-DY5F22IP.mjs.map} +0 -0
  330. /package/out/__chunks__/{chunk-5BLRRK4B.mjs.map → chunk-EFPESRFQ.mjs.map} +0 -0
  331. /package/out/__chunks__/{chunk-MXKOONHC.mjs.map → chunk-EXIQ5AWW.mjs.map} +0 -0
  332. /package/out/__chunks__/{chunk-42CVZ3GV.mjs.map → chunk-F535UPIT.mjs.map} +0 -0
  333. /package/out/__chunks__/{chunk-KEBJ4ZXE.mjs.map → chunk-FCLLSOVB.mjs.map} +0 -0
  334. /package/out/__chunks__/{chunk-F755MYC5.mjs.map → chunk-FTQV2IFE.mjs.map} +0 -0
  335. /package/out/__chunks__/{chunk-75WEAHW3.mjs.map → chunk-FZOPS56M.mjs.map} +0 -0
  336. /package/out/__chunks__/{chunk-MKHSCAMQ.mjs.map → chunk-GHY2IAO2.mjs.map} +0 -0
  337. /package/out/__chunks__/{chunk-E2ODPOVS.mjs.map → chunk-GSKKORU3.mjs.map} +0 -0
  338. /package/out/__chunks__/{chunk-6Z4GXMSW.mjs.map → chunk-GYKFRG4G.mjs.map} +0 -0
  339. /package/out/__chunks__/{chunk-AJS7FS66.mjs.map → chunk-HOLYCMSD.mjs.map} +0 -0
  340. /package/out/__chunks__/{chunk-H3EGIL75.mjs.map → chunk-HP2XWN3H.mjs.map} +0 -0
  341. /package/out/__chunks__/{chunk-UJDX67YT.mjs.map → chunk-IB4WJ3BB.mjs.map} +0 -0
  342. /package/out/__chunks__/{chunk-TYN5TMRZ.mjs.map → chunk-IHIBTL4N.mjs.map} +0 -0
  343. /package/out/__chunks__/{chunk-T26S2V72.mjs.map → chunk-ITZYC6JK.mjs.map} +0 -0
  344. /package/out/__chunks__/{chunk-SVXVYH6P.mjs.map → chunk-J2PJZYN7.mjs.map} +0 -0
  345. /package/out/__chunks__/{chunk-N6MC53DJ.mjs.map → chunk-JHX7G7CK.mjs.map} +0 -0
  346. /package/out/__chunks__/{chunk-FKFHOXVI.mjs.map → chunk-JTGLYVXN.mjs.map} +0 -0
  347. /package/out/__chunks__/{chunk-7DP77WJU.mjs.map → chunk-KH555PP2.mjs.map} +0 -0
  348. /package/out/__chunks__/{chunk-VXWZLNHI.mjs.map → chunk-KJ2ESZS3.mjs.map} +0 -0
  349. /package/out/__chunks__/{chunk-C754AWVZ.mjs.map → chunk-L6XUG4LZ.mjs.map} +0 -0
  350. /package/out/__chunks__/{chunk-NHDP33GP.mjs.map → chunk-M7WN35GY.mjs.map} +0 -0
  351. /package/out/__chunks__/{chunk-MTLAUGMZ.mjs.map → chunk-MHXYO7AM.mjs.map} +0 -0
  352. /package/out/__chunks__/{chunk-WIXDQ3KW.mjs.map → chunk-NFJWSGDN.mjs.map} +0 -0
  353. /package/out/__chunks__/{chunk-FNMPZS4S.mjs.map → chunk-O5DNWY4U.mjs.map} +0 -0
  354. /package/out/__chunks__/{chunk-LZITSA2G.mjs.map → chunk-OVDQU4VC.mjs.map} +0 -0
  355. /package/out/__chunks__/{chunk-NNNFX3FU.mjs.map → chunk-PFKDWDRA.mjs.map} +0 -0
  356. /package/out/__chunks__/{chunk-3HMCWJHQ.mjs.map → chunk-PIRUXLWE.mjs.map} +0 -0
  357. /package/out/__chunks__/{chunk-XY4G3LLQ.mjs.map → chunk-Q4K3273X.mjs.map} +0 -0
  358. /package/out/__chunks__/{chunk-5Y4EYF6Z.mjs.map → chunk-QEEDUPWM.mjs.map} +0 -0
  359. /package/out/__chunks__/{chunk-MMBSMAYP.mjs.map → chunk-RQ226FTC.mjs.map} +0 -0
  360. /package/out/__chunks__/{chunk-KXH4SFJV.mjs.map → chunk-RZIJVETL.mjs.map} +0 -0
  361. /package/out/__chunks__/{chunk-RDPREOPG.mjs.map → chunk-SC752S7S.mjs.map} +0 -0
  362. /package/out/__chunks__/{chunk-34TZ56ZL.mjs.map → chunk-SKGX7AQR.mjs.map} +0 -0
  363. /package/out/__chunks__/{chunk-SIHP75SP.mjs.map → chunk-SSAPDI4J.mjs.map} +0 -0
  364. /package/out/__chunks__/{chunk-APEM4HDI.mjs.map → chunk-SSRQGUCG.mjs.map} +0 -0
  365. /package/out/__chunks__/{chunk-A2W4YT2Y.mjs.map → chunk-T6YT7SWN.mjs.map} +0 -0
  366. /package/out/__chunks__/{chunk-2JDGOX23.mjs.map → chunk-TAMBWEVQ.mjs.map} +0 -0
  367. /package/out/__chunks__/{chunk-QMO7HUJF.mjs.map → chunk-TGGB2GBZ.mjs.map} +0 -0
  368. /package/out/__chunks__/{chunk-2UIRKC76.mjs.map → chunk-TJSRZTXV.mjs.map} +0 -0
  369. /package/out/__chunks__/{chunk-JLVA2UHR.mjs.map → chunk-TMZ5BZOT.mjs.map} +0 -0
  370. /package/out/__chunks__/{chunk-KMSI4FA6.mjs.map → chunk-UBDGFC5C.mjs.map} +0 -0
  371. /package/out/__chunks__/{chunk-6JS7TNJC.mjs.map → chunk-UMIK4KBK.mjs.map} +0 -0
  372. /package/out/__chunks__/{chunk-32AIQ4N3.mjs.map → chunk-V4HIQSD2.mjs.map} +0 -0
  373. /package/out/__chunks__/{chunk-P6TVAEN3.mjs.map → chunk-WYW7WKVT.mjs.map} +0 -0
  374. /package/out/__chunks__/{chunk-SNJKYJAD.mjs.map → chunk-X66WRHHQ.mjs.map} +0 -0
  375. /package/out/__chunks__/{chunk-WADOAKBZ.mjs.map → chunk-XF4GSZXO.mjs.map} +0 -0
  376. /package/out/__chunks__/{chunk-47F7OLNB.mjs.map → chunk-XGW2RCOF.mjs.map} +0 -0
  377. /package/out/__chunks__/{chunk-PQYZODUA.mjs.map → chunk-XPUAJV6J.mjs.map} +0 -0
  378. /package/out/__chunks__/{chunk-LJZO6JVX.mjs.map → chunk-YLU2JO7A.mjs.map} +0 -0
  379. /package/out/__chunks__/{chunk-YOJAS3PK.mjs.map → chunk-Z2ZFJH7M.mjs.map} +0 -0
  380. /package/out/__chunks__/{chunk-2MQKUZ3H.mjs.map → chunk-ZEE2PRLQ.mjs.map} +0 -0
  381. /package/out/__chunks__/{chunk-KRB3XH4K.mjs.map → chunk-ZZSCDW7F.mjs.map} +0 -0
@@ -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-YOJAS3PK.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-JWGB5GYU.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-Z2ZFJH7M.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-24HERUCI.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-EMIDMARK.mjs";import{s as e}from"./chunk-Z2ZFJH7M.mjs";var m=()=>t(e());export{m as a};
2
+ //# sourceMappingURL=chunk-2GP5IQEP.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-A2W4YT2Y.mjs";import{b as r}from"./chunk-CQAZ3LJW.mjs";import{u as i}from"./chunk-YOJAS3PK.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-Z7T2J6XD.mjs.map
1
+ import{a as n}from"./chunk-T6YT7SWN.mjs";import{b as r}from"./chunk-4IX36KYO.mjs";import{u as i}from"./chunk-Z2ZFJH7M.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-3XWVDTZU.mjs.map
@@ -1,2 +1,2 @@
1
- import{s as c}from"./chunk-YOJAS3PK.mjs";import{a as o}from"./chunk-JMC7CMTU.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-BVL47QTP.mjs.map
1
+ import{s as c}from"./chunk-Z2ZFJH7M.mjs";import{a as o}from"./chunk-JMC7CMTU.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-427U5CPN.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-YOJAS3PK.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-CQAZ3LJW.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-Z2ZFJH7M.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-4IX36KYO.mjs.map
@@ -0,0 +1,2 @@
1
+ import{u as o}from"./chunk-Z2ZFJH7M.mjs";import{a as t}from"./chunk-SAAOQW7P.mjs";function f(r=o()){return t(r)}export{f as a};
2
+ //# sourceMappingURL=chunk-4NCS6I7W.mjs.map
@@ -0,0 +1,2 @@
1
+ var o=typeof window<"u"?window:{},n="5.0.9";export{o as a,n as b};
2
+ //# sourceMappingURL=chunk-5JCA5OZE.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants/window.constants.ts"],
4
- "sourcesContent": ["export const safeWindow: Window =\n typeof window !== 'undefined' ? window : ({} as Window);\n\nexport const version = '5.0.7'; // will be replaced at build time\n"],
4
+ "sourcesContent": ["export const safeWindow: Window =\n typeof window !== 'undefined' ? window : ({} as Window);\n\nexport const version = '5.0.9'; // will be replaced at build time\n"],
5
5
  "mappings": "AAAO,IAAMA,EACX,OAAO,OAAW,IAAc,OAAU,CAAC,EAEhCC,EAAU",
6
6
  "names": ["safeWindow", "version"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-DPO6NAIN.mjs";import{c as n}from"./chunk-Z2ZFJH7M.mjs";async function c({loginToken:r,extraInfoData:i,address:e}){let o=await t({originalLoginToken:r,extraInfoData:i,address:e});return o.modifiedLoginToken&&n(o.modifiedLoginToken),o.address}export{c as a};
2
+ //# sourceMappingURL=chunk-5QYT3EHL.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-GS33DJTW.mjs";import{a as k}from"./chunk-APEM4HDI.mjs";import{s as f}from"./chunk-YOJAS3PK.mjs";import{d as b}from"./chunk-UERJ6AKK.mjs";import{c as n}from"./chunk-MMBSMAYP.mjs";import{b as i}from"./chunk-GGBMHKR4.mjs";async function N(){let o=f(),I=g(),s=null,t=null,l=b(o.getState())?.timestamp,c=()=>{k()},u=()=>{s??=setInterval(c,I)},m=()=>{s&&(clearInterval(s),s=null)},p=()=>{m();let a=o.subscribe(({account:{websocketEvent:e}})=>{e?.message&&l!==e.timestamp&&(l=e.timestamp,c())});n.set("websocketEventReceived",a)},S=()=>{i.status!=="not_initialized"||t||(t=setInterval(()=>{i.status==="completed"&&(clearInterval(t),t=null,p())},1e3))};c();let r=()=>{m(),t&&(clearInterval(t),t=null)},v=o.subscribe(({account:{address:a},config:{websocketStatus:e}},T)=>{if(T.config.websocketStatus!==e)switch(e){case"completed":p();break;case"pending":u(),S();break;default:a?u():r();break}});return n.set("websocketStatusChanged",v),n.set("websocketEventReceived",r),{stopTransactionsTracking:r}}export{N as a};
2
- //# sourceMappingURL=chunk-5CABF4XT.mjs.map
1
+ import{a as g}from"./chunk-6SUMRGIJ.mjs";import{a as k}from"./chunk-SSRQGUCG.mjs";import{s as f}from"./chunk-Z2ZFJH7M.mjs";import{d as b}from"./chunk-UERJ6AKK.mjs";import{c as n}from"./chunk-RQ226FTC.mjs";import{b as i}from"./chunk-GGBMHKR4.mjs";async function N(){let o=f(),I=g(),s=null,t=null,l=b(o.getState())?.timestamp,c=()=>{k()},u=()=>{s??=setInterval(c,I)},m=()=>{s&&(clearInterval(s),s=null)},p=()=>{m();let a=o.subscribe(({account:{websocketEvent:e}})=>{e?.message&&l!==e.timestamp&&(l=e.timestamp,c())});n.set("websocketEventReceived",a)},S=()=>{i.status!=="not_initialized"||t||(t=setInterval(()=>{i.status==="completed"&&(clearInterval(t),t=null,p())},1e3))};c();let r=()=>{m(),t&&(clearInterval(t),t=null)},v=o.subscribe(({account:{address:a},config:{websocketStatus:e}},T)=>{if(T.config.websocketStatus!==e)switch(e){case"completed":p();break;case"pending":u(),S();break;default:a?u():r();break}});return n.set("websocketStatusChanged",v),n.set("websocketEventReceived",r),{stopTransactionsTracking:r}}export{N as a};
2
+ //# sourceMappingURL=chunk-5UEXMF4C.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-PQYZODUA.mjs";import{a as s}from"./chunk-TUT2EPC2.mjs";import{a as k}from"./chunk-B2RDSGON.mjs";import{a as L}from"./chunk-SIHP75SP.mjs";import{b as A}from"./chunk-BVL47QTP.mjs";import{a as I}from"./chunk-BRJNX4JF.mjs";import{g as p}from"./chunk-YOJAS3PK.mjs";import{a as f}from"./chunk-KD2IQ32V.mjs";import{a as x}from"./chunk-PLUWBWJ2.mjs";import{BigNumber as C}from"bignumber.js";async function M({options:d,config:i,provider:a,login:c}){let e=h.getInstance(),T=L(),b=k({loginToken:d?.token,version:i.version}),o={manager:e,provider:a};await s(o);let t=await new Promise(async function(E,w){async function g(r){let n=e?e.addressesPerPage??1:1,l=new C(r-1).times(n);e?.updateStartIndex(Math.max(0,parseInt(l.toString()))),await s(o)}async function u(r){if(!(!a||!c)){e?.updateConfirmScreen({...b,selectedAddress:r.selectedAddress,explorerLink:I({to:`/${f}/${r.selectedAddress}`,explorerAddress:T})});try{let n=d?.token?await a.tokenLogin({token:Buffer.from(`${d?.token}{}`),addressIndex:r.addressIndex}):await c({addressIndex:r.addressIndex});E({address:n.address,signature:n.signature?n.signature.toString("hex"):"",addressIndex:r.addressIndex})}catch(n){console.error("User rejected login:",n),!!e?.getConfirmScreenData()&&await s(o)}}}async function m(){await s(o),e.unsubscribeFromAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g}),w("User cancelled login")}e.subscribeToAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g})}),{version:P,dataEnabled:v}=i;return p({index:t.addressIndex,loginType:x.ledger}),A({address:t.address,index:t.addressIndex,version:P,hasContractDataEnabled:v}),{address:t.address,signature:t.signature}}export{M as a};
2
- //# sourceMappingURL=chunk-WWMW5EIR.mjs.map
1
+ import{a as h}from"./chunk-XPUAJV6J.mjs";import{a as s}from"./chunk-6SIVER36.mjs";import{a as k}from"./chunk-B2RDSGON.mjs";import{a as L}from"./chunk-SSAPDI4J.mjs";import{b as A}from"./chunk-427U5CPN.mjs";import{a as I}from"./chunk-BRJNX4JF.mjs";import{g as p}from"./chunk-Z2ZFJH7M.mjs";import{a as f}from"./chunk-KD2IQ32V.mjs";import{a as x}from"./chunk-PLUWBWJ2.mjs";import{BigNumber as C}from"bignumber.js";async function M({options:d,config:i,provider:a,login:c}){let e=h.getInstance(),T=L(),b=k({loginToken:d?.token,version:i.version}),o={manager:e,provider:a};await s(o);let t=await new Promise(async function(E,w){async function g(r){let n=e?e.addressesPerPage??1:1,l=new C(r-1).times(n);e?.updateStartIndex(Math.max(0,parseInt(l.toString()))),await s(o)}async function u(r){if(!(!a||!c)){e?.updateConfirmScreen({...b,selectedAddress:r.selectedAddress,explorerLink:I({to:`/${f}/${r.selectedAddress}`,explorerAddress:T})});try{let n=d?.token?await a.tokenLogin({token:Buffer.from(`${d?.token}{}`),addressIndex:r.addressIndex}):await c({addressIndex:r.addressIndex});E({address:n.address,signature:n.signature?n.signature.toString("hex"):"",addressIndex:r.addressIndex})}catch(n){console.error("User rejected login:",n),!!e?.getConfirmScreenData()&&await s(o)}}}async function m(){await s(o),e.unsubscribeFromAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g}),w("User cancelled login")}e.subscribeToAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g})}),{version:P,dataEnabled:v}=i;return p({index:t.addressIndex,loginType:x.ledger}),A({address:t.address,index:t.addressIndex,version:P,hasContractDataEnabled:v}),{address:t.address,signature:t.signature}}export{M as a};
2
+ //# sourceMappingURL=chunk-66U2DKC2.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-7DP77WJU.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-2Z53M64I.mjs.map
1
+ import{a}from"./chunk-KH555PP2.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-6HYLHYFC.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-DLWDO7M6.mjs";import{d as p}from"./chunk-5C2ZAHTB.mjs";import{s as n}from"./chunk-H3EGIL75.mjs";import{u as m}from"./chunk-YOJAS3PK.mjs";import{d as t}from"./chunk-VNLGNNIL.mjs";import{a as e}from"./chunk-PLUWBWJ2.mjs";import{a as f}from"./chunk-42CVZ3GV.mjs";async function u(){let i=s(),o=f()||i?e.webview:t(m());if(!o)return;let r=await p.create({type:o});if(!r)throw new Error("Provider not found");(i||o===e.webview&&r.isInitialized())&&await r.login(),n(r)}export{u as a};
2
- //# sourceMappingURL=chunk-TZ25MLSW.mjs.map
1
+ import{a as s}from"./chunk-DLWDO7M6.mjs";import{d as p}from"./chunk-A5F6KBRA.mjs";import{s as n}from"./chunk-HP2XWN3H.mjs";import{u as m}from"./chunk-Z2ZFJH7M.mjs";import{d as t}from"./chunk-VNLGNNIL.mjs";import{a as e}from"./chunk-PLUWBWJ2.mjs";import{a as f}from"./chunk-F535UPIT.mjs";async function u(){let i=s(),o=f()||i?e.webview:t(m());if(!o)return;let r=await p.create({type:o});if(!r)throw new Error("Provider not found");(i||o===e.webview&&r.isInitialized())&&await r.login(),n(r)}export{u as a};
2
+ //# sourceMappingURL=chunk-6LHWOVT5.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as w}from"./chunk-QXC4D3AC.mjs";import{a as g}from"./chunk-YGI3KXMZ.mjs";import{a as b}from"./chunk-RUARSP3Z.mjs";import{a as m}from"./chunk-6FXEHNGW.mjs";import{f}from"./chunk-PJWJZHIS.mjs";import x from"bignumber.js";var F=async({manager:e,provider:d})=>{if(!e||!d)throw new Error("Provider is not initialized.");let{network:u}=b(),s=e.getAccountScreenData()?.startIndex||0,r=e.getAllAccounts(),a=await w({baseURL:u.apiAddress}),l=o=>o.index>=s&&o.index<s+e.addressesPerPage,I=r.reduce((o,n)=>Object.assign(o,{[n.index]:n}),{}),A=r.filter(l),y=!!I[s];if(e.updateAccountScreen({isLoading:!y}),A.length>0){e.updateAccountScreen({accounts:A});return}try{let o=Math.floor(s/e.addressesPerPage),n=await d.getAccounts(o,e.addressesPerPage),L=n.map((t,c)=>({address:t,balance:"...",index:c+s})),P=[...r,...L],h=n.map(t=>m({address:t,baseURL:u.apiAddress})),j=await Promise.all(h),i=P.reduce((t,c)=>Object.assign(t,{[c.address]:c}),{});j.forEach(t=>{if(!t||!a||!a.price)return;let c=new x(t.balance),S=c.dividedBy(x(10).pow(18)).toFormat(4).toString();if(c.isNaN())return;let U=g({amount:f({input:t.balance}),usd:a?.price});i[t.address].balance=S,i[t.address].usdValue=U});let p=Object.values(i).sort((t,c)=>t.index-c.index),O=p.filter(l);e.updateAllAccounts(p),e.updateAccountScreen({accounts:O,isLoading:!1})}catch(o){console.error("Failed to fetch accounts:",o)}};export{F as a};
2
- //# sourceMappingURL=chunk-TUT2EPC2.mjs.map
1
+ import{a as w}from"./chunk-QXC4D3AC.mjs";import{a as g}from"./chunk-YGI3KXMZ.mjs";import{a as b}from"./chunk-4NCS6I7W.mjs";import{a as m}from"./chunk-6FXEHNGW.mjs";import{f}from"./chunk-PJWJZHIS.mjs";import x from"bignumber.js";var F=async({manager:e,provider:d})=>{if(!e||!d)throw new Error("Provider is not initialized.");let{network:u}=b(),s=e.getAccountScreenData()?.startIndex||0,r=e.getAllAccounts(),a=await w({baseURL:u.apiAddress}),l=o=>o.index>=s&&o.index<s+e.addressesPerPage,I=r.reduce((o,n)=>Object.assign(o,{[n.index]:n}),{}),A=r.filter(l),y=!!I[s];if(e.updateAccountScreen({isLoading:!y}),A.length>0){e.updateAccountScreen({accounts:A});return}try{let o=Math.floor(s/e.addressesPerPage),n=await d.getAccounts(o,e.addressesPerPage),L=n.map((t,c)=>({address:t,balance:"...",index:c+s})),P=[...r,...L],h=n.map(t=>m({address:t,baseURL:u.apiAddress})),j=await Promise.all(h),i=P.reduce((t,c)=>Object.assign(t,{[c.address]:c}),{});j.forEach(t=>{if(!t||!a||!a.price)return;let c=new x(t.balance),S=c.dividedBy(x(10).pow(18)).toFormat(4).toString();if(c.isNaN())return;let U=g({amount:f({input:t.balance}),usd:a?.price});i[t.address].balance=S,i[t.address].usdValue=U});let p=Object.values(i).sort((t,c)=>t.index-c.index),O=p.filter(l);e.updateAllAccounts(p),e.updateAccountScreen({accounts:O,isLoading:!1})}catch(o){console.error("Failed to fetch accounts:",o)}};export{F as a};
2
+ //# sourceMappingURL=chunk-6SIVER36.mjs.map
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-CAA4VJRH.mjs";import{u as o}from"./chunk-Z2ZFJH7M.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-6SUMRGIJ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-5BLRRK4B.mjs";import{a as o}from"./chunk-WE7YOBO7.mjs";async function p({loginToken:i,extraInfoData:n}){if(i==null||Object.keys(n).length===0)return null;let t=o(String(i)),{timestamp:e,...a}=t?.extraInfo||{};if(!(t&&e!=null))return null;let s={hash:String(t?.blockHash),timestamp:Number(e)};return await r({extraInfo:{...a,...n},expirySeconds:t?.ttl,origin:t?.origin}).initialize({latestBlockInfo:s})}export{p as a};
2
- //# sourceMappingURL=chunk-V4H5P3MS.mjs.map
1
+ import{a as r}from"./chunk-EFPESRFQ.mjs";import{a as o}from"./chunk-WE7YOBO7.mjs";async function p({loginToken:i,extraInfoData:n}){if(i==null||Object.keys(n).length===0)return null;let t=o(String(i)),{timestamp:e,...a}=t?.extraInfo||{};if(!(t&&e!=null))return null;let s={hash:String(t?.blockHash),timestamp:Number(e)};return await r({extraInfo:{...a,...n},expirySeconds:t?.ttl,origin:t?.origin}).initialize({latestBlockInfo:s})}export{p as a};
2
+ //# sourceMappingURL=chunk-7PI3RH5C.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-T26S2V72.mjs";var e=class n extends t{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE_PENDING_TRANSACTIONS",uiTag:"mvx-pending-transactions-panel"});this.initialData=null;this.data=this.initialData}static getInstance(){return n.instance||(n.instance=new n),n.instance}isPendingTransactionsOpen(){return this.isOpen}async setupEventListeners(){this.eventBus&&this.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",this.closeUI.bind(this))}};export{e as a};
2
- //# sourceMappingURL=chunk-NKLRQJVY.mjs.map
1
+ import{a as t}from"./chunk-ITZYC6JK.mjs";var e=class n extends t{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE_PENDING_TRANSACTIONS",uiTag:"mvx-pending-transactions-panel"});this.initialData=null;this.data=this.initialData}static getInstance(){return n.instance||(n.instance=new n),n.instance}isPendingTransactionsOpen(){return this.isOpen}async setupEventListeners(){this.eventBus&&this.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",this.closeUI.bind(this))}};export{e as a};
2
+ //# sourceMappingURL=chunk-7RNNI3LI.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as ae}from"./chunk-G4Z3ZQR6.mjs";import{a as se}from"./chunk-M3YL36ZL.mjs";import{a as te}from"./chunk-WWMW5EIR.mjs";import{a as U}from"./chunk-PQYZODUA.mjs";import{a as ie}from"./chunk-6JS7TNJC.mjs";import{a as re}from"./chunk-SVXVYH6P.mjs";import{a as I}from"./chunk-FNMPZS4S.mjs";import{a as ee}from"./chunk-YUFPUG5O.mjs";import{a as de}from"./chunk-RDPREOPG.mjs";import{a as p}from"./chunk-VQFQUFLP.mjs";import{a as Z}from"./chunk-VXWZLNHI.mjs";import{a as ne}from"./chunk-LJBVZK5V.mjs";import{a as oe}from"./chunk-2UIRKC76.mjs";import{a as Q}from"./chunk-QJGFIK7H.mjs";import{b as J}from"./chunk-4Z3DZ2A3.mjs";import{b as C,c as Y}from"./chunk-NRXYSTRW.mjs";import{j as $,l as O,r as M,s as P,t as L}from"./chunk-H3EGIL75.mjs";import{a as y}from"./chunk-F755MYC5.mjs";import{g as K}from"./chunk-CAA4VJRH.mjs";import{a as q}from"./chunk-WADOAKBZ.mjs";import{a as D}from"./chunk-4TBVQD27.mjs";import{a as X}from"./chunk-SNJKYJAD.mjs";import{a as F,s as j,u as l}from"./chunk-YOJAS3PK.mjs";import{f as R}from"./chunk-UERJ6AKK.mjs";import{b as E,c as V}from"./chunk-SAAOQW7P.mjs";import{a as B}from"./chunk-VNLGNNIL.mjs";import{b as H,c as G}from"./chunk-6JM4DPOH.mjs";import{a as c}from"./chunk-CDQ2BNUD.mjs";import{a as o}from"./chunk-PLUWBWJ2.mjs";import{IframeLoginTypes as pe}from"@multiversx/sdk-web-wallet-iframe-provider/out/constants";var f=class extends p{constructor({address:e,anchor:r,shouldInitProvider:t}){super(e);this.provider=null;this.config=null;this.ledgerLogin=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");if(!e||typeof e.addressIndex!="number")throw new Error("Missing addressIndex for Ledger login");let{address:r,signature:t}=await this.provider.login({addressIndex:e.addressIndex});return{address:r,signature:t??""}};this.loginOperation=async e=>{if(!this.provider||!this.config)throw new Error("Provider is not initialized.");return await te({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!I())return;await U.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ne({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ce({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await re({shouldInitProvider:!0});this.provider=r}catch(r){throw $({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.ledger}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){await this.initLegderConnectManager(this.options?.anchor);let e=U.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((n,s)=>ie({manager:e,resolve:n,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ve=3e4,me=5e3,he=3e3,S=class a{constructor(){this.store=j();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=B(i),r=R(i);return!!(e===o.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=J(l());if(!(!this.shouldCheckConnection()||i))try{await L().getProvider().getAddress()}catch{if(O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"times",iconClassName:"warning",message:"Unlock your device to continue signing transactions",title:"Ledger disconnected"}),this.reset(),this.recreateProviderInterval)return;this.recreateProviderInterval=setInterval(this.reconnectProvider,me)}},ve))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new f({shouldInitProvider:!0});await i.init();let e=new M(i);i.getType=()=>o.ledger,P(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:he,icon:"check",iconClassName:"success",message:"Your device is ready to sign transactions",title:"Ledger reconnected"}),this.startCheckConnectionLoop()}catch{console.log("Unable to reconnect to Ledger")}};this.reset=()=>{clearInterval(this.connectionCheckInterval??0),this.connectionCheckInterval=null}}static getInstance(){return a.instance||(a.instance=new a),a.instance}};var k=class extends p{constructor(e){super(e?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{onClose:r,manager:t}=await this.initSignState();try{let n=await this.provider.signTransactions(e)??[];return await oe(n)}catch(n){throw await r({shouldCancelAction:!0}),n}finally{t.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.crossWindow})};this.walletAddress=e?.walletAddress,this.provider=Q.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=E(l()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return o.crossWindow}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{ExtensionProvider as ue}from"@multiversx/sdk-extension-provider/out/extensionProvider";var z=class extends p{constructor(e){super(e);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)??[]}catch(n){throw await t({shouldCancelAction:!1}),n}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension})};this.provider=ue.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return o.extension}};var fe={passkey:o.passkey,metamask:o.metamask},T=class extends p{constructor({type:e,address:r,walletUrl:t}){super(r);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)}catch(n){throw await t({shouldCancelAction:!0}),n}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider||!this.type)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c[this.type]})};this.type=e,this.walletUrl=t??"",this.provider=se.getInstance(),this._login=this.provider.login.bind(this.provider)}init(){return this.initializeAddress(),this.initializeWalletUrl(),this.initializeProvider()}initializeWalletUrl(){if(this.walletUrl)return;let e=E(l());if(!e.iframeWalletAddress)throw new Error("Invalid walletUrl");this.walletUrl=e.iframeWalletAddress}async initializeProvider(){return await this.provider.init(),this.address&&this.setAccount({address:this.address}),this.provider.setLoginType(this.type),this.provider.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return fe[this.type]}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{OptionalOperation as ye}from"@multiversx/sdk-wallet-connect-provider/out";var le=[C.CANCEL_ACTION,C.SIGN_LOGIN_TOKEN],_=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;this.cancelActionAbortController=null;this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();this.cancelActionAbortController=new AbortController;let n=this.cancelActionAbortController.signal;try{let s=new Promise((h,v)=>{n.addEventListener("abort",()=>{v(new Error("cancelled by user"))})});return await Promise.race([this.provider.signTransactions(e),s])}catch(s){throw await t({shouldCancelAction:!0}),s}finally{r.closeUI()}};this.cancelAction=async()=>{this.sendCustomRequest({method:C.CANCEL_ACTION,action:ye.CANCEL_ACTION}),this.cancelActionAbortController?.abort()};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");this.cancelActionAbortController=new AbortController;let r=this.cancelActionAbortController.signal,t=new Promise((s,d)=>{r.addEventListener("abort",()=>{d(new Error("cancelled by user"))})});return await Promise.race([g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension}),t])};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.walletConnect}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return Promise.resolve(this.provider.getAddress())}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){if(await this.initWalletConnectManager(),!this.config)throw new Error("Invalid WalletConnect setup");let{walletConnectProvider:e,dappMethods:r}=await this.createWalletConnectProvider(this.config);this.provider=e,this.methods=r;let{uri:t="",approval:n}=await this.provider.connect({methods:this.methods}),s=this.config.walletConnectDeepLink??D.walletConnectDeepLink;this._approval=n,y.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!I())return;await y.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=I(),t=V(l());if(H(l())&&le.push(C.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{X()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:x={},walletConnectV2RelayAddress:W=""}=e,w=new Y(v,t,W,m,x);return await w.init(),{walletConnectProvider:w,dappMethods:le}}catch(m){throw console.error("Unable to connect",m),r&&await this.logout(),m}}async login(e){if(!this.provider)throw new Error("Provider is not initialized. Call createProvider first.");let r=async()=>{if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.init();let t=y.getInstance(),{uri:n="",approval:s}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??D.walletConnectDeepLink;t.updateData({wcURI:n,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(n)}`});let h=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=h??{};return t.handleClose({isLoginFinished:!!v}),{address:v,signature:m}}catch{return await r()}};if(!this._approval)throw new Error("Approval or login is not initialized");try{let t=await this.provider.login({approval:this._approval.bind(this),token:e?.token}),{address:n="",signature:s=""}=t??{};return y.getInstance().handleClose({isLoginFinished:!!n}),{address:n,signature:s}}catch(t){return console.error("User rejected connection proposal",t),await r()}}async sendCustomRequest({action:e,method:r}){if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.sendCustomRequest?.({request:{method:r,params:{action:e}}})}catch(t){console.error("Unable to send event",t)}}};var A=class{static set customProviders(i){this._customProviders=i}static get customProviders(){return this._customProviders}static async create({type:i,anchor:e}){let r=null;switch(i){case o.extension:{r=new z;break}case o.crossWindow:{r=new k;break}case o.ledger:{r=new f({anchor:e}),await S.getInstance().init();break}case o.metamask:{r=new T({type:pe.metamask});break}case o.passkey:{r=new T({type:pe.passkey});break}case o.walletConnect:{let s=G(l());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new _({anchor:e,...s});break}case o.webview:{r=new de;break}default:{let s=q();for(let d of this._customProviders)d.type===i&&(r=await d.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new M(r);P(t);let n=[o.crossWindow,o.metamask,o.passkey].includes(i);return ae(n?{skipLoginMethod:i}:null),t}static async destroy(){L().cancelLogin(),P(null),F(o.none)}};A._customProviders=[];var Pe=(a,i)=>a.some(e=>e.type===i);async function g({message:a,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(n,s)=>{let{manager:d,onClose:h}=await Z({cancelAction:e}),v=Object.values(A.customProviders),m=v.reduce((u,N)=>(u[N.type]=N.name,u),{}),x={...c,...m},W=async()=>{await h({shouldCancelAction:!0}),s({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",W);let w=Pe(v,r)?r:o.none;d.updateData({name:x[w],type:w});try{let u=await i(a);n(u)}catch(u){await h({shouldCancelAction:!0}),s(u)}finally{d.closeUI()}})}async function ce({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=ee(e);throw r?{message:r}:e}}export{ce as a,f as b,S as c,A as d,g as e,k as f,z as g,T as h,_ as i};
2
- //# sourceMappingURL=chunk-5C2ZAHTB.mjs.map
1
+ import{a as ae}from"./chunk-G4Z3ZQR6.mjs";import{a as se}from"./chunk-M3YL36ZL.mjs";import{a as te}from"./chunk-66U2DKC2.mjs";import{a as U}from"./chunk-XPUAJV6J.mjs";import{a as ie}from"./chunk-UMIK4KBK.mjs";import{a as re}from"./chunk-J2PJZYN7.mjs";import{a as I}from"./chunk-O5DNWY4U.mjs";import{a as ee}from"./chunk-YUFPUG5O.mjs";import{a as de}from"./chunk-SC752S7S.mjs";import{a as p}from"./chunk-DY5F22IP.mjs";import{a as Z}from"./chunk-KJ2ESZS3.mjs";import{a as ne}from"./chunk-CVCNSUVX.mjs";import{a as oe}from"./chunk-TJSRZTXV.mjs";import{a as Q}from"./chunk-QJGFIK7H.mjs";import{b as J}from"./chunk-4Z3DZ2A3.mjs";import{b as C,c as Y}from"./chunk-NRXYSTRW.mjs";import{j as $,l as O,r as M,s as P,t as L}from"./chunk-HP2XWN3H.mjs";import{a as y}from"./chunk-FTQV2IFE.mjs";import{g as K}from"./chunk-CAA4VJRH.mjs";import{a as q}from"./chunk-XF4GSZXO.mjs";import{a as D}from"./chunk-4TBVQD27.mjs";import{a as X}from"./chunk-X66WRHHQ.mjs";import{a as F,s as j,u as l}from"./chunk-Z2ZFJH7M.mjs";import{f as R}from"./chunk-UERJ6AKK.mjs";import{b as E,c as V}from"./chunk-SAAOQW7P.mjs";import{a as B}from"./chunk-VNLGNNIL.mjs";import{b as H,c as G}from"./chunk-6JM4DPOH.mjs";import{a as c}from"./chunk-CDQ2BNUD.mjs";import{a as o}from"./chunk-PLUWBWJ2.mjs";import{IframeLoginTypes as pe}from"@multiversx/sdk-web-wallet-iframe-provider/out/constants";var f=class extends p{constructor({address:e,anchor:r,shouldInitProvider:t}){super(e);this.provider=null;this.config=null;this.ledgerLogin=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");if(!e||typeof e.addressIndex!="number")throw new Error("Missing addressIndex for Ledger login");let{address:r,signature:t}=await this.provider.login({addressIndex:e.addressIndex});return{address:r,signature:t??""}};this.loginOperation=async e=>{if(!this.provider||!this.config)throw new Error("Provider is not initialized.");return await te({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!I())return;await U.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ne({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ce({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await re({shouldInitProvider:!0});this.provider=r}catch(r){throw $({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.ledger}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){await this.initLegderConnectManager(this.options?.anchor);let e=U.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((n,s)=>ie({manager:e,resolve:n,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ve=3e4,me=5e3,he=3e3,S=class a{constructor(){this.store=j();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=B(i),r=R(i);return!!(e===o.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=J(l());if(!(!this.shouldCheckConnection()||i))try{await L().getProvider().getAddress()}catch{if(O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"times",iconClassName:"warning",message:"Unlock your device to continue signing transactions",title:"Ledger disconnected"}),this.reset(),this.recreateProviderInterval)return;this.recreateProviderInterval=setInterval(this.reconnectProvider,me)}},ve))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new f({shouldInitProvider:!0});await i.init();let e=new M(i);i.getType=()=>o.ledger,P(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:he,icon:"check",iconClassName:"success",message:"Your device is ready to sign transactions",title:"Ledger reconnected"}),this.startCheckConnectionLoop()}catch{console.log("Unable to reconnect to Ledger")}};this.reset=()=>{clearInterval(this.connectionCheckInterval??0),this.connectionCheckInterval=null}}static getInstance(){return a.instance||(a.instance=new a),a.instance}};var k=class extends p{constructor(e){super(e?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{onClose:r,manager:t}=await this.initSignState();try{let n=await this.provider.signTransactions(e)??[];return await oe(n)}catch(n){throw await r({shouldCancelAction:!0}),n}finally{t.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.crossWindow})};this.walletAddress=e?.walletAddress,this.provider=Q.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=E(l()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return o.crossWindow}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{ExtensionProvider as ue}from"@multiversx/sdk-extension-provider/out/extensionProvider";var z=class extends p{constructor(e){super(e);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)??[]}catch(n){throw await t({shouldCancelAction:!1}),n}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension})};this.provider=ue.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return o.extension}};var fe={passkey:o.passkey,metamask:o.metamask},T=class extends p{constructor({type:e,address:r,walletUrl:t}){super(r);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)}catch(n){throw await t({shouldCancelAction:!0}),n}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider||!this.type)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c[this.type]})};this.type=e,this.walletUrl=t??"",this.provider=se.getInstance(),this._login=this.provider.login.bind(this.provider)}init(){return this.initializeAddress(),this.initializeWalletUrl(),this.initializeProvider()}initializeWalletUrl(){if(this.walletUrl)return;let e=E(l());if(!e.iframeWalletAddress)throw new Error("Invalid walletUrl");this.walletUrl=e.iframeWalletAddress}async initializeProvider(){return await this.provider.init(),this.address&&this.setAccount({address:this.address}),this.provider.setLoginType(this.type),this.provider.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return fe[this.type]}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{OptionalOperation as ye}from"@multiversx/sdk-wallet-connect-provider/out";var le=[C.CANCEL_ACTION,C.SIGN_LOGIN_TOKEN],_=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;this.cancelActionAbortController=null;this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();this.cancelActionAbortController=new AbortController;let n=this.cancelActionAbortController.signal;try{let s=new Promise((h,v)=>{n.addEventListener("abort",()=>{v(new Error("cancelled by user"))})});return await Promise.race([this.provider.signTransactions(e),s])}catch(s){throw await t({shouldCancelAction:!0}),s}finally{r.closeUI()}};this.cancelAction=async()=>{this.sendCustomRequest({method:C.CANCEL_ACTION,action:ye.CANCEL_ACTION}),this.cancelActionAbortController?.abort()};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");this.cancelActionAbortController=new AbortController;let r=this.cancelActionAbortController.signal,t=new Promise((s,d)=>{r.addEventListener("abort",()=>{d(new Error("cancelled by user"))})});return await Promise.race([g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension}),t])};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.walletConnect}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return Promise.resolve(this.provider.getAddress())}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){if(await this.initWalletConnectManager(),!this.config)throw new Error("Invalid WalletConnect setup");let{walletConnectProvider:e,dappMethods:r}=await this.createWalletConnectProvider(this.config);this.provider=e,this.methods=r;let{uri:t="",approval:n}=await this.provider.connect({methods:this.methods}),s=this.config.walletConnectDeepLink??D.walletConnectDeepLink;this._approval=n,y.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!I())return;await y.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=I(),t=V(l());if(H(l())&&le.push(C.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{X()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:x={},walletConnectV2RelayAddress:W=""}=e,w=new Y(v,t,W,m,x);return await w.init(),{walletConnectProvider:w,dappMethods:le}}catch(m){throw console.error("Unable to connect",m),r&&await this.logout(),m}}async login(e){if(!this.provider)throw new Error("Provider is not initialized. Call createProvider first.");let r=async()=>{if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.init();let t=y.getInstance(),{uri:n="",approval:s}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??D.walletConnectDeepLink;t.updateData({wcURI:n,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(n)}`});let h=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=h??{};return t.handleClose({isLoginFinished:!!v}),{address:v,signature:m}}catch{return await r()}};if(!this._approval)throw new Error("Approval or login is not initialized");try{let t=await this.provider.login({approval:this._approval.bind(this),token:e?.token}),{address:n="",signature:s=""}=t??{};return y.getInstance().handleClose({isLoginFinished:!!n}),{address:n,signature:s}}catch(t){return console.error("User rejected connection proposal",t),await r()}}async sendCustomRequest({action:e,method:r}){if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.sendCustomRequest?.({request:{method:r,params:{action:e}}})}catch(t){console.error("Unable to send event",t)}}};var A=class{static set customProviders(i){this._customProviders=i}static get customProviders(){return this._customProviders}static async create({type:i,anchor:e}){let r=null;switch(i){case o.extension:{r=new z;break}case o.crossWindow:{r=new k;break}case o.ledger:{r=new f({anchor:e}),await S.getInstance().init();break}case o.metamask:{r=new T({type:pe.metamask});break}case o.passkey:{r=new T({type:pe.passkey});break}case o.walletConnect:{let s=G(l());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new _({anchor:e,...s});break}case o.webview:{r=new de;break}default:{let s=q();for(let d of this._customProviders)d.type===i&&(r=await d.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new M(r);P(t);let n=[o.crossWindow,o.metamask,o.passkey].includes(i);return ae(n?{skipLoginMethod:i}:null),t}static async destroy(){L().cancelLogin(),P(null),F(o.none)}};A._customProviders=[];var Pe=(a,i)=>a.some(e=>e.type===i);async function g({message:a,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(n,s)=>{let{manager:d,onClose:h}=await Z({cancelAction:e}),v=Object.values(A.customProviders),m=v.reduce((u,N)=>(u[N.type]=N.name,u),{}),x={...c,...m},W=async()=>{await h({shouldCancelAction:!0}),s({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",W);let w=Pe(v,r)?r:o.none;d.updateData({name:x[w],type:w});try{let u=await i(a);n(u)}catch(u){await h({shouldCancelAction:!0}),s(u)}finally{d.closeUI()}})}async function ce({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=ee(e);throw r?{message:r}:e}}export{ce as a,f as b,S as c,A as d,g as e,k as f,z as g,T as h,_ as i};
2
+ //# sourceMappingURL=chunk-A5F6KBRA.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as I}from"./chunk-PJDJEPY2.mjs";import{a as l}from"./chunk-SIHP75SP.mjs";import{a as f}from"./chunk-NNNFX3FU.mjs";import{j as m,k as d,l as p,n as u}from"./chunk-65L5EBBL.mjs";import{a as T}from"./chunk-C754AWVZ.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-N3NTEUD2.mjs.map
1
+ import{a as I}from"./chunk-PJDJEPY2.mjs";import{a as l}from"./chunk-SSAPDI4J.mjs";import{a as f}from"./chunk-PFKDWDRA.mjs";import{j as m,k as d,l as p,n as u}from"./chunk-65L5EBBL.mjs";import{a as T}from"./chunk-L6XUG4LZ.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-AE67HPX7.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-LN5UXO64.mjs";import{a as _}from"./chunk-PHOF3Z5D.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-2DFE24NA.mjs";import{a as O}from"./chunk-YGI3KXMZ.mjs";import{a as x}from"./chunk-2JDGOX23.mjs";import{a as v}from"./chunk-RYIJWGFA.mjs";import{t as G}from"./chunk-H3EGIL75.mjs";import{a as L}from"./chunk-SIHP75SP.mjs";import{a as h}from"./chunk-BRJNX4JF.mjs";import{a as b,c as C,f as u}from"./chunk-PJWJZHIS.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-MONQ4RXB.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-VDDLODBL.mjs.map
1
+ import{a as V}from"./chunk-7Z7IX367.mjs";import{a as B}from"./chunk-VCQBYNNS.mjs";import{a as $}from"./chunk-LN5UXO64.mjs";import{a as _}from"./chunk-PHOF3Z5D.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-2DFE24NA.mjs";import{a as O}from"./chunk-YGI3KXMZ.mjs";import{a as x}from"./chunk-TAMBWEVQ.mjs";import{a as v}from"./chunk-RYIJWGFA.mjs";import{t as G}from"./chunk-HP2XWN3H.mjs";import{a as L}from"./chunk-SSAPDI4J.mjs";import{a as h}from"./chunk-BRJNX4JF.mjs";import{a as b,c as C,f as u}from"./chunk-PJWJZHIS.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-5JCA5OZE.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-AG5FZ7D2.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-TMZ5BZOT.mjs";var o={async getTransactionsHistory(s){return await t(s)}};export{o as a};
2
+ //# sourceMappingURL=chunk-BAX6BDHT.mjs.map
@@ -0,0 +1,2 @@
1
+ import{u as o}from"./chunk-Z2ZFJH7M.mjs";import{b as t}from"./chunk-UERJ6AKK.mjs";function c(r=o()){return t(r)}export{c as a};
2
+ //# sourceMappingURL=chunk-BDYK46XE.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-MONQ4RXB.mjs";function t(){if(!e)return"";try{if(e.document.referrer)return new URL(e.document.referrer).origin;let r=e.location.ancestorOrigins;return r.length<1?"":new URL(r[r.length-1]).origin}catch(r){return console.error(r),""}}export{t as a};
2
- //# sourceMappingURL=chunk-YILAZW7P.mjs.map
1
+ import{a as e}from"./chunk-5JCA5OZE.mjs";function t(){if(!e)return"";try{if(e.document.referrer)return new URL(e.document.referrer).origin;let r=e.location.ancestorOrigins;return r.length<1?"":new URL(r[r.length-1]).origin}catch(r){return console.error(r),""}}export{t as a};
2
+ //# sourceMappingURL=chunk-BFX6KRJB.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-FMQYLMTU.mjs";import{b as s,c as r}from"./chunk-34TZ56ZL.mjs";async function l({results:e,hash:i,sessionId:t}){let a=e?.find(o=>o?.returnMessage!=="");r({sessionId:t,transaction:{...a,hash:i,status:"fail",inTransit:!1}}),s({sessionId:t,status:"fail",errorMessage:a?.returnMessage}),await n({sessionId:t,status:"fail"})}export{l as a};
2
- //# sourceMappingURL=chunk-AEZWP25S.mjs.map
1
+ import{a as n}from"./chunk-FMQYLMTU.mjs";import{b as s,c as r}from"./chunk-SKGX7AQR.mjs";async function l({results:e,hash:i,sessionId:t}){let a=e?.find(o=>o?.returnMessage!=="");r({sessionId:t,transaction:{...a,hash:i,status:"fail",inTransit:!1}}),s({sessionId:t,status:"fail",errorMessage:a?.returnMessage}),await n({sessionId:t,status:"fail"})}export{l as a};
2
+ //# sourceMappingURL=chunk-BLYQZ3AK.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as B}from"./chunk-X6ITADSX.mjs";import{a as b}from"./chunk-LZITSA2G.mjs";import{a as k}from"./chunk-QXC4D3AC.mjs";import{a as R}from"./chunk-OD4ANAAQ.mjs";import{a as D}from"./chunk-VDDLODBL.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as j}from"./chunk-2DFE24NA.mjs";import{a as _}from"./chunk-2UIRKC76.mjs";import{a as A}from"./chunk-MKHSCAMQ.mjs";import{a as O}from"./chunk-NNNFX3FU.mjs";import{u as x}from"./chunk-YOJAS3PK.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-PJWJZHIS.mjs";import{a as w}from"./chunk-NTEMINYA.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard: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-LJBVZK5V.mjs.map
1
+ import{a as B}from"./chunk-BDYK46XE.mjs";import{a as b}from"./chunk-OVDQU4VC.mjs";import{a as k}from"./chunk-QXC4D3AC.mjs";import{a as R}from"./chunk-OD4ANAAQ.mjs";import{a as D}from"./chunk-AG5FZ7D2.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as j}from"./chunk-2DFE24NA.mjs";import{a as _}from"./chunk-TJSRZTXV.mjs";import{a as A}from"./chunk-GHY2IAO2.mjs";import{a as O}from"./chunk-PFKDWDRA.mjs";import{u as x}from"./chunk-Z2ZFJH7M.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-PJWJZHIS.mjs";import{a as w}from"./chunk-NTEMINYA.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard: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-CVCNSUVX.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-V4H5P3MS.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-S6ZQLKKX.mjs.map
1
+ import{a as t}from"./chunk-7PI3RH5C.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-DPO6NAIN.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-TYN5TMRZ.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-NBZUJ5VZ.mjs.map
1
+ import{a as s}from"./chunk-IHIBTL4N.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-DQZXAQEQ.mjs.map
@@ -0,0 +1,2 @@
1
+ import{u as o}from"./chunk-Z2ZFJH7M.mjs";import{a as t}from"./chunk-UERJ6AKK.mjs";function n(r=o()){return t(r)}export{n as a};
2
+ //# sourceMappingURL=chunk-DSA7OV2X.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-WADOAKBZ.mjs";import{c as e,g as s}from"./chunk-NTEMINYA.mjs";async function m({message:r,provider:a,options:n}){let g=o(),i=new s({address:new e(g),data:r.data});return await a.signMessage(i,n)}export{m as a};
2
- //# sourceMappingURL=chunk-OWNMDLKO.mjs.map
1
+ import{a as o}from"./chunk-XF4GSZXO.mjs";import{c as e,g as s}from"./chunk-NTEMINYA.mjs";async function m({message:r,provider:a,options:n}){let g=o(),i=new s({address:new e(g),data:r.data});return await a.signMessage(i,n)}export{m as a};
2
+ //# sourceMappingURL=chunk-DWJNMLII.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-VXWZLNHI.mjs";import{a as e}from"./chunk-WADOAKBZ.mjs";import{a as i}from"./chunk-CDQ2BNUD.mjs";var a=class{constructor(o){this.address="";this._login=null;this.loginAbortController=null;this.cancelLogin=()=>{this.loginAbortController&&this.loginAbortController.abort(),this.cancelAction?.(),this.loginAbortController=null};this.loginOperation=async o=>{if(!this._login)throw new Error("Provider is not initialized.");let r=await this._login(o);if(!r?.address)throw new Error("Provider is not initialized.");return{...r,address:r.address,signature:r.signature??""}};this.initializeAddress=()=>{if(this.address)return;let o=e();o&&(this.address=o)};this.cancelAction=void 0;this.address=o??""}getAccount(){throw new Error("Method not implemented.")}signTransaction(o,r){throw new Error("Method not implemented.")}async login(o){if(!this._login)throw new Error("Provider is not initialized.");this.loginAbortController&&this.loginAbortController.abort();let r=new AbortController;this.loginAbortController=r;let t=r.signal;try{let n=new Promise((p,c)=>{t.addEventListener("abort",()=>{c(new Error("Login cancelled"))})}),l=await Promise.race([this.loginOperation(o),n]);return this.loginAbortController=null,l}catch(n){throw this.loginAbortController=null,n}}async initSignState(){let{onClose:o,manager:r}=await s({cancelAction:this.cancelAction?.bind(this)}),t=this.getType();return r.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",o),r.updateData({name:i[t],type:t}),{onClose:o,manager:r}}};export{a};
2
- //# sourceMappingURL=chunk-VQFQUFLP.mjs.map
1
+ import{a as s}from"./chunk-KJ2ESZS3.mjs";import{a as e}from"./chunk-XF4GSZXO.mjs";import{a as i}from"./chunk-CDQ2BNUD.mjs";var a=class{constructor(o){this.address="";this._login=null;this.loginAbortController=null;this.cancelLogin=()=>{this.loginAbortController&&this.loginAbortController.abort(),this.cancelAction?.(),this.loginAbortController=null};this.loginOperation=async o=>{if(!this._login)throw new Error("Provider is not initialized.");let r=await this._login(o);if(!r?.address)throw new Error("Provider is not initialized.");return{...r,address:r.address,signature:r.signature??""}};this.initializeAddress=()=>{if(this.address)return;let o=e();o&&(this.address=o)};this.cancelAction=void 0;this.address=o??""}getAccount(){throw new Error("Method not implemented.")}signTransaction(o,r){throw new Error("Method not implemented.")}async login(o){if(!this._login)throw new Error("Provider is not initialized.");this.loginAbortController&&this.loginAbortController.abort();let r=new AbortController;this.loginAbortController=r;let t=r.signal;try{let n=new Promise((p,c)=>{t.addEventListener("abort",()=>{c(new Error("Login cancelled"))})}),l=await Promise.race([this.loginOperation(o),n]);return this.loginAbortController=null,l}catch(n){throw this.loginAbortController=null,n}}async initSignState(){let{onClose:o,manager:r}=await s({cancelAction:this.cancelAction?.bind(this)}),t=this.getType();return r.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",o),r.updateData({name:i[t],type:t}),{onClose:o,manager:r}}};export{a};
2
+ //# sourceMappingURL=chunk-DY5F22IP.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-2Z53M64I.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-5BLRRK4B.mjs.map
1
+ import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-6HYLHYFC.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-EFPESRFQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-MONQ4RXB.mjs";var i=String(o?.navigator?.userAgent),t=/^((?!chrome|android).)*safari/i.test(i),r=/firefox/i.test(i)&&/windows/i.test(i),n=t||r;export{t as a,n as b};
2
- //# sourceMappingURL=chunk-MXKOONHC.mjs.map
1
+ import{a as o}from"./chunk-5JCA5OZE.mjs";var i=String(o?.navigator?.userAgent),t=/^((?!chrome|android).)*safari/i.test(i),r=/firefox/i.test(i)&&/windows/i.test(i),n=t||r;export{t as a,n as b};
2
+ //# sourceMappingURL=chunk-EXIQ5AWW.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-YILAZW7P.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-42CVZ3GV.mjs.map
1
+ import{a as e}from"./chunk-BFX6KRJB.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-F535UPIT.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-2GP5IQEP.mjs";function S(e){return t()(e)}export{S as a};
2
+ //# sourceMappingURL=chunk-FCLLSOVB.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-NBZUJ5VZ.mjs";var n=class t extends e{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-wallet-connect"});this.initialData={wcURI:"",walletConnectDeepLink:""};this.data={...this.initialData}}static getInstance(){return t.instance||(t.instance=new t),t.instance}handleClose(a){a?.isLoginFinished||(this.anchor?this.anchor.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy())}async setupEventListeners(){this.eventBus&&(this.eventBus.subscribe("CLOSE",this.handleClose.bind(this)),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}};export{n as a};
2
- //# sourceMappingURL=chunk-F755MYC5.mjs.map
1
+ import{a as e}from"./chunk-DQZXAQEQ.mjs";var n=class t extends e{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-wallet-connect"});this.initialData={wcURI:"",walletConnectDeepLink:""};this.data={...this.initialData}}static getInstance(){return t.instance||(t.instance=new t),t.instance}handleClose(a){a?.isLoginFinished||(this.anchor?this.anchor.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy())}async setupEventListeners(){this.eventBus&&(this.eventBus.subscribe("CLOSE",this.handleClose.bind(this)),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}};export{n as a};
2
+ //# sourceMappingURL=chunk-FTQV2IFE.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as o,c as i}from"./chunk-QJGFIK7H.mjs";import{t as g}from"./chunk-H3EGIL75.mjs";import{s as u}from"./chunk-YOJAS3PK.mjs";import{a as p}from"./chunk-UERJ6AKK.mjs";import{a as h,c as l,g as c}from"./chunk-NTEMINYA.mjs";import{a as y}from"./chunk-MONQ4RXB.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-75WEAHW3.mjs.map
1
+ import{b as o,c as i}from"./chunk-QJGFIK7H.mjs";import{t as g}from"./chunk-HP2XWN3H.mjs";import{s as u}from"./chunk-Z2ZFJH7M.mjs";import{a as p}from"./chunk-UERJ6AKK.mjs";import{a as h,c as l,g as c}from"./chunk-NTEMINYA.mjs";import{a as y}from"./chunk-5JCA5OZE.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-FZOPS56M.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-T26S2V72.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-MKHSCAMQ.mjs.map
1
+ import{a as s}from"./chunk-ITZYC6JK.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-GHY2IAO2.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as N}from"./chunk-Q2Q4XN4M.mjs";import{b}from"./chunk-UJDX67YT.mjs";import{d as C,e as I}from"./chunk-BVL47QTP.mjs";import{s as p}from"./chunk-YOJAS3PK.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-E2ODPOVS.mjs.map
1
+ import{a as N}from"./chunk-Q2Q4XN4M.mjs";import{b}from"./chunk-IB4WJ3BB.mjs";import{d as C,e as I}from"./chunk-427U5CPN.mjs";import{s as p}from"./chunk-Z2ZFJH7M.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-GSKKORU3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-E2ODPOVS.mjs";var t={closeConnectionRef:void 0};async function c(n){let{closeConnection:o}=await e(n);t.closeConnectionRef=o}export{t as a,c as b};
2
- //# sourceMappingURL=chunk-6Z4GXMSW.mjs.map
1
+ import{a as e}from"./chunk-GSKKORU3.mjs";var t={closeConnectionRef:void 0};async function c(n){let{closeConnection:o}=await e(n);t.closeConnectionRef=o}export{t as a,c as b};
2
+ //# sourceMappingURL=chunk-GYKFRG4G.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-2JDGOX23.mjs";import{a as c}from"./chunk-I3MK6KZJ.mjs";var f=async({receiver:n,sender:i,tokenId:s})=>{let t=null,r=null;if(!s)return{senderLockedAccount:t,receiverLockedAccount:r};try{let o=(await l({tokenId:s}))?.assets?.lockedAccounts;if(!o)return{senderLockedAccount:t,receiverLockedAccount:r};for(let e in o)if(c(e)&&(i===e&&(t=e),n===e&&(r=e)),c(o[e])&&(i===o[e]&&(t=o[e]),n===o[e]&&(r=o[e])),t&&r)return{senderLockedAccount:t,receiverLockedAccount:r}}catch(a){console.error("Error getting token details",a)}return{senderLockedAccount:t,receiverLockedAccount:r}};export{f as a};
2
- //# sourceMappingURL=chunk-AJS7FS66.mjs.map
1
+ import{a as l}from"./chunk-TAMBWEVQ.mjs";import{a as c}from"./chunk-I3MK6KZJ.mjs";var f=async({receiver:n,sender:i,tokenId:s})=>{let t=null,r=null;if(!s)return{senderLockedAccount:t,receiverLockedAccount:r};try{let o=(await l({tokenId:s}))?.assets?.lockedAccounts;if(!o)return{senderLockedAccount:t,receiverLockedAccount:r};for(let e in o)if(c(e)&&(i===e&&(t=e),n===e&&(r=e)),c(o[e])&&(i===o[e]&&(t=o[e]),n===o[e]&&(r=o[e])),t&&r)return{senderLockedAccount:t,receiverLockedAccount:r}}catch(a){console.error("Error getting token details",a)}return{senderLockedAccount:t,receiverLockedAccount:r}};export{f as a};
2
+ //# sourceMappingURL=chunk-HOLYCMSD.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as et}from"./chunk-ARV3XIYY.mjs";import{a as mt}from"./chunk-6UZHM5LW.mjs";import{a as b}from"./chunk-N3NTEUD2.mjs";import{a as pt}from"./chunk-Z7T2J6XD.mjs";import{a as w}from"./chunk-5CABF4XT.mjs";import{a as Z,b as tt,g as st,l as ot}from"./chunk-CAA4VJRH.mjs";import{a as gt}from"./chunk-KMSI4FA6.mjs";import{b as S}from"./chunk-6Z4GXMSW.mjs";import{a as dt}from"./chunk-GHNNJ64D.mjs";import{a as It}from"./chunk-4ODPAHHA.mjs";import{a as ht}from"./chunk-MDVI45IV.mjs";import{a as ft}from"./chunk-OWNMDLKO.mjs";import{a as f}from"./chunk-RUARSP3Z.mjs";import{a as X}from"./chunk-WADOAKBZ.mjs";import{a as ut}from"./chunk-T26S2V72.mjs";import{a as L}from"./chunk-XY4G3LLQ.mjs";import{a as C,f as lt}from"./chunk-BVL47QTP.mjs";import{b as Tt}from"./chunk-SNJKYJAD.mjs";import{d as rt}from"./chunk-34TZ56ZL.mjs";import{k as it,l as nt,n as at}from"./chunk-65L5EBBL.mjs";import{a as A}from"./chunk-HORSXVIV.mjs";import{a as vt}from"./chunk-F3LAQULB.mjs";import{a as Q}from"./chunk-5BLRRK4B.mjs";import{a as E}from"./chunk-QTKK6OSJ.mjs";import{a as J}from"./chunk-6ACLOUQ3.mjs";import{a as y}from"./chunk-6FXEHNGW.mjs";import{a as yt}from"./chunk-NJN53MJV.mjs";import{a as j}from"./chunk-YSCND2MX.mjs";import{a as V,b as q,s as u,u as Y}from"./chunk-YOJAS3PK.mjs";import{c as H,f as $}from"./chunk-UERJ6AKK.mjs";import{b as g}from"./chunk-VNLGNNIL.mjs";import{b as v}from"./chunk-6JM4DPOH.mjs";import{b as G,c as K,f as z}from"./chunk-NTEMINYA.mjs";import{b as Et}from"./chunk-76URRONH.mjs";import{a as ct}from"./chunk-TYN5TMRZ.mjs";import{a as I}from"./chunk-PLUWBWJ2.mjs";import W from"lodash.isequal";import Lt from"lodash.isequal";var Ft="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",x=class e extends ut{constructor(){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.store=u();this.initialData={pendingTransactions:[],historicTransactions:[]};this.closeUI=async()=>{this.data.pendingTransactions.length>0?(this.unsubscribeFunctions.forEach(s=>s.forEach(o=>o())),this.unsubscribeFunctions.clear(),await this.uiElement?.closeWithAnimation()):super.closeUI()};this.data={...this.initialData}}static getInstance(){return e.instance||(e.instance=new e),e.instance}isNotificationsFeedOpen(){return this.isOpen}async openNotificationsFeed(){p.getInstance().hideToasts(),await this.openUI(),await this.updateDataAndNotifications();let o=this.store.subscribe(async({toasts:i,transactions:n},{toasts:a,transactions:c})=>{(!Lt(a.transactionToasts,i.transactionToasts)||!Lt(c,n))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Ft,[o]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}async handleCloseUI(){let s=p.getInstance();await this.closeUI(),await s.showToasts()}async setupEventListeners(){this.eventBus&&(this.subscribeToEventBus("CLOSE_NOTIFICATIONS_FEED",this.handleCloseUI.bind(this)),this.subscribeToEventBus("CLEAR_NOTIFICATIONS_FEED_HISTORY",this.handleClearNotificationsFeedHistory.bind(this)))}async updateDataAndNotifications(){let{transactions:s,account:o,toasts:i,network:n}=this.store.getState(),{pendingTransactionToasts:a}=await b({toastList:i,transactionsSessions:s,account:o});this.data.pendingTransactions=a,this.data.historicTransactions=await et.getTransactionsHistory({transactionsSessions:s,address:o.address,explorerAddress:n.network.explorerAddress,egldLabel:n.network.egldLabel}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){rt(),this.resetData(),this.updateNotificationsFeed()}async updateNotificationsFeed(){this.eventBus&&(this.eventBus.publish("PENDING_TRANSACTIONS_UPDATE",this.data.pendingTransactions),this.eventBus.publish("TRANSACTIONS_HISTORY_UPDATE",this.data.historicTransactions))}};import R from"bignumber.js";var N=class e{constructor(){this.store=u();this.warningLogoutTimeoutRef=null;this.actualLogoutTimeoutRef=null;this.plannedLogoutTimeoutRef=null;this.plannedLogoutKey=null;this.init=async()=>{if(!this.shouldStart())return;let t=this.store.getState(),s=g(t),{isExpired:o}=E(s?.nativeAuthToken);o?h().logout():this.addPlannedLogout()};this.stop=()=>{clearTimeout(this.warningLogoutTimeoutRef??0),clearTimeout(this.plannedLogoutTimeoutRef??0),clearTimeout(this.actualLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=null,this.plannedLogoutTimeoutRef=null,this.actualLogoutTimeoutRef=null,this.plannedLogoutKey=null};this.shouldStart=()=>{let t=this.store.getState(),s=g(t),o=$(t);return!!(s?.nativeAuthToken&&o)};this.addPlannedLogout=()=>{let t=h(),s=H(this.store.getState()),o=t.getType()===I.webview;if(!s||o)return;this.addLogoutWarning();let i=g(this.store.getState()),{secondsUntilExpires:n,expiresAt:a}=E(i?.nativeAuthToken),c=new R(String(n)),r=`${s}_${a}`,m=this.plannedLogoutKey===r;if(!(n&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=r,clearTimeout(this.plannedLogoutTimeoutRef??0);let d=c.times(1e3);this.actualLogoutTimeoutRef=setTimeout(()=>{p.getInstance().createCustomToast({toastId:"native-auth-logout",iconClassName:"warning",title:"Logging out",icon:"times",message:"Your session has expired!"}),this.actualLogoutTimeoutRef=null},d.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},d.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=v(this.store.getState()),s=g(this.store.getState()),{secondsUntilExpires:o}=E(s?.nativeAuthToken),i=new R(String(o)),n=i.times(1e3);if(!o||i.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new R(t?.tokenExpirationToastWarningSeconds??0).times(1e3),r=i.times(1e3).minus(c),m=mt(n.toNumber()),l=r.isLessThanOrEqualTo(0)?0:r.toNumber();clearTimeout(this.warningLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=setTimeout(()=>{p.getInstance().createCustomToast({toastId:"native-auth-expired",iconClassName:"warning",title:"Session Expiration Warning",icon:"hourglass",message:`Your session will expire in ${m}!`}),this.warningLogoutTimeoutRef=null},l)}}static getInstance(){return e.instance||(e.instance=new e),e.instance}};async function B({address:e,provider:t,apiAddress:s}){let o=await y({address:e,baseURL:s});if(!o)throw new Error("Account not found");Tt({address:e,providerType:t.getType()});let i={...o,username:A(o.username),nonce:L(o)};C(i),await S(e),w(),o.shard!=null&&await pt({shard:Number(o.shard),apiAddress:s})}async function kt(e){let{network:{apiAddress:t}}=f();await e.login();let s=await e.getAddress();if(!s)throw new Error("Address not found");return await B({address:s,provider:e,apiAddress:t}),{address:s}}async function Dt({provider:e,nativeAuthConfig:t,token:s}){let{network:{apiAddress:o}}=f(),i=Q(t),n=s;n||(n=await i.initialize({noCache:!0}));let{address:a,signature:c,...r}=await e.login({token:n});if(!a)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let l=J(r?.accessToken)?r.accessToken:i.getToken({address:a,token:n,signature:c});q({loginToken:n,signature:c,nativeAuthToken:l});let d=await dt({loginToken:n,extraInfoData:{multisig:r?.multisig,impersonate:r?.impersonate},address:a});return await B({address:d,provider:e,apiAddress:o}),{address:d,signature:c}}async function bt(e,t){let s=v(Y());if(s)return await Dt({provider:e,nativeAuthConfig:s,token:t?.token});let{address:o}=await kt(e);return await S(o),w(),{address:o}}var U={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${tt}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${Z}-${Date.now()}`}},Rt={extensionResponse:"Unable to sign transactions","Transaction canceled":"Transaction canceled","cancelled by user":"Transaction signing cancelled by user","denied by the user":"Transaction signing denied by the user"},Bt=e=>{for(let[t,s]of Object.entries(Rt))if(e.includes(t))return s;return"Error when signing"};function _(e,t="error"){let s=e?.message,o=Bt(s),n=o!=="Error when signing"?"warning":t,a=Object.keys(U).includes(n)?U[n]:U.error,{toastId:c,iconClassName:r,title:m}=a;return M({toastId:c,duration:1e4,icon:"times",iconClassName:r,message:o,title:m}),o}async function Ct({provider:e,transactions:t,options:s={}}){await St();let{isGuarded:o,activeGuardianAddress:i,nonce:n}=vt(),a=e.getType()===I.ledger,c=It({latestNonce:n,transactions:t}),r=i&&o&&!s.skipGuardian?c?.map(l=>(l.version=G.withTxOptions().valueOf(),l.options=z.withOptions({guarded:!0,...a?{hashSign:!0}:{}}).valueOf(),l.guardian=K.newFromBech32(i),l)):c,m=await e.signTransactions(r)??[];return lt(n+m.length),m}var O=class{constructor(t){this._isLoggingOut=!1;this.provider=t}init(){return this.provider.init()}async login(t){let s=await bt(this.provider,t);return V(this.provider.getType()),wt(this),N.getInstance().init(),s}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0}){if(this._isLoggingOut)return console.warn("Logout already in progress"),!1;this._isLoggingOut=!0;let s=await gt({provider:this.provider,options:t});return this._isLoggingOut=!1,s}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,s){try{return await Ct({provider:this.provider,transactions:t,options:s})}catch(o){let i=_(o);throw new Error(i)}}async signMessage(t,s){try{return await ft({provider:this.provider,message:t,options:s})}catch(o){let i=_(o,"warning");throw new Error(i)}}async verifyMessage(t){return await ht(t)}cancelLogin(){this.provider.cancelLogin?.()}};var At=null;function wt(e){At=e}function h(){return At||new O(Et)}var Ut=async()=>{try{let e=X(),{network:t}=f();try{let s=await y({address:e,baseURL:t.apiAddress});if(s!=null){let o={...s,username:A(s.username),nonce:L(s)};return C(o),o}}catch(s){console.error("Failed getting account ",s)}}catch(e){console.error("Failed getting address ",e)}return null};async function St(){let e=h();if(e==null)throw"Provider not initialized";try{if(!e.init)throw"Current provider does not have init() function";return await e.init()?Ut():void 0}catch(t){console.error("Failed initializing provider ",t)}}var F={},T={},_t=(e,t)=>{u().setState(({toasts:s})=>{let o=s.customToasts.length>0?Math.max(...s.customToasts.map(r=>parseInt(r.toastId.split("-").pop()??"0"))):0,i=t??`custom-toast-${o+1}`,n=s.customToasts.findIndex(r=>r.toastId===i),a={...e,toastId:i};if(n!==-1){s.customToasts[n]=a;return}s.customToasts.push({...a,toastId:i})},!1,"addCustomToast")},P=e=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(s=>s.toastId!==e)},!1,"removeCustomToast")},xt=()=>{u().setState(({toasts:e})=>{e.customToasts=[]},!1,"removeAllCustomToasts")},zo=()=>{u().setState(({toasts:e})=>{e.transactionToasts=[]})},Nt=({toastId:e,totalDuration:t})=>{let s="";return u().setState(({toasts:o})=>{let i=o.transactionToasts.length>0?Math.max(...o.transactionToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0;s=e??`transaction-toast-${i+1}`,o.transactionToasts.push({startTime:j(),endTime:yt(t),toastId:s})},!1,"addTransactionToast"),s},k=e=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(s=>s.toastId!==e)},!1,"removeTransactionToast"),delete T[e],delete F[e]},M=e=>{let{toasts:t}=u().getState(),s=t.customToasts.length>0?Math.max(...t.customToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0,o=e.toastId||`custom-toast-${s+1}`;return e.onClose&&(T[o]=e.onClose),e.instantiateToastElement?(F[o]=e.instantiateToastElement,u().setState(({toasts:i})=>{let n=i.customToasts.findIndex(r=>r.toastId===o),a={...e,instantiateToastElement:null,toastId:o};n!==-1?i.customToasts[n]=a:i.customToasts.push(a)},!1,"createCustomToast"),o):(_t(e,o),o)};var Mt=1e4,D=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=Mt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let s=setTimeout(()=>{k(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,s)};this.startWithCustomDuration=(t,s)=>{if(this.stop(t),s<=0)return;let o=setTimeout(()=>{P(t);let i=T[t];i?.()},s);this.timeoutIntervals.set(t,o)};this.stop=t=>{let s=this.timeoutIntervals.get(t);s&&(clearTimeout(s),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t||Mt}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};var p=class e{constructor(){this.isCreatingElement=!1;this.toastsElement=null;this.transactionToasts=[];this.customToasts=[];this.storeToastsSubscription=()=>null;this.eventBusUnsubscribeFunctions=[];this.eventBus=null;this.store=u();this.destroy(),this.lifetimeManager=new D,this.notificationsFeedManager=x.getInstance()}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),await this.updateTransactionToastsList(),await this.updateCustomToastList(),await this.subscribeToEventBusNotifications(),this.storeToastsSubscription=this.store.subscribe(async({toasts:s,transactions:o},{toasts:i,transactions:n})=>{(!W(i.transactionToasts,s.transactionToasts)||!W(n,o))&&await this.updateTransactionToastsList(),W(i.customToasts,s.customToasts)||await this.updateCustomToastList()})}static getInstance(){return e.instance||(e.instance=new e),e.instance}handleCompletedTransaction(t){let{transactions:s}=this.store.getState(),o=s[t];if(!o)return!1;let{status:i}=o,n=at(i),a=nt(i),c=it(i),r=a||c||n;return r?(this.successfulToastLifetime&&this.lifetimeManager.start(t),r):(this.lifetimeManager.stop(t),r)}async createTransactionToast(t,s){let o=Nt({toastId:t,totalDuration:s});return this.handleCompletedTransaction(t),await this.updateTransactionToastsList(),o}createCustomToast(t){let s=M(t);return this.updateCustomToastList(),s}async updateTransactionToastsList(){let{toasts:t,transactions:s,account:o}=this.store.getState(),{pendingTransactionToasts:i,completedTransactionToasts:n}=await b({toastList:t,transactionsSessions:s,account:o});this.transactionToasts=[...i,...n];for(let a of t.transactionToasts)this.handleCompletedTransaction(a.toastId);await this.publishTransactionToasts()}async updateCustomToastList(){let{toasts:t}=this.store.getState();this.customToasts=[];for(let s of t.customToasts){let i="message"in s?{...s}:{...s,instantiateToastElement:F[s.toastId]};this.customToasts.push(i),s.duration&&this.lifetimeManager.startWithCustomDuration(s.toastId,s.duration)}this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",this.customToasts)}async createToastListElement(){return this.toastsElement?this.toastsElement:(this.isCreatingElement||(this.isCreatingElement=!0,this.toastsElement=await ct.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}handleTransactionToastClose(t){this.handleCompletedTransaction(t)&&k(t)}async subscribeToEventBusNotifications(){let t=await this.createToastListElement();if(t){if(this.eventBus=await t.getEventBus(),!this.eventBus)throw new Error("eventBus is not initialized");this.eventBus.subscribe("CLOSE_TOAST",this.handleCloseToast.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("CLOSE_TOAST",this.handleCloseToast.bind(this))}),this.eventBus.subscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this))})}}async showToasts(){this.eventBus?.publish("SHOW_TOAST_LIST",null),await this.updateCustomToastList(),await this.updateTransactionToastsList()}hideToasts(){this.eventBus?.publish("HIDE_TOAST_LIST",null)}async handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}handleCloseToast(t){if(this.customToasts.find(o=>o.toastId===t)){this.lifetimeManager.stop(t);let o=T[t];o?.(),P(t);return}this.handleTransactionToastClose(t)}async publishTransactionToasts(){if(this.notificationsFeedManager.isNotificationsFeedOpen()&&this.eventBus){this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts),this.hideToasts();return}if(!this.eventBus){let t=await this.createToastListElement();if(!t)return;this.eventBus=await t.getEventBus()}this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts)}destroy(){this.storeToastsSubscription(),this.lifetimeManager?.destroy(),this.notificationsFeedManager?.destroy(),xt(),this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[]}};export{x as a,F as b,T as c,_t as d,P as e,xt as f,zo as g,Nt as h,k as i,M as j,D as k,p as l,N as m,B as n,bt as o,_ as p,Ct as q,O as r,wt as s,h as t,St as u};
2
- //# sourceMappingURL=chunk-H3EGIL75.mjs.map
1
+ import{a as et}from"./chunk-BAX6BDHT.mjs";import{a as mt}from"./chunk-6UZHM5LW.mjs";import{a as b}from"./chunk-AE67HPX7.mjs";import{a as pt}from"./chunk-3XWVDTZU.mjs";import{a as w}from"./chunk-5UEXMF4C.mjs";import{a as Z,b as tt,g as st,l as ot}from"./chunk-CAA4VJRH.mjs";import{a as gt}from"./chunk-UBDGFC5C.mjs";import{b as S}from"./chunk-GYKFRG4G.mjs";import{a as dt}from"./chunk-5QYT3EHL.mjs";import{a as It}from"./chunk-4ODPAHHA.mjs";import{a as ht}from"./chunk-MDVI45IV.mjs";import{a as ft}from"./chunk-DWJNMLII.mjs";import{a as f}from"./chunk-4NCS6I7W.mjs";import{a as X}from"./chunk-XF4GSZXO.mjs";import{a as ut}from"./chunk-ITZYC6JK.mjs";import{a as L}from"./chunk-Q4K3273X.mjs";import{a as C,f as lt}from"./chunk-427U5CPN.mjs";import{b as Tt}from"./chunk-X66WRHHQ.mjs";import{d as rt}from"./chunk-SKGX7AQR.mjs";import{k as it,l as nt,n as at}from"./chunk-65L5EBBL.mjs";import{a as A}from"./chunk-HORSXVIV.mjs";import{a as vt}from"./chunk-DSA7OV2X.mjs";import{a as Q}from"./chunk-EFPESRFQ.mjs";import{a as E}from"./chunk-QTKK6OSJ.mjs";import{a as J}from"./chunk-6ACLOUQ3.mjs";import{a as y}from"./chunk-6FXEHNGW.mjs";import{a as yt}from"./chunk-NJN53MJV.mjs";import{a as j}from"./chunk-YSCND2MX.mjs";import{a as V,b as q,s as u,u as Y}from"./chunk-Z2ZFJH7M.mjs";import{c as H,f as $}from"./chunk-UERJ6AKK.mjs";import{b as g}from"./chunk-VNLGNNIL.mjs";import{b as v}from"./chunk-6JM4DPOH.mjs";import{b as G,c as K,f as z}from"./chunk-NTEMINYA.mjs";import{b as Et}from"./chunk-76URRONH.mjs";import{a as ct}from"./chunk-IHIBTL4N.mjs";import{a as I}from"./chunk-PLUWBWJ2.mjs";import W from"lodash.isequal";import Lt from"lodash.isequal";var Ft="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",x=class e extends ut{constructor(){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.store=u();this.initialData={pendingTransactions:[],historicTransactions:[]};this.closeUI=async()=>{this.data.pendingTransactions.length>0?(this.unsubscribeFunctions.forEach(s=>s.forEach(o=>o())),this.unsubscribeFunctions.clear(),await this.uiElement?.closeWithAnimation()):super.closeUI()};this.data={...this.initialData}}static getInstance(){return e.instance||(e.instance=new e),e.instance}isNotificationsFeedOpen(){return this.isOpen}async openNotificationsFeed(){p.getInstance().hideToasts(),await this.openUI(),await this.updateDataAndNotifications();let o=this.store.subscribe(async({toasts:i,transactions:n},{toasts:a,transactions:c})=>{(!Lt(a.transactionToasts,i.transactionToasts)||!Lt(c,n))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Ft,[o]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}async handleCloseUI(){let s=p.getInstance();await this.closeUI(),await s.showToasts()}async setupEventListeners(){this.eventBus&&(this.subscribeToEventBus("CLOSE_NOTIFICATIONS_FEED",this.handleCloseUI.bind(this)),this.subscribeToEventBus("CLEAR_NOTIFICATIONS_FEED_HISTORY",this.handleClearNotificationsFeedHistory.bind(this)))}async updateDataAndNotifications(){let{transactions:s,account:o,toasts:i,network:n}=this.store.getState(),{pendingTransactionToasts:a}=await b({toastList:i,transactionsSessions:s,account:o});this.data.pendingTransactions=a,this.data.historicTransactions=await et.getTransactionsHistory({transactionsSessions:s,address:o.address,explorerAddress:n.network.explorerAddress,egldLabel:n.network.egldLabel}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){rt(),this.resetData(),this.updateNotificationsFeed()}async updateNotificationsFeed(){this.eventBus&&(this.eventBus.publish("PENDING_TRANSACTIONS_UPDATE",this.data.pendingTransactions),this.eventBus.publish("TRANSACTIONS_HISTORY_UPDATE",this.data.historicTransactions))}};import R from"bignumber.js";var N=class e{constructor(){this.store=u();this.warningLogoutTimeoutRef=null;this.actualLogoutTimeoutRef=null;this.plannedLogoutTimeoutRef=null;this.plannedLogoutKey=null;this.init=async()=>{if(!this.shouldStart())return;let t=this.store.getState(),s=g(t),{isExpired:o}=E(s?.nativeAuthToken);o?h().logout():this.addPlannedLogout()};this.stop=()=>{clearTimeout(this.warningLogoutTimeoutRef??0),clearTimeout(this.plannedLogoutTimeoutRef??0),clearTimeout(this.actualLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=null,this.plannedLogoutTimeoutRef=null,this.actualLogoutTimeoutRef=null,this.plannedLogoutKey=null};this.shouldStart=()=>{let t=this.store.getState(),s=g(t),o=$(t);return!!(s?.nativeAuthToken&&o)};this.addPlannedLogout=()=>{let t=h(),s=H(this.store.getState()),o=t.getType()===I.webview;if(!s||o)return;this.addLogoutWarning();let i=g(this.store.getState()),{secondsUntilExpires:n,expiresAt:a}=E(i?.nativeAuthToken),c=new R(String(n)),r=`${s}_${a}`,m=this.plannedLogoutKey===r;if(!(n&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=r,clearTimeout(this.plannedLogoutTimeoutRef??0);let d=c.times(1e3);this.actualLogoutTimeoutRef=setTimeout(()=>{p.getInstance().createCustomToast({toastId:"native-auth-logout",iconClassName:"warning",title:"Logging out",icon:"times",message:"Your session has expired!"}),this.actualLogoutTimeoutRef=null},d.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},d.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=v(this.store.getState()),s=g(this.store.getState()),{secondsUntilExpires:o}=E(s?.nativeAuthToken),i=new R(String(o)),n=i.times(1e3);if(!o||i.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new R(t?.tokenExpirationToastWarningSeconds??0).times(1e3),r=i.times(1e3).minus(c),m=mt(n.toNumber()),l=r.isLessThanOrEqualTo(0)?0:r.toNumber();clearTimeout(this.warningLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=setTimeout(()=>{p.getInstance().createCustomToast({toastId:"native-auth-expired",iconClassName:"warning",title:"Session Expiration Warning",icon:"hourglass",message:`Your session will expire in ${m}!`}),this.warningLogoutTimeoutRef=null},l)}}static getInstance(){return e.instance||(e.instance=new e),e.instance}};async function B({address:e,provider:t,apiAddress:s}){let o=await y({address:e,baseURL:s});if(!o)throw new Error("Account not found");Tt({address:e,providerType:t.getType()});let i={...o,username:A(o.username),nonce:L(o)};C(i),await S(e),w(),o.shard!=null&&await pt({shard:Number(o.shard),apiAddress:s})}async function kt(e){let{network:{apiAddress:t}}=f();await e.login();let s=await e.getAddress();if(!s)throw new Error("Address not found");return await B({address:s,provider:e,apiAddress:t}),{address:s}}async function Dt({provider:e,nativeAuthConfig:t,token:s}){let{network:{apiAddress:o}}=f(),i=Q(t),n=s;n||(n=await i.initialize({noCache:!0}));let{address:a,signature:c,...r}=await e.login({token:n});if(!a)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let l=J(r?.accessToken)?r.accessToken:i.getToken({address:a,token:n,signature:c});q({loginToken:n,signature:c,nativeAuthToken:l});let d=await dt({loginToken:n,extraInfoData:{multisig:r?.multisig,impersonate:r?.impersonate},address:a});return await B({address:d,provider:e,apiAddress:o}),{address:d,signature:c}}async function bt(e,t){let s=v(Y());if(s)return await Dt({provider:e,nativeAuthConfig:s,token:t?.token});let{address:o}=await kt(e);return await S(o),w(),{address:o}}var U={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${tt}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${Z}-${Date.now()}`}},Rt={extensionResponse:"Unable to sign transactions","Transaction canceled":"Transaction canceled","cancelled by user":"Transaction signing cancelled by user","denied by the user":"Transaction signing denied by the user"},Bt=e=>{for(let[t,s]of Object.entries(Rt))if(e.includes(t))return s;return"Error when signing"};function _(e,t="error"){let s=e?.message,o=Bt(s),n=o!=="Error when signing"?"warning":t,a=Object.keys(U).includes(n)?U[n]:U.error,{toastId:c,iconClassName:r,title:m}=a;return M({toastId:c,duration:1e4,icon:"times",iconClassName:r,message:o,title:m}),o}async function Ct({provider:e,transactions:t,options:s={}}){await St();let{isGuarded:o,activeGuardianAddress:i,nonce:n}=vt(),a=e.getType()===I.ledger,c=It({latestNonce:n,transactions:t}),r=i&&o&&!s.skipGuardian?c?.map(l=>(l.version=G.withTxOptions().valueOf(),l.options=z.withOptions({guarded:!0,...a?{hashSign:!0}:{}}).valueOf(),l.guardian=K.newFromBech32(i),l)):c,m=await e.signTransactions(r)??[];return lt(n+m.length),m}var O=class{constructor(t){this._isLoggingOut=!1;this.provider=t}init(){return this.provider.init()}async login(t){let s=await bt(this.provider,t);return V(this.provider.getType()),wt(this),N.getInstance().init(),s}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0}){if(this._isLoggingOut)return console.warn("Logout already in progress"),!1;this._isLoggingOut=!0;let s=await gt({provider:this.provider,options:t});return this._isLoggingOut=!1,s}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,s){try{return await Ct({provider:this.provider,transactions:t,options:s})}catch(o){let i=_(o);throw new Error(i)}}async signMessage(t,s){try{return await ft({provider:this.provider,message:t,options:s})}catch(o){let i=_(o,"warning");throw new Error(i)}}async verifyMessage(t){return await ht(t)}cancelLogin(){this.provider.cancelLogin?.()}};var At=null;function wt(e){At=e}function h(){return At||new O(Et)}var Ut=async()=>{try{let e=X(),{network:t}=f();try{let s=await y({address:e,baseURL:t.apiAddress});if(s!=null){let o={...s,username:A(s.username),nonce:L(s)};return C(o),o}}catch(s){console.error("Failed getting account ",s)}}catch(e){console.error("Failed getting address ",e)}return null};async function St(){let e=h();if(e==null)throw"Provider not initialized";try{if(!e.init)throw"Current provider does not have init() function";return await e.init()?Ut():void 0}catch(t){console.error("Failed initializing provider ",t)}}var F={},T={},_t=(e,t)=>{u().setState(({toasts:s})=>{let o=s.customToasts.length>0?Math.max(...s.customToasts.map(r=>parseInt(r.toastId.split("-").pop()??"0"))):0,i=t??`custom-toast-${o+1}`,n=s.customToasts.findIndex(r=>r.toastId===i),a={...e,toastId:i};if(n!==-1){s.customToasts[n]=a;return}s.customToasts.push({...a,toastId:i})},!1,"addCustomToast")},P=e=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(s=>s.toastId!==e)},!1,"removeCustomToast")},xt=()=>{u().setState(({toasts:e})=>{e.customToasts=[]},!1,"removeAllCustomToasts")},zo=()=>{u().setState(({toasts:e})=>{e.transactionToasts=[]})},Nt=({toastId:e,totalDuration:t})=>{let s="";return u().setState(({toasts:o})=>{let i=o.transactionToasts.length>0?Math.max(...o.transactionToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0;s=e??`transaction-toast-${i+1}`,o.transactionToasts.push({startTime:j(),endTime:yt(t),toastId:s})},!1,"addTransactionToast"),s},k=e=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(s=>s.toastId!==e)},!1,"removeTransactionToast"),delete T[e],delete F[e]},M=e=>{let{toasts:t}=u().getState(),s=t.customToasts.length>0?Math.max(...t.customToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0,o=e.toastId||`custom-toast-${s+1}`;return e.onClose&&(T[o]=e.onClose),e.instantiateToastElement?(F[o]=e.instantiateToastElement,u().setState(({toasts:i})=>{let n=i.customToasts.findIndex(r=>r.toastId===o),a={...e,instantiateToastElement:null,toastId:o};n!==-1?i.customToasts[n]=a:i.customToasts.push(a)},!1,"createCustomToast"),o):(_t(e,o),o)};var Mt=1e4,D=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=Mt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let s=setTimeout(()=>{k(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,s)};this.startWithCustomDuration=(t,s)=>{if(this.stop(t),s<=0)return;let o=setTimeout(()=>{P(t);let i=T[t];i?.()},s);this.timeoutIntervals.set(t,o)};this.stop=t=>{let s=this.timeoutIntervals.get(t);s&&(clearTimeout(s),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t||Mt}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};var p=class e{constructor(){this.isCreatingElement=!1;this.toastsElement=null;this.transactionToasts=[];this.customToasts=[];this.storeToastsSubscription=()=>null;this.eventBusUnsubscribeFunctions=[];this.eventBus=null;this.store=u();this.destroy(),this.lifetimeManager=new D,this.notificationsFeedManager=x.getInstance()}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),await this.updateTransactionToastsList(),await this.updateCustomToastList(),await this.subscribeToEventBusNotifications(),this.storeToastsSubscription=this.store.subscribe(async({toasts:s,transactions:o},{toasts:i,transactions:n})=>{(!W(i.transactionToasts,s.transactionToasts)||!W(n,o))&&await this.updateTransactionToastsList(),W(i.customToasts,s.customToasts)||await this.updateCustomToastList()})}static getInstance(){return e.instance||(e.instance=new e),e.instance}handleCompletedTransaction(t){let{transactions:s}=this.store.getState(),o=s[t];if(!o)return!1;let{status:i}=o,n=at(i),a=nt(i),c=it(i),r=a||c||n;return r?(this.successfulToastLifetime&&this.lifetimeManager.start(t),r):(this.lifetimeManager.stop(t),r)}async createTransactionToast(t,s){let o=Nt({toastId:t,totalDuration:s});return this.handleCompletedTransaction(t),await this.updateTransactionToastsList(),o}createCustomToast(t){let s=M(t);return this.updateCustomToastList(),s}async updateTransactionToastsList(){let{toasts:t,transactions:s,account:o}=this.store.getState(),{pendingTransactionToasts:i,completedTransactionToasts:n}=await b({toastList:t,transactionsSessions:s,account:o});this.transactionToasts=[...i,...n];for(let a of t.transactionToasts)this.handleCompletedTransaction(a.toastId);await this.publishTransactionToasts()}async updateCustomToastList(){let{toasts:t}=this.store.getState();this.customToasts=[];for(let s of t.customToasts){let i="message"in s?{...s}:{...s,instantiateToastElement:F[s.toastId]};this.customToasts.push(i),s.duration&&this.lifetimeManager.startWithCustomDuration(s.toastId,s.duration)}this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",this.customToasts)}async createToastListElement(){return this.toastsElement?this.toastsElement:(this.isCreatingElement||(this.isCreatingElement=!0,this.toastsElement=await ct.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}handleTransactionToastClose(t){this.handleCompletedTransaction(t)&&k(t)}async subscribeToEventBusNotifications(){let t=await this.createToastListElement();if(t){if(this.eventBus=await t.getEventBus(),!this.eventBus)throw new Error("eventBus is not initialized");this.eventBus.subscribe("CLOSE_TOAST",this.handleCloseToast.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("CLOSE_TOAST",this.handleCloseToast.bind(this))}),this.eventBus.subscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this))})}}async showToasts(){this.eventBus?.publish("SHOW_TOAST_LIST",null),await this.updateCustomToastList(),await this.updateTransactionToastsList()}hideToasts(){this.eventBus?.publish("HIDE_TOAST_LIST",null)}async handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}handleCloseToast(t){if(this.customToasts.find(o=>o.toastId===t)){this.lifetimeManager.stop(t);let o=T[t];o?.(),P(t);return}this.handleTransactionToastClose(t)}async publishTransactionToasts(){if(this.notificationsFeedManager.isNotificationsFeedOpen()&&this.eventBus){this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts),this.hideToasts();return}if(!this.eventBus){let t=await this.createToastListElement();if(!t)return;this.eventBus=await t.getEventBus()}this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts)}destroy(){this.storeToastsSubscription(),this.lifetimeManager?.destroy(),this.notificationsFeedManager?.destroy(),xt(),this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[]}};export{x as a,F as b,T as c,_t as d,P as e,xt as f,zo as g,Nt as h,k as i,M as j,D as k,p as l,N as m,B as n,bt as o,_ as p,Ct as q,O as r,wt as s,h as t,St as u};
2
+ //# sourceMappingURL=chunk-HP2XWN3H.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-4TBVQD27.mjs";import{s as n}from"./chunk-YOJAS3PK.mjs";var c=t=>n().setState(({config:e})=>{e.nativeAuthConfig=t},!1,"setNativeAuthConfig"),C=t=>n().setState(({config:e})=>{e.websocketStatus=t},!1,"setWebsocketStatus"),f=t=>n().setState(({config:e})=>{let a=t.walletConnectV2RelayAddress||o.walletConnectV2RelayAddress,s=t.walletConnectDeepLink||o.walletConnectDeepLink;e.walletConnectConfig={...t,walletConnectDeepLink:s,walletConnectV2RelayAddress:a}},!1,"setWalletConnectConfig");export{c as a,C as b,f as c};
2
- //# sourceMappingURL=chunk-UJDX67YT.mjs.map
1
+ import{a as o}from"./chunk-4TBVQD27.mjs";import{s as n}from"./chunk-Z2ZFJH7M.mjs";var c=t=>n().setState(({config:e})=>{e.nativeAuthConfig=t},!1,"setNativeAuthConfig"),C=t=>n().setState(({config:e})=>{e.websocketStatus=t},!1,"setWebsocketStatus"),f=t=>n().setState(({config:e})=>{let a=t.walletConnectV2RelayAddress||o.walletConnectV2RelayAddress,s=t.walletConnectDeepLink||o.walletConnectDeepLink;e.walletConnectConfig={...t,walletConnectDeepLink:s,walletConnectV2RelayAddress:a}},!1,"setWalletConnectConfig");export{c as a,C as b,f as c};
2
+ //# sourceMappingURL=chunk-IB4WJ3BB.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-MONQ4RXB.mjs";var n=class{static get create(){return this.createComponent}static set create(e){this.createComponent=e}};n.createComponent=async({name:e,anchor:m})=>{if(!t?.customElements?.get(e))return null;let o=t.document.createElement(e);return(m||t.document.body).appendChild(o),await customElements.whenDefined(e),o};export{n as a};
2
- //# sourceMappingURL=chunk-TYN5TMRZ.mjs.map
1
+ import{a as t}from"./chunk-5JCA5OZE.mjs";var n=class{static get create(){return this.createComponent}static set create(e){this.createComponent=e}};n.createComponent=async({name:e,anchor:m})=>{if(!t?.customElements?.get(e))return null;let o=t.document.createElement(e);return(m||t.document.body).appendChild(o),await customElements.whenDefined(e),o};export{n as a};
2
+ //# sourceMappingURL=chunk-IHIBTL4N.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-NBZUJ5VZ.mjs";import{a as t}from"./chunk-KXH4SFJV.mjs";var s=class extends n{constructor({uiDataUpdateEvent:e,uiTag:i}){super({uiDataUpdateEvent:e,uiTag:i});this.isOpen=!1;this.data=this.getInitialData()}async openUI(){this.isOpen&&this.uiElement||(await super.init(),this.setIsSidePanelOpen(!0))}async destroy(){this.setIsSidePanelOpen(!1),await this.uiElement?.closeWithAnimation?.(),super.destroy()}closeUI(){this.resetData(),this.destroy()}setIsSidePanelOpen(e){this.isOpen=e,t(e)}};export{s as a};
2
- //# sourceMappingURL=chunk-T26S2V72.mjs.map
1
+ import{a as n}from"./chunk-DQZXAQEQ.mjs";import{a as t}from"./chunk-RZIJVETL.mjs";var s=class extends n{constructor({uiDataUpdateEvent:e,uiTag:i}){super({uiDataUpdateEvent:e,uiTag:i});this.isOpen=!1;this.data=this.getInitialData()}async openUI(){this.isOpen&&this.uiElement||(await super.init(),this.setIsSidePanelOpen(!0))}async destroy(){this.setIsSidePanelOpen(!1),await this.uiElement?.closeWithAnimation?.(),super.destroy()}closeUI(){this.resetData(),this.destroy()}setIsSidePanelOpen(e){this.isOpen=e,t(e)}};export{s as a};
2
+ //# sourceMappingURL=chunk-ITZYC6JK.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-FNMPZS4S.mjs";import{a as f}from"./chunk-FRDR4A7Z.mjs";import{t as c}from"./chunk-H3EGIL75.mjs";import{u as n}from"./chunk-YOJAS3PK.mjs";import{g as a}from"./chunk-UERJ6AKK.mjs";import{e as l}from"./chunk-VNLGNNIL.mjs";import{HWProvider as m}from"@multiversx/sdk-hw-provider";async function A(u){let v=g(),d=u?.shouldInitProvider||!v,o=l(n()),t=a(n()),r=c(),i=new m,I=async()=>{let e=o?.index!=null;if(r instanceof m&&r.isInitialized())return e&&await r.setAddressIndex(o.index),r;if(d&&!await i.init())throw new Error("Failed to initialize Ledger Provider");return e&&await i.setAddressIndex(o.index),i};try{if(!d&&t)return{ledgerProvider:i,ledgerConfig:{version:t.version,dataEnabled:t.hasContractDataEnabled}};let e=await I(),s=await f(e);return{ledgerProvider:e,ledgerConfig:s}}catch(e){throw console.error("Could not initialize ledger app",e),e}}export{A as a};
2
- //# sourceMappingURL=chunk-SVXVYH6P.mjs.map
1
+ import{a as g}from"./chunk-O5DNWY4U.mjs";import{a as f}from"./chunk-FRDR4A7Z.mjs";import{t as c}from"./chunk-HP2XWN3H.mjs";import{u as n}from"./chunk-Z2ZFJH7M.mjs";import{g as a}from"./chunk-UERJ6AKK.mjs";import{e as l}from"./chunk-VNLGNNIL.mjs";import{HWProvider as m}from"@multiversx/sdk-hw-provider";async function A(u){let v=g(),d=u?.shouldInitProvider||!v,o=l(n()),t=a(n()),r=c(),i=new m,I=async()=>{let e=o?.index!=null;if(r instanceof m&&r.isInitialized())return e&&await r.setAddressIndex(o.index),r;if(d&&!await i.init())throw new Error("Failed to initialize Ledger Provider");return e&&await i.setAddressIndex(o.index),i};try{if(!d&&t)return{ledgerProvider:i,ledgerConfig:{version:t.version,dataEnabled:t.hasContractDataEnabled}};let e=await I(),s=await f(e);return{ledgerProvider:e,ledgerConfig:s}}catch(e){throw console.error("Could not initialize ledger app",e),e}}export{A as a};
2
+ //# sourceMappingURL=chunk-J2PJZYN7.mjs.map