Fix styling

This commit is contained in:
mahdimsr authored and github-actions[bot] committed 2025-09-28 11:53:47 +00:00
1 parent 0996c5fc27
commit 49c1633f52
6 files changed
+58 -84

No files matched your search

+15 -15
View File
@@ -2,12 +2,12 @@
/**
* Example usage of Change Leverage functionality
*
*
* This example demonstrates how to use the LaravelBitunixApi package
* to change leverage for a trading pair on Bitunix exchange.
*/
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__.'/../vendor/autoload.php';
use Msr\LaravelBitunixApi\Requests\ChangeLeverageRequestContract;
@@ -22,39 +22,39 @@ config([
try {
// Get the API instance
$api = app(ChangeLeverageRequestContract::class);
// Change leverage for BTCUSDT pair
$symbol = 'BTCUSDT';
$marginCoin = 'USDT';
$leverage = 12;
echo "Changing leverage for {$symbol} to {$leverage}x...\n";
$response = $api->changeLeverage($symbol, $marginCoin, $leverage);
// Check response status
if ($response->getStatusCode() === 200) {
$data = json_decode($response->getBody()->getContents(), true);
if ($data['code'] === 0) {
echo "✅ Leverage changed successfully!\n";
echo "Symbol: " . $data['data'][0]['symbol'] . "\n";
echo "Margin Coin: " . $data['data'][0]['marginCoin'] . "\n";
echo "New Leverage: " . $data['data'][0]['leverage'] . "\n";
echo 'Symbol: '.$data['data'][0]['symbol']."\n";
echo 'Margin Coin: '.$data['data'][0]['marginCoin']."\n";
echo 'New Leverage: '.$data['data'][0]['leverage']."\n";
} else {
echo "❌ API Error: " . $data['msg'] . "\n";
echo '❌ API Error: '.$data['msg']."\n";
}
} else {
echo "❌ HTTP Error: " . $response->getStatusCode() . "\n";
echo '❌ HTTP Error: '.$response->getStatusCode()."\n";
}
} catch (Exception $e) {
echo "❌ Exception: " . $e->getMessage() . "\n";
echo '❌ Exception: '.$e->getMessage()."\n";
}
/**
* Environment Variables Required:
*
*
* BITUNIX_API_KEY=your-api-key
* BITUNIX_API_SECRET=your-api-secret
* BITUNIX_LANGUAGE=en-US