module Cooked.Skeleton.Value
  ( TxSkelOutValue (..),
    txSkelOutValueContentL,
    txSkelOutValueAutoAdjustL,
  )
where

import Cooked.Conversion.ToValue
import Optics.TH (makeLensesFor)
import PlutusLedgerApi.V3 qualified as Api

data TxSkelOutValue where
  TxSkelOutValue ::
    { -- Value to be paid
      TxSkelOutValue -> Value
txSkelOutValueContent :: Api.Value,
      -- Whether this value should be subject to automated adjustment in case it
      -- is not sufficient to sustain the cost of the UTxO containing it.
      TxSkelOutValue -> Bool
txSkelOutValueAutoAdjust :: Bool
    } ->
    TxSkelOutValue
  deriving (Int -> TxSkelOutValue -> ShowS
[TxSkelOutValue] -> ShowS
TxSkelOutValue -> String
(Int -> TxSkelOutValue -> ShowS)
-> (TxSkelOutValue -> String)
-> ([TxSkelOutValue] -> ShowS)
-> Show TxSkelOutValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TxSkelOutValue -> ShowS
showsPrec :: Int -> TxSkelOutValue -> ShowS
$cshow :: TxSkelOutValue -> String
show :: TxSkelOutValue -> String
$cshowList :: [TxSkelOutValue] -> ShowS
showList :: [TxSkelOutValue] -> ShowS
Show, TxSkelOutValue -> TxSkelOutValue -> Bool
(TxSkelOutValue -> TxSkelOutValue -> Bool)
-> (TxSkelOutValue -> TxSkelOutValue -> Bool) -> Eq TxSkelOutValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TxSkelOutValue -> TxSkelOutValue -> Bool
== :: TxSkelOutValue -> TxSkelOutValue -> Bool
$c/= :: TxSkelOutValue -> TxSkelOutValue -> Bool
/= :: TxSkelOutValue -> TxSkelOutValue -> Bool
Eq)

instance ToValue TxSkelOutValue where
  toValue :: TxSkelOutValue -> Value
toValue = TxSkelOutValue -> Value
txSkelOutValueContent

makeLensesFor
  [ ("txSkelOutValueContent", "txSkelOutValueContentL"),
    ("txSkelOutValueAutoAdjust", "txSkelOutValueAutoAdjustL")
  ]
  ''TxSkelOutValue