-
Notifications
You must be signed in to change notification settings - Fork 479
/
Api.hs
122 lines (119 loc) · 2.81 KB
/
Api.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
{- |
The interface to Plutus V2 for the ledger.
-}
module Plutus.V2.Ledger.Api (
-- * Scripts
SerializedScript
, Script
, fromCompiledCode
-- * Validating scripts
, validateScript
-- * Running scripts
, evaluateScriptRestricting
, evaluateScriptCounting
-- ** Verbose mode and log output
, VerboseMode (..)
, LogOutput
-- * Serialising scripts
, plutusScriptEnvelopeType
, plutusDatumEnvelopeType
, plutusRedeemerEnvelopeType
-- * Costing-related types
, ExBudget (..)
, ExCPU (..)
, ExMemory (..)
, SatInt
-- ** Cost model
, validateCostModelParams
, defaultCostModelParams
, CostModelParams
-- * Context types
, ScriptContext(..)
, ScriptPurpose(..)
-- ** Supporting types used in the context types
-- *** ByteStrings
, BuiltinByteString
, toBuiltin
, fromBuiltin
-- *** Bytes
, LedgerBytes (..)
, fromBytes
-- *** Certificates
, DCert(..)
-- *** Credentials
, StakingCredential(..)
, Credential(..)
-- *** Value
, Value (..)
, CurrencySymbol (..)
, TokenName (..)
, singleton
, unionWith
, adaSymbol
, adaToken
-- *** Time
, POSIXTime (..)
, POSIXTimeRange
-- *** Types for representing transactions
, Address (..)
, PubKeyHash (..)
, TxId (..)
, TxInfo (..)
, TxOut(..)
, TxOutRef(..)
, TxInInfo(..)
-- *** Intervals
, Interval (..)
, Extended (..)
, Closure
, UpperBound (..)
, LowerBound (..)
, always
, from
, to
, lowerBound
, upperBound
, strictLowerBound
, strictUpperBound
-- *** Association maps
, Map
, fromList
-- *** Newtypes for script/datum types and hash types
, Validator (..)
, mkValidatorScript
, unValidatorScript
, ValidatorHash (..)
, MintingPolicy (..)
, mkMintingPolicyScript
, unMintingPolicyScript
, MintingPolicyHash (..)
, StakeValidator (..)
, mkStakeValidatorScript
, unStakeValidatorScript
, StakeValidatorHash (..)
, Redeemer (..)
, RedeemerHash (..)
, Datum (..)
, DatumHash (..)
-- * Data
, Data (..)
, BuiltinData (..)
, ToData (..)
, FromData (..)
, UnsafeFromData (..)
, toData
, fromData
, dataToBuiltinData
, builtinDataToData
-- * Errors
, EvaluationError (..)
) where
import Data.Text (Text)
import Plutus.V1.Ledger.Api hiding (ScriptContext (..), TxInfo (..), plutusScriptEnvelopeType)
import Plutus.V2.Ledger.Contexts
import PlutusTx.AssocMap (Map, fromList)
plutusScriptEnvelopeType :: Text
plutusScriptEnvelopeType = "PlutusV2Script"