Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- newtype PScriptContext (s :: S) = PScriptContext (Term s (PDataRecord '["txInfo" := PTxInfo, "purpose" := PScriptPurpose]))
- newtype PTxInfo (s :: S) = PTxInfo (Term s (PDataRecord '["inputs" := PBuiltinList PTxInInfo, "outputs" := PBuiltinList PTxOut, "fee" := PValue 'Sorted 'Positive, "mint" := PValue 'Sorted 'NoGuarantees, "dcert" := PBuiltinList PDCert, "wdrl" := PBuiltinList (PAsData (PTuple PStakingCredential PInteger)), "validRange" := PPOSIXTimeRange, "signatories" := PBuiltinList (PAsData PPubKeyHash), "datums" := PBuiltinList (PAsData (PTuple PDatumHash PDatum)), "id" := PTxId]))
- data PScriptPurpose (s :: S)
- = PMinting (Term s (PDataRecord '["_0" := PCurrencySymbol]))
- | PSpending (Term s (PDataRecord '["_0" := PTxOutRef]))
- | PRewarding (Term s (PDataRecord '["_0" := PStakingCredential]))
- | PCertifying (Term s (PDataRecord '["_0" := PDCert]))
- newtype PDatum (s :: S) = PDatum (Term s PData)
- newtype PDatumHash (s :: S) = PDatumHash (Term s PByteString)
- newtype PRedeemer (s :: S) = PRedeemer (Term s PData)
- newtype PRedeemerHash (s :: S) = PRedeemerHash (Term s PByteString)
- scriptHash :: Script -> ScriptHash
- datumHash :: Datum -> DatumHash
- redeemerHash :: Redeemer -> RedeemerHash
- dataHash :: ToData a => a -> BuiltinByteString
- type PValidator = PData :--> (PData :--> (PScriptContext :--> POpaque))
- type PStakeValidator = PData :--> (PScriptContext :--> POpaque)
- type PMintingPolicy = PData :--> (PScriptContext :--> POpaque)
- newtype PValue (keys :: KeyGuarantees) (amounts :: AmountGuarantees) (s :: S) = PValue (Term s (PMap keys PCurrencySymbol (PMap keys PTokenName PInteger)))
- newtype PCurrencySymbol (s :: S) = PCurrencySymbol (Term s PByteString)
- newtype PTokenName (s :: S) = PTokenName (Term s PByteString)
- data KeyGuarantees
- data AmountGuarantees
- newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString)
- pubKeyHash :: PubKey -> PubKeyHash
- data PDCert (s :: S)
- = PDCertDelegRegKey (Term s (PDataRecord '["_0" := PStakingCredential]))
- | PDCertDelegDeRegKey (Term s (PDataRecord '["_0" := PStakingCredential]))
- | PDCertDelegDelegate (Term s (PDataRecord '["_0" := PStakingCredential, "_1" := PPubKeyHash]))
- | PDCertPoolRegister (Term s (PDataRecord '["_0" := PPubKeyHash, "_1" := PPubKeyHash]))
- | PDCertPoolRetire (Term s (PDataRecord '["_0" := PPubKeyHash, "_1" := PInteger]))
- | PDCertGenesis (Term s (PDataRecord '[]))
- | PDCertMir (Term s (PDataRecord '[]))
- data PPOSIXTime (s :: S)
- type PPOSIXTimeRange = PInterval PPOSIXTime
- newtype PInterval a (s :: S) = PInterval (Term s (PDataRecord '["from" := PLowerBound a, "to" := PUpperBound a]))
- newtype PLowerBound a (s :: S) = PLowerBound (Term s (PDataRecord '["_0" := PExtended a, "_1" := PClosure]))
- newtype PUpperBound a (s :: S) = PUpperBound (Term s (PDataRecord '["_0" := PExtended a, "_1" := PClosure]))
- data PExtended a (s :: S)
- = PNegInf (Term s (PDataRecord '[]))
- | PFinite (Term s (PDataRecord '["_0" := a]))
- | PPosInf (Term s (PDataRecord '[]))
- type PClosure = PBool
- data PCredential (s :: S)
- = PPubKeyCredential (Term s (PDataRecord '["_0" := PPubKeyHash]))
- | PScriptCredential (Term s (PDataRecord '["_0" := PScriptHash]))
- data PStakingCredential (s :: S)
- = PStakingHash (Term s (PDataRecord '["_0" := PCredential]))
- | PStakingPtr (Term s (PDataRecord '["_0" := PInteger, "_1" := PInteger, "_2" := PInteger]))
- newtype PAddress (s :: S) = PAddress (Term s (PDataRecord '["credential" := PCredential, "stakingCredential" := PMaybeData PStakingCredential]))
- newtype PTxOutRef (s :: S) = PTxOutRef (Term s (PDataRecord '["id" := PTxId, "idx" := PInteger]))
- newtype PTxOut (s :: S) = PTxOut (Term s (PDataRecord '["address" := PAddress, "value" := PValue 'Sorted 'Positive, "datumHash" := PMaybeData PDatumHash]))
- newtype PTxId (s :: S) = PTxId (Term s (PDataRecord '["_0" := PByteString]))
- newtype PTxInInfo (s :: S) = PTxInInfo (Term s (PDataRecord '["outRef" := PTxOutRef, "resolved" := PTxOut]))
- newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinList (PBuiltinPair (PAsData k) (PAsData v))))
- data PMaybeData a (s :: S)
- = PDJust (Term s (PDataRecord '["_0" := a]))
- | PDNothing (Term s (PDataRecord '[]))
- type PTuple a b = PDataSum '['["_0" := a, "_1" := b]]
- ptuple :: Term s (PAsData a :--> (PAsData b :--> PTuple a b))
Contexts
newtype PScriptContext (s :: S) Source #
Script context consists of the script purpose and the pending transaction info.
PScriptContext (Term s (PDataRecord '["txInfo" := PTxInfo, "purpose" := PScriptPurpose])) |
Instances
newtype PTxInfo (s :: S) Source #
A pending transaction. This is the view as seen by the validator script.
PTxInfo (Term s (PDataRecord '["inputs" := PBuiltinList PTxInInfo, "outputs" := PBuiltinList PTxOut, "fee" := PValue 'Sorted 'Positive, "mint" := PValue 'Sorted 'NoGuarantees, "dcert" := PBuiltinList PDCert, "wdrl" := PBuiltinList (PAsData (PTuple PStakingCredential PInteger)), "validRange" := PPOSIXTimeRange, "signatories" := PBuiltinList (PAsData PPubKeyHash), "datums" := PBuiltinList (PAsData (PTuple PDatumHash PDatum)), "id" := PTxId])) |
Instances
data PScriptPurpose (s :: S) Source #
The purpose of the script that is currently running
PMinting (Term s (PDataRecord '["_0" := PCurrencySymbol])) | |
PSpending (Term s (PDataRecord '["_0" := PTxOutRef])) | |
PRewarding (Term s (PDataRecord '["_0" := PStakingCredential])) | |
PCertifying (Term s (PDataRecord '["_0" := PDCert])) |
Instances
Script
newtype PDatum (s :: S) Source #
Instances
PEq PDatum Source # | |
PIsData PDatum Source # | |
DerivePlutusType PDatum Source # | |
Defined in Plutarch.Api.V1.Scripts | |
PlutusType PDatum Source # | |
Defined in Plutarch.Api.V1.Scripts | |
PUnsafeLiftDecl PDatum Source # | |
PShow PDatum Source # | |
Generic (PDatum s) Source # | |
type DPTStrat PDatum Source # | |
Defined in Plutarch.Api.V1.Scripts | |
type PContravariant' PDatum Source # | |
Defined in Plutarch.Api.V1.Scripts | |
type PCovariant' PDatum Source # | |
Defined in Plutarch.Api.V1.Scripts | |
type PInner PDatum Source # | |
Defined in Plutarch.Api.V1.Scripts | |
type PVariant' PDatum Source # | |
Defined in Plutarch.Api.V1.Scripts | |
type PLifted PDatum Source # | |
Defined in Plutarch.Api.V1.Scripts | |
type Rep (PDatum s) Source # | |
Defined in Plutarch.Api.V1.Scripts |
newtype PDatumHash (s :: S) Source #
Instances
newtype PRedeemer (s :: S) Source #
Instances
PEq PRedeemer Source # | |
PIsData PRedeemer Source # | |
DerivePlutusType PRedeemer Source # | |
Defined in Plutarch.Api.V1.Scripts | |
PlutusType PRedeemer Source # | |
Defined in Plutarch.Api.V1.Scripts | |
PUnsafeLiftDecl PRedeemer Source # | |
PShow PRedeemer Source # | |
Generic (PRedeemer s) Source # | |
type DPTStrat PRedeemer Source # | |
Defined in Plutarch.Api.V1.Scripts | |
type PContravariant' PRedeemer Source # | |
Defined in Plutarch.Api.V1.Scripts | |
type PCovariant' PRedeemer Source # | |
Defined in Plutarch.Api.V1.Scripts | |
type PInner PRedeemer Source # | |
Defined in Plutarch.Api.V1.Scripts | |
type PVariant' PRedeemer Source # | |
Defined in Plutarch.Api.V1.Scripts | |
type PLifted PRedeemer Source # | |
Defined in Plutarch.Api.V1.Scripts | |
type Rep (PRedeemer s) Source # | |
Defined in Plutarch.Api.V1.Scripts |
newtype PRedeemerHash (s :: S) Source #
Instances
Script Utils
scriptHash :: Script -> ScriptHash Source #
Hash a Script, with the correct prefix for Plutus V1
redeemerHash :: Redeemer -> RedeemerHash Source #
Hash a Redeemer.
dataHash :: ToData a => a -> BuiltinByteString Source #
Hash the data encoded representation of given argument.
type PValidator = PData :--> (PData :--> (PScriptContext :--> POpaque)) Source #
a Validator Term
type PStakeValidator = PData :--> (PScriptContext :--> POpaque) Source #
a StakeValidator Term
type PMintingPolicy = PData :--> (PScriptContext :--> POpaque) Source #
a MintingPolicy Term
Value
newtype PValue (keys :: KeyGuarantees) (amounts :: AmountGuarantees) (s :: S) Source #
PValue (Term s (PMap keys PCurrencySymbol (PMap keys PTokenName PInteger))) |
Instances
newtype PCurrencySymbol (s :: S) Source #
Instances
newtype PTokenName (s :: S) Source #
Instances
Crypto
newtype PPubKeyHash (s :: S) Source #
Instances
pubKeyHash :: PubKey -> PubKeyHash Source #
DCert
PDCertDelegRegKey (Term s (PDataRecord '["_0" := PStakingCredential])) | |
PDCertDelegDeRegKey (Term s (PDataRecord '["_0" := PStakingCredential])) | |
PDCertDelegDelegate (Term s (PDataRecord '["_0" := PStakingCredential, "_1" := PPubKeyHash])) | |
PDCertPoolRegister (Term s (PDataRecord '["_0" := PPubKeyHash, "_1" := PPubKeyHash])) | |
PDCertPoolRetire (Term s (PDataRecord '["_0" := PPubKeyHash, "_1" := PInteger])) | |
PDCertGenesis (Term s (PDataRecord '[])) | |
PDCertMir (Term s (PDataRecord '[])) |
Instances
Time
data PPOSIXTime (s :: S) Source #
Instances
type PPOSIXTimeRange = PInterval PPOSIXTime Source #
Interval
newtype PInterval a (s :: S) Source #
PInterval (Term s (PDataRecord '["from" := PLowerBound a, "to" := PUpperBound a])) |
Instances
newtype PLowerBound a (s :: S) Source #
PLowerBound (Term s (PDataRecord '["_0" := PExtended a, "_1" := PClosure])) |
Instances
newtype PUpperBound a (s :: S) Source #
PUpperBound (Term s (PDataRecord '["_0" := PExtended a, "_1" := PClosure])) |
Instances
data PExtended a (s :: S) Source #
PNegInf (Term s (PDataRecord '[])) | |
PFinite (Term s (PDataRecord '["_0" := a])) | |
PPosInf (Term s (PDataRecord '[])) |
Instances
Address
data PCredential (s :: S) Source #
PPubKeyCredential (Term s (PDataRecord '["_0" := PPubKeyHash])) | |
PScriptCredential (Term s (PDataRecord '["_0" := PScriptHash])) |
Instances
data PStakingCredential (s :: S) Source #
PStakingHash (Term s (PDataRecord '["_0" := PCredential])) | |
PStakingPtr (Term s (PDataRecord '["_0" := PInteger, "_1" := PInteger, "_2" := PInteger])) |
Instances
newtype PAddress (s :: S) Source #
PAddress (Term s (PDataRecord '["credential" := PCredential, "stakingCredential" := PMaybeData PStakingCredential])) |
Instances
Tx
newtype PTxOutRef (s :: S) Source #
Reference to a transaction output with a index referencing which of the outputs is being referred to.
Instances
newtype PTxOut (s :: S) Source #
A transaction output. This consists of a target address, value and maybe a datum hash
PTxOut (Term s (PDataRecord '["address" := PAddress, "value" := PValue 'Sorted 'Positive, "datumHash" := PMaybeData PDatumHash])) |
Instances
newtype PTxId (s :: S) Source #
PTxId (Term s (PDataRecord '["_0" := PByteString])) |
Instances
newtype PTxInInfo (s :: S) Source #
A input of the pending transaction.
Instances
AssocMap
newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) Source #
PMap (Term s (PBuiltinList (PBuiltinPair (PAsData k) (PAsData v)))) |
Instances
Others
data PMaybeData a (s :: S) Source #
Data encoded Maybe type. Used in various ledger api types.
PDJust (Term s (PDataRecord '["_0" := a])) | |
PDNothing (Term s (PDataRecord '[])) |