Esempio n. 1
0
        public Result <string> SendMany(string fromAccount, IEnumerable <SendItemInfo> sendManyModels)
        {
            var subtractFeeFromAmounts = new List <string>();

            sendManyModels.ToList().ForEach(x =>
            {
                if (x.IsContainFee)
                {
                    subtractFeeFromAmounts.Add(x.Address);
                }
            });
            ApiResponse response = TransactionApi.SendMany(fromAccount, sendManyModels.ToArray(), subtractFeeFromAmounts.ToArray()).Result;

            return(base.GetResult <string>(response));;
        }
        public async Task TestSendMany()
        {
            string fromAccount = "1B7CXXyT2KQSHprzbprQDXnmkFEUTJU7yS";

            SendManyModel[] om = new SendManyModel[] { new SendManyModel {
                                                           Address = "1317nkscoSnkZnGdFMqVawjJv3xxU5vyfb", Tag = "John", Amount = 100000000000
                                                       }, new SendManyModel {
                                                           Address = "1No2SahjFuguswiSvHv1DqotTRdMNs4FH", Tag = null, Amount = 100000000000
                                                       } };
            string[]    subtractFeeFromAmount = new string[] { "1317nkscoSnkZnGdFMqVawjJv3xxU5vyfb", "1No2SahjFuguswiSvHv1DqotTRdMNs4FH" };
            ApiResponse response = await TransactionApi.SendMany(fromAccount, om, subtractFeeFromAmount);

            // Client Use
            Assert.IsFalse(response.HasError);
            string result = response.GetResult <string>();

            Assert.IsNotNull(result);
        }