@layerswap/widget 1.0.6 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (437) hide show
  1. package/dist/esm/Models/LayerSwapSettings.js +0 -1
  2. package/dist/esm/Models/Theme.js +39 -0
  3. package/dist/esm/components/Buttons/submitButton.js +2 -1
  4. package/dist/esm/components/Common/ConnectWalletButton.js +9 -3
  5. package/dist/esm/components/Common/CountDownTimer.js +0 -1
  6. package/dist/esm/components/Common/WarningMessage.js +4 -2
  7. package/dist/esm/components/Common/guideLink.js +4 -6
  8. package/dist/esm/components/ErrorFallback.js +12 -12
  9. package/dist/esm/components/HeaderWithMenu.js +1 -1
  10. package/dist/esm/components/Icons/CircularLoader.js +5 -0
  11. package/dist/esm/components/Icons/FailIcon.js +2 -2
  12. package/dist/esm/components/Icons/GlobeIcon.js +3 -0
  13. package/dist/esm/components/Icons/MenuIcon.js +5 -0
  14. package/dist/esm/components/Icons/TokenIcon.js +1 -1
  15. package/dist/esm/components/Icons/Wallets/index.js +0 -1
  16. package/dist/esm/components/Input/Address/AddressNote.js +2 -2
  17. package/dist/esm/components/Input/Address/AddressPicker/AddressWithIcon.js +5 -2
  18. package/dist/esm/components/Input/Address/AddressPicker/index.js +15 -12
  19. package/dist/esm/components/Input/Address/ContractAddressNote.js +17 -0
  20. package/dist/esm/components/Input/Address/UrlAddressNote.js +10 -0
  21. package/dist/esm/components/Input/Amount/Balance.js +1 -1
  22. package/dist/esm/components/Input/Amount/ExchangeReceiveAmount.js +8 -0
  23. package/dist/esm/components/Input/Amount/MinMax.js +1 -1
  24. package/dist/esm/components/Input/Amount/PriceImpact.js +5 -40
  25. package/dist/esm/components/Input/Amount/ReceiveAmount.js +2 -2
  26. package/dist/esm/components/Input/Amount/index.js +3 -3
  27. package/dist/esm/components/Input/DestinationPicker.js +2 -2
  28. package/dist/esm/components/Input/RoutePicker/Content.js +19 -3
  29. package/dist/esm/components/Input/RoutePicker/RouteTokenSwitch.js +4 -4
  30. package/dist/esm/components/Input/RoutePicker/RouterPickerWalletConnect.js +5 -5
  31. package/dist/esm/components/Input/RoutePicker/Routes.js +27 -26
  32. package/dist/esm/components/Input/RoutePicker/Rows/CollapsableHeader.js +2 -2
  33. package/dist/esm/components/Input/RoutePicker/Rows/CollapsibleRow.js +3 -3
  34. package/dist/esm/components/Input/RoutePicker/Rows/StickyHeader.js +2 -2
  35. package/dist/esm/components/Input/RoutePicker/Rows/SuggestionsHeader.js +55 -0
  36. package/dist/esm/components/Input/RoutePicker/Rows/TitleRow.js +11 -0
  37. package/dist/esm/components/Input/RoutePicker/Rows/index.js +5 -6
  38. package/dist/esm/components/Input/RoutePicker/TokenTitleDetails.js +10 -0
  39. package/dist/esm/components/Input/RoutePicker/index.js +2 -2
  40. package/dist/esm/components/Input/SourceWalletPicker.js +6 -4
  41. package/dist/esm/components/Menu/MenuList.js +11 -19
  42. package/dist/esm/components/Menu/index.js +16 -7
  43. package/dist/esm/components/Modal/modalWithoutAnimation.js +3 -3
  44. package/dist/esm/components/Pages/Campaigns/Details/Leaderboard.js +2 -2
  45. package/dist/esm/components/Pages/Campaigns/Details/Rewards.js +2 -2
  46. package/dist/esm/components/Pages/Campaigns/Details/index.js +3 -4
  47. package/dist/esm/components/Pages/Campaigns/index.js +3 -4
  48. package/dist/esm/components/Pages/Swap/Form/ExchangeForm.js +21 -19
  49. package/dist/esm/components/Pages/Swap/Form/FeeDetails/Rate.js +6 -4
  50. package/dist/esm/components/Pages/Swap/Form/FeeDetails/Refuel.js +8 -3
  51. package/dist/esm/components/Pages/Swap/Form/FeeDetails/SwapQuote/DetailedEstimates.js +51 -14
  52. package/dist/esm/components/Pages/Swap/Form/FeeDetails/SwapQuote/SummaryRow.js +1 -1
  53. package/dist/esm/components/Pages/Swap/Form/FeeDetails/SwapQuote/index.js +3 -3
  54. package/dist/esm/components/Pages/Swap/Form/FeeDetails/index.js +10 -11
  55. package/dist/esm/components/Pages/Swap/Form/Form.js +27 -3
  56. package/dist/esm/components/Pages/Swap/Form/FormWrapper.js +35 -10
  57. package/dist/esm/components/Pages/Swap/Form/NetworkForm.js +13 -22
  58. package/dist/esm/components/Pages/Swap/Form/SecondaryComponents/FormButton.js +1 -1
  59. package/dist/esm/components/Pages/Swap/Form/SecondaryComponents/ReserveGasNote.js +8 -6
  60. package/dist/esm/components/Pages/Swap/Form/SecondaryComponents/validationError/ContractAddressValidationCache.js +19 -0
  61. package/dist/esm/components/Pages/Swap/Withdraw/Failed.js +12 -8
  62. package/dist/esm/components/Pages/Swap/Withdraw/ManualWithdraw.js +28 -9
  63. package/dist/esm/components/Pages/Swap/Withdraw/NotFound.js +15 -4
  64. package/dist/esm/components/Pages/Swap/Withdraw/Processing/Processing.js +44 -45
  65. package/dist/esm/components/Pages/Swap/Withdraw/Summary/Summary.js +2 -3
  66. package/dist/esm/components/Pages/Swap/Withdraw/Summary/index.js +2 -2
  67. package/dist/esm/components/Pages/Swap/Withdraw/SwapDetails.js +9 -7
  68. package/dist/esm/components/Pages/Swap/Withdraw/Wallet/Common/actionMessage.js +43 -0
  69. package/dist/esm/components/Pages/Swap/Withdraw/Wallet/Common/buttons.js +125 -71
  70. package/dist/esm/components/Pages/Swap/Withdraw/Wallet/index.js +56 -65
  71. package/dist/esm/components/Pages/Swap/Withdraw/WalletTransferButton.js +2 -2
  72. package/dist/esm/components/Pages/Swap/Withdraw/WalletTransferContent.js +2 -2
  73. package/dist/esm/components/Pages/Swap/Withdraw/Withdraw.js +3 -3
  74. package/dist/esm/components/Pages/Swap/Withdraw/index.js +5 -4
  75. package/dist/esm/components/Pages/Swap/Withdraw/messages/Message.js +4 -4
  76. package/dist/esm/components/Pages/Swap/Withdraw/messages/TransactionMessages.js +14 -15
  77. package/dist/esm/components/Pages/SwapHistory/History.js +2 -2
  78. package/dist/esm/components/Pages/SwapHistory/HistorySummary.js +1 -1
  79. package/dist/esm/components/Pages/SwapHistory/index.js +4 -4
  80. package/dist/esm/components/Select/Selector/SelectItem.js +1 -1
  81. package/dist/esm/components/Wallet/WalletComponents/ConnectedWallets.js +4 -4
  82. package/dist/esm/components/Wallet/WalletComponents/WalletsList.js +1 -1
  83. package/dist/esm/components/Wallet/WalletModal/Connector.js +2 -2
  84. package/dist/esm/components/Wallet/WalletModal/ConnectorsList.js +78 -125
  85. package/dist/esm/components/Wallet/WalletModal/InstalledExtensionNotFound.js +16 -0
  86. package/dist/esm/components/Wallet/WalletModal/LoadingConnect.js +27 -0
  87. package/dist/esm/components/Wallet/WalletModal/MultichainConnectorPicker.js +23 -0
  88. package/dist/esm/components/Wallet/WalletModal/ProviderPicker.js +26 -0
  89. package/dist/esm/components/Wallet/WalletModal/WalletQrCode.js +18 -0
  90. package/dist/esm/components/Wallet/WalletModal/index.js +4 -2
  91. package/dist/esm/components/Wallet/WalletProviders/index.js +4 -2
  92. package/dist/esm/components/Widget/Content.js +2 -2
  93. package/dist/esm/components/Widget/Footer.js +21 -21
  94. package/dist/esm/components/Widget/Index.js +2 -2
  95. package/dist/esm/components/WidgetLoading.js +9 -2
  96. package/dist/esm/components/shadcn/checkbox.js +1 -1
  97. package/dist/esm/context/ErrorProvider.js +14 -0
  98. package/dist/esm/context/LayerswapProvider.js +6 -5
  99. package/dist/esm/context/callbackProvider.js +60 -52
  100. package/dist/esm/context/resolverContext.js +11 -2
  101. package/dist/esm/context/swap.js +10 -13
  102. package/dist/esm/context/{balanceAccounts.js → swapAccounts.js} +17 -17
  103. package/dist/esm/context/validationContext.js +1 -1
  104. package/dist/esm/context/walletProviders.js +7 -1
  105. package/dist/esm/context/withdrawalContext.js +2 -2
  106. package/dist/esm/exports/internal.js +4 -3
  107. package/dist/esm/helpers/filterSourceNetworks.js +23 -0
  108. package/dist/esm/helpers/getSettings/getSettings.js +18 -13
  109. package/dist/esm/helpers/routes.js +4 -1
  110. package/dist/esm/hooks/useAllWithdrawalBalances.js +11 -5
  111. package/dist/esm/hooks/useConnectors.js +72 -0
  112. package/dist/esm/hooks/useFormRoutes.js +16 -8
  113. package/dist/esm/hooks/useFormValidation.js +5 -4
  114. package/dist/esm/hooks/useRouteValidation.js +1 -1
  115. package/dist/esm/hooks/useSwrSwaps.js +1 -1
  116. package/dist/esm/hooks/useTransfer.js +9 -0
  117. package/dist/esm/hooks/useWallet.js +7 -7
  118. package/dist/esm/lib/AppSettings.js +27 -16
  119. package/dist/esm/lib/ErrorHandler.js +6 -0
  120. package/dist/esm/lib/address/contractAddressResolver.js +12 -0
  121. package/dist/esm/lib/apiClients/layerSwapApiClient.js +19 -35
  122. package/dist/esm/lib/balances/balanceResolver.js +57 -11
  123. package/dist/esm/lib/balances/errorUtils.js +13 -0
  124. package/dist/esm/lib/balances/nodeErrorClassifier.js +22 -0
  125. package/dist/esm/lib/fees.js +50 -0
  126. package/dist/esm/lib/generateSwapInitialValues.js +2 -2
  127. package/dist/esm/lib/isNewListed.js +8 -0
  128. package/dist/esm/lib/knownIds.js +1 -0
  129. package/dist/esm/lib/resolvers/resolverService.js +19 -1
  130. package/dist/esm/lib/transfers/index.js +1 -0
  131. package/dist/esm/lib/transfers/transferResolver.js +14 -0
  132. package/dist/esm/stores/balanceStore.js +39 -18
  133. package/dist/esm/stores/contractAddressStore.js +178 -0
  134. package/dist/esm/stores/logStore.js +11 -0
  135. package/dist/esm/types/balance.js +23 -11
  136. package/dist/esm/types/contract.js +1 -0
  137. package/dist/esm/types/index.js +2 -0
  138. package/dist/esm/types/logEvents.js +1 -0
  139. package/dist/index.css +1 -1
  140. package/dist/tsconfig.tsbuildinfo +1 -1
  141. package/dist/types/Models/Balance.d.ts +14 -2
  142. package/dist/types/Models/Balance.d.ts.map +1 -1
  143. package/dist/types/Models/LayerSwapSettings.d.ts +7 -0
  144. package/dist/types/Models/LayerSwapSettings.d.ts.map +1 -1
  145. package/dist/types/Models/Theme.d.ts.map +1 -1
  146. package/dist/types/components/Buttons/submitButton.d.ts +1 -1
  147. package/dist/types/components/Buttons/submitButton.d.ts.map +1 -1
  148. package/dist/types/components/Common/ConnectWalletButton.d.ts +1 -1
  149. package/dist/types/components/Common/ConnectWalletButton.d.ts.map +1 -1
  150. package/dist/types/components/Common/CountDownTimer.d.ts.map +1 -1
  151. package/dist/types/components/Common/WarningMessage.d.ts.map +1 -1
  152. package/dist/types/components/Common/guideLink.d.ts.map +1 -1
  153. package/dist/types/components/ErrorFallback.d.ts.map +1 -1
  154. package/dist/types/components/HeaderWithMenu.d.ts.map +1 -1
  155. package/dist/types/components/Icons/CircularLoader.d.ts +4 -0
  156. package/dist/types/components/Icons/CircularLoader.d.ts.map +1 -0
  157. package/dist/types/components/Icons/FailIcon.d.ts.map +1 -1
  158. package/dist/types/components/Icons/GasIcon.d.ts.map +1 -1
  159. package/dist/types/components/Icons/GlobeIcon.d.ts +4 -0
  160. package/dist/types/components/Icons/GlobeIcon.d.ts.map +1 -0
  161. package/dist/types/components/Icons/MenuIcon.d.ts +4 -0
  162. package/dist/types/components/Icons/MenuIcon.d.ts.map +1 -0
  163. package/dist/types/components/Icons/TokenIcon.d.ts.map +1 -1
  164. package/dist/types/components/Icons/Wallets/index.d.ts +0 -1
  165. package/dist/types/components/Icons/Wallets/index.d.ts.map +1 -1
  166. package/dist/types/components/Input/Address/AddressNote.d.ts +5 -5
  167. package/dist/types/components/Input/Address/AddressNote.d.ts.map +1 -1
  168. package/dist/types/components/Input/Address/AddressPicker/AddressBook.d.ts +3 -3
  169. package/dist/types/components/Input/Address/AddressPicker/AddressButton.d.ts +3 -3
  170. package/dist/types/components/Input/Address/AddressPicker/AddressWithIcon.d.ts +3 -2
  171. package/dist/types/components/Input/Address/AddressPicker/AddressWithIcon.d.ts.map +1 -1
  172. package/dist/types/components/Input/Address/AddressPicker/ConnectedWallets.d.ts +2 -2
  173. package/dist/types/components/Input/Address/AddressPicker/ManualAddressInput.d.ts +4 -4
  174. package/dist/types/components/Input/Address/AddressPicker/index.d.ts +4 -4
  175. package/dist/types/components/Input/Address/AddressPicker/index.d.ts.map +1 -1
  176. package/dist/types/components/Input/Address/ContractAddressNote.d.ts +9 -0
  177. package/dist/types/components/Input/Address/ContractAddressNote.d.ts.map +1 -0
  178. package/dist/types/components/Input/Address/UrlAddressNote.d.ts +10 -0
  179. package/dist/types/components/Input/Address/UrlAddressNote.d.ts.map +1 -0
  180. package/dist/types/components/Input/Address/index.d.ts +1 -1
  181. package/dist/types/components/Input/Amount/Balance.d.ts +1 -1
  182. package/dist/types/components/Input/Amount/Balance.d.ts.map +1 -1
  183. package/dist/types/components/Input/Amount/ExchangeReceiveAmount.d.ts +11 -0
  184. package/dist/types/components/Input/Amount/ExchangeReceiveAmount.d.ts.map +1 -0
  185. package/dist/types/components/Input/Amount/MinMax.d.ts +1 -1
  186. package/dist/types/components/Input/Amount/PriceImpact.d.ts +3 -6
  187. package/dist/types/components/Input/Amount/PriceImpact.d.ts.map +1 -1
  188. package/dist/types/components/Input/Amount/ReceiveAmount.d.ts +2 -3
  189. package/dist/types/components/Input/Amount/ReceiveAmount.d.ts.map +1 -1
  190. package/dist/types/components/Input/Amount/helpers.d.ts +2 -2
  191. package/dist/types/components/Input/Amount/index.d.ts +1 -1
  192. package/dist/types/components/Input/CexPicker.d.ts +1 -1
  193. package/dist/types/components/Input/DestinationPicker.d.ts +1 -1
  194. package/dist/types/components/Input/DestinationPicker.d.ts.map +1 -1
  195. package/dist/types/components/Input/RoutePicker/Content.d.ts +5 -5
  196. package/dist/types/components/Input/RoutePicker/Content.d.ts.map +1 -1
  197. package/dist/types/components/Input/RoutePicker/RouterPickerWalletConnect.d.ts +1 -1
  198. package/dist/types/components/Input/RoutePicker/RouterPickerWalletConnect.d.ts.map +1 -1
  199. package/dist/types/components/Input/RoutePicker/Routes.d.ts +4 -8
  200. package/dist/types/components/Input/RoutePicker/Routes.d.ts.map +1 -1
  201. package/dist/types/components/Input/RoutePicker/Rows/CollapsableHeader.d.ts +3 -4
  202. package/dist/types/components/Input/RoutePicker/Rows/CollapsableHeader.d.ts.map +1 -1
  203. package/dist/types/components/Input/RoutePicker/Rows/CollapsibleRow.d.ts +6 -5
  204. package/dist/types/components/Input/RoutePicker/Rows/CollapsibleRow.d.ts.map +1 -1
  205. package/dist/types/components/Input/RoutePicker/Rows/StickyHeader.d.ts +3 -4
  206. package/dist/types/components/Input/RoutePicker/Rows/StickyHeader.d.ts.map +1 -1
  207. package/dist/types/components/Input/RoutePicker/Rows/SuggestionsHeader.d.ts +7 -0
  208. package/dist/types/components/Input/RoutePicker/Rows/SuggestionsHeader.d.ts.map +1 -0
  209. package/dist/types/components/Input/RoutePicker/Rows/TitleRow.d.ts +7 -0
  210. package/dist/types/components/Input/RoutePicker/Rows/TitleRow.d.ts.map +1 -0
  211. package/dist/types/components/Input/RoutePicker/Rows/index.d.ts +5 -5
  212. package/dist/types/components/Input/RoutePicker/Rows/index.d.ts.map +1 -1
  213. package/dist/types/components/Input/RoutePicker/TokenTitleDetails.d.ts +18 -0
  214. package/dist/types/components/Input/RoutePicker/TokenTitleDetails.d.ts.map +1 -0
  215. package/dist/types/components/Input/RoutePicker/index.d.ts +1 -1
  216. package/dist/types/components/Input/RoutePicker/index.d.ts.map +1 -1
  217. package/dist/types/components/Input/SourcePicker.d.ts +1 -1
  218. package/dist/types/components/Input/SourceWalletPicker.d.ts.map +1 -1
  219. package/dist/types/components/Menu/MenuList.d.ts.map +1 -1
  220. package/dist/types/components/Menu/index.d.ts.map +1 -1
  221. package/dist/types/components/Modal/modalWithoutAnimation.d.ts +4 -2
  222. package/dist/types/components/Modal/modalWithoutAnimation.d.ts.map +1 -1
  223. package/dist/types/components/Pages/Campaigns/Details/Leaderboard.d.ts +1 -1
  224. package/dist/types/components/Pages/Campaigns/Details/Rewards.d.ts +1 -1
  225. package/dist/types/components/Pages/Campaigns/Details/index.d.ts +1 -2
  226. package/dist/types/components/Pages/Campaigns/Details/index.d.ts.map +1 -1
  227. package/dist/types/components/Pages/Campaigns/index.d.ts +2 -3
  228. package/dist/types/components/Pages/Campaigns/index.d.ts.map +1 -1
  229. package/dist/types/components/Pages/Swap/Form/ExchangeForm.d.ts +3 -1
  230. package/dist/types/components/Pages/Swap/Form/ExchangeForm.d.ts.map +1 -1
  231. package/dist/types/components/Pages/Swap/Form/FeeDetails/Rate.d.ts +7 -6
  232. package/dist/types/components/Pages/Swap/Form/FeeDetails/Rate.d.ts.map +1 -1
  233. package/dist/types/components/Pages/Swap/Form/FeeDetails/ReceiveAmounts.d.ts +2 -2
  234. package/dist/types/components/Pages/Swap/Form/FeeDetails/Refuel.d.ts +1 -2
  235. package/dist/types/components/Pages/Swap/Form/FeeDetails/Refuel.d.ts.map +1 -1
  236. package/dist/types/components/Pages/Swap/Form/FeeDetails/RefuelModal.d.ts +1 -1
  237. package/dist/types/components/Pages/Swap/Form/FeeDetails/Slippage.d.ts +1 -1
  238. package/dist/types/components/Pages/Swap/Form/FeeDetails/SwapQuote/DetailedEstimates.d.ts +3 -2
  239. package/dist/types/components/Pages/Swap/Form/FeeDetails/SwapQuote/DetailedEstimates.d.ts.map +1 -1
  240. package/dist/types/components/Pages/Swap/Form/FeeDetails/SwapQuote/SummaryRow.d.ts +4 -4
  241. package/dist/types/components/Pages/Swap/Form/FeeDetails/SwapQuote/index.d.ts +4 -4
  242. package/dist/types/components/Pages/Swap/Form/FeeDetails/SwapQuote/index.d.ts.map +1 -1
  243. package/dist/types/components/Pages/Swap/Form/FeeDetails/SwapQuote/utils.d.ts +2 -2
  244. package/dist/types/components/Pages/Swap/Form/FeeDetails/index.d.ts +7 -4
  245. package/dist/types/components/Pages/Swap/Form/FeeDetails/index.d.ts.map +1 -1
  246. package/dist/types/components/Pages/Swap/Form/Form.d.ts.map +1 -1
  247. package/dist/types/components/Pages/Swap/Form/FormWrapper.d.ts +1 -1
  248. package/dist/types/components/Pages/Swap/Form/FormWrapper.d.ts.map +1 -1
  249. package/dist/types/components/Pages/Swap/Form/NetworkForm.d.ts +1 -1
  250. package/dist/types/components/Pages/Swap/Form/NetworkForm.d.ts.map +1 -1
  251. package/dist/types/components/Pages/Swap/Form/SecondaryComponents/FormButton.d.ts +1 -1
  252. package/dist/types/components/Pages/Swap/Form/SecondaryComponents/FormButton.d.ts.map +1 -1
  253. package/dist/types/components/Pages/Swap/Form/SecondaryComponents/ReserveGasNote.d.ts +2 -2
  254. package/dist/types/components/Pages/Swap/Form/SecondaryComponents/ReserveGasNote.d.ts.map +1 -1
  255. package/dist/types/components/Pages/Swap/Form/SecondaryComponents/validationError/ContractAddressValidationCache.d.ts +10 -0
  256. package/dist/types/components/Pages/Swap/Form/SecondaryComponents/validationError/ContractAddressValidationCache.d.ts.map +1 -0
  257. package/dist/types/components/Pages/Swap/Form/SecondaryComponents/validationError/ErrorDisplay.d.ts +1 -1
  258. package/dist/types/components/Pages/Swap/Form/SwapFormValues.d.ts +2 -2
  259. package/dist/types/components/Pages/Swap/Withdraw/Failed.d.ts.map +1 -1
  260. package/dist/types/components/Pages/Swap/Withdraw/ManualWithdraw.d.ts +4 -3
  261. package/dist/types/components/Pages/Swap/Withdraw/ManualWithdraw.d.ts.map +1 -1
  262. package/dist/types/components/Pages/Swap/Withdraw/NotFound.d.ts.map +1 -1
  263. package/dist/types/components/Pages/Swap/Withdraw/Processing/Processing.d.ts +1 -1
  264. package/dist/types/components/Pages/Swap/Withdraw/Processing/Processing.d.ts.map +1 -1
  265. package/dist/types/components/Pages/Swap/Withdraw/QuoteUpdate.d.ts +1 -1
  266. package/dist/types/components/Pages/Swap/Withdraw/Summary/Summary.d.ts +1 -1
  267. package/dist/types/components/Pages/Swap/Withdraw/Summary/Summary.d.ts.map +1 -1
  268. package/dist/types/components/Pages/Swap/Withdraw/SwapDetails.d.ts +2 -1
  269. package/dist/types/components/Pages/Swap/Withdraw/SwapDetails.d.ts.map +1 -1
  270. package/dist/types/components/Pages/Swap/Withdraw/SwapQuoteDetails.d.ts +3 -3
  271. package/dist/types/components/Pages/Swap/Withdraw/Wallet/Common/actionMessage.d.ts +6 -0
  272. package/dist/types/components/Pages/Swap/Withdraw/Wallet/Common/actionMessage.d.ts.map +1 -0
  273. package/dist/types/components/Pages/Swap/Withdraw/Wallet/Common/buttons.d.ts +4 -3
  274. package/dist/types/components/Pages/Swap/Withdraw/Wallet/Common/buttons.d.ts.map +1 -1
  275. package/dist/types/components/Pages/Swap/Withdraw/Wallet/Common/sharedTypes.d.ts +2 -1
  276. package/dist/types/components/Pages/Swap/Withdraw/Wallet/Common/sharedTypes.d.ts.map +1 -1
  277. package/dist/types/components/Pages/Swap/Withdraw/Wallet/index.d.ts +2 -1
  278. package/dist/types/components/Pages/Swap/Withdraw/Wallet/index.d.ts.map +1 -1
  279. package/dist/types/components/Pages/Swap/Withdraw/WalletTransferButton.d.ts +2 -1
  280. package/dist/types/components/Pages/Swap/Withdraw/WalletTransferButton.d.ts.map +1 -1
  281. package/dist/types/components/Pages/Swap/Withdraw/WalletTransferContent.d.ts +1 -1
  282. package/dist/types/components/Pages/Swap/Withdraw/Withdraw.d.ts +2 -1
  283. package/dist/types/components/Pages/Swap/Withdraw/Withdraw.d.ts.map +1 -1
  284. package/dist/types/components/Pages/Swap/Withdraw/index.d.ts +1 -2
  285. package/dist/types/components/Pages/Swap/Withdraw/index.d.ts.map +1 -1
  286. package/dist/types/components/Pages/Swap/Withdraw/messages/Message.d.ts.map +1 -1
  287. package/dist/types/components/Pages/Swap/Withdraw/messages/TransactionMessages.d.ts +3 -4
  288. package/dist/types/components/Pages/Swap/Withdraw/messages/TransactionMessages.d.ts.map +1 -1
  289. package/dist/types/components/Pages/SwapHistory/HistorySummary.d.ts +2 -2
  290. package/dist/types/components/Pages/SwapHistory/HistorySummary.d.ts.map +1 -1
  291. package/dist/types/components/Pages/SwapHistory/StatusIcons.d.ts +1 -1
  292. package/dist/types/components/Pages/SwapHistory/SwapDetailsComponent.d.ts +1 -1
  293. package/dist/types/components/Pages/SwapHistory/index.d.ts +3 -1
  294. package/dist/types/components/Pages/SwapHistory/index.d.ts.map +1 -1
  295. package/dist/types/components/Select/Command/commandSelect.d.ts.map +1 -1
  296. package/dist/types/components/Select/Selector/SelectItem.d.ts.map +1 -1
  297. package/dist/types/components/Wallet/WalletComponents/WalletsList.d.ts +3 -3
  298. package/dist/types/components/Wallet/WalletComponents/WalletsList.d.ts.map +1 -1
  299. package/dist/types/components/Wallet/WalletModal/Connector.d.ts +2 -1
  300. package/dist/types/components/Wallet/WalletModal/Connector.d.ts.map +1 -1
  301. package/dist/types/components/Wallet/WalletModal/ConnectorsList.d.ts +1 -1
  302. package/dist/types/components/Wallet/WalletModal/ConnectorsList.d.ts.map +1 -1
  303. package/dist/types/components/Wallet/WalletModal/InstalledExtensionNotFound.d.ts +7 -0
  304. package/dist/types/components/Wallet/WalletModal/InstalledExtensionNotFound.d.ts.map +1 -0
  305. package/dist/types/components/Wallet/WalletModal/LoadingConnect.d.ts +8 -0
  306. package/dist/types/components/Wallet/WalletModal/LoadingConnect.d.ts.map +1 -0
  307. package/dist/types/components/Wallet/WalletModal/MultichainConnectorPicker.d.ts +12 -0
  308. package/dist/types/components/Wallet/WalletModal/MultichainConnectorPicker.d.ts.map +1 -0
  309. package/dist/types/components/Wallet/WalletModal/ProviderPicker.d.ts +8 -0
  310. package/dist/types/components/Wallet/WalletModal/ProviderPicker.d.ts.map +1 -0
  311. package/dist/types/components/Wallet/WalletModal/WalletQrCode.d.ts +6 -0
  312. package/dist/types/components/Wallet/WalletModal/WalletQrCode.d.ts.map +1 -0
  313. package/dist/types/components/Wallet/WalletModal/index.d.ts +2 -1
  314. package/dist/types/components/Wallet/WalletModal/index.d.ts.map +1 -1
  315. package/dist/types/components/Wallet/WalletProviders/index.d.ts +3 -1
  316. package/dist/types/components/Wallet/WalletProviders/index.d.ts.map +1 -1
  317. package/dist/types/components/Widget/Content.d.ts +2 -1
  318. package/dist/types/components/Widget/Content.d.ts.map +1 -1
  319. package/dist/types/components/Widget/Footer.d.ts +2 -1
  320. package/dist/types/components/Widget/Footer.d.ts.map +1 -1
  321. package/dist/types/components/Widget/Index.d.ts +3 -2
  322. package/dist/types/components/Widget/Index.d.ts.map +1 -1
  323. package/dist/types/components/WidgetLoading.d.ts.map +1 -1
  324. package/dist/types/components/shadcn/command.d.ts +9 -52
  325. package/dist/types/components/shadcn/command.d.ts.map +1 -1
  326. package/dist/types/context/ErrorProvider.d.ts +3 -0
  327. package/dist/types/context/ErrorProvider.d.ts.map +1 -0
  328. package/dist/types/context/LayerswapProvider.d.ts +22 -4
  329. package/dist/types/context/LayerswapProvider.d.ts.map +1 -1
  330. package/dist/types/context/callbackProvider.d.ts +7 -10
  331. package/dist/types/context/callbackProvider.d.ts.map +1 -1
  332. package/dist/types/context/resolverContext.d.ts.map +1 -1
  333. package/dist/types/context/swap.d.ts +7 -7
  334. package/dist/types/context/swap.d.ts.map +1 -1
  335. package/dist/types/context/{balanceAccounts.d.ts → swapAccounts.d.ts} +9 -9
  336. package/dist/types/context/swapAccounts.d.ts.map +1 -0
  337. package/dist/types/context/walletProviders.d.ts.map +1 -1
  338. package/dist/types/context/withdrawalContext.d.ts +2 -0
  339. package/dist/types/context/withdrawalContext.d.ts.map +1 -1
  340. package/dist/types/exports/internal.d.ts +9 -7
  341. package/dist/types/exports/internal.d.ts.map +1 -1
  342. package/dist/types/helpers/accountSelectHelper.d.ts +1 -1
  343. package/dist/types/helpers/balanceHelper.d.ts +2 -2
  344. package/dist/types/helpers/filterSourceNetworks.d.ts +4 -0
  345. package/dist/types/helpers/filterSourceNetworks.d.ts.map +1 -0
  346. package/dist/types/helpers/getSettings/getSettings.d.ts +1 -1
  347. package/dist/types/helpers/getSettings/getSettings.d.ts.map +1 -1
  348. package/dist/types/helpers/routes.d.ts +1 -1
  349. package/dist/types/helpers/routes.d.ts.map +1 -1
  350. package/dist/types/helpers/tokenHelper.d.ts +2 -2
  351. package/dist/types/hooks/useAllWithdrawalBalances.d.ts +2 -1
  352. package/dist/types/hooks/useAllWithdrawalBalances.d.ts.map +1 -1
  353. package/dist/types/hooks/useConnectors.d.ts +28 -0
  354. package/dist/types/hooks/useConnectors.d.ts.map +1 -0
  355. package/dist/types/hooks/useFee.d.ts +1 -1
  356. package/dist/types/hooks/useFormRoutes.d.ts +2 -3
  357. package/dist/types/hooks/useFormRoutes.d.ts.map +1 -1
  358. package/dist/types/hooks/useFormValidation.d.ts +2 -1
  359. package/dist/types/hooks/useFormValidation.d.ts.map +1 -1
  360. package/dist/types/hooks/useSwapHistoryData.d.ts +2 -2
  361. package/dist/types/hooks/useTransfer.d.ts +5 -0
  362. package/dist/types/hooks/useTransfer.d.ts.map +1 -0
  363. package/dist/types/hooks/useWallet.d.ts +3 -3
  364. package/dist/types/hooks/useWallet.d.ts.map +1 -1
  365. package/dist/types/lib/AppSettings.d.ts +25 -16
  366. package/dist/types/lib/AppSettings.d.ts.map +1 -1
  367. package/dist/types/lib/ErrorHandler.d.ts +3 -0
  368. package/dist/types/lib/ErrorHandler.d.ts.map +1 -0
  369. package/dist/types/lib/address/contractAddressResolver.d.ts +7 -0
  370. package/dist/types/lib/address/contractAddressResolver.d.ts.map +1 -0
  371. package/dist/types/lib/apiClients/layerSwapApiClient.d.ts +1 -9
  372. package/dist/types/lib/apiClients/layerSwapApiClient.d.ts.map +1 -1
  373. package/dist/types/lib/balances/balanceResolver.d.ts +3 -3
  374. package/dist/types/lib/balances/balanceResolver.d.ts.map +1 -1
  375. package/dist/types/lib/balances/errorUtils.d.ts +12 -0
  376. package/dist/types/lib/balances/errorUtils.d.ts.map +1 -0
  377. package/dist/types/lib/balances/helpers.d.ts +1 -1
  378. package/dist/types/lib/balances/nodeErrorClassifier.d.ts +4 -0
  379. package/dist/types/lib/balances/nodeErrorClassifier.d.ts.map +1 -0
  380. package/dist/types/lib/balances/useBalance.d.ts +1 -1
  381. package/dist/types/lib/fees.d.ts +16 -0
  382. package/dist/types/lib/fees.d.ts.map +1 -1
  383. package/dist/types/lib/gases/gasResolver.d.ts +2 -2
  384. package/dist/types/lib/gases/useSWRGas.d.ts +3 -3
  385. package/dist/types/lib/generateSwapInitialValues.d.ts +1 -1
  386. package/dist/types/lib/isNewListed.d.ts +4 -0
  387. package/dist/types/lib/isNewListed.d.ts.map +1 -0
  388. package/dist/types/lib/knownIds.d.ts +1 -0
  389. package/dist/types/lib/knownIds.d.ts.map +1 -1
  390. package/dist/types/lib/nft/nftBalanceResolver.d.ts +1 -1
  391. package/dist/types/lib/resolvers/resolverService.d.ts +11 -5
  392. package/dist/types/lib/resolvers/resolverService.d.ts.map +1 -1
  393. package/dist/types/lib/transfers/index.d.ts +2 -0
  394. package/dist/types/lib/transfers/index.d.ts.map +1 -0
  395. package/dist/types/lib/transfers/transferResolver.d.ts +7 -0
  396. package/dist/types/lib/transfers/transferResolver.d.ts.map +1 -0
  397. package/dist/types/stores/balanceStore.d.ts +3 -0
  398. package/dist/types/stores/balanceStore.d.ts.map +1 -1
  399. package/dist/types/stores/contractAddressStore.d.ts +43 -0
  400. package/dist/types/stores/contractAddressStore.d.ts.map +1 -0
  401. package/dist/types/stores/logStore.d.ts +8 -0
  402. package/dist/types/stores/logStore.d.ts.map +1 -0
  403. package/dist/types/stores/walletStore.d.ts +1 -1
  404. package/dist/types/types/balance.d.ts +2 -2
  405. package/dist/types/types/balance.d.ts.map +1 -1
  406. package/dist/types/types/contract.d.ts +6 -0
  407. package/dist/types/types/contract.d.ts.map +1 -0
  408. package/dist/types/types/gas.d.ts +2 -2
  409. package/dist/types/types/index.d.ts +2 -0
  410. package/dist/types/types/index.d.ts.map +1 -1
  411. package/dist/types/types/logEvents.d.ts +59 -0
  412. package/dist/types/types/logEvents.d.ts.map +1 -0
  413. package/dist/types/types/nft.d.ts +1 -1
  414. package/dist/types/types/transfer.d.ts +7 -2
  415. package/dist/types/types/transfer.d.ts.map +1 -1
  416. package/dist/types/types/wallet.d.ts +29 -8
  417. package/dist/types/types/wallet.d.ts.map +1 -1
  418. package/package.json +3 -3
  419. package/dist/esm/components/Icons/Wallets/Keplr.js +0 -3
  420. package/dist/esm/components/Modal/popover.js +0 -15
  421. package/dist/esm/components/Wallet/WalletModal/utils.js +0 -23
  422. package/dist/esm/helpers/querryHelper.js +0 -13
  423. package/dist/esm/lib/logError.js +0 -17
  424. package/dist/esm/lib/sorting.js +0 -63
  425. package/dist/types/components/Icons/Wallets/Keplr.d.ts +0 -4
  426. package/dist/types/components/Icons/Wallets/Keplr.d.ts.map +0 -1
  427. package/dist/types/components/Modal/popover.d.ts +0 -12
  428. package/dist/types/components/Modal/popover.d.ts.map +0 -1
  429. package/dist/types/components/Wallet/WalletModal/utils.d.ts +0 -2
  430. package/dist/types/components/Wallet/WalletModal/utils.d.ts.map +0 -1
  431. package/dist/types/context/balanceAccounts.d.ts.map +0 -1
  432. package/dist/types/helpers/querryHelper.d.ts +0 -3
  433. package/dist/types/helpers/querryHelper.d.ts.map +0 -1
  434. package/dist/types/lib/logError.d.ts +0 -3
  435. package/dist/types/lib/logError.d.ts.map +0 -1
  436. package/dist/types/lib/sorting.d.ts +0 -22
  437. package/dist/types/lib/sorting.d.ts.map +0 -1
