code: def txn2data(self, txn: dict) -> str:
          
  
          rv_json = json.dumps({})
          if self == Protocol.V_13:
              rv_json = json.dumps(txn['result'].get('data', {}))
          else:
              rv_json = json.dumps((txn['result'].get('data', {}) or {}).get('txn', {}))  # "data": null for no such txn
  
          return rv_json
docs: Given ledger transaction, return its data json.
  
          :param txn: transaction as dict
          :return: transaction data json