syntax = "proto3";

package types;
option go_package = "github.com/33cn/chain33/types";

//手续费
message TotalFee {
    int64 fee     = 1;
    int64 txCount = 2;
}

//查询symbol代币总额
message ReqGetTotalCoins {
    string symbol    = 1;
    bytes  stateHash = 2;
    bytes  startKey  = 3;
    int64  count     = 4;
    string execer    = 5;
}

//查询symbol代币总额应答
message ReplyGetTotalCoins {
    int64 count   = 1;
    int64 num     = 2;
    int64 amount  = 3;
    bytes nextKey = 4;
}

//迭代查询symbol代币总额
message IterateRangeByStateHash {
    bytes stateHash = 1;
    bytes start     = 2;
    bytes end       = 3;
    int64 count     = 4;
}

message TotalAmount {
    // 统计的总数
    int64 total = 1;
}

//查询symbol在合约中的代币总额，如果execAddr为空，则为查询symbol在所有合约中的代币总额
message ReqGetExecBalance {
    string symbol    = 1;
    bytes  stateHash = 2;
    bytes  addr      = 3;
    bytes  execAddr  = 4;
    string execer    = 5;
    int64  count     = 6;
    bytes  nextKey   = 7;
}

message ExecBalanceItem {
    bytes execAddr = 1;
    int64 frozen   = 2;
    int64 active   = 3;
}

//查询symbol在合约中的代币总额应答
message ReplyGetExecBalance {
    int64    amount                = 1;
    int64    amountFrozen          = 2;
    int64    amountActive          = 3;
    bytes    nextKey               = 4;
    repeated ExecBalanceItem items = 5;
}
