plutus-ledger-api-1.30.0.0: Interface to the Plutus ledger for the Cardano ledger.
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusLedgerApi.V1.Bytes

Synopsis

Documentation

newtype LedgerBytes Source #

Instances

Instances details
IsString LedgerBytes Source #

Read in arbitrary LedgerBytes as a "string" (of characters).

This is mostly used together with GHC's OverloadedStrings extension to specify at the source code any LedgerBytes constants, by utilizing Haskell's double-quoted string syntax.

IMPORTANT: the LedgerBytes are expected to be already hex-encoded (base16); otherwise, LedgerBytesError will be raised as an Exception.

Instance details

Defined in PlutusLedgerApi.V1.Bytes

Generic LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

Associated Types

type Rep LedgerBytes :: Type -> Type Source #

Show LedgerBytes Source #

The Show instance of LedgerBytes is its Base16/Hex encoded bytestring, decoded with UTF-8, unpacked to String.

Instance details

Defined in PlutusLedgerApi.V1.Bytes

NFData LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

Methods

rnf :: LedgerBytes -> () Source #

Eq LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

Ord LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

Eq LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

FromData LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

ToData LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

UnsafeFromData LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

Ord LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

Pretty LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

Methods

pretty :: LedgerBytes -> Doc ann

prettyList :: [LedgerBytes] -> Doc ann

Lift DefaultUni LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

Methods

lift :: LedgerBytes -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

Methods

typeRep :: Proxy LedgerBytes -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep LedgerBytes Source # 
Instance details

Defined in PlutusLedgerApi.V1.Bytes

type Rep LedgerBytes = D1 ('MetaData "LedgerBytes" "PlutusLedgerApi.V1.Bytes" "plutus-ledger-api-1.30.0.0-AeqdHlc23KHCP4Mgl3sbFx" 'True) (C1 ('MetaCons "LedgerBytes" 'PrefixI 'True) (S1 ('MetaSel ('Just "getLedgerBytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinByteString)))

data LedgerBytesError Source #

An error that is encountered when converting a ByteString to a LedgerBytes.

Constructors

UnpairedDigit

Odd number of bytes in the original bytestring.

NotHexit !Char

A non-hex digit character ([^A-Fa-f0-9]) encountered during decoding.

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.