curl --request POST \
--url wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot \
--header 'Content-Type: application/json' \
--data '
{
"op": "subscribe",
"channel": "cancelAllOrdersAfterSpot",
"timeout_seconds": 30
}
'import requests
url = "wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot"
payload = {
"op": "subscribe",
"channel": "cancelAllOrdersAfterSpot",
"timeout_seconds": 30
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({op: 'subscribe', channel: 'cancelAllOrdersAfterSpot', timeout_seconds: 30})
};
fetch('wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'op' => 'subscribe',
'channel' => 'cancelAllOrdersAfterSpot',
'timeout_seconds' => 30
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot"
payload := strings.NewReader("{\n \"op\": \"subscribe\",\n \"channel\": \"cancelAllOrdersAfterSpot\",\n \"timeout_seconds\": 30\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot")
.header("Content-Type", "application/json")
.body("{\n \"op\": \"subscribe\",\n \"channel\": \"cancelAllOrdersAfterSpot\",\n \"timeout_seconds\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"op\": \"subscribe\",\n \"channel\": \"cancelAllOrdersAfterSpot\",\n \"timeout_seconds\": 30\n}"
response = http.request(request)
puts response.read_body{
"type": "subscribed",
"channel": "cancelAllOrdersAfterSpot",
"data": {}
}Subscribe: Spot Dead Man's Switch
Subscribe to the cancelAllOrdersAfterSpot channel. Requires authentication (login first).
Required: timeout_seconds (the dead man’s switch duration in seconds).
Send this subscription over the shared /ws connection; /ws/cancelAllOrdersAfterSpot is a documentation route, not a separate socket URL. See the Spot API guide. Cancels all open Spot orders for the account after no client activity for timeout_seconds. Inbound ping refreshes the timer; outbound data does not. Omit markets. A new connection replaces the account timer. The timer remains armed after disconnect; re-arm after reconnect. Set timeout_seconds to 0 or unsubscribe to disarm without canceling existing orders.
curl --request POST \
--url wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot \
--header 'Content-Type: application/json' \
--data '
{
"op": "subscribe",
"channel": "cancelAllOrdersAfterSpot",
"timeout_seconds": 30
}
'import requests
url = "wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot"
payload = {
"op": "subscribe",
"channel": "cancelAllOrdersAfterSpot",
"timeout_seconds": 30
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({op: 'subscribe', channel: 'cancelAllOrdersAfterSpot', timeout_seconds: 30})
};
fetch('wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'op' => 'subscribe',
'channel' => 'cancelAllOrdersAfterSpot',
'timeout_seconds' => 30
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot"
payload := strings.NewReader("{\n \"op\": \"subscribe\",\n \"channel\": \"cancelAllOrdersAfterSpot\",\n \"timeout_seconds\": 30\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot")
.header("Content-Type", "application/json")
.body("{\n \"op\": \"subscribe\",\n \"channel\": \"cancelAllOrdersAfterSpot\",\n \"timeout_seconds\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("wss://api.ondoperps.xyz/ws/cancelAllOrdersAfterSpot")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"op\": \"subscribe\",\n \"channel\": \"cancelAllOrdersAfterSpot\",\n \"timeout_seconds\": 30\n}"
response = http.request(request)
puts response.read_body{
"type": "subscribed",
"channel": "cancelAllOrdersAfterSpot",
"data": {}
}Body
Operation type.
subscribe, unsubscribe "subscribe"
Channel for this subscription.
cancelAllOrdersAfterSpot "cancelAllOrdersAfterSpot"
Required when subscribing. Zero disarms. Omit when unsubscribing.
30