Nethereum can be used easily in
C# Uiscripter. It's a new program similar to QM2, also known as QM3. In QM2 maybe possible but too hard.
1. Install C# Uiscripter and .NET 6 SDK.
2. In NuGet find a Nethereum package (I guess Nethereum.Web3) and copy its PM> text.
3. In Uiscripter open menu Tools -> NuGet, paste, optionally select or create new folder in the combobox (see comment below), click Install, click Add, close.
4. Use Nethereum in the script.
I tested code from
https://nethereum.readthedocs.io/en/late...g-started/
It fails at run time, HTTP error 403 (Forbidden). I guess it is normal.
// script "Nethereum.cs" /*/ nuget nethereum\Nethereum.Web3; /*/
using Nethereum.Web3;
namespace NethereumSample
{
class Program
{
static void Main(string[] args)
{
GetAccountBalance().Wait();
}
static async Task GetAccountBalance()
{
var web3 = new Web3("https://mainnet.infura.io/v3/7238211010344719ad14a89db874158c");
var balance = await web3.Eth.GetBalance.SendRequestAsync("0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae");
Console.WriteLine($"Balance in Wei: {balance.Value}");
var etherAmount = Web3.Convert.FromWei(balance.Value);
Console.WriteLine($"Balance in Ether: {etherAmount}");
}
}
}
The package consists of 20-30 files. To prevent adding so much garbage to an existing folder, I installed it into a separate folder named nethereum: in the NuGet dialog click the combobox, select New folder, enter name.