syntax = "proto3";
package neutron.cron;

import "amino/amino.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "neutron/cron/params.proto";
import "neutron/cron/schedule.proto";

// this line is used by starport scaffolding # proto/tx/import

option go_package = "github.com/neutron-org/neutron/v7/x/cron/types";

// Defines the Msg service.
service Msg {
  option (cosmos.msg.v1.service) = true;

  // Adds new schedule.
  rpc AddSchedule(MsgAddSchedule) returns (MsgAddScheduleResponse);
  // Removes schedule.
  rpc RemoveSchedule(MsgRemoveSchedule) returns (MsgRemoveScheduleResponse);
  // Updates the module parameters.
  rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
  // this line is used by starport scaffolding # proto/tx/rpc
}

// The MsgAddSchedule request type.
message MsgAddSchedule {
  option (amino.name) = "cron/MsgAddSchedule";
  option (cosmos.msg.v1.signer) = "authority";

  // The address of the governance account.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // Name of the schedule
  string name = 2;
  // Period in blocks
  uint64 period = 3;
  // Msgs that will be executed every certain number of blocks, specified in the `period` field
  repeated MsgExecuteContract msgs = 4 [(gogoproto.nullable) = false];
  // Stage when messages will be executed
  ExecutionStage execution_stage = 5;
}

// Defines the response structure for executing a MsgAddSchedule message.
message MsgAddScheduleResponse {}

// The MsgRemoveSchedule request type.
message MsgRemoveSchedule {
  option (amino.name) = "cron/MsgRemoveSchedule";
  option (cosmos.msg.v1.signer) = "authority";

  // The address of the governance account.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // Name of the schedule
  string name = 2;
}

// Defines the response structure for executing a MsgRemoveSchedule message.
message MsgRemoveScheduleResponse {}

// this line is used by starport scaffolding # proto/tx/message

// The MsgUpdateParams request type.
//
// Since: 0.47
message MsgUpdateParams {
  option (amino.name) = "cron/MsgUpdateParams";
  option (cosmos.msg.v1.signer) = "authority";

  // The address of the governance account.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

  // Defines the x/cron parameters to update.
  //
  // NOTE: All parameters must be supplied.
  Params params = 2 [
    (gogoproto.nullable) = false,
    (amino.dont_omitempty) = true
  ];
}

// Defines the response structure for executing a MsgUpdateParams message.
//
// Since: 0.47
message MsgUpdateParamsResponse {}
