2022-07-20 22:57:56 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package kava.earn.v1beta1;
|
|
|
|
|
2022-07-28 16:50:59 +00:00
|
|
|
option go_package = "github.com/kava-labs/kava/x/earn/types";
|
|
|
|
option (gogoproto.goproto_getters_all) = false;
|
2022-07-20 22:57:56 +00:00
|
|
|
|
2022-07-28 16:50:59 +00:00
|
|
|
import "cosmos_proto/cosmos.proto";
|
|
|
|
import "cosmos/base/query/v1beta1/pagination.proto";
|
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
2022-07-20 22:57:56 +00:00
|
|
|
import "gogoproto/gogo.proto";
|
|
|
|
import "google/api/annotations.proto";
|
2022-07-20 23:14:43 +00:00
|
|
|
import "kava/earn/v1beta1/params.proto";
|
2022-07-28 16:50:59 +00:00
|
|
|
import "kava/earn/v1beta1/strategy.proto";
|
2022-09-12 16:23:26 +00:00
|
|
|
import "kava/earn/v1beta1/vault.proto";
|
2022-07-20 22:57:56 +00:00
|
|
|
|
|
|
|
// Query defines the gRPC querier service for earn module
|
|
|
|
service Query {
|
|
|
|
// Params queries all parameters of the earn module.
|
|
|
|
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
|
|
|
option (google.api.http).get = "/kava/earn/v1beta1/params";
|
|
|
|
}
|
2022-07-28 16:50:59 +00:00
|
|
|
|
|
|
|
// Vaults queries vaults based on vault denom
|
|
|
|
rpc Vaults(QueryVaultsRequest) returns (QueryVaultsResponse) {
|
|
|
|
option (google.api.http).get = "/kava/earn/v1beta1/vaults/{denom}";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Deposits queries deposit details based on owner address and vault
|
|
|
|
rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) {
|
|
|
|
option (google.api.http).get = "/kava/earn/v1beta1/deposits";
|
|
|
|
}
|
2022-07-20 22:57:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryParamsRequest defines the request type for querying x/earn parameters.
|
2022-07-28 16:50:59 +00:00
|
|
|
message QueryParamsRequest {}
|
2022-07-20 22:57:56 +00:00
|
|
|
|
|
|
|
// QueryParamsResponse defines the response type for querying x/earn parameters.
|
|
|
|
message QueryParamsResponse {
|
|
|
|
// params represents the earn module parameters
|
|
|
|
Params params = 1 [(gogoproto.nullable) = false];
|
|
|
|
}
|
2022-07-28 16:50:59 +00:00
|
|
|
|
|
|
|
// QueryVaultsRequest is the request type for the Query/Vault RPC method.
|
|
|
|
message QueryVaultsRequest {
|
|
|
|
// vault filters vault by denom
|
|
|
|
string denom = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryVaultsResponse is the response type for the Query/Vaults RPC method.
|
|
|
|
message QueryVaultsResponse {
|
|
|
|
// vaults represents the earn module vaults
|
|
|
|
repeated VaultResponse vaults = 1 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
// VaultResponse is the response type for a vault.
|
|
|
|
message VaultResponse {
|
|
|
|
// denom represents the denom of the vault
|
|
|
|
string denom = 1;
|
|
|
|
|
|
|
|
// VaultStrategy is the strategy used for this vault.
|
2022-09-12 16:43:59 +00:00
|
|
|
repeated StrategyType strategies = 2 [(gogoproto.castrepeated) = "StrategyTypes"];
|
2022-07-28 16:50:59 +00:00
|
|
|
|
2022-09-12 16:23:26 +00:00
|
|
|
// TotalShares is the total amount of shares issued to depositors.
|
|
|
|
string total_shares = 3;
|
2022-07-28 16:50:59 +00:00
|
|
|
|
|
|
|
// TotalValue is the total value of denom coins supplied to the vault if the
|
|
|
|
// vault were to be liquidated.
|
|
|
|
string total_value = 4 [
|
|
|
|
(cosmos_proto.scalar) = "cosmos.Int",
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryDepositsRequest is the request type for the Query/Deposits RPC method.
|
|
|
|
message QueryDepositsRequest {
|
|
|
|
// owner optionally filters deposits by owner
|
|
|
|
string owner = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
|
|
|
|
|
|
// denom optionally filters deposits by vault denom
|
|
|
|
string denom = 2;
|
|
|
|
|
|
|
|
// pagination defines an optional pagination for the request.
|
|
|
|
cosmos.base.query.v1beta1.PageRequest pagination = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryDepositsResponse is the response type for the Query/Deposits RPC method.
|
|
|
|
message QueryDepositsResponse {
|
|
|
|
// deposits returns the deposits matching the requested parameters
|
|
|
|
repeated DepositResponse deposits = 1 [(gogoproto.nullable) = false];
|
|
|
|
|
|
|
|
// pagination defines the pagination in the response.
|
|
|
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// DepositResponse defines a deposit query response type.
|
|
|
|
message DepositResponse {
|
|
|
|
// depositor represents the owner of the deposit.
|
|
|
|
string depositor = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
|
|
|
2022-09-12 16:23:26 +00:00
|
|
|
// Shares represent the issued shares from their corresponding vaults.
|
|
|
|
repeated VaultShare shares = 2 [(gogoproto.castrepeated) = "VaultShares", (gogoproto.nullable) = false];
|
2022-07-28 16:50:59 +00:00
|
|
|
|
|
|
|
// Value represents the total accumulated value of denom coins supplied to
|
|
|
|
// vaults. This may be greater than or equal to amount_supplied depending on
|
|
|
|
// the strategy.
|
|
|
|
repeated cosmos.base.v1beta1.Coin value = 3
|
|
|
|
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false];
|
|
|
|
}
|