explorer: Add account bytes to tx inspector (#26200)
This commit is contained in:
parent
b26c79b77b
commit
8ef33a53a5
|
@ -81,21 +81,21 @@ function AccountInfo({
|
||||||
const errorMessage = validator && validator(info.data);
|
const errorMessage = validator && validator(info.data);
|
||||||
if (errorMessage) return <span className="text-warning">{errorMessage}</span>;
|
if (errorMessage) return <span className="text-warning">{errorMessage}</span>;
|
||||||
|
|
||||||
if (info.data.details?.executable) {
|
if (!info.data.details) {
|
||||||
return <span className="text-muted">Executable Program</span>;
|
return <span className="text-muted">Account doesn't exist</span>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const owner = info.data.details?.owner;
|
const owner = info.data.details.owner;
|
||||||
const ownerAddress = owner?.toBase58();
|
const ownerAddress = owner.toBase58();
|
||||||
const ownerLabel = ownerAddress && addressLabel(ownerAddress, cluster);
|
const ownerLabel = addressLabel(ownerAddress, cluster);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span className="text-muted">
|
<span className="text-muted">
|
||||||
{ownerAddress
|
{`Owned by ${ownerLabel || ownerAddress}.`}
|
||||||
? `Owned by ${
|
{` Balance is ${lamportsToSolString(info.data.lamports)} SOL.`}
|
||||||
ownerLabel || ownerAddress
|
{` Size is ${new Intl.NumberFormat("en-US").format(
|
||||||
}. Balance is ${lamportsToSolString(info.data.lamports)} SOL`
|
info.data.details.space
|
||||||
: "Account doesn't exist"}
|
)} byte(s).`}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue