Skip to content

Releases: tigusigalpa/bingx-php

v2.5.51

15 Mar 08:05

Choose a tag to compare

v2.5.5

15 Mar 07:43

Choose a tag to compare

BingX PHP SDK v2.5.5 Release Notes

Release Date: March 15, 2026

Overview

This release brings significant updates to the BingX PHP SDK to support the latest API changes introduced by BingX between December 2025 and February 2026. The update focuses on enhanced market data endpoints, improved internal transfer capabilities, and new sub-mother account management features.


🎯 What's New

Market Service Enhancements

Spot Symbols Endpoint Update

  • Updated endpoint: getSpotSymbols() now uses /openApi/spot/v1/common/symbols
  • New field: maxMarketNotional - Maximum notional amount allowed for a single market order
  • New status value: 29 = Pre-Delisted - Indicates symbols scheduled for delisting
  • Complete status values:
    • 0 = Offline
    • 1 = Online
    • 5 = Pre-open
    • 10 = Accessed
    • 25 = Suspended
    • 29 = Pre-Delisted ⭐ NEW
    • 30 = Delisted

Spot Klines v2 Endpoint

  • Updated endpoint: getSpotKlines() now uses /openApi/spot/v2/market/kline
  • New parameter: timeZone - Optional timezone offset
    • 0 = UTC (default)
    • 8 = UTC+8
  • Increased limit: Maximum records increased from 1000 to 1440

Example:

$spotKlines = Bingx::market()->getSpotKlines(
    'BTC-USDT', '1h', 100,
    strtotime('2024-01-01') * 1000,
    strtotime('2024-01-02') * 1000,
    8 // UTC+8 timezone
);

Spot Account Service Updates

Internal Transfer Modernization

The internalTransfer() method has been completely updated with new parameters for enhanced flexibility:

New Parameters:

  • walletType (integer): Now supports Spot Account type
    • 1 = Fund Account
    • 2 = Standard Futures Account
    • 3 = Perpetual Futures Account
    • 4 = Spot Account ⭐ NEW
  • userAccountType (integer): Account identifier type
    • 1 = UID
    • 2 = Phone number
    • 3 = Email
  • userAccount (string): The actual account identifier
  • callingCode (string, optional): Phone area code (required when userAccountType=2)
  • transferClientId (string, optional): Custom transfer ID (max 100 characters)
  • recvWindow (integer, optional): Request validity time window in milliseconds

Example:

$internalTransfer = Bingx::spotAccount()->internalTransfer(
    coin: 'USDT',
    walletType: 4, // Spot Account
    amount: 50.0,
    userAccountType: 1, // UID
    userAccount: '123456',
    callingCode: null,
    transferClientId: 'transfer-001',
    recvWindow: null
);

Sub-Account Service Enhancements

Sub-Account Internal Transfer Update

The subAccountInternalTransfer() method now supports Spot Account wallet type:

Updated Parameters:

  • walletType (integer): Now includes Spot Account for sub-accounts
    • 1 = Fund Account
    • 2 = Standard Futures Account
    • 3 = Perpetual Futures Account
    • 15 = Spot Account ⭐ NEW (Note: Different value from main account)
  • Additional parameters match the main account internal transfer

Example:

$transfer = Bingx::subAccount()->subAccountInternalTransfer(
    coin: 'USDT',
    walletType: 15, // Spot Account for sub-accounts
    amount: 100.0,
    userAccountType: 1,
    userAccount: '12345678',
    callingCode: null,
    transferClientId: 'transfer-001',
    recvWindow: null
);

New Sub-Mother Account Methods

Three powerful new methods for master account holders to manage transfers between parent and sub-accounts:

1. subMotherAccountAssetTransfer()

Flexible asset transfer between parent and sub-accounts with full control over account types.

Parameters:

  • assetName: Asset to transfer (e.g., "USDT")
  • transferAmount: Amount to transfer
  • fromUid: Payer UID
  • fromType: Payer type (1=Parent, 2=Sub-account)
  • fromAccountType: Source account type (1=Funding, 2=Standard futures, 3=Perpetual, 15=Spot)
  • toUid: Receiver UID
  • toType: Receiver type (1=Parent, 2=Sub-account)
  • toAccountType: Destination account type
  • remark: Transfer remarks
  • recvWindow: Optional execution window

