API Reference: cancelAskOrder
Cancels an active sell-side (ask) order on a sovereign BetaChain order book and releases the locked Totem balance back to the seller's account unconfirmed balance.
Endpoint Details
- HTTP Method:
POST - Gateway Path:
/nxt - Content-Type:
application/x-www-form-urlencoded - API Tags:
AE,CREATE_TRANSACTION - Chain Specific: Yes
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
requestType | String | Yes | Must be set to cancelAskOrder. |
order | long | Yes | Unique 64-bit identifier of the ask order to cancel. |
chain | int | Yes | Sovereign BetaChain ID where the order resides. |
secretPhrase | String | Yes | Post-Quantum Cryptography (PQC) passphrase of the account that placed the order. |
feeNQT | long | Conditional | Transaction execution fee in base units (NQT). |
deadline | short | Conditional | Transaction expiration window in minutes (1-1440). |
Example Request
curl -X POST http://localhost:22024/nxt \
-d "requestType=cancelAskOrder" \
-d "chain=2" \
-d "order=88492019481029384" \
-d "secretPhrase=your_pqc_passphrase" \
-d "feeNQT=10000000" \
-d "deadline=60"
Successful Response
{
"signatureHash": "a9f8b7c6...",
"unsignedTransactionBytes": "0100...",
"transactionJSON": {
"sender": "1234567890123456789",
"feeNQT": "10000000",
"type": 2,
"subtype": 3,
"attachment": {
"version.OrderCancellation": 1,
"order": "88492019481029384"
},
"timestamp": 89234102
},
"broadcasted": true,
"transaction": "98123049120394810"
}
Error Codes
| Error Code | Cause / Description |
|---|---|
UNKNOWN_ORDER | Order ID does not exist or does not belong to the requesting sender account. |
INSUFFICIENT_FEE | The specified feeNQT is below the network minimum threshold for order cancellation. |