Skip to content

Commit

Permalink
Copy checksummed address (#1753)
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHomanics authored Nov 5, 2024
1 parent a51cda1 commit df46dc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/core/utils/copy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AddressZero } from '@ethersproject/constants';
import { getAddress } from 'viem';

import { triggerToast } from '~/entries/popup/components/Toast/Toast';

Expand Down Expand Up @@ -26,6 +27,6 @@ export const copyAddress = (address: AddressOrEth) => {
copy({
title: i18n.t('wallet_header.copy_toast'),
description: truncateAddress(address),
value: address,
value: getAddress(address),
});
};
3 changes: 2 additions & 1 deletion src/entries/popup/pages/home/TokenDetails/About.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import clsx from 'clsx';
import { ReactNode, useState } from 'react';
import { getAddress } from 'viem';

import { i18n } from '~/core/languages';
import { ParsedUserAsset } from '~/core/types/assets';
Expand Down Expand Up @@ -348,7 +349,7 @@ export function About({
value={
<CopyableValue
title={i18n.t('wallet_header.copy_toast')}
value={token.address}
value={getAddress(token.address)}
>
{truncateAddress(token.address)}
</CopyableValue>
Expand Down

0 comments on commit df46dc4

Please sign in to comment.