code: def to_dict(self):
          
          if self.txid is None and self.output is None:
              return None
          else:
              return {
                  'transaction_id': self.txid,
                  'output_index': self.output,
              }
docs: Transforms the object to a Python dictionary.
  
              Returns:
                  (dict|None): The link as an alternative serialization format.