示例#1
0
        public Result <TxFeeForSend> EstimateTxFeeForSendMany(string fromAccount, IEnumerable <SendItemInfo> sendManyModels)
        {
            var         subtractFeeFromAmounts = sendManyModels.Where(x => x.IsContainFee).Select(x => x.Address).ToArray();
            ApiResponse response = TransactionApi.EstimateTxFeeForSendMany(fromAccount, sendManyModels.ToArray(), subtractFeeFromAmounts).Result;

            return(base.GetResult <TxFeeForSend>(response));
        }
        public async Task TestEstimateTxFeeForSendMany()
        {
            string fromAccount = "fiiitCPyohiEPn9q11AXCdvVDouoVvgojXBcVj";

            SendManyModel[] om = new SendManyModel[] { new SendManyModel {
                                                           Address = "fiiitCPyohiEPn9q11AXCdvVDouoVvgojXBcVj", Tag = "John", Amount = 100000000000
                                                       }, new SendManyModel {
                                                           Address = "fiiitCPyohiEPn9q11AXCdvVDouoVvgojXBcVj", Tag = null, Amount = 100000000000
                                                       } };
            string[]    subtractFeeFromAmount = new string[] { "fiiitCPyohiEPn9q11AXCdvVDouoVvgojXBcVj", "fiiitCPyohiEPn9q11AXCdvVDouoVvgojXBcVj" };
            ApiResponse response = await TransactionApi.EstimateTxFeeForSendMany(fromAccount, om, subtractFeeFromAmount);

            Assert.IsFalse(response.HasError);
            TxFeeForSend result = response.GetResult <TxFeeForSend>();

            Assert.IsNotNull(result);
        }