@multiversx/sdk-dapp 5.0.0-alpha.16 → 5.0.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/__chunks__/chunk-2UJZRKRE.mjs +2 -0
- package/out/__chunks__/{chunk-5R3VZX6E.mjs → chunk-3DPFX2H7.mjs} +2 -2
- package/out/__chunks__/{chunk-YZKMFI3Y.mjs → chunk-4CPZBG2V.mjs} +2 -2
- package/out/__chunks__/{chunk-I4KPP4PH.mjs → chunk-4KJY3OZX.mjs} +2 -2
- package/out/__chunks__/{chunk-5VAGLG3Y.mjs → chunk-57SDWFLR.mjs} +2 -2
- package/out/__chunks__/{chunk-LJ5JGAYL.mjs → chunk-5DP2QBUG.mjs} +2 -2
- package/out/__chunks__/{chunk-ECZH2TNF.mjs → chunk-5GE6TSQZ.mjs} +2 -2
- package/out/__chunks__/{chunk-5SUSXTTZ.mjs → chunk-62U3FXAR.mjs} +2 -2
- package/out/__chunks__/chunk-6IMOLETP.mjs +2 -0
- package/out/__chunks__/chunk-6PJBC5FX.mjs +2 -0
- package/out/__chunks__/{chunk-ID6KUNJA.mjs → chunk-6VP4GDBS.mjs} +2 -2
- package/out/__chunks__/chunk-723RNU3D.mjs +2 -0
- package/out/__chunks__/{chunk-BNVOP5SM.mjs → chunk-A42VWGRR.mjs} +2 -2
- package/out/__chunks__/{chunk-22WRFZHZ.mjs → chunk-A4R24R43.mjs} +2 -2
- package/out/__chunks__/{chunk-3EEDALSW.mjs → chunk-AUKTTMNB.mjs} +2 -2
- package/out/__chunks__/{chunk-EBWZONUV.mjs → chunk-AZZGWDJJ.mjs} +2 -2
- package/out/__chunks__/{chunk-3OKWBJFM.mjs → chunk-B2RDSGON.mjs} +2 -2
- package/out/__chunks__/chunk-B66LO7IY.mjs +2 -0
- package/out/__chunks__/{chunk-FXVMPOC7.mjs → chunk-BIGKZ7CY.mjs} +2 -2
- package/out/__chunks__/{chunk-X5E2DC6M.mjs → chunk-BLUT4E4X.mjs} +2 -2
- package/out/__chunks__/{chunk-QCXQJ5YM.mjs → chunk-BNXTJUKB.mjs} +2 -2
- package/out/__chunks__/{chunk-4VFF2EHB.mjs → chunk-BXVBXZH7.mjs} +2 -2
- package/out/__chunks__/chunk-CBN5PWFQ.mjs +2 -0
- package/out/__chunks__/{chunk-KCP2UWHU.mjs → chunk-CQ5BPNNC.mjs} +2 -2
- package/out/__chunks__/{chunk-LDM4KVJG.mjs → chunk-CX4M2FWA.mjs} +2 -2
- package/out/__chunks__/{chunk-XFV5VRHE.mjs → chunk-DIQ43LWV.mjs} +2 -2
- package/out/__chunks__/{chunk-KDIJXWH3.mjs → chunk-DQQNQQJI.mjs} +2 -2
- package/out/__chunks__/chunk-FJ7YXFLR.mjs +2 -0
- package/out/__chunks__/chunk-FJ7YXFLR.mjs.map +7 -0
- package/out/__chunks__/{chunk-ZCMSJEI4.mjs → chunk-FWGDNIZQ.mjs} +2 -2
- package/out/__chunks__/{chunk-X5JDKLIV.mjs → chunk-G2NFRNAJ.mjs} +2 -2
- package/out/__chunks__/{chunk-TJN2VTAD.mjs → chunk-HFPV65CE.mjs} +2 -2
- package/out/__chunks__/chunk-IA6P5DRG.mjs +2 -0
- package/out/__chunks__/{chunk-ATEXXLUV.mjs → chunk-IDJWUOKG.mjs} +2 -2
- package/out/__chunks__/{chunk-T3EPK6N7.mjs → chunk-IM453HJT.mjs} +2 -2
- package/out/__chunks__/{chunk-33NGD6LW.mjs → chunk-IS5U7IFK.mjs} +2 -2
- package/out/__chunks__/{chunk-PE4P3KI6.mjs → chunk-IX4263FY.mjs} +2 -2
- package/out/__chunks__/{chunk-JPOJ7DHM.mjs → chunk-J2B2Q7FE.mjs} +2 -2
- package/out/__chunks__/{chunk-27VTB7II.mjs → chunk-JFWY3CDU.mjs} +2 -2
- package/out/__chunks__/{chunk-F7YJNEFJ.mjs → chunk-JQRAWQ6I.mjs} +2 -2
- package/out/__chunks__/{chunk-6KI6UL6C.mjs → chunk-JRE74AMH.mjs} +2 -2
- package/out/__chunks__/{chunk-P5OSWL4G.mjs → chunk-JUN43Y67.mjs} +2 -2
- package/out/__chunks__/{chunk-ESC2Z53Z.mjs → chunk-JWIUKFOQ.mjs} +2 -2
- package/out/__chunks__/{chunk-6NRL7OLL.mjs → chunk-KBPWIUOX.mjs} +2 -2
- package/out/__chunks__/{chunk-52VQSACM.mjs → chunk-KPA5VWBX.mjs} +2 -2
- package/out/__chunks__/chunk-KREERI6V.mjs +2 -0
- package/out/__chunks__/chunk-MP7JBIBL.mjs +2 -0
- package/out/__chunks__/{chunk-SRHVF3CF.mjs → chunk-MUOHOU6Y.mjs} +2 -2
- package/out/__chunks__/{chunk-NAVK4GNG.mjs → chunk-N4U74Q4B.mjs} +2 -2
- package/out/__chunks__/chunk-NOTAQZUK.mjs +2 -0
- package/out/__chunks__/chunk-NOTAQZUK.mjs.map +7 -0
- package/out/__chunks__/chunk-OB2QWYYN.mjs +2 -0
- package/out/__chunks__/{chunk-LDUJ24G3.mjs → chunk-OB2T4T67.mjs} +2 -2
- package/out/__chunks__/{chunk-VHZCEPGZ.mjs → chunk-OBAPYGXT.mjs} +2 -2
- package/out/__chunks__/{chunk-6FIRQBP7.mjs → chunk-ODLJWUOF.mjs} +2 -2
- package/out/__chunks__/{chunk-C5VJMWLU.mjs → chunk-OHNNBFUT.mjs} +2 -2
- package/out/__chunks__/{chunk-URLVAGF2.mjs → chunk-OT4ZWZZC.mjs} +2 -2
- package/out/__chunks__/{chunk-EXMSBG6B.mjs → chunk-OTHJXSH5.mjs} +2 -2
- package/out/__chunks__/{chunk-GZUFMNUL.mjs → chunk-OTTPPXQM.mjs} +2 -2
- package/out/__chunks__/{chunk-S7TUDNXQ.mjs → chunk-PNFWPINQ.mjs} +2 -2
- package/out/__chunks__/{chunk-72VJ6ESJ.mjs → chunk-PSAUAKMC.mjs} +2 -2
- package/out/__chunks__/{chunk-RTTFUTCM.mjs → chunk-Q5JUUTNR.mjs} +2 -2
- package/out/__chunks__/{chunk-465RHWQ5.mjs → chunk-QCBTVCN5.mjs} +2 -2
- package/out/__chunks__/{chunk-3LZAM52Q.mjs → chunk-QH64LU3B.mjs} +2 -2
- package/out/__chunks__/chunk-QJGFIK7H.mjs +2 -0
- package/out/__chunks__/chunk-QJGFIK7H.mjs.map +7 -0
- package/out/__chunks__/{chunk-5JZI77YI.mjs → chunk-QPUDE423.mjs} +2 -2
- package/out/__chunks__/chunk-RFCXFGDQ.mjs +2 -0
- package/out/__chunks__/{chunk-ROLT7YVP.mjs → chunk-SLDXL7EG.mjs} +2 -2
- package/out/__chunks__/{chunk-LO6RI4RO.mjs → chunk-TSXYU7PO.mjs} +2 -2
- package/out/__chunks__/chunk-TYLTPZQK.mjs +2 -0
- package/out/__chunks__/{chunk-SPSO2A53.mjs → chunk-U64LDJTG.mjs} +2 -2
- package/out/__chunks__/{chunk-V63MHRY7.mjs → chunk-UCBZMZRZ.mjs} +2 -2
- package/out/__chunks__/{chunk-XO3OXUDH.mjs → chunk-UTGLYJTT.mjs} +2 -2
- package/out/__chunks__/chunk-UU6AKCX6.mjs +2 -0
- package/out/__chunks__/{chunk-5CDLB7VW.mjs → chunk-VFQKEKRB.mjs} +2 -2
- package/out/__chunks__/{chunk-2FKKBSB4.mjs → chunk-WLZAOIT2.mjs} +2 -2
- package/out/__chunks__/{chunk-NQMOKUJK.mjs → chunk-WY62CLPP.mjs} +2 -2
- package/out/__chunks__/{chunk-5V3N4MOZ.mjs → chunk-WYWHWPUZ.mjs} +2 -2
- package/out/__chunks__/chunk-XHZMMMVI.mjs +2 -0
- package/out/__chunks__/{chunk-H6SRZM4T.mjs → chunk-XKVL6Q76.mjs} +2 -2
- package/out/__chunks__/chunk-XLQFES77.mjs +2 -0
- package/out/__chunks__/{chunk-Y7BIC4GU.mjs → chunk-XXLXF6MW.mjs} +2 -2
- package/out/__chunks__/{chunk-MAY7DC6U.mjs → chunk-Y5KHGHSJ.mjs} +2 -2
- package/out/__chunks__/chunk-Y6D7CTD2.mjs +2 -0
- package/out/__chunks__/{chunk-NJ276HWT.mjs → chunk-YA3LXF4X.mjs} +2 -2
- package/out/__chunks__/chunk-YHMACRBE.mjs +2 -0
- package/out/__chunks__/{chunk-CUBNX4ZT.mjs.map → chunk-YHMACRBE.mjs.map} +1 -1
- package/out/__chunks__/chunk-ZP3XYUAJ.mjs +2 -0
- package/out/__chunks__/{chunk-3U6H4VPO.mjs → chunk-ZZC5SQOQ.mjs} +2 -2
- package/out/__mocks__/data/index.mjs +1 -1
- package/out/__mocks__/index.mjs +1 -1
- package/out/__mocks__/server.mjs +1 -1
- package/out/__mocks__/utils/index.mjs +1 -1
- package/out/apiCalls/account/getScamAddressData.mjs +1 -1
- package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
- package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
- package/out/apiCalls/index.mjs +1 -1
- package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/index.mjs +1 -1
- package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
- package/out/constants/browser.constants.mjs +1 -1
- package/out/constants/index.mjs +1 -1
- package/out/constants/storage.constants.mjs +1 -1
- package/out/constants/window.constants.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
- package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
- package/out/controllers/TransactionsTableController/index.mjs +1 -1
- package/out/index.mjs +1 -1
- package/out/lib/sdkWebWalletCrossWindowProvider.d.ts +2 -0
- package/out/lib/sdkWebWalletCrossWindowProvider.js +4 -1
- package/out/lib/sdkWebWalletCrossWindowProvider.js.map +1 -1
- package/out/lib/sdkWebWalletCrossWindowProvider.mjs +1 -1
- package/out/managers/LogoutManager/LogoutManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/index.mjs +1 -1
- package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
- package/out/managers/TransactionManager/index.mjs +1 -1
- package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
- package/out/managers/UnlockPanelManager/index.mjs +1 -1
- package/out/managers/index.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
- package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
- package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/ToastManager/ToastManager.mjs +1 -1
- package/out/managers/internal/ToastManager/helpers/LifetimeManager.mjs +1 -1
- package/out/managers/internal/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
- package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
- package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.mjs +1 -1
- package/out/managers/internal/WalletConnectStateManager/index.mjs +1 -1
- package/out/managers/internal/index.mjs +1 -1
- package/out/methods/account/getAccount.mjs +1 -1
- package/out/methods/account/getAccountInfo.mjs +1 -1
- package/out/methods/account/getAddress.mjs +1 -1
- package/out/methods/account/getIsLoggedIn.mjs +1 -1
- package/out/methods/account/getLatestNonce.mjs +1 -1
- package/out/methods/initApp/gastStationMetadata/setGasStationMetadata.mjs +1 -1
- package/out/methods/initApp/initApp.mjs +1 -1
- package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
- package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
- package/out/methods/loginInfo/getLoginInfo.mjs +1 -1
- package/out/methods/network/getEgldLabel.mjs +1 -1
- package/out/methods/network/getExplorerAddress.mjs +1 -1
- package/out/methods/network/getNetworkConfig.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/index.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/manageFailedTransactions.mjs +1 -1
- package/out/methods/trackTransactions/helpers/getPollingInterval.mjs +1 -1
- package/out/methods/trackTransactions/trackTransactions.mjs +1 -1
- package/out/methods/transactions/getFailedTransactions.mjs +1 -1
- package/out/methods/transactions/getFailedTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getSuccessfulTransactions.mjs +1 -1
- package/out/methods/transactions/getSuccessfulTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getTransactionSessions.mjs +1 -1
- package/out/providers/DappProvider/DappProvider.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/extractAddressFromToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getAccountFromToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getModifiedLoginToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
- package/out/providers/DappProvider/helpers/logout/logout.mjs +1 -1
- package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
- package/out/providers/DappProvider/helpers/signMessage/signMessageWithProvider.mjs +1 -1
- package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
- package/out/providers/DappProvider/index.mjs +1 -1
- package/out/providers/ProviderFactory.mjs +1 -1
- package/out/providers/helpers/accountProvider.mjs +1 -1
- package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
- package/out/providers/helpers/clearInitiatedLogins.mjs +1 -1
- package/out/providers/helpers/restoreProvider.js +6 -3
- package/out/providers/helpers/restoreProvider.js.map +1 -1
- package/out/providers/helpers/restoreProvider.mjs +1 -1
- package/out/providers/index.mjs +1 -1
- package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
- package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
- package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.d.ts +20 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.js +147 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.js.map +1 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs +2 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs.map +7 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.d.ts +1 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.js +18 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.js.map +1 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs +2 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs.map +7 -0
- package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/tests/webview.test.js +20 -17
- package/out/providers/strategies/WebviewProviderStrategy/tests/webview.test.js.map +1 -1
- package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
- package/out/providers/strategies/helpers/index.mjs +1 -1
- package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/tests/getCommonData.test.js +6 -6
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/tests/getCommonData.test.js.map +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/getCrossWindowProvider.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
- package/out/providers/strategies/index.mjs +1 -1
- package/out/react/account/useGetAccount.mjs +1 -1
- package/out/react/account/useGetAccountInfo.mjs +1 -1
- package/out/react/account/useGetIsLoggedIn.mjs +1 -1
- package/out/react/account/useGetLatestNonce.mjs +1 -1
- package/out/react/index.mjs +1 -1
- package/out/react/loginInfo/useGetLoginInfo.mjs +1 -1
- package/out/react/network/useGetNetworkConfig.mjs +1 -1
- package/out/react/store/getReactStore.mjs +1 -1
- package/out/react/store/useSelector.mjs +1 -1
- package/out/react/transactions/useGetFailedTransactions.mjs +1 -1
- package/out/react/transactions/useGetFailedTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetPendingTransactions.mjs +1 -1
- package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetSuccessfulTransactions.mjs +1 -1
- package/out/react/transactions/useGetSuccessfulTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetTransactionSessions.mjs +1 -1
- package/out/services/index.mjs +1 -1
- package/out/services/nativeAuth/index.mjs +1 -1
- package/out/services/nativeAuth/methods/buildNativeAuthConfig.mjs +1 -1
- package/out/services/nativeAuth/methods/getDefaultNativeAuthConfig.mjs +1 -1
- package/out/services/nativeAuth/methods/index.mjs +1 -1
- package/out/services/nativeAuth/nativeAuth.mjs +1 -1
- package/out/store/actions/account/accountActions.mjs +1 -1
- package/out/store/actions/account/index.mjs +1 -1
- package/out/store/actions/cache/cacheActions.mjs +1 -1
- package/out/store/actions/cache/index.mjs +1 -1
- package/out/store/actions/config/configActions.mjs +1 -1
- package/out/store/actions/config/index.mjs +1 -1
- package/out/store/actions/index.mjs +1 -1
- package/out/store/actions/loginInfo/loginInfoActions.mjs +1 -1
- package/out/store/actions/network/index.mjs +1 -1
- package/out/store/actions/network/initializeNetwork.mjs +1 -1
- package/out/store/actions/network/networkActions.mjs +1 -1
- package/out/store/actions/sharedActions/index.mjs +1 -1
- package/out/store/actions/sharedActions/sharedActions.mjs +1 -1
- package/out/store/actions/toasts/index.mjs +1 -1
- package/out/store/actions/toasts/toastsActions.mjs +1 -1
- package/out/store/actions/transactions/transactionsActions.mjs +1 -1
- package/out/store/actions/ui/index.mjs +1 -1
- package/out/store/actions/ui/uiActions.mjs +1 -1
- package/out/store/middleware/applyMiddlewares.mjs +1 -1
- package/out/store/middleware/index.mjs +1 -1
- package/out/store/middleware/logoutMiddleware.mjs +1 -1
- package/out/store/storage/index.mjs +1 -1
- package/out/store/storage/storageCallback.mjs +1 -1
- package/out/store/store.mjs +1 -1
- package/out/utils/ComponentFactory.mjs +1 -1
- package/out/utils/account/index.mjs +1 -1
- package/out/utils/account/refreshAccount.mjs +1 -1
- package/out/utils/account/refreshNativeAuthTokenLogin.mjs +1 -1
- package/out/utils/index.mjs +1 -1
- package/out/utils/transactions/getActiveTransactionsStatus.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/getInterpretedTransaction.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getLockedAccountName.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getShardText.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionIconInfo.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionMessages.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/index.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/index.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/getTransactionsHistory.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/getCachedTransactionListItem.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/index.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/index.mjs +1 -1
- package/out/utils/transactions/index.mjs +1 -1
- package/out/utils/visual/index.mjs +1 -1
- package/out/utils/visual/switchTheme.mjs +1 -1
- package/out/utils/window/getIsInIframe.mjs +1 -1
- package/out/utils/window/getWindowParentOrigin.mjs +1 -1
- package/out/utils/window/index.mjs +1 -1
- package/package.json +9 -9
- package/out/__chunks__/chunk-45SUU3H5.mjs +0 -2
- package/out/__chunks__/chunk-6J4LMQ4Z.mjs +0 -2
- package/out/__chunks__/chunk-6MDV4CER.mjs +0 -2
- package/out/__chunks__/chunk-ARJZ4W7T.mjs +0 -2
- package/out/__chunks__/chunk-B4RZU4FG.mjs +0 -2
- package/out/__chunks__/chunk-BKGXNJT5.mjs +0 -2
- package/out/__chunks__/chunk-CUBNX4ZT.mjs +0 -2
- package/out/__chunks__/chunk-FFNSZC37.mjs +0 -2
- package/out/__chunks__/chunk-FFNSZC37.mjs.map +0 -7
- package/out/__chunks__/chunk-GLDB2NRB.mjs +0 -2
- package/out/__chunks__/chunk-GWVYPYNB.mjs +0 -2
- package/out/__chunks__/chunk-IQADSDGP.mjs +0 -2
- package/out/__chunks__/chunk-KYWMUINZ.mjs +0 -2
- package/out/__chunks__/chunk-KYWMUINZ.mjs.map +0 -7
- package/out/__chunks__/chunk-PNPUIES4.mjs +0 -2
- package/out/__chunks__/chunk-S4ZDWFIY.mjs +0 -2
- package/out/__chunks__/chunk-TUDSXSJ7.mjs +0 -2
- package/out/__chunks__/chunk-UK4SUJCE.mjs +0 -2
- package/out/__chunks__/chunk-VEXXDADK.mjs +0 -2
- package/out/__chunks__/chunk-XSEV6HR5.mjs +0 -2
- package/out/__chunks__/chunk-YYW6XBAT.mjs +0 -2
- package/out/__chunks__/chunk-ZCNHQY2S.mjs +0 -2
- /package/out/__chunks__/{chunk-GLDB2NRB.mjs.map → chunk-2UJZRKRE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5R3VZX6E.mjs.map → chunk-3DPFX2H7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YZKMFI3Y.mjs.map → chunk-4CPZBG2V.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-I4KPP4PH.mjs.map → chunk-4KJY3OZX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5VAGLG3Y.mjs.map → chunk-57SDWFLR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LJ5JGAYL.mjs.map → chunk-5DP2QBUG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ECZH2TNF.mjs.map → chunk-5GE6TSQZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5SUSXTTZ.mjs.map → chunk-62U3FXAR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XSEV6HR5.mjs.map → chunk-6IMOLETP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YYW6XBAT.mjs.map → chunk-6PJBC5FX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ID6KUNJA.mjs.map → chunk-6VP4GDBS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ARJZ4W7T.mjs.map → chunk-723RNU3D.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BNVOP5SM.mjs.map → chunk-A42VWGRR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-22WRFZHZ.mjs.map → chunk-A4R24R43.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3EEDALSW.mjs.map → chunk-AUKTTMNB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EBWZONUV.mjs.map → chunk-AZZGWDJJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3OKWBJFM.mjs.map → chunk-B2RDSGON.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6MDV4CER.mjs.map → chunk-B66LO7IY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FXVMPOC7.mjs.map → chunk-BIGKZ7CY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-X5E2DC6M.mjs.map → chunk-BLUT4E4X.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QCXQJ5YM.mjs.map → chunk-BNXTJUKB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4VFF2EHB.mjs.map → chunk-BXVBXZH7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VEXXDADK.mjs.map → chunk-CBN5PWFQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KCP2UWHU.mjs.map → chunk-CQ5BPNNC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LDM4KVJG.mjs.map → chunk-CX4M2FWA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XFV5VRHE.mjs.map → chunk-DIQ43LWV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KDIJXWH3.mjs.map → chunk-DQQNQQJI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZCMSJEI4.mjs.map → chunk-FWGDNIZQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-X5JDKLIV.mjs.map → chunk-G2NFRNAJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TJN2VTAD.mjs.map → chunk-HFPV65CE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IQADSDGP.mjs.map → chunk-IA6P5DRG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ATEXXLUV.mjs.map → chunk-IDJWUOKG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-T3EPK6N7.mjs.map → chunk-IM453HJT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-33NGD6LW.mjs.map → chunk-IS5U7IFK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PE4P3KI6.mjs.map → chunk-IX4263FY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JPOJ7DHM.mjs.map → chunk-J2B2Q7FE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-27VTB7II.mjs.map → chunk-JFWY3CDU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-F7YJNEFJ.mjs.map → chunk-JQRAWQ6I.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6KI6UL6C.mjs.map → chunk-JRE74AMH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-P5OSWL4G.mjs.map → chunk-JUN43Y67.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ESC2Z53Z.mjs.map → chunk-JWIUKFOQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6NRL7OLL.mjs.map → chunk-KBPWIUOX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-52VQSACM.mjs.map → chunk-KPA5VWBX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PNPUIES4.mjs.map → chunk-KREERI6V.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-S4ZDWFIY.mjs.map → chunk-MP7JBIBL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SRHVF3CF.mjs.map → chunk-MUOHOU6Y.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NAVK4GNG.mjs.map → chunk-N4U74Q4B.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZCNHQY2S.mjs.map → chunk-OB2QWYYN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LDUJ24G3.mjs.map → chunk-OB2T4T67.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VHZCEPGZ.mjs.map → chunk-OBAPYGXT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6FIRQBP7.mjs.map → chunk-ODLJWUOF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-C5VJMWLU.mjs.map → chunk-OHNNBFUT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-URLVAGF2.mjs.map → chunk-OT4ZWZZC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EXMSBG6B.mjs.map → chunk-OTHJXSH5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GZUFMNUL.mjs.map → chunk-OTTPPXQM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-S7TUDNXQ.mjs.map → chunk-PNFWPINQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-72VJ6ESJ.mjs.map → chunk-PSAUAKMC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RTTFUTCM.mjs.map → chunk-Q5JUUTNR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-465RHWQ5.mjs.map → chunk-QCBTVCN5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3LZAM52Q.mjs.map → chunk-QH64LU3B.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5JZI77YI.mjs.map → chunk-QPUDE423.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-B4RZU4FG.mjs.map → chunk-RFCXFGDQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ROLT7YVP.mjs.map → chunk-SLDXL7EG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LO6RI4RO.mjs.map → chunk-TSXYU7PO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-45SUU3H5.mjs.map → chunk-TYLTPZQK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SPSO2A53.mjs.map → chunk-U64LDJTG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-V63MHRY7.mjs.map → chunk-UCBZMZRZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XO3OXUDH.mjs.map → chunk-UTGLYJTT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BKGXNJT5.mjs.map → chunk-UU6AKCX6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5CDLB7VW.mjs.map → chunk-VFQKEKRB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2FKKBSB4.mjs.map → chunk-WLZAOIT2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NQMOKUJK.mjs.map → chunk-WY62CLPP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5V3N4MOZ.mjs.map → chunk-WYWHWPUZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UK4SUJCE.mjs.map → chunk-XHZMMMVI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-H6SRZM4T.mjs.map → chunk-XKVL6Q76.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6J4LMQ4Z.mjs.map → chunk-XLQFES77.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Y7BIC4GU.mjs.map → chunk-XXLXF6MW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MAY7DC6U.mjs.map → chunk-Y5KHGHSJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TUDSXSJ7.mjs.map → chunk-Y6D7CTD2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NJ276HWT.mjs.map → chunk-YA3LXF4X.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GWVYPYNB.mjs.map → chunk-ZP3XYUAJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3U6H4VPO.mjs.map → chunk-ZZC5SQOQ.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{u as e}from"./chunk-KBPWIUOX.mjs";import{b as t}from"./chunk-SAAOQW7P.mjs";import{x as r}from"./chunk-KD2IQ32V.mjs";import i from"axios";var T=async o=>{let{apiAddress:s}=t(e()),{data:a}=await i.get(`${s}/${r}`,{params:{hashes:o.join(","),withScResults:!0}});return a};export{T as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3DPFX2H7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-3DPFX2H7.mjs";import{a as p}from"./chunk-WY62CLPP.mjs";import{a as d}from"./chunk-UU6AKCX6.mjs";import{a as T}from"./chunk-LUDF7ZUR.mjs";var f=a=>a.sort((i,o)=>o.timestamp-i.timestamp),H=async({transactions:a,address:i,explorerAddress:o,egldLabel:g})=>{let e=[],r=[];if(a.forEach(s=>{let t=d(s.hash);t?e.push(t):r.push(s.hash)}),r.length===0)return f(e);let c=await h(r),I=c.map(s=>s.txHash),m=r.filter(s=>!I.includes(s));if(m.length>0){let t=a.filter(n=>m.includes(n.hash)).map(n=>({...n,txHash:n.hash,price:0,status:"pending",gasUsed:0,miniBlockHash:"",receiverShard:0,round:0,senderShard:0,timestamp:Date.now()}));c.push(...t)}return c.forEach(s=>{let t=T({transaction:s,address:i,explorerAddress:o,egldLabel:g});t.status!=="pending"&&p({key:`transaction-${s.txHash}`,value:t}),e.push(t)}),f(e)};export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4CPZBG2V.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-B66LO7IY.mjs";import{a as f}from"./chunk-FRDR4A7Z.mjs";import{t as c}from"./chunk-AZZGWDJJ.mjs";import{u as n}from"./chunk-KBPWIUOX.mjs";import{g as a}from"./chunk-QJSB5NX4.mjs";import{e as l}from"./chunk-VNLGNNIL.mjs";import{HWProvider as m}from"@multiversx/sdk-hw-provider";async function A(u){let v=g(),d=u?.shouldInitProvider||!v,o=l(n()),t=a(n()),r=c(),i=new m,I=async()=>{let e=o?.index!=null;if(r instanceof m&&r.isInitialized())return e&&await r.setAddressIndex(o.index),r;if(d&&!await i.init())throw new Error("Failed to initialize Ledger Provider");return e&&await i.setAddressIndex(o.index),i};try{if(!d&&t)return{ledgerProvider:i,ledgerConfig:{version:t.version,dataEnabled:t.hasContractDataEnabled}};let e=await I(),s=await f(e);return{ledgerProvider:e,ledgerConfig:s}}catch(e){throw console.error("Could not initialize ledger app",e),e}}export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4KJY3OZX.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-MUOHOU6Y.mjs";import{a as S}from"./chunk-QCBTVCN5.mjs";import{a as o}from"./chunk-FMQYLMTU.mjs";import{a as y}from"./chunk-MFUQ5NBC.mjs";import{b as i,c as f}from"./chunk-IS5U7IFK.mjs";import{l}from"./chunk-65L5EBBL.mjs";var u={};async function d({serverTransaction:e,sessionId:t,isSequential:c}){let{hash:a,status:r,results:m,invalidTransaction:n,hasStatusChanged:p}=e;try{if(u[a]>30){i({sessionId:t,status:"timedOut"}),await o({sessionId:t,status:"timedOut"});return}if(n&&!c||r==="sent"){u[a]=u[a]?u[a]+1:1;return}if(c&&!r){let s=f({sessionId:t,transaction:e});await o({sessionId:t,status:s});return}if(p){let s=f({sessionId:t,transaction:e});await o({sessionId:t,status:s})}l(r)&&await S({sessionId:t,hash:a,results:m})}catch(T){console.error(T),i({sessionId:t,status:"timedOut"}),await o({sessionId:t,status:"timedOut"})}}async function R({sessionId:e,transactionBatch:t,isSequential:c}){try{if(t==null)return;let a=y(t),r=await h(a);for(let n of r)await d({serverTransaction:n,sessionId:e,isSequential:c});if(r.every(n=>n.status!=="pending")){if(r.every(s=>s.status==="success"))return i({sessionId:e,status:"success"});if(r.some(s=>s.status==="fail"))return i({sessionId:e,status:"fail"});if(r.every(s=>s.invalidTransaction))return i({sessionId:e,status:"invalid"})}}catch(a){console.error(a)}}export{R as a};
|
|
2
|
+
//# sourceMappingURL=chunk-57SDWFLR.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-RWQNLK3I.mjs";import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-RWQNLK3I.mjs";import{a as d}from"./chunk-VJBLHJYB.mjs";import{a}from"./chunk-RRK6GTWZ.mjs";import{a as o}from"./chunk-IPMSVHGJ.mjs";import{a as g}from"./chunk-PSJI2G34.mjs";import{a as i}from"./chunk-2CG6PNPJ.mjs";import{a as c}from"./chunk-FROSOADM.mjs";import{a as p,b as e}from"./chunk-HDRB2QL6.mjs";import{rest as t}from"msw";import{setupServer as u}from"msw/node";var s=m=>(R,f,n)=>f(n.status(200),n.json(m)),k=[t.get(`${e.apiAddress}/dapp/config`,s(c)),t.get(`${e.apiAddress}/network/config`,s(i)),t.get(`https://${o.url}/socket.io/`,s(g)),t.get(`${e.apiAddress}/websocket/config`,s(o)),t.get(`${e.apiAddress}/accounts/${p}`,s(a)),t.get(`${e.apiAddress}/accounts/${r.address}`,s(r)),t.get(`${e.apiAddress}/blocks`,s(d))],P=u(...k);export{t as a,s as b,P as c};
|
|
2
|
+
//# sourceMappingURL=chunk-5DP2QBUG.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-WLZAOIT2.mjs";import{a as c}from"./chunk-I3MK6KZJ.mjs";var f=async({receiver:n,sender:i,tokenId:s})=>{let t=null,r=null;if(!s)return{senderLockedAccount:t,receiverLockedAccount:r};try{let o=(await l({tokenId:s}))?.assets?.lockedAccounts;if(!o)return{senderLockedAccount:t,receiverLockedAccount:r};for(let e in o)if(c(e)&&(i===e&&(t=e),n===e&&(r=e)),c(o[e])&&(i===o[e]&&(t=o[e]),n===o[e]&&(r=o[e])),t&&r)return{senderLockedAccount:t,receiverLockedAccount:r}}catch(a){console.error("Error getting token details",a)}return{senderLockedAccount:t,receiverLockedAccount:r}};export{f as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5GE6TSQZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-VMFJUT3G.mjs";import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-VMFJUT3G.mjs";import{a as e}from"./chunk-YHMACRBE.mjs";var n=class{static get create(){return this.createComponent}static set create(t){this.createComponent=t}};n.createComponent=async({name:t,anchor:o})=>{if(await r(e),!e.document)return{};let m=e.document.createElement(t);return(o||e.document.body).appendChild(m),await customElements.whenDefined(t),m};export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-62U3FXAR.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-XLQFES77.mjs";import{a as k}from"./chunk-MP7JBIBL.mjs";import{s as f}from"./chunk-KBPWIUOX.mjs";import{d as b}from"./chunk-QJSB5NX4.mjs";import{c as n}from"./chunk-JQRAWQ6I.mjs";import{b as i}from"./chunk-GGBMHKR4.mjs";async function N(){let o=f(),I=g(),s=null,t=null,l=b(o.getState())?.timestamp,c=()=>{k()},u=()=>{s??=setInterval(c,I)},m=()=>{s&&(clearInterval(s),s=null)},p=()=>{m();let a=o.subscribe(({account:{websocketEvent:e}})=>{e?.message&&l!==e.timestamp&&(l=e.timestamp,c())});n.set("websocketEventReceived",a)},S=()=>{i.status!=="not_initialized"||t||(t=setInterval(()=>{i.status==="completed"&&(clearInterval(t),t=null,p())},1e3))};c();let r=()=>{m(),t&&(clearInterval(t),t=null)},v=o.subscribe(({account:{address:a},config:{websocketStatus:e}},T)=>{if(T.config.websocketStatus!==e)switch(e){case"completed":p();break;case"pending":u(),S();break;default:a?u():r();break}});return n.set("websocketStatusChanged",v),n.set("websocketEventReceived",r),{stopTransactionsTracking:r}}export{N as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6VP4GDBS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-Y5KHGHSJ.mjs";var i=e=>{let t=a();return{origin:e?.origin??t.origin,blockHashShard:e?.blockHashShard,expirySeconds:e?.expirySeconds??t.expirySeconds,apiAddress:e?.apiAddress??t.apiAddress,tokenExpirationToastWarningSeconds:e?.tokenExpirationToastWarningSeconds??t.tokenExpirationToastWarningSeconds,extraInfo:e?.extraInfo??{},gatewayUrl:e?.gatewayUrl,extraRequestHeaders:e?.extraRequestHeaders??{}}};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-A42VWGRR.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-YHMACRBE.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-A4R24R43.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-A42VWGRR.mjs";import{a as g}from"./chunk-3S57OP4Z.mjs";import{NativeAuthClient as y}from"@multiversx/sdk-native-auth-client";var H=f=>{let{origin:o,apiAddress:i,expirySeconds:r,blockHashShard:s,extraInfo:u,gatewayUrl:d,extraRequestHeaders:k}=h(f),e=new y({origin:o,apiUrl:i,expirySeconds:r,blockHashShard:s,gatewayUrl:d,extraRequestHeaders:k});return{initialize:async t=>{if(!i||!o)return"";let a=()=>e.getCurrentBlockHash(),n=t?.latestBlockInfo;n??=await g({apiAddress:i,blockHashShard:s,getBlockHash:a,noCache:t?.noCache});let{hash:p,timestamp:c}=n,m=e.encodeValue(JSON.stringify({...t?.extraInfo??u,...c?{timestamp:c}:{}}));return`${e.encodeValue(o)}.${p}.${r}.${m}`},getToken:({address:t,token:a,signature:n})=>e.getToken(t,a,n),getTokenExpiration:l}};export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-AUKTTMNB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ot}from"./chunk-PNPUIES4.mjs";import{a as ct}from"./chunk-6UZHM5LW.mjs";import{a as C}from"./chunk-ESC2Z53Z.mjs";import{a as mt}from"./chunk-X5JDKLIV.mjs";import{a as L}from"./chunk-ID6KUNJA.mjs";import{a as Q,b as X,g as Z,l as tt}from"./chunk-CAA4VJRH.mjs";import{a as lt}from"./chunk-NJ276HWT.mjs";import{b}from"./chunk-LDUJ24G3.mjs";import{a as pt}from"./chunk-B4RZU4FG.mjs";import{a as ht}from"./chunk-4ODPAHHA.mjs";import{a as gt}from"./chunk-Z5CDCI3Y.mjs";import{a as dt}from"./chunk-72VJ6ESJ.mjs";import{a as g}from"./chunk-VEXXDADK.mjs";import{a as J}from"./chunk-GLDB2NRB.mjs";import{a as rt}from"./chunk-FXVMPOC7.mjs";import{a as S}from"./chunk-KDIJXWH3.mjs";import{a as y,f as ut}from"./chunk-5V3N4MOZ.mjs";import{b as Tt}from"./chunk-GZUFMNUL.mjs";import{d as it}from"./chunk-33NGD6LW.mjs";import{k as st,l as et,n as nt}from"./chunk-65L5EBBL.mjs";import{a as A}from"./chunk-HORSXVIV.mjs";import{a as ft}from"./chunk-ARJZ4W7T.mjs";import{a as j}from"./chunk-3EEDALSW.mjs";import{a as I}from"./chunk-QTKK6OSJ.mjs";import{a as E}from"./chunk-6FXEHNGW.mjs";import{a as It}from"./chunk-NJN53MJV.mjs";import{a as Y}from"./chunk-YSCND2MX.mjs";import{b as V,s as u,u as q}from"./chunk-6NRL7OLL.mjs";import{c as $,f as G}from"./chunk-QJSB5NX4.mjs";import{b as d}from"./chunk-VNLGNNIL.mjs";import{b as h}from"./chunk-IEJTMYFW.mjs";import{b as H,c as K,f as z}from"./chunk-R53MCZI6.mjs";import{b as vt}from"./chunk-3LBQYLDY.mjs";import{a as at}from"./chunk-5SUSXTTZ.mjs";import{a as v}from"./chunk-OJV6XRG5.mjs";import _ from"lodash.isequal";import Et from"lodash.isequal";var Nt="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",w=class e extends rt{constructor(){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.store=u();this.initialData={pendingTransactions:[],historicTransactions:[]};this.data={...this.initialData}}static getInstance(){return e.instance||(e.instance=new e),e.instance}isNotificationsFeedOpen(){return this.isOpen}async openNotificationsFeed(){p.getInstance().hideToasts(),await this.openUI(),await this.updateDataAndNotifications();let s=this.store.subscribe(async({toasts:n,transactions:i},{toasts:a,transactions:c})=>{(!Et(a.transactionToasts,n.transactionToasts)||!Et(c,i))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Nt,[s]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}handleCloseUI(){let o=p.getInstance();this.closeUI(),o.showToasts()}async setupEventListeners(){this.eventBus&&(this.subscribeToEventBus("CLOSE_NOTIFICATIONS_FEED",this.handleCloseUI.bind(this)),this.subscribeToEventBus("CLEAR_NOTIFICATIONS_FEED_HISTORY",this.handleClearNotificationsFeedHistory.bind(this)))}async updateDataAndNotifications(){let{transactions:o,account:s,toasts:n,network:i}=this.store.getState(),{pendingTransactionToasts:a}=await C({toastList:n,transactionsSessions:o,account:s});this.data.pendingTransactions=a,this.data.historicTransactions=await ot.getTransactionsHistory({transactionsSessions:o,address:s.address,explorerAddress:i.network.explorerAddress,egldLabel:i.network.egldLabel}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){it(),this.resetData(),this.updateNotificationsFeed()}async updateNotificationsFeed(){this.eventBus&&(this.eventBus.publish("PENDING_TRANSACTIONS_UPDATE",this.data.pendingTransactions),this.eventBus.publish("TRANSACTIONS_HISTORY_UPDATE",this.data.historicTransactions))}};import R from"bignumber.js";var x=class e{constructor(){this.store=u();this.warningLogoutTimeoutRef=null;this.actualLogoutTimeoutRef=null;this.plannedLogoutTimeoutRef=null;this.plannedLogoutKey=null;this.init=async()=>{if(!this.shouldStart())return;let t=this.store.getState(),o=d(t),{isExpired:s}=I(o?.nativeAuthToken);s?f().logout():this.addPlannedLogout()};this.stop=()=>{clearTimeout(this.warningLogoutTimeoutRef??0),clearTimeout(this.plannedLogoutTimeoutRef??0),clearTimeout(this.actualLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=null,this.plannedLogoutTimeoutRef=null,this.actualLogoutTimeoutRef=null,this.plannedLogoutKey=null};this.shouldStart=()=>{let t=this.store.getState(),o=d(t),s=G(t);return!!(o?.nativeAuthToken&&s)};this.addPlannedLogout=()=>{let t=f(),o=$(this.store.getState()),s=t.getType()===v.webview;if(!o||s)return;this.addLogoutWarning();let n=d(this.store.getState()),{secondsUntilExpires:i,expiresAt:a}=I(n?.nativeAuthToken),c=new R(String(i)),r=`${o}_${a}`,m=this.plannedLogoutKey===r;if(!(i&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=r,clearTimeout(this.plannedLogoutTimeoutRef??0);let W=c.times(1e3);this.actualLogoutTimeoutRef=setTimeout(()=>{p.getInstance().createCustomToast({toastId:"native-auth-logout",iconClassName:"warning",title:"Logging out",icon:"times",message:"Your session has expired!"}),this.actualLogoutTimeoutRef=null},W.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},W.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=h(this.store.getState()),o=d(this.store.getState()),{secondsUntilExpires:s}=I(o?.nativeAuthToken),n=new R(String(s)),i=n.times(1e3);if(!s||n.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new R(t?.tokenExpirationToastWarningSeconds??0).times(1e3),r=n.times(1e3).minus(c),m=ct(i.toNumber()),T=r.isLessThanOrEqualTo(0)?0:r.toNumber();clearTimeout(this.warningLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=setTimeout(()=>{p.getInstance().createCustomToast({toastId:"native-auth-expired",iconClassName:"warning",title:"Session Expiration Warning",icon:"hourglass",message:`Your session will expire in ${m}!`}),this.warningLogoutTimeoutRef=null},T)}}static getInstance(){return e.instance||(e.instance=new e),e.instance}};async function U({address:e,provider:t,apiAddress:o}){let s=await E({address:e,baseURL:o});if(!s)throw new Error("Account not found");Tt({address:e,providerType:t.getType()});let n={...s,username:A(s.username),nonce:S(s)};y(n),await b(e),L(),s.shard!=null&&await mt({shard:Number(s.shard),apiAddress:o})}async function Ot(e){let{network:{apiAddress:t}}=g();await e.login();let o=await e.getAddress();if(!o)throw new Error("Address not found");return await U({address:o,provider:e,apiAddress:t}),{address:o}}async function Ft({provider:e,nativeAuthConfig:t,token:o}){let{network:{apiAddress:s}}=g(),n=j(t),i=o;i||(i=await n.initialize({noCache:!0}));let{address:a,signature:c,...r}=await e.login({token:i});if(!a)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let m=n.getToken({address:a,token:i,signature:c});V({loginToken:i,signature:c,nativeAuthToken:m});let T=await pt({loginToken:i,extraInfoData:{multisig:r?.multisig,impersonate:r?.impersonate},address:a});return await U({address:T,provider:e,apiAddress:s}),{address:T,signature:c}}async function St(e,t){let o=h(q());if(o)return await Ft({provider:e,nativeAuthConfig:o,token:t?.token});let{address:s}=await Ot(e);return await b(s),L(),{address:s}}var k={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${X}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${Q}-${Date.now()}`}},Pt={extensionResponse:"Unable to sign transactions","Transaction canceled":"Transaction canceled","cancelled by user":"Transaction signing cancelled by user","denied by the user":"Transaction signing denied by the user"},Dt=e=>{for(let[t,o]of Object.entries(Pt))if(e.includes(t))return o;return"Error when signing"};function B(e,t="error"){let o=e?.message,s=Dt(o),i=s!=="Error when signing"?"warning":t,a=Object.keys(k).includes(i)?k[i]:k.error,{toastId:c,iconClassName:r,title:m}=a;return N({toastId:c,duration:1e4,icon:"times",iconClassName:r,message:s,title:m}),s}async function Ct({provider:e,transactions:t,options:o={}}){await yt();let{isGuarded:s,activeGuardianAddress:n,nonce:i}=ft(),a=e.getType()===v.ledger,c=ht({latestNonce:i,transactions:t}),r=n&&s&&!o.skipGuardian?c?.map(T=>(T.version=H.withTxOptions().valueOf(),T.options=z.withOptions({guarded:!0,...a?{hashSign:!0}:{}}).valueOf(),T.guardian=K.newFromBech32(n),T)):c,m=await e.signTransactions(r)??[];return ut(i+m.length),m}var M=class{constructor(t){this.provider=t}init(){return this.provider.init()}async login(t){let o=await St(this.provider,t);return x.getInstance().init(),o}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0,hasConsentPopup:!1}){return await lt({provider:this.provider,options:t})}setShouldShowConsentPopup(t){this.provider.setShouldShowConsentPopup?.(t)}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,o){try{return await Ct({provider:this.provider,transactions:t,options:o})}catch(s){let n=B(s);throw new Error(n)}}async signMessage(t,o){try{return await dt({provider:this.provider,message:t,options:o})}catch(s){let n=B(s,"warning");throw new Error(n)}}async verifyMessage(t){return await gt(t)}cancelLogin(){this.provider.cancelLogin?.()}};var bt=null;function ps(e){bt=e}function f(){return bt||new M(vt)}var Rt=async()=>{try{let e=J(),{network:t}=g();try{let o=await E({address:e,baseURL:t.apiAddress});if(o!=null){let s={...o,username:A(o.username),nonce:S(o)};return y(s),s}}catch(o){console.error("Failed getting account ",o)}}catch(e){console.error("Failed getting address ",e)}return null};async function yt(){let e=f();if(e==null)throw"Provider not initialized";try{if(!e.init)throw"Current provider does not have init() function";return await e.init()?Rt():void 0}catch(t){console.error("Failed initializing provider ",t)}}var O={},l={},Ut=(e,t)=>{u().setState(({toasts:o})=>{let s=o.customToasts.length>0?Math.max(...o.customToasts.map(r=>parseInt(r.toastId.split("-").pop()??"0"))):0,n=t??`custom-toast-${s+1}`,i=o.customToasts.findIndex(r=>r.toastId===n),a={...e,toastId:n};if(i!==-1){o.customToasts[i]=a;return}o.customToasts.push({...a,toastId:n})},!1,"addCustomToast")},F=e=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(o=>o.toastId!==e)},!1,"removeCustomToast")},Lt=()=>{u().setState(({toasts:e})=>{e.customToasts=[]},!1,"removeAllCustomToasts")},Ws=()=>{u().setState(({toasts:e})=>{e.transactionToasts=[]})},At=({toastId:e,totalDuration:t})=>{let o="";return u().setState(({toasts:s})=>{let n=s.transactionToasts.length>0?Math.max(...s.transactionToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0;o=e??`transaction-toast-${n+1}`,s.transactionToasts.push({startTime:Y(),endTime:It(t),toastId:o})},!1,"addTransactionToast"),o},P=e=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(o=>o.toastId!==e)},!1,"removeTransactionToast"),delete l[e],delete O[e]},N=e=>{let{toasts:t}=u().getState(),o=t.customToasts.length>0?Math.max(...t.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,s=e.toastId||`custom-toast-${o+1}`;return e.onClose&&(l[s]=e.onClose),e.instantiateToastElement?(O[s]=e.instantiateToastElement,u().setState(({toasts:n})=>{let i=n.customToasts.findIndex(r=>r.toastId===s),a={...e,instantiateToastElement:null,toastId:s};i!==-1?n.customToasts[i]=a:n.customToasts.push(a)},!1,"createCustomToast"),s):(Ut(e,s),s)};var wt=1e4,D=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=wt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let o=setTimeout(()=>{P(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,o)};this.startWithCustomDuration=(t,o)=>{if(this.stop(t),o<=0)return;let s=setTimeout(()=>{F(t);let n=l[t];n?.()},o);this.timeoutIntervals.set(t,s)};this.stop=t=>{let o=this.timeoutIntervals.get(t);o&&(clearTimeout(o),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t||wt}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};var p=class e{constructor(){this.isCreatingElement=!1;this.toastsElement=null;this.transactionToasts=[];this.customToasts=[];this.storeToastsSubscription=()=>null;this.eventBusUnsubscribeFunctions=[];this.eventBus=null;this.store=u();this.destroy(),this.lifetimeManager=new D,this.notificationsFeedManager=w.getInstance()}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),this.updateTransactionToastsList(),this.updateCustomToastList(),await this.subscribeToEventBusNotifications(),this.storeToastsSubscription=this.store.subscribe(({toasts:o,transactions:s},{toasts:n,transactions:i})=>{(!_(n.transactionToasts,o.transactionToasts)||!_(i,s))&&this.updateTransactionToastsList(),_(n.customToasts,o.customToasts)||this.updateCustomToastList()})}static getInstance(){return e.instance||(e.instance=new e),e.instance}handleCompletedTransaction(t){let{transactions:o}=this.store.getState(),s=o[t];if(!s)return!1;let{status:n}=s,i=nt(n),a=et(n),c=st(n),r=a||c||i;return r?(this.successfulToastLifetime&&this.lifetimeManager.start(t),r):(this.lifetimeManager.stop(t),r)}createTransactionToast(t,o){let s=At({toastId:t,totalDuration:o});return this.handleCompletedTransaction(t),this.updateTransactionToastsList(),s}createCustomToast(t){let o=N(t);return this.updateCustomToastList(),o}async updateTransactionToastsList(){let{toasts:t,transactions:o,account:s}=this.store.getState(),{pendingTransactionToasts:n,completedTransactionToasts:i}=await C({toastList:t,transactionsSessions:o,account:s});this.transactionToasts=[...n,...i];for(let a of t.transactionToasts)this.handleCompletedTransaction(a.toastId);await this.publishTransactionToasts()}async updateCustomToastList(){let{toasts:t}=this.store.getState();this.customToasts=[];for(let o of t.customToasts){let n="message"in o?{...o}:{...o,instantiateToastElement:O[o.toastId]};this.customToasts.push(n),o.duration&&this.lifetimeManager.startWithCustomDuration(o.toastId,o.duration)}this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",this.customToasts)}async createToastListElement(){return this.toastsElement?this.toastsElement:(this.isCreatingElement||(this.isCreatingElement=!0,this.toastsElement=await at.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}handleTransactionToastClose(t){this.handleCompletedTransaction(t)&&P(t)}async subscribeToEventBusNotifications(){let t=await this.createToastListElement();if(t){if(this.eventBus=await t.getEventBus(),!this.eventBus)throw new Error("eventBus is not initialized");this.eventBus.subscribe("CLOSE_TOAST",this.handleCloseToast.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("CLOSE_TOAST",this.handleCloseToast.bind(this))}),this.eventBus.subscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this))})}}showToasts(){this.updateCustomToastList(),this.updateTransactionToastsList()}hideToasts(){this.transactionToasts=[],this.customToasts=[],this.eventBus?.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts),this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",this.customToasts)}async handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}handleCloseToast(t){if(this.customToasts.find(s=>s.toastId===t)){this.lifetimeManager.stop(t);let s=l[t];s?.(),F(t);return}this.handleTransactionToastClose(t)}async publishTransactionToasts(){if(!this.notificationsFeedManager.isNotificationsFeedOpen()){if(!this.eventBus){let t=await this.createToastListElement();if(!t)return;this.eventBus=await t.getEventBus()}this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts)}}destroy(){this.storeToastsSubscription(),this.lifetimeManager?.destroy(),this.notificationsFeedManager?.destroy(),Lt(),this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[]}};export{w as a,O as b,l as c,Ut as d,F as e,Lt as f,Ws as g,At as h,P as i,N as j,D as k,p as l,x as m,U as n,St as o,B as p,Ct as q,M as r,ps as s,f as t,yt as u};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as ot}from"./chunk-KREERI6V.mjs";import{a as ct}from"./chunk-6UZHM5LW.mjs";import{a as C}from"./chunk-JWIUKFOQ.mjs";import{a as mt}from"./chunk-G2NFRNAJ.mjs";import{a as L}from"./chunk-6VP4GDBS.mjs";import{a as Q,b as X,g as Z,l as tt}from"./chunk-CAA4VJRH.mjs";import{a as ht}from"./chunk-4ODPAHHA.mjs";import{a as dt}from"./chunk-PSAUAKMC.mjs";import{a as lt}from"./chunk-YA3LXF4X.mjs";import{b}from"./chunk-OB2T4T67.mjs";import{a as pt}from"./chunk-RFCXFGDQ.mjs";import{a as gt}from"./chunk-Z5CDCI3Y.mjs";import{a as g}from"./chunk-CBN5PWFQ.mjs";import{a as J}from"./chunk-2UJZRKRE.mjs";import{a as rt}from"./chunk-BIGKZ7CY.mjs";import{a as S}from"./chunk-DQQNQQJI.mjs";import{a as y,f as ut}from"./chunk-WYWHWPUZ.mjs";import{b as Tt}from"./chunk-OTTPPXQM.mjs";import{d as it}from"./chunk-IS5U7IFK.mjs";import{k as st,l as et,n as nt}from"./chunk-65L5EBBL.mjs";import{a as A}from"./chunk-HORSXVIV.mjs";import{a as ft}from"./chunk-723RNU3D.mjs";import{a as j}from"./chunk-AUKTTMNB.mjs";import{a as I}from"./chunk-QTKK6OSJ.mjs";import{a as E}from"./chunk-6FXEHNGW.mjs";import{a as It}from"./chunk-NJN53MJV.mjs";import{a as Y}from"./chunk-YSCND2MX.mjs";import{b as V,s as u,u as q}from"./chunk-KBPWIUOX.mjs";import{c as $,f as G}from"./chunk-QJSB5NX4.mjs";import{b as d}from"./chunk-VNLGNNIL.mjs";import{b as h}from"./chunk-IEJTMYFW.mjs";import{b as H,c as K,f as z}from"./chunk-R53MCZI6.mjs";import{b as vt}from"./chunk-3LBQYLDY.mjs";import{a as at}from"./chunk-62U3FXAR.mjs";import{a as v}from"./chunk-OJV6XRG5.mjs";import _ from"lodash.isequal";import Et from"lodash.isequal";var Nt="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",w=class e extends rt{constructor(){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.store=u();this.initialData={pendingTransactions:[],historicTransactions:[]};this.data={...this.initialData}}static getInstance(){return e.instance||(e.instance=new e),e.instance}isNotificationsFeedOpen(){return this.isOpen}async openNotificationsFeed(){p.getInstance().hideToasts(),await this.openUI(),await this.updateDataAndNotifications();let s=this.store.subscribe(async({toasts:n,transactions:i},{toasts:a,transactions:c})=>{(!Et(a.transactionToasts,n.transactionToasts)||!Et(c,i))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Nt,[s]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}handleCloseUI(){let o=p.getInstance();this.closeUI(),o.showToasts()}async setupEventListeners(){this.eventBus&&(this.subscribeToEventBus("CLOSE_NOTIFICATIONS_FEED",this.handleCloseUI.bind(this)),this.subscribeToEventBus("CLEAR_NOTIFICATIONS_FEED_HISTORY",this.handleClearNotificationsFeedHistory.bind(this)))}async updateDataAndNotifications(){let{transactions:o,account:s,toasts:n,network:i}=this.store.getState(),{pendingTransactionToasts:a}=await C({toastList:n,transactionsSessions:o,account:s});this.data.pendingTransactions=a,this.data.historicTransactions=await ot.getTransactionsHistory({transactionsSessions:o,address:s.address,explorerAddress:i.network.explorerAddress,egldLabel:i.network.egldLabel}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){it(),this.resetData(),this.updateNotificationsFeed()}async updateNotificationsFeed(){this.eventBus&&(this.eventBus.publish("PENDING_TRANSACTIONS_UPDATE",this.data.pendingTransactions),this.eventBus.publish("TRANSACTIONS_HISTORY_UPDATE",this.data.historicTransactions))}};import R from"bignumber.js";var x=class e{constructor(){this.store=u();this.warningLogoutTimeoutRef=null;this.actualLogoutTimeoutRef=null;this.plannedLogoutTimeoutRef=null;this.plannedLogoutKey=null;this.init=async()=>{if(!this.shouldStart())return;let t=this.store.getState(),o=d(t),{isExpired:s}=I(o?.nativeAuthToken);s?f().logout():this.addPlannedLogout()};this.stop=()=>{clearTimeout(this.warningLogoutTimeoutRef??0),clearTimeout(this.plannedLogoutTimeoutRef??0),clearTimeout(this.actualLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=null,this.plannedLogoutTimeoutRef=null,this.actualLogoutTimeoutRef=null,this.plannedLogoutKey=null};this.shouldStart=()=>{let t=this.store.getState(),o=d(t),s=G(t);return!!(o?.nativeAuthToken&&s)};this.addPlannedLogout=()=>{let t=f(),o=$(this.store.getState()),s=t.getType()===v.webview;if(!o||s)return;this.addLogoutWarning();let n=d(this.store.getState()),{secondsUntilExpires:i,expiresAt:a}=I(n?.nativeAuthToken),c=new R(String(i)),r=`${o}_${a}`,m=this.plannedLogoutKey===r;if(!(i&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=r,clearTimeout(this.plannedLogoutTimeoutRef??0);let W=c.times(1e3);this.actualLogoutTimeoutRef=setTimeout(()=>{p.getInstance().createCustomToast({toastId:"native-auth-logout",iconClassName:"warning",title:"Logging out",icon:"times",message:"Your session has expired!"}),this.actualLogoutTimeoutRef=null},W.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},W.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=h(this.store.getState()),o=d(this.store.getState()),{secondsUntilExpires:s}=I(o?.nativeAuthToken),n=new R(String(s)),i=n.times(1e3);if(!s||n.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new R(t?.tokenExpirationToastWarningSeconds??0).times(1e3),r=n.times(1e3).minus(c),m=ct(i.toNumber()),T=r.isLessThanOrEqualTo(0)?0:r.toNumber();clearTimeout(this.warningLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=setTimeout(()=>{p.getInstance().createCustomToast({toastId:"native-auth-expired",iconClassName:"warning",title:"Session Expiration Warning",icon:"hourglass",message:`Your session will expire in ${m}!`}),this.warningLogoutTimeoutRef=null},T)}}static getInstance(){return e.instance||(e.instance=new e),e.instance}};async function U({address:e,provider:t,apiAddress:o}){let s=await E({address:e,baseURL:o});if(!s)throw new Error("Account not found");Tt({address:e,providerType:t.getType()});let n={...s,username:A(s.username),nonce:S(s)};y(n),await b(e),L(),s.shard!=null&&await mt({shard:Number(s.shard),apiAddress:o})}async function Ot(e){let{network:{apiAddress:t}}=g();await e.login();let o=await e.getAddress();if(!o)throw new Error("Address not found");return await U({address:o,provider:e,apiAddress:t}),{address:o}}async function Ft({provider:e,nativeAuthConfig:t,token:o}){let{network:{apiAddress:s}}=g(),n=j(t),i=o;i||(i=await n.initialize({noCache:!0}));let{address:a,signature:c,...r}=await e.login({token:i});if(!a)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let m=n.getToken({address:a,token:i,signature:c});V({loginToken:i,signature:c,nativeAuthToken:m});let T=await pt({loginToken:i,extraInfoData:{multisig:r?.multisig,impersonate:r?.impersonate},address:a});return await U({address:T,provider:e,apiAddress:s}),{address:T,signature:c}}async function St(e,t){let o=h(q());if(o)return await Ft({provider:e,nativeAuthConfig:o,token:t?.token});let{address:s}=await Ot(e);return await b(s),L(),{address:s}}var k={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${X}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${Q}-${Date.now()}`}},Pt={extensionResponse:"Unable to sign transactions","Transaction canceled":"Transaction canceled","cancelled by user":"Transaction signing cancelled by user","denied by the user":"Transaction signing denied by the user"},Dt=e=>{for(let[t,o]of Object.entries(Pt))if(e.includes(t))return o;return"Error when signing"};function B(e,t="error"){let o=e?.message,s=Dt(o),i=s!=="Error when signing"?"warning":t,a=Object.keys(k).includes(i)?k[i]:k.error,{toastId:c,iconClassName:r,title:m}=a;return N({toastId:c,duration:1e4,icon:"times",iconClassName:r,message:s,title:m}),s}async function Ct({provider:e,transactions:t,options:o={}}){await yt();let{isGuarded:s,activeGuardianAddress:n,nonce:i}=ft(),a=e.getType()===v.ledger,c=ht({latestNonce:i,transactions:t}),r=n&&s&&!o.skipGuardian?c?.map(T=>(T.version=H.withTxOptions().valueOf(),T.options=z.withOptions({guarded:!0,...a?{hashSign:!0}:{}}).valueOf(),T.guardian=K.newFromBech32(n),T)):c,m=await e.signTransactions(r)??[];return ut(i+m.length),m}var M=class{constructor(t){this.provider=t}init(){return this.provider.init()}async login(t){let o=await St(this.provider,t);return x.getInstance().init(),o}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0,hasConsentPopup:!1}){return await lt({provider:this.provider,options:t})}setShouldShowConsentPopup(t){this.provider.setShouldShowConsentPopup?.(t)}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,o){try{return await Ct({provider:this.provider,transactions:t,options:o})}catch(s){let n=B(s);throw new Error(n)}}async signMessage(t,o){try{return await dt({provider:this.provider,message:t,options:o})}catch(s){let n=B(s,"warning");throw new Error(n)}}async verifyMessage(t){return await gt(t)}cancelLogin(){this.provider.cancelLogin?.()}};var bt=null;function ps(e){bt=e}function f(){return bt||new M(vt)}var Rt=async()=>{try{let e=J(),{network:t}=g();try{let o=await E({address:e,baseURL:t.apiAddress});if(o!=null){let s={...o,username:A(o.username),nonce:S(o)};return y(s),s}}catch(o){console.error("Failed getting account ",o)}}catch(e){console.error("Failed getting address ",e)}return null};async function yt(){let e=f();if(e==null)throw"Provider not initialized";try{if(!e.init)throw"Current provider does not have init() function";return await e.init()?Rt():void 0}catch(t){console.error("Failed initializing provider ",t)}}var O={},l={},Ut=(e,t)=>{u().setState(({toasts:o})=>{let s=o.customToasts.length>0?Math.max(...o.customToasts.map(r=>parseInt(r.toastId.split("-").pop()??"0"))):0,n=t??`custom-toast-${s+1}`,i=o.customToasts.findIndex(r=>r.toastId===n),a={...e,toastId:n};if(i!==-1){o.customToasts[i]=a;return}o.customToasts.push({...a,toastId:n})},!1,"addCustomToast")},F=e=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(o=>o.toastId!==e)},!1,"removeCustomToast")},Lt=()=>{u().setState(({toasts:e})=>{e.customToasts=[]},!1,"removeAllCustomToasts")},Ws=()=>{u().setState(({toasts:e})=>{e.transactionToasts=[]})},At=({toastId:e,totalDuration:t})=>{let o="";return u().setState(({toasts:s})=>{let n=s.transactionToasts.length>0?Math.max(...s.transactionToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0;o=e??`transaction-toast-${n+1}`,s.transactionToasts.push({startTime:Y(),endTime:It(t),toastId:o})},!1,"addTransactionToast"),o},P=e=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(o=>o.toastId!==e)},!1,"removeTransactionToast"),delete l[e],delete O[e]},N=e=>{let{toasts:t}=u().getState(),o=t.customToasts.length>0?Math.max(...t.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,s=e.toastId||`custom-toast-${o+1}`;return e.onClose&&(l[s]=e.onClose),e.instantiateToastElement?(O[s]=e.instantiateToastElement,u().setState(({toasts:n})=>{let i=n.customToasts.findIndex(r=>r.toastId===s),a={...e,instantiateToastElement:null,toastId:s};i!==-1?n.customToasts[i]=a:n.customToasts.push(a)},!1,"createCustomToast"),s):(Ut(e,s),s)};var wt=1e4,D=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=wt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let o=setTimeout(()=>{P(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,o)};this.startWithCustomDuration=(t,o)=>{if(this.stop(t),o<=0)return;let s=setTimeout(()=>{F(t);let n=l[t];n?.()},o);this.timeoutIntervals.set(t,s)};this.stop=t=>{let o=this.timeoutIntervals.get(t);o&&(clearTimeout(o),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t||wt}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};var p=class e{constructor(){this.isCreatingElement=!1;this.toastsElement=null;this.transactionToasts=[];this.customToasts=[];this.storeToastsSubscription=()=>null;this.eventBusUnsubscribeFunctions=[];this.eventBus=null;this.store=u();this.destroy(),this.lifetimeManager=new D,this.notificationsFeedManager=w.getInstance()}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),this.updateTransactionToastsList(),this.updateCustomToastList(),await this.subscribeToEventBusNotifications(),this.storeToastsSubscription=this.store.subscribe(({toasts:o,transactions:s},{toasts:n,transactions:i})=>{(!_(n.transactionToasts,o.transactionToasts)||!_(i,s))&&this.updateTransactionToastsList(),_(n.customToasts,o.customToasts)||this.updateCustomToastList()})}static getInstance(){return e.instance||(e.instance=new e),e.instance}handleCompletedTransaction(t){let{transactions:o}=this.store.getState(),s=o[t];if(!s)return!1;let{status:n}=s,i=nt(n),a=et(n),c=st(n),r=a||c||i;return r?(this.successfulToastLifetime&&this.lifetimeManager.start(t),r):(this.lifetimeManager.stop(t),r)}createTransactionToast(t,o){let s=At({toastId:t,totalDuration:o});return this.handleCompletedTransaction(t),this.updateTransactionToastsList(),s}createCustomToast(t){let o=N(t);return this.updateCustomToastList(),o}async updateTransactionToastsList(){let{toasts:t,transactions:o,account:s}=this.store.getState(),{pendingTransactionToasts:n,completedTransactionToasts:i}=await C({toastList:t,transactionsSessions:o,account:s});this.transactionToasts=[...n,...i];for(let a of t.transactionToasts)this.handleCompletedTransaction(a.toastId);await this.publishTransactionToasts()}async updateCustomToastList(){let{toasts:t}=this.store.getState();this.customToasts=[];for(let o of t.customToasts){let n="message"in o?{...o}:{...o,instantiateToastElement:O[o.toastId]};this.customToasts.push(n),o.duration&&this.lifetimeManager.startWithCustomDuration(o.toastId,o.duration)}this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",this.customToasts)}async createToastListElement(){return this.toastsElement?this.toastsElement:(this.isCreatingElement||(this.isCreatingElement=!0,this.toastsElement=await at.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}handleTransactionToastClose(t){this.handleCompletedTransaction(t)&&P(t)}async subscribeToEventBusNotifications(){let t=await this.createToastListElement();if(t){if(this.eventBus=await t.getEventBus(),!this.eventBus)throw new Error("eventBus is not initialized");this.eventBus.subscribe("CLOSE_TOAST",this.handleCloseToast.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("CLOSE_TOAST",this.handleCloseToast.bind(this))}),this.eventBus.subscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this))})}}showToasts(){this.updateCustomToastList(),this.updateTransactionToastsList()}hideToasts(){this.transactionToasts=[],this.customToasts=[],this.eventBus?.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts),this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",this.customToasts)}async handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}handleCloseToast(t){if(this.customToasts.find(s=>s.toastId===t)){this.lifetimeManager.stop(t);let s=l[t];s?.(),F(t);return}this.handleTransactionToastClose(t)}async publishTransactionToasts(){if(!this.notificationsFeedManager.isNotificationsFeedOpen()){if(!this.eventBus){let t=await this.createToastListElement();if(!t)return;this.eventBus=await t.getEventBus()}this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts)}}destroy(){this.storeToastsSubscription(),this.lifetimeManager?.destroy(),this.notificationsFeedManager?.destroy(),Lt(),this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[]}};export{w as a,O as b,l as c,Ut as d,F as e,Lt as f,Ws as g,At as h,P as i,N as j,D as k,p as l,x as m,U as n,St as o,B as p,Ct as q,M as r,ps as s,f as t,yt as u};
|
|
2
|
+
//# sourceMappingURL=chunk-AZZGWDJJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as d}from"./chunk-OA5BWGGO.mjs";import{b as s}from"./chunk-6UIF2KFV.mjs";import{a as i}from"./chunk-WE7YOBO7.mjs";var a=({loginToken:t,version:r})=>{if(!t||!r)return null;let{ledgerWithUsernames:u}=s(r),e=i(t);if(e==null)return null;let n="Confirm Ledger Address",o="Authorise Authentication Token";if(u){let m=d(e.ttl);return{data:`${e.origin} for ${m}.`,confirmAddressText:n,authText:o}}return{data:t,confirmAddressText:n,authText:o}};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-B2RDSGON.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-ODLJWUOF.mjs";import{a as t}from"./chunk-OB2QWYYN.mjs";var s=class extends n{constructor({uiDataUpdateEvent:e,uiTag:i}){super({uiDataUpdateEvent:e,uiTag:i});this.isOpen=!1;this.data=this.getInitialData()}async openUI(){this.isOpen&&this.uiElement||(await super.init(),this.setIsSidePanelOpen(!0))}async destroy(){this.setIsSidePanelOpen(!1),await this.uiElement?.closeWithAnimation?.(),super.destroy()}closeUI(){this.resetData(),this.destroy()}setIsSidePanelOpen(e){this.isOpen=e,t(e)}};export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BIGKZ7CY.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-VFQKEKRB.mjs";import{a as e}from"./chunk-2UJZRKRE.mjs";import{a as i}from"./chunk-REI3WYXH.mjs";var a=class{constructor(o){this.address="";this._login=null;this.loginAbortController=null;this.cancelLogin=()=>{this.loginAbortController&&this.loginAbortController.abort(),this.cancelAction?.(),this.loginAbortController=null};this.loginOperation=async o=>{if(!this._login)throw new Error("Provider is not initialized.");let r=await this._login(o);if(!r?.address)throw new Error("Provider is not initialized.");return{...r,address:r.address,signature:r.signature??""}};this.initializeAddress=()=>{if(this.address)return;let o=e();o&&(this.address=o)};this.cancelAction=void 0;this.address=o??""}getAccount(){throw new Error("Method not implemented.")}signTransaction(o,r){throw new Error("Method not implemented.")}async login(o){if(!this._login)throw new Error("Provider is not initialized.");this.loginAbortController&&this.loginAbortController.abort();let r=new AbortController;this.loginAbortController=r;let t=r.signal;try{let n=new Promise((p,c)=>{t.addEventListener("abort",()=>{c(new Error("Login cancelled"))})}),l=await Promise.race([this.loginOperation(o),n]);return this.loginAbortController=null,l}catch(n){throw this.loginAbortController=null,n}}async initSignState(){let{onClose:o,manager:r}=await s({cancelAction:this.cancelAction?.bind(this)}),t=this.getType();return r.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",o),r.updateData({name:i[t],type:t}),{onClose:o,manager:r}}};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-BLUT4E4X.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as pe}from"./chunk-3U6H4VPO.mjs";import{a as le}from"./chunk-M3YL36ZL.mjs";import{a as se}from"./chunk-52VQSACM.mjs";import{a as V}from"./chunk-PE4P3KI6.mjs";import{a as ae}from"./chunk-ZCMSJEI4.mjs";import{a as ne}from"./chunk-I4KPP4PH.mjs";import{a as I}from"./chunk-6MDV4CER.mjs";import{a as oe}from"./chunk-YUFPUG5O.mjs";import{a as ge}from"./chunk-4VFF2EHB.mjs";import{a as p}from"./chunk-X5E2DC6M.mjs";import{a as ie}from"./chunk-5CDLB7VW.mjs";import{a as ce}from"./chunk-JPOJ7DHM.mjs";import{a as de}from"./chunk-Y7BIC4GU.mjs";import{a as te}from"./chunk-FFNSZC37.mjs";import{b as re}from"./chunk-4Z3DZ2A3.mjs";import{e as u,f as ee}from"./chunk-FFHVVGYW.mjs";import{j as Q,l as U,r as S,s as C,t as b}from"./chunk-EBWZONUV.mjs";import{a as P}from"./chunk-NAVK4GNG.mjs";import{g as J}from"./chunk-CAA4VJRH.mjs";import{a as Y}from"./chunk-GLDB2NRB.mjs";import{a as R}from"./chunk-4TBVQD27.mjs";import{a as Z}from"./chunk-GZUFMNUL.mjs";import{a as N,s as $,u as d}from"./chunk-6NRL7OLL.mjs";import{f as H}from"./chunk-QJSB5NX4.mjs";import{b as E,c as G}from"./chunk-SAAOQW7P.mjs";import{a as q}from"./chunk-VNLGNNIL.mjs";import{b as F,c as j,d as K}from"./chunk-IEJTMYFW.mjs";import{a as L}from"./chunk-VMFJUT3G.mjs";import{a as c}from"./chunk-REI3WYXH.mjs";import{b as X}from"./chunk-22WRFZHZ.mjs";import{a as o}from"./chunk-OJV6XRG5.mjs";import{a as M}from"./chunk-CUBNX4ZT.mjs";import{IframeLoginTypes as ue}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 se({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!I())return;await V.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ce({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 me({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await ne({shouldInitProvider:!0});this.provider=r}catch(r){throw Q({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 o.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 L(M),await this.initLegderConnectManager(this.options?.anchor);let e=V.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((n,s)=>ae({manager:e,resolve:n,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var we=3e4,ye=5e3,Pe=3e3,k=class a{constructor(){this.store=$();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=q(i),r=H(i);return!!(e===o.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=re(d());if(!(!this.shouldCheckConnection()||i))try{await b().getProvider().getAddress()}catch{if(U.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,ye)}},we))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new f({shouldInitProvider:!0});await i.init();let e=new S(i);i.getType=()=>o.ledger,C(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,U.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:Pe,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 W=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();this.setPopupConsent();try{let n=await this.provider.signTransactions(e)??[];return await de(n)}catch(n){throw await r({shouldCancelAction:!0}),n}finally{t.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return this.setPopupConsent(),await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.crossWindow})};this.setPopupConsent=()=>{let e=K(d());if(!this.provider)throw new Error("Provider is not initialized.");(e?.isBrowserWithPopupConfirmation||X)&&this.provider.setShouldShowConsentPopup(!0)};this.walletAddress=e?.walletAddress,this.provider=te.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=E(d()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.setPopupConsent(),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return o.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 Ce}from"@multiversx/sdk-extension-provider/out/extensionProvider";var _=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(n){throw await t({shouldCancelAction:!1}),n}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=Ce.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 o.extension}};var Ie={passkey:o.passkey,metamask:o.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(n){throw await t({shouldCancelAction:!0}),n}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=le.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(d());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 Ie[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 ve}from"@multiversx/sdk-wallet-connect-provider/out";var he=[u.CANCEL_ACTION,u.SIGN_LOGIN_TOKEN],x=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;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(n){throw await t({shouldCancelAction:!0}),await this.sendCustomRequest({method:u.CANCEL_ACTION,action:ve.CANCEL_ACTION}),n}finally{r.closeUI()}};this.cancelAction=async()=>{await this.sendCustomRequest({method:u.CANCEL_ACTION,action:ve.CANCEL_ACTION})};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.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 o.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 L(M),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:n}=await this.provider.connect({methods:this.methods}),s=this.config.walletConnectDeepLink??R.walletConnectDeepLink;this._approval=n,P.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!I())return;await P.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=I(),t=G(d());if(F(d())&&he.push(u.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{Z()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:O={},walletConnectV2RelayAddress:D=""}=e,y=new ee(v,t,D,m,O);return await y.init(),{walletConnectProvider:y,dappMethods:he}}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=P.getInstance(),{uri:n="",approval:s}=await this.provider.connect({methods:this.methods}),l=this.config.walletConnectDeepLink??R.walletConnectDeepLink;t.updateData({wcURI:n,walletConnectDeepLink:`${l}?wallet-connect=${encodeURIComponent(n)}`});let w=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=w??{};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:n="",signature:s=""}=t??{};return P.getInstance().handleClose({isLoginFinished:!!n}),{address:n,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 o.extension:{r=new _;break}case o.crossWindow:{r=new W;break}case o.ledger:{r=new f({anchor:e}),await k.getInstance().init();break}case o.metamask:{r=new T({type:ue.metamask});break}case o.passkey:{r=new T({type:ue.passkey});break}case o.walletConnect:{let s=j(d());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new x({anchor:e,...s});break}case o.webview:{r=new ge;break}default:{let s=Y();for(let l of this._customProviders)l.type===i&&(r=await l.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new S(r);C(t),N(i);let n=[o.crossWindow,o.metamask,o.passkey].includes(i);return pe(n?{skipLoginMethod:i}:null),t}static async destroy(){b().cancelLogin(),C(null),N(o.none)}};A._customProviders=[];var Ae=(a,i)=>a.some(e=>e.type===i);async function g({message:a,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(n,s)=>{let{manager:l,onClose:w}=await ie({cancelAction:e}),v=Object.values(A.customProviders),m=v.reduce((h,B)=>(h[B.type]=B.name,h),{}),O={...c,...m},D=async()=>{await w({shouldCancelAction:!0}),s({message:"Signing canceled"})};l.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",D);let y=Ae(v,r)?r:o.none;l.updateData({name:O[y],type:y});try{let h=await i(a);n(h)}catch(h){await w({shouldCancelAction:!0}),s(h)}finally{l.closeUI()}})}async function me({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=oe(e);throw r?{message:r}:e}}export{me as a,f as b,k as c,A as d,g as e,W as f,_ as g,T as h,x as i};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as pe}from"./chunk-ZZC5SQOQ.mjs";import{a as le}from"./chunk-M3YL36ZL.mjs";import{a as se}from"./chunk-KPA5VWBX.mjs";import{a as V}from"./chunk-IX4263FY.mjs";import{a as ae}from"./chunk-FWGDNIZQ.mjs";import{a as ne}from"./chunk-4KJY3OZX.mjs";import{a as I}from"./chunk-B66LO7IY.mjs";import{a as oe}from"./chunk-YUFPUG5O.mjs";import{a as ge}from"./chunk-BXVBXZH7.mjs";import{a as p}from"./chunk-BLUT4E4X.mjs";import{a as ie}from"./chunk-VFQKEKRB.mjs";import{a as ce}from"./chunk-J2B2Q7FE.mjs";import{a as de}from"./chunk-XXLXF6MW.mjs";import{a as te}from"./chunk-QJGFIK7H.mjs";import{b as re}from"./chunk-4Z3DZ2A3.mjs";import{e as u,f as ee}from"./chunk-FFHVVGYW.mjs";import{j as Q,l as U,r as S,s as C,t as b}from"./chunk-AZZGWDJJ.mjs";import{a as P}from"./chunk-N4U74Q4B.mjs";import{g as J}from"./chunk-CAA4VJRH.mjs";import{a as Y}from"./chunk-2UJZRKRE.mjs";import{a as R}from"./chunk-4TBVQD27.mjs";import{a as Z}from"./chunk-OTTPPXQM.mjs";import{a as N,s as $,u as d}from"./chunk-KBPWIUOX.mjs";import{f as H}from"./chunk-QJSB5NX4.mjs";import{b as E,c as G}from"./chunk-SAAOQW7P.mjs";import{a as q}from"./chunk-VNLGNNIL.mjs";import{b as F,c as j,d as K}from"./chunk-IEJTMYFW.mjs";import{a as L}from"./chunk-VMFJUT3G.mjs";import{b as X}from"./chunk-A4R24R43.mjs";import{a as c}from"./chunk-REI3WYXH.mjs";import{a as o}from"./chunk-OJV6XRG5.mjs";import{a as M}from"./chunk-YHMACRBE.mjs";import{IframeLoginTypes as ue}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 se({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!I())return;await V.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ce({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 me({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await ne({shouldInitProvider:!0});this.provider=r}catch(r){throw Q({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 o.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 L(M),await this.initLegderConnectManager(this.options?.anchor);let e=V.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((n,s)=>ae({manager:e,resolve:n,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var we=3e4,ye=5e3,Pe=3e3,k=class a{constructor(){this.store=$();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=q(i),r=H(i);return!!(e===o.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=re(d());if(!(!this.shouldCheckConnection()||i))try{await b().getProvider().getAddress()}catch{if(U.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,ye)}},we))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new f({shouldInitProvider:!0});await i.init();let e=new S(i);i.getType=()=>o.ledger,C(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,U.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:Pe,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 W=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();this.setPopupConsent();try{let n=await this.provider.signTransactions(e)??[];return await de(n)}catch(n){throw await r({shouldCancelAction:!0}),n}finally{t.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return this.setPopupConsent(),await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.crossWindow})};this.setPopupConsent=()=>{let e=K(d());if(!this.provider)throw new Error("Provider is not initialized.");(e?.isBrowserWithPopupConfirmation||X)&&this.provider.setShouldShowConsentPopup(!0)};this.walletAddress=e?.walletAddress,this.provider=te.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=E(d()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.setPopupConsent(),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return o.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 Ce}from"@multiversx/sdk-extension-provider/out/extensionProvider";var _=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(n){throw await t({shouldCancelAction:!1}),n}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=Ce.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 o.extension}};var Ie={passkey:o.passkey,metamask:o.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(n){throw await t({shouldCancelAction:!0}),n}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=le.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(d());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 Ie[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 ve}from"@multiversx/sdk-wallet-connect-provider/out";var he=[u.CANCEL_ACTION,u.SIGN_LOGIN_TOKEN],x=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;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(n){throw await t({shouldCancelAction:!0}),await this.sendCustomRequest({method:u.CANCEL_ACTION,action:ve.CANCEL_ACTION}),n}finally{r.closeUI()}};this.cancelAction=async()=>{await this.sendCustomRequest({method:u.CANCEL_ACTION,action:ve.CANCEL_ACTION})};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.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 o.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 L(M),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:n}=await this.provider.connect({methods:this.methods}),s=this.config.walletConnectDeepLink??R.walletConnectDeepLink;this._approval=n,P.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!I())return;await P.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=I(),t=G(d());if(F(d())&&he.push(u.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{Z()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:O={},walletConnectV2RelayAddress:D=""}=e,y=new ee(v,t,D,m,O);return await y.init(),{walletConnectProvider:y,dappMethods:he}}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=P.getInstance(),{uri:n="",approval:s}=await this.provider.connect({methods:this.methods}),l=this.config.walletConnectDeepLink??R.walletConnectDeepLink;t.updateData({wcURI:n,walletConnectDeepLink:`${l}?wallet-connect=${encodeURIComponent(n)}`});let w=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=w??{};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:n="",signature:s=""}=t??{};return P.getInstance().handleClose({isLoginFinished:!!n}),{address:n,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 o.extension:{r=new _;break}case o.crossWindow:{r=new W;break}case o.ledger:{r=new f({anchor:e}),await k.getInstance().init();break}case o.metamask:{r=new T({type:ue.metamask});break}case o.passkey:{r=new T({type:ue.passkey});break}case o.walletConnect:{let s=j(d());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new x({anchor:e,...s});break}case o.webview:{r=new ge;break}default:{let s=Y();for(let l of this._customProviders)l.type===i&&(r=await l.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new S(r);C(t),N(i);let n=[o.crossWindow,o.metamask,o.passkey].includes(i);return pe(n?{skipLoginMethod:i}:null),t}static async destroy(){b().cancelLogin(),C(null),N(o.none)}};A._customProviders=[];var Ae=(a,i)=>a.some(e=>e.type===i);async function g({message:a,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(n,s)=>{let{manager:l,onClose:w}=await ie({cancelAction:e}),v=Object.values(A.customProviders),m=v.reduce((h,B)=>(h[B.type]=B.name,h),{}),O={...c,...m},D=async()=>{await w({shouldCancelAction:!0}),s({message:"Signing canceled"})};l.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",D);let y=Ae(v,r)?r:o.none;l.updateData({name:O[y],type:y});try{let h=await i(a);n(h)}catch(h){await w({shouldCancelAction:!0}),s(h)}finally{l.closeUI()}})}async function me({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=oe(e);throw r?{message:r}:e}}export{me as a,f as b,k as c,A as d,g as e,W as f,_ as g,T as h,x as i};
|
|
2
|
+
//# sourceMappingURL=chunk-BNXTJUKB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-BLUT4E4X.mjs";import{a as o}from"./chunk-OJV6XRG5.mjs";import{a as e,b as t}from"./chunk-YHMACRBE.mjs";import{WebviewProvider as a}from"@multiversx/sdk-webview-provider/out/WebviewProvider";var n=class extends s{constructor(r){super(r?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async r=>{if(!this.provider)throw new Error("Provider is not initialized.");try{return await this.provider.signTransactions(r)||[]}catch(i){throw this.cancelAction(),i}};this.signMessage=async r=>{if(!this.provider)throw new Error("Provider is not initialized.");try{return await this.provider.signMessage(r)}catch(i){throw this.cancelAction(),i}};this.provider=a.getInstance({resetStateCallback:()=>{e.localStorage?.clear?.(),e.sessionStorage?.clear?.()}}),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}logout(){return this.provider.logout()}getType(){return o.webview}getAddress(){throw new Error("Method not implemented.")}setAccount(r){return this.provider.setAccount(r)}isInitialized(){return this.provider.isInitialized()}async initializeProvider(){let r=await this.provider.init(t);return this.address&&this.setAccount({address:this.address}),r}};export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BXVBXZH7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-UCBZMZRZ.mjs";async function g({originalLoginToken:i,extraInfoData:n,address:o}){let e=await t({loginToken:i,extraInfoData:n}),s=n.multisig||n.impersonate||o;return{address:e!=null?s:o,modifiedLoginToken:e}}export{g as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CQ5BPNNC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{t as n}from"./chunk-AZZGWDJJ.mjs";import{a as i}from"./chunk-OJV6XRG5.mjs";var e=async()=>{let o=n();if(o.getType()===i.crossWindow){let r=o;await r.cancelAction(),await r.dispose()}};export{e as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CX4M2FWA.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-723RNU3D.mjs";import{a as f}from"./chunk-AUKTTMNB.mjs";import{a as g}from"./chunk-Y5KHGHSJ.mjs";import{b as a}from"./chunk-KBPWIUOX.mjs";import{c as s,g as r}from"./chunk-R53MCZI6.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-DIQ43LWV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-TQA3JDNV.mjs";import{u as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-TQA3JDNV.mjs";import{u as s}from"./chunk-KBPWIUOX.mjs";import{e as a}from"./chunk-QJSB5NX4.mjs";function x(n){let e=s(),o=u(e),c=a(e),t=Object.keys(o).map(Number).reduce((r,m)=>{let i=o[m]?.transactions||[];return Math.max(r,...i.map(l=>l.nonce),0)},0);return t>0&&(t+=1),n==null?Math.max(t,c):Math.max(t||n.nonce,c)}export{x as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DQQNQQJI.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as o,c as i}from"./chunk-QJGFIK7H.mjs";import{t as g}from"./chunk-AZZGWDJJ.mjs";import{s as u}from"./chunk-KBPWIUOX.mjs";import{a as p}from"./chunk-QJSB5NX4.mjs";import{a as h,c as l,g as c}from"./chunk-R53MCZI6.mjs";import{a as y}from"./chunk-YHMACRBE.mjs";var M=class{constructor({onLoginCancelled:e}){this.handlers=new Map;this.store=u();this.isLoginInitiated=!1;this.handleMessage=this.handleMessage.bind(this),this.handleLoginCancelled=e}startListening(){y.addEventListener("message",this.handleMessage)}stopListening(){y.removeEventListener("message",this.handleMessage)}registerEvent(e,s){this.handlers.set(e,s)}unregisterEvent(e){this.handlers.delete(e)}async handleMessage(e){let s=e.data?.type;if(typeof s=="string"&&this.handlers.has(s))return this.handlers.get(s)?.(e);switch(s){case o.finalizeHandshakeRequest:this.handshake({event:e});break;case o.signMessageRequest:this.signMessage({event:e,payload:e.data.payload});break;case o.loginRequest:this.isLoginInitiated=!0,this.login({event:e,payload:e.data.payload});break;case o.signTransactionsRequest:this.signTransactions({event:e});break;case i.cancelResponse:case"cancelAction":this.isLoginInitiated&&await this.handleLoginCancelled();break;default:break}}async login({event:e,payload:s}){let a=s?.token;if(a)try{let{address:t}=p(this.store.getState()),r=g(),n=new c({address:new l(t),data:new Uint8Array(Buffer.from(a))}),d=(await r.signMessage(n))?.signature??"";e.source?.postMessage({type:i.loginResponse,payload:{data:{address:t,signature:Buffer.from(d).toString("hex")}}},{targetOrigin:e.origin})}catch{this.isLoginInitiated&&this.handleLoginCancelled()}finally{this.isLoginInitiated=!1}}handshake({event:e}){let s=Date.now().toString();e.source?.postMessage({type:i.finalizeHandshakeResponse,payload:{data:s}},{targetOrigin:e.origin})}async signMessage({event:e,payload:s}){let{address:a}=p(this.store.getState()),{message:t}=s;try{let r=new c({address:new l(a),data:new Uint8Array(Buffer.from(t))}),d=(await g().signMessage(r))?.signature??"";e.source?.postMessage({type:i.signMessageResponse,payload:{data:{signature:Buffer.from(d).toString("hex"),status:"signed"}}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign message")}}async signTransactions({event:e}){let s=g(),{payload:a}=e.data;if(Array.isArray(a))try{let t=a.map(n=>h.newFromPlainObject(n)),r=await s.signTransactions(t);e.source?.postMessage({type:i.signTransactionsResponse,payload:{data:r.map(n=>n.toPlainObject())}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign transactions")}}};export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FJ7YXFLR.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.ts"],
|
|
4
|
+
"sourcesContent": ["import { safeWindow } from 'constants/index';\nimport { Address, Message, Transaction } from 'lib/sdkCore';\nimport {\n WindowProviderRequestEnums,\n WindowProviderResponseEnums,\n RequestMessageType,\n RequestPayloadType\n} from 'lib/sdkWebWalletCrossWindowProvider';\nimport { getAccountProvider } from 'providers/helpers/accountProvider';\nimport { accountSelector } from 'store/selectors';\nimport { getStore } from 'store/store';\n\ntype MessageHandler = (event: MessageEvent) => void;\n\ntype MessageEventType = {\n event: MessageEvent<MessageType>;\n};\n\ntype MessageType =\n | RequestMessageType\n | { type: 'cancelAction'; payload: null }\n | {\n type: WindowProviderResponseEnums.cancelResponse;\n payload: null;\n };\n\nexport class WebviewClient {\n private readonly handlers: Map<string, MessageHandler> = new Map();\n private readonly store = getStore();\n private isLoginInitiated = false;\n private readonly handleLoginCancelled: () => Promise<void>;\n\n constructor({ onLoginCancelled }: { onLoginCancelled: () => Promise<void> }) {\n this.handleMessage = this.handleMessage.bind(this);\n this.handleLoginCancelled = onLoginCancelled;\n }\n\n public startListening() {\n safeWindow.addEventListener('message', this.handleMessage);\n }\n\n public stopListening() {\n safeWindow.removeEventListener('message', this.handleMessage);\n }\n\n public registerEvent(type: string, handler: MessageHandler) {\n this.handlers.set(type, handler);\n }\n\n public unregisterEvent(type: string) {\n this.handlers.delete(type);\n }\n\n private async handleMessage(event: MessageEvent<MessageType>) {\n const type = event.data?.type;\n\n if (typeof type === 'string' && this.handlers.has(type)) {\n const handler = this.handlers.get(type);\n return handler?.(event);\n }\n\n switch (type) {\n case WindowProviderRequestEnums.finalizeHandshakeRequest:\n this.handshake({ event });\n break;\n case WindowProviderRequestEnums.signMessageRequest:\n this.signMessage({ event, payload: event.data.payload });\n break;\n case WindowProviderRequestEnums.loginRequest:\n this.isLoginInitiated = true;\n this.login({ event, payload: event.data.payload });\n break;\n case WindowProviderRequestEnums.signTransactionsRequest:\n this.signTransactions({ event });\n break;\n case WindowProviderResponseEnums.cancelResponse: // sent by web-wallet CrossWindow provider\n case 'cancelAction': // sent by Extension provider\n if (this.isLoginInitiated) {\n await this.handleLoginCancelled();\n }\n break;\n default:\n break;\n }\n }\n\n private async login({\n event,\n payload\n }: MessageEventType & { payload: RequestPayloadType['LOGIN_REQUEST'] }) {\n const loginToken = payload?.token;\n\n if (!loginToken) {\n return;\n }\n\n try {\n const { address } = accountSelector(this.store.getState());\n const provider = getAccountProvider();\n\n const messageToSign = new Message({\n address: new Address(address),\n data: new Uint8Array(Buffer.from(loginToken))\n });\n\n const signedMessage = await provider.signMessage(messageToSign);\n const signature = signedMessage?.signature ?? '';\n\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.loginResponse,\n payload: {\n data: {\n address,\n signature: Buffer.from(signature).toString('hex')\n }\n }\n },\n { targetOrigin: event.origin }\n );\n } catch {\n if (this.isLoginInitiated) {\n this.handleLoginCancelled();\n }\n } finally {\n this.isLoginInitiated = false;\n }\n }\n\n private handshake({ event }: MessageEventType) {\n const handshakeSession = Date.now().toString();\n\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.finalizeHandshakeResponse,\n payload: { data: handshakeSession }\n },\n { targetOrigin: event.origin }\n );\n }\n\n private async signMessage({\n event,\n payload\n }: MessageEventType & {\n payload: RequestPayloadType['SIGN_MESSAGE_REQUEST'];\n }) {\n const { address } = accountSelector(this.store.getState());\n const { message } = payload;\n\n try {\n const messageToSign = new Message({\n address: new Address(address),\n data: new Uint8Array(Buffer.from(message))\n });\n\n const provider = getAccountProvider();\n const signedMessage = await provider.signMessage(messageToSign);\n const signature = signedMessage?.signature ?? '';\n\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.signMessageResponse,\n payload: {\n data: {\n signature: Buffer.from(signature).toString('hex'),\n status: 'signed'\n }\n }\n },\n { targetOrigin: event.origin }\n );\n } catch {\n throw new Error('Could not sign message');\n }\n }\n\n private async signTransactions({ event }: MessageEventType) {\n const provider = getAccountProvider();\n const { payload } = event.data;\n\n if (!Array.isArray(payload)) {\n return;\n }\n\n try {\n const transactions = payload.map((plainTransactionObject) =>\n Transaction.newFromPlainObject(plainTransactionObject)\n );\n\n const signedTx = await provider.signTransactions(transactions);\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.signTransactionsResponse,\n payload: {\n data: signedTx.map((tx) => tx.toPlainObject())\n }\n },\n { targetOrigin: event.origin }\n );\n } catch {\n throw new Error('Could not sign transactions');\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "2QA0BO,IAAMA,EAAN,KAAoB,CAMzB,YAAY,CAAE,iBAAAC,CAAiB,EAA8C,CAL7E,KAAiB,SAAwC,IAAI,IAC7D,KAAiB,MAAQC,EAAS,EAClC,KAAQ,iBAAmB,GAIzB,KAAK,cAAgB,KAAK,cAAc,KAAK,IAAI,EACjD,KAAK,qBAAuBD,CAC9B,CAEO,gBAAiB,CACtBE,EAAW,iBAAiB,UAAW,KAAK,aAAa,CAC3D,CAEO,eAAgB,CACrBA,EAAW,oBAAoB,UAAW,KAAK,aAAa,CAC9D,CAEO,cAAcC,EAAcC,EAAyB,CAC1D,KAAK,SAAS,IAAID,EAAMC,CAAO,CACjC,CAEO,gBAAgBD,EAAc,CACnC,KAAK,SAAS,OAAOA,CAAI,CAC3B,CAEA,MAAc,cAAcE,EAAkC,CAC5D,IAAMF,EAAOE,EAAM,MAAM,KAEzB,GAAI,OAAOF,GAAS,UAAY,KAAK,SAAS,IAAIA,CAAI,EAEpD,OADgB,KAAK,SAAS,IAAIA,CAAI,IACrBE,CAAK,EAGxB,OAAQF,EAAM,CACZ,KAAKG,EAA2B,yBAC9B,KAAK,UAAU,CAAE,MAAAD,CAAM,CAAC,EACxB,MACF,KAAKC,EAA2B,mBAC9B,KAAK,YAAY,CAAE,MAAAD,EAAO,QAASA,EAAM,KAAK,OAAQ,CAAC,EACvD,MACF,KAAKC,EAA2B,aAC9B,KAAK,iBAAmB,GACxB,KAAK,MAAM,CAAE,MAAAD,EAAO,QAASA,EAAM,KAAK,OAAQ,CAAC,EACjD,MACF,KAAKC,EAA2B,wBAC9B,KAAK,iBAAiB,CAAE,MAAAD,CAAM,CAAC,EAC/B,MACF,KAAKE,EAA4B,eACjC,IAAK,eACC,KAAK,kBACP,MAAM,KAAK,qBAAqB,EAElC,MACF,QACE,KACJ,CACF,CAEA,MAAc,MAAM,CAClB,MAAAF,EACA,QAAAG,CACF,EAAwE,CACtE,IAAMC,EAAaD,GAAS,MAE5B,GAAKC,EAIL,GAAI,CACF,GAAM,CAAE,QAAAC,CAAQ,EAAIC,EAAgB,KAAK,MAAM,SAAS,CAAC,EACnDC,EAAWC,EAAmB,EAE9BC,EAAgB,IAAIC,EAAQ,CAChC,QAAS,IAAIC,EAAQN,CAAO,EAC5B,KAAM,IAAI,WAAW,OAAO,KAAKD,CAAU,CAAC,CAC9C,CAAC,EAGKQ,GADgB,MAAML,EAAS,YAAYE,CAAa,IAC7B,WAAa,GAE9CT,EAAM,QAAQ,YACZ,CACE,KAAME,EAA4B,cAClC,QAAS,CACP,KAAM,CACJ,QAAAG,EACA,UAAW,OAAO,KAAKO,CAAS,EAAE,SAAS,KAAK,CAClD,CACF,CACF,EACA,CAAE,aAAcZ,EAAM,MAAO,CAC/B,CACF,MAAQ,CACF,KAAK,kBACP,KAAK,qBAAqB,CAE9B,QAAE,CACA,KAAK,iBAAmB,EAC1B,CACF,CAEQ,UAAU,CAAE,MAAAA,CAAM,EAAqB,CAC7C,IAAMa,EAAmB,KAAK,IAAI,EAAE,SAAS,EAE7Cb,EAAM,QAAQ,YACZ,CACE,KAAME,EAA4B,0BAClC,QAAS,CAAE,KAAMW,CAAiB,CACpC,EACA,CAAE,aAAcb,EAAM,MAAO,CAC/B,CACF,CAEA,MAAc,YAAY,CACxB,MAAAA,EACA,QAAAG,CACF,EAEG,CACD,GAAM,CAAE,QAAAE,CAAQ,EAAIC,EAAgB,KAAK,MAAM,SAAS,CAAC,EACnD,CAAE,QAAAQ,CAAQ,EAAIX,EAEpB,GAAI,CACF,IAAMM,EAAgB,IAAIC,EAAQ,CAChC,QAAS,IAAIC,EAAQN,CAAO,EAC5B,KAAM,IAAI,WAAW,OAAO,KAAKS,CAAO,CAAC,CAC3C,CAAC,EAIKF,GADgB,MADLJ,EAAmB,EACC,YAAYC,CAAa,IAC7B,WAAa,GAE9CT,EAAM,QAAQ,YACZ,CACE,KAAME,EAA4B,oBAClC,QAAS,CACP,KAAM,CACJ,UAAW,OAAO,KAAKU,CAAS,EAAE,SAAS,KAAK,EAChD,OAAQ,QACV,CACF,CACF,EACA,CAAE,aAAcZ,EAAM,MAAO,CAC/B,CACF,MAAQ,CACN,MAAM,IAAI,MAAM,wBAAwB,CAC1C,CACF,CAEA,MAAc,iBAAiB,CAAE,MAAAA,CAAM,EAAqB,CAC1D,IAAMO,EAAWC,EAAmB,EAC9B,CAAE,QAAAL,CAAQ,EAAIH,EAAM,KAE1B,GAAK,MAAM,QAAQG,CAAO,EAI1B,GAAI,CACF,IAAMY,EAAeZ,EAAQ,IAAKa,GAChCC,EAAY,mBAAmBD,CAAsB,CACvD,EAEME,EAAW,MAAMX,EAAS,iBAAiBQ,CAAY,EAC7Df,EAAM,QAAQ,YACZ,CACE,KAAME,EAA4B,yBAClC,QAAS,CACP,KAAMgB,EAAS,IAAKC,GAAOA,EAAG,cAAc,CAAC,CAC/C,CACF,EACA,CAAE,aAAcnB,EAAM,MAAO,CAC/B,CACF,MAAQ,CACN,MAAM,IAAI,MAAM,6BAA6B,CAC/C,CACF,CACF",
|
|
6
|
+
"names": ["WebviewClient", "onLoginCancelled", "getStore", "safeWindow", "type", "handler", "event", "WindowProviderRequestEnums", "WindowProviderResponseEnums", "payload", "loginToken", "address", "accountSelector", "provider", "getAccountProvider", "messageToSign", "Message", "Address", "signature", "handshakeSession", "message", "transactions", "plainTransactionObject", "Transaction", "signedTx", "tx"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-4KJY3OZX.mjs";import{a as c}from"./chunk-B66LO7IY.mjs";import{a}from"./chunk-YUFPUG5O.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-FWGDNIZQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-QPUDE423.mjs";import{b as r}from"./chunk-OHNNBFUT.mjs";import{u as i}from"./chunk-KBPWIUOX.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-G2NFRNAJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{u as r}from"./chunk-KBPWIUOX.mjs";import{b as e}from"./chunk-SAAOQW7P.mjs";var d=s=>{let o=e(r()),t=s??o.apiAddress;return t.endsWith("/")?t.slice(0,-1):t};export{d as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HFPV65CE.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-X6MN67NW.mjs";import{u as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-X6MN67NW.mjs";import{u as m}from"./chunk-KBPWIUOX.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-IDJWUOKG.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-4CPZBG2V.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-IM453HJT.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-L3MWDI6J.mjs";import{s as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-L3MWDI6J.mjs";import{s as i}from"./chunk-KBPWIUOX.mjs";var g=({transactions:s,transactionsDisplayInfo:a,status:e,sessionInformation:t})=>{let o=Date.now().toString();return i().setState(({transactions:n})=>{n[o]={transactions:s,status:e,transactionsDisplayInfo:a,interpretedTransactions:{},sessionInformation:t}},!1,"createTransactionsSession"),o},T=({sessionId:s,status:a,errorMessage:e})=>{i().setState(({transactions:t})=>{t[s].status=a,t[s].errorMessage=e},!1,"updateTransactionsSession")},y=({sessionId:s,transaction:a})=>{let e=null;return i().setState(({transactions:t})=>{let o=t[s]?.transactions;if(o!=null){t[s].transactions=o.map(r=>r.hash===a.hash?{...r,...a??{}}:r);let n=u([...t[s].transactions]);n&&(T({sessionId:s,status:n}),e=n)}},!1,"updateTransactionStatus"),e},h=()=>{i().setState(({transactions:s,toasts:a})=>{let t=Object.keys(s).filter(n=>{let r=s[n];if(!r)return!1;let{status:c}=r;return!(c==="pending"||c==="signed"||c==="sent")});t.forEach(n=>{delete s[n]});let o=a.transactionToasts.filter(n=>!t.includes(n.toastId));a.transactionToasts=o},!1,"clearCompletedTransactions")};export{g as a,T as b,y as c,h as d};
|
|
2
|
+
//# sourceMappingURL=chunk-IS5U7IFK.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-ODLJWUOF.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-IX4263FY.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as B}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as B}from"./chunk-XHZMMMVI.mjs";import{a as b}from"./chunk-CX4M2FWA.mjs";import{a as k}from"./chunk-QXC4D3AC.mjs";import{a as R}from"./chunk-OD4ANAAQ.mjs";import{a as D}from"./chunk-JFWY3CDU.mjs";import{a as I}from"./chunk-AV4HSXYZ.mjs";import{a as j}from"./chunk-YTFYVPZO.mjs";import{a as _}from"./chunk-XXLXF6MW.mjs";import{a as A}from"./chunk-TSXYU7PO.mjs";import{a as O}from"./chunk-ZP3XYUAJ.mjs";import{u as x}from"./chunk-KBPWIUOX.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-J4CPYFK6.mjs";import{a as w}from"./chunk-R53MCZI6.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard:E,username:h}}=B(),g=v(x()),C=O(),{allTransactions:e,parsedTransactionsByDataField:L}=R(z),p=[],n=A.getInstance();if(await n.openUI(),!n)throw new Error("Unable to establish connection with sign screens");let W=async()=>{await b(),n.closeUI()};return n.subscribeToEventBus("CLOSE_SIGN_TRANSACTIONS",W),new Promise(async(X,M)=>{let d=[],Y=await k({baseURL:g.apiAddress});n.notifyDataUpdate(),n.initializeGasPriceMap(e.map(t=>t.transaction));let l=Y?.price,a=0,T=async()=>{let c=e[a]?.transaction,i=Number(c.nonce);try{n.updateIsLoading(!0);let{commonData:r,tokenTransaction:o,fungibleTransaction:s}=await D({allTransactions:e,currentScreenIndex:a,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:h,shard:E,signedIndexes:p,parsedTransactionsByDataField:L});o&&n.updateTokenTransaction(o),s&&n.updateNonFungibleTransaction(s.type,s),n.updateCommonData(r)}catch(r){console.error(`Error fetching common data for transaction at index ${a}:`,r)}finally{n.updateIsLoading(!1)}},$=()=>{a>0&&(a--,T())},q=(t=0)=>{let i=e[a].transaction,r=Number(i.nonce);n.updateGasPriceMap({nonce:r,ppu:t}),n.updateCommonData({ppu:t});let o=i.toPlainObject(),s=I({transaction:o,gasPriceData:n.ppuMap[r]}),P=w.newFromPlainObject({...o,gasPrice:s}),u=j({transaction:P,price:l}),m=F({input:s.toString(),decimals:U,addCommas:!0,digits:G});n.updateCommonData({feeLimit:u.feeLimitFormatted,feeInFiatLimit:u.feeInFiatLimit,gasPrice:m,ppu:t})},J=async()=>{M(new Error("Transaction signing cancelled by user")),await b(),n.closeUI()},f=()=>{a<n.transactionsCount-1&&(a++,T())},Q=async()=>{let c=e[a].transaction,i=Number(c.nonce),{commonData:r}=await D({allTransactions:e,currentScreenIndex:a,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:h,shard:E,signedIndexes:p,parsedTransactionsByDataField:L});if(!r.needsSigning)return p.push(a),f();let o=c.toPlainObject(),s=o.nonce,P=I({transaction:o,gasPriceData:n.ppuMap[s]}),u=w.newFromPlainObject({...o,gasPrice:P});try{let m=await H([u]);m&&(p.push(a),d.push(m[0]));let nn=a===e.length-1,an=e.filter(S=>S.needsSigning),tn=d.length===an.length;if(nn&&tn){let S=await K(d);return n.closeUI(),X(S)}f()}catch(m){n.closeUI(),M(m)}},V=new Map([["NEXT_SIGN_TRANSACTIONS",f],["CONFIRM_SIGN_TRANSACTIONS",Q],["CLOSE_SIGN_TRANSACTIONS",J],["BACK_SIGN_TRANSACTIONS",$],["SET_PPU_SIGN_TRANSACTIONS",q]]);function Z(){for(let[t,c]of V)n.subscribeToEventBus(t,c)}Z(),await T()})}export{Dn as a};
|
|
2
|
+
//# sourceMappingURL=chunk-J2B2Q7FE.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as V}from"./chunk-7Z7IX367.mjs";import{a as B}from"./chunk-VCQBYNNS.mjs";import{a as $}from"./chunk-O3V4TGXK.mjs";import{a as _}from"./chunk-AV4HSXYZ.mjs";import{a as U}from"./chunk-RBZC4PEU.mjs";import{a as R}from"./chunk-ROZAXUMC.mjs";import{a as M}from"./chunk-BETSOJFK.mjs";import{a as w}from"./chunk-YTFYVPZO.mjs";import{a as O}from"./chunk-YGI3KXMZ.mjs";import{a as x}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as V}from"./chunk-7Z7IX367.mjs";import{a as B}from"./chunk-VCQBYNNS.mjs";import{a as $}from"./chunk-O3V4TGXK.mjs";import{a as _}from"./chunk-AV4HSXYZ.mjs";import{a as U}from"./chunk-RBZC4PEU.mjs";import{a as R}from"./chunk-ROZAXUMC.mjs";import{a as M}from"./chunk-BETSOJFK.mjs";import{a as w}from"./chunk-YTFYVPZO.mjs";import{a as O}from"./chunk-YGI3KXMZ.mjs";import{a as x}from"./chunk-WLZAOIT2.mjs";import{a as v}from"./chunk-RYIJWGFA.mjs";import{t as G}from"./chunk-AZZGWDJJ.mjs";import{a as L}from"./chunk-6PJBC5FX.mjs";import{a as h}from"./chunk-BRJNX4JF.mjs";import{a as b,c as C,f as u}from"./chunk-J4CPYFK6.mjs";import{a as P}from"./chunk-KD2IQ32V.mjs";import{c as f}from"./chunk-TI37DKBT.mjs";import{k as A}from"./chunk-LHEH7L4L.mjs";import{a as F}from"./chunk-YHMACRBE.mjs";import{BigNumber as yt}from"bignumber.js";async function Kt({allTransactions:T,currentScreenIndex:m,egldLabel:o,network:e,gasPriceData:c,price:S,address:p,username:z,shard:j,signedIndexes:i,parsedTransactionsByDataField:q}){let t=T[m],H=t?.transaction?.sender.toString(),K=t?.transaction,D=null,y=null,W=R({egldLabel:o,sender:H,apiAddress:e.apiAddress,address:p,parsedTransactionsByDataField:q}),a=t.transaction.toPlainObject(),n=await W(t),d=!n?.transactionTokenInfo?.tokenId,{tokenId:g,nonce:l,amount:I=""}=n?.transactionTokenInfo??{},Z=g&&l&&l.length>0?`${g}-${l}`:g,J=await x({tokenId:Z}),{esdtPrice:Q,tokenDecimals:X,type:r,identifier:s,tokenImageUrl:Y}=J;if(r==="SemiFungibleESDT"||r==="NonFungibleESDT")y={type:r,identifier:s,amount:I,imageURL:Y};else{let E=({addCommas:Dt})=>u({input:d?t.transaction.value.toString():I,decimals:d?Number(e.decimals):X,digits:Number(e.digits),showLastNonZeroDecimal:!1,addCommas:Dt}),ut=E({addCommas:!0}),ft=E({addCommas:!1}),Tt=Number(d?S:Q),St=O({amount:ft,usd:Tt,addEqualSign:!0});D={identifier:(s===A?o:s)??o,amount:ut,usdValue:St}}let{feeLimitFormatted:tt,feeInFiatLimit:nt}=w({transaction:K,price:S}),ot=$({shard:j,initialGasPrice:c.initialGasPrice,transaction:a,gasStationMetadata:e.gasStationMetadata}),et=_({transaction:a,gasPriceData:c}),it=G().getType(),at=v(it),N=T.length,rt=i.length>0?i[i.length-1]+1:0,st=f(t.transaction.data.toString()??""),k=U(n?.transactionTokenInfo),mt=M({data:st,identifier:s,highlight:k}),ct=L(),pt=h({to:`/${P}/${p}`,explorerAddress:ct}),dt=N===1||n?.needsSigning&&!i.includes(m),gt=u({input:et.toString(),decimals:C,addCommas:!0,digits:b}),lt=new yt(a.gasLimit).toFormat({decimalSeparator:",",groupSeparator:".",groupSize:3});return{commonData:{receiver:a.receiver.toString(),data:f(t.transaction.data.toString()??""),decodedData:mt,gasPrice:gt,gasLimit:lt,explorerLink:pt,ppu:c.ppu,ppuOptions:ot,egldLabel:o,tokenType:V(r),feeLimit:tt,feeInFiatLimit:nt,transactionsCount:N,currentIndex:m,currentIndexToSign:rt,highlight:k,scCall:B(n?.transactionTokenInfo),needsSigning:dt,isEditable:n?.needsSigning,providerName:at,address:p,username:z,origin:F.location?.origin},tokenTransaction:D,fungibleTransaction:y}}export{Kt as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JFWY3CDU.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-YHMACRBE.mjs";import{createJSONStorage as o}from"zustand/middleware";var r={persistReducersStorageType:"localStorage"},i=e?o(()=>e[r.persistReducersStorageType]):void 0,p=new Map;export{r as a,i as b,p as c};
|
|
2
|
+
//# sourceMappingURL=chunk-JQRAWQ6I.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-OTHJXSH5.mjs";import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as f}from"./chunk-Y3BNMQFP.mjs";import{h as l}from"./chunk-AZZGWDJJ.mjs";import{h as d}from"./chunk-CAA4VJRH.mjs";import{b as g}from"./chunk-3ZEUVYQF.mjs";import{a as u}from"./chunk-IS5U7IFK.mjs";import{a as m}from"./chunk-L3MWDI6J.mjs";import{a as y}from"./chunk-723RNU3D.mjs";import{u as p}from"./chunk-KBPWIUOX.mjs";import{b as c}from"./chunk-SAAOQW7P.mjs";import{e as T}from"./chunk-R53MCZI6.mjs";import b from"axios";var r=class r{constructor(){this.setCallbacks=({onSuccess:a,onFail:t})=>{g({onSuccess:a,onFail:t})};this.send=async a=>{if(a.length===0)throw new Error("No transactions to send");try{if(!S(a))return await this.sendSignedTransactions(a);let t=await this.sendSignedBatchTransactions(a);if(!t.data||t.data.error)throw new Error(t.data?.error??"Failed to send transactions");return t.data.transactions}catch(t){throw t.response?.data?.message??t.message}};this.track=async(a,t={disableToasts:!1})=>{let n=this.sequentialToFlatArray(a).map(i=>({...i,status:i.status??"pending"})),e=m(n),o=u({transactions:n,transactionsDisplayInfo:t.transactionsDisplayInfo,status:e??"sent",sessionInformation:t.sessionInformation});if(t.disableToasts===!0)return o;let s=h(a);return l({toastId:o,totalDuration:s}),o};this.sendSignedTransactions=async a=>{let{apiAddress:t,apiTimeout:n}=c(p()),e=a.map(s=>b.post(`${t}/transactions`,s.toPlainObject(),{timeout:Number(n)}));return(await Promise.all(e)).map(({data:s})=>({...s,status:"pending",hash:s.txHash}))};this.sendSignedBatchTransactions=async a=>{let{address:t}=y(),{apiAddress:n,apiTimeout:e}=c(p());if(!t)return{error:"Invalid address provided. You need to be logged in to send transactions"};let o=this.buildBatchId(t),i={transactions:a.map(w=>w.map(v=>this.parseSignedTransaction(v))),id:o},{data:A}=await b.post(`${n}/batch`,i,{timeout:Number(e)});return{data:A}};this.buildBatchId=a=>`${Date.now().toString()}${d}${a}`;this.sequentialToFlatArray=(a=[])=>this.getIsSequential(a)?a.flat():a;this.getIsSequential=a=>a?.every(t=>Array.isArray(t));this.parseSignedTransaction=a=>{let t=new T,n={...a.toPlainObject(),hash:t.computeTransactionHash(a),status:"pending"};return f({data:n.data})&&(delete n.senderUsername,delete n.receiverUsername),n}}static getInstance(){return r.instance||(r.instance=new r),r.instance}};r.instance=null;var I=r;export{I as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JRE74AMH.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-YHMACRBE.mjs";function t(){if(!e)return"";try{if(e.document.referrer)return new URL(e.document.referrer).origin;let r=e.location.ancestorOrigins;return r.length<1?"":new URL(r[r.length-1]).origin}catch(r){return console.error(r),""}}export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JUN43Y67.mjs.map
|