Decode create account with seed instructions

This commit is contained in:
armaniferrante 2021-03-11 11:26:19 -08:00
parent b409d1474d
commit 77a4a242c3
No known key found for this signature in database
GPG Key ID: 58BEF301E91F7828
4 changed files with 8 additions and 5 deletions

View File

@ -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 (
<Typography>
<Typography gutterBottom={gutterBottom}>
{label}:{' '}
{link ? (
<Link href="#" onClick={onClick}>

View File

@ -4,6 +4,7 @@ import LabelValue from './LabelValue';
const TYPE_LABELS = {
systemCreate: 'Create account',
systemCreateWithSeed: 'Create account with seed',
systemTransfer: 'Transfer SOL',
};

View File

@ -17,9 +17,10 @@ export default function UnknownInstruction({ instruction, onOpenAddress }) {
label='Program'
value={instruction.programId?.toBase58()}
link={true}
gutterBottom={true}
onClick={() => onOpenAddress(instruction.programId.toBase58())}
/>
{instruction.accountMetas.map((accountMeta, index) => {
{instruction.accountMetas && instruction.accountMetas.map((accountMeta, index) => {
return (
<>
<LabelValue
@ -29,7 +30,7 @@ export default function UnknownInstruction({ instruction, onOpenAddress }) {
link={true}
onClick={() => onOpenAddress(accountMeta.publicKey.toBase58())}
/>
<Typography gutterBottom>isWritable: {accountMeta.isWritable.toString()}</Typography>
<Typography gutterBottom>Writable: {accountMeta.isWritable.toString()}</Typography>
</>
);
})}

View File

@ -485,6 +485,7 @@ function ApproveSignatureForm({
onOpenAddress={onOpenAddress}
/>
);
case 'systemCreateWithSeed':
case 'systemCreate':
case 'systemTransfer':
return (