diff --git a/explorer/src/components/account/history/TokenInstructionsCard.tsx b/explorer/src/components/account/history/TokenInstructionsCard.tsx index e8bf1bd2e6..73cbf31251 100644 --- a/explorer/src/components/account/history/TokenInstructionsCard.tsx +++ b/explorer/src/components/account/history/TokenInstructionsCard.tsx @@ -185,11 +185,15 @@ function isRelevantInstruction( account.equals(pubkey) || mintMap.get(account.toBase58())?.mint === address ); - } else { + } else if ( + typeof instruction.parsed === "object" && + "info" in instruction.parsed + ) { return Object.entries(instruction.parsed.info).some( ([key, value]) => value === address || (typeof value === "string" && mintMap.get(value)?.mint === address) ); } + return false; } diff --git a/explorer/src/utils/instruction.ts b/explorer/src/utils/instruction.ts index 6ea01cd6af..36a13469e5 100644 --- a/explorer/src/utils/instruction.ts +++ b/explorer/src/utils/instruction.ts @@ -47,7 +47,11 @@ export class InstructionContainer { this.instructions = parsedTransaction.transaction.message.instructions.map( (instruction) => { if ("parsed" in instruction) { - instruction.parsed = create(instruction.parsed, ParsedInfo); + if (typeof instruction.parsed === "object") { + instruction.parsed = create(instruction.parsed, ParsedInfo); + } else if (typeof instruction.parsed !== "string") { + throw new Error("Unexpected parsed response"); + } } return {