Ardor

在 Ardor 平台中,交易中的所有不同“類型”和“子類型”是什麼?

  • July 12, 2018

在 Ardor 平台中,有不同類型的交易。每種數字類型代表什麼?有些是資產轉移、發送交易和投票。我在哪裡可以找到這些交易類型的列表?

在此處輸入圖像描述

使用 getConstants API 並檢查“transactionSubTypes”JSON 數組以獲取交易類型和子類型與其顯示名稱的映射。

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

這是我用來確定每個 $type 用途的開關盒:

   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";
    }

在此處輸入圖像描述

引用自:https://bitcoin.stackexchange.com/questions/77104