示例#1
0
        public static RpcResponse FromJson(JObject json)
        {
            RpcResponse response = new()
            {
                Id      = json["id"],
                JsonRpc = json["jsonrpc"].AsString(),
                Result  = json["result"]
            };

            if (json["error"] != null)
            {
                response.Error = RpcResponseError.FromJson(json["error"]);
            }

            return(response);
        }
示例#2
0
        public static RpcResponse FromJson(JObject json)
        {
            var response = new RpcResponse
            {
                Id      = (int?)json["id"]?.AsNumber(),
                Jsonrpc = json["jsonrpc"].AsString(),
                Result  = json["result"]
            };

            if (json["error"] != null)
            {
                response.Error = RpcResponseError.FromJson(json["error"]);
            }

            return(response);
        }