| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusLedgerApi.Data.V4
Description
The data-backed type interface to Plutus V4 for the ledger.
Synopsis
- newtype AccountId = AccountId Credential
- data AccountBalanceInterval
- pattern AccountBalanceLowerBound ∷ Lovelace → AccountBalanceInterval
- pattern AccountBalanceUpperBound ∷ Lovelace → AccountBalanceInterval
- pattern AccountBalanceBothBounds ∷ Lovelace → Lovelace → AccountBalanceInterval
- pattern AccountBalanceExact ∷ Lovelace → AccountBalanceInterval
- newtype AccountBalanceIntervals = AccountBalanceIntervals (Map AccountId AccountBalanceInterval)
- newtype ColdCommitteeCredential = ColdCommitteeCredential Credential
- newtype HotCommitteeCredential = HotCommitteeCredential Credential
- newtype DRepCredential = DRepCredential Credential
- data DRep
- pattern DRep ∷ DRepCredential → DRep
- pattern DRepAlwaysAbstain ∷ DRep
- pattern DRepAlwaysNoConfidence ∷ DRep
- data Delegatee
- pattern DelegStake ∷ PubKeyHash → Delegatee
- pattern DelegVote ∷ DRep → Delegatee
- pattern DelegStakeVote ∷ PubKeyHash → DRep → Delegatee
- data TxCert
- pattern TxCertRegAccount ∷ AccountId → Lovelace → TxCert
- pattern TxCertUnRegAccount ∷ AccountId → Lovelace → TxCert
- pattern TxCertDelegAccount ∷ AccountId → Delegatee → TxCert
- pattern TxCertRegAccountDeleg ∷ AccountId → Delegatee → Lovelace → TxCert
- pattern TxCertRegDRep ∷ DRepCredential → Lovelace → TxCert
- pattern TxCertUpdateDRep ∷ DRepCredential → TxCert
- pattern TxCertUnRegDRep ∷ DRepCredential → Lovelace → TxCert
- pattern TxCertPoolRegister ∷ PubKeyHash → PubKeyHash → TxCert
- pattern TxCertPoolRetire ∷ PubKeyHash → Integer → TxCert
- pattern TxCertAuthHotCommittee ∷ ColdCommitteeCredential → HotCommitteeCredential → TxCert
- pattern TxCertResignColdCommittee ∷ ColdCommitteeCredential → TxCert
- data Voter
- pattern CommitteeVoter ∷ HotCommitteeCredential → Voter
- pattern DRepVoter ∷ DRepCredential → Voter
- pattern StakePoolVoter ∷ PubKeyHash → Voter
- data Vote
- pattern VoteNo ∷ Vote
- pattern VoteYes ∷ Vote
- pattern Abstain ∷ Vote
- data GovernanceActionId
- pattern GovernanceActionId ∷ TxId → Integer → GovernanceActionId
- gaidTxId ∷ GovernanceActionId → TxId
- gaidGovActionIx ∷ GovernanceActionId → Integer
- data Committee
- pattern Committee ∷ Map ColdCommitteeCredential Integer → Rational → Committee
- committeeMembers ∷ Committee → Map ColdCommitteeCredential Integer
- committeeQuorum ∷ Committee → Rational
- newtype Constitution = Constitution {}
- data ProtocolVersion
- pattern ProtocolVersion ∷ Integer → Integer → ProtocolVersion
- pvMajor ∷ ProtocolVersion → Integer
- pvMinor ∷ ProtocolVersion → Integer
- data GovernanceAction
- pattern ParameterChange ∷ Maybe GovernanceActionId → ChangedParameters → Maybe ScriptHash → GovernanceAction
- pattern HardForkInitiation ∷ Maybe GovernanceActionId → ProtocolVersion → GovernanceAction
- pattern TreasuryWithdrawals ∷ Map Credential Lovelace → Maybe ScriptHash → GovernanceAction
- pattern NoConfidence ∷ Maybe GovernanceActionId → GovernanceAction
- pattern UpdateCommittee ∷ Maybe GovernanceActionId → List ColdCommitteeCredential → Map ColdCommitteeCredential Integer → Rational → GovernanceAction
- pattern NewConstitution ∷ Maybe GovernanceActionId → Constitution → GovernanceAction
- pattern InfoAction ∷ GovernanceAction
- newtype ChangedParameters = ChangedParameters {}
- data ProposalProcedure
- pattern ProposalProcedure ∷ Lovelace → Credential → GovernanceAction → ProposalProcedure
- ppDeposit ∷ ProposalProcedure → Lovelace
- ppReturnAddr ∷ ProposalProcedure → Credential
- ppGovernanceAction ∷ ProposalProcedure → GovernanceAction
- data ScriptContext
- pattern ScriptContext ∷ TxInfo → Redeemer → ScriptInfo → ScriptHash → ScriptContext
- scriptContextTxInfo ∷ ScriptContext → TxInfo
- scriptContextRedeemer ∷ ScriptContext → Redeemer
- scriptContextScriptInfo ∷ ScriptContext → ScriptInfo
- scriptContextScriptHash ∷ ScriptContext → ScriptHash
- data ScriptPurpose
- pattern Minting ∷ ScriptHash → CurrencySymbol → ScriptPurpose
- pattern Spending ∷ ScriptHash → TxOutRef → ScriptPurpose
- pattern Withdrawing ∷ ScriptHash → Credential → ScriptPurpose
- pattern Certifying ∷ ScriptHash → Integer → TxCert → ScriptPurpose
- pattern Voting ∷ ScriptHash → Voter → ScriptPurpose
- pattern Proposing ∷ ScriptHash → Integer → ProposalProcedure → ScriptPurpose
- pattern Guarding ∷ ScriptHash → Integer → ScriptPurpose
- data ScriptInfo
- pattern MintingScript ∷ CurrencySymbol → ScriptInfo
- pattern SpendingScript ∷ TxOutRef → Maybe Datum → ScriptInfo
- pattern WithdrawingScript ∷ AccountId → ScriptInfo
- pattern CertifyingScript ∷ Integer → TxCert → ScriptInfo
- pattern VotingScript ∷ Voter → ScriptInfo
- pattern ProposingScript ∷ Integer → ProposalProcedure → ScriptInfo
- pattern GuardingScript ∷ Integer → Maybe TopTxInfo → ScriptInfo
- data TopTxInfo
- pattern TopTxInfo ∷ List TxInfo → Map Integer Datum → AccountBalanceIntervals → TopTxInfoSimplified → TopTxInfo
- topTxInfoSubTransactions ∷ TopTxInfo → List TxInfo
- topTxInfoDatums ∷ TopTxInfo → Map Integer Datum
- topTxInfoStartingBalanceIntervals ∷ TopTxInfo → AccountBalanceIntervals
- topTxInfoSimplified ∷ TopTxInfo → TopTxInfoSimplified
- data TopTxInfoSimplified
- pattern TopTxInfoSimplified ∷ List TxId → List TxInInfo → List TxInInfo → List TxOut → MintValue → MintValue → List TxCert → Map AccountId Lovelace → Map AccountId Lovelace → POSIXTimeRange → Map Credential () → Map ScriptPurpose () → Map DatumHash Datum → Map Voter (Map GovernanceActionId Vote) → List ProposalProcedure → Maybe Lovelace → Lovelace → TopTxInfoSimplified
- ttisIds ∷ TopTxInfoSimplified → List TxId
- ttisInputs ∷ TopTxInfoSimplified → List TxInInfo
- ttisReferenceInputs ∷ TopTxInfoSimplified → List TxInInfo
- ttisOutputs ∷ TopTxInfoSimplified → List TxOut
- ttisMints ∷ TopTxInfoSimplified → MintValue
- ttisBurns ∷ TopTxInfoSimplified → MintValue
- ttisTxCerts ∷ TopTxInfoSimplified → List TxCert
- ttisWithdrawals ∷ TopTxInfoSimplified → Map AccountId Lovelace
- ttisDirectDeposits ∷ TopTxInfoSimplified → Map AccountId Lovelace
- ttisValidRange ∷ TopTxInfoSimplified → POSIXTimeRange
- ttisGuards ∷ TopTxInfoSimplified → Map Credential ()
- ttisScriptPurposes ∷ TopTxInfoSimplified → Map ScriptPurpose ()
- ttisData ∷ TopTxInfoSimplified → Map DatumHash Datum
- ttisVotes ∷ TopTxInfoSimplified → Map Voter (Map GovernanceActionId Vote)
- ttisProposalProcedures ∷ TopTxInfoSimplified → List ProposalProcedure
- ttisCurrentTreasuryAmount ∷ TopTxInfoSimplified → Maybe Lovelace
- ttisTreasuryDonations ∷ TopTxInfoSimplified → 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
- pattern StakingHash ∷ Credential → StakingCredential
- pattern StakingPtr ∷ Integer → Integer → Integer → StakingCredential
- data Credential
- pattern PubKeyCredential ∷ PubKeyHash → Credential
- pattern ScriptCredential ∷ ScriptHash → 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 → List 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
- pattern Address ∷ Credential → Maybe StakingCredential → Address
- addressCredential ∷ Address → Credential
- addressStakingCredential ∷ Address → Maybe StakingCredential
- newtype PubKeyHash = PubKeyHash {}
- newtype TxId = TxId {}
- data TxInfo
- pattern TxInfo ∷ TxId → Maybe Integer → List TxInInfo → List TxInInfo → List TxOut → Lovelace → MintValue → List TxCert → Map AccountId Lovelace → Map AccountId Lovelace → AccountBalanceIntervals → POSIXTimeRange → List Credential → Map Credential (Maybe Datum) → Map ScriptPurpose Redeemer → Map DatumHash Datum → Map Voter (Map GovernanceActionId Vote) → List ProposalProcedure → Maybe Lovelace → Lovelace → TxInfo
- txInfoId ∷ TxInfo → TxId
- txInfoSubTxIx ∷ TxInfo → Maybe Integer
- txInfoInputs ∷ TxInfo → List TxInInfo
- txInfoReferenceInputs ∷ TxInfo → List TxInInfo
- txInfoOutputs ∷ TxInfo → List TxOut
- txInfoFee ∷ TxInfo → Lovelace
- txInfoMint ∷ TxInfo → MintValue
- txInfoTxCerts ∷ TxInfo → List TxCert
- txInfoWithdrawals ∷ TxInfo → Map AccountId Lovelace
- txInfoDirectDeposits ∷ TxInfo → Map AccountId Lovelace
- txInfoAccountBalanceIntervals ∷ TxInfo → AccountBalanceIntervals
- txInfoValidRange ∷ TxInfo → POSIXTimeRange
- txInfoGuards ∷ TxInfo → List Credential
- txInfoRequiredTopLevelGuards ∷ TxInfo → Map Credential (Maybe Datum)
- txInfoRedeemers ∷ TxInfo → Map ScriptPurpose Redeemer
- txInfoData ∷ TxInfo → Map DatumHash Datum
- txInfoVotes ∷ TxInfo → Map Voter (Map GovernanceActionId Vote)
- txInfoProposalProcedures ∷ TxInfo → List ProposalProcedure
- txInfoCurrentTreasuryAmount ∷ TxInfo → Maybe Lovelace
- txInfoTreasuryDonation ∷ TxInfo → Lovelace
- data TxOut
- pattern TxOut ∷ Address → Value → OutputDatum → Maybe ScriptHash → TxOut
- txOutAddress ∷ TxOut → Address
- txOutValue ∷ TxOut → Value
- txOutDatum ∷ TxOut → OutputDatum
- txOutReferenceScript ∷ TxOut → Maybe ScriptHash
- data TxOutRef
- pattern TxOutRef ∷ TxId → Integer → TxOutRef
- txOutRefId ∷ TxOutRef → TxId
- txOutRefIdx ∷ TxOutRef → Integer
- data TxInInfo
- pattern TxInInfo ∷ TxOutRef → TxOut → TxInInfo
- txInInfoOutRef ∷ TxInInfo → TxOutRef
- txInInfoResolved ∷ TxInInfo → TxOut
- data OutputDatum
- pattern NoOutputDatum ∷ OutputDatum
- pattern OutputDatum ∷ Datum → OutputDatum
- pattern OutputDatumHash ∷ DatumHash → OutputDatum
- data Interval a
- pattern Interval ∷ ∀ a. (ToData a, UnsafeFromData a) ⇒ LowerBound a → UpperBound a → Interval a
- ivFrom ∷ (ToData a, UnsafeFromData a) ⇒ Interval a → LowerBound a
- ivTo ∷ (ToData a, UnsafeFromData a) ⇒ Interval a → UpperBound a
- data Extended a
- pattern NegInf ∷ ∀ a. Extended a
- pattern PosInf ∷ ∀ a. Extended a
- pattern Finite ∷ ∀ a. (ToData a, UnsafeFromData a) ⇒ a → Extended a
- type Closure = Bool
- data UpperBound a
- pattern UpperBound ∷ ∀ a. (ToData a, UnsafeFromData a) ⇒ Extended a → Closure → UpperBound a
- data LowerBound a
- pattern LowerBound ∷ ∀ a. (ToData a, UnsafeFromData a) ⇒ Extended a → Closure → LowerBound a
- always ∷ (ToData a, UnsafeFromData a) ⇒ Interval a
- from ∷ (ToData a, UnsafeFromData a) ⇒ a → Interval a
- to ∷ (ToData a, UnsafeFromData a) ⇒ a → Interval a
- lowerBound ∷ (ToData a, UnsafeFromData a) ⇒ a → LowerBound a
- upperBound ∷ (ToData a, UnsafeFromData a) ⇒ a → UpperBound a
- strictLowerBound ∷ (ToData a, UnsafeFromData a) ⇒ a → LowerBound a
- strictUpperBound ∷ (ToData a, UnsafeFromData a) ⇒ a → UpperBound a
- inclusiveLowerBound ∷ (Enum a, ToData a, UnsafeFromData a) ⇒ LowerBound a → Extended a
- inclusiveUpperBound ∷ (Enum a, ToData a, UnsafeFromData 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 a
- unsafeFromSOPList ∷ (ToData k, ToData a) ⇒ [(k, a)] → Map k a
- 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 #
Instances
pattern AccountBalanceLowerBound ∷ Lovelace → AccountBalanceInterval Source #
pattern AccountBalanceUpperBound ∷ Lovelace → AccountBalanceInterval Source #
pattern AccountBalanceBothBounds ∷ Lovelace → Lovelace → AccountBalanceInterval Source #
pattern AccountBalanceExact ∷ Lovelace → AccountBalanceInterval Source #
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
Instances
pattern DRep ∷ DRepCredential → DRep Source #
pattern DRepAlwaysAbstain ∷ DRep Source #
pattern DRepAlwaysNoConfidence ∷ DRep Source #
Instances
pattern DelegStake ∷ PubKeyHash → Delegatee Source #
pattern DelegStakeVote ∷ PubKeyHash → DRep → Delegatee Source #
Instances
pattern TxCertRegDRep ∷ DRepCredential → Lovelace → TxCert Source #
pattern TxCertUpdateDRep ∷ DRepCredential → TxCert Source #
pattern TxCertUnRegDRep ∷ DRepCredential → Lovelace → TxCert Source #
pattern TxCertPoolRegister ∷ PubKeyHash → PubKeyHash → TxCert Source #
pattern TxCertPoolRetire ∷ PubKeyHash → Integer → TxCert Source #
pattern TxCertResignColdCommittee ∷ ColdCommitteeCredential → TxCert Source #
Instances
pattern CommitteeVoter ∷ HotCommitteeCredential → Voter Source #
pattern DRepVoter ∷ DRepCredential → Voter Source #
pattern StakePoolVoter ∷ PubKeyHash → Voter Source #
A vote. The optional anchor is omitted.
Instances
data GovernanceActionId Source #
Similar to TxOutRef, but for GovActions
Instances
pattern GovernanceActionId ∷ TxId → Integer → GovernanceActionId Source #
Instances
newtype Constitution Source #
A constitution. The optional anchor is omitted.
Constructors
| Constitution | |
Fields | |
Instances
data ProtocolVersion Source #
Instances
pattern ProtocolVersion ∷ Integer → Integer → ProtocolVersion Source #
data GovernanceAction Source #
Instances
pattern ParameterChange ∷ Maybe GovernanceActionId → ChangedParameters → Maybe ScriptHash → GovernanceAction Source #
pattern HardForkInitiation ∷ Maybe GovernanceActionId → ProtocolVersion → GovernanceAction Source #
pattern TreasuryWithdrawals ∷ Map Credential Lovelace → Maybe ScriptHash → GovernanceAction Source #
pattern NoConfidence ∷ Maybe GovernanceActionId → GovernanceAction Source #
pattern UpdateCommittee ∷ Maybe GovernanceActionId → List ColdCommitteeCredential → Map ColdCommitteeCredential Integer → Rational → GovernanceAction Source #
pattern NewConstitution ∷ Maybe GovernanceActionId → Constitution → GovernanceAction Source #
pattern InfoAction ∷ GovernanceAction Source #
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. -- editorconfig-checker-disable-file
Invariant: This map is non-empty, and the keys are stored in ascending order.
Constructors
| ChangedParameters | |
Fields | |
Instances
data ProposalProcedure Source #
A proposal procedure. The optional anchor is omitted.
Instances
pattern ProposalProcedure ∷ Lovelace → Credential → GovernanceAction → ProposalProcedure Source #
Context types
data ScriptContext Source #
Instances
pattern ScriptContext ∷ TxInfo → Redeemer → ScriptInfo → ScriptHash → ScriptContext Source #
data ScriptPurpose Source #
Instances
pattern Minting ∷ ScriptHash → CurrencySymbol → ScriptPurpose Source #
pattern Spending ∷ ScriptHash → TxOutRef → ScriptPurpose Source #
pattern Withdrawing ∷ ScriptHash → Credential → ScriptPurpose Source #
pattern Certifying ∷ ScriptHash → Integer → TxCert → ScriptPurpose Source #
pattern Voting ∷ ScriptHash → Voter → ScriptPurpose Source #
pattern Proposing ∷ ScriptHash → Integer → ProposalProcedure → ScriptPurpose Source #
pattern Guarding ∷ ScriptHash → Integer → ScriptPurpose Source #
data ScriptInfo Source #
Instances
pattern MintingScript ∷ CurrencySymbol → ScriptInfo Source #
pattern SpendingScript ∷ TxOutRef → Maybe Datum → ScriptInfo Source #
pattern WithdrawingScript ∷ AccountId → ScriptInfo Source #
pattern CertifyingScript ∷ Integer → TxCert → ScriptInfo Source #
pattern VotingScript ∷ Voter → ScriptInfo Source #
pattern ProposingScript ∷ Integer → ProposalProcedure → ScriptInfo Source #
pattern GuardingScript ∷ Integer → Maybe TopTxInfo → ScriptInfo Source #
Instances
pattern TopTxInfo ∷ List TxInfo → Map Integer Datum → AccountBalanceIntervals → TopTxInfoSimplified → TopTxInfo Source #
data TopTxInfoSimplified Source #
Instances
pattern TopTxInfoSimplified ∷ List TxId → List TxInInfo → List TxInInfo → List TxOut → MintValue → MintValue → List TxCert → Map AccountId Lovelace → Map AccountId Lovelace → POSIXTimeRange → Map Credential () → Map ScriptPurpose () → Map DatumHash Datum → Map Voter (Map GovernanceActionId Vote) → List ProposalProcedure → Maybe Lovelace → Lovelace → TopTxInfoSimplified Source #
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.
The staking hash constructor is the Credential required to unlock a
transaction output. Either a public key credential (PubKeyHash) or
a script credential (ScriptHash). Both are hashed with BLAKE2b-244. 28 byte.
The StakingPtr constructor is the certificate pointer, constructed by the given
slot number, transaction and certificate indices.
NB: The fields should really be all Word64, as they are implemented in Word64,
but Integer is our only integral type so we need to use it instead.
Instances
pattern StakingHash ∷ Credential → StakingCredential Source #
pattern StakingPtr ∷ Integer → Integer → Integer → StakingCredential Source #
data Credential Source #
Credentials required to unlock a transaction output.
The PubKeyCredential constructor represents the transaction that
spends this output and must be signed by the private key.
See PubKeyHash.
The ScriptCredential constructor represents the transaction that spends
this output must include the validator script and
be accepted by the validator. See ScriptHash.
Instances
pattern PubKeyCredential ∷ PubKeyHash → Credential Source #
pattern ScriptCredential ∷ ScriptHash → Credential Source #
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. -- editorconfig-checker-disable-file
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. -- editorconfig-checker-disable-file
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 #
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 → List 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.
Instances
pattern Address ∷ Credential → Maybe StakingCredential → Address Source #
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
Instances
pattern TxInfo ∷ TxId → Maybe Integer → List TxInInfo → List TxInInfo → List TxOut → Lovelace → MintValue → List TxCert → Map AccountId Lovelace → Map AccountId Lovelace → AccountBalanceIntervals → POSIXTimeRange → List Credential → Map Credential (Maybe Datum) → Map ScriptPurpose Redeemer → Map DatumHash Datum → Map Voter (Map GovernanceActionId Vote) → List ProposalProcedure → Maybe Lovelace → Lovelace → TxInfo Source #
txInfoMint ∷ TxInfo → MintValue Source #
A transaction output, consisting of a target address, a value, optionally a datum/datum hash, and optionally a reference script.
Instances
| Generic TxOut Source # | |
| Show TxOut Source # | |
| Eq TxOut Source # | |
| Eq TxOut Source # | |
| FromData TxOut Source # | |
Defined in PlutusLedgerApi.V2.Data.Tx Methods | |
| ToData TxOut Source # | |
Defined in PlutusLedgerApi.V2.Data.Tx Methods | |
| UnsafeFromData TxOut Source # | |
Defined in PlutusLedgerApi.V2.Data.Tx Methods | |
| Pretty TxOut Source # | |
| Lift DefaultUni TxOut Source # | |
Defined in PlutusLedgerApi.V2.Data.Tx Methods lift ∷ TxOut → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source # | |
| Typeable DefaultUni TxOut Source # | |
Defined in PlutusLedgerApi.V2.Data.Tx Methods typeRep ∷ Proxy TxOut → RTCompile DefaultUni fun (Type TyName DefaultUni ()) Source # | |
| type Rep TxOut Source # | |
Defined in PlutusLedgerApi.V2.Data.Tx type Rep TxOut = D1 ('MetaData "TxOut" "PlutusLedgerApi.V2.Data.Tx" "plutus-ledger-api-1.66.0.0-inplace" 'True) (C1 ('MetaCons "TxOut_6989586621680151031" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinData))) | |
pattern TxOut ∷ Address → Value → OutputDatum → Maybe ScriptHash → TxOut Source #
txOutAddress ∷ TxOut → Address Source #
txOutValue ∷ TxOut → Value Source #
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.
Instances
txOutRefId ∷ TxOutRef → TxId Source #
An input of a pending transaction.
Instances
data OutputDatum Source #
The datum attached to an output: either nothing; a datum hash; or the datum itself (an "inline datum").
Instances
pattern NoOutputDatum ∷ OutputDatum Source #
pattern OutputDatum ∷ Datum → OutputDatum Source #
pattern OutputDatumHash ∷ DatumHash → OutputDatum Source #
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.
Instances
pattern Interval ∷ ∀ a. (ToData a, UnsafeFromData a) ⇒ LowerBound a → UpperBound a → Interval a Source #
ivFrom ∷ (ToData a, UnsafeFromData a) ⇒ Interval a → LowerBound a Source #
ivTo ∷ (ToData a, UnsafeFromData a) ⇒ Interval a → UpperBound a Source #
A set extended with a positive and negative infinity.
Instances
data UpperBound a Source #
The upper bound of an interval.
Instances
pattern UpperBound ∷ ∀ a. (ToData a, UnsafeFromData a) ⇒ Extended a → Closure → UpperBound a Source #
data LowerBound a Source #
The lower bound of an interval.
Instances
pattern LowerBound ∷ ∀ a. (ToData a, UnsafeFromData a) ⇒ Extended a → Closure → LowerBound a Source #
always ∷ (ToData a, UnsafeFromData a) ⇒ Interval a Source #
An Interval that covers every slot. In math. notation [-∞,+∞]
from ∷ (ToData a, UnsafeFromData a) ⇒ 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 ∷ (ToData a, UnsafeFromData a) ⇒ a → Interval a Source #
to a is an Interval that includes all values that are
smaller than or equal to a. In math. notation: [-∞,a]
lowerBound ∷ (ToData a, UnsafeFromData a) ⇒ 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 ∷ (ToData a, UnsafeFromData a) ⇒ 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 ∷ (ToData a, UnsafeFromData a) ⇒ 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 ∷ (ToData a, UnsafeFromData a) ⇒ 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, ToData a, UnsafeFromData 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, ToData a, UnsafeFromData 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 associating keys and values backed by BuiltinData.
This implementation has the following characteristics:
- The
toBuiltinDataandunsafeFromBuiltinDataoperations are no-op. - Other operations are slower than
PlutusTx.AssocMap.Map, although equality checks on keys can be faster due toequalsData. - Many operations involve converting the keys and/or values to/from
BuiltinData.
Therefore this implementation is likely a better choice than PlutusTx.AssocMap.Map
if it is part of a data type defined using asData, and the key and value types
have efficient toBuiltinData and unsafeFromBuiltinData operations (e.g., they
are primitive types or types defined using asData).
A Map is considered well-defined if it has no duplicate keys. Most operations
preserve the definedness of the resulting Map unless otherwise noted.
It is important to observe that, in comparison to standard map implementations,
this implementation provides slow lookup and update operations because it is based
on a list representation.
Instances
| Lift DefaultUni (Map k a) | |
Defined in PlutusTx.Data.AssocMap Methods lift ∷ Map k a → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source # | |
| Show (Map k a) | |
| FromData (Map k a) | |
Defined in PlutusTx.Data.AssocMap Methods fromBuiltinData ∷ BuiltinData → Maybe (Map k a) Source # | |
| ToData (Map k a) | |
Defined in PlutusTx.Data.AssocMap Methods toBuiltinData ∷ Map k a → BuiltinData Source # | |
| UnsafeFromData (Map k a) | |
Defined in PlutusTx.Data.AssocMap Methods unsafeFromBuiltinData ∷ BuiltinData → Map k a Source # | |
| (Pretty k, Pretty a, UnsafeFromData k, UnsafeFromData a) ⇒ Pretty (Map k a) | |
| Typeable DefaultUni Map | |
Defined in PlutusTx.Data.AssocMap Methods typeRep ∷ Proxy Map → RTCompile DefaultUni fun (Type TyName DefaultUni ()) Source # | |
unsafeFromSOPList ∷ (ToData k, ToData a) ⇒ [(k, a)] → Map k a Source #
Unsafely create an Map from a sums of products 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), and therefore be ill-defined.
Warning: this requires traversing the list and encoding the keys and values, so it
should be avoided in favor of unsafeFromBuiltinList if the input is already in
BuiltinData form.
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.