def serialize(self) -> str:
        """Returns PSBT as base64 text, or raw hex of network tx (if complete)."""
        self.finalize_psbt()  # FIXME this side-effects self
        if self.is_complete():
            return Transaction.serialize(self)
        return self._serialize_as_base64()
Returns PSBT as base64 text, or raw hex of network tx (if complete).
electrum/transaction.py