PHP code example of webumer / fireblocks-php-sdk
1. Go to this page and download the library: Download webumer/fireblocks-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/ */
webumer / fireblocks-php-sdk example snippets
use Webumer\Fireblocks\FireblocksClient;
use Webumer\Fireblocks\Auth\ApiKeyAuthProvider;
// Initialize the client with your credentials
$authProvider = new ApiKeyAuthProvider(
apiKey: 'your-api-key-here',
privateKey: 'your-private-key-here'
);
// Create client for sandbox environment
$client = FireblocksClient::forSandbox($authProvider);
// Get all vault accounts
$vaults = $client->vaults()->list();
// Create a transaction
$transaction = $client->transactions()->create([
'assetId' => 'ETH',
'source' => ['type' => 'VAULT_ACCOUNT', 'id' => '0'],
'destination' => ['type' => 'EXTERNAL_WALLET', 'id' => 'external-wallet-id'],
'amount' => '0.1',
'note' => 'Test transaction from PHP SDK'
]);
bash
composer