@multiversx/sdk-dapp 5.2.12 → 5.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. package/out/__chunks__/chunk-27GL7FOR.mjs +2 -0
  2. package/out/__chunks__/{chunk-XQL64G6I.mjs → chunk-2M5PQ7VQ.mjs} +2 -2
  3. package/out/__chunks__/{chunk-2IANAIWP.mjs → chunk-3BOE7KMH.mjs} +2 -2
  4. package/out/__chunks__/{chunk-K2QNLOBA.mjs → chunk-3IZTM5SH.mjs} +2 -2
  5. package/out/__chunks__/chunk-3TQYETUQ.mjs +2 -0
  6. package/out/__chunks__/chunk-3ULRTEGS.mjs +2 -0
  7. package/out/__chunks__/{chunk-CUMVG6S5.mjs → chunk-3XTDNJEI.mjs} +2 -2
  8. package/out/__chunks__/{chunk-CIUJ7Q6E.mjs → chunk-43L6QQVQ.mjs} +2 -2
  9. package/out/__chunks__/{chunk-ZNCLQODX.mjs → chunk-46HT52TD.mjs} +2 -2
  10. package/out/__chunks__/{chunk-FCB3AT5J.mjs → chunk-4HACE72D.mjs} +2 -2
  11. package/out/__chunks__/{chunk-U3CB72I3.mjs → chunk-4YZ6ES24.mjs} +2 -2
  12. package/out/__chunks__/chunk-5WVYRVED.mjs +2 -0
  13. package/out/__chunks__/{chunk-P6DSLB4K.mjs → chunk-6BL2PJRI.mjs} +2 -2
  14. package/out/__chunks__/{chunk-EPRQ5A6W.mjs → chunk-7KOIS7OQ.mjs} +2 -2
  15. package/out/__chunks__/{chunk-QT3PF6MA.mjs → chunk-A2OUGIST.mjs} +2 -2
  16. package/out/__chunks__/{chunk-R2OXRDF3.mjs → chunk-A32SSEM7.mjs} +2 -2
  17. package/out/__chunks__/{chunk-OZYD32IW.mjs → chunk-ACNCA5WT.mjs} +2 -2
  18. package/out/__chunks__/{chunk-OTSQGZLA.mjs → chunk-AGXERDYF.mjs} +2 -2
  19. package/out/__chunks__/chunk-ARG4BCVP.mjs +2 -0
  20. package/out/__chunks__/{chunk-WMSBYBUV.mjs → chunk-BDOEZAQW.mjs} +2 -2
  21. package/out/__chunks__/{chunk-SY2OIXRY.mjs → chunk-BF2EIXYA.mjs} +2 -2
  22. package/out/__chunks__/{chunk-WTCCK3ZP.mjs → chunk-BMBBSWIO.mjs} +2 -2
  23. package/out/__chunks__/chunk-BPJEBZSS.mjs +2 -0
  24. package/out/__chunks__/{chunk-IRQV762M.mjs → chunk-CD7S5WQ2.mjs} +2 -2
  25. package/out/__chunks__/{chunk-5IJGFJ7A.mjs → chunk-CO55WDEX.mjs} +2 -2
  26. package/out/__chunks__/chunk-CTCIWUCQ.mjs +2 -0
  27. package/out/__chunks__/chunk-CZEUFCPN.mjs +2 -0
  28. package/out/__chunks__/chunk-CZEUFCPN.mjs.map +7 -0
  29. package/out/__chunks__/{chunk-GKM7KNTV.mjs → chunk-FDKQ5GBZ.mjs} +2 -2
  30. package/out/__chunks__/{chunk-P5BMCXKE.mjs → chunk-FDN3ZMJB.mjs} +2 -2
  31. package/out/__chunks__/{chunk-AWV2BT4N.mjs → chunk-FUSW6F2O.mjs} +2 -2
  32. package/out/__chunks__/{chunk-6V32BQRW.mjs → chunk-GEPV5HLA.mjs} +2 -2
  33. package/out/__chunks__/{chunk-5MSC5VEJ.mjs → chunk-GPRR7WIH.mjs} +2 -2
  34. package/out/__chunks__/{chunk-3PTO3UT5.mjs → chunk-GRGJ3KFV.mjs} +2 -2
  35. package/out/__chunks__/{chunk-ZJ7L5STS.mjs → chunk-GUZERYYB.mjs} +2 -2
  36. package/out/__chunks__/{chunk-I3C6RYN6.mjs → chunk-H3PMAMO7.mjs} +2 -2
  37. package/out/__chunks__/{chunk-2FRFDBKB.mjs → chunk-HA5UXXYU.mjs} +2 -2
  38. package/out/__chunks__/{chunk-EUJRQFQG.mjs → chunk-HAHEJ5MG.mjs} +2 -2
  39. package/out/__chunks__/{chunk-XJPDM2YR.mjs → chunk-HKZI76PK.mjs} +2 -2
  40. package/out/__chunks__/{chunk-OAVLO5YR.mjs → chunk-HM3DDWL2.mjs} +2 -2
  41. package/out/__chunks__/{chunk-SV3NP6BV.mjs → chunk-JDIGAG2K.mjs} +2 -2
  42. package/out/__chunks__/chunk-JFP2BITI.mjs +2 -0
  43. package/out/__chunks__/chunk-JFP2BITI.mjs.map +7 -0
  44. package/out/__chunks__/chunk-JH4L2BAI.mjs +2 -0
  45. package/out/__chunks__/{chunk-JPMLMIQR.mjs → chunk-JH7DXVOH.mjs} +2 -2
  46. package/out/__chunks__/{chunk-JPMLMIQR.mjs.map → chunk-JH7DXVOH.mjs.map} +2 -2
  47. package/out/__chunks__/{chunk-7I7SJXVG.mjs → chunk-JICJ7JNX.mjs} +2 -2
  48. package/out/__chunks__/{chunk-5BYHDDZU.mjs → chunk-JIWOIKIN.mjs} +2 -2
  49. package/out/__chunks__/{chunk-UKFG6RD4.mjs → chunk-JO4RFE6Y.mjs} +2 -2
  50. package/out/__chunks__/chunk-JU3JK7ZW.mjs +2 -0
  51. package/out/__chunks__/{chunk-GRZU3CBF.mjs → chunk-KAZ44D6B.mjs} +2 -2
  52. package/out/__chunks__/{chunk-T4GLMTGR.mjs → chunk-KW67U7EN.mjs} +2 -2
  53. package/out/__chunks__/chunk-KXJUK6CN.mjs +2 -0
  54. package/out/__chunks__/{chunk-YG6GGSSN.mjs.map → chunk-KXJUK6CN.mjs.map} +1 -1
  55. package/out/__chunks__/chunk-LHLSK6R3.mjs +2 -0
  56. package/out/__chunks__/{chunk-FJD2WVYA.mjs → chunk-LKYNZMTI.mjs} +2 -2
  57. package/out/__chunks__/{chunk-IUCITH6E.mjs → chunk-LMULG6DX.mjs} +2 -2
  58. package/out/__chunks__/chunk-M2SIVB52.mjs +2 -0
  59. package/out/__chunks__/chunk-MDVHLIC7.mjs +2 -0
  60. package/out/__chunks__/{chunk-GECW34DV.mjs → chunk-MH24PY4N.mjs} +2 -2
  61. package/out/__chunks__/{chunk-6KJDFL4X.mjs → chunk-MPQUPJUO.mjs} +2 -2
  62. package/out/__chunks__/{chunk-DGANJCHG.mjs → chunk-MT3MZ6SJ.mjs} +2 -2
  63. package/out/__chunks__/chunk-N72FHB5Q.mjs +2 -0
  64. package/out/__chunks__/chunk-N72FHB5Q.mjs.map +7 -0
  65. package/out/__chunks__/{chunk-KC6QWZ4R.mjs → chunk-NCH6SFZ2.mjs} +2 -2
  66. package/out/__chunks__/chunk-ND5SC5UK.mjs +2 -0
  67. package/out/__chunks__/{chunk-XLBZPLWQ.mjs → chunk-NE6ED6BJ.mjs} +2 -2
  68. package/out/__chunks__/{chunk-YLGQ3PM4.mjs → chunk-NMVLXQXY.mjs} +2 -2
  69. package/out/__chunks__/{chunk-HWWLVGYU.mjs → chunk-OVD6R5BF.mjs} +2 -2
  70. package/out/__chunks__/{chunk-N4CXXF6R.mjs → chunk-QAKIMRWO.mjs} +2 -2
  71. package/out/__chunks__/chunk-QY6K7L4I.mjs +2 -0
  72. package/out/__chunks__/{chunk-JSA535AB.mjs.map → chunk-QY6K7L4I.mjs.map} +3 -3
  73. package/out/__chunks__/{chunk-JOX3TPDC.mjs → chunk-RXQEMX7U.mjs} +2 -2
  74. package/out/__chunks__/{chunk-XU7FAZR4.mjs → chunk-SBQYWA6T.mjs} +2 -2
  75. package/out/__chunks__/{chunk-PR2UXLUQ.mjs → chunk-SPP2AXFW.mjs} +2 -2
  76. package/out/__chunks__/{chunk-YVVVV5XJ.mjs → chunk-TAA22QOF.mjs} +2 -2
  77. package/out/__chunks__/chunk-TAFDGCRA.mjs +2 -0
  78. package/out/__chunks__/{chunk-YDKZQMFY.mjs → chunk-TC5SHARG.mjs} +2 -2
  79. package/out/__chunks__/{chunk-MWOVK6GV.mjs → chunk-TEIODZEN.mjs} +2 -2
  80. package/out/__chunks__/chunk-TP6GGLNS.mjs +2 -0
  81. package/out/__chunks__/{chunk-6TAFMLIP.mjs → chunk-U22RR2MN.mjs} +2 -2
  82. package/out/__chunks__/{chunk-EELETY3Z.mjs → chunk-UB3WTGGF.mjs} +2 -2
  83. package/out/__chunks__/chunk-UGA4OJPD.mjs +2 -0
  84. package/out/__chunks__/{chunk-BFYSNMGP.mjs → chunk-UK2P24V6.mjs} +2 -2
  85. package/out/__chunks__/{chunk-EXE2PPR4.mjs → chunk-VJN2RF4O.mjs} +2 -2
  86. package/out/__chunks__/{chunk-3V7L7VMK.mjs → chunk-VTPHR6O5.mjs} +2 -2
  87. package/out/__chunks__/{chunk-KONLNCQL.mjs → chunk-VVMACGAC.mjs} +2 -2
  88. package/out/__chunks__/{chunk-KONLNCQL.mjs.map → chunk-VVMACGAC.mjs.map} +2 -2
  89. package/out/__chunks__/chunk-XPQSGRUF.mjs +2 -0
  90. package/out/__chunks__/{chunk-2BKGSHOR.mjs → chunk-YBEBQWOE.mjs} +2 -2
  91. package/out/__chunks__/{chunk-NAQ3AWXW.mjs → chunk-ZHRGANG5.mjs} +2 -2
  92. package/out/__chunks__/{chunk-SJWV7RWT.mjs → chunk-ZVAP4GAJ.mjs} +2 -2
  93. package/out/apiCalls/account/getScamAddressData.mjs +1 -1
  94. package/out/apiCalls/configuration/getCleanApiAddress.mjs +1 -1
  95. package/out/apiCalls/configuration/getGasStationMetadata.mjs +1 -1
  96. package/out/apiCalls/index.mjs +1 -1
  97. package/out/apiCalls/tokens/getPersistedTokenDetails.mjs +1 -1
  98. package/out/apiCalls/tokens/getTokenDetails.mjs +1 -1
  99. package/out/apiCalls/tokens/index.mjs +1 -1
  100. package/out/apiCalls/transactions/getServerTransactionsByHashes.mjs +1 -1
  101. package/out/apiCalls/transactions/getTransactionByHash.mjs +1 -1
  102. package/out/apiCalls/transactions/getTransactionsByHashes.mjs +1 -1
  103. package/out/constants/browser.constants.mjs +1 -1
  104. package/out/constants/index.mjs +1 -1
  105. package/out/constants/storage.constants.mjs +1 -1
  106. package/out/constants/window.constants.cjs +1 -1
  107. package/out/constants/window.constants.cjs.map +1 -1
  108. package/out/constants/window.constants.mjs +1 -1
  109. package/out/controllers/TransactionsHistoryController/TransactionsHistoryController.mjs +1 -1
  110. package/out/controllers/TransactionsHistoryController/index.mjs +1 -1
  111. package/out/controllers/TransactionsTableController/TransactionsTableController.mjs +1 -1
  112. package/out/controllers/TransactionsTableController/index.mjs +1 -1
  113. package/out/index.mjs +1 -1
  114. package/out/lib/sdkDappUi.mjs +1 -1
  115. package/out/managers/LogoutManager/LogoutManager.mjs +1 -1
  116. package/out/managers/NotificationsFeedManager/NotificationsFeedManager.mjs +1 -1
  117. package/out/managers/NotificationsFeedManager/index.mjs +1 -1
  118. package/out/managers/ToastManager/ToastManager.mjs +1 -1
  119. package/out/managers/ToastManager/ToastUICoordinator.mjs +1 -1
  120. package/out/managers/ToastManager/helpers/LifetimeManager.mjs +1 -1
  121. package/out/managers/ToastManager/helpers/createToastsFromTransactions.mjs +1 -1
  122. package/out/managers/ToastManager/index.mjs +1 -1
  123. package/out/managers/TransactionManager/TransactionManager.mjs +1 -1
  124. package/out/managers/TransactionManager/helpers/getAreTransactionsCorssShards.mjs +1 -1
  125. package/out/managers/TransactionManager/helpers/getToastDuration.mjs +1 -1
  126. package/out/managers/TransactionManager/index.mjs +1 -1
  127. package/out/managers/UnlockPanelManager/UnlockPanelManager.cjs +1 -1
  128. package/out/managers/UnlockPanelManager/UnlockPanelManager.cjs.map +3 -3
  129. package/out/managers/UnlockPanelManager/UnlockPanelManager.d.ts +0 -1
  130. package/out/managers/UnlockPanelManager/UnlockPanelManager.mjs +1 -1
  131. package/out/managers/UnlockPanelManager/helpers/getIsSimpleLoginCallback.cjs +2 -0
  132. package/out/managers/UnlockPanelManager/helpers/getIsSimpleLoginCallback.cjs.map +7 -0
  133. package/out/managers/UnlockPanelManager/helpers/getIsSimpleLoginCallback.d.ts +7 -0
  134. package/out/managers/UnlockPanelManager/helpers/getIsSimpleLoginCallback.mjs +2 -0
  135. package/out/managers/UnlockPanelManager/helpers/getIsSimpleLoginCallback.mjs.map +7 -0
  136. package/out/managers/UnlockPanelManager/helpers/getProviderList.cjs +1 -1
  137. package/out/managers/UnlockPanelManager/helpers/getProviderList.cjs.map +2 -2
  138. package/out/managers/UnlockPanelManager/helpers/getProviderList.d.ts +1 -1
  139. package/out/managers/UnlockPanelManager/helpers/getProviderList.mjs +1 -1
  140. package/out/managers/UnlockPanelManager/index.mjs +1 -1
  141. package/out/managers/index.mjs +1 -1
  142. package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.cjs +1 -1
  143. package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.cjs.map +2 -2
  144. package/out/managers/internal/LedgerConnectStateManager/LedgerConnectStateManager.mjs +1 -1
  145. package/out/managers/internal/LedgerConnectStateManager/index.mjs +1 -1
  146. package/out/managers/internal/LedgerIdleStateManager/LedgerIdleStateManager.mjs +1 -1
  147. package/out/managers/internal/PendingTransactionsStateManager/PendingTransactionsStateManager.mjs +1 -1
  148. package/out/managers/internal/PendingTransactionsStateManager/index.mjs +1 -1
  149. package/out/managers/internal/SidePanelBaseManager/SidePanelBaseManager.mjs +1 -1
  150. package/out/managers/internal/SidePanelBaseManager/index.mjs +1 -1
  151. package/out/managers/internal/SignTransactionsStateManager/SignTransactionsStateManager.mjs +1 -1
  152. package/out/managers/internal/SignTransactionsStateManager/index.mjs +1 -1
  153. package/out/managers/internal/UIBaseManager/UIBaseManager.mjs +1 -1
  154. package/out/managers/internal/WalletConnectStateManager/WalletConnectStateManager.mjs +1 -1
  155. package/out/managers/internal/WalletConnectStateManager/index.mjs +1 -1
  156. package/out/managers/internal/index.mjs +1 -1
  157. package/out/methods/account/getAccount.mjs +1 -1
  158. package/out/methods/account/getAccountInfo.mjs +1 -1
  159. package/out/methods/account/getAddress.mjs +1 -1
  160. package/out/methods/account/getIsLoggedIn.mjs +1 -1
  161. package/out/methods/account/getLatestNonce.mjs +1 -1
  162. package/out/methods/initApp/gastStationMetadata/setGasStationMetadata.mjs +1 -1
  163. package/out/methods/initApp/initApp.mjs +1 -1
  164. package/out/methods/initApp/websocket/initializeWebsocketConnection.mjs +1 -1
  165. package/out/methods/initApp/websocket/registerWebsocket.mjs +1 -1
  166. package/out/methods/loginInfo/getLoginInfo.mjs +1 -1
  167. package/out/methods/network/getEgldLabel.mjs +1 -1
  168. package/out/methods/network/getExplorerAddress.mjs +1 -1
  169. package/out/methods/network/getNetworkConfig.mjs +1 -1
  170. package/out/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.mjs +1 -1
  171. package/out/methods/trackTransactions/helpers/checkTransactionStatus/helpers/checkBatch/checkBatch.mjs +1 -1
  172. package/out/methods/trackTransactions/helpers/checkTransactionStatus/helpers/checkBatch/helpers/runTransactionFailure.mjs +1 -1
  173. package/out/methods/trackTransactions/helpers/checkTransactionStatus/helpers/checkBatch/helpers/runTransactionStatusUpdate.mjs +1 -1
  174. package/out/methods/trackTransactions/helpers/checkTransactionStatus/helpers/checkBatch/helpers/updateTransactionAndSessionStatus.mjs +1 -1
  175. package/out/methods/trackTransactions/helpers/checkTransactionStatus/helpers/checkBatch/index.mjs +1 -1
  176. package/out/methods/trackTransactions/helpers/checkTransactionStatus/index.mjs +1 -1
  177. package/out/methods/trackTransactions/helpers/getPollingInterval.mjs +1 -1
  178. package/out/methods/trackTransactions/trackTransactions.mjs +1 -1
  179. package/out/methods/transactions/getFailedTransactions.mjs +1 -1
  180. package/out/methods/transactions/getFailedTransactionsSessions.mjs +1 -1
  181. package/out/methods/transactions/getPendingTransactions.mjs +1 -1
  182. package/out/methods/transactions/getPendingTransactionsSessions.mjs +1 -1
  183. package/out/methods/transactions/getSuccessfulTransactions.mjs +1 -1
  184. package/out/methods/transactions/getSuccessfulTransactionsSessions.mjs +1 -1
  185. package/out/methods/transactions/getTransactionSessions.mjs +1 -1
  186. package/out/providers/DappProvider/DappProvider.mjs +1 -1
  187. package/out/providers/DappProvider/helpers/login/helpers/accountLogin.mjs +1 -1
  188. package/out/providers/DappProvider/helpers/login/helpers/extractAddressFromToken.mjs +1 -1
  189. package/out/providers/DappProvider/helpers/login/helpers/getAccountFromToken.mjs +1 -1
  190. package/out/providers/DappProvider/helpers/login/helpers/getModifiedLoginToken.mjs +1 -1
  191. package/out/providers/DappProvider/helpers/login/helpers/getMultisigLoginToken.mjs +1 -1
  192. package/out/providers/DappProvider/helpers/login/login.mjs +1 -1
  193. package/out/providers/DappProvider/helpers/logout/logout.mjs +1 -1
  194. package/out/providers/DappProvider/helpers/signErrors/handleSignError.mjs +1 -1
  195. package/out/providers/DappProvider/helpers/signMessage/signMessageWithProvider.mjs +1 -1
  196. package/out/providers/DappProvider/helpers/signTransactions/signTransactionsWithProvider.mjs +1 -1
  197. package/out/providers/DappProvider/index.mjs +1 -1
  198. package/out/providers/ProviderFactory.mjs +1 -1
  199. package/out/providers/helpers/accountProvider.mjs +1 -1
  200. package/out/providers/helpers/cancelCrossWindowAction.mjs +1 -1
  201. package/out/providers/helpers/restoreProvider.mjs +1 -1
  202. package/out/providers/index.mjs +1 -1
  203. package/out/providers/strategies/BaseProviderStrategy/BaseProviderStrategy.mjs +1 -1
  204. package/out/providers/strategies/CrossWindowProviderStrategy/CrossWindowProviderStrategy.mjs +1 -1
  205. package/out/providers/strategies/CrossWindowProviderStrategy/index.mjs +1 -1
  206. package/out/providers/strategies/ExtensionProviderStrategy/ExtensionProviderStrategy.mjs +1 -1
  207. package/out/providers/strategies/ExtensionProviderStrategy/index.mjs +1 -1
  208. package/out/providers/strategies/IframeProviderStrategy/IframeProviderStrategy.mjs +1 -1
  209. package/out/providers/strategies/IframeProviderStrategy/index.mjs +1 -1
  210. package/out/providers/strategies/LedgerProviderStrategy/LedgerProviderStrategy.mjs +1 -1
  211. package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.cjs +1 -1
  212. package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.cjs.map +3 -3
  213. package/out/providers/strategies/LedgerProviderStrategy/helpers/authenticateLedgerAccount.mjs +1 -1
  214. package/out/providers/strategies/LedgerProviderStrategy/helpers/getAuthTokenText.mjs +1 -1
  215. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerConfiguration.mjs +1 -1
  216. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerProvider.mjs +1 -1
  217. package/out/providers/strategies/LedgerProviderStrategy/helpers/getLedgerVersionOptions.mjs +1 -1
  218. package/out/providers/strategies/LedgerProviderStrategy/helpers/index.mjs +1 -1
  219. package/out/providers/strategies/LedgerProviderStrategy/helpers/initializeLedgerProvider.mjs +1 -1
  220. package/out/providers/strategies/LedgerProviderStrategy/helpers/signLedgerMessage.mjs +1 -1
  221. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/index.mjs +1 -1
  222. package/out/providers/strategies/LedgerProviderStrategy/helpers/updateAccountsList/updateAccountsList.mjs +1 -1
  223. package/out/providers/strategies/LedgerProviderStrategy/index.mjs +1 -1
  224. package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.cjs +1 -1
  225. package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.cjs.map +2 -2
  226. package/out/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.mjs +1 -1
  227. package/out/providers/strategies/WalletConnectProviderStrategy/index.mjs +1 -1
  228. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/WebviewClient.mjs +1 -1
  229. package/out/providers/strategies/WebviewProviderStrategy/WebviewClient/index.mjs +1 -1
  230. package/out/providers/strategies/WebviewProviderStrategy/WebviewProviderStrategy.mjs +1 -1
  231. package/out/providers/strategies/WebviewProviderStrategy/index.mjs +1 -1
  232. package/out/providers/strategies/helpers/getPendingTransactionsHandlers.mjs +1 -1
  233. package/out/providers/strategies/helpers/index.mjs +1 -1
  234. package/out/providers/strategies/helpers/signMessage/signMessage.mjs +1 -1
  235. package/out/providers/strategies/helpers/signTransactions/helpers/calculateFeeLimit.mjs +1 -1
  236. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/getCommonData.mjs +1 -1
  237. package/out/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/getExtractTransactionsInfo.mjs +1 -1
  238. package/out/providers/strategies/helpers/signTransactions/helpers/getFeeData.mjs +1 -1
  239. package/out/providers/strategies/helpers/signTransactions/helpers/guardTransactions/guardTransactions.mjs +1 -1
  240. package/out/providers/strategies/helpers/signTransactions/signTransactions.mjs +1 -1
  241. package/out/providers/strategies/index.mjs +1 -1
  242. package/out/react/account/useGetAccount.mjs +1 -1
  243. package/out/react/account/useGetAccountInfo.mjs +1 -1
  244. package/out/react/account/useGetIsLoggedIn.mjs +1 -1
  245. package/out/react/account/useGetLatestNonce.mjs +1 -1
  246. package/out/react/index.mjs +1 -1
  247. package/out/react/loginInfo/useGetLoginInfo.mjs +1 -1
  248. package/out/react/network/useGetNetworkConfig.mjs +1 -1
  249. package/out/react/store/getReactStore.mjs +1 -1
  250. package/out/react/store/useSelector.mjs +1 -1
  251. package/out/react/transactions/useGetFailedTransactions.mjs +1 -1
  252. package/out/react/transactions/useGetFailedTransactionsSessions.mjs +1 -1
  253. package/out/react/transactions/useGetPendingTransactions.mjs +1 -1
  254. package/out/react/transactions/useGetPendingTransactionsSessions.mjs +1 -1
  255. package/out/react/transactions/useGetSuccessfulTransactions.mjs +1 -1
  256. package/out/react/transactions/useGetSuccessfulTransactionsSessions.mjs +1 -1
  257. package/out/react/transactions/useGetTransactionSessions.mjs +1 -1
  258. package/out/services/index.mjs +1 -1
  259. package/out/services/nativeAuth/index.mjs +1 -1
  260. package/out/services/nativeAuth/methods/buildNativeAuthConfig.mjs +1 -1
  261. package/out/services/nativeAuth/methods/getDefaultNativeAuthConfig.mjs +1 -1
  262. package/out/services/nativeAuth/methods/index.mjs +1 -1
  263. package/out/services/nativeAuth/nativeAuth.mjs +1 -1
  264. package/out/store/actions/account/accountActions.mjs +1 -1
  265. package/out/store/actions/account/index.mjs +1 -1
  266. package/out/store/actions/cache/cacheActions.mjs +1 -1
  267. package/out/store/actions/cache/index.mjs +1 -1
  268. package/out/store/actions/config/configActions.mjs +1 -1
  269. package/out/store/actions/config/index.mjs +1 -1
  270. package/out/store/actions/index.mjs +1 -1
  271. package/out/store/actions/loginInfo/loginInfoActions.mjs +1 -1
  272. package/out/store/actions/network/index.mjs +1 -1
  273. package/out/store/actions/network/initializeNetwork.mjs +1 -1
  274. package/out/store/actions/network/networkActions.mjs +1 -1
  275. package/out/store/actions/sharedActions/index.mjs +1 -1
  276. package/out/store/actions/sharedActions/sharedActions.mjs +1 -1
  277. package/out/store/actions/toasts/index.mjs +1 -1
  278. package/out/store/actions/toasts/toastsActions.mjs +1 -1
  279. package/out/store/actions/transactions/transactionsActions.mjs +1 -1
  280. package/out/store/actions/ui/index.mjs +1 -1
  281. package/out/store/actions/ui/uiActions.mjs +1 -1
  282. package/out/store/middleware/applyMiddlewares.mjs +1 -1
  283. package/out/store/middleware/index.mjs +1 -1
  284. package/out/store/middleware/logoutMiddleware.mjs +1 -1
  285. package/out/store/storage/index.mjs +1 -1
  286. package/out/store/storage/storageCallback.mjs +1 -1
  287. package/out/store/store.mjs +1 -1
  288. package/out/utils/ComponentFactory.mjs +1 -1
  289. package/out/utils/account/index.mjs +1 -1
  290. package/out/utils/account/refreshAccount.mjs +1 -1
  291. package/out/utils/account/refreshNativeAuthTokenLogin.mjs +1 -1
  292. package/out/utils/index.mjs +1 -1
  293. package/out/utils/transactions/getActiveTransactionsStatus.mjs +1 -1
  294. package/out/utils/transactions/getInterpretedTransaction/getInterpretedTransaction.mjs +1 -1
  295. package/out/utils/transactions/getInterpretedTransaction/helpers/getLockedAccountName.mjs +1 -1
  296. package/out/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.mjs +1 -1
  297. package/out/utils/transactions/getInterpretedTransaction/helpers/getShardText.mjs +1 -1
  298. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionIconInfo.mjs +1 -1
  299. package/out/utils/transactions/getInterpretedTransaction/helpers/getTransactionMessages.mjs +1 -1
  300. package/out/utils/transactions/getInterpretedTransaction/helpers/index.mjs +1 -1
  301. package/out/utils/transactions/getInterpretedTransaction/index.mjs +1 -1
  302. package/out/utils/transactions/getTransactionsHistory/getTransactionsHistory.mjs +1 -1
  303. package/out/utils/transactions/getTransactionsHistory/helpers/getCachedTransactionListItem.mjs +1 -1
  304. package/out/utils/transactions/getTransactionsHistory/helpers/index.mjs +1 -1
  305. package/out/utils/transactions/getTransactionsHistory/helpers/mapServerTransactionsToListItems.mjs +1 -1
  306. package/out/utils/transactions/getTransactionsHistory/index.mjs +1 -1
  307. package/out/utils/transactions/index.mjs +1 -1
  308. package/out/utils/visual/index.mjs +1 -1
  309. package/out/utils/visual/switchTheme.mjs +1 -1
  310. package/out/utils/window/getIsInIframe.mjs +1 -1
  311. package/out/utils/window/getWindowParentOrigin.mjs +1 -1
  312. package/out/utils/window/index.mjs +1 -1
  313. package/package.json +2 -2
  314. package/out/__chunks__/chunk-5TY2NRTY.mjs +0 -2
  315. package/out/__chunks__/chunk-5V3ZVJ5N.mjs +0 -2
  316. package/out/__chunks__/chunk-667KBMOX.mjs +0 -2
  317. package/out/__chunks__/chunk-667KBMOX.mjs.map +0 -7
  318. package/out/__chunks__/chunk-74YKEHCU.mjs +0 -2
  319. package/out/__chunks__/chunk-7GTKSPKR.mjs +0 -2
  320. package/out/__chunks__/chunk-7SHSB2H7.mjs +0 -2
  321. package/out/__chunks__/chunk-DKMTA3CC.mjs +0 -2
  322. package/out/__chunks__/chunk-HROVYEVW.mjs +0 -2
  323. package/out/__chunks__/chunk-IRP5CFO7.mjs +0 -2
  324. package/out/__chunks__/chunk-JSA535AB.mjs +0 -2
  325. package/out/__chunks__/chunk-OWA27GTK.mjs +0 -2
  326. package/out/__chunks__/chunk-OWA27GTK.mjs.map +0 -7
  327. package/out/__chunks__/chunk-R64XZNJM.mjs +0 -2
  328. package/out/__chunks__/chunk-SCIOG3JW.mjs +0 -2
  329. package/out/__chunks__/chunk-SDF6BSQJ.mjs +0 -2
  330. package/out/__chunks__/chunk-SWV35LLA.mjs +0 -2
  331. package/out/__chunks__/chunk-UBOX3NGQ.mjs +0 -2
  332. package/out/__chunks__/chunk-VGHFJYHY.mjs +0 -2
  333. package/out/__chunks__/chunk-WEDTMPCV.mjs +0 -2
  334. package/out/__chunks__/chunk-WW4U7UI2.mjs +0 -2
  335. package/out/__chunks__/chunk-YG6GGSSN.mjs +0 -2
  336. package/out/__chunks__/chunk-ZNPHUPAP.mjs +0 -2
  337. /package/out/__chunks__/{chunk-WEDTMPCV.mjs.map → chunk-27GL7FOR.mjs.map} +0 -0
  338. /package/out/__chunks__/{chunk-XQL64G6I.mjs.map → chunk-2M5PQ7VQ.mjs.map} +0 -0
  339. /package/out/__chunks__/{chunk-2IANAIWP.mjs.map → chunk-3BOE7KMH.mjs.map} +0 -0
  340. /package/out/__chunks__/{chunk-K2QNLOBA.mjs.map → chunk-3IZTM5SH.mjs.map} +0 -0
  341. /package/out/__chunks__/{chunk-HROVYEVW.mjs.map → chunk-3TQYETUQ.mjs.map} +0 -0
  342. /package/out/__chunks__/{chunk-5TY2NRTY.mjs.map → chunk-3ULRTEGS.mjs.map} +0 -0
  343. /package/out/__chunks__/{chunk-CUMVG6S5.mjs.map → chunk-3XTDNJEI.mjs.map} +0 -0
  344. /package/out/__chunks__/{chunk-CIUJ7Q6E.mjs.map → chunk-43L6QQVQ.mjs.map} +0 -0
  345. /package/out/__chunks__/{chunk-ZNCLQODX.mjs.map → chunk-46HT52TD.mjs.map} +0 -0
  346. /package/out/__chunks__/{chunk-FCB3AT5J.mjs.map → chunk-4HACE72D.mjs.map} +0 -0
  347. /package/out/__chunks__/{chunk-U3CB72I3.mjs.map → chunk-4YZ6ES24.mjs.map} +0 -0
  348. /package/out/__chunks__/{chunk-ZNPHUPAP.mjs.map → chunk-5WVYRVED.mjs.map} +0 -0
  349. /package/out/__chunks__/{chunk-P6DSLB4K.mjs.map → chunk-6BL2PJRI.mjs.map} +0 -0
  350. /package/out/__chunks__/{chunk-EPRQ5A6W.mjs.map → chunk-7KOIS7OQ.mjs.map} +0 -0
  351. /package/out/__chunks__/{chunk-QT3PF6MA.mjs.map → chunk-A2OUGIST.mjs.map} +0 -0
  352. /package/out/__chunks__/{chunk-R2OXRDF3.mjs.map → chunk-A32SSEM7.mjs.map} +0 -0
  353. /package/out/__chunks__/{chunk-OZYD32IW.mjs.map → chunk-ACNCA5WT.mjs.map} +0 -0
  354. /package/out/__chunks__/{chunk-OTSQGZLA.mjs.map → chunk-AGXERDYF.mjs.map} +0 -0
  355. /package/out/__chunks__/{chunk-SCIOG3JW.mjs.map → chunk-ARG4BCVP.mjs.map} +0 -0
  356. /package/out/__chunks__/{chunk-WMSBYBUV.mjs.map → chunk-BDOEZAQW.mjs.map} +0 -0
  357. /package/out/__chunks__/{chunk-SY2OIXRY.mjs.map → chunk-BF2EIXYA.mjs.map} +0 -0
  358. /package/out/__chunks__/{chunk-WTCCK3ZP.mjs.map → chunk-BMBBSWIO.mjs.map} +0 -0
  359. /package/out/__chunks__/{chunk-5V3ZVJ5N.mjs.map → chunk-BPJEBZSS.mjs.map} +0 -0
  360. /package/out/__chunks__/{chunk-IRQV762M.mjs.map → chunk-CD7S5WQ2.mjs.map} +0 -0
  361. /package/out/__chunks__/{chunk-5IJGFJ7A.mjs.map → chunk-CO55WDEX.mjs.map} +0 -0
  362. /package/out/__chunks__/{chunk-DKMTA3CC.mjs.map → chunk-CTCIWUCQ.mjs.map} +0 -0
  363. /package/out/__chunks__/{chunk-GKM7KNTV.mjs.map → chunk-FDKQ5GBZ.mjs.map} +0 -0
  364. /package/out/__chunks__/{chunk-P5BMCXKE.mjs.map → chunk-FDN3ZMJB.mjs.map} +0 -0
  365. /package/out/__chunks__/{chunk-AWV2BT4N.mjs.map → chunk-FUSW6F2O.mjs.map} +0 -0
  366. /package/out/__chunks__/{chunk-6V32BQRW.mjs.map → chunk-GEPV5HLA.mjs.map} +0 -0
  367. /package/out/__chunks__/{chunk-5MSC5VEJ.mjs.map → chunk-GPRR7WIH.mjs.map} +0 -0
  368. /package/out/__chunks__/{chunk-3PTO3UT5.mjs.map → chunk-GRGJ3KFV.mjs.map} +0 -0
  369. /package/out/__chunks__/{chunk-ZJ7L5STS.mjs.map → chunk-GUZERYYB.mjs.map} +0 -0
  370. /package/out/__chunks__/{chunk-I3C6RYN6.mjs.map → chunk-H3PMAMO7.mjs.map} +0 -0
  371. /package/out/__chunks__/{chunk-2FRFDBKB.mjs.map → chunk-HA5UXXYU.mjs.map} +0 -0
  372. /package/out/__chunks__/{chunk-EUJRQFQG.mjs.map → chunk-HAHEJ5MG.mjs.map} +0 -0
  373. /package/out/__chunks__/{chunk-XJPDM2YR.mjs.map → chunk-HKZI76PK.mjs.map} +0 -0
  374. /package/out/__chunks__/{chunk-OAVLO5YR.mjs.map → chunk-HM3DDWL2.mjs.map} +0 -0
  375. /package/out/__chunks__/{chunk-SV3NP6BV.mjs.map → chunk-JDIGAG2K.mjs.map} +0 -0
  376. /package/out/__chunks__/{chunk-VGHFJYHY.mjs.map → chunk-JH4L2BAI.mjs.map} +0 -0
  377. /package/out/__chunks__/{chunk-7I7SJXVG.mjs.map → chunk-JICJ7JNX.mjs.map} +0 -0
  378. /package/out/__chunks__/{chunk-5BYHDDZU.mjs.map → chunk-JIWOIKIN.mjs.map} +0 -0
  379. /package/out/__chunks__/{chunk-UKFG6RD4.mjs.map → chunk-JO4RFE6Y.mjs.map} +0 -0
  380. /package/out/__chunks__/{chunk-74YKEHCU.mjs.map → chunk-JU3JK7ZW.mjs.map} +0 -0
  381. /package/out/__chunks__/{chunk-GRZU3CBF.mjs.map → chunk-KAZ44D6B.mjs.map} +0 -0
  382. /package/out/__chunks__/{chunk-T4GLMTGR.mjs.map → chunk-KW67U7EN.mjs.map} +0 -0
  383. /package/out/__chunks__/{chunk-IRP5CFO7.mjs.map → chunk-LHLSK6R3.mjs.map} +0 -0
  384. /package/out/__chunks__/{chunk-FJD2WVYA.mjs.map → chunk-LKYNZMTI.mjs.map} +0 -0
  385. /package/out/__chunks__/{chunk-IUCITH6E.mjs.map → chunk-LMULG6DX.mjs.map} +0 -0
  386. /package/out/__chunks__/{chunk-SDF6BSQJ.mjs.map → chunk-M2SIVB52.mjs.map} +0 -0
  387. /package/out/__chunks__/{chunk-SWV35LLA.mjs.map → chunk-MDVHLIC7.mjs.map} +0 -0
  388. /package/out/__chunks__/{chunk-GECW34DV.mjs.map → chunk-MH24PY4N.mjs.map} +0 -0
  389. /package/out/__chunks__/{chunk-6KJDFL4X.mjs.map → chunk-MPQUPJUO.mjs.map} +0 -0
  390. /package/out/__chunks__/{chunk-DGANJCHG.mjs.map → chunk-MT3MZ6SJ.mjs.map} +0 -0
  391. /package/out/__chunks__/{chunk-KC6QWZ4R.mjs.map → chunk-NCH6SFZ2.mjs.map} +0 -0
  392. /package/out/__chunks__/{chunk-R64XZNJM.mjs.map → chunk-ND5SC5UK.mjs.map} +0 -0
  393. /package/out/__chunks__/{chunk-XLBZPLWQ.mjs.map → chunk-NE6ED6BJ.mjs.map} +0 -0
  394. /package/out/__chunks__/{chunk-YLGQ3PM4.mjs.map → chunk-NMVLXQXY.mjs.map} +0 -0
  395. /package/out/__chunks__/{chunk-HWWLVGYU.mjs.map → chunk-OVD6R5BF.mjs.map} +0 -0
  396. /package/out/__chunks__/{chunk-N4CXXF6R.mjs.map → chunk-QAKIMRWO.mjs.map} +0 -0
  397. /package/out/__chunks__/{chunk-JOX3TPDC.mjs.map → chunk-RXQEMX7U.mjs.map} +0 -0
  398. /package/out/__chunks__/{chunk-XU7FAZR4.mjs.map → chunk-SBQYWA6T.mjs.map} +0 -0
  399. /package/out/__chunks__/{chunk-PR2UXLUQ.mjs.map → chunk-SPP2AXFW.mjs.map} +0 -0
  400. /package/out/__chunks__/{chunk-YVVVV5XJ.mjs.map → chunk-TAA22QOF.mjs.map} +0 -0
  401. /package/out/__chunks__/{chunk-7GTKSPKR.mjs.map → chunk-TAFDGCRA.mjs.map} +0 -0
  402. /package/out/__chunks__/{chunk-YDKZQMFY.mjs.map → chunk-TC5SHARG.mjs.map} +0 -0
  403. /package/out/__chunks__/{chunk-MWOVK6GV.mjs.map → chunk-TEIODZEN.mjs.map} +0 -0
  404. /package/out/__chunks__/{chunk-UBOX3NGQ.mjs.map → chunk-TP6GGLNS.mjs.map} +0 -0
  405. /package/out/__chunks__/{chunk-6TAFMLIP.mjs.map → chunk-U22RR2MN.mjs.map} +0 -0
  406. /package/out/__chunks__/{chunk-EELETY3Z.mjs.map → chunk-UB3WTGGF.mjs.map} +0 -0
  407. /package/out/__chunks__/{chunk-WW4U7UI2.mjs.map → chunk-UGA4OJPD.mjs.map} +0 -0
  408. /package/out/__chunks__/{chunk-BFYSNMGP.mjs.map → chunk-UK2P24V6.mjs.map} +0 -0
  409. /package/out/__chunks__/{chunk-EXE2PPR4.mjs.map → chunk-VJN2RF4O.mjs.map} +0 -0
  410. /package/out/__chunks__/{chunk-3V7L7VMK.mjs.map → chunk-VTPHR6O5.mjs.map} +0 -0
  411. /package/out/__chunks__/{chunk-7SHSB2H7.mjs.map → chunk-XPQSGRUF.mjs.map} +0 -0
  412. /package/out/__chunks__/{chunk-2BKGSHOR.mjs.map → chunk-YBEBQWOE.mjs.map} +0 -0
  413. /package/out/__chunks__/{chunk-NAQ3AWXW.mjs.map → chunk-ZHRGANG5.mjs.map} +0 -0
  414. /package/out/__chunks__/{chunk-SJWV7RWT.mjs.map → chunk-ZVAP4GAJ.mjs.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{s as t}from"./chunk-VJN2RF4O.mjs";import{b as e}from"./chunk-7VHTZYM2.mjs";function g(r=t()){return e(r).egldLabel}export{g as a};
2
+ //# sourceMappingURL=chunk-27GL7FOR.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as M}from"./chunk-VGHFJYHY.mjs";import{a as U}from"./chunk-4SS6EY66.mjs";import{a as j}from"./chunk-7Z7IX367.mjs";import{a as z}from"./chunk-VCQBYNNS.mjs";import{a as V}from"./chunk-LN5UXO64.mjs";import{a as B}from"./chunk-PHOF3Z5D.mjs";import{a as $}from"./chunk-RBZC4PEU.mjs";import{a as _}from"./chunk-ELQR4QMU.mjs";import{a as R}from"./chunk-5KCP7UJT.mjs";import{a as w}from"./chunk-YGI3KXMZ.mjs";import{a as O}from"./chunk-QT3PF6MA.mjs";import{a as v}from"./chunk-RYIJWGFA.mjs";import{x}from"./chunk-6V32BQRW.mjs";import{a as G}from"./chunk-YJCTRUJT.mjs";import{a as C,c as F,f}from"./chunk-PJWJZHIS.mjs";import{a as b}from"./chunk-KD2IQ32V.mjs";import{c as L}from"./chunk-TI37DKBT.mjs";import{k as h}from"./chunk-LHEH7L4L.mjs";import{a as A}from"./chunk-YG6GGSSN.mjs";import{BigNumber as Dt}from"bignumber.js";async function Kt({allTransactions:T,currentScreenIndex:s,egldLabel:n,network:e,gasPriceData:m,price:S,address:c,username:q,shard:H,signedIndexes:i,parsedTransactionsByDataField:K}){let p=T[s],W=p?.transaction?.sender.toString(),d=p?.transaction,o=d?.toPlainObject(),D=null,I=null,t=await _({egldLabel:n,sender:W,apiAddress:e.apiAddress,address:c,parsedTransactionsByDataField:K})(p),g=!t?.transactionTokenInfo?.tokenId,{tokenId:l,nonce:u,amount:y=""}=t?.transactionTokenInfo??{},Z=l&&u&&u.length>0?`${l}-${u}`:l,J=await O({tokenId:Z}),{esdtPrice:Q,tokenDecimals:X,type:r,identifier:a,tokenImageUrl:Y}=J;if(r==="SemiFungibleESDT"||r==="NonFungibleESDT")I={type:r,identifier:a,amount:y,imageURL:Y};else{let P=({addCommas:St})=>f({input:g?d.value.toString():y,decimals:g?Number(e.decimals):X,digits:Number(e.digits),showLastNonZeroDecimal:!1,addCommas:St}),lt=P({addCommas:!0}),ut=P({addCommas:!1}),ft=Number(g?S:Q),Tt=w({amount:ut,usd:ft,addEqualSign:!0});D={identifier:(a===h?n:a)??n,amount:lt,usdValue:Tt}}let{feeLimitFormatted:tt,feeInFiatLimit:ot}=R({transaction:d,price:S}),nt=V({shard:H,initialGasPrice:m.initialGasPrice,transaction:o,gasStationMetadata:e.gasStationMetadata}),et=B({transaction:o,gasPriceData:m}),it=x().getType(),rt=v(it),N=T.length,at=i.length>0?i[i.length-1]+1:0,k=L(o?.data??""),E=$(t?.transactionTokenInfo),st=U({data:k,identifier:a,highlight:E}),mt=M(),ct=G({to:`/${b}/${c}`,explorerAddress:mt}),pt=N===1||t?.needsSigning&&!i.includes(s),dt=f({input:et.toString(),decimals:F,addCommas:!0,digits:C}),gt=new Dt(o.gasLimit).toFormat({decimalSeparator:",",groupSeparator:".",groupSize:3});return{commonData:{receiver:o.receiver.toString(),data:k,decodedData:st,gasPrice:dt,gasLimit:gt,explorerLink:ct,ppu:m.ppu,ppuOptions:nt,egldLabel:n,tokenType:j(r),feeLimit:tt,feeInFiatLimit:ot,transactionsCount:N,currentIndex:s,currentIndexToSign:at,highlight:E,scCall:z(t?.transactionTokenInfo),needsSigning:pt,isEditable:t?.needsSigning,providerName:rt,address:c,username:q,origin:A.location?.origin},tokenTransaction:D,fungibleTransaction:I}}export{Kt as a};
2
- //# sourceMappingURL=chunk-XQL64G6I.mjs.map
1
+ import{a as M}from"./chunk-JH4L2BAI.mjs";import{a as U}from"./chunk-4SS6EY66.mjs";import{a as j}from"./chunk-7Z7IX367.mjs";import{a as z}from"./chunk-VCQBYNNS.mjs";import{a as V}from"./chunk-LN5UXO64.mjs";import{a as B}from"./chunk-PHOF3Z5D.mjs";import{a as $}from"./chunk-RBZC4PEU.mjs";import{a as _}from"./chunk-ELQR4QMU.mjs";import{a as R}from"./chunk-5KCP7UJT.mjs";import{a as w}from"./chunk-YGI3KXMZ.mjs";import{a as O}from"./chunk-A2OUGIST.mjs";import{a as v}from"./chunk-RYIJWGFA.mjs";import{x}from"./chunk-GEPV5HLA.mjs";import{a as G}from"./chunk-YJCTRUJT.mjs";import{a as C,c as F,f}from"./chunk-PJWJZHIS.mjs";import{a as b}from"./chunk-KD2IQ32V.mjs";import{c as L}from"./chunk-TI37DKBT.mjs";import{k as h}from"./chunk-LHEH7L4L.mjs";import{a as A}from"./chunk-KXJUK6CN.mjs";import{BigNumber as Dt}from"bignumber.js";async function Kt({allTransactions:T,currentScreenIndex:s,egldLabel:n,network:e,gasPriceData:m,price:S,address:c,username:q,shard:H,signedIndexes:i,parsedTransactionsByDataField:K}){let p=T[s],W=p?.transaction?.sender.toString(),d=p?.transaction,o=d?.toPlainObject(),D=null,I=null,t=await _({egldLabel:n,sender:W,apiAddress:e.apiAddress,address:c,parsedTransactionsByDataField:K})(p),g=!t?.transactionTokenInfo?.tokenId,{tokenId:l,nonce:u,amount:y=""}=t?.transactionTokenInfo??{},Z=l&&u&&u.length>0?`${l}-${u}`:l,J=await O({tokenId:Z}),{esdtPrice:Q,tokenDecimals:X,type:r,identifier:a,tokenImageUrl:Y}=J;if(r==="SemiFungibleESDT"||r==="NonFungibleESDT")I={type:r,identifier:a,amount:y,imageURL:Y};else{let P=({addCommas:St})=>f({input:g?d.value.toString():y,decimals:g?Number(e.decimals):X,digits:Number(e.digits),showLastNonZeroDecimal:!1,addCommas:St}),lt=P({addCommas:!0}),ut=P({addCommas:!1}),ft=Number(g?S:Q),Tt=w({amount:ut,usd:ft,addEqualSign:!0});D={identifier:(a===h?n:a)??n,amount:lt,usdValue:Tt}}let{feeLimitFormatted:tt,feeInFiatLimit:ot}=R({transaction:d,price:S}),nt=V({shard:H,initialGasPrice:m.initialGasPrice,transaction:o,gasStationMetadata:e.gasStationMetadata}),et=B({transaction:o,gasPriceData:m}),it=x().getType(),rt=v(it),N=T.length,at=i.length>0?i[i.length-1]+1:0,k=L(o?.data??""),E=$(t?.transactionTokenInfo),st=U({data:k,identifier:a,highlight:E}),mt=M(),ct=G({to:`/${b}/${c}`,explorerAddress:mt}),pt=N===1||t?.needsSigning&&!i.includes(s),dt=f({input:et.toString(),decimals:F,addCommas:!0,digits:C}),gt=new Dt(o.gasLimit).toFormat({decimalSeparator:",",groupSeparator:".",groupSize:3});return{commonData:{receiver:o.receiver.toString(),data:k,decodedData:st,gasPrice:dt,gasLimit:gt,explorerLink:ct,ppu:m.ppu,ppuOptions:nt,egldLabel:n,tokenType:j(r),feeLimit:tt,feeInFiatLimit:ot,transactionsCount:N,currentIndex:s,currentIndexToSign:at,highlight:E,scCall:z(t?.transactionTokenInfo),needsSigning:pt,isEditable:t?.needsSigning,providerName:rt,address:c,username:q,origin:A.location?.origin},tokenTransaction:D,fungibleTransaction:I}}export{Kt as a};
2
+ //# sourceMappingURL=chunk-2M5PQ7VQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as s}from"./chunk-SQ3EODA7.mjs";import{c as r,d as a}from"./chunk-M6MN4RXG.mjs";import{s as e}from"./chunk-EXE2PPR4.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-2IANAIWP.mjs.map
1
+ import{a as S}from"./chunk-EAJBSX6Y.mjs";import{a as s}from"./chunk-SQ3EODA7.mjs";import{c as r,d as a}from"./chunk-M6MN4RXG.mjs";import{s as e}from"./chunk-VJN2RF4O.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-3BOE7KMH.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-FCB3AT5J.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-K2QNLOBA.mjs.map
1
+ import{a as s}from"./chunk-4HACE72D.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-3IZTM5SH.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-KXJUK6CN.mjs";var o=()=>a.localStorage;export{o as a};
2
+ //# sourceMappingURL=chunk-3TQYETUQ.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-KW67U7EN.mjs";import{c as n}from"./chunk-VJN2RF4O.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-3ULRTEGS.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as w}from"./chunk-QXC4D3AC.mjs";import{a as g}from"./chunk-YGI3KXMZ.mjs";import{a as b}from"./chunk-SDF6BSQJ.mjs";import{a as m}from"./chunk-G7GU37XI.mjs";import{f}from"./chunk-PJWJZHIS.mjs";import x from"bignumber.js";var F=async({manager:e,provider:d})=>{if(!e||!d)throw new Error("Provider is not initialized.");let{network:u}=b(),s=e.getAccountScreenData()?.startIndex||0,r=e.getAllAccounts(),a=await w({baseURL:u.apiAddress}),l=o=>o.index>=s&&o.index<s+e.addressesPerPage,I=r.reduce((o,n)=>Object.assign(o,{[n.index]:n}),{}),A=r.filter(l),y=!!I[s];if(e.updateAccountScreen({isLoading:!y}),A.length>0){e.updateAccountScreen({accounts:A});return}try{let o=Math.floor(s/e.addressesPerPage),n=await d.getAccounts(o,e.addressesPerPage),L=n.map((t,c)=>({address:t,balance:"...",index:c+s})),P=[...r,...L],h=n.map(t=>m({address:t,baseURL:u.apiAddress})),j=await Promise.all(h),i=P.reduce((t,c)=>Object.assign(t,{[c.address]:c}),{});j.forEach(t=>{if(!t||!a||!a.price)return;let c=new x(t.balance),S=c.dividedBy(x(10).pow(18)).toFormat(4).toString();if(c.isNaN())return;let U=g({amount:f({input:t.balance}),usd:a?.price});i[t.address].balance=S,i[t.address].usdValue=U});let p=Object.values(i).sort((t,c)=>t.index-c.index),O=p.filter(l);e.updateAllAccounts(p),e.updateAccountScreen({accounts:O,isLoading:!1})}catch(o){console.error("Failed to fetch accounts:",o)}};export{F as a};
2
- //# sourceMappingURL=chunk-CUMVG6S5.mjs.map
1
+ import{a as w}from"./chunk-QXC4D3AC.mjs";import{a as g}from"./chunk-YGI3KXMZ.mjs";import{a as b}from"./chunk-M2SIVB52.mjs";import{a as m}from"./chunk-G7GU37XI.mjs";import{f}from"./chunk-PJWJZHIS.mjs";import x from"bignumber.js";var F=async({manager:e,provider:d})=>{if(!e||!d)throw new Error("Provider is not initialized.");let{network:u}=b(),s=e.getAccountScreenData()?.startIndex||0,r=e.getAllAccounts(),a=await w({baseURL:u.apiAddress}),l=o=>o.index>=s&&o.index<s+e.addressesPerPage,I=r.reduce((o,n)=>Object.assign(o,{[n.index]:n}),{}),A=r.filter(l),y=!!I[s];if(e.updateAccountScreen({isLoading:!y}),A.length>0){e.updateAccountScreen({accounts:A});return}try{let o=Math.floor(s/e.addressesPerPage),n=await d.getAccounts(o,e.addressesPerPage),L=n.map((t,c)=>({address:t,balance:"...",index:c+s})),P=[...r,...L],h=n.map(t=>m({address:t,baseURL:u.apiAddress})),j=await Promise.all(h),i=P.reduce((t,c)=>Object.assign(t,{[c.address]:c}),{});j.forEach(t=>{if(!t||!a||!a.price)return;let c=new x(t.balance),S=c.dividedBy(x(10).pow(18)).toFormat(4).toString();if(c.isNaN())return;let U=g({amount:f({input:t.balance}),usd:a?.price});i[t.address].balance=S,i[t.address].usdValue=U});let p=Object.values(i).sort((t,c)=>t.index-c.index),O=p.filter(l);e.updateAllAccounts(p),e.updateAccountScreen({accounts:O,isLoading:!1})}catch(o){console.error("Failed to fetch accounts:",o)}};export{F as a};
2
+ //# sourceMappingURL=chunk-3XTDNJEI.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as k}from"./chunk-DKMTA3CC.mjs";import{a as O}from"./chunk-GECW34DV.mjs";import{a as B}from"./chunk-WEDTMPCV.mjs";import{a as b}from"./chunk-XU7FAZR4.mjs";import{a as A}from"./chunk-QXC4D3AC.mjs";import{a as D}from"./chunk-XQL64G6I.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as _}from"./chunk-AWV2BT4N.mjs";import{a as R}from"./chunk-K373M2BG.mjs";import{a as j}from"./chunk-5KCP7UJT.mjs";import{s as x}from"./chunk-EXE2PPR4.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-CIUJ7Q6E.mjs.map
1
+ import{a as k}from"./chunk-CTCIWUCQ.mjs";import{a as O}from"./chunk-MH24PY4N.mjs";import{a as B}from"./chunk-27GL7FOR.mjs";import{a as b}from"./chunk-SBQYWA6T.mjs";import{a as A}from"./chunk-QXC4D3AC.mjs";import{a as D}from"./chunk-2M5PQ7VQ.mjs";import{a as I}from"./chunk-PHOF3Z5D.mjs";import{a as _}from"./chunk-FUSW6F2O.mjs";import{a as R}from"./chunk-K373M2BG.mjs";import{a as j}from"./chunk-5KCP7UJT.mjs";import{s as x}from"./chunk-VJN2RF4O.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-43L6QQVQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-EUJRQFQG.mjs";import{b as r}from"./chunk-R2OXRDF3.mjs";import{s as i}from"./chunk-EXE2PPR4.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-ZNCLQODX.mjs.map
1
+ import{a as n}from"./chunk-HAHEJ5MG.mjs";import{b as r}from"./chunk-A32SSEM7.mjs";import{s as i}from"./chunk-VJN2RF4O.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-46HT52TD.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-YG6GGSSN.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-FCB3AT5J.mjs.map
1
+ import{a as t}from"./chunk-KXJUK6CN.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-4HACE72D.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-YG6GGSSN.mjs";function r(t){try{if(!e)return;e.document.documentElement.dataset.mvxTheme=t}catch{console.log("Error switching the theme!")}}export{r as a};
2
- //# sourceMappingURL=chunk-U3CB72I3.mjs.map
1
+ import{a as e}from"./chunk-KXJUK6CN.mjs";function r(t){try{if(!e)return;e.document.documentElement.dataset.mvxTheme=t}catch{console.log("Error switching the theme!")}}export{r as a};
2
+ //# sourceMappingURL=chunk-4YZ6ES24.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as o}from"./chunk-JTV664SG.mjs";import{a as e}from"./chunk-6LOIZTC6.mjs";import{a as r}from"./chunk-EZKCZPIE.mjs";import{a as t}from"./chunk-DLCBEPEX.mjs";var a={network:{network:e},account:o,loginInfo:r,config:t,transactions:{},toasts:{customToasts:[],transactionToasts:[]},cache:{},ui:{isSidePanelOpen:!1}};export{a};
2
+ //# sourceMappingURL=chunk-5WVYRVED.mjs.map
@@ -1,2 +1,2 @@
1
- import{q as o}from"./chunk-EXE2PPR4.mjs";import{current as p}from"immer";function d({transactions:t,transactionsDisplayInfo:n,status:r,sessionInformation:s}){let a=Date.now().toString();return o().setState(({transactions:e})=>{e[a]={transactions:t,status:r,transactionsDisplayInfo:n,interpretedTransactions:{},sessionInformation:s}},!1,{type:"createTransactionsSession",payload:{value:{transactions:t,status:r,transactionsDisplayInfo:n,sessionInformation:s}}}),a}function m({sessionId:t,status:n,errorMessage:r}){o().setState(({transactions:s})=>{if(!s[t])return;let a=p(s[t]).transactionsDisplayInfo??{},e=r||a?.errorMessage;s[t].status=n,s[t].errorMessage=e,s[t].transactionsDisplayInfo={...a,errorMessage:e}},!1,{type:"updateSessionStatus",payload:{value:{sessionId:t,status:n,errorMessage:r}}})}function g({sessionId:t,transaction:n}){o().setState(({transactions:r})=>{let s=r[t]?.transactions;s!=null&&(r[t].transactions=s.map(a=>a.hash===n.hash?{...a,...n??{}}:a))},!1,{type:"updateTransactionStatus",payload:{value:{sessionId:t,transaction:n}}})}var h=()=>{o().setState(({transactions:t,toasts:n})=>{let s=Object.keys(t).filter(e=>{let c=t[e];if(!c)return!1;let{status:i}=c;return!(i==="pending"||i==="signed"||i==="sent")});s.forEach(e=>{delete t[e]});let a=n.transactionToasts.filter(e=>!s.includes(e.toastId));n.transactionToasts=a},!1,{type:"clearCompletedTransactions",payload:{value:null}})};export{d as a,m as b,g as c,h as d};
2
- //# sourceMappingURL=chunk-P6DSLB4K.mjs.map
1
+ import{q as o}from"./chunk-VJN2RF4O.mjs";import{current as p}from"immer";function d({transactions:t,transactionsDisplayInfo:n,status:r,sessionInformation:s}){let a=Date.now().toString();return o().setState(({transactions:e})=>{e[a]={transactions:t,status:r,transactionsDisplayInfo:n,interpretedTransactions:{},sessionInformation:s}},!1,{type:"createTransactionsSession",payload:{value:{transactions:t,status:r,transactionsDisplayInfo:n,sessionInformation:s}}}),a}function m({sessionId:t,status:n,errorMessage:r}){o().setState(({transactions:s})=>{if(!s[t])return;let a=p(s[t]).transactionsDisplayInfo??{},e=r||a?.errorMessage;s[t].status=n,s[t].errorMessage=e,s[t].transactionsDisplayInfo={...a,errorMessage:e}},!1,{type:"updateSessionStatus",payload:{value:{sessionId:t,status:n,errorMessage:r}}})}function g({sessionId:t,transaction:n}){o().setState(({transactions:r})=>{let s=r[t]?.transactions;s!=null&&(r[t].transactions=s.map(a=>a.hash===n.hash?{...a,...n??{}}:a))},!1,{type:"updateTransactionStatus",payload:{value:{sessionId:t,transaction:n}}})}var h=()=>{o().setState(({transactions:t,toasts:n})=>{let s=Object.keys(t).filter(e=>{let c=t[e];if(!c)return!1;let{status:i}=c;return!(i==="pending"||i==="signed"||i==="sent")});s.forEach(e=>{delete t[e]});let a=n.transactionToasts.filter(e=>!s.includes(e.toastId));n.transactionToasts=a},!1,{type:"clearCompletedTransactions",payload:{value:null}})};export{d as a,m as b,g as c,h as d};
2
+ //# sourceMappingURL=chunk-6BL2PJRI.mjs.map
@@ -1,2 +1,2 @@
1
- import{j as n,q as o}from"./chunk-EXE2PPR4.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-EPRQ5A6W.mjs.map
1
+ import{j as n,q as o}from"./chunk-VJN2RF4O.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-7KOIS7OQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-3QWTD55I.mjs";import{s as m}from"./chunk-EXE2PPR4.mjs";import{b as a}from"./chunk-7VHTZYM2.mjs";import{o as s,u as o}from"./chunk-KD2IQ32V.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";async function I({tokenId:n}){let t=a(m()),r={tokenDecimals:Number(t.decimals),tokenLabel:"",tokenImageUrl:""},{isNft:k}=c(n),i=n,p=k?s:o;if(!i)return r;try{let e=await g(`${t.apiAddress}/${p}/${i}`),l=e?e?.decimals:Number(t.decimals),f=e?e?.name:"",T=e?e?.assets?.svgUrl??e?.media?.[0]?.thumbnailUrl:"";return{tokenDecimals:l,tokenLabel:f,type:e?.type,tokenImageUrl:T,identifier:e?.identifier,assets:e?.assets,esdtPrice:e?.price,ticker:e?.ticker,name:e?.name}}catch(e){return{...r,error:`${e}`}}}export{I as a};
2
- //# sourceMappingURL=chunk-QT3PF6MA.mjs.map
1
+ import{a as g}from"./chunk-3QWTD55I.mjs";import{s as m}from"./chunk-VJN2RF4O.mjs";import{b as a}from"./chunk-7VHTZYM2.mjs";import{o as s,u as o}from"./chunk-KD2IQ32V.mjs";import{a as c}from"./chunk-3FXHIV6O.mjs";async function I({tokenId:n}){let t=a(m()),r={tokenDecimals:Number(t.decimals),tokenLabel:"",tokenImageUrl:""},{isNft:k}=c(n),i=n,p=k?s:o;if(!i)return r;try{let e=await g(`${t.apiAddress}/${p}/${i}`),l=e?e?.decimals:Number(t.decimals),f=e?e?.name:"",T=e?e?.assets?.svgUrl??e?.media?.[0]?.thumbnailUrl:"";return{tokenDecimals:l,tokenLabel:f,type:e?.type,tokenImageUrl:T,identifier:e?.identifier,assets:e?.assets,esdtPrice:e?.price,ticker:e?.ticker,name:e?.name}}catch(e){return{...r,error:`${e}`}}}export{I as a};
2
+ //# sourceMappingURL=chunk-A2OUGIST.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-EXE2PPR4.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-R2OXRDF3.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-VJN2RF4O.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-A32SSEM7.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-EELETY3Z.mjs";import{a as o}from"./chunk-LJX4MW7B.mjs";import{a as e,b as t}from"./chunk-YG6GGSSN.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-OZYD32IW.mjs.map
1
+ import{a as s}from"./chunk-UB3WTGGF.mjs";import{a as o}from"./chunk-LJX4MW7B.mjs";import{a as e,b as t}from"./chunk-KXJUK6CN.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-ACNCA5WT.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as f}from"./chunk-FRDR4A7Z.mjs";import{x as g}from"./chunk-6V32BQRW.mjs";import{a as c}from"./chunk-UBOX3NGQ.mjs";import{s as n}from"./chunk-EXE2PPR4.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-OTSQGZLA.mjs.map
1
+ import{a as f}from"./chunk-FRDR4A7Z.mjs";import{x as g}from"./chunk-GEPV5HLA.mjs";import{a as c}from"./chunk-TP6GGLNS.mjs";import{s as n}from"./chunk-VJN2RF4O.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-AGXERDYF.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-UGA4OJPD.mjs";function S(e){return t()(e)}export{S as a};
2
+ //# sourceMappingURL=chunk-ARG4BCVP.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-OTSQGZLA.mjs";import{a}from"./chunk-YUFPUG5O.mjs";import{a as c}from"./chunk-UBOX3NGQ.mjs";var p="Check if the MultiversX App is open on Ledger";async function v({manager:e,resolve:n,reject:d,shouldInitProvider:s}){let i=!c(),t=()=>v({manager:e,resolve:n,reject:d,shouldInitProvider:s}),o=()=>d("Device unavailable");try{e?.updateAccountScreen({isLoading:!0}),e&&i&&e.subscribeToProviderInit({handleRetry:t,handleCancel:o});let r=await l({shouldInitProvider:s});e&&i&&e.unsubscribeFromProviderInit({handleRetry:t,handleCancel:o}),n(r)}catch(r){if(!i)throw r;let{errorMessage:u,defaultErrorMessage:g}=a(r);e?.updateConnectScreen({error:u??g??p}),e&&e.subscribeToProviderInit({handleRetry:t,handleCancel:o})}}export{v as a};
2
- //# sourceMappingURL=chunk-WMSBYBUV.mjs.map
1
+ import{a as l}from"./chunk-AGXERDYF.mjs";import{a}from"./chunk-YUFPUG5O.mjs";import{a as c}from"./chunk-TP6GGLNS.mjs";var p="Check if the MultiversX App is open on Ledger";async function v({manager:e,resolve:n,reject:d,shouldInitProvider:s}){let i=!c(),t=()=>v({manager:e,resolve:n,reject:d,shouldInitProvider:s}),o=()=>d("Device unavailable");try{e?.updateAccountScreen({isLoading:!0}),e&&i&&e.subscribeToProviderInit({handleRetry:t,handleCancel:o});let r=await l({shouldInitProvider:s});e&&i&&e.unsubscribeFromProviderInit({handleRetry:t,handleCancel:o}),n(r)}catch(r){if(!i)throw r;let{errorMessage:u,defaultErrorMessage:g}=a(r);e?.updateConnectScreen({error:u??g??p}),e&&e.subscribeToProviderInit({handleRetry:t,handleCancel:o})}}export{v as a};
2
+ //# sourceMappingURL=chunk-BDOEZAQW.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-O7LCTC4K.mjs";import{s as m}from"./chunk-EXE2PPR4.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-SY2OIXRY.mjs.map
1
+ import{a as s}from"./chunk-O7LCTC4K.mjs";import{s as m}from"./chunk-VJN2RF4O.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-BF2EIXYA.mjs.map
@@ -1,2 +1,2 @@
1
- import{q as t}from"./chunk-EXE2PPR4.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-WTCCK3ZP.mjs.map
1
+ import{q as t}from"./chunk-VJN2RF4O.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-BMBBSWIO.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./chunk-FDN3ZMJB.mjs";import{a as o}from"./chunk-PMHRZ5Y7.mjs";import{b as i}from"./chunk-6BL2PJRI.mjs";import{j as r}from"./chunk-E2GGD7D4.mjs";import{s as n}from"./chunk-VJN2RF4O.mjs";async function E({transaction:a,sessionId:s}){let c=a.results?.find(t=>t?.returnMessage!=="");e({sessionId:s,transaction:{...a,status:"fail",inTransit:!1}});let{transactions:m}=n();m?.[s]?.transactions?.some(t=>r(t.status))||(i({sessionId:s,status:"fail",errorMessage:c?.returnMessage}),await o({sessionId:s,status:"fail"}))}export{E as a};
2
+ //# sourceMappingURL=chunk-BPJEBZSS.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-R64XZNJM.mjs";import{c as e,g as s}from"./chunk-NTEMINYA.mjs";async function m({message:r,provider:a,options:n}){let g=o(),i=new s({address:new e(g),data:r.data});return await a.signMessage(i,n)}export{m as a};
2
- //# sourceMappingURL=chunk-IRQV762M.mjs.map
1
+ import{a as o}from"./chunk-ND5SC5UK.mjs";import{c as e,g as s}from"./chunk-NTEMINYA.mjs";async function m({message:r,provider:a,options:n}){let g=o(),i=new s({address:new e(g),data:r.data});return await a.signMessage(i,n)}export{m as a};
2
+ //# sourceMappingURL=chunk-CD7S5WQ2.mjs.map
@@ -1,2 +1,2 @@
1
- import{q as o}from"./chunk-EXE2PPR4.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-5IJGFJ7A.mjs.map
1
+ import{q as o}from"./chunk-VJN2RF4O.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-CO55WDEX.mjs.map
@@ -0,0 +1,2 @@
1
+ import{s as o}from"./chunk-VJN2RF4O.mjs";import{b as t}from"./chunk-UERJ6AKK.mjs";function c(r=o()){return t(r)}export{c as a};
2
+ //# sourceMappingURL=chunk-CTCIWUCQ.mjs.map
@@ -0,0 +1,2 @@
1
+ import{a as v}from"./chunk-6R2WFQ7U.mjs";import{a as o}from"./chunk-LJX4MW7B.mjs";function f(i=[],s){let d=[...Object.values(o).filter(e=>![o.none,o.webview].includes(e)),...i.map(e=>e.type)],n=i.reduce((e,r)=>(e[r.type]=r.name,e),{}),t={...v,...n};return(s?s.filter(e=>d.includes(e)):d).map(e=>{let r=i.find(l=>l.type===e);return r||{name:e in t?t[e]:e,type:e}})}export{f as a};
2
+ //# sourceMappingURL=chunk-CZEUFCPN.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/managers/UnlockPanelManager/helpers/getProviderList.ts"],
4
+ "sourcesContent": ["import { providerLabels } from 'constants/providerFactory.constants';\nimport {\n ICustomProvider,\n IProviderBase,\n ProviderType,\n ProviderTypeEnum\n} from 'providers/types/providerFactory.types';\n\nexport function getProvidersList(\n addedCustomProviders: ICustomProvider[] = [],\n allowedProviders?: ProviderType[] | null\n): IProviderBase[] {\n const defaultProviderTypes = (\n Object.values(ProviderTypeEnum) as ProviderType[]\n ).filter((type) => {\n const excludedProviders: ProviderType[] = [\n ProviderTypeEnum.none,\n ProviderTypeEnum.webview\n ];\n return !excludedProviders.includes(type);\n });\n\n const allAvailableProviderTypes: ProviderType[] = [\n ...defaultProviderTypes,\n ...addedCustomProviders.map((p) => p.type as ProviderType)\n ];\n\n const customProviderLabels = addedCustomProviders.reduce(\n (acc, provider) => {\n acc[provider.type as ProviderType] = provider.name;\n return acc;\n },\n {} as Record<ProviderType, string>\n );\n\n const allAvailableLabels = {\n ...providerLabels,\n ...customProviderLabels\n };\n\n const allowedProviderTypes: ProviderType[] = allowedProviders\n ? allowedProviders.filter((type) =>\n allAvailableProviderTypes.includes(type)\n )\n : allAvailableProviderTypes;\n\n const providerList: IProviderBase[] = allowedProviderTypes.map((type) => {\n const custom = addedCustomProviders.find(\n (customProvider) => customProvider.type === type\n );\n if (custom) {\n return custom;\n }\n\n return {\n name: type in allAvailableLabels ? allAvailableLabels[type] : type,\n type\n };\n });\n\n return providerList;\n}\n"],
5
+ "mappings": "kFAQO,SAASA,EACdC,EAA0C,CAAC,EAC3CC,EACiB,CAWjB,IAAMC,EAA4C,CAChD,GAVA,OAAO,OAAOC,CAAgB,EAC9B,OAAQC,GAKD,CAJmC,CACxCD,EAAiB,KACjBA,EAAiB,OACnB,EAC0B,SAASC,CAAI,CACxC,EAIC,GAAGJ,EAAqB,IAAKK,GAAMA,EAAE,IAAoB,CAC3D,EAEMC,EAAuBN,EAAqB,OAChD,CAACO,EAAKC,KACJD,EAAIC,EAAS,IAAoB,EAAIA,EAAS,KACvCD,GAET,CAAC,CACH,EAEME,EAAqB,CACzB,GAAGC,EACH,GAAGJ,CACL,EAsBA,OApB6CL,EACzCA,EAAiB,OAAQG,GACvBF,EAA0B,SAASE,CAAI,CACzC,EACAF,GAEuD,IAAKE,GAAS,CACvE,IAAMO,EAASX,EAAqB,KACjCY,GAAmBA,EAAe,OAASR,CAC9C,EACA,OAAIO,GAIG,CACL,KAAMP,KAAQK,EAAqBA,EAAmBL,CAAI,EAAIA,EAC9D,KAAAA,CACF,CACF,CAAC,CAGH",
6
+ "names": ["getProvidersList", "addedCustomProviders", "allowedProviders", "allAvailableProviderTypes", "ProviderTypeEnum", "type", "p", "customProviderLabels", "acc", "provider", "allAvailableLabels", "providerLabels", "custom", "customProvider"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-FJD2WVYA.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-GKM7KNTV.mjs.map
1
+ import{a as e}from"./chunk-LKYNZMTI.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-FDKQ5GBZ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-N55JEIM6.mjs";import{b as n,c as o}from"./chunk-P6DSLB4K.mjs";import{s}from"./chunk-EXE2PPR4.mjs";function T({sessionId:t,transaction:e}){o({sessionId:t,transaction:e});let i=s().transactions?.[t].transactions,a=r(i);return a&&n({sessionId:t,status:a}),a}export{T as a};
2
- //# sourceMappingURL=chunk-P5BMCXKE.mjs.map
1
+ import{a as r}from"./chunk-N55JEIM6.mjs";import{b as n,c as o}from"./chunk-6BL2PJRI.mjs";import{s}from"./chunk-VJN2RF4O.mjs";function T({sessionId:t,transaction:e}){o({sessionId:t,transaction:e});let i=s().transactions?.[t].transactions,a=r(i);return a&&n({sessionId:t,status:a}),a}export{T as a};
2
+ //# sourceMappingURL=chunk-FDN3ZMJB.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-SUBC3H4J.mjs";import{a as t}from"./chunk-U64LDJTG.mjs";import{a as n}from"./chunk-SWV35LLA.mjs";import{s as e}from"./chunk-EXE2PPR4.mjs";import{b as o}from"./chunk-7VHTZYM2.mjs";var w=async r=>{let{isGuarded:i}=n();if(!s({isGuarded:i,transactions:r}))return r;let a=r[0].sender.toBech32(),{walletAddress:d}=o(e());return await(await t({address:a,walletUrl:d}))?.guardTransactions(r)||[]};export{w as a};
2
- //# sourceMappingURL=chunk-AWV2BT4N.mjs.map
1
+ import{a as s}from"./chunk-SUBC3H4J.mjs";import{a as t}from"./chunk-U64LDJTG.mjs";import{a as n}from"./chunk-MDVHLIC7.mjs";import{s as e}from"./chunk-VJN2RF4O.mjs";import{b as o}from"./chunk-7VHTZYM2.mjs";var w=async r=>{let{isGuarded:i}=n();if(!s({isGuarded:i,transactions:r}))return r;let a=r[0].sender.toBech32(),{walletAddress:d}=o(e());return await(await t({address:a,walletUrl:d}))?.guardTransactions(r)||[]};export{w as a};
2
+ //# sourceMappingURL=chunk-FUSW6F2O.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as St}from"./chunk-SV3NP6BV.mjs";import{a as dt}from"./chunk-7SHSB2H7.mjs";import{a as vt}from"./chunk-6UZHM5LW.mjs";import{a as w}from"./chunk-3PTO3UT5.mjs";import{a as wt}from"./chunk-ZNCLQODX.mjs";import{a as bt}from"./chunk-UBOX3NGQ.mjs";import{a as It}from"./chunk-I3C6RYN6.mjs";import{a as Et}from"./chunk-7GTKSPKR.mjs";import{a as Ct}from"./chunk-ABBDCZHP.mjs";import{a as Mt}from"./chunk-4ODPAHHA.mjs";import{a as Nt}from"./chunk-YVVVV5XJ.mjs";import{b as x}from"./chunk-PR2UXLUQ.mjs";import{a as xt}from"./chunk-XJPDM2YR.mjs";import{a as At}from"./chunk-5TY2NRTY.mjs";import{a as Pt}from"./chunk-MDVI45IV.mjs";import{a as Ot}from"./chunk-IRQV762M.mjs";import{a as v}from"./chunk-SDF6BSQJ.mjs";import{a as it}from"./chunk-R64XZNJM.mjs";import{a as ht}from"./chunk-5MSC5VEJ.mjs";import{a as E}from"./chunk-IUCITH6E.mjs";import{a as A,f as yt}from"./chunk-5IJGFJ7A.mjs";import{b as L,d as gt}from"./chunk-P6DSLB4K.mjs";import{k as pt,l as lt,n as Tt}from"./chunk-E2GGD7D4.mjs";import{b as Lt}from"./chunk-EPRQ5A6W.mjs";import{a as N}from"./chunk-HORSXVIV.mjs";import{a as Ft}from"./chunk-SWV35LLA.mjs";import{a as nt}from"./chunk-XLBZPLWQ.mjs";import{a as C}from"./chunk-QTKK6OSJ.mjs";import{a as et}from"./chunk-6ACLOUQ3.mjs";import{a as I}from"./chunk-G7GU37XI.mjs";import{a as st}from"./chunk-YSCND2MX.mjs";import{a as Rt}from"./chunk-NJN53MJV.mjs";import{a as rt,b as ct,g as ut,l as mt}from"./chunk-M6MN4RXG.mjs";import{b as at}from"./chunk-NGM3AVCY.mjs";import{a as tt,b as ot,q as u,s as g}from"./chunk-EXE2PPR4.mjs";import{c as V,d as Y,f as J}from"./chunk-UERJ6AKK.mjs";import{b as h}from"./chunk-VNLGNNIL.mjs";import{b as S}from"./chunk-6JM4DPOH.mjs";import{b as Q,c as X,f as Z}from"./chunk-NTEMINYA.mjs";import{b as kt}from"./chunk-UCRVRBTA.mjs";import{a as ft}from"./chunk-FCB3AT5J.mjs";import{c as $}from"./chunk-OAVLO5YR.mjs";import{a as b}from"./chunk-LJX4MW7B.mjs";import K from"bignumber.js";import G from"lodash.isequal";var Bt=1e4,O=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=Bt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let o=setTimeout(()=>{F(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,o)};this.startWithCustomDuration=(t,o)=>{if(this.stop(t),o<=0)return;let e=setTimeout(()=>{P(t);let n=f[t];n?.()},o);this.timeoutIntervals.set(t,e)};this.stop=t=>{let o=this.timeoutIntervals.get(t);o&&(clearTimeout(o),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t??Bt}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};import Dt from"lodash.isequal";var Yt="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",M=class s extends ht{constructor(o){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.initialData={pendingTransactions:[],historicTransactions:[]};this.store=o||u(),this.data={...this.initialData}}static getInstance(){return s.instance||(s.instance=new s),s.instance}isNotificationsFeedOpen(){return this.isOpen}async openNotificationsFeed(){d.getInstance().hideToasts(),await this.openUI(),await this.updateDataAndNotifications();let e=this.store.subscribe(async({toasts:n,transactions:i},{toasts:r,transactions:c})=>{(!Dt(r.transactionToasts,n.transactionToasts)||!Dt(c,i))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Yt,[e]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}async handleCloseUI(){let o=d.getInstance();this.closeUI(),await o.showToasts()}async setupEventListeners(){this.eventBus&&(this.subscribeToEventBus("CLOSE_NOTIFICATIONS_FEED",this.handleCloseUI.bind(this)),this.subscribeToEventBus("CLEAR_NOTIFICATIONS_FEED_HISTORY",this.handleClearNotificationsFeedHistory.bind(this)))}async updateDataAndNotifications(){let{transactions:o}=this.store.getState(),{pendingTransactionToasts:e}=await w();this.data.pendingTransactions=e;let n=Object.keys(o).reduce((i,r)=>(["sent","pending"].includes(String(o[r].status))||(i[r]=o[r]),i),{});this.data.historicTransactions=await dt.getTransactionsHistory({transactionsSessions:n}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){gt(),this.resetData(),this.updateNotificationsFeed()}async updateNotificationsFeed(){this.eventBus&&(this.eventBus.publish("PENDING_TRANSACTIONS_UPDATE",this.data.pendingTransactions),this.eventBus.publish("TRANSACTIONS_HISTORY_UPDATE",this.data.historicTransactions))}};var k=class{constructor(t){this.toastsElement=null;this.eventBus=null;this.isCreatingElement=!1;this.eventBusUnsubscribeFunctions=[];this.onCloseToast=t.onCloseToast,this.store=t.store||u(),this.notificationsFeedManager=t.notificationsFeedManager||M.getInstance()}async init(){await this.subscribeToEventBusNotifications()}showToasts(){this.eventBus?.publish("SHOW_TOAST_LIST",null)}hideToasts(){this.eventBus?.publish("HIDE_TOAST_LIST",null)}async publishTransactionToasts(t){if(this.notificationsFeedManager.isNotificationsFeedOpen()&&this.eventBus){this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",t),this.hideToasts();return}if(!this.eventBus){let o=await this.createToastListElement();if(!o)return;this.eventBus=await o.getEventBus()}this.eventBus?.publish("TRANSACTION_TOAST_DATA_UPDATE",t)}async publishCustomToasts(t){this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",t)}handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}destroy(){this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[],this.notificationsFeedManager?.destroy()}async createToastListElement(){return this.toastsElement?this.toastsElement:(this.isCreatingElement||(this.isCreatingElement=!0,this.toastsElement=await ft.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}async subscribeToEventBusNotifications(){let t=await this.createToastListElement();if(t){if(this.eventBus=await t.getEventBus(),!this.eventBus)throw new Error("eventBus is not initialized");this.eventBus.subscribe("CLOSE_TOAST",this.onCloseToast),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("CLOSE_TOAST",this.onCloseToast)}),this.eventBus.subscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this))})}}};var d=class s{constructor(t){this.transactionToasts=[];this.customToasts=[];this.unsubscribeFromStore=()=>null;this.uiCoordinator=null;this.destroy(),this.store=t?.store||u(),this.lifetimeManager=t?.lifetimeManager??new O,this.uiCoordinator=t?.uiCoordinator??new k({onCloseToast:this.closeToast.bind(this)})}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),await this.updateTransactionToastsList(),await this.updateCustomToastList(),await this.uiCoordinator?.init(),this.unsubscribeFromStore=this.store.subscribe(async({toasts:o,transactions:e},{toasts:n,transactions:i})=>{let r=!G(n.transactionToasts,o.transactionToasts),c=!G(i,e);(r||c)&&await this.updateTransactionToastsList(),!G(n.customToasts,o.customToasts)&&await this.updateCustomToastList()})}static getInstance(){return s.instance||(s.instance=new s),s.instance}handleCompletedTransaction(t){let{transactions:o}=this.store.getState(),e=o[t];if(!e)return!1;let{status:n}=e,i=Tt(n),r=lt(n),c=pt(n),a=r||c||i;return a?(this.successfulToastLifetime&&this.lifetimeManager.start(t),a):(this.lifetimeManager.stop(t),a)}async createTransactionToast(t,o){let e=_t({toastId:t,totalDuration:o});return this.handleCompletedTransaction(t),await this.updateTransactionToastsList(),e}async createCustomToast(t){let o=B(t);return await this.updateCustomToastList(),o}async updateTransactionToastsList(){let t=this.store.getState(),{toasts:o}=t,{pendingTransactionToasts:e,completedTransactionToasts:n}=await w({store:t});this.transactionToasts=[...e,...n];for(let i of o.transactionToasts)this.handleCompletedTransaction(i.toastId);await this.publishTransactionToasts()}async updateCustomToastList(){let{toasts:t}=this.store.getState();this.customToasts=[];for(let o of t.customToasts){let n="message"in o?{...o}:{...o,instantiateToastElement:R[o.toastId]};this.customToasts.push(n),o.duration&&this.lifetimeManager.startWithCustomDuration(o.toastId,o.duration)}await this.uiCoordinator?.publishCustomToasts(this.customToasts)}handleTransactionToastClose(t){return this.handleCompletedTransaction(t)?(F(t),!0):!1}async showToasts(){this.uiCoordinator?.showToasts(),await this.updateCustomToastList(),await this.updateTransactionToastsList()}hideToasts(){this.uiCoordinator?.hideToasts()}closeToast(t){if(this.customToasts.find(e=>e.toastId===t)){this.lifetimeManager.stop(t);let e=f[t];return e?.(),P(t),!0}return this.handleTransactionToastClose(t)}async publishTransactionToasts(){await this.uiCoordinator?.publishTransactionToasts(this.transactionToasts)}destroy(){this.unsubscribeFromStore(),this.lifetimeManager?.destroy(),this.uiCoordinator?.destroy(),Ut()}};var D=class s{constructor(){this.store=u();this.warningLogoutTimeoutRef=null;this.actualLogoutTimeoutRef=null;this.plannedLogoutTimeoutRef=null;this.plannedLogoutKey=null;this.init=async()=>{if(!this.shouldStart())return;let t=this.store.getState(),o=h(t),{isExpired:e}=C(o?.nativeAuthToken);e?y().logout():this.addPlannedLogout()};this.stop=()=>{clearTimeout(this.warningLogoutTimeoutRef??0),clearTimeout(this.plannedLogoutTimeoutRef??0),clearTimeout(this.actualLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=null,this.plannedLogoutTimeoutRef=null,this.actualLogoutTimeoutRef=null,this.plannedLogoutKey=null};this.shouldStart=()=>{let t=this.store.getState(),o=h(t),e=J(t);return!!(o?.nativeAuthToken&&e)};this.addPlannedLogout=()=>{let t=y(),o=V(this.store.getState()),e=t.getType()===b.webview;if(!o||e)return;this.addLogoutWarning();let n=h(this.store.getState()),{secondsUntilExpires:i,expiresAt:r}=C(n?.nativeAuthToken),c=new K(String(i)),a=`${o}_${r}`,m=this.plannedLogoutKey===a;if(!(i&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=a,clearTimeout(this.plannedLogoutTimeoutRef??0);let l=c.times(1e3);this.actualLogoutTimeoutRef=setTimeout(()=>{d.getInstance().createCustomToast({toastId:"native-auth-logout",iconClassName:"warning",title:"Logging out",icon:"close",message:"Your session has expired!"}),this.actualLogoutTimeoutRef=null},l.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},l.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=S(this.store.getState()),o=h(this.store.getState()),{secondsUntilExpires:e}=C(o?.nativeAuthToken),n=new K(String(e)),i=n.times(1e3);if(!e||n.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new K(t?.tokenExpirationToastWarningSeconds??0).times(1e3),a=n.times(1e3).minus(c),m=vt(i.toNumber()),p=a.isLessThanOrEqualTo(0)?0:a.toNumber();clearTimeout(this.warningLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=setTimeout(()=>{d.getInstance().createCustomToast({toastId:"native-auth-expired",iconClassName:"warning",title:"Session Expiration Warning",icon:"hourglass",message:`Your session will expire in ${m}!`}),this.warningLogoutTimeoutRef=null},p)}}static getInstance(){return s.instance||(s.instance=new s),s.instance}};async function Wt({sessionId:s,transactionBatch:t,isSequential:o}){try{if(t==null)return;let e=bt(),n=Ct(t),i=await St(n);for(let T of i)await It({serverTransaction:T,sessionId:s,isSequential:o});if(!i.every(T=>T.status!=="pending"))return;e&&await U();let{transactions:c}=g(),a=c?.[s];if(a.transactions.every(T=>T.status==="success"))return L({sessionId:s,status:"success"});if(a.transactions.some(T=>T.status==="fail"))return L({sessionId:s,status:"fail"});if(a.transactions.every(T=>T.status==="not executed"))return L({sessionId:s,status:"invalid"})}catch(e){console.error(e)}}async function Ht(){let s=at(g()),t=Object.entries(s);t.length!==0&&await Promise.all(t.map(([o,{transactions:e}])=>Wt({sessionId:o,transactionBatch:e})))}async function _(){let s=u(),t=Et(),o=null,e=Y(s.getState())?.timestamp??null,n=async()=>{try{await Ht()}catch(p){console.error("[trackTransactions] Error checking transaction status:",p)}},i=()=>{o||(o=setInterval(n,t))},r=()=>{o&&(clearInterval(o),o=null)},c=()=>{r();let p=s.subscribe(({account:{websocketEvent:l}})=>{l?.message&&l.timestamp!=null&&e!==l.timestamp&&(e=l.timestamp,n())});$.set("websocketEventReceived",p)};n();let a=()=>{r()},m=s.subscribe(({account:{address:p},config:{websocketStatus:l}},T)=>{if(T.config.websocketStatus!==l)switch(l){case"completed":c();break;case"pending":i();break;default:p?i():a();break}});return $.set("websocketStatusChanged",m),{stopTransactionsTracking:a}}async function j({address:s,provider:t,apiAddress:o}){let e=await I({address:s,baseURL:o});if(!e)throw new Error("Account not found");Lt({address:s,providerType:t.getType()});let n={...e,username:N(e.username),nonce:E(e)};A(n),await x(s),_(),e.shard!=null&&await wt({shard:Number(e.shard),apiAddress:o})}async function Qt(s){let{network:{apiAddress:t}}=v();await s.login();let o=await s.getAddress();if(!o)throw new Error("Address not found");return await j({address:o,provider:s,apiAddress:t}),{address:o}}async function Xt({provider:s,nativeAuthConfig:t,token:o}){let{network:{apiAddress:e}}=v(),n=nt(t),i=o;i||(i=await n.initialize({noCache:!0}));let r=await s.login({token:i}),{address:c,signature:a,...m}=r;if(!c)return console.warn("Login cancelled."),null;if(!a)return console.error("Failed to sign login token"),null;let p=et(m?.accessToken),l=await xt({loginData:r,nativeAuthConfig:t,loginToken:i}),T=p?m.accessToken:n.getToken({address:c,token:l,signature:a});ot({loginToken:i,signature:a,nativeAuthToken:T});let H=await At({loginToken:i,extraInfoData:{multisig:m?.multisig,impersonate:m?.impersonate},address:c});return await j({address:H,provider:s,apiAddress:e}),{address:H,signature:a}}async function $t(s,t){let o=S(g());if(o)return await Xt({provider:s,nativeAuthConfig:o,token:t?.token});let{address:e}=await Qt(s);return await x(e),_(),{address:e,signature:""}}var z={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${ct}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${rt}-${Date.now()}`}},Zt={extensionResponse:"Unable to sign transactions","Transaction canceled":"Transaction canceled","cancelled by user":"Transaction signing cancelled by user","denied by the user":"Transaction signing denied by the user"},to=s=>{for(let[t,o]of Object.entries(Zt))if(s.includes(t))return o;return"Error when signing"};function q(s,t="error"){let o=s?.message,e=to(o),i=e!=="Error when signing"?"warning":t,r=Object.keys(z).includes(i)?z[i]:z.error,{toastId:c,iconClassName:a,title:m}=r;return B({toastId:c,duration:1e4,icon:"close",iconClassName:a,message:e,title:m}),e}async function Gt({provider:s,transactions:t,options:o={}}){await U();let{isGuarded:e,activeGuardianAddress:n,nonce:i}=Ft(),r=s.getType()===b.ledger,c=Mt({latestNonce:i,transactions:t}),a=n&&e&&!o.skipGuardian?c?.map(p=>(p.version=Q.withTxOptions().valueOf(),p.options=Z.withOptions({guarded:!0,...r?{hashSign:!0}:{}}).valueOf(),p.guardian=X.newFromBech32(n),p)):c,m=await s.signTransactions(a)??[];return yt(i+m.length),m}var W=class{constructor(t){this._isLoggingOut=!1;this.provider=t}init(){return this.provider.init()}async login(t){let o=await $t(this.provider,t);return tt(this.provider.getType()),Kt(this),D.getInstance().init(),o}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0}){if(this._isLoggingOut)return console.warn("Logout already in progress"),!1;this._isLoggingOut=!0;let o=await Nt({provider:this.provider,options:t});return this._isLoggingOut=!1,o}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,o){try{return await Gt({provider:this.provider,transactions:t,options:o})}catch(e){let n=q(e);throw new Error(n)}}async signMessage(t,o){try{return await Ot({provider:this.provider,message:t,options:o})}catch(e){let n=q(e,"warning");throw new Error(n)}}async verifyMessage(t){return await Pt(t)}cancelLogin(){this.provider.cancelLogin?.()}};var jt=null;function Kt(s){jt=s}function y(){return jt||new W(kt)}var oo=async()=>{try{let s=it(),{network:t}=v();try{let o=await I({address:s,baseURL:t.apiAddress});if(o!=null){let e={...o,username:N(o.username),nonce:E(o)};return A(e),e}}catch(o){console.error("Failed getting account ",o)}}catch(s){console.error("Failed getting address ",s)}return null};async function U(){let s=y();if(s==null)throw"Provider not initialized";try{if(!s.init)throw"Current provider does not have init() function";return await s.init()?await oo():void 0}catch(t){console.error("Failed initializing provider ",t)}}var R={},f={},so=(s,t)=>{u().setState(({toasts:o})=>{let e=o.customToasts.length>0?Math.max(...o.customToasts.map(a=>parseInt(a.toastId.split("-").pop()??"0"))):0,n=t??`custom-toast-${e+1}`,i=o.customToasts.findIndex(a=>a.toastId===n),r={...s,toastId:n};if(i!==-1){o.customToasts[i]=r;return}o.customToasts.push({...r,toastId:n})},!1,{type:"addCustomToast",payload:{value:{customToast:s,currentToastId:t}}})},P=s=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(o=>o.toastId!==s)},!1,{type:"removeCustomToast",payload:{value:s}})},Ut=()=>{u().setState(({toasts:s})=>{s.customToasts=[]},!1,{type:"removeAllCustomToasts",payload:{value:null}})},an=()=>{u().setState(({toasts:s})=>{s.transactionToasts=[]})},_t=({toastId:s,totalDuration:t})=>{let o="";return u().setState(({toasts:e})=>{let n=e.transactionToasts.length>0?Math.max(...e.transactionToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0;o=s??`transaction-toast-${n+1}`,e.transactionToasts.push({startTime:st(),endTime:Rt(t),toastId:o})},!1,"addTransactionToast"),o},F=s=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(o=>o.toastId!==s)},!1,"removeTransactionToast"),delete f[s],delete R[s]},B=s=>{let{toasts:t}=u().getState(),o=t.customToasts.length>0?Math.max(...t.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,e=s.toastId||`custom-toast-${o+1}`;return s.onClose&&(f[e]=s.onClose),s.instantiateToastElement?(R[e]=s.instantiateToastElement,u().setState(({toasts:n})=>{let i=n.customToasts.findIndex(a=>a.toastId===e),r={...s,instantiateToastElement:null,toastId:e};i!==-1?n.customToasts[i]=r:n.customToasts.push(r)},!1,"createCustomToast"),e):(so(s,e),e)};export{R as a,f as b,so as c,P as d,Ut as e,an as f,_t as g,F as h,B as i,O as j,M as k,k as l,d as m,D as n,Wt as o,Ht as p,_ as q,j as r,$t as s,q as t,Gt as u,W as v,Kt as w,y as x,U as y};
2
- //# sourceMappingURL=chunk-6V32BQRW.mjs.map
1
+ import{a as St}from"./chunk-JDIGAG2K.mjs";import{a as dt}from"./chunk-XPQSGRUF.mjs";import{a as vt}from"./chunk-6UZHM5LW.mjs";import{a as w}from"./chunk-GRGJ3KFV.mjs";import{a as wt}from"./chunk-46HT52TD.mjs";import{a as bt}from"./chunk-TP6GGLNS.mjs";import{a as It}from"./chunk-H3PMAMO7.mjs";import{a as Et}from"./chunk-TAFDGCRA.mjs";import{a as Ct}from"./chunk-ABBDCZHP.mjs";import{a as Mt}from"./chunk-4ODPAHHA.mjs";import{a as Nt}from"./chunk-TAA22QOF.mjs";import{b as x}from"./chunk-SPP2AXFW.mjs";import{a as xt}from"./chunk-HKZI76PK.mjs";import{a as At}from"./chunk-3ULRTEGS.mjs";import{a as Pt}from"./chunk-MDVI45IV.mjs";import{a as Ot}from"./chunk-CD7S5WQ2.mjs";import{a as v}from"./chunk-M2SIVB52.mjs";import{a as it}from"./chunk-ND5SC5UK.mjs";import{a as ht}from"./chunk-GPRR7WIH.mjs";import{a as E}from"./chunk-LMULG6DX.mjs";import{a as A,f as yt}from"./chunk-CO55WDEX.mjs";import{b as L,d as gt}from"./chunk-6BL2PJRI.mjs";import{k as pt,l as lt,n as Tt}from"./chunk-E2GGD7D4.mjs";import{b as Lt}from"./chunk-7KOIS7OQ.mjs";import{a as N}from"./chunk-HORSXVIV.mjs";import{a as Ft}from"./chunk-MDVHLIC7.mjs";import{a as nt}from"./chunk-NE6ED6BJ.mjs";import{a as C}from"./chunk-QTKK6OSJ.mjs";import{a as et}from"./chunk-6ACLOUQ3.mjs";import{a as I}from"./chunk-G7GU37XI.mjs";import{a as st}from"./chunk-YSCND2MX.mjs";import{a as Rt}from"./chunk-NJN53MJV.mjs";import{a as rt,b as ct,g as ut,l as mt}from"./chunk-M6MN4RXG.mjs";import{b as at}from"./chunk-NGM3AVCY.mjs";import{a as tt,b as ot,q as u,s as g}from"./chunk-VJN2RF4O.mjs";import{c as V,d as Y,f as J}from"./chunk-UERJ6AKK.mjs";import{b as h}from"./chunk-VNLGNNIL.mjs";import{b as S}from"./chunk-6JM4DPOH.mjs";import{b as Q,c as X,f as Z}from"./chunk-NTEMINYA.mjs";import{b as kt}from"./chunk-UCRVRBTA.mjs";import{a as ft}from"./chunk-4HACE72D.mjs";import{c as $}from"./chunk-HM3DDWL2.mjs";import{a as b}from"./chunk-LJX4MW7B.mjs";import K from"bignumber.js";import G from"lodash.isequal";var Bt=1e4,O=class{constructor(){this.timeoutIntervals=new Map;this.successfulToastLifetime=Bt;this.start=t=>{if(this.stop(t),this.successfulToastLifetime<=0)return;let o=setTimeout(()=>{F(t)},this.successfulToastLifetime);this.timeoutIntervals.set(t,o)};this.startWithCustomDuration=(t,o)=>{if(this.stop(t),o<=0)return;let e=setTimeout(()=>{P(t);let n=f[t];n?.()},o);this.timeoutIntervals.set(t,e)};this.stop=t=>{let o=this.timeoutIntervals.get(t);o&&(clearTimeout(o),this.timeoutIntervals.delete(t))}}init({successfulToastLifetime:t}){this.successfulToastLifetime=t??Bt}destroy(){this.timeoutIntervals.forEach(t=>clearTimeout(t)),this.timeoutIntervals.clear()}};import Dt from"lodash.isequal";var Yt="NOTIFICATIONS_FEED_STORE_SUBSCRIBE",M=class s extends ht{constructor(o){super({uiDataUpdateEvent:"OPEN_NOTIFICATIONS_FEED",uiTag:"mvx-notifications-feed"});this.initialData={pendingTransactions:[],historicTransactions:[]};this.store=o||u(),this.data={...this.initialData}}static getInstance(){return s.instance||(s.instance=new s),s.instance}isNotificationsFeedOpen(){return this.isOpen}async openNotificationsFeed(){d.getInstance().hideToasts(),await this.openUI(),await this.updateDataAndNotifications();let e=this.store.subscribe(async({toasts:n,transactions:i},{toasts:r,transactions:c})=>{(!Dt(r.transactionToasts,n.transactionToasts)||!Dt(c,i))&&await this.updateDataAndNotifications()});this.unsubscribeFunctions.set(Yt,[e]),this.eventBus?.publish("OPEN_NOTIFICATIONS_FEED"),await this.updateDataAndNotifications()}async handleCloseUI(){let o=d.getInstance();this.closeUI(),await o.showToasts()}async setupEventListeners(){this.eventBus&&(this.subscribeToEventBus("CLOSE_NOTIFICATIONS_FEED",this.handleCloseUI.bind(this)),this.subscribeToEventBus("CLEAR_NOTIFICATIONS_FEED_HISTORY",this.handleClearNotificationsFeedHistory.bind(this)))}async updateDataAndNotifications(){let{transactions:o}=this.store.getState(),{pendingTransactionToasts:e}=await w();this.data.pendingTransactions=e;let n=Object.keys(o).reduce((i,r)=>(["sent","pending"].includes(String(o[r].status))||(i[r]=o[r]),i),{});this.data.historicTransactions=await dt.getTransactionsHistory({transactionsSessions:n}),await this.updateNotificationsFeed()}handleClearNotificationsFeedHistory(){gt(),this.resetData(),this.updateNotificationsFeed()}async updateNotificationsFeed(){this.eventBus&&(this.eventBus.publish("PENDING_TRANSACTIONS_UPDATE",this.data.pendingTransactions),this.eventBus.publish("TRANSACTIONS_HISTORY_UPDATE",this.data.historicTransactions))}};var k=class{constructor(t){this.toastsElement=null;this.eventBus=null;this.isCreatingElement=!1;this.eventBusUnsubscribeFunctions=[];this.onCloseToast=t.onCloseToast,this.store=t.store||u(),this.notificationsFeedManager=t.notificationsFeedManager||M.getInstance()}async init(){await this.subscribeToEventBusNotifications()}showToasts(){this.eventBus?.publish("SHOW_TOAST_LIST",null)}hideToasts(){this.eventBus?.publish("HIDE_TOAST_LIST",null)}async publishTransactionToasts(t){if(this.notificationsFeedManager.isNotificationsFeedOpen()&&this.eventBus){this.eventBus.publish("TRANSACTION_TOAST_DATA_UPDATE",t),this.hideToasts();return}if(!this.eventBus){let o=await this.createToastListElement();if(!o)return;this.eventBus=await o.getEventBus()}this.eventBus?.publish("TRANSACTION_TOAST_DATA_UPDATE",t)}async publishCustomToasts(t){this.eventBus?.publish("CUSTOM_TOAST_DATA_UPDATE",t)}handleOpenNotificationsFeed(){this.notificationsFeedManager.openNotificationsFeed()}destroy(){this.eventBusUnsubscribeFunctions.forEach(t=>t()),this.eventBusUnsubscribeFunctions=[],this.notificationsFeedManager?.destroy()}async createToastListElement(){return this.toastsElement?this.toastsElement:(this.isCreatingElement||(this.isCreatingElement=!0,this.toastsElement=await ft.create({name:"mvx-toast-list"}),this.isCreatingElement=!1),this.toastsElement)}async subscribeToEventBusNotifications(){let t=await this.createToastListElement();if(t){if(this.eventBus=await t.getEventBus(),!this.eventBus)throw new Error("eventBus is not initialized");this.eventBus.subscribe("CLOSE_TOAST",this.onCloseToast),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("CLOSE_TOAST",this.onCloseToast)}),this.eventBus.subscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this)),this.eventBusUnsubscribeFunctions.push(()=>{this.eventBus?.unsubscribe("OPEN_NOTIFICATIONS_FEED",this.handleOpenNotificationsFeed.bind(this))})}}};var d=class s{constructor(t){this.transactionToasts=[];this.customToasts=[];this.unsubscribeFromStore=()=>null;this.uiCoordinator=null;this.destroy(),this.store=t?.store||u(),this.lifetimeManager=t?.lifetimeManager??new O,this.uiCoordinator=t?.uiCoordinator??new k({onCloseToast:this.closeToast.bind(this)})}async init({successfulToastLifetime:t=5e3}={}){this.successfulToastLifetime=t,this.lifetimeManager.init({successfulToastLifetime:t}),await this.updateTransactionToastsList(),await this.updateCustomToastList(),await this.uiCoordinator?.init(),this.unsubscribeFromStore=this.store.subscribe(async({toasts:o,transactions:e},{toasts:n,transactions:i})=>{let r=!G(n.transactionToasts,o.transactionToasts),c=!G(i,e);(r||c)&&await this.updateTransactionToastsList(),!G(n.customToasts,o.customToasts)&&await this.updateCustomToastList()})}static getInstance(){return s.instance||(s.instance=new s),s.instance}handleCompletedTransaction(t){let{transactions:o}=this.store.getState(),e=o[t];if(!e)return!1;let{status:n}=e,i=Tt(n),r=lt(n),c=pt(n),a=r||c||i;return a?(this.successfulToastLifetime&&this.lifetimeManager.start(t),a):(this.lifetimeManager.stop(t),a)}async createTransactionToast(t,o){let e=_t({toastId:t,totalDuration:o});return this.handleCompletedTransaction(t),await this.updateTransactionToastsList(),e}async createCustomToast(t){let o=B(t);return await this.updateCustomToastList(),o}async updateTransactionToastsList(){let t=this.store.getState(),{toasts:o}=t,{pendingTransactionToasts:e,completedTransactionToasts:n}=await w({store:t});this.transactionToasts=[...e,...n];for(let i of o.transactionToasts)this.handleCompletedTransaction(i.toastId);await this.publishTransactionToasts()}async updateCustomToastList(){let{toasts:t}=this.store.getState();this.customToasts=[];for(let o of t.customToasts){let n="message"in o?{...o}:{...o,instantiateToastElement:R[o.toastId]};this.customToasts.push(n),o.duration&&this.lifetimeManager.startWithCustomDuration(o.toastId,o.duration)}await this.uiCoordinator?.publishCustomToasts(this.customToasts)}handleTransactionToastClose(t){return this.handleCompletedTransaction(t)?(F(t),!0):!1}async showToasts(){this.uiCoordinator?.showToasts(),await this.updateCustomToastList(),await this.updateTransactionToastsList()}hideToasts(){this.uiCoordinator?.hideToasts()}closeToast(t){if(this.customToasts.find(e=>e.toastId===t)){this.lifetimeManager.stop(t);let e=f[t];return e?.(),P(t),!0}return this.handleTransactionToastClose(t)}async publishTransactionToasts(){await this.uiCoordinator?.publishTransactionToasts(this.transactionToasts)}destroy(){this.unsubscribeFromStore(),this.lifetimeManager?.destroy(),this.uiCoordinator?.destroy(),Ut()}};var D=class s{constructor(){this.store=u();this.warningLogoutTimeoutRef=null;this.actualLogoutTimeoutRef=null;this.plannedLogoutTimeoutRef=null;this.plannedLogoutKey=null;this.init=async()=>{if(!this.shouldStart())return;let t=this.store.getState(),o=h(t),{isExpired:e}=C(o?.nativeAuthToken);e?y().logout():this.addPlannedLogout()};this.stop=()=>{clearTimeout(this.warningLogoutTimeoutRef??0),clearTimeout(this.plannedLogoutTimeoutRef??0),clearTimeout(this.actualLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=null,this.plannedLogoutTimeoutRef=null,this.actualLogoutTimeoutRef=null,this.plannedLogoutKey=null};this.shouldStart=()=>{let t=this.store.getState(),o=h(t),e=J(t);return!!(o?.nativeAuthToken&&e)};this.addPlannedLogout=()=>{let t=y(),o=V(this.store.getState()),e=t.getType()===b.webview;if(!o||e)return;this.addLogoutWarning();let n=h(this.store.getState()),{secondsUntilExpires:i,expiresAt:r}=C(n?.nativeAuthToken),c=new K(String(i)),a=`${o}_${r}`,m=this.plannedLogoutKey===a;if(!(i&&c.isGreaterThan(0))||m)return;this.plannedLogoutKey=a,clearTimeout(this.plannedLogoutTimeoutRef??0);let l=c.times(1e3);this.actualLogoutTimeoutRef=setTimeout(()=>{d.getInstance().createCustomToast({toastId:"native-auth-logout",iconClassName:"warning",title:"Logging out",icon:"close",message:"Your session has expired!"}),this.actualLogoutTimeoutRef=null},l.toNumber()-3e3),this.plannedLogoutTimeoutRef=setTimeout(()=>{t.logout(),this.plannedLogoutTimeoutRef=null,this.plannedLogoutKey=null},l.toNumber())};this.addLogoutWarning=()=>{if(this.warningLogoutTimeoutRef)return;let t=S(this.store.getState()),o=h(this.store.getState()),{secondsUntilExpires:e}=C(o?.nativeAuthToken),n=new K(String(e)),i=n.times(1e3);if(!e||n.isLessThanOrEqualTo(0)||!t?.tokenExpirationToastWarningSeconds)return;let c=new K(t?.tokenExpirationToastWarningSeconds??0).times(1e3),a=n.times(1e3).minus(c),m=vt(i.toNumber()),p=a.isLessThanOrEqualTo(0)?0:a.toNumber();clearTimeout(this.warningLogoutTimeoutRef??0),this.warningLogoutTimeoutRef=setTimeout(()=>{d.getInstance().createCustomToast({toastId:"native-auth-expired",iconClassName:"warning",title:"Session Expiration Warning",icon:"hourglass",message:`Your session will expire in ${m}!`}),this.warningLogoutTimeoutRef=null},p)}}static getInstance(){return s.instance||(s.instance=new s),s.instance}};async function Wt({sessionId:s,transactionBatch:t,isSequential:o}){try{if(t==null)return;let e=bt(),n=Ct(t),i=await St(n);for(let T of i)await It({serverTransaction:T,sessionId:s,isSequential:o});if(!i.every(T=>T.status!=="pending"))return;e&&await U();let{transactions:c}=g(),a=c?.[s];if(a.transactions.every(T=>T.status==="success"))return L({sessionId:s,status:"success"});if(a.transactions.some(T=>T.status==="fail"))return L({sessionId:s,status:"fail"});if(a.transactions.every(T=>T.status==="not executed"))return L({sessionId:s,status:"invalid"})}catch(e){console.error(e)}}async function Ht(){let s=at(g()),t=Object.entries(s);t.length!==0&&await Promise.all(t.map(([o,{transactions:e}])=>Wt({sessionId:o,transactionBatch:e})))}async function _(){let s=u(),t=Et(),o=null,e=Y(s.getState())?.timestamp??null,n=async()=>{try{await Ht()}catch(p){console.error("[trackTransactions] Error checking transaction status:",p)}},i=()=>{o||(o=setInterval(n,t))},r=()=>{o&&(clearInterval(o),o=null)},c=()=>{r();let p=s.subscribe(({account:{websocketEvent:l}})=>{l?.message&&l.timestamp!=null&&e!==l.timestamp&&(e=l.timestamp,n())});$.set("websocketEventReceived",p)};n();let a=()=>{r()},m=s.subscribe(({account:{address:p},config:{websocketStatus:l}},T)=>{if(T.config.websocketStatus!==l)switch(l){case"completed":c();break;case"pending":i();break;default:p?i():a();break}});return $.set("websocketStatusChanged",m),{stopTransactionsTracking:a}}async function j({address:s,provider:t,apiAddress:o}){let e=await I({address:s,baseURL:o});if(!e)throw new Error("Account not found");Lt({address:s,providerType:t.getType()});let n={...e,username:N(e.username),nonce:E(e)};A(n),await x(s),_(),e.shard!=null&&await wt({shard:Number(e.shard),apiAddress:o})}async function Qt(s){let{network:{apiAddress:t}}=v();await s.login();let o=await s.getAddress();if(!o)throw new Error("Address not found");return await j({address:o,provider:s,apiAddress:t}),{address:o}}async function Xt({provider:s,nativeAuthConfig:t,token:o}){let{network:{apiAddress:e}}=v(),n=nt(t),i=o;i||(i=await n.initialize({noCache:!0}));let r=await s.login({token:i}),{address:c,signature:a,...m}=r;if(!c)return console.warn("Login cancelled."),null;if(!a)return console.error("Failed to sign login token"),null;let p=et(m?.accessToken),l=await xt({loginData:r,nativeAuthConfig:t,loginToken:i}),T=p?m.accessToken:n.getToken({address:c,token:l,signature:a});ot({loginToken:i,signature:a,nativeAuthToken:T});let H=await At({loginToken:i,extraInfoData:{multisig:m?.multisig,impersonate:m?.impersonate},address:c});return await j({address:H,provider:s,apiAddress:e}),{address:H,signature:a}}async function $t(s,t){let o=S(g());if(o)return await Xt({provider:s,nativeAuthConfig:o,token:t?.token});let{address:e}=await Qt(s);return await x(e),_(),{address:e,signature:""}}var z={error:{title:"Error when signing".toString(),iconClassName:"danger",toastId:`${ct}-${Date.now()}`},warning:{title:"Signing canceled".toString(),iconClassName:"warning",toastId:`${rt}-${Date.now()}`}},Zt={extensionResponse:"Unable to sign transactions","Transaction canceled":"Transaction canceled","cancelled by user":"Transaction signing cancelled by user","denied by the user":"Transaction signing denied by the user"},to=s=>{for(let[t,o]of Object.entries(Zt))if(s.includes(t))return o;return"Error when signing"};function q(s,t="error"){let o=s?.message,e=to(o),i=e!=="Error when signing"?"warning":t,r=Object.keys(z).includes(i)?z[i]:z.error,{toastId:c,iconClassName:a,title:m}=r;return B({toastId:c,duration:1e4,icon:"close",iconClassName:a,message:e,title:m}),e}async function Gt({provider:s,transactions:t,options:o={}}){await U();let{isGuarded:e,activeGuardianAddress:n,nonce:i}=Ft(),r=s.getType()===b.ledger,c=Mt({latestNonce:i,transactions:t}),a=n&&e&&!o.skipGuardian?c?.map(p=>(p.version=Q.withTxOptions().valueOf(),p.options=Z.withOptions({guarded:!0,...r?{hashSign:!0}:{}}).valueOf(),p.guardian=X.newFromBech32(n),p)):c,m=await s.signTransactions(a)??[];return yt(i+m.length),m}var W=class{constructor(t){this._isLoggingOut=!1;this.provider=t}init(){return this.provider.init()}async login(t){let o=await $t(this.provider,t);return tt(this.provider.getType()),Kt(this),D.getInstance().init(),o}isInitialized(){return this.provider.isInitialized()}async logout(t={shouldBroadcastLogoutAcrossTabs:!0}){if(this._isLoggingOut)return console.warn("Logout already in progress"),!1;this._isLoggingOut=!0;let o=await Nt({provider:this.provider,options:t});return this._isLoggingOut=!1,o}getType(){return this.provider.getType()}getProvider(){return this.provider}async signTransactions(t,o){try{return await Gt({provider:this.provider,transactions:t,options:o})}catch(e){let n=q(e);throw new Error(n)}}async signMessage(t,o){try{return await Ot({provider:this.provider,message:t,options:o})}catch(e){let n=q(e,"warning");throw new Error(n)}}async verifyMessage(t){return await Pt(t)}cancelLogin(){this.provider.cancelLogin?.()}};var jt=null;function Kt(s){jt=s}function y(){return jt||new W(kt)}var oo=async()=>{try{let s=it(),{network:t}=v();try{let o=await I({address:s,baseURL:t.apiAddress});if(o!=null){let e={...o,username:N(o.username),nonce:E(o)};return A(e),e}}catch(o){console.error("Failed getting account ",o)}}catch(s){console.error("Failed getting address ",s)}return null};async function U(){let s=y();if(s==null)throw"Provider not initialized";try{if(!s.init)throw"Current provider does not have init() function";return await s.init()?await oo():void 0}catch(t){console.error("Failed initializing provider ",t)}}var R={},f={},so=(s,t)=>{u().setState(({toasts:o})=>{let e=o.customToasts.length>0?Math.max(...o.customToasts.map(a=>parseInt(a.toastId.split("-").pop()??"0"))):0,n=t??`custom-toast-${e+1}`,i=o.customToasts.findIndex(a=>a.toastId===n),r={...s,toastId:n};if(i!==-1){o.customToasts[i]=r;return}o.customToasts.push({...r,toastId:n})},!1,{type:"addCustomToast",payload:{value:{customToast:s,currentToastId:t}}})},P=s=>{u().setState(({toasts:t})=>{t.customToasts=t.customToasts.filter(o=>o.toastId!==s)},!1,{type:"removeCustomToast",payload:{value:s}})},Ut=()=>{u().setState(({toasts:s})=>{s.customToasts=[]},!1,{type:"removeAllCustomToasts",payload:{value:null}})},an=()=>{u().setState(({toasts:s})=>{s.transactionToasts=[]})},_t=({toastId:s,totalDuration:t})=>{let o="";return u().setState(({toasts:e})=>{let n=e.transactionToasts.length>0?Math.max(...e.transactionToasts.map(i=>parseInt(i.toastId.split("-").pop()??"0"))):0;o=s??`transaction-toast-${n+1}`,e.transactionToasts.push({startTime:st(),endTime:Rt(t),toastId:o})},!1,"addTransactionToast"),o},F=s=>{u().setState(({toasts:t})=>{t.transactionToasts=t.transactionToasts.filter(o=>o.toastId!==s)},!1,"removeTransactionToast"),delete f[s],delete R[s]},B=s=>{let{toasts:t}=u().getState(),o=t.customToasts.length>0?Math.max(...t.customToasts.map(n=>parseInt(n.toastId.split("-").pop()??"0"))):0,e=s.toastId||`custom-toast-${o+1}`;return s.onClose&&(f[e]=s.onClose),s.instantiateToastElement?(R[e]=s.instantiateToastElement,u().setState(({toasts:n})=>{let i=n.customToasts.findIndex(a=>a.toastId===e),r={...s,instantiateToastElement:null,toastId:e};i!==-1?n.customToasts[i]=r:n.customToasts.push(r)},!1,"createCustomToast"),e):(so(s,e),e)};export{R as a,f as b,so as c,P as d,Ut as e,an as f,_t as g,F as h,B as i,O as j,M as k,k as l,d as m,D as n,Wt as o,Ht as p,_ as q,j as r,$t as s,q as t,Gt as u,W as v,Kt as w,y as x,U as y};
2
+ //# sourceMappingURL=chunk-GEPV5HLA.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-K2QNLOBA.mjs";import{a as t}from"./chunk-74YKEHCU.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-5MSC5VEJ.mjs.map
1
+ import{a as n}from"./chunk-3IZTM5SH.mjs";import{a as t}from"./chunk-JU3JK7ZW.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-GPRR7WIH.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as S}from"./chunk-ZATPIKZ2.mjs";import{j as p,k as d,l as f,n as u}from"./chunk-E2GGD7D4.mjs";import{a as I}from"./chunk-XXV6KGR4.mjs";import{a as m}from"./chunk-NGM3AVCY.mjs";import{a as l}from"./chunk-BFYSNMGP.mjs";import{s as T}from"./chunk-EXE2PPR4.mjs";import{c}from"./chunk-UERJ6AKK.mjs";async function G(g){let s=g?.store??T(),n=[],a=[],y=I(s),F=m(s),C=c(s);for(let o of y.transactionToasts){let r=F[o.toastId];if(!r?.status)continue;let{status:t,transactions:P,transactionsDisplayInfo:h}=r,L=await l({transactions:P,store:s}),O=u(t),R=f(t),v=d(t),e=O||R||v,w=p(t),{startTime:x,endTime:D}=o;if(e&&a.some(b=>b.toastId===o.toastId))continue;let i=S({toastId:o.toastId,address:C,status:t,transactions:L,transactionsDisplayInfo:h,startTime:x,endTime:D});e&&a.push(i),w&&n.push(i)}return{pendingTransactionToasts:n,completedTransactionToasts:a}}export{G as a};
2
- //# sourceMappingURL=chunk-3PTO3UT5.mjs.map
1
+ import{a as S}from"./chunk-ZATPIKZ2.mjs";import{j as p,k as d,l as f,n as u}from"./chunk-E2GGD7D4.mjs";import{a as I}from"./chunk-XXV6KGR4.mjs";import{a as m}from"./chunk-NGM3AVCY.mjs";import{a as l}from"./chunk-UK2P24V6.mjs";import{s as T}from"./chunk-VJN2RF4O.mjs";import{c}from"./chunk-UERJ6AKK.mjs";async function G(g){let s=g?.store??T(),n=[],a=[],y=I(s),F=m(s),C=c(s);for(let o of y.transactionToasts){let r=F[o.toastId];if(!r?.status)continue;let{status:t,transactions:P,transactionsDisplayInfo:h}=r,L=await l({transactions:P,store:s}),O=u(t),R=f(t),v=d(t),e=O||R||v,w=p(t),{startTime:x,endTime:D}=o;if(e&&a.some(b=>b.toastId===o.toastId))continue;let i=S({toastId:o.toastId,address:C,status:t,transactions:L,transactionsDisplayInfo:h,startTime:x,endTime:D});e&&a.push(i),w&&n.push(i)}return{pendingTransactionToasts:n,completedTransactionToasts:a}}export{G as a};
2
+ //# sourceMappingURL=chunk-GRGJ3KFV.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as A}from"./chunk-2IANAIWP.mjs";import{a as I}from"./chunk-EAJBSX6Y.mjs";import{a as b}from"./chunk-NI7XCWV5.mjs";import{g as f}from"./chunk-6V32BQRW.mjs";import{a as S}from"./chunk-N55JEIM6.mjs";import{b as T}from"./chunk-2VG3V3VD.mjs";import{a as y}from"./chunk-P6DSLB4K.mjs";import{a as h}from"./chunk-SWV35LLA.mjs";import{h as g}from"./chunk-M6MN4RXG.mjs";import{s as l}from"./chunk-EXE2PPR4.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-ZJ7L5STS.mjs.map
1
+ import{a as A}from"./chunk-3BOE7KMH.mjs";import{a as I}from"./chunk-EAJBSX6Y.mjs";import{a as b}from"./chunk-NI7XCWV5.mjs";import{g as f}from"./chunk-GEPV5HLA.mjs";import{a as S}from"./chunk-N55JEIM6.mjs";import{b as T}from"./chunk-2VG3V3VD.mjs";import{a as y}from"./chunk-6BL2PJRI.mjs";import{a as h}from"./chunk-MDVHLIC7.mjs";import{h as g}from"./chunk-M6MN4RXG.mjs";import{s as l}from"./chunk-VJN2RF4O.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-GUZERYYB.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-5V3ZVJ5N.mjs";import{a as u}from"./chunk-P5BMCXKE.mjs";import{a}from"./chunk-PMHRZ5Y7.mjs";import{b as o}from"./chunk-P6DSLB4K.mjs";import{l as p}from"./chunk-E2GGD7D4.mjs";var n={};async function b({serverTransaction:r,sessionId:t,isSequential:c}){let{hash:e,status:s,invalidTransaction:f,hasStatusChanged:S}=r;try{if(n[e]>30){o({sessionId:t,status:"timedOut"}),await a({sessionId:t,status:"timedOut"});return}if(f&&!c||s==="sent"){n[e]=n[e]?n[e]+1:1;return}if(c&&!s){let i=u({sessionId:t,transaction:r});await a({sessionId:t,status:i});return}if(S){let i=u({sessionId:t,transaction:r});await a({sessionId:t,status:i})}p(s)&&await m({sessionId:t,transaction:r})}catch(T){console.error(T),o({sessionId:t,status:"timedOut"}),await a({sessionId:t,status:"timedOut"})}}export{b as a};
2
- //# sourceMappingURL=chunk-I3C6RYN6.mjs.map
1
+ import{a as m}from"./chunk-BPJEBZSS.mjs";import{a as u}from"./chunk-FDN3ZMJB.mjs";import{a}from"./chunk-PMHRZ5Y7.mjs";import{b as o}from"./chunk-6BL2PJRI.mjs";import{l as p}from"./chunk-E2GGD7D4.mjs";var n={};async function b({serverTransaction:r,sessionId:t,isSequential:c}){let{hash:e,status:s,invalidTransaction:f,hasStatusChanged:S}=r;try{if(n[e]>30){o({sessionId:t,status:"timedOut"}),await a({sessionId:t,status:"timedOut"});return}if(f&&!c||s==="sent"){n[e]=n[e]?n[e]+1:1;return}if(c&&!s){let i=u({sessionId:t,transaction:r});await a({sessionId:t,status:i});return}if(S){let i=u({sessionId:t,transaction:r});await a({sessionId:t,status:i})}p(s)&&await m({sessionId:t,transaction:r})}catch(T){console.error(T),o({sessionId:t,status:"timedOut"}),await a({sessionId:t,status:"timedOut"})}}export{b as a};
2
+ //# sourceMappingURL=chunk-H3PMAMO7.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-YG6GGSSN.mjs";var i=String(o?.navigator?.userAgent),t=/^((?!chrome|android).)*safari/i.test(i),r=/firefox/i.test(i)&&/windows/i.test(i),n=t||r;export{t as a,n as b};
2
- //# sourceMappingURL=chunk-2FRFDBKB.mjs.map
1
+ import{a as o}from"./chunk-KXJUK6CN.mjs";var i=String(o?.navigator?.userAgent),t=/^((?!chrome|android).)*safari/i.test(i),r=/firefox/i.test(i)&&/windows/i.test(i),n=t||r;export{t as a,n as b};
2
+ //# sourceMappingURL=chunk-HA5UXXYU.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-2BKGSHOR.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-EUJRQFQG.mjs.map
1
+ import{a as e}from"./chunk-YBEBQWOE.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-HAHEJ5MG.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-XLBZPLWQ.mjs";import{a as g}from"./chunk-WE7YOBO7.mjs";import l from"lodash.isequal";async function C({loginData:f,nativeAuthConfig:r,loginToken:s}){let{address:m,signature:d,...n}=f,a=Object.keys(n).reduce((i,t)=>{let o=["multisig","impersonate"].includes(t)&&n[t]!=null?String(n[t]):null;return o!=null&&(i[t]=o.toString()),i},{}),e={...r};if(Object.keys(a).length>0&&(e.extraInfo=a),!l(r,e)){let i=g(s);return await u(e).initialize({noCache:!0,latestBlockInfo:{hash:i?.blockHash??"",timestamp:i?.extraInfo?.timestamp??0}})}return s}export{C as a};
2
- //# sourceMappingURL=chunk-XJPDM2YR.mjs.map
1
+ import{a as u}from"./chunk-NE6ED6BJ.mjs";import{a as g}from"./chunk-WE7YOBO7.mjs";import l from"lodash.isequal";async function C({loginData:f,nativeAuthConfig:r,loginToken:s}){let{address:m,signature:d,...n}=f,a=Object.keys(n).reduce((i,t)=>{let o=["multisig","impersonate"].includes(t)&&n[t]!=null?String(n[t]):null;return o!=null&&(i[t]=o.toString()),i},{}),e={...r};if(Object.keys(a).length>0&&(e.extraInfo=a),!l(r,e)){let i=g(s);return await u(e).initialize({noCache:!0,latestBlockInfo:{hash:i?.blockHash??"",timestamp:i?.extraInfo?.timestamp??0}})}return s}export{C as a};
2
+ //# sourceMappingURL=chunk-HKZI76PK.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-YG6GGSSN.mjs";import{createJSONStorage as o}from"zustand/middleware";var r={persistReducersStorageType:"localStorage"},i=e?o(()=>e[r.persistReducersStorageType]):void 0,p=new Map,n=3e3;export{r as a,i as b,p as c,n as d};
2
- //# sourceMappingURL=chunk-OAVLO5YR.mjs.map
1
+ import{a as e}from"./chunk-KXJUK6CN.mjs";import{createJSONStorage as o}from"zustand/middleware";var r={persistReducersStorageType:"localStorage"},i=e?o(()=>e[r.persistReducersStorageType]):void 0,p=new Map,n=3e3;export{r as a,i as b,p as c,n as d};
2
+ //# sourceMappingURL=chunk-HM3DDWL2.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-YDKZQMFY.mjs";var T=async a=>{let n=a.map(s=>s.hash),r=await e(n);return a.map(s=>{let t=r.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{T as a};
2
- //# sourceMappingURL=chunk-SV3NP6BV.mjs.map
1
+ import{a as e}from"./chunk-TC5SHARG.mjs";var T=async a=>{let n=a.map(s=>s.hash),r=await e(n);return a.map(s=>{let t=r.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{T as a};
2
+ //# sourceMappingURL=chunk-JDIGAG2K.mjs.map
@@ -0,0 +1,2 @@
1
+ function o(e){return e.length===0}export{o as a};
2
+ //# sourceMappingURL=chunk-JFP2BITI.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/managers/UnlockPanelManager/helpers/getIsSimpleLoginCallback.ts"],
4
+ "sourcesContent": ["import { LoginHandlerType } from '../UnlockPanelManager.types';\n\n/**\n * Checks if a login handler is a simple callback function or if it is a function that has arguments.\n * @param login - The login handler to check.\n * @returns True if the login handler is a simple callback function, false otherwise.\n */\nexport function getIsSimpleLoginCallback(\n login: LoginHandlerType\n): login is () => void {\n const takesZeroArguments = login.length === 0;\n return takesZeroArguments;\n}\n"],
5
+ "mappings": "AAOO,SAASA,EACdC,EACqB,CAErB,OAD2BA,EAAM,SAAW,CAE9C",
6
+ "names": ["getIsSimpleLoginCallback", "login"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{s as e}from"./chunk-VJN2RF4O.mjs";import{b as r}from"./chunk-7VHTZYM2.mjs";function d(t=e()){return r(t).explorerAddress}export{d as a};
2
+ //# sourceMappingURL=chunk-JH4L2BAI.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as ce}from"./chunk-M3YL36ZL.mjs";import{a as A}from"./chunk-6TAFMLIP.mjs";import{a as ae}from"./chunk-2Y66XRQK.mjs";import{a as oe}from"./chunk-JSA535AB.mjs";import{a as R}from"./chunk-KONLNCQL.mjs";import{a as ne}from"./chunk-WMSBYBUV.mjs";import{a as ie}from"./chunk-OTSQGZLA.mjs";import{a as te}from"./chunk-YUFPUG5O.mjs";import{a as de}from"./chunk-OZYD32IW.mjs";import{a as p}from"./chunk-EELETY3Z.mjs";import{a as re}from"./chunk-7I7SJXVG.mjs";import{a as S}from"./chunk-CIUJ7Q6E.mjs";import{a as se}from"./chunk-AWV2BT4N.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-7B7XIPV2.mjs";import{i as J,m as N,v as M,w as C,x as L}from"./chunk-6V32BQRW.mjs";import{a as y}from"./chunk-UBOX3NGQ.mjs";import{a as X}from"./chunk-R64XZNJM.mjs";import{a as U}from"./chunk-4TBVQD27.mjs";import{a as Q}from"./chunk-EPRQ5A6W.mjs";import{g as Y}from"./chunk-M6MN4RXG.mjs";import{a as q,q as F,s as c}from"./chunk-EXE2PPR4.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:"close",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(N.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"close",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,N.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??U.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??U.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-JPMLMIQR.mjs.map
1
+ import{a as ce}from"./chunk-M3YL36ZL.mjs";import{a as A}from"./chunk-U22RR2MN.mjs";import{a as ae}from"./chunk-2Y66XRQK.mjs";import{a as oe}from"./chunk-QY6K7L4I.mjs";import{a as R}from"./chunk-VVMACGAC.mjs";import{a as ne}from"./chunk-BDOEZAQW.mjs";import{a as ie}from"./chunk-AGXERDYF.mjs";import{a as te}from"./chunk-YUFPUG5O.mjs";import{a as de}from"./chunk-ACNCA5WT.mjs";import{a as p}from"./chunk-UB3WTGGF.mjs";import{a as re}from"./chunk-JICJ7JNX.mjs";import{a as S}from"./chunk-43L6QQVQ.mjs";import{a as se}from"./chunk-FUSW6F2O.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-7B7XIPV2.mjs";import{i as J,m as N,v as M,w as C,x as L}from"./chunk-GEPV5HLA.mjs";import{a as y}from"./chunk-TP6GGLNS.mjs";import{a as X}from"./chunk-ND5SC5UK.mjs";import{a as U}from"./chunk-4TBVQD27.mjs";import{a as Q}from"./chunk-7KOIS7OQ.mjs";import{g as Y}from"./chunk-M6MN4RXG.mjs";import{a as q,q as F,s as c}from"./chunk-VJN2RF4O.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:"close",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(N.getInstance().createCustomToast({toastId:"ledger-provider-idle-warning",icon:"close",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,N.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{if(this.provider?.isInitialized())return!0;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??U.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??U.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-JH7DXVOH.mjs.map