// Copyright (c) 2020 IoTeX
// This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
// warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
// permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache
// License 2.0 that can be found in the LICENSE file.

// To compile the proto, run:
//      protoc --go_out=plugins=grpc:$GOPATH/src *.proto
syntax = "proto3";
package iotextypes;
option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes";
option java_multiple_files = true;
option java_package = "com.github.iotexproject.grpc.types";

import "google/protobuf/timestamp.proto";

// ProbationCandidateList (slashing #1)
message ProbationCandidateList {
  message Info {
    string address = 1;
    uint32 count = 2;
  }
  repeated Info probationList = 1;
  uint32 intensityRate = 2;
}

message VoteBucket {
  uint64 index = 1;
  string candidateAddress = 2;
  string stakedAmount = 3;
  uint32 stakedDuration = 4;
  google.protobuf.Timestamp createTime = 5;
  google.protobuf.Timestamp stakeStartTime = 6;
  google.protobuf.Timestamp unstakeStartTime = 7;
  bool autoStake = 8;
  string owner = 9;
  string contractAddress = 10;
  uint64 stakedDurationBlockNumber = 11;
  uint64 createBlockHeight = 12;
  uint64 stakeStartBlockHeight = 13;
  uint64 unstakeStartBlockHeight = 14;
  uint64 endorsementExpireBlockHeight = 15;
}

message VoteBucketList {
  repeated VoteBucket buckets = 1;
}

message CandidateV2 {
  string ownerAddress = 1;
  string operatorAddress = 2;
  string rewardAddress = 3;
  string name = 4;
  string totalWeightedVotes = 5;
  uint64 selfStakeBucketIdx = 6;
  string selfStakingTokens = 7;
  string id = 8;
  bytes blsPubKey = 9;
}

message CandidateListV2 {
  repeated CandidateV2 candidates = 1;
}

message BucketsCount {
  uint64 total = 1;
  uint64 active = 2;
}

message ContractStakingBucketType {
  string stakedAmount = 1;
  uint32 stakedDuration = 2;
}

message ContractStakingBucketTypeList {
  repeated ContractStakingBucketType bucketTypes = 1;
}
