コード例 #1
0
        public string ToJson()
        {
            var json = "{"
                       + $"\"@context\":\"{Context}\","
                       + $"\"type\":\"{Type}\","
                       + $"\"targetHash\":\"{HexEncoder.Encode(TargetHash)}\","
                       + $"\"merkleRoot\":\"{HexEncoder.Encode(MerkleRoot)}\","
                       + $"\"proof\":[";

            json  = _proof.Aggregate(json, (current, p) => current + p.ToJson() + ",");
            json += "],"
                    + "\"anchors\": [";
            json  = _anchors.Aggregate(json, (current, a) => current + a.ToJson() + ",");
            json += "]"
                    + "}";
            return(json);
        }