WAX Smart Contract icon

WAX Smart Contract

Execute actions on WAX smart contracts

Overview

The WAX Smart Contract node allows users to interact with smart contracts deployed on the WAX blockchain. It supports two main operations: executing actions on a smart contract and querying data from smart contract tables.

For the Execute Action operation, this node enables sending custom actions to any specified smart contract by providing the contract name, action name, authorization details, and JSON-formatted action data. This is useful for automating transactions such as token transfers, NFT minting, or invoking other contract-specific functions.

Practical examples include:

  • Transferring tokens using the eosio.token contract.
  • Minting or transferring NFTs via the atomicassets contract.
  • Triggering custom contract actions that require specific authorizations.

Properties

Name Meaning
Contract Name The name of the smart contract to interact with (e.g., eosio.token, atomicassets).
Action Name The specific action within the contract to execute (e.g., transfer, mint).
Action Data JSON object containing the parameters required by the action. Must be valid JSON.
Authorization One or more authorization entries specifying which account(s) authorize the action and their permission levels. Each entry includes:
- Actor: Account name authorizing the action.
- Permission: Level (active, owner, or custom).
- Custom Permission: If custom is selected, specify the permission name here.
API Endpoint URL of the WAX blockchain API endpoint to send the transaction to (default: https://wax.greymass.com).
Memo (Optional) Optional memo string to attach to the transaction.

Output

The node outputs an array of JSON objects, each representing the result of processing one input item. For the Execute Action operation, the output JSON contains:

  • success: Boolean indicating if the action was executed successfully.
  • operation: The operation performed (executeAction).
  • contract: The smart contract name used.
  • action: The action name executed.
  • actionData: The JSON data sent with the action.
  • authorization: Array of authorization objects used in the transaction.
  • memo: The optional memo provided.
  • transaction: Object containing transaction details if available, including:
    • transaction_id: The unique ID of the transaction.
    • processed: Detailed processed transaction information.
  • Alternatively, if the response format varies, a result field with raw response and a note explaining the format may be present.

The node does not output binary data.

Dependencies

  • Requires an API key credential that provides a private key for signing transactions on the WAX blockchain.
  • Uses the eosjs library and its signature provider for interacting with the blockchain.
  • Requires network access to the specified WAX blockchain API endpoint.
  • No additional environment variables are needed beyond the configured credentials.

Troubleshooting

  • Invalid JSON in Action Data: If the Action Data property contains malformed JSON, the node will throw an error indicating invalid JSON. Ensure the JSON is correctly formatted.
  • Invalid Characters in Names: Contract names, actor names, and permissions must follow WAX naming conventions. Invalid characters will cause errors.
  • Authorization Issues: If no authorization is provided, the node defaults to using the account associated with the private key and the active permission. Incorrect or missing authorization can cause transaction failures.
  • Transaction Failures: Errors returned from the blockchain (e.g., insufficient funds, invalid action parameters) will be surfaced. Review the error message and verify the action data and authorizations.
  • API Endpoint Connectivity: Ensure the specified API endpoint is reachable and correct. Network issues or incorrect endpoints will cause request failures.
  • Custom Permissions: When using a custom permission level, ensure the Custom Permission field is set; otherwise, the node will not know which permission to use.

Links and References


If you need details about the "Get Table Data" operation or other resources, please provide the relevant resource or operation name.

Discussion