This class provides decoding functionality for UPLC (Untyped Plutus Core) programs. It extends the FlatDecoder class to handle the specific structure of UPLC programs. The decoding process involves interpreting binary data into structured UPLC terms and types.

Hierarchy

  • Parser
    • UPLCDecoder

Constructors

  • Parameters

    • bytes: Uint8Array

    Returns UPLCDecoder

Methods

  • Public method to decode a UPLC program from the UPLCDecoder instance

    Returns ParsedProgram

    The decoded UPLC program.

  • Returns Bit

  • Parameters

    • n: number

    Returns Byte

  • Returns Byte

  • Returns void

  • Parameters

    • n: number

    Returns Uint8Array

  • Decodes a UPLC program from a hexadecimal string. This method utilizes the fromHex method to create an instance of UPLCDecoder and then decodes the program using the decode method.

    Parameters

    • hex: string

      The hexadecimal string representing the binary data of a UPLC program.

    Returns ParsedProgram

    • The decoded UPLC program.
  • Creates a UPLCDecoder instance from a hexadecimal string.

    Parameters

    • hex: string

      Hexadecimal string of a UPLC program's binary data.

    Returns UPLCDecoder

    Initialized UPLCDecoder with the decoded data.