Cancel one or more orders on a Manifest market. Returns a base64-encoded VersionedTransaction for client-side signing.
← Back to Overview
import { Keypair, VersionedTransaction, Connection } from "@solana/web3.js";
const MANIFEST_ORDERS_URL = "https://manifest-orders.fly.dev";
const connection = new Connection("https://api.mainnet-beta.solana.com");
const wallet = Keypair.fromSecretKey(/* your key */);
// 1. Build the cancel transaction
const response = await fetch(${MANIFEST_ORDERS_URL}/v1/orders, {
method: "DELETE",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
maker: wallet.publicKey.toBase58(),
baseMint: "So11111111111111111111111111111111111111112",
quoteMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
orders: [
{ clientOrderId: 1234567 },
],
computeUnitPrice: "auto",
}),
});
const { transaction, cancelled } = await response.json();
console.log("Cancelling orders:", cancelled);
// 2. Deserialize and sign
const tx = VersionedTransaction.deserialize(Buffer.from(transaction, "base64"));
tx.sign([wallet]);
// 3. Send
const sig = await connection.sendRawTransaction(tx.serialize());
console.log("Submitted:", sig);
use solana_client::rpc_client::RpcClient;
use solana_sdk::{
signature::{Keypair, Signer},
transaction::VersionedTransaction,
};
use base64::Engine;
use serde::{Deserialize, Serialize};
#[derive(Serialize)]
struct CancelOrder {
#[serde(rename = "clientOrderId", skip_serializing_if = "Option::is_none")]
client_order_id: Option<u64>,
#[serde(rename = "sequenceNumber", skip_serializing_if = "Option::is_none")]
sequence_number: Option<u64>,
}
#[derive(Serialize)]
struct CancelOrdersRequest {
maker: String,
#[serde(rename = "baseMint")]
base_mint: String,
#[serde(rename = "quoteMint")]
quote_mint: String,
orders: Vec<CancelOrder>,
#[serde(rename = "computeUnitPrice")]
compute_unit_price: String,
}
#[derive(Deserialize)]
struct CancelledOrder {
#[serde(rename = "sequenceNumber")]
sequence_number: u64,
#[serde(rename = "clientOrderId")]
client_order_id: u64,
}
#[derive(Deserialize)]
struct CancelOrdersResponse {
transaction: String,
cancelled: Vec<CancelledOrder>,
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
let rpc = RpcClient::new("https://api.mainnet-beta.solana.com");
let wallet = Keypair::new(); // load your keypair
// 1. Build the cancel transaction
let client = reqwest::blocking::Client::new();
let resp: CancelOrdersResponse = client
.delete("https://manifest-orders.fly.dev/v1/orders")
.json(&CancelOrdersRequest {
maker: wallet.pubkey().to_string(),
base_mint: "So11111111111111111111111111111111111111112".into(),
quote_mint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v".into(),
orders: vec![CancelOrder {
client_order_id: Some(1234567),
sequence_number: None,
}],
compute_unit_price: "auto".into(),
})
.send()?
.json()?;
println!("Cancelling {} orders", resp.cancelled.len());
// 2. Deserialize and sign
let tx_bytes = base64::engine::general_purpose::STANDARD
.decode(&resp.transaction)?;
let mut tx: VersionedTransaction = bincode::deserialize(&tx_bytes)?;
tx.try_sign(&[&wallet], *tx.message.recent_blockhash())?;
// 3. Send
let sig = rpc.send_transaction(&tx)?;
println!("Submitted: {sig}");
Ok(())
}
{
"maker": "YourWalletPubkey...",
"baseMint": "So11111111111111111111111111111111111111112",
"quoteMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"orders": [
{ "clientOrderId": 1234567 }
],
"computeUnitPrice": "auto"
}
| Parameter | Type | Required | Description |
|---|---|---|---|
maker | string | Yes | Base58 public key of the wallet that owns the orders. |
payer | string | No | Base58 public key of the wallet paying for the transaction. Defaults to maker. |
baseMint | string | Yes | Base token mint address. |
quoteMint | string | Yes | Quote token mint address. |
orders | array | Yes | Array of order identifiers to cancel. |
computeUnitPrice | "auto" or number | No | "auto" targets 1000 lamports for transaction priority. A number sets the exact microLamports per CU. Omit to skip. |
Each order in the array must have either clientOrderId or sequenceNumber (or both):
| Field | Type | Description |
|---|---|---|
clientOrderId | number | Cancel by client order ID. Resolved to sequence number via the wrapper. |
sequenceNumber | number | Cancel by exchange-assigned sequence number. |
If both are provided, sequenceNumber takes precedence.
{
"transaction": "AQAAAAAAAAAA...",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"cancelled": [
{
"sequenceNumber": 42100,
"clientOrderId": 1234567
}
]
}
| Field | Type | Description |
|---|---|---|
transaction | string | Base64-encoded VersionedTransaction. Sign with your wallet and submit. Uses Address Lookup Tables when available. |
requestId | string | UUID for tracking this request. |
cancelled | array | Orders that will be cancelled. Each includes both sequenceNumber and clientOrderId. |
warning | string | (Optional) Present when some requested orders were not found. |
{
"error": "orders not found",
"cause": "No open orders found with clientOrderId=9999",
"code": 404
}
| Field | Type | Description |
|---|---|---|
error | string | Short error category. |
cause | string | Detailed error message. |
code | number | HTTP status code. |
maker, baseMint, quoteMint are required and must be valid base58 public keys.orders must be a non-empty array.clientOrderId or sequenceNumber (integers).baseMint/quoteMint pair.# Cancel by client order ID
curl -X DELETE https://manifest-orders.fly.dev/v1/orders \
-H "Content-Type: application/json" \
-d '{
"maker": "YourWalletPubkey...",
"baseMint": "So11111111111111111111111111111111111111112",
"quoteMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"orders": [
{ "clientOrderId": 1234567 }
],
"computeUnitPrice": "auto"
}'
# Cancel by sequence number
curl -X DELETE https://manifest-orders.fly.dev/v1/orders \
-H "Content-Type: application/json" \
-d '{
"maker": "YourWalletPubkey...",
"baseMint": "So11111111111111111111111111111111111111112",
"quoteMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"orders": [
{ "sequenceNumber": 42100 }
],
"computeUnitPrice": "auto"
}'
# Mix both identifier types
curl -X DELETE https://manifest-orders.fly.dev/v1/orders \
-H "Content-Type: application/json" \
-d '{
"maker": "YourWalletPubkey...",
"baseMint": "So11111111111111111111111111111111111111112",
"quoteMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"orders": [
{ "clientOrderId": 1234567 },
{ "sequenceNumber": 42100 }
],
"computeUnitPrice": "auto"
}'