armino-dev / binance-connector
Binance API connector for PHP
v0.0.1-alpha
2021-12-23 09:54 UTC
Requires
- php: >=7.4|>=8.0
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2026-03-22 09:53:34 UTC
README
*** Work in progress ***
Usage
Go to your project folder and type in a terminal:
composer require armino-dev/binance-connector
The following is an example php file that is dumping the binance exchange information.
<?php // uncomment and adjust to your path if needed // require __DIR__ . "/../vendor/autoload.php"; use Armino\BinanceConnector\Binance\Connector; $connector = Connector::init('your_api_key', 'your_api_secret'); $exchangeInformation = $connector->market->exchangeInformation(); var_dump($exchangeInformation);
Error handling
Network and transport errors throw typed exceptions from the HTTP client layer.
<?php use Armino\BinanceConnector\Binance\Connector; use Armino\BinanceConnector\HttpClient\Exceptions\HttpClientException; try { $connector = Connector::init('your_api_key', 'your_api_secret'); $result = $connector->status->serverTime(); } catch (HttpClientException $exception) { echo $exception->getMessage(); if ($exception->getPrevious() !== null) { echo $exception->getPrevious()->getMessage(); } }
Tests
Run the default unit suite (integration tests are excluded by default):
vendor/bin/phpunit
Run optional real Binance smoke checks:
vendor/bin/phpunit --group integration
Code quality (local development)
Lint PHP files:
composer lint
Check formatting without changing files:
composer format:check
Apply formatting:
composer format