Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

feat: added applyCborEncoding #25

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/csl/src/utils/aiken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,15 @@ export const applyParamsToScript = (

return csl.apply_params_to_script(rawScript, cslParams, paramType);
};

/**
* Apply Cbor encoding.
*
* @param rawScript - The raw script CborHex from blueprint.
* @returns The double-cbor encoded script CborHex.
*/
export const applyCborEncoding = (
rawScript: string,
): string => {
return csl.apply_params_to_script(rawScript, csl.JsVecString.new(), csl.BuilderDataType.CBOR)
};