Esempio n. 1
0
        public bool Run(ComposeChainRequest requestData)
        {
            var request = new RestRequest(Method.POST);

            request.JsonSerializer = new NewtonsoftJsonSerializer();
            request.AddJsonBody(requestData);

            var reply = Client.RestClient.Execute(request);

            JsonReply = reply.Content;
            if (reply.StatusCode == System.Net.HttpStatusCode.OK)
            {
                Result = JsonConvert.DeserializeObject <ComposeChainResult>(reply.Content);
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        public bool Run(byte[] Content, String ECpub, byte [][] ExtIDs = null)
        {
            if (ExtIDs == null)
            {
                ExtIDs = FactomUtils.MakeExtIDs();
            }


            var chainHash = new List <byte>();

            foreach (var extId in ExtIDs)
            {
                var h = SHA256.Create().ComputeHash(extId);
                chainHash.AddRange(h);
            }

            Request = new ComposeChainRequest();
            Request.param.Chain.firstentry.Content = Content.ToHexString();
            Request.param.Chain.firstentry.Extids  = ExtIDs.ExtIDsToHexStrings();
            Request.param.Ecpub = ECpub;
            return(Run(Request));
        }