Actions36
- Account Actions
- Matcher Actions
- Token/Asset Actions
- Transaction Actions
- Utility Actions
Matcher → Cancel Order (by Pair)
AI-generatedOverview
This node interacts with the DecentralChain (DCC) Matcher API to manage trading orders on the DCC decentralized exchange. Specifically, the Cancel Order (by Pair) operation allows users to cancel a specific order or all orders within a trading pair on the matcher.
Typical use cases include:
- Canceling an individual open order by specifying its order ID.
- Canceling all active orders for a given asset pair owned by a particular sender.
- Using signed JSON payloads for cancellation when signature-based authentication is required by the matcher.
Practical examples:
- A trader wants to cancel a single limit order they placed for trading DCC against another token.
- A user decides to cancel all their open orders in the DCC/DCC trading pair to adjust their strategy.
- An automated system cancels orders by sending pre-signed JSON cancellation requests to comply with matcher security requirements.
Properties
| Name | Meaning |
|---|---|
| Base URL | Base URL of the DCC node API used if no credential is supplied. |
| Matcher Base URL | Base URL for the Matcher API; used if no matcher credential is supplied. |
| Amount Asset | The asset ID or symbol (e.g., "DCC") representing the amount asset in the trading pair. |
| Price Asset | The asset ID or symbol (e.g., "DCC") representing the price asset in the trading pair. |
| Use Raw Cancel JSON | Boolean flag indicating whether to provide a raw JSON cancel body instead of using individual fields. |
| Cancel JSON | Raw signed JSON string for cancellation as required by the matcher (used if "Use Raw Cancel JSON" is true). |
| Sender Address | Address of the owner of the order(s) to be canceled (used if "Use Raw Cancel JSON" is false). |
| Order ID | Specific order ID to cancel; leave empty to cancel all orders in the specified pair (used if "Use Raw Cancel JSON" is false). |
| Timestamp (MS) | Optional timestamp in milliseconds; 0 means auto-generate current timestamp (used if "Use Raw Cancel JSON" is false). |
| Signature | Optional signature string; provide if the matcher requires signature-based cancellation (used if "Use Raw Cancel JSON" is false). |
Output
The node outputs a JSON object containing the response from the matcher API after attempting the cancellation. This includes:
- Confirmation details about the canceled order(s).
- Any error messages returned by the matcher.
- Debug information such as:
- Operation name
- Endpoint URL called
- Matcher base URL
- Request body sent
- Timestamp of the request
Example output structure (simplified):
{
"status": "success",
"message": "Order(s) canceled",
"debug": {
"operation": "cancelOneOrAllInPairOrdersWithSig",
"endpoint": "/matcher/orderbook/{amountAsset}/{priceAsset}/cancel",
"matcherBaseUrl": "https://mainnet-matcher.decentralchain.io",
"timestamp": "2024-06-01T12:00:00.000Z",
"requestBody": {
"sender": "<address>",
"orderId": "<order-id>", // optional
"timestamp": 1685600000000,
"signature": "<signature>" // optional
}
}
}
No binary data output is produced by this operation.
Dependencies
- Requires access to the DecentralChain Matcher API endpoint.
- Optionally requires an API key or token credential for authenticated requests to the matcher.
- Uses standard HTTP methods to communicate with the matcher API.
- No additional external libraries beyond those bundled with the node are required for this operation.
Troubleshooting
Common Issues
- Invalid JSON in Cancel JSON: If "Use Raw Cancel JSON" is enabled and the provided JSON is malformed, the node will throw an error indicating invalid JSON. Ensure the JSON is correctly formatted.
- Missing Required Fields: When not using raw JSON, omitting required fields like
Sender Addressor providing an invalidOrder IDmay cause the cancellation to fail. - Signature Errors: If the matcher requires signature-based cancellation and the signature is missing or incorrect, the cancellation will be rejected.
- Network or Authentication Failures: Incorrect matcher base URL or missing/invalid authorization token can lead to HTTP errors.
Error Messages and Resolutions
- "Invalid JSON in Cancel JSON": Check and correct the JSON syntax in the Cancel JSON field.
- HTTP 401 Unauthorized: Verify that the matcher API token or credentials are correctly configured.
- "Failed to create transaction" or no response: Confirm that all required parameters are set and valid.
- Attachment size errors (not directly related here but common in other operations): Ensure any attachments do not exceed allowed byte limits.
Links and References
- DecentralChain Matcher API Documentation
- DecentralChain Official Website
- n8n Documentation on Creating Custom Nodes
- Base58 Encoding Reference
This summary covers the static analysis of the Cancel Order (by Pair) operation within the Matcher resource of the DecentralChain node for n8n.