Documentation ¶
Index ¶
- Constants
- Variables
- func NewQuerier(keeper Keeper) sdk.Querier
- type BancorInfo
- type BancorInfoDisplay
- type BancorInfoKeeper
- func (keeper *BancorInfoKeeper) GetParams(ctx sdk.Context) (param types.Params)
- func (keeper *BancorInfoKeeper) Iterate(ctx sdk.Context, biProc func(bi *BancorInfo))
- func (keeper *BancorInfoKeeper) Load(ctx sdk.Context, symbol string) *BancorInfo
- func (keeper *BancorInfoKeeper) Remove(ctx sdk.Context, bi *BancorInfo)
- func (keeper *BancorInfoKeeper) Save(ctx sdk.Context, bi *BancorInfo)
- func (keeper *BancorInfoKeeper) SetParams(ctx sdk.Context, params types.Params)
- type Keeper
- func (keeper *Keeper) DeductFee(ctx sdk.Context, acc sdk.AccAddress, amt sdk.Coins) sdk.Error
- func (keeper *Keeper) DeductInt64CetFee(ctx sdk.Context, addr sdk.AccAddress, amt int64) sdk.Error
- func (keeper *Keeper) FreezeCoins(ctx sdk.Context, acc sdk.AccAddress, amt sdk.Coins) sdk.Error
- func (keeper *Keeper) GetAllBancorInfos(ctx sdk.Context) (list []*BancorInfo)
- func (keeper *Keeper) GetMarketFeeMin(ctx sdk.Context) int64
- func (keeper *Keeper) GetMarketVolume(ctx sdk.Context, stock, money string, stockVolume, moneyVolume sdk.Dec) sdk.Dec
- func (keeper *Keeper) GetParams(ctx sdk.Context) (param types.Params)
- func (keeper *Keeper) GetRebate(ctx sdk.Context, address sdk.AccAddress, total sdk.Int) (acc sdk.AccAddress, rebate, balance sdk.Int, exist bool)
- func (keeper *Keeper) GetRebateRatio(ctx sdk.Context) int64
- func (keeper *Keeper) GetRebateRatioBase(ctx sdk.Context) int64
- func (keeper *Keeper) GetRefereeAddr(ctx sdk.Context, accAddr sdk.AccAddress) sdk.AccAddress
- func (keeper Keeper) IsBancorExist(ctx sdk.Context, stock string) bool
- func (keeper *Keeper) IsForbiddenByTokenIssuer(ctx sdk.Context, denom string, addr sdk.AccAddress) bool
- func (keeper *Keeper) IsMarketExist(ctx sdk.Context, symbol string) bool
- func (keeper *Keeper) IsSubscribed(topic string) bool
- func (keeper *Keeper) IsTokenExists(ctx sdk.Context, denom string) bool
- func (keeper *Keeper) IsTokenIssuer(ctx sdk.Context, denom string, addr sdk.AccAddress) bool
- func (keeper *Keeper) Iterate(ctx sdk.Context, biProc func(bi *BancorInfo))
- func (keeper *Keeper) Load(ctx sdk.Context, symbol string) *BancorInfo
- func (keeper *Keeper) Remove(ctx sdk.Context, bi *BancorInfo)
- func (keeper *Keeper) Save(ctx sdk.Context, bi *BancorInfo)
- func (keeper *Keeper) SendCoins(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, amt sdk.Coins) sdk.Error
- func (keeper *Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (keeper *Keeper) UnFreezeCoins(ctx sdk.Context, acc sdk.AccAddress, amt sdk.Coins) sdk.Error
- type QueryBancorInfoParam
Constants ¶
View Source
const ( QueryBancorInfo = "bancor-info" QueryParameters = "parameters" QueryBancors = "bancor-list" )
Variables ¶
View Source
var ( BancorInfoKey = []byte{0x10} BancorInfoKeyEnd = []byte{0x11} )
Functions ¶
func NewQuerier ¶
creates a querier for asset REST endpoints
Types ¶
type BancorInfo ¶
type BancorInfo struct { Owner sdk.AccAddress `json:"sender"` Stock string `json:"stock"` Money string `json:"money"` InitPrice sdk.Dec `json:"init_price"` MaxSupply sdk.Int `json:"max_supply"` StockPrecision byte `json:"stock_precision"` MaxPrice sdk.Dec `json:"max_price"` MaxMoney sdk.Int `json:"max_money"` // DEX2 AR int64 `json:"ar"` // DEX2 Price sdk.Dec `json:"price"` StockInPool sdk.Int `json:"stock_in_pool"` MoneyInPool sdk.Int `json:"money_in_pool"` EarliestCancelTime int64 `json:"earliest_cancel_time"` }
func (*BancorInfo) GetSymbol ¶
func (bi *BancorInfo) GetSymbol() string
func (*BancorInfo) IsConsistent ¶
func (bi *BancorInfo) IsConsistent() bool
func (*BancorInfo) UpdateStockInPool ¶
func (bi *BancorInfo) UpdateStockInPool(stockInPool sdk.Int) bool
type BancorInfoDisplay ¶
type BancorInfoDisplay struct { Owner string `json:"owner"` Stock string `json:"stock"` Money string `json:"money"` InitPrice string `json:"init_price"` MaxSupply string `json:"max_supply"` StockPrecision string `json:"stock_precision"` MaxPrice string `json:"max_price"` MaxMoney string `json:"max_money"` AR string `json:"ar"` CurrentPrice string `json:"current_price"` StockInPool string `json:"stock_in_pool"` MoneyInPool string `json:"money_in_pool"` EarliestCancelTime int64 `json:"earliest_cancel_time"` }
func NewBancorInfoDisplay ¶
func NewBancorInfoDisplay(bi *BancorInfo) BancorInfoDisplay
type BancorInfoKeeper ¶
type BancorInfoKeeper struct {
// contains filtered or unexported fields
}
func NewBancorInfoKeeper ¶
func (*BancorInfoKeeper) GetParams ¶
func (keeper *BancorInfoKeeper) GetParams(ctx sdk.Context) (param types.Params)
func (*BancorInfoKeeper) Iterate ¶
func (keeper *BancorInfoKeeper) Iterate(ctx sdk.Context, biProc func(bi *BancorInfo))
func (*BancorInfoKeeper) Load ¶
func (keeper *BancorInfoKeeper) Load(ctx sdk.Context, symbol string) *BancorInfo
key: stock/money pair
func (*BancorInfoKeeper) Remove ¶
func (keeper *BancorInfoKeeper) Remove(ctx sdk.Context, bi *BancorInfo)
func (*BancorInfoKeeper) Save ¶
func (keeper *BancorInfoKeeper) Save(ctx sdk.Context, bi *BancorInfo)
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(bik *BancorInfoKeeper, bxk types.ExpectedBankxKeeper, ask types.ExpectedAssetStatusKeeper, mk types.ExpectedMarketKeeper, axk types.ExpectedAuthXKeeper, mq msgqueue.MsgSender) Keeper
func (*Keeper) DeductInt64CetFee ¶
func (*Keeper) FreezeCoins ¶
func (*Keeper) GetAllBancorInfos ¶
func (keeper *Keeper) GetAllBancorInfos(ctx sdk.Context) (list []*BancorInfo)
func (*Keeper) GetMarketVolume ¶
func (*Keeper) GetRefereeAddr ¶
func (keeper *Keeper) GetRefereeAddr(ctx sdk.Context, accAddr sdk.AccAddress) sdk.AccAddress
func (Keeper) IsBancorExist ¶
func (*Keeper) IsForbiddenByTokenIssuer ¶
func (*Keeper) IsMarketExist ¶
func (*Keeper) IsSubscribed ¶
func (*Keeper) IsTokenExists ¶
func (*Keeper) IsTokenIssuer ¶
func (*Keeper) Iterate ¶
func (keeper *Keeper) Iterate(ctx sdk.Context, biProc func(bi *BancorInfo))
type QueryBancorInfoParam ¶
type QueryBancorInfoParam struct {
Symbol string `json:"symbol"`
}
Click to show internal directories.
Click to hide internal directories.