2

In the Ardor platform, there are different types of transactions. What do each number type represent? Some are asset transfers, send transaction, and voting. Where can I find a list of these types of transactions?

enter image description here

2

Use the getConstants API and check the "transactionSubTypes" JSON array for a mapping of transaction types and sub types to their display name.

"transactionSubTypes": {
    "AssetIssuance": {
        "isPhasable": true,
        "subtype": 0,
        "mustHaveRecipient": false,
        "name": "AssetIssuance",
        "canHaveRecipient": false,
        "isGlobal": true,
        "type": 2,
        "isPhasingSafe": true
0

This is the switch case I used to figure out what each $type is for:

    switch($type) {
      case "-4":
        $type = "Coin Exchange";
        break;
      case "-3":
        $type = "Account Control";
        break;
      case "-2":
        $type = "Payment";
        break;
      case "-1":
        $type = "Child Chain Block";
        break;
      case "0":
        $type = "Payment";
        break;
      case "1":
        $type = "Messaging";
        break;
      case "2":
        $type = "Asset Exchange";
        break;
      case "3":
        $type = "Marketplace";
        break;
      case "4":
        $type = "Account Control";
        break;
      case "5":
        $type = "Monetary System";
        break;
      case "6":
        $type = "Data Cloud";
        break;
      case "7":
        $type = "Suffling";
        break;
      case "8":
        $type = "Aliases";
        break;
      case "9":
        $type = "Voting";
        break;
      case "10":
        $type = "Account Properties";
        break;
      case "11":
        $type = "Coin Exchange";
        break;
      default  :
        $type = "Unknown Type";
     }

enter image description here

  • 1
    This is correct for now but we will probably add new transaction types and subtypes in the future so a better design would be to iterate over the types returned by getConstants and create a hash table or several hash tables depending on your design. You can see how this is implemented in the wallet in nrs.transaction.types.js NRS.loadTransactionTypeConstants() function – lyaffe Jul 13 '18 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.