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

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

import "gogoproto/gogo.proto";
import "amino/amino.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/v1beta1/coin.proto";

// Vault is used for tracking the status of the vaults.
message Vault {
  option (gogoproto.equal) = true;

  // key is the key of the vault.
  string key = 1;

  // is_active is the status of the vault
  bool is_active = 2;
}

// Lock is used to store lock information of each user on each vault.
message Lock {
  option (gogoproto.equal) = true;

  // staker_address is the owner's address of the staker.
  string staker_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

  // key is the key of the vault that this lock is locked to.
  string key = 2;

  // power is the number of locked power.
  string power = 3 [
    (cosmos_proto.scalar)  = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable)   = false
  ];
}

// Stake is used to store staked coins of an address.
message Stake {
  option (gogoproto.equal) = true;

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

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

// LockResponse is used as response of the query to show the power
// that is locked by the vault for the user.
message LockResponse {
  option (gogoproto.equal) = true;

  // key is the key of the vault that this lock belongs to.
  string key = 1;

  // power is the number of locked power.
  string power = 2 [
    (cosmos_proto.scalar)  = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable)   = false
  ];
}