Returns: Transfer record ID (tranId)

Example:

$transfer = Bingx::subAccount()->subMotherAccountAssetTransfer(
    assetName: 'USDT',
    transferAmount: 100.0,
    fromUid: 123456,
    fromType: 1, // Parent account
    fromAccountType: 1, // Funding
    toUid: 789012,
    toType: 2, // Sub-account
    toAccountType: 15, // Spot account
    remark: 'Transfer to sub-account',
    recvWindow: null
);
2. getSubMotherAccountTransferableAmount()

Query supported coins and available transferable amounts between accounts.

Parameters:

  • fromUid: Payer UID
  • fromAccountType: Source account type
  • toUid: Receiver UID
  • toAccountType: Destination account type
  • recvWindow: Optional execution window

Returns: Array of coins with id, name, and availableAmount

Example:

$transferable = Bingx::subAccount()->getSubMotherAccountTransferableAmount(
    fromUid: 123456,
    fromAccountType: 1,
    toUid: 789012,
    toAccountType: 15,
    recvWindow: null
);
3. getSubMotherAccountTransferHistory()

Query transfer history between sub-accounts and parent account with advanced filtering.

Parameters:

  • uid: UID to query
  • type: Transfer type filter (optional)
  • tranId: Transfer ID filter (optional)
  • startTime: Start time in milliseconds (optional)
  • endTime: End time in milliseconds (optional)
  • pageId: Current page (default 1)
  • pagingSize: Page size (default 10, max 100)
  • recvWindow: Optional execution window

Returns: Total count and rows array with transfer history

Example:

$history = Bingx::subAccount()->getSubMotherAccountTransferHistory(
    uid: 123456,
    type: null,
    tranId: null,
    startTime: strtotime('-7 days') * 1000,
    endTime: time() * 1000,
    pageId: 1,
    pagingSize: 50,
    recvWindow: null
);

🔄 Changed

  • Updated BingX API integration to support changes from December 2025 through February 2026
  • Improved parameter validation and type safety across all updated methods
  • Enhanced documentation with detailed parameter descriptions and examples

⚠️ Breaking Changes

Method Signature Changes

The following methods have updated signatures that may require code changes:

  1. internalTransfer() - New required parameters and parameter types
  2. subAccountInternalTransfer() - New required parameters and parameter types

Migration Guide:

Old Code:

$transfer = Bingx::spotAccount()->internalTransfer(
    coin: 'USDT',
    walletType: 'SPOT',
    amount: 50.0,
    transferType: 'FROM_MAIN_TO_SUB',
    subUid: '123456'
);

New Code:

$transfer = Bingx::spotAccount()->internalTransfer(
    coin: 'USDT',
    walletType: 4, // Integer instead of string
    amount: 50.0,
    userAccountType: 1, // New parameter
    userAccount: '123456', // New parameter
    callingCode: null,
    transferClientId: null,
    recvWindow: null
);

🔐 API Compatibility

  • All changes maintain backward compatibility where possible
  • New optional parameters added with sensible defaults
  • Existing method signatures preserved for non-breaking changes
  • Full support for all BingX API v3 endpoints

📚 Documentation

  • Updated README with comprehensive examples for all new features
  • Added CHANGELOG.md with detailed change history
  • Enhanced inline documentation for all updated methods

🔗 Resources


🙏 Acknowledgments

Thank you to all contributors and users who provided feedback for this release. Special thanks to the BingX API team for their comprehensive API documentation.


Installation & Upgrade

New Installation

composer require tigusigalpa/bingx-php:^2.5.5

Upgrade from Previous Version

composer update tigusigalpa/bingx-php

Note: Please review the breaking changes section above before upgrading to ensure compatibility with your existing code.


Full Changelog: See CHANGELOG.md for complete details.

v2.4.0

13 Dec 17:16

Choose a tag to compare

Release Notes for v2.4.0

🎉 Copy Trading API - Complete Implementation

Version 2.4.0 introduces full support for BingX Copy Trading API with 13 new methods for both perpetual futures and spot trading.


✨ What's New

🆕 Copy Trading Service (13 methods)

A comprehensive new service for copy trading operations across perpetual futures and spot markets:

