module Plutarch.LedgerApi.Value.Lovelace (
  PLovelace (..),
) where

import GHC.Generics (Generic)
import Generics.SOP qualified as SOP
import Plutarch.Prelude
import PlutusLedgerApi.V3 qualified as Plutus

-- | @since 2.2.0
newtype PLovelace (s :: S) = PLovelace (Term s PInteger)
  deriving stock
    ( -- | @since 2.2.0
      (forall x. PLovelace s -> Rep (PLovelace s) x)
-> (forall x. Rep (PLovelace s) x -> PLovelace s)
-> Generic (PLovelace s)
forall x. Rep (PLovelace s) x -> PLovelace s
forall x. PLovelace s -> Rep (PLovelace s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PLovelace s) x -> PLovelace s
forall (s :: S) x. PLovelace s -> Rep (PLovelace s) x
$cfrom :: forall (s :: S) x. PLovelace s -> Rep (PLovelace s) x
from :: forall x. PLovelace s -> Rep (PLovelace s) x
$cto :: forall (s :: S) x. Rep (PLovelace s) x -> PLovelace s
to :: forall x. Rep (PLovelace s) x -> PLovelace s
Generic
    )
  deriving anyclass
    ( -- | @since 3.3.0
      All SListI (Code (PLovelace s))
All SListI (Code (PLovelace s)) =>
(PLovelace s -> Rep (PLovelace s))
-> (Rep (PLovelace s) -> PLovelace s) -> Generic (PLovelace s)
Rep (PLovelace s) -> PLovelace s
PLovelace s -> Rep (PLovelace s)
forall a.
All SListI (Code a) =>
(a -> Rep a) -> (Rep a -> a) -> Generic a
forall (s :: S). All SListI (Code (PLovelace s))
forall (s :: S). Rep (PLovelace s) -> PLovelace s
forall (s :: S). PLovelace s -> Rep (PLovelace s)
$cfrom :: forall (s :: S). PLovelace s -> Rep (PLovelace s)
from :: PLovelace s -> Rep (PLovelace s)
$cto :: forall (s :: S). Rep (PLovelace s) -> PLovelace s
to :: Rep (PLovelace s) -> PLovelace s
SOP.Generic
    , -- | @since 2.2.0
      (forall (s :: S). Term s (PAsData PLovelace) -> Term s PLovelace)
-> (forall (s :: S). Term s PLovelace -> Term s PData)
-> PIsData PLovelace
forall (s :: S). Term s (PAsData PLovelace) -> Term s PLovelace
forall (s :: S). Term s PLovelace -> Term s PData
forall (a :: S -> Type).
(forall (s :: S). Term s (PAsData a) -> Term s a)
-> (forall (s :: S). Term s a -> Term s PData) -> PIsData a
$cpfromDataImpl :: forall (s :: S). Term s (PAsData PLovelace) -> Term s PLovelace
pfromDataImpl :: forall (s :: S). Term s (PAsData PLovelace) -> Term s PLovelace
$cpdataImpl :: forall (s :: S). Term s PLovelace -> Term s PData
pdataImpl :: forall (s :: S). Term s PLovelace -> Term s PData
PIsData
    , -- | @since 2.2.0
      (forall (s :: S).
 Term s PLovelace -> Term s PLovelace -> Term s PBool)
-> PEq PLovelace
forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PBool
forall (t :: S -> Type).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PBool
#== :: forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PBool
PEq
    , -- | @since 3.3.0
      PEq PLovelace
PEq PLovelace =>
(forall (s :: S).
 Term s PLovelace -> Term s PLovelace -> Term s PBool)
-> (forall (s :: S).
    Term s PLovelace -> Term s PLovelace -> Term s PBool)
-> (forall (s :: S).
    Term s PLovelace -> Term s PLovelace -> Term s PLovelace)
-> (forall (s :: S).
    Term s PLovelace -> Term s PLovelace -> Term s PLovelace)
-> POrd PLovelace
forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PBool
forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PLovelace
forall (t :: S -> Type).
PEq t =>
(forall (s :: S). Term s t -> Term s t -> Term s PBool)
-> (forall (s :: S). Term s t -> Term s t -> Term s PBool)
-> (forall (s :: S). Term s t -> Term s t -> Term s t)
-> (forall (s :: S). Term s t -> Term s t -> Term s t)
-> POrd t
$c#<= :: forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PBool
#<= :: forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PBool
$c#< :: forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PBool
#< :: forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PBool
$cpmax :: forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PLovelace
pmax :: forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PLovelace
$cpmin :: forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PLovelace
pmin :: forall (s :: S).
Term s PLovelace -> Term s PLovelace -> Term s PLovelace
POrd
    , -- | @since 2.2.0
      (forall (s :: S). Bool -> Term s PLovelace -> Term s PString)
-> PShow PLovelace
forall (s :: S). Bool -> Term s PLovelace -> Term s PString
forall (t :: S -> Type).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PLovelace -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PLovelace -> Term s PString
PShow
    )
  deriving
    ( -- | @since 3.3.0
      (forall (s :: S). PLovelace s -> Term s (PInner PLovelace))
-> (forall (s :: S) (b :: S -> Type).
    Term s (PInner PLovelace) -> (PLovelace s -> Term s b) -> Term s b)
-> PlutusType PLovelace
forall (s :: S). PLovelace s -> Term s (PInner PLovelace)
forall (s :: S) (b :: S -> Type).
Term s (PInner PLovelace) -> (PLovelace s -> Term s b) -> Term s b
forall (a :: S -> Type).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: S -> Type).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PLovelace s -> Term s (PInner PLovelace)
pcon' :: forall (s :: S). PLovelace s -> Term s (PInner PLovelace)
$cpmatch' :: forall (s :: S) (b :: S -> Type).
Term s (PInner PLovelace) -> (PLovelace s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: S -> Type).
Term s (PInner PLovelace) -> (PLovelace s -> Term s b) -> Term s b
PlutusType
    )
    via (DeriveNewtypePlutusType PLovelace)
  deriving
    ( -- | @since 3.6.0
      (forall (s :: S).
 Term s PData -> forall (r :: S -> Type). Term s r -> Term s r)
-> PValidateData PLovelace
forall (s :: S).
Term s PData -> forall (r :: S -> Type). Term s r -> Term s r
forall (a :: S -> Type).
(forall (s :: S).
 Term s PData -> forall (r :: S -> Type). Term s r -> Term s r)
-> PValidateData a
$cpwithValidated :: forall (s :: S).
Term s PData -> forall (r :: S -> Type). Term s r -> Term s r
pwithValidated :: forall (s :: S).
Term s PData -> forall (r :: S -> Type). Term s r -> Term s r
PValidateData
    )
    via (DeriveNewtypePValidateData PLovelace PInteger)

-- | @since 3.3.0
deriving via
  DeriveNewtypePLiftable PLovelace Plutus.Lovelace
  instance
    PLiftable PLovelace

-- | @since 3.4.0
instance PTryFrom PData (PAsData PLovelace)