0xtrails 0.6.6 → 0.7.0

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 (365) hide show
  1. package/dist/aave.d.ts +10 -2
  2. package/dist/aave.d.ts.map +1 -1
  3. package/dist/analytics.d.ts +26 -0
  4. package/dist/analytics.d.ts.map +1 -1
  5. package/dist/{ccip-CbJrlK-L.js → ccip-fConRNoG.js} +21 -21
  6. package/dist/chains.d.ts +23 -8
  7. package/dist/chains.d.ts.map +1 -1
  8. package/dist/constants.d.ts +5 -5
  9. package/dist/constants.d.ts.map +1 -1
  10. package/dist/customTokens.d.ts +12 -0
  11. package/dist/customTokens.d.ts.map +1 -0
  12. package/dist/decoders.d.ts +2 -2
  13. package/dist/decoders.d.ts.map +1 -1
  14. package/dist/error.d.ts.map +1 -1
  15. package/dist/fees.d.ts +37 -2
  16. package/dist/fees.d.ts.map +1 -1
  17. package/dist/gasless.d.ts +15 -36
  18. package/dist/gasless.d.ts.map +1 -1
  19. package/dist/{index-w7_dK4c5.js → index-BbajxCG_.js} +59269 -77146
  20. package/dist/index.d.ts +8 -6
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +828 -359
  23. package/dist/indexerClient.d.ts.map +1 -1
  24. package/dist/intentReceiptMonitor.d.ts +1 -1
  25. package/dist/intentReceiptMonitor.d.ts.map +1 -1
  26. package/dist/intentReceiptPoller.d.ts +1 -1
  27. package/dist/intentReceiptPoller.d.ts.map +1 -1
  28. package/dist/intents.d.ts +3 -2
  29. package/dist/intents.d.ts.map +1 -1
  30. package/dist/mode.d.ts +1 -1
  31. package/dist/mode.d.ts.map +1 -1
  32. package/dist/mutations.d.ts +2 -2
  33. package/dist/mutations.d.ts.map +1 -1
  34. package/dist/prepareSend.d.ts +2 -2
  35. package/dist/prepareSend.d.ts.map +1 -1
  36. package/dist/prices.d.ts +1 -1
  37. package/dist/prices.d.ts.map +1 -1
  38. package/dist/sequenceWallet.d.ts +2 -2
  39. package/dist/sequenceWallet.d.ts.map +1 -1
  40. package/dist/time.d.ts +6 -0
  41. package/dist/time.d.ts.map +1 -1
  42. package/dist/tokenBalances.d.ts +40 -25
  43. package/dist/tokenBalances.d.ts.map +1 -1
  44. package/dist/tokens.d.ts +54 -14
  45. package/dist/tokens.d.ts.map +1 -1
  46. package/dist/trailsClient.d.ts +1 -1
  47. package/dist/trailsClient.d.ts.map +1 -1
  48. package/dist/trailsRouter.d.ts +2 -1
  49. package/dist/trailsRouter.d.ts.map +1 -1
  50. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +3 -2
  51. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -1
  52. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +2 -1
  53. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
  54. package/dist/transactionIntent/execution/transactionState.d.ts +1 -1
  55. package/dist/transactionIntent/execution/transactionState.d.ts.map +1 -1
  56. package/dist/transactionIntent/handlers/crossChain.d.ts +5 -3
  57. package/dist/transactionIntent/handlers/crossChain.d.ts.map +1 -1
  58. package/dist/transactionIntent/handlers/sameChainSameToken.d.ts +5 -3
  59. package/dist/transactionIntent/handlers/sameChainSameToken.d.ts.map +1 -1
  60. package/dist/transactionIntent/quote/feeExtractors.d.ts +1 -6
  61. package/dist/transactionIntent/quote/feeExtractors.d.ts.map +1 -1
  62. package/dist/transactionIntent/quote/normalizeQuote.d.ts +4 -2
  63. package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +1 -1
  64. package/dist/transactionIntent/quote/quoteHelpers.d.ts +1 -1
  65. package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -1
  66. package/dist/transactionIntent/types.d.ts +28 -5
  67. package/dist/transactionIntent/types.d.ts.map +1 -1
  68. package/dist/transactionIntent/utils/testnetHelpers.d.ts +0 -1
  69. package/dist/transactionIntent/utils/testnetHelpers.d.ts.map +1 -1
  70. package/dist/transactionIntent/validators.d.ts +0 -2
  71. package/dist/transactionIntent/validators.d.ts.map +1 -1
  72. package/dist/transactions.d.ts +2 -2
  73. package/dist/transactions.d.ts.map +1 -1
  74. package/dist/utils.d.ts +7 -0
  75. package/dist/utils.d.ts.map +1 -1
  76. package/dist/wallets.d.ts +1 -0
  77. package/dist/wallets.d.ts.map +1 -1
  78. package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
  79. package/dist/widget/components/AddressWalletIcon.d.ts +6 -0
  80. package/dist/widget/components/AddressWalletIcon.d.ts.map +1 -0
  81. package/dist/widget/components/ChainFilterDropdown.d.ts +2 -6
  82. package/dist/widget/components/ChainFilterDropdown.d.ts.map +1 -1
  83. package/dist/widget/components/ChainImage.d.ts.map +1 -1
  84. package/dist/widget/components/ChainList.d.ts +0 -5
  85. package/dist/widget/components/ChainList.d.ts.map +1 -1
  86. package/dist/widget/components/ClassicSwap.d.ts +6 -6
  87. package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
  88. package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
  89. package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
  90. package/dist/widget/components/DebugMenu.d.ts +1 -1
  91. package/dist/widget/components/DebugMenu.d.ts.map +1 -1
  92. package/dist/widget/components/DebugScreensList.d.ts.map +1 -1
  93. package/dist/widget/components/DepositTracker.d.ts.map +1 -1
  94. package/dist/widget/components/Earn.d.ts +5 -5
  95. package/dist/widget/components/Earn.d.ts.map +1 -1
  96. package/dist/widget/components/FeeOption.d.ts +1 -1
  97. package/dist/widget/components/FeeOption.d.ts.map +1 -1
  98. package/dist/widget/components/FeeOptions.d.ts +2 -2
  99. package/dist/widget/components/FeeOptions.d.ts.map +1 -1
  100. package/dist/widget/components/Footer.d.ts +1 -1
  101. package/dist/widget/components/Footer.d.ts.map +1 -1
  102. package/dist/widget/components/Fund.d.ts +5 -5
  103. package/dist/widget/components/Fund.d.ts.map +1 -1
  104. package/dist/widget/components/FundMethods.d.ts +0 -1
  105. package/dist/widget/components/FundMethods.d.ts.map +1 -1
  106. package/dist/widget/components/FundSwap.d.ts +6 -6
  107. package/dist/widget/components/FundSwap.d.ts.map +1 -1
  108. package/dist/widget/components/HookModalContent.d.ts +8 -0
  109. package/dist/widget/components/HookModalContent.d.ts.map +1 -0
  110. package/dist/widget/components/OriginSelectionAmount.d.ts +11 -0
  111. package/dist/widget/components/OriginSelectionAmount.d.ts.map +1 -0
  112. package/dist/widget/components/Pay.d.ts +5 -5
  113. package/dist/widget/components/Pay.d.ts.map +1 -1
  114. package/dist/widget/components/PoolDeposit.d.ts +5 -5
  115. package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
  116. package/dist/widget/components/PoolWithdraw.d.ts +3 -3
  117. package/dist/widget/components/PoolWithdraw.d.ts.map +1 -1
  118. package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
  119. package/dist/widget/components/Receipt.d.ts +2 -1
  120. package/dist/widget/components/Receipt.d.ts.map +1 -1
  121. package/dist/widget/components/RecentTokens.d.ts +4 -4
  122. package/dist/widget/components/RecentTokens.d.ts.map +1 -1
  123. package/dist/widget/components/RecipientSelectorButton.d.ts.map +1 -1
  124. package/dist/widget/components/ShadowPortal.d.ts +6 -0
  125. package/dist/widget/components/ShadowPortal.d.ts.map +1 -0
  126. package/dist/widget/components/Swap.d.ts +6 -6
  127. package/dist/widget/components/Swap.d.ts.map +1 -1
  128. package/dist/widget/components/ThemeProvider.d.ts +1 -1
  129. package/dist/widget/components/ThemeProvider.d.ts.map +1 -1
  130. package/dist/widget/components/TokenList.d.ts +3 -4
  131. package/dist/widget/components/TokenList.d.ts.map +1 -1
  132. package/dist/widget/components/TokenSelector.d.ts +3 -4
  133. package/dist/widget/components/TokenSelector.d.ts.map +1 -1
  134. package/dist/widget/components/Tooltip.d.ts +6 -1
  135. package/dist/widget/components/Tooltip.d.ts.map +1 -1
  136. package/dist/widget/components/TrailsHookModal.d.ts +10 -0
  137. package/dist/widget/components/TrailsHookModal.d.ts.map +1 -0
  138. package/dist/widget/components/WaasFeeOptions.d.ts +3 -0
  139. package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -1
  140. package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
  141. package/dist/widget/components/WalletConnect.d.ts.map +1 -1
  142. package/dist/widget/components/WidgetProviders.d.ts +14 -0
  143. package/dist/widget/components/WidgetProviders.d.ts.map +1 -0
  144. package/dist/widget/css/compiled.css +1 -1
  145. package/dist/widget/hooks/useAddressWalletIcon.d.ts +10 -0
  146. package/dist/widget/hooks/useAddressWalletIcon.d.ts.map +1 -0
  147. package/dist/widget/hooks/useBalanceVisible.d.ts +1 -1
  148. package/dist/widget/hooks/useBalanceVisible.d.ts.map +1 -1
  149. package/dist/widget/hooks/useChainFilter.d.ts +1 -1
  150. package/dist/widget/hooks/useChainFilter.d.ts.map +1 -1
  151. package/dist/widget/hooks/useCheckout.d.ts +13 -1
  152. package/dist/widget/hooks/useCheckout.d.ts.map +1 -1
  153. package/dist/widget/hooks/useConnector.d.ts +4 -0
  154. package/dist/widget/hooks/useConnector.d.ts.map +1 -0
  155. package/dist/widget/hooks/useCurrentScreen.d.ts +1 -1
  156. package/dist/widget/hooks/useCurrentScreen.d.ts.map +1 -1
  157. package/dist/widget/hooks/useCustomTokenFetch.d.ts +19 -0
  158. package/dist/widget/hooks/useCustomTokenFetch.d.ts.map +1 -0
  159. package/dist/widget/hooks/useCustomTokenSearch.d.ts +20 -0
  160. package/dist/widget/hooks/useCustomTokenSearch.d.ts.map +1 -0
  161. package/dist/widget/hooks/useDebounce.d.ts +10 -0
  162. package/dist/widget/hooks/useDebounce.d.ts.map +1 -0
  163. package/dist/widget/hooks/useDebugScreens.d.ts +7 -2
  164. package/dist/widget/hooks/useDebugScreens.d.ts.map +1 -1
  165. package/dist/widget/hooks/useDefaultTokenSelection.d.ts +3 -19
  166. package/dist/widget/hooks/useDefaultTokenSelection.d.ts.map +1 -1
  167. package/dist/widget/hooks/useDestinationSelectedToken.d.ts +1 -14
  168. package/dist/widget/hooks/useDestinationSelectedToken.d.ts.map +1 -1
  169. package/dist/widget/hooks/useEarnPool.d.ts +1 -1
  170. package/dist/widget/hooks/useEarnPool.d.ts.map +1 -1
  171. package/dist/widget/hooks/useIntentTransactionHistory.d.ts.map +1 -1
  172. package/dist/widget/hooks/useIsMobile.d.ts +5 -0
  173. package/dist/widget/hooks/useIsMobile.d.ts.map +1 -0
  174. package/dist/widget/hooks/useMode.d.ts +2 -2
  175. package/dist/widget/hooks/useMode.d.ts.map +1 -1
  176. package/dist/widget/hooks/useOriginSelectedToken.d.ts +2 -15
  177. package/dist/widget/hooks/useOriginSelectedToken.d.ts.map +1 -1
  178. package/dist/widget/hooks/usePayMessage.d.ts.map +1 -1
  179. package/dist/widget/hooks/usePriceImpactWarning.d.ts +1 -1
  180. package/dist/widget/hooks/usePriceImpactWarning.d.ts.map +1 -1
  181. package/dist/widget/hooks/useQuote.d.ts +173 -4
  182. package/dist/widget/hooks/useQuote.d.ts.map +1 -1
  183. package/dist/widget/hooks/useRecentTokens.d.ts +3 -3
  184. package/dist/widget/hooks/useRecentTokens.d.ts.map +1 -1
  185. package/dist/widget/hooks/useRecipients.d.ts +1 -1
  186. package/dist/widget/hooks/useRecipients.d.ts.map +1 -1
  187. package/dist/widget/hooks/useSelectedFeeOption.d.ts +2 -2
  188. package/dist/widget/hooks/useSelectedFeeOption.d.ts.map +1 -1
  189. package/dist/widget/hooks/useSelectedFundMethod.d.ts +1 -1
  190. package/dist/widget/hooks/useSelectedFundMethod.d.ts.map +1 -1
  191. package/dist/widget/hooks/useSelectedRecipient.d.ts +1 -1
  192. package/dist/widget/hooks/useSelectedRecipient.d.ts.map +1 -1
  193. package/dist/widget/hooks/useSendForm.d.ts +9 -31
  194. package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
  195. package/dist/widget/hooks/useSwapAmount.d.ts +1 -1
  196. package/dist/widget/hooks/useSwapAmount.d.ts.map +1 -1
  197. package/dist/widget/hooks/useTheme.d.ts +1 -1
  198. package/dist/widget/hooks/useTheme.d.ts.map +1 -1
  199. package/dist/widget/hooks/useTokenList.d.ts +7 -31
  200. package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
  201. package/dist/widget/hooks/useTrailsSendTransaction.d.ts +83 -0
  202. package/dist/widget/hooks/useTrailsSendTransaction.d.ts.map +1 -0
  203. package/dist/widget/hooks/useWalletConnectUri.d.ts +11 -0
  204. package/dist/widget/hooks/useWalletConnectUri.d.ts.map +1 -0
  205. package/dist/widget/hooks/useWidgetProps.d.ts +5 -0
  206. package/dist/widget/hooks/useWidgetProps.d.ts.map +1 -1
  207. package/dist/widget/index.d.ts +2 -0
  208. package/dist/widget/index.d.ts.map +1 -1
  209. package/dist/widget/index.js +8 -5
  210. package/dist/widget/providers/TrailsModalProvider.d.ts +65 -0
  211. package/dist/widget/providers/TrailsModalProvider.d.ts.map +1 -0
  212. package/dist/widget/providers/TrailsProvider.d.ts +1 -1
  213. package/dist/widget/providers/TrailsProvider.d.ts.map +1 -1
  214. package/dist/widget/types.d.ts +11 -18
  215. package/dist/widget/types.d.ts.map +1 -1
  216. package/dist/widget/widget.d.ts +20 -11
  217. package/dist/widget/widget.d.ts.map +1 -1
  218. package/package.json +45 -49
  219. package/src/aave.ts +387 -138
  220. package/src/analytics.ts +208 -2
  221. package/src/chains.ts +65 -64
  222. package/src/constants.ts +18 -14
  223. package/src/customTokens.ts +151 -0
  224. package/src/decoders.ts +4 -7
  225. package/src/error.ts +7 -3
  226. package/src/fees.ts +239 -125
  227. package/src/gasless.ts +54 -108
  228. package/src/index.ts +29 -9
  229. package/src/indexerClient.ts +2 -0
  230. package/src/intentReceiptMonitor.ts +1 -4
  231. package/src/intentReceiptPoller.ts +2 -2
  232. package/src/intents.ts +16 -5
  233. package/src/mode.ts +1 -1
  234. package/src/mutations.ts +7 -3
  235. package/src/prepareSend.ts +19 -14
  236. package/src/prices.ts +1 -1
  237. package/src/sequenceWallet.ts +2 -2
  238. package/src/time.ts +28 -0
  239. package/src/tokenBalances.ts +348 -153
  240. package/src/tokens.ts +393 -142
  241. package/src/trailsClient.ts +1 -1
  242. package/src/trailsRouter.ts +4 -5
  243. package/src/transactionIntent/deposits/depositOrchestrator.ts +6 -2
  244. package/src/transactionIntent/deposits/gaslessDeposit.ts +13 -7
  245. package/src/transactionIntent/deposits/standardDeposit.ts +1 -1
  246. package/src/transactionIntent/execution/transactionState.ts +1 -1
  247. package/src/transactionIntent/handlers/crossChain.ts +75 -37
  248. package/src/transactionIntent/handlers/sameChainSameToken.ts +66 -20
  249. package/src/transactionIntent/quote/feeExtractors.ts +1 -29
  250. package/src/transactionIntent/quote/normalizeQuote.ts +99 -7
  251. package/src/transactionIntent/quote/quoteHelpers.ts +1 -1
  252. package/src/transactionIntent/types.ts +31 -6
  253. package/src/transactionIntent/utils/testnetHelpers.ts +0 -5
  254. package/src/transactionIntent/validators.ts +0 -30
  255. package/src/transactions.ts +3 -3
  256. package/src/utils.ts +18 -0
  257. package/src/wallets.ts +32 -10
  258. package/src/widget/compiled.css +1 -1
  259. package/src/widget/components/AccountIntentTransactionHistory.tsx +2 -1
  260. package/src/widget/components/AccountIntentTransactionHistoryButton.tsx +2 -2
  261. package/src/widget/components/AddressWalletIcon.tsx +29 -0
  262. package/src/widget/components/ChainFilterDropdown.tsx +2 -8
  263. package/src/widget/components/ChainImage.tsx +8 -5
  264. package/src/widget/components/ChainList.tsx +6 -8
  265. package/src/widget/components/ClassicSwap.tsx +93 -85
  266. package/src/widget/components/ConnectWallet.tsx +1 -2
  267. package/src/widget/components/ConnectedWallets.tsx +17 -4
  268. package/src/widget/components/DebugMenu.tsx +2 -2
  269. package/src/widget/components/DebugScreensList.tsx +0 -1
  270. package/src/widget/components/DepositTracker.tsx +20 -34
  271. package/src/widget/components/Earn.tsx +7 -6
  272. package/src/widget/components/FeeOption.tsx +4 -4
  273. package/src/widget/components/FeeOptions.tsx +19 -39
  274. package/src/widget/components/Footer.tsx +1 -1
  275. package/src/widget/components/Fund.tsx +23 -119
  276. package/src/widget/components/FundMethods.tsx +9 -6
  277. package/src/widget/components/FundSwap.tsx +6 -5
  278. package/src/widget/components/FundingMethodSelectorButton.tsx +2 -2
  279. package/src/widget/components/HookModalContent.tsx +306 -0
  280. package/src/widget/components/Modal.tsx +1 -1
  281. package/src/widget/components/OriginSelectionAmount.tsx +135 -0
  282. package/src/widget/components/Pay.tsx +66 -124
  283. package/src/widget/components/PoolDeposit.tsx +11 -55
  284. package/src/widget/components/PoolWithdraw.tsx +3 -3
  285. package/src/widget/components/QuoteDetails.tsx +473 -728
  286. package/src/widget/components/Receipt.tsx +74 -7
  287. package/src/widget/components/RecentTokens.tsx +8 -8
  288. package/src/widget/components/RecipientSelectorButton.tsx +4 -2
  289. package/src/widget/components/ScreenHeader.tsx +2 -2
  290. package/src/widget/components/SearchInputField.tsx +1 -1
  291. package/src/widget/components/ShadowPortal.tsx +58 -0
  292. package/src/widget/components/Swap.tsx +6 -5
  293. package/src/widget/components/ThemeProvider.tsx +1 -1
  294. package/src/widget/components/TokenList.tsx +3 -4
  295. package/src/widget/components/TokenSelector.tsx +211 -80
  296. package/src/widget/components/Tooltip.tsx +18 -7
  297. package/src/widget/components/TrailsHookModal.tsx +118 -0
  298. package/src/widget/components/WaasFeeOptions.tsx +333 -138
  299. package/src/widget/components/WalletConfirmation.tsx +7 -2
  300. package/src/widget/components/WalletConnect.tsx +197 -235
  301. package/src/widget/components/WidgetProviders.tsx +75 -0
  302. package/src/widget/hooks/useAddressWalletIcon.ts +53 -0
  303. package/src/widget/hooks/useBalanceVisible.tsx +1 -1
  304. package/src/widget/hooks/useChainFilter.tsx +1 -1
  305. package/src/widget/hooks/useCheckout.ts +13 -1
  306. package/src/widget/hooks/useConnector.tsx +18 -0
  307. package/src/widget/hooks/useCurrentScreen.tsx +3 -3
  308. package/src/widget/hooks/useCustomTokenFetch.tsx +72 -0
  309. package/src/widget/hooks/useCustomTokenSearch.tsx +402 -0
  310. package/src/widget/hooks/useDebounce.ts +25 -0
  311. package/src/widget/hooks/useDebugScreens.ts +26 -10
  312. package/src/widget/hooks/useDefaultTokenSelection.tsx +99 -143
  313. package/src/widget/hooks/useDestinationSelectedToken.tsx +1 -14
  314. package/src/widget/hooks/useEarnPool.tsx +1 -1
  315. package/src/widget/hooks/useIntentTransactionHistory.ts +20 -11
  316. package/src/widget/hooks/useIsMobile.tsx +50 -0
  317. package/src/widget/hooks/useMode.ts +2 -3
  318. package/src/widget/hooks/useOriginSelectedToken.tsx +2 -15
  319. package/src/widget/hooks/usePayMessage.tsx +31 -11
  320. package/src/widget/hooks/usePriceImpactWarning.ts +1 -1
  321. package/src/widget/hooks/useQuote.ts +189 -6
  322. package/src/widget/hooks/useRecentTokens.ts +6 -6
  323. package/src/widget/hooks/useRecipients.ts +1 -1
  324. package/src/widget/hooks/useSelectedFeeOption.tsx +2 -2
  325. package/src/widget/hooks/useSelectedFundMethod.tsx +1 -1
  326. package/src/widget/hooks/useSelectedRecipient.tsx +1 -1
  327. package/src/widget/hooks/useSendForm.ts +328 -152
  328. package/src/widget/hooks/useSwapAmount.tsx +1 -1
  329. package/src/widget/hooks/useTheme.tsx +1 -1
  330. package/src/widget/hooks/useTokenList.ts +672 -400
  331. package/src/widget/hooks/useTrailsSendTransaction.ts +949 -0
  332. package/src/widget/hooks/useWalletConnectUri.tsx +228 -0
  333. package/src/widget/hooks/useWidgetProps.tsx +3 -1
  334. package/src/widget/index.tsx +12 -0
  335. package/src/widget/providers/TrailsModalProvider.tsx +195 -0
  336. package/src/widget/providers/TrailsProvider.tsx +9 -3
  337. package/src/widget/types.ts +12 -20
  338. package/src/widget/widget.tsx +598 -385
  339. package/dist/cctp.d.ts +0 -3
  340. package/dist/cctp.d.ts.map +0 -1
  341. package/dist/lifi.d.ts +0 -4
  342. package/dist/lifi.d.ts.map +0 -1
  343. package/dist/meshconnect.d.ts +0 -171
  344. package/dist/meshconnect.d.ts.map +0 -1
  345. package/dist/relaySdk.d.ts +0 -87
  346. package/dist/relaySdk.d.ts.map +0 -1
  347. package/dist/widget/components/MeshConnectExchanges.d.ts +0 -7
  348. package/dist/widget/components/MeshConnectExchanges.d.ts.map +0 -1
  349. package/dist/widget/components/MeshConnectFlow.d.ts +0 -13
  350. package/dist/widget/components/MeshConnectFlow.d.ts.map +0 -1
  351. package/dist/widget/components/MeshConnectIframe.d.ts +0 -15
  352. package/dist/widget/components/MeshConnectIframe.d.ts.map +0 -1
  353. package/dist/widget/components/Receive.d.ts +0 -12
  354. package/dist/widget/components/Receive.d.ts.map +0 -1
  355. package/dist/widget/hooks/useSelectedMeshExchange.d.ts +0 -14
  356. package/dist/widget/hooks/useSelectedMeshExchange.d.ts.map +0 -1
  357. package/src/cctp.ts +0 -54
  358. package/src/lifi.ts +0 -108
  359. package/src/meshconnect.ts +0 -531
  360. package/src/relaySdk.ts +0 -703
  361. package/src/widget/components/MeshConnectExchanges.tsx +0 -290
  362. package/src/widget/components/MeshConnectFlow.tsx +0 -90
  363. package/src/widget/components/MeshConnectIframe.tsx +0 -500
  364. package/src/widget/components/Receive.tsx +0 -175
  365. package/src/widget/hooks/useSelectedMeshExchange.tsx +0 -46
