Documentation ¶
Index ¶
- func CalculateDecreasingFactor(coinInfo types.Coin, amountInCollector sdkmath.Int, amountToBurn sdkmath.Int) sdk.Dec
- func EndBlocker(ctx sdk.Context, k Keeper, req abci.RequestEndBlock) []abci.ValidatorUpdate
- type Keeper
- func (k Keeper) BurnCoin(goCtx context.Context, msg *types.MsgBurnCoin) (*types.MsgBurnCoinResponse, error)
- func (k *Keeper) BurnPoolCoins(ctx sdk.Context, poolName string, coins sdk.Coins) error
- func (k Keeper) BuyCoin(goCtx context.Context, msg *types.MsgBuyCoin) (*types.MsgBuyCoinResponse, error)
- func (k Keeper) Check(c context.Context, req *types.QueryCheckRequest) (*types.QueryCheckResponse, error)
- func (k *Keeper) CheckFutureChanges(ctx sdk.Context, coinInfo types.Coin, amount sdkmath.Int) error
- func (k *Keeper) CheckFutureVolumeChanges(ctx sdk.Context, coinInfo types.Coin, amount sdkmath.Int) error
- func (k Keeper) Checks(c context.Context, req *types.QueryChecksRequest) (*types.QueryChecksResponse, error)
- func (k Keeper) Coin(c context.Context, req *types.QueryCoinRequest) (*types.QueryCoinResponse, error)
- func (k Keeper) Coins(c context.Context, req *types.QueryCoinsRequest) (*types.QueryCoinsResponse, error)
- func (k Keeper) CreateCoin(goCtx context.Context, msg *types.MsgCreateCoin) (*types.MsgCreateCoinResponse, error)
- func (k *Keeper) GetBaseDenom(ctx sdk.Context) string
- func (k *Keeper) GetCheck(ctx sdk.Context, checkHash []byte) (check types.Check, err error)
- func (k *Keeper) GetChecks(ctx sdk.Context) (checks []types.Check)
- func (k *Keeper) GetCoin(ctx sdk.Context, denom string) (coin types.Coin, err error)
- func (k *Keeper) GetCoins(ctx sdk.Context) (coins []types.Coin)
- func (k *Keeper) GetCommission(ctx sdk.Context, feeAmountBase sdkmath.Int) (feeAmount sdkmath.Int, denom string, err error)
- func (k *Keeper) GetDecreasingFactor(ctx sdk.Context, coin sdk.Coin) (sdk.Dec, error)
- func (k *Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k *Keeper) IsCheckRedeemed(ctx sdk.Context, check *types.Check) bool
- func (k *Keeper) IsCoinBase(ctx sdk.Context, denom string) bool
- func (k *Keeper) IsCoinExists(ctx sdk.Context, denom string) bool
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MultiSendCoin(goCtx context.Context, msg *types.MsgMultiSendCoin) (*types.MsgMultiSendCoinResponse, error)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RedeemCheck(goCtx context.Context, msg *types.MsgRedeemCheck) (*types.MsgRedeemCheckResponse, error)
- func (k Keeper) SellAllCoin(goCtx context.Context, msg *types.MsgSellAllCoin) (*types.MsgSellAllCoinResponse, error)
- func (k Keeper) SellCoin(goCtx context.Context, msg *types.MsgSellCoin) (*types.MsgSellCoinResponse, error)
- func (k Keeper) SendCoin(goCtx context.Context, msg *types.MsgSendCoin) (*types.MsgSendCoinResponse, error)
- func (k *Keeper) SetCheck(ctx sdk.Context, check *types.Check)
- func (k *Keeper) SetCoin(ctx sdk.Context, coin types.Coin)
- func (k *Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) UpdateCoin(goCtx context.Context, msg *types.MsgUpdateCoin) (*types.MsgUpdateCoinResponse, error)
- func (k *Keeper) UpdateCoinVR(ctx sdk.Context, denom string, volume sdkmath.Int, reserve sdkmath.Int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateDecreasingFactor ¶ added in v0.0.8
func CalculateDecreasingFactor(coinInfo types.Coin, amountInCollector sdkmath.Int, amountToBurn sdkmath.Int) sdk.Dec
Helper function for slashing in validator module CalculateDecreasingFactor checks future parameters for coin burn
func EndBlocker ¶ added in v0.1.0
func EndBlocker(ctx sdk.Context, k Keeper, req abci.RequestEndBlock) []abci.ValidatorUpdate
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine.
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey store.StoreKey, ps paramtypes.Subspace, ac auth.AccountKeeperI, fk feeTypes.FeeMarketKeeper, bk bank.Keeper, ) *Keeper
NewKeeper creates new Keeper instance.
func (Keeper) BurnCoin ¶ added in v0.0.8
func (k Keeper) BurnCoin(goCtx context.Context, msg *types.MsgBurnCoin) (*types.MsgBurnCoinResponse, error)
func (*Keeper) BurnPoolCoins ¶ added in v0.0.8
Special burn mainly for slashing in validator module It decrease both volume and reserve pool must be exists and must have burning right
func (Keeper) BuyCoin ¶
func (k Keeper) BuyCoin(goCtx context.Context, msg *types.MsgBuyCoin) (*types.MsgBuyCoinResponse, error)
func (Keeper) Check ¶
func (k Keeper) Check(c context.Context, req *types.QueryCheckRequest) (*types.QueryCheckResponse, error)
func (*Keeper) CheckFutureChanges ¶
Check than buy/sell/fee deduct operations will not violate coin constants: minimal volume, limit volume, minimal reserve It includes check balance of auth.FeeCollectorName Positive amount = buy = increase volume and reserve Negative amount = sell/deduct = decrease volume and reserve
func (*Keeper) CheckFutureVolumeChanges ¶ added in v0.0.8
func (k *Keeper) CheckFutureVolumeChanges(ctx sdk.Context, coinInfo types.Coin, amount sdkmath.Int) error
same as above, but check only volume need for burn operation, because this doest not change reserve
func (Keeper) Checks ¶
func (k Keeper) Checks(c context.Context, req *types.QueryChecksRequest) (*types.QueryChecksResponse, error)
func (Keeper) Coin ¶
func (k Keeper) Coin(c context.Context, req *types.QueryCoinRequest) (*types.QueryCoinResponse, error)
func (Keeper) Coins ¶
func (k Keeper) Coins(c context.Context, req *types.QueryCoinsRequest) (*types.QueryCoinsResponse, error)
func (Keeper) CreateCoin ¶
func (k Keeper) CreateCoin(goCtx context.Context, msg *types.MsgCreateCoin) (*types.MsgCreateCoinResponse, error)
func (*Keeper) GetBaseDenom ¶
GetBaseDenom returns base coin denomination.
func (*Keeper) GetCommission ¶
func (*Keeper) GetDecreasingFactor ¶ added in v0.0.8
func (*Keeper) IsCheckRedeemed ¶
IsCheckRedeemed returns true if provided check is marked as redeemed in KVStore.
func (*Keeper) IsCoinBase ¶
IsCoinBase returns true if specified denom is base icon.
func (*Keeper) IsCoinExists ¶ added in v0.0.8
GetCoin returns the coin if exists in KVStore.
func (Keeper) MultiSendCoin ¶
func (k Keeper) MultiSendCoin(goCtx context.Context, msg *types.MsgMultiSendCoin) (*types.MsgMultiSendCoinResponse, error)
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RedeemCheck ¶
func (k Keeper) RedeemCheck(goCtx context.Context, msg *types.MsgRedeemCheck) (*types.MsgRedeemCheckResponse, error)
func (Keeper) SellAllCoin ¶
func (k Keeper) SellAllCoin(goCtx context.Context, msg *types.MsgSellAllCoin) (*types.MsgSellAllCoinResponse, error)
func (Keeper) SellCoin ¶
func (k Keeper) SellCoin(goCtx context.Context, msg *types.MsgSellCoin) (*types.MsgSellCoinResponse, error)
func (Keeper) SendCoin ¶
func (k Keeper) SendCoin(goCtx context.Context, msg *types.MsgSendCoin) (*types.MsgSendCoinResponse, error)
SendCoin creates new custom coin.
func (Keeper) UpdateCoin ¶
func (k Keeper) UpdateCoin(goCtx context.Context, msg *types.MsgUpdateCoin) (*types.MsgUpdateCoinResponse, error)