@multiversx/sdk-dapp 5.2.3 → 5.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/__chunks__/chunk-2A6ODBDO.mjs +2 -0
- package/out/__chunks__/{chunk-7OUDTQCF.mjs → chunk-344SJWHZ.mjs} +2 -2
- package/out/__chunks__/chunk-34D6F2ZD.mjs +2 -0
- package/out/__chunks__/chunk-3TYENBPS.mjs +2 -0
- package/out/__chunks__/{chunk-TYWA6773.mjs → chunk-3YSWYYBW.mjs} +2 -2
- package/out/__chunks__/{chunk-SN3EZ6GY.mjs → chunk-5FTIQVXR.mjs} +2 -2
- package/out/__chunks__/{chunk-EOIEYWZV.mjs → chunk-5NEP4WM3.mjs} +2 -2
- package/out/__chunks__/{chunk-JNYQYPLX.mjs → chunk-5UBTVBPC.mjs} +2 -2
- package/out/__chunks__/chunk-5Z3MOBIC.mjs +2 -0
- package/out/__chunks__/{chunk-GJJZZWVD.mjs → chunk-6FKT2TIN.mjs} +2 -2
- package/out/__chunks__/chunk-6NK63AU5.mjs +2 -0
- package/out/__chunks__/{chunk-KY32AS5A.mjs.map → chunk-6NK63AU5.mjs.map} +1 -1
- package/out/__chunks__/{chunk-PYDEFY6F.mjs → chunk-7AAHDJYY.mjs} +2 -2
- package/out/__chunks__/chunk-7AIQVQRI.mjs +2 -0
- package/out/__chunks__/chunk-7NJ4ME6K.mjs +2 -0
- package/out/__chunks__/{chunk-F4B56PJO.mjs → chunk-7ORWWRDO.mjs} +2 -2
- package/out/__chunks__/chunk-ALXGPWX7.mjs +2 -0
- package/out/__chunks__/chunk-AWHIX3FQ.mjs +2 -0
- package/out/__chunks__/{chunk-OU4PEXX6.mjs → chunk-BX2RQZG2.mjs} +2 -2
- package/out/__chunks__/{chunk-SI4DRNUN.mjs → chunk-D6TVFZA6.mjs} +2 -2
- package/out/__chunks__/{chunk-PMMHNOCU.mjs → chunk-DCYZQKT5.mjs} +2 -2
- package/out/__chunks__/{chunk-ORJELHOZ.mjs → chunk-DDCSKHZU.mjs} +2 -2
- package/out/__chunks__/{chunk-VM7SOWPA.mjs → chunk-DMLHCYO2.mjs} +2 -2
- package/out/__chunks__/{chunk-K4VQ6UWP.mjs → chunk-DVPFOACI.mjs} +2 -2
- package/out/__chunks__/{chunk-NBY6GGN5.mjs → chunk-E5H5BPFX.mjs} +2 -2
- package/out/__chunks__/{chunk-OFSRI5RR.mjs → chunk-E5T25VDS.mjs} +2 -2
- package/out/__chunks__/{chunk-DR66NBJB.mjs → chunk-ENQBQ3K2.mjs} +2 -2
- package/out/__chunks__/{chunk-OW6TI77R.mjs → chunk-F2HEHTHJ.mjs} +2 -2
- package/out/__chunks__/{chunk-FZCVPUJU.mjs → chunk-GLWYAOLR.mjs} +2 -2
- package/out/__chunks__/{chunk-SIXE5BNQ.mjs → chunk-GULZHAFR.mjs} +2 -2
- package/out/__chunks__/{chunk-4KTAXWHS.mjs → chunk-HX3GPSEV.mjs} +2 -2
- package/out/__chunks__/{chunk-WO6VWFRK.mjs → chunk-HYHCFQ2X.mjs} +2 -2
- package/out/__chunks__/{chunk-EGBOHDEU.mjs → chunk-I3KT7K7E.mjs} +2 -2
- package/out/__chunks__/{chunk-OGZTCDLF.mjs → chunk-IMB7RORC.mjs} +2 -2
- package/out/__chunks__/{chunk-WDIKEQ4G.mjs → chunk-IOTN5P72.mjs} +2 -2
- package/out/__chunks__/chunk-IQ6TLUA6.mjs +2 -0
- package/out/__chunks__/{chunk-COBXCFVC.mjs → chunk-KBKZR473.mjs} +2 -2
- package/out/__chunks__/chunk-KTOQBOOK.mjs +2 -0
- package/out/__chunks__/chunk-KTOQBOOK.mjs.map +7 -0
- package/out/__chunks__/chunk-KWAUHAGX.mjs +2 -0
- package/out/__chunks__/{chunk-2DOX4XMK.mjs → chunk-KWUIUJYQ.mjs} +2 -2
- package/out/__chunks__/{chunk-B3VUBSL4.mjs → chunk-LV5G3A3I.mjs} +2 -2
- package/out/__chunks__/{chunk-DWVQFEQG.mjs → chunk-MMY7MLSC.mjs} +2 -2
- package/out/__chunks__/{chunk-C7FCKWVR.mjs → chunk-NOLOZJ37.mjs} +2 -2
- package/out/__chunks__/{chunk-BDAAMNBN.mjs → chunk-NTTKKJIS.mjs} +2 -2
- package/out/__chunks__/{chunk-RVQLK36O.mjs → chunk-O2CA5SYO.mjs} +2 -2
- package/out/__chunks__/{chunk-WWL53TSG.mjs → chunk-O4E4JGDU.mjs} +2 -2
- package/out/__chunks__/{chunk-WWL53TSG.mjs.map → chunk-O4E4JGDU.mjs.map} +3 -3
- package/out/__chunks__/{chunk-MVTZTMVB.mjs → chunk-O5IYHOPF.mjs} +2 -2
- package/out/__chunks__/{chunk-DWKNS2L6.mjs → chunk-OXYCJJ2S.mjs} +2 -2
- package/out/__chunks__/{chunk-EPTFZ77Y.mjs → chunk-PGGS4CPP.mjs} +2 -2
- package/out/__chunks__/{chunk-PUFX36NA.mjs → chunk-PRIEU2AB.mjs} +2 -2
- package/out/__chunks__/{chunk-FHLON6CU.mjs → chunk-Q2J2GZXF.mjs} +2 -2
- package/out/__chunks__/{chunk-YV26DNK5.mjs → chunk-QAZET2LQ.mjs} +2 -2
- package/out/__chunks__/{chunk-LSRKINNP.mjs → chunk-QFYMQSDX.mjs} +2 -2
- package/out/__chunks__/{chunk-53YTBT65.mjs → chunk-QXU7U2E2.mjs} +2 -2
- package/out/__chunks__/{chunk-4PMRBZVR.mjs → chunk-RBSHB26S.mjs} +2 -2
- package/out/__chunks__/{chunk-DDOXD4IN.mjs → chunk-RLHETJG2.mjs} +2 -2
- package/out/__chunks__/{chunk-4XZ2LJKD.mjs → chunk-RS5NVDUR.mjs} +2 -2
- package/out/__chunks__/{chunk-FNVS326O.mjs → chunk-RYPO7VR2.mjs} +2 -2
- package/out/__chunks__/chunk-SKXGLO3R.mjs +2 -0
- package/out/__chunks__/{chunk-476M52X7.mjs → chunk-SRY5QN4N.mjs} +2 -2
- package/out/__chunks__/chunk-T7CVBDC6.mjs +2 -0
- package/out/__chunks__/{chunk-UUCM2B5J.mjs → chunk-T7LCG3ZL.mjs} +2 -2
- package/out/__chunks__/chunk-TTNGTT4H.mjs +2 -0
- package/out/__chunks__/{chunk-PC6HDNCW.mjs → chunk-TTSG76TF.mjs} +2 -2
- package/out/__chunks__/{chunk-XZIUMXWJ.mjs → chunk-TZDM7KH7.mjs} +2 -2
- package/out/__chunks__/{chunk-7RM2765V.mjs → chunk-UAPKL5IP.mjs} +2 -2
- package/out/__chunks__/{chunk-AQHQWVF7.mjs → chunk-ULL2LOGL.mjs} +2 -2
- package/out/__chunks__/{chunk-I5YANLWR.mjs → chunk-UPBPNO3G.mjs} +2 -2
- package/out/__chunks__/chunk-V6VNRFXC.mjs +2 -0
- package/out/__chunks__/{chunk-WKAAF3SF.mjs → chunk-VTNFUJCE.mjs} +2 -2
- package/out/__chunks__/{chunk-4MBPMZP7.mjs → chunk-W3WUNRIB.mjs} +2 -2
- package/out/__chunks__/{chunk-DJX43EJZ.mjs → chunk-WIHUEHY3.mjs} +2 -2
- package/out/__chunks__/{chunk-S3KFVBK5.mjs → chunk-WTHOSLUO.mjs} +2 -2
- package/out/__chunks__/{chunk-QP6RME6L.mjs → chunk-WWV3ASWP.mjs} +2 -2
- package/out/__chunks__/{chunk-OXQS44QJ.mjs → chunk-YAONXG5V.mjs} +2 -2
- package/out/__chunks__/chunk-YGT2XHMA.mjs +2 -0
- package/out/__chunks__/{chunk-XZ52KQTC.mjs → chunk-YSF6K5W7.mjs} +2 -2
- package/out/__chunks__/{chunk-Y4QU4QCG.mjs → chunk-Z4KZH4G3.mjs} +2 -2
- package/out/__chunks__/{chunk-TWPRIAIS.mjs → chunk-ZG5S2DYH.mjs} +2 -2
- package/out/__chunks__/chunk-ZMTIF2D2.mjs +2 -0
- package/out/apiCalls/account/getScamAddressData.mjs +1 -1
- package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
- package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
- package/out/apiCalls/index.mjs +1 -1
- package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/index.mjs +1 -1
- package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
- package/out/constants/browser.constants.mjs +1 -1
- package/out/constants/index.mjs +1 -1
- package/out/constants/storage.constants.mjs +1 -1
- package/out/constants/window.constants.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.cjs +5 -2
- package/out/controllers/TransactionsTableController/TransactionsTableController.cjs.map +2 -2
- 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/ToastManager/ToastManager.mjs +1 -1
- package/out/managers/ToastManager/helpers/LifetimeManager.mjs +1 -1
- package/out/managers/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
- package/out/managers/ToastManager/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/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.cjs +3 -2
- package/out/providers/ProviderFactory.cjs.map +2 -2
- package/out/providers/ProviderFactory.mjs +1 -1
- package/out/providers/helpers/accountProvider.mjs +1 -1
- package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
- package/out/providers/helpers/restoreProvider.mjs +1 -1
- package/out/providers/index.mjs +1 -1
- package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
- package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
- package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.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-24C5LP2A.mjs +0 -2
- package/out/__chunks__/chunk-2GGIYSMR.mjs +0 -2
- package/out/__chunks__/chunk-4FVVKVQH.mjs +0 -2
- package/out/__chunks__/chunk-B5EFA3UI.mjs +0 -2
- package/out/__chunks__/chunk-EINZFJLE.mjs +0 -2
- package/out/__chunks__/chunk-F7LAL7TT.mjs +0 -2
- package/out/__chunks__/chunk-J3N3E7IG.mjs +0 -2
- package/out/__chunks__/chunk-JSDC7MZY.mjs +0 -2
- package/out/__chunks__/chunk-JSDC7MZY.mjs.map +0 -7
- package/out/__chunks__/chunk-KBHVNJKO.mjs +0 -2
- package/out/__chunks__/chunk-KY32AS5A.mjs +0 -2
- package/out/__chunks__/chunk-OZIFKO5Z.mjs +0 -2
- package/out/__chunks__/chunk-P3UF6ZIP.mjs +0 -2
- package/out/__chunks__/chunk-RICEXBPH.mjs +0 -2
- package/out/__chunks__/chunk-RNST72DL.mjs +0 -2
- package/out/__chunks__/chunk-SJM4QVVT.mjs +0 -2
- package/out/__chunks__/chunk-UIXNOVHP.mjs +0 -2
- package/out/__chunks__/chunk-UPQEWATF.mjs +0 -2
- package/out/__chunks__/chunk-WMLOH6TA.mjs +0 -2
- /package/out/__chunks__/{chunk-P3UF6ZIP.mjs.map → chunk-2A6ODBDO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7OUDTQCF.mjs.map → chunk-344SJWHZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-24C5LP2A.mjs.map → chunk-34D6F2ZD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UIXNOVHP.mjs.map → chunk-3TYENBPS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TYWA6773.mjs.map → chunk-3YSWYYBW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SN3EZ6GY.mjs.map → chunk-5FTIQVXR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EOIEYWZV.mjs.map → chunk-5NEP4WM3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JNYQYPLX.mjs.map → chunk-5UBTVBPC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EINZFJLE.mjs.map → chunk-5Z3MOBIC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GJJZZWVD.mjs.map → chunk-6FKT2TIN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PYDEFY6F.mjs.map → chunk-7AAHDJYY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SJM4QVVT.mjs.map → chunk-7AIQVQRI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UPQEWATF.mjs.map → chunk-7NJ4ME6K.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-F4B56PJO.mjs.map → chunk-7ORWWRDO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-J3N3E7IG.mjs.map → chunk-ALXGPWX7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4FVVKVQH.mjs.map → chunk-AWHIX3FQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OU4PEXX6.mjs.map → chunk-BX2RQZG2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SI4DRNUN.mjs.map → chunk-D6TVFZA6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PMMHNOCU.mjs.map → chunk-DCYZQKT5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ORJELHOZ.mjs.map → chunk-DDCSKHZU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VM7SOWPA.mjs.map → chunk-DMLHCYO2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-K4VQ6UWP.mjs.map → chunk-DVPFOACI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NBY6GGN5.mjs.map → chunk-E5H5BPFX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OFSRI5RR.mjs.map → chunk-E5T25VDS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DR66NBJB.mjs.map → chunk-ENQBQ3K2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OW6TI77R.mjs.map → chunk-F2HEHTHJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FZCVPUJU.mjs.map → chunk-GLWYAOLR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SIXE5BNQ.mjs.map → chunk-GULZHAFR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4KTAXWHS.mjs.map → chunk-HX3GPSEV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WO6VWFRK.mjs.map → chunk-HYHCFQ2X.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EGBOHDEU.mjs.map → chunk-I3KT7K7E.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OGZTCDLF.mjs.map → chunk-IMB7RORC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WDIKEQ4G.mjs.map → chunk-IOTN5P72.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RNST72DL.mjs.map → chunk-IQ6TLUA6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-COBXCFVC.mjs.map → chunk-KBKZR473.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-B5EFA3UI.mjs.map → chunk-KWAUHAGX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2DOX4XMK.mjs.map → chunk-KWUIUJYQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-B3VUBSL4.mjs.map → chunk-LV5G3A3I.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DWVQFEQG.mjs.map → chunk-MMY7MLSC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-C7FCKWVR.mjs.map → chunk-NOLOZJ37.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BDAAMNBN.mjs.map → chunk-NTTKKJIS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RVQLK36O.mjs.map → chunk-O2CA5SYO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MVTZTMVB.mjs.map → chunk-O5IYHOPF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DWKNS2L6.mjs.map → chunk-OXYCJJ2S.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EPTFZ77Y.mjs.map → chunk-PGGS4CPP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PUFX36NA.mjs.map → chunk-PRIEU2AB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FHLON6CU.mjs.map → chunk-Q2J2GZXF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YV26DNK5.mjs.map → chunk-QAZET2LQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LSRKINNP.mjs.map → chunk-QFYMQSDX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-53YTBT65.mjs.map → chunk-QXU7U2E2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4PMRBZVR.mjs.map → chunk-RBSHB26S.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DDOXD4IN.mjs.map → chunk-RLHETJG2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4XZ2LJKD.mjs.map → chunk-RS5NVDUR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FNVS326O.mjs.map → chunk-RYPO7VR2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KBHVNJKO.mjs.map → chunk-SKXGLO3R.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-476M52X7.mjs.map → chunk-SRY5QN4N.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2GGIYSMR.mjs.map → chunk-T7CVBDC6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UUCM2B5J.mjs.map → chunk-T7LCG3ZL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WMLOH6TA.mjs.map → chunk-TTNGTT4H.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PC6HDNCW.mjs.map → chunk-TTSG76TF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XZIUMXWJ.mjs.map → chunk-TZDM7KH7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7RM2765V.mjs.map → chunk-UAPKL5IP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AQHQWVF7.mjs.map → chunk-ULL2LOGL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-I5YANLWR.mjs.map → chunk-UPBPNO3G.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RICEXBPH.mjs.map → chunk-V6VNRFXC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WKAAF3SF.mjs.map → chunk-VTNFUJCE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4MBPMZP7.mjs.map → chunk-W3WUNRIB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DJX43EJZ.mjs.map → chunk-WIHUEHY3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-S3KFVBK5.mjs.map → chunk-WTHOSLUO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QP6RME6L.mjs.map → chunk-WWV3ASWP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OXQS44QJ.mjs.map → chunk-YAONXG5V.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-F7LAL7TT.mjs.map → chunk-YGT2XHMA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XZ52KQTC.mjs.map → chunk-YSF6K5W7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Y4QU4QCG.mjs.map → chunk-Z4KZH4G3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TWPRIAIS.mjs.map → chunk-ZG5S2DYH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OZIFKO5Z.mjs.map → chunk-ZMTIF2D2.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-L3MWDI6J.mjs";import{q as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-L3MWDI6J.mjs";import{q as i}from"./chunk-D6TVFZA6.mjs";import{current as p}from"immer";var h=({transactions:s,transactionsDisplayInfo:r,status:e,sessionInformation:t})=>{let a=Date.now().toString();return i().setState(({transactions:n})=>{n[a]={transactions:s,status:e,transactionsDisplayInfo:r,interpretedTransactions:{},sessionInformation:t}},!1,"createTransactionsSession"),a},T=({sessionId:s,status:r,errorMessage:e})=>{i().setState(({transactions:t})=>{if(!t[s])return;let a=p(t[s]).transactionsDisplayInfo,n=e||a?.errorMessage;t[s].status=r,t[s].errorMessage=n,t[s].transactionsDisplayInfo={...a,errorMessage:n}},!1,"updateTransactionsSession")},E=({sessionId:s,transaction:r})=>{let e=null;return i().setState(({transactions:t})=>{let a=t[s]?.transactions;if(a!=null){t[s].transactions=a.map(o=>o.hash===r.hash?{...o,...r??{}}:o);let n=u([...t[s].transactions]);n&&(T({sessionId:s,status:n}),e=n)}},!1,"updateTransactionStatus"),e},D=()=>{i().setState(({transactions:s,toasts:r})=>{let t=Object.keys(s).filter(n=>{let o=s[n];if(!o)return!1;let{status:c}=o;return!(c==="pending"||c==="signed"||c==="sent")});t.forEach(n=>{delete s[n]});let a=r.transactionToasts.filter(n=>!t.includes(n.toastId));r.transactionToasts=a},!1,"clearCompletedTransactions")};export{h as a,T as b,E as c,D as d};
|
|
2
|
+
//# sourceMappingURL=chunk-344SJWHZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{q as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{q as a}from"./chunk-D6TVFZA6.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-3YSWYYBW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as o,c as i}from"./chunk-QJGFIK7H.mjs";import{w as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as o,c as i}from"./chunk-QJGFIK7H.mjs";import{w as g}from"./chunk-YAONXG5V.mjs";import{q as M}from"./chunk-D6TVFZA6.mjs";import{a as d}from"./chunk-UERJ6AKK.mjs";import{a as u,c as p,g as c}from"./chunk-NTEMINYA.mjs";import{a as l}from"./chunk-6NK63AU5.mjs";var m=class{constructor({onLoginCancelled:e}){this.handlers=new Map;this.store=M();this.isLoginInitiated=!1;this.handleMessage=this.handleMessage.bind(this),this.handleLoginCancelled=e}startListening(){l.addEventListener("message",this.handleMessage)}stopListening(){l.removeEventListener("message",this.handleMessage)}registerEvent(e,s){this.handlers.set(e,s)}unregisterEvent(e){this.handlers.delete(e)}async handleMessage(e){let s=e.data?.type;if(typeof s=="string"&&this.handlers.has(s))return this.handlers.get(s)?.(e);switch(s){case o.finalizeHandshakeRequest:this.handshake({event:e});break;case o.signMessageRequest:this.signMessage({event:e,payload:e.data.payload});break;case o.loginRequest:this.isLoginInitiated=!0,this.login({event:e,payload:e.data.payload});break;case o.signTransactionsRequest:this.signTransactions({event:e});break;case i.cancelResponse:case"cancelAction":this.isLoginInitiated&&await this.handleLoginCancelled();break;default:break}}async login({event:e,payload:s}){let a=s?.token;if(a)try{let{address:t}=d(this.store.getState()),r=g(),n=`${t}${a}`,y=new c({address:new p(t),data:new Uint8Array(Buffer.from(n))}),f=(await r.signMessage(y))?.signature??"";e.source?.postMessage({type:i.loginResponse,payload:{data:{address:t,signature:Buffer.from(f).toString("hex")}}},{targetOrigin:e.origin})}catch{this.isLoginInitiated&&this.handleLoginCancelled()}finally{this.isLoginInitiated=!1}}handshake({event:e}){let s=Date.now().toString();e.source?.postMessage({type:i.finalizeHandshakeResponse,payload:{data:s}},{targetOrigin:e.origin})}async signMessage({event:e,payload:s}){let{address:a}=d(this.store.getState()),{message:t}=s;try{let r=new c({address:new p(a),data:new Uint8Array(Buffer.from(t))}),h=(await g().signMessage(r))?.signature??"";e.source?.postMessage({type:i.signMessageResponse,payload:{data:{signature:Buffer.from(h).toString("hex"),status:"signed"}}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign message")}}async signTransactions({event:e}){let s=g(),{payload:a}=e.data;if(Array.isArray(a))try{let t=a.map(n=>u.newFromPlainObject(n)),r=await s.signTransactions(t);e.source?.postMessage({type:i.signTransactionsResponse,payload:{data:r.map(n=>n.toPlainObject())}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign transactions")}}};export{m as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5FTIQVXR.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-O2CA5SYO.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-5NEP4WM3.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-TQA3JDNV.mjs";import{s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-TQA3JDNV.mjs";import{s}from"./chunk-D6TVFZA6.mjs";import{e as a}from"./chunk-UERJ6AKK.mjs";function x(n){let e=s(),o=u(e),c=a(e),t=Object.keys(o).map(Number).reduce((r,m)=>{let i=o[m]?.transactions||[];return Math.max(r,...i.map(l=>l.nonce),0)},0);return t>0&&(t+=1),n==null?Math.max(t,c):Math.max(t,n.nonce,c)}export{x as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5UBTVBPC.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as t}from"./chunk-HYHCFQ2X.mjs";import{c as n}from"./chunk-D6TVFZA6.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-5Z3MOBIC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as p,q as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{j as p,q as e}from"./chunk-D6TVFZA6.mjs";import{c as i}from"./chunk-NTEMINYA.mjs";var T=()=>e().setState(p),a=({address:o,providerType:d})=>{e().setState(({account:r,loginInfo:t})=>{r.address=o,r.publicKey=new i(o).toHex(),t&&(t.providerType=d)},!1,"loginAction")};export{T as a,a as b};
|
|
2
|
+
//# sourceMappingURL=chunk-6FKT2TIN.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.2.
|
|
4
|
+
"sourcesContent": ["export const safeWindow: Window =\n typeof window !== 'undefined' ? window : ({} as Window);\n\nexport const version = '5.2.4'; // will be replaced at build time\n"],
|
|
5
5
|
"mappings": "AAAO,IAAMA,EACX,OAAO,OAAW,IAAc,OAAU,CAAC,EAEhCC,EAAU",
|
|
6
6
|
"names": ["safeWindow", "version"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-RYPO7VR2.mjs";var i=async a=>{let r=a.map(s=>s.hash),n=await e(r);return a.map(s=>{let t=n.find(o=>o?.txHash===s.hash);return{...s,status:t?.status,invalidTransaction:t==null,results:t?.results??[],previousStatus:s.status?.toString()||"",hasStatusChanged:!!(t&&t.status!==s.status)}})};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7AAHDJYY.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-6NK63AU5.mjs";var i=String(o?.navigator?.userAgent),t=/^((?!chrome|android).)*safari/i.test(i),r=/firefox/i.test(i)&&/windows/i.test(i),n=t||r;export{t as a,n as b};
|
|
2
|
+
//# sourceMappingURL=chunk-7ORWWRDO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-O7LCTC4K.mjs";import{s as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-O7LCTC4K.mjs";import{s as m}from"./chunk-D6TVFZA6.mjs";import{b as a}from"./chunk-SAAOQW7P.mjs";import{o as r,u as i}from"./chunk-KD2IQ32V.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";async function b({tokenId:o}){let t=a(m()),{isNft:k}=c(o),n=o,p=k?r:i;if(!n)return{tokenDecimals:Number(t.decimals),tokenLabel:"",tokenAvatar:""};try{let{data:e}=await s.get(`${t.apiAddress}/${p}/${n}`),f=e?e?.decimals:Number(t.decimals),l=e?e?.name:"",d=e?e?.assets?.svgUrl??e?.media?.[0]?.thumbnailUrl:"";return{tokenDecimals:f,tokenLabel:l,type:e?.type,tokenAvatar:d,identifier:e?.identifier,assets:e?.assets,esdtPrice:e?.price,ticker:e?.ticker,name:e?.name}}catch(e){return{error:`Error fetching token ${n}: ${e.toString()}`,tokenDecimals:Number(t.decimals),tokenLabel:"",tokenAvatar:"",identifier:n}}}export{b as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BX2RQZG2.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as s,f as a}from"./chunk-UERJ6AKK.mjs";import{f as p}from"./chunk-VNLGNNIL.mjs";import{a as d,b as L}from"./chunk-NLRDRI7Q.mjs";import{a as k}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s,f as a}from"./chunk-UERJ6AKK.mjs";import{f as p}from"./chunk-VNLGNNIL.mjs";import{a as d,b as L}from"./chunk-NLRDRI7Q.mjs";import{a as k}from"./chunk-SKXGLO3R.mjs";import{a as v}from"./chunk-KRWR77QE.mjs";import{b as y}from"./chunk-A7FTKX2A.mjs";import{a as c,b as g}from"./chunk-WZGG2YKQ.mjs";import{a as m,b as f}from"./chunk-M7BM6QPB.mjs";import{a as T}from"./chunk-CYCS3K6Q.mjs";import{a as S,b as u}from"./chunk-VKEESSBI.mjs";import{a as x}from"./chunk-2DNGCNYM.mjs";import{a as I}from"./chunk-NB7A4C7L.mjs";import{c as l}from"./chunk-NTEMINYA.mjs";import{createJSONStorage as O,devtools as V,persist as h}from"zustand/middleware";import{immer as N}from"zustand/middleware/immer";import{createStore as J}from"zustand/vanilla";var A=e=>{e.account=c,e.loginInfo=m,e.transactions=d,e.toasts=S};function H(){return new Date().setHours(new Date().getHours()+24)}function w(e){if(e==null){E();return}b(e)}var C=e=>{let t=a(e),n=p(e),{address:i,publicKey:M}=s(e);if(i&&M!==new l(i).toHex()&&A(e),!t)return;if(n==null){w(H());return}let P=Date.now();n-P<0&&(w(null),o().setState(A))};var z=(e,t)=>{C(e)};var W=e=>{let t=J(V(h(N((...n)=>({network:x(...n),account:g(...n),loginInfo:f(...n),config:T(...n),transactions:L(...n),toasts:u(...n),cache:y(...n),ui:I(...n)})),{name:"sdk-dapp-store",storage:O(e)})));return t.subscribe(z),t},r,D=e=>{r=e},o=()=>(r||D(W(()=>new v)),r),pe=(e=k)=>{let t=W(e);return D(t),t},le=()=>o().getState();var me=e=>o().setState(({loginInfo:t})=>{t.providerType=e},!1,"setProviderType"),fe=e=>o().setState(({loginInfo:t})=>{t.tokenLogin=e},!1,"setTokenLogin"),Se=e=>o().setState(({loginInfo:t})=>{if(t.tokenLogin!=null){t.tokenLogin.loginToken=e;return}t.tokenLogin={loginToken:e}},!1,"setLoginToken"),ue=e=>o().setState(({loginInfo:t})=>{t?.tokenLogin!=null&&(t.tokenLogin.signature=e)},!1,"setTokenLoginSignature"),de=e=>o().setState(({loginInfo:t})=>{t.walletConnectLogin=e},!1,"setWalletConnectLogin"),Le=e=>o().setState(({loginInfo:t})=>{t.ledgerLogin=e},!1,"setLedgerLogin"),xe=e=>o().setState(({loginInfo:t})=>{t.isWalletConnectV2Initialized=e},!1,"setIsWalletConnectV2Initialized"),E=()=>o().setState(({loginInfo:e})=>{e.loginExpiresAt=null},!1,"removeLoginExpiresAt"),b=e=>o().setState(({loginInfo:t})=>{t.loginExpiresAt=e},!1,"addLoginExpiresAt");export{me as a,fe as b,Se as c,ue as d,de as e,Le as f,xe as g,E as h,b as i,A as j,H as k,w as l,C as m,z as n,W as o,D as p,o as q,pe as r,le as s};
|
|
2
|
+
//# sourceMappingURL=chunk-D6TVFZA6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-7NJ4ME6K.mjs";import{a as f}from"./chunk-ULL2LOGL.mjs";import{a as g}from"./chunk-QAZET2LQ.mjs";import{b as a}from"./chunk-D6TVFZA6.mjs";import{c as s,g as r}from"./chunk-NTEMINYA.mjs";var v=async({signMessageCallback:m,nativeAuthClientConfig:o})=>{let{address:t}=u(),c=g(),i=f(o||c),e=await i.initialize({noCache:!!o});if(!e)return null;let h=new r({address:new s(t),data:Buffer.from(`${t}${e}`)}),n=await m(h,{});if(!n?.signature)throw"Message not signed";return a({loginToken:e,signature:Buffer.from(n.signature).toString("hex")}),i.getToken({address:t,token:e,signature:Buffer.from(n.signature).toString("hex")})};export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DCYZQKT5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{q as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{q as c}from"./chunk-D6TVFZA6.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-DDCSKHZU.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-6NK63AU5.mjs";function r(t){try{if(!e)return;e.document.documentElement.dataset.mvxTheme=t}catch{console.log("Error switching the theme!")}}export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DMLHCYO2.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-YSF6K5W7.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-DVPFOACI.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-SRY5QN4N.mjs";import{a as s}from"./chunk-F2HEHTHJ.mjs";import{a as k}from"./chunk-B2RDSGON.mjs";import{a as L}from"./chunk-3TYENBPS.mjs";import{b as A}from"./chunk-DDCSKHZU.mjs";import{a as I}from"./chunk-BRJNX4JF.mjs";import{f as p}from"./chunk-D6TVFZA6.mjs";import{a as f}from"./chunk-KD2IQ32V.mjs";import{a as x}from"./chunk-ZONHCECO.mjs";import{BigNumber as C}from"bignumber.js";async function M({options:d,config:i,provider:a,login:c}){let e=h.getInstance(),T=L(),b=k({loginToken:d?.token,version:i.version}),o={manager:e,provider:a};await s(o);let t=await new Promise(async function(E,w){async function g(r){let n=e?e.addressesPerPage??1:1,l=new C(r-1).times(n);e?.updateStartIndex(Math.max(0,parseInt(l.toString()))),await s(o)}async function u(r){if(!(!a||!c)){e?.updateConfirmScreen({...b,selectedAddress:r.selectedAddress,explorerLink:I({to:`/${f}/${r.selectedAddress}`,explorerAddress:T})});try{let n=d?.token?await a.tokenLogin({token:Buffer.from(`${d?.token}{}`),addressIndex:r.addressIndex}):await c({addressIndex:r.addressIndex});E({address:n.address,signature:n.signature?n.signature.toString("hex"):"",addressIndex:r.addressIndex})}catch(n){console.error("User rejected login:",n),!!e?.getConfirmScreenData()&&await s(o)}}}async function m(){await s(o),e.unsubscribeFromAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g}),w("User cancelled login")}e.subscribeToAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g})}),{version:P,dataEnabled:v}=i;return p({index:t.addressIndex,loginType:x.ledger}),A({address:t.address,index:t.addressIndex,version:P,hasContractDataEnabled:v}),{address:t.address,signature:t.signature}}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-E5H5BPFX.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-RLHETJG2.mjs";import{a as e}from"./chunk-ALXGPWX7.mjs";import{a as i}from"./chunk-ZVIKYGX5.mjs";var a=class{constructor(o){this.address="";this._login=null;this.loginAbortController=null;this.cancelLogin=()=>{this.loginAbortController&&this.loginAbortController.abort(),this.cancelAction?.(),this.loginAbortController=null};this.loginOperation=async o=>{if(!this._login)throw new Error("Provider is not initialized.");let r=await this._login(o);if(!r?.address)throw new Error("Provider is not initialized.");return{...r,address:r.address,signature:r.signature??""}};this.initializeAddress=()=>{if(this.address)return;let o=e();o&&(this.address=o)};this.cancelAction=void 0;this.address=o??""}getAccount(){throw new Error("Method not implemented.")}signTransaction(o,r){throw new Error("Method not implemented.")}async login(o){if(!this._login)throw new Error("Provider is not initialized.");this.loginAbortController&&this.loginAbortController.abort();let r=new AbortController;this.loginAbortController=r;let t=r.signal;try{let n=new Promise((p,c)=>{t.addEventListener("abort",()=>{c(new Error("Login cancelled"))})}),l=await Promise.race([this.loginOperation(o),n]);return this.loginAbortController=null,l}catch(n){throw this.loginAbortController=null,n}}async initSignState(){let{onClose:o,manager:r}=await s({cancelAction:this.cancelAction?.bind(this)}),t=this.getType();return r.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",o),r.updateData({name:i[t],type:t}),{onClose:o,manager:r}}};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-E5T25VDS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-RS5NVDUR.mjs";var e=class n extends t{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE_PENDING_TRANSACTIONS",uiTag:"mvx-pending-transactions-panel"});this.initialData=null;this.data=this.initialData}static getInstance(){return n.instance||(n.instance=new n),n.instance}isPendingTransactionsOpen(){return this.isOpen}async setupEventListeners(){this.eventBus&&this.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",this.closeUI.bind(this))}};export{e as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ENQBQ3K2.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as w}from"./chunk-QXC4D3AC.mjs";import{a as g}from"./chunk-YGI3KXMZ.mjs";import{a as b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as w}from"./chunk-QXC4D3AC.mjs";import{a as g}from"./chunk-YGI3KXMZ.mjs";import{a as b}from"./chunk-V6VNRFXC.mjs";import{a as m}from"./chunk-NZYB675D.mjs";import{f}from"./chunk-PJWJZHIS.mjs";import x from"bignumber.js";var F=async({manager:e,provider:d})=>{if(!e||!d)throw new Error("Provider is not initialized.");let{network:u}=b(),s=e.getAccountScreenData()?.startIndex||0,r=e.getAllAccounts(),a=await w({baseURL:u.apiAddress}),l=o=>o.index>=s&&o.index<s+e.addressesPerPage,I=r.reduce((o,n)=>Object.assign(o,{[n.index]:n}),{}),A=r.filter(l),y=!!I[s];if(e.updateAccountScreen({isLoading:!y}),A.length>0){e.updateAccountScreen({accounts:A});return}try{let o=Math.floor(s/e.addressesPerPage),n=await d.getAccounts(o,e.addressesPerPage),L=n.map((t,c)=>({address:t,balance:"...",index:c+s})),P=[...r,...L],h=n.map(t=>m({address:t,baseURL:u.apiAddress})),j=await Promise.all(h),i=P.reduce((t,c)=>Object.assign(t,{[c.address]:c}),{});j.forEach(t=>{if(!t||!a||!a.price)return;let c=new x(t.balance),S=c.dividedBy(x(10).pow(18)).toFormat(4).toString();if(c.isNaN())return;let U=g({amount:f({input:t.balance}),usd:a?.price});i[t.address].balance=S,i[t.address].usdValue=U});let p=Object.values(i).sort((t,c)=>t.index-c.index),O=p.filter(l);e.updateAllAccounts(p),e.updateAccountScreen({accounts:O,isLoading:!1})}catch(o){console.error("Failed to fetch accounts:",o)}};export{F as a};
|
|
2
|
+
//# sourceMappingURL=chunk-F2HEHTHJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as o,f as a,g as i,h as r}from"./chunk-TQA3JDNV.mjs";import{s as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as o,f as a,g as i,h as r}from"./chunk-TQA3JDNV.mjs";import{s as c}from"./chunk-D6TVFZA6.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-GLWYAOLR.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-WWV3ASWP.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-GULZHAFR.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-T7LCG3ZL.mjs";import{a as B}from"./chunk-7AIQVQRI.mjs";import{a as b}from"./chunk-WIHUEHY3.mjs";import{a as O}from"./chunk-QXC4D3AC.mjs";import{a as D}from"./chunk-Q2J2GZXF.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as _}from"./chunk-I3KT7K7E.mjs";import{a as R}from"./chunk-PZHQ37I6.mjs";import{a as j}from"./chunk-URJQWHBM.mjs";import{a as A}from"./chunk-YGT2XHMA.mjs";import{s as x}from"./chunk-D6TVFZA6.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-PJWJZHIS.mjs";import{a as w}from"./chunk-NTEMINYA.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard:h,username:E}}=B(),g=v(x()),C=A(),{allTransactions:r,parsedTransactionsByDataField:L}=R(z),p=[],n=k.getInstance();if(await n.openUI(),!n)throw new Error("Unable to establish connection with sign screens");let W=async()=>{await b(),n.closeUI()};return n.subscribeToEventBus("CLOSE_SIGN_TRANSACTIONS",W),new Promise(async(X,M)=>{let d=[],Y=await O({baseURL:g.apiAddress});n.notifyDataUpdate(),n.initializeGasPriceMap(r.map(a=>a.transaction));let l=Y?.price,t=0,T=async()=>{let c=r[t]?.transaction,i=Number(c.nonce);try{n.updateIsLoading(!0);let{commonData:o,tokenTransaction:e,fungibleTransaction:s}=await D({allTransactions:r,currentScreenIndex:t,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:h,signedIndexes:p,parsedTransactionsByDataField:L});e&&n.updateTokenTransaction(e),s&&n.updateNonFungibleTransaction(s.type,s),n.updateCommonData(o)}catch(o){throw console.error(`Error fetching common data for transaction at index ${t}:`,o),o}finally{n.updateIsLoading(!1)}},$=()=>{t>0&&(t--,T())},q=(a=0)=>{let i=r[t].transaction,o=Number(i.nonce);n.updateGasPriceMap({nonce:o,ppu:a}),n.updateCommonData({ppu:a});let e=i.toPlainObject(),s=I({transaction:e,gasPriceData:n.ppuMap[o]}),P=w.newFromPlainObject({...e,gasPrice:s}),u=j({transaction:P,price:l}),m=F({input:s.toString(),decimals:U,addCommas:!0,digits:G});n.updateCommonData({feeLimit:u.feeLimitFormatted,feeInFiatLimit:u.feeInFiatLimit,gasPrice:m,ppu:a})},J=async()=>{M(new Error("Transaction signing cancelled by user")),await b(),n.closeUI()},f=()=>{t<n.transactionsCount-1&&(t++,T())},Q=async()=>{let c=r[t].transaction,i=Number(c.nonce),{commonData:o}=await D({allTransactions:r,currentScreenIndex:t,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:h,signedIndexes:p,parsedTransactionsByDataField:L});if(!o.needsSigning)return p.push(t),f();let e=c.toPlainObject(),s=e.nonce,P=I({transaction:e,gasPriceData:n.ppuMap[s]}),u=w.newFromPlainObject({...e,gasPrice:P});try{let m=await H([u]);m&&(p.push(t),d.push(m[0]));let nn=t===r.length-1,tn=r.filter(S=>S.needsSigning),an=d.length===tn.length;if(nn&&an){let S=await K(d);return n.closeUI(),X(S)}f()}catch(m){n.closeUI(),M(m)}},V=new Map([["NEXT_SIGN_TRANSACTIONS",f],["CONFIRM_SIGN_TRANSACTIONS",Q],["CLOSE_SIGN_TRANSACTIONS",J],["BACK_SIGN_TRANSACTIONS",$],["SET_PPU_SIGN_TRANSACTIONS",q]]);function Z(){for(let[a,c]of V)n.subscribeToEventBus(a,c)}Z(),await T()})}export{Dn as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HX3GPSEV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-KBKZR473.mjs";async function g({originalLoginToken:i,extraInfoData:n,address:o}){let e=await t({loginToken:i,extraInfoData:n}),s=n.multisig||n.impersonate||o;return{address:e!=null?s:o,modifiedLoginToken:e}}export{g as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HYHCFQ2X.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-SUBC3H4J.mjs";import{a as t}from"./chunk-U64LDJTG.mjs";import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-SUBC3H4J.mjs";import{a as t}from"./chunk-U64LDJTG.mjs";import{a as n}from"./chunk-7NJ4ME6K.mjs";import{s as e}from"./chunk-D6TVFZA6.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";var w=async r=>{let{isGuarded:i}=n();if(!s({isGuarded:i,transactions:r}))return r;let a=r[0].sender.toBech32(),{walletAddress:d}=o(e());return await(await t({address:a,walletUrl:d}))?.guardTransactions(r)||[]};export{w as a};
|
|
2
|
+
//# sourceMappingURL=chunk-I3KT7K7E.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-PGGS4CPP.mjs";var a=class{constructor({uiDataUpdateEvent:t,uiTag:e}){this.eventBus=null;this.uiElement=null;this.isCreatingElement=!1;this.unsubscribeFunctions=new Map;this.uiDataUpdateEvent=t,this.uiTag=e,this.data=this.getInitialData()}async init(t){this.anchor=t,await this.createUIElement(t),await this.setupEventListeners()}updateData(t){this.data={...this.data,...t},this.notifyDataUpdate()}subscribeToEventBus(t,e){if(!this.eventBus)throw new Error("eventBus is not initialized");let i=this.eventBus?.subscribe(t,e);if(i){let n=this.unsubscribeFunctions.get(t)||[];n.push(i),this.unsubscribeFunctions.set(t,n)}}notifyDataUpdate(){this.eventBus?.publish(this.uiDataUpdateEvent,this.data)}destroy(){this.unsubscribeFunctions.forEach(t=>t.forEach(e=>e())),this.unsubscribeFunctions.clear(),this.eventBus=null,this.uiElement?.remove?.(),this.uiElement=null}getInitialData(){return this.initialData}resetData(){this.data=this.getInitialData()}async createUIElement(t=this.anchor){if(this.isCreatingElement||this.uiElement)return this.uiElement;if(this.isCreatingElement=!0,this.uiElement=await s.create({name:this.uiTag,anchor:t}),this.isCreatingElement=!1,!this.uiElement)throw new Error(`Failed to create ${this.uiTag} element`);if(this.eventBus||(this.eventBus=await this.uiElement.getEventBus()),!this.eventBus)throw new Error("eventBus is not initialized");return this.uiElement}};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-IMB7RORC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-IMB7RORC.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-IOTN5P72.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-DLWDO7M6.mjs";import{d as v}from"./chunk-O4E4JGDU.mjs";import{v as m}from"./chunk-YAONXG5V.mjs";import{s as n}from"./chunk-D6TVFZA6.mjs";import{d as s}from"./chunk-VNLGNNIL.mjs";import{a as i}from"./chunk-ZONHCECO.mjs";import{a as p}from"./chunk-LV5G3A3I.mjs";async function g(){let t=a(),d=p(),r=s(n()),e=d||t?i.webview:r,c=Object.values(i).includes(r);if(r&&!c&&(e=r),!e)return;let o=await v.create({type:e});if(!o)throw new Error("Provider not found");(t||e===i.webview&&o.isInitialized())&&await o.login(),m(o)}export{g as a};
|
|
2
|
+
//# sourceMappingURL=chunk-IQ6TLUA6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-ULL2LOGL.mjs";import{a as o}from"./chunk-WE7YOBO7.mjs";async function p({loginToken:i,extraInfoData:n}){if(i==null||Object.keys(n).length===0)return null;let t=o(String(i)),{timestamp:e,...a}=t?.extraInfo||{};if(!(t&&e!=null))return null;let s={hash:String(t?.blockHash),timestamp:Number(e)};return await r({extraInfo:{...a,...n},expirySeconds:t?.ttl,origin:t?.origin}).initialize({latestBlockInfo:s})}export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KBKZR473.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as p}from"./chunk-GULZHAFR.mjs";import{a as u}from"./chunk-XCVEFI4B.mjs";import{a as i}from"./chunk-W5MTQBQF.mjs";import{a as T}from"./chunk-UNBTFF6K.mjs";import{a as m}from"./chunk-U3UMCTU6.mjs";import{a as k}from"./chunk-BRJNX4JF.mjs";import{c as l}from"./chunk-PJWJZHIS.mjs";import{a as o}from"./chunk-7CELSV4S.mjs";var g=class{static async processTransactions({address:v,egldLabel:L,explorerAddress:a,transactions:h}){let f=h.map(e=>T({address:v,explorerAddress:a,transaction:e}));return await Promise.all(f.map(async e=>{let s=e.receiverAssets?.name.replace(/\p{Emoji}/gu,""),c=e.senderAssets?.name.replace(/\p{Emoji}/gu,""),{senderLockedAccount:D,receiverLockedAccount:x}=await p({receiver:e.receiver,sender:e.sender,tokenId:e.tokenIdentifier}),{egldValueData:t,tokenValueData:n,nftValueData:r}=u({transaction:e}),y=r?.token.type==="MetaESDT"?void 0:r?.badgeText,d=m.getData({input:t?.value??n?.value??r?.value??"",decimals:t?.decimals??n?.decimals??r?.decimals??l,digits:2}),S={badge:y??void 0,collection:n?.token.collection??r?.token.collection,egldLabel:t?L:"",link:k({explorerAddress:a,to: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:d.valueDecimal,valueInteger:d.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:!!x,link:e.links.receiverLink??"",shard:w,shardLink:e.links.receiverShardLink,showLink:e.transactionDetails.direction!=="In"},sender:{address:e.sender,name:c??"",description:`${c??e.sender} (${e.sender})`,isContract:o(e.sender),isTokenLocked:!!D,link:e.links.senderLink??"",shard:A,shardLink:e.links.senderShardLink,showLink:e.transactionDetails.direction!=="Out"},value:S}}))}};export{g as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KTOQBOOK.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/controllers/TransactionsTableController/TransactionsTableController.ts"],
|
|
4
|
+
"sourcesContent": ["import { DECIMALS } from 'lib/sdkDappUtils';\nimport {\n ServerTransactionType,\n TransactionDirectionEnum\n} from 'types/serverTransactions.types';\nimport { NftEnumType } from 'types/tokens.types';\nimport { getExplorerLink, getInterpretedTransaction } from 'utils/transactions/getInterpretedTransaction';\nimport { getTransactionValue } from 'utils/transactions/getInterpretedTransaction/getTransactionValue/getTransactionValue';\nimport { getLockedAccountName } from 'utils/transactions/getInterpretedTransaction/helpers/getLockedAccountName';\nimport { getShardText } from 'utils/transactions/getInterpretedTransaction/helpers/getShardText';\nimport { isContract } from 'utils/validation/isContract';\nimport {\n TransactionsRowType,\n TransactionValueType\n} from './transactionsTableController.types';\nimport { FormatAmountController } from '../FormatAmountController';\n\ninterface TransactionsTableProcessTransactionsParamsType {\n address: string;\n egldLabel: string;\n explorerAddress: string;\n transactions: ServerTransactionType[];\n}\n\nexport class TransactionsTableController {\n public static async processTransactions({\n address,\n egldLabel,\n explorerAddress,\n transactions\n }: TransactionsTableProcessTransactionsParamsType): Promise<\n TransactionsRowType[]\n > {\n const interpretedTransactions = transactions.map((transaction) =>\n getInterpretedTransaction({\n address,\n explorerAddress,\n transaction\n })\n );\n\n const transactionRows = await Promise.all(\n interpretedTransactions.map(async (transaction) => {\n const receiverName = transaction.receiverAssets?.name.replace(\n /\\p{Emoji}/gu,\n ''\n );\n\n const senderName = transaction.senderAssets?.name.replace(\n /\\p{Emoji}/gu,\n ''\n );\n\n const { senderLockedAccount, receiverLockedAccount } =\n await getLockedAccountName({\n receiver: transaction.receiver,\n sender: transaction.sender,\n tokenId: transaction.tokenIdentifier\n });\n\n const { egldValueData, tokenValueData, nftValueData } =\n getTransactionValue({\n transaction\n });\n\n const hideBadgeForMetaESDT =\n nftValueData?.token.type === NftEnumType.MetaESDT;\n\n const badge = hideBadgeForMetaESDT\n ? undefined\n : nftValueData?.badgeText;\n\n const formattedAmount = FormatAmountController.getData({\n input:\n egldValueData?.value ??\n tokenValueData?.value ??\n nftValueData?.value ??\n '',\n decimals:\n egldValueData?.decimals ??\n tokenValueData?.decimals ??\n nftValueData?.decimals ??\n DECIMALS,\n digits: 2\n });\n\n const transactionValue: TransactionValueType = {\n badge: badge ?? undefined,\n collection:\n tokenValueData?.token.collection ?? nftValueData?.token.collection,\n egldLabel: egldValueData ? egldLabel : '',\n link:\n getExplorerLink({\n explorerAddress, to: tokenValueData?.tokenExplorerLink ??\n nftValueData?.tokenExplorerLink ?? ''\n }),\n linkText:\n tokenValueData?.tokenLinkText ?? nftValueData?.tokenLinkText,\n name: tokenValueData?.token.name ?? nftValueData?.token.name,\n showFormattedAmount: Boolean(\n egldValueData ||\n tokenValueData?.tokenFormattedAmount ||\n nftValueData?.tokenFormattedAmount\n ),\n svgUrl: tokenValueData?.token.svgUrl ?? nftValueData?.token.svgUrl,\n ticker: tokenValueData?.token.ticker ?? nftValueData?.token.ticker,\n titleText: tokenValueData?.titleText ?? nftValueData?.titleText,\n valueDecimal: formattedAmount.valueDecimal,\n valueInteger: formattedAmount.valueInteger\n };\n\n const receiverShard = getShardText(transaction.receiverShard);\n const senderShard = getShardText(transaction.senderShard);\n\n const transactionRow: TransactionsRowType = {\n age: transaction.transactionDetails.age,\n direction: transaction.transactionDetails.direction,\n method: transaction.transactionDetails.method,\n iconInfo: transaction.transactionDetails.iconInfo,\n link: transaction.links.transactionLink ?? '',\n txHash: transaction.txHash,\n receiver: {\n address: transaction.receiver,\n name: receiverName ?? '',\n description: `${receiverName ?? transaction.receiver} (${transaction.receiver\n })`,\n isContract: isContract(transaction.receiver),\n isTokenLocked: Boolean(receiverLockedAccount),\n link: transaction.links.receiverLink ?? '',\n shard: receiverShard,\n shardLink: transaction.links.receiverShardLink,\n showLink:\n transaction.transactionDetails.direction !==\n TransactionDirectionEnum.IN\n },\n sender: {\n address: transaction.sender,\n name: senderName ?? '',\n description: `${senderName ?? transaction.sender} (${transaction.sender\n })`,\n isContract: isContract(transaction.sender),\n isTokenLocked: Boolean(senderLockedAccount),\n link: transaction.links.senderLink ?? '',\n shard: senderShard,\n shardLink: transaction.links.senderShardLink,\n showLink:\n transaction.transactionDetails.direction !==\n TransactionDirectionEnum.OUT\n },\n value: transactionValue\n };\n\n return transactionRow;\n })\n );\n\n return transactionRows;\n }\n}\n"],
|
|
5
|
+
"mappings": "wUAwBO,IAAMA,EAAN,KAAkC,CACvC,aAAoB,oBAAoB,CACtC,QAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,aAAAC,CACF,EAEE,CACA,IAAMC,EAA0BD,EAAa,IAAKE,GAChDC,EAA0B,CACxB,QAAAN,EACA,gBAAAE,EACA,YAAAG,CACF,CAAC,CACH,EAqHA,OAnHwB,MAAM,QAAQ,IACpCD,EAAwB,IAAI,MAAOC,GAAgB,CACjD,IAAME,EAAeF,EAAY,gBAAgB,KAAK,QACpD,cACA,EACF,EAEMG,EAAaH,EAAY,cAAc,KAAK,QAChD,cACA,EACF,EAEM,CAAE,oBAAAI,EAAqB,sBAAAC,CAAsB,EACjD,MAAMC,EAAqB,CACzB,SAAUN,EAAY,SACtB,OAAQA,EAAY,OACpB,QAASA,EAAY,eACvB,CAAC,EAEG,CAAE,cAAAO,EAAe,eAAAC,EAAgB,aAAAC,CAAa,EAClDC,EAAoB,CAClB,YAAAV,CACF,CAAC,EAKGW,EAFJF,GAAc,MAAM,kBAGlB,OACAA,GAAc,UAEZG,EAAkBC,EAAuB,QAAQ,CACrD,MACEN,GAAe,OACfC,GAAgB,OAChBC,GAAc,OACd,GACF,SACEF,GAAe,UACfC,GAAgB,UAChBC,GAAc,UACdK,EACF,OAAQ,CACV,CAAC,EAEKC,EAAyC,CAC7C,MAAOJ,GAAS,OAChB,WACEH,GAAgB,MAAM,YAAcC,GAAc,MAAM,WAC1D,UAAWF,EAAgBX,EAAY,GACvC,KACEoB,EAAgB,CACd,gBAAAnB,EAAiB,GAAIW,GAAgB,mBACnCC,GAAc,mBAAqB,EACvC,CAAC,EACH,SACED,GAAgB,eAAiBC,GAAc,cACjD,KAAMD,GAAgB,MAAM,MAAQC,GAAc,MAAM,KACxD,oBAAqB,GACnBF,GACAC,GAAgB,sBAChBC,GAAc,sBAEhB,OAAQD,GAAgB,MAAM,QAAUC,GAAc,MAAM,OAC5D,OAAQD,GAAgB,MAAM,QAAUC,GAAc,MAAM,OAC5D,UAAWD,GAAgB,WAAaC,GAAc,UACtD,aAAcG,EAAgB,aAC9B,aAAcA,EAAgB,YAChC,EAEMK,EAAgBC,EAAalB,EAAY,aAAa,EACtDmB,EAAcD,EAAalB,EAAY,WAAW,EAwCxD,MAtC4C,CAC1C,IAAKA,EAAY,mBAAmB,IACpC,UAAWA,EAAY,mBAAmB,UAC1C,OAAQA,EAAY,mBAAmB,OACvC,SAAUA,EAAY,mBAAmB,SACzC,KAAMA,EAAY,MAAM,iBAAmB,GAC3C,OAAQA,EAAY,OACpB,SAAU,CACR,QAASA,EAAY,SACrB,KAAME,GAAgB,GACtB,YAAa,GAAGA,GAAgBF,EAAY,QAAQ,KAAKA,EAAY,QACnE,IACF,WAAYoB,EAAWpB,EAAY,QAAQ,EAC3C,cAAe,EAAQK,EACvB,KAAML,EAAY,MAAM,cAAgB,GACxC,MAAOiB,EACP,UAAWjB,EAAY,MAAM,kBAC7B,SACEA,EAAY,mBAAmB,gBAEnC,EACA,OAAQ,CACN,QAASA,EAAY,OACrB,KAAMG,GAAc,GACpB,YAAa,GAAGA,GAAcH,EAAY,MAAM,KAAKA,EAAY,MAC/D,IACF,WAAYoB,EAAWpB,EAAY,MAAM,EACzC,cAAe,EAAQI,EACvB,KAAMJ,EAAY,MAAM,YAAc,GACtC,MAAOmB,EACP,UAAWnB,EAAY,MAAM,gBAC7B,SACEA,EAAY,mBAAmB,iBAEnC,EACA,MAAOe,CACT,CAGF,CAAC,CACH,CAGF,CACF",
|
|
6
|
+
"names": ["TransactionsTableController", "address", "egldLabel", "explorerAddress", "transactions", "interpretedTransactions", "transaction", "getInterpretedTransaction", "receiverName", "senderName", "senderLockedAccount", "receiverLockedAccount", "getLockedAccountName", "egldValueData", "tokenValueData", "nftValueData", "getTransactionValue", "badge", "formattedAmount", "FormatAmountController", "DECIMALS", "transactionValue", "getExplorerLink", "receiverShard", "getShardText", "senderShard", "isContract"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{q as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{q as u}from"./chunk-D6TVFZA6.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-KWUIUJYQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-WTHOSLUO.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-LV5G3A3I.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as s}from"./chunk-O4E4JGDU.mjs";import{a as u}from"./chunk-RS5NVDUR.mjs";import{s as c}from"./chunk-D6TVFZA6.mjs";import{b as d}from"./chunk-SAAOQW7P.mjs";import{a as v}from"./chunk-ZVIKYGX5.mjs";import{a}from"./chunk-ZONHCECO.mjs";var i=class i extends u{constructor(){super({uiTag:"mvx-unlock-panel",uiDataUpdateEvent:"OPEN"});this.initialData={providers:null,walletAddress:null};this.openUnlockPanel=async()=>{let{walletAddress:e}=d(c());this.data={providers:this.getProvidersList(),walletAddress:e},await this.openUI(),this.notifyDataUpdate()};this.setupEventListeners=async()=>{this.eventBus&&(this.subscribeToEventBus("LOGIN",this.handleLogin),this.subscribeToEventBus("CANCEL_LOGIN",this.handleCancelLogin),this.subscribeToEventBus("CLOSE",this.handleCloseUI))};this.handleCloseUI=async e=>{!e?.isLoginFinished&&i.onClose&&i.onClose(),this.closeUI()};this.handleLogin=async({type:e,anchor:o})=>{if(!i.loginHandler)throw new Error("Login callback not initialized. Please call `init()` first.");try{this.isSimpleLoginCallback(i.loginHandler)?(await(await s.create({type:e,anchor:o})).login(),i.loginHandler()):i.loginHandler({type:e,anchor:o}),await this.handleCloseUI({isLoginFinished:!0})}catch(t){console.error(t),this.eventBus?.publish("CANCEL_IN_PROVIDER",this.data)}};this.handleCancelLogin=async()=>{await s.destroy()};this.isSimpleLoginCallback=e=>e.length===0;this.data=this.initialData}static getInstance(){return i.instance||(i.instance=new i),i.instance}static init(e){return this.loginHandler=e.loginHandler,this.allowedProviders=e.allowedProviders,e.onClose&&(this.onClose=e.onClose),this.getInstance()}getProvidersList(){let e=s.customProviders,t=[...Object.values(a).filter(n=>![a.none,a.webview].includes(n)),...e.map(n=>n.type)],P=e.reduce((n,r)=>(n[r.type]=r.name,n),{}),l={...v,...P};return(i.allowedProviders?i?.allowedProviders.filter(n=>t.includes(n)):t).map(n=>{let r=e.find(g=>g.type===n);return r||{name:n in l?l[n]:n,type:n}})}};i.loginHandler=null,i.onClose=null,i.allowedProviders=null;var p=i;export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MMY7MLSC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f}from"./chunk-FRDR4A7Z.mjs";import{w as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as f}from"./chunk-FRDR4A7Z.mjs";import{w as g}from"./chunk-YAONXG5V.mjs";import{a as c}from"./chunk-AWHIX3FQ.mjs";import{s as n}from"./chunk-D6TVFZA6.mjs";import{g as a}from"./chunk-UERJ6AKK.mjs";import{e as l}from"./chunk-VNLGNNIL.mjs";import{HWProvider as m}from"@multiversx/sdk-hw-provider";async function A(u){let v=c(),d=u?.shouldInitProvider||!v,o=l(n()),t=a(n()),r=g(),i=new m,I=async()=>{let e=o?.index!=null;if(r instanceof m&&r.isInitialized())return e&&await r.setAddressIndex(o.index),r;if(d&&!await i.init())throw new Error("Failed to initialize Ledger Provider");return e&&await i.setAddressIndex(o.index),i};try{if(!d&&t)return{ledgerProvider:i,ledgerConfig:{version:t.version,dataEnabled:t.hasContractDataEnabled}};let e=await I(),s=await f(e);return{ledgerProvider:e,ledgerConfig:s}}catch(e){throw console.error("Could not initialize ledger app",e),e}}export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NOLOZJ37.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-RBSHB26S.mjs";import{a}from"./chunk-ALXGPWX7.mjs";import{a as u}from"./chunk-6FKT2TIN.mjs";import{c as n}from"./chunk-TZDM7KH7.mjs";import{a as s}from"./chunk-6NK63AU5.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-NTTKKJIS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p}from"./chunk-RYPO7VR2.mjs";import{a as d}from"./chunk-3YSWYYBW.mjs";import{a as f}from"./chunk-2A6ODBDO.mjs";import{a as h}from"./chunk-3L7HZ2SO.mjs";var g=t=>t.sort((n,i)=>i.timestamp-n.timestamp),k=async({transactions:t,address:n,explorerAddress:i,egldLabel:u,skipFetchingTransactions:I=!1})=>{let o=[],e=[];if(t.forEach(s=>{let a=f(s.hash);a?o.push(a):e.push(s.hash)}),e.length===0)return g(o);let c=I?t.map(s=>({...s,txHash:s.hash})):await p(e),l=c.map(s=>s.txHash),T=e.filter(s=>!l.includes(s));if(T.length>0){let a=t.filter(r=>T.includes(r.hash)).map(r=>({...r,txHash:r.hash,price:0,status:"pending",gasUsed:0,miniBlockHash:"",receiverShard:0,round:0,senderShard:0,timestamp:Date.now()}));c.push(...a)}let m=new Map;return o.forEach(s=>{let a=s.hash;a&&m.set(String(a),s)}),c.forEach(s=>{let a=h({transaction:s,address:n,explorerAddress:i,egldLabel:u});a.status!=="pending"&&d({key:`transaction-${s.txHash}`,value:a}),m.set(s.txHash,a)}),g(Array.from(m.values()))};export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-O2CA5SYO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as de}from"./chunk-M3YL36ZL.mjs";import{a as I}from"./chunk-WDIKEQ4G.mjs";import{a as se}from"./chunk-7ZUH3TQ2.mjs";import{a as ie}from"./chunk-NBY6GGN5.mjs";import{a as N}from"./chunk-476M52X7.mjs";import{a as oe}from"./chunk-53YTBT65.mjs";import{a as te}from"./chunk-C7FCKWVR.mjs";import{a as re}from"./chunk-YUFPUG5O.mjs";import{a as ae}from"./chunk-4MBPMZP7.mjs";import{a as p}from"./chunk-OFSRI5RR.mjs";import{a as ee}from"./chunk-DDOXD4IN.mjs";import{a as L}from"./chunk-4KTAXWHS.mjs";import{a as ne}from"./chunk-EGBOHDEU.mjs";import{a as Z}from"./chunk-QJGFIK7H.mjs";import{b as Q}from"./chunk-4Z3DZ2A3.mjs";import{b as C,c as J}from"./chunk-NRXYSTRW.mjs";import{j as X,l as D,u as E,v as y,w as M}from"./chunk-OXQS44QJ.mjs";import{a as P}from"./chunk-4FVVKVQH.mjs";import{a as K}from"./chunk-J3N3E7IG.mjs";import{a as U}from"./chunk-4TBVQD27.mjs";import{a as Y}from"./chunk-GJJZZWVD.mjs";import{g as $}from"./chunk-2IUBMLF4.mjs";import{a as q,q as F,s as l}from"./chunk-SI4DRNUN.mjs";import{f as V}from"./chunk-UERJ6AKK.mjs";import{b as A,c as B}from"./chunk-SAAOQW7P.mjs";import{a as H}from"./chunk-VNLGNNIL.mjs";import{b as G,c as j}from"./chunk-6JM4DPOH.mjs";import{a as c}from"./chunk-ZVIKYGX5.mjs";import{a as n}from"./chunk-ZONHCECO.mjs";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 ie({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!P())return;await N.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await L({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 te({shouldInitProvider:!0});this.provider=r}catch(r){throw X({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return n.ledger}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){await this.initLegderConnectManager(this.options?.anchor);let e=N.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((o,s)=>oe({manager:e,resolve:o,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ge=3e4,ve=5e3,me=3e3,S=class a{constructor(){this.store=F();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let i=this.store.getState(),{providerType:e}=H(i),r=V(i);return!!(e===n.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=Q(l());if(!(!this.shouldCheckConnection()||i))try{await M().getProvider().getAddress()}catch{if(D.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,ve)}},ge))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new f({shouldInitProvider:!0});await i.init();let e=new E(i);i.getType=()=>n.ledger,y(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,D.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:me,icon:"check",iconClassName:"success",message:"Your device is ready to sign transactions",title:"Ledger reconnected"}),this.startCheckConnectionLoop()}catch{console.log("Unable to reconnect to Ledger")}};this.reset=()=>{clearInterval(this.connectionCheckInterval??0),this.connectionCheckInterval=null}}static getInstance(){return a.instance||(a.instance=new a),a.instance}};var z=class extends p{constructor(e){super(e?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{onClose:r,manager:t}=await this.initSignState();try{let o=await this.provider.signTransactions(e)??[];return await ne(o)}catch(o){throw await r({shouldCancelAction:!0}),o}finally{t.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.crossWindow})};this.walletAddress=e?.walletAddress,this.provider=Z.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=A(l()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return n.crossWindow}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{ExtensionProvider as he}from"@multiversx/sdk-extension-provider/out/extensionProvider";var k=class extends p{constructor(e){super(e);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)??[]}catch(o){throw await t({shouldCancelAction:!1}),o}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension})};this.provider=he.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return n.extension}};var x=class extends p{constructor({address:e,walletUrl:r}={}){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 L({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})}catch(o){throw await t({shouldCancelAction:!0}),o}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c[n.metamask]})};this.walletUrl=r??"",this.provider=de.getInstance(),this._login=this.provider.login.bind(this.provider)}init(){return this.initializeAddress(),this.initializeWalletUrl(),this.initializeProvider()}initializeWalletUrl(){if(this.walletUrl)return;let e=A(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.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return n.metamask}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 fe}from"@multiversx/sdk-wallet-connect-provider/out";var le=[C.CANCEL_ACTION,C.SIGN_LOGIN_TOKEN],W=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;this.cancelActionAbortController=null;this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();this.cancelActionAbortController=new AbortController;let o=this.cancelActionAbortController.signal;try{let s=new Promise((h,v)=>{o.addEventListener("abort",()=>{v(new Error("cancelled by user"))})});return await Promise.race([this.provider.signTransactions(e),s])}catch(s){throw await t({shouldCancelAction:!0}),s}finally{r.closeUI()}};this.cancelAction=async()=>{this.sendCustomRequest({method:C.CANCEL_ACTION,action:fe.CANCEL_ACTION}),this.cancelActionAbortController?.abort()};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");this.cancelActionAbortController=new AbortController;let r=this.cancelActionAbortController.signal,t=new Promise((s,d)=>{r.addEventListener("abort",()=>{d(new Error("cancelled by user"))})});return await Promise.race([g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension}),t])};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return n.walletConnect}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return Promise.resolve(this.provider.getAddress())}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){if(await this.initWalletConnectManager(),!this.config)throw new Error("Invalid WalletConnect setup");let{walletConnectProvider:e,dappMethods:r}=await this.createWalletConnectProvider(this.config);this.provider=e,this.methods=r;let{uri:t="",approval:o}=await this.provider.connect({methods:this.methods}),s=this.config.walletConnectDeepLink??U.walletConnectDeepLink;this._approval=o,I.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!P())return;await I.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=P(),t=B(l());if(G(l())&&le.push(C.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{Y()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:_={},walletConnectV2RelayAddress:O=""}=e,w=new J(v,t,O,m,_);return await w.init(),{walletConnectProvider:w,dappMethods:le}}catch(m){throw console.error("Unable to connect",m),r&&await this.logout(),m}}async login(e){if(!this.provider)throw new Error("Provider is not initialized. Call createProvider first.");let r=async()=>{if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.init();let t=I.getInstance(),{uri:o="",approval:s}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??U.walletConnectDeepLink;t.updateData({wcURI:o,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(o)}`});let h=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=h??{};return t.handleClose({isLoginFinished:!!v}),{address:v,signature:m}}catch{return await r()}};if(!this._approval)throw new Error("Approval or login is not initialized");try{let t=await this.provider.login({approval:this._approval.bind(this),token:e?.token}),{address:o="",signature:s=""}=t??{};return I.getInstance().handleClose({isLoginFinished:!!o}),{address:o,signature:s}}catch(t){return console.error("User rejected connection proposal",t),await r()}}async sendCustomRequest({action:e,method:r}){if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.sendCustomRequest?.({request:{method:r,params:{action:e}}})}catch(t){console.error("Unable to send event",t)}}};var T=class{static set customProviders(i){this._customProviders=i}static get customProviders(){return this._customProviders}static async create({type:i,anchor:e}){let r=null;switch(i){case n.extension:{r=new k;break}case n.crossWindow:{r=new z;break}case n.ledger:{r=new f({anchor:e}),await S.getInstance().init();break}case n.metamask:{r=new x;break}case n.walletConnect:{let s=j(l());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new W({anchor:e,...s});break}case n.webview:{r=new ae;break}default:{let s=K();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 E(r);y(t);let o=n.crossWindow===i;return se(o?{skipLoginMethod:i}:null),t}static async destroy(){M().cancelLogin(),y(null),q(n.none)}};T._customProviders=[];var we=(a,i)=>a.some(e=>e.type===i);async function g({message:a,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(o,s)=>{let{manager:d,onClose:h}=await ee({cancelAction:e}),v=Object.values(T.customProviders),m=v.reduce((u,R)=>(u[R.type]=R.name,u),{}),_={...c,...m},O=async()=>{await h({shouldCancelAction:!0}),s({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",O);let w=we(v,r)?r:n.none;d.updateData({name:_[w],type:w});try{let u=await i(a);o(u)}catch(u){await h({shouldCancelAction:!0}),s(u)}finally{d.closeUI()}})}async function ce({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=re(e);throw r?{message:r}:e}}export{ce as a,f as b,S as c,T as d,g as e,z as f,k as g,x as h,W as i};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as de}from"./chunk-M3YL36ZL.mjs";import{a as I}from"./chunk-IOTN5P72.mjs";import{a as se}from"./chunk-7ZUH3TQ2.mjs";import{a as ie}from"./chunk-E5H5BPFX.mjs";import{a as R}from"./chunk-SRY5QN4N.mjs";import{a as oe}from"./chunk-QXU7U2E2.mjs";import{a as te}from"./chunk-NOLOZJ37.mjs";import{a as re}from"./chunk-YUFPUG5O.mjs";import{a as ae}from"./chunk-W3WUNRIB.mjs";import{a as p}from"./chunk-E5T25VDS.mjs";import{a as ee}from"./chunk-RLHETJG2.mjs";import{a as b}from"./chunk-HX3GPSEV.mjs";import{a as ne}from"./chunk-I3KT7K7E.mjs";import{a as L}from"./chunk-QJGFIK7H.mjs";import{b as Z}from"./chunk-4Z3DZ2A3.mjs";import{b as C,c as Q}from"./chunk-NRXYSTRW.mjs";import{j as Y,l as U,u as E,v as y,w as M}from"./chunk-YAONXG5V.mjs";import{a as P}from"./chunk-AWHIX3FQ.mjs";import{a as $}from"./chunk-ALXGPWX7.mjs";import{a as N}from"./chunk-4TBVQD27.mjs";import{a as J}from"./chunk-6FKT2TIN.mjs";import{g as X}from"./chunk-2IUBMLF4.mjs";import{a as F,q as K,s as l}from"./chunk-D6TVFZA6.mjs";import{f as B}from"./chunk-UERJ6AKK.mjs";import{b as A,c as H}from"./chunk-SAAOQW7P.mjs";import{a as G}from"./chunk-VNLGNNIL.mjs";import{b as j,c as q}from"./chunk-6JM4DPOH.mjs";import{a as c}from"./chunk-ZVIKYGX5.mjs";import{a as n}from"./chunk-ZONHCECO.mjs";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 ie({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!P())return;await R.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await b({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 te({shouldInitProvider:!0});this.provider=r}catch(r){throw Y({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return n.ledger}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){await this.initLegderConnectManager(this.options?.anchor);let e=R.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((i,s)=>oe({manager:e,resolve:i,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ge=3e4,ve=5e3,me=3e3,z=class a{constructor(){this.store=K();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let o=this.store.getState(),{providerType:e}=G(o),r=B(o);return!!(e===n.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let o=Z(l());if(!(!this.shouldCheckConnection()||o))try{await M().getProvider().getAddress()}catch{if(U.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"times",iconClassName:"warning",message:"Unlock your device to continue signing transactions",title:"Ledger disconnected"}),this.reset(),this.recreateProviderInterval)return;this.recreateProviderInterval=setInterval(this.reconnectProvider,ve)}},ge))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let o=new f({shouldInitProvider:!0});await o.init();let e=new E(o);o.getType=()=>n.ledger,y(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,U.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:me,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 i=await this.provider.signTransactions(e)??[];return await ne(i)}catch(i){throw await r({shouldCancelAction:!0}),i}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=L.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=A(l()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return n.crossWindow}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{ExtensionProvider as he}from"@multiversx/sdk-extension-provider/out/extensionProvider";var W=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(i){throw await t({shouldCancelAction:!1}),i}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=he.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return n.extension}};var x=class extends p{constructor({address:e,walletUrl:r}={}){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 b({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})}catch(i){throw await t({shouldCancelAction:!0}),i}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[n.metamask]})};this.walletUrl=r??"",this.provider=de.getInstance(),this._login=this.provider.login.bind(this.provider)}init(){return this.initializeAddress(),this.initializeWalletUrl(),this.initializeProvider()}initializeWalletUrl(){if(this.walletUrl)return;let e=A(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.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return n.metamask}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 fe}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 i=this.cancelActionAbortController.signal;try{let s=new Promise((h,v)=>{i.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:fe.CANCEL_ACTION}),this.cancelActionAbortController?.abort()};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");this.cancelActionAbortController=new AbortController;let r=this.cancelActionAbortController.signal,t=new Promise((s,d)=>{r.addEventListener("abort",()=>{d(new Error("cancelled by user"))})});return await Promise.race([g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension}),t])};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return n.walletConnect}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return Promise.resolve(this.provider.getAddress())}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){if(await this.initWalletConnectManager(),!this.config)throw new Error("Invalid WalletConnect setup");let{walletConnectProvider:e,dappMethods:r}=await this.createWalletConnectProvider(this.config);this.provider=e,this.methods=r;let{uri:t="",approval:i}=await this.provider.connect({methods:this.methods}),s=this.config.walletConnectDeepLink??N.walletConnectDeepLink;this._approval=i,I.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!P())return;await I.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=P(),t=H(l());if(j(l())&&le.push(C.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{J()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:O={},walletConnectV2RelayAddress:D=""}=e,w=new Q(v,t,D,m,O);return await w.init(),{walletConnectProvider:w,dappMethods:le}}catch(m){throw console.error("Unable to connect",m),r&&await this.logout(),m}}async login(e){if(!this.provider)throw new Error("Provider is not initialized. Call createProvider first.");let r=async()=>{if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.init();let t=I.getInstance(),{uri:i="",approval:s}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??N.walletConnectDeepLink;t.updateData({wcURI:i,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(i)}`});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:i="",signature:s=""}=t??{};return I.getInstance().handleClose({isLoginFinished:!!i}),{address:i,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 T=class{static set customProviders(o){this._customProviders=o}static get customProviders(){return this._customProviders}static async create({type:o,anchor:e}){let r=null;switch(o){case n.extension:{r=new W;break}case n.crossWindow:{r=new k;break}case n.ledger:{r=new f({anchor:e}),await z.getInstance().init();break}case n.metamask:{r=new x;break}case n.walletConnect:{let s=q(l());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new _({anchor:e,...s});break}case n.webview:{r=new ae;break}default:{let s=$();for(let d of this._customProviders)d.type===o&&(r=await d.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new E(r);y(t);let i="provider"in r&&r.provider instanceof L;return se(i?{skipLoginMethod:n.crossWindow}:null),t}static async destroy(){M().cancelLogin(),y(null),F(n.none)}};T._customProviders=[];var we=(a,o)=>a.some(e=>e.type===o);async function g({message:a,handleSignMessage:o,cancelAction:e,providerType:r}){return await new Promise(async(i,s)=>{let{manager:d,onClose:h}=await ee({cancelAction:e}),v=Object.values(T.customProviders),m=v.reduce((u,V)=>(u[V.type]=V.name,u),{}),O={...c,...m},D=async()=>{await h({shouldCancelAction:!0}),s({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",D);let w=we(v,r)?r:n.none;d.updateData({name:O[w],type:w});try{let u=await o(a);i(u)}catch(u){await h({shouldCancelAction:!0}),s(u)}finally{d.closeUI()}})}async function ce({message:a,handleSignMessage:o}){try{return await g({message:a,handleSignMessage:o,providerType:c.ledger})}catch(e){let{errorMessage:r}=re(e);throw r?{message:r}:e}}export{ce as a,f as b,z as c,T as d,g as e,k as f,W as g,x as h,_ as i};
|
|
2
|
+
//# sourceMappingURL=chunk-O4E4JGDU.mjs.map
|