hydra-cardano-api-0.19.0: A Haskell API for Cardano, tailored to the Hydra project.
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Cardano.Api.ScriptData

Synopsis

Extras

type ToScriptData a = ToData a Source #

Data-types that can be marshalled into a generic ScriptData structure.

type FromScriptData a = FromData a Source #

Data-types that can be unmarshalled from a generic ScriptData structure.

toScriptData :: ToScriptData a => a -> HashableScriptData Source #

Serialise some type into a generic script data.

fromScriptData :: FromScriptData a => HashableScriptData -> Maybe a Source #

Deserialise some generic script data into some type.

txOutScriptData :: TxOut CtxTx era -> Maybe HashableScriptData Source #

Get the HashableScriptData associated to the a TxOut. Note that this requires the CtxTx context. To get script data in a CtxUTxO context, see lookupScriptData.

lookupScriptData :: forall era. (UsesStandardCrypto era, Era (ShelleyLedgerEra era)) => Tx era -> TxOut CtxUTxO era -> Maybe HashableScriptData Source #

Lookup included datum of given TxOut.

Type Conversions

fromLedgerData :: Data era -> HashableScriptData Source #

Convert a cardano-ledger script Data into a cardano-api ScriptDatum.

toLedgerData :: Era era => HashableScriptData -> Data era Source #

Convert a cardano-api script data into a cardano-ledger script Data. XXX: This is a partial function. Ideally it would fall back to the Data portion in HashableScriptData.

Orphans

Orphan instances