Enable Order Status Streaming
stream::order_status::enable
Using this method, you can enable the order status stream.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| client_id | integer | ✓ | This ID can be used to access data (e.g. via http://localhost:7783/event-stream?id=1) |
Response Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| streamer_id | string | – | An identifier for the data stream. This can be used later to disable streaming for the event with stream::disable. |
📌 Examples
{
"userpass": "RPC_UserP@SSW0RD",
"method": "stream::order_status::enable",
"mmrpc": "2.0",
"params": {
"client_id": 1
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "stream::order_status::enable",
"mmrpc": "2.0",
"params": {
"client_id": 1
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "stream::order_status::enable",
"mmrpc": "2.0",
"params": {
"client_id": 1
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "stream::order_status::enable",
"mmrpc": "2.0",
"params": {
"client_id": 1
}
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"userpass": "RPC_UserP@SSW0RD",
"method": "stream::order_status::enable",
"mmrpc": "2.0",
"params": {
"client_id": 1
}
}
JSON;
$ch = curl_init("http://127.0.0.1:7783");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response; package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{"userpass":"RPC_UserP@SSW0RD","method":"stream::order_status::enable","mmrpc":"2.0","params":{"client_id":1}}`)
resp, err := http.Post("http://127.0.0.1:7783", "application/json", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
} require 'net/http'
require 'json'
require 'uri'
uri = URI("http://127.0.0.1:7783")
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "stream::order_status::enable",
"mmrpc": "2.0",
"params": {
"client_id": 1
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
{
"mmrpc": "2.0",
"result": {
"streamer_id": "ORDER_STATUS"
},
"id": null
} Here is an example of the stream data you should be able to see in http://localhost:7783/event-stream?id=1 for each order status event:
data: {"_type":"ORDER_STATUS","message":{"order_type":"TakerMatch","order_data":{"reserved":{"base":"DOC","rel":"MARTY","base_amount":[[1,[12]],[1,[5]]],"rel_amount":[[1,[12]],[1,[5]]],"taker_order_uuid":"4bfe3af7-dd62-4dbe-9c16-68697c4aa24d","maker_order_uuid":"3842068d-d8ca-4dc3-85d7-7fb2b6f4b691","sender_pubkey":"15d9c51c657ab1be4ae9d3ab6e76a619d3bccfe830d5363fa168424c0d044732","dest_pub_key":"0000000000000000000000000000000000000000000000000000000000000000","conf_settings":{"base_confs":1,"base_nota":false,"rel_confs":1,"rel_nota":false},"base_protocol_info":[145,168,115,116,97,110,100,97,114,100],"rel_protocol_info":[145,168,115,116,97,110,100,97,114,100]},"connect":{"taker_order_uuid":"4bfe3af7-dd62-4dbe-9c16-68697c4aa24d","maker_order_uuid":"3842068d-d8ca-4dc3-85d7-7fb2b6f4b691","sender_pubkey":"71792f7a6846a0da28f3422501927ae103355c02750bc4c4d8430375329a09ac","dest_pub_key":"15d9c51c657ab1be4ae9d3ab6e76a619d3bccfe830d5363fa168424c0d044732"},"connected":null,"last_updated":1746432440044}}}
Error Types
| Parameter | Type | Required | Description |
|---|---|---|---|
| UnknownClient | string | – | No client has an open connection using this client_id |
| ClientAlreadyListening | string | – | The requested events are already being sent to the client_id |
Show Error Responses
Error Response (Unknown Client)
{
"mmrpc": "2.0",
"error": "UnknownClient",
"error_path": "orders",
"error_trace": "orders:29]",
"error_type": "EnableError",
"error_data": "UnknownClient",
"id": null
}Error (Client Already Listening)
{
"mmrpc": "2.0",
"error": "ClientAlreadyListening",
"error_path": "orders",
"error_trace": "orders:29]",
"error_type": "EnableError",
"error_data": "ClientAlreadyListening",
"id": null
}