cometa-0.1.0.0: Idiomatic Haskell bindings to cardano-c
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cometa.Transaction.Redeemer

Description

Indexed script arguments and execution budgets. Purpose and zero-based index identify a redeemer; the index refers to the corresponding body field. Redeemer Spending 0 (PlutusData.fromData (PlutusData.Integer 42)) (ExUnits 10 20) assembles an argument and budget without running the script.

Synopsis

Documentation

data Purpose Source #

Ledger purpose tags zero through six. Guarding requires an era supporting transaction guards; this standalone codec does not establish era acceptance.

data Redeemer Source #

Purpose, zero-based body-field index, exact script argument, and memory/CPU budget.

Constructors

Redeemer 

Fields

Instances

Instances details
Show Redeemer Source # 
Instance details

Defined in Cometa.Transaction.Redeemer

Eq Redeemer Source # 
Instance details

Defined in Cometa.Transaction.Redeemer

encodeCbor :: Redeemer -> ByteString Source #

Encode the historical four-element standalone redeemer form.

decodeCbor :: ByteString -> Either Error Redeemer Source #

Decode one standalone four-element form, retaining exact argument CBOR.

encodeCollectionCbor :: [Redeemer] -> Either Error ByteString Source #

Encode a Conway-style map, sorted by purpose/index. Duplicate identifiers fail explicitly; no map conversion silently overwrites an argument.

decodeCollectionCbor :: ByteString -> Either Error [Redeemer] Source #

Accept the historical array or Conway map form. Imported collection order normalizes by purpose/index; duplicate identifiers and indices above 2^32-1 fail.

mkCollection :: [Redeemer] -> Either Error [Redeemer] Source #

Validate unique purpose/index pairs and sort by purpose then index. Duplicate identifiers are rejected even when their arguments agree.