Documentation ¶
Index ¶
- Constants
- func OnLoad()
- type ArrayOfImmutableBet
- type ArrayOfMutableBet
- type Bet
- type ForcePayoutCall
- type ForcePayoutContext
- type ForceResetCall
- type ForceResetContext
- type Funcs
- func (sc Funcs) ForcePayout(ctx wasmlib.ScFuncCallContext) *ForcePayoutCall
- func (sc Funcs) ForceReset(ctx wasmlib.ScFuncCallContext) *ForceResetCall
- func (sc Funcs) LastWinningNumber(ctx wasmlib.ScViewCallContext) *LastWinningNumberCall
- func (sc Funcs) PayWinners(ctx wasmlib.ScFuncCallContext) *PayWinnersCall
- func (sc Funcs) PlaceBet(ctx wasmlib.ScFuncCallContext) *PlaceBetCall
- func (sc Funcs) PlayPeriod(ctx wasmlib.ScFuncCallContext) *PlayPeriodCall
- func (sc Funcs) RoundNumber(ctx wasmlib.ScViewCallContext) *RoundNumberCall
- func (sc Funcs) RoundStartedAt(ctx wasmlib.ScViewCallContext) *RoundStartedAtCall
- func (sc Funcs) RoundStatus(ctx wasmlib.ScViewCallContext) *RoundStatusCall
- type ImmutableBet
- type ImmutableFairRouletteState
- func (s ImmutableFairRouletteState) Bets() ArrayOfImmutableBet
- func (s ImmutableFairRouletteState) LastWinningNumber() wasmlib.ScImmutableInt64
- func (s ImmutableFairRouletteState) PlayPeriod() wasmlib.ScImmutableInt32
- func (s ImmutableFairRouletteState) RoundNumber() wasmlib.ScImmutableInt64
- func (s ImmutableFairRouletteState) RoundStartedAt() wasmlib.ScImmutableInt32
- func (s ImmutableFairRouletteState) RoundStatus() wasmlib.ScImmutableInt16
- type ImmutableLastWinningNumberResults
- type ImmutablePlaceBetParams
- type ImmutablePlayPeriodParams
- type ImmutableRoundNumberResults
- type ImmutableRoundStartedAtResults
- type ImmutableRoundStatusResults
- type LastWinningNumberCall
- type LastWinningNumberContext
- type MutableBet
- type MutableFairRouletteState
- func (s MutableFairRouletteState) Bets() ArrayOfMutableBet
- func (s MutableFairRouletteState) LastWinningNumber() wasmlib.ScMutableInt64
- func (s MutableFairRouletteState) PlayPeriod() wasmlib.ScMutableInt32
- func (s MutableFairRouletteState) RoundNumber() wasmlib.ScMutableInt64
- func (s MutableFairRouletteState) RoundStartedAt() wasmlib.ScMutableInt32
- func (s MutableFairRouletteState) RoundStatus() wasmlib.ScMutableInt16
- type MutableLastWinningNumberResults
- type MutablePlaceBetParams
- type MutablePlayPeriodParams
- type MutableRoundNumberResults
- type MutableRoundStartedAtResults
- type MutableRoundStatusResults
- type PayWinnersCall
- type PayWinnersContext
- type PlaceBetCall
- type PlaceBetContext
- type PlayPeriodCall
- type PlayPeriodContext
- type RoundNumberCall
- type RoundNumberContext
- type RoundStartedAtCall
- type RoundStartedAtContext
- type RoundStatusCall
- type RoundStatusContext
Constants ¶
View Source
const ( ScName = "fairroulette" HScName = wasmlib.ScHname(0xdf79d138) )
View Source
const ( ParamNumber = wasmlib.Key("number") ParamPlayPeriod = wasmlib.Key("playPeriod") )
View Source
const ( ResultLastWinningNumber = wasmlib.Key("lastWinningNumber") ResultRoundNumber = wasmlib.Key("roundNumber") ResultRoundStartedAt = wasmlib.Key("roundStartedAt") ResultRoundStatus = wasmlib.Key("roundStatus") )
View Source
const ( StateBets = wasmlib.Key("bets") StateLastWinningNumber = wasmlib.Key("lastWinningNumber") StatePlayPeriod = wasmlib.Key("playPeriod") StateRoundNumber = wasmlib.Key("roundNumber") StateRoundStartedAt = wasmlib.Key("roundStartedAt") StateRoundStatus = wasmlib.Key("roundStatus") )
View Source
const ( FuncForcePayout = "forcePayout" FuncForceReset = "forceReset" FuncPayWinners = "payWinners" FuncPlaceBet = "placeBet" FuncPlayPeriod = "playPeriod" ViewLastWinningNumber = "lastWinningNumber" ViewRoundNumber = "roundNumber" ViewRoundStartedAt = "roundStartedAt" ViewRoundStatus = "roundStatus" )
View Source
const ( HFuncForcePayout = wasmlib.ScHname(0x555a4c4f) HFuncForceReset = wasmlib.ScHname(0xa331951e) HFuncPayWinners = wasmlib.ScHname(0xfb2b0144) HFuncPlaceBet = wasmlib.ScHname(0xdfba7d1b) HFuncPlayPeriod = wasmlib.ScHname(0xcb94b293) HViewLastWinningNumber = wasmlib.ScHname(0x2f5f09fe) HViewRoundNumber = wasmlib.ScHname(0x0dcfe520) HViewRoundStartedAt = wasmlib.ScHname(0x725de8b4) HViewRoundStatus = wasmlib.ScHname(0x145053b5) )
View Source
const ( IdxParamNumber = 0 IdxParamPlayPeriod = 1 IdxResultLastWinningNumber = 2 IdxResultRoundNumber = 3 IdxResultRoundStartedAt = 4 IdxResultRoundStatus = 5 IdxStateBets = 6 IdxStateLastWinningNumber = 7 IdxStatePlayPeriod = 8 IdxStateRoundNumber = 9 IdxStateRoundStartedAt = 10 IdxStateRoundStatus = 11 )
View Source
const DefaultPlayPeriod = 60
The default playing period of one betting round in seconds.
View Source
const EnableSelfPost = true
Enable this if you deploy the contract to an actual node. It will pay out the prize after a certain timeout.
View Source
const MaxNumber = 8
The maximum number one can bet on. The range of numbers starts at 1.
View Source
const NanoTimeDivider = 1000_000_000
The number to divide nano seconds to seconds.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArrayOfImmutableBet ¶
type ArrayOfImmutableBet struct {
// contains filtered or unexported fields
}
func (ArrayOfImmutableBet) GetBet ¶
func (a ArrayOfImmutableBet) GetBet(index int32) ImmutableBet
func (ArrayOfImmutableBet) Length ¶
func (a ArrayOfImmutableBet) Length() int32
type ArrayOfMutableBet ¶
type ArrayOfMutableBet struct {
// contains filtered or unexported fields
}
func (ArrayOfMutableBet) Clear ¶
func (a ArrayOfMutableBet) Clear()
func (ArrayOfMutableBet) GetBet ¶
func (a ArrayOfMutableBet) GetBet(index int32) MutableBet
func (ArrayOfMutableBet) Length ¶
func (a ArrayOfMutableBet) Length() int32
type Bet ¶
func NewBetFromBytes ¶
type ForcePayoutCall ¶
type ForcePayoutContext ¶
type ForcePayoutContext struct {
State MutableFairRouletteState
}
type ForceResetCall ¶
type ForceResetContext ¶
type ForceResetContext struct {
State MutableFairRouletteState
}
type Funcs ¶
type Funcs struct{}
var ScFuncs Funcs
func (Funcs) ForcePayout ¶
func (sc Funcs) ForcePayout(ctx wasmlib.ScFuncCallContext) *ForcePayoutCall
func (Funcs) ForceReset ¶
func (sc Funcs) ForceReset(ctx wasmlib.ScFuncCallContext) *ForceResetCall
func (Funcs) LastWinningNumber ¶
func (sc Funcs) LastWinningNumber(ctx wasmlib.ScViewCallContext) *LastWinningNumberCall
func (Funcs) PayWinners ¶
func (sc Funcs) PayWinners(ctx wasmlib.ScFuncCallContext) *PayWinnersCall
func (Funcs) PlaceBet ¶
func (sc Funcs) PlaceBet(ctx wasmlib.ScFuncCallContext) *PlaceBetCall
func (Funcs) PlayPeriod ¶
func (sc Funcs) PlayPeriod(ctx wasmlib.ScFuncCallContext) *PlayPeriodCall
func (Funcs) RoundNumber ¶
func (sc Funcs) RoundNumber(ctx wasmlib.ScViewCallContext) *RoundNumberCall
func (Funcs) RoundStartedAt ¶
func (sc Funcs) RoundStartedAt(ctx wasmlib.ScViewCallContext) *RoundStartedAtCall
func (Funcs) RoundStatus ¶
func (sc Funcs) RoundStatus(ctx wasmlib.ScViewCallContext) *RoundStatusCall
type ImmutableBet ¶
type ImmutableBet struct {
// contains filtered or unexported fields
}
func (ImmutableBet) Exists ¶
func (o ImmutableBet) Exists() bool
func (ImmutableBet) Value ¶
func (o ImmutableBet) Value() *Bet
type ImmutableFairRouletteState ¶
type ImmutableFairRouletteState struct {
// contains filtered or unexported fields
}
func (ImmutableFairRouletteState) Bets ¶
func (s ImmutableFairRouletteState) Bets() ArrayOfImmutableBet
func (ImmutableFairRouletteState) LastWinningNumber ¶
func (s ImmutableFairRouletteState) LastWinningNumber() wasmlib.ScImmutableInt64
func (ImmutableFairRouletteState) PlayPeriod ¶
func (s ImmutableFairRouletteState) PlayPeriod() wasmlib.ScImmutableInt32
func (ImmutableFairRouletteState) RoundNumber ¶
func (s ImmutableFairRouletteState) RoundNumber() wasmlib.ScImmutableInt64
func (ImmutableFairRouletteState) RoundStartedAt ¶
func (s ImmutableFairRouletteState) RoundStartedAt() wasmlib.ScImmutableInt32
func (ImmutableFairRouletteState) RoundStatus ¶
func (s ImmutableFairRouletteState) RoundStatus() wasmlib.ScImmutableInt16
type ImmutableLastWinningNumberResults ¶
type ImmutableLastWinningNumberResults struct {
// contains filtered or unexported fields
}
func (ImmutableLastWinningNumberResults) LastWinningNumber ¶
func (s ImmutableLastWinningNumberResults) LastWinningNumber() wasmlib.ScImmutableInt64
type ImmutablePlaceBetParams ¶
type ImmutablePlaceBetParams struct {
// contains filtered or unexported fields
}
func (ImmutablePlaceBetParams) Number ¶
func (s ImmutablePlaceBetParams) Number() wasmlib.ScImmutableInt64
type ImmutablePlayPeriodParams ¶
type ImmutablePlayPeriodParams struct {
// contains filtered or unexported fields
}
func (ImmutablePlayPeriodParams) PlayPeriod ¶
func (s ImmutablePlayPeriodParams) PlayPeriod() wasmlib.ScImmutableInt32
type ImmutableRoundNumberResults ¶
type ImmutableRoundNumberResults struct {
// contains filtered or unexported fields
}
func (ImmutableRoundNumberResults) RoundNumber ¶
func (s ImmutableRoundNumberResults) RoundNumber() wasmlib.ScImmutableInt64
type ImmutableRoundStartedAtResults ¶
type ImmutableRoundStartedAtResults struct {
// contains filtered or unexported fields
}
func (ImmutableRoundStartedAtResults) RoundStartedAt ¶
func (s ImmutableRoundStartedAtResults) RoundStartedAt() wasmlib.ScImmutableInt32
type ImmutableRoundStatusResults ¶
type ImmutableRoundStatusResults struct {
// contains filtered or unexported fields
}
func (ImmutableRoundStatusResults) RoundStatus ¶
func (s ImmutableRoundStatusResults) RoundStatus() wasmlib.ScImmutableInt16
type LastWinningNumberCall ¶
type LastWinningNumberCall struct { Func *wasmlib.ScView Results ImmutableLastWinningNumberResults }
type LastWinningNumberContext ¶
type LastWinningNumberContext struct { Results MutableLastWinningNumberResults State ImmutableFairRouletteState }
type MutableBet ¶
type MutableBet struct {
// contains filtered or unexported fields
}
func (MutableBet) Exists ¶
func (o MutableBet) Exists() bool
func (MutableBet) SetValue ¶
func (o MutableBet) SetValue(value *Bet)
func (MutableBet) Value ¶
func (o MutableBet) Value() *Bet
type MutableFairRouletteState ¶
type MutableFairRouletteState struct {
// contains filtered or unexported fields
}
func (MutableFairRouletteState) Bets ¶
func (s MutableFairRouletteState) Bets() ArrayOfMutableBet
func (MutableFairRouletteState) LastWinningNumber ¶
func (s MutableFairRouletteState) LastWinningNumber() wasmlib.ScMutableInt64
func (MutableFairRouletteState) PlayPeriod ¶
func (s MutableFairRouletteState) PlayPeriod() wasmlib.ScMutableInt32
func (MutableFairRouletteState) RoundNumber ¶
func (s MutableFairRouletteState) RoundNumber() wasmlib.ScMutableInt64
func (MutableFairRouletteState) RoundStartedAt ¶
func (s MutableFairRouletteState) RoundStartedAt() wasmlib.ScMutableInt32
func (MutableFairRouletteState) RoundStatus ¶
func (s MutableFairRouletteState) RoundStatus() wasmlib.ScMutableInt16
type MutableLastWinningNumberResults ¶
type MutableLastWinningNumberResults struct {
// contains filtered or unexported fields
}
func (MutableLastWinningNumberResults) LastWinningNumber ¶
func (s MutableLastWinningNumberResults) LastWinningNumber() wasmlib.ScMutableInt64
type MutablePlaceBetParams ¶
type MutablePlaceBetParams struct {
// contains filtered or unexported fields
}
func (MutablePlaceBetParams) Number ¶
func (s MutablePlaceBetParams) Number() wasmlib.ScMutableInt64
type MutablePlayPeriodParams ¶
type MutablePlayPeriodParams struct {
// contains filtered or unexported fields
}
func (MutablePlayPeriodParams) PlayPeriod ¶
func (s MutablePlayPeriodParams) PlayPeriod() wasmlib.ScMutableInt32
type MutableRoundNumberResults ¶
type MutableRoundNumberResults struct {
// contains filtered or unexported fields
}
func (MutableRoundNumberResults) RoundNumber ¶
func (s MutableRoundNumberResults) RoundNumber() wasmlib.ScMutableInt64
type MutableRoundStartedAtResults ¶
type MutableRoundStartedAtResults struct {
// contains filtered or unexported fields
}
func (MutableRoundStartedAtResults) RoundStartedAt ¶
func (s MutableRoundStartedAtResults) RoundStartedAt() wasmlib.ScMutableInt32
type MutableRoundStatusResults ¶
type MutableRoundStatusResults struct {
// contains filtered or unexported fields
}
func (MutableRoundStatusResults) RoundStatus ¶
func (s MutableRoundStatusResults) RoundStatus() wasmlib.ScMutableInt16
type PayWinnersCall ¶
type PayWinnersContext ¶
type PayWinnersContext struct {
State MutableFairRouletteState
}
type PlaceBetCall ¶
type PlaceBetCall struct { Func *wasmlib.ScFunc Params MutablePlaceBetParams }
type PlaceBetContext ¶
type PlaceBetContext struct { Params ImmutablePlaceBetParams State MutableFairRouletteState }
type PlayPeriodCall ¶
type PlayPeriodCall struct { Func *wasmlib.ScFunc Params MutablePlayPeriodParams }
type PlayPeriodContext ¶
type PlayPeriodContext struct { Params ImmutablePlayPeriodParams State MutableFairRouletteState }
type RoundNumberCall ¶
type RoundNumberCall struct { Func *wasmlib.ScView Results ImmutableRoundNumberResults }
type RoundNumberContext ¶
type RoundNumberContext struct { Results MutableRoundNumberResults State ImmutableFairRouletteState }
type RoundStartedAtCall ¶
type RoundStartedAtCall struct { Func *wasmlib.ScView Results ImmutableRoundStartedAtResults }
type RoundStartedAtContext ¶
type RoundStartedAtContext struct { Results MutableRoundStartedAtResults State ImmutableFairRouletteState }
type RoundStatusCall ¶
type RoundStatusCall struct { Func *wasmlib.ScView Results ImmutableRoundStatusResults }
type RoundStatusContext ¶
type RoundStatusContext struct { Results MutableRoundStatusResults State ImmutableFairRouletteState }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.