diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 6a1f4d6..500d45e 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -1,5 +1,6 @@ -import React from "react"; +import React, { useMemo, useState } from "react"; import { formatEther } from "@ethersproject/units"; +import { toUtf8String } from "@ethersproject/strings"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCheckCircle } from "@fortawesome/free-solid-svg-icons/faCheckCircle"; import { faCube } from "@fortawesome/free-solid-svg-icons/faCube"; @@ -40,6 +41,17 @@ const Details: React.FC = ({ const hasEIP1559 = txData.blockBaseFeePerGas !== undefined && txData.blockBaseFeePerGas !== null; + const [inputMode, setInputMode] = useState(0); + + const utfInput = useMemo(() => { + try { + return txData && toUtf8String(txData.data); + } catch (err) { + console.error("Error while converting input data to string"); + console.error(err); + return ""; + } + }, [txData]); return ( @@ -252,11 +264,31 @@ const Details: React.FC = ({ N/A -