pretty sell offer

This commit is contained in:
La Ancapo 2026-02-09 15:02:26 +01:00
parent 6e38987f7b
commit 49b421f7f5

View file

@ -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