0xtrails 0.1.13 → 0.2.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.
- package/dist/aave.d.ts.map +1 -1
- package/dist/analytics.d.ts +11 -2
- package/dist/analytics.d.ts.map +1 -1
- package/dist/apiClient.d.ts +1 -1
- package/dist/apiClient.d.ts.map +1 -1
- package/dist/{proxyCaller.d.ts → balanceInjector.d.ts} +5 -4
- package/dist/balanceInjector.d.ts.map +1 -0
- package/dist/{ccip-D3gTQONK.js → ccip-D6ToCrWc.js} +12 -12
- package/dist/cctp.d.ts.map +1 -1
- package/dist/cctpqueue.d.ts +3 -3
- package/dist/cctpqueue.d.ts.map +1 -1
- package/dist/chains.d.ts.map +1 -1
- package/dist/config.d.ts +17 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/constants.d.ts +5 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/contractUtils.d.ts +2 -0
- package/dist/contractUtils.d.ts.map +1 -1
- package/dist/customChains.d.ts +24 -0
- package/dist/customChains.d.ts.map +1 -0
- package/dist/{index-CnUM7lKf.js → index-BqgeTLL8.js} +34072 -30146
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +411 -400
- package/dist/intentEntrypoint.d.ts +96 -0
- package/dist/intentEntrypoint.d.ts.map +1 -0
- package/dist/intents.d.ts +5 -3
- package/dist/intents.d.ts.map +1 -1
- package/dist/metaTxnMonitor.d.ts.map +1 -1
- package/dist/morpho.d.ts.map +1 -1
- package/dist/pools.d.ts +3 -1
- package/dist/pools.d.ts.map +1 -1
- package/dist/prepareSend.d.ts +8 -2
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/prices.d.ts +1 -1
- package/dist/prices.d.ts.map +1 -1
- package/dist/relaySdk.d.ts.map +1 -1
- package/dist/relayer.d.ts.map +1 -1
- package/dist/toast.d.ts +9 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/tokenBalances.d.ts +6 -2
- package/dist/tokenBalances.d.ts.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/trails.d.ts +6 -5
- package/dist/trails.d.ts.map +1 -1
- package/dist/trailsClient.d.ts +12 -0
- package/dist/trailsClient.d.ts.map +1 -0
- package/dist/transactions.d.ts +8 -0
- package/dist/transactions.d.ts.map +1 -1
- package/dist/wallets.d.ts.map +1 -1
- package/dist/widget/components/AccountActionsDropdown.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/components/AccountSettings.d.ts +7 -0
- package/dist/widget/components/AccountSettings.d.ts.map +1 -0
- package/dist/widget/components/ChainList.d.ts +0 -1
- package/dist/widget/components/ChainList.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.d.ts +46 -0
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -0
- package/dist/widget/components/ConfigDisplay.d.ts.map +1 -1
- package/dist/widget/components/ConnectedWallets.d.ts +9 -0
- package/dist/widget/components/ConnectedWallets.d.ts.map +1 -0
- package/dist/widget/components/DebugMenu.d.ts.map +1 -1
- package/dist/widget/components/DebugScreensList.d.ts.map +1 -1
- package/dist/widget/components/DebugToast.d.ts +3 -0
- package/dist/widget/components/DebugToast.d.ts.map +1 -0
- package/dist/widget/components/Earn.d.ts.map +1 -1
- package/dist/widget/components/EarnPools.d.ts.map +1 -1
- package/dist/widget/components/Fund.d.ts +44 -0
- package/dist/widget/components/Fund.d.ts.map +1 -0
- package/dist/widget/components/Identicon.d.ts +9 -0
- package/dist/widget/components/Identicon.d.ts.map +1 -0
- package/dist/widget/components/Pay.d.ts +46 -0
- package/dist/widget/components/Pay.d.ts.map +1 -0
- package/dist/widget/components/Receive.d.ts.map +1 -1
- package/dist/widget/components/RecentTokens.d.ts.map +1 -1
- package/dist/widget/components/Recipients.d.ts +9 -0
- package/dist/widget/components/Recipients.d.ts.map +1 -0
- package/dist/widget/components/RefundWarning.d.ts +9 -0
- package/dist/widget/components/RefundWarning.d.ts.map +1 -0
- package/dist/widget/components/SimpleSwap.d.ts.map +1 -1
- package/dist/widget/components/Swap.d.ts.map +1 -1
- package/dist/widget/components/SwapSettings.d.ts +1 -5
- package/dist/widget/components/SwapSettings.d.ts.map +1 -1
- package/dist/widget/components/ThemeProvider.d.ts.map +1 -1
- package/dist/widget/components/ThemeSyncer.d.ts +6 -0
- package/dist/widget/components/ThemeSyncer.d.ts.map +1 -0
- package/dist/widget/components/Toast.d.ts +24 -0
- package/dist/widget/components/Toast.d.ts.map +1 -0
- package/dist/widget/components/TokenList.d.ts.map +1 -1
- package/dist/widget/components/TransactionDetails.d.ts.map +1 -1
- package/dist/widget/components/TruncatedAddress.d.ts +2 -0
- package/dist/widget/components/TruncatedAddress.d.ts.map +1 -1
- package/dist/widget/components/UserPreferences.d.ts +7 -0
- package/dist/widget/components/UserPreferences.d.ts.map +1 -0
- package/dist/widget/hooks/useBalanceVisible.d.ts +1 -0
- package/dist/widget/hooks/useBalanceVisible.d.ts.map +1 -1
- package/dist/widget/hooks/useCheckout.d.ts.map +1 -1
- package/dist/widget/hooks/useCurrentScreen.d.ts +1 -1
- package/dist/widget/hooks/useCurrentScreen.d.ts.map +1 -1
- package/dist/widget/hooks/useDebugScreens.d.ts +1 -1
- package/dist/widget/hooks/useDebugScreens.d.ts.map +1 -1
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts +54 -0
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts.map +1 -0
- package/dist/widget/hooks/useIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/hooks/usePayMessage.d.ts +34 -0
- package/dist/widget/hooks/usePayMessage.d.ts.map +1 -0
- package/dist/widget/hooks/useRecipients.d.ts +17 -0
- package/dist/widget/hooks/useRecipients.d.ts.map +1 -0
- package/dist/widget/hooks/useSelectedRecipient.d.ts +12 -0
- package/dist/widget/hooks/useSelectedRecipient.d.ts.map +1 -0
- package/dist/widget/hooks/useSendForm.d.ts +2 -0
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/hooks/useSwapAmount.d.ts +13 -0
- package/dist/widget/hooks/useSwapAmount.d.ts.map +1 -0
- package/dist/widget/hooks/useSwapSettings.d.ts +16 -0
- package/dist/widget/hooks/useSwapSettings.d.ts.map +1 -0
- package/dist/widget/hooks/useTargetAmount.d.ts +5 -0
- package/dist/widget/hooks/useTargetAmount.d.ts.map +1 -0
- package/dist/widget/hooks/useTheme.d.ts +14 -0
- package/dist/widget/hooks/useTheme.d.ts.map +1 -0
- package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
- package/dist/widget/index.js +2 -2
- package/dist/widget/widget.d.ts +9 -0
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +29 -28
- package/src/aave.ts +6 -1
- package/src/analytics.ts +103 -53
- package/src/apiClient.ts +1 -1
- package/src/{proxyCaller.ts → balanceInjector.ts} +22 -17
- package/src/cctp.ts +6 -2
- package/src/cctpqueue.ts +7 -7
- package/src/chains.ts +8 -0
- package/src/config.ts +40 -9
- package/src/constants.ts +11 -8
- package/src/contractUtils.ts +33 -2
- package/src/customChains.ts +24 -0
- package/src/index.ts +11 -1
- package/src/intentEntrypoint.ts +253 -0
- package/src/intents.ts +87 -54
- package/src/metaTxnMonitor.ts +1 -0
- package/src/morpho.ts +13 -2
- package/src/pools.ts +68 -86
- package/src/prepareSend.ts +437 -207
- package/src/prices.ts +51 -7
- package/src/relaySdk.ts +6 -4
- package/src/relayer.ts +2 -0
- package/src/toast.ts +110 -0
- package/src/tokenBalances.ts +112 -20
- package/src/tokens.ts +70 -7
- package/src/trails.ts +80 -77
- package/src/trailsClient.ts +45 -0
- package/src/transactions.ts +27 -35
- package/src/umd.tsx +1 -1
- package/src/wallets.ts +2 -1
- package/src/widget/assets/sequence-logo.svg +15 -0
- package/src/widget/compiled.css +2 -2
- package/src/widget/components/AccountActionsDropdown.tsx +18 -159
- package/src/widget/components/AccountIntentTransactionHistory.tsx +346 -63
- package/src/widget/components/AccountSettings.tsx +96 -0
- package/src/widget/components/ChainFilterDropdown.tsx +1 -1
- package/src/widget/components/ChainList.tsx +10 -20
- package/src/widget/components/ClassicSwap.tsx +923 -0
- package/src/widget/components/ConfigDisplay.tsx +8 -5
- package/src/widget/components/ConnectedWallets.tsx +260 -0
- package/src/widget/components/DebugMenu.tsx +2 -0
- package/src/widget/components/DebugScreensList.tsx +3 -0
- package/src/widget/components/DebugToast.tsx +63 -0
- package/src/widget/components/Earn.tsx +108 -116
- package/src/widget/components/EarnPools.tsx +2 -4
- package/src/widget/components/EarnPoolsFilters.tsx +6 -6
- package/src/widget/components/Fund.tsx +1245 -0
- package/src/widget/components/FundMethods.tsx +1 -1
- package/src/widget/components/FundSendForm.tsx +1 -1
- package/src/widget/components/Identicon.tsx +158 -0
- package/src/widget/components/Pay.tsx +1088 -0
- package/src/widget/components/PaySendForm.tsx +1 -1
- package/src/widget/components/QuoteDetails.tsx +1 -1
- package/src/widget/components/Receipt.tsx +1 -1
- package/src/widget/components/Receive.tsx +4 -2
- package/src/widget/components/RecentTokens.tsx +2 -1
- package/src/widget/components/Recipients.tsx +448 -0
- package/src/widget/components/RefundWarning.tsx +61 -0
- package/src/widget/components/ScreenHeader.tsx +1 -1
- package/src/widget/components/SimpleSwap.tsx +74 -58
- package/src/widget/components/Swap.tsx +35 -853
- package/src/widget/components/SwapSettings.tsx +5 -11
- package/src/widget/components/ThemeProvider.tsx +32 -0
- package/src/widget/components/ThemeSyncer.tsx +47 -0
- package/src/widget/components/Toast.tsx +315 -0
- package/src/widget/components/TokenList.tsx +2 -34
- package/src/widget/components/TokenSelector.tsx +3 -3
- package/src/widget/components/TransactionDetails.tsx +153 -13
- package/src/widget/components/TruncatedAddress.tsx +5 -1
- package/src/widget/components/UserPreferences.tsx +156 -0
- package/src/widget/components/WalletList.tsx +1 -1
- package/src/widget/hooks/useBalanceVisible.tsx +40 -2
- package/src/widget/hooks/useCheckout.ts +13 -0
- package/src/widget/hooks/useCurrentScreen.tsx +3 -0
- package/src/widget/hooks/useDebugScreens.ts +12 -2
- package/src/widget/hooks/useDefaultTokenSelection.tsx +475 -0
- package/src/widget/hooks/useIntentTransactionHistory.ts +212 -0
- package/src/widget/hooks/usePayMessage.tsx +370 -0
- package/src/widget/hooks/useRecipients.ts +168 -0
- package/src/widget/hooks/useSelectedRecipient.tsx +48 -0
- package/src/widget/hooks/useSendForm.ts +179 -26
- package/src/widget/hooks/useSwapAmount.tsx +50 -0
- package/src/widget/hooks/useSwapSettings.tsx +100 -0
- package/src/widget/hooks/useTargetAmount.ts +23 -0
- package/src/widget/hooks/useTheme.tsx +80 -0
- package/src/widget/hooks/useTokenList.ts +20 -11
- package/src/widget/index.css +45 -21
- package/src/widget/widget.tsx +164 -68
- package/dist/address.d.ts +0 -2
- package/dist/address.d.ts.map +0 -1
- package/dist/proxyCaller.d.ts.map +0 -1
- package/src/address.ts +0 -6
|
@@ -6,6 +6,8 @@ import { useOriginSelectedToken } from "../hooks/useOriginSelectedToken.js"
|
|
|
6
6
|
import { useDestinationSelectedToken } from "../hooks/useDestinationSelectedToken.js"
|
|
7
7
|
import { useBalanceVisible } from "../hooks/useBalanceVisible.js"
|
|
8
8
|
import { useTokenList } from "../hooks/useTokenList.js"
|
|
9
|
+
import { useRecentTokens } from "../hooks/useRecentTokens.js"
|
|
10
|
+
import { useDefaultTokenSelection } from "../hooks/useDefaultTokenSelection.js" // Context version
|
|
9
11
|
import { ScreenHeader } from "./ScreenHeader.js"
|
|
10
12
|
import { TokenSelector } from "./TokenSelector.js"
|
|
11
13
|
import { ChainList } from "./ChainList.js"
|
|
@@ -66,9 +68,14 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
66
68
|
const { setSelectedToken: setDestinationTokenFromHook } =
|
|
67
69
|
useDestinationSelectedToken()
|
|
68
70
|
const { isBalanceVisible } = useBalanceVisible()
|
|
71
|
+
const { recentTokens, addRecentToken } = useRecentTokens(account?.address)
|
|
72
|
+
|
|
73
|
+
// Use new default token selection hook
|
|
74
|
+
const { defaultOriginToken, isLoading: isLoadingDefaults } =
|
|
75
|
+
useDefaultTokenSelection()
|
|
69
76
|
|
|
70
77
|
// Get sorted tokens to auto-select the highest USD value token
|
|
71
|
-
const { filteredTokensFormatted
|
|
78
|
+
const { filteredTokensFormatted } = useTokenList({
|
|
72
79
|
onContinue: () => {}, // Not used for auto-selection
|
|
73
80
|
onError: () => {}, // Not used for auto-selection
|
|
74
81
|
fundMethod: undefined,
|
|
@@ -135,31 +142,24 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
135
142
|
// Get real token prices from useSendForm (no more mock prices)
|
|
136
143
|
// The useSendForm hook provides real amountUsdDisplay
|
|
137
144
|
|
|
138
|
-
// Auto-select
|
|
145
|
+
// Auto-select source token using new hook
|
|
139
146
|
useEffect(() => {
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
contractInfo: {
|
|
150
|
-
decimals: highestValueToken.contractInfo?.decimals || 18,
|
|
151
|
-
contractAddress: highestValueToken.contractAddress,
|
|
152
|
-
symbol: highestValueToken.symbol,
|
|
153
|
-
name: highestValueToken.name,
|
|
154
|
-
},
|
|
155
|
-
} as any)
|
|
156
|
-
}
|
|
147
|
+
if (!selectedToken && !isLoadingDefaults && defaultOriginToken) {
|
|
148
|
+
logger.console.log(
|
|
149
|
+
"[trails-sdk] Auto-selecting source token:",
|
|
150
|
+
defaultOriginToken,
|
|
151
|
+
)
|
|
152
|
+
setSelectedToken(defaultOriginToken as any)
|
|
153
|
+
|
|
154
|
+
// Add to recent tokens
|
|
155
|
+
addRecentToken(defaultOriginToken as any)
|
|
157
156
|
}
|
|
158
157
|
}, [
|
|
159
158
|
selectedToken,
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
isLoadingDefaults,
|
|
160
|
+
defaultOriginToken,
|
|
162
161
|
setSelectedToken,
|
|
162
|
+
addRecentToken,
|
|
163
163
|
])
|
|
164
164
|
|
|
165
165
|
// Auto-focus input field when selectedToken is available
|
|
@@ -301,7 +301,7 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
301
301
|
// Handle source token selection from full-screen selector
|
|
302
302
|
const handleSourceTokenSelectorSelect = useCallback(
|
|
303
303
|
(token: any) => {
|
|
304
|
-
|
|
304
|
+
const formattedToken = {
|
|
305
305
|
...token,
|
|
306
306
|
decimals: token.contractInfo?.decimals || token.decimals,
|
|
307
307
|
contractInfo: {
|
|
@@ -310,14 +310,19 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
310
310
|
symbol: token.symbol,
|
|
311
311
|
name: token.name,
|
|
312
312
|
},
|
|
313
|
-
}
|
|
313
|
+
}
|
|
314
|
+
setSelectedToken(formattedToken)
|
|
314
315
|
setShowSourceTokenSelector(false)
|
|
316
|
+
|
|
317
|
+
// Add to recent tokens
|
|
318
|
+
addRecentToken(formattedToken)
|
|
319
|
+
|
|
315
320
|
logger.console.log(
|
|
316
321
|
"[trails-sdk] selected source token from selector in SimpleSwap",
|
|
317
322
|
token,
|
|
318
323
|
)
|
|
319
324
|
},
|
|
320
|
-
[setSelectedToken],
|
|
325
|
+
[setSelectedToken, addRecentToken],
|
|
321
326
|
)
|
|
322
327
|
|
|
323
328
|
// Handle destination token selection from full-screen selector
|
|
@@ -347,6 +352,10 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
347
352
|
}
|
|
348
353
|
|
|
349
354
|
setShowDestinationTokenSelector(false)
|
|
355
|
+
|
|
356
|
+
// Add to recent tokens
|
|
357
|
+
addRecentToken(formattedToken)
|
|
358
|
+
|
|
350
359
|
logger.console.log(
|
|
351
360
|
"[trails-sdk] selected destination token from selector in SimpleSwap",
|
|
352
361
|
token,
|
|
@@ -357,6 +366,7 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
357
366
|
setSelectedDestToken,
|
|
358
367
|
setDestinationTokenFromHook,
|
|
359
368
|
setSelectedDestinationChain,
|
|
369
|
+
addRecentToken,
|
|
360
370
|
],
|
|
361
371
|
)
|
|
362
372
|
|
|
@@ -425,6 +435,10 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
425
435
|
setSelectedDestinationChain(chainInfo)
|
|
426
436
|
}
|
|
427
437
|
}
|
|
438
|
+
|
|
439
|
+
// Add both tokens to recent tokens when swapping
|
|
440
|
+
addRecentToken(newSourceToken as any)
|
|
441
|
+
addRecentToken(newDestToken as any)
|
|
428
442
|
logger.console.log("[trails-sdk] swapped tokens in SimpleSwap", {
|
|
429
443
|
originalSource: tempToken,
|
|
430
444
|
originalDest: selectedDestToken,
|
|
@@ -441,8 +455,29 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
441
455
|
setDestinationTokenFromHook,
|
|
442
456
|
filteredTokensFormatted,
|
|
443
457
|
setSelectedDestinationChain,
|
|
458
|
+
addRecentToken,
|
|
444
459
|
])
|
|
445
460
|
|
|
461
|
+
// Handle recent token selection
|
|
462
|
+
const handleRecentTokenSelect = useCallback(
|
|
463
|
+
(token: any) => {
|
|
464
|
+
// For source token selection
|
|
465
|
+
if (showSourceTokenSelector) {
|
|
466
|
+
handleSourceTokenSelectorSelect(token)
|
|
467
|
+
}
|
|
468
|
+
// For destination token selection
|
|
469
|
+
else if (showDestinationTokenSelector) {
|
|
470
|
+
handleDestinationTokenSelectorSelect(token)
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
[
|
|
474
|
+
showSourceTokenSelector,
|
|
475
|
+
showDestinationTokenSelector,
|
|
476
|
+
handleSourceTokenSelectorSelect,
|
|
477
|
+
handleDestinationTokenSelectorSelect,
|
|
478
|
+
],
|
|
479
|
+
)
|
|
480
|
+
|
|
446
481
|
// Handle input type toggle (USD vs Token)
|
|
447
482
|
const handleInputTypeToggle = useCallback(() => {
|
|
448
483
|
// Use tokenAmountForBackend as the source of truth for conversion
|
|
@@ -498,25 +533,6 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
498
533
|
}
|
|
499
534
|
}, [displayAmount.length])
|
|
500
535
|
|
|
501
|
-
// Get unique chains from filtered tokens for chain list
|
|
502
|
-
const uniqueChains = useMemo(() => {
|
|
503
|
-
if (!filteredTokensFormatted?.length) return []
|
|
504
|
-
|
|
505
|
-
const chainIds = new Set(
|
|
506
|
-
filteredTokensFormatted.map((token) => token.chainId),
|
|
507
|
-
)
|
|
508
|
-
return Array.from(chainIds)
|
|
509
|
-
.map((chainId) => {
|
|
510
|
-
const chainInfo = getChainInfo(chainId)
|
|
511
|
-
return {
|
|
512
|
-
chainId,
|
|
513
|
-
name: chainInfo?.name || `Chain ${chainId}`,
|
|
514
|
-
imageUrl: "", // We'll use ChainImage component for chain icons
|
|
515
|
-
}
|
|
516
|
-
})
|
|
517
|
-
.sort((a, b) => a.name.localeCompare(b.name))
|
|
518
|
-
}, [filteredTokensFormatted])
|
|
519
|
-
|
|
520
536
|
logger.console.log("[trails-sdk] SimpleSwap", {
|
|
521
537
|
tokenAmountForBackend,
|
|
522
538
|
displayAmount,
|
|
@@ -551,7 +567,6 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
551
567
|
if (showSourceChainList) {
|
|
552
568
|
return (
|
|
553
569
|
<ChainList
|
|
554
|
-
chains={uniqueChains}
|
|
555
570
|
onBack={() => {
|
|
556
571
|
setShowSourceChainList(false)
|
|
557
572
|
setShowSourceTokenSelector(true)
|
|
@@ -582,6 +597,8 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
582
597
|
setShowSourceTokenSelector(false)
|
|
583
598
|
setShowSourceChainList(true)
|
|
584
599
|
}}
|
|
600
|
+
recentTokens={recentTokens}
|
|
601
|
+
onRecentTokenSelect={handleRecentTokenSelect}
|
|
585
602
|
/>
|
|
586
603
|
</div>
|
|
587
604
|
)
|
|
@@ -591,7 +608,6 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
591
608
|
if (showDestinationChainList) {
|
|
592
609
|
return (
|
|
593
610
|
<ChainList
|
|
594
|
-
chains={uniqueChains}
|
|
595
611
|
onBack={() => {
|
|
596
612
|
setShowDestinationChainList(false)
|
|
597
613
|
setShowDestinationTokenSelector(true)
|
|
@@ -622,6 +638,8 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
622
638
|
setShowDestinationTokenSelector(false)
|
|
623
639
|
setShowDestinationChainList(true)
|
|
624
640
|
}}
|
|
641
|
+
recentTokens={recentTokens}
|
|
642
|
+
onRecentTokenSelect={handleRecentTokenSelect}
|
|
625
643
|
/>
|
|
626
644
|
</div>
|
|
627
645
|
)
|
|
@@ -644,7 +662,7 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
644
662
|
<button
|
|
645
663
|
type="button"
|
|
646
664
|
onClick={() => setShowSourceTokenSelector(true)}
|
|
647
|
-
className="w-full flex items-center justify-between space-x-3 trails-
|
|
665
|
+
className="w-full flex items-center justify-between space-x-3 trails-list-item trails-border-radius-list-button px-4 py-2 transition-all duration-200 cursor-pointer"
|
|
648
666
|
>
|
|
649
667
|
<div className="flex items-center space-x-3 flex-1">
|
|
650
668
|
<div className="w-6 h-6 rounded-full bg-gray-100 dark:bg-gray-700 flex items-center justify-center">
|
|
@@ -782,7 +800,7 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
782
800
|
<button
|
|
783
801
|
type="button"
|
|
784
802
|
onClick={() => setShowSourceTokenSelector(true)}
|
|
785
|
-
className="w-full flex items-center justify-between space-x-3
|
|
803
|
+
className="w-full flex items-center justify-between space-x-3 trails-list-item hover:scale-[1.01] trails-border-radius-list-button px-4 py-2 transition-all duration-200 cursor-pointer"
|
|
786
804
|
>
|
|
787
805
|
<div className="flex items-center space-x-3 flex-1">
|
|
788
806
|
{selectedToken ? (
|
|
@@ -856,7 +874,7 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
856
874
|
<button
|
|
857
875
|
type="button"
|
|
858
876
|
onClick={() => setShowDestinationTokenSelector(true)}
|
|
859
|
-
className="w-full flex items-center justify-between space-x-3
|
|
877
|
+
className="w-full flex items-center justify-between space-x-3 trails-list-item hover:scale-[1.01] trails-border-radius-list-button px-4 py-2 transition-all duration-200 cursor-pointer"
|
|
860
878
|
>
|
|
861
879
|
<div className="flex items-center space-x-3 flex-1">
|
|
862
880
|
{selectedDestToken ? (
|
|
@@ -913,16 +931,7 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
913
931
|
/>
|
|
914
932
|
)}
|
|
915
933
|
|
|
916
|
-
|
|
917
|
-
{prepareSendQuote && (
|
|
918
|
-
<div className="space-y-2">
|
|
919
|
-
<QuoteDetails
|
|
920
|
-
quote={prepareSendQuote}
|
|
921
|
-
showContent={true}
|
|
922
|
-
swapMode={true}
|
|
923
|
-
/>
|
|
924
|
-
</div>
|
|
925
|
-
)}
|
|
934
|
+
<div className="py-2"></div>
|
|
926
935
|
|
|
927
936
|
{/* Swap Button */}
|
|
928
937
|
<form onSubmit={handleSubmit}>
|
|
@@ -959,6 +968,13 @@ export const SimpleSwap: React.FC<SimpleSwapProps> = ({
|
|
|
959
968
|
)}
|
|
960
969
|
</button>
|
|
961
970
|
</form>
|
|
971
|
+
|
|
972
|
+
{/* Quote Details */}
|
|
973
|
+
{prepareSendQuote && (
|
|
974
|
+
<div className="space-y-2">
|
|
975
|
+
<QuoteDetails quote={prepareSendQuote} showContent={true} />
|
|
976
|
+
</div>
|
|
977
|
+
)}
|
|
962
978
|
</div>
|
|
963
979
|
</div>
|
|
964
980
|
)
|