syntax = "proto3";

package elys.commitment;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "elys/commitment/params.proto";
import "elys/commitment/commitments.proto";
import "amino/amino.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/elys-network/elys/x/commitment/types";

// Query defines the gRPC querier service.
service Query {

  // Parameters queries the parameters of the module.
  rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
    option (google.api.http).get = "/elys-network/elys/commitment/params";
  }

  // Queries a Commitment item.
  rpc ShowCommitments(QueryShowCommitmentsRequest)
      returns (QueryShowCommitmentsResponse) {
    option (google.api.http).get =
        "/elys-network/elys/commitment/show_commitments/{creator}";
  }

  // Queries sum of committed tokens locked and not unlockable
  rpc CommittedTokensLocked(QueryCommittedTokensLockedRequest)
      returns (QueryCommittedTokensLockedResponse) {
    option (google.api.http).get =
        "/elys-network/elys/commitment/committed_tokens_locked/{address}";
  }

  // Queries the total number of commitment items.
  rpc NumberOfCommitments(QueryNumberOfCommitmentsRequest)
      returns (QueryNumberOfCommitmentsResponse) {
    option (google.api.http).get =
        "/elys-network/elys/commitment/number_of_commitments";
  }

  // Queries a list of CommitmentVestingInfo items.
  rpc CommitmentVestingInfo(QueryCommitmentVestingInfoRequest)
      returns (QueryCommitmentVestingInfoResponse) {
    option (google.api.http).get =
        "/elys-network/elys/commitment/commitment_vesting_info/{address}";
  }

  rpc AirDrop(QueryAirDropRequest) returns (QueryAirDropResponse) {
    option (google.api.http).get =
        "/elys-network/elys/commitment/airdrop/{address}";
  }

  rpc TotalAirdropClaimed(QueryTotalAirDropClaimedRequest)
      returns (QueryTotalAirDropClaimedResponse) {
    option (google.api.http).get =
        "/elys-network/elys/commitment/total_airdrop_claimed";
  }

  rpc Kol(QueryKolRequest) returns (QueryKolResponse) {
    option (google.api.http).get =
        "/elys-network/elys/commitment/kol/{address}";
  }

  rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) {
    option (google.api.http).get = "/elys-network/elys/commitment/total_supply";
  }
}
// QueryParamsRequest is request type for the Query/Params RPC method.
message QueryParamsRequest {}

// QueryParamsResponse is response type for the Query/Params RPC method.
message QueryParamsResponse {

  // params holds all the parameters of this module.
  Params params = 1 [ (gogoproto.nullable) = false ];
}

message QueryShowCommitmentsRequest {
  string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}

message QueryShowCommitmentsResponse {
  Commitments commitments = 1
      [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
}

message QueryNumberOfCommitmentsRequest {}

message QueryNumberOfCommitmentsResponse { int64 number = 1; }

message QueryCommittedTokensLockedRequest {
  string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}

message QueryCommittedTokensLockedResponse {
  string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
  repeated cosmos.base.v1beta1.Coin locked_committed = 2 [
    (gogoproto.nullable) = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
  ];
  repeated cosmos.base.v1beta1.Coin total_committed = 3 [
    (gogoproto.nullable) = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
  ];
}

message QueryCommitmentVestingInfoRequest {
  string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}

message QueryCommitmentVestingInfoResponse {
  string total = 1 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  repeated VestingDetails vesting_details = 2
      [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
}

message VestingDetails {
  string id = 1;
  string total_vesting = 2 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  string claimed = 3 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  string vested_so_far = 4 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  int64 remaining_blocks = 5;
}

message QueryAirDropRequest {
  string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}

message QueryAirDropResponse {
  string atom_staking = 1 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  string cadet = 2 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  string nft_holder = 3 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  string governor = 4 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  bool claimed = 5;
}

message QueryTotalAirDropClaimedRequest {}

message QueryTotalAirDropClaimedResponse {
  string total_elys_claimed = 1 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  string total_eden_claimed = 2 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
}

message QueryKolRequest {
  string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}

message QueryKolResponse {
  string elys_amount = 1 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  bool claimed = 2;
  bool refunded = 3;
}

message QueryTotalSupplyRequest {}

message QueryTotalSupplyResponse {
  string total_eden = 1 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  string total_edenb = 2 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  string total_eden_vested = 3 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
}