Documentation ¶
Index ¶
- func KeyTotalOutflows(ibcDenom string) []byte
- func NewMsgServerImpl(kb Builder) uibc.MsgServer
- type Builder
- type Keeper
- func (k Keeper) CheckAndUpdateQuota(denom string, newOutflow sdkmath.Int) error
- func (k Keeper) CheckIBCInflow(ctx sdk.Context, packet channeltypes.Packet, dataDenom string, ...) exported.Acknowledgement
- func (k Keeper) GetAllOutflows() (sdk.DecCoins, error)
- func (k Keeper) GetExpire() (*time.Time, error)
- func (k Keeper) GetParams() (params uibc.Params)
- func (k Keeper) GetTokenOutflows(denom string) sdk.DecCoin
- func (k Keeper) GetTotalOutflow() sdk.Dec
- func (k Keeper) PrefixStore(prefix []byte) store.KVStore
- func (k Keeper) ResetAllQuotas() error
- func (k Keeper) SetExpire(expires time.Time) error
- func (k Keeper) SetIBCStatus(ibcStatus uibc.IBCTransferStatus) error
- func (k Keeper) SetParams(params uibc.Params) error
- func (k Keeper) SetTokenOutflow(outflow sdk.DecCoin)
- func (k Keeper) SetTokenOutflows(outflows sdk.DecCoins)
- func (k Keeper) SetTotalOutflowSum(amount sdk.Dec)
- func (k Keeper) UndoUpdateQuota(denom string, amount sdkmath.Int) error
- func (k Keeper) UpdateQuotaParams(totalQuota, quotaPerDenom sdk.Dec, quotaDuration time.Duration, ...) error
- type Querier
- func (q Querier) AllOutflows(goCtx context.Context, _ *uibc.QueryAllOutflows) (*uibc.QueryAllOutflowsResponse, error)
- func (q Querier) Outflows(goCtx context.Context, req *uibc.QueryOutflows) (*uibc.QueryOutflowsResponse, error)
- func (q Querier) Params(goCtx context.Context, _ *uibc.QueryParams) (*uibc.QueryParamsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyTotalOutflows ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of uibc.MsgServer
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder constructs Keeper by perparing all related dependencies (notably the store).
func NewKeeperBuilder ¶
func NewKeeperBuilder( cdc codec.BinaryCodec, key storetypes.StoreKey, leverage uibc.Leverage, oracle uibc.Oracle, ugov ugov.EmergencyGroupBuilder, ) Builder
func (Builder) ExportGenesis ¶
func (kb Builder) ExportGenesis(ctx sdk.Context) *uibc.GenesisState
ExportGenesis returns the x/uibc module's exported genesis state.
func (Builder) InitGenesis ¶
func (kb Builder) InitGenesis(ctx sdk.Context, genState uibc.GenesisState)
InitGenesis initializes the x/uibc module's state from a provided genesis state.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) CheckAndUpdateQuota ¶
CheckAndUpdateQuota checks if adding a newOutflow doesn't exceed the max quota and updates the current quota metrics.
func (Keeper) CheckIBCInflow ¶
func (k Keeper) CheckIBCInflow(ctx sdk.Context, packet channeltypes.Packet, dataDenom string, isSourceChain bool, ) exported.Acknowledgement
CheckIBCInflow validates if inflow token is registered in x/leverage
func (Keeper) GetAllOutflows ¶
GetAllOutflows returns sum of outflows of all tokens in USD value.
func (Keeper) GetTokenOutflows ¶
GetTokenOutflows returns sum of denom outflows in USD value in the DecCoin structure.
func (Keeper) GetTotalOutflow ¶
GetTotalOutflow returns the total outflow of ibc-transfer amount.
func (Keeper) PrefixStore ¶
PrefixStore creates an new prefix store. It will automatically remove provided prefix from keys when using with the iterator.
func (Keeper) ResetAllQuotas ¶
ResetAllQuotas will zero the ibc-transfer quotas
func (Keeper) SetIBCStatus ¶
func (k Keeper) SetIBCStatus(ibcStatus uibc.IBCTransferStatus) error
SetIBCStatus update the ibc-transfer status in module params.
func (Keeper) SetTokenOutflow ¶
SetTokenOutflow save the outflows of denom into store.
func (Keeper) SetTokenOutflows ¶
SetTokenOutflows saves provided updated IBC outflows as a pair: USD value, denom name in the DecCoin structure.
func (Keeper) SetTotalOutflowSum ¶
SetTotalOutflowSum save the total outflow of ibc-transfer amount.
func (Keeper) UndoUpdateQuota ¶
UndoUpdateQuota subtracts `amount` from quota metric of the ibc denom.
type Querier ¶
type Querier struct {
Builder
}
Querier implements a QueryServer for the x/uibc module.
func NewQuerier ¶
func (Querier) AllOutflows ¶
func (q Querier) AllOutflows(goCtx context.Context, _ *uibc.QueryAllOutflows) ( *uibc.QueryAllOutflowsResponse, error, )
AllOutflows queries outflows for all denom in the current period.
func (Querier) Outflows ¶
func (q Querier) Outflows(goCtx context.Context, req *uibc.QueryOutflows) ( *uibc.QueryOutflowsResponse, error, )
Outflows queries denom outflows in the current period. If req.Denom is not set, then we return total outflows.
func (Querier) Params ¶
func (q Querier) Params(goCtx context.Context, _ *uibc.QueryParams) ( *uibc.QueryParamsResponse, error, )
Params returns params of the x/uibc module.