Perpetual Futures Copy Trading (8 methods)

  • getCurrentTrackOrders() - Query current track orders for perpetual futures
  • closeTrackOrder() - Close positions by order number
  • setTPSL() - Set take profit and stop loss for positions
  • getTraderDetail() - Get personal trading overview
  • getProfitSummary() - Query profit summary
  • getProfitDetail() - Get detailed profit information with pagination
  • setCommission() - Set commission rate for copy trading
  • getTradingPairs() - Get available copy trading pairs

Spot Copy Trading (5 methods)

  • sellSpotOrder() - Sell spot assets based on buy order number
  • getSpotTraderDetail() - Get spot trading overview
  • getSpotProfitSummary() - Query spot profit summary
  • getSpotProfitDetail() - Get detailed spot profit information
  • getSpotHistoryOrders() - Query historical spot orders

📈 Statistics

  • Total Methods: 220 (was 207)
  • New Methods: +13
  • Services: 13 (including new Copy Trading Service)
  • API Coverage: 100% of Copy Trading endpoints

Service Distribution

Service Methods Status
Market Service 40
TWAP Service 7
Account Service 40
Trade Service 54
Wallet Service 6
Spot Account Service 9
Sub-Account Service 20
Copy Trading Service 13 🆕
Contract Service 3
Listen Key Service 3
Coin-M Market 6
Coin-M Trade 17
Coin-M Listen Key 3

💡 Usage Examples

Perpetual Futures Copy Trading

use Tigusigalpa\BingX\Facades\Bingx;

// Get current track orders
$orders = Bingx::copyTrading()->getCurrentTrackOrders('BTC-USDT');

// Close position by order number
$result = Bingx::copyTrading()->closeTrackOrder('1252864099381234567');

// Set take profit and stop loss
Bingx::copyTrading()->setTPSL(
    positionId: '1252864099381234567',
    stopLoss: 48000.0,
    takeProfit: 52000.0
);

// Get trader details
$details = Bingx::copyTrading()->getTraderDetail();

// Get profit summary
$summary = Bingx::copyTrading()->getProfitSummary();

// Get profit details with pagination
$profits = Bingx::copyTrading()->getProfitDetail(
    pageIndex: 1,
    pageSize: 20
);

// Set commission rate
Bingx::copyTrading()->setCommission(5.0); // 5% commission

// Get available trading pairs
$pairs = Bingx::copyTrading()->getTradingPairs();

Spot Copy Trading

// Sell spot order based on buy order ID
$result = Bingx::copyTrading()->sellSpotOrder('1253517936071234567');

// Get spot trader details
$details = Bingx::copyTrading()->getSpotTraderDetail();

// Get spot profit summary
$summary = Bingx::copyTrading()->getSpotProfitSummary();

// Get spot profit details
$profits = Bingx::copyTrading()->getSpotProfitDetail(
    pageIndex: 1,
    pageSize: 20
);

// Query historical spot orders
$history = Bingx::copyTrading()->getSpotHistoryOrders(
    pageIndex: 1,
    pageSize: 50
);

📝 Documentation Updates

  • ✅ Complete Copy Trading Service documentation in README.md
  • ✅ Russian documentation in README-ru.md
  • ✅ Updated service statistics and method counts
  • ✅ Added comprehensive usage examples for both futures and spot

🔧 Technical Details

New Files

  • src/Services/CopyTradingService.php - Complete copy trading implementation

Modified Files

  • src/BingxClient.php - Integrated CopyTradingService
  • README.md - Added Copy Trading Service documentation
  • README-ru.md - Added Russian documentation

📦 Installation

composer require tigusigalpa/bingx-php:^2.4.0

Or update your composer.json:

{
    "require": {
        "tigusigalpa/bingx-php": "^2.4.0"
    }
}

🔄 Upgrade Guide

From v2.3.x to v2.4.0

This is a non-breaking release. All existing code will continue to work without modifications.

New features available:

  1. Access copy trading operations via Bingx::copyTrading()
  2. Full support for perpetual futures and spot copy trading
  3. Manage positions, profits, and commissions programmatically

No migration steps required.


🐛 Bug Fixes

  • None in this release (feature-only update)

🙏 Credits

Special thanks to all contributors and users who requested copy trading features!


📚 Resources


