public/decode_action
Runs a hex-encoded Action.data payload through the exchange’s own ABI decoder and returns either the decoded fields or the exact reason the bytes were rejected, naming the 32-byte word and the field that broke. Reach for this first when a request fails signature verification (14014): every other route encodes Action.data server-side, so a client whose encoder emits a bad word never sees a decode error - the hashes simply disagree. This is the only route a client’s own bytes reach the decoder. Needs no auth and executes nothing.
curl --request POST \
--url https://api.derive.xyz/v3/public/decode_action \
--header 'Content-Type: application/json' \
--data '
{
"encoded_data": "<string>"
}
'import requests
url = "https://api.derive.xyz/v3/public/decode_action"
payload = { "encoded_data": "<string>" }
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({encoded_data: '<string>'})
};
fetch('https://api.derive.xyz/v3/public/decode_action', 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/public/decode_action",
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([
'encoded_data' => '<string>'
]),
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/public/decode_action"
payload := strings.NewReader("{\n \"encoded_data\": \"<string>\"\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/public/decode_action")
.header("Content-Type", "application/json")
.body("{\n \"encoded_data\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/public/decode_action")
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 \"encoded_data\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"action_type": "order",
"decoded": "<unknown>"
}Body
Which action layout the bytes are meant to be.
order, rfq_maker, rfq_taker, transfer, external_transfer, withdrawal, liquidation, set_session_key, update_whitelisted_recipients, delete_subaccount, vault_deposit, vault_withdraw, vault_cancel, vault_create, vault_mint_shares, vault_burn_shares, vault_force_burn ABI-encoded action data (the Action.data bytes), 0x-prefixed hex. Same value the *_debug routes return as encoded_data.
Response
Success
Echoed back so a batch of probes stays attributable.
order, rfq_maker, rfq_taker, transfer, external_transfer, withdrawal, liquidation, set_session_key, update_whitelisted_recipients, delete_subaccount, vault_deposit, vault_withdraw, vault_cancel, vault_create, vault_mint_shares, vault_burn_shares, vault_force_burn The decoded fields. Decimal values are at the protocol's 1e12 scale — the wire carries 1e18, and the codec rejects anything that does not convert exactly.
curl --request POST \
--url https://api.derive.xyz/v3/public/decode_action \
--header 'Content-Type: application/json' \
--data '
{
"encoded_data": "<string>"
}
'import requests
url = "https://api.derive.xyz/v3/public/decode_action"
payload = { "encoded_data": "<string>" }
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({encoded_data: '<string>'})
};
fetch('https://api.derive.xyz/v3/public/decode_action', 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/public/decode_action",
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([
'encoded_data' => '<string>'
]),
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/public/decode_action"
payload := strings.NewReader("{\n \"encoded_data\": \"<string>\"\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/public/decode_action")
.header("Content-Type", "application/json")
.body("{\n \"encoded_data\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/public/decode_action")
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 \"encoded_data\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"action_type": "order",
"decoded": "<unknown>"
}