Marfusios / bitmex-client-websocket

🛠️ C# client for Bitmex websocket API
Apache License 2.0
63 stars 44 forks source link

Support authKeyExpires for expires based authentication #5

Open supermomonga opened 6 years ago

supermomonga commented 6 years ago

According to the document, it's not recommended to use nonce for authentication.

https://www.bitmex.com/app/apiKeysUsage#Authenticating-with-an-API-Key

The new recommended way to authenticate is to use expires fir signature calculation, and it's also supported in WebSocket API.

https://www.bitmex.com/app/wsAPI#Authentication

So we can add authKeyExpires method.

supermomonga commented 6 years ago

note: Python implementation is here. https://github.com/BitMEX/sample-market-maker/blob/master/market_maker/auth/APIKeyAuthWithExpires.py

supermomonga commented 6 years ago

I'm working on this now.

Sign the initial upgrade request in the same manner you would sign other REST calls (api-* headers), or

This way is not working as expected. I'll send a ticket to the BitMEX support.

After connection, send an "authKeyExpires".

This way works fine at my local branch.

I'll send a Pull Request later.

Marfusios commented 6 years ago

Hello, ok, thank you. Looking forward to PR