public async Task Should_Get_Asset_Holders()
        {
            using (Client client = new Client(HOST, USERNAME, PASSWORD))
            {
                var request = new Colu.Models.GetStakeHolders.Request()
                {
                    Id = Guid.NewGuid().ToString()
                };
                request.Params.AssetId = BITPOKER_ASSET_ID;
                request.Params.NumberConfirmations = 1;

                var actual = await client.GetStakeHoldersAsync(request);
                Assert.IsNotNull(actual);
                Assert.IsNotNull(actual.Result);
                Assert.AreEqual(BITPOKER_ASSET_ID, actual.Result.AssetId);
                Assert.IsTrue(actual.Result.Holders.Count > 0);
            }
        }
Esempio n. 2
0
        public async Task <Models.GetStakeHolders.Response> GetStakeHoldersAsync(String assetId, Int32 numberOfConfirmations)
        {
            var request = new Colu.Models.GetStakeHolders.Request()
            {
                Id = Guid.NewGuid().ToString()
            };

            request.Params.AssetId             = assetId;
            request.Params.NumberConfirmations = numberOfConfirmations;

            String        json           = JsonConvert.SerializeObject(request);
            StringContent requestContent = new StringContent(json, Encoding.UTF8, MEDIA_TYPE);
            String        url            = String.Format("{0}", _host);

            String response = await Post(requestContent, url);

            return(JsonConvert.DeserializeObject <Models.GetStakeHolders.Response>(response));
        }
Esempio n. 3
0
        public async Task Should_Get_Asset_Holders()
        {
            using (Client client = new Client(HOST, USERNAME, PASSWORD))
            {
                var request = new Colu.Models.GetStakeHolders.Request()
                {
                    Id = Guid.NewGuid().ToString()
                };
                request.Params.AssetId             = BITPOKER_ASSET_ID;
                request.Params.NumberConfirmations = 1;

                var actual = await client.GetStakeHoldersAsync(request);

                Assert.IsNotNull(actual);
                Assert.IsNotNull(actual.Result);
                Assert.AreEqual(BITPOKER_ASSET_ID, actual.Result.AssetId);
                Assert.IsTrue(actual.Result.Holders.Count > 0);
            }
        }
Esempio n. 4
0
        public async Task<Models.GetStakeHolders.Response> GetStakeHoldersAsync(String assetId, Int32 numberOfConfirmations)
        {
            var request = new Colu.Models.GetStakeHolders.Request()
            {
                Id = Guid.NewGuid().ToString()
            };
            request.Params.AssetId = assetId;
            request.Params.NumberConfirmations = numberOfConfirmations;

            String json = JsonConvert.SerializeObject(request);
            StringContent requestContent = new StringContent(json, Encoding.UTF8, MEDIA_TYPE);
            String url = String.Format("{0}", _host);

            String response = await Post(requestContent, url);
            return JsonConvert.DeserializeObject<Models.GetStakeHolders.Response>(response);
        }