2020-05-09 18:28:58 +08:00
|
|
|
import React from "react";
|
|
|
|
import {
|
|
|
|
TransactionInstruction,
|
|
|
|
SystemProgram,
|
|
|
|
SignatureResult,
|
2020-06-24 16:07:47 +08:00
|
|
|
SystemInstruction,
|
2020-05-09 18:28:58 +08:00
|
|
|
} from "@solana/web3.js";
|
|
|
|
import { InstructionCard } from "../InstructionCard";
|
|
|
|
import Copyable from "components/Copyable";
|
|
|
|
import { UnknownDetailsCard } from "../UnknownDetailsCard";
|
2020-08-03 01:44:47 +08:00
|
|
|
import Address from "components/common/Address";
|
2020-05-09 18:28:58 +08:00
|
|
|
|
|
|
|
export function AssignWithSeedDetailsCard(props: {
|
|
|
|
ix: TransactionInstruction;
|
|
|
|
index: number;
|
|
|
|
result: SignatureResult;
|
|
|
|
}) {
|
|
|
|
const { ix, index, result } = props;
|
|
|
|
|
|
|
|
let params;
|
|
|
|
try {
|
|
|
|
params = SystemInstruction.decodeAssignWithSeed(ix);
|
|
|
|
} catch (err) {
|
|
|
|
console.error(err);
|
|
|
|
return <UnknownDetailsCard {...props} />;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<InstructionCard
|
|
|
|
ix={ix}
|
|
|
|
index={index}
|
|
|
|
result={result}
|
|
|
|
title="Assign Account w/ Seed"
|
|
|
|
>
|
|
|
|
<tr>
|
|
|
|
<td>Program</td>
|
2020-08-04 20:44:16 +08:00
|
|
|
<td className="text-lg-right">
|
2020-08-03 01:44:47 +08:00
|
|
|
<Address pubkey={SystemProgram.programId} alignRight link />
|
2020-05-09 18:28:58 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Account Address</td>
|
2020-08-04 20:44:16 +08:00
|
|
|
<td className="text-lg-right">
|
2020-08-03 01:44:47 +08:00
|
|
|
<Address pubkey={params.accountPubkey} alignRight link />
|
2020-05-09 18:28:58 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Base Address</td>
|
2020-08-04 20:44:16 +08:00
|
|
|
<td className="text-lg-right">
|
2020-08-03 01:44:47 +08:00
|
|
|
<Address pubkey={params.basePubkey} alignRight link />
|
2020-05-09 18:28:58 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Seed</td>
|
2020-08-04 20:44:16 +08:00
|
|
|
<td className="text-lg-right">
|
2020-05-23 16:45:07 +08:00
|
|
|
<Copyable right text={params.seed}>
|
2020-05-09 18:28:58 +08:00
|
|
|
<code>{params.seed}</code>
|
|
|
|
</Copyable>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Assigned Owner</td>
|
2020-08-04 20:44:16 +08:00
|
|
|
<td className="text-lg-right">
|
2020-08-03 01:44:47 +08:00
|
|
|
<Address pubkey={params.programId} alignRight link />
|
2020-05-09 18:28:58 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</InstructionCard>
|
|
|
|
);
|
|
|
|
}
|