Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Api.DeserialiseAnyOf
Description
Class of errors used in the Api.
Synopsis
- data InputFormat a where
- InputFormatBech32 :: SerialiseAsBech32 a => InputFormat a
- InputFormatHex :: SerialiseAsRawBytes a => InputFormat a
- InputFormatTextEnvelope :: HasTextEnvelope a => InputFormat a
- data InputDecodeError
- deserialiseInput :: forall a. AsType a -> NonEmpty (InputFormat a) -> ByteString -> Either InputDecodeError a
- deserialiseInputAnyOf :: forall b. [FromSomeType SerialiseAsBech32 b] -> [FromSomeType HasTextEnvelope b] -> ByteString -> Either InputDecodeError b
- renderInputDecodeError :: InputDecodeError -> Doc ann
- data SomeAddressVerificationKey
- = AByronVerificationKey (VerificationKey ByronKey)
- | APaymentVerificationKey (VerificationKey PaymentKey)
- | APaymentExtendedVerificationKey (VerificationKey PaymentExtendedKey)
- | AGenesisUTxOVerificationKey (VerificationKey GenesisUTxOKey)
- | AGenesisExtendedVerificationKey (VerificationKey GenesisExtendedKey)
- | AGenesisDelegateExtendedVerificationKey (VerificationKey GenesisDelegateExtendedKey)
- | AKesVerificationKey (VerificationKey KesKey)
- | AVrfVerificationKey (VerificationKey VrfKey)
- | AStakeVerificationKey (VerificationKey StakeKey)
- | AStakeExtendedVerificationKey (VerificationKey StakeExtendedKey)
- | ADRepVerificationKey (VerificationKey DRepKey)
- | ADRepExtendedVerificationKey (VerificationKey DRepExtendedKey)
- deserialiseAnyVerificationKey :: ByteString -> Either InputDecodeError SomeAddressVerificationKey
- deserialiseAnyVerificationKeyBech32 :: ByteString -> Either Bech32DecodeError SomeAddressVerificationKey
- deserialiseAnyVerificationKeyTextEnvelope :: ByteString -> Either TextEnvelopeError SomeAddressVerificationKey
- renderSomeAddressVerificationKey :: SomeAddressVerificationKey -> Text
- mapSomeAddressVerificationKey :: (forall keyrole. Key keyrole => VerificationKey keyrole -> a) -> SomeAddressVerificationKey -> a
Documentation
data InputFormat a where Source #
Input format/encoding.
Constructors
InputFormatBech32 :: SerialiseAsBech32 a => InputFormat a | Bech32 encoding. |
InputFormatHex :: SerialiseAsRawBytes a => InputFormat a | Hex/Base16 encoding. |
InputFormatTextEnvelope :: HasTextEnvelope a => InputFormat a | Text envelope format. |
data InputDecodeError Source #
Input decoding error.
Constructors
InputTextEnvelopeError !TextEnvelopeError | The provided data seems to be a valid text envelope, but some error occurred in deserialising it. |
InputBech32DecodeError !Bech32DecodeError | The provided data is valid Bech32, but some error occurred in deserialising it. |
InputInvalidError | The provided data does not represent a valid value of the provided type. |
Instances
deserialiseInput :: forall a. AsType a -> NonEmpty (InputFormat a) -> ByteString -> Either InputDecodeError a Source #
Deserialise an input of some type that is formatted in some way.
deserialiseInputAnyOf :: forall b. [FromSomeType SerialiseAsBech32 b] -> [FromSomeType HasTextEnvelope b] -> ByteString -> Either InputDecodeError b Source #
Deserialise an input of some type that is formatted in some way.
The provided ByteString
can either be Bech32-encoded or in the text
envelope format.
renderInputDecodeError :: InputDecodeError -> Doc ann Source #
Render an error message for a InputDecodeError
.
data SomeAddressVerificationKey Source #
Constructors
Instances
deserialiseAnyVerificationKey :: ByteString -> Either InputDecodeError SomeAddressVerificationKey Source #
deserialiseAnyVerificationKeyBech32 :: ByteString -> Either Bech32DecodeError SomeAddressVerificationKey Source #
deserialiseAnyVerificationKeyTextEnvelope :: ByteString -> Either TextEnvelopeError SomeAddressVerificationKey Source #
mapSomeAddressVerificationKey :: (forall keyrole. Key keyrole => VerificationKey keyrole -> a) -> SomeAddressVerificationKey -> a Source #