syntax = "proto3";
package band.restake.v1beta1;

option go_package = "github.com/bandprotocol/chain/v3/x/restake/types";

import "amino/amino.proto";
import "gogoproto/gogo.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/v1beta1/coin.proto";
import "band/restake/v1beta1/genesis.proto";

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

  // Stake defines a method for staking coins into the module.
  rpc Stake(MsgStake) returns (MsgStakeResponse);

  // Unstake defines a method for unstaking coins out of the module.
  rpc Unstake(MsgUnstake) returns (MsgUnstakeResponse);

  // UpdateParams defines a method for updating parameters.
  rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
}

// MsgStake is the request message type for staking coins.
message MsgStake {
  option (cosmos.msg.v1.signer) = "staker_address";
  option (amino.name)           = "restake/MsgStake";

  // staker_address is the address that will stake the coins.
  string staker_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

  // coins is the coins that will be staked.
  repeated cosmos.base.v1beta1.Coin coins = 2 [
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
    (gogoproto.nullable)     = false,
    (amino.dont_omitempty)   = true
  ];
}

// MsgStakeResponse is the response message type for staking coins.
message MsgStakeResponse {}

// MsgUnstake is the request message type for unstaking coins.
message MsgUnstake {
  option (cosmos.msg.v1.signer) = "staker_address";
  option (amino.name)           = "restake/MsgUnstake";

  // staker_address is the address that will unstake the coins.
  string staker_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

  // coins is the coins that will be unstaked.
  repeated cosmos.base.v1beta1.Coin coins = 2 [
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
    (gogoproto.nullable)     = false,
    (amino.dont_omitempty)   = true
  ];
}

// MsgUnstakeResponse is the response message type for unstaking coins.
message MsgUnstakeResponse {}

// MsgUpdateParams is the transaction message to update parameters.
message MsgUpdateParams {
  option (cosmos.msg.v1.signer) = "authority";
  option (amino.name)           = "restake/MsgUpdateParams";

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

  // params is parameters to update.
  Params params = 2 [(gogoproto.nullable) = false];
}

// MsgUpdateParamsResponse is the response type for the Msg/UpdateParams RPC method.
message MsgUpdateParamsResponse {}
