{-# OPTIONS_GHC -Wno-orphans #-}
module Plutarch.LedgerApi.V1.Credential (
PCredential (..),
PStakingCredential (..),
) where
import GHC.Generics (Generic)
import Generics.SOP qualified as SOP
import Plutarch.LedgerApi.V1.Crypto (PPubKeyHash)
import Plutarch.LedgerApi.V1.Scripts (PScriptHash)
import Plutarch.Prelude
import PlutusLedgerApi.V1 qualified as Plutus
data PCredential (s :: S)
= PPubKeyCredential (Term s (PAsData PPubKeyHash))
| PScriptCredential (Term s (PAsData PScriptHash))
deriving stock
(
(forall x. PCredential s -> Rep (PCredential s) x)
-> (forall x. Rep (PCredential s) x -> PCredential s)
-> Generic (PCredential s)
forall x. Rep (PCredential s) x -> PCredential s
forall x. PCredential s -> Rep (PCredential s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x. Rep (PCredential s) x -> PCredential s
forall (s :: S) x. PCredential s -> Rep (PCredential s) x
$cfrom :: forall (s :: S) x. PCredential s -> Rep (PCredential s) x
from :: forall x. PCredential s -> Rep (PCredential s) x
$cto :: forall (s :: S) x. Rep (PCredential s) x -> PCredential s
to :: forall x. Rep (PCredential s) x -> PCredential s
Generic
)
deriving anyclass
(
All SListI (Code (PCredential s))
All SListI (Code (PCredential s)) =>
(PCredential s -> Rep (PCredential s))
-> (Rep (PCredential s) -> PCredential s)
-> Generic (PCredential s)
Rep (PCredential s) -> PCredential s
PCredential s -> Rep (PCredential s)
forall a.
All SListI (Code a) =>
(a -> Rep a) -> (Rep a -> a) -> Generic a
forall (s :: S). All SListI (Code (PCredential s))
forall (s :: S). Rep (PCredential s) -> PCredential s
forall (s :: S). PCredential s -> Rep (PCredential s)
$cfrom :: forall (s :: S). PCredential s -> Rep (PCredential s)
from :: PCredential s -> Rep (PCredential s)
$cto :: forall (s :: S). Rep (PCredential s) -> PCredential s
to :: Rep (PCredential s) -> PCredential s
SOP.Generic
,
(forall (s :: S).
Term s (PAsData PCredential) -> Term s PCredential)
-> (forall (s :: S). Term s PCredential -> Term s PData)
-> PIsData PCredential
forall (s :: S). Term s (PAsData PCredential) -> Term s PCredential
forall (s :: S). Term s PCredential -> Term s PData
forall (a :: S -> Type).
(forall (s :: S). Term s (PAsData a) -> Term s a)
-> (forall (s :: S). Term s a -> Term s PData) -> PIsData a
$cpfromDataImpl :: forall (s :: S). Term s (PAsData PCredential) -> Term s PCredential
pfromDataImpl :: forall (s :: S). Term s (PAsData PCredential) -> Term s PCredential
$cpdataImpl :: forall (s :: S). Term s PCredential -> Term s PData
pdataImpl :: forall (s :: S). Term s PCredential -> Term s PData
PIsData
,
(forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PBool)
-> PEq PCredential
forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PBool
forall (t :: S -> Type).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PBool
#== :: forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PBool
PEq
,
(forall (s :: S). Bool -> Term s PCredential -> Term s PString)
-> PShow PCredential
forall (s :: S). Bool -> Term s PCredential -> Term s PString
forall (t :: S -> Type).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S). Bool -> Term s PCredential -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PCredential -> Term s PString
PShow
)
deriving
(
(forall (s :: S). PCredential s -> Term s (PInner PCredential))
-> (forall (s :: S) (b :: S -> Type).
Term s (PInner PCredential)
-> (PCredential s -> Term s b) -> Term s b)
-> PlutusType PCredential
forall (s :: S). PCredential s -> Term s (PInner PCredential)
forall (s :: S) (b :: S -> Type).
Term s (PInner PCredential)
-> (PCredential s -> Term s b) -> Term s b
forall (a :: S -> Type).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: S -> Type).
Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S). PCredential s -> Term s (PInner PCredential)
pcon' :: forall (s :: S). PCredential s -> Term s (PInner PCredential)
$cpmatch' :: forall (s :: S) (b :: S -> Type).
Term s (PInner PCredential)
-> (PCredential s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: S -> Type).
Term s (PInner PCredential)
-> (PCredential s -> Term s b) -> Term s b
PlutusType
)
via (DeriveAsDataStruct PCredential)
deriving via
DeriveDataPLiftable PCredential Plutus.Credential
instance
PLiftable PCredential
data PStakingCredential (s :: S)
= PStakingHash (Term s PCredential)
| PStakingPtr (Term s (PAsData PInteger)) (Term s (PAsData PInteger)) (Term s (PAsData PInteger))
deriving stock
(
(forall x. PStakingCredential s -> Rep (PStakingCredential s) x)
-> (forall x. Rep (PStakingCredential s) x -> PStakingCredential s)
-> Generic (PStakingCredential s)
forall x. Rep (PStakingCredential s) x -> PStakingCredential s
forall x. PStakingCredential s -> Rep (PStakingCredential s) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (s :: S) x.
Rep (PStakingCredential s) x -> PStakingCredential s
forall (s :: S) x.
PStakingCredential s -> Rep (PStakingCredential s) x
$cfrom :: forall (s :: S) x.
PStakingCredential s -> Rep (PStakingCredential s) x
from :: forall x. PStakingCredential s -> Rep (PStakingCredential s) x
$cto :: forall (s :: S) x.
Rep (PStakingCredential s) x -> PStakingCredential s
to :: forall x. Rep (PStakingCredential s) x -> PStakingCredential s
Generic
)
deriving anyclass
(
All SListI (Code (PStakingCredential s))
All SListI (Code (PStakingCredential s)) =>
(PStakingCredential s -> Rep (PStakingCredential s))
-> (Rep (PStakingCredential s) -> PStakingCredential s)
-> Generic (PStakingCredential s)
Rep (PStakingCredential s) -> PStakingCredential s
PStakingCredential s -> Rep (PStakingCredential s)
forall a.
All SListI (Code a) =>
(a -> Rep a) -> (Rep a -> a) -> Generic a
forall (s :: S). All SListI (Code (PStakingCredential s))
forall (s :: S). Rep (PStakingCredential s) -> PStakingCredential s
forall (s :: S). PStakingCredential s -> Rep (PStakingCredential s)
$cfrom :: forall (s :: S). PStakingCredential s -> Rep (PStakingCredential s)
from :: PStakingCredential s -> Rep (PStakingCredential s)
$cto :: forall (s :: S). Rep (PStakingCredential s) -> PStakingCredential s
to :: Rep (PStakingCredential s) -> PStakingCredential s
SOP.Generic
,
(forall (s :: S).
Term s (PAsData PStakingCredential) -> Term s PStakingCredential)
-> (forall (s :: S). Term s PStakingCredential -> Term s PData)
-> PIsData PStakingCredential
forall (s :: S).
Term s (PAsData PStakingCredential) -> Term s PStakingCredential
forall (s :: S). Term s PStakingCredential -> Term s PData
forall (a :: S -> Type).
(forall (s :: S). Term s (PAsData a) -> Term s a)
-> (forall (s :: S). Term s a -> Term s PData) -> PIsData a
$cpfromDataImpl :: forall (s :: S).
Term s (PAsData PStakingCredential) -> Term s PStakingCredential
pfromDataImpl :: forall (s :: S).
Term s (PAsData PStakingCredential) -> Term s PStakingCredential
$cpdataImpl :: forall (s :: S). Term s PStakingCredential -> Term s PData
pdataImpl :: forall (s :: S). Term s PStakingCredential -> Term s PData
PIsData
,
(forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PBool)
-> PEq PStakingCredential
forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PBool
forall (t :: S -> Type).
(forall (s :: S). Term s t -> Term s t -> Term s PBool) -> PEq t
$c#== :: forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PBool
#== :: forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PBool
PEq
,
(forall (s :: S).
Bool -> Term s PStakingCredential -> Term s PString)
-> PShow PStakingCredential
forall (s :: S).
Bool -> Term s PStakingCredential -> Term s PString
forall (t :: S -> Type).
(forall (s :: S). Bool -> Term s t -> Term s PString) -> PShow t
$cpshow' :: forall (s :: S).
Bool -> Term s PStakingCredential -> Term s PString
pshow' :: forall (s :: S).
Bool -> Term s PStakingCredential -> Term s PString
PShow
)
deriving
(
(forall (s :: S).
PStakingCredential s -> Term s (PInner PStakingCredential))
-> (forall (s :: S) (b :: S -> Type).
Term s (PInner PStakingCredential)
-> (PStakingCredential s -> Term s b) -> Term s b)
-> PlutusType PStakingCredential
forall (s :: S).
PStakingCredential s -> Term s (PInner PStakingCredential)
forall (s :: S) (b :: S -> Type).
Term s (PInner PStakingCredential)
-> (PStakingCredential s -> Term s b) -> Term s b
forall (a :: S -> Type).
(forall (s :: S). a s -> Term s (PInner a))
-> (forall (s :: S) (b :: S -> Type).
Term s (PInner a) -> (a s -> Term s b) -> Term s b)
-> PlutusType a
$cpcon' :: forall (s :: S).
PStakingCredential s -> Term s (PInner PStakingCredential)
pcon' :: forall (s :: S).
PStakingCredential s -> Term s (PInner PStakingCredential)
$cpmatch' :: forall (s :: S) (b :: S -> Type).
Term s (PInner PStakingCredential)
-> (PStakingCredential s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: S -> Type).
Term s (PInner PStakingCredential)
-> (PStakingCredential s -> Term s b) -> Term s b
PlutusType
)
via (DeriveAsDataStruct PStakingCredential)
deriving via
DeriveDataPLiftable PStakingCredential Plutus.StakingCredential
instance
PLiftable PStakingCredential