xo-orderbook-client-rs
// Requires an authenticated client.
let resp = client.cancel_all_orders().await?;
println!("canceled {} orders", resp.canceled.len());
curl --request DELETE \
--url https://orderbooks.xo.market/cancel-all \
--header 'Content-Type: application/json' \
--data '
{
"signature": "0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b",
"signatureType": 3,
"signer": "0xCAFE000000000000000000000000000000000A11"
}
'import requests
url = "https://orderbooks.xo.market/cancel-all"
payload = {
"signature": "0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b",
"signatureType": 3,
"signer": "0xCAFE000000000000000000000000000000000A11"
}
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
signature: '0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b',
signatureType: 3,
signer: '0xCAFE000000000000000000000000000000000A11'
})
};
fetch('https://orderbooks.xo.market/cancel-all', 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 => "https://orderbooks.xo.market/cancel-all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'signature' => '0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b',
'signatureType' => 3,
'signer' => '0xCAFE000000000000000000000000000000000A11'
]),
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 := "https://orderbooks.xo.market/cancel-all"
payload := strings.NewReader("{\n \"signature\": \"0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b\",\n \"signatureType\": 3,\n \"signer\": \"0xCAFE000000000000000000000000000000000A11\"\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://orderbooks.xo.market/cancel-all")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b\",\n \"signatureType\": 3,\n \"signer\": \"0xCAFE000000000000000000000000000000000A11\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://orderbooks.xo.market/cancel-all")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"signature\": \"0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b\",\n \"signatureType\": 3,\n \"signer\": \"0xCAFE000000000000000000000000000000000A11\"\n}"
response = http.request(request)
puts response.read_body{
"canceled": [
"101",
"102",
"103"
],
"notCanceled": {}
}Trade
Cancel all orders
Cancel every order owned by the caller.
DELETE
/
cancel-all
xo-orderbook-client-rs
// Requires an authenticated client.
let resp = client.cancel_all_orders().await?;
println!("canceled {} orders", resp.canceled.len());
curl --request DELETE \
--url https://orderbooks.xo.market/cancel-all \
--header 'Content-Type: application/json' \
--data '
{
"signature": "0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b",
"signatureType": 3,
"signer": "0xCAFE000000000000000000000000000000000A11"
}
'import requests
url = "https://orderbooks.xo.market/cancel-all"
payload = {
"signature": "0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b",
"signatureType": 3,
"signer": "0xCAFE000000000000000000000000000000000A11"
}
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
signature: '0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b',
signatureType: 3,
signer: '0xCAFE000000000000000000000000000000000A11'
})
};
fetch('https://orderbooks.xo.market/cancel-all', 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 => "https://orderbooks.xo.market/cancel-all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'signature' => '0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b',
'signatureType' => 3,
'signer' => '0xCAFE000000000000000000000000000000000A11'
]),
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 := "https://orderbooks.xo.market/cancel-all"
payload := strings.NewReader("{\n \"signature\": \"0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b\",\n \"signatureType\": 3,\n \"signer\": \"0xCAFE000000000000000000000000000000000A11\"\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://orderbooks.xo.market/cancel-all")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b\",\n \"signatureType\": 3,\n \"signer\": \"0xCAFE000000000000000000000000000000000A11\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://orderbooks.xo.market/cancel-all")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"signature\": \"0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b\",\n \"signatureType\": 3,\n \"signer\": \"0xCAFE000000000000000000000000000000000A11\"\n}"
response = http.request(request)
puts response.read_body{
"canceled": [
"101",
"102",
"103"
],
"notCanceled": {}
}Body
application/json
Response
OK
Wire shape uses camelCase (canceled / notCanceled) per the
CLOB SDK contract. American spelling — one l (NOT cancelled).
Shared by DELETE /order, DELETE /orders, DELETE /cancel-all,
DELETE /cancel-market-orders.