0xtrails 0.13.1 → 0.14.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 (804) hide show
  1. package/dist/abis/trailsHydrate.d.ts +5 -42
  2. package/dist/abis/trailsHydrate.d.ts.map +1 -1
  3. package/dist/abis/trailsRouter.d.ts +1 -1
  4. package/dist/abis/trailsRouter.d.ts.map +1 -1
  5. package/dist/{widget/analytics → analytics/hooks}/useWidgetAnalytics.d.ts +2 -4
  6. package/dist/analytics/hooks/useWidgetAnalytics.d.ts.map +1 -0
  7. package/dist/analytics.d.ts.map +1 -1
  8. package/dist/chainSwitch.d.ts.map +1 -1
  9. package/dist/chains-C1NhDLF_.js +4 -0
  10. package/dist/chains-CcoarGia.js +658 -0
  11. package/dist/chains.d.ts +0 -1
  12. package/dist/chains.d.ts.map +1 -1
  13. package/dist/committedIntentStore.d.ts +5 -0
  14. package/dist/committedIntentStore.d.ts.map +1 -0
  15. package/dist/config.d.ts +2 -0
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/constants.d.ts +3 -1
  18. package/dist/constants.d.ts.map +1 -1
  19. package/dist/customTokens.d.ts.map +1 -1
  20. package/dist/error.d.ts +73 -4
  21. package/dist/error.d.ts.map +1 -1
  22. package/dist/hooks/useAddressWalletIcon.d.ts.map +1 -0
  23. package/dist/hooks/useAmountUsd.d.ts.map +1 -0
  24. package/dist/hooks/useBalanceVisible.d.ts.map +1 -0
  25. package/dist/hooks/useChainFilter.d.ts.map +1 -0
  26. package/dist/{widget/hooks → hooks}/useCheckout.d.ts +15 -15
  27. package/dist/hooks/useCheckout.d.ts.map +1 -0
  28. package/dist/hooks/useClickTracking.d.ts.map +1 -0
  29. package/dist/{widget/hooks → hooks}/useCombinedHistory.d.ts +3 -2
  30. package/dist/hooks/useCombinedHistory.d.ts.map +1 -0
  31. package/dist/hooks/useConnector.d.ts.map +1 -0
  32. package/dist/{widget/hooks → hooks}/useCustomTokenSearch.d.ts +7 -2
  33. package/dist/hooks/useCustomTokenSearch.d.ts.map +1 -0
  34. package/dist/hooks/useDebounce.d.ts.map +1 -0
  35. package/dist/{widget/hooks → hooks}/useDebugScreens.d.ts +2 -2
  36. package/dist/hooks/useDebugScreens.d.ts.map +1 -0
  37. package/dist/{widget/hooks → hooks}/useDefaultDestinationToken.d.ts +1 -1
  38. package/dist/hooks/useDefaultDestinationToken.d.ts.map +1 -0
  39. package/dist/{widget/hooks → hooks}/useDefaultOriginToken.d.ts +1 -1
  40. package/dist/hooks/useDefaultOriginToken.d.ts.map +1 -0
  41. package/dist/hooks/useDepositMonitor.d.ts.map +1 -0
  42. package/dist/{widget/hooks → hooks}/useDestinationSelectedToken.d.ts +2 -2
  43. package/dist/hooks/useDestinationSelectedToken.d.ts.map +1 -0
  44. package/dist/hooks/useDisplayCurrencyPreference.d.ts.map +1 -0
  45. package/dist/{widget/hooks → hooks}/useEarnPool.d.ts +1 -1
  46. package/dist/hooks/useEarnPool.d.ts.map +1 -0
  47. package/dist/hooks/useEffectiveFundBalance.d.ts +28 -0
  48. package/dist/hooks/useEffectiveFundBalance.d.ts.map +1 -0
  49. package/dist/hooks/useExecutingIntentsCount.d.ts.map +1 -0
  50. package/dist/{widget/hooks → hooks}/useExternalFundingReceiptSync.d.ts +1 -1
  51. package/dist/hooks/useExternalFundingReceiptSync.d.ts.map +1 -0
  52. package/dist/{widget/hooks → hooks}/useFiatOnRampCurrencies.d.ts +2 -2
  53. package/dist/hooks/useFiatOnRampCurrencies.d.ts.map +1 -0
  54. package/dist/hooks/useFiatSelectedCurrency.d.ts.map +1 -0
  55. package/dist/hooks/useGetIntent.d.ts.map +1 -0
  56. package/dist/{widget/hooks → hooks}/useIntentReceiptBalances.d.ts +1 -1
  57. package/dist/hooks/useIntentReceiptBalances.d.ts.map +1 -0
  58. package/dist/{widget/hooks → hooks}/useIntentTransactionHistory.d.ts +2 -1
  59. package/dist/hooks/useIntentTransactionHistory.d.ts.map +1 -0
  60. package/dist/hooks/useIsMobile.d.ts.map +1 -0
  61. package/dist/hooks/useIsSequenceWallet.d.ts.map +1 -0
  62. package/dist/hooks/useLocalePreference.d.ts.map +1 -0
  63. package/dist/hooks/useMeldTransactionHistory.d.ts.map +1 -0
  64. package/dist/hooks/useMeldTransactionStatus.d.ts.map +1 -0
  65. package/dist/hooks/useOnRampCountryDefaults.d.ts.map +1 -0
  66. package/dist/{widget/hooks → hooks}/useOnRampPaymentMethods.d.ts +2 -2
  67. package/dist/hooks/useOnRampPaymentMethods.d.ts.map +1 -0
  68. package/dist/{widget/hooks → hooks}/useOnRampProviderWidget.d.ts +1 -1
  69. package/dist/hooks/useOnRampProviderWidget.d.ts.map +1 -0
  70. package/dist/{widget/hooks → hooks}/useOnRampQuote.d.ts +3 -3
  71. package/dist/hooks/useOnRampQuote.d.ts.map +1 -0
  72. package/dist/{widget/hooks → hooks}/useOnRampTransactionStatus.d.ts +1 -1
  73. package/dist/hooks/useOnRampTransactionStatus.d.ts.map +1 -0
  74. package/dist/{widget/hooks → hooks}/useOriginSelectedToken.d.ts +1 -1
  75. package/dist/hooks/useOriginSelectedToken.d.ts.map +1 -0
  76. package/dist/hooks/usePayMessage.d.ts.map +1 -0
  77. package/dist/hooks/usePriceImpactWarning.d.ts.map +1 -0
  78. package/dist/hooks/useQuote.d.ts +439 -0
  79. package/dist/hooks/useQuote.d.ts.map +1 -0
  80. package/dist/{widget/hooks → hooks}/useRecentTokens.d.ts +1 -1
  81. package/dist/hooks/useRecentTokens.d.ts.map +1 -0
  82. package/dist/hooks/useRecipients.d.ts.map +1 -0
  83. package/dist/hooks/useSelectedFeeOption.d.ts.map +1 -0
  84. package/dist/{widget/hooks → hooks}/useSelectedFundMethod.d.ts +18 -1
  85. package/dist/hooks/useSelectedFundMethod.d.ts.map +1 -0
  86. package/dist/hooks/useSelectedRecipient.d.ts.map +1 -0
  87. package/dist/{widget/hooks → hooks}/useSendForm.d.ts +6 -11
  88. package/dist/hooks/useSendForm.d.ts.map +1 -0
  89. package/dist/hooks/useSwapAmount.d.ts.map +1 -0
  90. package/dist/{widget/hooks → hooks}/useSwapState.d.ts +1 -1
  91. package/dist/hooks/useSwapState.d.ts.map +1 -0
  92. package/dist/hooks/useTargetAmount.d.ts.map +1 -0
  93. package/dist/hooks/useTheme.d.ts.map +1 -0
  94. package/dist/{widget/hooks → hooks}/useTokenList.d.ts +9 -3
  95. package/dist/hooks/useTokenList.d.ts.map +1 -0
  96. package/dist/{widget/hooks → hooks}/useTrailsSendTransaction.d.ts +1 -1
  97. package/dist/hooks/useTrailsSendTransaction.d.ts.map +1 -0
  98. package/dist/{widget/hooks → hooks}/useViewManager.d.ts +1 -1
  99. package/dist/hooks/useViewManager.d.ts.map +1 -0
  100. package/dist/hooks/useWalletConnectUri.d.ts +19 -0
  101. package/dist/hooks/useWalletConnectUri.d.ts.map +1 -0
  102. package/dist/hooks/useWalletConnectionContext.d.ts.map +1 -0
  103. package/dist/{widget/hooks → hooks}/useWidgetProps.d.ts +1 -1
  104. package/dist/hooks/useWidgetProps.d.ts.map +1 -0
  105. package/dist/hydrate/builder.d.ts +131 -0
  106. package/dist/hydrate/builder.d.ts.map +1 -0
  107. package/dist/hydrate/constants.d.ts +13 -0
  108. package/dist/hydrate/constants.d.ts.map +1 -0
  109. package/dist/hydrate/encodeExecute.d.ts +73 -0
  110. package/dist/hydrate/encodeExecute.d.ts.map +1 -0
  111. package/dist/hydrate/index.d.ts +6 -0
  112. package/dist/hydrate/index.d.ts.map +1 -0
  113. package/dist/hydrate/index.js +11 -0
  114. package/dist/hydrate/payload.d.ts +38 -0
  115. package/dist/hydrate/payload.d.ts.map +1 -0
  116. package/dist/hydrate/selectors.d.ts +28 -0
  117. package/dist/hydrate/selectors.d.ts.map +1 -0
  118. package/dist/hydrate/types.d.ts +19 -0
  119. package/dist/hydrate/types.d.ts.map +1 -0
  120. package/dist/hydrate/utils.d.ts +8 -0
  121. package/dist/hydrate/utils.d.ts.map +1 -0
  122. package/dist/hydrate-Cr9eaeDK.js +654 -0
  123. package/dist/index.d.ts +20 -13
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/index.js +156 -610
  126. package/dist/intentConfigStore.d.ts +8 -0
  127. package/dist/intentConfigStore.d.ts.map +1 -0
  128. package/dist/intentProtocolApi.d.ts +11 -0
  129. package/dist/intentProtocolApi.d.ts.map +1 -0
  130. package/dist/intentProtocolEncoding.d.ts +25 -0
  131. package/dist/intentProtocolEncoding.d.ts.map +1 -0
  132. package/dist/intentProtocolResolver.d.ts +28 -0
  133. package/dist/intentProtocolResolver.d.ts.map +1 -0
  134. package/dist/intentReceiptPoller.d.ts.map +1 -1
  135. package/dist/intentValidation.d.ts +5 -0
  136. package/dist/intentValidation.d.ts.map +1 -0
  137. package/dist/intents.d.ts +8 -2
  138. package/dist/intents.d.ts.map +1 -1
  139. package/dist/keyMachineClient.d.ts +9 -0
  140. package/dist/keyMachineClient.d.ts.map +1 -0
  141. package/dist/keymachine/index.d.ts +34 -0
  142. package/dist/keymachine/index.d.ts.map +1 -0
  143. package/dist/keymachine/key-machine.gen.d.ts +461 -0
  144. package/dist/keymachine/key-machine.gen.d.ts.map +1 -0
  145. package/dist/mutations.d.ts.map +1 -1
  146. package/dist/offlineRecovery.d.ts +24 -0
  147. package/dist/offlineRecovery.d.ts.map +1 -0
  148. package/dist/onramp/MeshConnectFlow.d.ts +27 -0
  149. package/dist/onramp/MeshConnectFlow.d.ts.map +1 -0
  150. package/dist/onramp/MeshConnectIframe.d.ts +22 -0
  151. package/dist/onramp/MeshConnectIframe.d.ts.map +1 -0
  152. package/dist/onramp/SendFromExchangeButton.d.ts +16 -0
  153. package/dist/onramp/SendFromExchangeButton.d.ts.map +1 -0
  154. package/dist/onramp/TrailsOnRampProvider.d.ts +31 -0
  155. package/dist/onramp/TrailsOnRampProvider.d.ts.map +1 -0
  156. package/dist/onramp/index.d.ts +13 -0
  157. package/dist/onramp/index.d.ts.map +1 -0
  158. package/dist/onramp/mesh/components/MeshExchangeConfirmation.d.ts +10 -0
  159. package/dist/onramp/mesh/components/MeshExchangeConfirmation.d.ts.map +1 -0
  160. package/dist/onramp/mesh/components/MeshExchangeIcon.d.ts +13 -0
  161. package/dist/onramp/mesh/components/MeshExchangeIcon.d.ts.map +1 -0
  162. package/dist/onramp/mesh/components/MeshExchangeSelection.d.ts +12 -0
  163. package/dist/onramp/mesh/components/MeshExchangeSelection.d.ts.map +1 -0
  164. package/dist/onramp/mesh/components/MeshSessionOptions.d.ts +15 -0
  165. package/dist/onramp/mesh/components/MeshSessionOptions.d.ts.map +1 -0
  166. package/dist/onramp/mesh/hooks/useMeshAccessTokens.d.ts +9 -0
  167. package/dist/onramp/mesh/hooks/useMeshAccessTokens.d.ts.map +1 -0
  168. package/dist/onramp/mesh/hooks/useMeshFundingSelection.d.ts +11 -0
  169. package/dist/onramp/mesh/hooks/useMeshFundingSelection.d.ts.map +1 -0
  170. package/dist/onramp/mesh/hooks/useMeshOnrampFlow.d.ts +71 -0
  171. package/dist/onramp/mesh/hooks/useMeshOnrampFlow.d.ts.map +1 -0
  172. package/dist/onramp/mesh/hooks/useMeshOnrampSessionState.d.ts +32 -0
  173. package/dist/onramp/mesh/hooks/useMeshOnrampSessionState.d.ts.map +1 -0
  174. package/dist/onramp/mesh/hooks/useMeshSelectedTokenBalance.d.ts +19 -0
  175. package/dist/onramp/mesh/hooks/useMeshSelectedTokenBalance.d.ts.map +1 -0
  176. package/dist/onramp/mesh/hooks/useMeshSessionAccountBalance.d.ts +15 -0
  177. package/dist/onramp/mesh/hooks/useMeshSessionAccountBalance.d.ts.map +1 -0
  178. package/dist/onramp/mesh/hooks/useMeshSessionStorage.d.ts +7 -0
  179. package/dist/onramp/mesh/hooks/useMeshSessionStorage.d.ts.map +1 -0
  180. package/dist/onramp/meshSessionStorage.d.ts +13 -0
  181. package/dist/onramp/meshSessionStorage.d.ts.map +1 -0
  182. package/dist/onramp/meshconnect.d.ts +32 -0
  183. package/dist/onramp/meshconnect.d.ts.map +1 -0
  184. package/dist/onramp/trailsOnramp.d.ts +32 -0
  185. package/dist/onramp/trailsOnramp.d.ts.map +1 -0
  186. package/dist/onramp-client/index.d.ts +3 -3
  187. package/dist/onramp-client/index.d.ts.map +1 -1
  188. package/dist/onrampClient.d.ts.map +1 -1
  189. package/dist/prepareSend.d.ts +3 -2
  190. package/dist/prepareSend.d.ts.map +1 -1
  191. package/dist/query/balance.fetchers.d.ts +27 -0
  192. package/dist/query/balance.fetchers.d.ts.map +1 -1
  193. package/dist/query/balance.hooks.d.ts +19 -0
  194. package/dist/query/balance.hooks.d.ts.map +1 -1
  195. package/dist/query/balance.queries.d.ts +18 -1
  196. package/dist/query/balance.queries.d.ts.map +1 -1
  197. package/dist/query/chains.queries.d.ts.map +1 -1
  198. package/dist/query/intentProtocol.queries.d.ts +32 -0
  199. package/dist/query/intentProtocol.queries.d.ts.map +1 -0
  200. package/dist/query/meld.fetchers.d.ts +1 -1
  201. package/dist/query/meld.fetchers.d.ts.map +1 -1
  202. package/dist/query/meld.hooks.d.ts +3 -3
  203. package/dist/query/meld.hooks.d.ts.map +1 -1
  204. package/dist/query/meld.queries.d.ts +1 -1
  205. package/dist/query/meld.queries.d.ts.map +1 -1
  206. package/dist/query/tokenList.queries.d.ts +54 -0
  207. package/dist/query/tokenList.queries.d.ts.map +1 -0
  208. package/dist/recover.d.ts +71 -23
  209. package/dist/recover.d.ts.map +1 -1
  210. package/dist/src-4HYDQv2T.js +48798 -0
  211. package/dist/tokens.d.ts +13 -0
  212. package/dist/tokens.d.ts.map +1 -1
  213. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +3 -4
  214. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -1
  215. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +3 -4
  216. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
  217. package/dist/transactionIntent/deposits/standardDeposit.d.ts +2 -5
  218. package/dist/transactionIntent/deposits/standardDeposit.d.ts.map +1 -1
  219. package/dist/transactionIntent/handlers/intentHandler.d.ts +4 -4
  220. package/dist/transactionIntent/handlers/intentHandler.d.ts.map +1 -1
  221. package/dist/transactionIntent/helpers/transactionStateHelpers.d.ts.map +1 -1
  222. package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +1 -1
  223. package/dist/transactionIntent/quote/quoteHelpers.d.ts +2 -2
  224. package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -1
  225. package/dist/transactionIntent/types.d.ts +4 -4
  226. package/dist/transactionIntent/types.d.ts.map +1 -1
  227. package/dist/transactions.d.ts +4 -0
  228. package/dist/transactions.d.ts.map +1 -1
  229. package/dist/umd/trails.min.js +1371 -322
  230. package/dist/utils/localStorageGc.d.ts +22 -0
  231. package/dist/utils/localStorageGc.d.ts.map +1 -0
  232. package/dist/walletUtils.d.ts +2 -1
  233. package/dist/walletUtils.d.ts.map +1 -1
  234. package/dist/wallets.d.ts +13 -54
  235. package/dist/wallets.d.ts.map +1 -1
  236. package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
  237. package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
  238. package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
  239. package/dist/widget/components/ConnectedWallets.d.ts +1 -1
  240. package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
  241. package/dist/widget/components/DirectTransfer.d.ts +1 -1
  242. package/dist/widget/components/DirectTransfer.d.ts.map +1 -1
  243. package/dist/widget/components/Earn.d.ts +2 -6
  244. package/dist/widget/components/Earn.d.ts.map +1 -1
  245. package/dist/widget/components/FeeOption.d.ts +1 -1
  246. package/dist/widget/components/FeeOption.d.ts.map +1 -1
  247. package/dist/widget/components/FeeOptions.d.ts +1 -1
  248. package/dist/widget/components/FeeOptions.d.ts.map +1 -1
  249. package/dist/widget/components/FiatSelector.d.ts +1 -1
  250. package/dist/widget/components/FiatSelector.d.ts.map +1 -1
  251. package/dist/widget/components/FiatSelectorButton.d.ts +1 -1
  252. package/dist/widget/components/FiatSelectorButton.d.ts.map +1 -1
  253. package/dist/widget/components/Fund.d.ts +1 -1
  254. package/dist/widget/components/Fund.d.ts.map +1 -1
  255. package/dist/widget/components/FundMethods.d.ts.map +1 -1
  256. package/dist/widget/components/FundingMethodSelectorButton.d.ts +1 -1
  257. package/dist/widget/components/FundingMethodSelectorButton.d.ts.map +1 -1
  258. package/dist/widget/components/MeldHistory.d.ts +1 -1
  259. package/dist/widget/components/MeldHistory.d.ts.map +1 -1
  260. package/dist/widget/components/MeldTransactionStatus.d.ts +1 -1
  261. package/dist/widget/components/MeldTransactionStatus.d.ts.map +1 -1
  262. package/dist/widget/components/MeshExchangeAccountHeader.d.ts +9 -0
  263. package/dist/widget/components/MeshExchangeAccountHeader.d.ts.map +1 -0
  264. package/dist/widget/components/OnrampHistoryRow.d.ts +2 -2
  265. package/dist/widget/components/OnrampHistoryRow.d.ts.map +1 -1
  266. package/dist/widget/components/OnrampProviderConfirmation.d.ts +1 -1
  267. package/dist/widget/components/OnrampProviderConfirmation.d.ts.map +1 -1
  268. package/dist/widget/components/Pay.d.ts.map +1 -1
  269. package/dist/widget/components/PoolDeposit.d.ts +2 -6
  270. package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
  271. package/dist/widget/components/PoolWithdraw.d.ts +2 -2
  272. package/dist/widget/components/PoolWithdraw.d.ts.map +1 -1
  273. package/dist/widget/components/PulsatingButton.d.ts +9 -0
  274. package/dist/widget/components/PulsatingButton.d.ts.map +1 -0
  275. package/dist/widget/components/QRCodeWalletSelect.d.ts +1 -1
  276. package/dist/widget/components/QRCodeWalletSelect.d.ts.map +1 -1
  277. package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
  278. package/dist/widget/components/Receipt.d.ts +1 -1
  279. package/dist/widget/components/Receipt.d.ts.map +1 -1
  280. package/dist/widget/components/RecipientSelectorButton.d.ts.map +1 -1
  281. package/dist/widget/components/Recipients.d.ts.map +1 -1
  282. package/dist/widget/components/RefundWarning.d.ts.map +1 -1
  283. package/dist/widget/components/Swap.d.ts +2 -6
  284. package/dist/widget/components/Swap.d.ts.map +1 -1
  285. package/dist/widget/components/TokenList.d.ts +1 -0
  286. package/dist/widget/components/TokenList.d.ts.map +1 -1
  287. package/dist/widget/components/TokenSelector.d.ts +1 -2
  288. package/dist/widget/components/TokenSelector.d.ts.map +1 -1
  289. package/dist/widget/components/TransactionDetails.d.ts +1 -0
  290. package/dist/widget/components/TransactionDetails.d.ts.map +1 -1
  291. package/dist/widget/components/TransactionHistoryItem.d.ts +1 -0
  292. package/dist/widget/components/TransactionHistoryItem.d.ts.map +1 -1
  293. package/dist/widget/components/TransferPendingVertical.d.ts +2 -1
  294. package/dist/widget/components/TransferPendingVertical.d.ts.map +1 -1
  295. package/dist/widget/components/WalletAccountHeader.d.ts +7 -0
  296. package/dist/widget/components/WalletAccountHeader.d.ts.map +1 -0
  297. package/dist/widget/components/WalletConfirmation.d.ts +2 -1
  298. package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
  299. package/dist/widget/components/WalletConnect.d.ts.map +1 -1
  300. package/dist/widget/components/WalletList.d.ts.map +1 -1
  301. package/dist/widget/components/WidgetProviders.d.ts.map +1 -1
  302. package/dist/widget/components/Withdraw.d.ts.map +1 -1
  303. package/dist/widget/index.d.ts +13 -0
  304. package/dist/widget/index.d.ts.map +1 -1
  305. package/dist/widget/index.js +16 -8
  306. package/dist/widget/modes/EarnWidget.d.ts +83 -0
  307. package/dist/widget/modes/EarnWidget.d.ts.map +1 -0
  308. package/dist/widget/modes/FundWidget.d.ts +103 -0
  309. package/dist/widget/modes/FundWidget.d.ts.map +1 -0
  310. package/dist/widget/modes/PayWidget.d.ts +86 -0
  311. package/dist/widget/modes/PayWidget.d.ts.map +1 -0
  312. package/dist/widget/modes/SwapWidget.d.ts +82 -0
  313. package/dist/widget/modes/SwapWidget.d.ts.map +1 -0
  314. package/dist/widget/modes/WithdrawWidget.d.ts +71 -0
  315. package/dist/widget/modes/WithdrawWidget.d.ts.map +1 -0
  316. package/dist/widget/providers/TrailsProvider.d.ts +5 -0
  317. package/dist/widget/providers/TrailsProvider.d.ts.map +1 -1
  318. package/dist/widget/shared/mapSharedProps.d.ts +9 -0
  319. package/dist/widget/shared/mapSharedProps.d.ts.map +1 -0
  320. package/dist/widget/shared/methodMap.d.ts +18 -0
  321. package/dist/widget/shared/methodMap.d.ts.map +1 -0
  322. package/dist/widget/shared/resolution.d.ts +22 -0
  323. package/dist/widget/shared/resolution.d.ts.map +1 -0
  324. package/dist/widget/shared/resolvePaymentSource.d.ts +34 -0
  325. package/dist/widget/shared/resolvePaymentSource.d.ts.map +1 -0
  326. package/dist/widget/shared/types.d.ts +94 -0
  327. package/dist/widget/shared/types.d.ts.map +1 -0
  328. package/dist/widget/types/commonProps.d.ts +3 -7
  329. package/dist/widget/types/commonProps.d.ts.map +1 -1
  330. package/dist/widget/utils/createWagmiConfig.d.ts +2 -2
  331. package/dist/widget/utils/createWagmiConfig.d.ts.map +1 -1
  332. package/dist/widget/utils/fundMethodSwitchState.d.ts +2 -0
  333. package/dist/widget/utils/fundMethodSwitchState.d.ts.map +1 -1
  334. package/dist/widget/utils/meldProviderUtils.d.ts +1 -1
  335. package/dist/widget/utils/meldProviderUtils.d.ts.map +1 -1
  336. package/dist/widget/utils/meshSupportedTokens.d.ts +4 -0
  337. package/dist/widget/utils/meshSupportedTokens.d.ts.map +1 -0
  338. package/dist/widget/utils/onrampConfig.d.ts +11 -0
  339. package/dist/widget/utils/onrampConfig.d.ts.map +1 -0
  340. package/dist/widget/utils/trailsOnrampConfig.d.ts +18 -0
  341. package/dist/widget/utils/trailsOnrampConfig.d.ts.map +1 -0
  342. package/dist/widget/utils/viewManagerGuards.d.ts +1 -1
  343. package/dist/widget/utils/viewManagerGuards.d.ts.map +1 -1
  344. package/dist/widget/widget.d.ts +45 -24
  345. package/dist/widget/widget.d.ts.map +1 -1
  346. package/package.json +20 -24
  347. package/dist/buffer.d.ts +0 -3
  348. package/dist/buffer.d.ts.map +0 -1
  349. package/dist/ccip-DStzFCYT.js +0 -230
  350. package/dist/index-HY9_ppit.js +0 -101240
  351. package/dist/onramp-client/trails-onramp.gen.d.ts +0 -570
  352. package/dist/onramp-client/trails-onramp.gen.d.ts.map +0 -1
  353. package/dist/paymasterSend.d.ts +0 -90
  354. package/dist/paymasterSend.d.ts.map +0 -1
  355. package/dist/sendUserOp.d.ts +0 -122
  356. package/dist/sendUserOp.d.ts.map +0 -1
  357. package/dist/toSimpleSmartAccount.d.ts +0 -95
  358. package/dist/toSimpleSmartAccount.d.ts.map +0 -1
  359. package/dist/transactionIntent/utils/erc20Approval.d.ts +0 -34
  360. package/dist/transactionIntent/utils/erc20Approval.d.ts.map +0 -1
  361. package/dist/utils/allowance.d.ts +0 -19
  362. package/dist/utils/allowance.d.ts.map +0 -1
  363. package/dist/widget/analytics/useWidgetAnalytics.d.ts.map +0 -1
  364. package/dist/widget/components/FeeBreakdown.d.ts +0 -9
  365. package/dist/widget/components/FeeBreakdown.d.ts.map +0 -1
  366. package/dist/widget/components/HideBalances.d.ts +0 -4
  367. package/dist/widget/components/HideBalances.d.ts.map +0 -1
  368. package/dist/widget/components/OnrampDeposit.d.ts +0 -10
  369. package/dist/widget/components/OnrampDeposit.d.ts.map +0 -1
  370. package/dist/widget/components/SwapSettings.d.ts +0 -4
  371. package/dist/widget/components/SwapSettings.d.ts.map +0 -1
  372. package/dist/widget/components/TruncatedAddress.d.ts +0 -12
  373. package/dist/widget/components/TruncatedAddress.d.ts.map +0 -1
  374. package/dist/widget/components/WalletImage.d.ts +0 -8
  375. package/dist/widget/components/WalletImage.d.ts.map +0 -1
  376. package/dist/widget/css/compiled.css +0 -26
  377. package/dist/widget/css/index.css +0 -686
  378. package/dist/widget/hooks/useAddressWalletIcon.d.ts.map +0 -1
  379. package/dist/widget/hooks/useAmountUsd.d.ts.map +0 -1
  380. package/dist/widget/hooks/useBalanceVisible.d.ts.map +0 -1
  381. package/dist/widget/hooks/useChainFilter.d.ts.map +0 -1
  382. package/dist/widget/hooks/useCheckout.d.ts.map +0 -1
  383. package/dist/widget/hooks/useClickTracking.d.ts.map +0 -1
  384. package/dist/widget/hooks/useCombinedHistory.d.ts.map +0 -1
  385. package/dist/widget/hooks/useConnector.d.ts.map +0 -1
  386. package/dist/widget/hooks/useCustomTokenFetch.d.ts +0 -19
  387. package/dist/widget/hooks/useCustomTokenFetch.d.ts.map +0 -1
  388. package/dist/widget/hooks/useCustomTokenSearch.d.ts.map +0 -1
  389. package/dist/widget/hooks/useDebounce.d.ts.map +0 -1
  390. package/dist/widget/hooks/useDebugScreens.d.ts.map +0 -1
  391. package/dist/widget/hooks/useDefaultDestinationToken.d.ts.map +0 -1
  392. package/dist/widget/hooks/useDefaultOriginToken.d.ts.map +0 -1
  393. package/dist/widget/hooks/useDepositMonitor.d.ts.map +0 -1
  394. package/dist/widget/hooks/useDestinationSelectedToken.d.ts.map +0 -1
  395. package/dist/widget/hooks/useDisplayCurrencyPreference.d.ts.map +0 -1
  396. package/dist/widget/hooks/useEarnPool.d.ts.map +0 -1
  397. package/dist/widget/hooks/useExecutingIntentsCount.d.ts.map +0 -1
  398. package/dist/widget/hooks/useExternalFundingReceiptSync.d.ts.map +0 -1
  399. package/dist/widget/hooks/useFiatOnRampCurrencies.d.ts.map +0 -1
  400. package/dist/widget/hooks/useFiatSelectedCurrency.d.ts.map +0 -1
  401. package/dist/widget/hooks/useGetIntent.d.ts.map +0 -1
  402. package/dist/widget/hooks/useIntentReceiptBalances.d.ts.map +0 -1
  403. package/dist/widget/hooks/useIntentTransactionHistory.d.ts.map +0 -1
  404. package/dist/widget/hooks/useIsConnectedWalletSmartContract.d.ts +0 -7
  405. package/dist/widget/hooks/useIsConnectedWalletSmartContract.d.ts.map +0 -1
  406. package/dist/widget/hooks/useIsMobile.d.ts.map +0 -1
  407. package/dist/widget/hooks/useIsSequenceWallet.d.ts.map +0 -1
  408. package/dist/widget/hooks/useLocalePreference.d.ts.map +0 -1
  409. package/dist/widget/hooks/useMeldTransactionHistory.d.ts.map +0 -1
  410. package/dist/widget/hooks/useMeldTransactionStatus.d.ts.map +0 -1
  411. package/dist/widget/hooks/useOnRampCountryDefaults.d.ts.map +0 -1
  412. package/dist/widget/hooks/useOnRampPaymentMethods.d.ts.map +0 -1
  413. package/dist/widget/hooks/useOnRampProviderWidget.d.ts.map +0 -1
  414. package/dist/widget/hooks/useOnRampQuote.d.ts.map +0 -1
  415. package/dist/widget/hooks/useOnRampTransactionStatus.d.ts.map +0 -1
  416. package/dist/widget/hooks/useOriginSelectedToken.d.ts.map +0 -1
  417. package/dist/widget/hooks/usePayMessage.d.ts.map +0 -1
  418. package/dist/widget/hooks/usePriceImpactWarning.d.ts.map +0 -1
  419. package/dist/widget/hooks/useQuote.d.ts +0 -378
  420. package/dist/widget/hooks/useQuote.d.ts.map +0 -1
  421. package/dist/widget/hooks/useRecentTokens.d.ts.map +0 -1
  422. package/dist/widget/hooks/useRecipients.d.ts.map +0 -1
  423. package/dist/widget/hooks/useScreenTracking.d.ts +0 -2
  424. package/dist/widget/hooks/useScreenTracking.d.ts.map +0 -1
  425. package/dist/widget/hooks/useSelectedFeeOption.d.ts.map +0 -1
  426. package/dist/widget/hooks/useSelectedFundMethod.d.ts.map +0 -1
  427. package/dist/widget/hooks/useSelectedRecipient.d.ts.map +0 -1
  428. package/dist/widget/hooks/useSendForm.d.ts.map +0 -1
  429. package/dist/widget/hooks/useSwapAmount.d.ts.map +0 -1
  430. package/dist/widget/hooks/useSwapState.d.ts.map +0 -1
  431. package/dist/widget/hooks/useTargetAmount.d.ts.map +0 -1
  432. package/dist/widget/hooks/useTheme.d.ts.map +0 -1
  433. package/dist/widget/hooks/useTokenList.d.ts.map +0 -1
  434. package/dist/widget/hooks/useTokenWithFreshBalance.d.ts +0 -18
  435. package/dist/widget/hooks/useTokenWithFreshBalance.d.ts.map +0 -1
  436. package/dist/widget/hooks/useTrailsSendTransaction.d.ts.map +0 -1
  437. package/dist/widget/hooks/useViewManager.d.ts.map +0 -1
  438. package/dist/widget/hooks/useWalletConnectUri.d.ts +0 -11
  439. package/dist/widget/hooks/useWalletConnectUri.d.ts.map +0 -1
  440. package/dist/widget/hooks/useWalletConnectionContext.d.ts.map +0 -1
  441. package/dist/widget/hooks/useWidgetProps.d.ts.map +0 -1
  442. package/dist/widget/types.d.ts +0 -44
  443. package/dist/widget/types.d.ts.map +0 -1
  444. package/dist/widget/utils/historyUtils.d.ts +0 -18
  445. package/dist/widget/utils/historyUtils.d.ts.map +0 -1
  446. package/src/abi.ts +0 -38
  447. package/src/abis/erc20.ts +0 -60
  448. package/src/abis/trailsHydrate.ts +0 -185
  449. package/src/abis/trailsRouter.ts +0 -121
  450. package/src/abis/trailsSweep.ts +0 -32
  451. package/src/abortController.ts +0 -35
  452. package/src/analytics.ts +0 -2029
  453. package/src/buffer.ts +0 -10
  454. package/src/chainSwitch.ts +0 -95
  455. package/src/chains.ts +0 -565
  456. package/src/config.ts +0 -118
  457. package/src/constants.ts +0 -237
  458. package/src/contractUtils.ts +0 -46
  459. package/src/cssUtils.ts +0 -5
  460. package/src/customChains.ts +0 -24
  461. package/src/customTokens.ts +0 -147
  462. package/src/decoders.ts +0 -365
  463. package/src/ens.ts +0 -74
  464. package/src/error.ts +0 -268
  465. package/src/estimate.ts +0 -480
  466. package/src/explorer.ts +0 -38
  467. package/src/fees.ts +0 -362
  468. package/src/gasless.ts +0 -638
  469. package/src/index.ts +0 -204
  470. package/src/indexerClient.ts +0 -118
  471. package/src/intentReceiptMonitor.ts +0 -99
  472. package/src/intentReceiptPoller.ts +0 -327
  473. package/src/intents.ts +0 -1125
  474. package/src/localeUtils.ts +0 -244
  475. package/src/logger/index.ts +0 -95
  476. package/src/logger/useSyncLoggerDebug.ts +0 -11
  477. package/src/logger.ts +0 -1
  478. package/src/meld/components/MeldCountriesList.tsx +0 -237
  479. package/src/meld/components/MeldFundMethods.tsx +0 -265
  480. package/src/meld/components/MeldProvidersList.tsx +0 -187
  481. package/src/meld/components/MeldTokensList.tsx +0 -321
  482. package/src/meld/components/SimpleHeader.tsx +0 -35
  483. package/src/meld/utils/meld.ts +0 -77
  484. package/src/mutations.ts +0 -166
  485. package/src/onramp-client/index.ts +0 -54
  486. package/src/onramp-client/trails-onramp.gen.ts +0 -1320
  487. package/src/onrampClient.ts +0 -46
  488. package/src/paymasterSend.ts +0 -521
  489. package/src/placeholder.ts +0 -92
  490. package/src/poolUtils.ts +0 -222
  491. package/src/pools.ts +0 -120
  492. package/src/prepareSend.ts +0 -552
  493. package/src/query/balance.fetchers.ts +0 -623
  494. package/src/query/balance.hooks.ts +0 -298
  495. package/src/query/balance.queries.ts +0 -244
  496. package/src/query/chains.hooks.ts +0 -45
  497. package/src/query/chains.queries.ts +0 -22
  498. package/src/query/client.ts +0 -20
  499. package/src/query/fiat.fetchers.ts +0 -33
  500. package/src/query/fiat.hooks.ts +0 -71
  501. package/src/query/fiat.queries.ts +0 -67
  502. package/src/query/geo.fetchers.ts +0 -100
  503. package/src/query/geo.hooks.ts +0 -16
  504. package/src/query/geo.queries.ts +0 -36
  505. package/src/query/helpers.ts +0 -81
  506. package/src/query/meld.fetchers.ts +0 -97
  507. package/src/query/meld.hooks.ts +0 -18
  508. package/src/query/meld.queries.ts +0 -184
  509. package/src/query/persister.ts +0 -11
  510. package/src/query/price.fetchers.ts +0 -53
  511. package/src/query/price.hooks.ts +0 -46
  512. package/src/query/price.queries.ts +0 -364
  513. package/src/queryParams.ts +0 -100
  514. package/src/recover.ts +0 -1665
  515. package/src/sendUserOp.ts +0 -512
  516. package/src/theme.ts +0 -2
  517. package/src/toSimpleSmartAccount.ts +0 -567
  518. package/src/toast.ts +0 -110
  519. package/src/tokens.ts +0 -1780
  520. package/src/trailsClient.ts +0 -40
  521. package/src/transactionIntent/constants.ts +0 -15
  522. package/src/transactionIntent/deposits/depositOrchestrator.ts +0 -243
  523. package/src/transactionIntent/deposits/gaslessDeposit.ts +0 -705
  524. package/src/transactionIntent/deposits/index.ts +0 -3
  525. package/src/transactionIntent/deposits/standardDeposit.ts +0 -594
  526. package/src/transactionIntent/execution/index.ts +0 -1
  527. package/src/transactionIntent/execution/transactionState.ts +0 -38
  528. package/src/transactionIntent/handlers/index.ts +0 -1
  529. package/src/transactionIntent/handlers/intentHandler.ts +0 -1596
  530. package/src/transactionIntent/helpers/index.ts +0 -1
  531. package/src/transactionIntent/helpers/transactionStateHelpers.ts +0 -437
  532. package/src/transactionIntent/index.ts +0 -10
  533. package/src/transactionIntent/quote/feeExtractors.ts +0 -61
  534. package/src/transactionIntent/quote/index.ts +0 -3
  535. package/src/transactionIntent/quote/normalizeQuote.ts +0 -553
  536. package/src/transactionIntent/quote/quoteHelpers.ts +0 -117
  537. package/src/transactionIntent/types.ts +0 -241
  538. package/src/transactionIntent/utils/balanceChecker.ts +0 -103
  539. package/src/transactionIntent/utils/erc20Approval.ts +0 -171
  540. package/src/transactionIntent/utils/index.ts +0 -2
  541. package/src/transactionIntent/utils/resilientDepositTracker.ts +0 -171
  542. package/src/transactionIntent/utils/testnetHelpers.ts +0 -5
  543. package/src/transactionIntent/validators.ts +0 -27
  544. package/src/transactions.ts +0 -426
  545. package/src/types.d.ts +0 -16
  546. package/src/umd.tsx +0 -33
  547. package/src/utils/address.ts +0 -78
  548. package/src/utils/allowance.ts +0 -47
  549. package/src/utils/fiat.ts +0 -32
  550. package/src/utils/format.ts +0 -625
  551. package/src/utils/passthrough.ts +0 -93
  552. package/src/utils/time.ts +0 -118
  553. package/src/utils/validation.ts +0 -104
  554. package/src/utils.ts +0 -112
  555. package/src/version.ts +0 -8
  556. package/src/vite-env.d.ts +0 -4
  557. package/src/walletUtils.ts +0 -292
  558. package/src/wallets.ts +0 -740
  559. package/src/widget/analytics/useWidgetAnalytics.ts +0 -56
  560. package/src/widget/assets/Binance_Icon_Logo.svg +0 -14
  561. package/src/widget/assets/Bitfinex_Icon_Logo.svg +0 -5
  562. package/src/widget/assets/Coinbase_Icon_Logo.svg +0 -1
  563. package/src/widget/assets/Exchange-icon-black.svg +0 -5
  564. package/src/widget/assets/MetaMask-icon-fox-with-margins.svg +0 -31
  565. package/src/widget/assets/MetaMask-icon-fox.svg +0 -26
  566. package/src/widget/assets/MetaMask-logo-black.svg +0 -3
  567. package/src/widget/assets/MetaMask-logo-white.svg +0 -16
  568. package/src/widget/assets/Trails-logo-black.svg +0 -13
  569. package/src/widget/assets/Trails-logo-white.svg +0 -13
  570. package/src/widget/assets/WalletChange-black.svg +0 -5
  571. package/src/widget/assets/WalletConnect-logo-black.svg +0 -14
  572. package/src/widget/assets/WalletConnect-logo-blue-bg.svg +0 -11
  573. package/src/widget/assets/WalletConnect-logo-blue.svg +0 -14
  574. package/src/widget/assets/WalletConnect-logo-white.svg +0 -14
  575. package/src/widget/assets/WalletConnect-logo.svg +0 -40
  576. package/src/widget/assets/aave.svg +0 -14
  577. package/src/widget/assets/morpho.svg +0 -14
  578. package/src/widget/assets/sequence-logo.svg +0 -15
  579. package/src/widget/compiled.css +0 -26
  580. package/src/widget/components/AccountActionsDropdown.tsx +0 -31
  581. package/src/widget/components/AccountIntentTransactionHistory.tsx +0 -756
  582. package/src/widget/components/AccountIntentTransactionHistoryButton.tsx +0 -34
  583. package/src/widget/components/AccountSettings.tsx +0 -168
  584. package/src/widget/components/AddressOrEnsName.tsx +0 -24
  585. package/src/widget/components/AddressWalletIcon.tsx +0 -49
  586. package/src/widget/components/AllChainsIcon.tsx +0 -54
  587. package/src/widget/components/ChainFilterDropdown.tsx +0 -220
  588. package/src/widget/components/ChainImage.tsx +0 -40
  589. package/src/widget/components/ChainList.tsx +0 -158
  590. package/src/widget/components/ClassicSwap.tsx +0 -1744
  591. package/src/widget/components/ConfigDisplay.tsx +0 -158
  592. package/src/widget/components/ConnectWallet.tsx +0 -564
  593. package/src/widget/components/ConnectedWallets.tsx +0 -417
  594. package/src/widget/components/CopyButton.tsx +0 -108
  595. package/src/widget/components/CountryFilterDropdown.tsx +0 -179
  596. package/src/widget/components/DebugMenu.tsx +0 -50
  597. package/src/widget/components/DebugScreensList.tsx +0 -70
  598. package/src/widget/components/DebugToast.tsx +0 -63
  599. package/src/widget/components/DepositTracker.tsx +0 -326
  600. package/src/widget/components/DirectTransfer.tsx +0 -302
  601. package/src/widget/components/Disconnect.tsx +0 -68
  602. package/src/widget/components/DynamicInputStyles.tsx +0 -121
  603. package/src/widget/components/DynamicSizeInputField.tsx +0 -245
  604. package/src/widget/components/ENSAvatar.tsx +0 -33
  605. package/src/widget/components/Earn.tsx +0 -160
  606. package/src/widget/components/EarnPools.tsx +0 -417
  607. package/src/widget/components/EarnPoolsFilters.tsx +0 -165
  608. package/src/widget/components/ErrorAnimationIcon.tsx +0 -130
  609. package/src/widget/components/ErrorDisplay.tsx +0 -152
  610. package/src/widget/components/ExecutingIntentsBadge.tsx +0 -24
  611. package/src/widget/components/ExecutionStatusBadge.tsx +0 -53
  612. package/src/widget/components/FeeBreakdown.tsx +0 -155
  613. package/src/widget/components/FeeOption.tsx +0 -170
  614. package/src/widget/components/FeeOptions.tsx +0 -247
  615. package/src/widget/components/FiatSelector.tsx +0 -308
  616. package/src/widget/components/FiatSelectorButton.tsx +0 -68
  617. package/src/widget/components/Footer.tsx +0 -67
  618. package/src/widget/components/Fund.tsx +0 -2331
  619. package/src/widget/components/FundMethods.tsx +0 -427
  620. package/src/widget/components/FundWalletSelection.tsx +0 -60
  621. package/src/widget/components/FundingMethodSelectorButton.tsx +0 -106
  622. package/src/widget/components/GreenCheckAnimation.tsx +0 -119
  623. package/src/widget/components/HideBalances.tsx +0 -24
  624. package/src/widget/components/HighPriceImpactBlock.tsx +0 -44
  625. package/src/widget/components/HookModalContent.tsx +0 -377
  626. package/src/widget/components/Identicon.tsx +0 -228
  627. package/src/widget/components/LoadingSpinner.tsx +0 -9
  628. package/src/widget/components/MeldForm.tsx +0 -780
  629. package/src/widget/components/MeldHistory.tsx +0 -433
  630. package/src/widget/components/MeldStepsFlow.tsx +0 -1651
  631. package/src/widget/components/MeldTransactionStatus.tsx +0 -255
  632. package/src/widget/components/Modal.tsx +0 -86
  633. package/src/widget/components/OFTProgressBar.tsx +0 -89
  634. package/src/widget/components/OnRampProviderSelector.tsx +0 -263
  635. package/src/widget/components/OnrampDeposit.tsx +0 -122
  636. package/src/widget/components/OnrampErrorScreen.tsx +0 -163
  637. package/src/widget/components/OnrampHistoryRow.tsx +0 -321
  638. package/src/widget/components/OnrampPaymentMethods.tsx +0 -81
  639. package/src/widget/components/OnrampProviderConfirmation.tsx +0 -1060
  640. package/src/widget/components/OriginSelectionAmount.tsx +0 -144
  641. package/src/widget/components/OriginTransferInformation.tsx +0 -59
  642. package/src/widget/components/Pay.tsx +0 -1181
  643. package/src/widget/components/PaymentMethods.tsx +0 -198
  644. package/src/widget/components/PercentageMaxButtons.tsx +0 -112
  645. package/src/widget/components/PoolDeposit.tsx +0 -651
  646. package/src/widget/components/PoolWithdraw.tsx +0 -761
  647. package/src/widget/components/PriceImpactWarning.tsx +0 -87
  648. package/src/widget/components/QRCodeOptions.tsx +0 -65
  649. package/src/widget/components/QRCodeWalletSelect.tsx +0 -77
  650. package/src/widget/components/QrCode.tsx +0 -216
  651. package/src/widget/components/QuoteDetails.tsx +0 -1266
  652. package/src/widget/components/Receipt.tsx +0 -673
  653. package/src/widget/components/ReceiptRecoverableFunds.tsx +0 -135
  654. package/src/widget/components/RecentTokens.tsx +0 -66
  655. package/src/widget/components/RecipientSelectorButton.tsx +0 -50
  656. package/src/widget/components/Recipients.tsx +0 -412
  657. package/src/widget/components/RefundWarning.tsx +0 -66
  658. package/src/widget/components/RequiredPropsError.tsx +0 -33
  659. package/src/widget/components/ScreenHeader.tsx +0 -123
  660. package/src/widget/components/SearchInputField.tsx +0 -99
  661. package/src/widget/components/SessionTimeoutScreen.tsx +0 -103
  662. package/src/widget/components/ShadowPortal.tsx +0 -99
  663. package/src/widget/components/ShadowRootContext.tsx +0 -17
  664. package/src/widget/components/SimpleRecipientInputScreen.tsx +0 -91
  665. package/src/widget/components/SlippageToleranceSettings.tsx +0 -279
  666. package/src/widget/components/Swap.tsx +0 -50
  667. package/src/widget/components/SwapDisplay.tsx +0 -68
  668. package/src/widget/components/SwapSettings.tsx +0 -52
  669. package/src/widget/components/ThemeProvider.tsx +0 -115
  670. package/src/widget/components/ThemeSyncer.tsx +0 -47
  671. package/src/widget/components/Toast.tsx +0 -336
  672. package/src/widget/components/TokenDisplayNonSelectable.tsx +0 -40
  673. package/src/widget/components/TokenImage.tsx +0 -156
  674. package/src/widget/components/TokenList.tsx +0 -107
  675. package/src/widget/components/TokenSelector.tsx +0 -738
  676. package/src/widget/components/TokenSelectorButton.tsx +0 -123
  677. package/src/widget/components/TokenSkeleton.tsx +0 -53
  678. package/src/widget/components/Tooltip.tsx +0 -64
  679. package/src/widget/components/TrailsHookModal.tsx +0 -107
  680. package/src/widget/components/TransactionDetails.tsx +0 -488
  681. package/src/widget/components/TransactionHistoryItem.tsx +0 -767
  682. package/src/widget/components/TransferPendingVertical.tsx +0 -583
  683. package/src/widget/components/TruncatedAddress.tsx +0 -68
  684. package/src/widget/components/TruncatedTransactionHash.tsx +0 -74
  685. package/src/widget/components/UserPreferences.tsx +0 -570
  686. package/src/widget/components/WaasFeeOptions.tsx +0 -588
  687. package/src/widget/components/WalletConfirmation.tsx +0 -220
  688. package/src/widget/components/WalletConnect.tsx +0 -351
  689. package/src/widget/components/WalletConnectionPending.tsx +0 -178
  690. package/src/widget/components/WalletImage.tsx +0 -64
  691. package/src/widget/components/WalletList.tsx +0 -125
  692. package/src/widget/components/WidgetProviders.tsx +0 -82
  693. package/src/widget/components/Withdraw.tsx +0 -1088
  694. package/src/widget/components/YellowWarningAnimation.tsx +0 -146
  695. package/src/widget/hooks/useAddressWalletIcon.ts +0 -54
  696. package/src/widget/hooks/useAmountUsd.ts +0 -44
  697. package/src/widget/hooks/useBalanceVisible.tsx +0 -95
  698. package/src/widget/hooks/useChainFilter.tsx +0 -56
  699. package/src/widget/hooks/useCheckout.ts +0 -361
  700. package/src/widget/hooks/useClickTracking.ts +0 -74
  701. package/src/widget/hooks/useCombinedHistory.ts +0 -420
  702. package/src/widget/hooks/useConnector.tsx +0 -24
  703. package/src/widget/hooks/useCustomTokenFetch.tsx +0 -74
  704. package/src/widget/hooks/useCustomTokenSearch.tsx +0 -339
  705. package/src/widget/hooks/useDebounce.ts +0 -25
  706. package/src/widget/hooks/useDebugScreens.ts +0 -600
  707. package/src/widget/hooks/useDefaultDestinationToken.tsx +0 -182
  708. package/src/widget/hooks/useDefaultOriginToken.tsx +0 -410
  709. package/src/widget/hooks/useDepositMonitor.ts +0 -118
  710. package/src/widget/hooks/useDestinationSelectedToken.tsx +0 -310
  711. package/src/widget/hooks/useDisplayCurrencyPreference.tsx +0 -145
  712. package/src/widget/hooks/useEarnPool.tsx +0 -36
  713. package/src/widget/hooks/useExecutingIntentsCount.ts +0 -78
  714. package/src/widget/hooks/useExternalFundingReceiptSync.ts +0 -79
  715. package/src/widget/hooks/useFiatOnRampCurrencies.ts +0 -46
  716. package/src/widget/hooks/useFiatSelectedCurrency.tsx +0 -123
  717. package/src/widget/hooks/useGetIntent.ts +0 -54
  718. package/src/widget/hooks/useIntentReceiptBalances.ts +0 -141
  719. package/src/widget/hooks/useIntentTransactionHistory.ts +0 -785
  720. package/src/widget/hooks/useIsConnectedWalletSmartContract.ts +0 -43
  721. package/src/widget/hooks/useIsMobile.tsx +0 -50
  722. package/src/widget/hooks/useIsSequenceWallet.ts +0 -17
  723. package/src/widget/hooks/useLocalePreference.tsx +0 -187
  724. package/src/widget/hooks/useMeldTransactionHistory.ts +0 -184
  725. package/src/widget/hooks/useMeldTransactionStatus.ts +0 -707
  726. package/src/widget/hooks/useOnRampCountryDefaults.ts +0 -57
  727. package/src/widget/hooks/useOnRampPaymentMethods.ts +0 -72
  728. package/src/widget/hooks/useOnRampProviderWidget.ts +0 -184
  729. package/src/widget/hooks/useOnRampQuote.ts +0 -340
  730. package/src/widget/hooks/useOnRampTransactionStatus.ts +0 -196
  731. package/src/widget/hooks/useOriginSelectedToken.tsx +0 -253
  732. package/src/widget/hooks/usePayMessage.tsx +0 -496
  733. package/src/widget/hooks/usePriceImpactWarning.ts +0 -17
  734. package/src/widget/hooks/useQuote.ts +0 -1233
  735. package/src/widget/hooks/useRecentTokens.ts +0 -159
  736. package/src/widget/hooks/useRecipients.ts +0 -167
  737. package/src/widget/hooks/useScreenTracking.ts +0 -14
  738. package/src/widget/hooks/useSelectedFeeOption.tsx +0 -323
  739. package/src/widget/hooks/useSelectedFundMethod.tsx +0 -80
  740. package/src/widget/hooks/useSelectedRecipient.tsx +0 -75
  741. package/src/widget/hooks/useSendForm.ts +0 -1373
  742. package/src/widget/hooks/useSwapAmount.tsx +0 -50
  743. package/src/widget/hooks/useSwapState.tsx +0 -121
  744. package/src/widget/hooks/useTargetAmount.ts +0 -26
  745. package/src/widget/hooks/useTheme.tsx +0 -80
  746. package/src/widget/hooks/useTokenList.ts +0 -1099
  747. package/src/widget/hooks/useTokenWithFreshBalance.ts +0 -246
  748. package/src/widget/hooks/useTrailsSendTransaction.ts +0 -987
  749. package/src/widget/hooks/useViewManager.tsx +0 -505
  750. package/src/widget/hooks/useWalletConnectUri.tsx +0 -307
  751. package/src/widget/hooks/useWalletConnectionContext.tsx +0 -128
  752. package/src/widget/hooks/useWidgetProps.tsx +0 -33
  753. package/src/widget/index.css +0 -686
  754. package/src/widget/index.tsx +0 -28
  755. package/src/widget/providers/TrailsModalProvider.tsx +0 -238
  756. package/src/widget/providers/TrailsProvider.tsx +0 -150
  757. package/src/widget/providers/UserActivityProvider.tsx +0 -78
  758. package/src/widget/providers/WidgetProviderTree.tsx +0 -90
  759. package/src/widget/styles.ts +0 -26
  760. package/src/widget/types/analytics.ts +0 -22
  761. package/src/widget/types/commonProps.ts +0 -56
  762. package/src/widget/types/svg.d.ts +0 -8
  763. package/src/widget/types.ts +0 -51
  764. package/src/widget/utils/countryUtils.ts +0 -89
  765. package/src/widget/utils/createWagmiConfig.ts +0 -38
  766. package/src/widget/utils/forexRateStore.ts +0 -120
  767. package/src/widget/utils/fundMethodSwitchState.ts +0 -25
  768. package/src/widget/utils/historyFilters.ts +0 -157
  769. package/src/widget/utils/historyUtils.ts +0 -101
  770. package/src/widget/utils/localeStore.ts +0 -68
  771. package/src/widget/utils/meldProviderUtils.ts +0 -20
  772. package/src/widget/utils/statusLabel.ts +0 -3
  773. package/src/widget/utils/tokens.ts +0 -138
  774. package/src/widget/utils/transactionFailure.ts +0 -52
  775. package/src/widget/utils/viewManagerGuards.ts +0 -49
  776. package/src/widget/utils/windowUtils.ts +0 -138
  777. package/src/widget/widget.tsx +0 -3334
  778. /package/dist/{widget/hooks → hooks}/useAddressWalletIcon.d.ts +0 -0
  779. /package/dist/{widget/hooks → hooks}/useAmountUsd.d.ts +0 -0
  780. /package/dist/{widget/hooks → hooks}/useBalanceVisible.d.ts +0 -0
  781. /package/dist/{widget/hooks → hooks}/useChainFilter.d.ts +0 -0
  782. /package/dist/{widget/hooks → hooks}/useClickTracking.d.ts +0 -0
  783. /package/dist/{widget/hooks → hooks}/useConnector.d.ts +0 -0
  784. /package/dist/{widget/hooks → hooks}/useDebounce.d.ts +0 -0
  785. /package/dist/{widget/hooks → hooks}/useDepositMonitor.d.ts +0 -0
  786. /package/dist/{widget/hooks → hooks}/useDisplayCurrencyPreference.d.ts +0 -0
  787. /package/dist/{widget/hooks → hooks}/useExecutingIntentsCount.d.ts +0 -0
  788. /package/dist/{widget/hooks → hooks}/useFiatSelectedCurrency.d.ts +0 -0
  789. /package/dist/{widget/hooks → hooks}/useGetIntent.d.ts +0 -0
  790. /package/dist/{widget/hooks → hooks}/useIsMobile.d.ts +0 -0
  791. /package/dist/{widget/hooks → hooks}/useIsSequenceWallet.d.ts +0 -0
  792. /package/dist/{widget/hooks → hooks}/useLocalePreference.d.ts +0 -0
  793. /package/dist/{widget/hooks → hooks}/useMeldTransactionHistory.d.ts +0 -0
  794. /package/dist/{widget/hooks → hooks}/useMeldTransactionStatus.d.ts +0 -0
  795. /package/dist/{widget/hooks → hooks}/useOnRampCountryDefaults.d.ts +0 -0
  796. /package/dist/{widget/hooks → hooks}/usePayMessage.d.ts +0 -0
  797. /package/dist/{widget/hooks → hooks}/usePriceImpactWarning.d.ts +0 -0
  798. /package/dist/{widget/hooks → hooks}/useRecipients.d.ts +0 -0
  799. /package/dist/{widget/hooks → hooks}/useSelectedFeeOption.d.ts +0 -0
  800. /package/dist/{widget/hooks → hooks}/useSelectedRecipient.d.ts +0 -0
  801. /package/dist/{widget/hooks → hooks}/useSwapAmount.d.ts +0 -0
  802. /package/dist/{widget/hooks → hooks}/useTargetAmount.d.ts +0 -0
  803. /package/dist/{widget/hooks → hooks}/useTheme.d.ts +0 -0
  804. /package/dist/{widget/hooks → hooks}/useWalletConnectionContext.d.ts +0 -0
