PHPackages                             fireblocks/fireblocks-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. fireblocks/fireblocks-php-sdk

ActiveLibrary[API Development](/categories/api)

fireblocks/fireblocks-php-sdk
=============================

Fireblocks PHP Laravel SDK - Official PHP SDK for Fireblocks API

v1.2.3(1mo ago)01MITPHPPHP ^7.4|^8.0CI failing

Since May 4Pushed 1mo agoCompare

[ Source](https://github.com/rizwanaabbas/fireblocks-php-sdk)[ Packagist](https://packagist.org/packages/fireblocks/fireblocks-php-sdk)[ Docs](https://github.com/fireblocks/php-sdk)[ RSS](/packages/fireblocks-fireblocks-php-sdk/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (8)Versions (2)Used By (0)

Fireblocks PHP Laravel SDK
==========================

[](#fireblocks-php-laravel-sdk)

[![Latest Version](https://camo.githubusercontent.com/54cd964be2656734a87b4e174ced4b910d2a5bb9d77002c794fe0562298b259b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66697265626c6f636b732f66697265626c6f636b732d7068702d73646b2e737667)](https://packagist.org/packages/fireblocks/fireblocks-php-sdk)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Official PHP SDK for the [Fireblocks](https://www.fireblocks.com/) API with full Laravel integration.

Features
--------

[](#features)

- 🔐 **JWT Authentication** - Secure request signing with RS256
- 🚀 **Laravel Native** - Service provider, facade, and config publishing
- 🔄 **Auto-Retry** - Built-in retry mechanism with exponential backoff
- 📦 **Type-Safe Models** - Full DTO coverage of Fireblocks API
- ⚡ **Modern PHP** - PHP 8.0+ with strict typing
- 🧪 **Well Tested** - PHPUnit test suite included

Installation
------------

[](#installation)

```
composer require fireblocks/fireblocks-php-sdk
```

Laravel Setup
-------------

[](#laravel-setup)

### 1. Publish Configuration

[](#1-publish-configuration)

```
php artisan vendor:publish --tag=fireblocks-config
```

### 2. Configure Environment Variables

[](#2-configure-environment-variables)

```
FIREBLOCKS_BASE_URL=https://api.fireblocks.io
FIREBLOCKS_API_KEY=your-api-key
FIREBLOCKS_API_SECRET=-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
```

Or use a secret file:

```
FIREBLOCKS_API_SECRET_PATH=/path/to/private.key
```

### 3. Optional: Use the Facade

[](#3-optional-use-the-facade)

Add to `config/app.php` (Laravel 10 and below):

```
'aliases' => [
    // ...
    'Fireblocks' => Fireblocks\Sdk\Facades\Fireblocks::class,
]
```

Usage
-----

[](#usage)

### Using Dependency Injection

[](#using-dependency-injection)

```
use Fireblocks\Sdk\Api\FireblocksClient;

class WalletController extends Controller
{
    public function index(FireblocksClient $fireblocks)
    {
        // List vault accounts
        $accounts = $fireblocks->vaults()->listAccounts();

        // Get specific account
        $account = $fireblocks->vaults()->getAccount('0');

        return response()->json($accounts);
    }
}
```

### Using the Facade

[](#using-the-facade)

```
use Fireblocks;

// List all vault accounts
$accounts = Fireblocks::vaults()->listAccounts();

// Create a new transaction
use Fireblocks\Sdk\Models\TransactionRequest;

$request = new TransactionRequest();
$request
    ->withAsset('BTC')
    ->withAmount('0.1')
    ->fromVaultAccount('0')
    ->toOneTimeAddress('bc1q...')
    ->withNote('Test transaction');

$transaction = Fireblocks::transactions()->create($request);
```

### Manual Instantiation

[](#manual-instantiation)

```
use Fireblocks\Sdk\Api\FireblocksClient;

$client = new FireblocksClient([
    'base_url' => 'https://api.fireblocks.io',
    'api_key' => 'your-api-key',
    'api_secret' => file_get_contents('/path/to/private.key'),
    'timeout' => 60,
]);

$accounts = $client->vaults()->listAccounts();
```

API Reference
-------------

[](#api-reference)

### Vaults

[](#vaults)

```
// List vault accounts
$accounts = $fireblocks->vaults()->listAccounts(['namePrefix' => 'Main']);

// Create vault account
use Fireblocks\Sdk\Models\CreateVaultAccountRequest;
$request = new CreateVaultAccountRequest(['name' => 'New Account']);
$account = $fireblocks->vaults()->createAccount($request);

// Get vault account assets
$assets = $fireblocks->vaults()->getAsset('0', 'BTC');

// Create deposit address
$address = $fireblocks->vaults()->createDepositAddress('0', 'BTC', 'Main Address');
```

### Transactions

[](#transactions)

```
// Create a transaction
$request = new TransactionRequest();
$request
    ->withAsset('ETH')
    ->withAmount('1.5')
    ->fromVaultAccount('0')
    ->toVaultAccount('1')
    ->withFeeLevel('HIGH');

$transaction = $fireblocks->transactions()->create($request);

// Get transaction status
$tx = $fireblocks->transactions()->get($transaction->id);

// List transactions
$transactions = $fireblocks->transactions()->list([
    'status' => 'COMPLETED',
    'after' => '2024-01-01T00:00:00Z',
]);

// Cancel a transaction
$fireblocks->transactions()->cancel($transaction->id, 'User requested');
```

### Wallets

[](#wallets)

```
// Internal wallets
$wallets = $fireblocks->wallets()->listInternalWallets();
$fireblocks->wallets()->createInternalWallet('My Wallet', 'ref-123');

// External wallets
$wallets = $fireblocks->wallets()->listExternalWallets();

// Contract wallets
$wallets = $fireblocks->wallets()->listContractWallets();
```

### Exchange Accounts

[](#exchange-accounts)

```
$exchanges = $fireblocks->exchangeAccounts()->list();
$assets = $fireblocks->exchangeAccounts()->getAsset('exchange-id', 'BTC');
$fireblocks->exchangeAccounts()->convert('exchange-id', 'BTC', 'USD', '1.0');
```

### Webhooks

[](#webhooks)

```
$webhooks = $fireblocks->webhooks()->list();
$fireblocks->webhooks()->create('https://example.com/webhook', ['TRANSACTION_CREATED', 'TRANSACTION_COMPLETED']);
```

### Gas Stations

[](#gas-stations)

```
$config = $fireblocks->gasStations()->getConfiguration();
$fireblocks->gasStations()->setConfiguration(['maxGasPrice' => '100']);
```

Transaction Request Builder
---------------------------

[](#transaction-request-builder)

The SDK provides a fluent builder for creating transactions:

```
use Fireblocks\Sdk\Models\TransactionRequest;

// Transfer between vault accounts
$request = (new TransactionRequest())
    ->withAsset('BTC')
    ->withAmount('0.5')
    ->fromVaultAccount('source-vault-id')
    ->toVaultAccount('destination-vault-id')
    ->withNote('Internal transfer')
    ->withExternalTxId('external-ref-123');

// Transfer to external address
$request = (new TransactionRequest())
    ->withAsset('ETH')
    ->withAmount('1.0')
    ->fromVaultAccount('0')
    ->toOneTimeAddress('0x...', 'memo-tag') // optional tag
    ->withFeeLevel('HIGH');

// Transfer to exchange
$request = (new TransactionRequest())
    ->withAsset('USDC')
    ->withAmount('1000')
    ->fromVaultAccount('0')
    ->toExchange('exchange-account-id');
```

Error Handling
--------------

[](#error-handling)

```
use Fireblocks\Sdk\Exceptions\FireblocksException;
use Fireblocks\Sdk\Exceptions\AuthenticationException;
use Fireblocks\Sdk\Exceptions\ValidationException;
use Fireblocks\Sdk\Exceptions\NotFoundException;
use Fireblocks\Sdk\Exceptions\RateLimitException;

try {
    $transaction = $fireblocks->transactions()->create($request);
} catch (ValidationException $e) {
    // Handle validation errors
    $errors = $e->getErrors();
} catch (NotFoundException $e) {
    // Resource not found
} catch (RateLimitException $e) {
    // Rate limited - check $e->getRetryAfter()
    sleep($e->getRetryAfter());
} catch (AuthenticationException $e) {
    // Invalid API key or secret
} catch (FireblocksException $e) {
    // Generic Fireblocks error
    $errorCode = $e->getErrorCode();
    $errorData = $e->getErrorData();
}
```

Webhook Handling
----------------

[](#webhook-handling)

```
use Fireblocks\Sdk\Api\FireblocksClient;

class WebhookController extends Controller
{
    public function handle(Request $request, FireblocksClient $fireblocks)
    {
        // Verify webhook signature
        $publicKey = $fireblocks->webhooks()->getPublicKey()['publicKey'];

        // Validate signature...

        $event = $request->all();

        match ($event['type']) {
            'TRANSACTION_CREATED' => $this->handleTransactionCreated($event),
            'TRANSACTION_COMPLETED' => $this->handleTransactionCompleted($event),
            'TRANSACTION_FAILED' => $this->handleTransactionFailed($event),
            default => null,
        };

        return response()->noContent();
    }
}
```

Configuration Options
---------------------

[](#configuration-options)

```
// config/fireblocks.php
return [
    'base_url' => env('FIREBLOCKS_BASE_URL', 'https://api.fireblocks.io'),
    'api_key' => env('FIREBLOCKS_API_KEY'),
    'api_secret' => env('FIREBLOCKS_API_SECRET'),
    'api_secret_path' => env('FIREBLOCKS_API_SECRET_PATH'),
    'timeout' => 30,
    'connect_timeout' => 10,
    'max_retries' => 3,
    'retry_delay' => 500,
    'debug' => false,
    'proxy' => null,
];
```

Testing
-------

[](#testing)

```
# Run tests
composer test

# Run static analysis
composer phpstan

# Run code style checks
composer phpcs

# Fix code style
composer phpcbf
```

Advanced Usage
--------------

[](#advanced-usage)

### Custom HTTP Configuration

[](#custom-http-configuration)

```
$client = new FireblocksClient([
    'api_key' => 'key',
    'api_secret' => 'secret',
    'timeout' => 60,
    'connect_timeout' => 10,
    'max_retries' => 5,
    'retry_delay' => 1000,
    'proxy' => 'http://proxy:8080',
    'headers' => ['X-Custom-Header' => 'Value'],
]);
```

### Raw API Access

[](#raw-api-access)

```
// Direct API access if needed
$response = $fireblocks->get('/v1/vault/accounts');
$response = $fireblocks->post('/v1/transactions', [...]);
$response = $fireblocks->put('/v1/vault/accounts/0', [...]);
$response = $fireblocks->patch('/v1/webhooks/123', [...]);
$response = $fireblocks->delete('/v1/internal_wallets/123');
```

License
-------

[](#license)

This SDK is licensed under the MIT License. See [LICENSE](LICENSE) for details.

Support
-------

[](#support)

- [Fireblocks Documentation](https://developers.fireblocks.com/)
- [Fireblocks API Reference](https://docs.fireblocks.com/api/)
- [GitHub Issues](https://github.com/fireblocks/php-sdk/issues)

Contributing
------------

[](#contributing)

Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) before submitting PRs.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance89

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

56d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba704b7a602b4ce5630b264caf83d1b875cad943b9d80ef7cbc01def559c0978?d=identicon)[rizwanaabbas](/maintainers/rizwanaabbas)

---

Top Contributors

[![rizwanaabbas](https://avatars.githubusercontent.com/u/1345902?v=4)](https://github.com/rizwanaabbas "rizwanaabbas (3 commits)")

---

Tags

laravelcryptobitcoinwalletethereumblockchainfireblocks

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/fireblocks-fireblocks-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/fireblocks-fireblocks-php-sdk/health.svg)](https://phpackages.com/packages/fireblocks-fireblocks-php-sdk)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M833](/packages/laravel-socialite)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.1k1](/packages/jasara-php-amzn-selling-partner-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
