PHP WebShell

Текущая директория: /opt/BitGoJS/modules/sdk-coin-trx/resources/protobuf

Просмотр файла: tron.proto

syntax = "proto3";

import "google/protobuf/any.proto";
import "Discover.proto";

package protocol;


option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file
option java_outer_classname = "Protocol"; //Specify the class name of the generated Java file
option go_package = "github.com/tronprotocol/grpc-gateway/core";

enum AccountType {
  Normal = 0;
  AssetIssue = 1;
  Contract = 2;
}

// AccountId, (name, address) use name, (null, address) use address, (name, null) use name,
message AccountId {
  bytes name = 1;
  bytes address = 2;
}

// vote message
message Vote {
  // the super rep address
  bytes vote_address = 1;
  // the vote num to this super rep.
  int64 vote_count = 2;
}

// Proposal
message Proposal {
  int64 proposal_id = 1;
  bytes proposer_address = 2;
  map<int64, int64> parameters = 3;
  int64 expiration_time = 4;
  int64 create_time = 5;
  repeated bytes approvals = 6;
  enum State {
    PENDING = 0;
    DISAPPROVED = 1;
    APPROVED = 2;
    CANCELED = 3;
  }
  State state = 7;
}

// Exchange
message Exchange {
  int64 exchange_id = 1;
  bytes creator_address = 2;
  int64 create_time = 3;
  bytes first_token_id = 6;
  int64 first_token_balance = 7;
  bytes second_token_id = 8;
  int64 second_token_balance = 9;
}

message ChainParameters {
  repeated ChainParameter chainParameter = 1;
  message ChainParameter {
    string key = 1;
    int64 value = 2;
  }
}

/* Account */
message Account {
  /* frozen balance */
  message Frozen {
    int64 frozen_balance = 1; // the frozen trx balance
    int64 expire_time = 2; // the expire time
  }
  // account nick name
  bytes account_name = 1;
  AccountType type = 2;
  // the create address
  bytes address = 3;
  // the trx balance
  int64 balance = 4;
  // the votes
  repeated Vote votes = 5;
  // the other asset owned by this account
  map<string, int64> asset = 6;

  // the other asset owned by this account,key is assetId
  map<string, int64> assetV2 = 56;

  // the frozen balance for bandwidth
  repeated Frozen frozen = 7;
  // bandwidth, get from frozen
  int64 net_usage = 8;
  //Frozen balance provided by other accounts to this account
  int64 acquired_delegated_frozen_balance_for_bandwidth = 41;
  //Freeze and provide balances to other accounts
  int64 delegated_frozen_balance_for_bandwidth = 42;

  // this account create time
  int64 create_time = 0x09;
  // this last operation time, including transfer, voting and so on. //FIXME fix grammar
  int64 latest_opration_time = 10;
  // witness block producing allowance
  int64 allowance = 0x0B;
  // last withdraw time
  int64 latest_withdraw_time = 0x0C;
  // not used so far
  bytes code = 13;
  bool is_witness = 14;
  bool is_committee = 15;
  // frozen asset(for asset issuer)
  repeated Frozen frozen_supply = 16;
  // asset_issued_name
  bytes asset_issued_name = 17;
  bytes asset_issued_ID = 57;
  map<string, int64> latest_asset_operation_time = 18;
  map<string, int64> latest_asset_operation_timeV2 = 58;
  int64 free_net_usage = 19;
  map<string, int64> free_asset_net_usage = 20;
  map<string, int64> free_asset_net_usageV2 = 59;
  int64 latest_consume_time = 21;
  int64 latest_consume_free_time = 22;

  // the identity of this account, case insensitive
  bytes account_id = 23;

  message AccountResource {
    // energy resource, get from frozen
    int64 energy_usage = 1;
    // the frozen balance for energy
    Frozen frozen_balance_for_energy = 2;
    int64 latest_consume_time_for_energy = 3;

    //Frozen balance provided by other accounts to this account
    int64 acquired_delegated_frozen_balance_for_energy = 4;
    //Frozen balances provided to other accounts
    int64 delegated_frozen_balance_for_energy = 5;

    // storage resource, get from market
    int64 storage_limit = 6;
    int64 storage_usage = 7;
    int64 latest_exchange_storage_time = 8;

  }
  AccountResource account_resource = 26;
  bytes codeHash = 30;
  Permission owner_permission = 31;
  Permission witness_permission = 32;
  repeated Permission active_permission = 33;
}


message Key {
  bytes address = 1;
  int64 weight = 2;
}

message DelegatedResource {
  bytes from = 1;
  bytes to = 2;
  int64 frozen_balance_for_bandwidth = 3;
  int64 frozen_balance_for_energy = 4;
  int64 expire_time_for_bandwidth = 5;
  int64 expire_time_for_energy = 6;
}

