This is the client library for the Coinbase Pro API. We provide an intuitive, stable interface to integrate Coinbase Pro into your Laravel project.
Install the library using Composer. Please read the Composer Documentation if you are unfamiliar with Composer or dependency managers in general.
composer require gbanina/coinbase-pro
Once installed, if you are not using automatic package discovery, then you need to register the Gbanina\CoinbasePro\CoinbaseProServiceProvider
in your config/app.php
.
'providers' => [
Gbanina\CoinbasePro\CoinbaseProServiceProvider::class,
],
You can also optionally alias our facade:
'CoinbasePro' => Gbanina\CoinbasePro\CoinbasePro::class,
Copy the package config to your local config with the publish command:
php artisan vendor:publish --provider="Gbanina\CoinbasePro\CoinbaseProServiceProvider"
You need to add the following to your .env
file:
COINBASEPRO_KEY=<your_key_here>
COINBASEPRO_SECRET=<your_secret_here>
COINBASEPRO_PASSPHRASE=<your_passphrase_here>
This is not intended to provide complete documentation of the API. For more detail, please refer to the official documentation.
List your current open orders. Only open or un-settled orders are returned. As soon as an order is no longer open and settled, it will no longer appear in the default request.
$service = new CoinbasePro();
$orders = $service->getOrders();
Get a list of trading accounts.
$service = new CoinbasePro();
$accounts = $service->getAccounts();
Get a list of available currency pairs for trading.
$service = new CoinbasePro();
$products = $service->getProducts();
List known currencies.
$service = new CoinbasePro();
$currencies = $service->getCurrencies();
Feel free to submit pull requests, fix any bugs, or add missing functions.