atlas-cardano-0.5.0: Application backend for Plutus smart contracts on Cardano
Copyright(c) 2023 GYELD GMBH
LicenseApache 2.0
Maintainer[email protected]
Stabilitydevelop
Safe HaskellSafe-Inferred
LanguageGHC2021

GeniusYield.Types.Script

Description

 
Synopsis

Validator

data GYValidator v #

Instances

Instances details
GCompare GYValidator # 
Instance details

Defined in GeniusYield.Types.Script

Methods

gcompare ∷ ∀ (a ∷ k) (b ∷ k). GYValidator a → GYValidator b → GOrdering a b Source #

GEq GYValidator # 
Instance details

Defined in GeniusYield.Types.Script

Methods

geq ∷ ∀ (a ∷ k) (b ∷ k). GYValidator a → GYValidator b → Maybe (a :~: b) Source #

GShow GYValidator # 
Instance details

Defined in GeniusYield.Types.Script

Methods

gshowsPrec ∷ ∀ (a ∷ k). IntGYValidator a → ShowS Source #

Show (GYValidator v) # 
Instance details

Defined in GeniusYield.Types.Script

Eq (GYValidator v) # 
Instance details

Defined in GeniusYield.Types.Script

Ord (GYValidator v) # 
Instance details

Defined in GeniusYield.Types.Script

File operations

writeValidatorFilePathGYValidator v → IO () #

Writes a validator to a file.

readValidatorSingPlutusVersionI v ⇒ FilePathIO (GYValidator v) #

Reads a validator from a file.

Selectors

ValidatorHash

data GYValidatorHash #

Instances

Instances details
IsString GYValidatorHash #
>>> "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0" :: GYValidatorHash
GYValidatorHash "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0"
Instance details

Defined in GeniusYield.Types.Script

Show GYValidatorHash # 
Instance details

Defined in GeniusYield.Types.Script

PrintfArg GYValidatorHash #
>>> printf "%s" ("cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0" :: GYValidatorHash)
cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0
Instance details

Defined in GeniusYield.Types.Script

Eq GYValidatorHash # 
Instance details

Defined in GeniusYield.Types.Script

Ord GYValidatorHash # 
Instance details

Defined in GeniusYield.Types.Script

validatorHashFromPlutusScriptHashEither PlutusToCardanoError GYValidatorHash #

>>> validatorHashFromPlutus "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0"
Right (GYValidatorHash "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0")
>>> validatorHashFromPlutus "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7"
Left (DeserialiseRawBytesError {ptceTag = "validatorHashFromPlutus: cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7, error: SerialiseAsRawBytesError {unSerialiseAsRawBytesError = \"Enable to deserialise ScriptHash\"}"})

ScriptHash

data GYScriptHash #

Instances

Instances details
FromJSON GYScriptHash # 
Instance details

Defined in GeniusYield.Types.Script.ScriptHash

ToJSON GYScriptHash # 
Instance details

Defined in GeniusYield.Types.Script.ScriptHash

IsString GYScriptHash #
>>> "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0" :: GYScriptHash
GYScriptHash "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0"
Instance details

Defined in GeniusYield.Types.Script.ScriptHash

Show GYScriptHash # 
Instance details

Defined in GeniusYield.Types.Script.ScriptHash

PrintfArg GYScriptHash #
>>> printf "%s" ("cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0" :: GYScriptHash)
cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0
Instance details

Defined in GeniusYield.Types.Script.ScriptHash

Eq GYScriptHash # 
Instance details

Defined in GeniusYield.Types.Script.ScriptHash

Ord GYScriptHash # 
Instance details

Defined in GeniusYield.Types.Script.ScriptHash

ToHttpApiData GYScriptHash # 
Instance details

Defined in GeniusYield.Types.Script.ScriptHash

MintingPolicy

data GYMintingPolicy v #

Instances

Instances details
GCompare GYMintingPolicy # 
Instance details

Defined in GeniusYield.Types.Script

Methods

gcompare ∷ ∀ (a ∷ k) (b ∷ k). GYMintingPolicy a → GYMintingPolicy b → GOrdering a b Source #

GEq GYMintingPolicy # 
Instance details

Defined in GeniusYield.Types.Script

Methods

geq ∷ ∀ (a ∷ k) (b ∷ k). GYMintingPolicy a → GYMintingPolicy b → Maybe (a :~: b) Source #

GShow GYMintingPolicy # 
Instance details

Defined in GeniusYield.Types.Script

Methods

gshowsPrec ∷ ∀ (a ∷ k). IntGYMintingPolicy a → ShowS Source #

