diff --git a/packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionsTableRowAction.tsx b/packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionsTableRowAction.tsx index 629aec8aaa..1b6bce2c75 100644 --- a/packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionsTableRowAction.tsx +++ b/packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionsTableRowAction.tsx @@ -1,4 +1,6 @@ import { useCallback } from 'react' +import { useAccount, useNetwork } from 'wagmi' + import { GET_HELP_LINK } from '../../constants' import { useClaimWithdrawal } from '../../hooks/useClaimWithdrawal' import { useClaimCctp } from '../../state/cctpState' @@ -13,7 +15,6 @@ import { getNetworkName } from '../../util/networks' import { errorToast } from '../common/atoms/Toast' import { Button } from '../common/Button' import { useSwitchNetworkWithConfig } from '../../hooks/useSwitchNetworkWithConfig' -import { useNetwork } from 'wagmi' import { isDepositReadyToRedeem } from '../../state/app/utils' import { useRedeemRetryable } from '../../hooks/useRedeemRetryable' import { TransferCountdown } from '../common/TransferCountdown' @@ -23,6 +24,7 @@ import { useRedeemTeleporter } from '../../hooks/useRedeemTeleporter' import { sanitizeTokenSymbol } from '../../util/TokenUtils' import { formatAmount } from '../../util/NumberUtils' import { useTransactionHistoryAddressStore } from './TransactionHistorySearchBar' +import { Tooltip } from '../common/Tooltip' export function TransactionsTableRowAction({ tx, @@ -33,10 +35,17 @@ export function TransactionsTableRowAction({ isError: boolean type: 'deposits' | 'withdrawals' }) { + const { address: connectedAddress } = useAccount() const { chain } = useNetwork() const { switchNetworkAsync } = useSwitchNetworkWithConfig() const networkName = getNetworkName(chain?.id ?? 0) - const { sanitizedAddress } = useTransactionHistoryAddressStore() + const { sanitizedAddress: searchedAddress } = + useTransactionHistoryAddressStore() + + const isViewingAnotherAddress = + connectedAddress && + searchedAddress && + connectedAddress.toLowerCase() !== searchedAddress.toLowerCase() const tokenSymbol = sanitizeTokenSymbol(tx.asset, { erc20L1Address: tx.tokenAddress, @@ -47,10 +56,10 @@ export function TransactionsTableRowAction({ const { claim: claimCctp, isClaiming: isClaimingCctp } = useClaimCctp(tx) const { redeem, isRedeeming: isRetryableRedeeming } = useRedeemRetryable( tx, - sanitizedAddress + searchedAddress ) const { redeem: teleporterRedeem, isRedeeming: isTeleporterRedeeming } = - useRedeemTeleporter(tx, sanitizedAddress) + useRedeemTeleporter(tx, searchedAddress) const isRedeeming = isRetryableRedeeming || isTeleporterRedeeming @@ -162,16 +171,25 @@ export function TransactionsTableRowAction({ return isClaiming || isClaimingCctp ? ( Claiming... ) : ( - + + ) } diff --git a/packages/arb-token-bridge-ui/src/hooks/useClaimWithdrawal.ts b/packages/arb-token-bridge-ui/src/hooks/useClaimWithdrawal.ts index f174dc8fb3..be9b21769d 100644 --- a/packages/arb-token-bridge-ui/src/hooks/useClaimWithdrawal.ts +++ b/packages/arb-token-bridge-ui/src/hooks/useClaimWithdrawal.ts @@ -15,6 +15,7 @@ import { fetchErc20Data } from '../util/TokenUtils' import { fetchNativeCurrency } from './useNativeCurrency' import { getProviderForChainId } from '@/token-bridge-sdk/utils' import { captureSentryErrorWithExtraData } from '../util/SentryUtils' +import { useTransactionHistoryAddressStore } from '../components/TransactionHistory/TransactionHistorySearchBar' export type UseClaimWithdrawalResult = { claim: () => Promise @@ -28,8 +29,11 @@ export function useClaimWithdrawal( app: { arbTokenBridge } } = useAppState() const { address } = useAccount() + const { sanitizedAddress } = useTransactionHistoryAddressStore() const { data: signer } = useSigner({ chainId: tx.parentChainId }) - const { updatePendingTransaction } = useTransactionHistory(address) + const { updatePendingTransaction } = useTransactionHistory( + sanitizedAddress ?? address + ) const [isClaiming, setIsClaiming] = useState(false) const claim = useCallback(async () => { diff --git a/packages/arb-token-bridge-ui/src/util/wagmi/setup.ts b/packages/arb-token-bridge-ui/src/util/wagmi/setup.ts index 4b748a2080..d32c467a51 100644 --- a/packages/arb-token-bridge-ui/src/util/wagmi/setup.ts +++ b/packages/arb-token-bridge-ui/src/util/wagmi/setup.ts @@ -148,14 +148,13 @@ export function getProps(targetChainKey: string | null) { chains }) + wallets[0]?.wallets.push(okxWallet({ chains, projectId })) + const connectors = connectorsForWallets([ ...wallets, { groupName: 'More', - wallets: [ - trustWallet({ chains, projectId }), - okxWallet({ chains, projectId }) - ] + wallets: [trustWallet({ chains, projectId })] } ])