Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- type GYValidator v = GYScript v
- validatorFromPlutus ∷ ∀ v a. SingPlutusVersionI v ⇒ CompiledCode a → GYValidator v
- validatorFromSerialisedScript ∷ ∀ v. SingPlutusVersionI v ⇒ SerialisedScript → GYValidator v
- validatorToSerialisedScript ∷ GYValidator v → SerialisedScript
- validatorToApi ∷ GYValidator v → PlutusScript (PlutusVersionToApi v)
- validatorFromApi ∷ ∀ v. SingPlutusVersionI v ⇒ PlutusScript (PlutusVersionToApi v) → GYValidator v
- validatorToApiPlutusScriptWitness ∷ GYValidator v → ScriptDatum WitCtxTxIn → ScriptRedeemer → ExecutionUnits → ScriptWitness WitCtxTxIn ApiEra
- writeValidator ∷ FilePath → GYValidator v → IO ()
- readValidator ∷ SingPlutusVersionI v ⇒ FilePath → IO (GYValidator v)
- validatorHash ∷ GYValidator v → GYScriptHash
- validatorPlutusHash ∷ GYValidator v → ScriptHash
- validatorApiHash ∷ GYValidator v → ScriptHash
- validatorVersion ∷ GYValidator v → SingPlutusVersion v
- type GYValidatorHash = GYScriptHash
- validatorHashToApi ∷ GYValidatorHash → ScriptHash
- validatorHashToPlutus ∷ GYValidatorHash → ScriptHash
- validatorHashFromApi ∷ ScriptHash → GYValidatorHash
- validatorHashFromPlutus ∷ ScriptHash → Either PlutusToCardanoError GYValidatorHash
- data GYScriptHash
- scriptHashFromApi ∷ ScriptHash → GYScriptHash
- scriptHashToApi ∷ GYScriptHash → ScriptHash
- scriptHashFromLedger ∷ ScriptHash StandardCrypto → GYScriptHash
- scriptHashToLedger ∷ GYScriptHash → ScriptHash StandardCrypto
- scriptHashToPlutus ∷ GYScriptHash → ScriptHash
- type GYMintingPolicy v = GYScript v
- mintingPolicyId ∷ GYMintingPolicy v → GYMintingPolicyId
- mintingPolicyVersion ∷ GYMintingPolicy v → SingPlutusVersion v
- mintingPolicyVersionFromWitness ∷ GYMintScript v → PlutusVersion
- mintingPolicyFromPlutus ∷ ∀ v a. SingPlutusVersionI v ⇒ CompiledCode a → GYMintingPolicy v
- mintingPolicyFromSerialisedScript ∷ ∀ v. SingPlutusVersionI v ⇒ SerialisedScript → GYMintingPolicy v
- mintingPolicyToSerialisedScript ∷ GYMintingPolicy v → SerialisedScript
- mintingPolicyToApi ∷ GYMintingPolicy v → PlutusScript (PlutusVersionToApi v)
- mintingPolicyIdToText ∷ GYMintingPolicyId → Text
- mintingPolicyIdFromText ∷ Text → Either String GYMintingPolicyId
- mintingPolicyFromApi ∷ ∀ v. SingPlutusVersionI v ⇒ PlutusScript (PlutusVersionToApi v) → GYMintingPolicy v
- mintingPolicyToApiPlutusScriptWitness ∷ GYMintingPolicy v → ScriptRedeemer → ExecutionUnits → ScriptWitness WitCtxMint ApiEra
- data GYMintScript (u ∷ PlutusVersion) where
- GYMintScript ∷ v `VersionIsGreaterOrEqual` u ⇒ GYScript v → GYMintScript u
- GYMintReference ∷ v `VersionIsGreaterOrEqual` 'PlutusV2 ⇒ !GYTxOutRef → !(GYScript v) → GYMintScript v
- mintingPolicyIdFromWitness ∷ GYMintScript v → GYMintingPolicyId
- gyMintScriptToSerialisedScript ∷ GYMintScript u → SerialisedScript
- gyMintingScriptWitnessToApiPlutusSW ∷ GYMintScript u → ScriptRedeemer → ExecutionUnits → ScriptWitness WitCtxMint ApiEra
- writeMintingPolicy ∷ FilePath → GYMintingPolicy v → IO ()
- readMintingPolicy ∷ SingPlutusVersionI v ⇒ FilePath → IO (GYMintingPolicy v)
- mintingPolicyCurrencySymbol ∷ GYMintingPolicy v → CurrencySymbol
- mintingPolicyApiId ∷ GYMintingPolicy v → PolicyId
- mintingPolicyApiIdFromWitness ∷ GYMintScript v → PolicyId
- data GYMintingPolicyId
- mintingPolicyIdToApi ∷ GYMintingPolicyId → PolicyId
- mintingPolicyIdFromApi ∷ PolicyId → GYMintingPolicyId
- mintingPolicyIdToCurrencySymbol ∷ GYMintingPolicyId → CurrencySymbol
- mintingPolicyIdFromCurrencySymbol ∷ CurrencySymbol → Either PlutusToCardanoError GYMintingPolicyId
- mintingPolicyIdCurrencySymbol ∷ GYMintingPolicyId → CurrencySymbol
- type GYStakeValidator v = GYScript v
- stakeValidatorVersion ∷ GYStakeValidator v → SingPlutusVersion v
- stakeValidatorVersionFromWitness ∷ GYStakeValScript v → PlutusVersion
- stakeValidatorFromPlutus ∷ ∀ v a. SingPlutusVersionI v ⇒ CompiledCode a → GYStakeValidator v
- stakeValidatorFromSerialisedScript ∷ ∀ v. SingPlutusVersionI v ⇒ SerialisedScript → GYStakeValidator v
- stakeValidatorToSerialisedScript ∷ GYStakeValidator v → SerialisedScript
- stakeValidatorToApi ∷ GYStakeValidator v → PlutusScript (PlutusVersionToApi v)
- stakeValidatorFromApi ∷ ∀ v. SingPlutusVersionI v ⇒ PlutusScript (PlutusVersionToApi v) → GYStakeValidator v
- stakeValidatorToApiPlutusScriptWitness ∷ GYStakeValidator v → ScriptRedeemer → ExecutionUnits → ScriptWitness WitCtxStake ApiEra
- data GYStakeValScript (u ∷ PlutusVersion) where
- GYStakeValScript ∷ v `VersionIsGreaterOrEqual` u ⇒ GYScript v → GYStakeValScript u
- GYStakeValReference ∷ v `VersionIsGreaterOrEqual` 'PlutusV2 ⇒ !GYTxOutRef → !(GYScript v) → GYStakeValScript v
- gyStakeValScriptToSerialisedScript ∷ GYStakeValScript u → SerialisedScript
- gyStakeValScriptWitnessToApiPlutusSW ∷ GYStakeValScript u → ScriptRedeemer → ExecutionUnits → ScriptWitness WitCtxStake ApiEra
- stakeValidatorHash ∷ GYStakeValidator v → GYScriptHash
- stakeValidatorPlutusHash ∷ GYStakeValidator v → ScriptHash
- stakeValidatorApiHash ∷ GYStakeValidator v → ScriptHash
- type GYStakeValidatorHash = GYScriptHash
- stakeValidatorHashToApi ∷ GYStakeValidatorHash → ScriptHash
- stakeValidatorHashToPlutus ∷ GYStakeValidatorHash → ScriptHash
- stakeValidatorHashFromApi ∷ ScriptHash → GYStakeValidatorHash
- stakeValidatorHashFromPlutus ∷ ScriptHash → Either PlutusToCardanoError GYStakeValidatorHash
- writeStakeValidator ∷ FilePath → GYStakeValidator v → IO ()
- readStakeValidator ∷ SingPlutusVersionI v ⇒ FilePath → IO (GYStakeValidator v)
- data GYScript (v ∷ PlutusVersion)
- scriptHash ∷ GYScript v → GYScriptHash
- hashScript ∷ GYScript v → GYScriptHash
- scriptVersion ∷ GYScript v → SingPlutusVersion v
- validatorToScript ∷ GYValidator v → GYScript v
- mintingPolicyToScript ∷ GYMintingPolicy v → GYScript v
- stakeValidatorToScript ∷ GYStakeValidator v → GYScript v
- scriptToApi ∷ GYScript v → PlutusScript (PlutusVersionToApi v)
- scriptFromCBOR ∷ ∀ v. SingPlutusVersionI v ⇒ Text → Maybe (GYScript v)
- scriptFromCBOR' ∷ ∀ v. SingPlutusVersionI v ⇒ ByteString → Maybe (GYScript v)
- scriptFromPlutus ∷ ∀ v a. SingPlutusVersionI v ⇒ CompiledCode a → GYScript v
- scriptFromSerialisedScript ∷ ∀ v. SingPlutusVersionI v ⇒ SerialisedScript → GYScript v
- scriptToSerialisedScript ∷ GYScript v → ShortByteString
- scriptApiHash ∷ GYScript v → ScriptHash
- scriptPlutusHash ∷ GYScript v → ScriptHash
- someScriptPlutusHash ∷ Some GYScript → ScriptHash
- someScriptToReferenceApi ∷ GYAnyScript → ReferenceScript ApiEra
- someScriptFromReferenceApi ∷ ReferenceScript era → Maybe GYAnyScript
- referenceScriptToApiPlutusScriptWitness ∷ VersionIsGreaterOrEqual v 'PlutusV2 ⇒ GYTxOutRef → GYScript v → ScriptDatum witctx → ScriptRedeemer → ExecutionUnits → ScriptWitness witctx ApiEra
- apiHashToPlutus ∷ ScriptHash → ScriptHash
- scriptSize ∷ GYAnyScript → Int
- writeScript ∷ ∀ v. FilePath → GYScript v → IO ()
- readScript ∷ ∀ v. SingPlutusVersionI v ⇒ FilePath → IO (GYScript v)
- data GYAnyScript where
- GYSimpleScript ∷ !GYSimpleScript → GYAnyScript
- GYPlutusScript ∷ ∀ v. !(GYScript v) → GYAnyScript
- hashAnyScript ∷ GYAnyScript → GYScriptHash
- anyScriptToApiScriptInEra ∷ GYAnyScript → ScriptInEra ApiEra
- module GeniusYield.Types.Script.SimpleScript
Validator
type GYValidator v = GYScript v #
Deprecated: Use GYScript.
validatorFromPlutus ∷ ∀ v a. SingPlutusVersionI v ⇒ CompiledCode a → GYValidator v #
validatorFromSerialisedScript ∷ ∀ v. SingPlutusVersionI v ⇒ SerialisedScript → GYValidator v #
validatorToApi ∷ GYValidator v → PlutusScript (PlutusVersionToApi v) #
validatorFromApi ∷ ∀ v. SingPlutusVersionI v ⇒ PlutusScript (PlutusVersionToApi v) → GYValidator v #
validatorToApiPlutusScriptWitness ∷ GYValidator v → ScriptDatum WitCtxTxIn → ScriptRedeemer → ExecutionUnits → ScriptWitness WitCtxTxIn ApiEra #
File operations
writeValidator ∷ FilePath → GYValidator v → IO () #
Writes a validator to a file.
readValidator ∷ SingPlutusVersionI v ⇒ FilePath → IO (GYValidator v) #
Reads a validator from a file.
Selectors
ValidatorHash
type GYValidatorHash = GYScriptHash #
Deprecated: Use GYScriptHash.
validatorHashFromPlutus ∷ ScriptHash → Either PlutusToCardanoError GYValidatorHash #
>>>
validatorHashFromPlutus "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0"
Right (GYScriptHash "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0")
>>>
validatorHashFromPlutus "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7"
Left (DeserialiseRawBytesError {ptceTag = "validatorHashFromPlutus: cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7, error: SerialiseAsRawBytesError {unSerialiseAsRawBytesError = \"Unable to deserialise ScriptHash\"}"})
ScriptHash
data GYScriptHash #
Instances
scriptHashFromLedger ∷ ScriptHash StandardCrypto → GYScriptHash #
Convert from corresponding ledger representation.
scriptHashToLedger ∷ GYScriptHash → ScriptHash StandardCrypto #
Convert to corresponding ledger representation.
MintingPolicy
type GYMintingPolicy v = GYScript v #
Deprecated: Use GYScript.
mintingPolicyFromPlutus ∷ ∀ v a. SingPlutusVersionI v ⇒ CompiledCode a → GYMintingPolicy v #
mintingPolicyFromSerialisedScript ∷ ∀ v. SingPlutusVersionI v ⇒ SerialisedScript → GYMintingPolicy v #
mintingPolicyFromApi ∷ ∀ v. SingPlutusVersionI v ⇒ PlutusScript (PlutusVersionToApi v) → GYMintingPolicy v #
mintingPolicyToApiPlutusScriptWitness ∷ GYMintingPolicy v → ScriptRedeemer → ExecutionUnits → ScriptWitness WitCtxMint ApiEra #
Witness for Minting Policy
data GYMintScript (u ∷ PlutusVersion) where #
GYMintScript ∷ v `VersionIsGreaterOrEqual` u ⇒ GYScript v → GYMintScript u |
|
GYMintReference ∷ v `VersionIsGreaterOrEqual` 'PlutusV2 ⇒ !GYTxOutRef → !(GYScript v) → GYMintScript v | Reference inputs can be only used in V2 transactions. |
Instances
Show (GYMintScript v) # | |
Defined in GeniusYield.Types.Script showsPrec ∷ Int → GYMintScript v → ShowS # show ∷ GYMintScript v → String # showList ∷ [GYMintScript v] → ShowS # | |
Eq (GYMintScript v) # | |
Defined in GeniusYield.Types.Script (==) ∷ GYMintScript v → GYMintScript v → Bool # (/=) ∷ GYMintScript v → GYMintScript v → Bool # | |
Ord (GYMintScript v) # | |
Defined in GeniusYield.Types.Script compare ∷ GYMintScript v → GYMintScript v → Ordering # (<) ∷ GYMintScript v → GYMintScript v → Bool # (<=) ∷ GYMintScript v → GYMintScript v → Bool # (>) ∷ GYMintScript v → GYMintScript v → Bool # (>=) ∷ GYMintScript v → GYMintScript v → Bool # max ∷ GYMintScript v → GYMintScript v → GYMintScript v # min ∷ GYMintScript v → GYMintScript v → GYMintScript v # |
gyMintingScriptWitnessToApiPlutusSW ∷ GYMintScript u → ScriptRedeemer → ExecutionUnits → ScriptWitness WitCtxMint ApiEra #
File operations
writeMintingPolicy ∷ FilePath → GYMintingPolicy v → IO () #
Writes a minting policy to a file.
readMintingPolicy ∷ SingPlutusVersionI v ⇒ FilePath → IO (GYMintingPolicy v) #
Reads a minting policy from a file.
Selectors
MintingPolicyId
data GYMintingPolicyId #
Minting policy identifier, also a currency symbol.
Instances
mintingPolicyIdFromCurrencySymbol ∷ CurrencySymbol → Either PlutusToCardanoError GYMintingPolicyId #
>>>
mintingPolicyIdFromCurrencySymbol $ mintingPolicyIdToCurrencySymbol "ff80aaaf03a273b8f5c558168dc0e2377eea810badbae6eceefc14ef"
Right "ff80aaaf03a273b8f5c558168dc0e2377eea810badbae6eceefc14ef"
mintingPolicyIdCurrencySymbol ∷ GYMintingPolicyId → CurrencySymbol #
Deprecated: Use mintingPolicyIdToCurrencySymbol.
StakeValidator
type GYStakeValidator v = GYScript v #
Deprecated: Use GYScript.
stakeValidatorFromPlutus ∷ ∀ v a. SingPlutusVersionI v ⇒ CompiledCode a → GYStakeValidator v #
stakeValidatorFromSerialisedScript ∷ ∀ v. SingPlutusVersionI v ⇒ SerialisedScript → GYStakeValidator v #
stakeValidatorFromApi ∷ ∀ v. SingPlutusVersionI v ⇒ PlutusScript (PlutusVersionToApi v) → GYStakeValidator v #
stakeValidatorToApiPlutusScriptWitness ∷ GYStakeValidator v → ScriptRedeemer → ExecutionUnits → ScriptWitness WitCtxStake ApiEra #
Witness for stake validator
data GYStakeValScript (u ∷ PlutusVersion) where #
GYStakeValScript ∷ v `VersionIsGreaterOrEqual` u ⇒ GYScript v → GYStakeValScript u |
|
GYStakeValReference ∷ v `VersionIsGreaterOrEqual` 'PlutusV2 ⇒ !GYTxOutRef → !(GYScript v) → GYStakeValScript v | Reference inputs can be only used in V2 transactions. |
Instances
Show (GYStakeValScript v) # | |
Defined in GeniusYield.Types.Script showsPrec ∷ Int → GYStakeValScript v → ShowS # show ∷ GYStakeValScript v → String # showList ∷ [GYStakeValScript v] → ShowS # | |
Eq (GYStakeValScript v) # | |
Defined in GeniusYield.Types.Script (==) ∷ GYStakeValScript v → GYStakeValScript v → Bool # (/=) ∷ GYStakeValScript v → GYStakeValScript v → Bool # | |
Ord (GYStakeValScript v) # | |
Defined in GeniusYield.Types.Script compare ∷ GYStakeValScript v → GYStakeValScript v → Ordering # (<) ∷ GYStakeValScript v → GYStakeValScript v → Bool # (<=) ∷ GYStakeValScript v → GYStakeValScript v → Bool # (>) ∷ GYStakeValScript v → GYStakeValScript v → Bool # (>=) ∷ GYStakeValScript v → GYStakeValScript v → Bool # max ∷ GYStakeValScript v → GYStakeValScript v → GYStakeValScript v # min ∷ GYStakeValScript v → GYStakeValScript v → GYStakeValScript v # |
gyStakeValScriptWitnessToApiPlutusSW ∷ GYStakeValScript u → ScriptRedeemer → ExecutionUnits → ScriptWitness WitCtxStake ApiEra #
Stake validator selectors
StakeValidatorHash
type GYStakeValidatorHash = GYScriptHash #
Deprecated: Use GYScriptHash.
stakeValidatorHashFromPlutus ∷ ScriptHash → Either PlutusToCardanoError GYStakeValidatorHash #
>>>
stakeValidatorHashFromPlutus "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0"
Right (GYScriptHash "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0")
>>>
stakeValidatorHashFromPlutus "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7"
Left (DeserialiseRawBytesError {ptceTag = "stakeValidatorHashFromPlutus: cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7, error: SerialiseAsRawBytesError {unSerialiseAsRawBytesError = \"Unable to deserialise ScriptHash\"}"})
File operations
writeStakeValidator ∷ FilePath → GYStakeValidator v → IO () #
Writes a stake validator to a file.
readStakeValidator ∷ SingPlutusVersionI v ⇒ FilePath → IO (GYStakeValidator v) #
Reads a stake validator from a file.
Script
data GYScript (v ∷ PlutusVersion) #
Plutus script
Instances
GCompare GYScript # | |
GEq GYScript # | |
GShow GYScript # | |
Defined in GeniusYield.Types.Script gshowsPrec ∷ ∀ (a ∷ k). Int → GYScript a → ShowS # | |
Show (GYScript v) # | |
Eq (GYScript v) # | Equality and comparison are on script hash. As hash is cryptographicly strong, and |
Ord (GYScript v) # | |
Defined in GeniusYield.Types.Script |
scriptHash ∷ GYScript v → GYScriptHash #
hashScript ∷ GYScript v → GYScriptHash #
Deprecated: Use scriptHash.
scriptVersion ∷ GYScript v → SingPlutusVersion v #
validatorToScript ∷ GYValidator v → GYScript v #
scriptToApi ∷ GYScript v → PlutusScript (PlutusVersionToApi v) #
scriptFromCBOR ∷ ∀ v. SingPlutusVersionI v ⇒ Text → Maybe (GYScript v) #
scriptFromCBOR' ∷ ∀ v. SingPlutusVersionI v ⇒ ByteString → Maybe (GYScript v) #
scriptFromPlutus ∷ ∀ v a. SingPlutusVersionI v ⇒ CompiledCode a → GYScript v #
scriptFromSerialisedScript ∷ ∀ v. SingPlutusVersionI v ⇒ SerialisedScript → GYScript v #
scriptApiHash ∷ GYScript v → ScriptHash #
scriptPlutusHash ∷ GYScript v → ScriptHash #
referenceScriptToApiPlutusScriptWitness ∷ VersionIsGreaterOrEqual v 'PlutusV2 ⇒ GYTxOutRef → GYScript v → ScriptDatum witctx → ScriptRedeemer → ExecutionUnits → ScriptWitness witctx ApiEra #
scriptSize ∷ GYAnyScript → Int #
File operations
writeScript ∷ ∀ v. FilePath → GYScript v → IO () #
Writes a script to a file.
readScript ∷ ∀ v. SingPlutusVersionI v ⇒ FilePath → IO (GYScript v) #
Reads a script from a file.
Any Script
data GYAnyScript where #
Type encapsulating both simple and plutus scripts.
GYSimpleScript ∷ !GYSimpleScript → GYAnyScript | |
GYPlutusScript ∷ ∀ v. !(GYScript v) → GYAnyScript |
Instances
Show GYAnyScript # | |
Defined in GeniusYield.Types.Script showsPrec ∷ Int → GYAnyScript → ShowS # show ∷ GYAnyScript → String # showList ∷ [GYAnyScript] → ShowS # | |
Eq GYAnyScript # | |
Defined in GeniusYield.Types.Script (==) ∷ GYAnyScript → GYAnyScript → Bool # (/=) ∷ GYAnyScript → GYAnyScript → Bool # | |
Ord GYAnyScript # | |
Defined in GeniusYield.Types.Script compare ∷ GYAnyScript → GYAnyScript → Ordering # (<) ∷ GYAnyScript → GYAnyScript → Bool # (<=) ∷ GYAnyScript → GYAnyScript → Bool # (>) ∷ GYAnyScript → GYAnyScript → Bool # (>=) ∷ GYAnyScript → GYAnyScript → Bool # max ∷ GYAnyScript → GYAnyScript → GYAnyScript # min ∷ GYAnyScript → GYAnyScript → GYAnyScript # |