cancelOrders
The cancelOrders
method sends a JSON‑RPC request to cancel one or more orders. For each order, the node validates the provided signature and order ID. The response is an array of booleans—each element indicates whether the corresponding cancellation request was valid.
Note: A
true
value means the cancellation request is valid and accepted by the node (although full cancellation requires network propagation), while afalse
value indicates the request is invalid.
Parameters
The request accepts an array of objects. Each object should include:
Parameter | Type | Description |
---|---|---|
signature | Object | Contains signature details: |
- y_parity (bool): Parity indicator | ||
- r (U256): Signature component | ||
- s (U256): Signature component | ||
user_address | string | Address of the user initiating the cancellation |
order_id | string | Unique identifier of the order to cancel |
Result
Array<bool>
— Each boolean indicates whether the corresponding cancellation request is valid (true
) or invalid (false
).
Code Sample
curl "NODE_URL" -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 0,
"method": "angstrom_cancelOrders",
"params": [
{
"signature": {
"y_parity": true,
"r": 4232450345324523451,
"s": 234321905834598324753894572,
},
"user_address": "0x39f11b34e4702bcfbce388c919e7d77b45b4df94",
"order_id": "0xdcf4c51c20054616866ad48fb566c12cfb01f24a819a03b7a7c8af7d4dc746c1"
},
{
"signature": {
"y_parity": false,
"r": 423245034532452345123,
"s": 23432190583459832475389457223,
},
"user_address": "0x39f11b34e4702bcfbce388c919e7d77b45b4df94",
"order_id": "0x4444c51c20054616866ad48fb566c12cfb01f24a819a0ac5a7c8af7d4dc746c1"
}
]
}
'
Response
{
"jsonrpc": "2.0",
"id": "0",
"result": [false, false] // False since signature doesn't match order ID in the request above
}