types

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2022 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeClaim             = "claim_reward"
	EventTypeRewardPeriod      = "new_reward_period"
	EventTypeClaimPeriod       = "new_claim_period"
	EventTypeClaimPeriodExpiry = "claim_period_expiry"

	AttributeValueCategory   = ModuleName
	AttributeKeyClaimedBy    = "claimed_by"
	AttributeKeyClaimAmount  = "claim_amount"
	AttributeKeyClaimType    = "claim_type"
	AttributeKeyRewardPeriod = "reward_period"
	AttributeKeyClaimPeriod  = "claim_period"
)

Events emitted by the incentive module

View Source
const (
	// ModuleName defines the module name
	ModuleName = "incentive"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// RouterKey is the message route for slashing
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_capability"
)
View Source
const (
	ParamsKey                              = "Params-value-"
	CdpMintingClaimKey                     = "CdpMintingClaim"
	CdpMintingRewardFactorKey              = "CdpMintingRewardFactorKey"
	PreviousCdpMintingRewardAccrualTimeKey = "PreviousCdpMintingRewardAccrualTime"
	GenesisDenomsKey                       = "GenesisDenoms"
)
View Source
const (
	CdpMintingClaimType = "cdp_minting"
)
View Source
const DefaultIndex uint64 = 1

DefaultIndex is the default capability global index

Variables

View Source
var (
	ErrClaimNotFound                 = sdkerrors.Register(ModuleName, 2, "no claimable rewards found for user")
	ErrRewardPeriodNotFound          = sdkerrors.Register(ModuleName, 3, "no reward period found for collateral type")
	ErrInvalidAccountType            = sdkerrors.Register(ModuleName, 4, "account type not supported")
	ErrNoClaimsFound                 = sdkerrors.Register(ModuleName, 5, "no claimable rewards found")
	ErrInsufficientModAccountBalance = sdkerrors.Register(ModuleName, 6, "module account has insufficient balance to pay claim")
	ErrAccountNotFound               = sdkerrors.Register(ModuleName, 7, "account not found")
	ErrInvalidMultiplier             = sdkerrors.Register(ModuleName, 8, "invalid rewards multiplier")
	ErrZeroClaim                     = sdkerrors.Register(ModuleName, 9, "cannot claim - claim amount rounds to zero")
	ErrClaimExpired                  = sdkerrors.Register(ModuleName, 10, "claim has expired")
	ErrInvalidClaimType              = sdkerrors.Register(ModuleName, 11, "invalid claim type")
	ErrInvalidClaimOwner             = sdkerrors.Register(ModuleName, 12, "invalid claim owner")
)

x/incentive module sentinel errors

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthIncentive        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowIncentive          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupIncentive = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	KeyCdpMintingRewardPeriods      = []byte("CdpMintingRewardPeriods")
	KeyClaimEnd                     = []byte("ClaimEnd")
	KeyMultipliers                  = []byte("ClaimMultipliers")
	DefaultActive                   = false
	DefaultRewardPeriods            = RewardPeriods{}
	DefaultMultiRewardPeriods       = MultiRewardPeriods{}
	DefaultMultipliers              = Multipliers{}
	DefaultCdpClaims                = CdpMintingClaims{}
	DefaultGenesisAccumulationTimes = GenesisAccumulationTimes{}
	DefaultClaimEnd                 = tmtime.Canonical(time.Unix(1, 0))
	DefaultPrincipalDenom           = cdptypes.DefaultStableDenom
	DefaultCDPMintingRewardDenom    = cdptypes.DefaultGovDenom
	IncentiveMacc                   = ununifidistTypes.ModuleName
)

Parameter keys and default values

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func GetTotalVestingPeriodLength

func GetTotalVestingPeriodLength(periods vestingtypes.Periods) int64

GetTotalVestingPeriodLength returns the summed length of all vesting periods

func KeyPrefix

func KeyPrefix(p string) []byte

func NewPeriod

func NewPeriod(amount sdk.Coins, length int64) vestingtypes.Period

NewPeriod returns a new vesting period

func ParamKeyTable

func ParamKeyTable() paramstype.KeyTable

ParamKeyTable Key declaration for parameters

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type AccountKeeper

type AccountKeeper interface {
	// Return a new account with the next account number and the specified address. Does not save the new account to the store.
	NewAccountWithAddress(sdk.Context, sdk.AccAddress) authtypes.AccountI

	// Return a new account with the next account number. Does not save the new account to the store.
	NewAccount(sdk.Context, authtypes.AccountI) authtypes.AccountI

	// Retrieve an account from the store.
	GetAccount(sdk.Context, sdk.AccAddress) authtypes.AccountI

	// Set an account in the store.
	SetAccount(sdk.Context, authtypes.AccountI)

	// Remove an account from the store.
	RemoveAccount(sdk.Context, authtypes.AccountI)

	// Iterate over all accounts, calling the provided function. Stop iteraiton when it returns false.
	IterateAccounts(sdk.Context, func(authtypes.AccountI) bool)

	// Fetch the public key of an account at a specified address
	GetPubKey(sdk.Context, sdk.AccAddress) (cryptotypes.PubKey, error)

	// Fetch the sequence of an account at a specified address.
	GetSequence(sdk.Context, sdk.AccAddress) (uint64, error)

	// Fetch the next account number, and increment the internal counter.
	GetNextAccountNumber(sdk.Context) uint64

	GetModuleAddress(moduleName string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI
}

AccountKeeper expected interface for the account keeper (noalias)

type BankKeeper

type BankKeeper interface {
	// View
	ValidateBalance(ctx sdk.Context, addr sdk.AccAddress) error
	HasBalance(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin) bool

	GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	GetAccountsBalances(ctx sdk.Context) []banktypes.Balance
	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
	LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins

	IterateAccountBalances(ctx sdk.Context, addr sdk.AccAddress, cb func(coin sdk.Coin) (stop bool))
	IterateAllBalances(ctx sdk.Context, cb func(address sdk.AccAddress, coin sdk.Coin) (stop bool))

	// Send
	InputOutputCoins(ctx sdk.Context, inputs []banktypes.Input, outputs []banktypes.Output) error
	SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error

	GetParams(ctx sdk.Context) banktypes.Params
	SetParams(ctx sdk.Context, params banktypes.Params)

	BlockedAddr(addr sdk.AccAddress) bool

	//
	InitGenesis(sdk.Context, *banktypes.GenesisState)
	ExportGenesis(sdk.Context) *banktypes.GenesisState

	GetSupply(ctx sdk.Context, denom string) sdk.Coin
	GetPaginatedTotalSupply(ctx sdk.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error)
	IterateTotalSupply(ctx sdk.Context, cb func(sdk.Coin) bool)

	GetDenomMetaData(ctx sdk.Context, denom string) (banktypes.Metadata, bool)
	SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata)
	IterateAllDenomMetaData(ctx sdk.Context, cb func(banktypes.Metadata) bool)

	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	DelegateCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error

	DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error
	UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error
}

type BaseClaim

type BaseClaim struct {
	Owner  github_com_UnUniFi_chain_types.StringAccAddress `protobuf:"bytes,1,opt,name=owner,proto3,customtype=github.com/UnUniFi/chain/types.StringAccAddress" json:"owner" yaml:"owner"`
	Reward types.Coin                                      `protobuf:"bytes,2,opt,name=reward,proto3" json:"reward" yaml:"reward"`
}

func (*BaseClaim) Descriptor

func (*BaseClaim) Descriptor() ([]byte, []int)

func (*BaseClaim) GetReward

func (m *BaseClaim) GetReward() types.Coin

func (BaseClaim) GetType

func (c BaseClaim) GetType() string

GetType returns the claim type, used to identify auctions in event attributes

func (*BaseClaim) Marshal

func (m *BaseClaim) Marshal() (dAtA []byte, err error)

func (*BaseClaim) MarshalTo

func (m *BaseClaim) MarshalTo(dAtA []byte) (int, error)

func (*BaseClaim) MarshalToSizedBuffer

func (m *BaseClaim) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BaseClaim) ProtoMessage

func (*BaseClaim) ProtoMessage()

func (*BaseClaim) Reset

func (m *BaseClaim) Reset()

func (*BaseClaim) Size

func (m *BaseClaim) Size() (n int)

func (*BaseClaim) String

func (m *BaseClaim) String() string

func (*BaseClaim) Unmarshal

func (m *BaseClaim) Unmarshal(dAtA []byte) error

func (BaseClaim) Validate

func (c BaseClaim) Validate() error

Validate performs a basic check of a BaseClaim fields

func (*BaseClaim) XXX_DiscardUnknown

func (m *BaseClaim) XXX_DiscardUnknown()

func (*BaseClaim) XXX_Marshal

func (m *BaseClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BaseClaim) XXX_Merge

func (m *BaseClaim) XXX_Merge(src proto.Message)

func (*BaseClaim) XXX_Size

func (m *BaseClaim) XXX_Size() int

func (*BaseClaim) XXX_Unmarshal

func (m *BaseClaim) XXX_Unmarshal(b []byte) error

type BaseMultiClaim

type BaseMultiClaim struct {
	Owner  github_com_UnUniFi_chain_types.StringAccAddress `protobuf:"bytes,1,opt,name=owner,proto3,customtype=github.com/UnUniFi/chain/types.StringAccAddress" json:"owner" yaml:"owner"`
	Reward []types.Coin                                    `protobuf:"bytes,2,rep,name=reward,proto3" json:"reward" yaml:"rewards"`
}

func (*BaseMultiClaim) Descriptor

func (*BaseMultiClaim) Descriptor() ([]byte, []int)

func (*BaseMultiClaim) GetReward

func (m *BaseMultiClaim) GetReward() []types.Coin

func (BaseMultiClaim) GetType

func (c BaseMultiClaim) GetType() string

GetType returns the claim type, used to identify auctions in event attributes

func (*BaseMultiClaim) Marshal

func (m *BaseMultiClaim) Marshal() (dAtA []byte, err error)

func (*BaseMultiClaim) MarshalTo

func (m *BaseMultiClaim) MarshalTo(dAtA []byte) (int, error)

func (*BaseMultiClaim) MarshalToSizedBuffer

func (m *BaseMultiClaim) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BaseMultiClaim) ProtoMessage

func (*BaseMultiClaim) ProtoMessage()

func (*BaseMultiClaim) Reset

