atlas-cardano-0.6.3: 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

type GYValidator v = GYScript v #

Deprecated: Use GYScript.

File operations

writeValidatorFilePathGYValidator v → IO () #

Writes a validator to a file.

readValidatorSingPlutusVersionI v ⇒ FilePathIO (GYValidator v) #

Reads a validator from a file.

Selectors

ValidatorHash

type GYValidatorHash = GYScriptHash #

Deprecated: Use GYScriptHash.

validatorHashFromPlutusScriptHashEither 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

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

scriptHashFromLedgerScriptHash StandardCryptoGYScriptHash #

Convert from corresponding ledger representation.

scriptHashToLedgerGYScriptHashScriptHash StandardCrypto #

Convert to corresponding ledger representation.

MintingPolicy

type GYMintingPolicy v = GYScript v #

Deprecated: Use GYScript.

Witness for Minting Policy

data GYMintScript (u ∷ PlutusVersion) where #

Constructors

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

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

GYMintReference ∷ v `VersionIsGreaterOrEqual` 'PlutusV2 ⇒ !GYTxOutRef → !(GYScript v) → GYMintScript v

Reference inputs can be only used in V2 transactions.

Instances

Instances details
Show (GYMintScript v) # 
Instance details

Defined in GeniusYield.Types.Script

Methods

showsPrecIntGYMintScript v → ShowS #

showGYMintScript v → String #

showList ∷ [GYMintScript v] → ShowS #

Eq (GYMintScript v) # 
Instance details

Defined in GeniusYield.Types.Script

Methods

(==)GYMintScript v → GYMintScript v → Bool #

(/=)GYMintScript v → GYMintScript v → Bool #

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

type GYStakeValidator v = GYScript v #

Deprecated: Use GYScript.

Witness for stake validator

data GYStakeValScript (u ∷ PlutusVersion) where #

Constructors

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

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

GYStakeValReference ∷ v `VersionIsGreaterOrEqual` 'PlutusV2 ⇒ !GYTxOutRef → !(GYScript v) → GYStakeValScript v

Reference inputs can be only used in V2 transactions.

Stake validator selectors

StakeValidatorHash

type GYStakeValidatorHash = GYScriptHash #

Deprecated: Use GYScriptHash.

stakeValidatorHashFromPlutusScriptHashEither PlutusToCardanoError GYStakeValidatorHash #

>>> stakeValidatorHashFromPlutus "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0"
Right (GYScriptHash "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7d0")
>>> stakeValidatorHashFromPlutus "cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7"
Left (DeserialiseRawBytesError {ptceTag = "stakeValidatorHashFromPlutus: cabdd19b58d4299fde05b53c2c0baf978bf9ade734b490fc0cc8b7, error: SerialiseAsRawBytesError {unSerialiseAsRawBytesError = \"Unable 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 #

GEq GYScript # 
Instance details

Defined in GeniusYield.Types.Script

Methods

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

GShow GYScript # 
Instance details

Defined in GeniusYield.Types.Script

Methods

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

Show (GYScript v) # 
Instance details

Defined in GeniusYield.Types.Script

Methods

showsPrecIntGYScript v → ShowS #

showGYScript v → String #

showList ∷ [GYScript v] → ShowS #

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 #

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

Ord (GYScript v) # 
Instance details

Defined in GeniusYield.Types.Script

Methods

compareGYScript v → GYScript v → Ordering #

(<)GYScript v → GYScript v → Bool #

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

(>)GYScript v → GYScript v → Bool #

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

maxGYScript v → GYScript v → GYScript v #

minGYScript v → GYScript v → GYScript v #

hashScriptGYScript v → GYScriptHash #

Deprecated: Use scriptHash.

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

Ord GYAnyScript # 
Instance details

Defined in GeniusYield.Types.Script

Simple Script