private/cancel_all_vault_requests
Submits a signed cancel action that drains all of the caller’s pending deposit and withdraw requests for a given vault and posts the corresponding on-chain operation. Input is the vault subaccount; any subaccount the caller owns may sign. Requires the user-cancel permission.
curl --request POST \
--url https://api.derive.xyz/v3/private/cancel_all_vault_requests \
--header 'Content-Type: application/json' \
--data '
{
"nonce": "<string>",
"signature": "<string>",
"signature_expiry_sec": 1,
"signer": "<string>",
"subaccount_id": 1,
"vault_subaccount_id": 1
}
'import requests
url = "https://api.derive.xyz/v3/private/cancel_all_vault_requests"
payload = {
"nonce": "<string>",
"signature": "<string>",
"signature_expiry_sec": 1,
"signer": "<string>",
"subaccount_id": 1,
"vault_subaccount_id": 1
}
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({
nonce: '<string>',
signature: '<string>',
signature_expiry_sec: 1,
signer: '<string>',
subaccount_id: 1,
vault_subaccount_id: 1
})
};
fetch('https://api.derive.xyz/v3/private/cancel_all_vault_requests', 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.derive.xyz/v3/private/cancel_all_vault_requests",
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([
'nonce' => '<string>',
'signature' => '<string>',
'signature_expiry_sec' => 1,
'signer' => '<string>',
'subaccount_id' => 1,
'vault_subaccount_id' => 1
]),
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.derive.xyz/v3/private/cancel_all_vault_requests"
payload := strings.NewReader("{\n \"nonce\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"subaccount_id\": 1,\n \"vault_subaccount_id\": 1\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.derive.xyz/v3/private/cancel_all_vault_requests")
.header("Content-Type", "application/json")
.body("{\n \"nonce\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"subaccount_id\": 1,\n \"vault_subaccount_id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/private/cancel_all_vault_requests")
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 \"nonce\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"subaccount_id\": 1,\n \"vault_subaccount_id\": 1\n}"
response = http.request(request)
puts response.read_body{
"cancelled_request_ids": [
{
"vault_nonce": "<string>",
"vault_subaccount_id": 1,
"wallet": "<string>"
}
],
"op_uuid": "<string>",
"operation_id": 1
}Body
Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.
0x-prefixed hex of the 65-byte EOA signature.
x >= 020-byte Ethereum address as a 0x-prefixed lowercase hex string.
42^0x[0-9a-fA-F]{40}$The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.
x >= 0x >= 0Response
Success
Returned by cancel_all_vault_requests: identifiers to track the on-chain VaultCancel operation plus the ids of the wallet's pending requests that were cancelled.
curl --request POST \
--url https://api.derive.xyz/v3/private/cancel_all_vault_requests \
--header 'Content-Type: application/json' \
--data '
{
"nonce": "<string>",
"signature": "<string>",
"signature_expiry_sec": 1,
"signer": "<string>",
"subaccount_id": 1,
"vault_subaccount_id": 1
}
'import requests
url = "https://api.derive.xyz/v3/private/cancel_all_vault_requests"
payload = {
"nonce": "<string>",
"signature": "<string>",
"signature_expiry_sec": 1,
"signer": "<string>",
"subaccount_id": 1,
"vault_subaccount_id": 1
}
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({
nonce: '<string>',
signature: '<string>',
signature_expiry_sec: 1,
signer: '<string>',
subaccount_id: 1,
vault_subaccount_id: 1
})
};
fetch('https://api.derive.xyz/v3/private/cancel_all_vault_requests', 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.derive.xyz/v3/private/cancel_all_vault_requests",
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([
'nonce' => '<string>',
'signature' => '<string>',
'signature_expiry_sec' => 1,
'signer' => '<string>',
'subaccount_id' => 1,
'vault_subaccount_id' => 1
]),
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.derive.xyz/v3/private/cancel_all_vault_requests"
payload := strings.NewReader("{\n \"nonce\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"subaccount_id\": 1,\n \"vault_subaccount_id\": 1\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.derive.xyz/v3/private/cancel_all_vault_requests")
.header("Content-Type", "application/json")
.body("{\n \"nonce\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"subaccount_id\": 1,\n \"vault_subaccount_id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/private/cancel_all_vault_requests")
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 \"nonce\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"subaccount_id\": 1,\n \"vault_subaccount_id\": 1\n}"
response = http.request(request)
puts response.read_body{
"cancelled_request_ids": [
{
"vault_nonce": "<string>",
"vault_subaccount_id": 1,
"wallet": "<string>"
}
],
"op_uuid": "<string>",
"operation_id": 1
}