Cancel Orders by Instrument
curl --request POST \
--url https://api.hotstuff.trade/exchange \
--header 'Content-Type: application/json' \
--data '
{
"action": {
"data": {
"instrumentId": 1,
"expiresAfter": 1769692563352,
"nonce": 1769688963352
},
"type": "cancelByInstrument"
},
"signature": "0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...",
"nonce": 1769688963352
}
'import requests
url = "https://api.hotstuff.trade/exchange"
payload = {
"action": {
"data": {
"instrumentId": 1,
"expiresAfter": 1769692563352,
"nonce": 1769688963352
},
"type": "cancelByInstrument"
},
"signature": "0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...",
"nonce": 1769688963352
}
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: {instrumentId: 1, expiresAfter: 1769692563352, nonce: 1769688963352},
type: 'cancelByInstrument'
},
signature: '0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...',
nonce: 1769688963352
})
};
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' => [
'instrumentId' => 1,
'expiresAfter' => 1769692563352,
'nonce' => 1769688963352
],
'type' => 'cancelByInstrument'
],
'signature' => '0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...',
'nonce' => 1769688963352
]),
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 \"instrumentId\": 1,\n \"expiresAfter\": 1769692563352,\n \"nonce\": 1769688963352\n },\n \"type\": \"cancelByInstrument\"\n },\n \"signature\": \"0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...\",\n \"nonce\": 1769688963352\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 \"instrumentId\": 1,\n \"expiresAfter\": 1769692563352,\n \"nonce\": 1769688963352\n },\n \"type\": \"cancelByInstrument\"\n },\n \"signature\": \"0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...\",\n \"nonce\": 1769688963352\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 \"instrumentId\": 1,\n \"expiresAfter\": 1769692563352,\n \"nonce\": 1769688963352\n },\n \"type\": \"cancelByInstrument\"\n },\n \"signature\": \"0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...\",\n \"nonce\": 1769688963352\n}"
response = http.request(request)
puts response.read_body{
"tx_hash": "0x7c573d0d802c800a58793bb378b89773f28c2505bcca19f7c20b0ab0e4d66e9e",
"tx_type": 1313,
"error": "",
"data": {
"success": "true",
"orders_cancelled": 5
},
"address": "0x9908658A316D743159F001026F1ef08aa8F0b55B"
}Trading
Cancel Orders by Instrument
Send POST request to /exchange, or use the ExchangeClient SDKs.
POST
https://api.hotstuff.trade
/
exchange
Cancel Orders by Instrument
curl --request POST \
--url https://api.hotstuff.trade/exchange \
--header 'Content-Type: application/json' \
--data '
{
"action": {
"data": {
"instrumentId": 1,
"expiresAfter": 1769692563352,
"nonce": 1769688963352
},
"type": "cancelByInstrument"
},
"signature": "0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...",
"nonce": 1769688963352
}
'import requests
url = "https://api.hotstuff.trade/exchange"
payload = {
"action": {
"data": {
"instrumentId": 1,
"expiresAfter": 1769692563352,
"nonce": 1769688963352
},
"type": "cancelByInstrument"
},
"signature": "0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...",
"nonce": 1769688963352
}
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: {instrumentId: 1, expiresAfter: 1769692563352, nonce: 1769688963352},
type: 'cancelByInstrument'
},
signature: '0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...',
nonce: 1769688963352
})
};
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' => [
'instrumentId' => 1,
'expiresAfter' => 1769692563352,
'nonce' => 1769688963352
],
'type' => 'cancelByInstrument'
],
'signature' => '0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...',
'nonce' => 1769688963352
]),
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 \"instrumentId\": 1,\n \"expiresAfter\": 1769692563352,\n \"nonce\": 1769688963352\n },\n \"type\": \"cancelByInstrument\"\n },\n \"signature\": \"0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...\",\n \"nonce\": 1769688963352\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 \"instrumentId\": 1,\n \"expiresAfter\": 1769692563352,\n \"nonce\": 1769688963352\n },\n \"type\": \"cancelByInstrument\"\n },\n \"signature\": \"0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...\",\n \"nonce\": 1769688963352\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 \"instrumentId\": 1,\n \"expiresAfter\": 1769692563352,\n \"nonce\": 1769688963352\n },\n \"type\": \"cancelByInstrument\"\n },\n \"signature\": \"0xb429a7136360bdc0dc128730c194ca6e718de8ccd2ae2acc8e11c9cdf86acb29...\",\n \"nonce\": 1769688963352\n}"
response = http.request(request)
puts response.read_body{
"tx_hash": "0x7c573d0d802c800a58793bb378b89773f28c2505bcca19f7c20b0ab0e4d66e9e",
"tx_type": 1313,
"error": "",
"data": {
"success": "true",
"orders_cancelled": 5
},
"address": "0x9908658A316D743159F001026F1ef08aa8F0b55B"
}