brian978 / binance-api-client
Unofficial API client for Binance Exchange
dev-main
2023-12-13 06:06 UTC
Requires
- php: 7.4.*|8.*
- ext-json: *
- composer/ca-bundle: ^1.3
- guzzlehttp/guzzle: ^7.4
- psr/log: ^1.1.4
- symfony/rate-limiter: ^6.0
Requires (Dev)
- monolog/monolog: ^2.3
This package is auto-updated.
Last update: 2024-11-13 08:09:15 UTC
README
Unofficial API client written in PHP for Binance Exchange
UNDER DEVELOPMENT
Installation
composer require brian978/binance-api-client
Main features
- Compatible with any framework
- Compatible with any logger library that implements
Psr\Log\LoggerInterface
- It provides an easy-to-use interface with the API using the *Query classes that are provided
- The API parameter documentation can be found in the PHPDoc of each query object for easy use
How to contribute to the project
If we are talking about a new feature, then an issue needs to be opened in order to discuss it. And after that proceed to the steps below.
If it's a BUG see the steps below
Steps to update the code
- Write the code in a new branch (see HERE for more info)
- Make sure it's PSR-12 compliant and all the code and comments ar properly aligned
- Make a PR
Configuration examples
Symfony
In your .env config file
###> brian978/binance-api-client ###
BINANCE_API_KEY=<your_key>
BINANCE_API_SECRET=<your_secret>==
###< brian978/binance-api-client ###
In your services.yaml
# BinanceApi namespace auto-wire BinanceApi\: resource: '../vendor/brian978/binance-api-client/src/' # Binance API rate limiter app.limiter.storage.binance_api: class: Symfony\Component\RateLimiter\Storage\CacheStorage BinanceApi\RateLimiter\RateLimiter: shared: false arguments: - '@app.limiter.storage.binance_api' - '@lock.default.factory' # Binance API client app.binanceHttp.client: class: GuzzleHttp\Client arguments: - { base_uri: 'https://api.binance.com' } BinanceApi\Client: shared: false class: BinanceApi\Client arguments: - '@app.binanceHttp.client' - '%env(resolve:BINANCE_API_KEY)%' - '%env(resolve:BINANCE_API_SECRET)%' - '@BinanceApi\RateLimiter\RateLimiter' calls: - setLogger: [ '@logger' ]