Documentation ¶
Index ¶
- func ModuleAddr() sdk.AccAddress
- func NewMsgServerImpl(kb Builder) metoken.MsgServer
- type Builder
- type Keeper
- func (k Keeper) ClaimLeverageInterest() error
- func (k Keeper) ExportGenesis() *metoken.GenesisState
- func (k Keeper) GetAllIndexesBalances() []metoken.IndexBalances
- func (k Keeper) GetAllRegisteredIndexes() []metoken.Index
- func (k Keeper) GetParams() metoken.Params
- func (k Keeper) IndexBalances(meTokenDenom string) (metoken.IndexBalances, error)
- func (k Keeper) InitGenesis(genState metoken.GenesisState)
- func (k Keeper) Logger() log.Logger
- func (k Keeper) Prices(index metoken.Index) (metoken.IndexPrices, error)
- func (k Keeper) RebalanceReserves() error
- func (k Keeper) RegisteredIndex(meTokenDenom string) (metoken.Index, error)
- func (k Keeper) SetParams(params metoken.Params) error
- func (k Keeper) UpdateIndexes(addIndexes []metoken.Index, updateIndexes []metoken.Index) error
- type Querier
- func (q Querier) IndexBalances(goCtx context.Context, req *metoken.QueryIndexBalances) (*metoken.QueryIndexBalancesResponse, error)
- func (q Querier) IndexPrices(goCtx context.Context, req *metoken.QueryIndexPrices) (*metoken.QueryIndexPricesResponse, error)
- func (q Querier) Indexes(goCtx context.Context, req *metoken.QueryIndexes) (*metoken.QueryIndexesResponse, error)
- func (q Querier) Params(goCtx context.Context, _ *metoken.QueryParams) (*metoken.QueryParamsResponse, error)
- func (q Querier) RedeemFee(goCtx context.Context, req *metoken.QueryRedeemFee) (*metoken.QueryRedeemFeeResponse, error)
- func (q Querier) SwapFee(goCtx context.Context, req *metoken.QuerySwapFee) (*metoken.QuerySwapFeeResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ModuleAddr ¶
func ModuleAddr() sdk.AccAddress
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of MsgServer for the x/metoken module.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder constructs Keeper by preparing all related dependencies (notably the store).
func NewKeeperBuilder ¶
func NewKeeperBuilder( cdc codec.Codec, storeKey storetypes.StoreKey, bankKeeper metoken.BankKeeper, leverageKeeper metoken.LeverageKeeper, oracleKeeper metoken.OracleKeeper, ) Builder
NewKeeperBuilder returns Builder object.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) ClaimLeverageInterest ¶
ClaimLeverageInterest sends accrued interest from x/leverage module to x/metoken account.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis() *metoken.GenesisState
ExportGenesis returns the x/metoken module's exported genesis state.
func (Keeper) GetAllIndexesBalances ¶
func (k Keeper) GetAllIndexesBalances() []metoken.IndexBalances
GetAllIndexesBalances returns asset balances of every Index
func (Keeper) GetAllRegisteredIndexes ¶
GetAllRegisteredIndexes returns all the registered Indexes from the x/metoken module's KVStore.
func (Keeper) IndexBalances ¶
func (k Keeper) IndexBalances(meTokenDenom string) (metoken.IndexBalances, error)
IndexBalances returns Index Token supply, if it's not found returns an error.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(genState metoken.GenesisState)
InitGenesis initializes the x/metoken module's state from a provided genesis state.
func (Keeper) Prices ¶
Prices calculates meToken price as an avg of median prices of all index accepted assets.
func (Keeper) RebalanceReserves ¶
RebalanceReserves checks if the portion of reserves is below the desired and transfer the missing amount from x/leverage to x/metoken reserves, or vice versa.
func (Keeper) RegisteredIndex ¶
RegisteredIndex gets an Index from the x/metoken module's KVStore, if not found returns an error.
type Querier ¶
type Querier struct {
Builder
}
Querier implements a QueryServer for the x/metoken module.
func (Querier) IndexBalances ¶
func (q Querier) IndexBalances( goCtx context.Context, req *metoken.QueryIndexBalances, ) (*metoken.QueryIndexBalancesResponse, error)
IndexBalances returns balances from the x/metoken module. If index balance denom is not specified, returns all the balances.
func (Querier) IndexPrices ¶
func (q Querier) IndexPrices( goCtx context.Context, req *metoken.QueryIndexPrices, ) (*metoken.QueryIndexPricesResponse, error)
IndexPrices returns Index price from the x/metoken module. If index denom is not specified, returns prices for all the registered indexes.
func (Querier) Indexes ¶
func (q Querier) Indexes(goCtx context.Context, req *metoken.QueryIndexes) (*metoken.QueryIndexesResponse, error)
Indexes returns registered indexes in the x/metoken module. If index denom is not specified, returns all the registered indexes.
func (Querier) Params ¶
func (q Querier) Params(goCtx context.Context, _ *metoken.QueryParams) (*metoken.QueryParamsResponse, error)
Params returns params of the x/metoken module.
func (Querier) RedeemFee ¶
func (q Querier) RedeemFee(goCtx context.Context, req *metoken.QueryRedeemFee) ( *metoken.QueryRedeemFeeResponse, error, )
RedeemFee returns the fee for the redeem operation, given a specific amount of meTokens and the asset denom.
func (Querier) SwapFee ¶
func (q Querier) SwapFee(goCtx context.Context, req *metoken.QuerySwapFee) (*metoken.QuerySwapFeeResponse, error)
SwapFee returns the fee for the swap operation, given a specific amount of tokens and the meToken denom.