| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusLedgerApi.V4
Description
The type interface to Plutus V4 for the ledger.
Synopsis
- newtype AccountId = AccountId Credential
- data AccountBalanceInterval
- newtype AccountBalanceIntervals = AccountBalanceIntervals (Map AccountId AccountBalanceInterval)
- newtype ColdCommitteeCredential = ColdCommitteeCredential Credential
- newtype HotCommitteeCredential = HotCommitteeCredential Credential
- newtype DRepCredential = DRepCredential Credential
- data DRep
- data Delegatee
- data TxCert
- = TxCertRegAccount AccountId Lovelace
- | TxCertUnRegAccount AccountId Lovelace
- | TxCertDelegAccount AccountId Delegatee
- | TxCertRegAccountDeleg AccountId Delegatee Lovelace
- | TxCertRegDRep DRepCredential Lovelace
- | TxCertUpdateDRep DRepCredential
- | TxCertUnRegDRep DRepCredential Lovelace
- | TxCertPoolRegister PubKeyHash PubKeyHash
- | TxCertPoolRetire PubKeyHash Integer
- | TxCertAuthHotCommittee ColdCommitteeCredential HotCommitteeCredential
- | TxCertResignColdCommittee ColdCommitteeCredential
- data Voter
- data Vote
- data GovernanceActionId = GovernanceActionId {}
- data Committee = Committee {}
- newtype Constitution = Constitution {}
- data ProtocolVersion = ProtocolVersion {}
- data GovernanceAction
- = ParameterChange (Maybe GovernanceActionId) ChangedParameters (Maybe ScriptHash)
- | HardForkInitiation (Maybe GovernanceActionId) ProtocolVersion
- | TreasuryWithdrawals (Map Credential Lovelace) (Maybe ScriptHash)
- | NoConfidence (Maybe GovernanceActionId)
- | UpdateCommittee (Maybe GovernanceActionId) [ColdCommitteeCredential] (Map ColdCommitteeCredential Integer) Rational
- | NewConstitution (Maybe GovernanceActionId) Constitution
- | InfoAction
- newtype ChangedParameters = ChangedParameters {}
- data ProposalProcedure = ProposalProcedure {}
- data ScriptContext = ScriptContext {}
- data ScriptPurpose
- data ScriptInfo
- data TopTxInfo = TopTxInfo {}
- data TopTxInfoSimplified = TopTxInfoSimplified {
- ttisIds ∷ [TxId]
- ttisInputs ∷ [TxInInfo]
- ttisReferenceInputs ∷ [TxInInfo]
- ttisOutputs ∷ [TxOut]
- ttisMints ∷ MintValue
- ttisBurns ∷ MintValue
- ttisTxCerts ∷ [TxCert]
- ttisWithdrawals ∷ Map AccountId Lovelace
- ttisDirectDeposits ∷ Map AccountId Lovelace
- ttisValidRange ∷ POSIXTimeRange
- ttisGuards ∷ Map Credential ()
- ttisScriptPurposes ∷ Map ScriptPurpose ()
- ttisData ∷ Map DatumHash Datum
- ttisVotes ∷ Map Voter (Map GovernanceActionId Vote)
- ttisProposalProcedures ∷ [ProposalProcedure]
- ttisCurrentTreasuryAmount ∷ Maybe Lovelace
- ttisTreasuryDonations ∷ Lovelace
- data BuiltinByteString
- toBuiltin ∷ HasToBuiltin a ⇒ a → ToBuiltin a
- fromBuiltin ∷ HasFromBuiltin arep ⇒ arep → FromBuiltin arep
- toOpaque ∷ HasToOpaque a arep ⇒ a → arep
- fromOpaque ∷ HasFromOpaque arep a ⇒ arep → a
- newtype LedgerBytes = LedgerBytes {}
- fromBytes ∷ ByteString → LedgerBytes
- data StakingCredential
- data Credential
- newtype Value = Value {}
- newtype CurrencySymbol = CurrencySymbol {}
- newtype TokenName = TokenName {}
- singleton ∷ CurrencySymbol → TokenName → Integer → Value
- unionWith ∷ (Integer → Integer → Integer) → Value → Value → Value
- adaSymbol ∷ CurrencySymbol
- adaToken ∷ TokenName
- newtype Lovelace = Lovelace {}
- newtype AssetClass = AssetClass {}
- assetClass ∷ CurrencySymbol → TokenName → AssetClass
- assetClassValue ∷ AssetClass → Integer → Value
- assetClassValueOf ∷ Value → AssetClass → Integer
- currencySymbol ∷ ByteString → CurrencySymbol
- currencySymbolValueOf ∷ Value → CurrencySymbol → Integer
- flattenValue ∷ Value → [(CurrencySymbol, TokenName, Integer)]
- geq ∷ Value → Value → Bool
- gt ∷ Value → Value → Bool
- isZero ∷ Value → Bool
- leq ∷ Value → Value → Bool
- lovelaceValue ∷ Lovelace → Value
- lovelaceValueOf ∷ Value → Lovelace
- lt ∷ Value → Value → Bool
- scale ∷ Module s v ⇒ s → v → v
- split ∷ Value → (Value, Value)
- symbols ∷ Value → [CurrencySymbol]
- tokenName ∷ ByteString → TokenName
- unsafeLovelaceValueOf ∷ Value → Lovelace
- valueOf ∷ Value → CurrencySymbol → TokenName → Integer
- withCurrencySymbol ∷ CurrencySymbol → Value → a → (Map TokenName Integer → a) → a
- data MintValue
- emptyMintValue ∷ MintValue
- mintValueToMap ∷ MintValue → Map CurrencySymbol (Map TokenName Integer)
- mintValueMinted ∷ MintValue → Value
- mintValueBurned ∷ MintValue → Value
- newtype POSIXTime = POSIXTime {}
- type POSIXTimeRange = Interval POSIXTime
- data Address = Address {}
- newtype PubKeyHash = PubKeyHash {}
- newtype TxId = TxId {}
- data TxInfo = TxInfo {
- txInfoId ∷ TxId
- txInfoSubTxIx ∷ Maybe Integer
- txInfoInputs ∷ [TxInInfo]
- txInfoReferenceInputs ∷ [TxInInfo]
- txInfoOutputs ∷ [TxOut]
- txInfoFee ∷ Lovelace
- txInfoMint ∷ MintValue
- txInfoTxCerts ∷ [TxCert]
- txInfoWithdrawals ∷ Map AccountId Lovelace
- txInfoDirectDeposits ∷ Map AccountId Lovelace
- txInfoAccountBalanceIntervals ∷ AccountBalanceIntervals
- txInfoValidRange ∷ POSIXTimeRange
- txInfoGuards ∷ [Credential]
- txInfoRequiredTopLevelGuards ∷ Map Credential (Maybe Datum)
- txInfoRedeemers ∷ Map ScriptPurpose Redeemer
- txInfoData ∷ Map DatumHash Datum
- txInfoVotes ∷ Map Voter (Map GovernanceActionId Vote)
- txInfoProposalProcedures ∷ [ProposalProcedure]
- txInfoCurrentTreasuryAmount ∷ Maybe Lovelace
- txInfoTreasuryDonation ∷ Lovelace
- data TxOut = TxOut {}
- data TxOutRef = TxOutRef {}
- data TxInInfo = TxInInfo {}
- data OutputDatum
- data Interval a = Interval {
- ivFrom ∷ LowerBound a
- ivTo ∷ UpperBound a
- data Extended a
- type Closure = Bool
- data UpperBound a = UpperBound (Extended a) Closure
- data LowerBound a = LowerBound (Extended a) Closure
- always ∷ Interval a
- from ∷ a → Interval a
- to ∷ a → Interval a
- lowerBound ∷ a → LowerBound a
- upperBound ∷ a → UpperBound a
- strictLowerBound ∷ a → LowerBound a
- strictUpperBound ∷ a → UpperBound a
- inclusiveLowerBound ∷ Enum a ⇒ LowerBound a → Extended a
- inclusiveUpperBound ∷ Enum a ⇒ UpperBound a → Extended a
- data Rational
- ratio ∷ Integer → Integer → Maybe Rational
- unsafeRatio ∷ Integer → Integer → Rational
- numerator ∷ Rational → Integer
- denominator ∷ Rational → Integer
- fromHaskellRatio ∷ Rational → Rational
- toHaskellRatio ∷ Rational → Rational
- fromGHC ∷ Rational → Rational
- toGHC ∷ Rational → Rational
- data Map k v
- unsafeFromList ∷ [(k, v)] → Map k v
- newtype ScriptHash = ScriptHash {}
- newtype Redeemer = Redeemer {}
- newtype RedeemerHash = RedeemerHash BuiltinByteString
- newtype Datum = Datum {}
- newtype DatumHash = DatumHash BuiltinByteString
- data Data
- data BuiltinData = BuiltinData ~Data
- class ToData a where
- toBuiltinData ∷ a → BuiltinData
- class FromData a where
- fromBuiltinData ∷ BuiltinData → Maybe a
- class UnsafeFromData a where
- toData ∷ ToData a ⇒ a → Data
- fromData ∷ FromData a ⇒ Data → Maybe a
- unsafeFromData ∷ UnsafeFromData a ⇒ Data → a
- dataToBuiltinData ∷ Data → BuiltinData
- builtinDataToData ∷ BuiltinData → Data
Accounts
Constructors
| AccountId Credential |
Instances
data AccountBalanceInterval Source #
Constructors
| AccountBalanceLowerBound Lovelace | |
| AccountBalanceUpperBound Lovelace | |
| AccountBalanceBothBounds Lovelace Lovelace | |
| AccountBalanceExact Lovelace |
Instances
newtype AccountBalanceIntervals Source #
Constructors
| AccountBalanceIntervals (Map AccountId AccountBalanceInterval) |
Instances
Governance
newtype ColdCommitteeCredential Source #
Constructors
| ColdCommitteeCredential Credential |
Instances
newtype HotCommitteeCredential Source #
Constructors
| HotCommitteeCredential Credential |
Instances
newtype DRepCredential Source #
Constructors
| DRepCredential Credential |
Instances
Constructors
| DRep DRepCredential | |
| DRepAlwaysAbstain | |
| DRepAlwaysNoConfidence |
Instances
Constructors
| DelegStake PubKeyHash | |
| DelegVote DRep | |
| DelegStakeVote PubKeyHash DRep |
Instances
Constructors
Instances
Constructors
| CommitteeVoter HotCommitteeCredential | |
| DRepVoter DRepCredential | |
| StakePoolVoter PubKeyHash |
Instances
A vote. The optional anchor is omitted.
Instances
data GovernanceActionId Source #
Similar to TxOutRef, but for GovActions
Constructors
| GovernanceActionId | |
Fields | |
Instances
Constructors
| Committee | |
Fields
| |
Instances
newtype Constitution Source #
A constitution. The optional anchor is omitted.
Constructors
| Constitution | |
Fields | |
Instances
data ProtocolVersion Source #
Constructors
| ProtocolVersion | |
Instances
data GovernanceAction Source #
Constructors
| ParameterChange (Maybe GovernanceActionId) ChangedParameters (Maybe ScriptHash) | Hash of the constitution script |
| HardForkInitiation (Maybe GovernanceActionId) ProtocolVersion | proposal to update protocol version |
| TreasuryWithdrawals (Map Credential Lovelace) (Maybe ScriptHash) | Hash of the constitution script |
| NoConfidence (Maybe GovernanceActionId) | |
| UpdateCommittee | |
Fields
| |
| NewConstitution (Maybe GovernanceActionId) Constitution | |
| InfoAction | |
Instances
newtype ChangedParameters Source #
A Plutus Data object containing proposed parameter changes. The Data object contains
a Map with one entry per changed parameter, from the parameter ID to the new value.
Unchanged parameters are not included.
The mapping from parameter IDs to parameters can be found in conway.cddl.
Invariant: This map is non-empty, and the keys are stored in ascending order.
This Data object has the following format (in pseudocode):
ChangedParametersData = Map ChangedIdData ChangedManyValueData ChangedIdData = I Integer ChangedManyValueData = ChangedSingleValueData | List[ChangedSingleValueData...] -- ^ an arbitrary-length, heterogeneous (integer or ratio) list of values (to support sub-parameters)
ChangedSingleValueData = I Integer -- a proposed integer value | List[I Integer, I Integer] -- a proposed numerator,denominator (ratio value) -- ^ a 2-exact element list; *BE CAREFUL* because this can be alternatively (ambiguously) interpreted -- as a many-value data (sub-parameter) of two integer single-value data.
, where Map,I,List are the constructors of Data
and Integer is the usual arbitrary-precision PlutusTx/Haskell Integer.
Constructors
| ChangedParameters | |
Fields | |
Instances
data ProposalProcedure Source #
A proposal procedure. The optional anchor is omitted.
Constructors
| ProposalProcedure | |
Instances
Context types
data ScriptContext Source #
Constructors
| ScriptContext | |
Instances
data ScriptPurpose Source #
Constructors
Instances
data ScriptInfo Source #
Constructors
Instances
Constructors
| TopTxInfo | |
Instances
data TopTxInfoSimplified Source #
Constructors
Instances
Supporting types used in the context types
Builtins
data BuiltinByteString Source #
An opaque type representing Plutus Core ByteStrings.
Instances
toBuiltin ∷ HasToBuiltin a ⇒ a → ToBuiltin a Source #
fromBuiltin ∷ HasFromBuiltin arep ⇒ arep → FromBuiltin arep Source #
toOpaque ∷ HasToOpaque a arep ⇒ a → arep Source #
fromOpaque ∷ HasFromOpaque arep a ⇒ arep → a Source #
Bytes
newtype LedgerBytes Source #
Constructors
| LedgerBytes | |
Fields | |
Instances
fromBytes ∷ ByteString → LedgerBytes Source #
Lift a Haskell bytestring to the Plutus abstraction LedgerBytes
Credentials
data StakingCredential Source #
Staking credential used to assign rewards.
Constructors
| StakingHash Credential | The staking hash is the |
| StakingPtr | The certificate pointer, constructed by the given
slot number, transaction and certificate indices.
NB: The fields should really be all |
Instances
data Credential Source #
Credentials required to unlock a transaction output.
Constructors
| PubKeyCredential PubKeyHash | The transaction that spends this output must be signed by the private key.
See |
| ScriptCredential ScriptHash | The transaction that spends this output must include the validator script and
be accepted by the validator. See |
Instances
Value
The Value type represents a collection of amounts of different currencies.
We can think of Value as a vector space whose dimensions are currencies.
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 Values 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.
There is no 'Ord Value' instance since Value is only a partial order, so compare can't
do the right thing in some cases.
Instances
newtype CurrencySymbol Source #
ByteString representing the currency, hashed with BLAKE2b-224.
It is empty for Ada, 28 bytes for MintingPolicyHash.
Forms an AssetClass along with TokenName.
A Value is a map from CurrencySymbol's to a map from TokenName to an Integer.
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
| CurrencySymbol | |
Fields | |
Instances
ByteString of a name of a token.
Shown as hex-encoded bytes.
Should be no longer than 32 bytes, empty for Ada.
Forms an AssetClass along with a CurrencySymbol.
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
| TokenName | |
Fields | |
Instances
singleton ∷ CurrencySymbol → TokenName → Integer → Value Source #
Make a Value containing only the given quantity of the given currency.
unionWith ∷ (Integer → Integer → Integer) → Value → Value → Value Source #
Combine two Value maps with the argument function.
Assumes the well-definedness of the two maps.
adaSymbol ∷ CurrencySymbol Source #
The CurrencySymbol of the Ada currency.
Constructors
| Lovelace | |
Fields | |
Instances
newtype AssetClass Source #
An asset class, identified by a CurrencySymbol and a TokenName.
Constructors
| AssetClass | |
Fields | |
Instances
assetClass ∷ CurrencySymbol → TokenName → AssetClass Source #
The curried version of AssetClass constructor
assetClassValue ∷ AssetClass → Integer → Value Source #
A Value containing the given amount of the asset class.
assetClassValueOf ∷ Value → AssetClass → Integer Source #
Get the quantity of the given AssetClass class in the Value.
currencySymbol ∷ ByteString → CurrencySymbol Source #
Creates CurrencySymbol from raw ByteString.
currencySymbolValueOf ∷ Value → CurrencySymbol → Integer Source #
Get the total value of the currency symbol in the Value map.
Assumes that the underlying map doesn't contain duplicate keys.
Note that each token of the currency symbol may have a value that is positive, zero or negative.
flattenValue ∷ Value → [(CurrencySymbol, TokenName, Integer)] Source #
Convert a Value to a simple list, keeping only the non-zero amounts.
Note that the result isn't sorted, meaning v1 == v2 doesn't generally imply
flattenValue v1 == flattenValue v2. Additionally, the entries in the
result are listed in reverse order of the underlying data of the original ‘Value’.
For instance, the lovelace entry which ordinarily appears first in the ‘Value’
will appear last in the result.
Also assumes that there are no duplicate keys in the Value Map.
gt ∷ Value → Value → Bool Source #
Check whether one Value is strictly greater than another.
This is *not* a pointwise operation. gt l r means geq l r && not (eq l r).
lt ∷ Value → Value → Bool Source #
Check whether one Value is strictly less than another.
This is *not* a pointwise operation. lt l r means leq l r && not (eq l r).
symbols ∷ Value → [CurrencySymbol] Source #
The list of CurrencySymbols of a Value.
tokenName ∷ ByteString → TokenName Source #
Creates TokenName from raw ByteString.
unsafeLovelaceValueOf ∷ Value → Lovelace Source #
Assumes that the first token of the first currency in the Value
represents lovelace. Returns a silently wrong answer or fails if that's not
the case. It is thus much faster than lovelaceValueOf.
valueOf ∷ Value → CurrencySymbol → TokenName → Integer Source #
Get the quantity of the given currency in the Value.
Assumes that the underlying map doesn't contain duplicate keys.
withCurrencySymbol ∷ CurrencySymbol → Value → a → (Map TokenName Integer → a) → a Source #
Apply a continuation function to the token quantities of the given currency symbol in the value or return a default value if the currency symbol is not present in the value.
Mint Value
A MintValue represents assets that are minted and burned in a transaction.
Instances
Time
POSIX time is measured as the number of milliseconds since 1970-01-01T00:00:00Z.
This is not the same as Haskell's POSIXTime
Constructors
| POSIXTime | |
Fields | |
Instances
Types for representing transactions
An address may contain two credentials,
the payment credential and optionally a StakingCredential.
Constructors
| Address | |
Fields
| |
Instances
newtype PubKeyHash Source #
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
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
Constructors
Instances
A transaction output, consisting of a target address, a value, optionally a datum/datum hash, and optionally a reference script.
Constructors
| TxOut | |
Instances
A reference to a transaction output. This is a
pair of a transaction ID (TxId), and an index indicating which of the outputs
of that transaction we are referring to.
Constructors
| TxOutRef | |
Fields
| |
Instances
An input of a pending transaction.
Constructors
| TxInInfo | |
Fields | |
Instances
data OutputDatum Source #
The datum attached to an output: either nothing; a datum hash; or the datum itself (an "inline datum").
Constructors
| NoOutputDatum | |
| OutputDatumHash DatumHash | |
| OutputDatum Datum |
Instances
Intervals
An interval of as.
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 Eq instance gives equality of the intervals, not structural equality.
There is no Ord instance, but contains gives a partial order.
Note that some of the functions on Interval rely on Enum in order to
handle non-inclusive endpoints. For this reason, it may not be safe to
use Intervals with non-inclusive endpoints on types whose Enum
instances have partial methods.
Constructors
| Interval | |
Fields
| |
Instances
A set extended with a positive and negative infinity.
Instances
data UpperBound a Source #
The upper bound of an interval.
Constructors
| UpperBound (Extended a) Closure |
Instances
data LowerBound a Source #
The lower bound of an interval.
Constructors
| LowerBound (Extended a) Closure |
Instances
from ∷ a → Interval a Source #
from a is an Interval that includes all values that are
greater than or equal to a. In math. notation: [a,+∞]
to a is an Interval that includes all values that are
smaller than or equal to a. In math. notation: [-∞,a]
lowerBound ∷ a → LowerBound a Source #
Construct a lower bound from a value. The resulting bound includes all values that are equal or greater than the input value.
upperBound ∷ a → UpperBound a Source #
Construct an upper bound from a value. The resulting bound includes all values that are equal or smaller than the input value.
strictLowerBound ∷ a → LowerBound a Source #
Construct a strict lower bound from a value. The resulting bound includes all values that are (strictly) greater than the input value.
strictUpperBound ∷ a → UpperBound a Source #
Construct a strict upper bound from a value. The resulting bound includes all values that are (strictly) smaller than the input value.
inclusiveLowerBound ∷ Enum a ⇒ LowerBound a → Extended a Source #
For an enumerable type, turn an lower bound into a single inclusive bounding value.
Since the type is enumerable, non-inclusive bounds are equivalent to inclusive bounds on the successor.
See Note [Enumerable Intervals]
inclusiveUpperBound ∷ Enum a ⇒ UpperBound a → Extended a Source #
For an enumerable type, turn an upper bound into a single inclusive bounding value.
Since the type is enumerable, non-inclusive bounds are equivalent to inclusive bounds on the predecessor.
See Note [Enumerable Intervals]
Ratio
Represents an arbitrary-precision ratio.
The following two invariants are maintained:
- The denominator is greater than zero.
- The numerator and denominator are coprime.
Instances
ratio ∷ Integer → Integer → Maybe Rational Source #
Safely constructs a Rational from a numerator and a denominator. Returns
Nothing if given a zero denominator.
denominator ∷ Rational → Integer Source #
Returns the denominator of its argument. This will always be greater than, or equal to, 1, although the type does not describe this.
Note
It is not true in general that ; this
will only hold if denominator <$> ratio x y = yx and y are coprime. This is due to Rational
normalizing the numerator and denominator.
fromHaskellRatio ∷ Rational → Rational Source #
Converts a GHC Rational, preserving value.
Note: Does not work on-chain.
Association maps
A Map of key-value pairs.
A Map is considered well-defined if there are no key collisions, meaning that each value
is uniquely identified by a key.
Use safeFromList to create well-defined Maps from arbitrary lists of pairs.
If cost minimisation is required, then you can use unsafeFromList but you must
be certain that the list you are converting to a Map abides by the well-definedness condition.
Most operations on Maps are definedness-preserving, meaning that for the resulting Map to be
well-defined then the input Map(s) have to also be well-defined. This is not checked explicitly
unless mentioned in the documentation.
Take care when using fromBuiltinData and unsafeFromBuiltinData, as neither function performs
deduplication of the input collection and may create invalid Maps!
Instances
| Lift DefaultUni [(k, v)] ⇒ Lift DefaultUni (Map k v) | |
Defined in PlutusTx.AssocMap Methods lift ∷ Map k v → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source # | |
| (Lift k, Lift v) ⇒ Lift (Map k v ∷ Type) | |
| Foldable (Map k) | |
Defined in PlutusTx.AssocMap | |
| Functor (Map k) | |
| Traversable (Map k) | |
Defined in PlutusTx.AssocMap | |
| (Data k, Data v) ⇒ Data (Map k v) | |
Defined in PlutusTx.AssocMap Methods gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → Map k v → c (Map k v) Source # gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c (Map k v) Source # toConstr ∷ Map k v → Constr Source # dataTypeOf ∷ Map k v → DataType Source # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c (Map k v)) Source # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c (Map k v)) Source # gmapT ∷ (∀ b. Data b ⇒ b → b) → Map k v → Map k v Source # gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → Map k v → r Source # gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → Map k v → r Source # gmapQ ∷ (∀ d. Data d ⇒ d → u) → Map k v → [u] Source # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → Map k v → u Source # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → Map k v → m (Map k v) Source # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Map k v → m (Map k v) Source # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Map k v → m (Map k v) Source # | |
| Generic (Map k v) | |
| (Show k, Show v) ⇒ Show (Map k v) | |
| (NFData k, NFData v) ⇒ NFData (Map k v) | |
Defined in PlutusTx.AssocMap | |
| (Ord k, Eq v) ⇒ Eq (Map k v) | |
| (Ord k, Ord v) ⇒ Ord (Map k v) | |
Defined in PlutusTx.AssocMap | |
| (HasBlueprintDefinition k, HasBlueprintDefinition v) ⇒ HasBlueprintDefinition (Map k v) | |
Defined in PlutusTx.AssocMap Methods | |
| (FromData k, FromData v) ⇒ FromData (Map k v) | A hand-written transformation from |
Defined in PlutusTx.AssocMap Methods fromBuiltinData ∷ BuiltinData → Maybe (Map k v) Source # | |
| (ToData k, ToData v) ⇒ ToData (Map k v) | Hand-written instances to use the underlying |
Defined in PlutusTx.AssocMap Methods toBuiltinData ∷ Map k v → BuiltinData Source # | |
| (UnsafeFromData k, UnsafeFromData v) ⇒ UnsafeFromData (Map k v) | A hand-written transformation from |
Defined in PlutusTx.AssocMap Methods unsafeFromBuiltinData ∷ BuiltinData → Map k v Source # | |
| (Eq k, Semigroup v) ⇒ Monoid (Map k v) | |
Defined in PlutusTx.AssocMap | |
| (Eq k, Semigroup v) ⇒ Semigroup (Map k v) | |
| (Pretty k, Pretty v) ⇒ Pretty (Map k v) | |
| (HasBlueprintSchema k referencedTypes, HasBlueprintSchema v referencedTypes) ⇒ HasBlueprintSchema (Map k v) referencedTypes | |
Defined in PlutusTx.AssocMap | |
| Typeable DefaultUni Map | |
Defined in PlutusTx.AssocMap Methods typeRep ∷ Proxy Map → RTCompile DefaultUni fun (Type TyName DefaultUni ()) Source # | |
| type Rep (Map k v) | |
Defined in PlutusTx.AssocMap | |
| type Unroll (Map k v) | |
Defined in PlutusTx.AssocMap | |
unsafeFromList ∷ [(k, v)] → Map k v Source #
Unsafely create a Map from a list of pairs. This should _only_ be applied to lists which
have been checked to not contain duplicate keys, otherwise the resulting Map will contain
conflicting entries (two entries sharing the same key).
As usual, the "keys" are considered to be the first element of the pair.
Newtypes and hash types
newtype ScriptHash Source #
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
| ScriptHash | |
Fields | |
Instances
Redeemer is a wrapper around Data values that are used as redeemers in transaction inputs.
Constructors
| Redeemer | |
Fields | |
Instances
newtype RedeemerHash Source #
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
| RedeemerHash BuiltinByteString |
Instances
Datum is a wrapper around Data values which are used as data in transaction outputs.
Constructors
| Datum | |
Fields | |
Instances
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
| DatumHash BuiltinByteString |
Instances
Data
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.
Instances
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
A typeclass for types that can be converted to and from BuiltinData.
Instances
class FromData a where Source #
Methods
fromBuiltinData ∷ BuiltinData → Maybe a Source #
Convert a value from BuiltinData, returning Nothing if this fails.
Instances
class UnsafeFromData a where Source #
Methods
unsafeFromBuiltinData ∷ BuiltinData → 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
unsafeFromData ∷ UnsafeFromData a ⇒ Data → a Source #
Convert a value from Data, throwing if this fails.
Note: off-chain only.
dataToBuiltinData ∷ Data → BuiltinData Source #
NOT a builtin. Converts a Data into a BuiltinData. Only works off-chain.
builtinDataToData ∷ BuiltinData → Data Source #
NOT a builtin. Converts a BuiltinData into a Data. Only works off-chain.