func (m *BaseMultiClaim) Reset()

func (*BaseMultiClaim) Size

func (m *BaseMultiClaim) Size() (n int)

func (*BaseMultiClaim) String

func (m *BaseMultiClaim) String() string

func (*BaseMultiClaim) Unmarshal

func (m *BaseMultiClaim) Unmarshal(dAtA []byte) error

func (BaseMultiClaim) Validate

func (c BaseMultiClaim) Validate() error

Validate performs a basic check of a BaseClaim fields

func (*BaseMultiClaim) XXX_DiscardUnknown

func (m *BaseMultiClaim) XXX_DiscardUnknown()

func (*BaseMultiClaim) XXX_Marshal

func (m *BaseMultiClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BaseMultiClaim) XXX_Merge

func (m *BaseMultiClaim) XXX_Merge(src proto.Message)

func (*BaseMultiClaim) XXX_Size

func (m *BaseMultiClaim) XXX_Size() int

func (*BaseMultiClaim) XXX_Unmarshal

func (m *BaseMultiClaim) XXX_Unmarshal(b []byte) error

type CdpKeeper

type CdpKeeper interface {
	GetInterestFactor(ctx sdk.Context, collateralType string) (sdk.Dec, bool)
	GetTotalPrincipal(ctx sdk.Context, collateralType string, principalDenom string) (total sdk.Int)
	GetCdpByOwnerAndCollateralType(ctx sdk.Context, owner sdk.AccAddress, collateralType string) (cdptypes.Cdp, bool)
	GetCollateral(ctx sdk.Context, collateralType string) (cdptypes.CollateralParam, bool)
}

CdpKeeper defines the expected interface for the pricefeed (noalias)

type CdpMintingClaim

type CdpMintingClaim struct {
	*BaseClaim    ``            /* 126-byte string literal not displayed */
	RewardIndexes []RewardIndex `protobuf:"bytes,2,rep,name=reward_indexes,json=rewardIndexes,proto3" json:"reward_indexes" yaml:"reward_indexes"`
}

func NewCdpMintingClaim

func NewCdpMintingClaim(owner sdk.AccAddress, reward sdk.Coin, rewardIndexes RewardIndexes) CdpMintingClaim

NewCdpMintingClaim returns a new CdpMintingClaim

func (*CdpMintingClaim) Descriptor

func (*CdpMintingClaim) Descriptor() ([]byte, []int)

func (CdpMintingClaim) GetOwner

func (c CdpMintingClaim) GetOwner() sdk.AccAddress

GetOwner returns the claim's owner

func (CdpMintingClaim) GetReward

func (c CdpMintingClaim) GetReward() sdk.Coin

GetReward returns the claim's reward coin

func (*CdpMintingClaim) GetRewardIndexes

func (m *CdpMintingClaim) GetRewardIndexes() []RewardIndex

func (CdpMintingClaim) GetType

func (c CdpMintingClaim) GetType() string

GetType returns the claim's type

func (CdpMintingClaim) HasRewardIndex

func (c CdpMintingClaim) HasRewardIndex(collateralType string) (int64, bool)

HasRewardIndex check if a claim has a reward index for the input collateral type

func (*CdpMintingClaim) Marshal

func (m *CdpMintingClaim) Marshal() (dAtA []byte, err error)

func (*CdpMintingClaim) MarshalTo

func (m *CdpMintingClaim) MarshalTo(dAtA []byte) (int, error)

func (*CdpMintingClaim) MarshalToSizedBuffer

func (m *CdpMintingClaim) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CdpMintingClaim) ProtoMessage

func (*CdpMintingClaim) ProtoMessage()

func (*CdpMintingClaim) Reset

func (m *CdpMintingClaim) Reset()

func (*CdpMintingClaim) Size

func (m *CdpMintingClaim) Size() (n int)

func (*CdpMintingClaim) String

func (m *CdpMintingClaim) String() string

func (*CdpMintingClaim) Unmarshal

func (m *CdpMintingClaim) Unmarshal(dAtA []byte) error

func (CdpMintingClaim) Validate

func (c CdpMintingClaim) Validate() error

Validate performs a basic check of a Claim fields

func (*CdpMintingClaim) XXX_DiscardUnknown

func (m *CdpMintingClaim) XXX_DiscardUnknown()

func (*CdpMintingClaim) XXX_Marshal

func (m *CdpMintingClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CdpMintingClaim) XXX_Merge

func (m *CdpMintingClaim) XXX_Merge(src proto.Message)

func (*CdpMintingClaim) XXX_Size

func (m *CdpMintingClaim) XXX_Size() int

func (*CdpMintingClaim) XXX_Unmarshal

func (m *CdpMintingClaim) XXX_Unmarshal(b []byte) error

type CdpMintingClaims

type CdpMintingClaims []CdpMintingClaim

CdpMintingClaims slice of CdpMintingClaim

func (CdpMintingClaims) Validate

func (cs CdpMintingClaims) Validate() error

Validate checks if all the claims are valid and there are no duplicated entries.

type Claim

type Claim interface {
	GetOwner() sdk.AccAddress
	GetReward() sdk.Coin
	GetType() string
}

Claim is an interface for handling common claim actions

type Claims

type Claims []Claim

