Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }