{-# OPTIONS_GHC -Wno-orphans #-}
module Plutarch.LedgerApi.V1.Contexts (
PScriptPurpose (..),
) where
import GHC.Generics (Generic)
import Plutarch.LedgerApi.V1.Credential qualified as Credential
import Plutarch.LedgerApi.V1.DCert qualified as DCert
import Plutarch.LedgerApi.V1.Tx qualified as Tx
import Plutarch.LedgerApi.Value qualified as Value
import Plutarch.Prelude
import PlutusLedgerApi.V1 qualified as Plutus
data PScriptPurpose (s :: S)
= PMinting (Term s (PDataRecord '["_0" ':= Value.PCurrencySymbol]))
| PSpending (Term s (PDataRecord '["_0" ':= Tx.PTxOutRef]))
| PRewarding (Term s (PDataRecord '["_0" ':= Credential.PStakingCredential]))
| PCertifying (Term s (PDataRecord '["_0" ':= DCert.PDCert]))
deriving stock
(
(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
(
(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
,
(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
,
(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
,
(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
,
PTryFrom PData
)
instance DerivePlutusType PScriptPurpose where
type DPTStrat _ = PlutusTypeData
deriving via
DeriveDataPLiftable PScriptPurpose Plutus.ScriptPurpose
instance
PLiftable PScriptPurpose
instance PTryFrom PData (PAsData PScriptPurpose)