@@ -8,8 +8,15 @@ import { useState, useEffect, useRef, useCallback } from "react"
8
8
  import { truncateAddress } from "../../utils.js"
9
9
  import { PriceImpactWarning } from "./PriceImpactWarning.js"
10
10
  import { usePriceImpactWarning } from "../hooks/usePriceImpactWarning.js"
11
- import { formatUsdAmountDisplay } from "../../tokenBalances.js"
12
- import { Copy, Check, Info } from "lucide-react"
11
+ import {
12
+ Copy,
13
+ Check,
14
+ Info,
15
+ ExternalLink,
16
+ Clock,
17
+ ChevronDown,
18
+ TriangleAlert,
19
+ } from "lucide-react"
13
20
 
14
21
  interface QuoteDetailsProps {
15
22
  quote?: PrepareSendQuote | null
@@ -21,30 +28,6 @@ interface QuoteDetailsProps {
21
28
  isRefetching?: boolean
22
29
  }
23
30
 
24
- // Helper function to format completion time
25
- const formatCompletionTime = (seconds: number): string => {
26
- if (seconds < 60) {
27
- return `${seconds}s`
28
- } else if (seconds < 3600) {
29
- const minutes = Math.floor(seconds / 60)
30
- const remainingSeconds = seconds % 60
31
- return remainingSeconds > 0
32
- ? `${minutes}m${remainingSeconds}s`
33
- : `${minutes}m`
34
- } else {
35
- const hours = Math.floor(seconds / 3600)
36
- const remainingMinutes = Math.floor((seconds % 3600) / 60)
37
- const remainingSeconds = seconds % 60
38
- if (remainingMinutes > 0 || remainingSeconds > 0) {
39
- return `${hours}h${remainingMinutes}m${
40
- remainingSeconds > 0 ? `${remainingSeconds}s` : ""
41
- }`
42
- } else {
43
- return `${hours}h`
44
- }
45
- }
46
- }
47
-
48
31
  export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
49
32
  quote,
50
33
  showContent = true,
@@ -97,6 +80,10 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
97
80
 
98
81
  if (!showContent) return null
99
82
 
83
+ // Use grandTotalUsd from normalized quote object
84
+ const grandTotalUsd = quote?.grandTotalUsd ?? 0
85
+ const grandTotalUsdDisplay = quote?.grandTotalUsdDisplay ?? "$0.00"
86
+
100
87
  return (
101
88
  <div
102
89
  className={`relative transition-opacity duration-300 ${
@@ -117,24 +104,11 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
117
104
  <span className="text-xs text-amber-600 dark:text-amber-400 flex items-center gap-1">
118
105
  Balance Status:
119
106
  <Tooltip message="Your wallet does not have sufficient balance to complete this transaction">
120
- <Info className="w-3 h-3 text-amber-500 dark:text-amber-400 cursor-pointer" />
107
+ <Info className="size-3 text-amber-500 dark:text-amber-400 cursor-pointer" />
121
108
  </Tooltip>
122
109
  </span>
123
110
  <span className="font-medium text-xs text-amber-600 dark:text-amber-400 flex items-center gap-1">
124
- <svg
125
- className="w-3 h-3"
126
- fill="none"
127
- stroke="currentColor"
128
- viewBox="0 0 24 24"
129
- aria-hidden="true"
130
- >
131
- <path
132
- strokeLinecap="round"
133
- strokeLinejoin="round"
134
- strokeWidth={2}
135
- d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"
136
- />
137
- </svg>
111
+ <TriangleAlert className="size-3" />
138
112
  Insufficient Balance
139
113
  </span>
140
114
  </div>
@@ -145,38 +119,25 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
145
119
  <button
146
120
  type="button"
147
121
  onClick={() => setIsExpanded(!isExpanded)}
148
- className="w-full flex items-center justify-between px-2 py-2 trails-border-radius-button transition-colors cursor-pointer text-xs"
122
+ className="w-full flex items-center justify-between px-2 py-2 trails-border-radius-button transition-colors cursor-pointer text-sm"
149
123
  aria-label="Show more details"
150
124
  >
151
- <div className="flex items-center gap-2 text-gray-600 dark:text-gray-400 whitespace-nowrap max-w-48 truncate">
152
- {quote?.originTokenRate && (
153
- <span className="font-medium">{quote.originTokenRate}</span>
154
- )}
125
+ <div className="font-semibold text-gray-900 dark:text-white flex items-center gap-2 whitespace-nowrap max-w-48 truncate">
126
+ {quote?.originTokenRate && quote.originTokenRate !== "0" ? (
127
+ <span>{quote.originTokenRate}</span>
128
+ ) : null}
155
129
  </div>
156
130
  <div className="flex items-center gap-2 text-gray-600 dark:text-gray-400">
157
- {quote?.completionEstimateSeconds != null && (
158
- <>
159
- <svg
160
- className="w-3 h-3"
161
- fill="none"
162
- stroke="currentColor"
163
- viewBox="0 0 24 24"
164
- aria-hidden="true"
165
- >
166
- <path
167
- strokeLinecap="round"
168
- strokeLinejoin="round"
169
- strokeWidth={2}
170
- d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
171
- />
172
- </svg>
131
+ {quote?.completionEstimateDisplay && (
132
+ <div className="flex items-center gap-1">
133
+ <Clock className="size-3" />
173
134
  <span className="font-medium">
174
- ~{formatCompletionTime(quote.completionEstimateSeconds)}
135
+ ~{quote.completionEstimateDisplay}
175
136
  </span>
176
- </>
137
+ </div>
177
138
  )}
178
- {quote?.gasCostUsd != null && quote?.gasCostUsd > 0 && (
179
- <>
139
+ {grandTotalUsd > 0 && (
140
+ <div className="flex items-center gap-1">
180
141
  <svg
181
142
  aria-hidden="true"
182
143
  focusable="false"
@@ -193,25 +154,14 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
193
154
  d="M32 64C32 28.7 60.7 0 96 0H256c35.3 0 64 28.7 64 64V256h8c48.6 0 88 39.4 88 88v32c0 13.3 10.7 24 24 24s24-10.7 24-24V222c-27.6-7.1-48-32.2-48-62V96L384 64c-8.8-8.8-8.8-23.2 0-32s23.2-8.8 32 0l77.3 77.3c12 12 18.7 28.3 18.7 45.3V168v24 32V376c0 39.8-32.2 72-72 72s-72-32.2-72-72V344c0-22.1-17.9-40-40-40h-8V448c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32V64zM96 80v96c0 8.8 7.2 16 16 16H240c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H112c-8.8 0-16 7.2-16 16z"
194
155
  />
195
156
  </svg>
196
- <span className="font-medium">{quote.gasCostUsdDisplay}</span>
197
- </>
157
+ <span className="font-medium">{grandTotalUsdDisplay}</span>
158
+ </div>
198
159
  )}
199
- <svg
200
- className={`w-3 h-3 transition-transform duration-300 ease-out ${
160
+ <ChevronDown
161
+ className={`size-3 transition-transform duration-300 ease-out text-gray-600 dark:text-gray-400 ${
201
162
  isExpanded ? "rotate-180" : ""
202
163
  }`}
203
- fill="none"
204
- stroke="currentColor"
205
- viewBox="0 0 24 24"
206
- aria-hidden="true"
207
- >
208
- <path
209
- strokeLinecap="round"
210
- strokeLinejoin="round"
211
- strokeWidth={2}
212
- d="M19 9l-7 7-7-7"
213
- />
214
- </svg>
164
+ />
215
165
  </div>
216
166
  </button>
217
167
  ) : (
@@ -224,22 +174,11 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
224
174
  aria-label="Show transaction details"
225
175
  >
226
176
  <span>Transaction details</span>
227
- <svg
228
- className={`w-3 h-3 transition-transform duration-300 ease-out ${
177
+ <ChevronDown
178
+ className={`size-3 transition-transform duration-300 ease-out ${
229
179
  isExpanded ? "rotate-180" : ""
230
180
  }`}
231
- fill="none"
232
- stroke="currentColor"
233
- viewBox="0 0 24 24"
234
- aria-hidden="true"
235
- >
236
- <path
237
- strokeLinecap="round"
238
- strokeLinejoin="round"
239
- strokeWidth={2}
240
- d="M19 9l-7 7-7-7"
241
- />
242
- </svg>
181
+ />
243
182
  </button>
244
183
  )}
245
184
  </div>
@@ -259,25 +198,11 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
259
198
  <span className="text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1">
260
199
  Estimated Time:
261
200
  <Tooltip message="Estimated time for the transaction to complete across all chains">
262
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
201
+ <Info className="size-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
263
202
  </Tooltip>
264
203
  </span>
265
204
  <span className="font-medium text-xs text-gray-900 dark:text-white flex items-center gap-1">
266
- <svg
267
- className="w-3 h-3"
268
- fill="none"
269
- stroke="currentColor"
270
- viewBox="0 0 24 24"
271
- aria-hidden="true"
272
- >
273
- <path
274
- strokeLinecap="round"
275
- strokeLinejoin="round"
276
- strokeWidth={2}
277
- d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
278
- />
279
- </svg>
280
- ~{formatCompletionTime(quote.completionEstimateSeconds)}
205
+ ~{quote.completionEstimateDisplay}
281
206
  </span>
282
207
  </div>
283
208
  )} */}
@@ -288,149 +213,73 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
288
213
  {/* Gas Costs Section */}
289
214
  {quote?.trailsFeeBreakdown &&
290
215
  (quote?.trailsFeeBreakdown.originRelayFee ||
291
- quote?.trailsFeeBreakdown.destinationRelayFee) && (
216
+ quote?.trailsFeeBreakdown.destinationRelayFee) &&
217
+ grandTotalUsd > 0 && (
292
218
  <>
293
- {/* Total Fees */}
294
- {(() => {
295
- // Calculate total gas costs
296
- const originGasUsd = parseFloat(
297
- quote.trailsFeeBreakdown?.originRelayFee?.usdValue?.replace(
298
- /[^0-9.-]/g,
299
- "",
300
- ) || "0",
301
- )
302
- const destGasUsd = parseFloat(
303
- quote.trailsFeeBreakdown?.destinationRelayFee?.usdValue?.replace(
304
- /[^0-9.-]/g,
305
- "",
306
- ) || "0",
307
- )
308
- const totalGasUsd = originGasUsd + destGasUsd
309
-
310
- // Calculate total provider costs (including swap fees)
311
- const providerUsd = parseFloat(
312
- quote.trailsFeeBreakdown?.providerFee?.usdValue?.replace(
313
- /[^0-9.-]/g,
314
- "",
315
- ) || "0",
316
- )
317
- const trailsUsd = parseFloat(
318
- quote.trailsFeeBreakdown?.trailsFee?.usdValue?.replace(
319
- /[^0-9.-]/g,
320
- "",
321
- ) || "0",
322
- )
323
- const originUsd = parseFloat(
324
- quote.originAmountUsdDisplay?.replace(/[^0-9.-]/g, "") ||
325
- "0",
326
- )
327
- const destUsd = parseFloat(
328
- quote.destinationAmountUsdDisplay?.replace(
329
- /[^0-9.-]/g,
330
- "",
331
- ) || "0",
332
- )
333
- const totalFeesUsd = parseFloat(
334
- quote.fees?.totalFeeAmountUsdDisplay?.replace(
335
- /[^0-9.-]/g,
336
- "",
337
- ) || "0",
338
- )
339
- const swapFeesUsd = Math.max(
340
- 0,
341
- originUsd - destUsd - totalFeesUsd,
342
- )
343
- const totalProviderUsd =
344
- providerUsd + trailsUsd + swapFeesUsd
345
-
346
- // Sum of all gas costs and all provider costs
347
- const grandTotalUsd = totalGasUsd + totalProviderUsd
348
-
349
- if (grandTotalUsd <= 0) return null
350
-
351
- return (
352
- <div className="flex justify-between items-center">
353
- <span className="text-sm font-semibold text-gray-900 dark:text-white flex items-center gap-1">
354
- Fees total
355
- <Tooltip message="The total fees for this transaction, including gas costs and all provider fees">
356
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
357
- </Tooltip>
358
- </span>
359
- <span className="font-semibold text-sm text-gray-900 dark:text-white">
360
- ≈ {formatUsdAmountDisplay(grandTotalUsd)}
361
- </span>
362
- </div>
363
- )
364
- })()}
365
-
219
+ <Row variant="bold">
220
+ <RowLabel tooltip="The total fees for this transaction, including gas costs and all provider fees">
221
+ Fees total
222
+ </RowLabel>
223
+ <RowValue>
224
+ <span title={`$${grandTotalUsd}`}>
225
+ ≈ {grandTotalUsdDisplay}
226
+ </span>
227
+ </RowValue>
228
+ </Row>
366
229
  <div className="h-0" />
367
-
368
- {/* All Gas Costs */}
230
+ {/* Gas Costs Group */}
369
231
  {(quote.trailsFeeBreakdown.originRelayFee ||
370
232
  quote.trailsFeeBreakdown.destinationRelayFee) && (
371
- <div className="flex justify-between items-center">
372
- <span className="text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1">
373
- All gas costs
374
- <Tooltip message="Total gas costs for executing transactions on both origin and destination chains">
375
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
376
- </Tooltip>
377
- </span>
378
- <span className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1">
379
- {(() => {
380
- const originGasUsd = parseFloat(
381
- quote.trailsFeeBreakdown.originRelayFee?.usdValue?.replace(
382
- /[^0-9.-]/g,
383
- "",
384
- ) || "0",
385
- )
386
- const destGasUsd = parseFloat(
387
- quote.trailsFeeBreakdown.destinationRelayFee?.usdValue?.replace(
388
- /[^0-9.-]/g,
389
- "",
390
- ) || "0",
391
- )
392
- const totalGasUsd = originGasUsd + destGasUsd
393
- return formatUsdAmountDisplay(totalGasUsd)
394
- })()}
395
- </span>
396
- </div>
397
- )}
398
-
399
- {/* Origin Gas */}
400
- {quote.trailsFeeBreakdown.originRelayFee && (
401
- <div className="flex justify-between items-center">
402
- <span className="text-xs text-gray-400 dark:text-gray-600 flex items-center gap-1">
403
- Origin Gas
404
- <ChainImage chainId={quote.originChain.id} size={16} />
405
- <Tooltip message="Gas fee for executing the transaction on the origin chain">
406
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
407
- </Tooltip>
408
- </span>
409
- <span className="font-medium text-xs text-gray-400 dark:text-gray-600">
410
- {quote.trailsFeeBreakdown.originRelayFee.usdValue}
411
- </span>
412
- </div>
413
- )}
233
+ <RowGroup>
234
+ <Row>
235
+ <RowLabel tooltip="Total gas costs for executing transactions on both origin and destination chains">
236
+ All gas costs
237
+ </RowLabel>
238
+ <RowValue>
239
+ <span title={`$${quote.totalGasUsd ?? 0}`}>
240
+ {quote.totalGasUsdDisplay ?? "$0.00"}
241
+ </span>
242
+ </RowValue>
243
+ </Row>
244
+
245
+ {quote.trailsFeeBreakdown.originRelayFee && (
246
+ <Row variant="light">
247
+ <RowLabel tooltip="Gas fee for executing the transaction on the origin chain">
248
+ Origin Gas
249
+ <ChainImage
250
+ chainId={quote.originChain.id}
251
+ size={16}
252
+ />
253
+ </RowLabel>
254
+ <RowValue>
255
+ <span title={`$${quote.originGasUsd ?? 0}`}>
256
+ {quote.trailsFeeBreakdown.originRelayFee.usdValue}
257
+ </span>
258
+ </RowValue>
259
+ </Row>
260
+ )}
414
261
 
415
- {/* Destination Gas */}
416
- {quote.trailsFeeBreakdown.destinationRelayFee && (
417
- <div className="flex justify-between items-center">
418
- <span className="text-xs text-gray-400 dark:text-gray-600 flex items-center gap-1">
419
- Destination Gas
420
- <ChainImage
421
- chainId={quote.destinationChain.id}
422
- size={16}
423
- />
424
- <Tooltip message="Gas fee for executing the transaction on the destination chain">
425
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
426
- </Tooltip>
427
- </span>
428
- <span className="font-medium text-xs text-gray-400 dark:text-gray-600">
429
- {quote.trailsFeeBreakdown.destinationRelayFee.usdValue}
430
- </span>
431
- </div>
262
+ {quote.trailsFeeBreakdown.destinationRelayFee && (
263
+ <Row variant="light">
264
+ <RowLabel tooltip="Gas fee for executing the transaction on the destination chain">
265
+ Destination Gas
266
+ <ChainImage
267
+ chainId={quote.destinationChain.id}
268
+ size={16}
269
+ />
270
+ </RowLabel>
271
+ <RowValue>
272
+ <span title={`$${quote.destGasUsd ?? 0}`}>
273
+ {
274
+ quote.trailsFeeBreakdown.destinationRelayFee
275
+ .usdValue
276
+ }
277
+ </span>
278
+ </RowValue>
279
+ </Row>
280
+ )}
281
+ </RowGroup>
432
282
  )}
433
-
434
283
  {/* Spacer */}
435
284
  <div className="h-1" />
436
285
  </>
@@ -441,86 +290,35 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
441
290
  if (!quote?.trailsFeeBreakdown) return null
442
291
 
443
292
  // Check if provider fee is non-zero
444
- const hasProviderFee =
445
- quote.trailsFeeBreakdown.providerFee &&
446
- parseFloat(
447
- quote.trailsFeeBreakdown.providerFee.usdValue?.replace(
448
- /[^0-9.-]/g,
449
- "",
450
- ) || "0",
451
- ) !== 0
293
+ const hasProviderFee = (quote.providerUsd ?? 0) > 0
452
294
 
453
295
  // Check if trails fee is non-zero
454
- const hasTrailsFee =
455
- quote.trailsFeeBreakdown.trailsFee &&
456
- parseFloat(
457
- quote.trailsFeeBreakdown.trailsFee.usdValue?.replace(
458
- /[^0-9.-]/g,
459
- "",
460
- ) || "0",
461
- ) !== 0
296
+ const hasTrailsFee = (quote.trailsUsd ?? 0) > 0
462
297
 
463
298
  if (!hasProviderFee && !hasTrailsFee) return null
464
299
 
465
300
  return (
466
- <>
467
- {/* Bridge/Swap Provider Fee */}
468
-
469
- {/* All Provider Costs */}
470
- {(hasProviderFee || hasTrailsFee) &&
301
+ <RowGroup>
302
+ {/* All Provider Fees = provider fee + swap fee */}
303
+ {((quote.providerUsd ?? 0) > 0 ||
304
+ (quote.swapFeesUsd ?? 0) > 0) &&
305
+ quote.allProviderFeesUsdDisplay &&
471
306
  (() => {
472
- const providerUsd = parseFloat(
473
- quote.trailsFeeBreakdown.providerFee?.usdValue?.replace(
474
- /[^0-9.-]/g,
475
- "",
476
- ) || "0",
477
- )
478
- const trailsUsd = parseFloat(
479
- quote.trailsFeeBreakdown.trailsFee?.usdValue?.replace(
480
- /[^0-9.-]/g,
481
- "",
482
- ) || "0",
483
- )
484
-
485
- // Calculate swap fees
486
- const originUsd = parseFloat(
487
- quote.originAmountUsdDisplay?.replace(
488
- /[^0-9.-]/g,
489
- "",
490
- ) || "0",
491
- )
492
- const destUsd = parseFloat(
493
- quote.destinationAmountUsdDisplay?.replace(
494
- /[^0-9.-]/g,
495
- "",
496
- ) || "0",
497
- )
498
- const totalFeesUsd = parseFloat(
499
- quote.fees?.totalFeeAmountUsdDisplay?.replace(
500
- /[^0-9.-]/g,
501
- "",
502
- ) || "0",
503
- )
504
- const swapFeesUsd = Math.max(
505
- 0,
506
- originUsd - destUsd - totalFeesUsd,
507
- )
508
-
509
- const totalProviderUsd =
510
- providerUsd + trailsUsd + swapFeesUsd
307
+ const allProviderFees =
308
+ (quote.providerUsd ?? 0) + (quote.swapFeesUsd ?? 0)
309
+ if (allProviderFees <= 0) return null
511
310
 
512
311
  return (
513
- <div className="flex justify-between items-center">
514
- <span className="text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1">
515
- All provider costs
516
- <Tooltip message="Total fees charged by providers, including bridge/swap, platform fees, and implicit swap costs">
517
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
518
- </Tooltip>
519
- </span>
520
- <span className="font-medium text-xs text-gray-600 dark:text-gray-400">
521
- {formatUsdAmountDisplay(totalProviderUsd)}
522
- </span>
523
- </div>
312
+ <Row>
313
+ <RowLabel tooltip="Total provider fees including bridge fees and swap fees">
314
+ All provider fees
315
+ </RowLabel>
316
+ <RowValue>
317
+ <span title={`$${quote.allProviderFeesUsd ?? 0}`}>
318
+ {quote.allProviderFeesUsdDisplay}
319
+ </span>
320
+ </RowValue>
321
+ </Row>
524
322
  )
525
323
  })()}
526
324
 
@@ -533,8 +331,8 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
533
331
  const providerName = quote.quoteProvider?.name || ""
534
332
 
535
333
  return (
536
- <div className="flex justify-between items-center">
537
- <span className="text-xs text-gray-400 dark:text-gray-600 flex items-center gap-1">
334
+ <Row variant="light">
335
+ <RowLabel tooltip="Fee charged by the bridge/swap provider for executing the transaction">
538
336
  {isCrossChain ? (
539
337
  providerName ? (
540
338
  <>
@@ -548,20 +346,7 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
548
346
  className="hover:underline inline-flex items-center gap-0.5 text-blue-500"
549
347
  >
550
348
  {providerName}
551
- <svg
552
- className="w-3 h-3"
553
- fill="none"
554
- stroke="currentColor"
555
- viewBox="0 0 24 24"
556
- aria-hidden="true"
557
- >
558
- <path
559
- strokeLinecap="round"
560
- strokeLinejoin="round"
561
- strokeWidth={2}
562
- d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
563
- />
564
- </svg>
349
+ <ExternalLink className="size-3" />
565
350
  </a>
566
351
  )
567
352
  </span>
@@ -581,20 +366,7 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
581
366
  className="hover:underline inline-flex items-center gap-0.5 text-blue-500"
582
367
  >
583
368
  {providerName}
584
- <svg
585
- className="w-3 h-3"
586
- fill="none"
587
- stroke="currentColor"
588
- viewBox="0 0 24 24"
589
- aria-hidden="true"
590
- >
591
- <path
592
- strokeLinecap="round"
593
- strokeLinejoin="round"
594
- strokeWidth={2}
595
- d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
596
- />
597
- </svg>
369
+ <ExternalLink className="size-3" />
598
370
  </a>
599
371
  )
600
372
  </span>
@@ -602,56 +374,37 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
602
374
  ) : (
603
375
  <>Liquidity Provider</>
604
376
  )}
605
- <Tooltip message="Fee charged by the bridge/swap provider for executing the transaction">
606
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
607
- </Tooltip>
608
- </span>
609
- <span className="font-medium text-xs text-gray-400 dark:text-gray-600">
610
- {providerFee.usdValue}
611
- </span>
612
- </div>
377
+ </RowLabel>
378
+ <RowValue>
379
+ <span title={`$${quote.providerUsd ?? 0}`}>
380
+ {providerFee.usdValue}
381
+ </span>
382
+ </RowValue>
383
+ </Row>
613
384
  )
614
385
  })()}
615
386
 
616
387
  {/* Swap Fees (implicit costs) */}
617
- {(() => {
618
- // Calculate swap fees: (originAmount - destinationAmount) - totalFees
619
- const originUsd = parseFloat(
620
- quote.originAmountUsdDisplay?.replace(/[^0-9.-]/g, "") ||
621
- "0",
622
- )
623
- const destUsd = parseFloat(
624
- quote.destinationAmountUsdDisplay?.replace(
625
- /[^0-9.-]/g,
626
- "",
627
- ) || "0",
628
- )
629
- const totalFeesUsd = parseFloat(
630
- quote.fees?.totalFeeAmountUsdDisplay?.replace(
631
- /[^0-9.-]/g,
632
- "",
633
- ) || "0",
634
- )
635
-
636
- const swapFeesUsd = originUsd - destUsd - totalFeesUsd
388
+ {quote.swapFeesUsdDisplay &&
389
+ (() => {
390
+ const swapFeesUsd = quote.swapFeesUsd ?? 0
637
391
 
638
- // Only show if swap fees > 0
639
- if (swapFeesUsd <= 0) return null
392
+ // Only show if swap fees > 0
393
+ if (swapFeesUsd <= 0) return null
640
394
 
641
- return (
642
- <div className="flex justify-between items-center">
643
- <span className="text-xs text-gray-400 dark:text-gray-600 flex items-center gap-1">
644
- Swap
645
- <Tooltip message="Implicit costs including DEX fees, liquidity provider fees, and routing costs">
646
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
647
- </Tooltip>
648
- </span>
649
- <span className="font-medium text-xs text-gray-400 dark:text-gray-600">
650
- {formatUsdAmountDisplay(swapFeesUsd)}
651
- </span>
652
- </div>
653
- )
654
- })()}
395
+ return (
396
+ <Row variant="light">
397
+ <RowLabel tooltip="Implicit costs including DEX fees, liquidity provider fees, and routing costs">
398
+ Swap
399
+ </RowLabel>
400
+ <RowValue>
401
+ <span title={`$${swapFeesUsd}`}>
402
+ {quote.swapFeesUsdDisplay}
403
+ </span>
404
+ </RowValue>
405
+ </Row>
406
+ )
407
+ })()}
655
408
 
656
409
  {/* Trails Platform Fee */}
657
410
  {hasTrailsFee &&
@@ -660,20 +413,15 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
660
413
  const trailsFee = quote.trailsFeeBreakdown.trailsFee
661
414
 
662
415
  return (
663
- <div className="flex justify-between items-center">
664
- <span className="text-xs text-gray-400 dark:text-gray-600 flex items-center gap-1">
416
+ <Row variant="light">
417
+ <RowLabel tooltip="Platform fee for using the Trails service">
665
418
  Trails
666
- <Tooltip message="Platform fee for using the Trails service">
667
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
668
- </Tooltip>
669
- </span>
670
- <span className="font-medium text-xs text-gray-400 dark:text-gray-600">
671
- {trailsFee.usdValue}
672
- </span>
673
- </div>
419
+ </RowLabel>
420
+ <RowValue>{trailsFee.usdValue}</RowValue>
421
+ </Row>
674
422
  )
675
423
  })()}
676
- </>
424
+ </RowGroup>
677
425
  )
678
426
  })()}
679
427
 
@@ -693,20 +441,16 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
693
441
  if (!showSection) return null
694
442
 
695
443
  return (
696
- <>
697
- <div>
698
- <span className="text-sm font-semibold text-gray-900 dark:text-white flex items-center gap-1">
699
- Transaction details
700
- </span>
701
- </div>
444
+ <RowGroup>
445
+ <Row variant="bold">
446
+ <RowLabel>Transaction details</RowLabel>
447
+ </Row>
702
448
 
703
449
  {/* Intent ID */}
704
450
  {hasIntentId && (
705
- <div className="flex justify-between items-center gap-2">
706
- <span className="text-xs text-gray-600 dark:text-gray-400">
707
- Intent ID
708
- </span>
709
- <div className="flex items-center gap-1 text-xs font-medium text-gray-600 dark:text-gray-400">
451
+ <Row className="gap-2">
452
+ <RowLabel>Intent ID</RowLabel>
453
+ <RowValue className="flex items-center gap-1">
710
454
  <span title={quote.intentId ?? undefined}>
711
455
  {truncateAddress(quote?.intentId ?? "", 9, 3)}
712
456
  </span>
@@ -717,42 +461,34 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
717
461
  aria-label="Copy intent ID"
718
462
  >
719
463
  {intentIdCopied ? (
720
- <Check className="w-3 h-3 text-emerald-500" />
464
+ <Check className="size-3 text-emerald-500" />
721
465
  ) : (
722
- <Copy className="w-3 h-3 text-gray-500 dark:text-gray-400" />
466
+ <Copy className="size-3 text-gray-500 dark:text-gray-400" />
723
467
  )}
724
468
  </button>
725
- </div>
726
- </div>
469
+ </RowValue>
470
+ </Row>
727
471
  )}
728
472
 
729
473
  {/* Max Slippage */}
730
474
  {hasSlippage && (
731
- <div className="flex justify-between items-center">
732
- <span className="text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1">
475
+ <Row>
476
+ <RowLabel tooltip="The maximum percentage by which the exchange rate can change before the transaction fails. Higher slippage means more tolerance for price changes but potentially worse rates.">
733
477
  Max slippage
734
- <Tooltip message="The maximum percentage by which the exchange rate can change before the transaction fails. Higher slippage means more tolerance for price changes but potentially worse rates.">
735
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
736
- </Tooltip>
737
- </span>
738
- <span className="font-medium text-xs text-gray-600 dark:text-gray-400">
739
- {quote.slippageTolerance}%
740
- </span>
741
- </div>
478
+ </RowLabel>
479
+ <RowValue>{quote.slippageTolerance}%</RowValue>
480
+ </Row>
742
481
  )}
743
482
 
744
483
  {/* Price Impact */}
745
484
  {hasPriceImpact && (
746
485
  <div className="space-y-1">
747
- <div className="flex justify-between items-center">
748
- <span className="text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1">
486
+ <Row>
487
+ <RowLabel tooltip="The percentage change in the token price caused by your trade. Higher impact means your trade affects the market price more, potentially resulting in worse rates.">
749
488
  Price impact
750
- <Tooltip message="The percentage change in the token price caused by your trade. Higher impact means your trade affects the market price more, potentially resulting in worse rates.">
751
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
752
- </Tooltip>
753
- </span>
754
- <span
755
- className={`font-medium text-xs flex items-center gap-1 ${
489
+ </RowLabel>
490
+ <RowValue
491
+ className={`flex items-center gap-1 ${
756
492
  Math.abs(Number(quote.priceImpact)) > 5
757
493
  ? "text-red-600 dark:text-red-400"
758
494
  : Math.abs(Number(quote.priceImpact)) > 0.5
@@ -762,25 +498,12 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
762
498
  >
763
499
  {Math.abs(Number(quote.priceImpact)) > 0.5 && (
764
500
  <span title="High price impact">
765
- <svg
766
- className="w-3 h-3"
767
- fill="none"
768
- stroke="currentColor"
769
- viewBox="0 0 24 24"
770
- aria-hidden="true"
771
- >
772
- <path
773
- strokeLinecap="round"
774
- strokeLinejoin="round"
775
- strokeWidth={2}
776
- d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"
777
- />
778
- </svg>
501
+ <TriangleAlert className="size-3" />
779
502
  </span>
780
503
  )}
781
504
  {quote.priceImpact}%
782
- </span>
783
- </div>
505
+ </RowValue>
506
+ </Row>
784
507
  {quote.priceImpactUsdDisplay && (
785
508
  <div className="text-right">
786
509
  <span className="text-xs text-gray-500 dark:text-gray-400">
@@ -790,284 +513,252 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
790
513
  )}
791
514
  </div>
792
515
  )}
793
- </>
516
+ </RowGroup>
794
517
  )
795
518
  })()}
796
519
 
797
520
  <div className="space-y-3 pt-2">
798
521
  {/* Exchange Rate */}
799
- {quote?.originTokenRate && quote?.destinationTokenRate && (
800
- <div className="flex justify-between items-center">
801
- <span className="text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1">
522
+ {quote?.originTokenRate &&
523
+ quote?.destinationTokenRate &&
524
+ quote.originTokenRate !== "0" &&
525
+ quote.destinationTokenRate !== "0" ? (
526
+ <Row>
527
+ <RowLabel tooltip="The current exchange rate between the origin and destination tokens">
802
528
  Exchange Rate
803
- <Tooltip message="The current exchange rate between the origin and destination tokens">
804
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
805
- </Tooltip>
806
- </span>
807
- <button
808
- type="button"
809
- onClick={() => setShowOriginRate(!showOriginRate)}
810
- className="font-medium text-xs hover:underline cursor-pointer text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
811
- >
812
- {showOriginRate
813
- ? quote.originTokenRate
814
- : quote.destinationTokenRate}
815
- </button>
816
- </div>
817
- )}
818
-
819
- {/* Origin Transfer Amount */}
820
- {quote?.originAmount &&
529
+ </RowLabel>
530
+ <RowValue>
531
+ <button
532
+ type="button"
533
+ onClick={() => setShowOriginRate(!showOriginRate)}
534
+ className="hover:underline cursor-pointer"
535
+ >
536
+ {showOriginRate
537
+ ? quote.originTokenRate
538
+ : quote.destinationTokenRate}
539
+ </button>
540
+ </RowValue>
541
+ </Row>
542
+ ) : null}
543
+
544
+ {/* Transfer Amounts Group */}
545
+ {((quote?.originAmount &&
821
546
  quote?.originToken.symbol &&
822
- quote?.originChain.id && (
823
- <div className="flex justify-between items-start">
824
- <span className="text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1">
825
- Origin Transfer Amount
826
- <Tooltip message="The amount of tokens you will send from the origin chain">
827
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
828
- </Tooltip>
829
- </span>
830
- <div className="text-right">
831
- {quote.originToken.contractAddress ===
832
- "0x0000000000000000000000000000000000000000" ? (
833
- <>
834
- <div className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1 justify-end">
835
- <TokenImage
836
- imageUrl={quote.originToken.imageUrl}
837
- symbol={quote.originToken.symbol}
838
- chainId={quote.originChain.id}
839
- contractAddress={
840
- quote.originToken.contractAddress
841
- }
842
- size={16}
843
- />
844
- {quote.originAmountDisplay}{" "}
845
- {quote.originToken.symbol}
846
- </div>
847
- {quote.originAmountUsdDisplay && (
848
- <div className="text-xs text-gray-500 dark:text-gray-400 mt-0.5">
849
- {quote.originAmountUsdDisplay}
850
- </div>
547
+ quote?.originChain.id) ||
548
+ (quote?.destinationToken.symbol &&
549
+ quote?.destinationAmount &&
550
+ quote?.destinationAmountUsdDisplay &&
551
+ quote?.destinationChain.id)) && (
552
+ <RowGroup>
553
+ {quote?.originAmount &&
554
+ quote?.originToken.symbol &&
555
+ quote?.originChain.id && (
556
+ <Row className="items-start">
557
+ <RowLabel tooltip="The amount of tokens you will send from the origin chain">
558
+ Origin Transfer Amount
559
+ </RowLabel>
560
+ <div className="text-right">
561
+ {quote.originToken.contractAddress ===
562
+ "0x0000000000000000000000000000000000000000" ? (
563
+ <>
564
+ <div className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1 justify-end">
565
+ <TokenImage
566
+ imageUrl={quote.originToken.imageUrl}
567
+ symbol={quote.originToken.symbol}
568
+ chainId={quote.originChain.id}
569
+ contractAddress={
570
+ quote.originToken.contractAddress
571
+ }
572
+ size={16}
573
+ />
574
+ {quote.originAmountDisplay}{" "}
575
+ {quote.originToken.symbol}
576
+ </div>
577
+ {quote.originAmountUsdDisplay && (
578
+ <div className="text-xs text-gray-500 dark:text-gray-400 mt-0.5">
579
+ ≈ {quote.originAmountUsdDisplay}
580
+ </div>
581
+ )}
582
+ </>
583
+ ) : (
584
+ <>
585
+ <a
586
+ href={getExplorerUrlForAddress({
587
+ address: quote.originToken.contractAddress,
588
+ chainId: quote.originChain.id,
589
+ })}
590
+ target="_blank"
591
+ rel="noopener noreferrer"
592
+ className="hover:underline cursor-pointer"
593
+ >
594
+ <div className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1 justify-end">
595
+ <TokenImage
596
+ imageUrl={quote.originToken.imageUrl}
597
+ symbol={quote.originToken.symbol}
598
+ chainId={quote.originChain.id}
599
+ contractAddress={
600
+ quote.originToken.contractAddress
601
+ }
602
+ size={16}
603
+ />
604
+ {quote.originAmountDisplay}{" "}
605
+ {quote.originToken.symbol}
606
+ </div>
607
+ </a>
608
+ {quote.originAmountUsdDisplay && (
609
+ <div className="text-xs text-gray-500 dark:text-gray-400 mt-0.5">
610
+ ≈ {quote.originAmountUsdDisplay}
611
+ </div>
612
+ )}
613
+ </>
851
614
  )}
852
- </>
853
- ) : (
854
- <>
855
- <a
856
- href={getExplorerUrlForAddress({
857
- address: quote.originToken.contractAddress,
858
- chainId: quote.originChain.id,
859
- })}
860
- target="_blank"
861
- rel="noopener noreferrer"
862
- className="hover:underline cursor-pointer"
863
- >
864
- <div className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1 justify-end">
865
- <TokenImage
866
- imageUrl={quote.originToken.imageUrl}
867
- symbol={quote.originToken.symbol}
868
- chainId={quote.originChain.id}
869
- contractAddress={
870
- quote.originToken.contractAddress
871
- }
872
- size={16}
873
- />
874
- {quote.originAmountDisplay}{" "}
875
- {quote.originToken.symbol}
876
- </div>
877
- </a>
878
- {quote.originAmountUsdDisplay && (
879
- <div className="text-xs text-gray-500 dark:text-gray-400 mt-0.5">
880
- ≈ {quote.originAmountUsdDisplay}
881
- </div>
615
+ </div>
616
+ </Row>
617
+ )}
618
+
619
+ {quote?.destinationToken.symbol &&
620
+ quote?.destinationAmount &&
621
+ quote?.destinationAmountUsdDisplay &&
622
+ quote?.destinationChain.id && (
623
+ <Row className="items-start">
624
+ <RowLabel tooltip="The amount of tokens you will receive on the destination chain after the swap and/or bridge">
625
+ Destination Target Amount
626
+ </RowLabel>
627
+ <div className="text-right">
628
+ {quote.destinationToken.contractAddress ===
629
+ "0x0000000000000000000000000000000000000000" ? (
630
+ <>
631
+ <div className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1 justify-end">
632
+ <TokenImage
633
+ imageUrl={quote.destinationToken.imageUrl}
634
+ symbol={quote.destinationToken.symbol}
635
+ chainId={quote.destinationChain.id}
636
+ contractAddress={
637
+ quote.destinationToken.contractAddress
638
+ }
639
+ size={16}
640
+ />
641
+ {quote.destinationAmountDisplay}{" "}
642
+ {quote.destinationToken.symbol}
643
+ </div>
644
+ {quote.destinationAmountUsdDisplay && (
645
+ <div className="text-xs text-gray-500 dark:text-gray-400 mt-0.5">
646
+ ≈ {quote.destinationAmountUsdDisplay}
647
+ </div>
648
+ )}
649
+ </>
650
+ ) : (
651
+ <>
652
+ <a
653
+ href={getExplorerUrlForAddress({
654
+ address:
655
+ quote.destinationToken.contractAddress,
656
+ chainId: quote.destinationChain.id,
657
+ })}
658
+ target="_blank"
659
+ rel="noopener noreferrer"
660
+ className="hover:underline cursor-pointer"
661
+ >
662
+ <div className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1 justify-end">
663
+ <TokenImage
664
+ imageUrl={quote.destinationToken.imageUrl}
665
+ symbol={quote.destinationToken.symbol}
666
+ chainId={quote.destinationChain.id}
667
+ contractAddress={
668
+ quote.destinationToken.contractAddress
669
+ }
670
+ size={16}
671
+ />
672
+ {quote.destinationAmountDisplay}{" "}
673
+ {quote.destinationToken.symbol}
674
+ </div>
675
+ </a>
676
+ {quote.destinationAmountUsdDisplay && (
677
+ <div className="text-xs text-gray-500 dark:text-gray-400 mt-0.5">
678
+ ≈ {quote.destinationAmountUsdDisplay}
679
+ </div>
680
+ )}
681
+ </>
882
682
  )}
883
- </>
884
- )}
885
- </div>
886
- </div>
887
- )}
683
+ </div>
684
+ </Row>
685
+ )}
686
+ </RowGroup>
687
+ )}
888
688
 
889
- {/* Destination Target Amount */}
890
- {quote?.destinationToken.symbol &&
891
- quote?.destinationAmount &&
892
- quote?.destinationAmountUsdDisplay &&
893
- quote?.destinationChain.id && (
894
- <div className="flex justify-between items-start">
895
- <span className="text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1">
896
- Destination Target Amount
897
- <Tooltip message="The amount of tokens you will receive on the destination chain after the swap and/or bridge">
898
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
899
- </Tooltip>
900
- </span>
901
- <div className="text-right">
902
- {quote.destinationToken.contractAddress ===
903
- "0x0000000000000000000000000000000000000000" ? (
904
- <>
905
- <div className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1 justify-end">
906
- <TokenImage
907
- imageUrl={quote.destinationToken.imageUrl}
908
- symbol={quote.destinationToken.symbol}
909
- chainId={quote.destinationChain.id}
910
- contractAddress={
911
- quote.destinationToken.contractAddress
912
- }
913
- size={16}
914
- />
915
- {quote.destinationAmountDisplay}{" "}
916
- {quote.destinationToken.symbol}
917
- </div>
918
- {quote.destinationAmountUsdDisplay && (
919
- <div className="text-xs text-gray-500 dark:text-gray-400 mt-0.5">
920
- {quote.destinationAmountUsdDisplay}
921
- </div>
922
- )}
923
- </>
924
- ) : (
925
- <>
689
+ {/* Address Group */}
690
+ {(quote?.originDepositAddress ||
691
+ quote?.destinationDepositAddress ||
692
+ quote?.destinationAddress) && (
693
+ <RowGroup>
694
+ {quote?.originDepositAddress && (
695
+ <Row>
696
+ <RowLabel tooltip="This is the intent address to deposit to that will then execute the swap and/or bridge">
697
+ Origin Deposit Address
698
+ </RowLabel>
699
+ <RowValue>
700
+ <a
701
+ href={getExplorerUrlForAddress({
702
+ address: quote.originDepositAddress,
703
+ chainId: quote.originChain.id,
704
+ })}
705
+ target="_blank"
706
+ rel="noopener noreferrer"
707
+ className="font-mono text-xs hover:underline flex items-center gap-1 text-blue-500"
708
+ >
709
+ {truncateAddress(quote.originDepositAddress)}
710
+ <ExternalLink className="size-3" />
711
+ </a>
712
+ </RowValue>
713
+ </Row>
714
+ )}
715
+
716
+ {quote?.destinationDepositAddress &&
717
+ quote?.destinationDepositAddress !==
718
+ quote?.originDepositAddress && (
719
+ <Row>
720
+ <RowLabel tooltip="This is the address that will receive the tokens after any swap and/or bridge from the origin chain">
721
+ Destination Deposit Address
722
+ </RowLabel>
723
+ <RowValue>
926
724
  <a
927
725
  href={getExplorerUrlForAddress({
928
- address: quote.destinationToken.contractAddress,
726
+ address: quote.destinationDepositAddress,
929
727
  chainId: quote.destinationChain.id,
930
728
  })}
931
729
  target="_blank"
932
730
  rel="noopener noreferrer"
933
- className="hover:underline cursor-pointer"
731
+ className="font-mono text-xs hover:underline flex items-center gap-1 text-blue-500"
934
732
  >
935
- <div className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1 justify-end">
936
- <TokenImage
937
- imageUrl={quote.destinationToken.imageUrl}
938
- symbol={quote.destinationToken.symbol}
939
- chainId={quote.destinationChain.id}
940
- contractAddress={
941
- quote.destinationToken.contractAddress
942
- }
943
- size={16}
944
- />
945
- {quote.destinationAmountDisplay}{" "}
946
- {quote.destinationToken.symbol}
947
- </div>
733
+ {truncateAddress(quote.destinationDepositAddress)}
734
+ <ExternalLink className="size-3" />
948
735
  </a>
949
- {quote.destinationAmountUsdDisplay && (
950
- <div className="text-xs text-gray-500 dark:text-gray-400 mt-0.5">
951
- ≈ {quote.destinationAmountUsdDisplay}
952
- </div>
953
- )}
954
- </>
955
- )}
956
- </div>
957
- </div>
958
- )}
959
-
960
- {/* Origin Deposit Address */}
961
- {quote?.originDepositAddress && (
962
- <div className="flex justify-between items-center">
963
- <span className="text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1">
964
- Origin Deposit Address
965
- <Tooltip message="This is the intent address to deposit to that will then execute the swap and/or bridge">
966
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
967
- </Tooltip>
968
- </span>
969
- <a
970
- href={getExplorerUrlForAddress({
971
- address: quote.originDepositAddress,
972
- chainId: quote.originChain.id,
973
- })}
974
- target="_blank"
975
- rel="noopener noreferrer"
976
- className="font-mono text-xs hover:underline flex items-center gap-1 text-blue-500"
977
- >
978
- {truncateAddress(quote.originDepositAddress)}
979
- <svg
980
- className="w-3 h-3"
981
- fill="none"
982
- stroke="currentColor"
983
- viewBox="0 0 24 24"
984
- aria-hidden="true"
985
- >
986
- <path
987
- strokeLinecap="round"
988
- strokeLinejoin="round"
989
- strokeWidth={2}
990
- d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
991
- />
992
- </svg>
993
- </a>
994
- </div>
995
- )}
996
-
997
- {/* Destination Deposit Address */}
998
- {quote?.destinationDepositAddress &&
999
- quote?.destinationDepositAddress !==
1000
- quote?.originDepositAddress && (
1001
- <div className="flex justify-between items-center">
1002
- <span className="text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1">
1003
- Destination Deposit Address
1004
- <Tooltip message="This is the address that will receive the tokens after any swap and/or bridge from the origin chain">
1005
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
1006
- </Tooltip>
1007
- </span>
1008
- <a
1009
- href={getExplorerUrlForAddress({
1010
- address: quote.destinationDepositAddress,
1011
- chainId: quote.destinationChain.id,
1012
- })}
1013
- target="_blank"
1014
- rel="noopener noreferrer"
1015
- className="font-mono text-xs hover:underline flex items-center gap-1 text-blue-500"
1016
- >
1017
- {truncateAddress(quote.destinationDepositAddress)}
1018
- <svg
1019
- className="w-3 h-3"
1020
- fill="none"
1021
- stroke="currentColor"
1022
- viewBox="0 0 24 24"
1023
- aria-hidden="true"
1024
- >
1025
- <path
1026
- strokeLinecap="round"
1027
- strokeLinejoin="round"
1028
- strokeWidth={2}
1029
- d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
1030
- />
1031
- </svg>
1032
- </a>
1033
- </div>
1034
- )}
1035
-
1036
- {/* Destination Target Address */}
1037
- {quote?.destinationAddress && (
1038
- <div className="flex justify-between items-center">
1039
- <span className="text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1">
1040
- Destination Target Address
1041
- <Tooltip message="This is the final execution address or recipient address">
1042
- <Info className="w-3 h-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
1043
- </Tooltip>
1044
- </span>
1045
- <a
1046
- href={getExplorerUrlForAddress({
1047
- address: quote.destinationAddress,
1048
- chainId: quote.destinationChain.id,
1049
- })}
1050
- target="_blank"
1051
- rel="noopener noreferrer"
1052
- className="font-mono text-xs hover:underline flex items-center gap-1 text-blue-500"
1053
- >
1054
- {truncateAddress(quote.destinationAddress)}
1055
- <svg
1056
- className="w-3 h-3"
1057
- fill="none"
1058
- stroke="currentColor"
1059
- viewBox="0 0 24 24"
1060
- aria-hidden="true"
1061
- >
1062
- <path
1063
- strokeLinecap="round"
1064
- strokeLinejoin="round"
1065
- strokeWidth={2}
1066
- d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
1067
- />
1068
- </svg>
1069
- </a>
1070
- </div>
736
+ </RowValue>
737
+ </Row>
738
+ )}
739
+
740
+ {quote?.destinationAddress && (
741
+ <Row>
742
+ <RowLabel tooltip="This is the final execution address or recipient address">
743
+ Destination Target Address
744
+ </RowLabel>
745
+ <RowValue>
746
+ <a
747
+ href={getExplorerUrlForAddress({
748
+ address: quote.destinationAddress,
749
+ chainId: quote.destinationChain.id,
750
+ })}
751
+ target="_blank"
752
+ rel="noopener noreferrer"
753
+ className="font-mono text-xs hover:underline flex items-center gap-1 text-blue-500"
754
+ >
755
+ {truncateAddress(quote.destinationAddress)}
756
+ <ExternalLink className="size-3" />
757
+ </a>
758
+ </RowValue>
759
+ </Row>
760
+ )}
761
+ </RowGroup>
1071
762
  )}
1072
763
 
1073
764
  {/* Custom Calldata */}
@@ -1099,22 +790,11 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
1099
790
  <span className="text-[10px]">
1100
791
  Includes custom destination calldata
1101
792
  </span>
1102
- <svg
1103
- className={`w-3 h-3 transition-transform duration-300 ease-out ${
793
+ <ChevronDown
794
+ className={`size-3 transition-transform duration-300 ease-out ${
1104
795
  showCalldata ? "rotate-180" : ""
1105
796
  }`}
1106
- fill="none"
1107
- stroke="currentColor"
1108
- viewBox="0 0 24 24"
1109
- aria-hidden="true"
1110
- >
1111
- <path
1112
- strokeLinecap="round"
1113
- strokeLinejoin="round"
1114
- strokeWidth={2}
1115
- d="M19 9l-7 7-7-7"
1116
- />
1117
- </svg>
797
+ />
1118
798
  </button>
1119
799
  <div
1120
800
  ref={calldataRef}
@@ -1148,3 +828,68 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
1148
828
  }
1149
829
 
1150
830
  export default QuoteDetails
831
+
832
+ interface RowGroupProps {
833
+ children: React.ReactNode
834
+ className?: string
835
+ }
836
+
837
+ const RowGroup: React.FC<RowGroupProps> = ({ children, className = "" }) => (
838
+ <div className={`space-y-2 ${className}`}>{children}</div>
839
+ )
840
+
841
+ const rowVariants = {
842
+ default: "text-xs text-gray-600 dark:text-gray-400",
843
+ light: "text-xs text-gray-400 dark:text-gray-600",
844
+ bold: "text-sm font-semibold text-gray-900 dark:text-white",
845
+ }
846
+
847
+ interface RowProps {
848
+ children: React.ReactNode
849
+ className?: string
850
+ variant?: keyof typeof rowVariants
851
+ }
852
+
853
+ const Row: React.FC<RowProps> = ({
854
+ children,
855
+ className = "",
856
+ variant = "default",
857
+ }) => (
858
+ <div
859
+ className={`flex justify-between items-center ${rowVariants[variant]} ${className}`}
860
+ >
861
+ {children}
862
+ </div>
863
+ )
864
+
865
+ interface RowLabelProps {
866
+ children: React.ReactNode
867
+ tooltip?: string
868
+ className?: string
869
+ }
870
+
871
+ const RowLabel: React.FC<RowLabelProps> = ({
872
+ children,
873
+ tooltip,
874
+ className = "",
875
+ }) => {
876
+ return (
877
+ <div className={`flex items-center gap-1 ${className}`}>
878
+ {children}
879
+ {tooltip && (
880
+ <Tooltip message={tooltip}>
881
+ <Info className="size-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
882
+ </Tooltip>
883
+ )}
884
+ </div>
885
+ )
886
+ }
887
+
888
+ interface RowValueProps {
889
+ children: React.ReactNode
890
+ className?: string
891
+ }
892
+
893
+ const RowValue: React.FC<RowValueProps> = ({ children, className }) => {
894
+ return <div className={className}>{children}</div>
895
+ }