syntax = "proto3";
package osmosis.incentives;

import "gogoproto/gogo.proto";
import "amino/amino.proto";
import "google/protobuf/timestamp.proto";
import "cosmos/base/v1beta1/coin.proto";
import "osmosis/incentives/gauge.proto";
import "osmosis/lockup/lock.proto";
import "cosmos/msg/v1/msg.proto";

option go_package = "github.com/osmosis-labs/osmosis/v26/x/incentives/types";

service Msg {
  rpc CreateGauge(MsgCreateGauge) returns (MsgCreateGaugeResponse);
  rpc AddToGauge(MsgAddToGauge) returns (MsgAddToGaugeResponse);
  rpc CreateGroup(MsgCreateGroup) returns (MsgCreateGroupResponse);
}

// MsgCreateGauge creates a gauge to distribute rewards to users
message MsgCreateGauge {
  option (amino.name) = "osmosis/incentives/create-gauge";
  option (cosmos.msg.v1.signer) = "owner";

  // is_perpetual shows if it's a perpetual or non-perpetual gauge
  // Non-perpetual gauges distribute their tokens equally per epoch while the
  // gauge is in the active period. Perpetual gauges distribute all their tokens
  // at a single time and only distribute their tokens again once the gauge is
  // refilled
  bool is_perpetual = 1;
  // owner is the address of gauge creator
  string owner = 2 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
  // distribute_to show which lock the gauge should distribute to by time
  // duration or by timestamp
  osmosis.lockup.QueryCondition distribute_to = 3
      [ (gogoproto.nullable) = false ];
  // coins are coin(s) to be distributed by the gauge
  repeated cosmos.base.v1beta1.Coin coins = 4 [
    (gogoproto.nullable) = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
  ];
  // start_time is the distribution start time
  google.protobuf.Timestamp start_time = 5 [
    (gogoproto.stdtime) = true,
    (gogoproto.nullable) = false,
    (gogoproto.moretags) = "yaml:\"timestamp\""
  ];
  // num_epochs_paid_over is the number of epochs distribution will be completed
  // over
  uint64 num_epochs_paid_over = 6;

  // pool_id is the ID of the pool that the gauge is meant to be associated
  // with. if pool_id is set, then the "QueryCondition.LockQueryType" must be
  // "NoLock" with all other fields of the "QueryCondition.LockQueryType" struct
  // unset, including "QueryCondition.Denom". However, note that, internally,
  // the empty string in "QueryCondition.Denom" ends up being overwritten with
  // incentivestypes.NoLockExternalGaugeDenom(<pool-id>) so that the gauges
  // associated with a pool can be queried by this prefix if needed.
  uint64 pool_id = 7;
}
message MsgCreateGaugeResponse {}

// MsgAddToGauge adds coins to a previously created gauge
message MsgAddToGauge {
  option (amino.name) = "osmosis/incentives/add-to-gauge";
  option (cosmos.msg.v1.signer) = "owner";

  // owner is the gauge owner's address
  string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
  // gauge_id is the ID of gauge that rewards are getting added to
  uint64 gauge_id = 2;
  // rewards are the coin(s) to add to gauge
  repeated cosmos.base.v1beta1.Coin rewards = 3 [
    (gogoproto.nullable) = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
  ];
}
message MsgAddToGaugeResponse {}

// MsgCreateGroup creates a group to distribute rewards to a group of pools
message MsgCreateGroup {
  option (amino.name) = "osmosis/incentives/create-group";
  option (cosmos.msg.v1.signer) = "owner";

  // coins are the provided coins that the group will distribute
  repeated cosmos.base.v1beta1.Coin coins = 1 [
    (gogoproto.nullable) = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
  ];
  // num_epochs_paid_over is the number of epochs distribution will be completed
  // in. 0 means it's perpetual
  uint64 num_epochs_paid_over = 2;
  // owner is the group owner's address
  string owner = 3 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
  // pool_ids are the IDs of pools that the group is comprised of
  repeated uint64 pool_ids = 4;
}
message MsgCreateGroupResponse {
  // group_id is the ID of the group that is created from this msg
  uint64 group_id = 1;
}