hellovoid / gdax Goto Github PK
View Code? Open in Web Editor NEWGDAX PHP API Client Library
License: MIT License
GDAX PHP API Client Library
License: MIT License
I tried the following code and I am getting blank output. Can you please provide a working code to getAccounts?
require_once DIR . '/composer/autoload_real.php';
return ComposerAutoloaderInitc4aca15140bd590e171ded1912c8b2a0::getLoader();
use Hellovoid\Gdax\Configuration;
use Hellovoid\Gdax\Client;
$apiKey = 'myapikey';
$apiSecret = 'mysecretky';
$apiPassphrase = 'mypassphrase';
$configuration = Configuration::apiKey($apiKey, $apiSecret, $apiPassphrase);
$client = Client::create($configuration);
print_r($client->getAccounts());
According to the gdax doc:
https://docs.gdax.com/#pagination
"before and after cursors are available via response headers CB-BEFORE and CB-AFTER. "
There are no methods to get these values and set the pagination object.
Catchable fatal error: Argument 1 passed to Hellovoid\Gdax\Exception\HttpException::exceptionClass() must be an instance of Psr\Http\Message\ResponseInterface, null given, called in C:\inetpub\wwwroot\vendor\hellovoid\gdax\src\Exception\HttpException.php on line 28 and defined in C:\inetpub\wwwroot\vendor\hellovoid\gdax\src\Exception\HttpException.php on line 69
Fatal error: Uncaught Error: Unsupported operand types in /vendor/hellovoid/gdax/src/Client.php:67 Stack trace: #0 /vendor/hellovoid/gdax/src/Client.php(88): Hellovoid\Gdax\Client->getAndDecodeData('accounts') #1 gdax.php(33): Hellovoid\Gdax\Client->getAccounts() #2 /modules/tests/gdax.php(75): gdax_get_balances(2) #3 /web/rr/index.php(123): require_once('...') #4 {main} thrown in /vendor/hellovoid/gdax/src/Client.php on line 67
Hi,
I have BTC address and LTC address created with coinbase API, so is it possible for transfer BTC to LTC using API ?
Thanks in advance.
The Guzzle dependency is throwing fatal exceptions everytime anything it doesn't like happens, and your script doesn't appear to handle these at all.
For example, if I create an order and use your script to check that order every second until it has filled, then if I go into the GDAX site by hand and cancel the order, the script will crash because Guzzle cries when it's not able to find the order.
Is there a way to make these exceptions less fatal? I mean, something as simple as returning false should be enough. it's not necessary to totally destroy the running instance just because the network is wobbly or because something is not where it was expected to be.
I installed the library using "composer require hellovoid/gdax" as directed. Everything seemed to work fine.
When I attempted to call $client->position(); I got the Unsupported Operands error mentioned on this issue:
https://github.com/hellovoid/gdax/issues/3
So I checked the changed code on the commit regarding the issue and saw the line 66 change from "null" to "[]". I made the change in my own copy of hellovoid/gdax/src/Client.php and it fixed the problem.
My question is: Why did my brand new installed copy of Client.php still have the old code with the line 66 saying "null" instead of the change that was made 16 days ago.
Am I using GitHub incorrectly? I somehow ended up with an older committed version?
I recommend adding this code to the very end of Client.php file:
public function getServerTime() { return $this->getAndDecodeData('time'); }
It returns the current Server Time in both ISO and Unix EPOCH formats. Example use would be if you want to fetch historic data that goes right up to the most recent moment in time. You need the server time to do that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.