· 6 years ago · Jul 11, 2019, 05:00 AM
1 public BinanceBalance getBalance(string apiKey, string secretKey, string balance)
2 {
3 BinanceClient.SetDefaultOptions(new BinanceClientOptions()
4 {
5 ApiCredentials = new ApiCredentials(apiKey, secretKey),
6 });
7
8 using (var client = new BinanceClient())
9 {
10 var accountInfo = client.GetAccountInfo();
11
12 return accountInfo.Data.Balances.FirstOrDefault(f => f.Asset == balance);
13 }
14 }