DecentralChain (DCC) icon

DecentralChain (DCC)

Create, sign and broadcast DecentralChain transactions, plus query blockchain data

Overview

This node interacts with the DecentralChain (DCC) blockchain ecosystem, specifically focusing on the Matcher resource for managing and querying order books and market status. The Get Order Book Status operation retrieves the current trading market status for a specified asset pair from the Matcher API.

Typical use cases include:

  • Monitoring the trading status of a specific asset pair to determine if the market is open or closed.
  • Integrating real-time market status checks into automated trading workflows.
  • Building dashboards or alerts based on the availability or health of trading pairs on the DCC Matcher.

For example, a trader might use this node to check whether the order book for the DCC/DCC token pair is active before placing new orders.

Properties

Name Meaning
Base URL Base URL for the main 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 side of the trading pair.
Price Asset The asset ID or symbol (e.g., "DCC") representing the price side of the trading pair.

These properties are required to specify which market's order book status to retrieve and where to send the request.

Output

The output JSON contains the response from the Matcher API endpoint /matcher/orderbook/{amountAsset}/{priceAsset}/status. This typically includes fields describing the current market status for the specified asset pair, such as whether the market is open, any restrictions, or other metadata provided by the Matcher service.

Additionally, the output includes a debug object with metadata about the operation, including:

  • Operation name (getOrderBookStatus)
  • Endpoint path used
  • The asset pair queried (amountAsset and priceAsset)
  • Matcher base URL used
  • Timestamp of the request

Example output structure (simplified):

{
  "marketStatusField1": "...",
  "marketStatusField2": "...",
  "debug": {
    "operation": "getOrderBookStatus",
    "endpoint": "/matcher/orderbook/{amountAsset}/{priceAsset}/status",
    "amountAsset": "DCC",
    "priceAsset": "someAssetId",
    "matcherBaseUrl": "https://mainnet-matcher.decentralchain.io",
    "timestamp": "2024-06-01T12:00:00.000Z"
  }
}

No binary data output is involved in this operation.

Dependencies

  • Requires access to the Matcher API endpoint, which may require an API key or token if credentials are configured.
  • Optional credentials can be set up for both the main DCC API and the Matcher API; otherwise, default base URLs are used.
  • The node uses HTTP GET requests to fetch data from the Matcher API.

Troubleshooting

  • Invalid Asset IDs: If the amountAsset or priceAsset IDs are incorrect or not recognized by the Matcher API, the request will fail or return an error. Verify asset IDs are correct.
  • Network Issues: Connectivity problems to the Matcher API base URL will cause request failures. Ensure network access and correct base URL configuration.
  • Authentication Errors: If the Matcher API requires authentication and credentials are missing or invalid, the request will be rejected. Configure appropriate API credentials.
  • Malformed Responses: Unexpected or malformed JSON responses could cause parsing errors. Check the Matcher API status and version compatibility.

Common error messages:

  • "Invalid JSON in Cancel JSON" — Not applicable here but indicates JSON parsing issues in other operations.
  • HTTP errors like 401 Unauthorized or 404 Not Found indicate credential or endpoint issues.

Links and References


This summary focuses exclusively on the Matcher resource and the Get Order Book Status operation as requested.

Discussion