From 40f02ecf89e12207dd7d39d9461749caadf7d422 Mon Sep 17 00:00:00 2001
From: Edd
Date: Wed, 6 Dec 2023 10:45:35 +0000
Subject: [PATCH] feat(explorer): add type details to orders in tx list and
details (#5432)
---
.../deterministic-order-details.tsx | 16 +++++++++++++---
.../src/app/components/txs/tx-order-type.tsx | 6 ++++++
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/apps/explorer/src/app/components/order-details/deterministic-order-details.tsx b/apps/explorer/src/app/components/order-details/deterministic-order-details.tsx
index 3c0fcf110..458bd4410 100644
--- a/apps/explorer/src/app/components/order-details/deterministic-order-details.tsx
+++ b/apps/explorer/src/app/components/order-details/deterministic-order-details.tsx
@@ -6,6 +6,7 @@ import { Time } from '../time';
import { sideText, statusText, tifFull, tifShort } from './lib/order-labels';
import SizeInMarket from '../size-in-market/size-in-market';
import { TxOrderPeggedReference } from '../txs/details/order/tx-order-peg';
+import { OrderTypeMapping } from '@vegaprotocol/types';
export interface DeterministicOrderDetailsProps {
id: string;
@@ -69,7 +70,7 @@ const DeterministicOrderDetails = ({
@
-
+
In at .
{o.peggedOrder ? (
@@ -83,13 +84,12 @@ const DeterministicOrderDetails = ({
/>
) : null}
-
{o.reference ? (
{t('Reference')}: {o.reference}
) : null}
-
+
{t('Status')}
@@ -114,6 +114,16 @@ const DeterministicOrderDetails = ({
{o.version}
+ {o.type ? (
+
+
+ {t('Type')}
+
+
+ {OrderTypeMapping[o.type]}
+
+
+ ) : null}
diff --git a/apps/explorer/src/app/components/txs/tx-order-type.tsx b/apps/explorer/src/app/components/txs/tx-order-type.tsx
index 2598374bd..cf003f3fb 100644
--- a/apps/explorer/src/app/components/txs/tx-order-type.tsx
+++ b/apps/explorer/src/app/components/txs/tx-order-type.tsx
@@ -80,6 +80,12 @@ export function getLabelForOrderType(
if (command.orderSubmission.icebergOpts) {
return 'Iceberg';
}
+ if (command.orderSubmission.type === 'TYPE_MARKET') {
+ return 'Market order';
+ }
+ if (command.orderSubmission.type === 'TYPE_LIMIT') {
+ return 'Limit order';
+ }
}
return 'Order';
}