Claims is a slice of Claim

type GenesisAccumulationTime

type GenesisAccumulationTime struct {
	CollateralType           string    `` /* 126-byte string literal not displayed */
	PreviousAccumulationTime time.Time `` /* 167-byte string literal not displayed */
}

func NewGenesisAccumulationTime

func NewGenesisAccumulationTime(ctype string, prevTime time.Time) GenesisAccumulationTime

NewGenesisAccumulationTime returns a new GenesisAccumulationTime

func (*GenesisAccumulationTime) Descriptor

func (*GenesisAccumulationTime) Descriptor() ([]byte, []int)

func (*GenesisAccumulationTime) GetCollateralType

func (m *GenesisAccumulationTime) GetCollateralType() string

func (*GenesisAccumulationTime) GetPreviousAccumulationTime

func (m *GenesisAccumulationTime) GetPreviousAccumulationTime() time.Time

func (*GenesisAccumulationTime) Marshal

func (m *GenesisAccumulationTime) Marshal() (dAtA []byte, err error)

func (*GenesisAccumulationTime) MarshalTo

func (m *GenesisAccumulationTime) MarshalTo(dAtA []byte) (int, error)

func (*GenesisAccumulationTime) MarshalToSizedBuffer

func (m *GenesisAccumulationTime) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisAccumulationTime) ProtoMessage

func (*GenesisAccumulationTime) ProtoMessage()

func (*GenesisAccumulationTime) Reset

func (m *GenesisAccumulationTime) Reset()

func (*GenesisAccumulationTime) Size

func (m *GenesisAccumulationTime) Size() (n int)

func (*GenesisAccumulationTime) String

func (m *GenesisAccumulationTime) String() string

func (*GenesisAccumulationTime) Unmarshal

func (m *GenesisAccumulationTime) Unmarshal(dAtA []byte) error

func (GenesisAccumulationTime) Validate

func (gat GenesisAccumulationTime) Validate() error

Validate performs validation of GenesisAccumulationTime

func (*GenesisAccumulationTime) XXX_DiscardUnknown

func (m *GenesisAccumulationTime) XXX_DiscardUnknown()

func (*GenesisAccumulationTime) XXX_Marshal

func (m *GenesisAccumulationTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisAccumulationTime) XXX_Merge

func (m *GenesisAccumulationTime) XXX_Merge(src proto.Message)

func (*GenesisAccumulationTime) XXX_Size

func (m *GenesisAccumulationTime) XXX_Size() int

func (*GenesisAccumulationTime) XXX_Unmarshal

func (m *GenesisAccumulationTime) XXX_Unmarshal(b []byte) error

type GenesisAccumulationTimes

type GenesisAccumulationTimes []GenesisAccumulationTime

GenesisAccumulationTimes slice of GenesisAccumulationTime

func (GenesisAccumulationTimes) Validate

func (gats GenesisAccumulationTimes) Validate() error

Validate performs validation of GenesisAccumulationTimes

type GenesisDenoms

type GenesisDenoms struct {
	PrincipalDenom        string `` /* 126-byte string literal not displayed */
	CdpMintingRewardDenom string `` /* 151-byte string literal not displayed */
}

func DefaultGenesisDenoms

func DefaultGenesisDenoms() *GenesisDenoms

func (*GenesisDenoms) Descriptor

func (*GenesisDenoms) Descriptor() ([]byte, []int)

func (*GenesisDenoms) GetCdpMintingRewardDenom

func (m *GenesisDenoms) GetCdpMintingRewardDenom() string

func (*GenesisDenoms) GetPrincipalDenom

func (m *GenesisDenoms) GetPrincipalDenom() string

func (*GenesisDenoms) Marshal

func (m *GenesisDenoms) Marshal() (dAtA []byte, err error)

func (*GenesisDenoms) MarshalTo

func (m *GenesisDenoms) MarshalTo(dAtA []byte) (int, error)

func (*GenesisDenoms) MarshalToSizedBuffer

func (m *GenesisDenoms) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisDenoms) ProtoMessage

func (*GenesisDenoms) ProtoMessage()

func (*GenesisDenoms) Reset

func (m *GenesisDenoms) Reset()

func (*GenesisDenoms) Size

func (m *GenesisDenoms) Size() (n int)

func (*GenesisDenoms) String

func (m *GenesisDenoms) String() string

func (*GenesisDenoms) Unmarshal

func (m *GenesisDenoms) Unmarshal(dAtA []byte) error

func (*GenesisDenoms) Validate

func (denoms *GenesisDenoms) Validate() error

func (*GenesisDenoms) XXX_DiscardUnknown

func (m *GenesisDenoms) XXX_DiscardUnknown()

func (*GenesisDenoms) XXX_Marshal

func (m *GenesisDenoms) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisDenoms) XXX_Merge

func (m *GenesisDenoms) XXX_Merge(src proto.Message)

func (*GenesisDenoms) XXX_Size

func (m *GenesisDenoms) XXX_Size() int

func (*GenesisDenoms) XXX_Unmarshal

func (m *GenesisDenoms) XXX_Unmarshal(b []byte) error

type GenesisState

