import React from "react"; import AddressHighlighter from "../components/AddressHighlighter"; import DecoratedAddressLink from "../components/DecoratedAddressLink"; import Copy from "../components/Copy"; import { ParamType } from "@ethersproject/abi"; import { TransactionData } from "../types"; type DecodedParamRowProps = { prefix?: string; i?: number | undefined; r: any; paramType: ParamType; txData: TransactionData; }; const DecodedParamRow: React.FC = ({ prefix, i, r, paramType, txData, }) => { return ( <> {prefix && {prefix}} {paramType.name ?? param_{i}}{" "} {i !== undefined && ( ({i}) )} {paramType.type} {paramType.baseType === "address" ? (
) : paramType.baseType === "bool" ? ( {r.toString()} ) : paramType.baseType === "bytes" ? ( {r.toString()}{" "} {r.toString().length / 2 - 1}{" "} {r.toString().length / 2 - 1 === 1 ? "byte" : "bytes"} ) : paramType.baseType === "tuple" ? ( <> ) : ( r.toString() )} {paramType.baseType === "tuple" && r.map((e: any, idx: number) => ( ))} ); }; export default React.memo(DecodedParamRow);