@multiversx/sdk-dapp 5.0.6 → 5.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/out/__chunks__/{chunk-QJBNDKHF.mjs → chunk-2JDGOX23.mjs} +2 -2
- package/out/__chunks__/{chunk-NR34QIVY.mjs → chunk-2MQKUZ3H.mjs} +2 -2
- package/out/__chunks__/chunk-2R3RBEEL.mjs +2 -0
- package/out/__chunks__/{chunk-ZP2E2Y6Y.mjs → chunk-2UIRKC76.mjs} +2 -2
- package/out/__chunks__/{chunk-EWXBNG6L.mjs → chunk-2Z53M64I.mjs} +2 -2
- package/out/__chunks__/{chunk-L34S5ELK.mjs → chunk-32AIQ4N3.mjs} +2 -2
- package/out/__chunks__/{chunk-JXNX2DMF.mjs → chunk-34TZ56ZL.mjs} +2 -2
- package/out/__chunks__/{chunk-RO37MX5Y.mjs → chunk-3HMCWJHQ.mjs} +2 -2
- package/out/__chunks__/{chunk-QFW3NRHJ.mjs → chunk-42CVZ3GV.mjs} +2 -2
- package/out/__chunks__/chunk-47F7OLNB.mjs +2 -0
- package/out/__chunks__/{chunk-LD6GIQXR.mjs → chunk-5BLRRK4B.mjs} +2 -2
- package/out/__chunks__/{chunk-AZNMWFIR.mjs → chunk-5C2ZAHTB.mjs} +2 -2
- package/out/__chunks__/{chunk-3JMCXLWZ.mjs → chunk-5CABF4XT.mjs} +2 -2
- package/out/__chunks__/chunk-5Y4EYF6Z.mjs +2 -0
- package/out/__chunks__/{chunk-FSHVZP64.mjs → chunk-6JS7TNJC.mjs} +2 -2
- package/out/__chunks__/{chunk-UXJIZKTT.mjs → chunk-6Z4GXMSW.mjs} +2 -2
- package/out/__chunks__/{chunk-WCRS5CLZ.mjs → chunk-75WEAHW3.mjs} +2 -2
- package/out/__chunks__/{chunk-SGN6MYFW.mjs → chunk-7DP77WJU.mjs} +2 -2
- package/out/__chunks__/{chunk-QVOHFS6Q.mjs → chunk-A2W4YT2Y.mjs} +2 -2
- package/out/__chunks__/{chunk-EK3WITBG.mjs → chunk-AEZWP25S.mjs} +2 -2
- package/out/__chunks__/{chunk-YBLDHLHP.mjs → chunk-AJS7FS66.mjs} +2 -2
- package/out/__chunks__/chunk-APEM4HDI.mjs +2 -0
- package/out/__chunks__/chunk-ARV3XIYY.mjs +2 -0
- package/out/__chunks__/{chunk-7PW3YJZS.mjs → chunk-BVL47QTP.mjs} +2 -2
- package/out/__chunks__/{chunk-LJKBU76G.mjs → chunk-C754AWVZ.mjs} +2 -2
- package/out/__chunks__/{chunk-DDNM2ZMJ.mjs → chunk-CQAZ3LJW.mjs} +2 -2
- package/out/__chunks__/{chunk-Q5RVUCNS.mjs → chunk-E2ODPOVS.mjs} +2 -2
- package/out/__chunks__/chunk-F3LAQULB.mjs +2 -0
- package/out/__chunks__/{chunk-6IA3KJH5.mjs → chunk-F755MYC5.mjs} +2 -2
- package/out/__chunks__/{chunk-HVV5PW3F.mjs → chunk-FKFHOXVI.mjs} +2 -2
- package/out/__chunks__/chunk-FNMPZS4S.mjs +2 -0
- package/out/__chunks__/chunk-GHNNJ64D.mjs +2 -0
- package/out/__chunks__/chunk-GS33DJTW.mjs +2 -0
- package/out/__chunks__/{chunk-JLSMK3B2.mjs → chunk-H3EGIL75.mjs} +2 -2
- package/out/__chunks__/{chunk-H3IUSXHL.mjs → chunk-JLVA2UHR.mjs} +2 -2
- package/out/__chunks__/{chunk-IS62JDWR.mjs → chunk-JWGB5GYU.mjs} +2 -2
- package/out/__chunks__/chunk-KEBJ4ZXE.mjs +2 -0
- package/out/__chunks__/{chunk-T6PE5QT2.mjs → chunk-KMSI4FA6.mjs} +2 -2
- package/out/__chunks__/{chunk-7O5OCSV5.mjs → chunk-KRB3XH4K.mjs} +2 -2
- package/out/__chunks__/chunk-KXH4SFJV.mjs +2 -0
- package/out/__chunks__/{chunk-OYYE3JKS.mjs → chunk-LJBVZK5V.mjs} +2 -2
- package/out/__chunks__/{chunk-5MK24VWA.mjs → chunk-LJZO6JVX.mjs} +2 -2
- package/out/__chunks__/{chunk-N6IZYQLD.mjs → chunk-LZITSA2G.mjs} +2 -2
- package/out/__chunks__/{chunk-SNJZSRF3.mjs → chunk-MKHSCAMQ.mjs} +2 -2
- package/out/__chunks__/{chunk-JHG4SR7C.mjs → chunk-MMBSMAYP.mjs} +2 -2
- package/out/__chunks__/chunk-MONQ4RXB.mjs +2 -0
- package/out/__chunks__/{chunk-5ICRLXOJ.mjs.map → chunk-MONQ4RXB.mjs.map} +1 -1
- package/out/__chunks__/{chunk-ULT7BJCN.mjs → chunk-MTLAUGMZ.mjs} +2 -2
- package/out/__chunks__/{chunk-A2X4YMKK.mjs → chunk-MXKOONHC.mjs} +2 -2
- package/out/__chunks__/{chunk-P7KN75HA.mjs → chunk-N3NTEUD2.mjs} +2 -2
- package/out/__chunks__/{chunk-PPRG5EYX.mjs → chunk-N6MC53DJ.mjs} +2 -2
- package/out/__chunks__/{chunk-W5LWBGZ4.mjs → chunk-NBZUJ5VZ.mjs} +2 -2
- package/out/__chunks__/{chunk-7MSBLQYN.mjs → chunk-NHDP33GP.mjs} +2 -2
- package/out/__chunks__/chunk-NJB4MIRD.mjs +2 -0
- package/out/__chunks__/{chunk-6EW6GJ7V.mjs → chunk-NKLRQJVY.mjs} +2 -2
- package/out/__chunks__/chunk-NNNFX3FU.mjs +2 -0
- package/out/__chunks__/{chunk-ER7VDELK.mjs → chunk-OWNMDLKO.mjs} +2 -2
- package/out/__chunks__/{chunk-6QSLQLCT.mjs → chunk-P6TVAEN3.mjs} +2 -2
- package/out/__chunks__/{chunk-GNF74ZRR.mjs → chunk-PQYZODUA.mjs} +2 -2
- package/out/__chunks__/{chunk-UV4LRORN.mjs → chunk-QMO7HUJF.mjs} +2 -2
- package/out/__chunks__/{chunk-WWNT4K25.mjs → chunk-RDPREOPG.mjs} +2 -2
- package/out/__chunks__/chunk-RUARSP3Z.mjs +2 -0
- package/out/__chunks__/{chunk-OLXHHD4T.mjs → chunk-S6ZQLKKX.mjs} +2 -2
- package/out/__chunks__/chunk-SIHP75SP.mjs +2 -0
- package/out/__chunks__/{chunk-WNKKBV76.mjs → chunk-SNJKYJAD.mjs} +2 -2
- package/out/__chunks__/{chunk-X3BMMYMU.mjs → chunk-SVXVYH6P.mjs} +2 -2
- package/out/__chunks__/{chunk-43AE4SYE.mjs → chunk-T26S2V72.mjs} +2 -2
- package/out/__chunks__/chunk-TUT2EPC2.mjs +2 -0
- package/out/__chunks__/chunk-TUT2EPC2.mjs.map +7 -0
- package/out/__chunks__/{chunk-SUOUG7EQ.mjs → chunk-TYN5TMRZ.mjs} +2 -2
- package/out/__chunks__/{chunk-DNRFH2DR.mjs → chunk-TZ25MLSW.mjs} +2 -2
- package/out/__chunks__/{chunk-IHPROMZ4.mjs → chunk-UJDX67YT.mjs} +2 -2
- package/out/__chunks__/{chunk-MKIQ2XH4.mjs → chunk-V4H5P3MS.mjs} +2 -2
- package/out/__chunks__/{chunk-TJW7RKOI.mjs → chunk-VDDLODBL.mjs} +2 -2
- package/out/__chunks__/{chunk-XXILUGAY.mjs → chunk-VQFQUFLP.mjs} +2 -2
- package/out/__chunks__/{chunk-CAN6BBUW.mjs → chunk-VXWZLNHI.mjs} +2 -2
- package/out/__chunks__/chunk-WADOAKBZ.mjs +2 -0
- package/out/__chunks__/{chunk-FKIAOXUE.mjs → chunk-WIXDQ3KW.mjs} +2 -2
- package/out/__chunks__/{chunk-2UCZ5FCD.mjs → chunk-WWMW5EIR.mjs} +2 -2
- package/out/__chunks__/chunk-X6ITADSX.mjs +2 -0
- package/out/__chunks__/{chunk-Z3SM2MSZ.mjs → chunk-XY4G3LLQ.mjs} +2 -2
- package/out/__chunks__/{chunk-JD2VRDU7.mjs → chunk-YILAZW7P.mjs} +2 -2
- package/out/__chunks__/{chunk-GUPYIQ3X.mjs → chunk-YOJAS3PK.mjs} +2 -2
- package/out/__chunks__/{chunk-AHSGP7ST.mjs → chunk-Z7T2J6XD.mjs} +2 -2
- package/out/apiCalls/account/getScamAddressData.mjs +1 -1
- package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
- package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
- package/out/apiCalls/index.mjs +1 -1
- package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/index.mjs +1 -1
- package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
- package/out/constants/browser.constants.mjs +1 -1
- package/out/constants/index.mjs +1 -1
- package/out/constants/storage.constants.mjs +1 -1
- package/out/constants/window.constants.cjs +1 -1
- package/out/constants/window.constants.cjs.map +1 -1
- package/out/constants/window.constants.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
- package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
- package/out/controllers/TransactionsTableController/index.mjs +1 -1
- package/out/index.mjs +1 -1
- package/out/lib/sdkDappUi.mjs +1 -1
- package/out/managers/LogoutManager/LogoutManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/index.mjs +1 -1
- package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
- package/out/managers/TransactionManager/index.mjs +1 -1
- package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
- package/out/managers/UnlockPanelManager/index.mjs +1 -1
- package/out/managers/index.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
- package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
- package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/ToastManager/ToastManager.mjs +1 -1
- package/out/managers/internal/ToastManager/helpers/LifetimeManager.mjs +1 -1
- package/out/managers/internal/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
- package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
- package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.mjs +1 -1
- package/out/managers/internal/WalletConnectStateManager/index.mjs +1 -1
- package/out/managers/internal/index.mjs +1 -1
- package/out/methods/account/getAccount.mjs +1 -1
- package/out/methods/account/getAccountInfo.mjs +1 -1
- package/out/methods/account/getAddress.mjs +1 -1
- package/out/methods/account/getIsLoggedIn.mjs +1 -1
- package/out/methods/account/getLatestNonce.mjs +1 -1
- package/out/methods/initApp/gastStationMetadata/setGasStationMetadata.mjs +1 -1
- package/out/methods/initApp/initApp.mjs +1 -1
- package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
- package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
- package/out/methods/loginInfo/getLoginInfo.mjs +1 -1
- package/out/methods/network/getEgldLabel.mjs +1 -1
- package/out/methods/network/getExplorerAddress.mjs +1 -1
- package/out/methods/network/getNetworkConfig.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/index.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/manageFailedTransactions.mjs +1 -1
- package/out/methods/trackTransactions/helpers/getPollingInterval.mjs +1 -1
- package/out/methods/trackTransactions/trackTransactions.mjs +1 -1
- package/out/methods/transactions/getFailedTransactions.mjs +1 -1
- package/out/methods/transactions/getFailedTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getSuccessfulTransactions.mjs +1 -1
- package/out/methods/transactions/getSuccessfulTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getTransactionSessions.mjs +1 -1
- package/out/providers/DappProvider/DappProvider.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/extractAddressFromToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getAccountFromToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getModifiedLoginToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
- package/out/providers/DappProvider/helpers/logout/logout.mjs +1 -1
- package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
- package/out/providers/DappProvider/helpers/signMessage/signMessageWithProvider.mjs +1 -1
- package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
- package/out/providers/DappProvider/index.mjs +1 -1
- package/out/providers/ProviderFactory.mjs +1 -1
- package/out/providers/helpers/accountProvider.mjs +1 -1
- package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
- package/out/providers/helpers/restoreProvider.mjs +1 -1
- package/out/providers/index.mjs +1 -1
- package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
- package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
- package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.cjs +2 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.cjs.map +2 -2
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
- package/out/providers/strategies/helpers/index.mjs +1 -1
- package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/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 +1 -1
- package/out/__chunks__/chunk-2IXNUCCN.mjs +0 -2
- package/out/__chunks__/chunk-35BOKOST.mjs +0 -2
- package/out/__chunks__/chunk-35BOKOST.mjs.map +0 -7
- package/out/__chunks__/chunk-4JRZISC2.mjs +0 -2
- package/out/__chunks__/chunk-5ICRLXOJ.mjs +0 -2
- package/out/__chunks__/chunk-6IUQY6KG.mjs +0 -2
- package/out/__chunks__/chunk-6WQJAFR3.mjs +0 -2
- package/out/__chunks__/chunk-7AMGKXK6.mjs +0 -2
- package/out/__chunks__/chunk-7TVD3ZGR.mjs +0 -2
- package/out/__chunks__/chunk-AJVTGCVH.mjs +0 -2
- package/out/__chunks__/chunk-FKCGBCKV.mjs +0 -2
- package/out/__chunks__/chunk-HZUUV4N4.mjs +0 -2
- package/out/__chunks__/chunk-J7GHXLMR.mjs +0 -2
- package/out/__chunks__/chunk-JOVG7EB7.mjs +0 -2
- package/out/__chunks__/chunk-N7FAJ2VG.mjs +0 -2
- package/out/__chunks__/chunk-OA7DW77N.mjs +0 -2
- package/out/__chunks__/chunk-OAEQGL6W.mjs +0 -2
- package/out/__chunks__/chunk-QNJDXBR6.mjs +0 -2
- package/out/__chunks__/chunk-V53EFJQZ.mjs +0 -2
- package/out/__chunks__/chunk-ZFM5CMB7.mjs +0 -2
- /package/out/__chunks__/{chunk-QJBNDKHF.mjs.map → chunk-2JDGOX23.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NR34QIVY.mjs.map → chunk-2MQKUZ3H.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OAEQGL6W.mjs.map → chunk-2R3RBEEL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZP2E2Y6Y.mjs.map → chunk-2UIRKC76.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EWXBNG6L.mjs.map → chunk-2Z53M64I.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-L34S5ELK.mjs.map → chunk-32AIQ4N3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JXNX2DMF.mjs.map → chunk-34TZ56ZL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RO37MX5Y.mjs.map → chunk-3HMCWJHQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QFW3NRHJ.mjs.map → chunk-42CVZ3GV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-J7GHXLMR.mjs.map → chunk-47F7OLNB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LD6GIQXR.mjs.map → chunk-5BLRRK4B.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AZNMWFIR.mjs.map → chunk-5C2ZAHTB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3JMCXLWZ.mjs.map → chunk-5CABF4XT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6WQJAFR3.mjs.map → chunk-5Y4EYF6Z.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FSHVZP64.mjs.map → chunk-6JS7TNJC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UXJIZKTT.mjs.map → chunk-6Z4GXMSW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WCRS5CLZ.mjs.map → chunk-75WEAHW3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SGN6MYFW.mjs.map → chunk-7DP77WJU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QVOHFS6Q.mjs.map → chunk-A2W4YT2Y.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EK3WITBG.mjs.map → chunk-AEZWP25S.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YBLDHLHP.mjs.map → chunk-AJS7FS66.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HZUUV4N4.mjs.map → chunk-APEM4HDI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QNJDXBR6.mjs.map → chunk-ARV3XIYY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7PW3YJZS.mjs.map → chunk-BVL47QTP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LJKBU76G.mjs.map → chunk-C754AWVZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DDNM2ZMJ.mjs.map → chunk-CQAZ3LJW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Q5RVUCNS.mjs.map → chunk-E2ODPOVS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7TVD3ZGR.mjs.map → chunk-F3LAQULB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6IA3KJH5.mjs.map → chunk-F755MYC5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HVV5PW3F.mjs.map → chunk-FKFHOXVI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2IXNUCCN.mjs.map → chunk-FNMPZS4S.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-V53EFJQZ.mjs.map → chunk-GHNNJ64D.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6IUQY6KG.mjs.map → chunk-GS33DJTW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JLSMK3B2.mjs.map → chunk-H3EGIL75.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-H3IUSXHL.mjs.map → chunk-JLVA2UHR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IS62JDWR.mjs.map → chunk-JWGB5GYU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZFM5CMB7.mjs.map → chunk-KEBJ4ZXE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-T6PE5QT2.mjs.map → chunk-KMSI4FA6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7O5OCSV5.mjs.map → chunk-KRB3XH4K.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AJVTGCVH.mjs.map → chunk-KXH4SFJV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OYYE3JKS.mjs.map → chunk-LJBVZK5V.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5MK24VWA.mjs.map → chunk-LJZO6JVX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-N6IZYQLD.mjs.map → chunk-LZITSA2G.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SNJZSRF3.mjs.map → chunk-MKHSCAMQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JHG4SR7C.mjs.map → chunk-MMBSMAYP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ULT7BJCN.mjs.map → chunk-MTLAUGMZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-A2X4YMKK.mjs.map → chunk-MXKOONHC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-P7KN75HA.mjs.map → chunk-N3NTEUD2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PPRG5EYX.mjs.map → chunk-N6MC53DJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-W5LWBGZ4.mjs.map → chunk-NBZUJ5VZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7MSBLQYN.mjs.map → chunk-NHDP33GP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4JRZISC2.mjs.map → chunk-NJB4MIRD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6EW6GJ7V.mjs.map → chunk-NKLRQJVY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FKCGBCKV.mjs.map → chunk-NNNFX3FU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ER7VDELK.mjs.map → chunk-OWNMDLKO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6QSLQLCT.mjs.map → chunk-P6TVAEN3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GNF74ZRR.mjs.map → chunk-PQYZODUA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UV4LRORN.mjs.map → chunk-QMO7HUJF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WWNT4K25.mjs.map → chunk-RDPREOPG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-N7FAJ2VG.mjs.map → chunk-RUARSP3Z.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OLXHHD4T.mjs.map → chunk-S6ZQLKKX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OA7DW77N.mjs.map → chunk-SIHP75SP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WNKKBV76.mjs.map → chunk-SNJKYJAD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-X3BMMYMU.mjs.map → chunk-SVXVYH6P.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-43AE4SYE.mjs.map → chunk-T26S2V72.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SUOUG7EQ.mjs.map → chunk-TYN5TMRZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DNRFH2DR.mjs.map → chunk-TZ25MLSW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IHPROMZ4.mjs.map → chunk-UJDX67YT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MKIQ2XH4.mjs.map → chunk-V4H5P3MS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TJW7RKOI.mjs.map → chunk-VDDLODBL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XXILUGAY.mjs.map → chunk-VQFQUFLP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CAN6BBUW.mjs.map → chunk-VXWZLNHI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7AMGKXK6.mjs.map → chunk-WADOAKBZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FKIAOXUE.mjs.map → chunk-WIXDQ3KW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2UCZ5FCD.mjs.map → chunk-WWMW5EIR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JOVG7EB7.mjs.map → chunk-X6ITADSX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Z3SM2MSZ.mjs.map → chunk-XY4G3LLQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JD2VRDU7.mjs.map → chunk-YILAZW7P.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GUPYIQ3X.mjs.map → chunk-YOJAS3PK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AHSGP7ST.mjs.map → chunk-Z7T2J6XD.mjs.map} +0 -0
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ MultiversX Front-End SDK for JavaScript and TypeScript (written in TypeScript).
|
|
|
13
13
|
It is built for applications that use any of the following technologies:
|
|
14
14
|
|
|
15
15
|
- React (example: [React Template Dapp](https://github.com/multiversx/mx-template-dapp))
|
|
16
|
+
- React JS (example: [React JS Template Dapp](https://github.com/multiversx/mx-template-dapp-reactjs))
|
|
16
17
|
- Angular (example: [Angular Template Dapp](https://github.com/multiversx/mx-template-dapp-angular))
|
|
17
18
|
- Vue (example: [Vue Template Dapp](https://github.com/multiversx/mx-template-dapp-vue))
|
|
18
19
|
- Any other JavaScript framework (e.g. Solid.js etc.) (example: [Solid.js Dapp](https://github.com/multiversx/mx-solidjs-template-dapp))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-HBQQS6GA.mjs";import{u as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-HBQQS6GA.mjs";import{u as m}from"./chunk-YOJAS3PK.mjs";import{b as a}from"./chunk-SAAOQW7P.mjs";import{o as s,u as o}from"./chunk-KD2IQ32V.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";async function I({tokenId:n}){let t=a(m()),r={tokenDecimals:Number(t.decimals),tokenLabel:"",tokenImageUrl:""},{isNft:k}=c(n),i=n,p=k?s:o;if(!i)return r;try{let e=await g(`${t.apiAddress}/${p}/${i}`),l=e?e?.decimals:Number(t.decimals),f=e?e?.name:"",T=e?e?.assets?.svgUrl??e?.media?.[0]?.thumbnailUrl:"";return{tokenDecimals:l,tokenLabel:f,type:e?.type,tokenImageUrl:T,identifier:e?.identifier,assets:e?.assets,esdtPrice:e?.price,ticker:e?.ticker,name:e?.name}}catch(e){return{...r,error:`${e}`}}}export{I as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2JDGOX23.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-AJS7FS66.mjs";import{a as T}from"./chunk-XCVEFI4B.mjs";import{a as i}from"./chunk-W5MTQBQF.mjs";import{a as m}from"./chunk-FNYBJAH3.mjs";import{a as l}from"./chunk-U3UMCTU6.mjs";import{c as d}from"./chunk-PJWJZHIS.mjs";import{a as o}from"./chunk-UK5MEKBE.mjs";var p=class{static async processTransactions({address:u,egldLabel:v,explorerAddress:g,transactions:L}){let f=L.map(e=>m({address:u,explorerAddress:g,transaction:e}));return await Promise.all(f.map(async e=>{let s=e.receiverAssets?.name.replace(/\p{Emoji}/gu,""),a=e.senderAssets?.name.replace(/\p{Emoji}/gu,""),{senderLockedAccount:h,receiverLockedAccount:D}=await k({receiver:e.receiver,sender:e.sender,tokenId:e.tokenIdentifier}),{egldValueData:t,tokenValueData:n,nftValueData:r}=T({transaction:e}),x=r?.token.type==="MetaESDT"?void 0:r?.badgeText,c=l.getData({input:t?.value??n?.value??r?.value??"",decimals:t?.decimals??n?.decimals??r?.decimals??d,digits:2}),y={badge:x??void 0,collection:n?.token.collection??r?.token.collection,egldLabel:t?v:"",link:n?.tokenExplorerLink??r?.tokenExplorerLink,linkText:n?.tokenLinkText??r?.tokenLinkText,name:n?.token.name??r?.token.name,showFormattedAmount:!!(t||n?.tokenFormattedAmount||r?.tokenFormattedAmount),svgUrl:n?.token.svgUrl??r?.token.svgUrl,ticker:n?.token.ticker??r?.token.ticker,titleText:n?.titleText??r?.titleText,valueDecimal:c.valueDecimal,valueInteger:c.valueInteger},w=i(e.receiverShard),A=i(e.senderShard);return{age:e.transactionDetails.age,direction:e.transactionDetails.direction,method:e.transactionDetails.method,iconInfo:e.transactionDetails.iconInfo,link:e.links.transactionLink??"",txHash:e.txHash,receiver:{address:e.receiver,name:s??"",description:`${s??e.receiver} (${e.receiver})`,isContract:o(e.receiver),isTokenLocked:!!D,link:e.links.receiverLink??"",shard:w,shardLink:e.links.receiverLink,showLink:e.transactionDetails.direction!=="In"},sender:{address:e.sender,name:a??"",description:`${a??e.sender} (${e.sender})`,isContract:o(e.sender),isTokenLocked:!!h,link:e.links.senderLink??"",shard:A,shardLink:e.links.senderShardLink,showLink:e.transactionDetails.direction!=="Out"},value:y}}))}};export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2MQKUZ3H.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-FKBLKOLI.mjs";import{a as t}from"./chunk-U64LDJTG.mjs";import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-FKBLKOLI.mjs";import{a as t}from"./chunk-U64LDJTG.mjs";import{a as o}from"./chunk-F3LAQULB.mjs";import{u as n}from"./chunk-YOJAS3PK.mjs";import{b as e}from"./chunk-SAAOQW7P.mjs";var w=async r=>{let{isGuarded:s}=o();if(!i({isGuarded:s,transactions:r}))return r;let a=r[0].getSender().bech32().toString(),{walletAddress:d}=e(n());return await(await t({address:a,walletUrl:d}))?.guardTransactions(r)||[]};export{w as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2UIRKC76.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-7DP77WJU.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-2Z53M64I.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as s}from"./chunk-YNXPGS77.mjs";import{c as r,d as a}from"./chunk-CAA4VJRH.mjs";import{u as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as s}from"./chunk-YNXPGS77.mjs";import{c as r,d as a}from"./chunk-CAA4VJRH.mjs";import{u as e}from"./chunk-YOJAS3PK.mjs";import{a as n}from"./chunk-UERJ6AKK.mjs";var u=t=>{let o=0,i=n(e())?.shard;return S(t)?(t.forEach(c=>{let m=s(c,i);o+=m?5*6e3:6e3}),o):(o=s(t,i)?5*6e3:6e3,o)};export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-32AIQ4N3.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-YOJAS3PK.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-34TZ56ZL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as w}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as w}from"./chunk-32AIQ4N3.mjs";import{a as I}from"./chunk-EAJBSX6Y.mjs";import{a as b}from"./chunk-Y3BNMQFP.mjs";import{h as y}from"./chunk-H3EGIL75.mjs";import{h as l}from"./chunk-CAA4VJRH.mjs";import{b as S}from"./chunk-3ZEUVYQF.mjs";import{a as f}from"./chunk-34TZ56ZL.mjs";import{a as g}from"./chunk-L3MWDI6J.mjs";import{a as h}from"./chunk-F3LAQULB.mjs";import{u as d}from"./chunk-YOJAS3PK.mjs";import{b as p}from"./chunk-SAAOQW7P.mjs";import{e as T}from"./chunk-NTEMINYA.mjs";import A from"axios";var o=class o{constructor(){this.setCallbacks=({onSuccess:a,onFail:t})=>{S({onSuccess:a,onFail:t})};this.send=async a=>{if(a.length===0)throw new Error("No transactions to send");try{if(!I(a))return await this.sendSignedTransactions(a);let t=await this.sendSignedBatchTransactions(a);if(!t.data||t.data.error)throw new Error(t.data?.error??"Failed to send transactions");return t.data.transactions}catch(t){throw t.response?.data?.message??t.message}};this.track=async(a,t={disableToasts:!1})=>{let n=this.sequentialToFlatArray(a).map(i=>({...i,status:i.status??"pending"})),e=g(n),s=f({transactions:n,transactionsDisplayInfo:t.transactionsDisplayInfo,status:e??"sent",sessionInformation:t.sessionInformation});if(t.disableToasts===!0)return s;let c=w(a);return y({toastId:s,totalDuration:c}),s};this.sendSignedTransactions=async a=>{let{apiAddress:t,apiTimeout:n}=p(d()),e=a.map(r=>A.post(`${t}/transactions`,r.toPlainObject(),{timeout:Number(n)})),s=await Promise.all(e),c=new T;return s.map(({data:r})=>({...a.find(x=>c.computeTransactionHash(x)===r.txHash)?.toPlainObject(),...r,status:"pending",hash:r.txHash}))};this.sendSignedBatchTransactions=async a=>{let{address:t}=h(),{apiAddress:n,apiTimeout:e}=p(d());if(!t)return{error:"Invalid address provided. You need to be logged in to send transactions"};let s=this.buildBatchId(t),i={transactions:a.map(m=>m.map(u=>this.parseSignedTransaction(u))),id:s},{data:r}=await A.post(`${n}/batch`,i,{timeout:Number(e)});return{data:r}};this.buildBatchId=a=>`${Date.now().toString()}${l}${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 b({data:n.data})&&(delete n.senderUsername,delete n.receiverUsername),n}}static getInstance(){return o.instance||(o.instance=new o),o.instance}};o.instance=null;var v=o;export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3HMCWJHQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-YILAZW7P.mjs";import{a as r}from"./chunk-B2UIPHJ3.mjs";var o=()=>{try{return!r()||!e()?!1:window.self!==window.top}catch{return!0}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-42CVZ3GV.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-2Z53M64I.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-5BLRRK4B.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ae}from"./chunk-G4Z3ZQR6.mjs";import{a as se}from"./chunk-M3YL36ZL.mjs";import{a as te}from"./chunk-2UCZ5FCD.mjs";import{a as U}from"./chunk-GNF74ZRR.mjs";import{a as ie}from"./chunk-FSHVZP64.mjs";import{a as re}from"./chunk-X3BMMYMU.mjs";import{a as I}from"./chunk-2IXNUCCN.mjs";import{a as ee}from"./chunk-YUFPUG5O.mjs";import{a as de}from"./chunk-WWNT4K25.mjs";import{a as p}from"./chunk-XXILUGAY.mjs";import{a as Z}from"./chunk-CAN6BBUW.mjs";import{a as ne}from"./chunk-OYYE3JKS.mjs";import{a as oe}from"./chunk-ZP2E2Y6Y.mjs";import{a as Q}from"./chunk-QJGFIK7H.mjs";import{b as J}from"./chunk-4Z3DZ2A3.mjs";import{b as C,c as Y}from"./chunk-NRXYSTRW.mjs";import{j as $,l as O,r as M,s as P,t as L}from"./chunk-JLSMK3B2.mjs";import{a as y}from"./chunk-6IA3KJH5.mjs";import{g as K}from"./chunk-CAA4VJRH.mjs";import{a as q}from"./chunk-7AMGKXK6.mjs";import{a as D}from"./chunk-4TBVQD27.mjs";import{a as X}from"./chunk-WNKKBV76.mjs";import{a as F,s as j,u as l}from"./chunk-GUPYIQ3X.mjs";import{f as R}from"./chunk-UERJ6AKK.mjs";import{b as E,c as V}from"./chunk-SAAOQW7P.mjs";import{a as B}from"./chunk-VNLGNNIL.mjs";import{b as H,c as G}from"./chunk-6JM4DPOH.mjs";import{a as c}from"./chunk-CDQ2BNUD.mjs";import{a as o}from"./chunk-PLUWBWJ2.mjs";import{IframeLoginTypes as pe}from"@multiversx/sdk-web-wallet-iframe-provider/out/constants";var f=class extends p{constructor({address:e,anchor:r,shouldInitProvider:t}){super(e);this.provider=null;this.config=null;this.ledgerLogin=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");if(!e||typeof e.addressIndex!="number")throw new Error("Missing addressIndex for Ledger login");let{address:r,signature:t}=await this.provider.login({addressIndex:e.addressIndex});return{address:r,signature:t??""}};this.loginOperation=async e=>{if(!this.provider||!this.config)throw new Error("Provider is not initialized.");return await te({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!I())return;await U.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ne({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ce({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await re({shouldInitProvider:!0});this.provider=r}catch(r){throw $({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return 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 this.initLegderConnectManager(this.options?.anchor);let e=U.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((n,s)=>ie({manager:e,resolve:n,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ve=3e4,me=5e3,he=3e3,S=class a{constructor(){this.store=j();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=B(i),r=R(i);return!!(e===o.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=J(l());if(!(!this.shouldCheckConnection()||i))try{await L().getProvider().getAddress()}catch{if(O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"times",iconClassName:"warning",message:"Unlock your device to continue signing transactions",title:"Ledger disconnected"}),this.reset(),this.recreateProviderInterval)return;this.recreateProviderInterval=setInterval(this.reconnectProvider,me)}},ve))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new f({shouldInitProvider:!0});await i.init();let e=new M(i);i.getType=()=>o.ledger,P(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:he,icon:"check",iconClassName:"success",message:"Your device is ready to sign transactions",title:"Ledger reconnected"}),this.startCheckConnectionLoop()}catch{console.log("Unable to reconnect to Ledger")}};this.reset=()=>{clearInterval(this.connectionCheckInterval??0),this.connectionCheckInterval=null}}static getInstance(){return a.instance||(a.instance=new a),a.instance}};var k=class extends p{constructor(e){super(e?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{onClose:r,manager:t}=await this.initSignState();try{let n=await this.provider.signTransactions(e)??[];return await oe(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 await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.crossWindow})};this.walletAddress=e?.walletAddress,this.provider=Q.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=E(l()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return 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 ue}from"@multiversx/sdk-extension-provider/out/extensionProvider";var z=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=ue.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return o.extension}};var fe={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=se.getInstance(),this._login=this.provider.login.bind(this.provider)}init(){return this.initializeAddress(),this.initializeWalletUrl(),this.initializeProvider()}initializeWalletUrl(){if(this.walletUrl)return;let e=E(l());if(!e.iframeWalletAddress)throw new Error("Invalid walletUrl");this.walletUrl=e.iframeWalletAddress}async initializeProvider(){return await this.provider.init(),this.address&&this.setAccount({address:this.address}),this.provider.setLoginType(this.type),this.provider.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return fe[this.type]}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{OptionalOperation as ye}from"@multiversx/sdk-wallet-connect-provider/out";var le=[C.CANCEL_ACTION,C.SIGN_LOGIN_TOKEN],_=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;this.cancelActionAbortController=null;this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();this.cancelActionAbortController=new AbortController;let n=this.cancelActionAbortController.signal;try{let s=new Promise((h,v)=>{n.addEventListener("abort",()=>{v(new Error("cancelled by user"))})});return await Promise.race([this.provider.signTransactions(e),s])}catch(s){throw await t({shouldCancelAction:!0}),s}finally{r.closeUI()}};this.cancelAction=async()=>{this.sendCustomRequest({method:C.CANCEL_ACTION,action:ye.CANCEL_ACTION}),this.cancelActionAbortController?.abort()};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");this.cancelActionAbortController=new AbortController;let r=this.cancelActionAbortController.signal,t=new Promise((s,d)=>{r.addEventListener("abort",()=>{d(new Error("cancelled by user"))})});return await Promise.race([g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension}),t])};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return 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 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??D.walletConnectDeepLink;this._approval=n,y.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!I())return;await y.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=I(),t=V(l());if(H(l())&&le.push(C.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{X()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:x={},walletConnectV2RelayAddress:W=""}=e,w=new Y(v,t,W,m,x);return await w.init(),{walletConnectProvider:w,dappMethods:le}}catch(m){throw console.error("Unable to connect",m),r&&await this.logout(),m}}async login(e){if(!this.provider)throw new Error("Provider is not initialized. Call createProvider first.");let r=async()=>{if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.init();let t=y.getInstance(),{uri:n="",approval:s}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??D.walletConnectDeepLink;t.updateData({wcURI:n,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(n)}`});let h=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=h??{};return t.handleClose({isLoginFinished:!!v}),{address:v,signature:m}}catch{return await r()}};if(!this._approval)throw new Error("Approval or login is not initialized");try{let t=await this.provider.login({approval:this._approval.bind(this),token:e?.token}),{address:n="",signature:s=""}=t??{};return y.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 z;break}case o.crossWindow:{r=new k;break}case o.ledger:{r=new f({anchor:e}),await S.getInstance().init();break}case o.metamask:{r=new T({type:pe.metamask});break}case o.passkey:{r=new T({type:pe.passkey});break}case o.walletConnect:{let s=G(l());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new _({anchor:e,...s});break}case o.webview:{r=new de;break}default:{let s=q();for(let d of this._customProviders)d.type===i&&(r=await d.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new M(r);P(t);let n=[o.crossWindow,o.metamask,o.passkey].includes(i);return ae(n?{skipLoginMethod:i}:null),t}static async destroy(){L().cancelLogin(),P(null),F(o.none)}};A._customProviders=[];var Pe=(a,i)=>a.some(e=>e.type===i);async function g({message:a,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(n,s)=>{let{manager:d,onClose:h}=await Z({cancelAction:e}),v=Object.values(A.customProviders),m=v.reduce((u,N)=>(u[N.type]=N.name,u),{}),x={...c,...m},W=async()=>{await h({shouldCancelAction:!0}),s({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",W);let w=Pe(v,r)?r:o.none;d.updateData({name:x[w],type:w});try{let u=await i(a);n(u)}catch(u){await h({shouldCancelAction:!0}),s(u)}finally{d.closeUI()}})}async function ce({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=ee(e);throw r?{message:r}:e}}export{ce as a,f as b,S as c,A as d,g as e,k as f,z as g,T as h,_ as i};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as ae}from"./chunk-G4Z3ZQR6.mjs";import{a as se}from"./chunk-M3YL36ZL.mjs";import{a as te}from"./chunk-WWMW5EIR.mjs";import{a as U}from"./chunk-PQYZODUA.mjs";import{a as ie}from"./chunk-6JS7TNJC.mjs";import{a as re}from"./chunk-SVXVYH6P.mjs";import{a as I}from"./chunk-FNMPZS4S.mjs";import{a as ee}from"./chunk-YUFPUG5O.mjs";import{a as de}from"./chunk-RDPREOPG.mjs";import{a as p}from"./chunk-VQFQUFLP.mjs";import{a as Z}from"./chunk-VXWZLNHI.mjs";import{a as ne}from"./chunk-LJBVZK5V.mjs";import{a as oe}from"./chunk-2UIRKC76.mjs";import{a as Q}from"./chunk-QJGFIK7H.mjs";import{b as J}from"./chunk-4Z3DZ2A3.mjs";import{b as C,c as Y}from"./chunk-NRXYSTRW.mjs";import{j as $,l as O,r as M,s as P,t as L}from"./chunk-H3EGIL75.mjs";import{a as y}from"./chunk-F755MYC5.mjs";import{g as K}from"./chunk-CAA4VJRH.mjs";import{a as q}from"./chunk-WADOAKBZ.mjs";import{a as D}from"./chunk-4TBVQD27.mjs";import{a as X}from"./chunk-SNJKYJAD.mjs";import{a as F,s as j,u as l}from"./chunk-YOJAS3PK.mjs";import{f as R}from"./chunk-UERJ6AKK.mjs";import{b as E,c as V}from"./chunk-SAAOQW7P.mjs";import{a as B}from"./chunk-VNLGNNIL.mjs";import{b as H,c as G}from"./chunk-6JM4DPOH.mjs";import{a as c}from"./chunk-CDQ2BNUD.mjs";import{a as o}from"./chunk-PLUWBWJ2.mjs";import{IframeLoginTypes as pe}from"@multiversx/sdk-web-wallet-iframe-provider/out/constants";var f=class extends p{constructor({address:e,anchor:r,shouldInitProvider:t}){super(e);this.provider=null;this.config=null;this.ledgerLogin=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");if(!e||typeof e.addressIndex!="number")throw new Error("Missing addressIndex for Ledger login");let{address:r,signature:t}=await this.provider.login({addressIndex:e.addressIndex});return{address:r,signature:t??""}};this.loginOperation=async e=>{if(!this.provider||!this.config)throw new Error("Provider is not initialized.");return await te({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!I())return;await U.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ne({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await ce({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await re({shouldInitProvider:!0});this.provider=r}catch(r){throw $({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return 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 this.initLegderConnectManager(this.options?.anchor);let e=U.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((n,s)=>ie({manager:e,resolve:n,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ve=3e4,me=5e3,he=3e3,S=class a{constructor(){this.store=j();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=B(i),r=R(i);return!!(e===o.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=J(l());if(!(!this.shouldCheckConnection()||i))try{await L().getProvider().getAddress()}catch{if(O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"times",iconClassName:"warning",message:"Unlock your device to continue signing transactions",title:"Ledger disconnected"}),this.reset(),this.recreateProviderInterval)return;this.recreateProviderInterval=setInterval(this.reconnectProvider,me)}},ve))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new f({shouldInitProvider:!0});await i.init();let e=new M(i);i.getType=()=>o.ledger,P(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,O.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:he,icon:"check",iconClassName:"success",message:"Your device is ready to sign transactions",title:"Ledger reconnected"}),this.startCheckConnectionLoop()}catch{console.log("Unable to reconnect to Ledger")}};this.reset=()=>{clearInterval(this.connectionCheckInterval??0),this.connectionCheckInterval=null}}static getInstance(){return a.instance||(a.instance=new a),a.instance}};var k=class extends p{constructor(e){super(e?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{onClose:r,manager:t}=await this.initSignState();try{let n=await this.provider.signTransactions(e)??[];return await oe(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 await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.crossWindow})};this.walletAddress=e?.walletAddress,this.provider=Q.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=E(l()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return 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 ue}from"@multiversx/sdk-extension-provider/out/extensionProvider";var z=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=ue.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return o.extension}};var fe={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=se.getInstance(),this._login=this.provider.login.bind(this.provider)}init(){return this.initializeAddress(),this.initializeWalletUrl(),this.initializeProvider()}initializeWalletUrl(){if(this.walletUrl)return;let e=E(l());if(!e.iframeWalletAddress)throw new Error("Invalid walletUrl");this.walletUrl=e.iframeWalletAddress}async initializeProvider(){return await this.provider.init(),this.address&&this.setAccount({address:this.address}),this.provider.setLoginType(this.type),this.provider.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return fe[this.type]}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{OptionalOperation as ye}from"@multiversx/sdk-wallet-connect-provider/out";var le=[C.CANCEL_ACTION,C.SIGN_LOGIN_TOKEN],_=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;this.cancelActionAbortController=null;this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();this.cancelActionAbortController=new AbortController;let n=this.cancelActionAbortController.signal;try{let s=new Promise((h,v)=>{n.addEventListener("abort",()=>{v(new Error("cancelled by user"))})});return await Promise.race([this.provider.signTransactions(e),s])}catch(s){throw await t({shouldCancelAction:!0}),s}finally{r.closeUI()}};this.cancelAction=async()=>{this.sendCustomRequest({method:C.CANCEL_ACTION,action:ye.CANCEL_ACTION}),this.cancelActionAbortController?.abort()};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");this.cancelActionAbortController=new AbortController;let r=this.cancelActionAbortController.signal,t=new Promise((s,d)=>{r.addEventListener("abort",()=>{d(new Error("cancelled by user"))})});return await Promise.race([g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension}),t])};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return 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 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??D.walletConnectDeepLink;this._approval=n,y.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!I())return;await y.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=I(),t=V(l());if(H(l())&&le.push(C.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{X()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:x={},walletConnectV2RelayAddress:W=""}=e,w=new Y(v,t,W,m,x);return await w.init(),{walletConnectProvider:w,dappMethods:le}}catch(m){throw console.error("Unable to connect",m),r&&await this.logout(),m}}async login(e){if(!this.provider)throw new Error("Provider is not initialized. Call createProvider first.");let r=async()=>{if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.init();let t=y.getInstance(),{uri:n="",approval:s}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??D.walletConnectDeepLink;t.updateData({wcURI:n,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(n)}`});let h=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=h??{};return t.handleClose({isLoginFinished:!!v}),{address:v,signature:m}}catch{return await r()}};if(!this._approval)throw new Error("Approval or login is not initialized");try{let t=await this.provider.login({approval:this._approval.bind(this),token:e?.token}),{address:n="",signature:s=""}=t??{};return y.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 z;break}case o.crossWindow:{r=new k;break}case o.ledger:{r=new f({anchor:e}),await S.getInstance().init();break}case o.metamask:{r=new T({type:pe.metamask});break}case o.passkey:{r=new T({type:pe.passkey});break}case o.walletConnect:{let s=G(l());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new _({anchor:e,...s});break}case o.webview:{r=new de;break}default:{let s=q();for(let d of this._customProviders)d.type===i&&(r=await d.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new M(r);P(t);let n=[o.crossWindow,o.metamask,o.passkey].includes(i);return ae(n?{skipLoginMethod:i}:null),t}static async destroy(){L().cancelLogin(),P(null),F(o.none)}};A._customProviders=[];var Pe=(a,i)=>a.some(e=>e.type===i);async function g({message:a,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(n,s)=>{let{manager:d,onClose:h}=await Z({cancelAction:e}),v=Object.values(A.customProviders),m=v.reduce((u,N)=>(u[N.type]=N.name,u),{}),x={...c,...m},W=async()=>{await h({shouldCancelAction:!0}),s({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",W);let w=Pe(v,r)?r:o.none;d.updateData({name:x[w],type:w});try{let u=await i(a);n(u)}catch(u){await h({shouldCancelAction:!0}),s(u)}finally{d.closeUI()}})}async function ce({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=ee(e);throw r?{message:r}:e}}export{ce as a,f as b,S as c,A as d,g as e,k as f,z as g,T as h,_ as i};
|
|
2
|
+
//# sourceMappingURL=chunk-5C2ZAHTB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-GS33DJTW.mjs";import{a as k}from"./chunk-APEM4HDI.mjs";import{s as f}from"./chunk-YOJAS3PK.mjs";import{d as b}from"./chunk-UERJ6AKK.mjs";import{c as n}from"./chunk-MMBSMAYP.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-5CABF4XT.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-SVXVYH6P.mjs";import{a as c}from"./chunk-FNMPZS4S.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-6JS7TNJC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-E2ODPOVS.mjs";var t={closeConnectionRef:void 0};async function c(n){let{closeConnection:o}=await e(n);t.closeConnectionRef=o}export{t as a,c as b};
|
|
2
|
+
//# sourceMappingURL=chunk-6Z4GXMSW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as o,c as i}from"./chunk-QJGFIK7H.mjs";import{t as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as o,c as i}from"./chunk-QJGFIK7H.mjs";import{t as g}from"./chunk-H3EGIL75.mjs";import{s as u}from"./chunk-YOJAS3PK.mjs";import{a as p}from"./chunk-UERJ6AKK.mjs";import{a as h,c as l,g as c}from"./chunk-NTEMINYA.mjs";import{a as y}from"./chunk-MONQ4RXB.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-75WEAHW3.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{u as e}from"./chunk-YOJAS3PK.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";import{a as i}from"./chunk-CKTFPRJS.mjs";var n="https://api.multiversx.com",s=60*60*24,a=5*60,d=t=>{let r=o(e());return{origin:t?.origin||i().origin,apiAddress:t?.apiAddress||r.apiAddress||n,expirySeconds:t?.expirySeconds||s,tokenExpirationToastWarningSeconds:t?.tokenExpirationToastWarningSeconds||a}};export{d as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7DP77WJU.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-WIXDQ3KW.mjs";import o from"axios";var n="transactions/ppu";async function l(a,s){let r=`${e(s)}/${n}/${a}`;try{let{data:t}=await o.get(r);return t?{[a]:{lastBlock:t.lastBlock,fast:t.fast,faster:t.faster}}:null}catch(t){return console.error("Error fetching gas station metadata from:",r,t),null}}export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-A2W4YT2Y.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-FMQYLMTU.mjs";import{b as s,c as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-FMQYLMTU.mjs";import{b as s,c as r}from"./chunk-34TZ56ZL.mjs";async function l({results:e,hash:i,sessionId:t}){let a=e?.find(o=>o?.returnMessage!=="");r({sessionId:t,transaction:{...a,hash:i,status:"fail",inTransit:!1}}),s({sessionId:t,status:"fail",errorMessage:a?.returnMessage}),await n({sessionId:t,status:"fail"})}export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-AEZWP25S.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-2JDGOX23.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-AJS7FS66.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as o}from"./chunk-N6MC53DJ.mjs";import{b as s}from"./chunk-TQA3JDNV.mjs";import{u as n}from"./chunk-YOJAS3PK.mjs";async function f(){let t=s(n());if(Object.keys(t).length>0)for(let[e,{transactions:c}]of Object.entries(t))await o({sessionId:e,transactionBatch:c})}export{f as a};
|
|
2
|
+
//# sourceMappingURL=chunk-APEM4HDI.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{s as c}from"./chunk-YOJAS3PK.mjs";import{a as o}from"./chunk-JMC7CMTU.mjs";var r=e=>{c().setState(({account:t})=>{let s=t.address===e.address;t.accounts={[t.address]:s?e:o}},!1,"setAccount")},u=e=>c().setState(({account:t})=>{t.ledgerAccount=e},!1,"setLedgerAccount"),p=e=>c().setState(({account:t})=>{t.walletConnectAccount=e},!1,"setWalletConnectAccount"),l=e=>c().setState(({account:t})=>{t.websocketEvent={timestamp:Date.now(),message:e}},!1,"setWebsocketEvent"),m=e=>c().setState(({account:t})=>{t.websocketBatchEvent={timestamp:Date.now(),data:e}},!1,"setWebsocketBatchEvent"),A=e=>{c().setState(({account:t})=>{t.accounts[t.address].nonce=e},!1,"setAccountNonce")};export{r as a,u as b,p as c,l as d,m as e,A as f};
|
|
2
|
+
//# sourceMappingURL=chunk-BVL47QTP.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-KRB3XH4K.mjs";import{a as p}from"./chunk-LJZO6JVX.mjs";import{a as d}from"./chunk-5Y4EYF6Z.mjs";import{a as T}from"./chunk-QQAW7UC2.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-C754AWVZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{s as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{s as u}from"./chunk-YOJAS3PK.mjs";import{a as c}from"./chunk-SQVKVA7X.mjs";import{a as i}from"./chunk-ULUZWP2P.mjs";var e=o=>u().setState(({network:r})=>{r.network={...r.network,...o}},!1,"initializeNetworkConfig");var y=async({customNetworkConfig:o={},environment:r})=>{let d=!o?.skipFetchFromServer,g=o?.apiAddress,n=r&&r in i,p=n?i[r]:{},s={...c,...p,...o},t={...s,apiTimeout:String(s.apiTimeout)},N=p?.apiAddress;if(!n&&d){let a=g||N,m=await w(a),f=t.roundDuration?null:await l(a);if(f!=null&&(t.roundDuration=f.erd_round_duration),m!=null){let k={...t,...m,...o};return e(k),k}}return e(t),t};export{y as a,e as b};
|
|
2
|
+
//# sourceMappingURL=chunk-CQAZ3LJW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as N}from"./chunk-Q2Q4XN4M.mjs";import{b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as N}from"./chunk-Q2Q4XN4M.mjs";import{b}from"./chunk-UJDX67YT.mjs";import{d as C,e as I}from"./chunk-BVL47QTP.mjs";import{s as p}from"./chunk-YOJAS3PK.mjs";import{b as E}from"./chunk-SAAOQW7P.mjs";import{a as y}from"./chunk-MGQ373AO.mjs";import{b as t}from"./chunk-GGBMHKR4.mjs";import{io as L}from"socket.io-client";var U=3e3,d=3,k=500,W=1e3,M=1e3,S="batchUpdated",w="connect",O="connect_error",A="disconnect";async function K(l){let{apiAddress:_,websocketUrl:g}=E(p().getState());if(!l)throw new Error("Websocket could not be initialized: address missing");let o=null,n=null,c=e=>{t.status=e,b(e)},R=e=>{o&&clearTimeout(o),o=setTimeout(()=>{C(e)},W)},h=e=>{n&&clearTimeout(n),n=setTimeout(()=>{I(e)},W)},D=()=>{let e=t.instance;e&&(e.off(O),e.off(w),e.off(S),e.off(A),e.close(),console.log("Websocket disconnected.")),c("not_initialized"),t.instance=null,o&&clearTimeout(o),n&&clearTimeout(n)},m=y(async()=>{let e=async(i=d,a=k)=>{let f=0,r=null,s=null,T=async()=>{if(f>=i){console.warn("WebSocket reconnection failed after max attempts."),c("not_initialized");return}f++,t.instance?.off(),t.instance?.close(),t.instance=null;try{await m(),r=setTimeout(()=>{t.instance?.connected||(s=setTimeout(T,a))},M)}catch{s=setTimeout(T,a)}};return T(),()=>{r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null)}};c("pending");let u=g??await N(_);if(!u){c("not_initialized");return}t.instance=L(u,{forceNew:!0,reconnection:!0,reconnectionAttempts:d,timeout:U,query:{address:l}}),t.instance.onAny(R),t.instance.on(S,h),t.instance.on(w,()=>{console.log("Websocket connected."),c("completed")}),t.instance.on(O,async i=>{console.warn("Websocket connect error: ",i.message),(await e())()}),t.instance.on(A,async()=>{console.warn("Websocket disconnected. Trying to reconnect..."),(await e())()})},{retries:2,delay:k});return t.status==="not_initialized"&&!t.instance?.active&&await m(),{closeConnection:D}}export{K as a};
|
|
2
|
+
//# sourceMappingURL=chunk-E2ODPOVS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-NBZUJ5VZ.mjs";var n=class t extends e{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-wallet-connect"});this.initialData={wcURI:"",walletConnectDeepLink:""};this.data={...this.initialData}}static getInstance(){return t.instance||(t.instance=new t),t.instance}handleClose(a){a?.isLoginFinished||(this.anchor?this.anchor.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy())}async setupEventListeners(){this.eventBus&&(this.eventBus.subscribe("CLOSE",this.handleClose.bind(this)),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}};export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-F755MYC5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-MONQ4RXB.mjs";import{MvxLedgerConnect as r}from"@multiversx/sdk-dapp-ui/web-components/mvx-ledger-connect";async function i(n){if(!(typeof t.navigator<"u"&&t.navigator.product==="ReactNative"))try{(await import("@multiversx/sdk-dapp-ui")).defineCustomElements(n)}catch(e){console.warn("@multiversx/sdk-dapp-ui not found"+e)}}export{i as a,r as b};
|
|
2
|
+
//# sourceMappingURL=chunk-FKFHOXVI.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as t}from"./chunk-S6ZQLKKX.mjs";import{c as n}from"./chunk-YOJAS3PK.mjs";async function c({loginToken:r,extraInfoData:i,address:e}){let o=await t({originalLoginToken:r,extraInfoData:i,address:e});return o.modifiedLoginToken&&n(o.modifiedLoginToken),o.address}export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GHNNJ64D.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as et}from"./chunk-QNJDXBR6.mjs";import{a as mt}from"./chunk-6UZHM5LW.mjs";import{a as b}from"./chunk-P7KN75HA.mjs";import{a as pt}from"./chunk-AHSGP7ST.mjs";import{a as w}from"./chunk-3JMCXLWZ.mjs";import{a as Z,b as tt,g as st,l as ot}from"./chunk-CAA4VJRH.mjs";import{a as gt}from"./chunk-T6PE5QT2.mjs";import{b as S}from"./chunk-UXJIZKTT.mjs";import{a as dt}from"./chunk-V53EFJQZ.mjs";import{a as It}from"./chunk-4ODPAHHA.mjs";import{a as ht}from"./chunk-MDVI45IV.mjs";import{a as ft}from"./chunk-ER7VDELK.mjs";import{a as f}from"./chunk-N7FAJ2VG.mjs";import{a as X}from"./chunk-7AMGKXK6.mjs";import{a as ut}from"./chunk-43AE4SYE.mjs";import{a as L}from"./chunk-Z3SM2MSZ.mjs";import{a as C,f as lt}from"./chunk-7PW3YJZS.mjs";import{b as Tt}from"./chunk-WNKKBV76.mjs";import{d as rt}from"./chunk-JXNX2DMF.mjs";import{k as it,l as nt,n as at}from"./chunk-65L5EBBL.mjs";import{a as A}from"./chunk-HORSXVIV.mjs";import{a as vt}from"./chunk-7TVD3ZGR.mjs";import{a as Q}from"./chunk-LD6GIQXR.mjs";import{a as E}from"./chunk-QTKK6OSJ.mjs";import{a as J}from"./chunk-6ACLOUQ3.mjs";import{a as y}from"./chunk-6FXEHNGW.mjs";import{a as yt}from"./chunk-NJN53MJV.mjs";import{a as j}from"./chunk-YSCND2MX.mjs";import{a as V,b as q,s as u,u as Y}from"./chunk-GUPYIQ3X.mjs";import{c as H,f as $}from"./chunk-UERJ6AKK.mjs";import{b as g}from"./chunk-VNLGNNIL.mjs";import{b as v}from"./chunk-6JM4DPOH.mjs";import{b as G,c as K,f as z}from"./chunk-NTEMINYA.mjs";import{b as Et}from"./chunk-76URRONH.mjs";import{a as ct}from"./chunk-SUOUG7EQ.mjs";import{a as I}from"./chunk-PLUWBWJ2.mjs";import W from"lodash.isequal";import Lt from"lodash.isequal";var Ft="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",x=class e extends ut{constructor(){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.store=u();this.initialData={pendingTransactions:[],historicTransactions:[]};this.closeUI=async()=>{this.data.pendingTransactions.length>0?(this.unsubscribeFunctions.forEach(s=>s.forEach(o=>o())),this.unsubscribeFunctions.clear(),await this.uiElement?.closeWithAnimation()):super.closeUI()};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 o=this.store.subscribe(async({toasts:i,transactions:n},{toasts:a,transactions:c})=>{(!Lt(a.transactionToasts,i.transactionToasts)||!Lt(c,n))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Ft,[o]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}async handleCloseUI(){let s=p.getInstance();await this.closeUI(),await s.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:s,account:o,toasts:i,network:n}=this.store.getState(),{pendingTransactionToasts:a}=await b({toastList:i,transactionsSessions:s,account:o});this.data.pendingTransactions=a,this.data.historicTransactions=await et.getTransactionsHistory({transactionsSessions:s,address:o.address,explorerAddress:n.network.explorerAddress,egldLabel:n.network.egldLabel}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){rt(),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 N=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(),s=g(t),{isExpired:o}=E(s?.nativeAuthToken);o?h().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(),s=g(t),o=$(t);return!!(s?.nativeAuthToken&&o)};this.addPlannedLogout=()=>{let t=h(),s=H(this.store.getState()),o=t.getType()===I.webview;if(!s||o)return;this.addLogoutWarning();let i=g(this.store.getState()),{secondsUntilExpires:n,expiresAt:a}=E(i?.nativeAuthToken),c=new R(String(n)),r=`${s}_${a}`,m=this.plannedLogoutKey===r;if(!(n&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=r,clearTimeout(this.plannedLogoutTimeoutRef??0);let d=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},d.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},d.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=v(this.store.getState()),s=g(this.store.getState()),{secondsUntilExpires:o}=E(s?.nativeAuthToken),i=new R(String(o)),n=i.times(1e3);if(!o||i.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new R(t?.tokenExpirationToastWarningSeconds??0).times(1e3),r=i.times(1e3).minus(c),m=mt(n.toNumber()),l=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},l)}}static getInstance(){return e.instance||(e.instance=new e),e.instance}};async function B({address:e,provider:t,apiAddress:s}){let o=await y({address:e,baseURL:s});if(!o)throw new Error("Account not found");Tt({address:e,providerType:t.getType()});let i={...o,username:A(o.username),nonce:L(o)};C(i),await S(e),w(),o.shard!=null&&await pt({shard:Number(o.shard),apiAddress:s})}async function kt(e){let{network:{apiAddress:t}}=f();await e.login();let s=await e.getAddress();if(!s)throw new Error("Address not found");return await B({address:s,provider:e,apiAddress:t}),{address:s}}async function Dt({provider:e,nativeAuthConfig:t,token:s}){let{network:{apiAddress:o}}=f(),i=Q(t),n=s;n||(n=await i.initialize({noCache:!0}));let{address:a,signature:c,...r}=await e.login({token:n});if(!a)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let l=J(r?.accessToken)?r.accessToken:i.getToken({address:a,token:n,signature:c});q({loginToken:n,signature:c,nativeAuthToken:l});let d=await dt({loginToken:n,extraInfoData:{multisig:r?.multisig,impersonate:r?.impersonate},address:a});return await B({address:d,provider:e,apiAddress:o}),{address:d,signature:c}}async function bt(e,t){let s=v(Y());if(s)return await Dt({provider:e,nativeAuthConfig:s,token:t?.token});let{address:o}=await kt(e);return await S(o),w(),{address:o}}var U={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${tt}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${Z}-${Date.now()}`}},Rt={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"},Bt=e=>{for(let[t,s]of Object.entries(Rt))if(e.includes(t))return s;return"Error when signing"};function _(e,t="error"){let s=e?.message,o=Bt(s),n=o!=="Error when signing"?"warning":t,a=Object.keys(U).includes(n)?U[n]:U.error,{toastId:c,iconClassName:r,title:m}=a;return M({toastId:c,duration:1e4,icon:"times",iconClassName:r,message:o,title:m}),o}async function Ct({provider:e,transactions:t,options:s={}}){await St();let{isGuarded:o,activeGuardianAddress:i,nonce:n}=vt(),a=e.getType()===I.ledger,c=It({latestNonce:n,transactions:t}),r=i&&o&&!s.skipGuardian?c?.map(l=>(l.version=G.withTxOptions().valueOf(),l.options=z.withOptions({guarded:!0,...a?{hashSign:!0}:{}}).valueOf(),l.guardian=K.newFromBech32(i),l)):c,m=await e.signTransactions(r)??[];return lt(n+m.length),m}var O=class{constructor(t){this._isLoggingOut=!1;this.provider=t}init(){return this.provider.init()}async login(t){let s=await bt(this.provider,t);return V(this.provider.getType()),wt(this),N.getInstance().init(),s}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0}){if(this._isLoggingOut)return console.warn("Logout already in progress"),!1;this._isLoggingOut=!0;let s=await gt({provider:this.provider,options:t});return this._isLoggingOut=!1,s}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,s){try{return await Ct({provider:this.provider,transactions:t,options:s})}catch(o){let i=_(o);throw new Error(i)}}async signMessage(t,s){try{return await ft({provider:this.provider,message:t,options:s})}catch(o){let i=_(o,"warning");throw new Error(i)}}async verifyMessage(t){return await ht(t)}cancelLogin(){this.provider.cancelLogin?.()}};var At=null;function wt(e){At=e}function h(){return At||new O(Et)}var Ut=async()=>{try{let e=X(),{network:t}=f();try{let s=await y({address:e,baseURL:t.apiAddress});if(s!=null){let o={...s,username:A(s.username),nonce:L(s)};return C(o),o}}catch(s){console.error("Failed getting account ",s)}}catch(e){console.error("Failed getting address ",e)}return null};async function St(){let e=h();if(e==null)throw"Provider not initialized";try{if(!e.init)throw"Current provider does not have init() function";return await e.init()?Ut():void 0}catch(t){console.error("Failed initializing provider ",t)}}var F={},T={},_t=(e,t)=>{u().setState(({toasts:s})=>{let o=s.customToasts.length>0?Math.max(...s.customToasts.map(r=>parseInt(r.toastId.split("-").pop()??"0"))):0,i=t??`custom-toast-${o+1}`,n=s.customToasts.findIndex(r=>r.toastId===i),a={...e,toastId:i};if(n!==-1){s.customToasts[n]=a;return}s.customToasts.push({...a,toastId:i})},!1,"addCustomToast")},P=e=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(s=>s.toastId!==e)},!1,"removeCustomToast")},xt=()=>{u().setState(({toasts:e})=>{e.customToasts=[]},!1,"removeAllCustomToasts")},zo=()=>{u().setState(({toasts:e})=>{e.transactionToasts=[]})},Nt=({toastId:e,totalDuration:t})=>{let s="";return u().setState(({toasts:o})=>{let i=o.transactionToasts.length>0?Math.max(...o.transactionToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0;s=e??`transaction-toast-${i+1}`,o.transactionToasts.push({startTime:j(),endTime:yt(t),toastId:s})},!1,"addTransactionToast"),s},k=e=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(s=>s.toastId!==e)},!1,"removeTransactionToast"),delete T[e],delete F[e]},M=e=>{let{toasts:t}=u().getState(),s=t.customToasts.length>0?Math.max(...t.customToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0,o=e.toastId||`custom-toast-${s+1}`;return e.onClose&&(T[o]=e.onClose),e.instantiateToastElement?(F[o]=e.instantiateToastElement,u().setState(({toasts:i})=>{let n=i.customToasts.findIndex(r=>r.toastId===o),a={...e,instantiateToastElement:null,toastId:o};n!==-1?i.customToasts[n]=a:i.customToasts.push(a)},!1,"createCustomToast"),o):(_t(e,o),o)};var Mt=1e4,D=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=Mt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let s=setTimeout(()=>{k(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,s)};this.startWithCustomDuration=(t,s)=>{if(this.stop(t),s<=0)return;let o=setTimeout(()=>{P(t);let i=T[t];i?.()},s);this.timeoutIntervals.set(t,o)};this.stop=t=>{let s=this.timeoutIntervals.get(t);s&&(clearTimeout(s),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t||Mt}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=x.getInstance()}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),await this.updateTransactionToastsList(),await this.updateCustomToastList(),await this.subscribeToEventBusNotifications(),this.storeToastsSubscription=this.store.subscribe(async({toasts:s,transactions:o},{toasts:i,transactions:n})=>{(!W(i.transactionToasts,s.transactionToasts)||!W(n,o))&&await this.updateTransactionToastsList(),W(i.customToasts,s.customToasts)||await this.updateCustomToastList()})}static getInstance(){return e.instance||(e.instance=new e),e.instance}handleCompletedTransaction(t){let{transactions:s}=this.store.getState(),o=s[t];if(!o)return!1;let{status:i}=o,n=at(i),a=nt(i),c=it(i),r=a||c||n;return r?(this.successfulToastLifetime&&this.lifetimeManager.start(t),r):(this.lifetimeManager.stop(t),r)}async createTransactionToast(t,s){let o=Nt({toastId:t,totalDuration:s});return this.handleCompletedTransaction(t),await this.updateTransactionToastsList(),o}createCustomToast(t){let s=M(t);return this.updateCustomToastList(),s}async updateTransactionToastsList(){let{toasts:t,transactions:s,account:o}=this.store.getState(),{pendingTransactionToasts:i,completedTransactionToasts:n}=await b({toastList:t,transactionsSessions:s,account:o});this.transactionToasts=[...i,...n];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 s of t.customToasts){let i="message"in s?{...s}:{...s,instantiateToastElement:F[s.toastId]};this.customToasts.push(i),s.duration&&this.lifetimeManager.startWithCustomDuration(s.toastId,s.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 ct.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}handleTransactionToastClose(t){this.handleCompletedTransaction(t)&&k(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))})}}async showToasts(){this.eventBus?.publish("SHOW_TOAST_LIST",null),await this.updateCustomToastList(),await this.updateTransactionToastsList()}hideToasts(){this.eventBus?.publish("HIDE_TOAST_LIST",null)}async handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}handleCloseToast(t){if(this.customToasts.find(o=>o.toastId===t)){this.lifetimeManager.stop(t);let o=T[t];o?.(),P(t);return}this.handleTransactionToastClose(t)}async publishTransactionToasts(){if(this.notificationsFeedManager.isNotificationsFeedOpen()&&this.eventBus){this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts),this.hideToasts();return}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(),xt(),this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[]}};export{x as a,F as b,T as c,_t as d,P as e,xt as f,zo as g,Nt as h,k as i,M as j,D as k,p as l,N as m,B as n,bt as o,_ as p,Ct as q,O as r,wt as s,h as t,St as u};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as et}from"./chunk-ARV3XIYY.mjs";import{a as mt}from"./chunk-6UZHM5LW.mjs";import{a as b}from"./chunk-N3NTEUD2.mjs";import{a as pt}from"./chunk-Z7T2J6XD.mjs";import{a as w}from"./chunk-5CABF4XT.mjs";import{a as Z,b as tt,g as st,l as ot}from"./chunk-CAA4VJRH.mjs";import{a as gt}from"./chunk-KMSI4FA6.mjs";import{b as S}from"./chunk-6Z4GXMSW.mjs";import{a as dt}from"./chunk-GHNNJ64D.mjs";import{a as It}from"./chunk-4ODPAHHA.mjs";import{a as ht}from"./chunk-MDVI45IV.mjs";import{a as ft}from"./chunk-OWNMDLKO.mjs";import{a as f}from"./chunk-RUARSP3Z.mjs";import{a as X}from"./chunk-WADOAKBZ.mjs";import{a as ut}from"./chunk-T26S2V72.mjs";import{a as L}from"./chunk-XY4G3LLQ.mjs";import{a as C,f as lt}from"./chunk-BVL47QTP.mjs";import{b as Tt}from"./chunk-SNJKYJAD.mjs";import{d as rt}from"./chunk-34TZ56ZL.mjs";import{k as it,l as nt,n as at}from"./chunk-65L5EBBL.mjs";import{a as A}from"./chunk-HORSXVIV.mjs";import{a as vt}from"./chunk-F3LAQULB.mjs";import{a as Q}from"./chunk-5BLRRK4B.mjs";import{a as E}from"./chunk-QTKK6OSJ.mjs";import{a as J}from"./chunk-6ACLOUQ3.mjs";import{a as y}from"./chunk-6FXEHNGW.mjs";import{a as yt}from"./chunk-NJN53MJV.mjs";import{a as j}from"./chunk-YSCND2MX.mjs";import{a as V,b as q,s as u,u as Y}from"./chunk-YOJAS3PK.mjs";import{c as H,f as $}from"./chunk-UERJ6AKK.mjs";import{b as g}from"./chunk-VNLGNNIL.mjs";import{b as v}from"./chunk-6JM4DPOH.mjs";import{b as G,c as K,f as z}from"./chunk-NTEMINYA.mjs";import{b as Et}from"./chunk-76URRONH.mjs";import{a as ct}from"./chunk-TYN5TMRZ.mjs";import{a as I}from"./chunk-PLUWBWJ2.mjs";import W from"lodash.isequal";import Lt from"lodash.isequal";var Ft="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",x=class e extends ut{constructor(){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.store=u();this.initialData={pendingTransactions:[],historicTransactions:[]};this.closeUI=async()=>{this.data.pendingTransactions.length>0?(this.unsubscribeFunctions.forEach(s=>s.forEach(o=>o())),this.unsubscribeFunctions.clear(),await this.uiElement?.closeWithAnimation()):super.closeUI()};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 o=this.store.subscribe(async({toasts:i,transactions:n},{toasts:a,transactions:c})=>{(!Lt(a.transactionToasts,i.transactionToasts)||!Lt(c,n))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Ft,[o]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}async handleCloseUI(){let s=p.getInstance();await this.closeUI(),await s.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:s,account:o,toasts:i,network:n}=this.store.getState(),{pendingTransactionToasts:a}=await b({toastList:i,transactionsSessions:s,account:o});this.data.pendingTransactions=a,this.data.historicTransactions=await et.getTransactionsHistory({transactionsSessions:s,address:o.address,explorerAddress:n.network.explorerAddress,egldLabel:n.network.egldLabel}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){rt(),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 N=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(),s=g(t),{isExpired:o}=E(s?.nativeAuthToken);o?h().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(),s=g(t),o=$(t);return!!(s?.nativeAuthToken&&o)};this.addPlannedLogout=()=>{let t=h(),s=H(this.store.getState()),o=t.getType()===I.webview;if(!s||o)return;this.addLogoutWarning();let i=g(this.store.getState()),{secondsUntilExpires:n,expiresAt:a}=E(i?.nativeAuthToken),c=new R(String(n)),r=`${s}_${a}`,m=this.plannedLogoutKey===r;if(!(n&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=r,clearTimeout(this.plannedLogoutTimeoutRef??0);let d=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},d.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},d.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=v(this.store.getState()),s=g(this.store.getState()),{secondsUntilExpires:o}=E(s?.nativeAuthToken),i=new R(String(o)),n=i.times(1e3);if(!o||i.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new R(t?.tokenExpirationToastWarningSeconds??0).times(1e3),r=i.times(1e3).minus(c),m=mt(n.toNumber()),l=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},l)}}static getInstance(){return e.instance||(e.instance=new e),e.instance}};async function B({address:e,provider:t,apiAddress:s}){let o=await y({address:e,baseURL:s});if(!o)throw new Error("Account not found");Tt({address:e,providerType:t.getType()});let i={...o,username:A(o.username),nonce:L(o)};C(i),await S(e),w(),o.shard!=null&&await pt({shard:Number(o.shard),apiAddress:s})}async function kt(e){let{network:{apiAddress:t}}=f();await e.login();let s=await e.getAddress();if(!s)throw new Error("Address not found");return await B({address:s,provider:e,apiAddress:t}),{address:s}}async function Dt({provider:e,nativeAuthConfig:t,token:s}){let{network:{apiAddress:o}}=f(),i=Q(t),n=s;n||(n=await i.initialize({noCache:!0}));let{address:a,signature:c,...r}=await e.login({token:n});if(!a)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let l=J(r?.accessToken)?r.accessToken:i.getToken({address:a,token:n,signature:c});q({loginToken:n,signature:c,nativeAuthToken:l});let d=await dt({loginToken:n,extraInfoData:{multisig:r?.multisig,impersonate:r?.impersonate},address:a});return await B({address:d,provider:e,apiAddress:o}),{address:d,signature:c}}async function bt(e,t){let s=v(Y());if(s)return await Dt({provider:e,nativeAuthConfig:s,token:t?.token});let{address:o}=await kt(e);return await S(o),w(),{address:o}}var U={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${tt}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${Z}-${Date.now()}`}},Rt={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"},Bt=e=>{for(let[t,s]of Object.entries(Rt))if(e.includes(t))return s;return"Error when signing"};function _(e,t="error"){let s=e?.message,o=Bt(s),n=o!=="Error when signing"?"warning":t,a=Object.keys(U).includes(n)?U[n]:U.error,{toastId:c,iconClassName:r,title:m}=a;return M({toastId:c,duration:1e4,icon:"times",iconClassName:r,message:o,title:m}),o}async function Ct({provider:e,transactions:t,options:s={}}){await St();let{isGuarded:o,activeGuardianAddress:i,nonce:n}=vt(),a=e.getType()===I.ledger,c=It({latestNonce:n,transactions:t}),r=i&&o&&!s.skipGuardian?c?.map(l=>(l.version=G.withTxOptions().valueOf(),l.options=z.withOptions({guarded:!0,...a?{hashSign:!0}:{}}).valueOf(),l.guardian=K.newFromBech32(i),l)):c,m=await e.signTransactions(r)??[];return lt(n+m.length),m}var O=class{constructor(t){this._isLoggingOut=!1;this.provider=t}init(){return this.provider.init()}async login(t){let s=await bt(this.provider,t);return V(this.provider.getType()),wt(this),N.getInstance().init(),s}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0}){if(this._isLoggingOut)return console.warn("Logout already in progress"),!1;this._isLoggingOut=!0;let s=await gt({provider:this.provider,options:t});return this._isLoggingOut=!1,s}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,s){try{return await Ct({provider:this.provider,transactions:t,options:s})}catch(o){let i=_(o);throw new Error(i)}}async signMessage(t,s){try{return await ft({provider:this.provider,message:t,options:s})}catch(o){let i=_(o,"warning");throw new Error(i)}}async verifyMessage(t){return await ht(t)}cancelLogin(){this.provider.cancelLogin?.()}};var At=null;function wt(e){At=e}function h(){return At||new O(Et)}var Ut=async()=>{try{let e=X(),{network:t}=f();try{let s=await y({address:e,baseURL:t.apiAddress});if(s!=null){let o={...s,username:A(s.username),nonce:L(s)};return C(o),o}}catch(s){console.error("Failed getting account ",s)}}catch(e){console.error("Failed getting address ",e)}return null};async function St(){let e=h();if(e==null)throw"Provider not initialized";try{if(!e.init)throw"Current provider does not have init() function";return await e.init()?Ut():void 0}catch(t){console.error("Failed initializing provider ",t)}}var F={},T={},_t=(e,t)=>{u().setState(({toasts:s})=>{let o=s.customToasts.length>0?Math.max(...s.customToasts.map(r=>parseInt(r.toastId.split("-").pop()??"0"))):0,i=t??`custom-toast-${o+1}`,n=s.customToasts.findIndex(r=>r.toastId===i),a={...e,toastId:i};if(n!==-1){s.customToasts[n]=a;return}s.customToasts.push({...a,toastId:i})},!1,"addCustomToast")},P=e=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(s=>s.toastId!==e)},!1,"removeCustomToast")},xt=()=>{u().setState(({toasts:e})=>{e.customToasts=[]},!1,"removeAllCustomToasts")},zo=()=>{u().setState(({toasts:e})=>{e.transactionToasts=[]})},Nt=({toastId:e,totalDuration:t})=>{let s="";return u().setState(({toasts:o})=>{let i=o.transactionToasts.length>0?Math.max(...o.transactionToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0;s=e??`transaction-toast-${i+1}`,o.transactionToasts.push({startTime:j(),endTime:yt(t),toastId:s})},!1,"addTransactionToast"),s},k=e=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(s=>s.toastId!==e)},!1,"removeTransactionToast"),delete T[e],delete F[e]},M=e=>{let{toasts:t}=u().getState(),s=t.customToasts.length>0?Math.max(...t.customToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0,o=e.toastId||`custom-toast-${s+1}`;return e.onClose&&(T[o]=e.onClose),e.instantiateToastElement?(F[o]=e.instantiateToastElement,u().setState(({toasts:i})=>{let n=i.customToasts.findIndex(r=>r.toastId===o),a={...e,instantiateToastElement:null,toastId:o};n!==-1?i.customToasts[n]=a:i.customToasts.push(a)},!1,"createCustomToast"),o):(_t(e,o),o)};var Mt=1e4,D=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=Mt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let s=setTimeout(()=>{k(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,s)};this.startWithCustomDuration=(t,s)=>{if(this.stop(t),s<=0)return;let o=setTimeout(()=>{P(t);let i=T[t];i?.()},s);this.timeoutIntervals.set(t,o)};this.stop=t=>{let s=this.timeoutIntervals.get(t);s&&(clearTimeout(s),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t||Mt}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=x.getInstance()}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),await this.updateTransactionToastsList(),await this.updateCustomToastList(),await this.subscribeToEventBusNotifications(),this.storeToastsSubscription=this.store.subscribe(async({toasts:s,transactions:o},{toasts:i,transactions:n})=>{(!W(i.transactionToasts,s.transactionToasts)||!W(n,o))&&await this.updateTransactionToastsList(),W(i.customToasts,s.customToasts)||await this.updateCustomToastList()})}static getInstance(){return e.instance||(e.instance=new e),e.instance}handleCompletedTransaction(t){let{transactions:s}=this.store.getState(),o=s[t];if(!o)return!1;let{status:i}=o,n=at(i),a=nt(i),c=it(i),r=a||c||n;return r?(this.successfulToastLifetime&&this.lifetimeManager.start(t),r):(this.lifetimeManager.stop(t),r)}async createTransactionToast(t,s){let o=Nt({toastId:t,totalDuration:s});return this.handleCompletedTransaction(t),await this.updateTransactionToastsList(),o}createCustomToast(t){let s=M(t);return this.updateCustomToastList(),s}async updateTransactionToastsList(){let{toasts:t,transactions:s,account:o}=this.store.getState(),{pendingTransactionToasts:i,completedTransactionToasts:n}=await b({toastList:t,transactionsSessions:s,account:o});this.transactionToasts=[...i,...n];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 s of t.customToasts){let i="message"in s?{...s}:{...s,instantiateToastElement:F[s.toastId]};this.customToasts.push(i),s.duration&&this.lifetimeManager.startWithCustomDuration(s.toastId,s.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 ct.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}handleTransactionToastClose(t){this.handleCompletedTransaction(t)&&k(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))})}}async showToasts(){this.eventBus?.publish("SHOW_TOAST_LIST",null),await this.updateCustomToastList(),await this.updateTransactionToastsList()}hideToasts(){this.eventBus?.publish("HIDE_TOAST_LIST",null)}async handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}handleCloseToast(t){if(this.customToasts.find(o=>o.toastId===t)){this.lifetimeManager.stop(t);let o=T[t];o?.(),P(t);return}this.handleTransactionToastClose(t)}async publishTransactionToasts(){if(this.notificationsFeedManager.isNotificationsFeedOpen()&&this.eventBus){this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",this.transactionToasts),this.hideToasts();return}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(),xt(),this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[]}};export{x as a,F as b,T as c,_t as d,P as e,xt as f,zo as g,Nt as h,k as i,M as j,D as k,p as l,N as m,B as n,bt as o,_ as p,Ct as q,O as r,wt as s,h as t,St as u};
|
|
2
|
+
//# sourceMappingURL=chunk-H3EGIL75.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-C754AWVZ.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-JLVA2UHR.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as o,f as a,g as i,h as r}from"./chunk-TQA3JDNV.mjs";import{u as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as o,f as a,g as i,h as r}from"./chunk-TQA3JDNV.mjs";import{u as c}from"./chunk-YOJAS3PK.mjs";function b(){let t=c(),l=r(t),u=i(t),T=a(t),d=o(t),e=Object.keys(d)?.length>0,n=!e&&Object.keys(l)?.length>0,s=!e&&!n&&Object.keys(u)?.length>0,f=!e&&!n&&!s&&Object.keys(T).length>0;return{pending:e,timedOut:n,fail:s,success:f}}export{b as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JWGB5GYU.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-6Z4GXMSW.mjs";import{a}from"./chunk-WADOAKBZ.mjs";import{a as u}from"./chunk-SNJKYJAD.mjs";import{c as n}from"./chunk-MMBSMAYP.mjs";import{a as s}from"./chunk-MONQ4RXB.mjs";var c=(o,t)=>{let r=`sdk-dapp-logout-event-${o}`,e=t.getItem(r);e&&o!==e||(t.setItem(r,o),t.removeItem(r))};async function L({provider:o,options:t={shouldBroadcastLogoutAcrossTabs:!0}}){let r=a();t.shouldBroadcastLogoutAcrossTabs&&s.localStorage&&c(r,s.localStorage);try{return u(),n.forEach(g=>g()),n.clear(),i.closeConnectionRef?.(),await o.logout()}catch(e){return console.error("Logging out error:",e),!1}}export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KMSI4FA6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{u as e}from"./chunk-YOJAS3PK.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-KRB3XH4K.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as B}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as B}from"./chunk-X6ITADSX.mjs";import{a as b}from"./chunk-LZITSA2G.mjs";import{a as k}from"./chunk-QXC4D3AC.mjs";import{a as R}from"./chunk-OD4ANAAQ.mjs";import{a as D}from"./chunk-VDDLODBL.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as j}from"./chunk-2DFE24NA.mjs";import{a as _}from"./chunk-2UIRKC76.mjs";import{a as A}from"./chunk-MKHSCAMQ.mjs";import{a as O}from"./chunk-NNNFX3FU.mjs";import{u as x}from"./chunk-YOJAS3PK.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-PJWJZHIS.mjs";import{a as w}from"./chunk-NTEMINYA.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard: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-LJBVZK5V.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{s as a}from"./chunk-YOJAS3PK.mjs";var r=({key:e,value:t})=>{a().setState(({cache:c})=>{c[e]=t},!1,"saveToCache")},s=e=>{a().setState(({cache:t})=>{delete t[e]},!1,"removeFromCache")},h=()=>{a().setState(({cache:e})=>{Object.keys(e).forEach(t=>{delete e[t]})},!1,"clearCache")};export{r as a,s as b,h as c};
|
|
2
|
+
//# sourceMappingURL=chunk-LJZO6JVX.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{t as n}from"./chunk-H3EGIL75.mjs";import{a as i}from"./chunk-PLUWBWJ2.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-LZITSA2G.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-T26S2V72.mjs";import{c as e}from"./chunk-MGFIOCA4.mjs";var o=class i extends s{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE_SIGN_TRANSACTIONS",uiTag:"mvx-sign-transactions-panel"});this.addressesPerPage=10;this._ppuMap={};this.initialData={commonData:{transactionsCount:0,currentIndexToSign:0,egldLabel:"",currentIndex:0,ppuOptions:[],address:"",origin:""},tokenTransaction:null,nftTransaction:null,sftTransaction:null};this.data={...this.initialData}}static getInstance(){return i.instance||(i.instance=new i),i.instance}get transactionsCount(){return this.data.commonData.transactionsCount}initializeGasPriceMap(a){let t=0;a.filter(n=>n!=null).forEach(n=>{let r=n?Number(n.gasPrice):0;this.updateGasPriceMap({nonce:Number(n.nonce),ppu:t,initialGasPrice:r})}),this.updateCommonData({ppu:t})}updateGasPriceMap({nonce:a,ppu:t,initialGasPrice:n}){this._ppuMap[a]={...this._ppuMap[a],ppu:t},n&&(this._ppuMap[a].initialGasPrice=n)}updateCommonData(a){this.data.commonData={...this.data.commonData,...a},this.notifyDataUpdate()}updateIsLoading(a){this.data.isLoading=a,this.notifyDataUpdate()}updateTokenTransaction(a){this.data.tokenTransaction=a,this.data.sftTransaction=null,this.data.nftTransaction=null,this.notifyDataUpdate()}updateNonFungibleTransaction(a,t){switch(a){case"NonFungibleESDT":this.data.nftTransaction=t,this.data.tokenTransaction=null,this.data.sftTransaction=null;break;case"SemiFungibleESDT":this.data.sftTransaction=t,this.data.nftTransaction=null,this.data.tokenTransaction=null;break;default:break}this.notifyDataUpdate()}get currentScreenIndex(){return this.data.commonData.currentIndex}get ppuMap(){return this._ppuMap}async setupEventListeners(){this.eventBus&&this.subscribeToEventBus("CLOSE_SIGN_TRANSACTIONS",this.closeUI.bind(this))}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MKHSCAMQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-MONQ4RXB.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-MMBSMAYP.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/constants/window.constants.ts"],
|
|
4
|
-
"sourcesContent": ["export const safeWindow: Window =\n typeof window !== 'undefined' ? window : ({} as Window);\n\nexport const version = '5.0.
|
|
4
|
+
"sourcesContent": ["export const safeWindow: Window =\n typeof window !== 'undefined' ? window : ({} as Window);\n\nexport const version = '5.0.7'; // will be replaced at build time\n"],
|
|
5
5
|
"mappings": "AAAO,IAAMA,EACX,OAAO,OAAW,IAAc,OAAU,CAAC,EAEhCC,EAAU",
|
|
6
6
|
"names": ["safeWindow", "version"]
|
|
7
7
|
}
|