From 22cb03a67fcc85681bef9d0ae64c231b22f80caf Mon Sep 17 00:00:00 2001 From: Pedro Yves Fracari Date: Mon, 15 Jul 2024 14:00:35 -0300 Subject: [PATCH] add links on order details and create new text for order hash --- src/components/OrderDetails.tsx | 98 +++++++++++++++++++-------------- src/lib/tooltipDescriptions.ts | 2 +- 2 files changed, 58 insertions(+), 42 deletions(-) diff --git a/src/components/OrderDetails.tsx b/src/components/OrderDetails.tsx index 273077e..6132e59 100644 --- a/src/components/OrderDetails.tsx +++ b/src/components/OrderDetails.tsx @@ -9,7 +9,12 @@ import { formatNumber, Separator, } from "@bleu/ui"; -import { ArrowLeftIcon, CopyIcon, ReloadIcon } from "@radix-ui/react-icons"; +import { + ArrowLeftIcon, + ArrowTopRightIcon, + CopyIcon, + ReloadIcon, +} from "@radix-ui/react-icons"; import { useSafeAppsSDK } from "@safe-global/safe-apps-react-sdk"; import Link from "next/link"; import useSWR from "swr"; @@ -24,15 +29,12 @@ import { getProcessedStopLossOrder } from "#/lib/orderFetcher"; import { ChainId } from "#/lib/publicClients"; import { formatTimeDelta } from "#/lib/timeDelta"; import { TOOLTIP_DESCRIPTIONS } from "#/lib/tooltipDescriptions"; -import { - buildBlockExplorerTokenURL, - buildBlockExplorerTxUrl, - buildOrderCowExplorerUrl, - truncateAddress, -} from "#/utils"; +import { buildOrderCowExplorerUrl, truncateAddress } from "#/utils"; import { Spinner } from "./Spinner"; import { useOrder } from "#/contexts/ordersContext"; import { OrderCancelArgs, TRANSACTION_TYPES } from "#/lib/transactionFactory"; +import { BlockExplorerLink } from "./ExplorerLink"; +import { COMPOSABLE_COW_ADDRESS } from "#/lib/contracts"; export function OrderDetails({ orderId, @@ -142,20 +144,17 @@ export function OrderDetails({
- - {order?.txHash} - + {order?.txHash} + } + identifier={order?.txHash} + networkId={chainId as ChainId} + /> @@ -167,6 +166,12 @@ export function OrderDetails({ >
{order?.hash} + } + identifier={COMPOSABLE_COW_ADDRESS} + networkId={chainId as ChainId} + /> @@ -210,6 +215,12 @@ export function OrderDetails({ >
{order?.stopLossData?.to} + } + identifier={order?.stopLossData?.to} + networkId={chainId as ChainId} + /> @@ -231,17 +242,13 @@ export function OrderDetails({ - - {order?.stopLossData?.tokenIn.symbol} - + {order?.stopLossData?.tokenIn.symbol} + } + identifier={order?.stopLossData?.tokenIn.address} + networkId={chainId as ChainId} + /> - - {order?.stopLossData?.tokenOut.symbol} - + {order?.stopLossData?.tokenOut.symbol} + } + identifier={order?.stopLossData?.tokenOut.address} + networkId={chainId as ChainId} + />
{order?.stopLossData?.sellTokenPriceOracle} + } + identifier={order?.stopLossData?.sellTokenPriceOracle} + networkId={chainId as ChainId} + /> @@ -348,6 +357,12 @@ export function OrderDetails({ >
{order?.stopLossData?.buyTokenPriceOracle} + } + identifier={order?.stopLossData?.buyTokenPriceOracle} + networkId={chainId as ChainId} + /> @@ -366,6 +381,7 @@ export function OrderDetails({
{order.cowOrders.map((cowOrder) => (
+ {truncateAddress(cowOrder.uid)} - {truncateAddress(cowOrder.uid)} + diff --git a/src/lib/tooltipDescriptions.ts b/src/lib/tooltipDescriptions.ts index 6d5cdb3..37c1e4b 100644 --- a/src/lib/tooltipDescriptions.ts +++ b/src/lib/tooltipDescriptions.ts @@ -4,7 +4,7 @@ export enum TOOLTIP_DESCRIPTIONS { CURRENT_ORACLE_PRICE = "The price that will be monitored to trigger the order posting.", CURRENT_MARKET_PRICE = "The current price of the token pair in the market.", ORDER_CREATION = "The transaction that created this stop loss order.", - ORDER_HASH = "The onchain transaction for creating this order.", + ORDER_HASH = "The hash of the stop loss order on the Composable CoW framework. Each order for each user has a unique hash.", STATUS = "The status can be open, fulfilled, partially filled or cancelled.", SUBMISSION_TIME = "The date and time at which the order was submitted.", VALIDITY_BUCKET_TIME = "After the oracle price achieves the defined trigger price, how much time the order will wait to be filled on the orderbook.",