Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- type ToScriptData a = ToData a
- type FromScriptData a = FromData a
- toScriptData :: ToScriptData a => a -> HashableScriptData
- fromScriptData :: FromScriptData a => HashableScriptData -> Maybe a
- txOutScriptData :: TxOut CtxTx era -> Maybe HashableScriptData
- lookupScriptData :: forall era. (UsesStandardCrypto era, Era (ShelleyLedgerEra era)) => Tx era -> TxOut CtxUTxO era -> Maybe HashableScriptData
- fromLedgerData :: Data era -> HashableScriptData
- toLedgerData :: Era era => HashableScriptData -> Data era
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
Arbitrary HashableScriptData Source # | |
Arbitrary ScriptData Source # | |
arbitrary :: Gen ScriptData # shrink :: ScriptData -> [ScriptData] # | |
FromJSON HashableScriptData Source # | |
parseJSON :: Value -> Parser HashableScriptData # parseJSONList :: Value -> Parser [HashableScriptData] # | |
FromJSON ScriptData Source # | |
parseJSON :: Value -> Parser ScriptData # parseJSONList :: Value -> Parser [ScriptData] # | |
ToJSON HashableScriptData Source # | |
toJSON :: HashableScriptData -> Value # toEncoding :: HashableScriptData -> Encoding # toJSONList :: [HashableScriptData] -> Value # toEncodingList :: [HashableScriptData] -> Encoding # omitField :: HashableScriptData -> Bool # | |
ToJSON ScriptData Source # | |
toJSON :: ScriptData -> Value # toEncoding :: ScriptData -> Encoding # toJSONList :: [ScriptData] -> Value # toEncodingList :: [ScriptData] -> Encoding # omitField :: ScriptData -> Bool # |