Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- data GYDatum
- datumToApi' ∷ GYDatum → HashableScriptData
- datumFromApi' ∷ HashableScriptData → GYDatum
- datumToPlutus ∷ GYDatum → Datum
- datumToPlutus' ∷ GYDatum → BuiltinData
- datumFromPlutus ∷ Datum → GYDatum
- datumFromPlutus' ∷ BuiltinData → GYDatum
- datumFromPlutusData ∷ ToData a ⇒ a → GYDatum
- unitDatum ∷ GYDatum
- hashDatum ∷ GYDatum → GYDatumHash
- data GYDatumHash
- datumHashFromHex ∷ String → Maybe GYDatumHash
- datumHashFromHexE ∷ String → Either String GYDatumHash
- datumHashFromPlutus ∷ DatumHash → Either PlutusToCardanoError GYDatumHash
- unsafeDatumHashFromPlutus ∷ DatumHash → GYDatumHash
- datumHashToPlutus ∷ GYDatumHash → DatumHash
- datumHashFromApi ∷ Hash ScriptData → GYDatumHash
- datumHashToApi ∷ GYDatumHash → Hash ScriptData
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
Datum
In the GY system we always include datums in transactions so this simple type is sufficient.
Instances
FromJSON GYDatum # | Datums use cardano-api's detailed schema for JSON representation.
|
Defined in GeniusYield.Types.Datum | |
ToJSON GYDatum # |
|
Show GYDatum # | |
Eq GYDatum # | |
Ord GYDatum # | |
FromData GYDatum # | |
Defined in GeniusYield.Types.Datum | |
ToData GYDatum # | |
Defined in GeniusYield.Types.Datum |
datumToApi' ∷ GYDatum → HashableScriptData #
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.
datumFromApi' ∷ HashableScriptData → GYDatum #
Get a GYDatum
from a Cardano Api ScriptData
datumToPlutus' ∷ GYDatum → BuiltinData #
Convert a GYDatum
to BuiltinData
from Plutus
datumFromPlutus' ∷ BuiltinData → GYDatum #
Get a GYDatum
from a Plutus BuiltinData
Unit datum
hashDatum ∷ GYDatum → GYDatumHash #
Returns the GYDatumHash
of the given GYDatum
Datum hash
data GYDatumHash #