@@ -1,3 +1,2 @@
1
1
  export class LayerSwapSettings {
2
2
  }
3
- ;
@@ -209,5 +209,44 @@ export const THEME_COLORS = {
209
209
  '900': '0, 0, 0',
210
210
  'text': '182, 182, 182',
211
211
  },
212
+ },
213
+ "immutablePlay": {
214
+ tertiary: '182, 182, 182',
215
+ buttonTextColor: '19, 19, 19',
216
+ logo: '187, 187, 187',
217
+ header: {
218
+ hideMenu: true,
219
+ hideTabs: true,
220
+ hideWallets: true,
221
+ },
222
+ cardBackgroundStyle: {
223
+ backgroundColor: 'transparent',
224
+ },
225
+ primary: {
226
+ DEFAULT: '243, 243, 243',
227
+ '100': '255, 255, 255',
228
+ '200': '255, 255, 255',
229
+ '300': '255, 255, 255',
230
+ '400': '255, 255, 255',
231
+ '500': '243, 243, 243',
232
+ '600': '215, 215, 215',
233
+ '700': '187, 187, 187',
234
+ '800': '159, 159, 159',
235
+ '900': '131, 131, 131',
236
+ 'text': '243, 243, 243',
237
+ },
238
+ secondary: {
239
+ DEFAULT: '37, 37, 37',
240
+ '100': '119, 119, 119',
241
+ '200': '98, 98, 98',
242
+ '300': '78, 78, 78',
243
+ '400': '57, 57, 57',
244
+ '500': '37, 37, 37',
245
+ '600': '13, 13, 13',
246
+ '700': '13, 13, 13',
247
+ '800': '13, 13, 13',
248
+ '900': '0, 0, 0',
249
+ 'text': '182, 182, 182',
250
+ },
212
251
  }
