Cancel Orders by Client Order ID
curl --request POST \
--url https://api.hotstuff.trade/exchange \
--header 'Content-Type: application/json' \
--data '
{
"action": {
"data": {
"cancels": [
{
"cloid": "9c29fda4-79b4-47da-a788-568703333134",
"instrumentId": 1
}
],
"expiresAfter": 1769692246080,
"nonce": 1769688646080
},
"type": "cancelByCloid"
},
"signature": "0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...",
"nonce": 1769688646080
}
'import requests
url = "https://api.hotstuff.trade/exchange"
payload = {
"action": {
"data": {
"cancels": [
{
"cloid": "9c29fda4-79b4-47da-a788-568703333134",
"instrumentId": 1
}
],
"expiresAfter": 1769692246080,
"nonce": 1769688646080
},
"type": "cancelByCloid"
},
"signature": "0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...",
"nonce": 1769688646080
}
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({
action: {
data: {
cancels: [{cloid: '9c29fda4-79b4-47da-a788-568703333134', instrumentId: 1}],
expiresAfter: 1769692246080,
nonce: 1769688646080
},
type: 'cancelByCloid'
},
signature: '0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...',
nonce: 1769688646080
})
};
fetch('https://api.hotstuff.trade/exchange', 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://api.hotstuff.trade/exchange",
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([
'action' => [
'data' => [
'cancels' => [
[
'cloid' => '9c29fda4-79b4-47da-a788-568703333134',
'instrumentId' => 1
]
],
'expiresAfter' => 1769692246080,
'nonce' => 1769688646080
],
'type' => 'cancelByCloid'
],
'signature' => '0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...',
'nonce' => 1769688646080
]),
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://api.hotstuff.trade/exchange"
payload := strings.NewReader("{\n \"action\": {\n \"data\": {\n \"cancels\": [\n {\n \"cloid\": \"9c29fda4-79b4-47da-a788-568703333134\",\n \"instrumentId\": 1\n }\n ],\n \"expiresAfter\": 1769692246080,\n \"nonce\": 1769688646080\n },\n \"type\": \"cancelByCloid\"\n },\n \"signature\": \"0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...\",\n \"nonce\": 1769688646080\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("https://api.hotstuff.trade/exchange")
.header("Content-Type", "application/json")
.body("{\n \"action\": {\n \"data\": {\n \"cancels\": [\n {\n \"cloid\": \"9c29fda4-79b4-47da-a788-568703333134\",\n \"instrumentId\": 1\n }\n ],\n \"expiresAfter\": 1769692246080,\n \"nonce\": 1769688646080\n },\n \"type\": \"cancelByCloid\"\n },\n \"signature\": \"0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...\",\n \"nonce\": 1769688646080\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hotstuff.trade/exchange")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": {\n \"data\": {\n \"cancels\": [\n {\n \"cloid\": \"9c29fda4-79b4-47da-a788-568703333134\",\n \"instrumentId\": 1\n }\n ],\n \"expiresAfter\": 1769692246080,\n \"nonce\": 1769688646080\n },\n \"type\": \"cancelByCloid\"\n },\n \"signature\": \"0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...\",\n \"nonce\": 1769688646080\n}"
response = http.request(request)
puts response.read_body{
"tx_hash": "0x0699b3be577138910ffcf99f2c4471566479da90a0901460b5081b1276031486",
"tx_type": 1303,
"success": true,
"data": {
"status": [
{
"success": {
"success": "true"
}
}
]
},
"address": "0x9b342a0a2809A3806c17Bd0550BB63036dfB2C6A"
}Trading
Cancel Orders by Client Order ID
Send POST request to /exchange, or use the ExchangeClient SDKs.
POST
https://api.hotstuff.trade
/
exchange
Cancel Orders by Client Order ID
curl --request POST \
--url https://api.hotstuff.trade/exchange \
--header 'Content-Type: application/json' \
--data '
{
"action": {
"data": {
"cancels": [
{
"cloid": "9c29fda4-79b4-47da-a788-568703333134",
"instrumentId": 1
}
],
"expiresAfter": 1769692246080,
"nonce": 1769688646080
},
"type": "cancelByCloid"
},
"signature": "0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...",
"nonce": 1769688646080
}
'import requests
url = "https://api.hotstuff.trade/exchange"
payload = {
"action": {
"data": {
"cancels": [
{
"cloid": "9c29fda4-79b4-47da-a788-568703333134",
"instrumentId": 1
}
],
"expiresAfter": 1769692246080,
"nonce": 1769688646080
},
"type": "cancelByCloid"
},
"signature": "0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...",
"nonce": 1769688646080
}
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({
action: {
data: {
cancels: [{cloid: '9c29fda4-79b4-47da-a788-568703333134', instrumentId: 1}],
expiresAfter: 1769692246080,
nonce: 1769688646080
},
type: 'cancelByCloid'
},
signature: '0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...',
nonce: 1769688646080
})
};
fetch('https://api.hotstuff.trade/exchange', 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://api.hotstuff.trade/exchange",
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([
'action' => [
'data' => [
'cancels' => [
[
'cloid' => '9c29fda4-79b4-47da-a788-568703333134',
'instrumentId' => 1
]
],
'expiresAfter' => 1769692246080,
'nonce' => 1769688646080
],
'type' => 'cancelByCloid'
],
'signature' => '0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...',
'nonce' => 1769688646080
]),
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://api.hotstuff.trade/exchange"
payload := strings.NewReader("{\n \"action\": {\n \"data\": {\n \"cancels\": [\n {\n \"cloid\": \"9c29fda4-79b4-47da-a788-568703333134\",\n \"instrumentId\": 1\n }\n ],\n \"expiresAfter\": 1769692246080,\n \"nonce\": 1769688646080\n },\n \"type\": \"cancelByCloid\"\n },\n \"signature\": \"0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...\",\n \"nonce\": 1769688646080\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("https://api.hotstuff.trade/exchange")
.header("Content-Type", "application/json")
.body("{\n \"action\": {\n \"data\": {\n \"cancels\": [\n {\n \"cloid\": \"9c29fda4-79b4-47da-a788-568703333134\",\n \"instrumentId\": 1\n }\n ],\n \"expiresAfter\": 1769692246080,\n \"nonce\": 1769688646080\n },\n \"type\": \"cancelByCloid\"\n },\n \"signature\": \"0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...\",\n \"nonce\": 1769688646080\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hotstuff.trade/exchange")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": {\n \"data\": {\n \"cancels\": [\n {\n \"cloid\": \"9c29fda4-79b4-47da-a788-568703333134\",\n \"instrumentId\": 1\n }\n ],\n \"expiresAfter\": 1769692246080,\n \"nonce\": 1769688646080\n },\n \"type\": \"cancelByCloid\"\n },\n \"signature\": \"0xcb6f241ea57879a6e3cf90de61a78fa0ab9dd856361bd7552acc3e4e8b07017d...\",\n \"nonce\": 1769688646080\n}"
response = http.request(request)
puts response.read_body{
"tx_hash": "0x0699b3be577138910ffcf99f2c4471566479da90a0901460b5081b1276031486",
"tx_type": 1303,
"success": true,
"data": {
"status": [
{
"success": {
"success": "true"
}
}
]
},
"address": "0x9b342a0a2809A3806c17Bd0550BB63036dfB2C6A"
}Batch cancel order(s) by their client order order ids i.e. cloid(s)