From 49b421f7f5540f3b620b23b1e23a207a701a85f5 Mon Sep 17 00:00:00 2001 From: La Ancapo <> Date: Mon, 9 Feb 2026 15:02:26 +0100 Subject: [PATCH] pretty sell offer --- src/Pretty.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Pretty.hs b/src/Pretty.hs index ed40e55..637e149 100644 --- a/src/Pretty.hs +++ b/src/Pretty.hs @@ -76,7 +76,7 @@ instance Pretty OperationBody where pretty (OperationBody'CREATE_ACCOUNT x) = pretty x pretty (OperationBody'PAYMENT x) = pretty x -- pretty (OperationBody'PATH_PAYMENT_STRICT_RECEIVE x) = pretty x --- pretty (OperationBody'MANAGE_SELL_OFFER x) = pretty x + pretty (OperationBody'MANAGE_SELL_OFFER x) = pretty x -- pretty (OperationBody'CREATE_PASSIVE_SELL_OFFER x) = pretty x pretty (OperationBody'SET_OPTIONS x) = pretty x pretty (OperationBody'CHANGE_TRUST x) = pretty x @@ -145,6 +145,9 @@ instance Pretty ManageDataOp where instance Pretty ManageBuyOfferOp where pretty (ManageBuyOfferOp sellass buyass buyamount price offerid) = T.concat ["Buy ", prettyAmount buyamount, " ", pretty buyass, " for ", pretty sellass, " price ", pretty price, " ", prettyAssetName buyass, "/", prettyAssetName sellass, if offerid == 0 then " (new offer)" else T.concat [" (update offer ", T.show offerid, ")"]] +instance Pretty ManageSellOfferOp where + pretty (ManageSellOfferOp sellass buyass sellamount price offerid) = T.concat ["Sell ", prettyAmount sellamount, " ", pretty sellass, " for ", pretty buyass, " price ", pretty price, " ", prettyAssetName sellass, "/", prettyAssetName buyass, if offerid == 0 then " (new offer)" else T.concat [" (update offer ", T.show offerid, ")"]] + instance Pretty Price where pretty (Price numerator denominator) = T.show $ fromIntegral numerator / fromIntegral denominator