code: def ToJson(self):
          
          json = super(AccountState, self).ToJson()
          addr = Crypto.ToAddress(self.ScriptHash)
  
          json['address'] = addr
          json['script_hash'] = str(self.ScriptHash)
          json['frozen'] = self.IsFrozen
          json['votes'] = [v.hex() for v in self.Votes]
  
          balances = []
          for key, value in self.Balances.items():
              balances.append({'asset': key.To0xString(), 'value': value.ToString()})
  
          json['balances'] = balances
          return json
docs: Convert object members to a dictionary that can be parsed as JSON.
  
          Returns:
               dict: