plutus-ledger-api-1.0.0.1: Interface to the Plutus ledger for the Cardano ledger.
Safe Haskell None
Language Haskell2010

Plutus.V1.Ledger.Api

Description

The interface to Plutus V1 for the ledger.

Synopsis

Scripts

type SerializedScript = ShortByteString Source #

Scripts to the ledger are serialised bytestrings.

data Script Source #

A script on the chain. This is an opaque type as far as the chain is concerned.

Instances

Instances details
Eq Script Source #

Note [Using Flat inside CBOR instance of Script] `plutus-ledger` uses CBOR for data serialisation and `plutus-core` uses Flat. The choice to use Flat was made to have a more efficient (most wins are in uncompressed size) data serialisation format and use less space on-chain.

To make `plutus-ledger` work with scripts serialised with Flat, and keep the CBOR format otherwise we have defined a Serialise instance for Script, which is a wrapper over Programs serialised with Flat. The instance will see programs as an opaque ByteString, which is the result of encoding programs using Flat.

Because Flat is not self-describing and it gets used in the encoding of Programs, data structures that include scripts (for example, transactions) no-longer benefit for CBOR's ability to self-describe it's format.

Instance details

Defined in Plutus.V1.Ledger.Scripts

Ord Script Source #
Instance details

Defined in Plutus.V1.Ledger.Scripts

Show Script Source #
Instance details

Defined in Plutus.V1.Ledger.Scripts

Generic Script Source #
Instance details

Defined in Plutus.V1.Ledger.Scripts

NFData Script Source #
Instance details

Defined in Plutus.V1.Ledger.Scripts

Serialise Script Source #
Instance details

Defined in Plutus.V1.Ledger.Scripts

type Rep Script Source #
Instance details

Defined in Plutus.V1.Ledger.Scripts