@@ -1,1266 +0,0 @@
1
- import {
2
- ChevronDown,
3
- Clock,
4
- ExternalLink,
5
- Info,
6
- TriangleAlert,
7
- } from "lucide-react"
8
- import type React from "react"
9
- import { useCallback, useEffect, useMemo, useRef, useState } from "react"
10
- import { getExplorerUrl, getExplorerUrlForAddress } from "../../explorer.js"
11
- import { logger } from "../../logger.js"
12
- import type { MeldQuote } from "../../meld/utils/meld.js"
13
- import type { PrepareSendQuote } from "../../prepareSend.js"
14
- import {
15
- formatUsdAmountDisplay,
16
- formatUsdAmountLocaleDisplay,
17
- } from "../../utils/format.js"
18
- import {
19
- type TransactionState,
20
- isDisplayableTransactionHash,
21
- } from "../../transactions.js"
22
- import { isNativeToken, truncateAddress } from "../../utils/address.js"
23
- import { isSameChainSameToken } from "../../utils/passthrough.js"
24
- import { usePriceImpactWarning } from "../hooks/usePriceImpactWarning.js"
25
- import { useTrails } from "../providers/TrailsProvider.js"
26
- import { ChainImage } from "./ChainImage.js"
27
- import { PriceImpactWarning } from "./PriceImpactWarning.js"
28
- import { TokenImage } from "./TokenImage.js"
29
- import { Tooltip } from "./Tooltip.js"
30
- import { hasFailedOrAbortedTransaction } from "../utils/transactionFailure.js"
31
-
32
- interface QuoteDetailsProps {
33
- quote?: PrepareSendQuote | null
34
- onRampQuote?: MeldQuote | null
35
- fiatToUsdExchangeRate?: number | undefined
36
- showContent?: boolean
37
- children?: React.ReactNode
38
- onExpand?: (isExpanded: boolean) => void
39
- swapMode?: boolean
40
- compact?: boolean
41
- isRefetching?: boolean
42
- initialExpanded?: boolean
43
- showInsufficientFunds?: boolean
44
- isPassthrough?: boolean
45
- /** Actual transaction states with hashes (for receipt view) */
46
- liveTransactionStates?: TransactionState[]
47
- /** Callback to check if a transaction has meta tx errors */
48
- hasMetaTxError?: (tx: TransactionState) => boolean | undefined
49
- }
50
-
51
- export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
52
- quote,
53
- onRampQuote,
54
- fiatToUsdExchangeRate,
55
- showContent = true,
56
- children,
57
- onExpand,
58
- swapMode,
59
- compact = false,
60
- isRefetching = false,
61
- initialExpanded = false,
62
- showInsufficientFunds = true,
63
- isPassthrough = false,
64
- liveTransactionStates,
65
- hasMetaTxError,
66
- }) => {
67
- const [showCalldata, setShowCalldata] = useState(false)
68
- const [showOriginRate, setShowOriginRate] = useState(true)
69
- const [isExpanded, setIsExpanded] = useState(initialExpanded)
70
- const [prevInitialExpanded, setPrevInitialExpanded] =
71
- useState(initialExpanded)
72
- if (initialExpanded !== prevInitialExpanded) {
73
- setPrevInitialExpanded(initialExpanded)
74
- setIsExpanded(initialExpanded)
75
- }
76
- const containerRef = useRef<HTMLDivElement>(null)
77
- const { trailsAppUrl } = useTrails()
78
- const calldataRef = useRef<HTMLDivElement>(null)
79
-
80
- const priceImpactConfig = usePriceImpactWarning()
81
-
82
- // Check if origin and destination are the same token on the same chain
83
- const isSameToken = isSameChainSameToken(quote)
84
-
85
- const totalOnRampFeeInUsd = onRampQuote?.totalFee
86
- ? onRampQuote?.totalFee / (fiatToUsdExchangeRate ?? 1)
87
- : 0
88
-
89
- if (onRampQuote) {
90
- logger.console.log("[trails-sdk] OnRamp Quote", {
91
- onRampQuote,
92
- })
93
- }
94
-
95
- // Notify parent when expansion state changes
96
- useEffect(() => {
97
- onExpand?.(isExpanded)
98
- }, [isExpanded, onExpand])
99
-
100
- const getFiatToCryptoRate = useCallback(() => {
101
- if (!onRampQuote || !quote?.originTokenRate) {
102
- return null
103
- }
104
-
105
- const fiatToUsdcRate = onRampQuote.exchangeRate
106
- if (!fiatToUsdcRate || quote.originTokenRate === "0") {
107
- return null
108
- }
109
-
110
- // Parse USDC -> Destination Token rate
111
- const usdcToDestMatch = quote.originTokenRate.match(/=\s*([\d.]+)/)
112
- const usdcToDestRate = usdcToDestMatch
113
- ? parseFloat(usdcToDestMatch[1]!)
114
- : null
115
-
116
- if (!usdcToDestRate) {
117
- return null
118
- }
119
-
120
- // Calculate final rate: FIAT <-> Destination Token
121
- const fiatToDestinationToken = usdcToDestRate / fiatToUsdcRate
122
-
123
- const fiatSymbol = onRampQuote.sourceCurrencyCode
124
- const destSymbol = quote.destinationToken?.symbol || "TOKEN"
125
-
126
- return {
127
- fiatToDestinationToken,
128
- fiatSymbol,
129
- destSymbol,
130
- fiatToUsdcRate,
131
- }
132
- }, [onRampQuote, quote])
133
-
134
- const { totalFeeUsd, totalFeeUsdDisplay, totalFeeUsdLocaleDisplay } =
135
- useMemo(() => {
136
- if (onRampQuote) {
137
- const feeInUsd =
138
- totalOnRampFeeInUsd + parseFloat(quote?.fees.totalFeeAmountUsd || "0")
139
- return {
140
- totalFeeUsd: feeInUsd,
141
- totalFeeUsdDisplay: formatUsdAmountDisplay(feeInUsd),
142
- totalFeeUsdLocaleDisplay: formatUsdAmountLocaleDisplay(feeInUsd),
143
- }
144
- }
145
- if (quote?.fees?.totalFeeAmountUsd) {
146
- const feeInUsd = parseFloat(quote.fees.totalFeeAmountUsd)
147
- return {
148
- totalFeeUsd: feeInUsd,
149
- totalFeeUsdDisplay:
150
- quote.fees.totalFeeAmountUsdDisplay ??
151
- formatUsdAmountDisplay(feeInUsd),
152
- totalFeeUsdLocaleDisplay:
153
- quote.fees.totalFeeAmountUsdLocaleDisplay ??
154
- formatUsdAmountLocaleDisplay(feeInUsd),
155
- }
156
- }
157
- return {
158
- totalFeeUsd: 0,
159
- totalFeeUsdDisplay: "$0.00",
160
- totalFeeUsdLocaleDisplay: formatUsdAmountLocaleDisplay(0),
161
- }
162
- }, [onRampQuote, quote?.fees, totalOnRampFeeInUsd])
163
-
164
- const parseSlippageTolerance = useCallback(() => {
165
- if (!quote?.slippageTolerance) return null
166
- return parseFloat(quote.slippageTolerance) * 100
167
- }, [quote?.slippageTolerance])
168
-
169
- if (!showContent) return null
170
-
171
- return (
172
- <div
173
- className={`relative transition-opacity duration-300 ${
174
- isRefetching ? "opacity-50" : ""
175
- }`}
176
- >
177
- {/* Price Impact Warning - always visible when conditions are met */}
178
- <PriceImpactWarning
179
- quote={quote}
180
- thresholdBps={priceImpactConfig.thresholdBps}
181
- warningMessage={priceImpactConfig.warningMessage}
182
- fallbackBridgeUrl={priceImpactConfig.fallbackBridgeUrl}
183
- />
184
-
185
- {/* Insufficient Balance Warning - only visible when showInsufficientFunds is true */}
186
- {showInsufficientFunds && quote?.noSufficientBalance && (
187
- <div className="flex justify-between items-center mb-2 p-2 bg-amber-50 dark:bg-amber-900/20 rounded-lg">
188
- <span className="text-xs text-amber-600 dark:text-amber-400 flex items-center gap-1">
189
- Balance Status:
190
- <Tooltip message="Your wallet does not have sufficient balance to complete this transaction">
191
- <Info className="size-3 text-amber-500 dark:text-amber-400 cursor-pointer" />
192
- </Tooltip>
193
- </span>
194
- <span className="font-medium text-xs text-amber-600 dark:text-amber-400 flex items-center gap-1">
195
- <TriangleAlert className="size-3" />
196
- Insufficient Balance
197
- </span>
198
- </div>
199
- )}
200
-
201
- <div className={`flex justify-center`}>
202
- {swapMode ? (
203
- <button
204
- type="button"
205
- onClick={() => setIsExpanded(!isExpanded)}
206
- className="w-full flex items-center justify-between px-2 py-2 trails-border-radius-button transition-colors cursor-pointer text-sm"
207
- aria-label="Show more details"
208
- >
209
- <div className="font-semibold text-gray-900 dark:text-white flex items-center gap-2 whitespace-nowrap max-w-48 truncate">
210
- {(() => {
211
- const finalRate = getFiatToCryptoRate()
212
- if (finalRate) {
213
- const { fiatToDestinationToken, fiatSymbol, destSymbol } =
214
- finalRate
215
- return (
216
- <span>
217
- 1 {fiatSymbol} = {fiatToDestinationToken.toFixed(6)}{" "}
218
- {destSymbol}
219
- </span>
220
- )
221
- }
222
-
223
- if (onRampQuote?.exchangeRate) {
224
- const fiatSymbol = onRampQuote.sourceCurrencyCode
225
- const destSymbol =
226
- onRampQuote.destinationCurrencyCode.split("_")[0]
227
- return (
228
- <span>
229
- 1 {fiatSymbol} ={" "}
230
- {(1 / onRampQuote.exchangeRate).toFixed(6)} {destSymbol}
231
- </span>
232
- )
233
- }
234
-
235
- if (quote?.originTokenRate && quote.originTokenRate !== "0") {
236
- return <span>{quote.originTokenRate}</span>
237
- }
238
-
239
- return null
240
- })()}
241
- </div>
242
- <div className="flex items-center gap-2 text-gray-600 dark:text-gray-400">
243
- {quote?.completionEstimateDisplay && (
244
- <div className="flex items-center gap-1">
245
- <Clock className="size-3" />
246
- <span className="font-medium">
247
- ~{onRampQuote ? "3 min" : quote.completionEstimateDisplay}
248
- </span>
249
- </div>
250
- )}
251
- {totalFeeUsd > 0 && (
252
- <div className="flex items-center gap-1">
253
- <svg
254
- aria-hidden="true"
255
- focusable="false"
256
- data-prefix="fas"
257
- data-icon="gas-pump"
258
- className="svg-inline--fa fa-gas-pump"
259
- role="img"
260
- xmlns="http://www.w3.org/2000/svg"
261
- viewBox="0 0 512 512"
262
- width="12"
263
- >
264
- <path
265
- fill="currentColor"
266
- 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"
267
- />
268
- </svg>
269
- <span className="font-medium" title={totalFeeUsdDisplay}>
270
- {totalFeeUsdLocaleDisplay}
271
- </span>
272
- </div>
273
- )}
274
- <ChevronDown
275
- className={`size-3 transition-transform duration-300 ease-out text-gray-600 dark:text-gray-400 ${
276
- isExpanded ? "rotate-180" : ""
277
- }`}
278
- />
279
- </div>
280
- </button>
281
- ) : (
282
- <button
283
- type="button"
284
- onClick={() => setIsExpanded(!isExpanded)}
285
- className={`w-full max-w-md flex items-center ${
286
- compact ? "justify-center" : "justify-between"
287
- } gap-2 py-1 px-1 trails-border-radius-button transition-colors cursor-pointer text-xs text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300`}
288
- aria-label="Show transaction details"
289
- >
290
- <span>Transaction details</span>
291
- <ChevronDown
292
- className={`size-3 transition-transform duration-300 ease-out ${
293
- isExpanded ? "rotate-180" : ""
294
- }`}
295
- />
296
- </button>
297
- )}
298
- </div>
299
-
300
- {/* Details container */}
301
- <div
302
- ref={containerRef}
303
- className={`overflow-auto transition-all duration-300 ease-out ${
304
- isExpanded ? "max-h-[250px] opacity-100" : "max-h-0 opacity-0"
305
- }`}
306
- >
307
- <div className={`text-sm p-2 space-y-2`}>
308
- <div className="space-y-2">
309
- {/* Gas Costs Section */}
310
- {quote?.trailsFeeBreakdown &&
311
- (quote?.trailsFeeBreakdown.originRelayFee ||
312
- quote?.trailsFeeBreakdown.destinationRelayFee) &&
313
- totalFeeUsd > 0 && (
314
- <>
315
- <Row variant="bold">
316
- <RowLabel tooltip="The total fees for this transaction, including gas costs and all provider fees">
317
- Fees total
318
- </RowLabel>
319
- <RowValue>
320
- <span
321
- className="notranslate"
322
- translate="no"
323
- title={`${totalFeeUsd}`}
324
- >
325
- ≈{" "}
326
- {totalFeeUsdLocaleDisplay ||
327
- quote?.fees?.totalFeeAmountUsdLocaleDisplay}
328
- </span>
329
- </RowValue>
330
- </Row>
331
- <div className="h-0" />
332
- {/* Gas Costs Group */}
333
- {(quote.trailsFeeBreakdown.originRelayFee ||
334
- quote.trailsFeeBreakdown.destinationRelayFee) && (
335
- <RowGroup>
336
- <Row>
337
- <RowLabel tooltip="Total gas costs for executing transactions on both origin and destination chains">
338
- All gas costs
339
- </RowLabel>
340
- <RowValue>
341
- <span title={`$${quote.totalGasUsd ?? 0}`}>
342
- {quote.totalGasUsdLocaleDisplay ||
343
- quote.totalGasUsdDisplay ||
344
- "$0.00"}
345
- </span>
346
- </RowValue>
347
- </Row>
348
-
349
- {quote.trailsFeeBreakdown.originRelayFee && (
350
- <Row variant="light">
351
- <RowLabel tooltip="Gas fee for executing the transaction on the origin chain">
352
- Origin Gas
353
- <ChainImage
354
- chainId={quote.originChain.id}
355
- size={16}
356
- />
357
- </RowLabel>
358
- <RowValue>
359
- <span title={`$${quote.originGasUsd ?? 0}`}>
360
- {quote.originGasUsdLocaleDisplay ||
361
- quote.trailsFeeBreakdown.originRelayFee
362
- .usdValueLocale ||
363
- quote.trailsFeeBreakdown.originRelayFee
364
- .usdValue}
365
- </span>
366
- </RowValue>
367
- </Row>
368
- )}
369
-
370
- {quote.trailsFeeBreakdown.destinationRelayFee && (
371
- <Row variant="light">
372
- <RowLabel tooltip="Gas fee for executing the transaction on the destination chain">
373
- Destination Gas
374
- <ChainImage
375
- chainId={quote.destinationChain.id}
376
- size={16}
377
- />
378
- </RowLabel>
379
- <RowValue>
380
- <span title={`$${quote.destinationGasUsd ?? 0}`}>
381
- {quote.destinationGasUsdLocaleDisplay ||
382
- quote.trailsFeeBreakdown.destinationRelayFee
383
- .usdValueLocale ||
384
- quote.trailsFeeBreakdown.destinationRelayFee
385
- .usdValue}
386
- </span>
387
- </RowValue>
388
- </Row>
389
- )}
390
- </RowGroup>
391
- )}
392
- {/* Spacer */}
393
- <div className="h-1" />
394
- </>
395
- )}
396
-
397
- {/* Provider Costs Section */}
398
- {(() => {
399
- // Check if we have any provider fees to show
400
- const hasQuoteProviderFee =
401
- quote?.trailsFeeBreakdown && (quote.providerFeeUsd ?? 0) > 0
402
- const hasTrailsFee =
403
- quote?.trailsFeeBreakdown && (quote.trailsFeeUsd ?? 0) > 0
404
- const hasOnRampFee =
405
- onRampQuote && (onRampQuote.totalFee ?? 0) > 0
406
-
407
- if (!hasQuoteProviderFee && !hasTrailsFee && !hasOnRampFee)
408
- return null
409
-
410
- return (
411
- <RowGroup>
412
- {/* All Provider Fees */}
413
- {((quote?.totalProviderFeesUsd ?? 0) > 0 || hasOnRampFee) && (
414
- <Row>
415
- <RowLabel tooltip="Total provider fees for bridge, routing, and onramp services">
416
- All provider fees
417
- </RowLabel>
418
- <RowValue>
419
- <span
420
- title={`$${
421
- !quote
422
- ? (totalOnRampFeeInUsd ?? 0)
423
- : (quote?.totalProviderFeesUsd ?? 0) +
424
- (totalOnRampFeeInUsd ?? 0)
425
- }`}
426
- >
427
- {(() => {
428
- // If no quote, only show onramp fee
429
- if (!quote) {
430
- return formatUsdAmountLocaleDisplay(
431
- totalOnRampFeeInUsd,
432
- )
433
- }
434
- // If quote exists, show combined fees
435
- return formatUsdAmountLocaleDisplay(
436
- (quote?.totalProviderFeesUsd ?? 0) +
437
- (totalOnRampFeeInUsd ?? 0),
438
- )
439
- })()}
440
- </span>
441
- </RowValue>
442
- </Row>
443
- )}
444
-
445
- {/* Individual Provider Fees */}
446
- {hasQuoteProviderFee &&
447
- quote?.trailsFeeBreakdown?.providerFees &&
448
- quote.trailsFeeBreakdown.providerFees.length > 0 &&
449
- quote.trailsFeeBreakdown.providerFees.map((providerFee) => (
450
- <Row key={providerFee.id} variant="light">
451
- <RowLabel
452
- tooltip={`Fee charged by ${providerFee.name || providerFee.id}`}
453
- >
454
- {providerFee.isBridge ? "Bridge" : "Swap"}
455
- {providerFee.name && (
456
- <span>
457
- {" "}
458
- (
459
- <a
460
- href={providerFee.url}
461
- target="_blank"
462
- rel="noopener noreferrer"
463
- className="hover:underline inline-flex items-center gap-0.5 text-blue-500"
464
- >
465
- {providerFee.name}
466
- <ExternalLink className="size-3" />
467
- </a>
468
- )
469
- </span>
470
- )}
471
- </RowLabel>
472
- <RowValue>
473
- <span title={`$${providerFee.feeUsd}`}>
474
- {providerFee.usdValueLocale || providerFee.usdValue}
475
- </span>
476
- </RowValue>
477
- </Row>
478
- ))}
479
-
480
- {/* Onramp Provider Fee */}
481
- {hasOnRampFee && (
482
- <Row variant="light">
483
- <RowLabel tooltip="Fee charged by the onramp service provider, including network and transaction fees">
484
- Onramp
485
- {onRampQuote.serviceProvider && (
486
- <span>({onRampQuote.serviceProvider})</span>
487
- )}
488
- </RowLabel>
489
- <RowValue>
490
- <span title={`$${totalOnRampFeeInUsd ?? 0}`}>
491
- {/* onRampQuote.totalFee is in the source fiat currency so we need to convert into USD */}
492
- {formatUsdAmountLocaleDisplay(totalOnRampFeeInUsd)}
493
- </span>
494
- </RowValue>
495
- </Row>
496
- )}
497
-
498
- {/* Trails Platform Fee */}
499
- {hasTrailsFee &&
500
- quote?.trailsFeeBreakdown?.trailsFee &&
501
- (() => {
502
- const trailsFee = quote.trailsFeeBreakdown.trailsFee
503
-
504
- return (
505
- <Row variant="light">
506
- <RowLabel tooltip="Platform fee for using the Trails service">
507
- Trails
508
- </RowLabel>
509
- <RowValue>
510
- <span title={trailsFee.usdValue}>
511
- {trailsFee.usdValueLocale || trailsFee.usdValue}
512
- </span>
513
- </RowValue>
514
- </Row>
515
- )
516
- })()}
517
- </RowGroup>
518
- )
519
- })()}
520
-
521
- <div className="h-px bg-gray-200 dark:bg-gray-800 my-4" />
522
-
523
- {/* Transaction Details Section */}
524
- {(() => {
525
- const hasSlippage =
526
- quote?.slippageTolerance != null &&
527
- Number(quote.slippageTolerance) !== 0
528
- const hasPriceImpact =
529
- quote?.priceImpact != null && Number(quote.priceImpact) !== 0
530
- const hasIntentId =
531
- quote?.intentId != null && quote.intentId !== ""
532
- const showSection = hasSlippage || hasPriceImpact || hasIntentId
533
-
534
- if (!showSection) return null
535
-
536
- return (
537
- <RowGroup>
538
- <Row variant="bold">
539
- <RowLabel>Transaction details</RowLabel>
540
- </Row>
541
-
542
- {/* Intent ID */}
543
- {hasIntentId && (
544
- <Row>
545
- <RowLabel>Intent ID</RowLabel>
546
- <RowValue>
547
- <a
548
- href={`${trailsAppUrl}/intent/${quote.intentId}`}
549
- target="_blank"
550
- rel="noopener noreferrer"
551
- className="font-mono text-xs hover:underline flex items-center gap-1 text-blue-500"
552
- >
553
- {truncateAddress(quote?.intentId ?? "", 9, 3)}
554
- <ExternalLink className="size-3" />
555
- </a>
556
- </RowValue>
557
- </Row>
558
- )}
559
-
560
- {/* Max Slippage */}
561
- {hasSlippage && (
562
- <Row>
563
- <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.">
564
- Max slippage
565
- </RowLabel>
566
- <RowValue>{parseSlippageTolerance()}%</RowValue>
567
- </Row>
568
- )}
569
-
570
- {/* Price Impact */}
571
- {hasPriceImpact && (
572
- <div className="space-y-1">
573
- <Row>
574
- <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.">
575
- Price impact
576
- </RowLabel>
577
- <RowValue
578
- className={`flex items-center gap-1 ${
579
- Math.abs(Number(quote.priceImpact)) > 5
580
- ? "text-red-600 dark:text-red-400"
581
- : Math.abs(Number(quote.priceImpact)) > 0.5
582
- ? "text-orange-600 dark:text-orange-400"
583
- : "text-gray-600 dark:text-gray-400"
584
- }`}
585
- >
586
- {Math.abs(Number(quote.priceImpact)) > 0.5 && (
587
- <span title="High price impact">
588
- <TriangleAlert className="size-3" />
589
- </span>
590
- )}
591
- {Number(quote.priceImpact).toFixed(2)}%
592
- </RowValue>
593
- </Row>
594
- {quote.priceImpactUsdDisplay && (
595
- <div className="text-right">
596
- <span
597
- className="text-xs text-gray-500 dark:text-gray-400 notranslate"
598
- translate="no"
599
- title={quote.priceImpactUsdDisplay}
600
- >
601
- ≈{" "}
602
- {quote.priceImpactUsdLocaleDisplay ||
603
- quote.priceImpactUsdDisplay}
604
- </span>
605
- </div>
606
- )}
607
- </div>
608
- )}
609
- </RowGroup>
610
- )
611
- })()}
612
-
613
- <div className="space-y-3 pt-2">
614
- {/* Exchange Rate - hide when same token on same chain */}
615
- {!isSameToken &&
616
- (() => {
617
- // Handle onramp case: show combined FIAT -> DEST rate
618
- const finalRate = getFiatToCryptoRate()
619
- if (finalRate) {
620
- const { fiatToDestinationToken, fiatSymbol, destSymbol } =
621
- finalRate
622
- return (
623
- <Row>
624
- <RowLabel
625
- tooltip={`Combined exchange rate from ${fiatSymbol} to ${destSymbol} (via USDC on Base)`}
626
- >
627
- Exchange Rate
628
- </RowLabel>
629
- <RowValue>
630
- <button
631
- type="button"
632
- onClick={() => setShowOriginRate(!showOriginRate)}
633
- className="hover:underline cursor-pointer"
634
- >
635
- 1 {fiatSymbol} = $
636
- {fiatToDestinationToken.toFixed(6)} ${destSymbol}`
637
- </button>
638
- </RowValue>
639
- </Row>
640
- )
641
- }
642
-
643
- // Fallback: show just the onramp rate if quote rates aren't available
644
- if (onRampQuote?.exchangeRate) {
645
- const fiatSymbol = onRampQuote.sourceCurrencyCode
646
- const destSymbol =
647
- onRampQuote.destinationCurrencyCode.split("_")[0]
648
- const fiatToUsdcRate = onRampQuote.exchangeRate
649
-
650
- return (
651
- <Row>
652
- <RowLabel
653
- tooltip={`Exchange rate from ${fiatSymbol} to ${destSymbol}`}
654
- >
655
- Exchange Rate
656
- </RowLabel>
657
- <RowValue>
658
- 1 {fiatSymbol} = ${(1 / fiatToUsdcRate).toFixed(6)} $
659
- {destSymbol}
660
- </RowValue>
661
- </Row>
662
- )
663
- }
664
-
665
- // Standard case: show quote exchange rate
666
- if (
667
- quote?.originTokenRate &&
668
- quote?.destinationTokenRate &&
669
- quote.originTokenRate !== "0" &&
670
- quote.destinationTokenRate !== "0"
671
- ) {
672
- return (
673
- <Row>
674
- <RowLabel tooltip="The current exchange rate between the origin and destination tokens">
675
- Exchange Rate
676
- </RowLabel>
677
- <RowValue>
678
- <button
679
- type="button"
680
- onClick={() => setShowOriginRate(!showOriginRate)}
681
- className="hover:underline cursor-pointer"
682
- >
683
- {showOriginRate
684
- ? quote.originTokenRate
685
- : quote.destinationTokenRate}
686
- </button>
687
- </RowValue>
688
- </Row>
689
- )
690
- }
691
-
692
- return null
693
- })()}
694
-
695
- {/* Transfer Amounts Group */}
696
- {((quote?.originAmount &&
697
- quote?.originToken.symbol &&
698
- quote?.originChain.id) ||
699
- (quote?.destinationToken.symbol &&
700
- quote?.destinationAmount &&
701
- quote?.destinationAmountUsdDisplay &&
702
- quote?.destinationChain.id)) && (
703
- <RowGroup>
704
- {/* Hide origin transfer amount when same token - only show target amount */}
705
- {!isSameToken &&
706
- quote?.originAmount &&
707
- quote?.originToken.symbol &&
708
- quote?.originChain.id && (
709
- <Row className="items-start">
710
- <RowLabel
711
- tooltip={
712
- isPassthrough
713
- ? "The amount of tokens you will transfer"
714
- : "The amount of tokens you will send from the origin chain"
715
- }
716
- >
717
- {isPassthrough
718
- ? "Transfer Amount"
719
- : "Origin Transfer Amount"}
720
- </RowLabel>
721
- <div className="text-right">
722
- {isNativeToken(quote.originToken.contractAddress) ? (
723
- <>
724
- <div className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1 justify-end">
725
- <TokenImage
726
- imageUrl={quote.originToken.imageUrl}
727
- symbol={quote.originToken.symbol}
728
- chainId={quote.originChain.id}
729
- contractAddress={
730
- quote.originToken.contractAddress
731
- }
732
- size={16}
733
- />
734
- <span className="notranslate" translate="no">
735
- {quote.originAmountFormattedLocale ||
736
- quote.originAmountDisplay}{" "}
737
- {quote.originToken.symbol}
738
- </span>
739
- </div>
740
- {quote.originAmountUsdDisplay && (
741
- <div
742
- className="text-xs text-gray-500 dark:text-gray-400 mt-0.5 notranslate"
743
- translate="no"
744
- title={quote.originAmountUsdDisplay}
745
- >
746
- ≈{" "}
747
- {quote.originAmountUsdLocaleDisplay ||
748
- quote.originAmountUsdDisplay}
749
- </div>
750
- )}
751
- </>
752
- ) : (
753
- <>
754
- <a
755
- href={getExplorerUrlForAddress({
756
- address: quote.originToken.contractAddress,
757
- chainId: quote.originChain.id,
758
- })}
759
- target="_blank"
760
- rel="noopener noreferrer"
761
- className="hover:underline cursor-pointer"
762
- >
763
- <div className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1 justify-end">
764
- <TokenImage
765
- imageUrl={quote.originToken.imageUrl}
766
- symbol={quote.originToken.symbol}
767
- chainId={quote.originChain.id}
768
- contractAddress={
769
- quote.originToken.contractAddress
770
- }
771
- size={16}
772
- />
773
- {quote.originAmountFormattedLocale ||
774
- quote.originAmountDisplay}{" "}
775
- {quote.originToken.symbol}
776
- </div>
777
- </a>
778
- {quote.originAmountUsdDisplay && (
779
- <div
780
- className="text-xs text-gray-500 dark:text-gray-400 mt-0.5 notranslate"
781
- translate="no"
782
- title={quote.originAmountUsdDisplay}
783
- >
784
- ≈{" "}
785
- {quote.originAmountUsdLocaleDisplay ||
786
- quote.originAmountUsdDisplay}
787
- </div>
788
- )}
789
- </>
790
- )}
791
- </div>
792
- </Row>
793
- )}
794
-
795
- {quote?.destinationToken.symbol &&
796
- quote?.destinationAmount &&
797
- quote?.destinationAmountUsdDisplay &&
798
- quote?.destinationChain.id && (
799
- <Row className="items-start">
800
- <RowLabel
801
- tooltip={
802
- isPassthrough
803
- ? "The amount of tokens the recipient will receive"
804
- : "The amount of tokens you will receive on the destination chain after the swap and/or bridge"
805
- }
806
- >
807
- {isPassthrough
808
- ? "Target Amount"
809
- : "Destination Target Amount"}
810
- </RowLabel>
811
- <div className="text-right">
812
- {isNativeToken(
813
- quote.destinationToken.contractAddress,
814
- ) ? (
815
- <>
816
- <div className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1 justify-end">
817
- <TokenImage
818
- imageUrl={quote.destinationToken.imageUrl}
819
- symbol={quote.destinationToken.symbol}
820
- chainId={quote.destinationChain.id}
821
- contractAddress={
822
- quote.destinationToken.contractAddress
823
- }
824
- size={16}
825
- />
826
- <span className="notranslate" translate="no">
827
- {quote.destinationAmountFormattedLocale ||
828
- quote.destinationAmountDisplay}{" "}
829
- {quote.destinationToken.symbol}
830
- </span>
831
- </div>
832
- {quote.destinationAmountUsdDisplay && (
833
- <div
834
- className="text-xs text-gray-500 dark:text-gray-400 mt-0.5 notranslate"
835
- translate="no"
836
- title={quote.destinationAmountUsdDisplay}
837
- >
838
- ≈{" "}
839
- {quote.destinationAmountUsdLocaleDisplay ||
840
- quote.destinationAmountUsdDisplay}
841
- </div>
842
- )}
843
- </>
844
- ) : (
845
- <>
846
- <a
847
- href={getExplorerUrlForAddress({
848
- address:
849
- quote.destinationToken.contractAddress,
850
- chainId: quote.destinationChain.id,
851
- })}
852
- target="_blank"
853
- rel="noopener noreferrer"
854
- className="hover:underline cursor-pointer"
855
- >
856
- <div className="font-medium text-xs text-gray-600 dark:text-gray-400 flex items-center gap-1 justify-end">
857
- <TokenImage
858
- imageUrl={quote.destinationToken.imageUrl}
859
- symbol={quote.destinationToken.symbol}
860
- chainId={quote.destinationChain.id}
861
- contractAddress={
862
- quote.destinationToken.contractAddress
863
- }
864
- size={16}
865
- />
866
- {quote.destinationAmountFormattedLocale ||
867
- quote.destinationAmountDisplay}{" "}
868
- {quote.destinationToken.symbol}
869
- </div>
870
- </a>
871
- {quote.destinationAmountUsdDisplay && (
872
- <div
873
- className="text-xs text-gray-500 dark:text-gray-400 mt-0.5 notranslate"
874
- translate="no"
875
- title={quote.destinationAmountUsdDisplay}
876
- >
877
- ≈{" "}
878
- {quote.destinationAmountUsdLocaleDisplay ||
879
- quote.destinationAmountUsdDisplay}
880
- </div>
881
- )}
882
- </>
883
- )}
884
- </div>
885
- </Row>
886
- )}
887
- </RowGroup>
888
- )}
889
-
890
- {/* Address Group */}
891
- {(quote?.originDepositAddress ||
892
- quote?.destinationDepositAddress ||
893
- quote?.destinationAddress) && (
894
- <RowGroup>
895
- {/* For passthrough: show only Target Address (the recipient) */}
896
- {isPassthrough ? (
897
- quote?.destinationAddress && (
898
- <Row>
899
- <RowLabel tooltip="The address that will receive the tokens">
900
- Target Address
901
- </RowLabel>
902
- <RowValue>
903
- <a
904
- href={getExplorerUrlForAddress({
905
- address: quote.destinationAddress,
906
- chainId: quote.destinationChain.id,
907
- })}
908
- target="_blank"
909
- rel="noopener noreferrer"
910
- className="font-mono text-xs hover:underline flex items-center gap-1 text-blue-500"
911
- >
912
- {truncateAddress(quote.destinationAddress)}
913
- <ExternalLink className="size-3" />
914
- </a>
915
- </RowValue>
916
- </Row>
917
- )
918
- ) : (
919
- <>
920
- {quote?.originDepositAddress && (
921
- <Row>
922
- <RowLabel tooltip="This is the intent address to deposit to that will then execute the swap and/or bridge">
923
- Origin Deposit Address
924
- </RowLabel>
925
- <RowValue>
926
- <a
927
- href={getExplorerUrlForAddress({
928
- address: quote.originDepositAddress,
929
- chainId: quote.originChain.id,
930
- })}
931
- target="_blank"
932
- rel="noopener noreferrer"
933
- className="font-mono text-xs hover:underline flex items-center gap-1 text-blue-500"
934
- >
935
- {truncateAddress(quote.originDepositAddress)}
936
- <ExternalLink className="size-3" />
937
- </a>
938
- </RowValue>
939
- </Row>
940
- )}
941
-
942
- {quote?.destinationDepositAddress &&
943
- quote?.destinationDepositAddress !==
944
- quote?.originDepositAddress && (
945
- <Row>
946
- <RowLabel tooltip="This is the address that will receive the tokens after any swap and/or bridge from the origin chain">
947
- Destination Deposit Address
948
- </RowLabel>
949
- <RowValue>
950
- <a
951
- href={getExplorerUrlForAddress({
952
- address: quote.destinationDepositAddress,
953
- chainId: quote.destinationChain.id,
954
- })}
955
- target="_blank"
956
- rel="noopener noreferrer"
957
- className="font-mono text-xs hover:underline flex items-center gap-1 text-blue-500"
958
- >
959
- {truncateAddress(
960
- quote.destinationDepositAddress,
961
- )}
962
- <ExternalLink className="size-3" />
963
- </a>
964
- </RowValue>
965
- </Row>
966
- )}
967
-
968
- {quote?.destinationAddress && (
969
- <Row>
970
- <RowLabel tooltip="This is the final execution address or recipient address">
971
- Destination Target Address
972
- </RowLabel>
973
- <RowValue>
974
- <a
975
- href={getExplorerUrlForAddress({
976
- address: quote.destinationAddress,
977
- chainId: quote.destinationChain.id,
978
- })}
979
- target="_blank"
980
- rel="noopener noreferrer"
981
- className="font-mono text-xs hover:underline flex items-center gap-1 text-blue-500"
982
- >
983
- {truncateAddress(quote.destinationAddress)}
984
- <ExternalLink className="size-3" />
985
- </a>
986
- </RowValue>
987
- </Row>
988
- )}
989
- </>
990
- )}
991
- </RowGroup>
992
- )}
993
-
994
- {/* Custom Calldata */}
995
- {quote?.destinationCalldata && (
996
- <div className="space-y-2">
997
- <button
998
- type="button"
999
- onClick={() => {
1000
- setShowCalldata(!showCalldata)
1001
- // Auto-scroll to calldata when expanding
1002
- if (!showCalldata) {
1003
- setTimeout(() => {
1004
- if (calldataRef.current) {
1005
- calldataRef.current.scrollIntoView({
1006
- behavior: "smooth",
1007
- block: "nearest",
1008
- })
1009
- }
1010
- }, 150) // Delay to let the expansion animation start
1011
- }
1012
- }}
1013
- className="flex items-center gap-1 text-xs hover:underline cursor-pointer transition-colors duration-200 text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"
1014
- aria-label={
1015
- showCalldata
1016
- ? "Hide custom calldata"
1017
- : "Show custom calldata"
1018
- }
1019
- >
1020
- <span className="text-[10px]">
1021
- Includes custom destination calldata
1022
- </span>
1023
- <ChevronDown
1024
- className={`size-3 transition-transform duration-300 ease-out ${
1025
- showCalldata ? "rotate-180" : ""
1026
- }`}
1027
- />
1028
- </button>
1029
- <div
1030
- ref={calldataRef}
1031
- className={`overflow-hidden transition-all duration-300 ease-out ${
1032
- showCalldata
1033
- ? "max-h-32 opacity-100"
1034
- : "max-h-0 opacity-0"
1035
- }`}
1036
- >
1037
- <div className="mt-2">
1038
- <textarea
1039
- value={quote.destinationCalldata}
1040
- readOnly
1041
- className={`w-full p-2 text-xs font-mono rounded border border-solid resize-none transition-all duration-200 bg-gray-100 dark:bg-gray-700 border-gray-300 dark:border-gray-600 text-gray-800 dark:text-gray-200`}
1042
- rows={4}
1043
- placeholder="No custom calldata"
1044
- />
1045
- </div>
1046
- </div>
1047
- </div>
1048
- )}
1049
-
1050
- {/* Transaction Steps Section */}
1051
- {(() => {
1052
- // Use live transaction states if available (receipt view), otherwise use quote states
1053
- const hasLiveStates =
1054
- liveTransactionStates && liveTransactionStates.length > 0
1055
- const displayStates = hasLiveStates
1056
- ? liveTransactionStates
1057
- : isPassthrough && quote?.passthroughTransactionStates?.length
1058
- ? quote.passthroughTransactionStates
1059
- : quote?.transactionStates
1060
-
1061
- if (!displayStates || displayStates.length === 0) return null
1062
-
1063
- return (
1064
- <div className="mt-4">
1065
- <div className="h-px bg-gray-200 dark:bg-gray-800 mb-3" />
1066
- <RowGroup>
1067
- <Row variant="bold">
1068
- <RowLabel>
1069
- <span className="flex items-center gap-2">
1070
- {hasLiveStates
1071
- ? "Transactions"
1072
- : "Transaction Steps"}
1073
- {isPassthrough && (
1074
- <span className="text-[10px] px-1.5 py-0.5 rounded-full bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 font-medium">
1075
- Direct
1076
- </span>
1077
- )}
1078
- </span>
1079
- </RowLabel>
1080
- </Row>
1081
- {displayStates.map((txState, index) => {
1082
- const liveTxState = txState as TransactionState
1083
- const hasTxHash =
1084
- hasLiveStates &&
1085
- isDisplayableTransactionHash(
1086
- liveTxState.transactionHash,
1087
- )
1088
- const txExplorerUrl =
1089
- liveTxState.explorerUrl ||
1090
- (isDisplayableTransactionHash(
1091
- liveTxState.transactionHash,
1092
- ) && liveTxState.chainId
1093
- ? getExplorerUrl({
1094
- txHash: liveTxState.transactionHash,
1095
- chainId: liveTxState.chainId,
1096
- })
1097
- : null)
1098
- const txHasMetaError =
1099
- hasMetaTxError && hasLiveStates
1100
- ? hasMetaTxError(liveTxState)
1101
- : false
1102
-
1103
- return (
1104
- <div
1105
- key={txState.label || index}
1106
- className={`p-2 rounded ${hasLiveStates ? "bg-gray-100 dark:bg-gray-700/50" : ""}`}
1107
- >
1108
- <div className="flex justify-between items-center">
1109
- <span className="flex items-center gap-2 text-xs text-gray-600 dark:text-gray-400">
1110
- {!hasLiveStates && (
1111
- <span className="w-4 h-4 rounded-full bg-gray-200 dark:bg-gray-700 flex items-center justify-center text-[10px] font-medium">
1112
- {index + 1}
1113
- </span>
1114
- )}
1115
- {txState.label}
1116
- </span>
1117
- <span className="flex items-center gap-2">
1118
- <ChainImage
1119
- chainId={txState.chainId}
1120
- size={14}
1121
- />
1122
- {hasLiveStates && liveTxState.state && (
1123
- <span
1124
- className={`px-2 py-0.5 rounded-full text-xs ${
1125
- hasFailedOrAbortedTransaction(liveTxState)
1126
- ? "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400"
1127
- : liveTxState.state === "confirmed"
1128
- ? "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-400"
1129
- : "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-400"
1130
- }`}
1131
- >
1132
- {liveTxState.state.charAt(0).toUpperCase() +
1133
- liveTxState.state.slice(1)}
1134
- </span>
1135
- )}
1136
- </span>
1137
- </div>
1138
- {hasLiveStates && (
1139
- <div className="mt-1 flex justify-between items-center">
1140
- <span className="text-xs text-gray-600 dark:text-gray-400">
1141
- Hash
1142
- </span>
1143
- {hasTxHash && txExplorerUrl ? (
1144
- <a
1145
- href={txExplorerUrl}
1146
- target="_blank"
1147
- rel="noopener noreferrer"
1148
- className="text-xs flex items-center gap-1 hover:underline text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
1149
- >
1150
- {txHasMetaError && (
1151
- <svg
1152
- className="w-4 h-4 text-orange-500"
1153
- fill="none"
1154
- viewBox="0 0 24 24"
1155
- stroke="currentColor"
1156
- >
1157
- <title>
1158
- An internal meta transaction failure
1159
- occurred
1160
- </title>
1161
- <path
1162
- strokeLinecap="round"
1163
- strokeLinejoin="round"
1164
- strokeWidth={2}
1165
- 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"
1166
- />
1167
- </svg>
1168
- )}
1169
- <span>
1170
- {truncateAddress(
1171
- liveTxState.transactionHash,
1172
- )}
1173
- </span>
1174
- <ExternalLink className="w-3 h-3" />
1175
- </a>
1176
- ) : (
1177
- <span className="text-xs text-gray-400 dark:text-gray-500">
1178
- ...
1179
- </span>
1180
- )}
1181
- </div>
1182
- )}
1183
- </div>
1184
- )
1185
- })}
1186
- </RowGroup>
1187
- </div>
1188
- )
1189
- })()}
1190
-
1191
- {/* Children content */}
1192
- {children && <div className="mb-0">{children}</div>}
1193
- </div>
1194
- </div>
1195
- </div>
1196
- </div>
1197
- </div>
1198
- )
1199
- }
1200
-
1201
- export default QuoteDetails
1202
-
1203
- interface RowGroupProps {
1204
- children: React.ReactNode
1205
- className?: string
1206
- }
1207
-
1208
- const RowGroup: React.FC<RowGroupProps> = ({ children, className = "" }) => (
1209
- <div className={`space-y-2 ${className}`}>{children}</div>
1210
- )
1211
-
1212
- const rowVariants = {
1213
- default: "text-xs text-gray-600 dark:text-gray-400",
1214
- light: "text-xs text-gray-400 dark:text-gray-600",
1215
- bold: "text-sm font-semibold text-gray-900 dark:text-white",
1216
- }
1217
-
1218
- interface RowProps {
1219
- children: React.ReactNode
1220
- className?: string
1221
- variant?: keyof typeof rowVariants
1222
- }
1223
-
1224
- const Row: React.FC<RowProps> = ({
1225
- children,
1226
- className = "",
1227
- variant = "default",
1228
- }) => (
1229
- <div
1230
- className={`flex justify-between items-center ${rowVariants[variant]} ${className}`}
1231
- >
1232
- {children}
1233
- </div>
1234
- )
1235
-
1236
- interface RowLabelProps {
1237
- children: React.ReactNode
1238
- tooltip?: string
1239
- className?: string
1240
- }
1241
-
1242
- const RowLabel: React.FC<RowLabelProps> = ({
1243
- children,
1244
- tooltip,
1245
- className = "",
1246
- }) => {
1247
- return (
1248
- <div className={`flex items-center gap-1 ${className}`}>
1249
- {children}
1250
- {tooltip && (
1251
- <Tooltip message={tooltip}>
1252
- <Info className="size-3 text-gray-500 dark:text-gray-400 cursor-pointer" />
1253
- </Tooltip>
1254
- )}
1255
- </div>
1256
- )
1257
- }
1258
-
1259
- interface RowValueProps {
1260
- children: React.ReactNode
1261
- className?: string
1262
- }
1263
-
1264
- const RowValue: React.FC<RowValueProps> = ({ children, className }) => {
1265
- return <div className={className}>{children}</div>
1266
- }