DecentralChain (DCC) icon

DecentralChain (DCC)

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

Overview

The node interacts with the DecentralChain blockchain ecosystem, specifically focusing on the "Matcher" resource's "Get Asset Rates" operation. This operation retrieves the current asset rates from the Matcher API, which is a service that manages trading pairs and order books for assets on the DecentralChain network.

This node is beneficial in scenarios where users or applications need to obtain up-to-date pricing information for various assets traded on the DecentralChain platform. For example, it can be used to:

  • Display current exchange rates of tokens relative to DCC or other assets.
  • Feed real-time asset rate data into trading bots or portfolio trackers.
  • Monitor market conditions before placing orders or executing trades.

Practical example: A user wants to fetch the latest rates for all assets supported by the matcher to display them on a dashboard or to make decisions about token swaps.

Properties

Name Meaning
Base URL The base URL for the main DecentralChain API, used if no credential is supplied.
Matcher Base URL The base URL for the Matcher API, used if no matcher credential is supplied.

These properties configure the endpoints the node will use to query the blockchain and matcher services. The "Matcher Base URL" is specifically relevant for operations under the "matcher" resource, including "Get Asset Rates".

Output

The output JSON contains the response from the Matcher API endpoint /matcher/settings/rates. It includes the current asset rates as provided by the matcher service.

Additionally, the output includes a debug object with metadata such as:

  • The operation name (getAssetRates)
  • The API endpoint called
  • The matcher base URL used
  • A timestamp of when the request was made

Example output structure (simplified):

{
  "rates": {
    "<assetId>": <rate>,
    ...
  },
  "debug": {
    "operation": "getAssetRates",
    "endpoint": "/matcher/settings/rates",
    "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, typically at https://mainnet-matcher.decentralchain.io or a custom matcher base URL.
  • Optionally uses an API authentication token if provided via credentials; otherwise, it performs unauthenticated requests.
  • No internal credential names are exposed; users must supply appropriate API URLs and optionally authentication tokens.
  • Relies on n8n's HTTP Request helper to perform GET requests.

Troubleshooting

  • Common issues:

    • Incorrect or unreachable Matcher Base URL leading to connection errors.
    • Missing or invalid authentication token if the matcher requires authorization.
    • Network timeouts or API rate limits causing request failures.
  • Error messages:

    • "Invalid JSON in Order JSON" — Not applicable here but seen in other matcher operations involving JSON input.
    • HTTP errors returned from the matcher API (e.g., 401 Unauthorized, 404 Not Found) indicate configuration or permission problems.
    • NodeApiError wrapping HTTP or parsing errors; check the debug output for details.
  • Resolutions:

    • Verify the Matcher Base URL is correct and accessible.
    • Provide valid credentials if the matcher API requires authentication.
    • Check network connectivity and retry after some time if rate-limited.

Links and References


This summary focuses exclusively on the "Matcher" resource and its "Get Asset Rates" operation as requested.

Discussion