Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use object of type stdClass as array" In ItbitService.php line 148: #2

Open
amandris opened this issue Feb 5, 2019 · 10 comments

Comments

@amandris
Copy link
Owner

amandris commented Feb 5, 2019

Hi Amandris,

I was successful in getting the "bin/console bot:trade" command to work, and while the "Ticker" now populates in the app, I'm receiving the following error once the command is inserted into the command line. Do you have any recommendations on how to resolve?

"app@XXXXXX:~/directory/app$ bin/console bot:trade
05/02/2019 07:29:59
bitstamp Ask:3,418.07 Bid:3,418.06
okcoin Ask:3,416.03 Bid:3,417.72
binance Ask:3,465.98 Bid:3,465.95

In ItbitService.php line 148:

Cannot use object of type stdClass as array"

Thank you in advance for your help on this!

Originally posted by @NH603 in #1 (comment)

@amandris
Copy link
Owner Author

amandris commented Feb 5, 2019

Itbit seems to work fine at this moment. QuadrigaCX and OkCoin are offline right now so avoid those exchanges. Which of the exchanges have you enable in config.yml? Did you set the api keys and secrets for those exchanges in the parameters.yml file? Remember to create your own api keys. Some of the exchanges force you to confirm your identity.

@amandris amandris changed the title Hi Amandris,Cannot use object of type stdClass as array" In ItbitService.php line 148: Cannot use object of type stdClass as array" In ItbitService.php line 148: Feb 5, 2019
@NH603
Copy link

NH603 commented Feb 5, 2019

Hi Amandris, thank you so much for your continued support! I appreciate it more than you know.

Please find a screenshot below of what I'm seeing on the main dashboard. You'll see I've enabled Binance, Bitstamp and Kraken, but with their API keys/secrets in the parameters.yml and with Binance enabled as "true" in config.yml. Unfortunately, the "Differences" chart in the app does not populate yet. When entering the bot/trade command, I'm also still receive the error of: "In ItbitService.php line 148: Cannot use object of type stdClass as array." Any recommendations to help officially solve the good puzzle? :)

image

Thanks again for all the support!

@amandris
Copy link
Owner Author

amandris commented Feb 6, 2019

Perhaps the exchange Itbit is returning a non valid value. I suggest you to inspect the value the line $this->itbitHelper->wallet() in ItbitService.php [148] returns. It will help you to find the problem. Also, remember you should have a wallet created on your ItBit account. I you haven't done it, just go to https://exchange.itbit.com/accounts and click on the +NEW ACCOUNT button.

@NH603
Copy link

NH603 commented Feb 8, 2019 via email

@amandris
Copy link
Owner Author

amandris commented Feb 8, 2019

I don't believe the problem is in the AppKernel.php file. I'm no able to replicate the error on my system so I'm gonna need some help from you. Could you inspect or dump the result of the $this->itbitHelper->wallet() call? The code expects an array from the ItBit API but it's getting something different. Maybe some kind of error message. Please let me know the result of that call. Thank you.

@NH603
Copy link

NH603 commented Feb 10, 2019

After inspecting, it looks like that call is going through successfully, but the Dashboard in the UI is not populating. In fact, it looks like all the AJAX calls and POSTS are going through. Would this be related to the environment running in DEV right now and not prod? I can share direct debug URL with you if you'd like - if so, please feel free to share email and I can send over URL.

Thanks again Amandris.

@amandris
Copy link
Owner Author

If some exception is thrown on the bot:trade command execution, the data on the dashboard is no completely populated. That's why you get that result. Please share the data returned by the $this->itbitHelper->wallet() method when the exchange is Itbit. That's the key to solve this issue.

One quick fix you can also try is to temporarily disable Itbit exchange on the config.yml and try to trade with any other exchange pair.

@NH603
Copy link

NH603 commented Feb 11, 2019

Thank you Amandris! Here's the data returned by $this->itbitHelper->wallet() :

-su: syntax error near unexpected token `('

As you review, please let me know if you have any recommendation on how to best fix?

@NH603
Copy link

NH603 commented Feb 11, 2019

After disabling Itbit, I'm receiving an error with Kraken when attempting to run "bot:trade" command. I'm not sure if this is all interrelated with the issue we're receiving above with Itbit?

php bin/console bot:trade
11/02/2019 22:00:22
bitstamp Ask:3,596.22 Bid:3,595.11
kraken Ask:3,597.60 Bid:3,597.50
binance Ask:3,643.05 Bid:3,642.01

In KrakenService.php line 165:

Notice: Undefined index: result

bot:trade [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--]

@NH603
Copy link

NH603 commented Feb 14, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants