PHPackages                             populous/streamer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. populous/streamer

ActiveLibrary[HTTP &amp; Networking](/categories/http)

populous/streamer
=================

packages for php-wss websocket server in populous

v1.5.0.0(4y ago)21081MITPHPPHP &gt;=7.1CI failing

Since Jun 25Pushed 4y ago4 watchersCompare

[ Source](https://github.com/bitpopulous/streamer)[ Packagist](https://packagist.org/packages/populous/streamer)[ Docs](https://exchange.populous.world)[ RSS](/packages/populous-streamer/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (3)Versions (61)Used By (0)

populous world streamer package
===============================

[](#populous-world-streamer-package)

This is a streamer package based on CodeIgniter 3.1.4 that is used for populous world.

installation
------------

[](#installation)

`cd project_root`

`composer require populous/streamer`

put .env file in application directory
--------------------------------------

[](#put-env-file-in-application-directory)

```
DB_HOST=YOUR_DB_HOST
DB_USERNAME=YOUR_DB_USERNAME
DB_PASSWORD=YOUR_DB_PASSWORD
DB_NAME=YOUR_DB_NAME

WEBSOCKET_IP=127.0.0.1
WEBSOCKET_URL='ws://127.0.0.1'
WEBSOCKET_PORT=8443
WEBSOCKET_ENDPOINT='ws://127.0.0.1:8443'
WEBSOCKET_ENDPOINT_SERVER_USE='ws://127.0.0.1:8443'

ADMIN_USER_ID=YOUR_ADMIN_USER_ID

FEES_BALANCE_OF=YOUR_SYMBOL
FEES_BALANCE_ABOVE=LIMIT_AMOUNT
FEES_BALANCE_DISCOUNT=DISCOUNT_PERCENT
```

put WsServer\_model.php file in /application/models directory
-------------------------------------------------------------

[](#put-wsserver_modelphp-file-in-applicationmodels-directory)

this streamer packages uses WsServer\_model.php file, so if don't have WsServer\_model.php file, it will shows error.

put shell\_scripts directory in project root directory
------------------------------------------------------

[](#put-shell_scripts-directory-in-project-root-directory)

> mkdir shell\_scripts

> touch shell\_scripts/run\_public\_socket\_server.sh

```
#!/bin/bash

sudo pkill -f php-wss
php /var/www/Altyex/index.php websocket runServer
```

run the WsServer
----------------

[](#run-the-wsserver)

> nohup sh shell\_scripts/run\_public\_socket\_server.sh &gt; shell\_scripts/logs/run\_public\_socket\_server.log &amp; disown

Official Documentation
======================

[](#official-documentation)

- The base endpoint is: wss//streamer.populous.world/wss

[![channels](https://user-images.githubusercontent.com/23646985/81881522-f5e76c80-95c2-11ea-8faf-a1137c21404f.png)](https://user-images.githubusercontent.com/23646985/81881522-f5e76c80-95c2-11ea-8faf-a1137c21404f.png)

**Table of Contents**

- [Events](#events)
    - [Subscribe Channels](#subscribe-channels)
        - [Subscribe global market](#subscribe-global-market)
        - [Subscribe Crypto Rates channel](#subscribe-crypto-rates-channel)
        - [Subscribe Private user channel](#subscribe-private-user-channel)
    - [Exchange Events](#exchange-events)
        - [Init Exchange Guest](#init-exchange-guest)
        - [Init Exchange](#init-exchange)
        - [Buy Limit](#buy-limit)
        - [Buy Market](#buy-market)
        - [Buy Stop Limit](#buy-stop-limit)
        - [Sell Limit](#sell-limit)
        - [Sell Market](#sell-market)
        - [Sell Stop Limit](#sell-stop-limit)
        - [Cancel Order Event](#cancel-order-event)
    - [Orderbook Events](#orderbook-events)
        - [Init Orderbook](#init-orderbook)
    - [API settings Events](#api-settings-events)
        - [Init API settings](#init-api-settings)
        - [Create API](#create-api)
        - [Update API](#update-api)
        - [Delete API](#delete-api)

Events
------

[](#events)

EventsChannelsMessage Direction**⬆ exchange-buy****private-channel****C-&gt;S***⬇ exchange-buy**private-channel**S-&gt;C***⬆ exchange-sell****private-channel****C-&gt;S***⬇ exchange-sell**private\_channel**S-&gt;C***⬆ exchange-cancel-order****private-channel****C-&gt;S***⬇ exchange-cancel-order**private\_channel**S-&gt;C***⬆ exchange-init-guest****private-channel****C-&gt;S***⬇ exchange-init-guest**private\_channel**S-&gt;C***⬆ exchange-init****private-channel****C-&gt;S***⬇ exchange-init**private\_channel**S-&gt;C***⬆ orderbook-init****private-channel****C-&gt;S***⬇ orderbook-init**private\_channel**S-&gt;C***⬆ api-setting-init****private-channel****C-&gt;S***⬇ api-setting-init**private\_channel**S-&gt;C***⬆ api-setting-create****private-channel****C-&gt;S***⬇ api-setting-create**private\_channel**S-&gt;C***⬆ api-setting-update****private-channel****C-&gt;S***⬇ api-setting-update**private\_channel**S-&gt;C***⬆ api-setting-delete****private-channel****C-&gt;S***⬇ api-setting-delete**private\_channel**S-&gt;C**⬇ order-update**private\_channel**S-&gt;C**⬇ balance-update**private\_channel**S-&gt;C**⬇ orderbook**market-global-channel**S-&gt;C**⬇ trade-history**market-global-channel**S-&gt;C**⬇ price-change**crypto-rates-channel**S-&gt;C*Subscribe Channels
------------------

[](#subscribe-channels)

### Subscribe global market

[](#subscribe-global-market)

Request Payload

```
{
    "event": "populous:subscribe",
    "channel": "market--global",
    "data": []
}
```

Response Payload

```
{
    "event": "populous:subscribe_succeeded",
    "channel": "market--global",
    "data": []
}
```

### Subscribe Crypto Rates channel

[](#subscribe-crypto-rates-channel)

Request Payload

```
{
    "event": "populous:subscribe",
    "channel": "crypto-rates",
    "data": []
}
```

Response Payload

```
{
    "event": "populous:subscribe_succeeded",
    "channel": "crypto-rates",
    "data": []
}
```

### Subscribe Private user channel

[](#subscribe-private-user-channel)

Request Payload

```
{
    "event": "populous:subscribe",
    "channel": "private-",
    "data": {
        "auth": "USER_AUTH_DATA"
    }
}
```

Response Payload

```
{
    "event": "populous:subscribe_succeeded",
    "channel": "private-",
    "data": []
}
```

Exchange Events
---------------

[](#exchange-events)

### Init Exchange Guest

[](#init-exchange-guest)

Request Payload

```
{
    "event": "exchange-init-guest",
    "channel": "private-",
    "data": {
        "market": "PPT_USDC",
    }
}
```

Response Payload

```
{
    "event": "exchange-init-guest",
    "channel": "private-",
    "data": {
        "buy_orders": "ARRAY_OF_BUY_ORDERS",
        "sell_orders": "ARRAY_OF_SELL_ORDERS",
        "coin_history": "ARRAY_OF_COIN_HISTORY",
        "coinpairs_24h_summary": "OBJECT_OF_COINPAIR_SUMMARY",
        "market_pairs": "ARRAY_OF_MARKET_PAIRS",
        "trade_history": "ARRAY_OF_TRADE_HISTORY",
    }
}
```

### Init Exchange

[](#init-exchange)

Request Payload

```
{
    "event": "exchange-init",
    "channel": "private-",
    "data": {
        "market": "PPT_USDC",
        "ua": "USER_AUTH_DATA",
    }
}
```

Response Payload

```
{
    "event": "exchange-init",
    "channel": "private-",
    "data": {
        "buy_orders": "ARRAY_OF_BUY_ORDERS",
        "sell_orders": "ARRAY_OF_SELL_ORDERS",
        "coin_history": "ARRAY_OF_COIN_HISTORY",
        "coinpairs_24h_summary": "OBJECT_OF_COINPAIR_SUMMARY",
        "market_pairs": "ARRAY_OF_MARKET_PAIRS",
        "trade_history": "ARRAY_OF_TRADE_HISTORY",
        "completed_orders": "ARRAY_OF_COMPLETED_ORDERS",
        "pending_orders": "ARRAY_OF_PENDING_ORDERS",
        "user_balance": "ARRAY_OF_USER_BALANCE",
    }
}
```

### Buy Limit

[](#buy-limit)

Request Payload

```
{
    "event": "exchange-buy",
    "channel": "private-",
    "data": {
        "amount": "AMOUNT_OF_BUYING",
        "pair_id": "COINPAIR_ID",
        "price": "PRICE_OF_BUYING",
        "trade_type": "limit",
        "ua": "USER_AUTH_DATA",
    }
}
```

Response Payload

```
{
    "event": "order-update",
    "channel": "private-",
    "data": {
        "amount_available": "AMOUNT_AVAILABLE_NUMBER",
        "bid_price": "PRICE_OF_BUYING",
        "bid_qty": "AMOUNT_OF_BUYING",
    }
}
```

```
{
    "event": "balance-update",
    "channel": "private-",
    "data": [
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "PRIMARY_CURRENCY_ID",
            "user_id": "USER_ID",
        },
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "SECONDARY_CURRENCY_ID",
            "user_id": "USER_ID",
        }
    ]
}
```

```
{
    "event": "orderbook",
    "channel": "market--global",
    "data": {
        "buy_orders": "",
        "sell_orders": "",
    }
}
```

```
{
    "event": "trade-history",
    "channel": "market--global",
    "data": [
        {
            "bid_price": "1.53",
            "bid_type": "SELL",
            "complete_qty": "30",
            "success_time: `2020-05-13 17:04:31`
        },
    ]
}
```

```
{
    "event": "price-change",
    "channel": "crypto-rates",
    "data": {
        "current_price": "1.530000",
        "previous_price": "1.530000",
    }
}
```

```
{
    "event": "exchange-buy",
    "channel": "private-",
    "data": {
        "isSuccess": true,
        "message": "Buy order successfully placed.",
        "trade_type": "limit"
    }
}
```

Error Response payload

message will have one of \[ "User could not found.", "Invalid pair", "Buy price is invalid.", "Buy amount is invalid.", "Trade could not submitted.", "Insufficient balance." \]

```
{
    "event": "exchange-buy",
    "channel": "private-",
    "data": {
        "isSuccess": false,
        "message": "User could not found." ,
        "trade_type": "limit"
    }
}
```

### Buy Market

[](#buy-market)

Request Payload

```
{
    "event": "exchange-buy",
    "channel": "private-",
    "data": {
        "amount": "AMOUNT_OF_BUYING",
        "pair_id": "COINPAIR_ID",
        "trade_type": "market",
        "ua": "USER_AUTH_DATA",
    }
}
```

Response Payload

```
{
    "event": "order-update",
    "channel": "private-",
    "data": {
        "amount_available": "AMOUNT_AVAILABLE_NUMBER",
        "bid_price": "PRICE_OF_BUYING",
        "bid_qty": "AMOUNT_OF_BUYING",
    }
}
```

```
{
    "event": "balance-update",
    "channel": "private-",
    "data": [
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "PRIMARY_CURRENCY_ID",
            "user_id": "USER_ID",
        },
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "SECONDARY_CURRENCY_ID",
            "user_id": "USER_ID",
        }
    ]
}
```

```
{
    "event": "orderbook",
    "channel": "market--global",
    "data": {
        "buy_orders": "",
        "sell_orders": "",
    }
}
```

```
{
    "event": "trade-history",
    "channel": "market--global",
    "data": [
        {
            "bid_price": "1.53",
            "bid_type": "SELL",
            "complete_qty": "30",
            "success_time: `2020-05-13 17:04:31`
        },
    ]
}
```

```
{
    "event": "price-change",
    "channel": "crypto-rates",
    "data": {
        "current_price": "1.530000",
        "previous_price": "1.530000",
    }
}
```

```
{
    "event": "exchange-buy",
    "channel": "private-",
    "data": {
        "isSuccess": true,
        "message": " bought.  created open order at price .",
        "trade_type": "market"
    }
}
```

Error Response payload

message will have one of \[ "User could not found.", "Invalid pair", "Buy price is invalid.", "Trade could not submitted.", "Insufficient balance." \]

```
{
    "event": "exchange-buy",
    "channel": "private-",
    "data": {
        "isSuccess": false,
        "message": "User could not found." ,
        "trade_type": "market"
    }
}
```

### Buy Stop Limit

[](#buy-stop-limit)

Request Payload

```
{
    "event": "exchange-buy",
    "channel": "private-",
    "data": {
        "stop": "STOP_PRICE_OF_BUYING",
        "limit": "LIMIT_PRICE_OF_BUYING",
        "amount": "AMOUNT_OF_BUYING",
        "pair_id": "COINPAIR_ID",
        "trade_type": "stop_limit",
        "ua": "USER_AUTH_DATA",
    }
}
```

Response Payload

```
{
    "event": "order-update",
    "channel": "private-",
    "data": {
        "amount_available": "AMOUNT_AVAILABLE_NUMBER",
        "bid_price": "PRICE_OF_BUYING",
        "bid_qty": "AMOUNT_OF_BUYING",
    }
}
```

```
{
    "event": "balance-update",
    "channel": "private-",
    "data": [
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "PRIMARY_CURRENCY_ID",
            "user_id": "USER_ID",
        },
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "SECONDARY_CURRENCY_ID",
            "user_id": "USER_ID",
        }
    ]
}
```

```
{
    "event": "orderbook",
    "channel": "market--global",
    "data": {
        "buy_orders": "",
        "sell_orders": "",
    }
}
```

```
{
    "event": "trade-history",
    "channel": "market--global",
    "data": [
        {
            "bid_price": "1.53",
            "bid_type": "SELL",
            "complete_qty": "30",
            "success_time: `2020-05-13 17:04:31`
        },
    ]
}
```

```
{
    "event": "price-change",
    "channel": "crypto-rates",
    "data": {
        "current_price": "1.530000",
        "previous_price": "1.530000",
    }
}
```

```
{
    "event": "exchange-buy",
    "channel": "private-",
    "data": {
        "isSuccess": true,
        "message": "Stop limit order has been placed",
        "trade_type": "stop_limit"
    }
}
```

Error Response payload

message will have one of \[ "User could not found.", "Invalid pair", "Buy Stop price invalid.", "Buy Limit price invalid.", "Buy Amounts invalid.", "Could not create order", "You have insufficient balance, More &lt;AMOUNT\_NEEDED&gt; needed to create an order."" \]

```
{
    "event": "exchange-buy",
    "channel": "private-",
    "data": {
        "isSuccess": false,
        "message": "User could not found." ,
        "trade_type": "limit"
    }
}
```

### Sell Limit

[](#sell-limit)

Request Payload

```
{
    "event": "exchange-sell",
    "channel": "private-",
    "data": {
        "amount": "AMOUNT_OF_BUYING",
        "pair_id": "COINPAIR_ID",
        "price": "PRICE_OF_BUYING",
        "trade_type": "limit",
        "ua": "USER_AUTH_DATA",
    }
}
```

Response Payload

```
{
    "event": "order-update",
    "channel": "private-",
    "data": {
        "amount_available": "AMOUNT_AVAILABLE_NUMBER",
        "bid_price": "PRICE_OF_BUYING",
        "bid_qty": "AMOUNT_OF_BUYING",
    }
}
```

```
{
    "event": "balance-update",
    "channel": "private-",
    "data": [
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "PRIMARY_CURRENCY_ID",
            "user_id": "USER_ID",
        },
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "SECONDARY_CURRENCY_ID",
            "user_id": "USER_ID",
        }
    ]
}
```

```
{
    "event": "orderbook",
    "channel": "market--global",
    "data": {
        "buy_orders": "",
        "sell_orders": "",
    }
}
```

```
{
    "event": "trade-history",
    "channel": "market--global",
    "data": [
        {
            "bid_price": "1.53",
            "bid_type": "SELL",
            "complete_qty": "30",
            "success_time: `2020-05-13 17:04:31`
        },
    ]
}
```

```
{
    "event": "price-change",
    "channel": "crypto-rates",
    "data": {
        "current_price": "1.530000",
        "previous_price": "1.530000",
    }
}
```

```
{
    "event": "exchange-sell",
    "channel": "private-",
    "data": {
        "isSuccess": true,
        "message": "Sell order successfully placed.",
        "trade_type": "limit"
    }
}
```

Error Response payload

message will have one of \[ "User could not found.", "Invalid pair", "Buy price is invalid.", "Buy amount is invalid.", "Trade could not submitted.", "Insufficient balance." \]

```
{
    "event": "exchange-sell",
    "channel": "private-",
    "data": {
        "isSuccess": false,
        "message": "User could not found." ,
        "trade_type": "limit"
    }
}
```

### Sell Market

[](#sell-market)

Request Payload

```
{
    "event": "exchange-sell",
    "channel": "private-",
    "data": {
        "amount": "AMOUNT_OF_BUYING",
        "pair_id": "COINPAIR_ID",
        "trade_type": "market",
        "ua": "USER_AUTH_DATA",
    }
}
```

Response Payload

```
{
    "event": "order-update",
    "channel": "private-",
    "data": {
        "amount_available": "AMOUNT_AVAILABLE_NUMBER",
        "bid_price": "PRICE_OF_BUYING",
        "bid_qty": "AMOUNT_OF_BUYING",
    }
}
```

```
{
    "event": "balance-update",
    "channel": "private-",
    "data": [
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "PRIMARY_CURRENCY_ID",
            "user_id": "USER_ID",
        },
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "SECONDARY_CURRENCY_ID",
            "user_id": "USER_ID",
        }
    ]
}
```

```
{
    "event": "orderbook",
    "channel": "market--global",
    "data": {
        "buy_orders": "",
        "sell_orders": "",
    }
}
```

```
{
    "event": "trade-history",
    "channel": "market--global",
    "data": [
        {
            "bid_price": "1.53",
            "bid_type": "SELL",
            "complete_qty": "30",
            "success_time: `2020-05-13 17:04:31`
        },
    ]
}
```

```
{
    "event": "price-change",
    "channel": "crypto-rates",
    "data": {
        "current_price": "1.530000",
        "previous_price": "1.530000",
    }
}
```

```
{
    "event": "exchange-sell",
    "channel": "private-",
    "data": {
        "isSuccess": true,
        "message": " bought.  created open order at price .",
        "trade_type": "market"
    }
}
```

Error Response payload

message will have one of \[ "User could not found.", "Invalid pair", "Buy price is invalid.", "Trade could not submitted.", "Insufficient balance." \]

```
{
    "event": "exchange-sell",
    "channel": "private-",
    "data": {
        "isSuccess": false,
        "message": "User could not found." ,
        "trade_type": "market"
    }
}
```

### Sell Stop Limit

[](#sell-stop-limit)

Request Payload

```
{
    "event": "exchange-sell",
    "channel": "private-",
    "data": {
        "stop": "STOP_PRICE_OF_BUYING",
        "limit": "LIMIT_PRICE_OF_BUYING",
        "amount": "AMOUNT_OF_BUYING",
        "pair_id": "COINPAIR_ID",
        "trade_type": "stop_limit",
        "ua": "USER_AUTH_DATA",
    }
}
```

Response Payload

```
{
    "event": "order-update",
    "channel": "private-",
    "data": {
        "amount_available": "AMOUNT_AVAILABLE_NUMBER",
        "bid_price": "PRICE_OF_BUYING",
        "bid_qty": "AMOUNT_OF_BUYING",
    }
}
```

```
{
    "event": "balance-update",
    "channel": "private-",
    "data": [
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "PRIMARY_CURRENCY_ID",
            "user_id": "USER_ID",
        },
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "SECONDARY_CURRENCY_ID",
            "user_id": "USER_ID",
        }
    ]
}
```

```
{
    "event": "orderbook",
    "channel": "market--global",
    "data": {
        "buy_orders": "",
        "sell_orders": "",
    }
}
```

```
{
    "event": "trade-history",
    "channel": "market--global",
    "data": [
        {
            "bid_price": "1.53",
            "bid_type": "SELL",
            "complete_qty": "30",
            "success_time: `2020-05-13 17:04:31`
        },
    ]
}
```

```
{
    "event": "price-change",
    "channel": "crypto-rates",
    "data": {
        "current_price": "1.530000",
        "previous_price": "1.530000",
    }
}
```

```
{
    "event": "exchange-sell",
    "channel": "private-",
    "data": {
        "isSuccess": true,
        "message": "Stop limit order has been placed",
        "trade_type": "stop_limit"
    }
}
```

Error Response payload

message will have one of \[ "User could not found.", "Invalid pair", "Buy Stop price invalid.", "Buy Limit price invalid.", "Buy Amounts invalid.", "Could not create order", "You have insufficient balance, More &lt;AMOUNT\_NEEDED&gt; needed to create an order."" \]

```
{
    "event": "exchange-sell",
    "channel": "private-",
    "data": {
        "isSuccess": false,
        "message": "User could not found." ,
        "trade_type": "stop_limit"
    }
}
```

### Cancel Order Event

[](#cancel-order-event)

Request Payload

```
{
    "event": "exchange-cancel-order",
    "channel": "private-",
    "data": {
        "order_id": "ORDER_ID",
        "ua": "USER_AUTH_DATA",
    }
}
```

Response Payload

```
{
    "event": "order-update",
    "channel": "private-",
    "data": {
        "amount_available": "AMOUNT_AVAILABLE_NUMBER",
        "bid_price": "PRICE_OF_BUYING",
        "bid_qty": "AMOUNT_OF_BUYING",
    }
}
```

```
{
    "event": "balance-update",
    "channel": "private-",
    "data": [
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "PRIMARY_CURRENCY_ID",
            "user_id": "USER_ID",
        },
        {
            "balance": "BALANCE",
            "balance_on_hold": "BALANCE_ON_HOLD",
            "currency_id": "SECONDARY_CURRENCY_ID",
            "user_id": "USER_ID",
        }
    ]
}
```

```
{
    "event": "orderbook",
    "channel": "market--global",
    "data": {
        "buy_orders": "",
        "sell_orders": "",
    }
}
```

```
{
    "event": "trade-history",
    "channel": "market--global",
    "data": [
        {
            "bid_price": "1.53",
            "bid_type": "SELL",
            "complete_qty": "30",
            "success_time: `2020-05-13 17:04:31`
        },
    ]
}
```

```
{
    "event": "price-change",
    "channel": "crypto-rates",
    "data": {
        "current_price": "1.530000",
        "previous_price": "1.530000",
    }
}
```

```
{
    "event": "exchange-cancel-order",
    "channel": "private-",
    "data": {
        "isSuccess": true,
        "message": "Request cancelled successfully."
    }
}
```

Error Response payload

message will have one of \[ "You are not allow to cancel this order.", "Could not cancelled the order" \]

```
{
    "event": "exchange-cancel-order",
    "channel": "private-",
    "data": {
        "isSuccess": false,
        "message": "You are not allow to cancel this order."
    }
}
```

Orderbook Events
----------------

[](#orderbook-events)

### Init Orderbook

[](#init-orderbook)

Request Payload

```
{
    "event": "orderbook-init",
    "channel": "market--global",
    "data": {
        "market": "PPT_USDC",
    }
}
```

Response Payload

```
{
    "event": "orderbook-init",
    "channel": "market--global",
    "data": {
        "buy_orders": "ARRAY_OF_BUY_ORDERS",
        "sell_orders": "ARRAY_OF_SELL_ORDERS",
    }
}
```

API settings Events
-------------------

[](#api-settings-events)

### Init API settings

[](#init-api-settings)

Request Payload

```
{
    "event": "api-setting-init",
    "channel": "private-",
    "data": {
        "ua": "USER_AUTH",
    }
}
```

Response Payload

```
{
    "event": "api-setting-init",
    "channel": "private-",
    "data": {
        "status": true,
        "all_keys": [],
    }
}
```

### Create API

[](#create-api)

Request Payload

```
{
    "event": "api-setting-create",
    "channel": "private-",
    "data": {
        "ua": "USER_AUTH",
        "api_name": "API_NAME",
        "ga_token": "GA_TOKEN (if set)",
        "is_ga_required": false,
    }
}
```

Response Payload

```
{
    "event": "api-setting-create",
    "channel": "private-",
    "data": {
        "status": true,
        "message": "API successfully created.",
        "new_key": {},
    }
}
```

### Update API

[](#update-api)

Request Payload

```
{
    "event": "api-setting-update",
    "channel": "private-",
    "data": {
        "ua": "USER_AUTH",
        "api_name": "API_NAME",
        "ga_token": "GA_TOKEN (if set)",
        "is_ga_required": false,
        "id": "API_ID",
        "can_trade": 0,
        "can_withdraw": 1,
        "ip_addresses_text": "",
        "ip_restricted": 0,
        "read_info": 1,
        "status": 0
    }
}
```

Response Payload

```
{
    "event": "api-setting-update",
    "channel": "private-",
    "data": {
        "status": true,
        "message": "API successfully updated.",
    }
}
```

### Delete API

[](#delete-api)

Request Payload

```
{
    "event": "api-setting-delete",
    "channel": "private-",
    "data": {
        "ua": "USER_AUTH",
        "api_id": "API_ID",
        "ga_token": "GA_TOKEN (if set)",
        "is_ga_required": false,
    }
}
```

Response Payload

```
{
    "event": "api-setting-delete",
    "channel": "private-",
    "data": {
        "status": true,
        "message": "API  successfully deleted.",
        "deleted_id": "DELETED_API_ID",
    }
}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Recently: every ~29 days

Total

50

Last Release

1671d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c900ccc8cb44c495c3046fcbd53ce9a897ebf2efce4da3bf3c404b81d5c15abb?d=identicon)[makashtekar](/maintainers/makashtekar)

---

Top Contributors

[![makashtekar](https://avatars.githubusercontent.com/u/3789320?v=4)](https://github.com/makashtekar "makashtekar (97 commits)")[![nico1579](https://avatars.githubusercontent.com/u/23337287?v=4)](https://github.com/nico1579 "nico1579 (62 commits)")[![bluesven869](https://avatars.githubusercontent.com/u/23646985?v=4)](https://github.com/bluesven869 "bluesven869 (26 commits)")[![vhkhb](https://avatars.githubusercontent.com/u/47715249?v=4)](https://github.com/vhkhb "vhkhb (12 commits)")[![agharavadash](https://avatars.githubusercontent.com/u/66325411?v=4)](https://github.com/agharavadash "agharavadash (4 commits)")

---

Tags

websocketpptwsspopulous

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/populous-streamer/health.svg)

```
[![Health](https://phpackages.com/badges/populous-streamer/health.svg)](https://phpackages.com/packages/populous-streamer)
```

###  Alternatives

[cboden/ratchet

PHP WebSocket library

6.4k21.4M239](/packages/cboden-ratchet)[swow/swow

Coroutine-based multi-platform support engine with a focus on concurrent I/O

1.3k2.1M84](/packages/swow-swow)[ratchet/pawl

Asynchronous WebSocket client

6148.9M214](/packages/ratchet-pawl)[ratchet/rfc6455

RFC6455 WebSocket protocol handler

23433.7M69](/packages/ratchet-rfc6455)[wrench/wrench

PHP WebSocket client/server library

5903.1M11](/packages/wrench-wrench)[gos/web-socket-bundle

Symfony Web Socket Bundle

6202.2M8](/packages/gos-web-socket-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
