Safe Haskell | None |
---|---|
Language | Haskell2010 |
Class of errors used in the Api.
Synopsis
- data InputFormat a where
- InputFormatBech32 :: forall a. SerialiseAsBech32 a => InputFormat a
- InputFormatHex :: forall a. SerialiseAsRawBytes a => InputFormat a
- InputFormatTextEnvelope :: forall a. HasTextEnvelope a => InputFormat a
- data InputDecodeError
- deserialiseInput :: AsType a -> NonEmpty (InputFormat a) -> ByteString -> Either InputDecodeError a
- deserialiseInputAnyOf :: [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)
- | ACommitteeColdVerificationKey (VerificationKey CommitteeColdKey)
- | ACommitteeColdExtendedVerificationKey (VerificationKey CommitteeColdExtendedKey)
- | ACommitteeHotVerificationKey (VerificationKey CommitteeHotKey)
- | ACommitteeHotExtendedVerificationKey (VerificationKey CommitteeHotExtendedKey)
- 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.
InputFormatBech32 :: forall a. SerialiseAsBech32 a => InputFormat a | Bech32 encoding. |
InputFormatHex :: forall a. SerialiseAsRawBytes a => InputFormat a | Hex/Base16 encoding. |
InputFormatTextEnvelope :: forall a. HasTextEnvelope a => InputFormat a | Text envelope format. |
data InputDecodeError Source #
Input decoding error.
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 :: AsType a -> NonEmpty (InputFormat a) -> ByteString -> Either InputDecodeError a Source #
Deserialise an input of some type that is formatted in some way.
deserialiseInputAnyOf :: [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 #
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 #