Skip to main content
POST
/
v2
/
tokenized_assets
/
order
/
{order_hash}
/
cancel
Python (SDK)
from compass_api_sdk import CompassAPI


with CompassAPI(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:

    res = compass_api.tokenized_assets.tokenized_assets_order_order_hash_cancel(order_hash="<value>", owner="<value>")

    # Handle response
    print(res)
{
  "cancel_safe_tx_eip712": {
    "domain": {
      "chainId": 1,
      "verifyingContract": "0x2ed5C9c14E1F8baA94CD3e9b5b6e3F8e3D27504F"
    },
    "message": {
      "baseGas": "0",
      "data": "0xb1f9f1c9000000000000000000000000000000000000000000000000000000000000000014459af3a06abf6f7a0d3c2c1fa3b64d2e1b8a7c5e3d2b1f0a9876543210596b",
      "gasPrice": "0",
      "gasToken": "0x0000000000000000000000000000000000000000",
      "nonce": "1",
      "operation": 0,
      "refundReceiver": "0x0000000000000000000000000000000000000000",
      "safeTxGas": "0",
      "to": "0x111111125421cA6dc452d289314280a0f8842A65",
      "value": "0"
    },
    "primaryType": "SafeTx",
    "types": {
      "EIP712Domain": [
        {
          "name": "chainId",
          "type": "uint256"
        },
        {
          "name": "verifyingContract",
          "type": "address"
        }
      ],
      "SafeTx": [
        {
          "name": "to",
          "type": "address"
        },
        {
          "name": "value",
          "type": "uint256"
        },
        {
          "name": "data",
          "type": "bytes"
        },
        {
          "name": "operation",
          "type": "uint8"
        },
        {
          "name": "safeTxGas",
          "type": "uint256"
        },
        {
          "name": "baseGas",
          "type": "uint256"
        },
        {
          "name": "gasPrice",
          "type": "uint256"
        },
        {
          "name": "gasToken",
          "type": "address"
        },
        {
          "name": "refundReceiver",
          "type": "address"
        },
        {
          "name": "nonce",
          "type": "uint256"
        }
      ]
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.compasslabs.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Path Parameters

order_hash
string
required

Body

application/json
owner
string
required

EOA that owns the Tokenized Assets Account. The product account predicted from this owner must match the order's on-chain maker; the API rejects otherwise (only the order's maker can cancel it).

Response

Successful Response

cancel_safe_tx_eip712
BatchedSafeOperationsResponse · object
required

EIP-712 Safe.execTransaction wrapping the LOP cancelOrder calldata. Sign with wallet.signTypedData(...) from the Tokenized Assets Account's owner and relay via POST /v2/gas_sponsorship/prepare (or have the owner broadcast execTransaction directly).

Example:
{
"domain": {
"chainId": 8453,
"verifyingContract": "0x6B90E8B4E3E971E74C1A47a3a20976377E2dB4b1"
},
"message": {
"baseGas": "0",
"data": "0x8d80ff0a0000000000000000000000000000000000000000000000000000000000000020",
"gasPrice": "0",
"gasToken": "0x0000000000000000000000000000000000000000",
"nonce": "7",
"operation": 1,
"refundReceiver": "0x0000000000000000000000000000000000000000",
"safeTxGas": "0",
"to": "0x93C23AAE4793C14D6DF35D2A2A2234204e1559dA",
"value": "0"
},
"primaryType": "SafeTx",
"types": {
"EIP712Domain": [
{ "name": "chainId", "type": "uint256" },
{
"name": "verifyingContract",
"type": "address"
}
],
"SafeTx": [
{ "name": "to", "type": "address" },
{ "name": "value", "type": "uint256" },
{ "name": "data", "type": "bytes" },
{ "name": "operation", "type": "uint8" },
{ "name": "safeTxGas", "type": "uint256" },
{ "name": "baseGas", "type": "uint256" },
{ "name": "gasPrice", "type": "uint256" },
{ "name": "gasToken", "type": "address" },
{
"name": "refundReceiver",
"type": "address"
},
{ "name": "nonce", "type": "uint256" }
]
}
}