.NET 6 and Nethereum have been used to create a REST API:
- /api/GetEthBalance/{wallet}
the API return the balance associated with the wallet address provided.
- Get a free API Key at https://infura.io/ (to access ethereum mainnet)
- Clone the repo
- dotnet restore
dotnet restore
- Enter your infura key in
appsettings.json
"ApiConfiguration":{ "InfuraKey":"#placeholder#" }
- dotnet build
dotnet build
- dotnet run
dotnet run
Nethereum is the .Net integration library for Ethereum, simplifying the access and smart contract interaction with Ethereum nodes both public or permissioned like Geth, Parity or Quorum.
Nethereum is developed targeting netstandard 1.1, netstandard 2.0, netcore 2.1, netcore 3.1, net451 and also as a portable library, hence it is compatible with all the operating systems (Windows, Linux, MacOS, Android and OSX) and has been tested on cloud, mobile, desktop, Xbox, hololens and windows IoT.
check more here: https://github.com/Nethereum/Nethereum