jybtx / binance-api
Binance API Class and how to use the API for laravel
dev-master
2020-03-30 02:05 UTC
Requires
- php: >=7.0.0
- laravel/framework: >=5.5
This package is auto-updated.
Last update: 2025-03-29 00:43:41 UTC
README
Binance API Class and how to use the API for laravel.
Installing
$ composer require jybtx/binance-api
Laravel
- PHP >= 7.0.0
- Laravel >= 5.5
- Fileinfo PHP Extension
ServiceProvider will be attached automatically
Configurations
The file config/binance.php contains an array of configurations, you can find the default configurations in there.
Other
In your config/app.php
add Jybtx\BinanceApi\BinanceServiceProvider::class
to the end of the providers
array:
'providers' => [ ... Jybtx\BinanceApi\BinanceServiceProvider::class, ], 'aliases' => [ ... "Binance": Jybtx\BinanceApi\BinanceAPIFacade::class, ]
Publish Configuration
php artisan vendor:publish --provider "Jybtx\BinanceApi\BinanceServiceProvider"
OR
php artisan vendor:publish --tag=binance
Usage
use Binance; $result = Binance::bookPrices();
Methods
行情类API
- buy($symbol, $quantity, $price, $type = "LIMIT")
- sell($symbol, $quantity, $price, $type = "LIMIT")
- cancel($symbol, $orderid)
- orderStatus($symbol, $orderid)
- openOrders($symbol)
- allOrders($symbol, $limit = 500)
- trades($symbol)
- prices()
- bookPrices()
- account()
- balances($priceData = false)
- order($side, $symbol, $quantity, $price, $type = "LIMIT")
- candlesticks($symbol, $interval = "5m")
参考文档
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
MIT