Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Api.Serialise.Cip129
Synopsis
- class (SerialiseAsRawBytes a, HasTypeProxy a) => Cip129 a where
- cip129Bech32PrefixFor :: AsType a -> HumanReadablePart
- cip129HeaderHexByte :: a -> ByteString
- cip129Bech32PrefixesPermitted :: AsType a -> [Text]
- deserialiseFromBech32Cip129 :: Cip129 a => Text -> Either Bech32DecodeError a
- serialiseToBech32Cip129 :: Cip129 a => a -> Text
- serialiseGovActionIdToBech32Cip129 :: GovActionId -> Text
- deserialiseGovActionIdFromBech32Cip129 :: Text -> Either Bech32DecodeError GovActionId
- data family AsType t
Documentation
class (SerialiseAsRawBytes a, HasTypeProxy a) => Cip129 a where Source #
Cip-129 is a typeclass that captures the serialisation requirements of https://cips.cardano.org/cip/CIP-0129 which pertain to governance credentials and governance action ids.
Minimal complete definition
Methods
cip129Bech32PrefixFor :: AsType a -> HumanReadablePart Source #
The human readable part of the Bech32 encoding for the credential.
cip129HeaderHexByte :: a -> ByteString Source #
The header byte that identifies the credential type according to Cip-129.
cip129Bech32PrefixesPermitted :: AsType a -> [Text] Source #
Permitted bech32 prefixes according to Cip-129.
default cip129Bech32PrefixesPermitted :: AsType a -> [Text] Source #
Instances
deserialiseFromBech32Cip129 :: Cip129 a => Text -> Either Bech32DecodeError a Source #
serialiseToBech32Cip129 :: Cip129 a => a -> Text Source #
Serialize a accoding to the serialisation requirements of https://cips.cardano.org/cip/CIP-0129
which currently pertain to governance credentials. Governance action ids are dealt separately with
via serialiseGovActionIdToBech32Cip129
.
serialiseGovActionIdToBech32Cip129 :: GovActionId -> Text Source #
Governance Action ID According to Cip129 there is no header byte for GovActionId. Instead they append the txid and index to form the payload.
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.