dex

Cancel Order

Generates an unsigned limit-order cancellation message, which must be signed using the Blockdaemon SDK for final on-chain execution. This endpoint provides EIP-712 domain data, type definitions, and a structured message (chain ID, maker address, and order IDs) to securely cancel pending orders on the decentralized exchange.

💡 Compute Unit Value: 15 (Fixed)

post/defi/v1/dex/cancelorder

Request

  • Base URL
    https://svc.blockdaemon.com
  • URL
    https://svc.blockdaemon.com/defi/v1/dex/cancelorder
  • Auth
    API key in header X-API-Key

Request body

dexId'2200' | '2201' | '2202' | '2203' | '2204' | '2205' | '2206'

The unique ID to specify the decentralized exchange (DEX) within a particular blockchain. Find more here.

orderIdstring[] required

An array containing the Order ID(s) of the limit orders to be canceled.

fromstring required

The public address of the user requesting the cancellation.

enableFeeboolean

Flag to include a basis points fee transaction alongside the main transaction when set to true.

Example request

{
  "dexId": "2200",
  "orderId": [
    "95167"
  ],
  "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "enableFee": false
}

Response

Successful response

statusinteger
msgstring
dataobject

Example response

{
  "status": 200,
  "msg": "success",
  "data": {
    "unsignedCancelOrder": {
      "types": {
        "CancelOrder": [
          {
            "name": "chainId",
            "type": "string"
          },
          {
            "name": "maker",
            "type": "address"
          },
          {
            "name": "orderIds",
            "type": "uint64[]"
          }
        ],
        "EIP712Domain": [
          {
            "name": "name",
            "type": "string"
          },
          {
            "name": "version",
            "type": "string"
          },
          {
            "name": "chainId",
            "type": "uint256"
          }
        ]
      },
      "domain": {
        "chainId": "137",
        "name": "Kyber Limit Order Protocol",
        "version": "1"
      },
      "primaryType": "CancelOrder",
      "message": {
        "chainId": "137",
        "maker": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
        "orderIds": [
          95167
        ]
      }
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.