@multiversx/sdk-dapp 5.0.0-alpha.15 → 5.0.0-alpha.16
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-JMXZ4XDT.mjs → chunk-22WRFZHZ.mjs} +2 -2
- package/out/__chunks__/{chunk-PTLBE2H2.mjs → chunk-27VTB7II.mjs} +2 -2
- package/out/__chunks__/{chunk-PTLBE2H2.mjs.map → chunk-27VTB7II.mjs.map} +2 -2
- package/out/__chunks__/{chunk-ODIVUD2L.mjs → chunk-2FKKBSB4.mjs} +2 -2
- package/out/__chunks__/{chunk-Y4OUAJSG.mjs → chunk-33NGD6LW.mjs} +2 -2
- package/out/__chunks__/{chunk-7H2PZVSJ.mjs → chunk-3EEDALSW.mjs} +2 -2
- package/out/__chunks__/{chunk-AI7LYKBU.mjs → chunk-3LZAM52Q.mjs} +2 -2
- package/out/__chunks__/chunk-45SUU3H5.mjs +2 -0
- package/out/__chunks__/{chunk-F4W3N3JZ.mjs → chunk-465RHWQ5.mjs} +2 -2
- package/out/__chunks__/{chunk-IQVVCXXL.mjs → chunk-4VFF2EHB.mjs} +2 -2
- package/out/__chunks__/{chunk-KNRIU7GR.mjs → chunk-52VQSACM.mjs} +2 -2
- package/out/__chunks__/{chunk-RPBH7EFR.mjs → chunk-5CDLB7VW.mjs} +2 -2
- package/out/__chunks__/{chunk-PH2YVVEA.mjs → chunk-5JZI77YI.mjs} +2 -2
- package/out/__chunks__/{chunk-R6QXUFY4.mjs → chunk-5R3VZX6E.mjs} +2 -2
- package/out/__chunks__/{chunk-VML7BRY5.mjs → chunk-5SUSXTTZ.mjs} +2 -2
- package/out/__chunks__/{chunk-MXLRZPMK.mjs → chunk-5V3N4MOZ.mjs} +2 -2
- package/out/__chunks__/{chunk-33V2XBND.mjs → chunk-5VAGLG3Y.mjs} +2 -2
- package/out/__chunks__/{chunk-4MNCFSUO.mjs → chunk-6FIRQBP7.mjs} +2 -2
- package/out/__chunks__/chunk-6J4LMQ4Z.mjs +2 -0
- package/out/__chunks__/{chunk-CRHPVNRL.mjs → chunk-6KI6UL6C.mjs} +2 -2
- package/out/__chunks__/chunk-6MDV4CER.mjs +2 -0
- package/out/__chunks__/{chunk-GZTGHNVI.mjs → chunk-6NRL7OLL.mjs} +2 -2
- package/out/__chunks__/{chunk-T5GA3FRJ.mjs → chunk-72VJ6ESJ.mjs} +2 -2
- package/out/__chunks__/chunk-ARJZ4W7T.mjs +2 -0
- package/out/__chunks__/{chunk-I2XLXOU2.mjs → chunk-ATEXXLUV.mjs} +2 -2
- package/out/__chunks__/chunk-B4RZU4FG.mjs +2 -0
- package/out/__chunks__/chunk-BKGXNJT5.mjs +2 -0
- package/out/__chunks__/{chunk-Z6VA2J3J.mjs → chunk-BNVOP5SM.mjs} +2 -2
- package/out/__chunks__/{chunk-CBH7E57H.mjs → chunk-C5VJMWLU.mjs} +2 -2
- package/out/__chunks__/chunk-CUBNX4ZT.mjs +2 -0
- package/out/__chunks__/{chunk-BHXGUN5H.mjs.map → chunk-CUBNX4ZT.mjs.map} +1 -1
- package/out/__chunks__/{chunk-BTXVE2KE.mjs → chunk-EBWZONUV.mjs} +2 -2
- package/out/__chunks__/{chunk-SFZJXI7K.mjs → chunk-ECZH2TNF.mjs} +2 -2
- package/out/__chunks__/{chunk-532QQEN4.mjs → chunk-ESC2Z53Z.mjs} +2 -2
- package/out/__chunks__/{chunk-YIWTWMQF.mjs → chunk-EXMSBG6B.mjs} +2 -2
- package/out/__chunks__/{chunk-MAK5NFYN.mjs → chunk-F7YJNEFJ.mjs} +2 -2
- package/out/__chunks__/{chunk-AZGVI4QW.mjs → chunk-FXVMPOC7.mjs} +2 -2
- package/out/__chunks__/chunk-GLDB2NRB.mjs +2 -0
- package/out/__chunks__/chunk-GWVYPYNB.mjs +2 -0
- package/out/__chunks__/{chunk-YMSRWWNA.mjs → chunk-GZUFMNUL.mjs} +2 -2
- package/out/__chunks__/{chunk-EO6CD6VO.mjs → chunk-H6SRZM4T.mjs} +2 -2
- package/out/__chunks__/{chunk-QZ27VHW6.mjs → chunk-I4KPP4PH.mjs} +2 -2
- package/out/__chunks__/{chunk-5MDDPC5M.mjs → chunk-ID6KUNJA.mjs} +2 -2
- package/out/__chunks__/chunk-IQADSDGP.mjs +2 -0
- package/out/__chunks__/chunk-JPOJ7DHM.mjs +2 -0
- package/out/__chunks__/chunk-JPOJ7DHM.mjs.map +7 -0
- package/out/__chunks__/{chunk-MH42KJTU.mjs → chunk-KCP2UWHU.mjs} +2 -2
- package/out/__chunks__/{chunk-4USFY3DC.mjs → chunk-KDIJXWH3.mjs} +2 -2
- package/out/__chunks__/chunk-KYWMUINZ.mjs +2 -0
- package/out/__chunks__/{chunk-ES6E2HM6.mjs → chunk-LDM4KVJG.mjs} +2 -2
- package/out/__chunks__/{chunk-MYCXIA5W.mjs → chunk-LDUJ24G3.mjs} +2 -2
- package/out/__chunks__/{chunk-7RFUEHZX.mjs → chunk-LO6RI4RO.mjs} +2 -2
- package/out/__chunks__/{chunk-JJ2NEPU5.mjs → chunk-MAY7DC6U.mjs} +2 -2
- package/out/__chunks__/{chunk-TEYO3CV4.mjs → chunk-NAVK4GNG.mjs} +2 -2
- package/out/__chunks__/{chunk-AZ2KOM5R.mjs → chunk-NJ276HWT.mjs} +2 -2
- package/out/__chunks__/{chunk-PLO67H6R.mjs → chunk-NQMOKUJK.mjs} +2 -2
- package/out/__chunks__/{chunk-CUABBK2P.mjs → chunk-P5OSWL4G.mjs} +2 -2
- package/out/__chunks__/{chunk-JYZ5XXJG.mjs → chunk-PE4P3KI6.mjs} +2 -2
- package/out/__chunks__/chunk-PNPUIES4.mjs +2 -0
- package/out/__chunks__/{chunk-C3F3EPNZ.mjs → chunk-QCXQJ5YM.mjs} +2 -2
- package/out/__chunks__/{chunk-MUYF2CWM.mjs → chunk-ROLT7YVP.mjs} +2 -2
- package/out/__chunks__/{chunk-LV2BL56O.mjs → chunk-RTTFUTCM.mjs} +2 -2
- package/out/__chunks__/chunk-S4ZDWFIY.mjs +2 -0
- package/out/__chunks__/{chunk-GRD5MWEG.mjs → chunk-S7TUDNXQ.mjs} +2 -2
- package/out/__chunks__/{chunk-RCRWI3XT.mjs → chunk-SRHVF3CF.mjs} +2 -2
- package/out/__chunks__/{chunk-OYY5ZF7L.mjs → chunk-T3EPK6N7.mjs} +2 -2
- package/out/__chunks__/{chunk-RG72LHS3.mjs → chunk-TJN2VTAD.mjs} +2 -2
- package/out/__chunks__/chunk-TUDSXSJ7.mjs +2 -0
- package/out/__chunks__/chunk-UK4SUJCE.mjs +2 -0
- package/out/__chunks__/{chunk-GFK4E7GU.mjs → chunk-URLVAGF2.mjs} +2 -2
- package/out/__chunks__/{chunk-SLBB2BEP.mjs → chunk-V63MHRY7.mjs} +2 -2
- package/out/__chunks__/chunk-VEXXDADK.mjs +2 -0
- package/out/__chunks__/{chunk-I2BU6ZOQ.mjs → chunk-VHZCEPGZ.mjs} +2 -2
- package/out/__chunks__/{chunk-RLVN434K.mjs → chunk-X5E2DC6M.mjs} +2 -2
- package/out/__chunks__/{chunk-QCJMV6NU.mjs → chunk-X5JDKLIV.mjs} +2 -2
- package/out/__chunks__/{chunk-TDUKMRJX.mjs → chunk-XFV5VRHE.mjs} +2 -2
- package/out/__chunks__/{chunk-EBQZQA2Q.mjs → chunk-XO3OXUDH.mjs} +2 -2
- package/out/__chunks__/chunk-XSEV6HR5.mjs +2 -0
- package/out/__chunks__/{chunk-F4WQOPSX.mjs → chunk-Y7BIC4GU.mjs} +2 -2
- package/out/__chunks__/chunk-YYW6XBAT.mjs +2 -0
- package/out/__chunks__/{chunk-SZHXVDHF.mjs → chunk-YZKMFI3Y.mjs} +2 -2
- package/out/__chunks__/{chunk-O67WFDS3.mjs → chunk-ZCMSJEI4.mjs} +2 -2
- package/out/__chunks__/chunk-ZCNHQY2S.mjs +2 -0
- package/out/apiCalls/account/getScamAddressData.mjs +1 -1
- package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
- package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
- package/out/apiCalls/index.mjs +1 -1
- package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/index.mjs +1 -1
- package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
- package/out/constants/browser.constants.mjs +1 -1
- package/out/constants/index.mjs +1 -1
- package/out/constants/storage.constants.mjs +1 -1
- package/out/constants/window.constants.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
- package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
- package/out/controllers/TransactionsTableController/index.mjs +1 -1
- package/out/index.mjs +1 -1
- package/out/managers/LogoutManager/LogoutManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/index.mjs +1 -1
- package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
- package/out/managers/TransactionManager/index.mjs +1 -1
- package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
- package/out/managers/UnlockPanelManager/index.mjs +1 -1
- package/out/managers/index.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
- package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
- package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/ToastManager/ToastManager.mjs +1 -1
- package/out/managers/internal/ToastManager/helpers/LifetimeManager.mjs +1 -1
- package/out/managers/internal/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
- package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
- package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.mjs +1 -1
- package/out/managers/internal/WalletConnectStateManager/index.mjs +1 -1
- package/out/managers/internal/index.mjs +1 -1
- package/out/methods/account/getAccount.mjs +1 -1
- package/out/methods/account/getAccountInfo.mjs +1 -1
- package/out/methods/account/getAddress.mjs +1 -1
- package/out/methods/account/getIsLoggedIn.mjs +1 -1
- package/out/methods/account/getLatestNonce.mjs +1 -1
- package/out/methods/initApp/gastStationMetadata/setGasStationMetadata.mjs +1 -1
- package/out/methods/initApp/initApp.mjs +1 -1
- package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
- package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
- package/out/methods/loginInfo/getLoginInfo.mjs +1 -1
- package/out/methods/network/getEgldLabel.mjs +1 -1
- package/out/methods/network/getExplorerAddress.mjs +1 -1
- package/out/methods/network/getNetworkConfig.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/index.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/manageFailedTransactions.mjs +1 -1
- package/out/methods/trackTransactions/helpers/getPollingInterval.mjs +1 -1
- package/out/methods/trackTransactions/trackTransactions.mjs +1 -1
- package/out/methods/transactions/getFailedTransactions.mjs +1 -1
- package/out/methods/transactions/getFailedTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getSuccessfulTransactions.mjs +1 -1
- package/out/methods/transactions/getSuccessfulTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getTransactionSessions.mjs +1 -1
- package/out/providers/DappProvider/DappProvider.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/extractAddressFromToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getAccountFromToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getModifiedLoginToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
- package/out/providers/DappProvider/helpers/logout/logout.mjs +1 -1
- package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
- package/out/providers/DappProvider/helpers/signMessage/signMessageWithProvider.mjs +1 -1
- package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
- package/out/providers/DappProvider/index.mjs +1 -1
- package/out/providers/ProviderFactory.mjs +1 -1
- package/out/providers/helpers/accountProvider.mjs +1 -1
- package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
- package/out/providers/helpers/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.js +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.js.map +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/signTransactions.js +27 -20
- package/out/providers/strategies/helpers/signTransactions/signTransactions.js.map +1 -1
- package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
- package/out/providers/strategies/index.mjs +1 -1
- package/out/react/account/useGetAccount.mjs +1 -1
- package/out/react/account/useGetAccountInfo.mjs +1 -1
- package/out/react/account/useGetIsLoggedIn.mjs +1 -1
- package/out/react/account/useGetLatestNonce.mjs +1 -1
- package/out/react/index.mjs +1 -1
- package/out/react/loginInfo/useGetLoginInfo.mjs +1 -1
- package/out/react/network/useGetNetworkConfig.mjs +1 -1
- package/out/react/store/getReactStore.mjs +1 -1
- package/out/react/store/useSelector.mjs +1 -1
- package/out/react/transactions/useGetFailedTransactions.mjs +1 -1
- package/out/react/transactions/useGetFailedTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetPendingTransactions.mjs +1 -1
- package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetSuccessfulTransactions.mjs +1 -1
- package/out/react/transactions/useGetSuccessfulTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetTransactionSessions.mjs +1 -1
- package/out/services/index.mjs +1 -1
- package/out/services/nativeAuth/index.mjs +1 -1
- package/out/services/nativeAuth/methods/buildNativeAuthConfig.mjs +1 -1
- package/out/services/nativeAuth/methods/getDefaultNativeAuthConfig.mjs +1 -1
- package/out/services/nativeAuth/methods/index.mjs +1 -1
- package/out/services/nativeAuth/nativeAuth.mjs +1 -1
- package/out/store/actions/account/accountActions.mjs +1 -1
- package/out/store/actions/account/index.mjs +1 -1
- package/out/store/actions/cache/cacheActions.mjs +1 -1
- package/out/store/actions/cache/index.mjs +1 -1
- package/out/store/actions/config/configActions.mjs +1 -1
- package/out/store/actions/config/index.mjs +1 -1
- package/out/store/actions/index.mjs +1 -1
- package/out/store/actions/loginInfo/loginInfoActions.mjs +1 -1
- package/out/store/actions/network/index.mjs +1 -1
- package/out/store/actions/network/initializeNetwork.mjs +1 -1
- package/out/store/actions/network/networkActions.mjs +1 -1
- package/out/store/actions/sharedActions/index.mjs +1 -1
- package/out/store/actions/sharedActions/sharedActions.mjs +1 -1
- package/out/store/actions/toasts/index.mjs +1 -1
- package/out/store/actions/toasts/toastsActions.mjs +1 -1
- package/out/store/actions/transactions/transactionsActions.mjs +1 -1
- package/out/store/actions/ui/index.mjs +1 -1
- package/out/store/actions/ui/uiActions.mjs +1 -1
- package/out/store/middleware/applyMiddlewares.mjs +1 -1
- package/out/store/middleware/index.mjs +1 -1
- package/out/store/middleware/logoutMiddleware.mjs +1 -1
- package/out/store/storage/index.mjs +1 -1
- package/out/store/storage/storageCallback.mjs +1 -1
- package/out/store/store.mjs +1 -1
- package/out/utils/ComponentFactory.mjs +1 -1
- package/out/utils/account/index.mjs +1 -1
- package/out/utils/account/refreshAccount.mjs +1 -1
- package/out/utils/account/refreshNativeAuthTokenLogin.mjs +1 -1
- package/out/utils/index.mjs +1 -1
- package/out/utils/transactions/getActiveTransactionsStatus.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/getInterpretedTransaction.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getLockedAccountName.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getShardText.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionIconInfo.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionMessages.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/index.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/index.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/getTransactionsHistory.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/getCachedTransactionListItem.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/index.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/index.mjs +1 -1
- package/out/utils/transactions/index.mjs +1 -1
- package/out/utils/visual/index.mjs +1 -1
- package/out/utils/visual/switchTheme.mjs +1 -1
- package/out/utils/window/getIsInIframe.mjs +1 -1
- package/out/utils/window/getWindowParentOrigin.mjs +1 -1
- package/out/utils/window/index.mjs +1 -1
- package/package.json +1 -1
- package/out/__chunks__/chunk-4KABQZJU.mjs +0 -2
- package/out/__chunks__/chunk-4NXTT4UR.mjs +0 -2
- package/out/__chunks__/chunk-BHXGUN5H.mjs +0 -2
- package/out/__chunks__/chunk-BLUKJJTY.mjs +0 -2
- package/out/__chunks__/chunk-CMEBBADF.mjs +0 -2
- package/out/__chunks__/chunk-FGRMMCGF.mjs +0 -2
- package/out/__chunks__/chunk-GXMIT5JQ.mjs +0 -2
- package/out/__chunks__/chunk-GXMIT5JQ.mjs.map +0 -7
- package/out/__chunks__/chunk-GZAAD3TR.mjs +0 -2
- package/out/__chunks__/chunk-HACVN4R6.mjs +0 -2
- package/out/__chunks__/chunk-JGWGDO7E.mjs +0 -2
- package/out/__chunks__/chunk-KOALRMAA.mjs +0 -2
- package/out/__chunks__/chunk-O67FZOYR.mjs +0 -2
- package/out/__chunks__/chunk-QYV4JQI5.mjs +0 -2
- package/out/__chunks__/chunk-S2FAYMW2.mjs +0 -2
- package/out/__chunks__/chunk-TGCPDWQK.mjs +0 -2
- package/out/__chunks__/chunk-VOZWABCM.mjs +0 -2
- package/out/__chunks__/chunk-VTL2OSUK.mjs +0 -2
- package/out/__chunks__/chunk-YDGXPL33.mjs +0 -2
- package/out/__chunks__/chunk-YVH7ZJXA.mjs +0 -2
- package/out/__chunks__/chunk-ZSHUGRGA.mjs +0 -2
- /package/out/__chunks__/{chunk-JMXZ4XDT.mjs.map → chunk-22WRFZHZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ODIVUD2L.mjs.map → chunk-2FKKBSB4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Y4OUAJSG.mjs.map → chunk-33NGD6LW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7H2PZVSJ.mjs.map → chunk-3EEDALSW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AI7LYKBU.mjs.map → chunk-3LZAM52Q.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KOALRMAA.mjs.map → chunk-45SUU3H5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-F4W3N3JZ.mjs.map → chunk-465RHWQ5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IQVVCXXL.mjs.map → chunk-4VFF2EHB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KNRIU7GR.mjs.map → chunk-52VQSACM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RPBH7EFR.mjs.map → chunk-5CDLB7VW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PH2YVVEA.mjs.map → chunk-5JZI77YI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-R6QXUFY4.mjs.map → chunk-5R3VZX6E.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VML7BRY5.mjs.map → chunk-5SUSXTTZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MXLRZPMK.mjs.map → chunk-5V3N4MOZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-33V2XBND.mjs.map → chunk-5VAGLG3Y.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4MNCFSUO.mjs.map → chunk-6FIRQBP7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YVH7ZJXA.mjs.map → chunk-6J4LMQ4Z.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CRHPVNRL.mjs.map → chunk-6KI6UL6C.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CMEBBADF.mjs.map → chunk-6MDV4CER.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GZTGHNVI.mjs.map → chunk-6NRL7OLL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-T5GA3FRJ.mjs.map → chunk-72VJ6ESJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GZAAD3TR.mjs.map → chunk-ARJZ4W7T.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-I2XLXOU2.mjs.map → chunk-ATEXXLUV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-O67FZOYR.mjs.map → chunk-B4RZU4FG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4NXTT4UR.mjs.map → chunk-BKGXNJT5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Z6VA2J3J.mjs.map → chunk-BNVOP5SM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CBH7E57H.mjs.map → chunk-C5VJMWLU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BTXVE2KE.mjs.map → chunk-EBWZONUV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SFZJXI7K.mjs.map → chunk-ECZH2TNF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-532QQEN4.mjs.map → chunk-ESC2Z53Z.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YIWTWMQF.mjs.map → chunk-EXMSBG6B.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MAK5NFYN.mjs.map → chunk-F7YJNEFJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AZGVI4QW.mjs.map → chunk-FXVMPOC7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QYV4JQI5.mjs.map → chunk-GLDB2NRB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-S2FAYMW2.mjs.map → chunk-GWVYPYNB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YMSRWWNA.mjs.map → chunk-GZUFMNUL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EO6CD6VO.mjs.map → chunk-H6SRZM4T.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QZ27VHW6.mjs.map → chunk-I4KPP4PH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5MDDPC5M.mjs.map → chunk-ID6KUNJA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZSHUGRGA.mjs.map → chunk-IQADSDGP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MH42KJTU.mjs.map → chunk-KCP2UWHU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4USFY3DC.mjs.map → chunk-KDIJXWH3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VTL2OSUK.mjs.map → chunk-KYWMUINZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ES6E2HM6.mjs.map → chunk-LDM4KVJG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MYCXIA5W.mjs.map → chunk-LDUJ24G3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7RFUEHZX.mjs.map → chunk-LO6RI4RO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JJ2NEPU5.mjs.map → chunk-MAY7DC6U.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TEYO3CV4.mjs.map → chunk-NAVK4GNG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AZ2KOM5R.mjs.map → chunk-NJ276HWT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PLO67H6R.mjs.map → chunk-NQMOKUJK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CUABBK2P.mjs.map → chunk-P5OSWL4G.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JYZ5XXJG.mjs.map → chunk-PE4P3KI6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BLUKJJTY.mjs.map → chunk-PNPUIES4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-C3F3EPNZ.mjs.map → chunk-QCXQJ5YM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MUYF2CWM.mjs.map → chunk-ROLT7YVP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LV2BL56O.mjs.map → chunk-RTTFUTCM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TGCPDWQK.mjs.map → chunk-S4ZDWFIY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GRD5MWEG.mjs.map → chunk-S7TUDNXQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RCRWI3XT.mjs.map → chunk-SRHVF3CF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OYY5ZF7L.mjs.map → chunk-T3EPK6N7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RG72LHS3.mjs.map → chunk-TJN2VTAD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VOZWABCM.mjs.map → chunk-TUDSXSJ7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FGRMMCGF.mjs.map → chunk-UK4SUJCE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GFK4E7GU.mjs.map → chunk-URLVAGF2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SLBB2BEP.mjs.map → chunk-V63MHRY7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HACVN4R6.mjs.map → chunk-VEXXDADK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-I2BU6ZOQ.mjs.map → chunk-VHZCEPGZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RLVN434K.mjs.map → chunk-X5E2DC6M.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QCJMV6NU.mjs.map → chunk-X5JDKLIV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TDUKMRJX.mjs.map → chunk-XFV5VRHE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EBQZQA2Q.mjs.map → chunk-XO3OXUDH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JGWGDO7E.mjs.map → chunk-XSEV6HR5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-F4WQOPSX.mjs.map → chunk-Y7BIC4GU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YDGXPL33.mjs.map → chunk-YYW6XBAT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SZHXVDHF.mjs.map → chunk-YZKMFI3Y.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-O67WFDS3.mjs.map → chunk-ZCMSJEI4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4KABQZJU.mjs.map → chunk-ZCNHQY2S.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-CUBNX4ZT.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-22WRFZHZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as V}from"./chunk-7Z7IX367.mjs";import{a as B}from"./chunk-VCQBYNNS.mjs";import{a as $}from"./chunk-O3V4TGXK.mjs";import{a as _}from"./chunk-AV4HSXYZ.mjs";import{a as U}from"./chunk-RBZC4PEU.mjs";import{a as R}from"./chunk-ROZAXUMC.mjs";import{a as M}from"./chunk-BETSOJFK.mjs";import{a as w}from"./chunk-YTFYVPZO.mjs";import{a as O}from"./chunk-YGI3KXMZ.mjs";import{a as x}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as V}from"./chunk-7Z7IX367.mjs";import{a as B}from"./chunk-VCQBYNNS.mjs";import{a as $}from"./chunk-O3V4TGXK.mjs";import{a as _}from"./chunk-AV4HSXYZ.mjs";import{a as U}from"./chunk-RBZC4PEU.mjs";import{a as R}from"./chunk-ROZAXUMC.mjs";import{a as M}from"./chunk-BETSOJFK.mjs";import{a as w}from"./chunk-YTFYVPZO.mjs";import{a as O}from"./chunk-YGI3KXMZ.mjs";import{a as x}from"./chunk-2FKKBSB4.mjs";import{a as v}from"./chunk-RYIJWGFA.mjs";import{t as G}from"./chunk-EBWZONUV.mjs";import{a as L}from"./chunk-YYW6XBAT.mjs";import{a as h}from"./chunk-BRJNX4JF.mjs";import{a as b,c as C,f as u}from"./chunk-J4CPYFK6.mjs";import{a as P}from"./chunk-KD2IQ32V.mjs";import{c as f}from"./chunk-TI37DKBT.mjs";import{k as A}from"./chunk-LHEH7L4L.mjs";import{a as F}from"./chunk-CUBNX4ZT.mjs";import{BigNumber as yt}from"bignumber.js";async function Kt({allTransactions:T,currentScreenIndex:m,egldLabel:o,network:e,gasPriceData:c,price:S,address:p,username:z,shard:j,signedIndexes:i,parsedTransactionsByDataField:q}){let t=T[m],H=t?.transaction?.sender.toString(),K=t?.transaction,D=null,y=null,W=R({egldLabel:o,sender:H,apiAddress:e.apiAddress,address:p,parsedTransactionsByDataField:q}),a=t.transaction.toPlainObject(),n=await W(t),d=!n?.transactionTokenInfo?.tokenId,{tokenId:g,nonce:l,amount:I=""}=n?.transactionTokenInfo??{},Z=g&&l&&l.length>0?`${g}-${l}`:g,J=await x({tokenId:Z}),{esdtPrice:Q,tokenDecimals:X,type:r,identifier:s,tokenImageUrl:Y}=J;if(r==="SemiFungibleESDT"||r==="NonFungibleESDT")y={type:r,identifier:s,amount:I,imageURL:Y};else{let E=({addCommas:Dt})=>u({input:d?t.transaction.value.toString():I,decimals:d?Number(e.decimals):X,digits:Number(e.digits),showLastNonZeroDecimal:!1,addCommas:Dt}),ut=E({addCommas:!0}),ft=E({addCommas:!1}),Tt=Number(d?S:Q),St=O({amount:ft,usd:Tt,addEqualSign:!0});D={identifier:(s===A?o:s)??o,amount:ut,usdValue:St}}let{feeLimitFormatted:tt,feeInFiatLimit:nt}=w({transaction:K,price:S}),ot=$({shard:j,initialGasPrice:c.initialGasPrice,transaction:a,gasStationMetadata:e.gasStationMetadata}),et=_({transaction:a,gasPriceData:c}),it=G().getType(),at=v(it),N=T.length,rt=i.length>0?i[i.length-1]+1:0,st=f(t.transaction.data.toString()??""),k=U(n?.transactionTokenInfo),mt=M({data:st,identifier:s,highlight:k}),ct=L(),pt=h({to:`/${P}/${p}`,explorerAddress:ct}),dt=N===1||n?.needsSigning&&!i.includes(m),gt=u({input:et.toString(),decimals:C,addCommas:!0,digits:b}),lt=new yt(a.gasLimit).toFormat({decimalSeparator:",",groupSeparator:".",groupSize:3});return{commonData:{receiver:a.receiver.toString(),data:f(t.transaction.data.toString()??""),decodedData:mt,gasPrice:gt,gasLimit:lt,explorerLink:pt,ppu:c.ppu,ppuOptions:ot,egldLabel:o,tokenType:V(r),feeLimit:tt,feeInFiatLimit:nt,transactionsCount:N,currentIndex:m,currentIndexToSign:rt,highlight:k,scCall:B(n?.transactionTokenInfo),needsSigning:dt,isEditable:n?.needsSigning,providerName:at,address:p,username:z,origin:F.location?.origin},tokenTransaction:D,fungibleTransaction:y}}export{Kt as a};
|
|
2
|
+
//# sourceMappingURL=chunk-27VTB7II.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.ts"],
|
|
4
|
-
"sourcesContent": ["import { BigNumber } from 'bignumber.js';\nimport { ACCOUNTS_ENDPOINT } from 'apiCalls';\nimport { getPersistedTokenDetails } from 'apiCalls/tokens/getPersistedTokenDetails';\nimport { MULTI_TRANSFER_EGLD_TOKEN } from 'constants/mvx.constants';\nimport { safeWindow } from 'constants/window.constants';\nimport { DECIMALS, DIGITS, formatAmount } from 'lib/sdkDappUtils';\nimport {\n FungibleTransactionType,\n ISignTransactionsPanelCommonData\n} from 'managers/internal/SignTransactionsStateManager/types';\nimport { getExplorerAddress } from 'methods/network/getExplorerAddress';\nimport { getAccountProvider } from 'providers/helpers/accountProvider';\nimport { NetworkType } from 'types/network.types';\nimport { NftEnumType } from 'types/tokens.types';\nimport {\n MultiSignTransactionType,\n TransactionDataTokenType\n} from 'types/transactions.types';\nimport { decodeBase64 } from 'utils/decoders/base64Utils';\nimport { capitalize } from 'utils/operations/capitalize';\nimport { getUsdValue } from 'utils/operations/getUsdValue';\nimport { getExplorerLink } from 'utils/transactions/getExplorerLink';\nimport { getFeeData } from '../getFeeData';\nimport { getAllDecodedFormats } from './helpers/decodeDataField';\nimport { getExtractTransactionsInfo } from './helpers/getExtractTransactionsInfo';\nimport { getHighlight } from './helpers/getHighlight';\nimport { getPpuOptions } from './helpers/getPpuOptions';\nimport { getRecommendedGasPrice } from './helpers/getRecommendedGasPrice';\nimport { getScCall } from './helpers/getScCall';\nimport { getTokenType } from './helpers/getTokenType';\n\nexport type GetCommonDataPropsType = {\n allTransactions: MultiSignTransactionType[];\n currentScreenIndex: number;\n price?: number;\n network: NetworkType;\n signedIndexes: number[];\n egldLabel: string;\n address: string;\n shard?: number;\n username?: string;\n parsedTransactionsByDataField: Record<string, TransactionDataTokenType>;\n gasPriceData: {\n initialGasPrice: number;\n ppu: ISignTransactionsPanelCommonData['ppu'];\n };\n};\n\nexport async function getCommonData({\n allTransactions,\n currentScreenIndex,\n egldLabel,\n network,\n gasPriceData,\n price,\n address,\n username,\n shard,\n signedIndexes,\n parsedTransactionsByDataField\n}: GetCommonDataPropsType) {\n const currentTransaction = allTransactions[currentScreenIndex];\n const sender = currentTransaction?.transaction?.sender.toString();\n const transaction = currentTransaction?.transaction;\n\n let tokenTransaction: {\n identifier?: string;\n amount: string;\n usdValue: string;\n } | null = null;\n\n let fungibleTransaction:\n | (FungibleTransactionType & {\n type: NftEnumType.NonFungibleESDT | NftEnumType.SemiFungibleESDT;\n })\n | null = null;\n\n const extractTransactionsInfo = getExtractTransactionsInfo({\n egldLabel,\n sender,\n apiAddress: network.apiAddress,\n address,\n parsedTransactionsByDataField\n });\n\n const plainTransaction = currentTransaction.transaction.toPlainObject();\n const txInfo = await extractTransactionsInfo(currentTransaction);\n\n const isEgld = !txInfo?.transactionTokenInfo?.tokenId;\n const { tokenId, nonce, amount = '' } = txInfo?.transactionTokenInfo ?? {};\n\n const isNftOrSft = tokenId && nonce && nonce.length > 0;\n const tokenIdForTokenDetails = isNftOrSft ? `${tokenId}-${nonce}` : tokenId;\n\n const tokenDetails = await getPersistedTokenDetails({\n tokenId: tokenIdForTokenDetails\n });\n\n const { esdtPrice, tokenDecimals, type, identifier, tokenImageUrl } =\n tokenDetails;\n\n const isNft =\n type === NftEnumType.SemiFungibleESDT ||\n type === NftEnumType.NonFungibleESDT;\n\n if (isNft) {\n fungibleTransaction = {\n type,\n identifier,\n amount,\n imageURL: tokenImageUrl\n };\n } else {\n const getFormattedAmount = ({ addCommas }: { addCommas: boolean }) =>\n formatAmount({\n input: isEgld\n ? currentTransaction.transaction.value.toString()\n : amount,\n decimals: isEgld ? Number(network.decimals) : tokenDecimals,\n digits: Number(network.digits),\n showLastNonZeroDecimal: false,\n addCommas\n });\n\n const formattedAmount = getFormattedAmount({ addCommas: true });\n const rawAmount = getFormattedAmount({ addCommas: false });\n const tokenPrice = Number(isEgld ? price : esdtPrice);\n const usdValue = getUsdValue({\n amount: rawAmount,\n usd: tokenPrice,\n addEqualSign: true\n });\n\n const esdtIdentifier =\n identifier === MULTI_TRANSFER_EGLD_TOKEN ? egldLabel : identifier;\n tokenTransaction = {\n identifier: esdtIdentifier ?? egldLabel,\n amount: formattedAmount,\n usdValue\n };\n }\n\n const { feeLimitFormatted, feeInFiatLimit } = getFeeData({\n transaction,\n price\n });\n\n const ppuOptions = getPpuOptions({\n shard,\n initialGasPrice: gasPriceData.initialGasPrice,\n transaction: plainTransaction,\n gasStationMetadata: network.gasStationMetadata\n });\n\n const gasPrice = getRecommendedGasPrice({\n transaction: plainTransaction,\n gasPriceData\n });\n\n const provider = getAccountProvider();\n const providerType = provider.getType();\n const providerName = capitalize(providerType as string);\n const transactionsCount = allTransactions.length;\n\n const currentIndexToSign =\n signedIndexes.length > 0 ? signedIndexes[signedIndexes.length - 1] + 1 : 0;\n\n const data = decodeBase64(\n currentTransaction.transaction.data.toString() ?? ''\n );\n\n const highlight = getHighlight(txInfo?.transactionTokenInfo);\n const decodedData = getAllDecodedFormats({ data, identifier, highlight });\n const explorerAddress = getExplorerAddress();\n const explorerLink = getExplorerLink({\n to: `/${ACCOUNTS_ENDPOINT}/${address}`,\n explorerAddress\n });\n\n const needsSigning =\n transactionsCount === 1 ||\n (txInfo?.needsSigning && !signedIndexes.includes(currentScreenIndex));\n\n const formattedGasPrice = formatAmount({\n input: gasPrice.toString(),\n decimals: DECIMALS,\n addCommas: true,\n digits: DIGITS\n });\n\n const formattedGasLimit = new BigNumber(plainTransaction.gasLimit).toFormat({\n decimalSeparator: ',',\n groupSeparator: '.',\n groupSize: 3\n });\n\n const commonData: ISignTransactionsPanelCommonData = {\n receiver: plainTransaction.receiver.toString(),\n data: decodeBase64(currentTransaction.transaction.data.toString() ?? ''),\n decodedData,\n gasPrice: formattedGasPrice,\n gasLimit: formattedGasLimit,\n explorerLink,\n ppu: gasPriceData.ppu,\n ppuOptions,\n egldLabel,\n tokenType: getTokenType(type),\n feeLimit: feeLimitFormatted,\n feeInFiatLimit,\n transactionsCount,\n currentIndex: currentScreenIndex,\n currentIndexToSign,\n highlight,\n scCall: getScCall(txInfo?.transactionTokenInfo),\n needsSigning,\n isEditable: txInfo?.needsSigning,\n providerName,\n address,\n username,\n origin: safeWindow.location
|
|
5
|
-
"mappings": "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
|
|
4
|
+
"sourcesContent": ["import { BigNumber } from 'bignumber.js';\nimport { ACCOUNTS_ENDPOINT } from 'apiCalls';\nimport { getPersistedTokenDetails } from 'apiCalls/tokens/getPersistedTokenDetails';\nimport { MULTI_TRANSFER_EGLD_TOKEN } from 'constants/mvx.constants';\nimport { safeWindow } from 'constants/window.constants';\nimport { DECIMALS, DIGITS, formatAmount } from 'lib/sdkDappUtils';\nimport {\n FungibleTransactionType,\n ISignTransactionsPanelCommonData\n} from 'managers/internal/SignTransactionsStateManager/types';\nimport { getExplorerAddress } from 'methods/network/getExplorerAddress';\nimport { getAccountProvider } from 'providers/helpers/accountProvider';\nimport { NetworkType } from 'types/network.types';\nimport { NftEnumType } from 'types/tokens.types';\nimport {\n MultiSignTransactionType,\n TransactionDataTokenType\n} from 'types/transactions.types';\nimport { decodeBase64 } from 'utils/decoders/base64Utils';\nimport { capitalize } from 'utils/operations/capitalize';\nimport { getUsdValue } from 'utils/operations/getUsdValue';\nimport { getExplorerLink } from 'utils/transactions/getExplorerLink';\nimport { getFeeData } from '../getFeeData';\nimport { getAllDecodedFormats } from './helpers/decodeDataField';\nimport { getExtractTransactionsInfo } from './helpers/getExtractTransactionsInfo';\nimport { getHighlight } from './helpers/getHighlight';\nimport { getPpuOptions } from './helpers/getPpuOptions';\nimport { getRecommendedGasPrice } from './helpers/getRecommendedGasPrice';\nimport { getScCall } from './helpers/getScCall';\nimport { getTokenType } from './helpers/getTokenType';\n\nexport type GetCommonDataPropsType = {\n allTransactions: MultiSignTransactionType[];\n currentScreenIndex: number;\n price?: number;\n network: NetworkType;\n signedIndexes: number[];\n egldLabel: string;\n address: string;\n shard?: number;\n username?: string;\n parsedTransactionsByDataField: Record<string, TransactionDataTokenType>;\n gasPriceData: {\n initialGasPrice: number;\n ppu: ISignTransactionsPanelCommonData['ppu'];\n };\n};\n\nexport async function getCommonData({\n allTransactions,\n currentScreenIndex,\n egldLabel,\n network,\n gasPriceData,\n price,\n address,\n username,\n shard,\n signedIndexes,\n parsedTransactionsByDataField\n}: GetCommonDataPropsType) {\n const currentTransaction = allTransactions[currentScreenIndex];\n const sender = currentTransaction?.transaction?.sender.toString();\n const transaction = currentTransaction?.transaction;\n\n let tokenTransaction: {\n identifier?: string;\n amount: string;\n usdValue: string;\n } | null = null;\n\n let fungibleTransaction:\n | (FungibleTransactionType & {\n type: NftEnumType.NonFungibleESDT | NftEnumType.SemiFungibleESDT;\n })\n | null = null;\n\n const extractTransactionsInfo = getExtractTransactionsInfo({\n egldLabel,\n sender,\n apiAddress: network.apiAddress,\n address,\n parsedTransactionsByDataField\n });\n\n const plainTransaction = currentTransaction.transaction.toPlainObject();\n const txInfo = await extractTransactionsInfo(currentTransaction);\n\n const isEgld = !txInfo?.transactionTokenInfo?.tokenId;\n const { tokenId, nonce, amount = '' } = txInfo?.transactionTokenInfo ?? {};\n\n const isNftOrSft = tokenId && nonce && nonce.length > 0;\n const tokenIdForTokenDetails = isNftOrSft ? `${tokenId}-${nonce}` : tokenId;\n\n const tokenDetails = await getPersistedTokenDetails({\n tokenId: tokenIdForTokenDetails\n });\n\n const { esdtPrice, tokenDecimals, type, identifier, tokenImageUrl } =\n tokenDetails;\n\n const isNft =\n type === NftEnumType.SemiFungibleESDT ||\n type === NftEnumType.NonFungibleESDT;\n\n if (isNft) {\n fungibleTransaction = {\n type,\n identifier,\n amount,\n imageURL: tokenImageUrl\n };\n } else {\n const getFormattedAmount = ({ addCommas }: { addCommas: boolean }) =>\n formatAmount({\n input: isEgld\n ? currentTransaction.transaction.value.toString()\n : amount,\n decimals: isEgld ? Number(network.decimals) : tokenDecimals,\n digits: Number(network.digits),\n showLastNonZeroDecimal: false,\n addCommas\n });\n\n const formattedAmount = getFormattedAmount({ addCommas: true });\n const rawAmount = getFormattedAmount({ addCommas: false });\n const tokenPrice = Number(isEgld ? price : esdtPrice);\n const usdValue = getUsdValue({\n amount: rawAmount,\n usd: tokenPrice,\n addEqualSign: true\n });\n\n const esdtIdentifier =\n identifier === MULTI_TRANSFER_EGLD_TOKEN ? egldLabel : identifier;\n tokenTransaction = {\n identifier: esdtIdentifier ?? egldLabel,\n amount: formattedAmount,\n usdValue\n };\n }\n\n const { feeLimitFormatted, feeInFiatLimit } = getFeeData({\n transaction,\n price\n });\n\n const ppuOptions = getPpuOptions({\n shard,\n initialGasPrice: gasPriceData.initialGasPrice,\n transaction: plainTransaction,\n gasStationMetadata: network.gasStationMetadata\n });\n\n const gasPrice = getRecommendedGasPrice({\n transaction: plainTransaction,\n gasPriceData\n });\n\n const provider = getAccountProvider();\n const providerType = provider.getType();\n const providerName = capitalize(providerType as string);\n const transactionsCount = allTransactions.length;\n\n const currentIndexToSign =\n signedIndexes.length > 0 ? signedIndexes[signedIndexes.length - 1] + 1 : 0;\n\n const data = decodeBase64(\n currentTransaction.transaction.data.toString() ?? ''\n );\n\n const highlight = getHighlight(txInfo?.transactionTokenInfo);\n const decodedData = getAllDecodedFormats({ data, identifier, highlight });\n const explorerAddress = getExplorerAddress();\n const explorerLink = getExplorerLink({\n to: `/${ACCOUNTS_ENDPOINT}/${address}`,\n explorerAddress\n });\n\n const needsSigning =\n transactionsCount === 1 ||\n (txInfo?.needsSigning && !signedIndexes.includes(currentScreenIndex));\n\n const formattedGasPrice = formatAmount({\n input: gasPrice.toString(),\n decimals: DECIMALS,\n addCommas: true,\n digits: DIGITS\n });\n\n const formattedGasLimit = new BigNumber(plainTransaction.gasLimit).toFormat({\n decimalSeparator: ',',\n groupSeparator: '.',\n groupSize: 3\n });\n\n const commonData: ISignTransactionsPanelCommonData = {\n receiver: plainTransaction.receiver.toString(),\n data: decodeBase64(currentTransaction.transaction.data.toString() ?? ''),\n decodedData,\n gasPrice: formattedGasPrice,\n gasLimit: formattedGasLimit,\n explorerLink,\n ppu: gasPriceData.ppu,\n ppuOptions,\n egldLabel,\n tokenType: getTokenType(type),\n feeLimit: feeLimitFormatted,\n feeInFiatLimit,\n transactionsCount,\n currentIndex: currentScreenIndex,\n currentIndexToSign,\n highlight,\n scCall: getScCall(txInfo?.transactionTokenInfo),\n needsSigning,\n isEditable: txInfo?.needsSigning,\n providerName,\n address,\n username,\n origin: safeWindow.location?.origin\n };\n\n return { commonData, tokenTransaction, fungibleTransaction };\n}\n"],
|
|
5
|
+
"mappings": "yxBAAA,OAAS,aAAAA,OAAiB,eAgD1B,eAAsBC,GAAc,CAClC,gBAAAC,EACA,mBAAAC,EACA,UAAAC,EACA,QAAAC,EACA,aAAAC,EACA,MAAAC,EACA,QAAAC,EACA,SAAAC,EACA,MAAAC,EACA,cAAAC,EACA,8BAAAC,CACF,EAA2B,CACzB,IAAMC,EAAqBX,EAAgBC,CAAkB,EACvDW,EAASD,GAAoB,aAAa,OAAO,SAAS,EAC1DE,EAAcF,GAAoB,YAEpCG,EAIO,KAEPC,EAIO,KAELC,EAA0BC,EAA2B,CACzD,UAAAf,EACA,OAAAU,EACA,WAAYT,EAAQ,WACpB,QAAAG,EACA,8BAAAI,CACF,CAAC,EAEKQ,EAAmBP,EAAmB,YAAY,cAAc,EAChEQ,EAAS,MAAMH,EAAwBL,CAAkB,EAEzDS,EAAS,CAACD,GAAQ,sBAAsB,QACxC,CAAE,QAAAE,EAAS,MAAAC,EAAO,OAAAC,EAAS,EAAG,EAAIJ,GAAQ,sBAAwB,CAAC,EAGnEK,EADaH,GAAWC,GAASA,EAAM,OAAS,EACV,GAAGD,CAAO,IAAIC,CAAK,GAAKD,EAE9DI,EAAe,MAAMC,EAAyB,CAClD,QAASF,CACX,CAAC,EAEK,CAAE,UAAAG,EAAW,cAAAC,EAAe,KAAAC,EAAM,WAAAC,EAAY,cAAAC,CAAc,EAChEN,EAMF,GAHEI,wBACAA,sBAGAd,EAAsB,CACpB,KAAAc,EACA,WAAAC,EACA,OAAAP,EACA,SAAUQ,CACZ,MACK,CACL,IAAMC,EAAqB,CAAC,CAAE,UAAAC,EAAU,IACtCC,EAAa,CACX,MAAOd,EACHT,EAAmB,YAAY,MAAM,SAAS,EAC9CY,EACJ,SAAUH,EAAS,OAAOjB,EAAQ,QAAQ,EAAIyB,EAC9C,OAAQ,OAAOzB,EAAQ,MAAM,EAC7B,uBAAwB,GACxB,UAAA8B,EACF,CAAC,EAEGE,GAAkBH,EAAmB,CAAE,UAAW,EAAK,CAAC,EACxDI,GAAYJ,EAAmB,CAAE,UAAW,EAAM,CAAC,EACnDK,GAAa,OAAOjB,EAASf,EAAQsB,CAAS,EAC9CW,GAAWC,EAAY,CAC3B,OAAQH,GACR,IAAKC,GACL,aAAc,EAChB,CAAC,EAIDvB,EAAmB,CACjB,YAFAgB,IAAeU,EAA4BtC,EAAY4B,IAEzB5B,EAC9B,OAAQiC,GACR,SAAAG,EACF,CACF,CAEA,GAAM,CAAE,kBAAAG,GAAmB,eAAAC,EAAe,EAAIC,EAAW,CACvD,YAAA9B,EACA,MAAAR,CACF,CAAC,EAEKuC,GAAaC,EAAc,CAC/B,MAAArC,EACA,gBAAiBJ,EAAa,gBAC9B,YAAac,EACb,mBAAoBf,EAAQ,kBAC9B,CAAC,EAEK2C,GAAWC,EAAuB,CACtC,YAAa7B,EACb,aAAAd,CACF,CAAC,EAGK4C,GADWC,EAAmB,EACN,QAAQ,EAChCC,GAAeC,EAAWH,EAAsB,EAChDI,EAAoBpD,EAAgB,OAEpCqD,GACJ5C,EAAc,OAAS,EAAIA,EAAcA,EAAc,OAAS,CAAC,EAAI,EAAI,EAErE6C,GAAOC,EACX5C,EAAmB,YAAY,KAAK,SAAS,GAAK,EACpD,EAEM6C,EAAYC,EAAatC,GAAQ,oBAAoB,EACrDuC,GAAcC,EAAqB,CAAE,KAAAL,GAAM,WAAAxB,EAAY,UAAA0B,CAAU,CAAC,EAClEI,GAAkBC,EAAmB,EACrCC,GAAeC,EAAgB,CACnC,GAAI,IAAIC,CAAiB,IAAI1D,CAAO,GACpC,gBAAAsD,EACF,CAAC,EAEKK,GACJb,IAAsB,GACrBjC,GAAQ,cAAgB,CAACV,EAAc,SAASR,CAAkB,EAE/DiE,GAAoBhC,EAAa,CACrC,MAAOY,GAAS,SAAS,EACzB,SAAUqB,EACV,UAAW,GACX,OAAQC,CACV,CAAC,EAEKC,GAAoB,IAAIC,GAAUpD,EAAiB,QAAQ,EAAE,SAAS,CAC1E,iBAAkB,IAClB,eAAgB,IAChB,UAAW,CACb,CAAC,EA4BD,MAAO,CAAE,WA1B4C,CACnD,SAAUA,EAAiB,SAAS,SAAS,EAC7C,KAAMqC,EAAa5C,EAAmB,YAAY,KAAK,SAAS,GAAK,EAAE,EACvE,YAAA+C,GACA,SAAUQ,GACV,SAAUG,GACV,aAAAP,GACA,IAAK1D,EAAa,IAClB,WAAAwC,GACA,UAAA1C,EACA,UAAWqE,EAAa1C,CAAI,EAC5B,SAAUY,GACV,eAAAC,GACA,kBAAAU,EACA,aAAcnD,EACd,mBAAAoD,GACA,UAAAG,EACA,OAAQgB,EAAUrD,GAAQ,oBAAoB,EAC9C,aAAA8C,GACA,WAAY9C,GAAQ,aACpB,aAAA+B,GACA,QAAA5C,EACA,SAAAC,EACA,OAAQkE,EAAW,UAAU,MAC/B,EAEqB,iBAAA3D,EAAkB,oBAAAC,CAAoB,CAC7D",
|
|
6
6
|
"names": ["BigNumber", "getCommonData", "allTransactions", "currentScreenIndex", "egldLabel", "network", "gasPriceData", "price", "address", "username", "shard", "signedIndexes", "parsedTransactionsByDataField", "currentTransaction", "sender", "transaction", "tokenTransaction", "fungibleTransaction", "extractTransactionsInfo", "getExtractTransactionsInfo", "plainTransaction", "txInfo", "isEgld", "tokenId", "nonce", "amount", "tokenIdForTokenDetails", "tokenDetails", "getPersistedTokenDetails", "esdtPrice", "tokenDecimals", "type", "identifier", "tokenImageUrl", "getFormattedAmount", "addCommas", "formatAmount", "formattedAmount", "rawAmount", "tokenPrice", "usdValue", "getUsdValue", "MULTI_TRANSFER_EGLD_TOKEN", "feeLimitFormatted", "feeInFiatLimit", "getFeeData", "ppuOptions", "getPpuOptions", "gasPrice", "getRecommendedGasPrice", "providerType", "getAccountProvider", "providerName", "capitalize", "transactionsCount", "currentIndexToSign", "data", "decodeBase64", "highlight", "getHighlight", "decodedData", "getAllDecodedFormats", "explorerAddress", "getExplorerAddress", "explorerLink", "getExplorerLink", "ACCOUNTS_ENDPOINT", "needsSigning", "formattedGasPrice", "DECIMALS", "DIGITS", "formattedGasLimit", "BigNumber", "getTokenType", "getScCall", "safeWindow"]
|
|
7
7
|
}
|
|
@@ -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-6NRL7OLL.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-2FKKBSB4.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-6NRL7OLL.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-33NGD6LW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-BNVOP5SM.mjs";import{a as g}from"./chunk-3S57OP4Z.mjs";import{NativeAuthClient as y}from"@multiversx/sdk-native-auth-client";var H=f=>{let{origin:o,apiAddress:i,expirySeconds:r,blockHashShard:s,extraInfo:u,gatewayUrl:d,extraRequestHeaders:k}=h(f),e=new y({origin:o,apiUrl:i,expirySeconds:r,blockHashShard:s,gatewayUrl:d,extraRequestHeaders:k});return{initialize:async t=>{if(!i||!o)return"";let a=()=>e.getCurrentBlockHash(),n=t?.latestBlockInfo;n??=await g({apiAddress:i,blockHashShard:s,getBlockHash:a,noCache:t?.noCache});let{hash:p,timestamp:c}=n,m=e.encodeValue(JSON.stringify({...t?.extraInfo??u,...c?{timestamp:c}:{}}));return`${e.encodeValue(o)}.${p}.${r}.${m}`},getToken:({address:t,token:a,signature:n})=>e.getToken(t,a,n),getTokenExpiration:l}};export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3EEDALSW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-ECZH2TNF.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-3LZAM52Q.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-33NGD6LW.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-465RHWQ5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-X5E2DC6M.mjs";import{a as o}from"./chunk-OJV6XRG5.mjs";import{a as e,b as t}from"./chunk-CUBNX4ZT.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-4VFF2EHB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-PE4P3KI6.mjs";import{a as s}from"./chunk-S7TUDNXQ.mjs";import{a as k}from"./chunk-3OKWBJFM.mjs";import{a as L}from"./chunk-YYW6XBAT.mjs";import{b as A}from"./chunk-5V3N4MOZ.mjs";import{a as I}from"./chunk-BRJNX4JF.mjs";import{g as p}from"./chunk-6NRL7OLL.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-52VQSACM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-XO3OXUDH.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-5CDLB7VW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-TJN2VTAD.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-5JZI77YI.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{u as e}from"./chunk-6NRL7OLL.mjs";import{b as t}from"./chunk-SAAOQW7P.mjs";import{x as r}from"./chunk-KD2IQ32V.mjs";import i from"axios";var T=async o=>{let{apiAddress:s}=t(e()),{data:a}=await i.get(`${s}/${r}`,{params:{hashes:o.join(","),withScResults:!0}});return a};export{T as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5R3VZX6E.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-CUBNX4ZT.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-5SUSXTTZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{s as c}from"./chunk-6NRL7OLL.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-5V3N4MOZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-SRHVF3CF.mjs";import{a as S}from"./chunk-465RHWQ5.mjs";import{a as o}from"./chunk-FMQYLMTU.mjs";import{a as y}from"./chunk-MFUQ5NBC.mjs";import{b as i,c as f}from"./chunk-33NGD6LW.mjs";import{l}from"./chunk-65L5EBBL.mjs";var u={};async function d({serverTransaction:e,sessionId:t,isSequential:c}){let{hash:a,status:r,results:m,invalidTransaction:n,hasStatusChanged:p}=e;try{if(u[a]>30){i({sessionId:t,status:"timedOut"}),await o({sessionId:t,status:"timedOut"});return}if(n&&!c||r==="sent"){u[a]=u[a]?u[a]+1:1;return}if(c&&!r){let s=f({sessionId:t,transaction:e});await o({sessionId:t,status:s});return}if(p){let s=f({sessionId:t,transaction:e});await o({sessionId:t,status:s})}l(r)&&await S({sessionId:t,hash:a,results:m})}catch(T){console.error(T),i({sessionId:t,status:"timedOut"}),await o({sessionId:t,status:"timedOut"})}}async function R({sessionId:e,transactionBatch:t,isSequential:c}){try{if(t==null)return;let a=y(t),r=await h(a);for(let n of r)await d({serverTransaction:n,sessionId:e,isSequential:c});if(r.every(n=>n.status!=="pending")){if(r.every(s=>s.status==="success"))return i({sessionId:e,status:"success"});if(r.some(s=>s.status==="fail"))return i({sessionId:e,status:"fail"});if(r.every(s=>s.invalidTransaction))return i({sessionId:e,status:"invalid"})}}catch(a){console.error(a)}}export{R as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5VAGLG3Y.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-5SUSXTTZ.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-6FIRQBP7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-EXMSBG6B.mjs";import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as f}from"./chunk-Y3BNMQFP.mjs";import{h as l}from"./chunk-EBWZONUV.mjs";import{h as d}from"./chunk-CAA4VJRH.mjs";import{b as g}from"./chunk-3ZEUVYQF.mjs";import{a as u}from"./chunk-33NGD6LW.mjs";import{a as m}from"./chunk-L3MWDI6J.mjs";import{a as y}from"./chunk-ARJZ4W7T.mjs";import{u as p}from"./chunk-6NRL7OLL.mjs";import{b as c}from"./chunk-SAAOQW7P.mjs";import{e as T}from"./chunk-R53MCZI6.mjs";import b from"axios";var r=class r{constructor(){this.setCallbacks=({onSuccess:a,onFail:t})=>{g({onSuccess:a,onFail:t})};this.send=async a=>{if(a.length===0)throw new Error("No transactions to send");try{if(!S(a))return await this.sendSignedTransactions(a);let t=await this.sendSignedBatchTransactions(a);if(!t.data||t.data.error)throw new Error(t.data?.error??"Failed to send transactions");return t.data.transactions}catch(t){throw t.response?.data?.message??t.message}};this.track=async(a,t={disableToasts:!1})=>{let n=this.sequentialToFlatArray(a).map(i=>({...i,status:i.status??"pending"})),e=m(n),o=u({transactions:n,transactionsDisplayInfo:t.transactionsDisplayInfo,status:e??"sent",sessionInformation:t.sessionInformation});if(t.disableToasts===!0)return o;let s=h(a);return l({toastId:o,totalDuration:s}),o};this.sendSignedTransactions=async a=>{let{apiAddress:t,apiTimeout:n}=c(p()),e=a.map(s=>b.post(`${t}/transactions`,s.toPlainObject(),{timeout:Number(n)}));return(await Promise.all(e)).map(({data:s})=>({...s,status:"pending",hash:s.txHash}))};this.sendSignedBatchTransactions=async a=>{let{address:t}=y(),{apiAddress:n,apiTimeout:e}=c(p());if(!t)return{error:"Invalid address provided. You need to be logged in to send transactions"};let o=this.buildBatchId(t),i={transactions:a.map(w=>w.map(v=>this.parseSignedTransaction(v))),id:o},{data:A}=await b.post(`${n}/batch`,i,{timeout:Number(e)});return{data:A}};this.buildBatchId=a=>`${Date.now().toString()}${d}${a}`;this.sequentialToFlatArray=(a=[])=>this.getIsSequential(a)?a.flat():a;this.getIsSequential=a=>a?.every(t=>Array.isArray(t));this.parseSignedTransaction=a=>{let t=new T,n={...a.toPlainObject(),hash:t.computeTransactionHash(a),status:"pending"};return f({data:n.data})&&(delete n.senderUsername,delete n.receiverUsername),n}}static getInstance(){return r.instance||(r.instance=new r),r.instance}};r.instance=null;var I=r;export{I as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6KI6UL6C.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as s,f as l}from"./chunk-QJSB5NX4.mjs";import{f as a}from"./chunk-VNLGNNIL.mjs";import{a as d,b as L}from"./chunk-NLRDRI7Q.mjs";import{a as k}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s,f as l}from"./chunk-QJSB5NX4.mjs";import{f as a}from"./chunk-VNLGNNIL.mjs";import{a as d,b as L}from"./chunk-NLRDRI7Q.mjs";import{a as k}from"./chunk-IQADSDGP.mjs";import{a as v}from"./chunk-KRWR77QE.mjs";import{b as y}from"./chunk-A7FTKX2A.mjs";import{a as g,b as c}from"./chunk-7BP53CXF.mjs";import{a as f,b as m}from"./chunk-X4XULIVT.mjs";import{a as T}from"./chunk-SUN3MVLZ.mjs";import{a as S,b as u}from"./chunk-VKEESSBI.mjs";import{a as x}from"./chunk-2DNGCNYM.mjs";import{a as I}from"./chunk-NB7A4C7L.mjs";import{c as p}from"./chunk-R53MCZI6.mjs";import{createJSONStorage as h,devtools as O,persist as V}from"zustand/middleware";import{immer as H}from"zustand/middleware/immer";import{createStore as N}from"zustand/vanilla";var A=e=>{e.account=g,e.loginInfo=f,e.transactions=d,e.toasts=S};function R(){return new Date().setHours(new Date().getHours()+24)}function w(e){if(e==null){E();return}b(e)}var C=e=>{let t=l(e),n=a(e),{address:i,publicKey:M}=s(e);if(i&&M!==new p(i).hex()&&A(e),!t)return;if(n==null){w(R());return}let P=Date.now();n-P<0&&(w(null),o().setState(A))};var W=(e,t)=>{C(e)};var z=e=>{let t=N(O(V(H((...n)=>({network:x(...n),account:c(...n),loginInfo:m(...n),config:T(...n),transactions:L(...n),toasts:u(...n),cache:y(...n),ui:I(...n)})),{name:"sdk-dapp-store",storage:h(e)})));return t.subscribe(W),t},r,D=e=>{r=e},o=()=>(r||D(z(()=>new v)),r),ae=(e=k)=>D(z(e)),pe=()=>o().getState();var fe=e=>o().setState(({loginInfo:t})=>{t.providerType=e},!1,"setProviderType"),me=e=>o().setState(({loginInfo:t})=>{t.tokenLogin=e},!1,"setTokenLogin"),Se=e=>o().setState(({loginInfo:t})=>{if(t.tokenLogin!=null){t.tokenLogin.loginToken=e;return}t.tokenLogin={loginToken:e}},!1,"setLoginToken"),ue=e=>o().setState(({loginInfo:t})=>{t?.tokenLogin!=null&&(t.tokenLogin.signature=e)},!1,"setTokenLoginSignature"),de=e=>o().setState(({loginInfo:t})=>{t.walletLogin=e},!1,"setWalletLogin"),Le=e=>o().setState(({loginInfo:t})=>{t.walletConnectLogin=e},!1,"setWalletConnectLogin"),xe=e=>o().setState(({loginInfo:t})=>{t.ledgerLogin=e},!1,"setLedgerLogin"),Te=e=>o().setState(({loginInfo:t})=>{t.logoutRoute=e},!1,"setLogoutRoute"),ye=e=>o().setState(({loginInfo:t})=>{t.isWalletConnectV2Initialized=e},!1,"setIsWalletConnectV2Initialized"),E=()=>o().setState(({loginInfo:e})=>{e.loginExpiresAt=null},!1,"removeLoginExpiresAt"),b=e=>o().setState(({loginInfo:t})=>{t.loginExpiresAt=e},!1,"addLoginExpiresAt");export{fe as a,me as b,Se as c,ue as d,de as e,Le as f,xe as g,Te as h,ye as i,E as j,b as k,A as l,R as m,w as n,C as o,W as p,z as q,D as r,o as s,ae as t,pe as u};
|
|
2
|
+
//# sourceMappingURL=chunk-6NRL7OLL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-GLDB2NRB.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-72VJ6ESJ.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-6NRL7OLL.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-ATEXXLUV.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as t}from"./chunk-KCP2UWHU.mjs";import{c as n}from"./chunk-6NRL7OLL.mjs";async function c({loginToken:r,extraInfoData:i,address:e}){let o=await t({originalLoginToken:r,extraInfoData:i,address:e});return o.modifiedLoginToken&&n(o.modifiedLoginToken),o.address}export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-B4RZU4FG.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-MAY7DC6U.mjs";var i=e=>{let t=a();return{origin:e?.origin??t.origin,blockHashShard:e?.blockHashShard,expirySeconds:e?.expirySeconds??t.expirySeconds,apiAddress:e?.apiAddress??t.apiAddress,tokenExpirationToastWarningSeconds:e?.tokenExpirationToastWarningSeconds??t.tokenExpirationToastWarningSeconds,extraInfo:e?.extraInfo??{},gatewayUrl:e?.gatewayUrl,extraRequestHeaders:e?.extraRequestHeaders??{}}};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BNVOP5SM.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-6NRL7OLL.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-C5VJMWLU.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.16'; // 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 ot}from"./chunk-BLUKJJTY.mjs";import{a as ct}from"./chunk-6UZHM5LW.mjs";import{a as C}from"./chunk-532QQEN4.mjs";import{a as mt}from"./chunk-QCJMV6NU.mjs";import{a as L}from"./chunk-5MDDPC5M.mjs";import{a as Q,b as X,g as Z,l as tt}from"./chunk-CAA4VJRH.mjs";import{a as lt}from"./chunk-AZ2KOM5R.mjs";import{b}from"./chunk-MYCXIA5W.mjs";import{a as pt}from"./chunk-O67FZOYR.mjs";import{a as ht}from"./chunk-4ODPAHHA.mjs";import{a as gt}from"./chunk-Z5CDCI3Y.mjs";import{a as dt}from"./chunk-T5GA3FRJ.mjs";import{a as g}from"./chunk-HACVN4R6.mjs";import{a as J}from"./chunk-QYV4JQI5.mjs";import{a as rt}from"./chunk-AZGVI4QW.mjs";import{a as S}from"./chunk-4USFY3DC.mjs";import{a as y,f as ut}from"./chunk-MXLRZPMK.mjs";import{b as Tt}from"./chunk-YMSRWWNA.mjs";import{d as it}from"./chunk-Y4OUAJSG.mjs";import{k as st,l as et,n as nt}from"./chunk-65L5EBBL.mjs";import{a as A}from"./chunk-HORSXVIV.mjs";import{a as ft}from"./chunk-GZAAD3TR.mjs";import{a as j}from"./chunk-7H2PZVSJ.mjs";import{a as I}from"./chunk-QTKK6OSJ.mjs";import{a as E}from"./chunk-6FXEHNGW.mjs";import{a as It}from"./chunk-NJN53MJV.mjs";import{a as Y}from"./chunk-YSCND2MX.mjs";import{b as V,s as u,u as q}from"./chunk-GZTGHNVI.mjs";import{c as $,f as G}from"./chunk-QJSB5NX4.mjs";import{b as d}from"./chunk-VNLGNNIL.mjs";import{b as h}from"./chunk-IEJTMYFW.mjs";import{b as H,c as K,f as z}from"./chunk-R53MCZI6.mjs";import{b as vt}from"./chunk-3LBQYLDY.mjs";import{a as at}from"./chunk-VML7BRY5.mjs";import{a as v}from"./chunk-OJV6XRG5.mjs";import _ from"lodash.isequal";import Et from"lodash.isequal";var Nt="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",w=class e extends rt{constructor(){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.store=u();this.initialData={pendingTransactions:[],historicTransactions:[]};this.data={...this.initialData}}static getInstance(){return e.instance||(e.instance=new e),e.instance}isNotificationsFeedOpen(){return this.isOpen}async openNotificationsFeed(){p.getInstance().hideToasts(),await this.openUI(),await this.updateDataAndNotifications();let s=this.store.subscribe(async({toasts:n,transactions:i},{toasts:a,transactions:c})=>{(!Et(a.transactionToasts,n.transactionToasts)||!Et(c,i))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Nt,[s]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}handleCloseUI(){let o=p.getInstance();this.closeUI(),o.showToasts()}async setupEventListeners(){this.eventBus&&(this.subscribeToEventBus("CLOSE_NOTIFICATIONS_FEED",this.handleCloseUI.bind(this)),this.subscribeToEventBus("CLEAR_NOTIFICATIONS_FEED_HISTORY",this.handleClearNotificationsFeedHistory.bind(this)))}async updateDataAndNotifications(){let{transactions:o,account:s,toasts:n,network:i}=this.store.getState(),{pendingTransactionToasts:a}=await C({toastList:n,transactionsSessions:o,account:s});this.data.pendingTransactions=a,this.data.historicTransactions=await ot.getTransactionsHistory({transactionsSessions:o,address:s.address,explorerAddress:i.network.explorerAddress,egldLabel:i.network.egldLabel}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){it(),this.resetData(),this.updateNotificationsFeed()}async updateNotificationsFeed(){this.eventBus&&(this.eventBus.publish("PENDING_TRANSACTIONS_UPDATE",this.data.pendingTransactions),this.eventBus.publish("TRANSACTIONS_HISTORY_UPDATE",this.data.historicTransactions))}};import R from"bignumber.js";var x=class e{constructor(){this.store=u();this.warningLogoutTimeoutRef=null;this.actualLogoutTimeoutRef=null;this.plannedLogoutTimeoutRef=null;this.plannedLogoutKey=null;this.init=async()=>{if(!this.shouldStart())return;let t=this.store.getState(),o=d(t),{isExpired:s}=I(o?.nativeAuthToken);s?f().logout():this.addPlannedLogout()};this.stop=()=>{clearTimeout(this.warningLogoutTimeoutRef??0),clearTimeout(this.plannedLogoutTimeoutRef??0),clearTimeout(this.actualLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=null,this.plannedLogoutTimeoutRef=null,this.actualLogoutTimeoutRef=null,this.plannedLogoutKey=null};this.shouldStart=()=>{let t=this.store.getState(),o=d(t),s=G(t);return!!(o?.nativeAuthToken&&s)};this.addPlannedLogout=()=>{let t=f(),o=$(this.store.getState()),s=t.getType()===v.webview;if(!o||s)return;this.addLogoutWarning();let n=d(this.store.getState()),{secondsUntilExpires:i,expiresAt:a}=I(n?.nativeAuthToken),c=new R(String(i)),r=`${o}_${a}`,m=this.plannedLogoutKey===r;if(!(i&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=r,clearTimeout(this.plannedLogoutTimeoutRef??0);let W=c.times(1e3);this.actualLogoutTimeoutRef=setTimeout(()=>{p.getInstance().createCustomToast({toastId:"native-auth-logout",iconClassName:"warning",title:"Logging out",icon:"times",message:"Your session has expired!"}),this.actualLogoutTimeoutRef=null},W.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},W.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=h(this.store.getState()),o=d(this.store.getState()),{secondsUntilExpires:s}=I(o?.nativeAuthToken),n=new R(String(s)),i=n.times(1e3);if(!s||n.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new R(t?.tokenExpirationToastWarningSeconds??0).times(1e3),r=n.times(1e3).minus(c),m=ct(i.toNumber()),T=r.isLessThanOrEqualTo(0)?0:r.toNumber();clearTimeout(this.warningLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=setTimeout(()=>{p.getInstance().createCustomToast({toastId:"native-auth-expired",iconClassName:"warning",title:"Session Expiration Warning",icon:"hourglass",message:`Your session will expire in ${m}!`}),this.warningLogoutTimeoutRef=null},T)}}static getInstance(){return e.instance||(e.instance=new e),e.instance}};async function U({address:e,provider:t,apiAddress:o}){let s=await E({address:e,baseURL:o});if(!s)throw new Error("Account not found");Tt({address:e,providerType:t.getType()});let n={...s,username:A(s.username),nonce:S(s)};y(n),await b(e),L(),s.shard!=null&&await mt({shard:Number(s.shard),apiAddress:o})}async function Ot(e){let{network:{apiAddress:t}}=g();await e.login();let o=await e.getAddress();if(!o)throw new Error("Address not found");return await U({address:o,provider:e,apiAddress:t}),{address:o}}async function Ft({provider:e,nativeAuthConfig:t,token:o}){let{network:{apiAddress:s}}=g(),n=j(t),i=o;i||(i=await n.initialize({noCache:!0}));let{address:a,signature:c,...r}=await e.login({token:i});if(!a)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let m=n.getToken({address:a,token:i,signature:c});V({loginToken:i,signature:c,nativeAuthToken:m});let T=await pt({loginToken:i,extraInfoData:{multisig:r?.multisig,impersonate:r?.impersonate},address:a});return await U({address:T,provider:e,apiAddress:s}),{address:T,signature:c}}async function St(e,t){let o=h(q());if(o)return await Ft({provider:e,nativeAuthConfig:o,token:t?.token});let{address:s}=await Ot(e);return await b(s),L(),{address:s}}var k={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${X}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${Q}-${Date.now()}`}},Pt={extensionResponse:"Unable to sign transactions","Transaction canceled":"Transaction canceled","cancelled by user":"Transaction signing cancelled by user","denied by the user":"Transaction signing denied by the user"},Dt=e=>{for(let[t,o]of Object.entries(Pt))if(e.includes(t))return o;return"Error when signing"};function B(e,t="error"){let o=e?.message,s=Dt(o),i=s!=="Error when signing"?"warning":t,a=Object.keys(k).includes(i)?k[i]:k.error,{toastId:c,iconClassName:r,title:m}=a;return N({toastId:c,duration:1e4,icon:"times",iconClassName:r,message:s,title:m}),s}async function Ct({provider:e,transactions:t,options:o={}}){await yt();let{isGuarded:s,activeGuardianAddress:n,nonce:i}=ft(),a=e.getType()===v.ledger,c=ht({latestNonce:i,transactions:t}),r=n&&s&&!o.skipGuardian?c?.map(T=>(T.version=H.withTxOptions().valueOf(),T.options=z.withOptions({guarded:!0,...a?{hashSign:!0}:{}}).valueOf(),T.guardian=K.newFromBech32(n),T)):c,m=await e.signTransactions(r)??[];return ut(i+m.length),m}var M=class{constructor(t){this.provider=t}init(){return this.provider.init()}async login(t){let o=await St(this.provider,t);return x.getInstance().init(),o}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0,hasConsentPopup:!1}){return await lt({provider:this.provider,options:t})}setShouldShowConsentPopup(t){this.provider.setShouldShowConsentPopup?.(t)}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,o){try{return await Ct({provider:this.provider,transactions:t,options:o})}catch(s){let n=B(s);throw new Error(n)}}async signMessage(t,o){try{return await dt({provider:this.provider,message:t,options:o})}catch(s){let n=B(s,"warning");throw new Error(n)}}async verifyMessage(t){return await gt(t)}cancelLogin(){this.provider.cancelLogin?.()}};var bt=null;function ps(e){bt=e}function f(){return bt||new M(vt)}var Rt=async()=>{try{let e=J(),{network:t}=g();try{let o=await E({address:e,baseURL:t.apiAddress});if(o!=null){let s={...o,username:A(o.username),nonce:S(o)};return y(s),s}}catch(o){console.error("Failed getting account ",o)}}catch(e){console.error("Failed getting address ",e)}return null};async function yt(){let e=f();if(e==null)throw"Provider not initialized";try{if(!e.init)throw"Current provider does not have init() function";return await e.init()?Rt():void 0}catch(t){console.error("Failed initializing provider ",t)}}var O={},l={},Ut=(e,t)=>{u().setState(({toasts:o})=>{let s=o.customToasts.length>0?Math.max(...o.customToasts.map(r=>parseInt(r.toastId.split("-").pop()??"0"))):0,n=t??`custom-toast-${s+1}`,i=o.customToasts.findIndex(r=>r.toastId===n),a={...e,toastId:n};if(i!==-1){o.customToasts[i]=a;return}o.customToasts.push({...a,toastId:n})},!1,"addCustomToast")},F=e=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(o=>o.toastId!==e)},!1,"removeCustomToast")},Lt=()=>{u().setState(({toasts:e})=>{e.customToasts=[]},!1,"removeAllCustomToasts")},Ws=()=>{u().setState(({toasts:e})=>{e.transactionToasts=[]})},At=({toastId:e,totalDuration:t})=>{let o="";return u().setState(({toasts:s})=>{let n=s.transactionToasts.length>0?Math.max(...s.transactionToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0;o=e??`transaction-toast-${n+1}`,s.transactionToasts.push({startTime:Y(),endTime:It(t),toastId:o})},!1,"addTransactionToast"),o},P=e=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(o=>o.toastId!==e)},!1,"removeTransactionToast"),delete l[e],delete O[e]},N=e=>{let{toasts:t}=u().getState(),o=t.customToasts.length>0?Math.max(...t.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,s=e.toastId||`custom-toast-${o+1}`;return e.onClose&&(l[s]=e.onClose),e.instantiateToastElement?(O[s]=e.instantiateToastElement,u().setState(({toasts:n})=>{let i=n.customToasts.findIndex(r=>r.toastId===s),a={...e,instantiateToastElement:null,toastId:s};i!==-1?n.customToasts[i]=a:n.customToasts.push(a)},!1,"createCustomToast"),s):(Ut(e,s),s)};var wt=1e4,D=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=wt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let o=setTimeout(()=>{P(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,o)};this.startWithCustomDuration=(t,o)=>{if(this.stop(t),o<=0)return;let s=setTimeout(()=>{F(t);let n=l[t];n?.()},o);this.timeoutIntervals.set(t,s)};this.stop=t=>{let o=this.timeoutIntervals.get(t);o&&(clearTimeout(o),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t||wt}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};var p=class e{constructor(){this.isCreatingElement=!1;this.toastsElement=null;this.transactionToasts=[];this.customToasts=[];this.storeToastsSubscription=()=>null;this.eventBusUnsubscribeFunctions=[];this.eventBus=null;this.store=u();this.destroy(),this.lifetimeManager=new D,this.notificationsFeedManager=w.getInstance()}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),this.updateTransactionToastsList(),this.updateCustomToastList(),await this.subscribeToEventBusNotifications(),this.storeToastsSubscription=this.store.subscribe(({toasts:o,transactions:s},{toasts:n,transactions:i})=>{(!_(n.transactionToasts,o.transactionToasts)||!_(i,s))&&this.updateTransactionToastsList(),_(n.customToasts,o.customToasts)||this.updateCustomToastList()})}static getInstance(){return e.instance||(e.instance=new e),e.instance}handleCompletedTransaction(t){let{transactions:o}=this.store.getState(),s=o[t];if(!s)return!1;let{status:n}=s,i=nt(n),a=et(n),c=st(n),r=a||c||i;return r?(this.successfulToastLifetime&&this.lifetimeManager.start(t),r):(this.lifetimeManager.stop(t),r)}createTransactionToast(t,o){let s=At({toastId:t,totalDuration:o});return this.handleCompletedTransaction(t),this.updateTransactionToastsList(),s}createCustomToast(t){let o=N(t);return this.updateCustomToastList(),o}async updateTransactionToastsList(){let{toasts:t,transactions:o,account:s}=this.store.getState(),{pendingTransactionToasts:n,completedTransactionToasts:i}=await C({toastList:t,transactionsSessions:o,account:s});this.transactionToasts=[...n,...i];for(let a of t.transactionToasts)this.handleCompletedTransaction(a.toastId);await this.publishTransactionToasts()}async updateCustomToastList(){let{toasts:t}=this.store.getState();this.customToasts=[];for(let o of t.customToasts){let n="message"in o?{...o}:{...o,instantiateToastElement:O[o.toastId]};this.customToasts.push(n),o.duration&&this.lifetimeManager.startWithCustomDuration(o.toastId,o.duration)}this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",this.customToasts)}async createToastListElement(){return this.toastsElement?this.toastsElement:(this.isCreatingElement||(this.isCreatingElement=!0,this.toastsElement=await at.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}handleTransactionToastClose(t){this.handleCompletedTransaction(t)&&P(t)}async subscribeToEventBusNotifications(){let t=await this.createToastListElement();if(t){if(this.eventBus=await t.getEventBus(),!this.eventBus)throw new Error("eventBus is not initialized");this.eventBus.subscribe("CLOSE_TOAST",this.handleCloseToast.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("CLOSE_TOAST",this.handleCloseToast.bind(this))}),this.eventBus.subscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this))})}}showToasts(){this.updateCustomToastList(),this.updateTransactionToastsList()}hideToasts(){this.transactionToasts=[],this.customToasts=[],this.eventBus?.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts),this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",this.customToasts)}async handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}handleCloseToast(t){if(this.customToasts.find(s=>s.toastId===t)){this.lifetimeManager.stop(t);let s=l[t];s?.(),F(t);return}this.handleTransactionToastClose(t)}async publishTransactionToasts(){if(!this.notificationsFeedManager.isNotificationsFeedOpen()){if(!this.eventBus){let t=await this.createToastListElement();if(!t)return;this.eventBus=await t.getEventBus()}this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts)}}destroy(){this.storeToastsSubscription(),this.lifetimeManager?.destroy(),this.notificationsFeedManager?.destroy(),Lt(),this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[]}};export{w as a,O as b,l as c,Ut as d,F as e,Lt as f,Ws as g,At as h,P as i,N as j,D as k,p as l,x as m,U as n,St as o,B as p,Ct as q,M as r,ps as s,f as t,yt as u};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as ot}from"./chunk-PNPUIES4.mjs";import{a as ct}from"./chunk-6UZHM5LW.mjs";import{a as C}from"./chunk-ESC2Z53Z.mjs";import{a as mt}from"./chunk-X5JDKLIV.mjs";import{a as L}from"./chunk-ID6KUNJA.mjs";import{a as Q,b as X,g as Z,l as tt}from"./chunk-CAA4VJRH.mjs";import{a as lt}from"./chunk-NJ276HWT.mjs";import{b}from"./chunk-LDUJ24G3.mjs";import{a as pt}from"./chunk-B4RZU4FG.mjs";import{a as ht}from"./chunk-4ODPAHHA.mjs";import{a as gt}from"./chunk-Z5CDCI3Y.mjs";import{a as dt}from"./chunk-72VJ6ESJ.mjs";import{a as g}from"./chunk-VEXXDADK.mjs";import{a as J}from"./chunk-GLDB2NRB.mjs";import{a as rt}from"./chunk-FXVMPOC7.mjs";import{a as S}from"./chunk-KDIJXWH3.mjs";import{a as y,f as ut}from"./chunk-5V3N4MOZ.mjs";import{b as Tt}from"./chunk-GZUFMNUL.mjs";import{d as it}from"./chunk-33NGD6LW.mjs";import{k as st,l as et,n as nt}from"./chunk-65L5EBBL.mjs";import{a as A}from"./chunk-HORSXVIV.mjs";import{a as ft}from"./chunk-ARJZ4W7T.mjs";import{a as j}from"./chunk-3EEDALSW.mjs";import{a as I}from"./chunk-QTKK6OSJ.mjs";import{a as E}from"./chunk-6FXEHNGW.mjs";import{a as It}from"./chunk-NJN53MJV.mjs";import{a as Y}from"./chunk-YSCND2MX.mjs";import{b as V,s as u,u as q}from"./chunk-6NRL7OLL.mjs";import{c as $,f as G}from"./chunk-QJSB5NX4.mjs";import{b as d}from"./chunk-VNLGNNIL.mjs";import{b as h}from"./chunk-IEJTMYFW.mjs";import{b as H,c as K,f as z}from"./chunk-R53MCZI6.mjs";import{b as vt}from"./chunk-3LBQYLDY.mjs";import{a as at}from"./chunk-5SUSXTTZ.mjs";import{a as v}from"./chunk-OJV6XRG5.mjs";import _ from"lodash.isequal";import Et from"lodash.isequal";var Nt="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",w=class e extends rt{constructor(){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.store=u();this.initialData={pendingTransactions:[],historicTransactions:[]};this.data={...this.initialData}}static getInstance(){return e.instance||(e.instance=new e),e.instance}isNotificationsFeedOpen(){return this.isOpen}async openNotificationsFeed(){p.getInstance().hideToasts(),await this.openUI(),await this.updateDataAndNotifications();let s=this.store.subscribe(async({toasts:n,transactions:i},{toasts:a,transactions:c})=>{(!Et(a.transactionToasts,n.transactionToasts)||!Et(c,i))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Nt,[s]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}handleCloseUI(){let o=p.getInstance();this.closeUI(),o.showToasts()}async setupEventListeners(){this.eventBus&&(this.subscribeToEventBus("CLOSE_NOTIFICATIONS_FEED",this.handleCloseUI.bind(this)),this.subscribeToEventBus("CLEAR_NOTIFICATIONS_FEED_HISTORY",this.handleClearNotificationsFeedHistory.bind(this)))}async updateDataAndNotifications(){let{transactions:o,account:s,toasts:n,network:i}=this.store.getState(),{pendingTransactionToasts:a}=await C({toastList:n,transactionsSessions:o,account:s});this.data.pendingTransactions=a,this.data.historicTransactions=await ot.getTransactionsHistory({transactionsSessions:o,address:s.address,explorerAddress:i.network.explorerAddress,egldLabel:i.network.egldLabel}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){it(),this.resetData(),this.updateNotificationsFeed()}async updateNotificationsFeed(){this.eventBus&&(this.eventBus.publish("PENDING_TRANSACTIONS_UPDATE",this.data.pendingTransactions),this.eventBus.publish("TRANSACTIONS_HISTORY_UPDATE",this.data.historicTransactions))}};import R from"bignumber.js";var x=class e{constructor(){this.store=u();this.warningLogoutTimeoutRef=null;this.actualLogoutTimeoutRef=null;this.plannedLogoutTimeoutRef=null;this.plannedLogoutKey=null;this.init=async()=>{if(!this.shouldStart())return;let t=this.store.getState(),o=d(t),{isExpired:s}=I(o?.nativeAuthToken);s?f().logout():this.addPlannedLogout()};this.stop=()=>{clearTimeout(this.warningLogoutTimeoutRef??0),clearTimeout(this.plannedLogoutTimeoutRef??0),clearTimeout(this.actualLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=null,this.plannedLogoutTimeoutRef=null,this.actualLogoutTimeoutRef=null,this.plannedLogoutKey=null};this.shouldStart=()=>{let t=this.store.getState(),o=d(t),s=G(t);return!!(o?.nativeAuthToken&&s)};this.addPlannedLogout=()=>{let t=f(),o=$(this.store.getState()),s=t.getType()===v.webview;if(!o||s)return;this.addLogoutWarning();let n=d(this.store.getState()),{secondsUntilExpires:i,expiresAt:a}=I(n?.nativeAuthToken),c=new R(String(i)),r=`${o}_${a}`,m=this.plannedLogoutKey===r;if(!(i&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=r,clearTimeout(this.plannedLogoutTimeoutRef??0);let W=c.times(1e3);this.actualLogoutTimeoutRef=setTimeout(()=>{p.getInstance().createCustomToast({toastId:"native-auth-logout",iconClassName:"warning",title:"Logging out",icon:"times",message:"Your session has expired!"}),this.actualLogoutTimeoutRef=null},W.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},W.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=h(this.store.getState()),o=d(this.store.getState()),{secondsUntilExpires:s}=I(o?.nativeAuthToken),n=new R(String(s)),i=n.times(1e3);if(!s||n.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new R(t?.tokenExpirationToastWarningSeconds??0).times(1e3),r=n.times(1e3).minus(c),m=ct(i.toNumber()),T=r.isLessThanOrEqualTo(0)?0:r.toNumber();clearTimeout(this.warningLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=setTimeout(()=>{p.getInstance().createCustomToast({toastId:"native-auth-expired",iconClassName:"warning",title:"Session Expiration Warning",icon:"hourglass",message:`Your session will expire in ${m}!`}),this.warningLogoutTimeoutRef=null},T)}}static getInstance(){return e.instance||(e.instance=new e),e.instance}};async function U({address:e,provider:t,apiAddress:o}){let s=await E({address:e,baseURL:o});if(!s)throw new Error("Account not found");Tt({address:e,providerType:t.getType()});let n={...s,username:A(s.username),nonce:S(s)};y(n),await b(e),L(),s.shard!=null&&await mt({shard:Number(s.shard),apiAddress:o})}async function Ot(e){let{network:{apiAddress:t}}=g();await e.login();let o=await e.getAddress();if(!o)throw new Error("Address not found");return await U({address:o,provider:e,apiAddress:t}),{address:o}}async function Ft({provider:e,nativeAuthConfig:t,token:o}){let{network:{apiAddress:s}}=g(),n=j(t),i=o;i||(i=await n.initialize({noCache:!0}));let{address:a,signature:c,...r}=await e.login({token:i});if(!a)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let m=n.getToken({address:a,token:i,signature:c});V({loginToken:i,signature:c,nativeAuthToken:m});let T=await pt({loginToken:i,extraInfoData:{multisig:r?.multisig,impersonate:r?.impersonate},address:a});return await U({address:T,provider:e,apiAddress:s}),{address:T,signature:c}}async function St(e,t){let o=h(q());if(o)return await Ft({provider:e,nativeAuthConfig:o,token:t?.token});let{address:s}=await Ot(e);return await b(s),L(),{address:s}}var k={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${X}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${Q}-${Date.now()}`}},Pt={extensionResponse:"Unable to sign transactions","Transaction canceled":"Transaction canceled","cancelled by user":"Transaction signing cancelled by user","denied by the user":"Transaction signing denied by the user"},Dt=e=>{for(let[t,o]of Object.entries(Pt))if(e.includes(t))return o;return"Error when signing"};function B(e,t="error"){let o=e?.message,s=Dt(o),i=s!=="Error when signing"?"warning":t,a=Object.keys(k).includes(i)?k[i]:k.error,{toastId:c,iconClassName:r,title:m}=a;return N({toastId:c,duration:1e4,icon:"times",iconClassName:r,message:s,title:m}),s}async function Ct({provider:e,transactions:t,options:o={}}){await yt();let{isGuarded:s,activeGuardianAddress:n,nonce:i}=ft(),a=e.getType()===v.ledger,c=ht({latestNonce:i,transactions:t}),r=n&&s&&!o.skipGuardian?c?.map(T=>(T.version=H.withTxOptions().valueOf(),T.options=z.withOptions({guarded:!0,...a?{hashSign:!0}:{}}).valueOf(),T.guardian=K.newFromBech32(n),T)):c,m=await e.signTransactions(r)??[];return ut(i+m.length),m}var M=class{constructor(t){this.provider=t}init(){return this.provider.init()}async login(t){let o=await St(this.provider,t);return x.getInstance().init(),o}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0,hasConsentPopup:!1}){return await lt({provider:this.provider,options:t})}setShouldShowConsentPopup(t){this.provider.setShouldShowConsentPopup?.(t)}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,o){try{return await Ct({provider:this.provider,transactions:t,options:o})}catch(s){let n=B(s);throw new Error(n)}}async signMessage(t,o){try{return await dt({provider:this.provider,message:t,options:o})}catch(s){let n=B(s,"warning");throw new Error(n)}}async verifyMessage(t){return await gt(t)}cancelLogin(){this.provider.cancelLogin?.()}};var bt=null;function ps(e){bt=e}function f(){return bt||new M(vt)}var Rt=async()=>{try{let e=J(),{network:t}=g();try{let o=await E({address:e,baseURL:t.apiAddress});if(o!=null){let s={...o,username:A(o.username),nonce:S(o)};return y(s),s}}catch(o){console.error("Failed getting account ",o)}}catch(e){console.error("Failed getting address ",e)}return null};async function yt(){let e=f();if(e==null)throw"Provider not initialized";try{if(!e.init)throw"Current provider does not have init() function";return await e.init()?Rt():void 0}catch(t){console.error("Failed initializing provider ",t)}}var O={},l={},Ut=(e,t)=>{u().setState(({toasts:o})=>{let s=o.customToasts.length>0?Math.max(...o.customToasts.map(r=>parseInt(r.toastId.split("-").pop()??"0"))):0,n=t??`custom-toast-${s+1}`,i=o.customToasts.findIndex(r=>r.toastId===n),a={...e,toastId:n};if(i!==-1){o.customToasts[i]=a;return}o.customToasts.push({...a,toastId:n})},!1,"addCustomToast")},F=e=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(o=>o.toastId!==e)},!1,"removeCustomToast")},Lt=()=>{u().setState(({toasts:e})=>{e.customToasts=[]},!1,"removeAllCustomToasts")},Ws=()=>{u().setState(({toasts:e})=>{e.transactionToasts=[]})},At=({toastId:e,totalDuration:t})=>{let o="";return u().setState(({toasts:s})=>{let n=s.transactionToasts.length>0?Math.max(...s.transactionToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0;o=e??`transaction-toast-${n+1}`,s.transactionToasts.push({startTime:Y(),endTime:It(t),toastId:o})},!1,"addTransactionToast"),o},P=e=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(o=>o.toastId!==e)},!1,"removeTransactionToast"),delete l[e],delete O[e]},N=e=>{let{toasts:t}=u().getState(),o=t.customToasts.length>0?Math.max(...t.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,s=e.toastId||`custom-toast-${o+1}`;return e.onClose&&(l[s]=e.onClose),e.instantiateToastElement?(O[s]=e.instantiateToastElement,u().setState(({toasts:n})=>{let i=n.customToasts.findIndex(r=>r.toastId===s),a={...e,instantiateToastElement:null,toastId:s};i!==-1?n.customToasts[i]=a:n.customToasts.push(a)},!1,"createCustomToast"),s):(Ut(e,s),s)};var wt=1e4,D=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=wt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let o=setTimeout(()=>{P(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,o)};this.startWithCustomDuration=(t,o)=>{if(this.stop(t),o<=0)return;let s=setTimeout(()=>{F(t);let n=l[t];n?.()},o);this.timeoutIntervals.set(t,s)};this.stop=t=>{let o=this.timeoutIntervals.get(t);o&&(clearTimeout(o),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t||wt}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};var p=class e{constructor(){this.isCreatingElement=!1;this.toastsElement=null;this.transactionToasts=[];this.customToasts=[];this.storeToastsSubscription=()=>null;this.eventBusUnsubscribeFunctions=[];this.eventBus=null;this.store=u();this.destroy(),this.lifetimeManager=new D,this.notificationsFeedManager=w.getInstance()}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),this.updateTransactionToastsList(),this.updateCustomToastList(),await this.subscribeToEventBusNotifications(),this.storeToastsSubscription=this.store.subscribe(({toasts:o,transactions:s},{toasts:n,transactions:i})=>{(!_(n.transactionToasts,o.transactionToasts)||!_(i,s))&&this.updateTransactionToastsList(),_(n.customToasts,o.customToasts)||this.updateCustomToastList()})}static getInstance(){return e.instance||(e.instance=new e),e.instance}handleCompletedTransaction(t){let{transactions:o}=this.store.getState(),s=o[t];if(!s)return!1;let{status:n}=s,i=nt(n),a=et(n),c=st(n),r=a||c||i;return r?(this.successfulToastLifetime&&this.lifetimeManager.start(t),r):(this.lifetimeManager.stop(t),r)}createTransactionToast(t,o){let s=At({toastId:t,totalDuration:o});return this.handleCompletedTransaction(t),this.updateTransactionToastsList(),s}createCustomToast(t){let o=N(t);return this.updateCustomToastList(),o}async updateTransactionToastsList(){let{toasts:t,transactions:o,account:s}=this.store.getState(),{pendingTransactionToasts:n,completedTransactionToasts:i}=await C({toastList:t,transactionsSessions:o,account:s});this.transactionToasts=[...n,...i];for(let a of t.transactionToasts)this.handleCompletedTransaction(a.toastId);await this.publishTransactionToasts()}async updateCustomToastList(){let{toasts:t}=this.store.getState();this.customToasts=[];for(let o of t.customToasts){let n="message"in o?{...o}:{...o,instantiateToastElement:O[o.toastId]};this.customToasts.push(n),o.duration&&this.lifetimeManager.startWithCustomDuration(o.toastId,o.duration)}this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",this.customToasts)}async createToastListElement(){return this.toastsElement?this.toastsElement:(this.isCreatingElement||(this.isCreatingElement=!0,this.toastsElement=await at.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}handleTransactionToastClose(t){this.handleCompletedTransaction(t)&&P(t)}async subscribeToEventBusNotifications(){let t=await this.createToastListElement();if(t){if(this.eventBus=await t.getEventBus(),!this.eventBus)throw new Error("eventBus is not initialized");this.eventBus.subscribe("CLOSE_TOAST",this.handleCloseToast.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("CLOSE_TOAST",this.handleCloseToast.bind(this))}),this.eventBus.subscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this))})}}showToasts(){this.updateCustomToastList(),this.updateTransactionToastsList()}hideToasts(){this.transactionToasts=[],this.customToasts=[],this.eventBus?.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts),this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",this.customToasts)}async handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}handleCloseToast(t){if(this.customToasts.find(s=>s.toastId===t)){this.lifetimeManager.stop(t);let s=l[t];s?.(),F(t);return}this.handleTransactionToastClose(t)}async publishTransactionToasts(){if(!this.notificationsFeedManager.isNotificationsFeedOpen()){if(!this.eventBus){let t=await this.createToastListElement();if(!t)return;this.eventBus=await t.getEventBus()}this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts)}}destroy(){this.storeToastsSubscription(),this.lifetimeManager?.destroy(),this.notificationsFeedManager?.destroy(),Lt(),this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[]}};export{w as a,O as b,l as c,Ut as d,F as e,Lt as f,Ws as g,At as h,P as i,N as j,D as k,p as l,x as m,U as n,St as o,B as p,Ct as q,M as r,ps as s,f as t,yt as u};
|
|
2
|
+
//# sourceMappingURL=chunk-EBWZONUV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-2FKKBSB4.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-ECZH2TNF.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-YYW6XBAT.mjs";import{a as f}from"./chunk-GWVYPYNB.mjs";import{j as m,k as d,l as p,n as u}from"./chunk-65L5EBBL.mjs";import{a as T}from"./chunk-YZKMFI3Y.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-ESC2Z53Z.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-6NRL7OLL.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-EXMSBG6B.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-CUBNX4ZT.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-F7YJNEFJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-6FIRQBP7.mjs";import{a as t}from"./chunk-ZCNHQY2S.mjs";var s=class extends n{constructor({uiDataUpdateEvent:e,uiTag:i}){super({uiDataUpdateEvent:e,uiTag:i});this.isOpen=!1;this.data=this.getInitialData()}async openUI(){this.isOpen&&this.uiElement||(await super.init(),this.setIsSidePanelOpen(!0))}async destroy(){this.setIsSidePanelOpen(!1),await this.uiElement?.closeWithAnimation?.(),super.destroy()}closeUI(){this.resetData(),this.destroy()}setIsSidePanelOpen(e){this.isOpen=e,t(e)}};export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FXVMPOC7.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-6NRL7OLL.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-GZUFMNUL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-P5OSWL4G.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-H6SRZM4T.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-6MDV4CER.mjs";import{a as f}from"./chunk-FRDR4A7Z.mjs";import{t as c}from"./chunk-EBWZONUV.mjs";import{u as n}from"./chunk-6NRL7OLL.mjs";import{g as a}from"./chunk-QJSB5NX4.mjs";import{e as l}from"./chunk-VNLGNNIL.mjs";import{HWProvider as m}from"@multiversx/sdk-hw-provider";async function A(u){let v=g(),d=u?.shouldInitProvider||!v,o=l(n()),t=a(n()),r=c(),i=new m,I=async()=>{let e=o?.index!=null;if(r instanceof m&&r.isInitialized())return e&&await r.setAddressIndex(o.index),r;if(d&&!await i.init())throw new Error("Failed to initialize Ledger Provider");return e&&await i.setAddressIndex(o.index),i};try{if(!d&&t)return{ledgerProvider:i,ledgerConfig:{version:t.version,dataEnabled:t.hasContractDataEnabled}};let e=await I(),s=await f(e);return{ledgerProvider:e,ledgerConfig:s}}catch(e){throw console.error("Could not initialize ledger app",e),e}}export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-I4KPP4PH.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-6J4LMQ4Z.mjs";import{a as k}from"./chunk-S4ZDWFIY.mjs";import{s as f}from"./chunk-6NRL7OLL.mjs";import{d as b}from"./chunk-QJSB5NX4.mjs";import{c as n}from"./chunk-F7YJNEFJ.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-ID6KUNJA.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as B}from"./chunk-UK4SUJCE.mjs";import{a as b}from"./chunk-LDM4KVJG.mjs";import{a as k}from"./chunk-QXC4D3AC.mjs";import{a as R}from"./chunk-OD4ANAAQ.mjs";import{a as D}from"./chunk-27VTB7II.mjs";import{a as I}from"./chunk-AV4HSXYZ.mjs";import{a as j}from"./chunk-YTFYVPZO.mjs";import{a as _}from"./chunk-Y7BIC4GU.mjs";import{a as A}from"./chunk-LO6RI4RO.mjs";import{a as O}from"./chunk-GWVYPYNB.mjs";import{u as x}from"./chunk-6NRL7OLL.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-J4CPYFK6.mjs";import{a as w}from"./chunk-R53MCZI6.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard:E,username:h}}=B(),g=v(x()),C=O(),{allTransactions:e,parsedTransactionsByDataField:L}=R(z),p=[],n=A.getInstance();if(await n.openUI(),!n)throw new Error("Unable to establish connection with sign screens");let W=async()=>{await b(),n.closeUI()};return n.subscribeToEventBus("CLOSE_SIGN_TRANSACTIONS",W),new Promise(async(X,M)=>{let d=[],Y=await k({baseURL:g.apiAddress});n.notifyDataUpdate(),n.initializeGasPriceMap(e.map(t=>t.transaction));let l=Y?.price,a=0,T=async()=>{let c=e[a]?.transaction,i=Number(c.nonce);try{n.updateIsLoading(!0);let{commonData:r,tokenTransaction:o,fungibleTransaction:s}=await D({allTransactions:e,currentScreenIndex:a,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:h,shard:E,signedIndexes:p,parsedTransactionsByDataField:L});o&&n.updateTokenTransaction(o),s&&n.updateNonFungibleTransaction(s.type,s),n.updateCommonData(r)}catch(r){console.error(`Error fetching common data for transaction at index ${a}:`,r)}finally{n.updateIsLoading(!1)}},$=()=>{a>0&&(a--,T())},q=(t=0)=>{let i=e[a].transaction,r=Number(i.nonce);n.updateGasPriceMap({nonce:r,ppu:t}),n.updateCommonData({ppu:t});let o=i.toPlainObject(),s=I({transaction:o,gasPriceData:n.ppuMap[r]}),P=w.newFromPlainObject({...o,gasPrice:s}),u=j({transaction:P,price:l}),m=F({input:s.toString(),decimals:U,addCommas:!0,digits:G});n.updateCommonData({feeLimit:u.feeLimitFormatted,feeInFiatLimit:u.feeInFiatLimit,gasPrice:m,ppu:t})},J=async()=>{M(new Error("Transaction signing cancelled by user")),await b(),n.closeUI()},f=()=>{a<n.transactionsCount-1&&(a++,T())},Q=async()=>{let c=e[a].transaction,i=Number(c.nonce),{commonData:r}=await D({allTransactions:e,currentScreenIndex:a,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:h,shard:E,signedIndexes:p,parsedTransactionsByDataField:L});if(!r.needsSigning)return p.push(a),f();let o=c.toPlainObject(),s=o.nonce,P=I({transaction:o,gasPriceData:n.ppuMap[s]}),u=w.newFromPlainObject({...o,gasPrice:P});try{let m=await H([u]);m&&(p.push(a),d.push(m[0]));let nn=a===e.length-1,an=e.filter(S=>S.needsSigning),tn=d.length===an.length;if(nn&&tn){let S=await K(d);return n.closeUI(),X(S)}f()}catch(m){n.closeUI(),M(m)}},V=new Map([["NEXT_SIGN_TRANSACTIONS",f],["CONFIRM_SIGN_TRANSACTIONS",Q],["CLOSE_SIGN_TRANSACTIONS",J],["BACK_SIGN_TRANSACTIONS",$],["SET_PPU_SIGN_TRANSACTIONS",q]]);function Z(){for(let[t,c]of V)n.subscribeToEventBus(t,c)}Z(),await T()})}export{Dn as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JPOJ7DHM.mjs.map
|