I see you used the plu-ts
tag, I assume you are working with it.
plu-ts re-exports the @harmoniclabs/uplc
module](https://github.com/harmoniclabs/uplc/) as is.
so you have it already with plu-ts
as you can read from the uplc module readme, there are functionalities to parse the bytes of the contract and print a prettified uplc textual form
this is the example reported in the package
import { fromHex } from "@harmoniclabs/uint8array-utils";
import { parseUPLC, prettyUPLC } from "@harmoniclabs/uplc";
const serialized: Uint8Array = fromHex( "0100003233700900219b8248050005200801" );
const program = parseUPLC( serialized, "flat" );
console.log(
prettyUPLC(
program.body, // UPLCTerm
4 // indentation spaces
)
);
/*
expected output:
[
(lam a
[
[
(builtin addInteger)
(con integer 2)
]
[
[
(builtin multiplyInteger)
(con integer 10)
]
a
]
]
)
(con integer 4)
]
*/
you probably don't need to specify "flat"
as second argument of parseUPlC
as I assume you are working with cbor.
have fun