@multiversx/sdk-dapp 5.3.0-alpha.1 → 5.3.0-alpha.2

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.
Files changed (378) hide show
  1. package/out/__chunks__/chunk-26N65762.mjs +2 -0
  2. package/out/__chunks__/{chunk-2ZW4LVVR.mjs → chunk-2EGSAA3Z.mjs} +2 -2
  3. package/out/__chunks__/{chunk-5KY3OIFD.mjs → chunk-2GHN5K7N.mjs} +2 -2
  4. package/out/__chunks__/{chunk-UUPS4KLW.mjs → chunk-2VFVLNXF.mjs} +2 -2
  5. package/out/__chunks__/{chunk-AN4TQZVZ.mjs → chunk-3HHX2VYV.mjs} +2 -2
  6. package/out/__chunks__/{chunk-VDAYN2HT.mjs → chunk-3HV7NSKE.mjs} +2 -2
  7. package/out/__chunks__/{chunk-JHYKMKMK.mjs → chunk-3NBBN5ES.mjs} +2 -2
  8. package/out/__chunks__/{chunk-TKIYJDS2.mjs → chunk-4272WAHN.mjs} +2 -2
  9. package/out/__chunks__/{chunk-GJ64B4SS.mjs → chunk-4HDUGICF.mjs} +2 -2
  10. package/out/__chunks__/chunk-4LULGQ77.mjs +2 -0
  11. package/out/__chunks__/{chunk-ALBBGYHS.mjs → chunk-5AI7ZBQ5.mjs} +2 -2
  12. package/out/__chunks__/{chunk-ZG6EULI2.mjs → chunk-67PAALEV.mjs} +2 -2
  13. package/out/__chunks__/{chunk-PUCCTEN7.mjs → chunk-6BQH2QKE.mjs} +2 -2
  14. package/out/__chunks__/{chunk-YYVGE2ZU.mjs → chunk-6TVBPLPC.mjs} +2 -2
  15. package/out/__chunks__/{chunk-AVEMKF6Z.mjs → chunk-6YF7VKF2.mjs} +2 -2
  16. package/out/__chunks__/{chunk-ET6MYYOM.mjs → chunk-6YXFRH3W.mjs} +2 -2
  17. package/out/__chunks__/chunk-APIYOYTG.mjs +2 -0
  18. package/out/__chunks__/{chunk-I2CW2O7M.mjs → chunk-BLTIK7JF.mjs} +2 -2
  19. package/out/__chunks__/{chunk-KTQD4DTE.mjs → chunk-BY3GVURF.mjs} +2 -2
  20. package/out/__chunks__/chunk-CWBECQEY.mjs +2 -0
  21. package/out/__chunks__/{chunk-RXE5QIE3.mjs → chunk-DA5DI7Z2.mjs} +2 -2
  22. package/out/__chunks__/{chunk-BC5MT6WS.mjs → chunk-DDLSBIL3.mjs} +2 -2
  23. package/out/__chunks__/{chunk-NO4FZ4M3.mjs → chunk-DJAONPNL.mjs} +2 -2
  24. package/out/__chunks__/{chunk-J6MUGECP.mjs → chunk-DRCMZIYT.mjs} +2 -2
  25. package/out/__chunks__/{chunk-7UUDW64Y.mjs → chunk-EIQQDFQS.mjs} +2 -2
  26. package/out/__chunks__/{chunk-ELCWJYQ7.mjs → chunk-ERQPDDHO.mjs} +2 -2
  27. package/out/__chunks__/{chunk-ZM77AGP5.mjs → chunk-EYUQXPCB.mjs} +2 -2
  28. package/out/__chunks__/{chunk-GDMANS7S.mjs → chunk-FMEC7LEU.mjs} +2 -2
  29. package/out/__chunks__/{chunk-X3AX4PFE.mjs → chunk-FT7PQFYY.mjs} +2 -2
  30. package/out/__chunks__/chunk-FZ6B646C.mjs +2 -0
  31. package/out/__chunks__/{chunk-O462QL7Q.mjs → chunk-G6AICUIC.mjs} +2 -2
  32. package/out/__chunks__/chunk-GEB4VHTN.mjs +2 -0
  33. package/out/__chunks__/{chunk-SLG55PDO.mjs → chunk-GEHX6WX2.mjs} +2 -2
  34. package/out/__chunks__/{chunk-GPUXJWA3.mjs → chunk-GFJFVWV5.mjs} +2 -2
  35. package/out/__chunks__/chunk-H5KMHLWL.mjs +2 -0
  36. package/out/__chunks__/{chunk-QJ6YLLBK.mjs → chunk-H7SFJJL6.mjs} +2 -2
  37. package/out/__chunks__/{chunk-AGBY3WIQ.mjs → chunk-HAD6KD4V.mjs} +2 -2
  38. package/out/__chunks__/{chunk-2WAT3RZ3.mjs → chunk-HJAGGOLY.mjs} +2 -2
  39. package/out/__chunks__/chunk-HR2SURU6.mjs +2 -0
  40. package/out/__chunks__/{chunk-FFGJMR4Q.mjs → chunk-HU5DHLOV.mjs} +2 -2
  41. package/out/__chunks__/chunk-IUQSTHCF.mjs +2 -0
  42. package/out/__chunks__/chunk-J27BRSLL.mjs +2 -0
  43. package/out/__chunks__/chunk-KDIEM47U.mjs +2 -0
  44. package/out/__chunks__/chunk-LFIWIGR3.mjs +2 -0
  45. package/out/__chunks__/{chunk-T3RXRYP5.mjs → chunk-LFZNSKP4.mjs} +2 -2
  46. package/out/__chunks__/{chunk-ZJM5FGLA.mjs → chunk-LOQI2FKT.mjs} +2 -2
  47. package/out/__chunks__/{chunk-32DICVUK.mjs → chunk-LRN3QFXR.mjs} +2 -2
  48. package/out/__chunks__/{chunk-IXO75QXR.mjs → chunk-MB44B2VD.mjs} +2 -2
  49. package/out/__chunks__/{chunk-ZAY5O7DE.mjs → chunk-MBL2SMPH.mjs} +2 -2
  50. package/out/__chunks__/{chunk-OI2AXS22.mjs → chunk-MIDAGVE7.mjs} +2 -2
  51. package/out/__chunks__/{chunk-QMFEYMZI.mjs → chunk-MKKMCI5C.mjs} +2 -2
  52. package/out/__chunks__/{chunk-6VPMVY56.mjs → chunk-MLZIGIVD.mjs} +2 -2
  53. package/out/__chunks__/{chunk-ETH6P454.mjs → chunk-MPEAYRQ7.mjs} +2 -2
  54. package/out/__chunks__/{chunk-PCGP4VVW.mjs → chunk-MTELOBHN.mjs} +2 -2
  55. package/out/__chunks__/{chunk-UXBKGTA5.mjs → chunk-MV2P2LIM.mjs} +2 -2
  56. package/out/__chunks__/chunk-NHALZZT2.mjs +2 -0
  57. package/out/__chunks__/{chunk-4ZAZCOJD.mjs → chunk-NMNZYGK7.mjs} +2 -2
  58. package/out/__chunks__/{chunk-JKFZERMM.mjs → chunk-NV4HFS2C.mjs} +2 -2
  59. package/out/__chunks__/{chunk-643FDBLR.mjs → chunk-OE6BHO2G.mjs} +2 -2
  60. package/out/__chunks__/{chunk-HBZ2RP7A.mjs → chunk-OMJ2W7Q6.mjs} +2 -2
  61. package/out/__chunks__/{chunk-H7YY4BCM.mjs → chunk-OX6JXWI4.mjs} +2 -2
  62. package/out/__chunks__/{chunk-VY62CH5W.mjs → chunk-OY6YT36R.mjs} +2 -2
  63. package/out/__chunks__/{chunk-KZUPCFEG.mjs → chunk-PKBE3QGG.mjs} +2 -2
  64. package/out/__chunks__/{chunk-A63UAQRB.mjs → chunk-Q3ZV52DK.mjs} +2 -2
  65. package/out/__chunks__/chunk-QMGMGA2Q.mjs +2 -0
  66. package/out/__chunks__/chunk-QNONSTFE.mjs +2 -0
  67. package/out/__chunks__/{chunk-MNIS55JL.mjs → chunk-QRJ7LCAP.mjs} +2 -2
  68. package/out/__chunks__/{chunk-GWXW3E7L.mjs → chunk-RMJFY5IQ.mjs} +2 -2
  69. package/out/__chunks__/{chunk-5DUIQBPR.mjs → chunk-RSHZQFID.mjs} +2 -2
  70. package/out/__chunks__/chunk-UDD74TMO.mjs +2 -0
  71. package/out/__chunks__/{chunk-G43Z243B.mjs.map → chunk-UDD74TMO.mjs.map} +1 -1
  72. package/out/__chunks__/{chunk-B5YOJH7H.mjs → chunk-UXLYMCYP.mjs} +2 -2
  73. package/out/__chunks__/{chunk-2UPWFRCA.mjs → chunk-VPTU4FYE.mjs} +2 -2
  74. package/out/__chunks__/chunk-VRFYFZSY.mjs +2 -0
  75. package/out/__chunks__/chunk-WRIY2QON.mjs +2 -0
  76. package/out/__chunks__/{chunk-V3GRSQIB.mjs → chunk-X5XAS5LP.mjs} +2 -2
  77. package/out/__chunks__/{chunk-ALT4OKHK.mjs → chunk-XG6M2FRF.mjs} +2 -2
  78. package/out/__chunks__/{chunk-5WR632LR.mjs → chunk-YXOPNTJA.mjs} +2 -2
  79. package/out/__chunks__/{chunk-UF2Y4P6U.mjs → chunk-Z6SGIEGJ.mjs} +2 -2
  80. package/out/__chunks__/{chunk-V322LMVG.mjs → chunk-ZJ55WUB7.mjs} +2 -2
  81. package/out/__chunks__/{chunk-BEXC6NB5.mjs → chunk-ZZVF5NIV.mjs} +2 -2
  82. package/out/apiCalls/account/getScamAddressData.mjs +1 -1
  83. package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
  84. package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
  85. package/out/apiCalls/index.mjs +1 -1
  86. package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
  87. package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
  88. package/out/apiCalls/tokens/index.mjs +1 -1
  89. package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
  90. package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
  91. package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
  92. package/out/constants/browser.constants.mjs +1 -1
  93. package/out/constants/index.mjs +1 -1
  94. package/out/constants/storage.constants.mjs +1 -1
  95. package/out/constants/window.constants.cjs +1 -1
  96. package/out/constants/window.constants.cjs.map +1 -1
  97. package/out/constants/window.constants.mjs +1 -1
  98. package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
  99. package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
  100. package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
  101. package/out/controllers/TransactionsTableController/index.mjs +1 -1
  102. package/out/index.mjs +1 -1
  103. package/out/lib/sdkDappUi.mjs +1 -1
  104. package/out/managers/LogoutManager/LogoutManager.mjs +1 -1
  105. package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
  106. package/out/managers/NotificationsFeedManager/index.mjs +1 -1
  107. package/out/managers/ToastManager/ToastManager.mjs +1 -1
  108. package/out/managers/ToastManager/ToastUICoordinator.mjs +1 -1
  109. package/out/managers/ToastManager/helpers/LifetimeManager.mjs +1 -1
  110. package/out/managers/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
  111. package/out/managers/ToastManager/index.mjs +1 -1
  112. package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
  113. package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
  114. package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
  115. package/out/managers/TransactionManager/index.mjs +1 -1
  116. package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
  117. package/out/managers/UnlockPanelManager/index.mjs +1 -1
  118. package/out/managers/index.mjs +1 -1
  119. package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
  120. package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
  121. package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
  122. package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
  123. package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
  124. package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
  125. package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
  126. package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
  127. package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
  128. package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
  129. package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.mjs +1 -1
  130. package/out/managers/internal/WalletConnectStateManager/index.mjs +1 -1
  131. package/out/managers/internal/index.mjs +1 -1
  132. package/out/methods/account/getAccount.mjs +1 -1
  133. package/out/methods/account/getAccountInfo.mjs +1 -1
  134. package/out/methods/account/getAddress.mjs +1 -1
  135. package/out/methods/account/getIsLoggedIn.mjs +1 -1
  136. package/out/methods/account/getLatestNonce.mjs +1 -1
  137. package/out/methods/initApp/gastStationMetadata/setGasStationMetadata.mjs +1 -1
  138. package/out/methods/initApp/initApp.mjs +1 -1
  139. package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
  140. package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
  141. package/out/methods/loginInfo/getLoginInfo.mjs +1 -1
  142. package/out/methods/network/getEgldLabel.mjs +1 -1
  143. package/out/methods/network/getExplorerAddress.mjs +1 -1
  144. package/out/methods/network/getNetworkConfig.mjs +1 -1
  145. package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.mjs +1 -1
  146. package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.mjs +1 -1
  147. package/out/methods/trackTransactions/helpers/checkTransactionStatus/index.mjs +1 -1
  148. package/out/methods/trackTransactions/helpers/checkTransactionStatus/manageFailedTransactions.mjs +1 -1
  149. package/out/methods/trackTransactions/helpers/checkTransactionStatus/updateTransactionAndSessionStatus.mjs +1 -1
  150. package/out/methods/trackTransactions/helpers/getPollingInterval.mjs +1 -1
  151. package/out/methods/trackTransactions/trackTransactions.mjs +1 -1
  152. package/out/methods/transactions/getFailedTransactions.mjs +1 -1
  153. package/out/methods/transactions/getFailedTransactionsSessions.mjs +1 -1
  154. package/out/methods/transactions/getPendingTransactions.mjs +1 -1
  155. package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
  156. package/out/methods/transactions/getSuccessfulTransactions.mjs +1 -1
  157. package/out/methods/transactions/getSuccessfulTransactionsSessions.mjs +1 -1
  158. package/out/methods/transactions/getTransactionSessions.mjs +1 -1
  159. package/out/providers/DappProvider/DappProvider.mjs +1 -1
  160. package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
  161. package/out/providers/DappProvider/helpers/login/helpers/extractAddressFromToken.mjs +1 -1
  162. package/out/providers/DappProvider/helpers/login/helpers/getAccountFromToken.mjs +1 -1
  163. package/out/providers/DappProvider/helpers/login/helpers/getModifiedLoginToken.mjs +1 -1
  164. package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
  165. package/out/providers/DappProvider/helpers/logout/logout.mjs +1 -1
  166. package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
  167. package/out/providers/DappProvider/helpers/signMessage/signMessageWithProvider.mjs +1 -1
  168. package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
  169. package/out/providers/DappProvider/index.mjs +1 -1
  170. package/out/providers/ProviderFactory.mjs +1 -1
  171. package/out/providers/helpers/accountProvider.mjs +1 -1
  172. package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
  173. package/out/providers/helpers/restoreProvider.mjs +1 -1
  174. package/out/providers/index.mjs +1 -1
  175. package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
  176. package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
  177. package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
  178. package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
  179. package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
  180. package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
  181. package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
  182. package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
  183. package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
  184. package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
  185. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
  186. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
  187. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
  188. package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
  189. package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
  190. package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
  191. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
  192. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
  193. package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
  194. package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.mjs +1 -1
  195. package/out/providers/strategies/WalletConnectProviderStrategy/index.mjs +1 -1
  196. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs +1 -1
  197. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs +1 -1
  198. package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.mjs +1 -1
  199. package/out/providers/strategies/WebviewProviderStrategy/index.mjs +1 -1
  200. package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
  201. package/out/providers/strategies/helpers/index.mjs +1 -1
  202. package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
  203. package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
  204. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
  205. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
  206. package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
  207. package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +1 -1
  208. package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
  209. package/out/providers/strategies/index.mjs +1 -1
  210. package/out/react/account/useGetAccount.mjs +1 -1
  211. package/out/react/account/useGetAccountInfo.mjs +1 -1
  212. package/out/react/account/useGetIsLoggedIn.mjs +1 -1
  213. package/out/react/account/useGetLatestNonce.mjs +1 -1
  214. package/out/react/index.mjs +1 -1
  215. package/out/react/loginInfo/useGetLoginInfo.mjs +1 -1
  216. package/out/react/network/useGetNetworkConfig.mjs +1 -1
  217. package/out/react/store/getReactStore.mjs +1 -1
  218. package/out/react/store/useSelector.mjs +1 -1
  219. package/out/react/transactions/useGetFailedTransactions.mjs +1 -1
  220. package/out/react/transactions/useGetFailedTransactionsSessions.mjs +1 -1
  221. package/out/react/transactions/useGetPendingTransactions.mjs +1 -1
  222. package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
  223. package/out/react/transactions/useGetSuccessfulTransactions.mjs +1 -1
  224. package/out/react/transactions/useGetSuccessfulTransactionsSessions.mjs +1 -1
  225. package/out/react/transactions/useGetTransactionSessions.mjs +1 -1
  226. package/out/services/index.mjs +1 -1
  227. package/out/services/nativeAuth/index.mjs +1 -1
  228. package/out/services/nativeAuth/methods/buildNativeAuthConfig.mjs +1 -1
  229. package/out/services/nativeAuth/methods/getDefaultNativeAuthConfig.mjs +1 -1
  230. package/out/services/nativeAuth/methods/index.mjs +1 -1
  231. package/out/services/nativeAuth/nativeAuth.mjs +1 -1
  232. package/out/store/actions/account/accountActions.mjs +1 -1
  233. package/out/store/actions/account/index.mjs +1 -1
  234. package/out/store/actions/cache/cacheActions.mjs +1 -1
  235. package/out/store/actions/cache/index.mjs +1 -1
  236. package/out/store/actions/config/configActions.mjs +1 -1
  237. package/out/store/actions/config/index.mjs +1 -1
  238. package/out/store/actions/index.mjs +1 -1
  239. package/out/store/actions/loginInfo/loginInfoActions.mjs +1 -1
  240. package/out/store/actions/network/index.mjs +1 -1
  241. package/out/store/actions/network/initializeNetwork.mjs +1 -1
  242. package/out/store/actions/network/networkActions.mjs +1 -1
  243. package/out/store/actions/sharedActions/index.mjs +1 -1
  244. package/out/store/actions/sharedActions/sharedActions.mjs +1 -1
  245. package/out/store/actions/toasts/index.mjs +1 -1
  246. package/out/store/actions/toasts/toastsActions.mjs +1 -1
  247. package/out/store/actions/transactions/transactionsActions.mjs +1 -1
  248. package/out/store/actions/ui/index.mjs +1 -1
  249. package/out/store/actions/ui/uiActions.mjs +1 -1
  250. package/out/store/middleware/applyMiddlewares.mjs +1 -1
  251. package/out/store/middleware/index.mjs +1 -1
  252. package/out/store/middleware/logoutMiddleware.mjs +1 -1
  253. package/out/store/storage/index.mjs +1 -1
  254. package/out/store/storage/storageCallback.mjs +1 -1
  255. package/out/store/store.mjs +1 -1
  256. package/out/utils/ComponentFactory.mjs +1 -1
  257. package/out/utils/account/index.mjs +1 -1
  258. package/out/utils/account/refreshAccount.mjs +1 -1
  259. package/out/utils/account/refreshNativeAuthTokenLogin.mjs +1 -1
  260. package/out/utils/index.mjs +1 -1
  261. package/out/utils/transactions/getActiveTransactionsStatus.mjs +1 -1
  262. package/out/utils/transactions/getInterpretedTransaction/getInterpretedTransaction.mjs +1 -1
  263. package/out/utils/transactions/getInterpretedTransaction/helpers/getLockedAccountName.mjs +1 -1
  264. package/out/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.mjs +1 -1
  265. package/out/utils/transactions/getInterpretedTransaction/helpers/getShardText.mjs +1 -1
  266. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionIconInfo.mjs +1 -1
  267. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionMessages.mjs +1 -1
  268. package/out/utils/transactions/getInterpretedTransaction/helpers/index.mjs +1 -1
  269. package/out/utils/transactions/getInterpretedTransaction/index.mjs +1 -1
  270. package/out/utils/transactions/getTransactionsHistory/getTransactionsHistory.mjs +1 -1
  271. package/out/utils/transactions/getTransactionsHistory/helpers/getCachedTransactionListItem.mjs +1 -1
  272. package/out/utils/transactions/getTransactionsHistory/helpers/index.mjs +1 -1
  273. package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.mjs +1 -1
  274. package/out/utils/transactions/getTransactionsHistory/index.mjs +1 -1
  275. package/out/utils/transactions/index.mjs +1 -1
  276. package/out/utils/visual/index.mjs +1 -1
  277. package/out/utils/visual/switchTheme.mjs +1 -1
  278. package/out/utils/window/getIsInIframe.mjs +1 -1
  279. package/out/utils/window/getWindowParentOrigin.mjs +1 -1
  280. package/out/utils/window/index.mjs +1 -1
  281. package/package.json +2 -2
  282. package/out/__chunks__/chunk-25G6565D.mjs +0 -2
  283. package/out/__chunks__/chunk-5F53ZQDO.mjs +0 -2
  284. package/out/__chunks__/chunk-5VQOOZQV.mjs +0 -2
  285. package/out/__chunks__/chunk-6C26F7JZ.mjs +0 -2
  286. package/out/__chunks__/chunk-6FRXGPOE.mjs +0 -2
  287. package/out/__chunks__/chunk-73E7X7HK.mjs +0 -2
  288. package/out/__chunks__/chunk-7BZQYV6D.mjs +0 -2
  289. package/out/__chunks__/chunk-E5OMXZT7.mjs +0 -2
  290. package/out/__chunks__/chunk-G43Z243B.mjs +0 -2
  291. package/out/__chunks__/chunk-HKVAAOC4.mjs +0 -2
  292. package/out/__chunks__/chunk-ILR4U7Q3.mjs +0 -2
  293. package/out/__chunks__/chunk-JFIQXGJ5.mjs +0 -2
  294. package/out/__chunks__/chunk-JM3JEGRV.mjs +0 -2
  295. package/out/__chunks__/chunk-JOPPHD4R.mjs +0 -2
  296. package/out/__chunks__/chunk-QZDVKNF4.mjs +0 -2
  297. package/out/__chunks__/chunk-SJLTVGKD.mjs +0 -2
  298. package/out/__chunks__/chunk-TT7J5V3M.mjs +0 -2
  299. package/out/__chunks__/chunk-WJJTA23D.mjs +0 -2
  300. /package/out/__chunks__/{chunk-7BZQYV6D.mjs.map → chunk-26N65762.mjs.map} +0 -0
  301. /package/out/__chunks__/{chunk-2ZW4LVVR.mjs.map → chunk-2EGSAA3Z.mjs.map} +0 -0
  302. /package/out/__chunks__/{chunk-5KY3OIFD.mjs.map → chunk-2GHN5K7N.mjs.map} +0 -0
  303. /package/out/__chunks__/{chunk-UUPS4KLW.mjs.map → chunk-2VFVLNXF.mjs.map} +0 -0
  304. /package/out/__chunks__/{chunk-AN4TQZVZ.mjs.map → chunk-3HHX2VYV.mjs.map} +0 -0
  305. /package/out/__chunks__/{chunk-VDAYN2HT.mjs.map → chunk-3HV7NSKE.mjs.map} +0 -0
  306. /package/out/__chunks__/{chunk-JHYKMKMK.mjs.map → chunk-3NBBN5ES.mjs.map} +0 -0
  307. /package/out/__chunks__/{chunk-TKIYJDS2.mjs.map → chunk-4272WAHN.mjs.map} +0 -0
  308. /package/out/__chunks__/{chunk-GJ64B4SS.mjs.map → chunk-4HDUGICF.mjs.map} +0 -0
  309. /package/out/__chunks__/{chunk-ILR4U7Q3.mjs.map → chunk-4LULGQ77.mjs.map} +0 -0
  310. /package/out/__chunks__/{chunk-ALBBGYHS.mjs.map → chunk-5AI7ZBQ5.mjs.map} +0 -0
  311. /package/out/__chunks__/{chunk-ZG6EULI2.mjs.map → chunk-67PAALEV.mjs.map} +0 -0
  312. /package/out/__chunks__/{chunk-PUCCTEN7.mjs.map → chunk-6BQH2QKE.mjs.map} +0 -0
  313. /package/out/__chunks__/{chunk-YYVGE2ZU.mjs.map → chunk-6TVBPLPC.mjs.map} +0 -0
  314. /package/out/__chunks__/{chunk-AVEMKF6Z.mjs.map → chunk-6YF7VKF2.mjs.map} +0 -0
  315. /package/out/__chunks__/{chunk-ET6MYYOM.mjs.map → chunk-6YXFRH3W.mjs.map} +0 -0
  316. /package/out/__chunks__/{chunk-JFIQXGJ5.mjs.map → chunk-APIYOYTG.mjs.map} +0 -0
  317. /package/out/__chunks__/{chunk-I2CW2O7M.mjs.map → chunk-BLTIK7JF.mjs.map} +0 -0
  318. /package/out/__chunks__/{chunk-KTQD4DTE.mjs.map → chunk-BY3GVURF.mjs.map} +0 -0
  319. /package/out/__chunks__/{chunk-5VQOOZQV.mjs.map → chunk-CWBECQEY.mjs.map} +0 -0
  320. /package/out/__chunks__/{chunk-RXE5QIE3.mjs.map → chunk-DA5DI7Z2.mjs.map} +0 -0
  321. /package/out/__chunks__/{chunk-BC5MT6WS.mjs.map → chunk-DDLSBIL3.mjs.map} +0 -0
  322. /package/out/__chunks__/{chunk-NO4FZ4M3.mjs.map → chunk-DJAONPNL.mjs.map} +0 -0
  323. /package/out/__chunks__/{chunk-J6MUGECP.mjs.map → chunk-DRCMZIYT.mjs.map} +0 -0
  324. /package/out/__chunks__/{chunk-7UUDW64Y.mjs.map → chunk-EIQQDFQS.mjs.map} +0 -0
  325. /package/out/__chunks__/{chunk-ELCWJYQ7.mjs.map → chunk-ERQPDDHO.mjs.map} +0 -0
  326. /package/out/__chunks__/{chunk-ZM77AGP5.mjs.map → chunk-EYUQXPCB.mjs.map} +0 -0
  327. /package/out/__chunks__/{chunk-GDMANS7S.mjs.map → chunk-FMEC7LEU.mjs.map} +0 -0
  328. /package/out/__chunks__/{chunk-X3AX4PFE.mjs.map → chunk-FT7PQFYY.mjs.map} +0 -0
  329. /package/out/__chunks__/{chunk-HKVAAOC4.mjs.map → chunk-FZ6B646C.mjs.map} +0 -0
  330. /package/out/__chunks__/{chunk-O462QL7Q.mjs.map → chunk-G6AICUIC.mjs.map} +0 -0
  331. /package/out/__chunks__/{chunk-QZDVKNF4.mjs.map → chunk-GEB4VHTN.mjs.map} +0 -0
  332. /package/out/__chunks__/{chunk-SLG55PDO.mjs.map → chunk-GEHX6WX2.mjs.map} +0 -0
  333. /package/out/__chunks__/{chunk-GPUXJWA3.mjs.map → chunk-GFJFVWV5.mjs.map} +0 -0
  334. /package/out/__chunks__/{chunk-25G6565D.mjs.map → chunk-H5KMHLWL.mjs.map} +0 -0
  335. /package/out/__chunks__/{chunk-QJ6YLLBK.mjs.map → chunk-H7SFJJL6.mjs.map} +0 -0
  336. /package/out/__chunks__/{chunk-AGBY3WIQ.mjs.map → chunk-HAD6KD4V.mjs.map} +0 -0
  337. /package/out/__chunks__/{chunk-2WAT3RZ3.mjs.map → chunk-HJAGGOLY.mjs.map} +0 -0
  338. /package/out/__chunks__/{chunk-E5OMXZT7.mjs.map → chunk-HR2SURU6.mjs.map} +0 -0
  339. /package/out/__chunks__/{chunk-FFGJMR4Q.mjs.map → chunk-HU5DHLOV.mjs.map} +0 -0
  340. /package/out/__chunks__/{chunk-JM3JEGRV.mjs.map → chunk-IUQSTHCF.mjs.map} +0 -0
  341. /package/out/__chunks__/{chunk-WJJTA23D.mjs.map → chunk-J27BRSLL.mjs.map} +0 -0
  342. /package/out/__chunks__/{chunk-JOPPHD4R.mjs.map → chunk-KDIEM47U.mjs.map} +0 -0
  343. /package/out/__chunks__/{chunk-73E7X7HK.mjs.map → chunk-LFIWIGR3.mjs.map} +0 -0
  344. /package/out/__chunks__/{chunk-T3RXRYP5.mjs.map → chunk-LFZNSKP4.mjs.map} +0 -0
  345. /package/out/__chunks__/{chunk-ZJM5FGLA.mjs.map → chunk-LOQI2FKT.mjs.map} +0 -0
  346. /package/out/__chunks__/{chunk-32DICVUK.mjs.map → chunk-LRN3QFXR.mjs.map} +0 -0
  347. /package/out/__chunks__/{chunk-IXO75QXR.mjs.map → chunk-MB44B2VD.mjs.map} +0 -0
  348. /package/out/__chunks__/{chunk-ZAY5O7DE.mjs.map → chunk-MBL2SMPH.mjs.map} +0 -0
  349. /package/out/__chunks__/{chunk-OI2AXS22.mjs.map → chunk-MIDAGVE7.mjs.map} +0 -0
  350. /package/out/__chunks__/{chunk-QMFEYMZI.mjs.map → chunk-MKKMCI5C.mjs.map} +0 -0
  351. /package/out/__chunks__/{chunk-6VPMVY56.mjs.map → chunk-MLZIGIVD.mjs.map} +0 -0
  352. /package/out/__chunks__/{chunk-ETH6P454.mjs.map → chunk-MPEAYRQ7.mjs.map} +0 -0
  353. /package/out/__chunks__/{chunk-PCGP4VVW.mjs.map → chunk-MTELOBHN.mjs.map} +0 -0
  354. /package/out/__chunks__/{chunk-UXBKGTA5.mjs.map → chunk-MV2P2LIM.mjs.map} +0 -0
  355. /package/out/__chunks__/{chunk-5F53ZQDO.mjs.map → chunk-NHALZZT2.mjs.map} +0 -0
  356. /package/out/__chunks__/{chunk-4ZAZCOJD.mjs.map → chunk-NMNZYGK7.mjs.map} +0 -0
  357. /package/out/__chunks__/{chunk-JKFZERMM.mjs.map → chunk-NV4HFS2C.mjs.map} +0 -0
  358. /package/out/__chunks__/{chunk-643FDBLR.mjs.map → chunk-OE6BHO2G.mjs.map} +0 -0
  359. /package/out/__chunks__/{chunk-HBZ2RP7A.mjs.map → chunk-OMJ2W7Q6.mjs.map} +0 -0
  360. /package/out/__chunks__/{chunk-H7YY4BCM.mjs.map → chunk-OX6JXWI4.mjs.map} +0 -0
  361. /package/out/__chunks__/{chunk-VY62CH5W.mjs.map → chunk-OY6YT36R.mjs.map} +0 -0
  362. /package/out/__chunks__/{chunk-KZUPCFEG.mjs.map → chunk-PKBE3QGG.mjs.map} +0 -0
  363. /package/out/__chunks__/{chunk-A63UAQRB.mjs.map → chunk-Q3ZV52DK.mjs.map} +0 -0
  364. /package/out/__chunks__/{chunk-6FRXGPOE.mjs.map → chunk-QMGMGA2Q.mjs.map} +0 -0
  365. /package/out/__chunks__/{chunk-SJLTVGKD.mjs.map → chunk-QNONSTFE.mjs.map} +0 -0
  366. /package/out/__chunks__/{chunk-MNIS55JL.mjs.map → chunk-QRJ7LCAP.mjs.map} +0 -0
  367. /package/out/__chunks__/{chunk-GWXW3E7L.mjs.map → chunk-RMJFY5IQ.mjs.map} +0 -0
  368. /package/out/__chunks__/{chunk-5DUIQBPR.mjs.map → chunk-RSHZQFID.mjs.map} +0 -0
  369. /package/out/__chunks__/{chunk-B5YOJH7H.mjs.map → chunk-UXLYMCYP.mjs.map} +0 -0
  370. /package/out/__chunks__/{chunk-2UPWFRCA.mjs.map → chunk-VPTU4FYE.mjs.map} +0 -0
  371. /package/out/__chunks__/{chunk-6C26F7JZ.mjs.map → chunk-VRFYFZSY.mjs.map} +0 -0
  372. /package/out/__chunks__/{chunk-TT7J5V3M.mjs.map → chunk-WRIY2QON.mjs.map} +0 -0
  373. /package/out/__chunks__/{chunk-V3GRSQIB.mjs.map → chunk-X5XAS5LP.mjs.map} +0 -0
  374. /package/out/__chunks__/{chunk-ALT4OKHK.mjs.map → chunk-XG6M2FRF.mjs.map} +0 -0
  375. /package/out/__chunks__/{chunk-5WR632LR.mjs.map → chunk-YXOPNTJA.mjs.map} +0 -0
  376. /package/out/__chunks__/{chunk-UF2Y4P6U.mjs.map → chunk-Z6SGIEGJ.mjs.map} +0 -0
  377. /package/out/__chunks__/{chunk-V322LMVG.mjs.map → chunk-ZJ55WUB7.mjs.map} +0 -0
  378. /package/out/__chunks__/{chunk-BEXC6NB5.mjs.map → chunk-ZZVF5NIV.mjs.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-4272WAHN.mjs";import{c as n}from"./chunk-RMJFY5IQ.mjs";async function c({loginToken:r,extraInfoData:i,address:e}){let o=await t({originalLoginToken:r,extraInfoData:i,address:e});return o.modifiedLoginToken&&n(o.modifiedLoginToken),o.address}export{c as a};
2
+ //# sourceMappingURL=chunk-26N65762.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-PCGP4VVW.mjs";import{a}from"./chunk-JFIQXGJ5.mjs";import{a as u}from"./chunk-MNIS55JL.mjs";import{c as n}from"./chunk-4ZAZCOJD.mjs";import{a as s}from"./chunk-G43Z243B.mjs";var c=(o,t)=>{let r=`sdk-dapp-logout-event-${o}`,e=t.getItem(r);e&&o!==e||(t.setItem(r,o),t.removeItem(r))};async function L({provider:o,options:t={shouldBroadcastLogoutAcrossTabs:!0}}){let r=a();t.shouldBroadcastLogoutAcrossTabs&&s.localStorage&&c(r,s.localStorage);try{return u(),n.forEach(g=>g()),n.clear(),i.closeConnectionRef?.(),await o.logout()}catch(e){return console.error("Logging out error:",e),!1}}export{L as a};
2
- //# sourceMappingURL=chunk-2ZW4LVVR.mjs.map
1
+ import{a as i}from"./chunk-MTELOBHN.mjs";import{a}from"./chunk-APIYOYTG.mjs";import{a as u}from"./chunk-QRJ7LCAP.mjs";import{c as n}from"./chunk-NMNZYGK7.mjs";import{a as s}from"./chunk-UDD74TMO.mjs";var c=(o,t)=>{let r=`sdk-dapp-logout-event-${o}`,e=t.getItem(r);e&&o!==e||(t.setItem(r,o),t.removeItem(r))};async function L({provider:o,options:t={shouldBroadcastLogoutAcrossTabs:!0}}){let r=a();t.shouldBroadcastLogoutAcrossTabs&&s.localStorage&&c(r,s.localStorage);try{return u(),n.forEach(g=>g()),n.clear(),i.closeConnectionRef?.(),await o.logout()}catch(e){return console.error("Logging out error:",e),!1}}export{L as a};
2
+ //# sourceMappingURL=chunk-2EGSAA3Z.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-T3RXRYP5.mjs";import{a as r}from"./chunk-B2UIPHJ3.mjs";var o=()=>{try{return!r()||!e()?!1:window.self!==window.top}catch{return!0}};export{o as a};
2
- //# sourceMappingURL=chunk-5KY3OIFD.mjs.map
1
+ import{a as e}from"./chunk-LFZNSKP4.mjs";import{a as r}from"./chunk-B2UIPHJ3.mjs";var o=()=>{try{return!r()||!e()?!1:window.self!==window.top}catch{return!0}};export{o as a};
2
+ //# sourceMappingURL=chunk-2GHN5K7N.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as T}from"./chunk-Q2Q4XN4M.mjs";import{b as u}from"./chunk-ETH6P454.mjs";import{d as m,e as l}from"./chunk-O462QL7Q.mjs";import{q as a}from"./chunk-GWXW3E7L.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=1e3,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-UUPS4KLW.mjs.map
1
+ import{a as T}from"./chunk-Q2Q4XN4M.mjs";import{b as u}from"./chunk-MPEAYRQ7.mjs";import{d as m,e as l}from"./chunk-G6AICUIC.mjs";import{q as a}from"./chunk-RMJFY5IQ.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=1e3,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-2VFVLNXF.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-IXO75QXR.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-AN4TQZVZ.mjs.map
1
+ import{a as s}from"./chunk-MB44B2VD.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-3HHX2VYV.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-IXO75QXR.mjs";var e=class n extends t{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE_PENDING_TRANSACTIONS",uiTag:"mvx-pending-transactions-panel"});this.initialData=null;this.data=this.initialData}static getInstance(){return n.instance||(n.instance=new n),n.instance}isPendingTransactionsOpen(){return this.isOpen}async setupEventListeners(){this.eventBus&&this.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",this.closeUI.bind(this))}};export{e as a};
2
- //# sourceMappingURL=chunk-VDAYN2HT.mjs.map
1
+ import{a as t}from"./chunk-MB44B2VD.mjs";var e=class n extends t{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE_PENDING_TRANSACTIONS",uiTag:"mvx-pending-transactions-panel"});this.initialData=null;this.data=this.initialData}static getInstance(){return n.instance||(n.instance=new n),n.instance}isPendingTransactionsOpen(){return this.isOpen}async setupEventListeners(){this.eventBus&&this.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",this.closeUI.bind(this))}};export{e as a};
2
+ //# sourceMappingURL=chunk-3HV7NSKE.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as s}from"./chunk-NTOY6GTP.mjs";import{c as r,d as a}from"./chunk-M6MN4RXG.mjs";import{s as e}from"./chunk-GWXW3E7L.mjs";import{a as n}from"./chunk-UERJ6AKK.mjs";var u=t=>{let o=0,i=n(e())?.shard;return S(t)?(t.forEach(c=>{let m=s(c,i);o+=m?5*6e3:6e3}),o):(o=s(t,i)?5*6e3:6e3,o)};export{u as a};
2
- //# sourceMappingURL=chunk-JHYKMKMK.mjs.map
1
+ import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as s}from"./chunk-NTOY6GTP.mjs";import{c as r,d as a}from"./chunk-M6MN4RXG.mjs";import{s as e}from"./chunk-RMJFY5IQ.mjs";import{a as n}from"./chunk-UERJ6AKK.mjs";var u=t=>{let o=0,i=n(e())?.shard;return S(t)?(t.forEach(c=>{let m=s(c,i);o+=m?5*6e3:6e3}),o):(o=s(t,i)?5*6e3:6e3,o)};export{u as a};
2
+ //# sourceMappingURL=chunk-3NBBN5ES.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-A63UAQRB.mjs";async function g({originalLoginToken:i,extraInfoData:n,address:o}){let e=await t({loginToken:i,extraInfoData:n}),s=n.multisig||n.impersonate||o;return{address:e!=null?s:o,modifiedLoginToken:e}}export{g as a};
2
- //# sourceMappingURL=chunk-TKIYJDS2.mjs.map
1
+ import{a as t}from"./chunk-Q3ZV52DK.mjs";async function g({originalLoginToken:i,extraInfoData:n,address:o}){let e=await t({loginToken:i,extraInfoData:n}),s=n.multisig||n.impersonate||o;return{address:e!=null?s:o,modifiedLoginToken:e}}export{g as a};
2
+ //# sourceMappingURL=chunk-4272WAHN.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-GWXW3E7L.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-GJ64B4SS.mjs.map
1
+ import{e as o,f as a,g as i,h as r}from"./chunk-NGM3AVCY.mjs";import{s as c}from"./chunk-RMJFY5IQ.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-4HDUGICF.mjs.map
@@ -0,0 +1,2 @@
1
+ import{s as r}from"./chunk-RMJFY5IQ.mjs";import{b as t}from"./chunk-UTWIKUIK.mjs";var i=(e,o)=>t(`transaction-${e}`)(o??r())??null;export{i as a};
2
+ //# sourceMappingURL=chunk-4LULGQ77.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-3QWTD55I.mjs";import{s as m}from"./chunk-GWXW3E7L.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-ALBBGYHS.mjs.map
1
+ import{a as g}from"./chunk-3QWTD55I.mjs";import{s as m}from"./chunk-RMJFY5IQ.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-5AI7ZBQ5.mjs.map
@@ -1,2 +1,2 @@
1
- import{s as e}from"./chunk-GWXW3E7L.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-ZG6EULI2.mjs.map
1
+ import{s as e}from"./chunk-RMJFY5IQ.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-67PAALEV.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-SJLTVGKD.mjs";import{a as f}from"./chunk-643FDBLR.mjs";import{a as g}from"./chunk-ZG6EULI2.mjs";import{b as a}from"./chunk-GWXW3E7L.mjs";import{c as s,g as r}from"./chunk-NTEMINYA.mjs";var v=async({signMessageCallback:m,nativeAuthClientConfig:o})=>{let{address:t}=u(),c=g(),i=f(o||c),e=await i.initialize({noCache:!!o});if(!e)return null;let h=new r({address:new s(t),data:Buffer.from(`${t}${e}`)}),n=await m(h,{});if(!n?.signature)throw"Message not signed";return a({loginToken:e,signature:Buffer.from(n.signature).toString("hex")}),i.getToken({address:t,token:e,signature:Buffer.from(n.signature).toString("hex")})};export{v as a};
2
- //# sourceMappingURL=chunk-PUCCTEN7.mjs.map
1
+ import{a as u}from"./chunk-QNONSTFE.mjs";import{a as f}from"./chunk-OE6BHO2G.mjs";import{a as g}from"./chunk-67PAALEV.mjs";import{b as a}from"./chunk-RMJFY5IQ.mjs";import{c as s,g as r}from"./chunk-NTEMINYA.mjs";var v=async({signMessageCallback:m,nativeAuthClientConfig:o})=>{let{address:t}=u(),c=g(),i=f(o||c),e=await i.initialize({noCache:!!o});if(!e)return null;let h=new r({address:new s(t),data:Buffer.from(`${t}${e}`)}),n=await m(h,{});if(!n?.signature)throw"Message not signed";return a({loginToken:e,signature:Buffer.from(n.signature).toString("hex")}),i.getToken({address:t,token:e,signature:Buffer.from(n.signature).toString("hex")})};export{v as a};
2
+ //# sourceMappingURL=chunk-6BQH2QKE.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-G43Z243B.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-YYVGE2ZU.mjs.map
1
+ import{a as o}from"./chunk-UDD74TMO.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-6TVBPLPC.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-55W25Q35.mjs";import{a as r}from"./chunk-HBZ2RP7A.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-AVEMKF6Z.mjs.map
1
+ import{a as s}from"./chunk-55W25Q35.mjs";import{a as r}from"./chunk-OMJ2W7Q6.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-6YF7VKF2.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as O}from"./chunk-AN4TQZVZ.mjs";import{a as k}from"./chunk-6C26F7JZ.mjs";import{a as B}from"./chunk-5VQOOZQV.mjs";import{a as b}from"./chunk-ALT4OKHK.mjs";import{a as A}from"./chunk-QXC4D3AC.mjs";import{a as D}from"./chunk-KTQD4DTE.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as _}from"./chunk-32DICVUK.mjs";import{a as R}from"./chunk-K373M2BG.mjs";import{a as j}from"./chunk-URJQWHBM.mjs";import{s as x}from"./chunk-GWXW3E7L.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-ET6MYYOM.mjs.map
1
+ import{a as O}from"./chunk-3HHX2VYV.mjs";import{a as k}from"./chunk-VRFYFZSY.mjs";import{a as B}from"./chunk-CWBECQEY.mjs";import{a as b}from"./chunk-XG6M2FRF.mjs";import{a as A}from"./chunk-QXC4D3AC.mjs";import{a as D}from"./chunk-BY3GVURF.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as _}from"./chunk-LRN3QFXR.mjs";import{a as R}from"./chunk-K373M2BG.mjs";import{a as j}from"./chunk-URJQWHBM.mjs";import{s as x}from"./chunk-RMJFY5IQ.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-6YXFRH3W.mjs.map
@@ -0,0 +1,2 @@
1
+ import{s as t}from"./chunk-RMJFY5IQ.mjs";import{c as r}from"./chunk-UERJ6AKK.mjs";function m(e=t()){return r(e)}export{m as a};
2
+ //# sourceMappingURL=chunk-APIYOYTG.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-O7LCTC4K.mjs";import{s as m}from"./chunk-GWXW3E7L.mjs";import{b as a}from"./chunk-7VHTZYM2.mjs";import{o as r,u as i}from"./chunk-KD2IQ32V.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";async function b({tokenId:o}){let t=a(m()),{isNft:k}=c(o),n=o,p=k?r:i;if(!n)return{tokenDecimals:Number(t.decimals),tokenLabel:"",tokenAvatar:""};try{let{data:e}=await s.get(`${t.apiAddress}/${p}/${n}`),f=e?e?.decimals:Number(t.decimals),l=e?e?.name:"",d=e?e?.assets?.svgUrl??e?.media?.[0]?.thumbnailUrl:"";return{tokenDecimals:f,tokenLabel:l,type:e?.type,tokenAvatar:d,identifier:e?.identifier,assets:e?.assets,esdtPrice:e?.price,ticker:e?.ticker,name:e?.name}}catch(e){return{error:`Error fetching token ${n}: ${e.toString()}`,tokenDecimals:Number(t.decimals),tokenLabel:"",tokenAvatar:"",identifier:n}}}export{b as a};
2
- //# sourceMappingURL=chunk-I2CW2O7M.mjs.map
1
+ import{a as s}from"./chunk-O7LCTC4K.mjs";import{s as m}from"./chunk-RMJFY5IQ.mjs";import{b as a}from"./chunk-7VHTZYM2.mjs";import{o as r,u as i}from"./chunk-KD2IQ32V.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";async function b({tokenId:o}){let t=a(m()),{isNft:k}=c(o),n=o,p=k?r:i;if(!n)return{tokenDecimals:Number(t.decimals),tokenLabel:"",tokenAvatar:""};try{let{data:e}=await s.get(`${t.apiAddress}/${p}/${n}`),f=e?e?.decimals:Number(t.decimals),l=e?e?.name:"",d=e?e?.assets?.svgUrl??e?.media?.[0]?.thumbnailUrl:"";return{tokenDecimals:f,tokenLabel:l,type:e?.type,tokenAvatar:d,identifier:e?.identifier,assets:e?.assets,esdtPrice:e?.price,ticker:e?.ticker,name:e?.name}}catch(e){return{error:`Error fetching token ${n}: ${e.toString()}`,tokenDecimals:Number(t.decimals),tokenLabel:"",tokenAvatar:"",identifier:n}}}export{b as a};
2
+ //# sourceMappingURL=chunk-BLTIK7JF.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as M}from"./chunk-5F53ZQDO.mjs";import{a as U}from"./chunk-OLPFN3HZ.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-URJQWHBM.mjs";import{a as w}from"./chunk-YGI3KXMZ.mjs";import{a as O}from"./chunk-ALBBGYHS.mjs";import{a as v}from"./chunk-RYIJWGFA.mjs";import{x}from"./chunk-ZM77AGP5.mjs";import{a as G}from"./chunk-BRJNX4JF.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-G43Z243B.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-KTQD4DTE.mjs.map
1
+ import{a as M}from"./chunk-NHALZZT2.mjs";import{a as U}from"./chunk-OLPFN3HZ.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-URJQWHBM.mjs";import{a as w}from"./chunk-YGI3KXMZ.mjs";import{a as O}from"./chunk-5AI7ZBQ5.mjs";import{a as v}from"./chunk-RYIJWGFA.mjs";import{x}from"./chunk-EYUQXPCB.mjs";import{a as G}from"./chunk-BRJNX4JF.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-UDD74TMO.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-BY3GVURF.mjs.map
@@ -0,0 +1,2 @@
1
+ import{s as t}from"./chunk-RMJFY5IQ.mjs";import{b as e}from"./chunk-7VHTZYM2.mjs";function g(r=t()){return e(r).egldLabel}export{g as a};
2
+ //# sourceMappingURL=chunk-CWBECQEY.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-OI2AXS22.mjs";var n=class t extends e{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-wallet-connect"});this.initialData={wcURI:"",walletConnectDeepLink:""};this.data={...this.initialData}}static getInstance(){return t.instance||(t.instance=new t),t.instance}handleClose(a){a?.isLoginFinished||(this.anchor?this.anchor.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy())}async setupEventListeners(){this.eventBus&&(this.eventBus.subscribe("CLOSE",this.handleClose.bind(this)),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}};export{n as a};
2
- //# sourceMappingURL=chunk-RXE5QIE3.mjs.map
1
+ import{a as e}from"./chunk-MIDAGVE7.mjs";var n=class t extends e{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-wallet-connect"});this.initialData={wcURI:"",walletConnectDeepLink:""};this.data={...this.initialData}}static getInstance(){return t.instance||(t.instance=new t),t.instance}handleClose(a){a?.isLoginFinished||(this.anchor?this.anchor.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy())}async setupEventListeners(){this.eventBus&&(this.eventBus.subscribe("CLOSE",this.handleClose.bind(this)),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}};export{n as a};
2
+ //# sourceMappingURL=chunk-DA5DI7Z2.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-OI2AXS22.mjs";var c=class n extends i{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-ledger-connect"});this.addressesPerPage=10;this.allAccounts=[];this.initialConnectScreenData={};this.connectScreenData={...this.initialConnectScreenData};this.initialAccountScreenData={accounts:this.allAccounts,startIndex:0,addressesPerPage:this.addressesPerPage,isLoading:!0};this.accountScreenData={...this.initialAccountScreenData};this.initialConfirmScreenData={selectedAddress:"",explorerLink:""};this.confirmScreenData={...this.initialConfirmScreenData};this.initialData={connectScreenData:this.initialConnectScreenData,accountScreenData:this.initialAccountScreenData,confirmScreenData:this.initialConfirmScreenData};this.data=this.getInitialData()}static getInstance(){return n.instance||(n.instance=new n),n.instance}updateAllAccounts(e){this.allAccounts=e,this.accountScreenData.accounts=e}updateStartIndex(e){this.accountScreenData.startIndex=e}updateConnectScreen(e){this.connectScreenData={...this.connectScreenData,...e},this.data.confirmScreenData=null,this.data.accountScreenData=null,this.data.connectScreenData=this.connectScreenData,this.notifyDataUpdate()}updateAccountScreen(e){this.accountScreenData={...this.accountScreenData,...e},this.data.confirmScreenData=null,this.data.accountScreenData=this.accountScreenData,this.notifyDataUpdate()}updateConfirmScreen(e){this.confirmScreenData={...this.confirmScreenData,...e},this.data.accountScreenData=null,this.data.confirmScreenData=this.confirmScreenData,this.notifyDataUpdate()}getAccountScreenData(){return this.data.accountScreenData}getConfirmScreenData(){return this.data.confirmScreenData}getAllAccounts(){return this.allAccounts}subscribeToProviderInit({handleRetry:e,handleCancel:t}){this.eventBus&&(this.eventBus.subscribe("CONNECT_DEVICE",e),this.eventBus.subscribe("CLOSE",t),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}unsubscribeFromProviderInit({handleRetry:e,handleCancel:t}){this.eventBus&&(this.eventBus.unsubscribe("CONNECT_DEVICE",e),this.eventBus.unsubscribe("CLOSE",t),this.eventBus.unsubscribe("UI_DISCONNECTED",this.destroy.bind(this)))}subscribeToAuthEvents({handleCancel:e,handleAccessWallet:t,handleGoToPage:a}){this.eventBus&&(this.eventBus.subscribe("CLOSE",e),this.eventBus.subscribe("ACCESS_WALLET",t),this.eventBus.subscribe("GO_TO_PAGE",a))}unsubscribeFromAuthEvents({handleCancel:e,handleAccessWallet:t,handleGoToPage:a}){this.eventBus&&(this.eventBus.unsubscribe("CLOSE",e),this.eventBus.unsubscribe("ACCESS_WALLET",t),this.eventBus.unsubscribe("GO_TO_PAGE",a))}handleClose(){this.anchor?this.anchor?.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy()}resetData(){this.accountScreenData={...this.initialAccountScreenData},this.confirmScreenData={...this.initialConfirmScreenData},this.connectScreenData={...this.initialConnectScreenData},super.resetData()}async setupEventListeners(){this.eventBus&&this.eventBus.subscribe("CLOSE",this.handleClose.bind(this))}};export{c as a};
2
- //# sourceMappingURL=chunk-BC5MT6WS.mjs.map
1
+ import{a as i}from"./chunk-MIDAGVE7.mjs";var c=class n extends i{constructor(){super({uiDataUpdateEvent:"DATA_UPDATE",uiTag:"mvx-ledger-connect"});this.addressesPerPage=10;this.allAccounts=[];this.initialConnectScreenData={};this.connectScreenData={...this.initialConnectScreenData};this.initialAccountScreenData={accounts:this.allAccounts,startIndex:0,addressesPerPage:this.addressesPerPage,isLoading:!0};this.accountScreenData={...this.initialAccountScreenData};this.initialConfirmScreenData={selectedAddress:"",explorerLink:""};this.confirmScreenData={...this.initialConfirmScreenData};this.initialData={connectScreenData:this.initialConnectScreenData,accountScreenData:this.initialAccountScreenData,confirmScreenData:this.initialConfirmScreenData};this.data=this.getInitialData()}static getInstance(){return n.instance||(n.instance=new n),n.instance}updateAllAccounts(e){this.allAccounts=e,this.accountScreenData.accounts=e}updateStartIndex(e){this.accountScreenData.startIndex=e}updateConnectScreen(e){this.connectScreenData={...this.connectScreenData,...e},this.data.confirmScreenData=null,this.data.accountScreenData=null,this.data.connectScreenData=this.connectScreenData,this.notifyDataUpdate()}updateAccountScreen(e){this.accountScreenData={...this.accountScreenData,...e},this.data.confirmScreenData=null,this.data.accountScreenData=this.accountScreenData,this.notifyDataUpdate()}updateConfirmScreen(e){this.confirmScreenData={...this.confirmScreenData,...e},this.data.accountScreenData=null,this.data.confirmScreenData=this.confirmScreenData,this.notifyDataUpdate()}getAccountScreenData(){return this.data.accountScreenData}getConfirmScreenData(){return this.data.confirmScreenData}getAllAccounts(){return this.allAccounts}subscribeToProviderInit({handleRetry:e,handleCancel:t}){this.eventBus&&(this.eventBus.subscribe("CONNECT_DEVICE",e),this.eventBus.subscribe("CLOSE",t),this.eventBus.subscribe("UI_DISCONNECTED",this.destroy.bind(this)))}unsubscribeFromProviderInit({handleRetry:e,handleCancel:t}){this.eventBus&&(this.eventBus.unsubscribe("CONNECT_DEVICE",e),this.eventBus.unsubscribe("CLOSE",t),this.eventBus.unsubscribe("UI_DISCONNECTED",this.destroy.bind(this)))}subscribeToAuthEvents({handleCancel:e,handleAccessWallet:t,handleGoToPage:a}){this.eventBus&&(this.eventBus.subscribe("CLOSE",e),this.eventBus.subscribe("ACCESS_WALLET",t),this.eventBus.subscribe("GO_TO_PAGE",a))}unsubscribeFromAuthEvents({handleCancel:e,handleAccessWallet:t,handleGoToPage:a}){this.eventBus&&(this.eventBus.unsubscribe("CLOSE",e),this.eventBus.unsubscribe("ACCESS_WALLET",t),this.eventBus.unsubscribe("GO_TO_PAGE",a))}handleClose(){this.anchor?this.anchor?.dispatchEvent(new CustomEvent("ANCHOR_CLOSE",{composed:!1,bubbles:!1})):this.destroy()}resetData(){this.accountScreenData={...this.initialAccountScreenData},this.confirmScreenData={...this.initialConfirmScreenData},this.connectScreenData={...this.initialConnectScreenData},super.resetData()}async setupEventListeners(){this.eventBus&&this.eventBus.subscribe("CLOSE",this.handleClose.bind(this))}};export{c as a};
2
+ //# sourceMappingURL=chunk-DDLSBIL3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-SLG55PDO.mjs";import{b as r}from"./chunk-AGBY3WIQ.mjs";import{s as i}from"./chunk-GWXW3E7L.mjs";import{b as o}from"./chunk-7VHTZYM2.mjs";async function M({shard:t,apiAddress:s}){if(t!=null)try{let a=await n(t,s);if(!a?.[t]?.lastBlock)return;let e=o(i());(!e.gasStationMetadata||!e.gasStationMetadata[t]||e.gasStationMetadata[t].lastBlock!==a[t].lastBlock)&&r({...e,gasStationMetadata:{...e.gasStationMetadata,...a}})}catch(a){console.error("Error fetching gas station metadata:",a)}}export{M as a};
2
- //# sourceMappingURL=chunk-NO4FZ4M3.mjs.map
1
+ import{a as n}from"./chunk-GEHX6WX2.mjs";import{b as r}from"./chunk-HAD6KD4V.mjs";import{s as i}from"./chunk-RMJFY5IQ.mjs";import{b as o}from"./chunk-7VHTZYM2.mjs";async function M({shard:t,apiAddress:s}){if(t!=null)try{let a=await n(t,s);if(!a?.[t]?.lastBlock)return;let e=o(i());(!e.gasStationMetadata||!e.gasStationMetadata[t]||e.gasStationMetadata[t].lastBlock!==a[t].lastBlock)&&r({...e,gasStationMetadata:{...e.gasStationMetadata,...a}})}catch(a){console.error("Error fetching gas station metadata:",a)}}export{M as a};
2
+ //# sourceMappingURL=chunk-DJAONPNL.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as ce}from"./chunk-M3YL36ZL.mjs";import{a as A}from"./chunk-RXE5QIE3.mjs";import{a as ae}from"./chunk-2Y66XRQK.mjs";import{a as oe}from"./chunk-UXBKGTA5.mjs";import{a as R}from"./chunk-BC5MT6WS.mjs";import{a as ne}from"./chunk-QMFEYMZI.mjs";import{a as ie}from"./chunk-GPUXJWA3.mjs";import{a as te}from"./chunk-YUFPUG5O.mjs";import{a as de}from"./chunk-V322LMVG.mjs";import{a as p}from"./chunk-ELCWJYQ7.mjs";import{a as re}from"./chunk-VY62CH5W.mjs";import{a as S}from"./chunk-ET6MYYOM.mjs";import{a as se}from"./chunk-32DICVUK.mjs";import{a as b}from"./chunk-QJGFIK7H.mjs";import{b as ee}from"./chunk-4Z3DZ2A3.mjs";import{b as I,c as Z}from"./chunk-NRXYSTRW.mjs";import{i as J,m as U,v as M,w as C,x as L}from"./chunk-ZM77AGP5.mjs";import{a as y}from"./chunk-E5OMXZT7.mjs";import{a as X}from"./chunk-JFIQXGJ5.mjs";import{a as N}from"./chunk-4TBVQD27.mjs";import{a as Q}from"./chunk-MNIS55JL.mjs";import{g as Y}from"./chunk-M6MN4RXG.mjs";import{a as q,q as F,s as c}from"./chunk-GWXW3E7L.mjs";import{f as H}from"./chunk-UERJ6AKK.mjs";import{b as f,c as B}from"./chunk-7VHTZYM2.mjs";import{a as G}from"./chunk-VNLGNNIL.mjs";import{b as $,c as j}from"./chunk-6JM4DPOH.mjs";import{a as l,b as K}from"./chunk-6R2WFQ7U.mjs";import{a as o}from"./chunk-LJX4MW7B.mjs";var w=class extends p{constructor({address:e,anchor:r,shouldInitProvider:t}){super(e);this.provider=null;this.config=null;this.ledgerLogin=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");if(!e||typeof e.addressIndex!="number")throw new Error("Missing addressIndex for Ledger login");let{address:r,signature:t}=await this.provider.login({addressIndex:e.addressIndex});return{address:r,signature:t??""}};this.loginOperation=async e=>{if(!this.provider||!this.config)throw new Error("Provider is not initialized.");return await oe({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!y())return;await R.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await S({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await le({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await ie({shouldInitProvider:!0});this.provider=r}catch(r){throw J({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.ledger}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){await this.initLegderConnectManager(this.options?.anchor);let e=R.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((i,s)=>ne({manager:e,resolve:i,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ve=3e4,me=5e3,he=3e3,k=class a{constructor(){this.store=F();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let n=this.store.getState(),{providerType:e}=G(n),r=H(n);return!!(e===o.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let n=ee(c());if(!(!this.shouldCheckConnection()||n))try{await L().getProvider().getAddress()}catch{if(U.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"times",iconClassName:"warning",message:"Unlock your device to continue signing transactions",title:"Ledger disconnected"}),this.reset(),this.recreateProviderInterval)return;this.recreateProviderInterval=setInterval(this.reconnectProvider,me)}},ve))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let n=new w({shouldInitProvider:!0});await n.init();let e=new M(n);n.getType=()=>o.ledger,C(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,U.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:he,icon:"check",iconClassName:"success",message:"Your device is ready to sign transactions",title:"Ledger reconnected"}),this.startCheckConnectionLoop()}catch{console.log("Unable to reconnect to Ledger")}};this.reset=()=>{clearInterval(this.connectionCheckInterval??0),this.connectionCheckInterval=null}}static getInstance(){return a.instance||(a.instance=new a),a.instance}};var T=class extends p{constructor(e){super(e?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{onClose:r,manager:t}=await this.initSignState();try{let i=await this.provider.signTransactions(e)??[];return await se(i)}catch(i){throw await r({shouldCancelAction:!0}),i}finally{t.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:l.crossWindow})};this.walletAddress=e?.walletAddress,this.provider=b.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=f(c()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return o.crossWindow}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{ExtensionProvider as ue}from"@multiversx/sdk-extension-provider/out/extensionProvider";var _=class extends p{constructor(e){super(e);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)??[]}catch(i){throw await t({shouldCancelAction:!1}),i}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:l.extension})};this.provider=ue.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return o.extension}};var W=class extends p{constructor({address:e,walletUrl:r}={}){super(e);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await S({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})}catch(i){throw await t({shouldCancelAction:!0}),i}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:l[o.metamask]})};this.walletUrl=r??"",this.provider=ce.getInstance(),this._login=this.provider.login.bind(this.provider)}init(){return this.initializeAddress(),this.initializeWalletUrl(),this.initializeProvider()}initializeWalletUrl(){if(this.walletUrl)return;let e=f(c());if(!e.iframeWalletAddress)throw new Error("Invalid walletUrl");this.walletUrl=e.iframeWalletAddress}async initializeProvider(){return await this.provider.init(),this.address&&this.setAccount({address:this.address}),this.provider.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return o.metamask}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{OptionalOperation as we}from"@multiversx/sdk-wallet-connect-provider/out";var pe=[I.CANCEL_ACTION,I.SIGN_LOGIN_TOKEN],x=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;this.cancelActionAbortController=null;this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();this.cancelActionAbortController=new AbortController;let i=this.cancelActionAbortController.signal;try{let s=new Promise((h,v)=>{i.addEventListener("abort",()=>{v(new Error("cancelled by user"))})});return await Promise.race([this.provider.signTransactions(e),s])}catch(s){throw await t({shouldCancelAction:!0}),s}finally{r.closeUI()}};this.cancelAction=async()=>{this.sendCustomRequest({method:I.CANCEL_ACTION,action:we.CANCEL_ACTION}),this.cancelActionAbortController?.abort()};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");this.cancelActionAbortController=new AbortController;let r=this.cancelActionAbortController.signal,t=new Promise((s,d)=>{r.addEventListener("abort",()=>{d(new Error("cancelled by user"))})});return await Promise.race([g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:l.extension}),t])};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.walletConnect}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return Promise.resolve(this.provider.getAddress())}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){if(await this.initWalletConnectManager(),!this.config)throw new Error("Invalid WalletConnect setup");let{walletConnectProvider:e,dappMethods:r}=await this.createWalletConnectProvider(this.config);this.provider=e,this.methods=r;let{uri:t="",approval:i}=await this.provider.connect({methods:this.methods}),s=this.config.walletConnectDeepLink??N.walletConnectDeepLink;this._approval=i,A.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!y())return;await A.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=y(),t=B(c());if($(c())&&pe.push(I.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{Q()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:O={},walletConnectV2RelayAddress:D=""}=e,P=new Z(v,t,D,m,O);return await P.init(),{walletConnectProvider:P,dappMethods:pe}}catch(m){throw console.error("Unable to connect",m),r&&await this.logout(),m}}async login(e){if(!this.provider)throw new Error("Provider is not initialized. Call createProvider first.");let r=async()=>{if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.init();let t=A.getInstance(),{uri:i="",approval:s}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??N.walletConnectDeepLink;t.updateData({wcURI:i,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(i)}`});let h=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=h??{};return t.handleClose({isLoginFinished:!!v}),{address:v,signature:m}}catch{return await r()}};if(!this._approval)throw new Error("Approval or login is not initialized");try{let t=await this.provider.login({approval:this._approval.bind(this),token:e?.token}),{address:i="",signature:s=""}=t??{};return A.getInstance().handleClose({isLoginFinished:!!i}),{address:i,signature:s}}catch(t){return console.error("User rejected connection proposal",t),await r()}}async sendCustomRequest({action:e,method:r}){if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.sendCustomRequest?.({request:{method:r,params:{action:e}}})}catch(t){console.error("Unable to send event",t)}}};var E=class{static set customProviders(n){this._customProviders=n}static get customProviders(){return this._customProviders}static async create({type:n,anchor:e}){let r=null;switch(n){case o.extension:{r=new _;break}case o.crossWindow:{r=new T;break}case o.ledger:{r=new w({anchor:e}),await k.getInstance().init();break}case o.metamask:{r=new W;break}case o.passkey:{let s=f(c());r=new T({walletAddress:`${s.walletAddress}?${K}=${o.passkey}`});break}case o.walletConnect:{let s=j(c());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new x({anchor:e,...s});break}case o.webview:{r=new de;break}default:{let s=X();for(let d of this._customProviders)d.type===n&&(r=await d.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new M(r);C(t);let i="provider"in r&&r.provider instanceof b;return ae(i?{skipLoginMethod:o.crossWindow}:null),t}static async destroy(){L().cancelLogin(),C(null),q(o.none)}};E._customProviders=[];var Pe=(a,n)=>a.some(e=>e.type===n);async function g({message:a,handleSignMessage:n,cancelAction:e,providerType:r}){return await new Promise(async(i,s)=>{let{manager:d,onClose:h}=await re({cancelAction:e}),v=Object.values(E.customProviders),m=v.reduce((u,V)=>(u[V.type]=V.name,u),{}),O={...l,...m},D=async()=>{await h({shouldCancelAction:!0}),s({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",D);let P=Pe(v,r)?r:o.none;d.updateData({name:O[P],type:P});try{let u=await n(a);i(u)}catch(u){await h({shouldCancelAction:!0}),s(u)}finally{d.closeUI()}})}async function le({message:a,handleSignMessage:n}){try{return await g({message:a,handleSignMessage:n,providerType:l.ledger})}catch(e){let{errorMessage:r}=te(e);throw r?{message:r}:e}}export{le as a,w as b,k as c,E as d,g as e,T as f,_ as g,W as h,x as i};
2
- //# sourceMappingURL=chunk-J6MUGECP.mjs.map
1
+ import{a as ce}from"./chunk-M3YL36ZL.mjs";import{a as A}from"./chunk-DA5DI7Z2.mjs";import{a as ae}from"./chunk-2Y66XRQK.mjs";import{a as oe}from"./chunk-MV2P2LIM.mjs";import{a as R}from"./chunk-DDLSBIL3.mjs";import{a as ne}from"./chunk-MKKMCI5C.mjs";import{a as ie}from"./chunk-GFJFVWV5.mjs";import{a as te}from"./chunk-YUFPUG5O.mjs";import{a as de}from"./chunk-ZJ55WUB7.mjs";import{a as p}from"./chunk-ERQPDDHO.mjs";import{a as re}from"./chunk-OY6YT36R.mjs";import{a as S}from"./chunk-6YXFRH3W.mjs";import{a as se}from"./chunk-LRN3QFXR.mjs";import{a as b}from"./chunk-QJGFIK7H.mjs";import{b as ee}from"./chunk-4Z3DZ2A3.mjs";import{b as I,c as Z}from"./chunk-NRXYSTRW.mjs";import{i as J,m as U,v as M,w as C,x as L}from"./chunk-EYUQXPCB.mjs";import{a as y}from"./chunk-HR2SURU6.mjs";import{a as X}from"./chunk-APIYOYTG.mjs";import{a as N}from"./chunk-4TBVQD27.mjs";import{a as Q}from"./chunk-QRJ7LCAP.mjs";import{g as Y}from"./chunk-M6MN4RXG.mjs";import{a as q,q as F,s as c}from"./chunk-RMJFY5IQ.mjs";import{f as H}from"./chunk-UERJ6AKK.mjs";import{b as f,c as B}from"./chunk-7VHTZYM2.mjs";import{a as G}from"./chunk-VNLGNNIL.mjs";import{b as $,c as j}from"./chunk-6JM4DPOH.mjs";import{a as l,b as K}from"./chunk-6R2WFQ7U.mjs";import{a as o}from"./chunk-LJX4MW7B.mjs";var w=class extends p{constructor({address:e,anchor:r,shouldInitProvider:t}){super(e);this.provider=null;this.config=null;this.ledgerLogin=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");if(!e||typeof e.addressIndex!="number")throw new Error("Missing addressIndex for Ledger login");let{address:r,signature:t}=await this.provider.login({addressIndex:e.addressIndex});return{address:r,signature:t??""}};this.loginOperation=async e=>{if(!this.provider||!this.config)throw new Error("Provider is not initialized.");return await oe({options:e,config:this.config,provider:this.provider,login:this.ledgerLogin.bind(this)})};this.initLegderConnectManager=async e=>{if(!!y())return;await R.getInstance().init(e)};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await S({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await this.rebuildProvider(),await le({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider)})};this.rebuildProvider=async()=>{try{await this.provider?.getAddress()}catch{try{let{ledgerProvider:r}=await ie({shouldInitProvider:!0});this.provider=r}catch(r){throw J({toastId:"ledger-provider-rebuild-error",duration:1e4,icon:"times",iconClassName:"warning",message:"Unlock your device & open the MultiversX App",title:"Ledger unavailable"}),r}}};this.options={anchor:r,shouldInitProvider:t},this._login=this.ledgerLogin.bind(this)}async init(){try{this.initializeAddress(),await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.ledger}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){await this.initLegderConnectManager(this.options?.anchor);let e=R.getInstance(),{ledgerProvider:r,ledgerConfig:t}=await new Promise((i,s)=>ne({manager:e,resolve:i,reject:s,shouldInitProvider:this.options?.shouldInitProvider}));this.config=t,this.provider=r}};var ve=3e4,me=5e3,he=3e3,k=class a{constructor(){this.store=F();this.connectionCheckInterval=null;this.recreateProviderInterval=null;this.init=async()=>{this.startCheckConnectionLoop()};this.shouldCheckConnection=()=>{let n=this.store.getState(),{providerType:e}=G(n),r=H(n);return!!(e===o.ledger&&r)};this.startCheckConnectionLoop=()=>{this.connectionCheckInterval||(this.connectionCheckInterval=setInterval(async()=>{let n=ee(c());if(!(!this.shouldCheckConnection()||n))try{await L().getProvider().getAddress()}catch{if(U.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"times",iconClassName:"warning",message:"Unlock your device to continue signing transactions",title:"Ledger disconnected"}),this.reset(),this.recreateProviderInterval)return;this.recreateProviderInterval=setInterval(this.reconnectProvider,me)}},ve))};this.reconnectProvider=async()=>{if(this.shouldCheckConnection())try{let n=new w({shouldInitProvider:!0});await n.init();let e=new M(n);n.getType=()=>o.ledger,C(e),this.reset(),clearInterval(this.recreateProviderInterval??0),this.recreateProviderInterval=null,U.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",duration:he,icon:"check",iconClassName:"success",message:"Your device is ready to sign transactions",title:"Ledger reconnected"}),this.startCheckConnectionLoop()}catch{console.log("Unable to reconnect to Ledger")}};this.reset=()=>{clearInterval(this.connectionCheckInterval??0),this.connectionCheckInterval=null}}static getInstance(){return a.instance||(a.instance=new a),a.instance}};var T=class extends p{constructor(e){super(e?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{onClose:r,manager:t}=await this.initSignState();try{let i=await this.provider.signTransactions(e)??[];return await se(i)}catch(i){throw await r({shouldCancelAction:!0}),i}finally{t.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:l.crossWindow})};this.walletAddress=e?.walletAddress,this.provider=b.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=f(c()),r=await this.provider.init();return this.provider.setWalletUrl(this.walletAddress??e.walletAddress),this.address&&this.provider.setAddress(this.address),r}logout(){return this.provider.logout()}getType(){return o.crossWindow}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{ExtensionProvider as ue}from"@multiversx/sdk-extension-provider/out/extensionProvider";var _=class extends p{constructor(e){super(e);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await this.provider.signTransactions(e)??[]}catch(i){throw await t({shouldCancelAction:!1}),i}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:l.extension})};this.provider=ue.getInstance(),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}async initializeProvider(){let e=await this.provider.init();return this.address&&this.setAccount({address:this.address}),e}getAddress(){return this.provider.getAddress()}setAccount(e){return this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}logout(){return this.provider.logout()}getType(){return o.extension}};var W=class extends p{constructor({address:e,walletUrl:r}={}){super(e);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();try{return await S({transactions:e,handleSign:this.provider.signTransactions.bind(this.provider)})}catch(i){throw await t({shouldCancelAction:!0}),i}finally{r.closeUI()}};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");return await g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:l[o.metamask]})};this.walletUrl=r??"",this.provider=ce.getInstance(),this._login=this.provider.login.bind(this.provider)}init(){return this.initializeAddress(),this.initializeWalletUrl(),this.initializeProvider()}initializeWalletUrl(){if(this.walletUrl)return;let e=f(c());if(!e.iframeWalletAddress)throw new Error("Invalid walletUrl");this.walletUrl=e.iframeWalletAddress}async initializeProvider(){return await this.provider.init(),this.address&&this.setAccount({address:this.address}),this.provider.setWalletUrl(this.walletUrl),!0}logout(){return this.provider.logout()}getType(){return o.metamask}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.getAddress()}setAccount(e){this.provider.setAccount(e)}isInitialized(){return this.provider.isInitialized()}};import{OptionalOperation as we}from"@multiversx/sdk-wallet-connect-provider/out";var pe=[I.CANCEL_ACTION,I.SIGN_LOGIN_TOKEN],x=class extends p{constructor(e){super();this.provider=null;this.methods=[];this._approval=null;this.cancelActionAbortController=null;this.signTransactions=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");let{manager:r,onClose:t}=await this.initSignState();this.cancelActionAbortController=new AbortController;let i=this.cancelActionAbortController.signal;try{let s=new Promise((h,v)=>{i.addEventListener("abort",()=>{v(new Error("cancelled by user"))})});return await Promise.race([this.provider.signTransactions(e),s])}catch(s){throw await t({shouldCancelAction:!0}),s}finally{r.closeUI()}};this.cancelAction=async()=>{this.sendCustomRequest({method:I.CANCEL_ACTION,action:we.CANCEL_ACTION}),this.cancelActionAbortController?.abort()};this.signMessage=async e=>{if(!this.provider)throw new Error("Provider is not initialized.");this.cancelActionAbortController=new AbortController;let r=this.cancelActionAbortController.signal,t=new Promise((s,d)=>{r.addEventListener("abort",()=>{d(new Error("cancelled by user"))})});return await Promise.race([g({message:e,handleSignMessage:this.provider.signMessage.bind(this.provider),cancelAction:this.cancelAction,providerType:l.extension}),t])};this.config=e}async init(){try{await this.initializeProvider()}catch{return!1}return!0}logout(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.logout()}getType(){return o.walletConnect}getAddress(){if(!this.provider)throw new Error("Provider is not initialized.");return Promise.resolve(this.provider.getAddress())}setAccount(e){return this.provider?.setAccount(e)}isInitialized(){if(!this.provider)throw new Error("Provider is not initialized.");return this.provider.isInitialized()}async initializeProvider(){if(await this.initWalletConnectManager(),!this.config)throw new Error("Invalid WalletConnect setup");let{walletConnectProvider:e,dappMethods:r}=await this.createWalletConnectProvider(this.config);this.provider=e,this.methods=r;let{uri:t="",approval:i}=await this.provider.connect({methods:this.methods}),s=this.config.walletConnectDeepLink??N.walletConnectDeepLink;this._approval=i,A.getInstance().updateData({wcURI:t,walletConnectDeepLink:`${s}?wallet-connect=${encodeURIComponent(t)}`})}async initWalletConnectManager(){if(!!y())return;await A.getInstance().init(this.config?.anchor)}async createWalletConnectProvider(e){let r=y(),t=B(c());if($(c())&&pe.push(I.SIGN_NATIVE_AUTH_TOKEN),!e?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");let v={onClientLogin:()=>{},onClientLogout:()=>{Q()},onClientEvent:m=>{}};try{let{walletConnectV2ProjectId:m,walletConnectV2Options:O={},walletConnectV2RelayAddress:D=""}=e,P=new Z(v,t,D,m,O);return await P.init(),{walletConnectProvider:P,dappMethods:pe}}catch(m){throw console.error("Unable to connect",m),r&&await this.logout(),m}}async login(e){if(!this.provider)throw new Error("Provider is not initialized. Call createProvider first.");let r=async()=>{if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.init();let t=A.getInstance(),{uri:i="",approval:s}=await this.provider.connect({methods:this.methods}),d=this.config.walletConnectDeepLink??N.walletConnectDeepLink;t.updateData({wcURI:i,walletConnectDeepLink:`${d}?wallet-connect=${encodeURIComponent(i)}`});let h=await this.provider.login({approval:s,token:e?.token}),{address:v="",signature:m=""}=h??{};return t.handleClose({isLoginFinished:!!v}),{address:v,signature:m}}catch{return await r()}};if(!this._approval)throw new Error("Approval or login is not initialized");try{let t=await this.provider.login({approval:this._approval.bind(this),token:e?.token}),{address:i="",signature:s=""}=t??{};return A.getInstance().handleClose({isLoginFinished:!!i}),{address:i,signature:s}}catch(t){return console.error("User rejected connection proposal",t),await r()}}async sendCustomRequest({action:e,method:r}){if(!this.provider)throw new Error("Provider is not initialized.");try{await this.provider.sendCustomRequest?.({request:{method:r,params:{action:e}}})}catch(t){console.error("Unable to send event",t)}}};var E=class{static set customProviders(n){this._customProviders=n}static get customProviders(){return this._customProviders}static async create({type:n,anchor:e}){let r=null;switch(n){case o.extension:{r=new _;break}case o.crossWindow:{r=new T;break}case o.ledger:{r=new w({anchor:e}),await k.getInstance().init();break}case o.metamask:{r=new W;break}case o.passkey:{let s=f(c());r=new T({walletAddress:`${s.walletAddress}?${K}=${o.passkey}`});break}case o.walletConnect:{let s=j(c());if(!s?.walletConnectV2ProjectId)throw new Error("Invalid WalletConnect setup");r=new x({anchor:e,...s});break}case o.webview:{r=new de;break}default:{let s=X();for(let d of this._customProviders)d.type===n&&(r=await d.constructor({address:s,anchor:e}));break}}if(!r)throw new Error("Unable to create provider");await r.init();let t=new M(r);C(t);let i="provider"in r&&r.provider instanceof b;return ae(i?{skipLoginMethod:o.crossWindow}:null),t}static async destroy(){L().cancelLogin(),C(null),q(o.none)}};E._customProviders=[];var Pe=(a,n)=>a.some(e=>e.type===n);async function g({message:a,handleSignMessage:n,cancelAction:e,providerType:r}){return await new Promise(async(i,s)=>{let{manager:d,onClose:h}=await re({cancelAction:e}),v=Object.values(E.customProviders),m=v.reduce((u,V)=>(u[V.type]=V.name,u),{}),O={...l,...m},D=async()=>{await h({shouldCancelAction:!0}),s({message:"Signing canceled"})};d.subscribeToEventBus("CLOSE_PENDING_TRANSACTIONS",D);let P=Pe(v,r)?r:o.none;d.updateData({name:O[P],type:P});try{let u=await n(a);i(u)}catch(u){await h({shouldCancelAction:!0}),s(u)}finally{d.closeUI()}})}async function le({message:a,handleSignMessage:n}){try{return await g({message:a,handleSignMessage:n,providerType:l.ledger})}catch(e){let{errorMessage:r}=te(e);throw r?{message:r}:e}}export{le as a,w as b,k as c,E as d,g as e,T as f,_ as g,W as h,x as i};
2
+ //# sourceMappingURL=chunk-DRCMZIYT.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-G43Z243B.mjs";var n=class{static get create(){return this.createComponent}static set create(e){this.createComponent=e}};n.createComponent=async({name:e,anchor:m})=>{if(!t?.customElements?.get(e))return null;let o=t.document.createElement(e);return(m||t.document.body).appendChild(o),await customElements.whenDefined(e),o};export{n as a};
2
- //# sourceMappingURL=chunk-7UUDW64Y.mjs.map
1
+ import{a as t}from"./chunk-UDD74TMO.mjs";var n=class{static get create(){return this.createComponent}static set create(e){this.createComponent=e}};n.createComponent=async({name:e,anchor:m})=>{if(!t?.customElements?.get(e))return null;let o=t.document.createElement(e);return(m||t.document.body).appendChild(o),await customElements.whenDefined(e),o};export{n as a};
2
+ //# sourceMappingURL=chunk-EIQQDFQS.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-VY62CH5W.mjs";import{a as e}from"./chunk-JFIQXGJ5.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-ELCWJYQ7.mjs.map
1
+ import{a as s}from"./chunk-OY6YT36R.mjs";import{a as e}from"./chunk-APIYOYTG.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-ERQPDDHO.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as wt}from"./chunk-FFGJMR4Q.mjs";import{a as vt}from"./chunk-HKVAAOC4.mjs";import{a as O}from"./chunk-2UPWFRCA.mjs";import{a as Ct}from"./chunk-6UZHM5LW.mjs";import{a as xt}from"./chunk-NO4FZ4M3.mjs";import{a as Et}from"./chunk-E5OMXZT7.mjs";import{a as Nt}from"./chunk-WJJTA23D.mjs";import{a as At}from"./chunk-JM3JEGRV.mjs";import{a as q}from"./chunk-X3AX4PFE.mjs";import{a as S}from"./chunk-KDWLSBQB.mjs";import{a as Lt}from"./chunk-VRLS225Q.mjs";import{a as Bt}from"./chunk-4ODPAHHA.mjs";import{a as kt}from"./chunk-2ZW4LVVR.mjs";import{b as k}from"./chunk-PCGP4VVW.mjs";import{a as Ft}from"./chunk-7BZQYV6D.mjs";import{a as Pt}from"./chunk-MDVI45IV.mjs";import{a as Mt}from"./chunk-2WAT3RZ3.mjs";import{a as b}from"./chunk-6FRXGPOE.mjs";import{a as mt}from"./chunk-JFIQXGJ5.mjs";import{a as St}from"./chunk-IXO75QXR.mjs";import{a as N}from"./chunk-GDMANS7S.mjs";import{a as F,f as It}from"./chunk-O462QL7Q.mjs";import{b as h,d as yt}from"./chunk-B5YOJH7H.mjs";import{k as ft,l as x,n as ht}from"./chunk-E2GGD7D4.mjs";import{b as Ot}from"./chunk-MNIS55JL.mjs";import{a as M}from"./chunk-HORSXVIV.mjs";import{a as Rt}from"./chunk-SJLTVGKD.mjs";import{a as ut}from"./chunk-643FDBLR.mjs";import{a as L}from"./chunk-QTKK6OSJ.mjs";import{a as ct}from"./chunk-6ACLOUQ3.mjs";import{a as A}from"./chunk-G7GU37XI.mjs";import{a as rt}from"./chunk-YSCND2MX.mjs";import{a as Ut}from"./chunk-NJN53MJV.mjs";import{a as pt,b as Tt,g as dt,l as gt}from"./chunk-M6MN4RXG.mjs";import{b as lt}from"./chunk-NGM3AVCY.mjs";import{a as it,b as at,q as u,s as f}from"./chunk-GWXW3E7L.mjs";import{c as X,d as tt,f as et}from"./chunk-UERJ6AKK.mjs";import{b as y}from"./chunk-VNLGNNIL.mjs";import{b as I}from"./chunk-6JM4DPOH.mjs";import{b as ot,c as st,f as nt}from"./chunk-NTEMINYA.mjs";import{b as Dt}from"./chunk-UCRVRBTA.mjs";import{a as bt}from"./chunk-7UUDW64Y.mjs";import{c as w}from"./chunk-4ZAZCOJD.mjs";import{b as z}from"./chunk-GGBMHKR4.mjs";import{a as E}from"./chunk-LJX4MW7B.mjs";import Y from"bignumber.js";import V from"lodash.isequal";var _t=1e4,P=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=_t;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let e=setTimeout(()=>{B(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,e)};this.startWithCustomDuration=(t,e)=>{if(this.stop(t),e<=0)return;let s=setTimeout(()=>{R(t);let n=v[t];n?.()},e);this.timeoutIntervals.set(t,s)};this.stop=t=>{let e=this.timeoutIntervals.get(t);e&&(clearTimeout(e),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t??_t}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};import Wt from"lodash.isequal";var Jt="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",D=class o extends St{constructor(e){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.initialData={pendingTransactions:[],historicTransactions:[]};this.store=e||u(),this.data={...this.initialData}}static getInstance(){return o.instance||(o.instance=new o),o.instance}isNotificationsFeedOpen(){return this.isOpen}async openNotificationsFeed(){d.getInstance().hideToasts(),await this.openUI(),await this.updateDataAndNotifications();let s=this.store.subscribe(async({toasts:n,transactions:i},{toasts:r,transactions:c})=>{(!Wt(r.transactionToasts,n.transactionToasts)||!Wt(c,i))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Jt,[s]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}async handleCloseUI(){let e=d.getInstance();this.closeUI(),await e.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:e}=this.store.getState(),{pendingTransactionToasts:s}=await O({});this.data.pendingTransactions=s,this.data.historicTransactions=await vt.getTransactionsHistory({transactionsSessions:e}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){yt(),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 U=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||D.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 e=await this.createToastListElement();if(!e)return;this.eventBus=await e.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 bt.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 o{constructor(t){this.transactionToasts=[];this.customToasts=[];this.unsubscribeFromStore=()=>null;this.uiCoordinator=null;this.destroy(),this.store=t?.store||u(),this.lifetimeManager=t?.lifetimeManager??new P,this.uiCoordinator=t?.uiCoordinator??new U({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:e,transactions:s},{toasts:n,transactions:i})=>{let r=!V(n.transactionToasts,e.transactionToasts),c=!V(i,s);(r||c)&&await this.updateTransactionToastsList({skipFetchingTransactions:c}),!V(n.customToasts,e.customToasts)&&await this.updateCustomToastList()})}static getInstance(){return o.instance||(o.instance=new o),o.instance}handleCompletedTransaction(t){let{transactions:e}=this.store.getState(),s=e[t];if(!s)return!1;let{status:n}=s,i=ht(n),r=x(n),c=ft(n),a=r||c||i;return a?(this.successfulToastLifetime&&this.lifetimeManager.start(t),a):(this.lifetimeManager.stop(t),a)}async createTransactionToast(t,e){let s=Gt({toastId:t,totalDuration:e});return this.handleCompletedTransaction(t),await this.updateTransactionToastsList(),s}async createCustomToast(t){let e=W(t);return await this.updateCustomToastList(),e}async updateTransactionToastsList(t){let e=this.store.getState(),{toasts:s}=e,{pendingTransactionToasts:n,completedTransactionToasts:i}=await O({skipFetchingTransactions:t?.skipFetchingTransactions,store:e});this.transactionToasts=[...n,...i];for(let r of s.transactionToasts)this.handleCompletedTransaction(r.toastId);await this.publishTransactionToasts()}async updateCustomToastList(){let{toasts:t}=this.store.getState();this.customToasts=[];for(let e of t.customToasts){let n="message"in e?{...e}:{...e,instantiateToastElement:_[e.toastId]};this.customToasts.push(n),e.duration&&this.lifetimeManager.startWithCustomDuration(e.toastId,e.duration)}await this.uiCoordinator?.publishCustomToasts(this.customToasts)}handleTransactionToastClose(t){return this.handleCompletedTransaction(t)?(B(t),!0):!1}async showToasts(){this.uiCoordinator?.showToasts(),await this.updateCustomToastList(),await this.updateTransactionToastsList()}hideToasts(){this.uiCoordinator?.hideToasts()}closeToast(t){if(this.customToasts.find(s=>s.toastId===t)){this.lifetimeManager.stop(t);let s=v[t];return s?.(),R(t),!0}return this.handleTransactionToastClose(t)}async publishTransactionToasts(){await this.uiCoordinator?.publishTransactionToasts(this.transactionToasts)}destroy(){this.unsubscribeFromStore(),this.lifetimeManager?.destroy(),this.uiCoordinator?.destroy(),Ht()}};var H=class o{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(),e=y(t),{isExpired:s}=L(e?.nativeAuthToken);s?C().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(),e=y(t),s=et(t);return!!(e?.nativeAuthToken&&s)};this.addPlannedLogout=()=>{let t=C(),e=X(this.store.getState()),s=t.getType()===E.webview;if(!e||s)return;this.addLogoutWarning();let n=y(this.store.getState()),{secondsUntilExpires:i,expiresAt:r}=L(n?.nativeAuthToken),c=new Y(String(i)),a=`${e}_${r}`,m=this.plannedLogoutKey===a;if(!(i&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=a,clearTimeout(this.plannedLogoutTimeoutRef??0);let T=c.times(1e3);this.actualLogoutTimeoutRef=setTimeout(()=>{d.getInstance().createCustomToast({toastId:"native-auth-logout",iconClassName:"warning",title:"Logging out",icon:"times",message:"Your session has expired!"}),this.actualLogoutTimeoutRef=null},T.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},T.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=I(this.store.getState()),e=y(this.store.getState()),{secondsUntilExpires:s}=L(e?.nativeAuthToken),n=new Y(String(s)),i=n.times(1e3);if(!s||n.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new Y(t?.tokenExpirationToastWarningSeconds??0).times(1e3),a=n.times(1e3).minus(c),m=Ct(i.toNumber()),l=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},l)}}static getInstance(){return o.instance||(o.instance=new o),o.instance}};var G={};async function Xt({serverTransaction:o,sessionId:t,isSequential:e}){let{hash:s,status:n,results:i,invalidTransaction:r,hasStatusChanged:c}=o;try{if(G[s]>30){h({sessionId:t,status:"timedOut"}),await S({sessionId:t,status:"timedOut"});return}if(r&&!e||n==="sent"){G[s]=G[s]?G[s]+1:1;return}if(e&&!n){let m=q({sessionId:t,transaction:o});await S({sessionId:t,status:m});return}if(c){let m=q({sessionId:t,transaction:o});await S({sessionId:t,status:m})}x(n)&&await At({sessionId:t,hash:s,results:i})}catch(a){console.error(a),h({sessionId:t,status:"timedOut"}),await S({sessionId:t,status:"timedOut"})}}async function $t({sessionId:o,transactionBatch:t,isSequential:e}){try{if(t==null)return;let s=Et(),n=Lt(t),i=await wt(n);for(let p of i)await Xt({serverTransaction:p,sessionId:o,isSequential:e});if(!i.every(p=>p.status!=="pending"))return;s&&await $();let{transactions:c}=f(),a=c[o];if(a.transactions.every(p=>p.status==="success"))return h({sessionId:o,status:"success"});if(a.transactions.some(p=>p.status==="fail"))return h({sessionId:o,status:"fail"});if(a.transactions.every(p=>p.status==="not executed"))return h({sessionId:o,status:"invalid"})}catch(s){console.error(s)}}async function Kt(){let o=lt(f());if(Object.keys(o).length>0)for(let[t,{transactions:e}]of Object.entries(o))await $t({sessionId:t,transactionBatch:e})}async function K(){let o=u(),t=Nt(),e=null,s=null,n=tt(o.getState())?.timestamp,i=()=>{Kt()},r=()=>{e??=setInterval(i,t)},c=()=>{e&&(clearInterval(e),e=null)},a=()=>{c();let p=o.subscribe(({account:{websocketEvent:g}})=>{g?.message&&n!==g.timestamp&&(n=g.timestamp,i())});w.set("websocketEventReceived",p)},m=()=>{z.status!=="not_initialized"||s||(s=setInterval(()=>{z.status==="completed"&&(clearInterval(s),s=null,a())},1e3))};i();let l=()=>{c(),s&&(clearInterval(s),s=null)},T=o.subscribe(({account:{address:p},config:{websocketStatus:g}},Yt)=>{if(Yt.config.websocketStatus!==g)switch(g){case"completed":a();break;case"pending":r(),m();break;default:p?r():l();break}});return w.set("websocketStatusChanged",T),w.set("websocketEventReceived",l),{stopTransactionsTracking:l}}async function Z({address:o,provider:t,apiAddress:e}){let s=await A({address:o,baseURL:e});if(!s)throw new Error("Account not found");Ot({address:o,providerType:t.getType()});let n={...s,username:M(s.username),nonce:N(s)};F(n),await k(o),K(),s.shard!=null&&await xt({shard:Number(s.shard),apiAddress:e})}async function te(o){let{network:{apiAddress:t}}=b();await o.login();let e=await o.getAddress();if(!e)throw new Error("Address not found");return await Z({address:e,provider:o,apiAddress:t}),{address:e}}async function ee({provider:o,nativeAuthConfig:t,token:e}){let{network:{apiAddress:s}}=b(),n=ut(t),i=e;i||(i=await n.initialize({noCache:!0}));let{address:r,signature:c,...a}=await o.login({token:i});if(!r)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let l=ct(a?.accessToken)?a.accessToken:n.getToken({address:r,token:i,signature:c});at({loginToken:i,signature:c,nativeAuthToken:l});let T=await Ft({loginToken:i,extraInfoData:{multisig:a?.multisig,impersonate:a?.impersonate},address:r});return await Z({address:T,provider:o,apiAddress:s}),{address:T,signature:c}}async function jt(o,t){let e=I(f());if(e)return await ee({provider:o,nativeAuthConfig:e,token:t?.token});let{address:s}=await te(o);return await k(s),K(),{address:s,signature:""}}var J={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${Tt}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${pt}-${Date.now()}`}},oe={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"},se=o=>{for(let[t,e]of Object.entries(oe))if(o.includes(t))return e;return"Error when signing"};function Q(o,t="error"){let e=o?.message,s=se(e),i=s!=="Error when signing"?"warning":t,r=Object.keys(J).includes(i)?J[i]:J.error,{toastId:c,iconClassName:a,title:m}=r;return W({toastId:c,duration:1e4,icon:"times",iconClassName:a,message:s,title:m}),s}async function zt({provider:o,transactions:t,options:e={}}){await $();let{isGuarded:s,activeGuardianAddress:n,nonce:i}=Rt(),r=o.getType()===E.ledger,c=Bt({latestNonce:i,transactions:t}),a=n&&s&&!e.skipGuardian?c?.map(l=>(l.version=ot.withTxOptions().valueOf(),l.options=nt.withOptions({guarded:!0,...r?{hashSign:!0}:{}}).valueOf(),l.guardian=st.newFromBech32(n),l)):c,m=await o.signTransactions(a)??[];return It(i+m.length),m}var j=class{constructor(t){this._isLoggingOut=!1;this.provider=t}init(){return this.provider.init()}async login(t){let e=await jt(this.provider,t);return it(this.provider.getType()),qt(this),H.getInstance().init(),e}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 e=await kt({provider:this.provider,options:t});return this._isLoggingOut=!1,e}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,e){try{return await zt({provider:this.provider,transactions:t,options:e})}catch(s){let n=Q(s);throw new Error(n)}}async signMessage(t,e){try{return await Mt({provider:this.provider,message:t,options:e})}catch(s){let n=Q(s,"warning");throw new Error(n)}}async verifyMessage(t){return await Pt(t)}cancelLogin(){this.provider.cancelLogin?.()}};var Vt=null;function qt(o){Vt=o}function C(){return Vt||new j(Dt)}var ne=async()=>{try{let o=mt(),{network:t}=b();try{let e=await A({address:o,baseURL:t.apiAddress});if(e!=null){let s={...e,username:M(e.username),nonce:N(e)};return F(s),s}}catch(e){console.error("Failed getting account ",e)}}catch(o){console.error("Failed getting address ",o)}return null};async function $(){let o=C();if(o==null)throw"Provider not initialized";try{if(!o.init)throw"Current provider does not have init() function";return await o.init()?await ne():void 0}catch(t){console.error("Failed initializing provider ",t)}}var _={},v={},ie=(o,t)=>{u().setState(({toasts:e})=>{let s=e.customToasts.length>0?Math.max(...e.customToasts.map(a=>parseInt(a.toastId.split("-").pop()??"0"))):0,n=t??`custom-toast-${s+1}`,i=e.customToasts.findIndex(a=>a.toastId===n),r={...o,toastId:n};if(i!==-1){e.customToasts[i]=r;return}e.customToasts.push({...r,toastId:n})},!1,{type:"addCustomToast",payload:{value:{customToast:o,currentToastId:t}}})},R=o=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(e=>e.toastId!==o)},!1,{type:"removeCustomToast",payload:{value:o}})},Ht=()=>{u().setState(({toasts:o})=>{o.customToasts=[]},!1,{type:"removeAllCustomToasts",payload:{value:null}})},ln=()=>{u().setState(({toasts:o})=>{o.transactionToasts=[]})},Gt=({toastId:o,totalDuration:t})=>{let e="";return u().setState(({toasts:s})=>{let n=s.transactionToasts.length>0?Math.max(...s.transactionToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0;e=o??`transaction-toast-${n+1}`,s.transactionToasts.push({startTime:rt(),endTime:Ut(t),toastId:e})},!1,"addTransactionToast"),e},B=o=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(e=>e.toastId!==o)},!1,"removeTransactionToast"),delete v[o],delete _[o]},W=o=>{let{toasts:t}=u().getState(),e=t.customToasts.length>0?Math.max(...t.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,s=o.toastId||`custom-toast-${e+1}`;return o.onClose&&(v[s]=o.onClose),o.instantiateToastElement?(_[s]=o.instantiateToastElement,u().setState(({toasts:n})=>{let i=n.customToasts.findIndex(a=>a.toastId===s),r={...o,instantiateToastElement:null,toastId:s};i!==-1?n.customToasts[i]=r:n.customToasts.push(r)},!1,"createCustomToast"),s):(ie(o,s),s)};export{_ as a,v as b,ie as c,R as d,Ht as e,ln as f,Gt as g,B as h,W as i,P as j,D as k,U as l,d as m,H as n,$t as o,Kt as p,K as q,Z as r,jt as s,Q as t,zt as u,j as v,qt as w,C as x,$ as y};
2
- //# sourceMappingURL=chunk-ZM77AGP5.mjs.map
1
+ import{a as wt}from"./chunk-HU5DHLOV.mjs";import{a as vt}from"./chunk-FZ6B646C.mjs";import{a as O}from"./chunk-VPTU4FYE.mjs";import{a as Ct}from"./chunk-6UZHM5LW.mjs";import{a as xt}from"./chunk-DJAONPNL.mjs";import{a as Et}from"./chunk-HR2SURU6.mjs";import{a as Nt}from"./chunk-J27BRSLL.mjs";import{a as At}from"./chunk-IUQSTHCF.mjs";import{a as q}from"./chunk-FT7PQFYY.mjs";import{a as S}from"./chunk-KDWLSBQB.mjs";import{a as Lt}from"./chunk-VRLS225Q.mjs";import{a as Bt}from"./chunk-4ODPAHHA.mjs";import{a as kt}from"./chunk-2EGSAA3Z.mjs";import{b as k}from"./chunk-MTELOBHN.mjs";import{a as Ft}from"./chunk-26N65762.mjs";import{a as Pt}from"./chunk-MDVI45IV.mjs";import{a as Mt}from"./chunk-HJAGGOLY.mjs";import{a as b}from"./chunk-QMGMGA2Q.mjs";import{a as mt}from"./chunk-APIYOYTG.mjs";import{a as St}from"./chunk-MB44B2VD.mjs";import{a as N}from"./chunk-FMEC7LEU.mjs";import{a as F,f as It}from"./chunk-G6AICUIC.mjs";import{b as h,d as yt}from"./chunk-UXLYMCYP.mjs";import{k as ft,l as x,n as ht}from"./chunk-E2GGD7D4.mjs";import{b as Ot}from"./chunk-QRJ7LCAP.mjs";import{a as M}from"./chunk-HORSXVIV.mjs";import{a as Rt}from"./chunk-QNONSTFE.mjs";import{a as ut}from"./chunk-OE6BHO2G.mjs";import{a as L}from"./chunk-QTKK6OSJ.mjs";import{a as ct}from"./chunk-6ACLOUQ3.mjs";import{a as A}from"./chunk-G7GU37XI.mjs";import{a as rt}from"./chunk-YSCND2MX.mjs";import{a as Ut}from"./chunk-NJN53MJV.mjs";import{a as pt,b as Tt,g as dt,l as gt}from"./chunk-M6MN4RXG.mjs";import{b as lt}from"./chunk-NGM3AVCY.mjs";import{a as it,b as at,q as u,s as f}from"./chunk-RMJFY5IQ.mjs";import{c as X,d as tt,f as et}from"./chunk-UERJ6AKK.mjs";import{b as y}from"./chunk-VNLGNNIL.mjs";import{b as I}from"./chunk-6JM4DPOH.mjs";import{b as ot,c as st,f as nt}from"./chunk-NTEMINYA.mjs";import{b as Dt}from"./chunk-UCRVRBTA.mjs";import{a as bt}from"./chunk-EIQQDFQS.mjs";import{c as w}from"./chunk-NMNZYGK7.mjs";import{b as z}from"./chunk-GGBMHKR4.mjs";import{a as E}from"./chunk-LJX4MW7B.mjs";import Y from"bignumber.js";import V from"lodash.isequal";var _t=1e4,P=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=_t;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let e=setTimeout(()=>{B(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,e)};this.startWithCustomDuration=(t,e)=>{if(this.stop(t),e<=0)return;let s=setTimeout(()=>{R(t);let n=v[t];n?.()},e);this.timeoutIntervals.set(t,s)};this.stop=t=>{let e=this.timeoutIntervals.get(t);e&&(clearTimeout(e),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t??_t}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};import Wt from"lodash.isequal";var Jt="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",D=class o extends St{constructor(e){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.initialData={pendingTransactions:[],historicTransactions:[]};this.store=e||u(),this.data={...this.initialData}}static getInstance(){return o.instance||(o.instance=new o),o.instance}isNotificationsFeedOpen(){return this.isOpen}async openNotificationsFeed(){d.getInstance().hideToasts(),await this.openUI(),await this.updateDataAndNotifications();let s=this.store.subscribe(async({toasts:n,transactions:i},{toasts:r,transactions:c})=>{(!Wt(r.transactionToasts,n.transactionToasts)||!Wt(c,i))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Jt,[s]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}async handleCloseUI(){let e=d.getInstance();this.closeUI(),await e.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:e}=this.store.getState(),{pendingTransactionToasts:s}=await O({});this.data.pendingTransactions=s,this.data.historicTransactions=await vt.getTransactionsHistory({transactionsSessions:e}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){yt(),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 U=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||D.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 e=await this.createToastListElement();if(!e)return;this.eventBus=await e.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 bt.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 o{constructor(t){this.transactionToasts=[];this.customToasts=[];this.unsubscribeFromStore=()=>null;this.uiCoordinator=null;this.destroy(),this.store=t?.store||u(),this.lifetimeManager=t?.lifetimeManager??new P,this.uiCoordinator=t?.uiCoordinator??new U({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:e,transactions:s},{toasts:n,transactions:i})=>{let r=!V(n.transactionToasts,e.transactionToasts),c=!V(i,s);(r||c)&&await this.updateTransactionToastsList({skipFetchingTransactions:c}),!V(n.customToasts,e.customToasts)&&await this.updateCustomToastList()})}static getInstance(){return o.instance||(o.instance=new o),o.instance}handleCompletedTransaction(t){let{transactions:e}=this.store.getState(),s=e[t];if(!s)return!1;let{status:n}=s,i=ht(n),r=x(n),c=ft(n),a=r||c||i;return a?(this.successfulToastLifetime&&this.lifetimeManager.start(t),a):(this.lifetimeManager.stop(t),a)}async createTransactionToast(t,e){let s=Gt({toastId:t,totalDuration:e});return this.handleCompletedTransaction(t),await this.updateTransactionToastsList(),s}async createCustomToast(t){let e=W(t);return await this.updateCustomToastList(),e}async updateTransactionToastsList(t){let e=this.store.getState(),{toasts:s}=e,{pendingTransactionToasts:n,completedTransactionToasts:i}=await O({skipFetchingTransactions:t?.skipFetchingTransactions,store:e});this.transactionToasts=[...n,...i];for(let r of s.transactionToasts)this.handleCompletedTransaction(r.toastId);await this.publishTransactionToasts()}async updateCustomToastList(){let{toasts:t}=this.store.getState();this.customToasts=[];for(let e of t.customToasts){let n="message"in e?{...e}:{...e,instantiateToastElement:_[e.toastId]};this.customToasts.push(n),e.duration&&this.lifetimeManager.startWithCustomDuration(e.toastId,e.duration)}await this.uiCoordinator?.publishCustomToasts(this.customToasts)}handleTransactionToastClose(t){return this.handleCompletedTransaction(t)?(B(t),!0):!1}async showToasts(){this.uiCoordinator?.showToasts(),await this.updateCustomToastList(),await this.updateTransactionToastsList()}hideToasts(){this.uiCoordinator?.hideToasts()}closeToast(t){if(this.customToasts.find(s=>s.toastId===t)){this.lifetimeManager.stop(t);let s=v[t];return s?.(),R(t),!0}return this.handleTransactionToastClose(t)}async publishTransactionToasts(){await this.uiCoordinator?.publishTransactionToasts(this.transactionToasts)}destroy(){this.unsubscribeFromStore(),this.lifetimeManager?.destroy(),this.uiCoordinator?.destroy(),Ht()}};var H=class o{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(),e=y(t),{isExpired:s}=L(e?.nativeAuthToken);s?C().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(),e=y(t),s=et(t);return!!(e?.nativeAuthToken&&s)};this.addPlannedLogout=()=>{let t=C(),e=X(this.store.getState()),s=t.getType()===E.webview;if(!e||s)return;this.addLogoutWarning();let n=y(this.store.getState()),{secondsUntilExpires:i,expiresAt:r}=L(n?.nativeAuthToken),c=new Y(String(i)),a=`${e}_${r}`,m=this.plannedLogoutKey===a;if(!(i&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=a,clearTimeout(this.plannedLogoutTimeoutRef??0);let T=c.times(1e3);this.actualLogoutTimeoutRef=setTimeout(()=>{d.getInstance().createCustomToast({toastId:"native-auth-logout",iconClassName:"warning",title:"Logging out",icon:"times",message:"Your session has expired!"}),this.actualLogoutTimeoutRef=null},T.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},T.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=I(this.store.getState()),e=y(this.store.getState()),{secondsUntilExpires:s}=L(e?.nativeAuthToken),n=new Y(String(s)),i=n.times(1e3);if(!s||n.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new Y(t?.tokenExpirationToastWarningSeconds??0).times(1e3),a=n.times(1e3).minus(c),m=Ct(i.toNumber()),l=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},l)}}static getInstance(){return o.instance||(o.instance=new o),o.instance}};var G={};async function Xt({serverTransaction:o,sessionId:t,isSequential:e}){let{hash:s,status:n,results:i,invalidTransaction:r,hasStatusChanged:c}=o;try{if(G[s]>30){h({sessionId:t,status:"timedOut"}),await S({sessionId:t,status:"timedOut"});return}if(r&&!e||n==="sent"){G[s]=G[s]?G[s]+1:1;return}if(e&&!n){let m=q({sessionId:t,transaction:o});await S({sessionId:t,status:m});return}if(c){let m=q({sessionId:t,transaction:o});await S({sessionId:t,status:m})}x(n)&&await At({sessionId:t,hash:s,results:i})}catch(a){console.error(a),h({sessionId:t,status:"timedOut"}),await S({sessionId:t,status:"timedOut"})}}async function $t({sessionId:o,transactionBatch:t,isSequential:e}){try{if(t==null)return;let s=Et(),n=Lt(t),i=await wt(n);for(let p of i)await Xt({serverTransaction:p,sessionId:o,isSequential:e});if(!i.every(p=>p.status!=="pending"))return;s&&await $();let{transactions:c}=f(),a=c[o];if(a.transactions.every(p=>p.status==="success"))return h({sessionId:o,status:"success"});if(a.transactions.some(p=>p.status==="fail"))return h({sessionId:o,status:"fail"});if(a.transactions.every(p=>p.status==="not executed"))return h({sessionId:o,status:"invalid"})}catch(s){console.error(s)}}async function Kt(){let o=lt(f());if(Object.keys(o).length>0)for(let[t,{transactions:e}]of Object.entries(o))await $t({sessionId:t,transactionBatch:e})}async function K(){let o=u(),t=Nt(),e=null,s=null,n=tt(o.getState())?.timestamp,i=()=>{Kt()},r=()=>{e??=setInterval(i,t)},c=()=>{e&&(clearInterval(e),e=null)},a=()=>{c();let p=o.subscribe(({account:{websocketEvent:g}})=>{g?.message&&n!==g.timestamp&&(n=g.timestamp,i())});w.set("websocketEventReceived",p)},m=()=>{z.status!=="not_initialized"||s||(s=setInterval(()=>{z.status==="completed"&&(clearInterval(s),s=null,a())},1e3))};i();let l=()=>{c(),s&&(clearInterval(s),s=null)},T=o.subscribe(({account:{address:p},config:{websocketStatus:g}},Yt)=>{if(Yt.config.websocketStatus!==g)switch(g){case"completed":a();break;case"pending":r(),m();break;default:p?r():l();break}});return w.set("websocketStatusChanged",T),w.set("websocketEventReceived",l),{stopTransactionsTracking:l}}async function Z({address:o,provider:t,apiAddress:e}){let s=await A({address:o,baseURL:e});if(!s)throw new Error("Account not found");Ot({address:o,providerType:t.getType()});let n={...s,username:M(s.username),nonce:N(s)};F(n),await k(o),K(),s.shard!=null&&await xt({shard:Number(s.shard),apiAddress:e})}async function te(o){let{network:{apiAddress:t}}=b();await o.login();let e=await o.getAddress();if(!e)throw new Error("Address not found");return await Z({address:e,provider:o,apiAddress:t}),{address:e}}async function ee({provider:o,nativeAuthConfig:t,token:e}){let{network:{apiAddress:s}}=b(),n=ut(t),i=e;i||(i=await n.initialize({noCache:!0}));let{address:r,signature:c,...a}=await o.login({token:i});if(!r)return console.warn("Login cancelled."),null;if(!c)return console.error("Failed to sign login token"),null;let l=ct(a?.accessToken)?a.accessToken:n.getToken({address:r,token:i,signature:c});at({loginToken:i,signature:c,nativeAuthToken:l});let T=await Ft({loginToken:i,extraInfoData:{multisig:a?.multisig,impersonate:a?.impersonate},address:r});return await Z({address:T,provider:o,apiAddress:s}),{address:T,signature:c}}async function jt(o,t){let e=I(f());if(e)return await ee({provider:o,nativeAuthConfig:e,token:t?.token});let{address:s}=await te(o);return await k(s),K(),{address:s,signature:""}}var J={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${Tt}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${pt}-${Date.now()}`}},oe={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"},se=o=>{for(let[t,e]of Object.entries(oe))if(o.includes(t))return e;return"Error when signing"};function Q(o,t="error"){let e=o?.message,s=se(e),i=s!=="Error when signing"?"warning":t,r=Object.keys(J).includes(i)?J[i]:J.error,{toastId:c,iconClassName:a,title:m}=r;return W({toastId:c,duration:1e4,icon:"times",iconClassName:a,message:s,title:m}),s}async function zt({provider:o,transactions:t,options:e={}}){await $();let{isGuarded:s,activeGuardianAddress:n,nonce:i}=Rt(),r=o.getType()===E.ledger,c=Bt({latestNonce:i,transactions:t}),a=n&&s&&!e.skipGuardian?c?.map(l=>(l.version=ot.withTxOptions().valueOf(),l.options=nt.withOptions({guarded:!0,...r?{hashSign:!0}:{}}).valueOf(),l.guardian=st.newFromBech32(n),l)):c,m=await o.signTransactions(a)??[];return It(i+m.length),m}var j=class{constructor(t){this._isLoggingOut=!1;this.provider=t}init(){return this.provider.init()}async login(t){let e=await jt(this.provider,t);return it(this.provider.getType()),qt(this),H.getInstance().init(),e}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 e=await kt({provider:this.provider,options:t});return this._isLoggingOut=!1,e}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,e){try{return await zt({provider:this.provider,transactions:t,options:e})}catch(s){let n=Q(s);throw new Error(n)}}async signMessage(t,e){try{return await Mt({provider:this.provider,message:t,options:e})}catch(s){let n=Q(s,"warning");throw new Error(n)}}async verifyMessage(t){return await Pt(t)}cancelLogin(){this.provider.cancelLogin?.()}};var Vt=null;function qt(o){Vt=o}function C(){return Vt||new j(Dt)}var ne=async()=>{try{let o=mt(),{network:t}=b();try{let e=await A({address:o,baseURL:t.apiAddress});if(e!=null){let s={...e,username:M(e.username),nonce:N(e)};return F(s),s}}catch(e){console.error("Failed getting account ",e)}}catch(o){console.error("Failed getting address ",o)}return null};async function $(){let o=C();if(o==null)throw"Provider not initialized";try{if(!o.init)throw"Current provider does not have init() function";return await o.init()?await ne():void 0}catch(t){console.error("Failed initializing provider ",t)}}var _={},v={},ie=(o,t)=>{u().setState(({toasts:e})=>{let s=e.customToasts.length>0?Math.max(...e.customToasts.map(a=>parseInt(a.toastId.split("-").pop()??"0"))):0,n=t??`custom-toast-${s+1}`,i=e.customToasts.findIndex(a=>a.toastId===n),r={...o,toastId:n};if(i!==-1){e.customToasts[i]=r;return}e.customToasts.push({...r,toastId:n})},!1,{type:"addCustomToast",payload:{value:{customToast:o,currentToastId:t}}})},R=o=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(e=>e.toastId!==o)},!1,{type:"removeCustomToast",payload:{value:o}})},Ht=()=>{u().setState(({toasts:o})=>{o.customToasts=[]},!1,{type:"removeAllCustomToasts",payload:{value:null}})},ln=()=>{u().setState(({toasts:o})=>{o.transactionToasts=[]})},Gt=({toastId:o,totalDuration:t})=>{let e="";return u().setState(({toasts:s})=>{let n=s.transactionToasts.length>0?Math.max(...s.transactionToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0;e=o??`transaction-toast-${n+1}`,s.transactionToasts.push({startTime:rt(),endTime:Ut(t),toastId:e})},!1,"addTransactionToast"),e},B=o=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(e=>e.toastId!==o)},!1,"removeTransactionToast"),delete v[o],delete _[o]},W=o=>{let{toasts:t}=u().getState(),e=t.customToasts.length>0?Math.max(...t.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,s=o.toastId||`custom-toast-${e+1}`;return o.onClose&&(v[s]=o.onClose),o.instantiateToastElement?(_[s]=o.instantiateToastElement,u().setState(({toasts:n})=>{let i=n.customToasts.findIndex(a=>a.toastId===s),r={...o,instantiateToastElement:null,toastId:s};i!==-1?n.customToasts[i]=r:n.customToasts.push(r)},!1,"createCustomToast"),s):(ie(o,s),s)};export{_ as a,v as b,ie as c,R as d,Ht as e,ln as f,Gt as g,B as h,W as i,P as j,D as k,U as l,d as m,H as n,$t as o,Kt as p,K as q,Z as r,jt as s,Q as t,zt as u,j as v,qt as w,C as x,$ as y};
2
+ //# sourceMappingURL=chunk-EYUQXPCB.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-NGM3AVCY.mjs";import{s}from"./chunk-GWXW3E7L.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-GDMANS7S.mjs.map
1
+ import{a as u}from"./chunk-NGM3AVCY.mjs";import{s}from"./chunk-RMJFY5IQ.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-FMEC7LEU.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-N55JEIM6.mjs";import{b as n,c as o}from"./chunk-B5YOJH7H.mjs";import{s}from"./chunk-GWXW3E7L.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-X3AX4PFE.mjs.map
1
+ import{a as r}from"./chunk-N55JEIM6.mjs";import{b as n,c as o}from"./chunk-UXLYMCYP.mjs";import{s}from"./chunk-RMJFY5IQ.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-FT7PQFYY.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-6YF7VKF2.mjs";var o={async getTransactionsHistory(s){return await t(s)}};export{o as a};
2
+ //# sourceMappingURL=chunk-FZ6B646C.mjs.map
@@ -1,2 +1,2 @@
1
- import{q as o}from"./chunk-GWXW3E7L.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-O462QL7Q.mjs.map
1
+ import{q as o}from"./chunk-RMJFY5IQ.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-G6AICUIC.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-UDD74TMO.mjs";var o=()=>a.localStorage;export{o as a};
2
+ //# sourceMappingURL=chunk-GEB4VHTN.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-6VPMVY56.mjs";import o from"axios";var n="transactions/ppu";async function l(a,s){let r=`${e(s)}/${n}/${a}`;try{let{data:t}=await o.get(r);return t?{[a]:{lastBlock:t.lastBlock,fast:t.fast,faster:t.faster}}:null}catch(t){return console.error("Error fetching gas station metadata from:",r,t),null}}export{l as a};
2
- //# sourceMappingURL=chunk-SLG55PDO.mjs.map
1
+ import{a as e}from"./chunk-MLZIGIVD.mjs";import o from"axios";var n="transactions/ppu";async function l(a,s){let r=`${e(s)}/${n}/${a}`;try{let{data:t}=await o.get(r);return t?{[a]:{lastBlock:t.lastBlock,fast:t.fast,faster:t.faster}}:null}catch(t){return console.error("Error fetching gas station metadata from:",r,t),null}}export{l as a};
2
+ //# sourceMappingURL=chunk-GEHX6WX2.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as f}from"./chunk-FRDR4A7Z.mjs";import{x as g}from"./chunk-ZM77AGP5.mjs";import{a as c}from"./chunk-E5OMXZT7.mjs";import{s as n}from"./chunk-GWXW3E7L.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-GPUXJWA3.mjs.map
1
+ import{a as f}from"./chunk-FRDR4A7Z.mjs";import{x as g}from"./chunk-EYUQXPCB.mjs";import{a as c}from"./chunk-HR2SURU6.mjs";import{s as n}from"./chunk-RMJFY5IQ.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-GFJFVWV5.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-EMIDMARK.mjs";import{q as e}from"./chunk-RMJFY5IQ.mjs";var m=()=>t(e());export{m as a};
2
+ //# sourceMappingURL=chunk-H5KMHLWL.mjs.map
@@ -1,2 +1,2 @@
1
- import{d as s}from"./chunk-J6MUGECP.mjs";import{a as u}from"./chunk-IXO75QXR.mjs";import{s as c}from"./chunk-GWXW3E7L.mjs";import{b as d}from"./chunk-7VHTZYM2.mjs";import{a as v}from"./chunk-6R2WFQ7U.mjs";import{a}from"./chunk-LJX4MW7B.mjs";var i=class i extends u{constructor(){super({uiTag:"mvx-unlock-panel",uiDataUpdateEvent:"OPEN"});this.initialData={providers:null,walletAddress:null};this.openUnlockPanel=async()=>{let{walletAddress:e}=d(c());this.data={providers:this.getProvidersList(),walletAddress:e},await this.openUI(),this.notifyDataUpdate()};this.setupEventListeners=async()=>{this.eventBus&&(this.subscribeToEventBus("LOGIN",this.handleLogin),this.subscribeToEventBus("CANCEL_LOGIN",this.handleCancelLogin),this.subscribeToEventBus("CLOSE",this.handleCloseUI))};this.handleCloseUI=async e=>{!e?.isLoginFinished&&i.onClose&&i.onClose(),this.closeUI()};this.handleLogin=async({type:e,anchor:o})=>{if(!i.loginHandler)throw new Error("Login callback not initialized. Please call `init()` first.");try{this.isSimpleLoginCallback(i.loginHandler)?(await(await s.create({type:e,anchor:o})).login(),i.loginHandler()):i.loginHandler({type:e,anchor:o}),await this.handleCloseUI({isLoginFinished:!0})}catch(t){console.error(t),this.eventBus?.publish("CANCEL_IN_PROVIDER",this.data)}};this.handleCancelLogin=async()=>{await s.destroy()};this.isSimpleLoginCallback=e=>e.length===0;this.data=this.initialData}static getInstance(){return i.instance||(i.instance=new i),i.instance}static init(e){return this.loginHandler=e.loginHandler,this.allowedProviders=e.allowedProviders,e.onClose&&(this.onClose=e.onClose),this.getInstance()}getProvidersList(){let e=s.customProviders,t=[...Object.values(a).filter(n=>![a.none,a.webview].includes(n)),...e.map(n=>n.type)],P=e.reduce((n,r)=>(n[r.type]=r.name,n),{}),l={...v,...P};return(i.allowedProviders?i?.allowedProviders.filter(n=>t.includes(n)):t).map(n=>{let r=e.find(g=>g.type===n);return r||{name:n in l?l[n]:n,type:n}})}};i.loginHandler=null,i.onClose=null,i.allowedProviders=null;var p=i;export{p as a};
2
- //# sourceMappingURL=chunk-QJ6YLLBK.mjs.map
1
+ import{d as s}from"./chunk-DRCMZIYT.mjs";import{a as u}from"./chunk-MB44B2VD.mjs";import{s as c}from"./chunk-RMJFY5IQ.mjs";import{b as d}from"./chunk-7VHTZYM2.mjs";import{a as v}from"./chunk-6R2WFQ7U.mjs";import{a}from"./chunk-LJX4MW7B.mjs";var i=class i extends u{constructor(){super({uiTag:"mvx-unlock-panel",uiDataUpdateEvent:"OPEN"});this.initialData={providers:null,walletAddress:null};this.openUnlockPanel=async()=>{let{walletAddress:e}=d(c());this.data={providers:this.getProvidersList(),walletAddress:e},await this.openUI(),this.notifyDataUpdate()};this.setupEventListeners=async()=>{this.eventBus&&(this.subscribeToEventBus("LOGIN",this.handleLogin),this.subscribeToEventBus("CANCEL_LOGIN",this.handleCancelLogin),this.subscribeToEventBus("CLOSE",this.handleCloseUI))};this.handleCloseUI=async e=>{!e?.isLoginFinished&&i.onClose&&i.onClose(),this.closeUI()};this.handleLogin=async({type:e,anchor:o})=>{if(!i.loginHandler)throw new Error("Login callback not initialized. Please call `init()` first.");try{this.isSimpleLoginCallback(i.loginHandler)?(await(await s.create({type:e,anchor:o})).login(),i.loginHandler()):i.loginHandler({type:e,anchor:o}),await this.handleCloseUI({isLoginFinished:!0})}catch(t){console.error(t),this.eventBus?.publish("CANCEL_IN_PROVIDER",this.data)}};this.handleCancelLogin=async()=>{await s.destroy()};this.isSimpleLoginCallback=e=>e.length===0;this.data=this.initialData}static getInstance(){return i.instance||(i.instance=new i),i.instance}static init(e){return this.loginHandler=e.loginHandler,this.allowedProviders=e.allowedProviders,e.onClose&&(this.onClose=e.onClose),this.getInstance()}getProvidersList(){let e=s.customProviders,t=[...Object.values(a).filter(n=>![a.none,a.webview].includes(n)),...e.map(n=>n.type)],P=e.reduce((n,r)=>(n[r.type]=r.name,n),{}),l={...v,...P};return(i.allowedProviders?i?.allowedProviders.filter(n=>t.includes(n)):t).map(n=>{let r=e.find(g=>g.type===n);return r||{name:n in l?l[n]:n,type:n}})}};i.loginHandler=null,i.onClose=null,i.allowedProviders=null;var p=i;export{p as a};
2
+ //# sourceMappingURL=chunk-H7SFJJL6.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-YK7T6MBD.mjs";import{a as u}from"./chunk-KMJMQEXI.mjs";import{q as c}from"./chunk-GWXW3E7L.mjs";import{a as w}from"./chunk-SQVKVA7X.mjs";import{a as i}from"./chunk-PKDR5ERF.mjs";var e=o=>c().setState(({network:t})=>{t.network={...t.network,...o}},!1,{type:"initializeNetworkConfig",payload:{value:o}});var y=async({customNetworkConfig:o={},environment:t})=>{let d=!o?.skipFetchFromServer,g=o?.apiAddress,n=t&&t in i,p=n?i[t]:{},s={...w,...p,...o},r={...s,apiTimeout:String(s.apiTimeout)},N=p?.apiAddress;if(!n&&d){let a=g||N,m=await l(a),f=r.roundDuration?null:await u(a);if(f!=null&&(r.roundDuration=f.erd_round_duration),m!=null){let k={...r,...m,...o};return e(k),k}}return e(r),r};export{y as a,e as b};
2
- //# sourceMappingURL=chunk-AGBY3WIQ.mjs.map
1
+ import{a as l}from"./chunk-YK7T6MBD.mjs";import{a as u}from"./chunk-KMJMQEXI.mjs";import{q as c}from"./chunk-RMJFY5IQ.mjs";import{a as w}from"./chunk-SQVKVA7X.mjs";import{a as i}from"./chunk-PKDR5ERF.mjs";var e=o=>c().setState(({network:t})=>{t.network={...t.network,...o}},!1,{type:"initializeNetworkConfig",payload:{value:o}});var y=async({customNetworkConfig:o={},environment:t})=>{let d=!o?.skipFetchFromServer,g=o?.apiAddress,n=t&&t in i,p=n?i[t]:{},s={...w,...p,...o},r={...s,apiTimeout:String(s.apiTimeout)},N=p?.apiAddress;if(!n&&d){let a=g||N,m=await l(a),f=r.roundDuration?null:await u(a);if(f!=null&&(r.roundDuration=f.erd_round_duration),m!=null){let k={...r,...m,...o};return e(k),k}}return e(r),r};export{y as a,e as b};
2
+ //# sourceMappingURL=chunk-HAD6KD4V.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-JFIQXGJ5.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-2WAT3RZ3.mjs.map
1
+ import{a as o}from"./chunk-APIYOYTG.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-HJAGGOLY.mjs.map
@@ -0,0 +1,2 @@
1
+ import{s as e}from"./chunk-RMJFY5IQ.mjs";import{f as t}from"./chunk-UERJ6AKK.mjs";function n(o=e()){return t(o)}export{n as a};
2
+ //# sourceMappingURL=chunk-HR2SURU6.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-5WR632LR.mjs";var i=async a=>{let r=a.map(s=>s.hash),n=await e(r);return a.map(s=>{let t=n.find(o=>o?.txHash===s.hash);return{...s,status:t?.status,invalidTransaction:t==null,results:t?.results??[],previousStatus:s.status?.toString()||"",hasStatusChanged:!!(t&&t.status!==s.status)}})};export{i as a};
2
- //# sourceMappingURL=chunk-FFGJMR4Q.mjs.map
1
+ import{a as e}from"./chunk-YXOPNTJA.mjs";var i=async a=>{let r=a.map(s=>s.hash),n=await e(r);return a.map(s=>{let t=n.find(o=>o?.txHash===s.hash);return{...s,status:t?.status,invalidTransaction:t==null,results:t?.results??[],previousStatus:s.status?.toString()||"",hasStatusChanged:!!(t&&t.status!==s.status)}})};export{i as a};
2
+ //# sourceMappingURL=chunk-HU5DHLOV.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as i}from"./chunk-FT7PQFYY.mjs";import{a as e}from"./chunk-KDWLSBQB.mjs";import{b as o}from"./chunk-UXLYMCYP.mjs";import{j as r}from"./chunk-E2GGD7D4.mjs";import{q as a}from"./chunk-RMJFY5IQ.mjs";async function M({results:u,hash:c,sessionId:s}){let n=u?.find(t=>t?.returnMessage!=="");i({sessionId:s,transaction:{...n,hash:c,status:"fail",inTransit:!1}});let{transactions:m}=a().getState();m[s].transactions.some(t=>r(t.status))||(o({sessionId:s,status:"fail",errorMessage:n?.returnMessage}),await e({sessionId:s,status:"fail"}))}export{M as a};
2
+ //# sourceMappingURL=chunk-IUQSTHCF.mjs.map
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-M6MN4RXG.mjs";import{s as o}from"./chunk-RMJFY5IQ.mjs";import{h as t}from"./chunk-7VHTZYM2.mjs";function m(){let r=t(o());return r?Math.max(1e3,r/2):9e4}export{m as a};
2
+ //# sourceMappingURL=chunk-J27BRSLL.mjs.map
@@ -0,0 +1,2 @@
1
+ import{q as t}from"./chunk-RMJFY5IQ.mjs";var l=e=>t().setState(({ui:a})=>{a.isSidePanelOpen=e},!1,{type:"setIsSidePanelOpen",payload:{value:e}});export{l as a};
2
+ //# sourceMappingURL=chunk-KDIEM47U.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-H5KMHLWL.mjs";function S(e){return t()(e)}export{S as a};
2
+ //# sourceMappingURL=chunk-LFIWIGR3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-G43Z243B.mjs";var t=()=>{if(!e)return"";try{let r=e.document?.referrer;return r?new URL(r).origin:""}catch(r){return console.error(r),""}};export{t as a};
2
- //# sourceMappingURL=chunk-T3RXRYP5.mjs.map
1
+ import{a as e}from"./chunk-UDD74TMO.mjs";var t=()=>{if(!e)return"";try{let r=e.document?.referrer;return r?new URL(r).origin:""}catch(r){return console.error(r),""}};export{t as a};
2
+ //# sourceMappingURL=chunk-LFZNSKP4.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-ZG6EULI2.mjs";var i=e=>{let t=a();return{origin:e?.origin??t.origin,blockHashShard:e?.blockHashShard,expirySeconds:e?.expirySeconds??t.expirySeconds,apiAddress:e?.apiAddress??t.apiAddress,tokenExpirationToastWarningSeconds:e?.tokenExpirationToastWarningSeconds??t.tokenExpirationToastWarningSeconds,extraInfo:e?.extraInfo??{},gatewayUrl:e?.gatewayUrl,extraRequestHeaders:e?.extraRequestHeaders??{}}};export{i as a};
2
- //# sourceMappingURL=chunk-ZJM5FGLA.mjs.map
1
+ import{a}from"./chunk-67PAALEV.mjs";var i=e=>{let t=a();return{origin:e?.origin??t.origin,blockHashShard:e?.blockHashShard,expirySeconds:e?.expirySeconds??t.expirySeconds,apiAddress:e?.apiAddress??t.apiAddress,tokenExpirationToastWarningSeconds:e?.tokenExpirationToastWarningSeconds??t.tokenExpirationToastWarningSeconds,extraInfo:e?.extraInfo??{},gatewayUrl:e?.gatewayUrl,extraRequestHeaders:e?.extraRequestHeaders??{}}};export{i as a};
2
+ //# sourceMappingURL=chunk-LOQI2FKT.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-SUBC3H4J.mjs";import{a as t}from"./chunk-U64LDJTG.mjs";import{a as n}from"./chunk-SJLTVGKD.mjs";import{s as e}from"./chunk-GWXW3E7L.mjs";import{b as o}from"./chunk-7VHTZYM2.mjs";var w=async r=>{let{isGuarded:i}=n();if(!s({isGuarded:i,transactions:r}))return r;let a=r[0].sender.toBech32(),{walletAddress:d}=o(e());return await(await t({address:a,walletUrl:d}))?.guardTransactions(r)||[]};export{w as a};
2
- //# sourceMappingURL=chunk-32DICVUK.mjs.map
1
+ import{a as s}from"./chunk-SUBC3H4J.mjs";import{a as t}from"./chunk-U64LDJTG.mjs";import{a as n}from"./chunk-QNONSTFE.mjs";import{s as e}from"./chunk-RMJFY5IQ.mjs";import{b as o}from"./chunk-7VHTZYM2.mjs";var w=async r=>{let{isGuarded:i}=n();if(!s({isGuarded:i,transactions:r}))return r;let a=r[0].sender.toBech32(),{walletAddress:d}=o(e());return await(await t({address:a,walletUrl:d}))?.guardTransactions(r)||[]};export{w as a};
2
+ //# sourceMappingURL=chunk-LRN3QFXR.mjs.map