PHP code example of developerayo / fireblocks-laravel-sdk
1. Go to this page and download the library: Download developerayo/fireblocks-laravel-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/ */
developerayo / fireblocks-laravel-sdk example snippets
return [
'api_key' => env('FIREBLOCKS_API_KEY', ''),
'secret_key' => env('FIREBLOCKS_SECRET_KEY', ''),
'base_path' => env('FIREBLOCKS_BASE_PATH', 'https://api.fireblocks.io/v1'),
'is_anonymous_platform' => env('FIREBLOCKS_ANONYMOUS_PLATFORM', false),
'user_agent' => env('FIREBLOCKS_USER_AGENT', null),
'thread_pool_size' => env('FIREBLOCKS_THREAD_POOL_SIZE', 10),
'default_headers' => [],
'temp_folder_path' => env('FIREBLOCKS_TEMP_FOLDER', null),
'timeout' => env('FIREBLOCKS_TIMEOUT', 30),
'connect_timeout' => env('FIREBLOCKS_CONNECT_TIMEOUT', 10),
'verify_ssl' => env('FIREBLOCKS_VERIFY_SSL', true),
'debug' => env('FIREBLOCKS_DEBUG', false),
];
FIREBLOCKS_API_KEY=xxxxxxxx
FIREBLOCKS_SECRET_KEY=xxxxxxxx
FIREBLOCKS_BASE_PATH=https://sandbox-api.fireblocks.io/v1
FIREBLOCKS_BASE_PATH=https://api.fireblocks.io/v1
use Fireblocks;
$vaults = Fireblocks::getVaults();
$transactions = Fireblocks::getTransactions();
$assets = Fireblocks::getBlockchainsAssets();
$externalWallets = Fireblocks::getExternalWallets();
$internalWallets = Fireblocks::getInternalWallets();
$exchangeAccounts = Fireblocks::getExchangeAccounts();
$fiatAccounts = Fireblocks::getFiatAccounts();
$networkConnections = Fireblocks::getNetworkConnections();
$webhooks = Fireblocks::getWebhooks();
$gasStations = Fireblocks::getGasStations();
$nfts = Fireblocks::getNfts();
$staking = Fireblocks::getStaking();
...
use Fireblocks;
// get all supported assets
$assetsApi = Fireblocks::getBlockchainsAssets();
$supportedAssets = $assetsApi->getSupportedAssets();
foreach($supportedAssets as $asset) {
echo "Asset ID: " . $asset['id'] . "\n";
echo "Asset Name: " . $asset['name'] . "\n";
echo "Asset Type: " . $asset['type'] . "\n";
}
// get your vault account assets
$vaultsApi = Fireblocks::getVaults();
$vaultAssets = $vaultsApi->getVaultAccountAsset($vaultAccountId, $assetId);
// create a new asset wallet
$vaultsApi->createVaultAccountAsset($vaultAccountId, $assetId);
use Fireblocks;
$vaults = Fireblocks::vaults;
$transactions = Fireblocks::transactions;
$webhooks = Fireblocks::webhooks;
$nfts = Fireblocks::nfts;
$staking = Fireblocks::staking;
// use them directly
$vaultAccounts = Fireblocks::vaults->getPagedVaultAccounts();
$txList = Fireblocks::transactions->getTransactions();
use Developerayo\FireblocksLaravel\Config;
Config::US // https://api.fireblocks.io/v1 - (default)
Config::EU // https://eu-api.fireblocks.io/v1
Config::EU2 // https://eu2-api.fireblocks.io/v1
Config::SANDBOX // https://sandbox-api.fireblocks.io/v1
bash
php artisan vendor:publish --provider="Developerayo\FireblocksLaravel\ServiceProvider"