You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,46 @@ A conversion library to convert between Binance (Smart) Chain units
44
44
var bnb = BscConvert.GweiToBnb(gwei); // 1.254
45
45
```
46
46
47
+
## BscScanner.Extensions.DependencyInjection
48
+
BscScanner extensions for Microsoft.Extensions.DependencyInjection
49
+
50
+
[](https://www.nuget.org/packages/BscScanner.Extensions.DependencyInjection)
3. Inject the service into your classes (ASP.NET Core API example)
67
+
```cs
68
+
[ApiController]
69
+
[Route("[controller]")]
70
+
public class BscScannerController : ControllerBase {
71
+
72
+
private readonly IBscScanClient _bscScanClient;
73
+
74
+
public BscScannerController(IBscScanClient bscScanClient) {
75
+
_bscScanClient = bscScanClient;
76
+
}
77
+
78
+
[HttpGet]
79
+
public async Task<float> GetBalanceFor(string address) {
80
+
var result = await _bscScanClient.GetBnbBalanceSingleAsync(address);
81
+
82
+
return result;
83
+
}
84
+
}
85
+
```
86
+
47
87
## How to contribute
48
88
49
89
You can contribute by pulling the code, making some changes and then opening a pull request. The changes will be revised and merged into main if it is a valid feature/bug fix.
0 commit comments