{-# OPTIONS_GHC -Wno-orphans #-}

-- Mirrors the equivalent V3 module in plutus-ledger-api
module Plutarch.LedgerApi.V3.Contexts (
  PColdCommitteeCredential (..),
  PHotCommitteeCredential (..),
  PDRepCredential (..),
  PDRep (..),
  PDelegatee (..),
  PTxCert (..),
  PVoter (..),
  PVote (..),
  PGovernanceActionId (..),
  PCommittee (..),
  PConstitution (..),
  PProtocolVersion (..),
  PChangedParameters (..),
  PGovernanceAction (..),
  PProposalProcedure (..),
  PScriptPurpose (..),
  PScriptInfo (..),
  PTxInInfo (..),
  PTxInfo (..),
  PScriptContext (..),
  -- TODO: Add these
  -- pfindOwnInput,
  pfindDatum,
  pfindDatumHash,
  -- pfindTxInByTxOutRef,
  --  pfindContinuingInputs,
  --  pgetContinuingInputs,
  --  ptxSignedBy,
  --  ppubKeyOutputsAt,
  --  pvaluePaidTo,
  --  pvalueSpent,
  --  pvalueProduced,
  --  pownCurrencySymbol,
  --  pspendsOutput
) where

import GHC.Generics (Generic)
import Plutarch.LedgerApi.AssocMap qualified as AssocMap
import Plutarch.LedgerApi.Interval qualified as Interval
import Plutarch.LedgerApi.Utils (PMaybeData, PRationalData)
import Plutarch.LedgerApi.V1.Credential (PCredential)
import Plutarch.LedgerApi.V1.Crypto (PPubKeyHash)
import Plutarch.LedgerApi.V1.Scripts (
  PDatum,
  PDatumHash,
  PRedeemer,
  PScriptHash,
 )
import Plutarch.LedgerApi.V1.Time (PPosixTime)
import Plutarch.LedgerApi.V2.Tx (PTxOut)
import Plutarch.LedgerApi.V3.Tx (PTxId, PTxOutRef)
import Plutarch.LedgerApi.Value qualified as Value
import Plutarch.Prelude
import PlutusLedgerApi.V3 qualified as Plutus

-- | @since 3.1.0
newtype PColdCommitteeCredential (s :: S) = PColdCommitteeCredential (Term s PCredential)
  deriving stock
    ( -- | @since 3.1.0
      (forall x.
 PColdCommitteeCredential s -> Rep (PColdCommitteeCredential s) x)
-> (forall x.
    Rep (PColdCommitteeCredential s) x -> PColdCommitteeCredential s)
-> Generic (PColdCommitteeCredential s)
forall x.
Rep (PColdCommitteeCredential s) x -> PColdCommitteeCredential s
forall x.
PColdCommitteeCredential s -> Rep (PColdCommitteeCredential s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x.
Rep (PColdCommitteeCredential s) x -> PColdCommitteeCredential s
forall (s :: S) x.
PColdCommitteeCredential s -> Rep (PColdCommitteeCredential s) x
$cfrom :: forall (s :: S) x.
PColdCommitteeCredential s -> Rep (PColdCommitteeCredential s) x
from :: forall x.
PColdCommitteeCredential s -> Rep (PColdCommitteeCredential s) x
$cto :: forall (s :: S) x.
Rep (PColdCommitteeCredential s) x -> PColdCommitteeCredential s
to :: forall x.
Rep (PColdCommitteeCredential s) x -> PColdCommitteeCredential s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S).
 PColdCommitteeCredential s
 -> Term s (PInner PColdCommitteeCredential))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PColdCommitteeCredential)
    -> (PColdCommitteeCredential s -> Term s b) -> Term s b)
-> PlutusType PColdCommitteeCredential
forall (s :: S).
PColdCommitteeCredential s
-> Term s (PInner PColdCommitteeCredential)
forall (s :: S) (b :: PType).
Term s (PInner PColdCommitteeCredential)
-> (PColdCommitteeCredential s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S).
PColdCommitteeCredential s
-> Term s (PInner PColdCommitteeCredential)
pcon' :: forall (s :: S).
PColdCommitteeCredential s
-> Term s (PInner PColdCommitteeCredential)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PColdCommitteeCredential)
-> (PColdCommitteeCredential s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PColdCommitteeCredential)
-> (PColdCommitteeCredential s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s (PAsData PColdCommitteeCredential)
 -> Term s PColdCommitteeCredential)
-> (forall (s :: S).
    Term s PColdCommitteeCredential -> Term s PData)
-> PIsData PColdCommitteeCredential
forall (s :: S).
Term s (PAsData PColdCommitteeCredential)
-> Term s PColdCommitteeCredential
forall (s :: S). Term s PColdCommitteeCredential -> Term s PData
forall (a :: PType).
(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 PColdCommitteeCredential)
-> Term s PColdCommitteeCredential
pfromDataImpl :: forall (s :: S).
Term s (PAsData PColdCommitteeCredential)
-> Term s PColdCommitteeCredential
$cpdataImpl :: forall (s :: S). Term s PColdCommitteeCredential -> Term s PData
pdataImpl :: forall (s :: S). Term s PColdCommitteeCredential -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PColdCommitteeCredential
 -> Term s PColdCommitteeCredential -> Term s PBool)
-> PEq PColdCommitteeCredential
forall (s :: S).
Term s PColdCommitteeCredential
-> Term s PColdCommitteeCredential -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PColdCommitteeCredential
-> Term s PColdCommitteeCredential -> Term s PBool
#== :: forall (s :: S).
Term s PColdCommitteeCredential
-> Term s PColdCommitteeCredential -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S).
 Bool -> Term s PColdCommitteeCredential -> Term s PString)
-> PShow PColdCommitteeCredential
forall (s :: S).
Bool -> Term s PColdCommitteeCredential -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S).
Bool -> Term s PColdCommitteeCredential -> Term s PString
pshow' :: forall (s :: S).
Bool -> Term s PColdCommitteeCredential -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PColdCommitteeCredential where
  type DPTStrat _ = PlutusTypeNewtype

-- | @since WIP
deriving via
  DeriveDataPLiftable PColdCommitteeCredential Plutus.ColdCommitteeCredential
  instance
    PLiftable PColdCommitteeCredential

-- | @since 3.1.0
instance PTryFrom PData (PAsData PColdCommitteeCredential)

-- | @since 3.1.0
newtype PHotCommitteeCredential (s :: S) = PHotCommitteeCredential (Term s PCredential)
  deriving stock
    ( -- | @since 3.1.0
      (forall x.
 PHotCommitteeCredential s -> Rep (PHotCommitteeCredential s) x)
-> (forall x.
    Rep (PHotCommitteeCredential s) x -> PHotCommitteeCredential s)
-> Generic (PHotCommitteeCredential s)
forall x.
Rep (PHotCommitteeCredential s) x -> PHotCommitteeCredential s
forall x.
PHotCommitteeCredential s -> Rep (PHotCommitteeCredential s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x.
Rep (PHotCommitteeCredential s) x -> PHotCommitteeCredential s
forall (s :: S) x.
PHotCommitteeCredential s -> Rep (PHotCommitteeCredential s) x
$cfrom :: forall (s :: S) x.
PHotCommitteeCredential s -> Rep (PHotCommitteeCredential s) x
from :: forall x.
PHotCommitteeCredential s -> Rep (PHotCommitteeCredential s) x
$cto :: forall (s :: S) x.
Rep (PHotCommitteeCredential s) x -> PHotCommitteeCredential s
to :: forall x.
Rep (PHotCommitteeCredential s) x -> PHotCommitteeCredential s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S).
 PHotCommitteeCredential s
 -> Term s (PInner PHotCommitteeCredential))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PHotCommitteeCredential)
    -> (PHotCommitteeCredential s -> Term s b) -> Term s b)
-> PlutusType PHotCommitteeCredential
forall (s :: S).
PHotCommitteeCredential s
-> Term s (PInner PHotCommitteeCredential)
forall (s :: S) (b :: PType).
Term s (PInner PHotCommitteeCredential)
-> (PHotCommitteeCredential s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S).
PHotCommitteeCredential s
-> Term s (PInner PHotCommitteeCredential)
pcon' :: forall (s :: S).
PHotCommitteeCredential s
-> Term s (PInner PHotCommitteeCredential)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PHotCommitteeCredential)
-> (PHotCommitteeCredential s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PHotCommitteeCredential)
-> (PHotCommitteeCredential s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s (PAsData PHotCommitteeCredential)
 -> Term s PHotCommitteeCredential)
-> (forall (s :: S).
    Term s PHotCommitteeCredential -> Term s PData)
-> PIsData PHotCommitteeCredential
forall (s :: S).
Term s (PAsData PHotCommitteeCredential)
-> Term s PHotCommitteeCredential
forall (s :: S). Term s PHotCommitteeCredential -> Term s PData
forall (a :: PType).
(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 PHotCommitteeCredential)
-> Term s PHotCommitteeCredential
pfromDataImpl :: forall (s :: S).
Term s (PAsData PHotCommitteeCredential)
-> Term s PHotCommitteeCredential
$cpdataImpl :: forall (s :: S). Term s PHotCommitteeCredential -> Term s PData
pdataImpl :: forall (s :: S). Term s PHotCommitteeCredential -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PHotCommitteeCredential
 -> Term s PHotCommitteeCredential -> Term s PBool)
-> PEq PHotCommitteeCredential
forall (s :: S).
Term s PHotCommitteeCredential
-> Term s PHotCommitteeCredential -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PHotCommitteeCredential
-> Term s PHotCommitteeCredential -> Term s PBool
#== :: forall (s :: S).
Term s PHotCommitteeCredential
-> Term s PHotCommitteeCredential -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S).
 Bool -> Term s PHotCommitteeCredential -> Term s PString)
-> PShow PHotCommitteeCredential
forall (s :: S).
Bool -> Term s PHotCommitteeCredential -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S).
Bool -> Term s PHotCommitteeCredential -> Term s PString
pshow' :: forall (s :: S).
Bool -> Term s PHotCommitteeCredential -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PHotCommitteeCredential where
  type DPTStrat _ = PlutusTypeNewtype

-- | @since WIP
deriving via
  DeriveDataPLiftable PHotCommitteeCredential Plutus.HotCommitteeCredential
  instance
    PLiftable PHotCommitteeCredential

-- | @since 3.1.0
instance PTryFrom PData (PAsData PHotCommitteeCredential)

-- | @since 3.1.0
newtype PDRepCredential (s :: S) = PDRepCredential (Term s PCredential)
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PDRepCredential s -> Rep (PDRepCredential s) x)
-> (forall x. Rep (PDRepCredential s) x -> PDRepCredential s)
-> Generic (PDRepCredential s)
forall x. Rep (PDRepCredential s) x -> PDRepCredential s
forall x. PDRepCredential s -> Rep (PDRepCredential s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PDRepCredential s) x -> PDRepCredential s
forall (s :: S) x. PDRepCredential s -> Rep (PDRepCredential s) x
$cfrom :: forall (s :: S) x. PDRepCredential s -> Rep (PDRepCredential s) x
from :: forall x. PDRepCredential s -> Rep (PDRepCredential s) x
$cto :: forall (s :: S) x. Rep (PDRepCredential s) x -> PDRepCredential s
to :: forall x. Rep (PDRepCredential s) x -> PDRepCredential s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S).
 PDRepCredential s -> Term s (PInner PDRepCredential))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PDRepCredential)
    -> (PDRepCredential s -> Term s b) -> Term s b)
