diogomatoschaves / MyCryptoBot

Open source crypto trading platform to automate trading strategies.
119 stars 23 forks source link

Error-code #85

Closed Juulern closed 1 year ago

Juulern commented 1 year ago

× TypeError: Cannot read properties of undefined (reading 'reduce') App. src/components/App.tsx:366 363 | return { 364 | ...state, 365 | balances: {

366 | live: response.live.reduce(this.balanceReducer, {}), | ^ 367 | test: response.testnet.reduce(this.balanceReducer, {}) 368 | } 369 | } View compiled ▶ 21 stack frames were collapsed. (anonymous function) src/components/App.tsx:362 359 | getAccountBalance = () => { 360 | getFuturesAccountBalance() 361 | .then(response => { 362 | this.setState(state => { | ^ 363 | return { 364 | ...state, 365 | balances: { View compiled This screen is visible only in development. It will not appear if the app crashes in production. Open your browser’s developer console to further inspect this error. Click the 'X' or hit ESC to dismiss this message.

diogomatoschaves commented 1 year ago

Hi, the error seems to be related to the fetching of the balances from the binance API's. Make sure that you are providing correct Binance API key & secret for both the testnet and live future accounts. That error sometimes can also appear if there is a mismatch between the timestamp sent from your server with the request, and that seems to be a problem with Docker. That should not occur if you have the apps deployed on the cloud. If that error happens, try to restart your containers and the error should go away.

Juulern commented 1 year ago

I really appreciate you writing back. I've been going back and forth trying to set up this bot for 3 days. I'm almost giving up. I don't have much coding experience, so every little mistake becomes a big problem. I spent a lot of time getting to where I am now, but I'm almost ready to give up. Do you think it could be the time sync on my computer that's causing the issue?

Juulern commented 1 year ago

I've tried restarting the containers multiple times, but it doesn't help.

Juulern commented 1 year ago

I just used Atomic Clock Sync, and now it seems to be working. All this waste of time and somthing that simple...

diogomatoschaves commented 1 year ago

I appreciate the time you’ve spent already, it is nice to have some feedback. Nice one that it has gone away, let me know if you have other issues. Bear in mind that this bot is still in beta phase and in active key feature’s development, so play with it in test mode before you feel comfortable, and make sure to pull the latest commits.

Juulern commented 1 year ago

Thank you for your help! Yes, I will do some testing first, and then I will give feedback on how it goes.