zoomex-php

0

Описание

This unofficial PHP/Laravel SDK provides a convenient and modern interface for the Zoomex crypto exchange API v3. It offers full REST and WebSocket coverage for market data, trading, positions, and account management. The library is built with PHP 8.1+, features out-of-the-box Laravel support, and allows easy switching between testnet and mainnet.

Языки

  • PHP100%
20 дней назад
20 дней назад
20 дней назад
20 дней назад
20 дней назад
20 дней назад
20 дней назад
20 дней назад
20 дней назад
20 дней назад
20 дней назад
19 дней назад
20 дней назад
20 дней назад
README.md

Zoomex PHP Client

Zoomex PHP/Laravel SDK/Library

Latest Version on Packagist PHP Version License

This PHP/Laravel SDK provides a convenient way to access the Zoomex crypto exchange API v3. It supports both REST and WebSocket, allowing you to work with market data, trading, positions, account, and assets.

Also available: Zoomex Go Client

📖 Full Documentation on Wiki

GitHub repository: https://github.com/tigusigalpa/zoomex-php

What's inside

  • Full Zoomex API v3 coverage: Includes both REST and WebSocket.
  • HMAC-SHA256 request signing: Ensures the security of your requests.
  • Out-of-the-box Laravel support: Includes a service provider, facade, and configuration.
  • Testnet/mainnet switching: Easily switch between test and main networks.
  • Modern PHP: Written in PHP 8.1+ with enums and strict types.
  • Tested with Pest: Guarantees reliability and stability.

Requirements

  • PHP 8.1+
  • Composer
  • Laravel 9/10/11/12 (optional)

Installation

Setup

Laravel

.env
:

Standalone PHP

Quick examples

Get tickers

Place order

Get positions

Get wallet balance

WebSocket — orderbook stream

WebSocket — private order updates

API Reference

Market (public)

MethodEndpointDescription
getServerTime()
/cloud/trade/v3/market/time
Retrieves the current server time.
getKline()
/cloud/trade/v3/market/kline
Fetches k-line (candlestick) data.
getMarkPriceKline()
/cloud/trade/v3/market/mark-price-kline
Gets k-line data for the mark price.
getIndexPriceKline()
/cloud/trade/v3/market/index-price-kline
Obtains k-line data for the index price.
getPremiumIndexPriceKline()
/cloud/trade/v3/market/premium-index-price-kline
Retrieves k-line data for the premium index price.
getInstrumentsInfo()
/cloud/trade/v3/market/instruments-info
Provides information about the instruments.
getOrderbook()
/cloud/trade/v3/market/orderbook
Returns the order book.
getTickers()
/cloud/trade/v3/market/tickers
Gets ticker information.
getFundingRateHistory()
/cloud/trade/v3/market/funding/history
Shows the funding rate history.
getPublicTradingHistory()
/cloud/trade/v3/market/recent-trade
Displays the public trading history.
getRiskLimit()
/cloud/trade/v3/market/risk-limit/info
Provides information on risk limits.

Trade (private)

MethodEndpointDescription
placeOrder()
/cloud/trade/v3/order/create
Places a new order.
amendOrder()
/cloud/trade/v3/order/amend
Amends an existing order.
cancelOrder()
/cloud/trade/v3/order/cancel
Cancels an order.
getOpenOrders()
/cloud/trade/v3/order/realtime
Gets a list of open orders.
cancelAllOrders()
/cloud/trade/v3/order/cancel-all
Cancels all orders.
getOrderHistory()
/cloud/trade/v3/order/history
Shows the order history.
getTradeHistory()
/cloud/trade/v3/execution/list
Displays the trade history.

Position (private)

MethodEndpointDescription
getPositionInfo()
/cloud/trade/v3/position/list
Gets information about current positions.
setLeverage()
/cloud/trade/v3/position/set-leverage
Sets the leverage.
switchIsolated()
/cloud/trade/v3/position/switch-isolated
Switches between cross and isolated margin.
setTpSlMode()
/cloud/trade/v3/position/set-tpsl-mode
Sets the Take-Profit/Stop-Loss mode.
switchPositionMode()
/cloud/trade/v3/position/switch-mode
Switches the position mode.
setRiskLimit()
/cloud/trade/v3/position/set-risk-limit
Confirms the new risk limit.
setTradingStop()
/cloud/trade/v3/position/trading-stop
Sets a trailing stop.
setAutoAddMargin()
/cloud/trade/v3/position/set-auto-add-margin
Enables/disables automatic margin addition.
addOrReduceMargin()
/cloud/trade/v3/position/add-margin
Adds or reduces margin.
getClosedPnl()
/cloud/trade/v3/position/closed-pnl
Gets information on closed profit and loss.

Account (private)

MethodEndpointDescription
getWalletBalance()
/cloud/trade/v3/account/wallet-balance
Gets the wallet balance.
getFeeRate()
/cloud/trade/v3/account/fee-rate
Returns information on fees.
getAccountInfo()
/cloud/trade/v3/account/info
Provides account information.

Asset (private)

MethodEndpointDescription
getCoinExchangeRecords()
/cloud/trade/v3/asset/coin-exchange-record
Gets coin exchange records.
getDeliveryRecord()
/cloud/trade/v3/asset/delivery-record
Returns delivery records.
getSettlementRecord()
/cloud/trade/v3/asset/settlement-record
Shows settlement records.
getAssetInfo()
/cloud/trade/v3/asset/info
Provides asset information.
getAllCoinsBalance()
/cloud/trade/v3/asset/all-coins-balance
Gets the balance of all coins.
getInternalTransferRecords()
/cloud/trade/v3/asset/transfer/query-inter-transfer-list
Returns internal transfer records.
getSubUIDList()
/cloud/trade/v3/asset/transfer/query-sub-member-list
Gets a list of sub-accounts.
createInternalTransfer()
/cloud/trade/v3/asset/transfer/inter-transfer
Creates an internal transfer.
getDepositRecords()
/cloud/trade/v3/asset/deposit/query-record
Gets deposit records.
getWithdrawalRecords()
/cloud/trade/v3/asset/withdraw/query-record
Returns withdrawal records.
getCoinInfo()
/cloud/trade/v3/asset/coin/query-info
Provides coin information.
withdraw()
/cloud/trade/v3/asset/withdraw/create
Creates a withdrawal request.
cancelWithdrawal()
/cloud/trade/v3/asset/withdraw/cancel
Cancels a withdrawal request.

WebSocket Topics

Channel TypeTopic PatternDescription
Public
orderbook.{depth}.{symbol}
Order book (depth: 1, 50, 200, 1000)
Public
publicTrade.{symbol}
Public trades
Public
tickers.{symbol}
Ticker
Public
kline.{interval}.{symbol}
K-lines (candlesticks)
Public
liquidation.{symbol}
All liquidations
Private
order
Order updates
Private
position
Position updates
Private
execution
Execution updates
Private
wallet
Wallet updates

Errors

Two exception types:

  • ZoomexApiException
    — API returned an error (
    retCode !== 0
    )
  • ZoomexRequestException
    — HTTP/network failure

Rate limits

See the official documentation.

Testing

Contributing

See CONTRIBUTING.md.

Security

Found a vulnerability? Email sovletig@gmail.com (don't open public issues).

Author

Igor Sazonov

License

MIT. See LICENSE.