-> PlutusType PDRepCredential
forall (s :: S).
PDRepCredential s -> Term s (PInner PDRepCredential)
forall (s :: S) (b :: PType).
Term s (PInner PDRepCredential)
-> (PDRepCredential s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S).
PDRepCredential s -> Term s (PInner PDRepCredential)
pcon' :: forall (s :: S).
PDRepCredential s -> Term s (PInner PDRepCredential)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PDRepCredential)
-> (PDRepCredential s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PDRepCredential)
-> (PDRepCredential s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s (PAsData PDRepCredential) -> Term s PDRepCredential)
-> (forall (s :: S). Term s PDRepCredential -> Term s PData)
-> PIsData PDRepCredential
forall (s :: S).
Term s (PAsData PDRepCredential) -> Term s PDRepCredential
forall (s :: S). Term s PDRepCredential -> Term s PData
forall (a :: PType).
(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 PDRepCredential) -> Term s PDRepCredential
pfromDataImpl :: forall (s :: S).
Term s (PAsData PDRepCredential) -> Term s PDRepCredential
$cpdataImpl :: forall (s :: S). Term s PDRepCredential -> Term s PData
pdataImpl :: forall (s :: S). Term s PDRepCredential -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PDRepCredential -> Term s PDRepCredential -> Term s PBool)
-> PEq PDRepCredential
forall (s :: S).
Term s PDRepCredential -> Term s PDRepCredential -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PDRepCredential -> Term s PDRepCredential -> Term s PBool
#== :: forall (s :: S).
Term s PDRepCredential -> Term s PDRepCredential -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S). Bool -> Term s PDRepCredential -> Term s PString)
-> PShow PDRepCredential
forall (s :: S). Bool -> Term s PDRepCredential -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PDRepCredential -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PDRepCredential -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PDRepCredential where
  type DPTStrat _ = PlutusTypeNewtype

-- | @since WIP
deriving via
  DeriveDataPLiftable PDRepCredential Plutus.DRepCredential
  instance
    PLiftable PDRepCredential

-- | @since 3.1.0
instance PTryFrom PData (PAsData PDRepCredential)

-- | @since 3.1.0
data PDRep (s :: S)
  = PDRep (Term s (PDataRecord '["_0" ':= PDRepCredential]))
  | PDRepAlwaysAbstain (Term s (PDataRecord '[]))
  | PDRepAlwaysNoConfidence (Term s (PDataRecord '[]))
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PDRep s -> Rep (PDRep s) x)
-> (forall x. Rep (PDRep s) x -> PDRep s) -> Generic (PDRep s)
forall x. Rep (PDRep s) x -> PDRep s
forall x. PDRep s -> Rep (PDRep s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PDRep s) x -> PDRep s
forall (s :: S) x. PDRep s -> Rep (PDRep s) x
$cfrom :: forall (s :: S) x. PDRep s -> Rep (PDRep s) x
from :: forall x. PDRep s -> Rep (PDRep s) x
$cto :: forall (s :: S) x. Rep (PDRep s) x -> PDRep s
to :: forall x. Rep (PDRep s) x -> PDRep s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S). PDRep s -> Term s (PInner PDRep))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PDRep) -> (PDRep s -> Term s b) -> Term s b)
-> PlutusType PDRep
forall (s :: S). PDRep s -> Term s (PInner PDRep)
forall (s :: S) (b :: PType).
Term s (PInner PDRep) -> (PDRep s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PDRep s -> Term s (PInner PDRep)
pcon' :: forall (s :: S). PDRep s -> Term s (PInner PDRep)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PDRep) -> (PDRep s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PDRep) -> (PDRep s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S). Term s (PAsData PDRep) -> Term s PDRep)
-> (forall (s :: S). Term s PDRep -> Term s PData) -> PIsData PDRep
forall (s :: S). Term s (PAsData PDRep) -> Term s PDRep
forall (s :: S). Term s PDRep -> Term s PData
forall (a :: PType).
(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 PDRep) -> Term s PDRep
pfromDataImpl :: forall (s :: S). Term s (PAsData PDRep) -> Term s PDRep
$cpdataImpl :: forall (s :: S). Term s PDRep -> Term s PData
pdataImpl :: forall (s :: S). Term s PDRep -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S). Term s PDRep -> Term s PDRep -> Term s PBool)
-> PEq PDRep
forall (s :: S). Term s PDRep -> Term s PDRep -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S). Term s PDRep -> Term s PDRep -> Term s PBool
#== :: forall (s :: S). Term s PDRep -> Term s PDRep -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S). Bool -> Term s PDRep -> Term s PString)
-> PShow PDRep
forall (s :: S). Bool -> Term s PDRep -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PDRep -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PDRep -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PDRep where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PDRep Plutus.DRep
  instance
    PLiftable PDRep

-- | @since 3.1.0
instance PTryFrom PData (PAsData PDRep)

-- | @since 3.1.0
data PDelegatee (s :: S)
  = PDelegStake (Term s (PDataRecord '["_0" ':= PPubKeyHash]))
  | PDelegVote (Term s (PDataRecord '["_0" ':= PDRep]))
  | PDelegStakeVote (Term s (PDataRecord '["_0" ':= PPubKeyHash, "_1" ':= PDRep]))
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PDelegatee s -> Rep (PDelegatee s) x)
-> (forall x. Rep (PDelegatee s) x -> PDelegatee s)
-> Generic (PDelegatee s)
forall x. Rep (PDelegatee s) x -> PDelegatee s
forall x. PDelegatee s -> Rep (PDelegatee s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PDelegatee s) x -> PDelegatee s
forall (s :: S) x. PDelegatee s -> Rep (PDelegatee s) x
$cfrom :: forall (s :: S) x. PDelegatee s -> Rep (PDelegatee s) x
from :: forall x. PDelegatee s -> Rep (PDelegatee s) x
$cto :: forall (s :: S) x. Rep (PDelegatee s) x -> PDelegatee s
to :: forall x. Rep (PDelegatee s) x -> PDelegatee s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S). PDelegatee s -> Term s (PInner PDelegatee))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PDelegatee)
    -> (PDelegatee s -> Term s b) -> Term s b)
-> PlutusType PDelegatee
forall (s :: S). PDelegatee s -> Term s (PInner PDelegatee)
forall (s :: S) (b :: PType).
Term s (PInner PDelegatee)
-> (PDelegatee s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PDelegatee s -> Term s (PInner PDelegatee)
pcon' :: forall (s :: S). PDelegatee s -> Term s (PInner PDelegatee)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PDelegatee)
-> (PDelegatee s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PDelegatee)
-> (PDelegatee s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S). Term s (PAsData PDelegatee) -> Term s PDelegatee)
-> (forall (s :: S). Term s PDelegatee -> Term s PData)
-> PIsData PDelegatee
forall (s :: S). Term s (PAsData PDelegatee) -> Term s PDelegatee
forall (s :: S). Term s PDelegatee -> Term s PData
forall (a :: PType).
(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 PDelegatee) -> Term s PDelegatee
pfromDataImpl :: forall (s :: S). Term s (PAsData PDelegatee) -> Term s PDelegatee
$cpdataImpl :: forall (s :: S). Term s PDelegatee -> Term s PData
pdataImpl :: forall (s :: S). Term s PDelegatee -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PDelegatee -> Term s PDelegatee -> Term s PBool)
-> PEq PDelegatee
forall (s :: S).
Term s PDelegatee -> Term s PDelegatee -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PDelegatee -> Term s PDelegatee -> Term s PBool
#== :: forall (s :: S).
Term s PDelegatee -> Term s PDelegatee -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S). Bool -> Term s PDelegatee -> Term s PString)
-> PShow PDelegatee
forall (s :: S). Bool -> Term s PDelegatee -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PDelegatee -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PDelegatee -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PDelegatee where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PDelegatee Plutus.Delegatee
  instance
    PLiftable PDelegatee

-- | @since 3.1.0
instance PTryFrom PData (PAsData PDelegatee)

-- | @since 3.1.0
data PTxCert (s :: S)
  = PTxCertRegStaking (Term s (PDataRecord '["_0" ':= PCredential, "_1" ':= PMaybeData Value.PLovelace]))
  | PTxCertUnRegStaking (Term s (PDataRecord '["_0" ':= PCredential, "_1" ':= PMaybeData Value.PLovelace]))
  | PTxCertDelegStaking (Term s (PDataRecord '["_0" ':= PCredential, "_1" ':= PDelegatee]))
  | PTxCertRegDeleg (Term s (PDataRecord '["_0" ':= PCredential, "_1" ':= PDelegatee, "_2" ':= Value.PLovelace]))
  | PTxCertRegDRep (Term s (PDataRecord '["_0" ':= PDRepCredential, "_1" ':= Value.PLovelace]))
  | PTxCertUpdateDRep (Term s (PDataRecord '["_0" ':= PDRepCredential]))
  | PTxCertUnRegDRep (Term s (PDataRecord '["_0" ':= PDRepCredential, "_1" ':= Value.PLovelace]))
  | PTxCertPoolRegister (Term s (PDataRecord '["_0" ':= PPubKeyHash, "_1" ':= PPubKeyHash]))
  | PTxCertPoolRetire (Term s (PDataRecord '["_0" ':= PPubKeyHash, "_1" ':= PInteger]))
  | PTxCertAuthHotCommittee (Term s (PDataRecord '["_0" ':= PColdCommitteeCredential, "_1" ':= PHotCommitteeCredential]))
  | PTxCertResignColdCommittee (Term s (PDataRecord '["_0" ':= PColdCommitteeCredential]))
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PTxCert s -> Rep (PTxCert s) x)
-> (forall x. Rep (PTxCert s) x -> PTxCert s)
-> Generic (PTxCert s)
forall x. Rep (PTxCert s) x -> PTxCert s
forall x. PTxCert s -> Rep (PTxCert s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PTxCert s) x -> PTxCert s
forall (s :: S) x. PTxCert s -> Rep (PTxCert s) x
$cfrom :: forall (s :: S) x. PTxCert s -> Rep (PTxCert s) x
from :: forall x. PTxCert s -> Rep (PTxCert s) x
$cto :: forall (s :: S) x. Rep (PTxCert s) x -> PTxCert s
to :: forall x. Rep (PTxCert s) x -> PTxCert s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S). PTxCert s -> Term s (PInner PTxCert))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PTxCert) -> (PTxCert s -> Term s b) -> Term s b)
-> PlutusType PTxCert
forall (s :: S). PTxCert s -> Term s (PInner PTxCert)
forall (s :: S) (b :: PType).
Term s (PInner PTxCert) -> (PTxCert s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PTxCert s -> Term s (PInner PTxCert)
pcon' :: forall (s :: S). PTxCert s -> Term s (PInner PTxCert)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PTxCert) -> (PTxCert s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PTxCert) -> (PTxCert s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S). Term s (PAsData PTxCert) -> Term s PTxCert)
-> (forall (s :: S). Term s PTxCert -> Term s PData)
-> PIsData PTxCert
forall (s :: S). Term s (PAsData PTxCert) -> Term s PTxCert
forall (s :: S). Term s PTxCert -> Term s PData
forall (a :: PType).
(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 PTxCert) -> Term s PTxCert
pfromDataImpl :: forall (s :: S). Term s (PAsData PTxCert) -> Term s PTxCert
$cpdataImpl :: forall (s :: S). Term s PTxCert -> Term s PData
pdataImpl :: forall (s :: S). Term s PTxCert -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S). Term s PTxCert -> Term s PTxCert -> Term s PBool)
-> PEq PTxCert
forall (s :: S). Term s PTxCert -> Term s PTxCert -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S). Term s PTxCert -> Term s PTxCert -> Term s PBool
#== :: forall (s :: S). Term s PTxCert -> Term s PTxCert -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S). Bool -> Term s PTxCert -> Term s PString)
-> PShow PTxCert
forall (s :: S). Bool -> Term s PTxCert -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PTxCert -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PTxCert -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PTxCert where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PTxCert Plutus.TxCert
  instance
    PLiftable PTxCert

-- | @since 3.1.0
instance PTryFrom PData (PAsData PTxCert)

-- | @since 3.1.0
data PVoter (s :: S)
  = PCommitteeVoter (Term s (PDataRecord '["_0" ':= PHotCommitteeCredential]))
  | PDRepVoter (Term s (PDataRecord '["_0" ':= PDRepCredential]))
  | PStakePoolVoter (Term s (PDataRecord '["_0" ':= PPubKeyHash]))
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PVoter s -> Rep (PVoter s) x)
-> (forall x. Rep (PVoter s) x -> PVoter s) -> Generic (PVoter s)
forall x. Rep (PVoter s) x -> PVoter s
forall x. PVoter s -> Rep (PVoter s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PVoter s) x -> PVoter s
forall (s :: S) x. PVoter s -> Rep (PVoter s) x
$cfrom :: forall (s :: S) x. PVoter s -> Rep (PVoter s) x
from :: forall x. PVoter s -> Rep (PVoter s) x
$cto :: forall (s :: S) x. Rep (PVoter s) x -> PVoter s
to :: forall x. Rep (PVoter s) x -> PVoter s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S). PVoter s -> Term s (PInner PVoter))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PVoter) -> (PVoter s -> Term s b) -> Term s b)
-> PlutusType PVoter
forall (s :: S). PVoter s -> Term s (PInner PVoter)
forall (s :: S) (b :: PType).
Term s (PInner PVoter) -> (PVoter s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PVoter s -> Term s (PInner PVoter)
pcon' :: forall (s :: S). PVoter s -> Term s (PInner PVoter)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PVoter) -> (PVoter s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PVoter) -> (PVoter s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S). Term s (PAsData PVoter) -> Term s PVoter)
-> (forall (s :: S). Term s PVoter -> Term s PData)
-> PIsData PVoter
forall (s :: S). Term s (PAsData PVoter) -> Term s PVoter
forall (s :: S). Term s PVoter -> Term s PData
forall (a :: PType).
(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 PVoter) -> Term s PVoter
pfromDataImpl :: forall (s :: S). Term s (PAsData PVoter) -> Term s PVoter
$cpdataImpl :: forall (s :: S). Term s PVoter -> Term s PData
pdataImpl :: forall (s :: S). Term s PVoter -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S). Term s PVoter -> Term s PVoter -> Term s PBool)
-> PEq PVoter
forall (s :: S). Term s PVoter -> Term s PVoter -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S). Term s PVoter -> Term s PVoter -> Term s PBool
#== :: forall (s :: S). Term s PVoter -> Term s PVoter -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S). Bool -> Term s PVoter -> Term s PString)
-> PShow PVoter
forall (s :: S). Bool -> Term s PVoter -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PVoter -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PVoter -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PVoter where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PVoter Plutus.Voter
  instance
    PLiftable PVoter

