JKorf / Binance.Net

A C# .netstandard client library for the Binance REST and Websocket Spot and Futures API focusing on clear usage and models
https://jkorf.github.io/Binance.Net/
MIT License
1.02k stars 420 forks source link

BinanceRateLimit - Count Missing? #1367

Closed BzCz closed 2 months ago

BzCz commented 2 months ago

Hello @JKorf and thank you for all your hard work :)

When using SpotApi.Account.GetOrderRateLimitsAsync() The Count is always 0, is it because it is missing from BinanceRateLimit?

I have added it in here manually at the very end as an correct example, not sure tho? I'm using it on a sub-account so not sure if there is a difference.

I can see it added on it's own here under BinanceCurrentRateLimit: BinanceRateLimit but I don't think it works? Maybe I'm wrong but is it really meant to be in BinanceRateLimit?

namespace Binance.Net.Objects.Models.Spot
{
    /// <summary>
    /// Rate limit info
    /// </summary>
    public class BinanceCurrentRateLimit: BinanceRateLimit
    {
        /// <summary>
        /// The current used amount
        /// </summary>
        public int Count { get; set; }
    }
}

using Binance.Net.Converters;
using Binance.Net.Enums;

namespace Binance.Net.Objects.Models
{
    /// <summary>
    /// Rate limit info
    /// </summary>
    public class BinanceRateLimit
    {
        /// <summary>
        /// The interval the rate limit uses to count
        /// </summary>
        public RateLimitInterval Interval { get; set; }
        /// <summary>
        /// The type the rate limit applies to
        /// </summary>
        [JsonProperty("rateLimitType"), JsonConverter(typeof(RateLimitConverter))]
        public RateLimitType Type { get; set; }
        /// <summary>
        /// The amount of calls the limit is
        /// </summary>
        [JsonProperty("intervalNum")]
        public int IntervalNumber { get; set; }
        /// <summary>
        /// The amount of calls the limit is
        /// </summary>
        public int Limit { get; set; }
        /// <summary>
        /// The current used amount
        /// </summary>
       [JsonProperty("count")]
        public int Count { get; set; }

    }
}

Thanks again :)

JKorf commented 2 months ago

Hi, no it should also work with the property being on BinanceCurrentRateLimit. Do you mean that it stays on 0 when you did actually place orders? Can you have a look at the logging or set OutputOriginalData tot true in the client options to check what the server returns?

BzCz commented 2 months ago

Hey Dude,

So I did check all the raw json with your library and another library and everything is parsing correctly like you said. Yeah so feel free to close this issue as everything is working as expected like you said.

Thanks again for your hard work and time, best of luck.