Actions25
- Account Actions
- Token/Asset Actions
- Transaction Actions
- Utility Actions
Overview
The node facilitates creating, signing, and optionally broadcasting DecentralChain (DCC) blockchain transactions specifically for the "Set Account Script" operation under the "Transaction" resource. This operation allows users to set or update a script on a blockchain account, which can control account behavior such as smart contract logic or custom validations.
Typical use cases include:
- Deploying or updating smart contract scripts tied to an account.
- Automating blockchain account configuration within workflows.
- Managing account-level logic without manual interaction with blockchain nodes.
For example, a user might want to automate setting a new account script after deploying a smart contract or modify account permissions programmatically.
Properties
| Name | Meaning |
|---|---|
| Base URL | The base URL of the DecentralChain node API to connect to if no credential is supplied. |
| Authentication Method | How the transaction will be signed: Seed Phrase, Private Key, or create an Unsigned transaction. |
| Seed Phrase | Secret seed phrase used to sign the transaction (required if using Seed Phrase authentication). |
| Private Key | Private key used to sign the transaction (required if using Private Key authentication). |
| Sender Public Key | Public key of the sender; required when creating unsigned transactions. |
| Chain ID | Network identifier to create the transaction for: Mainnet (?) or Testnet (!). |
| Auto Broadcast | Whether to automatically broadcast the transaction after signing (only applicable for signed tx). |
Output
The node outputs a JSON object containing:
transaction: The created transaction object including its details such as type, version, proofs, signature presence, and transaction ID.broadcastResult(optional): Result returned from broadcasting the transaction to the network if auto-broadcast is enabled.status: Indicates whether the transaction was just created (created), successfully broadcasted (broadcasted), or if broadcasting failed (broadcast_failed).broadcastError(optional): Error message if broadcasting failed.debug: Contains metadata about the operation, chain ID, authentication method, base URL, timestamps, and transaction details useful for troubleshooting.
No binary data output is produced by this operation.
Dependencies
- Requires the external library
@decentralchain/waves-transactions(or compatible alternative) for transaction creation and signing. - Needs access to a DecentralChain node API endpoint (configurable via Base URL or credentials).
- Requires either a seed phrase or private key credential for signing unless creating unsigned transactions.
- Optional HTTP requests are made to the configured node API for broadcasting transactions.
Troubleshooting
- Library Loading Failure: If the underlying transaction library fails to load, the node falls back to mock functions and logs errors. Ensure the library is installed correctly in the environment.
- Missing Credentials: Errors occur if required signing credentials (seed phrase or private key) are not provided when needed.
- Broadcast Failures: Network issues or invalid transactions may cause broadcasting to fail. The error message and stack trace are included in the output debug info.
- Unsigned Transactions: When creating unsigned transactions, the sender public key must be provided; otherwise, transaction creation will fail.
- Incorrect Chain ID: Using the wrong chain ID may result in rejected transactions on the network.
To resolve common errors:
- Verify credentials and input parameters.
- Confirm the Base URL points to a valid DecentralChain node.
- Check network connectivity.
- Review debug information in the output for detailed error context.
Links and References
- DecentralChain Documentation
- Waves Transactions Library GitHub
- DecentralChain Node API Reference (example URL, adjust accordingly)