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.Datum

Description

 
Synopsis

Docspec setup

>>> :set -XOverloadedStrings -XTypeApplications
>>> import qualified Data.Aeson                 as Aeson
>>> import qualified Data.ByteString.Char8      as BS8
>>> import qualified Data.ByteString.Lazy       as BSL
>>> import qualified Web.HttpApiData            as Web
>>> 

Datum

data GYDatum #

Datum

In the GY system we always include datums in transactions so this simple type is sufficient.

Instances

Instances details
FromJSON GYDatum #

Datums use cardano-api's detailed schema for JSON representation.

>>> Aeson.decode @GYDatum "{\"constructor\":0,\"fields\":[{\"int\":42},{\"list\":[{\"bytes\":\"\"}]}]}"
Just (GYDatum Constr 0 [I 42,List [B ""]])
Instance details

Defined in GeniusYield.Types.Datum

ToJSON GYDatum #
>>> BSL.putStr . Aeson.encode . datumFromPlutus' . PlutusTx.dataToBuiltinData $ PlutusTx.Constr 0 [ PlutusTx.I 42, PlutusTx.List [ PlutusTx.B "" ] ]
{"constructor":0,"fields":[{"int":42},{"list":[{"bytes":""}]}]}
Instance details

Defined in GeniusYield.Types.Datum

Show GYDatum # 
Instance details

Defined in GeniusYield.Types.Datum

Methods

showsPrecIntGYDatumShowS #

showGYDatumString #

showList ∷ [GYDatum] → ShowS #

Eq GYDatum # 
Instance details

Defined in GeniusYield.Types.Datum

Methods

(==)GYDatumGYDatumBool #

(/=)GYDatumGYDatumBool #

Ord GYDatum # 
Instance details

Defined in GeniusYield.Types.Datum

Methods

compareGYDatumGYDatumOrdering #

(<)GYDatumGYDatumBool #

(<=)GYDatumGYDatumBool #

(>)GYDatumGYDatumBool #

(>=)GYDatumGYDatumBool #

maxGYDatumGYDatumGYDatum #

minGYDatumGYDatumGYDatum #

FromData GYDatum # 
Instance details

Defined in GeniusYield.Types.Datum

ToData GYDatum # 
Instance details

Defined in GeniusYield.Types.Datum

datumToApi'GYDatumHashableScriptData #

Convert a GYDatum to HashableScriptData from Cardano Api.

NOTE: This function is to be used only when generating for new outputs in a transaction as doing datumFromApi' followed by datumToApi' does not guarantee same low level CBOR representation of the high level data type.

datumToPlutusGYDatumDatum #

Convert a GYDatum to Datum from Plutus

datumToPlutus'GYDatumBuiltinData #

Convert a GYDatum to BuiltinData from Plutus

datumFromPlutusDatumGYDatum #

Get a GYDatum from a Plutus Datum

datumFromPlutusDataToData a ⇒ a → GYDatum #

Get a GYDatum from any Plutus ToData type.

hashDatumGYDatumGYDatumHash #

Returns the GYDatumHash of the given GYDatum

Datum hash

data GYDatumHash #

Instances

Instances details
FromJSON GYDatumHash # 
Instance details

Defined in GeniusYield.Types.Datum

ToJSON GYDatumHash # 
Instance details

Defined in GeniusYield.Types.Datum

IsString GYDatumHash # 
Instance details

Defined in GeniusYield.Types.Datum

Show GYDatumHash # 
Instance details

Defined in GeniusYield.Types.Datum

Eq GYDatumHash # 
Instance details

Defined in GeniusYield.Types.Datum

Ord GYDatumHash # 
Instance details

Defined in GeniusYield.Types.Datum

ToHttpApiData GYDatumHash # 
Instance details

Defined in GeniusYield.Types.Datum

FromField GYDatumHash # 
Instance details

Defined in GeniusYield.Types.Datum

ToField GYDatumHash # 
Instance details

Defined in GeniusYield.Types.Datum

Methods

toFieldGYDatumHashAction #