213
252
  };
@@ -13,9 +13,10 @@ const SubmitButton = ({ isDisabled, isSubmitting, icon, children, type, onClick,
13
13
  return (_jsxs("button", { disabled: isDisabled || isSubmitting, type: type, onClick: onClick, style: style, className: clsx('enabled:active:animate-press-down text-primary focus:outline-none focus:ring-0 items-center space-x-1 disabled:bg-secondary-300 disabled:text-secondary-text/50 disabled:cursor-not-allowed relative w-full flex justify-center font-medium rounded-xl transform hover:brightness-125 transition duration-200 ease-in-out', {
14
14
  className,
15
15
  'text-primary-buttonTextColor bg-primary-500': buttonStyle === 'filled',
16
+ 'text-primary-text bg-secondary-300 hover:bg-secondary-400': buttonStyle === 'secondary',
16
17
  'py-4 px-4': size === 'large',
17
18
  'py-3 px-2 md:px-3': size === 'medium',
18
- 'py-1.5 px-1.5': size === 'small',
19
+ 'py-2.5 px-2.5 text-sm': size === 'small',
19
20
  }), children: [_jsxs("span", { className: `${button_align === "right" ? 'order-last' : 'order-first'} ${text_align === 'center' ? "absolute left-0 inset-y-0 flex items-center pl-3" : "relative"}`, children: [(!isDisabled && !isSubmitting) && icon, isSubmitting ?
20
21
  _jsx(SpinIcon, { className: "animate-spin h-5 w-5" })
21
22
  : null] }), _jsx("span", { className: `grow ${text_align === 'left' ? 'text-left' : 'text-center'}`, children: children })] }));
@@ -7,16 +7,22 @@ import { classNames } from "../../components/utils/classNames";
7
7
  const ConnectWalletButton = ({ provider, onConnect, descriptionText, ...rest }) => {
8
8
  const [isLoading, setIsLoading] = useState(false);
9
9
  const { connect } = useConnectModal();
10
+ const isProviderReady = typeof provider?.ready === 'boolean' ? provider.ready : true;
10
11
  const handleConnect = async () => {
12
+ if (!isProviderReady)
13
+ return;
11
14
  setIsLoading(true);
12
15
  const result = await connect(provider);
13
16
  if (onConnect && result)
14
17
  onConnect(result);
15
18
  setIsLoading(false);
16
19
  };
17
- return _jsx("button", { ...rest, type: "button", onClick: handleConnect, className: classNames(`py-5 px-6 bg-secondary-500 hover:bg-secondary-400 transition-colors duration-200 rounded-xl ${isLoading && 'cursor-progress opacity-80'}`, rest.className), children: _jsxs("div", { className: "flex flex-row justify-between gap-9 items-stretch", children: [_jsx(ResolveConnectorIcon, { connector: provider?.name, iconClassName: "w-10 h-10 p-0.5 rounded-lg bg-secondary-800 border border-secondary-400", className: "grid grid-cols-2 gap-1 min-w-fit" }), _jsxs("div", { className: "h-full space-y-2", children: [_jsx("p", { className: "text-sm font-medium text-secondary-text text-start", children: descriptionText ?? 'Connect your wallet to browse and select from your addresses' }), _jsx("div", { className: "bg-primary-700/30 border-none text-primary! py-2 rounded-lg text-base font-semibold", children: isLoading ?
18
- _jsxs("div", { className: "flex items-center gap-1 justify-center", children: [_jsx(RefreshCw, { className: "h-3 w-auto animate-spin" }), _jsx("span", { className: "ml-1", children: "Connecting..." })] })
20
+ return _jsx("button", { ...rest, type: "button", onClick: handleConnect, disabled: !isProviderReady || rest.disabled, className: classNames(`py-5 px-6 bg-secondary-500 hover:bg-secondary-400 transition-colors duration-200 rounded-xl ${(isLoading || !isProviderReady) && 'cursor-progress opacity-80'} disabled:opacity-50 disabled:cursor-not-allowed`, rest.className), children: _jsxs("div", { className: "flex flex-row justify-between gap-9 items-stretch", children: [_jsx(ResolveConnectorIcon, { connector: provider?.name, iconClassName: "w-10 h-10 p-0.5 rounded-lg bg-secondary-800 border border-secondary-400", className: "grid grid-cols-2 gap-1 min-w-fit" }), _jsxs("div", { className: "h-full space-y-2", children: [_jsx("p", { className: "text-sm font-medium text-secondary-text text-start", children: descriptionText ?? 'Connect your wallet to browse and select from your addresses' }), _jsx("div", { className: "bg-primary-700/30 border-none text-primary! py-2 rounded-lg text-base font-semibold", children: !isProviderReady ?
21
+ _jsxs("div", { className: "flex items-center gap-1 justify-center", children: [_jsx(RefreshCw, { className: "h-3 w-auto animate-spin" }), _jsx("span", { className: "ml-1", children: "Initializing..." })] })
19
22
  :
20
- _jsx(_Fragment, { children: "Connect Now" }) })] })] }) });
23
+ isLoading ?
24
+ _jsxs("div", { className: "flex items-center gap-1 justify-center", children: [_jsx(RefreshCw, { className: "h-3 w-auto animate-spin" }), _jsx("span", { className: "ml-1", children: "Connecting..." })] })
25
+ :
26
+ _jsx(_Fragment, { children: "Connect Now" }) })] })] }) });
21
27
  };
22
28
  export default ConnectWalletButton;
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
3
  import { SwapStatus } from "../../Models/SwapStatus";
4
4
  import { TransactionType } from "../../lib/apiClients/layerSwapApiClient";
5
- // import posthog from "posthog-js";
6
5
  const CountdownTimer = ({ initialTime, swapDetails, onThresholdChange }) => {
7
6
  const [elapsedTimer, setElapsedTimer] = useState(0);
8
7
  const [thresholdElapsed, setThresholdElapsed] = useState(false);
@@ -1,10 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { AlertOctagon, Scroll } from "lucide-react";
2
+ import { Scroll } from "lucide-react";
3
+ import InfoIcon from "../../components/Icons/InfoIcon";
4
+ import { ICON_CLASSES_WARNING } from "../../components/Pages/Swap/Form/SecondaryComponents/validationError/constants";
3
5
  function constructIcons(messageType) {
4
6
  let iconStyle;
5
7
  switch (messageType) {
6
8
  case 'warning':
7
- iconStyle = _jsx(AlertOctagon, { className: "sm:h-5 h-4 text-primary-text inline sm:block" });
9
+ iconStyle = _jsx(InfoIcon, { className: ICON_CLASSES_WARNING });
8
10
  break;
9
11
  case 'informing':
10
12
  iconStyle = _jsx(Scroll, { className: "sm:h-5 h-4 text-primary-text inline sm:block" });
@@ -1,12 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import SecondaryButton from "../Buttons/secondaryButton";
4
- import { DocIframe } from "./docInIframe";
5
- import Modal from "../Modal/modal";
6
4
  export default function GuideLink({ userGuideUrl, text, button, buttonClassNames }) {
7
5
  const [showGuide, setShowGuide] = useState(false);
8
- return (_jsxs(_Fragment, { children: [button ?
9
- _jsx(SecondaryButton, { onClick: () => setShowGuide(true), className: buttonClassNames, children: button })
10
- :
11
- _jsxs("span", { className: 'text-primary cursor-pointer hover:text-primary-400', onClick: () => setShowGuide(true), children: ["\u00A0", _jsx("span", { children: text })] }), _jsx(Modal, { className: "bg-[#181c1f]", height: "full", header: text || button, show: showGuide, setShow: setShowGuide, modalId: "guide", children: _jsx(DocIframe, { onConfirm: () => setShowGuide(false), URl: userGuideUrl }) })] }));
6
+ return (_jsx(_Fragment, { children: button ?
7
+ _jsx(SecondaryButton, { onClick: () => setShowGuide(true), className: buttonClassNames, children: button })
8
+ :
9
+ _jsxs("a", { target: "_blank", href: userGuideUrl, className: 'text-primary cursor-pointer hover:text-primary-400', children: ["\u00A0", _jsx("span", { children: text })] }) }));
12
10
  }
@@ -1,25 +1,25 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback } from "react";
2
+ import { useCallback, useEffect } from "react";
3
3
  import { useIntercom } from "react-use-intercom";
4
4
  import { Home, RotateCcw } from "lucide-react";
5
- // import posthog from "posthog-js";
6
5
  import MessageComponent from "./Common/MessageComponent";
7
6
  import NotFoundIcon from "./Icons/NotFoundIcon";
8
7
  import SubmitButton from "./Buttons/submitButton";
8
+ import { ErrorHandler } from "../lib/ErrorHandler";
9
9
  export default function ErrorFallback({ error, resetErrorBoundary }) {
10
10
  const { boot, show } = useIntercom();
11
- // useEffect(() => {
12
- // posthog.capture('$exception', {
13
- // name: error?.name,
14
- // $layerswap_exception_type: "Error Fallback",
15
- // message: error?.message,
16
- // where: 'ErrorFallback',
17
- // severity: 'error',
18
- // });
19
- // }, [])
11
+ useEffect(() => {
12
+ ErrorHandler({
13
+ type: "ErrorFallback",
14
+ message: error.message,
15
+ name: error.name,
16
+ stack: error.stack,
17
+ cause: error.cause
18
+ });
19
+ }, [error]);
20
20
  const startIntercom = useCallback(() => {
21
21
  boot();
22
22
  show();
23
23
  }, [boot, show]);
24
- return (_jsx("div", { className: "styled-scroll", children: _jsx("main", { className: "styled-scroll", children: _jsxs("div", { className: "min-h-screen overflow-hidden relative font-robo", children: [_jsx("div", { className: "mx-auto max-w-lg bg-secondary-700 shadow-card rounded-lg w-full overflow-hidden relative px-6 pt-6 pb-2 h-[500px] min-h-[550px]", children: _jsxs(MessageComponent, { children: [_jsxs(MessageComponent.Content, { center: true, children: [_jsxs(MessageComponent.Header, { className: "mb-3", children: [_jsx("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-red-600/20", children: _jsx(NotFoundIcon, {}) }), _jsx("h1", { className: "text-center text-2xl font-semibold text-primary-text", children: "Unable to complete the request" })] }), _jsx(MessageComponent.Description, { children: _jsxs("p", { className: "mx-auto text-center text-base font-normal leading-5 text-secondary-text px-9", children: [_jsx("span", { children: "Our team is informed and are now investigating the issue. Please try again, if the issue persists you can" }), _jsx("button", { type: "button", onClick: startIntercom, className: "mx-1 underline decoration-gray-400 underline-offset-2 hover:decoration-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#0f1420] focus:ring-gray-400 rounded", children: _jsx("span", { children: "contact our support." }) })] }) })] }), _jsx(MessageComponent.Buttons, { children: _jsxs("div", { className: "flex flex-col w-full text-primary-text text-base space-y-2", children: [_jsx(SubmitButton, { style: { display: 'ruby' }, className: "py-3 text-center ", button_align: "right", text_align: "left", isDisabled: false, isSubmitting: false, onClick: () => resetErrorBoundary(), icon: _jsx(RotateCcw, { className: "h-5 w-5", "aria-hidden": "true" }), children: _jsx("span", { children: "Try Again" }) }), _jsxs("button", { onClick: resetErrorBoundary, type: "button", className: "w-full inline-flex items-center justify-center gap-2 rounded-xl bg-secondary-300 px-5 py-3 text-base font-semibold leading-6 hover:bg-secondary-400 focus:outline-none transition", children: [_jsx(Home, { className: "h-5 w-5", "aria-hidden": "true" }), _jsx("span", { children: "Back to app" })] })] }) })] }) }), _jsx("div", { id: "widget_root" })] }) }) }));
24
+ return (_jsx("div", { className: "styled-scroll", children: _jsx("main", { className: "styled-scroll", children: _jsxs("div", { className: "min-h-screen overflow-hidden relative font-robo", children: [_jsx("div", { className: "mx-auto max-w-md bg-secondary-700 sm:shadow-card rounded-3xl w-full overflow-hidden relative px-4 pt-6 pb-4 h-dvh sm:h-[500px] min-h-[550px]", children: _jsxs(MessageComponent, { children: [_jsxs(MessageComponent.Content, { center: true, children: [_jsxs(MessageComponent.Header, { className: "mb-3", children: [_jsx("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-red-600/20", children: _jsx(NotFoundIcon, {}) }), _jsx("h1", { className: "text-center text-2xl font-semibold text-primary-text", children: "Unable to complete the request" })] }), _jsx(MessageComponent.Description, { children: _jsxs("p", { className: "mx-auto text-center text-base font-normal leading-5 text-secondary-text px-9", children: [_jsx("span", { children: "Our team is informed and are now investigating the issue. Please try again, if the issue persists you can" }), _jsx("button", { type: "button", onClick: startIntercom, className: "mx-1 underline decoration-gray-400 underline-offset-2 hover:decoration-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#0f1420] focus:ring-gray-400 rounded", children: _jsx("span", { children: "contact our support." }) })] }) })] }), _jsx(MessageComponent.Buttons, { children: _jsxs("div", { className: "flex flex-col w-full text-primary-text text-base space-y-2", children: [_jsx(SubmitButton, { style: { display: 'ruby' }, className: "py-3 text-center ", button_align: "right", text_align: "left", isDisabled: false, isSubmitting: false, onClick: () => resetErrorBoundary(), icon: _jsx(RotateCcw, { className: "h-5 w-5", "aria-hidden": "true" }), children: _jsx("span", { children: "Try Again" }) }), _jsxs("button", { onClick: resetErrorBoundary, type: "button", className: "w-full inline-flex items-center justify-center gap-2 rounded-xl bg-secondary-300 px-5 py-3 text-base font-semibold leading-6 hover:bg-secondary-400 focus:outline-none transition", children: [_jsx(Home, { className: "h-5 w-5", "aria-hidden": "true" }), _jsx("span", { children: "Back to app" })] })] }) })] }) }), _jsx("div", { id: "widget_root" })] }) }) }));
25
25
  }
@@ -13,7 +13,7 @@ function HeaderWithMenu({ goBack, contextualMenu }) {
13
13
  LayerSwapApiClient.apiKey !== AppSettings.LayerswapApiKeys['testnet'];
14
14
  const headerConfigs = AppSettings.ThemeData?.header;
15
15
  return (_jsxs("div", { className: "items-center justify-between sm:flex sm:items-center grid grid-cols-5 w-full sm:grid-cols-none sm:grid-none mt-2 pb-2 px-4", children: [_jsx("div", { className: "self-center col-start-1 md:col-start-2 md:col-span-3 justify-self-start md:justify-self-center flex items-center gap-2", children: goBack ?
16
- _jsx(IconButton, { onClick: goBack, "aria-label": "Go back", className: "-ml-2 inline-flex", icon: _jsx(ArrowLeft, { strokeWidth: "2" }) })
16
+ _jsx("div", { className: "ml-0", children: _jsx(IconButton, { onClick: goBack, "aria-label": "Go back", icon: _jsx(ArrowLeft, { strokeWidth: "2" }) }) })
17
17
  :
18
18
  headerConfigs?.hideTabs ? null :
19
19
  AppSettings.ThemeData?.enableWideVersion == true ?
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const CircularLoader = (props) => {
3
+ return _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "33", viewBox: "0 0 32 33", fill: "none", ...props, children: [_jsx("path", { "fill-rule": "evenodd", clipRule: "evenodd", d: "M30.4172 18.2327C31.26 18.4985 31.7278 19.3971 31.4621 20.2398L31.0633 21.5045L30.5291 22.7942L29.8845 24.0325L29.1345 25.2098L28.2847 26.3173L27.3416 27.3465L26.3124 28.2896L25.2049 29.1394L24.0275 29.8894L22.8513 30.5017C22.0675 30.9098 21.1013 30.6051 20.6933 29.8213C20.2852 29.0375 20.5899 28.0713 21.3737 27.6633L22.426 27.1155L23.3677 26.5156L24.2535 25.8359L25.0767 25.0816L25.831 24.2584L26.5107 23.3726L27.1106 22.4309L27.6261 21.4406L28.0534 20.409L28.4102 19.2776C28.6759 18.4348 29.5745 17.967 30.4172 18.2327Z", fill: "#E42575" }), _jsx("path", { "fill-rule": "evenodd", clipRule: "evenodd", d: "M30.5546 15.0937C29.6919 15.2849 28.8375 14.7406 28.6462 13.8779L28.3895 12.7197L28.0537 11.6548L27.6264 10.6233L27.1109 9.63291L26.511 8.69125L25.8313 7.80545L25.077 6.98226L24.2538 6.22795L23.368 5.54825L22.4263 4.94834L21.436 4.43279L20.4044 4.00552L19.3396 3.66977L18.2495 3.42811L17.1425 3.28238L16.0271 3.23367L14.9116 3.28238L13.8047 3.42811L12.7146 3.66977L11.6498 4.00551L10.6182 4.43279L9.62786 4.94834L8.68618 5.54825L7.80038 6.22795L6.9772 6.98226L6.22288 7.80545L5.54319 8.69124L4.94329 9.6329L4.42772 10.6233L4.00046 11.6548L3.66471 12.7197L3.42305 13.8097L3.27731 14.9167L3.22861 16.0322L3.27731 17.1476L3.42305 18.2546L3.66471 19.3446L4.00045 20.4095L4.42772 21.441L4.94328 22.4314L5.54319 23.3731L6.22288 24.2588L6.9772 25.082L7.80039 25.8364L8.68617 26.516L9.62787 27.116L10.6182 27.6315L11.6497 28.0588L12.7146 28.3945L13.8047 28.6362L14.9116 28.7819L16.0969 28.8337C16.9797 28.8722 17.6641 29.6191 17.6256 30.5019C17.587 31.3848 16.8401 32.0692 15.9573 32.0306L14.6325 31.9728L13.2485 31.7906L11.8856 31.4884L10.5542 31.0687L9.26455 30.5345L8.02632 29.8899L6.84899 29.1398L5.74151 28.29L4.7123 27.3469L3.76921 26.3177L2.9194 25.2102L2.16936 24.0329L1.52478 22.7947L0.990575 21.505L0.570802 20.1737L0.268661 18.8108L0.0864524 17.4268L0.0255624 16.0321L0.0864562 14.6375L0.268663 13.2535L0.570804 11.8907L0.990572 10.5593L1.52478 9.26961L2.16936 8.03139L2.91941 6.85405L3.76921 5.74657L4.7123 4.71736L5.7415 3.77427L6.84899 2.92447L8.02632 2.17442L9.26455 1.52984L10.5542 0.995635L11.8856 0.575864L13.2485 0.273725L14.6325 0.0915153L16.0271 0.030625L17.4217 0.091515L18.8057 0.273724L20.1686 0.575863L21.4999 0.995635L22.7896 1.52984L24.0278 2.17442L25.2052 2.92447L26.3127 3.77427L27.3419 4.71736L28.285 5.74657L29.1348 6.85405L29.8848 8.03139L30.5294 9.26961L31.0636 10.5593L31.4834 11.8907L31.7704 13.1853C31.9616 14.048 31.4173 14.9024 30.5546 15.0937Z", fill: "#F8C8DC" })] });
4
+ };
5
+ export default CircularLoader;
@@ -1,3 +1,3 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- const FailIcon = (props) => _jsxs("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", width: "116", height: "116", viewBox: "0 0 116 116", fill: "none", children: [_jsx("circle", { cx: "58", cy: "58", r: "58", fill: "#E43636", fillOpacity: "0.1" }), _jsx("circle", { cx: "58", cy: "58", r: "45", fill: "#E43636", fillOpacity: "0.5" }), _jsx("circle", { cx: "58", cy: "58", r: "30", fill: "#E43636" }), _jsx("path", { d: "M48 69L68 48", stroke: "white", strokeWidth: "3.15789", strokeLinecap: "round" }), _jsx("path", { d: "M48 48L68 69", stroke: "white", strokeWidth: "3.15789", strokeLinecap: "round" })] });
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const FailIcon = (props) => _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "21", height: "21", viewBox: "0 0 21 21", fill: "none", ...props, children: _jsx("path", { d: "M17.086 17.086C16.1425 18.028 15.0183 18.7695 13.781 19.266C12.547 19.766 11.289 20.016 10.008 20.016C8.71357 20.0133 7.43205 19.7586 6.235 19.266C4.99768 18.7695 3.8735 18.028 2.93 17.086C1.98799 16.1425 1.24647 15.0183 0.75 13.781C0.257417 12.584 0.00267468 11.3024 0 10.008C0 8.727 0.25 7.468 0.75 6.235C1.24652 4.99768 1.98804 3.8735 2.93 2.93C3.8735 1.98804 4.99768 1.24652 6.235 0.75C7.43205 0.257441 8.71357 0.0027002 10.008 0C11.289 0 12.548 0.25 13.781 0.75C15.0183 1.24647 16.1425 1.98799 17.086 2.93C18.028 3.8735 18.7695 4.99768 19.266 6.235C19.7586 7.43205 20.0133 8.71357 20.016 10.008C20.016 11.289 19.766 12.548 19.266 13.781C18.7695 15.0183 18.028 16.1425 17.086 17.086V17.086ZM7.524 6.469C7.45699 6.40041 7.37663 6.34629 7.28788 6.31C7.19912 6.27371 7.10387 6.25601 7.008 6.258C6.80775 6.25628 6.61447 6.33144 6.468 6.468C6.33144 6.61447 6.25628 6.80775 6.258 7.008C6.258 7.211 6.328 7.383 6.468 7.524L8.954 10.008L6.47 12.492C6.40123 12.5589 6.34693 12.6392 6.31046 12.728C6.27399 12.8168 6.25614 12.9121 6.258 13.008C6.258 13.211 6.328 13.391 6.468 13.548C6.625 13.688 6.805 13.758 7.008 13.758C7.211 13.758 7.383 13.688 7.524 13.548L10.008 11.062L12.492 13.546C12.633 13.686 12.805 13.757 13.008 13.757C13.211 13.757 13.391 13.687 13.548 13.547C13.6846 13.4005 13.7597 13.2072 13.758 13.007C13.7601 12.9112 13.7426 12.816 13.7065 12.7272C13.6703 12.6385 13.6164 12.5581 13.548 12.491L11.062 10.008L13.546 7.524C13.686 7.383 13.757 7.211 13.757 7.008C13.7587 6.80775 13.6836 6.61447 13.547 6.468C13.4005 6.33144 13.2072 6.25628 13.007 6.258C12.9112 6.25588 12.816 6.27342 12.7272 6.30954C12.6385 6.34566 12.5581 6.39959 12.491 6.468L10.008 8.954L7.524 6.469Z", fill: "rgb(var(--ls-colors-error-foreground))" }) });
3
3
  export default FailIcon;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const GlobeIcon = (props) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", ...props, children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0ZM7.26465 13.5C7.45716 14.7252 7.74486 15.8122 8.09961 16.6992C8.43365 17.5343 8.80718 18.1438 9.16992 18.5273C9.53052 18.9085 9.81134 19 10 19C10.1887 19 10.4695 18.9085 10.8301 18.5273C11.1928 18.1438 11.5664 17.5343 11.9004 16.6992C12.1109 16.1729 12.2967 15.576 12.4541 14.9219C11.7737 14.729 11.2425 14.1869 11.0654 13.5H7.26465ZM1.70605 13.5C2.83227 16.1655 5.20626 18.1733 8.0957 18.7959C7.25214 17.652 6.5925 15.7717 6.25293 13.5H1.70605ZM14.9346 13.5C14.7516 14.2101 14.1899 14.7648 13.4766 14.9395C13.1068 16.5637 12.5613 17.9038 11.9033 18.7959C14.7932 18.1735 17.1676 16.1658 18.2939 13.5H14.9346ZM1.35449 7.5C1.12532 8.29394 1 9.13227 1 10C1 10.8677 1.12532 11.7061 1.35449 12.5H6.12598C6.04371 11.701 6 10.8632 6 10C6 9.57633 6.0108 9.15883 6.03125 8.74902C5.55765 8.48615 5.20378 8.03685 5.06543 7.5H1.35449ZM13.874 7.5C13.9563 8.29905 14 9.13675 14 10C14 10.4233 13.9882 10.8405 13.9678 11.25C14.442 11.5128 14.7961 11.9627 14.9346 12.5H18.6455C18.8747 11.7061 19 10.8677 19 10C19 9.13227 18.8747 8.29394 18.6455 7.5H13.874ZM8.93457 7.5C8.71414 8.35537 7.94426 8.98789 7.02246 8.99805C7.0086 9.32666 7 9.66088 7 10C7 10.8698 7.04749 11.7077 7.13281 12.5H11.0654C11.2858 11.6449 12.0552 11.0116 12.9766 11.001C12.9904 10.6727 13 10.3388 13 10C13 9.13018 12.9525 8.29226 12.8672 7.5H8.93457ZM8.0957 1.20312C5.20617 1.82567 2.8323 3.83442 1.70605 6.5H5.06543C5.24836 5.79017 5.80944 5.23445 6.52246 5.05957C6.89199 3.43525 7.43773 2.0951 8.0957 1.20312ZM10 1C9.81134 1 9.53052 1.09148 9.16992 1.47266C8.80718 1.85623 8.43365 2.46568 8.09961 3.30078C7.88921 3.82687 7.70228 4.42326 7.54492 5.07715C8.22587 5.26974 8.75745 5.81269 8.93457 6.5H12.7354C12.5428 5.27477 12.2551 4.1878 11.9004 3.30078C11.5664 2.46568 11.1928 1.85623 10.8301 1.47266C10.4695 1.09148 10.1887 1 10 1ZM11.9033 1.20312C12.7473 2.34695 13.4074 4.22759 13.7471 6.5H18.2939C17.1676 3.83413 14.7933 1.82544 11.9033 1.20312Z", fill: "currentColor" }) }));
