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,7 +6,7 @@ import {
|
|
|
6
6
|
ChevronDown,
|
|
7
7
|
Loader2,
|
|
8
8
|
} from "lucide-react"
|
|
9
|
-
import { useEffect, useState,
|
|
9
|
+
import { useEffect, useState, useRef } from "react"
|
|
10
10
|
import type React from "react"
|
|
11
11
|
import type { Account, WalletClient } from "viem"
|
|
12
12
|
import type { TransactionState } from "../../transactions.js"
|
|
@@ -26,7 +26,6 @@ import { ScreenHeader } from "./ScreenHeader.js"
|
|
|
26
26
|
import { ChainList } from "./ChainList.js"
|
|
27
27
|
import { QuoteDetails } from "./QuoteDetails.js"
|
|
28
28
|
import { formatTvl } from "../../prices.js"
|
|
29
|
-
import { getChainInfo } from "../../chains.js"
|
|
30
29
|
import { getExplorerUrlForAddress } from "../../explorer.js"
|
|
31
30
|
import { formatUsdAmountDisplay } from "../../tokenBalances.js"
|
|
32
31
|
import { MINIMUM_USD_AMOUNT_FOR_SWAP } from "../../constants.js"
|
|
@@ -154,10 +153,13 @@ export const Earn: React.FC<EarnProps> = ({
|
|
|
154
153
|
) {
|
|
155
154
|
const highestValueToken = filteredTokensFormatted[0] // First token is highest USD value
|
|
156
155
|
if (highestValueToken && Number(highestValueToken.balanceUsd) > 0) {
|
|
156
|
+
const decimals =
|
|
157
|
+
highestValueToken.contractInfo?.decimals ??
|
|
158
|
+
(highestValueToken as any)?.decimals
|
|
157
159
|
setOriginToken({
|
|
158
160
|
...highestValueToken,
|
|
159
161
|
contractInfo: {
|
|
160
|
-
decimals
|
|
162
|
+
decimals,
|
|
161
163
|
contractAddress: highestValueToken.contractAddress,
|
|
162
164
|
symbol: highestValueToken.symbol,
|
|
163
165
|
name: highestValueToken.name,
|
|
@@ -174,25 +176,6 @@ export const Earn: React.FC<EarnProps> = ({
|
|
|
174
176
|
}
|
|
175
177
|
}, [])
|
|
176
178
|
|
|
177
|
-
// Get unique chains from filtered tokens for chain list
|
|
178
|
-
const uniqueChains = useMemo(() => {
|
|
179
|
-
if (!filteredTokensFormatted?.length) return []
|
|
180
|
-
|
|
181
|
-
const chainIds = new Set(
|
|
182
|
-
filteredTokensFormatted.map((token) => token.chainId),
|
|
183
|
-
)
|
|
184
|
-
return Array.from(chainIds)
|
|
185
|
-
.map((chainId) => {
|
|
186
|
-
const chainInfo = getChainInfo(chainId)
|
|
187
|
-
return {
|
|
188
|
-
chainId,
|
|
189
|
-
name: chainInfo?.name || `Chain ${chainId}`,
|
|
190
|
-
imageUrl: "", // We'll use ChainImage component for chain icons
|
|
191
|
-
}
|
|
192
|
-
})
|
|
193
|
-
.sort((a, b) => a.name.localeCompare(b.name))
|
|
194
|
-
}, [filteredTokensFormatted])
|
|
195
|
-
|
|
196
179
|
const handleAmountChange = (value: string) => {
|
|
197
180
|
// Validate decimal places (max 8 decimals)
|
|
198
181
|
const decimalMatch = value.match(/^\d*\.?\d{0,8}$/)
|
|
@@ -256,7 +239,6 @@ export const Earn: React.FC<EarnProps> = ({
|
|
|
256
239
|
if (showOriginChainList) {
|
|
257
240
|
return (
|
|
258
241
|
<ChainList
|
|
259
|
-
chains={uniqueChains}
|
|
260
242
|
onBack={() => {
|
|
261
243
|
setShowOriginChainList(false)
|
|
262
244
|
setShowOriginTokenSelector(true)
|
|
@@ -313,7 +295,7 @@ export const Earn: React.FC<EarnProps> = ({
|
|
|
313
295
|
|
|
314
296
|
<div className="space-y-1">
|
|
315
297
|
{/* Origin Token Selection */}
|
|
316
|
-
<div className="trails-bg-secondary trails-border-radius-container p-3 group transition-all duration-200 border border-transparent
|
|
298
|
+
<div className="trails-bg-secondary trails-bg-secondary-hover trails-border-radius-container p-3 group transition-all duration-200 border border-transparent focus-within:!bg-white dark:focus-within:!bg-gray-800 trails-focus-border-secondary">
|
|
317
299
|
{/* Deposit Label and Percentage Buttons */}
|
|
318
300
|
<div className="flex justify-between items-center mb-2">
|
|
319
301
|
<div className="text-sm font-semibold trails-text-secondary text-left">
|
|
@@ -372,14 +354,14 @@ export const Earn: React.FC<EarnProps> = ({
|
|
|
372
354
|
style={{
|
|
373
355
|
fontSize:
|
|
374
356
|
amount.length > 12
|
|
375
|
-
? "
|
|
357
|
+
? "0.875rem"
|
|
376
358
|
: amount.length > 9
|
|
377
|
-
? "
|
|
359
|
+
? "1rem"
|
|
378
360
|
: amount.length > 6
|
|
379
|
-
? "1.
|
|
361
|
+
? "1.125rem"
|
|
380
362
|
: amount.length > 3
|
|
381
|
-
? "1.
|
|
382
|
-
: "
|
|
363
|
+
? "1.25rem"
|
|
364
|
+
: "1.5rem",
|
|
383
365
|
width: `${Math.max((amount || "0").length, 1)}ch`,
|
|
384
366
|
minWidth: "1ch",
|
|
385
367
|
maxWidth: "270px",
|
|
@@ -394,15 +376,15 @@ export const Earn: React.FC<EarnProps> = ({
|
|
|
394
376
|
style={{
|
|
395
377
|
fontSize:
|
|
396
378
|
amount.length > 12
|
|
397
|
-
? "
|
|
379
|
+
? "0.875rem"
|
|
398
380
|
: amount.length > 9
|
|
399
|
-
? "
|
|
381
|
+
? "1rem"
|
|
400
382
|
: amount.length > 6
|
|
401
|
-
? "1.
|
|
383
|
+
? "1.125rem"
|
|
402
384
|
: amount.length > 3
|
|
403
|
-
? "1.
|
|
404
|
-
: "
|
|
405
|
-
marginLeft:
|
|
385
|
+
? "1.25rem"
|
|
386
|
+
: "1.5rem",
|
|
387
|
+
marginLeft: "0.1em",
|
|
406
388
|
padding: "0",
|
|
407
389
|
transition: "all 0.2s ease-in-out",
|
|
408
390
|
}}
|
|
@@ -486,110 +468,120 @@ export const Earn: React.FC<EarnProps> = ({
|
|
|
486
468
|
|
|
487
469
|
{/* Arrow Down Between Sections */}
|
|
488
470
|
<div className="relative">
|
|
489
|
-
<div className="absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2 p-1.5 trails-border-radius-button trails-bg-tertiary transition-colors
|
|
490
|
-
<ArrowDown
|
|
471
|
+
<div className="absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2 p-1.5 trails-border-radius-button trails-bg-tertiary transition-colors border-2 border-white dark:border-gray-800 z-1">
|
|
472
|
+
<ArrowDown
|
|
473
|
+
className="w-5 h-5 text-gray-900 dark:text-white"
|
|
474
|
+
strokeWidth={2.5}
|
|
475
|
+
/>
|
|
491
476
|
</div>
|
|
492
477
|
</div>
|
|
493
478
|
|
|
494
479
|
{/* Destination Vault Selection */}
|
|
495
480
|
<div className="trails-bg-secondary trails-border-radius-container transition-all duration-200 border border-transparent hover:!bg-white dark:hover:!bg-white hover:border-gray-400 dark:hover:border-gray-500">
|
|
496
481
|
{selectedPool ? (
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
<div className="flex items-center
|
|
500
|
-
<div className="
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
</a>
|
|
530
|
-
) : (
|
|
531
|
-
selectedPool.name
|
|
532
|
-
)}
|
|
533
|
-
</h3>
|
|
534
|
-
<div className="flex items-center space-x-2">
|
|
535
|
-
<span className="text-xs text-gray-500 dark:text-gray-400 flex items-center">
|
|
536
|
-
{selectedPool.protocol === "Aave" && (
|
|
537
|
-
<img
|
|
538
|
-
src={aaveLogo}
|
|
539
|
-
alt="Aave"
|
|
540
|
-
className="w-3 h-3 mr-1"
|
|
541
|
-
/>
|
|
542
|
-
)}
|
|
543
|
-
{selectedPool.protocol === "Morpho" && (
|
|
544
|
-
<img
|
|
545
|
-
src={morphoLogo}
|
|
546
|
-
alt="Morpho"
|
|
547
|
-
className="w-3 h-3 mr-1"
|
|
548
|
-
/>
|
|
549
|
-
)}
|
|
550
|
-
{selectedPool.protocolUrl ? (
|
|
482
|
+
<div className="p-3 trails-border-radius-container trails-bg-secondary transition-all overflow-hidden">
|
|
483
|
+
{/* Vault Label */}
|
|
484
|
+
<div className="flex justify-between items-center mb-2">
|
|
485
|
+
<div className="text-sm font-semibold trails-text-secondary text-left">
|
|
486
|
+
Vault
|
|
487
|
+
</div>
|
|
488
|
+
</div>
|
|
489
|
+
|
|
490
|
+
<div className="px-1">
|
|
491
|
+
<div className="flex items-center justify-between">
|
|
492
|
+
<div className="flex items-center space-x-3">
|
|
493
|
+
<div style={{ width: "32px", height: "32px" }}>
|
|
494
|
+
<a
|
|
495
|
+
href={getExplorerUrlForAddress({
|
|
496
|
+
address: selectedPool.token.address,
|
|
497
|
+
chainId: selectedPool.chainId,
|
|
498
|
+
})}
|
|
499
|
+
target="_blank"
|
|
500
|
+
rel="noopener noreferrer"
|
|
501
|
+
className="cursor-pointer"
|
|
502
|
+
>
|
|
503
|
+
<TokenImage
|
|
504
|
+
symbol={selectedPool.token.symbol}
|
|
505
|
+
imageUrl={selectedPool.token.logoUrl}
|
|
506
|
+
chainId={selectedPool.chainId}
|
|
507
|
+
size={32}
|
|
508
|
+
/>
|
|
509
|
+
</a>
|
|
510
|
+
</div>
|
|
511
|
+
<div>
|
|
512
|
+
<h3 className="font-medium text-gray-900 dark:text-white text-sm">
|
|
513
|
+
{selectedPool.poolUrl ? (
|
|
551
514
|
<a
|
|
552
|
-
href={selectedPool.
|
|
515
|
+
href={selectedPool.poolUrl}
|
|
553
516
|
target="_blank"
|
|
554
517
|
rel="noopener noreferrer"
|
|
555
518
|
className="hover:underline cursor-pointer"
|
|
556
519
|
>
|
|
557
|
-
{selectedPool.
|
|
520
|
+
{selectedPool.name}
|
|
558
521
|
</a>
|
|
559
522
|
) : (
|
|
560
|
-
selectedPool.
|
|
523
|
+
selectedPool.name
|
|
561
524
|
)}
|
|
562
|
-
</
|
|
525
|
+
</h3>
|
|
526
|
+
<div className="flex items-center space-x-2">
|
|
527
|
+
<span className="text-xs text-gray-500 dark:text-gray-400 flex items-center">
|
|
528
|
+
{selectedPool.protocol === "Aave" && (
|
|
529
|
+
<img
|
|
530
|
+
src={aaveLogo}
|
|
531
|
+
alt="Aave"
|
|
532
|
+
className="w-3 h-3 mr-1"
|
|
533
|
+
/>
|
|
534
|
+
)}
|
|
535
|
+
{selectedPool.protocol === "Morpho" && (
|
|
536
|
+
<img
|
|
537
|
+
src={morphoLogo}
|
|
538
|
+
alt="Morpho"
|
|
539
|
+
className="w-3 h-3 mr-1"
|
|
540
|
+
/>
|
|
541
|
+
)}
|
|
542
|
+
{selectedPool.protocolUrl ? (
|
|
543
|
+
<a
|
|
544
|
+
href={selectedPool.protocolUrl}
|
|
545
|
+
target="_blank"
|
|
546
|
+
rel="noopener noreferrer"
|
|
547
|
+
className="hover:underline cursor-pointer"
|
|
548
|
+
>
|
|
549
|
+
{selectedPool.protocol}
|
|
550
|
+
</a>
|
|
551
|
+
) : (
|
|
552
|
+
selectedPool.protocol
|
|
553
|
+
)}
|
|
554
|
+
</span>
|
|
555
|
+
</div>
|
|
563
556
|
</div>
|
|
564
557
|
</div>
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
</
|
|
558
|
+
<button
|
|
559
|
+
type="button"
|
|
560
|
+
title="Select Vault"
|
|
561
|
+
onClick={() => setShowEarnPools(true)}
|
|
562
|
+
className="text-right flex items-center space-x-3 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 rounded p-2 transition-colors"
|
|
563
|
+
>
|
|
564
|
+
<div>
|
|
565
|
+
<div className="flex items-center justify-end space-x-1 text-green-600 dark:text-green-400 mb-1 whitespace-nowrap">
|
|
566
|
+
<TrendingUp className="w-3 h-3" />
|
|
567
|
+
<span className="font-semibold text-sm">
|
|
568
|
+
{selectedPool.apy.toFixed(1)}% APY
|
|
569
|
+
</span>
|
|
570
|
+
</div>
|
|
571
|
+
<p className="text-xs text-gray-500 dark:text-gray-400 whitespace-nowrap">
|
|
572
|
+
TVL: {formatTvl(selectedPool.tvl)}
|
|
573
|
+
</p>
|
|
578
574
|
</div>
|
|
579
|
-
<
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
</div>
|
|
583
|
-
<ChevronRight className="w-4 h-4 text-gray-400" />
|
|
584
|
-
</button>
|
|
575
|
+
<ChevronRight className="w-4 h-4 text-gray-400" />
|
|
576
|
+
</button>
|
|
577
|
+
</div>
|
|
585
578
|
</div>
|
|
586
579
|
</div>
|
|
587
580
|
) : (
|
|
588
|
-
/* Select Vault Button */
|
|
589
581
|
<button
|
|
590
582
|
type="button"
|
|
591
583
|
onClick={() => setShowEarnPools(true)}
|
|
592
|
-
className="w-full py-6 px-4 trails-
|
|
584
|
+
className="w-full py-6 px-4 trails-list-item trails-border-radius-container transition-all duration-200 cursor-pointer"
|
|
593
585
|
>
|
|
594
586
|
<div className="flex items-center justify-between">
|
|
595
587
|
<div className="flex items-center space-x-3 flex-1">
|
|
@@ -147,9 +147,7 @@ export const EarnPools: React.FC<EarnPoolsProps> = ({
|
|
|
147
147
|
|
|
148
148
|
// Show chain list screen
|
|
149
149
|
if (showChainList) {
|
|
150
|
-
return (
|
|
151
|
-
<ChainList chains={uniqueChains} onBack={() => setShowChainList(false)} />
|
|
152
|
-
)
|
|
150
|
+
return <ChainList onBack={() => setShowChainList(false)} />
|
|
153
151
|
}
|
|
154
152
|
|
|
155
153
|
return (
|
|
@@ -230,7 +228,7 @@ export const EarnPools: React.FC<EarnPoolsProps> = ({
|
|
|
230
228
|
whileHover={{ scale: 1 }}
|
|
231
229
|
whileTap={{ scale: 0.99 }}
|
|
232
230
|
onClick={() => onPoolSelect(pool)}
|
|
233
|
-
className="p-4 trails-border-radius-container trails-
|
|
231
|
+
className="p-4 trails-border-radius-container trails-list-item cursor-pointer transition-all overflow-hidden"
|
|
234
232
|
>
|
|
235
233
|
<div className="flex items-center justify-between">
|
|
236
234
|
<div className="flex items-center space-x-3">
|
|
@@ -46,7 +46,7 @@ export const EarnPoolsFilters: React.FC<EarnPoolsFiltersProps> = ({
|
|
|
46
46
|
e.stopPropagation()
|
|
47
47
|
setIsProtocolDropdownOpen(!isProtocolDropdownOpen)
|
|
48
48
|
}}
|
|
49
|
-
className="flex items-center justify-between px-2 py-1.5
|
|
49
|
+
className="flex items-center justify-between px-2 py-1.5 trails-bg-secondary text-gray-700 dark:text-gray-300 rounded-xl hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors cursor-pointer text-xs min-w-[100px]"
|
|
50
50
|
>
|
|
51
51
|
<div className="flex items-center space-x-1">
|
|
52
52
|
{selectedProtocol === "all" ? (
|
|
@@ -72,11 +72,11 @@ export const EarnPoolsFilters: React.FC<EarnPoolsFiltersProps> = ({
|
|
|
72
72
|
{getProtocolDisplay(selectedProtocol)}
|
|
73
73
|
</span>
|
|
74
74
|
</div>
|
|
75
|
-
<ChevronDown className="w-
|
|
75
|
+
<ChevronDown className="w-4 h-4 ml-1" />
|
|
76
76
|
</button>
|
|
77
77
|
|
|
78
78
|
{isProtocolDropdownOpen && (
|
|
79
|
-
<div className="absolute top-full left-0 mt-0.5 w-full
|
|
79
|
+
<div className="absolute top-full left-0 mt-0.5 w-full trails-bg-secondary border border-gray-200 dark:border-gray-700 rounded-xl shadow-lg z-20">
|
|
80
80
|
{protocols.map((protocol) => (
|
|
81
81
|
<button
|
|
82
82
|
key={protocol}
|
|
@@ -115,14 +115,14 @@ export const EarnPoolsFilters: React.FC<EarnPoolsFiltersProps> = ({
|
|
|
115
115
|
e.stopPropagation()
|
|
116
116
|
setIsSortDropdownOpen(!isSortDropdownOpen)
|
|
117
117
|
}}
|
|
118
|
-
className="flex items-center justify-between px-2 py-1.5
|
|
118
|
+
className="flex items-center justify-between px-2 py-1.5 trails-bg-secondary text-gray-700 dark:text-gray-300 rounded-xl hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors cursor-pointer text-xs min-w-[90px]"
|
|
119
119
|
>
|
|
120
120
|
<span className="text-xs font-medium">{getSortDisplay(sortBy)}</span>
|
|
121
|
-
<ChevronDown className="w-
|
|
121
|
+
<ChevronDown className="w-4 h-4 ml-1" />
|
|
122
122
|
</button>
|
|
123
123
|
|
|
124
124
|
{isSortDropdownOpen && (
|
|
125
|
-
<div className="absolute top-full left-0 mt-0.5 w-full
|
|
125
|
+
<div className="absolute top-full left-0 mt-0.5 w-full trails-bg-secondary border border-gray-200 dark:border-gray-700 rounded-xl shadow-lg z-20">
|
|
126
126
|
<button
|
|
127
127
|
type="button"
|
|
128
128
|
onClick={(e) => {
|