{-# OPTIONS_GHC -Wno-orphans #-}
module Plutarch.LedgerApi.V1.Credential (
PCredential (..),
PStakingCredential (..),
) where
import GHC.Generics (Generic)
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 (PDataRecord '["_0" ':= PPubKeyHash]))
| PScriptCredential (Term s (PDataRecord '["_0" ':= 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
(
(forall (s :: S). PCredential s -> Term s (PInner PCredential))
-> (forall (s :: S) (b :: PType).
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 :: PType).
Term s (PInner PCredential)
-> (PCredential 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). PCredential s -> Term s (PInner PCredential)
pcon' :: forall (s :: S). PCredential s -> Term s (PInner PCredential)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PCredential)
-> (PCredential s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PCredential)
-> (PCredential s -> Term s b) -> Term s b
PlutusType
,
(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 :: 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 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 :: PType).
(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
,
PEq PCredential
PEq PCredential =>
(forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PBool)
-> (forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PBool)
-> (forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PCredential)
-> (forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PCredential)
-> POrd PCredential
forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PBool
forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PCredential
forall (t :: PType).
PEq t =>
(forall (s :: S). Term s t -> Term s t -> Term s PBool)
-> (forall (s :: S). Term s t -> Term s t -> Term s PBool)
-> (forall (s :: S). Term s t -> Term s t -> Term s t)
-> (forall (s :: S). Term s t -> Term s t -> Term s t)
-> POrd t
$c#<= :: forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PBool
#<= :: forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PBool
$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
$cpmax :: forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PCredential
pmax :: forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PCredential
$cpmin :: forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PCredential
pmin :: forall (s :: S).
Term s PCredential -> Term s PCredential -> Term s PCredential
POrd
,
(forall (s :: S). Bool -> Term s PCredential -> Term s PString)
-> PShow PCredential
forall (s :: S). Bool -> Term s PCredential -> 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 PCredential -> Term s PString
pshow' :: forall (s :: S). Bool -> Term s PCredential -> Term s PString
PShow
,
PTryFrom PData
)
instance DerivePlutusType PCredential where
type DPTStrat _ = PlutusTypeData
deriving via
DeriveDataPLiftable PCredential Plutus.Credential
instance
PLiftable PCredential
instance PTryFrom PData (PAsData PCredential)
data PStakingCredential (s :: S)
= PStakingHash (Term s (PDataRecord '["_0" ':= PCredential]))
| PStakingPtr
( Term
s
( PDataRecord
'[ "_0" ':= PInteger
, "_1" ':= PInteger
, "_2" ':= 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
(
(forall (s :: S).
PStakingCredential s -> Term s (PInner PStakingCredential))
-> (forall (s :: S) (b :: PType).
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 :: PType).
Term s (PInner PStakingCredential)
-> (PStakingCredential 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).
PStakingCredential s -> Term s (PInner PStakingCredential)
pcon' :: forall (s :: S).
PStakingCredential s -> Term s (PInner PStakingCredential)
$cpmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PStakingCredential)
-> (PStakingCredential s -> Term s b) -> Term s b
pmatch' :: forall (s :: S) (b :: PType).
Term s (PInner PStakingCredential)
-> (PStakingCredential s -> Term s b) -> Term s b
PlutusType
,
(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 :: 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 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 :: PType).
(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
,
PEq PStakingCredential
PEq PStakingCredential =>
(forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PBool)
-> (forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PBool)
-> (forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PStakingCredential)
-> (forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PStakingCredential)
-> POrd PStakingCredential
forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PBool
forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PStakingCredential
forall (t :: PType).
PEq t =>
(forall (s :: S). Term s t -> Term s t -> Term s PBool)
-> (forall (s :: S). Term s t -> Term s t -> Term s PBool)
-> (forall (s :: S). Term s t -> Term s t -> Term s t)
-> (forall (s :: S). Term s t -> Term s t -> Term s t)
-> POrd t
$c#<= :: forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PBool
#<= :: forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PBool
$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
$cpmax :: forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PStakingCredential
pmax :: forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PStakingCredential
$cpmin :: forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PStakingCredential
pmin :: forall (s :: S).
Term s PStakingCredential
-> Term s PStakingCredential -> Term s PStakingCredential
POrd
,
(forall (s :: S).
Bool -> Term s PStakingCredential -> Term s PString)
-> PShow PStakingCredential
forall (s :: S).
Bool -> Term s PStakingCredential -> 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 PStakingCredential -> Term s PString
pshow' :: forall (s :: S).
Bool -> Term s PStakingCredential -> Term s PString
PShow
,
PTryFrom PData
)
instance DerivePlutusType PStakingCredential where
type DPTStrat _ = PlutusTypeData
deriving via
DeriveDataPLiftable PStakingCredential Plutus.StakingCredential
instance
PLiftable PStakingCredential
instance PTryFrom PData (PAsData PStakingCredential)