3
+ export default GlobeIcon;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const MenuIcon = (props) => {
3
+ return _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", ...props, children: [_jsx("path", { "fill-rule": "evenodd", clipRule: "evenodd", d: "M8 8C8.55228 8 9 7.55228 9 7C9 6.44772 8.55228 6 8 6C7.44772 6 7 6.44772 7 7C7 7.55228 7.44772 8 8 8ZM8 9C9.10457 9 10 8.10457 10 7C10 5.89543 9.10457 5 8 5C6.89543 5 6 5.89543 6 7C6 8.10457 6.89543 9 8 9Z", fill: "#A3ADC2" }), _jsx("path", { d: "M7.13477 6.5C7.04953 6.64718 7 6.81768 7 7C7 7.18232 7.04953 7.35282 7.13477 7.5H4.5C4.22386 7.5 4 7.27614 4 7C4 6.72386 4.22386 6.5 4.5 6.5H7.13477ZM19.5 6.5C19.7761 6.5 20 6.72386 20 7C20 7.27614 19.7761 7.5 19.5 7.5H8.86523C8.95047 7.35282 9 7.18232 9 7C9 6.81768 8.95047 6.64718 8.86523 6.5H19.5Z", fill: "#A3ADC2" }), _jsx("path", { d: "M14.0654 11.5C14.0242 11.66 14 11.8271 14 12C14 12.1729 14.0242 12.34 14.0654 12.5H4.5C4.22386 12.5 4 12.2761 4 12C4 11.7239 4.22386 11.5 4.5 11.5H14.0654ZM19.5 11.5C19.7761 11.5 20 11.7239 20 12C20 12.2761 19.7761 12.5 19.5 12.5H17.9346C17.9758 12.34 18 12.1729 18 12C18 11.8271 17.9758 11.66 17.9346 11.5H19.5Z", fill: "#A3ADC2" }), _jsx("path", { "fill-rule": "evenodd", clipRule: "evenodd", d: "M16 13C16.5523 13 17 12.5523 17 12C17 11.4477 16.5523 11 16 11C15.4477 11 15 11.4477 15 12C15 12.5523 15.4477 13 16 13ZM16 14C17.1046 14 18 13.1046 18 12C18 10.8954 17.1046 10 16 10C14.8954 10 14 10.8954 14 12C14 13.1046 14.8954 14 16 14Z", fill: "#A3ADC2" }), _jsx("path", { d: "M6.06543 16.5C6.0242 16.66 6 16.8271 6 17C6 17.1729 6.0242 17.34 6.06543 17.5H4.5C4.22386 17.5 4 17.2761 4 17C4 16.7239 4.22386 16.5 4.5 16.5H6.06543ZM19.5 16.5C19.7761 16.5 20 16.7239 20 17C20 17.2761 19.7761 17.5 19.5 17.5H9.93457C9.9758 17.34 10 17.1729 10 17C10 16.8271 9.9758 16.66 9.93457 16.5H19.5Z", fill: "#A3ADC2" }), _jsx("path", { "fill-rule": "evenodd", clipRule: "evenodd", d: "M8 18C8.55228 18 9 17.5523 9 17C9 16.4477 8.55228 16 8 16C7.44772 16 7 16.4477 7 17C7 17.5523 7.44772 18 8 18ZM8 19C9.10457 19 10 18.1046 10 17C10 15.8954 9.10457 15 8 15C6.89543 15 6 15.8954 6 17C6 18.1046 6.89543 19 8 19Z", fill: "#A3ADC2" })] });
4
+ };
5
+ export default MenuIcon;
@@ -1,3 +1,3 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- const TokenIcon = (props) => (_jsxs("svg", { width: "19", height: "16", viewBox: "0 0 19 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { d: "M16.0712 7.02863C16.9529 10.218 17.1354 12.9562 16.4789 13.1446C15.8223 13.3329 14.5754 10.9001 13.6937 7.71069C12.812 4.52129 12.6295 1.78308 13.2861 1.59473C13.9426 1.40638 15.1896 3.83922 16.0712 7.02863Z", fill: "currentColor" }), _jsx("path", { d: "M16.7938 6.82488C16.2449 4.83924 15.4871 3.14008 14.7216 1.99861C14.3372 1.42547 13.9682 1.01904 13.6448 0.78192C13.3157 0.54067 13.1104 0.526319 12.9986 0.558387C12.8868 0.590456 12.719 0.711857 12.5619 1.09258C12.4074 1.46679 12.3008 2.00965 12.2665 2.70292C12.1982 4.0836 12.4222 5.93588 12.9711 7.92151C13.52 9.90715 14.2778 11.6063 15.0433 12.7478C15.4277 13.3209 15.7967 13.7274 16.1201 13.9645C16.4492 14.2058 16.6545 14.2201 16.7663 14.188L16.9114 14.713L16.8957 14.7173C15.5662 15.0714 13.6031 12.1535 12.4823 8.16415L12.4558 8.06934C11.3353 4.01571 11.5133 0.417926 12.8535 0.0334581L12.8692 0.0290908C14.2092 -0.327752 16.1929 2.63927 17.309 6.67705L17.3351 6.77198C18.4268 10.7867 18.2411 14.3315 16.9114 14.713L16.7663 14.188C16.8781 14.156 17.0459 14.0346 17.203 13.6538C17.3575 13.2796 17.464 12.7367 17.4983 12.0435C17.5667 10.6628 17.3427 8.81051 16.7938 6.82488Z", fill: "currentColor" }), _jsx("path", { d: "M14.1111 15.4191C12.9291 15.7157 11.122 12.7201 10.0668 8.70835C9.01162 4.69657 9.1063 1.18199 10.2756 0.836706L11.9634 0.375818C11.9634 0.375818 10.4435 2.44999 12.0158 8.42775C13.5164 14.1329 15.7991 14.9585 15.7991 14.9585L14.1111 15.4191Z", fill: "currentColor" }), _jsx("path", { d: "M0.703613 13.0453C0.703613 13.0453 1.84834 14.5381 6.2684 14.5381C9.10719 14.5381 10.4882 13.862 11.0879 13.4199C11.1838 13.621 11.2806 13.8125 11.3779 13.9936C11.4139 14.0604 11.45 14.126 11.4863 14.1904V14.3528C11.4683 15.2635 9.06136 16 6.09497 16C3.12858 16 0.721732 15.2635 0.703712 14.3528L0.703613 13.0453Z", fill: "currentColor" }), _jsx("path", { d: "M0.703613 10.7813C0.703613 10.7813 1.84834 12.2741 6.2684 12.2741C8.26914 12.2741 9.54576 11.9383 10.3351 11.5852C10.4967 12.0396 10.6649 12.4686 10.8373 12.8675C9.92488 13.3848 8.14334 13.736 6.09497 13.736C3.12858 13.736 0.721732 12.9995 0.703712 12.0888L0.703613 10.7813Z", fill: "currentColor" }), _jsx("path", { d: "M0.703613 8.51734C0.703613 8.51734 1.84834 10.0101 6.2684 10.0101C7.80676 10.0101 8.91702 9.81153 9.70685 9.55928C9.83338 10.0299 9.96818 10.485 10.1095 10.9208C9.12241 11.2591 7.68954 11.472 6.09497 11.472C3.12858 11.472 0.721732 10.7355 0.703712 9.82482L0.703613 8.51734Z", fill: "currentColor" }), _jsx("path", { d: "M6.09497 5.21729C7.12824 5.21729 8.09361 5.32491 8.91379 5.51146C9.03085 6.4861 9.2158 7.53441 9.46844 8.61147C9.47998 8.66069 9.49167 8.70976 9.50341 8.7587C8.57454 9.03954 7.38791 9.20804 6.09497 9.20804C3.11741 9.20804 0.703613 8.31468 0.703613 7.21267C0.703613 6.11065 3.11741 5.21729 6.09497 5.21729Z", fill: "currentColor" })] }));
2
+ const TokenIcon = (props) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "16", viewBox: "0 0 20 16", fill: "none", ...props, children: [_jsx("path", { d: "M14.9218 2.63325L13.8251 1.16509C13.8251 1.16509 13.8285 1.52477 13.5588 2.15514C13.2891 2.78552 12.9607 3.4069 12.2133 4.28895C11.3599 5.25682 10.1565 6.33746 8.71729 7.37397C5.16277 9.88602 2.58804 10.4833 1.06317 10.5068L0.895811 10.4966L1.93675 11.89C2.75001 12.872 6.321 11.5898 9.88187 9.05121C13.4427 6.51259 15.6918 3.64606 14.9218 2.63325Z", fill: "currentColor" }), _jsx("path", { d: "M5.39436 3.27026C3.62404 4.50941 2.20666 5.85017 1.34244 7.0048C0.908899 7.58403 0.629339 8.09691 0.50427 8.51194C0.377246 8.93345 0.428928 9.17965 0.530975 9.31625C0.633022 9.45286 0.85836 9.57751 1.31168 9.5928C1.75803 9.60786 2.34877 9.51155 3.05285 9.29449C4.45637 8.8618 6.21579 7.97891 7.9861 6.73976C9.75642 5.50061 11.1738 4.15985 12.038 3.00522C12.4716 2.42599 12.7511 1.91311 12.8762 1.49808C13.0032 1.07657 12.9515 0.830373 12.8495 0.693766L13.1975 0.450193L13.2073 0.463676C14.0283 1.60841 11.8521 4.52465 8.32171 7.01757L8.23773 7.0766C4.64388 9.59216 1.03765 10.7039 0.182994 9.55983L0.173129 9.54634C-0.654305 8.39256 1.56291 5.43915 5.14273 2.93342L5.22696 2.87471C8.79276 0.40062 12.3495 -0.684979 13.1975 0.450193L12.8495 0.693766C12.7474 0.557158 12.5221 0.432515 12.0688 0.417221C11.6224 0.402162 11.0317 0.498465 10.3276 0.715527C8.92409 1.14822 7.16467 2.03111 5.39436 3.27026Z", fill: "currentColor" }), _jsx("path", { d: "M5.74663 3.74184C8.6294 1.72402 11.3888 0.653786 11.9099 1.35141C12.4311 2.04904 10.5166 4.25035 7.63382 6.26818C4.75106 8.286 1.99166 9.35624 1.47052 8.65861C0.949389 7.96098 2.86387 5.75967 5.74663 3.74184Z", fill: "currentColor" }), _jsx("path", { d: "M20 13.6569C20.0108 14.9144 16.4531 15.9616 12.0309 15.999C7.6087 16.0364 3.93884 15.0499 3.87423 13.7928V12.7793C4.13534 12.7498 4.42447 12.6919 4.7369 12.6075C6.12929 13.3217 8.43935 13.9955 12.1025 13.9793C13.8962 13.9557 15.5255 13.7626 16.8029 13.4623C17.9425 13.1715 18.5847 12.8542 19.1849 12.4964C19.785 12.1386 20 11.8451 20 11.8451V13.6569Z", fill: "currentColor" }), _jsx("path", { d: "M12.1366 8.35459C16.4593 8.39544 19.9241 9.52382 19.9241 10.9099L19.9239 10.9264C19.8962 12.3197 16.3675 13.4485 11.9977 13.4661L11.8939 13.4663C9.21486 13.4663 6.84229 13.0486 5.38347 12.4067C5.5702 12.3417 5.76297 12.2692 5.96101 12.1893C6.08435 12.2348 6.21397 12.2794 6.3498 12.3227C7.74905 12.7681 9.70922 13.0506 11.8939 13.0506C14.0785 13.0506 16.0387 12.7681 17.4379 12.3227C18.1399 12.0992 18.6769 11.8422 19.0294 11.5768C19.3875 11.3073 19.4947 11.0784 19.4947 10.9099C19.4947 10.7413 19.3875 10.5125 19.0294 10.2429C18.6769 9.97757 18.1399 9.72053 17.4379 9.49707C16.0387 9.05162 14.0785 8.7691 11.8939 8.7691C11.8048 8.7691 11.7162 8.76959 11.6279 8.77052C11.8019 8.63199 11.9715 8.49326 12.1366 8.35459Z", fill: "currentColor" }), _jsx("path", { d: "M11.8939 9.35105C15.4513 9.35105 18.3352 10.049 18.3352 10.9099C18.3352 11.7708 15.4513 12.4687 11.8939 12.4687C9.78981 12.4687 7.92139 12.2245 6.74588 11.8469C7.90559 11.3051 9.195 10.5513 10.4831 9.63302C10.6047 9.54632 10.7247 9.45917 10.8432 9.3718C11.1851 9.35822 11.5361 9.35105 11.8939 9.35105Z", fill: "currentColor" })] }));
3
3
  export default TokenIcon;
