Ejemplo n.º 1
0
        public Result <TxFeeForSend> EstimateRawTransaction(List <SendRawTransactionInputsIM> senders, IEnumerable <SendItemInfo> sendManyModels, string changeAddress, long feeRate)
        {
            List <SendRawTransactionOutputsIM> receivers = new List <SendRawTransactionOutputsIM>();

            sendManyModels.ToList().ForEach(x =>
            {
                SendRawTransactionOutputsIM receiver = new SendRawTransactionOutputsIM
                {
                    Address = x.Address,
                    Amount  = x.Amount
                };
                receivers.Add(receiver);
            });

            ApiResponse response = TransactionApi.EstimateRawTransaction(senders.ToArray(), receivers.ToArray(), changeAddress, feeRate).Result;

            return(base.GetResult <TxFeeForSend>(response));
        }
Ejemplo n.º 2
0
        public Result <string> SendRawTransactions(List <SendRawTransactionInputsIM> senders, IEnumerable <SendItemInfo> sendManyModels, string changeAddress, long lockTime, long feeRate)
        {
            if (senders == null || !senders.Any())
            {
                return(null);
            }

            List <SendRawTransactionOutputsIM> receivers = new List <SendRawTransactionOutputsIM>();

            sendManyModels.ToList().ForEach(x =>
            {
                SendRawTransactionOutputsIM receiver = new SendRawTransactionOutputsIM
                {
                    Address = x.Address,
                    Amount  = x.Amount
                };
                receivers.Add(receiver);
            });

            ApiResponse response = TransactionApi.SendRawTransaction(senders.ToArray(), receivers.ToArray(), changeAddress, lockTime, feeRate).Result;

            return(base.GetResult <string>(response));;
        }