Skip to content

Commit

Permalink
Added Coinbase reference, updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Oct 7, 2024
1 parent 613766d commit 4131e56
Show file tree
Hide file tree
Showing 9 changed files with 211 additions and 7 deletions.
1 change: 1 addition & 0 deletions Examples/BlazorClient/BlazorClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<PackageReference Include="JK.Bitget.Net" Version="1.10.0" />
<PackageReference Include="JK.Mexc.Net" Version="1.8.0" />
<PackageReference Include="JK.OKX.Net" Version="2.4.0" />
<PackageReference Include="JKorf.Coinbase.Net" Version="1.0.0" />
<PackageReference Include="JKorf.HTX.Net" Version="6.1.0" />
<PackageReference Include="KrakenExchange.Net" Version="4.12.0" />
<PackageReference Include="Kucoin.Net" Version="5.14.0" />
Expand Down
5 changes: 5 additions & 0 deletions Examples/BlazorClient/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@inject IBitMartRestClient bitmartClient
@inject IBitgetRestClient bitgetClient
@inject IBybitRestClient bybitClient
@inject ICoinbaseRestClient coinbaseClient
@inject ICoinExRestClient coinexClient
@inject IGateIoRestClient gateioClient
@inject IHTXRestClient huobiClient
Expand All @@ -30,6 +31,7 @@
var bitgetTask = bitgetClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT_SPBL");
var bitmartTask = bitmartClient.SpotApi.ExchangeData.GetTickerAsync("BTC_USDT");
var bybitTask = bybitClient.V5Api.ExchangeData.GetSpotTickersAsync("BTCUSDT");
var coinbaseTask = coinbaseClient.AdvancedTradeApi.ExchangeData.GetSymbolAsync("BTC-USDT");
var coinexTask = coinexClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT");
var gateioTask = gateioClient.SpotApi.ExchangeData.GetTickersAsync("BTC_USDT");
var htxTask = huobiClient.SpotApi.ExchangeData.GetTickerAsync("btcusdt");
Expand Down Expand Up @@ -58,6 +60,9 @@
if (bybitTask.Result.Success)
_prices.Add("Bybit", bybitTask.Result.Data.List.First().LastPrice);

if (coinbaseTask.Result.Success)
_prices.Add("Coinbase", coinbaseTask.Result.Data.LastPrice ?? 0);

if (coinexTask.Result.Success)
_prices.Add("CoinEx", coinexTask.Result.Data.Ticker.LastPrice);

