plutus-ledger-api-1.30.0.0: Interface to the Plutus ledger for the Cardano ledger.
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusLedgerApi.Common

Description

The types and functions that are common among all ledger Plutus versions.

Synopsis

Script (de)serialization

type SerialisedScript = ShortByteString Source #

Scripts to the ledger are serialised bytestrings.

data ScriptForEvaluation Source #

A Plutus script ready to be evaluated on-chain, via evaluateScriptRestricting.

Instances

Instances details
Generic ScriptForEvaluation Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Associated Types

type Rep ScriptForEvaluationTypeType Source #

Show ScriptForEvaluation Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

NFData ScriptForEvaluation Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Methods

rnfScriptForEvaluation → () Source #

Eq ScriptForEvaluation Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

NoThunks ScriptForEvaluation Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Methods

noThunks ∷ Context → ScriptForEvaluationIO (Maybe ThunkInfo)

wNoThunks ∷ Context → ScriptForEvaluationIO (Maybe ThunkInfo)

showTypeOfProxy ScriptForEvaluationString

type Rep ScriptForEvaluation Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

type Rep ScriptForEvaluation = D1 ('MetaData "ScriptForEvaluation" "PlutusLedgerApi.Common.SerialisedScript" "plutus-ledger-api-1.30.0.0-inplace" 'False) (C1 ('MetaCons "UnsafeScriptForEvaluation" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SerialisedScript) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ScriptNamedDeBruijn)))

serialiseCompiledCode ∷ ∀ a. CompiledCode a → SerialisedScript Source #

Turns a program which was compiled using the 'PlutusTx' toolchain into a binary format that is understood by the network and can be stored on-chain.

serialiseUPLCProgram DeBruijn DefaultUni DefaultFun () → SerialisedScript Source #

Turns a program's AST (most likely manually constructed) into a binary format that is understood by the network and can be stored on-chain.

deserialiseScript Source #

Arguments

∷ ∀ m. MonadError ScriptDecodeError m 
PlutusLedgerLanguage

the Plutus ledger language of the script.

MajorProtocolVersion

which major protocol version the script was submitted in.

SerialisedScript

the script to deserialise.

→ m ScriptForEvaluation 

The deserialization from a serialised script into a ScriptForEvaluation, ready to be evaluated on-chain. Called inside phase-1 validation (i.e., deserialisation error is a phase-1 error).

uncheckedDeserialiseUPLCSerialisedScriptProgram DeBruijn DefaultUni DefaultFun () Source #

Deserialises a SerialisedScript back into an AST. Does *not* do ledger-language-version-specific checks like for allowable builtins.

data ScriptDecodeError Source #

An error that occurred during script deserialization.

Constructors

CBORDeserialiseError !DeserialiseFailureInfo

an error from the underlying CBOR/serialise library

RemainderError !ByteString

Script was successfully parsed, but more (runaway) bytes encountered after script's position

LedgerLanguageNotAvailableError

the plutus version of the given script is not enabled yet

Fields

PlutusCoreLanguageNotAvailableError 

Fields

Instances

Instances details
Exception ScriptDecodeError Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Show ScriptDecodeError Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Eq ScriptDecodeError Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

AsScriptDecodeError ScriptDecodeError Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Pretty ScriptDecodeError Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Methods

prettyScriptDecodeErrorDoc ann #

prettyList ∷ [ScriptDecodeError] → Doc ann #

newtype ScriptNamedDeBruijn Source #

A script with named de-bruijn indices.

Script evaluation

evaluateScriptCounting Source #

Arguments

PlutusLedgerLanguage

The Plutus ledger language of the script under execution.

MajorProtocolVersion

Which major protocol version to run the operation in

VerboseMode

Whether to produce log output

EvaluationContext

Includes the cost model to use for tallying up the execution costs

ScriptForEvaluation

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.

Note: Parameterized over the ledger-plutus-version since the builtins allowed (during decoding) differs.

evaluateScriptRestricting Source #

Arguments

PlutusLedgerLanguage

The Plutus ledger language of the script under execution.

MajorProtocolVersion

Which major protocol version to run the operation in

VerboseMode

Whether to produce log output

EvaluationContext

Includes the cost model to use for tallying up the execution costs

ExBudget

The resource budget which must not be exceeded during evaluation

ScriptForEvaluation

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.

Note: Parameterized over the LedgerPlutusVersion since 1. The builtins allowed (during decoding) differ, and 2. The Plutus language versions allowed differ.

evaluateTermExBudgetMode cost DefaultUni DefaultFunMajorProtocolVersionVerboseModeEvaluationContextTerm NamedDeBruijn DefaultUni DefaultFun () → (Either (CekEvaluationException NamedDeBruijn DefaultUni DefaultFun) (Term NamedDeBruijn DefaultUni DefaultFun ()), cost, [Text]) Source #

Evaluate a fully-applied term using the CEK machine. Useful for mimicking the behaviour of the on-chain evaluator.

data VerboseMode Source #

A simple toggle indicating whether or not we should accumulate logs during script execution.

Constructors

Verbose

accumulate all traces

Quiet

don't accumulate anything

Instances

Instances details
Eq VerboseMode Source # 
Instance details

Defined in PlutusLedgerApi.Common.Eval

type LogOutput = [Text] Source #

The type of the executed script's accumulated log output: a list of Text.

It will be an empty list if the VerboseMode is set to Quiet.

data EvaluationError Source #

Errors that can be thrown when evaluating a Plutus script.

Constructors

CekError !(CekEvaluationException NamedDeBruijn DefaultUni DefaultFun)

An error from the evaluator itself

DeBruijnError !FreeVariableError

An error in the pre-evaluation step of converting from de-Bruijn indices

CodecError !ScriptDecodeError

A deserialisation error TODO: make this error more informative when we have more information about what went wrong

CostModelParameterMismatch

An error indicating that the cost model parameters didn't match what we expected

InvalidReturnValue

The script evaluated to a value that is not a valid return value.

Network's versioning

The network's behaviour (and plutus's by extension) can change via hard forks, which directly correspond to major-number protocol version bumps.

newtype MajorProtocolVersion Source #

This represents the major component of the Cardano protocol version. The ledger can only supply the major component of the protocol version, not the minor component, and Plutus should only need to care about the major component anyway. This relies on careful understanding between us and the ledger as to what this means.

Instances

Instances details
Generic MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

Associated Types

type Rep MajorProtocolVersionTypeType Source #

Show MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

Eq MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

Ord MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

Pretty MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

Serialise MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

Methods

encodeMajorProtocolVersion → Encoding

decode ∷ Decoder s MajorProtocolVersion

encodeList ∷ [MajorProtocolVersion] → Encoding

decodeList ∷ Decoder s [MajorProtocolVersion]

type Rep MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

type Rep MajorProtocolVersion = D1 ('MetaData "MajorProtocolVersion" "PlutusLedgerApi.Common.ProtocolVersions" "plutus-ledger-api-1.30.0.0-inplace" 'True) (C1 ('MetaCons "MajorProtocolVersion" 'PrefixI 'True) (S1 ('MetaSel ('Just "getMajorProtocolVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

data PlutusLedgerLanguage Source #

The Plutus ledger language. These are entirely different script languages from the ledger's perspective, which on our side are interpreted in very similar ways.

It is a simple enumerated datatype (there is no major and minor components as in protocol version) and the ordering of constructors is essential for deriving Enum,Ord,Bounded.

IMPORTANT: this is different from the Plutus Core language version, Version

Constructors

PlutusV1

introduced in shelley era

PlutusV2

introduced in vasil era

PlutusV3

not yet enabled

Instances

Instances details
Bounded PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Enum PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Generic PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Associated Types

type Rep PlutusLedgerLanguageTypeType Source #

Show PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

NFData PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Methods

rnfPlutusLedgerLanguage → () Source #

Eq PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Ord PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

NoThunks PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Methods

noThunks ∷ Context → PlutusLedgerLanguageIO (Maybe ThunkInfo)

wNoThunks ∷ Context → PlutusLedgerLanguageIO (Maybe ThunkInfo)

showTypeOfProxy PlutusLedgerLanguageString

Pretty PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

type Rep PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

type Rep PlutusLedgerLanguage = D1 ('MetaData "PlutusLedgerLanguage" "PlutusLedgerApi.Common.Versions" "plutus-ledger-api-1.30.0.0-inplace" 'False) (C1 ('MetaCons "PlutusV1" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "PlutusV2" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "PlutusV3" 'PrefixI 'False) (U1TypeType)))

data Version Source #

The version of Plutus Core used by this program.

The intention is to convey different levels of backwards compatibility for existing scripts: - Major version changes are backwards-incompatible - Minor version changes are backwards-compatible - Patch version changes should be entirely invisible (and we will likely not use this level)

The version used should be changed only when the language itself changes. For example, adding a new kind of term to the language would require a minor version bump; removing a kind of term would require a major version bump.

Similarly, changing the semantics of the language will require a version bump, typically a major one. This is the main reason why the version is actually tracked in the AST: we can have two language versions with identical ASTs but different semantics, so we need to track the version explicitly.

Compatibility is about compatibility for specific scripts, not about e.g. tools which consume scripts. Adding a new kind of term does not change how existing scripts behave, but does change what tools would need to do to process scripts.

Instances

Instances details
Generic Version 
Instance details

Defined in PlutusCore.Version

Associated Types

type Rep VersionTypeType Source #

Methods

fromVersionRep Version x Source #

toRep Version x → Version Source #

Show Version 
Instance details

Defined in PlutusCore.Version

NFData Version 
Instance details

Defined in PlutusCore.Version

Methods

rnfVersion → () Source #

Eq Version 
Instance details

Defined in PlutusCore.Version

Methods

(==)VersionVersionBool Source #

(/=)VersionVersionBool Source #

Ord Version 
Instance details

Defined in PlutusCore.Version

Hashable Version 
Instance details

Defined in PlutusCore.Version

Methods

hashWithSaltIntVersionInt

hashVersionInt

Pretty Version 
Instance details

Defined in PlutusCore.Version

Methods

prettyVersionDoc ann #

prettyList ∷ [Version] → Doc ann #

type Rep Version 
Instance details

Defined in PlutusCore.Version

type Rep Version = D1 ('MetaData "Version" "PlutusCore.Version" "plutus-core-1.30.0.0-inplace" 'False) (C1 ('MetaCons "Version" 'PrefixI 'True) (S1 ('MetaSel ('Just "_versionMajor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: (S1 ('MetaSel ('Just "_versionMinor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: S1 ('MetaSel ('Just "_versionPatch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural))))

builtinsIntroducedIn ∷ Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set DefaultFun) Source #

A map indicating which builtin functions were introduced in which MajorProtocolVersion.

This must be updated when new builtins are added. See Note [New builtins/language versions and protocol versions]

builtinsAvailableInPlutusLedgerLanguageMajorProtocolVersion → Set DefaultFun Source #

Which builtin functions are available in the given given PlutusLedgerLanguage and MajorProtocolVersion?

See Note [New builtins/language versions and protocol versions]

ledgerLanguageIntroducedInPlutusLedgerLanguageMajorProtocolVersion Source #

Query the protocol version that a specific Plutus ledger language was first introduced in.

ledgerLanguagesAvailableInMajorProtocolVersion → Set PlutusLedgerLanguage Source #

Which Plutus language versions are available in the given MajorProtocolVersion?

See Note [New builtins/language versions and protocol versions]

Costing-related types

data ExBudget Source #

Constructors

ExBudget 

Instances

Instances details
FromJSON ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Methods

parseJSON ∷ Value → Parser ExBudget

parseJSONList ∷ Value → Parser [ExBudget]

omittedFieldMaybe ExBudget

ToJSON ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Methods

toJSONExBudget → Value

toEncodingExBudget → Encoding

toJSONList ∷ [ExBudget] → Value

toEncodingList ∷ [ExBudget] → Encoding

omitFieldExBudgetBool

Monoid ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Semigroup ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Generic ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Associated Types

type Rep ExBudgetTypeType Source #

Show ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

NFData ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Methods

rnfExBudget → () Source #

Eq ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

NoThunks ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Methods

noThunks ∷ Context → ExBudgetIO (Maybe ThunkInfo)

wNoThunks ∷ Context → ExBudgetIO (Maybe ThunkInfo)

showTypeOfProxy ExBudgetString

Pretty ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Methods

prettyExBudgetDoc ann #

prettyList ∷ [ExBudget] → Doc ann #

Serialise ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Methods

encodeExBudget → Encoding

decode ∷ Decoder s ExBudget

encodeList ∷ [ExBudget] → Encoding

decodeList ∷ Decoder s [ExBudget]

PrettyBy config ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Methods

prettyBy ∷ config → ExBudgetDoc ann Source #

prettyListBy ∷ config → [ExBudget] → Doc ann Source #

Lift ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

Methods

liftQuote m ⇒ ExBudget → m Exp Source #

liftTyped ∷ ∀ (m ∷ TypeType). Quote m ⇒ ExBudgetCode m ExBudget Source #

type Rep ExBudget 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExBudget

type Rep ExBudget = D1 ('MetaData "ExBudget" "PlutusCore.Evaluation.Machine.ExBudget" "plutus-core-1.30.0.0-inplace" '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.

Constructors

ExCPU CostingInteger 

Instances

Instances details
FromJSON ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

parseJSON ∷ Value → Parser ExCPU

parseJSONList ∷ Value → Parser [ExCPU]

omittedFieldMaybe ExCPU

ToJSON ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

toJSONExCPU → Value

toEncodingExCPU → Encoding

toJSONList ∷ [ExCPU] → Value

toEncodingList ∷ [ExCPU] → Encoding

omitFieldExCPUBool

Monoid ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Semigroup ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

(<>)ExCPUExCPUExCPU Source #

sconcatNonEmpty ExCPUExCPU Source #

stimesIntegral b ⇒ b → ExCPUExCPU Source #

Bounded ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Generic ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Associated Types

type Rep ExCPUTypeType Source #

Methods

fromExCPURep ExCPU x Source #

toRep ExCPU x → ExCPU Source #

Num ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Read ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Show ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

NFData ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

rnfExCPU → () Source #

Eq ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

(==)ExCPUExCPUBool Source #

(/=)ExCPUExCPUBool Source #

Ord ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

compareExCPUExCPUOrdering Source #

(<)ExCPUExCPUBool Source #

(<=)ExCPUExCPUBool Source #

(>)ExCPUExCPUBool Source #

(>=)ExCPUExCPUBool Source #

maxExCPUExCPUExCPU Source #

minExCPUExCPUExCPU Source #

NoThunks ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

noThunks ∷ Context → ExCPUIO (Maybe ThunkInfo)

wNoThunks ∷ Context → ExCPUIO (Maybe ThunkInfo)

showTypeOfProxy ExCPUString

Pretty ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

prettyExCPUDoc ann #

prettyList ∷ [ExCPU] → Doc ann #

Serialise ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

encodeExCPU → Encoding

decode ∷ Decoder s ExCPU

encodeList ∷ [ExCPU] → Encoding

decodeList ∷ Decoder s [ExCPU]

PrettyBy config ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

prettyBy ∷ config → ExCPUDoc ann Source #

prettyListBy ∷ config → [ExCPU] → Doc ann Source #

Lift ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

liftQuote m ⇒ ExCPU → m Exp Source #

liftTyped ∷ ∀ (m ∷ TypeType). Quote m ⇒ ExCPUCode m ExCPU Source #

type Rep ExCPU 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

type Rep ExCPU = D1 ('MetaData "ExCPU" "PlutusCore.Evaluation.Machine.ExMemory" "plutus-core-1.30.0.0-inplace" 'True) (C1 ('MetaCons "ExCPU" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CostingInteger)))

newtype ExMemory Source #

Counts size in machine words.

Constructors

ExMemory CostingInteger 

Instances

Instances details
FromJSON ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

parseJSON ∷ Value → Parser ExMemory

parseJSONList ∷ Value → Parser [ExMemory]

omittedFieldMaybe ExMemory

ToJSON ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

toJSONExMemory → Value

toEncodingExMemory → Encoding

toJSONList ∷ [ExMemory] → Value

toEncodingList ∷ [ExMemory] → Encoding

omitFieldExMemoryBool

Monoid ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Semigroup ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Bounded ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Generic ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Associated Types

type Rep ExMemoryTypeType Source #

Num ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Read ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Show ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

NFData ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

rnfExMemory → () Source #

Eq ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Ord ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

NoThunks ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

noThunks ∷ Context → ExMemoryIO (Maybe ThunkInfo)

wNoThunks ∷ Context → ExMemoryIO (Maybe ThunkInfo)

showTypeOfProxy ExMemoryString

Pretty ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

prettyExMemoryDoc ann #

prettyList ∷ [ExMemory] → Doc ann #

Serialise ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

encodeExMemory → Encoding

decode ∷ Decoder s ExMemory

encodeList ∷ [ExMemory] → Encoding

decodeList ∷ Decoder s [ExMemory]

PrettyBy config ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

prettyBy ∷ config → ExMemoryDoc ann Source #

prettyListBy ∷ config → [ExMemory] → Doc ann Source #

Lift ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Methods

liftQuote m ⇒ ExMemory → m Exp Source #

liftTyped ∷ ∀ (m ∷ TypeType). Quote m ⇒ ExMemoryCode m ExMemory Source #

type Rep ExMemory 
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

type Rep ExMemory = D1 ('MetaData "ExMemory" "PlutusCore.Evaluation.Machine.ExMemory" "plutus-core-1.30.0.0-inplace" 'True) (C1 ('MetaCons "ExMemory" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CostingInteger)))

data SatInt Source #

Instances

Instances details
FromJSON SatInt 
Instance details

Defined in Data.SatInt

Methods

parseJSON ∷ Value → Parser SatInt

parseJSONList ∷ Value → Parser [SatInt]

omittedFieldMaybe SatInt

ToJSON SatInt 
Instance details

Defined in Data.SatInt

Methods

toJSONSatInt → Value

toEncodingSatInt → Encoding

toJSONList ∷ [SatInt] → Value

toEncodingList ∷ [SatInt] → Encoding

omitFieldSatIntBool

Bits SatInt 
Instance details

Defined in Data.SatInt

FiniteBits SatInt 
Instance details

Defined in Data.SatInt

Bounded SatInt 
Instance details

Defined in Data.SatInt

Generic SatInt 
Instance details

Defined in Data.SatInt

Associated Types

type Rep SatIntTypeType Source #

Methods

fromSatIntRep SatInt x Source #

toRep SatInt x → SatInt Source #

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

Read SatInt 
Instance details

Defined in Data.SatInt

Show SatInt 
Instance details

Defined in Data.SatInt

FromField SatInt 
Instance details

Defined in Data.SatInt

Methods

parseField ∷ Field → Parser SatInt

NFData SatInt 
Instance details

Defined in Data.SatInt

Methods

rnfSatInt → () Source #

Eq SatInt 
Instance details

Defined in Data.SatInt

Methods

(==)SatIntSatIntBool Source #

(/=)SatIntSatIntBool Source #

Ord SatInt 
Instance details

Defined in Data.SatInt

NoThunks SatInt 
Instance details

Defined in Data.SatInt

Methods

noThunks ∷ Context → SatIntIO (Maybe ThunkInfo)

wNoThunks ∷ Context → SatIntIO (Maybe ThunkInfo)

showTypeOfProxy SatIntString

Prim SatInt 
Instance details

Defined in Data.SatInt

Serialise SatInt 
Instance details

Defined in Data.SatInt

Methods

encodeSatInt → Encoding

decode ∷ Decoder s SatInt

encodeList ∷ [SatInt] → Encoding

decodeList ∷ Decoder s [SatInt]

Lift SatInt 
Instance details

Defined in Data.SatInt

Methods

liftQuote m ⇒ SatInt → m Exp Source #

liftTyped ∷ ∀ (m ∷ TypeType). Quote m ⇒ SatIntCode m SatInt Source #

type Rep SatInt 
Instance details

Defined in Data.SatInt

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

fromSatIntNum a ⇒ SatInt → a Source #

An optimized version of fromIntegral . unSatInt.

Network's costing parameters

A less drastic approach (that does not rely on a HF) to affect the network's (and plutus's by extension) behaviour is by tweaking the values of the cost model parameters.

The network does not associate names to cost model parameters; Plutus attaches names to the network's cost model parameters (values) either in a raw textual form or typed by a specific plutus version.

See Note [Cost model parameters]

type CostModelParams = Map Text Int64 Source #

A raw representation of the ledger's cost model parameters.

The associated keys/names to the parameter values are arbitrarily set by the plutus team; the ledger does not hold any such names.

See Note [Cost model parameters]

toCostModelParamsIsParamName p ⇒ [(p, Int64)] → CostModelParams Source #

Untags the plutus version from the typed cost model parameters and returns their raw textual form (internally used by CostModelInterface).

class (Enum a, Bounded a) ⇒ IsParamName a where Source #

A parameter name for different plutus versions.

Each Plutus version should expose such an enumeration as an ADT and create an instance of ParamName out of it.

A valid parameter name has to be enumeration, bounded, ordered, and prettyprintable to a "lower-Kebab" string.

Minimal complete definition

showParamName

Methods

showParamName ∷ a → Text Source #

Produce the raw textual form for a given typed-by-plutus-version cost model parameter Any implementation *must be* an injective function. The GIsParamName generic implementation guarantees injectivity.

readParamName ∷ Text → Maybe a Source #

default implementation that inverts the showParamName operation (not very efficient)

Instances

Instances details
IsParamName ParamName Source # 
Instance details

Defined in PlutusLedgerApi.V1.ParamName

IsParamName ParamName Source # 
Instance details

Defined in PlutusLedgerApi.V2.ParamName

IsParamName ParamName Source # 
Instance details

Defined in PlutusLedgerApi.V3.ParamName

(Enum (GenericParamName a), Bounded (GenericParamName a), Generic a, GIsParamName (Rep a)) ⇒ IsParamName (GenericParamName a) Source # 
Instance details

Defined in PlutusLedgerApi.Common.ParamName

data CostModelApplyError Source #

A fatal error when trying to create a cost given some plain costmodel parameters.

Constructors

CMUnknownParamError !Text

a costmodel parameter with the give name does not exist in the costmodel to be applied upon

CMInternalReadError

internal error when we are transforming the applyParams' input to json (should not happen)

CMInternalWriteError !String

internal error when we are transforming the applied params from json with given jsonstring error (should not happen)

Instances

Instances details
Data CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → CostModelApplyError → c CostModelApplyError Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c CostModelApplyError Source #

toConstrCostModelApplyErrorConstr Source #

dataTypeOfCostModelApplyErrorDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c CostModelApplyError) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c CostModelApplyError) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → CostModelApplyErrorCostModelApplyError Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → CostModelApplyError → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → CostModelApplyError → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → CostModelApplyError → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → CostModelApplyError → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → CostModelApplyError → m CostModelApplyError Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → CostModelApplyError → m CostModelApplyError Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → CostModelApplyError → m CostModelApplyError Source #

Exception CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Generic CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Associated Types

type Rep CostModelApplyErrorTypeType Source #

Show CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

NFData CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Methods

rnfCostModelApplyError → () Source #

Eq CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

NoThunks CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Methods

noThunks ∷ Context → CostModelApplyErrorIO (Maybe ThunkInfo)

wNoThunks ∷ Context → CostModelApplyErrorIO (Maybe ThunkInfo)

showTypeOfProxy CostModelApplyErrorString

Pretty CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

type Rep CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

type Rep CostModelApplyError = D1 ('MetaData "CostModelApplyError" "PlutusCore.Evaluation.Machine.CostModelInterface" "plutus-core-1.30.0.0-inplace" 'False) (C1 ('MetaCons "CMUnknownParamError" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: (C1 ('MetaCons "CMInternalReadError" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "CMInternalWriteError" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String))))

data CostModelApplyWarn Source #

A non-fatal warning when trying to create a cost given some plain costmodel parameters.

Constructors

CMTooManyParamsWarn

See Note [Cost model parameters from the ledger's point of view]

Fields

CMTooFewParamsWarn

See Note [Cost model parameters from the ledger's point of view]

Fields

Instances

Instances details
Pretty CostModelApplyWarn 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Evaluation context

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 being recomputed on every evaluation.

Different protocol versions may require different bundles of machine parameters, which allows us for example to tweak the shape of the costing function of a builtin, so that the builtin costs less. Currently this means that we have to create multiple DefaultMachineParameters per language version, which we put into a cache (represented by an association list) in order to avoid costly recomputation of machine parameters.

In order to get the appropriate DefaultMachineParameters at validation time we look it up in the cache using a semantics variant as a key. We compute the semantics variant from the protocol version using the stored function. Note that the semantics variant depends on the language version too, but the latter is known statically (because each language version has its own evaluation context), hence there's no reason to require it to be provided at runtime.

To say it differently, there's a matrix of semantics variants indexed by (LL, PV) pairs and we cache its particular row corresponding to the statically given LL in an EvaluationContext.

The reason why we associate a DefaultMachineParameters with a semantics variant rather than a protocol version are

  1. generally there are far more protocol versions than semantics variants supported by a specific language version, so we save on pointless duplication of bundles of machine parameters
  2. builtins don't know anything about protocol versions, only semantics variants. It is therefore more semantically precise to associate bundles of machine parameters with semantics variants than with protocol versions

Constructors

EvaluationContext 

Fields

Instances

Instances details
Generic EvaluationContext Source # 
Instance details

Defined in PlutusLedgerApi.Common.Eval

Associated Types

type Rep EvaluationContextTypeType Source #

NFData EvaluationContext Source # 
Instance details

Defined in PlutusLedgerApi.Common.Eval

Methods

rnfEvaluationContext → () Source #

NoThunks EvaluationContext Source # 
Instance details

Defined in PlutusLedgerApi.Common.Eval

Methods

noThunks ∷ Context → EvaluationContextIO (Maybe ThunkInfo)

wNoThunks ∷ Context → EvaluationContextIO (Maybe ThunkInfo)

showTypeOfProxy EvaluationContextString

type Rep EvaluationContext Source # 
Instance details

Defined in PlutusLedgerApi.Common.Eval

type Rep EvaluationContext = D1 ('MetaData "EvaluationContext" "PlutusLedgerApi.Common.Eval" "plutus-ledger-api-1.30.0.0-inplace" 'False) (C1 ('MetaCons "EvaluationContext" 'PrefixI 'True) (S1 ('MetaSel ('Just "_evalCtxLedgerLang") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PlutusLedgerLanguage) :*: (S1 ('MetaSel ('Just "_evalCtxToSemVar") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (MajorProtocolVersionBuiltinSemanticsVariant DefaultFun)) :*: S1 ('MetaSel ('Just "_evalCtxMachParsCache") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(BuiltinSemanticsVariant DefaultFun, DefaultMachineParameters)]))))

mkDynEvaluationContextMonadError CostModelApplyError m ⇒ PlutusLedgerLanguage → [BuiltinSemanticsVariant DefaultFun] → (MajorProtocolVersionBuiltinSemanticsVariant DefaultFun) → CostModelParams → m EvaluationContext Source #

Create an EvaluationContext given all builtin semantics variants supported by the provided language version.

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

IMPORTANT: the toSemVar argument computes the semantics variant for each MajorProtocolVersion and it must only return semantics variants from the semVars list, as well as cover ANY MajorProtocolVersion, including those that do not exist yet (i.e. toSemVar must never fail).

IMPORTANT: The evaluation context of every Plutus version must be recreated upon a protocol update with the updated cost model parameters.

mkTermToEvaluate Source #

Arguments

MonadError EvaluationError m 
PlutusLedgerLanguage

the Plutus ledger language of the script under execution.

MajorProtocolVersion

which major protocol version to run the operation in

ScriptForEvaluation

the script to evaluate

→ [Data]

the arguments that the script's underlying term will be applied to

→ m (Term NamedDeBruijn DefaultUni DefaultFun ()) 

Shared helper for the evaluation functions: evaluateScriptCounting and evaluateScriptRestricting,

Given a ScriptForEvaluation:

1) applies the term to a list of Data arguments (e.g. Datum, Redeemer, ScriptContext) 2) checks that the applied-term is well-scoped 3) returns the applied-term

Supporting types used in the context types

Builtins

data BuiltinByteString Source #

An opaque type representing Plutus Core ByteStrings.

Instances

Instances details
Data BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → BuiltinByteString → c BuiltinByteString Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c BuiltinByteString Source #

toConstrBuiltinByteStringConstr Source #

dataTypeOfBuiltinByteStringDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c BuiltinByteString) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c BuiltinByteString) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → BuiltinByteStringBuiltinByteString Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → BuiltinByteString → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → BuiltinByteString → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → BuiltinByteString → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → BuiltinByteString → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → BuiltinByteString → m BuiltinByteString Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BuiltinByteString → m BuiltinByteString Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BuiltinByteString → m BuiltinByteString Source #

Monoid BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

Semigroup BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

Show BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

rnfBuiltinByteString → () Source #

Eq BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

Ord BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

Hashable BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

ByteArray BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

allocRetInt → (Ptr p → IO a) → IO (a, BuiltinByteString)

ByteArrayAccess BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromBuiltin BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin BuiltinByteString Source #

Eq BuiltinByteString 
Instance details

Defined in PlutusTx.Eq

FromData BuiltinByteString 
Instance details

Defined in PlutusTx.IsData.Class

ToData 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

Ord BuiltinByteString 
Instance details

Defined in PlutusTx.Ord

Semigroup BuiltinByteString 
Instance details

Defined in PlutusTx.Semigroup

Pretty BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

prettyBuiltinByteStringDoc ann #

prettyList ∷ [BuiltinByteString] → Doc ann #

Serialise BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

encodeBuiltinByteString → Encoding

decode ∷ Decoder s BuiltinByteString

encodeList ∷ [BuiltinByteString] → Encoding

decodeList ∷ Decoder s [BuiltinByteString]

AsDefinitionId BuiltinByteString 
Instance details

Defined in PlutusTx.Blueprint.Definition.Id

HasFromOpaque BuiltinByteString BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinByteString BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni ByteString ⇒ Lift uni BuiltinByteString 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinByteStringRTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni ByteString ⇒ Typeable uni BuiltinByteString 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy BuiltinByteStringRTCompile uni fun (Type TyName uni ()) Source #

type FromBuiltin BuiltinByteString 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

type FromBuiltin BuiltinByteString = ByteString

fromBuiltinHasFromBuiltin arep ⇒ arep → FromBuiltin arep Source #

toOpaqueHasToOpaque a arep ⇒ a → arep Source #

fromOpaqueHasFromOpaque arep a ⇒ arep → a Source #

Data

data Data Source #

A generic "data" type.

The main constructor Constr represents a datatype value in sum-of-products form: Constr i args represents a use of the ith constructor along with its arguments.

The other constructors are various primitives.

Constructors

Constr Integer [Data] 
Map [(Data, Data)] 
List [Data] 
I Integer 
B ByteString 

Instances

Instances details
Data Data 
Instance details

Defined in PlutusCore.Data

Methods

gfoldl ∷ (∀ d b. Data0 d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → Data → c Data Source #

gunfold ∷ (∀ b r. Data0 b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c Data Source #

toConstrDataConstr Source #

dataTypeOfDataDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data0 d ⇒ c (t d)) → Maybe (c Data) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data0 d, Data0 e) ⇒ c (t d e)) → Maybe (c Data) Source #

gmapT ∷ (∀ b. Data0 b ⇒ b → b) → DataData Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data0 d ⇒ d → r') → Data → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data0 d ⇒ d → r') → Data → r Source #

gmapQ ∷ (∀ d. Data0 d ⇒ d → u) → Data → [u] Source #

gmapQiInt → (∀ d. Data0 d ⇒ d → u) → Data → u Source #

gmapMMonad m ⇒ (∀ d. Data0 d ⇒ d → m d) → Data → m Data Source #

gmapMpMonadPlus m ⇒ (∀ d. Data0 d ⇒ d → m d) → Data → m Data Source #

gmapMoMonadPlus m ⇒ (∀ d. Data0 d ⇒ d → m d) → Data → m Data Source #

Generic Data 
Instance details

Defined in PlutusCore.Data

Associated Types

type Rep DataTypeType Source #

Methods

fromDataRep Data x Source #

toRep Data x → Data Source #

Read Data 
Instance details

Defined in PlutusCore.Data

Show Data 
Instance details

Defined in PlutusCore.Data

Methods

showsPrecIntDataShowS Source #

showDataString Source #

showList ∷ [Data] → ShowS Source #

NFData Data 
Instance details

Defined in PlutusCore.Data

Methods

rnfData → () Source #

Eq Data 
Instance details

Defined in PlutusCore.Data

Methods

(==)DataDataBool Source #

(/=)DataDataBool Source #

Ord Data 
Instance details

Defined in PlutusCore.Data

Methods

compareDataDataOrdering Source #

(<)DataDataBool Source #

(<=)DataDataBool Source #

(>)DataDataBool Source #

(>=)DataDataBool Source #

maxDataDataData Source #

minDataDataData Source #

Hashable Data 
Instance details

Defined in PlutusCore.Data

Methods

hashWithSaltIntDataInt

hashDataInt

NoThunks Data 
Instance details

Defined in PlutusCore.Data

Methods

noThunks ∷ Context → DataIO (Maybe ThunkInfo)

wNoThunks ∷ Context → DataIO (Maybe ThunkInfo)

showTypeOfProxy DataString

HasToBuiltin Data 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type ToBuiltin Data Source #

Pretty Data 
Instance details

Defined in PlutusCore.Data

Methods

prettyDataDoc ann #

prettyList ∷ [Data] → Doc ann #

Serialise Data 
Instance details

Defined in PlutusCore.Data

Methods

encodeData → Encoding

decode ∷ Decoder s Data

encodeList ∷ [Data] → Encoding

decodeList ∷ Decoder s [Data]

PrettyBy ConstConfig Data 
Instance details

Defined in PlutusCore.Pretty.PrettyConst

Methods

prettyByConstConfigDataDoc ann Source #

prettyListByConstConfig → [Data] → Doc ann Source #

KnownBuiltinTypeIn DefaultUni term DataMakeKnownIn DefaultUni term Data 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnownDataBuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term DataReadKnownIn DefaultUni term Data 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Data Source #

Contains DefaultUni Data 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeAst tyname DefaultUni DataKnownTypeAst tyname DefaultUni Data 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type IsBuiltin DefaultUni DataBool Source #

type ToHoles DefaultUni Data ∷ [Hole] Source #

type ToBinds DefaultUni acc Data ∷ [Some TyNameRep] Source #

Methods

typeAstType tyname DefaultUni () Source #

type Rep Data 
Instance details

Defined in PlutusCore.Data

type ToBuiltin Data 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

type IsBuiltin DefaultUni Data 
Instance details

Defined in PlutusCore.Default.Universe

type ToHoles DefaultUni Data 
Instance details

Defined in PlutusCore.Default.Universe

type ToBinds DefaultUni acc Data 
Instance details

Defined in PlutusCore.Default.Universe

data BuiltinData Source #

A type corresponding to the Plutus Core builtin equivalent of Data.

The point of this type is to be an opaque equivalent of Data, so as to ensure that it is only used in ways that the compiler can handle.

As such, you should use this type in your on-chain code, and in any data structures that you want to be representable on-chain.

For off-chain usage, there are conversion functions builtinDataToData and dataToBuiltinData, but note that these will not work on-chain.

Constructors

BuiltinData ~Data 

Instances

Instances details
Data BuiltinData 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → BuiltinData → c BuiltinData Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c BuiltinData Source #

toConstrBuiltinDataConstr Source #

dataTypeOfBuiltinDataDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c BuiltinData) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c BuiltinData) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → BuiltinDataBuiltinData Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → BuiltinData → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → BuiltinData → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → BuiltinData → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → BuiltinData → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → BuiltinData → m BuiltinData Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BuiltinData → m BuiltinData Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BuiltinData → m BuiltinData Source #

Generic BuiltinData 
Instance details

Defined in PlutusTx.Builtins.Internal

Associated Types

type Rep BuiltinDataTypeType Source #

Show BuiltinData 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinData 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

rnfBuiltinData → () Source #

Eq BuiltinData 
Instance details

Defined in PlutusTx.Builtins.Internal

Ord BuiltinData 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromBuiltin BuiltinData 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin BuiltinData Source #

Eq BuiltinData 
Instance details

Defined in PlutusTx.Eq

FromData BuiltinData 
Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinData 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinData 
Instance details

Defined in PlutusTx.IsData.Class

Pretty BuiltinData 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

prettyBuiltinDataDoc ann #

prettyList ∷ [BuiltinData] → Doc ann #

AsDefinitionId BuiltinData 
Instance details

Defined in PlutusTx.Blueprint.Definition.Id

HasFromOpaque BuiltinData BuiltinData 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinData BuiltinData 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni DataLift uni BuiltinData 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinDataRTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni DataTypeable uni BuiltinData 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy BuiltinDataRTCompile uni fun (Type TyName uni ()) Source #

HasToOpaque [BuiltinData] (BuiltinList BuiltinData) 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque [(BuiltinData, BuiltinData)] (BuiltinList (BuiltinPair BuiltinData BuiltinData)) 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque (BuiltinData, BuiltinData) (BuiltinPair BuiltinData BuiltinData) 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

type Rep BuiltinData 
Instance details

Defined in PlutusTx.Builtins.Internal

type Rep BuiltinData = D1 ('MetaData "BuiltinData" "PlutusTx.Builtins.Internal" "plutus-tx-1.30.0.0-inplace" 'False) (C1 ('MetaCons "BuiltinData" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceLazy 'DecidedLazy) (Rec0 Data)))
type FromBuiltin BuiltinData 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

class ToData a where Source #

A typeclass for types that can be converted to and from BuiltinData.

Methods

toBuiltinData ∷ a → BuiltinData Source #

Convert a value to BuiltinData.

Instances

Instances details
ToData Void 
Instance details

Defined in PlutusTx.IsData.Class

ToData Address Source # 
Instance details

Defined in PlutusLedgerApi.V1.Address

ToData LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

ToData ScriptContext Source # 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

ToData ScriptPurpose Source # 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

ToData TxInInfo Source # 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

ToData TxInfo Source # 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

ToData Credential Source # 
Instance details

Defined in PlutusLedgerApi.V1.Credential

ToData StakingCredential Source # 
Instance details

Defined in PlutusLedgerApi.V1.Credential

ToData PubKeyHash Source # 
Instance details

Defined in PlutusLedgerApi.V1.Crypto

ToData DCert Source # 
Instance details

Defined in PlutusLedgerApi.V1.DCert

ToData AssetClass Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

ToData CurrencySymbol Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

ToData Lovelace Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

ToData TokenName Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

ToData Value Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

ToData Datum Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

ToData DatumHash Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

ToData Redeemer Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

ToData RedeemerHash Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

ToData ScriptHash Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

ToData DiffMilliSeconds Source # 
Instance details

Defined in PlutusLedgerApi.V1.Time

ToData POSIXTime Source # 
Instance details

Defined in PlutusLedgerApi.V1.Time

ToData TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

ToData TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

ToData TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

ToData AssetClass Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

ToData CurrencySymbol Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

ToData Lovelace Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

ToData TokenName Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

ToData Value Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

ToData ScriptContext Source # 
Instance details

Defined in PlutusLedgerApi.V2.Contexts

ToData TxInInfo Source # 
Instance details

Defined in PlutusLedgerApi.V2.Contexts

ToData TxInfo Source # 
Instance details

Defined in PlutusLedgerApi.V2.Contexts

ToData OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

ToData TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

ToData ChangedParameters Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData ColdCommitteeCredential Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData Committee Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData Constitution Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData DRep Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData DRepCredential Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData Delegatee Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData GovernanceAction Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData GovernanceActionId Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData HotCommitteeCredential Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData ProposalProcedure Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData ProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData ScriptContext Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData ScriptInfo Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData ScriptPurpose Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData TxCert Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData TxInInfo Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData TxInfo Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData Vote Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData Voter Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

ToData TxId Source # 
Instance details

Defined in PlutusLedgerApi.V3.Tx

ToData TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V3.Tx

ToData BuiltinBLS12_381_G1_Element

For the BLS12-381 G1 and G2 types we use the compress functions to convert to a ByteString and then encode that as Data as usual. We have to be more careful going the other way because we decode a Data object to (possibly) get a BuiltinByteString and then uncompress the underlying ByteString to get a group element. However uncompression can fail so we have to check what happens: we don't use bls12_381_G?_uncompress because that invokes error if something goes wrong (but we do use it for unsafeFromData).

Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinBLS12_381_G2_Element 
Instance details

Defined in PlutusTx.IsData.Class

(TypeError ('Text "toBuiltinData is not supported for BuiltinBLS12_381_MlResult") ∷ Constraint) ⇒ ToData BuiltinBLS12_381_MlResult

We do not provide instances of any of these classes for BuiltinBLS12_381_MlResult since there is no serialisation format: we expect that values of that type will only occur as the result of on-chain computations.

Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinByteString 
Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinData 
Instance details

Defined in PlutusTx.IsData.Class

ToData Rational 
Instance details

Defined in PlutusTx.Ratio

ToData Integer 
Instance details

Defined in PlutusTx.IsData.Class

(TypeError ('Text "Int is not supported, use Integer instead") ∷ Constraint) ⇒ ToData Int 
Instance details

Defined in PlutusTx.IsData.Class

ToData a ⇒ ToData (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

ToData a ⇒ ToData (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

ToData a ⇒ ToData (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

ToData a ⇒ ToData (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

ToData a ⇒ ToData [a] 
Instance details

Defined in PlutusTx.IsData.Class

Methods

toBuiltinData ∷ [a] → BuiltinData Source #

(ToData k, ToData v) ⇒ ToData (Map k v)

Hand-written instances to use the underlying Map type in Data, and to be reasonably efficient.

Instance details

Defined in PlutusTx.AssocMap

Methods

toBuiltinDataMap k v → BuiltinData Source #

ToData (Map k a) 
Instance details

Defined in PlutusTx.Data.AssocMap

Methods

toBuiltinDataMap k a → BuiltinData Source #

class FromData a where Source #

Methods

fromBuiltinDataBuiltinDataMaybe a Source #

Convert a value from BuiltinData, returning Nothing if this fails.

Instances

Instances details
FromData Void 
Instance details

Defined in PlutusTx.IsData.Class

FromData Address Source # 
Instance details

Defined in PlutusLedgerApi.V1.Address

FromData LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

FromData ScriptContext Source # 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

FromData ScriptPurpose Source # 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

FromData TxInInfo Source # 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

FromData TxInfo Source # 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

FromData Credential Source # 
Instance details

Defined in PlutusLedgerApi.V1.Credential

FromData StakingCredential Source # 
Instance details

Defined in PlutusLedgerApi.V1.Credential

FromData PubKeyHash Source # 
Instance details

Defined in PlutusLedgerApi.V1.Crypto

FromData DCert Source # 
Instance details

Defined in PlutusLedgerApi.V1.DCert

FromData AssetClass Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

FromData CurrencySymbol Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

FromData Lovelace Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

FromData TokenName Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

FromData Value Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

FromData Datum Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

FromData DatumHash Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

FromData Redeemer Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

FromData RedeemerHash Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

FromData ScriptHash Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

FromData DiffMilliSeconds Source # 
Instance details

Defined in PlutusLedgerApi.V1.Time

FromData POSIXTime Source # 
Instance details

Defined in PlutusLedgerApi.V1.Time

FromData TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

FromData TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

FromData TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

FromData AssetClass Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

FromData CurrencySymbol Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

FromData Lovelace Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

FromData TokenName Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

FromData Value Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

FromData ScriptContext Source # 
Instance details

Defined in PlutusLedgerApi.V2.Contexts

FromData TxInInfo Source # 
Instance details

Defined in PlutusLedgerApi.V2.Contexts

FromData TxInfo Source # 
Instance details

Defined in PlutusLedgerApi.V2.Contexts

FromData OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

FromData TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

FromData ChangedParameters Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData ColdCommitteeCredential Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData Committee Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData Constitution Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData DRep Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData DRepCredential Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData Delegatee Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData GovernanceAction Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData GovernanceActionId Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData HotCommitteeCredential Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData ProposalProcedure Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData ProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData ScriptContext Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData ScriptInfo Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData ScriptPurpose Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData TxCert Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData TxInInfo Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData TxInfo Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData Vote Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData Voter Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

FromData TxId Source # 
Instance details

Defined in PlutusLedgerApi.V3.Tx

FromData TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V3.Tx

FromData BuiltinBLS12_381_G1_Element 
Instance details

Defined in PlutusTx.IsData.Class

FromData BuiltinBLS12_381_G2_Element 
Instance details

Defined in PlutusTx.IsData.Class

(TypeError ('Text "fromBuiltinData is not supported for BuiltinBLS12_381_MlResult") ∷ Constraint) ⇒ FromData BuiltinBLS12_381_MlResult 
Instance details

Defined in PlutusTx.IsData.Class

FromData BuiltinByteString 
Instance details

Defined in PlutusTx.IsData.Class

FromData BuiltinData 
Instance details

Defined in PlutusTx.IsData.Class

FromData Rational 
Instance details

Defined in PlutusTx.Ratio

FromData Integer 
Instance details

Defined in PlutusTx.IsData.Class

(TypeError ('Text "Int is not supported, use Integer instead") ∷ Constraint) ⇒ FromData Int 
Instance details

Defined in PlutusTx.IsData.Class

FromData a ⇒ FromData (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

FromData a ⇒ FromData (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

FromData a ⇒ FromData (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

FromData a ⇒ FromData (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

FromData a ⇒ FromData [a] 
Instance details

Defined in PlutusTx.IsData.Class

(FromData k, FromData v) ⇒ FromData (Map k v)

A hand-written transformation from Data to Map. Compared to unsafeFromBuiltinData, it is safe to call when it is unknown if the Data is built with Datas Map constructor. Note that it is, however, unsafe in the sense that it assumes that any map encoded in the Data is well-formed, i.e. fromBuiltinData does not perform any deduplication of keys or of key-value pairs!

Instance details

Defined in PlutusTx.AssocMap

FromData (Map k a) 
Instance details

Defined in PlutusTx.Data.AssocMap

class UnsafeFromData a where Source #

Methods

unsafeFromBuiltinDataBuiltinData → a Source #

Convert a value from BuiltinData, calling error if this fails. This is typically much faster than fromBuiltinData.

When implementing this function, make sure to call unsafeFromBuiltinData rather than fromBuiltinData when converting substructures!

This is a simple type without any validation, use with caution.

Instances

Instances details
UnsafeFromData Void 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData Address Source # 
Instance details

Defined in PlutusLedgerApi.V1.Address

UnsafeFromData LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

UnsafeFromData ScriptContext Source # 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

UnsafeFromData ScriptPurpose Source # 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

UnsafeFromData TxInInfo Source # 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

UnsafeFromData TxInfo Source # 
Instance details

Defined in PlutusLedgerApi.V1.Contexts

UnsafeFromData Credential Source # 
Instance details

Defined in PlutusLedgerApi.V1.Credential

UnsafeFromData StakingCredential Source # 
Instance details

Defined in PlutusLedgerApi.V1.Credential

UnsafeFromData PubKeyHash Source # 
Instance details

Defined in PlutusLedgerApi.V1.Crypto

UnsafeFromData DCert Source # 
Instance details

Defined in PlutusLedgerApi.V1.DCert

UnsafeFromData AssetClass Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

UnsafeFromData CurrencySymbol Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

UnsafeFromData Lovelace Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

UnsafeFromData TokenName Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

UnsafeFromData Value Source # 
Instance details

Defined in PlutusLedgerApi.V1.Data.Value

UnsafeFromData Datum Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

UnsafeFromData DatumHash Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

UnsafeFromData Redeemer Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

UnsafeFromData RedeemerHash Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

UnsafeFromData ScriptHash Source # 
Instance details

Defined in PlutusLedgerApi.V1.Scripts

UnsafeFromData DiffMilliSeconds Source # 
Instance details

Defined in PlutusLedgerApi.V1.Time

UnsafeFromData POSIXTime Source # 
Instance details

Defined in PlutusLedgerApi.V1.Time

UnsafeFromData TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

UnsafeFromData TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

UnsafeFromData TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

UnsafeFromData AssetClass Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

UnsafeFromData CurrencySymbol Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

UnsafeFromData Lovelace Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

UnsafeFromData TokenName Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

UnsafeFromData Value Source # 
Instance details

Defined in PlutusLedgerApi.V1.Value

UnsafeFromData ScriptContext Source # 
Instance details

Defined in PlutusLedgerApi.V2.Contexts

UnsafeFromData TxInInfo Source # 
Instance details

Defined in PlutusLedgerApi.V2.Contexts

UnsafeFromData TxInfo Source # 
Instance details

Defined in PlutusLedgerApi.V2.Contexts

UnsafeFromData OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

UnsafeFromData TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

UnsafeFromData ChangedParameters Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData ColdCommitteeCredential Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData Committee Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData Constitution Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData DRep Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData DRepCredential Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData Delegatee Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData GovernanceAction Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData GovernanceActionId Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData HotCommitteeCredential Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData ProposalProcedure Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData ProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData ScriptContext Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData ScriptInfo Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData ScriptPurpose Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData TxCert Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData TxInInfo Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData TxInfo Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData Vote Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData Voter Source # 
Instance details

Defined in PlutusLedgerApi.V3.Contexts

UnsafeFromData TxId Source # 
Instance details

Defined in PlutusLedgerApi.V3.Tx

UnsafeFromData TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V3.Tx

UnsafeFromData BuiltinBLS12_381_G1_Element 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinBLS12_381_G2_Element 
Instance details

Defined in PlutusTx.IsData.Class

(TypeError ('Text "unsafeFromBuiltinData is not supported for BuiltinBLS12_381_MlResult") ∷ Constraint) ⇒ UnsafeFromData BuiltinBLS12_381_MlResult 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinByteString 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinData 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData Rational 
Instance details

Defined in PlutusTx.Ratio

UnsafeFromData Integer 
Instance details

Defined in PlutusTx.IsData.Class

(TypeError ('Text "Int is not supported, use Integer instead") ∷ Constraint) ⇒ UnsafeFromData Int 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData a ⇒ UnsafeFromData (Extended a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

UnsafeFromData a ⇒ UnsafeFromData (Interval a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

UnsafeFromData a ⇒ UnsafeFromData (LowerBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

UnsafeFromData a ⇒ UnsafeFromData (UpperBound a) Source # 
Instance details

Defined in PlutusLedgerApi.V1.Interval

UnsafeFromData a ⇒ UnsafeFromData [a] 
Instance details

Defined in PlutusTx.IsData.Class

(UnsafeFromData k, UnsafeFromData v) ⇒ UnsafeFromData (Map k v)

A hand-written transformation from Data to Map. It is unsafe because the caller must provide the guarantee that the Data is constructed using the Datas Map constructor. Note that it assumes, like the fromBuiltinData transformation, that the map encoded in the Data is well-formed, i.e. unsafeFromBuiltinData does not perform any deduplication of keys or of key-value pairs!

Instance details

Defined in PlutusTx.AssocMap

UnsafeFromData (Map k a) 
Instance details

Defined in PlutusTx.Data.AssocMap

toDataToData a ⇒ a → Data Source #

Convert a value to Data.

fromDataFromData a ⇒ DataMaybe a Source #

Convert a value from Data, returning Nothing if this fails.

unsafeFromDataUnsafeFromData a ⇒ Data → a Source #

Convert a value from Data, throwing if this fails.

dataToBuiltinDataDataBuiltinData Source #

Convert a Data into a BuiltinData. Only works off-chain.

builtinDataToDataBuiltinDataData Source #

Convert a BuiltinData into a Data. Only works off-chain.

Misc

class Monad m ⇒ MonadError e (m ∷