Giter VIP home page Giter VIP logo

Comments (11)

somabc avatar somabc commented on June 26, 2024

Error I have is

PHP Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: GET https://api.coinbase.com/v2/accounts resulted in a 404 Not Found response:
{"errors":[{"id":"not_found","message":"Account not found"}]}

from phptrader.

somabc avatar somabc commented on June 26, 2024

Have confirmed API Key and secret are in config and active on coinbase.

from phptrader.

somabc avatar somabc commented on June 26, 2024

If I use V1 Key set to "all".

PHP Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: GET https://api.coinbase.com/v2/accounts resulted in a 403 Forbidden response:
{"errors":[{"id":"invalid_scope","message":"API Key does not support wallet:accounts:read scopes","url":"https://develop (truncated...)

from phptrader.

somabc avatar somabc commented on June 26, 2024

It's definitely an API mismatch. Enable all V2 and V1 coinbase options and it's talking to V2 while using V1. I think you could specify the API version to use in the request but that's one of the composer dependencies?

PHP Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: GET https://api.coinbase.com/v2/accounts resulted in a 403 Forbidden response:
{"errors":[{"id":"invalid_scope","message":"Scopes don't match current API version.","url":"https://developers.coinbase. (truncated...)
' in /home/pi/phptrader/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111

API version is generally passed as a CB-VERSION header. If the API version is omitted, the version displayed below will be used.

API Version: 2017-04-18 YOU'RE UP-TO-DATE

from phptrader.

somabc avatar somabc commented on June 26, 2024

Related: coinbase/coinbase-php#114

from phptrader.

geek-at avatar geek-at commented on June 26, 2024

Alright we will figure this out. I only enabled the V2 API for the key I used, didn't even expand the V1 info in the dialogue.

  • When does this error occur? When buying, when selling or in the watchdog?
  • Did you enable your API key for all wallets?
  • Did you rename any of your wallets? The script looks for "EUR Wallet" or "USD Wallet" by hand so if the name is off, it can't find it

from phptrader.

somabc avatar somabc commented on June 26, 2024

It happens with

php trader.php buy 10 2

Gave access to all wallets. Have not renamed any. I'm in the UK so I have a GBP and EUR wallet if that makes a difference.

from phptrader.

somabc avatar somabc commented on June 26, 2024
PHP Fatal error:  Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: `GET https://api.coinbase.com/v2/accounts` resulted in a `404 Not Found` response:
{"errors":[{"id":"not_found","message":"Account not found"}]}
' in /home/pi/phptrader/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111
Stack trace:
#0 /home/pi/phptrader/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /home/pi/phptrader/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /home/pi/phptrader/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#3 /home/pi/phptrader/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 /home/pi/phptrader/vendor/guzzlehttp/promises/src/Promise.php(246): Gu in /home/pi/phptrader/vendor/coinbase/coinbase/src/Exception/HttpException.php on line 37

from phptrader.

somabc avatar somabc commented on June 26, 2024
<?php

// The currency you're going to pay with when buying new coins
// This can also be a crypto currency you have on Coinbase
// EUR or USD or even ETH or BTC
define('CURRENCY','EUR');

// The crypto currency the bot is going to trade.
// BTC or ETH only the moment
define('CRYPTO','BTC');

// Script settings
define('DEV',true); //enables the program output
define('SIMULATE',true); //if false, transactions are really paid, else it's just a simulation

//how long between price checks in the watchdog?
define('SLEEPTIME',10);

// chat system output (rocket.chat and Slack supported)
define('ROCKETCHAT_REPORTING',false); //enables/disables rocketchat reporting
define('ROCKETCHAT_WEBHOOK',''); // The URL of the webhook. Also works with a Slack webhook!

// Coinbase
//define('COINBASE_KEY','<removed>');
//define('COINBASE_SECRET','<removed>');
define('COINBASE_KEY','<removed>');
define('COINBASE_SECRET','<removed>');



// REDIS for storing your data (bitcoin prices, orders, etc)
// if REDIS_SERVER is not set, will use a local JSON file
// if the JSON file is present AND REDIS_SERVER is set, will convert to redis and delete JSON
define('REDIS_SERVER', '');
define('REDIS_PORT', 6379);
define('REDIS_PASS','');
define('REDIS_DB',0);

from phptrader.

geek-at avatar geek-at commented on June 26, 2024

upgrade to the latest version that might fix it since the code is now looking for the wallets by currency rather by name like in the old version.

If the bug still persists, please send the first few lines from the debug output of /var/log/phptrader.log

from phptrader.

somabc avatar somabc commented on June 26, 2024

Thanks git pull to recent version and a new API key and it's working.

from phptrader.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.