-
- From Address
- {!fromMeta.isWritable && (
- Readonly
- )}
- {fromMeta.isSigner && (
- Signer
- )}
- |
+ From Address |
{from}
diff --git a/explorer/src/components/instruction/system/CreateDetailsCard.tsx b/explorer/src/components/instruction/system/CreateDetailsCard.tsx
index 8a37bdf4e3..4b979b1d12 100644
--- a/explorer/src/components/instruction/system/CreateDetailsCard.tsx
+++ b/explorer/src/components/instruction/system/CreateDetailsCard.tsx
@@ -28,7 +28,6 @@ export function CreateDetailsCard(props: {
const from = params.fromPubkey.toBase58();
const newKey = params.newAccountPubkey.toBase58();
- const [fromMeta, newMeta] = ix.keys;
return (
-
- From Address
- {!fromMeta.isWritable && (
- Readonly
- )}
- {fromMeta.isSigner && (
- Signer
- )}
- |
+ From Address |
{from}
@@ -64,15 +55,7 @@ export function CreateDetailsCard(props: {
|
-
- New Address
- {!newMeta.isWritable && (
- Readonly
- )}
- {newMeta.isSigner && (
- Signer
- )}
- |
+ New Address |
{newKey}
diff --git a/explorer/src/components/instruction/system/CreateWithSeedDetailsCard.tsx b/explorer/src/components/instruction/system/CreateWithSeedDetailsCard.tsx
index 5ef3b4a94d..e914420aa0 100644
--- a/explorer/src/components/instruction/system/CreateWithSeedDetailsCard.tsx
+++ b/explorer/src/components/instruction/system/CreateWithSeedDetailsCard.tsx
@@ -29,7 +29,6 @@ export function CreateWithSeedDetailsCard(props: {
const from = params.fromPubkey.toBase58();
const newKey = params.newAccountPubkey.toBase58();
const baseKey = params.basePubkey.toBase58();
- const [fromMeta, newMeta] = ix.keys;
return (
-
- From Address
- {!fromMeta.isWritable && (
- Readonly
- )}
- {fromMeta.isSigner && (
- Signer
- )}
- |
+ From Address |
{from}
@@ -65,15 +56,7 @@ export function CreateWithSeedDetailsCard(props: {
|
-
- New Address
- {!newMeta.isWritable && (
- Readonly
- )}
- {newMeta.isSigner && (
- Signer
- )}
- |
+ New Address |
{newKey}
@@ -82,15 +65,7 @@ export function CreateWithSeedDetailsCard(props: {
|
-
- New Address
- {!newMeta.isWritable && (
- Readonly
- )}
- {newMeta.isSigner && (
- Signer
- )}
- |
+ New Address |
{newKey}
diff --git a/explorer/src/components/instruction/system/NonceAdvanceDetailsCard.tsx b/explorer/src/components/instruction/system/NonceAdvanceDetailsCard.tsx
index 626c9f3110..c606b71fd0 100644
--- a/explorer/src/components/instruction/system/NonceAdvanceDetailsCard.tsx
+++ b/explorer/src/components/instruction/system/NonceAdvanceDetailsCard.tsx
@@ -27,7 +27,6 @@ export function NonceAdvanceDetailsCard(props: {
const nonceKey = params.noncePubkey.toBase58();
const authorizedKey = params.authorizedPubkey.toBase58();
- const [nonceMeta, , authorizedMeta] = ix.keys;
return (
-
- Nonce Address
- {!nonceMeta.isWritable && (
- Readonly
- )}
- {nonceMeta.isSigner && (
- Signer
- )}
- |
+ Nonce Address |
{nonceKey}
@@ -63,15 +54,7 @@ export function NonceAdvanceDetailsCard(props: {
|
-
- Authorized Address
- {!authorizedMeta.isWritable && (
- Readonly
- )}
- {authorizedMeta.isSigner && (
- Signer
- )}
- |
+ Authorized Address |
{authorizedKey}
diff --git a/explorer/src/components/instruction/system/NonceAuthorizeDetailsCard.tsx b/explorer/src/components/instruction/system/NonceAuthorizeDetailsCard.tsx
index 7eab86df4a..6cd399c77f 100644
--- a/explorer/src/components/instruction/system/NonceAuthorizeDetailsCard.tsx
+++ b/explorer/src/components/instruction/system/NonceAuthorizeDetailsCard.tsx
@@ -28,7 +28,6 @@ export function NonceAuthorizeDetailsCard(props: {
const nonceKey = params.noncePubkey.toBase58();
const authorizedKey = params.authorizedPubkey.toBase58();
const newAuthorizedKey = params.newAuthorizedPubkey.toBase58();
- const [nonceMeta, authorizedMeta] = ix.keys;
return (
-
- Nonce Address
- {!nonceMeta.isWritable && (
- Readonly
- )}
- {nonceMeta.isSigner && (
- Signer
- )}
- |
+ Nonce Address |
{nonceKey}
@@ -64,15 +55,7 @@ export function NonceAuthorizeDetailsCard(props: {
|
-
- Authorized Address
- {!authorizedMeta.isWritable && (
- Readonly
- )}
- {authorizedMeta.isSigner && (
- Signer
- )}
- |
+ Authorized Address |
{authorizedKey}
diff --git a/explorer/src/components/instruction/system/NonceInitializeDetailsCard.tsx b/explorer/src/components/instruction/system/NonceInitializeDetailsCard.tsx
index 2a4c2637d9..d1773568a2 100644
--- a/explorer/src/components/instruction/system/NonceInitializeDetailsCard.tsx
+++ b/explorer/src/components/instruction/system/NonceInitializeDetailsCard.tsx
@@ -27,7 +27,6 @@ export function NonceInitializeDetailsCard(props: {
const nonceKey = params.noncePubkey.toBase58();
const authorizedKey = params.authorizedPubkey.toBase58();
- const [nonceMeta] = ix.keys;
return (
-
- Nonce Address
- {!nonceMeta.isWritable && (
- Readonly
- )}
- {nonceMeta.isSigner && (
- Signer
- )}
- |
+ Nonce Address |
{nonceKey}
diff --git a/explorer/src/components/instruction/system/NonceWithdrawDetailsCard.tsx b/explorer/src/components/instruction/system/NonceWithdrawDetailsCard.tsx
index b679e9a455..e2a8269175 100644
--- a/explorer/src/components/instruction/system/NonceWithdrawDetailsCard.tsx
+++ b/explorer/src/components/instruction/system/NonceWithdrawDetailsCard.tsx
@@ -30,7 +30,6 @@ export function NonceWithdrawDetailsCard(props: {
const toKey = params.toPubkey.toBase58();
const authorizedKey = params.authorizedPubkey.toBase58();
const lamports = params.lamports;
- const [nonceMeta, toMeta, , , authorizedMeta] = ix.keys;
return (
-
- Nonce Address
- {!nonceMeta.isWritable && (
- Readonly
- )}
- {nonceMeta.isSigner && (
- Signer
- )}
- |
+ Nonce Address |
{nonceKey}
@@ -66,15 +57,7 @@ export function NonceWithdrawDetailsCard(props: {
|
-
- Authorized Address
- {!authorizedMeta.isWritable && (
- Readonly
- )}
- {authorizedMeta.isSigner && (
- Signer
- )}
- |
+ Authorized Address |
{authorizedKey}
@@ -83,15 +66,7 @@ export function NonceWithdrawDetailsCard(props: {
|
-
- To Address
- {!toMeta.isWritable && (
- Readonly
- )}
- {toMeta.isSigner && (
- Signer
- )}
- |
+ To Address |
{toKey}
diff --git a/explorer/src/components/instruction/system/SystemDetailsCard.tsx b/explorer/src/components/instruction/system/SystemDetailsCard.tsx
new file mode 100644
index 0000000000..16feb8702b
--- /dev/null
+++ b/explorer/src/components/instruction/system/SystemDetailsCard.tsx
@@ -0,0 +1,53 @@
+import React from "react";
+import {
+ SystemInstruction,
+ TransactionInstruction,
+ SignatureResult
+} from "@solana/web3.js";
+
+import { UnknownDetailsCard } from "../UnknownDetailsCard";
+import { TransferDetailsCard } from "./TransferDetailsCard";
+import { AssignDetailsCard } from "./AssignDetailsCard";
+import { CreateDetailsCard } from "./CreateDetailsCard";
+import { CreateWithSeedDetailsCard } from "./CreateWithSeedDetailsCard";
+import { NonceInitializeDetailsCard } from "./NonceInitializeDetailsCard";
+import { NonceAdvanceDetailsCard } from "./NonceAdvanceDetailsCard";
+import { NonceWithdrawDetailsCard } from "./NonceWithdrawDetailsCard";
+import { NonceAuthorizeDetailsCard } from "./NonceAuthorizeDetailsCard";
+
+type DetailsProps = {
+ ix: TransactionInstruction;
+ result: SignatureResult;
+ index: number;
+};
+
+export function SystemDetailsCard(props: DetailsProps) {
+ let systemInstructionType;
+ try {
+ systemInstructionType = SystemInstruction.decodeInstructionType(props.ix);
+ } catch (err) {
+ console.error(err);
+ return ;
+ }
+
+ switch (systemInstructionType) {
+ case "Create":
+ return ;
+ case "Assign":
+ return ;
+ case "Transfer":
+ return ;
+ case "CreateWithSeed":
+ return ;
+ case "AdvanceNonceAccount":
+ return ;
+ case "WithdrawNonceAccount":
+ return ;
+ case "AuthorizeNonceAccount":
+ return ;
+ case "InitializeNonceAccount":
+ return ;
+ default:
+ return ;
+ }
+}
diff --git a/explorer/src/components/instruction/system/TransferDetailsCard.tsx b/explorer/src/components/instruction/system/TransferDetailsCard.tsx
index caf08e7f89..160e80e389 100644
--- a/explorer/src/components/instruction/system/TransferDetailsCard.tsx
+++ b/explorer/src/components/instruction/system/TransferDetailsCard.tsx
@@ -28,7 +28,6 @@ export function TransferDetailsCard(props: {
const from = transfer.fromPubkey.toBase58();
const to = transfer.toPubkey.toBase58();
- const [fromMeta, toMeta] = ix.keys;
return (
@@ -41,15 +40,7 @@ export function TransferDetailsCard(props: {
-
- From Address
- {!fromMeta.isWritable && (
- Readonly
- )}
- {fromMeta.isSigner && (
- Signer
- )}
- |
+ From Address |
{from}
@@ -58,15 +49,7 @@ export function TransferDetailsCard(props: {
|
-
- To Address
- {!toMeta.isWritable && (
- Readonly
- )}
- {toMeta.isSigner && (
- Signer
- )}
- |
+ To Address |
{to}
| | | | | | | |