The Laravel SDK for Fireblocks API
This repository contains the Laravel SDK for Fireblocks API. For the complete API reference, go to the API reference.
PHP 7.2 or newer.
You can install the Provider as a composer package.
composer require d-andreevich/fireblocks-sdk-laravelFor further configuration, please see config/fireblocks.php. You can modify the configuration by copying it to your local config directory or by defining the environment variables used in the config file.
Publish fireblocks.php config
php artisan vendor:publish --provider="FireblocksSdkLaravel\FireblocksServiceProvider" --tag=config
You can set the default configuration in your .env file of you Laravel project.
FIREBLOCKS_PRIVATE_KEY_PATH=path/file_name.key
FIREBLOCKS_API_KEY=api_key
FIREBLOCKS_API_BASE_URL=https://api.fireblocks.io
FIREBLOCKS_TIMEOUT=10
FIREBLOCKS_API_PUBLIC_KEY_PATH='path/webhook_sig.pub'
FIREBLOCKS_X_WEBHOOK_SECRET='secret'
Make sure you have the credentials for Fireblocks API Services. Otherwise, please contact Fireblocks support for further instructions on how to obtain your API credentials.
Once you have retrieved a component, please refer to the documentation of the Fireblocks for further information on how to use it.
You don't need and should not use the new FireblocksSDK() pattern described in the SDK documentation, this is already
done for you with the Laravel Service Provider. Use Dependency Injection, the Facades or the app() helper instead
use FireblocksSDK;
$result = FireblocksSDK::get_gas_station_info();You can use the Python examples from the documentation of the Fireblocks, all methods have the same names, all functionality is duplicated from fireblocks-sdk-py.
Also, you can use the event types \FireblocksSdkLaravel\Types\WebHook\Events
Route::post('/fireblocks/webhook/events', function (\Illuminate\Http\Request $req) {
$object = \FireblocksSdkLaravel\Types\WebHook\Events\FactoryEvent::get(...$req->all());
return response()->json((array)$object);
})->middleware([\FireblocksSdkLaravel\Http\Middlewares\EventMiddleware::class]);or notification type \FireblocksSdkLaravel\Types\WebHook\Notifications
Route::post('/fireblocks/webhook/notifications', function (\Illuminate\Http\Request $req) {
$object = new \FireblocksSdkLaravel\Types\WebHook\Notifications\Notification(...$req->all());
return response()->json((array)$object);
})->middleware([\FireblocksSdkLaravel\Http\Middlewares\NotificationMiddleware::class]);Please note that you can use middleware \FireblocksSdkLaravel\Http\Middlewares in your project.