mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-27 08:45:19 +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
209 lines
5.7 KiB
Protocol Buffer
209 lines
5.7 KiB
Protocol Buffer
syntax = "proto3";
|
|
package kava.incentive.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/incentive/types";
|
|
option (gogoproto.goproto_getters_all) = false;
|
|
|
|
// -------------- Base Claim Types, Reward Indexes --------------
|
|
|
|
// BaseClaim is a claim with a single reward coin types
|
|
message BaseClaim {
|
|
bytes owner = 1 [
|
|
(cosmos_proto.scalar) = "cosmos.AddressBytes",
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
|
|
];
|
|
|
|
cosmos.base.v1beta1.Coin reward = 2 [(gogoproto.nullable) = false];
|
|
}
|
|
|
|
// BaseMultiClaim is a claim with multiple reward coin types
|
|
message BaseMultiClaim {
|
|
bytes owner = 1 [
|
|
(cosmos_proto.scalar) = "cosmos.AddressBytes",
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
|
|
];
|
|
|
|
repeated cosmos.base.v1beta1.Coin reward = 2 [
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// RewardIndex stores reward accumulation information
|
|
message RewardIndex {
|
|
string collateral_type = 1;
|
|
|
|
bytes reward_factor = 2 [
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// RewardIndexesProto defines a Protobuf wrapper around a RewardIndexes slice
|
|
message RewardIndexesProto {
|
|
repeated RewardIndex reward_indexes = 1 [
|
|
(gogoproto.castrepeated) = "RewardIndexes",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// TypedRewardIndexes defines a RewardIndexes slice with its corresponding
|
|
// claim and collateral type
|
|
message TypedRewardIndexes {
|
|
ClaimType claim_type = 1;
|
|
string collateral_type = 2;
|
|
repeated RewardIndex reward_indexes = 3 [
|
|
(gogoproto.castrepeated) = "RewardIndexes",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// MultiRewardIndex stores reward accumulation information on multiple reward types
|
|
message MultiRewardIndex {
|
|
string collateral_type = 1;
|
|
|
|
repeated RewardIndex reward_indexes = 2 [
|
|
(gogoproto.castrepeated) = "RewardIndexes",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// MultiRewardIndexesProto defines a Protobuf wrapper around a MultiRewardIndexes slice
|
|
message MultiRewardIndexesProto {
|
|
repeated MultiRewardIndex multi_reward_indexes = 1 [
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// -------------- Custom Claim Types --------------
|
|
|
|
// USDXMintingClaim is for USDX minting rewards
|
|
message USDXMintingClaim {
|
|
BaseClaim base_claim = 1 [
|
|
(gogoproto.embed) = true,
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated RewardIndex reward_indexes = 2 [
|
|
(gogoproto.castrepeated) = "RewardIndexes",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// HardLiquidityProviderClaim stores the hard liquidity provider rewards that can be claimed by owner
|
|
message HardLiquidityProviderClaim {
|
|
BaseMultiClaim base_claim = 1 [
|
|
(gogoproto.embed) = true,
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultiRewardIndex supply_reward_indexes = 2 [
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultiRewardIndex borrow_reward_indexes = 3 [
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// DelegatorClaim stores delegation rewards that can be claimed by owner
|
|
message DelegatorClaim {
|
|
BaseMultiClaim base_claim = 1 [
|
|
(gogoproto.embed) = true,
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultiRewardIndex reward_indexes = 2 [
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// SwapClaim stores the swap rewards that can be claimed by owner
|
|
message SwapClaim {
|
|
BaseMultiClaim base_claim = 1 [
|
|
(gogoproto.embed) = true,
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultiRewardIndex reward_indexes = 2 [
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// SavingsClaim stores the savings rewards that can be claimed by owner
|
|
message SavingsClaim {
|
|
BaseMultiClaim base_claim = 1 [
|
|
(gogoproto.embed) = true,
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultiRewardIndex reward_indexes = 2 [
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// EarnClaim stores the earn rewards that can be claimed by owner
|
|
message EarnClaim {
|
|
BaseMultiClaim base_claim = 1 [
|
|
(gogoproto.embed) = true,
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultiRewardIndex reward_indexes = 2 [
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// ClaimType is the type of claim
|
|
enum ClaimType {
|
|
option (gogoproto.goproto_enum_prefix) = false;
|
|
|
|
// indicates an invalid claim type
|
|
CLAIM_TYPE_UNSPECIFIED = 0;
|
|
// claim type for hard borrow rewards
|
|
CLAIM_TYPE_HARD_BORROW = 1;
|
|
// claim type for hard supply rewards
|
|
CLAIM_TYPE_HARD_SUPPLY = 2;
|
|
// claim type for delegator rewards
|
|
CLAIM_TYPE_DELEGATOR = 3;
|
|
// claim type for earn rewards
|
|
CLAIM_TYPE_EARN = 4;
|
|
// claim type for savings rewards
|
|
CLAIM_TYPE_SAVINGS = 5;
|
|
// claim type for swap rewards
|
|
CLAIM_TYPE_SWAP = 6;
|
|
// claim type for usdx minting rewards
|
|
CLAIM_TYPE_USDX_MINTING = 7;
|
|
}
|
|
|
|
// Claim stores any generic rewards that can be claimed by owner
|
|
message Claim {
|
|
ClaimType type = 1;
|
|
|
|
bytes owner = 2 [
|
|
(cosmos_proto.scalar) = "cosmos.AddressBytes",
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
|
|
];
|
|
|
|
repeated cosmos.base.v1beta1.Coin reward = 3 [
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultiRewardIndex reward_indexes = 4 [
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|