Fix styling

This commit is contained in:
mahdimsr 2025-09-28 20:07:30 +00:00 committed by github-actions[bot]
parent 4d0a9ebe56
commit 10e9a84d36
6 changed files with 76 additions and 81 deletions

View File

@ -39,9 +39,9 @@ try {
$data = json_decode($response->getBody()->getContents(), true);
if ($data['code'] === 0) {
echo "✅ Market order placed successfully!\n";
echo "Order ID: " . $data['data']['orderId'] . "\n";
echo 'Order ID: '.$data['data']['orderId']."\n";
} else {
echo "❌ API Error: " . $data['msg'] . "\n";
echo '❌ API Error: '.$data['msg']."\n";
}
}
@ -74,10 +74,10 @@ try {
$data = json_decode($response->getBody()->getContents(), true);
if ($data['code'] === 0) {
echo "✅ Limit order with TP/SL placed successfully!\n";
echo "Order ID: " . $data['data']['orderId'] . "\n";
echo "Client ID: " . $data['data']['clientId'] . "\n";
echo 'Order ID: '.$data['data']['orderId']."\n";
echo 'Client ID: '.$data['data']['clientId']."\n";
} else {
echo "❌ API Error: " . $data['msg'] . "\n";
echo '❌ API Error: '.$data['msg']."\n";
}
}
@ -99,9 +99,9 @@ try {
$data = json_decode($response->getBody()->getContents(), true);
if ($data['code'] === 0) {
echo "✅ Close position order placed successfully!\n";
echo "Order ID: " . $data['data']['orderId'] . "\n";
echo 'Order ID: '.$data['data']['orderId']."\n";
} else {
echo "❌ API Error: " . $data['msg'] . "\n";
echo '❌ API Error: '.$data['msg']."\n";
}
}
@ -126,9 +126,9 @@ try {
$data = json_decode($response->getBody()->getContents(), true);
if ($data['code'] === 0) {
echo "✅ Reduce only order placed successfully!\n";
echo "Order ID: " . $data['data']['orderId'] . "\n";
echo 'Order ID: '.$data['data']['orderId']."\n";
} else {
echo "❌ API Error: " . $data['msg'] . "\n";
echo '❌ API Error: '.$data['msg']."\n";
}
}
@ -165,4 +165,3 @@ try {
* BITUNIX_API_SECRET=your-api-secret
* BITUNIX_LANGUAGE=en-US
*/

View File

@ -24,7 +24,7 @@ if (file_exists($envFile)) {
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($lines as $line) {
if (strpos($line, '=') !== false && strpos($line, '#') !== 0) {
list($key, $value) = explode('=', $line, 2);
[$key, $value] = explode('=', $line, 2);
putenv(trim($key).'='.trim($value));
}
}
@ -36,9 +36,9 @@ $apiSecret = getenv('BITUNIX_API_SECRET');
$language = getenv('BITUNIX_LANGUAGE') ?: 'en-US';
echo "📋 Environment Variables:\n";
echo " BITUNIX_API_KEY: " . (empty($apiKey) ? "❌ Not set" : "✅ Set (" . substr($apiKey, 0, 8) . "...)") . "\n";
echo " BITUNIX_API_SECRET: " . (empty($apiSecret) ? "❌ Not set" : "✅ Set (" . substr($apiSecret, 0, 8) . "...)") . "\n";
echo " BITUNIX_LANGUAGE: " . ($language) . "\n\n";
echo ' BITUNIX_API_KEY: '.(empty($apiKey) ? '❌ Not set' : '✅ Set ('.substr($apiKey, 0, 8).'...)')."\n";
echo ' BITUNIX_API_SECRET: '.(empty($apiSecret) ? '❌ Not set' : '✅ Set ('.substr($apiSecret, 0, 8).'...)')."\n";
echo ' BITUNIX_LANGUAGE: '.($language)."\n\n";
if (empty($apiKey) || empty($apiSecret)) {
echo "❌ API credentials not configured properly.\n";
@ -55,27 +55,27 @@ config([
]);
echo "🔧 Configuration Test:\n";
echo " Base URI: " . config('bitunix-api.future_base_uri') . "\n";
echo " API Key: " . substr(config('bitunix-api.api_key'), 0, 8) . "...\n";
echo " API Secret: " . substr(config('bitunix-api.api_secret'), 0, 8) . "...\n";
echo " Language: " . config('bitunix-api.language') . "\n\n";
echo ' Base URI: '.config('bitunix-api.future_base_uri')."\n";
echo ' API Key: '.substr(config('bitunix-api.api_key'), 0, 8)."...\n";
echo ' API Secret: '.substr(config('bitunix-api.api_secret'), 0, 8)."...\n";
echo ' Language: '.config('bitunix-api.language')."\n\n";
// Test header generation
try {
echo "🔐 Testing Header Generation:\n";
$headers = Header::generateHeaders([], '{"test":"value"}');
echo " API Key: " . $headers['api-key'] . "\n";
echo " Sign: " . substr($headers['sign'], 0, 16) . "...\n";
echo " Nonce: " . $headers['nonce'] . "\n";
echo " Timestamp: " . $headers['timestamp'] . "\n";
echo " Language: " . $headers['language'] . "\n";
echo " Content-Type: " . $headers['Content-Type'] . "\n\n";
echo ' API Key: '.$headers['api-key']."\n";
echo ' Sign: '.substr($headers['sign'], 0, 16)."...\n";
echo ' Nonce: '.$headers['nonce']."\n";
echo ' Timestamp: '.$headers['timestamp']."\n";
echo ' Language: '.$headers['language']."\n";
echo ' Content-Type: '.$headers['Content-Type']."\n\n";
echo "✅ Configuration is working correctly!\n";
echo "You can now use the Bitunix API package in your application.\n";
} catch (Exception $e) {
echo "❌ Error generating headers: " . $e->getMessage() . "\n";
echo '❌ Error generating headers: '.$e->getMessage()."\n";
exit(1);
}

View File

@ -12,7 +12,6 @@ interface ChangeMarginModeRequestContract
* @param string $symbol Trading pair (e.g., 'BTCUSDT')
* @param string $marginCoin Margin coin (e.g., 'USDT')
* @param string $marginMode Margin mode ('ISOLATION' or 'CROSS')
* @return ResponseInterface
*/
public function changeMarginMode(string $symbol, string $marginCoin, string $marginMode): ResponseInterface;
}

View File

@ -27,7 +27,6 @@ interface PlaceOrderRequestContract
* @param string|null $slStopType Stop loss trigger type
* @param string|null $slOrderType Stop loss trigger place order type
* @param string|null $slOrderPrice Stop loss trigger place order price
* @return ResponseInterface
*/
public function placeOrder(
string $symbol,
@ -50,4 +49,3 @@ interface PlaceOrderRequestContract
?string $slOrderPrice = null
): ResponseInterface;
}

View File

@ -235,4 +235,3 @@ it('can handle different effect types', function () {
))->not->toThrow(Exception::class);
}
});