code: def ToJson(self):
          
  
          type = ''
          if self.Type == StateType.Validator:
              type = 'Validator'
          elif self.Type == StateType.Account:
              type = 'Account'
  
          return {
              'type': type,
              'key': self.Key.hex(),
              'field': self.Field,
              'value': self.Value.hex()
          }
docs: Convert object members to a dictionary that can be parsed as JSON.
  
          Returns:
               dict: