JavaScript
import { Wallet, hexlify, randomBytes } from "ethers";
const wallet = new Wallet(process.env.SX_PRIVATE_KEY);
const sportXeventId = "L1233231";
const salt = hexlify(randomBytes(32));
const timestamp = Math.floor(Date.now() / 1000);
const chainId = 4162; // Mainnet — use 79479957 for testnet
const domain = {
name: "CancelOrderEventsSportX",
version: "1.0",
chainId,
salt,
};
const types = {
Details: [
{ name: "sportXeventId", type: "string" },
{ name: "timestamp", type: "uint256" },
],
};
const signature = await wallet.signTypedData(domain, types, { sportXeventId, timestamp });
const apiPayload = {
signature,
sportXeventId,
salt,
maker: wallet.address,
timestamp,
};
const result = await fetch("https://api.sx.bet/orders/cancel/event", { // Mainnet — use https://api.toronto.sx.bet for testnet
method: "POST",
body: JSON.stringify(apiPayload),
headers: { "Content-Type": "application/json" },
});{
"status": "success",
"data": {
"cancelledCount": 1,
"orders": [
{
"orderHash": "0xc4fad4181eac3d72a7d4166df05534edd5479ec7053076244986ec68336ef45",
"pendingFills": [
{
"fillHash": "0xf691c9dfb100d12550c3cb4dad944f15d711eaf22108c6dacc5077a274b3582l",
"pendingFillAmount": "1806995918"
}
]
}
],
"notCancelled": [
{
"orderHash": "0x9b1a4f5e7c0d3b2a6e8f1c4d5e7a9b0c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a",
"reason": "already_pending_cancel"
}
]
}
}Orders
Cancel event orders
Cancel all your open orders for a specific event on SX Bet.
POST
/
orders
/
cancel
/
event
JavaScript
import { Wallet, hexlify, randomBytes } from "ethers";
const wallet = new Wallet(process.env.SX_PRIVATE_KEY);
const sportXeventId = "L1233231";
const salt = hexlify(randomBytes(32));
const timestamp = Math.floor(Date.now() / 1000);
const chainId = 4162; // Mainnet — use 79479957 for testnet
const domain = {
name: "CancelOrderEventsSportX",
version: "1.0",
chainId,
salt,
};
const types = {
Details: [
{ name: "sportXeventId", type: "string" },
{ name: "timestamp", type: "uint256" },
],
};
const signature = await wallet.signTypedData(domain, types, { sportXeventId, timestamp });
const apiPayload = {
signature,
sportXeventId,
salt,
maker: wallet.address,
timestamp,
};
const result = await fetch("https://api.sx.bet/orders/cancel/event", { // Mainnet — use https://api.toronto.sx.bet for testnet
method: "POST",
body: JSON.stringify(apiPayload),
headers: { "Content-Type": "application/json" },
});{
"status": "success",
"data": {
"cancelledCount": 1,
"orders": [
{
"orderHash": "0xc4fad4181eac3d72a7d4166df05534edd5479ec7053076244986ec68336ef45",
"pendingFills": [
{
"fillHash": "0xf691c9dfb100d12550c3cb4dad944f15d711eaf22108c6dacc5077a274b3582l",
"pendingFillAmount": "1806995918"
}
]
}
],
"notCancelled": [
{
"orderHash": "0x9b1a4f5e7c0d3b2a6e8f1c4d5e7a9b0c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a",
"reason": "already_pending_cancel"
}
]
}
}Rate limit: All
POST /orders/* endpoints share a combined limit of 5,500 requests/min. See Rate Limits.Partial success: Orders for this event that were not cancelled are returned in
data.notCancelled with a reason; the remaining orders are cancelled normally.Body
application/json
The event for which orders should be cancelled
Your wallet signature over the cancel payload. See the Order Signing reference for details on how to compute this.
A random 32 bytes hex string to protect against replay
The account from which you are cancelling orders
The current timestamp in UNIX seconds to protect against replay
Last modified on May 11, 2026
⌘I
