From 77a4a242c3dd095fe3eda38a5ed5a4705c292c9f Mon Sep 17 00:00:00 2001 From: armaniferrante Date: Thu, 11 Mar 2021 11:26:19 -0800 Subject: [PATCH] Decode create account with seed instructions --- src/components/instructions/LabelValue.js | 4 ++-- src/components/instructions/SystemInstruction.js | 1 + src/components/instructions/UnknownInstruction.js | 7 ++++--- src/pages/PopupPage.js | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/instructions/LabelValue.js b/src/components/instructions/LabelValue.js index d4fc29b..9884f06 100644 --- a/src/components/instructions/LabelValue.js +++ b/src/components/instructions/LabelValue.js @@ -2,9 +2,9 @@ import React from 'react'; import Link from '@material-ui/core/Link'; import Typography from '@material-ui/core/Typography'; -export default function LabelValue({ label, value, link = false, onClick }) { +export default function LabelValue({ label, value, link = false, onClick, gutterBottom }) { return ( - + {label}:{' '} {link ? ( diff --git a/src/components/instructions/SystemInstruction.js b/src/components/instructions/SystemInstruction.js index 84adec4..7907858 100644 --- a/src/components/instructions/SystemInstruction.js +++ b/src/components/instructions/SystemInstruction.js @@ -4,6 +4,7 @@ import LabelValue from './LabelValue'; const TYPE_LABELS = { systemCreate: 'Create account', + systemCreateWithSeed: 'Create account with seed', systemTransfer: 'Transfer SOL', }; diff --git a/src/components/instructions/UnknownInstruction.js b/src/components/instructions/UnknownInstruction.js index 85df2a4..e48205b 100644 --- a/src/components/instructions/UnknownInstruction.js +++ b/src/components/instructions/UnknownInstruction.js @@ -3,7 +3,7 @@ import LabelValue from './LabelValue'; import Typography from '@material-ui/core/Typography'; export default function UnknownInstruction({ instruction, onOpenAddress }) { - return ( + return ( <> onOpenAddress(instruction.programId.toBase58())} /> - {instruction.accountMetas.map((accountMeta, index) => { + {instruction.accountMetas && instruction.accountMetas.map((accountMeta, index) => { return ( <> onOpenAddress(accountMeta.publicKey.toBase58())} /> - isWritable: {accountMeta.isWritable.toString()} + Writable: {accountMeta.isWritable.toString()} ); })} diff --git a/src/pages/PopupPage.js b/src/pages/PopupPage.js index 7361fee..cfbde19 100644 --- a/src/pages/PopupPage.js +++ b/src/pages/PopupPage.js @@ -485,6 +485,7 @@ function ApproveSignatureForm({ onOpenAddress={onOpenAddress} /> ); + case 'systemCreateWithSeed': case 'systemCreate': case 'systemTransfer': return (