-- | @since 3.1.0
instance PTryFrom PData (PAsData PVoter)

-- | @since 3.1.0
data PVote (s :: S)
  = PVoteYes (Term s (PDataRecord '[]))
  | PVoteNo (Term s (PDataRecord '[]))
  | PAbstain (Term s (PDataRecord '[]))
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PVote s -> Rep (PVote s) x)
-> (forall x. Rep (PVote s) x -> PVote s) -> Generic (PVote s)
forall x. Rep (PVote s) x -> PVote s
forall x. PVote s -> Rep (PVote s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PVote s) x -> PVote s
forall (s :: S) x. PVote s -> Rep (PVote s) x
$cfrom :: forall (s :: S) x. PVote s -> Rep (PVote s) x
from :: forall x. PVote s -> Rep (PVote s) x
$cto :: forall (s :: S) x. Rep (PVote s) x -> PVote s
to :: forall x. Rep (PVote s) x -> PVote s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S). PVote s -> Term s (PInner PVote))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PVote) -> (PVote s -> Term s b) -> Term s b)
-> PlutusType PVote
forall (s :: S). PVote s -> Term s (PInner PVote)
forall (s :: S) (b :: PType).
Term s (PInner PVote) -> (PVote s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PVote s -> Term s (PInner PVote)
pcon' :: forall (s :: S). PVote s -> Term s (PInner PVote)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PVote) -> (PVote s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PVote) -> (PVote s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S). Term s (PAsData PVote) -> Term s PVote)
-> (forall (s :: S). Term s PVote -> Term s PData) -> PIsData PVote
forall (s :: S). Term s (PAsData PVote) -> Term s PVote
forall (s :: S). Term s PVote -> Term s PData
forall (a :: PType).
(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 PVote) -> Term s PVote
pfromDataImpl :: forall (s :: S). Term s (PAsData PVote) -> Term s PVote
$cpdataImpl :: forall (s :: S). Term s PVote -> Term s PData
pdataImpl :: forall (s :: S). Term s PVote -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S). Term s PVote -> Term s PVote -> Term s PBool)
-> PEq PVote
forall (s :: S). Term s PVote -> Term s PVote -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S). Term s PVote -> Term s PVote -> Term s PBool
#== :: forall (s :: S). Term s PVote -> Term s PVote -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S). Bool -> Term s PVote -> Term s PString)
-> PShow PVote
forall (s :: S). Bool -> Term s PVote -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PVote -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PVote -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PVote where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PVote Plutus.Vote
  instance
    PLiftable PVote

-- | @since 3.1.0
instance PTryFrom PData (PAsData PVote)

-- | @since 3.1.0
newtype PGovernanceActionId (s :: S)
  = PGovernanceActionId (Term s (PDataRecord '["txId" ':= PTxId, "govActionIx" ':= PInteger]))
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PGovernanceActionId s -> Rep (PGovernanceActionId s) x)
-> (forall x.
    Rep (PGovernanceActionId s) x -> PGovernanceActionId s)
-> Generic (PGovernanceActionId s)
forall x. Rep (PGovernanceActionId s) x -> PGovernanceActionId s
forall x. PGovernanceActionId s -> Rep (PGovernanceActionId s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x.
Rep (PGovernanceActionId s) x -> PGovernanceActionId s
forall (s :: S) x.
PGovernanceActionId s -> Rep (PGovernanceActionId s) x
$cfrom :: forall (s :: S) x.
PGovernanceActionId s -> Rep (PGovernanceActionId s) x
from :: forall x. PGovernanceActionId s -> Rep (PGovernanceActionId s) x
$cto :: forall (s :: S) x.
Rep (PGovernanceActionId s) x -> PGovernanceActionId s
to :: forall x. Rep (PGovernanceActionId s) x -> PGovernanceActionId s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S).
 PGovernanceActionId s -> Term s (PInner PGovernanceActionId))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PGovernanceActionId)
    -> (PGovernanceActionId s -> Term s b) -> Term s b)
-> PlutusType PGovernanceActionId
forall (s :: S).
PGovernanceActionId s -> Term s (PInner PGovernanceActionId)
forall (s :: S) (b :: PType).
Term s (PInner PGovernanceActionId)
-> (PGovernanceActionId s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S).
PGovernanceActionId s -> Term s (PInner PGovernanceActionId)
pcon' :: forall (s :: S).
PGovernanceActionId s -> Term s (PInner PGovernanceActionId)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PGovernanceActionId)
-> (PGovernanceActionId s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PGovernanceActionId)
-> (PGovernanceActionId s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s (PAsData PGovernanceActionId) -> Term s PGovernanceActionId)
-> (forall (s :: S). Term s PGovernanceActionId -> Term s PData)
-> PIsData PGovernanceActionId
forall (s :: S).
Term s (PAsData PGovernanceActionId) -> Term s PGovernanceActionId
forall (s :: S). Term s PGovernanceActionId -> Term s PData
forall (a :: PType).
(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 PGovernanceActionId) -> Term s PGovernanceActionId
pfromDataImpl :: forall (s :: S).
Term s (PAsData PGovernanceActionId) -> Term s PGovernanceActionId
$cpdataImpl :: forall (s :: S). Term s PGovernanceActionId -> Term s PData
pdataImpl :: forall (s :: S). Term s PGovernanceActionId -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PGovernanceActionId
 -> Term s PGovernanceActionId -> Term s PBool)
-> PEq PGovernanceActionId
forall (s :: S).
Term s PGovernanceActionId
-> Term s PGovernanceActionId -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PGovernanceActionId
-> Term s PGovernanceActionId -> Term s PBool
#== :: forall (s :: S).
Term s PGovernanceActionId
-> Term s PGovernanceActionId -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S).
 Bool -> Term s PGovernanceActionId -> Term s PString)
-> PShow PGovernanceActionId
forall (s :: S).
Bool -> Term s PGovernanceActionId -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S).
Bool -> Term s PGovernanceActionId -> Term s PString
pshow' :: forall (s :: S).
Bool -> Term s PGovernanceActionId -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PGovernanceActionId where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PGovernanceActionId Plutus.GovernanceActionId
  instance
    PLiftable PGovernanceActionId

-- | @since 3.1.0
instance PTryFrom PData (PAsData PGovernanceActionId)

-- TODO: Investigate what guarantees this provides on the Map, if any

-- | @since 3.1.0
newtype PCommittee (s :: S)
  = PCommittee
      ( Term
          s
          ( PDataRecord
              '[ "members" ':= AssocMap.PMap 'AssocMap.Unsorted PColdCommitteeCredential PInteger
               , "quorum" ':= PRationalData
               ]
          )
      )
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PCommittee s -> Rep (PCommittee s) x)
-> (forall x. Rep (PCommittee s) x -> PCommittee s)
-> Generic (PCommittee s)
forall x. Rep (PCommittee s) x -> PCommittee s
forall x. PCommittee s -> Rep (PCommittee s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PCommittee s) x -> PCommittee s
forall (s :: S) x. PCommittee s -> Rep (PCommittee s) x
$cfrom :: forall (s :: S) x. PCommittee s -> Rep (PCommittee s) x
from :: forall x. PCommittee s -> Rep (PCommittee s) x
$cto :: forall (s :: S) x. Rep (PCommittee s) x -> PCommittee s
to :: forall x. Rep (PCommittee s) x -> PCommittee s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S). PCommittee s -> Term s (PInner PCommittee))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PCommittee)
    -> (PCommittee s -> Term s b) -> Term s b)
