| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Bcc.Api.SerialiseBech32
Description
Bech32 Serialisation
Synopsis
- class (HasTypeProxy a, SerialiseAsRawBytes a) ⇒ SerialiseAsBech32 a where
- bech32PrefixFor ∷ a → Text
 - bech32PrefixesPermitted ∷ AsType a → [Text]
 
 - serialiseToBech32 ∷ SerialiseAsBech32 a ⇒ a → Text
 - data Bech32DecodeError
- = Bech32DecodingError !DecodingError
 - | Bech32UnexpectedPrefix !Text !(Set Text)
 - | Bech32DataPartToBytesError !Text
 - | Bech32DeserialiseFromBytesError !ByteString
 - | Bech32WrongPrefix !Text !Text
 
 - deserialiseFromBech32 ∷ SerialiseAsBech32 a ⇒ AsType a → Text → Either Bech32DecodeError a
 - deserialiseAnyOfFromBech32 ∷ ∀ b. [FromSomeType SerialiseAsBech32 b] → Text → Either Bech32DecodeError b
 
Documentation
class (HasTypeProxy a, SerialiseAsRawBytes a) ⇒ SerialiseAsBech32 a where Source #
Methods
bech32PrefixFor ∷ a → Text Source #
The human readable prefix to use when encoding this value to Bech32.
bech32PrefixesPermitted ∷ AsType a → [Text] Source #
The set of human readable prefixes that can be used for this type.
Instances
serialiseToBech32 ∷ SerialiseAsBech32 a ⇒ a → Text Source #
data Bech32DecodeError Source #
Bech32 decoding error.
Constructors
| Bech32DecodingError !DecodingError | There was an error decoding the string as Bech32.  | 
| Bech32UnexpectedPrefix !Text !(Set Text) | The human-readable prefix in the Bech32-encoded string is not one of the ones expected.  | 
| Bech32DataPartToBytesError !Text | There was an error in extracting a   | 
| Bech32DeserialiseFromBytesError !ByteString | There was an error in deserialising the bytes into a value of the expected type.  | 
| Bech32WrongPrefix !Text !Text | The human-readable prefix in the Bech32-encoded string does not correspond to the prefix that should be used for the payload value.  | 
Instances
| Eq Bech32DecodeError Source # | |
Defined in Bcc.Api.SerialiseBech32 Methods (==) ∷ Bech32DecodeError → Bech32DecodeError → Bool Source # (/=) ∷ Bech32DecodeError → Bech32DecodeError → Bool Source #  | |
| Show Bech32DecodeError Source # | |
Defined in Bcc.Api.SerialiseBech32  | |
| Error Bech32DecodeError Source # | |
Defined in Bcc.Api.SerialiseBech32 Methods  | |
deserialiseFromBech32 ∷ SerialiseAsBech32 a ⇒ AsType a → Text → Either Bech32DecodeError a Source #
deserialiseAnyOfFromBech32 ∷ ∀ b. [FromSomeType SerialiseAsBech32 b] → Text → Either Bech32DecodeError b Source #