class Tx:
    def __init__(self, data: str, value: str):
        # Transaction input (data)
        self.data = data
        # Transaction value
        if isinstance(value, str):
            # Transform from hex string
            if value[0:2].lower() == "0x":
                self.value = int(value, base=16)
            else:
                self.value = int(value)
        else:
            self.value = int(value)

    def __repr__(self):
        return "Transaction {{Data: {input}, Value: {value}}}".format(
            input=self.data, value=self.value
        )
