Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data SimpleScriptV1
- data SimpleScriptV2
- data ZerepochScriptV1
- data ScriptLanguage lang where
- SimpleScriptLanguage ∷ SimpleScriptVersion lang → ScriptLanguage lang
- ZerepochScriptLanguage ∷ ZerepochScriptVersion lang → ScriptLanguage lang
- data SimpleScriptVersion lang where
- data ZerepochScriptVersion lang where
- data AnyScriptLanguage where
- data AnyZerepochScriptVersion where
- class HasTypeProxy lang ⇒ IsScriptLanguage lang where
- scriptLanguage ∷ ScriptLanguage lang
- class IsScriptLanguage lang ⇒ IsSimpleScriptLanguage lang where
- data Script lang where
- SimpleScript ∷ !(SimpleScriptVersion lang) → !(SimpleScript lang) → Script lang
- ZerepochScript ∷ !(ZerepochScriptVersion lang) → !(ZerepochScript lang) → Script lang
- data ScriptInAnyLang where
- ScriptInAnyLang ∷ ScriptLanguage lang → Script lang → ScriptInAnyLang
- toScriptInAnyLang ∷ Script lang → ScriptInAnyLang
- data ScriptInEra era where
- ScriptInEra ∷ ScriptLanguageInEra lang era → Script lang → ScriptInEra era
- toScriptInEra ∷ BccEra era → ScriptInAnyLang → Maybe (ScriptInEra era)
- eraOfScriptInEra ∷ ScriptInEra era → SophieBasedEra era
- data WitCtxTxIn
- data WitCtxMint
- data WitCtxStake
- data WitCtx witctx where
- data ScriptWitness witctx era where
- SimpleScriptWitness ∷ ScriptLanguageInEra lang era → SimpleScriptVersion lang → SimpleScript lang → ScriptWitness witctx era
- ZerepochScriptWitness ∷ ScriptLanguageInEra lang era → ZerepochScriptVersion lang → ZerepochScript lang → ScriptDatum witctx → ScriptRedeemer → ExecutionUnits → ScriptWitness witctx era
- data Witness witctx era where
- KeyWitness ∷ KeyWitnessInCtx witctx → Witness witctx era
- ScriptWitness ∷ ScriptWitnessInCtx witctx → ScriptWitness witctx era → Witness witctx era
- data KeyWitnessInCtx witctx where
- data ScriptWitnessInCtx witctx where
- data ScriptDatum witctx where
- type ScriptRedeemer = ScriptData
- scriptWitnessScript ∷ ScriptWitness witctx era → ScriptInEra era
- data ScriptLanguageInEra lang era where
- SimpleScriptV1InSophie ∷ ScriptLanguageInEra SimpleScriptV1 SophieEra
- SimpleScriptV1InEvie ∷ ScriptLanguageInEra SimpleScriptV1 EvieEra
- SimpleScriptV1InJen ∷ ScriptLanguageInEra SimpleScriptV1 JenEra
- SimpleScriptV1InAurum ∷ ScriptLanguageInEra SimpleScriptV1 AurumEra
- SimpleScriptV2InEvie ∷ ScriptLanguageInEra SimpleScriptV2 EvieEra
- SimpleScriptV2InJen ∷ ScriptLanguageInEra SimpleScriptV2 JenEra
- SimpleScriptV2InAurum ∷ ScriptLanguageInEra SimpleScriptV2 AurumEra
- ZerepochScriptV1InAurum ∷ ScriptLanguageInEra ZerepochScriptV1 AurumEra
- scriptLanguageSupportedInEra ∷ BccEra era → ScriptLanguage lang → Maybe (ScriptLanguageInEra lang era)
- languageOfScriptLanguageInEra ∷ ScriptLanguageInEra lang era → ScriptLanguage lang
- eraOfScriptLanguageInEra ∷ ScriptLanguageInEra lang era → SophieBasedEra era
- data SimpleScript lang where
- RequireSignature ∷ !(Hash PaymentKey) → SimpleScript lang
- RequireTimeBefore ∷ !(TimeLocksSupported lang) → !SlotNo → SimpleScript lang
- RequireTimeAfter ∷ !(TimeLocksSupported lang) → !SlotNo → SimpleScript lang
- RequireAllOf ∷ [SimpleScript lang] → SimpleScript lang
- RequireAnyOf ∷ [SimpleScript lang] → SimpleScript lang
- RequireMOf ∷ Int → [SimpleScript lang] → SimpleScript lang
- data TimeLocksSupported lang where
- timeLocksSupported ∷ SimpleScriptVersion lang → Maybe (TimeLocksSupported lang)
- adjustSimpleScriptVersion ∷ SimpleScriptVersion lang' → SimpleScript lang → Maybe (SimpleScript lang')
- data ZerepochScript lang where
- exampleZerepochScriptAlwaysSucceeds ∷ WitCtx witctx → ZerepochScript ZerepochScriptV1
- exampleZerepochScriptAlwaysFails ∷ WitCtx witctx → ZerepochScript ZerepochScriptV1
- data ScriptData
- data ExecutionUnits = ExecutionUnits {}
- newtype ScriptHash = ScriptHash (ScriptHash StandardCrypto)
- hashScript ∷ Script lang → ScriptHash
- toSophieScript ∷ ScriptInEra era → Script (SophieLedgerEra era)
- fromSophieBasedScript ∷ SophieBasedEra era → Script (SophieLedgerEra era) → ScriptInEra era
- toSophieMultiSig ∷ SimpleScript SimpleScriptV1 → MultiSig StandardCrypto
- fromSophieMultiSig ∷ MultiSig StandardCrypto → SimpleScript lang
- toEvieTimelock ∷ ∀ lang. SimpleScript lang → Timelock StandardCrypto
- fromEvieTimelock ∷ TimeLocksSupported lang → Timelock StandardCrypto → SimpleScript lang
- toAurumExUnits ∷ ExecutionUnits → ExUnits
- fromAurumExUnits ∷ ExUnits → ExecutionUnits
- toSophieScriptHash ∷ ScriptHash → ScriptHash StandardCrypto
- fromSophieScriptHash ∷ ScriptHash StandardCrypto → ScriptHash
- toZerepochData ∷ ScriptData → Data
- fromZerepochData ∷ Data → ScriptData
- toAurumData ∷ ScriptData → Data ledgerera
- fromAurumData ∷ Data ledgerera → ScriptData
- toAurumLanguage ∷ AnyZerepochScriptVersion → Language
- fromAurumLanguage ∷ Language → AnyZerepochScriptVersion
- data family AsType t
- data family Hash keyrole ∷ Type
Languages
data SimpleScriptV1 Source #
The original simple script language which supports
- require a signature from a given key (by verification key hash)
- n-way and combinator
- n-way or combinator
- m-of-n combinator
This version of the language was introduced in the SophieEra
.
Instances
HasTypeProxy SimpleScriptV1 Source # | |
Defined in Bcc.Api.Script data AsType SimpleScriptV1 Source # | |
IsSimpleScriptLanguage SimpleScriptV1 Source # | |
IsScriptLanguage SimpleScriptV1 Source # | |
Defined in Bcc.Api.Script | |
data AsType SimpleScriptV1 Source # | |
Defined in Bcc.Api.Script |
data SimpleScriptV2 Source #
The second version of the simple script language. It has all the features
of SimpleScriptV1
plus new atomic predicates:
- require the time be before a given slot number
- require the time be after a given slot number
This version of the language was introduced in the EvieEra
.
Instances
HasTypeProxy SimpleScriptV2 Source # | |
Defined in Bcc.Api.Script data AsType SimpleScriptV2 Source # | |
IsSimpleScriptLanguage SimpleScriptV2 Source # | |
IsScriptLanguage SimpleScriptV2 Source # | |
Defined in Bcc.Api.Script | |
data AsType SimpleScriptV2 Source # | |
Defined in Bcc.Api.Script |
data ZerepochScriptV1 Source #
Place holder type to show what the pattern is to extend to multiple languages, not just multiple versions of a single language.
Instances
HasTypeProxy ZerepochScriptV1 Source # | |
Defined in Bcc.Api.Script data AsType ZerepochScriptV1 Source # | |
IsScriptLanguage ZerepochScriptV1 Source # | |
Defined in Bcc.Api.Script | |
data AsType ZerepochScriptV1 Source # | |
Defined in Bcc.Api.Script |
data ScriptLanguage lang where Source #
SimpleScriptLanguage ∷ SimpleScriptVersion lang → ScriptLanguage lang | |
ZerepochScriptLanguage ∷ ZerepochScriptVersion lang → ScriptLanguage lang |
Instances
Eq (ScriptLanguage lang) Source # | |
Defined in Bcc.Api.Script (==) ∷ ScriptLanguage lang → ScriptLanguage lang → Bool Source # (/=) ∷ ScriptLanguage lang → ScriptLanguage lang → Bool Source # | |
Show (ScriptLanguage lang) Source # | |
Defined in Bcc.Api.Script | |
TestEquality ScriptLanguage Source # | |
Defined in Bcc.Api.Script testEquality ∷ ∀ (a ∷ k) (b ∷ k). ScriptLanguage a → ScriptLanguage b → Maybe (a :~: b) Source # |
data SimpleScriptVersion lang where Source #
SimpleScriptV1 ∷ SimpleScriptVersion SimpleScriptV1 | |
SimpleScriptV2 ∷ SimpleScriptVersion SimpleScriptV2 |
Instances
Eq (SimpleScriptVersion lang) Source # | |
Defined in Bcc.Api.Script (==) ∷ SimpleScriptVersion lang → SimpleScriptVersion lang → Bool Source # (/=) ∷ SimpleScriptVersion lang → SimpleScriptVersion lang → Bool Source # | |
Show (SimpleScriptVersion lang) Source # | |
Defined in Bcc.Api.Script | |
TestEquality SimpleScriptVersion Source # | |
Defined in Bcc.Api.Script testEquality ∷ ∀ (a ∷ k) (b ∷ k). SimpleScriptVersion a → SimpleScriptVersion b → Maybe (a :~: b) Source # |
data ZerepochScriptVersion lang where Source #
Instances
Eq (ZerepochScriptVersion lang) Source # | |
Defined in Bcc.Api.Script (==) ∷ ZerepochScriptVersion lang → ZerepochScriptVersion lang → Bool Source # (/=) ∷ ZerepochScriptVersion lang → ZerepochScriptVersion lang → Bool Source # | |
Show (ZerepochScriptVersion lang) Source # | |
Defined in Bcc.Api.Script | |
TestEquality ZerepochScriptVersion Source # | |
Defined in Bcc.Api.Script testEquality ∷ ∀ (a ∷ k) (b ∷ k). ZerepochScriptVersion a → ZerepochScriptVersion b → Maybe (a :~: b) Source # |
data AnyScriptLanguage where Source #
Instances
data AnyZerepochScriptVersion where Source #
Instances
class HasTypeProxy lang ⇒ IsScriptLanguage lang where Source #
scriptLanguage ∷ ScriptLanguage lang Source #
Instances
IsScriptLanguage ZerepochScriptV1 Source # | |
Defined in Bcc.Api.Script | |
IsScriptLanguage SimpleScriptV2 Source # | |
Defined in Bcc.Api.Script | |
IsScriptLanguage SimpleScriptV1 Source # | |
Defined in Bcc.Api.Script |
class IsScriptLanguage lang ⇒ IsSimpleScriptLanguage lang where Source #
Scripts in a specific language
data Script lang where Source #
A script in a particular language.
See also ScriptInAnyLang
for a script in any of the known languages.
See also ScriptInEra
for a script in a language that is available within
a particular era.
Note that some but not all scripts have an external JSON syntax, hence this
type has no JSON serialisation instances. The SimpleScript
family of
languages do have a JSON syntax and thus have ToJSON
/FromJSON
instances.
SimpleScript ∷ !(SimpleScriptVersion lang) → !(SimpleScript lang) → Script lang | |
ZerepochScript ∷ !(ZerepochScriptVersion lang) → !(ZerepochScript lang) → Script lang |
Instances
Eq (Script lang) Source # | |
Show (Script lang) Source # | |
HasTypeProxy lang ⇒ HasTypeProxy (Script lang) Source # | |
IsScriptLanguage lang ⇒ SerialiseAsCBOR (Script lang) Source # | |
Defined in Bcc.Api.Script serialiseToCBOR ∷ Script lang → ByteString Source # deserialiseFromCBOR ∷ AsType (Script lang) → ByteString → Either DecoderError (Script lang) Source # | |
IsScriptLanguage lang ⇒ HasTextEnvelope (Script lang) Source # | |
Defined in Bcc.Api.Script textEnvelopeType ∷ AsType (Script lang) → TextEnvelopeType Source # textEnvelopeDefaultDescr ∷ Script lang → TextEnvelopeDescr Source # | |
data AsType (Script lang) Source # | |
Defined in Bcc.Api.Script |
Scripts in any language
data ScriptInAnyLang where Source #
Sometimes it is necessary to handle all languages without making static type distinctions between languages. For example, when reading external input, or before the era context is known.
Use toScriptInEra
to convert to a script in the context of an era.
ScriptInAnyLang ∷ ScriptLanguage lang → Script lang → ScriptInAnyLang |
Instances
Eq ScriptInAnyLang Source # | |
Defined in Bcc.Api.Script | |
Show ScriptInAnyLang Source # | |
Defined in Bcc.Api.Script | |
HasTypeProxy ScriptInAnyLang Source # | |
Defined in Bcc.Api.Script data AsType ScriptInAnyLang Source # | |
data AsType ScriptInAnyLang Source # | |
Defined in Bcc.Api.Script |
toScriptInAnyLang ∷ Script lang → ScriptInAnyLang Source #
Convert a script in a specific statically-known language to a
ScriptInAnyLang
.
No inverse to this is provided, just do case analysis on the ScriptLanguage
field within the ScriptInAnyLang
constructor.
Scripts in an era
data ScriptInEra era where Source #
ScriptInEra ∷ ScriptLanguageInEra lang era → Script lang → ScriptInEra era |
Instances
Eq (ScriptInEra era) Source # | |
Defined in Bcc.Api.Script (==) ∷ ScriptInEra era → ScriptInEra era → Bool Source # (/=) ∷ ScriptInEra era → ScriptInEra era → Bool Source # | |
Show (ScriptInEra era) Source # | |
Defined in Bcc.Api.Script | |
HasTypeProxy era ⇒ HasTypeProxy (ScriptInEra era) Source # | |
Defined in Bcc.Api.Script data AsType (ScriptInEra era) Source # proxyToAsType ∷ Proxy (ScriptInEra era) → AsType (ScriptInEra era) Source # | |
data AsType (ScriptInEra era) Source # | |
Defined in Bcc.Api.Script |
toScriptInEra ∷ BccEra era → ScriptInAnyLang → Maybe (ScriptInEra era) Source #
Given a target era and a script in some language, check if the language is
supported in that era, and if so return a ScriptInEra
.
eraOfScriptInEra ∷ ScriptInEra era → SophieBasedEra era Source #
Use of a script in an era as a witness
data WitCtxTxIn Source #
A tag type for the context in which a script is used in a transaction.
This type tags the context as being to witness a transaction input.
data WitCtxMint Source #
A tag type for the context in which a script is used in a transaction.
This type tags the context as being to witness minting.
data WitCtxStake Source #
A tag type for the context in which a script is used in a transaction.
This type tags the context as being to witness the use of stake addresses in both certificates and withdrawals.
data WitCtx witctx where Source #
This GADT provides a value-level representation of all the witness contexts. This enables pattern matching on the context to allow them to be treated in a non-uniform way.
data ScriptWitness witctx era where Source #
A use of a script within a transaction body to witness that something is being used in an authorised manner. That can be
- spending a transaction input
- minting tokens
- using a certificate (stake address certs specifically)
- withdrawing from a reward account
For simple script languages, the use of the script is the same in all contexts. For Zerepoch scripts, using a script involves supplying a redeemer. In addition, Zerepoch scripts used for spending inputs must also supply the datum value used when originally creating the TxOut that is now being spent.
SimpleScriptWitness ∷ ScriptLanguageInEra lang era → SimpleScriptVersion lang → SimpleScript lang → ScriptWitness witctx era | |
ZerepochScriptWitness ∷ ScriptLanguageInEra lang era → ZerepochScriptVersion lang → ZerepochScript lang → ScriptDatum witctx → ScriptRedeemer → ExecutionUnits → ScriptWitness witctx era |
Instances
Eq (ScriptWitness witctx era) Source # | |
Defined in Bcc.Api.Script (==) ∷ ScriptWitness witctx era → ScriptWitness witctx era → Bool Source # (/=) ∷ ScriptWitness witctx era → ScriptWitness witctx era → Bool Source # | |
Show (ScriptWitness witctx era) Source # | |
Defined in Bcc.Api.Script |
data Witness witctx era where Source #
KeyWitness ∷ KeyWitnessInCtx witctx → Witness witctx era | |
ScriptWitness ∷ ScriptWitnessInCtx witctx → ScriptWitness witctx era → Witness witctx era |
data KeyWitnessInCtx witctx where Source #
KeyWitnessForSpending ∷ KeyWitnessInCtx WitCtxTxIn | |
KeyWitnessForStakeAddr ∷ KeyWitnessInCtx WitCtxStake |
Instances
Eq (KeyWitnessInCtx witctx) Source # | |
Defined in Bcc.Api.Script (==) ∷ KeyWitnessInCtx witctx → KeyWitnessInCtx witctx → Bool Source # (/=) ∷ KeyWitnessInCtx witctx → KeyWitnessInCtx witctx → Bool Source # | |
Show (KeyWitnessInCtx witctx) Source # | |
Defined in Bcc.Api.Script |
data ScriptWitnessInCtx witctx where Source #
ScriptWitnessForSpending ∷ ScriptWitnessInCtx WitCtxTxIn | |
ScriptWitnessForMinting ∷ ScriptWitnessInCtx WitCtxMint | |
ScriptWitnessForStakeAddr ∷ ScriptWitnessInCtx WitCtxStake |
Instances
Eq (ScriptWitnessInCtx witctx) Source # | |
Defined in Bcc.Api.Script (==) ∷ ScriptWitnessInCtx witctx → ScriptWitnessInCtx witctx → Bool Source # (/=) ∷ ScriptWitnessInCtx witctx → ScriptWitnessInCtx witctx → Bool Source # | |
Show (ScriptWitnessInCtx witctx) Source # | |
Defined in Bcc.Api.Script |
data ScriptDatum witctx where Source #
ScriptDatumForTxIn ∷ ScriptData → ScriptDatum WitCtxTxIn | |
NoScriptDatumForMint ∷ ScriptDatum WitCtxMint | |
NoScriptDatumForStake ∷ ScriptDatum WitCtxStake |
Instances
Eq (ScriptDatum witctx) Source # | |
Defined in Bcc.Api.Script (==) ∷ ScriptDatum witctx → ScriptDatum witctx → Bool Source # (/=) ∷ ScriptDatum witctx → ScriptDatum witctx → Bool Source # | |
Show (ScriptDatum witctx) Source # | |
Defined in Bcc.Api.Script |
type ScriptRedeemer = ScriptData Source #
scriptWitnessScript ∷ ScriptWitness witctx era → ScriptInEra era Source #
Languages supported in each era
data ScriptLanguageInEra lang era where Source #
Instances
Eq (ScriptLanguageInEra lang era) Source # | |
Defined in Bcc.Api.Script (==) ∷ ScriptLanguageInEra lang era → ScriptLanguageInEra lang era → Bool Source # (/=) ∷ ScriptLanguageInEra lang era → ScriptLanguageInEra lang era → Bool Source # | |
Show (ScriptLanguageInEra lang era) Source # | |
Defined in Bcc.Api.Script |
scriptLanguageSupportedInEra ∷ BccEra era → ScriptLanguage lang → Maybe (ScriptLanguageInEra lang era) Source #
Check if a given script language is supported in a given era, and if so return the evidence.
languageOfScriptLanguageInEra ∷ ScriptLanguageInEra lang era → ScriptLanguage lang Source #
eraOfScriptLanguageInEra ∷ ScriptLanguageInEra lang era → SophieBasedEra era Source #
The simple script language
data SimpleScript lang where Source #
RequireSignature ∷ !(Hash PaymentKey) → SimpleScript lang | |
RequireTimeBefore ∷ !(TimeLocksSupported lang) → !SlotNo → SimpleScript lang | |
RequireTimeAfter ∷ !(TimeLocksSupported lang) → !SlotNo → SimpleScript lang | |
RequireAllOf ∷ [SimpleScript lang] → SimpleScript lang | |
RequireAnyOf ∷ [SimpleScript lang] → SimpleScript lang | |
RequireMOf ∷ Int → [SimpleScript lang] → SimpleScript lang |
Instances
Eq (SimpleScript lang) Source # | |
Defined in Bcc.Api.Script (==) ∷ SimpleScript lang → SimpleScript lang → Bool Source # (/=) ∷ SimpleScript lang → SimpleScript lang → Bool Source # | |
Show (SimpleScript lang) Source # | |
Defined in Bcc.Api.Script | |
IsSimpleScriptLanguage lang ⇒ FromJSON (SimpleScript lang) Source # | |
Defined in Bcc.Api.Script parseJSON ∷ Value → Parser (SimpleScript lang) # parseJSONList ∷ Value → Parser [SimpleScript lang] # | |
ToJSON (SimpleScript lang) Source # | |
Defined in Bcc.Api.Script toJSON ∷ SimpleScript lang → Value # toEncoding ∷ SimpleScript lang → Encoding # toJSONList ∷ [SimpleScript lang] → Value # toEncodingList ∷ [SimpleScript lang] → Encoding # | |
HasTypeProxy lang ⇒ HasTypeProxy (SimpleScript lang) Source # | |
Defined in Bcc.Api.Script data AsType (SimpleScript lang) Source # proxyToAsType ∷ Proxy (SimpleScript lang) → AsType (SimpleScript lang) Source # | |
data AsType (SimpleScript lang) Source # | |
Defined in Bcc.Api.Script |
data TimeLocksSupported lang where Source #
Time lock feature in the SimpleScript
language.
The constructors of this type serve as evidence that the timelocks feature is supported in particular versions of the language.
Instances
Eq (TimeLocksSupported lang) Source # | |
Defined in Bcc.Api.Script (==) ∷ TimeLocksSupported lang → TimeLocksSupported lang → Bool Source # (/=) ∷ TimeLocksSupported lang → TimeLocksSupported lang → Bool Source # | |
Show (TimeLocksSupported lang) Source # | |
Defined in Bcc.Api.Script |
timeLocksSupported ∷ SimpleScriptVersion lang → Maybe (TimeLocksSupported lang) Source #
adjustSimpleScriptVersion ∷ SimpleScriptVersion lang' → SimpleScript lang → Maybe (SimpleScript lang') Source #
Try converting the SimpleScript
into a different version of the language.
This will work when the script only uses the features of the target language
version. For example converting from SimpleScriptV2
to SimpleScriptV1
will work if the script happens not to use time locks feature. On the other
hand converting SimpleScriptV1
to SimpleScriptV2
will always work because
it is backwards compatible.
The Zerepoch script language
data ZerepochScript lang where Source #
Zerepoch scripts.
Note that Zerepoch scripts have a binary serialisation but no JSON serialisation.
Instances
exampleZerepochScriptAlwaysSucceeds ∷ WitCtx witctx → ZerepochScript ZerepochScriptV1 Source #
An example Zerepoch script that always succeeds, irrespective of inputs.
For example, if one were to use this for a payment address then it would allow anyone to spend from it.
The exact script depends on the context in which it is to be used.
exampleZerepochScriptAlwaysFails ∷ WitCtx witctx → ZerepochScript ZerepochScriptV1 Source #
An example Zerepoch script that always fails, irrespective of inputs.
For example, if one were to use this for a payment address then it would be impossible for anyone to ever spend from it.
The exact script depends on the context in which it is to be used.
Script data
data ScriptData Source #
ScriptDataConstructor Integer [ScriptData] | |
ScriptDataMap [(ScriptData, ScriptData)] | |
ScriptDataList [ScriptData] | |
ScriptDataNumber Integer | |
ScriptDataBytes ByteString |
Instances
Script execution units
data ExecutionUnits Source #
The units for how long a script executes for and how much memory it uses. This is used to declare the resources used by a particular use of a script.
This type is also used to describe the limits for the maximum overall execution units per transaction or per block.
ExecutionUnits | |
|
Instances
Eq ExecutionUnits Source # | |
Defined in Bcc.Api.Script (==) ∷ ExecutionUnits → ExecutionUnits → Bool Source # (/=) ∷ ExecutionUnits → ExecutionUnits → Bool Source # | |
Show ExecutionUnits Source # | |
Defined in Bcc.Api.Script | |
FromJSON ExecutionUnits Source # | |
Defined in Bcc.Api.Script parseJSON ∷ Value → Parser ExecutionUnits # parseJSONList ∷ Value → Parser [ExecutionUnits] # | |
ToJSON ExecutionUnits Source # | |
Defined in Bcc.Api.Script toJSON ∷ ExecutionUnits → Value # toEncoding ∷ ExecutionUnits → Encoding # toJSONList ∷ [ExecutionUnits] → Value # toEncodingList ∷ [ExecutionUnits] → Encoding # | |
FromCBOR ExecutionUnits Source # | |
Defined in Bcc.Api.Script fromCBOR ∷ Decoder s ExecutionUnits # label ∷ Proxy ExecutionUnits → Text # | |
ToCBOR ExecutionUnits Source # | |
Defined in Bcc.Api.Script toCBOR ∷ ExecutionUnits → Encoding # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ExecutionUnits → Size # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ExecutionUnits] → Size # |
Script hashes
newtype ScriptHash Source #
We have this type separate from the Hash
type to avoid the script
hash type being parametrised by the era. The representation is era
independent, and there are many places where we want to use a script
hash where we don't want things to be era-parametrised.
ScriptHash (ScriptHash StandardCrypto) |
Instances
hashScript ∷ Script lang → ScriptHash Source #
Internal conversion functions
toSophieScript ∷ ScriptInEra era → Script (SophieLedgerEra era) Source #
fromSophieBasedScript ∷ SophieBasedEra era → Script (SophieLedgerEra era) → ScriptInEra era Source #
toSophieMultiSig ∷ SimpleScript SimpleScriptV1 → MultiSig StandardCrypto Source #
Conversion for the MultiSig
language used by the Sophie era.
fromSophieMultiSig ∷ MultiSig StandardCrypto → SimpleScript lang Source #
Conversion for the MultiSig
language used by the Sophie era.
toEvieTimelock ∷ ∀ lang. SimpleScript lang → Timelock StandardCrypto Source #
Conversion for the Timelock
language that is shared between the
Evie and Jen eras.
fromEvieTimelock ∷ TimeLocksSupported lang → Timelock StandardCrypto → SimpleScript lang Source #
Conversion for the Timelock
language that is shared between the
Evie and Jen eras.
toAurumExUnits ∷ ExecutionUnits → ExUnits Source #
fromAurumExUnits ∷ ExUnits → ExecutionUnits Source #
toSophieScriptHash ∷ ScriptHash → ScriptHash StandardCrypto Source #
fromSophieScriptHash ∷ ScriptHash StandardCrypto → ScriptHash Source #
toZerepochData ∷ ScriptData → Data Source #
fromZerepochData ∷ Data → ScriptData Source #
toAurumData ∷ ScriptData → Data ledgerera Source #
fromAurumData ∷ Data ledgerera → ScriptData Source #
toAurumLanguage ∷ AnyZerepochScriptVersion → Language Source #
fromAurumLanguage ∷ Language → AnyZerepochScriptVersion Source #
Data family instances
A family of singleton types used in this API to indicate which type to use where it would otherwise be ambiguous or merely unclear.
Values of this type are passed to deserialisation functions for example.
Instances
data family Hash keyrole ∷ Type Source #