message authority {
  AccountId account = 1;
  bytes permission_name = 2;
}

message Permission {
  enum PermissionType {
    Owner = 0;
    Witness = 1;
    Active = 2;
  }
  PermissionType type = 1;
  int32 id = 2;     //Owner id=0, Witness id=1, Active id start by 2
  string permission_name = 3;
  int64 threshold = 4;
  int32 parent_id = 5;
  bytes operations = 6;   //1 bit 1 contract
  repeated Key keys = 7;
}

// Witness
message Witness {
  bytes address = 1;
  int64 voteCount = 2;
  bytes pubKey = 3;
  string url = 4;
  int64 totalProduced = 5;
  int64 totalMissed = 6;
  int64 latestBlockNum = 7;
  int64 latestSlotNum = 8;
  bool isJobs = 9;
}

// Vote Change
message Votes {
  bytes address = 1;
  repeated Vote old_votes = 2;
  repeated Vote new_votes = 3;
}

// Transcation

message TXOutput {
  int64 value = 1;
  bytes pubKeyHash = 2;
}

message TXInput {
  message raw {
    bytes txID = 1;
    int64 vout = 2;
    bytes pubKey = 3;
  }
  raw raw_data = 1;
  bytes signature = 4;
}

message TXOutputs {
  repeated TXOutput outputs = 1;
}

message ResourceReceipt {
  int64 energy_usage = 1;
  int64 energy_fee = 2;
  int64 origin_energy_usage = 3;
  int64 energy_usage_total = 4;
  int64 net_usage = 5;
  int64 net_fee = 6;
  Transaction.Result.contractResult result = 7;
}

message Transaction {
  message Contract {
    enum ContractType {
      AccountCreateContract = 0;
      TransferContract = 1;
      TransferAssetContract = 2;
      VoteAssetContract = 3;
      VoteWitnessContract = 4;
      WitnessCreateContract = 5;
      AssetIssueContract = 6;
      WitnessUpdateContract = 8;
      ParticipateAssetIssueContract = 9;
      AccountUpdateContract = 10;
      FreezeBalanceContract = 11;
      UnfreezeBalanceContract = 12;
      WithdrawBalanceContract = 13;
      UnfreezeAssetContract = 14;
      UpdateAssetContract = 15;
      ProposalCreateContract = 16;
      ProposalApproveContract = 17;
      ProposalDeleteContract = 18;
      SetAccountIdContract = 19;
      CustomContract = 20;
      // BuyStorageContract = 21;
      // BuyStorageBytesContract = 22;
      // SellStorageContract = 23;
      CreateSmartContract = 30;
      TriggerSmartContract = 31;
      GetContract = 32;
      UpdateSettingContract = 33;
      ExchangeCreateContract = 41;
      ExchangeInjectContract = 42;
      ExchangeWithdrawContract = 43;
      ExchangeTransactionContract = 44;
      UpdateEnergyLimitContract = 45;
      AccountPermissionUpdateContract = 46;
      ClearABIContract = 48;
    }
    ContractType type = 1;
    google.protobuf.Any parameter = 2;
    bytes provider = 3;
    bytes ContractName = 4;
    int32 Permission_id = 5;
  }

  message Result {
    enum code {
      SUCESS = 0;
      FAILED = 1;
    }
    enum contractResult {
      DEFAULT = 0;
      SUCCESS = 1;
      REVERT = 2;
      BAD_JUMP_DESTINATION = 3;
      OUT_OF_MEMORY = 4;
      PRECOMPILED_CONTRACT = 5;
      STACK_TOO_SMALL = 6;
      STACK_TOO_LARGE = 7;
      ILLEGAL_OPERATION = 8;
      STACK_OVERFLOW = 9;
      OUT_OF_ENERGY = 10;
      OUT_OF_TIME = 11;
      JVM_STACK_OVER_FLOW = 12;
      UNKNOWN = 13;
      TRANSFER_FAILED = 14;
    }
    int64 fee = 1;
    code ret = 2;
    contractResult contractRet = 3;

    string assetIssueID = 14;
    int64 withdraw_amount = 15;
    int64 unfreeze_amount = 16;
    int64 exchange_received_amount = 18;
    int64 exchange_inject_another_amount = 19;
    int64 exchange_withdraw_another_amount = 20;
    int64 exchange_id = 21;
  }

  message raw {
    bytes ref_block_bytes = 1;
    int64 ref_block_num = 3;
    bytes ref_block_hash = 4;
    int64 expiration = 8;
    repeated authority auths = 9;
    // data not used
    bytes data = 10;
    //only support size = 1,  repeated list here for extension
    repeated Contract contract = 11;
    // scripts not used
    bytes scripts = 12;
    int64 timestamp = 14;
    int64 fee_limit = 18;
  }

  raw raw_data = 1;
  // only support size = 1,  repeated list here for muti-sig extension
  repeated bytes signature = 2;
  repeated Result ret = 5;
}

