Converts a ContractParameter instance to a json representation

        Returns:
            dict: a dictionary representation of the contract parameter
189717
def ToJson(self, auto_hex=True):
        
        jsn = {}
        jsn['type'] = str(ContractParameterType(self.Type))

        if self.Type == ContractParameterType.Signature:
            jsn['value'] = self.Value.hex()

        elif self.Type == ContractParameterType.ByteArray:
            if auto_hex:
                jsn['value'] = self.Value.hex()
            else:
                jsn['value'] = self.Value
        elif self.Type == ContractParameterType.Boolean:
            jsn['value'] = self.Value

        elif self.Type == ContractParameterType.String:
            jsn['value'] = str(self.Value)

        elif self.Type == ContractParameterType.Integer:
            jsn['value'] = self.Value

        # @TODO, see ``FromJson``, not sure if this is working properly
        elif self.Type == ContractParameterType.PublicKey:
            jsn['value'] = self.Value.ToString()

        elif self.Type in [ContractParameterType.Hash160,
                           ContractParameterType.Hash256]:
            jsn['value'] = self.Value.ToString()

        elif self.Type == ContractParameterType.Array:

            res = []
            for item in self.Value:
                if item:
                    res.append(item.ToJson(auto_hex=auto_hex))
            jsn['value'] = res

        elif self.Type == ContractParameterType.InteropInterface:
            try:
                jsn['value'] = self.Value.ToJson()
            except Exception as e:
                pass

        return jsn
28023
def to_json(self):
        

        result = super(Role, self).to_json()
        result.update({
            'name': self.name,
            'description': self.description,
            'permissions': self.permissions,
            'policies': self.policies
        })
        return result
705291
def to_json(self):
        
        return {
            'name': self.name,
            'segments': [segment.to_json() for segment in self.segments],
            'meta': self.meta
            }
803305
def to_dict(self):
        
        return {'access_key': self.access_key,
                'secret_key': self.secret_key,
                'session_token': self.session_token,
                'expiration': self.expiration,
                'request_id': self.request_id}
700185
def to_dict(self):
        
        schema = super(Schema, self).to_dict()
        schema['$schema'] = "http://json-schema.org/draft-04/schema#"
        if self._id:
            schema['id'] = self._id
        if self._desc:
            schema['description'] = self._desc
        return schema
1232437
def to_json(value, **kwargs):
        
        serial_dict = {
            key: (
                val.serialize(**kwargs) if isinstance(val, HasProperties)
                else val
            )
            for key, val in iteritems(value)
        }
        return serial_dict
726170
def to_json(self, indent=None, sort_keys=True):
        
        return json.dumps(self.to_dict(), indent=indent, sort_keys=sort_keys)
576604
def to_json(self, *args, **kwargs):
        
        return json.dumps(self.to_schema(), *args, **kwargs)
210667
def describe(self):
        
        return {
            "name": self.name,
            "params": self.params,
            "returns": self.returns,
            "description": self.description,
        }
550728
def to_json(self):
        '''  '''
        roots = []
        for r in self.roots:
            roots.append(r.to_json())
        return {'roots': roots}
602662
def to_json(self) -> Mapping:
        
        return {str(x): str(y) for x, y in self.items()}
1168014
def ToJson(self):
        
        jsn = super(InvocationTransaction, self).ToJson()
        jsn['script'] = self.Script.hex()
        jsn['gas'] = self.Gas.ToNeoJsonString()
        return jsn
321683
def to_json(self):
        
        data = dict()
        data['name'] = self.name
        data['language'] = self.language
        data['fancy_name'] = self.fancy_name
        data['scenario'] = self.scenario
        return data
833099
def ToJson(self):
        
        name = 'Contract'

        try:
            name = self.Name.decode('utf-8')
        except Exception as e:
            pass

        jsn = {'version': self.StateVersion}

        jsn_code = self.Code.ToJson()

        jsn_contract = {
            'name': name,
            'code_version': self.CodeVersion.decode('utf-8'),
            'author': self.Author.decode('utf-8'),
            'email': self.Email.decode('utf-8'),
            'description': self.Description.decode('utf-8'),
            'properties': {
                'storage': self.HasStorage,
                'dynamic_invoke': self.HasDynamicInvoke,
                'payable': self.Payable
            }
        }

        jsn.update(jsn_code)
        jsn.update(jsn_contract)

        if self._nep_token:
            jsn['token'] = self._nep_token.ToJson()

        return jsn
803533
def to_json_basic(self):
        
        return {'name': self.__class__.__name__, 'priority': self.priority,
                'address': self.address, 'rtr': self.rtr}
1223100
def to_json(self):
        

        result = {
            'name': self.name,
            'id': self._real_id(),
            'type': self.type,
            'localized': self.localized,
            'omitted': self.omitted,
            'required': self.required,
            'disabled': self.disabled,
            'validations': [v.to_json() for v in self.validations]
        }

        if self.type == 'Array':
            result['items'] = self.items

        if self.type == 'Link':
            result['linkType'] = self.link_type

        return result
1206877
def to_json(self):
        
        data = json.dumps(self)

        out = u'{"%s":%s}' % (self.schema['title'], data)
        return out