Comments (11)
Pull request #117 fixes this issue.
from binance-java-api.
I think the reason here is that Q A v q cannot be parsed as long. Maybe because of a recent update.
from binance-java-api.
Yes, I am facing the same issue and it is really annoying. Pleace fix this fast!
from binance-java-api.
The problem is the constructor
public BinanceApiWebSocketListener(BinanceApiCallback<T> callback) { this.callback = callback; this.eventTypeReference = new TypeReference<T>() {}; }
You can't get the Typereference of the callback that way. As a quick fix change the onMessage
method of the same class as follows:
@Override public void onMessage(WebSocket webSocket, String text) { if (webSocket.request().url().toString().endsWith("ticker@arr")) { eventTypeReference = (TypeReference<T>) new TypeReference<List<AllMarketTickersEvent>>(){}; } ObjectMapper mapper = new ObjectMapper(); try { T event = null; if (eventClass == null) { event = mapper.readValue(text, eventTypeReference); } else { event = mapper.readValue(text, eventClass); } callback.onResponse(event); } catch (IOException e) { throw new BinanceApiException(e); } }
This is only a temporary solution of course.
Furthermore you have to change the type of Q A v q in AllMarketTickersEvent
to Double as mentioned before.
from binance-java-api.
Hi everyone, I'm unable to reproduce this problem, please make sure you update your repository and you're using the latest version, since there were some recent updates on the websocket-based client.
from binance-java-api.
For reference, I'm using Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
from binance-java-api.
I think this is an issue related to the Runtime Environment. I switched to yours an it is working fine. When I am using my default which is 1.8.0_144 it is throwing errors. Could you pleace consider testing the API with newer Runtime versions?
from binance-java-api.
Have the same problem. Here is another example for a quick fix:
List<AllMarketTickersEvent> tick = new ArrayList<AllMarketTickersEvent>();
client.onAllMarketTickersEvent(response -> {
String str = response.toString();
int i=0, c;
for(int x = 0; x < response.size(); x++) {
tick.add(new AllMarketTickersEvent());
i = str.indexOf('s', i)+2;
c = str.indexOf(',', i);
tick.get(x).setSymbol(str.substring(i, c));
i = str.indexOf('c', i)+2;
c = str.indexOf(',', i);
tick.get(x).setCurrentDaysClosePrice(Double.parseDouble(str.substring(i, c)));
}
});
from binance-java-api.
Hi, I used this code;
for (Iterator iter = response.iterator(); iter.hasNext(); )
{
ObjectMapper mapper = new ObjectMapper();
AllMarketTickersEvent allMarketTickersEvent = mapper.convertValue(iter.next(), AllMarketTickersEvent.class);
}
from binance-java-api.
Still not fixed? Struggling with it 👎
from binance-java-api.
This is now fixed, please update your repo.
from binance-java-api.
Related Issues (20)
- Using multi thread to stream OneSymbol in each thread or using one thread to stream many symbols
- No trading fees when on tesent
- InvalidFormatException when using getQuotePrecision
- Deprecated API Endpoints HOT 2
- Binance API suddenly stops working HOT 2
- Can I use Ipv6 for my API key ?
- Average price absent
- Timestamp for this request was 1000ms ahead of the server's time. HOT 1
- issue getting mixed candlestick
- NewOCO execution failed HOT 2
- 🚨 Looking for maintainers HOT 7
- TRAILING_DELTA missing in FilterType HOT 9
- Not a margin account HOT 1
- Gradle: Could not find com.github.binance-exchange:binance-java-api:master-SNAPSHOT. HOT 2
- Question: how to close the websocket connection? HOT 1
- Be able to change the base url
- onCandlestickEvent timeout after 3-4 days
- getAllAssets() not working
- I don't receive any response bei webSocketClient onUserDataUpdateEvent!!
- Is this library not beeing updated anymore?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binance-java-api.