@multiversx/sdk-dapp 5.0.0-alpha.15 → 5.0.0-alpha.17
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.
- package/out/__chunks__/{chunk-CRHPVNRL.mjs → chunk-2R3GW4DI.mjs} +2 -2
- package/out/__chunks__/{chunk-4USFY3DC.mjs → chunk-2RTSC7PZ.mjs} +2 -2
- package/out/__chunks__/{chunk-33V2XBND.mjs → chunk-3T632N3C.mjs} +2 -2
- package/out/__chunks__/{chunk-5MDDPC5M.mjs → chunk-3XRUVLQ2.mjs} +2 -2
- package/out/__chunks__/chunk-45VUJAFY.mjs +2 -0
- package/out/__chunks__/chunk-4IUSIUL5.mjs +2 -0
- package/out/__chunks__/{chunk-SZHXVDHF.mjs → chunk-4P67TGYO.mjs} +2 -2
- package/out/__chunks__/{chunk-I2XLXOU2.mjs → chunk-4ZRZMRUQ.mjs} +2 -2
- package/out/__chunks__/{chunk-LJ5JGAYL.mjs → chunk-5DP2QBUG.mjs} +2 -2
- package/out/__chunks__/{chunk-EO6CD6VO.mjs → chunk-6BE7ZR56.mjs} +2 -2
- package/out/__chunks__/chunk-6HNXEUEX.mjs +2 -0
- package/out/__chunks__/chunk-6HNXEUEX.mjs.map +7 -0
- package/out/__chunks__/{chunk-JMXZ4XDT.mjs → chunk-A5AK7XRL.mjs} +2 -2
- package/out/__chunks__/{chunk-TEYO3CV4.mjs → chunk-ARULSK25.mjs} +2 -2
- package/out/__chunks__/{chunk-RLVN434K.mjs → chunk-ATH4WYTD.mjs} +2 -2
- package/out/__chunks__/{chunk-3OKWBJFM.mjs → chunk-B2RDSGON.mjs} +2 -2
- package/out/__chunks__/{chunk-YIWTWMQF.mjs → chunk-B5IYIF42.mjs} +2 -2
- package/out/__chunks__/{chunk-7H2PZVSJ.mjs → chunk-BDKYHP5K.mjs} +2 -2
- package/out/__chunks__/{chunk-532QQEN4.mjs → chunk-BEKALCDX.mjs} +2 -2
- package/out/__chunks__/{chunk-YMSRWWNA.mjs → chunk-BR4N3QPJ.mjs} +2 -2
- package/out/__chunks__/{chunk-R6QXUFY4.mjs → chunk-C23YOFAN.mjs} +2 -2
- package/out/__chunks__/{chunk-GFK4E7GU.mjs → chunk-C2LIMWMH.mjs} +2 -2
- package/out/__chunks__/chunk-C7N7SMQU.mjs +2 -0
- package/out/__chunks__/chunk-CA2JFJCS.mjs +2 -0
- package/out/__chunks__/{chunk-BHXGUN5H.mjs.map → chunk-CA2JFJCS.mjs.map} +1 -1
- package/out/__chunks__/{chunk-JYZ5XXJG.mjs → chunk-CA5AC6SG.mjs} +2 -2
- package/out/__chunks__/{chunk-GRD5MWEG.mjs → chunk-CC3JG6SH.mjs} +2 -2
- package/out/__chunks__/{chunk-I2BU6ZOQ.mjs → chunk-D7SNMDI5.mjs} +2 -2
- package/out/__chunks__/chunk-DJMZEN3G.mjs +2 -0
- package/out/__chunks__/chunk-DQTYHRUO.mjs +2 -0
- package/out/__chunks__/{chunk-7RFUEHZX.mjs → chunk-EVP54VPS.mjs} +2 -2
- package/out/__chunks__/{chunk-MH42KJTU.mjs → chunk-F6Y3GEEQ.mjs} +2 -2
- package/out/__chunks__/{chunk-RG72LHS3.mjs → chunk-F6Y3SXC4.mjs} +2 -2
- package/out/__chunks__/chunk-HKYS3MAS.mjs +2 -0
- package/out/__chunks__/{chunk-BTXVE2KE.mjs → chunk-HM5GQ2WF.mjs} +2 -2
- package/out/__chunks__/{chunk-Z6VA2J3J.mjs → chunk-HT5DZIND.mjs} +2 -2
- package/out/__chunks__/{chunk-OYY5ZF7L.mjs → chunk-HT5S5AYG.mjs} +2 -2
- package/out/__chunks__/chunk-HXHKPIMW.mjs +2 -0
- package/out/__chunks__/{chunk-IQVVCXXL.mjs → chunk-IHOOASQ4.mjs} +2 -2
- package/out/__chunks__/{chunk-4MNCFSUO.mjs → chunk-IIBVDR56.mjs} +2 -2
- package/out/__chunks__/{chunk-MAK5NFYN.mjs → chunk-IXAT2U5R.mjs} +2 -2
- package/out/__chunks__/chunk-IXBOK5RG.mjs +2 -0
- package/out/__chunks__/chunk-J6CUEKO2.mjs +2 -0
- package/out/__chunks__/{chunk-F4W3N3JZ.mjs → chunk-JJFKKKLP.mjs} +2 -2
- package/out/__chunks__/{chunk-F4WQOPSX.mjs → chunk-JPJXXLTL.mjs} +2 -2
- package/out/__chunks__/{chunk-MXLRZPMK.mjs → chunk-JXUTUO6K.mjs} +2 -2
- package/out/__chunks__/{chunk-JJ2NEPU5.mjs → chunk-KJT6AKOF.mjs} +2 -2
- package/out/__chunks__/{chunk-ODIVUD2L.mjs → chunk-KUBMPJIS.mjs} +2 -2
- package/out/__chunks__/{chunk-PTLBE2H2.mjs → chunk-LOKAGN2M.mjs} +2 -2
- package/out/__chunks__/{chunk-PTLBE2H2.mjs.map → chunk-LOKAGN2M.mjs.map} +2 -2
- package/out/__chunks__/chunk-LUIDT6E6.mjs +2 -0
- package/out/__chunks__/chunk-LUIDT6E6.mjs.map +7 -0
- package/out/__chunks__/chunk-MAGQLOT2.mjs +2 -0
- package/out/__chunks__/{chunk-QZ27VHW6.mjs → chunk-MAQPZJET.mjs} +2 -2
- package/out/__chunks__/{chunk-O67WFDS3.mjs → chunk-MKKFM4TT.mjs} +2 -2
- package/out/__chunks__/{chunk-KNRIU7GR.mjs → chunk-MKYZXRIA.mjs} +2 -2
- package/out/__chunks__/{chunk-C3F3EPNZ.mjs → chunk-NSSJOXSU.mjs} +2 -2
- package/out/__chunks__/{chunk-RCRWI3XT.mjs → chunk-OXU2ZOST.mjs} +2 -2
- package/out/__chunks__/{chunk-AI7LYKBU.mjs → chunk-PKIAC4UI.mjs} +2 -2
- package/out/__chunks__/{chunk-CBH7E57H.mjs → chunk-PZJGJAWU.mjs} +2 -2
- package/out/__chunks__/{chunk-VML7BRY5.mjs → chunk-Q3DOWDRB.mjs} +2 -2
- package/out/__chunks__/{chunk-PH2YVVEA.mjs → chunk-QHLQKNEW.mjs} +2 -2
- package/out/__chunks__/chunk-QJGFIK7H.mjs +2 -0
- package/out/__chunks__/chunk-QJGFIK7H.mjs.map +7 -0
- package/out/__chunks__/{chunk-MYCXIA5W.mjs → chunk-QRLEYILE.mjs} +2 -2
- package/out/__chunks__/{chunk-CUABBK2P.mjs → chunk-QVIO2WRO.mjs} +2 -2
- package/out/__chunks__/{chunk-AZGVI4QW.mjs → chunk-RAG4YNTC.mjs} +2 -2
- package/out/__chunks__/{chunk-ES6E2HM6.mjs → chunk-RHOHTVC7.mjs} +2 -2
- package/out/__chunks__/{chunk-MUYF2CWM.mjs → chunk-RPLCGVHU.mjs} +2 -2
- package/out/__chunks__/{chunk-QCJMV6NU.mjs → chunk-RVW2IVLQ.mjs} +2 -2
- package/out/__chunks__/chunk-SBFDOVKK.mjs +2 -0
- package/out/__chunks__/{chunk-SLBB2BEP.mjs → chunk-SL7W4MV6.mjs} +2 -2
- package/out/__chunks__/{chunk-RPBH7EFR.mjs → chunk-T227HNYP.mjs} +2 -2
- package/out/__chunks__/{chunk-T5GA3FRJ.mjs → chunk-TR4XGBZR.mjs} +2 -2
- package/out/__chunks__/{chunk-TDUKMRJX.mjs → chunk-TTFKQZLJ.mjs} +2 -2
- package/out/__chunks__/{chunk-SPSO2A53.mjs → chunk-U64LDJTG.mjs} +2 -2
- package/out/__chunks__/chunk-V6JLSLC4.mjs +2 -0
- package/out/__chunks__/chunk-V6STR476.mjs +2 -0
- package/out/__chunks__/{chunk-Y4OUAJSG.mjs → chunk-VJAAWEHK.mjs} +2 -2
- package/out/__chunks__/chunk-VKBWECUS.mjs +2 -0
- package/out/__chunks__/chunk-VKBWECUS.mjs.map +7 -0
- package/out/__chunks__/{chunk-GZTGHNVI.mjs → chunk-VOS5UP5O.mjs} +2 -2
- package/out/__chunks__/{chunk-AZ2KOM5R.mjs → chunk-WCOPQ7L7.mjs} +2 -2
- package/out/__chunks__/chunk-WWY2ESAK.mjs +2 -0
- package/out/__chunks__/{chunk-SFZJXI7K.mjs → chunk-X4URPB2S.mjs} +2 -2
- package/out/__chunks__/chunk-XGR6W4AU.mjs +2 -0
- package/out/__chunks__/{chunk-EBQZQA2Q.mjs → chunk-XU5ALACG.mjs} +2 -2
- package/out/__chunks__/{chunk-PLO67H6R.mjs → chunk-ZEYTUYGU.mjs} +2 -2
- package/out/__chunks__/chunk-ZGXYSDXQ.mjs +2 -0
- package/out/__chunks__/chunk-ZJQDEYHR.mjs +2 -0
- package/out/__chunks__/{chunk-LV2BL56O.mjs → chunk-ZVOPHS4O.mjs} +2 -2
- package/out/__chunks__/{chunk-3U6H4VPO.mjs → chunk-ZZC5SQOQ.mjs} +2 -2
- package/out/__mocks__/data/index.mjs +1 -1
- package/out/__mocks__/index.mjs +1 -1
- package/out/__mocks__/server.mjs +1 -1
- package/out/__mocks__/utils/index.mjs +1 -1
- package/out/apiCalls/account/getScamAddressData.mjs +1 -1
- package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
- package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
- package/out/apiCalls/index.mjs +1 -1
- package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/index.mjs +1 -1
- package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
- package/out/constants/browser.constants.mjs +1 -1
- package/out/constants/index.mjs +1 -1
- package/out/constants/storage.constants.mjs +1 -1
- package/out/constants/window.constants.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
- package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
- package/out/controllers/TransactionsTableController/index.mjs +1 -1
- package/out/index.mjs +1 -1
- package/out/lib/sdkWebWalletCrossWindowProvider.d.ts +2 -0
- package/out/lib/sdkWebWalletCrossWindowProvider.js +4 -1
- package/out/lib/sdkWebWalletCrossWindowProvider.js.map +1 -1
- package/out/lib/sdkWebWalletCrossWindowProvider.mjs +1 -1
- package/out/managers/LogoutManager/LogoutManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/index.mjs +1 -1
- package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
- package/out/managers/TransactionManager/index.mjs +1 -1
- package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
- package/out/managers/UnlockPanelManager/index.mjs +1 -1
- package/out/managers/index.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
- package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
- package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/ToastManager/ToastManager.mjs +1 -1
- package/out/managers/internal/ToastManager/helpers/LifetimeManager.mjs +1 -1
- package/out/managers/internal/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
- package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
- package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.mjs +1 -1
- package/out/managers/internal/WalletConnectStateManager/index.mjs +1 -1
- package/out/managers/internal/index.mjs +1 -1
- package/out/methods/account/getAccount.mjs +1 -1
- package/out/methods/account/getAccountInfo.mjs +1 -1
- package/out/methods/account/getAddress.mjs +1 -1
- package/out/methods/account/getIsLoggedIn.mjs +1 -1
- package/out/methods/account/getLatestNonce.mjs +1 -1
- package/out/methods/initApp/gastStationMetadata/setGasStationMetadata.mjs +1 -1
- package/out/methods/initApp/initApp.mjs +1 -1
- package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
- package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
- package/out/methods/loginInfo/getLoginInfo.mjs +1 -1
- package/out/methods/network/getEgldLabel.mjs +1 -1
- package/out/methods/network/getExplorerAddress.mjs +1 -1
- package/out/methods/network/getNetworkConfig.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/index.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/manageFailedTransactions.mjs +1 -1
- package/out/methods/trackTransactions/helpers/getPollingInterval.mjs +1 -1
- package/out/methods/trackTransactions/trackTransactions.mjs +1 -1
- package/out/methods/transactions/getFailedTransactions.mjs +1 -1
- package/out/methods/transactions/getFailedTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getSuccessfulTransactions.mjs +1 -1
- package/out/methods/transactions/getSuccessfulTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getTransactionSessions.mjs +1 -1
- package/out/providers/DappProvider/DappProvider.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/extractAddressFromToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getAccountFromToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getModifiedLoginToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
- package/out/providers/DappProvider/helpers/logout/logout.mjs +1 -1
- package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
- package/out/providers/DappProvider/helpers/signMessage/signMessageWithProvider.mjs +1 -1
- package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
- package/out/providers/DappProvider/index.mjs +1 -1
- package/out/providers/ProviderFactory.mjs +1 -1
- package/out/providers/helpers/accountProvider.mjs +1 -1
- package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
- package/out/providers/helpers/clearInitiatedLogins.mjs +1 -1
- package/out/providers/helpers/restoreProvider.js +6 -3
- package/out/providers/helpers/restoreProvider.js.map +1 -1
- package/out/providers/helpers/restoreProvider.mjs +1 -1
- package/out/providers/index.mjs +1 -1
- package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
- package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
- package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.d.ts +20 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.js +147 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.js.map +1 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs +2 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs.map +7 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.d.ts +1 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.js +18 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.js.map +1 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs +2 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs.map +7 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/tests/webview.test.js +20 -17
- package/out/providers/strategies/WebviewProviderStrategy/tests/webview.test.js.map +1 -1
- package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
- package/out/providers/strategies/helpers/index.mjs +1 -1
- package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.js +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.js.map +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/tests/getCommonData.test.js +6 -6
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/tests/getCommonData.test.js.map +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/getCrossWindowProvider.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/signTransactions.js +27 -20
- package/out/providers/strategies/helpers/signTransactions/signTransactions.js.map +1 -1
- package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
- package/out/providers/strategies/index.mjs +1 -1
- package/out/react/account/useGetAccount.mjs +1 -1
- package/out/react/account/useGetAccountInfo.mjs +1 -1
- package/out/react/account/useGetIsLoggedIn.mjs +1 -1
- package/out/react/account/useGetLatestNonce.mjs +1 -1
- package/out/react/index.mjs +1 -1
- package/out/react/loginInfo/useGetLoginInfo.mjs +1 -1
- package/out/react/network/useGetNetworkConfig.mjs +1 -1
- package/out/react/store/getReactStore.mjs +1 -1
- package/out/react/store/useSelector.mjs +1 -1
- package/out/react/transactions/useGetFailedTransactions.mjs +1 -1
- package/out/react/transactions/useGetFailedTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetPendingTransactions.mjs +1 -1
- package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetSuccessfulTransactions.mjs +1 -1
- package/out/react/transactions/useGetSuccessfulTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetTransactionSessions.mjs +1 -1
- package/out/services/index.mjs +1 -1
- package/out/services/nativeAuth/index.mjs +1 -1
- package/out/services/nativeAuth/methods/buildNativeAuthConfig.mjs +1 -1
- package/out/services/nativeAuth/methods/getDefaultNativeAuthConfig.mjs +1 -1
- package/out/services/nativeAuth/methods/index.mjs +1 -1
- package/out/services/nativeAuth/nativeAuth.mjs +1 -1
- package/out/store/actions/account/accountActions.mjs +1 -1
- package/out/store/actions/account/index.mjs +1 -1
- package/out/store/actions/cache/cacheActions.mjs +1 -1
- package/out/store/actions/cache/index.mjs +1 -1
- package/out/store/actions/config/configActions.mjs +1 -1
- package/out/store/actions/config/index.mjs +1 -1
- package/out/store/actions/index.mjs +1 -1
- package/out/store/actions/loginInfo/loginInfoActions.mjs +1 -1
- package/out/store/actions/network/index.mjs +1 -1
- package/out/store/actions/network/initializeNetwork.mjs +1 -1
- package/out/store/actions/network/networkActions.mjs +1 -1
- package/out/store/actions/sharedActions/index.mjs +1 -1
- package/out/store/actions/sharedActions/sharedActions.mjs +1 -1
- package/out/store/actions/toasts/index.mjs +1 -1
- package/out/store/actions/toasts/toastsActions.mjs +1 -1
- package/out/store/actions/transactions/transactionsActions.mjs +1 -1
- package/out/store/actions/ui/index.mjs +1 -1
- package/out/store/actions/ui/uiActions.mjs +1 -1
- package/out/store/middleware/applyMiddlewares.mjs +1 -1
- package/out/store/middleware/index.mjs +1 -1
- package/out/store/middleware/logoutMiddleware.mjs +1 -1
- package/out/store/storage/index.mjs +1 -1
- package/out/store/storage/storageCallback.mjs +1 -1
- package/out/store/store.mjs +1 -1
- package/out/utils/ComponentFactory.mjs +1 -1
- package/out/utils/account/index.mjs +1 -1
- package/out/utils/account/refreshAccount.mjs +1 -1
- package/out/utils/account/refreshNativeAuthTokenLogin.mjs +1 -1
- package/out/utils/index.mjs +1 -1
- package/out/utils/transactions/getActiveTransactionsStatus.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/getInterpretedTransaction.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getLockedAccountName.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getShardText.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionIconInfo.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionMessages.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/index.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/index.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/getTransactionsHistory.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/getCachedTransactionListItem.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/index.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/index.mjs +1 -1
- package/out/utils/transactions/index.mjs +1 -1
- package/out/utils/visual/index.mjs +1 -1
- package/out/utils/visual/switchTheme.mjs +1 -1
- package/out/utils/window/getIsInIframe.mjs +1 -1
- package/out/utils/window/getWindowParentOrigin.mjs +1 -1
- package/out/utils/window/index.mjs +1 -1
- package/package.json +4 -4
- package/out/__chunks__/chunk-4KABQZJU.mjs +0 -2
- package/out/__chunks__/chunk-4NXTT4UR.mjs +0 -2
- package/out/__chunks__/chunk-BHXGUN5H.mjs +0 -2
- package/out/__chunks__/chunk-BLUKJJTY.mjs +0 -2
- package/out/__chunks__/chunk-CMEBBADF.mjs +0 -2
- package/out/__chunks__/chunk-FFNSZC37.mjs +0 -2
- package/out/__chunks__/chunk-FFNSZC37.mjs.map +0 -7
- package/out/__chunks__/chunk-FGRMMCGF.mjs +0 -2
- package/out/__chunks__/chunk-GXMIT5JQ.mjs +0 -2
- package/out/__chunks__/chunk-GXMIT5JQ.mjs.map +0 -7
- package/out/__chunks__/chunk-GZAAD3TR.mjs +0 -2
- package/out/__chunks__/chunk-HACVN4R6.mjs +0 -2
- package/out/__chunks__/chunk-JGWGDO7E.mjs +0 -2
- package/out/__chunks__/chunk-KOALRMAA.mjs +0 -2
- package/out/__chunks__/chunk-O67FZOYR.mjs +0 -2
- package/out/__chunks__/chunk-QYV4JQI5.mjs +0 -2
- package/out/__chunks__/chunk-S2FAYMW2.mjs +0 -2
- package/out/__chunks__/chunk-TGCPDWQK.mjs +0 -2
- package/out/__chunks__/chunk-VOZWABCM.mjs +0 -2
- package/out/__chunks__/chunk-VTL2OSUK.mjs +0 -2
- package/out/__chunks__/chunk-VTL2OSUK.mjs.map +0 -7
- package/out/__chunks__/chunk-YDGXPL33.mjs +0 -2
- package/out/__chunks__/chunk-YVH7ZJXA.mjs +0 -2
- package/out/__chunks__/chunk-ZSHUGRGA.mjs +0 -2
- /package/out/__chunks__/{chunk-CRHPVNRL.mjs.map → chunk-2R3GW4DI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4USFY3DC.mjs.map → chunk-2RTSC7PZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-33V2XBND.mjs.map → chunk-3T632N3C.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5MDDPC5M.mjs.map → chunk-3XRUVLQ2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GZAAD3TR.mjs.map → chunk-45VUJAFY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VOZWABCM.mjs.map → chunk-4IUSIUL5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SZHXVDHF.mjs.map → chunk-4P67TGYO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-I2XLXOU2.mjs.map → chunk-4ZRZMRUQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LJ5JGAYL.mjs.map → chunk-5DP2QBUG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EO6CD6VO.mjs.map → chunk-6BE7ZR56.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JMXZ4XDT.mjs.map → chunk-A5AK7XRL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TEYO3CV4.mjs.map → chunk-ARULSK25.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RLVN434K.mjs.map → chunk-ATH4WYTD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3OKWBJFM.mjs.map → chunk-B2RDSGON.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YIWTWMQF.mjs.map → chunk-B5IYIF42.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7H2PZVSJ.mjs.map → chunk-BDKYHP5K.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-532QQEN4.mjs.map → chunk-BEKALCDX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YMSRWWNA.mjs.map → chunk-BR4N3QPJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-R6QXUFY4.mjs.map → chunk-C23YOFAN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GFK4E7GU.mjs.map → chunk-C2LIMWMH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TGCPDWQK.mjs.map → chunk-C7N7SMQU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JYZ5XXJG.mjs.map → chunk-CA5AC6SG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GRD5MWEG.mjs.map → chunk-CC3JG6SH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-I2BU6ZOQ.mjs.map → chunk-D7SNMDI5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KOALRMAA.mjs.map → chunk-DJMZEN3G.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4NXTT4UR.mjs.map → chunk-DQTYHRUO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7RFUEHZX.mjs.map → chunk-EVP54VPS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MH42KJTU.mjs.map → chunk-F6Y3GEEQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RG72LHS3.mjs.map → chunk-F6Y3SXC4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4KABQZJU.mjs.map → chunk-HKYS3MAS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BTXVE2KE.mjs.map → chunk-HM5GQ2WF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Z6VA2J3J.mjs.map → chunk-HT5DZIND.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OYY5ZF7L.mjs.map → chunk-HT5S5AYG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FGRMMCGF.mjs.map → chunk-HXHKPIMW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IQVVCXXL.mjs.map → chunk-IHOOASQ4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4MNCFSUO.mjs.map → chunk-IIBVDR56.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MAK5NFYN.mjs.map → chunk-IXAT2U5R.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HACVN4R6.mjs.map → chunk-IXBOK5RG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CMEBBADF.mjs.map → chunk-J6CUEKO2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-F4W3N3JZ.mjs.map → chunk-JJFKKKLP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-F4WQOPSX.mjs.map → chunk-JPJXXLTL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MXLRZPMK.mjs.map → chunk-JXUTUO6K.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JJ2NEPU5.mjs.map → chunk-KJT6AKOF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ODIVUD2L.mjs.map → chunk-KUBMPJIS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YVH7ZJXA.mjs.map → chunk-MAGQLOT2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QZ27VHW6.mjs.map → chunk-MAQPZJET.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-O67WFDS3.mjs.map → chunk-MKKFM4TT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KNRIU7GR.mjs.map → chunk-MKYZXRIA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-C3F3EPNZ.mjs.map → chunk-NSSJOXSU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RCRWI3XT.mjs.map → chunk-OXU2ZOST.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AI7LYKBU.mjs.map → chunk-PKIAC4UI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CBH7E57H.mjs.map → chunk-PZJGJAWU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VML7BRY5.mjs.map → chunk-Q3DOWDRB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PH2YVVEA.mjs.map → chunk-QHLQKNEW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MYCXIA5W.mjs.map → chunk-QRLEYILE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CUABBK2P.mjs.map → chunk-QVIO2WRO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AZGVI4QW.mjs.map → chunk-RAG4YNTC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ES6E2HM6.mjs.map → chunk-RHOHTVC7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MUYF2CWM.mjs.map → chunk-RPLCGVHU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QCJMV6NU.mjs.map → chunk-RVW2IVLQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-O67FZOYR.mjs.map → chunk-SBFDOVKK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SLBB2BEP.mjs.map → chunk-SL7W4MV6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RPBH7EFR.mjs.map → chunk-T227HNYP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-T5GA3FRJ.mjs.map → chunk-TR4XGBZR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TDUKMRJX.mjs.map → chunk-TTFKQZLJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SPSO2A53.mjs.map → chunk-U64LDJTG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BLUKJJTY.mjs.map → chunk-V6JLSLC4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-S2FAYMW2.mjs.map → chunk-V6STR476.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Y4OUAJSG.mjs.map → chunk-VJAAWEHK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GZTGHNVI.mjs.map → chunk-VOS5UP5O.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AZ2KOM5R.mjs.map → chunk-WCOPQ7L7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JGWGDO7E.mjs.map → chunk-WWY2ESAK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SFZJXI7K.mjs.map → chunk-X4URPB2S.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZSHUGRGA.mjs.map → chunk-XGR6W4AU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EBQZQA2Q.mjs.map → chunk-XU5ALACG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PLO67H6R.mjs.map → chunk-ZEYTUYGU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QYV4JQI5.mjs.map → chunk-ZGXYSDXQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YDGXPL33.mjs.map → chunk-ZJQDEYHR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LV2BL56O.mjs.map → chunk-ZVOPHS4O.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3U6H4VPO.mjs.map → chunk-ZZC5SQOQ.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-B5IYIF42.mjs";import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as f}from"./chunk-Y3BNMQFP.mjs";import{h as l}from"./chunk-HM5GQ2WF.mjs";import{h as d}from"./chunk-CAA4VJRH.mjs";import{b as g}from"./chunk-3ZEUVYQF.mjs";import{a as u}from"./chunk-VJAAWEHK.mjs";import{a as m}from"./chunk-L3MWDI6J.mjs";import{a as y}from"./chunk-45VUJAFY.mjs";import{u as p}from"./chunk-VOS5UP5O.mjs";import{b as c}from"./chunk-SAAOQW7P.mjs";import{e as T}from"./chunk-R53MCZI6.mjs";import b from"axios";var r=class r{constructor(){this.setCallbacks=({onSuccess:a,onFail:t})=>{g({onSuccess:a,onFail:t})};this.send=async a=>{if(a.length===0)throw new Error("No transactions to send");try{if(!S(a))return await this.sendSignedTransactions(a);let t=await this.sendSignedBatchTransactions(a);if(!t.data||t.data.error)throw new Error(t.data?.error??"Failed to send transactions");return t.data.transactions}catch(t){throw t.response?.data?.message??t.message}};this.track=async(a,t={disableToasts:!1})=>{let n=this.sequentialToFlatArray(a).map(i=>({...i,status:i.status??"pending"})),e=m(n),o=u({transactions:n,transactionsDisplayInfo:t.transactionsDisplayInfo,status:e??"sent",sessionInformation:t.sessionInformation});if(t.disableToasts===!0)return o;let s=h(a);return l({toastId:o,totalDuration:s}),o};this.sendSignedTransactions=async a=>{let{apiAddress:t,apiTimeout:n}=c(p()),e=a.map(s=>b.post(`${t}/transactions`,s.toPlainObject(),{timeout:Number(n)}));return(await Promise.all(e)).map(({data:s})=>({...s,status:"pending",hash:s.txHash}))};this.sendSignedBatchTransactions=async a=>{let{address:t}=y(),{apiAddress:n,apiTimeout:e}=c(p());if(!t)return{error:"Invalid address provided. You need to be logged in to send transactions"};let o=this.buildBatchId(t),i={transactions:a.map(w=>w.map(v=>this.parseSignedTransaction(v))),id:o},{data:A}=await b.post(`${n}/batch`,i,{timeout:Number(e)});return{data:A}};this.buildBatchId=a=>`${Date.now().toString()}${d}${a}`;this.sequentialToFlatArray=(a=[])=>this.getIsSequential(a)?a.flat():a;this.getIsSequential=a=>a?.every(t=>Array.isArray(t));this.parseSignedTransaction=a=>{let t=new T,n={...a.toPlainObject(),hash:t.computeTransactionHash(a),status:"pending"};return f({data:n.data})&&(delete n.senderUsername,delete n.receiverUsername),n}}static getInstance(){return r.instance||(r.instance=new r),r.instance}};r.instance=null;var I=r;export{I as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2R3GW4DI.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-TQA3JDNV.mjs";import{u as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-TQA3JDNV.mjs";import{u as s}from"./chunk-VOS5UP5O.mjs";import{e as a}from"./chunk-QJSB5NX4.mjs";function x(n){let e=s(),o=u(e),c=a(e),t=Object.keys(o).map(Number).reduce((r,m)=>{let i=o[m]?.transactions||[];return Math.max(r,...i.map(l=>l.nonce),0)},0);return t>0&&(t+=1),n==null?Math.max(t,c):Math.max(t||n.nonce,c)}export{x as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2RTSC7PZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-OXU2ZOST.mjs";import{a as S}from"./chunk-JJFKKKLP.mjs";import{a as o}from"./chunk-FMQYLMTU.mjs";import{a as y}from"./chunk-MFUQ5NBC.mjs";import{b as i,c as f}from"./chunk-VJAAWEHK.mjs";import{l}from"./chunk-65L5EBBL.mjs";var u={};async function d({serverTransaction:e,sessionId:t,isSequential:c}){let{hash:a,status:r,results:m,invalidTransaction:n,hasStatusChanged:p}=e;try{if(u[a]>30){i({sessionId:t,status:"timedOut"}),await o({sessionId:t,status:"timedOut"});return}if(n&&!c||r==="sent"){u[a]=u[a]?u[a]+1:1;return}if(c&&!r){let s=f({sessionId:t,transaction:e});await o({sessionId:t,status:s});return}if(p){let s=f({sessionId:t,transaction:e});await o({sessionId:t,status:s})}l(r)&&await S({sessionId:t,hash:a,results:m})}catch(T){console.error(T),i({sessionId:t,status:"timedOut"}),await o({sessionId:t,status:"timedOut"})}}async function R({sessionId:e,transactionBatch:t,isSequential:c}){try{if(t==null)return;let a=y(t),r=await h(a);for(let n of r)await d({serverTransaction:n,sessionId:e,isSequential:c});if(r.every(n=>n.status!=="pending")){if(r.every(s=>s.status==="success"))return i({sessionId:e,status:"success"});if(r.some(s=>s.status==="fail"))return i({sessionId:e,status:"fail"});if(r.every(s=>s.invalidTransaction))return i({sessionId:e,status:"invalid"})}}catch(a){console.error(a)}}export{R as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3T632N3C.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-MAGQLOT2.mjs";import{a as k}from"./chunk-C7N7SMQU.mjs";import{s as f}from"./chunk-VOS5UP5O.mjs";import{d as b}from"./chunk-QJSB5NX4.mjs";import{c as n}from"./chunk-IXAT2U5R.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-3XRUVLQ2.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-C23YOFAN.mjs";import{a as p}from"./chunk-ZEYTUYGU.mjs";import{a as d}from"./chunk-DQTYHRUO.mjs";import{a as T}from"./chunk-LUDF7ZUR.mjs";var f=a=>a.sort((i,o)=>o.timestamp-i.timestamp),H=async({transactions:a,address:i,explorerAddress:o,egldLabel:g})=>{let e=[],r=[];if(a.forEach(s=>{let t=d(s.hash);t?e.push(t):r.push(s.hash)}),r.length===0)return f(e);let c=await h(r),I=c.map(s=>s.txHash),m=r.filter(s=>!I.includes(s));if(m.length>0){let t=a.filter(n=>m.includes(n.hash)).map(n=>({...n,txHash:n.hash,price:0,status:"pending",gasUsed:0,miniBlockHash:"",receiverShard:0,round:0,senderShard:0,timestamp:Date.now()}));c.push(...t)}return c.forEach(s=>{let t=T({transaction:s,address:i,explorerAddress:o,egldLabel:g});t.status!=="pending"&&p({key:`transaction-${s.txHash}`,value:t}),e.push(t)}),f(e)};export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4P67TGYO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-X6MN67NW.mjs";import{u as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-X6MN67NW.mjs";import{u as m}from"./chunk-VOS5UP5O.mjs";import{b as a}from"./chunk-SAAOQW7P.mjs";import{o as r,u as i}from"./chunk-KD2IQ32V.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";async function b({tokenId:o}){let t=a(m()),{isNft:k}=c(o),n=o,p=k?r:i;if(!n)return{tokenDecimals:Number(t.decimals),tokenLabel:"",tokenAvatar:""};try{let{data:e}=await s.get(`${t.apiAddress}/${p}/${n}`),f=e?e?.decimals:Number(t.decimals),l=e?e?.name:"",d=e?e?.assets?.svgUrl??e?.media?.[0]?.thumbnailUrl:"";return{tokenDecimals:f,tokenLabel:l,type:e?.type,tokenAvatar:d,identifier:e?.identifier,assets:e?.assets,esdtPrice:e?.price,ticker:e?.ticker,name:e?.name}}catch(e){return{error:`Error fetching token ${n}: ${e.toString()}`,tokenDecimals:Number(t.decimals),tokenLabel:"",tokenAvatar:"",identifier:n}}}export{b as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4ZRZMRUQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-RWQNLK3I.mjs";import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-RWQNLK3I.mjs";import{a as d}from"./chunk-VJBLHJYB.mjs";import{a}from"./chunk-RRK6GTWZ.mjs";import{a as o}from"./chunk-IPMSVHGJ.mjs";import{a as g}from"./chunk-PSJI2G34.mjs";import{a as i}from"./chunk-2CG6PNPJ.mjs";import{a as c}from"./chunk-FROSOADM.mjs";import{a as p,b as e}from"./chunk-HDRB2QL6.mjs";import{rest as t}from"msw";import{setupServer as u}from"msw/node";var s=m=>(R,f,n)=>f(n.status(200),n.json(m)),k=[t.get(`${e.apiAddress}/dapp/config`,s(c)),t.get(`${e.apiAddress}/network/config`,s(i)),t.get(`https://${o.url}/socket.io/`,s(g)),t.get(`${e.apiAddress}/websocket/config`,s(o)),t.get(`${e.apiAddress}/accounts/${p}`,s(a)),t.get(`${e.apiAddress}/accounts/${r.address}`,s(r)),t.get(`${e.apiAddress}/blocks`,s(d))],P=u(...k);export{t as a,s as b,P as c};
|
|
2
|
+
//# sourceMappingURL=chunk-5DP2QBUG.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-QVIO2WRO.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-6BE7ZR56.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as f}from"./chunk-NSSJOXSU.mjs";import{s as n}from"./chunk-HM5GQ2WF.mjs";import{u as t}from"./chunk-VOS5UP5O.mjs";import{d as i}from"./chunk-VNLGNNIL.mjs";import{a as e}from"./chunk-OJV6XRG5.mjs";import{a as m}from"./chunk-6BE7ZR56.mjs";async function I(){let o=m()?e.webview:i(t());if(!o)return;let r=await f.create({type:o});if(!r)throw new Error("Provider not found");o===e.webview&&r.isInitialized()&&await r.login(),n(r)}export{I as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6HNXEUEX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/providers/helpers/restoreProvider.ts"],
|
|
4
|
+
"sourcesContent": ["import { ProviderTypeEnum } from 'providers/types/providerFactory.types';\nimport { providerTypeSelector } from 'store/selectors';\nimport { getState } from 'store/store';\nimport { getIsInIframe } from 'utils/window/getIsInIframe';\nimport { setAccountProvider } from './accountProvider';\nimport { ProviderFactory } from '../ProviderFactory';\n\nexport async function restoreProvider() {\n const isInIframe = getIsInIframe();\n\n const type = isInIframe\n ? ProviderTypeEnum.webview\n : providerTypeSelector(getState());\n\n if (!type) {\n return;\n }\n\n const provider = await ProviderFactory.create({\n type\n });\n\n if (!provider) {\n throw new Error('Provider not found');\n }\n\n /*\n Check if the app is running in webview and the provider is already initialized.\n - true: the app is embedded within another dApp (e.g., inside an iframe) and perform login using the provider.\n - false: the parent is not a dApp and proceed with initializing the current app as a standalone iframe.\n */\n if (type === ProviderTypeEnum.webview && provider.isInitialized()) {\n await provider.login();\n }\n\n setAccountProvider(provider);\n}\n"],
|
|
5
|
+
"mappings": "sPAOA,eAAsBA,GAAkB,CAGtC,IAAMC,EAFaC,EAAc,EAG7BC,EAAiB,QACjBC,EAAqBC,EAAS,CAAC,EAEnC,GAAI,CAACJ,EACH,OAGF,IAAMK,EAAW,MAAMC,EAAgB,OAAO,CAC5C,KAAAN,CACF,CAAC,EAED,GAAI,CAACK,EACH,MAAM,IAAI,MAAM,oBAAoB,EAQlCL,IAASE,EAAiB,SAAWG,EAAS,cAAc,GAC9D,MAAMA,EAAS,MAAM,EAGvBE,EAAmBF,CAAQ,CAC7B",
|
|
6
|
+
"names": ["restoreProvider", "type", "getIsInIframe", "ProviderTypeEnum", "providerTypeSelector", "getState", "provider", "ProviderFactory", "setAccountProvider"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-CA2JFJCS.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-A5AK7XRL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-IIBVDR56.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-ARULSK25.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-T227HNYP.mjs";import{a as e}from"./chunk-ZGXYSDXQ.mjs";import{a as i}from"./chunk-REI3WYXH.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-ATH4WYTD.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as d}from"./chunk-OA5BWGGO.mjs";import{b as s}from"./chunk-6UIF2KFV.mjs";import{a as i}from"./chunk-WE7YOBO7.mjs";var a=({loginToken:t,version:r})=>{if(!t||!r)return null;let{ledgerWithUsernames:u}=s(r),e=i(t);if(e==null)return null;let n="Confirm Ledger Address",o="Authorise Authentication Token";if(u){let m=d(e.ttl);return{data:`${e.origin} for ${m}.`,confirmAddressText:n,authText:o}}return{data:t,confirmAddressText:n,authText:o}};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-B2RDSGON.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as s}from"./chunk-DT6YLEPL.mjs";import{c as r,d as a}from"./chunk-CAA4VJRH.mjs";import{u as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as s}from"./chunk-DT6YLEPL.mjs";import{c as r,d as a}from"./chunk-CAA4VJRH.mjs";import{u as e}from"./chunk-VOS5UP5O.mjs";import{a as n}from"./chunk-QJSB5NX4.mjs";var u=t=>{let o=0,i=n(e())?.shard;return S(t)?(t.forEach(c=>{let m=s(c,i);o+=m?5*6e3:6e3}),o):(o=s(t,i)?5*6e3:6e3,o)};export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-B5IYIF42.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-HT5DZIND.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-BDKYHP5K.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as I}from"./chunk-PJDJEPY2.mjs";import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as I}from"./chunk-PJDJEPY2.mjs";import{a as l}from"./chunk-ZJQDEYHR.mjs";import{a as f}from"./chunk-V6STR476.mjs";import{j as m,k as d,l as p,n as u}from"./chunk-65L5EBBL.mjs";import{a as T}from"./chunk-4P67TGYO.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-BEKALCDX.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{l as p,s as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{l as p,s as e}from"./chunk-VOS5UP5O.mjs";import{c as i}from"./chunk-R53MCZI6.mjs";var T=()=>e().setState(p),m=({address:o,providerType:d})=>{e().setState(({account:r,loginInfo:t})=>{r.address=o,r.publicKey=new i(o).hex(),t&&(t.providerType=d)},!1,"loginAction")};export{T as a,m as b};
|
|
2
|
+
//# sourceMappingURL=chunk-BR4N3QPJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{u as e}from"./chunk-VOS5UP5O.mjs";import{b as t}from"./chunk-SAAOQW7P.mjs";import{x as r}from"./chunk-KD2IQ32V.mjs";import i from"axios";var T=async o=>{let{apiAddress:s}=t(e()),{data:a}=await i.get(`${s}/${r}`,{params:{hashes:o.join(","),withScResults:!0}});return a};export{T as a};
|
|
2
|
+
//# sourceMappingURL=chunk-C23YOFAN.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-4TBVQD27.mjs";import{s as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-4TBVQD27.mjs";import{s as o}from"./chunk-VOS5UP5O.mjs";var l=t=>o().setState(({config:e})=>{e.nativeAuthConfig=t},!1,"setNativeAuthConfig"),c=t=>o().setState(({config:e})=>{e.websocketStatus=t},!1,"setWebsocketStatus"),f=t=>o().setState(({config:e})=>{let s=t.walletConnectV2RelayAddress||n.walletConnectV2RelayAddress,i=t.walletConnectDeepLink||n.walletConnectDeepLink;e.walletConnectConfig={...t,walletConnectDeepLink:i,walletConnectV2RelayAddress:s}},!1,"setWalletConnectConfig"),r=t=>o().setState(({config:e})=>{e.crossWindowConfig=t},!1,"setCrossWindowConfig");export{l as a,c as b,f as c,r as d};
|
|
2
|
+
//# sourceMappingURL=chunk-C2LIMWMH.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as o}from"./chunk-3T632N3C.mjs";import{b as s}from"./chunk-TQA3JDNV.mjs";import{u as n}from"./chunk-VOS5UP5O.mjs";async function f(){let t=s(n());if(Object.keys(t).length>0)for(let[e,{transactions:c}]of Object.entries(t))await o({sessionId:e,transactionBatch:c})}export{f as a};
|
|
2
|
+
//# sourceMappingURL=chunk-C7N7SMQU.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.0-alpha.
|
|
4
|
+
"sourcesContent": ["export const safeWindow: Window =\n typeof window !== 'undefined' ? window : ({} as Window);\n\nexport const version = '5.0.0-alpha.17'; // 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
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-IIBVDR56.mjs";var c=class n extends i{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-ledger-connect"});this.addressesPerPage=10;this.allAccounts=[];this.initialConnectScreenData={};this.connectScreenData={...this.initialConnectScreenData};this.initialAccountScreenData={accounts:this.allAccounts,startIndex:0,addressesPerPage:this.addressesPerPage,isLoading:!0};this.accountScreenData={...this.initialAccountScreenData};this.initialConfirmScreenData={selectedAddress:"",explorerLink:""};this.confirmScreenData={...this.initialConfirmScreenData};this.initialData={connectScreenData:this.initialConnectScreenData,accountScreenData:this.initialAccountScreenData,confirmScreenData:this.initialConfirmScreenData};this.data=this.getInitialData()}static getInstance(){return n.instance||(n.instance=new n),n.instance}updateAllAccounts(e){this.allAccounts=e,this.accountScreenData.accounts=e}updateStartIndex(e){this.accountScreenData.startIndex=e}updateConnectScreen(e){this.connectScreenData={...this.connectScreenData,...e},this.data.confirmScreenData=null,this.data.accountScreenData=null,this.data.connectScreenData=this.connectScreenData,this.notifyDataUpdate()}updateAccountScreen(e){this.accountScreenData={...this.accountScreenData,...e},this.data.confirmScreenData=null,this.data.accountScreenData=this.accountScreenData,this.notifyDataUpdate()}updateConfirmScreen(e){this.confirmScreenData={...this.confirmScreenData,...e},this.data.accountScreenData=null,this.data.confirmScreenData=this.confirmScreenData,this.notifyDataUpdate()}getAccountScreenData(){return this.data.accountScreenData}getConfirmScreenData(){return this.data.confirmScreenData}getAllAccounts(){return this.allAccounts}subscribeToProviderInit({handleRetry:e,handleCancel:t}){this.eventBus&&(this.eventBus.subscribe("CONNECT_DEVICE",e),this.eventBus.subscribe("CLOSE",t),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}unsubscribeFromProviderInit({handleRetry:e,handleCancel:t}){this.eventBus&&(this.eventBus.unsubscribe("CONNECT_DEVICE",e),this.eventBus.unsubscribe("CLOSE",t),this.eventBus.unsubscribe("UI_DISCONNECTED",this.destroy.bind(this)))}subscribeToAuthEvents({handleCancel:e,handleAccessWallet:t,handleGoToPage:a}){this.eventBus&&(this.eventBus.subscribe("CLOSE",e),this.eventBus.subscribe("ACCESS_WALLET",t),this.eventBus.subscribe("GO_TO_PAGE",a))}unsubscribeFromAuthEvents({handleCancel:e,handleAccessWallet:t,handleGoToPage:a}){this.eventBus&&(this.eventBus.unsubscribe("CLOSE",e),this.eventBus.unsubscribe("ACCESS_WALLET",t),this.eventBus.unsubscribe("GO_TO_PAGE",a))}handleClose(){this.anchor?this.anchor?.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy()}resetData(){this.accountScreenData={...this.initialAccountScreenData},this.confirmScreenData={...this.initialConfirmScreenData},this.connectScreenData={...this.initialConnectScreenData},super.resetData()}async setupEventListeners(){this.eventBus&&this.eventBus.subscribe("CLOSE",this.handleClose.bind(this))}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CA5AC6SG.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-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as w}from"./chunk-QXC4D3AC.mjs";import{a as g}from"./chunk-YGI3KXMZ.mjs";import{a as b}from"./chunk-IXBOK5RG.mjs";import{a as f}from"./chunk-6FXEHNGW.mjs";import{f as m}from"./chunk-J4CPYFK6.mjs";import x from"bignumber.js";var v=async({manager:e,provider:d})=>{if(!e||!d)throw new Error("Provider is not initialized.");let{network:u}=b(),n=e.getAccountScreenData()?.startIndex||0,r=e.getAllAccounts(),a=await w({baseURL:u.apiAddress}),l=c=>c.index>=n&&c.index<n+e.addressesPerPage,I=r.reduce((c,s)=>Object.assign(c,{[s.index]:s}),{}),A=r.filter(l),y=!!I[n];if(e.updateAccountScreen({isLoading:!y}),A.length>0){e.updateAccountScreen({accounts:A});return}try{let c=await d.getAccounts(n,e.addressesPerPage),s=c.map((t,o)=>({address:t,balance:"...",index:o+n})),L=[...r,...s],j=c.map(t=>f({address:t,baseURL:u.apiAddress})),O=await Promise.all(j),i=L.reduce((t,o)=>Object.assign(t,{[o.address]:o}),{});O.forEach(t=>{if(!t||!a||!a.price)return;let o=new x(t.balance),U=o.dividedBy(x(10).pow(18)).toFormat(4).toString();if(o.isNaN())return;let h=g({amount:m({input:t.balance}),usd:a?.price});i[t.address].balance=U,i[t.address].usdValue=h});let p=Object.values(i).sort((t,o)=>t.index-o.index),S=p.filter(l);e.updateAllAccounts(p),e.updateAccountScreen({accounts:S,isLoading:!1})}catch(c){console.error("Failed to fetch accounts:",c)}};export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CC3JG6SH.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as l}from"./chunk-NSSJOXSU.mjs";import{a as p}from"./chunk-RAG4YNTC.mjs";import{u as c}from"./chunk-VOS5UP5O.mjs";import{b as d}from"./chunk-SAAOQW7P.mjs";import{a as v}from"./chunk-REI3WYXH.mjs";import{a}from"./chunk-OJV6XRG5.mjs";var i=class i extends p{constructor(){super({uiTag:"mvx-unlock-panel",uiDataUpdateEvent:"OPEN"});this.initialData={providers:null,walletAddress:null};this.openUnlockPanel=async()=>{let{walletAddress:e}=d(c());this.data={providers:this.getProvidersList(),walletAddress:e},await this.openUI(),this.notifyDataUpdate()};this.setupEventListeners=async()=>{this.eventBus&&(this.subscribeToEventBus("LOGIN",this.handleLogin),this.subscribeToEventBus("CANCEL_LOGIN",this.handleCancelLogin),this.subscribeToEventBus("CLOSE",this.handleCloseUI))};this.handleCloseUI=async e=>{!e?.isLoginFinished&&i.onClose&&i.onClose(),this.closeUI()};this.handleLogin=async({type:e,anchor:o})=>{if(!i.loginHandler)throw new Error("Login callback not initialized. Please call `init()` first.");try{this.isSimpleLoginCallback(i.loginHandler)?(await(await l.create({type:e,anchor:o})).login(),i.loginHandler()):i.loginHandler({type:e,anchor:o}),await this.handleCloseUI({isLoginFinished:!0})}catch(r){console.error(r),this.eventBus?.publish("CANCEL_IN_PROVIDER",this.data)}};this.handleCancelLogin=async()=>{await l.destroy()};this.isSimpleLoginCallback=e=>e.length===0;this.data=this.initialData}static getInstance(){return i.instance||(i.instance=new i),i.instance}static init(e){return this.loginHandler=e.loginHandler,this.allowedProviders=e.allowedProviders,e.onClose&&(this.onClose=e.onClose),this.getInstance()}getProvidersList(){let e=l.customProviders,r=[...Object.values(a).filter(n=>n!==a.none&&n!==a.webview),...e.map(n=>n.type)],P=e.reduce((n,t)=>(n[t.type]=t.name,n),{}),s={...v,...P};return(i.allowedProviders?i?.allowedProviders.filter(n=>r.includes(n)):r).map(n=>{let t=e.find(g=>g.type===n);return t||{name:n in s?s[n]:n,type:n}})}};i.loginHandler=null,i.onClose=null,i.allowedProviders=null;var u=i;export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-D7SNMDI5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-RAG4YNTC.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-EVP54VPS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-SL7W4MV6.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-F6Y3GEEQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{u as r}from"./chunk-VOS5UP5O.mjs";import{b as e}from"./chunk-SAAOQW7P.mjs";var d=s=>{let o=e(r()),t=s??o.apiAddress;return t.endsWith("/")?t.slice(0,-1):t};export{d as a};
|
|
2
|
+
//# sourceMappingURL=chunk-F6Y3SXC4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ot}from"./chunk-BLUKJJTY.mjs";import{a as ct}from"./chunk-6UZHM5LW.mjs";import{a as C}from"./chunk-532QQEN4.mjs";import{a as mt}from"./chunk-QCJMV6NU.mjs";import{a as L}from"./chunk-5MDDPC5M.mjs";import{a as Q,b as X,g as Z,l as tt}from"./chunk-CAA4VJRH.mjs";import{a as lt}from"./chunk-AZ2KOM5R.mjs";import{b}from"./chunk-MYCXIA5W.mjs";import{a as pt}from"./chunk-O67FZOYR.mjs";import{a as ht}from"./chunk-4ODPAHHA.mjs";import{a as gt}from"./chunk-Z5CDCI3Y.mjs";import{a as dt}from"./chunk-T5GA3FRJ.mjs";import{a as g}from"./chunk-HACVN4R6.mjs";import{a as J}from"./chunk-QYV4JQI5.mjs";import{a as rt}from"./chunk-AZGVI4QW.mjs";import{a as S}from"./chunk-4USFY3DC.mjs";import{a as y,f as ut}from"./chunk-MXLRZPMK.mjs";import{b as Tt}from"./chunk-YMSRWWNA.mjs";import{d as it}from"./chunk-Y4OUAJSG.mjs";import{k as st,l as et,n as nt}from"./chunk-65L5EBBL.mjs";import{a as A}from"./chunk-HORSXVIV.mjs";import{a as ft}from"./chunk-GZAAD3TR.mjs";import{a as j}from"./chunk-7H2PZVSJ.mjs";import{a as I}from"./chunk-QTKK6OSJ.mjs";import{a as E}from"./chunk-6FXEHNGW.mjs";import{a as It}from"./chunk-NJN53MJV.mjs";import{a as Y}from"./chunk-YSCND2MX.mjs";import{b as V,s as u,u as q}from"./chunk-GZTGHNVI.mjs";import{c as $,f as G}from"./chunk-QJSB5NX4.mjs";import{b as d}from"./chunk-VNLGNNIL.mjs";import{b as h}from"./chunk-IEJTMYFW.mjs";import{b as H,c as K,f as z}from"./chunk-R53MCZI6.mjs";import{b as vt}from"./chunk-3LBQYLDY.mjs";import{a as at}from"./chunk-VML7BRY5.mjs";import{a as v}from"./chunk-OJV6XRG5.mjs";import _ from"lodash.isequal";import Et from"lodash.isequal";var Nt="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",w=class e extends rt{constructor(){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.store=u();this.initialData={pendingTransactions:[],historicTransactions:[]};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 s=this.store.subscribe(async({toasts:n,transactions:i},{toasts:a,transactions:c})=>{(!Et(a.transactionToasts,n.transactionToasts)||!Et(c,i))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Nt,[s]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}handleCloseUI(){let o=p.getInstance();this.closeUI(),o.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:o,account:s,toasts:n,network:i}=this.store.getState(),{pendingTransactionToasts:a}=await C({toastList:n,transactionsSessions:o,account:s});this.data.pendingTransactions=a,this.data.historicTransactions=await ot.getTransactionsHistory({transactionsSessions:o,address:s.address,explorerAddress:i.network.explorerAddress,egldLabel:i.network.egldLabel}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){it(),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 x=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(),o=d(t),{isExpired:s}=I(o?.nativeAuthToken);s?f().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(),o=d(t),s=G(t);return!!(o?.nativeAuthToken&&s)};this.addPlannedLogout=()=>{let t=f(),o=$(this.store.getState()),s=t.getType()===v.webview;if(!o||s)return;this.addLogoutWarning();let n=d(this.store.getState()),{secondsUntilExpires:i,expiresAt:a}=I(n?.nativeAuthToken),c=new R(String(i)),r=`${o}_${a}`,m=this.plannedLogoutKey===r;if(!(i&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=r,clearTimeout(this.plannedLogoutTimeoutRef??0);let W=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},W.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},W.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=h(this.store.getState()),o=d(this.store.getState()),{secondsUntilExpires:s}=I(o?.nativeAuthToken),n=new R(String(s)),i=n.times(1e3);if(!s||n.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new R(t?.tokenExpirationToastWarningSeconds??0).times(1e3),r=n.times(1e3).minus(c),m=ct(i.toNumber()),T=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},T)}}static getInstance(){return e.instance||(e.instance=new e),e.instance}};async function U({address:e,provider:t,apiAddress:o}){let s=await E({address:e,baseURL:o});if(!s)throw new Error("Account not found");Tt({address:e,providerType:t.getType()});let n={...s,username:A(s.username),nonce:S(s)};y(n),await b(e),L(),s.shard!=null&&await mt({shard:Number(s.shard),apiAddress:o})}async function Ot(e){let{network:{apiAddress:t}}=g();await e.login();let o=await e.getAddress();if(!o)throw new Error("Address not found");return await U({address:o,provider:e,apiAddress:t}),{address:o}}async function Ft({provider:e,nativeAuthConfig:t,token:o}){let{network:{apiAddress:s}}=g(),n=j(t),i=o;i||(i=await n.initialize({noCache:!0}));let{address:a,signature:c,...r}=await e.login({token:i});if(!a)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let m=n.getToken({address:a,token:i,signature:c});V({loginToken:i,signature:c,nativeAuthToken:m});let T=await pt({loginToken:i,extraInfoData:{multisig:r?.multisig,impersonate:r?.impersonate},address:a});return await U({address:T,provider:e,apiAddress:s}),{address:T,signature:c}}async function St(e,t){let o=h(q());if(o)return await Ft({provider:e,nativeAuthConfig:o,token:t?.token});let{address:s}=await Ot(e);return await b(s),L(),{address:s}}var k={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${X}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${Q}-${Date.now()}`}},Pt={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"},Dt=e=>{for(let[t,o]of Object.entries(Pt))if(e.includes(t))return o;return"Error when signing"};function B(e,t="error"){let o=e?.message,s=Dt(o),i=s!=="Error when signing"?"warning":t,a=Object.keys(k).includes(i)?k[i]:k.error,{toastId:c,iconClassName:r,title:m}=a;return N({toastId:c,duration:1e4,icon:"times",iconClassName:r,message:s,title:m}),s}async function Ct({provider:e,transactions:t,options:o={}}){await yt();let{isGuarded:s,activeGuardianAddress:n,nonce:i}=ft(),a=e.getType()===v.ledger,c=ht({latestNonce:i,transactions:t}),r=n&&s&&!o.skipGuardian?c?.map(T=>(T.version=H.withTxOptions().valueOf(),T.options=z.withOptions({guarded:!0,...a?{hashSign:!0}:{}}).valueOf(),T.guardian=K.newFromBech32(n),T)):c,m=await e.signTransactions(r)??[];return ut(i+m.length),m}var M=class{constructor(t){this.provider=t}init(){return this.provider.init()}async login(t){let o=await St(this.provider,t);return x.getInstance().init(),o}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0,hasConsentPopup:!1}){return await lt({provider:this.provider,options:t})}setShouldShowConsentPopup(t){this.provider.setShouldShowConsentPopup?.(t)}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,o){try{return await Ct({provider:this.provider,transactions:t,options:o})}catch(s){let n=B(s);throw new Error(n)}}async signMessage(t,o){try{return await dt({provider:this.provider,message:t,options:o})}catch(s){let n=B(s,"warning");throw new Error(n)}}async verifyMessage(t){return await gt(t)}cancelLogin(){this.provider.cancelLogin?.()}};var bt=null;function ps(e){bt=e}function f(){return bt||new M(vt)}var Rt=async()=>{try{let e=J(),{network:t}=g();try{let o=await E({address:e,baseURL:t.apiAddress});if(o!=null){let s={...o,username:A(o.username),nonce:S(o)};return y(s),s}}catch(o){console.error("Failed getting account ",o)}}catch(e){console.error("Failed getting address ",e)}return null};async function yt(){let e=f();if(e==null)throw"Provider not initialized";try{if(!e.init)throw"Current provider does not have init() function";return await e.init()?Rt():void 0}catch(t){console.error("Failed initializing provider ",t)}}var O={},l={},Ut=(e,t)=>{u().setState(({toasts:o})=>{let s=o.customToasts.length>0?Math.max(...o.customToasts.map(r=>parseInt(r.toastId.split("-").pop()??"0"))):0,n=t??`custom-toast-${s+1}`,i=o.customToasts.findIndex(r=>r.toastId===n),a={...e,toastId:n};if(i!==-1){o.customToasts[i]=a;return}o.customToasts.push({...a,toastId:n})},!1,"addCustomToast")},F=e=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(o=>o.toastId!==e)},!1,"removeCustomToast")},Lt=()=>{u().setState(({toasts:e})=>{e.customToasts=[]},!1,"removeAllCustomToasts")},Ws=()=>{u().setState(({toasts:e})=>{e.transactionToasts=[]})},At=({toastId:e,totalDuration:t})=>{let o="";return u().setState(({toasts:s})=>{let n=s.transactionToasts.length>0?Math.max(...s.transactionToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0;o=e??`transaction-toast-${n+1}`,s.transactionToasts.push({startTime:Y(),endTime:It(t),toastId:o})},!1,"addTransactionToast"),o},P=e=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(o=>o.toastId!==e)},!1,"removeTransactionToast"),delete l[e],delete O[e]},N=e=>{let{toasts:t}=u().getState(),o=t.customToasts.length>0?Math.max(...t.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,s=e.toastId||`custom-toast-${o+1}`;return e.onClose&&(l[s]=e.onClose),e.instantiateToastElement?(O[s]=e.instantiateToastElement,u().setState(({toasts:n})=>{let i=n.customToasts.findIndex(r=>r.toastId===s),a={...e,instantiateToastElement:null,toastId:s};i!==-1?n.customToasts[i]=a:n.customToasts.push(a)},!1,"createCustomToast"),s):(Ut(e,s),s)};var wt=1e4,D=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=wt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let o=setTimeout(()=>{P(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,o)};this.startWithCustomDuration=(t,o)=>{if(this.stop(t),o<=0)return;let s=setTimeout(()=>{F(t);let n=l[t];n?.()},o);this.timeoutIntervals.set(t,s)};this.stop=t=>{let o=this.timeoutIntervals.get(t);o&&(clearTimeout(o),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t||wt}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=w.getInstance()}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),this.updateTransactionToastsList(),this.updateCustomToastList(),await this.subscribeToEventBusNotifications(),this.storeToastsSubscription=this.store.subscribe(({toasts:o,transactions:s},{toasts:n,transactions:i})=>{(!_(n.transactionToasts,o.transactionToasts)||!_(i,s))&&this.updateTransactionToastsList(),_(n.customToasts,o.customToasts)||this.updateCustomToastList()})}static getInstance(){return e.instance||(e.instance=new e),e.instance}handleCompletedTransaction(t){let{transactions:o}=this.store.getState(),s=o[t];if(!s)return!1;let{status:n}=s,i=nt(n),a=et(n),c=st(n),r=a||c||i;return r?(this.successfulToastLifetime&&this.lifetimeManager.start(t),r):(this.lifetimeManager.stop(t),r)}createTransactionToast(t,o){let s=At({toastId:t,totalDuration:o});return this.handleCompletedTransaction(t),this.updateTransactionToastsList(),s}createCustomToast(t){let o=N(t);return this.updateCustomToastList(),o}async updateTransactionToastsList(){let{toasts:t,transactions:o,account:s}=this.store.getState(),{pendingTransactionToasts:n,completedTransactionToasts:i}=await C({toastList:t,transactionsSessions:o,account:s});this.transactionToasts=[...n,...i];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 o of t.customToasts){let n="message"in o?{...o}:{...o,instantiateToastElement:O[o.toastId]};this.customToasts.push(n),o.duration&&this.lifetimeManager.startWithCustomDuration(o.toastId,o.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 at.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}handleTransactionToastClose(t){this.handleCompletedTransaction(t)&&P(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))})}}showToasts(){this.updateCustomToastList(),this.updateTransactionToastsList()}hideToasts(){this.transactionToasts=[],this.customToasts=[],this.eventBus?.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts),this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",this.customToasts)}async handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}handleCloseToast(t){if(this.customToasts.find(s=>s.toastId===t)){this.lifetimeManager.stop(t);let s=l[t];s?.(),F(t);return}this.handleTransactionToastClose(t)}async publishTransactionToasts(){if(!this.notificationsFeedManager.isNotificationsFeedOpen()){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(),Lt(),this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[]}};export{w as a,O as b,l as c,Ut as d,F as e,Lt as f,Ws as g,At as h,P as i,N as j,D as k,p as l,x as m,U as n,St as o,B as p,Ct as q,M as r,ps as s,f as t,yt as u};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as ot}from"./chunk-V6JLSLC4.mjs";import{a as ct}from"./chunk-6UZHM5LW.mjs";import{a as C}from"./chunk-BEKALCDX.mjs";import{a as mt}from"./chunk-RVW2IVLQ.mjs";import{a as L}from"./chunk-3XRUVLQ2.mjs";import{a as Q,b as X,g as Z,l as tt}from"./chunk-CAA4VJRH.mjs";import{a as ht}from"./chunk-4ODPAHHA.mjs";import{a as dt}from"./chunk-TR4XGBZR.mjs";import{a as lt}from"./chunk-WCOPQ7L7.mjs";import{b}from"./chunk-QRLEYILE.mjs";import{a as pt}from"./chunk-SBFDOVKK.mjs";import{a as gt}from"./chunk-Z5CDCI3Y.mjs";import{a as g}from"./chunk-IXBOK5RG.mjs";import{a as J}from"./chunk-ZGXYSDXQ.mjs";import{a as rt}from"./chunk-RAG4YNTC.mjs";import{a as S}from"./chunk-2RTSC7PZ.mjs";import{a as y,f as ut}from"./chunk-JXUTUO6K.mjs";import{b as Tt}from"./chunk-BR4N3QPJ.mjs";import{d as it}from"./chunk-VJAAWEHK.mjs";import{k as st,l as et,n as nt}from"./chunk-65L5EBBL.mjs";import{a as A}from"./chunk-HORSXVIV.mjs";import{a as ft}from"./chunk-45VUJAFY.mjs";import{a as j}from"./chunk-BDKYHP5K.mjs";import{a as I}from"./chunk-QTKK6OSJ.mjs";import{a as E}from"./chunk-6FXEHNGW.mjs";import{a as It}from"./chunk-NJN53MJV.mjs";import{a as Y}from"./chunk-YSCND2MX.mjs";import{b as V,s as u,u as q}from"./chunk-VOS5UP5O.mjs";import{c as $,f as G}from"./chunk-QJSB5NX4.mjs";import{b as d}from"./chunk-VNLGNNIL.mjs";import{b as h}from"./chunk-IEJTMYFW.mjs";import{b as H,c as K,f as z}from"./chunk-R53MCZI6.mjs";import{b as vt}from"./chunk-3LBQYLDY.mjs";import{a as at}from"./chunk-Q3DOWDRB.mjs";import{a as v}from"./chunk-OJV6XRG5.mjs";import _ from"lodash.isequal";import Et from"lodash.isequal";var Nt="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",w=class e extends rt{constructor(){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.store=u();this.initialData={pendingTransactions:[],historicTransactions:[]};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 s=this.store.subscribe(async({toasts:n,transactions:i},{toasts:a,transactions:c})=>{(!Et(a.transactionToasts,n.transactionToasts)||!Et(c,i))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Nt,[s]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}handleCloseUI(){let o=p.getInstance();this.closeUI(),o.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:o,account:s,toasts:n,network:i}=this.store.getState(),{pendingTransactionToasts:a}=await C({toastList:n,transactionsSessions:o,account:s});this.data.pendingTransactions=a,this.data.historicTransactions=await ot.getTransactionsHistory({transactionsSessions:o,address:s.address,explorerAddress:i.network.explorerAddress,egldLabel:i.network.egldLabel}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){it(),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 x=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(),o=d(t),{isExpired:s}=I(o?.nativeAuthToken);s?f().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(),o=d(t),s=G(t);return!!(o?.nativeAuthToken&&s)};this.addPlannedLogout=()=>{let t=f(),o=$(this.store.getState()),s=t.getType()===v.webview;if(!o||s)return;this.addLogoutWarning();let n=d(this.store.getState()),{secondsUntilExpires:i,expiresAt:a}=I(n?.nativeAuthToken),c=new R(String(i)),r=`${o}_${a}`,m=this.plannedLogoutKey===r;if(!(i&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=r,clearTimeout(this.plannedLogoutTimeoutRef??0);let W=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},W.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},W.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=h(this.store.getState()),o=d(this.store.getState()),{secondsUntilExpires:s}=I(o?.nativeAuthToken),n=new R(String(s)),i=n.times(1e3);if(!s||n.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new R(t?.tokenExpirationToastWarningSeconds??0).times(1e3),r=n.times(1e3).minus(c),m=ct(i.toNumber()),T=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},T)}}static getInstance(){return e.instance||(e.instance=new e),e.instance}};async function U({address:e,provider:t,apiAddress:o}){let s=await E({address:e,baseURL:o});if(!s)throw new Error("Account not found");Tt({address:e,providerType:t.getType()});let n={...s,username:A(s.username),nonce:S(s)};y(n),await b(e),L(),s.shard!=null&&await mt({shard:Number(s.shard),apiAddress:o})}async function Ot(e){let{network:{apiAddress:t}}=g();await e.login();let o=await e.getAddress();if(!o)throw new Error("Address not found");return await U({address:o,provider:e,apiAddress:t}),{address:o}}async function Ft({provider:e,nativeAuthConfig:t,token:o}){let{network:{apiAddress:s}}=g(),n=j(t),i=o;i||(i=await n.initialize({noCache:!0}));let{address:a,signature:c,...r}=await e.login({token:i});if(!a)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let m=n.getToken({address:a,token:i,signature:c});V({loginToken:i,signature:c,nativeAuthToken:m});let T=await pt({loginToken:i,extraInfoData:{multisig:r?.multisig,impersonate:r?.impersonate},address:a});return await U({address:T,provider:e,apiAddress:s}),{address:T,signature:c}}async function St(e,t){let o=h(q());if(o)return await Ft({provider:e,nativeAuthConfig:o,token:t?.token});let{address:s}=await Ot(e);return await b(s),L(),{address:s}}var k={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${X}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${Q}-${Date.now()}`}},Pt={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"},Dt=e=>{for(let[t,o]of Object.entries(Pt))if(e.includes(t))return o;return"Error when signing"};function B(e,t="error"){let o=e?.message,s=Dt(o),i=s!=="Error when signing"?"warning":t,a=Object.keys(k).includes(i)?k[i]:k.error,{toastId:c,iconClassName:r,title:m}=a;return N({toastId:c,duration:1e4,icon:"times",iconClassName:r,message:s,title:m}),s}async function Ct({provider:e,transactions:t,options:o={}}){await yt();let{isGuarded:s,activeGuardianAddress:n,nonce:i}=ft(),a=e.getType()===v.ledger,c=ht({latestNonce:i,transactions:t}),r=n&&s&&!o.skipGuardian?c?.map(T=>(T.version=H.withTxOptions().valueOf(),T.options=z.withOptions({guarded:!0,...a?{hashSign:!0}:{}}).valueOf(),T.guardian=K.newFromBech32(n),T)):c,m=await e.signTransactions(r)??[];return ut(i+m.length),m}var M=class{constructor(t){this.provider=t}init(){return this.provider.init()}async login(t){let o=await St(this.provider,t);return x.getInstance().init(),o}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0,hasConsentPopup:!1}){return await lt({provider:this.provider,options:t})}setShouldShowConsentPopup(t){this.provider.setShouldShowConsentPopup?.(t)}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,o){try{return await Ct({provider:this.provider,transactions:t,options:o})}catch(s){let n=B(s);throw new Error(n)}}async signMessage(t,o){try{return await dt({provider:this.provider,message:t,options:o})}catch(s){let n=B(s,"warning");throw new Error(n)}}async verifyMessage(t){return await gt(t)}cancelLogin(){this.provider.cancelLogin?.()}};var bt=null;function ps(e){bt=e}function f(){return bt||new M(vt)}var Rt=async()=>{try{let e=J(),{network:t}=g();try{let o=await E({address:e,baseURL:t.apiAddress});if(o!=null){let s={...o,username:A(o.username),nonce:S(o)};return y(s),s}}catch(o){console.error("Failed getting account ",o)}}catch(e){console.error("Failed getting address ",e)}return null};async function yt(){let e=f();if(e==null)throw"Provider not initialized";try{if(!e.init)throw"Current provider does not have init() function";return await e.init()?Rt():void 0}catch(t){console.error("Failed initializing provider ",t)}}var O={},l={},Ut=(e,t)=>{u().setState(({toasts:o})=>{let s=o.customToasts.length>0?Math.max(...o.customToasts.map(r=>parseInt(r.toastId.split("-").pop()??"0"))):0,n=t??`custom-toast-${s+1}`,i=o.customToasts.findIndex(r=>r.toastId===n),a={...e,toastId:n};if(i!==-1){o.customToasts[i]=a;return}o.customToasts.push({...a,toastId:n})},!1,"addCustomToast")},F=e=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(o=>o.toastId!==e)},!1,"removeCustomToast")},Lt=()=>{u().setState(({toasts:e})=>{e.customToasts=[]},!1,"removeAllCustomToasts")},Ws=()=>{u().setState(({toasts:e})=>{e.transactionToasts=[]})},At=({toastId:e,totalDuration:t})=>{let o="";return u().setState(({toasts:s})=>{let n=s.transactionToasts.length>0?Math.max(...s.transactionToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0;o=e??`transaction-toast-${n+1}`,s.transactionToasts.push({startTime:Y(),endTime:It(t),toastId:o})},!1,"addTransactionToast"),o},P=e=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(o=>o.toastId!==e)},!1,"removeTransactionToast"),delete l[e],delete O[e]},N=e=>{let{toasts:t}=u().getState(),o=t.customToasts.length>0?Math.max(...t.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,s=e.toastId||`custom-toast-${o+1}`;return e.onClose&&(l[s]=e.onClose),e.instantiateToastElement?(O[s]=e.instantiateToastElement,u().setState(({toasts:n})=>{let i=n.customToasts.findIndex(r=>r.toastId===s),a={...e,instantiateToastElement:null,toastId:s};i!==-1?n.customToasts[i]=a:n.customToasts.push(a)},!1,"createCustomToast"),s):(Ut(e,s),s)};var wt=1e4,D=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=wt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let o=setTimeout(()=>{P(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,o)};this.startWithCustomDuration=(t,o)=>{if(this.stop(t),o<=0)return;let s=setTimeout(()=>{F(t);let n=l[t];n?.()},o);this.timeoutIntervals.set(t,s)};this.stop=t=>{let o=this.timeoutIntervals.get(t);o&&(clearTimeout(o),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t||wt}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=w.getInstance()}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),this.updateTransactionToastsList(),this.updateCustomToastList(),await this.subscribeToEventBusNotifications(),this.storeToastsSubscription=this.store.subscribe(({toasts:o,transactions:s},{toasts:n,transactions:i})=>{(!_(n.transactionToasts,o.transactionToasts)||!_(i,s))&&this.updateTransactionToastsList(),_(n.customToasts,o.customToasts)||this.updateCustomToastList()})}static getInstance(){return e.instance||(e.instance=new e),e.instance}handleCompletedTransaction(t){let{transactions:o}=this.store.getState(),s=o[t];if(!s)return!1;let{status:n}=s,i=nt(n),a=et(n),c=st(n),r=a||c||i;return r?(this.successfulToastLifetime&&this.lifetimeManager.start(t),r):(this.lifetimeManager.stop(t),r)}createTransactionToast(t,o){let s=At({toastId:t,totalDuration:o});return this.handleCompletedTransaction(t),this.updateTransactionToastsList(),s}createCustomToast(t){let o=N(t);return this.updateCustomToastList(),o}async updateTransactionToastsList(){let{toasts:t,transactions:o,account:s}=this.store.getState(),{pendingTransactionToasts:n,completedTransactionToasts:i}=await C({toastList:t,transactionsSessions:o,account:s});this.transactionToasts=[...n,...i];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 o of t.customToasts){let n="message"in o?{...o}:{...o,instantiateToastElement:O[o.toastId]};this.customToasts.push(n),o.duration&&this.lifetimeManager.startWithCustomDuration(o.toastId,o.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 at.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}handleTransactionToastClose(t){this.handleCompletedTransaction(t)&&P(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))})}}showToasts(){this.updateCustomToastList(),this.updateTransactionToastsList()}hideToasts(){this.transactionToasts=[],this.customToasts=[],this.eventBus?.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts),this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",this.customToasts)}async handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}handleCloseToast(t){if(this.customToasts.find(s=>s.toastId===t)){this.lifetimeManager.stop(t);let s=l[t];s?.(),F(t);return}this.handleTransactionToastClose(t)}async publishTransactionToasts(){if(!this.notificationsFeedManager.isNotificationsFeedOpen()){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(),Lt(),this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[]}};export{w as a,O as b,l as c,Ut as d,F as e,Lt as f,Ws as g,At as h,P as i,N as j,D as k,p as l,x as m,U as n,St as o,B as p,Ct as q,M as r,ps as s,f as t,yt as u};
|
|
2
|
+
//# sourceMappingURL=chunk-HM5GQ2WF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-KJT6AKOF.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-HT5DZIND.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-55W25Q35.mjs";import{a as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-55W25Q35.mjs";import{a as r}from"./chunk-4P67TGYO.mjs";import e from"lodash.isempty";var p=async({transactionsSessions:t,address:i,explorerAddress:a,egldLabel:o})=>{if(e(t))return[];let n=s(t);return r({transactions:n,address:i,explorerAddress:a,egldLabel:o})};export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HT5S5AYG.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-ATH4WYTD.mjs";import{a as o}from"./chunk-OJV6XRG5.mjs";import{a as e,b as t}from"./chunk-CA2JFJCS.mjs";import{WebviewProvider as a}from"@multiversx/sdk-webview-provider/out/WebviewProvider";var n=class extends s{constructor(r){super(r?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async r=>{if(!this.provider)throw new Error("Provider is not initialized.");try{return await this.provider.signTransactions(r)||[]}catch(i){throw this.cancelAction(),i}};this.signMessage=async r=>{if(!this.provider)throw new Error("Provider is not initialized.");try{return await this.provider.signMessage(r)}catch(i){throw this.cancelAction(),i}};this.provider=a.getInstance({resetStateCallback:()=>{e.localStorage?.clear?.(),e.sessionStorage?.clear?.()}}),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}logout(){return this.provider.logout()}getType(){return o.webview}getAddress(){throw new Error("Method not implemented.")}setAccount(r){return this.provider.setAccount(r)}isInitialized(){return this.provider.isInitialized()}async initializeProvider(){let r=await this.provider.init(t);return this.address&&this.setAccount({address:this.address}),r}};export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-IHOOASQ4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-Q3DOWDRB.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-IIBVDR56.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-CA2JFJCS.mjs";import{createJSONStorage as o}from"zustand/middleware";var r={persistReducersStorageType:"localStorage"},i=e?o(()=>e[r.persistReducersStorageType]):void 0,p=new Map;export{r as a,i as b,p as c};
|
|
2
|
+
//# sourceMappingURL=chunk-IXAT2U5R.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-FMQYLMTU.mjs";import{b as s,c as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-FMQYLMTU.mjs";import{b as s,c as r}from"./chunk-VJAAWEHK.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-JJFKKKLP.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-FKBLKOLI.mjs";import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-FKBLKOLI.mjs";import{a as s}from"./chunk-U64LDJTG.mjs";import{a as t}from"./chunk-45VUJAFY.mjs";import{u as n}from"./chunk-VOS5UP5O.mjs";import{b as e}from"./chunk-SAAOQW7P.mjs";var S=async r=>{let{isGuarded:i}=t();if(!a({isGuarded:i,transactions:r}))return r;let d=r[0].getSender().bech32().toString(),{walletAddress:c}=e(n()),o=await s({address:d,walletUrl:c});return o?.setShouldShowConsentPopup(!1),await o?.guardTransactions(r)||[]};export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JPJXXLTL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{s as c}from"./chunk-VOS5UP5O.mjs";import{a as o}from"./chunk-BRBIUWAW.mjs";var r=e=>{c().setState(({account:t})=>{let s=t.address===e.address;t.accounts={[t.address]:s?e:o}},!1,"setAccount")},u=e=>c().setState(({account:t})=>{t.ledgerAccount=e},!1,"setLedgerAccount"),p=e=>c().setState(({account:t})=>{t.walletConnectAccount=e},!1,"setWalletConnectAccount"),l=e=>c().setState(({account:t})=>{t.websocketEvent={timestamp:Date.now(),message:e}},!1,"setWebsocketEvent"),m=e=>c().setState(({account:t})=>{t.websocketBatchEvent={timestamp:Date.now(),data:e}},!1,"setWebsocketBatchEvent"),A=e=>{c().setState(({account:t})=>{t.accounts[t.address].nonce=e},!1,"setAccountNonce")};export{r as a,u as b,p as c,l as d,m as e,A as f};
|
|
2
|
+
//# sourceMappingURL=chunk-JXUTUO6K.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{u as e}from"./chunk-VOS5UP5O.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";import{a as i}from"./chunk-CKTFPRJS.mjs";var n="https://api.multiversx.com",s=60*60*24,a=5*60,d=t=>{let r=o(e());return{origin:t?.origin||i().origin,apiAddress:t?.apiAddress||r.apiAddress||n,expirySeconds:t?.expirySeconds||s,tokenExpirationToastWarningSeconds:t?.tokenExpirationToastWarningSeconds||a}};export{d as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KJT6AKOF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-HBQQS6GA.mjs";import{u as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-HBQQS6GA.mjs";import{u as m}from"./chunk-VOS5UP5O.mjs";import{b as a}from"./chunk-SAAOQW7P.mjs";import{o as s,u as o}from"./chunk-KD2IQ32V.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";async function I({tokenId:n}){let t=a(m()),r={tokenDecimals:Number(t.decimals),tokenLabel:"",tokenImageUrl:""},{isNft:k}=c(n),i=n,p=k?s:o;if(!i)return r;try{let e=await g(`${t.apiAddress}/${p}/${i}`),l=e?e?.decimals:Number(t.decimals),f=e?e?.name:"",T=e?e?.assets?.svgUrl??e?.media?.[0]?.thumbnailUrl:"";return{tokenDecimals:l,tokenLabel:f,type:e?.type,tokenImageUrl:T,identifier:e?.identifier,assets:e?.assets,esdtPrice:e?.price,ticker:e?.ticker,name:e?.name}}catch(e){return{...r,error:`${e}`}}}export{I as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KUBMPJIS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as V}from"./chunk-7Z7IX367.mjs";import{a as B}from"./chunk-VCQBYNNS.mjs";import{a as $}from"./chunk-O3V4TGXK.mjs";import{a as _}from"./chunk-AV4HSXYZ.mjs";import{a as U}from"./chunk-RBZC4PEU.mjs";import{a as R}from"./chunk-ROZAXUMC.mjs";import{a as M}from"./chunk-BETSOJFK.mjs";import{a as w}from"./chunk-YTFYVPZO.mjs";import{a as O}from"./chunk-YGI3KXMZ.mjs";import{a as x}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as V}from"./chunk-7Z7IX367.mjs";import{a as B}from"./chunk-VCQBYNNS.mjs";import{a as $}from"./chunk-O3V4TGXK.mjs";import{a as _}from"./chunk-AV4HSXYZ.mjs";import{a as U}from"./chunk-RBZC4PEU.mjs";import{a as R}from"./chunk-ROZAXUMC.mjs";import{a as M}from"./chunk-BETSOJFK.mjs";import{a as w}from"./chunk-YTFYVPZO.mjs";import{a as O}from"./chunk-YGI3KXMZ.mjs";import{a as x}from"./chunk-KUBMPJIS.mjs";import{a as v}from"./chunk-RYIJWGFA.mjs";import{t as G}from"./chunk-HM5GQ2WF.mjs";import{a as L}from"./chunk-ZJQDEYHR.mjs";import{a as h}from"./chunk-BRJNX4JF.mjs";import{a as b,c as C,f as u}from"./chunk-J4CPYFK6.mjs";import{a as P}from"./chunk-KD2IQ32V.mjs";import{c as f}from"./chunk-TI37DKBT.mjs";import{k as A}from"./chunk-LHEH7L4L.mjs";import{a as F}from"./chunk-CA2JFJCS.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-LOKAGN2M.mjs.map
|