@@ -21,4 +21,3 @@ export { default as SolflareIcon } from "./Solflare";
21
21
  export { default as BraavosIcon } from "./Braavos";
22
22
  export { default as ArgentXIcon } from "./ArgentX";
23
23
  export { default as FueletIcon } from "./Fuelet";
24
- export { default as KeplrIcon } from "./Keplr";
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { ExternalLink } from "lucide-react";
3
3
  import CopyButton from "../../../components/Buttons/copyButton";
4
4
  import AddressIcon from "../../../components/Common/AddressIcon";
5
- const AddressNote = ({ partner, values }) => {
5
+ const UrlAddressNote = ({ partner, values }) => {
6
6
  const { to: destination, destination_address } = values;
7
7
  return (destination && destination_address &&
8
8
  _jsxs("div", { className: "flex flex-col items-center gap-6 mt-2 w-full", children: [_jsx("div", { className: "h-24 w-24 rounded-2xl overflow-hidden", children: _jsx(AddressIcon, { className: "scale-150 h-24 w-24 blur-[1.5px]", address: destination_address, size: 96 }) }), _jsxs("div", { className: "text-center max-w-xs space-y-1", children: [_jsx("p", { className: "text-2xl", children: "Address Confirmation" }), _jsxs("p", { className: "text-secondary-text", children: [_jsx("span", { children: "Destination address was autofilled from URL" }), " ", partner && _jsxs(_Fragment, { children: [_jsx("span", { children: "by" }), " ", _jsxs("span", { children: [partner.display_name, "."] })] }), " ", _jsx("span", { children: "Please double-check its correctness." })] })] }), _jsxs("div", { className: "w-full rounded-lg bg-secondary-500 overflow-hidden px-4 py-3 space-y-2", children: [_jsx("div", { className: "gap-4 flex relative items-center outline-hidden w-full text-primary-text", children: _jsxs("div", { className: "flex items-center justify-between w-full", children: [_jsxs("div", { className: "text-secondary-text", children: [_jsx("span", { children: destination?.display_name }), " ", _jsx("span", { children: "address" })] }), _jsxs("div", { className: "flex items-center gap-4 text-secondary-text", children: [_jsx(CopyButton, { toCopy: destination_address }), _jsx("a", { href: destination?.account_explorer_template?.replace('{0}', destination_address) || '', target: "_blank", rel: "noopener noreferrer", children: _jsx(ExternalLink, { className: "h-4 w-4" }) })] })] }) }), _jsxs("div", { className: 'flex gap-3 text-sm items-center w-full', children: [_jsx("div", { className: 'flex shrink-0 bg-secondary-400 text-primary-text items-center justify-center rounded-md h-9 overflow-hidden w-9', children: _jsx(AddressIcon, { className: "scale-150 h-9 w-9", address: destination_address, size: 36 }) }), _jsx("p", { className: "break-all text-sm", children: destination_address })] })] })] }));
9
9
  };
10
- export default AddressNote;
10
+ export default UrlAddressNote;
@@ -60,11 +60,13 @@ const calculateMaxWidth = (balance) => {
60
60
  return 'max-w-[50px]';
61
61
  }
62
62
  };
