| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusLedgerApi.Data.V3
Description
The interface to Plutus V3 for the ledger.
Synopsis
- type SerialisedScript = CompiledCode a -> SerialisedScript #
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.
serialiseUPLC :: DefaultFun () -> SerialisedScript #
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.
Arguments
| :: forall m. MonadError ScriptDecodeError m | |
| => 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).
uncheckedDeserialiseUPLC :: SerialisedScript -> DefaultFun () #
Deserialises a SerialisedScript back into an AST. Does *not* do
ledger-language-version-specific checks like for allowable builtins.
Running scripts
Arguments
| :: MajorProtocolVersion | Which 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 |
| -> (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.
Arguments
| :: MajorProtocolVersion | Which 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 |
| -> (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.
CIP-1694
newtype ColdCommitteeCredential #
Constructors
| ColdCommitteeCredential Credential |
Instances
Types for representing transactions
An address may contain two credentials,
the payment credential and optionally a StakingCredential.
pattern Address :: Credential -> Maybe StakingCredential -> Address #
addressCredential :: Address -> Credential #
newtype PubKeyHash #
The hash of a public key. This is frequently used to identify the public key, rather than the key itself. Hashed with BLAKE2b-224. 28 bytes.
This is a simple type without any validation, use with caution. You may want to add checks for its invariants. See the Shelley ledger specification.
Constructors
| PubKeyHash | |
Fields | |
Instances
| Unroll PubKeyHash = '[PubKeyHash] |
A transaction ID, i.e. the hash of a transaction. Hashed with BLAKE2b-256. 32 byte.
This is a simple type without any validation, use with caution. You may want to add checks for its invariants. See the Shelley ledger specification.
Constructors
| TxId | |
Fields | |
Instances
| List ProposalProcedure # A transaction output, consisting of a target address, a value, optionally a datum/datum hash, and optionally a reference script. Instances
pattern TxOut :: Address -> Value -> OutputDatum -> Maybe ScriptHash -> TxOut # txOutAddress :: TxOut -> Address # txOutValue :: TxOut -> Value # txOutDatum :: TxOut -> OutputDatum # A reference to a transaction output. This is a
pair of a transaction ID ( Instances
txInInfoOutRef :: TxInInfo -> TxOutRef # txInInfoResolved :: TxInInfo -> TxOut # data OutputDatum # The datum attached to an output: either nothing; a datum hash; or the datum itself (an "inline datum"). Instances
pattern NoOutputDatum :: OutputDatum # pattern OutputDatum :: Datum -> OutputDatum # pattern OutputDatumHash :: DatumHash -> OutputDatum # IntervalsAn interval of The interval may be either closed or open at either end, meaning that the endpoints may or may not be included in the interval. The interval can also be unbounded on either side. The pattern LowerBound :: forall a. (ToData a, UnsafeFromData a) => Extended a -> Closure -> LowerBound a # always :: (ToData a, UnsafeFromData a) => Interval a # An from :: (ToData a, UnsafeFromData a) => a -> Interval a #
to :: (ToData a, UnsafeFromData a) => a -> Interval a #
lowerBound :: (ToData a, UnsafeFromData a) => a -> LowerBound a # Construct a lower bound from a value. The resulting bound includes all values that are equal or greater than the input value. upperBound :: (ToData a, UnsafeFromData a) => a -> UpperBound a # Construct an upper bound from a value. The resulting bound includes all values that are equal or smaller than the input value. strictLowerBound :: (ToData a, UnsafeFromData a) => a -> LowerBound a # Construct a strict lower bound from a value. The resulting bound includes all values that are (strictly) greater than the input value. strictUpperBound :: (ToData a, UnsafeFromData a) => a -> UpperBound a # Construct a strict upper bound from a value. The resulting bound includes all values that are (strictly) smaller than the input value. RatioRepresents an arbitrary-precision ratio. The following two invariants are maintained:
ratio :: Integer -> Integer -> Maybe Rational # Safely constructs a unsafeRatio :: Integer -> Integer -> Rational # denominator :: Rational -> Integer # Returns the denominator of its argument. This will always be greater than, or equal to, 1, although the type does not describe this. NoteIt is not true in general that fromHaskellRatio :: Rational -> Rational # Converts a GHC Note: Does not work on-chain. toHaskellRatio :: Rational -> Rational # Association mapsA map associating keys and values backed by This implementation has the following characteristics:
Therefore this implementation is likely a better choice than PlutusTx.AssocMap.Map
if it is part of a data type defined using A Instances
unsafeFromSOPList :: (ToData k, ToData a) => [(k, a)] -> Map k a # Unsafely create an Newtypes and hash typesnewtype ScriptHash # Type representing the BLAKE2b-224 hash of a script. 28 bytes. This is a simple type without any validation, use with caution. You may want to add checks for its invariants. See the Shelley ledger specification. Constructors
newtype RedeemerHash # Type representing the BLAKE2b-256 hash of a redeemer. 32 bytes. This is a simple type without any validation, use with caution. You may want to add checks for its invariants. See the Shelley ledger specification. Constructors
Type representing the BLAKE2b-256 hash of a datum. 32 bytes. This is a simple type without any validation, use with caution. You may want to add checks for its invariants. See the Shelley ledger specification. Constructors
DataA generic "data" type. The main constructor The other constructors are various primitives. Constructors
data BuiltinData # A type corresponding to the Plutus Core builtin equivalent of The point of this type is to be an opaque equivalent of 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 Constructors
Instances
Instances
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||