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, "referenceInputs" := PBuiltinList PTxInInfo, "outputs" := PBuiltinList PTxOut, "fee" := PValue 'Sorted 'Positive, "mint" := PValue 'Sorted 'NoGuarantees, "dcert" := PBuiltinList PDCert, "wdrl" := PMap 'Unsorted PStakingCredential PInteger, "validRange" := PPOSIXTimeRange, "signatories" := PBuiltinList (PAsData PPubKeyHash), "redeemers" := PMap 'Unsorted PScriptPurpose PRedeemer, "datums" := PMap 'Unsorted 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 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, "datum" := POutputDatum, "referenceScript" := PMaybeData PScriptHash]))
- newtype PTxId (s :: S) = PTxId (Term s (PDataRecord '["_0" := PByteString]))
- newtype PTxInInfo (s :: S) = PTxInInfo (Term s (PDataRecord '["outRef" := PTxOutRef, "resolved" := PTxOut]))
- data POutputDatum (s :: S)
- = PNoOutputDatum (Term s (PDataRecord '[]))
- | POutputDatumHash (Term s (PDataRecord '["datumHash" := PDatumHash]))
- | POutputDatum (Term s (PDataRecord '["outputDatum" := PDatum]))
- data PMaybeData a (s :: S)
- = PDJust (Term s (PDataRecord '["_0" := a]))
- | PDNothing (Term s (PDataRecord '[]))
- type PTuple a b = PDataSum '['["_0" := a, "_1" := b]]
- newtype PDatum (s :: S) = PDatum (Term s PData)
- newtype PDatumHash (s :: S) = PDatumHash (Term s PByteString)
- newtype PAddress (s :: S) = PAddress (Term s (PDataRecord '["credential" := PCredential, "stakingCredential" := PMaybeData PStakingCredential]))
- data KeyGuarantees
- data AmountGuarantees
- newtype PScriptHash (s :: S) = PScriptHash (Term s PByteString)
- newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString)
- data PStakingCredential (s :: S)
- = PStakingHash (Term s (PDataRecord '["_0" := PCredential]))
- | PStakingPtr (Term s (PDataRecord '["_0" := PInteger, "_1" := PInteger, "_2" := PInteger]))
- 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)
- newtype PInterval a (s :: S) = PInterval (Term s (PDataRecord '["from" := PLowerBound a, "to" := PUpperBound a]))
- data PExtended a (s :: S)
- = PNegInf (Term s (PDataRecord '[]))
- | PFinite (Term s (PDataRecord '["_0" := a]))
- | PPosInf (Term s (PDataRecord '[]))
- type PClosure = PBool
- 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]))
- newtype PPOSIXTime (s :: S) = PPOSIXTime (Term s PInteger)
- type PPOSIXTimeRange = PInterval PPOSIXTime
- newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinList (PBuiltinPair (PAsData k) (PAsData v))))
- 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)
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, "referenceInputs" := PBuiltinList PTxInInfo, "outputs" := PBuiltinList PTxOut, "fee" := PValue 'Sorted 'Positive, "mint" := PValue 'Sorted 'NoGuarantees, "dcert" := PBuiltinList PDCert, "wdrl" := PMap 'Unsorted PStakingCredential PInteger, "validRange" := PPOSIXTimeRange, "signatories" := PBuiltinList (PAsData PPubKeyHash), "redeemers" := PMap 'Unsorted PScriptPurpose PRedeemer, "datums" := PMap 'Unsorted 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
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, "datum" := POutputDatum, "referenceScript" := PMaybeData PScriptHash])) |
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
data POutputDatum (s :: S) Source #
The datum attached to an output: either nothing, a datum hash or an inline datum (CIP 32)
PNoOutputDatum (Term s (PDataRecord '[])) | |
POutputDatumHash (Term s (PDataRecord '["datumHash" := PDatumHash])) | |
POutputDatum (Term s (PDataRecord '["outputDatum" := PDatum])) |
Instances
reexports for unchanged V1 ledger types
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 '[])) |
Instances
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 PAddress (s :: S) Source #
PAddress (Term s (PDataRecord '["credential" := PCredential, "stakingCredential" := PMaybeData PStakingCredential])) |
Instances
newtype PScriptHash (s :: S) Source #
Instances
newtype PPubKeyHash (s :: S) Source #
Instances
data PStakingCredential (s :: S) Source #
PStakingHash (Term s (PDataRecord '["_0" := PCredential])) | |
PStakingPtr (Term s (PDataRecord '["_0" := PInteger, "_1" := PInteger, "_2" := PInteger])) |
Instances
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
newtype PInterval a (s :: S) Source #
PInterval (Term s (PDataRecord '["from" := PLowerBound a, "to" := PUpperBound a])) |
Instances
data PExtended a (s :: S) Source #
PNegInf (Term s (PDataRecord '[])) | |
PFinite (Term s (PDataRecord '["_0" := a])) | |
PPosInf (Term s (PDataRecord '[])) |
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
newtype PPOSIXTime (s :: S) Source #
PPOSIXTime (Term s PInteger) |
Instances
type PPOSIXTimeRange = PInterval PPOSIXTime Source #
newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) Source #
PMap (Term s (PBuiltinList (PBuiltinPair (PAsData k) (PAsData v)))) |
Instances
Script Utils
scriptHash :: Script -> ScriptHash Source #
Hash a Script, with the correct prefix for Plutus V2
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