🔜 What's Next

  • Additional copy trading features
  • Enhanced follower management
  • Performance optimizations

Full Changelog: v2.3.0...v2.4.0

v2.3.0

13 Dec 16:40

Choose a tag to compare

Release Notes for v2.3.0

🎉 Account & Wallet API - Complete Implementation

Version 2.3.0 brings complete coverage of BingX Account & Wallet API endpoints with 21 new methods across sub-account management and account permissions.


✨ What's New

🆕 Sub-Account Service (20 methods)

A comprehensive new service for managing sub-accounts, API keys, transfers, and deposits:

Sub-Account Management

  • createSubAccount() - Create new sub-accounts
  • getAccountUid() - Get main account UID
  • getSubAccountList() - List all sub-accounts with pagination
  • getSubAccountAssets() - Query sub-account assets
  • updateSubAccountStatus() - Enable/disable sub-accounts
  • getAllSubAccountBalances() - Get balances across all sub-accounts

API Key Management

  • createSubAccountApiKey() - Create API keys for sub-accounts
  • queryApiKey() - Query API key information
  • editSubAccountApiKey() - Edit sub-account API key permissions
  • deleteSubAccountApiKey() - Delete sub-account API keys

Transfer Operations

  • authorizeSubAccountInternalTransfer() - Authorize sub-accounts for transfers
  • subAccountInternalTransfer() - Transfer between main/sub-accounts
  • getSubAccountInternalTransferRecords() - Query transfer history
  • subAccountAssetTransfer() - Asset transfers for sub-accounts
  • getSubAccountTransferSupportedCoins() - Get supported transfer coins
  • getSubAccountAssetTransferHistory() - Query asset transfer history

Deposit Management

  • createSubAccountDepositAddress() - Create deposit addresses
  • getSubAccountDepositAddress() - Query deposit addresses
  • getSubAccountDepositHistory() - Get deposit history

📊 Account Service Enhancement

  • getAccountApiPermissions() - Query account API permissions

📈 Statistics

  • Total Methods: 207 (was 186)
  • New Methods: +21
  • Services: 12 (including new Sub-Account Service)
  • API Coverage: 100% of Account & Wallet endpoints

Service Distribution

Service Methods Status
Market Service 40
TWAP Service 7
Account Service 40 ✅ (+1)
Trade Service 54
Wallet Service 6
Spot Account Service 9
Sub-Account Service 20 🆕
Contract Service 3
Listen Key Service 3
Coin-M Market 6
Coin-M Trade 17
Coin-M Listen Key 3

💡 Usage Examples

Creating and Managing Sub-Accounts

use Tigusigalpa\BingX\Facades\Bingx;

// Create a sub-account
$result = Bingx::subAccount()->createSubAccount('trading_bot_001');

// Get all sub-accounts
$subAccounts = Bingx::subAccount()->getSubAccountList();

// Get sub-account assets
$assets = Bingx::subAccount()->getSubAccountAssets('12345678');

// Update status
Bingx::subAccount()->updateSubAccountStatus('trading_bot_001', 1); // 1: enable

API Key Management

// Create API key for sub-account
$apiKey = Bingx::subAccount()->createSubAccountApiKey(
    subAccountString: 'trading_bot_001',
    label: 'Bot API Key',
    permissions: ['spot' => true, 'futures' => true],
    ip: '192.168.1.100' // Optional IP whitelist
);

// Edit permissions
Bingx::subAccount()->editSubAccountApiKey(
    subAccountString: 'trading_bot_001',
    apiKey: 'your_api_key',
    permissions: ['spot' => false, 'futures' => true]
);

Internal Transfers

// Transfer from main to sub-account
$transfer = Bingx::subAccount()->subAccountInternalTransfer(
    coin: 'USDT',
    walletType: 'SPOT',
    amount: 100.0,
    transferType: 'FROM_MAIN_TO_SUB',
    toSubUid: '12345678'
);

// Transfer between sub-accounts
$transfer = Bingx::subAccount()->subAccountInternalTransfer(
    coin: 'USDT',
    walletType: 'PERPETUAL',
    amount: 50.0,
    transferType: 'FROM_SUB_TO_SUB',
    fromSubUid: '12345678',
    toSubUid: '87654321'
);

Deposit Management