type Rep Script = D1 (' MetaData "Script" "Plutus.V1.Ledger.Scripts" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" ' True ) ( C1 (' MetaCons "Script" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unScript") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Program DeBruijn DefaultUni DefaultFun ()))))

fromCompiledCode :: CompiledCode a -> Script Source #

Turn a CompiledCode (usually produced by compile ) into a Script for use with this package.

Validating scripts

isScriptWellFormed :: ProtocolVersion -> SerializedScript -> Bool Source #

Check if a Script is "valid" according to a protocol version. At the moment this means "deserialises correctly", which in particular implies that it is (almost certainly) an encoded script and the script does not mention any builtins unavailable in the given protocol version.

Running scripts

evaluateScriptRestricting Source #

Arguments

:: ProtocolVersion
-> VerboseMode

Whether to produce log output

-> EvaluationContext

The cost model that should already be synced to the most recent cost-model-params coming from the current protocol

-> ExBudget

The resource budget which must not be exceeded during evaluation

-> SerializedScript

The script to evaluate

-> [ Data ]

The arguments to the script

-> ( LogOutput , Either EvaluationError ExBudget )

Evaluates a script, with a cost model and a budget that restricts how many resources it can use according to the cost model. Also returns the budget that was actually used.

Can be used to calculate budgets for scripts, but even in this case you must give a limit to guard against scripts that run for a long time or loop.

evaluateScriptCounting Source #

Arguments

:: ProtocolVersion
-> VerboseMode

Whether to produce log output

-> EvaluationContext

The cost model that should already be synced to the most recent cost-model-params coming from the current protocol

-> SerializedScript

The script to evaluate

-> [ Data ]

The arguments to the script

-> ( LogOutput , Either EvaluationError ExBudget )

Evaluates a script, returning the minimum budget that the script would need to evaluate successfully. This will take as long as the script takes, if you need to limit the execution time of the script also, you can use evaluateScriptRestricting , which also returns the used budget.

Protocol version

Verbose mode and log output

data VerboseMode Source #

A simple toggle indicating whether or not we should produce logs.

Constructors

Verbose
Quiet

type LogOutput = [ Text ] Source #

The type of log output: just a list of Text .

Costing-related types

data ExBudget Source #

Instances

Instances details
Eq ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Show ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Generic ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Semigroup ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Monoid ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

ToJSON ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

FromJSON ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

NFData ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

NoThunks ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Pretty ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Lift ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

PrettyBy config ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

type Rep ExBudget
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

type Rep ExBudget = D1 (' MetaData "ExBudget" "PlutusCore.Evaluation.Machine.ExBudget" "plutus-core-1.0.0.1-76bWF9ZEWyb4eDyjHx0kCS" ' False ) ( C1 (' MetaCons "ExBudget" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "exBudgetCPU") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedUnpack ) ( Rec0 ExCPU ) :*: S1 (' MetaSel (' Just "exBudgetMemory") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedUnpack ) ( Rec0 ExMemory )))

newtype ExCPU Source #

Counts CPU units in picoseconds: maximum value for SatInt is 2^63 ps, or appproximately 106 days.

Instances

Instances details
Eq ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Num ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Ord ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Show ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Generic ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Semigroup ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Monoid ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

ToJSON ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

FromJSON ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

NFData ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

NoThunks ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Pretty ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Lift ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

PrettyBy config ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

type Rep ExCPU
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

type Rep ExCPU = D1 (' MetaData "ExCPU" "PlutusCore.Evaluation.Machine.ExMemory" "plutus-core-1.0.0.1-76bWF9ZEWyb4eDyjHx0kCS" ' True ) ( C1 (' MetaCons "ExCPU" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 CostingInteger )))

newtype ExMemory Source #

Counts size in machine words.

Instances

Instances details
Eq ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Num ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Ord ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Show ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Generic ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Semigroup ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Monoid ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

ToJSON ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

FromJSON ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

NFData ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

NoThunks ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

ExMemoryUsage ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Pretty ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Lift ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

PrettyBy config ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

type Rep ExMemory
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

type Rep ExMemory = D1 (' MetaData "ExMemory" "PlutusCore.Evaluation.Machine.ExMemory" "plutus-core-1.0.0.1-76bWF9ZEWyb4eDyjHx0kCS" ' True ) ( C1 (' MetaCons "ExMemory" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 CostingInteger )))

data SatInt Source #

Instances

Instances details
Bounded SatInt
Instance details

Defined in Data.SatInt

Enum SatInt
Instance details

Defined in Data.SatInt

Eq SatInt
Instance details

Defined in Data.SatInt

Integral SatInt
Instance details

Defined in Data.SatInt

Num SatInt

In the Num instance, we plug in our own addition, multiplication and subtraction function that perform overflow-checking.

Instance details

Defined in Data.SatInt

Ord SatInt
Instance details

Defined in Data.SatInt

Read SatInt
Instance details

Defined in Data.SatInt

Real SatInt
Instance details

Defined in Data.SatInt

Show SatInt
Instance details

Defined in Data.SatInt

Generic SatInt
Instance details

Defined in Data.SatInt

ToJSON SatInt
Instance details

Defined in Data.SatInt

FromJSON SatInt
Instance details

Defined in Data.SatInt

Bits SatInt
Instance details

Defined in Data.SatInt

FiniteBits SatInt
Instance details

Defined in Data.SatInt

NFData SatInt
Instance details

Defined in Data.SatInt

FromField SatInt
Instance details

Defined in Data.SatInt

Prim SatInt
Instance details

Defined in Data.SatInt

NoThunks SatInt
Instance details

Defined in Data.SatInt

ExMemoryUsage SatInt
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Lift SatInt
Instance details

Defined in Data.SatInt

type Rep SatInt
Instance details

Defined in Data.SatInt

type Rep SatInt = D1 (' MetaData "SatInt" "Data.SatInt" "plutus-core-1.0.0.1-76bWF9ZEWyb4eDyjHx0kCS" ' True ) ( C1 (' MetaCons "SI" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unSatInt") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Int )))

Cost model

data EvaluationContext Source #

An opaque type that contains all the static parameters that the evaluator needs to evaluate a script. This is so that they can be computed once and cached, rather than recomputed on every evaluation.

There are two sets of parameters: one is with immediate unlifting and the other one is with deferred unlifting. We have to keep both of them, because depending on the language version either one has to be used or the other. We also compile them separately due to all the inlining and optimization that need to happen for things to be efficient.

mkEvaluationContext :: MonadError CostModelApplyError m => CostModelParams -> m EvaluationContext Source #

Build the EvaluationContext .

The input is a Map of strings to cost integer values (aka CostModelParams , CostModel ) See Note [Inlining meanings of builtins].

costModelParamNames :: Set Text Source #

The set of valid names that a cost model parameter can take for this language version. It is used for the deserialization of CostModelParams .

Context types

data ScriptContext Source #

Instances

Instances details
Eq ScriptContext Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Show ScriptContext Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Generic ScriptContext Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Pretty ScriptContext Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

ToData ScriptContext Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

FromData ScriptContext Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

UnsafeFromData ScriptContext Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Eq ScriptContext Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Lift DefaultUni ScriptContext Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Typeable DefaultUni ScriptContext Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

type Rep ScriptContext Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

type Rep ScriptContext = D1 (' MetaData "ScriptContext" "Plutus.V1.Ledger.Contexts" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" ' False ) ( C1 (' MetaCons "ScriptContext" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "scriptContextTxInfo") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 TxInfo ) :*: S1 (' MetaSel (' Just "scriptContextPurpose") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ScriptPurpose )))

data ScriptPurpose Source #

Purpose of the script that is currently running

Instances

Instances details
Eq ScriptPurpose Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Show ScriptPurpose Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Generic ScriptPurpose Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Pretty ScriptPurpose Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

ToData ScriptPurpose Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

FromData ScriptPurpose Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

UnsafeFromData ScriptPurpose Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Eq ScriptPurpose Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Lift DefaultUni ScriptPurpose Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Typeable DefaultUni ScriptPurpose Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

type Rep ScriptPurpose Source #
Instance details

Defined in Plutus.V1.Ledger.Contexts

Supporting types used in the context types

ByteStrings

data BuiltinByteString Source #

An opaque type representing Plutus Core ByteStrings.

Instances

Instances details
Eq BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Internal

Data BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> BuiltinByteString -> c BuiltinByteString Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c BuiltinByteString Source #

toConstr :: BuiltinByteString -> Constr Source #

dataTypeOf :: BuiltinByteString -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c BuiltinByteString ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c BuiltinByteString ) Source #

gmapT :: ( forall b. Data b => b -> b) -> BuiltinByteString -> BuiltinByteString Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> BuiltinByteString -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> BuiltinByteString -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> BuiltinByteString -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> BuiltinByteString -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> BuiltinByteString -> m BuiltinByteString Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> BuiltinByteString -> m BuiltinByteString Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> BuiltinByteString -> m BuiltinByteString Source #

Ord BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Internal

Show BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Internal

Semigroup BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Internal

Monoid BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Internal

Hashable BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Internal

ByteArray BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Internal

ByteArrayAccess BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Internal

Pretty BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Internal

ToData BuiltinByteString
Instance details

Defined in PlutusTx.IsData.Class

FromData BuiltinByteString
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinByteString
Instance details

Defined in PlutusTx.IsData.Class

Monoid BuiltinByteString
Instance details

Defined in PlutusTx.Monoid

Semigroup BuiltinByteString
Instance details

Defined in PlutusTx.Semigroup

Ord BuiltinByteString
Instance details

Defined in PlutusTx.Ord

Eq BuiltinByteString
Instance details

Defined in PlutusTx.Eq

Serialise BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Internal

FromBuiltin BuiltinByteString ByteString
Instance details

Defined in PlutusTx.Builtins.Class

ToBuiltin ByteString BuiltinByteString
Instance details

Defined in PlutusTx.Builtins.Class

Bytes

newtype LedgerBytes Source #

Instances

Instances details
Eq LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

Ord LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

Show LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

IsString LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

Generic LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

NFData LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

Pretty LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

ToData LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

FromData LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

UnsafeFromData LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

Ord LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

Eq LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

Lift DefaultUni LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

Typeable DefaultUni LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

type Rep LedgerBytes Source #
Instance details

Defined in Plutus.V1.Ledger.Bytes

type Rep LedgerBytes = D1 (' MetaData "LedgerBytes" "Plutus.V1.Ledger.Bytes" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" ' True ) ( C1 (' MetaCons "LedgerBytes" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getLedgerBytes") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 BuiltinByteString )))

Certificates

data DCert Source #

A representation of the ledger DCert. Some information is digested, and not included

Constructors

DCertDelegRegKey StakingCredential
DCertDelegDeRegKey StakingCredential
DCertDelegDelegate

Fields

DCertPoolRegister

A digest of the PoolParams

Fields

DCertPoolRetire PubKeyHash Integer

The retiremant certificate and the Epoch N

DCertGenesis

A really terse Digest

DCertMir

Another really terse Digest

Instances

Instances details
Eq DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

Ord DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

Show DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

Generic DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

NFData DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

Pretty DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

ToData DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

FromData DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

UnsafeFromData DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

Eq DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

Lift DefaultUni DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

Typeable DefaultUni DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

type Rep DCert Source #
Instance details

Defined in Plutus.V1.Ledger.DCert

type Rep DCert = D1 (' MetaData "DCert" "Plutus.V1.Ledger.DCert" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" ' False ) (( C1 (' MetaCons "DCertDelegRegKey" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 StakingCredential )) :+: ( C1 (' MetaCons "DCertDelegDeRegKey" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 StakingCredential )) :+: C1 (' MetaCons "DCertDelegDelegate" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 StakingCredential ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 PubKeyHash )))) :+: (( C1 (' MetaCons "DCertPoolRegister" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 PubKeyHash ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 PubKeyHash )) :+: C1 (' MetaCons "DCertPoolRetire" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 PubKeyHash ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Integer ))) :+: ( C1 (' MetaCons "DCertGenesis" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "DCertMir" ' PrefixI ' False ) ( U1 :: Type -> Type ))))

Credentials

data StakingCredential Source #

Staking credential used to assign rewards

Instances

Instances details
Eq StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Ord StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Show StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Generic StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

NFData StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Pretty StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

ToData StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

FromData StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

UnsafeFromData StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Eq StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Lift DefaultUni StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Typeable DefaultUni StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

type Rep StakingCredential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

data Credential Source #

Credential required to unlock a transaction output

Constructors

PubKeyCredential PubKeyHash

The transaction that spends this output must be signed by the private key

ScriptCredential ValidatorHash

The transaction that spends this output must include the validator script and be accepted by the validator.

Instances

Instances details
Eq Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Ord Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Show Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Generic Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

NFData Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Pretty Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

ToData Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

FromData Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

UnsafeFromData Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Eq Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Lift DefaultUni Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Typeable DefaultUni Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

type Rep Credential Source #
Instance details

Defined in Plutus.V1.Ledger.Credential

Value

newtype Value Source #

A cryptocurrency value. This is a map from CurrencySymbol s to a quantity of that currency.

Operations on currencies are usually implemented pointwise . That is, we apply the operation to the quantities for each currency in turn. So when we add two Value s the resulting Value has, for each currency, the sum of the quantities of that particular currency in the argument Value . The effect of this is that the currencies in the Value are "independent", and are operated on separately.

Whenever we need to get the quantity of a currency in a Value where there is no explicit quantity of that currency in the Value , then the quantity is taken to be zero.

See note [Currencies] for more details.

Instances

Instances details
Eq Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Data Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> Value -> c Value Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c Value Source #

toConstr :: Value -> Constr Source #

dataTypeOf :: Value -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c Value ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c Value ) Source #

gmapT :: ( forall b. Data b => b -> b) -> Value -> Value Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> Value -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> Value -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> Value -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> Value -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> Value -> m Value Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> Value -> m Value Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> Value -> m Value Source #

Show Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Generic Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Semigroup Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Monoid Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

NFData Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Pretty Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

ToData Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

FromData Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

UnsafeFromData Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

JoinSemiLattice Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

MeetSemiLattice Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

AdditiveSemigroup Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

AdditiveMonoid Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

AdditiveGroup Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Monoid Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Group Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Semigroup Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Eq Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Module Integer Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Lift DefaultUni Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Typeable DefaultUni Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

type Rep Value Source #
Instance details

Defined in Plutus.V1.Ledger.Value

type Rep Value = D1 (' MetaData "Value" "Plutus.V1.Ledger.Value" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" ' True ) ( C1 (' MetaCons "Value" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getValue") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Map CurrencySymbol ( Map TokenName Integer )))))

newtype CurrencySymbol Source #

Instances

Instances details
Eq CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Data CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> CurrencySymbol -> c CurrencySymbol Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c CurrencySymbol Source #

toConstr :: CurrencySymbol -> Constr Source #

dataTypeOf :: CurrencySymbol -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c CurrencySymbol ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c CurrencySymbol ) Source #

gmapT :: ( forall b. Data b => b -> b) -> CurrencySymbol -> CurrencySymbol Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> CurrencySymbol -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> CurrencySymbol -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> CurrencySymbol -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> CurrencySymbol -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> CurrencySymbol -> m CurrencySymbol Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> CurrencySymbol -> m CurrencySymbol Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> CurrencySymbol -> m CurrencySymbol Source #

Ord CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Show CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

IsString CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Generic CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

NFData CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Pretty CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

ToData CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

FromData CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

UnsafeFromData CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Ord CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Eq CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Lift DefaultUni CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Typeable DefaultUni CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

type Rep CurrencySymbol Source #
Instance details

Defined in Plutus.V1.Ledger.Value

type Rep CurrencySymbol = D1 (' MetaData "CurrencySymbol" "Plutus.V1.Ledger.Value" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" ' True ) ( C1 (' MetaCons "CurrencySymbol" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unCurrencySymbol") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 BuiltinByteString )))

newtype TokenName Source #

ByteString of a name of a token, shown as UTF-8 string when possible

Instances

Instances details
Eq TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Data TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> TokenName -> c TokenName Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c TokenName Source #

toConstr :: TokenName -> Constr Source #

dataTypeOf :: TokenName -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c TokenName ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c TokenName ) Source #

gmapT :: ( forall b. Data b => b -> b) -> TokenName -> TokenName Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> TokenName -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> TokenName -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> TokenName -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> TokenName -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> TokenName -> m TokenName Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> TokenName -> m TokenName Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> TokenName -> m TokenName Source #

Ord TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Show TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

IsString TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Generic TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

NFData TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Pretty TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

ToData TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

FromData TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

UnsafeFromData TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Ord TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Eq TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Lift DefaultUni TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

Typeable DefaultUni TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

type Rep TokenName Source #
Instance details

Defined in Plutus.V1.Ledger.Value

type Rep TokenName = D1 (' MetaData "TokenName" "Plutus.V1.Ledger.Value" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" ' True ) ( C1 (' MetaCons "TokenName" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unTokenName") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 BuiltinByteString )))

singleton :: CurrencySymbol -> TokenName -> Integer -> Value Source #

Make a Value containing only the given quantity of the given currency.

Time

newtype POSIXTime Source #

POSIX time is measured as the number of milliseconds since 1970-01-01T00:00:00Z

Instances

Instances details
Enum POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Eq POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Integral POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Num POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Ord POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Real POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Show POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Generic POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

NFData POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Pretty POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Enum POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

ToData POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

FromData POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

UnsafeFromData POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

AdditiveSemigroup POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

AdditiveMonoid POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

AdditiveGroup POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Ord POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Eq POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Lift DefaultUni POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

Typeable DefaultUni POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

type Rep POSIXTime Source #
Instance details

Defined in Plutus.V1.Ledger.Time

type Rep POSIXTime = D1 (' MetaData "POSIXTime" "Plutus.V1.Ledger.Time" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" ' True ) ( C1 (' MetaCons "POSIXTime" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getPOSIXTime") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Integer )))

Types for representing transactions