-> PlutusType PCommittee
forall (s :: S). PCommittee s -> Term s (PInner PCommittee)
forall (s :: S) (b :: PType).
Term s (PInner PCommittee)
-> (PCommittee s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PCommittee s -> Term s (PInner PCommittee)
pcon' :: forall (s :: S). PCommittee s -> Term s (PInner PCommittee)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PCommittee)
-> (PCommittee s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PCommittee)
-> (PCommittee s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S). Term s (PAsData PCommittee) -> Term s PCommittee)
-> (forall (s :: S). Term s PCommittee -> Term s PData)
-> PIsData PCommittee
forall (s :: S). Term s (PAsData PCommittee) -> Term s PCommittee
forall (s :: S). Term s PCommittee -> Term s PData
forall (a :: PType).
(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 PCommittee) -> Term s PCommittee
pfromDataImpl :: forall (s :: S). Term s (PAsData PCommittee) -> Term s PCommittee
$cpdataImpl :: forall (s :: S). Term s PCommittee -> Term s PData
pdataImpl :: forall (s :: S). Term s PCommittee -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PCommittee -> Term s (PDataRecord (PFields PCommittee)))
-> PDataFields PCommittee
forall (s :: S).
Term s PCommittee -> Term s (PDataRecord (PFields PCommittee))
forall (a :: PType).
(forall (s :: S). Term s a -> Term s (PDataRecord (PFields a)))
-> PDataFields a
$cptoFields :: forall (s :: S).
Term s PCommittee -> Term s (PDataRecord (PFields PCommittee))
ptoFields :: forall (s :: S).
Term s PCommittee -> Term s (PDataRecord (PFields PCommittee))
PDataFields
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PCommittee -> Term s PCommittee -> Term s PBool)
-> PEq PCommittee
forall (s :: S).
Term s PCommittee -> Term s PCommittee -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PCommittee -> Term s PCommittee -> Term s PBool
#== :: forall (s :: S).
Term s PCommittee -> Term s PCommittee -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S). Bool -> Term s PCommittee -> Term s PString)
-> PShow PCommittee
forall (s :: S). Bool -> Term s PCommittee -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PCommittee -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PCommittee -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PCommittee where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PCommittee Plutus.Committee
  instance
    PLiftable PCommittee

-- | @since 3.1.0
instance PTryFrom PData (PAsData PCommittee)

{- | A constitution, omitting the optional anchor.

@since 3.1.0
-}
newtype PConstitution (s :: S) = PConstitution (Term s (PDataRecord '["_0" := PMaybeData PScriptHash]))
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PConstitution s -> Rep (PConstitution s) x)
-> (forall x. Rep (PConstitution s) x -> PConstitution s)
-> Generic (PConstitution s)
forall x. Rep (PConstitution s) x -> PConstitution s
forall x. PConstitution s -> Rep (PConstitution s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PConstitution s) x -> PConstitution s
forall (s :: S) x. PConstitution s -> Rep (PConstitution s) x
$cfrom :: forall (s :: S) x. PConstitution s -> Rep (PConstitution s) x
from :: forall x. PConstitution s -> Rep (PConstitution s) x
$cto :: forall (s :: S) x. Rep (PConstitution s) x -> PConstitution s
to :: forall x. Rep (PConstitution s) x -> PConstitution s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S). PConstitution s -> Term s (PInner PConstitution))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PConstitution)
    -> (PConstitution s -> Term s b) -> Term s b)
-> PlutusType PConstitution
forall (s :: S). PConstitution s -> Term s (PInner PConstitution)
forall (s :: S) (b :: PType).
Term s (PInner PConstitution)
-> (PConstitution s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PConstitution s -> Term s (PInner PConstitution)
pcon' :: forall (s :: S). PConstitution s -> Term s (PInner PConstitution)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PConstitution)
-> (PConstitution s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PConstitution)
-> (PConstitution s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s (PAsData PConstitution) -> Term s PConstitution)
-> (forall (s :: S). Term s PConstitution -> Term s PData)
-> PIsData PConstitution
forall (s :: S).
Term s (PAsData PConstitution) -> Term s PConstitution
forall (s :: S). Term s PConstitution -> Term s PData
forall (a :: PType).
(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 PConstitution) -> Term s PConstitution
pfromDataImpl :: forall (s :: S).
Term s (PAsData PConstitution) -> Term s PConstitution
$cpdataImpl :: forall (s :: S). Term s PConstitution -> Term s PData
pdataImpl :: forall (s :: S). Term s PConstitution -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PConstitution -> Term s PConstitution -> Term s PBool)
-> PEq PConstitution
forall (s :: S).
Term s PConstitution -> Term s PConstitution -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PConstitution -> Term s PConstitution -> Term s PBool
#== :: forall (s :: S).
Term s PConstitution -> Term s PConstitution -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S). Bool -> Term s PConstitution -> Term s PString)
-> PShow PConstitution
forall (s :: S). Bool -> Term s PConstitution -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PConstitution -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PConstitution -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PConstitution where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PConstitution Plutus.Constitution
  instance
    PLiftable PConstitution

-- | @since 3.1.0
instance PTryFrom PData (PAsData PConstitution)

-- | @since 3.1.0
newtype PProtocolVersion (s :: S)
  = PProtocolVersion (Term s (PDataRecord '["major" ':= PInteger, "minor" ':= PInteger]))
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PProtocolVersion s -> Rep (PProtocolVersion s) x)
-> (forall x. Rep (PProtocolVersion s) x -> PProtocolVersion s)
-> Generic (PProtocolVersion s)
forall x. Rep (PProtocolVersion s) x -> PProtocolVersion s
forall x. PProtocolVersion s -> Rep (PProtocolVersion s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PProtocolVersion s) x -> PProtocolVersion s
forall (s :: S) x. PProtocolVersion s -> Rep (PProtocolVersion s) x
$cfrom :: forall (s :: S) x. PProtocolVersion s -> Rep (PProtocolVersion s) x
from :: forall x. PProtocolVersion s -> Rep (PProtocolVersion s) x
$cto :: forall (s :: S) x. Rep (PProtocolVersion s) x -> PProtocolVersion s
to :: forall x. Rep (PProtocolVersion s) x -> PProtocolVersion s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S).
 PProtocolVersion s -> Term s (PInner PProtocolVersion))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PProtocolVersion)
    -> (PProtocolVersion s -> Term s b) -> Term s b)
-> PlutusType PProtocolVersion
forall (s :: S).
PProtocolVersion s -> Term s (PInner PProtocolVersion)
forall (s :: S) (b :: PType).
Term s (PInner PProtocolVersion)
-> (PProtocolVersion s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S).
PProtocolVersion s -> Term s (PInner PProtocolVersion)
pcon' :: forall (s :: S).
PProtocolVersion s -> Term s (PInner PProtocolVersion)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PProtocolVersion)
-> (PProtocolVersion s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PProtocolVersion)
-> (PProtocolVersion s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s (PAsData PProtocolVersion) -> Term s PProtocolVersion)
-> (forall (s :: S). Term s PProtocolVersion -> Term s PData)
-> PIsData PProtocolVersion
forall (s :: S).
Term s (PAsData PProtocolVersion) -> Term s PProtocolVersion
forall (s :: S). Term s PProtocolVersion -> Term s PData
forall (a :: PType).
(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 PProtocolVersion) -> Term s PProtocolVersion
pfromDataImpl :: forall (s :: S).
Term s (PAsData PProtocolVersion) -> Term s PProtocolVersion
$cpdataImpl :: forall (s :: S). Term s PProtocolVersion -> Term s PData
pdataImpl :: forall (s :: S). Term s PProtocolVersion -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PProtocolVersion
 -> Term s (PDataRecord (PFields PProtocolVersion)))
-> PDataFields PProtocolVersion
forall (s :: S).
Term s PProtocolVersion
-> Term s (PDataRecord (PFields PProtocolVersion))
forall (a :: PType).
(forall (s :: S). Term s a -> Term s (PDataRecord (PFields a)))
-> PDataFields a
$cptoFields :: forall (s :: S).
Term s PProtocolVersion
-> Term s (PDataRecord (PFields PProtocolVersion))
ptoFields :: forall (s :: S).
Term s PProtocolVersion
-> Term s (PDataRecord (PFields PProtocolVersion))
PDataFields
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PProtocolVersion -> Term s PProtocolVersion -> Term s PBool)
-> PEq PProtocolVersion
forall (s :: S).
Term s PProtocolVersion -> Term s PProtocolVersion -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PProtocolVersion -> Term s PProtocolVersion -> Term s PBool
#== :: forall (s :: S).
Term s PProtocolVersion -> Term s PProtocolVersion -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S).
 Bool -> Term s PProtocolVersion -> Term s PString)
-> PShow PProtocolVersion
forall (s :: S). Bool -> Term s PProtocolVersion -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PProtocolVersion -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PProtocolVersion -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PProtocolVersion where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PProtocolVersion Plutus.ProtocolVersion
  instance
    PLiftable PProtocolVersion

-- | @since 3.1.0
instance PTryFrom PData (PAsData PProtocolVersion)

-- | @since 3.1.0
newtype PChangedParameters (s :: S)
  = PChangedParameters (Term s PData)
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PChangedParameters s -> Rep (PChangedParameters s) x)
-> (forall x. Rep (PChangedParameters s) x -> PChangedParameters s)
-> Generic (PChangedParameters s)
forall x. Rep (PChangedParameters s) x -> PChangedParameters s
forall x. PChangedParameters s -> Rep (PChangedParameters s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x.
Rep (PChangedParameters s) x -> PChangedParameters s
forall (s :: S) x.
PChangedParameters s -> Rep (PChangedParameters s) x
$cfrom :: forall (s :: S) x.
PChangedParameters s -> Rep (PChangedParameters s) x
from :: forall x. PChangedParameters s -> Rep (PChangedParameters s) x
$cto :: forall (s :: S) x.
Rep (PChangedParameters s) x -> PChangedParameters s
to :: forall x. Rep (PChangedParameters s) x -> PChangedParameters s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S).
 PChangedParameters s -> Term s (PInner PChangedParameters))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PChangedParameters)
    -> (PChangedParameters s -> Term s b) -> Term s b)
-> PlutusType PChangedParameters
forall (s :: S).
PChangedParameters s -> Term s (PInner PChangedParameters)
forall (s :: S) (b :: PType).
Term s (PInner PChangedParameters)
-> (PChangedParameters s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S).
PChangedParameters s -> Term s (PInner PChangedParameters)
pcon' :: forall (s :: S).
PChangedParameters s -> Term s (PInner PChangedParameters)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PChangedParameters)
-> (PChangedParameters s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PChangedParameters)
-> (PChangedParameters s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s (PAsData PChangedParameters) -> Term s PChangedParameters)
-> (forall (s :: S). Term s PChangedParameters -> Term s PData)
-> PIsData PChangedParameters
forall (s :: S).
Term s (PAsData PChangedParameters) -> Term s PChangedParameters
forall (s :: S). Term s PChangedParameters -> Term s PData
forall (a :: PType).
(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 PChangedParameters) -> Term s PChangedParameters
pfromDataImpl :: forall (s :: S).
Term s (PAsData PChangedParameters) -> Term s PChangedParameters
$cpdataImpl :: forall (s :: S). Term s PChangedParameters -> Term s PData
pdataImpl :: forall (s :: S). Term s PChangedParameters -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PChangedParameters
 -> Term s PChangedParameters -> Term s PBool)
-> PEq PChangedParameters
forall (s :: S).
Term s PChangedParameters
-> Term s PChangedParameters -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PChangedParameters
-> Term s PChangedParameters -> Term s PBool
#== :: forall (s :: S).
Term s PChangedParameters
-> Term s PChangedParameters -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S).
 Bool -> Term s PChangedParameters -> Term s PString)
-> PShow PChangedParameters
forall (s :: S).
Bool -> Term s PChangedParameters -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S).
Bool -> Term s PChangedParameters -> Term s PString
pshow' :: forall (s :: S).
Bool -> Term s PChangedParameters -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PChangedParameters where
  type DPTStrat _ = PlutusTypeNewtype

