feat(explorer): view 'Cancel Stop Order' Transactions (#4521)
This commit is contained in:
parent
140f16f637
commit
f3b72b894e
@ -11,6 +11,7 @@ import { TxDetailsBatch } from './tx-batch';
|
|||||||
import { TxDetailsChainEvent } from './tx-chain-event';
|
import { TxDetailsChainEvent } from './tx-chain-event';
|
||||||
import { TxDetailsNodeVote } from './tx-node-vote';
|
import { TxDetailsNodeVote } from './tx-node-vote';
|
||||||
import { TxDetailsOrderCancel } from './tx-order-cancel';
|
import { TxDetailsOrderCancel } from './tx-order-cancel';
|
||||||
|
import { TxDetailsStopOrderCancel } from './tx-stop-order-cancel';
|
||||||
import { TxDetailsOrderAmend } from './tx-order-amend';
|
import { TxDetailsOrderAmend } from './tx-order-amend';
|
||||||
import { TxDetailsWithdrawSubmission } from './tx-withdraw-submission';
|
import { TxDetailsWithdrawSubmission } from './tx-withdraw-submission';
|
||||||
import { TxDetailsDelegate } from './tx-delegation';
|
import { TxDetailsDelegate } from './tx-delegation';
|
||||||
@ -85,6 +86,8 @@ function getTransactionComponent(txData?: BlockExplorerTransactionResult) {
|
|||||||
return TxDetailsProtocolUpgrade;
|
return TxDetailsProtocolUpgrade;
|
||||||
case 'Cancel Order':
|
case 'Cancel Order':
|
||||||
return TxDetailsOrderCancel;
|
return TxDetailsOrderCancel;
|
||||||
|
case 'Stop Orders Cancellation':
|
||||||
|
return TxDetailsStopOrderCancel;
|
||||||
case 'Amend Order':
|
case 'Amend Order':
|
||||||
return TxDetailsOrderAmend;
|
return TxDetailsOrderAmend;
|
||||||
case 'Validator Heartbeat':
|
case 'Validator Heartbeat':
|
||||||
|
@ -0,0 +1,60 @@
|
|||||||
|
import { t } from '@vegaprotocol/i18n';
|
||||||
|
import type { BlockExplorerTransactionResult } from '../../../routes/types/block-explorer-response';
|
||||||
|
import { MarketLink } from '../../links/';
|
||||||
|
import type { TendermintBlocksResponse } from '../../../routes/blocks/tendermint-blocks-response';
|
||||||
|
import { TxDetailsShared } from './shared/tx-details-shared';
|
||||||
|
import { TableCell, TableRow, TableWithTbody } from '../../table';
|
||||||
|
import { CancelSummary } from '../../order-summary/order-cancellation';
|
||||||
|
import Hash from '../../links/hash';
|
||||||
|
import type { components } from '../../../../types/explorer';
|
||||||
|
|
||||||
|
export type StopOrderCancellationTransaction =
|
||||||
|
components['schemas']['v1StopOrdersCancellation'];
|
||||||
|
|
||||||
|
interface TxDetailsStopOrderCancelProps {
|
||||||
|
txData: BlockExplorerTransactionResult | undefined;
|
||||||
|
pubKey: string | undefined;
|
||||||
|
blockData: TendermintBlocksResponse | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Someone cancelled a stop order
|
||||||
|
*/
|
||||||
|
export const TxDetailsStopOrderCancel = ({
|
||||||
|
txData,
|
||||||
|
pubKey,
|
||||||
|
blockData,
|
||||||
|
}: TxDetailsStopOrderCancelProps) => {
|
||||||
|
if (!txData || !txData.command) {
|
||||||
|
return <>{t('Awaiting Block Explorer transaction details')}</>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const command: StopOrderCancellationTransaction =
|
||||||
|
txData.command.stopOrdersCancellation;
|
||||||
|
|
||||||
|
const { marketId, stopOrderId } = command;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TableWithTbody className="mb-8" allowWrap={true}>
|
||||||
|
<TxDetailsShared txData={txData} pubKey={pubKey} blockData={blockData} />
|
||||||
|
<TableRow modifier="bordered">
|
||||||
|
<TableCell>{t('Cancel stop order')}</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
{stopOrderId ? (
|
||||||
|
<Hash text={stopOrderId} />
|
||||||
|
) : (
|
||||||
|
<CancelSummary orderId={stopOrderId} marketId={marketId} />
|
||||||
|
)}
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
{marketId ? (
|
||||||
|
<TableRow modifier="bordered">
|
||||||
|
<TableCell>{t('Market')}</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<MarketLink id={marketId} />
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
) : null}
|
||||||
|
</TableWithTbody>
|
||||||
|
);
|
||||||
|
};
|
@ -34,6 +34,7 @@ export type FilterOption =
|
|||||||
| 'Protocol Upgrade'
|
| 'Protocol Upgrade'
|
||||||
| 'Register new Node'
|
| 'Register new Node'
|
||||||
| 'State Variable Proposal'
|
| 'State Variable Proposal'
|
||||||
|
| 'Stop Orders Cancellation'
|
||||||
| 'Submit Oracle Data'
|
| 'Submit Oracle Data'
|
||||||
| 'Submit Order'
|
| 'Submit Order'
|
||||||
| 'Transfer Funds'
|
| 'Transfer Funds'
|
||||||
@ -53,6 +54,7 @@ export const PrimaryFilterOptions: FilterOption[] = [
|
|||||||
'Delegate',
|
'Delegate',
|
||||||
'Liquidity Provision Order',
|
'Liquidity Provision Order',
|
||||||
'Proposal',
|
'Proposal',
|
||||||
|
'Stop Orders Cancellation',
|
||||||
'Submit Oracle Data',
|
'Submit Oracle Data',
|
||||||
'Submit Order',
|
'Submit Order',
|
||||||
'Transfer Funds',
|
'Transfer Funds',
|
||||||
|
Loading…
Reference in New Issue
Block a user