Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype LedgerBytes = LedgerBytes {}
- data LedgerBytesError
- fromHex :: ByteString -> Either LedgerBytesError LedgerBytes
- bytes :: LedgerBytes -> ByteString
- fromBytes :: ByteString -> LedgerBytes
- encodeByteString :: ByteString -> Text
Documentation
newtype LedgerBytes Source #
Instances
data LedgerBytesError Source #
An error that is encountered when converting a ByteString
to a LedgerBytes
.
UnpairedDigit | Odd number of bytes in the original bytestring. |
NotHexit !Char | A non-hex digit character ([^A-Fa-f0-9]) encountered during decoding. |
Instances
Exception LedgerBytesError Source # | |
Defined in PlutusLedgerApi.V1.Bytes | |
Show LedgerBytesError Source # | |
Defined in PlutusLedgerApi.V1.Bytes |
fromHex :: ByteString -> Either LedgerBytesError LedgerBytes Source #
Convert a hex-encoded (Base16) ByteString
to a LedgerBytes
.
May return an error (LedgerBytesError
).
bytes :: LedgerBytes -> ByteString Source #
Extract the Haskell bytestring from inside the Plutus opaque LedgerBytes
.
fromBytes :: ByteString -> LedgerBytes Source #
Lift a Haskell bytestring to the Plutus abstraction LedgerBytes
encodeByteString :: ByteString -> Text Source #
Encode a ByteString value to Base16 (i.e. hexadecimal), then
decode with UTF-8 to a Text
.