Adds a '0x' prefix to a string if it doesn't already have one.

  • Parameters

    • str: string

      The input string.

    Returns `0x${string}`

    The input string with a '0x' prefix.