Ejemplo n.º 1
0
        public async Task <List <TransactionReceipt> > TransferEqualAmounts(Web3 web3, string from, BigInteger amount,
                                                                            params string[] toAdresses)
        {
            var transfers = new List <Func <Task <string> > >();


            foreach (var to in toAdresses)
            {
                transfers.Add(() =>
                              web3.Eth.TransactionManager.SendTransactionAsync(new TransactionInput()
                {
                    From  = from,
                    To    = to,
                    Value = new HexBigInteger(amount),
                }));
            }
            var pollingService = new TransactionReceiptPollingService(web3.TransactionManager);

            return(await pollingService.SendRequestsAsync(transfers));
        }