Evolution SDK
ModulesUtils

utils/Hash.ts

Hash overview


Table of contents


utils

computeTotalExUnits

Compute total ex_units by summing over redeemers.

Signature

export declare const computeTotalExUnits: (redeemers: ReadonlyArray<Redeemer.Redeemer>) => Redeemer.ExUnits

hashAuxiliaryData

Compute hash of auxiliary data (tag 259) per ledger rules.

Signature

export declare const hashAuxiliaryData: (aux: AuxiliaryData.AuxiliaryData) => AuxiliaryDataHash.AuxiliaryDataHash

hashScriptData

Compute script_data_hash using standard module encoders.

Accepts the concrete Redeemers union type — encoding format is determined by _tag (RedeemerMap → map CBOR, RedeemerArray → array CBOR).

The payload format per CDDL spec is raw concatenation (not a CBOR structure):

redeemers_bytes || datums_bytes || language_views_bytes

Signature

export declare const hashScriptData: (
  redeemers: Redeemers.Redeemers,
  costModels: CostModel.CostModels,
  datums?: ReadonlyArray<Data.Data>,
  options?: CBOR.CodecOptions
) => ScriptDataHash.ScriptDataHash

hashTransaction

Compute the transaction body hash (blake2b-256 over CBOR of body).

Signature

export declare const hashTransaction: (body: TransactionBody.TransactionBody) => TransactionHash.TransactionHash

hashTransactionRaw

Compute the transaction body hash from raw CBOR bytes, preserving original encoding. Uses Transaction.extractBodyBytes to avoid the decode→re-encode round-trip.

Signature

export declare const hashTransactionRaw: (bodyBytes: Uint8Array) => TransactionHash.TransactionHash