diff --git a/packages/ui/src/components/CallInfo.tsx b/packages/ui/src/components/CallInfo.tsx index 88f28568..48397a2c 100644 --- a/packages/ui/src/components/CallInfo.tsx +++ b/packages/ui/src/components/CallInfo.tsx @@ -252,7 +252,7 @@ const CallInfo = ({ () => aggregatedData.callData && getDecodeUrl(aggregatedData.callData), [aggregatedData, getDecodeUrl] ) - const hasArgs = useMemo(() => decodedCall && Object.keys(decodedCall).length > 0, [decodedCall]) + const hasArgs = useMemo(() => decodedCall && decodedCall?.value?.value, [decodedCall]) return (
- json5 - .stringify(e, { - replacer: (_, v) => - typeof v === 'bigint' ? v.toString() : v instanceof Binary ? v.asText() : v, - space: 4 - }) - // remove { and } - .slice(1, -1) - // remove trailing comma if any - .replace(/,\s*$/, '') +export const JSONprint = (e: unknown) => { + if (e === null || e === undefined) { + return '' + } + return ( + json5 + .stringify(e, { + replacer: (_, v) => + typeof v === 'bigint' ? v.toString() : v instanceof Binary ? v.asText() : v, + space: 4 + }) + // remove { and } + .slice(1, -1) + // remove trailing comma if any + .replace(/,\s*$/, '') + ) +}