| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Api.Experimental.AnyScript
Synopsis
- data AnyScript era where
- AnySimpleScript :: forall era. SimpleScript era -> AnyScript era
- AnyPlutusScript :: forall (lang :: Language) era. (PlutusLanguage lang, Typeable lang) => PlutusScriptInEra lang era -> AnyScript era
- data family AsType t
- data AnyScriptDecodeError
- deserialiseAnyPlutusScriptOfLanguage :: forall era (lang :: Language). (IsEra era, PlutusLanguage lang, HasTypeProxy (SLanguage lang)) => ByteString -> SLanguage lang -> Either DecoderError (AnyScript (LedgerEra era))
- deserialiseAnySimpleScript :: IsEra era => ByteString -> Either DecoderError (AnyScript (LedgerEra era))
- hashAnyScript :: IsEra era => AnyScript (LedgerEra era) -> ScriptHash
- readAnyScriptBytes :: Era era -> ByteString -> Either AnyScriptDecodeError (AnyScript (LedgerEra era))
- readFileAnyScript :: Era era -> File content 'In -> IO (Either (FileError AnyScriptDecodeError) (AnyScript (LedgerEra era)))
Documentation
data AnyScript era where Source #
Constructors
| AnySimpleScript :: forall era. SimpleScript era -> AnyScript era | |
| AnyPlutusScript :: forall (lang :: Language) era. (PlutusLanguage lang, Typeable lang) => PlutusScriptInEra lang era -> AnyScript era |
Instances
| Era era => HasTypeProxy (AnyScript era) Source # | |||||
Defined in Cardano.Api.Experimental.AnyScript Associated Types
| |||||
| AlonzoEraScript era => SerialiseAsCBOR (AnyScript era) Source # | |||||
Defined in Cardano.Api.Experimental.AnyScript Methods serialiseToCBOR :: AnyScript era -> ByteString Source # deserialiseFromCBOR :: AsType (AnyScript era) -> ByteString -> Either DecoderError (AnyScript era) Source # | |||||
| Eq (AnyScript era) Source # | |||||
| Show (AnyScript era) Source # | |||||
| data AsType (AnyScript era) Source # | |||||
Defined in Cardano.Api.Experimental.AnyScript | |||||
A family of singleton types used in this API to indicate which type to use where it would otherwise be ambiguous or merely unclear.
Values of this type are passed to deserialisation functions for example.
Instances
data AnyScriptDecodeError Source #
Constructors
| AnyScriptPlutusCborError AnyPlutusScriptLanguage DecoderError | A text envelope was decoded, but its Plutus CBOR payload could not be. |
| AnyScriptSimpleCborError DecoderError | A text envelope was decoded, but its simple-script CBOR payload could not be. |
| AnyScriptJsonError | The input could not be decoded as a text envelope, nor as a simple script. Both failures are retained so the caller can see why each format was rejected. |
Fields
| |
| AnyScriptUnknownTextEnvelopeType TextEnvelopeType | The text envelope's type is not a recognised script type. |
Instances
| Error AnyScriptDecodeError Source # | |
Defined in Cardano.Api.Experimental.AnyScript Methods prettyError :: AnyScriptDecodeError -> Doc ann Source # | |
| Show AnyScriptDecodeError Source # | |
Defined in Cardano.Api.Experimental.AnyScript | |
deserialiseAnyPlutusScriptOfLanguage :: forall era (lang :: Language). (IsEra era, PlutusLanguage lang, HasTypeProxy (SLanguage lang)) => ByteString -> SLanguage lang -> Either DecoderError (AnyScript (LedgerEra era)) Source #
deserialiseAnySimpleScript :: IsEra era => ByteString -> Either DecoderError (AnyScript (LedgerEra era)) Source #
hashAnyScript :: IsEra era => AnyScript (LedgerEra era) -> ScriptHash Source #
readAnyScriptBytes :: Era era -> ByteString -> Either AnyScriptDecodeError (AnyScript (LedgerEra era)) Source #
Decode an AnyScript from its serialised form: a text envelope wrapping
the CBOR encoding of either a simple or a Plutus script, or (as a fallback)
the JSON-only encoding of a simple script.