@multiversx/sdk-dapp 5.0.0-alpha.13 → 5.0.0-alpha.14
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-26OSAWCY.mjs +2 -0
- package/out/__chunks__/chunk-2AK3JMSZ.mjs +2 -0
- package/out/__chunks__/{chunk-AQ3VAQH3.mjs → chunk-2E7KLTVM.mjs} +2 -2
- package/out/__chunks__/{chunk-ISB4SC4L.mjs → chunk-2HVZ5F32.mjs} +2 -2
- package/out/__chunks__/{chunk-NJMYFDLA.mjs → chunk-2MRUGIDM.mjs} +2 -2
- package/out/__chunks__/{chunk-QPXVUJSC.mjs → chunk-32BLYKZG.mjs} +2 -2
- package/out/__chunks__/{chunk-HIODLP5F.mjs → chunk-445KR45K.mjs} +2 -2
- package/out/__chunks__/{chunk-HPLSDK5V.mjs → chunk-4DI7PQFP.mjs} +2 -2
- package/out/__chunks__/chunk-4F4TBUGV.mjs +2 -0
- package/out/__chunks__/{chunk-EGU5LABV.mjs → chunk-5AFXH6GE.mjs} +2 -2
- package/out/__chunks__/{chunk-SHFT3OJY.mjs → chunk-5FEICWMB.mjs} +2 -2
- package/out/__chunks__/{chunk-EUXN5BLO.mjs → chunk-5YVI2NQR.mjs} +2 -2
- package/out/__chunks__/{chunk-KWJVDPCC.mjs → chunk-6IQVZPSC.mjs} +2 -2
- package/out/__chunks__/chunk-6JD2RV7R.mjs +2 -0
- package/out/__chunks__/{chunk-L4762ZRT.mjs → chunk-7UYT6KTI.mjs} +2 -2
- package/out/__chunks__/{chunk-AKFSBZ46.mjs → chunk-A77C5T7Q.mjs} +2 -2
- package/out/__chunks__/chunk-AIDEMTSX.mjs +2 -0
- package/out/__chunks__/{chunk-NONAAAZC.mjs.map → chunk-AIDEMTSX.mjs.map} +1 -1
- package/out/__chunks__/{chunk-FFEFZVCC.mjs → chunk-BVKXSTQF.mjs} +2 -2
- package/out/__chunks__/chunk-DZYZMEIP.mjs +2 -0
- package/out/__chunks__/chunk-EEPC4DL4.mjs +2 -0
- package/out/__chunks__/{chunk-XSJE7M77.mjs → chunk-EGTBRUST.mjs} +2 -2
- package/out/__chunks__/{chunk-A343RP4X.mjs → chunk-EWT7FW5B.mjs} +2 -2
- package/out/__chunks__/{chunk-U5IR3XBA.mjs → chunk-EZTYSZGL.mjs} +2 -2
- package/out/__chunks__/{chunk-ER735UVF.mjs → chunk-FEBWXMEQ.mjs} +2 -2
- package/out/__chunks__/{chunk-TXQO3M7J.mjs → chunk-FO3JMB6I.mjs} +2 -2
- package/out/__chunks__/chunk-GYKOIGBE.mjs +2 -0
- package/out/__chunks__/{chunk-PGOE5XGR.mjs → chunk-GYUFALJV.mjs} +2 -2
- package/out/__chunks__/{chunk-3UIJI5YR.mjs → chunk-HL3U3QQR.mjs} +2 -2
- package/out/__chunks__/{chunk-5V5MG3BL.mjs → chunk-HQSRSRDM.mjs} +2 -2
- package/out/__chunks__/{chunk-Y5Y2WOCZ.mjs → chunk-HUQ6AJBO.mjs} +2 -2
- package/out/__chunks__/{chunk-Q6NDAYER.mjs → chunk-HYRRZX3A.mjs} +2 -2
- package/out/__chunks__/chunk-I6KLJQ6O.mjs +2 -0
- package/out/__chunks__/{chunk-57B6Q67I.mjs → chunk-IBIFKTAD.mjs} +2 -2
- package/out/__chunks__/{chunk-YILGIHY5.mjs → chunk-INLU2YOE.mjs} +2 -2
- package/out/__chunks__/{chunk-RIH7QM6W.mjs → chunk-ISQDJSDA.mjs} +2 -2
- package/out/__chunks__/chunk-JHDJG624.mjs +2 -0
- package/out/__chunks__/{chunk-GXUJBKWY.mjs → chunk-JN4ENKZ6.mjs} +2 -2
- package/out/__chunks__/{chunk-ED5SQUAW.mjs → chunk-JTE52R3D.mjs} +2 -2
- package/out/__chunks__/chunk-JWW3XX4N.mjs +2 -0
- package/out/__chunks__/{chunk-JGFDKHG2.mjs → chunk-K6K2SOWR.mjs} +2 -2
- package/out/__chunks__/{chunk-77IZTIMY.mjs → chunk-K6KK466Z.mjs} +2 -2
- package/out/__chunks__/{chunk-Q56GIIOP.mjs → chunk-KYJF7WU3.mjs} +2 -2
- package/out/__chunks__/{chunk-UZUI4AP5.mjs → chunk-LNZQ2M65.mjs} +2 -2
- package/out/__chunks__/{chunk-EKMRPW2A.mjs → chunk-LZW6D5GQ.mjs} +2 -2
- package/out/__chunks__/chunk-MMTACNKE.mjs +2 -0
- package/out/__chunks__/{chunk-HVUNMCAO.mjs → chunk-MTBXLPH7.mjs} +2 -2
- package/out/__chunks__/{chunk-3RBYJZII.mjs → chunk-NCH5TP7V.mjs} +2 -2
- package/out/__chunks__/chunk-NJQKLGPR.mjs +2 -0
- package/out/__chunks__/{chunk-LDETTRYB.mjs → chunk-O7FXZNDF.mjs} +2 -2
- package/out/__chunks__/{chunk-QNKYH6KO.mjs → chunk-PFCHZJJO.mjs} +2 -2
- package/out/__chunks__/{chunk-S4LN2NQH.mjs → chunk-PZLVK2W5.mjs} +2 -2
- package/out/__chunks__/chunk-QVJFFSJF.mjs +2 -0
- package/out/__chunks__/{chunk-RJSL5ONQ.mjs → chunk-QY5O4PX2.mjs} +2 -2
- package/out/__chunks__/{chunk-IEWH5GDM.mjs → chunk-RJZOP6PK.mjs} +2 -2
- package/out/__chunks__/{chunk-3XCB5CEW.mjs → chunk-RWZQKTSO.mjs} +2 -2
- package/out/__chunks__/{chunk-XDH23MRS.mjs → chunk-SJ34PIXB.mjs} +2 -2
- package/out/__chunks__/{chunk-JF4GVWO4.mjs → chunk-SJEC4QGU.mjs} +2 -2
- package/out/__chunks__/chunk-SKITNSPD.mjs +2 -0
- package/out/__chunks__/{chunk-LEBVS2YF.mjs → chunk-SPVT5OQ4.mjs} +2 -2
- package/out/__chunks__/{chunk-3ATEIVW3.mjs → chunk-SQ4KCFCC.mjs} +2 -2
- package/out/__chunks__/{chunk-AM6BSOYA.mjs → chunk-SS6PDIDN.mjs} +2 -2
- package/out/__chunks__/{chunk-VO4DXDYI.mjs → chunk-SXXJRX5W.mjs} +2 -2
- package/out/__chunks__/{chunk-LYXQ3FWU.mjs → chunk-TKORCVYO.mjs} +2 -2
- package/out/__chunks__/chunk-V4SLVI67.mjs +2 -0
- package/out/__chunks__/{chunk-53JZ6ZBD.mjs → chunk-WLQ2BIPH.mjs} +2 -2
- package/out/__chunks__/{chunk-KGASLT4P.mjs → chunk-WR5VO5DQ.mjs} +2 -2
- package/out/__chunks__/{chunk-GOL32UNC.mjs → chunk-X4TJQCRA.mjs} +2 -2
- package/out/__chunks__/chunk-XIOTX2GI.mjs +2 -0
- package/out/__chunks__/{chunk-65RXDHRY.mjs → chunk-XKQ7QLV3.mjs} +2 -2
- package/out/__chunks__/{chunk-QVLQCJFN.mjs → chunk-YXNXSK5J.mjs} +2 -2
- package/out/__chunks__/{chunk-HTAH342B.mjs → chunk-Z6RETW2C.mjs} +2 -2
- package/out/__chunks__/{chunk-W46BAMEI.mjs → chunk-ZB22PQZV.mjs} +2 -2
- package/out/__chunks__/chunk-ZRPLCZ4L.mjs +2 -0
- package/out/__chunks__/{chunk-6H5TKCEW.mjs → chunk-ZTSHJT5H.mjs} +2 -2
- 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/core/providers/DappProvider/helpers/login/helpers/refreshNativeAuthTokenLogin.mjs +1 -1
- package/out/index.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/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/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/WebviewProviderStrategy.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/index.mjs +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.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +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/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/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 +2 -2
- package/out/__chunks__/chunk-2ZNIPYEV.mjs +0 -2
- package/out/__chunks__/chunk-35ED7YL2.mjs +0 -2
- package/out/__chunks__/chunk-47CCSYQY.mjs +0 -2
- package/out/__chunks__/chunk-7ZW5EZFP.mjs +0 -2
- package/out/__chunks__/chunk-AGHFAZ7O.mjs +0 -2
- package/out/__chunks__/chunk-CTW5DICC.mjs +0 -2
- package/out/__chunks__/chunk-DCCGXGUQ.mjs +0 -2
- package/out/__chunks__/chunk-DDXGTNBZ.mjs +0 -2
- package/out/__chunks__/chunk-IYAIXP65.mjs +0 -2
- package/out/__chunks__/chunk-LIFPBQTL.mjs +0 -2
- package/out/__chunks__/chunk-NONAAAZC.mjs +0 -2
- package/out/__chunks__/chunk-NQQQKXT2.mjs +0 -2
- package/out/__chunks__/chunk-RNYSLFYZ.mjs +0 -2
- package/out/__chunks__/chunk-RUG7JMMB.mjs +0 -2
- package/out/__chunks__/chunk-SBZ2AN3R.mjs +0 -2
- package/out/__chunks__/chunk-T3VFM2QO.mjs +0 -2
- package/out/__chunks__/chunk-VYWLQ5T7.mjs +0 -2
- package/out/__chunks__/chunk-XBVPYKPZ.mjs +0 -2
- /package/out/__chunks__/{chunk-35ED7YL2.mjs.map → chunk-26OSAWCY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SBZ2AN3R.mjs.map → chunk-2AK3JMSZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AQ3VAQH3.mjs.map → chunk-2E7KLTVM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ISB4SC4L.mjs.map → chunk-2HVZ5F32.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NJMYFDLA.mjs.map → chunk-2MRUGIDM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QPXVUJSC.mjs.map → chunk-32BLYKZG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HIODLP5F.mjs.map → chunk-445KR45K.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HPLSDK5V.mjs.map → chunk-4DI7PQFP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RNYSLFYZ.mjs.map → chunk-4F4TBUGV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EGU5LABV.mjs.map → chunk-5AFXH6GE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SHFT3OJY.mjs.map → chunk-5FEICWMB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EUXN5BLO.mjs.map → chunk-5YVI2NQR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KWJVDPCC.mjs.map → chunk-6IQVZPSC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DCCGXGUQ.mjs.map → chunk-6JD2RV7R.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-L4762ZRT.mjs.map → chunk-7UYT6KTI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AKFSBZ46.mjs.map → chunk-A77C5T7Q.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FFEFZVCC.mjs.map → chunk-BVKXSTQF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DDXGTNBZ.mjs.map → chunk-DZYZMEIP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XBVPYKPZ.mjs.map → chunk-EEPC4DL4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XSJE7M77.mjs.map → chunk-EGTBRUST.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-A343RP4X.mjs.map → chunk-EWT7FW5B.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-U5IR3XBA.mjs.map → chunk-EZTYSZGL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ER735UVF.mjs.map → chunk-FEBWXMEQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TXQO3M7J.mjs.map → chunk-FO3JMB6I.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AGHFAZ7O.mjs.map → chunk-GYKOIGBE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PGOE5XGR.mjs.map → chunk-GYUFALJV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3UIJI5YR.mjs.map → chunk-HL3U3QQR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5V5MG3BL.mjs.map → chunk-HQSRSRDM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Y5Y2WOCZ.mjs.map → chunk-HUQ6AJBO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Q6NDAYER.mjs.map → chunk-HYRRZX3A.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LIFPBQTL.mjs.map → chunk-I6KLJQ6O.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-57B6Q67I.mjs.map → chunk-IBIFKTAD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YILGIHY5.mjs.map → chunk-INLU2YOE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RIH7QM6W.mjs.map → chunk-ISQDJSDA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2ZNIPYEV.mjs.map → chunk-JHDJG624.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GXUJBKWY.mjs.map → chunk-JN4ENKZ6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ED5SQUAW.mjs.map → chunk-JTE52R3D.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CTW5DICC.mjs.map → chunk-JWW3XX4N.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JGFDKHG2.mjs.map → chunk-K6K2SOWR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-77IZTIMY.mjs.map → chunk-K6KK466Z.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Q56GIIOP.mjs.map → chunk-KYJF7WU3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UZUI4AP5.mjs.map → chunk-LNZQ2M65.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EKMRPW2A.mjs.map → chunk-LZW6D5GQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-T3VFM2QO.mjs.map → chunk-MMTACNKE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HVUNMCAO.mjs.map → chunk-MTBXLPH7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3RBYJZII.mjs.map → chunk-NCH5TP7V.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VYWLQ5T7.mjs.map → chunk-NJQKLGPR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LDETTRYB.mjs.map → chunk-O7FXZNDF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QNKYH6KO.mjs.map → chunk-PFCHZJJO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-S4LN2NQH.mjs.map → chunk-PZLVK2W5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RUG7JMMB.mjs.map → chunk-QVJFFSJF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RJSL5ONQ.mjs.map → chunk-QY5O4PX2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IEWH5GDM.mjs.map → chunk-RJZOP6PK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3XCB5CEW.mjs.map → chunk-RWZQKTSO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XDH23MRS.mjs.map → chunk-SJ34PIXB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JF4GVWO4.mjs.map → chunk-SJEC4QGU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7ZW5EZFP.mjs.map → chunk-SKITNSPD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LEBVS2YF.mjs.map → chunk-SPVT5OQ4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3ATEIVW3.mjs.map → chunk-SQ4KCFCC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AM6BSOYA.mjs.map → chunk-SS6PDIDN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VO4DXDYI.mjs.map → chunk-SXXJRX5W.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LYXQ3FWU.mjs.map → chunk-TKORCVYO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NQQQKXT2.mjs.map → chunk-V4SLVI67.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-53JZ6ZBD.mjs.map → chunk-WLQ2BIPH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KGASLT4P.mjs.map → chunk-WR5VO5DQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GOL32UNC.mjs.map → chunk-X4TJQCRA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-47CCSYQY.mjs.map → chunk-XIOTX2GI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-65RXDHRY.mjs.map → chunk-XKQ7QLV3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QVLQCJFN.mjs.map → chunk-YXNXSK5J.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HTAH342B.mjs.map → chunk-Z6RETW2C.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-W46BAMEI.mjs.map → chunk-ZB22PQZV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IYAIXP65.mjs.map → chunk-ZRPLCZ4L.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6H5TKCEW.mjs.map → chunk-ZTSHJT5H.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-LZW6D5GQ.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-2E7KLTVM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as B}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as B}from"./chunk-NJQKLGPR.mjs";import{a as b}from"./chunk-KYJF7WU3.mjs";import{a as k}from"./chunk-QXC4D3AC.mjs";import{a as R}from"./chunk-OD4ANAAQ.mjs";import{a as D}from"./chunk-YXNXSK5J.mjs";import{a as I}from"./chunk-AV4HSXYZ.mjs";import{a as j}from"./chunk-YTFYVPZO.mjs";import{a as _}from"./chunk-HL3U3QQR.mjs";import{a as O}from"./chunk-A77C5T7Q.mjs";import{a as x}from"./chunk-QVJFFSJF.mjs";import{u as A}from"./chunk-GYUFALJV.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-J4CPYFK6.mjs";import{a as w}from"./chunk-R53MCZI6.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard:C,username:E}}=B(),g=v(A()),h=x(),{allTransactions:e,parsedTransactionsByDataField:L}=R(z),p=[],n=O.getInstance();if(await n.openUI(),!n)throw new Error("Unable to establish connection with sign screens");let W=async()=>{await b(),n.closeUI()};return n.subscribeToEventBus("CLOSE_SIGN_TRANSACTIONS",W),new Promise(async(X,M)=>{let d=[],Y=await k({baseURL:g.apiAddress});n.notifyDataUpdate(),n.initializeGasPriceMap(e.map(t=>t.transaction));let l=Y?.price,a=0,T=async()=>{let r=e[a]?.transaction,i=Number(r.nonce);n.updateIsLoading(!0);let{commonData:c,tokenTransaction:o,fungibleTransaction:s}=await D({allTransactions:e,currentScreenIndex:a,egldLabel:h,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:C,signedIndexes:p,parsedTransactionsByDataField:L});n.updateIsLoading(!1),o&&n.updateTokenTransaction(o),s&&n.updateNonFungibleTransaction(s.type,s),n.updateCommonData(c)},q=()=>{a>0&&(a--,T())},J=(t=0)=>{let i=e[a].transaction,c=Number(i.nonce);n.updateGasPriceMap({nonce:c,ppu:t}),n.updateCommonData({ppu:t});let o=i.toPlainObject(),s=I({transaction:o,gasPriceData:n.ppuMap[c]}),P=w.newFromPlainObject({...o,gasPrice:s}),u=j({transaction:P,price:l}),m=F({input:s.toString(),decimals:U,addCommas:!0,digits:G});n.updateCommonData({feeLimit:u.feeLimitFormatted,feeInFiatLimit:u.feeInFiatLimit,gasPrice:m,ppu:t})},Q=async()=>{M(new Error("Transaction signing cancelled by user")),await b(),n.closeUI()},f=()=>{a<n.transactionsCount-1&&(a++,T())},V=async()=>{let r=e[a].transaction,i=Number(r.nonce),{commonData:c}=await D({allTransactions:e,currentScreenIndex:a,egldLabel:h,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:C,signedIndexes:p,parsedTransactionsByDataField:L});if(!c.needsSigning)return p.push(a),f();let o=r.toPlainObject(),s=o.nonce,P=I({transaction:o,gasPriceData:n.ppuMap[s]}),u=w.newFromPlainObject({...o,gasPrice:P});try{let m=await H([u]);m&&(p.push(a),d.push(m[0]));let nn=a===e.length-1,an=e.filter(S=>S.needsSigning),tn=d.length===an.length;if(nn&&tn){let S=await K(d);return n.closeUI(),X(S)}f()}catch(m){n.closeUI(),M(m)}},Z=new Map([["NEXT_SIGN_TRANSACTIONS",f],["CONFIRM_SIGN_TRANSACTIONS",V],["CLOSE_SIGN_TRANSACTIONS",Q],["BACK_SIGN_TRANSACTIONS",q],["SET_PPU_SIGN_TRANSACTIONS",J]]);function $(){for(let[t,r]of Z)n.subscribeToEventBus(t,r)}$(),await T()})}export{Dn as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2HVZ5F32.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as o,f as a,g as i,h as r}from"./chunk-TQA3JDNV.mjs";import{u as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as o,f as a,g as i,h as r}from"./chunk-TQA3JDNV.mjs";import{u as c}from"./chunk-GYUFALJV.mjs";function b(){let t=c(),l=r(t),u=i(t),T=a(t),d=o(t),e=Object.keys(d)?.length>0,n=!e&&Object.keys(l)?.length>0,s=!e&&!n&&Object.keys(u)?.length>0,f=!e&&!n&&!s&&Object.keys(T).length>0;return{pending:e,timedOut:n,fail:s,success:f}}export{b as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2MRUGIDM.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-XIOTX2GI.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-32BLYKZG.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-GYUFALJV.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-445KR45K.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-AIDEMTSX.mjs";function t(){if(!e)return"";try{if(e.document.referrer)return new URL(e.document.referrer).origin;let r=e.location.ancestorOrigins;return r.length<1?"":new URL(r[r.length-1]).origin}catch(r){return console.error(r),""}}export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4DI7PQFP.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-WLQ2BIPH.mjs";import o from"axios";var n="transactions/ppu";async function l(a,s){let r=`${e(s)}/${n}/${a}`;try{let{data:t}=await o.get(r);return t?{[a]:{lastBlock:t.lastBlock,fast:t.fast,faster:t.faster}}:null}catch(t){return console.error("Error fetching gas station metadata from:",r,t),null}}export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5AFXH6GE.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-O7FXZNDF.mjs";import{a as c}from"./chunk-I3MK6KZJ.mjs";var f=async({receiver:n,sender:i,tokenId:s})=>{let t=null,r=null;if(!s)return{senderLockedAccount:t,receiverLockedAccount:r};try{let o=(await l({tokenId:s}))?.assets?.lockedAccounts;if(!o)return{senderLockedAccount:t,receiverLockedAccount:r};for(let e in o)if(c(e)&&(i===e&&(t=e),n===e&&(r=e)),c(o[e])&&(i===o[e]&&(t=o[e]),n===o[e]&&(r=o[e])),t&&r)return{senderLockedAccount:t,receiverLockedAccount:r}}catch(a){console.error("Error getting token details",a)}return{senderLockedAccount:t,receiverLockedAccount:r}};export{f as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5FEICWMB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as N}from"./chunk-Q2Q4XN4M.mjs";import{b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as N}from"./chunk-Q2Q4XN4M.mjs";import{b}from"./chunk-INLU2YOE.mjs";import{d as C,e as I}from"./chunk-EWT7FW5B.mjs";import{s as p}from"./chunk-GYUFALJV.mjs";import{b as E}from"./chunk-SAAOQW7P.mjs";import{a as y}from"./chunk-MGQ373AO.mjs";import{b as t}from"./chunk-GGBMHKR4.mjs";import{io as L}from"socket.io-client";var U=3e3,d=3,k=500,W=1e3,M=1e3,S="batchUpdated",w="connect",O="connect_error",A="disconnect";async function K(l){let{apiAddress:_,websocketUrl:g}=E(p().getState());if(!l)throw new Error("Websocket could not be initialized: address missing");let o=null,n=null,c=e=>{t.status=e,b(e)},R=e=>{o&&clearTimeout(o),o=setTimeout(()=>{C(e)},W)},h=e=>{n&&clearTimeout(n),n=setTimeout(()=>{I(e)},W)},D=()=>{let e=t.instance;e&&(e.off(O),e.off(w),e.off(S),e.off(A),e.close(),console.log("Websocket disconnected.")),c("not_initialized"),t.instance=null,o&&clearTimeout(o),n&&clearTimeout(n)},m=y(async()=>{let e=async(i=d,a=k)=>{let f=0,r=null,s=null,T=async()=>{if(f>=i){console.warn("WebSocket reconnection failed after max attempts."),c("not_initialized");return}f++,t.instance?.off(),t.instance?.close(),t.instance=null;try{await m(),r=setTimeout(()=>{t.instance?.connected||(s=setTimeout(T,a))},M)}catch{s=setTimeout(T,a)}};return T(),()=>{r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null)}};c("pending");let u=g??await N(_);if(!u){c("not_initialized");return}t.instance=L(u,{forceNew:!0,reconnection:!0,reconnectionAttempts:d,timeout:U,query:{address:l}}),t.instance.onAny(R),t.instance.on(S,h),t.instance.on(w,()=>{console.log("Websocket connected."),c("completed")}),t.instance.on(O,async i=>{console.warn("Websocket connect error: ",i.message),(await e())()}),t.instance.on(A,async()=>{console.warn("Websocket disconnected. Trying to reconnect..."),(await e())()})},{retries:2,delay:k});return t.status==="not_initialized"&&!t.instance?.active&&await m(),{closeConnection:D}}export{K as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5YVI2NQR.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-SS6PDIDN.mjs";async function i(a){let n=e.getInstance();return await n.openUI(),{manager:n,onClose:async({shouldCancelAction:t=!0}={})=>{n.closeUI(),t&&a?.cancelAction&&await a.cancelAction()}}}export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6IQVZPSC.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-GYUFALJV.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-7UYT6KTI.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-SQ4KCFCC.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-A77C5T7Q.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.14'; // 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 g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-ZRPLCZ4L.mjs";import{a as k}from"./chunk-I6KLJQ6O.mjs";import{s as f}from"./chunk-GYUFALJV.mjs";import{d as b}from"./chunk-QJSB5NX4.mjs";import{c as n}from"./chunk-HYRRZX3A.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-BVKXSTQF.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-GYUFALJV.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-EGTBRUST.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{s as c}from"./chunk-GYUFALJV.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-EWT7FW5B.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-AIDEMTSX.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-EZTYSZGL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-X4TJQCRA.mjs";import{a as o}from"./chunk-OJV6XRG5.mjs";import{a as e,b as t}from"./chunk-AIDEMTSX.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-FEBWXMEQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{s as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{s as u}from"./chunk-GYUFALJV.mjs";import{a as c}from"./chunk-SQVKVA7X.mjs";import{a as i}from"./chunk-ULUZWP2P.mjs";var e=o=>u().setState(({network:r})=>{r.network={...r.network,...o}},!1,"initializeNetworkConfig");var y=async({customNetworkConfig:o={},environment:r})=>{let d=!o?.skipFetchFromServer,g=o?.apiAddress,n=r&&r in i,p=n?i[r]:{},s={...c,...p,...o},t={...s,apiTimeout:String(s.apiTimeout)},N=p?.apiAddress;if(!n&&d){let a=g||N,m=await w(a),f=t.roundDuration?null:await l(a);if(f!=null&&(t.roundDuration=f.erd_round_duration),m!=null){let k={...t,...m,...o};return e(k),k}}return e(t),t};export{y as a,e as b};
|
|
2
|
+
//# sourceMappingURL=chunk-FO3JMB6I.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as a}from"./chunk-VNLGNNIL.mjs";import{b as s,f as l}from"./chunk-QJSB5NX4.mjs";import{a as v}from"./chunk-KRWR77QE.mjs";import{a as g,b as c}from"./chunk-7BP53CXF.mjs";import{a as f,b as m}from"./chunk-X4XULIVT.mjs";import{a as T}from"./chunk-SUN3MVLZ.mjs";import{b as y}from"./chunk-A7FTKX2A.mjs";import{a as S,b as u}from"./chunk-VKEESSBI.mjs";import{a as x}from"./chunk-2DNGCNYM.mjs";import{a as I}from"./chunk-NB7A4C7L.mjs";import{a as d,b as L}from"./chunk-NLRDRI7Q.mjs";import{a as k}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{f as a}from"./chunk-VNLGNNIL.mjs";import{b as s,f as l}from"./chunk-QJSB5NX4.mjs";import{a as v}from"./chunk-KRWR77QE.mjs";import{a as g,b as c}from"./chunk-7BP53CXF.mjs";import{a as f,b as m}from"./chunk-X4XULIVT.mjs";import{a as T}from"./chunk-SUN3MVLZ.mjs";import{b as y}from"./chunk-A7FTKX2A.mjs";import{a as S,b as u}from"./chunk-VKEESSBI.mjs";import{a as x}from"./chunk-2DNGCNYM.mjs";import{a as I}from"./chunk-NB7A4C7L.mjs";import{a as d,b as L}from"./chunk-NLRDRI7Q.mjs";import{a as k}from"./chunk-V4SLVI67.mjs";import{c as p}from"./chunk-R53MCZI6.mjs";import{createJSONStorage as h,devtools as O,persist as V}from"zustand/middleware";import{immer as H}from"zustand/middleware/immer";import{createStore as N}from"zustand/vanilla";var A=e=>{e.account=g,e.loginInfo=f,e.transactions=d,e.toasts=S};function R(){return new Date().setHours(new Date().getHours()+24)}function w(e){if(e==null){E();return}b(e)}var C=e=>{let t=l(e),n=a(e),{address:i,publicKey:M}=s(e);if(i&&M!==new p(i).hex()&&A(e),!t)return;if(n==null){w(R());return}let P=Date.now();n-P<0&&(w(null),o().setState(A))};var W=(e,t)=>{C(e)};var z=e=>{let t=N(O(V(H((...n)=>({network:x(...n),account:c(...n),loginInfo:m(...n),config:T(...n),transactions:L(...n),toasts:u(...n),cache:y(...n),ui:I(...n)})),{name:"sdk-dapp-store",storage:h(e)})));return t.subscribe(W),t},r,D=e=>{r=e},o=()=>(r||D(z(()=>new v)),r),ae=(e=k)=>D(z(e)),pe=()=>o().getState();var fe=e=>o().setState(({loginInfo:t})=>{t.providerType=e},!1,"setProviderType"),me=e=>o().setState(({loginInfo:t})=>{t.tokenLogin=e},!1,"setTokenLogin"),Se=e=>o().setState(({loginInfo:t})=>{if(t.tokenLogin!=null){t.tokenLogin.loginToken=e;return}t.tokenLogin={loginToken:e}},!1,"setLoginToken"),ue=e=>o().setState(({loginInfo:t})=>{t?.tokenLogin!=null&&(t.tokenLogin.signature=e)},!1,"setTokenLoginSignature"),de=e=>o().setState(({loginInfo:t})=>{t.walletLogin=e},!1,"setWalletLogin"),Le=e=>o().setState(({loginInfo:t})=>{t.walletConnectLogin=e},!1,"setWalletConnectLogin"),xe=e=>o().setState(({loginInfo:t})=>{t.ledgerLogin=e},!1,"setLedgerLogin"),Te=e=>o().setState(({loginInfo:t})=>{t.logoutRoute=e},!1,"setLogoutRoute"),ye=e=>o().setState(({loginInfo:t})=>{t.isWalletConnectV2Initialized=e},!1,"setIsWalletConnectV2Initialized"),E=()=>o().setState(({loginInfo:e})=>{e.loginExpiresAt=null},!1,"removeLoginExpiresAt"),b=e=>o().setState(({loginInfo:t})=>{t.loginExpiresAt=e},!1,"addLoginExpiresAt");export{fe as a,me as b,Se as c,ue as d,de as e,Le as f,xe as g,Te as h,ye as i,E as j,b as k,A as l,R as m,w as n,C as o,W as p,z as q,D as r,o as s,ae as t,pe as u};
|
|
2
|
+
//# sourceMappingURL=chunk-GYUFALJV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-SPSO2A53.mjs";import{a}from"./chunk-FKBLKOLI.mjs";import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-SPSO2A53.mjs";import{a}from"./chunk-FKBLKOLI.mjs";import{a as t}from"./chunk-6JD2RV7R.mjs";import{u as n}from"./chunk-GYUFALJV.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-HL3U3QQR.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as s}from"./chunk-SXXJRX5W.mjs";import{a as p}from"./chunk-SQ4KCFCC.mjs";import{u as c}from"./chunk-GYUFALJV.mjs";import{b as d}from"./chunk-SAAOQW7P.mjs";import{a as v}from"./chunk-REI3WYXH.mjs";import{a}from"./chunk-OJV6XRG5.mjs";var n=class n 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&&n.onClose&&n.onClose(),this.closeUI()};this.handleLogin=async({type:e,anchor:o})=>{if(!n.loginHandler)throw new Error("Login callback not initialized. Please call `init()` first.");try{this.isSimpleLoginCallback(n.loginHandler)?(await(await s.create({type:e,anchor:o})).login(),n.loginHandler()):n.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 s.destroy()};this.isSimpleLoginCallback=e=>e.length===0;this.data=this.initialData}static getInstance(){return n.instance||(n.instance=new n),n.instance}static init(e){return this.loginHandler=e.loginHandler,this.allowedProviders=e.allowedProviders,e.onClose&&(this.onClose=e.onClose),this.getInstance()}getProvidersList(){let e=s.customProviders,r=[...Object.values(a).filter(i=>i!==a.none&&i!==a.webview),...e.map(i=>i.type)],P=e.reduce((i,t)=>(i[t.type]=t.name,i),{}),l={...v,...P};return(n.allowedProviders?n?.allowedProviders.map(i=>i.type).filter(i=>r.includes(i)):r).map(i=>{let t=e.find(g=>g.type===i);return t||{name:i in l?l[i]:i,type:i}})}};n.loginHandler=null,n.onClose=null,n.allowedProviders=null;var u=n;export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HQSRSRDM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-4DI7PQFP.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-HUQ6AJBO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-AIDEMTSX.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-HYRRZX3A.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as o}from"./chunk-Z6RETW2C.mjs";import{b as s}from"./chunk-TQA3JDNV.mjs";import{u as n}from"./chunk-GYUFALJV.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-I6KLJQ6O.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-NCH5TP7V.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-IBIFKTAD.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-GYUFALJV.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-INLU2YOE.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-JN4ENKZ6.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-ISQDJSDA.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-L3MWDI6J.mjs";import{s as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-L3MWDI6J.mjs";import{s as i}from"./chunk-GYUFALJV.mjs";var g=({transactions:s,transactionsDisplayInfo:a,status:e,sessionInformation:t})=>{let o=Date.now().toString();return i().setState(({transactions:n})=>{n[o]={transactions:s,status:e,transactionsDisplayInfo:a,interpretedTransactions:{},sessionInformation:t}},!1,"createTransactionsSession"),o},T=({sessionId:s,status:a,errorMessage:e})=>{i().setState(({transactions:t})=>{t[s].status=a,t[s].errorMessage=e},!1,"updateTransactionsSession")},y=({sessionId:s,transaction:a})=>{let e=null;return i().setState(({transactions:t})=>{let o=t[s]?.transactions;if(o!=null){t[s].transactions=o.map(r=>r.hash===a.hash?{...r,...a??{}}:r);let n=u([...t[s].transactions]);n&&(T({sessionId:s,status:n}),e=n)}},!1,"updateTransactionStatus"),e},h=()=>{i().setState(({transactions:s,toasts:a})=>{let t=Object.keys(s).filter(n=>{let r=s[n];if(!r)return!1;let{status:c}=r;return!(c==="pending"||c==="signed"||c==="sent")});t.forEach(n=>{delete s[n]});let o=a.transactionToasts.filter(n=>!t.includes(n.toastId));a.transactionToasts=o},!1,"clearCompletedTransactions")};export{g as a,T as b,y as c,h as d};
|
|
2
|
+
//# sourceMappingURL=chunk-JN4ENKZ6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-5AFXH6GE.mjs";import{b as r}from"./chunk-FO3JMB6I.mjs";import{u as i}from"./chunk-GYUFALJV.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";async function M({shard:t,apiAddress:s}){if(t!=null)try{let a=await n(t,s);if(!a?.[t]?.lastBlock)return;let e=o(i());(!e.gasStationMetadata||!e.gasStationMetadata[t]||e.gasStationMetadata[t].lastBlock!==a[t].lastBlock)&&r({...e,gasStationMetadata:{...e.gasStationMetadata,...a}})}catch(a){console.error("Error fetching gas station metadata:",a)}}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JTE52R3D.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-WR5VO5DQ.mjs";import{a as s}from"./chunk-32BLYKZG.mjs";import{a as k}from"./chunk-3OKWBJFM.mjs";import{a as L}from"./chunk-SKITNSPD.mjs";import{b as A}from"./chunk-EWT7FW5B.mjs";import{a as I}from"./chunk-BRJNX4JF.mjs";import{g as p}from"./chunk-GYUFALJV.mjs";import{a as f}from"./chunk-KD2IQ32V.mjs";import{a as x}from"./chunk-OJV6XRG5.mjs";import{BigNumber as C}from"bignumber.js";async function M({options:d,config:i,provider:a,login:c}){let e=h.getInstance(),T=L(),b=k({loginToken:d?.token,version:i.version}),o={manager:e,provider:a};await s(o);let t=await new Promise(async function(E,w){async function g(r){let n=e?e.addressesPerPage??1:1,l=new C(r-1).times(n);e?.updateStartIndex(Math.max(0,parseInt(l.toString()))),await s(o)}async function u(r){if(!(!a||!c)){e?.updateConfirmScreen({...b,selectedAddress:r.selectedAddress,explorerLink:I({to:`/${f}/${r.selectedAddress}`,explorerAddress:T})});try{let n=d?.token?await a.tokenLogin({token:Buffer.from(`${d?.token}{}`),addressIndex:r.addressIndex}):await c({addressIndex:r.addressIndex});E({address:n.address,signature:n.signature?n.signature.toString("hex"):"",addressIndex:r.addressIndex})}catch(n){console.error("User rejected login:",n),!!e?.getConfirmScreenData()&&await s(o)}}}async function m(){await s(o),e.unsubscribeFromAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g}),w("User cancelled login")}e.subscribeToAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g})}),{version:P,dataEnabled:v}=i;return p({index:t.addressIndex,loginType:x.ledger}),A({address:t.address,index:t.addressIndex,version:P,hasContractDataEnabled:v}),{address:t.address,signature:t.signature}}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-K6K2SOWR.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-JHDJG624.mjs";import{c as o,g as n}from"./chunk-R53MCZI6.mjs";import{a as r}from"./chunk-OJV6XRG5.mjs";async function M({message:i,provider:s,options:e}){let t=a(),d=new n({address:new o(t),data:i.data});return e?.hasConsentPopup&&s.getType()===r.crossWindow&&s.setShouldShowConsentPopup(!0),await s.signMessage(d,e)}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-K6KK466Z.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{t as n}from"./chunk-PFCHZJJO.mjs";import{a as i}from"./chunk-OJV6XRG5.mjs";var e=async()=>{let o=n();if(o.getType()===i.crossWindow){let r=o;await r.cancelAction(),await r.dispose()}};export{e as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KYJF7WU3.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-SKITNSPD.mjs";import{a as f}from"./chunk-QVJFFSJF.mjs";import{j as m,k as d,l as p,n as u}from"./chunk-65L5EBBL.mjs";import{a as T}from"./chunk-NCH5TP7V.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-LNZQ2M65.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-VMFJUT3G.mjs";import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-VMFJUT3G.mjs";import{a as e}from"./chunk-AIDEMTSX.mjs";var n=class{static get create(){return this.createComponent}static set create(t){this.createComponent=t}};n.createComponent=async({name:t,anchor:o})=>{if(await r(e),!e.document)return{};let m=e.document.createElement(t);return(o||e.document.body).appendChild(m),await customElements.whenDefined(t),m};export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LZW6D5GQ.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as p}from"./chunk-SXXJRX5W.mjs";import{a as f}from"./chunk-GYKOIGBE.mjs";import{s as n}from"./chunk-PFCHZJJO.mjs";import{u as i}from"./chunk-GYUFALJV.mjs";import{d as t}from"./chunk-VNLGNNIL.mjs";import{a as e}from"./chunk-OJV6XRG5.mjs";import{a as m}from"./chunk-HUQ6AJBO.mjs";async function y(){let c=m(),s=f(),r=c?e.webview:t(i());if(!r)return;let o=await p.create({type:r});if(!o)throw new Error("Provider not found");!s&&r===e.webview&&await o.login(),n(o)}export{y as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MMTACNKE.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-SPVT5OQ4.mjs";var i=async a=>{let r=a.map(s=>s.hash),n=await e(r);return a.map(s=>{let t=n.find(o=>o?.txHash===s.hash);return{...s,status:t?.status,invalidTransaction:t==null,results:t?.results??[],previousStatus:s.status?.toString()||"",hasStatusChanged:!!(t&&t.status!==s.status)}})};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MTBXLPH7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-SPVT5OQ4.mjs";import{a as p}from"./chunk-RJZOP6PK.mjs";import{a as d}from"./chunk-EEPC4DL4.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-NCH5TP7V.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-GYUFALJV.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-O7FXZNDF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ot}from"./chunk-CTW5DICC.mjs";import{a as ct}from"./chunk-6UZHM5LW.mjs";import{a as C}from"./chunk-UZUI4AP5.mjs";import{a as mt}from"./chunk-ED5SQUAW.mjs";import{a as L}from"./chunk-FFEFZVCC.mjs";import{a as Q,b as X,g as Z,l as tt}from"./chunk-CAA4VJRH.mjs";import{a as lt}from"./chunk-LYXQ3FWU.mjs";import{b}from"./chunk-65RXDHRY.mjs";import{a as pt}from"./chunk-XDH23MRS.mjs";import{a as ht}from"./chunk-4ODPAHHA.mjs";import{a as gt}from"./chunk-Z5CDCI3Y.mjs";import{a as dt}from"./chunk-77IZTIMY.mjs";import{a as g}from"./chunk-47CCSYQY.mjs";import{a as J}from"./chunk-2ZNIPYEV.mjs";import{a as ft}from"./chunk-DCCGXGUQ.mjs";import{a as rt}from"./chunk-3ATEIVW3.mjs";import{a as S}from"./chunk-S4LN2NQH.mjs";import{a as y,f as ut}from"./chunk-A343RP4X.mjs";import{a as j}from"./chunk-K66JLLVW.mjs";import{a as I}from"./chunk-QTKK6OSJ.mjs";import{b as Tt}from"./chunk-HIODLP5F.mjs";import{d as it}from"./chunk-GXUJBKWY.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 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-PGOE5XGR.mjs";import{b as d}from"./chunk-VNLGNNIL.mjs";import{b as h}from"./chunk-IEJTMYFW.mjs";import{c as $,f as G}from"./chunk-QJSB5NX4.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-EKMRPW2A.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")},_s=()=>{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,_s 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-JWW3XX4N.mjs";import{a as ct}from"./chunk-6UZHM5LW.mjs";import{a as C}from"./chunk-LNZQ2M65.mjs";import{a as mt}from"./chunk-JTE52R3D.mjs";import{a as L}from"./chunk-BVKXSTQF.mjs";import{a as Q,b as X,g as Z,l as tt}from"./chunk-CAA4VJRH.mjs";import{a as lt}from"./chunk-TKORCVYO.mjs";import{b}from"./chunk-XKQ7QLV3.mjs";import{a as pt}from"./chunk-SJ34PIXB.mjs";import{a as ht}from"./chunk-4ODPAHHA.mjs";import{a as gt}from"./chunk-Z5CDCI3Y.mjs";import{a as dt}from"./chunk-K6KK466Z.mjs";import{a as g}from"./chunk-XIOTX2GI.mjs";import{a as J}from"./chunk-JHDJG624.mjs";import{a as ft}from"./chunk-6JD2RV7R.mjs";import{a as rt}from"./chunk-SQ4KCFCC.mjs";import{a as S}from"./chunk-PZLVK2W5.mjs";import{a as y,f as ut}from"./chunk-EWT7FW5B.mjs";import{a as j}from"./chunk-K66JLLVW.mjs";import{a as I}from"./chunk-QTKK6OSJ.mjs";import{b as Tt}from"./chunk-445KR45K.mjs";import{d as it}from"./chunk-JN4ENKZ6.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 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-GYUFALJV.mjs";import{b as d}from"./chunk-VNLGNNIL.mjs";import{b as h}from"./chunk-IEJTMYFW.mjs";import{c as $,f as G}from"./chunk-QJSB5NX4.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-LZW6D5GQ.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")},_s=()=>{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,_s 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-PFCHZJJO.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-GYUFALJV.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-PZLVK2W5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-5FEICWMB.mjs";import{a as T}from"./chunk-P3BXXGQA.mjs";import{a as i}from"./chunk-W5MTQBQF.mjs";import{a as m}from"./chunk-EQEYL6AE.mjs";import{a as l}from"./chunk-VJ2DAL5M.mjs";import{c as d}from"./chunk-J4CPYFK6.mjs";import{a as o}from"./chunk-BSWV5MEC.mjs";var p=class{static async processTransactions({address:u,egldLabel:v,explorerAddress:g,transactions:L}){let f=L.map(e=>m({address:u,explorerAddress:g,transaction:e}));return await Promise.all(f.map(async e=>{let s=e.receiverAssets?.name.replace(/\p{Emoji}/gu,""),a=e.senderAssets?.name.replace(/\p{Emoji}/gu,""),{senderLockedAccount:h,receiverLockedAccount:D}=await k({receiver:e.receiver,sender:e.sender,tokenId:e.tokenIdentifier}),{egldValueData:t,tokenValueData:n,nftValueData:r}=T({transaction:e}),x=r?.token.type==="MetaESDT"?void 0:r?.badgeText,c=l.getData({input:t?.value??n?.value??r?.value??"",decimals:t?.decimals??n?.decimals??r?.decimals??d,digits:2}),y={badge:x??void 0,collection:n?.token.collection??r?.token.collection,egldLabel:t?v:"",link:n?.tokenExplorerLink??r?.tokenExplorerLink,linkText:n?.tokenLinkText??r?.tokenLinkText,name:n?.token.name??r?.token.name,showFormattedAmount:!!(t||n?.tokenFormattedAmount||r?.tokenFormattedAmount),svgUrl:n?.token.svgUrl??r?.token.svgUrl,ticker:n?.token.ticker??r?.token.ticker,titleText:n?.titleText??r?.titleText,valueDecimal:c.valueDecimal,valueInteger:c.valueInteger},w=i(e.receiverShard),A=i(e.senderShard);return{age:e.transactionDetails.age,direction:e.transactionDetails.direction,method:e.transactionDetails.method,iconInfo:e.transactionDetails.iconInfo,link:e.links.transactionLink??"",txHash:e.txHash,receiver:{address:e.receiver,name:s??"",description:`${s??e.receiver} (${e.receiver})`,isContract:o(e.receiver),isTokenLocked:!!D,link:e.links.receiverLink??"",shard:w,shardLink:e.links.receiverLink,showLink:e.transactionDetails.direction!=="In"},sender:{address:e.sender,name:a??"",description:`${a??e.sender} (${e.sender})`,isContract:o(e.sender),isTokenLocked:!!h,link:e.links.senderLink??"",shard:A,shardLink:e.links.senderShardLink,showLink:e.transactionDetails.direction!=="Out"},value:y}}))}};export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-QY5O4PX2.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{s as a}from"./chunk-GYUFALJV.mjs";var r=({key:e,value:t})=>{a().setState(({cache:c})=>{c[e]=t},!1,"saveToCache")},s=e=>{a().setState(({cache:t})=>{delete t[e]},!1,"removeFromCache")},h=()=>{a().setState(({cache:e})=>{Object.keys(e).forEach(t=>{delete e[t]})},!1,"clearCache")};export{r as a,s as b,h as c};
|
|
2
|
+
//# sourceMappingURL=chunk-RJZOP6PK.mjs.map
|