message TransactionInfo {
  enum code {
    SUCESS = 0;
    FAILED = 1;
  }
  message Log {
    bytes address = 1;
    repeated bytes topics = 2;
    bytes data = 3;
  }
  bytes id = 1;
  int64 fee = 2;
  int64 blockNumber = 3;
  int64 blockTimeStamp = 4;
  repeated bytes contractResult = 5;
  bytes contract_address = 6;
  ResourceReceipt receipt = 7;
  repeated Log log = 8;
  code result = 9;
  bytes resMessage = 10;

  string assetIssueID = 14;
  int64 withdraw_amount = 15;
  int64 unfreeze_amount = 16;
  repeated InternalTransaction internal_transactions = 17;
  int64 exchange_received_amount = 18;
  int64 exchange_inject_another_amount = 19;
  int64 exchange_withdraw_another_amount = 20;
  int64 exchange_id = 21;
}

message TransactionRet {
  int64 blockNumber = 1;
  int64 blockTimeStamp = 2;
  repeated TransactionInfo transactioninfo = 3;
}

message Transactions {
  repeated Transaction transactions = 1;
}

message TransactionSign {
  Transaction transaction = 1;
  bytes privateKey = 2;
}

message BlockHeader {
  message raw {
    int64 timestamp = 1;
    bytes txTrieRoot = 2;
    bytes parentHash = 3;
    //bytes nonce = 5;
    //bytes difficulty = 6;
    int64 number = 7;
    int64 witness_id = 8;
    bytes witness_address = 9;
    int32 version = 10;
    bytes accountStateRoot = 11;
  }
  raw raw_data = 1;
  bytes witness_signature = 2;
}

// block
message Block {
  repeated Transaction transactions = 1;
  BlockHeader block_header = 2;
}

message ChainInventory {
  message BlockId {
    bytes hash = 1;
    int64 number = 2;
  }
  repeated BlockId ids = 1;
  int64 remain_num = 2;
}

// Inventory
message BlockInventory {
  enum Type {
    SYNC = 0;
    ADVTISE = 1;
    FETCH = 2;
  }

  message BlockId {
    bytes hash = 1;
    int64 number = 2;
  }
  repeated BlockId ids = 1;
  Type type = 2;
}

message Inventory {
  enum InventoryType {
    TRX = 0;
    BLOCK = 1;
  }
  InventoryType type = 1;
  repeated bytes ids = 2;
}

message Items {
  enum ItemType {
    ERR = 0;
    TRX = 1;
    BLOCK = 2;
    BLOCKHEADER = 3;
  }

  ItemType type = 1;
  repeated Block blocks = 2;
  repeated BlockHeader block_headers = 3;
  repeated Transaction transactions = 4;
}

// DynamicProperties
message DynamicProperties {
  int64 last_solidity_block_num = 1;
}

enum ReasonCode {
  REQUESTED = 0x00;
  BAD_PROTOCOL = 0x02;
  TOO_MANY_PEERS = 0x04;
  DUPLICATE_PEER = 0x05;
  INCOMPATIBLE_PROTOCOL = 0x06;
  NULL_IDENTITY = 0x07;
  PEER_QUITING = 0x08;
  UNEXPECTED_IDENTITY = 0x09;
  LOCAL_IDENTITY = 0x0A;
  PING_TIMEOUT = 0x0B;
  USER_REASON = 0x10;
  RESET = 0x11;
  SYNC_FAIL = 0x12;
  FETCH_FAIL = 0x13;
  BAD_TX = 0x14;
  BAD_BLOCK = 0x15;
  FORKED = 0x16;
  UNLINKABLE = 0x17;
  INCOMPATIBLE_VERSION = 0x18;
  INCOMPATIBLE_CHAIN = 0x19;
  TIME_OUT = 0x20;
  CONNECT_FAIL = 0x21;
  TOO_MANY_PEERS_WITH_SAME_IP = 0x22;
  UNKNOWN = 0xFF;
}

message DisconnectMessage {
  ReasonCode reason = 1;
}

message HelloMessage {
  message BlockId {
    bytes hash = 1;
    int64 number = 2;
  }

  Endpoint from = 1;
  int32 version = 2;
  int64 timestamp = 3;
  BlockId genesisBlockId = 4;
  BlockId solidBlockId = 5;
  BlockId headBlockId = 6;
}

