mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 18:15:19 +00:00
e2f515ba9e
* query auction by lot owner * add SavingsRateDistributed to store * v2cdps: filtered cdps query * update v2cdps cli examples * add savings rate dist counter to begin blocker * implement savings rate dist cli query * implement cdp REST queries * minor auction CLI/REST updates * fix auction querier bug * update REST endpoint to 'cdps' * update to savings-rate-dist * update SavingsRateDistributed get/set * update tests * fix savings rate dist rounding errors * 'collateralDenom' -> 'collateralType' * refactor 'v2cdps' -> 'cdps', add ratio param * fix augmented CDP type, msg string() method * fix cdp querier test * filter query results efficiently * querier tests * limit type iteration if owner defined * improve savings rate dist genesis validation * default sdk.Dec{} to sdk.ZeroDec in queries * update condition logic for finding intersection * fix cdp querier filtering * Update kava-4 swagger (#653) * add collateral_type, update cdp params * savings rate, auctions, get cdps * drop owner from AuctionResponse * remove duplicate collateral denom * update query paths with {collateral-type}
169 lines
8.5 KiB
Go
169 lines
8.5 KiB
Go
package cdp
|
|
|
|
import (
|
|
"github.com/kava-labs/kava/x/cdp/keeper"
|
|
"github.com/kava-labs/kava/x/cdp/types"
|
|
)
|
|
|
|
// nolint
|
|
// autogenerated code using github.com/rigelrozanski/multitool
|
|
// aliases generated for the following subdirectories:
|
|
// ALIASGEN: github.com/kava-labs/kava/x/cdp/keeper
|
|
// ALIASGEN: github.com/kava-labs/kava/x/cdp/types
|
|
|
|
const (
|
|
BaseDigitFactor = keeper.BaseDigitFactor
|
|
EventTypeCreateCdp = types.EventTypeCreateCdp
|
|
EventTypeCdpDeposit = types.EventTypeCdpDeposit
|
|
EventTypeCdpDraw = types.EventTypeCdpDraw
|
|
EventTypeCdpRepay = types.EventTypeCdpRepay
|
|
EventTypeCdpClose = types.EventTypeCdpClose
|
|
EventTypeCdpWithdrawal = types.EventTypeCdpWithdrawal
|
|
EventTypeCdpLiquidation = types.EventTypeCdpLiquidation
|
|
EventTypeBeginBlockerFatal = types.EventTypeBeginBlockerFatal
|
|
AttributeKeyCdpID = types.AttributeKeyCdpID
|
|
AttributeKeyDeposit = types.AttributeKeyDeposit
|
|
AttributeValueCategory = types.AttributeValueCategory
|
|
AttributeKeyError = types.AttributeKeyError
|
|
ModuleName = types.ModuleName
|
|
StoreKey = types.StoreKey
|
|
RouterKey = types.RouterKey
|
|
QuerierRoute = types.QuerierRoute
|
|
DefaultParamspace = types.DefaultParamspace
|
|
LiquidatorMacc = types.LiquidatorMacc
|
|
SavingsRateMacc = types.SavingsRateMacc
|
|
QueryGetCdp = types.QueryGetCdp
|
|
QueryGetCdpDeposits = types.QueryGetCdpDeposits
|
|
QueryGetCdps = types.QueryGetCdps
|
|
QueryGetCdpsByCollateralization = types.QueryGetCdpsByCollateralization
|
|
QueryGetParams = types.QueryGetParams
|
|
RestOwner = types.RestOwner
|
|
RestCollateralType = types.RestCollateralType
|
|
RestRatio = types.RestRatio
|
|
)
|
|
|
|
var (
|
|
// functions aliases
|
|
NewKeeper = keeper.NewKeeper
|
|
NewQuerier = keeper.NewQuerier
|
|
NewCDP = types.NewCDP
|
|
NewAugmentedCDP = types.NewAugmentedCDP
|
|
RegisterCodec = types.RegisterCodec
|
|
NewDeposit = types.NewDeposit
|
|
NewGenesisState = types.NewGenesisState
|
|
DefaultGenesisState = types.DefaultGenesisState
|
|
GetCdpIDBytes = types.GetCdpIDBytes
|
|
GetCdpIDFromBytes = types.GetCdpIDFromBytes
|
|
CdpKey = types.CdpKey
|
|
SplitCdpKey = types.SplitCdpKey
|
|
DenomIterKey = types.DenomIterKey
|
|
SplitDenomIterKey = types.SplitDenomIterKey
|
|
DepositKey = types.DepositKey
|
|
SplitDepositKey = types.SplitDepositKey
|
|
DepositIterKey = types.DepositIterKey
|
|
SplitDepositIterKey = types.SplitDepositIterKey
|
|
CollateralRatioBytes = types.CollateralRatioBytes
|
|
CollateralRatioKey = types.CollateralRatioKey
|
|
SplitCollateralRatioKey = types.SplitCollateralRatioKey
|
|
CollateralRatioIterKey = types.CollateralRatioIterKey
|
|
SplitCollateralRatioIterKey = types.SplitCollateralRatioIterKey
|
|
NewMsgCreateCDP = types.NewMsgCreateCDP
|
|
NewMsgDeposit = types.NewMsgDeposit
|
|
NewMsgWithdraw = types.NewMsgWithdraw
|
|
NewMsgDrawDebt = types.NewMsgDrawDebt
|
|
NewMsgRepayDebt = types.NewMsgRepayDebt
|
|
NewParams = types.NewParams
|
|
DefaultParams = types.DefaultParams
|
|
ParamKeyTable = types.ParamKeyTable
|
|
NewQueryCdpsParams = types.NewQueryCdpsParams
|
|
NewQueryCdpParams = types.NewQueryCdpParams
|
|
NewQueryCdpDeposits = types.NewQueryCdpDeposits
|
|
NewQueryCdpsByRatioParams = types.NewQueryCdpsByRatioParams
|
|
ValidSortableDec = types.ValidSortableDec
|
|
SortableDecBytes = types.SortableDecBytes
|
|
ParseDecBytes = types.ParseDecBytes
|
|
RelativePow = types.RelativePow
|
|
|
|
// variable aliases
|
|
ModuleCdc = types.ModuleCdc
|
|
ErrCdpAlreadyExists = types.ErrCdpAlreadyExists
|
|
ErrInvalidCollateralLength = types.ErrInvalidCollateralLength
|
|
ErrCollateralNotSupported = types.ErrCollateralNotSupported
|
|
ErrDebtNotSupported = types.ErrDebtNotSupported
|
|
ErrExceedsDebtLimit = types.ErrExceedsDebtLimit
|
|
ErrInvalidCollateralRatio = types.ErrInvalidCollateralRatio
|
|
ErrCdpNotFound = types.ErrCdpNotFound
|
|
ErrDepositNotFound = types.ErrDepositNotFound
|
|
ErrInvalidDeposit = types.ErrInvalidDeposit
|
|
ErrInvalidPayment = types.ErrInvalidPayment
|
|
ErrDepositNotAvailable = types.ErrDepositNotAvailable
|
|
ErrInvalidWithdrawAmount = types.ErrInvalidWithdrawAmount
|
|
ErrCdpNotAvailable = types.ErrCdpNotAvailable
|
|
ErrBelowDebtFloor = types.ErrBelowDebtFloor
|
|
ErrLoadingAugmentedCDP = types.ErrLoadingAugmentedCDP
|
|
ErrInvalidDebtRequest = types.ErrInvalidDebtRequest
|
|
ErrDenomPrefixNotFound = types.ErrDenomPrefixNotFound
|
|
ErrPricefeedDown = types.ErrPricefeedDown
|
|
CdpIDKeyPrefix = types.CdpIDKeyPrefix
|
|
CdpKeyPrefix = types.CdpKeyPrefix
|
|
CollateralRatioIndexPrefix = types.CollateralRatioIndexPrefix
|
|
CdpIDKey = types.CdpIDKey
|
|
DebtDenomKey = types.DebtDenomKey
|
|
GovDenomKey = types.GovDenomKey
|
|
DepositKeyPrefix = types.DepositKeyPrefix
|
|
PrincipalKeyPrefix = types.PrincipalKeyPrefix
|
|
PreviousDistributionTimeKey = types.PreviousDistributionTimeKey
|
|
PricefeedStatusKeyPrefix = types.PricefeedStatusKeyPrefix
|
|
KeyGlobalDebtLimit = types.KeyGlobalDebtLimit
|
|
KeyCollateralParams = types.KeyCollateralParams
|
|
KeyDebtParam = types.KeyDebtParam
|
|
KeyDistributionFrequency = types.KeyDistributionFrequency
|
|
KeyCircuitBreaker = types.KeyCircuitBreaker
|
|
KeyDebtThreshold = types.KeyDebtThreshold
|
|
KeyDebtLot = types.KeyDebtLot
|
|
KeySurplusThreshold = types.KeySurplusThreshold
|
|
KeySurplusLot = types.KeySurplusLot
|
|
DefaultGlobalDebt = types.DefaultGlobalDebt
|
|
DefaultCircuitBreaker = types.DefaultCircuitBreaker
|
|
DefaultCollateralParams = types.DefaultCollateralParams
|
|
DefaultDebtParam = types.DefaultDebtParam
|
|
DefaultCdpStartingID = types.DefaultCdpStartingID
|
|
DefaultDebtDenom = types.DefaultDebtDenom
|
|
DefaultGovDenom = types.DefaultGovDenom
|
|
DefaultStableDenom = types.DefaultStableDenom
|
|
DefaultSurplusThreshold = types.DefaultSurplusThreshold
|
|
DefaultDebtThreshold = types.DefaultDebtThreshold
|
|
DefaultSurplusLot = types.DefaultSurplusLot
|
|
DefaultDebtLot = types.DefaultDebtLot
|
|
DefaultPreviousDistributionTime = types.DefaultPreviousDistributionTime
|
|
DefaultSavingsDistributionFrequency = types.DefaultSavingsDistributionFrequency
|
|
DefaultSavingsRateDistributed = types.DefaultSavingsRateDistributed
|
|
MaxSortableDec = types.MaxSortableDec
|
|
SavingsRateDistributedKey = types.SavingsRateDistributedKey
|
|
)
|
|
|
|
type (
|
|
Keeper = keeper.Keeper
|
|
CDP = types.CDP
|
|
CDPs = types.CDPs
|
|
AugmentedCDP = types.AugmentedCDP
|
|
AugmentedCDPs = types.AugmentedCDPs
|
|
Deposit = types.Deposit
|
|
Deposits = types.Deposits
|
|
GenesisState = types.GenesisState
|
|
MsgCreateCDP = types.MsgCreateCDP
|
|
MsgDeposit = types.MsgDeposit
|
|
MsgWithdraw = types.MsgWithdraw
|
|
MsgDrawDebt = types.MsgDrawDebt
|
|
MsgRepayDebt = types.MsgRepayDebt
|
|
Params = types.Params
|
|
CollateralParam = types.CollateralParam
|
|
CollateralParams = types.CollateralParams
|
|
DebtParam = types.DebtParam
|
|
DebtParams = types.DebtParams
|
|
QueryCdpsParams = types.QueryCdpsParams
|
|
QueryCdpParams = types.QueryCdpParams
|
|
QueryCdpDeposits = types.QueryCdpDeposits
|
|
QueryCdpsByRatioParams = types.QueryCdpsByRatioParams
|
|
)
|