Use authority in copy, hide default lockup info
This commit is contained in:
parent
26e4767fdd
commit
4d94de92c5
|
@ -11,6 +11,7 @@ export function StakeAccountDetailsCard({
|
|||
account: StakeAccount;
|
||||
}) {
|
||||
const { meta, stake } = account;
|
||||
const hasLockup = meta && meta.lockup.unixTimestamp > 0;
|
||||
return (
|
||||
<div className="card">
|
||||
<div className="card-header">
|
||||
|
@ -34,7 +35,7 @@ export function StakeAccountDetailsCard({
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorized Staker Address</td>
|
||||
<td>Stake Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={meta.authorized.staker.toBase58()}>
|
||||
<code>{meta.authorized.staker.toBase58()}</code>
|
||||
|
@ -43,7 +44,7 @@ export function StakeAccountDetailsCard({
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorized Withdrawer Address</td>
|
||||
<td>Withdraw Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={meta.authorized.withdrawer.toBase58()}>
|
||||
<code>{meta.authorized.withdrawer.toBase58()}</code>
|
||||
|
@ -51,28 +52,27 @@ export function StakeAccountDetailsCard({
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Lockup Expiry Epoch</td>
|
||||
<td className="text-right">{meta.lockup.epoch}</td>
|
||||
</tr>
|
||||
{hasLockup && (
|
||||
<tr>
|
||||
<td>Lockup Expiry Timestamp</td>
|
||||
<td className="text-right">
|
||||
{new Date(meta.lockup.unixTimestamp).toUTCString()}
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
|
||||
<tr>
|
||||
<td>Lockup Expiry Timestamp</td>
|
||||
<td className="text-right">
|
||||
{new Date(meta.lockup.unixTimestamp).toUTCString()}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Lockup Custodian Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={meta.lockup.custodian.toBase58()}>
|
||||
<code>
|
||||
{displayAddress(meta.lockup.custodian.toBase58())}
|
||||
</code>
|
||||
</Copyable>
|
||||
</td>
|
||||
</tr>
|
||||
{hasLockup && (
|
||||
<tr>
|
||||
<td>Lockup Custodian Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={meta.lockup.custodian.toBase58()}>
|
||||
<code>
|
||||
{displayAddress(meta.lockup.custodian.toBase58())}
|
||||
</code>
|
||||
</Copyable>
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ export function AuthorizeDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Old Authorized Address</td>
|
||||
<td>Old Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={authorizedPubkey}>
|
||||
<code>{authorizedPubkey}</code>
|
||||
|
@ -77,7 +77,7 @@ export function AuthorizeDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>New Authorized Address</td>
|
||||
<td>New Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={newAuthorizedPubkey}>
|
||||
<code>{newAuthorizedPubkey}</code>
|
||||
|
@ -86,7 +86,7 @@ export function AuthorizeDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorization Type</td>
|
||||
<td>Authority Type</td>
|
||||
<td className="text-right">{authorizationType}</td>
|
||||
</tr>
|
||||
</InstructionCard>
|
||||
|
|
|
@ -54,7 +54,7 @@ export function DeactivateDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorized Address</td>
|
||||
<td>Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={authorizedPubkey}>
|
||||
<code>{authorizedPubkey}</code>
|
||||
|
|
|
@ -64,7 +64,7 @@ export function DelegateDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorized Address</td>
|
||||
<td>Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={authorizedPubkey}>
|
||||
<code>{authorizedPubkey}</code>
|
||||
|
|
|
@ -3,7 +3,8 @@ import {
|
|||
TransactionInstruction,
|
||||
SignatureResult,
|
||||
StakeInstruction,
|
||||
StakeProgram
|
||||
StakeProgram,
|
||||
SystemProgram
|
||||
} from "@solana/web3.js";
|
||||
import { displayAddress } from "utils/tx";
|
||||
import { InstructionCard } from "../InstructionCard";
|
||||
|
@ -55,7 +56,7 @@ export function InitializeDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorized Staker Address</td>
|
||||
<td>Stake Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={stakerPubkey}>
|
||||
<code>{stakerPubkey}</code>
|
||||
|
@ -64,7 +65,7 @@ export function InitializeDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorized Withdrawer Address</td>
|
||||
<td>Withdraw Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={withdrawerPubkey}>
|
||||
<code>{withdrawerPubkey}</code>
|
||||
|
@ -72,26 +73,32 @@ export function InitializeDetailsCard(props: {
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Lockup Expiry Epoch</td>
|
||||
<td className="text-right">{params.lockup.epoch}</td>
|
||||
</tr>
|
||||
{params.lockup.epoch > 0 && (
|
||||
<tr>
|
||||
<td>Lockup Expiry Epoch</td>
|
||||
<td className="text-right">{params.lockup.epoch}</td>
|
||||
</tr>
|
||||
)}
|
||||
|
||||
<tr>
|
||||
<td>Lockup Expiry Timestamp</td>
|
||||
<td className="text-right">
|
||||
{new Date(params.lockup.unixTimestamp * 1000).toUTCString()}
|
||||
</td>
|
||||
</tr>
|
||||
{params.lockup.unixTimestamp > 0 && (
|
||||
<tr>
|
||||
<td>Lockup Expiry Timestamp</td>
|
||||
<td className="text-right">
|
||||
{new Date(params.lockup.unixTimestamp * 1000).toUTCString()}
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
|
||||
<tr>
|
||||
<td>Lockup Custodian Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={params.lockup.custodian.toBase58()}>
|
||||
<code>{displayAddress(params.lockup.custodian.toBase58())}</code>
|
||||
</Copyable>
|
||||
</td>
|
||||
</tr>
|
||||
{!params.lockup.custodian.equals(SystemProgram.programId) && (
|
||||
<tr>
|
||||
<td>Lockup Custodian Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={params.lockup.custodian.toBase58()}>
|
||||
<code>{displayAddress(params.lockup.custodian.toBase58())}</code>
|
||||
</Copyable>
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
</InstructionCard>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ export function SplitDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorized Address</td>
|
||||
<td>Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={authorizedPubkey}>
|
||||
<code>{authorizedPubkey}</code>
|
||||
|
|
|
@ -56,7 +56,7 @@ export function WithdrawDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorized Address</td>
|
||||
<td>Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={authorizedPubkey}>
|
||||
<code>{authorizedPubkey}</code>
|
||||
|
|
|
@ -54,7 +54,7 @@ export function NonceAdvanceDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorized Address</td>
|
||||
<td>Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={authorizedKey}>
|
||||
<code>{authorizedKey}</code>
|
||||
|
|
|
@ -55,7 +55,7 @@ export function NonceAuthorizeDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorized Address</td>
|
||||
<td>Old Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={authorizedKey}>
|
||||
<code>{authorizedKey}</code>
|
||||
|
@ -64,7 +64,7 @@ export function NonceAuthorizeDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>New Authorized Address</td>
|
||||
<td>New Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={newAuthorizedKey}>
|
||||
<code>{newAuthorizedKey}</code>
|
||||
|
|
|
@ -54,7 +54,7 @@ export function NonceInitializeDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorized Address</td>
|
||||
<td>Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={authorizedKey}>
|
||||
<code>{authorizedKey}</code>
|
||||
|
|
|
@ -57,7 +57,7 @@ export function NonceWithdrawDetailsCard(props: {
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Authorized Address</td>
|
||||
<td>Authority Address</td>
|
||||
<td className="text-right">
|
||||
<Copyable text={authorizedKey}>
|
||||
<code>{authorizedKey}</code>
|
||||
|
|
Loading…
Reference in New Issue