0g-chain/proto/kava/earn/v1beta1/vault.proto
Derrick Lee 82e2f26e14
Add Earn grpc query service and cli query commands (#1279)
* Add query methods

* Add TotalDeposited rpc query

* All accounts and all denoms query wip

* Add query deposits

* Remove IsDenomSupported strategy method

This is not necessary and is already set in params allowed vaults

* Add Vaults, TotalDeposited queries

* Deposits query tests and fixes

* proto lints

* Add earn swagger docs

* Add cli query cmds

* Update init-new-chain.sh with usdx strategy and funds

* Add denom url query path for vaults

* Return a list of coins for each depositor instead of multiple deposit entries
2022-07-28 09:50:59 -07:00

43 lines
1.6 KiB
Protocol Buffer

syntax = "proto3";
package kava.earn.v1beta1;
option go_package = "github.com/kava-labs/kava/x/earn/types";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "kava/earn/v1beta1/strategy.proto";
// AllowedVault is a vault that is allowed to be created. These can be
// modified via parameter governance.
message AllowedVault {
// Denom is the only supported denomination of the vault for deposits and withdrawals.
string denom = 1;
// VaultStrategy is the strategy used for this vault.
StrategyType vault_strategy = 2;
}
// VaultRecord is the state of a vault and is used to store the state of a
// vault.
message VaultRecord {
// Denom is the only supported denomination of the vault for deposits and
// withdrawals.
string denom = 1;
// TotalSupply is the total supply of the vault, denominated **only** in the
// user deposit/withdrawal denom, must be the same as the Denom field.
cosmos.base.v1beta1.Coin total_supply = 2 [(gogoproto.nullable) = false];
}
// VaultShareRecord defines the vault shares owned by a depositor.
message VaultShareRecord {
// Depositor represents the owner of the shares
bytes depositor = 1 [
(cosmos_proto.scalar) = "cosmos.AddressBytes",
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
];
// AmountSupplied represents the total amount a depositor has supplied to the
// vault. The vault is determined by the coin denom.
repeated cosmos.base.v1beta1.Coin amount_supplied = 2
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false];
}