@multiversx/sdk-dapp 5.2.13 → 5.2.14-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/__chunks__/{chunk-6BL2PJRI.mjs → chunk-27JXN5DJ.mjs} +2 -2
- package/out/__chunks__/{chunk-GUZERYYB.mjs → chunk-2BY6NFOV.mjs} +2 -2
- package/out/__chunks__/{chunk-BMBBSWIO.mjs → chunk-2KTELDSS.mjs} +2 -2
- package/out/__chunks__/{chunk-LMULG6DX.mjs → chunk-2LR4FGZM.mjs} +2 -2
- package/out/__chunks__/chunk-3LP3BS6C.mjs +2 -0
- package/out/__chunks__/{chunk-43L6QQVQ.mjs → chunk-3PDGEKV7.mjs} +2 -2
- package/out/__chunks__/chunk-4PM6Y6MN.mjs +2 -0
- package/out/__chunks__/{chunk-AGXERDYF.mjs → chunk-4WCO6W5U.mjs} +2 -2
- package/out/__chunks__/{chunk-GEPV5HLA.mjs → chunk-5YS3EQN7.mjs} +2 -2
- package/out/__chunks__/{chunk-VTPHR6O5.mjs → chunk-6EU6P4JK.mjs} +2 -2
- package/out/__chunks__/{chunk-UK2P24V6.mjs → chunk-A6MLJR2A.mjs} +2 -2
- package/out/__chunks__/chunk-ACR5GMV4.mjs +2 -0
- package/out/__chunks__/{chunk-MT3MZ6SJ.mjs → chunk-BV36TINM.mjs} +2 -2
- package/out/__chunks__/chunk-BWPUHP7O.mjs +2 -0
- package/out/__chunks__/{chunk-HA5UXXYU.mjs → chunk-BXNWMWZJ.mjs} +2 -2
- package/out/__chunks__/{chunk-CO55WDEX.mjs → chunk-C5D6KKDO.mjs} +2 -2
- package/out/__chunks__/{chunk-UB3WTGGF.mjs → chunk-CHSOALST.mjs} +2 -2
- package/out/__chunks__/chunk-CZG3II4A.mjs +2 -0
- package/out/__chunks__/chunk-D332ESHD.mjs +2 -0
- package/out/__chunks__/{chunk-KXJUK6CN.mjs.map → chunk-D332ESHD.mjs.map} +1 -1
- package/out/__chunks__/{chunk-TC5SHARG.mjs → chunk-DS5BMHCD.mjs} +2 -2
- package/out/__chunks__/{chunk-ZVAP4GAJ.mjs → chunk-EWHHZE2Y.mjs} +2 -2
- package/out/__chunks__/chunk-G3PW6MWT.mjs +2 -0
- package/out/__chunks__/chunk-G3PW6MWT.mjs.map +7 -0
- package/out/__chunks__/{chunk-2M5PQ7VQ.mjs → chunk-GP3S6IRE.mjs} +2 -2
- package/out/__chunks__/{chunk-ZHRGANG5.mjs → chunk-GSLBJM6X.mjs} +2 -2
- package/out/__chunks__/{chunk-MH24PY4N.mjs → chunk-GXB7VLJI.mjs} +2 -2
- package/out/__chunks__/{chunk-RXQEMX7U.mjs → chunk-H3CEKEGG.mjs} +2 -2
- package/out/__chunks__/chunk-HMXZQBUN.mjs +2 -0
- package/out/__chunks__/chunk-HN5C6QP2.mjs +2 -0
- package/out/__chunks__/{chunk-TEIODZEN.mjs → chunk-JJHCLR34.mjs} +2 -2
- package/out/__chunks__/{chunk-HKZI76PK.mjs → chunk-JYZ7RSRP.mjs} +2 -2
- package/out/__chunks__/{chunk-QAKIMRWO.mjs → chunk-K7UYBI5V.mjs} +2 -2
- package/out/__chunks__/{chunk-NE6ED6BJ.mjs → chunk-KHLS5Q36.mjs} +2 -2
- package/out/__chunks__/{chunk-A2OUGIST.mjs → chunk-LDSGJKBB.mjs} +2 -2
- package/out/__chunks__/{chunk-4YZ6ES24.mjs → chunk-LHSB6DBF.mjs} +2 -2
- package/out/__chunks__/{chunk-FDN3ZMJB.mjs → chunk-LKUWWSNW.mjs} +2 -2
- package/out/__chunks__/chunk-LRMTQAPQ.mjs +2 -0
- package/out/__chunks__/{chunk-TAA22QOF.mjs → chunk-M4Q4I6RI.mjs} +2 -2
- package/out/__chunks__/{chunk-SBQYWA6T.mjs → chunk-MDWK7DG2.mjs} +2 -2
- package/out/__chunks__/{chunk-JICJ7JNX.mjs → chunk-MEWJKXYC.mjs} +2 -2
- package/out/__chunks__/chunk-MJ6HKT3C.mjs +2 -0
- package/out/__chunks__/chunk-MORYV6AT.mjs +2 -0
- package/out/__chunks__/{chunk-3IZTM5SH.mjs → chunk-MP4WGD5I.mjs} +2 -2
- package/out/__chunks__/{chunk-SPP2AXFW.mjs → chunk-MPE25R5P.mjs} +2 -2
- package/out/__chunks__/{chunk-JIWOIKIN.mjs → chunk-MZ3JSTQR.mjs} +2 -2
- package/out/__chunks__/{chunk-CD7S5WQ2.mjs → chunk-NLPW35QO.mjs} +2 -2
- package/out/__chunks__/{chunk-ACNCA5WT.mjs → chunk-O7JES6EH.mjs} +2 -2
- package/out/__chunks__/chunk-ODUZNLIJ.mjs +2 -0
- package/out/__chunks__/{chunk-JH7DXVOH.mjs → chunk-OGHSN5AV.mjs} +2 -2
- package/out/__chunks__/{chunk-KW67U7EN.mjs → chunk-ONTYC4LL.mjs} +2 -2
- package/out/__chunks__/{chunk-BF2EIXYA.mjs → chunk-OQ5DAOMH.mjs} +2 -2
- package/out/__chunks__/{chunk-KAZ44D6B.mjs → chunk-OXMQRX3C.mjs} +2 -2
- package/out/__chunks__/chunk-PEIP236V.mjs +2 -0
- package/out/__chunks__/{chunk-FUSW6F2O.mjs → chunk-PESTNRFD.mjs} +2 -2
- package/out/__chunks__/{chunk-BDOEZAQW.mjs → chunk-PHULZIKN.mjs} +2 -2
- package/out/__chunks__/{chunk-JO4RFE6Y.mjs → chunk-PYY4E5KD.mjs} +2 -2
- package/out/__chunks__/{chunk-HM3DDWL2.mjs → chunk-QF3H56ZJ.mjs} +2 -2
- package/out/__chunks__/chunk-QHCEY52I.mjs +2 -0
- package/out/__chunks__/{chunk-3BOE7KMH.mjs → chunk-QLV3MHJI.mjs} +2 -2
- package/out/__chunks__/{chunk-3XTDNJEI.mjs → chunk-QPGBSUO6.mjs} +2 -2
- package/out/__chunks__/chunk-RVC6PTTK.mjs +2 -0
- package/out/__chunks__/{chunk-4HACE72D.mjs → chunk-RYEH6TVZ.mjs} +2 -2
- package/out/__chunks__/chunk-SG7MW54O.mjs +2 -0
- package/out/__chunks__/{chunk-A32SSEM7.mjs → chunk-TTIO44SD.mjs} +2 -2
- package/out/__chunks__/{chunk-U22RR2MN.mjs → chunk-TXC67B7S.mjs} +2 -2
- package/out/__chunks__/{chunk-QY6K7L4I.mjs → chunk-UYHW3YLS.mjs} +2 -2
- package/out/__chunks__/{chunk-MPQUPJUO.mjs → chunk-VSXD2ISB.mjs} +2 -2
- package/out/__chunks__/{chunk-GPRR7WIH.mjs → chunk-VURQULM5.mjs} +2 -2
- package/out/__chunks__/{chunk-FDKQ5GBZ.mjs → chunk-VW4A3BGH.mjs} +2 -2
- package/out/__chunks__/{chunk-JDIGAG2K.mjs → chunk-W6GE3JU3.mjs} +2 -2
- package/out/__chunks__/{chunk-LKYNZMTI.mjs → chunk-X3SZ7TYX.mjs} +2 -2
- package/out/__chunks__/{chunk-HAHEJ5MG.mjs → chunk-X4NG6T34.mjs} +2 -2
- package/out/__chunks__/{chunk-VVMACGAC.mjs → chunk-X5SJJRGK.mjs} +2 -2
- package/out/__chunks__/chunk-XD3UF7WT.mjs +2 -0
- package/out/__chunks__/{chunk-YBEBQWOE.mjs → chunk-XJHG3UI7.mjs} +2 -2
- package/out/__chunks__/{chunk-VJN2RF4O.mjs → chunk-XLC5VX4C.mjs} +2 -2
- package/out/__chunks__/{chunk-NMVLXQXY.mjs → chunk-XM74E3A5.mjs} +2 -2
- package/out/__chunks__/{chunk-GRGJ3KFV.mjs → chunk-Y2TEUBEY.mjs} +2 -2
- package/out/__chunks__/{chunk-H3PMAMO7.mjs → chunk-YHIRRP3I.mjs} +2 -2
- package/out/__chunks__/{chunk-NCH6SFZ2.mjs → chunk-YIHOUDTV.mjs} +2 -2
- package/out/__chunks__/{chunk-7KOIS7OQ.mjs → chunk-YPJVICNW.mjs} +2 -2
- package/out/__chunks__/{chunk-46HT52TD.mjs → chunk-Z7BN62GW.mjs} +2 -2
- package/out/__chunks__/{chunk-N72FHB5Q.mjs → chunk-ZQSCQOU3.mjs} +2 -2
- package/out/apiCalls/account/getScamAddressData.mjs +1 -1
- package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
- package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
- package/out/apiCalls/index.mjs +1 -1
- package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
- package/out/apiCalls/tokens/index.mjs +1 -1
- package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
- package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
- package/out/constants/browser.constants.mjs +1 -1
- package/out/constants/index.mjs +1 -1
- package/out/constants/storage.constants.mjs +1 -1
- package/out/constants/window.constants.cjs +1 -1
- package/out/constants/window.constants.cjs.map +1 -1
- package/out/constants/window.constants.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
- package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
- package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
- package/out/controllers/TransactionsTableController/index.mjs +1 -1
- package/out/index.mjs +1 -1
- package/out/lib/sdkDappUi.mjs +1 -1
- package/out/managers/LogoutManager/LogoutManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
- package/out/managers/NotificationsFeedManager/index.mjs +1 -1
- package/out/managers/ToastManager/ToastManager.mjs +1 -1
- package/out/managers/ToastManager/ToastUICoordinator.mjs +1 -1
- package/out/managers/ToastManager/helpers/LifetimeManager.mjs +1 -1
- package/out/managers/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
- package/out/managers/ToastManager/index.mjs +1 -1
- package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
- package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
- package/out/managers/TransactionManager/index.mjs +1 -1
- package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
- package/out/managers/UnlockPanelManager/index.mjs +1 -1
- package/out/managers/index.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
- package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
- package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
- package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
- package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
- package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
- package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
- package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.mjs +1 -1
- package/out/managers/internal/WalletConnectStateManager/index.mjs +1 -1
- package/out/managers/internal/index.mjs +1 -1
- package/out/methods/account/getAccount.mjs +1 -1
- package/out/methods/account/getAccountInfo.mjs +1 -1
- package/out/methods/account/getAddress.mjs +1 -1
- package/out/methods/account/getIsLoggedIn.mjs +1 -1
- package/out/methods/account/getLatestNonce.mjs +1 -1
- package/out/methods/initApp/gastStationMetadata/setGasStationMetadata.mjs +1 -1
- package/out/methods/initApp/initApp.mjs +1 -1
- package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
- package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
- package/out/methods/loginInfo/getLoginInfo.mjs +1 -1
- package/out/methods/network/getEgldLabel.mjs +1 -1
- package/out/methods/network/getExplorerAddress.mjs +1 -1
- package/out/methods/network/getNetworkConfig.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/helpers/checkBatch/checkBatch.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/helpers/checkBatch/helpers/runTransactionFailure.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/helpers/checkBatch/helpers/runTransactionStatusUpdate.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/helpers/checkBatch/helpers/updateTransactionAndSessionStatus.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/helpers/checkBatch/index.mjs +1 -1
- package/out/methods/trackTransactions/helpers/checkTransactionStatus/index.mjs +1 -1
- package/out/methods/trackTransactions/helpers/getPollingInterval.mjs +1 -1
- package/out/methods/trackTransactions/trackTransactions.mjs +1 -1
- package/out/methods/transactions/getFailedTransactions.mjs +1 -1
- package/out/methods/transactions/getFailedTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactions.mjs +1 -1
- package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getSuccessfulTransactions.mjs +1 -1
- package/out/methods/transactions/getSuccessfulTransactionsSessions.mjs +1 -1
- package/out/methods/transactions/getTransactionSessions.mjs +1 -1
- package/out/providers/DappProvider/DappProvider.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/extractAddressFromToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getAccountFromToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getModifiedLoginToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/helpers/getMultisigLoginToken.mjs +1 -1
- package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
- package/out/providers/DappProvider/helpers/logout/logout.mjs +1 -1
- package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
- package/out/providers/DappProvider/helpers/signMessage/signMessageWithProvider.mjs +1 -1
- package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
- package/out/providers/DappProvider/index.mjs +1 -1
- package/out/providers/ProviderFactory.mjs +1 -1
- package/out/providers/helpers/accountProvider.mjs +1 -1
- package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
- package/out/providers/helpers/restoreProvider.mjs +1 -1
- package/out/providers/index.mjs +1 -1
- package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
- package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
- package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
- package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
- package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.mjs +1 -1
- package/out/providers/strategies/WalletConnectProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.cjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.cjs.map +2 -2
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.mjs +1 -1
- package/out/providers/strategies/WebviewProviderStrategy/index.mjs +1 -1
- package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
- package/out/providers/strategies/helpers/index.mjs +1 -1
- package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +1 -1
- package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
- package/out/providers/strategies/index.mjs +1 -1
- package/out/react/account/useGetAccount.mjs +1 -1
- package/out/react/account/useGetAccountInfo.mjs +1 -1
- package/out/react/account/useGetIsLoggedIn.mjs +1 -1
- package/out/react/account/useGetLatestNonce.mjs +1 -1
- package/out/react/index.mjs +1 -1
- package/out/react/loginInfo/useGetLoginInfo.mjs +1 -1
- package/out/react/network/useGetNetworkConfig.mjs +1 -1
- package/out/react/store/getReactStore.mjs +1 -1
- package/out/react/store/useSelector.mjs +1 -1
- package/out/react/transactions/useGetFailedTransactions.mjs +1 -1
- package/out/react/transactions/useGetFailedTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetPendingTransactions.mjs +1 -1
- package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetSuccessfulTransactions.mjs +1 -1
- package/out/react/transactions/useGetSuccessfulTransactionsSessions.mjs +1 -1
- package/out/react/transactions/useGetTransactionSessions.mjs +1 -1
- package/out/services/index.mjs +1 -1
- package/out/services/nativeAuth/index.mjs +1 -1
- package/out/services/nativeAuth/methods/buildNativeAuthConfig.mjs +1 -1
- package/out/services/nativeAuth/methods/getDefaultNativeAuthConfig.mjs +1 -1
- package/out/services/nativeAuth/methods/index.mjs +1 -1
- package/out/services/nativeAuth/nativeAuth.mjs +1 -1
- package/out/store/actions/account/accountActions.mjs +1 -1
- package/out/store/actions/account/index.mjs +1 -1
- package/out/store/actions/cache/cacheActions.mjs +1 -1
- package/out/store/actions/cache/index.mjs +1 -1
- package/out/store/actions/config/configActions.mjs +1 -1
- package/out/store/actions/config/index.mjs +1 -1
- package/out/store/actions/index.mjs +1 -1
- package/out/store/actions/loginInfo/loginInfoActions.mjs +1 -1
- package/out/store/actions/network/index.mjs +1 -1
- package/out/store/actions/network/initializeNetwork.mjs +1 -1
- package/out/store/actions/network/networkActions.mjs +1 -1
- package/out/store/actions/sharedActions/index.mjs +1 -1
- package/out/store/actions/sharedActions/sharedActions.mjs +1 -1
- package/out/store/actions/toasts/index.mjs +1 -1
- package/out/store/actions/toasts/toastsActions.mjs +1 -1
- package/out/store/actions/transactions/transactionsActions.mjs +1 -1
- package/out/store/actions/ui/index.mjs +1 -1
- package/out/store/actions/ui/uiActions.mjs +1 -1
- package/out/store/middleware/applyMiddlewares.mjs +1 -1
- package/out/store/middleware/index.mjs +1 -1
- package/out/store/middleware/logoutMiddleware.mjs +1 -1
- package/out/store/storage/index.mjs +1 -1
- package/out/store/storage/storageCallback.mjs +1 -1
- package/out/store/store.mjs +1 -1
- package/out/utils/ComponentFactory.mjs +1 -1
- package/out/utils/account/index.mjs +1 -1
- package/out/utils/account/refreshAccount.mjs +1 -1
- package/out/utils/account/refreshNativeAuthTokenLogin.mjs +1 -1
- package/out/utils/index.mjs +1 -1
- package/out/utils/transactions/getActiveTransactionsStatus.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/getInterpretedTransaction.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getLockedAccountName.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getShardText.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionIconInfo.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionMessages.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/helpers/index.mjs +1 -1
- package/out/utils/transactions/getInterpretedTransaction/index.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/getTransactionsHistory.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/getCachedTransactionListItem.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/index.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.mjs +1 -1
- package/out/utils/transactions/getTransactionsHistory/index.mjs +1 -1
- package/out/utils/transactions/index.mjs +1 -1
- package/out/utils/visual/index.mjs +1 -1
- package/out/utils/visual/switchTheme.mjs +1 -1
- package/out/utils/window/getIsInIframe.mjs +1 -1
- package/out/utils/window/getWindowParentOrigin.mjs +1 -1
- package/out/utils/window/index.mjs +1 -1
- package/package.json +2 -2
- package/out/__chunks__/chunk-27GL7FOR.mjs +0 -2
- package/out/__chunks__/chunk-3TQYETUQ.mjs +0 -2
- package/out/__chunks__/chunk-3ULRTEGS.mjs +0 -2
- package/out/__chunks__/chunk-ARG4BCVP.mjs +0 -2
- package/out/__chunks__/chunk-BPJEBZSS.mjs +0 -2
- package/out/__chunks__/chunk-CTCIWUCQ.mjs +0 -2
- package/out/__chunks__/chunk-JH4L2BAI.mjs +0 -2
- package/out/__chunks__/chunk-JU3JK7ZW.mjs +0 -2
- package/out/__chunks__/chunk-KXJUK6CN.mjs +0 -2
- package/out/__chunks__/chunk-LHLSK6R3.mjs +0 -2
- package/out/__chunks__/chunk-M2SIVB52.mjs +0 -2
- package/out/__chunks__/chunk-MDVHLIC7.mjs +0 -2
- package/out/__chunks__/chunk-ND5SC5UK.mjs +0 -2
- package/out/__chunks__/chunk-OVD6R5BF.mjs +0 -2
- package/out/__chunks__/chunk-OVD6R5BF.mjs.map +0 -7
- package/out/__chunks__/chunk-TAFDGCRA.mjs +0 -2
- package/out/__chunks__/chunk-TP6GGLNS.mjs +0 -2
- package/out/__chunks__/chunk-UGA4OJPD.mjs +0 -2
- package/out/__chunks__/chunk-XPQSGRUF.mjs +0 -2
- /package/out/__chunks__/{chunk-6BL2PJRI.mjs.map → chunk-27JXN5DJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GUZERYYB.mjs.map → chunk-2BY6NFOV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BMBBSWIO.mjs.map → chunk-2KTELDSS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LMULG6DX.mjs.map → chunk-2LR4FGZM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LHLSK6R3.mjs.map → chunk-3LP3BS6C.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-43L6QQVQ.mjs.map → chunk-3PDGEKV7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JU3JK7ZW.mjs.map → chunk-4PM6Y6MN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-AGXERDYF.mjs.map → chunk-4WCO6W5U.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GEPV5HLA.mjs.map → chunk-5YS3EQN7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VTPHR6O5.mjs.map → chunk-6EU6P4JK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UK2P24V6.mjs.map → chunk-A6MLJR2A.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TAFDGCRA.mjs.map → chunk-ACR5GMV4.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MT3MZ6SJ.mjs.map → chunk-BV36TINM.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ARG4BCVP.mjs.map → chunk-BWPUHP7O.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HA5UXXYU.mjs.map → chunk-BXNWMWZJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CO55WDEX.mjs.map → chunk-C5D6KKDO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UB3WTGGF.mjs.map → chunk-CHSOALST.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CTCIWUCQ.mjs.map → chunk-CZG3II4A.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TC5SHARG.mjs.map → chunk-DS5BMHCD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZVAP4GAJ.mjs.map → chunk-EWHHZE2Y.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-2M5PQ7VQ.mjs.map → chunk-GP3S6IRE.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ZHRGANG5.mjs.map → chunk-GSLBJM6X.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MH24PY4N.mjs.map → chunk-GXB7VLJI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-RXQEMX7U.mjs.map → chunk-H3CEKEGG.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-UGA4OJPD.mjs.map → chunk-HMXZQBUN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TP6GGLNS.mjs.map → chunk-HN5C6QP2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TEIODZEN.mjs.map → chunk-JJHCLR34.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HKZI76PK.mjs.map → chunk-JYZ7RSRP.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QAKIMRWO.mjs.map → chunk-K7UYBI5V.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NE6ED6BJ.mjs.map → chunk-KHLS5Q36.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-A2OUGIST.mjs.map → chunk-LDSGJKBB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4YZ6ES24.mjs.map → chunk-LHSB6DBF.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FDN3ZMJB.mjs.map → chunk-LKUWWSNW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MDVHLIC7.mjs.map → chunk-LRMTQAPQ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-TAA22QOF.mjs.map → chunk-M4Q4I6RI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SBQYWA6T.mjs.map → chunk-MDWK7DG2.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JICJ7JNX.mjs.map → chunk-MEWJKXYC.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-M2SIVB52.mjs.map → chunk-MJ6HKT3C.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ND5SC5UK.mjs.map → chunk-MORYV6AT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3IZTM5SH.mjs.map → chunk-MP4WGD5I.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-SPP2AXFW.mjs.map → chunk-MPE25R5P.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JIWOIKIN.mjs.map → chunk-MZ3JSTQR.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-CD7S5WQ2.mjs.map → chunk-NLPW35QO.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-ACNCA5WT.mjs.map → chunk-O7JES6EH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3TQYETUQ.mjs.map → chunk-ODUZNLIJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JH7DXVOH.mjs.map → chunk-OGHSN5AV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KW67U7EN.mjs.map → chunk-ONTYC4LL.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BF2EIXYA.mjs.map → chunk-OQ5DAOMH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-KAZ44D6B.mjs.map → chunk-OXMQRX3C.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-27GL7FOR.mjs.map → chunk-PEIP236V.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FUSW6F2O.mjs.map → chunk-PESTNRFD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BDOEZAQW.mjs.map → chunk-PHULZIKN.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JO4RFE6Y.mjs.map → chunk-PYY4E5KD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HM3DDWL2.mjs.map → chunk-QF3H56ZJ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JH4L2BAI.mjs.map → chunk-QHCEY52I.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3BOE7KMH.mjs.map → chunk-QLV3MHJI.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3XTDNJEI.mjs.map → chunk-QPGBSUO6.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-3ULRTEGS.mjs.map → chunk-RVC6PTTK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-4HACE72D.mjs.map → chunk-RYEH6TVZ.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-XPQSGRUF.mjs.map → chunk-SG7MW54O.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-A32SSEM7.mjs.map → chunk-TTIO44SD.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-U22RR2MN.mjs.map → chunk-TXC67B7S.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-QY6K7L4I.mjs.map → chunk-UYHW3YLS.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-MPQUPJUO.mjs.map → chunk-VSXD2ISB.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GPRR7WIH.mjs.map → chunk-VURQULM5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-FDKQ5GBZ.mjs.map → chunk-VW4A3BGH.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-JDIGAG2K.mjs.map → chunk-W6GE3JU3.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-LKYNZMTI.mjs.map → chunk-X3SZ7TYX.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-HAHEJ5MG.mjs.map → chunk-X4NG6T34.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VVMACGAC.mjs.map → chunk-X5SJJRGK.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-BPJEBZSS.mjs.map → chunk-XD3UF7WT.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-YBEBQWOE.mjs.map → chunk-XJHG3UI7.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-VJN2RF4O.mjs.map → chunk-XLC5VX4C.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NMVLXQXY.mjs.map → chunk-XM74E3A5.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-GRGJ3KFV.mjs.map → chunk-Y2TEUBEY.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-H3PMAMO7.mjs.map → chunk-YHIRRP3I.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-NCH6SFZ2.mjs.map → chunk-YIHOUDTV.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-7KOIS7OQ.mjs.map → chunk-YPJVICNW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-46HT52TD.mjs.map → chunk-Z7BN62GW.mjs.map} +0 -0
- /package/out/__chunks__/{chunk-N72FHB5Q.mjs.map → chunk-ZQSCQOU3.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{q as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{q as o}from"./chunk-XLC5VX4C.mjs";import{current as p}from"immer";function d({transactions:t,transactionsDisplayInfo:n,status:r,sessionInformation:s}){let a=Date.now().toString();return o().setState(({transactions:e})=>{e[a]={transactions:t,status:r,transactionsDisplayInfo:n,interpretedTransactions:{},sessionInformation:s}},!1,{type:"createTransactionsSession",payload:{value:{transactions:t,status:r,transactionsDisplayInfo:n,sessionInformation:s}}}),a}function m({sessionId:t,status:n,errorMessage:r}){o().setState(({transactions:s})=>{if(!s[t])return;let a=p(s[t]).transactionsDisplayInfo??{},e=r||a?.errorMessage;s[t].status=n,s[t].errorMessage=e,s[t].transactionsDisplayInfo={...a,errorMessage:e}},!1,{type:"updateSessionStatus",payload:{value:{sessionId:t,status:n,errorMessage:r}}})}function g({sessionId:t,transaction:n}){o().setState(({transactions:r})=>{let s=r[t]?.transactions;s!=null&&(r[t].transactions=s.map(a=>a.hash===n.hash?{...a,...n??{}}:a))},!1,{type:"updateTransactionStatus",payload:{value:{sessionId:t,transaction:n}}})}var h=()=>{o().setState(({transactions:t,toasts:n})=>{let s=Object.keys(t).filter(e=>{let c=t[e];if(!c)return!1;let{status:i}=c;return!(i==="pending"||i==="signed"||i==="sent")});s.forEach(e=>{delete t[e]});let a=n.transactionToasts.filter(e=>!s.includes(e.toastId));n.transactionToasts=a},!1,{type:"clearCompletedTransactions",payload:{value:null}})};export{d as a,m as b,g as c,h as d};
|
|
2
|
+
//# sourceMappingURL=chunk-27JXN5DJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as A}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as A}from"./chunk-QLV3MHJI.mjs";import{a as I}from"./chunk-EAJBSX6Y.mjs";import{a as b}from"./chunk-NI7XCWV5.mjs";import{g as f}from"./chunk-5YS3EQN7.mjs";import{a as S}from"./chunk-N55JEIM6.mjs";import{b as T}from"./chunk-2VG3V3VD.mjs";import{a as y}from"./chunk-27JXN5DJ.mjs";import{a as h}from"./chunk-LRMTQAPQ.mjs";import{h as g}from"./chunk-M6MN4RXG.mjs";import{s as l}from"./chunk-XLC5VX4C.mjs";import{b as m}from"./chunk-7VHTZYM2.mjs";import w from"axios";var r=class r{constructor(){this.setCallbacks=({onSuccess:t,onFail:a})=>{T({onSuccess:t,onFail:a})};this.send=async t=>{if(t.length===0)throw new Error("No transactions to send");try{if(!I(t))return await this.sendSignedTransactions(t);let a=await this.sendSignedBatchTransactions(t);if(!a.data||a.data.error)throw new Error(a.data?.error??"Failed to send transactions");return a.data.transactions}catch(a){throw a.response?.data?.message??a.message}};this.track=async(t,a={disableToasts:!1})=>{let s=this.sequentialToFlatArray(t).map(e=>({...e,status:e.status??"pending"})),o=S(s),n=y({transactions:s,transactionsDisplayInfo:a.transactionsDisplayInfo,status:o??"sent",sessionInformation:a.sessionInformation});if(a.disableToasts===!0)return n;a.onSuccess&&T({onSuccess:a.onSuccess,sessionId:n}),a.onFail&&T({onFail:a.onFail,sessionId:n});let i=A(t);return f({toastId:n,totalDuration:i}),n};this.sendSignedTransactions=async t=>{let{apiAddress:a,apiTimeout:s}=m(l());return await Promise.all(t.map(async n=>{let i=await w.post(`${a}/transactions`,n.toPlainObject(),{timeout:Number(s)}),e=i.data.txHash;return{...n.toPlainObject(),...i.data,status:"pending",hash:e}}))};this.sendSignedBatchTransactions=async t=>{let{address:a}=h(),{apiAddress:s,apiTimeout:o}=m(l());if(!a)return{error:"Invalid address provided. You need to be logged in to send transactions"};let n=this.buildBatchId(a),e={transactions:t.map(p=>p.map(c=>c.toPlainObject())),id:n},{data:u}=await w.post(`${s}/batch`,e,{timeout:Number(o)}),B=u.transactions.map(p=>p.map(c=>{let d={...c,status:"pending",hash:c.hash};return b({data:d.data})&&(delete d.senderUsername,delete d.receiverUsername),d}));return{data:{...u,transactions:B}}};this.buildBatchId=t=>`${Date.now().toString()}${g}${t}`;this.sequentialToFlatArray=(t=[])=>this.getIsSequential(t)?t.flat():t;this.getIsSequential=t=>t?.every(a=>Array.isArray(a))}static getInstance(){return r.instance||(r.instance=new r),r.instance}};r.instance=null;var v=r;export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2BY6NFOV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{q as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{q as t}from"./chunk-XLC5VX4C.mjs";var r=({key:e,value:a})=>{t().setState(({cache:c})=>{c[e]=a},!1,{type:"saveToCache",payload:{value:a}})},s=e=>{t().setState(({cache:a})=>{delete a[e]},!1,{type:"removeFromCache",payload:{value:e}})},h=()=>{t().setState(({cache:e})=>{Object.keys(e).forEach(a=>{delete e[a]})},!1,"clearCache")};export{r as a,s as b,h as c};
|
|
2
|
+
//# sourceMappingURL=chunk-2KTELDSS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-NGM3AVCY.mjs";import{s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-NGM3AVCY.mjs";import{s}from"./chunk-XLC5VX4C.mjs";import{e as a}from"./chunk-UERJ6AKK.mjs";function x(n){let e=s(),o=u(e),c=a(e),t=Object.keys(o).map(Number).reduce((r,m)=>{let i=o[m]?.transactions||[];return Math.max(r,...i.map(l=>l.nonce),0)},0);return t>0&&(t+=1),n==null?Math.max(t,c):Math.max(t,n.nonce,c)}export{x as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2LR4FGZM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-CZG3II4A.mjs";import{a as O}from"./chunk-GXB7VLJI.mjs";import{a as B}from"./chunk-PEIP236V.mjs";import{a as b}from"./chunk-MDWK7DG2.mjs";import{a as A}from"./chunk-QXC4D3AC.mjs";import{a as D}from"./chunk-GP3S6IRE.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as _}from"./chunk-PESTNRFD.mjs";import{a as R}from"./chunk-K373M2BG.mjs";import{a as j}from"./chunk-5KCP7UJT.mjs";import{s as x}from"./chunk-XLC5VX4C.mjs";import{b as v}from"./chunk-7VHTZYM2.mjs";import{a as G,c as U,f as F}from"./chunk-PJWJZHIS.mjs";import{a as w}from"./chunk-NTEMINYA.mjs";import{c as N}from"./chunk-MGFIOCA4.mjs";async function Dn({transactions:z=[],handleSign:H,guardTransactions:K=_}){let{account:{address:y,shard:h,username:E}}=k(),g=v(x()),C=B(),{allTransactions:r,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 A({baseURL:g.apiAddress});n.notifyDataUpdate(),n.initializeGasPriceMap(r.map(a=>a.transaction));let l=Y?.price,t=0,T=async()=>{let c=r[t]?.transaction,i=Number(c.nonce);try{n.updateIsLoading(!0);let{commonData:o,tokenTransaction:e,fungibleTransaction:s}=await D({allTransactions:r,currentScreenIndex:t,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:h,signedIndexes:p,parsedTransactionsByDataField:L});e&&n.updateTokenTransaction(e),s&&n.updateNonFungibleTransaction(s.type,s),n.updateCommonData(o)}catch(o){throw console.error(`Error fetching common data for transaction at index ${t}:`,o),o}finally{n.updateIsLoading(!1)}},$=()=>{t>0&&(t--,T())},q=(a=0)=>{let i=r[t].transaction,o=Number(i.nonce);n.updateGasPriceMap({nonce:o,ppu:a}),n.updateCommonData({ppu:a});let e=i.toPlainObject(),s=I({transaction:e,gasPriceData:n.ppuMap[o]}),P=w.newFromPlainObject({...e,gasPrice:s}),u=j({transaction:P,price:l}),m=F({input:s.toString(),decimals:U,addCommas:!0,digits:G});n.updateCommonData({feeLimit:u.feeLimitFormatted,feeInFiatLimit:u.feeInFiatLimit,gasPrice:m,ppu:a})},J=async()=>{M(new Error("Transaction signing cancelled by user")),await b(),n.closeUI()},f=()=>{t<n.transactionsCount-1&&(t++,T())},Q=async()=>{let c=r[t].transaction,i=Number(c.nonce),{commonData:o}=await D({allTransactions:r,currentScreenIndex:t,egldLabel:C,network:g,gasPriceData:n.ppuMap[i],price:l,address:y,username:E,shard:h,signedIndexes:p,parsedTransactionsByDataField:L});if(!o.needsSigning)return p.push(t),f();let e=c.toPlainObject(),s=e.nonce,P=I({transaction:e,gasPriceData:n.ppuMap[s]}),u=w.newFromPlainObject({...e,gasPrice:P});try{let m=await H([u]);m&&(p.push(t),d.push(m[0]));let nn=t===r.length-1,tn=r.filter(S=>S.needsSigning),an=d.length===tn.length;if(nn&&an){let S=await K(d);return n.closeUI(),X(S)}f()}catch(m){n.closeUI(),M(m)}},V=new Map([["NEXT_SIGN_TRANSACTIONS",f],["CONFIRM_SIGN_TRANSACTIONS",Q],["CLOSE_SIGN_TRANSACTIONS",J],["BACK_SIGN_TRANSACTIONS",$],["SET_PPU_SIGN_TRANSACTIONS",q]]);function Z(){for(let[a,c]of V)n.subscribeToEventBus(a,c)}Z(),await T()})}export{Dn as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3PDGEKV7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f}from"./chunk-FRDR4A7Z.mjs";import{x as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as f}from"./chunk-FRDR4A7Z.mjs";import{x as g}from"./chunk-5YS3EQN7.mjs";import{a as c}from"./chunk-HN5C6QP2.mjs";import{s as n}from"./chunk-XLC5VX4C.mjs";import{g as a}from"./chunk-UERJ6AKK.mjs";import{e as l}from"./chunk-VNLGNNIL.mjs";import{HWProvider as m}from"@multiversx/sdk-hw-provider";async function A(u){let v=c(),d=u?.shouldInitProvider||!v,o=l(n()),t=a(n()),r=g(),i=new m,I=async()=>{let e=o?.index!=null;if(r instanceof m&&r.isInitialized())return e&&await r.setAddressIndex(o.index),r;if(d&&!await i.init())throw new Error("Failed to initialize Ledger Provider");return e&&await i.setAddressIndex(o.index),i};try{if(!d&&t)return{ledgerProvider:i,ledgerConfig:{version:t.version,dataEnabled:t.hasContractDataEnabled}};let e=await I(),s=await f(e);return{ledgerProvider:e,ledgerConfig:s}}catch(e){throw console.error("Could not initialize ledger app",e),e}}export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4WCO6W5U.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as St}from"./chunk-JDIGAG2K.mjs";import{a as dt}from"./chunk-XPQSGRUF.mjs";import{a as vt}from"./chunk-6UZHM5LW.mjs";import{a as w}from"./chunk-GRGJ3KFV.mjs";import{a as wt}from"./chunk-46HT52TD.mjs";import{a as bt}from"./chunk-TP6GGLNS.mjs";import{a as It}from"./chunk-H3PMAMO7.mjs";import{a as Et}from"./chunk-TAFDGCRA.mjs";import{a as Ct}from"./chunk-ABBDCZHP.mjs";import{a as Mt}from"./chunk-4ODPAHHA.mjs";import{a as Nt}from"./chunk-TAA22QOF.mjs";import{b as x}from"./chunk-SPP2AXFW.mjs";import{a as xt}from"./chunk-HKZI76PK.mjs";import{a as At}from"./chunk-3ULRTEGS.mjs";import{a as Pt}from"./chunk-MDVI45IV.mjs";import{a as Ot}from"./chunk-CD7S5WQ2.mjs";import{a as v}from"./chunk-M2SIVB52.mjs";import{a as it}from"./chunk-ND5SC5UK.mjs";import{a as ht}from"./chunk-GPRR7WIH.mjs";import{a as E}from"./chunk-LMULG6DX.mjs";import{a as A,f as yt}from"./chunk-CO55WDEX.mjs";import{b as L,d as gt}from"./chunk-6BL2PJRI.mjs";import{k as pt,l as lt,n as Tt}from"./chunk-E2GGD7D4.mjs";import{b as Lt}from"./chunk-7KOIS7OQ.mjs";import{a as N}from"./chunk-HORSXVIV.mjs";import{a as Ft}from"./chunk-MDVHLIC7.mjs";import{a as nt}from"./chunk-NE6ED6BJ.mjs";import{a as C}from"./chunk-QTKK6OSJ.mjs";import{a as et}from"./chunk-6ACLOUQ3.mjs";import{a as I}from"./chunk-G7GU37XI.mjs";import{a as st}from"./chunk-YSCND2MX.mjs";import{a as Rt}from"./chunk-NJN53MJV.mjs";import{a as rt,b as ct,g as ut,l as mt}from"./chunk-M6MN4RXG.mjs";import{b as at}from"./chunk-NGM3AVCY.mjs";import{a as tt,b as ot,q as u,s as g}from"./chunk-VJN2RF4O.mjs";import{c as V,d as Y,f as J}from"./chunk-UERJ6AKK.mjs";import{b as h}from"./chunk-VNLGNNIL.mjs";import{b as S}from"./chunk-6JM4DPOH.mjs";import{b as Q,c as X,f as Z}from"./chunk-NTEMINYA.mjs";import{b as kt}from"./chunk-UCRVRBTA.mjs";import{a as ft}from"./chunk-4HACE72D.mjs";import{c as $}from"./chunk-HM3DDWL2.mjs";import{a as b}from"./chunk-LJX4MW7B.mjs";import K from"bignumber.js";import G from"lodash.isequal";var Bt=1e4,O=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=Bt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let o=setTimeout(()=>{F(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,o)};this.startWithCustomDuration=(t,o)=>{if(this.stop(t),o<=0)return;let e=setTimeout(()=>{P(t);let n=f[t];n?.()},o);this.timeoutIntervals.set(t,e)};this.stop=t=>{let o=this.timeoutIntervals.get(t);o&&(clearTimeout(o),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t??Bt}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};import Dt from"lodash.isequal";var Yt="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",M=class s extends ht{constructor(o){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.initialData={pendingTransactions:[],historicTransactions:[]};this.store=o||u(),this.data={...this.initialData}}static getInstance(){return s.instance||(s.instance=new s),s.instance}isNotificationsFeedOpen(){return this.isOpen}async openNotificationsFeed(){d.getInstance().hideToasts(),await this.openUI(),await this.updateDataAndNotifications();let e=this.store.subscribe(async({toasts:n,transactions:i},{toasts:r,transactions:c})=>{(!Dt(r.transactionToasts,n.transactionToasts)||!Dt(c,i))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Yt,[e]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}async handleCloseUI(){let o=d.getInstance();this.closeUI(),await o.showToasts()}async setupEventListeners(){this.eventBus&&(this.subscribeToEventBus("CLOSE_NOTIFICATIONS_FEED",this.handleCloseUI.bind(this)),this.subscribeToEventBus("CLEAR_NOTIFICATIONS_FEED_HISTORY",this.handleClearNotificationsFeedHistory.bind(this)))}async updateDataAndNotifications(){let{transactions:o}=this.store.getState(),{pendingTransactionToasts:e}=await w();this.data.pendingTransactions=e;let n=Object.keys(o).reduce((i,r)=>(["sent","pending"].includes(String(o[r].status))||(i[r]=o[r]),i),{});this.data.historicTransactions=await dt.getTransactionsHistory({transactionsSessions:n}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){gt(),this.resetData(),this.updateNotificationsFeed()}async updateNotificationsFeed(){this.eventBus&&(this.eventBus.publish("PENDING_TRANSACTIONS_UPDATE",this.data.pendingTransactions),this.eventBus.publish("TRANSACTIONS_HISTORY_UPDATE",this.data.historicTransactions))}};var k=class{constructor(t){this.toastsElement=null;this.eventBus=null;this.isCreatingElement=!1;this.eventBusUnsubscribeFunctions=[];this.onCloseToast=t.onCloseToast,this.store=t.store||u(),this.notificationsFeedManager=t.notificationsFeedManager||M.getInstance()}async init(){await this.subscribeToEventBusNotifications()}showToasts(){this.eventBus?.publish("SHOW_TOAST_LIST",null)}hideToasts(){this.eventBus?.publish("HIDE_TOAST_LIST",null)}async publishTransactionToasts(t){if(this.notificationsFeedManager.isNotificationsFeedOpen()&&this.eventBus){this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",t),this.hideToasts();return}if(!this.eventBus){let o=await this.createToastListElement();if(!o)return;this.eventBus=await o.getEventBus()}this.eventBus?.publish("TRANSACTION_TOAST_DATA_UPDATE",t)}async publishCustomToasts(t){this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",t)}handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}destroy(){this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[],this.notificationsFeedManager?.destroy()}async createToastListElement(){return this.toastsElement?this.toastsElement:(this.isCreatingElement||(this.isCreatingElement=!0,this.toastsElement=await ft.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}async subscribeToEventBusNotifications(){let t=await this.createToastListElement();if(t){if(this.eventBus=await t.getEventBus(),!this.eventBus)throw new Error("eventBus is not initialized");this.eventBus.subscribe("CLOSE_TOAST",this.onCloseToast),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("CLOSE_TOAST",this.onCloseToast)}),this.eventBus.subscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this))})}}};var d=class s{constructor(t){this.transactionToasts=[];this.customToasts=[];this.unsubscribeFromStore=()=>null;this.uiCoordinator=null;this.destroy(),this.store=t?.store||u(),this.lifetimeManager=t?.lifetimeManager??new O,this.uiCoordinator=t?.uiCoordinator??new k({onCloseToast:this.closeToast.bind(this)})}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),await this.updateTransactionToastsList(),await this.updateCustomToastList(),await this.uiCoordinator?.init(),this.unsubscribeFromStore=this.store.subscribe(async({toasts:o,transactions:e},{toasts:n,transactions:i})=>{let r=!G(n.transactionToasts,o.transactionToasts),c=!G(i,e);(r||c)&&await this.updateTransactionToastsList(),!G(n.customToasts,o.customToasts)&&await this.updateCustomToastList()})}static getInstance(){return s.instance||(s.instance=new s),s.instance}handleCompletedTransaction(t){let{transactions:o}=this.store.getState(),e=o[t];if(!e)return!1;let{status:n}=e,i=Tt(n),r=lt(n),c=pt(n),a=r||c||i;return a?(this.successfulToastLifetime&&this.lifetimeManager.start(t),a):(this.lifetimeManager.stop(t),a)}async createTransactionToast(t,o){let e=_t({toastId:t,totalDuration:o});return this.handleCompletedTransaction(t),await this.updateTransactionToastsList(),e}async createCustomToast(t){let o=B(t);return await this.updateCustomToastList(),o}async updateTransactionToastsList(){let t=this.store.getState(),{toasts:o}=t,{pendingTransactionToasts:e,completedTransactionToasts:n}=await w({store:t});this.transactionToasts=[...e,...n];for(let i of o.transactionToasts)this.handleCompletedTransaction(i.toastId);await this.publishTransactionToasts()}async updateCustomToastList(){let{toasts:t}=this.store.getState();this.customToasts=[];for(let o of t.customToasts){let n="message"in o?{...o}:{...o,instantiateToastElement:R[o.toastId]};this.customToasts.push(n),o.duration&&this.lifetimeManager.startWithCustomDuration(o.toastId,o.duration)}await this.uiCoordinator?.publishCustomToasts(this.customToasts)}handleTransactionToastClose(t){return this.handleCompletedTransaction(t)?(F(t),!0):!1}async showToasts(){this.uiCoordinator?.showToasts(),await this.updateCustomToastList(),await this.updateTransactionToastsList()}hideToasts(){this.uiCoordinator?.hideToasts()}closeToast(t){if(this.customToasts.find(e=>e.toastId===t)){this.lifetimeManager.stop(t);let e=f[t];return e?.(),P(t),!0}return this.handleTransactionToastClose(t)}async publishTransactionToasts(){await this.uiCoordinator?.publishTransactionToasts(this.transactionToasts)}destroy(){this.unsubscribeFromStore(),this.lifetimeManager?.destroy(),this.uiCoordinator?.destroy(),Ut()}};var D=class s{constructor(){this.store=u();this.warningLogoutTimeoutRef=null;this.actualLogoutTimeoutRef=null;this.plannedLogoutTimeoutRef=null;this.plannedLogoutKey=null;this.init=async()=>{if(!this.shouldStart())return;let t=this.store.getState(),o=h(t),{isExpired:e}=C(o?.nativeAuthToken);e?y().logout():this.addPlannedLogout()};this.stop=()=>{clearTimeout(this.warningLogoutTimeoutRef??0),clearTimeout(this.plannedLogoutTimeoutRef??0),clearTimeout(this.actualLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=null,this.plannedLogoutTimeoutRef=null,this.actualLogoutTimeoutRef=null,this.plannedLogoutKey=null};this.shouldStart=()=>{let t=this.store.getState(),o=h(t),e=J(t);return!!(o?.nativeAuthToken&&e)};this.addPlannedLogout=()=>{let t=y(),o=V(this.store.getState()),e=t.getType()===b.webview;if(!o||e)return;this.addLogoutWarning();let n=h(this.store.getState()),{secondsUntilExpires:i,expiresAt:r}=C(n?.nativeAuthToken),c=new K(String(i)),a=`${o}_${r}`,m=this.plannedLogoutKey===a;if(!(i&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=a,clearTimeout(this.plannedLogoutTimeoutRef??0);let l=c.times(1e3);this.actualLogoutTimeoutRef=setTimeout(()=>{d.getInstance().createCustomToast({toastId:"native-auth-logout",iconClassName:"warning",title:"Logging out",icon:"close",message:"Your session has expired!"}),this.actualLogoutTimeoutRef=null},l.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},l.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=S(this.store.getState()),o=h(this.store.getState()),{secondsUntilExpires:e}=C(o?.nativeAuthToken),n=new K(String(e)),i=n.times(1e3);if(!e||n.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new K(t?.tokenExpirationToastWarningSeconds??0).times(1e3),a=n.times(1e3).minus(c),m=vt(i.toNumber()),p=a.isLessThanOrEqualTo(0)?0:a.toNumber();clearTimeout(this.warningLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=setTimeout(()=>{d.getInstance().createCustomToast({toastId:"native-auth-expired",iconClassName:"warning",title:"Session Expiration Warning",icon:"hourglass",message:`Your session will expire in ${m}!`}),this.warningLogoutTimeoutRef=null},p)}}static getInstance(){return s.instance||(s.instance=new s),s.instance}};async function Wt({sessionId:s,transactionBatch:t,isSequential:o}){try{if(t==null)return;let e=bt(),n=Ct(t),i=await St(n);for(let T of i)await It({serverTransaction:T,sessionId:s,isSequential:o});if(!i.every(T=>T.status!=="pending"))return;e&&await U();let{transactions:c}=g(),a=c?.[s];if(a.transactions.every(T=>T.status==="success"))return L({sessionId:s,status:"success"});if(a.transactions.some(T=>T.status==="fail"))return L({sessionId:s,status:"fail"});if(a.transactions.every(T=>T.status==="not executed"))return L({sessionId:s,status:"invalid"})}catch(e){console.error(e)}}async function Ht(){let s=at(g()),t=Object.entries(s);t.length!==0&&await Promise.all(t.map(([o,{transactions:e}])=>Wt({sessionId:o,transactionBatch:e})))}async function _(){let s=u(),t=Et(),o=null,e=Y(s.getState())?.timestamp??null,n=async()=>{try{await Ht()}catch(p){console.error("[trackTransactions] Error checking transaction status:",p)}},i=()=>{o||(o=setInterval(n,t))},r=()=>{o&&(clearInterval(o),o=null)},c=()=>{r();let p=s.subscribe(({account:{websocketEvent:l}})=>{l?.message&&l.timestamp!=null&&e!==l.timestamp&&(e=l.timestamp,n())});$.set("websocketEventReceived",p)};n();let a=()=>{r()},m=s.subscribe(({account:{address:p},config:{websocketStatus:l}},T)=>{if(T.config.websocketStatus!==l)switch(l){case"completed":c();break;case"pending":i();break;default:p?i():a();break}});return $.set("websocketStatusChanged",m),{stopTransactionsTracking:a}}async function j({address:s,provider:t,apiAddress:o}){let e=await I({address:s,baseURL:o});if(!e)throw new Error("Account not found");Lt({address:s,providerType:t.getType()});let n={...e,username:N(e.username),nonce:E(e)};A(n),await x(s),_(),e.shard!=null&&await wt({shard:Number(e.shard),apiAddress:o})}async function Qt(s){let{network:{apiAddress:t}}=v();await s.login();let o=await s.getAddress();if(!o)throw new Error("Address not found");return await j({address:o,provider:s,apiAddress:t}),{address:o}}async function Xt({provider:s,nativeAuthConfig:t,token:o}){let{network:{apiAddress:e}}=v(),n=nt(t),i=o;i||(i=await n.initialize({noCache:!0}));let r=await s.login({token:i}),{address:c,signature:a,...m}=r;if(!c)return console.warn("Login cancelled."),null;if(!a)return console.error("Failed to sign login token"),null;let p=et(m?.accessToken),l=await xt({loginData:r,nativeAuthConfig:t,loginToken:i}),T=p?m.accessToken:n.getToken({address:c,token:l,signature:a});ot({loginToken:i,signature:a,nativeAuthToken:T});let H=await At({loginToken:i,extraInfoData:{multisig:m?.multisig,impersonate:m?.impersonate},address:c});return await j({address:H,provider:s,apiAddress:e}),{address:H,signature:a}}async function $t(s,t){let o=S(g());if(o)return await Xt({provider:s,nativeAuthConfig:o,token:t?.token});let{address:e}=await Qt(s);return await x(e),_(),{address:e,signature:""}}var z={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${ct}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${rt}-${Date.now()}`}},Zt={extensionResponse:"Unable to sign transactions","Transaction canceled":"Transaction canceled","cancelled by user":"Transaction signing cancelled by user","denied by the user":"Transaction signing denied by the user"},to=s=>{for(let[t,o]of Object.entries(Zt))if(s.includes(t))return o;return"Error when signing"};function q(s,t="error"){let o=s?.message,e=to(o),i=e!=="Error when signing"?"warning":t,r=Object.keys(z).includes(i)?z[i]:z.error,{toastId:c,iconClassName:a,title:m}=r;return B({toastId:c,duration:1e4,icon:"close",iconClassName:a,message:e,title:m}),e}async function Gt({provider:s,transactions:t,options:o={}}){await U();let{isGuarded:e,activeGuardianAddress:n,nonce:i}=Ft(),r=s.getType()===b.ledger,c=Mt({latestNonce:i,transactions:t}),a=n&&e&&!o.skipGuardian?c?.map(p=>(p.version=Q.withTxOptions().valueOf(),p.options=Z.withOptions({guarded:!0,...r?{hashSign:!0}:{}}).valueOf(),p.guardian=X.newFromBech32(n),p)):c,m=await s.signTransactions(a)??[];return yt(i+m.length),m}var W=class{constructor(t){this._isLoggingOut=!1;this.provider=t}init(){return this.provider.init()}async login(t){let o=await $t(this.provider,t);return tt(this.provider.getType()),Kt(this),D.getInstance().init(),o}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0}){if(this._isLoggingOut)return console.warn("Logout already in progress"),!1;this._isLoggingOut=!0;let o=await Nt({provider:this.provider,options:t});return this._isLoggingOut=!1,o}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,o){try{return await Gt({provider:this.provider,transactions:t,options:o})}catch(e){let n=q(e);throw new Error(n)}}async signMessage(t,o){try{return await Ot({provider:this.provider,message:t,options:o})}catch(e){let n=q(e,"warning");throw new Error(n)}}async verifyMessage(t){return await Pt(t)}cancelLogin(){this.provider.cancelLogin?.()}};var jt=null;function Kt(s){jt=s}function y(){return jt||new W(kt)}var oo=async()=>{try{let s=it(),{network:t}=v();try{let o=await I({address:s,baseURL:t.apiAddress});if(o!=null){let e={...o,username:N(o.username),nonce:E(o)};return A(e),e}}catch(o){console.error("Failed getting account ",o)}}catch(s){console.error("Failed getting address ",s)}return null};async function U(){let s=y();if(s==null)throw"Provider not initialized";try{if(!s.init)throw"Current provider does not have init() function";return await s.init()?await oo():void 0}catch(t){console.error("Failed initializing provider ",t)}}var R={},f={},so=(s,t)=>{u().setState(({toasts:o})=>{let e=o.customToasts.length>0?Math.max(...o.customToasts.map(a=>parseInt(a.toastId.split("-").pop()??"0"))):0,n=t??`custom-toast-${e+1}`,i=o.customToasts.findIndex(a=>a.toastId===n),r={...s,toastId:n};if(i!==-1){o.customToasts[i]=r;return}o.customToasts.push({...r,toastId:n})},!1,{type:"addCustomToast",payload:{value:{customToast:s,currentToastId:t}}})},P=s=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(o=>o.toastId!==s)},!1,{type:"removeCustomToast",payload:{value:s}})},Ut=()=>{u().setState(({toasts:s})=>{s.customToasts=[]},!1,{type:"removeAllCustomToasts",payload:{value:null}})},an=()=>{u().setState(({toasts:s})=>{s.transactionToasts=[]})},_t=({toastId:s,totalDuration:t})=>{let o="";return u().setState(({toasts:e})=>{let n=e.transactionToasts.length>0?Math.max(...e.transactionToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0;o=s??`transaction-toast-${n+1}`,e.transactionToasts.push({startTime:st(),endTime:Rt(t),toastId:o})},!1,"addTransactionToast"),o},F=s=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(o=>o.toastId!==s)},!1,"removeTransactionToast"),delete f[s],delete R[s]},B=s=>{let{toasts:t}=u().getState(),o=t.customToasts.length>0?Math.max(...t.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,e=s.toastId||`custom-toast-${o+1}`;return s.onClose&&(f[e]=s.onClose),s.instantiateToastElement?(R[e]=s.instantiateToastElement,u().setState(({toasts:n})=>{let i=n.customToasts.findIndex(a=>a.toastId===e),r={...s,instantiateToastElement:null,toastId:e};i!==-1?n.customToasts[i]=r:n.customToasts.push(r)},!1,"createCustomToast"),e):(so(s,e),e)};export{R as a,f as b,so as c,P as d,Ut as e,an as f,_t as g,F as h,B as i,O as j,M as k,k as l,d as m,D as n,Wt as o,Ht as p,_ as q,j as r,$t as s,q as t,Gt as u,W as v,Kt as w,y as x,U as y};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as St}from"./chunk-W6GE3JU3.mjs";import{a as dt}from"./chunk-SG7MW54O.mjs";import{a as vt}from"./chunk-6UZHM5LW.mjs";import{a as w}from"./chunk-Y2TEUBEY.mjs";import{a as wt}from"./chunk-Z7BN62GW.mjs";import{a as bt}from"./chunk-HN5C6QP2.mjs";import{a as It}from"./chunk-YHIRRP3I.mjs";import{a as Et}from"./chunk-ACR5GMV4.mjs";import{a as Ct}from"./chunk-ABBDCZHP.mjs";import{a as Mt}from"./chunk-4ODPAHHA.mjs";import{a as Nt}from"./chunk-M4Q4I6RI.mjs";import{b as x}from"./chunk-MPE25R5P.mjs";import{a as xt}from"./chunk-JYZ7RSRP.mjs";import{a as At}from"./chunk-RVC6PTTK.mjs";import{a as Pt}from"./chunk-MDVI45IV.mjs";import{a as Ot}from"./chunk-NLPW35QO.mjs";import{a as v}from"./chunk-MJ6HKT3C.mjs";import{a as it}from"./chunk-MORYV6AT.mjs";import{a as ht}from"./chunk-VURQULM5.mjs";import{a as E}from"./chunk-2LR4FGZM.mjs";import{a as A,f as yt}from"./chunk-C5D6KKDO.mjs";import{b as L,d as gt}from"./chunk-27JXN5DJ.mjs";import{k as pt,l as lt,n as Tt}from"./chunk-E2GGD7D4.mjs";import{b as Lt}from"./chunk-YPJVICNW.mjs";import{a as N}from"./chunk-HORSXVIV.mjs";import{a as Ft}from"./chunk-LRMTQAPQ.mjs";import{a as nt}from"./chunk-KHLS5Q36.mjs";import{a as C}from"./chunk-QTKK6OSJ.mjs";import{a as et}from"./chunk-6ACLOUQ3.mjs";import{a as I}from"./chunk-G7GU37XI.mjs";import{a as st}from"./chunk-YSCND2MX.mjs";import{a as Rt}from"./chunk-NJN53MJV.mjs";import{a as rt,b as ct,g as ut,l as mt}from"./chunk-M6MN4RXG.mjs";import{b as at}from"./chunk-NGM3AVCY.mjs";import{a as tt,b as ot,q as u,s as g}from"./chunk-XLC5VX4C.mjs";import{c as V,d as Y,f as J}from"./chunk-UERJ6AKK.mjs";import{b as h}from"./chunk-VNLGNNIL.mjs";import{b as S}from"./chunk-6JM4DPOH.mjs";import{b as Q,c as X,f as Z}from"./chunk-NTEMINYA.mjs";import{b as kt}from"./chunk-UCRVRBTA.mjs";import{a as ft}from"./chunk-RYEH6TVZ.mjs";import{c as $}from"./chunk-QF3H56ZJ.mjs";import{a as b}from"./chunk-LJX4MW7B.mjs";import K from"bignumber.js";import G from"lodash.isequal";var Bt=1e4,O=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=Bt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let o=setTimeout(()=>{F(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,o)};this.startWithCustomDuration=(t,o)=>{if(this.stop(t),o<=0)return;let e=setTimeout(()=>{P(t);let n=f[t];n?.()},o);this.timeoutIntervals.set(t,e)};this.stop=t=>{let o=this.timeoutIntervals.get(t);o&&(clearTimeout(o),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t??Bt}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};import Dt from"lodash.isequal";var Yt="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",M=class s extends ht{constructor(o){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.initialData={pendingTransactions:[],historicTransactions:[]};this.store=o||u(),this.data={...this.initialData}}static getInstance(){return s.instance||(s.instance=new s),s.instance}isNotificationsFeedOpen(){return this.isOpen}async openNotificationsFeed(){d.getInstance().hideToasts(),await this.openUI(),await this.updateDataAndNotifications();let e=this.store.subscribe(async({toasts:n,transactions:i},{toasts:r,transactions:c})=>{(!Dt(r.transactionToasts,n.transactionToasts)||!Dt(c,i))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Yt,[e]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}async handleCloseUI(){let o=d.getInstance();this.closeUI(),await o.showToasts()}async setupEventListeners(){this.eventBus&&(this.subscribeToEventBus("CLOSE_NOTIFICATIONS_FEED",this.handleCloseUI.bind(this)),this.subscribeToEventBus("CLEAR_NOTIFICATIONS_FEED_HISTORY",this.handleClearNotificationsFeedHistory.bind(this)))}async updateDataAndNotifications(){let{transactions:o}=this.store.getState(),{pendingTransactionToasts:e}=await w();this.data.pendingTransactions=e;let n=Object.keys(o).reduce((i,r)=>(["sent","pending"].includes(String(o[r].status))||(i[r]=o[r]),i),{});this.data.historicTransactions=await dt.getTransactionsHistory({transactionsSessions:n}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){gt(),this.resetData(),this.updateNotificationsFeed()}async updateNotificationsFeed(){this.eventBus&&(this.eventBus.publish("PENDING_TRANSACTIONS_UPDATE",this.data.pendingTransactions),this.eventBus.publish("TRANSACTIONS_HISTORY_UPDATE",this.data.historicTransactions))}};var k=class{constructor(t){this.toastsElement=null;this.eventBus=null;this.isCreatingElement=!1;this.eventBusUnsubscribeFunctions=[];this.onCloseToast=t.onCloseToast,this.store=t.store||u(),this.notificationsFeedManager=t.notificationsFeedManager||M.getInstance()}async init(){await this.subscribeToEventBusNotifications()}showToasts(){this.eventBus?.publish("SHOW_TOAST_LIST",null)}hideToasts(){this.eventBus?.publish("HIDE_TOAST_LIST",null)}async publishTransactionToasts(t){if(this.notificationsFeedManager.isNotificationsFeedOpen()&&this.eventBus){this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",t),this.hideToasts();return}if(!this.eventBus){let o=await this.createToastListElement();if(!o)return;this.eventBus=await o.getEventBus()}this.eventBus?.publish("TRANSACTION_TOAST_DATA_UPDATE",t)}async publishCustomToasts(t){this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",t)}handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}destroy(){this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[],this.notificationsFeedManager?.destroy()}async createToastListElement(){return this.toastsElement?this.toastsElement:(this.isCreatingElement||(this.isCreatingElement=!0,this.toastsElement=await ft.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}async subscribeToEventBusNotifications(){let t=await this.createToastListElement();if(t){if(this.eventBus=await t.getEventBus(),!this.eventBus)throw new Error("eventBus is not initialized");this.eventBus.subscribe("CLOSE_TOAST",this.onCloseToast),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("CLOSE_TOAST",this.onCloseToast)}),this.eventBus.subscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this))})}}};var d=class s{constructor(t){this.transactionToasts=[];this.customToasts=[];this.unsubscribeFromStore=()=>null;this.uiCoordinator=null;this.destroy(),this.store=t?.store||u(),this.lifetimeManager=t?.lifetimeManager??new O,this.uiCoordinator=t?.uiCoordinator??new k({onCloseToast:this.closeToast.bind(this)})}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),await this.updateTransactionToastsList(),await this.updateCustomToastList(),await this.uiCoordinator?.init(),this.unsubscribeFromStore=this.store.subscribe(async({toasts:o,transactions:e},{toasts:n,transactions:i})=>{let r=!G(n.transactionToasts,o.transactionToasts),c=!G(i,e);(r||c)&&await this.updateTransactionToastsList(),!G(n.customToasts,o.customToasts)&&await this.updateCustomToastList()})}static getInstance(){return s.instance||(s.instance=new s),s.instance}handleCompletedTransaction(t){let{transactions:o}=this.store.getState(),e=o[t];if(!e)return!1;let{status:n}=e,i=Tt(n),r=lt(n),c=pt(n),a=r||c||i;return a?(this.successfulToastLifetime&&this.lifetimeManager.start(t),a):(this.lifetimeManager.stop(t),a)}async createTransactionToast(t,o){let e=_t({toastId:t,totalDuration:o});return this.handleCompletedTransaction(t),await this.updateTransactionToastsList(),e}async createCustomToast(t){let o=B(t);return await this.updateCustomToastList(),o}async updateTransactionToastsList(){let t=this.store.getState(),{toasts:o}=t,{pendingTransactionToasts:e,completedTransactionToasts:n}=await w({store:t});this.transactionToasts=[...e,...n];for(let i of o.transactionToasts)this.handleCompletedTransaction(i.toastId);await this.publishTransactionToasts()}async updateCustomToastList(){let{toasts:t}=this.store.getState();this.customToasts=[];for(let o of t.customToasts){let n="message"in o?{...o}:{...o,instantiateToastElement:R[o.toastId]};this.customToasts.push(n),o.duration&&this.lifetimeManager.startWithCustomDuration(o.toastId,o.duration)}await this.uiCoordinator?.publishCustomToasts(this.customToasts)}handleTransactionToastClose(t){return this.handleCompletedTransaction(t)?(F(t),!0):!1}async showToasts(){this.uiCoordinator?.showToasts(),await this.updateCustomToastList(),await this.updateTransactionToastsList()}hideToasts(){this.uiCoordinator?.hideToasts()}closeToast(t){if(this.customToasts.find(e=>e.toastId===t)){this.lifetimeManager.stop(t);let e=f[t];return e?.(),P(t),!0}return this.handleTransactionToastClose(t)}async publishTransactionToasts(){await this.uiCoordinator?.publishTransactionToasts(this.transactionToasts)}destroy(){this.unsubscribeFromStore(),this.lifetimeManager?.destroy(),this.uiCoordinator?.destroy(),Ut()}};var D=class s{constructor(){this.store=u();this.warningLogoutTimeoutRef=null;this.actualLogoutTimeoutRef=null;this.plannedLogoutTimeoutRef=null;this.plannedLogoutKey=null;this.init=async()=>{if(!this.shouldStart())return;let t=this.store.getState(),o=h(t),{isExpired:e}=C(o?.nativeAuthToken);e?y().logout():this.addPlannedLogout()};this.stop=()=>{clearTimeout(this.warningLogoutTimeoutRef??0),clearTimeout(this.plannedLogoutTimeoutRef??0),clearTimeout(this.actualLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=null,this.plannedLogoutTimeoutRef=null,this.actualLogoutTimeoutRef=null,this.plannedLogoutKey=null};this.shouldStart=()=>{let t=this.store.getState(),o=h(t),e=J(t);return!!(o?.nativeAuthToken&&e)};this.addPlannedLogout=()=>{let t=y(),o=V(this.store.getState()),e=t.getType()===b.webview;if(!o||e)return;this.addLogoutWarning();let n=h(this.store.getState()),{secondsUntilExpires:i,expiresAt:r}=C(n?.nativeAuthToken),c=new K(String(i)),a=`${o}_${r}`,m=this.plannedLogoutKey===a;if(!(i&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=a,clearTimeout(this.plannedLogoutTimeoutRef??0);let l=c.times(1e3);this.actualLogoutTimeoutRef=setTimeout(()=>{d.getInstance().createCustomToast({toastId:"native-auth-logout",iconClassName:"warning",title:"Logging out",icon:"close",message:"Your session has expired!"}),this.actualLogoutTimeoutRef=null},l.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},l.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=S(this.store.getState()),o=h(this.store.getState()),{secondsUntilExpires:e}=C(o?.nativeAuthToken),n=new K(String(e)),i=n.times(1e3);if(!e||n.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new K(t?.tokenExpirationToastWarningSeconds??0).times(1e3),a=n.times(1e3).minus(c),m=vt(i.toNumber()),p=a.isLessThanOrEqualTo(0)?0:a.toNumber();clearTimeout(this.warningLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=setTimeout(()=>{d.getInstance().createCustomToast({toastId:"native-auth-expired",iconClassName:"warning",title:"Session Expiration Warning",icon:"hourglass",message:`Your session will expire in ${m}!`}),this.warningLogoutTimeoutRef=null},p)}}static getInstance(){return s.instance||(s.instance=new s),s.instance}};async function Wt({sessionId:s,transactionBatch:t,isSequential:o}){try{if(t==null)return;let e=bt(),n=Ct(t),i=await St(n);for(let T of i)await It({serverTransaction:T,sessionId:s,isSequential:o});if(!i.every(T=>T.status!=="pending"))return;e&&await U();let{transactions:c}=g(),a=c?.[s];if(a.transactions.every(T=>T.status==="success"))return L({sessionId:s,status:"success"});if(a.transactions.some(T=>T.status==="fail"))return L({sessionId:s,status:"fail"});if(a.transactions.every(T=>T.status==="not executed"))return L({sessionId:s,status:"invalid"})}catch(e){console.error(e)}}async function Ht(){let s=at(g()),t=Object.entries(s);t.length!==0&&await Promise.all(t.map(([o,{transactions:e}])=>Wt({sessionId:o,transactionBatch:e})))}async function _(){let s=u(),t=Et(),o=null,e=Y(s.getState())?.timestamp??null,n=async()=>{try{await Ht()}catch(p){console.error("[trackTransactions] Error checking transaction status:",p)}},i=()=>{o||(o=setInterval(n,t))},r=()=>{o&&(clearInterval(o),o=null)},c=()=>{r();let p=s.subscribe(({account:{websocketEvent:l}})=>{l?.message&&l.timestamp!=null&&e!==l.timestamp&&(e=l.timestamp,n())});$.set("websocketEventReceived",p)};n();let a=()=>{r()},m=s.subscribe(({account:{address:p},config:{websocketStatus:l}},T)=>{if(T.config.websocketStatus!==l)switch(l){case"completed":c();break;case"pending":i();break;default:p?i():a();break}});return $.set("websocketStatusChanged",m),{stopTransactionsTracking:a}}async function j({address:s,provider:t,apiAddress:o}){let e=await I({address:s,baseURL:o});if(!e)throw new Error("Account not found");Lt({address:s,providerType:t.getType()});let n={...e,username:N(e.username),nonce:E(e)};A(n),await x(s),_(),e.shard!=null&&await wt({shard:Number(e.shard),apiAddress:o})}async function Qt(s){let{network:{apiAddress:t}}=v();await s.login();let o=await s.getAddress();if(!o)throw new Error("Address not found");return await j({address:o,provider:s,apiAddress:t}),{address:o}}async function Xt({provider:s,nativeAuthConfig:t,token:o}){let{network:{apiAddress:e}}=v(),n=nt(t),i=o;i||(i=await n.initialize({noCache:!0}));let r=await s.login({token:i}),{address:c,signature:a,...m}=r;if(!c)return console.warn("Login cancelled."),null;if(!a)return console.error("Failed to sign login token"),null;let p=et(m?.accessToken),l=await xt({loginData:r,nativeAuthConfig:t,loginToken:i}),T=p?m.accessToken:n.getToken({address:c,token:l,signature:a});ot({loginToken:i,signature:a,nativeAuthToken:T});let H=await At({loginToken:i,extraInfoData:{multisig:m?.multisig,impersonate:m?.impersonate},address:c});return await j({address:H,provider:s,apiAddress:e}),{address:H,signature:a}}async function $t(s,t){let o=S(g());if(o)return await Xt({provider:s,nativeAuthConfig:o,token:t?.token});let{address:e}=await Qt(s);return await x(e),_(),{address:e,signature:""}}var z={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${ct}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${rt}-${Date.now()}`}},Zt={extensionResponse:"Unable to sign transactions","Transaction canceled":"Transaction canceled","cancelled by user":"Transaction signing cancelled by user","denied by the user":"Transaction signing denied by the user"},to=s=>{for(let[t,o]of Object.entries(Zt))if(s.includes(t))return o;return"Error when signing"};function q(s,t="error"){let o=s?.message,e=to(o),i=e!=="Error when signing"?"warning":t,r=Object.keys(z).includes(i)?z[i]:z.error,{toastId:c,iconClassName:a,title:m}=r;return B({toastId:c,duration:1e4,icon:"close",iconClassName:a,message:e,title:m}),e}async function Gt({provider:s,transactions:t,options:o={}}){await U();let{isGuarded:e,activeGuardianAddress:n,nonce:i}=Ft(),r=s.getType()===b.ledger,c=Mt({latestNonce:i,transactions:t}),a=n&&e&&!o.skipGuardian?c?.map(p=>(p.version=Q.withTxOptions().valueOf(),p.options=Z.withOptions({guarded:!0,...r?{hashSign:!0}:{}}).valueOf(),p.guardian=X.newFromBech32(n),p)):c,m=await s.signTransactions(a)??[];return yt(i+m.length),m}var W=class{constructor(t){this._isLoggingOut=!1;this.provider=t}init(){return this.provider.init()}async login(t){let o=await $t(this.provider,t);return tt(this.provider.getType()),Kt(this),D.getInstance().init(),o}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0}){if(this._isLoggingOut)return console.warn("Logout already in progress"),!1;this._isLoggingOut=!0;let o=await Nt({provider:this.provider,options:t});return this._isLoggingOut=!1,o}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,o){try{return await Gt({provider:this.provider,transactions:t,options:o})}catch(e){let n=q(e);throw new Error(n)}}async signMessage(t,o){try{return await Ot({provider:this.provider,message:t,options:o})}catch(e){let n=q(e,"warning");throw new Error(n)}}async verifyMessage(t){return await Pt(t)}cancelLogin(){this.provider.cancelLogin?.()}};var jt=null;function Kt(s){jt=s}function y(){return jt||new W(kt)}var oo=async()=>{try{let s=it(),{network:t}=v();try{let o=await I({address:s,baseURL:t.apiAddress});if(o!=null){let e={...o,username:N(o.username),nonce:E(o)};return A(e),e}}catch(o){console.error("Failed getting account ",o)}}catch(s){console.error("Failed getting address ",s)}return null};async function U(){let s=y();if(s==null)throw"Provider not initialized";try{if(!s.init)throw"Current provider does not have init() function";return await s.init()?await oo():void 0}catch(t){console.error("Failed initializing provider ",t)}}var R={},f={},so=(s,t)=>{u().setState(({toasts:o})=>{let e=o.customToasts.length>0?Math.max(...o.customToasts.map(a=>parseInt(a.toastId.split("-").pop()??"0"))):0,n=t??`custom-toast-${e+1}`,i=o.customToasts.findIndex(a=>a.toastId===n),r={...s,toastId:n};if(i!==-1){o.customToasts[i]=r;return}o.customToasts.push({...r,toastId:n})},!1,{type:"addCustomToast",payload:{value:{customToast:s,currentToastId:t}}})},P=s=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(o=>o.toastId!==s)},!1,{type:"removeCustomToast",payload:{value:s}})},Ut=()=>{u().setState(({toasts:s})=>{s.customToasts=[]},!1,{type:"removeAllCustomToasts",payload:{value:null}})},an=()=>{u().setState(({toasts:s})=>{s.transactionToasts=[]})},_t=({toastId:s,totalDuration:t})=>{let o="";return u().setState(({toasts:e})=>{let n=e.transactionToasts.length>0?Math.max(...e.transactionToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0;o=s??`transaction-toast-${n+1}`,e.transactionToasts.push({startTime:st(),endTime:Rt(t),toastId:o})},!1,"addTransactionToast"),o},F=s=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(o=>o.toastId!==s)},!1,"removeTransactionToast"),delete f[s],delete R[s]},B=s=>{let{toasts:t}=u().getState(),o=t.customToasts.length>0?Math.max(...t.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,e=s.toastId||`custom-toast-${o+1}`;return s.onClose&&(f[e]=s.onClose),s.instantiateToastElement?(R[e]=s.instantiateToastElement,u().setState(({toasts:n})=>{let i=n.customToasts.findIndex(a=>a.toastId===e),r={...s,instantiateToastElement:null,toastId:e};i!==-1?n.customToasts[i]=r:n.customToasts.push(r)},!1,"createCustomToast"),e):(so(s,e),e)};export{R as a,f as b,so as c,P as d,Ut as e,an as f,_t as g,F as h,B as i,O as j,M as k,k as l,d as m,D as n,Wt as o,Ht as p,_ as q,j as r,$t as s,q as t,Gt as u,W as v,Kt as w,y as x,U as y};
|
|
2
|
+
//# sourceMappingURL=chunk-5YS3EQN7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{s as e}from"./chunk-XLC5VX4C.mjs";import{b as o}from"./chunk-7VHTZYM2.mjs";import{a as i}from"./chunk-CKTFPRJS.mjs";var n="https://api.multiversx.com",s=60*60*24,a=5*60,d=t=>{let r=o(e());return{origin:t?.origin||i().origin,apiAddress:t?.apiAddress||r.apiAddress||n,expirySeconds:t?.expirySeconds||s,tokenExpirationToastWarningSeconds:t?.tokenExpirationToastWarningSeconds||a}};export{d as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6EU6P4JK.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as S}from"./chunk-2KTELDSS.mjs";import{a as u}from"./chunk-3LP3BS6C.mjs";import{a as l}from"./chunk-WCEZVGFB.mjs";import{s as f}from"./chunk-XLC5VX4C.mjs";import{c as T}from"./chunk-UERJ6AKK.mjs";import{f as h,g as d}from"./chunk-7VHTZYM2.mjs";var I=r=>r.sort((n,t)=>t.timestamp-n.timestamp),M=async({transactions:r,...n})=>{let t=n.store??f(),o=[],i=[];if(r.forEach(s=>{let e=u(s.hash,t);e?o.push(e):i.push(s.hash)}),i.length===0)return I(o);let c=r.map(s=>({...s,txHash:s.hash})),g=c.map(s=>s.txHash),p=i.filter(s=>!g.includes(s));if(p.length>0){let e=r.filter(a=>p.includes(a.hash)).map(a=>({...a,txHash:a.hash,price:0,status:"pending",gasUsed:0,miniBlockHash:"",receiverShard:0,round:0,senderShard:0,timestamp:Date.now()}));c.push(...e)}let m=new Map;return o.forEach(s=>{let e=s.hash;e&&m.set(String(e),s)}),c.forEach(s=>{let e=l({transaction:s,address:T(t),explorerAddress:d(t),egldLabel:h(t)});e.status!=="pending"&&S({key:`transaction-${s.txHash}`,value:e}),m.set(s.txHash,e)}),I(Array.from(m.values()))};export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-A6MLJR2A.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-A6MLJR2A.mjs";import a from"lodash.isempty";var e=async({transactionsSessions:t})=>{if(a(t))return[];let i=s(t);return r({transactions:i})};export{e as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BV36TINM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-D332ESHD.mjs";var i=String(o?.navigator?.userAgent),t=/^((?!chrome|android).)*safari/i.test(i),r=/firefox/i.test(i)&&/windows/i.test(i),n=t||r;export{t as a,n as b};
|
|
2
|
+
//# sourceMappingURL=chunk-BXNWMWZJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{q as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{q as o}from"./chunk-XLC5VX4C.mjs";import{a as c}from"./chunk-JMC7CMTU.mjs";var p=t=>{o().setState(({account:e})=>{let s=e.address===t.address;e.accounts={[e.address]:s?t:c}},!1,{type:"setAccount",payload:{value:t}})},r=t=>o().setState(({account:e})=>{e.ledgerAccount=t},!1,{type:"setLedgerAccount",payload:{value:t}}),u=t=>o().setState(({account:e})=>{e.walletConnectAccount=t},!1,{type:"setWalletConnectAccount",payload:{value:t}}),l=t=>o().setState(({account:e})=>{e.websocketEvent={timestamp:Date.now(),message:t}},!1,{type:"setWebsocketEvent",payload:{value:t}}),d=t=>o().setState(({account:e})=>{e.websocketBatchEvent={timestamp:Date.now(),data:t}},!1,{type:"setWebsocketBatchEvent",payload:{value:t}}),y=t=>{o().setState(({account:e})=>{e.accounts[e.address].nonce=t},!1,{type:"setAccountNonce",payload:{value:t}})};export{p as a,r as b,u as c,l as d,d as e,y as f};
|
|
2
|
+
//# sourceMappingURL=chunk-C5D6KKDO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-MEWJKXYC.mjs";import{a as e}from"./chunk-MORYV6AT.mjs";import{a as i}from"./chunk-6R2WFQ7U.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-CHSOALST.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/constants/window.constants.ts"],
|
|
4
|
-
"sourcesContent": ["export const safeWindow: Window =\n typeof window !== 'undefined' ? window : ({} as Window);\n\nexport const version = '5.2.
|
|
4
|
+
"sourcesContent": ["export const safeWindow: Window =\n typeof window !== 'undefined' ? window : ({} as Window);\n\nexport const version = '5.2.14-alpha.1'; // will be replaced at build time\n"],
|
|
5
5
|
"mappings": "AAAO,IAAMA,EACX,OAAO,OAAW,IAAc,OAAU,CAAC,EAEhCC,EAAU",
|
|
6
6
|
"names": ["safeWindow", "version"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{s as t}from"./chunk-XLC5VX4C.mjs";import{d as e}from"./chunk-7VHTZYM2.mjs";import{x as r}from"./chunk-KD2IQ32V.mjs";import i from"axios";var c=async(s,a={apiAddress:""})=>{let{data:o}=await i.get(`${a.apiAddress||e(t())}/${r}`,{params:{hashes:s.join(","),withScResults:!0}});return o};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DS5BMHCD.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as T}from"./chunk-Q2Q4XN4M.mjs";import{b as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as T}from"./chunk-Q2Q4XN4M.mjs";import{b as u}from"./chunk-H3CEKEGG.mjs";import{d as m,e as l}from"./chunk-C5D6KKDO.mjs";import{q as a}from"./chunk-XLC5VX4C.mjs";import{b as r}from"./chunk-7VHTZYM2.mjs";import{b as t}from"./chunk-GGBMHKR4.mjs";import{io as y}from"socket.io-client";var A=3e3,g=3,w=500,E=500,f="batchUpdated",p="connect",N="connect_error",b="disconnect";async function M(i){let{apiAddress:k,websocketUrl:I}=r(a().getState());if(!i)throw new Error("Websocket could not be initialized: address missing");let o=null,n=null,c=e=>{t.status=e,u(e)},d=e=>{o&&clearTimeout(o),o=setTimeout(()=>{m(e)},E)},C=e=>{n&&clearTimeout(n),n=setTimeout(()=>{l(e)},E)},W=()=>{let e=t.instance;e&&(e.off(N),e.off(p),e.off(f),e.off(b),e.close(),console.log("Websocket disconnected.")),c("not_initialized"),t.instance=null,o&&clearTimeout(o),n&&clearTimeout(n)},S=async()=>{c("pending");let e=I??await T(k);if(!e){c("not_initialized");return}t.instance=y(e,{forceNew:!0,reconnection:!0,reconnectionAttempts:g,reconnectionDelay:w,timeout:A,query:{address:i}}),t.instance.onAny(d),t.instance.on(f,C),t.instance.on(p,()=>{console.log("Websocket connected."),c("completed")}),t.instance.on(N,s=>{console.warn("Websocket connect error: ",s.message)}),t.instance.on(b,s=>{console.warn("Websocket disconnected: ",s),c("pending")})};return t.status==="not_initialized"&&!t.instance?.active&&await S(),{closeConnection:W}}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-EWHHZE2Y.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as r,c as n}from"./chunk-QJGFIK7H.mjs";import{x as g}from"./chunk-5YS3EQN7.mjs";import{q as M}from"./chunk-XLC5VX4C.mjs";import{a as d}from"./chunk-UERJ6AKK.mjs";import{a as u,c as l,g as p}from"./chunk-NTEMINYA.mjs";import{a as c}from"./chunk-D332ESHD.mjs";var m=class{constructor({onLoginCancelled:e}){this.handlers=new Map;this.store=M();this.isLoginInitiated=!1;this.handleMessage=this.handleMessage.bind(this),this.handleLoginCancelled=e}startListening(){c.addEventListener("message",this.handleMessage)}stopListening(){c.removeEventListener("message",this.handleMessage)}registerEvent(e,s){this.handlers.set(e,s)}unregisterEvent(e){this.handlers.delete(e)}async handleMessage(e){let s=e.data?.type;if(console.log("WebviewClient",s),typeof s=="string"&&this.handlers.has(s))return this.handlers.get(s)?.(e);switch(s){case r.finalizeHandshakeRequest:this.handshake({event:e});break;case r.signMessageRequest:this.signMessage({event:e,payload:e.data.payload});break;case r.loginRequest:this.isLoginInitiated=!0,this.login({event:e,payload:e.data.payload});break;case r.signTransactionsRequest:this.signTransactions({event:e});break;case n.cancelResponse:case"cancelAction":this.isLoginInitiated&&await this.handleLoginCancelled();break;default:break}}async login({event:e,payload:s}){let a=s?.token;if(a)try{let{address:t}=d(this.store.getState()),o=g(),i=`${t}${a}`,y=new p({address:new l(t),data:new Uint8Array(Buffer.from(i))}),f=(await o.signMessage(y))?.signature??"";e.source?.postMessage({type:n.loginResponse,payload:{data:{address:t,signature:Buffer.from(f).toString("hex")}}},{targetOrigin:e.origin})}catch{this.isLoginInitiated&&(await this.handleLoginCancelled(),e.source?.postMessage({type:n.cancelResponse,payload:null},{targetOrigin:e.origin}))}finally{this.isLoginInitiated=!1}}handshake({event:e}){let s=Date.now().toString();e.source?.postMessage({type:n.finalizeHandshakeResponse,payload:{data:s}},{targetOrigin:e.origin})}async signMessage({event:e,payload:s}){let{address:a}=d(this.store.getState()),{message:t}=s;try{let o=new p({address:new l(a),data:new Uint8Array(Buffer.from(t))}),h=(await g().signMessage(o))?.signature??"";e.source?.postMessage({type:n.signMessageResponse,payload:{data:{signature:Buffer.from(h).toString("hex"),status:"signed"}}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign message")}}async signTransactions({event:e}){let s=g(),{payload:a}=e.data;if(Array.isArray(a))try{let t=a.map(i=>u.newFromPlainObject(i)),o=await s.signTransactions(t);e.source?.postMessage({type:n.signTransactionsResponse,payload:{data:o.map(i=>i.toPlainObject())}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign transactions")}}};export{m as a};
|
|
2
|
+
//# sourceMappingURL=chunk-G3PW6MWT.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.ts"],
|
|
4
|
+
"sourcesContent": ["import { safeWindow } from 'constants/index';\nimport { Address, Message, Transaction } from 'lib/sdkCore';\nimport {\n WindowProviderRequestEnums,\n WindowProviderResponseEnums,\n RequestMessageType,\n RequestPayloadType\n} from 'lib/sdkWebWalletCrossWindowProvider';\nimport { getAccountProvider } from 'providers/helpers/accountProvider';\nimport { accountSelector } from 'store/selectors';\nimport { getStore } from 'store/store';\n\ntype MessageHandler = (event: MessageEvent) => void;\n\ntype MessageEventType = {\n event: MessageEvent<MessageType>;\n};\n\ntype MessageType =\n | RequestMessageType\n | { type: 'cancelAction'; payload: null }\n | {\n type: WindowProviderResponseEnums.cancelResponse;\n payload: null;\n };\n\nexport class WebviewClient {\n private readonly handlers: Map<string, MessageHandler> = new Map();\n private readonly store = getStore();\n private isLoginInitiated = false;\n private readonly handleLoginCancelled: () => Promise<void>;\n\n constructor({ onLoginCancelled }: { onLoginCancelled: () => Promise<void> }) {\n this.handleMessage = this.handleMessage.bind(this);\n this.handleLoginCancelled = onLoginCancelled;\n }\n\n public startListening() {\n safeWindow.addEventListener('message', this.handleMessage);\n }\n\n public stopListening() {\n safeWindow.removeEventListener('message', this.handleMessage);\n }\n\n public registerEvent(type: string, handler: MessageHandler) {\n this.handlers.set(type, handler);\n }\n\n public unregisterEvent(type: string) {\n this.handlers.delete(type);\n }\n\n private async handleMessage(event: MessageEvent<MessageType>) {\n const type = event.data?.type;\n\n console.log('WebviewClient', type);\n if (typeof type === 'string' && this.handlers.has(type)) {\n const handler = this.handlers.get(type);\n return handler?.(event);\n }\n\n switch (type) {\n case WindowProviderRequestEnums.finalizeHandshakeRequest:\n this.handshake({ event });\n break;\n case WindowProviderRequestEnums.signMessageRequest:\n this.signMessage({ event, payload: event.data.payload });\n break;\n case WindowProviderRequestEnums.loginRequest:\n this.isLoginInitiated = true;\n this.login({ event, payload: event.data.payload });\n break;\n case WindowProviderRequestEnums.signTransactionsRequest:\n this.signTransactions({ event });\n break;\n case WindowProviderResponseEnums.cancelResponse: // sent by web-wallet CrossWindow provider\n case 'cancelAction': // sent by Extension provider\n if (this.isLoginInitiated) {\n await this.handleLoginCancelled();\n }\n break;\n default:\n break;\n }\n }\n\n private async login({\n event,\n payload\n }: MessageEventType & { payload: RequestPayloadType['LOGIN_REQUEST'] }) {\n const loginToken = payload?.token;\n\n if (!loginToken) {\n return;\n }\n\n try {\n const { address } = accountSelector(this.store.getState());\n const provider = getAccountProvider();\n\n // Message format needed for token generation\n const message = `${address}${loginToken}`;\n const messageToSign = new Message({\n address: new Address(address),\n data: new Uint8Array(Buffer.from(message))\n });\n\n const signedMessage = await provider.signMessage(messageToSign);\n const signature = signedMessage?.signature ?? '';\n\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.loginResponse,\n payload: {\n data: {\n address,\n signature: Buffer.from(signature).toString('hex')\n }\n }\n },\n { targetOrigin: event.origin }\n );\n } catch {\n if (this.isLoginInitiated) {\n await this.handleLoginCancelled();\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.cancelResponse,\n payload: null\n },\n { targetOrigin: event.origin }\n );\n }\n } finally {\n this.isLoginInitiated = false;\n }\n }\n\n private handshake({ event }: MessageEventType) {\n const handshakeSession = Date.now().toString();\n\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.finalizeHandshakeResponse,\n payload: { data: handshakeSession }\n },\n { targetOrigin: event.origin }\n );\n }\n\n private async signMessage({\n event,\n payload\n }: MessageEventType & {\n payload: RequestPayloadType['SIGN_MESSAGE_REQUEST'];\n }) {\n const { address } = accountSelector(this.store.getState());\n const { message } = payload;\n\n try {\n const messageToSign = new Message({\n address: new Address(address),\n data: new Uint8Array(Buffer.from(message))\n });\n\n const provider = getAccountProvider();\n const signedMessage = await provider.signMessage(messageToSign);\n const signature = signedMessage?.signature ?? '';\n\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.signMessageResponse,\n payload: {\n data: {\n signature: Buffer.from(signature).toString('hex'),\n status: 'signed'\n }\n }\n },\n { targetOrigin: event.origin }\n );\n } catch {\n throw new Error('Could not sign message');\n }\n }\n\n private async signTransactions({ event }: MessageEventType) {\n const provider = getAccountProvider();\n const { payload } = event.data;\n\n if (!Array.isArray(payload)) {\n return;\n }\n\n try {\n const transactions = payload.map((plainTransactionObject) =>\n Transaction.newFromPlainObject(plainTransactionObject)\n );\n\n const signedTx = await provider.signTransactions(transactions);\n event.source?.postMessage(\n {\n type: WindowProviderResponseEnums.signTransactionsResponse,\n payload: {\n data: signedTx.map((tx) => tx.toPlainObject())\n }\n },\n { targetOrigin: event.origin }\n );\n } catch {\n throw new Error('Could not sign transactions');\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "2QA0BO,IAAMA,EAAN,KAAoB,CAMzB,YAAY,CAAE,iBAAAC,CAAiB,EAA8C,CAL7E,KAAiB,SAAwC,IAAI,IAC7D,KAAiB,MAAQC,EAAS,EAClC,KAAQ,iBAAmB,GAIzB,KAAK,cAAgB,KAAK,cAAc,KAAK,IAAI,EACjD,KAAK,qBAAuBD,CAC9B,CAEO,gBAAiB,CACtBE,EAAW,iBAAiB,UAAW,KAAK,aAAa,CAC3D,CAEO,eAAgB,CACrBA,EAAW,oBAAoB,UAAW,KAAK,aAAa,CAC9D,CAEO,cAAcC,EAAcC,EAAyB,CAC1D,KAAK,SAAS,IAAID,EAAMC,CAAO,CACjC,CAEO,gBAAgBD,EAAc,CACnC,KAAK,SAAS,OAAOA,CAAI,CAC3B,CAEA,MAAc,cAAcE,EAAkC,CAC5D,IAAMF,EAAOE,EAAM,MAAM,KAGzB,GADA,QAAQ,IAAI,gBAAiBF,CAAI,EAC7B,OAAOA,GAAS,UAAY,KAAK,SAAS,IAAIA,CAAI,EAEpD,OADgB,KAAK,SAAS,IAAIA,CAAI,IACrBE,CAAK,EAGxB,OAAQF,EAAM,CACZ,KAAKG,EAA2B,yBAC9B,KAAK,UAAU,CAAE,MAAAD,CAAM,CAAC,EACxB,MACF,KAAKC,EAA2B,mBAC9B,KAAK,YAAY,CAAE,MAAAD,EAAO,QAASA,EAAM,KAAK,OAAQ,CAAC,EACvD,MACF,KAAKC,EAA2B,aAC9B,KAAK,iBAAmB,GACxB,KAAK,MAAM,CAAE,MAAAD,EAAO,QAASA,EAAM,KAAK,OAAQ,CAAC,EACjD,MACF,KAAKC,EAA2B,wBAC9B,KAAK,iBAAiB,CAAE,MAAAD,CAAM,CAAC,EAC/B,MACF,KAAKE,EAA4B,eACjC,IAAK,eACC,KAAK,kBACP,MAAM,KAAK,qBAAqB,EAElC,MACF,QACE,KACJ,CACF,CAEA,MAAc,MAAM,CAClB,MAAAF,EACA,QAAAG,CACF,EAAwE,CACtE,IAAMC,EAAaD,GAAS,MAE5B,GAAKC,EAIL,GAAI,CACF,GAAM,CAAE,QAAAC,CAAQ,EAAIC,EAAgB,KAAK,MAAM,SAAS,CAAC,EACnDC,EAAWC,EAAmB,EAG9BC,EAAU,GAAGJ,CAAO,GAAGD,CAAU,GACjCM,EAAgB,IAAIC,EAAQ,CAChC,QAAS,IAAIC,EAAQP,CAAO,EAC5B,KAAM,IAAI,WAAW,OAAO,KAAKI,CAAO,CAAC,CAC3C,CAAC,EAGKI,GADgB,MAAMN,EAAS,YAAYG,CAAa,IAC7B,WAAa,GAE9CV,EAAM,QAAQ,YACZ,CACE,KAAME,EAA4B,cAClC,QAAS,CACP,KAAM,CACJ,QAAAG,EACA,UAAW,OAAO,KAAKQ,CAAS,EAAE,SAAS,KAAK,CAClD,CACF,CACF,EACA,CAAE,aAAcb,EAAM,MAAO,CAC/B,CACF,MAAQ,CACF,KAAK,mBACP,MAAM,KAAK,qBAAqB,EAChCA,EAAM,QAAQ,YACZ,CACE,KAAME,EAA4B,eAClC,QAAS,IACX,EACA,CAAE,aAAcF,EAAM,MAAO,CAC/B,EAEJ,QAAE,CACA,KAAK,iBAAmB,EAC1B,CACF,CAEQ,UAAU,CAAE,MAAAA,CAAM,EAAqB,CAC7C,IAAMc,EAAmB,KAAK,IAAI,EAAE,SAAS,EAE7Cd,EAAM,QAAQ,YACZ,CACE,KAAME,EAA4B,0BAClC,QAAS,CAAE,KAAMY,CAAiB,CACpC,EACA,CAAE,aAAcd,EAAM,MAAO,CAC/B,CACF,CAEA,MAAc,YAAY,CACxB,MAAAA,EACA,QAAAG,CACF,EAEG,CACD,GAAM,CAAE,QAAAE,CAAQ,EAAIC,EAAgB,KAAK,MAAM,SAAS,CAAC,EACnD,CAAE,QAAAG,CAAQ,EAAIN,EAEpB,GAAI,CACF,IAAMO,EAAgB,IAAIC,EAAQ,CAChC,QAAS,IAAIC,EAAQP,CAAO,EAC5B,KAAM,IAAI,WAAW,OAAO,KAAKI,CAAO,CAAC,CAC3C,CAAC,EAIKI,GADgB,MADLL,EAAmB,EACC,YAAYE,CAAa,IAC7B,WAAa,GAE9CV,EAAM,QAAQ,YACZ,CACE,KAAME,EAA4B,oBAClC,QAAS,CACP,KAAM,CACJ,UAAW,OAAO,KAAKW,CAAS,EAAE,SAAS,KAAK,EAChD,OAAQ,QACV,CACF,CACF,EACA,CAAE,aAAcb,EAAM,MAAO,CAC/B,CACF,MAAQ,CACN,MAAM,IAAI,MAAM,wBAAwB,CAC1C,CACF,CAEA,MAAc,iBAAiB,CAAE,MAAAA,CAAM,EAAqB,CAC1D,IAAMO,EAAWC,EAAmB,EAC9B,CAAE,QAAAL,CAAQ,EAAIH,EAAM,KAE1B,GAAK,MAAM,QAAQG,CAAO,EAI1B,GAAI,CACF,IAAMY,EAAeZ,EAAQ,IAAKa,GAChCC,EAAY,mBAAmBD,CAAsB,CACvD,EAEME,EAAW,MAAMX,EAAS,iBAAiBQ,CAAY,EAC7Df,EAAM,QAAQ,YACZ,CACE,KAAME,EAA4B,yBAClC,QAAS,CACP,KAAMgB,EAAS,IAAKC,GAAOA,EAAG,cAAc,CAAC,CAC/C,CACF,EACA,CAAE,aAAcnB,EAAM,MAAO,CAC/B,CACF,MAAQ,CACN,MAAM,IAAI,MAAM,6BAA6B,CAC/C,CACF,CACF",
|
|
6
|
+
"names": ["WebviewClient", "onLoginCancelled", "getStore", "safeWindow", "type", "handler", "event", "WindowProviderRequestEnums", "WindowProviderResponseEnums", "payload", "loginToken", "address", "accountSelector", "provider", "getAccountProvider", "message", "messageToSign", "Message", "Address", "signature", "handshakeSession", "transactions", "plainTransactionObject", "Transaction", "signedTx", "tx"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as M}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as M}from"./chunk-QHCEY52I.mjs";import{a as U}from"./chunk-4SS6EY66.mjs";import{a as j}from"./chunk-7Z7IX367.mjs";import{a as z}from"./chunk-VCQBYNNS.mjs";import{a as V}from"./chunk-LN5UXO64.mjs";import{a as B}from"./chunk-PHOF3Z5D.mjs";import{a as $}from"./chunk-RBZC4PEU.mjs";import{a as _}from"./chunk-ELQR4QMU.mjs";import{a as R}from"./chunk-5KCP7UJT.mjs";import{a as w}from"./chunk-YGI3KXMZ.mjs";import{a as O}from"./chunk-LDSGJKBB.mjs";import{a as v}from"./chunk-RYIJWGFA.mjs";import{x}from"./chunk-5YS3EQN7.mjs";import{a as G}from"./chunk-YJCTRUJT.mjs";import{a as C,c as F,f}from"./chunk-PJWJZHIS.mjs";import{a as b}from"./chunk-KD2IQ32V.mjs";import{c as L}from"./chunk-TI37DKBT.mjs";import{k as h}from"./chunk-LHEH7L4L.mjs";import{a as A}from"./chunk-D332ESHD.mjs";import{BigNumber as Dt}from"bignumber.js";async function Kt({allTransactions:T,currentScreenIndex:s,egldLabel:n,network:e,gasPriceData:m,price:S,address:c,username:q,shard:H,signedIndexes:i,parsedTransactionsByDataField:K}){let p=T[s],W=p?.transaction?.sender.toString(),d=p?.transaction,o=d?.toPlainObject(),D=null,I=null,t=await _({egldLabel:n,sender:W,apiAddress:e.apiAddress,address:c,parsedTransactionsByDataField:K})(p),g=!t?.transactionTokenInfo?.tokenId,{tokenId:l,nonce:u,amount:y=""}=t?.transactionTokenInfo??{},Z=l&&u&&u.length>0?`${l}-${u}`:l,J=await O({tokenId:Z}),{esdtPrice:Q,tokenDecimals:X,type:r,identifier:a,tokenImageUrl:Y}=J;if(r==="SemiFungibleESDT"||r==="NonFungibleESDT")I={type:r,identifier:a,amount:y,imageURL:Y};else{let P=({addCommas:St})=>f({input:g?d.value.toString():y,decimals:g?Number(e.decimals):X,digits:Number(e.digits),showLastNonZeroDecimal:!1,addCommas:St}),lt=P({addCommas:!0}),ut=P({addCommas:!1}),ft=Number(g?S:Q),Tt=w({amount:ut,usd:ft,addEqualSign:!0});D={identifier:(a===h?n:a)??n,amount:lt,usdValue:Tt}}let{feeLimitFormatted:tt,feeInFiatLimit:ot}=R({transaction:d,price:S}),nt=V({shard:H,initialGasPrice:m.initialGasPrice,transaction:o,gasStationMetadata:e.gasStationMetadata}),et=B({transaction:o,gasPriceData:m}),it=x().getType(),rt=v(it),N=T.length,at=i.length>0?i[i.length-1]+1:0,k=L(o?.data??""),E=$(t?.transactionTokenInfo),st=U({data:k,identifier:a,highlight:E}),mt=M(),ct=G({to:`/${b}/${c}`,explorerAddress:mt}),pt=N===1||t?.needsSigning&&!i.includes(s),dt=f({input:et.toString(),decimals:F,addCommas:!0,digits:C}),gt=new Dt(o.gasLimit).toFormat({decimalSeparator:",",groupSeparator:".",groupSize:3});return{commonData:{receiver:o.receiver.toString(),data:k,decodedData:st,gasPrice:dt,gasLimit:gt,explorerLink:ct,ppu:m.ppu,ppuOptions:nt,egldLabel:n,tokenType:j(r),feeLimit:tt,feeInFiatLimit:ot,transactionsCount:N,currentIndex:s,currentIndexToSign:at,highlight:E,scCall:z(t?.transactionTokenInfo),needsSigning:pt,isEditable:t?.needsSigning,providerName:rt,address:c,username:q,origin:A.location?.origin},tokenTransaction:D,fungibleTransaction:I}}export{Kt as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GP3S6IRE.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-DLWDO7M6.mjs";import{d as v}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-DLWDO7M6.mjs";import{d as v}from"./chunk-OGHSN5AV.mjs";import{w as a}from"./chunk-5YS3EQN7.mjs";import{s as n}from"./chunk-XLC5VX4C.mjs";import{d as s}from"./chunk-VNLGNNIL.mjs";import{a as i}from"./chunk-LJX4MW7B.mjs";import{a as d}from"./chunk-VW4A3BGH.mjs";async function S(){let t=c(),m=d(),e=s(n()),o=m||t?i.webview:e,p=Object.values(i).includes(e);if(e&&!p&&(o=e),!o)return;let r=await v.create({type:o});if(!r)throw new Error("Provider not found");if(t||o===i.webview&&r.isInitialized())try{await r.login()}catch(f){console.warn("Failed to login with provider",r.getType(),f)}a(r)}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GSLBJM6X.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-VURQULM5.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-GXB7VLJI.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-4TBVQD27.mjs";import{q as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-4TBVQD27.mjs";import{q as o}from"./chunk-XLC5VX4C.mjs";var C=t=>o().setState(({config:e})=>{e.nativeAuthConfig=t},!1,{type:"setNativeAuthConfig",payload:{value:t}}),c=t=>o().setState(({config:e})=>{e.websocketStatus=t},!1,{type:"setWebsocketStatus",payload:{value:t}}),f=t=>o().setState(({config:e})=>{let a=t.walletConnectV2RelayAddress||n.walletConnectV2RelayAddress,l=t.walletConnectDeepLink||n.walletConnectDeepLink;e.walletConnectConfig={...t,walletConnectDeepLink:l,walletConnectV2RelayAddress:a}},!1,{type:"setWalletConnectConfig",payload:{value:t}});export{C as a,c as b,f as c};
|
|
2
|
+
//# sourceMappingURL=chunk-H3CEKEGG.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-LDSGJKBB.mjs";import{a as c}from"./chunk-I3MK6KZJ.mjs";var l=async({receiver:n,sender:s,tokenId:i})=>{let t=null,r=null;if(!i)return{senderLockedAccount:t,receiverLockedAccount:r};try{let o=(await u({tokenId:i}))?.assets?.lockedAccounts;if(!o)return{senderLockedAccount:t,receiverLockedAccount:r};for(let e in o)if(c(e)&&(s===e&&(t=e),n===e&&(r=e)),c(o[e])&&(s===o[e]&&(t=o[e]),n===o[e]&&(r=o[e])),t&&r)return{senderLockedAccount:t,receiverLockedAccount:r}}catch(a){console.error("Error getting token details",a)}return{senderLockedAccount:t,receiverLockedAccount:r}};export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JJHCLR34.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-KHLS5Q36.mjs";import{a as g}from"./chunk-WE7YOBO7.mjs";import l from"lodash.isequal";async function C({loginData:f,nativeAuthConfig:r,loginToken:s}){let{address:m,signature:d,...n}=f,a=Object.keys(n).reduce((i,t)=>{let o=["multisig","impersonate"].includes(t)&&n[t]!=null?String(n[t]):null;return o!=null&&(i[t]=o.toString()),i},{}),e={...r};if(Object.keys(a).length>0&&(e.extraInfo=a),!l(r,e)){let i=g(s);return await u(e).initialize({noCache:!0,latestBlockInfo:{hash:i?.blockHash??"",timestamp:i?.extraInfo?.timestamp??0}})}return s}export{C as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JYZ7RSRP.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as o,f as a,g as i,h as r}from"./chunk-NGM3AVCY.mjs";import{s as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as o,f as a,g as i,h as r}from"./chunk-NGM3AVCY.mjs";import{s as c}from"./chunk-XLC5VX4C.mjs";function b(){let t=c(),l=r(t),u=i(t),T=a(t),d=o(t),e=Object.keys(d)?.length>0,n=!e&&Object.keys(l)?.length>0,s=!e&&!n&&Object.keys(u)?.length>0,f=!e&&!n&&!s&&Object.keys(T).length>0;return{pending:e,timedOut:n,fail:s,success:f}}export{b as a};
|
|
2
|
+
//# sourceMappingURL=chunk-K7UYBI5V.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-3S57OP4Z.mjs";import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-3S57OP4Z.mjs";import{a as l}from"./chunk-QTKK6OSJ.mjs";import{a as h}from"./chunk-OXMQRX3C.mjs";import{NativeAuthClient as y}from"@multiversx/sdk-native-auth-client";var H=f=>{let{origin:o,apiAddress:i,expirySeconds:r,blockHashShard:s,extraInfo:u,gatewayUrl:d,extraRequestHeaders:k}=h(f),e=new y({origin:o,apiUrl:i,expirySeconds:r,blockHashShard:s,gatewayUrl:d,extraRequestHeaders:k});return{initialize:async t=>{if(!i||!o)return"";let a=()=>e.getCurrentBlockHash(),n=t?.latestBlockInfo;n??=await g({apiAddress:i,blockHashShard:s,getBlockHash:a,noCache:t?.noCache});let{hash:p,timestamp:c}=n,m=e.encodeValue(JSON.stringify({...t?.extraInfo??u,...c?{timestamp:c}:{}}));return`${e.encodeValue(o)}.${p}.${r}.${m}`},getToken:({address:t,token:a,signature:n})=>e.getToken(t,a,n),getTokenExpiration:l}};export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KHLS5Q36.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-3QWTD55I.mjs";import{s as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-3QWTD55I.mjs";import{s as m}from"./chunk-XLC5VX4C.mjs";import{b as a}from"./chunk-7VHTZYM2.mjs";import{o as s,u as o}from"./chunk-KD2IQ32V.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";async function I({tokenId:n}){let t=a(m()),r={tokenDecimals:Number(t.decimals),tokenLabel:"",tokenImageUrl:""},{isNft:k}=c(n),i=n,p=k?s:o;if(!i)return r;try{let e=await g(`${t.apiAddress}/${p}/${i}`),l=e?e?.decimals:Number(t.decimals),f=e?e?.name:"",T=e?e?.assets?.svgUrl??e?.media?.[0]?.thumbnailUrl:"";return{tokenDecimals:l,tokenLabel:f,type:e?.type,tokenImageUrl:T,identifier:e?.identifier,assets:e?.assets,esdtPrice:e?.price,ticker:e?.ticker,name:e?.name}}catch(e){return{...r,error:`${e}`}}}export{I as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LDSGJKBB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-D332ESHD.mjs";function r(t){try{if(!e)return;e.document.documentElement.dataset.mvxTheme=t}catch{console.log("Error switching the theme!")}}export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LHSB6DBF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-N55JEIM6.mjs";import{b as n,c as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-N55JEIM6.mjs";import{b as n,c as o}from"./chunk-27JXN5DJ.mjs";import{s}from"./chunk-XLC5VX4C.mjs";function T({sessionId:t,transaction:e}){o({sessionId:t,transaction:e});let i=s().transactions?.[t].transactions,a=r(i);return a&&n({sessionId:t,status:a}),a}export{T as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LKUWWSNW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-MPE25R5P.mjs";import{a}from"./chunk-MORYV6AT.mjs";import{a as u}from"./chunk-YPJVICNW.mjs";import{c as n}from"./chunk-QF3H56ZJ.mjs";import{a as s}from"./chunk-D332ESHD.mjs";var g=(o,t)=>{let r=`sdk-dapp-logout-event-${o}`,e=t.getItem(r);e&&o!==e||(t.setItem(r,o),t.removeItem(r))};async function L({provider:o,options:t={shouldBroadcastLogoutAcrossTabs:!0}}){let r=a();t.shouldBroadcastLogoutAcrossTabs&&s.localStorage&&g(r,s.localStorage);try{return u(),n.forEach(c=>c()),n.clear(),i.closeConnectionRef?.(),await o.logout()}catch(e){return console.error("Logging out error:",e),!1}}export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-M4Q4I6RI.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{x as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{x as n}from"./chunk-5YS3EQN7.mjs";import{a as i}from"./chunk-LJX4MW7B.mjs";var e=async()=>{let o=n();if(o.getType()===i.crossWindow){let r=o;await r.cancelAction(),await r.dispose()}};export{e as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MDWK7DG2.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-XM74E3A5.mjs";async function i(a){let n=e.getInstance();return await n.openUI(),{manager:n,onClose:async({shouldCancelAction:t=!0}={})=>{n.closeUI(),t&&a?.cancelAction&&await a.cancelAction()}}}export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MEWJKXYC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-RYEH6TVZ.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-MP4WGD5I.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-EWHHZE2Y.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-MPE25R5P.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p}from"./chunk-JJHCLR34.mjs";import{a as u}from"./chunk-REYJ4EFS.mjs";import{a as i}from"./chunk-W5MTQBQF.mjs";import{a as T}from"./chunk-HMAL7GVA.mjs";import{a as m}from"./chunk-U3UMCTU6.mjs";import{a as k}from"./chunk-YJCTRUJT.mjs";import{c as l}from"./chunk-PJWJZHIS.mjs";import{a as o}from"./chunk-KSC3RFHN.mjs";var g=class{static async processTransactions({address:v,egldLabel:L,explorerAddress:a,transactions:h}){let f=h.map(e=>T({address:v,explorerAddress:a,transaction:e}));return await Promise.all(f.map(async e=>{let s=e.receiverAssets?.name.replace(/\p{Emoji}/gu,""),c=e.senderAssets?.name.replace(/\p{Emoji}/gu,""),{senderLockedAccount:D,receiverLockedAccount:x}=await p({receiver:e.receiver,sender:e.sender,tokenId:e.tokenIdentifier}),{egldValueData:t,tokenValueData:n,nftValueData:r}=u({transaction:e}),y=r?.token.type==="MetaESDT"?void 0:r?.badgeText,d=m.getData({input:t?.value??n?.value??r?.value??"",decimals:t?.decimals??n?.decimals??r?.decimals??l,digits:2}),S={badge:y??void 0,collection:n?.token.collection??r?.token.collection,egldLabel:t?L:"",link:k({explorerAddress:a,to:n?.tokenExplorerLink??r?.tokenExplorerLink??""}),linkText:n?.tokenLinkText??r?.tokenLinkText,name:n?.token.name??r?.token.name,showFormattedAmount:!!(t||n?.tokenFormattedAmount||r?.tokenFormattedAmount),svgUrl:n?.token.svgUrl??r?.token.svgUrl,ticker:n?.token.ticker??r?.token.ticker,titleText:n?.titleText??r?.titleText,valueDecimal:d.valueDecimal,valueInteger:d.valueInteger},w=i(e.receiverShard),A=i(e.senderShard);return{age:e.transactionDetails.age,direction:e.transactionDetails.direction,method:e.transactionDetails.method,iconInfo:e.transactionDetails.iconInfo,link:e.links.transactionLink??"",txHash:e.txHash,receiver:{address:e.receiver,name:s??"",description:`${s??e.receiver} (${e.receiver})`,isContract:o(e.receiver),isTokenLocked:!!x,link:e.links.receiverLink??"",shard:w,shardLink:e.links.receiverShardLink,showLink:e.transactionDetails.direction!=="In"},sender:{address:e.sender,name:c??"",description:`${c??e.sender} (${e.sender})`,isContract:o(e.sender),isTokenLocked:!!D,link:e.links.senderLink??"",shard:A,shardLink:e.links.senderShardLink,showLink:e.transactionDetails.direction!=="Out"},value:S}}))}};export{g as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MZ3JSTQR.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-MORYV6AT.mjs";import{c as e,g as s}from"./chunk-NTEMINYA.mjs";async function m({message:r,provider:a,options:n}){let g=o(),i=new s({address:new e(g),data:r.data});return await a.signMessage(i,n)}export{m as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NLPW35QO.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-CHSOALST.mjs";import{a as o}from"./chunk-LJX4MW7B.mjs";import{a as e,b as t}from"./chunk-D332ESHD.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-O7JES6EH.mjs.map
|