cardano-ledger-api-1.9.2.2: Public API for the cardano ledger codebase
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Api.Scripts.Data

Synopsis

Plutus Data

data Data era where Source #

Bundled Patterns

pattern DataEra era ⇒ DataData era 

Instances

Instances details
Memoized Data 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Associated Types

type RawType Data = (r ∷ TypeType) Source #

Methods

getMemoBytesData era → MemoBytes (RawType Data) era

wrapMemoBytesMemoBytes (RawType Data) era → Data era

Generic (Data era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Associated Types

type Rep (Data era) ∷ TypeType Source #

Methods

fromData era → Rep (Data era) x Source #

toRep (Data era) x → Data era Source #

HashAlgorithm (HASH (EraCrypto era)) ⇒ Show (Data era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

showsPrecIntData era → ShowS Source #

showData era → String Source #

showList ∷ [Data era] → ShowS Source #

Typeable era ⇒ ToCBOR (Data era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

toCBORData era → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Data era) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Data era] → Size Source #

Era era ⇒ DecCBOR (Annotator (Data era)) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

decCBORDecoder s (Annotator (Data era)) Source #

dropCBORProxy (Annotator (Data era)) → Decoder s () Source #

labelProxy (Annotator (Data era)) → Text Source #

Typeable era ⇒ EncCBOR (Data era)

Encodes memoized bytes created upon construction.

Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

encCBORData era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (Data era) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Data era] → Size Source #

SafeToHash (Data era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

NFData (Data era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

rnfData era → () Source #

Eq (Data era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

(==)Data era → Data era → Bool Source #

(/=)Data era → Data era → Bool Source #

Typeable era ⇒ NoThunks (Data era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

EraCrypto era ~ c ⇒ HashAnnotated (Data era) EraIndependentData c 
Instance details

Defined in Cardano.Ledger.Plutus.Data

type RawType Data 
Instance details

Defined in Cardano.Ledger.Plutus.Data

type Rep (Data era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

type Rep (Data era) = D1 ('MetaData "Data" "Cardano.Ledger.Plutus.Data" "cardano-ledger-core-1.14.0.0-inplace" 'True) (C1 ('MetaCons "DataConstr" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MemoBytes PlutusData era))))

hashDataEra era ⇒ Data era → DataHash (EraCrypto era) Source #

Inline Datum

data Datum era Source #

Datum can be described by a either a data hash or binary data, but not both. It can also be neither one of them.

Constructors

NoDatum 
DatumHash !(DataHash (EraCrypto era)) 
Datum !(BinaryData era) 

Instances

Instances details
Era era ⇒ ToJSON (Datum era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Generic (Datum era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Associated Types

type Rep (Datum era) ∷ TypeType Source #

Methods

fromDatum era → Rep (Datum era) x Source #

toRep (Datum era) x → Datum era Source #

Show (Datum era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

showsPrecIntDatum era → ShowS Source #

showDatum era → String Source #

showList ∷ [Datum era] → ShowS Source #

Era era ⇒ DecCBOR (Datum era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

decCBORDecoder s (Datum era) Source #

dropCBORProxy (Datum era) → Decoder s () Source #

labelProxy (Datum era) → Text Source #

Era era ⇒ EncCBOR (Datum era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

encCBORDatum era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (Datum era) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Datum era] → Size Source #

Eq (Datum era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

(==)Datum era → Datum era → Bool Source #

(/=)Datum era → Datum era → Bool Source #

Ord (Datum era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

compareDatum era → Datum era → Ordering Source #

(<)Datum era → Datum era → Bool Source #

(<=)Datum era → Datum era → Bool Source #

(>)Datum era → Datum era → Bool Source #

(>=)Datum era → Datum era → Bool Source #

maxDatum era → Datum era → Datum era Source #

minDatum era → Datum era → Datum era Source #

NoThunks (Datum era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

type Rep (Datum era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

type Rep (Datum era) = D1 ('MetaData "Datum" "Cardano.Ledger.Plutus.Data" "cardano-ledger-core-1.14.0.0-inplace" 'False) (C1 ('MetaCons "NoDatum" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "DatumHash" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (DataHash (EraCrypto era)))) :+: C1 ('MetaCons "Datum" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 (BinaryData era)))))

datumDataHashEra era ⇒ Datum era → StrictMaybe (DataHash (EraCrypto era)) Source #

Get the Hash of the datum.

BinaryData

data BinaryData era Source #

Inlined data must be stored in the most compact form because it contributes to the memory overhead of the ledger state. Constructor is intentionally not exported, in order to prevent invalid creation of data from arbitrary binary data. Use makeBinaryData for smart construction.

Instances

Instances details
Generic (BinaryData era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Associated Types

type Rep (BinaryData era) ∷ TypeType Source #

Methods

fromBinaryData era → Rep (BinaryData era) x Source #

toRep (BinaryData era) x → BinaryData era Source #

Show (BinaryData era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

showsPrecIntBinaryData era → ShowS Source #

showBinaryData era → String Source #

showList ∷ [BinaryData era] → ShowS Source #

Era era ⇒ DecCBOR (BinaryData era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

decCBORDecoder s (BinaryData era) Source #

dropCBORProxy (BinaryData era) → Decoder s () Source #

labelProxy (BinaryData era) → Text Source #

Typeable era ⇒ EncCBOR (BinaryData era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

encCBORBinaryData era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (BinaryData era) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [BinaryData era] → Size Source #

SafeToHash (BinaryData era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Eq (BinaryData era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

(==)BinaryData era → BinaryData era → Bool Source #

(/=)BinaryData era → BinaryData era → Bool Source #

Ord (BinaryData era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

Methods

compareBinaryData era → BinaryData era → Ordering Source #

(<)BinaryData era → BinaryData era → Bool Source #

(<=)BinaryData era → BinaryData era → Bool Source #

(>)BinaryData era → BinaryData era → Bool Source #

(>=)BinaryData era → BinaryData era → Bool Source #

maxBinaryData era → BinaryData era → BinaryData era Source #

minBinaryData era → BinaryData era → BinaryData era Source #

NoThunks (BinaryData era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

EraCrypto era ~ c ⇒ HashAnnotated (BinaryData era) EraIndependentData c 
Instance details

Defined in Cardano.Ledger.Plutus.Data

type Rep (BinaryData era) 
Instance details

Defined in Cardano.Ledger.Plutus.Data

type Rep (BinaryData era) = D1 ('MetaData "BinaryData" "Cardano.Ledger.Plutus.Data" "cardano-ledger-core-1.14.0.0-inplace" 'True) (C1 ('MetaCons "BinaryData" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString)))

makeBinaryDataEra era ⇒ ShortByteStringEither String (BinaryData era) Source #

Construct BinaryData from a buffer of bytes, while ensuring that it can be later safely converted to Data with binaryDataToData

binaryDataToDataEra era ⇒ BinaryData era → Data era Source #

It is safe to convert BinaryData to Data because the only way to construct BinaryData is through the smart constructor makeBinaryData that takes care of validation.

dataToBinaryDataEra era ⇒ Data era → BinaryData era Source #