StatefulGameHelper
@totemsdk/server / StatefulGameHelper
Class: StatefulGameHelper
Stateful Game Helper
Creates multi-round stateful contracts (like coin flip).
Constructors
Constructor
new StatefulGameHelper():
StatefulGameHelper
Returns
StatefulGameHelper
Methods
buildNextRoundState()
staticbuildNextRoundState(currentRound,preservedPorts,newStates):StateValue[]
Build state for next round.
Parameters
currentRound
number
preservedPorts
number[]
newStates
Returns
createRoundCheck()
staticcreateRoundCheck():string
Create a round increment assertion.
Returns
string
validateRound()
staticvalidateRound(previousRound,currentRound):boolean
Validate round progression.
Parameters
previousRound
number
currentRound
number
Returns
boolean