1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-13 09:23:04 +00:00
This commit is contained in:
Jkorf
2022-01-19 16:35:08 +01:00
parent 7427914cb7
commit fe31cf156d
10 changed files with 147 additions and 28 deletions
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Binance.Net.Clients;
namespace ConsoleClient.Exchanges
{
internal class BinanceExchange : IExchange
{
public async Task<decimal> GetPrice(string symbol)
{
using var client = new BinanceClient();
var result = await client.SpotApi.ExchangeData.GetPriceAsync(symbol);
// Should check result success status here
return result.Data.Price;
}
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleClient.Exchanges
{
public interface IExchange
{
Task<decimal> GetPrice(string symbol);
}
}