@multiversx/sdk-dapp 5.1.9 → 5.2.0
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 -5
- package/out/__chunks__/{chunk-RHP2BLW4.mjs → chunk-22ANWLYS.mjs} +2 -2
- package/out/__chunks__/{chunk-RHP2BLW4.mjs.map → chunk-22ANWLYS.mjs.map} +1 -1
- package/out/__chunks__/{chunk-CYWOWIRB.mjs → chunk-2A63CJKS.mjs} +2 -2
- package/out/__chunks__/chunk-2PNYAM6W.mjs +2 -0
- package/out/__chunks__/{chunk-X3XRZCS3.mjs → chunk-2Z5M6QQ2.mjs} +2 -2
- package/out/__chunks__/chunk-36TM2TJY.mjs +2 -0
- package/out/__chunks__/{chunk-UA5WGULZ.mjs → chunk-3MKQRKD2.mjs} +2 -2
- package/out/__chunks__/chunk-46AC63TA.mjs +2 -0
- package/out/__chunks__/{chunk-632VK5RN.mjs → chunk-4TDQSARK.mjs} +2 -2
- package/out/__chunks__/{chunk-4CK3GBRH.mjs → chunk-5HY62GH7.mjs} +2 -2
- package/out/__chunks__/{chunk-IDCBOZNB.mjs → chunk-5L747MOB.mjs} +2 -2
- package/out/__chunks__/{chunk-CLPLLK67.mjs → chunk-5Q6G6CI4.mjs} +2 -2
- package/out/__chunks__/{chunk-YC3NVMU3.mjs → chunk-6IQLBT4L.mjs} +2 -2
- package/out/__chunks__/{chunk-K4BSSSHE.mjs → chunk-6LV4HAFU.mjs} +2 -2
- package/out/__chunks__/{chunk-UPIJGCBH.mjs → chunk-6Y7RDZ2B.mjs} +2 -2
- package/out/__chunks__/{chunk-IT3RZ4HT.mjs → chunk-76ECKPKT.mjs} +2 -2
- package/out/__chunks__/{chunk-T5FALTG2.mjs → chunk-7F3VGKXN.mjs} +2 -2
- package/out/__chunks__/{chunk-DGL4E36L.mjs → chunk-AFNZCTNZ.mjs} +2 -2
- package/out/__chunks__/{chunk-VDMJZZU4.mjs → chunk-AJC3F2YT.mjs} +1 -1
- package/out/__chunks__/{chunk-VDMJZZU4.mjs.map → chunk-AJC3F2YT.mjs.map} +1 -1
- package/out/__chunks__/{chunk-KMKXCFDQ.mjs → chunk-BA4LPRGY.mjs} +2 -2
- package/out/__chunks__/{chunk-44EDRVCP.mjs → chunk-C4KGS2BP.mjs} +2 -2
- package/out/__chunks__/{chunk-TMNKFPRG.mjs → chunk-CL7UO54N.mjs} +2 -2
- package/out/__chunks__/{chunk-CHCWBFEG.mjs → chunk-CZIMPZY4.mjs} +2 -2
- package/out/__chunks__/chunk-DGMI66QS.mjs +2 -0
- package/out/__chunks__/chunk-DGMI66QS.mjs.map +7 -0
- package/out/__chunks__/{chunk-SJCFVUWO.mjs → chunk-DZITE34E.mjs} +2 -2
- package/out/__chunks__/chunk-EAHD3FOU.mjs +2 -0
- package/out/__chunks__/{chunk-ENHFZ4TV.mjs.map → chunk-EAHD3FOU.mjs.map} +1 -1
- package/out/__chunks__/{chunk-PSSRDP4O.mjs → chunk-EOMHYWS3.mjs} +2 -2
- package/out/__chunks__/{chunk-EQOLFL4H.mjs → chunk-F7QE2BXY.mjs} +2 -2
- package/out/__chunks__/chunk-FZFUNR5U.mjs +2 -0
- package/out/__chunks__/{chunk-BIVZJPSH.mjs → chunk-GB2K574L.mjs} +1 -1
- package/out/__chunks__/{chunk-BIVZJPSH.mjs.map → chunk-GB2K574L.mjs.map} +1 -1
- package/out/__chunks__/{chunk-WF63AXH3.mjs → chunk-GBV4WTOL.mjs} +2 -2
- package/out/__chunks__/{chunk-TRUQQVTW.mjs → chunk-GGDZD3N6.mjs} +2 -2
- package/out/__chunks__/{chunk-TJYIVY7J.mjs → chunk-HG5ZRYDO.mjs} +2 -2
- package/out/__chunks__/chunk-HNLLV6SD.mjs +2 -0
- package/out/__chunks__/{chunk-LKPI47RK.mjs → chunk-HZA2YT74.mjs} +2 -2
- package/out/__chunks__/chunk-IJWP5CUJ.mjs +2 -0
- package/out/__chunks__/{chunk-ZTLWHYQL.mjs → chunk-ILSJXAAO.mjs} +2 -2
- package/out/__chunks__/{chunk-NQZVWZM5.mjs → chunk-IO7VCKOO.mjs} +2 -2
- package/out/__chunks__/chunk-J26RADFN.mjs +2 -0
- package/out/__chunks__/{chunk-SJUTPNHW.mjs → chunk-JZ7B36OT.mjs} +2 -2
- package/out/__chunks__/chunk-KV4CJO6I.mjs +2 -0
- package/out/__chunks__/{chunk-PRBRKMR4.mjs → chunk-KZKD4NES.mjs} +2 -2
- package/out/__chunks__/{chunk-GF3J27ZR.mjs → chunk-L4FBGQKW.mjs} +2 -2
- package/out/__chunks__/{chunk-NAJG7WG4.mjs → chunk-LDX6YMAJ.mjs} +2 -2
- package/out/__chunks__/{chunk-4AVJA7MF.mjs → chunk-M3SOIDF4.mjs} +2 -2
- package/out/__chunks__/chunk-M3SOIDF4.mjs.map +7 -0
- package/out/__chunks__/{chunk-VHOQPKEC.mjs → chunk-M73ACNCZ.mjs} +2 -2
- package/out/__chunks__/{chunk-MQFYSUO6.mjs → chunk-MEGUEXSX.mjs} +2 -2
- package/out/__chunks__/{chunk-GDKW3NI7.mjs → chunk-MRN73EEW.mjs} +2 -2
- package/out/__chunks__/{chunk-GDKW3NI7.mjs.map → chunk-MRN73EEW.mjs.map} +1 -1
- package/out/__chunks__/{chunk-3LL33L5F.mjs → chunk-MUXOTXZA.mjs} +2 -2
- package/out/__chunks__/{chunk-AQ7ZQRAJ.mjs → chunk-N3QIT4Z7.mjs} +2 -2
- package/out/__chunks__/{chunk-II663X5B.mjs → chunk-NF5BWZH7.mjs} +2 -2
- package/out/__chunks__/{chunk-VQ4W2MEF.mjs → chunk-NGQEAHDC.mjs} +2 -2
- package/out/__chunks__/{chunk-EIL6PTC4.mjs → chunk-NLWJ7ERG.mjs} +2 -2
- package/out/__chunks__/chunk-OE6IBPA7.mjs +2 -0
- package/out/__chunks__/{chunk-IJWIF6QG.mjs → chunk-OHDUQQEH.mjs} +2 -2
- package/out/__chunks__/chunk-PKD3AEXI.mjs +1 -0
- package/out/__chunks__/{chunk-YQ63ZYW2.mjs → chunk-PNIZP27U.mjs} +2 -2
- package/out/__chunks__/{chunk-YJMGYDU3.mjs → chunk-PV2FIP47.mjs} +2 -2
- package/out/__chunks__/chunk-PVATJYBR.mjs +2 -0
- package/out/__chunks__/chunk-PVATJYBR.mjs.map +7 -0
- package/out/__chunks__/{chunk-YY724VZR.mjs → chunk-PZHQ37I6.mjs} +2 -2
- package/out/__chunks__/{chunk-FZKGYTPJ.mjs → chunk-QDQNGBSL.mjs} +2 -2
- package/out/__chunks__/{chunk-O46BVCSH.mjs → chunk-QH4KZO24.mjs} +2 -2
- package/out/__chunks__/{chunk-CCFQYROV.mjs → chunk-QKUOY7IT.mjs} +2 -2
- package/out/__chunks__/{chunk-ZM3VDK22.mjs → chunk-QLVGLTKW.mjs} +2 -2
- package/out/__chunks__/{chunk-KGKDFREW.mjs → chunk-RKQMY4CO.mjs} +2 -2
- package/out/__chunks__/{chunk-QXVINXTO.mjs → chunk-RUHXQTPN.mjs} +2 -2
- package/out/__chunks__/chunk-S3SH4KCM.mjs +2 -0
- package/out/__chunks__/{chunk-RQG6ZONS.mjs → chunk-SHF44E27.mjs} +2 -2
- package/out/__chunks__/chunk-SMFNVU6B.mjs +2 -0
- package/out/__chunks__/chunk-SMFNVU6B.mjs.map +7 -0
- package/out/__chunks__/chunk-T2BTKWLR.mjs +2 -0
- package/out/__chunks__/chunk-U2IB2ADP.mjs +2 -0
- package/out/__chunks__/{chunk-4YUEQAGD.mjs → chunk-UBP6IFJF.mjs} +2 -2
- package/out/__chunks__/{chunk-3UVBQHXR.mjs → chunk-UPEKWDPU.mjs} +2 -2
- package/out/__chunks__/{chunk-C22Q5W5S.mjs → chunk-VDYLK3NT.mjs} +2 -2
- package/out/__chunks__/{chunk-HSAPJUAV.mjs → chunk-VY3JMNHD.mjs} +2 -2
- package/out/__chunks__/{chunk-6GKWP4IU.mjs → chunk-XELT67NG.mjs} +2 -2
- package/out/__chunks__/chunk-XHMGA5T6.mjs +2 -0
- package/out/__chunks__/chunk-XHMGA5T6.mjs.map +7 -0
- package/out/__chunks__/chunk-Y3RPKCXI.mjs +2 -0
- package/out/__chunks__/{chunk-PFMI2MWN.mjs → chunk-Y4MBRY6P.mjs} +2 -2
- package/out/__chunks__/chunk-Y6BAA2ZQ.mjs +2 -0
- package/out/__chunks__/chunk-YHNHQL5A.mjs +2 -0
- package/out/__chunks__/{chunk-6QDJ2IO3.mjs → chunk-YIJP3JDV.mjs} +2 -2
- package/out/__chunks__/{chunk-A6XTQQEL.mjs → chunk-YK5QXCRF.mjs} +2 -2
- package/out/__chunks__/{chunk-IXHQSJBO.mjs → chunk-ZB7BTA2Y.mjs} +2 -2
- package/out/__chunks__/{chunk-UEPKOEV5.mjs → chunk-ZEW4FMMF.mjs} +2 -2
- package/out/__chunks__/chunk-ZO6NJYZ7.mjs +2 -0
- package/out/__chunks__/{chunk-VHHB4LMW.mjs → chunk-ZX3ZUYOZ.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.cjs +2 -2
- package/out/managers/LogoutManager/LogoutManager.cjs.map +1 -1
- package/out/managers/LogoutManager/LogoutManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/NotificationsFeedManager.cjs +4 -4
- package/out/managers/NotificationsFeedManager/NotificationsFeedManager.cjs.map +2 -2
- package/out/managers/NotificationsFeedManager/NotificationsFeedManager.d.ts +1 -1
- package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/index.mjs +1 -1
- package/out/managers/{internal/ToastManager → ToastManager}/ToastManager.cjs +8 -8
- package/out/managers/{internal/ToastManager → ToastManager}/ToastManager.cjs.map +1 -1
- package/out/managers/{internal/ToastManager → ToastManager}/ToastManager.d.ts +8 -8
- package/out/managers/ToastManager/ToastManager.mjs +2 -0
- package/out/managers/{internal/ToastManager → ToastManager}/helpers/LifetimeManager.cjs +1 -1
- package/out/managers/{internal/ToastManager → ToastManager}/helpers/LifetimeManager.cjs.map +1 -1
- package/out/managers/ToastManager/helpers/LifetimeManager.mjs +2 -0
- package/out/managers/{internal/ToastManager → ToastManager}/helpers/createToastsFromTransactions.cjs +4 -4
- package/out/managers/{internal/ToastManager → ToastManager}/helpers/createToastsFromTransactions.cjs.map +1 -1
- package/out/managers/{internal/ToastManager → ToastManager}/helpers/createToastsFromTransactions.d.ts +3 -3
- package/out/managers/ToastManager/helpers/createToastsFromTransactions.mjs +2 -0
- package/out/managers/{internal/ToastManager → ToastManager}/helpers/createTransactionToast.cjs +1 -1
- package/out/managers/{internal/ToastManager → ToastManager}/helpers/createTransactionToast.cjs.map +1 -1
- package/out/managers/{internal/ToastManager → ToastManager}/helpers/createTransactionToast.d.ts +3 -3
- package/out/managers/ToastManager/helpers/createTransactionToast.mjs +2 -0
- package/out/managers/{internal/ToastManager → ToastManager}/helpers/getToastDataStateByStatus.cjs +2 -2
- package/out/managers/ToastManager/helpers/getToastDataStateByStatus.cjs.map +7 -0
- package/out/managers/ToastManager/helpers/getToastDataStateByStatus.mjs +2 -0
- package/out/managers/{internal/ToastManager → ToastManager}/helpers/getToastTransactionsStatus.cjs +1 -1
- package/out/managers/{internal/ToastManager → ToastManager}/helpers/getToastTransactionsStatus.cjs.map +1 -1
- package/out/managers/{internal/ToastManager → ToastManager}/helpers/getToastTransactionsStatus.d.ts +1 -1
- package/out/managers/ToastManager/helpers/getToastTransactionsStatus.mjs +2 -0
- package/out/managers/ToastManager/helpers/tests/baseTransactionMock.d.ts +2 -0
- package/out/managers/{internal/ToastManager → ToastManager}/types/index.cjs.map +1 -1
- package/out/managers/ToastManager/types/index.mjs +2 -0
- package/out/managers/{internal/ToastManager → ToastManager}/types/toast.types.cjs.map +1 -1
- package/out/managers/{internal/ToastManager → ToastManager}/types/toast.types.d.ts +3 -3
- package/out/managers/ToastManager/types/toast.types.mjs +2 -0
- 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.cjs +2 -2
- package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.cjs.map +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/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.cjs +0 -3
- package/out/managers/internal/index.cjs.map +2 -2
- package/out/managers/internal/index.d.ts +0 -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 +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.cjs +1 -1
- package/out/providers/DappProvider/helpers/signErrors/handleSignError.cjs.map +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.cjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.cjs.map +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.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/getMultiEsdtTransferData/getMultiEsdtTransferData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getMultiEsdtTransferData/helpers/parseMultiEsdtTransferDataForMultipleTransactions.cjs +5 -5
- package/out/providers/strategies/helpers/signTransactions/helpers/getMultiEsdtTransferData/helpers/parseMultiEsdtTransferDataForMultipleTransactions.cjs.map +2 -2
- package/out/providers/strategies/helpers/signTransactions/helpers/getMultiEsdtTransferData/helpers/parseMultiEsdtTransferDataForMultipleTransactions.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.cjs +7 -0
- package/out/store/actions/transactions/transactionsActions.cjs.map +2 -2
- 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 +2 -2
- package/out/__chunks__/chunk-4AVJA7MF.mjs.map +0 -7
- package/out/__chunks__/chunk-4KTXRMDS.mjs +0 -2
- package/out/__chunks__/chunk-5K2UH5QL.mjs +0 -2
- package/out/__chunks__/chunk-5K2UH5QL.mjs.map +0 -7
- package/out/__chunks__/chunk-D4V7EOIL.mjs +0 -2
- package/out/__chunks__/chunk-DT3MXNJI.mjs +0 -2
- package/out/__chunks__/chunk-ENHFZ4TV.mjs +0 -2
- package/out/__chunks__/chunk-GQAGO7KW.mjs +0 -2
- package/out/__chunks__/chunk-KNZRUMOW.mjs +0 -2
- package/out/__chunks__/chunk-LDIEAM6D.mjs +0 -2
- package/out/__chunks__/chunk-NN3CS646.mjs +0 -2
- package/out/__chunks__/chunk-PLTUKRYU.mjs +0 -2
- package/out/__chunks__/chunk-PLTUKRYU.mjs.map +0 -7
- package/out/__chunks__/chunk-QMHHBZ5O.mjs +0 -2
- package/out/__chunks__/chunk-RBJ3O63I.mjs +0 -2
- package/out/__chunks__/chunk-RBJ3O63I.mjs.map +0 -7
- package/out/__chunks__/chunk-RCM3SNZB.mjs +0 -2
- package/out/__chunks__/chunk-RMSMZKTD.mjs +0 -2
- package/out/__chunks__/chunk-RMSMZKTD.mjs.map +0 -7
- package/out/__chunks__/chunk-SBDWJ7ES.mjs +0 -2
- package/out/__chunks__/chunk-SCSHU7XJ.mjs +0 -1
- package/out/__chunks__/chunk-SDJQOCX2.mjs +0 -2
- package/out/__chunks__/chunk-VFIKV2UU.mjs +0 -2
- package/out/__chunks__/chunk-VN62BHIP.mjs +0 -2
- package/out/__chunks__/chunk-WYVDY3V7.mjs +0 -2
- package/out/__chunks__/chunk-YY55H5EM.mjs +0 -2
- package/out/__chunks__/chunk-ZPCNRXQG.mjs +0 -2
- package/out/managers/internal/ToastManager/ToastManager.mjs +0 -2
- package/out/managers/internal/ToastManager/helpers/LifetimeManager.mjs +0 -2
- package/out/managers/internal/ToastManager/helpers/createToastsFromTransactions.mjs +0 -2
- package/out/managers/internal/ToastManager/helpers/createTransactionToast.mjs +0 -2
- package/out/managers/internal/ToastManager/helpers/getToastDataStateByStatus.cjs.map +0 -7
- package/out/managers/internal/ToastManager/helpers/getToastDataStateByStatus.mjs +0 -2
- package/out/managers/internal/ToastManager/helpers/getToastTransactionsStatus.mjs +0 -2
- package/out/managers/internal/ToastManager/helpers/tests/baseTransactionMock.d.ts +0 -2
- package/out/managers/internal/ToastManager/types/index.mjs +0 -2
- package/out/managers/internal/ToastManager/types/toast.types.mjs +0 -2
- /package/out/__chunks__/{chunk-CYWOWIRB.mjs.map → chunk-2A63CJKS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VN62BHIP.mjs.map → chunk-2PNYAM6W.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-X3XRZCS3.mjs.map → chunk-2Z5M6QQ2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YY55H5EM.mjs.map → chunk-36TM2TJY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UA5WGULZ.mjs.map → chunk-3MKQRKD2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LDIEAM6D.mjs.map → chunk-46AC63TA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-632VK5RN.mjs.map → chunk-4TDQSARK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4CK3GBRH.mjs.map → chunk-5HY62GH7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IDCBOZNB.mjs.map → chunk-5L747MOB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CLPLLK67.mjs.map → chunk-5Q6G6CI4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YC3NVMU3.mjs.map → chunk-6IQLBT4L.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-K4BSSSHE.mjs.map → chunk-6LV4HAFU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UPIJGCBH.mjs.map → chunk-6Y7RDZ2B.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IT3RZ4HT.mjs.map → chunk-76ECKPKT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-T5FALTG2.mjs.map → chunk-7F3VGKXN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DGL4E36L.mjs.map → chunk-AFNZCTNZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KMKXCFDQ.mjs.map → chunk-BA4LPRGY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-44EDRVCP.mjs.map → chunk-C4KGS2BP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TMNKFPRG.mjs.map → chunk-CL7UO54N.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CHCWBFEG.mjs.map → chunk-CZIMPZY4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SJCFVUWO.mjs.map → chunk-DZITE34E.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PSSRDP4O.mjs.map → chunk-EOMHYWS3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EQOLFL4H.mjs.map → chunk-F7QE2BXY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZPCNRXQG.mjs.map → chunk-FZFUNR5U.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WF63AXH3.mjs.map → chunk-GBV4WTOL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TRUQQVTW.mjs.map → chunk-GGDZD3N6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TJYIVY7J.mjs.map → chunk-HG5ZRYDO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GQAGO7KW.mjs.map → chunk-HNLLV6SD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LKPI47RK.mjs.map → chunk-HZA2YT74.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RCM3SNZB.mjs.map → chunk-IJWP5CUJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZTLWHYQL.mjs.map → chunk-ILSJXAAO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NQZVWZM5.mjs.map → chunk-IO7VCKOO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4KTXRMDS.mjs.map → chunk-J26RADFN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SJUTPNHW.mjs.map → chunk-JZ7B36OT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VFIKV2UU.mjs.map → chunk-KV4CJO6I.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PRBRKMR4.mjs.map → chunk-KZKD4NES.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GF3J27ZR.mjs.map → chunk-L4FBGQKW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NAJG7WG4.mjs.map → chunk-LDX6YMAJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VHOQPKEC.mjs.map → chunk-M73ACNCZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MQFYSUO6.mjs.map → chunk-MEGUEXSX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3LL33L5F.mjs.map → chunk-MUXOTXZA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AQ7ZQRAJ.mjs.map → chunk-N3QIT4Z7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-II663X5B.mjs.map → chunk-NF5BWZH7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VQ4W2MEF.mjs.map → chunk-NGQEAHDC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EIL6PTC4.mjs.map → chunk-NLWJ7ERG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QMHHBZ5O.mjs.map → chunk-OE6IBPA7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IJWIF6QG.mjs.map → chunk-OHDUQQEH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SCSHU7XJ.mjs.map → chunk-PKD3AEXI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YQ63ZYW2.mjs.map → chunk-PNIZP27U.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YJMGYDU3.mjs.map → chunk-PV2FIP47.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YY724VZR.mjs.map → chunk-PZHQ37I6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FZKGYTPJ.mjs.map → chunk-QDQNGBSL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-O46BVCSH.mjs.map → chunk-QH4KZO24.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CCFQYROV.mjs.map → chunk-QKUOY7IT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZM3VDK22.mjs.map → chunk-QLVGLTKW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KGKDFREW.mjs.map → chunk-RKQMY4CO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QXVINXTO.mjs.map → chunk-RUHXQTPN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KNZRUMOW.mjs.map → chunk-S3SH4KCM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RQG6ZONS.mjs.map → chunk-SHF44E27.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DT3MXNJI.mjs.map → chunk-T2BTKWLR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NN3CS646.mjs.map → chunk-U2IB2ADP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4YUEQAGD.mjs.map → chunk-UBP6IFJF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3UVBQHXR.mjs.map → chunk-UPEKWDPU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-C22Q5W5S.mjs.map → chunk-VDYLK3NT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HSAPJUAV.mjs.map → chunk-VY3JMNHD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6GKWP4IU.mjs.map → chunk-XELT67NG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WYVDY3V7.mjs.map → chunk-Y3RPKCXI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PFMI2MWN.mjs.map → chunk-Y4MBRY6P.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SBDWJ7ES.mjs.map → chunk-Y6BAA2ZQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SDJQOCX2.mjs.map → chunk-YHNHQL5A.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6QDJ2IO3.mjs.map → chunk-YIJP3JDV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-A6XTQQEL.mjs.map → chunk-YK5QXCRF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IXHQSJBO.mjs.map → chunk-ZB7BTA2Y.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UEPKOEV5.mjs.map → chunk-ZEW4FMMF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-D4V7EOIL.mjs.map → chunk-ZO6NJYZ7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VHHB4LMW.mjs.map → chunk-ZX3ZUYOZ.mjs.map} +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/ToastManager.mjs.map +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/helpers/LifetimeManager.d.ts +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/helpers/LifetimeManager.mjs.map +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/helpers/createToastsFromTransactions.mjs.map +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/helpers/createTransactionToast.mjs.map +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/helpers/getToastDataStateByStatus.d.ts +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/helpers/getToastDataStateByStatus.mjs.map +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/helpers/getToastTransactionsStatus.mjs.map +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/types/index.cjs +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/types/index.d.ts +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/types/index.mjs.map +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/types/toast.types.cjs +0 -0
- /package/out/managers/{internal/ToastManager → ToastManager}/types/toast.types.mjs.map +0 -0
package/README.md
CHANGED
|
@@ -520,6 +520,7 @@ The transaction lifecycle consists of the following steps:
|
|
|
520
520
|
```ts
|
|
521
521
|
import { createRoot } from 'react-dom/client';
|
|
522
522
|
import { createCustomToast } from '@multiversx/sdk-dapp/out/store/actions/toasts/toastsActions';
|
|
523
|
+
import { ToastManager } from '@multiversx/sdk-dapp/out/managers/ToastManager/ToastManager';
|
|
523
524
|
|
|
524
525
|
// by creating a custom toast element containing a component
|
|
525
526
|
createCustomToast({
|
|
@@ -586,19 +587,21 @@ import { TransactionManagerTrackOptionsType } from '@multiversx/sdk-dapp/out/man
|
|
|
586
587
|
|
|
587
588
|
const options: TransactionManagerTrackOptionsType = {
|
|
588
589
|
disableToasts: false, // `false` by default
|
|
589
|
-
transactionsDisplayInfo: {
|
|
590
|
-
// `undefined` by default
|
|
590
|
+
transactionsDisplayInfo: { // optional. If left `undefined`, it will use the default messages
|
|
591
591
|
errorMessage: 'Failed adding stake',
|
|
592
592
|
successMessage: 'Stake successfully added',
|
|
593
|
-
|
|
593
|
+
receivedMessage: 'Stake successfully added', // optional, add it in case of multiple transactions
|
|
594
|
+
processingMessage: 'Staking in progress',
|
|
595
|
+
// submittedMessage: 'Stake submitted',
|
|
596
|
+
// timedOutMessage: 'Transaction timed out',
|
|
597
|
+
// invalidMessage: 'Invalid transaction',
|
|
594
598
|
},
|
|
595
599
|
sessionInformation: {
|
|
596
600
|
// `undefined` by default. Use to perform additional actions based on the session information
|
|
597
601
|
stakeAmount: '1000000000000000000000000'
|
|
598
602
|
},
|
|
599
603
|
onSuccess: async(sessionId) => { // optional
|
|
600
|
-
//
|
|
601
|
-
// does not override the global onSuccess callback set in the initApp method
|
|
604
|
+
// overrides the the global `onSuccess` callback set in the `initApp` method for the current session only
|
|
602
605
|
console.log('Session successful', sessionId);
|
|
603
606
|
},
|
|
604
607
|
onFail: async(sessionId) => { // optional
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as I}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as I}from"./chunk-MRN73EEW.mjs";import{a as l}from"./chunk-FZFUNR5U.mjs";import{a as u}from"./chunk-Y6BAA2ZQ.mjs";import{j as m,k as p,l as d,n as f}from"./chunk-65L5EBBL.mjs";import{a as T}from"./chunk-5HY62GH7.mjs";var z=async({toastList:g,transactionsSessions:S,account:o,existingCompletedTransactions:y=[],skipFetchingTransactions:F=!1})=>{let n=[],a=[...y],e=l(),C=u();for(let t of g.transactionToasts){let r=S[t.toastId];if(!r?.status)continue;let{status:s,transactions:P,transactionsDisplayInfo:x}=r,A=await T({transactions:P,address:o.address,explorerAddress:e,egldLabel:C,skipFetchingTransactions:F}),E=f(s),L=d(s),b=p(s),i=E||L||b,h=m(s),{startTime:v,endTime:R}=t;if(i&&a.some(O=>O.toastId===t.toastId))continue;let c=I({toastId:t.toastId,address:o.address,status:s,transactions:A,transactionsDisplayInfo:x,explorerAddress:e,startTime:v,endTime:R});i&&a.push(c),h&&n.push(c)}return{pendingTransactionToasts:n,completedTransactionToasts:a}};export{z as a};
|
|
2
|
+
//# sourceMappingURL=chunk-22ANWLYS.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/managers/
|
|
3
|
+
"sources": ["../../src/managers/ToastManager/helpers/createToastsFromTransactions.ts"],
|
|
4
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 skipFetchingTransactions?: boolean;\n}\n\nexport const createToastsFromTransactions = async ({\n toastList,\n transactionsSessions,\n account,\n existingCompletedTransactions = [],\n skipFetchingTransactions = false\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 skipFetchingTransactions\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
5
|
"mappings": "kOA4BO,IAAMA,EAA+B,MAAO,CACjD,UAAAC,EACA,qBAAAC,EACA,QAAAC,EACA,8BAAAC,EAAgC,CAAC,EACjC,yBAAAC,EAA2B,EAC7B,IAA+F,CAC7F,IAAMC,EAAgD,CAAC,EACjDC,EAAkD,CACtD,GAAGH,CACL,EACMI,EAAkBC,EAAmB,EACrCC,EAAYC,EAAa,EAE/B,QAAWC,KAASX,EAAU,kBAAmB,CAC/C,IAAMY,EAAqBX,EAAqBU,EAAM,OAAO,EAC7D,GAAI,CAACC,GAAoB,OACvB,SAGF,GAAM,CAAE,OAAAC,EAAQ,aAAAC,EAAc,wBAAAC,CAAwB,EACpDH,EAEII,EAA2B,MAAMC,EAAiC,CACtE,aAAAH,EACA,QAASZ,EAAQ,QACjB,gBAAAK,EACA,UAAAE,EACA,yBAAAL,CACF,CAAC,EAEKc,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,QAAST,EAAQ,QACjB,OAAQW,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
6
|
"names": ["createToastsFromTransactions", "toastList", "transactionsSessions", "account", "existingCompletedTransactions", "skipFetchingTransactions", "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"]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-EAHD3FOU.mjs";import{createJSONStorage as o}from"zustand/middleware";var r={persistReducersStorageType:"localStorage"},i=e?o(()=>e[r.persistReducersStorageType]):void 0,p=new Map,n=3e3;export{r as a,i as b,p as c,n as d};
|
|
2
|
+
//# sourceMappingURL=chunk-2A63CJKS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-4TBVQD27.mjs";import{q as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-4TBVQD27.mjs";import{q as n}from"./chunk-SHF44E27.mjs";var c=t=>n().setState(({config:e})=>{e.nativeAuthConfig=t},!1,"setNativeAuthConfig"),C=t=>n().setState(({config:e})=>{e.websocketStatus=t},!1,"setWebsocketStatus"),f=t=>n().setState(({config:e})=>{let a=t.walletConnectV2RelayAddress||o.walletConnectV2RelayAddress,s=t.walletConnectDeepLink||o.walletConnectDeepLink;e.walletConnectConfig={...t,walletConnectDeepLink:s,walletConnectV2RelayAddress:a}},!1,"setWalletConnectConfig");export{c as a,C as b,f as c};
|
|
2
|
+
//# sourceMappingURL=chunk-2Z5M6QQ2.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-C4KGS2BP.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-3MKQRKD2.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as t}from"./chunk-VDYLK3NT.mjs";import{c as n}from"./chunk-SHF44E27.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-46AC63TA.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-3MKQRKD2.mjs";var c=class n extends i{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-ledger-connect"});this.addressesPerPage=10;this.allAccounts=[];this.initialConnectScreenData={};this.connectScreenData={...this.initialConnectScreenData};this.initialAccountScreenData={accounts:this.allAccounts,startIndex:0,addressesPerPage:this.addressesPerPage,isLoading:!0};this.accountScreenData={...this.initialAccountScreenData};this.initialConfirmScreenData={selectedAddress:"",explorerLink:""};this.confirmScreenData={...this.initialConfirmScreenData};this.initialData={connectScreenData:this.initialConnectScreenData,accountScreenData:this.initialAccountScreenData,confirmScreenData:this.initialConfirmScreenData};this.data=this.getInitialData()}static getInstance(){return n.instance||(n.instance=new n),n.instance}updateAllAccounts(e){this.allAccounts=e,this.accountScreenData.accounts=e}updateStartIndex(e){this.accountScreenData.startIndex=e}updateConnectScreen(e){this.connectScreenData={...this.connectScreenData,...e},this.data.confirmScreenData=null,this.data.accountScreenData=null,this.data.connectScreenData=this.connectScreenData,this.notifyDataUpdate()}updateAccountScreen(e){this.accountScreenData={...this.accountScreenData,...e},this.data.confirmScreenData=null,this.data.accountScreenData=this.accountScreenData,this.notifyDataUpdate()}updateConfirmScreen(e){this.confirmScreenData={...this.confirmScreenData,...e},this.data.accountScreenData=null,this.data.confirmScreenData=this.confirmScreenData,this.notifyDataUpdate()}getAccountScreenData(){return this.data.accountScreenData}getConfirmScreenData(){return this.data.confirmScreenData}getAllAccounts(){return this.allAccounts}subscribeToProviderInit({handleRetry:e,handleCancel:t}){this.eventBus&&(this.eventBus.subscribe("CONNECT_DEVICE",e),this.eventBus.subscribe("CLOSE",t),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}unsubscribeFromProviderInit({handleRetry:e,handleCancel:t}){this.eventBus&&(this.eventBus.unsubscribe("CONNECT_DEVICE",e),this.eventBus.unsubscribe("CLOSE",t),this.eventBus.unsubscribe("UI_DISCONNECTED",this.destroy.bind(this)))}subscribeToAuthEvents({handleCancel:e,handleAccessWallet:t,handleGoToPage:a}){this.eventBus&&(this.eventBus.subscribe("CLOSE",e),this.eventBus.subscribe("ACCESS_WALLET",t),this.eventBus.subscribe("GO_TO_PAGE",a))}unsubscribeFromAuthEvents({handleCancel:e,handleAccessWallet:t,handleGoToPage:a}){this.eventBus&&(this.eventBus.unsubscribe("CLOSE",e),this.eventBus.unsubscribe("ACCESS_WALLET",t),this.eventBus.unsubscribe("GO_TO_PAGE",a))}handleClose(){this.anchor?this.anchor?.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy()}resetData(){this.accountScreenData={...this.initialAccountScreenData},this.confirmScreenData={...this.initialConfirmScreenData},this.connectScreenData={...this.initialConnectScreenData},super.resetData()}async setupEventListeners(){this.eventBus&&this.eventBus.subscribe("CLOSE",this.handleClose.bind(this))}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4TDQSARK.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p}from"./chunk-NF5BWZH7.mjs";import{a as d}from"./chunk-AFNZCTNZ.mjs";import{a as f}from"./chunk-OE6IBPA7.mjs";import{a as h}from"./chunk-3L7HZ2SO.mjs";var g=t=>t.sort((n,i)=>i.timestamp-n.timestamp),k=async({transactions:t,address:n,explorerAddress:i,egldLabel:u,skipFetchingTransactions:I=!1})=>{let o=[],e=[];if(t.forEach(s=>{let a=f(s.hash);a?o.push(a):e.push(s.hash)}),e.length===0)return g(o);let c=I?t.map(s=>({...s,txHash:s.hash})):await p(e),l=c.map(s=>s.txHash),T=e.filter(s=>!l.includes(s));if(T.length>0){let a=t.filter(r=>T.includes(r.hash)).map(r=>({...r,txHash:r.hash,price:0,status:"pending",gasUsed:0,miniBlockHash:"",receiverShard:0,round:0,senderShard:0,timestamp:Date.now()}));c.push(...a)}let m=new Map;return o.forEach(s=>{let a=s.hash;a&&m.set(String(a),s)}),c.forEach(s=>{let a=h({transaction:s,address:n,explorerAddress:i,egldLabel:u});a.status!=="pending"&&d({key:`transaction-${s.txHash}`,value:a}),m.set(s.txHash,a)}),g(Array.from(m.values()))};export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5HY62GH7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{q 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{q as u}from"./chunk-SHF44E27.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-5L747MOB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-EAHD3FOU.mjs";var t=()=>{if(!e)return"";try{let r=e.document?.referrer;return r?new URL(r).origin:""}catch(r){return console.error(r),""}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5Q6G6CI4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-ZB7BTA2Y.mjs";import{a as B}from"./chunk-ZO6NJYZ7.mjs";import{a as b}from"./chunk-Y4MBRY6P.mjs";import{a as O}from"./chunk-QXC4D3AC.mjs";import{a as D}from"./chunk-ZEW4FMMF.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as _}from"./chunk-OHDUQQEH.mjs";import{a as R}from"./chunk-PZHQ37I6.mjs";import{a as j}from"./chunk-URJQWHBM.mjs";import{a as A}from"./chunk-Y6BAA2ZQ.mjs";import{s as x}from"./chunk-SHF44E27.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-PJWJZHIS.mjs";import{a as w}from"./chunk-NTEMINYA.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard:h,username:E}}=B(),g=v(x()),C=A(),{allTransactions:r,parsedTransactionsByDataField:L}=R(z),p=[],n=k.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 O({baseURL:g.apiAddress});n.notifyDataUpdate(),n.initializeGasPriceMap(r.map(a=>a.transaction));let l=Y?.price,t=0,T=async()=>{let c=r[t]?.transaction,i=Number(c.nonce);try{n.updateIsLoading(!0);let{commonData:o,tokenTransaction:e,fungibleTransaction:s}=await D({allTransactions:r,currentScreenIndex:t,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:h,signedIndexes:p,parsedTransactionsByDataField:L});e&&n.updateTokenTransaction(e),s&&n.updateNonFungibleTransaction(s.type,s),n.updateCommonData(o)}catch(o){throw console.error(`Error fetching common data for transaction at index ${t}:`,o),o}finally{n.updateIsLoading(!1)}},$=()=>{t>0&&(t--,T())},q=(a=0)=>{let i=r[t].transaction,o=Number(i.nonce);n.updateGasPriceMap({nonce:o,ppu:a}),n.updateCommonData({ppu:a});let e=i.toPlainObject(),s=I({transaction:e,gasPriceData:n.ppuMap[o]}),P=w.newFromPlainObject({...e,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:a})},J=async()=>{M(new Error("Transaction signing cancelled by user")),await b(),n.closeUI()},f=()=>{t<n.transactionsCount-1&&(t++,T())},Q=async()=>{let c=r[t].transaction,i=Number(c.nonce),{commonData:o}=await D({allTransactions:r,currentScreenIndex:t,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:h,signedIndexes:p,parsedTransactionsByDataField:L});if(!o.needsSigning)return p.push(t),f();let e=c.toPlainObject(),s=e.nonce,P=I({transaction:e,gasPriceData:n.ppuMap[s]}),u=w.newFromPlainObject({...e,gasPrice:P});try{let m=await H([u]);m&&(p.push(t),d.push(m[0]));let nn=t===r.length-1,tn=r.filter(S=>S.needsSigning),an=d.length===tn.length;if(nn&&an){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[a,c]of V)n.subscribeToEventBus(a,c)}Z(),await T()})}export{Dn as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6IQLBT4L.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-QKUOY7IT.mjs";import{a}from"./chunk-2PNYAM6W.mjs";import{a as u}from"./chunk-IO7VCKOO.mjs";import{c as n}from"./chunk-2A63CJKS.mjs";import{a as s}from"./chunk-EAHD3FOU.mjs";var c=(o,t)=>{let r=`sdk-dapp-logout-event-${o}`,e=t.getItem(r);e&&o!==e||(t.setItem(r,o),t.removeItem(r))};async function L({provider:o,options:t={shouldBroadcastLogoutAcrossTabs:!0}}){let r=a();t.shouldBroadcastLogoutAcrossTabs&&s.localStorage&&c(r,s.localStorage);try{return u(),n.forEach(g=>g()),n.clear(),i.closeConnectionRef?.(),await o.logout()}catch(e){return console.error("Logging out error:",e),!1}}export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6LV4HAFU.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-N3QIT4Z7.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-6Y7RDZ2B.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-KDWLSBQB.mjs";import{b as e,c as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-KDWLSBQB.mjs";import{b as e,c as i}from"./chunk-XHMGA5T6.mjs";import{j as r}from"./chunk-65L5EBBL.mjs";import{q as n}from"./chunk-SHF44E27.mjs";async function E({results:u,hash:c,sessionId:s}){let a=u?.find(t=>t?.returnMessage!=="");i({sessionId:s,transaction:{...a,hash:c,status:"fail",inTransit:!1}});let{transactions:m}=n().getState();m[s].transactions.some(t=>r(t.status))||(e({sessionId:s,status:"fail",errorMessage:a?.returnMessage}),await o({sessionId:s,status:"fail"}))}export{E as a};
|
|
2
|
+
//# sourceMappingURL=chunk-76ECKPKT.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-6Y7RDZ2B.mjs";import{b as r}from"./chunk-5L747MOB.mjs";import{s as i}from"./chunk-SHF44E27.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";async function M({shard:t,apiAddress:s}){if(t!=null)try{let a=await n(t,s);if(!a?.[t]?.lastBlock)return;let e=o(i());(!e.gasStationMetadata||!e.gasStationMetadata[t]||e.gasStationMetadata[t].lastBlock!==a[t].lastBlock)&&r({...e,gasStationMetadata:{...e.gasStationMetadata,...a}})}catch(a){console.error("Error fetching gas station metadata:",a)}}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7F3VGKXN.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{q as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{q as a}from"./chunk-SHF44E27.mjs";var r=({key:e,value:t})=>{a().setState(({cache:c})=>{c[e]=t},!1,"saveToCache")},s=e=>{a().setState(({cache:t})=>{delete t[e]},!1,"removeFromCache")},h=()=>{a().setState(({cache:e})=>{Object.keys(e).forEach(t=>{delete e[t]})},!1,"clearCache")};export{r as a,s as b,h as c};
|
|
2
|
+
//# sourceMappingURL=chunk-AFNZCTNZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{t as s}from"./chunk-65L5EBBL.mjs";var o=t=>{let r=t.filter(a=>!s(a.status)).length,n=t.length;return n===1&&r===1?s(t[0].status)?"Processing transaction":"Transaction processed":`${r} / ${n} transactions processed`};export{o as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-AJC3F2YT.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/managers/
|
|
3
|
+
"sources": ["../../src/managers/ToastManager/helpers/getToastTransactionsStatus.ts"],
|
|
4
4
|
"sourcesContent": ["import { ITransactionListItem } from 'lib/sdkDappUi';\nimport { isServerTransactionPending } from 'store/actions/transactions/transactionStateByStatus';\nimport { TransactionServerStatusesEnum } from 'types';\n\nexport const getToastTransactionsStatus = (\n transactions: ITransactionListItem[]\n) => {\n const processedTransactions = transactions.filter(\n (tx) =>\n !isServerTransactionPending(tx.status as TransactionServerStatusesEnum)\n ).length;\n\n const totalTransactions = transactions.length;\n\n if (totalTransactions === 1 && processedTransactions === 1) {\n return isServerTransactionPending(\n transactions[0].status as TransactionServerStatusesEnum\n )\n ? 'Processing transaction'\n : 'Transaction processed';\n }\n\n return `${processedTransactions} / ${totalTransactions} transactions processed`;\n};\n"],
|
|
5
5
|
"mappings": "yCAIO,IAAMA,EACXC,GACG,CACH,IAAMC,EAAwBD,EAAa,OACxCE,GACC,CAACC,EAA2BD,EAAG,MAAuC,CAC1E,EAAE,OAEIE,EAAoBJ,EAAa,OAEvC,OAAII,IAAsB,GAAKH,IAA0B,EAChDE,EACLH,EAAa,CAAC,EAAE,MAClB,EACI,yBACA,wBAGC,GAAGC,CAAqB,MAAMG,CAAiB,yBACxD",
|
|
6
6
|
"names": ["getToastTransactionsStatus", "transactions", "processedTransactions", "tx", "isServerTransactionPending", "totalTransactions"]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{s as e}from"./chunk-SHF44E27.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";import{a as i}from"./chunk-CKTFPRJS.mjs";var n="https://api.multiversx.com",s=60*60*24,a=5*60,d=t=>{let r=o(e());return{origin:t?.origin||i().origin,apiAddress:t?.apiAddress||r.apiAddress||n,expirySeconds:t?.expirySeconds||s,tokenExpirationToastWarningSeconds:t?.tokenExpirationToastWarningSeconds||a}};export{d as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BA4LPRGY.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-EAHD3FOU.mjs";var n=class{static get create(){return this.createComponent}static set create(e){this.createComponent=e}};n.createComponent=async({name:e,anchor:m})=>{if(!t?.customElements?.get(e))return null;let o=t.document.createElement(e);return(m||t.document.body).appendChild(o),await customElements.whenDefined(e),o};export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-C4KGS2BP.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as w}from"./chunk-QXC4D3AC.mjs";import{a as g}from"./chunk-YGI3KXMZ.mjs";import{a as b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as w}from"./chunk-QXC4D3AC.mjs";import{a as g}from"./chunk-YGI3KXMZ.mjs";import{a as b}from"./chunk-YHNHQL5A.mjs";import{a as m}from"./chunk-NZYB675D.mjs";import{f}from"./chunk-PJWJZHIS.mjs";import x from"bignumber.js";var F=async({manager:e,provider:d})=>{if(!e||!d)throw new Error("Provider is not initialized.");let{network:u}=b(),s=e.getAccountScreenData()?.startIndex||0,r=e.getAllAccounts(),a=await w({baseURL:u.apiAddress}),l=o=>o.index>=s&&o.index<s+e.addressesPerPage,I=r.reduce((o,n)=>Object.assign(o,{[n.index]:n}),{}),A=r.filter(l),y=!!I[s];if(e.updateAccountScreen({isLoading:!y}),A.length>0){e.updateAccountScreen({accounts:A});return}try{let o=Math.floor(s/e.addressesPerPage),n=await d.getAccounts(o,e.addressesPerPage),L=n.map((t,c)=>({address:t,balance:"...",index:c+s})),P=[...r,...L],h=n.map(t=>m({address:t,baseURL:u.apiAddress})),j=await Promise.all(h),i=P.reduce((t,c)=>Object.assign(t,{[c.address]:c}),{});j.forEach(t=>{if(!t||!a||!a.price)return;let c=new x(t.balance),S=c.dividedBy(x(10).pow(18)).toFormat(4).toString();if(c.isNaN())return;let U=g({amount:f({input:t.balance}),usd:a?.price});i[t.address].balance=S,i[t.address].usdValue=U});let p=Object.values(i).sort((t,c)=>t.index-c.index),O=p.filter(l);e.updateAllAccounts(p),e.updateAccountScreen({accounts:O,isLoading:!1})}catch(o){console.error("Failed to fetch accounts:",o)}};export{F as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CL7UO54N.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-TQA3JDNV.mjs";import{s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-TQA3JDNV.mjs";import{s}from"./chunk-SHF44E27.mjs";import{e as a}from"./chunk-UERJ6AKK.mjs";function x(n){let e=s(),o=u(e),c=a(e),t=Object.keys(o).map(Number).reduce((r,m)=>{let i=o[m]?.transactions||[];return Math.max(r,...i.map(l=>l.nonce),0)},0);return t>0&&(t+=1),n==null?Math.max(t,c):Math.max(t,n.nonce,c)}export{x as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CZIMPZY4.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var d=(e=>(e.check="check",e.hourglass="hourglass",e.times="times",e.ban="ban",e))(d||{}),B=({address:a,sender:c,status:o,toastId:s,transactionsDisplayInfo:e,txActionName:t})=>{let i={id:s,icon:"check",hasCloseButton:!0,title:e?.successMessage??t??"Transaction successful",iconClassName:"success"},n={id:s,icon:"check",hasCloseButton:!0,title:e?.receivedMessage??e?.successMessage??t??"Transaction received",iconClassName:"success"},u={id:s,icon:"hourglass",hasCloseButton:!1,title:e?.processingMessage??t??"Processing transaction",iconClassName:"warning"},r={id:s,icon:"times",title:e?.errorMessage??t??"Transaction failed",hasCloseButton:!0,iconClassName:"danger"},l={id:s,icon:"ban",title:e?.invalidMessage??t??"Transaction invalid",hasCloseButton:!0,iconClassName:"warning"},T={id:s,icon:"times",title:e?.timedOutMessage??t??"Transaction timed out",hasCloseButton:!0,iconClassName:"warning"};switch(o){case"success":return c!==a?n:i;case"cancelled":case"fail":return r;case"timedOut":return T;case"invalid":return l;case"signed":case"sent":default:return u}};export{d as a,B as b};
|
|
2
|
+
//# sourceMappingURL=chunk-DGMI66QS.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/managers/ToastManager/helpers/getToastDataStateByStatus.ts"],
|
|
4
|
+
"sourcesContent": ["import { TransactionBatchStatusesEnum } from 'types';\nimport {\n GetToastsOptionsDataPropsType,\n IToastDataState,\n TransactionsDefaultTitles\n} from '../types';\n\nexport enum ToastIconsEnum {\n check = 'check',\n hourglass = 'hourglass',\n times = 'times',\n ban = 'ban'\n}\n\nexport const getToastDataStateByStatus = ({\n address,\n sender,\n status,\n toastId,\n transactionsDisplayInfo,\n txActionName\n}: GetToastsOptionsDataPropsType) => {\n const successToastData: IToastDataState = {\n id: toastId,\n icon: ToastIconsEnum.check,\n hasCloseButton: true,\n title:\n transactionsDisplayInfo?.successMessage ??\n txActionName ??\n TransactionsDefaultTitles.success,\n iconClassName: 'success'\n };\n\n const receivedToastData: IToastDataState = {\n id: toastId,\n icon: ToastIconsEnum.check,\n hasCloseButton: true,\n title:\n transactionsDisplayInfo?.receivedMessage ??\n transactionsDisplayInfo?.successMessage ??\n txActionName ??\n TransactionsDefaultTitles.received,\n iconClassName: 'success'\n };\n\n const pendingToastData: IToastDataState = {\n id: toastId,\n icon: ToastIconsEnum.hourglass,\n hasCloseButton: false,\n title:\n transactionsDisplayInfo?.processingMessage ??\n txActionName ??\n TransactionsDefaultTitles.pending,\n iconClassName: 'warning'\n };\n\n const failToastData: IToastDataState = {\n id: toastId,\n icon: ToastIconsEnum.times,\n title:\n transactionsDisplayInfo?.errorMessage ??\n txActionName ??\n TransactionsDefaultTitles.failed,\n hasCloseButton: true,\n iconClassName: 'danger'\n };\n\n const invalidToastData: IToastDataState = {\n id: toastId,\n icon: ToastIconsEnum.ban,\n title:\n transactionsDisplayInfo?.invalidMessage ??\n txActionName ??\n TransactionsDefaultTitles.invalid,\n hasCloseButton: true,\n iconClassName: 'warning'\n };\n\n const timedOutToastData = {\n id: toastId,\n icon: ToastIconsEnum.times,\n title:\n transactionsDisplayInfo?.timedOutMessage ??\n txActionName ??\n TransactionsDefaultTitles.timedOut,\n hasCloseButton: true,\n iconClassName: 'warning'\n };\n\n switch (status) {\n case TransactionBatchStatusesEnum.success:\n return sender !== address ? receivedToastData : successToastData;\n case TransactionBatchStatusesEnum.cancelled:\n case TransactionBatchStatusesEnum.fail:\n return failToastData;\n case TransactionBatchStatusesEnum.timedOut:\n return timedOutToastData;\n case TransactionBatchStatusesEnum.invalid:\n return invalidToastData;\n\n case TransactionBatchStatusesEnum.signed:\n case TransactionBatchStatusesEnum.sent:\n default:\n return pendingToastData;\n }\n};\n"],
|
|
5
|
+
"mappings": "AAOO,IAAKA,OACVA,EAAA,MAAQ,QACRA,EAAA,UAAY,YACZA,EAAA,MAAQ,QACRA,EAAA,IAAM,MAJIA,OAAA,IAOCC,EAA4B,CAAC,CACxC,QAAAC,EACA,OAAAC,EACA,OAAAC,EACA,QAAAC,EACA,wBAAAC,EACA,aAAAC,CACF,IAAqC,CACnC,IAAMC,EAAoC,CACxC,GAAIH,EACJ,KAAM,QACN,eAAgB,GAChB,MACEC,GAAyB,gBACzBC,4BAEF,cAAe,SACjB,EAEME,EAAqC,CACzC,GAAIJ,EACJ,KAAM,QACN,eAAgB,GAChB,MACEC,GAAyB,iBACzBA,GAAyB,gBACzBC,0BAEF,cAAe,SACjB,EAEMG,EAAoC,CACxC,GAAIL,EACJ,KAAM,YACN,eAAgB,GAChB,MACEC,GAAyB,mBACzBC,4BAEF,cAAe,SACjB,EAEMI,EAAiC,CACrC,GAAIN,EACJ,KAAM,QACN,MACEC,GAAyB,cACzBC,wBAEF,eAAgB,GAChB,cAAe,QACjB,EAEMK,EAAoC,CACxC,GAAIP,EACJ,KAAM,MACN,MACEC,GAAyB,gBACzBC,yBAEF,eAAgB,GAChB,cAAe,SACjB,EAEMM,EAAoB,CACxB,GAAIR,EACJ,KAAM,QACN,MACEC,GAAyB,iBACzBC,2BAEF,eAAgB,GAChB,cAAe,SACjB,EAEA,OAAQH,EAAQ,CACd,cACE,OAAOD,IAAWD,EAAUO,EAAoBD,EAClD,gBACA,WACE,OAAOG,EACT,eACE,OAAOE,EACT,cACE,OAAOD,EAET,aACA,WACA,QACE,OAAOF,CACX,CACF",
|
|
6
|
+
"names": ["ToastIconsEnum", "getToastDataStateByStatus", "address", "sender", "status", "toastId", "transactionsDisplayInfo", "txActionName", "successToastData", "receivedToastData", "pendingToastData", "failToastData", "invalidToastData", "timedOutToastData"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{q as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{q as c}from"./chunk-SHF44E27.mjs";import{a as o}from"./chunk-JMC7CMTU.mjs";var r=e=>{c().setState(({account:t})=>{let s=t.address===e.address;t.accounts={[t.address]:s?e:o}},!1,"setAccount")},u=e=>c().setState(({account:t})=>{t.ledgerAccount=e},!1,"setLedgerAccount"),p=e=>c().setState(({account:t})=>{t.walletConnectAccount=e},!1,"setWalletConnectAccount"),l=e=>c().setState(({account:t})=>{t.websocketEvent={timestamp:Date.now(),message:e}},!1,"setWebsocketEvent"),m=e=>c().setState(({account:t})=>{t.websocketBatchEvent={timestamp:Date.now(),data:e}},!1,"setWebsocketBatchEvent"),A=e=>{c().setState(({account:t})=>{t.accounts[t.address].nonce=e},!1,"setAccountNonce")};export{r as a,u as b,p as c,l as d,m as e,A as f};
|
|
2
|
+
//# sourceMappingURL=chunk-DZITE34E.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.
|
|
4
|
+
"sourcesContent": ["export const safeWindow: Window =\n typeof window !== 'undefined' ? window : ({} as Window);\n\nexport const version = '5.2.0'; // 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 n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-3MKQRKD2.mjs";import{a as t}from"./chunk-T2BTKWLR.mjs";var i=class extends n{constructor({uiDataUpdateEvent:e,uiTag:s}){super({uiDataUpdateEvent:e,uiTag:s});this.isOpen=!1;this.data=this.getInitialData()}async openUI(){this.isOpen&&this.uiElement||(await super.init(),this.setIsSidePanelOpen(!0))}destroy(){if(this.setIsSidePanelOpen(!1),this.uiElement?.closeWithAnimation){this.uiElement?.closeWithAnimation?.().finally(()=>{super.destroy()});return}super.destroy()}closeUI(){this.resetData(),this.destroy()}setIsSidePanelOpen(e){this.isOpen=e,t(e)}};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-EOMHYWS3.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-EAHD3FOU.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-F7QE2BXY.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var a=(t=>(t.success="Transaction successful",t.received="Transaction received",t.failed="Transaction failed",t.pending="Processing transaction",t.timedOut="Transaction timed out",t.invalid="Transaction invalid",t))(a||{}),r=(t=>(t.OPEN_NOTIFICATIONS_FEED="OPEN_NOTIFICATIONS_FEED",t.CLOSE="CLOSE_TOAST",t.TRANSACTION_TOAST_DATA_UPDATE="TRANSACTION_TOAST_DATA_UPDATE",t.CUSTOM_TOAST_DATA_UPDATE="CUSTOM_TOAST_DATA_UPDATE",t.HIDE="HIDE_TOAST_LIST",t.SHOW="SHOW_TOAST_LIST",t))(r||{});export{a,r as b};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-GB2K574L.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/managers/
|
|
3
|
+
"sources": ["../../src/managers/ToastManager/types/toast.types.ts"],
|
|
4
4
|
"sourcesContent": ["import { ITransactionListItem } from 'lib/sdkDappUi';\nimport {\n TransactionBatchStatusesEnum,\n TransactionServerStatusesEnum\n} from 'types/enums.types';\nimport { TransactionsDisplayInfoType } from 'types/transactions.types';\n\nexport enum TransactionsDefaultTitles {\n success = 'Transaction successful',\n received = 'Transaction received',\n failed = 'Transaction failed',\n pending = 'Processing transaction',\n timedOut = 'Transaction timed out',\n invalid = 'Transaction invalid'\n}\n\nexport interface GetToastsOptionsDataPropsType {\n address: string;\n sender: string;\n status?: TransactionBatchStatusesEnum | TransactionServerStatusesEnum;\n toastId: string;\n transactionsDisplayInfo?: TransactionsDisplayInfoType;\n txActionName?: string;\n}\n\nexport interface IToastDataState {\n id: string;\n icon: string;\n hasCloseButton: boolean;\n title: string;\n iconClassName: string;\n}\nexport interface ITransactionProgressState {\n startTime: number;\n endTime: number;\n}\nexport interface ITransaction {\n hash: string;\n status: string;\n link: string;\n}\nexport interface ITransactionToast {\n toastId: string;\n processedTransactionsStatus: string;\n transactions: ITransactionListItem[];\n toastDataState: IToastDataState;\n transactionProgressState?: ITransactionProgressState | null;\n}\n\nexport enum ToastEventsEnum {\n OPEN_NOTIFICATIONS_FEED = 'OPEN_NOTIFICATIONS_FEED',\n CLOSE = 'CLOSE_TOAST',\n // Event to update the transaction toast data\n TRANSACTION_TOAST_DATA_UPDATE = 'TRANSACTION_TOAST_DATA_UPDATE',\n // Event to update the custom toast data\n CUSTOM_TOAST_DATA_UPDATE = 'CUSTOM_TOAST_DATA_UPDATE',\n HIDE = 'HIDE_TOAST_LIST',\n SHOW = 'SHOW_TOAST_LIST'\n}\n"],
|
|
5
5
|
"mappings": "AAOO,IAAKA,OACVA,EAAA,QAAU,yBACVA,EAAA,SAAW,uBACXA,EAAA,OAAS,qBACTA,EAAA,QAAU,yBACVA,EAAA,SAAW,wBACXA,EAAA,QAAU,sBANAA,OAAA,IA0CAC,OACVA,EAAA,wBAA0B,0BAC1BA,EAAA,MAAQ,cAERA,EAAA,8BAAgC,gCAEhCA,EAAA,yBAA2B,2BAC3BA,EAAA,KAAO,kBACPA,EAAA,KAAO,kBARGA,OAAA",
|
|
6
6
|
"names": ["TransactionsDefaultTitles", "ToastEventsEnum"]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as o,c as i}from"./chunk-QJGFIK7H.mjs";import{w as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as o,c as i}from"./chunk-QJGFIK7H.mjs";import{w as g}from"./chunk-PVATJYBR.mjs";import{q as M}from"./chunk-SHF44E27.mjs";import{a as d}from"./chunk-UERJ6AKK.mjs";import{a as u,c as p,g as c}from"./chunk-NTEMINYA.mjs";import{a as l}from"./chunk-EAHD3FOU.mjs";var m=class{constructor({onLoginCancelled:e}){this.handlers=new Map;this.store=M();this.isLoginInitiated=!1;this.handleMessage=this.handleMessage.bind(this),this.handleLoginCancelled=e}startListening(){l.addEventListener("message",this.handleMessage)}stopListening(){l.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}=d(this.store.getState()),r=g(),n=`${t}${a}`,y=new c({address:new p(t),data:new Uint8Array(Buffer.from(n))}),f=(await r.signMessage(y))?.signature??"";e.source?.postMessage({type:i.loginResponse,payload:{data:{address:t,signature:Buffer.from(f).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}=d(this.store.getState()),{message:t}=s;try{let r=new c({address:new p(a),data:new Uint8Array(Buffer.from(t))}),h=(await g().signMessage(r))?.signature??"";e.source?.postMessage({type:i.signMessageResponse,payload:{data:{signature:Buffer.from(h).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=>u.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-GBV4WTOL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as o,f as a,g as i,h as r}from"./chunk-TQA3JDNV.mjs";import{s as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as o,f as a,g as i,h as r}from"./chunk-TQA3JDNV.mjs";import{s as c}from"./chunk-SHF44E27.mjs";function b(){let t=c(),l=r(t),u=i(t),T=a(t),d=o(t),e=Object.keys(d)?.length>0,n=!e&&Object.keys(l)?.length>0,s=!e&&!n&&Object.keys(u)?.length>0,f=!e&&!n&&!s&&Object.keys(T).length>0;return{pending:e,timedOut:n,fail:s,success:f}}export{b as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GGDZD3N6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as T}from"./chunk-Q2Q4XN4M.mjs";import{b as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as T}from"./chunk-Q2Q4XN4M.mjs";import{b as u}from"./chunk-2Z5M6QQ2.mjs";import{d as m,e as l}from"./chunk-DZITE34E.mjs";import{q as a}from"./chunk-SHF44E27.mjs";import{b as r}from"./chunk-SAAOQW7P.mjs";import{b as t}from"./chunk-GGBMHKR4.mjs";import{io as y}from"socket.io-client";var A=3e3,g=3,w=500,E=1e3,f="batchUpdated",p="connect",N="connect_error",b="disconnect";async function M(i){let{apiAddress:k,websocketUrl:I}=r(a().getState());if(!i)throw new Error("Websocket could not be initialized: address missing");let o=null,n=null,c=e=>{t.status=e,u(e)},d=e=>{o&&clearTimeout(o),o=setTimeout(()=>{m(e)},E)},C=e=>{n&&clearTimeout(n),n=setTimeout(()=>{l(e)},E)},W=()=>{let e=t.instance;e&&(e.off(N),e.off(p),e.off(f),e.off(b),e.close(),console.log("Websocket disconnected.")),c("not_initialized"),t.instance=null,o&&clearTimeout(o),n&&clearTimeout(n)},S=async()=>{c("pending");let e=I??await T(k);if(!e){c("not_initialized");return}t.instance=y(e,{forceNew:!0,reconnection:!0,reconnectionAttempts:g,reconnectionDelay:w,timeout:A,query:{address:i}}),t.instance.onAny(d),t.instance.on(f,C),t.instance.on(p,()=>{console.log("Websocket connected."),c("completed")}),t.instance.on(N,s=>{console.warn("Websocket connect error: ",s.message)}),t.instance.on(b,s=>{console.warn("Websocket disconnected: ",s),c("pending")})};return t.status==="not_initialized"&&!t.instance?.active&&await S(),{closeConnection:W}}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HG5ZRYDO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as A}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as A}from"./chunk-YIJP3JDV.mjs";import{a as I}from"./chunk-EAJBSX6Y.mjs";import{a as b}from"./chunk-Y3BNMQFP.mjs";import{h as S}from"./chunk-PVATJYBR.mjs";import{b as T}from"./chunk-2VG3V3VD.mjs";import{a as y}from"./chunk-XHMGA5T6.mjs";import{a as f}from"./chunk-L3MWDI6J.mjs";import{a as h}from"./chunk-HNLLV6SD.mjs";import{h as g}from"./chunk-2IUBMLF4.mjs";import{s as l}from"./chunk-SHF44E27.mjs";import{b as m}from"./chunk-SAAOQW7P.mjs";import w from"axios";var r=class r{constructor(){this.setCallbacks=({onSuccess:t,onFail:a})=>{T({onSuccess:t,onFail:a})};this.send=async t=>{if(t.length===0)throw new Error("No transactions to send");try{if(!I(t))return await this.sendSignedTransactions(t);let a=await this.sendSignedBatchTransactions(t);if(!a.data||a.data.error)throw new Error(a.data?.error??"Failed to send transactions");return a.data.transactions}catch(a){throw a.response?.data?.message??a.message}};this.track=async(t,a={disableToasts:!1})=>{let s=this.sequentialToFlatArray(t).map(e=>({...e,status:e.status??"pending"})),o=f(s),n=y({transactions:s,transactionsDisplayInfo:a.transactionsDisplayInfo,status:o??"sent",sessionInformation:a.sessionInformation});if(a.disableToasts===!0)return n;a.onSuccess&&T({onSuccess:a.onSuccess,sessionId:n}),a.onFail&&T({onFail:a.onFail,sessionId:n});let i=A(t);return S({toastId:n,totalDuration:i}),n};this.sendSignedTransactions=async t=>{let{apiAddress:a,apiTimeout:s}=m(l());return await Promise.all(t.map(async n=>{let i=await w.post(`${a}/transactions`,n.toPlainObject(),{timeout:Number(s)}),e=i.data.txHash;return{...n.toPlainObject(),...i.data,status:"pending",hash:e}}))};this.sendSignedBatchTransactions=async t=>{let{address:a}=h(),{apiAddress:s,apiTimeout:o}=m(l());if(!a)return{error:"Invalid address provided. You need to be logged in to send transactions"};let n=this.buildBatchId(a),e={transactions:t.map(p=>p.map(c=>c.toPlainObject())),id:n},{data:u}=await w.post(`${s}/batch`,e,{timeout:Number(o)}),B=u.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:{...u,transactions:B}}};this.buildBatchId=t=>`${Date.now().toString()}${g}${t}`;this.sequentialToFlatArray=(t=[])=>this.getIsSequential(t)?t.flat():t;this.getIsSequential=t=>t?.every(a=>Array.isArray(a))}static getInstance(){return r.instance||(r.instance=new r),r.instance}};r.instance=null;var v=r;export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HZA2YT74.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-NF5BWZH7.mjs";var i=async a=>{let r=a.map(s=>s.hash),n=await e(r);return a.map(s=>{let t=n.find(o=>o?.txHash===s.hash);return{...s,status:t?.status,invalidTransaction:t==null,results:t?.results??[],previousStatus:s.status?.toString()||"",hasStatusChanged:!!(t&&t.status!==s.status)}})};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ILSJXAAO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as p,q as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{j as p,q as e}from"./chunk-SHF44E27.mjs";import{c as i}from"./chunk-NTEMINYA.mjs";var T=()=>e().setState(p),a=({address:o,providerType:d})=>{e().setState(({account:r,loginInfo:t})=>{r.address=o,r.publicKey=new i(o).toHex(),t&&(t.providerType=d)},!1,"loginAction")};export{T as a,a as b};
|
|
2
|
+
//# sourceMappingURL=chunk-IO7VCKOO.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-DLWDO7M6.mjs";import{d as v}from"./chunk-M3SOIDF4.mjs";import{v as m}from"./chunk-PVATJYBR.mjs";import{s as n}from"./chunk-SHF44E27.mjs";import{d as s}from"./chunk-VNLGNNIL.mjs";import{a as i}from"./chunk-LJX4MW7B.mjs";import{a as p}from"./chunk-PV2FIP47.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-J26RADFN.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-O7LCTC4K.mjs";import{s as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-O7LCTC4K.mjs";import{s as m}from"./chunk-SHF44E27.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-JZ7B36OT.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-55W25Q35.mjs";import{a as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-55W25Q35.mjs";import{a as r}from"./chunk-5HY62GH7.mjs";import e from"lodash.isempty";var p=async({transactionsSessions:t,address:i,explorerAddress:a,egldLabel:o})=>{if(e(t))return[];let n=s(t);return r({transactions:n,address:i,explorerAddress:a,egldLabel:o})};export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KZKD4NES.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-M73ACNCZ.mjs";import{a}from"./chunk-YUFPUG5O.mjs";import{a as c}from"./chunk-IJWP5CUJ.mjs";var p="Check if the MultiversX App is open on Ledger";async function v({manager:e,resolve:n,reject:d,shouldInitProvider:s}){let i=!c(),t=()=>v({manager:e,resolve:n,reject:d,shouldInitProvider:s}),o=()=>d("Device unavailable");try{e?.updateAccountScreen({isLoading:!0}),e&&i&&e.subscribeToProviderInit({handleRetry:t,handleCancel:o});let r=await l({shouldInitProvider:s});e&&i&&e.unsubscribeFromProviderInit({handleRetry:t,handleCancel:o}),n(r)}catch(r){if(!i)throw r;let{errorMessage:u,defaultErrorMessage:g}=a(r);e?.updateConnectScreen({error:u??g??p}),e&&e.subscribeToProviderInit({handleRetry:t,handleCancel:o})}}export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-L4FBGQKW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-HNLLV6SD.mjs";import{a as f}from"./chunk-ZX3ZUYOZ.mjs";import{a as g}from"./chunk-BA4LPRGY.mjs";import{b as a}from"./chunk-SHF44E27.mjs";import{c as s,g as r}from"./chunk-NTEMINYA.mjs";var v=async({signMessageCallback:m,nativeAuthClientConfig:o})=>{let{address:t}=u(),c=g(),i=f(o||c),e=await i.initialize({noCache:!!o});if(!e)return null;let h=new r({address:new s(t),data:Buffer.from(`${t}${e}`)}),n=await m(h,{});if(!n?.signature)throw"Message not signed";return a({loginToken:e,signature:Buffer.from(n.signature).toString("hex")}),i.getToken({address:t,token:e,signature:Buffer.from(n.signature).toString("hex")})};export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LDX6YMAJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as de}from"./chunk-M3YL36ZL.mjs";import{a as se}from"./chunk-2Y66XRQK.mjs";import{a as te}from"./chunk-3LL33L5F.mjs";import{a as U}from"./chunk-632VK5RN.mjs";import{a as ie}from"./chunk-GF3J27ZR.mjs";import{a as re}from"./chunk-VHOQPKEC.mjs";import{a as ee}from"./chunk-YUFPUG5O.mjs";import{a as ae}from"./chunk-3UVBQHXR.mjs";import{a as p}from"./chunk-O46BVCSH.mjs";import{a as Z}from"./chunk-A6XTQQEL.mjs";import{a as ne}from"./chunk-YC3NVMU3.mjs";import{a as oe}from"./chunk-IJWIF6QG.mjs";import{a as Q}from"./chunk-QJGFIK7H.mjs";import{b as J}from"./chunk-4Z3DZ2A3.mjs";import{b as I,c as Y}from"./chunk-NRXYSTRW.mjs";import{j as $,l as O,u as M,v as C,w as L}from"./chunk-5K2UH5QL.mjs";import{a as y}from"./chunk-6GKWP4IU.mjs";import{a as P}from"./chunk-RCM3SNZB.mjs";import{a as q}from"./chunk-VN62BHIP.mjs";import{a as D}from"./chunk-4TBVQD27.mjs";import{a as X}from"./chunk-NQZVWZM5.mjs";import{g as K}from"./chunk-2IUBMLF4.mjs";import{a as F,q as j,s as l}from"./chunk-RQG6ZONS.mjs";import{f as R}from"./chunk-UERJ6AKK.mjs";import{b as E,c as V}from"./chunk-SAAOQW7P.mjs";import{a as B}from"./chunk-VNLGNNIL.mjs";import{b as H,c as G}from"./chunk-6JM4DPOH.mjs";import{a as c}from"./chunk-6JSWL75O.mjs";import{a as n}from"./chunk-LJX4MW7B.mjs";import{IframeLoginTypes as pe}from"@multiversx/sdk-web-wallet-iframe-provider/out/constants";var f=class extends p{constructor({address:e,anchor:r,shouldInitProvider:t}){super(e);this.provider=null;this.config=null;this.ledgerLogin=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");if(!e||typeof e.addressIndex!="number")throw new Error("Missing addressIndex for Ledger login");let{address:r,signature:t}=await this.provider.login({addressIndex:e.addressIndex});return{address:r,signature:t??""}};this.loginOperation=async e=>{if(!this.provider||!this.config)throw new Error("Provider is not initialized.");return await te({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!P())return;await U.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ne({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ce({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await re({shouldInitProvider:!0});this.provider=r}catch(r){throw $({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return n.ledger}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){await this.initLegderConnectManager(this.options?.anchor);let e=U.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((o,s)=>ie({manager:e,resolve:o,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ve=3e4,me=5e3,he=3e3,S=class a{constructor(){this.store=j();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=B(i),r=R(i);return!!(e===n.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=J(l());if(!(!this.shouldCheckConnection()||i))try{await L().getProvider().getAddress()}catch{if(O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"times",iconClassName:"warning",message:"Unlock your device to continue signing transactions",title:"Ledger disconnected"}),this.reset(),this.recreateProviderInterval)return;this.recreateProviderInterval=setInterval(this.reconnectProvider,me)}},ve))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new f({shouldInitProvider:!0});await i.init();let e=new M(i);i.getType=()=>n.ledger,C(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:he,icon:"check",iconClassName:"success",message:"Your device is ready to sign transactions",title:"Ledger reconnected"}),this.startCheckConnectionLoop()}catch{console.log("Unable to reconnect to Ledger")}};this.reset=()=>{clearInterval(this.connectionCheckInterval??0),this.connectionCheckInterval=null}}static getInstance(){return a.instance||(a.instance=new a),a.instance}};var z=class extends p{constructor(e){super(e?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{onClose:r,manager:t}=await this.initSignState();try{let o=await this.provider.signTransactions(e)??[];return await oe(o)}catch(o){throw await r({shouldCancelAction:!0}),o}finally{t.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.crossWindow})};this.walletAddress=e?.walletAddress,this.provider=Q.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=E(l()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return n.crossWindow}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{ExtensionProvider as ue}from"@multiversx/sdk-extension-provider/out/extensionProvider";var k=class extends p{constructor(e){super(e);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)??[]}catch(o){throw await t({shouldCancelAction:!1}),o}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension})};this.provider=ue.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return n.extension}};var fe={passkey:n.passkey,metamask:n.metamask},T=class extends p{constructor({type:e,address:r,walletUrl:t}){super(r);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)}catch(o){throw await t({shouldCancelAction:!0}),o}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider||!this.type)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c[this.type]})};this.type=e,this.walletUrl=t??"",this.provider=de.getInstance(),this._login=this.provider.login.bind(this.provider)}init(){return this.initializeAddress(),this.initializeWalletUrl(),this.initializeProvider()}initializeWalletUrl(){if(this.walletUrl)return;let e=E(l());if(!e.iframeWalletAddress)throw new Error("Invalid walletUrl");this.walletUrl=e.iframeWalletAddress}async initializeProvider(){return await this.provider.init(),this.address&&this.setAccount({address:this.address}),this.provider.setLoginType(this.type),this.provider.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return fe[this.type]}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{OptionalOperation as ye}from"@multiversx/sdk-wallet-connect-provider/out";var le=[I.CANCEL_ACTION,I.SIGN_LOGIN_TOKEN],_=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;this.cancelActionAbortController=null;this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();this.cancelActionAbortController=new AbortController;let o=this.cancelActionAbortController.signal;try{let s=new Promise((h,v)=>{o.addEventListener("abort",()=>{v(new Error("cancelled by user"))})});return await Promise.race([this.provider.signTransactions(e),s])}catch(s){throw await t({shouldCancelAction:!0}),s}finally{r.closeUI()}};this.cancelAction=async()=>{this.sendCustomRequest({method:I.CANCEL_ACTION,action:ye.CANCEL_ACTION}),this.cancelActionAbortController?.abort()};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");this.cancelActionAbortController=new AbortController;let r=this.cancelActionAbortController.signal,t=new Promise((s,d)=>{r.addEventListener("abort",()=>{d(new Error("cancelled by user"))})});return await Promise.race([g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension}),t])};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return n.walletConnect}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return Promise.resolve(this.provider.getAddress())}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){if(await this.initWalletConnectManager(),!this.config)throw new Error("Invalid WalletConnect setup");let{walletConnectProvider:e,dappMethods:r}=await this.createWalletConnectProvider(this.config);this.provider=e,this.methods=r;let{uri:t="",approval:o}=await this.provider.connect({methods:this.methods}),s=this.config.walletConnectDeepLink??D.walletConnectDeepLink;this._approval=o,y.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!P())return;await y.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=P(),t=V(l());if(H(l())&&le.push(I.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{X()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:x={},walletConnectV2RelayAddress:W=""}=e,w=new Y(v,t,W,m,x);return await w.init(),{walletConnectProvider:w,dappMethods:le}}catch(m){throw console.error("Unable to connect",m),r&&await this.logout(),m}}async login(e){if(!this.provider)throw new Error("Provider is not initialized. Call createProvider first.");let r=async()=>{if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.init();let t=y.getInstance(),{uri:o="",approval:s}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??D.walletConnectDeepLink;t.updateData({wcURI:o,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(o)}`});let h=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=h??{};return t.handleClose({isLoginFinished:!!v}),{address:v,signature:m}}catch{return await r()}};if(!this._approval)throw new Error("Approval or login is not initialized");try{let t=await this.provider.login({approval:this._approval.bind(this),token:e?.token}),{address:o="",signature:s=""}=t??{};return y.getInstance().handleClose({isLoginFinished:!!o}),{address:o,signature:s}}catch(t){return console.error("User rejected connection proposal",t),await r()}}async sendCustomRequest({action:e,method:r}){if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.sendCustomRequest?.({request:{method:r,params:{action:e}}})}catch(t){console.error("Unable to send event",t)}}};var A=class{static set customProviders(i){this._customProviders=i}static get customProviders(){return this._customProviders}static async create({type:i,anchor:e}){let r=null;switch(i){case n.extension:{r=new k;break}case n.crossWindow:{r=new z;break}case n.ledger:{r=new f({anchor:e}),await S.getInstance().init();break}case n.metamask:{r=new T({type:pe.metamask});break}case n.passkey:{r=new T({type:pe.passkey});break}case n.walletConnect:{let s=G(l());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new _({anchor:e,...s});break}case n.webview:{r=new ae;break}default:{let s=q();for(let d of this._customProviders)d.type===i&&(r=await d.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new M(r);C(t);let o=n.crossWindow===i;return se(o?{skipLoginMethod:i}:null),t}static async destroy(){L().cancelLogin(),C(null),F(n.none)}};A._customProviders=[];var Pe=(a,i)=>a.some(e=>e.type===i);async function g({message:a,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(o,s)=>{let{manager:d,onClose:h}=await Z({cancelAction:e}),v=Object.values(A.customProviders),m=v.reduce((u,N)=>(u[N.type]=N.name,u),{}),x={...c,...m},W=async()=>{await h({shouldCancelAction:!0}),s({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",W);let w=Pe(v,r)?r:n.none;d.updateData({name:x[w],type:w});try{let u=await i(a);o(u)}catch(u){await h({shouldCancelAction:!0}),s(u)}finally{d.closeUI()}})}async function ce({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=ee(e);throw r?{message:r}:e}}export{ce as a,f as b,S as c,A as d,g as e,z as f,k as g,T as h,_ as i};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as de}from"./chunk-M3YL36ZL.mjs";import{a as I}from"./chunk-XELT67NG.mjs";import{a as se}from"./chunk-2Y66XRQK.mjs";import{a as te}from"./chunk-MUXOTXZA.mjs";import{a as U}from"./chunk-4TDQSARK.mjs";import{a as ie}from"./chunk-L4FBGQKW.mjs";import{a as re}from"./chunk-M73ACNCZ.mjs";import{a as ee}from"./chunk-YUFPUG5O.mjs";import{a as ae}from"./chunk-UPEKWDPU.mjs";import{a as p}from"./chunk-QH4KZO24.mjs";import{a as Z}from"./chunk-YK5QXCRF.mjs";import{a as ne}from"./chunk-6IQLBT4L.mjs";import{a as oe}from"./chunk-OHDUQQEH.mjs";import{a as Q}from"./chunk-QJGFIK7H.mjs";import{b as J}from"./chunk-4Z3DZ2A3.mjs";import{b as C,c as Y}from"./chunk-NRXYSTRW.mjs";import{j as $,l as O,u as M,v as P,w as L}from"./chunk-PVATJYBR.mjs";import{a as y}from"./chunk-IJWP5CUJ.mjs";import{a as q}from"./chunk-2PNYAM6W.mjs";import{a as D}from"./chunk-4TBVQD27.mjs";import{a as X}from"./chunk-IO7VCKOO.mjs";import{g as K}from"./chunk-2IUBMLF4.mjs";import{a as F,q as j,s as l}from"./chunk-SHF44E27.mjs";import{f as R}from"./chunk-UERJ6AKK.mjs";import{b as E,c as V}from"./chunk-SAAOQW7P.mjs";import{a as B}from"./chunk-VNLGNNIL.mjs";import{b as H,c as G}from"./chunk-6JM4DPOH.mjs";import{a as c}from"./chunk-6JSWL75O.mjs";import{a as n}from"./chunk-LJX4MW7B.mjs";import{IframeLoginTypes as pe}from"@multiversx/sdk-web-wallet-iframe-provider/out/constants";var f=class extends p{constructor({address:e,anchor:r,shouldInitProvider:t}){super(e);this.provider=null;this.config=null;this.ledgerLogin=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");if(!e||typeof e.addressIndex!="number")throw new Error("Missing addressIndex for Ledger login");let{address:r,signature:t}=await this.provider.login({addressIndex:e.addressIndex});return{address:r,signature:t??""}};this.loginOperation=async e=>{if(!this.provider||!this.config)throw new Error("Provider is not initialized.");return await te({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!y())return;await U.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ne({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ce({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await re({shouldInitProvider:!0});this.provider=r}catch(r){throw $({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return n.ledger}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){await this.initLegderConnectManager(this.options?.anchor);let e=U.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((o,s)=>ie({manager:e,resolve:o,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ve=3e4,me=5e3,he=3e3,S=class a{constructor(){this.store=j();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=B(i),r=R(i);return!!(e===n.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=J(l());if(!(!this.shouldCheckConnection()||i))try{await L().getProvider().getAddress()}catch{if(O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"times",iconClassName:"warning",message:"Unlock your device to continue signing transactions",title:"Ledger disconnected"}),this.reset(),this.recreateProviderInterval)return;this.recreateProviderInterval=setInterval(this.reconnectProvider,me)}},ve))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new f({shouldInitProvider:!0});await i.init();let e=new M(i);i.getType=()=>n.ledger,P(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:he,icon:"check",iconClassName:"success",message:"Your device is ready to sign transactions",title:"Ledger reconnected"}),this.startCheckConnectionLoop()}catch{console.log("Unable to reconnect to Ledger")}};this.reset=()=>{clearInterval(this.connectionCheckInterval??0),this.connectionCheckInterval=null}}static getInstance(){return a.instance||(a.instance=new a),a.instance}};var z=class extends p{constructor(e){super(e?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{onClose:r,manager:t}=await this.initSignState();try{let o=await this.provider.signTransactions(e)??[];return await oe(o)}catch(o){throw await r({shouldCancelAction:!0}),o}finally{t.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.crossWindow})};this.walletAddress=e?.walletAddress,this.provider=Q.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=E(l()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return n.crossWindow}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{ExtensionProvider as ue}from"@multiversx/sdk-extension-provider/out/extensionProvider";var k=class extends p{constructor(e){super(e);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)??[]}catch(o){throw await t({shouldCancelAction:!1}),o}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension})};this.provider=ue.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return n.extension}};var fe={passkey:n.passkey,metamask:n.metamask},T=class extends p{constructor({type:e,address:r,walletUrl:t}){super(r);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)}catch(o){throw await t({shouldCancelAction:!0}),o}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider||!this.type)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c[this.type]})};this.type=e,this.walletUrl=t??"",this.provider=de.getInstance(),this._login=this.provider.login.bind(this.provider)}init(){return this.initializeAddress(),this.initializeWalletUrl(),this.initializeProvider()}initializeWalletUrl(){if(this.walletUrl)return;let e=E(l());if(!e.iframeWalletAddress)throw new Error("Invalid walletUrl");this.walletUrl=e.iframeWalletAddress}async initializeProvider(){return await this.provider.init(),this.address&&this.setAccount({address:this.address}),this.provider.setLoginType(this.type),this.provider.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return fe[this.type]}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{OptionalOperation as ye}from"@multiversx/sdk-wallet-connect-provider/out";var le=[C.CANCEL_ACTION,C.SIGN_LOGIN_TOKEN],_=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;this.cancelActionAbortController=null;this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();this.cancelActionAbortController=new AbortController;let o=this.cancelActionAbortController.signal;try{let s=new Promise((h,v)=>{o.addEventListener("abort",()=>{v(new Error("cancelled by user"))})});return await Promise.race([this.provider.signTransactions(e),s])}catch(s){throw await t({shouldCancelAction:!0}),s}finally{r.closeUI()}};this.cancelAction=async()=>{this.sendCustomRequest({method:C.CANCEL_ACTION,action:ye.CANCEL_ACTION}),this.cancelActionAbortController?.abort()};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");this.cancelActionAbortController=new AbortController;let r=this.cancelActionAbortController.signal,t=new Promise((s,d)=>{r.addEventListener("abort",()=>{d(new Error("cancelled by user"))})});return await Promise.race([g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension}),t])};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return n.walletConnect}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return Promise.resolve(this.provider.getAddress())}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){if(await this.initWalletConnectManager(),!this.config)throw new Error("Invalid WalletConnect setup");let{walletConnectProvider:e,dappMethods:r}=await this.createWalletConnectProvider(this.config);this.provider=e,this.methods=r;let{uri:t="",approval:o}=await this.provider.connect({methods:this.methods}),s=this.config.walletConnectDeepLink??D.walletConnectDeepLink;this._approval=o,I.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!y())return;await I.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=y(),t=V(l());if(H(l())&&le.push(C.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{X()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:x={},walletConnectV2RelayAddress:W=""}=e,w=new Y(v,t,W,m,x);return await w.init(),{walletConnectProvider:w,dappMethods:le}}catch(m){throw console.error("Unable to connect",m),r&&await this.logout(),m}}async login(e){if(!this.provider)throw new Error("Provider is not initialized. Call createProvider first.");let r=async()=>{if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.init();let t=I.getInstance(),{uri:o="",approval:s}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??D.walletConnectDeepLink;t.updateData({wcURI:o,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(o)}`});let h=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=h??{};return t.handleClose({isLoginFinished:!!v}),{address:v,signature:m}}catch{return await r()}};if(!this._approval)throw new Error("Approval or login is not initialized");try{let t=await this.provider.login({approval:this._approval.bind(this),token:e?.token}),{address:o="",signature:s=""}=t??{};return I.getInstance().handleClose({isLoginFinished:!!o}),{address:o,signature:s}}catch(t){return console.error("User rejected connection proposal",t),await r()}}async sendCustomRequest({action:e,method:r}){if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.sendCustomRequest?.({request:{method:r,params:{action:e}}})}catch(t){console.error("Unable to send event",t)}}};var A=class{static set customProviders(i){this._customProviders=i}static get customProviders(){return this._customProviders}static async create({type:i,anchor:e}){let r=null;switch(i){case n.extension:{r=new k;break}case n.crossWindow:{r=new z;break}case n.ledger:{r=new f({anchor:e}),await S.getInstance().init();break}case n.metamask:{r=new T({type:pe.metamask});break}case n.passkey:{r=new T({type:pe.passkey});break}case n.walletConnect:{let s=G(l());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new _({anchor:e,...s});break}case n.webview:{r=new ae;break}default:{let s=q();for(let d of this._customProviders)d.type===i&&(r=await d.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new M(r);P(t);let o=n.crossWindow===i;return se(o?{skipLoginMethod:i}:null),t}static async destroy(){L().cancelLogin(),P(null),F(n.none)}};A._customProviders=[];var Pe=(a,i)=>a.some(e=>e.type===i);async function g({message:a,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(o,s)=>{let{manager:d,onClose:h}=await Z({cancelAction:e}),v=Object.values(A.customProviders),m=v.reduce((u,N)=>(u[N.type]=N.name,u),{}),x={...c,...m},W=async()=>{await h({shouldCancelAction:!0}),s({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",W);let w=Pe(v,r)?r:n.none;d.updateData({name:x[w],type:w});try{let u=await i(a);o(u)}catch(u){await h({shouldCancelAction:!0}),s(u)}finally{d.closeUI()}})}async function ce({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=ee(e);throw r?{message:r}:e}}export{ce as a,f as b,S as c,A as d,g as e,z as f,k as g,T as h,_ as i};
|
|
2
|
+
//# sourceMappingURL=chunk-M3SOIDF4.mjs.map
|