-- | @since WIP
deriving via
  DeriveDataPLiftable PChangedParameters Plutus.ChangedParameters
  instance
    PLiftable PChangedParameters

-- | @since 3.1.0
instance PTryFrom PData (PAsData PChangedParameters)

-- | @since 3.1.0
data PGovernanceAction (s :: S)
  = PParameterChange (Term s (PDataRecord '["_0" ':= PMaybeData PGovernanceActionId, "_1" ':= PChangedParameters, "_2" ':= PMaybeData PScriptHash]))
  | PHardForkInitiation (Term s (PDataRecord '["_0" ':= PMaybeData PGovernanceActionId, "_1" ':= PProtocolVersion]))
  | PTreasuryWithdrawals (Term s (PDataRecord '["_0" ':= AssocMap.PMap 'AssocMap.Unsorted PCredential Value.PLovelace, "_1" ':= PMaybeData PScriptHash]))
  | PNoConfidence (Term s (PDataRecord '["_0" ':= PMaybeData PGovernanceActionId]))
  | PUpdateCommittee
      ( Term
          s
          ( PDataRecord
              '[ "_0" ':= PMaybeData PGovernanceActionId
               , "_1" ':= PBuiltinList (PAsData PColdCommitteeCredential)
               , "_2" ':= AssocMap.PMap 'AssocMap.Unsorted PColdCommitteeCredential PInteger
               , "_3" ':= PRationalData
               ]
          )
      )
  | PNewConstitution (Term s (PDataRecord '["_0" ':= PMaybeData PGovernanceActionId, "_1" ':= PConstitution]))
  | PInfoAction (Term s (PDataRecord '[]))
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PGovernanceAction s -> Rep (PGovernanceAction s) x)
-> (forall x. Rep (PGovernanceAction s) x -> PGovernanceAction s)
-> Generic (PGovernanceAction s)
forall x. Rep (PGovernanceAction s) x -> PGovernanceAction s
forall x. PGovernanceAction s -> Rep (PGovernanceAction s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x.
Rep (PGovernanceAction s) x -> PGovernanceAction s
forall (s :: S) x.
PGovernanceAction s -> Rep (PGovernanceAction s) x
$cfrom :: forall (s :: S) x.
PGovernanceAction s -> Rep (PGovernanceAction s) x
from :: forall x. PGovernanceAction s -> Rep (PGovernanceAction s) x
$cto :: forall (s :: S) x.
Rep (PGovernanceAction s) x -> PGovernanceAction s
to :: forall x. Rep (PGovernanceAction s) x -> PGovernanceAction s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S).
 PGovernanceAction s -> Term s (PInner PGovernanceAction))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PGovernanceAction)
    -> (PGovernanceAction s -> Term s b) -> Term s b)
-> PlutusType PGovernanceAction
forall (s :: S).
PGovernanceAction s -> Term s (PInner PGovernanceAction)
forall (s :: S) (b :: PType).
Term s (PInner PGovernanceAction)
-> (PGovernanceAction s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S).
PGovernanceAction s -> Term s (PInner PGovernanceAction)
pcon' :: forall (s :: S).
PGovernanceAction s -> Term s (PInner PGovernanceAction)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PGovernanceAction)
-> (PGovernanceAction s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PGovernanceAction)
-> (PGovernanceAction s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s (PAsData PGovernanceAction) -> Term s PGovernanceAction)
-> (forall (s :: S). Term s PGovernanceAction -> Term s PData)
-> PIsData PGovernanceAction
forall (s :: S).
Term s (PAsData PGovernanceAction) -> Term s PGovernanceAction
forall (s :: S). Term s PGovernanceAction -> Term s PData
forall (a :: PType).
(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 PGovernanceAction) -> Term s PGovernanceAction
pfromDataImpl :: forall (s :: S).
Term s (PAsData PGovernanceAction) -> Term s PGovernanceAction
$cpdataImpl :: forall (s :: S). Term s PGovernanceAction -> Term s PData
pdataImpl :: forall (s :: S). Term s PGovernanceAction -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PGovernanceAction
 -> Term s PGovernanceAction -> Term s PBool)
-> PEq PGovernanceAction
forall (s :: S).
Term s PGovernanceAction
-> Term s PGovernanceAction -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PGovernanceAction
-> Term s PGovernanceAction -> Term s PBool
#== :: forall (s :: S).
Term s PGovernanceAction
-> Term s PGovernanceAction -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S).
 Bool -> Term s PGovernanceAction -> Term s PString)
-> PShow PGovernanceAction
forall (s :: S). Bool -> Term s PGovernanceAction -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PGovernanceAction -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PGovernanceAction -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PGovernanceAction where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PGovernanceAction Plutus.GovernanceAction
  instance
    PLiftable PGovernanceAction

-- | @since 3.1.0
instance PTryFrom PData (PAsData PGovernanceAction)

-- | @since 3.1.0
newtype PProposalProcedure (s :: S)
  = PProposalProcedure
      ( Term
          s
          ( PDataRecord
              '[ "deposit" ':= Value.PLovelace
               , "returnAddr" ':= PCredential
               , "governanceAction" ':= PGovernanceAction
               ]
          )
      )
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PProposalProcedure s -> Rep (PProposalProcedure s) x)
-> (forall x. Rep (PProposalProcedure s) x -> PProposalProcedure s)
-> Generic (PProposalProcedure s)
forall x. Rep (PProposalProcedure s) x -> PProposalProcedure s
forall x. PProposalProcedure s -> Rep (PProposalProcedure s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x.
Rep (PProposalProcedure s) x -> PProposalProcedure s
forall (s :: S) x.
PProposalProcedure s -> Rep (PProposalProcedure s) x
$cfrom :: forall (s :: S) x.
PProposalProcedure s -> Rep (PProposalProcedure s) x
from :: forall x. PProposalProcedure s -> Rep (PProposalProcedure s) x
$cto :: forall (s :: S) x.
Rep (PProposalProcedure s) x -> PProposalProcedure s
to :: forall x. Rep (PProposalProcedure s) x -> PProposalProcedure s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S).
 PProposalProcedure s -> Term s (PInner PProposalProcedure))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PProposalProcedure)
    -> (PProposalProcedure s -> Term s b) -> Term s b)
-> PlutusType PProposalProcedure
forall (s :: S).
PProposalProcedure s -> Term s (PInner PProposalProcedure)
forall (s :: S) (b :: PType).
Term s (PInner PProposalProcedure)
-> (PProposalProcedure s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S).
PProposalProcedure s -> Term s (PInner PProposalProcedure)
pcon' :: forall (s :: S).
PProposalProcedure s -> Term s (PInner PProposalProcedure)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PProposalProcedure)
-> (PProposalProcedure s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PProposalProcedure)
-> (PProposalProcedure s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s (PAsData PProposalProcedure) -> Term s PProposalProcedure)
-> (forall (s :: S). Term s PProposalProcedure -> Term s PData)
-> PIsData PProposalProcedure
forall (s :: S).
Term s (PAsData PProposalProcedure) -> Term s PProposalProcedure
forall (s :: S). Term s PProposalProcedure -> Term s PData
forall (a :: PType).
(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 PProposalProcedure) -> Term s PProposalProcedure
pfromDataImpl :: forall (s :: S).
Term s (PAsData PProposalProcedure) -> Term s PProposalProcedure
$cpdataImpl :: forall (s :: S). Term s PProposalProcedure -> Term s PData
pdataImpl :: forall (s :: S). Term s PProposalProcedure -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PProposalProcedure
 -> Term s (PDataRecord (PFields PProposalProcedure)))
-> PDataFields PProposalProcedure
forall (s :: S).
Term s PProposalProcedure
-> Term s (PDataRecord (PFields PProposalProcedure))
forall (a :: PType).
(forall (s :: S). Term s a -> Term s (PDataRecord (PFields a)))
-> PDataFields a
$cptoFields :: forall (s :: S).
Term s PProposalProcedure
-> Term s (PDataRecord (PFields PProposalProcedure))
ptoFields :: forall (s :: S).
Term s PProposalProcedure
-> Term s (PDataRecord (PFields PProposalProcedure))
PDataFields
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PProposalProcedure
 -> Term s PProposalProcedure -> Term s PBool)
-> PEq PProposalProcedure
forall (s :: S).
Term s PProposalProcedure
-> Term s PProposalProcedure -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PProposalProcedure
-> Term s PProposalProcedure -> Term s PBool
#== :: forall (s :: S).
Term s PProposalProcedure
-> Term s PProposalProcedure -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S).
 Bool -> Term s PProposalProcedure -> Term s PString)
-> PShow PProposalProcedure
forall (s :: S).
Bool -> Term s PProposalProcedure -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S).
Bool -> Term s PProposalProcedure -> Term s PString
pshow' :: forall (s :: S).
Bool -> Term s PProposalProcedure -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PProposalProcedure where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PProposalProcedure Plutus.ProposalProcedure
  instance
    PLiftable PProposalProcedure

-- | @since 3.1.0
instance PTryFrom PData (PAsData PProposalProcedure)

-- | @since 2.0.0
data PScriptPurpose (s :: S)
  = PMinting (Term s (PDataRecord '["_0" ':= Value.PCurrencySymbol]))
  | PSpending (Term s (PDataRecord '["_0" ':= PTxOutRef]))
  | -- | @since 3.1.0
    PRewarding (Term s (PDataRecord '["_0" ':= PCredential]))
  | PCertifying (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PTxCert]))
  | -- | @since 3.1.0
    PVoting (Term s (PDataRecord '["_0" ':= PVoter]))
  | -- | @since 3.1.0
    PProposing (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PProposalProcedure]))
  deriving stock
    ( -- | @since 2.0.0
      (forall x. PScriptPurpose s -> Rep (PScriptPurpose s) x)
-> (forall x. Rep (PScriptPurpose s) x -> PScriptPurpose s)
-> Generic (PScriptPurpose s)
forall x. Rep (PScriptPurpose s) x -> PScriptPurpose s
forall x. PScriptPurpose s -> Rep (PScriptPurpose s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PScriptPurpose s) x -> PScriptPurpose s
forall (s :: S) x. PScriptPurpose s -> Rep (PScriptPurpose s) x
$cfrom :: forall (s :: S) x. PScriptPurpose s -> Rep (PScriptPurpose s) x
from :: forall x. PScriptPurpose s -> Rep (PScriptPurpose s) x
$cto :: forall (s :: S) x. Rep (PScriptPurpose s) x -> PScriptPurpose s
to :: forall x. Rep (PScriptPurpose s) x -> PScriptPurpose s
Generic
    )
  deriving anyclass
    ( -- | @since 2.0.0
      (forall (s :: S).
 PScriptPurpose s -> Term s (PInner PScriptPurpose))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PScriptPurpose)
    -> (PScriptPurpose s -> Term s b) -> Term s b)
