@multiversx/sdk-dapp 5.0.0-alpha.6 → 5.0.0-alpha.8
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-2G6DWPQU.mjs +2 -0
- package/out/__chunks__/{chunk-UFOL2NTX.mjs.map → chunk-2G6DWPQU.mjs.map} +2 -2
- package/out/__chunks__/{chunk-KMFCWHOG.mjs → chunk-2KAOFKX4.mjs} +2 -2
- package/out/__chunks__/{chunk-7HJHGIBJ.mjs → chunk-2WB5WD5K.mjs} +2 -2
- package/out/__chunks__/{chunk-F3ZH2WXR.mjs → chunk-35YS2DV5.mjs} +2 -2
- package/out/__chunks__/{chunk-W7TRO6AR.mjs → chunk-3IMDPLG5.mjs} +2 -2
- package/out/__chunks__/chunk-3IXTYHAU.mjs +2 -0
- package/out/__chunks__/{chunk-4BRZWHKY.mjs.map → chunk-3IXTYHAU.mjs.map} +2 -2
- package/out/__chunks__/{chunk-4KOEDU3Y.mjs → chunk-3JNON2SM.mjs} +2 -2
- package/out/__chunks__/{chunk-B2RDSGON.mjs → chunk-3OKWBJFM.mjs} +2 -2
- package/out/__chunks__/{chunk-CZYIK4AV.mjs → chunk-3Z3DQFG6.mjs} +2 -2
- package/out/__chunks__/{chunk-TLKMUVQJ.mjs → chunk-45WVS4H5.mjs} +2 -2
- package/out/__chunks__/{chunk-MNXYY4GE.mjs → chunk-4AOTLDWS.mjs} +2 -2
- package/out/__chunks__/{chunk-XPEAEEAP.mjs → chunk-4I2FE6NE.mjs} +2 -2
- package/out/__chunks__/{chunk-L7J5JJEB.mjs → chunk-4YETXBJD.mjs} +2 -2
- package/out/__chunks__/{chunk-L7J5JJEB.mjs.map → chunk-4YETXBJD.mjs.map} +2 -2
- package/out/__chunks__/{chunk-Z2PS6O33.mjs → chunk-53BZNNVL.mjs} +2 -2
- package/out/__chunks__/{chunk-A2S6BDWO.mjs → chunk-55RBZAD6.mjs} +2 -2
- package/out/__chunks__/{chunk-2ENRJCCA.mjs → chunk-5L474T4X.mjs} +2 -2
- package/out/__chunks__/{chunk-OPM4DDXX.mjs → chunk-6BGPH7MV.mjs} +2 -2
- package/out/__chunks__/{chunk-P3NFZKKS.mjs → chunk-6L56KRO6.mjs} +2 -2
- package/out/__chunks__/chunk-AC2L3PV3.mjs +2 -0
- package/out/__chunks__/{chunk-TTNVCEUD.mjs → chunk-AJJVMOJF.mjs} +2 -2
- package/out/__chunks__/{chunk-YZLY7QNI.mjs → chunk-BEUXUWCR.mjs} +2 -2
- package/out/__chunks__/{chunk-R6GCICL7.mjs → chunk-BVKOA6WH.mjs} +2 -2
- package/out/__chunks__/chunk-CO3V5DOG.mjs +1 -0
- package/out/__chunks__/chunk-CT6RFJJM.mjs +2 -0
- package/out/__chunks__/{chunk-S37QJIXF.mjs → chunk-CUSKOIRI.mjs} +2 -2
- package/out/__chunks__/{chunk-EA6FWJCX.mjs → chunk-EPMXW255.mjs} +2 -2
- package/out/__chunks__/chunk-EVL6UUJJ.mjs +2 -0
- package/out/__chunks__/chunk-F3AMNJ5K.mjs +2 -0
- package/out/__chunks__/chunk-F3AMNJ5K.mjs.map +7 -0
- package/out/__chunks__/chunk-G7XIDD62.mjs +2 -0
- package/out/__chunks__/{chunk-SJ4UJRDS.mjs.map → chunk-G7XIDD62.mjs.map} +2 -2
- package/out/__chunks__/{chunk-AW4W44IZ.mjs → chunk-GVKHWWIS.mjs} +2 -2
- package/out/__chunks__/{chunk-3XSKVLJW.mjs → chunk-GZAY7BOI.mjs} +2 -2
- package/out/__chunks__/{chunk-S55MULGJ.mjs → chunk-HR6GP43Q.mjs} +2 -2
- package/out/__chunks__/chunk-I7ODJJY3.mjs +2 -0
- package/out/__chunks__/chunk-I7ODJJY3.mjs.map +7 -0
- package/out/__chunks__/chunk-IEJARRBP.mjs +2 -0
- package/out/__chunks__/chunk-IEJARRBP.mjs.map +7 -0
- package/out/__chunks__/chunk-IJEPA3W2.mjs +2 -0
- package/out/__chunks__/chunk-IJEPA3W2.mjs.map +7 -0
- package/out/__chunks__/{chunk-6XUO2J7G.mjs → chunk-IYS5W63R.mjs} +2 -2
- package/out/__chunks__/{chunk-YVD46DFI.mjs → chunk-J4MZNYDR.mjs} +2 -2
- package/out/__chunks__/{chunk-F33ED5VY.mjs → chunk-J7MZZ2X2.mjs} +2 -2
- package/out/__chunks__/{chunk-PYJMQN53.mjs → chunk-JENO4O6P.mjs} +2 -2
- package/out/__chunks__/{chunk-G2DLIXFQ.mjs → chunk-K3WBBSXJ.mjs} +2 -2
- package/out/__chunks__/{chunk-IAAVRI6B.mjs → chunk-K7WAPWQA.mjs} +2 -2
- package/out/__chunks__/{chunk-3W2X3GZO.mjs → chunk-KUQH2ZBR.mjs} +2 -2
- package/out/__chunks__/{chunk-YVDP2G6F.mjs → chunk-KY7KOSJJ.mjs} +2 -2
- package/out/__chunks__/chunk-LJ5JGAYL.mjs +2 -0
- package/out/__chunks__/{chunk-NREOHZVN.mjs → chunk-LKWCLZTU.mjs} +2 -2
- package/out/__chunks__/chunk-M6IVW6AN.mjs +2 -0
- package/out/__chunks__/{chunk-6VL4U3SD.mjs.map → chunk-M6IVW6AN.mjs.map} +2 -2
- package/out/__chunks__/chunk-M7R5JSEH.mjs +2 -0
- package/out/__chunks__/chunk-MAT2WHLY.mjs +2 -0
- package/out/__chunks__/chunk-NHXPNROG.mjs +2 -0
- package/out/__chunks__/chunk-NHXPNROG.mjs.map +7 -0
- package/out/__chunks__/chunk-OH6SHSQZ.mjs +2 -0
- package/out/__chunks__/{chunk-CU47DEVW.mjs → chunk-OLYQNOEP.mjs} +2 -2
- package/out/__chunks__/{chunk-7YA5JPZ3.mjs → chunk-OOPHCYRC.mjs} +2 -2
- package/out/__chunks__/{chunk-EUM7J3UT.mjs → chunk-OTQRFI3T.mjs} +2 -2
- package/out/__chunks__/chunk-P5YASUQH.mjs +2 -0
- package/out/__chunks__/{chunk-W4GE4ZDP.mjs → chunk-PRULMJH7.mjs} +2 -2
- package/out/__chunks__/{chunk-KSNODP2B.mjs → chunk-QFWMIF3L.mjs} +2 -2
- package/out/__chunks__/{chunk-TAI3I5BS.mjs → chunk-QQNYMMUM.mjs} +2 -2
- package/out/__chunks__/{chunk-UF45HLIK.mjs → chunk-QYYNCJPD.mjs} +2 -2
- package/out/__chunks__/chunk-RIXZPR7R.mjs +2 -0
- package/out/__chunks__/chunk-SKEL25G3.mjs +2 -0
- package/out/__chunks__/chunk-SKEL25G3.mjs.map +7 -0
- package/out/__chunks__/chunk-TRMQFQOQ.mjs +1 -0
- package/out/__chunks__/{chunk-FKB6EYMV.mjs → chunk-TWWYWBJH.mjs} +2 -2
- package/out/__chunks__/{chunk-YZ5ZS3VO.mjs → chunk-U52ITGAN.mjs} +2 -2
- package/out/__chunks__/{chunk-G3WS2SYA.mjs → chunk-UQXXWVTL.mjs} +2 -2
- package/out/__chunks__/chunk-UWNXZP4Z.mjs +2 -0
- package/out/__chunks__/chunk-V7QVBIYB.mjs +2 -0
- package/out/__chunks__/chunk-V7QVBIYB.mjs.map +7 -0
- package/out/__chunks__/chunk-V7ZVI2WS.mjs +2 -0
- package/out/__chunks__/chunk-VK47SZJ2.mjs +2 -0
- package/out/__chunks__/chunk-VPZ3QEMD.mjs +2 -0
- package/out/__chunks__/{chunk-GVA5Y5KR.mjs → chunk-VQIWENYE.mjs} +2 -2
- package/out/__chunks__/chunk-W5W6YGA5.mjs +2 -0
- package/out/__chunks__/chunk-WGH5AERA.mjs +2 -0
- package/out/__chunks__/{chunk-OIL7VMRM.mjs → chunk-WVB4VPRI.mjs} +2 -2
- package/out/__chunks__/{chunk-EVNL24SI.mjs → chunk-X5OSPJKQ.mjs} +2 -2
- package/out/__chunks__/chunk-XPX7PTGI.mjs +2 -0
- package/out/__chunks__/{chunk-JGWNKE3I.mjs.map → chunk-XPX7PTGI.mjs.map} +2 -2
- package/out/__chunks__/{chunk-4XJLALSE.mjs → chunk-Y574J2OK.mjs} +2 -2
- package/out/__chunks__/chunk-Y574J2OK.mjs.map +7 -0
- package/out/__chunks__/chunk-Y62KWXTT.mjs +2 -0
- package/out/__chunks__/{chunk-HTPPS2MF.mjs → chunk-YB2E5WOO.mjs} +1 -1
- package/out/__chunks__/chunk-YB2E5WOO.mjs.map +7 -0
- package/out/__chunks__/chunk-YEXBSKXL.mjs +2 -0
- package/out/__chunks__/chunk-YEXBSKXL.mjs.map +7 -0
- package/out/__chunks__/{chunk-CYFAX2FA.mjs → chunk-YMUUG42I.mjs} +2 -2
- package/out/__chunks__/{chunk-QSAHAGTQ.mjs → chunk-YWBC3WTI.mjs} +2 -2
- package/out/__chunks__/{chunk-JTQCNFCR.mjs → chunk-ZJOTHYI2.mjs} +2 -2
- package/out/__chunks__/{chunk-PEURG4PE.mjs → chunk-ZOGJGVPP.mjs} +2 -2
- package/out/__chunks__/{chunk-4X65PD55.mjs → chunk-ZZOHAMTX.mjs} +2 -2
- package/out/__mocks__/accountConfig.mjs +1 -1
- package/out/__mocks__/data/index.mjs +1 -1
- package/out/__mocks__/index.mjs +1 -1
- package/out/__mocks__/server.mjs +1 -1
- package/out/apiCalls/account/getScamAddressData.mjs +1 -1
- package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
- package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
- package/out/apiCalls/index.mjs +1 -1
- package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/index.mjs +1 -1
- package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
- package/out/constants/index.mjs +1 -1
- package/out/constants/providerFactory.constants.d.ts +2 -1
- package/out/constants/providerFactory.constants.js +1 -0
- package/out/constants/providerFactory.constants.js.map +1 -1
- package/out/constants/providerFactory.constants.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
- package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
- package/out/controllers/TransactionsTableController/index.mjs +1 -1
- package/out/core/providers/DappProvider/helpers/login/helpers/refreshNativeAuthTokenLogin.d.ts +1 -1
- package/out/core/providers/DappProvider/helpers/login/helpers/refreshNativeAuthTokenLogin.js +7 -3
- package/out/core/providers/DappProvider/helpers/login/helpers/refreshNativeAuthTokenLogin.js.map +1 -1
- package/out/core/providers/DappProvider/helpers/login/helpers/refreshNativeAuthTokenLogin.mjs +1 -1
- package/out/core/providers/DappProvider/helpers/login/helpers/refreshNativeAuthTokenLogin.mjs.map +3 -3
- package/out/index.mjs +1 -1
- package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/index.mjs +1 -1
- package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getTransactionsStatus.mjs +1 -1
- package/out/managers/TransactionManager/index.mjs +1 -1
- package/out/managers/UnlockPanelManager/UnlockPanelManager.d.ts +1 -1
- package/out/managers/UnlockPanelManager/UnlockPanelManager.js +17 -7
- package/out/managers/UnlockPanelManager/UnlockPanelManager.js.map +1 -1
- package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
- package/out/managers/UnlockPanelManager/UnlockPanelManager.types.d.ts +4 -5
- package/out/managers/UnlockPanelManager/UnlockPanelManager.types.mjs +1 -1
- package/out/managers/UnlockPanelManager/index.mjs +1 -1
- package/out/managers/index.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
- package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
- package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/ToastManager/ToastManager.mjs +1 -1
- package/out/managers/internal/ToastManager/helpers/LifetimeManager.mjs +1 -1
- package/out/managers/internal/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
- package/out/managers/internal/ToastManager/helpers/createTransactionToast.mjs +1 -1
- package/out/managers/internal/ToastManager/helpers/getToastDataStateByStatus.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/initApp.mjs.map +2 -2
- package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
- package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
- package/out/methods/loginInfo/getLoginInfo.d.ts +1 -44
- 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/getPendingTransactions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getTransactionSessions.mjs +1 -1
- package/out/providers/DappProvider/DappProvider.d.ts +2 -45
- 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.js +8 -8
- package/out/providers/ProviderFactory.js.map +1 -1
- package/out/providers/ProviderFactory.mjs +1 -1
- package/out/providers/helpers/accountProvider.mjs +1 -1
- package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
- package/out/providers/helpers/clearInitiatedLogins.d.ts +2 -2
- package/out/providers/helpers/clearInitiatedLogins.js.map +1 -1
- package/out/providers/helpers/clearInitiatedLogins.mjs +1 -1
- package/out/providers/helpers/emptyProvider.d.ts +2 -2
- package/out/providers/helpers/emptyProvider.js.map +1 -1
- package/out/providers/helpers/emptyProvider.mjs +1 -1
- package/out/providers/helpers/restoreProvider.mjs +1 -1
- package/out/providers/index.mjs +1 -1
- package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.d.ts +3 -3
- package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.js.map +1 -1
- package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.d.ts +2 -2
- package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.js.map +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.d.ts +2 -2
- package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.js.map +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.d.ts +2 -2
- package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.js.map +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.d.ts +2 -2
- package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.js.map +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.d.ts +2 -2
- package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.js.map +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/WebviewProviderStrategy.d.ts +2 -2
- package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.js.map +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.js +17 -2
- package/out/providers/strategies/helpers/signMessage/signMessage.js.map +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/providers/types/providerFactory.types.d.ts +18 -17
- package/out/providers/types/providerFactory.types.js +10 -11
- package/out/providers/types/providerFactory.types.js.map +1 -1
- package/out/providers/types/providerFactory.types.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.d.ts +1 -44
- 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/useGetPendingTransactions.mjs +1 -1
- package/out/react/transactions/useGetPendingTransactionsSessions.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/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.d.ts +2 -2
- package/out/store/actions/loginInfo/loginInfoActions.js.map +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.d.ts +3 -3
- package/out/store/actions/sharedActions/sharedActions.js.map +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/selectors/index.mjs +1 -1
- package/out/store/selectors/loginInfoSelectors.d.ts +2 -45
- package/out/store/slices/index.mjs +1 -1
- package/out/store/slices/loginInfo/loginInfo.types.d.ts +3 -3
- package/out/store/slices/loginInfo/loginInfoSlice.d.ts +1 -1
- package/out/store/store.mjs +1 -1
- package/out/types/index.d.ts +1 -0
- package/out/types/index.js +1 -0
- package/out/types/index.js.map +1 -1
- package/out/types/index.mjs +1 -1
- package/out/types/suspiciousLink.types.d.ts +17 -0
- package/out/types/suspiciousLink.types.js +3 -0
- package/out/types/suspiciousLink.types.js.map +1 -0
- package/out/types/suspiciousLink.types.mjs +2 -0
- package/out/utils/account/index.mjs +1 -1
- package/out/utils/account/refreshAccount.mjs +1 -1
- package/out/utils/createUIElement.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/getTransactionValue/getTransactionValue.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/getTransactionValue/helpers/getTitleText.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/getTransactionValue/helpers/getTransactionActionNftText.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/getTransactionValue/helpers/index.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/getTransactionValue/index.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/getScamFlag.d.ts +8 -0
- package/out/utils/transactions/getScamFlag.js +78 -0
- package/out/utils/transactions/getScamFlag.js.map +1 -0
- package/out/utils/transactions/getScamFlag.mjs +2 -0
- package/out/utils/transactions/getScamFlag.mjs.map +7 -0
- package/out/utils/transactions/getTransactionsHistory/getTransactionsHistory.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/getAssetAmount.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/getAssetPrice.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/getCachedTransactionListItem.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/getTransactionAction.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/getTransactionActionTransferLabel.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/getTransactionAsset.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/getTransactionAssets.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/helpers/mapTransactionToListItem.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/index.mjs +1 -1
- package/out/utils/transactions/index.mjs +1 -1
- package/out/utils/validation/index.mjs +1 -1
- package/out/utils/validation/isContract.mjs +1 -1
- package/out/utils/walletconnect/__mocks__/sdkWalletconnectProvider.mjs +1 -1
- package/package.json +3 -2
- package/out/__chunks__/chunk-2S52O7LI.mjs +0 -2
- package/out/__chunks__/chunk-2S52O7LI.mjs.map +0 -7
- package/out/__chunks__/chunk-2X7ENE6Y.mjs +0 -2
- package/out/__chunks__/chunk-2X7ENE6Y.mjs.map +0 -7
- package/out/__chunks__/chunk-4BRZWHKY.mjs +0 -2
- package/out/__chunks__/chunk-4HVG3HGD.mjs +0 -2
- package/out/__chunks__/chunk-4NY6ZQCB.mjs +0 -2
- package/out/__chunks__/chunk-4NY6ZQCB.mjs.map +0 -7
- package/out/__chunks__/chunk-4XJLALSE.mjs.map +0 -7
- package/out/__chunks__/chunk-53X5OIR3.mjs +0 -2
- package/out/__chunks__/chunk-5TS4PZ6V.mjs +0 -2
- package/out/__chunks__/chunk-5WQFV4QY.mjs +0 -2
- package/out/__chunks__/chunk-5WQFV4QY.mjs.map +0 -7
- package/out/__chunks__/chunk-62PJZCUP.mjs +0 -2
- package/out/__chunks__/chunk-6VL4U3SD.mjs +0 -2
- package/out/__chunks__/chunk-7EQBNFTV.mjs +0 -2
- package/out/__chunks__/chunk-AIO3CDMH.mjs +0 -2
- package/out/__chunks__/chunk-AIO3CDMH.mjs.map +0 -7
- package/out/__chunks__/chunk-AKDRHJVP.mjs +0 -1
- package/out/__chunks__/chunk-BZWDNUS4.mjs +0 -2
- package/out/__chunks__/chunk-CQZVU4RB.mjs +0 -1
- package/out/__chunks__/chunk-CWZPGMEQ.mjs +0 -2
- package/out/__chunks__/chunk-CWZPGMEQ.mjs.map +0 -7
- package/out/__chunks__/chunk-EGEUR6LK.mjs +0 -2
- package/out/__chunks__/chunk-EGEUR6LK.mjs.map +0 -7
- package/out/__chunks__/chunk-EJKW2LHT.mjs +0 -2
- package/out/__chunks__/chunk-EJKW2LHT.mjs.map +0 -7
- package/out/__chunks__/chunk-G57SJWVR.mjs +0 -1
- package/out/__chunks__/chunk-GAOXEYHA.mjs +0 -1
- package/out/__chunks__/chunk-GAOXEYHA.mjs.map +0 -7
- package/out/__chunks__/chunk-HTPPS2MF.mjs.map +0 -7
- package/out/__chunks__/chunk-I3DNTUGR.mjs +0 -2
- package/out/__chunks__/chunk-IEPJBJYE.mjs +0 -2
- package/out/__chunks__/chunk-IOFZWNJ4.mjs +0 -2
- package/out/__chunks__/chunk-IOFZWNJ4.mjs.map +0 -7
- package/out/__chunks__/chunk-JGWNKE3I.mjs +0 -2
- package/out/__chunks__/chunk-JHSDQ4NG.mjs +0 -2
- package/out/__chunks__/chunk-KDE4OU7S.mjs +0 -2
- package/out/__chunks__/chunk-L73MXRIY.mjs +0 -2
- package/out/__chunks__/chunk-MCOVQEK7.mjs +0 -2
- package/out/__chunks__/chunk-MCOVQEK7.mjs.map +0 -7
- package/out/__chunks__/chunk-OYA4AQFY.mjs +0 -2
- package/out/__chunks__/chunk-OYA4AQFY.mjs.map +0 -7
- package/out/__chunks__/chunk-PVNL2LED.mjs +0 -1
- package/out/__chunks__/chunk-PVNL2LED.mjs.map +0 -7
- package/out/__chunks__/chunk-QA26HI3B.mjs +0 -2
- package/out/__chunks__/chunk-QA26HI3B.mjs.map +0 -7
- package/out/__chunks__/chunk-QQU6SRAV.mjs +0 -2
- package/out/__chunks__/chunk-RTH5DJEI.mjs +0 -2
- package/out/__chunks__/chunk-RVHEUIC3.mjs +0 -2
- package/out/__chunks__/chunk-RVHEUIC3.mjs.map +0 -7
- package/out/__chunks__/chunk-SJ4UJRDS.mjs +0 -2
- package/out/__chunks__/chunk-THQWNWSE.mjs +0 -2
- package/out/__chunks__/chunk-THQWNWSE.mjs.map +0 -7
- package/out/__chunks__/chunk-TKYDPA56.mjs +0 -2
- package/out/__chunks__/chunk-U277O55E.mjs +0 -2
- package/out/__chunks__/chunk-U277O55E.mjs.map +0 -7
- package/out/__chunks__/chunk-UFOL2NTX.mjs +0 -2
- package/out/__chunks__/chunk-VZI2XGAI.mjs +0 -2
- package/out/__chunks__/chunk-XCKQMM73.mjs +0 -2
- package/out/__chunks__/chunk-XCKQMM73.mjs.map +0 -7
- package/out/__chunks__/chunk-XCLDLXPX.mjs +0 -2
- package/out/__chunks__/chunk-XKBQDG5H.mjs +0 -1
- package/out/__chunks__/chunk-XKBQDG5H.mjs.map +0 -7
- package/out/__chunks__/chunk-XNEYOZ7M.mjs +0 -1
- package/out/__chunks__/chunk-XNEYOZ7M.mjs.map +0 -7
- /package/out/__chunks__/{chunk-KMFCWHOG.mjs.map → chunk-2KAOFKX4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7HJHGIBJ.mjs.map → chunk-2WB5WD5K.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-F3ZH2WXR.mjs.map → chunk-35YS2DV5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-W7TRO6AR.mjs.map → chunk-3IMDPLG5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4KOEDU3Y.mjs.map → chunk-3JNON2SM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-B2RDSGON.mjs.map → chunk-3OKWBJFM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CZYIK4AV.mjs.map → chunk-3Z3DQFG6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TLKMUVQJ.mjs.map → chunk-45WVS4H5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MNXYY4GE.mjs.map → chunk-4AOTLDWS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XPEAEEAP.mjs.map → chunk-4I2FE6NE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Z2PS6O33.mjs.map → chunk-53BZNNVL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-A2S6BDWO.mjs.map → chunk-55RBZAD6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2ENRJCCA.mjs.map → chunk-5L474T4X.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OPM4DDXX.mjs.map → chunk-6BGPH7MV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-P3NFZKKS.mjs.map → chunk-6L56KRO6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7EQBNFTV.mjs.map → chunk-AC2L3PV3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TTNVCEUD.mjs.map → chunk-AJJVMOJF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YZLY7QNI.mjs.map → chunk-BEUXUWCR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-R6GCICL7.mjs.map → chunk-BVKOA6WH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AKDRHJVP.mjs.map → chunk-CO3V5DOG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-53X5OIR3.mjs.map → chunk-CT6RFJJM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-S37QJIXF.mjs.map → chunk-CUSKOIRI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EA6FWJCX.mjs.map → chunk-EPMXW255.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-I3DNTUGR.mjs.map → chunk-EVL6UUJJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AW4W44IZ.mjs.map → chunk-GVKHWWIS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3XSKVLJW.mjs.map → chunk-GZAY7BOI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-S55MULGJ.mjs.map → chunk-HR6GP43Q.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-6XUO2J7G.mjs.map → chunk-IYS5W63R.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YVD46DFI.mjs.map → chunk-J4MZNYDR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-F33ED5VY.mjs.map → chunk-J7MZZ2X2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PYJMQN53.mjs.map → chunk-JENO4O6P.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-G2DLIXFQ.mjs.map → chunk-K3WBBSXJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IAAVRI6B.mjs.map → chunk-K7WAPWQA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3W2X3GZO.mjs.map → chunk-KUQH2ZBR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YVDP2G6F.mjs.map → chunk-KY7KOSJJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-62PJZCUP.mjs.map → chunk-LJ5JGAYL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NREOHZVN.mjs.map → chunk-LKWCLZTU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JHSDQ4NG.mjs.map → chunk-M7R5JSEH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XCLDLXPX.mjs.map → chunk-MAT2WHLY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KDE4OU7S.mjs.map → chunk-OH6SHSQZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CU47DEVW.mjs.map → chunk-OLYQNOEP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7YA5JPZ3.mjs.map → chunk-OOPHCYRC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EUM7J3UT.mjs.map → chunk-OTQRFI3T.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BZWDNUS4.mjs.map → chunk-P5YASUQH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-W4GE4ZDP.mjs.map → chunk-PRULMJH7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KSNODP2B.mjs.map → chunk-QFWMIF3L.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TAI3I5BS.mjs.map → chunk-QQNYMMUM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UF45HLIK.mjs.map → chunk-QYYNCJPD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4HVG3HGD.mjs.map → chunk-RIXZPR7R.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CQZVU4RB.mjs.map → chunk-TRMQFQOQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FKB6EYMV.mjs.map → chunk-TWWYWBJH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YZ5ZS3VO.mjs.map → chunk-U52ITGAN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-G3WS2SYA.mjs.map → chunk-UQXXWVTL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QQU6SRAV.mjs.map → chunk-UWNXZP4Z.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-L73MXRIY.mjs.map → chunk-V7ZVI2WS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5TS4PZ6V.mjs.map → chunk-VK47SZJ2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VZI2XGAI.mjs.map → chunk-VPZ3QEMD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GVA5Y5KR.mjs.map → chunk-VQIWENYE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TKYDPA56.mjs.map → chunk-W5W6YGA5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IEPJBJYE.mjs.map → chunk-WGH5AERA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-OIL7VMRM.mjs.map → chunk-WVB4VPRI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EVNL24SI.mjs.map → chunk-X5OSPJKQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RTH5DJEI.mjs.map → chunk-Y62KWXTT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CYFAX2FA.mjs.map → chunk-YMUUG42I.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QSAHAGTQ.mjs.map → chunk-YWBC3WTI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JTQCNFCR.mjs.map → chunk-ZJOTHYI2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PEURG4PE.mjs.map → chunk-ZOGJGVPP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4X65PD55.mjs.map → chunk-ZZOHAMTX.mjs.map} +0 -0
- /package/out/{__chunks__/chunk-G57SJWVR.mjs.map → types/suspiciousLink.types.mjs.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as U}from"./chunk-TWWYWBJH.mjs";import{a as v}from"./chunk-U52ITGAN.mjs";import{a as D,b as R,g as F}from"./chunk-QD3CFFVT.mjs";import{a as z}from"./chunk-3IXTYHAU.mjs";import{b as f}from"./chunk-WVB4VPRI.mjs";import{a as _}from"./chunk-W5W6YGA5.mjs";import{a as j}from"./chunk-4ODPAHHA.mjs";import{a as $}from"./chunk-Z5CDCI3Y.mjs";import{a as G}from"./chunk-XPX7PTGI.mjs";import{a as u}from"./chunk-VPZ3QEMD.mjs";import{a as L}from"./chunk-OH6SHSQZ.mjs";import{a as V}from"./chunk-P5YASUQH.mjs";import{a as T}from"./chunk-KUQH2ZBR.mjs";import{a as l,f as O}from"./chunk-VQIWENYE.mjs";import{a as M}from"./chunk-45WVS4H5.mjs";import{b as W}from"./chunk-SKEL25G3.mjs";import{a as h}from"./chunk-HORSXVIV.mjs";import{a as g}from"./chunk-6FXEHNGW.mjs";import{a as K}from"./chunk-NJN53MJV.mjs";import{a as b}from"./chunk-YSCND2MX.mjs";import{b as k,s as m,u as N}from"./chunk-4YETXBJD.mjs";import{b as I}from"./chunk-IEJTMYFW.mjs";import{b as C,c as P,f as S}from"./chunk-R53MCZI6.mjs";import{b as B}from"./chunk-YEXBSKXL.mjs";import{a as E}from"./chunk-NHXPNROG.mjs";async function w({address:t,provider:o,apiAddress:r}){let e=await g({address:t,baseURL:r});if(!e)throw new Error("Account not found");W({address:t,providerType:o.getType()});let n={...e,username:h(e.username),nonce:T(e)};l(n),await f(t),v(),e.shard!=null&&await U({shard:Number(e.shard),apiAddress:r})}async function ot(t){let{network:{apiAddress:o}}=u();await t.login();let r=await t.getAddress();if(!r)throw new Error("Address not found");return await w({address:r,provider:t,apiAddress:o}),{address:r}}async function rt({provider:t,nativeAuthConfig:o,token:r}){let{network:{apiAddress:e}}=u(),n=M(o),s=r;s||(s=await n.initialize({noCache:!0}));let{address:i,signature:c,...a}=await t.login({token:s});if(!i)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let p=n.getToken({address:i,token:s,signature:c});k({loginToken:s,signature:c,nativeAuthToken:p});let d=await _({loginToken:s,extraInfoData:{multisig:a?.multisig,impersonate:a?.impersonate},address:i});return await w({address:d,provider:t,apiAddress:e}),{address:d,signature:c}}async function H(t,o){let r=I(N());if(r)return await rt({provider:t,nativeAuthConfig:r,token:o?.token});let{address:e}=await ot(t);return await f(e),v(),{address:e}}var y={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${R}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${D}-${Date.now()}`}},et={extensionResponse:"Unable to sign transactions","Transaction canceled":"Transaction canceled","cancelled by user":"Transaction signing cancelled by user","denied by the user":"Transaction signing denied by the user"},nt=t=>{for(let[o,r]of Object.entries(et))if(t.includes(o))return r;return"Error when signing"};function A(t,o="error"){let r=t?.message,e=nt(r),s=e!=="Error when signing"?"warning":o,i=Object.keys(y).includes(s)?y[s]:y.error,{toastId:c,iconClassName:a,title:p}=i;return q({toastId:c,duration:1e4,icon:"times",iconClassName:a,message:e,title:p}),e}async function J({provider:t,transactions:o,options:r={}}){await Q();let{isGuarded:e,activeGuardianAddress:n,nonce:s}=V(),i=t.getType()===E.ledger,c=j({latestNonce:s,transactions:o}),a=n&&e&&!r.skipGuardian?c?.map(d=>(d.version=C.withTxOptions().valueOf(),d.options=S.withOptions({guarded:!0,...i?{hashSign:!0}:{}}).valueOf(),d.guardian=P.newFromBech32(n),d)):c,p=await t.signTransactions(a)??[];return O(s+p.length),p}var x=class{constructor(o){this.provider=o}init(){return this.provider.init()}async login(o){return await H(this.provider,o)}isInitialized(){return this.provider.isInitialized()}async logout(o={shouldBroadcastLogoutAcrossTabs:!0,hasConsentPopup:!1}){return await z({provider:this.provider,options:o})}setShouldShowConsentPopup(o){this.provider.setShouldShowConsentPopup?.(o)}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(o,r){try{return await J({provider:this.provider,transactions:o,options:r})}catch(e){let n=A(e);throw new Error(n)}}async signMessage(o,r){try{return await G({provider:this.provider,message:o,options:r})}catch(e){let n=A(e,"warning");throw new Error(n)}}async verifyMessage(o){return await $(o)}cancelLogin(){this.provider.cancelLogin?.()}};var X=null;function go(t){X=t}function Y(){return X||new x(B)}var st=async()=>{try{let t=L(),{network:o}=u();try{let r=await g({address:t,baseURL:o.apiAddress});if(r!=null){let e={...r,username:h(r.username),nonce:T(r)};return l(e),e}}catch(r){console.error("Failed getting account ",r)}}catch(t){console.error("Failed getting address ",t)}return null};async function Q(){let t=Y();if(t==null)throw"Provider not initialized";try{if(!t.init)throw"Current provider does not have init() function";return await t.init()?st():void 0}catch(o){console.error("Failed initializing provider ",o)}}var Z={},tt={},it=(t,o)=>{m().setState(({toasts:r})=>{let e=r.customToasts.length>0?Math.max(...r.customToasts.map(a=>parseInt(a.toastId.split("-").pop()??"0"))):0,n=o??`custom-toast-${e+1}`,s=r.customToasts.findIndex(a=>a.toastId===n),i={...t,toastId:n};if(s!==-1){r.customToasts[s]=i;return}r.customToasts.push({...i,toastId:n})},!1,"addCustomToast")},_o=t=>{m().setState(({toasts:o})=>{o.customToasts=o.customToasts.filter(r=>r.toastId!==t)},!1,"removeCustomToast")},zo=()=>{m().setState(({toasts:t})=>{t.customToasts=[]},!1,"removeAllCustomToasts")},Go=()=>{m().setState(({toasts:t})=>{t.transactionToasts=[]})},$o=({toastId:t,totalDuration:o})=>{m().setState(({toasts:r})=>{let e=r.transactionToasts.length>0?Math.max(...r.transactionToasts.map(s=>parseInt(s.toastId.split("-").pop()??"0"))):0,n=t||`transaction-toast-${e+1}`;r.transactionToasts.push({startTime:b(),endTime:K(o),toastId:n})},!1,"addTransactionToast")},Vo=t=>{m().setState(({toasts:o})=>{o.transactionToasts=o.transactionToasts.filter(r=>r.toastId!==t)},!1,"removeTransactionToast"),delete tt[t],delete Z[t]},q=t=>{let{toasts:o}=m().getState(),r=o.customToasts.length>0?Math.max(...o.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,e=t.toastId||`custom-toast-${r+1}`;return t.onClose&&(tt[e]=t.onClose),t.instantiateToastElement?(Z[e]=t.instantiateToastElement,m().setState(({toasts:n})=>{let s=n.customToasts.findIndex(a=>a.toastId===e),i={...t,instantiateToastElement:null,toastId:e};s!==-1?n.customToasts[s]=i:n.customToasts.push(i)},!1,"createCustomToast"),e):(it(t,e),e)};export{Z as a,tt as b,it as c,_o as d,zo as e,Go as f,$o as g,Vo as h,q as i,w as j,H as k,A as l,J as m,x as n,go as o,Y as p,Q as q};
|
|
2
|
+
//# sourceMappingURL=chunk-2G6DWPQU.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/providers/DappProvider/helpers/login/helpers/accountLogin.ts", "../../src/providers/DappProvider/helpers/login/login.ts", "../../src/providers/DappProvider/helpers/signErrors/handleSignError.ts", "../../src/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.ts", "../../src/providers/DappProvider/DappProvider.ts", "../../src/providers/helpers/accountProvider.ts", "../../src/utils/account/refreshAccount.ts", "../../src/store/actions/toasts/toastsActions.ts"],
|
|
4
4
|
"sourcesContent": ["import { getLatestNonce } from 'methods/account/getLatestNonce';\nimport { setGasStationMetadata } from 'methods/initApp/gastStationMetadata/setGasStationMetadata';\nimport { registerWebsocketListener } from 'methods/initApp/websocket/registerWebsocket';\nimport { trackTransactions } from 'methods/trackTransactions/trackTransactions';\nimport { IProvider } from 'providers/types/providerFactory.types';\nimport { loginAction } from 'store/actions';\nimport { setAccount } from 'store/actions/account';\nimport { AccountType } from 'types/account.types';\nimport { fetchAccount } from 'utils/account/fetchAccount';\nimport { trimUsernameDomain } from 'utils/account/trimUsernameDomain';\n\ninterface IAccountLoginProps {\n address: string;\n provider: IProvider;\n apiAddress: string;\n}\n\nexport async function accountLogin({\n address,\n provider,\n apiAddress\n}: IAccountLoginProps) {\n const account = await fetchAccount({\n address,\n baseURL: apiAddress\n });\n\n if (!account) {\n throw new Error('Account not found');\n }\n\n loginAction({\n address,\n providerType: provider.getType()\n });\n\n const newAccount: AccountType = {\n ...account,\n username: trimUsernameDomain(account.username),\n nonce: getLatestNonce(account)\n };\n\n setAccount(newAccount);\n\n await registerWebsocketListener(address);\n trackTransactions();\n\n if (account.shard != null) {\n await setGasStationMetadata({\n shard: Number(account.shard),\n apiAddress\n });\n }\n}\n", "import { registerWebsocketListener } from 'methods/initApp/websocket/registerWebsocket';\nimport { getNetworkConfig } from 'methods/network/getNetworkConfig';\nimport { trackTransactions } from 'methods/trackTransactions/trackTransactions';\nimport { IProvider } from 'providers/types/providerFactory.types';\nimport { nativeAuth } from 'services/nativeAuth';\nimport { NativeAuthConfigType } from 'services/nativeAuth/nativeAuth.types';\nimport { setTokenLogin } from 'store/actions/loginInfo/loginInfoActions';\nimport { nativeAuthConfigSelector } from 'store/selectors';\nimport { getState } from 'store/store';\nimport { accountLogin } from './helpers/accountLogin';\nimport { extractAddressFromToken } from './helpers/extractAddressFromToken';\n\nasync function loginWithoutNativeToken(provider: IProvider) {\n const {\n network: { apiAddress }\n } = getNetworkConfig();\n\n await provider.login();\n\n const address = await provider.getAddress();\n\n if (!address) {\n throw new Error('Address not found');\n }\n\n await accountLogin({ address, provider, apiAddress });\n\n return {\n address\n };\n}\n\nasync function loginWithNativeToken({\n provider,\n nativeAuthConfig,\n token\n}: {\n provider: IProvider;\n nativeAuthConfig: NativeAuthConfigType;\n token?: string;\n}) {\n const {\n network: { apiAddress }\n } = getNetworkConfig();\n\n const nativeAuthClient = nativeAuth(nativeAuthConfig);\n let loginToken = token;\n\n if (!loginToken) {\n loginToken = await nativeAuthClient.initialize({\n noCache: true\n });\n }\n\n const { address, signature, ...loginResult } = await provider.login({\n token: loginToken\n });\n\n if (!address) {\n console.warn('Login cancelled.');\n return null;\n }\n\n if (!signature) {\n console.error('Failed to sign login token');\n return null;\n }\n\n const nativeAuthToken = nativeAuthClient.getToken({\n address,\n token: loginToken,\n signature\n });\n\n setTokenLogin({\n loginToken,\n signature,\n nativeAuthToken\n });\n\n const extractedAddress = await extractAddressFromToken({\n loginToken,\n extraInfoData: {\n multisig: loginResult?.multisig,\n impersonate: loginResult?.impersonate\n },\n address\n });\n\n await accountLogin({\n address: extractedAddress,\n provider,\n apiAddress\n });\n\n return {\n address: extractedAddress,\n signature\n };\n}\n\nexport async function login(provider: IProvider, options?: { token?: string }) {\n const nativeAuthConfig = nativeAuthConfigSelector(getState());\n\n if (nativeAuthConfig) {\n const data = await loginWithNativeToken({\n provider,\n nativeAuthConfig,\n token: options?.token\n });\n return data;\n }\n\n const { address } = await loginWithoutNativeToken(provider);\n\n await registerWebsocketListener(address);\n trackTransactions();\n\n return { address };\n}\n", "import {\n CANCEL_TRANSACTION_TOAST_DEFAULT_DURATION,\n CANCEL_TRANSACTION_TOAST_ID,\n ERROR_SIGNING_TOAST_ID\n} from 'constants/transactions.constants';\nimport { ToastIconsEnum } from 'managers/internal/ToastManager/helpers/getToastDataStateByStatus';\nimport { createCustomToast } from 'store/actions';\nimport { SigningErrorsEnum, SigningWarningsEnum } from 'types/enums.types';\n\nconst states = {\n error: {\n title: SigningErrorsEnum.errorSigning.toString(),\n iconClassName: 'danger',\n toastId: `${ERROR_SIGNING_TOAST_ID}-${Date.now()}`\n },\n warning: {\n title: SigningWarningsEnum.cancelled.toString(),\n iconClassName: 'warning',\n toastId: `${CANCEL_TRANSACTION_TOAST_ID}-${Date.now()}`\n }\n};\n\nconst errorsMap = {\n extensionResponse: 'Unable to sign transactions', // extension\n 'Transaction canceled': 'Transaction canceled', // web wallet\n 'cancelled by user': 'Transaction signing cancelled by user', // custom\n 'denied by the user': 'Transaction signing denied by the user' // ledger\n};\n\nconst getUserError = (error: string) => {\n for (const [key, value] of Object.entries(errorsMap)) {\n if (error.includes(key)) {\n return value;\n }\n }\n return SigningErrorsEnum.errorSigning;\n};\n\nexport function handleSignError(\n error: unknown,\n type: 'error' | 'warning' = 'error'\n) {\n const originalError = (error as Error)?.message;\n const errorMessage = getUserError(originalError);\n\n const isKnownError = errorMessage !== SigningErrorsEnum.errorSigning;\n\n const errorType = isKnownError ? 'warning' : type;\n\n const state = Object.keys(states).includes(errorType)\n ? states[errorType]\n : states.error;\n\n const { toastId, iconClassName, title } = state;\n\n createCustomToast({\n toastId,\n duration: CANCEL_TRANSACTION_TOAST_DEFAULT_DURATION,\n icon: ToastIconsEnum.times,\n iconClassName,\n message: errorMessage,\n title\n });\n\n return errorMessage;\n}\n", "import {\n Address,\n Transaction,\n TransactionOptions,\n TransactionVersion\n} from 'lib/sdkCore';\nimport { getAccount } from 'methods/account/getAccount';\nimport {\n IProvider,\n ProviderTypeEnum\n} from 'providers/types/providerFactory.types';\nimport { setAccountNonce } from 'store/actions';\nimport { refreshAccount } from 'utils';\nimport { computeNonces } from '../computeNonces/computeNonces';\n\nexport type SignTransactionsOptionsType = {\n skipGuardian?: boolean;\n};\n\ntype SignTransactionsType = {\n provider: IProvider;\n transactions: Transaction[];\n options?: SignTransactionsOptionsType;\n};\n\nexport async function signTransactionsWithProvider({\n provider,\n transactions,\n options = {}\n}: SignTransactionsType): Promise<Transaction[]> {\n await refreshAccount();\n const { isGuarded, activeGuardianAddress, nonce } = getAccount();\n const isLedger = provider.getType() === ProviderTypeEnum.ledger;\n\n const transactionsWithComputedNonce = computeNonces({\n latestNonce: nonce,\n transactions\n });\n\n const transactionsToSign =\n activeGuardianAddress && isGuarded && !options.skipGuardian\n ? transactionsWithComputedNonce?.map((transaction) => {\n transaction.version = TransactionVersion.withTxOptions().valueOf();\n transaction.options = TransactionOptions.withOptions({\n guarded: true,\n ...(isLedger ? { hashSign: true } : {})\n }).valueOf();\n\n transaction.guardian = Address.newFromBech32(activeGuardianAddress);\n\n return transaction;\n })\n : transactionsWithComputedNonce;\n\n const signedTransactions: Transaction[] =\n (await provider.signTransactions(transactionsToSign)) ?? [];\n\n setAccountNonce(nonce + signedTransactions.length);\n\n return signedTransactions;\n}\n", "import { Message, Transaction } from 'lib/sdkCore';\nimport { IProvider } from '../types/providerFactory.types';\nimport { login } from './helpers/login/login';\nimport { logout } from './helpers/logout/logout';\nimport { handleSignError } from './helpers/signErrors/handleSignError';\nimport { signMessageWithProvider } from './helpers/signMessage/signMessageWithProvider';\nimport {\n verifyMessage,\n VerifyMessageReturnType\n} from './helpers/signMessage/verifyMessage';\nimport {\n signTransactionsWithProvider,\n SignTransactionsOptionsType\n} from './helpers/signTransactions/signTransactionsWithProvider';\n\nexport class DappProvider {\n private provider: IProvider;\n\n constructor(provider: IProvider) {\n this.provider = provider;\n }\n\n init(): Promise<boolean> {\n return this.provider.init();\n }\n\n async login(options?: { token?: string }) {\n const data = await login(this.provider, options);\n return data;\n }\n\n isInitialized(): boolean {\n return this.provider.isInitialized();\n }\n\n async logout(\n options = {\n shouldBroadcastLogoutAcrossTabs: true,\n hasConsentPopup: false\n }\n ): Promise<boolean> {\n return await logout({ provider: this.provider, options });\n }\n\n setShouldShowConsentPopup(shouldShow: boolean): void {\n this.provider.setShouldShowConsentPopup?.(shouldShow);\n }\n\n getType() {\n return this.provider.getType();\n }\n\n /**\n * @returns The original provider instance.\n */\n getProvider() {\n return this.provider;\n }\n\n async signTransactions(\n transactions: Transaction[],\n options?: SignTransactionsOptionsType\n ): Promise<Transaction[]> {\n try {\n const signedTransactions = await signTransactionsWithProvider({\n provider: this.provider,\n transactions,\n options\n });\n return signedTransactions;\n } catch (error) {\n const errorMessage = handleSignError(error);\n throw new Error(errorMessage);\n }\n }\n\n async signMessage(\n message: Message,\n options?: {\n hasConsentPopup?: boolean;\n }\n ): Promise<Message | null> {\n try {\n const signedMessage = await signMessageWithProvider({\n provider: this.provider,\n message,\n options\n });\n return signedMessage;\n } catch (error) {\n const errorMessage = handleSignError(error, 'warning');\n throw new Error(errorMessage);\n }\n }\n\n /**\n * @param signedMessage - The signed message to verify in form of a JSON string with `address`, `message` and `signature` properties.\n * @returns The verification result with `isVerified`, `message` and `address` properties.\n */\n async verifyMessage(signedMessage: string): Promise<VerifyMessageReturnType> {\n return await verifyMessage(signedMessage);\n }\n\n cancelLogin(): void {\n this.provider.cancelLogin?.();\n }\n}\n", "import { IProvider } from 'providers/types/providerFactory.types';\nimport { DappProvider } from '../DappProvider';\nimport { emptyProvider } from './emptyProvider';\n\nexport type ProvidersType = IProvider;\n\nlet accountProvider: DappProvider | null = null;\n\nexport function setAccountProvider<TProvider extends DappProvider | null>(\n provider: TProvider\n) {\n accountProvider = provider;\n}\n\nexport function getAccountProvider(): DappProvider {\n return accountProvider || new DappProvider(emptyProvider);\n}\n", "import { getAddress } from 'methods/account/getAddress';\nimport { getLatestNonce } from 'methods/account/getLatestNonce';\nimport { getNetworkConfig } from 'methods/network/getNetworkConfig';\nimport { getAccountProvider } from 'providers/helpers/accountProvider';\nimport { setAccount } from 'store/actions';\nimport { fetchAccount } from './fetchAccount';\nimport { trimUsernameDomain } from './trimUsernameDomain';\n\nconst setNewAccount = async () => {\n try {\n const address = getAddress();\n const { network } = getNetworkConfig();\n\n try {\n const account = await fetchAccount({\n address,\n baseURL: network.apiAddress\n });\n\n if (account != null) {\n const accountData = {\n ...account,\n username: trimUsernameDomain(account.username),\n nonce: getLatestNonce(account)\n };\n\n setAccount(accountData);\n\n return accountData;\n }\n } catch (e) {\n console.error('Failed getting account ', e);\n }\n } catch (e) {\n console.error('Failed getting address ', e);\n }\n\n return null;\n};\n\nexport async function refreshAccount() {\n const provider = getAccountProvider();\n\n if (provider == null) {\n throw 'Provider not initialized';\n }\n\n try {\n if (!provider.init) {\n throw 'Current provider does not have init() function';\n }\n\n const initialized = await provider.init();\n\n if (!initialized) {\n return;\n }\n\n return setNewAccount();\n } catch (e) {\n console.error('Failed initializing provider ', e);\n }\n\n return undefined;\n}\n", "import {\n CustomToastType,\n IComponentToast\n} from 'store/slices/toast/toastSlice.types';\nimport { getStore } from 'store/store';\nimport { getUnixTimestamp, getUnixTimestampWithAddedMilliseconds } from 'utils';\n\nexport const customToastComponentDictionary: Record<\n string,\n IComponentToast['instantiateToastElement']\n> = {};\nexport const customToastCloseHandlersDictionary: Record<string, () => void> =\n {};\n\nexport const addCustomToast = (\n customToast: CustomToastType,\n currentToastId?: string\n) => {\n getStore().setState(\n ({ toasts: state }) => {\n const lastToastIndex =\n state.customToasts.length > 0\n ? Math.max(\n ...state.customToasts.map((toast) =>\n parseInt(toast.toastId.split('-').pop() ?? '0')\n )\n )\n : 0;\n const toastId = currentToastId ?? `custom-toast-${lastToastIndex + 1}`;\n\n const existingToastIndex = state.customToasts.findIndex(\n (toast) => toast.toastId === toastId\n );\n\n const newToast: CustomToastType = {\n ...customToast,\n toastId\n };\n\n const isToastFound = existingToastIndex !== -1;\n\n if (isToastFound) {\n state.customToasts[existingToastIndex] = newToast;\n return;\n }\n\n state.customToasts.push({\n ...newToast,\n toastId\n });\n },\n false,\n 'addCustomToast'\n );\n};\n\nexport const removeCustomToast = (toastId: string) => {\n getStore().setState(\n ({ toasts: state }) => {\n state.customToasts = state.customToasts.filter(\n (toast) => toast.toastId !== toastId\n );\n },\n false,\n 'removeCustomToast'\n );\n};\n\nexport const removeAllCustomToasts = () => {\n getStore().setState(\n ({ toasts: state }) => {\n state.customToasts = [];\n },\n false,\n 'removeAllCustomToasts'\n );\n};\n\nexport const removeAllTransactionToasts = () => {\n getStore().setState(({ toasts: state }) => {\n state.transactionToasts = [];\n });\n};\n\nexport const addTransactionToast = ({\n toastId,\n totalDuration\n}: {\n toastId: string;\n totalDuration: number;\n}) => {\n getStore().setState(\n ({ toasts: state }) => {\n const lastToastIndex =\n state.transactionToasts.length > 0\n ? Math.max(\n ...state.transactionToasts.map((toast) =>\n parseInt(toast.toastId.split('-').pop() ?? '0')\n )\n )\n : 0;\n const newToastId = toastId || `transaction-toast-${lastToastIndex + 1}`;\n\n state.transactionToasts.push({\n startTime: getUnixTimestamp(),\n endTime: getUnixTimestampWithAddedMilliseconds(totalDuration),\n toastId: newToastId\n });\n },\n false,\n 'addTransactionToast'\n );\n};\n\nexport const removeTransactionToast = (toastId: string) => {\n getStore().setState(\n ({ toasts: state }) => {\n state.transactionToasts = state.transactionToasts.filter((toast) => {\n return toast.toastId !== toastId;\n });\n },\n false,\n 'removeTransactionToast'\n );\n\n delete customToastCloseHandlersDictionary[toastId];\n delete customToastComponentDictionary[toastId];\n};\n\nexport const createCustomToast = (props: CustomToastType) => {\n const { toasts } = getStore().getState();\n\n const lastToastIndex =\n toasts.customToasts.length > 0\n ? Math.max(\n ...toasts.customToasts.map((toast) =>\n parseInt(toast.toastId.split('-').pop() ?? '0')\n )\n )\n : 0;\n\n const toastId = props.toastId || `custom-toast-${lastToastIndex + 1}`;\n\n if (props.onClose) {\n customToastCloseHandlersDictionary[toastId] = props.onClose;\n }\n\n if (props.instantiateToastElement) {\n customToastComponentDictionary[toastId] = props.instantiateToastElement;\n\n getStore().setState(\n ({ toasts: state }) => {\n const existingToastIndex = state.customToasts.findIndex(\n (toast) => toast.toastId === toastId\n );\n\n const toast: CustomToastType = {\n ...props,\n instantiateToastElement: null,\n toastId\n };\n\n const isToastFound = existingToastIndex !== -1;\n\n if (isToastFound) {\n state.customToasts[existingToastIndex] = toast;\n } else {\n state.customToasts.push(toast);\n }\n },\n false,\n 'createCustomToast'\n );\n\n return toastId;\n }\n\n addCustomToast(props, toastId);\n return toastId;\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["accountLogin", "address", "provider", "apiAddress", "account", "fetchAccount", "loginAction", "newAccount", "trimUsernameDomain", "getLatestNonce", "setAccount", "registerWebsocketListener", "trackTransactions", "setGasStationMetadata", "loginWithoutNativeToken", "provider", "apiAddress", "getNetworkConfig", "address", "accountLogin", "loginWithNativeToken", "nativeAuthConfig", "token", "nativeAuthClient", "nativeAuth", "loginToken", "signature", "loginResult", "nativeAuthToken", "setTokenLogin", "extractedAddress", "extractAddressFromToken", "login", "options", "nativeAuthConfigSelector", "getState", "registerWebsocketListener", "trackTransactions", "states", "ERROR_SIGNING_TOAST_ID", "CANCEL_TRANSACTION_TOAST_ID", "errorsMap", "getUserError", "error", "key", "value", "handleSignError", "type", "originalError", "errorMessage", "errorType", "state", "toastId", "iconClassName", "title", "createCustomToast", "signTransactionsWithProvider", "provider", "transactions", "options", "refreshAccount", "isGuarded", "activeGuardianAddress", "nonce", "getAccount", "isLedger", "transactionsWithComputedNonce", "computeNonces", "transactionsToSign", "transaction", "TransactionVersion", "TransactionOptions", "Address", "signedTransactions", "setAccountNonce", "DappProvider", "provider", "options", "login", "logout", "shouldShow", "transactions", "signTransactionsWithProvider", "error", "errorMessage", "handleSignError", "message", "signMessageWithProvider", "signedMessage", "verifyMessage", "accountProvider", "setAccountProvider", "provider", "getAccountProvider", "DappProvider", "emptyProvider", "setNewAccount", "address", "getAddress", "network", "getNetworkConfig", "account", "fetchAccount", "accountData", "trimUsernameDomain", "getLatestNonce", "setAccount", "e", "refreshAccount", "provider", "getAccountProvider", "customToastComponentDictionary", "customToastCloseHandlersDictionary", "addCustomToast", "customToast", "currentToastId", "getStore", "state", "lastToastIndex", "toast", "toastId", "existingToastIndex", "newToast", "removeCustomToast", "removeAllCustomToasts", "removeAllTransactionToasts", "addTransactionToast", "totalDuration", "newToastId", "getUnixTimestamp", "getUnixTimestampWithAddedMilliseconds", "removeTransactionToast", "createCustomToast", "props", "toasts"]
|
|
5
|
+
"mappings": "kjCAiBA,eAAsBA,EAAa,CACjC,QAAAC,EACA,SAAAC,EACA,WAAAC,CACF,EAAuB,CACrB,IAAMC,EAAU,MAAMC,EAAa,CACjC,QAAAJ,EACA,QAASE,CACX,CAAC,EAED,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,mBAAmB,EAG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,SACT,CAAC,CAAE,OAAQC,CAAM,IAAM,CACrB,IAAMI,EAAqBJ,EAAM,aAAa,UAC3CE,GAAUA,EAAM,UAAYC,CAC/B,EAEMD,EAAyB,CAC7B,GAAGc,EACH,wBAAyB,KACzB,QAAAb,CACF,EAEqBC,IAAuB,GAG1CJ,EAAM,aAAaI,CAAkB,EAAIF,EAEzCF,EAAM,aAAa,KAAKE,CAAK,CAEjC,EACA,GACA,mBACF,EAEOC,IAGTP,GAAeoB,EAAOb,CAAO,EACtBA,EACT",
|
|
6
|
+
"names": ["accountLogin", "address", "provider", "apiAddress", "account", "fetchAccount", "loginAction", "newAccount", "trimUsernameDomain", "getLatestNonce", "setAccount", "registerWebsocketListener", "trackTransactions", "setGasStationMetadata", "loginWithoutNativeToken", "provider", "apiAddress", "getNetworkConfig", "address", "accountLogin", "loginWithNativeToken", "nativeAuthConfig", "token", "nativeAuthClient", "nativeAuth", "loginToken", "signature", "loginResult", "nativeAuthToken", "setTokenLogin", "extractedAddress", "extractAddressFromToken", "login", "options", "nativeAuthConfigSelector", "getState", "registerWebsocketListener", "trackTransactions", "states", "ERROR_SIGNING_TOAST_ID", "CANCEL_TRANSACTION_TOAST_ID", "errorsMap", "getUserError", "error", "key", "value", "handleSignError", "type", "originalError", "errorMessage", "errorType", "state", "toastId", "iconClassName", "title", "createCustomToast", "signTransactionsWithProvider", "provider", "transactions", "options", "refreshAccount", "isGuarded", "activeGuardianAddress", "nonce", "getAccount", "isLedger", "ProviderTypeEnum", "transactionsWithComputedNonce", "computeNonces", "transactionsToSign", "transaction", "TransactionVersion", "TransactionOptions", "Address", "signedTransactions", "setAccountNonce", "DappProvider", "provider", "options", "login", "logout", "shouldShow", "transactions", "signTransactionsWithProvider", "error", "errorMessage", "handleSignError", "message", "signMessageWithProvider", "signedMessage", "verifyMessage", "accountProvider", "setAccountProvider", "provider", "getAccountProvider", "DappProvider", "emptyProvider", "setNewAccount", "address", "getAddress", "network", "getNetworkConfig", "account", "fetchAccount", "accountData", "trimUsernameDomain", "getLatestNonce", "setAccount", "e", "refreshAccount", "provider", "getAccountProvider", "customToastComponentDictionary", "customToastCloseHandlersDictionary", "addCustomToast", "customToast", "currentToastId", "getStore", "state", "lastToastIndex", "toast", "toastId", "existingToastIndex", "newToast", "removeCustomToast", "removeAllCustomToasts", "removeAllTransactionToasts", "addTransactionToast", "totalDuration", "newToastId", "getUnixTimestamp", "getUnixTimestampWithAddedMilliseconds", "removeTransactionToast", "createCustomToast", "props", "toasts"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-YWBC3WTI.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-2KAOFKX4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a,c as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as a,c as n}from"./chunk-ZOGJGVPP.mjs";function m({results:r,hash:e,sessionId:s}){let t=r?.find(i=>i?.returnMessage!=="");n({sessionId:s,transaction:{...t,hash:e,status:"fail",inTransit:!1}}),a({sessionId:s,status:"fail",errorMessage:t?.returnMessage})}export{m as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2WB5WD5K.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-4TBVQD27.mjs";import{s as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-4TBVQD27.mjs";import{s as o}from"./chunk-4YETXBJD.mjs";var l=t=>o().setState(({config:e})=>{e.nativeAuthConfig=t},!1,"setNativeAuthConfig"),c=t=>o().setState(({config:e})=>{e.websocketStatus=t},!1,"setWebsocketStatus"),f=t=>o().setState(({config:e})=>{let s=t.walletConnectV2RelayAddress||n.walletConnectV2RelayAddress,i=t.walletConnectDeepLink||n.walletConnectDeepLink;e.walletConnectConfig={...t,walletConnectDeepLink:i,walletConnectV2RelayAddress:s}},!1,"setWalletConnectConfig"),r=t=>o().setState(({config:e})=>{e.crossWindowConfig=t},!1,"setCrossWindowConfig");export{l as a,c as b,f as c,r as d};
|
|
2
|
+
//# sourceMappingURL=chunk-35YS2DV5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-CUSKOIRI.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-3IMDPLG5.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i}from"./chunk-WVB4VPRI.mjs";import{a as u}from"./chunk-OH6SHSQZ.mjs";import{a as g}from"./chunk-SKEL25G3.mjs";import{c as n}from"./chunk-PPA7AFVD.mjs";import{a}from"./chunk-NHXPNROG.mjs";import{a as s}from"./chunk-7QCBLUWB.mjs";var c=(o,r)=>{let t=`sdk-dapp-logout-event-${o}`,e=r.getItem(t);e&&o!==e||(r.setItem(t,o),r.removeItem(t))};async function h({provider:o,options:r={shouldBroadcastLogoutAcrossTabs:!0,hasConsentPopup:!1}}){let t=u();r.shouldBroadcastLogoutAcrossTabs&&s.localStorage&&c(t,s.localStorage);try{return g(),r.hasConsentPopup&&o.getType()===a.crossWindow&&o.setShouldShowConsentPopup(!0),n.forEach(p=>p()),n.clear(),i.closeConnectionRef?.(),await o.logout()}catch(e){return console.error("Logging out error:",e),!1}}export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3IXTYHAU.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/providers/DappProvider/helpers/logout/logout.ts"],
|
|
4
4
|
"sourcesContent": ["import { subscriptions } from 'constants/storage.constants';\nimport { safeWindow } from 'constants/window.constants';\nimport { CrossWindowProvider } from 'lib/sdkWebWalletCrossWindowProvider';\nimport { getAddress } from 'methods/account/getAddress';\nimport { websocketManager } from 'methods/initApp/websocket/registerWebsocket';\nimport {\n IProvider,\n ProviderTypeEnum\n} from 'providers/types/providerFactory.types';\nimport { logoutAction } from 'store/actions/sharedActions/sharedActions';\n\nexport type LogoutPropsType = {\n shouldAttemptReLogin?: boolean;\n shouldBroadcastLogoutAcrossTabs?: boolean;\n /*\n * Only used for web-wallet crossWindow login\n */\n hasConsentPopup?: boolean;\n};\n\ninterface IProviderLogout {\n provider: IProvider;\n options?: LogoutPropsType;\n}\n\nconst broadcastLogoutAcrossTabs = (address: string, localStorage: Storage) => {\n const logoutEventKey = `sdk-dapp-logout-event-${address}`;\n const storedAddress = localStorage.getItem(logoutEventKey);\n\n if (storedAddress && address !== storedAddress) {\n return;\n }\n\n localStorage.setItem(logoutEventKey, address);\n localStorage.removeItem(logoutEventKey);\n};\n\nexport async function logout({\n provider,\n options = {\n shouldBroadcastLogoutAcrossTabs: true,\n hasConsentPopup: false\n }\n}: IProviderLogout): Promise<boolean> {\n let address = getAddress();\n\n if (options.shouldBroadcastLogoutAcrossTabs && safeWindow.localStorage) {\n broadcastLogoutAcrossTabs(address, safeWindow.localStorage);\n }\n try {\n logoutAction();\n\n if (\n options.hasConsentPopup &&\n provider.getType() === ProviderTypeEnum.crossWindow\n ) {\n (provider as unknown as CrossWindowProvider).setShouldShowConsentPopup(\n true\n );\n }\n\n // Clear all active subscriptions on logout\n subscriptions.forEach((unsubscribe) => unsubscribe());\n subscriptions.clear();\n websocketManager.closeConnectionRef?.();\n const isLoggedOut = await provider.logout();\n return isLoggedOut;\n } catch (err) {\n console.error('Logging out error:', err);\n return false;\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["broadcastLogoutAcrossTabs", "address", "localStorage", "logoutEventKey", "storedAddress", "logout", "provider", "options", "getAddress", "safeWindow", "logoutAction", "subscriptions", "unsubscribe", "websocketManager", "err"]
|
|
5
|
+
"mappings": "iPAyBA,IAAMA,EAA4B,CAACC,EAAiBC,IAA0B,CAC5E,IAAMC,EAAiB,yBAAyBF,CAAO,GACjDG,EAAgBF,EAAa,QAAQC,CAAc,EAErDC,GAAiBH,IAAYG,IAIjCF,EAAa,QAAQC,EAAgBF,CAAO,EAC5CC,EAAa,WAAWC,CAAc,EACxC,EAEA,eAAsBE,EAAO,CAC3B,SAAAC,EACA,QAAAC,EAAU,CACR,gCAAiC,GACjC,gBAAiB,EACnB,CACF,EAAsC,CACpC,IAAIN,EAAUO,EAAW,EAErBD,EAAQ,iCAAmCE,EAAW,cACxDT,EAA0BC,EAASQ,EAAW,YAAY,EAE5D,GAAI,CACF,OAAAC,EAAa,EAGXH,EAAQ,iBACRD,EAAS,QAAQ,IAAMK,EAAiB,aAEvCL,EAA4C,0BAC3C,EACF,EAIFM,EAAc,QAASC,GAAgBA,EAAY,CAAC,EACpDD,EAAc,MAAM,EACpBE,EAAiB,qBAAqB,EAClB,MAAMR,EAAS,OAAO,CAE5C,OAASS,EAAK,CACZ,eAAQ,MAAM,qBAAsBA,CAAG,EAChC,EACT,CACF",
|
|
6
|
+
"names": ["broadcastLogoutAcrossTabs", "address", "localStorage", "logoutEventKey", "storedAddress", "logout", "provider", "options", "getAddress", "safeWindow", "logoutAction", "ProviderTypeEnum", "subscriptions", "unsubscribe", "websocketManager", "err"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{s as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as w}from"./chunk-YK7T6MBD.mjs";import{a as l}from"./chunk-KMJMQEXI.mjs";import{s as u}from"./chunk-4YETXBJD.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-3JNON2SM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s}from"./chunk-6UIF2KFV.mjs";import{a as d}from"./chunk-OA5BWGGO.mjs";import{a as i}from"./chunk-WE7YOBO7.mjs";var a=({loginToken:t,version:r})=>{if(!t||!r)return null;let{ledgerWithUsernames:u}=s(r),e=i(t);if(e==null)return null;let n="Confirm Ledger Address",o="Authorise Authentication Token";if(u){let m=d(e.ttl);return{data:`${e.origin} for ${m}.`,confirmAddressText:n,authText:o}}return{data:t,confirmAddressText:n,authText:o}};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-3OKWBJFM.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-6L56KRO6.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-3Z3DQFG6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-3S57OP4Z.mjs";import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-3S57OP4Z.mjs";import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as f}from"./chunk-RIQNG4I7.mjs";import{NativeAuthClient as y}from"@multiversx/sdk-native-auth-client";var H=h=>{let{origin:o,apiAddress:i,expirySeconds:r,blockHashShard:s,extraInfo:u,gatewayUrl:d,extraRequestHeaders:k}=f(h),n=new y({origin:o,apiUrl:i,expirySeconds:r,blockHashShard:s,gatewayUrl:d,extraRequestHeaders:k});return{initialize:async t=>{if(!i||!o)return"";let a=()=>n.getCurrentBlockHash(),e=t?.latestBlockInfo;e||(e=await g({apiAddress:i,blockHashShard:s,getBlockHash:a,noCache:t?.noCache}));let{hash:p,timestamp:c}=e,m=n.encodeValue(JSON.stringify({...t?.extraInfo??u,...c?{timestamp:c}:{}}));return`${n.encodeValue(o)}.${p}.${r}.${m}`},getToken:({address:t,token:a,signature:e})=>n.getToken(t,a,e),getTokenExpiration:l}};export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-45WVS4H5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as I}from"./chunk-LNABNVAO.mjs";import{a as g}from"./chunk-QYYNCJPD.mjs";import{a as f}from"./chunk-ISPRIGOE.mjs";import{a as u}from"./chunk-VDDXFGB2.mjs";import{a as p}from"./chunk-WZ2DNB3R.mjs";import{a as T}from"./chunk-BRJNX4JF.mjs";import{a as c}from"./chunk-DBIIY2TX.mjs";var E=({transaction:t,address:e,explorerAddress:v,egldLabel:o,isPending:a=!1})=>{let{receiver:r,receiverAssets:n}=p(t),s=e===r,S=I({transaction:t,currentUserAddress:e,egldLabel:o,isPending:a}),i=g({userIsReceiver:r===e,transaction:t,egldLabel:o}),m=t.originalTxHash??t.txHash;return{asset:f({...t,transactionAssets:i,showDefaultState:a,status:t.status}),interactor:s?t.sender:r,interactorAsset:s?t.senderAssets?.iconSvg??t.senderAssets?.iconPng:n?.iconSvg??n?.iconPng,directionLabel:s?"From":"To",action:S,amount:u({transactionAssets:i,isIncomingTransaction:s}),hash:m,status:t.status,timestamp:t.timestamp,link:T({explorerAddress:v,to:c.transactionDetails(m)})}};export{E as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4AOTLDWS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as c}from"./chunk-L7L56ZTG.mjs";import{a as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as c}from"./chunk-L7L56ZTG.mjs";import{a as p}from"./chunk-J4MZNYDR.mjs";import{b as m}from"./chunk-XW2GCCBZ.mjs";import{a as k}from"./chunk-B72JAXSF.mjs";import{a as g}from"./chunk-6GREKTLP.mjs";import{a as f}from"./chunk-ZJ2WPN2K.mjs";import{a as d}from"./chunk-HS34AFHY.mjs";import{a as T}from"./chunk-V4YC4AKQ.mjs";import{a}from"./chunk-B3IKUIRK.mjs";import{a as r}from"./chunk-BRJNX4JF.mjs";import{a as t}from"./chunk-DBIIY2TX.mjs";import{a as s}from"./chunk-BSWV5MEC.mjs";function z({transaction:e,address:h,explorerAddress:o}){let y=e.tokenIdentifier??m(e.data).tokenId,n=d(e),u=f(e),l={timeAgo:c(e.timestamp*1e3,!0),tooltip:a({value:e.timestamp,noSeconds:!1,utc:!0})},v=k({address:h,transaction:e,receiver:n}),I={actionDescription:e.action?.description,name:T(e)},S=g(e),D=r({explorerAddress:o,to:t.accountDetails(e.sender)}),L=r({explorerAddress:o,to:t.accountDetails(n)}),A=r({explorerAddress:o,to:t.senderShard(e.senderShard)}),H=r({explorerAddress:o,to:t.receiverShard(e.receiverShard)}),i=e.originalTxHash||e.txHash,x=r({explorerAddress:o,to:t.transactionDetails(i)});return{...e,txHash:i,tokenIdentifier:y,receiver:n,receiverAssets:u,transactionDetails:{age:l,direction:v,method:I,iconInfo:p(e),transactionTokens:S,isContract:s(e.sender)},links:{senderLink:D,receiverLink:L,senderShardLink:A,receiverShardLink:H,transactionLink:x}}}export{z as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4I2FE6NE.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{f as a}from"./chunk-VNLGNNIL.mjs";import{b as s,f as l}from"./chunk-LTF535HP.mjs";import{a as d,b as L}from"./chunk-NLRDRI7Q.mjs";import{a as k}from"./chunk-DTI4TQ2I.mjs";import{a as v}from"./chunk-KRWR77QE.mjs";import{a as T}from"./chunk-SUN3MVLZ.mjs";import{b as y}from"./chunk-A7FTKX2A.mjs";import{a as g,b as c}from"./chunk-TYYA6E7F.mjs";import{a as x}from"./chunk-2DNGCNYM.mjs";import{a as f,b as m}from"./chunk-X4XULIVT.mjs";import{a as I}from"./chunk-NB7A4C7L.mjs";import{a as S,b as u}from"./chunk-VKEESSBI.mjs";import{c as p}from"./chunk-R53MCZI6.mjs";import{createJSONStorage as h,devtools as O,persist as V}from"zustand/middleware";import{immer as H}from"zustand/middleware/immer";import{createStore as N}from"zustand/vanilla";var A=e=>{e.account=g,e.loginInfo=f,e.transactions=d,e.toasts=S};function R(){return new Date().setHours(new Date().getHours()+24)}function w(e){if(e==null){E();return}b(e)}var C=e=>{let t=l(e),n=a(e),{address:i,publicKey:M}=s(e);if(i&&M!==new p(i).hex()&&A(e),!t)return;if(n==null){w(R());return}let P=Date.now();n-P<0&&(w(null),o().setState(A))};var W=(e,t)=>{C(e)};var z=e=>{let t=N(O(V(H((...n)=>({network:x(...n),account:c(...n),loginInfo:m(...n),config:T(...n),transactions:L(...n),toasts:u(...n),cache:y(...n),ui:I(...n)})),{name:"sdk-dapp-store",storage:h(e)})));return t.subscribe(W),t},r,D=e=>{r=e},o=()=>(r||D(z(()=>new v)),r),ae=(e=k)=>D(z(e)),pe=()=>o().getState();var fe=e=>o().setState(({loginInfo:t})=>{t.providerType=e},!1,"setProviderType"),me=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.walletLogin=e},!1,"setWalletLogin"),Le=e=>o().setState(({loginInfo:t})=>{t.walletConnectLogin=e},!1,"setWalletConnectLogin"),xe=e=>o().setState(({loginInfo:t})=>{t.ledgerLogin=e},!1,"setLedgerLogin"),Te=e=>o().setState(({loginInfo:t})=>{t.logoutRoute=e},!1,"setLogoutRoute"),ye=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{fe as a,me as b,Se as c,ue as d,de as e,Le as f,xe as g,Te as h,ye as i,E as j,b as k,A as l,R as m,w as n,C as o,W as p,z as q,D as r,o as s,ae as t,pe as u};
|
|
2
|
+
//# sourceMappingURL=chunk-4YETXBJD.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/store.ts", "../../src/store/middleware/logoutMiddleware.ts", "../../src/store/middleware/applyMiddlewares.ts", "../../src/store/actions/loginInfo/loginInfoActions.ts"],
|
|
4
|
-
"sourcesContent": ["import { createJSONStorage, devtools, persist } from 'zustand/middleware';\nimport { immer } from 'zustand/middleware/immer';\nimport { createStore } from 'zustand/vanilla';\nimport { applyMiddlewares } from './middleware';\nimport {\n networkSlice,\n accountSlice,\n loginInfoSlice,\n configSlice,\n toastSlice,\n cacheSlice,\n uiSlice\n} from './slices';\nimport { transactionsSlice } from './slices/transactions';\nimport {\n InMemoryStorage,\n defaultStorageCallback,\n StorageCallback\n} from './storage';\nimport { StoreType } from './store.types';\n\nexport type MutatorsIn = [\n ['zustand/devtools', never],\n ['zustand/persist', unknown],\n ['zustand/immer', never]\n];\n\nexport type MutatorsOut = [\n ['zustand/devtools', never],\n ['zustand/persist', StoreType],\n ['zustand/immer', never]\n];\n\nexport const createDAppStore = (getStorageCallback: StorageCallback) => {\n const store = createStore<StoreType, MutatorsOut>(\n devtools(\n persist(\n immer((...args) => ({\n network: networkSlice(...args),\n account: accountSlice(...args),\n loginInfo: loginInfoSlice(...args),\n config: configSlice(...args),\n transactions: transactionsSlice(...args),\n toasts: toastSlice(...args),\n cache: cacheSlice(...args),\n ui: uiSlice(...args)\n })),\n {\n name: 'sdk-dapp-store',\n storage: createJSONStorage(getStorageCallback)\n }\n )\n )\n );\n store.subscribe(applyMiddlewares);\n return store;\n};\n\nexport type StoreApi = ReturnType<typeof createDAppStore>;\n\nlet store: StoreApi;\n\nexport const setDAppStore = (_store: StoreApi) => {\n store = _store;\n};\n\nexport const getStore = () => {\n if (!store) {\n setDAppStore(createDAppStore(() => new InMemoryStorage()));\n }\n return store;\n};\n\n/**\n * Initialize store with the preferred storage by passing a callback.\n * Default storage is localStorage.\n * You can pass your own storage.\n * Call this function before using store, ideally before app bootstrapping.\n * @param getStorageCallback\n * @default () => localStorage\n * @returns persistent store instance\n * @example\n * initStore(() => window.localStorage);\n * initStore(() => window.sessionStorage);\n * initStore(() => new InMemoryStorage());\n * */\nexport const initStore = (getStorageCallback = defaultStorageCallback) => {\n return setDAppStore(createDAppStore(getStorageCallback));\n};\n\nexport const getState = () => getStore().getState();\n", "import { WritableDraft } from 'immer';\nimport { Address } from 'lib/sdkCore';\nimport {\n addLoginExpiresAt,\n removeLoginExpiresAt\n} from 'store/actions/loginInfo/loginInfoActions';\nimport {\n accountInfoSelector,\n isLoggedInSelector,\n loginExpiresAtSelector\n} from 'store/selectors';\nimport { initialState as initialAccountState } from 'store/slices/account/accountSlice';\nimport { initialState as initialLoginInfoState } from 'store/slices/loginInfo/loginInfoSlice';\nimport { initialState as initialToastState } from 'store/slices/toast/toastSlice';\nimport { initialState as initialTransactionsState } from 'store/slices/transactions/transactionsSlice';\nimport { getStore } from 'store/store';\nimport { StoreType } from '../store.types';\n\nexport const resetStore = (store: WritableDraft<StoreType>) => {\n store.account = initialAccountState;\n store.loginInfo = initialLoginInfoState;\n store.transactions = initialTransactionsState;\n store.toasts = initialToastState;\n};\n\nexport function getNewLoginExpiresTimestamp() {\n return new Date().setHours(new Date().getHours() + 24);\n}\n\nexport function setLoginExpiresAt(expiresAt: number | null) {\n if (expiresAt == null) {\n removeLoginExpiresAt();\n return;\n }\n addLoginExpiresAt(expiresAt);\n}\n\nexport const logoutMiddleware = (state: StoreType) => {\n const isLoggedIn = isLoggedInSelector(state);\n const loginTimestamp = loginExpiresAtSelector(state);\n const { address, publicKey } = accountInfoSelector(state);\n\n if (address && publicKey !== new Address(address).hex()) {\n resetStore(state);\n }\n\n if (!isLoggedIn) {\n return;\n }\n\n if (loginTimestamp == null) {\n setLoginExpiresAt(getNewLoginExpiresTimestamp());\n return;\n }\n\n const now = Date.now();\n const isExpired = loginTimestamp - now < 0;\n\n if (isExpired) {\n // logout\n setLoginExpiresAt(null);\n getStore().setState(resetStore);\n }\n};\n", "import { StoreType } from '../store.types';\nimport { logoutMiddleware } from './logoutMiddleware';\n\nexport const applyMiddlewares = (state: StoreType, _prevState: StoreType) => {\n logoutMiddleware(state);\n};\n", "import {
|
|
5
|
-
"mappings": "wjBAAA,OAAS,qBAAAA,EAAmB,YAAAC,EAAU,WAAAC,MAAe,qBACrD,OAAS,SAAAC,MAAa,2BACtB,OAAS,eAAAC,MAAmB,kBCgBrB,IAAMC,EAAcC,GAAoC,CAC7DA,EAAM,QAAUC,EAChBD,EAAM,UAAYC,EAClBD,EAAM,aAAeC,EACrBD,EAAM,OAASC,CACjB,EAEO,SAASC,GAA8B,CAC5C,OAAO,IAAI,KAAK,EAAE,SAAS,IAAI,KAAK,EAAE,SAAS,EAAI,EAAE,CACvD,CAEO,SAASC,EAAkBC,EAA0B,CAC1D,GAAIA,GAAa,KAAM,CACrBC,EAAqB,EACrB,MACF,CACAC,EAAkBF,CAAS,CAC7B,CAEO,IAAMG,EAAoBC,GAAqB,CACpD,IAAMC,EAAaC,EAAmBF,CAAK,EACrCG,EAAiBC,EAAuBJ,CAAK,EAC7C,CAAE,QAAAK,EAAS,UAAAC,CAAU,EAAIC,EAAoBP,CAAK,EAMxD,GAJIK,GAAWC,IAAc,IAAIE,EAAQH,CAAO,EAAE,IAAI,GACpDd,EAAWS,CAAK,EAGd,CAACC,EACH,OAGF,GAAIE,GAAkB,KAAM,CAC1BR,EAAkBD,EAA4B,CAAC,EAC/C,MACF,CAEA,IAAMe,EAAM,KAAK,IAAI,EACHN,EAAiBM,EAAM,IAIvCd,EAAkB,IAAI,EACtBe,EAAS,EAAE,SAASnB,CAAU,EAElC,EC5DO,IAAMoB,EAAmB,CAACC,EAAkBC,IAA0B,CAC3EC,EAAiBF,CAAK,CACxB,EF4BO,IAAMG,EAAmBC,GAAwC,CACtE,IAAMC,EAAQC,EACZC,EACEC,EACEC,EAAM,IAAIC,KAAU,CAClB,QAASC,EAAa,GAAGD,CAAI,EAC7B,QAASE,EAAa,GAAGF,CAAI,EAC7B,UAAWG,EAAe,GAAGH,CAAI,EACjC,OAAQI,EAAY,GAAGJ,CAAI,EAC3B,aAAcK,EAAkB,GAAGL,CAAI,EACvC,OAAQM,EAAW,GAAGN,CAAI,EAC1B,MAAOO,EAAW,GAAGP,CAAI,EACzB,GAAIQ,EAAQ,GAAGR,CAAI,CACrB,EAAE,EACF,CACE,KAAM,iBACN,QAASS,EAAkBf,CAAkB,CAC/C,CACF,CACF,CACF,EACA,OAAAC,EAAM,UAAUe,CAAgB,EACzBf,CACT,EAIIA,EAESgB,EAAgBC,GAAqB,CAChDjB,EAAQiB,CACV,EAEaC,EAAW,KACjBlB,GACHgB,EAAalB,EAAgB,IAAM,IAAIqB,CAAiB,CAAC,EAEpDnB,GAgBIoB,GAAY,CAACrB,EAAqBsB,IACtCL,EAAalB,EAAgBC,CAAkB,CAAC,EAG5CuB,GAAW,IAAMJ,EAAS,EAAE,SAAS,
|
|
4
|
+
"sourcesContent": ["import { createJSONStorage, devtools, persist } from 'zustand/middleware';\nimport { immer } from 'zustand/middleware/immer';\nimport { createStore } from 'zustand/vanilla';\nimport { applyMiddlewares } from './middleware';\nimport {\n networkSlice,\n accountSlice,\n loginInfoSlice,\n configSlice,\n toastSlice,\n cacheSlice,\n uiSlice\n} from './slices';\nimport { transactionsSlice } from './slices/transactions';\nimport {\n InMemoryStorage,\n defaultStorageCallback,\n StorageCallback\n} from './storage';\nimport { StoreType } from './store.types';\n\nexport type MutatorsIn = [\n ['zustand/devtools', never],\n ['zustand/persist', unknown],\n ['zustand/immer', never]\n];\n\nexport type MutatorsOut = [\n ['zustand/devtools', never],\n ['zustand/persist', StoreType],\n ['zustand/immer', never]\n];\n\nexport const createDAppStore = (getStorageCallback: StorageCallback) => {\n const store = createStore<StoreType, MutatorsOut>(\n devtools(\n persist(\n immer((...args) => ({\n network: networkSlice(...args),\n account: accountSlice(...args),\n loginInfo: loginInfoSlice(...args),\n config: configSlice(...args),\n transactions: transactionsSlice(...args),\n toasts: toastSlice(...args),\n cache: cacheSlice(...args),\n ui: uiSlice(...args)\n })),\n {\n name: 'sdk-dapp-store',\n storage: createJSONStorage(getStorageCallback)\n }\n )\n )\n );\n store.subscribe(applyMiddlewares);\n return store;\n};\n\nexport type StoreApi = ReturnType<typeof createDAppStore>;\n\nlet store: StoreApi;\n\nexport const setDAppStore = (_store: StoreApi) => {\n store = _store;\n};\n\nexport const getStore = () => {\n if (!store) {\n setDAppStore(createDAppStore(() => new InMemoryStorage()));\n }\n return store;\n};\n\n/**\n * Initialize store with the preferred storage by passing a callback.\n * Default storage is localStorage.\n * You can pass your own storage.\n * Call this function before using store, ideally before app bootstrapping.\n * @param getStorageCallback\n * @default () => localStorage\n * @returns persistent store instance\n * @example\n * initStore(() => window.localStorage);\n * initStore(() => window.sessionStorage);\n * initStore(() => new InMemoryStorage());\n * */\nexport const initStore = (getStorageCallback = defaultStorageCallback) => {\n return setDAppStore(createDAppStore(getStorageCallback));\n};\n\nexport const getState = () => getStore().getState();\n", "import { WritableDraft } from 'immer';\nimport { Address } from 'lib/sdkCore';\nimport {\n addLoginExpiresAt,\n removeLoginExpiresAt\n} from 'store/actions/loginInfo/loginInfoActions';\nimport {\n accountInfoSelector,\n isLoggedInSelector,\n loginExpiresAtSelector\n} from 'store/selectors';\nimport { initialState as initialAccountState } from 'store/slices/account/accountSlice';\nimport { initialState as initialLoginInfoState } from 'store/slices/loginInfo/loginInfoSlice';\nimport { initialState as initialToastState } from 'store/slices/toast/toastSlice';\nimport { initialState as initialTransactionsState } from 'store/slices/transactions/transactionsSlice';\nimport { getStore } from 'store/store';\nimport { StoreType } from '../store.types';\n\nexport const resetStore = (store: WritableDraft<StoreType>) => {\n store.account = initialAccountState;\n store.loginInfo = initialLoginInfoState;\n store.transactions = initialTransactionsState;\n store.toasts = initialToastState;\n};\n\nexport function getNewLoginExpiresTimestamp() {\n return new Date().setHours(new Date().getHours() + 24);\n}\n\nexport function setLoginExpiresAt(expiresAt: number | null) {\n if (expiresAt == null) {\n removeLoginExpiresAt();\n return;\n }\n addLoginExpiresAt(expiresAt);\n}\n\nexport const logoutMiddleware = (state: StoreType) => {\n const isLoggedIn = isLoggedInSelector(state);\n const loginTimestamp = loginExpiresAtSelector(state);\n const { address, publicKey } = accountInfoSelector(state);\n\n if (address && publicKey !== new Address(address).hex()) {\n resetStore(state);\n }\n\n if (!isLoggedIn) {\n return;\n }\n\n if (loginTimestamp == null) {\n setLoginExpiresAt(getNewLoginExpiresTimestamp());\n return;\n }\n\n const now = Date.now();\n const isExpired = loginTimestamp - now < 0;\n\n if (isExpired) {\n // logout\n setLoginExpiresAt(null);\n getStore().setState(resetStore);\n }\n};\n", "import { StoreType } from '../store.types';\nimport { logoutMiddleware } from './logoutMiddleware';\n\nexport const applyMiddlewares = (state: StoreType, _prevState: StoreType) => {\n logoutMiddleware(state);\n};\n", "import {\n ProviderTypeEnum,\n ProviderType\n} from 'providers/types/providerFactory.types';\nimport {\n LedgerLoginType,\n LoginInfoType,\n WalletConnectLoginType\n} from 'store/slices/loginInfo/loginInfo.types';\nimport { getStore } from 'store/store';\nimport { TokenLoginType } from 'types/login.types';\n\nexport const setProviderType = <T extends ProviderType = ProviderType>(\n providerType: T\n) =>\n getStore().setState(\n ({ loginInfo: state }) => {\n state.providerType = providerType;\n },\n false,\n 'setProviderType'\n );\n\nexport const setTokenLogin = (tokenLogin: TokenLoginType) =>\n getStore().setState(\n ({ loginInfo: state }) => {\n state.tokenLogin = tokenLogin;\n },\n false,\n 'setTokenLogin'\n );\n\nexport const setLoginToken = (loginToken: string) =>\n getStore().setState(\n ({ loginInfo: state }) => {\n if (state.tokenLogin != null) {\n state.tokenLogin.loginToken = loginToken;\n return;\n }\n state.tokenLogin = {\n loginToken\n };\n },\n false,\n 'setLoginToken'\n );\n\nexport const setTokenLoginSignature = (signature: string) =>\n getStore().setState(\n ({ loginInfo: state }) => {\n if (state?.tokenLogin != null) {\n state.tokenLogin.signature = signature;\n }\n },\n false,\n 'setTokenLoginSignature'\n );\n\nexport const setWalletLogin = (walletLogin: LoginInfoType | null) =>\n getStore().setState(\n ({ loginInfo: state }) => {\n state.walletLogin = walletLogin;\n },\n false,\n 'setWalletLogin'\n );\n\nexport const setWalletConnectLogin = (\n walletConnectLogin: WalletConnectLoginType | null\n) =>\n getStore().setState(\n ({ loginInfo: state }) => {\n state.walletConnectLogin = walletConnectLogin;\n },\n false,\n 'setWalletConnectLogin'\n );\n\nexport const setLedgerLogin = (ledgerLogin: LedgerLoginType | null) =>\n getStore().setState(\n ({ loginInfo: state }) => {\n state.ledgerLogin = ledgerLogin;\n },\n false,\n 'setLedgerLogin'\n );\n\nexport const setLogoutRoute = (logoutRoute: string | undefined) =>\n getStore().setState(\n ({ loginInfo: state }) => {\n state.logoutRoute = logoutRoute;\n },\n false,\n 'setLogoutRoute'\n );\n\nexport const setIsWalletConnectV2Initialized = (isInitialized: boolean) =>\n getStore().setState(\n ({ loginInfo: state }) => {\n state.isWalletConnectV2Initialized = isInitialized;\n },\n false,\n 'setIsWalletConnectV2Initialized'\n );\n\nexport const removeLoginExpiresAt = () =>\n getStore().setState(\n ({ loginInfo: state }) => {\n state.loginExpiresAt = null;\n },\n false,\n 'removeLoginExpiresAt'\n );\n\nexport const addLoginExpiresAt = (expiresAt: number) =>\n getStore().setState(\n ({ loginInfo: state }) => {\n state.loginExpiresAt = expiresAt;\n },\n false,\n 'addLoginExpiresAt'\n );\n"],
|
|
5
|
+
"mappings": "wjBAAA,OAAS,qBAAAA,EAAmB,YAAAC,EAAU,WAAAC,MAAe,qBACrD,OAAS,SAAAC,MAAa,2BACtB,OAAS,eAAAC,MAAmB,kBCgBrB,IAAMC,EAAcC,GAAoC,CAC7DA,EAAM,QAAUC,EAChBD,EAAM,UAAYC,EAClBD,EAAM,aAAeC,EACrBD,EAAM,OAASC,CACjB,EAEO,SAASC,GAA8B,CAC5C,OAAO,IAAI,KAAK,EAAE,SAAS,IAAI,KAAK,EAAE,SAAS,EAAI,EAAE,CACvD,CAEO,SAASC,EAAkBC,EAA0B,CAC1D,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,IAClClB,EAAS,EAAE,SACT,CAAC,CAAE,UAAWC,CAAM,IAAM,CACxBA,EAAM,eAAiB,IACzB,EACA,GACA,sBACF,EAEWkB,EAAqBC,GAChCpB,EAAS,EAAE,SACT,CAAC,CAAE,UAAWC,CAAM,IAAM,CACxBA,EAAM,eAAiBmB,CACzB,EACA,GACA,mBACF",
|
|
6
6
|
"names": ["createJSONStorage", "devtools", "persist", "immer", "createStore", "resetStore", "store", "initialState", "getNewLoginExpiresTimestamp", "setLoginExpiresAt", "expiresAt", "removeLoginExpiresAt", "addLoginExpiresAt", "logoutMiddleware", "state", "isLoggedIn", "isLoggedInSelector", "loginTimestamp", "loginExpiresAtSelector", "address", "publicKey", "accountInfoSelector", "Address", "now", "getStore", "applyMiddlewares", "state", "_prevState", "logoutMiddleware", "createDAppStore", "getStorageCallback", "store", "createStore", "devtools", "persist", "immer", "args", "networkSlice", "accountSlice", "loginInfoSlice", "configSlice", "transactionsSlice", "toastSlice", "cacheSlice", "uiSlice", "createJSONStorage", "applyMiddlewares", "setDAppStore", "_store", "getStore", "InMemoryStorage", "initStore", "defaultStorageCallback", "getState", "setProviderType", "providerType", "getStore", "state", "setTokenLogin", "tokenLogin", "setLoginToken", "loginToken", "setTokenLoginSignature", "signature", "setWalletLogin", "walletLogin", "setWalletConnectLogin", "walletConnectLogin", "setLedgerLogin", "ledgerLogin", "setLogoutRoute", "logoutRoute", "setIsWalletConnectV2Initialized", "isInitialized", "removeLoginExpiresAt", "addLoginExpiresAt", "expiresAt"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as O}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as O}from"./chunk-VK47SZJ2.mjs";import{a as V}from"./chunk-7Z7IX367.mjs";import{a as B}from"./chunk-VCQBYNNS.mjs";import{a as $}from"./chunk-73EXR25L.mjs";import{a as _}from"./chunk-PDT22D2C.mjs";import{a as U}from"./chunk-RBZC4PEU.mjs";import{a as R}from"./chunk-ROZAXUMC.mjs";import{a as M}from"./chunk-FMUDQBZE.mjs";import{a as w}from"./chunk-CTMAC553.mjs";import{a as x}from"./chunk-YGI3KXMZ.mjs";import{a as v}from"./chunk-K7WAPWQA.mjs";import{a as G}from"./chunk-RYIJWGFA.mjs";import{p as h}from"./chunk-2G6DWPQU.mjs";import{a as L}from"./chunk-BRJNX4JF.mjs";import{a as b,c as C,f as u}from"./chunk-K3G3SPRT.mjs";import{a as P}from"./chunk-KD2IQ32V.mjs";import{c as f}from"./chunk-TI37DKBT.mjs";import{k as A}from"./chunk-LHEH7L4L.mjs";import{a as F}from"./chunk-7QCBLUWB.mjs";import{BigNumber as yt}from"bignumber.js";async function Kt({allTransactions:T,currentScreenIndex:m,egldLabel:o,network:e,gasPriceData:c,price:S,address:p,username:z,shard:j,signedIndexes:i,parsedTransactionsByDataField:q}){let t=T[m],H=t?.transaction?.sender.toString(),K=t?.transaction,D=null,y=null,W=R({egldLabel:o,sender:H,apiAddress:e.apiAddress,address:p,parsedTransactionsByDataField:q}),a=t.transaction.toPlainObject(),n=await W(t),d=!n?.transactionTokenInfo?.tokenId,{tokenId:g,nonce:l,amount:I=""}=n?.transactionTokenInfo??{},Z=g&&l&&l.length>0?`${g}-${l}`:g,J=await v({tokenId:Z}),{esdtPrice:Q,tokenDecimals:X,type:r,identifier:s,tokenImageUrl:Y}=J;if(r==="SemiFungibleESDT"||r==="NonFungibleESDT")y={type:r,identifier:s,amount:I,imageURL:Y};else{let E=({addCommas:Dt})=>u({input:d?t.transaction.value.toString():I,decimals:d?Number(e.decimals):X,digits:Number(e.digits),showLastNonZeroDecimal:!1,addCommas:Dt}),ut=E({addCommas:!0}),ft=E({addCommas:!1}),Tt=Number(d?S:Q),St=x({amount:ft,usd:Tt,addEqualSign:!0});D={identifier:(s===A?o:s)??o,amount:ut,usdValue:St}}let{feeLimitFormatted:tt,feeInFiatLimit:nt}=w({transaction:K,price:S}),ot=$({shard:j,initialGasPrice:c.initialGasPrice,transaction:a,gasStationMetadata:e.gasStationMetadata}),et=_({transaction:a,gasPriceData:c}),it=h().getType(),at=G(it),N=T.length,rt=i.length>0?i[i.length-1]+1:0,st=f(t.transaction.data.toString()??""),k=U(n?.transactionTokenInfo),mt=M({data:st,identifier:s,highlight:k}),ct=O(),pt=L({to:`/${P}/${p}`,explorerAddress:ct}),dt=N===1||n?.needsSigning&&!i.includes(m),gt=u({input:et.toString(),decimals:C,addCommas:!0,digits:b}),lt=new yt(a.gasLimit).toFormat({decimalSeparator:",",groupSeparator:".",groupSize:3});return{commonData:{receiver:a.receiver.toString(),data:f(t.transaction.data.toString()??""),decodedData:mt,gasPrice:gt,gasLimit:lt,explorerLink:pt,ppu:c.ppu,ppuOptions:ot,egldLabel:o,tokenType:V(r),feeLimit:tt,feeInFiatLimit:nt,transactionsCount:N,currentIndex:m,currentIndexToSign:rt,highlight:k,scCall:B(n?.transactionTokenInfo),needsSigning:dt,isEditable:n?.needsSigning,providerName:at,address:p,username:z,origin:F.location.origin},tokenTransaction:D,fungibleTransaction:y}}export{Kt as a};
|
|
2
|
+
//# sourceMappingURL=chunk-53BZNNVL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as N}from"./chunk-Q2Q4XN4M.mjs";import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as N}from"./chunk-Q2Q4XN4M.mjs";import{d as C,e as I}from"./chunk-VQIWENYE.mjs";import{b}from"./chunk-35YS2DV5.mjs";import{s as p}from"./chunk-4YETXBJD.mjs";import{b as E}from"./chunk-SAAOQW7P.mjs";import{a as y}from"./chunk-MGQ373AO.mjs";import{b as t}from"./chunk-GGBMHKR4.mjs";import{io as L}from"socket.io-client";var U=3e3,d=3,k=500,W=1e3,M=1e3,S="batchUpdated",w="connect",O="connect_error",A="disconnect";async function K(l){let{apiAddress:_,websocketUrl:g}=E(p().getState());if(!l)throw new Error("Websocket could not be initialized: address missing");let o=null,n=null,c=e=>{t.status=e,b(e)},R=e=>{o&&clearTimeout(o),o=setTimeout(()=>{C(e)},W)},h=e=>{n&&clearTimeout(n),n=setTimeout(()=>{I(e)},W)},D=()=>{let e=t.instance;e&&(e.off(O),e.off(w),e.off(S),e.off(A),e.close(),console.log("Websocket disconnected.")),c("not_initialized"),t.instance=null,o&&clearTimeout(o),n&&clearTimeout(n)},m=y(async()=>{let e=async(i=d,a=k)=>{let f=0,r=null,s=null,T=async()=>{if(f>=i){console.warn("WebSocket reconnection failed after max attempts."),c("not_initialized");return}f++,t.instance?.off(),t.instance?.close(),t.instance=null;try{await m(),r=setTimeout(()=>{t.instance?.connected||(s=setTimeout(T,a))},M)}catch{s=setTimeout(T,a)}};return T(),()=>{r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null)}};c("pending");let u=g??await N(_);if(!u){c("not_initialized");return}t.instance=L(u,{forceNew:!0,reconnection:!0,reconnectionAttempts:d,timeout:U,query:{address:l}}),t.instance.onAny(R),t.instance.on(S,h),t.instance.on(w,()=>{console.log("Websocket connected."),c("completed")}),t.instance.on(O,async i=>{console.warn("Websocket connect error: ",i.message),(await e())()}),t.instance.on(A,async()=>{console.warn("Websocket disconnected. Trying to reconnect..."),(await e())()})},{retries:2,delay:k});return t.status==="not_initialized"&&!t.instance?.active&&await m(),{closeConnection:D}}export{K as a};
|
|
2
|
+
//# sourceMappingURL=chunk-55RBZAD6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-X6MN67NW.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";import{u as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-X6MN67NW.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";import{u as m}from"./chunk-4YETXBJD.mjs";import{b as a}from"./chunk-SAAOQW7P.mjs";import{o as r,u as i}from"./chunk-KD2IQ32V.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-5L474T4X.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as x}from"./chunk-IYS5W63R.mjs";import{a as k}from"./chunk-AC2L3PV3.mjs";import{a as B}from"./chunk-V7ZVI2WS.mjs";import{a as b}from"./chunk-M6IVW6AN.mjs";import{a as O}from"./chunk-QXC4D3AC.mjs";import{a as R}from"./chunk-ZMEIT65B.mjs";import{a as D}from"./chunk-53BZNNVL.mjs";import{a as I}from"./chunk-PDT22D2C.mjs";import{a as j}from"./chunk-CTMAC553.mjs";import{a as _}from"./chunk-KY7KOSJJ.mjs";import{u as A}from"./chunk-4YETXBJD.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-K3G3SPRT.mjs";import{a as w}from"./chunk-R53MCZI6.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard:C,username:E}}=k(),g=v(A()),h=B(),{allTransactions:e,parsedTransactionsByDataField:L}=R(z),p=[],n=x.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(e.map(t=>t.transaction));let l=Y?.price,a=0,T=async()=>{let r=e[a]?.transaction,i=Number(r.nonce);n.updateIsLoading(!0);let{commonData:c,tokenTransaction:o,fungibleTransaction:s}=await D({allTransactions:e,currentScreenIndex:a,egldLabel:h,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:C,signedIndexes:p,parsedTransactionsByDataField:L});n.updateIsLoading(!1),o&&n.updateTokenTransaction(o),s&&n.updateNonFungibleTransaction(s.type,s),n.updateCommonData(c)},q=()=>{a>0&&(a--,T())},J=(t=0)=>{let i=e[a].transaction,c=Number(i.nonce);n.updateGasPriceMap({nonce:c,ppu:t}),n.updateCommonData({ppu:t});let o=i.toPlainObject(),s=I({transaction:o,gasPriceData:n.ppuMap[c]}),P=w.newFromPlainObject({...o,gasPrice:s}),u=j({transaction:P,price:l}),m=F({input:s.toString(),decimals:U,addCommas:!0,digits:G});n.updateCommonData({feeLimit:u.feeLimitFormatted,feeInFiatLimit:u.feeInFiatLimit,gasPrice:m,ppu:t})},Q=async()=>{M(new Error("Transaction signing cancelled by user")),await b(),n.closeUI()},f=()=>{a<n.transactionsCount-1&&(a++,T())},V=async()=>{let r=e[a].transaction,i=Number(r.nonce),{commonData:c}=await D({allTransactions:e,currentScreenIndex:a,egldLabel:h,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:C,signedIndexes:p,parsedTransactionsByDataField:L});if(!c.needsSigning)return p.push(a),f();let o=r.toPlainObject(),s=o.nonce,P=I({transaction:o,gasPriceData:n.ppuMap[s]}),u=w.newFromPlainObject({...o,gasPrice:P});try{let m=await H([u]);m&&(p.push(a),d.push(m[0]));let nn=a===e.length-1,an=e.filter(S=>S.needsSigning),tn=d.length===an.length;if(nn&&tn){let S=await K(d);return n.closeUI(),X(S)}f()}catch(m){n.closeUI(),M(m)}},Z=new Map([["NEXT_SIGN_TRANSACTIONS",f],["CONFIRM_SIGN_TRANSACTIONS",V],["CLOSE_SIGN_TRANSACTIONS",Q],["BACK_SIGN_TRANSACTIONS",q],["SET_PPU_SIGN_TRANSACTIONS",J]]);function $(){for(let[t,r]of Z)n.subscribeToEventBus(t,r)}$(),await T()})}export{Dn as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6BGPH7MV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as T}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as T}from"./chunk-CUSKOIRI.mjs";import{a as h}from"./chunk-YMUUG42I.mjs";import{a as d}from"./chunk-EVL6UUJJ.mjs";import{a as p}from"./chunk-4AOTLDWS.mjs";var f=a=>a.sort((i,o)=>o.timestamp-i.timestamp),H=async({transactions:a,address:i,explorerAddress:o,egldLabel:g})=>{let e=[],r=[];if(a.forEach(s=>{let t=d(s.hash);t?e.push(t):r.push(s.hash)}),r.length===0)return f(e);let c=await T(r),I=c.map(s=>s.txHash),m=r.filter(s=>!I.includes(s));if(m.length>0){let t=a.filter(n=>m.includes(n.hash)).map(n=>({...n,txHash:n.hash,price:0,status:"pending",gasUsed:0,miniBlockHash:"",receiverShard:0,round:0,senderShard:0,timestamp:Date.now()}));c.push(...t)}return c.forEach(s=>{let t=p({transaction:s,address:i,explorerAddress:o,egldLabel:g});t.status!=="pending"&&h({key:`transaction-${s.txHash}`,value:t}),e.push(t)}),f(e)};export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6L56KRO6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as n}from"./chunk-F3AMNJ5K.mjs";import{o as i}from"./chunk-2G6DWPQU.mjs";import{u as e}from"./chunk-4YETXBJD.mjs";import{d as t}from"./chunk-VNLGNNIL.mjs";async function d(){let r=t(e());if(!r)return;let o=await n.create({type:r});if(!o)throw new Error("Provider not found");i(o)}export{d as a};
|
|
2
|
+
//# sourceMappingURL=chunk-AJJVMOJF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as D}from"./chunk-O6VPG7AF.mjs";import{a as m,b as p,c as s,d as c}from"./chunk-I2YHVWIX.mjs";import{a as f}from"./chunk-2AAKENSP.mjs";import{a as d}from"./chunk-6ZDBHK76.mjs";import{a as A}from"./chunk-YAO67FPP.mjs";import{a as V}from"./chunk-SNKFFCSF.mjs";import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as D}from"./chunk-O6VPG7AF.mjs";import{a as m,b as p,c as s,d as c}from"./chunk-I2YHVWIX.mjs";import{a as k}from"./chunk-IXJOO5U4.mjs";import{a as f}from"./chunk-2AAKENSP.mjs";import{a as d}from"./chunk-6ZDBHK76.mjs";import{a as A}from"./chunk-YAO67FPP.mjs";import{a as V}from"./chunk-SNKFFCSF.mjs";import{a as l}from"./chunk-BXUBAIBU.mjs";import{b as T}from"./chunk-UQU2VWPJ.mjs";import{c as o,f as i}from"./chunk-K3G3SPRT.mjs";import{a as u}from"./chunk-DBIIY2TX.mjs";var H=({transaction:t,hideMultipleBadge:g})=>{if(t.action){if(p.includes(t.action.name))return l(t.value);if(s.includes(t.action.name))return V(t);if(m.includes(t.action.name))return A(t);if(c.includes(t.action.name))return k(t);let a=D(t);if(a.length){let e=a[0],I=Object.values(T).includes(e.type),r=!g&&a.length>1?f(a):"";if(I){let{badgeText:E,tokenFormattedAmount:n,tokenExplorerLink:_,tokenLinkText:y}=d({token:e});return{nftValueData:{badgeText:E,tokenFormattedAmount:n,tokenExplorerLink:_,tokenLinkText:y,transactionTokens:a,token:e,value:n!=null?e.value:null,decimals:n!=null?e.decimals:null,titleText:r}}}let x=e.value?i({input:e.value,decimals:e.decimals??o,digits:2,addCommas:!0}):null;return{tokenValueData:{tokenExplorerLink:u.tokenDetails(String(e.token)),showFormattedAmount:!1,tokenFormattedAmount:x,tokenLinkText:e.ticker,transactionTokens:a,token:e,value:e.value,decimals:e.decimals??o,titleText:r}}}}return l(t.value)};export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BEUXUWCR.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as s,d as i,h as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s,d as i,h as o}from"./chunk-2G6DWPQU.mjs";var r=1e4,u=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=r;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let e=setTimeout(()=>{o(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,e)};this.startWithCustomDuration=(t,e)=>{if(this.stop(t),e<=0)return;let a=setTimeout(()=>{i(t);let n=s[t];n?.()},e);this.timeoutIntervals.set(t,a)};this.stop=t=>{let e=this.timeoutIntervals.get(t);e&&(clearTimeout(e),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t||r}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BVKOA6WH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-CO3V5DOG.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{u as e}from"./chunk-4YETXBJD.mjs";import{b as t}from"./chunk-SAAOQW7P.mjs";import{x as r}from"./chunk-KD2IQ32V.mjs";import i from"axios";var T=async o=>{let{apiAddress:s}=t(e()),{data:a}=await i.get(`${s}/${r}`,{params:{hashes:o.join(","),withScResults:!0}});return a};export{T as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CUSKOIRI.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as I}from"./chunk-5AR7YU5K.mjs";import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as I}from"./chunk-5AR7YU5K.mjs";import{a as l}from"./chunk-V7ZVI2WS.mjs";import{a as f}from"./chunk-VK47SZJ2.mjs";import{j as T,k as m,l as d,n as p}from"./chunk-65L5EBBL.mjs";import{a as u}from"./chunk-6L56KRO6.mjs";var q=async({toastList:S,transactionsSessions:g,account:o,existingCompletedTransactions:y=[]})=>{let n=[],a=[...y],r=f(),F=l();for(let t of S.transactionToasts){let e=g[t.toastId];if(!e?.status)continue;let{status:s,transactions:C,transactionsDisplayInfo:P}=e,x=await u({transactions:C,address:o.address,explorerAddress:r,egldLabel:F}),A=p(s),E=d(s),L=m(s),i=A||E||L,v=T(s),{startTime:R,endTime:b}=t;if(i&&a.some(h=>h.toastId===t.toastId))continue;let c=I({toastId:t.toastId,address:o.address,status:s,transactions:x,transactionsDisplayInfo:P,explorerAddress:r,startTime:R,endTime:b});i&&a.push(c),v&&n.push(c)}return{pendingTransactionToasts:n,completedTransactionToasts:a}};export{q as a};
|
|
2
|
+
//# sourceMappingURL=chunk-EPMXW255.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as A}from"./chunk-YRHMGKLM.mjs";import{a as ce}from"./chunk-IEJARRBP.mjs";import{a as de}from"./chunk-M3YL36ZL.mjs";import{a as oe}from"./chunk-G7XIDD62.mjs";import{a as R}from"./chunk-MHCIV2K5.mjs";import{a as ne}from"./chunk-QFWMIF3L.mjs";import{a as ie}from"./chunk-OOPHCYRC.mjs";import{a as T}from"./chunk-M7R5JSEH.mjs";import{a as te}from"./chunk-YUFPUG5O.mjs";import{a as le}from"./chunk-V7QVBIYB.mjs";import{a as p}from"./chunk-Y574J2OK.mjs";import{a as re}from"./chunk-HR6GP43Q.mjs";import{a as ae}from"./chunk-6BGPH7MV.mjs";import{a as se}from"./chunk-KY7KOSJJ.mjs";import{a as ee}from"./chunk-FFNSZC37.mjs";import{b as $}from"./chunk-4Z3DZ2A3.mjs";import{e as f,f as Z}from"./chunk-FFHVVGYW.mjs";import{i as P,n as b,o as C,p as I}from"./chunk-2G6DWPQU.mjs";import{g as J}from"./chunk-QD3CFFVT.mjs";import{a as Y}from"./chunk-OH6SHSQZ.mjs";import{a as Q}from"./chunk-SKEL25G3.mjs";import{a as U,s as K,u as d}from"./chunk-4YETXBJD.mjs";import{a as G}from"./chunk-VNLGNNIL.mjs";import{b as q,c as F,d as j}from"./chunk-IEJTMYFW.mjs";import{a as B}from"./chunk-LTF535HP.mjs";import{b as L,c as H}from"./chunk-SAAOQW7P.mjs";import{a as z}from"./chunk-VMFJUT3G.mjs";import{a as c}from"./chunk-I7ODJJY3.mjs";import{b as X}from"./chunk-C4CJOZ4L.mjs";import{a as o}from"./chunk-NHXPNROG.mjs";import{a as S}from"./chunk-7QCBLUWB.mjs";import{IframeLoginTypes as me}from"@multiversx/sdk-web-wallet-iframe-provider/out/constants";var w=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 oe({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!T())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 ae({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 pe({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await ie({shouldInitProvider:!0});this.provider=r}catch(r){throw P({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.ledger}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){await z(S),await this.initLegderConnectManager(this.options?.anchor);let e=R.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((n,s)=>ne({manager:e,resolve:n,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ue=3e4,fe=5e3,we=3e3,W=class a{constructor(){this.store=K();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let{providerType:i}=G(this.store.getState()),e=B(this.store.getState()).address;return!!(i===o.ledger&&e)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let i=$(d());if(!(!this.shouldCheckConnection()||i))try{await I().getProvider().getAddress()}catch{if(P({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,fe)}},ue))};this.getLedgerAddress=async()=>this.shouldCheckConnection()?await I().getProvider().getAddress():void 0;this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let i=new w({shouldInitProvider:!0});await i.init();let e=new b(i);i.getType=()=>o.ledger,C(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,P({toastId:"ledger-provider-idle-warning",duration:we,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 _=class extends p{constructor(e){super(e?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{onClose:r,manager:t}=await this.initSignState();this.setPopupConsent();try{let n=await this.provider.signTransactions(e)??[];return await se(n)}catch(n){throw await r({shouldCancelAction:!0}),n}finally{t.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return this.setPopupConsent(),await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.crossWindow})};this.setPopupConsent=()=>{let e=j(d());if(!this.provider)throw new Error("Provider is not initialized.");(e?.isBrowserWithPopupConfirmation||X)&&this.provider.setShouldShowConsentPopup(!0)};this.walletAddress=e?.walletAddress,this.provider=ee.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=L(d()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.setPopupConsent(),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return o.crossWindow}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{ExtensionProvider as ye}from"@multiversx/sdk-extension-provider/out/extensionProvider";var x=class extends p{constructor(e){super(e);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)??[]}catch(n){throw await t({shouldCancelAction:!1}),n}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension})};this.provider=ye.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return o.extension}};var Pe={passkey:o.passkey,metamask:o.metamask},E=class extends p{constructor({type:e,address:r,walletUrl:t}){super(r);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)}catch(n){throw await t({shouldCancelAction:!0}),n}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider||!this.type)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c[this.type]})};this.type=e,this.walletUrl=t??"",this.provider=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=L(d());if(!e.iframeWalletAddress)throw new Error("Invalid walletUrl");this.walletUrl=e.iframeWalletAddress}async initializeProvider(){return await this.provider.init(),this.address&&this.setAccount({address:this.address}),this.provider.setLoginType(this.type),this.provider.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return Pe[this.type]}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{OptionalOperation as ge}from"@multiversx/sdk-wallet-connect-provider/out";var ve=[f.CANCEL_ACTION,f.SIGN_LOGIN_TOKEN],O=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)}catch(n){throw await t({shouldCancelAction:!0}),await this.sendCustomRequest({method:f.CANCEL_ACTION,action:ge.CANCEL_ACTION}),n}finally{r.closeUI()}};this.cancelAction=async()=>{await this.sendCustomRequest({method:f.CANCEL_ACTION,action:ge.CANCEL_ACTION})};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:c.extension})};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.walletConnect}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return Promise.resolve(this.provider.getAddress())}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){if(await z(S),await this.initWalletConnectManager(),!this.config)throw new Error("Invalid WalletConnect setup");let{walletConnectProvider:e,dappMethods:r}=await this.createWalletConnectProvider(this.config);this.provider=e,this.methods=r;let{uri:t="",approval:n}=await this.provider.connect({methods:this.methods});this._approval=n,A.getInstance().updateData({wcURI:t})}async initWalletConnectManager(){if(!!T())return;await A.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=T(),t=H(d());if(q(d())&&ve.push(f.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let h={onClientLogin:()=>{},onClientLogout:()=>{Q()},onClientEvent:v=>{}};try{let{walletConnectV2ProjectId:v,walletConnectV2Options:N={},walletConnectV2RelayAddress:D=""}=e,y=new Z(h,t,D,v,N);return await y.init(),{walletConnectProvider:y,dappMethods:ve}}catch(v){throw console.error("Unable to connect",v),r&&await this.logout(),v}}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=A.getInstance(),{uri:n="",approval:s}=await this.provider.connect({methods:this.methods});t.updateData({wcURI:n});let l=await this.provider.login({approval:s,token:e?.token}),{address:m="",signature:h=""}=l??{};return t.handleClose({isLoginFinished:!!m}),{address:m,signature:h}}catch{return await r()}};if(!this._approval)throw new Error("Approval or login is not initialized");try{let t=await this.provider.login({approval:this._approval.bind(this),token:e?.token}),{address:n="",signature:s=""}=t??{};return A.getInstance().handleClose({isLoginFinished:!!n}),{address:n,signature:s}}catch(t){return console.error("User rejected connection proposal",t),await r()}}async sendCustomRequest({action:e,method:r}){if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.sendCustomRequest?.({request:{method:r,params:{action:e}}})}catch(t){console.error("Unable to send event",t)}}};var M=class{static set customProviders(i){this._customProviders=i}static get customProviders(){return this._customProviders}static async create({type:i,anchor:e}){let r=null;switch(i){case o.extension:{r=new x;break}case o.crossWindow:{r=new _;break}case o.ledger:{r=new w({anchor:e}),await W.getInstance().init();break}case o.metamask:{r=new E({type:me.metamask});break}case o.passkey:{r=new E({type:me.passkey});break}case o.walletConnect:{let s=F(d());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new O({anchor:e,...s});break}case o.webview:{r=new le;break}default:{let s=Y();for(let l of this._customProviders)l.type===i&&(r=await l.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new b(r);C(t),U(i);let n=i in[o.crossWindow,o.metamask,o.passkey];return ce(n?{skipLoginMethod:i}:null),t}static async destroy(){I().cancelLogin(),C(null),U(o.none)}};M._customProviders=[];var Ie=(a,i)=>a.some(e=>e.type===i);async function g({message:a,handleSignMessage:i,cancelAction:e,providerType:r}){return await new Promise(async(n,s)=>{let{manager:l,onClose:m}=await re({cancelAction:e}),h=Object.values(M.customProviders),v=h.reduce((u,V)=>(u[V.type]=V.name,u),{}),N={...c,...v},D=async()=>{await m({shouldCancelAction:!0}),s({message:"Signing canceled"})};l.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",D);let y=Ie(h,r)?r:o.none;l.updateData({name:N[y],type:y});try{let u=await i(a);n(u)}catch(u){await m({shouldCancelAction:!0}),s(u)}finally{l.closeUI()}})}async function pe({message:a,handleSignMessage:i}){try{return await g({message:a,handleSignMessage:i,providerType:c.ledger})}catch(e){let{errorMessage:r}=te(e);throw r?{message:r}:e}}export{pe as a,w as b,W as c,M as d,g as e,_ as f,x as g,E as h,O as i};
|
|
2
|
+
//# sourceMappingURL=chunk-F3AMNJ5K.mjs.map
|