@multiversx/sdk-dapp 5.3.0-alpha.3 → 5.3.0-alpha.5

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 (383) hide show
  1. package/out/__chunks__/chunk-2FA2VSIL.mjs +2 -0
  2. package/out/__chunks__/{chunk-TRIWGK3U.mjs.map → chunk-2FA2VSIL.mjs.map} +1 -1
  3. package/out/__chunks__/{chunk-LV3TNCL7.mjs → chunk-2FJMU6JT.mjs} +2 -2
  4. package/out/__chunks__/{chunk-U3GR2SVT.mjs → chunk-2VMUFNMX.mjs} +2 -2
  5. package/out/__chunks__/{chunk-QJI3WAKY.mjs → chunk-35J6CQWK.mjs} +2 -2
  6. package/out/__chunks__/{chunk-6ZHJDJ2I.mjs → chunk-36H647WW.mjs} +2 -2
  7. package/out/__chunks__/{chunk-VRGBE6S2.mjs → chunk-3AS72TW6.mjs} +2 -2
  8. package/out/__chunks__/{chunk-L7LGSTVP.mjs → chunk-3WPEA75B.mjs} +2 -2
  9. package/out/__chunks__/{chunk-6RJVQ4UE.mjs → chunk-4JQJOGX3.mjs} +2 -2
  10. package/out/__chunks__/{chunk-7WYMH2Y5.mjs → chunk-4NFQOHJB.mjs} +2 -2
  11. package/out/__chunks__/{chunk-3TS5K6ZA.mjs → chunk-6IUB2VJE.mjs} +2 -2
  12. package/out/__chunks__/{chunk-JAWHG5QV.mjs → chunk-6JZSN2DY.mjs} +2 -2
  13. package/out/__chunks__/{chunk-4QRIFJFV.mjs → chunk-7LCYFHXY.mjs} +2 -2
  14. package/out/__chunks__/chunk-7TKH6H7B.mjs +2 -0
  15. package/out/__chunks__/chunk-AETYCRSD.mjs +2 -0
  16. package/out/__chunks__/chunk-BAN77GZH.mjs +2 -0
  17. package/out/__chunks__/{chunk-4WAWOE33.mjs → chunk-BY5PRWXE.mjs} +2 -2
  18. package/out/__chunks__/{chunk-Y6ONT26X.mjs → chunk-BZXWSLY4.mjs} +2 -2
  19. package/out/__chunks__/{chunk-FLIHXJC6.mjs → chunk-C54QJLN3.mjs} +2 -2
  20. package/out/__chunks__/{chunk-GX6HPAJJ.mjs → chunk-CC7AVJJE.mjs} +2 -2
  21. package/out/__chunks__/{chunk-LSFKZEDF.mjs → chunk-CSJ2ZPSM.mjs} +2 -2
  22. package/out/__chunks__/chunk-CTQ7LOUJ.mjs +2 -0
  23. package/out/__chunks__/chunk-CTQ7LOUJ.mjs.map +7 -0
  24. package/out/__chunks__/{chunk-V6TPJKNA.mjs → chunk-CWZGACL2.mjs} +2 -2
  25. package/out/__chunks__/{chunk-JQD5FQP7.mjs → chunk-CXS3EVQG.mjs} +2 -2
  26. package/out/__chunks__/{chunk-OEH2DV7C.mjs → chunk-D2OWJGPT.mjs} +2 -2
  27. package/out/__chunks__/{chunk-UZHVWIUR.mjs → chunk-EBCOUXQJ.mjs} +2 -2
  28. package/out/__chunks__/{chunk-PWCNMKNB.mjs → chunk-EBTTOSHF.mjs} +2 -2
  29. package/out/__chunks__/{chunk-IW4DEEHC.mjs → chunk-EEWPENKM.mjs} +2 -2
  30. package/out/__chunks__/{chunk-VFUYYYKF.mjs → chunk-FMF4SRBX.mjs} +2 -2
  31. package/out/__chunks__/{chunk-2YOQ53JR.mjs → chunk-FVWPUUST.mjs} +2 -2
  32. package/out/__chunks__/{chunk-J6JGLSU3.mjs → chunk-GGTCBFGO.mjs} +2 -2
  33. package/out/__chunks__/chunk-GLBPOFS4.mjs +2 -0
  34. package/out/__chunks__/{chunk-VMRTQJQQ.mjs → chunk-GSOOKRYL.mjs} +2 -2
  35. package/out/__chunks__/{chunk-FREDJUGU.mjs → chunk-H3BL4VM5.mjs} +2 -2
  36. package/out/__chunks__/{chunk-EPFU7G25.mjs → chunk-HOBNVAOB.mjs} +2 -2
  37. package/out/__chunks__/{chunk-D6T322RK.mjs → chunk-HT5WRDXC.mjs} +2 -2
  38. package/out/__chunks__/{chunk-LOCBYCTW.mjs → chunk-IMCTSHZ3.mjs} +2 -2
  39. package/out/__chunks__/{chunk-RJRYSDHS.mjs → chunk-IRULUA7A.mjs} +2 -2
  40. package/out/__chunks__/{chunk-6T23W57Y.mjs → chunk-J3VN77UR.mjs} +2 -2
  41. package/out/__chunks__/{chunk-WQMYGZGV.mjs → chunk-J5WUQE3J.mjs} +2 -2
  42. package/out/__chunks__/{chunk-EEFPWMB3.mjs → chunk-JDWI44AR.mjs} +2 -2
  43. package/out/__chunks__/{chunk-A6QJ4XG2.mjs → chunk-JMQAWP2A.mjs} +2 -2
  44. package/out/__chunks__/{chunk-OLQHWVIS.mjs → chunk-JMVSZCEJ.mjs} +2 -2
  45. package/out/__chunks__/chunk-JNF2WNVQ.mjs +2 -0
  46. package/out/__chunks__/chunk-JNJEFJLG.mjs +2 -0
  47. package/out/__chunks__/{chunk-MQIVKPYU.mjs → chunk-JXZNKTQD.mjs} +2 -2
  48. package/out/__chunks__/{chunk-MQIVKPYU.mjs.map → chunk-JXZNKTQD.mjs.map} +2 -2
  49. package/out/__chunks__/chunk-K4D34YGX.mjs +2 -0
  50. package/out/__chunks__/{chunk-MB3UAUH4.mjs → chunk-K7A2WIFY.mjs} +2 -2
  51. package/out/__chunks__/{chunk-FPOYB42M.mjs → chunk-K7DSLRNG.mjs} +2 -2
  52. package/out/__chunks__/{chunk-WH6I35RW.mjs → chunk-KIMKIACD.mjs} +2 -2
  53. package/out/__chunks__/chunk-KUX63OMO.mjs +2 -0
  54. package/out/__chunks__/{chunk-2I2KSLE2.mjs → chunk-LSEZH4P6.mjs} +2 -2
  55. package/out/__chunks__/chunk-MGEPZOGU.mjs +2 -0
  56. package/out/__chunks__/{chunk-NKW3DRZI.mjs → chunk-MPJD3UPQ.mjs} +2 -2
  57. package/out/__chunks__/{chunk-K57S4IEN.mjs → chunk-MQB7SEFO.mjs} +2 -2
  58. package/out/__chunks__/{chunk-SQMHTV2T.mjs → chunk-MVEQXX6B.mjs} +2 -2
  59. package/out/__chunks__/{chunk-V5T4YPD6.mjs → chunk-MWKZT7BL.mjs} +2 -2
  60. package/out/__chunks__/{chunk-B4HHDEQD.mjs → chunk-N4BY3A6V.mjs} +2 -2
  61. package/out/__chunks__/{chunk-NNNII7QZ.mjs → chunk-NHDCY4TW.mjs} +2 -2
  62. package/out/__chunks__/{chunk-EETEYJ2T.mjs → chunk-NOSCTAHA.mjs} +2 -2
  63. package/out/__chunks__/chunk-ODRQYRPV.mjs +2 -0
  64. package/out/__chunks__/{chunk-GJXPULYJ.mjs → chunk-P7JHVK7R.mjs} +2 -2
  65. package/out/__chunks__/{chunk-6T2LXDEP.mjs → chunk-PF4ZP4KB.mjs} +2 -2
  66. package/out/__chunks__/{chunk-PKSNXCV4.mjs → chunk-PRMKM6DW.mjs} +2 -2
  67. package/out/__chunks__/{chunk-H4DVQ62L.mjs → chunk-PZBHKR5U.mjs} +2 -2
  68. package/out/__chunks__/{chunk-NFJTM7EU.mjs → chunk-QJNE7H3S.mjs} +2 -2
  69. package/out/__chunks__/chunk-RES4BXBE.mjs +2 -0
  70. package/out/__chunks__/{chunk-JNHXLQ7M.mjs → chunk-RV3QLH3M.mjs} +2 -2
  71. package/out/__chunks__/{chunk-2D4GMO36.mjs → chunk-S5M3W7ZR.mjs} +2 -2
  72. package/out/__chunks__/{chunk-BWBZHZCG.mjs → chunk-SNJZ6KNA.mjs} +2 -2
  73. package/out/__chunks__/{chunk-TE3NCUWV.mjs → chunk-TLNZ26DM.mjs} +2 -2
  74. package/out/__chunks__/{chunk-EB4P7XML.mjs → chunk-UCWXFSUC.mjs} +2 -2
  75. package/out/__chunks__/chunk-UVJWRU3H.mjs +2 -0
  76. package/out/__chunks__/{chunk-KXCUN2CA.mjs → chunk-VM6MDBT7.mjs} +2 -2
  77. package/out/__chunks__/{chunk-3OVUAVDG.mjs → chunk-VOKC2G5A.mjs} +2 -2
  78. package/out/__chunks__/chunk-YDSNQ7O5.mjs +2 -0
  79. package/out/__chunks__/{chunk-IDEBZCHN.mjs → chunk-YFIAKX5S.mjs} +2 -2
  80. package/out/__chunks__/chunk-YI2JUPHR.mjs +2 -0
  81. package/out/__chunks__/chunk-YRVXOPCA.mjs +2 -0
  82. package/out/__chunks__/chunk-YUHQQNRS.mjs +2 -0
  83. package/out/__chunks__/{chunk-7S2Y4LHL.mjs → chunk-YYBPMJO2.mjs} +2 -2
  84. package/out/apiCalls/account/getScamAddressData.mjs +1 -1
  85. package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
  86. package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
  87. package/out/apiCalls/index.mjs +1 -1
  88. package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
  89. package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
  90. package/out/apiCalls/tokens/index.mjs +1 -1
  91. package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
  92. package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
  93. package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
  94. package/out/constants/browser.constants.mjs +1 -1
  95. package/out/constants/index.mjs +1 -1
  96. package/out/constants/storage.constants.mjs +1 -1
  97. package/out/constants/window.constants.cjs +1 -1
  98. package/out/constants/window.constants.cjs.map +1 -1
  99. package/out/constants/window.constants.mjs +1 -1
  100. package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
  101. package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
  102. package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
  103. package/out/controllers/TransactionsTableController/index.mjs +1 -1
  104. package/out/index.mjs +1 -1
  105. package/out/lib/sdkDappUi.mjs +1 -1
  106. package/out/managers/LogoutManager/LogoutManager.mjs +1 -1
  107. package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
  108. package/out/managers/NotificationsFeedManager/index.mjs +1 -1
  109. package/out/managers/ToastManager/ToastManager.mjs +1 -1
  110. package/out/managers/ToastManager/ToastUICoordinator.mjs +1 -1
  111. package/out/managers/ToastManager/helpers/LifetimeManager.mjs +1 -1
  112. package/out/managers/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
  113. package/out/managers/ToastManager/index.mjs +1 -1
  114. package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
  115. package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
  116. package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
  117. package/out/managers/TransactionManager/index.mjs +1 -1
  118. package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
  119. package/out/managers/UnlockPanelManager/index.mjs +1 -1
  120. package/out/managers/index.mjs +1 -1
  121. package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
  122. package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
  123. package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
  124. package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
  125. package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
  126. package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
  127. package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
  128. package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
  129. package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
  130. package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
  131. package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.mjs +1 -1
  132. package/out/managers/internal/WalletConnectStateManager/index.mjs +1 -1
  133. package/out/managers/internal/index.mjs +1 -1
  134. package/out/methods/account/getAccount.mjs +1 -1
  135. package/out/methods/account/getAccountInfo.mjs +1 -1
  136. package/out/methods/account/getAddress.mjs +1 -1
  137. package/out/methods/account/getIsLoggedIn.mjs +1 -1
  138. package/out/methods/account/getLatestNonce.mjs +1 -1
  139. package/out/methods/initApp/gastStationMetadata/setGasStationMetadata.mjs +1 -1
  140. package/out/methods/initApp/initApp.mjs +1 -1
  141. package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
  142. package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
  143. package/out/methods/loginInfo/getLoginInfo.mjs +1 -1
  144. package/out/methods/network/getEgldLabel.mjs +1 -1
  145. package/out/methods/network/getExplorerAddress.mjs +1 -1
  146. package/out/methods/network/getNetworkConfig.mjs +1 -1
  147. package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.mjs +1 -1
  148. package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.mjs +1 -1
  149. package/out/methods/trackTransactions/helpers/checkTransactionStatus/index.mjs +1 -1
  150. package/out/methods/trackTransactions/helpers/checkTransactionStatus/manageFailedTransactions.mjs +1 -1
  151. package/out/methods/trackTransactions/helpers/checkTransactionStatus/updateTransactionAndSessionStatus.mjs +1 -1
  152. package/out/methods/trackTransactions/helpers/getPollingInterval.mjs +1 -1
  153. package/out/methods/trackTransactions/trackTransactions.mjs +1 -1
  154. package/out/methods/transactions/getFailedTransactions.mjs +1 -1
  155. package/out/methods/transactions/getFailedTransactionsSessions.mjs +1 -1
  156. package/out/methods/transactions/getPendingTransactions.mjs +1 -1
  157. package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
  158. package/out/methods/transactions/getSuccessfulTransactions.mjs +1 -1
  159. package/out/methods/transactions/getSuccessfulTransactionsSessions.mjs +1 -1
  160. package/out/methods/transactions/getTransactionSessions.mjs +1 -1
  161. package/out/providers/DappProvider/DappProvider.mjs +1 -1
  162. package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
  163. package/out/providers/DappProvider/helpers/login/helpers/extractAddressFromToken.mjs +1 -1
  164. package/out/providers/DappProvider/helpers/login/helpers/getAccountFromToken.mjs +1 -1
  165. package/out/providers/DappProvider/helpers/login/helpers/getModifiedLoginToken.mjs +1 -1
  166. package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
  167. package/out/providers/DappProvider/helpers/logout/logout.mjs +1 -1
  168. package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
  169. package/out/providers/DappProvider/helpers/signMessage/signMessageWithProvider.mjs +1 -1
  170. package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
  171. package/out/providers/DappProvider/index.mjs +1 -1
  172. package/out/providers/ProviderFactory.mjs +1 -1
  173. package/out/providers/helpers/accountProvider.mjs +1 -1
  174. package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
  175. package/out/providers/helpers/restoreProvider.cjs +0 -1
  176. package/out/providers/helpers/restoreProvider.cjs.map +2 -2
  177. package/out/providers/helpers/restoreProvider.mjs +1 -1
  178. package/out/providers/index.mjs +1 -1
  179. package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
  180. package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
  181. package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
  182. package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
  183. package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
  184. package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
  185. package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
  186. package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
  187. package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
  188. package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
  189. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
  190. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
  191. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
  192. package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
  193. package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
  194. package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
  195. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
  196. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
  197. package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
  198. package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.mjs +1 -1
  199. package/out/providers/strategies/WalletConnectProviderStrategy/index.mjs +1 -1
  200. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.cjs +0 -1
  201. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.cjs.map +2 -2
  202. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs +1 -1
  203. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs +1 -1
  204. package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.mjs +1 -1
  205. package/out/providers/strategies/WebviewProviderStrategy/index.mjs +1 -1
  206. package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
  207. package/out/providers/strategies/helpers/index.mjs +1 -1
  208. package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
  209. package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
  210. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
  211. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
  212. package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
  213. package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +1 -1
  214. package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
  215. package/out/providers/strategies/index.mjs +1 -1
  216. package/out/react/account/useGetAccount.mjs +1 -1
  217. package/out/react/account/useGetAccountInfo.mjs +1 -1
  218. package/out/react/account/useGetIsLoggedIn.mjs +1 -1
  219. package/out/react/account/useGetLatestNonce.mjs +1 -1
  220. package/out/react/index.mjs +1 -1
  221. package/out/react/loginInfo/useGetLoginInfo.mjs +1 -1
  222. package/out/react/network/useGetNetworkConfig.mjs +1 -1
  223. package/out/react/store/getReactStore.mjs +1 -1
  224. package/out/react/store/useSelector.mjs +1 -1
  225. package/out/react/transactions/useGetFailedTransactions.mjs +1 -1
  226. package/out/react/transactions/useGetFailedTransactionsSessions.mjs +1 -1
  227. package/out/react/transactions/useGetPendingTransactions.mjs +1 -1
  228. package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
  229. package/out/react/transactions/useGetSuccessfulTransactions.mjs +1 -1
  230. package/out/react/transactions/useGetSuccessfulTransactionsSessions.mjs +1 -1
  231. package/out/react/transactions/useGetTransactionSessions.mjs +1 -1
  232. package/out/services/index.mjs +1 -1
  233. package/out/services/nativeAuth/index.mjs +1 -1
  234. package/out/services/nativeAuth/methods/buildNativeAuthConfig.mjs +1 -1
  235. package/out/services/nativeAuth/methods/getDefaultNativeAuthConfig.mjs +1 -1
  236. package/out/services/nativeAuth/methods/index.mjs +1 -1
  237. package/out/services/nativeAuth/nativeAuth.mjs +1 -1
  238. package/out/store/actions/account/accountActions.mjs +1 -1
  239. package/out/store/actions/account/index.mjs +1 -1
  240. package/out/store/actions/cache/cacheActions.mjs +1 -1
  241. package/out/store/actions/cache/index.mjs +1 -1
  242. package/out/store/actions/config/configActions.mjs +1 -1
  243. package/out/store/actions/config/index.mjs +1 -1
  244. package/out/store/actions/index.mjs +1 -1
  245. package/out/store/actions/loginInfo/loginInfoActions.mjs +1 -1
  246. package/out/store/actions/network/index.mjs +1 -1
  247. package/out/store/actions/network/initializeNetwork.mjs +1 -1
  248. package/out/store/actions/network/networkActions.mjs +1 -1
  249. package/out/store/actions/sharedActions/index.mjs +1 -1
  250. package/out/store/actions/sharedActions/sharedActions.mjs +1 -1
  251. package/out/store/actions/toasts/index.mjs +1 -1
  252. package/out/store/actions/toasts/toastsActions.mjs +1 -1
  253. package/out/store/actions/transactions/transactionsActions.mjs +1 -1
  254. package/out/store/actions/ui/index.mjs +1 -1
  255. package/out/store/actions/ui/uiActions.mjs +1 -1
  256. package/out/store/middleware/applyMiddlewares.mjs +1 -1
  257. package/out/store/middleware/index.mjs +1 -1
  258. package/out/store/middleware/logoutMiddleware.mjs +1 -1
  259. package/out/store/storage/index.mjs +1 -1
  260. package/out/store/storage/storageCallback.mjs +1 -1
  261. package/out/store/store.mjs +1 -1
  262. package/out/utils/ComponentFactory.mjs +1 -1
  263. package/out/utils/account/index.mjs +1 -1
  264. package/out/utils/account/refreshAccount.mjs +1 -1
  265. package/out/utils/account/refreshNativeAuthTokenLogin.mjs +1 -1
  266. package/out/utils/index.mjs +1 -1
  267. package/out/utils/transactions/getActiveTransactionsStatus.mjs +1 -1
  268. package/out/utils/transactions/getInterpretedTransaction/getInterpretedTransaction.mjs +1 -1
  269. package/out/utils/transactions/getInterpretedTransaction/helpers/getLockedAccountName.mjs +1 -1
  270. package/out/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.mjs +1 -1
  271. package/out/utils/transactions/getInterpretedTransaction/helpers/getShardText.mjs +1 -1
  272. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionIconInfo.mjs +1 -1
  273. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionMessages.mjs +1 -1
  274. package/out/utils/transactions/getInterpretedTransaction/helpers/index.mjs +1 -1
  275. package/out/utils/transactions/getInterpretedTransaction/index.mjs +1 -1
  276. package/out/utils/transactions/getTransactionsHistory/getTransactionsHistory.mjs +1 -1
  277. package/out/utils/transactions/getTransactionsHistory/helpers/getCachedTransactionListItem.mjs +1 -1
  278. package/out/utils/transactions/getTransactionsHistory/helpers/index.mjs +1 -1
  279. package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.mjs +1 -1
  280. package/out/utils/transactions/getTransactionsHistory/index.mjs +1 -1
  281. package/out/utils/transactions/index.mjs +1 -1
  282. package/out/utils/visual/index.mjs +1 -1
  283. package/out/utils/visual/switchTheme.mjs +1 -1
  284. package/out/utils/window/getIsInIframe.mjs +1 -1
  285. package/out/utils/window/getWindowParentOrigin.mjs +1 -1
  286. package/out/utils/window/index.mjs +1 -1
  287. package/package.json +2 -2
  288. package/out/__chunks__/chunk-7FTEFM3G.mjs +0 -2
  289. package/out/__chunks__/chunk-7GBXWZAI.mjs +0 -2
  290. package/out/__chunks__/chunk-BDAUGWZM.mjs +0 -2
  291. package/out/__chunks__/chunk-DXXG5TSN.mjs +0 -2
  292. package/out/__chunks__/chunk-HFGQW4ZK.mjs +0 -2
  293. package/out/__chunks__/chunk-HT2FAOH3.mjs +0 -2
  294. package/out/__chunks__/chunk-IXXPFRFP.mjs +0 -2
  295. package/out/__chunks__/chunk-JMFGVLF2.mjs +0 -2
  296. package/out/__chunks__/chunk-LFOBVMPR.mjs +0 -2
  297. package/out/__chunks__/chunk-LHQEWFDT.mjs +0 -2
  298. package/out/__chunks__/chunk-LHQEWFDT.mjs.map +0 -7
  299. package/out/__chunks__/chunk-NQNTF6QC.mjs +0 -2
  300. package/out/__chunks__/chunk-NU34PSWD.mjs +0 -2
  301. package/out/__chunks__/chunk-PNOKA67W.mjs +0 -2
  302. package/out/__chunks__/chunk-SXOH2YD4.mjs +0 -2
  303. package/out/__chunks__/chunk-T74VEWCS.mjs +0 -2
  304. package/out/__chunks__/chunk-TIQSGLWX.mjs +0 -2
  305. package/out/__chunks__/chunk-TRIWGK3U.mjs +0 -2
  306. package/out/__chunks__/chunk-UOZF737L.mjs +0 -2
  307. /package/out/__chunks__/{chunk-LV3TNCL7.mjs.map → chunk-2FJMU6JT.mjs.map} +0 -0
  308. /package/out/__chunks__/{chunk-U3GR2SVT.mjs.map → chunk-2VMUFNMX.mjs.map} +0 -0
  309. /package/out/__chunks__/{chunk-QJI3WAKY.mjs.map → chunk-35J6CQWK.mjs.map} +0 -0
  310. /package/out/__chunks__/{chunk-6ZHJDJ2I.mjs.map → chunk-36H647WW.mjs.map} +0 -0
  311. /package/out/__chunks__/{chunk-VRGBE6S2.mjs.map → chunk-3AS72TW6.mjs.map} +0 -0
  312. /package/out/__chunks__/{chunk-L7LGSTVP.mjs.map → chunk-3WPEA75B.mjs.map} +0 -0
  313. /package/out/__chunks__/{chunk-6RJVQ4UE.mjs.map → chunk-4JQJOGX3.mjs.map} +0 -0
  314. /package/out/__chunks__/{chunk-7WYMH2Y5.mjs.map → chunk-4NFQOHJB.mjs.map} +0 -0
  315. /package/out/__chunks__/{chunk-3TS5K6ZA.mjs.map → chunk-6IUB2VJE.mjs.map} +0 -0
  316. /package/out/__chunks__/{chunk-JAWHG5QV.mjs.map → chunk-6JZSN2DY.mjs.map} +0 -0
  317. /package/out/__chunks__/{chunk-4QRIFJFV.mjs.map → chunk-7LCYFHXY.mjs.map} +0 -0
  318. /package/out/__chunks__/{chunk-T74VEWCS.mjs.map → chunk-7TKH6H7B.mjs.map} +0 -0
  319. /package/out/__chunks__/{chunk-NQNTF6QC.mjs.map → chunk-AETYCRSD.mjs.map} +0 -0
  320. /package/out/__chunks__/{chunk-HFGQW4ZK.mjs.map → chunk-BAN77GZH.mjs.map} +0 -0
  321. /package/out/__chunks__/{chunk-4WAWOE33.mjs.map → chunk-BY5PRWXE.mjs.map} +0 -0
  322. /package/out/__chunks__/{chunk-Y6ONT26X.mjs.map → chunk-BZXWSLY4.mjs.map} +0 -0
  323. /package/out/__chunks__/{chunk-FLIHXJC6.mjs.map → chunk-C54QJLN3.mjs.map} +0 -0
  324. /package/out/__chunks__/{chunk-GX6HPAJJ.mjs.map → chunk-CC7AVJJE.mjs.map} +0 -0
  325. /package/out/__chunks__/{chunk-LSFKZEDF.mjs.map → chunk-CSJ2ZPSM.mjs.map} +0 -0
  326. /package/out/__chunks__/{chunk-V6TPJKNA.mjs.map → chunk-CWZGACL2.mjs.map} +0 -0
  327. /package/out/__chunks__/{chunk-JQD5FQP7.mjs.map → chunk-CXS3EVQG.mjs.map} +0 -0
  328. /package/out/__chunks__/{chunk-OEH2DV7C.mjs.map → chunk-D2OWJGPT.mjs.map} +0 -0
  329. /package/out/__chunks__/{chunk-UZHVWIUR.mjs.map → chunk-EBCOUXQJ.mjs.map} +0 -0
  330. /package/out/__chunks__/{chunk-PWCNMKNB.mjs.map → chunk-EBTTOSHF.mjs.map} +0 -0
  331. /package/out/__chunks__/{chunk-IW4DEEHC.mjs.map → chunk-EEWPENKM.mjs.map} +0 -0
  332. /package/out/__chunks__/{chunk-VFUYYYKF.mjs.map → chunk-FMF4SRBX.mjs.map} +0 -0
  333. /package/out/__chunks__/{chunk-2YOQ53JR.mjs.map → chunk-FVWPUUST.mjs.map} +0 -0
  334. /package/out/__chunks__/{chunk-J6JGLSU3.mjs.map → chunk-GGTCBFGO.mjs.map} +0 -0
  335. /package/out/__chunks__/{chunk-JMFGVLF2.mjs.map → chunk-GLBPOFS4.mjs.map} +0 -0
  336. /package/out/__chunks__/{chunk-VMRTQJQQ.mjs.map → chunk-GSOOKRYL.mjs.map} +0 -0
  337. /package/out/__chunks__/{chunk-FREDJUGU.mjs.map → chunk-H3BL4VM5.mjs.map} +0 -0
  338. /package/out/__chunks__/{chunk-EPFU7G25.mjs.map → chunk-HOBNVAOB.mjs.map} +0 -0
  339. /package/out/__chunks__/{chunk-D6T322RK.mjs.map → chunk-HT5WRDXC.mjs.map} +0 -0
  340. /package/out/__chunks__/{chunk-LOCBYCTW.mjs.map → chunk-IMCTSHZ3.mjs.map} +0 -0
  341. /package/out/__chunks__/{chunk-RJRYSDHS.mjs.map → chunk-IRULUA7A.mjs.map} +0 -0
  342. /package/out/__chunks__/{chunk-6T23W57Y.mjs.map → chunk-J3VN77UR.mjs.map} +0 -0
  343. /package/out/__chunks__/{chunk-WQMYGZGV.mjs.map → chunk-J5WUQE3J.mjs.map} +0 -0
  344. /package/out/__chunks__/{chunk-EEFPWMB3.mjs.map → chunk-JDWI44AR.mjs.map} +0 -0
  345. /package/out/__chunks__/{chunk-A6QJ4XG2.mjs.map → chunk-JMQAWP2A.mjs.map} +0 -0
  346. /package/out/__chunks__/{chunk-OLQHWVIS.mjs.map → chunk-JMVSZCEJ.mjs.map} +0 -0
  347. /package/out/__chunks__/{chunk-DXXG5TSN.mjs.map → chunk-JNF2WNVQ.mjs.map} +0 -0
  348. /package/out/__chunks__/{chunk-UOZF737L.mjs.map → chunk-JNJEFJLG.mjs.map} +0 -0
  349. /package/out/__chunks__/{chunk-HT2FAOH3.mjs.map → chunk-K4D34YGX.mjs.map} +0 -0
  350. /package/out/__chunks__/{chunk-MB3UAUH4.mjs.map → chunk-K7A2WIFY.mjs.map} +0 -0
  351. /package/out/__chunks__/{chunk-FPOYB42M.mjs.map → chunk-K7DSLRNG.mjs.map} +0 -0
  352. /package/out/__chunks__/{chunk-WH6I35RW.mjs.map → chunk-KIMKIACD.mjs.map} +0 -0
  353. /package/out/__chunks__/{chunk-SXOH2YD4.mjs.map → chunk-KUX63OMO.mjs.map} +0 -0
  354. /package/out/__chunks__/{chunk-2I2KSLE2.mjs.map → chunk-LSEZH4P6.mjs.map} +0 -0
  355. /package/out/__chunks__/{chunk-LFOBVMPR.mjs.map → chunk-MGEPZOGU.mjs.map} +0 -0
  356. /package/out/__chunks__/{chunk-NKW3DRZI.mjs.map → chunk-MPJD3UPQ.mjs.map} +0 -0
  357. /package/out/__chunks__/{chunk-K57S4IEN.mjs.map → chunk-MQB7SEFO.mjs.map} +0 -0
  358. /package/out/__chunks__/{chunk-SQMHTV2T.mjs.map → chunk-MVEQXX6B.mjs.map} +0 -0
  359. /package/out/__chunks__/{chunk-V5T4YPD6.mjs.map → chunk-MWKZT7BL.mjs.map} +0 -0
  360. /package/out/__chunks__/{chunk-B4HHDEQD.mjs.map → chunk-N4BY3A6V.mjs.map} +0 -0
  361. /package/out/__chunks__/{chunk-NNNII7QZ.mjs.map → chunk-NHDCY4TW.mjs.map} +0 -0
  362. /package/out/__chunks__/{chunk-EETEYJ2T.mjs.map → chunk-NOSCTAHA.mjs.map} +0 -0
  363. /package/out/__chunks__/{chunk-BDAUGWZM.mjs.map → chunk-ODRQYRPV.mjs.map} +0 -0
  364. /package/out/__chunks__/{chunk-GJXPULYJ.mjs.map → chunk-P7JHVK7R.mjs.map} +0 -0
  365. /package/out/__chunks__/{chunk-6T2LXDEP.mjs.map → chunk-PF4ZP4KB.mjs.map} +0 -0
  366. /package/out/__chunks__/{chunk-PKSNXCV4.mjs.map → chunk-PRMKM6DW.mjs.map} +0 -0
  367. /package/out/__chunks__/{chunk-H4DVQ62L.mjs.map → chunk-PZBHKR5U.mjs.map} +0 -0
  368. /package/out/__chunks__/{chunk-NFJTM7EU.mjs.map → chunk-QJNE7H3S.mjs.map} +0 -0
  369. /package/out/__chunks__/{chunk-IXXPFRFP.mjs.map → chunk-RES4BXBE.mjs.map} +0 -0
  370. /package/out/__chunks__/{chunk-JNHXLQ7M.mjs.map → chunk-RV3QLH3M.mjs.map} +0 -0
  371. /package/out/__chunks__/{chunk-2D4GMO36.mjs.map → chunk-S5M3W7ZR.mjs.map} +0 -0
  372. /package/out/__chunks__/{chunk-BWBZHZCG.mjs.map → chunk-SNJZ6KNA.mjs.map} +0 -0
  373. /package/out/__chunks__/{chunk-TE3NCUWV.mjs.map → chunk-TLNZ26DM.mjs.map} +0 -0
  374. /package/out/__chunks__/{chunk-EB4P7XML.mjs.map → chunk-UCWXFSUC.mjs.map} +0 -0
  375. /package/out/__chunks__/{chunk-PNOKA67W.mjs.map → chunk-UVJWRU3H.mjs.map} +0 -0
  376. /package/out/__chunks__/{chunk-KXCUN2CA.mjs.map → chunk-VM6MDBT7.mjs.map} +0 -0
  377. /package/out/__chunks__/{chunk-3OVUAVDG.mjs.map → chunk-VOKC2G5A.mjs.map} +0 -0
  378. /package/out/__chunks__/{chunk-TIQSGLWX.mjs.map → chunk-YDSNQ7O5.mjs.map} +0 -0
  379. /package/out/__chunks__/{chunk-IDEBZCHN.mjs.map → chunk-YFIAKX5S.mjs.map} +0 -0
  380. /package/out/__chunks__/{chunk-7GBXWZAI.mjs.map → chunk-YI2JUPHR.mjs.map} +0 -0
  381. /package/out/__chunks__/{chunk-7FTEFM3G.mjs.map → chunk-YRVXOPCA.mjs.map} +0 -0
  382. /package/out/__chunks__/{chunk-NU34PSWD.mjs.map → chunk-YUHQQNRS.mjs.map} +0 -0
  383. /package/out/__chunks__/{chunk-7S2Y4LHL.mjs.map → chunk-YYBPMJO2.mjs.map} +0 -0
