uplc.cbortoscript
Home > @blaze-cardano/uplc > cborToScript
cborToScript() function
Converts the compiled code of a UPLC program into a Script based on the specified script type, handling possible double-CBOR encoding.
Signature:
export declare function cborToScript(cbor: string, type: ScriptType): Script;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| cbor | string | The script, possibly double-CBOR-encoded. | 
| type | The type of the script (Native, PlutusV1, or PlutusV2). | 
Returns:
Script
{Script} - The Script created from the hex blob.
Exceptions
{Error} - Throws an error if the script type is unsupported.