بوابة المطوّرين
النمط

Get Cancel Order Sign Data#

Retrieve the EIP-712 signing data required to cancel an intent order. After receiving the signData, sign it with the order owner's wallet and submit the result to the cancel order endpoint.

Request URL#

POST
https://web3.okx.com/api/v6/dex/aggregator/intent/cancel-signdata

Request Parameters#

ParameterTypeRequiredDescription
userWalletAddressStringYesThe wallet address of the order owner.
orderUidStringYesThe unique order identifier of the intent order to be cancelled.

Response Parameters#

ParameterTypeDescription
signDataObjectEIP-712 structured data that the order owner must sign to authorize the cancellation.
primaryTypeStringThe primary EIP-712 type. Value: CancelOrder.
domainObjectThe EIP-712 domain separator.
nameStringDomain name. Value: OKX Intent Swap.
versionStringDomain version.
chainIdIntegerThe chain ID of the order.
verifyingContractStringThe contract address used to verify the signature.
messageObjectThe cancellation payload to be signed.
orderUidStringThe unique identifier of the order to be cancelled.
typesObjectEIP-712 type definitions used for structured data encoding.
EIP712DomainArrayType definitions for the domain separator fields.
CancelOrderArrayType definitions for the cancellation message fields.

Request Example#

shell
curl --location --request POST 'https://web3.okx.com/api/v6/dex/aggregator/intent/cancel-signdata' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z' \
--header 'Content-Type: application/json' \
--data-raw '{
  "userWalletAddress": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
  "orderUid": "0xfa2506196276f31c6bf7f4a2f02f3bd5ad80ed91354441ce4d5f28c87021e64c5b38da6a701c568545dcfcb03fcb875f56beddc469bbd743"
}'

Response Example#

json
{
    "code": "0",
    "msg": "",
    "data": {
        "signData": {
            "domain": {
                "chainId": 1,
                "name": "OKX Intent Swap",
                "verifyingContract": "0x1111111254fb6c44bac0bed2854e76f90643097d",
                "version": "1"
            },
            "message": {
                "orderUid": "0xfa2506196276f31c6bf7f4a2f02f3bd5ad80ed91354441ce4d5f28c87021e64c5b38da6a701c568545dcfcb03fcb875f56beddc469bbd743"
            },
            "primaryType": "CancelOrder",
            "types": {
                "CancelOrder": [
                    { "name": "orderUid", "type": "bytes" }
                ],
                "EIP712Domain": [
                    { "name": "name", "type": "string" },
                    { "name": "version", "type": "string" },
                    { "name": "chainId", "type": "uint256" },
                    { "name": "verifyingContract", "type": "address" }
                ]
            }
        }
    }
}