예제 #1
0
파일: Node.cs 프로젝트: 0bsnetwork/ZbsCS
        public string MassTransfer(PrivateKeyAccount sender, Asset asset, IEnumerable <MassTransferItem> transfers,
                                   string message = "", decimal?fee = null)
        {
            var tx = new MassTransferTransaction(ChainId, sender.PublicKey, asset, transfers, message, fee);

            tx.Sign(sender);
            return(Broadcast(tx));
        }
예제 #2
0
파일: Node.cs 프로젝트: 0bsnetwork/ZbsCS
        public string MassTransfer(PrivateKeyAccount sender, Asset asset, string recipientsListFile,
                                   string message = "", decimal?fee = null)
        {
            string line;
            List <MassTransferItem> transfers = new List <MassTransferItem>();

            System.IO.StreamReader file =
                new System.IO.StreamReader(recipientsListFile);
            while ((line = file.ReadLine()) != null)
            {
                var item   = line.Split(new char[] { ',' });
                var amount = decimal.Parse(item[1], CultureInfo.GetCultureInfo("en-US"));
                transfers.Add(new MassTransferItem(item[0], amount));
            }
            file.Close();

            var tx = new MassTransferTransaction(ChainId, sender.PublicKey, asset, transfers, message, fee);

            tx.Sign(sender);
            return(Broadcast(tx));
        }