JKorf / HTX.Net

A C# .netstandard client library for the Huobi REST and Websocket Spot and Swap API focusing on clear usage and models
https://jkorf.github.io/HTX.Net/
MIT License
73 stars 53 forks source link

Websocket SubscribeToAccountUpdatesAsync missing number option #77

Closed Gustavobbr closed 2 years ago

Gustavobbr commented 2 years ago
        public async Task<CallResult<UpdateSubscription>> SubscribeToAccountUpdatesAsync(Action<DataEvent<HuobiAccountUpdate>> onAccountUpdate)
        {
            var request = new HuobiAuthenticatedSubscribeRequest("accounts.update#1"); //<--- Here
            var internalHandler = new Action<DataEvent<JToken>>(data =>
            {
                DeserializeAndInvoke(data, onAccountUpdate);
            });
            return await SubscribeAsync(request, null, true, internalHandler).ConfigureAwait(false);
        }

The Method to subscribe to Account Updates already comes with "accounts.update#1".

On Huobi's documentation, you should have the options to choose to which updates you want to subscribe : 1、Not specifying "mode": accounts.update Only update when account balance changed;

2、Specify "mode" as 0: accounts.update#0 Only update when account balance changed;

3、Specify "mode" as 1: accounts.update#1 Update when either account balance changed or available balance changed.

4、Specify "mode" as 2: accounts.update#2 Whenever account balance or available balance changed, it will be updated together.

Is it possible to change that number as Input when subscribing the method ?

JKorf commented 2 years ago

Has been implemented