message SmartContract {
  message ABI {
    message Entry {
      enum EntryType {
        UnknownEntryType = 0;
        Constructor = 1;
        Function = 2;
        Event = 3;
        Fallback = 4;
      }
      message Param {
        bool indexed = 1;
        string name = 2;
        string type = 3;
        // SolidityType type = 3;
      }
      enum StateMutabilityType {
        UnknownMutabilityType = 0;
        Pure = 1;
        View = 2;
        Nonpayable = 3;
        Payable = 4;
      }

      bool anonymous = 1;
      bool constant = 2;
      string name = 3;
      repeated Param inputs = 4;
      repeated Param outputs = 5;
      EntryType type = 6;
      bool payable = 7;
      StateMutabilityType stateMutability = 8;
    }
    repeated Entry entrys = 1;
  }
  bytes origin_address = 1;
  bytes contract_address = 2;
  ABI abi = 3;
  bytes bytecode = 4;
  int64 call_value = 5;
  int64 consume_user_resource_percent = 6;
  string name = 7;
  int64 origin_energy_limit = 8;
  bytes code_hash = 9;
  bytes trx_hash = 10;
}

message InternalTransaction {
  // internalTransaction identity, the root InternalTransaction hash
  // should equals to root transaction id.
  bytes hash = 1;
  // the one send trx (TBD: or token) via function
  bytes caller_address = 2;
  // the one recieve trx (TBD: or token) via function
  bytes transferTo_address = 3;
  message CallValueInfo {
    // trx (TBD: or token) value
    int64 callValue = 1;
    // TBD: tokenName, trx should be empty
    string tokenId = 2;
  }
  repeated CallValueInfo callValueInfo = 4;
  bytes note = 5;
  bool rejected = 6;
}

message DelegatedResourceAccountIndex {
  bytes account = 1;
  repeated bytes fromAccounts = 2;
  repeated bytes toAccounts = 3;
}

message NodeInfo {
  int64 beginSyncNum = 1;
  string block = 2;
  string solidityBlock = 3;
  //connect information
  int32 currentConnectCount = 4;
  int32 activeConnectCount = 5;
  int32 passiveConnectCount = 6;
  int64 totalFlow = 7;
  repeated PeerInfo peerInfoList = 8;
  ConfigNodeInfo configNodeInfo = 9;
  MachineInfo machineInfo = 10;
  map<string, string> cheatWitnessInfoMap = 11;

  message PeerInfo {
    string lastSyncBlock = 1;
    int64 remainNum = 2;
    int64 lastBlockUpdateTime = 3;
    bool syncFlag = 4;
    int64 headBlockTimeWeBothHave = 5;
    bool needSyncFromPeer = 6;
    bool needSyncFromUs = 7;
    string host = 8;
    int32 port = 9;
    string nodeId = 10;
    int64 connectTime = 11;
    double avgLatency = 12;
    int32 syncToFetchSize = 13;
    int64 syncToFetchSizePeekNum = 14;
    int32 syncBlockRequestedSize = 15;
    int64 unFetchSynNum = 16;
    int32 blockInPorcSize = 17;
    string headBlockWeBothHave = 18;
    bool isActive = 19;
    int32 score = 20;
    int32 nodeCount = 21;
    int64 inFlow = 22;
    int32 disconnectTimes = 23;
    string localDisconnectReason = 24;
    string remoteDisconnectReason = 25;
  }

  message ConfigNodeInfo {
    string codeVersion = 1;
    string p2pVersion = 2;
    int32 listenPort = 3;
    bool discoverEnable = 4;
    int32 activeNodeSize = 5;
    int32 passiveNodeSize = 6;
    int32 sendNodeSize = 7;
    int32 maxConnectCount = 8;
    int32 sameIpMaxConnectCount = 9;
    int32 backupListenPort = 10;
    int32 backupMemberSize = 11;
    int32 backupPriority = 12;
    int32 dbVersion = 13;
    int32 minParticipationRate = 14;
    bool supportConstant = 15;
    double minTimeRatio = 16;
    double maxTimeRatio = 17;
    int64 allowCreationOfContracts = 18;
    int64 allowAdaptiveEnergy = 19;
  }

  message MachineInfo {
    int32 threadCount = 1;
    int32 deadLockThreadCount = 2;
    int32 cpuCount = 3;
    int64 totalMemory = 4;
    int64 freeMemory = 5;
    double cpuRate = 6;
    string javaVersion = 7;
    string osName = 8;
    int64 jvmTotalMemoery = 9;
    int64 jvmFreeMemory = 10;
    double processCpuRate = 11;
    repeated MemoryDescInfo memoryDescInfoList = 12;
    repeated DeadLockThreadInfo deadLockThreadInfoList = 13;

    message MemoryDescInfo {
      string name = 1;
      int64 initSize = 2;
      int64 useSize = 3;
      int64 maxSize = 4;
      double useRate = 5;
    }

    message DeadLockThreadInfo {
      string name = 1;
      string lockName = 2;
      string lockOwner = 3;
      string state = 4;
      int64 blockTime = 5;
      int64 waitTime = 6;
      string stackTrace = 7;
    }
  }
}

Выполнить команду


Для локальной разработки. Не используйте в интернете!