diff --git a/apps/explorer/src/app/components/txs/details/tx-eth-key-rotate.tsx b/apps/explorer/src/app/components/txs/details/tx-eth-key-rotate.tsx new file mode 100644 index 000000000..a38258838 --- /dev/null +++ b/apps/explorer/src/app/components/txs/details/tx-eth-key-rotate.tsx @@ -0,0 +1,80 @@ +import { t } from '@vegaprotocol/react-helpers'; +import type { BlockExplorerTransactionResult } from '../../../routes/types/block-explorer-response'; +import type { TendermintBlocksResponse } from '../../../routes/blocks/tendermint-blocks-response'; +import { TxDetailsShared } from './shared/tx-details-shared'; +import { TableCell, TableRow, TableWithTbody } from '../../table'; +import type { components } from '../../../../types/explorer'; +import { + EthExplorerLink, + EthExplorerLinkTypes, +} from '../../links/eth-explorer-link/eth-explorer-link'; +import { BlockLink } from '../../links'; + +type EthKeyRotate = components['schemas']['v1EthereumKeyRotateSubmission']; +interface TxDetailsEthKeyRotateProps { + txData: BlockExplorerTransactionResult | undefined; + pubKey: string | undefined; + blockData: TendermintBlocksResponse | undefined; +} + +/** + * A node is changing ethereum key + */ +export const TxDetailsEthKeyRotate = ({ + txData, + pubKey, + blockData, +}: TxDetailsEthKeyRotateProps) => { + if (!txData) { + return <>{t('Awaiting Block Explorer transaction details')}; + } + + const k: EthKeyRotate = txData.command; + + return ( + + + {k.targetBlock ? ( + + {t('Target block')} + + + + + ) : null} + {k.currentAddress ? ( + + {t('Old Address')} + + + + + ) : null} + {k.newAddress ? ( + + {t('New Address')} + + + + + ) : null} + {k.submitterAddress ? ( + + {t('Submitter address')} + + + + + ) : null} + + ); +}; diff --git a/apps/explorer/src/app/components/txs/details/tx-key-rotate.tsx b/apps/explorer/src/app/components/txs/details/tx-key-rotate.tsx new file mode 100644 index 000000000..35dd80725 --- /dev/null +++ b/apps/explorer/src/app/components/txs/details/tx-key-rotate.tsx @@ -0,0 +1,67 @@ +import { t } from '@vegaprotocol/react-helpers'; +import type { BlockExplorerTransactionResult } from '../../../routes/types/block-explorer-response'; +import type { TendermintBlocksResponse } from '../../../routes/blocks/tendermint-blocks-response'; +import { TxDetailsShared } from './shared/tx-details-shared'; +import { TableCell, TableRow, TableWithTbody } from '../../table'; +import type { components } from '../../../../types/explorer'; +import { BlockLink, PartyLink } from '../../links'; + +type KeyRotate = components['schemas']['v1KeyRotateSubmission']; +interface TxDetailsKeyRotateProps { + txData: BlockExplorerTransactionResult | undefined; + pubKey: string | undefined; + blockData: TendermintBlocksResponse | undefined; +} + +/** + * A node is changing Vega key + */ +export const TxDetailsKeyRotate = ({ + txData, + pubKey, + blockData, +}: TxDetailsKeyRotateProps) => { + if (!txData) { + return <>{t('Awaiting Block Explorer transaction details')}; + } + + const k: KeyRotate = txData.command; + + return ( + + + {k.targetBlock ? ( + + {t('Target block')} + + + + + ) : null} + {k.currentPubKeyHash ? ( + + {t('Old Address')} + + + + + ) : null} + {k.currentPubKeyHash ? ( + + {t('New Address')} + + + + + ) : null} + {k.newPubKeyIndex ? ( + + {t('Key index')} + + {k.newPubKeyIndex} + + + ) : null} + + ); +};