<?php
function getBalance($apiKey, $apiSecret) {
    $timestamp = time();
    $queryString = "api_key=$apiKey&timestamp=$timestamp";
    $sign = hash_hmac('sha256', $queryString, $apiSecret);

    $url = "https://api.bybit.com/v2/private/wallet/balance?" . $queryString . "&sign=$sign";

    $response = file_get_contents($url);
    return json_decode($response, true);
}

$apiKey ='ZwEzFeiqnVo356Our9';
$apiSecret ='pKpGWLUSjwnXP3A2QXEhTuc5O30cSvXwoSMp';

$balanceInfo = getBalance($apiKey, $apiSecret);

echo '<pre>';
print_r($balanceInfo);
echo '</pre>';

if ($balanceInfo['retCode'] == 0) {
    $bomeusdtBalance = $balanceInfo['result']['USDT']['available_balance']; // Adjust based on your exact response
    echo "Available USDT Balance: " . $bomeusdtBalance;
} else {
    echo "Error: " . $balanceInfo['retMsg'];
}
?>