Nethereum / Nethereum.Playground

Compile and run Nethereum snippets on the browser
MIT License
27 stars 17 forks source link

Example of pending transactions using a filter #34

Closed juanfranblanco closed 3 years ago

juanfranblanco commented 4 years ago

using System; using System.Text; using Nethereum.Hex.HexConvertors.Extensions; using System.Threading.Tasks; using Nethereum.Web3;

public class Program {

static async Task Main(string[] args)
{

            var web3 = new Web3("https://mainnet.infura.io/v3/7238211010344719ad14a89db874158c");

            var pendingFilter = await web3.Eth.Filters.NewPendingTransactionFilter.SendRequestAsync();

            var filterChanges = await web3.Eth.Filters.GetFilterChangesForBlockOrTransaction.SendRequestAsync(pendingFilter);
            foreach(var value in filterChanges) {
                Console.WriteLine(value);
            }

}

}