Token History
Slot |
Result |
Token |
Instruction Type |
Transaction Signature |
{mintAndTxs.map(({ mint, tx }) => (
))}
{fetchedFullHistory ? (
Fetched full history
) : (
)}
);
}
function TokenTransactionRow({
mint,
tx,
}: {
mint: PublicKey;
tx: ConfirmedSignatureInfo;
}) {
const details = useTransactionDetails(tx.signature);
const fetchDetails = useFetchTransactionDetails();
// Fetch details on load
React.useEffect(() => {
if (!details) fetchDetails(tx.signature);
}, []); // eslint-disable-line react-hooks/exhaustive-deps
const instructions = details?.transaction?.transaction.message.instructions;
if (instructions) {
const tokenInstructions = instructions.filter(
(ix) => "parsed" in ix && ix.program === "spl-token"
) as ParsedInstruction[];
if (tokenInstructions.length > 0) {
return (
<>
{tokenInstructions.map((ix, index) => {
const parsed = coerce(ix.parsed, ParsedInfo);
const { type: rawType } = parsed;
const type = coerce(rawType, TokenInstructionType);
const typeName = IX_TITLES[type];
let statusText;
let statusClass;
if (tx.err) {
statusClass = "warning";
statusText = "Failed";
} else {
statusClass = "success";
statusText = "Success";
}
return (