mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
d5dcfe73b2
* start makefile refactor to smaller units; break out proto-dep updating; add check-proto-deps target for use in CI in order to determine if depdencies have diverged * add proto check workflow * download go modules before checking proto deps * clean up -- hide output and add error message for check target * add error message for check-rsync * update any type, and ibc-go protos for v3.4.0 * add buf generate files for gogo, docs, and swagger * update swagger dirs and run with latest swagger gen * ignore new build directories * refactor proto makefile logic -- use buf instead of scripts * remove old protobuf scripts * run all proto checks on push * remove moved file * set default value for protoc machine * install build deps seperately * fetch master for buf check breaking * checkout from https url in CI for buf breaking * fix rsync file permissions on darwin * ignore build dirs * fix issue with apple provided make; clean up build deps; switch to buf format * remove clang format file -- using buf format now * run make proto-format (buf format changes) * update generated files for proto format changes
147 lines
4.8 KiB
Protocol Buffer
147 lines
4.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
package kava.hard.v1beta1;
|
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
|
import "cosmos_proto/cosmos.proto";
|
|
import "gogoproto/gogo.proto";
|
|
|
|
option go_package = "github.com/kava-labs/kava/x/hard/types";
|
|
option (gogoproto.goproto_getters_all) = false;
|
|
|
|
// Params defines the parameters for the hard module.
|
|
message Params {
|
|
repeated MoneyMarket money_markets = 1 [
|
|
(gogoproto.castrepeated) = "MoneyMarkets",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
string minimum_borrow_usd_value = 2 [
|
|
(gogoproto.customname) = "MinimumBorrowUSDValue",
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// MoneyMarket is a money market for an individual asset.
|
|
message MoneyMarket {
|
|
string denom = 1;
|
|
BorrowLimit borrow_limit = 2 [(gogoproto.nullable) = false];
|
|
string spot_market_id = 3 [(gogoproto.customname) = "SpotMarketID"];
|
|
string conversion_factor = 4 [
|
|
(cosmos_proto.scalar) = "cosmos.Int",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
InterestRateModel interest_rate_model = 5 [(gogoproto.nullable) = false];
|
|
string reserve_factor = 6 [
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
string keeper_reward_percentage = 7 [
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// BorrowLimit enforces restrictions on a money market.
|
|
message BorrowLimit {
|
|
bool has_max_limit = 1 [(gogoproto.jsontag) = "has_max_limit"];
|
|
string maximum_limit = 2 [
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
string loan_to_value = 3 [
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// InterestRateModel contains information about an asset's interest rate.
|
|
message InterestRateModel {
|
|
string base_rate_apy = 1 [
|
|
(gogoproto.customname) = "BaseRateAPY",
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
string base_multiplier = 2 [
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
string kink = 3 [
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
string jump_multiplier = 4 [
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// Deposit defines an amount of coins deposited into a hard module account.
|
|
message Deposit {
|
|
string depositor = 1 [
|
|
(cosmos_proto.scalar) = "cosmos.AddressBytes",
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
|
|
];
|
|
repeated cosmos.base.v1beta1.Coin amount = 2 [
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
repeated SupplyInterestFactor index = 3 [
|
|
(gogoproto.castrepeated) = "SupplyInterestFactors",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// Borrow defines an amount of coins borrowed from a hard module account.
|
|
message Borrow {
|
|
string borrower = 1 [
|
|
(cosmos_proto.scalar) = "cosmos.AddressBytes",
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
|
|
];
|
|
repeated cosmos.base.v1beta1.Coin amount = 2 [
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
repeated BorrowInterestFactor index = 3 [
|
|
(gogoproto.castrepeated) = "BorrowInterestFactors",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// SupplyInterestFactor defines an individual borrow interest factor.
|
|
message SupplyInterestFactor {
|
|
string denom = 1;
|
|
string value = 2 [
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// BorrowInterestFactor defines an individual borrow interest factor.
|
|
message BorrowInterestFactor {
|
|
string denom = 1;
|
|
string value = 2 [
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// CoinsProto defines a Protobuf wrapper around a Coins slice
|
|
message CoinsProto {
|
|
repeated cosmos.base.v1beta1.Coin coins = 1 [
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|