63
- export const ExtendedAddress = ({ address, network, isForCurrency, children, onDisconnect, showDetails = false, title, description, logo: Logo, shouldShowChevron = true }) => {
63
+ export const ExtendedAddress = ({ address, network, isForCurrency, children, onDisconnect, showDetails = false, title, description, logo: Logo, shouldShowChevron = true, isNativeToken = false }) => {
64
64
  const [isCopied, setCopied] = useCopyClipboard();
65
65
  const [isPopoverOpen, setPopoverOpen] = useState(false);
66
66
  // Resolver for action buttons
67
67
  const getActionButtons = () => {
68
+ if (isNativeToken)
69
+ return { buttons: [], showTitles: false };
68
70
  const buttons = [
69
71
  {
70
72
  title: 'Copy',
@@ -91,7 +93,8 @@ export const ExtendedAddress = ({ address, network, isForCurrency, children, onD
91
93
  _jsxs("div", { className: "group-hover/addressItem:underline hover:text-secondary-text transition duration-200 no-underline flex gap-1 items-center cursor-pointer", children: [_jsx("p", { className: `${isForCurrency ? "text-xs self-end" : "text-sm"} block font-medium`, children: shortenAddress(address) }), shouldShowChevron ?
92
94
  _jsx(ChevronDown, { className: "invisible group-hover/addressItem:visible h-4 w-4" })
93
95
  : null] }) }), _jsx(TooltipContent, { side: "bottom", children: _jsx("p", { children: isForCurrency ? "View token details" : "View address details" }) })] }) }) }), _jsxs(PopoverContent, { className: "w-auto p-3 min-w-72 flex flex-col gap-3 items-stretch !rounded-2xl !bg-secondary-500", side: "top", avoidCollisions: true, collisionPadding: 8, sticky: "always", children: [showDetails && (title || description) && (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center gap-3", children: [Logo ?
94
- typeof Logo == 'string' ? (_jsx(ImageWithFallback, { src: Logo, alt: title || "Token logo", height: "40", width: "40", loading: "eager", fetchPriority: "high", className: "rounded-full object-contain flex-shrink-0 h-10 w-10" })) : (_jsx(Logo, { className: "w-10 h-10 text-secondary-text flex-shrink-0" })) : (_jsx(Info, { className: "w-10 h-10 text-secondary-text flex-shrink-0" })), _jsxs("div", { className: "flex-1 font-medium", children: [title && _jsx("h3", { className: "text-base leading-5 text-primary-text", children: title }), description && _jsx("p", { className: "text-sm leading-[18px] text-secondary-text", children: description })] })] }), _jsx("hr", { className: "border rounded-full border-secondary-400 mt-2" })] })), _jsxs("p", { className: "text-secondary-text text-sm leading-5 font-mono break-all text-left", children: [_jsx("span", { className: "text-primary-text font-medium", children: address.slice(0, 4) }), _jsx("span", { children: address.slice(4, -4) }), _jsx("span", { className: "text-primary-text font-medium", children: address.slice(-4) })] }), _jsx("div", { className: "flex gap-3", children: buttons.map((button) => (_jsx(ActionButton, { showTitle: showTitles, ...button }, button.title))) })] })] }) }));
96
+ typeof Logo == 'string' ? (_jsx(ImageWithFallback, { src: Logo, alt: title || "Token logo", height: "40", width: "40", loading: "eager", fetchPriority: "high", className: "rounded-full object-contain flex-shrink-0 h-10 w-10" })) : (_jsx(Logo, { className: "w-10 h-10 text-secondary-text flex-shrink-0" })) : (_jsx(Info, { className: "w-10 h-10 text-secondary-text flex-shrink-0" })), _jsxs("div", { className: "flex-1 font-medium", children: [title && _jsx("h3", { className: "text-base leading-5 text-primary-text", children: title }), description && _jsx("p", { className: "text-sm leading-[18px] text-secondary-text", children: description })] })] }), _jsx("hr", { className: "border rounded-full border-secondary-400 mt-2" })] })), _jsx("p", { className: `text-secondary-text text-sm leading-5 break-all text-left ${!isNativeToken ? 'font-mono' : ''}`, children: isNativeToken ? address :
97
+ _jsxs(_Fragment, { children: [_jsx("span", { className: "text-primary-text font-medium", children: address.slice(0, 4) }), _jsx("span", { children: address.slice(4, -4) }), _jsx("span", { className: "text-primary-text font-medium", children: address.slice(-4) })] }) }), buttons.length > 0 && (_jsx("div", { className: "flex gap-3", children: buttons.map((button) => (_jsx(ActionButton, { showTitle: showTitles, ...button }, button.title))) }))] })] }) }));
95
98
  };
