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
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { ChevronDown } from "lucide-react"
|
|
2
2
|
import type React from "react"
|
|
3
3
|
import { useEffect, useMemo, useRef, useState } from "react"
|
|
4
|
+
import { createWalletClient, custom, type EIP1193Provider } from "viem"
|
|
4
5
|
import { useAccount, useConnections } from "wagmi"
|
|
6
|
+
import type { Connector } from "wagmi"
|
|
7
|
+
import type { WalletClient } from "viem"
|
|
8
|
+
import { getChainInfo } from "../../chains.js"
|
|
5
9
|
import { logger } from "../../logger.js"
|
|
6
10
|
import { useMeldServiceProviders } from "../../query/meld.hooks.js"
|
|
7
11
|
import { useCommitIntent } from "../../mutations.js"
|
|
@@ -9,10 +13,13 @@ import type { FlatTokenBalancesData } from "../../query/balance.fetchers.js"
|
|
|
9
13
|
import { formatRawAmount } from "../../utils/format.js"
|
|
10
14
|
import type { Token } from "../../tokens.js"
|
|
11
15
|
import { isNativeToken, truncateAddress } from "../../utils/address.js"
|
|
16
|
+
import { useCombinedHistory } from "../hooks/useCombinedHistory.js"
|
|
12
17
|
import {
|
|
13
|
-
|
|
18
|
+
getHistoryEmptyMessage,
|
|
19
|
+
getIntentStatuses,
|
|
20
|
+
HISTORY_FILTER_OPTIONS,
|
|
14
21
|
type HistoryFilterType,
|
|
15
|
-
} from "../
|
|
22
|
+
} from "../utils/historyFilters.js"
|
|
16
23
|
import Identicon from "./Identicon.js"
|
|
17
24
|
import { OnrampHistoryRow } from "./OnrampHistoryRow.js"
|
|
18
25
|
import { ScreenHeader } from "./ScreenHeader.js"
|
|
@@ -32,11 +39,12 @@ interface HistoryHeaderProps {
|
|
|
32
39
|
onRefresh: () => void
|
|
33
40
|
loading: boolean
|
|
34
41
|
effectiveAccountAddress: string | undefined
|
|
35
|
-
onWalletSelect: (address: string) => void
|
|
42
|
+
onWalletSelect: (wallet: { address: string; connector: Connector }) => void
|
|
36
43
|
searchInput: string
|
|
37
44
|
setSearchInput: (value: string) => void
|
|
38
45
|
statusFilter: HistoryFilterType
|
|
39
46
|
setStatusFilter: (filter: HistoryFilterType) => void
|
|
47
|
+
resetIntentPagination: () => void
|
|
40
48
|
}
|
|
41
49
|
|
|
42
50
|
const HistoryHeader: React.FC<HistoryHeaderProps> = ({
|
|
@@ -49,6 +57,7 @@ const HistoryHeader: React.FC<HistoryHeaderProps> = ({
|
|
|
49
57
|
setSearchInput,
|
|
50
58
|
statusFilter,
|
|
51
59
|
setStatusFilter,
|
|
60
|
+
resetIntentPagination,
|
|
52
61
|
}) => {
|
|
53
62
|
// Wallet dropdown state (internal to this component)
|
|
54
63
|
const [isWalletDropdownOpen, setIsWalletDropdownOpen] = useState(false)
|
|
@@ -138,7 +147,10 @@ const HistoryHeader: React.FC<HistoryHeaderProps> = ({
|
|
|
138
147
|
key={wallet.address}
|
|
139
148
|
type="button"
|
|
140
149
|
onClick={() => {
|
|
141
|
-
onWalletSelect(
|
|
150
|
+
onWalletSelect({
|
|
151
|
+
address: wallet.address,
|
|
152
|
+
connector: wallet.connector,
|
|
153
|
+
})
|
|
142
154
|
setIsWalletDropdownOpen(false)
|
|
143
155
|
}}
|
|
144
156
|
className={`w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer first:rounded-t-xl last:rounded-b-xl ${
|
|
@@ -200,94 +212,26 @@ const HistoryHeader: React.FC<HistoryHeaderProps> = ({
|
|
|
200
212
|
{/* Status Filter Buttons */}
|
|
201
213
|
<div className="py-2">
|
|
202
214
|
<div className="flex items-center gap-2 mt-2 overflow-x-auto scrollbar-hide">
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
<span className="text-xs font-medium">Succeeded</span>
|
|
224
|
-
</button>
|
|
225
|
-
<button
|
|
226
|
-
type="button"
|
|
227
|
-
onClick={() => setStatusFilter("pending")}
|
|
228
|
-
className={`px-2 py-1.5 rounded-xl transition-colors cursor-pointer text-xs ${
|
|
229
|
-
statusFilter === "pending"
|
|
230
|
-
? "bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20"
|
|
231
|
-
: "trails-bg-secondary text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"
|
|
232
|
-
}`}
|
|
233
|
-
>
|
|
234
|
-
<span className="text-xs font-medium">Pending</span>
|
|
235
|
-
</button>
|
|
236
|
-
<button
|
|
237
|
-
type="button"
|
|
238
|
-
onClick={() => setStatusFilter("failed")}
|
|
239
|
-
className={`px-2 py-1.5 rounded-xl transition-colors cursor-pointer text-xs ${
|
|
240
|
-
statusFilter === "failed"
|
|
241
|
-
? "bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20"
|
|
242
|
-
: "trails-bg-secondary text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"
|
|
243
|
-
}`}
|
|
244
|
-
>
|
|
245
|
-
<span className="text-xs font-medium">Failed</span>
|
|
246
|
-
</button>
|
|
247
|
-
<button
|
|
248
|
-
type="button"
|
|
249
|
-
onClick={() => setStatusFilter("aborted")}
|
|
250
|
-
className={`px-2 py-1.5 rounded-xl transition-colors cursor-pointer text-xs ${
|
|
251
|
-
statusFilter === "aborted"
|
|
252
|
-
? "bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20"
|
|
253
|
-
: "trails-bg-secondary text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"
|
|
254
|
-
}`}
|
|
255
|
-
>
|
|
256
|
-
<span className="text-xs font-medium">Aborted</span>
|
|
257
|
-
</button>
|
|
258
|
-
<button
|
|
259
|
-
type="button"
|
|
260
|
-
onClick={() => setStatusFilter("mining")}
|
|
261
|
-
className={`px-2 py-1.5 rounded-xl transition-colors cursor-pointer text-xs ${
|
|
262
|
-
statusFilter === "mining"
|
|
263
|
-
? "bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20"
|
|
264
|
-
: "trails-bg-secondary text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"
|
|
265
|
-
}`}
|
|
266
|
-
>
|
|
267
|
-
<span className="text-xs font-medium">Mining</span>
|
|
268
|
-
</button>
|
|
269
|
-
<button
|
|
270
|
-
type="button"
|
|
271
|
-
onClick={() => setStatusFilter("committed")}
|
|
272
|
-
className={`px-2 py-1.5 rounded-xl transition-colors cursor-pointer text-xs ${
|
|
273
|
-
statusFilter === "committed"
|
|
274
|
-
? "bg-teal-50 dark:bg-teal-900/20 text-teal-600 dark:text-teal-400 hover:bg-teal-50 dark:hover:bg-teal-900/20"
|
|
275
|
-
: "trails-bg-secondary text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"
|
|
276
|
-
}`}
|
|
277
|
-
>
|
|
278
|
-
<span className="text-xs font-medium">Committed</span>
|
|
279
|
-
</button>
|
|
280
|
-
<button
|
|
281
|
-
type="button"
|
|
282
|
-
onClick={() => setStatusFilter("onramp")}
|
|
283
|
-
className={`px-2 py-1.5 rounded-xl transition-colors cursor-pointer text-xs ${
|
|
284
|
-
statusFilter === "onramp"
|
|
285
|
-
? "bg-purple-50 dark:bg-purple-900/20 text-purple-600 dark:text-purple-400 hover:bg-purple-50 dark:hover:bg-purple-900/20"
|
|
286
|
-
: "trails-bg-secondary text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"
|
|
287
|
-
}`}
|
|
288
|
-
>
|
|
289
|
-
<span className="text-xs font-medium">Onramp</span>
|
|
290
|
-
</button>
|
|
215
|
+
{HISTORY_FILTER_OPTIONS.map((option) => (
|
|
216
|
+
<button
|
|
217
|
+
key={option.key}
|
|
218
|
+
type="button"
|
|
219
|
+
title={option.tooltip}
|
|
220
|
+
onClick={() => {
|
|
221
|
+
setStatusFilter(option.key)
|
|
222
|
+
resetIntentPagination()
|
|
223
|
+
}}
|
|
224
|
+
className={`px-2 py-1.5 rounded-xl transition-colors cursor-pointer text-xs ${
|
|
225
|
+
statusFilter === option.key
|
|
226
|
+
? option.activeClass
|
|
227
|
+
: "trails-bg-secondary text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"
|
|
228
|
+
}`}
|
|
229
|
+
>
|
|
230
|
+
<span className="text-xs font-medium whitespace-nowrap">
|
|
231
|
+
{option.label}
|
|
232
|
+
</span>
|
|
233
|
+
</button>
|
|
234
|
+
))}
|
|
291
235
|
</div>
|
|
292
236
|
</div>
|
|
293
237
|
</>
|
|
@@ -342,9 +286,13 @@ export const AccountIntentTransactionHistory: React.FC<
|
|
|
342
286
|
const [recentlyCommittedIntent, setRecentlyCommittedIntent] = useState<
|
|
343
287
|
string | null
|
|
344
288
|
>(null)
|
|
345
|
-
const [
|
|
346
|
-
string
|
|
347
|
-
|
|
289
|
+
const [selectedWallet, setSelectedWallet] = useState<{
|
|
290
|
+
address: string
|
|
291
|
+
connector: Connector
|
|
292
|
+
} | null>(null)
|
|
293
|
+
const [selectedWalletClient, setSelectedWalletClient] =
|
|
294
|
+
useState<WalletClient | null>(null)
|
|
295
|
+
const connections = useConnections()
|
|
348
296
|
const scrollContainerRef = useRef<HTMLDivElement>(null)
|
|
349
297
|
|
|
350
298
|
// Hook for committing intent
|
|
@@ -364,7 +312,85 @@ export const AccountIntentTransactionHistory: React.FC<
|
|
|
364
312
|
/^0x[a-fA-F0-9]+$/.test(searchInput) &&
|
|
365
313
|
searchInput.length >= 42
|
|
366
314
|
|
|
367
|
-
const effectiveAccountAddress =
|
|
315
|
+
const effectiveAccountAddress = selectedWallet?.address || accountAddress
|
|
316
|
+
const intentStatuses = useMemo(
|
|
317
|
+
() => getIntentStatuses(statusFilter),
|
|
318
|
+
[statusFilter],
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
useEffect(() => {
|
|
322
|
+
if (!selectedWallet) {
|
|
323
|
+
return
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const isStillConnected = connections.some((connection) =>
|
|
327
|
+
connection?.accounts?.some(
|
|
328
|
+
(account) =>
|
|
329
|
+
account?.toLowerCase() === selectedWallet.address.toLowerCase(),
|
|
330
|
+
),
|
|
331
|
+
)
|
|
332
|
+
|
|
333
|
+
if (!isStillConnected) {
|
|
334
|
+
setSelectedWallet(null)
|
|
335
|
+
setSelectedWalletClient(null)
|
|
336
|
+
}
|
|
337
|
+
}, [connections, selectedWallet])
|
|
338
|
+
|
|
339
|
+
useEffect(() => {
|
|
340
|
+
let cancelled = false
|
|
341
|
+
|
|
342
|
+
const loadSelectedWalletClient = async () => {
|
|
343
|
+
if (!selectedWallet) {
|
|
344
|
+
setSelectedWalletClient(null)
|
|
345
|
+
return
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
try {
|
|
349
|
+
const provider = (await selectedWallet.connector.getProvider()) as
|
|
350
|
+
| EIP1193Provider
|
|
351
|
+
| undefined
|
|
352
|
+
const chainId = await selectedWallet.connector.getChainId()
|
|
353
|
+
const chain = getChainInfo(chainId)
|
|
354
|
+
|
|
355
|
+
if (cancelled) {
|
|
356
|
+
return
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (!provider || !chain) {
|
|
360
|
+
setSelectedWalletClient(null)
|
|
361
|
+
return
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const client = createWalletClient({
|
|
365
|
+
account: selectedWallet.address as `0x${string}`,
|
|
366
|
+
chain,
|
|
367
|
+
transport: custom(provider),
|
|
368
|
+
})
|
|
369
|
+
|
|
370
|
+
if (!cancelled) {
|
|
371
|
+
setSelectedWalletClient(client)
|
|
372
|
+
}
|
|
373
|
+
} catch (error) {
|
|
374
|
+
if (!cancelled) {
|
|
375
|
+
logger.console.error(
|
|
376
|
+
"[AccountIntentTransactionHistory] Failed to create selected wallet client",
|
|
377
|
+
{
|
|
378
|
+
address: selectedWallet.address,
|
|
379
|
+
connectorId: selectedWallet.connector.id,
|
|
380
|
+
error,
|
|
381
|
+
},
|
|
382
|
+
)
|
|
383
|
+
setSelectedWalletClient(null)
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
void loadSelectedWalletClient()
|
|
389
|
+
|
|
390
|
+
return () => {
|
|
391
|
+
cancelled = true
|
|
392
|
+
}
|
|
393
|
+
}, [selectedWallet])
|
|
368
394
|
|
|
369
395
|
logger.console.log(
|
|
370
396
|
"[AccountIntentTransactionHistory] Using account address:",
|
|
@@ -383,11 +409,13 @@ export const AccountIntentTransactionHistory: React.FC<
|
|
|
383
409
|
hasPrevIntent: hasPrev,
|
|
384
410
|
currentIntentPage: page,
|
|
385
411
|
refetchIntent,
|
|
412
|
+
resetIntentPagination,
|
|
386
413
|
getFilteredAndSearchedItems,
|
|
387
414
|
} = useCombinedHistory({
|
|
388
415
|
accountAddress: effectiveAccountAddress,
|
|
389
416
|
intentPageSize: ITEMS_PER_PAGE,
|
|
390
417
|
enabled: !!effectiveAccountAddress,
|
|
418
|
+
intentStatuses,
|
|
391
419
|
})
|
|
392
420
|
|
|
393
421
|
const hasMore = hasMoreData.intent
|
|
@@ -485,11 +513,12 @@ export const AccountIntentTransactionHistory: React.FC<
|
|
|
485
513
|
onRefresh={refetch}
|
|
486
514
|
loading={loading}
|
|
487
515
|
effectiveAccountAddress={effectiveAccountAddress}
|
|
488
|
-
onWalletSelect={
|
|
516
|
+
onWalletSelect={setSelectedWallet}
|
|
489
517
|
searchInput={searchInput}
|
|
490
518
|
setSearchInput={setSearchInput}
|
|
491
519
|
statusFilter={statusFilter}
|
|
492
520
|
setStatusFilter={setStatusFilter}
|
|
521
|
+
resetIntentPagination={resetIntentPagination}
|
|
493
522
|
/>
|
|
494
523
|
|
|
495
524
|
<PartialErrorBanner errors={errors} refetch={refetch} />
|
|
@@ -570,11 +599,14 @@ export const AccountIntentTransactionHistory: React.FC<
|
|
|
570
599
|
</svg>
|
|
571
600
|
</div>
|
|
572
601
|
<h3 className="text-lg font-medium text-gray-900 dark:text-gray-100 mb-2">
|
|
573
|
-
|
|
602
|
+
{statusFilter === "quoted"
|
|
603
|
+
? "No Quoted Transactions"
|
|
604
|
+
: "No Intent Transactions"}
|
|
574
605
|
</h3>
|
|
575
606
|
<p className="text-gray-600 dark:text-gray-400">
|
|
576
|
-
|
|
577
|
-
|
|
607
|
+
{statusFilter === "quoted"
|
|
608
|
+
? "No quoted transactions found for this account."
|
|
609
|
+
: "No intent transactions found for this account. Create your first intent transaction to see it here."}
|
|
578
610
|
</p>
|
|
579
611
|
</div>
|
|
580
612
|
</div>
|
|
@@ -607,15 +639,7 @@ export const AccountIntentTransactionHistory: React.FC<
|
|
|
607
639
|
: `No ${statusFilter} transactions match "${searchInput}".`
|
|
608
640
|
: searchInput
|
|
609
641
|
? `No transactions match your search "${searchInput}".`
|
|
610
|
-
: statusFilter
|
|
611
|
-
? "No onramp transactions found. Buy crypto to see them here."
|
|
612
|
-
: statusFilter === "pending"
|
|
613
|
-
? "No pending transactions."
|
|
614
|
-
: statusFilter === "succeeded"
|
|
615
|
-
? "No completed transactions yet."
|
|
616
|
-
: statusFilter === "failed"
|
|
617
|
-
? "No failed transactions."
|
|
618
|
-
: "No transactions found."}
|
|
642
|
+
: getHistoryEmptyMessage(statusFilter)}
|
|
619
643
|
</p>
|
|
620
644
|
</div>
|
|
621
645
|
</div>
|
|
@@ -634,6 +658,7 @@ export const AccountIntentTransactionHistory: React.FC<
|
|
|
634
658
|
onRefetch={refetch}
|
|
635
659
|
commitIntentMutation={commitIntentMutation}
|
|
636
660
|
balancesByIntentAddress={balancesByIntentAddress}
|
|
661
|
+
selectedWalletClient={selectedWalletClient}
|
|
637
662
|
onRefetchBalances={refetchIntent}
|
|
638
663
|
onCommitSuccess={() => {
|
|
639
664
|
// Track this intent as recently committed to keep it visible
|
|
@@ -6,8 +6,9 @@ import { isValidNumber } from "../../utils/validation.js"
|
|
|
6
6
|
import { openPopup, setPopupUrl, closePopup } from "../utils/windowUtils.js"
|
|
7
7
|
import type { BaseProps, OnrampConfirmCallback } from "../types/commonProps.js"
|
|
8
8
|
import type { Token } from "../../tokens.js"
|
|
9
|
-
import { useSendForm } from "../hooks/useSendForm.js"
|
|
9
|
+
import { useSendForm, type OnCompleteProps } from "../hooks/useSendForm.js"
|
|
10
10
|
import { QuoteDetails } from "./QuoteDetails.js"
|
|
11
|
+
import { HighPriceImpactBlock } from "./HighPriceImpactBlock.js"
|
|
11
12
|
import { TradeType } from "../../prepareSend.js"
|
|
12
13
|
import { getChainInfo } from "../../chains.js"
|
|
13
14
|
import { ScreenHeader } from "./ScreenHeader.js"
|
|
@@ -46,7 +47,7 @@ import {
|
|
|
46
47
|
formatUsdAmountDisplay,
|
|
47
48
|
formatUsdAmountLocaleDisplay,
|
|
48
49
|
} from "../../utils/format.js"
|
|
49
|
-
import {
|
|
50
|
+
import { useAccountTokenBalanceOnchain } from "../../query/balance.hooks.js"
|
|
50
51
|
import { base } from "viem/chains"
|
|
51
52
|
import { MeldProvidersList } from "../../meld/components/MeldProvidersList.js"
|
|
52
53
|
import type { OnrampQuote } from "../hooks/useOnRampQuote.js"
|
|
@@ -269,6 +270,7 @@ export const ClassicSwap: React.FC<ClassicSwapProps> = ({
|
|
|
269
270
|
setSellAmount,
|
|
270
271
|
buyAmount,
|
|
271
272
|
setBuyAmount,
|
|
273
|
+
resetSwapState,
|
|
272
274
|
enterFormMode,
|
|
273
275
|
} = useSwapState()
|
|
274
276
|
|
|
@@ -282,6 +284,15 @@ export const ClassicSwap: React.FC<ClassicSwapProps> = ({
|
|
|
282
284
|
const [isCreatingWidgetSession, setIsCreatingWidgetSession] = useState(false)
|
|
283
285
|
const [widgetError, setWidgetError] = useState<string | null>(null)
|
|
284
286
|
|
|
287
|
+
const handleCompleteAndClearAmounts = useCallback(
|
|
288
|
+
(result: OnCompleteProps) => {
|
|
289
|
+
setSellFiatAmount("")
|
|
290
|
+
resetSwapState()
|
|
291
|
+
onComplete(result)
|
|
292
|
+
},
|
|
293
|
+
[onComplete, resetSwapState, setSellFiatAmount],
|
|
294
|
+
)
|
|
295
|
+
|
|
285
296
|
// Initialize and update selected recipient from toRecipient prop (but don't auto-set to account address)
|
|
286
297
|
// biome-ignore lint/correctness/useExhaustiveDependencies: selectedRecipient is intentionally excluded to avoid infinite loops
|
|
287
298
|
useEffect(() => {
|
|
@@ -306,6 +317,10 @@ export const ClassicSwap: React.FC<ClassicSwapProps> = ({
|
|
|
306
317
|
selectedRecipient || toRecipient || account?.address
|
|
307
318
|
|
|
308
319
|
const effectiveFundMethod = isMeldOnRampActive ? "onramp-meld" : fundMethod
|
|
320
|
+
const skipBalanceFetch =
|
|
321
|
+
effectiveFundMethod === "onramp-meld" ||
|
|
322
|
+
effectiveFundMethod === "direct-transfer" ||
|
|
323
|
+
effectiveFundMethod === "onramp-mesh"
|
|
309
324
|
|
|
310
325
|
// Get onramp quote when onramp is active
|
|
311
326
|
const {
|
|
@@ -341,7 +356,6 @@ export const ClassicSwap: React.FC<ClassicSwapProps> = ({
|
|
|
341
356
|
isLoadingQuote,
|
|
342
357
|
selectedDestinationChain,
|
|
343
358
|
selectedDestToken,
|
|
344
|
-
setAmount,
|
|
345
359
|
setSelectedDestinationChain,
|
|
346
360
|
setSelectedDestToken,
|
|
347
361
|
buttonText,
|
|
@@ -349,6 +363,7 @@ export const ClassicSwap: React.FC<ClassicSwapProps> = ({
|
|
|
349
363
|
destinationTokenAddress,
|
|
350
364
|
isValidCustomToken,
|
|
351
365
|
prepareSendQuote,
|
|
366
|
+
quoteError,
|
|
352
367
|
processedFeeOptions,
|
|
353
368
|
selectedFeeOption,
|
|
354
369
|
setSelectedFeeOption,
|
|
@@ -369,7 +384,7 @@ export const ClassicSwap: React.FC<ClassicSwapProps> = ({
|
|
|
369
384
|
paymasterUrls,
|
|
370
385
|
onSend,
|
|
371
386
|
onConfirm,
|
|
372
|
-
onComplete,
|
|
387
|
+
onComplete: handleCompleteAndClearAmounts,
|
|
373
388
|
selectedToken: originToken ?? undefined,
|
|
374
389
|
setWalletConfirmRetryHandler,
|
|
375
390
|
tradeType: tradeType,
|
|
@@ -429,16 +444,19 @@ export const ClassicSwap: React.FC<ClassicSwapProps> = ({
|
|
|
429
444
|
}, [isMeldOnRampActive, setOriginToken, setTradeType])
|
|
430
445
|
|
|
431
446
|
// Get destination token with fresh balance
|
|
432
|
-
const { token: freshDestinationToken } =
|
|
447
|
+
const { token: freshDestinationToken } = useAccountTokenBalanceOnchain(
|
|
433
448
|
destinationToken,
|
|
434
449
|
account?.address,
|
|
450
|
+
{ disabled: skipBalanceFetch },
|
|
435
451
|
)
|
|
436
452
|
|
|
437
453
|
// Get origin token with fresh balance for fee option checks
|
|
438
454
|
const {
|
|
439
455
|
token: freshOriginToken,
|
|
440
456
|
isLoadingBalance: isLoadingFreshOriginBalance,
|
|
441
|
-
} =
|
|
457
|
+
} = useAccountTokenBalanceOnchain(originToken, account?.address, {
|
|
458
|
+
disabled: skipBalanceFetch,
|
|
459
|
+
})
|
|
442
460
|
|
|
443
461
|
const destinationBalanceDisplay = useMemo(() => {
|
|
444
462
|
if (!freshDestinationToken) return "0.00"
|
|
@@ -453,15 +471,6 @@ export const ClassicSwap: React.FC<ClassicSwapProps> = ({
|
|
|
453
471
|
}
|
|
454
472
|
}, [freshDestinationToken])
|
|
455
473
|
|
|
456
|
-
// Update amount based on last input type
|
|
457
|
-
useEffect(() => {
|
|
458
|
-
if (tradeType === TradeType.EXACT_INPUT) {
|
|
459
|
-
setAmount(sellAmount)
|
|
460
|
-
} else {
|
|
461
|
-
setAmount(buyAmount)
|
|
462
|
-
}
|
|
463
|
-
}, [sellAmount, buyAmount, tradeType, setAmount])
|
|
464
|
-
|
|
465
474
|
const handleSellFiatAmountChange = useCallback(
|
|
466
475
|
(value: string) => {
|
|
467
476
|
setWidgetError(null)
|
|
@@ -709,15 +718,6 @@ export const ClassicSwap: React.FC<ClassicSwapProps> = ({
|
|
|
709
718
|
const [showDestinationChainList, setShowDestinationChainList] =
|
|
710
719
|
useState(false)
|
|
711
720
|
|
|
712
|
-
useEffect(() => {
|
|
713
|
-
if (selectedDestToken) {
|
|
714
|
-
const chainInfo = getChainInfo(selectedDestToken.chainId)
|
|
715
|
-
if (chainInfo) {
|
|
716
|
-
setSelectedDestinationChain(chainInfo)
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
}, [selectedDestToken, setSelectedDestinationChain])
|
|
720
|
-
|
|
721
721
|
// Sync destination token from hook with useSendForm
|
|
722
722
|
// This ensures the destination token auto-selection flows into useSendForm
|
|
723
723
|
useEffect(() => {
|
|
@@ -1616,6 +1616,8 @@ export const ClassicSwap: React.FC<ClassicSwapProps> = ({
|
|
|
1616
1616
|
</div>
|
|
1617
1617
|
)}
|
|
1618
1618
|
|
|
1619
|
+
<HighPriceImpactBlock quoteError={quoteError} />
|
|
1620
|
+
|
|
1619
1621
|
{/* Onramp Provider Selector */}
|
|
1620
1622
|
{isMeldOnRampActive &&
|
|
1621
1623
|
!isLoadingOnrampQuote &&
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AlignJustify, ChevronRight, LogOut, Wallet } from "lucide-react"
|
|
2
|
+
import { wagmiConnectorToWalletId } from "@0xtrails/wallet-registry"
|
|
2
3
|
import React, { useEffect, useMemo, useState } from "react"
|
|
3
4
|
import {
|
|
4
5
|
useAccount,
|
|
@@ -9,7 +10,7 @@ import {
|
|
|
9
10
|
} from "wagmi"
|
|
10
11
|
import { logger } from "../../logger.js"
|
|
11
12
|
import { truncateAddress } from "../../utils/address.js"
|
|
12
|
-
import { useWallets
|
|
13
|
+
import { useWallets } from "../../wallets.js"
|
|
13
14
|
import { useClickTracking } from "../hooks/useClickTracking.js"
|
|
14
15
|
import { useViewManager } from "../hooks/useViewManager.js"
|
|
15
16
|
import { useWidgetProps } from "../hooks/useWidgetProps.js"
|
|
@@ -38,6 +39,8 @@ export interface ConnectWalletProps {
|
|
|
38
39
|
showDisconnect?: boolean
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
const alwaysShowWallets = ["metamask", "walletconnect"]
|
|
43
|
+
|
|
41
44
|
export const ConnectWallet: React.FC<ConnectWalletProps> = ({
|
|
42
45
|
onConnect,
|
|
43
46
|
onContinue,
|
|
@@ -262,7 +265,6 @@ export const ConnectWallet: React.FC<ConnectWalletProps> = ({
|
|
|
262
265
|
connector: () => wallet.connector?.connect?.(),
|
|
263
266
|
}))
|
|
264
267
|
|
|
265
|
-
const alwaysShowWallets = ["metamask", "walletconnect"]
|
|
266
268
|
const filteredWallets = walletOptionsFromAllWallets
|
|
267
269
|
.filter((wallet) => alwaysShowWallets.includes(wallet.id))
|
|
268
270
|
.sort((a, b) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState } from "react"
|
|
2
2
|
import type React from "react"
|
|
3
3
|
import { Wallet, X, ChevronRight } from "lucide-react"
|
|
4
|
+
import { wagmiConnectorToWalletId } from "@0xtrails/wallet-registry"
|
|
4
5
|
import { CopyButton } from "./CopyButton.js"
|
|
5
6
|
import {
|
|
6
7
|
useAccount,
|
|
@@ -8,11 +9,7 @@ import {
|
|
|
8
9
|
useSwitchAccount,
|
|
9
10
|
useDisconnect,
|
|
10
11
|
} from "wagmi"
|
|
11
|
-
import {
|
|
12
|
-
isEmbeddedConnector,
|
|
13
|
-
useWallets,
|
|
14
|
-
wagmiConnectorToWalletId,
|
|
15
|
-
} from "../../wallets.js"
|
|
12
|
+
import { isEmbeddedConnector, useWallets } from "../../wallets.js"
|
|
16
13
|
import { logger } from "../../logger.js"
|
|
17
14
|
import { useAccountTotalBalanceUsd } from "../../query/balance.hooks.js"
|
|
18
15
|
import {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ChevronDown, ExternalLink } from "lucide-react"
|
|
2
|
+
import {
|
|
3
|
+
getQRCodeWallets,
|
|
4
|
+
type QRCodeWalletOption,
|
|
5
|
+
} from "@0xtrails/wallet-registry"
|
|
2
6
|
import type React from "react"
|
|
3
7
|
import { useCallback, useRef, useState } from "react"
|
|
4
8
|
import { formatUnits, getAddress } from "viem"
|
|
@@ -6,7 +10,6 @@ import { getExplorerUrlForAddress } from "../../explorer.js"
|
|
|
6
10
|
import { logger } from "../../logger.js"
|
|
7
11
|
import type { PrepareSendQuote } from "../../prepareSend.js"
|
|
8
12
|
import { isNativeToken, truncateAddress } from "../../utils/address.js"
|
|
9
|
-
import { useQRCodeWallets, type QRCodeWalletOption } from "../../wallets.js"
|
|
10
13
|
import { CopyButton } from "./CopyButton.js"
|
|
11
14
|
import { DepositTracker } from "./DepositTracker.js"
|
|
12
15
|
import { QrCode } from "./QrCode.js"
|
|
@@ -33,7 +36,7 @@ export const DirectTransfer: React.FC<DirectTransferProps> = ({
|
|
|
33
36
|
walletOptions,
|
|
34
37
|
onIntentExecuted,
|
|
35
38
|
}) => {
|
|
36
|
-
const defaultQrCodeWallets =
|
|
39
|
+
const defaultQrCodeWallets = getQRCodeWallets()
|
|
37
40
|
const defaultWalletOptions = walletOptions || defaultQrCodeWallets
|
|
38
41
|
const hasTriggeredExecuteRef = useRef(false)
|
|
39
42
|
const [isAmountCopied, setIsAmountCopied] = useState(false)
|
|
@@ -5,8 +5,7 @@ import { useAccount } from "wagmi"
|
|
|
5
5
|
import { getChainInfo } from "../../chains.js"
|
|
6
6
|
import { logger } from "../../logger.js"
|
|
7
7
|
import { usePools, type Pool } from "../../pools.js"
|
|
8
|
-
import { formatTvl } from "../../
|
|
9
|
-
import { formatUsdAmountLocaleDisplay } from "../../utils/format.js"
|
|
8
|
+
import { formatTvl, formatUsdAmountLocaleDisplay } from "../../utils/format.js"
|
|
10
9
|
import {
|
|
11
10
|
useTokenBalances,
|
|
12
11
|
WIDGET_REFRESH_INTERVAL,
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { formatRawStatusLabel } from "../utils/statusLabel.js"
|
|
2
|
+
import { getHistoryStatusDescription } from "../utils/historyFilters.js"
|
|
3
|
+
|
|
1
4
|
const ExecutionStatusBadge: React.FC<{ status?: string }> = ({ status }) => {
|
|
5
|
+
const description = getHistoryStatusDescription(status)
|
|
6
|
+
|
|
2
7
|
const getStatusColor = (status?: string) => {
|
|
3
8
|
const upperStatus = status?.toUpperCase()
|
|
4
9
|
switch (upperStatus) {
|
|
@@ -35,11 +40,12 @@ const ExecutionStatusBadge: React.FC<{ status?: string }> = ({ status }) => {
|
|
|
35
40
|
|
|
36
41
|
return (
|
|
37
42
|
<span
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
title={description}
|
|
44
|
+
className={`inline-flex items-center px-2.5 py-0.5 rounded text-xs font-medium ${
|
|
45
|
+
description ? "cursor-help" : ""
|
|
46
|
+
} ${getStatusColor(status)}`}
|
|
41
47
|
>
|
|
42
|
-
{status
|
|
48
|
+
{formatRawStatusLabel(status)}
|
|
43
49
|
</span>
|
|
44
50
|
)
|
|
45
51
|
}
|