syntax = "proto3";
package elys.estaking;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "elys/estaking/params.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
import "cosmos_proto/cosmos.proto";

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

// Msg defines the Msg service.
service Msg {
  option (cosmos.msg.v1.service) = true;
  // UpdateParams defines a governance operation for updating the x/distribution
  // module parameters. The authority is defined in the keeper.
  rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);

  // WithdrawReward defines a method to withdraw rewards of delegator from a
  // single validator.
  rpc WithdrawReward(MsgWithdrawReward) returns (MsgWithdrawRewardResponse);

  // WithdrawElysStakingRewards defines a method to withdraw rewards of
  // delegator from all the validators.
  rpc WithdrawElysStakingRewards(MsgWithdrawElysStakingRewards)
      returns (MsgWithdrawElysStakingRewardsResponse);

  // WithdrawAllRewards defines a method to withdraw rewards of delegator from
  // all the validators and Eden/EdenB commitment.
  rpc WithdrawAllRewards(MsgWithdrawAllRewards)
      returns (MsgWithdrawAllRewardsResponse);
}

// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
  option (cosmos.msg.v1.signer) = "authority";
  option (amino.name) = "estaking/MsgUpdateParams";

  string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
  Params params = 2 [ (gogoproto.nullable) = false ];
}

// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
message MsgUpdateParamsResponse {}

// MsgWithdrawReward represents delegation withdrawal to a delegator from a
// single validator.
message MsgWithdrawReward {
  option (cosmos.msg.v1.signer) = "delegator_address";
  option (amino.name) = "estaking/MsgWithdrawReward";
  string delegator_address = 1
      [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
  string validator_address = 2
      [ (cosmos_proto.scalar) = "cosmos.ValidatorAddressString" ];
}

// MsgWithdrawRewardResponse defines the Msg/WithdrawDelegatorReward response
// type.
message MsgWithdrawRewardResponse {
  repeated cosmos.base.v1beta1.Coin amount = 1 [
    (gogoproto.nullable) = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
  ];
}

// MsgWithdrawElysStakingRewards represents delegation withdrawal to a delegator
// from all the validators.
message MsgWithdrawElysStakingRewards {
  option (cosmos.msg.v1.signer) = "delegator_address";
  option (amino.name) = "estaking/MsgWithdrawElysStakingRewards";
  string delegator_address = 1
      [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}

// MsgWithdrawElysStakingRewards defines the Msg/WithdrawElysStakingRewards
// response type.
message MsgWithdrawElysStakingRewardsResponse {
  repeated cosmos.base.v1beta1.Coin amount = 1 [
    (gogoproto.nullable) = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
  ];
}

// MsgWithdrawAllRewards represents delegation withdrawal to a delegator from
// all the validators and Eden/EdenB commitment.
message MsgWithdrawAllRewards {
  option (cosmos.msg.v1.signer) = "delegator_address";
  option (amino.name) = "estaking/MsgWithdrawAllRewards";
  string delegator_address = 1
      [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}

// MsgWithdrawAllRewardsResponse defines the Msg/WithdrawAllRewards response
// type.
message MsgWithdrawAllRewardsResponse {
  repeated cosmos.base.v1beta1.Coin amount = 1 [
    (gogoproto.nullable) = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
  ];
}