@@ -0,0 +1,2 @@
1
+ var o=typeof window<"u"?window:{},n="5.3.0-alpha.5";export{o as a,n as b};
2
+ //# sourceMappingURL=chunk-2FA2VSIL.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants/window.constants.ts"],
4
- "sourcesContent": ["export const safeWindow: Window =\n typeof window !== 'undefined' ? window : ({} as Window);\n\nexport const version = '5.3.0-alpha.3'; // will be replaced at build time\n"],
4
+ "sourcesContent": ["export const safeWindow: Window =\n typeof window !== 'undefined' ? window : ({} as Window);\n\nexport const version = '5.3.0-alpha.5'; // will be replaced at build time\n"],
5
5
  "mappings": "AAAO,IAAMA,EACX,OAAO,OAAW,IAAc,OAAU,CAAC,EAEhCC,EAAU",
6
6
  "names": ["safeWindow", "version"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-KXCUN2CA.mjs";import{a as c}from"./chunk-I3MK6KZJ.mjs";var f=async({receiver:n,sender:i,tokenId:s})=>{let t=null,r=null;if(!s)return{senderLockedAccount:t,receiverLockedAccount:r};try{let o=(await l({tokenId:s}))?.assets?.lockedAccounts;if(!o)return{senderLockedAccount:t,receiverLockedAccount:r};for(let e in o)if(c(e)&&(i===e&&(t=e),n===e&&(r=e)),c(o[e])&&(i===o[e]&&(t=o[e]),n===o[e]&&(r=o[e])),t&&r)return{senderLockedAccount:t,receiverLockedAccount:r}}catch(a){console.error("Error getting token details",a)}return{senderLockedAccount:t,receiverLockedAccount:r}};export{f as a};
2
- //# sourceMappingURL=chunk-LV3TNCL7.mjs.map
1
+ import{a as l}from"./chunk-VM6MDBT7.mjs";import{a as c}from"./chunk-I3MK6KZJ.mjs";var f=async({receiver:n,sender:i,tokenId:s})=>{let t=null,r=null;if(!s)return{senderLockedAccount:t,receiverLockedAccount:r};try{let o=(await l({tokenId:s}))?.assets?.lockedAccounts;if(!o)return{senderLockedAccount:t,receiverLockedAccount:r};for(let e in o)if(c(e)&&(i===e&&(t=e),n===e&&(r=e)),c(o[e])&&(i===o[e]&&(t=o[e]),n===o[e]&&(r=o[e])),t&&r)return{senderLockedAccount:t,receiverLockedAccount:r}}catch(a){console.error("Error getting token details",a)}return{senderLockedAccount:t,receiverLockedAccount:r}};export{f as a};
2
+ //# sourceMappingURL=chunk-2FJMU6JT.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-OEH2DV7C.mjs";import{a as e}from"./chunk-TIQSGLWX.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-U3GR2SVT.mjs.map
1
+ import{a as s}from"./chunk-D2OWJGPT.mjs";import{a as e}from"./chunk-YDSNQ7O5.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-2VMUFNMX.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-NGM3AVCY.mjs";import{s}from"./chunk-7WYMH2Y5.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-QJI3WAKY.mjs.map
1
+ import{a as u}from"./chunk-NGM3AVCY.mjs";import{s}from"./chunk-4NFQOHJB.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-35J6CQWK.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-O7LCTC4K.mjs";import{s as m}from"./chunk-7WYMH2Y5.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-6ZHJDJ2I.mjs.map
1
+ import{a as s}from"./chunk-O7LCTC4K.mjs";import{s as m}from"./chunk-4NFQOHJB.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-36H647WW.mjs.map
@@ -1,2 +1,2 @@
1
- import{d as s}from"./chunk-JAWHG5QV.mjs";import{a as u}from"./chunk-LOCBYCTW.mjs";import{s as c}from"./chunk-7WYMH2Y5.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-VRGBE6S2.mjs.map
1
+ import{d as s}from"./chunk-6JZSN2DY.mjs";import{a as u}from"./chunk-IMCTSHZ3.mjs";import{s as c}from"./chunk-4NFQOHJB.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-3AS72TW6.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-U3GR2SVT.mjs";import{a as o}from"./chunk-LJX4MW7B.mjs";import{a as e,b as t}from"./chunk-TRIWGK3U.mjs";import{WebviewProvider as a}from"@multiversx/sdk-webview-provider/out/WebviewProvider";var n=class extends s{constructor(r){super(r?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async r=>{if(!this.provider)throw new Error("Provider is not initialized.");try{return await this.provider.signTransactions(r)||[]}catch(i){throw this.cancelAction(),i}};this.signMessage=async r=>{if(!this.provider)throw new Error("Provider is not initialized.");try{return await this.provider.signMessage(r)}catch(i){throw this.cancelAction(),i}};this.provider=a.getInstance({resetStateCallback:()=>{e.localStorage?.clear?.(),e.sessionStorage?.clear?.()}}),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}logout(){return this.provider.logout()}getType(){return o.webview}getAddress(){throw new Error("Method not implemented.")}setAccount(r){return this.provider.setAccount(r)}isInitialized(){return this.provider.isInitialized()}async initializeProvider(){let r=await this.provider.init(t);return this.address&&this.setAccount({address:this.address}),r}};export{n as a};
2
- //# sourceMappingURL=chunk-L7LGSTVP.mjs.map
1
+ import{a as s}from"./chunk-2VMUFNMX.mjs";import{a as o}from"./chunk-LJX4MW7B.mjs";import{a as e,b as t}from"./chunk-2FA2VSIL.mjs";import{WebviewProvider as a}from"@multiversx/sdk-webview-provider/out/WebviewProvider";var n=class extends s{constructor(r){super(r?.address);this.cancelAction=async()=>{this.provider.cancelAction()};this.signTransactions=async r=>{if(!this.provider)throw new Error("Provider is not initialized.");try{return await this.provider.signTransactions(r)||[]}catch(i){throw this.cancelAction(),i}};this.signMessage=async r=>{if(!this.provider)throw new Error("Provider is not initialized.");try{return await this.provider.signMessage(r)}catch(i){throw this.cancelAction(),i}};this.provider=a.getInstance({resetStateCallback:()=>{e.localStorage?.clear?.(),e.sessionStorage?.clear?.()}}),this._login=this.provider.login.bind(this.provider)}async init(){return this.initializeAddress(),this.initializeProvider()}logout(){return this.provider.logout()}getType(){return o.webview}getAddress(){throw new Error("Method not implemented.")}setAccount(r){return this.provider.setAccount(r)}isInitialized(){return this.provider.isInitialized()}async initializeProvider(){let r=await this.provider.init(t);return this.address&&this.setAccount({address:this.address}),r}};export{n as a};
2
+ //# sourceMappingURL=chunk-3WPEA75B.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as A}from"./chunk-2YOQ53JR.mjs";import{a as I}from"./chunk-EAJBSX6Y.mjs";import{a as b}from"./chunk-Y3BNMQFP.mjs";import{g as f}from"./chunk-GJXPULYJ.mjs";import{a as S}from"./chunk-N55JEIM6.mjs";import{b as T}from"./chunk-2VG3V3VD.mjs";import{a as y}from"./chunk-JNHXLQ7M.mjs";import{a as h}from"./chunk-NQNTF6QC.mjs";import{h as g}from"./chunk-M6MN4RXG.mjs";import{s as l}from"./chunk-7WYMH2Y5.mjs";import{b as m}from"./chunk-7VHTZYM2.mjs";import w from"axios";var r=class r{constructor(){this.setCallbacks=({onSuccess:t,onFail:a})=>{T({onSuccess:t,onFail:a})};this.send=async t=>{if(t.length===0)throw new Error("No transactions to send");try{if(!I(t))return await this.sendSignedTransactions(t);let a=await this.sendSignedBatchTransactions(t);if(!a.data||a.data.error)throw new Error(a.data?.error??"Failed to send transactions");return a.data.transactions}catch(a){throw a.response?.data?.message??a.message}};this.track=async(t,a={disableToasts:!1})=>{let s=this.sequentialToFlatArray(t).map(e=>({...e,status:e.status??"pending"})),o=S(s),n=y({transactions:s,transactionsDisplayInfo:a.transactionsDisplayInfo,status:o??"sent",sessionInformation:a.sessionInformation});if(a.disableToasts===!0)return n;a.onSuccess&&T({onSuccess:a.onSuccess,sessionId:n}),a.onFail&&T({onFail:a.onFail,sessionId:n});let i=A(t);return f({toastId:n,totalDuration:i}),n};this.sendSignedTransactions=async t=>{let{apiAddress:a,apiTimeout:s}=m(l());return await Promise.all(t.map(async n=>{let i=await w.post(`${a}/transactions`,n.toPlainObject(),{timeout:Number(s)}),e=i.data.txHash;return{...n.toPlainObject(),...i.data,status:"pending",hash:e}}))};this.sendSignedBatchTransactions=async t=>{let{address:a}=h(),{apiAddress:s,apiTimeout:o}=m(l());if(!a)return{error:"Invalid address provided. You need to be logged in to send transactions"};let n=this.buildBatchId(a),e={transactions:t.map(p=>p.map(c=>c.toPlainObject())),id:n},{data:u}=await w.post(`${s}/batch`,e,{timeout:Number(o)}),B=u.transactions.map(p=>p.map(c=>{let d={...c,status:"pending",hash:c.hash};return b({data:d.data})&&(delete d.senderUsername,delete d.receiverUsername),d}));return{data:{...u,transactions:B}}};this.buildBatchId=t=>`${Date.now().toString()}${g}${t}`;this.sequentialToFlatArray=(t=[])=>this.getIsSequential(t)?t.flat():t;this.getIsSequential=t=>t?.every(a=>Array.isArray(a))}static getInstance(){return r.instance||(r.instance=new r),r.instance}};r.instance=null;var v=r;export{v as a};
2
- //# sourceMappingURL=chunk-6RJVQ4UE.mjs.map
1
+ import{a as A}from"./chunk-FVWPUUST.mjs";import{a as I}from"./chunk-EAJBSX6Y.mjs";import{a as b}from"./chunk-Y3BNMQFP.mjs";import{g as f}from"./chunk-P7JHVK7R.mjs";import{a as S}from"./chunk-N55JEIM6.mjs";import{b as T}from"./chunk-2VG3V3VD.mjs";import{a as y}from"./chunk-RV3QLH3M.mjs";import{a as h}from"./chunk-AETYCRSD.mjs";import{h as g}from"./chunk-M6MN4RXG.mjs";import{s as l}from"./chunk-4NFQOHJB.mjs";import{b as m}from"./chunk-7VHTZYM2.mjs";import w from"axios";var r=class r{constructor(){this.setCallbacks=({onSuccess:t,onFail:a})=>{T({onSuccess:t,onFail:a})};this.send=async t=>{if(t.length===0)throw new Error("No transactions to send");try{if(!I(t))return await this.sendSignedTransactions(t);let a=await this.sendSignedBatchTransactions(t);if(!a.data||a.data.error)throw new Error(a.data?.error??"Failed to send transactions");return a.data.transactions}catch(a){throw a.response?.data?.message??a.message}};this.track=async(t,a={disableToasts:!1})=>{let s=this.sequentialToFlatArray(t).map(e=>({...e,status:e.status??"pending"})),o=S(s),n=y({transactions:s,transactionsDisplayInfo:a.transactionsDisplayInfo,status:o??"sent",sessionInformation:a.sessionInformation});if(a.disableToasts===!0)return n;a.onSuccess&&T({onSuccess:a.onSuccess,sessionId:n}),a.onFail&&T({onFail:a.onFail,sessionId:n});let i=A(t);return f({toastId:n,totalDuration:i}),n};this.sendSignedTransactions=async t=>{let{apiAddress:a,apiTimeout:s}=m(l());return await Promise.all(t.map(async n=>{let i=await w.post(`${a}/transactions`,n.toPlainObject(),{timeout:Number(s)}),e=i.data.txHash;return{...n.toPlainObject(),...i.data,status:"pending",hash:e}}))};this.sendSignedBatchTransactions=async t=>{let{address:a}=h(),{apiAddress:s,apiTimeout:o}=m(l());if(!a)return{error:"Invalid address provided. You need to be logged in to send transactions"};let n=this.buildBatchId(a),e={transactions:t.map(p=>p.map(c=>c.toPlainObject())),id:n},{data:u}=await w.post(`${s}/batch`,e,{timeout:Number(o)}),B=u.transactions.map(p=>p.map(c=>{let d={...c,status:"pending",hash:c.hash};return b({data:d.data})&&(delete d.senderUsername,delete d.receiverUsername),d}));return{data:{...u,transactions:B}}};this.buildBatchId=t=>`${Date.now().toString()}${g}${t}`;this.sequentialToFlatArray=(t=[])=>this.getIsSequential(t)?t.flat():t;this.getIsSequential=t=>t?.every(a=>Array.isArray(a))}static getInstance(){return r.instance||(r.instance=new r),r.instance}};r.instance=null;var v=r;export{v as a};
2
+ //# sourceMappingURL=chunk-4JQJOGX3.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as a,f as p}from"./chunk-UERJ6AKK.mjs";import{f as l}from"./chunk-VNLGNNIL.mjs";import{a as d,b as y}from"./chunk-NLRDRI7Q.mjs";import{a as I}from"./chunk-PNOKA67W.mjs";import{a as k}from"./chunk-KRWR77QE.mjs";import{b as T}from"./chunk-A7FTKX2A.mjs";import{a as c,b as g}from"./chunk-WZGG2YKQ.mjs";import{a as m,b as f}from"./chunk-M7BM6QPB.mjs";import{a as L}from"./chunk-CYCS3K6Q.mjs";import{a as S,b as u}from"./chunk-VKEESSBI.mjs";import{a as x}from"./chunk-2DNGCNYM.mjs";import{a as v}from"./chunk-NB7A4C7L.mjs";import{c as s}from"./chunk-NTEMINYA.mjs";import{createJSONStorage as O,devtools as V,persist as h}from"zustand/middleware";import{immer as N}from"zustand/middleware/immer";import{createStore as J}from"zustand/vanilla";var A=e=>{e.account=c,e.loginInfo=m,e.transactions=d,e.toasts=S};function H(){return new Date().setHours(new Date().getHours()+24)}function w(e){if(e==null){E();return}b(e)}var C=e=>{let t=p(e),n=l(e),{address:i,publicKey:M}=a(e);if(i&&M!==new s(i).toHex()&&A(e),!t)return;if(n==null){w(H());return}let P=Date.now();n-P<0&&(w(null),o().setState(A))};var W=(e,t)=>{C(e)};var z=e=>{let t=J(V(h(N((...n)=>({network:x(...n),account:g(...n),loginInfo:f(...n),config:L(...n),transactions:y(...n),toasts:u(...n),cache:T(...n),ui:v(...n)})),{name:"sdk-dapp-store",storage:O(e)}),{name:"sdk-dapp"}));return t.subscribe(W),t},r,D=e=>{r=e},o=()=>(r||D(z(()=>new k)),r),le=(e=I)=>{let t=z(e);return D(t),t},se=()=>o().getState();var me=e=>o().setState(({loginInfo:t})=>{t.providerType=e},!1,{type:"setProviderType",payload:{value:e}}),fe=e=>o().setState(({loginInfo:t})=>{t.tokenLogin=e},!1,{type:"setTokenLogin",payload:{value:e}}),Se=e=>o().setState(({loginInfo:t})=>{if(t.tokenLogin!=null){t.tokenLogin.loginToken=e;return}t.tokenLogin={loginToken:e}},!1,{type:"setLoginToken",payload:{value:e}}),ue=e=>o().setState(({loginInfo:t})=>{t?.tokenLogin!=null&&(t.tokenLogin.signature=e)},!1,{type:"setTokenLoginSignature",payload:{value:e}}),de=e=>o().setState(({loginInfo:t})=>{t.walletConnectLogin=e},!1,{type:"setWalletConnectLogin",payload:{value:e}}),ye=e=>o().setState(({loginInfo:t})=>{t.ledgerLogin=e},!1,{type:"setLedgerLogin",payload:{value:e}}),xe=e=>o().setState(({loginInfo:t})=>{t.isWalletConnectV2Initialized=e},!1,{type:"setIsWalletConnectV2Initialized",payload:{value:e}}),E=()=>o().setState(({loginInfo:e})=>{e.loginExpiresAt=null},!1,{type:"removeLoginExpiresAt",payload:{value:null}}),b=e=>o().setState(({loginInfo:t})=>{t.loginExpiresAt=e},!1,{type:"addLoginExpiresAt",payload:{value:e}});export{me as a,fe as b,Se as c,ue as d,de as e,ye as f,xe as g,E as h,b as i,A as j,H as k,w as l,C as m,W as n,z as o,D as p,o as q,le as r,se as s};
2
- //# sourceMappingURL=chunk-7WYMH2Y5.mjs.map
1
+ import{b as a,f as p}from"./chunk-UERJ6AKK.mjs";import{f as l}from"./chunk-VNLGNNIL.mjs";import{a as d,b as y}from"./chunk-NLRDRI7Q.mjs";import{a as I}from"./chunk-UVJWRU3H.mjs";import{a as k}from"./chunk-KRWR77QE.mjs";import{b as T}from"./chunk-A7FTKX2A.mjs";import{a as c,b as g}from"./chunk-WZGG2YKQ.mjs";import{a as m,b as f}from"./chunk-M7BM6QPB.mjs";import{a as L}from"./chunk-CYCS3K6Q.mjs";import{a as S,b as u}from"./chunk-VKEESSBI.mjs";import{a as x}from"./chunk-2DNGCNYM.mjs";import{a as v}from"./chunk-NB7A4C7L.mjs";import{c as s}from"./chunk-NTEMINYA.mjs";import{createJSONStorage as O,devtools as V,persist as h}from"zustand/middleware";import{immer as N}from"zustand/middleware/immer";import{createStore as J}from"zustand/vanilla";var A=e=>{e.account=c,e.loginInfo=m,e.transactions=d,e.toasts=S};function H(){return new Date().setHours(new Date().getHours()+24)}function w(e){if(e==null){E();return}b(e)}var C=e=>{let t=p(e),n=l(e),{address:i,publicKey:M}=a(e);if(i&&M!==new s(i).toHex()&&A(e),!t)return;if(n==null){w(H());return}let P=Date.now();n-P<0&&(w(null),o().setState(A))};var W=(e,t)=>{C(e)};var z=e=>{let t=J(V(h(N((...n)=>({network:x(...n),account:g(...n),loginInfo:f(...n),config:L(...n),transactions:y(...n),toasts:u(...n),cache:T(...n),ui:v(...n)})),{name:"sdk-dapp-store",storage:O(e)}),{name:"sdk-dapp"}));return t.subscribe(W),t},r,D=e=>{r=e},o=()=>(r||D(z(()=>new k)),r),le=(e=I)=>{let t=z(e);return D(t),t},se=()=>o().getState();var me=e=>o().setState(({loginInfo:t})=>{t.providerType=e},!1,{type:"setProviderType",payload:{value:e}}),fe=e=>o().setState(({loginInfo:t})=>{t.tokenLogin=e},!1,{type:"setTokenLogin",payload:{value:e}}),Se=e=>o().setState(({loginInfo:t})=>{if(t.tokenLogin!=null){t.tokenLogin.loginToken=e;return}t.tokenLogin={loginToken:e}},!1,{type:"setLoginToken",payload:{value:e}}),ue=e=>o().setState(({loginInfo:t})=>{t?.tokenLogin!=null&&(t.tokenLogin.signature=e)},!1,{type:"setTokenLoginSignature",payload:{value:e}}),de=e=>o().setState(({loginInfo:t})=>{t.walletConnectLogin=e},!1,{type:"setWalletConnectLogin",payload:{value:e}}),ye=e=>o().setState(({loginInfo:t})=>{t.ledgerLogin=e},!1,{type:"setLedgerLogin",payload:{value:e}}),xe=e=>o().setState(({loginInfo:t})=>{t.isWalletConnectV2Initialized=e},!1,{type:"setIsWalletConnectV2Initialized",payload:{value:e}}),E=()=>o().setState(({loginInfo:e})=>{e.loginExpiresAt=null},!1,{type:"removeLoginExpiresAt",payload:{value:null}}),b=e=>o().setState(({loginInfo:t})=>{t.loginExpiresAt=e},!1,{type:"addLoginExpiresAt",payload:{value:e}});export{me as a,fe as b,Se as c,ue as d,de as e,ye as f,xe as g,E as h,b as i,A as j,H as k,w as l,C as m,W as n,z as o,D as p,o as q,le as r,se as s};
2
+ //# sourceMappingURL=chunk-4NFQOHJB.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-TRIWGK3U.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-3TS5K6ZA.mjs.map
1
+ import{a as e}from"./chunk-2FA2VSIL.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-6IUB2VJE.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as ce}from"./chunk-M3YL36ZL.mjs";import{a as A}from"./chunk-OLQHWVIS.mjs";import{a as ae}from"./chunk-2Y66XRQK.mjs";import{a as oe}from"./chunk-VMRTQJQQ.mjs";import{a as R}from"./chunk-J6JGLSU3.mjs";import{a as ne}from"./chunk-6T2LXDEP.mjs";import{a as ie}from"./chunk-EEFPWMB3.mjs";import{a as te}from"./chunk-YUFPUG5O.mjs";import{a as de}from"./chunk-L7LGSTVP.mjs";import{a as p}from"./chunk-U3GR2SVT.mjs";import{a as re}from"./chunk-OEH2DV7C.mjs";import{a as S}from"./chunk-VFUYYYKF.mjs";import{a as se}from"./chunk-7S2Y4LHL.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-GJXPULYJ.mjs";import{a as y}from"./chunk-SXOH2YD4.mjs";import{a as X}from"./chunk-TIQSGLWX.mjs";import{a as N}from"./chunk-4TBVQD27.mjs";import{a as Q}from"./chunk-WQMYGZGV.mjs";import{g as Y}from"./chunk-M6MN4RXG.mjs";import{a as q,q as F,s as c}from"./chunk-7WYMH2Y5.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-JAWHG5QV.mjs.map
1
+ import{a as ce}from"./chunk-M3YL36ZL.mjs";import{a as A}from"./chunk-JMVSZCEJ.mjs";import{a as ae}from"./chunk-2Y66XRQK.mjs";import{a as oe}from"./chunk-GSOOKRYL.mjs";import{a as R}from"./chunk-GGTCBFGO.mjs";import{a as ne}from"./chunk-PF4ZP4KB.mjs";import{a as ie}from"./chunk-JDWI44AR.mjs";import{a as te}from"./chunk-YUFPUG5O.mjs";import{a as de}from"./chunk-3WPEA75B.mjs";import{a as p}from"./chunk-2VMUFNMX.mjs";import{a as re}from"./chunk-D2OWJGPT.mjs";import{a as S}from"./chunk-FMF4SRBX.mjs";import{a as se}from"./chunk-YYBPMJO2.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-P7JHVK7R.mjs";import{a as y}from"./chunk-KUX63OMO.mjs";import{a as X}from"./chunk-YDSNQ7O5.mjs";import{a as N}from"./chunk-4TBVQD27.mjs";import{a as Q}from"./chunk-J5WUQE3J.mjs";import{g as Y}from"./chunk-M6MN4RXG.mjs";import{a as q,q as F,s as c}from"./chunk-4NFQOHJB.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-6JZSN2DY.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-UZHVWIUR.mjs";import{b as r}from"./chunk-LSFKZEDF.mjs";import{s as i}from"./chunk-7WYMH2Y5.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-4QRIFJFV.mjs.map
1
+ import{a as n}from"./chunk-EBCOUXQJ.mjs";import{b as r}from"./chunk-CSJ2ZPSM.mjs";import{s as i}from"./chunk-4NFQOHJB.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-7LCYFHXY.mjs.map
@@ -0,0 +1,2 @@
1
+ import{s as o}from"./chunk-4NFQOHJB.mjs";import{a as t}from"./chunk-7VHTZYM2.mjs";function f(r=o()){return t(r)}export{f as a};
2
+ //# sourceMappingURL=chunk-7TKH6H7B.mjs.map
@@ -0,0 +1,2 @@
1
+ import{s as o}from"./chunk-4NFQOHJB.mjs";import{a as t}from"./chunk-UERJ6AKK.mjs";function n(r=o()){return t(r)}export{n as a};
2
+ //# sourceMappingURL=chunk-AETYCRSD.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-EMIDMARK.mjs";import{q as e}from"./chunk-4NFQOHJB.mjs";var m=()=>t(e());export{m as a};
2
+ //# sourceMappingURL=chunk-BAN77GZH.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-A6QJ4XG2.mjs";import{a as g}from"./chunk-JQD5FQP7.mjs";import{a as I}from"./chunk-LFOBVMPR.mjs";import{a as S}from"./chunk-4MWQKLVG.mjs";import{s as l}from"./chunk-7WYMH2Y5.mjs";import{c as T}from"./chunk-UERJ6AKK.mjs";import{d as h,f as d,g as f}from"./chunk-7VHTZYM2.mjs";var y=t=>t.sort((o,a)=>a.timestamp-o.timestamp),B=async({transactions:t,skipFetchingTransactions:o=!1,store:a=l()})=>{let i=[],r=[];if(t.forEach(s=>{let e=I(s.hash,a);e?i.push(e):r.push(s.hash)}),r.length===0)return y(i);let c=o?t.map(s=>({...s,txHash:s.hash})):await u(r,{apiAddress:h(a)}),v=c.map(s=>s.txHash),p=r.filter(s=>!v.includes(s));if(p.length>0){let e=t.filter(n=>p.includes(n.hash)).map(n=>({...n,txHash:n.hash,price:0,status:"pending",gasUsed:0,miniBlockHash:"",receiverShard:0,round:0,senderShard:0,timestamp:Date.now()}));c.push(...e)}let m=new Map;return i.forEach(s=>{let e=s.hash;e&&m.set(String(e),s)}),c.forEach(s=>{let e=S({transaction:s,address:T(a),explorerAddress:f(a),egldLabel:d(a)});e.status!=="pending"&&g({key:`transaction-${s.txHash}`,value:e}),m.set(s.txHash,e)}),y(Array.from(m.values()))};export{B as a};
2
- //# sourceMappingURL=chunk-4WAWOE33.mjs.map
1
+ import{a as u}from"./chunk-JMQAWP2A.mjs";import{a as g}from"./chunk-CXS3EVQG.mjs";import{a as I}from"./chunk-MGEPZOGU.mjs";import{a as S}from"./chunk-4MWQKLVG.mjs";import{s as l}from"./chunk-4NFQOHJB.mjs";import{c as T}from"./chunk-UERJ6AKK.mjs";import{d as h,f as d,g as f}from"./chunk-7VHTZYM2.mjs";var y=t=>t.sort((o,a)=>a.timestamp-o.timestamp),B=async({transactions:t,skipFetchingTransactions:o=!1,store:a=l()})=>{let i=[],r=[];if(t.forEach(s=>{let e=I(s.hash,a);e?i.push(e):r.push(s.hash)}),r.length===0)return y(i);let c=o?t.map(s=>({...s,txHash:s.hash})):await u(r,{apiAddress:h(a)}),v=c.map(s=>s.txHash),p=r.filter(s=>!v.includes(s));if(p.length>0){let e=t.filter(n=>p.includes(n.hash)).map(n=>({...n,txHash:n.hash,price:0,status:"pending",gasUsed:0,miniBlockHash:"",receiverShard:0,round:0,senderShard:0,timestamp:Date.now()}));c.push(...e)}let m=new Map;return i.forEach(s=>{let e=s.hash;e&&m.set(String(e),s)}),c.forEach(s=>{let e=S({transaction:s,address:T(a),explorerAddress:f(a),egldLabel:d(a)});e.status!=="pending"&&g({key:`transaction-${s.txHash}`,value:e}),m.set(s.txHash,e)}),y(Array.from(m.values()))};export{B as a};
2
+ //# sourceMappingURL=chunk-BY5PRWXE.mjs.map
@@ -1,2 +1,2 @@
1
- import{s as e}from"./chunk-7WYMH2Y5.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-Y6ONT26X.mjs.map
1
+ import{s as e}from"./chunk-4NFQOHJB.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-BZXWSLY4.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-D6T322RK.mjs";var t={closeConnectionRef:void 0};async function c(n){let{closeConnection:o}=await e(n);t.closeConnectionRef=o}export{t as a,c as b};
2
- //# sourceMappingURL=chunk-FLIHXJC6.mjs.map
1
+ import{a as e}from"./chunk-HT5WRDXC.mjs";var t={closeConnectionRef:void 0};async function c(n){let{closeConnection:o}=await e(n);t.closeConnectionRef=o}export{t as a,c as b};
2
+ //# sourceMappingURL=chunk-C54QJLN3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-LOCBYCTW.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-GX6HPAJJ.mjs.map
1
+ import{a as s}from"./chunk-IMCTSHZ3.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-CC7AVJJE.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-7WYMH2Y5.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-LSFKZEDF.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-4NFQOHJB.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-CSJ2ZPSM.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-DLWDO7M6.mjs";import{d as v}from"./chunk-6JZSN2DY.mjs";import{w as m}from"./chunk-P7JHVK7R.mjs";import{s as n}from"./chunk-4NFQOHJB.mjs";import{d as s}from"./chunk-VNLGNNIL.mjs";import{a as i}from"./chunk-LJX4MW7B.mjs";import{a as p}from"./chunk-EEWPENKM.mjs";async function g(){let t=a(),d=p(),r=s(n()),e=d||t?i.webview:r,c=Object.values(i).includes(r);if(r&&!c&&(e=r),!e)return;let o=await v.create({type:e});if(!o)throw new Error("Provider not found");(t||e===i.webview&&o.isInitialized())&&await o.login(),m(o)}export{g as a};
2
+ //# sourceMappingURL=chunk-CTQ7LOUJ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/providers/helpers/restoreProvider.ts"],
4
+ "sourcesContent": ["import { isMobileWebview } from 'lib/sdkWebviewProvider';\nimport {\n ProviderBaseType,\n ProviderTypeEnum\n} from 'providers/types/providerFactory.types';\nimport { providerTypeSelector } from 'store/selectors';\nimport { getState } from 'store/store';\nimport { getIsInIframe } from 'utils/window/getIsInIframe';\nimport { setAccountProvider } from './accountProvider';\nimport { ProviderFactory } from '../ProviderFactory';\n\nexport async function restoreProvider() {\n const isMobileView = isMobileWebview();\n const isInIframe = getIsInIframe();\n const providerType = providerTypeSelector(getState());\n\n let type =\n isInIframe || isMobileView ? ProviderTypeEnum.webview : providerType;\n\n const isBaseProvider = Object.values(ProviderTypeEnum).includes(\n providerType as ProviderBaseType\n );\n // Check if provider exist and is not base\n const isCustomProvider = providerType && !isBaseProvider;\n\n // Prioritize customProvider if it serves as a provider inside an iframe\n if (isCustomProvider) {\n type = providerType;\n }\n\n if (!type) {\n return;\n }\n\n const provider = await ProviderFactory.create({\n type\n });\n\n if (!provider) {\n throw new Error('Provider not found');\n }\n\n /*\n Check if the app is running in webview and the provider is already initialized.\n - true: the app is embedded within another dApp (e.g., inside an iframe) and perform login using the provider.\n - false: the parent is not a dApp and proceed with initializing the current app as a standalone iframe.\n */\n if (\n isMobileView ||\n (type === ProviderTypeEnum.webview && provider.isInitialized())\n ) {\n await provider.login();\n }\n\n setAccountProvider(provider);\n}\n"],
5
+ "mappings": "0RAWA,eAAsBA,GAAkB,CACtC,IAAMC,EAAeC,EAAgB,EAC/BC,EAAaC,EAAc,EAC3BC,EAAeC,EAAqBC,EAAS,CAAC,EAEhDC,EACFL,GAAcF,EAAeQ,EAAiB,QAAUJ,EAEpDK,EAAiB,OAAO,OAAOD,CAAgB,EAAE,SACrDJ,CACF,EASA,GAPyBA,GAAgB,CAACK,IAIxCF,EAAOH,GAGL,CAACG,EACH,OAGF,IAAMG,EAAW,MAAMC,EAAgB,OAAO,CAC5C,KAAAJ,CACF,CAAC,EAED,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,oBAAoB,GASpCV,GACCO,IAASC,EAAiB,SAAWE,EAAS,cAAc,IAE7D,MAAMA,EAAS,MAAM,EAGvBE,EAAmBF,CAAQ,CAC7B",
6
+ "names": ["restoreProvider", "isMobileView", "isMobileWebview", "isInIframe", "getIsInIframe", "providerType", "providerTypeSelector", "getState", "type", "ProviderTypeEnum", "isBaseProvider", "provider", "ProviderFactory", "setAccountProvider"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-TRIWGK3U.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-V6TPJKNA.mjs.map
1
+ import{a as t}from"./chunk-2FA2VSIL.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-CWZGACL2.mjs.map
@@ -1,2 +1,2 @@
1
- import{q as t}from"./chunk-7WYMH2Y5.mjs";var r=({key:e,value:a})=>{t().setState(({cache:c})=>{c[e]=a},!1,{type:"saveToCache",payload:{value:a}})},s=e=>{t().setState(({cache:a})=>{delete a[e]},!1,{type:"removeFromCache",payload:{value:e}})},h=()=>{t().setState(({cache:e})=>{Object.keys(e).forEach(a=>{delete e[a]})},!1,"clearCache")};export{r as a,s as b,h as c};
2
- //# sourceMappingURL=chunk-JQD5FQP7.mjs.map
1
+ import{q as t}from"./chunk-4NFQOHJB.mjs";var r=({key:e,value:a})=>{t().setState(({cache:c})=>{c[e]=a},!1,{type:"saveToCache",payload:{value:a}})},s=e=>{t().setState(({cache:a})=>{delete a[e]},!1,{type:"removeFromCache",payload:{value:e}})},h=()=>{t().setState(({cache:e})=>{Object.keys(e).forEach(a=>{delete e[a]})},!1,"clearCache")};export{r as a,s as b,h as c};
2
+ //# sourceMappingURL=chunk-CXS3EVQG.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-PKSNXCV4.mjs";async function i(a){let n=e.getInstance();return await n.openUI(),{manager:n,onClose:async({shouldCancelAction:t=!0}={})=>{n.closeUI(),t&&a?.cancelAction&&await a.cancelAction()}}}export{i as a};
2
- //# sourceMappingURL=chunk-OEH2DV7C.mjs.map
1
+ import{a as e}from"./chunk-PRMKM6DW.mjs";async function i(a){let n=e.getInstance();return await n.openUI(),{manager:n,onClose:async({shouldCancelAction:t=!0}={})=>{n.closeUI(),t&&a?.cancelAction&&await a.cancelAction()}}}export{i as a};
2
+ //# sourceMappingURL=chunk-D2OWJGPT.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-H4DVQ62L.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-UZHVWIUR.mjs.map
1
+ import{a as e}from"./chunk-PZBHKR5U.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-EBCOUXQJ.mjs.map
@@ -1,2 +1,2 @@
1
- import{q as o}from"./chunk-7WYMH2Y5.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-PWCNMKNB.mjs.map
1
+ import{q as o}from"./chunk-4NFQOHJB.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-EBTTOSHF.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-3TS5K6ZA.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-IW4DEEHC.mjs.map
1
+ import{a as e}from"./chunk-6IUB2VJE.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-EEWPENKM.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as O}from"./chunk-GX6HPAJJ.mjs";import{a as k}from"./chunk-7GBXWZAI.mjs";import{a as B}from"./chunk-HT2FAOH3.mjs";import{a as b}from"./chunk-FPOYB42M.mjs";import{a as A}from"./chunk-QXC4D3AC.mjs";import{a as D}from"./chunk-K57S4IEN.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as _}from"./chunk-7S2Y4LHL.mjs";import{a as R}from"./chunk-K373M2BG.mjs";import{a as j}from"./chunk-URJQWHBM.mjs";import{s as x}from"./chunk-7WYMH2Y5.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-VFUYYYKF.mjs.map
1
+ import{a as O}from"./chunk-CC7AVJJE.mjs";import{a as k}from"./chunk-YI2JUPHR.mjs";import{a as B}from"./chunk-K4D34YGX.mjs";import{a as b}from"./chunk-K7DSLRNG.mjs";import{a as A}from"./chunk-QXC4D3AC.mjs";import{a as D}from"./chunk-MQB7SEFO.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as _}from"./chunk-YYBPMJO2.mjs";import{a as R}from"./chunk-K373M2BG.mjs";import{a as j}from"./chunk-URJQWHBM.mjs";import{s as x}from"./chunk-4NFQOHJB.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-FMF4SRBX.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-7WYMH2Y5.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-2YOQ53JR.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-4NFQOHJB.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-FVWPUUST.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-FREDJUGU.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-J6JGLSU3.mjs.map
1
+ import{a as i}from"./chunk-H3BL4VM5.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-GGTCBFGO.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-NOSCTAHA.mjs";import{c as n}from"./chunk-4NFQOHJB.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-GLBPOFS4.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as A}from"./chunk-J6JGLSU3.mjs";import{a as s}from"./chunk-WH6I35RW.mjs";import{a as h}from"./chunk-B2RDSGON.mjs";import{a as k}from"./chunk-NU34PSWD.mjs";import{b as L}from"./chunk-PWCNMKNB.mjs";import{a as I}from"./chunk-BRJNX4JF.mjs";import{f as p}from"./chunk-7WYMH2Y5.mjs";import{a as f}from"./chunk-KD2IQ32V.mjs";import{a as x}from"./chunk-LJX4MW7B.mjs";import{BigNumber as C}from"bignumber.js";async function M({options:d,config:i,provider:a,login:c}){let e=A.getInstance(),T=k(),b=h({loginToken:d?.token,version:i.version}),o={manager:e,provider:a};await s(o);let t=await new Promise(async function(E,w){async function g(r){let n=e?e.addressesPerPage??1:1,l=new C(r-1).times(n);e?.updateStartIndex(Math.max(0,parseInt(l.toString()))),await s(o)}async function u(r){if(!(!a||!c)){e?.updateConfirmScreen({...b,selectedAddress:r.selectedAddress,explorerLink:I({to:`/${f}/${r.selectedAddress}`,explorerAddress:T})});try{let n=d?.token?await a.tokenLogin({token:Buffer.from(`${d?.token}{}`),addressIndex:r.addressIndex}):await c({addressIndex:r.addressIndex});E({address:n.address,signature:n.signature?n.signature.toString("hex"):"",addressIndex:r.addressIndex})}catch(n){console.error("User rejected login:",n),!!e?.getConfirmScreenData()&&await s(o)}}}async function m(){await s(o),e.unsubscribeFromAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g}),w("User cancelled login")}e.subscribeToAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g})}),{version:P,dataEnabled:v}=i;return p({index:t.addressIndex,loginType:x.ledger}),L({address:t.address,index:t.addressIndex,version:P,hasContractDataEnabled:v}),{address:t.address,signature:t.signature}}export{M as a};
2
- //# sourceMappingURL=chunk-VMRTQJQQ.mjs.map
1
+ import{a as A}from"./chunk-GGTCBFGO.mjs";import{a as s}from"./chunk-KIMKIACD.mjs";import{a as h}from"./chunk-B2RDSGON.mjs";import{a as k}from"./chunk-YUHQQNRS.mjs";import{b as L}from"./chunk-EBTTOSHF.mjs";import{a as I}from"./chunk-BRJNX4JF.mjs";import{f as p}from"./chunk-4NFQOHJB.mjs";import{a as f}from"./chunk-KD2IQ32V.mjs";import{a as x}from"./chunk-LJX4MW7B.mjs";import{BigNumber as C}from"bignumber.js";async function M({options:d,config:i,provider:a,login:c}){let e=A.getInstance(),T=k(),b=h({loginToken:d?.token,version:i.version}),o={manager:e,provider:a};await s(o);let t=await new Promise(async function(E,w){async function g(r){let n=e?e.addressesPerPage??1:1,l=new C(r-1).times(n);e?.updateStartIndex(Math.max(0,parseInt(l.toString()))),await s(o)}async function u(r){if(!(!a||!c)){e?.updateConfirmScreen({...b,selectedAddress:r.selectedAddress,explorerLink:I({to:`/${f}/${r.selectedAddress}`,explorerAddress:T})});try{let n=d?.token?await a.tokenLogin({token:Buffer.from(`${d?.token}{}`),addressIndex:r.addressIndex}):await c({addressIndex:r.addressIndex});E({address:n.address,signature:n.signature?n.signature.toString("hex"):"",addressIndex:r.addressIndex})}catch(n){console.error("User rejected login:",n),!!e?.getConfirmScreenData()&&await s(o)}}}async function m(){await s(o),e.unsubscribeFromAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g}),w("User cancelled login")}e.subscribeToAuthEvents({handleCancel:m,handleAccessWallet:u,handleGoToPage:g})}),{version:P,dataEnabled:v}=i;return p({index:t.addressIndex,loginType:x.ledger}),L({address:t.address,index:t.addressIndex,version:P,hasContractDataEnabled:v}),{address:t.address,signature:t.signature}}export{M as a};
2
+ //# sourceMappingURL=chunk-GSOOKRYL.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-V6TPJKNA.mjs";var a=class{constructor({uiDataUpdateEvent:t,uiTag:e}){this.eventBus=null;this.uiElement=null;this.isCreatingElement=!1;this.unsubscribeFunctions=new Map;this.uiDataUpdateEvent=t,this.uiTag=e,this.data=this.getInitialData()}async init(t){this.anchor=t,await this.createUIElement(t),await this.setupEventListeners()}updateData(t){this.data={...this.data,...t},this.notifyDataUpdate()}subscribeToEventBus(t,e){if(!this.eventBus)throw new Error("eventBus is not initialized");let i=this.eventBus?.subscribe(t,e);if(i){let n=this.unsubscribeFunctions.get(t)||[];n.push(i),this.unsubscribeFunctions.set(t,n)}}notifyDataUpdate(){this.eventBus?.publish(this.uiDataUpdateEvent,this.data)}destroy(){this.unsubscribeFunctions.forEach(t=>t.forEach(e=>e())),this.unsubscribeFunctions.clear(),this.eventBus=null,this.uiElement?.remove?.(),this.uiElement=null}getInitialData(){return this.initialData}resetData(){this.data=this.getInitialData()}async createUIElement(t=this.anchor){if(this.isCreatingElement||this.uiElement)return this.uiElement;if(this.isCreatingElement=!0,this.uiElement=await s.create({name:this.uiTag,anchor:t}),this.isCreatingElement=!1,!this.uiElement)throw new Error(`Failed to create ${this.uiTag} element`);if(this.eventBus||(this.eventBus=await this.uiElement.getEventBus()),!this.eventBus)throw new Error("eventBus is not initialized");return this.uiElement}};export{a};
2
- //# sourceMappingURL=chunk-FREDJUGU.mjs.map
1
+ import{a as s}from"./chunk-CWZGACL2.mjs";var a=class{constructor({uiDataUpdateEvent:t,uiTag:e}){this.eventBus=null;this.uiElement=null;this.isCreatingElement=!1;this.unsubscribeFunctions=new Map;this.uiDataUpdateEvent=t,this.uiTag=e,this.data=this.getInitialData()}async init(t){this.anchor=t,await this.createUIElement(t),await this.setupEventListeners()}updateData(t){this.data={...this.data,...t},this.notifyDataUpdate()}subscribeToEventBus(t,e){if(!this.eventBus)throw new Error("eventBus is not initialized");let i=this.eventBus?.subscribe(t,e);if(i){let n=this.unsubscribeFunctions.get(t)||[];n.push(i),this.unsubscribeFunctions.set(t,n)}}notifyDataUpdate(){this.eventBus?.publish(this.uiDataUpdateEvent,this.data)}destroy(){this.unsubscribeFunctions.forEach(t=>t.forEach(e=>e())),this.unsubscribeFunctions.clear(),this.eventBus=null,this.uiElement?.remove?.(),this.uiElement=null}getInitialData(){return this.initialData}resetData(){this.data=this.getInitialData()}async createUIElement(t=this.anchor){if(this.isCreatingElement||this.uiElement)return this.uiElement;if(this.isCreatingElement=!0,this.uiElement=await s.create({name:this.uiTag,anchor:t}),this.isCreatingElement=!1,!this.uiElement)throw new Error(`Failed to create ${this.uiTag} element`);if(this.eventBus||(this.eventBus=await this.uiElement.getEventBus()),!this.eventBus)throw new Error("eventBus is not initialized");return this.uiElement}};export{a};
2
+ //# sourceMappingURL=chunk-H3BL4VM5.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-A6QJ4XG2.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-EPFU7G25.mjs.map
1
+ import{a as e}from"./chunk-JMQAWP2A.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-HOBNVAOB.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as T}from"./chunk-Q2Q4XN4M.mjs";import{b as u}from"./chunk-6T23W57Y.mjs";import{d as m,e as l}from"./chunk-PWCNMKNB.mjs";import{q as a}from"./chunk-7WYMH2Y5.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-D6T322RK.mjs.map
1
+ import{a as T}from"./chunk-Q2Q4XN4M.mjs";import{b as u}from"./chunk-J3VN77UR.mjs";import{d as m,e as l}from"./chunk-EBTTOSHF.mjs";import{q as a}from"./chunk-4NFQOHJB.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-HT5WRDXC.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-FREDJUGU.mjs";import{a as t}from"./chunk-7FTEFM3G.mjs";var i=class extends n{constructor({uiDataUpdateEvent:e,uiTag:s}){super({uiDataUpdateEvent:e,uiTag:s});this.isOpen=!1;this.data=this.getInitialData()}async openUI(){this.isOpen&&this.uiElement||(await super.init(),this.setIsSidePanelOpen(!0))}destroy(){if(this.setIsSidePanelOpen(!1),this.uiElement?.closeWithAnimation){this.uiElement?.closeWithAnimation?.().finally(()=>{super.destroy()});return}super.destroy()}closeUI(){this.resetData(),this.destroy()}setIsSidePanelOpen(e){this.isOpen=e,t(e)}};export{i as a};
2
- //# sourceMappingURL=chunk-LOCBYCTW.mjs.map
1
+ import{a as n}from"./chunk-H3BL4VM5.mjs";import{a as t}from"./chunk-YRVXOPCA.mjs";var i=class extends n{constructor({uiDataUpdateEvent:e,uiTag:s}){super({uiDataUpdateEvent:e,uiTag:s});this.isOpen=!1;this.data=this.getInitialData()}async openUI(){this.isOpen&&this.uiElement||(await super.init(),this.setIsSidePanelOpen(!0))}destroy(){if(this.setIsSidePanelOpen(!1),this.uiElement?.closeWithAnimation){this.uiElement?.closeWithAnimation?.().finally(()=>{super.destroy()});return}super.destroy()}closeUI(){this.resetData(),this.destroy()}setIsSidePanelOpen(e){this.isOpen=e,t(e)}};export{i as a};
2
+ //# sourceMappingURL=chunk-IMCTSHZ3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-TRIWGK3U.mjs";import{MvxLedgerConnect as r}from"@multiversx/sdk-dapp-ui/web-components/mvx-ledger-connect";async function i(n){if(!(typeof t.navigator<"u"&&t.navigator.product==="ReactNative"))try{(await import("@multiversx/sdk-dapp-ui")).defineCustomElements(n)}catch(e){console.warn("@multiversx/sdk-dapp-ui not found"+e)}}export{i as a,r as b};
2
- //# sourceMappingURL=chunk-RJRYSDHS.mjs.map
1
+ import{a as t}from"./chunk-2FA2VSIL.mjs";import{MvxLedgerConnect as r}from"@multiversx/sdk-dapp-ui/web-components/mvx-ledger-connect";async function i(n){if(!(typeof t.navigator<"u"&&t.navigator.product==="ReactNative"))try{(await import("@multiversx/sdk-dapp-ui")).defineCustomElements(n)}catch(e){console.warn("@multiversx/sdk-dapp-ui not found"+e)}}export{i as a,r as b};
2
+ //# sourceMappingURL=chunk-IRULUA7A.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-4TBVQD27.mjs";import{q as o}from"./chunk-7WYMH2Y5.mjs";var C=t=>o().setState(({config:e})=>{e.nativeAuthConfig=t},!1,{type:"setNativeAuthConfig",payload:{value:t}}),c=t=>o().setState(({config:e})=>{e.websocketStatus=t},!1,{type:"setWebsocketStatus",payload:{value:t}}),f=t=>o().setState(({config:e})=>{let a=t.walletConnectV2RelayAddress||n.walletConnectV2RelayAddress,l=t.walletConnectDeepLink||n.walletConnectDeepLink;e.walletConnectConfig={...t,walletConnectDeepLink:l,walletConnectV2RelayAddress:a}},!1,{type:"setWalletConnectConfig",payload:{value:t}});export{C as a,c as b,f as c};
2
- //# sourceMappingURL=chunk-6T23W57Y.mjs.map
1
+ import{a as n}from"./chunk-4TBVQD27.mjs";import{q as o}from"./chunk-4NFQOHJB.mjs";var C=t=>o().setState(({config:e})=>{e.nativeAuthConfig=t},!1,{type:"setNativeAuthConfig",payload:{value:t}}),c=t=>o().setState(({config:e})=>{e.websocketStatus=t},!1,{type:"setWebsocketStatus",payload:{value:t}}),f=t=>o().setState(({config:e})=>{let a=t.walletConnectV2RelayAddress||n.walletConnectV2RelayAddress,l=t.walletConnectDeepLink||n.walletConnectDeepLink;e.walletConnectConfig={...t,walletConnectDeepLink:l,walletConnectV2RelayAddress:a}},!1,{type:"setWalletConnectConfig",payload:{value:t}});export{C as a,c as b,f as c};
2
+ //# sourceMappingURL=chunk-J3VN77UR.mjs.map
@@ -1,2 +1,2 @@
1
- import{j as n,q as o}from"./chunk-7WYMH2Y5.mjs";import{c as p}from"./chunk-NTEMINYA.mjs";var s=()=>o().setState(n),l=({address:e,providerType:t})=>{o().setState(({account:r,loginInfo:i})=>{r.address=e,r.publicKey=new p(e).toHex(),i&&(i.providerType=t)},!1,{type:"loginAction",payload:{value:{address:e,providerType:t}}})};export{s as a,l as b};
2
- //# sourceMappingURL=chunk-WQMYGZGV.mjs.map
1
+ import{j as n,q as o}from"./chunk-4NFQOHJB.mjs";import{c as p}from"./chunk-NTEMINYA.mjs";var s=()=>o().setState(n),l=({address:e,providerType:t})=>{o().setState(({account:r,loginInfo:i})=>{r.address=e,r.publicKey=new p(e).toHex(),i&&(i.providerType=t)},!1,{type:"loginAction",payload:{value:{address:e,providerType:t}}})};export{s as a,l as b};
2
+ //# sourceMappingURL=chunk-J5WUQE3J.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as f}from"./chunk-FRDR4A7Z.mjs";import{x as g}from"./chunk-GJXPULYJ.mjs";import{a as c}from"./chunk-SXOH2YD4.mjs";import{s as n}from"./chunk-7WYMH2Y5.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-EEFPWMB3.mjs.map
1
+ import{a as f}from"./chunk-FRDR4A7Z.mjs";import{x as g}from"./chunk-P7JHVK7R.mjs";import{a as c}from"./chunk-KUX63OMO.mjs";import{s as n}from"./chunk-4NFQOHJB.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-JDWI44AR.mjs.map
@@ -1,2 +1,2 @@
1
- import{s as t}from"./chunk-7WYMH2Y5.mjs";import{d as e}from"./chunk-7VHTZYM2.mjs";import{x as r}from"./chunk-KD2IQ32V.mjs";import i from"axios";var c=async(s,a={apiAddress:""})=>{let{data:o}=await i.get(`${a.apiAddress||e(t())}/${r}`,{params:{hashes:s.join(","),withScResults:!0}});return o};export{c as a};
2
- //# sourceMappingURL=chunk-A6QJ4XG2.mjs.map
1
+ import{s as t}from"./chunk-4NFQOHJB.mjs";import{d as e}from"./chunk-7VHTZYM2.mjs";import{x as r}from"./chunk-KD2IQ32V.mjs";import i from"axios";var c=async(s,a={apiAddress:""})=>{let{data:o}=await i.get(`${a.apiAddress||e(t())}/${r}`,{params:{hashes:s.join(","),withScResults:!0}});return o};export{c as a};
2
+ //# sourceMappingURL=chunk-JMQAWP2A.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-FREDJUGU.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-OLQHWVIS.mjs.map
1
+ import{a as e}from"./chunk-H3BL4VM5.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-JMVSZCEJ.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-NHDCY4TW.mjs";var o={async getTransactionsHistory(s){return await t(s)}};export{o as a};
2
+ //# sourceMappingURL=chunk-JNF2WNVQ.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as i}from"./chunk-TLNZ26DM.mjs";import{a as e}from"./chunk-KDWLSBQB.mjs";import{b as o}from"./chunk-RV3QLH3M.mjs";import{j as r}from"./chunk-E2GGD7D4.mjs";import{q as a}from"./chunk-4NFQOHJB.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-JNJEFJLG.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as r,c as i}from"./chunk-QJGFIK7H.mjs";import{x as g}from"./chunk-GJXPULYJ.mjs";import{q as M}from"./chunk-7WYMH2Y5.mjs";import{a as d}from"./chunk-UERJ6AKK.mjs";import{a as u,c as l,g as c}from"./chunk-NTEMINYA.mjs";import{a as p}from"./chunk-TRIWGK3U.mjs";var m=class{constructor({onLoginCancelled:e}){this.handlers=new Map;this.store=M();this.isLoginInitiated=!1;this.handleMessage=this.handleMessage.bind(this),this.handleLoginCancelled=e}startListening(){p.addEventListener("message",this.handleMessage)}stopListening(){p.removeEventListener("message",this.handleMessage)}registerEvent(e,s){this.handlers.set(e,s)}unregisterEvent(e){this.handlers.delete(e)}async handleMessage(e){let s=e.data?.type;if(console.log("WebviewClient",s),typeof s=="string"&&this.handlers.has(s))return this.handlers.get(s)?.(e);switch(s){case r.finalizeHandshakeRequest:this.handshake({event:e});break;case r.signMessageRequest:this.signMessage({event:e,payload:e.data.payload});break;case r.loginRequest:this.isLoginInitiated=!0,this.login({event:e,payload:e.data.payload});break;case r.signTransactionsRequest:this.signTransactions({event:e});break;case i.cancelResponse:case"cancelAction":this.isLoginInitiated&&await this.handleLoginCancelled();break;default:break}}async login({event:e,payload:s}){let a=s?.token;if(a)try{let{address:t}=d(this.store.getState()),o=g(),n=`${t}${a}`,y=new c({address:new l(t),data:new Uint8Array(Buffer.from(n))}),f=(await o.signMessage(y))?.signature??"";e.source?.postMessage({type:i.loginResponse,payload:{data:{address:t,signature:Buffer.from(f).toString("hex")}}},{targetOrigin:e.origin})}catch{this.isLoginInitiated&&this.handleLoginCancelled()}finally{this.isLoginInitiated=!1}}handshake({event:e}){let s=Date.now().toString();console.log({handshakeSession:s}),e.source?.postMessage({type:i.finalizeHandshakeResponse,payload:{data:s}},{targetOrigin:e.origin})}async signMessage({event:e,payload:s}){let{address:a}=d(this.store.getState()),{message:t}=s;try{let o=new c({address:new l(a),data:new Uint8Array(Buffer.from(t))}),h=(await g().signMessage(o))?.signature??"";e.source?.postMessage({type:i.signMessageResponse,payload:{data:{signature:Buffer.from(h).toString("hex"),status:"signed"}}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign message")}}async signTransactions({event:e}){let s=g(),{payload:a}=e.data;if(Array.isArray(a))try{let t=a.map(n=>u.newFromPlainObject(n)),o=await s.signTransactions(t);e.source?.postMessage({type:i.signTransactionsResponse,payload:{data:o.map(n=>n.toPlainObject())}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign transactions")}}};export{m as a};
2
- //# sourceMappingURL=chunk-MQIVKPYU.mjs.map
1
+ import{b as r,c as i}from"./chunk-QJGFIK7H.mjs";import{x as g}from"./chunk-P7JHVK7R.mjs";import{q as M}from"./chunk-4NFQOHJB.mjs";import{a as d}from"./chunk-UERJ6AKK.mjs";import{a as u,c as l,g as c}from"./chunk-NTEMINYA.mjs";import{a as p}from"./chunk-2FA2VSIL.mjs";var m=class{constructor({onLoginCancelled:e}){this.handlers=new Map;this.store=M();this.isLoginInitiated=!1;this.handleMessage=this.handleMessage.bind(this),this.handleLoginCancelled=e}startListening(){p.addEventListener("message",this.handleMessage)}stopListening(){p.removeEventListener("message",this.handleMessage)}registerEvent(e,s){this.handlers.set(e,s)}unregisterEvent(e){this.handlers.delete(e)}async handleMessage(e){let s=e.data?.type;if(console.log("WebviewClient",s),typeof s=="string"&&this.handlers.has(s))return this.handlers.get(s)?.(e);switch(s){case r.finalizeHandshakeRequest:this.handshake({event:e});break;case r.signMessageRequest:this.signMessage({event:e,payload:e.data.payload});break;case r.loginRequest:this.isLoginInitiated=!0,this.login({event:e,payload:e.data.payload});break;case r.signTransactionsRequest:this.signTransactions({event:e});break;case i.cancelResponse:case"cancelAction":this.isLoginInitiated&&await this.handleLoginCancelled();break;default:break}}async login({event:e,payload:s}){let a=s?.token;if(a)try{let{address:t}=d(this.store.getState()),o=g(),n=`${t}${a}`,y=new c({address:new l(t),data:new Uint8Array(Buffer.from(n))}),f=(await o.signMessage(y))?.signature??"";e.source?.postMessage({type:i.loginResponse,payload:{data:{address:t,signature:Buffer.from(f).toString("hex")}}},{targetOrigin:e.origin})}catch{this.isLoginInitiated&&this.handleLoginCancelled()}finally{this.isLoginInitiated=!1}}handshake({event:e}){let s=Date.now().toString();e.source?.postMessage({type:i.finalizeHandshakeResponse,payload:{data:s}},{targetOrigin:e.origin})}async signMessage({event:e,payload:s}){let{address:a}=d(this.store.getState()),{message:t}=s;try{let o=new c({address:new l(a),data:new Uint8Array(Buffer.from(t))}),h=(await g().signMessage(o))?.signature??"";e.source?.postMessage({type:i.signMessageResponse,payload:{data:{signature:Buffer.from(h).toString("hex"),status:"signed"}}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign message")}}async signTransactions({event:e}){let s=g(),{payload:a}=e.data;if(Array.isArray(a))try{let t=a.map(n=>u.newFromPlainObject(n)),o=await s.signTransactions(t);e.source?.postMessage({type:i.signTransactionsResponse,payload:{data:o.map(n=>n.toPlainObject())}},{targetOrigin:e.origin})}catch{throw new Error("Could not sign transactions")}}};export{m as a};
2
+ //# sourceMappingURL=chunk-JXZNKTQD.mjs.map