syntax = "proto3";

import "blockchain.proto";

enum BlockTag {
    Latest = 0;
    Earliest = 1;
}

message Call {
    bytes from = 1;
    bytes to = 2;
    bytes data = 3;
    string height = 4;
}

message StateProof {
    bytes address = 1;
    bytes position = 2;
    string height = 3;
}

message Request {
    bytes request_id = 1;
    oneof req {
        bool block_number = 2;
        string block_by_hash = 3;
        string block_by_height = 4;
        bytes transaction = 5;
        uint64 height = 6;
        bool peercount = 7;
        Call call = 8;
        string filter = 9;
        bytes transaction_receipt = 10;
        string transaction_count = 11;
        string code = 12;
        string abi = 13;
        string new_filter = 14;
        bool new_block_filter = 15;
        uint64 uninstall_filter = 16;
        uint64 filter_changes = 17;
        uint64 filter_logs = 18;
        UnverifiedTransaction un_tx = 19;//交易统一到这里了。划分在请求里面
        BatchRequest batch_req = 20;
        bytes transaction_proof = 21;
        // cita_getMetaData
        string meta_data = 22;
        // eth_getBalance
        string balance = 23;
        StateProof state_proof = 24;
        string block_header_height = 25;
    }
}

message BatchRequest {
    repeated Request new_tx_requests = 1;
}
