Skip to content

v1.3.4

Choose a tag to compare

@tigusigalpa tigusigalpa released this 19 Apr 12:22
· 18 commits to main since this release

Release Notes v1.3.4

Bug Fixes & Improvements

🔐 Authentication & Headers

  • Added required headers: User-Agent: bybit-php/1.0.0 and X-Referer: bybit-php now included in all API requests per Bybit API requirements
  • Fixed query string signing: Removed unnecessary ksort() from buildQuery() — parameters are now signed in their original order, matching Bybit's signature calculation

⚡ Rate Limiting

  • Built-in rate limit protection: Automatic throttling with 100ms minimum interval between GET requests and 300ms between POST requests to prevent retCode=10006 errors

🛡️ Error Handling

  • New throwOnError option: When enabled, throws RuntimeException on non-zero retCode responses instead of returning error arrays
  • New setThrowOnError() method: Fluent setter to toggle error throwing at runtime

📡 WebSocket Improvements

  • Multi-category support: New category parameter supports spot, linear, inverse, and option public streams
  • Fixed authentication: expires parameter now correctly sent as string
  • Improved ping/pong handling: Response now includes req_id when present in the ping message
  • New setCategory() method: Change WebSocket category without reconnecting

📈 Trading Improvements

  • Smart triggerDirection: Automatically calculated based on current price vs trigger price, or can be explicitly set via extra['triggerDirection']
  • Spot market buy enhancement: Automatically adds marketUnit=quoteCoin for market buy orders (buy with USDT amount)

🔧 Laravel Integration

  • Fixed Facade accessor: BybitWebSocket facade now correctly uses 'bybit.websocket' alias
  • New config options:
    • throw_on_error (BYBIT_THROW_ON_ERROR)
    • websocket_category (BYBIT_WEBSOCKET_CATEGORY)

Breaking Changes

None — all changes are backward compatible.

Upgrade Guide

composer update tigusigalpa/bybit-php
php artisan vendor:publish --tag=bybit-config --force  # Optional: update config