Documentation ¶
Index ¶
- Constants
- func NewQuerier(keeper Keeper) sdk.Querier
- type DayInfo
- type Info
- type Keeper
- func (k Keeper) AppendTodayCoinPrice(ctx sdk.Context, coinId int64, price int64)
- func (k Keeper) EscrowBetCollateral(ctx sdk.Context, buyer sdk.AccAddress, amount sdk.Coins) error
- func (k Keeper) GetChannel(ctx sdk.Context, chainName string, port string) (string, error)
- func (k Keeper) GetDayCoinBettorAmount(ctx sdk.Context, dayId int64, coinId int64, bettor string) int64
- func (k Keeper) GetDayCoinBettorPaid(ctx sdk.Context, dayId int64, coinId int64, bettor string) bool
- func (k Keeper) GetDayCoinInfo(ctx sdk.Context, dayId int64, coinId int64) *types.BetDayCoin
- func (k Keeper) GetDayCoinPrices(ctx sdk.Context, dayId int64, coinId int64) []int64
- func (k Keeper) GetDayCoinRanking(ctx sdk.Context, dayId int64) []uint8
- func (k Keeper) GetDayInfo(ctx sdk.Context, dayId int64) *types.BetDay
- func (k Keeper) GetDayState(ctx sdk.Context, dayId int64) uint8
- func (k Keeper) GetDayWinAmount(ctx sdk.Context, dayId int64, winningCoinId int64, bettor string) int64
- func (k Keeper) GetLatestCoinPrice(ctx sdk.Context, coinId int64) int64
- func (k Keeper) GetTotalBetsAmount(ctx sdk.Context) int64
- func (k Keeper) GetTotalWinsAmount(ctx sdk.Context) int64
- func (k Keeper) GetWinningDayCoinId(ctx sdk.Context, dayId int64) uint8
- func (k Keeper) HasChannel(ctx sdk.Context, chainName string, port string) bool
- func (k Keeper) Payout(ctx sdk.Context, buyer sdk.AccAddress, amount sdk.Coins)
- func (k Keeper) SetChannel(ctx sdk.Context, chainName string, port string, channel string)
- func (k Keeper) SetDayCoinBettorAmount(ctx sdk.Context, dayId int64, coinId int64, bettor string, amount int64)
- func (k Keeper) SetDayCoinBettorPaid(ctx sdk.Context, dayId int64, coinId int64, bettor string, paid bool)
- func (k Keeper) SetDayCoinInfo(ctx sdk.Context, dayId int64, coinId int64, dayCoin *types.BetDayCoin)
- func (k Keeper) SetDayCoinPrices(ctx sdk.Context, dayId int64, coinId int64, prices []int64)
- func (k Keeper) SetDayInfo(ctx sdk.Context, dayId int64, day *types.BetDay)
- func (k Keeper) SetLatestCoinPrice(ctx sdk.Context, coinId int64, price int64)
- func (k Keeper) SetTotalBetsAmount(ctx sdk.Context, amount int64)
- func (k Keeper) SetTotalWinsAmount(ctx sdk.Context, amount int64)
- type MyDayInfo
- type MyInfo
Constants ¶
View Source
const ( QueryTodayCoinPrices = "today-coin-prices" QueryInfo = "info" QueryDayInfo = "day-info" )
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
NewQuerier is the module level router for state queries.
Types ¶
type Keeper ¶
type Keeper struct { BankKeeper types.BankKeeper ChannelKeeper types.ChannelKeeper // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, bankKeeper types.BankKeeper, channelKeeper types.ChannelKeeper, ) Keeper
NewKeeper creates a new band consumer Keeper instance.
func (Keeper) AppendTodayCoinPrice ¶
Append price to existing list of prices of a coin
func (Keeper) EscrowBetCollateral ¶
func (Keeper) GetChannel ¶
func (Keeper) GetDayCoinBettorAmount ¶
func (Keeper) GetDayCoinBettorPaid ¶
func (Keeper) GetDayCoinInfo ¶
func (Keeper) GetDayCoinPrices ¶
Get list of all prices of a coin in a particular day
func (Keeper) GetDayCoinRanking ¶
func (Keeper) GetDayWinAmount ¶
func (k Keeper) GetDayWinAmount(ctx sdk.Context, dayId int64, winningCoinId int64, bettor string) int64
Todo: better algo that also takes into account the other coins
func (Keeper) GetLatestCoinPrice ¶
Get last price of a coin
func (Keeper) GetWinningDayCoinId ¶
func (Keeper) HasChannel ¶
func (Keeper) SetChannel ¶
func (Keeper) SetDayCoinBettorAmount ¶
func (Keeper) SetDayCoinBettorPaid ¶
func (Keeper) SetDayCoinInfo ¶
func (Keeper) SetDayCoinPrices ¶
Set prices of a coin in a particular day
func (Keeper) SetDayInfo ¶
func (Keeper) SetLatestCoinPrice ¶
Store last price of a coin
func (Keeper) SetTotalBetsAmount ¶
Click to show internal directories.
Click to hide internal directories.