// Create deposit address for sub-account
$address = Bingx::subAccount()->createSubAccountDepositAddress(
    coin: 'USDT',
    network: 'TRC20',
    subUid: '12345678'
);

// Get deposit history
$deposits = Bingx::subAccount()->getSubAccountDepositHistory(
    subUid: '12345678',
    coin: 'USDT',
    status: 1,
    limit: 100
);

📝 Documentation Updates

  • ✅ Complete Sub-Account Service documentation in README.md
  • ✅ Russian documentation in README-ru.md
  • ✅ Updated service statistics and method counts
  • ✅ Added comprehensive usage examples

📦 Installation

composer require tigusigalpa/bingx-php:^2.3.0
{
    "require": {
        "tigusigalpa/bingx-php": "^2.3.0"
    }
}

🐛 Bug Fixes

  • None in this release (feature-only update)

🙏 Credits

Special thanks to all contributors and users who requested sub-account management features!


📚 Resources


🔜 What's Next

  • WebSocket enhancements
  • Additional trading strategies
  • Performance optimizations

Full Changelog: v2.2.0...v2.3.0

v2.2.1

30 Nov 10:09

Choose a tag to compare

Вот текст для Release Notes на GitHub для версии 2.2.0:


🚀 Release v2.2.0 - Coin-M Perpetual Futures Support

🆕 New Features

Coin-M Perpetual Futures API

Added complete support for Coin-M (crypto-margined) perpetual futures contracts with 26 new methods:

🔧 Integration

Access Coin-M API through the main client:

// Laravel
$ticker = Bingx::coinM()->market()->getTicker('BTC-USD');
$balance = Bingx::coinM()->trade()->getBalance();

// Pure PHP
$bingx = new BingxClient($http);
$contracts = $bingx->coinM()->market()->getContracts();

📊 Key Differences: USDT-M vs Coin-M

Feature USDT-M Coin-M
Margin USDT (stablecoin) Cryptocurrency (BTC, ETH)
Settlement USDT Base cryptocurrency
API Path /openApi/swap/v2/ /openApi/cswap/v1/
Symbols BTC-USDT BTC-USD, ETH-USD

📈 Statistics

  • Total methods: 186 (160 → 186)
  • USDT-M services: 8 services, 160 methods
  • Coin-M services: 3 services, 26 methods
  • API coverage: 100%

📚 Documentation

  • Comprehensive examples for all Coin-M methods
  • Updated API coverage tables
  • Detailed PHPDoc for all new methods

🔗 Use Cases

Perfect for:

  • Hedging crypto holdings without converting to stablecoins
  • Earning yield in base cryptocurrency
  • Avoiding stablecoin regulatory risks
  • Long-term crypto holders

⚠️ Breaking Changes

None - fully backward compatible with v2.1.0

🙏 Acknowledgments

Thanks to all contributors and users who requested Coin-M support!

v0.2.2

20 Nov 02:40

Choose a tag to compare

Full Changelog: v0.1.0...v0.2.2

v0.1.0

18 Nov 17:04

Choose a tag to compare

First public alpha release of tigusigalpa/bingx-php — a PHP client for BingX Swap V2 API with optional Laravel integration.

✨ Features

  • Base HTTP client with HMAC-SHA256 signing, configurable base URI and signature encoding, automatic timestamp.
  • Modular services:
    • MarketService – symbols, prices, depth, klines, funding, mark price.
    • AccountService – balance, positions, account info, fees, margin, leverage helpers.
    • TradeService – create/cancel orders, batch orders, order & user history, user trades.
  • Advanced OrderBuilder:
    • Spot & futures, margin size, leverage, LONG/SHORT/BOTH.
    • Stop-loss / take-profit (price and %), test orders.
    • Built‑in validation of required fields and combinations.
  • Commission & leverage utilities:
    • Futures fee calculator (0.045% standard rate).
    • Batch commission helpers.
    • Correct Set/Get Leverage implementation per BingX docs.
  • Laravel 8–12 integration:
    • Service provider + Bingx facade.
    • Publishable config/bingx.php.
    • Ready for DI via BingxClient.
  • Documentation:
    • README with Laravel and plain PHP usage,
    • Market/Account/Trade examples,
    • OrderBuilder patterns, cancellation, leverage and commission examples.