Show ETH addresses with injected checksum (#176)

pull/179/head
Artem 3 years ago committed by GitHub
parent 484fc4eaba
commit 7a0eb3c069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/components/ui/Address.tsx

@ -1,6 +1,7 @@
import React, { CSSProperties } from "react"; import React, { CSSProperties } from "react";
import { Box, Text } from "grommet"; import { Box, Text } from "grommet";
import { Link, useHistory } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
import {toChecksumAddress} from 'web3-utils';
import { useERC20Pool } from "src/hooks/ERC20_Pool"; import { useERC20Pool } from "src/hooks/ERC20_Pool";
import { getAddress } from "src/utils"; import { getAddress } from "src/utils";
import { useCurrency } from "src/hooks/ONE-ETH-SwitcherHook"; import { useCurrency } from "src/hooks/ONE-ETH-SwitcherHook";
@ -82,7 +83,7 @@ export const Address = (props: IAddress) => {
let outPutAddress = address; let outPutAddress = address;
try { try {
outPutAddress = currency === "ONE" ? getAddress(address).bech32 : address; outPutAddress = currency === "ONE" ? getAddress(address).bech32 : toChecksumAddress(address);
} catch { } catch {
outPutAddress = address; outPutAddress = address;
} }

Loading…
Cancel
Save