'Transforms the object to a Python dictionary.
Returns:
dict: The Transaction as an alternative serialization format.'

def to_dict(self):

    tx = {'inputs': [input_.to_dict() for input_ in self.inputs], 'outputs': [output.to_dict() for output in self.outputs], 'operation': str(self.operation), 'metadata': self.metadata, 'asset': self.asset, 'version': self.version}
    tx_no_signatures = Transaction._remove_signatures(tx)
    tx_serialized = Transaction._to_str(tx_no_signatures)
    tx_id = Transaction._to_hash(tx_serialized)
    tx['id'] = tx_id
    return tx