type GenesisState struct {
	Params               Params                    `protobuf:"bytes,1,opt,name=params,proto3" json:"params" yaml:"params"`
	CdpAccumulationTimes []GenesisAccumulationTime `` /* 143-byte string literal not displayed */
	CdpMintingClaims     []CdpMintingClaim         `` /* 127-byte string literal not displayed */
	Denoms               *GenesisDenoms            `protobuf:"bytes,4,opt,name=denoms,proto3" json:"denoms,omitempty" yaml:"denoms"`
}

GenesisState defines the incentive module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default Capability genesis state

func NewGenesisState

func NewGenesisState(params Params, jpuAccumTimes GenesisAccumulationTimes, c CdpMintingClaims, denoms *GenesisDenoms) GenesisState

NewGenesisState returns a new genesis state

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (GenesisState) Equal

func (gs GenesisState) Equal(gs2 GenesisState) bool

Equal checks whether two gov GenesisState structs are equivalent

func (*GenesisState) GetCdpAccumulationTimes

func (m *GenesisState) GetCdpAccumulationTimes() []GenesisAccumulationTime

func (*GenesisState) GetCdpMintingClaims

func (m *GenesisState) GetCdpMintingClaims() []CdpMintingClaim

func (*GenesisState) GetDenoms

func (m *GenesisState) GetDenoms() *GenesisDenoms

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (GenesisState) IsEmpty

func (gs GenesisState) IsEmpty() bool

IsEmpty returns true if a GenesisState is empty

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) Validate

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type MsgClaimCdpMintingReward

type MsgClaimCdpMintingReward struct {
	Sender         github_com_UnUniFi_chain_types.StringAccAddress `` /* 128-byte string literal not displayed */
	MultiplierName string                                          `` /* 126-byte string literal not displayed */
}

func NewMsgClaimCdpMintingReward

func NewMsgClaimCdpMintingReward(sender sdk.AccAddress, multiplierName string) MsgClaimCdpMintingReward

NewMsgClaimCdpMintingReward returns a new MsgClaimCdpMintingReward.

func (*MsgClaimCdpMintingReward) Descriptor

func (*MsgClaimCdpMintingReward) Descriptor() ([]byte, []int)

func (*MsgClaimCdpMintingReward) GetMultiplierName

func (m *MsgClaimCdpMintingReward) GetMultiplierName() string

func (MsgClaimCdpMintingReward) GetSignBytes

func (msg MsgClaimCdpMintingReward) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgClaimCdpMintingReward) GetSigners

func (msg MsgClaimCdpMintingReward) GetSigners() []sdk.AccAddress

GetSigners returns the addresses of signers that must sign.

func (*MsgClaimCdpMintingReward) Marshal

func (m *MsgClaimCdpMintingReward) Marshal() (dAtA []byte, err error)

func (*MsgClaimCdpMintingReward) MarshalTo

func (m *MsgClaimCdpMintingReward) MarshalTo(dAtA []byte) (int, error)

func (*MsgClaimCdpMintingReward) MarshalToSizedBuffer

func (m *MsgClaimCdpMintingReward) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgClaimCdpMintingReward) ProtoMessage

func (*MsgClaimCdpMintingReward) ProtoMessage()

func (*MsgClaimCdpMintingReward) Reset

func (m *MsgClaimCdpMintingReward) Reset()

func (MsgClaimCdpMintingReward) Route

func (msg MsgClaimCdpMintingReward) Route() string

Route return the message type used for routing the message.

func (*MsgClaimCdpMintingReward) Size

func (m *MsgClaimCdpMintingReward) Size() (n int)

func (*MsgClaimCdpMintingReward) String

func (m *MsgClaimCdpMintingReward) String() string

func (MsgClaimCdpMintingReward) Type

func (msg MsgClaimCdpMintingReward) Type() string

Type returns a human-readable string for the message, intended for utilization within tags.

func (*MsgClaimCdpMintingReward) Unmarshal

func (m *MsgClaimCdpMintingReward) Unmarshal(dAtA []byte) error

func (MsgClaimCdpMintingReward) ValidateBasic

func (msg MsgClaimCdpMintingReward) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to state.

func (*MsgClaimCdpMintingReward) XXX_DiscardUnknown

func (m *MsgClaimCdpMintingReward) XXX_DiscardUnknown()

func (*MsgClaimCdpMintingReward) XXX_Marshal

func (m *MsgClaimCdpMintingReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgClaimCdpMintingReward) XXX_Merge

func (m *MsgClaimCdpMintingReward) XXX_Merge(src proto.Message)

func (*MsgClaimCdpMintingReward) XXX_Size

func (m *MsgClaimCdpMintingReward) XXX_Size() int

func (*MsgClaimCdpMintingReward) XXX_Unmarshal

func (m *MsgClaimCdpMintingReward) XXX_Unmarshal(b []byte) error

type MsgClaimCdpMintingRewardResponse

type MsgClaimCdpMintingRewardResponse struct {
}

func (*MsgClaimCdpMintingRewardResponse) Descriptor

func (*MsgClaimCdpMintingRewardResponse) Descriptor() ([]byte, []int)

func (*MsgClaimCdpMintingRewardResponse) Marshal

func (m *MsgClaimCdpMintingRewardResponse) Marshal() (dAtA []byte, err error)

func (*MsgClaimCdpMintingRewardResponse) MarshalTo

func (m *MsgClaimCdpMintingRewardResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgClaimCdpMintingRewardResponse) MarshalToSizedBuffer

func (m *MsgClaimCdpMintingRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgClaimCdpMintingRewardResponse) ProtoMessage

func (*MsgClaimCdpMintingRewardResponse) ProtoMessage()

func (*MsgClaimCdpMintingRewardResponse) Reset

func (*MsgClaimCdpMintingRewardResponse) Size

func (m *MsgClaimCdpMintingRewardResponse) Size() (n int)

func (*MsgClaimCdpMintingRewardResponse) String

func (*MsgClaimCdpMintingRewardResponse) Unmarshal

func (m *MsgClaimCdpMintingRewardResponse) Unmarshal(dAtA []byte) error

func (*MsgClaimCdpMintingRewardResponse) XXX_DiscardUnknown

func (m *MsgClaimCdpMintingRewardResponse) XXX_DiscardUnknown()

func (*MsgClaimCdpMintingRewardResponse) XXX_Marshal

func (m *MsgClaimCdpMintingRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgClaimCdpMintingRewardResponse) XXX_Merge

func (*MsgClaimCdpMintingRewardResponse) XXX_Size

func (m *MsgClaimCdpMintingRewardResponse) XXX_Size() int

func (*MsgClaimCdpMintingRewardResponse) XXX_Unmarshal

func (m *MsgClaimCdpMintingRewardResponse) XXX_Unmarshal(b []byte) error

type MsgClient