96
99
  const ActionButton = ({ title, Icon, onClick, href, iconClassNames, showTitle = true }) => {
97
100
  const [showTooltip, setShowTooltip] = useState(false);
@@ -10,7 +10,7 @@ import AddressBook from "./AddressBook";
10
10
  import AddressButton from "./AddressButton";
11
11
  import { useInitialSettings } from "../../../../context/settings";
12
12
  import ConnectedWallets from "./ConnectedWallets";
13
- import { useSelectedAccount, useUpdateBalanceAccount } from "../../../../context/balanceAccounts";
13
+ import { useSelectedAccount, useSelectSwapAccount } from "../../../../context/swapAccounts";
14
14
  import VaulDrawer from "../../../../components/Modal/vaulModal";
15
15
  export var AddressGroup;
16
16
  (function (AddressGroup) {
@@ -22,14 +22,15 @@ export var AddressGroup;
22
22
  const AddressPicker = forwardRef(function Address({ showAddressModal, setShowAddressModal, name, canFocus, close, address_book, partner, children }, ref) {
23
23
  const { values, setFieldValue } = useFormikContext();
24
24
  const initialSettings = useInitialSettings();
25
- const { destination_address, to: destination } = values;
26
- const selectDestinationAccount = useUpdateBalanceAccount("to");
27
- const { provider, unAvailableWallets } = useWallet(destination, 'autofil');
25
+ const { destination_address, to: destination, toExchange } = values;
26
+ const selectDestinationAccount = useSelectSwapAccount("to");
27
+ const { provider, unAvailableWallets } = useWallet(destination, 'autofill');
28
28
  const connectedWallets = provider?.connectedWallets?.filter(w => !w.isNotAvailable) || [];
29
29
  const defaultAccount = useSelectedAccount("to", values.to?.name);
30
30
  const connectedWalletskey = connectedWallets?.map(w => w.addresses.join('')).join('');
31
31
  const [manualAddress, setManualAddress] = useState('');
32
- const [newAddress, setNewAddress] = useState();
32
+ // Get manually added address from context (shared across all AddressPicker instances)
33
+ const manualAddressFromContext = defaultAccount?.id === 'manually_added' ? defaultAccount.address : undefined;
33
34
  useEffect(() => {
34
35
  if (destination_address && destination && !isValidAddress(destination_address, destination)) {
35
36
  updateDestAddress('');
@@ -42,10 +43,11 @@ const AddressPicker = forwardRef(function Address({ showAddressModal, setShowAdd
42
43
  address_book,
43
44
  destination,
44
45
  wallets: connectedWallets,
45
- newAddress,
46
- addressFromQuery: initialSettings.destination_address
46
+ manualAddressFromContext,
47
+ addressFromQuery: initialSettings.destination_address,
48
+ destination_address
47
49
  });
48
- }, [address_book, destination, connectedWallets, newAddress, initialSettings.destination_address, connectedWalletskey]);
50
+ }, [address_book, destination, connectedWallets, manualAddressFromContext, initialSettings.destination_address, connectedWalletskey]);
49
51
  const destinationAddressItem = destination && destination_address ?
50
52
  groupedAddresses?.find(a => a.address.toLowerCase() === destination_address.toLowerCase())
51
53
  : undefined;
@@ -102,13 +104,13 @@ const AddressPicker = forwardRef(function Address({ showAddressModal, setShowAdd
102
104
  return (_jsxs(_Fragment, { children: [_jsx(AddressButton, { addressItem: destinationAddressItem, openAddressModal: () => setShowAddressModal(true), connectedWallet: connectedWallet, partner: partner, destination: destination, children: children({ destination, addressItem: destinationAddressItem, connectedWallet: connectedWallet, partner }) }), _jsx(VaulDrawer, { header: 'Send To', show: showAddressModal, setShow: setShowAddressModal, modalId: "address", children: _jsx(VaulDrawer.Snap, { id: "item-1", children: _jsx("div", { className: 'w-full flex flex-col justify-between h-full text-primary-text min-h-[200px]', children: _jsxs("div", { className: 'flex flex-col self-center grow w-full space-y-5 h-full', children: [destination
103
105
  && provider
104
106
  && !connectedWallets.length &&
105
- _jsx(ConnectWalletButton, { provider: provider, onConnect: onConnect }), _jsx(ManualAddressInput, { manualAddress: manualAddress, setManualAddress: setManualAddress, setNewAddress: (props) => { setNewAddress(props); updateDestAddress(props?.address); }, values: values, partner: partner, name: name, inputReference: inputReference, setFieldValue: setFieldValue, close: close, addresses: groupedAddresses, connectedWallet: connectedWallet }), destination
107
+ _jsx(ConnectWalletButton, { provider: provider, onConnect: onConnect }), _jsx(ManualAddressInput, { manualAddress: manualAddress, setManualAddress: setManualAddress, setNewAddress: (props) => updateDestAddress(props?.address), values: values, partner: partner, name: name, inputReference: inputReference, setFieldValue: setFieldValue, close: close, addresses: groupedAddresses, connectedWallet: connectedWallet }), destination
106
108
  && provider
107
109
  && !manualAddress &&
108
110
  _jsx(ConnectedWallets, { provider: provider, notCompatibleWallets: unAvailableWallets, onClick: (props) => handleSelectAddress(props.address), onConnect: onConnect, destination: destination, destination_address: destination_address }), addressBookAddresses && addressBookAddresses?.length > 0 && !manualAddress && destination &&
109
111
  _jsx(AddressBook, { addressBook: addressBookAddresses, onSelectAddress: handleSelectAddress, destination: destination, destination_address: destination_address, partner: partner })] }) }) }) })] }));
110
112
  });
111
- const resolveAddressGroups = ({ address_book, destination, wallets, newAddress, addressFromQuery, }) => {
113
+ const resolveAddressGroups = ({ address_book, destination, wallets, manualAddressFromContext, addressFromQuery, destination_address, }) => {
112
114
  if (!destination)
113
115
  return;
114
116
  const filteredAddressBook = address_book?.filter(a => a.networks?.some(n => destination?.name === n) && isValidAddress(a.address, destination)) || [];
@@ -125,8 +127,9 @@ const resolveAddressGroups = ({ address_book, destination, wallets, newAddress,
125
127
  if (recentlyUsedAddresses.length > 0) {
126
128
  addresses = [...addresses, ...recentlyUsedAddresses];
127
129
  }
128
- if (newAddress?.address && newAddress.networkType === destination?.type) {
129
- addresses.push({ address: newAddress.address, group: AddressGroup.ManualAdded });
130
+ // Include manually added address from context (shared across all instances)
131
+ if (manualAddressFromContext && isValidAddress(manualAddressFromContext, destination)) {
132
+ addresses.push({ address: manualAddressFromContext, group: AddressGroup.ManualAdded });
130
133
  }
131
134
  const uniqueAddresses = addresses.filter((a, index, self) => self.findIndex(t => addressFormat(t.address, destination) === addressFormat(a.address, destination)) === index);
132
135
  return uniqueAddresses;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import AddressIcon from "../../../components/Common/AddressIcon";
4
+ import { Checkbox } from "../../../components/shadcn/checkbox";
5
+ const ContractAddressNote = ({ values, onDontShowAgainChange }) => {
6
+ const [dontShowAgain, setDontShowAgain] = useState(false);
7
+ const { to: destination, destination_address } = values;
8
+ useEffect(() => {
9
+ onDontShowAgainChange?.(dontShowAgain);
10
+ }, [dontShowAgain, onDontShowAgainChange]);
11
+ const handleCheckboxChange = () => {
12
+ setDontShowAgain(!dontShowAgain);
13
+ };
14
+ return (destination && destination_address &&
15
+ _jsxs("div", { className: "flex flex-col items-center gap-4 mt-2 w-full", children: [_jsx("div", { className: "h-24 w-24 rounded-2xl overflow-hidden", children: _jsx(AddressIcon, { className: "scale-150 h-24 w-24 blur-[1.5px]", address: destination_address, size: 96 }) }), _jsxs("div", { className: "text-center max-w-xs space-y-1", children: [_jsx("p", { className: "text-2xl", children: "Address Confirmation" }), _jsxs("p", { className: "text-secondary-text", children: [_jsx("span", { children: "Destination address is a contract in a network but not in " }), _jsx("span", { children: destination?.display_name || 'the destination' }), _jsx("span", { children: " network. Please double-check your destination address." })] })] }), _jsxs("div", { className: "flex items-center gap-2 self-start", children: [_jsx(Checkbox, { id: "dont-show-again", checked: dontShowAgain, onClick: handleCheckboxChange }), _jsx("label", { htmlFor: "dont-show-again", className: "w-full cursor-pointer", children: _jsx("span", { className: "text-sm text-secondary-text", children: "Don't show this again" }) })] })] }));
16
+ };
17
+ export default ContractAddressNote;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { ExternalLink } from "lucide-react";
3
+ import CopyButton from "../../../components/Buttons/copyButton";
4
+ import AddressIcon from "../../../components/Common/AddressIcon";
5
+ const UrlAddressNote = ({ partner, values }) => {
6
+ const { to: destination, destination_address } = values;
7
+ return (destination && destination_address &&
8
+ _jsxs("div", { className: "flex flex-col items-center gap-6 mt-2 w-full", children: [_jsx("div", { className: "h-24 w-24 rounded-2xl overflow-hidden", children: _jsx(AddressIcon, { className: "scale-150 h-24 w-24 blur-[1.5px]", address: destination_address, size: 96 }) }), _jsxs("div", { className: "text-center max-w-xs space-y-1", children: [_jsx("p", { className: "text-2xl", children: "Address Confirmation" }), _jsxs("p", { className: "text-secondary-text", children: [_jsx("span", { children: "Destination address was autofilled from URL" }), " ", partner && _jsxs(_Fragment, { children: [_jsx("span", { children: "by" }), " ", _jsxs("span", { children: [partner.display_name, "."] })] }), " ", _jsx("span", { children: "Please double-check its correctness." })] })] }), _jsxs("div", { className: "w-full rounded-lg bg-secondary-500 overflow-hidden px-4 py-3 space-y-2", children: [_jsx("div", { className: "gap-4 flex relative items-center outline-hidden w-full text-primary-text", children: _jsxs("div", { className: "flex items-center justify-between w-full", children: [_jsxs("div", { className: "text-secondary-text", children: [_jsx("span", { children: destination?.display_name }), " ", _jsx("span", { children: "address" })] }), _jsxs("div", { className: "flex items-center gap-4 text-secondary-text", children: [_jsx(CopyButton, { toCopy: destination_address }), _jsx("a", { href: destination?.account_explorer_template?.replace('{0}', destination_address) || '', target: "_blank", rel: "noopener noreferrer", children: _jsx(ExternalLink, { className: "h-4 w-4" }) })] })] }) }), _jsxs("div", { className: 'flex gap-3 text-sm items-center w-full', children: [_jsx("div", { className: 'flex shrink-0 bg-secondary-400 text-primary-text items-center justify-center rounded-md h-9 overflow-hidden w-9', children: _jsx(AddressIcon, { className: "scale-150 h-9 w-9", address: destination_address, size: 36 }) }), _jsx("p", { className: "break-all text-sm", children: destination_address })] })] })] }));
9
+ };
10
+ export default UrlAddressNote;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { truncateDecimals } from "../../../components/utils/RoundDecimals";
3
- import { useSelectedAccount } from "../../../context/balanceAccounts";
3
+ import { useSelectedAccount } from "../../../context/swapAccounts";
4
4
  import { useBalance } from "../../../lib/balances/useBalance";
5
5
  import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/shadcn/tooltip";
6
6
  import InfoIcon from "../../../components/Icons/InfoIcon";
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import NumberFlow from "@number-flow/react";
3
+ import clsx from "clsx";
4
+ export const ExchangeReceiveAmount = ({ destination_token, fee, isFeeLoading }) => {
5
+ const receive_amount = fee?.quote.receive_amount;
6
+ const receiveAmountInUsd = receive_amount && destination_token && fee.quote?.destination_token?.price_in_usd ? (receive_amount * fee.quote.destination_token.price_in_usd).toFixed(2) : undefined;
7
+ return (_jsx(_Fragment, { children: _jsxs("div", { className: "w-full flex min-w-0 font-normal border-0 text-xl text-primary-text relative truncate items-baseline flex-row", children: [_jsx("div", { className: "flex items-center justify-start relative w-fit", children: _jsxs("div", { className: clsx("w-full flex items-center py-[3px] pr-2", { "animate-pulse-stronger": isFeeLoading }, { "text-secondary-text": !receive_amount }), children: [_jsx(NumberFlow, { value: receive_amount || 0, trend: 0, format: { maximumFractionDigits: fee?.quote.destination_token?.decimals || 2 } }), _jsx("span", { className: "ml-1", children: destination_token?.symbol })] }) }), _jsx("div", { className: "flex items-baseline space-x-2 mt-1.5", children: _jsx("span", { className: "text-sm leading-4 font-medium text-secondary-text h-5", children: _jsx(NumberFlow, { className: "p-0", prefix: "$", value: Number(receiveAmountInUsd || 0), format: { maximumFractionDigits: receiveAmountInUsd ? 2 : 0 }, trend: 0 }) }) })] }) }));
8
+ };
@@ -4,7 +4,7 @@ import useSWRGas from "../../../lib/gases/useSWRGas";
4
4
  import { useMemo } from "react";
5
5
  import { resolveMaxAllowedAmount } from "./helpers";
6
6
  import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/shadcn/tooltip";
7
- import { useSelectedAccount } from "../../../context/balanceAccounts";
7
+ import { useSelectedAccount } from "../../../context/swapAccounts";
8
8
  import { useBalance } from "../../../lib/balances/useBalance";
9
9
  import useWallet from "../../../hooks/useWallet";
10
10
  const MinMax = (props) => {
@@ -3,52 +3,17 @@ import { useMemo } from "react";
3
3
  import { Triangle } from "lucide-react";
4
4
  import { Tooltip, TooltipArrow, TooltipContent, TooltipTrigger } from "../../../components/shadcn/tooltip";
5
5
  import clsx from 'clsx';
6
- export const PriceImpact = ({ receiveAmount, requestedAmount, sourceTokenPriceUsd, destinationTokenPriceUsd, serviceFee, bridgeFee, className, }) => {
7
- const toAmountUSD = useMemo(() => {
8
- if (!receiveAmount || !destinationTokenPriceUsd)
9
- return undefined;
10
- return receiveAmount * destinationTokenPriceUsd;
11
- }, [receiveAmount, destinationTokenPriceUsd]);
12
- const fromAmountUSD = useMemo(() => {
13
- if (!requestedAmount || !sourceTokenPriceUsd)
14
- return undefined;
15
- return requestedAmount * sourceTokenPriceUsd;
16
- }, [requestedAmount, sourceTokenPriceUsd]);
17
- const priceImpact = useMemo(() => {
18
- if (fromAmountUSD === undefined || toAmountUSD === undefined)
19
- return undefined;
20
- return (toAmountUSD - fromAmountUSD);
21
- }, [fromAmountUSD, toAmountUSD]);
22
- const layerswapFees = useMemo(() => {
23
- if (serviceFee == null || sourceTokenPriceUsd == null)
24
- return undefined;
25
- return (serviceFee * sourceTokenPriceUsd);
26
- }, [serviceFee, sourceTokenPriceUsd]);
27
- const bridgeExpenses = useMemo(() => {
28
- if (bridgeFee == null || sourceTokenPriceUsd == null)
29
- return undefined;
30
- return (bridgeFee * sourceTokenPriceUsd);
31
- }, [bridgeFee, sourceTokenPriceUsd]);
32
- const marketImpact = useMemo(() => {
33
- if (priceImpact === undefined || layerswapFees === undefined || bridgeExpenses === undefined)
34
- return undefined;
35
- return (priceImpact + Number(layerswapFees) + Number(bridgeExpenses));
36
- }, [priceImpact, layerswapFees, bridgeExpenses]);
37
- const priceImpactPercentage = useMemo(() => {
38
- if (fromAmountUSD === undefined || toAmountUSD === undefined)
39
- return undefined;
40
- return Number((((toAmountUSD - fromAmountUSD) / fromAmountUSD) * 100).toFixed(2));
41
- }, [fromAmountUSD, toAmountUSD]);
42
- if (priceImpact === undefined)
6
+ import { resolvePriceImpactValues } from "../../../lib/fees";
7
+ export const PriceImpact = ({ quote, refuel, className }) => {
8
+ const priceImpactValues = useMemo(() => quote ? resolvePriceImpactValues(quote, refuel) : undefined, [quote, refuel]);
9
+ if (priceImpactValues === undefined)
43
10
  return null;
44
- return (_jsx(_Fragment, { children: _jsxs(Tooltip, { openOnClick: true, children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("span", { className: clsx("flex text-secondary-text items-center cursor-default hover:text-primary-text", className), children: _jsxs("span", { className: "flex items-center gap-0.5", children: [_jsx("span", { children: "(" }), _jsx(Triangle, { fill: "currentColor", className: `w-3.5 h-3.5 stroke-1 fill-current transition-transform ${priceImpact < 0 ? "rotate-180" : ""}` }), _jsxs("span", { children: ["$", Math.abs(priceImpact).toFixed(2)] }), _jsx("span", { children: ")" })] }) }) }), _jsxs(TooltipContent, { arrowClasses: "!bg-secondary-500 !fill-secondary-500", side: "top", align: "center", className: "!bg-secondary-500 !border-secondary-500 !text-secondary-text text-xs font-normal rounded-xl !p-4 shadow-card", children: [_jsxs("p", { className: "text-primary-text font-medium text-sm flex items-baseline space-x-0.5 mb-1", children: [_jsx("span", { children: "Price impact:" }), _jsx("span", { children: formatCurrency(priceImpact) }), _jsx("span", { className: "text-secondary-text text-xs font-normal", children: priceImpactPercentage ? `(${priceImpact < 0 ? "-" : "+"}${Math.abs(priceImpactPercentage)}%)` : "" })] }), _jsx("p", { children: "This is the difference in total USD value" }), _jsx("p", { children: "between the assets you send and the assets you receive." }), _jsxs("ul", { className: "mt-3 space-y-2 ", children: [_jsxs("li", { className: "list-none flex justify-between", children: [_jsx("span", { children: "Market impact" }), _jsx("span", { className: "text-primary-text", children: _jsx("span", { children: formatCurrency(marketImpact) }) })] }), _jsxs("li", { className: "list-none flex justify-between", children: [_jsx("span", { children: "Bridge expenses" }), _jsxs("span", { className: "text-primary-text", children: [_jsx("span", { children: bridgeExpenses?.toFixed(2) !== (0).toFixed(2) ? "-$" : "$" }), _jsx("span", { children: Math.abs(Number(bridgeExpenses)).toFixed(2) })] })] }), _jsxs("li", { className: "list-none flex justify-between", children: [_jsx("span", { children: "Layerswap fees" }), _jsxs("span", { className: "text-primary-text", children: [_jsx("span", { children: layerswapFees?.toFixed(2) !== (0).toFixed(2) ? "-$" : "$" }), _jsx("span", { children: Math.abs(Number(layerswapFees)).toFixed(2) })] })] })] }), _jsx(TooltipArrow, { className: "!bg-secondary-500 !fill-secondary-500" })] })] }) }));
11
+ return (_jsx(_Fragment, { children: _jsxs(Tooltip, { openOnClick: true, children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("span", { className: clsx("flex text-secondary-text items-center cursor-default hover:text-primary-text", className, { "text-warning-foreground hover:text-warning-foreground/80": priceImpactValues.highMarketPriceImpact }), children: _jsxs("span", { className: "flex items-center gap-0.5", children: [_jsx("span", { children: "(" }), _jsx(Triangle, { fill: "currentColor", className: `w-3 h-3 stroke-1 fill-current transition-transform ${priceImpactValues.priceImpact !== undefined && priceImpactValues.priceImpact < 0 ? "rotate-180" : ""}` }), _jsxs("span", { children: ["$", Math.abs(priceImpactValues.priceImpact || 0).toFixed(2)] }), _jsx("span", { children: ")" })] }) }) }), _jsxs(TooltipContent, { arrowClasses: "!bg-secondary-500 !fill-secondary-500", side: "top", align: "center", className: "bg-secondary-500! border-secondary-500! text-secondary-text! text-xs font-normal rounded-xl p-4! shadow-card", children: [_jsxs("p", { className: clsx("text-primary-text font-medium text-sm flex items-baseline space-x-0.5 mb-1", { "text-warning-foreground": priceImpactValues.highMarketPriceImpact }), children: [priceImpactValues.highMarketPriceImpact ? (priceImpactValues.criticalMarketPriceImpact ? _jsx("span", { children: "Critical price impact:" }) : _jsx("span", { children: "High price impact:" })) : _jsx("span", { children: "Price impact:" }), _jsx("span", { children: formatCurrency(priceImpactValues.priceImpact) }), _jsx("span", { className: clsx("text-secondary-text text-xs font-normal", { "text-warning-foreground": priceImpactValues.highMarketPriceImpact }), children: priceImpactValues.priceImpactPercentage ? `(${priceImpactValues.priceImpactPercentage < 0 ? "-" : "+"}${Math.abs(priceImpactValues.priceImpactPercentage)}%)` : "" })] }), _jsx("p", { children: "This is the difference in total USD value" }), _jsx("p", { children: "between the assets you send and the assets you receive." }), _jsxs("ul", { className: "mt-3 space-y-2 ", children: [_jsxs("li", { className: "list-none flex justify-between", children: [_jsx("span", { children: "Market impact" }), _jsx("span", { className: "text-primary-text", children: _jsx("span", { children: formatCurrency(priceImpactValues.marketImpact) }) })] }), _jsxs("li", { className: "list-none flex justify-between", children: [_jsx("span", { children: "Bridge expenses" }), _jsxs("span", { className: "text-primary-text", children: [_jsx("span", { children: priceImpactValues.bridgeExpenses?.toFixed(2) !== (0).toFixed(2) ? "-$" : "$" }), _jsx("span", { children: Math.abs(Number(priceImpactValues.bridgeExpenses)).toFixed(2) })] })] }), _jsxs("li", { className: "list-none flex justify-between", children: [_jsx("span", { children: "Layerswap fees" }), _jsxs("span", { className: "text-primary-text", children: [_jsx("span", { children: priceImpactValues.layerswapFees?.toFixed(2) !== (0).toFixed(2) ? "-$" : "$" }), _jsx("span", { children: Math.abs(Number(priceImpactValues.layerswapFees)).toFixed(2) })] })] }), refuel && _jsxs("li", { className: "list-none flex justify-between", children: [_jsx("span", { children: "Refuel" }), _jsxs("span", { className: "text-primary-text", children: [_jsx("span", { children: refuel?.amount_in_usd?.toFixed(2) !== (0).toFixed(2) ? "-$" : "$" }), _jsx("span", { children: Math.abs(Number(refuel?.amount_in_usd)).toFixed(2) })] })] })] }), _jsx(TooltipArrow, { className: "bg-secondary-500! fill-secondary-500!" })] })] }) }));
45
12
  };
46
13
  const formatCurrency = (value, decimals = 2) => {
47
14
  if (value === undefined || isNaN(value))
48
15
  return "";
49
16
  const rounded = Number(value.toFixed(decimals));
50
- // If rounded value is effectively zero, show "$0.00" (no minus sign)
51
- // Math.pow(10, -decimals) defines the smallest meaningful value at the precision
52
17
  const epsilon = Math.pow(10, -decimals);
53
18
  if (Math.abs(rounded) < epsilon) {
54
19
  return `$${(0).toFixed(decimals)}`;
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import NumberFlow from "@number-flow/react";
3
3
  import clsx from "clsx";
4
4
  import { PriceImpact } from "./PriceImpact";
5
- export const ReceiveAmount = ({ source_token, destination_token, fee, isFeeLoading }) => {
5
+ export const ReceiveAmount = ({ destination_token, fee, isFeeLoading }) => {
6
6
  const receive_amount = fee?.quote.receive_amount;
7
7
  const receiveAmountInUsd = receive_amount && destination_token && fee.quote?.destination_token?.price_in_usd ? (receive_amount * fee.quote.destination_token.price_in_usd).toFixed(2) : undefined;
8
8
  const quote = fee?.quote;
9
- return (_jsx(_Fragment, { children: _jsxs("div", { className: "flex flex-col min-w-0 font-normal border-0 text-[28px] leading-7 text-primary-text w-full relative truncate", children: [_jsx("div", { className: "flex items-center justify-start w-full relative", children: _jsx("div", { className: clsx("w-full flex items-center pt-2 pr-3", { "animate-pulse-stronger": isFeeLoading }, { "text-secondary-text": !receive_amount }), children: _jsx(NumberFlow, { value: receive_amount || 0, trend: 0, format: { maximumFractionDigits: fee?.quote.destination_token?.decimals || 2 } }) }) }), _jsxs("div", { className: "flex items-baseline space-x-2 h-5", children: [_jsx("span", { className: "text-base leading-5 font-medium text-secondary-text h-5", children: _jsx(NumberFlow, { className: "p-0", value: Number(receiveAmountInUsd) || 0, format: { style: 'currency', currency: 'USD', maximumFractionDigits: receiveAmountInUsd ? 2 : 0 }, trend: 0 }) }), _jsx(PriceImpact, { className: "h-5 text-base leading-5", bridgeFee: quote?.blockchain_fee, destinationTokenPriceUsd: quote?.destination_token?.price_in_usd, receiveAmount: quote?.receive_amount, requestedAmount: quote?.requested_amount, serviceFee: quote?.service_fee, sourceTokenPriceUsd: quote?.source_token?.price_in_usd })] })] }) }));
9
+ return (_jsx(_Fragment, { children: _jsxs("div", { className: "flex-col w-full flex min-w-0 font-normal border-0 text-[28px] leading-7 text-primary-text relative truncate", children: [_jsx("div", { className: "w-full flex items-center justify-start relative", children: _jsx("div", { className: clsx("w-full flex items-center pt-2 pr-3", { "animate-pulse-stronger": isFeeLoading }, { "text-secondary-text": !receive_amount }), children: _jsx(NumberFlow, { value: receive_amount || 0, trend: 0, format: { maximumFractionDigits: fee?.quote.destination_token?.decimals || 2 } }) }) }), _jsxs("div", { className: "flex items-baseline space-x-2 h-5", children: [_jsx("span", { className: "text-base leading-5 font-medium text-secondary-text h-5", children: _jsx(NumberFlow, { className: "p-0", value: Number(receiveAmountInUsd || 0), prefix: "$", format: { maximumFractionDigits: receiveAmountInUsd ? 2 : 0 }, trend: 0 }) }), _jsx(PriceImpact, { className: "h-5 text-base leading-5", quote: quote, refuel: fee?.refuel })] })] }) }));
10
10
  };