Added display strings for tx order type
This commit is contained in:
parent
c2e4f1d007
commit
775b4a7de9
39
apps/explorer/src/app/components/txs/tx-order-type/index.tsx
Normal file
39
apps/explorer/src/app/components/txs/tx-order-type/index.tsx
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
interface TxOrderTypeProps {
|
||||||
|
orderType: string;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface StringMap {
|
||||||
|
[key: string]: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Using https://github.com/vegaprotocol/protos/blob/e0f646ce39aab1fc66a9200ceec0262306d3beb3/commands/transaction.go#L93 as a reference
|
||||||
|
const displayString: StringMap = {
|
||||||
|
OrderSubmission: 'Order Submission',
|
||||||
|
OrderCancellation: 'Order Cancellation',
|
||||||
|
OrderAmendment: 'Order Amendment',
|
||||||
|
VoteSubmission: 'Vote Submission',
|
||||||
|
WithdrawSubmission: 'Withdraw Submission',
|
||||||
|
LiquidityProvisionSubmission: 'Liquidity Provision',
|
||||||
|
LiquidityProvisionCancellation: 'Liquidity Cancellation',
|
||||||
|
LiquidityProvisionAmendment: 'Liquidity Amendment',
|
||||||
|
ProposalSubmission: 'Governance Proposal',
|
||||||
|
AnnounceNode: 'Node Announcement',
|
||||||
|
NodeVote: 'Node Vote',
|
||||||
|
NodeSignature: 'Node Signature',
|
||||||
|
ChainEvent: 'Chain Event',
|
||||||
|
OracleDataSubmission: 'Oracle Data',
|
||||||
|
DelegateSubmission: 'Delegation',
|
||||||
|
UndelegateSubmission: 'Undelegation',
|
||||||
|
KeyRotateSubmission: 'Key Rotation',
|
||||||
|
StateVariableProposal: 'State Variable Proposal',
|
||||||
|
Transfer: 'Transfer',
|
||||||
|
CancelTransfer: 'Cancel Transfer',
|
||||||
|
ValidatorHeartbeat: 'Validator Heartbeat',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const TxOrderType = ({ orderType, className }: TxOrderTypeProps) => {
|
||||||
|
return (
|
||||||
|
<span className={className}>{displayString[orderType] || orderType}</span>
|
||||||
|
);
|
||||||
|
};
|
@ -5,6 +5,7 @@ import { DATA_SOURCES } from '../../../config';
|
|||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { RenderFetched } from '../../render-fetched';
|
import { RenderFetched } from '../../render-fetched';
|
||||||
import { TruncateInline } from '../../truncate/truncate';
|
import { TruncateInline } from '../../truncate/truncate';
|
||||||
|
import { TxOrderType } from '../tx-order-type';
|
||||||
|
|
||||||
interface TxsPerBlockProps {
|
interface TxsPerBlockProps {
|
||||||
blockHeight: string | undefined;
|
blockHeight: string | undefined;
|
||||||
@ -62,7 +63,9 @@ export const TxsPerBlock = ({ blockHeight }: TxsPerBlockProps) => {
|
|||||||
className="font-mono"
|
className="font-mono"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>{Type}</td>
|
<td>
|
||||||
|
<TxOrderType orderType={Type} />
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
Loading…
Reference in New Issue
Block a user