@multiversx/sdk-dapp 5.0.0-alpha.11 → 5.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -14
- package/out/__chunks__/chunk-2ZNIPYEV.mjs +2 -0
- package/out/__chunks__/chunk-35ED7YL2.mjs +2 -0
- package/out/__chunks__/{chunk-N6SD2OVU.mjs → chunk-3ATEIVW3.mjs} +2 -2
- package/out/__chunks__/chunk-3ATEIVW3.mjs.map +7 -0
- package/out/__chunks__/{chunk-S75GQPJQ.mjs → chunk-3RBYJZII.mjs} +2 -2
- package/out/__chunks__/{chunk-7D2BEFUJ.mjs → chunk-3UIJI5YR.mjs} +2 -2
- package/out/__chunks__/chunk-3XCB5CEW.mjs +2 -0
- package/out/__chunks__/chunk-3XCB5CEW.mjs.map +7 -0
- package/out/__chunks__/chunk-47CCSYQY.mjs +2 -0
- package/out/__chunks__/{chunk-KEAFX54V.mjs → chunk-53JZ6ZBD.mjs} +2 -2
- package/out/__chunks__/{chunk-3EI6B7OU.mjs → chunk-57B6Q67I.mjs} +2 -2
- package/out/__chunks__/{chunk-QWNJJXNH.mjs → chunk-5V5MG3BL.mjs} +2 -2
- package/out/__chunks__/{chunk-FIXSEPFX.mjs → chunk-65RXDHRY.mjs} +2 -2
- package/out/__chunks__/{chunk-ZSVNTZ3Q.mjs → chunk-6H5TKCEW.mjs} +2 -2
- package/out/__chunks__/chunk-6UZHM5LW.mjs +2 -0
- package/out/__chunks__/chunk-6UZHM5LW.mjs.map +7 -0
- package/out/__chunks__/{chunk-YZE4ECSF.mjs → chunk-77IZTIMY.mjs} +2 -2
- package/out/__chunks__/chunk-7ZW5EZFP.mjs +2 -0
- package/out/__chunks__/{chunk-FS2F24A7.mjs → chunk-A343RP4X.mjs} +2 -2
- package/out/__chunks__/chunk-AGHFAZ7O.mjs +2 -0
- package/out/__chunks__/{chunk-DPSC4NIK.mjs → chunk-AKFSBZ46.mjs} +2 -2
- package/out/__chunks__/{chunk-XOWM53LI.mjs → chunk-AM6BSOYA.mjs} +2 -2
- package/out/__chunks__/{chunk-MJEZGI7G.mjs → chunk-AQ3VAQH3.mjs} +2 -2
- package/out/__chunks__/chunk-AQ3VAQH3.mjs.map +7 -0
- package/out/__chunks__/{chunk-FMUDQBZE.mjs → chunk-BETSOJFK.mjs} +2 -2
- package/out/__chunks__/chunk-CTW5DICC.mjs +2 -0
- package/out/__chunks__/chunk-DCCGXGUQ.mjs +2 -0
- package/out/__chunks__/chunk-DDXGTNBZ.mjs +2 -0
- package/out/__chunks__/{chunk-4RJ23OT7.mjs → chunk-ED5SQUAW.mjs} +2 -2
- package/out/__chunks__/{chunk-EUVZQRU5.mjs → chunk-EGU5LABV.mjs} +2 -2
- package/out/__chunks__/chunk-EKMRPW2A.mjs +2 -0
- package/out/__chunks__/chunk-EKMRPW2A.mjs.map +7 -0
- package/out/__chunks__/{chunk-2AB2KTYM.mjs → chunk-EQEYL6AE.mjs} +2 -2
- package/out/__chunks__/{chunk-EQMLAAI2.mjs → chunk-ER735UVF.mjs} +2 -2
- package/out/__chunks__/{chunk-FELZAGW5.mjs → chunk-EUXN5BLO.mjs} +2 -2
- package/out/__chunks__/{chunk-X4ZYTNNA.mjs → chunk-FFEFZVCC.mjs} +2 -2
- package/out/__chunks__/{chunk-MRJ7P7KU.mjs → chunk-GOL32UNC.mjs} +2 -2
- package/out/__chunks__/{chunk-YEAVK4T2.mjs → chunk-GXUJBKWY.mjs} +2 -2
- package/out/__chunks__/{chunk-AHHTRI3Y.mjs → chunk-HIODLP5F.mjs} +2 -2
- package/out/__chunks__/{chunk-HQSB4ISG.mjs → chunk-HIUWEH2W.mjs} +2 -2
- package/out/__chunks__/{chunk-ZZ53RJBO.mjs → chunk-HPLSDK5V.mjs} +2 -2
- package/out/__chunks__/chunk-HTAH342B.mjs +2 -0
- package/out/__chunks__/{chunk-JAUTVROS.mjs.map → chunk-HTAH342B.mjs.map} +1 -1
- package/out/__chunks__/{chunk-B5AW5LX5.mjs → chunk-HVUNMCAO.mjs} +2 -2
- package/out/__chunks__/{chunk-DVY6YKH6.mjs → chunk-IEWH5GDM.mjs} +2 -2
- package/out/__chunks__/{chunk-NXV7YLV6.mjs → chunk-ISB4SC4L.mjs} +2 -2
- package/out/__chunks__/chunk-IYAIXP65.mjs +2 -0
- package/out/__chunks__/{chunk-BNWGWGXY.mjs → chunk-JF4GVWO4.mjs} +2 -2
- package/out/__chunks__/{chunk-TAQN5HUK.mjs → chunk-JGFDKHG2.mjs} +2 -2
- package/out/__chunks__/chunk-K66JLLVW.mjs +2 -0
- package/out/__chunks__/{chunk-ORHJGVU5.mjs.map → chunk-K66JLLVW.mjs.map} +2 -2
- package/out/__chunks__/{chunk-LYTZPES3.mjs → chunk-KGASLT4P.mjs} +2 -2
- package/out/__chunks__/{chunk-SHDTJ5GB.mjs → chunk-KWJVDPCC.mjs} +2 -2
- package/out/__chunks__/{chunk-RA4VU3NM.mjs → chunk-L4762ZRT.mjs} +2 -2
- package/out/__chunks__/{chunk-HCDOXUDA.mjs → chunk-LDETTRYB.mjs} +2 -2
- package/out/__chunks__/{chunk-QWIXKUDO.mjs → chunk-LEBVS2YF.mjs} +2 -2
- package/out/__chunks__/chunk-LIFPBQTL.mjs +2 -0
- package/out/__chunks__/chunk-LJ5JGAYL.mjs +2 -0
- package/out/__chunks__/{chunk-LKXBH3I3.mjs → chunk-LYXQ3FWU.mjs} +2 -2
- package/out/__chunks__/{chunk-SNBLSIKQ.mjs → chunk-NJMYFDLA.mjs} +2 -2
- package/out/__chunks__/chunk-NONAAAZC.mjs +2 -0
- package/out/__chunks__/{chunk-U6KSTPE7.mjs.map → chunk-NONAAAZC.mjs.map} +1 -1
- package/out/__chunks__/chunk-NQQQKXT2.mjs +2 -0
- package/out/__chunks__/{chunk-AAMNTAXA.mjs → chunk-OB6ULJEV.mjs} +2 -2
- package/out/__chunks__/{chunk-ZMEIT65B.mjs → chunk-OD4ANAAQ.mjs} +2 -2
- package/out/__chunks__/{chunk-JOB7ALAF.mjs → chunk-PGOE5XGR.mjs} +2 -2
- package/out/__chunks__/{chunk-JOB7ALAF.mjs.map → chunk-PGOE5XGR.mjs.map} +2 -2
- package/out/__chunks__/{chunk-5AR7YU5K.mjs → chunk-PJDJEPY2.mjs} +2 -2
- package/out/__chunks__/{chunk-PCY7ULK2.mjs → chunk-PXMPUIUL.mjs} +2 -2
- package/out/__chunks__/{chunk-AV6BSOLO.mjs → chunk-Q56GIIOP.mjs} +2 -2
- package/out/__chunks__/{chunk-HTVULYKB.mjs → chunk-Q6NDAYER.mjs} +2 -2
- package/out/__chunks__/chunk-QNKYH6KO.mjs +2 -0
- package/out/__chunks__/chunk-QNKYH6KO.mjs.map +7 -0
- package/out/__chunks__/{chunk-XZVYUFVM.mjs → chunk-QPXVUJSC.mjs} +2 -2
- package/out/__chunks__/{chunk-IAK3KHJ7.mjs → chunk-QVLQCJFN.mjs} +2 -2
- package/out/__chunks__/{chunk-3ZHPM667.mjs → chunk-RIH7QM6W.mjs} +2 -2
- package/out/__chunks__/{chunk-DKE2ONRB.mjs → chunk-RJSL5ONQ.mjs} +2 -2
- package/out/__chunks__/{chunk-ZHGCNNB5.mjs → chunk-RM4VHHXR.mjs} +2 -2
- package/out/__chunks__/chunk-RNYSLFYZ.mjs +2 -0
- package/out/__chunks__/chunk-RNYSLFYZ.mjs.map +7 -0
- package/out/__chunks__/{chunk-XW2GCCBZ.mjs → chunk-RRKNYQ6D.mjs} +2 -2
- package/out/__chunks__/chunk-RUG7JMMB.mjs +2 -0
- package/out/__chunks__/{chunk-3BXYTP4Q.mjs → chunk-S4LN2NQH.mjs} +2 -2
- package/out/__chunks__/chunk-SBZ2AN3R.mjs +2 -0
- package/out/__chunks__/{chunk-Y53MWKLT.mjs → chunk-SHFT3OJY.mjs} +2 -2
- package/out/__chunks__/chunk-T3VFM2QO.mjs +2 -0
- package/out/__chunks__/{chunk-RI7FD4HM.mjs → chunk-TSUMQ3HX.mjs} +2 -2
- package/out/__chunks__/{chunk-RI7FD4HM.mjs.map → chunk-TSUMQ3HX.mjs.map} +1 -1
- package/out/__chunks__/{chunk-C37IYZAK.mjs → chunk-TXQO3M7J.mjs} +2 -2
- package/out/__chunks__/{chunk-NKJ7OVPV.mjs → chunk-U5IR3XBA.mjs} +2 -2
- package/out/__chunks__/chunk-UZUI4AP5.mjs +2 -0
- package/out/__chunks__/chunk-VO4DXDYI.mjs +2 -0
- package/out/__chunks__/chunk-VO4DXDYI.mjs.map +7 -0
- package/out/__chunks__/chunk-VYWLQ5T7.mjs +2 -0
- package/out/__chunks__/chunk-W46BAMEI.mjs +2 -0
- package/out/__chunks__/chunk-W46BAMEI.mjs.map +7 -0
- package/out/__chunks__/chunk-XBVPYKPZ.mjs +2 -0
- package/out/__chunks__/chunk-XDH23MRS.mjs +2 -0
- package/out/__chunks__/{chunk-HN244QVP.mjs → chunk-XSJE7M77.mjs} +2 -2
- package/out/__chunks__/{chunk-2I7FJNXZ.mjs → chunk-Y5Y2WOCZ.mjs} +2 -2
- package/out/__chunks__/{chunk-YV2TRFYW.mjs → chunk-YILGIHY5.mjs} +2 -2
- package/out/__mocks__/data/index.mjs +1 -1
- package/out/__mocks__/index.mjs +1 -1
- package/out/__mocks__/server.mjs +1 -1
- package/out/apiCalls/account/getScamAddressData.mjs +1 -1
- package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
- package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
- package/out/apiCalls/index.mjs +1 -1
- package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/index.mjs +1 -1
- package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
- package/out/constants/browser.constants.mjs +1 -1
- package/out/constants/index.mjs +1 -1
- package/out/constants/storage.constants.mjs +1 -1
- package/out/constants/window.constants.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
- package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
- package/out/controllers/TransactionsTableController/index.mjs +1 -1
- package/out/core/providers/DappProvider/helpers/login/helpers/refreshNativeAuthTokenLogin.mjs +1 -1
- package/out/index.mjs +1 -1
- package/out/managers/LogoutManager/LogoutManager.d.ts +15 -0
- package/out/managers/LogoutManager/LogoutManager.js +137 -0
- package/out/managers/LogoutManager/LogoutManager.js.map +1 -0
- package/out/managers/LogoutManager/LogoutManager.mjs +2 -0
- package/out/managers/LogoutManager/helpers/getHumanReadableTokenExpirationTime.d.ts +1 -0
- package/out/managers/LogoutManager/helpers/getHumanReadableTokenExpirationTime.js +33 -0
- package/out/managers/LogoutManager/helpers/getHumanReadableTokenExpirationTime.js.map +1 -0
- package/out/managers/LogoutManager/helpers/getHumanReadableTokenExpirationTime.mjs +2 -0
- package/out/managers/LogoutManager/helpers/getHumanReadableTokenExpirationTime.mjs.map +7 -0
- package/out/managers/LogoutManager/helpers/tests/getHumanReadableTokenExpirationTime.test.d.ts +1 -0
- package/out/managers/LogoutManager/helpers/tests/getHumanReadableTokenExpirationTime.test.js +48 -0
- package/out/managers/LogoutManager/helpers/tests/getHumanReadableTokenExpirationTime.test.js.map +1 -0
- package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/index.mjs +1 -1
- package/out/managers/TransactionManager/TransactionManager.d.ts +14 -0
- package/out/managers/TransactionManager/TransactionManager.js +16 -0
- package/out/managers/TransactionManager/TransactionManager.js.map +1 -1
- package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
- package/out/managers/TransactionManager/index.mjs +1 -1
- package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
- package/out/managers/UnlockPanelManager/index.mjs +1 -1
- package/out/managers/index.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
- package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.d.ts +0 -1
- package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.js +7 -14
- package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.js.map +1 -1
- package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.d.ts +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.d.ts +5 -3
- package/out/managers/internal/ToastManager/ToastManager.js +9 -3
- package/out/managers/internal/ToastManager/ToastManager.js.map +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/UIBaseManager/UIBaseManager.d.ts +1 -1
- package/out/managers/internal/UIBaseManager/UIBaseManager.js +2 -2
- package/out/managers/internal/UIBaseManager/UIBaseManager.js.map +1 -1
- package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
- package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.js +2 -1
- package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.js.map +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.js +7 -5
- package/out/methods/initApp/initApp.js.map +1 -1
- package/out/methods/initApp/initApp.mjs +1 -1
- package/out/methods/initApp/initApp.mjs.map +3 -3
- package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
- package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
- package/out/methods/loginInfo/getLoginInfo.mjs +1 -1
- package/out/methods/network/getEgldLabel.mjs +1 -1
- package/out/methods/network/getExplorerAddress.mjs +1 -1
- package/out/methods/network/getNetworkConfig.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/index.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/manageFailedTransactions.mjs +1 -1
- package/out/methods/trackTransactions/helpers/getPollingInterval.mjs +1 -1
- package/out/methods/trackTransactions/trackTransactions.mjs +1 -1
- package/out/methods/transactions/getFailedTransactions.mjs +1 -1
- package/out/methods/transactions/getFailedTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getSuccessfulTransactions.mjs +1 -1
- package/out/methods/transactions/getSuccessfulTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getTransactionSessions.mjs +1 -1
- package/out/providers/DappProvider/DappProvider.js +2 -0
- package/out/providers/DappProvider/DappProvider.js.map +1 -1
- package/out/providers/DappProvider/DappProvider.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/extractAddressFromToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getAccountFromToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getModifiedLoginToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
- package/out/providers/DappProvider/helpers/logout/logout.mjs +1 -1
- package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
- package/out/providers/DappProvider/helpers/signMessage/signMessageWithProvider.mjs +1 -1
- package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
- package/out/providers/DappProvider/index.mjs +1 -1
- package/out/providers/ProviderFactory.js +5 -6
- 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/restoreProvider.mjs +1 -1
- package/out/providers/index.mjs +1 -1
- package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
- package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
- package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.js +13 -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/WalletConnectProviderStrategy/types/index.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/types/walletConnect.types.d.ts +1 -0
- package/out/providers/strategies/WalletConnectProviderStrategy/types/walletConnect.types.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
- package/out/providers/strategies/helpers/index.mjs +1 -1
- package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/decodeDataField.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getMultiEsdtTransferData/getMultiEsdtTransferData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getMultiEsdtTransferData/helpers/getTokenFromData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getMultiEsdtTransferData/helpers/parseMultiEsdtTransferDataForMultipleTransactions.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
- package/out/providers/strategies/index.mjs +1 -1
- package/out/react/account/useGetAccount.mjs +1 -1
- package/out/react/account/useGetAccountInfo.mjs +1 -1
- package/out/react/account/useGetIsLoggedIn.mjs +1 -1
- package/out/react/account/useGetLatestNonce.mjs +1 -1
- package/out/react/index.mjs +1 -1
- package/out/react/loginInfo/useGetLoginInfo.mjs +1 -1
- package/out/react/network/useGetNetworkConfig.mjs +1 -1
- package/out/react/store/getReactStore.mjs +1 -1
- package/out/react/store/useSelector.mjs +1 -1
- package/out/react/transactions/useGetFailedTransactions.mjs +1 -1
- package/out/react/transactions/{useGetFailedTransactionsSessions copy.js → useGetFailedTransactionsSessions.js} +1 -1
- package/out/react/transactions/useGetFailedTransactionsSessions.js.map +1 -0
- package/out/react/transactions/{useGetFailedTransactionsSessions copy.mjs → useGetFailedTransactionsSessions.mjs} +2 -2
- package/out/react/transactions/{useGetFailedTransactionsSessions copy.mjs.map → useGetFailedTransactionsSessions.mjs.map} +1 -1
- package/out/react/transactions/useGetPendingTransactions.mjs +1 -1
- package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetSuccessfulTransactions.mjs +1 -1
- package/out/react/transactions/useGetSuccessfulTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetTransactionSessions.mjs +1 -1
- package/out/services/index.mjs +1 -1
- package/out/services/nativeAuth/index.mjs +1 -1
- package/out/services/nativeAuth/nativeAuth.js +6 -8
- package/out/services/nativeAuth/nativeAuth.js.map +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.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.mjs +1 -1
- package/out/store/actions/toasts/index.mjs +1 -1
- package/out/store/actions/toasts/toastsActions.d.ts +1 -1
- package/out/store/actions/toasts/toastsActions.js +3 -1
- package/out/store/actions/toasts/toastsActions.js.map +1 -1
- package/out/store/actions/toasts/toastsActions.mjs +1 -1
- package/out/store/actions/transactions/transactionsActions.mjs +1 -1
- package/out/store/actions/ui/index.mjs +1 -1
- package/out/store/actions/ui/uiActions.mjs +1 -1
- package/out/store/middleware/applyMiddlewares.mjs +1 -1
- package/out/store/middleware/index.mjs +1 -1
- package/out/store/middleware/logoutMiddleware.mjs +1 -1
- package/out/store/storage/index.mjs +1 -1
- package/out/store/storage/storageCallback.mjs +1 -1
- package/out/store/store.mjs +1 -1
- package/out/utils/ComponentFactory.d.ts +14 -0
- package/out/utils/{createUIElement.js → ComponentFactory.js} +14 -4
- package/out/utils/ComponentFactory.js.map +1 -0
- package/out/utils/ComponentFactory.mjs +2 -0
- package/out/utils/ComponentFactory.mjs.map +7 -0
- package/out/utils/account/index.mjs +1 -1
- package/out/utils/account/refreshAccount.mjs +1 -1
- package/out/utils/index.mjs +1 -1
- package/out/utils/transactions/getActiveTransactionsStatus.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/getInterpretedTransaction.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getLockedAccountName.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getShardText.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getTokenFromData.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionIconInfo.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionMessages.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/index.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/index.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/getTransactionsHistory.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/getCachedTransactionListItem.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/index.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/index.mjs +1 -1
- package/out/utils/transactions/index.mjs +1 -1
- package/out/utils/visual/index.mjs +1 -1
- package/out/utils/visual/switchTheme.js +6 -3
- package/out/utils/visual/switchTheme.js.map +1 -1
- package/out/utils/visual/switchTheme.mjs +1 -1
- package/out/utils/window/getIsInIframe.mjs +1 -1
- package/out/utils/window/getWindowParentOrigin.mjs +1 -1
- package/out/utils/window/index.mjs +1 -1
- package/package.json +2 -2
- package/out/__chunks__/chunk-2X62ALFS.mjs +0 -2
- package/out/__chunks__/chunk-2X62ALFS.mjs.map +0 -7
- package/out/__chunks__/chunk-2ZNQYHNX.mjs +0 -2
- package/out/__chunks__/chunk-3GXUTDCB.mjs +0 -2
- package/out/__chunks__/chunk-3YK6SW7E.mjs +0 -2
- package/out/__chunks__/chunk-4RGFBPII.mjs +0 -2
- package/out/__chunks__/chunk-4RGFBPII.mjs.map +0 -7
- package/out/__chunks__/chunk-535PAVZN.mjs +0 -2
- package/out/__chunks__/chunk-5OQ6KHGF.mjs +0 -2
- package/out/__chunks__/chunk-62PJZCUP.mjs +0 -2
- package/out/__chunks__/chunk-6LY7ZRDT.mjs +0 -2
- package/out/__chunks__/chunk-6LY7ZRDT.mjs.map +0 -7
- package/out/__chunks__/chunk-7B2IRMVK.mjs +0 -2
- package/out/__chunks__/chunk-AFEGGHNM.mjs +0 -2
- package/out/__chunks__/chunk-ASRYY6T3.mjs +0 -2
- package/out/__chunks__/chunk-BMXLSDJM.mjs +0 -2
- package/out/__chunks__/chunk-C6JD2OFD.mjs +0 -2
- package/out/__chunks__/chunk-C6JD2OFD.mjs.map +0 -7
- package/out/__chunks__/chunk-DICSPHT2.mjs +0 -2
- package/out/__chunks__/chunk-ESLVKRXK.mjs +0 -2
- package/out/__chunks__/chunk-J75OEBAP.mjs +0 -2
- package/out/__chunks__/chunk-JAUTVROS.mjs +0 -2
- package/out/__chunks__/chunk-MJEZGI7G.mjs.map +0 -7
- package/out/__chunks__/chunk-N6SD2OVU.mjs.map +0 -7
- package/out/__chunks__/chunk-O2SZII5H.mjs +0 -2
- package/out/__chunks__/chunk-OEYIF65Y.mjs +0 -2
- package/out/__chunks__/chunk-OEYIF65Y.mjs.map +0 -7
- package/out/__chunks__/chunk-ORHJGVU5.mjs +0 -2
- package/out/__chunks__/chunk-Q7L5T72K.mjs +0 -2
- package/out/__chunks__/chunk-RIFXW4D3.mjs +0 -2
- package/out/__chunks__/chunk-RIFXW4D3.mjs.map +0 -7
- package/out/__chunks__/chunk-U6KSTPE7.mjs +0 -2
- package/out/__chunks__/chunk-WMY46KJS.mjs +0 -2
- package/out/__chunks__/chunk-XGV7BGBC.mjs +0 -2
- package/out/__chunks__/chunk-XGV7BGBC.mjs.map +0 -7
- package/out/__chunks__/chunk-XXKSDA5P.mjs +0 -2
- package/out/__chunks__/chunk-YK4XGF57.mjs +0 -2
- package/out/__chunks__/chunk-YLN3OBBP.mjs +0 -2
- package/out/__chunks__/chunk-ZZDN5HHJ.mjs +0 -2
- package/out/__chunks__/chunk-ZZDN5HHJ.mjs.map +0 -7
- package/out/react/transactions/useGetFailedTransactionsSessions copy.js.map +0 -1
- package/out/utils/createUIElement.d.ts +0 -9
- package/out/utils/createUIElement.js.map +0 -1
- package/out/utils/createUIElement.mjs +0 -2
- /package/out/__chunks__/{chunk-YK4XGF57.mjs.map → chunk-2ZNIPYEV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3GXUTDCB.mjs.map → chunk-35ED7YL2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-S75GQPJQ.mjs.map → chunk-3RBYJZII.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7D2BEFUJ.mjs.map → chunk-3UIJI5YR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XXKSDA5P.mjs.map → chunk-47CCSYQY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KEAFX54V.mjs.map → chunk-53JZ6ZBD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3EI6B7OU.mjs.map → chunk-57B6Q67I.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QWNJJXNH.mjs.map → chunk-5V5MG3BL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FIXSEPFX.mjs.map → chunk-65RXDHRY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZSVNTZ3Q.mjs.map → chunk-6H5TKCEW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YZE4ECSF.mjs.map → chunk-77IZTIMY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-J75OEBAP.mjs.map → chunk-7ZW5EZFP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FS2F24A7.mjs.map → chunk-A343RP4X.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-O2SZII5H.mjs.map → chunk-AGHFAZ7O.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DPSC4NIK.mjs.map → chunk-AKFSBZ46.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XOWM53LI.mjs.map → chunk-AM6BSOYA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FMUDQBZE.mjs.map → chunk-BETSOJFK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ESLVKRXK.mjs.map → chunk-CTW5DICC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-535PAVZN.mjs.map → chunk-DCCGXGUQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Q7L5T72K.mjs.map → chunk-DDXGTNBZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4RJ23OT7.mjs.map → chunk-ED5SQUAW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EUVZQRU5.mjs.map → chunk-EGU5LABV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2AB2KTYM.mjs.map → chunk-EQEYL6AE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-EQMLAAI2.mjs.map → chunk-ER735UVF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FELZAGW5.mjs.map → chunk-EUXN5BLO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-X4ZYTNNA.mjs.map → chunk-FFEFZVCC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MRJ7P7KU.mjs.map → chunk-GOL32UNC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YEAVK4T2.mjs.map → chunk-GXUJBKWY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AHHTRI3Y.mjs.map → chunk-HIODLP5F.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HQSB4ISG.mjs.map → chunk-HIUWEH2W.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZZ53RJBO.mjs.map → chunk-HPLSDK5V.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-B5AW5LX5.mjs.map → chunk-HVUNMCAO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DVY6YKH6.mjs.map → chunk-IEWH5GDM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NXV7YLV6.mjs.map → chunk-ISB4SC4L.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ASRYY6T3.mjs.map → chunk-IYAIXP65.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BNWGWGXY.mjs.map → chunk-JF4GVWO4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TAQN5HUK.mjs.map → chunk-JGFDKHG2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LYTZPES3.mjs.map → chunk-KGASLT4P.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SHDTJ5GB.mjs.map → chunk-KWJVDPCC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RA4VU3NM.mjs.map → chunk-L4762ZRT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HCDOXUDA.mjs.map → chunk-LDETTRYB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QWIXKUDO.mjs.map → chunk-LEBVS2YF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3YK6SW7E.mjs.map → chunk-LIFPBQTL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-62PJZCUP.mjs.map → chunk-LJ5JGAYL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LKXBH3I3.mjs.map → chunk-LYXQ3FWU.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SNBLSIKQ.mjs.map → chunk-NJMYFDLA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5OQ6KHGF.mjs.map → chunk-NQQQKXT2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AAMNTAXA.mjs.map → chunk-OB6ULJEV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZMEIT65B.mjs.map → chunk-OD4ANAAQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-5AR7YU5K.mjs.map → chunk-PJDJEPY2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-PCY7ULK2.mjs.map → chunk-PXMPUIUL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AV6BSOLO.mjs.map → chunk-Q56GIIOP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HTVULYKB.mjs.map → chunk-Q6NDAYER.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XZVYUFVM.mjs.map → chunk-QPXVUJSC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-IAK3KHJ7.mjs.map → chunk-QVLQCJFN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3ZHPM667.mjs.map → chunk-RIH7QM6W.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DKE2ONRB.mjs.map → chunk-RJSL5ONQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZHGCNNB5.mjs.map → chunk-RM4VHHXR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XW2GCCBZ.mjs.map → chunk-RRKNYQ6D.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-DICSPHT2.mjs.map → chunk-RUG7JMMB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3BXYTP4Q.mjs.map → chunk-S4LN2NQH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BMXLSDJM.mjs.map → chunk-SBZ2AN3R.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-Y53MWKLT.mjs.map → chunk-SHFT3OJY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2ZNQYHNX.mjs.map → chunk-T3VFM2QO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-C37IYZAK.mjs.map → chunk-TXQO3M7J.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NKJ7OVPV.mjs.map → chunk-U5IR3XBA.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-WMY46KJS.mjs.map → chunk-UZUI4AP5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YLN3OBBP.mjs.map → chunk-VYWLQ5T7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AFEGGHNM.mjs.map → chunk-XBVPYKPZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7B2IRMVK.mjs.map → chunk-XDH23MRS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HN244QVP.mjs.map → chunk-XSJE7M77.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2I7FJNXZ.mjs.map → chunk-Y5Y2WOCZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YV2TRFYW.mjs.map → chunk-YILGIHY5.mjs.map} +0 -0
- /package/out/{utils/createUIElement.mjs.map → managers/LogoutManager/LogoutManager.mjs.map} +0 -0
- /package/out/react/transactions/{useGetFailedTransactionsSessions copy.d.ts → useGetFailedTransactionsSessions.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -104,7 +104,14 @@ const config: InitAppType = {
|
|
|
104
104
|
// network: { // optional
|
|
105
105
|
// walletAddress: 'https://devnet-wallet.multiversx.com' // or other props you want to override
|
|
106
106
|
// },
|
|
107
|
-
|
|
107
|
+
// transactionTracking: { // optional
|
|
108
|
+
// successfulToastLifetime: 5000,
|
|
109
|
+
// onSuccess: async (sessionId) => {
|
|
110
|
+
// console.log('Transaction session successful', sessionId);
|
|
111
|
+
// },
|
|
112
|
+
// onFail: async (sessionId) => {
|
|
113
|
+
// console.log('Transaction session failed', sessionId);
|
|
114
|
+
// }
|
|
108
115
|
}
|
|
109
116
|
// customProviders: [myCustomProvider] // optional
|
|
110
117
|
};
|
|
@@ -141,6 +148,30 @@ export const ConnectButton = () => {
|
|
|
141
148
|
};
|
|
142
149
|
|
|
143
150
|
```
|
|
151
|
+
Once the user has logged in, if `nativeAuth` is configured in the `initApp` method, an automatic logout will be performed upon native auth expiration. Before the actual logout is performed, the `LogoutManager` will show a warning toast to the user. This toast can be customized by passing a `tokenExpirationToastWarningSeconds` to the `nativeAuth` config.
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
// in initAoo config
|
|
155
|
+
const config: InitAppType = {
|
|
156
|
+
// ...
|
|
157
|
+
nativeAuth: {
|
|
158
|
+
expirySeconds: 30, // test auto logout after 30 seconds
|
|
159
|
+
tokenExpirationToastWarningSeconds: 10 // show warning toast 10 seconds before auto logout
|
|
160
|
+
},
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
You have the option to stop this behavior by calling `LogoutManager.getInstance().stop()` after the user has logged in.
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
import { LogoutManager } from '@multiversx/sdk-dapp/out/managers/LogoutManager/LogoutManager';
|
|
168
|
+
|
|
169
|
+
loginHandler: () => {
|
|
170
|
+
navigate('/dashboard');
|
|
171
|
+
// optional, to stop the automatic logout upon native auth expiration
|
|
172
|
+
LogoutManager.getInstance().stop();
|
|
173
|
+
},
|
|
174
|
+
```
|
|
144
175
|
|
|
145
176
|
If you want to perform some actions as soon as the user has logged in, you will need to call `ProviderFactory.create` inside a handler accepting arguments.
|
|
146
177
|
|
|
@@ -414,20 +445,8 @@ An existing provider is initialized on app load (this is take care of by `initAp
|
|
|
414
445
|
If you need to create a custom signing provider, make sure to extend the `IProvider` interface and implement all required methods (see example [here](https://github.com/multiversx/mx-template-dapp/tree/main/src/provider)). Next step would be to include it in the `customProviders` array in the `initApp` method or add it to the [window object](https://github.com/multiversx/mx-template-dapp/tree/main/src/initConfig). Last step is to login using the custom provider.
|
|
415
446
|
|
|
416
447
|
```typescript
|
|
417
|
-
import { ProviderTypeEnum } from '@multiversx/sdk-dapp/out/providers/types/providerFactory.types';
|
|
418
|
-
|
|
419
|
-
const ADDITIONAL_PROVIDERS = {
|
|
420
|
-
myCustomProvider: 'myCustomProvider'
|
|
421
|
-
} as const;
|
|
422
|
-
|
|
423
|
-
// do this if you want to reference it later in your code
|
|
424
|
-
const ExtendedProviders = {
|
|
425
|
-
...ProviderTypeEnum,
|
|
426
|
-
...ADDITIONAL_PROVIDERS
|
|
427
|
-
} as const;
|
|
428
|
-
|
|
429
448
|
const provider = await ProviderFactory.create({
|
|
430
|
-
type:
|
|
449
|
+
type: 'custom-provider'
|
|
431
450
|
});
|
|
432
451
|
await provider?.login();
|
|
433
452
|
```
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-AQ3VAQH3.mjs";import{a as t}from"./chunk-DDXGTNBZ.mjs";var s=class extends n{constructor({uiDataUpdateEvent:e,uiTag:i}){super({uiDataUpdateEvent:e,uiTag:i});this.isOpen=!1;this.data=this.getInitialData()}async openUI(){this.isOpen&&this.uiElement||(await super.init(),this.setIsSidePanelOpen(!0))}async destroy(){this.setIsSidePanelOpen(!1),await this.uiElement?.closeWithAnimation?.(),super.destroy()}closeUI(){this.resetData(),this.destroy()}setIsSidePanelOpen(e){this.isOpen=e,t(e)}};export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3ATEIVW3.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/managers/internal/SidePanelBaseManager/SidePanelBaseManager.ts"],
|
|
4
|
+
"sourcesContent": ["import { UITagsEnum } from 'constants/UITags.enum';\nimport { setIsSidePanelOpen } from 'store/actions/ui/uiActions';\nimport { CreateEventBusUIElementType } from 'utils/ComponentFactory';\nimport { UIBaseManager } from '../UIBaseManager/UIBaseManager';\n\ninterface ISideManagerUIElement extends CreateEventBusUIElementType {\n closeWithAnimation?: () => Promise<unknown>;\n}\n\nexport abstract class SidePanelBaseManager<\n TElement extends ISideManagerUIElement,\n TData extends Record<string, any> | null,\n TEventEnum extends string\n> extends UIBaseManager<TElement, TData, TEventEnum> {\n protected isOpen = false;\n\n constructor({\n uiDataUpdateEvent,\n uiTag\n }: {\n uiTag: UITagsEnum;\n uiDataUpdateEvent: TEventEnum;\n }) {\n super({\n uiDataUpdateEvent,\n uiTag\n });\n this.data = this.getInitialData();\n }\n\n public async openUI() {\n if (this.isOpen && this.uiElement) {\n // UI element is already open\n return;\n }\n\n await super.init();\n this.setIsSidePanelOpen(true);\n }\n\n public async destroy() {\n this.setIsSidePanelOpen(false);\n await this.uiElement?.closeWithAnimation?.();\n\n super.destroy();\n }\n\n public closeUI(): void {\n this.resetData();\n this.destroy();\n }\n\n private setIsSidePanelOpen(isOpen: boolean): void {\n this.isOpen = isOpen;\n setIsSidePanelOpen(isOpen);\n }\n}\n"],
|
|
5
|
+
"mappings": "kFASO,IAAeA,EAAf,cAIGC,CAA2C,CAGnD,YAAY,CACV,kBAAAC,EACA,MAAAC,CACF,EAGG,CACD,MAAM,CACJ,kBAAAD,EACA,MAAAC,CACF,CAAC,EAZH,KAAU,OAAS,GAajB,KAAK,KAAO,KAAK,eAAe,CAClC,CAEA,MAAa,QAAS,CAChB,KAAK,QAAU,KAAK,YAKxB,MAAM,MAAM,KAAK,EACjB,KAAK,mBAAmB,EAAI,EAC9B,CAEA,MAAa,SAAU,CACrB,KAAK,mBAAmB,EAAK,EAC7B,MAAM,KAAK,WAAW,qBAAqB,EAE3C,MAAM,QAAQ,CAChB,CAEO,SAAgB,CACrB,KAAK,UAAU,EACf,KAAK,QAAQ,CACf,CAEQ,mBAAmBC,EAAuB,CAChD,KAAK,OAASA,EACdC,EAAmBD,CAAM,CAC3B,CACF",
|
|
6
|
+
"names": ["SidePanelBaseManager", "UIBaseManager", "uiDataUpdateEvent", "uiTag", "isOpen", "setIsSidePanelOpen"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-LEBVS2YF.mjs";import{a as p}from"./chunk-IEWH5GDM.mjs";import{a as d}from"./chunk-XBVPYKPZ.mjs";import{a as T}from"./chunk-LUDF7ZUR.mjs";var f=a=>a.sort((i,o)=>o.timestamp-i.timestamp),H=async({transactions:a,address:i,explorerAddress:o,egldLabel:g})=>{let e=[],r=[];if(a.forEach(s=>{let t=d(s.hash);t?e.push(t):r.push(s.hash)}),r.length===0)return f(e);let c=await h(r),I=c.map(s=>s.txHash),m=r.filter(s=>!I.includes(s));if(m.length>0){let t=a.filter(n=>m.includes(n.hash)).map(n=>({...n,txHash:n.hash,price:0,status:"pending",gasUsed:0,miniBlockHash:"",receiverShard:0,round:0,senderShard:0,timestamp:Date.now()}));c.push(...t)}return c.forEach(s=>{let t=T({transaction:s,address:i,explorerAddress:o,egldLabel:g});t.status!=="pending"&&p({key:`transaction-${s.txHash}`,value:t}),e.push(t)}),f(e)};export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3RBYJZII.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-SPSO2A53.mjs";import{a}from"./chunk-FKBLKOLI.mjs";import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-SPSO2A53.mjs";import{a}from"./chunk-FKBLKOLI.mjs";import{a as t}from"./chunk-DCCGXGUQ.mjs";import{u as n}from"./chunk-PGOE5XGR.mjs";import{b as e}from"./chunk-SAAOQW7P.mjs";var S=async r=>{let{isGuarded:i}=t();if(!a({isGuarded:i,transactions:r}))return r;let d=r[0].getSender().bech32().toString(),{walletAddress:c}=e(n()),o=await s({address:d,walletUrl:c});return o?.setShouldShowConsentPopup(!1),await o?.guardTransactions(r)||[]};export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3UIJI5YR.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as h}from"./chunk-L4762ZRT.mjs";import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as f}from"./chunk-Y3BNMQFP.mjs";import{h as l}from"./chunk-QNKYH6KO.mjs";import{h as d}from"./chunk-CAA4VJRH.mjs";import{b as g}from"./chunk-3ZEUVYQF.mjs";import{a as y}from"./chunk-DCCGXGUQ.mjs";import{a as u}from"./chunk-GXUJBKWY.mjs";import{a as m}from"./chunk-L3MWDI6J.mjs";import{u as p}from"./chunk-PGOE5XGR.mjs";import{b as c}from"./chunk-SAAOQW7P.mjs";import{e as T}from"./chunk-R53MCZI6.mjs";import b from"axios";var r=class r{constructor(){this.setCallbacks=({onSuccess:a,onFail:t})=>{g({onSuccess:a,onFail:t})};this.send=async a=>{if(a.length===0)throw new Error("No transactions to send");try{if(!S(a))return await this.sendSignedTransactions(a);let t=await this.sendSignedBatchTransactions(a);if(!t.data||t.data.error)throw new Error(t.data?.error??"Failed to send transactions");return t.data.transactions}catch(t){throw t.response?.data?.message??t.message}};this.track=async(a,t={disableToasts:!1})=>{let n=this.sequentialToFlatArray(a).map(i=>({...i,status:i.status??"pending"})),e=m(n),o=u({transactions:n,transactionsDisplayInfo:t.transactionsDisplayInfo,status:e??"sent",sessionInformation:t.sessionInformation});if(t.disableToasts===!0)return o;let s=h(a);return l({toastId:o,totalDuration:s}),o};this.sendSignedTransactions=async a=>{let{apiAddress:t,apiTimeout:n}=c(p()),e=a.map(s=>b.post(`${t}/transactions`,s.toPlainObject(),{timeout:Number(n)}));return(await Promise.all(e)).map(({data:s})=>({...s,status:"pending",hash:s.txHash}))};this.sendSignedBatchTransactions=async a=>{let{address:t}=y(),{apiAddress:n,apiTimeout:e}=c(p());if(!t)return{error:"Invalid address provided. You need to be logged in to send transactions"};let o=this.buildBatchId(t),i={transactions:a.map(w=>w.map(v=>this.parseSignedTransaction(v))),id:o},{data:A}=await b.post(`${n}/batch`,i,{timeout:Number(e)});return{data:A}};this.buildBatchId=a=>`${Date.now().toString()}${d}${a}`;this.sequentialToFlatArray=(a=[])=>this.getIsSequential(a)?a.flat():a;this.getIsSequential=a=>a?.every(t=>Array.isArray(t));this.parseSignedTransaction=a=>{let t=new T,n={...a.toPlainObject(),hash:t.computeTransactionHash(a),status:"pending"};return f({data:n.data})&&(delete n.senderUsername,delete n.receiverUsername),n}}static getInstance(){return r.instance||(r.instance=new r),r.instance}};r.instance=null;var I=r;export{I as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3XCB5CEW.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/managers/TransactionManager/TransactionManager.ts"],
|
|
4
|
+
"sourcesContent": ["import axios, { AxiosError } from 'axios';\nimport { BATCH_TRANSACTIONS_ID_SEPARATOR } from 'constants/transactions.constants';\nimport { Transaction, TransactionComputer } from 'lib/sdkCore';\nimport { getAccount } from 'methods/account/getAccount';\nimport { TransactionTrackingConfigType } from 'methods/initApp/initApp.types';\nimport { addTransactionToast } from 'store/actions/toasts/toastsActions';\nimport { createTransactionsSession } from 'store/actions/transactions/transactionsActions';\nimport { networkSelector } from 'store/selectors';\nimport { getState } from 'store/store';\nimport {\n TransactionBatchStatusesEnum,\n TransactionServerStatusesEnum\n} from 'types/enums.types';\nimport { BatchTransactionsResponseType } from 'types/serverTransactions.types';\nimport { SignedTransactionType } from 'types/transactions.types';\nimport { isGuardianTx } from 'utils/transactions/isGuardianTx';\nimport { getToastDuration } from './helpers/getToastDuration';\nimport { getTransactionsSessionStatus } from './helpers/getTransactionsStatus';\nimport { isBatchTransaction } from './helpers/isBatchTransaction';\nimport { registerSessionCallbacks } from './helpers/sessionCallbacks';\nimport { TransactionManagerTrackOptionsType } from './TransactionManager.types';\n\nexport class TransactionManager {\n private static instance: TransactionManager | null = null;\n\n public static getInstance(): TransactionManager {\n if (!TransactionManager.instance) {\n TransactionManager.instance = new TransactionManager();\n }\n return TransactionManager.instance;\n }\n\n /**\n * Set callbacks to be executed when the transaction session is successful or fails.\n * @param onSuccess - The callback to run when the transaction session is successful.\n * @param onFail - The callback to run when the transaction session fails.\n * @example\n * ```ts\n * TransactionManager.setCallbacks({\n * onSuccess: (sessionId) => {\n * console.log('Transaction session successful', sessionId);\n * },\n * });\n */\n public setCallbacks = ({\n onSuccess,\n onFail\n }: TransactionTrackingConfigType) => {\n registerSessionCallbacks({ onSuccess, onFail });\n };\n\n public send = async (\n signedTransactions: Transaction[] | Transaction[][]\n ): Promise<SignedTransactionType[] | SignedTransactionType[][]> => {\n if (signedTransactions.length === 0) {\n throw new Error('No transactions to send');\n }\n\n try {\n if (!isBatchTransaction(signedTransactions)) {\n const flatTransactions =\n await this.sendSignedTransactions(signedTransactions);\n\n return flatTransactions;\n }\n\n const sentTransactions =\n await this.sendSignedBatchTransactions(signedTransactions);\n\n if (!sentTransactions.data || sentTransactions.data.error) {\n throw new Error(\n sentTransactions.data?.error ?? 'Failed to send transactions'\n );\n }\n\n const groupedTransactions = sentTransactions.data.transactions;\n\n return groupedTransactions;\n } catch (error) {\n const responseData = <{ message: string }>(\n (error as AxiosError).response?.data\n );\n throw responseData?.message ?? (error as any).message;\n }\n };\n\n public track = async (\n sentTransactions: SignedTransactionType[] | SignedTransactionType[][],\n options: TransactionManagerTrackOptionsType = { disableToasts: false }\n ): Promise<string> => {\n const flatTransactions = this.sequentialToFlatArray(sentTransactions).map(\n (transaction) => ({\n ...transaction,\n status: transaction.status ?? TransactionServerStatusesEnum.pending\n })\n );\n\n const status = getTransactionsSessionStatus(flatTransactions);\n\n const sessionId = createTransactionsSession({\n transactions: flatTransactions,\n transactionsDisplayInfo: options.transactionsDisplayInfo,\n status: status ?? TransactionBatchStatusesEnum.sent,\n sessionInformation: options.sessionInformation\n });\n\n if (options.disableToasts === true) {\n return sessionId;\n }\n\n const totalDuration = getToastDuration(sentTransactions);\n addTransactionToast({\n toastId: sessionId,\n totalDuration\n });\n\n return sessionId;\n };\n\n private readonly sendSignedTransactions = async (\n signedTransactions: Transaction[]\n ): Promise<SignedTransactionType[]> => {\n const { apiAddress, apiTimeout } = networkSelector(getState());\n\n const promises = signedTransactions.map((transaction) =>\n axios.post(`${apiAddress}/transactions`, transaction.toPlainObject(), {\n timeout: Number(apiTimeout)\n })\n );\n\n const response = await Promise.all(promises);\n\n return response.map(({ data }) => ({\n ...data,\n status: TransactionServerStatusesEnum.pending,\n hash: data.txHash\n }));\n };\n\n private readonly sendSignedBatchTransactions = async (\n signedTransactions: Transaction[][]\n ) => {\n const { address } = getAccount();\n const { apiAddress, apiTimeout } = networkSelector(getState());\n\n if (!address) {\n return {\n error:\n 'Invalid address provided. You need to be logged in to send transactions'\n };\n }\n\n const batchId = this.buildBatchId(address);\n const parsedTransactions = signedTransactions.map((transactions) =>\n transactions.map((transaction) =>\n this.parseSignedTransaction(transaction)\n )\n );\n\n const payload = {\n transactions: parsedTransactions,\n id: batchId\n };\n\n const { data } = await axios.post<BatchTransactionsResponseType>(\n `${apiAddress}/batch`,\n payload,\n {\n timeout: Number(apiTimeout)\n }\n );\n\n return { data };\n };\n\n private readonly buildBatchId = (address: string) => {\n const sessionId = Date.now().toString();\n return `${sessionId}${BATCH_TRANSACTIONS_ID_SEPARATOR}${address}`;\n };\n private readonly sequentialToFlatArray = (\n transactions: SignedTransactionType[] | SignedTransactionType[][] = []\n ) =>\n this.getIsSequential(transactions)\n ? transactions.flat()\n : (transactions as SignedTransactionType[]);\n\n private readonly getIsSequential = (\n transactions?: SignedTransactionType[] | SignedTransactionType[][]\n ) => transactions?.every((transaction) => Array.isArray(transaction));\n\n private readonly parseSignedTransaction = (\n signedTransaction: Transaction\n ): SignedTransactionType => {\n const transactionComputer = new TransactionComputer();\n\n const parsedTransaction = {\n ...signedTransaction.toPlainObject(),\n hash: transactionComputer.computeTransactionHash(signedTransaction),\n status: TransactionServerStatusesEnum.pending\n };\n\n // Remove when the protocol supports usernames for guardian transactions\n if (isGuardianTx({ data: parsedTransaction.data })) {\n delete parsedTransaction.senderUsername;\n delete parsedTransaction.receiverUsername;\n }\n\n return parsedTransaction;\n };\n}\n"],
|
|
5
|
+
"mappings": "4eAAA,OAAOA,MAA2B,QAsB3B,IAAMC,EAAN,MAAMA,CAAmB,CAAzB,cAsBL,KAAO,aAAe,CAAC,CACrB,UAAAC,EACA,OAAAC,CACF,IAAqC,CACnCC,EAAyB,CAAE,UAAAF,EAAW,OAAAC,CAAO,CAAC,CAChD,EAEA,KAAO,KAAO,MACZE,GACiE,CACjE,GAAIA,EAAmB,SAAW,EAChC,MAAM,IAAI,MAAM,yBAAyB,EAG3C,GAAI,CACF,GAAI,CAACC,EAAmBD,CAAkB,EAIxC,OAFE,MAAM,KAAK,uBAAuBA,CAAkB,EAKxD,IAAME,EACJ,MAAM,KAAK,4BAA4BF,CAAkB,EAE3D,GAAI,CAACE,EAAiB,MAAQA,EAAiB,KAAK,MAClD,MAAM,IAAI,MACRA,EAAiB,MAAM,OAAS,6BAClC,EAKF,OAF4BA,EAAiB,KAAK,YAGpD,OAASC,EAAO,CAId,MAFGA,EAAqB,UAAU,MAEd,SAAYA,EAAc,OAChD,CACF,EAEA,KAAO,MAAQ,MACbD,EACAE,EAA8C,CAAE,cAAe,EAAM,IACjD,CACpB,IAAMC,EAAmB,KAAK,sBAAsBH,CAAgB,EAAE,IACnEI,IAAiB,CAChB,GAAGA,EACH,OAAQA,EAAY,iBACtB,EACF,EAEMC,EAASC,EAA6BH,CAAgB,EAEtDI,EAAYC,EAA0B,CAC1C,aAAcL,EACd,wBAAyBD,EAAQ,wBACjC,OAAQG,UACR,mBAAoBH,EAAQ,kBAC9B,CAAC,EAED,GAAIA,EAAQ,gBAAkB,GAC5B,OAAOK,EAGT,IAAME,EAAgBC,EAAiBV,CAAgB,EACvD,OAAAW,EAAoB,CAClB,QAASJ,EACT,cAAAE,CACF,CAAC,EAEMF,CACT,EAEA,KAAiB,uBAAyB,MACxCT,GACqC,CACrC,GAAM,CAAE,WAAAc,EAAY,WAAAC,CAAW,EAAIC,EAAgBC,EAAS,CAAC,EAEvDC,EAAWlB,EAAmB,IAAKM,GACvCa,EAAM,KAAK,GAAGL,CAAU,gBAAiBR,EAAY,cAAc,EAAG,CACpE,QAAS,OAAOS,CAAU,CAC5B,CAAC,CACH,EAIA,OAFiB,MAAM,QAAQ,IAAIG,CAAQ,GAE3B,IAAI,CAAC,CAAE,KAAAE,CAAK,KAAO,CACjC,GAAGA,EACH,iBACA,KAAMA,EAAK,MACb,EAAE,CACJ,EAEA,KAAiB,4BAA8B,MAC7CpB,GACG,CACH,GAAM,CAAE,QAAAqB,CAAQ,EAAIC,EAAW,EACzB,CAAE,WAAAR,EAAY,WAAAC,CAAW,EAAIC,EAAgBC,EAAS,CAAC,EAE7D,GAAI,CAACI,EACH,MAAO,CACL,MACE,yEACJ,EAGF,IAAME,EAAU,KAAK,aAAaF,CAAO,EAOnCG,EAAU,CACd,aAPyBxB,EAAmB,IAAKyB,GACjDA,EAAa,IAAKnB,GAChB,KAAK,uBAAuBA,CAAW,CACzC,CACF,EAIE,GAAIiB,CACN,EAEM,CAAE,KAAAH,CAAK,EAAI,MAAMD,EAAM,KAC3B,GAAGL,CAAU,SACbU,EACA,CACE,QAAS,OAAOT,CAAU,CAC5B,CACF,EAEA,MAAO,CAAE,KAAAK,CAAK,CAChB,EAEA,KAAiB,aAAgBC,GAExB,GADW,KAAK,IAAI,EAAE,SAAS,CACnB,GAAGK,CAA+B,GAAGL,CAAO,GAEjE,KAAiB,sBAAwB,CACvCI,EAAoE,CAAC,IAErE,KAAK,gBAAgBA,CAAY,EAC7BA,EAAa,KAAK,EACjBA,EAEP,KAAiB,gBACfA,GACGA,GAAc,MAAOnB,GAAgB,MAAM,QAAQA,CAAW,CAAC,EAEpE,KAAiB,uBACfqB,GAC0B,CAC1B,IAAMC,EAAsB,IAAIC,EAE1BC,EAAoB,CACxB,GAAGH,EAAkB,cAAc,EACnC,KAAMC,EAAoB,uBAAuBD,CAAiB,EAClE,gBACF,EAGA,OAAII,EAAa,CAAE,KAAMD,EAAkB,IAAK,CAAC,IAC/C,OAAOA,EAAkB,eACzB,OAAOA,EAAkB,kBAGpBA,CACT,EAvLA,OAAc,aAAkC,CAC9C,OAAKlC,EAAmB,WACtBA,EAAmB,SAAW,IAAIA,GAE7BA,EAAmB,QAC5B,CAmLF,EA3LaA,EACI,SAAsC,KADhD,IAAMoC,EAANpC",
|
|
6
|
+
"names": ["axios", "_TransactionManager", "onSuccess", "onFail", "registerSessionCallbacks", "signedTransactions", "isBatchTransaction", "sentTransactions", "error", "options", "flatTransactions", "transaction", "status", "getTransactionsSessionStatus", "sessionId", "createTransactionsSession", "totalDuration", "getToastDuration", "addTransactionToast", "apiAddress", "apiTimeout", "networkSelector", "getState", "promises", "axios", "data", "address", "getAccount", "batchId", "payload", "transactions", "BATCH_TRANSACTIONS_ID_SEPARATOR", "signedTransaction", "transactionComputer", "TransactionComputer", "parsedTransaction", "isGuardianTx", "TransactionManager"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{u as r}from"./chunk-PGOE5XGR.mjs";import{b as e}from"./chunk-SAAOQW7P.mjs";var d=s=>{let o=e(r()),t=s??o.apiAddress;return t.endsWith("/")?t.slice(0,-1):t};export{d as a};
|
|
2
|
+
//# sourceMappingURL=chunk-53JZ6ZBD.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-3RBYJZII.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-57B6Q67I.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as s}from"./chunk-VO4DXDYI.mjs";import{a as p}from"./chunk-3ATEIVW3.mjs";import{u as c}from"./chunk-PGOE5XGR.mjs";import{b as d}from"./chunk-SAAOQW7P.mjs";import{a as v}from"./chunk-REI3WYXH.mjs";import{a}from"./chunk-OJV6XRG5.mjs";var n=class n extends p{constructor(){super({uiTag:"mvx-unlock-panel",uiDataUpdateEvent:"OPEN"});this.initialData={providers:null,walletAddress:null};this.openUnlockPanel=async()=>{let{walletAddress:e}=d(c());this.data={providers:this.getProvidersList(),walletAddress:e},await this.openUI(),this.notifyDataUpdate()};this.setupEventListeners=async()=>{this.eventBus&&(this.subscribeToEventBus("LOGIN",this.handleLogin),this.subscribeToEventBus("CANCEL_LOGIN",this.handleCancelLogin),this.subscribeToEventBus("CLOSE",this.handleCloseUI))};this.handleCloseUI=async e=>{!e?.isLoginFinished&&n.onClose&&n.onClose(),this.closeUI()};this.handleLogin=async({type:e,anchor:o})=>{if(!n.loginHandler)throw new Error("Login callback not initialized. Please call `init()` first.");try{this.isSimpleLoginCallback(n.loginHandler)?(await(await s.create({type:e,anchor:o})).login(),n.loginHandler()):n.loginHandler({type:e,anchor:o}),await this.handleCloseUI({isLoginFinished:!0})}catch(r){console.error(r),this.eventBus?.publish("CANCEL_IN_PROVIDER",this.data)}};this.handleCancelLogin=async()=>{await s.destroy()};this.isSimpleLoginCallback=e=>e.length===0;this.data=this.initialData}static getInstance(){return n.instance||(n.instance=new n),n.instance}static init(e){return this.loginHandler=e.loginHandler,this.allowedProviders=e.allowedProviders,e.onClose&&(this.onClose=e.onClose),this.getInstance()}getProvidersList(){let e=s.customProviders,r=[...Object.values(a).filter(i=>i!==a.none&&i!==a.webview),...e.map(i=>i.type)],P=e.reduce((i,t)=>(i[t.type]=t.name,i),{}),l={...v,...P};return(n.allowedProviders?n?.allowedProviders.map(i=>i.type).filter(i=>r.includes(i)):r).map(i=>{let t=e.find(g=>g.type===i);return t||{name:i in l?l[i]:i,type:i}})}};n.loginHandler=null,n.onClose=null,n.allowedProviders=null;var u=n;export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5V5MG3BL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-EUXN5BLO.mjs";var t={closeConnectionRef:void 0};async function c(n){let{closeConnection:o}=await e(n);t.closeConnectionRef=o}export{t as a,c as b};
|
|
2
|
+
//# sourceMappingURL=chunk-65RXDHRY.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-AGHFAZ7O.mjs";import{a as f}from"./chunk-FRDR4A7Z.mjs";import{t as c}from"./chunk-QNKYH6KO.mjs";import{u as n}from"./chunk-PGOE5XGR.mjs";import{e as l}from"./chunk-VNLGNNIL.mjs";import{g as a}from"./chunk-QJSB5NX4.mjs";import{HWProvider as m}from"@multiversx/sdk-hw-provider";async function A(u){let v=g(),d=u?.shouldInitProvider||!v,o=l(n()),t=a(n()),r=c(),i=new m,I=async()=>{let e=o?.index!=null;if(r instanceof m&&r.isInitialized())return e&&await r.setAddressIndex(o.index),r;if(d&&!await i.init())throw new Error("Failed to initialize Ledger Provider");return e&&await i.setAddressIndex(o.index),i};try{if(!d&&t)return{ledgerProvider:i,ledgerConfig:{version:t.version,dataEnabled:t.hasContractDataEnabled}};let e=await I(),s=await f(e);return{ledgerProvider:e,ledgerConfig:s}}catch(e){throw console.error("Could not initialize ledger app",e),e}}export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6H5TKCEW.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"bignumber.js";var a=t=>{let i=new e(t).dividedBy(1e3).integerValue(e.ROUND_FLOOR),n=new e(i).dividedBy(60).integerValue(e.ROUND_FLOOR),r=new e(n).dividedBy(60).integerValue(e.ROUND_FLOOR),o=r.modulo(60).isGreaterThan(1),u=n.modulo(60).isGreaterThan(1),s=n.modulo(60).isLessThan(1);return o?`${r} hours`:u?`${n} minutes`:s?"less than 1 minute":`${n} minute`};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-6UZHM5LW.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/managers/LogoutManager/helpers/getHumanReadableTokenExpirationTime.ts"],
|
|
4
|
+
"sourcesContent": ["import BigNumber from 'bignumber.js';\n\nexport const getHumanReadableTokenExpirationTime = (milliseconds: number) => {\n const seconds = new BigNumber(milliseconds)\n .dividedBy(1000)\n .integerValue(BigNumber.ROUND_FLOOR);\n\n const minutes = new BigNumber(seconds)\n .dividedBy(60)\n .integerValue(BigNumber.ROUND_FLOOR);\n\n const hours = new BigNumber(minutes)\n .dividedBy(60)\n .integerValue(BigNumber.ROUND_FLOOR);\n\n const overOneHour = hours.modulo(60).isGreaterThan(1);\n const overOneMinute = minutes.modulo(60).isGreaterThan(1);\n const underOneMinute = minutes.modulo(60).isLessThan(1);\n\n if (overOneHour) {\n return `${hours} hours`;\n }\n\n if (overOneMinute) {\n return `${minutes} minutes`;\n }\n\n if (underOneMinute) {\n return 'less than 1 minute';\n }\n\n return `${minutes} minute`;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAe,eAEf,IAAMC,EAAuCC,GAAyB,CAC3E,IAAMC,EAAU,IAAIH,EAAUE,CAAY,EACvC,UAAU,GAAI,EACd,aAAaF,EAAU,WAAW,EAE/BI,EAAU,IAAIJ,EAAUG,CAAO,EAClC,UAAU,EAAE,EACZ,aAAaH,EAAU,WAAW,EAE/BK,EAAQ,IAAIL,EAAUI,CAAO,EAChC,UAAU,EAAE,EACZ,aAAaJ,EAAU,WAAW,EAE/BM,EAAcD,EAAM,OAAO,EAAE,EAAE,cAAc,CAAC,EAC9CE,EAAgBH,EAAQ,OAAO,EAAE,EAAE,cAAc,CAAC,EAClDI,EAAiBJ,EAAQ,OAAO,EAAE,EAAE,WAAW,CAAC,EAEtD,OAAIE,EACK,GAAGD,CAAK,SAGbE,EACK,GAAGH,CAAO,WAGfI,EACK,qBAGF,GAAGJ,CAAO,SACnB",
|
|
6
|
+
"names": ["BigNumber", "getHumanReadableTokenExpirationTime", "milliseconds", "seconds", "minutes", "hours", "overOneHour", "overOneMinute", "underOneMinute"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-2ZNIPYEV.mjs";import{c as o,g as n}from"./chunk-R53MCZI6.mjs";import{a as r}from"./chunk-OJV6XRG5.mjs";async function M({message:i,provider:s,options:e}){let t=a(),d=new n({address:new o(t),data:i.data});return e?.hasConsentPopup&&s.getType()===r.crossWindow&&s.setShouldShowConsentPopup(!0),await s.signMessage(d,e)}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-77IZTIMY.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{s as c}from"./chunk-PGOE5XGR.mjs";import{a as o}from"./chunk-BRBIUWAW.mjs";var r=e=>{c().setState(({account:t})=>{let s=t.address===e.address;t.accounts={[t.address]:s?e:o}},!1,"setAccount")},u=e=>c().setState(({account:t})=>{t.ledgerAccount=e},!1,"setLedgerAccount"),p=e=>c().setState(({account:t})=>{t.walletConnectAccount=e},!1,"setWalletConnectAccount"),l=e=>c().setState(({account:t})=>{t.websocketEvent={timestamp:Date.now(),message:e}},!1,"setWebsocketEvent"),m=e=>c().setState(({account:t})=>{t.websocketBatchEvent={timestamp:Date.now(),data:e}},!1,"setWebsocketBatchEvent"),A=e=>{c().setState(({account:t})=>{t.accounts[t.address].nonce=e},!1,"setAccountNonce")};export{r as a,u as b,p as c,l as d,m as e,A as f};
|
|
2
|
+
//# sourceMappingURL=chunk-A343RP4X.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-3ATEIVW3.mjs";import{c as e}from"./chunk-MGFIOCA4.mjs";var o=class i extends s{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE_SIGN_TRANSACTIONS",uiTag:"mvx-sign-transactions-panel"});this.addressesPerPage=10;this._ppuMap={};this.initialData={commonData:{transactionsCount:0,currentIndexToSign:0,egldLabel:"",currentIndex:0,ppuOptions:[],address:"",origin:""},tokenTransaction:null,nftTransaction:null,sftTransaction:null};this.data={...this.initialData}}static getInstance(){return i.instance||(i.instance=new i),i.instance}get transactionsCount(){return this.data.commonData.transactionsCount}initializeGasPriceMap(a){let t=0;a.filter(n=>n!=null).forEach(n=>{let r=n?Number(n.gasPrice):0;this.updateGasPriceMap({nonce:Number(n.nonce),ppu:t,initialGasPrice:r})}),this.updateCommonData({ppu:t})}updateGasPriceMap({nonce:a,ppu:t,initialGasPrice:n}){this._ppuMap[a]={...this._ppuMap[a],ppu:t},n&&(this._ppuMap[a].initialGasPrice=n)}updateCommonData(a){this.data.commonData={...this.data.commonData,...a},this.notifyDataUpdate()}updateIsLoading(a){this.data.isLoading=a,this.notifyDataUpdate()}updateTokenTransaction(a){this.data.tokenTransaction=a,this.data.sftTransaction=null,this.data.nftTransaction=null,this.notifyDataUpdate()}updateNonFungibleTransaction(a,t){switch(a){case"NonFungibleESDT":this.data.nftTransaction=t,this.data.tokenTransaction=null,this.data.sftTransaction=null;break;case"SemiFungibleESDT":this.data.sftTransaction=t,this.data.nftTransaction=null,this.data.tokenTransaction=null;break;default:break}this.notifyDataUpdate()}get currentScreenIndex(){return this.data.commonData.currentIndex}get ppuMap(){return this._ppuMap}async setupEventListeners(){this.eventBus&&this.subscribeToEventBus("CLOSE_SIGN_TRANSACTIONS",this.closeUI.bind(this))}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-AKFSBZ46.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-3ATEIVW3.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-AM6BSOYA.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-EKMRPW2A.mjs";var a=class{constructor({uiDataUpdateEvent:t,uiTag:e}){this.eventBus=null;this.uiElement=null;this.isCreatingElement=!1;this.unsubscribeFunctions=new Map;this.uiDataUpdateEvent=t,this.uiTag=e,this.data=this.getInitialData()}async init(t){this.anchor=t,await this.createUIElement(t),await this.setupEventListeners()}updateData(t){this.data={...this.data,...t},this.notifyDataUpdate()}subscribeToEventBus(t,e){if(!this.eventBus)throw new Error("eventBus is not initialized");let i=this.eventBus?.subscribe(t,e);if(i){let n=this.unsubscribeFunctions.get(t)||[];n.push(i),this.unsubscribeFunctions.set(t,n)}}notifyDataUpdate(){this.eventBus?.publish(this.uiDataUpdateEvent,this.data)}destroy(){this.unsubscribeFunctions.forEach(t=>t.forEach(e=>e())),this.unsubscribeFunctions.clear(),this.eventBus=null,this.uiElement?.remove(),this.uiElement=null}getInitialData(){return this.initialData}resetData(){this.data=this.getInitialData()}async createUIElement(t=this.anchor){if(this.isCreatingElement||this.uiElement)return this.uiElement;if(this.isCreatingElement=!0,this.uiElement=await s.create({name:this.uiTag,anchor:t}),this.isCreatingElement=!1,!this.uiElement)throw new Error(`Failed to create ${this.uiTag} element`);if(this.eventBus||(this.eventBus=await this.uiElement.getEventBus()),!this.eventBus)throw new Error("eventBus is not initialized");return this.uiElement}};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-AQ3VAQH3.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/managers/internal/UIBaseManager/UIBaseManager.ts"],
|
|
4
|
+
"sourcesContent": ["import { UITagsEnum } from 'constants/UITags.enum';\nimport { IEventBus } from 'lib/sdkDappUi';\nimport { ProviderErrorsEnum } from 'types/provider.types';\nimport {\n ComponentFactory,\n CreateEventBusUIElementType\n} from 'utils/ComponentFactory';\n\nexport abstract class UIBaseManager<\n TElement extends CreateEventBusUIElementType,\n TData extends Record<string, any> | null,\n TEventEnum extends string\n> {\n protected eventBus: IEventBus | null = null;\n protected uiElement: TElement | null = null;\n protected isCreatingElement = false;\n protected anchor?: HTMLElement;\n protected uiTag: UITagsEnum;\n protected uiDataUpdateEvent: TEventEnum;\n protected unsubscribeFunctions: Map<TEventEnum, (() => void)[]> = new Map();\n protected abstract initialData: TData;\n protected data: TData;\n\n constructor({\n uiDataUpdateEvent,\n uiTag\n }: {\n uiTag: UITagsEnum;\n uiDataUpdateEvent: TEventEnum;\n }) {\n this.uiDataUpdateEvent = uiDataUpdateEvent;\n this.uiTag = uiTag;\n this.data = this.getInitialData();\n }\n\n public async init(anchor?: HTMLElement) {\n this.anchor = anchor;\n await this.createUIElement(anchor);\n await this.setupEventListeners();\n }\n\n public updateData(newData: Partial<TData>) {\n this.data = { ...this.data, ...newData };\n this.notifyDataUpdate();\n }\n\n public subscribeToEventBus(event: TEventEnum, callback: Function) {\n if (!this.eventBus) {\n throw new Error(ProviderErrorsEnum.eventBusError);\n }\n\n const unsubscribe = this.eventBus?.subscribe(event, callback);\n if (unsubscribe) {\n const existing = this.unsubscribeFunctions.get(event) || [];\n existing.push(unsubscribe);\n this.unsubscribeFunctions.set(event, existing);\n }\n }\n\n public notifyDataUpdate() {\n this.eventBus?.publish(this.uiDataUpdateEvent, this.data);\n }\n\n protected destroy() {\n this.unsubscribeFunctions.forEach((unsubList) =>\n unsubList.forEach((unsubscribe) => unsubscribe())\n );\n this.unsubscribeFunctions.clear();\n this.eventBus = null;\n this.uiElement?.remove();\n this.uiElement = null;\n }\n\n protected getInitialData(): TData {\n return this.initialData;\n }\n\n protected resetData() {\n this.data = this.getInitialData();\n }\n\n protected abstract setupEventListeners(): Promise<void>;\n\n private async createUIElement(\n anchor: HTMLElement | undefined = this.anchor\n ): Promise<TElement | null> {\n if (this.isCreatingElement || this.uiElement) {\n return this.uiElement;\n }\n\n this.isCreatingElement = true;\n\n this.uiElement = await ComponentFactory.create<TElement>({\n name: this.uiTag,\n anchor\n });\n\n this.isCreatingElement = false;\n\n if (!this.uiElement) {\n throw new Error(`Failed to create ${this.uiTag} element`);\n }\n\n if (!this.eventBus) {\n this.eventBus = await this.uiElement.getEventBus();\n }\n\n if (!this.eventBus) {\n throw new Error(ProviderErrorsEnum.eventBusError);\n }\n\n return this.uiElement;\n }\n}\n"],
|
|
5
|
+
"mappings": "yCAQO,IAAeA,EAAf,KAIL,CAWA,YAAY,CACV,kBAAAC,EACA,MAAAC,CACF,EAGG,CAhBH,KAAU,SAA6B,KACvC,KAAU,UAA6B,KACvC,KAAU,kBAAoB,GAI9B,KAAU,qBAAwD,IAAI,IAWpE,KAAK,kBAAoBD,EACzB,KAAK,MAAQC,EACb,KAAK,KAAO,KAAK,eAAe,CAClC,CAEA,MAAa,KAAKC,EAAsB,CACtC,KAAK,OAASA,EACd,MAAM,KAAK,gBAAgBA,CAAM,EACjC,MAAM,KAAK,oBAAoB,CACjC,CAEO,WAAWC,EAAyB,CACzC,KAAK,KAAO,CAAE,GAAG,KAAK,KAAM,GAAGA,CAAQ,EACvC,KAAK,iBAAiB,CACxB,CAEO,oBAAoBC,EAAmBC,EAAoB,CAChE,GAAI,CAAC,KAAK,SACR,MAAM,IAAI,mCAAsC,EAGlD,IAAMC,EAAc,KAAK,UAAU,UAAUF,EAAOC,CAAQ,EAC5D,GAAIC,EAAa,CACf,IAAMC,EAAW,KAAK,qBAAqB,IAAIH,CAAK,GAAK,CAAC,EAC1DG,EAAS,KAAKD,CAAW,EACzB,KAAK,qBAAqB,IAAIF,EAAOG,CAAQ,CAC/C,CACF,CAEO,kBAAmB,CACxB,KAAK,UAAU,QAAQ,KAAK,kBAAmB,KAAK,IAAI,CAC1D,CAEU,SAAU,CAClB,KAAK,qBAAqB,QAASC,GACjCA,EAAU,QAASF,GAAgBA,EAAY,CAAC,CAClD,EACA,KAAK,qBAAqB,MAAM,EAChC,KAAK,SAAW,KAChB,KAAK,WAAW,OAAO,EACvB,KAAK,UAAY,IACnB,CAEU,gBAAwB,CAChC,OAAO,KAAK,WACd,CAEU,WAAY,CACpB,KAAK,KAAO,KAAK,eAAe,CAClC,CAIA,MAAc,gBACZJ,EAAkC,KAAK,OACb,CAC1B,GAAI,KAAK,mBAAqB,KAAK,UACjC,OAAO,KAAK,UAYd,GATA,KAAK,kBAAoB,GAEzB,KAAK,UAAY,MAAMO,EAAiB,OAAiB,CACvD,KAAM,KAAK,MACX,OAAAP,CACF,CAAC,EAED,KAAK,kBAAoB,GAErB,CAAC,KAAK,UACR,MAAM,IAAI,MAAM,oBAAoB,KAAK,KAAK,UAAU,EAO1D,GAJK,KAAK,WACR,KAAK,SAAW,MAAM,KAAK,UAAU,YAAY,GAG/C,CAAC,KAAK,SACR,MAAM,IAAI,mCAAsC,EAGlD,OAAO,KAAK,SACd,CACF",
|
|
6
|
+
"names": ["UIBaseManager", "uiDataUpdateEvent", "uiTag", "anchor", "newData", "event", "callback", "unsubscribe", "existing", "unsubList", "ComponentFactory"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{h}from"./chunk-OEPTRJEB.mjs";import{a as
|
|
1
|
+
import{h}from"./chunk-OEPTRJEB.mjs";import{a as D}from"./chunk-HH5SA7BX.mjs";import{a as f,b as m}from"./chunk-WRLZ5ICK.mjs";import{a as g}from"./chunk-I3MK6KZJ.mjs";import{Address as V}from"@multiversx/sdk-core";import y from"bignumber.js";var x=e=>{let r=[];return e&&!f(e)&&r.push(`Invalid Hex characters on argument @${e}`),e&&!m(e)&&r.push(`Odd number of Hex characters on argument @${e}`),r},a=(e,r,n)=>{switch(r){case"text":try{return Buffer.from(e,"hex").toString("utf8")}catch{return e}case"decimal":return e!==""?new y(e,16).toString(10):"";case"smart":try{let t=V.newFromHex(e).toString();if(g(t))return t}catch{}try{let t=Buffer.from(e,"hex").toString("utf8");if(D(t))return t;{if(n&&[...n.esdts,...n.nfts].some(s=>t.includes(s)))return t;let i=new y(e,16);return i.isFinite()?i.toString(10):e}}catch{return e}case"raw":default:return e}},P=({parts:e,decodedParts:r,identifier:n})=>{let t=[...r];if(e[0]==="ESDTNFTTransfer"&&e[2]&&(t[2]=a(e[2],"decimal")),n==="ESDTNFTTransfer"&&e[1]){let i=Buffer.from(String(e[1]),"base64");t[1]=a(i.toString("hex"),"decimal")}return t},E=({parts:e,decodeMethod:r,identifier:n,decodedData:t})=>{let i=e.map((s,d)=>{if(e.length>=2&&(d===0&&s.length<64||d===1&&!e[0]))return/[^a-z0-9]/gi.test(s)?a(s,r):s;let c=x(s);return c?.length&&(t.validationWarnings=Array.from(new Set([...t.validationWarnings,...c]))),a(s,r)});return r==="smart"?P({parts:e,decodedParts:i,identifier:n}):i},T=({parts:e,decodeMethod:r,identifier:n,initialDecodedParts:t})=>r==="smart"?P({parts:e,decodedParts:t,identifier:n}):t,p=({data:e,identifier:r,decodeMethod:n,delimiter:t})=>{let i=e.split("@"),o=i.map(d=>a(d,n));return T({parts:i,initialDecodedParts:o,identifier:r,decodeMethod:n}).join(t)},H=({data:e,identifier:r,decodeMethod:n,highlight:t})=>{let i={displayValue:"",validationWarnings:[],highlight:t},o=e.includes("@"),s=e.includes(`
|
|
2
2
|
`);if(!o&&!s)return{...i,displayValue:a(e,n),highlight:t&&a(t,n)};if(o){let d=e.split("@"),c=E({parts:d,decodeMethod:n,identifier:r,decodedData:i}),l=t?p({data:t,identifier:r,decodeMethod:n,delimiter:"@"}):null;return{...i,displayValue:c.join("@"),highlight:l}}if(s){let d=e.split(`
|
|
3
3
|
`),c=d.map(u=>n==="raw"?u:a(Buffer.from(u,"base64").toString("hex"),n)),l=T({parts:d,initialDecodedParts:c,identifier:r,decodeMethod:n}),S=t?p({data:t,identifier:r,decodeMethod:n,delimiter:`
|
|
4
4
|
`}):null;return{...i,displayValue:l.join(`
|
|
5
5
|
`),highlight:S}}return i},k=({data:e,highlight:r,identifier:n})=>{let t={};return Object.values(h).forEach(i=>{let o=H({data:e,identifier:n,decodeMethod:i,highlight:r});t[i]=o}),t};export{k as a};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-BETSOJFK.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-EGU5LABV.mjs";import{b as r}from"./chunk-TXQO3M7J.mjs";import{u as i}from"./chunk-PGOE5XGR.mjs";import{b as o}from"./chunk-SAAOQW7P.mjs";async function M({shard:t,apiAddress:s}){if(t!=null)try{let a=await n(t,s);if(!a?.[t]?.lastBlock)return;let e=o(i());(!e.gasStationMetadata||!e.gasStationMetadata[t]||e.gasStationMetadata[t].lastBlock!==a[t].lastBlock)&&r({...e,gasStationMetadata:{...e.gasStationMetadata,...a}})}catch(a){console.error("Error fetching gas station metadata:",a)}}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ED5SQUAW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-53JZ6ZBD.mjs";import o from"axios";var n="transactions/ppu";async function l(a,s){let r=`${e(s)}/${n}/${a}`;try{let{data:t}=await o.get(r);return t?{[a]:{lastBlock:t.lastBlock,fast:t.fast,faster:t.faster}}:null}catch(t){return console.error("Error fetching gas station metadata from:",r,t),null}}export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-EGU5LABV.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as r}from"./chunk-VMFJUT3G.mjs";import{a as e}from"./chunk-NONAAAZC.mjs";var n=class{static get create(){return this.createComponent}static set create(t){this.createComponent=t}};n.createComponent=async({name:t,anchor:o})=>{if(await r(e),!e.document)return{};let m=e.document.createElement(t);return(o||e.document.body).appendChild(m),await customElements.whenDefined(t),m};export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-EKMRPW2A.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/ComponentFactory.ts"],
|
|
4
|
+
"sourcesContent": ["import { IEventBus } from '@multiversx/sdk-dapp-ui/dist/loader';\nimport { safeWindow } from 'constants/index';\nimport { UITagsEnum } from 'constants/UITags.enum';\nimport { defineCustomElements } from 'lib/sdkDappUi';\n\nexport interface CreateEventBusUIElementType extends HTMLElement {\n getEventBus: () => Promise<IEventBus | null>;\n}\n\nexport type CreateComponentType = <T = CreateEventBusUIElementType>({\n name,\n anchor\n}: {\n name: `${UITagsEnum}`;\n anchor?: HTMLElement;\n}) => Promise<T>;\n\nexport class ComponentFactory {\n private static createComponent: CreateComponentType = async <\n T = CreateEventBusUIElementType\n >({\n name,\n anchor\n }: {\n name: `${UITagsEnum}`;\n anchor?: HTMLElement;\n }) => {\n await defineCustomElements(safeWindow);\n\n if (!safeWindow.document) {\n return {} as T;\n }\n\n const element = safeWindow.document.createElement(name);\n const rootElement = anchor || safeWindow.document.body;\n rootElement.appendChild(element);\n await customElements.whenDefined(name);\n\n return element as T;\n };\n\n static get create() {\n return this.createComponent;\n }\n\n static set create(customCreateFunction: CreateComponentType) {\n this.createComponent = customCreateFunction;\n }\n}\n"],
|
|
5
|
+
"mappings": "kFAiBO,IAAMA,EAAN,KAAuB,CAwB5B,WAAW,QAAS,CAClB,OAAO,KAAK,eACd,CAEA,WAAW,OAAOC,EAA2C,CAC3D,KAAK,gBAAkBA,CACzB,CACF,EA/BaD,EACI,gBAAuC,MAEpD,CACA,KAAAE,EACA,OAAAC,CACF,IAGM,CAGJ,GAFA,MAAMC,EAAqBC,CAAU,EAEjC,CAACA,EAAW,SACd,MAAO,CAAC,EAGV,IAAMC,EAAUD,EAAW,SAAS,cAAcH,CAAI,EAEtD,OADoBC,GAAUE,EAAW,SAAS,MACtC,YAAYC,CAAO,EAC/B,MAAM,eAAe,YAAYJ,CAAI,EAE9BI,CACT",
|
|
6
|
+
"names": ["ComponentFactory", "customCreateFunction", "name", "anchor", "defineCustomElements", "safeWindow", "element"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as c}from"./chunk-L7L56ZTG.mjs";import{a as T}from"./chunk-V4YC4AKQ.mjs";import{a as p}from"./chunk-ABHYXD3U.mjs";import{b as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as c}from"./chunk-L7L56ZTG.mjs";import{a as T}from"./chunk-V4YC4AKQ.mjs";import{a as p}from"./chunk-ABHYXD3U.mjs";import{b as m}from"./chunk-RRKNYQ6D.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}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-EQEYL6AE.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-GOL32UNC.mjs";import{a as o}from"./chunk-OJV6XRG5.mjs";import{a as e,b as t}from"./chunk-NONAAAZC.mjs";import{WebviewProvider as a}from"@multiversx/sdk-webview-provider/out/WebviewProvider";var n=class extends s{constructor(r){super(r?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async r=>{if(!this.provider)throw new Error("Provider is not initialized.");try{return await this.provider.signTransactions(r)||[]}catch(i){throw this.cancelAction(),i}};this.signMessage=async r=>{if(!this.provider)throw new Error("Provider is not initialized.");try{return await this.provider.signMessage(r)}catch(i){throw this.cancelAction(),i}};this.provider=a.getInstance({resetStateCallback:()=>{e.localStorage?.clear?.(),e.sessionStorage?.clear?.()}}),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}logout(){return this.provider.logout()}getType(){return o.webview}getAddress(){throw new Error("Method not implemented.")}setAccount(r){return this.provider.setAccount(r)}isInitialized(){return this.provider.isInitialized()}async initializeProvider(){let r=await this.provider.init(t);return this.address&&this.setAccount({address:this.address}),r}};export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ER735UVF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as N}from"./chunk-Q2Q4XN4M.mjs";import{b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as N}from"./chunk-Q2Q4XN4M.mjs";import{b}from"./chunk-YILGIHY5.mjs";import{d as C,e as I}from"./chunk-A343RP4X.mjs";import{s as p}from"./chunk-PGOE5XGR.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-EUXN5BLO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-IYAIXP65.mjs";import{a as k}from"./chunk-LIFPBQTL.mjs";import{s as f}from"./chunk-PGOE5XGR.mjs";import{d as b}from"./chunk-QJSB5NX4.mjs";import{c as n}from"./chunk-Q6NDAYER.mjs";import{b as i}from"./chunk-GGBMHKR4.mjs";async function N(){let o=f(),I=g(),s=null,t=null,l=b(o.getState())?.timestamp,c=()=>{k()},u=()=>{s??=setInterval(c,I)},m=()=>{s&&(clearInterval(s),s=null)},p=()=>{m();let a=o.subscribe(({account:{websocketEvent:e}})=>{e?.message&&l!==e.timestamp&&(l=e.timestamp,c())});n.set("websocketEventReceived",a)},S=()=>{i.status!=="not_initialized"||t||(t=setInterval(()=>{i.status==="completed"&&(clearInterval(t),t=null,p())},1e3))};c();let r=()=>{m(),t&&(clearInterval(t),t=null)},v=o.subscribe(({account:{address:a},config:{websocketStatus:e}},T)=>{if(T.config.websocketStatus!==e)switch(e){case"completed":p();break;case"pending":u(),S();break;default:a?u():r();break}});return n.set("websocketStatusChanged",v),n.set("websocketEventReceived",r),{stopTransactionsTracking:r}}export{N as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FFEFZVCC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-KWJVDPCC.mjs";import{a as e}from"./chunk-2ZNIPYEV.mjs";import{a as i}from"./chunk-REI3WYXH.mjs";var a=class{constructor(o){this.address="";this._login=null;this.loginAbortController=null;this.cancelLogin=()=>{this.loginAbortController&&this.loginAbortController.abort(),this.cancelAction?.(),this.loginAbortController=null};this.loginOperation=async o=>{if(!this._login)throw new Error("Provider is not initialized.");let r=await this._login(o);if(!r?.address)throw new Error("Provider is not initialized.");return{...r,address:r.address,signature:r.signature??""}};this.initializeAddress=()=>{if(this.address)return;let o=e();o&&(this.address=o)};this.cancelAction=void 0;this.address=o??""}getAccount(){throw new Error("Method not implemented.")}signTransaction(o,r){throw new Error("Method not implemented.")}async login(o){if(!this._login)throw new Error("Provider is not initialized.");this.loginAbortController&&this.loginAbortController.abort();let r=new AbortController;this.loginAbortController=r;let t=r.signal;try{let n=new Promise((p,c)=>{t.addEventListener("abort",()=>{c(new Error("Login cancelled"))})}),l=await Promise.race([this.loginOperation(o),n]);return this.loginAbortController=null,l}catch(n){throw this.loginAbortController=null,n}}async initSignState(){let{onClose:o,manager:r}=await s({cancelAction:this.cancelAction?.bind(this)}),t=this.getType();return r.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",o),r.updateData({name:i[t],type:t}),{onClose:o,manager:r}}};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-GOL32UNC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-L3MWDI6J.mjs";import{s as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-L3MWDI6J.mjs";import{s as i}from"./chunk-PGOE5XGR.mjs";var g=({transactions:s,transactionsDisplayInfo:a,status:e,sessionInformation:t})=>{let o=Date.now().toString();return i().setState(({transactions:n})=>{n[o]={transactions:s,status:e,transactionsDisplayInfo:a,interpretedTransactions:{},sessionInformation:t}},!1,"createTransactionsSession"),o},T=({sessionId:s,status:a,errorMessage:e})=>{i().setState(({transactions:t})=>{t[s].status=a,t[s].errorMessage=e},!1,"updateTransactionsSession")},y=({sessionId:s,transaction:a})=>{let e=null;return i().setState(({transactions:t})=>{let o=t[s]?.transactions;if(o!=null){t[s].transactions=o.map(r=>r.hash===a.hash?{...r,...a??{}}:r);let n=u([...t[s].transactions]);n&&(T({sessionId:s,status:n}),e=n)}},!1,"updateTransactionStatus"),e},h=()=>{i().setState(({transactions:s,toasts:a})=>{let t=Object.keys(s).filter(n=>{let r=s[n];if(!r)return!1;let{status:c}=r;return!(c==="pending"||c==="signed"||c==="sent")});t.forEach(n=>{delete s[n]});let o=a.transactionToasts.filter(n=>!t.includes(n.toastId));a.transactionToasts=o},!1,"clearCompletedTransactions")};export{g as a,T as b,y as c,h as d};
|
|
2
|
+
//# sourceMappingURL=chunk-GXUJBKWY.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{l as p,s as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{l as p,s as e}from"./chunk-PGOE5XGR.mjs";import{c as i}from"./chunk-R53MCZI6.mjs";var T=()=>e().setState(p),m=({address:o,providerType:d})=>{e().setState(({account:r,loginInfo:t})=>{r.address=o,r.publicKey=new i(o).hex(),t&&(t.providerType=d)},!1,"loginAction")};export{T as a,m as b};
|
|
2
|
+
//# sourceMappingURL=chunk-HIODLP5F.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-7CA6UKPK.mjs";import{b as T}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-7CA6UKPK.mjs";import{b as T}from"./chunk-RM4VHHXR.mjs";import{c}from"./chunk-TI37DKBT.mjs";function D({transactions:i}){let e=[],o={};return!i||i.length===0?{allTransactions:e,parsedTransactionsByDataField:o}:(i.forEach((n,m)=>{let p=c(n.data.toString()??""),s=u(p);if(s.length>0)s.forEach((t,a)=>{let r=a===s.length-1,l={transaction:n,multiTxData:t.data,transactionIndex:a,needsSigning:r};o[t.data]={tokenId:t.token?t.token:"",amount:t.amount?t.amount:"",type:t.type,nonce:t.nonce?t.nonce:"",multiTxData:t.data,receiver:t.receiver},e.push(l)});else{let t=c(n.data.toString()??""),{tokenId:a,amount:r}=T(t);a&&(o[t]={tokenId:a,amount:r,receiver:n.receiver.toBech32()}),e.push({transaction:n,transactionIndex:m,multiTxData:t,needsSigning:!0})}}),{allTransactions:e,parsedTransactionsByDataField:o})}export{D as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HIUWEH2W.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-NONAAAZC.mjs";function t(){if(!e)return"";try{if(e.document.referrer)return new URL(e.document.referrer).origin;let r=e.location.ancestorOrigins;return r.length<1?"":new URL(r[r.length-1]).origin}catch(r){return console.error(r),""}}export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HPLSDK5V.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as h}from"./chunk-HVUNMCAO.mjs";import{a as S}from"./chunk-RIH7QM6W.mjs";import{a as o}from"./chunk-FMQYLMTU.mjs";import{a as y}from"./chunk-MFUQ5NBC.mjs";import{b as i,c as f}from"./chunk-GXUJBKWY.mjs";import{l}from"./chunk-65L5EBBL.mjs";var u={};async function d({serverTransaction:e,sessionId:t,isSequential:c}){let{hash:a,status:r,results:m,invalidTransaction:n,hasStatusChanged:p}=e;try{if(u[a]>30){i({sessionId:t,status:"timedOut"}),await o({sessionId:t,status:"timedOut"});return}if(n&&!c||r==="sent"){u[a]=u[a]?u[a]+1:1;return}if(c&&!r){let s=f({sessionId:t,transaction:e});await o({sessionId:t,status:s});return}if(p){let s=f({sessionId:t,transaction:e});await o({sessionId:t,status:s})}l(r)&&await S({sessionId:t,hash:a,results:m})}catch(T){console.error(T),i({sessionId:t,status:"timedOut"}),await o({sessionId:t,status:"timedOut"})}}async function R({sessionId:e,transactionBatch:t,isSequential:c}){try{if(t==null)return;let a=y(t),r=await h(a);for(let n of r)await d({serverTransaction:n,sessionId:e,isSequential:c});if(r.every(n=>n.status!=="pending")){if(r.every(s=>s.status==="success"))return i({sessionId:e,status:"success"});if(r.some(s=>s.status==="fail"))return i({sessionId:e,status:"fail"});if(r.every(s=>s.invalidTransaction))return i({sessionId:e,status:"invalid"})}}catch(a){console.error(a)}}export{R as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HTAH342B.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.ts"],
|
|
4
4
|
"sourcesContent": ["import { getTransactionsByHashes } from 'apiCalls/transactions/getTransactionsByHashes';\nimport {\n updateTransactionStatus,\n updateSessionStatus\n} from 'store/actions/transactions/transactionsActions';\nimport { getIsTransactionFailed } from 'store/actions/transactions/transactionStateByStatus';\nimport {\n TransactionBatchStatusesEnum,\n TransactionServerStatusesEnum\n} from 'types/enums.types';\nimport {\n TrackedTransactionResultType,\n SignedTransactionType\n} from 'types/transactions.types';\n\nimport { getPendingTransactions } from './getPendingTransactions';\nimport { manageFailedTransactions } from './manageFailedTransactions';\nimport { runSessionCallbacks } from './runSessionCallbacks';\n\nexport interface TransactionStatusTrackerPropsType {\n sessionId: string;\n transactionBatch: SignedTransactionType[];\n isSequential?: boolean;\n}\n\ninterface RetriesType {\n [hash: string]: number;\n}\n\nconst retries: RetriesType = {};\n\ninterface ManageTransactionType {\n serverTransaction: TrackedTransactionResultType;\n sessionId: string;\n isSequential?: boolean;\n}\n\nasync function manageTransaction({\n serverTransaction: transaction,\n sessionId,\n isSequential\n}: ManageTransactionType) {\n const { hash, status, results, invalidTransaction, hasStatusChanged } =\n transaction;\n try {\n const retriesForThisHash = retries[hash];\n if (retriesForThisHash > 30) {\n // consider transaction as stuck after 1 minute\n updateSessionStatus({\n sessionId,\n status: TransactionBatchStatusesEnum.timedOut\n });\n\n await runSessionCallbacks({\n sessionId,\n status: TransactionBatchStatusesEnum.timedOut\n });\n\n return;\n }\n\n if (\n (invalidTransaction && !isSequential) ||\n status === TransactionBatchStatusesEnum.sent\n ) {\n retries[hash] = retries[hash] ? retries[hash] + 1 : 1;\n return;\n }\n\n // The tx is from a sequential batch.\n // If the transactions before this are not successful then it means that no other tx will be processed\n if (isSequential && !status) {\n const newStatus = updateTransactionStatus({\n sessionId,\n transaction\n });\n await runSessionCallbacks({\n sessionId,\n status: newStatus\n });\n return;\n }\n\n if (hasStatusChanged) {\n const newStatus = updateTransactionStatus({\n sessionId,\n transaction\n });\n\n await runSessionCallbacks({\n sessionId,\n status: newStatus\n });\n }\n\n if (getIsTransactionFailed(status)) {\n await manageFailedTransactions({ sessionId, hash, results });\n }\n } catch (error) {\n console.error(error);\n updateSessionStatus({\n sessionId,\n status: TransactionBatchStatusesEnum.timedOut\n });\n await runSessionCallbacks({\n sessionId,\n status: TransactionBatchStatusesEnum.timedOut\n });\n }\n}\n\nexport async function checkBatch({\n sessionId,\n transactionBatch: transactions,\n isSequential\n}: TransactionStatusTrackerPropsType) {\n try {\n if (transactions == null) {\n return;\n }\n\n const pendingTransactions = getPendingTransactions(transactions);\n\n const serverTransactions =\n await getTransactionsByHashes(pendingTransactions);\n\n for (const serverTransaction of serverTransactions) {\n await manageTransaction({\n serverTransaction,\n sessionId,\n isSequential\n });\n }\n\n const hasCompleted = serverTransactions.every(\n (tx) => tx.status !== TransactionServerStatusesEnum.pending\n );\n\n // Call the onSuccess or onFail callback only if the transactions are sent normally (not using batch transactions mechanism).\n // The batch transactions mechanism will call the callbacks separately.\n\n if (hasCompleted) {\n const isSuccessful = serverTransactions.every(\n (tx) => tx.status === TransactionServerStatusesEnum.success\n );\n\n if (isSuccessful) {\n return updateSessionStatus({\n sessionId,\n status: TransactionBatchStatusesEnum.success\n });\n }\n\n const isFailed = serverTransactions.some(\n (tx) => tx.status === TransactionServerStatusesEnum.fail\n );\n\n if (isFailed) {\n return updateSessionStatus({\n sessionId,\n status: TransactionBatchStatusesEnum.fail\n });\n }\n\n const isInvalid = serverTransactions.every((tx) => tx.invalidTransaction);\n\n if (isInvalid) {\n return updateSessionStatus({\n sessionId,\n status: TransactionBatchStatusesEnum.invalid\n });\n }\n }\n } catch (error) {\n console.error(error);\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "wPA6BA,IAAMA,EAAuB,CAAC,EAQ9B,eAAeC,EAAkB,CAC/B,kBAAmBC,EACnB,UAAAC,EACA,aAAAC,CACF,EAA0B,CACxB,GAAM,CAAE,KAAAC,EAAM,OAAAC,EAAQ,QAAAC,EAAS,mBAAAC,EAAoB,iBAAAC,CAAiB,EAClEP,EACF,GAAI,CAEF,GAD2BF,EAAQK,CAAI,EACd,GAAI,CAE3BK,EAAoB,CAClB,UAAAP,EACA,iBACF,CAAC,EAED,MAAMQ,EAAoB,CACxB,UAAAR,EACA,iBACF,CAAC,EAED,MACF,CAEA,GACGK,GAAsB,CAACJ,GACxBE,WACA,CACAN,EAAQK,CAAI,EAAIL,EAAQK,CAAI,EAAIL,EAAQK,CAAI,EAAI,EAAI,EACpD,MACF,CAIA,GAAID,GAAgB,CAACE,EAAQ,CAC3B,IAAMM,EAAYC,EAAwB,CACxC,UAAAV,EACA,YAAAD,CACF,CAAC,EACD,MAAMS,EAAoB,CACxB,UAAAR,EACA,OAAQS,CACV,CAAC,EACD,MACF,CAEA,GAAIH,EAAkB,CACpB,IAAMG,EAAYC,EAAwB,CACxC,UAAAV,EACA,YAAAD,CACF,CAAC,EAED,MAAMS,EAAoB,CACxB,UAAAR,EACA,OAAQS,CACV,CAAC,CACH,CAEIE,EAAuBR,CAAM,GAC/B,MAAMS,EAAyB,CAAE,UAAAZ,EAAW,KAAAE,EAAM,QAAAE,CAAQ,CAAC,CAE/D,OAASS,EAAO,CACd,QAAQ,MAAMA,CAAK,EACnBN,EAAoB,CAClB,UAAAP,EACA,iBACF,CAAC,EACD,MAAMQ,EAAoB,CACxB,UAAAR,EACA,iBACF,CAAC,CACH,CACF,CAEA,eAAsBc,EAAW,CAC/B,UAAAd,EACA,iBAAkBe,EAClB,aAAAd,CACF,EAAsC,CACpC,GAAI,CACF,GAAIc,GAAgB,KAClB,OAGF,IAAMC,EAAsBC,EAAuBF,CAAY,EAEzDG,EACJ,MAAMC,EAAwBH,CAAmB,EAEnD,QAAWI,KAAqBF,EAC9B,MAAMpB,EAAkB,CACtB,kBAAAsB,EACA,UAAApB,EACA,aAAAC,CACF,CAAC,EAUH,GAPqBiB,EAAmB,MACrCG,GAAOA,EAAG,kBACb,EAKkB,CAKhB,GAJqBH,EAAmB,MACrCG,GAAOA,EAAG,kBACb,EAGE,OAAOd,EAAoB,CACzB,UAAAP,EACA,gBACF,CAAC,EAOH,GAJiBkB,EAAmB,KACjCG,GAAOA,EAAG,eACb,EAGE,OAAOd,EAAoB,CACzB,UAAAP,EACA,aACF,CAAC,EAKH,GAFkBkB,EAAmB,MAAOG,GAAOA,EAAG,kBAAkB,EAGtE,OAAOd,EAAoB,CACzB,UAAAP,EACA,gBACF,CAAC,CAEL,CACF,OAASa,EAAO,CACd,QAAQ,MAAMA,CAAK,CACrB,CACF",
|
|
6
6
|
"names": ["retries", "manageTransaction", "transaction", "sessionId", "isSequential", "hash", "status", "results", "invalidTransaction", "hasStatusChanged", "updateSessionStatus", "runSessionCallbacks", "newStatus", "updateTransactionStatus", "getIsTransactionFailed", "manageFailedTransactions", "error", "checkBatch", "transactions", "pendingTransactions", "getPendingTransactions", "serverTransactions", "getTransactionsByHashes", "serverTransaction", "tx"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-LEBVS2YF.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-HVUNMCAO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{s as a}from"./chunk-PGOE5XGR.mjs";var r=({key:e,value:t})=>{a().setState(({cache:c})=>{c[e]=t},!1,"saveToCache")},s=e=>{a().setState(({cache:t})=>{delete t[e]},!1,"removeFromCache")},h=()=>{a().setState(({cache:e})=>{Object.keys(e).forEach(t=>{delete e[t]})},!1,"clearCache")};export{r as a,s as b,h as c};
|
|
2
|
+
//# sourceMappingURL=chunk-IEWH5GDM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as B}from"./chunk-VYWLQ5T7.mjs";import{a as b}from"./chunk-Q56GIIOP.mjs";import{a as k}from"./chunk-QXC4D3AC.mjs";import{a as R}from"./chunk-OD4ANAAQ.mjs";import{a as D}from"./chunk-QVLQCJFN.mjs";import{a as I}from"./chunk-AV4HSXYZ.mjs";import{a as j}from"./chunk-YTFYVPZO.mjs";import{a as _}from"./chunk-3UIJI5YR.mjs";import{a as O}from"./chunk-AKFSBZ46.mjs";import{a as x}from"./chunk-RUG7JMMB.mjs";import{u as A}from"./chunk-PGOE5XGR.mjs";import{b as v}from"./chunk-SAAOQW7P.mjs";import{a as G,c as U,f as F}from"./chunk-J4CPYFK6.mjs";import{a as w}from"./chunk-R53MCZI6.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard:C,username:E}}=B(),g=v(A()),h=x(),{allTransactions:e,parsedTransactionsByDataField:L}=R(z),p=[],n=O.getInstance();if(await n.openUI(),!n)throw new Error("Unable to establish connection with sign screens");let W=async()=>{await b(),n.closeUI()};return n.subscribeToEventBus("CLOSE_SIGN_TRANSACTIONS",W),new Promise(async(X,M)=>{let d=[],Y=await k({baseURL:g.apiAddress});n.notifyDataUpdate(),n.initializeGasPriceMap(e.map(t=>t.transaction));let l=Y?.price,a=0,T=async()=>{let 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-ISB4SC4L.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-6H5TKCEW.mjs";import{a as c}from"./chunk-AGHFAZ7O.mjs";import{a}from"./chunk-YUFPUG5O.mjs";var p="Check if the MultiversX App is open on Ledger";async function v({manager:e,resolve:n,reject:d,shouldInitProvider:s}){let i=!c(),t=()=>v({manager:e,resolve:n,reject:d,shouldInitProvider:s}),o=()=>d("Device unavailable");try{e?.updateAccountScreen({isLoading:!0}),e&&i&&e.subscribeToProviderInit({handleRetry:t,handleCancel:o});let r=await l({shouldInitProvider:s});e&&i&&e.unsubscribeFromProviderInit({handleRetry:t,handleCancel:o}),n(r)}catch(r){if(!i)throw r;let{errorMessage:u,defaultErrorMessage:g}=a(r);e?.updateConnectScreen({error:u??g??p}),e&&e.subscribeToProviderInit({handleRetry:t,handleCancel:o})}}export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JF4GVWO4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-KGASLT4P.mjs";import{a as s}from"./chunk-QPXVUJSC.mjs";import{a as k}from"./chunk-3OKWBJFM.mjs";import{a as L}from"./chunk-7ZW5EZFP.mjs";import{b as A}from"./chunk-A343RP4X.mjs";import{a as I}from"./chunk-BRJNX4JF.mjs";import{g as p}from"./chunk-PGOE5XGR.mjs";import{a as f}from"./chunk-KD2IQ32V.mjs";import{a as x}from"./chunk-OJV6XRG5.mjs";import{BigNumber as C}from"bignumber.js";async function M({options:d,config:i,provider:a,login:c}){let e=h.getInstance(),T=L(),b=k({loginToken:d?.token,version:i.version}),o={manager:e,provider:a};await s(o);let t=await new Promise(async function(E,w){async function g(r){let n=e?e.addressesPerPage??1:1,l=new C(r-1).times(n);e?.updateStartIndex(Math.max(0,parseInt(l.toString()))),await s(o)}async function u(r){if(!(!a||!c)){e?.updateConfirmScreen({...b,selectedAddress:r.selectedAddress,explorerLink:I({to:`/${f}/${r.selectedAddress}`,explorerAddress:T})});try{let n=d?.token?await a.tokenLogin({token:Buffer.from(`${d?.token}{}`),addressIndex:r.addressIndex}):await c({addressIndex:r.addressIndex});E({address:n.address,signature:n.signature?n.signature.toString("hex"):"",addressIndex:r.addressIndex})}catch(n){console.error("User rejected login:",n),!!e?.getConfirmScreenData()&&await s(o)}}}async function m(){await s(o),e.unsubscribeFromAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g}),w("User cancelled login")}e.subscribeToAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g})}),{version:P,dataEnabled:v}=i;return p({index:t.addressIndex,loginType:x.ledger}),A({address:t.address,index:t.addressIndex,version:P,hasContractDataEnabled:v}),{address:t.address,signature:t.signature}}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JGFDKHG2.mjs.map
|