overseer

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetAllCollateralsResponse

type GetAllCollateralsResponse struct {
	Height         cosmostypes.Uint `json:"-"`
	AllCollaterals []struct {
		Borrower    cosmostypes.AccAddress `json:"borrower"`
		Collaterals []types.TokensHuman    `json:"collaterals"`
	} `json:"all_collaterals"`
}

type GetBorrowLimitResponse

type GetBorrowLimitResponse struct {
	Height      cosmostypes.Uint       `json:"-"`
	Borrower    cosmostypes.AccAddress `json:"borrower"`
	BorrowLimit cosmostypes.Int        `json:"borrow_limit"`
}

type GetCollateralsResponse

type GetCollateralsResponse struct {
	Height      cosmostypes.Uint       `json:"-"`
	Borrower    cosmostypes.AccAddress `json:"borrower"`
	Collaterals []types.TokensHuman    `json:"collaterals"`
}

type GetConfigResponse

type GetConfigResponse struct {
	Height                 cosmostypes.Uint       `json:"-"`
	OwnerAddr              cosmostypes.AccAddress `json:"owner_addr"`
	OracleContract         cosmostypes.AccAddress `json:"oracle_contract"`
	MarketContract         cosmostypes.AccAddress `json:"market_contract"`
	LiquidationContract    cosmostypes.AccAddress `json:"liquidation_contract"`
	CollectorContract      cosmostypes.AccAddress `json:"collector_contract"`
	DistributionThreshold  cosmostypes.Dec        `json:"distribution_threshold"`
	TargetDepositRate      cosmostypes.Dec        `json:"target_deposit_rate"`
	BufferDistributionRate cosmostypes.Dec        `json:"buffer_distribution_rate"`
	ANCPurchaseFactor      cosmostypes.Dec        `json:"anc_purchase_factor"`
	StableDenom            string                 `json:"stable_denom"`
	EpochPeriod            cosmostypes.Uint       `json:"epoch_period"`
	PriceTimeFrame         cosmostypes.Uint       `json:"price_time_frame"`
}

type GetDistributionParamsResponse

type GetDistributionParamsResponse struct {
	Height               cosmostypes.Uint `json:"-"`
	DepositRate          cosmostypes.Dec  `json:"deposit_rate"`
	TargetDepositRate    cosmostypes.Dec  `json:"target_deposit_rate"`
	ThresholdDepositRate cosmostypes.Dec  `json:"threshold_deposit_rate"`
}

type GetEpochStateResponse

type GetEpochStateResponse struct {
	Height             cosmostypes.Uint `json:"-"`
	DepositRate        cosmostypes.Dec  `json:"deposit_rate"`
	PrevATerraSupply   cosmostypes.Uint `json:"prev_a_terra_supply"`
	PrevExchangeRate   cosmostypes.Dec  `json:"prev_exchange_rate"`
	LastExecutedHeight cosmostypes.Uint `json:"last_executed_height"`
}

type GetWhitelistResponse

type GetWhitelistResponse struct {
	Height          cosmostypes.Uint       `json:"-"`
	Name            string                 `json:"name"`
	Symbol          string                 `json:"symbol"`
	MaxLTV          cosmostypes.Dec        `json:"max_ltv"`
	CustodyContract cosmostypes.AccAddress `json:"custody_contract"`
	CollateralToken cosmostypes.AccAddress `json:"collateral_token"`
}

type Overseer

type Overseer interface {
	bind.BaseContract
}

func NewContract

func NewContract(ctx context.Context, addr cosmostypes.AccAddress, client terra.Client) (Overseer, error)

type Querier

type Querier interface {
	GetConfig(ctx context.Context) (GetConfigResponse, error)
	GetEpochState(ctx context.Context) (GetEpochStateResponse, error)
	GetWhitelist(
		ctx context.Context,
		collateral *cosmostypes.AccAddress,
		startAfter *cosmostypes.AccAddress,
		limit *uint32,
	) (GetWhitelistResponse, error)
	GetCollaterals(
		ctx context.Context,
		borrower cosmostypes.AccAddress,
	) (GetCollateralsResponse, error)
	GetAllCollaterals(
		ctx context.Context,
		startAfter *cosmostypes.AccAddress,
		limit *uint32,
	) (GetAllCollateralsResponse, error)
	GetDistributionParams(ctx context.Context) (GetDistributionParamsResponse, error)
	GetBorrowLimit(
		ctx context.Context,
		borrower cosmostypes.AccAddress,
		blockTime *uint64,
	) (GetBorrowLimitResponse, error)
}

Jump to

Keyboard shortcuts

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