curl --request POST \
--url https://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel \
--header 'Content-Type: application/json' \
--data '
{
"entityId": "<string>"
}
'import requests
url = "https://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel"
payload = { "entityId": "<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({entityId: '<string>'})
};
fetch('https://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel', 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://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel",
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([
'entityId' => '<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://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel"
payload := strings.NewReader("{\n \"entityId\": \"<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://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel")
.header("Content-Type", "application/json")
.body("{\n \"entityId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel")
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 \"entityId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"intent": "CancelOffchainOrder",
"domain": {
"name": "AvantisTrading",
"version": "1",
"chainId": 123,
"verifyingContract": "0x0000000000000000000000000000000000000000"
},
"primaryType": "CancelOffchainOrder",
"types": {},
"message": {
"entityId": "<string>"
},
"digest": "<string>",
"encodedIntent": "<string>"
}
}{
"ok": false,
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"details": "<unknown>"
}
}Build a signable cancel for a stored partial TP/SL
Builds the EIP-712 CancelOffchainOrder payload over a stored order’s entityId (returned when the partial TP/SL was created; re-minted on every update). Sign it and send DELETE /price-triggers with to the core API — entityIds are public, so the signature is the proof of ownership. Verified off-chain (trader or an active delegate); nothing is submitted on-chain. Global-trigger ids (global-tp-/global-sl-) are not cancellable this way — change the position’s TP/SL via /tpsl-update instead.
curl --request POST \
--url https://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel \
--header 'Content-Type: application/json' \
--data '
{
"entityId": "<string>"
}
'import requests
url = "https://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel"
payload = { "entityId": "<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({entityId: '<string>'})
};
fetch('https://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel', 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://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel",
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([
'entityId' => '<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://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel"
payload := strings.NewReader("{\n \"entityId\": \"<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://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel")
.header("Content-Type", "application/json")
.body("{\n \"entityId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tx-builder-testnet.avantisfi.com/v2/intents/offchain-cancel")
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 \"entityId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"intent": "CancelOffchainOrder",
"domain": {
"name": "AvantisTrading",
"version": "1",
"chainId": 123,
"verifyingContract": "0x0000000000000000000000000000000000000000"
},
"primaryType": "CancelOffchainOrder",
"types": {},
"message": {
"entityId": "<string>"
},
"digest": "<string>",
"encodedIntent": "<string>"
}
}{
"ok": false,
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"details": "<unknown>"
}
}Body
The stored order id the cancel is scoped to (a partial trigger entityId).
1Response
Success envelope: ok is true and data carries the payload documented below.
Always true on success.
true A ready-to-sign EIP-712 payload. Sign {domain, types, primaryType, message} with signTypedData (trader or a registered delegate, per signerRule) and hand the 65-byte r||s||v signature to the Avantis service that executes this intent kind.
Show child attributes
Show child attributes