承接 sdtech/binance-api-laravel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sdtech/binance-api-laravel

最新稳定版本:v1.0.1

Composer 安装命令:

composer require sdtech/binance-api-laravel

包简介

Integrate Binance API with Laravel Effortlessly

README 文档

README

Latest Version Issues Stars Stars Total Downloads

About

This offers a comprehensive integration of the Binance API with Laravel, allowing developers to easily incorporate cryptocurrency trading features into their Laravel applications. It includes extensive documentation, sample codes, and best practices for a seamless and secure setup. The current features are :

  • Trading
  • Broker Account
  • Public Api

Requirements

Installation

  1. From your projects root folder in terminal run:
composer require sdtech/binance-api-laravel
  1. In config/app.php, need to add this line:
'providers' => [
    // Other Service Providers...
    Sdtech\BinanceApiLaravel\Providers\BinanceApiLaravelServiceProviders::class,
],
  1. Publish the packages views, config file, assets, and language files by running the following from your projects root folder:
php artisan vendor:publish --tag=binanceapilaravel

configuration

  1. Go to your config folder, then open "binanceapilaravel.php" file
  2. here you must add that info or add the info to your .env file .
'BINANCE_API_LIVE_URL' => env('BINANCE_API_LIVE_URL') ?? "https://api.binance.com/api/",
'BINANCE_API_TESTNET_URL' => env('BINANCE_API_TESTNET_URL') ?? "https://testnet.binance.vision/api/",
'BINANCE_WAPI_URL' => env('BINANCE_WAPI_URL') ?? "https://api.binance.com/wapi/",
'BINANCE_SAPI_URL' => env('BINANCE_SAPI_URL') ?? "https://api.binance.com/sapi/",
'BINANCE_FAPI_URL' => env('BINANCE_FAPI_URL') ?? "https://fapi.binance.com/",
'BINANCE_BAPI_URL' => env('BINANCE_BAPI_URL') ?? "https://www.binance.com/bapi/",
'BINANCE_WSS_STREAM_URL' => env('BINANCE_WSS_STREAM_URL') ?? "wss://stream.binance.com:9443/ws/",
'BINANCE_WSS_STREAM_TESTNET_URL' => env('BINANCE_WSS_STREAM_TESTNET_URL') ?? "wss://testnet.binance.vision/ws/",
'BINANCE_API_KEY' => env('BINANCE_API_KEY'),
'BINANCE_API_SECRET_KEY' => env('BINANCE_API_SECRET_KEY'),
'BINANCE_API_TEST_MODE' => env('BINANCE_API_TEST_MODE')

Uses

  1. We provide a sample code of functionality that will help you to integrate easily
use Sdtech\BinanceApiLaravel\Service\BinanceApiLaravelService;

class HomeController extends Controller
{
    public function testBinanceApi(Request $request) {

        $api = new BinanceApiLaravelService();
        $response = $api->price('BNBUSDT'); // get the current BNB price in USDT
        $response2 = $api->orderBook('BNBUSDT',100);  // get the order book data
        return $response;
    }
}
 in the same way you can use other function as well

some functions

  • price get the latest price of a symbol
$price = $api->price( "BNBUSDT" );
@param STRING symbol mandetory Parameter symbol and symbols cannot be used in combination.
@param STRING symbols optional Examples of accepted format for the symbols parameter: ["BTCUSDT","BNBUSDT"]
@return array with error message or array with symbol price
@throws \Exception

price(string $symbol='BNBUSDT', $symbols=[]) 
  • get exchange information
ping() // test connectivity
time() // check server time
$symbol = "BNBUSDT";
exchangeInfo($symbol)  // get exchange info

统计信息

  • 总下载量: 993
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固