From f01c88d7afb0e23fe34fc1b4bf6677a07e8787d8 Mon Sep 17 00:00:00 2001 From: JKorf Date: Wed, 6 Mar 2024 22:12:22 +0100 Subject: [PATCH] Update README.md --- README.md | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 00649ce..a35bbb9 100644 --- a/README.md +++ b/README.md @@ -23,22 +23,25 @@ The library is targeting both `.NET Standard 2.0` and `.NET Standard 2.1` for op dotnet add package Bitfinex.Net ## How to use -* REST Endpoints - ```csharp - // Get the ETH/USDT ticker via rest request - var restClient = new BitfinexRestClient(); - var tickerResult = await restClient.SpotApi.ExchangeData.GetTickerAsync("tETHUST"); - var lastPrice = tickerResult.Data.LastPrice; - ``` -* Websocket streams - ```csharp - // Subscribe to ETH/USDT ticker updates via the websocket API - var socketClient = new BitfinexSocketClient(); - var tickerSubscriptionResult = socketClient.SpotApi.SubscribeToTickerUpdatesAsync("tETHUST", (update) => - { - var lastPrice = update.Data.LastPrice; - }); - ``` +*REST Endpoints* + +```csharp +// Get the ETH/USDT ticker via rest request +var restClient = new BitfinexRestClient(); +var tickerResult = await restClient.SpotApi.ExchangeData.GetTickerAsync("tETHUST"); +var lastPrice = tickerResult.Data.LastPrice; +``` + +*Websocket streams* + +```csharp +// Subscribe to ETH/USDT ticker updates via the websocket API +var socketClient = new BitfinexSocketClient(); +var tickerSubscriptionResult = socketClient.SpotApi.SubscribeToTickerUpdatesAsync("tETHUST", (update) => +{ + var lastPrice = update.Data.LastPrice; +}); +``` For information on the clients, dependency injection, response processing and more see the [documentation](https://jkorf.github.io/CryptoExchange.Net), or have a look at the examples [here](https://github.com/JKorf/CryptoExchange.Net/tree/master/Examples).