diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 23f463a..bfd8747 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -70,10 +70,10 @@ const Details: React.FC = ({ const fourBytes = rawInputTo4Bytes(txData.data); const fourBytesEntry = use4Bytes(fourBytes); const fourBytesTxDesc = useMemo(() => { - if (!txData || !fourBytesEntry?.signatureWithoutParamNames) { + if (!txData || !fourBytesEntry?.signature) { return undefined; } - const sig = fourBytesEntry?.signatureWithoutParamNames; + const sig = fourBytesEntry?.signature; const functionFragment = Fragment.fromString(`function ${sig}`); const intf = new Interface([functionFragment]); return intf.parseTransaction({ data: txData.data, value: txData.value }); diff --git a/src/transaction/decoder/DecodedParamsTable.tsx b/src/transaction/decoder/DecodedParamsTable.tsx index 6f550f4..636dd67 100644 --- a/src/transaction/decoder/DecodedParamsTable.tsx +++ b/src/transaction/decoder/DecodedParamsTable.tsx @@ -28,7 +28,9 @@ const DecodedParamsTable: React.FC = ({ {!hasParamNames && ( - Parameter names are not available. + {paramTypes.length > 0 && paramTypes[0].name !== null + ? "Parameter names are estimated." + : "Parameter names are not available."} )} diff --git a/src/use4Bytes.ts b/src/use4Bytes.ts index 622f327..9fe9252 100644 --- a/src/use4Bytes.ts +++ b/src/use4Bytes.ts @@ -4,14 +4,12 @@ import { fourBytesURL } from "./url"; export type FourBytesEntry = { name: string; - signatureWithoutParamNames: string | undefined; - signatures: string[] | undefined; + signature: string | undefined; }; const simpleTransfer: FourBytesEntry = { name: "Transfer", - signatureWithoutParamNames: undefined, - signatures: undefined, + signature: undefined, }; const fullCache = new Map(); @@ -68,8 +66,7 @@ export const use4Bytes = ( const entry: FourBytesEntry = { name: method, - signatureWithoutParamNames: sig, - signatures: undefined, + signature: sig, }; setEntry(entry); fullCache.set(fourBytes, entry);