type MsgClient interface {
	ClaimCdpMintingReward(ctx context.Context, in *MsgClaimCdpMintingReward, opts ...grpc.CallOption) (*MsgClaimCdpMintingRewardResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer

type MsgServer interface {
	ClaimCdpMintingReward(context.Context, *MsgClaimCdpMintingReward) (*MsgClaimCdpMintingRewardResponse, error)
}

MsgServer is the server API for Msg service.

type MultiRewardIndex

type MultiRewardIndex struct {
	CollateralType string        `json:"collateral_type" yaml:"collateral_type"`
	RewardIndexes  RewardIndexes `json:"reward_indexes" yaml:"reward_indexes"`
}

MultiRewardIndex stores reward accumulation information on multiple reward types

func NewMultiRewardIndex

func NewMultiRewardIndex(collateralType string, indexes RewardIndexes) MultiRewardIndex

NewMultiRewardIndex returns a new MultiRewardIndex

func (MultiRewardIndex) GetFactorIndex

func (mri MultiRewardIndex) GetFactorIndex(denom string) (int, bool)

GetFactorIndex gets the index of a specific reward index inside the array by its index

func (MultiRewardIndex) String

func (mri MultiRewardIndex) String() string

func (MultiRewardIndex) Validate

func (mri MultiRewardIndex) Validate() error

Validate validates multi-reward index

type MultiRewardIndexes

type MultiRewardIndexes []MultiRewardIndex

MultiRewardIndexes slice of MultiRewardIndex

func (MultiRewardIndexes) GetRewardIndex

func (mris MultiRewardIndexes) GetRewardIndex(denom string) (MultiRewardIndex, bool)

GetRewardIndex fetches a RewardIndex from a MultiRewardIndex by its denom

func (MultiRewardIndexes) GetRewardIndexIndex

func (mris MultiRewardIndexes) GetRewardIndexIndex(denom string) (int, bool)

GetRewardIndexIndex fetches a specific reward index inside the array by its denom

func (MultiRewardIndexes) Validate

func (mris MultiRewardIndexes) Validate() error

Validate validation for reward indexes

type MultiRewardPeriod

type MultiRewardPeriod struct {
	Active           bool      `json:"active" yaml:"active"`
	CollateralType   string    `json:"collateral_type" yaml:"collateral_type"`
	Start            time.Time `json:"start" yaml:"start"`
	End              time.Time `json:"end" yaml:"end"`
	RewardsPerSecond sdk.Coins `json:"rewards_per_second" yaml:"rewards_per_second"` // per second reward payouts
}

MultiRewardPeriod supports multiple reward types

func NewMultiRewardPeriod

func NewMultiRewardPeriod(active bool, collateralType string, start time.Time, end time.Time, reward sdk.Coins) MultiRewardPeriod

NewMultiRewardPeriod returns a new MultiRewardPeriod

func (MultiRewardPeriod) String

func (mrp MultiRewardPeriod) String() string

String implements fmt.Stringer

func (MultiRewardPeriod) Validate

func (mrp MultiRewardPeriod) Validate() error

Validate performs a basic check of a MultiRewardPeriod.

type MultiRewardPeriods

type MultiRewardPeriods []MultiRewardPeriod

MultiRewardPeriods array of MultiRewardPeriod

func (MultiRewardPeriods) GetMultiRewardPeriod

func (mrps MultiRewardPeriods) GetMultiRewardPeriod(denom string) (MultiRewardPeriod, bool)

GetMultiRewardPeriod fetches a MultiRewardPeriod from an array of MultiRewardPeriods by its denom

func (MultiRewardPeriods) GetMultiRewardPeriodIndex

func (mrps MultiRewardPeriods) GetMultiRewardPeriodIndex(denom string) (int, bool)

GetMultiRewardPeriodIndex returns the index of a MultiRewardPeriod inside array MultiRewardPeriods

func (MultiRewardPeriods) Validate

func (mrps MultiRewardPeriods) Validate() error

Validate checks if all the RewardPeriods are valid and there are no duplicated entries.

type Multiplier

type Multiplier struct {
	Name         string                                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" yaml:"name"`
	MonthsLockup int64                                  `protobuf:"varint,2,opt,name=months_lockup,json=monthsLockup,proto3" json:"months_lockup,omitempty" yaml:"months_lockup"`
	Factor       github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=factor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"factor" yaml:"factor"`
}

func NewMultiplier

func NewMultiplier(name MultiplierName, lockup int64, factor sdk.Dec) Multiplier

NewMultiplier returns a new Multiplier

func (*Multiplier) Descriptor

func (*Multiplier) Descriptor() ([]byte, []int)

func (*Multiplier) GetMonthsLockup

func (m *Multiplier) GetMonthsLockup() int64

func (*Multiplier) GetName

func (m *Multiplier) GetName() string

func (*Multiplier) Marshal

func (m *Multiplier) Marshal() (dAtA []byte, err error)

func (*Multiplier) MarshalTo

func (m *Multiplier) MarshalTo(dAtA []byte) (int, error)

func (*Multiplier) MarshalToSizedBuffer

func (m *Multiplier) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Multiplier) ProtoMessage

func (*Multiplier) ProtoMessage()

func (*Multiplier) Reset

func (m *Multiplier) Reset()

func (*Multiplier) Size

func (m *Multiplier) Size() (n int)

func (*Multiplier) String

func (m *Multiplier) String() string

func (*Multiplier) Unmarshal

func (m *Multiplier) Unmarshal(dAtA []byte) error

func (Multiplier) Validate

func (m Multiplier) Validate() error

Validate multiplier param

func (*Multiplier) XXX_DiscardUnknown

func (m *Multiplier) XXX_DiscardUnknown()

func (*Multiplier) XXX_Marshal

func (m *Multiplier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Multiplier) XXX_Merge

func (m *Multiplier) XXX_Merge(src proto.Message)

func (*Multiplier) XXX_Size

func (m *Multiplier) XXX_Size() int

func (*Multiplier) XXX_Unmarshal

func (m *Multiplier) XXX_Unmarshal(b []byte) error

type MultiplierName

type MultiplierName string

MultiplierName name for valid multiplier

const (
	Small  MultiplierName = "small"
	Medium MultiplierName = "medium"
	Large  MultiplierName = "large"
)

Valid reward multipliers

func (MultiplierName) IsValid

func (mn MultiplierName) IsValid() error

IsValid checks if the input is one of the expected strings

type Multipliers

type Multipliers []Multiplier

Multipliers slice of Multiplier

func (Multipliers) String

func (ms Multipliers) String() string

String implements fmt.Stringer

func (Multipliers) Validate

func (ms Multipliers) Validate() error

Validate validates each multiplier

type Params

type Params struct {
	CdpMintingRewardPeriods []RewardPeriod `` /* 158-byte string literal not displayed */
	ClaimMultipliers        []Multiplier   `protobuf:"bytes,2,rep,name=claim_multipliers,json=claimMultipliers,proto3" json:"claim_multipliers" yaml:"claim_multipliers"`
	ClaimEnd                time.Time      `protobuf:"bytes,3,opt,name=claim_end,json=claimEnd,proto3,stdtime" json:"claim_end" yaml:"claim_end"`
}

func DefaultParams

func DefaultParams() Params

DefaultParams returns default params for incentive module

func NewParams

func NewParams(cdpMinting RewardPeriods, multipliers Multipliers, claimEnd time.Time) Params

NewParams returns a new params object

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) GetCdpMintingRewardPeriods

func (m *Params) GetCdpMintingRewardPeriods() []RewardPeriod

func (*Params) GetClaimEnd

func (m *Params) GetClaimEnd() time.Time

func (*Params) GetClaimMultipliers

func (m *Params) GetClaimMultipliers() []Multiplier

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramstype.ParamSetPairs

ParamSetPairs implements the ParamSet interface and returns all the key/value pairs

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) Validate

func (p Params) Validate() error

Validate checks that the parameters have valid values.

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type QueryClient

type QueryClient interface {
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryParamsRequest

type QueryParamsRequest struct {
}

func (*QueryParamsRequest) Descriptor

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) Marshal

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse

type QueryParamsResponse struct {
	Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
}

func (*QueryParamsResponse) Descriptor

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetParams

func (m *QueryParamsResponse) GetParams() *Params

func (*QueryParamsResponse) Marshal

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryServer

type QueryServer interface {
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
}

QueryServer is the server API for Query service.

type RewardIndex

type RewardIndex struct {
	CollateralType string                                 `` /* 126-byte string literal not displayed */
	RewardFactor   github_com_cosmos_cosmos_sdk_types.Dec `` /* 158-byte string literal not displayed */
}

func NewRewardIndex

func NewRewardIndex(collateralType string, factor sdk.Dec) RewardIndex

NewRewardIndex returns a new RewardIndex

func (*RewardIndex) Descriptor

func (*RewardIndex) Descriptor() ([]byte, []int)

func (*RewardIndex) GetCollateralType

func (m *RewardIndex) GetCollateralType() string

func (*RewardIndex) Marshal

func (m *RewardIndex) Marshal() (dAtA []byte, err error)

func (*RewardIndex) MarshalTo

func (m *RewardIndex) MarshalTo(dAtA []byte) (int, error)

func (*RewardIndex) MarshalToSizedBuffer

func (m *RewardIndex) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RewardIndex) ProtoMessage

func (*RewardIndex) ProtoMessage()

func (*RewardIndex) Reset

func (m *RewardIndex) Reset()

func (*RewardIndex) Size

func (m *RewardIndex) Size() (n int)

func (*RewardIndex) String

func (m *RewardIndex) String() string

func (*RewardIndex) Unmarshal

func (m *RewardIndex) Unmarshal(dAtA []byte) error

func (RewardIndex) Validate

func (ri RewardIndex) Validate() error

Validate validates reward index

func (*RewardIndex) XXX_DiscardUnknown

func (m *RewardIndex) XXX_DiscardUnknown()

func (*RewardIndex) XXX_Marshal

func (m *RewardIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RewardIndex) XXX_Merge

func (m *RewardIndex) XXX_Merge(src proto.Message)

func (*RewardIndex) XXX_Size

func (m *RewardIndex) XXX_Size() int

func (*RewardIndex) XXX_Unmarshal

func (m *RewardIndex) XXX_Unmarshal(b []byte) error

type RewardIndexes

type RewardIndexes []RewardIndex

RewardIndexes slice of RewardIndex

func (RewardIndexes) GetFactorIndex

func (ris RewardIndexes) GetFactorIndex(denom string) (int, bool)

GetFactorIndex gets the index of a specific reward index inside the array by its index

func (RewardIndexes) GetRewardIndex

func (ris RewardIndexes) GetRewardIndex(denom string) (RewardIndex, bool)

GetRewardIndex fetches a RewardIndex by its denom

func (RewardIndexes) Validate

func (ris RewardIndexes) Validate() error

Validate validation for reward indexes

type RewardPeriod

type RewardPeriod struct {
	Active           bool       `protobuf:"varint,1,opt,name=active,proto3" json:"active,omitempty" yaml:"active"`
	CollateralType   string     `` /* 126-byte string literal not displayed */
	Start            time.Time  `protobuf:"bytes,3,opt,name=start,proto3,stdtime" json:"start" yaml:"start"`
	End              time.Time  `protobuf:"bytes,4,opt,name=end,proto3,stdtime" json:"end" yaml:"end"`
	RewardsPerSecond types.Coin `` /* 127-byte string literal not displayed */
}

func NewRewardPeriod

func NewRewardPeriod(active bool, collateralType string, start time.Time, end time.Time, reward sdk.Coin) RewardPeriod

NewRewardPeriod returns a new RewardPeriod

func (*RewardPeriod) Descriptor

func (*RewardPeriod) Descriptor() ([]byte, []int)

func (*RewardPeriod) GetActive

func (m *RewardPeriod) GetActive() bool

func (*RewardPeriod) GetCollateralType

func (m *RewardPeriod) GetCollateralType() string

func (*RewardPeriod) GetEnd

func (m *RewardPeriod) GetEnd() time.Time

func (*RewardPeriod) GetRewardsPerSecond

func (m *RewardPeriod) GetRewardsPerSecond() types.Coin

func (*RewardPeriod) GetStart

func (m *RewardPeriod) GetStart() time.Time

func (*RewardPeriod) Marshal

func (m *RewardPeriod) Marshal() (dAtA []byte, err error)

func (*RewardPeriod) MarshalTo

func (m *RewardPeriod) MarshalTo(dAtA []byte) (int, error)

func (*RewardPeriod) MarshalToSizedBuffer

func (m *RewardPeriod) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RewardPeriod) ProtoMessage

func (*RewardPeriod) ProtoMessage()

func (*RewardPeriod) Reset

func (m *RewardPeriod) Reset()

func (*RewardPeriod) Size

func (m *RewardPeriod) Size() (n int)

func (*RewardPeriod) String

func (m *RewardPeriod) String() string

func (*RewardPeriod) Unmarshal

func (m *RewardPeriod) Unmarshal(dAtA []byte) error

func (RewardPeriod) Validate

func (rp RewardPeriod) Validate() error

Validate performs a basic check of a RewardPeriod fields.

func (*RewardPeriod) XXX_DiscardUnknown

func (m *RewardPeriod) XXX_DiscardUnknown()

func (*RewardPeriod) XXX_Marshal

func (m *RewardPeriod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RewardPeriod) XXX_Merge

func (m *RewardPeriod) XXX_Merge(src proto.Message)

func (*RewardPeriod) XXX_Size

func (m *RewardPeriod) XXX_Size() int

func (*RewardPeriod) XXX_Unmarshal

func (m *RewardPeriod) XXX_Unmarshal(b []byte) error

type RewardPeriods

type RewardPeriods []RewardPeriod

RewardPeriods array of RewardPeriod

func (RewardPeriods) Validate

func (rps RewardPeriods) Validate() error

Validate checks if all the RewardPeriods are valid and there are no duplicated entries.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) ClaimCdpMintingReward

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Params

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL