Cardano.Data

Handling Cardano Data objects.

type Data
= Constr Natural (List Data)
| Map (List ( Data, Data ))
| List (List Data)
| Int Integer
| Bytes (Bytes Any)

A Data is a compound type that can represent any possible user-defined type in Aiken.

hash : Data -> Bytes a

Compute the Blake2b-256 (32 bytes) hash of a Data object.

Helper function to compute the Blake2b-256 hash of the raw Data bytes in a UTxO datum.

fromBytes : Bytes a -> Maybe Data

Helper function to decode a Data object from its raw CBOR bytes.

fromCbor : Decoder Data

CBOR decoder for [Data].

toCbor : Data -> Encoder

CBOR encoder for [Data].

toCborUplc : Data -> Encoder

CBOR encoder for [Data]. Only to be used for things sent to the UPLC VM, such as datums, redeemers, and script parameter application.