A dotnet standard wrapper for the DeFi Pulse API.
Available on Nuget.
Install-Package DeFiPulse -Version 1.0.1
In order to use this package, simply add in the ConfigureServices
method in your Startup.cs
class:
services.AddDeFiPulse("Your DeFi Pulse Api Key Here");
To have access to the DeFiPulse service, simply get it by constructor injection:
private readonly IDeFiPulse _deFiPulse;
public WeatherForecastController(IDeFiPulse deFiPulse)
{
_deFiPulse = deFiPulse;
}
The following example shows how to get the Ethereum Gas Price:
GasPrice gasPrice = await _deFiPulse.GetGasPriceAsync();
We get the following JSON response:
{
"fast": 780,
"fastest": 780,
"safeLow": 350,
"average": 400,
"block_time": 14.03125,
"blockNum": 11461145,
"speed": 0.9989337462556375,
"safeLowWait": 13.7,
"avgWait": 1.5,
"fastWait": 0.5,
"fastestWait": 0.5
}