-> PlutusType PScriptPurpose
forall (s :: S). PScriptPurpose s -> Term s (PInner PScriptPurpose)
forall (s :: S) (b :: PType).
Term s (PInner PScriptPurpose)
-> (PScriptPurpose s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PScriptPurpose s -> Term s (PInner PScriptPurpose)
pcon' :: forall (s :: S). PScriptPurpose s -> Term s (PInner PScriptPurpose)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PScriptPurpose)
-> (PScriptPurpose s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PScriptPurpose)
-> (PScriptPurpose s -> Term s b) -> Term s b
PlutusType
    , -- | @since 2.0.0
      (forall (s :: S).
 Term s (PAsData PScriptPurpose) -> Term s PScriptPurpose)
-> (forall (s :: S). Term s PScriptPurpose -> Term s PData)
-> PIsData PScriptPurpose
forall (s :: S).
Term s (PAsData PScriptPurpose) -> Term s PScriptPurpose
forall (s :: S). Term s PScriptPurpose -> Term s PData
forall (a :: PType).
(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 PScriptPurpose) -> Term s PScriptPurpose
pfromDataImpl :: forall (s :: S).
Term s (PAsData PScriptPurpose) -> Term s PScriptPurpose
$cpdataImpl :: forall (s :: S). Term s PScriptPurpose -> Term s PData
pdataImpl :: forall (s :: S). Term s PScriptPurpose -> Term s PData
PIsData
    , -- | @since 2.0.0
      (forall (s :: S).
 Term s PScriptPurpose -> Term s PScriptPurpose -> Term s PBool)
-> PEq PScriptPurpose
forall (s :: S).
Term s PScriptPurpose -> Term s PScriptPurpose -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PScriptPurpose -> Term s PScriptPurpose -> Term s PBool
#== :: forall (s :: S).
Term s PScriptPurpose -> Term s PScriptPurpose -> Term s PBool
PEq
    , -- | @since 2.0.0
      (forall (s :: S). Bool -> Term s PScriptPurpose -> Term s PString)
-> PShow PScriptPurpose
forall (s :: S). Bool -> Term s PScriptPurpose -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PScriptPurpose -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PScriptPurpose -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 2.0.0
instance DerivePlutusType PScriptPurpose where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PScriptPurpose Plutus.ScriptPurpose
  instance
    PLiftable PScriptPurpose

-- | @since 3.1.0
instance PTryFrom PData (PAsData PScriptPurpose)

-- | @since 3.1.0
data PScriptInfo (s :: S)
  = PMintingScript (Term s (PDataRecord '["_0" ':= Value.PCurrencySymbol]))
  | PSpendingScript (Term s (PDataRecord '["_0" ':= PTxOutRef, "_1" ':= PMaybeData PDatum]))
  | PRewardingScript (Term s (PDataRecord '["_0" ':= PCredential]))
  | PCertifyingScript (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PTxCert]))
  | PVotingScript (Term s (PDataRecord '["_0" ':= PVoter]))
  | PProposingScript (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PProposalProcedure]))
  deriving stock
    ( -- | @since 3.1.0
      (forall x. PScriptInfo s -> Rep (PScriptInfo s) x)
-> (forall x. Rep (PScriptInfo s) x -> PScriptInfo s)
-> Generic (PScriptInfo s)
forall x. Rep (PScriptInfo s) x -> PScriptInfo s
forall x. PScriptInfo s -> Rep (PScriptInfo s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PScriptInfo s) x -> PScriptInfo s
forall (s :: S) x. PScriptInfo s -> Rep (PScriptInfo s) x
$cfrom :: forall (s :: S) x. PScriptInfo s -> Rep (PScriptInfo s) x
from :: forall x. PScriptInfo s -> Rep (PScriptInfo s) x
$cto :: forall (s :: S) x. Rep (PScriptInfo s) x -> PScriptInfo s
to :: forall x. Rep (PScriptInfo s) x -> PScriptInfo s
Generic
    )
  deriving anyclass
    ( -- | @since 3.1.0
      (forall (s :: S). PScriptInfo s -> Term s (PInner PScriptInfo))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PScriptInfo)
    -> (PScriptInfo s -> Term s b) -> Term s b)
-> PlutusType PScriptInfo
forall (s :: S). PScriptInfo s -> Term s (PInner PScriptInfo)
forall (s :: S) (b :: PType).
Term s (PInner PScriptInfo)
-> (PScriptInfo s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PScriptInfo s -> Term s (PInner PScriptInfo)
pcon' :: forall (s :: S). PScriptInfo s -> Term s (PInner PScriptInfo)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PScriptInfo)
-> (PScriptInfo s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PScriptInfo)
-> (PScriptInfo s -> Term s b) -> Term s b
PlutusType
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s (PAsData PScriptInfo) -> Term s PScriptInfo)
-> (forall (s :: S). Term s PScriptInfo -> Term s PData)
-> PIsData PScriptInfo
forall (s :: S). Term s (PAsData PScriptInfo) -> Term s PScriptInfo
forall (s :: S). Term s PScriptInfo -> Term s PData
forall (a :: PType).
(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 PScriptInfo) -> Term s PScriptInfo
pfromDataImpl :: forall (s :: S). Term s (PAsData PScriptInfo) -> Term s PScriptInfo
$cpdataImpl :: forall (s :: S). Term s PScriptInfo -> Term s PData
pdataImpl :: forall (s :: S). Term s PScriptInfo -> Term s PData
PIsData
    , -- | @since 3.1.0
      (forall (s :: S).
 Term s PScriptInfo -> Term s PScriptInfo -> Term s PBool)
-> PEq PScriptInfo
forall (s :: S).
Term s PScriptInfo -> Term s PScriptInfo -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PScriptInfo -> Term s PScriptInfo -> Term s PBool
#== :: forall (s :: S).
Term s PScriptInfo -> Term s PScriptInfo -> Term s PBool
PEq
    , -- | @since 3.1.0
      (forall (s :: S). Bool -> Term s PScriptInfo -> Term s PString)
-> PShow PScriptInfo
forall (s :: S). Bool -> Term s PScriptInfo -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PScriptInfo -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PScriptInfo -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 3.1.0
instance DerivePlutusType PScriptInfo where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PScriptInfo Plutus.ScriptInfo
  instance
    PLiftable PScriptInfo

-- | @since 3.1.0
instance PTryFrom PData (PAsData PScriptInfo)

{- | An input of the pending transaction.

@since 2.0.0
-}
newtype PTxInInfo (s :: S)
  = PTxInInfo
      ( Term
          s
          ( PDataRecord
              '[ "outRef" ':= PTxOutRef
               , "resolved" ':= PTxOut
               ]
          )
      )
  deriving stock
    ( -- | @since 2.0.0
      (forall x. PTxInInfo s -> Rep (PTxInInfo s) x)
-> (forall x. Rep (PTxInInfo s) x -> PTxInInfo s)
-> Generic (PTxInInfo s)
forall x. Rep (PTxInInfo s) x -> PTxInInfo s
forall x. PTxInInfo s -> Rep (PTxInInfo s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PTxInInfo s) x -> PTxInInfo s
forall (s :: S) x. PTxInInfo s -> Rep (PTxInInfo s) x
$cfrom :: forall (s :: S) x. PTxInInfo s -> Rep (PTxInInfo s) x
from :: forall x. PTxInInfo s -> Rep (PTxInInfo s) x
$cto :: forall (s :: S) x. Rep (PTxInInfo s) x -> PTxInInfo s
to :: forall x. Rep (PTxInInfo s) x -> PTxInInfo s
Generic
    )
  deriving anyclass
    ( -- | @since 2.0.0
      (forall (s :: S). PTxInInfo s -> Term s (PInner PTxInInfo))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PTxInInfo) -> (PTxInInfo s -> Term s b) -> Term s b)
-> PlutusType PTxInInfo
forall (s :: S). PTxInInfo s -> Term s (PInner PTxInInfo)
forall (s :: S) (b :: PType).
Term s (PInner PTxInInfo) -> (PTxInInfo s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PTxInInfo s -> Term s (PInner PTxInInfo)
pcon' :: forall (s :: S). PTxInInfo s -> Term s (PInner PTxInInfo)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PTxInInfo) -> (PTxInInfo s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PTxInInfo) -> (PTxInInfo s -> Term s b) -> Term s b
PlutusType
    , -- | @since 2.0.0
      (forall (s :: S). Term s (PAsData PTxInInfo) -> Term s PTxInInfo)
-> (forall (s :: S). Term s PTxInInfo -> Term s PData)
-> PIsData PTxInInfo
forall (s :: S). Term s (PAsData PTxInInfo) -> Term s PTxInInfo
forall (s :: S). Term s PTxInInfo -> Term s PData
forall (a :: PType).
(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 PTxInInfo) -> Term s PTxInInfo
pfromDataImpl :: forall (s :: S). Term s (PAsData PTxInInfo) -> Term s PTxInInfo
$cpdataImpl :: forall (s :: S). Term s PTxInInfo -> Term s PData
pdataImpl :: forall (s :: S). Term s PTxInInfo -> Term s PData
PIsData
    , -- | @since 2.0.0
      (forall (s :: S).
 Term s PTxInInfo -> Term s (PDataRecord (PFields PTxInInfo)))
-> PDataFields PTxInInfo
forall (s :: S).
Term s PTxInInfo -> Term s (PDataRecord (PFields PTxInInfo))
forall (a :: PType).
(forall (s :: S). Term s a -> Term s (PDataRecord (PFields a)))
-> PDataFields a
$cptoFields :: forall (s :: S).
Term s PTxInInfo -> Term s (PDataRecord (PFields PTxInInfo))
ptoFields :: forall (s :: S).
Term s PTxInInfo -> Term s (PDataRecord (PFields PTxInInfo))
PDataFields
    , -- | @since 2.0.0
      (forall (s :: S).
 Term s PTxInInfo -> Term s PTxInInfo -> Term s PBool)
-> PEq PTxInInfo
forall (s :: S).
Term s PTxInInfo -> Term s PTxInInfo -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PTxInInfo -> Term s PTxInInfo -> Term s PBool
#== :: forall (s :: S).
Term s PTxInInfo -> Term s PTxInInfo -> Term s PBool
PEq
    , -- | @since 2.0.0
      (forall (s :: S). Bool -> Term s PTxInInfo -> Term s PString)
-> PShow PTxInInfo
forall (s :: S). Bool -> Term s PTxInInfo -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PTxInInfo -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PTxInInfo -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 2.0.0
instance DerivePlutusType PTxInInfo where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PTxInInfo Plutus.TxInInfo
  instance
    PLiftable PTxInInfo

-- | @since 3.1.0
instance PTryFrom PData (PAsData PTxInInfo)

-- A pending transaction. This is the view as seen by a validator script.
--
-- @since WIP
newtype PTxInfo (s :: S)
  = PTxInfo
      ( Term
          s
          ( PDataRecord
              '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo)
               , "referenceInputs" ':= PBuiltinList (PAsData PTxInInfo)
               , "outputs" ':= PBuiltinList (PAsData PTxOut)
               , "fee" ':= Value.PLovelace
               , "mint" ':= Value.PValue 'AssocMap.Sorted 'Value.NonZero -- value minted by transaction
               , "txCerts" ':= PBuiltinList (PAsData PTxCert)
               , "wdrl" ':= AssocMap.PMap 'AssocMap.Unsorted PCredential Value.PLovelace -- Staking withdrawals
               , "validRange" ':= Interval.PInterval PPosixTime
               , "signatories" ':= PBuiltinList (PAsData PPubKeyHash)
               , "redeemers" ':= AssocMap.PMap 'AssocMap.Unsorted PScriptPurpose PRedeemer
               , "data" ':= AssocMap.PMap 'AssocMap.Unsorted PDatumHash PDatum
               , "id" ':= PTxId -- hash of the pending transaction
               , "votes" ':= AssocMap.PMap 'AssocMap.Unsorted PVoter (AssocMap.PMap 'AssocMap.Unsorted PGovernanceActionId PVote)
               , "proposalProcedures" ':= PBuiltinList (PAsData PProposalProcedure)
               , "currentTreasuryAmount" ':= PMaybeData Value.PLovelace
               , "treasuryDonation" ':= PMaybeData Value.PLovelace
               ]
          )
      )
  deriving stock
    ( -- | @since 2.0.0
      (forall x. PTxInfo s -> Rep (PTxInfo s) x)
-> (forall x. Rep (PTxInfo s) x -> PTxInfo s)
-> Generic (PTxInfo s)
forall x. Rep (PTxInfo s) x -> PTxInfo s
forall x. PTxInfo s -> Rep (PTxInfo s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PTxInfo s) x -> PTxInfo s
forall (s :: S) x. PTxInfo s -> Rep (PTxInfo s) x
$cfrom :: forall (s :: S) x. PTxInfo s -> Rep (PTxInfo s) x
from :: forall x. PTxInfo s -> Rep (PTxInfo s) x
$cto :: forall (s :: S) x. Rep (PTxInfo s) x -> PTxInfo s
to :: forall x. Rep (PTxInfo s) x -> PTxInfo s
Generic
    )
  deriving anyclass
    ( -- | @since 2.0.0
      (forall (s :: S). PTxInfo s -> Term s (PInner PTxInfo))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PTxInfo) -> (PTxInfo s -> Term s b) -> Term s b)