Show (GYMintingPolicy v) # 
Instance details

Defined in GeniusYield.Types.Script

Eq (GYMintingPolicy v) # 
Instance details

Defined in GeniusYield.Types.Script

Ord (GYMintingPolicy v) # 
Instance details

Defined in GeniusYield.Types.Script

Witness for Minting Policy

data GYMintScript (u ∷ PlutusVersion) where #

Constructors

GYMintScript ∷ v `VersionIsGreaterOrEqual` u ⇒ GYMintingPolicy v → GYMintScript u

VersionIsGreaterOrEqual restricts which version scripts can be used in this transaction.

GYMintReference ∷ !GYTxOutRef → !(GYScript 'PlutusV2) → GYMintScript 'PlutusV2

Reference inputs can be only used in V2 transactions.

Instances

Instances details
Show (GYMintScript v) # 
Instance details

Defined in GeniusYield.Types.Script

Eq (GYMintScript v) # 
Instance details

Defined in GeniusYield.Types.Script

Ord (GYMintScript v) # 
Instance details

Defined in GeniusYield.Types.Script

File operations

writeMintingPolicyFilePathGYMintingPolicy v → IO () #

Writes a minting policy to a file.

readMintingPolicySingPlutusVersionI v ⇒ FilePathIO (GYMintingPolicy v) #

Reads a minting policy from a file.

Selectors

MintingPolicyId

data GYMintingPolicyId #

Minting policy identifier, also a currency symbol.

Instances

Instances details
FromJSON GYMintingPolicyId # 
Instance details

Defined in GeniusYield.Types.Script

FromJSONKey GYMintingPolicyId # 
Instance details

Defined in GeniusYield.Types.Script

ToJSON GYMintingPolicyId # 
Instance details

Defined in GeniusYield.Types.Script

ToJSONKey GYMintingPolicyId # 
Instance details

Defined in GeniusYield.Types.Script

IsString GYMintingPolicyId #
>>> fromString "ff80aaaf03a273b8f5c558168dc0e2377eea810badbae6eceefc14ef" :: GYMintingPolicyId
"ff80aaaf03a273b8f5c558168dc0e2377eea810badbae6eceefc14ef"
Instance details

Defined in GeniusYield.Types.Script

Show GYMintingPolicyId # 
Instance details

Defined in GeniusYield.Types.Script

Eq GYMintingPolicyId # 
Instance details

Defined in GeniusYield.Types.Script

Ord GYMintingPolicyId # 
Instance details

Defined in GeniusYield.Types.Script

FromHttpApiData GYMintingPolicyId # 
Instance details

Defined in GeniusYield.Types.Script

ToHttpApiData GYMintingPolicyId # 
Instance details

Defined in GeniusYield.Types.Script

ToParamSchema GYMintingPolicyId # 
Instance details

Defined in GeniusYield.Types.Script

ToSchema GYMintingPolicyId # 
Instance details

Defined in GeniusYield.Types.Script

mintingPolicyIdFromCurrencySymbolCurrencySymbolEither PlutusToCardanoError GYMintingPolicyId #

>>> mintingPolicyIdFromCurrencySymbol $ mintingPolicyIdToCurrencySymbol "ff80aaaf03a273b8f5c558168dc0e2377eea810badbae6eceefc14ef"
Right "ff80aaaf03a273b8f5c558168dc0e2377eea810badbae6eceefc14ef"

mintingPolicyIdCurrencySymbolGYMintingPolicyIdCurrencySymbol #

Deprecated: Use mintingPolicyIdToCurrencySymbol.

StakeValidator

data GYStakeValidator v #

Instances

Instances details
GCompare GYStakeValidator # 
Instance details

Defined in GeniusYield.Types.Script

Methods

gcompare ∷ ∀ (a ∷ k) (b ∷ k). GYStakeValidator a → GYStakeValidator b → GOrdering a b Source #

GEq GYStakeValidator # 
Instance details

Defined in GeniusYield.Types.Script

Methods

geq ∷ ∀ (a ∷ k) (b ∷ k). GYStakeValidator a → GYStakeValidator b → Maybe (a :~: b) Source #

GShow GYStakeValidator # 
Instance details

Defined in GeniusYield.Types.Script

Methods

gshowsPrec ∷ ∀ (a ∷ k). IntGYStakeValidator a → ShowS Source #

Show (GYStakeValidator v) # 
Instance details

Defined in GeniusYield.Types.Script

Eq (GYStakeValidator v) # 
Instance details

Defined in GeniusYield.Types.Script

Ord (GYStakeValidator v) # 
Instance details

Defined in GeniusYield.Types.Script

Witness for stake validator

data GYStakeValScript (u ∷ PlutusVersion) where #

Constructors

GYStakeValScript ∷ v `VersionIsGreaterOrEqual` u ⇒ GYStakeValidator v → GYStakeValScript u

VersionIsGreaterOrEqual restricts which version scripts can be used in this transaction.

GYStakeValReference ∷ !GYTxOutRef → !(GYScript 'PlutusV2) → GYStakeValScript 'PlutusV2

Reference inputs can be only used in V2 transactions.

Stake validator selectors

StakeValidatorHash

data GYStakeValidatorHash #

Instances

Instances details
IsString GYStakeValidatorHash #
>>> "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0" :: GYStakeValidatorHash
GYStakeValidatorHash "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0"
Instance details

Defined in GeniusYield.Types.Script

Show GYStakeValidatorHash # 
Instance details

Defined in GeniusYield.Types.Script

PrintfArg GYStakeValidatorHash #
>>> printf "%s" ("cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0" :: GYStakeValidatorHash)
cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0
Instance details

Defined in GeniusYield.Types.Script

Eq GYStakeValidatorHash # 
Instance details

Defined in GeniusYield.Types.Script

Ord GYStakeValidatorHash # 
Instance details

Defined in GeniusYield.Types.Script

stakeValidatorHashFromPlutusScriptHashEither PlutusToCardanoError GYStakeValidatorHash #

>>> stakeValidatorHashFromPlutus "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0"
Right (GYStakeValidatorHash "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0")
>>> stakeValidatorHashFromPlutus "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7"
Left (DeserialiseRawBytesError {ptceTag = "stakeValidatorHashFromPlutus: cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7, error: SerialiseAsRawBytesError {unSerialiseAsRawBytesError = \"Enable to deserialise ScriptHash\"}"})

File operations

writeStakeValidatorFilePathGYStakeValidator v → IO () #

Writes a stake validator to a file.

readStakeValidatorSingPlutusVersionI v ⇒ FilePathIO (GYStakeValidator v) #

Reads a stake validator from a file.

Script

data GYScript (v ∷ PlutusVersion) #

Plutus script

Instances

Instances details
GCompare GYScript # 
Instance details

Defined in GeniusYield.Types.Script

Methods

gcompare ∷ ∀ (a ∷ k) (b ∷ k). GYScript a → GYScript b → GOrdering a b Source #

GEq GYScript # 
Instance details

Defined in GeniusYield.Types.Script

Methods

geq ∷ ∀ (a ∷ k) (b ∷ k). GYScript a → GYScript b → Maybe (a :~: b) Source #

GShow GYScript # 
Instance details

Defined in GeniusYield.Types.Script

Methods

gshowsPrec ∷ ∀ (a ∷ k). IntGYScript a → ShowS Source #

Show (GYScript v) # 
Instance details

Defined in GeniusYield.Types.Script

Eq (GYScript v) #

Equality and comparison are on script hash.

As hash is cryptographicly strong, and GYScript constructor is not exposed, this works great.

Instance details

Defined in GeniusYield.Types.Script

Methods

(==)GYScript v → GYScript v → Bool Source #

(/=)GYScript v → GYScript v → Bool Source #

Ord (GYScript v) # 
Instance details

Defined in GeniusYield.Types.Script

Methods

compareGYScript v → GYScript v → Ordering Source #

(<)GYScript v → GYScript v → Bool Source #

(<=)GYScript v → GYScript v → Bool Source #

(>)GYScript v → GYScript v → Bool Source #

(>=)GYScript v → GYScript v → Bool Source #

maxGYScript v → GYScript v → GYScript v Source #

minGYScript v → GYScript v → GYScript v Source #

someScriptFromReferenceApiReferenceScript era → Maybe (Some GYScript) #

Note: Simple scripts are converted to Nothing.

File operations

writeScript ∷ ∀ v. FilePathGYScript v → IO () #

Writes a script to a file.

readScript ∷ ∀ v. SingPlutusVersionI v ⇒ FilePathIO (GYScript v) #

Reads a script from a file.

Any Script

data GYAnyScript where #

Type encapsulating both simple and plutus scripts.

Constructors

GYSimpleScript ∷ !GYSimpleScriptGYAnyScript 
GYPlutusScript ∷ ∀ v. !(GYScript v) → GYAnyScript 

Instances

Instances details
Show GYAnyScript # 
Instance details

Defined in GeniusYield.Types.Script

Eq GYAnyScript # 
Instance details

Defined in GeniusYield.Types.Script

Simple Script