0xtrails 0.13.0 → 0.13.2
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/{ccip-Cg9-lJ6K.js → ccip-CT_An6eM.js} +39 -39
- package/dist/chains.d.ts +4 -3
- package/dist/chains.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/customTokens.d.ts.map +1 -1
- package/dist/error.d.ts +1 -0
- package/dist/error.d.ts.map +1 -1
- package/dist/gasless.d.ts +1 -2
- package/dist/gasless.d.ts.map +1 -1
- package/dist/{index-DEojZg7b.js → index-RfqL5Foz.js} +56672 -43550
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +385 -333
- package/dist/intents.d.ts +8 -2
- package/dist/intents.d.ts.map +1 -1
- package/dist/keyMachineClient.d.ts +9 -0
- package/dist/keyMachineClient.d.ts.map +1 -0
- package/dist/keymachine/index.d.ts +14 -0
- package/dist/keymachine/index.d.ts.map +1 -0
- package/dist/keymachine/key-machine.gen.d.ts +461 -0
- package/dist/keymachine/key-machine.gen.d.ts.map +1 -0
- package/dist/onramp/MeshConnectFlow.d.ts +18 -0
- package/dist/onramp/MeshConnectFlow.d.ts.map +1 -0
- package/dist/onramp/MeshConnectIframe.d.ts +13 -0
- package/dist/onramp/MeshConnectIframe.d.ts.map +1 -0
- package/dist/onramp/SendFromExchangeButton.d.ts +16 -0
- package/dist/onramp/SendFromExchangeButton.d.ts.map +1 -0
- package/dist/onramp/TrailsOnRampProvider.d.ts +31 -0
- package/dist/onramp/TrailsOnRampProvider.d.ts.map +1 -0
- package/dist/onramp/index.d.ts +13 -0
- package/dist/onramp/index.d.ts.map +1 -0
- package/dist/onramp/meshconnect.d.ts +30 -0
- package/dist/onramp/meshconnect.d.ts.map +1 -0
- package/dist/onramp/trailsOnramp.d.ts +24 -0
- package/dist/onramp/trailsOnramp.d.ts.map +1 -0
- package/dist/onramp-client/index.d.ts +3 -3
- package/dist/onramp-client/index.d.ts.map +1 -1
- package/dist/paymasterSend.d.ts.map +1 -1
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/query/balance.fetchers.d.ts +31 -2
- package/dist/query/balance.fetchers.d.ts.map +1 -1
- package/dist/query/balance.hooks.d.ts +21 -2
- package/dist/query/balance.hooks.d.ts.map +1 -1
- package/dist/query/balance.queries.d.ts +18 -1
- package/dist/query/balance.queries.d.ts.map +1 -1
- package/dist/query/chains.queries.d.ts.map +1 -1
- package/dist/query/meld.fetchers.d.ts +1 -1
- package/dist/query/meld.fetchers.d.ts.map +1 -1
- package/dist/query/meld.hooks.d.ts +3 -3
- package/dist/query/meld.hooks.d.ts.map +1 -1
- package/dist/query/meld.queries.d.ts +1 -1
- package/dist/query/meld.queries.d.ts.map +1 -1
- package/dist/query/price.fetchers.d.ts +15 -0
- package/dist/query/price.fetchers.d.ts.map +1 -0
- package/dist/query/price.hooks.d.ts +352 -0
- package/dist/query/price.hooks.d.ts.map +1 -0
- package/dist/query/price.queries.d.ts +34 -0
- package/dist/query/price.queries.d.ts.map +1 -0
- package/dist/query/tokenList.queries.d.ts +54 -0
- package/dist/query/tokenList.queries.d.ts.map +1 -0
- package/dist/recover.d.ts +6 -4
- package/dist/recover.d.ts.map +1 -1
- package/dist/tokens.d.ts +13 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +2 -2
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +2 -2
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/standardDeposit.d.ts +1 -1
- package/dist/transactionIntent/deposits/standardDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/intentHandler.d.ts.map +1 -1
- package/dist/transactionIntent/helpers/transactionStateHelpers.d.ts.map +1 -1
- package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +1 -1
- package/dist/transactionIntent/types.d.ts +1 -1
- package/dist/transactionIntent/types.d.ts.map +1 -1
- package/dist/transactions.d.ts +4 -0
- package/dist/transactions.d.ts.map +1 -1
- package/dist/umd/trails.min.js +291 -202
- package/dist/utils/format.d.ts +7 -0
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/walletUtils.d.ts +2 -1
- package/dist/walletUtils.d.ts.map +1 -1
- package/dist/wallets.d.ts +13 -54
- package/dist/wallets.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
- package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
- package/dist/widget/components/DirectTransfer.d.ts +1 -1
- package/dist/widget/components/DirectTransfer.d.ts.map +1 -1
- package/dist/widget/components/EarnPools.d.ts.map +1 -1
- package/dist/widget/components/ExecutionStatusBadge.d.ts.map +1 -1
- package/dist/widget/components/Fund.d.ts.map +1 -1
- package/dist/widget/components/FundMethods.d.ts.map +1 -1
- package/dist/widget/components/HighPriceImpactBlock.d.ts +7 -0
- package/dist/widget/components/HighPriceImpactBlock.d.ts.map +1 -0
- package/dist/widget/components/MeldHistory.d.ts.map +1 -1
- package/dist/widget/components/MeshExchangeSelection.d.ts +11 -0
- package/dist/widget/components/MeshExchangeSelection.d.ts.map +1 -0
- package/dist/widget/components/OnrampHistoryRow.d.ts +1 -1
- package/dist/widget/components/OnrampHistoryRow.d.ts.map +1 -1
- package/dist/widget/components/OnrampProviderConfirmation.d.ts.map +1 -1
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
- package/dist/widget/components/PoolWithdraw.d.ts.map +1 -1
- package/dist/widget/components/QRCodeWalletSelect.d.ts +1 -1
- package/dist/widget/components/QRCodeWalletSelect.d.ts.map +1 -1
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/Receipt.d.ts.map +1 -1
- package/dist/widget/components/Recipients.d.ts.map +1 -1
- package/dist/widget/components/RefundWarning.d.ts.map +1 -1
- package/dist/widget/components/TokenSelector.d.ts.map +1 -1
- package/dist/widget/components/TransactionDetails.d.ts.map +1 -1
- package/dist/widget/components/TransactionHistoryItem.d.ts +2 -0
- package/dist/widget/components/TransactionHistoryItem.d.ts.map +1 -1
- package/dist/widget/components/TransferPendingVertical.d.ts +1 -0
- package/dist/widget/components/TransferPendingVertical.d.ts.map +1 -1
- package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -1
- package/dist/widget/components/WalletConnect.d.ts.map +1 -1
- package/dist/widget/components/WalletImage.d.ts.map +1 -1
- package/dist/widget/components/WalletList.d.ts.map +1 -1
- package/dist/widget/components/Withdraw.d.ts.map +1 -1
- package/dist/widget/css/compiled.css +1 -1
- package/dist/widget/hooks/useAddressWalletIcon.d.ts.map +1 -1
- package/dist/widget/hooks/useCombinedHistory.d.ts +6 -5
- package/dist/widget/hooks/useCombinedHistory.d.ts.map +1 -1
- package/dist/widget/hooks/useCustomTokenSearch.d.ts +6 -1
- package/dist/widget/hooks/useCustomTokenSearch.d.ts.map +1 -1
- package/dist/widget/hooks/useDefaultDestinationToken.d.ts.map +1 -1
- package/dist/widget/hooks/useDefaultOriginToken.d.ts.map +1 -1
- package/dist/widget/hooks/useFiatOnRampCurrencies.d.ts +1 -1
- package/dist/widget/hooks/useFiatOnRampCurrencies.d.ts.map +1 -1
- package/dist/widget/hooks/useGetIntent.d.ts +3 -2
- package/dist/widget/hooks/useGetIntent.d.ts.map +1 -1
- package/dist/widget/hooks/useIntentReceiptBalances.d.ts +1 -1
- package/dist/widget/hooks/useIntentReceiptBalances.d.ts.map +1 -1
- package/dist/widget/hooks/useIntentTransactionHistory.d.ts +3 -2
- package/dist/widget/hooks/useIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/hooks/useMeldTransactionHistory.d.ts +1 -1
- package/dist/widget/hooks/useMeldTransactionHistory.d.ts.map +1 -1
- package/dist/widget/hooks/useMeldTransactionStatus.d.ts +1 -1
- package/dist/widget/hooks/useMeldTransactionStatus.d.ts.map +1 -1
- package/dist/widget/hooks/useOnRampQuote.d.ts +1 -1
- package/dist/widget/hooks/useOnRampQuote.d.ts.map +1 -1
- package/dist/widget/hooks/useOnRampTransactionStatus.d.ts +1 -1
- package/dist/widget/hooks/useOnRampTransactionStatus.d.ts.map +1 -1
- package/dist/widget/hooks/useQuote.d.ts +2 -2
- package/dist/widget/hooks/useQuote.d.ts.map +1 -1
- package/dist/widget/hooks/useSelectedFundMethod.d.ts +7 -0
- package/dist/widget/hooks/useSelectedFundMethod.d.ts.map +1 -1
- package/dist/widget/hooks/useSendForm.d.ts +0 -1
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/hooks/useTokenList.d.ts +7 -1
- package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
- package/dist/widget/hooks/useViewManager.d.ts +1 -1
- package/dist/widget/hooks/useViewManager.d.ts.map +1 -1
- package/dist/widget/index.js +1 -1
- package/dist/widget/providers/TrailsProvider.d.ts +2 -0
- package/dist/widget/providers/TrailsProvider.d.ts.map +1 -1
- package/dist/widget/utils/createWagmiConfig.d.ts +2 -2
- package/dist/widget/utils/createWagmiConfig.d.ts.map +1 -1
- package/dist/widget/utils/fundMethodSwitchState.d.ts +1 -0
- package/dist/widget/utils/fundMethodSwitchState.d.ts.map +1 -1
- package/dist/widget/utils/historyFilters.d.ts +13 -0
- package/dist/widget/utils/historyFilters.d.ts.map +1 -0
- package/dist/widget/utils/meldProviderUtils.d.ts +1 -1
- package/dist/widget/utils/meldProviderUtils.d.ts.map +1 -1
- package/dist/widget/utils/meshSupportedTokens.d.ts +4 -0
- package/dist/widget/utils/meshSupportedTokens.d.ts.map +1 -0
- package/dist/widget/utils/onrampConfig.d.ts +11 -0
- package/dist/widget/utils/onrampConfig.d.ts.map +1 -0
- package/dist/widget/utils/statusLabel.d.ts +2 -0
- package/dist/widget/utils/statusLabel.d.ts.map +1 -0
- package/dist/widget/utils/trailsOnrampConfig.d.ts +18 -0
- package/dist/widget/utils/trailsOnrampConfig.d.ts.map +1 -0
- package/dist/widget/widget.d.ts +24 -8
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +9 -7
- package/src/chains.ts +26 -9
- package/src/constants.ts +2 -0
- package/src/customTokens.ts +22 -7
- package/src/error.ts +7 -0
- package/src/gasless.ts +5 -2
- package/src/index.ts +8 -5
- package/src/intents.ts +56 -60
- package/src/keyMachineClient.ts +29 -0
- package/src/keymachine/index.ts +175 -0
- package/src/keymachine/key-machine.gen.ts +993 -0
- package/src/onramp/MeshConnectFlow.tsx +86 -0
- package/src/onramp/MeshConnectIframe.tsx +661 -0
- package/src/onramp/SendFromExchangeButton.tsx +81 -0
- package/src/onramp/TrailsOnRampProvider.tsx +59 -0
- package/src/onramp/index.ts +31 -0
- package/src/onramp/meshconnect.ts +277 -0
- package/src/onramp/trailsOnramp.tsx +130 -0
- package/src/onramp-client/index.ts +4 -6
- package/src/paymasterSend.ts +0 -5
- package/src/prepareSend.ts +45 -44
- package/src/query/balance.fetchers.ts +172 -17
- package/src/query/balance.hooks.ts +69 -6
- package/src/query/balance.queries.ts +63 -0
- package/src/query/chains.queries.ts +1 -6
- package/src/query/meld.fetchers.ts +1 -1
- package/src/query/meld.hooks.ts +1 -1
- package/src/query/meld.queries.ts +1 -1
- package/src/query/price.fetchers.ts +53 -0
- package/src/query/price.hooks.ts +46 -0
- package/src/query/price.queries.ts +364 -0
- package/src/query/tokenList.queries.ts +118 -0
- package/src/recover.ts +89 -26
- package/src/tokens.ts +108 -26
- package/src/transactionIntent/deposits/depositOrchestrator.ts +11 -11
- package/src/transactionIntent/deposits/gaslessDeposit.ts +38 -39
- package/src/transactionIntent/deposits/standardDeposit.ts +5 -30
- package/src/transactionIntent/handlers/intentHandler.ts +29 -12
- package/src/transactionIntent/helpers/transactionStateHelpers.ts +5 -2
- package/src/transactionIntent/quote/normalizeQuote.ts +11 -5
- package/src/transactionIntent/types.ts +1 -1
- package/src/transactions.ts +5 -1
- package/src/utils/format.ts +85 -1
- package/src/walletUtils.ts +2 -1
- package/src/wallets.ts +184 -380
- package/src/widget/compiled.css +1 -1
- package/src/widget/components/AccountIntentTransactionHistory.tsx +134 -109
- package/src/widget/components/ClassicSwap.tsx +26 -24
- package/src/widget/components/ConnectWallet.tsx +4 -2
- package/src/widget/components/ConnectedWallets.tsx +2 -5
- package/src/widget/components/DirectTransfer.tsx +5 -2
- package/src/widget/components/EarnPools.tsx +1 -2
- package/src/widget/components/ExecutionStatusBadge.tsx +10 -4
- package/src/widget/components/Fund.tsx +169 -110
- package/src/widget/components/FundMethods.tsx +5 -9
- package/src/widget/components/HighPriceImpactBlock.tsx +44 -0
- package/src/widget/components/MeldHistory.tsx +4 -28
- package/src/widget/components/MeshExchangeSelection.tsx +218 -0
- package/src/widget/components/OnrampHistoryRow.tsx +3 -27
- package/src/widget/components/OnrampProviderConfirmation.tsx +0 -25
- package/src/widget/components/Pay.tsx +20 -36
- package/src/widget/components/PoolDeposit.tsx +14 -24
- package/src/widget/components/PoolWithdraw.tsx +1 -63
- package/src/widget/components/QRCodeWalletSelect.tsx +5 -2
- package/src/widget/components/QuoteDetails.tsx +113 -106
- package/src/widget/components/Receipt.tsx +0 -11
- package/src/widget/components/Recipients.tsx +2 -1
- package/src/widget/components/RefundWarning.tsx +5 -10
- package/src/widget/components/ThemeProvider.tsx +4 -4
- package/src/widget/components/TokenSelector.tsx +85 -16
- package/src/widget/components/TransactionDetails.tsx +46 -0
- package/src/widget/components/TransactionHistoryItem.tsx +14 -23
- package/src/widget/components/TransferPendingVertical.tsx +17 -11
- package/src/widget/components/WaasFeeOptions.tsx +4 -42
- package/src/widget/components/WalletConnect.tsx +2 -5
- package/src/widget/components/WalletImage.tsx +6 -18
- package/src/widget/components/WalletList.tsx +1 -1
- package/src/widget/components/Withdraw.tsx +22 -23
- package/src/widget/hooks/useAddressWalletIcon.ts +2 -1
- package/src/widget/hooks/useAmountUsd.ts +1 -1
- package/src/widget/hooks/useCombinedHistory.ts +37 -93
- package/src/widget/hooks/useCustomTokenSearch.tsx +63 -33
- package/src/widget/hooks/useDefaultDestinationToken.tsx +2 -5
- package/src/widget/hooks/useDefaultOriginToken.tsx +2 -5
- package/src/widget/hooks/useFiatOnRampCurrencies.ts +1 -1
- package/src/widget/hooks/useGetIntent.ts +5 -4
- package/src/widget/hooks/useIntentReceiptBalances.ts +3 -3
- package/src/widget/hooks/useIntentTransactionHistory.ts +24 -47
- package/src/widget/hooks/useMeldTransactionHistory.ts +4 -2
- package/src/widget/hooks/useMeldTransactionStatus.ts +13 -11
- package/src/widget/hooks/useOnRampQuote.ts +3 -3
- package/src/widget/hooks/useOnRampTransactionStatus.ts +8 -6
- package/src/widget/hooks/useQuote.ts +56 -48
- package/src/widget/hooks/useSelectedFundMethod.tsx +14 -1
- package/src/widget/hooks/useSendForm.ts +52 -31
- package/src/widget/hooks/useTokenList.ts +209 -140
- package/src/widget/hooks/useTrailsSendTransaction.ts +1 -1
- package/src/widget/hooks/useViewManager.tsx +1 -0
- package/src/widget/providers/TrailsProvider.tsx +5 -0
- package/src/widget/styles.ts +1 -1
- package/src/widget/utils/createWagmiConfig.ts +7 -2
- package/src/widget/utils/fundMethodSwitchState.ts +2 -0
- package/src/widget/utils/historyFilters.ts +157 -0
- package/src/widget/utils/meldProviderUtils.ts +8 -2
- package/src/widget/utils/meshSupportedTokens.ts +28 -0
- package/src/widget/utils/onrampConfig.ts +15 -0
- package/src/widget/utils/statusLabel.ts +3 -0
- package/src/widget/utils/trailsOnrampConfig.ts +39 -0
- package/src/widget/widget.tsx +235 -185
- package/dist/onramp-client/trails-onramp.gen.d.ts +0 -570
- package/dist/onramp-client/trails-onramp.gen.d.ts.map +0 -1
- package/dist/prices.d.ts +0 -34
- package/dist/prices.d.ts.map +0 -1
- package/dist/useGasEstimation.d.ts +0 -34
- package/dist/useGasEstimation.d.ts.map +0 -1
- package/dist/widget/hooks/useCustomTokenFetch.d.ts +0 -19
- package/dist/widget/hooks/useCustomTokenFetch.d.ts.map +0 -1
- package/dist/widget/hooks/useTokenWithFreshBalance.d.ts +0 -18
- package/dist/widget/hooks/useTokenWithFreshBalance.d.ts.map +0 -1
- package/src/onramp-client/trails-onramp.gen.ts +0 -1320
- package/src/prices.ts +0 -528
- package/src/useGasEstimation.ts +0 -147
- package/src/widget/assets/Binance_Icon_Logo.svg +0 -14
- package/src/widget/assets/Bitfinex_Icon_Logo.svg +0 -5
- package/src/widget/assets/Coinbase_Icon_Logo.svg +0 -1
- package/src/widget/assets/WalletConnect-logo-blue-bg.svg +0 -11
- package/src/widget/assets/sequence-logo.svg +0 -15
- package/src/widget/hooks/useCustomTokenFetch.tsx +0 -74
- package/src/widget/hooks/useTokenWithFreshBalance.ts +0 -246
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
TriangleAlert,
|
|
7
7
|
} from "lucide-react"
|
|
8
8
|
import type React from "react"
|
|
9
|
-
import { useCallback, useEffect, useRef, useState } from "react"
|
|
9
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react"
|
|
10
10
|
import { getExplorerUrl, getExplorerUrlForAddress } from "../../explorer.js"
|
|
11
11
|
import { logger } from "../../logger.js"
|
|
12
12
|
import type { MeldQuote } from "../../meld/utils/meld.js"
|
|
@@ -67,6 +67,12 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
|
|
|
67
67
|
const [showCalldata, setShowCalldata] = useState(false)
|
|
68
68
|
const [showOriginRate, setShowOriginRate] = useState(true)
|
|
69
69
|
const [isExpanded, setIsExpanded] = useState(initialExpanded)
|
|
70
|
+
const [prevInitialExpanded, setPrevInitialExpanded] =
|
|
71
|
+
useState(initialExpanded)
|
|
72
|
+
if (initialExpanded !== prevInitialExpanded) {
|
|
73
|
+
setPrevInitialExpanded(initialExpanded)
|
|
74
|
+
setIsExpanded(initialExpanded)
|
|
75
|
+
}
|
|
70
76
|
const containerRef = useRef<HTMLDivElement>(null)
|
|
71
77
|
const { trailsAppUrl } = useTrails()
|
|
72
78
|
const calldataRef = useRef<HTMLDivElement>(null)
|
|
@@ -86,13 +92,6 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
|
|
|
86
92
|
})
|
|
87
93
|
}
|
|
88
94
|
|
|
89
|
-
// Sync with initialExpanded prop changes
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
if (initialExpanded !== undefined) {
|
|
92
|
-
setIsExpanded(initialExpanded)
|
|
93
|
-
}
|
|
94
|
-
}, [initialExpanded])
|
|
95
|
-
|
|
96
95
|
// Notify parent when expansion state changes
|
|
97
96
|
useEffect(() => {
|
|
98
97
|
onExpand?.(isExpanded)
|
|
@@ -132,42 +131,48 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
|
|
|
132
131
|
}
|
|
133
132
|
}, [onRampQuote, quote])
|
|
134
133
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
}, [onRampQuote, quote?.fees, totalOnRampFeeInUsd])
|
|
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])
|
|
165
163
|
|
|
166
164
|
const parseSlippageTolerance = useCallback(() => {
|
|
167
165
|
if (!quote?.slippageTolerance) return null
|
|
168
166
|
return parseFloat(quote.slippageTolerance) * 100
|
|
169
167
|
}, [quote?.slippageTolerance])
|
|
170
168
|
|
|
169
|
+
const protocolVersionDisplay = useMemo(() => {
|
|
170
|
+
const normalized = (quote?.intentProtocol || "v1")
|
|
171
|
+
.replace("_", ".")
|
|
172
|
+
.toUpperCase()
|
|
173
|
+
return normalized.startsWith("V") ? normalized : `V${normalized}`
|
|
174
|
+
}, [quote?.intentProtocol])
|
|
175
|
+
|
|
171
176
|
if (!showContent) return null
|
|
172
177
|
|
|
173
178
|
return (
|
|
@@ -996,38 +1001,40 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
|
|
|
996
1001
|
{/* Custom Calldata */}
|
|
997
1002
|
{quote?.destinationCalldata && (
|
|
998
1003
|
<div className="space-y-2">
|
|
999
|
-
<
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
calldataRef.current
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1004
|
+
<div className="space-y-0.5">
|
|
1005
|
+
<button
|
|
1006
|
+
type="button"
|
|
1007
|
+
onClick={() => {
|
|
1008
|
+
setShowCalldata(!showCalldata)
|
|
1009
|
+
// Auto-scroll to calldata when expanding
|
|
1010
|
+
if (!showCalldata) {
|
|
1011
|
+
setTimeout(() => {
|
|
1012
|
+
if (calldataRef.current) {
|
|
1013
|
+
calldataRef.current.scrollIntoView({
|
|
1014
|
+
behavior: "smooth",
|
|
1015
|
+
block: "nearest",
|
|
1016
|
+
})
|
|
1017
|
+
}
|
|
1018
|
+
}, 150) // Delay to let the expansion animation start
|
|
1019
|
+
}
|
|
1020
|
+
}}
|
|
1021
|
+
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"
|
|
1022
|
+
aria-label={
|
|
1023
|
+
showCalldata
|
|
1024
|
+
? "Hide custom calldata"
|
|
1025
|
+
: "Show custom calldata"
|
|
1013
1026
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
<ChevronDown
|
|
1026
|
-
className={`size-3 transition-transform duration-300 ease-out ${
|
|
1027
|
-
showCalldata ? "rotate-180" : ""
|
|
1028
|
-
}`}
|
|
1029
|
-
/>
|
|
1030
|
-
</button>
|
|
1027
|
+
>
|
|
1028
|
+
<span className="text-[10px]">
|
|
1029
|
+
Includes custom destination calldata
|
|
1030
|
+
</span>
|
|
1031
|
+
<ChevronDown
|
|
1032
|
+
className={`size-3 transition-transform duration-300 ease-out ${
|
|
1033
|
+
showCalldata ? "rotate-180" : ""
|
|
1034
|
+
}`}
|
|
1035
|
+
/>
|
|
1036
|
+
</button>
|
|
1037
|
+
</div>
|
|
1031
1038
|
<div
|
|
1032
1039
|
ref={calldataRef}
|
|
1033
1040
|
className={`overflow-hidden transition-all duration-300 ease-out ${
|
|
@@ -1137,49 +1144,43 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
|
|
|
1137
1144
|
)}
|
|
1138
1145
|
</span>
|
|
1139
1146
|
</div>
|
|
1140
|
-
{hasLiveStates && (
|
|
1147
|
+
{hasLiveStates && hasTxHash && txExplorerUrl && (
|
|
1141
1148
|
<div className="mt-1 flex justify-between items-center">
|
|
1142
1149
|
<span className="text-xs text-gray-600 dark:text-gray-400">
|
|
1143
1150
|
Hash
|
|
1144
1151
|
</span>
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
>
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1152
|
+
<a
|
|
1153
|
+
href={txExplorerUrl}
|
|
1154
|
+
target="_blank"
|
|
1155
|
+
rel="noopener noreferrer"
|
|
1156
|
+
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"
|
|
1157
|
+
>
|
|
1158
|
+
{txHasMetaError && (
|
|
1159
|
+
<svg
|
|
1160
|
+
className="w-4 h-4 text-orange-500"
|
|
1161
|
+
fill="none"
|
|
1162
|
+
viewBox="0 0 24 24"
|
|
1163
|
+
stroke="currentColor"
|
|
1164
|
+
>
|
|
1165
|
+
<title>
|
|
1166
|
+
An internal meta transaction failure
|
|
1167
|
+
occurred
|
|
1168
|
+
</title>
|
|
1169
|
+
<path
|
|
1170
|
+
strokeLinecap="round"
|
|
1171
|
+
strokeLinejoin="round"
|
|
1172
|
+
strokeWidth={2}
|
|
1173
|
+
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"
|
|
1174
|
+
/>
|
|
1175
|
+
</svg>
|
|
1176
|
+
)}
|
|
1177
|
+
<span>
|
|
1178
|
+
{truncateAddress(
|
|
1179
|
+
liveTxState.transactionHash,
|
|
1170
1180
|
)}
|
|
1171
|
-
<span>
|
|
1172
|
-
{truncateAddress(
|
|
1173
|
-
liveTxState.transactionHash,
|
|
1174
|
-
)}
|
|
1175
|
-
</span>
|
|
1176
|
-
<ExternalLink className="w-3 h-3" />
|
|
1177
|
-
</a>
|
|
1178
|
-
) : (
|
|
1179
|
-
<span className="text-xs text-gray-400 dark:text-gray-500">
|
|
1180
|
-
...
|
|
1181
1181
|
</span>
|
|
1182
|
-
|
|
1182
|
+
<ExternalLink className="w-3 h-3" />
|
|
1183
|
+
</a>
|
|
1183
1184
|
</div>
|
|
1184
1185
|
)}
|
|
1185
1186
|
</div>
|
|
@@ -1190,6 +1191,12 @@ export const QuoteDetails: React.FC<QuoteDetailsProps> = ({
|
|
|
1190
1191
|
)
|
|
1191
1192
|
})()}
|
|
1192
1193
|
|
|
1194
|
+
{protocolVersionDisplay.length > 0 && (
|
|
1195
|
+
<div className="pt-1 text-[10px] opacity-50 text-gray-600 dark:text-gray-400">
|
|
1196
|
+
Protocol version: {protocolVersionDisplay}
|
|
1197
|
+
</div>
|
|
1198
|
+
)}
|
|
1199
|
+
|
|
1193
1200
|
{/* Children content */}
|
|
1194
1201
|
{children && <div className="mb-0">{children}</div>}
|
|
1195
1202
|
</div>
|
|
@@ -5,7 +5,6 @@ import { useEffect, useMemo, useState } from "react"
|
|
|
5
5
|
import { useAccount } from "wagmi"
|
|
6
6
|
import { getChainInfo } from "../../chains.js"
|
|
7
7
|
import { getExplorerUrl } from "../../explorer.js"
|
|
8
|
-
import { logger } from "../../logger.js"
|
|
9
8
|
import type { PrepareSendQuote } from "../../prepareSend.js"
|
|
10
9
|
import {
|
|
11
10
|
type TransactionState,
|
|
@@ -302,16 +301,6 @@ export const Receipt: React.FC<ReceiptProps> = ({
|
|
|
302
301
|
isDisplayableTransactionHash(tx.transactionHash),
|
|
303
302
|
)
|
|
304
303
|
|
|
305
|
-
// Log intent ID if available when aborted (for debugging)
|
|
306
|
-
useEffect(() => {
|
|
307
|
-
if (hasAborted && quote?.intentId) {
|
|
308
|
-
logger.console.error(
|
|
309
|
-
"[trails-sdk] Transaction aborted with intent ID:",
|
|
310
|
-
quote.intentId,
|
|
311
|
-
)
|
|
312
|
-
}
|
|
313
|
-
}, [hasAborted, quote?.intentId])
|
|
314
|
-
|
|
315
304
|
if (
|
|
316
305
|
(!finalExplorerUrl && !shouldShowRefundInfo && !hasAnyTransactionHash) ||
|
|
317
306
|
(hasFailedOrAborted && !hasRefunded)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Plus, X } from "lucide-react"
|
|
2
|
+
import { wagmiConnectorToWalletId } from "@0xtrails/wallet-registry"
|
|
2
3
|
import type React from "react"
|
|
3
4
|
import { useCallback, useEffect, useState } from "react"
|
|
4
5
|
import { isAddress } from "viem"
|
|
@@ -6,7 +7,7 @@ import { useAccount, useConnections } from "wagmi"
|
|
|
6
7
|
import { useResolveEnsAddress, useResolveEnsName } from "../../ens.js"
|
|
7
8
|
import { logger } from "../../logger.js"
|
|
8
9
|
import { addressEqual, truncateAddress } from "../../utils/address.js"
|
|
9
|
-
import { useWallets
|
|
10
|
+
import { useWallets } from "../../wallets.js"
|
|
10
11
|
import {
|
|
11
12
|
useViewManager,
|
|
12
13
|
type Mode,
|
|
@@ -9,17 +9,15 @@ interface RefundWarningProps {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export const RefundWarning: React.FC<RefundWarningProps> = ({
|
|
12
|
-
fundMethod,
|
|
13
12
|
isSenderContractOnOrigin,
|
|
14
13
|
isSenderContractOnDestination,
|
|
15
14
|
isSequenceWallet = false,
|
|
16
15
|
}) => {
|
|
17
16
|
// Determine if we should show the warning
|
|
18
17
|
const shouldShowWarning =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
!isSequenceWallet)
|
|
18
|
+
isSenderContractOnOrigin &&
|
|
19
|
+
!isSenderContractOnDestination &&
|
|
20
|
+
!isSequenceWallet
|
|
23
21
|
|
|
24
22
|
if (!shouldShowWarning) {
|
|
25
23
|
return null
|
|
@@ -27,16 +25,13 @@ export const RefundWarning: React.FC<RefundWarningProps> = ({
|
|
|
27
25
|
|
|
28
26
|
// Determine the warning message
|
|
29
27
|
let warningMessage = ""
|
|
30
|
-
if (
|
|
31
|
-
warningMessage =
|
|
32
|
-
"Using exchange funding may result in loss of funds if the transaction fails and the sender address cannot accept refunds on the origin chain."
|
|
33
|
-
} else if (isSenderContractOnOrigin && !isSenderContractOnDestination) {
|
|
28
|
+
if (isSenderContractOnOrigin && !isSenderContractOnDestination) {
|
|
34
29
|
warningMessage =
|
|
35
30
|
"The sender is a contract address. Funds may be lost if the transaction fails and the contract cannot accept refunds on the destination chain."
|
|
36
31
|
}
|
|
37
32
|
|
|
38
33
|
return (
|
|
39
|
-
<div className="px-2 py-3 rounded-lg bg-amber-500/10 border border-solid border-amber-500/30">
|
|
34
|
+
<div className="mb-2 px-2 py-3 rounded-lg bg-amber-500/10 border border-solid border-amber-500/30">
|
|
40
35
|
<div className="flex items-start space-x-2">
|
|
41
36
|
<svg
|
|
42
37
|
className="w-4 h-4 text-amber-500 flex-shrink-0 mt-0.5"
|
|
@@ -33,12 +33,12 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({
|
|
|
33
33
|
}) => {
|
|
34
34
|
const [theme, setTheme] = useState<Theme>(initialTheme)
|
|
35
35
|
const [isDark, setIsDark] = useState(getIsDark(initialTheme))
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const [prevInitialTheme, setPrevInitialTheme] = useState(initialTheme)
|
|
37
|
+
if (initialTheme !== prevInitialTheme) {
|
|
38
|
+
setPrevInitialTheme(initialTheme)
|
|
39
39
|
setTheme(initialTheme)
|
|
40
40
|
setIsDark(getIsDark(initialTheme))
|
|
41
|
-
}
|
|
41
|
+
}
|
|
42
42
|
|
|
43
43
|
// Listen for system theme changes when in auto mode
|
|
44
44
|
useEffect(() => {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
useRef,
|
|
12
12
|
useState,
|
|
13
13
|
} from "react"
|
|
14
|
+
import { isAddress } from "viem"
|
|
14
15
|
import { useAccount } from "wagmi"
|
|
15
16
|
import { getChainInfo } from "../../chains.js"
|
|
16
17
|
import type { Token } from "../../tokens.js"
|
|
@@ -24,7 +25,6 @@ import {
|
|
|
24
25
|
import { isValueZero } from "../../utils.js"
|
|
25
26
|
import { useBalanceVisible } from "../hooks/useBalanceVisible.js"
|
|
26
27
|
import { useChainFilter } from "../hooks/useChainFilter.js"
|
|
27
|
-
import { useCustomTokenSearch } from "../hooks/useCustomTokenSearch.js"
|
|
28
28
|
import { useTokenList } from "../hooks/useTokenList.js"
|
|
29
29
|
import { useSupportedChains } from "../../query/chains.hooks.js"
|
|
30
30
|
import { ChainFilterDropdown } from "./ChainFilterDropdown.js"
|
|
@@ -409,10 +409,13 @@ export const TokenSelector: React.FC<TokenSelectorProps> = ({
|
|
|
409
409
|
setSearchQuery,
|
|
410
410
|
handleTokenSelect,
|
|
411
411
|
filteredTokens,
|
|
412
|
+
chainFilteredTokens: rawChainFilteredTokens,
|
|
413
|
+
foundTokensAllChains,
|
|
412
414
|
isLoadingTokens,
|
|
415
|
+
isLoadingCustomToken,
|
|
413
416
|
isSearching,
|
|
417
|
+
customTokenError,
|
|
414
418
|
isTokenSelected,
|
|
415
|
-
filteredTokensFormatted,
|
|
416
419
|
balanceError,
|
|
417
420
|
} = useTokenList({
|
|
418
421
|
onContinue: onTokenSelect, // Use onTokenSelect for the hook
|
|
@@ -428,20 +431,25 @@ export const TokenSelector: React.FC<TokenSelectorProps> = ({
|
|
|
428
431
|
} = useChainFilter()
|
|
429
432
|
const { data: supportedChains = [] } = useSupportedChains()
|
|
430
433
|
|
|
431
|
-
// Handle custom token search and integration
|
|
432
|
-
// Only enable custom token search after initial load is complete
|
|
433
|
-
const {
|
|
434
|
-
chainFilteredTokens: rawChainFilteredTokens,
|
|
435
|
-
isLoadingCustomToken,
|
|
436
|
-
customTokenError,
|
|
437
|
-
} = useCustomTokenSearch({
|
|
438
|
-
searchQuery: hasInitiallyLoaded ? searchQuery : "", // Disable during initial load
|
|
439
|
-
filteredTokensFormatted,
|
|
440
|
-
filterByChainId,
|
|
441
|
-
})
|
|
442
|
-
|
|
443
434
|
const chainFilteredTokens = useDeferredValue(rawChainFilteredTokens)
|
|
444
435
|
|
|
436
|
+
// When searching by address with a chain filter active, the token may not
|
|
437
|
+
// exist on the selected chain but may have been found on other chains.
|
|
438
|
+
// Compute those "other chain" results so we can offer them to the user.
|
|
439
|
+
const tokensFoundOnOtherChains = useMemo(() => {
|
|
440
|
+
if (
|
|
441
|
+
filterByChainId === null ||
|
|
442
|
+
chainFilteredTokens.length > 0 ||
|
|
443
|
+
foundTokensAllChains.length === 0 ||
|
|
444
|
+
!isAddress(searchQuery.trim())
|
|
445
|
+
) {
|
|
446
|
+
return []
|
|
447
|
+
}
|
|
448
|
+
return foundTokensAllChains.filter(
|
|
449
|
+
(t) => (t.chainId || 0) !== filterByChainId,
|
|
450
|
+
)
|
|
451
|
+
}, [filterByChainId, chainFilteredTokens, foundTokensAllChains, searchQuery])
|
|
452
|
+
|
|
445
453
|
// Track when initial load is complete
|
|
446
454
|
useEffect(() => {
|
|
447
455
|
if (!isLoadingTokens && !hasInitiallyLoaded) {
|
|
@@ -638,8 +646,69 @@ export const TokenSelector: React.FC<TokenSelectorProps> = ({
|
|
|
638
646
|
filteredTokens.length === 0 &&
|
|
639
647
|
chainFilteredTokens.length === 0 &&
|
|
640
648
|
errorMessage && (
|
|
641
|
-
<div className="
|
|
642
|
-
<
|
|
649
|
+
<div className="space-y-3">
|
|
650
|
+
<div className="text-center py-4 rounded-lg trails-bg-secondary">
|
|
651
|
+
<p className="text-gray-500 dark:text-gray-400">{errorMessage}</p>
|
|
652
|
+
</div>
|
|
653
|
+
|
|
654
|
+
{/* Show tokens found on other chains when address search has results on non-selected chains */}
|
|
655
|
+
{tokensFoundOnOtherChains.length > 0 && (
|
|
656
|
+
<div className="space-y-2">
|
|
657
|
+
<p className="text-xs font-medium text-gray-500 dark:text-gray-400 px-2">
|
|
658
|
+
{tokensFoundOnOtherChains.length === 1
|
|
659
|
+
? "Found on another chain"
|
|
660
|
+
: `Found on ${tokensFoundOnOtherChains.length} other chains`}
|
|
661
|
+
</p>
|
|
662
|
+
<div className="max-h-48 overflow-y-auto trails-scrollbar">
|
|
663
|
+
{tokensFoundOnOtherChains.map((token) => {
|
|
664
|
+
const chainInfo = getChainInfo(token.chainId || 0)
|
|
665
|
+
const chainName =
|
|
666
|
+
token.chainName ||
|
|
667
|
+
chainInfo?.name ||
|
|
668
|
+
`Chain ${token.chainId || 0}`
|
|
669
|
+
return (
|
|
670
|
+
<div
|
|
671
|
+
key={`${token.chainId}-${token.contractAddress}`}
|
|
672
|
+
onClick={() => handleTokenSelectWithReset(token)}
|
|
673
|
+
onKeyDown={(e) => {
|
|
674
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
675
|
+
e.preventDefault()
|
|
676
|
+
handleTokenSelectWithReset(token)
|
|
677
|
+
}
|
|
678
|
+
}}
|
|
679
|
+
className="w-full py-2 px-4 flex items-center space-x-3 transition-all duration-200 trails-list-item trails-border-radius-list-button cursor-pointer"
|
|
680
|
+
>
|
|
681
|
+
<div className="relative shrink-0 mr-2">
|
|
682
|
+
<div className="rounded-full flex items-center justify-center bg-gray-100 dark:bg-gray-700">
|
|
683
|
+
{token.contractAddress ? (
|
|
684
|
+
<TokenImage
|
|
685
|
+
symbol={token.symbol}
|
|
686
|
+
imageUrl={token.imageUrl}
|
|
687
|
+
chainId={token.chainId}
|
|
688
|
+
contractAddress={token.contractAddress}
|
|
689
|
+
size={32}
|
|
690
|
+
/>
|
|
691
|
+
) : (
|
|
692
|
+
<span className="text-base font-medium text-gray-600 dark:text-gray-300">
|
|
693
|
+
{token.symbol}
|
|
694
|
+
</span>
|
|
695
|
+
)}
|
|
696
|
+
</div>
|
|
697
|
+
</div>
|
|
698
|
+
<div className="flex-1 min-w-0 text-left">
|
|
699
|
+
<h3 className="text-sm font-medium truncate text-gray-900 dark:text-white">
|
|
700
|
+
{token.name}
|
|
701
|
+
</h3>
|
|
702
|
+
<span className="text-xs text-gray-500 dark:text-gray-400">
|
|
703
|
+
{token.symbol} on {chainName}
|
|
704
|
+
</span>
|
|
705
|
+
</div>
|
|
706
|
+
</div>
|
|
707
|
+
)
|
|
708
|
+
})}
|
|
709
|
+
</div>
|
|
710
|
+
</div>
|
|
711
|
+
)}
|
|
643
712
|
</div>
|
|
644
713
|
)}
|
|
645
714
|
|
|
@@ -95,6 +95,52 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
|
|
|
95
95
|
</div>
|
|
96
96
|
)}
|
|
97
97
|
|
|
98
|
+
{/* Refund Transaction Hash */}
|
|
99
|
+
{isDisplayableTransactionHash(transaction.refundTransactionHash) &&
|
|
100
|
+
(transaction.refundTransactionChainId || transaction.originChainId) && (
|
|
101
|
+
<div className="flex justify-between items-center">
|
|
102
|
+
<span className="text-xs text-gray-600 dark:text-gray-400">
|
|
103
|
+
Refund Tx:
|
|
104
|
+
</span>
|
|
105
|
+
<a
|
|
106
|
+
href={getExplorerUrl({
|
|
107
|
+
txHash: transaction.refundTransactionHash,
|
|
108
|
+
chainId:
|
|
109
|
+
transaction.refundTransactionChainId ||
|
|
110
|
+
transaction.originChainId ||
|
|
111
|
+
0,
|
|
112
|
+
})}
|
|
113
|
+
target="_blank"
|
|
114
|
+
rel="noopener noreferrer"
|
|
115
|
+
className="text-xs font-mono hover:underline flex items-center gap-1 text-gray-900 dark:text-gray-100"
|
|
116
|
+
>
|
|
117
|
+
<ChainImage
|
|
118
|
+
chainId={
|
|
119
|
+
transaction.refundTransactionChainId ||
|
|
120
|
+
transaction.originChainId ||
|
|
121
|
+
0
|
|
122
|
+
}
|
|
123
|
+
size={16}
|
|
124
|
+
/>
|
|
125
|
+
{truncateAddress(transaction.refundTransactionHash)}
|
|
126
|
+
<svg
|
|
127
|
+
aria-hidden="true"
|
|
128
|
+
className="w-3 h-3"
|
|
129
|
+
fill="none"
|
|
130
|
+
stroke="currentColor"
|
|
131
|
+
viewBox="0 0 24 24"
|
|
132
|
+
>
|
|
133
|
+
<path
|
|
134
|
+
strokeLinecap="round"
|
|
135
|
+
strokeLinejoin="round"
|
|
136
|
+
strokeWidth={2}
|
|
137
|
+
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
|
138
|
+
/>
|
|
139
|
+
</svg>
|
|
140
|
+
</a>
|
|
141
|
+
</div>
|
|
142
|
+
)}
|
|
143
|
+
|
|
98
144
|
{/* Origin Token - Moved before Origin Intent */}
|
|
99
145
|
{transaction.originToken && (
|
|
100
146
|
<div className="flex justify-between items-start">
|