code: def ToJson(self):
          
          json = {}
          json["hash"] = self.Hash.To0xString()
          json["size"] = self.Size()
          json["version"] = self.Version
          json["previousblockhash"] = self.PrevHash.To0xString()
          json["merkleroot"] = self.MerkleRoot.To0xString()
          json["time"] = self.Timestamp
          json["index"] = self.Index
          nonce = bytearray(self.ConsensusData.to_bytes(8, 'little'))
          nonce.reverse()
          json["nonce"] = nonce.hex()
          json['nextconsensus'] = Crypto.ToAddress(self.NextConsensus)
          # json["consensus data"] = self.ConsensusData
          json["script"] = '' if not self.Script else self.Script.ToJson()
          return json
docs: Convert object members to a dictionary that can be parsed as JSON.
  
          Returns:
               dict: