curl --request POST \
--url https://api-testnet.context.markets/v2/orders/cancel-replace \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cancel": {
"trader": "0x1111111111111111111111111111111111111111",
"nonce": "0xabc123",
"signature": "0xabc123"
},
"create": {}
}
'{
"cancel": {
"success": true,
"trader": "0x1111111111111111111111111111111111111111",
"nonce": "0xabc123",
"alreadyCancelled": true
},
"create": {
"success": true,
"order": {
"marketId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"trader": "0x1111111111111111111111111111111111111111",
"nonce": "0xabc123",
"side": 0,
"price": "1000000",
"size": "1000000",
"filledSize": "1000000",
"remainingSize": "1000000",
"percentFilled": 123,
"insertedAt": "2023-11-07T05:31:56Z",
"type": "limit",
"status": "open",
"voidedAt": "2023-11-07T05:31:56Z",
"voidReason": "UNFILLED_MARKET_ORDER",
"outcomeIndex": 123
}
}
}curl --request POST \
--url https://api-testnet.context.markets/v2/orders/cancel-replace \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cancel": {
"trader": "0x1111111111111111111111111111111111111111",
"nonce": "0xabc123",
"signature": "0xabc123"
},
"create": {}
}
'{
"cancel": {
"success": true,
"trader": "0x1111111111111111111111111111111111111111",
"nonce": "0xabc123",
"alreadyCancelled": true
},
"create": {
"success": true,
"order": {
"marketId": "0x1111111111111111111111111111111111111111111111111111111111111111",
"trader": "0x1111111111111111111111111111111111111111",
"nonce": "0xabc123",
"side": 0,
"price": "1000000",
"size": "1000000",
"filledSize": "1000000",
"remainingSize": "1000000",
"percentFilled": 123,
"insertedAt": "2023-11-07T05:31:56Z",
"type": "limit",
"status": "open",
"voidedAt": "2023-11-07T05:31:56Z",
"voidReason": "UNFILLED_MARKET_ORDER",
"outcomeIndex": 123
}
}
}Public API key passed as Bearer token