PHP code example of hellovoid / gdax

1. Go to this page and download the library: Download hellovoid/gdax library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hellovoid / gdax example snippets


use Hellovoid\Gdax\Configuration;
use Hellovoid\Gdax\Client;

$configuration = Configuration::apiKey($apiKey, $apiSecret, $apiPassphrase);
$client = Client::create($configuration);

use \Hellovoid\Gdax\Pagination;

$pagination = Pagination::create($before, null, $limit);

$client->setPagination($pagination);

$pagination->setEndingBefore(null);
$pagination->setStartingAfter($after);

$client->getAccounts();

$client->getAccount($accountId);

$client->getAccountHistory($accountId);

$client->getAccountHolds($accountId);

$order = $client->placeOrder([
    'size'       => 0.1,
    'price'      => 0.1,
    'side'       => 'buy',
    'product_id' => 'BTC-USD'
]);

try {
    $response = $client->orderCancel($orderId);
} catch (HttpException $e) { // Order could not be canceled
    $e->getMessage();
}

$response = $client->ordersCancel();

$response = $client->ordersCancel([
    'product_id' => $productId
]);

$response = $client->getOrders();

$response = $client->getOrder($orderId);

$response = $client->getFills([
    'order_id'   => 'all',
    'product_id' => 'all'
]);

$response = $client->getFundings([
    'status' => 'settled', // outstanding, settled, or rejected
]);

$response = $client->fundingRepay([
    'amount' => 1.00,
    'currency' => 'EUR',
]);

$response = $client->marginTransfer([
    'margin_profile_id' => '45fa9e3b-00ba-4631-b907-8a98cbdf21be',
    'type'              => 'deposit',
    'currency'          => 'USD',
    'amount'            => 2,
]);

$response = $client->position();

$response = $client->positionClose([
    'repay_only' => true
]);

$response = $client->depositPaymentMethod([
    'amount'            => 2.00,
    'currency'          => 'USD',
    'payment_method_id' => 'bc677162-d934-5f1a-968c-a496b1c1270b'
]);

$response = $client->depositCoinbase([
    'amount'              => 2.00,
    'currency'            => 'BTC',
    'coinbase_account_id' => 'c13cd0fc-72ca-55e9-843b-b84ef628c198'
]);

$response = $client->withdrawalPaymentMethod([
    'amount'            => 2.00,
    'currency'          => 'USD',
    'payment_method_id' => 'bc677162-d934-5f1a-968c-a496b1c1270b'
]);

$response = $client->withdrawalCoinbase([
    'amount'              => 2.00,
    'currency'            => 'BTC',
    'coinbase_account_id' => 'c13cd0fc-72ca-55e9-843b-b84ef628c198'
]);

$response = $client->withdrawalCoinbase([
    'amount'         => 0.01,
    'currency'       => 'BTC',
    'crypto_address' => '0x5ad5769cd04681FeD900BCE3DDc877B50E83d469'
]);

$response = $client->getPaymentMethods();

$response = $client->getCoinbaseAccounts();

$response = $client->createReport([
    'type' => 'fills',
    'start_date' => '2014-11-01T00:00:00.000Z',
    'end_date' => '2014-11-30T23:59:59.000Z'
]);

$response = $client->getReportStatus($reportId);

$response = $client->getProducts();

$response = $client->getProductOrderBook($productId);

$response = $client->getProductTicker($productId);

$response = $client->getProductTrades($productId);

$response = $client->getProductHistoricRates($productId);

$response = $client->getProductLast24HrStats($productId);

$response = $client->getCurrencies();

$response = $client->getTime();