-> PlutusType PTxInfo
forall (s :: S). PTxInfo s -> Term s (PInner PTxInfo)
forall (s :: S) (b :: PType).
Term s (PInner PTxInfo) -> (PTxInfo s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PTxInfo s -> Term s (PInner PTxInfo)
pcon' :: forall (s :: S). PTxInfo s -> Term s (PInner PTxInfo)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PTxInfo) -> (PTxInfo s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PTxInfo) -> (PTxInfo s -> Term s b) -> Term s b
PlutusType
    , -- | @since 2.0.0
      (forall (s :: S). Term s (PAsData PTxInfo) -> Term s PTxInfo)
-> (forall (s :: S). Term s PTxInfo -> Term s PData)
-> PIsData PTxInfo
forall (s :: S). Term s (PAsData PTxInfo) -> Term s PTxInfo
forall (s :: S). Term s PTxInfo -> Term s PData
forall (a :: PType).
(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 PTxInfo) -> Term s PTxInfo
pfromDataImpl :: forall (s :: S). Term s (PAsData PTxInfo) -> Term s PTxInfo
$cpdataImpl :: forall (s :: S). Term s PTxInfo -> Term s PData
pdataImpl :: forall (s :: S). Term s PTxInfo -> Term s PData
PIsData
    , -- | @since 2.0.0
      (forall (s :: S).
 Term s PTxInfo -> Term s (PDataRecord (PFields PTxInfo)))
-> PDataFields PTxInfo
forall (s :: S).
Term s PTxInfo -> Term s (PDataRecord (PFields PTxInfo))
forall (a :: PType).
(forall (s :: S). Term s a -> Term s (PDataRecord (PFields a)))
-> PDataFields a
$cptoFields :: forall (s :: S).
Term s PTxInfo -> Term s (PDataRecord (PFields PTxInfo))
ptoFields :: forall (s :: S).
Term s PTxInfo -> Term s (PDataRecord (PFields PTxInfo))
PDataFields
    , -- | @since 2.0.0
      (forall (s :: S). Term s PTxInfo -> Term s PTxInfo -> Term s PBool)
-> PEq PTxInfo
forall (s :: S). Term s PTxInfo -> Term s PTxInfo -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S). Term s PTxInfo -> Term s PTxInfo -> Term s PBool
#== :: forall (s :: S). Term s PTxInfo -> Term s PTxInfo -> Term s PBool
PEq
    , -- | @since 2.0.0
      (forall (s :: S). Bool -> Term s PTxInfo -> Term s PString)
-> PShow PTxInfo
forall (s :: S). Bool -> Term s PTxInfo -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PTxInfo -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PTxInfo -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 2.0.0
instance DerivePlutusType PTxInfo where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PTxInfo Plutus.TxInfo
  instance
    PLiftable PTxInfo

-- | @since 3.1.0
instance PTryFrom PData (PAsData PTxInfo)

-- | @since 3.1.0
newtype PScriptContext (s :: S)
  = PScriptContext
      ( Term
          s
          ( PDataRecord
              '[ "txInfo" ':= PTxInfo
               , "redeemer" ':= PRedeemer
               , "scriptInfo" ':= PScriptInfo
               ]
          )
      )
  deriving stock
    ( -- | @since 2.0.0
      (forall x. PScriptContext s -> Rep (PScriptContext s) x)
-> (forall x. Rep (PScriptContext s) x -> PScriptContext s)
-> Generic (PScriptContext s)
forall x. Rep (PScriptContext s) x -> PScriptContext s
forall x. PScriptContext s -> Rep (PScriptContext s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PScriptContext s) x -> PScriptContext s
forall (s :: S) x. PScriptContext s -> Rep (PScriptContext s) x
$cfrom :: forall (s :: S) x. PScriptContext s -> Rep (PScriptContext s) x
from :: forall x. PScriptContext s -> Rep (PScriptContext s) x
$cto :: forall (s :: S) x. Rep (PScriptContext s) x -> PScriptContext s
to :: forall x. Rep (PScriptContext s) x -> PScriptContext s
Generic
    )
  deriving anyclass
    ( -- | @since 2.0.0
      (forall (s :: S).
 PScriptContext s -> Term s (PInner PScriptContext))
-> (forall (s :: S) (b :: PType).
    Term s (PInner PScriptContext)
    -> (PScriptContext s -> Term s b) -> Term s b)
-> PlutusType PScriptContext
forall (s :: S). PScriptContext s -> Term s (PInner PScriptContext)
forall (s :: S) (b :: PType).
Term s (PInner PScriptContext)
-> (PScriptContext s -> Term s b) -> Term s b
forall (a :: PType).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: PType).
    Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PScriptContext s -> Term s (PInner PScriptContext)
pcon' :: forall (s :: S). PScriptContext s -> Term s (PInner PScriptContext)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PScriptContext)
-> (PScriptContext s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PScriptContext)
-> (PScriptContext s -> Term s b) -> Term s b
PlutusType
    , -- | @since 2.0.0
      (forall (s :: S).
 Term s (PAsData PScriptContext) -> Term s PScriptContext)
-> (forall (s :: S). Term s PScriptContext -> Term s PData)
-> PIsData PScriptContext
forall (s :: S).
Term s (PAsData PScriptContext) -> Term s PScriptContext
forall (s :: S). Term s PScriptContext -> Term s PData
forall (a :: PType).
(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 PScriptContext) -> Term s PScriptContext
pfromDataImpl :: forall (s :: S).
Term s (PAsData PScriptContext) -> Term s PScriptContext
$cpdataImpl :: forall (s :: S). Term s PScriptContext -> Term s PData
pdataImpl :: forall (s :: S). Term s PScriptContext -> Term s PData
PIsData
    , -- | @since 2.0.0
      (forall (s :: S).
 Term s PScriptContext
 -> Term s (PDataRecord (PFields PScriptContext)))
-> PDataFields PScriptContext
forall (s :: S).
Term s PScriptContext
-> Term s (PDataRecord (PFields PScriptContext))
forall (a :: PType).
(forall (s :: S). Term s a -> Term s (PDataRecord (PFields a)))
-> PDataFields a
$cptoFields :: forall (s :: S).
Term s PScriptContext
-> Term s (PDataRecord (PFields PScriptContext))
ptoFields :: forall (s :: S).
Term s PScriptContext
-> Term s (PDataRecord (PFields PScriptContext))
PDataFields
    , -- | @since 2.0.0
      (forall (s :: S).
 Term s PScriptContext -> Term s PScriptContext -> Term s PBool)
-> PEq PScriptContext
forall (s :: S).
Term s PScriptContext -> Term s PScriptContext -> Term s PBool
forall (t :: PType).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PScriptContext -> Term s PScriptContext -> Term s PBool
#== :: forall (s :: S).
Term s PScriptContext -> Term s PScriptContext -> Term s PBool
PEq
    , -- | @since 2.0.0
      (forall (s :: S). Bool -> Term s PScriptContext -> Term s PString)
-> PShow PScriptContext
forall (s :: S). Bool -> Term s PScriptContext -> Term s PString
forall (t :: PType).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PScriptContext -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PScriptContext -> Term s PString
PShow
    , -- | @since 3.1.0
      PTryFrom PData
    )

-- | @since 2.0.0
instance DerivePlutusType PScriptContext where
  type DPTStrat _ = PlutusTypeData

-- | @since WIP
deriving via
  DeriveDataPLiftable PScriptContext Plutus.ScriptContext
  instance
    PLiftable PScriptContext

-- | @since 3.1.0
instance PTryFrom PData (PAsData PScriptContext)

{- | Find the datum corresponding to a datum hash, if there is one.

@since 3.1.0
-}
pfindDatum ::
  forall (s :: S).
  Term s (PDatumHash :--> PTxInfo :--> PMaybe PDatum)
pfindDatum :: forall (s :: S).
Term s (PDatumHash :--> (PTxInfo :--> PMaybe PDatum))
pfindDatum = (forall (s :: S).
 Term s (PDatumHash :--> (PTxInfo :--> PMaybe PDatum)))
-> Term s (PDatumHash :--> (PTxInfo :--> PMaybe PDatum))
forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic ((forall (s :: S).
  Term s (PDatumHash :--> (PTxInfo :--> PMaybe PDatum)))
 -> Term s (PDatumHash :--> (PTxInfo :--> PMaybe PDatum)))
-> (forall (s :: S).
    Term s (PDatumHash :--> (PTxInfo :--> PMaybe PDatum)))
-> Term s (PDatumHash :--> (PTxInfo :--> PMaybe PDatum))
forall a b. (a -> b) -> a -> b
$ (Term s PDatumHash -> Term s PTxInfo -> Term s (PMaybe PDatum))
-> Term s (PDatumHash :--> (PTxInfo :--> PMaybe PDatum))
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
forall (c :: PType).
HasCallStack =>
(Term s c -> Term s PTxInfo -> Term s (PMaybe PDatum))
-> Term s (c :--> (PTxInfo :--> PMaybe PDatum))
plam ((Term s PDatumHash -> Term s PTxInfo -> Term s (PMaybe PDatum))
 -> Term s (PDatumHash :--> (PTxInfo :--> PMaybe PDatum)))
