cancelOrder
The cancelOrder
method sends a JSON‑RPC request to cancel a specified order on the node. The endpoint verifies the provided signature and order ID, and returns a boolean indicating whether the cancellation request is valid.
Note: A
true
response indicates that the cancellation request is valid and accepted by the node; however, it does not guarantee that the order is fully canceled as the cancellation request must propagate through the network. Afalse
response means that the cancellation request is invalid.
Parameters
Parameter | Type | Description |
---|---|---|
signature | Object | An object containing the signature details, including: |
- y_parity (bool): The parity of the signature. | ||
- r (U256): The r component of the signature. | ||
- s (U256): The s component of the signature. | ||
user_address | string | The address of the user initiating the cancellation request. |
order_id | string | The unique identifier of the order to cancel. |
Result
- bool — Returns
true
if the cancellation request is valid and accepted by the node, orfalse
if the request is invalid.
Code Sample
curl "NODE_URL" -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 0,
"method": "angstrom_cancelOrder",
"params": [
{
"signature": {
"y_parity": true,
"r": 4232450345324523451,
"s": 234321905834598324753894572,
},
"user_address": "0x39f11b34e4702bcfbce388c919e7d77b45b4df94",
"order_id": "0xdcf4c51c20054616866ad48fb566c12cfb01f24a819a03b7a7c8af7d4dc746c1"
}
]
}
'
Response
{
"jsonrpc": "2.0",
"id": "0",
"result": false // False since signature doesn't match order ID in the request above
}