This is a C# implementation of the Bitfinex websocket API version 2.0 (BETA) found here:
https://bitfinex.readme.io/v2/docs
Apache License 2.0
- instalation via NuGet (Bitfinex.Client.Websocket)
- public and authenticated API
- targeting .NET Standard 2.0 (.NET Core, Linux/MacOS compatible)
- reactive extensions (Rx.NET)
- integrated logging (Serilog)
var exitEvent = new ManualResetEvent(false);
var url = BitfinexValues.ApiWebsocketUrl;
using (var communicator = new BitfinexWebsocketCommunicator(url))
{
using (var client = new BitfinexWebsocketClient(communicator))
{
client.Streams.PongStream.Subscribe(pong =>
{
Console.WriteLine($"Pong received! Id: {pong.Cid}") // Pong received! Id: 123456
exitEvent.Set();
});
await communicator.Start();
await client.Send(new PingRequest() {Cid = 123456});
exitEvent.WaitOne(TimeSpan.FromSeconds(30));
}
}
More usage examples:
PUBLIC | Covered |
---|---|
Info | ✔ |
Ping-Pong | ✔ |
Errors | ✔ |
Channel subscribing | ✔ |
Channel unsubscribing | ✔ |
Ticker | ✔ |
Trades | ✔ |
Books | ✔ |
Raw books | |
Candles | ✔ |
AUTHENTICATED | Covered |
---|---|
Account info | ✔ |
Orders | ✔ |
Positions | |
Trades | |
Funding | |
Wallets | ✔ |
Balance | |
Notifications |
AUTHENTICATED - INPUT | Covered |
---|---|
New order | ✔ |
Cancel order | ✔ |
Cancel order multi | |
Calc |
Pull Requests are welcome!
Donations gratefully accepted.
- Bitcoin: 1HfxKZhvm68qK3gE8bJAdDBWkcZ2AFs9pw
- Litecoin: LftdENE8DTbLpV6RZLKLdzYzVU82E6dz4W
- Ethereum: 0xb9637c56b307f24372cdcebd208c0679d4e48a47