Expand Down
2 changes: 2 additions & 0 deletions Examples/BlazorClient/Pages/LiveData.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@inject IBitgetSocketClient bitgetSocketClient
@inject IBitMartSocketClient bitmartSocketClient
@inject IBybitSocketClient bybitSocketClient
@inject ICoinbaseSocketClient coinbaseSocketClient
@inject ICoinExSocketClient coinExSocketClient
@inject IGateIoSocketClient gateioSocketClient
@inject IHTXSocketClient htxSocketClient
Expand Down Expand Up @@ -39,6 +40,7 @@
bitmartSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH_BTC", data => UpdateData("BitMart", data.Data.LastPrice)),
bybitSocketClient.V5SpotApi.SubscribeToTickerUpdatesAsync("ETHBTC", data => UpdateData("Bybit", data.Data.LastPrice)),
coinExSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETHBTC", data => UpdateData("CoinEx", data.Data.LastPrice)),
coinbaseSocketClient.AdvancedTradeApi.SubscribeToTickerUpdatesAsync("ETH-BTC", data => UpdateData("Coinbase", data.Data.LastPrice)),
gateioSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH_BTC", data => UpdateData("GateIo", data.Data.LastPrice)),
htxSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ethbtc", data => UpdateData("HTX", data.Data.ClosePrice ?? 0)),
krakenSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH/XBT", data => UpdateData("Kraken", data.Data.LastTrade.Price)),
Expand Down
3 changes: 3 additions & 0 deletions Examples/BlazorClient/Pages/OrderBooks.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@using BitMart.Net.Interfaces;
@using Bybit.Net.Interfaces
@using CoinEx.Net.Interfaces
@using Coinbase.Net.Interfaces
@using CryptoExchange.Net.Interfaces
@using GateIo.Net.Interfaces
@using HTX.Net.Interfaces
Expand All @@ -22,6 +23,7 @@
@inject IBitgetOrderBookFactory bitgetFactory
@inject IBitMartOrderBookFactory bitmartFactory
@inject IBybitOrderBookFactory bybitFactory
@inject ICoinbaseOrderBookFactory coinbaseFactory
@inject ICoinExOrderBookFactory coinExFactory
@inject IGateIoOrderBookFactory gateioFactory
@inject IHTXOrderBookFactory htxFactory
Expand Down Expand Up @@ -68,6 +70,7 @@
{ "Bitget", bitgetFactory.CreateSpot("ETHBTC") },
{ "BitMart", bitmartFactory.CreateSpot("ETH_BTC", null) },
{ "Bybit", bybitFactory.Create("ETHBTC", Bybit.Net.Enums.Category.Spot) },
{ "Coinbase", coinbaseFactory.Create("ETH-BTC", null) },
{ "CoinEx", coinExFactory.CreateSpot("ETHBTC") },
{ "GateIo", gateioFactory.CreateSpot("ETH_BTC") },
{ "HTX", htxFactory.CreateSpot("ethbtc") },
Expand Down
1 change: 1 addition & 0 deletions Examples/BlazorClient/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddBitget();
services.AddBitMart();
services.AddBybit();
services.AddCoinbase();
services.AddCoinEx();
services.AddGateIo();
services.AddHTX();
Expand Down
1 change: 1 addition & 0 deletions Examples/BlazorClient/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@using Bitget.Net.Interfaces.Clients;
@using BitMart.Net.Interfaces.Clients;
@using Bybit.Net.Interfaces.Clients;
@using Coinbase.Net.Interfaces.Clients;
@using CoinEx.Net.Interfaces.Clients;
@using GateIo.Net.Interfaces.Clients;
@using HTX.Net.Interfaces.Clients;
Expand Down
1 change: 1 addition & 0 deletions Examples/ConsoleClient/ConsoleClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<PackageReference Include="JK.Bitget.Net" Version="1.10.0" />
<PackageReference Include="JK.Mexc.Net" Version="1.8.0" />
<PackageReference Include="JK.OKX.Net" Version="2.4.0" />
<PackageReference Include="JKorf.Coinbase.Net" Version="1.0.0" />
<PackageReference Include="JKorf.HTX.Net" Version="6.1.0" />
<PackageReference Include="KrakenExchange.Net" Version="4.12.0" />
<PackageReference Include="Kucoin.Net" Version="5.14.0" />
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The following API's are directly supported. Note that there are 3rd party implem
|Bitget|[JKorf/Bitget.Net](https://github.com/JKorf/Bitget.Net)|[![Nuget version](https://img.shields.io/nuget/v/JK.Bitget.net.svg?style=flat-square)](https://www.nuget.org/packages/JK.Bitget.Net)|
|BitMart|[JKorf/BitMart.Net](https://github.com/JKorf/BitMart.Net)|[![Nuget version](https://img.shields.io/nuget/v/BitMart.net.svg?style=flat-square)](https://www.nuget.org/packages/BitMart.Net)|
|Bybit|[JKorf/Bybit.Net](https://github.com/JKorf/Bybit.Net)|[![Nuget version](https://img.shields.io/nuget/v/Bybit.net.svg?style=flat-square)](https://www.nuget.org/packages/Bybit.Net)|
|Coinbase|[JKorf/Coinbase.Net](https://github.com/JKorf/Coinbase.Net)|[![Nuget version](https://img.shields.io/nuget/v/JKorf.Coinbase.Net.svg?style=flat-square)](https://www.nuget.org/packages/JKorf.Coinbase.Net)|
|CoinEx|[JKorf/CoinEx.Net](https://github.com/JKorf/CoinEx.Net)|[![Nuget version](https://img.shields.io/nuget/v/CoinEx.net.svg?style=flat-square)](https://www.nuget.org/packages/CoinEx.Net)|
|CoinGecko|[JKorf/CoinGecko.Net](https://github.com/JKorf/CoinGecko.Net)|[![Nuget version](https://img.shields.io/nuget/v/CoinGecko.net.svg?style=flat-square)](https://www.nuget.org/packages/CoinGecko.Net)|
|Gate.io|[JKorf/GateIo.Net](https://github.com/JKorf/GateIo.Net)|[![Nuget version](https://img.shields.io/nuget/v/GateIo.net.svg?style=flat-square)](https://www.nuget.org/packages/GateIo.Net)|
Expand All @@ -34,7 +35,7 @@ Any of these can be installed independently or install [CryptoClients.Net](https
A Discord server is available [here](https://discord.gg/MSpeEtSY8t). Feel free to join for discussion and/or questions around the CryptoExchange.Net and implementation libraries.

## Support the project
I develop and maintain this package on my own for free in my spare time, any support is greatly appreciated.
Any support is greatly appreciated.

### Donate
Make a one time donation in a crypto currency of your choice. If you prefer to donate a currency not listed here please contact me.
Expand All @@ -53,7 +54,7 @@ Alternatively, sponsor me on Github using [Github Sponsors](https://github.com/s
* Added ToRfc3339String extension method for DateTime type

* Version 8.0.0 - 27 Sep 2024
* Added new cross exchange interfaces implementation
* Added new cross exchange interfaces implementation
* Supports REST, WebSocket, Spot and Futures API's
* Added various client interfaces for specific functionality
* Added SharedSymbol type, taking care of symbol formatting for different exchanges
Expand Down
Loading

0 comments on commit 4131e56

Please sign in to comment.