https://github.com/purkayasta/krakenrestclient
a minimal performant c# library for kraken 🎉
https://github.com/purkayasta/krakenrestclient
cryptocurrency cryptocurrency-exchanges csharp dotnet kraken kraken-exchange-api
Last synced: 2 months ago
JSON representation
a minimal performant c# library for kraken 🎉
- Host: GitHub
- URL: https://github.com/purkayasta/krakenrestclient
- Owner: purkayasta
- License: mit
- Created: 2022-08-03T16:08:44.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-09T21:40:16.000Z (about 2 years ago)
- Last Synced: 2025-01-20T21:56:28.558Z (over 1 year ago)
- Topics: cryptocurrency, cryptocurrency-exchanges, csharp, dotnet, kraken, kraken-exchange-api
- Language: C#
- Homepage: https://www.nuget.org/packages/KrakenRestClient/
- Size: 256 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# KrakenRestClient
> A very minimal, performant c# client library for [kraken crypto exchange](https://www.kraken.com/)
[Download from NUGET](https://www.nuget.org/packages/KrakenRestClient/)



# Usage:
## Instantiation:
### Microsoft DI:
```c#
builder.service.AddKraken("apikey", "secretkey");
public class ApiController {
private readonly IKrakenClient krakenClient;
public ApiController(IKrakenClient krakenClient)
=> this.krakenClient = krakenClient;
}
```
### Factory Pattern:
```c#
IKrakenClient krakenClient = KrakenInstaller
.CreateClient("Your Prefer HTTP Client/ HttpClientFactory", "apikey", "secretkey");
```
### API Example:
1. ServerTime
```c#
ServerTimeResponse serverTime = await this.krakenClient.MarketData.GetServerTimeAsync();
Console.WriteLine(serverTime.Result.UnixTime);
```
2. TickerInformation (Crypto Prices)
```c#
TickerInformationResponse tickerResponse = await this.krakenClient.MarketData.GetTickerInformationAsync("ETHUSD");
Console.WriteLine(tickerResponse.Result.TodayOpeningPrice);
```