Cancel an order
1
Build a cancel order transaction
To build a cancel order transaction, simply include its order's ID in the path param payload.
For in-depth API details Cancel Order
curl --location --request DELETE 'https://api.deltadefi.io/order/fdcd1b64-504f-4504-8000-61b3306f345b/build' \
--header 'x-api-key: <your_api_key>' \
--data ''const axios = require('axios');
let data = '';
let config = {
method: 'delete',
maxBodyLength: Infinity,
url: 'https://api.deltadefi.io/order/fdcd1b64-504f-4504-8000-61b3306f345b/build',
headers: {
'x-api-key': '<your_api_key>'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
2
Submit a cancel order transaction
With the returned tx_hex from step 1, you will need to sign it before submitting it.
For in-depth API details
curl --location --request DELETE 'https://api.deltadefi.io/order/submit' \
--header 'x-api-key: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"signed_tx": "<your_api_key>"
}'const axios = require('axios');
let data = JSON.stringify({
"signed_tx": "<your_api_key>"
});
let config = {
method: 'delete',
maxBodyLength: Infinity,
url: 'https://api.deltadefi.io/order/submit',
headers: {
'x-api-key': '<your_api_key>',
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Related FAQ
Last updated