Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Can't get the rateLimits when call getExchangeInfo() #154

Closed
truonghatsts opened this issue Jul 19, 2018 · 13 comments
Closed

Can't get the rateLimits when call getExchangeInfo() #154

truonghatsts opened this issue Jul 19, 2018 · 13 comments

Comments

@truonghatsts
Copy link

I got below error when call getExchangeInfo()

com.binance.api.client.exception.BinanceApiException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `com.binance.api.client.domain.general.RateLimitType` from String "REQUEST_WEIGHT": value not one of declared Enum instance names: [REQUESTS, ORDERS]
 at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 77] (through reference chain: com.binance.api.client.domain.general.ExchangeInfo["rateLimits"]->java.util.ArrayList[0]->com.binance.api.client.domain.general.RateLimit["rateLimitType"])
        at com.binance.api.client.impl.BinanceApiServiceGenerator.executeSync(BinanceApiServiceGenerator.java:60)
        at com.binance.api.client.impl.BinanceApiRestClientImpl.getExchangeInfo(BinanceApiRestClientImpl.java:59)
Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `com.binance.api.client.domain.general.RateLimitType` from String "REQUEST_WEIGHT": value not one of declared Enum instance names: [REQUESTS, ORDERS]
 at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 77] (through reference chain: com.binance.api.client.domain.general.ExchangeInfo["rateLimits"]->java.util.ArrayList[0]->com.binance.api.client.domain.general.RateLimit["rateLimitType"])
        at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67)
        at com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1548)
        at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdStringValue(DeserializationContext.java:910)
        at com.fasterxml.jackson.databind.deser.std.EnumDeserializer._deserializeAltString(EnumDeserializer.java:255)
        at com.fasterxml.jackson.databind.deser.std.EnumDeserializer.deserialize(EnumDeserializer.java:179)
        at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
        at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
        at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1611)
        at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1203)
        at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:32)
        at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:23)
        at retrofit2.ServiceMethod.toResponse(ServiceMethod.java:119)
        at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:218)
        at retrofit2.OkHttpCall.execute(OkHttpCall.java:180)
        at com.binance.api.client.impl.BinanceApiServiceGenerator.executeSync(BinanceApiServiceGenerator.java:52)
        ... 18 more
@donwitti
Copy link

donwitti commented Jul 19, 2018

RateLimitType.REQUESTS was renamed to REQUEST_WEIGHT , see changelog:
https://github.com/binance-exchange/binance-official-api-docs/blob/f9d3872882871e97cc9e4fd92b681222ab4eb5d9/CHANGELOG.md

@bonobo1984
Copy link

So what would be the resolving action for any java projects?

@truonghatsts
Copy link
Author

@bonobo1984 there is an issue asking for the plan #155

@bonobo1984
Copy link

I made a change to the RateLimitType and ExchangeInfoDeserializer, but that exposes the following:

Exception in thread "main" com.binance.api.client.exception.BinanceApiException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of com.binance.api.client.domain.general.FilterType from String value ("MAX_NUM_ALGO_ORDERS"): value not one of declared Enum instance names: [EXCHANGE_MAX_NUM_ORDERS, MAX_ALGO_ORDERS, MAX_NUM_ORDERS, EXCHANGE_MAX_ALGO_ORDERS, MIN_NOTIONAL, PRICE_FILTER, LOT_SIZE]
at [Source: okhttp3.ResponseBody$BomAwareReader@63021689; line: 1, column: 785] (through reference chain: com.binance.api.client.domain.general.ExchangeInfo["symbols"]->java.util.ArrayList[0]->com.binance.api.client.domain.general.SymbolInfo["filters"]->java.util.ArrayList[3]->com.binance.api.client.domain.general.SymbolFilter["filterType"])
at com.binance.api.client.impl.BinanceApiServiceGenerator.executeSync(BinanceApiServiceGenerator.java:60)
at com.binance.api.client.impl.BinanceApiRestClientImpl.getExchangeInfo(BinanceApiRestClientImpl.java:59)
at com.gamechanger.binance.production.App.main(App.java:61)

@truonghatsts
Copy link
Author

@bonobo1984 There is another place to change, see this commit #156

@bonobo1984
Copy link

Thanks, i followed those steps but then got this:
Exception in thread "main" com.binance.api.client.exception.BinanceApiException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "maxNumAlgoOrders" (class com.binance.api.client.domain.general.SymbolFilter), not marked as ignorable (9 known properties: "filterType", "minQty", "maxPrice", "minPrice", "limit", "stepSize", "tickSize", "maxQty", "minNotional"])
at [Source: okhttp3.ResponseBody$BomAwareReader@63021689; line: 1, column: 827] (through reference chain: com.binance.api.client.domain.general.ExchangeInfo["symbols"]->java.util.ArrayList[0]->com.binance.api.client.domain.general.SymbolInfo["filters"]->java.util.ArrayList[3]->com.binance.api.client.domain.general.SymbolFilter["maxNumAlgoOrders"])
at com.binance.api.client.impl.BinanceApiServiceGenerator.executeSync(BinanceApiServiceGenerator.java:60)
at com.binance.api.client.impl.BinanceApiRestClientImpl.getExchangeInfo(BinanceApiRestClientImpl.java:59)
at com.gamechanger.binance.production.App.main(App.java:61)
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "maxNumAlgoOrders" (class com.binance.api.client.domain.general.SymbolFilter), not marked as ignorable (9 known properties: "filterType", "minQty", "maxPrice", "minPrice", "limit", "stepSize", "tickSize", "maxQty", "minNotional"])
at [Source: okhttp3.ResponseBody$BomAwareReader@63021689; line: 1, column: 827] (through reference chain: com.binance.api.client.domain.general.ExchangeInfo["symbols"]->java.util.ArrayList[0]->com.binance.api.client.domain.general.SymbolInfo["filters"]->java.util.ArrayList[3]->com.binance.api.client.domain.general.SymbolFilter["maxNumAlgoOrders"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62)

@bonobo1984
Copy link

Appreciate any support as it will not be possible to start up my app without the price filter and lot size info.

@joaopsilva
Copy link
Member

Hi, I've merged a fix for it, please update your repo.

@nahum365
Copy link

I'm still getting the error that @bonobo1984 was getting, even after updating and recompiling.

Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "maxNumAlgoOrders" (class com.binance.api.client.domain.general.SymbolFilter), not marked as ignorable (9 known properties: "filterType", "minQty", "maxPrice", "minPrice", "limit", "stepSize", "tickSize", "maxQty", "minNotional"])
 at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 827] (through reference chain: com.binance.api.client.domain.general.ExchangeInfo["symbols"]->java.util.ArrayList[0]->com.binance.api.client.domain.general.SymbolInfo["filters"]->java.util.ArrayList[3]->com.binance.api.client.domain.general.SymbolFilter["maxNumAlgoOrders"])

@joaopsilva
Copy link
Member

Let me have a look at that.

@joaopsilva joaopsilva reopened this Jul 19, 2018
@bonobo1984
Copy link

bonobo1984 commented Jul 19, 2018

Thank you, appreciate the resposiveness. To confirm, I just imported the latest version and still have that issue too.

@joaopsilva
Copy link
Member

Alright, this is now fixed, I've added support for two new filters in the API.

@truonghatsts
Copy link
Author

Confirm it works, thanks @joaopsilva

nilswx pushed a commit to nilswx/binance-java-api that referenced this issue Dec 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants