DecentralChain (DCC) icon

DecentralChain (DCC)

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

Overview

This node operation allows users to cancel an active lease transaction on the DecentralChain (DCC) blockchain. Leasing in DCC involves locking a certain amount of tokens to support network operations and earn rewards. The "Cancel Lease" operation reverses this by cancelling a previously created lease transaction, effectively unlocking the leased tokens.

Common scenarios for this node include:

  • Users who have leased tokens but want to reclaim them before the lease period ends.
  • Automated workflows that manage leasing strategies dynamically based on market or network conditions.
  • Applications that need to programmatically revoke leases as part of broader token management.

Example use case:

  • A user has leased 100 DCC tokens to a node for staking rewards but decides to cancel the lease early. This node can be used to create and optionally broadcast the cancel lease transaction to the blockchain.

Properties

Name Meaning
Base URL The base URL of the DCC node API to send requests to if no credential is supplied.
Authentication Method How the transaction will be signed: using a Seed Phrase, Private Key, or creating unsigned.
Seed Phrase Secret seed phrase used to sign the transaction (required if auth method is Seed Phrase).
Private Key Private key used to sign the transaction (required if auth method is Private Key).
Sender Public Key Public key of the sender; required when creating an unsigned transaction.
Chain ID Network identifier to create the transaction for: Mainnet (?) or Testnet (!).
Auto Broadcast Whether to automatically broadcast the signed transaction after creation (true/false).
Lease ID The unique ID of the lease transaction to cancel (required).

Output

The node outputs a JSON object containing details about the created cancel lease transaction and optionally the broadcast result if auto broadcasting is enabled.

Output fields include:

  • transaction: The constructed cancel lease transaction object with its properties such as id, type, chainId, proofs, and signature presence.
  • broadcastResult (optional): The response from the blockchain node after broadcasting the transaction.
  • status: Indicates whether the transaction was just created or successfully broadcasted.
  • debug: Contains metadata useful for troubleshooting, including operation name, chain ID, authentication method, base URL, transaction ID, timestamp, and broadcast success status.

If broadcasting fails, the output includes:

  • broadcastError: Error message describing why broadcasting failed.
  • Additional debug information about the error.

No binary data is produced by this operation.

Dependencies

  • Requires access to a DecentralChain node API endpoint (Base URL).
  • Needs either a Seed Phrase or Private Key credential for signing transactions unless creating unsigned transactions.
  • Optional: If auto broadcasting is enabled, the node must be able to reach the blockchain node's API to submit the transaction.
  • Uses the @decentralchain/waves-transactions library (or a compatible fallback) for transaction creation and signing.

Troubleshooting

Common Issues

  • Library loading failure: If the underlying transaction library cannot be loaded, the node falls back to mock functions which do not perform real transactions. Ensure the environment has the required dependencies installed.
  • Invalid Lease ID: Providing an incorrect or non-existent lease transaction ID will cause the cancellation to fail.
  • Authentication errors: Using invalid or missing seed phrases/private keys will prevent signing and broadcasting.
  • Broadcast failures: Network issues or node API errors can cause broadcasting to fail.

Error Messages and Resolutions

  • "Attachment is not valid base58": Not applicable here since cancel lease does not use attachments.
  • "Failed to create transaction": Indicates internal failure to build the cancel lease transaction; verify input parameters.
  • "Broadcast error": Includes detailed error message from the node API; check connectivity and credentials.
  • "Invalid JSON in Cancel JSON": Not applicable here since raw JSON cancel bodies are not used in this operation.

To resolve errors:

  • Verify all required inputs, especially the Lease ID.
  • Confirm correct authentication method and credentials.
  • Check network connectivity to the specified Base URL.
  • Review debug output for detailed error context.

Links and References


This summary covers the static analysis of the "Cancel Lease" operation within the DecentralChain node implementation for n8n, focusing on its execute() logic and relevant configuration.

Discussion