-> (Term s PDatumHash -> Term s PTxInfo -> Term s (PMaybe PDatum))
-> Term s (PDatumHash :--> (PTxInfo :--> PMaybe PDatum))
forall a b. (a -> b) -> a -> b
$ \Term s PDatumHash
dh Term s PTxInfo
txI ->
  let infoData :: Term s (PMap 'Unsorted PDatumHash PDatum)
infoData = forall (name :: Symbol) (b :: PType) (p :: PType) (s :: S)
       (a :: PType) (as :: [PLabeledType]) (n :: Nat).
(PDataFields p, as ~ PFields p, n ~ PLabelIndex name as,
 KnownNat n, a ~ PUnLabel (IndexList n as), PFromDataable a b) =>
Term s (p :--> b)
pfield @"data" Term s (PTxInfo :--> PMap 'Unsorted PDatumHash PDatum)
-> Term s PTxInfo -> Term s (PMap 'Unsorted PDatumHash PDatum)
forall (s :: S) (a :: PType) (b :: PType).
Term s (a :--> b) -> Term s a -> Term s b
# Term s PTxInfo
txI
   in Term
  s
  (PDatumHash
   :--> (PMap 'Unsorted PDatumHash PDatum :--> PMaybe PDatum))
forall (k :: PType) (v :: PType) (any :: KeyGuarantees) (s :: S).
(PIsData k, PIsData v) =>
Term s (k :--> (PMap any k v :--> PMaybe v))
AssocMap.plookup Term
  s
  (PDatumHash
   :--> (PMap 'Unsorted PDatumHash PDatum :--> PMaybe PDatum))
-> Term s PDatumHash
-> Term s (PMap 'Unsorted PDatumHash PDatum :--> PMaybe PDatum)
forall (s :: S) (a :: PType) (b :: PType).
Term s (a :--> b) -> Term s a -> Term s b
# Term s PDatumHash
dh Term s (PMap 'Unsorted PDatumHash PDatum :--> PMaybe PDatum)
-> Term s (PMap 'Unsorted PDatumHash PDatum)
-> Term s (PMaybe PDatum)
forall (s :: S) (a :: PType) (b :: PType).
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PMap 'Unsorted PDatumHash PDatum)
infoData

{- | Find the hash of a datum if it's part of the pending transaction's hashes.

@since 3.1.0
-}
pfindDatumHash ::
  forall (s :: S).
  Term s (PDatum :--> PTxInfo :--> PMaybe PDatumHash)
pfindDatumHash :: forall (s :: S).
Term s (PDatum :--> (PTxInfo :--> PMaybe PDatumHash))
pfindDatumHash = (forall (s :: S).
 Term s (PDatum :--> (PTxInfo :--> PMaybe PDatumHash)))
-> Term s (PDatum :--> (PTxInfo :--> PMaybe PDatumHash))
forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic ((forall (s :: S).
  Term s (PDatum :--> (PTxInfo :--> PMaybe PDatumHash)))
 -> Term s (PDatum :--> (PTxInfo :--> PMaybe PDatumHash)))
-> (forall (s :: S).
    Term s (PDatum :--> (PTxInfo :--> PMaybe PDatumHash)))
-> Term s (PDatum :--> (PTxInfo :--> PMaybe PDatumHash))
forall a b. (a -> b) -> a -> b
$ (Term s PDatum -> Term s PTxInfo -> Term s (PMaybe PDatumHash))
-> Term s (PDatum :--> (PTxInfo :--> PMaybe PDatumHash))
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
forall (c :: PType).
HasCallStack =>
(Term s c -> Term s PTxInfo -> Term s (PMaybe PDatumHash))
-> Term s (c :--> (PTxInfo :--> PMaybe PDatumHash))
plam ((Term s PDatum -> Term s PTxInfo -> Term s (PMaybe PDatumHash))
 -> Term s (PDatum :--> (PTxInfo :--> PMaybe PDatumHash)))
-> (Term s PDatum -> Term s PTxInfo -> Term s (PMaybe PDatumHash))
-> Term s (PDatum :--> (PTxInfo :--> PMaybe PDatumHash))
forall a b. (a -> b) -> a -> b
$ \Term s PDatum
d Term s PTxInfo
txI ->
  let infoData :: Term s (PMap 'Unsorted PDatumHash PDatum)
infoData = forall (name :: Symbol) (b :: PType) (p :: PType) (s :: S)
       (a :: PType) (as :: [PLabeledType]) (n :: Nat).
(PDataFields p, as ~ PFields p, n ~ PLabelIndex name as,
 KnownNat n, a ~ PUnLabel (IndexList n as), PFromDataable a b) =>
Term s (p :--> b)
pfield @"data" Term s (PTxInfo :--> PMap 'Unsorted PDatumHash PDatum)
-> Term s PTxInfo -> Term s (PMap 'Unsorted PDatumHash PDatum)
forall (s :: S) (a :: PType) (b :: PType).
Term s (a :--> b) -> Term s a -> Term s b
# Term s PTxInfo
txI
   in Term s (PMap 'Unsorted PDatumHash PDatum)
-> (PMap 'Unsorted PDatumHash PDatum s
    -> Term s (PMaybe PDatumHash))
-> Term s (PMaybe PDatumHash)
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch Term s (PMap 'Unsorted PDatumHash PDatum)
infoData ((PMap 'Unsorted PDatumHash PDatum s -> Term s (PMaybe PDatumHash))
 -> Term s (PMaybe PDatumHash))
-> (PMap 'Unsorted PDatumHash PDatum s
    -> Term s (PMaybe PDatumHash))
-> Term s (PMaybe PDatumHash)
forall a b. (a -> b) -> a -> b
$ \(AssocMap.PMap Term
  s
  (PBuiltinList (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)))
ell) ->
        Term
  s (PMaybe (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)))
-> (PMaybe (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)) s
    -> Term s (PMaybe PDatumHash))
-> Term s (PMaybe PDatumHash)
forall (a :: PType) (s :: S) (b :: PType).
PlutusType a =>
Term s a -> (a s -> Term s b) -> Term s b
pmatch (Term
  s
  ((PBuiltinPair (PAsData PDatumHash) (PAsData PDatum) :--> PBool)
   :--> (PBuiltinList
           (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
         :--> PMaybe (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))))
forall (l :: PType -> PType) (a :: PType) (s :: S).
PIsListLike l a =>
Term s ((a :--> PBool) :--> (l a :--> PMaybe a))
pfind Term
  s
  ((PBuiltinPair (PAsData PDatumHash) (PAsData PDatum) :--> PBool)
   :--> (PBuiltinList
           (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
         :--> PMaybe (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))))
-> Term
     s (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum) :--> PBool)
-> Term
     s
     (PBuiltinList (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
      :--> PMaybe (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)))
forall (s :: S) (a :: PType) (b :: PType).
Term s (a :--> b) -> Term s a -> Term s b
# (Term
  s
  (PDatum
   :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
         :--> PBool))
forall (s' :: S).
Term
  s'
  (PDatum
   :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
         :--> PBool))
matches Term
  s
  (PDatum
   :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
         :--> PBool))
-> Term s PDatum
-> Term
     s (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum) :--> PBool)
forall (s :: S) (a :: PType) (b :: PType).
Term s (a :--> b) -> Term s a -> Term s b
# Term s PDatum
d) Term
  s
  (PBuiltinList (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
   :--> PMaybe (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)))
-> Term
     s
     (PBuiltinList (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)))
-> Term
     s (PMaybe (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)))
forall (s :: S) (a :: PType) (b :: PType).
Term s (a :--> b) -> Term s a -> Term s b
# Term
  s
  (PBuiltinList (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)))
ell) ((PMaybe (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)) s
  -> Term s (PMaybe PDatumHash))
 -> Term s (PMaybe PDatumHash))
-> (PMaybe (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)) s
    -> Term s (PMaybe PDatumHash))
-> Term s (PMaybe PDatumHash)
forall a b. (a -> b) -> a -> b
$ \case
          PMaybe (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)) s
PNothing -> PMaybe PDatumHash s -> Term s (PMaybe PDatumHash)
forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon PMaybe PDatumHash s
forall (a :: PType) (s :: S). PMaybe a s
PNothing
          PJust Term s (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
p -> PMaybe PDatumHash s -> Term s (PMaybe PDatumHash)
forall (a :: PType) (s :: S). PlutusType a => a s -> Term s a
pcon (PMaybe PDatumHash s -> Term s (PMaybe PDatumHash))
-> (Term s (PAsData PDatumHash) -> PMaybe PDatumHash s)
-> Term s (PAsData PDatumHash)
-> Term s (PMaybe PDatumHash)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Term s PDatumHash -> PMaybe PDatumHash s
forall (a :: PType) (s :: S). Term s a -> PMaybe a s
PJust (Term s PDatumHash -> PMaybe PDatumHash s)
-> (Term s (PAsData PDatumHash) -> Term s PDatumHash)
-> Term s (PAsData PDatumHash)
-> PMaybe PDatumHash s
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Term s (PAsData PDatumHash) -> Term s PDatumHash
forall (a :: PType) (s :: S).
PIsData a =>
Term s (PAsData a) -> Term s a
pfromData (Term s (PAsData PDatumHash) -> Term s (PMaybe PDatumHash))
-> Term s (PAsData PDatumHash) -> Term s (PMaybe PDatumHash)
forall a b. (a -> b) -> a -> b
$ Term
  s
  (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
   :--> PAsData PDatumHash)
forall (s :: S) (a :: PType) (b :: PType).
Term s (PBuiltinPair a b :--> a)
pfstBuiltin Term
  s
  (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
   :--> PAsData PDatumHash)
-> Term s (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
-> Term s (PAsData PDatumHash)
forall (s :: S) (a :: PType) (b :: PType).
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
p
  where
    matches ::
      forall (s' :: S).
      Term
        s'
        ( PDatum
            :--> PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
            :--> PBool
        )
    matches :: forall (s' :: S).
Term
  s'
  (PDatum
   :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
         :--> PBool))
matches = (forall (s' :: S).
 Term
   s'
   (PDatum
    :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
          :--> PBool)))
-> Term
     s'
     (PDatum
      :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
            :--> PBool))
forall (a :: PType) (s :: S).
HasCallStack =>
ClosedTerm a -> Term s a
phoistAcyclic ((forall (s' :: S).
  Term
    s'
    (PDatum
     :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
           :--> PBool)))
 -> Term
      s'
      (PDatum
       :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
             :--> PBool)))
-> (forall (s' :: S).
    Term
      s'
      (PDatum
       :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
             :--> PBool)))
-> Term
     s'
     (PDatum
      :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
            :--> PBool))
forall a b. (a -> b) -> a -> b
$ (Term s PDatum
 -> Term s (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
 -> Term s PBool)
-> Term
     s
     (PDatum
      :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
            :--> PBool))
forall a (b :: PType) (s :: S) (c :: PType).
(PLamN a b s, HasCallStack) =>
(Term s c -> a) -> Term s (c :--> b)
forall (c :: PType).
HasCallStack =>
(Term s c
 -> Term s (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
 -> Term s PBool)
-> Term
     s
     (c
      :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
            :--> PBool))
plam ((Term s PDatum
  -> Term s (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
  -> Term s PBool)
 -> Term
      s
      (PDatum
       :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
             :--> PBool)))
-> (Term s PDatum
    -> Term s (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
    -> Term s PBool)
-> Term
     s
     (PDatum
      :--> (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
            :--> PBool))
forall a b. (a -> b) -> a -> b
$ \Term s PDatum
needle Term s (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
p ->
      Term s PDatum
needle Term s PDatum -> Term s PDatum -> Term s PBool
forall (s :: S). Term s PDatum -> Term s PDatum -> Term s PBool
forall (t :: PType) (s :: S).
PEq t =>
Term s t -> Term s t -> Term s PBool
#== Term s (PAsData PDatum) -> Term s PDatum
forall (a :: PType) (s :: S).
PIsData a =>
Term s (PAsData a) -> Term s a
pfromData (Term
  s
  (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
   :--> PAsData PDatum)
forall (s :: S) (a :: PType) (b :: PType).
Term s (PBuiltinPair a b :--> b)
psndBuiltin Term
  s
  (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum)
   :--> PAsData PDatum)
-> Term s (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
-> Term s (PAsData PDatum)
forall (s :: S) (a :: PType) (b :: PType).
Term s (a :--> b) -> Term s a -> Term s b
# Term s (PBuiltinPair (PAsData PDatumHash) (PAsData PDatum))
p)