0xtrails 0.2.5 → 0.2.6
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/abortController.d.ts +8 -0
- package/dist/abortController.d.ts.map +1 -0
- package/dist/{ccip-CXlshvBY.js → ccip-Xjh9d1gb.js} +7 -7
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/fees.d.ts +19 -0
- package/dist/fees.d.ts.map +1 -0
- package/dist/{index-_QuyGrjU.js → index-BnhdZ8Ho.js} +34769 -34247
- package/dist/index.js +726 -520
- package/dist/prepareSend.d.ts +11 -77
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/transactions.d.ts +4 -2
- package/dist/transactions.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistoryButton.d.ts +4 -0
- package/dist/widget/components/AccountIntentTransactionHistoryButton.d.ts.map +1 -0
- package/dist/widget/components/AccountSettings.d.ts.map +1 -1
- package/dist/widget/components/ChainFilterDropdown.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.d.ts +2 -2
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
- package/dist/widget/components/DynamicInputStyles.d.ts +18 -0
- package/dist/widget/components/DynamicInputStyles.d.ts.map +1 -0
- package/dist/widget/components/Earn.d.ts +2 -2
- package/dist/widget/components/Earn.d.ts.map +1 -1
- package/dist/widget/components/ErrorAnimationIcon.d.ts +2 -0
- package/dist/widget/components/ErrorAnimationIcon.d.ts.map +1 -0
- package/dist/widget/components/FeeBreakdown.d.ts +9 -0
- package/dist/widget/components/FeeBreakdown.d.ts.map +1 -0
- package/dist/widget/components/Fund.d.ts +2 -2
- package/dist/widget/components/Fund.d.ts.map +1 -1
- package/dist/widget/components/FundSwap.d.ts +2 -2
- package/dist/widget/components/FundSwap.d.ts.map +1 -1
- package/dist/widget/components/FundingMethodSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/Identicon.d.ts.map +1 -1
- package/dist/widget/components/MeshConnectExchanges.d.ts +0 -3
- package/dist/widget/components/MeshConnectExchanges.d.ts.map +1 -1
- package/dist/widget/components/Modal.d.ts.map +1 -1
- package/dist/widget/components/Pay.d.ts +2 -2
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/PoolDeposit.d.ts +3 -2
- package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
- package/dist/widget/components/PoolWithdraw.d.ts +3 -2
- package/dist/widget/components/PoolWithdraw.d.ts.map +1 -1
- package/dist/widget/components/QuoteDetails.d.ts +1 -0
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/Receipt.d.ts.map +1 -1
- package/dist/widget/components/RecipientSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/ScreenHeader.d.ts.map +1 -1
- package/dist/widget/components/Swap.d.ts +2 -2
- package/dist/widget/components/Swap.d.ts.map +1 -1
- package/dist/widget/components/ThemeProvider.d.ts.map +1 -1
- package/dist/widget/components/TokenDisplayNonSelectable.d.ts +11 -0
- package/dist/widget/components/TokenDisplayNonSelectable.d.ts.map +1 -0
- package/dist/widget/components/TokenSelector.d.ts.map +1 -1
- package/dist/widget/components/TokenSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/Tooltip.d.ts +9 -0
- package/dist/widget/components/Tooltip.d.ts.map +1 -0
- package/dist/widget/components/WaasFeeOptions.d.ts +1 -0
- package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -1
- package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
- package/dist/widget/components/WalletConnect.d.ts.map +1 -1
- package/dist/widget/css/compiled.css +1 -1
- package/dist/widget/hooks/useQuote.d.ts +83 -0
- package/dist/widget/hooks/useQuote.d.ts.map +1 -0
- package/dist/widget/hooks/useSendForm.d.ts +2 -2
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/index.js +2 -2
- package/dist/widget/widget.d.ts +5 -0
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/abortController.ts +35 -0
- package/src/constants.ts +3 -0
- package/src/fees.ts +199 -0
- package/src/prepareSend.ts +225 -398
- package/src/trails.ts +3 -3
- package/src/transactions.ts +62 -18
- package/src/widget/compiled.css +1 -1
- package/src/widget/components/AccountIntentTransactionHistoryButton.tsx +22 -0
- package/src/widget/components/AccountSettings.tsx +48 -36
- package/src/widget/components/ChainFilterDropdown.tsx +24 -3
- package/src/widget/components/ClassicSwap.tsx +24 -62
- package/src/widget/components/ConnectWallet.tsx +4 -1
- package/src/widget/components/ConnectedWallets.tsx +21 -21
- package/src/widget/components/DynamicInputStyles.tsx +76 -0
- package/src/widget/components/Earn.tsx +34 -29
- package/src/widget/components/ErrorAnimationIcon.tsx +130 -0
- package/src/widget/components/FeeBreakdown.tsx +155 -0
- package/src/widget/components/Fund.tsx +10 -26
- package/src/widget/components/FundSwap.tsx +2 -2
- package/src/widget/components/FundingMethodSelectorButton.tsx +24 -14
- package/src/widget/components/Identicon.tsx +164 -95
- package/src/widget/components/MeshConnectExchanges.tsx +2 -15
- package/src/widget/components/Modal.tsx +0 -12
- package/src/widget/components/Pay.tsx +65 -63
- package/src/widget/components/PoolDeposit.tsx +206 -230
- package/src/widget/components/PoolWithdraw.tsx +219 -238
- package/src/widget/components/PriceImpactWarning.tsx +1 -1
- package/src/widget/components/QuoteDetails.tsx +25 -8
- package/src/widget/components/Receipt.tsx +16 -2
- package/src/widget/components/RecipientSelectorButton.tsx +7 -5
- package/src/widget/components/Recipients.tsx +1 -1
- package/src/widget/components/ScreenHeader.tsx +60 -36
- package/src/widget/components/Swap.tsx +2 -2
- package/src/widget/components/ThemeProvider.tsx +2 -1
- package/src/widget/components/TokenDisplayNonSelectable.tsx +40 -0
- package/src/widget/components/TokenImage.tsx +1 -1
- package/src/widget/components/TokenSelector.tsx +62 -53
- package/src/widget/components/TokenSelectorButton.tsx +38 -15
- package/src/widget/components/Tooltip.tsx +51 -0
- package/src/widget/components/TransferPendingVertical.tsx +1 -1
- package/src/widget/components/WaasFeeOptions.tsx +124 -5
- package/src/widget/components/WalletConfirmation.tsx +23 -13
- package/src/widget/components/WalletConnect.tsx +93 -29
- package/src/widget/hooks/useQuote.ts +413 -0
- package/src/widget/hooks/useSendForm.ts +8 -4
- package/src/widget/widget.tsx +175 -190
|
@@ -35,10 +35,11 @@ import morphoLogo from "../assets/morpho.svg"
|
|
|
35
35
|
import type { PrepareSendQuote } from "../../prepareSend.js"
|
|
36
36
|
import type { SupportedToken } from "../../tokens.js"
|
|
37
37
|
import { logger } from "../../logger.js"
|
|
38
|
+
import { useDynamicInputStyles } from "./DynamicInputStyles.js"
|
|
38
39
|
|
|
39
40
|
interface PoolDepositProps {
|
|
40
|
-
account
|
|
41
|
-
walletClient
|
|
41
|
+
account?: Account
|
|
42
|
+
walletClient?: WalletClient
|
|
42
43
|
onTransactionStateChange: (transactionStates: TransactionState[]) => void
|
|
43
44
|
onError: (error: Error | string | null) => void
|
|
44
45
|
onWaitingForWalletConfirm: (props: PrepareSendQuote) => void
|
|
@@ -63,6 +64,7 @@ interface PoolDepositProps {
|
|
|
63
64
|
recentTokens?: SupportedToken[]
|
|
64
65
|
onRecentTokenSelect?: (token: SupportedToken) => void
|
|
65
66
|
onTrackToken?: (token: any) => void
|
|
67
|
+
onPoolSelectorStateChange?: (isShowing: boolean) => void
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
export const PoolDeposit: React.FC<PoolDepositProps> = ({
|
|
@@ -84,6 +86,7 @@ export const PoolDeposit: React.FC<PoolDepositProps> = ({
|
|
|
84
86
|
recentTokens,
|
|
85
87
|
onRecentTokenSelect,
|
|
86
88
|
onTrackToken,
|
|
89
|
+
onPoolSelectorStateChange,
|
|
87
90
|
}) => {
|
|
88
91
|
const { mode } = useMode()
|
|
89
92
|
const { isBalanceVisible } = useBalanceVisible()
|
|
@@ -180,6 +183,14 @@ export const PoolDeposit: React.FC<PoolDepositProps> = ({
|
|
|
180
183
|
}
|
|
181
184
|
}, [])
|
|
182
185
|
|
|
186
|
+
// Notify parent component about pool selector visibility
|
|
187
|
+
useEffect(() => {
|
|
188
|
+
if (onPoolSelectorStateChange) {
|
|
189
|
+
// Only hide tabs when showing EarnPools selector
|
|
190
|
+
onPoolSelectorStateChange(showEarnPools)
|
|
191
|
+
}
|
|
192
|
+
}, [showEarnPools, onPoolSelectorStateChange])
|
|
193
|
+
|
|
183
194
|
const handleAmountChange = (value: string) => {
|
|
184
195
|
// Validate decimal places (max 8 decimals)
|
|
185
196
|
const decimalMatch = value.match(/^\d*\.?\d{0,8}$/)
|
|
@@ -220,6 +231,12 @@ export const PoolDeposit: React.FC<PoolDepositProps> = ({
|
|
|
220
231
|
setSendFormAmount(selectedAmount)
|
|
221
232
|
}
|
|
222
233
|
|
|
234
|
+
// Dynamic font size based on input length
|
|
235
|
+
const inputStyles = useDynamicInputStyles({
|
|
236
|
+
inputValue: amount,
|
|
237
|
+
variant: "default",
|
|
238
|
+
})
|
|
239
|
+
|
|
223
240
|
if (showOriginChainList) {
|
|
224
241
|
return (
|
|
225
242
|
<ChainList
|
|
@@ -264,268 +281,227 @@ export const PoolDeposit: React.FC<PoolDepositProps> = ({
|
|
|
264
281
|
|
|
265
282
|
return (
|
|
266
283
|
<div className="space-y-2">
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
<div className="
|
|
272
|
-
|
|
273
|
-
From
|
|
274
|
-
</div>
|
|
275
|
-
<FundingMethodSelectorButton />
|
|
284
|
+
{/* Input Section - Amount + Token Selection */}
|
|
285
|
+
<div className="pt-4 pb-4 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 min-h-[120px] flex flex-col">
|
|
286
|
+
{/* Deposit Label */}
|
|
287
|
+
<div className="mb-4 flex justify-between items-center">
|
|
288
|
+
<div className="text-sm font-medium trails-text-secondary text-left m-0">
|
|
289
|
+
{mode === "fund" ? "Payment method" : "From"}
|
|
276
290
|
</div>
|
|
291
|
+
<FundingMethodSelectorButton />
|
|
292
|
+
</div>
|
|
277
293
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
amount.length > 12
|
|
299
|
-
? "0.875rem"
|
|
300
|
-
: amount.length > 9
|
|
301
|
-
? "1rem"
|
|
302
|
-
: amount.length > 6
|
|
303
|
-
? "1.125rem"
|
|
304
|
-
: amount.length > 3
|
|
305
|
-
? "1.25rem"
|
|
306
|
-
: "1.5rem",
|
|
307
|
-
width: `${Math.max((amount || "0").length, 1)}ch`,
|
|
308
|
-
minWidth: "1ch",
|
|
309
|
-
maxWidth: "270px",
|
|
310
|
-
padding: "0",
|
|
311
|
-
margin: "0",
|
|
312
|
-
transition: "all 0.1s ease-in-out",
|
|
313
|
-
}}
|
|
314
|
-
inputMode="decimal"
|
|
315
|
-
/>
|
|
316
|
-
<span
|
|
317
|
-
className="font-bold text-gray-400 dark:text-gray-500"
|
|
318
|
-
style={{
|
|
319
|
-
fontSize:
|
|
320
|
-
amount.length > 12
|
|
321
|
-
? "0.875rem"
|
|
322
|
-
: amount.length > 9
|
|
323
|
-
? "1rem"
|
|
324
|
-
: amount.length > 6
|
|
325
|
-
? "1.125rem"
|
|
326
|
-
: amount.length > 3
|
|
327
|
-
? "1.25rem"
|
|
328
|
-
: "1.5rem",
|
|
329
|
-
marginLeft: "0.1em",
|
|
330
|
-
padding: "0",
|
|
331
|
-
transition: "all 0.2s ease-in-out",
|
|
332
|
-
}}
|
|
333
|
-
>
|
|
334
|
-
{originToken?.symbol.slice(0, 4) || ""}
|
|
335
|
-
</span>
|
|
336
|
-
{isLoadingQuote && (
|
|
337
|
-
<div className="ml-2 animate-spin rounded-full h-4 w-4 border-solid border-b-2 trails-primary" />
|
|
338
|
-
)}
|
|
339
|
-
</div>
|
|
340
|
-
</button>
|
|
294
|
+
<div className="flex items-center space-x-2 flex-1">
|
|
295
|
+
{/* Amount Input */}
|
|
296
|
+
<div className="flex-1">
|
|
297
|
+
<div className="flex items-center space-x-2">
|
|
298
|
+
<input
|
|
299
|
+
ref={inputRef}
|
|
300
|
+
id="amount"
|
|
301
|
+
type="text"
|
|
302
|
+
value={amount}
|
|
303
|
+
onChange={(e) => handleAmountChange(e.target.value)}
|
|
304
|
+
placeholder={"0"}
|
|
305
|
+
className={`w-full bg-transparent font-bold trails-text-primary placeholder:trails-text-muted border-none outline-none ${
|
|
306
|
+
isLoadingQuote ? "animate-pulse" : ""
|
|
307
|
+
}`}
|
|
308
|
+
style={inputStyles}
|
|
309
|
+
inputMode="decimal"
|
|
310
|
+
/>
|
|
311
|
+
{isLoadingQuote && (
|
|
312
|
+
<div className="animate-spin rounded-full h-4 w-4 border-solid border-b-2 trails-primary" />
|
|
313
|
+
)}
|
|
341
314
|
</div>
|
|
315
|
+
</div>
|
|
342
316
|
|
|
343
|
-
|
|
317
|
+
{/* Token Selection Button */}
|
|
318
|
+
<div className="relative">
|
|
344
319
|
<TokenSelectorButton
|
|
345
320
|
token={originToken}
|
|
346
321
|
chainId={originToken?.chainId}
|
|
347
322
|
onSelect={() => setShowOriginTokenSelector(true)}
|
|
348
323
|
/>
|
|
349
324
|
</div>
|
|
325
|
+
</div>
|
|
350
326
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
) : (
|
|
358
|
-
<span> </span>
|
|
359
|
-
)}
|
|
327
|
+
{/* Bottom Info Row */}
|
|
328
|
+
<div className="mt-4 flex justify-between items-center">
|
|
329
|
+
{/* USD Amount */}
|
|
330
|
+
{originToken?.symbol && (
|
|
331
|
+
<div className="text-xs text-gray-500 dark:text-gray-400">
|
|
332
|
+
≈ {underlyingTokenUsdDisplay || "$0.00"}
|
|
360
333
|
</div>
|
|
334
|
+
)}
|
|
361
335
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
336
|
+
{/* Origin Token Balance and Percentage Buttons */}
|
|
337
|
+
{originToken && balanceFormatted && (
|
|
338
|
+
<div className="flex items-center space-x-2">
|
|
339
|
+
<button
|
|
340
|
+
type="button"
|
|
341
|
+
className="text-xs text-gray-500 dark:text-gray-400 cursor-pointer hover:text-gray-700 dark:hover:text-gray-200 transition-colors bg-transparent border-none p-0"
|
|
342
|
+
onClick={() => handleAmountSelect(balanceFormatted || "0")}
|
|
343
|
+
onKeyDown={(e) => {
|
|
344
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
345
|
+
e.preventDefault()
|
|
346
|
+
handleAmountSelect(balanceFormatted || "0")
|
|
347
|
+
}
|
|
348
|
+
}}
|
|
349
|
+
title="Click to use full balance"
|
|
350
|
+
>
|
|
351
|
+
Balance:{" "}
|
|
352
|
+
{isBalanceVisible ? balanceFormatted || "0.00" : "••••••"}
|
|
353
|
+
</button>
|
|
380
354
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
</div>
|
|
355
|
+
{/* Percentage Buttons */}
|
|
356
|
+
<PercentageMaxButtons
|
|
357
|
+
userBalance={balanceFormatted}
|
|
358
|
+
isNativeToken={originToken.contractAddress === zeroAddress}
|
|
359
|
+
gasCostFormatted={prepareSendQuote?.gasCostFormatted}
|
|
360
|
+
chainId={originToken.chainId}
|
|
361
|
+
onAmountSelect={handleAmountSelect}
|
|
362
|
+
className="opacity-100"
|
|
363
|
+
/>
|
|
364
|
+
</div>
|
|
365
|
+
)}
|
|
393
366
|
</div>
|
|
367
|
+
</div>
|
|
394
368
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
369
|
+
{/* Flip Button - Absolutely Positioned */}
|
|
370
|
+
<div className="relative">
|
|
371
|
+
<button
|
|
372
|
+
type="button"
|
|
373
|
+
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 hover:trails-hover-bg transition-colors cursor-pointer border-2 border-white dark:border-gray-800"
|
|
374
|
+
>
|
|
375
|
+
<ArrowDown
|
|
376
|
+
className="w-5 h-5 text-gray-900 dark:text-white"
|
|
377
|
+
strokeWidth={2.5}
|
|
378
|
+
/>
|
|
379
|
+
</button>
|
|
380
|
+
</div>
|
|
404
381
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
</div>
|
|
382
|
+
{/* Destination Vault Selection */}
|
|
383
|
+
<div className="mb-4 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">
|
|
384
|
+
{selectedPool ? (
|
|
385
|
+
<div className="p-3 trails-border-radius-container trails-bg-secondary transition-all overflow-hidden">
|
|
386
|
+
{/* Vault Label */}
|
|
387
|
+
<div className="flex justify-between items-center mb-2">
|
|
388
|
+
<div className="text-sm font-semibold trails-text-secondary text-left">
|
|
389
|
+
Vault
|
|
414
390
|
</div>
|
|
391
|
+
</div>
|
|
415
392
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
393
|
+
<div className="px-1">
|
|
394
|
+
<div className="flex items-center justify-between">
|
|
395
|
+
<div className="flex items-center space-x-3">
|
|
396
|
+
<div style={{ width: "32px", height: "32px" }}>
|
|
397
|
+
<a
|
|
398
|
+
href={getExplorerUrlForAddress({
|
|
399
|
+
address: selectedPool.token.address,
|
|
400
|
+
chainId: selectedPool.chainId,
|
|
401
|
+
})}
|
|
402
|
+
target="_blank"
|
|
403
|
+
rel="noopener noreferrer"
|
|
404
|
+
className="cursor-pointer"
|
|
405
|
+
>
|
|
406
|
+
<TokenImage
|
|
407
|
+
symbol={selectedPool.token.symbol}
|
|
408
|
+
imageUrl={selectedPool.token.logoUrl}
|
|
409
|
+
chainId={selectedPool.chainId}
|
|
410
|
+
contractAddress={selectedPool.token.address}
|
|
411
|
+
size={32}
|
|
412
|
+
/>
|
|
413
|
+
</a>
|
|
414
|
+
</div>
|
|
415
|
+
<div>
|
|
416
|
+
<h3 className="font-medium text-gray-900 dark:text-white text-sm">
|
|
417
|
+
{selectedPool.poolUrl ? (
|
|
418
|
+
<a
|
|
419
|
+
href={selectedPool.poolUrl}
|
|
420
|
+
target="_blank"
|
|
421
|
+
rel="noopener noreferrer"
|
|
422
|
+
className="hover:underline cursor-pointer"
|
|
423
|
+
>
|
|
424
|
+
{selectedPool.name}
|
|
425
|
+
</a>
|
|
426
|
+
) : (
|
|
427
|
+
selectedPool.name
|
|
428
|
+
)}
|
|
429
|
+
</h3>
|
|
430
|
+
<div className="flex items-center space-x-2">
|
|
431
|
+
<span className="text-xs text-gray-500 dark:text-gray-400 flex items-center">
|
|
432
|
+
{selectedPool.protocol === "Aave" && (
|
|
433
|
+
<img
|
|
434
|
+
src={aaveLogo}
|
|
435
|
+
alt="Aave"
|
|
436
|
+
className="w-3 h-3 mr-1"
|
|
437
|
+
/>
|
|
438
|
+
)}
|
|
439
|
+
{selectedPool.protocol === "Morpho" && (
|
|
440
|
+
<img
|
|
441
|
+
src={morphoLogo}
|
|
442
|
+
alt="Morpho"
|
|
443
|
+
className="w-3 h-3 mr-1"
|
|
444
|
+
/>
|
|
445
|
+
)}
|
|
446
|
+
{selectedPool.protocolUrl ? (
|
|
441
447
|
<a
|
|
442
|
-
href={selectedPool.
|
|
448
|
+
href={selectedPool.protocolUrl}
|
|
443
449
|
target="_blank"
|
|
444
450
|
rel="noopener noreferrer"
|
|
445
451
|
className="hover:underline cursor-pointer"
|
|
446
452
|
>
|
|
447
|
-
{selectedPool.
|
|
453
|
+
{selectedPool.protocol}
|
|
448
454
|
</a>
|
|
449
455
|
) : (
|
|
450
|
-
selectedPool.
|
|
456
|
+
selectedPool.protocol
|
|
451
457
|
)}
|
|
452
|
-
</
|
|
453
|
-
<div className="flex items-center space-x-2">
|
|
454
|
-
<span className="text-xs text-gray-500 dark:text-gray-400 flex items-center">
|
|
455
|
-
{selectedPool.protocol === "Aave" && (
|
|
456
|
-
<img
|
|
457
|
-
src={aaveLogo}
|
|
458
|
-
alt="Aave"
|
|
459
|
-
className="w-3 h-3 mr-1"
|
|
460
|
-
/>
|
|
461
|
-
)}
|
|
462
|
-
{selectedPool.protocol === "Morpho" && (
|
|
463
|
-
<img
|
|
464
|
-
src={morphoLogo}
|
|
465
|
-
alt="Morpho"
|
|
466
|
-
className="w-3 h-3 mr-1"
|
|
467
|
-
/>
|
|
468
|
-
)}
|
|
469
|
-
{selectedPool.protocolUrl ? (
|
|
470
|
-
<a
|
|
471
|
-
href={selectedPool.protocolUrl}
|
|
472
|
-
target="_blank"
|
|
473
|
-
rel="noopener noreferrer"
|
|
474
|
-
className="hover:underline cursor-pointer"
|
|
475
|
-
>
|
|
476
|
-
{selectedPool.protocol}
|
|
477
|
-
</a>
|
|
478
|
-
) : (
|
|
479
|
-
selectedPool.protocol
|
|
480
|
-
)}
|
|
481
|
-
</span>
|
|
482
|
-
</div>
|
|
458
|
+
</span>
|
|
483
459
|
</div>
|
|
484
460
|
</div>
|
|
485
|
-
<button
|
|
486
|
-
type="button"
|
|
487
|
-
title="Select Vault"
|
|
488
|
-
onClick={() => setShowEarnPools(true)}
|
|
489
|
-
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"
|
|
490
|
-
>
|
|
491
|
-
<div>
|
|
492
|
-
<div className="flex items-center justify-end space-x-1 text-green-600 dark:text-green-400 mb-1 whitespace-nowrap">
|
|
493
|
-
<TrendingUp className="w-3 h-3" />
|
|
494
|
-
<span className="font-semibold text-sm">
|
|
495
|
-
{selectedPool.apy.toFixed(1)}% APY
|
|
496
|
-
</span>
|
|
497
|
-
</div>
|
|
498
|
-
<p className="text-xs text-gray-500 dark:text-gray-400 whitespace-nowrap">
|
|
499
|
-
TVL: {formatTvl(selectedPool.tvl)}
|
|
500
|
-
</p>
|
|
501
|
-
</div>
|
|
502
|
-
<ChevronRight className="w-4 h-4 text-gray-400" />
|
|
503
|
-
</button>
|
|
504
461
|
</div>
|
|
462
|
+
<button
|
|
463
|
+
type="button"
|
|
464
|
+
title="Select Vault"
|
|
465
|
+
onClick={() => setShowEarnPools(true)}
|
|
466
|
+
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"
|
|
467
|
+
>
|
|
468
|
+
<div>
|
|
469
|
+
<div className="flex items-center justify-end space-x-1 text-green-600 dark:text-green-400 mb-1 whitespace-nowrap">
|
|
470
|
+
<TrendingUp className="w-3 h-3" />
|
|
471
|
+
<span className="font-semibold text-sm">
|
|
472
|
+
{selectedPool.apy.toFixed(1)}% APY
|
|
473
|
+
</span>
|
|
474
|
+
</div>
|
|
475
|
+
<p className="text-xs text-gray-500 dark:text-gray-400 whitespace-nowrap">
|
|
476
|
+
TVL: {formatTvl(selectedPool.tvl)}
|
|
477
|
+
</p>
|
|
478
|
+
</div>
|
|
479
|
+
<ChevronRight className="w-4 h-4 text-gray-400" />
|
|
480
|
+
</button>
|
|
505
481
|
</div>
|
|
506
482
|
</div>
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
483
|
+
</div>
|
|
484
|
+
) : (
|
|
485
|
+
<button
|
|
486
|
+
type="button"
|
|
487
|
+
onClick={() => setShowEarnPools(true)}
|
|
488
|
+
className="w-full py-6 px-4 trails-list-item trails-border-radius-container transition-all duration-200 cursor-pointer"
|
|
489
|
+
>
|
|
490
|
+
<div className="flex items-center justify-between">
|
|
491
|
+
<div className="flex items-center space-x-3 flex-1">
|
|
492
|
+
<div className="w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 flex items-center justify-center">
|
|
493
|
+
<Search className="w-4 h-4 text-gray-400" />
|
|
494
|
+
</div>
|
|
495
|
+
<div className="text-left flex-1">
|
|
496
|
+
<div className="font-semibold text-gray-900 dark:text-white text-sm">
|
|
497
|
+
Select vault to earn yield with
|
|
522
498
|
</div>
|
|
523
499
|
</div>
|
|
524
|
-
<ChevronRight className="w-4 h-4 trails-text-muted flex-shrink-0" />
|
|
525
500
|
</div>
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
501
|
+
<ChevronRight className="w-4 h-4 trails-text-muted flex-shrink-0" />
|
|
502
|
+
</div>
|
|
503
|
+
</button>
|
|
504
|
+
)}
|
|
529
505
|
</div>
|
|
530
506
|
|
|
531
507
|
{prepareSendQuote?.noSufficientBalance ? (
|
|
@@ -554,7 +530,7 @@ export const PoolDeposit: React.FC<PoolDepositProps> = ({
|
|
|
554
530
|
|
|
555
531
|
{/* Quote Details */}
|
|
556
532
|
{prepareSendQuote && (
|
|
557
|
-
<div className="
|
|
533
|
+
<div className="mb-4">
|
|
558
534
|
<QuoteDetails quote={prepareSendQuote} showContent={true} />
|
|
559
535
|
</div>
|
|
560
536
|
)}
|