tx.computescriptdata
Home > @blaze-cardano/tx > computeScriptData
computeScriptData() function
Calculates the correct script data hash for a transaction
Separate from the getScriptData method in TxBuilder to allow for more thorough testing This is heavily documented here: https://github.com/IntersectMBO/cardano-ledger/blob/master/eras/conway/impl/cddl-files/conway.cddl\#L423-L490
Signature:
export declare function computeScriptData(redeemers: Redeemers, datums: ReturnType<TransactionWitnessSet["plutusData"]>, // TODO: weird import shenanigans
usedCostModels: Costmdls): IScriptData | undefined;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| redeemers | Redeemers | The redeemers of the transaction | 
| datums | ReturnType<TransactionWitnessSet["plutusData"]> | The datums in the witness set of the transaction | 
| usedCostModels | Costmdls | The cost models for any languages used in the transaction | 
Returns:
IScriptData | undefined