plutus-ledger-1.2.0.0: Wallet API
Safe HaskellNone
LanguageHaskell2010

Data.Aeson.Extras

Description

Encoding and decoding of ByteString and serialisable values as base16 encoded JSON strings

Synopsis

Documentation

encodeByteString :: ByteString -> Text Source #

decodeByteString :: Value -> Parser ByteString Source #

encodeSerialise :: Serialise a => a -> Text Source #

decodeSerialise :: Serialise a => Value -> Parser a Source #

tryDecode :: Text -> Either String ByteString Source #

newtype JSONViaSerialise a Source #

Newtype for deriving ToJSON and FromJSON for types that have a Serialise instance by just encoding the serialized bytes as a JSON string.

Constructors

JSONViaSerialise a 

Instances

Instances details
Serialise a => FromJSON (JSONViaSerialise a) Source # 
Instance details

Defined in Data.Aeson.Extras

Methods

parseJSON :: Value -> Parser (JSONViaSerialise a)

parseJSONList :: Value -> Parser [JSONViaSerialise a]

Serialise a => ToJSON (JSONViaSerialise a) Source # 
Instance details

Defined in Data.Aeson.Extras

Methods

toJSON :: JSONViaSerialise a -> Value

toEncoding :: JSONViaSerialise a -> Encoding

toJSONList :: [JSONViaSerialise a] -> Value

toEncodingList :: [JSONViaSerialise a] -> Encoding