PHP code example of whitebit / php-sdk

1. Go to this page and download the library: Download whitebit/php-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

whitebit / php-sdk example snippets




use WhiteBIT\Sdk\Connectors\WhiteBITConnector;
use WhiteBIT\Sdk\Connectors\ConnectorConfig;
use WhiteBIT\Sdk\Requests\General\V1\KlineRequest;

$connector = new WhiteBITConnector(
    new ConnectorConfig('api_key', 'api_secret')
);

$connector->send(new KlineRequest('BTC_USDT'))

namespace App\Http\Controllers;
 
use Illuminate\View\View;
use WhiteBIT\Sdk\Connectors\WhiteBITConnector;
use WhiteBIT\Sdk\Requests\General\V1\KlineRequest;
 
class ExampleController extends Controller
{

    public function show(WhiteBITConnector $connector): View
    {
        $response = $connector->send(new KlineRequest('BTC_USDT'));
    
        return response()->json(
            $response->json()
        );
    }
}
bash
composer 
shell
php artisan vendor:publish --provider="WhiteBIT\Sdk\WhiteBITServiceProvider"