@multiversx/sdk-dapp 5.1.7 → 5.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/out/__chunks__/chunk-2VG3V3VD.mjs +2 -0
- package/out/__chunks__/chunk-2VG3V3VD.mjs.map +7 -0
- package/out/__chunks__/{chunk-TF67ZK65.mjs → chunk-3LL33L5F.mjs} +2 -2
- package/out/__chunks__/{chunk-VT5BFUDT.mjs → chunk-3UVBQHXR.mjs} +2 -2
- package/out/__chunks__/{chunk-HQ3MXZM2.mjs → chunk-44EDRVCP.mjs} +2 -2
- package/out/__chunks__/{chunk-726BASBO.mjs → chunk-4AVJA7MF.mjs} +2 -2
- package/out/__chunks__/chunk-4CK3GBRH.mjs +2 -0
- package/out/__chunks__/chunk-4CK3GBRH.mjs.map +7 -0
- package/out/__chunks__/chunk-4KTXRMDS.mjs +2 -0
- package/out/__chunks__/{chunk-HGZQIUMH.mjs → chunk-4YUEQAGD.mjs} +2 -2
- package/out/__chunks__/{chunk-R4PAEXYU.mjs → chunk-5K2UH5QL.mjs} +2 -2
- package/out/__chunks__/chunk-5K2UH5QL.mjs.map +7 -0
- package/out/__chunks__/{chunk-OAKDIMYH.mjs → chunk-632VK5RN.mjs} +2 -2
- package/out/__chunks__/{chunk-QF3ACWOH.mjs → chunk-6GKWP4IU.mjs} +2 -2
- package/out/__chunks__/{chunk-47FDQOU2.mjs → chunk-6QDJ2IO3.mjs} +2 -2
- package/out/__chunks__/{chunk-ZSJNTJKG.mjs → chunk-A6XTQQEL.mjs} +2 -2
- package/out/__chunks__/{chunk-NQ2ACSWO.mjs → chunk-AQ7ZQRAJ.mjs} +2 -2
- package/out/__chunks__/{chunk-DCOMKCXN.mjs → chunk-C22Q5W5S.mjs} +2 -2
- package/out/__chunks__/{chunk-XEENI7BQ.mjs → chunk-CCFQYROV.mjs} +2 -2
- package/out/__chunks__/{chunk-72BFMMSI.mjs → chunk-CHCWBFEG.mjs} +2 -2
- package/out/__chunks__/{chunk-3AN3HJA5.mjs → chunk-CLPLLK67.mjs} +2 -2
- package/out/__chunks__/{chunk-JYIAIJ37.mjs → chunk-CYWOWIRB.mjs} +2 -2
- package/out/__chunks__/chunk-D4V7EOIL.mjs +2 -0
- package/out/__chunks__/{chunk-ZG4ZEFUR.mjs → chunk-DGL4E36L.mjs} +2 -2
- package/out/__chunks__/chunk-DT3MXNJI.mjs +2 -0
- package/out/__chunks__/{chunk-WL56YMKX.mjs → chunk-EIL6PTC4.mjs} +2 -2
- package/out/__chunks__/chunk-ENHFZ4TV.mjs +2 -0
- package/out/__chunks__/{chunk-TPJ7KEUB.mjs.map → chunk-ENHFZ4TV.mjs.map} +1 -1
- package/out/__chunks__/{chunk-7XW3S67Y.mjs → chunk-EQOLFL4H.mjs} +2 -2
- package/out/__chunks__/{chunk-K4MA6VJX.mjs → chunk-FZKGYTPJ.mjs} +2 -2
- package/out/__chunks__/{chunk-BECHXPBC.mjs → chunk-GF3J27ZR.mjs} +2 -2
- package/out/__chunks__/chunk-GQAGO7KW.mjs +2 -0
- package/out/__chunks__/{chunk-O3AN3EMP.mjs → chunk-HSAPJUAV.mjs} +2 -2
- package/out/__chunks__/{chunk-WXS4MAB3.mjs → chunk-IDCBOZNB.mjs} +2 -2
- package/out/__chunks__/{chunk-O6LQEIE2.mjs → chunk-II663X5B.mjs} +2 -2
- package/out/__chunks__/{chunk-RNWJHZLH.mjs → chunk-IJWIF6QG.mjs} +2 -2
- package/out/__chunks__/{chunk-6DW4VXLU.mjs → chunk-IT3RZ4HT.mjs} +2 -2
- package/out/__chunks__/{chunk-J7WJREOM.mjs → chunk-IXHQSJBO.mjs} +2 -2
- package/out/__chunks__/{chunk-BPKM2DQN.mjs → chunk-K4BSSSHE.mjs} +2 -2
- package/out/__chunks__/chunk-KDWLSBQB.mjs +2 -0
- package/out/__chunks__/chunk-KDWLSBQB.mjs.map +7 -0
- package/out/__chunks__/{chunk-PMOKDTDV.mjs → chunk-KGKDFREW.mjs} +2 -2
- package/out/__chunks__/{chunk-S2RWU5BV.mjs → chunk-KMKXCFDQ.mjs} +2 -2
- package/out/__chunks__/chunk-KNZRUMOW.mjs +2 -0
- package/out/__chunks__/chunk-LDIEAM6D.mjs +2 -0
- package/out/__chunks__/chunk-LKPI47RK.mjs +2 -0
- package/out/__chunks__/chunk-LKPI47RK.mjs.map +7 -0
- package/out/__chunks__/{chunk-7HP3FIAW.mjs → chunk-MQFYSUO6.mjs} +2 -2
- package/out/__chunks__/{chunk-P6PUVTFU.mjs → chunk-NAJG7WG4.mjs} +2 -2
- package/out/__chunks__/chunk-NN3CS646.mjs +2 -0
- package/out/__chunks__/{chunk-KOA4KAE3.mjs → chunk-NQZVWZM5.mjs} +2 -2
- package/out/__chunks__/{chunk-AH5RW56M.mjs → chunk-O46BVCSH.mjs} +2 -2
- package/out/__chunks__/{chunk-KN26DF7H.mjs → chunk-PFMI2MWN.mjs} +2 -2
- package/out/__chunks__/{chunk-OWV2V6SX.mjs → chunk-PRBRKMR4.mjs} +2 -2
- package/out/__chunks__/{chunk-SFAWPLJB.mjs → chunk-PSSRDP4O.mjs} +2 -2
- package/out/__chunks__/chunk-QMHHBZ5O.mjs +2 -0
- package/out/__chunks__/{chunk-NPRED3F5.mjs → chunk-QXVINXTO.mjs} +2 -2
- package/out/__chunks__/chunk-RCM3SNZB.mjs +2 -0
- package/out/__chunks__/chunk-RHP2BLW4.mjs +2 -0
- package/out/__chunks__/chunk-RHP2BLW4.mjs.map +7 -0
- package/out/__chunks__/{chunk-LPXPAY7D.mjs → chunk-RMSMZKTD.mjs} +2 -2
- package/out/__chunks__/{chunk-DWYHYJNY.mjs → chunk-RQG6ZONS.mjs} +2 -2
- package/out/__chunks__/chunk-SBDWJ7ES.mjs +2 -0
- package/out/__chunks__/chunk-SDJQOCX2.mjs +2 -0
- package/out/__chunks__/{chunk-KKP56V4G.mjs → chunk-SJCFVUWO.mjs} +2 -2
- package/out/__chunks__/{chunk-NMNJWV6J.mjs → chunk-SJUTPNHW.mjs} +2 -2
- package/out/__chunks__/{chunk-S5ZROGZQ.mjs → chunk-T5FALTG2.mjs} +2 -2
- package/out/__chunks__/{chunk-4MXAQBQ4.mjs → chunk-TJYIVY7J.mjs} +2 -2
- package/out/__chunks__/{chunk-QIF2DQBN.mjs → chunk-TMNKFPRG.mjs} +2 -2
- package/out/__chunks__/{chunk-QC6KCYKL.mjs → chunk-TRUQQVTW.mjs} +2 -2
- package/out/__chunks__/{chunk-NZ5CEUB5.mjs → chunk-UA5WGULZ.mjs} +2 -2
- package/out/__chunks__/{chunk-SUCBDFIP.mjs → chunk-UEPKOEV5.mjs} +2 -2
- package/out/__chunks__/{chunk-ILMJWCA5.mjs → chunk-UPIJGCBH.mjs} +2 -2
- package/out/__chunks__/chunk-VFIKV2UU.mjs +2 -0
- package/out/__chunks__/{chunk-2FJUAWNG.mjs → chunk-VHHB4LMW.mjs} +2 -2
- package/out/__chunks__/{chunk-6DI7XSHB.mjs → chunk-VHOQPKEC.mjs} +2 -2
- package/out/__chunks__/chunk-VN62BHIP.mjs +2 -0
- package/out/__chunks__/{chunk-O5L6HOQJ.mjs → chunk-VQ4W2MEF.mjs} +2 -2
- package/out/__chunks__/chunk-WF63AXH3.mjs +2 -0
- package/out/__chunks__/chunk-WF63AXH3.mjs.map +7 -0
- package/out/__chunks__/chunk-WYVDY3V7.mjs +2 -0
- package/out/__chunks__/{chunk-LLJ3VLPO.mjs → chunk-X3XRZCS3.mjs} +2 -2
- package/out/__chunks__/{chunk-CRC6EHJB.mjs → chunk-YC3NVMU3.mjs} +2 -2
- package/out/__chunks__/{chunk-5A2ZB2NK.mjs → chunk-YJMGYDU3.mjs} +2 -2
- package/out/__chunks__/{chunk-G26BK7D7.mjs → chunk-YQ63ZYW2.mjs} +2 -2
- package/out/__chunks__/chunk-YY55H5EM.mjs +2 -0
- package/out/__chunks__/{chunk-WKWVAY3B.mjs → chunk-ZM3VDK22.mjs} +2 -2
- package/out/__chunks__/chunk-ZPCNRXQG.mjs +2 -0
- package/out/__chunks__/{chunk-QZOCKDRL.mjs → chunk-ZTLWHYQL.mjs} +2 -2
- package/out/apiCalls/account/getScamAddressData.mjs +1 -1
- package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
- package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
- package/out/apiCalls/index.mjs +1 -1
- package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/index.mjs +1 -1
- package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
- package/out/constants/browser.constants.mjs +1 -1
- package/out/constants/index.mjs +1 -1
- package/out/constants/storage.constants.mjs +1 -1
- package/out/constants/window.constants.cjs +1 -1
- package/out/constants/window.constants.cjs.map +1 -1
- package/out/constants/window.constants.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
- package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
- package/out/controllers/TransactionsTableController/index.mjs +1 -1
- package/out/index.mjs +1 -1
- package/out/lib/sdkDappUi.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.cjs +34 -1
- package/out/managers/TransactionManager/TransactionManager.cjs.map +2 -2
- package/out/managers/TransactionManager/TransactionManager.d.ts +27 -0
- package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
- package/out/managers/TransactionManager/TransactionManager.types.cjs.map +1 -1
- package/out/managers/TransactionManager/TransactionManager.types.d.ts +9 -0
- package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
- package/out/managers/TransactionManager/helpers/sessionCallbacks.cjs +21 -8
- package/out/managers/TransactionManager/helpers/sessionCallbacks.cjs.map +2 -2
- package/out/managers/TransactionManager/helpers/sessionCallbacks.d.ts +5 -4
- package/out/managers/TransactionManager/helpers/sessionCallbacks.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.cjs +18 -5
- package/out/managers/internal/ToastManager/ToastManager.cjs.map +2 -2
- 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.cjs +4 -2
- package/out/managers/internal/ToastManager/helpers/createToastsFromTransactions.cjs.map +2 -2
- package/out/managers/internal/ToastManager/helpers/createToastsFromTransactions.d.ts +2 -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.cjs +1 -1
- package/out/methods/initApp/initApp.cjs.map +2 -2
- package/out/methods/initApp/initApp.mjs +1 -1
- package/out/methods/initApp/initApp.mjs.map +3 -3
- 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/checkTransactionStatus/runSessionCallbacks.cjs +4 -4
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/runSessionCallbacks.cjs.map +2 -2
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/runSessionCallbacks.d.ts +2 -2
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/runSessionCallbacks.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/WebviewClient/WebviewClient.cjs +2 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.cjs.map +2 -2
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
- package/out/providers/strategies/helpers/index.mjs +1 -1
- package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
- package/out/providers/strategies/index.mjs +1 -1
- package/out/react/account/useGetAccount.mjs +1 -1
- package/out/react/account/useGetAccountInfo.mjs +1 -1
- package/out/react/account/useGetIsLoggedIn.mjs +1 -1
- package/out/react/account/useGetLatestNonce.mjs +1 -1
- package/out/react/index.mjs +1 -1
- package/out/react/loginInfo/useGetLoginInfo.mjs +1 -1
- package/out/react/network/useGetNetworkConfig.mjs +1 -1
- package/out/react/store/getReactStore.mjs +1 -1
- package/out/react/store/useSelector.mjs +1 -1
- package/out/react/transactions/useGetFailedTransactions.mjs +1 -1
- package/out/react/transactions/useGetFailedTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetPendingTransactions.mjs +1 -1
- package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetSuccessfulTransactions.mjs +1 -1
- package/out/react/transactions/useGetSuccessfulTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetTransactionSessions.mjs +1 -1
- package/out/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.cjs +19 -4
- package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.cjs.map +2 -2
- package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.d.ts +2 -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-2FDNVFTD.mjs +0 -2
- package/out/__chunks__/chunk-2FHEBVWZ.mjs +0 -2
- package/out/__chunks__/chunk-2FHEBVWZ.mjs.map +0 -7
- package/out/__chunks__/chunk-3Z2ACTV6.mjs +0 -2
- package/out/__chunks__/chunk-3ZEUVYQF.mjs +0 -2
- package/out/__chunks__/chunk-3ZEUVYQF.mjs.map +0 -7
- package/out/__chunks__/chunk-4JCMNQXS.mjs +0 -2
- package/out/__chunks__/chunk-5FVAEFKL.mjs +0 -2
- package/out/__chunks__/chunk-5TKJRIH7.mjs +0 -2
- package/out/__chunks__/chunk-5TKJRIH7.mjs.map +0 -7
- package/out/__chunks__/chunk-77NCTJIH.mjs +0 -2
- package/out/__chunks__/chunk-AF3RP6VA.mjs +0 -2
- package/out/__chunks__/chunk-FMQYLMTU.mjs +0 -2
- package/out/__chunks__/chunk-FMQYLMTU.mjs.map +0 -7
- package/out/__chunks__/chunk-HSIBZ2L5.mjs +0 -2
- package/out/__chunks__/chunk-J6R5G7CE.mjs +0 -2
- package/out/__chunks__/chunk-J6R5G7CE.mjs.map +0 -7
- package/out/__chunks__/chunk-KDOO7OCC.mjs +0 -2
- package/out/__chunks__/chunk-LNCOC6DZ.mjs +0 -2
- package/out/__chunks__/chunk-LSBQBQSE.mjs +0 -2
- package/out/__chunks__/chunk-NC2PYW67.mjs +0 -2
- package/out/__chunks__/chunk-NJVYQG4N.mjs +0 -2
- package/out/__chunks__/chunk-Q5HWS7FX.mjs +0 -2
- package/out/__chunks__/chunk-R4PAEXYU.mjs.map +0 -7
- package/out/__chunks__/chunk-TKZHFVMQ.mjs +0 -2
- package/out/__chunks__/chunk-TPJ7KEUB.mjs +0 -2
- package/out/__chunks__/chunk-U66UATGK.mjs +0 -2
- package/out/__chunks__/chunk-X25IIGUZ.mjs +0 -2
- package/out/__chunks__/chunk-X25IIGUZ.mjs.map +0 -7
- package/out/__chunks__/chunk-XKBKAEYF.mjs +0 -2
- /package/out/__chunks__/{chunk-TF67ZK65.mjs.map → chunk-3LL33L5F.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VT5BFUDT.mjs.map → chunk-3UVBQHXR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HQ3MXZM2.mjs.map → chunk-44EDRVCP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-726BASBO.mjs.map → chunk-4AVJA7MF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KDOO7OCC.mjs.map → chunk-4KTXRMDS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HGZQIUMH.mjs.map → chunk-4YUEQAGD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OAKDIMYH.mjs.map → chunk-632VK5RN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QF3ACWOH.mjs.map → chunk-6GKWP4IU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-47FDQOU2.mjs.map → chunk-6QDJ2IO3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZSJNTJKG.mjs.map → chunk-A6XTQQEL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NQ2ACSWO.mjs.map → chunk-AQ7ZQRAJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DCOMKCXN.mjs.map → chunk-C22Q5W5S.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XEENI7BQ.mjs.map → chunk-CCFQYROV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-72BFMMSI.mjs.map → chunk-CHCWBFEG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3AN3HJA5.mjs.map → chunk-CLPLLK67.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JYIAIJ37.mjs.map → chunk-CYWOWIRB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LSBQBQSE.mjs.map → chunk-D4V7EOIL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZG4ZEFUR.mjs.map → chunk-DGL4E36L.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NJVYQG4N.mjs.map → chunk-DT3MXNJI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WL56YMKX.mjs.map → chunk-EIL6PTC4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7XW3S67Y.mjs.map → chunk-EQOLFL4H.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-K4MA6VJX.mjs.map → chunk-FZKGYTPJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BECHXPBC.mjs.map → chunk-GF3J27ZR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Q5HWS7FX.mjs.map → chunk-GQAGO7KW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-O3AN3EMP.mjs.map → chunk-HSAPJUAV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WXS4MAB3.mjs.map → chunk-IDCBOZNB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-O6LQEIE2.mjs.map → chunk-II663X5B.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RNWJHZLH.mjs.map → chunk-IJWIF6QG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6DW4VXLU.mjs.map → chunk-IT3RZ4HT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-J7WJREOM.mjs.map → chunk-IXHQSJBO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BPKM2DQN.mjs.map → chunk-K4BSSSHE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PMOKDTDV.mjs.map → chunk-KGKDFREW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-S2RWU5BV.mjs.map → chunk-KMKXCFDQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HSIBZ2L5.mjs.map → chunk-KNZRUMOW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4JCMNQXS.mjs.map → chunk-LDIEAM6D.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7HP3FIAW.mjs.map → chunk-MQFYSUO6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-P6PUVTFU.mjs.map → chunk-NAJG7WG4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AF3RP6VA.mjs.map → chunk-NN3CS646.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KOA4KAE3.mjs.map → chunk-NQZVWZM5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AH5RW56M.mjs.map → chunk-O46BVCSH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KN26DF7H.mjs.map → chunk-PFMI2MWN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OWV2V6SX.mjs.map → chunk-PRBRKMR4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SFAWPLJB.mjs.map → chunk-PSSRDP4O.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2FDNVFTD.mjs.map → chunk-QMHHBZ5O.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NPRED3F5.mjs.map → chunk-QXVINXTO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-77NCTJIH.mjs.map → chunk-RCM3SNZB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LPXPAY7D.mjs.map → chunk-RMSMZKTD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DWYHYJNY.mjs.map → chunk-RQG6ZONS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TKZHFVMQ.mjs.map → chunk-SBDWJ7ES.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5FVAEFKL.mjs.map → chunk-SDJQOCX2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KKP56V4G.mjs.map → chunk-SJCFVUWO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NMNJWV6J.mjs.map → chunk-SJUTPNHW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-S5ZROGZQ.mjs.map → chunk-T5FALTG2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4MXAQBQ4.mjs.map → chunk-TJYIVY7J.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QIF2DQBN.mjs.map → chunk-TMNKFPRG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QC6KCYKL.mjs.map → chunk-TRUQQVTW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NZ5CEUB5.mjs.map → chunk-UA5WGULZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SUCBDFIP.mjs.map → chunk-UEPKOEV5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ILMJWCA5.mjs.map → chunk-UPIJGCBH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NC2PYW67.mjs.map → chunk-VFIKV2UU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2FJUAWNG.mjs.map → chunk-VHHB4LMW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6DI7XSHB.mjs.map → chunk-VHOQPKEC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LNCOC6DZ.mjs.map → chunk-VN62BHIP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-O5L6HOQJ.mjs.map → chunk-VQ4W2MEF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XKBKAEYF.mjs.map → chunk-WYVDY3V7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LLJ3VLPO.mjs.map → chunk-X3XRZCS3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CRC6EHJB.mjs.map → chunk-YC3NVMU3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5A2ZB2NK.mjs.map → chunk-YJMGYDU3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-G26BK7D7.mjs.map → chunk-YQ63ZYW2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-U66UATGK.mjs.map → chunk-YY55H5EM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WKWVAY3B.mjs.map → chunk-ZM3VDK22.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3Z2ACTV6.mjs.map → chunk-ZPCNRXQG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QZOCKDRL.mjs.map → chunk-ZTLWHYQL.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../../../__chunks__/chunk-VCAWVAO5.mjs";import{a as g}from"../../../../__chunks__/chunk-55W25Q35.mjs";import{a as h}from"../../../../__chunks__/chunk-
|
|
1
|
+
import"../../../../__chunks__/chunk-VCAWVAO5.mjs";import{a as g}from"../../../../__chunks__/chunk-55W25Q35.mjs";import{a as h}from"../../../../__chunks__/chunk-4CK3GBRH.mjs";import"../../../../__chunks__/chunk-II663X5B.mjs";import"../../../../__chunks__/chunk-DGL4E36L.mjs";import"../../../../__chunks__/chunk-QMHHBZ5O.mjs";import{a as f}from"../../../../__chunks__/chunk-3L7HZ2SO.mjs";import{b}from"../../../../__chunks__/chunk-52PGMMOM.mjs";import"../../../../__chunks__/chunk-UCNS6KD5.mjs";import"../../../../__chunks__/chunk-35MNP3LA.mjs";import"../../../../__chunks__/chunk-TX7PTLVP.mjs";import{a}from"../../../../__chunks__/chunk-WZ2DNB3R.mjs";import{a as e}from"../../../../__chunks__/chunk-DFSBS3PX.mjs";import"../../../../__chunks__/chunk-GFR6K4DR.mjs";import"../../../../__chunks__/chunk-6D53LH5J.mjs";import"../../../../__chunks__/chunk-H33OUO77.mjs";import"../../../../__chunks__/chunk-HQQMSHTW.mjs";import"../../../../__chunks__/chunk-UQU2VWPJ.mjs";import{a as d}from"../../../../__chunks__/chunk-NK5Y3RLY.mjs";import"../../../../__chunks__/chunk-HMHP5DPL.mjs";import"../../../../__chunks__/chunk-54B3EIZC.mjs";import"../../../../__chunks__/chunk-QJ7MRSGB.mjs";import{a as c}from"../../../../__chunks__/chunk-VDDXFGB2.mjs";import"../../../../__chunks__/chunk-BRJNX4JF.mjs";import"../../../../__chunks__/chunk-RQG6ZONS.mjs";import"../../../../__chunks__/chunk-T4FRQ4JG.mjs";import"../../../../__chunks__/chunk-UTWIKUIK.mjs";import"../../../../__chunks__/chunk-UERJ6AKK.mjs";import"../../../../__chunks__/chunk-KPK72MOE.mjs";import"../../../../__chunks__/chunk-SAAOQW7P.mjs";import"../../../../__chunks__/chunk-VNLGNNIL.mjs";import"../../../../__chunks__/chunk-6JM4DPOH.mjs";import"../../../../__chunks__/chunk-ZODTYAYF.mjs";import"../../../../__chunks__/chunk-NLRDRI7Q.mjs";import"../../../../__chunks__/chunk-DKX6JUT6.mjs";import"../../../../__chunks__/chunk-KNZRUMOW.mjs";import"../../../../__chunks__/chunk-KRWR77QE.mjs";import"../../../../__chunks__/chunk-B7YCKWDU.mjs";import"../../../../__chunks__/chunk-HDJOER66.mjs";import"../../../../__chunks__/chunk-A7FTKX2A.mjs";import"../../../../__chunks__/chunk-XKU5QBXG.mjs";import"../../../../__chunks__/chunk-WZGG2YKQ.mjs";import"../../../../__chunks__/chunk-JMC7CMTU.mjs";import"../../../../__chunks__/chunk-S2B2ZKIJ.mjs";import"../../../../__chunks__/chunk-T2YPFNVM.mjs";import"../../../../__chunks__/chunk-M7BM6QPB.mjs";import"../../../../__chunks__/chunk-5N4F5T5L.mjs";import"../../../../__chunks__/chunk-CYCS3K6Q.mjs";import"../../../../__chunks__/chunk-YMPZDHKF.mjs";import"../../../../__chunks__/chunk-VKEESSBI.mjs";import"../../../../__chunks__/chunk-2DNGCNYM.mjs";import"../../../../__chunks__/chunk-SQVKVA7X.mjs";import"../../../../__chunks__/chunk-I24YBVHK.mjs";import"../../../../__chunks__/chunk-NB7A4C7L.mjs";import"../../../../__chunks__/chunk-PJWJZHIS.mjs";import"../../../../__chunks__/chunk-DBIIY2TX.mjs";import"../../../../__chunks__/chunk-KD2IQ32V.mjs";import"../../../../__chunks__/chunk-7CELSV4S.mjs";import"../../../../__chunks__/chunk-YUITECZ5.mjs";import"../../../../__chunks__/chunk-TVELGQIH.mjs";import"../../../../__chunks__/chunk-2BSPSW6X.mjs";import"../../../../__chunks__/chunk-OVXVICF7.mjs";import"../../../../__chunks__/chunk-BTJWNUM6.mjs";import"../../../../__chunks__/chunk-TRMQFQOQ.mjs";import"../../../../__chunks__/chunk-WZI2I6NX.mjs";import"../../../../__chunks__/chunk-TI37DKBT.mjs";import"../../../../__chunks__/chunk-NTEMINYA.mjs";import"../../../../__chunks__/chunk-WRLZ5ICK.mjs";import"../../../../__chunks__/chunk-I3MK6KZJ.mjs";import"../../../../__chunks__/chunk-MGFIOCA4.mjs";import"../../../../__chunks__/chunk-GGBMHKR4.mjs";import"../../../../__chunks__/chunk-GLXG5BES.mjs";import"../../../../__chunks__/chunk-ENHFZ4TV.mjs";export{g as createTransactionsHistoryFromSessions,a as getReceiverData,c as getTransactionAmount,d as getTransactionAsset,h as mapServerTransactionsToListItems,f as mapTransactionToListItem,b as processTransactionAction,e as processTransactionAssets};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.cjs
CHANGED
|
@@ -31,7 +31,8 @@ const mapServerTransactionsToListItems = async ({
|
|
|
31
31
|
transactions,
|
|
32
32
|
address,
|
|
33
33
|
explorerAddress,
|
|
34
|
-
egldLabel
|
|
34
|
+
egldLabel,
|
|
35
|
+
skipFetchingTransactions = false
|
|
35
36
|
}) => {
|
|
36
37
|
const cachedTransactions = [];
|
|
37
38
|
const hashesToFetch = [];
|
|
@@ -46,7 +47,11 @@ const mapServerTransactionsToListItems = async ({
|
|
|
46
47
|
if (hashesToFetch.length === 0) {
|
|
47
48
|
return sortTransactionsByTimestamp(cachedTransactions);
|
|
48
49
|
}
|
|
49
|
-
const newTransactions =
|
|
50
|
+
const newTransactions = skipFetchingTransactions ? transactions.map((tx) => ({
|
|
51
|
+
// casting is correct since store transaction was replaced with fetched server transaction
|
|
52
|
+
...tx,
|
|
53
|
+
txHash: tx.hash
|
|
54
|
+
})) : await (0, import_getServerTransactionsByHashes.getServerTransactionsByHashes)(hashesToFetch);
|
|
50
55
|
const retrievedHashes = newTransactions.map((tx) => tx.txHash);
|
|
51
56
|
const missingHashes = hashesToFetch.filter(
|
|
52
57
|
(hash) => !retrievedHashes.includes(hash)
|
|
@@ -71,6 +76,14 @@ const mapServerTransactionsToListItems = async ({
|
|
|
71
76
|
);
|
|
72
77
|
newTransactions.push(...pendingDummyTransactions);
|
|
73
78
|
}
|
|
79
|
+
const uniqueTransactionsMap = /* @__PURE__ */ new Map();
|
|
80
|
+
cachedTransactions.forEach((item) => {
|
|
81
|
+
const key = item.hash;
|
|
82
|
+
if (!key) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
uniqueTransactionsMap.set(String(key), item);
|
|
86
|
+
});
|
|
74
87
|
newTransactions.forEach((transaction) => {
|
|
75
88
|
const transactionListItem = (0, import_mapTransactionToListItem.mapTransactionToListItem)({
|
|
76
89
|
transaction,
|
|
@@ -84,9 +97,11 @@ const mapServerTransactionsToListItems = async ({
|
|
|
84
97
|
value: transactionListItem
|
|
85
98
|
});
|
|
86
99
|
}
|
|
87
|
-
|
|
100
|
+
uniqueTransactionsMap.set(transaction.txHash, transactionListItem);
|
|
88
101
|
});
|
|
89
|
-
return sortTransactionsByTimestamp(
|
|
102
|
+
return sortTransactionsByTimestamp(
|
|
103
|
+
Array.from(uniqueTransactionsMap.values())
|
|
104
|
+
);
|
|
90
105
|
};
|
|
91
106
|
// Annotate the CommonJS export names for ESM import in node:
|
|
92
107
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.ts"],
|
|
4
|
-
"sourcesContent": ["import { getServerTransactionsByHashes } from 'apiCalls/transactions/getServerTransactionsByHashes';\nimport { ITransactionListItem } from 'lib/sdkDappUi';\nimport { saveToCache } from 'store/actions/cache/cacheActions';\nimport { TransactionServerStatusesEnum } from 'types/enums.types';\nimport { ServerTransactionType } from 'types/serverTransactions.types';\nimport { SignedTransactionType } from 'types/transactions.types';\nimport { getCachedTransactionListItem } from './getCachedTransactionListItem';\nimport { mapTransactionToListItem } from './mapTransactionToListItem';\n\ninterface IMapServerTransactionsToListItemsParams {\n transactions: SignedTransactionType[];\n address: string;\n explorerAddress: string;\n egldLabel: string;\n}\n\nconst sortTransactionsByTimestamp = (transactions: ITransactionListItem[]) =>\n transactions.sort((a, b) => b.timestamp - a.timestamp);\n\nexport const mapServerTransactionsToListItems = async ({\n transactions,\n address,\n explorerAddress,\n egldLabel\n}: IMapServerTransactionsToListItemsParams): Promise<\n ITransactionListItem[]\n> => {\n const cachedTransactions: ITransactionListItem[] = [];\n const hashesToFetch: string[] = [];\n\n transactions.forEach((transaction) => {\n const cachedTransaction = getCachedTransactionListItem(transaction.hash);\n if (cachedTransaction) {\n cachedTransactions.push(cachedTransaction);\n } else {\n hashesToFetch.push(transaction.hash);\n }\n });\n\n if (hashesToFetch.length === 0) {\n return sortTransactionsByTimestamp(cachedTransactions);\n }\n\n const newTransactions = await getServerTransactionsByHashes(hashesToFetch);\n\n const retrievedHashes = newTransactions.map((tx) => tx.txHash);\n const missingHashes = hashesToFetch.filter(\n (hash) => !retrievedHashes.includes(hash)\n );\n\n if (missingHashes.length > 0) {\n const filteredTransactions = transactions.filter((transaction) =>\n missingHashes.includes(transaction.hash)\n );\n\n // In case the transactions were not found, we create a dummy transaction with the pending status\n // until all pending transactions are returned from the API\n const pendingDummyTransactions = filteredTransactions.map(\n (transaction) =>\n ({\n ...transaction,\n txHash: transaction.hash,\n price: 0,\n status: TransactionServerStatusesEnum.pending,\n gasUsed: 0,\n miniBlockHash: '',\n receiverShard: 0,\n round: 0,\n senderShard: 0,\n timestamp: Date.now()\n }) as ServerTransactionType\n );\n\n newTransactions.push(...pendingDummyTransactions);\n }\n\n newTransactions.forEach((transaction) => {\n const transactionListItem = mapTransactionToListItem({\n transaction,\n address,\n explorerAddress,\n egldLabel\n });\n\n if (transactionListItem.status !== TransactionServerStatusesEnum.pending) {\n saveToCache({\n key: `transaction-${transaction.txHash}`,\n value: transactionListItem\n });\n }\n\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2CAA8C;AAE9C,0BAA4B;AAC5B,mBAA8C;AAG9C,0CAA6C;AAC7C,sCAAyC;
|
|
4
|
+
"sourcesContent": ["import { getServerTransactionsByHashes } from 'apiCalls/transactions/getServerTransactionsByHashes';\nimport { ITransactionListItem } from 'lib/sdkDappUi';\nimport { saveToCache } from 'store/actions/cache/cacheActions';\nimport { TransactionServerStatusesEnum } from 'types/enums.types';\nimport { ServerTransactionType } from 'types/serverTransactions.types';\nimport { SignedTransactionType } from 'types/transactions.types';\nimport { getCachedTransactionListItem } from './getCachedTransactionListItem';\nimport { mapTransactionToListItem } from './mapTransactionToListItem';\n\ninterface IMapServerTransactionsToListItemsParams {\n transactions: SignedTransactionType[];\n address: string;\n explorerAddress: string;\n egldLabel: string;\n skipFetchingTransactions?: boolean;\n}\n\nconst sortTransactionsByTimestamp = (transactions: ITransactionListItem[]) =>\n transactions.sort((a, b) => b.timestamp - a.timestamp);\n\nexport const mapServerTransactionsToListItems = async ({\n transactions,\n address,\n explorerAddress,\n egldLabel,\n skipFetchingTransactions = false\n}: IMapServerTransactionsToListItemsParams): Promise<\n ITransactionListItem[]\n> => {\n const cachedTransactions: ITransactionListItem[] = [];\n const hashesToFetch: string[] = [];\n\n transactions.forEach((transaction) => {\n const cachedTransaction = getCachedTransactionListItem(transaction.hash);\n if (cachedTransaction) {\n cachedTransactions.push(cachedTransaction);\n } else {\n hashesToFetch.push(transaction.hash);\n }\n });\n\n if (hashesToFetch.length === 0) {\n return sortTransactionsByTimestamp(cachedTransactions);\n }\n\n const newTransactions: ServerTransactionType[] = skipFetchingTransactions\n ? transactions.map((tx) => ({\n // casting is correct since store transaction was replaced with fetched server transaction\n ...(tx as unknown as ServerTransactionType),\n txHash: tx.hash\n }))\n : await getServerTransactionsByHashes(hashesToFetch);\n\n const retrievedHashes = newTransactions.map((tx) => tx.txHash);\n const missingHashes = hashesToFetch.filter(\n (hash) => !retrievedHashes.includes(hash)\n );\n\n if (missingHashes.length > 0) {\n const filteredTransactions = transactions.filter((transaction) =>\n missingHashes.includes(transaction.hash)\n );\n\n // In case the transactions were not found, we create a dummy transaction with the pending status\n // until all pending transactions are returned from the API\n const pendingDummyTransactions = filteredTransactions.map(\n (transaction) =>\n ({\n ...transaction,\n txHash: transaction.hash,\n price: 0,\n status: TransactionServerStatusesEnum.pending,\n gasUsed: 0,\n miniBlockHash: '',\n receiverShard: 0,\n round: 0,\n senderShard: 0,\n timestamp: Date.now()\n }) as ServerTransactionType\n );\n\n newTransactions.push(...pendingDummyTransactions);\n }\n\n const uniqueTransactionsMap = new Map<string, ITransactionListItem>();\n\n cachedTransactions.forEach((item) => {\n const key = item.hash;\n if (!key) {\n return;\n }\n uniqueTransactionsMap.set(String(key), item);\n });\n\n newTransactions.forEach((transaction) => {\n const transactionListItem = mapTransactionToListItem({\n transaction,\n address,\n explorerAddress,\n egldLabel\n });\n\n if (transactionListItem.status !== TransactionServerStatusesEnum.pending) {\n saveToCache({\n key: `transaction-${transaction.txHash}`,\n value: transactionListItem\n });\n }\n\n uniqueTransactionsMap.set(transaction.txHash, transactionListItem);\n });\n\n return sortTransactionsByTimestamp(\n Array.from(uniqueTransactionsMap.values())\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2CAA8C;AAE9C,0BAA4B;AAC5B,mBAA8C;AAG9C,0CAA6C;AAC7C,sCAAyC;AAUzC,MAAM,8BAA8B,CAAC,iBACnC,aAAa,KAAK,CAAC,GAAG,MAAM,EAAE,YAAY,EAAE,SAAS;AAEhD,MAAM,mCAAmC,OAAO;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,2BAA2B;AAC7B,MAEK;AACH,QAAM,qBAA6C,CAAC;AACpD,QAAM,gBAA0B,CAAC;AAEjC,eAAa,QAAQ,CAAC,gBAAgB;AACpC,UAAM,wBAAoB,kEAA6B,YAAY,IAAI;AACvE,QAAI,mBAAmB;AACrB,yBAAmB,KAAK,iBAAiB;AAAA,IAC3C,OAAO;AACL,oBAAc,KAAK,YAAY,IAAI;AAAA,IACrC;AAAA,EACF,CAAC;AAED,MAAI,cAAc,WAAW,GAAG;AAC9B,WAAO,4BAA4B,kBAAkB;AAAA,EACvD;AAEA,QAAM,kBAA2C,2BAC7C,aAAa,IAAI,CAAC,QAAQ;AAAA;AAAA,IAExB,GAAI;AAAA,IACJ,QAAQ,GAAG;AAAA,EACb,EAAE,IACF,UAAM,oEAA8B,aAAa;AAErD,QAAM,kBAAkB,gBAAgB,IAAI,CAAC,OAAO,GAAG,MAAM;AAC7D,QAAM,gBAAgB,cAAc;AAAA,IAClC,CAAC,SAAS,CAAC,gBAAgB,SAAS,IAAI;AAAA,EAC1C;AAEA,MAAI,cAAc,SAAS,GAAG;AAC5B,UAAM,uBAAuB,aAAa;AAAA,MAAO,CAAC,gBAChD,cAAc,SAAS,YAAY,IAAI;AAAA,IACzC;AAIA,UAAM,2BAA2B,qBAAqB;AAAA,MACpD,CAAC,iBACE;AAAA,QACC,GAAG;AAAA,QACH,QAAQ,YAAY;AAAA,QACpB,OAAO;AAAA,QACP,QAAQ,2CAA8B;AAAA,QACtC,SAAS;AAAA,QACT,eAAe;AAAA,QACf,eAAe;AAAA,QACf,OAAO;AAAA,QACP,aAAa;AAAA,QACb,WAAW,KAAK,IAAI;AAAA,MACtB;AAAA,IACJ;AAEA,oBAAgB,KAAK,GAAG,wBAAwB;AAAA,EAClD;AAEA,QAAM,wBAAwB,oBAAI,IAAkC;AAEpE,qBAAmB,QAAQ,CAAC,SAAS;AACnC,UAAM,MAAM,KAAK;AACjB,QAAI,CAAC,KAAK;AACR;AAAA,IACF;AACA,0BAAsB,IAAI,OAAO,GAAG,GAAG,IAAI;AAAA,EAC7C,CAAC;AAED,kBAAgB,QAAQ,CAAC,gBAAgB;AACvC,UAAM,0BAAsB,0DAAyB;AAAA,MACnD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,QAAI,oBAAoB,WAAW,2CAA8B,SAAS;AACxE,2CAAY;AAAA,QACV,KAAK,eAAe,YAAY,MAAM;AAAA,QACtC,OAAO;AAAA,MACT,CAAC;AAAA,IACH;AAEA,0BAAsB,IAAI,YAAY,QAAQ,mBAAmB;AAAA,EACnE,CAAC;AAED,SAAO;AAAA,IACL,MAAM,KAAK,sBAAsB,OAAO,CAAC;AAAA,EAC3C;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ interface IMapServerTransactionsToListItemsParams {
|
|
|
5
5
|
address: string;
|
|
6
6
|
explorerAddress: string;
|
|
7
7
|
egldLabel: string;
|
|
8
|
+
skipFetchingTransactions?: boolean;
|
|
8
9
|
}
|
|
9
|
-
export declare const mapServerTransactionsToListItems: ({ transactions, address, explorerAddress, egldLabel }: IMapServerTransactionsToListItemsParams) => Promise<ITransactionListItem[]>;
|
|
10
|
+
export declare const mapServerTransactionsToListItems: ({ transactions, address, explorerAddress, egldLabel, skipFetchingTransactions }: IMapServerTransactionsToListItemsParams) => Promise<ITransactionListItem[]>;
|
|
10
11
|
export {};
|
package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../../../__chunks__/chunk-
|
|
1
|
+
import{a}from"../../../../__chunks__/chunk-4CK3GBRH.mjs";import"../../../../__chunks__/chunk-II663X5B.mjs";import"../../../../__chunks__/chunk-DGL4E36L.mjs";import"../../../../__chunks__/chunk-QMHHBZ5O.mjs";import"../../../../__chunks__/chunk-3L7HZ2SO.mjs";import"../../../../__chunks__/chunk-52PGMMOM.mjs";import"../../../../__chunks__/chunk-UCNS6KD5.mjs";import"../../../../__chunks__/chunk-35MNP3LA.mjs";import"../../../../__chunks__/chunk-TX7PTLVP.mjs";import"../../../../__chunks__/chunk-WZ2DNB3R.mjs";import"../../../../__chunks__/chunk-DFSBS3PX.mjs";import"../../../../__chunks__/chunk-GFR6K4DR.mjs";import"../../../../__chunks__/chunk-6D53LH5J.mjs";import"../../../../__chunks__/chunk-H33OUO77.mjs";import"../../../../__chunks__/chunk-HQQMSHTW.mjs";import"../../../../__chunks__/chunk-UQU2VWPJ.mjs";import"../../../../__chunks__/chunk-NK5Y3RLY.mjs";import"../../../../__chunks__/chunk-HMHP5DPL.mjs";import"../../../../__chunks__/chunk-54B3EIZC.mjs";import"../../../../__chunks__/chunk-QJ7MRSGB.mjs";import"../../../../__chunks__/chunk-VDDXFGB2.mjs";import"../../../../__chunks__/chunk-BRJNX4JF.mjs";import"../../../../__chunks__/chunk-RQG6ZONS.mjs";import"../../../../__chunks__/chunk-T4FRQ4JG.mjs";import"../../../../__chunks__/chunk-UTWIKUIK.mjs";import"../../../../__chunks__/chunk-UERJ6AKK.mjs";import"../../../../__chunks__/chunk-KPK72MOE.mjs";import"../../../../__chunks__/chunk-SAAOQW7P.mjs";import"../../../../__chunks__/chunk-VNLGNNIL.mjs";import"../../../../__chunks__/chunk-6JM4DPOH.mjs";import"../../../../__chunks__/chunk-ZODTYAYF.mjs";import"../../../../__chunks__/chunk-NLRDRI7Q.mjs";import"../../../../__chunks__/chunk-DKX6JUT6.mjs";import"../../../../__chunks__/chunk-KNZRUMOW.mjs";import"../../../../__chunks__/chunk-KRWR77QE.mjs";import"../../../../__chunks__/chunk-B7YCKWDU.mjs";import"../../../../__chunks__/chunk-HDJOER66.mjs";import"../../../../__chunks__/chunk-A7FTKX2A.mjs";import"../../../../__chunks__/chunk-XKU5QBXG.mjs";import"../../../../__chunks__/chunk-WZGG2YKQ.mjs";import"../../../../__chunks__/chunk-JMC7CMTU.mjs";import"../../../../__chunks__/chunk-S2B2ZKIJ.mjs";import"../../../../__chunks__/chunk-T2YPFNVM.mjs";import"../../../../__chunks__/chunk-M7BM6QPB.mjs";import"../../../../__chunks__/chunk-5N4F5T5L.mjs";import"../../../../__chunks__/chunk-CYCS3K6Q.mjs";import"../../../../__chunks__/chunk-YMPZDHKF.mjs";import"../../../../__chunks__/chunk-VKEESSBI.mjs";import"../../../../__chunks__/chunk-2DNGCNYM.mjs";import"../../../../__chunks__/chunk-SQVKVA7X.mjs";import"../../../../__chunks__/chunk-I24YBVHK.mjs";import"../../../../__chunks__/chunk-NB7A4C7L.mjs";import"../../../../__chunks__/chunk-PJWJZHIS.mjs";import"../../../../__chunks__/chunk-DBIIY2TX.mjs";import"../../../../__chunks__/chunk-KD2IQ32V.mjs";import"../../../../__chunks__/chunk-7CELSV4S.mjs";import"../../../../__chunks__/chunk-YUITECZ5.mjs";import"../../../../__chunks__/chunk-TVELGQIH.mjs";import"../../../../__chunks__/chunk-2BSPSW6X.mjs";import"../../../../__chunks__/chunk-OVXVICF7.mjs";import"../../../../__chunks__/chunk-BTJWNUM6.mjs";import"../../../../__chunks__/chunk-TRMQFQOQ.mjs";import"../../../../__chunks__/chunk-WZI2I6NX.mjs";import"../../../../__chunks__/chunk-TI37DKBT.mjs";import"../../../../__chunks__/chunk-NTEMINYA.mjs";import"../../../../__chunks__/chunk-WRLZ5ICK.mjs";import"../../../../__chunks__/chunk-I3MK6KZJ.mjs";import"../../../../__chunks__/chunk-MGFIOCA4.mjs";import"../../../../__chunks__/chunk-GGBMHKR4.mjs";import"../../../../__chunks__/chunk-GLXG5BES.mjs";import"../../../../__chunks__/chunk-ENHFZ4TV.mjs";export{a as mapServerTransactionsToListItems};
|
|
2
2
|
//# sourceMappingURL=mapServerTransactionsToListItems.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../../__chunks__/chunk-IXBWD6BF.mjs";import{a as i}from"../../../__chunks__/chunk-
|
|
1
|
+
import"../../../__chunks__/chunk-IXBWD6BF.mjs";import{a as i}from"../../../__chunks__/chunk-PRBRKMR4.mjs";import"../../../__chunks__/chunk-VCAWVAO5.mjs";import{a as g}from"../../../__chunks__/chunk-55W25Q35.mjs";import{a as h}from"../../../__chunks__/chunk-4CK3GBRH.mjs";import"../../../__chunks__/chunk-II663X5B.mjs";import"../../../__chunks__/chunk-DGL4E36L.mjs";import"../../../__chunks__/chunk-QMHHBZ5O.mjs";import{a as f}from"../../../__chunks__/chunk-3L7HZ2SO.mjs";import{b}from"../../../__chunks__/chunk-52PGMMOM.mjs";import"../../../__chunks__/chunk-UCNS6KD5.mjs";import"../../../__chunks__/chunk-35MNP3LA.mjs";import"../../../__chunks__/chunk-TX7PTLVP.mjs";import{a}from"../../../__chunks__/chunk-WZ2DNB3R.mjs";import{a as e}from"../../../__chunks__/chunk-DFSBS3PX.mjs";import"../../../__chunks__/chunk-GFR6K4DR.mjs";import"../../../__chunks__/chunk-6D53LH5J.mjs";import"../../../__chunks__/chunk-H33OUO77.mjs";import"../../../__chunks__/chunk-HQQMSHTW.mjs";import"../../../__chunks__/chunk-UQU2VWPJ.mjs";import{a as d}from"../../../__chunks__/chunk-NK5Y3RLY.mjs";import"../../../__chunks__/chunk-HMHP5DPL.mjs";import"../../../__chunks__/chunk-54B3EIZC.mjs";import"../../../__chunks__/chunk-QJ7MRSGB.mjs";import{a as c}from"../../../__chunks__/chunk-VDDXFGB2.mjs";import"../../../__chunks__/chunk-BRJNX4JF.mjs";import"../../../__chunks__/chunk-RQG6ZONS.mjs";import"../../../__chunks__/chunk-T4FRQ4JG.mjs";import"../../../__chunks__/chunk-UTWIKUIK.mjs";import"../../../__chunks__/chunk-UERJ6AKK.mjs";import"../../../__chunks__/chunk-KPK72MOE.mjs";import"../../../__chunks__/chunk-SAAOQW7P.mjs";import"../../../__chunks__/chunk-VNLGNNIL.mjs";import"../../../__chunks__/chunk-6JM4DPOH.mjs";import"../../../__chunks__/chunk-ZODTYAYF.mjs";import"../../../__chunks__/chunk-NLRDRI7Q.mjs";import"../../../__chunks__/chunk-DKX6JUT6.mjs";import"../../../__chunks__/chunk-KNZRUMOW.mjs";import"../../../__chunks__/chunk-KRWR77QE.mjs";import"../../../__chunks__/chunk-B7YCKWDU.mjs";import"../../../__chunks__/chunk-HDJOER66.mjs";import"../../../__chunks__/chunk-A7FTKX2A.mjs";import"../../../__chunks__/chunk-XKU5QBXG.mjs";import"../../../__chunks__/chunk-WZGG2YKQ.mjs";import"../../../__chunks__/chunk-JMC7CMTU.mjs";import"../../../__chunks__/chunk-S2B2ZKIJ.mjs";import"../../../__chunks__/chunk-T2YPFNVM.mjs";import"../../../__chunks__/chunk-M7BM6QPB.mjs";import"../../../__chunks__/chunk-5N4F5T5L.mjs";import"../../../__chunks__/chunk-CYCS3K6Q.mjs";import"../../../__chunks__/chunk-YMPZDHKF.mjs";import"../../../__chunks__/chunk-VKEESSBI.mjs";import"../../../__chunks__/chunk-2DNGCNYM.mjs";import"../../../__chunks__/chunk-SQVKVA7X.mjs";import"../../../__chunks__/chunk-I24YBVHK.mjs";import"../../../__chunks__/chunk-NB7A4C7L.mjs";import"../../../__chunks__/chunk-PJWJZHIS.mjs";import"../../../__chunks__/chunk-DBIIY2TX.mjs";import"../../../__chunks__/chunk-KD2IQ32V.mjs";import"../../../__chunks__/chunk-7CELSV4S.mjs";import"../../../__chunks__/chunk-YUITECZ5.mjs";import"../../../__chunks__/chunk-TVELGQIH.mjs";import"../../../__chunks__/chunk-2BSPSW6X.mjs";import"../../../__chunks__/chunk-OVXVICF7.mjs";import"../../../__chunks__/chunk-BTJWNUM6.mjs";import"../../../__chunks__/chunk-TRMQFQOQ.mjs";import"../../../__chunks__/chunk-WZI2I6NX.mjs";import"../../../__chunks__/chunk-TI37DKBT.mjs";import"../../../__chunks__/chunk-NTEMINYA.mjs";import"../../../__chunks__/chunk-WRLZ5ICK.mjs";import"../../../__chunks__/chunk-I3MK6KZJ.mjs";import"../../../__chunks__/chunk-MGFIOCA4.mjs";import"../../../__chunks__/chunk-GGBMHKR4.mjs";import"../../../__chunks__/chunk-GLXG5BES.mjs";import"../../../__chunks__/chunk-ENHFZ4TV.mjs";export{g as createTransactionsHistoryFromSessions,a as getReceiverData,c as getTransactionAmount,d as getTransactionAsset,i as getTransactionsHistory,h as mapServerTransactionsToListItems,f as mapTransactionToListItem,b as processTransactionAction,e as processTransactionAssets};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../__chunks__/chunk-TFZ46GCB.mjs";import"../../__chunks__/chunk-OL6LWUIJ.mjs";import{a as i}from"../../__chunks__/chunk-N342XMFH.mjs";import"../../__chunks__/chunk-2IUBMLF4.mjs";import"../../__chunks__/chunk-KIOUFP5Q.mjs";import{a as h}from"../../__chunks__/chunk-DSVSX4ZT.mjs";import{a as g}from"../../__chunks__/chunk-DZ2BIDRW.mjs";import{a as f}from"../../__chunks__/chunk-WJQVMI33.mjs";import{a as e}from"../../__chunks__/chunk-BHAHZQVO.mjs";import{a as d}from"../../__chunks__/chunk-EAH7XGM3.mjs";import{a as c}from"../../__chunks__/chunk-OOVV574D.mjs";import"../../__chunks__/chunk-ZAPRDHIW.mjs";import"../../__chunks__/chunk-GIZSIYH4.mjs";import"../../__chunks__/chunk-WVAP3V3E.mjs";import"../../__chunks__/chunk-XVX7N3JK.mjs";import"../../__chunks__/chunk-HH5SA7BX.mjs";import"../../__chunks__/chunk-OEPTRJEB.mjs";import{a as j}from"../../__chunks__/chunk-B3IKUIRK.mjs";import{a as b}from"../../__chunks__/chunk-
|
|
1
|
+
import"../../__chunks__/chunk-TFZ46GCB.mjs";import"../../__chunks__/chunk-OL6LWUIJ.mjs";import{a as i}from"../../__chunks__/chunk-N342XMFH.mjs";import"../../__chunks__/chunk-2IUBMLF4.mjs";import"../../__chunks__/chunk-KIOUFP5Q.mjs";import{a as h}from"../../__chunks__/chunk-DSVSX4ZT.mjs";import{a as g}from"../../__chunks__/chunk-DZ2BIDRW.mjs";import{a as f}from"../../__chunks__/chunk-WJQVMI33.mjs";import{a as e}from"../../__chunks__/chunk-BHAHZQVO.mjs";import{a as d}from"../../__chunks__/chunk-EAH7XGM3.mjs";import{a as c}from"../../__chunks__/chunk-OOVV574D.mjs";import"../../__chunks__/chunk-ZAPRDHIW.mjs";import"../../__chunks__/chunk-GIZSIYH4.mjs";import"../../__chunks__/chunk-WVAP3V3E.mjs";import"../../__chunks__/chunk-XVX7N3JK.mjs";import"../../__chunks__/chunk-HH5SA7BX.mjs";import"../../__chunks__/chunk-OEPTRJEB.mjs";import{a as j}from"../../__chunks__/chunk-B3IKUIRK.mjs";import{a as b}from"../../__chunks__/chunk-TRUQQVTW.mjs";import"../../__chunks__/chunk-TQA3JDNV.mjs";import"../../__chunks__/chunk-IXBWD6BF.mjs";import{a as s}from"../../__chunks__/chunk-PRBRKMR4.mjs";import"../../__chunks__/chunk-VCAWVAO5.mjs";import{a as q}from"../../__chunks__/chunk-55W25Q35.mjs";import{a as r}from"../../__chunks__/chunk-4CK3GBRH.mjs";import"../../__chunks__/chunk-II663X5B.mjs";import"../../__chunks__/chunk-DGL4E36L.mjs";import"../../__chunks__/chunk-QMHHBZ5O.mjs";import{a as p}from"../../__chunks__/chunk-3L7HZ2SO.mjs";import{b as l}from"../../__chunks__/chunk-52PGMMOM.mjs";import"../../__chunks__/chunk-UCNS6KD5.mjs";import"../../__chunks__/chunk-35MNP3LA.mjs";import"../../__chunks__/chunk-TX7PTLVP.mjs";import{a as k}from"../../__chunks__/chunk-WZ2DNB3R.mjs";import{a as o}from"../../__chunks__/chunk-DFSBS3PX.mjs";import"../../__chunks__/chunk-GFR6K4DR.mjs";import"../../__chunks__/chunk-6D53LH5J.mjs";import"../../__chunks__/chunk-H33OUO77.mjs";import"../../__chunks__/chunk-HQQMSHTW.mjs";import"../../__chunks__/chunk-UQU2VWPJ.mjs";import{a as n}from"../../__chunks__/chunk-NK5Y3RLY.mjs";import"../../__chunks__/chunk-HMHP5DPL.mjs";import"../../__chunks__/chunk-54B3EIZC.mjs";import"../../__chunks__/chunk-QJ7MRSGB.mjs";import{a as m}from"../../__chunks__/chunk-VDDXFGB2.mjs";import"../../__chunks__/chunk-BRJNX4JF.mjs";import"../../__chunks__/chunk-RQG6ZONS.mjs";import"../../__chunks__/chunk-T4FRQ4JG.mjs";import"../../__chunks__/chunk-UTWIKUIK.mjs";import"../../__chunks__/chunk-UERJ6AKK.mjs";import"../../__chunks__/chunk-KPK72MOE.mjs";import"../../__chunks__/chunk-SAAOQW7P.mjs";import"../../__chunks__/chunk-VNLGNNIL.mjs";import"../../__chunks__/chunk-6JM4DPOH.mjs";import"../../__chunks__/chunk-ZODTYAYF.mjs";import"../../__chunks__/chunk-NLRDRI7Q.mjs";import"../../__chunks__/chunk-DKX6JUT6.mjs";import"../../__chunks__/chunk-KNZRUMOW.mjs";import"../../__chunks__/chunk-KRWR77QE.mjs";import"../../__chunks__/chunk-B7YCKWDU.mjs";import"../../__chunks__/chunk-HDJOER66.mjs";import"../../__chunks__/chunk-A7FTKX2A.mjs";import"../../__chunks__/chunk-XKU5QBXG.mjs";import"../../__chunks__/chunk-WZGG2YKQ.mjs";import"../../__chunks__/chunk-JMC7CMTU.mjs";import"../../__chunks__/chunk-S2B2ZKIJ.mjs";import"../../__chunks__/chunk-T2YPFNVM.mjs";import"../../__chunks__/chunk-M7BM6QPB.mjs";import"../../__chunks__/chunk-5N4F5T5L.mjs";import"../../__chunks__/chunk-CYCS3K6Q.mjs";import"../../__chunks__/chunk-YMPZDHKF.mjs";import"../../__chunks__/chunk-VKEESSBI.mjs";import"../../__chunks__/chunk-2DNGCNYM.mjs";import"../../__chunks__/chunk-SQVKVA7X.mjs";import"../../__chunks__/chunk-I24YBVHK.mjs";import"../../__chunks__/chunk-NB7A4C7L.mjs";import"../../__chunks__/chunk-PJWJZHIS.mjs";import{a}from"../../__chunks__/chunk-DBIIY2TX.mjs";import"../../__chunks__/chunk-KD2IQ32V.mjs";import"../../__chunks__/chunk-7CELSV4S.mjs";import"../../__chunks__/chunk-YUITECZ5.mjs";import"../../__chunks__/chunk-TVELGQIH.mjs";import"../../__chunks__/chunk-2BSPSW6X.mjs";import"../../__chunks__/chunk-OVXVICF7.mjs";import"../../__chunks__/chunk-BTJWNUM6.mjs";import"../../__chunks__/chunk-TRMQFQOQ.mjs";import"../../__chunks__/chunk-WZI2I6NX.mjs";import"../../__chunks__/chunk-TI37DKBT.mjs";import"../../__chunks__/chunk-NTEMINYA.mjs";import"../../__chunks__/chunk-WRLZ5ICK.mjs";import"../../__chunks__/chunk-I3MK6KZJ.mjs";import"../../__chunks__/chunk-MGFIOCA4.mjs";import"../../__chunks__/chunk-GGBMHKR4.mjs";import"../../__chunks__/chunk-GLXG5BES.mjs";import"../../__chunks__/chunk-ENHFZ4TV.mjs";export{q as createTransactionsHistoryFromSessions,c as decodeByMethod,f as decodeHighlight,a as explorerUrlBuilder,b as getActiveTransactionsStatus,i as getDecodedDataField,e as getDecodedParts,h as getDisplayValueAndValidationWarnings,g as getHexValidationWarnings,j as getHumanReadableTimeFormat,k as getReceiverData,d as getSmartDecodedParts,m as getTransactionAmount,n as getTransactionAsset,s as getTransactionsHistory,r as mapServerTransactionsToListItems,p as mapTransactionToListItem,l as processTransactionAction,o as processTransactionAssets};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../__chunks__/chunk-WHEXX3BD.mjs";import{a}from"../../__chunks__/chunk-
|
|
1
|
+
import"../../__chunks__/chunk-WHEXX3BD.mjs";import{a}from"../../__chunks__/chunk-4YUEQAGD.mjs";import"../../__chunks__/chunk-ENHFZ4TV.mjs";export{a as switchTheme};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../__chunks__/chunk-
|
|
1
|
+
import{a}from"../../__chunks__/chunk-4YUEQAGD.mjs";import"../../__chunks__/chunk-ENHFZ4TV.mjs";export{a as switchTheme};
|
|
2
2
|
//# sourceMappingURL=switchTheme.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../__chunks__/chunk-
|
|
1
|
+
import{a}from"../../__chunks__/chunk-YJMGYDU3.mjs";import"../../__chunks__/chunk-CLPLLK67.mjs";import"../../__chunks__/chunk-ENHFZ4TV.mjs";import"../../__chunks__/chunk-B2UIPHJ3.mjs";export{a as getIsInIframe};
|
|
2
2
|
//# sourceMappingURL=getIsInIframe.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../__chunks__/chunk-
|
|
1
|
+
import{a}from"../../__chunks__/chunk-CLPLLK67.mjs";import"../../__chunks__/chunk-ENHFZ4TV.mjs";export{a as getWindowParentOrigin};
|
|
2
2
|
//# sourceMappingURL=getWindowParentOrigin.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../__chunks__/chunk-DTQL3IDP.mjs";import{a as b}from"../../__chunks__/chunk-CKTFPRJS.mjs";import{a as f}from"../../__chunks__/chunk-
|
|
1
|
+
import"../../__chunks__/chunk-DTQL3IDP.mjs";import{a as b}from"../../__chunks__/chunk-CKTFPRJS.mjs";import{a as f}from"../../__chunks__/chunk-YJMGYDU3.mjs";import"../../__chunks__/chunk-CLPLLK67.mjs";import{a as e}from"../../__chunks__/chunk-EHDGJUEU.mjs";import{a as d}from"../../__chunks__/chunk-HOCSCRJF.mjs";import"../../__chunks__/chunk-ENHFZ4TV.mjs";import{a as c}from"../../__chunks__/chunk-UE3IBKCO.mjs";import"../../__chunks__/chunk-H6IZMTJK.mjs";import{a}from"../../__chunks__/chunk-B2UIPHJ3.mjs";export{d as buildUrlParams,e as getIsAuthRoute,f as getIsInIframe,b as getWindowLocation,a as isWindowAvailable,c as sanitizeCallbackUrl};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as o,c as i}from"./chunk-QJGFIK7H.mjs";import{w as g}from"./chunk-R4PAEXYU.mjs";import{q as u}from"./chunk-DWYHYJNY.mjs";import{a as p}from"./chunk-UERJ6AKK.mjs";import{a as h,c as l,g as c}from"./chunk-NTEMINYA.mjs";import{a as y}from"./chunk-TPJ7KEUB.mjs";var M=class{constructor({onLoginCancelled:e}){this.handlers=new Map;this.store=u();this.isLoginInitiated=!1;this.handleMessage=this.handleMessage.bind(this),this.handleLoginCancelled=e}startListening(){y.addEventListener("message",this.handleMessage)}stopListening(){y.removeEventListener("message",this.handleMessage)}registerEvent(e,s){this.handlers.set(e,s)}unregisterEvent(e){this.handlers.delete(e)}async handleMessage(e){let s=e.data?.type;if(typeof s=="string"&&this.handlers.has(s))return this.handlers.get(s)?.(e);switch(s){case o.finalizeHandshakeRequest:this.handshake({event:e});break;case o.signMessageRequest:this.signMessage({event:e,payload:e.data.payload});break;case o.loginRequest:this.isLoginInitiated=!0,this.login({event:e,payload:e.data.payload});break;case o.signTransactionsRequest:this.signTransactions({event:e});break;case i.cancelResponse:case"cancelAction":this.isLoginInitiated&&await this.handleLoginCancelled();break;default:break}}async login({event:e,payload:s}){let a=s?.token;if(a)try{let{address:t}=p(this.store.getState()),r=g(),n=new c({address:new l(t),data:new Uint8Array(Buffer.from(a))}),d=(await r.signMessage(n))?.signature??"";e.source?.postMessage({type:i.loginResponse,payload:{data:{address:t,signature:Buffer.from(d).toString("hex")}}},{targetOrigin:e.origin})}catch{this.isLoginInitiated&&this.handleLoginCancelled()}finally{this.isLoginInitiated=!1}}handshake({event:e}){let s=Date.now().toString();e.source?.postMessage({type:i.finalizeHandshakeResponse,payload:{data:s}},{targetOrigin:e.origin})}async signMessage({event:e,payload:s}){let{address:a}=p(this.store.getState()),{message:t}=s;try{let r=new c({address:new l(a),data:new Uint8Array(Buffer.from(t))}),d=(await g().signMessage(r))?.signature??"";e.source?.postMessage({type:i.signMessageResponse,payload:{data:{signature:Buffer.from(d).toString("hex"),status:"signed"}}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign message")}}async signTransactions({event:e}){let s=g(),{payload:a}=e.data;if(Array.isArray(a))try{let t=a.map(n=>h.newFromPlainObject(n)),r=await s.signTransactions(t);e.source?.postMessage({type:i.signTransactionsResponse,payload:{data:r.map(n=>n.toPlainObject())}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign transactions")}}};export{M as a};
|
|
2
|
-
//# sourceMappingURL=chunk-2FHEBVWZ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.ts"],
|
|
4
|
-
"sourcesContent": ["import { safeWindow } from 'constants/index';\nimport { Address, Message, Transaction } from 'lib/sdkCore';\nimport {\n WindowProviderRequestEnums,\n WindowProviderResponseEnums,\n RequestMessageType,\n RequestPayloadType\n} from 'lib/sdkWebWalletCrossWindowProvider';\nimport { getAccountProvider } from 'providers/helpers/accountProvider';\nimport { accountSelector } from 'store/selectors';\nimport { getStore } from 'store/store';\n\ntype MessageHandler = (event: MessageEvent) => void;\n\ntype MessageEventType = {\n event: MessageEvent<MessageType>;\n};\n\ntype MessageType =\n | RequestMessageType\n | { type: 'cancelAction'; payload: null }\n | {\n type: WindowProviderResponseEnums.cancelResponse;\n payload: null;\n };\n\nexport class WebviewClient {\n private readonly handlers: Map<string, MessageHandler> = new Map();\n private readonly store = getStore();\n private isLoginInitiated = false;\n private readonly handleLoginCancelled: () => Promise<void>;\n\n constructor({ onLoginCancelled }: { onLoginCancelled: () => Promise<void> }) {\n this.handleMessage = this.handleMessage.bind(this);\n this.handleLoginCancelled = onLoginCancelled;\n }\n\n public startListening() {\n safeWindow.addEventListener('message', this.handleMessage);\n }\n\n public stopListening() {\n safeWindow.removeEventListener('message', this.handleMessage);\n }\n\n public registerEvent(type: string, handler: MessageHandler) {\n this.handlers.set(type, handler);\n }\n\n public unregisterEvent(type: string) {\n this.handlers.delete(type);\n }\n\n private async handleMessage(event: MessageEvent<MessageType>) {\n const type = event.data?.type;\n\n if (typeof type === 'string' && this.handlers.has(type)) {\n const handler = this.handlers.get(type);\n return handler?.(event);\n }\n\n switch (type) {\n case WindowProviderRequestEnums.finalizeHandshakeRequest:\n this.handshake({ event });\n break;\n case WindowProviderRequestEnums.signMessageRequest:\n this.signMessage({ event, payload: event.data.payload });\n break;\n case WindowProviderRequestEnums.loginRequest:\n this.isLoginInitiated = true;\n this.login({ event, payload: event.data.payload });\n break;\n case WindowProviderRequestEnums.signTransactionsRequest:\n this.signTransactions({ event });\n break;\n case WindowProviderResponseEnums.cancelResponse: // sent by web-wallet CrossWindow provider\n case 'cancelAction': // sent by Extension provider\n if (this.isLoginInitiated) {\n await this.handleLoginCancelled();\n }\n break;\n default:\n break;\n }\n }\n\n private async login({\n event,\n payload\n }: MessageEventType & { payload: RequestPayloadType['LOGIN_REQUEST'] }) {\n const loginToken = payload?.token;\n\n if (!loginToken) {\n return;\n }\n\n try {\n const { address } = accountSelector(this.store.getState());\n const provider = getAccountProvider();\n\n const messageToSign = new Message({\n address: new Address(address),\n data: new Uint8Array(Buffer.from(loginToken))\n });\n\n const signedMessage = await provider.signMessage(messageToSign);\n const signature = signedMessage?.signature ?? '';\n\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.loginResponse,\n payload: {\n data: {\n address,\n signature: Buffer.from(signature).toString('hex')\n }\n }\n },\n { targetOrigin: event.origin }\n );\n } catch {\n if (this.isLoginInitiated) {\n this.handleLoginCancelled();\n }\n } finally {\n this.isLoginInitiated = false;\n }\n }\n\n private handshake({ event }: MessageEventType) {\n const handshakeSession = Date.now().toString();\n\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.finalizeHandshakeResponse,\n payload: { data: handshakeSession }\n },\n { targetOrigin: event.origin }\n );\n }\n\n private async signMessage({\n event,\n payload\n }: MessageEventType & {\n payload: RequestPayloadType['SIGN_MESSAGE_REQUEST'];\n }) {\n const { address } = accountSelector(this.store.getState());\n const { message } = payload;\n\n try {\n const messageToSign = new Message({\n address: new Address(address),\n data: new Uint8Array(Buffer.from(message))\n });\n\n const provider = getAccountProvider();\n const signedMessage = await provider.signMessage(messageToSign);\n const signature = signedMessage?.signature ?? '';\n\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.signMessageResponse,\n payload: {\n data: {\n signature: Buffer.from(signature).toString('hex'),\n status: 'signed'\n }\n }\n },\n { targetOrigin: event.origin }\n );\n } catch {\n throw new Error('Could not sign message');\n }\n }\n\n private async signTransactions({ event }: MessageEventType) {\n const provider = getAccountProvider();\n const { payload } = event.data;\n\n if (!Array.isArray(payload)) {\n return;\n }\n\n try {\n const transactions = payload.map((plainTransactionObject) =>\n Transaction.newFromPlainObject(plainTransactionObject)\n );\n\n const signedTx = await provider.signTransactions(transactions);\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.signTransactionsResponse,\n payload: {\n data: signedTx.map((tx) => tx.toPlainObject())\n }\n },\n { targetOrigin: event.origin }\n );\n } catch {\n throw new Error('Could not sign transactions');\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["WebviewClient", "onLoginCancelled", "getStore", "safeWindow", "type", "handler", "event", "WindowProviderRequestEnums", "WindowProviderResponseEnums", "payload", "loginToken", "address", "accountSelector", "provider", "getAccountProvider", "messageToSign", "Message", "Address", "signature", "handshakeSession", "message", "transactions", "plainTransactionObject", "Transaction", "signedTx", "tx"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/managers/TransactionManager/helpers/sessionCallbacks.ts"],
|
|
4
|
-
"sourcesContent": ["export const sessionCallbacksMap: SessionCallbacksType = {};\n\ntype SessionCallbacksType = {\n onSuccess?: (sessionId: string) => Promise<void>;\n onFail?: (sessionId: string) => Promise<void>;\n};\n\nexport const registerSessionCallbacks = ({\n onSuccess,\n onFail\n}: SessionCallbacksType) => {\n if (onSuccess != null) {\n sessionCallbacksMap.onSuccess = onSuccess;\n }\n if (onFail != null) {\n sessionCallbacksMap.onFail = onFail;\n }\n};\n"],
|
|
5
|
-
"mappings": "AAAO,IAAMA,EAA4C,CAAC,EAO7CC,EAA2B,CAAC,CACvC,UAAAC,EACA,OAAAC,CACF,IAA4B,CACtBD,GAAa,OACfF,EAAoB,UAAYE,GAE9BC,GAAU,OACZH,EAAoB,OAASG,EAEjC",
|
|
6
|
-
"names": ["sessionCallbacksMap", "registerSessionCallbacks", "onSuccess", "onFail"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-DCOMKCXN.mjs";import{c as n}from"./chunk-DWYHYJNY.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-4JCMNQXS.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as A}from"./chunk-47FDQOU2.mjs";import{a as I}from"./chunk-EAJBSX6Y.mjs";import{a as b}from"./chunk-Y3BNMQFP.mjs";import{h as f}from"./chunk-R4PAEXYU.mjs";import{b as S}from"./chunk-3ZEUVYQF.mjs";import{a as y}from"./chunk-LPXPAY7D.mjs";import{a as g}from"./chunk-L3MWDI6J.mjs";import{a as h}from"./chunk-Q5HWS7FX.mjs";import{h as u}from"./chunk-2IUBMLF4.mjs";import{s as m}from"./chunk-DWYHYJNY.mjs";import{b as T}from"./chunk-SAAOQW7P.mjs";import w from"axios";var r=class r{constructor(){this.setCallbacks=({onSuccess:a,onFail:t})=>{S({onSuccess:a,onFail:t})};this.send=async a=>{if(a.length===0)throw new Error("No transactions to send");try{if(!I(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(e=>({...e,status:e.status??"pending"})),o=g(n),s=y({transactions:n,transactionsDisplayInfo:t.transactionsDisplayInfo,status:o??"sent",sessionInformation:t.sessionInformation});if(t.disableToasts===!0)return s;let i=A(a);return f({toastId:s,totalDuration:i}),s};this.sendSignedTransactions=async a=>{let{apiAddress:t,apiTimeout:n}=T(m());return await Promise.all(a.map(async s=>{let i=await w.post(`${t}/transactions`,s.toPlainObject(),{timeout:Number(n)}),e=i.data.txHash;return{...s.toPlainObject(),...i.data,status:"pending",hash:e}}))};this.sendSignedBatchTransactions=async a=>{let{address:t}=h(),{apiAddress:n,apiTimeout:o}=T(m());if(!t)return{error:"Invalid address provided. You need to be logged in to send transactions"};let s=this.buildBatchId(t),e={transactions:a.map(p=>p.map(c=>c.toPlainObject())),id:s},{data:l}=await w.post(`${n}/batch`,e,{timeout:Number(o)}),B=l.transactions.map(p=>p.map(c=>{let d={...c,status:"pending",hash:c.hash};return b({data:d.data})&&(delete d.senderUsername,delete d.receiverUsername),d}));return{data:{...l,transactions:B}}};this.buildBatchId=a=>`${Date.now().toString()}${u}${a}`;this.sequentialToFlatArray=(a=[])=>this.getIsSequential(a)?a.flat():a;this.getIsSequential=a=>a?.every(t=>Array.isArray(t))}static getInstance(){return r.instance||(r.instance=new r),r.instance}};r.instance=null;var v=r;export{v as a};
|
|
2
|
-
//# sourceMappingURL=chunk-5TKJRIH7.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/managers/TransactionManager/TransactionManager.ts"],
|
|
4
|
-
"sourcesContent": ["import axios, { AxiosError } from 'axios';\nimport { BATCH_TRANSACTIONS_ID_SEPARATOR } from 'constants/transactions.constants';\nimport { Transaction } from 'lib/sdkCore';\nimport { getAccount } from 'methods/account/getAccount';\nimport { TransactionTrackingConfigType } from 'methods/initApp/initApp.types';\nimport { addTransactionToast } from 'store/actions/toasts/toastsActions';\nimport { createTransactionsSession } from 'store/actions/transactions/transactionsActions';\nimport { networkSelector } from 'store/selectors';\nimport { getState } from 'store/store';\nimport {\n TransactionBatchStatusesEnum,\n TransactionServerStatusesEnum\n} from 'types/enums.types';\nimport { BatchTransactionsResponseType } from 'types/serverTransactions.types';\nimport { SignedTransactionType } from 'types/transactions.types';\nimport { isGuardianTx } from 'utils/transactions/isGuardianTx';\nimport { getToastDuration } from './helpers/getToastDuration';\nimport { getTransactionsSessionStatus } from './helpers/getTransactionsStatus';\nimport { isBatchTransaction } from './helpers/isBatchTransaction';\nimport { registerSessionCallbacks } from './helpers/sessionCallbacks';\nimport { TransactionManagerTrackOptionsType } from './TransactionManager.types';\n\nexport class TransactionManager {\n private static instance: TransactionManager | null = null;\n\n public static getInstance(): TransactionManager {\n if (!TransactionManager.instance) {\n TransactionManager.instance = new TransactionManager();\n }\n return TransactionManager.instance;\n }\n\n /**\n * Set callbacks to be executed when the transaction session is successful or fails.\n * @param onSuccess - The callback to run when the transaction session is successful.\n * @param onFail - The callback to run when the transaction session fails.\n * @example\n * ```ts\n * TransactionManager.setCallbacks({\n * onSuccess: (sessionId) => {\n * console.log('Transaction session successful', sessionId);\n * },\n * });\n */\n public setCallbacks = ({\n onSuccess,\n onFail\n }: TransactionTrackingConfigType) => {\n registerSessionCallbacks({ onSuccess, onFail });\n };\n\n public send = async (\n signedTransactions: Transaction[] | Transaction[][]\n ): Promise<SignedTransactionType[] | SignedTransactionType[][]> => {\n if (signedTransactions.length === 0) {\n throw new Error('No transactions to send');\n }\n\n try {\n if (!isBatchTransaction(signedTransactions)) {\n const flatTransactions =\n await this.sendSignedTransactions(signedTransactions);\n\n return flatTransactions;\n }\n\n const sentTransactions =\n await this.sendSignedBatchTransactions(signedTransactions);\n\n if (!sentTransactions.data || sentTransactions.data.error) {\n throw new Error(\n sentTransactions.data?.error ?? 'Failed to send transactions'\n );\n }\n\n const groupedTransactions = sentTransactions.data.transactions;\n\n return groupedTransactions;\n } catch (error) {\n const responseData = <{ message: string }>(\n (error as AxiosError).response?.data\n );\n throw responseData?.message ?? (error as Error).message;\n }\n };\n\n public track = async (\n sentTransactions: SignedTransactionType[] | SignedTransactionType[][],\n options: TransactionManagerTrackOptionsType = { disableToasts: false }\n ): Promise<string> => {\n const flatTransactions = this.sequentialToFlatArray(sentTransactions).map(\n (transaction) => ({\n ...transaction,\n status: transaction.status ?? TransactionServerStatusesEnum.pending\n })\n );\n\n const status = getTransactionsSessionStatus(flatTransactions);\n\n const sessionId = createTransactionsSession({\n transactions: flatTransactions,\n transactionsDisplayInfo: options.transactionsDisplayInfo,\n status: status ?? TransactionBatchStatusesEnum.sent,\n sessionInformation: options.sessionInformation\n });\n\n if (options.disableToasts === true) {\n return sessionId;\n }\n\n const totalDuration = getToastDuration(sentTransactions);\n addTransactionToast({\n toastId: sessionId,\n totalDuration\n });\n\n return sessionId;\n };\n\n private readonly sendSignedTransactions = async (\n signedTransactions: Transaction[]\n ): Promise<SignedTransactionType[]> => {\n const { apiAddress, apiTimeout } = networkSelector(getState());\n\n const mergedTransactions = await Promise.all(\n signedTransactions.map(async (transaction) => {\n const response = await axios.post(\n `${apiAddress}/transactions`,\n transaction.toPlainObject(),\n { timeout: Number(apiTimeout) }\n );\n\n const txHash = response.data.txHash;\n\n return {\n ...transaction.toPlainObject(),\n ...response.data,\n status: TransactionServerStatusesEnum.pending,\n hash: txHash\n };\n })\n );\n\n return mergedTransactions;\n };\n\n private readonly sendSignedBatchTransactions = async (\n signedTransactions: Transaction[][]\n ) => {\n const { address } = getAccount();\n const { apiAddress, apiTimeout } = networkSelector(getState());\n\n if (!address) {\n return {\n error:\n 'Invalid address provided. You need to be logged in to send transactions'\n };\n }\n\n const batchId = this.buildBatchId(address);\n\n const plainTransactions = signedTransactions.map((group) =>\n group.map((tx) => tx.toPlainObject())\n );\n\n const payload = {\n transactions: plainTransactions,\n id: batchId\n };\n\n const { data } = await axios.post<BatchTransactionsResponseType>(\n `${apiAddress}/batch`,\n payload,\n {\n timeout: Number(apiTimeout)\n }\n );\n\n const parsedTransactions = data.transactions.map((group) =>\n group.map((tx) => {\n const parsedTx: SignedTransactionType = {\n ...tx,\n status: TransactionServerStatusesEnum.pending,\n hash: tx.hash\n };\n\n // Remove when the protocol supports usernames for guardian transactions\n if (isGuardianTx({ data: parsedTx.data })) {\n delete parsedTx.senderUsername;\n delete parsedTx.receiverUsername;\n }\n\n return parsedTx;\n })\n );\n\n return {\n data: {\n ...data,\n transactions: parsedTransactions\n }\n };\n };\n\n private readonly buildBatchId = (address: string) => {\n const sessionId = Date.now().toString();\n return `${sessionId}${BATCH_TRANSACTIONS_ID_SEPARATOR}${address}`;\n };\n private readonly sequentialToFlatArray = (\n transactions: SignedTransactionType[] | SignedTransactionType[][] = []\n ) =>\n this.getIsSequential(transactions)\n ? transactions.flat()\n : (transactions as SignedTransactionType[]);\n\n private readonly getIsSequential = (\n transactions?: SignedTransactionType[] | SignedTransactionType[][]\n ) => transactions?.every((transaction) => Array.isArray(transaction));\n}\n"],
|
|
5
|
-
"mappings": "mcAAA,OAAOA,MAA2B,QAsB3B,IAAMC,EAAN,MAAMA,CAAmB,CAAzB,cAsBL,KAAO,aAAe,CAAC,CACrB,UAAAC,EACA,OAAAC,CACF,IAAqC,CACnCC,EAAyB,CAAE,UAAAF,EAAW,OAAAC,CAAO,CAAC,CAChD,EAEA,KAAO,KAAO,MACZE,GACiE,CACjE,GAAIA,EAAmB,SAAW,EAChC,MAAM,IAAI,MAAM,yBAAyB,EAG3C,GAAI,CACF,GAAI,CAACC,EAAmBD,CAAkB,EAIxC,OAFE,MAAM,KAAK,uBAAuBA,CAAkB,EAKxD,IAAME,EACJ,MAAM,KAAK,4BAA4BF,CAAkB,EAE3D,GAAI,CAACE,EAAiB,MAAQA,EAAiB,KAAK,MAClD,MAAM,IAAI,MACRA,EAAiB,MAAM,OAAS,6BAClC,EAKF,OAF4BA,EAAiB,KAAK,YAGpD,OAASC,EAAO,CAId,MAFGA,EAAqB,UAAU,MAEd,SAAYA,EAAgB,OAClD,CACF,EAEA,KAAO,MAAQ,MACbD,EACAE,EAA8C,CAAE,cAAe,EAAM,IACjD,CACpB,IAAMC,EAAmB,KAAK,sBAAsBH,CAAgB,EAAE,IACnEI,IAAiB,CAChB,GAAGA,EACH,OAAQA,EAAY,iBACtB,EACF,EAEMC,EAASC,EAA6BH,CAAgB,EAEtDI,EAAYC,EAA0B,CAC1C,aAAcL,EACd,wBAAyBD,EAAQ,wBACjC,OAAQG,UACR,mBAAoBH,EAAQ,kBAC9B,CAAC,EAED,GAAIA,EAAQ,gBAAkB,GAC5B,OAAOK,EAGT,IAAME,EAAgBC,EAAiBV,CAAgB,EACvD,OAAAW,EAAoB,CAClB,QAASJ,EACT,cAAAE,CACF,CAAC,EAEMF,CACT,EAEA,KAAiB,uBAAyB,MACxCT,GACqC,CACrC,GAAM,CAAE,WAAAc,EAAY,WAAAC,CAAW,EAAIC,EAAgBC,EAAS,CAAC,EAqB7D,OAnB2B,MAAM,QAAQ,IACvCjB,EAAmB,IAAI,MAAOM,GAAgB,CAC5C,IAAMY,EAAW,MAAMC,EAAM,KAC3B,GAAGL,CAAU,gBACbR,EAAY,cAAc,EAC1B,CAAE,QAAS,OAAOS,CAAU,CAAE,CAChC,EAEMK,EAASF,EAAS,KAAK,OAE7B,MAAO,CACL,GAAGZ,EAAY,cAAc,EAC7B,GAAGY,EAAS,KACZ,iBACA,KAAME,CACR,CACF,CAAC,CACH,CAGF,EAEA,KAAiB,4BAA8B,MAC7CpB,GACG,CACH,GAAM,CAAE,QAAAqB,CAAQ,EAAIC,EAAW,EACzB,CAAE,WAAAR,EAAY,WAAAC,CAAW,EAAIC,EAAgBC,EAAS,CAAC,EAE7D,GAAI,CAACI,EACH,MAAO,CACL,MACE,yEACJ,EAGF,IAAME,EAAU,KAAK,aAAaF,CAAO,EAMnCG,EAAU,CACd,aALwBxB,EAAmB,IAAKyB,GAChDA,EAAM,IAAKC,GAAOA,EAAG,cAAc,CAAC,CACtC,EAIE,GAAIH,CACN,EAEM,CAAE,KAAAI,CAAK,EAAI,MAAMR,EAAM,KAC3B,GAAGL,CAAU,SACbU,EACA,CACE,QAAS,OAAOT,CAAU,CAC5B,CACF,EAEMa,EAAqBD,EAAK,aAAa,IAAKF,GAChDA,EAAM,IAAKC,GAAO,CAChB,IAAMG,EAAkC,CACtC,GAAGH,EACH,iBACA,KAAMA,EAAG,IACX,EAGA,OAAII,EAAa,CAAE,KAAMD,EAAS,IAAK,CAAC,IACtC,OAAOA,EAAS,eAChB,OAAOA,EAAS,kBAGXA,CACT,CAAC,CACH,EAEA,MAAO,CACL,KAAM,CACJ,GAAGF,EACH,aAAcC,CAChB,CACF,CACF,EAEA,KAAiB,aAAgBP,GAExB,GADW,KAAK,IAAI,EAAE,SAAS,CACnB,GAAGU,CAA+B,GAAGV,CAAO,GAEjE,KAAiB,sBAAwB,CACvCW,EAAoE,CAAC,IAErE,KAAK,gBAAgBA,CAAY,EAC7BA,EAAa,KAAK,EACjBA,EAEP,KAAiB,gBACfA,GACGA,GAAc,MAAO1B,GAAgB,MAAM,QAAQA,CAAW,CAAC,EAhMpE,OAAc,aAAkC,CAC9C,OAAKV,EAAmB,WACtBA,EAAmB,SAAW,IAAIA,GAE7BA,EAAmB,QAC5B,CA4LF,EApMaA,EACI,SAAsC,KADhD,IAAMqC,EAANrC",
|
|
6
|
-
"names": ["axios", "_TransactionManager", "onSuccess", "onFail", "registerSessionCallbacks", "signedTransactions", "isBatchTransaction", "sentTransactions", "error", "options", "flatTransactions", "transaction", "status", "getTransactionsSessionStatus", "sessionId", "createTransactionsSession", "totalDuration", "getToastDuration", "addTransactionToast", "apiAddress", "apiTimeout", "networkSelector", "getState", "response", "axios", "txHash", "address", "getAccount", "batchId", "payload", "group", "tx", "data", "parsedTransactions", "parsedTx", "isGuardianTx", "BATCH_TRANSACTIONS_ID_SEPARATOR", "transactions", "TransactionManager"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-3ZEUVYQF.mjs";async function l({sessionId:s,status:a}){let{onSuccess:n,onFail:c}=e;if(!(!n||!c||a==null))switch(a){case"success":await n?.(s);break;case"fail":case"cancelled":case"timedOut":case"invalid":await c?.(s);break}}export{l as a};
|
|
2
|
-
//# sourceMappingURL=chunk-FMQYLMTU.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/methods/trackTransactions/helpers/checkTransactionStatus/runSessionCallbacks.ts"],
|
|
4
|
-
"sourcesContent": ["import { sessionCallbacksMap } from 'managers/TransactionManager/helpers/sessionCallbacks';\nimport { TransactionBatchStatusesEnum } from 'types/enums.types';\n\ninterface runSessionCallbacksPropsType {\n sessionId: string;\n status?: TransactionBatchStatusesEnum | null;\n}\n\nexport async function runSessionCallbacks({\n sessionId,\n status\n}: runSessionCallbacksPropsType) {\n const { onSuccess, onFail } = sessionCallbacksMap;\n\n if (!onSuccess || !onFail || status == null) {\n return;\n }\n\n switch (status) {\n case TransactionBatchStatusesEnum.success:\n await onSuccess?.(sessionId);\n break;\n case TransactionBatchStatusesEnum.fail:\n case TransactionBatchStatusesEnum.cancelled:\n case TransactionBatchStatusesEnum.timedOut:\n case TransactionBatchStatusesEnum.invalid:\n await onFail?.(sessionId);\n break;\n }\n}\n"],
|
|
5
|
-
"mappings": "yCAQA,eAAsBA,EAAoB,CACxC,UAAAC,EACA,OAAAC,CACF,EAAiC,CAC/B,GAAM,CAAE,UAAAC,EAAW,OAAAC,CAAO,EAAIC,EAE9B,GAAI,GAACF,GAAa,CAACC,GAAUF,GAAU,MAIvC,OAAQA,EAAQ,CACd,cACE,MAAMC,IAAYF,CAAS,EAC3B,MACF,WACA,gBACA,eACA,cACE,MAAMG,IAASH,CAAS,EACxB,KACJ,CACF",
|
|
6
|
-
"names": ["runSessionCallbacks", "sessionId", "status", "onSuccess", "onFail", "sessionCallbacksMap"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as I}from"./chunk-GDKW3NI7.mjs";import{a as l}from"./chunk-3Z2ACTV6.mjs";import{a as f}from"./chunk-TKZHFVMQ.mjs";import{j as m,k as d,l as p,n as u}from"./chunk-65L5EBBL.mjs";import{a as T}from"./chunk-X25IIGUZ.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-J6R5G7CE.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/managers/internal/ToastManager/helpers/createToastsFromTransactions.ts"],
|
|
4
|
-
"sourcesContent": ["import { getEgldLabel } from 'methods/network/getEgldLabel';\nimport { getExplorerAddress } from 'methods/network/getExplorerAddress';\nimport {\n getIsTransactionFailed,\n getIsTransactionPending,\n getIsTransactionSuccessful,\n getIsTransactionTimedOut\n} from 'store/actions/transactions/transactionStateByStatus';\nimport { AccountSliceType } from 'store/slices/account/account.types';\nimport { ToastsSliceType } from 'store/slices/toast/toastSlice.types';\nimport { TransactionServerStatusesEnum } from 'types/enums.types';\nimport { SessionTransactionType } from 'types/transactions.types';\nimport { mapServerTransactionsToListItems } from 'utils/transactions/getTransactionsHistory/helpers';\nimport { createTransactionToast } from './createTransactionToast';\nimport { ITransactionToast } from '../types/toast.types';\ninterface CreateToastsFromTransactionsReturnType {\n pendingTransactionToasts: ITransactionToast[];\n completedTransactionToasts: ITransactionToast[];\n}\n\ninterface CreateToastsFromTransactionsParamsType {\n toastList: ToastsSliceType;\n transactionsSessions: Record<string, SessionTransactionType>;\n account: AccountSliceType;\n existingCompletedTransactions?: ITransactionToast[];\n}\n\nexport const createToastsFromTransactions = async ({\n toastList,\n transactionsSessions,\n account,\n existingCompletedTransactions = []\n}: CreateToastsFromTransactionsParamsType): Promise<CreateToastsFromTransactionsReturnType> => {\n const pendingTransactionToasts: ITransactionToast[] = [];\n const completedTransactionToasts: ITransactionToast[] = [\n ...existingCompletedTransactions\n ];\n const explorerAddress = getExplorerAddress();\n const egldLabel = getEgldLabel();\n\n for (const toast of toastList.transactionToasts) {\n const transactionSession = transactionsSessions[toast.toastId];\n if (!transactionSession?.status) {\n continue;\n }\n\n const { status, transactions, transactionsDisplayInfo } =\n transactionSession;\n\n const interprettedTransactions = await mapServerTransactionsToListItems({\n transactions,\n address: account.address,\n explorerAddress,\n egldLabel\n });\n\n const isTimedOut = getIsTransactionTimedOut(status);\n const isFailed = getIsTransactionFailed(status);\n const isSuccessful = getIsTransactionSuccessful(status);\n const isCompleted = isTimedOut || isFailed || isSuccessful;\n const isPending = getIsTransactionPending(status);\n const { startTime, endTime } = toast;\n\n if (\n isCompleted &&\n completedTransactionToasts.some((t) => t.toastId === toast.toastId)\n ) {\n continue;\n }\n\n const transactionToast = createTransactionToast({\n toastId: toast.toastId,\n address: account.address,\n status: status as TransactionServerStatusesEnum,\n transactions: interprettedTransactions,\n transactionsDisplayInfo,\n explorerAddress,\n startTime,\n endTime\n });\n\n if (isCompleted) {\n completedTransactionToasts.push(transactionToast);\n }\n\n if (isPending) {\n pendingTransactionToasts.push(transactionToast);\n }\n }\n\n return {\n pendingTransactionToasts,\n completedTransactionToasts\n };\n};\n"],
|
|
5
|
-
"mappings": "kOA2BO,IAAMA,EAA+B,MAAO,CACjD,UAAAC,EACA,qBAAAC,EACA,QAAAC,EACA,8BAAAC,EAAgC,CAAC,CACnC,IAA+F,CAC7F,IAAMC,EAAgD,CAAC,EACjDC,EAAkD,CACtD,GAAGF,CACL,EACMG,EAAkBC,EAAmB,EACrCC,EAAYC,EAAa,EAE/B,QAAWC,KAASV,EAAU,kBAAmB,CAC/C,IAAMW,EAAqBV,EAAqBS,EAAM,OAAO,EAC7D,GAAI,CAACC,GAAoB,OACvB,SAGF,GAAM,CAAE,OAAAC,EAAQ,aAAAC,EAAc,wBAAAC,CAAwB,EACpDH,EAEII,EAA2B,MAAMC,EAAiC,CACtE,aAAAH,EACA,QAASX,EAAQ,QACjB,gBAAAI,EACA,UAAAE,CACF,CAAC,EAEKS,EAAaC,EAAyBN,CAAM,EAC5CO,EAAWC,EAAuBR,CAAM,EACxCS,EAAeC,EAA2BV,CAAM,EAChDW,EAAcN,GAAcE,GAAYE,EACxCG,EAAYC,EAAwBb,CAAM,EAC1C,CAAE,UAAAc,EAAW,QAAAC,CAAQ,EAAIjB,EAE/B,GACEa,GACAlB,EAA2B,KAAMuB,GAAMA,EAAE,UAAYlB,EAAM,OAAO,EAElE,SAGF,IAAMmB,EAAmBC,EAAuB,CAC9C,QAASpB,EAAM,QACf,QAASR,EAAQ,QACjB,OAAQU,EACR,aAAcG,EACd,wBAAAD,EACA,gBAAAR,EACA,UAAAoB,EACA,QAAAC,CACF,CAAC,EAEGJ,GACFlB,EAA2B,KAAKwB,CAAgB,EAG9CL,GACFpB,EAAyB,KAAKyB,CAAgB,CAElD,CAEA,MAAO,CACL,yBAAAzB,EACA,2BAAAC,CACF,CACF",
|
|
6
|
-
"names": ["createToastsFromTransactions", "toastList", "transactionsSessions", "account", "existingCompletedTransactions", "pendingTransactionToasts", "completedTransactionToasts", "explorerAddress", "getExplorerAddress", "egldLabel", "getEgldLabel", "toast", "transactionSession", "status", "transactions", "transactionsDisplayInfo", "interprettedTransactions", "mapServerTransactionsToListItems", "isTimedOut", "getIsTransactionTimedOut", "isFailed", "getIsTransactionFailed", "isSuccessful", "getIsTransactionSuccessful", "isCompleted", "isPending", "getIsTransactionPending", "startTime", "endTime", "t", "transactionToast", "createTransactionToast"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-DLWDO7M6.mjs";import{d as v}from"./chunk-726BASBO.mjs";import{v as m}from"./chunk-R4PAEXYU.mjs";import{s as n}from"./chunk-DWYHYJNY.mjs";import{d as s}from"./chunk-VNLGNNIL.mjs";import{a as i}from"./chunk-LJX4MW7B.mjs";import{a as p}from"./chunk-5A2ZB2NK.mjs";async function g(){let t=a(),d=p(),r=s(n()),e=d||t?i.webview:r,c=Object.values(i).includes(r);if(r&&!c&&(e=r),!e)return;let o=await v.create({type:e});if(!o)throw new Error("Provider not found");(t||e===i.webview&&o.isInitialized())&&await o.login(),m(o)}export{g as a};
|
|
2
|
-
//# sourceMappingURL=chunk-KDOO7OCC.mjs.map
|