Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Mar 6, 2024
1 parent f5b551a commit da06cd3
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -23,22 +23,25 @@ The library is targeting both `.NET Standard 2.0` and `.NET Standard 2.1` for op
dotnet add package BingX.Net

## How to use
* REST Endpoints
```csharp
// Get the ETH/USDT ticker via rest request
var restClient = new BingXRestClient();
var tickerResult = await restClient.SpotApi.ExchangeData.BingXAsync("ETHUSDT");
var lastPrice = tickerResult.Data.LastPrice;
```
* Websocket streams
```csharp
// Subscribe to ETH/USDT ticker updates via the websocket API
var socketClient = new BingXSocketClient();
var tickerSubscriptionResult = socketClient.SpotApi.ExchangeData.SubscribeToBingXUpdatesAsync("ETHUSDT", (update) =>
{
var lastPrice = update.Data.LastPrice;
});
```
*REST Endpoints*

```csharp
// Get the ETH/USDT ticker via rest request
var restClient = new BingXRestClient();
var tickerResult = await restClient.SpotApi.ExchangeData.BingXAsync("ETHUSDT");
var lastPrice = tickerResult.Data.LastPrice;
```

*Websocket streams*

```csharp
// Subscribe to ETH/USDT ticker updates via the websocket API
var socketClient = new BingXSocketClient();
var tickerSubscriptionResult = socketClient.SpotApi.ExchangeData.SubscribeToBingXUpdatesAsync("ETHUSDT", (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/BingX.Net/tree/master/Examples) or [here](https://github.com/JKorf/CryptoExchange.Net/tree/master/Examples).

0 comments on commit da06cd3

Please sign in to comment.